lists.osmocom.org
Sign In Sign Up
Manage this list Sign In Sign Up

Keyboard Shortcuts

Thread View

  • j: Next unread message
  • k: Previous unread message
  • j a: Jump to all threads
  • j l: Jump to MailingList overview

gerrit-log

Thread Start a new thread
Download
Threads by month
  • ----- 2026 -----
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2025 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2024 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2023 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
  • ----- 2022 -----
  • December
  • November
  • October
  • September
  • August
  • July
  • June
  • May
  • April
  • March
  • February
  • January
gerrit-log@lists.osmocom.org

March 2026

  • 1 participants
  • 1933 discussions
[XS] Change in pysim[master]: pysim/pcsc: do not use getProtocol for protocol selection
by dexter 23 Mar '26

23 Mar '26
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/42475?usp=email ) Change subject: pysim/pcsc: do not use getProtocol for protocol selection ...................................................................... pysim/pcsc: do not use getProtocol for protocol selection The documentation of the getProtocol provided by pyscard says: "Return bit mask for the protocol of connection, or None if no protocol set. The return value is a bit mask of CardConnection.T0_protocol, CardConnection.T1_protocol, CardConnection.RAW_protocol, CardConnection.T15_protocol" This suggests that the purpose of getProtocol is not to determine which protocols are supported. Its purpose is to determine which protocol is currently selected (either through auto selection or through the explicit selection made by the API user). This means we are using getProtocol wrong. So far this was no problem, since the auto-selected protocol should be a supported protocol anyway. However, the automatic protocol selection may not always return a correct result (see bug report from THD-siegfried [1]). Let's not trust the automatic protocol selection. Instead let's parse the ATR and make the decision based on the TD1/TD2 bytes). [1] https://osmocom.org/issues/6952 Related: OS#6952 Change-Id: Ib119948aa68c430e42ac84daec8b9bd542db7963 --- M pySim/transport/pcsc.py 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/75/42475/1 diff --git a/pySim/transport/pcsc.py b/pySim/transport/pcsc.py index c92a3ba..1c1b5b2 100644 --- a/pySim/transport/pcsc.py +++ b/pySim/transport/pcsc.py @@ -26,6 +26,7 @@ from smartcard.Exceptions import NoCardException, CardRequestTimeoutException, CardConnectionException from smartcard.System import readers from smartcard.ExclusiveConnectCardConnection import ExclusiveConnectCardConnection +from smartcard.ATR import ATR from osmocom.utils import h2i, i2h, Hexstr @@ -85,12 +86,12 @@ # Make card connection and select a suitable communication protocol self._con.connect() - supported_protocols = self._con.getProtocol(); + atr = ATR(self._con.getATR()) self.disconnect() - if (supported_protocols & CardConnection.T0_protocol): - protocol = CardConnection.T0_protocol + if atr.isT0Supported(): + protocol = CardConnection.T0_protocol self.set_tpdu_format(0) - elif (supported_protocols & CardConnection.T1_protocol): + elif atr.isT1Supported(): protocol = CardConnection.T1_protocol self.set_tpdu_format(1) else: -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42475?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: Ib119948aa68c430e42ac84daec8b9bd542db7963 Gerrit-Change-Number: 42475 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ttcn3-hacks[master]: General_types.ttcn: Introduce type OCT4_20n
by pespin 23 Mar '26

23 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42471?usp=email ) Change subject: General_types.ttcn: Introduce type OCT4_20n ...................................................................... General_types.ttcn: Introduce type OCT4_20n This is useful to store EUAs of type v4,v6 or v4v6. Change-Id: I00a35c444e3fb498712fbb4b9c310375c527052f --- M library/General_Types.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/71/42471/1 diff --git a/library/General_Types.ttcn b/library/General_Types.ttcn index dca4ea2..1b9a732 100644 --- a/library/General_Types.ttcn +++ b/library/General_Types.ttcn @@ -155,6 +155,7 @@ type octetstring OCT3_17n length(3..17) with { variant "" }; type octetstring OCT4_8n length(4..8) with { variant "" }; type octetstring OCT4_16n length(4..16) with { variant "" }; + type octetstring OCT4_20n length(4..20) with { variant "" }; //**************************************************** -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42471?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I00a35c444e3fb498712fbb4b9c310375c527052f Gerrit-Change-Number: 42471 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTPv1U_Emulation: Clear entries from PidTable upon rx CUPS program_te...
by pespin 23 Mar '26

23 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42472?usp=email ) Change subject: GTPv1U_Emulation: Clear entries from PidTable upon rx CUPS program_term_ind ...................................................................... GTPv1U_Emulation: Clear entries from PidTable upon rx CUPS program_term_ind Otherwise it will evnetually run out of entries if enough commands are called sequentially. Change-Id: I7be2639761726c09e4ea6f75c57d8414c5dbf128 --- M library/GTPv1U_Emulation.ttcnpp 1 file changed, 32 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/72/42472/1 diff --git a/library/GTPv1U_Emulation.ttcnpp b/library/GTPv1U_Emulation.ttcnpp index 6146147..5ae847d 100644 --- a/library/GTPv1U_Emulation.ttcnpp +++ b/library/GTPv1U_Emulation.ttcnpp @@ -82,9 +82,9 @@ /* pid <-> ConnHdlr mapping (for UECUPS process termination indication) */ type record PidTableRec { /* process ID of the running process */ - integer pid, + integer pid optional, /* component that started it */ - GTP1U_ConnHdlr vc_conn + GTP1U_ConnHdlr vc_conn optional }; #endif @@ -113,8 +113,7 @@ private function f_comp_by_pid(integer pid) runs on GTPv1U_Emulation_CT return GTP1U_ConnHdlr { var integer i; for (i := 0; i < sizeof(PidTable); i := i+1) { - if (isbound(PidTable[i].pid) and PidTable[i].pid == pid) { - /* fixme: remove */ + if (ispresent(PidTable[i].pid) and PidTable[i].pid == pid) { return PidTable[i].vc_conn; } } @@ -136,10 +135,24 @@ } #ifdef GTP1U_EMULATION_HAVE_UECUPS +private function f_pid_clear(integer idx) runs on GTPv1U_Emulation_CT { + PidTable[idx].pid := omit; + PidTable[idx].vc_conn := omit; +} + +private function f_pid_tbl_init() runs on GTPv1U_Emulation_CT { + var integer i; + + /* Initialize the ConnectionTable */ + for (i := 0; i < sizeof(PidTable); i := i+1) { + f_pid_clear(i); + } +} + private function f_pid_tbl_add(integer pid, GTP1U_ConnHdlr vc_conn) runs on GTPv1U_Emulation_CT { var integer i; for (i := 0; i < sizeof(PidTable); i := i+1) { - if (not isbound(PidTable[i].pid)) { + if (not ispresent(PidTable[i].pid)) { PidTable[i].pid := pid; PidTable[i].vc_conn := vc_conn; return; @@ -147,6 +160,17 @@ } testcase.stop("No Space in PID Table for ", pid); } + +private function f_pid_tbl_del(integer pid) runs on GTPv1U_Emulation_CT { + var integer i; + for (i := 0; i < sizeof(PidTable); i := i+1) { + if (ispresent(PidTable[i].pid) and PidTable[i].pid == pid) { + f_pid_clear(i); + return; + } + } + testcase.stop("No Space in PID Table for ", pid); +} #endif @@ -209,6 +233,8 @@ g_c_seq_nr := f_rnd_int(65535); g_gtp1u_cfg := cfg; + f_pid_tbl_init(); + if (g_gtp1u_cfg.use_gtpu_daemon) { #ifdef GTP1U_EMULATION_HAVE_UECUPS map(self:UECUPS, system:UECUPS); @@ -241,8 +267,8 @@ /* handle incoming program_term_ind; dispatch to whatever component started the process */ [] UECUPS.receive(tr_UECUPS_RecvFrom_R({program_term_ind:=?})) -> value rx { vc_conn := f_comp_by_pid(rx.msg.program_term_ind.pid); + f_pid_tbl_del(rx.msg.program_term_ind.pid); CLIENT.send(rx.msg.program_term_ind) to vc_conn; - /* FIXME: remove from table */ repeat; } /* handle incoming ipv6_slaac_ind; dispatch to whatever component started the process */ -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42472?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I7be2639761726c09e4ea6f75c57d8414c5dbf128 Gerrit-Change-Number: 42472 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: 5gc: Introduce tests TC_ng_register_ping46(_256)
by pespin 23 Mar '26

23 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42473?usp=email ) Change subject: 5gc: Introduce tests TC_ng_register_ping46(_256) ...................................................................... 5gc: Introduce tests TC_ng_register_ping46(_256) Depends: osmo-uecups.git Change-Id Ic2da7a761a8df7e006fc02ca6557a48f371e4151 Change-Id: I9cb250f07ac356b7345a570ed71590f041168ed2 --- M 5gc/C5G_Tests.ttcn M 5gc/ConnHdlr.ttcn M 5gc/expected-results.xml M deps/Makefile 4 files changed, 113 insertions(+), 30 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/73/42473/1 diff --git a/5gc/C5G_Tests.ttcn b/5gc/C5G_Tests.ttcn index 7274daf..2f42729 100644 --- a/5gc/C5G_Tests.ttcn +++ b/5gc/C5G_Tests.ttcn @@ -91,7 +91,8 @@ cn_gtpu_ip := omit, cn_gtpu_teid := omit, qos_rules := omit, - ue_ip := omit, + ue_ip4 := omit, + ue_ip6 := omit, ipv6_interface_id := omit }; @@ -399,7 +400,7 @@ f_register(); f_pdu_sess_establish(pdu_sess_type := c_PDU_SessionType_IPv4); f_sleep(1.0); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); f_pdu_sess_release(); f_deregister(); } @@ -433,7 +434,7 @@ f_register(); f_pdu_sess_establish(pdu_sess_type := c_PDU_SessionType_IPv6); f_sleep(1.0); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); f_pdu_sess_release(); f_deregister(); } @@ -465,6 +466,44 @@ } } +private function f_TC_register_ping46() runs on ConnHdlr { + f_register(); + f_pdu_sess_establish(pdu_sess_type := c_PDU_SessionType_IPv4v6); + f_sleep(1.0); + f_ping(mp_ping_hostname); + /* Give some extra time for previous commands on all ConnHdlr finish, + * so we don't run out of PIDs in the PID table of GTPv1U_Emulation: */ + f_sleep(5.0); + f_ping(mp_ping_hostname6); + f_pdu_sess_release(); + f_deregister(); +} +testcase TC_ng_register_ping46() runs on MTC_CT { + f_init(); + f_ngap_setup(0); + + var ConnHdlrPars pars := f_init_pars(ue_idx := 0); + var ConnHdlr vc_conn; + vc_conn := f_start_handler_with_pars(refers(f_TC_register_ping46), pars); + vc_conn.done; +} +testcase TC_ng_register_ping46_256() runs on MTC_CT { + var ConnHdlr vc_conn[256]; + var integer i; + + f_init(); + f_ngap_setup(0); + + for (i := 0; i < sizeof(vc_conn); i := i + 1) { + var ConnHdlrPars pars := f_init_pars(ue_idx := i); + vc_conn[i] := f_start_handler_with_pars(refers(f_TC_register_ping46), pars); + } + + for (i := 0; i < sizeof(vc_conn); i := i + 1) { + vc_conn[i].done; + } +} + /* 3GPP TS 23.502 4.2.3.2 UE Triggered Service Request. * UE signals the active session as active, and it has UL data for it */ private function f_TC_ue_service_request_cm_idle_ul_data() runs on ConnHdlr { @@ -565,7 +604,7 @@ /* NOTE: In theory we should generate DL-originated traffic here, but since * UPF let our UL traffic pass (bug?), make use of it to generate some DL * traffic (ping reply) triggering the Paging: */ - var integer pid := f_ping4_async(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname, interval := 1, count := 1); + var integer pid := f_ping_async(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname, interval := 1, count := 1); NGAP.receive(mw_ngap_initMsg(mw_n2_Paging(?, ?))); log("Rx Paging") @@ -666,7 +705,7 @@ f_register(exp_registration_accept := exp_registration_accept); f_pdu_sess_establish(request_type := c_RequestType_initial_emergency_request); f_sleep(1.0); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); f_pdu_sess_release(); f_deregister(); } @@ -733,7 +772,7 @@ exp_registration_accept := exp_registration_accept); f_pdu_sess_establish(request_type := c_RequestType_initial_emergency_request); f_sleep(1.0); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); f_pdu_sess_release(); f_deregister(); } @@ -752,7 +791,7 @@ f_register(); f_pdu_sess_establish(); f_sleep(1.0); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); var NG_NAS_UE_State nus := f_ngap_obtain_nus(g_pars.ue_pars.ran_id); @@ -775,7 +814,8 @@ g_pars.ue_pars.sess_pars.cn_gtpu_ip := ho_xn_pars.sess_pars.cn_gtpu_ip; g_pars.ue_pars.sess_pars.cn_gtpu_teid := ho_xn_pars.sess_pars.cn_gtpu_teid; g_pars.ue_pars.sess_pars.qos_rules := ho_xn_pars.sess_pars.qos_rules; - g_pars.ue_pars.sess_pars.ue_ip := ho_xn_pars.sess_pars.ue_ip; + g_pars.ue_pars.sess_pars.ue_ip4 := ho_xn_pars.sess_pars.ue_ip4; + g_pars.ue_pars.sess_pars.ue_ip6 := ho_xn_pars.sess_pars.ue_ip6; g_pars.kset_id := ho_xn_pars.kset_id; f_n2_path_switch(ho_xn_pars.source_amf_id); @@ -783,7 +823,7 @@ f_sleep(1.0); f_pdu_sess_create_tun(); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); f_pdu_sess_release(); f_deregister(); @@ -815,7 +855,7 @@ f_register(); f_pdu_sess_establish(); f_sleep(1.0); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); var NG_NAS_UE_State nus := f_ngap_obtain_nus(g_pars.ue_pars.ran_id); @@ -850,7 +890,8 @@ g_pars.ue_pars.pti := ho_n2_pars.pti; g_pars.ue_pars.sess_pars.id := ho_n2_pars.sess_pars.id; g_pars.ue_pars.sess_pars.qos_rules := ho_n2_pars.sess_pars.qos_rules; - g_pars.ue_pars.sess_pars.ue_ip := ho_n2_pars.sess_pars.ue_ip; + g_pars.ue_pars.sess_pars.ue_ip4 := ho_n2_pars.sess_pars.ue_ip4; + g_pars.ue_pars.sess_pars.ue_ip6 := ho_n2_pars.sess_pars.ue_ip6; g_pars.kset_id := ho_n2_pars.kset_id; @@ -867,7 +908,7 @@ f_sleep(1.0); f_pdu_sess_create_tun(); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); f_pdu_sess_release(); f_deregister(); @@ -899,7 +940,7 @@ f_register(); f_pdu_sess_establish(); f_sleep(1.0); - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); /* 3GPP TS 23.502 4.9.1.3.2 step 1: */ f_n2_handover_required(m_targetID_targetRANNodeID(m_targetRANNodeID(g_pars.ngran_pars[1].global_ngran_id, @@ -911,7 +952,7 @@ f_n2_handover_cancel(); /* Test UE can still use the network after HO cancel: */ - f_ping4(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); + f_ping(g_pars.ue_pars.sess_pars.run_prog_pars.ping_hostname); f_pdu_sess_release(); f_deregister(); @@ -1012,6 +1053,9 @@ execute( TC_ng_register_ping6() ); execute( TC_ng_register_ping6_256() ); + execute( TC_ng_register_ping46() ); + execute( TC_ng_register_ping46_256() ); + execute( TC_ue_service_request_cm_idle_ul_data() ); execute( TC_ue_service_request_cm_idle_inact_sess() ); execute( TC_ue_service_request_cm_idle_unknown_sess_active() ); diff --git a/5gc/ConnHdlr.ttcn b/5gc/ConnHdlr.ttcn index cfd8c5a..a90bc64 100644 --- a/5gc/ConnHdlr.ttcn +++ b/5gc/ConnHdlr.ttcn @@ -73,7 +73,8 @@ charstring cn_gtpu_ip optional, OCT4 cn_gtpu_teid optional, QoS_RuleList qos_rules optional, - charstring ue_ip optional, + charstring ue_ip4 optional, + charstring ue_ip6 optional, octetstring ipv6_interface_id optional }; @@ -539,8 +540,8 @@ log("5GC assigned IPv6 global prefix: ", ipv6slaac_ind.ipv6_prefix, " -> ", f_inet6_ntoa(ipv6slaac_ind.ipv6_prefix & '0000000000000000'O)); /* Use the first global IPv6 address in the IPv6 prefix picked by osmo-uecups: */ - g_pars.ue_pars.sess_pars.ue_ip := f_inet6_ntoa(ipv6slaac_ind.ipv6_user_addr); - log("Using IPv6 global address: ", g_pars.ue_pars.sess_pars.ue_ip); + g_pars.ue_pars.sess_pars.ue_ip6 := f_inet6_ntoa(ipv6slaac_ind.ipv6_user_addr); + log("Using IPv6 global address: ", g_pars.ue_pars.sess_pars.ue_ip6); } /* 3GPP TS 23.502 4.3.2.2 UE Requested PDU Session Establishment */ @@ -574,8 +575,8 @@ log("5GC assigned CN GTPU Address: ", g_pars.ue_pars.sess_pars.cn_gtpu_ip, " TEID: ", g_pars.ue_pars.sess_pars.cn_gtpu_teid); select (pdu_sess_type) { case (c_PDU_SessionType_IPv4) { - g_pars.ue_pars.sess_pars.ue_ip := f_inet_ntoa(inner_nas.pdu_Session_Establishment_Accept.pduAddress.adressInfo); - log("5GC assigned UE IPv4 address: ", g_pars.ue_pars.sess_pars.ue_ip); + g_pars.ue_pars.sess_pars.ue_ip4 := f_inet_ntoa(inner_nas.pdu_Session_Establishment_Accept.pduAddress.adressInfo); + log("5GC assigned UE IPv4 address: ", g_pars.ue_pars.sess_pars.ue_ip4); if (configure_userplane) { f_pdu_sess_create_tun(IPV4); } @@ -585,13 +586,28 @@ log("5GC assigned IPv6 Interface Id: ", g_pars.ue_pars.sess_pars.ipv6_interface_id); /* Use the link-local address for now: */ var octetstring ll_addr := 'FE80000000000000'O & g_pars.ue_pars.sess_pars.ipv6_interface_id; - g_pars.ue_pars.sess_pars.ue_ip := f_inet6_ntoa(ll_addr); - log("5GC assigned IPv6 link-local Address: ", g_pars.ue_pars.sess_pars.ue_ip); + g_pars.ue_pars.sess_pars.ue_ip6 := f_inet6_ntoa(ll_addr); + log("5GC assigned IPv6 link-local Address: ", g_pars.ue_pars.sess_pars.ue_ip6); if (configure_userplane) { f_pdu_sess_create_tun(IPV6); f_perform_ipv6_slaac(); } } + case (c_PDU_SessionType_IPv4v6) { + var octetstring eua_v6 := substr(inner_nas.pdu_Session_Establishment_Accept.pduAddress.adressInfo, 0, 8); + var octetstring eua_v4 := substr(inner_nas.pdu_Session_Establishment_Accept.pduAddress.adressInfo, 8, 4); + g_pars.ue_pars.sess_pars.ue_ip4 := f_inet_ntoa(eua_v4); + log("5GC assigned UE IPv4 address: ", g_pars.ue_pars.sess_pars.ue_ip4); + g_pars.ue_pars.sess_pars.ipv6_interface_id := eua_v6; + log("5GC assigned IPv6 Interface Id: ", g_pars.ue_pars.sess_pars.ipv6_interface_id); + var octetstring ll_addr := 'FE80000000000000'O & g_pars.ue_pars.sess_pars.ipv6_interface_id; + g_pars.ue_pars.sess_pars.ue_ip6 := f_inet6_ntoa(ll_addr); + log("5GC assigned IPv6 link-local Address: ", g_pars.ue_pars.sess_pars.ue_ip6); + if (configure_userplane) { + f_pdu_sess_create_tun(IPV4V6); + f_perform_ipv6_slaac(); + } + } case (?) { setverdict(fail, "PDU Session Type not implemented"); } @@ -1291,7 +1307,8 @@ } g_pars.ue_pars.sess_pars.qos_rules := omit; - g_pars.ue_pars.sess_pars.ue_ip := omit; + g_pars.ue_pars.sess_pars.ue_ip4 := omit; + g_pars.ue_pars.sess_pars.ue_ip6 := omit; nas_ul_msg := cs_NG_PDU_SESSION_RELEASE_COMPLETE(cs_NG_PDU_SessionIdV(pdu_sess_id), pti, p_Cause := cs_GMM_GSM_Cause('59'O, cause_val)); @@ -1310,7 +1327,7 @@ var template (value) UECUPS_GtpExtHdr gtp_ext_hdr; var template (value) UECUPS_CreateTun uecups_create; var template (value) UECUPS_GtpExtHdr_PduSessContainer pdu_sess_cont; - var template (value) OCT4_16n user_addr; + var template (value) OCT4_20n user_addr; /* First of all, register the local TEID in the GTPv1U_Emulation: */ f_gtp1u_register_teid(g_pars.ue_pars.sess_pars.ran_gtpu_teid); @@ -1321,10 +1338,14 @@ select (valueof(user_addr_type)) { case (IPV4) { - user_addr := f_inet_addr(g_pars.ue_pars.sess_pars.ue_ip); + user_addr := f_inet_addr(g_pars.ue_pars.sess_pars.ue_ip4); } case (IPV6) { - user_addr := f_inet6_addr(g_pars.ue_pars.sess_pars.ue_ip); + user_addr := f_inet6_addr(g_pars.ue_pars.sess_pars.ue_ip6); + } + case (IPV4V6) { + user_addr := f_inet_addr(g_pars.ue_pars.sess_pars.ue_ip4) & + f_inet6_addr(g_pars.ue_pars.sess_pars.ue_ip6); } } @@ -1373,21 +1394,37 @@ } /* execute ping command and wait for result */ -function f_ping4(charstring host, integer interval := 1, integer count := 10) runs on ConnHdlr +function f_ping(charstring host, integer interval := 1, integer count := 10) runs on ConnHdlr { /* command will be filled in by f_gtp1u_ping4() below: */ var UECUPS_StartProgram sprog := f_run_prog_init(""); - f_gtp1u_ping4(sprog, host, interval, count, g_pars.ue_pars.sess_pars.ue_ip, + var charstring bind_addr; + + if (f_addr_is_ipv6(host)) { + bind_addr := g_pars.ue_pars.sess_pars.ue_ip6; + } else { + bind_addr := g_pars.ue_pars.sess_pars.ue_ip4; + } + + f_gtp1u_ping4(sprog, host, interval, count, bind_addr, redirect_output := true, redirect_output_path_prefix := f_run_prog_unique_log_path()); } -function f_ping4_async(charstring host, integer interval := 1, integer count := 10) runs on ConnHdlr return integer +function f_ping_async(charstring host, integer interval := 1, integer count := 10) runs on ConnHdlr return integer { /* command will be filled in by f_gtp1u_ping4() below: */ var UECUPS_StartProgram sprog := f_run_prog_init(""); + var charstring bind_addr; + + if (f_addr_is_ipv6(host)) { + bind_addr := g_pars.ue_pars.sess_pars.ue_ip6; + } else { + bind_addr := g_pars.ue_pars.sess_pars.ue_ip4; + } + var integer pid := f_gtp1u_ping4_async(sprog, host, - interval, count, g_pars.ue_pars.sess_pars.ue_ip, + interval, count, bind_addr, redirect_output := true, redirect_output_path_prefix := f_run_prog_unique_log_path()); return pid; diff --git a/5gc/expected-results.xml b/5gc/expected-results.xml index 9827df5..8581cf0 100644 --- a/5gc/expected-results.xml +++ b/5gc/expected-results.xml @@ -12,6 +12,8 @@ <testcase classname='C5G_Tests' name='TC_ng_register_ping4_256' time='MASKED'/> <testcase classname='C5G_Tests' name='TC_ng_register_ping6' time='MASKED'/> <testcase classname='C5G_Tests' name='TC_ng_register_ping6_256' time='MASKED'/> + <testcase classname='C5G_Tests' name='TC_ng_register_ping46' time='MASKED'/> + <testcase classname='C5G_Tests' name='TC_ng_register_ping46_256' time='MASKED'/> <testcase classname='C5G_Tests' name='TC_ue_service_request_cm_idle_ul_data' time='MASKED'/> <testcase classname='C5G_Tests' name='TC_ue_service_request_cm_idle_inact_sess' time='MASKED'/> <testcase classname='C5G_Tests' name='TC_ue_service_request_cm_idle_unknown_sess_active' time='MASKED'/> diff --git a/deps/Makefile b/deps/Makefile index d7aeed1..61dfe48 100644 --- a/deps/Makefile +++ b/deps/Makefile @@ -124,7 +124,7 @@ titan.TestPorts.UDPasp_commit= 54176e95850654e5e8b0ffa2f1b5f35c412b949c titan.TestPorts.UNIX_DOMAIN_SOCKETasp_commit= R.2.A-13-gd34ab71 titan.TestPorts.USB_commit= a9470fdc99c82fbf988f4508c3161118c9106e28 -osmo-uecups_commit= ca90fa48b8d44e241f55b1d15c9b7c8631ac4e69 +osmo-uecups_commit= ee9b225a66c2f84bcdcaf2fc27ee73d6aeb33b8e all: $(foreach dir,$(ALL_REPOS),$(dir)/update) clean: $(foreach dir,$(ALL_REPOS),$(dir)/clean) -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42473?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I9cb250f07ac356b7345a570ed71590f041168ed2 Gerrit-Change-Number: 42473 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: 5gc: Introduce tests TC_ng_register_ping6(_256)
by pespin 23 Mar '26

23 Mar '26
Attention is currently required from: fixeria, osmith. Hello Jenkins Builder, fixeria, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42460?usp=email to look at the new patch set (#3). The following approvals got outdated and were removed: Code-Review+1 by fixeria, Verified+1 by Jenkins Builder Change subject: 5gc: Introduce tests TC_ng_register_ping6(_256) ...................................................................... 5gc: Introduce tests TC_ng_register_ping6(_256) Change-Id: Iedf3697265b91bdda85e8d32402345ea8d58dc9f --- M 5gc/C5G_Tests.ttcn M 5gc/ConnHdlr.ttcn M 5gc/expected-results.xml M 5gc/open5gs/open5gs-upf.yaml M 5gc/testenv.sh 5 files changed, 108 insertions(+), 13 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/60/42460/3 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42460?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Iedf3697265b91bdda85e8d32402345ea8d58dc9f Gerrit-Change-Number: 42460 Gerrit-PatchSet: 3 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: GTPv1U_Emulation: Support IPv6 SLAAC with osmo-uecups
by pespin 23 Mar '26

23 Mar '26
Attention is currently required from: fixeria, laforge, osmith. Hello Jenkins Builder, fixeria, laforge, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42459?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Code-Review+1 by fixeria, Code-Review+1 by osmith, Verified+1 by Jenkins Builder Change subject: GTPv1U_Emulation: Support IPv6 SLAAC with osmo-uecups ...................................................................... GTPv1U_Emulation: Support IPv6 SLAAC with osmo-uecups Depends: osmo-uecups.git Change-Id I917b5c70f143d48b55b4e270e24594d1a36f71aa Change-Id: Ic368383ea65161297e57a298a12c7b4adc927142 --- M deps/Makefile M library/GTPv1U_Emulation.ttcnpp 2 files changed, 26 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/59/42459/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42459?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Ic368383ea65161297e57a298a12c7b4adc927142 Gerrit-Change-Number: 42459 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-uecups[master]: Support configuring IPv4v6 tunnels
by pespin 23 Mar '26

23 Mar '26
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-uecups/+/42470?usp=email ) Change subject: Support configuring IPv4v6 tunnels ...................................................................... Support configuring IPv4v6 tunnels Change-Id: Ic2da7a761a8df7e006fc02ca6557a48f371e4151 --- M daemon/cups_client.c M daemon/daemon_vty.c M daemon/gtp_endpoint.c M daemon/gtp_tunnel.c M daemon/internal.h M ttcn3/UECUPS_Types.ttcn 6 files changed, 138 insertions(+), 51 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-uecups refs/changes/70/42470/1 diff --git a/daemon/cups_client.c b/daemon/cups_client.c index f7c6f1a..a96861f 100644 --- a/daemon/cups_client.c +++ b/daemon/cups_client.c @@ -198,9 +198,9 @@ json_object_set_new(jslaac_ind, "ipv6_prefix", json_string(ipv6_str)); osmo_hexdump_buf(ipv6_str, sizeof(ipv6_str), - (const unsigned char *)&t->user_addr.u.sin6.sin6_addr, - sizeof(t->user_addr.u.sin6.sin6_addr), - "", true); + (const unsigned char *)&t->user_addr_ipv6_global.u.sin6.sin6_addr, + sizeof(t->user_addr_ipv6_global.u.sin6.sin6_addr), + "", true); json_object_set_new(jslaac_ind, "ipv6_user_addr", json_string(ipv6_str)); json_str = json_dumps(jtx, JSON_SORT_KEYS); @@ -265,21 +265,26 @@ return 0; } -static int parse_eua(struct osmo_sockaddr *out, json_t *jip, json_t *jaddr_type) +static int parse_eua(enum gtp1u_eua_type *user_addr_type, struct osmo_sockaddr *out4, + struct osmo_sockaddr *out6, json_t *jip, json_t *jaddr_type) { const char *addr_type, *ip; - uint8_t buf[16]; - + uint8_t buf[20]; + struct sockaddr_in *sin = &out4->u.sin; + struct sockaddr_in6 *sin6 = &out6->u.sin6; if (!json_is_string(jip) || !json_is_string(jaddr_type)) return -EINVAL; addr_type = json_string_value(jaddr_type); ip = json_string_value(jip); - memset(out, 0, sizeof(*out)); + memset(out4, 0, sizeof(*out4)); + out4->u.sa.sa_family = AF_UNSPEC; + memset(out6, 0, sizeof(*out6)); + out6->u.sa.sa_family = AF_UNSPEC; if (!strcmp(addr_type, "IPV4")) { - struct sockaddr_in *sin = &out->u.sin; + *user_addr_type = GTP1U_EUA_TYPE_IPv4; if (osmo_hexparse(ip, buf, sizeof(buf)) != 4) { LOGP(DUECUPS, LOGL_NOTICE, "Failed parsing EUA %s type %s\n", ip, addr_type); return -EINVAL; @@ -287,13 +292,23 @@ memcpy(&sin->sin_addr, buf, 4); sin->sin_family = AF_INET; } else if (!strcmp(addr_type, "IPV6")) { - struct sockaddr_in6 *sin6 = &out->u.sin6; + *user_addr_type = GTP1U_EUA_TYPE_IPv6; if (osmo_hexparse(ip, buf, sizeof(buf)) != 16) { LOGP(DUECUPS, LOGL_NOTICE, "Failed parsing EUA %s type %s\n", ip, addr_type); return -EINVAL; } memcpy(&sin6->sin6_addr, buf, 16); sin6->sin6_family = AF_INET6; + } else if (!strcmp(addr_type, "IPV4V6")) { + *user_addr_type = GTP1U_EUA_TYPE_IPv4v6; + if (osmo_hexparse(ip, buf, sizeof(buf)) != 20) { + LOGP(DUECUPS, LOGL_NOTICE, "Failed parsing EUA %s type %s\n", ip, addr_type); + return -EINVAL; + } + memcpy(&sin->sin_addr, buf, 4); + sin->sin_family = AF_INET; + memcpy(&sin6->sin6_addr, buf + 4, 16); + sin6->sin6_family = AF_INET6; } else { LOGP(DUECUPS, LOGL_NOTICE, "Unknown EUA type %s\n", addr_type); return -EINVAL; @@ -395,7 +410,8 @@ rc = parse_ep(&out->remote_udp, jremote_gtp_ep); if (rc < 0) return rc; - rc = parse_eua(&out->user_addr, juser_addr, juser_addr_type); + rc = parse_eua(&out->user_addr_type, &out->user_addr_ipv4, + &out->user_addr_ipv6, juser_addr, juser_addr_type); if (rc < 0) return rc; out->rx_teid = json_integer_value(jrx_teid); diff --git a/daemon/daemon_vty.c b/daemon/daemon_vty.c index 16f23b8..e2562c9 100644 --- a/daemon/daemon_vty.c +++ b/daemon/daemon_vty.c @@ -230,20 +230,34 @@ static void show_one_tunnel(struct vty *vty, const struct gtp_tunnel *t) { - char remote_ip[64], remote_port[16], user_addr[64]; + char remote_ip[64], remote_port[16], user_addr_v4[64], user_addr_v6[64]; getnameinfo(&t->remote_udp.u.sa, sizeof(t->remote_udp.u.sas), remote_ip, sizeof(remote_ip), remote_port, sizeof(remote_port), NI_NUMERICHOST|NI_NUMERICSERV); - getnameinfo(&t->user_addr.u.sa, sizeof(t->user_addr.u.sas), - user_addr, sizeof(user_addr), NULL, 0, - NI_NUMERICHOST|NI_NUMERICSERV); + if (t->user_addr_type == GTP1U_EUA_TYPE_IPv4 || t->user_addr_type == GTP1U_EUA_TYPE_IPv4v6) { + getnameinfo(&t->user_addr_ipv4.u.sa, sizeof(t->user_addr_ipv4.u.sas), + user_addr_v4, sizeof(user_addr_v4), NULL, 0, + NI_NUMERICHOST|NI_NUMERICSERV); + } else { + user_addr_v4[0] = '\0'; + } + if ((t->user_addr_type == GTP1U_EUA_TYPE_IPv6 || t->user_addr_type == GTP1U_EUA_TYPE_IPv4v6) && + t->user_addr_ipv6_global.u.sa.sa_family == AF_INET6) { + getnameinfo(&t->user_addr_ipv6_global.u.sa, sizeof(t->user_addr_ipv6_global.u.sas), + user_addr_v6, sizeof(user_addr_v6), NULL, 0, + NI_NUMERICHOST|NI_NUMERICSERV); + } else { + user_addr_v6[0] = '\0'; + } - - vty_out(vty, "%s/%08X - %s:%s/%08X %s(%s) %s%s", - t->gtp_ep->name, t->rx_teid, remote_ip, remote_port, t->tx_teid, - t->tun_dev->devname, t->tun_dev->netns_name, user_addr, VTY_NEWLINE); + vty_out(vty, "%s/%08X - %s:%s/%08X %s(%s) %s%s%s%s", + t->gtp_ep->name, t->rx_teid, + remote_ip, remote_port, t->tx_teid, + t->tun_dev->devname, t->tun_dev->netns_name, user_addr_v4, + (user_addr_v4[0] != '\0' && user_addr_v6[0] != '\0') ? " " : "", + user_addr_v6, VTY_NEWLINE); } DEFUN(show_tunnel, show_tunnel_cmd, diff --git a/daemon/gtp_endpoint.c b/daemon/gtp_endpoint.c index 0332f91..524226c 100644 --- a/daemon/gtp_endpoint.c +++ b/daemon/gtp_endpoint.c @@ -72,19 +72,20 @@ 0, 16 - prefix_len_bytes); /* Pick second address in the prefix: */ - memcpy(&t->user_addr.u.sin6.sin6_addr, + t->user_addr_ipv6_global.u.sa.sa_family = AF_INET6; + memcpy(&t->user_addr_ipv6_global.u.sin6.sin6_addr, &t->user_addr_ipv6_prefix.u.sin6.sin6_addr, sizeof(t->user_addr_ipv6_prefix.u.sin6.sin6_addr)); - ((uint8_t *)&t->user_addr.u.sin6.sin6_addr)[15] = 2; + ((uint8_t *)&t->user_addr_ipv6_global.u.sin6.sin6_addr)[15] = 2; LOGT(t, LOGL_INFO, "Adding global IPv6 prefix %s/%u address %s\n", inet_ntop(AF_INET6, &t->user_addr_ipv6_prefix.u.sin6.sin6_addr, &ip6strbuf[0][0], sizeof(ip6strbuf[0])), opt_prefix->prefix_len, - inet_ntop(AF_INET6, &t->user_addr.u.sin6.sin6_addr, &ip6strbuf[1][0], sizeof(ip6strbuf[1]))); + inet_ntop(AF_INET6, &t->user_addr_ipv6_global.u.sin6.sin6_addr, &ip6strbuf[1][0], sizeof(ip6strbuf[1]))); - if ((rc = osmo_netdev_add_addr(t->tun_dev->netdev, &t->user_addr, 64)) < 0) { + if ((rc = osmo_netdev_add_addr(t->tun_dev->netdev, &t->user_addr_ipv6_global, 64)) < 0) { LOGT(t, LOGL_ERROR, "Cannot add global IPv6 user addr %s to tun device: %s\n", - inet_ntop(AF_INET6, &t->user_addr.u.sin6.sin6_addr, &ip6strbuf[1][0], sizeof(ip6strbuf[1])), + inet_ntop(AF_INET6, &t->user_addr_ipv6_global.u.sin6.sin6_addr, &ip6strbuf[1][0], sizeof(ip6strbuf[1])), strerror(-rc)); } @@ -174,12 +175,12 @@ struct osmo_icmpv6_radv_hdr *ra; switch (iph->version) { case 4: - if (t->user_addr.u.sa.sa_family != AF_INET) { + if (t->user_addr_ipv4.u.sa.sa_family != AF_INET) { LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unexpected IPv4 %s in non-IPv4 PDP Context\n", inet_ntop(AF_INET, &iph->daddr, ip6strbuf, sizeof(ip6strbuf))); goto unlock_ret; } - if (memcmp(&iph->daddr, &t->user_addr.u.sin.sin_addr, 4) != 0) { + if (memcmp(&iph->daddr, &t->user_addr_ipv4.u.sin.sin_addr, 4) != 0) { LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unknown dst IP addr %s\n", inet_ntop(AF_INET, &iph->daddr, ip6strbuf, sizeof(ip6strbuf))); goto unlock_ret; @@ -187,12 +188,12 @@ break; case 6: ip6h = (struct ip6_hdr *)payload; - if (t->user_addr.u.sa.sa_family != AF_INET6) { - LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unexpected IPv6 %s in non-IPv6 PDP Context\n", - inet_ntop(AF_INET6, &ip6h->ip6_dst, ip6strbuf, sizeof(ip6strbuf))); - goto unlock_ret; - } if (IN6_IS_ADDR_LINKLOCAL(&ip6h->ip6_dst)) { + if (t->user_addr_ipv6_ll.u.sa.sa_family != AF_INET6) { + LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unexpected IPv6 %s in non-IPv6 PDP Context\n", + inet_ntop(AF_INET6, &ip6h->ip6_dst, ip6strbuf, sizeof(ip6strbuf))); + goto unlock_ret; + } if (memcmp(&ip6h->ip6_dst, &t->user_addr_ipv6_ll.u.sin6.sin6_addr, 16) != 0) { LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unknown link-local dst IP addr %s\n", inet_ntop(AF_INET6, &ip6h->ip6_dst, ip6strbuf, sizeof(ip6strbuf))); @@ -203,11 +204,18 @@ handle_router_adv(t, (struct ip6_hdr *)payload, ra, ra_len); goto unlock_ret; } - /* Match by global IPv6 /64 prefix allocated through SLAAC: */ - } else if (memcmp(&ip6h->ip6_dst, &t->user_addr.u.sin6.sin6_addr, 8) != 0) { - LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unknown global dst IP addr %s\n", - inet_ntop(AF_INET6, &ip6h->ip6_dst, ip6strbuf, sizeof(ip6strbuf))); - goto unlock_ret; + } else { + /* Match by global IPv6 /64 prefix allocated through SLAAC: */ + if (t->user_addr_ipv6_global.u.sa.sa_family != AF_INET6) { + LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unexpected IPv6 %s in non-IPv6 PDP Context\n", + inet_ntop(AF_INET6, &ip6h->ip6_dst, ip6strbuf, sizeof(ip6strbuf))); + goto unlock_ret; + } + if (memcmp(&ip6h->ip6_dst, &t->user_addr_ipv6_prefix.u.sin6.sin6_addr, 8) != 0) { + LOGT(t, LOGL_NOTICE, "Rx GTPU payload for unknown global dst IP addr %s\n", + inet_ntop(AF_INET6, &ip6h->ip6_dst, ip6strbuf, sizeof(ip6strbuf))); + goto unlock_ret; + } } break; default: diff --git a/daemon/gtp_tunnel.c b/daemon/gtp_tunnel.c index 2765488..fc99e4f 100644 --- a/daemon/gtp_tunnel.c +++ b/daemon/gtp_tunnel.c @@ -57,15 +57,28 @@ t->rx_teid = cpars->rx_teid; t->tx_teid = cpars->tx_teid; memcpy(&t->exthdr, &cpars->exthdr, sizeof(t->exthdr)); - memcpy(&t->user_addr_ipv6_ll, &cpars->user_addr, sizeof(t->user_addr)); - memcpy(&t->user_addr, &t->user_addr_ipv6_ll, sizeof(t->user_addr_ipv6_ll)); - memcpy(&t->remote_udp, &cpars->remote_udp, sizeof(t->remote_udp)); - if ((rc = osmo_netdev_add_addr(t->tun_dev->netdev, &t->user_addr, 32)) < 0) { - LOGT(t, LOGL_ERROR, "Cannot add user addr to tun device: %s\n", - strerror(-rc)); + if (cpars->user_addr_type == GTP1U_EUA_TYPE_IPv4 || cpars->user_addr_type == GTP1U_EUA_TYPE_IPv4v6) { + memcpy(&t->user_addr_ipv4, &cpars->user_addr_ipv4, sizeof(t->user_addr_ipv4)); + if ((rc = osmo_netdev_add_addr(t->tun_dev->netdev, &t->user_addr_ipv4, 32)) < 0) { + LOGT(t, LOGL_ERROR, "Cannot add user addr to tun device: %s\n", + strerror(-rc)); + } + } else { + t->user_addr_ipv4.u.sa.sa_family = AF_UNSPEC; } + t->user_addr_type = cpars->user_addr_type; + if (cpars->user_addr_type == GTP1U_EUA_TYPE_IPv6 || cpars->user_addr_type == GTP1U_EUA_TYPE_IPv4v6) + memcpy(&t->user_addr_ipv6_ll, &cpars->user_addr_ipv6, sizeof(t->user_addr_ipv6_ll)); + else + t->user_addr_ipv6_ll.u.sa.sa_family = AF_UNSPEC; + + /* user_addr_ipv6_global will be set later on during IPv6 SLAAC procedure: */ + t->user_addr_ipv6_global.u.sa.sa_family = AF_UNSPEC; + + memcpy(&t->remote_udp, &cpars->remote_udp, sizeof(t->remote_udp)); + /* TODO: hash table? */ llist_add_tail(&t->list, &d->gtp_tunnels); pthread_rwlock_unlock(&d->rwlock); @@ -125,9 +138,23 @@ llist_for_each_entry(t, &d->gtp_tunnels, list) { /* TODO: Find best matching filter */ - if (t->tun_dev == tun && - osmo_sockaddr_cmp(osa, &t->user_addr) == 0) + if (t->tun_dev != tun) + continue; + switch (osa->u.sa.sa_family) { + case AF_INET: + if (t->user_addr_type == GTP1U_EUA_TYPE_IPv6) + continue; + if (osmo_sockaddr_cmp(osa, &t->user_addr_ipv4) != 0) + continue; return t; + case AF_INET6: + if (t->user_addr_type == GTP1U_EUA_TYPE_IPv4) + continue; + if (osmo_sockaddr_cmp(osa, &t->user_addr_ipv6_ll) != 0 && + osmo_sockaddr_cmp(osa, &t->user_addr_ipv6_global) != 0) + continue; + return t; + } } return NULL; } @@ -141,8 +168,18 @@ /* talloc is not thread safe, all alloc/free must come from main thread */ ASSERT_MAIN_THREAD(t->d); - if ((rc = osmo_netdev_del_addr(t->tun_dev->netdev, &t->user_addr, 32)) < 0) - LOGT(t, LOGL_ERROR, "Cannot remove user address: %s\n", strerror(-rc)); + if (t->user_addr_type == GTP1U_EUA_TYPE_IPv4 || t->user_addr_type == GTP1U_EUA_TYPE_IPv4v6) { + if ((rc = osmo_netdev_del_addr(t->tun_dev->netdev, &t->user_addr_ipv4, 32)) < 0) + LOGT(t, LOGL_ERROR, "Cannot remove IPv4 user address: %s\n", strerror(-rc)); + } + if (t->user_addr_type == GTP1U_EUA_TYPE_IPv6 || t->user_addr_type == GTP1U_EUA_TYPE_IPv4v6) { + if ((rc = osmo_netdev_del_addr(t->tun_dev->netdev, &t->user_addr_ipv6_ll, 32)) < 0) + LOGT(t, LOGL_ERROR, "Cannot remove IPv6 link-local user address: %s\n", strerror(-rc)); + if (t->user_addr_ipv6_global.u.sa.sa_family != AF_UNSPEC) { + if ((rc = osmo_netdev_del_addr(t->tun_dev->netdev, &t->user_addr_ipv6_global, 32)) < 0) + LOGT(t, LOGL_ERROR, "Cannot remove IPv6 global user address: %s\n", strerror(-rc)); + } + } llist_del(&t->list); @@ -180,9 +217,10 @@ struct msgb *msg; int rc; - OSMO_ASSERT(t->user_addr.u.sa.sa_family == AF_INET6); + OSMO_ASSERT(t->user_addr_type == GTP1U_EUA_TYPE_IPv6 || + t->user_addr_type == GTP1U_EUA_TYPE_IPv4v6); - msg = osmo_icmpv6_construct_rs(&t->user_addr.u.sin6.sin6_addr); + msg = osmo_icmpv6_construct_rs(&t->user_addr_ipv6_ll.u.sin6.sin6_addr); pthread_rwlock_rdlock(&t->d->rwlock); rc = tx_gtp1u_pkt(t, msg->head, msgb_data(msg), msgb_length(msg)); diff --git a/daemon/internal.h b/daemon/internal.h index 5d4b832..d9e040c 100644 --- a/daemon/internal.h +++ b/daemon/internal.h @@ -172,6 +172,12 @@ * this is what happens when IP arrives on the tun device */ +enum gtp1u_eua_type { + GTP1U_EUA_TYPE_IPv4, + GTP1U_EUA_TYPE_IPv6, + GTP1U_EUA_TYPE_IPv4v6, +}; + struct gtp1u_exthdr_pdu_sess_container { bool enabled; uint8_t pdu_type; /* GTP1_EXTHDR_PDU_TYPE_* */ @@ -203,9 +209,11 @@ uint32_t rx_teid; /* End user Address (inner IP) */ + enum gtp1u_eua_type user_addr_type; + struct osmo_sockaddr user_addr_ipv4; struct osmo_sockaddr user_addr_ipv6_ll; struct osmo_sockaddr user_addr_ipv6_prefix; - struct osmo_sockaddr user_addr; + struct osmo_sockaddr user_addr_ipv6_global; /* Remote UDP IP/Port*/ struct osmo_sockaddr remote_udp; @@ -231,7 +239,9 @@ struct gtp1u_exthdrs exthdr; /* end user address */ - struct osmo_sockaddr user_addr; + enum gtp1u_eua_type user_addr_type; + struct osmo_sockaddr user_addr_ipv4; + struct osmo_sockaddr user_addr_ipv6; /* remote GTP/UDP IP+Port */ struct osmo_sockaddr remote_udp; diff --git a/ttcn3/UECUPS_Types.ttcn b/ttcn3/UECUPS_Types.ttcn index 45466c8..ba4e7d4 100644 --- a/ttcn3/UECUPS_Types.ttcn +++ b/ttcn3/UECUPS_Types.ttcn @@ -7,7 +7,8 @@ type enumerated UECUPS_AddrType { IPV4 (1), - IPV6 (2) + IPV6 (2), + IPV4V6 (3) }; type enumerated UECUPS_Result { @@ -43,7 +44,7 @@ /* user address (allocated inside the tunnel) */ UECUPS_AddrType user_addr_type, - OCT4_16n user_addr, + OCT4_20n user_addr, /* GTP endpoint (UDP IP/Port tuples) */ UECUPS_SockAddr local_gtp_ep, -- To view, visit https://gerrit.osmocom.org/c/osmo-uecups/+/42470?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-uecups Gerrit-Branch: master Gerrit-Change-Id: Ic2da7a761a8df7e006fc02ca6557a48f371e4151 Gerrit-Change-Number: 42470 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: 5gc: Introduce tests TC_ng_register_ping6(_256)
by pespin 23 Mar '26

23 Mar '26
Attention is currently required from: osmith. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42460?usp=email ) Change subject: 5gc: Introduce tests TC_ng_register_ping6(_256) ...................................................................... Patch Set 2: (2 comments) File 5gc/C5G_Tests.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42460/comment/c3a2863c_9391… : PS2, Line 436: f_ping4 > shouldn't this be ping6? The naming of the function is actually wrong, it just works fine here. I'll rename it when supporting IPv4v6 addresses as a next step. File 5gc/ConnHdlr.ttcn: https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42460/comment/4e9d4704_b219… : PS2, Line 1327: //user_addr := g_pars.ue_pars.sess_pars.ipv6_interface_id; > do you want to keep this commented out line? thanks, fixed it will push with next version of the patch. -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/42460?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: Iedf3697265b91bdda85e8d32402345ea8d58dc9f Gerrit-Change-Number: 42460 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-CC: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de> Gerrit-Comment-Date: Mon, 23 Mar 2026 16:23:54 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: osmith <osmith(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: pySim/EF.SMSP: add an additional de_encode test for EF_SMSP
by dexter 23 Mar '26

23 Mar '26
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/42468?usp=email ) Change subject: pySim/EF.SMSP: add an additional de_encode test for EF_SMSP ...................................................................... pySim/EF.SMSP: add an additional de_encode test for EF_SMSP Let's add another testvector where we test what happens when we populate none of the fields except for the tp_sc_addr. Related: SYS#7765 Change-Id: I12b600ab17d1acfdddaffe6006095acf1a4228c9 --- M pySim/ts_51_011.py 1 file changed, 10 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/68/42468/1 diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 57cfc0c..86d0192 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -261,6 +261,16 @@ "numbering_plan_id": "reserved_for_extension" }, "call_number": "" }, "tp_pid": b"\x00", "tp_dcs": b"\x00", "tp_vp_minutes": 1440 } ), + ( 'fffffffffffffffffffffffffffffffffffffffffffffffffdffffffffffffffffffffffff07919403214365f7ffffffffffffff', + { "alpha_id": "", "parameter_indicators": { "tp_dest_addr": False, "tp_sc_addr": True, + "tp_pid": False, "tp_dcs": False, "tp_vp": False }, + "tp_dest_addr": { "length": 255, "ton_npi": { "ext": True, "type_of_number": "reserved_for_extension", + "numbering_plan_id": "reserved_for_extension" }, + "call_number": "" }, + "tp_sc_addr": { "length": 7, "ton_npi": { "ext": True, "type_of_number": "international", + "numbering_plan_id": "isdn_e164" }, + "call_number": "49301234567" }, + "tp_pid": b"\xff", "tp_dcs": b"\xff", "tp_vp_minutes": 635040 } ), ] _test_no_pad = True class ValidityPeriodAdapter(Adapter): -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42468?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I12b600ab17d1acfdddaffe6006095acf1a4228c9 Gerrit-Change-Number: 42468 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
1 0
0 0
[S] Change in pysim[master]: pySim/EF.SMSP: fix encoding of TP-Destination Address
by dexter 23 Mar '26

23 Mar '26
dexter has uploaded this change for review. ( https://gerrit.osmocom.org/c/pysim/+/42469?usp=email ) Change subject: pySim/EF.SMSP: fix encoding of TP-Destination Address ...................................................................... pySim/EF.SMSP: fix encoding of TP-Destination Address The TP-Destination Address in EF.SMSP uses the same encoding as the TS-Service Centre Address field. However, even though the encoding of both fields looks almost identical, it actually isn't. The TS-Service Centre Address field encodes the length field as octets required for the call_number + one octet for ton_npi. (see also: 3GPP TS 24.011, section 8.2.5.2) The TP-Destination Address uses the number of digits of the call_number directly in the length field. (see also: 3GPP TS 23.040, section 9.1.2.5) Related: SYS#7765 Change-Id: I55c123c9e244e5a6e71a0348f5d476ef03e618e8 --- M pySim/ts_51_011.py 1 file changed, 24 insertions(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/pysim refs/changes/69/42469/1 diff --git a/pySim/ts_51_011.py b/pySim/ts_51_011.py index 86d0192..44eccfa 100644 --- a/pySim/ts_51_011.py +++ b/pySim/ts_51_011.py @@ -271,6 +271,16 @@ "numbering_plan_id": "isdn_e164" }, "call_number": "49301234567" }, "tp_pid": b"\xff", "tp_dcs": b"\xff", "tp_vp_minutes": 635040 } ), + ( 'fffffffffffffffffffffffffffffffffffffffffffffffffc0b919403214365f7ffffffff07919403214365f7ffffffffffffff', + { "alpha_id": "", "parameter_indicators": { "tp_dest_addr": True, "tp_sc_addr": True, + "tp_pid": False, "tp_dcs": False, "tp_vp": False }, + "tp_dest_addr": { "length": 11, "ton_npi": { "ext": True, "type_of_number": "international", + "numbering_plan_id": "isdn_e164" }, + "call_number": "49301234567" }, + "tp_sc_addr": { "length": 7, "ton_npi": { "ext": True, "type_of_number": "international", + "numbering_plan_id": "isdn_e164" }, + "call_number": "49301234567" }, + "tp_pid": b"\xff", "tp_dcs": b"\xff", "tp_vp_minutes": 635040 } ), ] _test_no_pad = True class ValidityPeriodAdapter(Adapter): @@ -299,16 +309,28 @@ @staticmethod def sc_addr_len(ctx): - """Compute the length field for an address field (like TP-DestAddr or TP-ScAddr).""" + """Compute the length field for an address field (see also: 3GPP TS 24.011, section 8.2.5.2).""" if not hasattr(ctx, 'call_number') or len(ctx.call_number) == 0: return 0xff else: + # octets required for the call_number + one octet for ton_npi return bytes_for_nibbles(len(ctx.call_number)) + 1 + @staticmethod + def dest_addr_len(ctx): + """Compute the length field for an address field (see also: 3GPP TS 23.040, section 9.1.2.5).""" + if not hasattr(ctx, 'call_number') or len(ctx.call_number) == 0: + return 0xff + else: + # number of call_number digits + return len(ctx.call_number) + def __init__(self, fid='6f42', sfid=None, name='EF.SMSP', desc='Short message service parameters', **kwargs): super().__init__(fid, sfid=sfid, name=name, desc=desc, rec_len=(28, None), **kwargs) ScAddr = Struct('length'/Rebuild(Int8ub, lambda ctx: EF_SMSP.sc_addr_len(ctx)), 'ton_npi'/TonNpi, 'call_number'/PaddedBcdAdapter(Rpad(Bytes(10)))) + DestAddr = Struct('length'/Rebuild(Int8ub, lambda ctx: EF_SMSP.dest_addr_len(ctx)), + 'ton_npi'/TonNpi, 'call_number'/PaddedBcdAdapter(Rpad(Bytes(10)))) self._construct = Struct('alpha_id'/COptional(GsmOrUcs2Adapter(Rpad(Bytes(this._.total_len-28)))), 'parameter_indicators'/InvertAdapter(BitStruct( Const(7, BitsInteger(3)), @@ -317,7 +339,7 @@ 'tp_pid'/Flag, 'tp_sc_addr'/Flag, 'tp_dest_addr'/Flag)), - 'tp_dest_addr'/ScAddr, + 'tp_dest_addr'/DestAddr, 'tp_sc_addr'/ScAddr, 'tp_pid'/Bytes(1), 'tp_dcs'/Bytes(1), -- To view, visit https://gerrit.osmocom.org/c/pysim/+/42469?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: pysim Gerrit-Branch: master Gerrit-Change-Id: I55c123c9e244e5a6e71a0348f5d476ef03e618e8 Gerrit-Change-Number: 42469 Gerrit-PatchSet: 1 Gerrit-Owner: dexter <pmaier(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 47
  • 48
  • 49
  • 50
  • 51
  • 52
  • 53
  • ...
  • 194
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.