dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34152 )
Change subject: sim-rest-server: do not select ADF.USIM in connect_to_card
......................................................................
sim-rest-server: do not select ADF.USIM in connect_to_card
When the function connect_to_card is done, it selects ADF.USIM. This
might be contraproductive in case someone needs to access files on MF
level in one of the REST methods. Instead fo ADF.USIM, let's use MF as a
common ground to start from.
At the moment the only existing REST (info, auth) immediately select
ADF.USIM after calling connect_to_card already, so there are no further
modifications necessary.
Related: RT#67094
Change-Id: I16e7f3c991c83f81989ecc4e4764bb6cc799c01d
---
M contrib/sim-rest-server.py
1 file changed, 22 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/52/34152/1
diff --git a/contrib/sim-rest-server.py b/contrib/sim-rest-server.py
index f2ed63e..ccf4430 100755
--- a/contrib/sim-rest-server.py
+++ b/contrib/sim-rest-server.py
@@ -46,7 +46,9 @@
scc.sel_ctrl = "0004"
card.read_aids()
- card.select_adf_by_aid(adf='usim')
+
+ # ensure that MF is selected when we are done.
+ card._scc.select_file('3f00')
return tp, scc, card
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34152
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I16e7f3c991c83f81989ecc4e4764bb6cc799c01d
Gerrit-Change-Number: 34152
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34155 )
Change subject: sim-reset-server: fix error printing sw_match_error
......................................................................
sim-reset-server: fix error printing sw_match_error
When a status word other than 9862 or 6982 is received, then
failure.value is included in the error message string. Unfortunately the
value object cannot be converted to string. An exception is raised:
builtins.TypeError: decoding to str: need a bytes-like object, ApiError found
To fix this, let's exclude failure.value from the string.
Related: OS#67094
Change-Id: I5a1d19abeb00c2c9dc26517abc44a5c916f2d658
---
M contrib/sim-rest-server.py
1 file changed, 19 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/55/34155/1
diff --git a/contrib/sim-rest-server.py b/contrib/sim-rest-server.py
index 83fb377..ed5176b 100755
--- a/contrib/sim-rest-server.py
+++ b/contrib/sim-rest-server.py
@@ -101,7 +101,7 @@
elif sw == '6982':
return str(ApiError("Security Status not satisfied - Card PIN enabled?", sw))
else:
- return str(ApiError("Card Communication Error %s" % failure.value), sw)
+ return str(ApiError("Card Communication Error", sw))
@app.route('/sim-auth-api/v1/slot/<int:slot>')
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34155
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I5a1d19abeb00c2c9dc26517abc44a5c916f2d658
Gerrit-Change-Number: 34155
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/34151 )
Change subject: cards: get rid of method read_iccid
......................................................................
cards: get rid of method read_iccid
The method read_iccid in class CardBase should be put back to
legacy/cards.py. The reason for this is that it falls in the same
category like read_imsi, read_ki, etc. We should not use those old
methods in future programs since we have a more modern infrastructure
(lchan) now.
Also pySim-shell.py is the only caller of this method now. It is not
used in any other place.
Related: RT#67094
Change-Id: Ied3ae6fd107992abcc1b5ea3edb0eb4bdcd2f892
---
M pySim-shell.py
M pySim/cards.py
M pySim/legacy/cards.py
3 files changed, 32 insertions(+), 11 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/51/34151/1
diff --git a/pySim-shell.py b/pySim-shell.py
index 2727a5b..af7dbca 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -52,7 +52,7 @@
from pySim.transport import init_reader, ApduTracer, argparse_add_reader_args, ProactiveHandler
from pySim.cards import card_detect, SimCardBase, UiccCardBase
from pySim.utils import h2b, b2h, i2h, swap_nibbles, rpad, JsonEncoder, bertlv_parse_one, sw_match
-from pySim.utils import sanitize_pin_adm, tabulate_str_list, boxed_heading_str, Hexstr
+from pySim.utils import sanitize_pin_adm, tabulate_str_list, boxed_heading_str, Hexstr, dec_iccid
from pySim.card_handler import CardHandler, CardHandlerAuto
from pySim.filesystem import CardDF, CardADF, CardModel, CardApplication
@@ -240,7 +240,10 @@
self.register_command_set(Iso7816Commands())
self.register_command_set(Ts102222Commands())
self.register_command_set(PySimCommands())
- self.iccid, sw = self.card.read_iccid()
+
+ self.lchan.select('MF/EF.ICCID', self)
+ self.iccid = dec_iccid(self.lchan.read_binary()[0])
+
self.lchan.select('MF', self)
rc = True
else:
diff --git a/pySim/cards.py b/pySim/cards.py
index c87c488..b1adcf2 100644
--- a/pySim/cards.py
+++ b/pySim/cards.py
@@ -23,7 +23,7 @@
#
from typing import Optional, Dict, Tuple
-from pySim.ts_102_221 import EF_DIR, EF_ICCID
+from pySim.ts_102_221 import EF_DIR
from pySim.ts_51_011 import DF_GSM
from pySim.transport import LinkBase
import abc
@@ -69,14 +69,6 @@
# callers having to do hasattr('read_aids') ahead of every call.
return []
- def read_iccid(self) -> Tuple[Optional[Hexstr], SwHexstr]:
- ef_iccid = EF_ICCID()
- (res, sw) = self._scc.read_binary(ef_iccid.fid)
- if sw == '9000':
- return (dec_iccid(res), sw)
- else:
- return (None, sw)
-
class SimCardBase(CardBase):
"""Here we only add methods for commands specified in TS 51.011, without
diff --git a/pySim/legacy/cards.py b/pySim/legacy/cards.py
index e64b5c3..496ce78 100644
--- a/pySim/legacy/cards.py
+++ b/pySim/legacy/cards.py
@@ -59,6 +59,13 @@
(res, sw) = self._scc.verify_chv(self._adm_chv_num, key)
return sw
+ def read_iccid(self):
+ (res, sw) = self._scc.read_binary(EF['ICCID'])
+ if sw == '9000':
+ return (dec_iccid(res), sw)
+ else:
+ return (None, sw)
+
def update_iccid(self, iccid):
data, sw = self._scc.update_binary(EF['ICCID'], enc_iccid(iccid))
return sw
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/34151
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Ied3ae6fd107992abcc1b5ea3edb0eb4bdcd2f892
Gerrit-Change-Number: 34151
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange
keith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-mgw/+/34150 )
Change subject: vty: include local port when dumping RTP conns
......................................................................
vty: include local port when dumping RTP conns
The CONN pairs associated with each endpoint show remote RTP
ports. When osmo-mgw is being used by both BSC and MSC, one
side of the pair is showing the internal loop connection inside
osmo-mgw, while my intuition suggested this connection pair
is showing me the RTP port tuple of a single RTP stream. Adding
the local port to the display makes it more clear, IMHO.
Seeing the local port can also help to correlate the MGW vty
dump with a capture of RTP.
Change-Id: Ib89a6779e1d68c6600f00699d4303f6c0ee07132
---
M src/libosmo-mgcp/mgcp_conn.c
1 file changed, 20 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-mgw refs/changes/50/34150/1
diff --git a/src/libosmo-mgcp/mgcp_conn.c b/src/libosmo-mgcp/mgcp_conn.c
index 0ba10e5..b756736 100644
--- a/src/libosmo-mgcp/mgcp_conn.c
+++ b/src/libosmo-mgcp/mgcp_conn.c
@@ -370,9 +370,10 @@
case MGCP_RTP_DEFAULT:
/* Dump RTP connection */
snprintf(str, sizeof(str), "(%s/rtp, id:0x%s, ip:%s, "
- "rtp:%u rtcp:%u)",
+ "rtp:%u<->%u rtcp:%u)",
conn->name, conn->id,
osmo_sockaddr_ntop(&conn->u.rtp.end.addr.u.sa, ipbuf),
+ conn->u.rtp.end.local_port,
osmo_sockaddr_port(&conn->u.rtp.end.addr.u.sa),
ntohs(conn->u.rtp.end.rtcp_port));
break;
--
To view, visit https://gerrit.osmocom.org/c/osmo-mgw/+/34150
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-mgw
Gerrit-Branch: master
Gerrit-Change-Id: Ib89a6779e1d68c6600f00699d4303f6c0ee07132
Gerrit-Change-Number: 34150
Gerrit-PatchSet: 1
Gerrit-Owner: keith <keith(a)rhizomatica.org>
Gerrit-MessageType: newchange
Attention is currently required from: pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/34122 )
Change subject: sgsn_rim: forward message based on RIM ROUTING ADDRESS
......................................................................
Patch Set 3:
(1 comment)
File src/sgsn/sgsn_libgtp.c:
https://gerrit.osmocom.org/c/osmo-sgsn/+/34122/comment/fe234a04_2ee2e559
PS2, Line 706: uint8_t rim_ra_discr_encoded[1024];
> having 1024 byte buffer for a 1 byte field seems a bit overkill. Same for routing address. […]
Lets use 256 bytes for the RIM ROUTING ADDRESS
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/34122
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ifd2b915ed2f05130cff8ee77714b82005c17de3d
Gerrit-Change-Number: 34122
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 15 Aug 2023 10:23:57 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
Hello Jenkins Builder,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/34122
to look at the new patch set (#3).
Change subject: sgsn_rim: forward message based on RIM ROUTING ADDRESS
......................................................................
sgsn_rim: forward message based on RIM ROUTING ADDRESS
At the moment we parse the RAN TRANSPARENT CONTAINER to look at the
destination RIM ROUTING INFORMATION. This is not corredt. The SGSN
should not decode the RAN TRANSPARENT CONTAINER and use the RIM ROUTING
ADDRESS / RIM ROUTING ADDRESS DISCRIMINATOR IE to make the routing
decision.
Related: OS#6095
Depends: libosmocore.git Ibca1f08906c4ffeecdae80d4e91c6c7b05fe4f8a
Change-Id: Ifd2b915ed2f05130cff8ee77714b82005c17de3d
---
M include/osmocom/sgsn/sgsn_rim.h
M src/sgsn/sgsn_libgtp.c
M src/sgsn/sgsn_rim.c
3 files changed, 86 insertions(+), 14 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/22/34122/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/34122
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ifd2b915ed2f05130cff8ee77714b82005c17de3d
Gerrit-Change-Number: 34122
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset
dexter has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34077 )
Change subject: SGSN_Tests: add RIM ROUTING ADDRESS field in request
......................................................................
SGSN_Tests: add RIM ROUTING ADDRESS field in request
When sending the RAN INFORMATION REQUEST on GTP-C, we do not add a RIM
ROUTING ADDRESS + RIM ROUTING ADDRESS DISCRIMINATOR field. Those fields
are optional but commonly added so that the SGSN does not have to
disassemble the RAN TRANSPARENT CONTAINTER to know the destination
address.
see also: 3gpp TS 29.060, section 7.5.14 and
3GPP TS 23.060, section 8.1.5.2.2
Change-Id: Id944c66f28d787a18c6c6f7c9dc885997d83e94c
Related: OS#6095
---
M sgsn/SGSN_Tests.ttcn
1 file changed, 27 insertions(+), 1 deletion(-)
Approvals:
laforge: Looks good to me, approved
pespin: Looks good to me, but someone else must approve
Jenkins Builder: Verified
diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn
index ac25caa..4af44ee 100644
--- a/sgsn/SGSN_Tests.ttcn
+++ b/sgsn/SGSN_Tests.ttcn
@@ -3478,6 +3478,8 @@
var template (value) RIM_Routing_Address_GTPC gtpc_dst_addr, gtpc_src_addr;
var template (value) RAN_Information_Request_RIM_Container_GTPC gtpc_rim_req_cont;
var template (value) PDU_BSSGP_RAN_INFORMATION_REQUEST_GTPC gtpc_bssgp_cont;
+ var template (value) RIM_RoutingAddress gtpc_rim_ra;
+ var template (value) RIM_RoutingAddress_Discriminator gtpc_rim_ra_discr;
var template (value) Gtp1cUnitdata gtpc_pdu;
gtpc_dst_addr := t_GTPC_RIM_Routing_Address_cid(gtp_ci);
@@ -3492,7 +3494,12 @@
gtpc_bssgp_cont := ts_GTPC_RAN_Information_Request(ts_GTPC_RIM_Routing_Information(RIM_ADDR_GERAN_CELL_ID, gtpc_dst_addr),
ts_GTPC_RIM_Routing_Information(RIM_ADDR_EUTRAN_NODEB_ID, gtpc_src_addr),
gtpc_rim_req_cont);
- gtpc_pdu := ts_GTPC_RANInfoRelay(peer, ts_RANTransparentContainer_RAN_INFO_REQ(gtpc_bssgp_cont));
+
+ /* Assemble RIM Routing Address (essentially a copy of the destination cell identifier)*/
+ gtpc_rim_ra := ts_RIM_RoutingAddress(enc_RIM_Routing_Address_GTPC(valueof(gtpc_dst_addr)));
+ gtpc_rim_ra_discr := ts_RIM_RoutingAddress_Discriminator(hex2bit(RIM_ADDR_GERAN_CELL_ID));
+ gtpc_pdu := ts_GTPC_RANInfoRelay(peer, ts_RANTransparentContainer_RAN_INFO_REQ(gtpc_bssgp_cont),
+ gtpc_rim_ra, gtpc_rim_ra_discr);
GTPC.send(gtpc_pdu);
var template RIM_Routing_Address bssgp_dst_addr, bssgp_src_addr;
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34077
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: Id944c66f28d787a18c6c6f7c9dc885997d83e94c
Gerrit-Change-Number: 34077
Gerrit-PatchSet: 5
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: merged
Attention is currently required from: pespin.
dexter has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34109 )
Change subject: PCUIF_Codec port, do not return fn in f_PCUIF_tx_imm_ass_pch
......................................................................
Patch Set 3:
(1 comment)
File library/PCUIF_CodecPort.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34109/comment/8de40831_e797…
PS2, Line 187: return 0;
> If it's not useful, then change this function to return void.
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34109
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0e5bad7a0d74e5032f2818f6fdf5b9b2ecb531cc
Gerrit-Change-Number: 34109
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Tue, 15 Aug 2023 09:27:00 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: comment
Attention is currently required from: pespin.
Hello Jenkins Builder, pespin,
I'd like you to reexamine a change. Please visit
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34109
to look at the new patch set (#3).
Change subject: PCUIF_Codec port, do not return fn in f_PCUIF_tx_imm_ass_pch
......................................................................
PCUIF_Codec port, do not return fn in f_PCUIF_tx_imm_ass_pch
The function f_PCUIF_tx_imm_ass_pch() retuns the frame number, that is
sent back from osmo-bts via PCUIF / gsm_pcu_if_data_cnf_dt. Since we are
about to remove this field from gsm_pcu_if_data_cnf_dt, lets no longer
access it here as well. Also the return code is never used anywhere in
the tests. (In osmo-pcu the fn parameter was used for logging only, in
osmo-bts it was set to constant 0)
Related: OS#5927
Change-Id: I0e5bad7a0d74e5032f2818f6fdf5b9b2ecb531cc
---
M bts/BTS_Tests.ttcn
M library/PCUIF_CodecPort.ttcn
2 files changed, 23 insertions(+), 7 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/09/34109/3
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/34109
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ttcn3-hacks
Gerrit-Branch: master
Gerrit-Change-Id: I0e5bad7a0d74e5032f2818f6fdf5b9b2ecb531cc
Gerrit-Change-Number: 34109
Gerrit-PatchSet: 3
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newpatchset