pespin has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37646?usp=email )
Change subject: sgsn: Introduce test TC_pmm_idle_rx_mt_data
......................................................................
Set Ready For Review
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37646?usp=email
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: I35d660b8e546f6ce0af8c05d7b5c56833a26fb76
Gerrit-Change-Number: 37646
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Comment-Date: Fri, 26 Jul 2024 17:29:08 +0000
Gerrit-HasComments: No
Gerrit-Has-Labels: No
Gerrit-MessageType: comment
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/37644?usp=email )
Change subject: Announce SGSN own TEID during UpdatePDPCtxReq after UE goes PMM-IDLE
......................................................................
Announce SGSN own TEID during UpdatePDPCtxReq after UE goes PMM-IDLE
When the UE/RNC closes the Iu conn (while keeping the PDP Context
activated), the SGSN updates the GGSN to point the GTPU tunnel to
itself. Unfortunately, only the IP address was being updated while the
TEID was kept the same (the one from the RNC).
As a result, when new MT data arrived at the GGSN, it would forward it
over GTPU to the SGSN using the incorrect RNC TEID, which the libgtp
stack at osmo-sgsn would silently drop due to not being known (because
it was >PDP_MAX=1024).
The issue can be triggered in test SGSN_Tests_Iu.TC_pmm_idle_rx_mt_data.
Related: OS#5773
Related: SYS#5435
Change-Id: I782aa43c71569922a945bd44544bb1388bf8c878
---
M include/osmocom/sgsn/pdpctx.h
M src/sgsn/gprs_mm_state_iu_fsm.c
M src/sgsn/sgsn_libgtp.c
3 files changed, 36 insertions(+), 3 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/44/37644/1
diff --git a/include/osmocom/sgsn/pdpctx.h b/include/osmocom/sgsn/pdpctx.h
index f3cf0ed..39d744a 100644
--- a/include/osmocom/sgsn/pdpctx.h
+++ b/include/osmocom/sgsn/pdpctx.h
@@ -69,6 +69,9 @@
uint8_t radio_prio;
//uint32_t charging_id;
bool ue_pdp_active; /* PDP Context is active for this NSAPI? */
+ /* Keeps original SGSN local TEID when lib->teid_own is updated with
+ * RNC's TEID upon use of Direct Tunnel feature: */
+ uint32_t sgsn_teid_own;
struct osmo_timer_list timer;
unsigned int T; /* Txxxx number */
diff --git a/src/sgsn/gprs_mm_state_iu_fsm.c b/src/sgsn/gprs_mm_state_iu_fsm.c
index b883278..b376d98 100644
--- a/src/sgsn/gprs_mm_state_iu_fsm.c
+++ b/src/sgsn/gprs_mm_state_iu_fsm.c
@@ -49,9 +49,11 @@
char buf[INET_ADDRSTRLEN];
struct sgsn_pdp_ctx *pdp;
llist_for_each_entry(pdp, &mm_ctx->pdp_list, list) {
- LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s -> %s\n",
- sgsn_gtp_ntoa(&pdp->lib->gsnlu),
- inet_ntop(AF_INET, &sgsn->cfg.gtp_listenaddr.sin_addr, buf, sizeof(buf)));
+ LOGMMCTXP(LOGL_INFO, mm_ctx, "Changing GTP-U endpoints %s/0x%08x -> %s/0x%08x\n",
+ sgsn_gtp_ntoa(&pdp->lib->gsnlu), pdp->lib->teid_own,
+ inet_ntop(AF_INET, &sgsn->cfg.gtp_listenaddr.sin_addr, buf, sizeof(buf)),
+ pdp->sgsn_teid_own);
+ pdp->lib->teid_own = pdp->sgsn_teid_own;
/* Disable Direct Tunnel Flags DTI: */
pdp->lib->dir_tun_flags.l = 1;
pdp->lib->dir_tun_flags.v[0] &= 0xFE;
diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c
index 4885ada..f497609 100644
--- a/src/sgsn/sgsn_libgtp.c
+++ b/src/sgsn/sgsn_libgtp.c
@@ -166,6 +166,9 @@
pdp->priv = pctx;
pctx->lib = pdp;
+ /* Back up our own local TEID in case we update the library one with RNC TEID when setting up Direct Tunnel: */
+ pctx->sgsn_teid_own = pdp->teid_own;
+
//pdp->peer = /* sockaddr_in of GGSN (receive) */
//pdp->ipif = /* not used by library */
pdp->version = ggsn->gtp_version;
@@ -783,6 +786,8 @@
#ifdef BUILD_IU
/* Ignore the packet for now and page the UE to get the RAB
* reestablished */
+ LOGMMCTXP(LOGL_INFO, mm, "Rx GTP for UE in PMM state %s, paging it\n",
+ osmo_fsm_inst_state_name(mm->iu.mm_state_fsm));
ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac);
return 0;
--
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/37644?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: I782aa43c71569922a945bd44544bb1388bf8c878
Gerrit-Change-Number: 37644
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-MessageType: newchange
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/37643?usp=email )
Change subject: ara_m: add export support for the ARA-M application
......................................................................
ara_m: add export support for the ARA-M application
This patch adds an export method to the CardApplicationARAM class.
This method reads the ARA-M configuration and transforms it into
executeable command lines, which can be executed as a script later
to restore an ARA-M configuration.
Related: OS#6092
Change-Id: I811cb9d25cb8ee194b4ead5fb2cabf1fdc0c1c43
---
M pySim/ara_m.py
1 file changed, 86 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/43/37643/1
diff --git a/pySim/ara_m.py b/pySim/ara_m.py
index c283cf0..c327e13 100644
--- a/pySim/ara_m.py
+++ b/pySim/ara_m.py
@@ -415,3 +415,74 @@
class CardApplicationARAM(CardApplication):
def __init__(self):
super().__init__('ARA-M', adf=ADF_ARAM(), sw=sw_aram)
+
+ @staticmethod
+ def export(as_json: bool, lchan):
+
+ # TODO: Add JSON output as soon as aram_store_ref_ar_do is able to process input in JSON format.
+ if as_json:
+ raise NotImplementedError("res_do encoder not yet implemented. Patches welcome.")
+
+ export_str = ""
+ export_str += "aram_delete_all\n"
+
+ res_do = ADF_ARAM.get_all(lchan.scc._tp)
+ if res_do:
+ for res_do_dict in res_do.to_dict():
+ if 'response_all_ref_ar_do' in res_do_dict and res_do_dict['response_all_ref_ar_do']:
+ for ref_ar_do_list in res_do_dict['response_all_ref_ar_do']:
+ ref_do_list = None
+ ar_do_list = None
+ if 'ref_ar_do' in ref_ar_do_list:
+ for ref_ar_do in ref_ar_do_list['ref_ar_do']:
+ if 'ref_do' in ref_ar_do:
+ ref_do_list = ref_ar_do['ref_do']
+ if 'ar_do' in ref_ar_do:
+ ar_do_list = ref_ar_do['ar_do']
+
+ if ref_do_list and ar_do_list:
+ aid_ref_do = None
+ dev_app_id_ref_do = None
+ apdu_ar_do = None
+ nfc_ar_do = None
+ perm_ar_do = None
+ pkg_ref_do = None
+ for ref_do in ref_do_list:
+ if 'aid_ref_do' in ref_do:
+ aid_ref_do = ref_do['aid_ref_do']
+ if 'dev_app_id_ref_do' in ref_do:
+ dev_app_id_ref_do = ref_do['dev_app_id_ref_do']
+ if 'pkg_ref_do' in ref_do:
+ pkg_ref_do = ref_do['pkg_ref_do']
+ for ar_do in ar_do_list:
+ if 'apdu_ar_do' in ar_do:
+ apdu_ar_do = ar_do['apdu_ar_do']
+ if 'nfc_ar_do' in ar_do:
+ nfc_ar_do = ar_do['nfc_ar_do']
+ if 'perm_ar_do' in ar_do:
+ perm_ar_do = ar_do['perm_ar_do']
+
+ # Write command-line
+ export_str += "aram_store_ref_ar_do"
+ if aid_ref_do:
+ export_str += (" --aid %s" % aid_ref_do)
+ else:
+ export_str += " --aid-empty"
+ if dev_app_id_ref_do:
+ export_str += (" --device-app-id %s" % dev_app_id_ref_do)
+ if apdu_ar_do and 'generic_access_rule' in apdu_ar_do:
+ export_str += (" --apdu-%s" % apdu_ar_do['generic_access_rule'])
+ elif apdu_ar_do and 'apdu_filter' in apdu_ar_do:
+ export_str += (" --apdu-filter ")
+ for apdu_filter in apdu_ar_do['apdu_filter']:
+ export_str += apdu_filter['header']
+ export_str += apdu_filter['mask']
+ if nfc_ar_do and 'nfc_event_access_rule' in nfc_ar_do:
+ export_str += (" --nfc-%s" % nfc_ar_do['nfc_event_access_rule'])
+ if perm_ar_do:
+ export_str += (" --android-permissions %s" % perm_ar_do['permissions'])
+ if pkg_ref_do:
+ export_str += (" --pkg-ref %s" % pkg_ref_do['package_name_string'])
+ export_str += "\n"
+
+ return export_str.strip()
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37643?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I811cb9d25cb8ee194b4ead5fb2cabf1fdc0c1c43
Gerrit-Change-Number: 37643
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/+/37637?usp=email )
Change subject: pySim-shell: fix comment formatting
......................................................................
pySim-shell: fix comment formatting
Related: OS#6092
Change-Id: Icea88c061436d26a3240fc666fcc3fe1bd36d2ba
---
M pySim-shell.py
1 file changed, 16 insertions(+), 6 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/37/37637/1
diff --git a/pySim-shell.py b/pySim-shell.py
index 8f654bd..168c916 100755
--- a/pySim-shell.py
+++ b/pySim-shell.py
@@ -813,14 +813,14 @@
@cmd2.with_argparser(activate_file_parser)
def do_activate_file(self, opts):
"""Activate the specified EF by sending an ACTIVATE FILE apdu command (used to be called REHABILITATE
-in TS 11.11 for classic SIM).
+ in TS 11.11 for classic SIM).
-This command is used to (re-)activate a file that is currently in deactivated (sometimes also called
-"invalidated") state. You need to call this from the DF above the to-be-activated EF and specify the name or
-FID of the file to activate.
+ This command is used to (re-)activate a file that is currently in deactivated (sometimes also called
+ "invalidated") state. You need to call this from the DF above the to-be-activated EF and specify the name or
+ FID of the file to activate.
-Note that for *deactivation* the to-be-deactivated EF must be selected, but for *activation*, the DF
-above the to-be-activated EF must be selected!"""
+ Note that for *deactivation* the to-be-deactivated EF must be selected, but for *activation*, the DF
+ above the to-be-activated EF must be selected!"""
(data, sw) = self._cmd.lchan.activate_file(opts.NAME)
def complete_activate_file(self, text, line, begidx, endidx) -> List[str]:
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37637?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: Icea88c061436d26a3240fc666fcc3fe1bd36d2ba
Gerrit-Change-Number: 37637
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/+/37642?usp=email )
Change subject: filesystem: add export method for ADF files
......................................................................
filesystem: add export method for ADF files
This patch adds an export method to CardADF, which calls the application
specific export method in CardApplication class
Related: OS#6092
Change-Id: I8129656096ecaf41b36e5f2afbbfbebcd0587886
---
M pySim/filesystem.py
1 file changed, 20 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/42/37642/1
diff --git a/pySim/filesystem.py b/pySim/filesystem.py
index 5414fb9..028b906 100644
--- a/pySim/filesystem.py
+++ b/pySim/filesystem.py
@@ -530,6 +530,13 @@
else:
return self.aid
+ @staticmethod
+ def export(as_json: bool, lchan):
+ """
+ Export application specific parameters that are not part of the eUICC filesystem.
+ """
+ return lchan.selected_file.application.export(as_json, lchan)
+
class CardEF(CardFile):
"""EF (Entry File) in the smart card filesystem"""
--
To view, visit https://gerrit.osmocom.org/c/pysim/+/37642?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings
Gerrit-Project: pysim
Gerrit-Branch: master
Gerrit-Change-Id: I8129656096ecaf41b36e5f2afbbfbebcd0587886
Gerrit-Change-Number: 37642
Gerrit-PatchSet: 1
Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
Gerrit-MessageType: newchange