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 -----
  • December
  • 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

August 2024

  • 1 participants
  • 1478 discussions
[XS] Change in osmo-ttcn3-hacks[master]: s1gw: Wait for component to stop before testing IUT for conn refused
by pespin 22 Aug '24

22 Aug '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37908?usp=email ) Change subject: s1gw: Wait for component to stop before testing IUT for conn refused ...................................................................... s1gw: Wait for component to stop before testing IUT for conn refused Change-Id: I9dcac498766dd4a597cc5827bdb9192e861356c6 --- M s1gw/S1GW_Tests.ttcn 1 file changed, 1 insertion(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/08/37908/1 diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index d766ed1..de680bb 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -159,6 +159,7 @@ f_init(); f_init_s1ap_srv(); vc_S1APSRV.stop; + vc_S1APSRV.done; vc_conn := f_ConnHdlr_spawn(refers(f_TC_conn_term_mme_unavail), pars); vc_conn.done; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37908?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: I9dcac498766dd4a597cc5827bdb9192e861356c6 Gerrit-Change-Number: 37908 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in ...osmo-s1gw[master]: pfcp_peer: Retry PFCP assiciation towards UPF instead of exiting
by pespin 22 Aug '24

22 Aug '24
Attention is currently required from: fixeria, laforge, lynxis lazus. pespin has posted comments on this change by pespin. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37907?usp=email ) Change subject: pfcp_peer: Retry PFCP assiciation towards UPF instead of exiting ...................................................................... Patch Set 1: (1 comment) Patchset: PS1: This fixes sporadic failures of ttcn3 tests. -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37907?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ic17c1c7210ab4ae0ddc840a5ffd13b7cdda243c9 Gerrit-Change-Number: 37907 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Thu, 22 Aug 2024 14:37:08 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No
1 0
0 0
[XS] Change in ...osmo-s1gw[master]: pfcp_peer: Retry PFCP assiciation towards UPF instead of exiting
by pespin 22 Aug '24

22 Aug '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37907?usp=email ) Change subject: pfcp_peer: Retry PFCP assiciation towards UPF instead of exiting ...................................................................... pfcp_peer: Retry PFCP assiciation towards UPF instead of exiting Otherwise the osmo-s1gw program stops if the UPF is not available at the time. Change-Id: Ic17c1c7210ab4ae0ddc840a5ffd13b7cdda243c9 --- M src/pfcp_peer.erl 1 file changed, 5 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/erlang/osmo-s1gw refs/changes/07/37907/1 diff --git a/src/pfcp_peer.erl b/src/pfcp_peer.erl index dc36c1f..ba8f8a9 100644 --- a/src/pfcp_peer.erl +++ b/src/pfcp_peer.erl @@ -155,12 +155,13 @@ ?LOG_INFO("State change: ~p -> ~p", [OldState, ?FUNCTION_NAME]), %% Tx PFCP Association Setup {ok, S1} = send_assoc_setup(S0), - {next_state, connecting, S1, - [{state_timeout, 2_000, assoc_setup_timeout}]}; + {keep_state, S1, [{state_timeout, 2_000, assoc_setup_timeout}]}; %% Handle Association Setup timeout -connecting(state_timeout, assoc_setup_timeout, _S) -> - {stop, {shutdown, assoc_setup_timeout}}; +connecting(state_timeout, assoc_setup_timeout, S) -> + % Re-start sending PFCP Association Setup above: + ?LOG_NOTICE("PFCP Association Setup timeout, UPF may be down, retrying..."), + {repeat_state, S}; %% Handle incoming PFCP PDU(s) connecting(info, {udp, Sock, _FromIp, _FromPort, Data}, -- To view, visit https://gerrit.osmocom.org/c/erlang/osmo-s1gw/+/37907?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: erlang/osmo-s1gw Gerrit-Branch: master Gerrit-Change-Id: Ic17c1c7210ab4ae0ddc840a5ffd13b7cdda243c9 Gerrit-Change-Number: 37907 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: initial testenv.cfg
by pespin 22 Aug '24

22 Aug '24
Attention is currently required from: osmith. Hello Jenkins Builder, osmith, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37906?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: s1gw: initial testenv.cfg ...................................................................... s1gw: initial testenv.cfg This commit already provides a running setup to run the testsuite, similar to the one already available in docker-playground.git. Change-Id: Ib66c3f23355c117302b48fc9ef05cde1920d8739 --- A s1gw/osmo-s1gw.config A s1gw/testenv.cfg 2 files changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/06/37906/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37906?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: Ib66c3f23355c117302b48fc9ef05cde1920d8739 Gerrit-Change-Number: 37906 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Attention: osmith <osmith(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: initial testenv.cfg
by pespin 22 Aug '24

22 Aug '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37906?usp=email ) Change subject: s1gw: initial testenv.cfg ...................................................................... s1gw: initial testenv.cfg This commit already provides a running setup to run the testsuite, similar to the one already available in docker-playground.git. Change-Id: Ib66c3f23355c117302b48fc9ef05cde1920d8739 --- A s1gw/osmo-s1gw.config A s1gw/testenv.cfg 2 files changed, 44 insertions(+), 0 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/06/37906/1 diff --git a/s1gw/osmo-s1gw.config b/s1gw/osmo-s1gw.config new file mode 100644 index 0000000..f4a4a73 --- /dev/null +++ b/s1gw/osmo-s1gw.config @@ -0,0 +1,35 @@ +%% -*- erlang -*- + +[%% ================================================================================ + %% application config + %% + %% eNB S1GW + %% +-----+ +----------------+ + %% | ... | --> | s1gw_bind_addr | MME + %% +-----+ +----------------+ +-----------------+ + %% | mme_loc_addr | --> | mme_rem_addr | + %% +----------------+ +-----------------+ + %% ================================================================================ + {osmo_s1gw, + [{s1gw_bind_addr, "127.0.1.1"}, %% S1GW bind address for incoming eNB connections + {mme_loc_addr, "127.0.2.1"}, %% local address for outgoing connections to the MME + {mme_rem_addr, "127.0.2.10"} %% remote address for outgoing connections to the MME + ]}, + %% ================================================================================ + %% kernel config + %% ================================================================================ + {kernel, + [{logger_level, debug}, + {logger, + [{handler, default, logger_std_h, + #{level => debug, + formatter => {logger_formatter, + #{template => [time, " ", + "[", level, "]", + {pid, [" ", pid, ""], ""}, + {prefix, [" ", prefix, " ::"], ""}, + " ", msg, + {mfa, [" (", mfa, ":", line, ")"], ""}, + "\n"]}}}}]}]}]. + +%% vim:set ts=2 sw=2 et: diff --git a/s1gw/testenv.cfg b/s1gw/testenv.cfg new file mode 100644 index 0000000..c1d71e5 --- /dev/null +++ b/s1gw/testenv.cfg @@ -0,0 +1,9 @@ +[testsuite] +program=S1GW_Tests +config=S1GW_Tests.cfg + +[dia2gsup] +program=ERL_FLAGS="-config osmo-s1gw.config" osmo-s1gw +make=osmo-s1gw +package=osmo-s1gw +copy=osmo-s1gw.config -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37906?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: Ib66c3f23355c117302b48fc9ef05cde1920d8739 Gerrit-Change-Number: 37906 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: Add mp_enb_bind_ip module parameter
by pespin 22 Aug '24

22 Aug '24
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37905?usp=email to look at the new patch set (#2). The following approvals got outdated and were removed: Verified+1 by Jenkins Builder Change subject: s1gw: Add mp_enb_bind_ip module parameter ...................................................................... s1gw: Add mp_enb_bind_ip module parameter This allows more easily understanding pcap traces by looking at the config file to identify the ip addresses. Change-Id: I294b14e6ef119c17eec22f813d5755279560e0bc --- M s1gw/ConnHdlr.ttcn M s1gw/S1GW_Tests.cfg M s1gw/S1GW_Tests.ttcn 3 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/37905/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37905?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: I294b14e6ef119c17eec22f813d5755279560e0bc Gerrit-Change-Number: 37905 Gerrit-PatchSet: 2 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: s1gw: Add mp_enb_bind_ip module parameter
by pespin 22 Aug '24

22 Aug '24
pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37905?usp=email ) Change subject: s1gw: Add mp_enb_bind_ip module parameter ...................................................................... s1gw: Add mp_enb_bind_ip module parameter This allows more easily understanding pcap traces by looking at the config file to identify the ip addresses. Change-Id: I294b14e6ef119c17eec22f813d5755279560e0bc --- M s1gw/ConnHdlr.ttcn M s1gw/S1GW_Tests.cfg M s1gw/S1GW_Tests.ttcn 3 files changed, 8 insertions(+), 6 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/05/37905/1 diff --git a/s1gw/ConnHdlr.ttcn b/s1gw/ConnHdlr.ttcn index 69c19b6..cd327ef 100644 --- a/s1gw/ConnHdlr.ttcn +++ b/s1gw/ConnHdlr.ttcn @@ -58,7 +58,7 @@ type function void_fn(ConnHdlrPars pars) runs on ConnHdlr; -function f_ConnHdlr_connect(charstring remote_addr) runs on ConnHdlr { +function f_ConnHdlr_connect(charstring local_addr, charstring remote_addr) runs on ConnHdlr { var Result res; timer T; @@ -67,7 +67,7 @@ /* initiate SCTP connection establishment */ res := S1AP_CodecPort_CtrlFunct.f_IPL4_connect(S1AP_ENB, remote_addr, 36412, - "0.0.0.0", 0, -1, + local_addr, 0, -1, { sctp := c_SctpTuple_S1AP }); if (not ispresent(res.connId)) { setverdict(fail, "Could not create an S1AP socket, check your configuration"); diff --git a/s1gw/S1GW_Tests.cfg b/s1gw/S1GW_Tests.cfg index 536f0ec..7e10c5c 100644 --- a/s1gw/S1GW_Tests.cfg +++ b/s1gw/S1GW_Tests.cfg @@ -13,6 +13,7 @@ [MODULE_PARAMETERS] S1GW_Tests.mp_s1gw_enb_ip := "127.0.1.1"; S1GW_Tests.mp_s1gw_mme_ip := "127.0.2.1"; +S1GW_Tests.mp_enb_bind_ip := "127.0.2.20"; S1GW_Tests.mp_mme_bind_ip := "127.0.2.10"; [MAIN_CONTROLLER] diff --git a/s1gw/S1GW_Tests.ttcn b/s1gw/S1GW_Tests.ttcn index 2625799..d766ed1 100644 --- a/s1gw/S1GW_Tests.ttcn +++ b/s1gw/S1GW_Tests.ttcn @@ -35,6 +35,7 @@ modulepar { charstring mp_s1gw_enb_ip; /* eNB facing address of the S1GW */ charstring mp_s1gw_mme_ip; /* MME facing address of the S1GW */ + charstring mp_enb_bind_ip; /* eNB address to use locally when connecting to S1GW */ charstring mp_mme_bind_ip; /* MME address on which we get connections from S1GW */ } @@ -81,7 +82,7 @@ function f_TC_setup(ConnHdlrPars pars) runs on ConnHdlr { f_ConnHdlr_register(pars.genb_id); - f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); f_ConnHdlr_setup(pars.genb_id); f_sleep(0.5); /* keep the connection idle for some time */ f_ConnHdlr_disconnect(); @@ -120,7 +121,7 @@ function f_TC_conn_term_by_mme(ConnHdlrPars pars) runs on ConnHdlr { f_ConnHdlr_register(pars.genb_id); - f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); f_ConnHdlr_setup(pars.genb_id); f_sleep(0.5); /* keep the connection idle for some time */ @@ -146,7 +147,7 @@ /* MME is not available, expect S1GW to terminate the eNB connection */ function f_TC_conn_term_mme_unavail(ConnHdlrPars pars) runs on ConnHdlr { /* establish an eNB connection to the S1GW */ - f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); /* expect our eNB connection to be released gracefully */ f_ConnHdlr_expect_shutdown(); setverdict(pass); @@ -170,7 +171,7 @@ var S1AP_PDU pdu; f_ConnHdlr_register(pars.genb_id); - f_ConnHdlr_connect(mp_s1gw_enb_ip); + f_ConnHdlr_connect(mp_enb_bind_ip, mp_s1gw_enb_ip); f_ConnHdlr_setup(pars.genb_id); log("eNB -> [S1GW] -> MME: E-RAB SETUP REQUEST"); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37905?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: I294b14e6ef119c17eec22f813d5755279560e0bc Gerrit-Change-Number: 37905 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de>
1 0
0 0
[XS] Change in osmo-ci[master]: Revert "checkpatch: recognize json_array_foreach etc."
by osmith 22 Aug '24

22 Aug '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/37904?usp=email ) Change subject: Revert "checkpatch: recognize json_array_foreach etc." ...................................................................... Revert "checkpatch: recognize json_array_foreach etc." Turns out we don't want to treat loop macros the same as real for/while etc. regarding spaces. Harald wrote: > Those macros are used without space before the open parenthesis, for > decades in the kernel and also in osmocom This reverts commit afd9d56e0568a61d0b2de010f710baffb71bff25. Related: https://gerrit.osmocom.org/c/osmo-sgsn/+/37864/comment/7eada1b7_0e584088/ Change-Id: I59d4a89cca516df8346fc090f532d42fc9d6acac --- M lint/checkpatch/checkpatch.pl 1 file changed, 1 insertion(+), 2 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/04/37904/1 diff --git a/lint/checkpatch/checkpatch.pl b/lint/checkpatch/checkpatch.pl index ff6eea1..eada2a9 100755 --- a/lint/checkpatch/checkpatch.pl +++ b/lint/checkpatch/checkpatch.pl @@ -4888,7 +4888,6 @@ # Ignore those directives where spaces _are_ permitted. if ($name =~ /^(?: if|for|while|switch|return|case| - [a-z_]*for[_]?each[a-z_]*| volatile|__volatile__| __attribute__|format|__extension__| asm|__asm__)$/x) @@ -5514,7 +5513,7 @@ } # Need a space before open parenthesis after if, while etc - if ($line =~ /\b(if|while|for|switch|[a-z_]*for[_]?each[a-z_]*)\(/) { + if ($line =~ /\b(if|while|for|switch)\(/) { if (ERROR("SPACING", "space required before the open parenthesis '('\n" . $herecurr) && $fix) { -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/37904?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newchange Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: I59d4a89cca516df8346fc090f532d42fc9d6acac Gerrit-Change-Number: 37904 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-sgsn[master]: Replace gprs_ra_id with modern osmo_routing_area_id
by lynxis lazus 22 Aug '24

22 Aug '24
lynxis lazus has submitted this change. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/37860?usp=email ) Change subject: Replace gprs_ra_id with modern osmo_routing_area_id ...................................................................... Replace gprs_ra_id with modern osmo_routing_area_id The new modern osmo_routing_area_id is more flexible and allow to access PLMN, LAC more convient. Depends: Iaef54cac541913534af00f40483723e9952a6807 (libosmocore) Change-Id: Ia41eb8f51d3836b1bc65325ff1ec6bdb16e20c7e --- M include/osmocom/sgsn/gprs_gmm.h M include/osmocom/sgsn/gprs_sndcp.h M include/osmocom/sgsn/gtp.h M include/osmocom/sgsn/mmctx.h M src/sgsn/gprs_bssgp.c M src/sgsn/gprs_gmm.c M src/sgsn/gprs_sndcp.c M src/sgsn/gprs_subscriber.c M src/sgsn/mmctx.c M src/sgsn/sgsn_auth.c M src/sgsn/sgsn_cdr.c M src/sgsn/sgsn_libgtp.c M src/sgsn/sgsn_vty.c M tests/sgsn/sgsn_test.c 14 files changed, 72 insertions(+), 67 deletions(-) Approvals: pespin: Looks good to me, approved Jenkins Builder: Verified diff --git a/include/osmocom/sgsn/gprs_gmm.h b/include/osmocom/sgsn/gprs_gmm.h index 71dd1fa..6fca77e 100644 --- a/include/osmocom/sgsn/gprs_gmm.h +++ b/include/osmocom/sgsn/gprs_gmm.h @@ -9,6 +9,7 @@ struct sgsn_mm_ctx; struct gprs_llc_llme; +struct osmo_routing_area_id; int gsm48_tx_gmm_auth_ciph_req(struct sgsn_mm_ctx *mm, const struct osmo_auth_vector *vec, @@ -28,8 +29,8 @@ void gsm0408_gprs_access_cancelled(struct sgsn_mm_ctx *mmctx, int gmm_cause); void gsm0408_gprs_authenticate(struct sgsn_mm_ctx *mmctx); -int gprs_gmm_rx_suspend(struct gprs_ra_id *raid, uint32_t tlli); -int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli, +int gprs_gmm_rx_suspend(struct osmo_routing_area_id *raid, uint32_t tlli); +int gprs_gmm_rx_resume(struct osmo_routing_area_id *raid, uint32_t tlli, uint8_t suspend_ref); int gsm0408_gprs_rcvmsg_gb(struct msgb *msg, struct gprs_llc_llme *llme, diff --git a/include/osmocom/sgsn/gprs_sndcp.h b/include/osmocom/sgsn/gprs_sndcp.h index 30ea053..058cb29 100644 --- a/include/osmocom/sgsn/gprs_sndcp.h +++ b/include/osmocom/sgsn/gprs_sndcp.h @@ -47,7 +47,7 @@ struct llist_head list; /* FIXME: move this RA_ID up to the LLME or even higher */ - struct gprs_ra_id ra_id; + struct osmo_routing_area_id ra_id; /* reference to the LLC Entity below this SNDCP entity */ struct gprs_llc_lle *lle; /* The NSAPI we shall use on top of LLC */ diff --git a/include/osmocom/sgsn/gtp.h b/include/osmocom/sgsn/gtp.h index 1d76243..ed6cbf5 100644 --- a/include/osmocom/sgsn/gtp.h +++ b/include/osmocom/sgsn/gtp.h @@ -23,7 +23,7 @@ uint16_t nsapi, struct tlv_parsed *tp); -int sgsn_gtp_data_req(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi, +int sgsn_gtp_data_req(struct osmo_routing_area_id *ra_id, int32_t tlli, uint8_t nsapi, struct msgb *msg, uint32_t npdu_len, uint8_t *npdu); int sgsn_delete_pdp_ctx(struct sgsn_pdp_ctx *pctx); int send_act_pdp_cont_acc(struct sgsn_pdp_ctx *pctx); diff --git a/include/osmocom/sgsn/mmctx.h b/include/osmocom/sgsn/mmctx.h index 5e4662f..03bb845 100644 --- a/include/osmocom/sgsn/mmctx.h +++ b/include/osmocom/sgsn/mmctx.h @@ -105,7 +105,7 @@ char imei[GSM23003_IMEISV_NUM_DIGITS+1]; /* Opt: Software Version Numbber / TS 23.195 */ char msisdn[GSM_EXTENSION_LENGTH]; - struct gprs_ra_id ra; + struct osmo_routing_area_id ra; struct { uint16_t cell_id; /* Gb only */ uint32_t cell_id_age; /* Gb only */ @@ -253,7 +253,7 @@ /* look-up a SGSN MM context based on TLLI + RAI */ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli, - const struct gprs_ra_id *raid); + const struct osmo_routing_area_id *raid); struct sgsn_mm_ctx *sgsn_mm_ctx_by_ptmsi(uint32_t tmsi); struct sgsn_mm_ctx *sgsn_mm_ctx_by_imsi(const char *imsi); struct sgsn_mm_ctx *sgsn_mm_ctx_by_ue_ctx(const void *uectx); @@ -261,11 +261,11 @@ /* look-up by matching TLLI and P-TMSI (think twice before using this) */ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli_and_ptmsi(uint32_t tlli, - const struct gprs_ra_id *raid); + const struct osmo_routing_area_id *raid); /* Allocate a new SGSN MM context */ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_gb(uint32_t tlli, - const struct gprs_ra_id *raid); + const struct osmo_routing_area_id *raid); struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_iu(void *uectx); void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *ctx); diff --git a/src/sgsn/gprs_bssgp.c b/src/sgsn/gprs_bssgp.c index 5db751c..0a9bb91 100644 --- a/src/sgsn/gprs_bssgp.c +++ b/src/sgsn/gprs_bssgp.c @@ -26,6 +26,8 @@ #include <osmocom/gprs/gprs_bssgp.h> #include <osmocom/gprs/gprs_ns2.h> +#include <osmocom/gsm/gsm48.h> + #include <osmocom/sgsn/gprs_llc.h> #include <osmocom/sgsn/gprs_gmm.h> #include <osmocom/sgsn/sgsn_rim.h> @@ -35,6 +37,7 @@ int sgsn_bssgp_rx_prim(struct osmo_prim_hdr *oph) { struct osmo_bssgp_prim *bp; + struct osmo_routing_area_id ra_id = {}; bp = container_of(oph, struct osmo_bssgp_prim, oph); switch (oph->sap) { @@ -45,11 +48,12 @@ } break; case SAP_BSSGP_GMM: + gprs_rai_to_osmo(&ra_id, bp->ra_id); switch (oph->primitive) { case PRIM_BSSGP_GMM_SUSPEND: - return gprs_gmm_rx_suspend(bp->ra_id, bp->tlli); + return gprs_gmm_rx_suspend(&ra_id, bp->tlli); case PRIM_BSSGP_GMM_RESUME: - return gprs_gmm_rx_resume(bp->ra_id, bp->tlli, + return gprs_gmm_rx_resume(&ra_id, bp->tlli, bp->u.resume.suspend_ref); } break; diff --git a/src/sgsn/gprs_gmm.c b/src/sgsn/gprs_gmm.c index 911d42d..7f70260 100644 --- a/src/sgsn/gprs_gmm.c +++ b/src/sgsn/gprs_gmm.c @@ -312,7 +312,7 @@ t = osmo_tdef_get(sgsn->cfg.T_defs, 3312, OSMO_TDEF_S, -1); aa->ra_upd_timer = gprs_secs_to_tmr_floor(t); aa->radio_prio = 0x44; /* lowest */ - gsm48_encode_ra(&aa->ra_id, &mm->ra); + osmo_routing_area_id_encode_buf((uint8_t *) &aa->ra_id, sizeof(struct gsm48_ra_id), &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1195,7 +1195,7 @@ uint8_t msnc_len, att_type, mi_len, ms_ra_acc_cap_len; uint16_t drx_par; char mi_log_string[32]; - struct gprs_ra_id ra_id; + struct osmo_routing_area_id ra_id; uint16_t cid = 0; enum gsm48_gmm_cause reject_cause; struct osmo_mobile_identity mi; @@ -1210,10 +1210,10 @@ if (!MSG_IU_UE_CTX(msg)) { /* Gb mode */ - cid = bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); + bssgp_parse_cell_id2(&ra_id, &cid, msgb_bcid(msg), 8); } else { #ifdef BUILD_IU - ra_id = MSG_IU_UE_CTX(msg)->ra_id; + gprs_rai_to_osmo(&ra_id, &MSG_IU_UE_CTX(msg)->ra_id); #else LOGMMCTXP(LOGL_ERROR, ctx, "Cannot handle Iu Attach Request, built without Iu support\n"); return -ENOTSUP; @@ -1515,7 +1515,7 @@ t = osmo_tdef_get(sgsn->cfg.T_defs, 3312, OSMO_TDEF_S, -1); rua->ra_upd_timer = gprs_secs_to_tmr_floor(t); - gsm48_encode_ra(&rua->ra_id, &mm->ra); + osmo_routing_area_id_encode_buf((uint8_t *)&rua->ra_id, sizeof(struct gsm48_ra_id), &mm->ra); #if 0 /* Optional: P-TMSI signature */ @@ -1622,7 +1622,7 @@ struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg); uint8_t *cur = gh->data; uint8_t ms_ra_acc_cap_len; - struct gprs_ra_id old_ra_id; + struct osmo_routing_area_id old_ra_id; struct tlv_parsed tp; uint8_t upd_type; enum gsm48_gmm_cause reject_cause = GMM_CAUSE_PROTO_ERR_UNSPEC; @@ -1642,7 +1642,7 @@ get_value_string(gprs_upd_t_strs, upd_type)); /* Old routing area identification 10.5.5.15 */ - gsm48_parse_ra(&old_ra_id, cur); + osmo_routing_area_id_decode(&old_ra_id, cur, msgb_l3len(msg) - (cur - msgb_gmmh(msg))); cur += 6; /* MS Radio Access Capability 10.5.5.12a */ @@ -1709,7 +1709,7 @@ msgb_tlli(msg), mmctx->p_tmsi, mmctx->p_tmsi_old, mmctx->gb.tlli, mmctx->gb.tlli_new, - osmo_rai_name(&mmctx->ra)); + osmo_rai_name2(&mmctx->ra)); /* A RAT change will trigger the common procedure * below after handling the RAT change. Protect it * here from being called twice */ @@ -1717,26 +1717,26 @@ osmo_fsm_inst_dispatch(mmctx->gmm_fsm, E_GMM_COMMON_PROC_INIT_REQ, NULL); } - } else if (!gprs_ra_id_equals(&mmctx->ra, &old_ra_id) || + } else if (osmo_rai_cmp(&mmctx->ra, &old_ra_id) || mmctx->gmm_fsm->state == ST_GMM_DEREGISTERED) { /* We've received either a RAU for a MS which isn't registered * or a RAU with an unknown RA ID. As long the SGSN doesn't support * PS handover we treat this as invalid RAU */ - struct gprs_ra_id new_ra_id; + struct osmo_routing_area_id new_ra_id = {}; char new_ra[32]; - bssgp_parse_cell_id(&new_ra_id, msgb_bcid(msg)); - osmo_rai_name_buf(new_ra, sizeof(new_ra), &new_ra_id); + bssgp_parse_cell_id2(&new_ra_id, NULL, msgb_bcid(msg), 8); + osmo_rai_name2_buf(new_ra, sizeof(new_ra), &new_ra_id); if (mmctx->gmm_fsm->state == ST_GMM_DEREGISTERED) LOGMMCTXP(LOGL_INFO, mmctx, "Rejecting RAU - GMM state is deregistered. Old RA: %s New RA: %s\n", - osmo_rai_name(&old_ra_id), new_ra); + osmo_rai_name2(&old_ra_id), new_ra); else LOGMMCTXP(LOGL_INFO, mmctx, "Rejecting RAU - Old RA doesn't match MM. Old RA: %s New RA: %s\n", - osmo_rai_name(&old_ra_id), new_ra); + osmo_rai_name2(&old_ra_id), new_ra); reject_cause = GMM_CAUSE_IMPL_DETACHED; goto rejected; @@ -1757,10 +1757,10 @@ mmctx = sgsn_mm_ctx_by_llme(llme); if (mmctx) { char old_ra_id_name[32]; - osmo_rai_name_buf(old_ra_id_name, sizeof(old_ra_id_name), &old_ra_id); + osmo_rai_name2_buf(old_ra_id_name, sizeof(old_ra_id_name), &old_ra_id); LOGMMCTXP(LOGL_NOTICE, mmctx, "Rx RA Update Request with unexpected TLLI=%08x Old RA=%s (expected Old RA: %s)!\n", - msgb_tlli(msg), old_ra_id_name, osmo_rai_name(&mmctx->ra)); + msgb_tlli(msg), old_ra_id_name, osmo_rai_name2(&mmctx->ra)); /* mmctx will be released (and its llme un assigned) after REJECT below. */ } } @@ -1784,7 +1784,7 @@ /* Update the MM context with the new RA-ID */ if (mmctx->ran_type == MM_CTX_T_GERAN_Gb && msgb_bcid(msg)) { - bssgp_parse_cell_id(&mmctx->ra, msgb_bcid(msg)); + bssgp_parse_cell_id2(&mmctx->ra, NULL, msgb_bcid(msg), 8); /* Update the MM context with the new (i.e. foreign) TLLI */ mmctx->gb.tlli = msgb_tlli(msg); } @@ -2292,7 +2292,7 @@ return rc; } -int gprs_gmm_rx_suspend(struct gprs_ra_id *raid, uint32_t tlli) +int gprs_gmm_rx_suspend(struct osmo_routing_area_id *raid, uint32_t tlli) { struct sgsn_mm_ctx *mmctx; @@ -2314,7 +2314,7 @@ return 0; } -int gprs_gmm_rx_resume(struct gprs_ra_id *raid, uint32_t tlli, +int gprs_gmm_rx_resume(struct osmo_routing_area_id *raid, uint32_t tlli, uint8_t suspend_ref) { struct sgsn_mm_ctx *mmctx; @@ -2355,10 +2355,10 @@ struct gsm48_hdr *gh = (struct gsm48_hdr *) msgb_gmmh(msg); uint8_t pdisc = gsm48_hdr_pdisc(gh); struct sgsn_mm_ctx *mmctx; - struct gprs_ra_id ra_id; + struct osmo_routing_area_id ra_id = {}; int rc = -EINVAL; - bssgp_parse_cell_id(&ra_id, msgb_bcid(msg)); + bssgp_parse_cell_id2(&ra_id, NULL, msgb_bcid(msg), 8); mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &ra_id); if (mmctx) { rate_ctr_inc(rate_ctr_group_get_ctr(mmctx->ctrg, GMM_CTR_PKTS_SIG_IN)); diff --git a/src/sgsn/gprs_sndcp.c b/src/sgsn/gprs_sndcp.c index 3eae127..636fe2e 100644 --- a/src/sgsn/gprs_sndcp.c +++ b/src/sgsn/gprs_sndcp.c @@ -834,7 +834,7 @@ return -EIO; } /* FIXME: move this RA_ID up to the LLME or even higher */ - bssgp_parse_cell_id(&sne->ra_id, msgb_bcid(msg)); + bssgp_parse_cell_id2(&sne->ra_id, NULL, msgb_bcid(msg), 8); mmctx = sgsn_mm_ctx_by_tlli(msgb_tlli(msg), &sne->ra_id); if (!mmctx) { diff --git a/src/sgsn/gprs_subscriber.c b/src/sgsn/gprs_subscriber.c index a52abe8..07ea4c2 100644 --- a/src/sgsn/gprs_subscriber.c +++ b/src/sgsn/gprs_subscriber.c @@ -877,8 +877,8 @@ osmo_strlcpy(subscr->imei, mmctx->imei, sizeof(subscr->imei)); - if (subscr->lac != mmctx->ra.lac) - subscr->lac = mmctx->ra.lac; + if (subscr->lac != mmctx->ra.lac.lac) + subscr->lac = mmctx->ra.lac.lac; subscr->sgsn_data->mm = mmctx; mmctx->subscr = gprs_subscr_get(subscr); diff --git a/src/sgsn/mmctx.c b/src/sgsn/mmctx.c index 459f6cf..e0af4ed 100644 --- a/src/sgsn/mmctx.c +++ b/src/sgsn/mmctx.c @@ -122,13 +122,13 @@ /* look-up a SGSN MM context based on TLLI + RAI */ struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli(uint32_t tlli, - const struct gprs_ra_id *raid) + const struct osmo_routing_area_id *raid) { struct sgsn_mm_ctx *ctx; llist_for_each_entry(ctx, &sgsn->mm_list, list) { if ((tlli == ctx->gb.tlli || tlli == ctx->gb.tlli_new) && - gprs_ra_id_equals(raid, &ctx->ra)) + !osmo_rai_cmp(raid, &ctx->ra)) return ctx; } @@ -136,7 +136,7 @@ } struct sgsn_mm_ctx *sgsn_mm_ctx_by_tlli_and_ptmsi(uint32_t tlli, - const struct gprs_ra_id *raid) + const struct osmo_routing_area_id *raid) { struct sgsn_mm_ctx *ctx; int tlli_type; @@ -153,7 +153,7 @@ llist_for_each_entry(ctx, &sgsn->mm_list, list) { if ((gprs_tmsi2tlli(ctx->p_tmsi, tlli_type) == tlli || gprs_tmsi2tlli(ctx->p_tmsi_old, tlli_type) == tlli) && - gprs_ra_id_equals(raid, &ctx->ra)) + !osmo_rai_cmp(raid, &ctx->ra)) return ctx; } @@ -239,7 +239,7 @@ } /* Allocate a new SGSN MM context for GERAN_Gb */ struct sgsn_mm_ctx *sgsn_mm_ctx_alloc_gb(uint32_t tlli, - const struct gprs_ra_id *raid) + const struct osmo_routing_area_id *raid) { struct sgsn_mm_ctx *ctx; @@ -267,7 +267,7 @@ return NULL; /* Need to get RAID from IU conn */ - ctx->ra = ue_ctx->ra_id; + gprs_rai_to_osmo(&ctx->ra, &ue_ctx->ra_id); ctx->ran_type = MM_CTX_T_UTRAN_Iu; ctx->iu.ue_ctx = ue_ctx; ctx->iu.ue_ctx->rab_assign_addr_enc = sgsn->cfg.iu.rab_assign_addr_enc; diff --git a/src/sgsn/sgsn_auth.c b/src/sgsn/sgsn_auth.c index cbff6f8..2f5bc8c 100644 --- a/src/sgsn/sgsn_auth.c +++ b/src/sgsn/sgsn_auth.c @@ -133,9 +133,9 @@ /* We simply assume that the IMSI exists, as long as it is part * of 'our' network */ snprintf(mccmnc, sizeof(mccmnc), "%s%s", - osmo_mcc_name(mmctx->ra.mcc), - osmo_mnc_name(mmctx->ra.mnc, mmctx->ra.mnc_3_digits)); - if (strncmp(mccmnc, mmctx->imsi, mmctx->ra.mnc_3_digits ? 6 : 5) == 0) + osmo_mcc_name(mmctx->ra.lac.plmn.mcc), + osmo_mnc_name(mmctx->ra.lac.plmn.mnc, mmctx->ra.lac.plmn.mnc_3_digits)); + if (strncmp(mccmnc, mmctx->imsi, mmctx->ra.lac.plmn.mnc_3_digits ? 6 : 5) == 0) return SGSN_AUTH_ACCEPTED; } diff --git a/src/sgsn/sgsn_cdr.c b/src/sgsn/sgsn_cdr.c index 1536c13..1979d92 100644 --- a/src/sgsn/sgsn_cdr.c +++ b/src/sgsn/sgsn_cdr.c @@ -92,7 +92,7 @@ mmctx->imei, mmctx->msisdn, mmctx->gb.cell_id, - mmctx->ra.lac, + mmctx->ra.lac.lac, mmctx->hlr, ev); return ret; @@ -194,7 +194,7 @@ pdp->mm ? pdp->mm->imei : "N/A", pdp->mm ? pdp->mm->msisdn : "N/A", pdp->mm ? pdp->mm->gb.cell_id : -1, - pdp->mm ? pdp->mm->ra.lac : -1, + pdp->mm ? pdp->mm->ra.lac.lac : -1, pdp->mm ? pdp->mm->hlr : "N/A", ev, (unsigned long ) duration, diff --git a/src/sgsn/sgsn_libgtp.c b/src/sgsn/sgsn_libgtp.c index 39dcc7a..faf0e7f 100644 --- a/src/sgsn/sgsn_libgtp.c +++ b/src/sgsn/sgsn_libgtp.c @@ -143,7 +143,7 @@ uint16_t nsapi, struct tlv_parsed *tp) { - struct gprs_ra_id raid; + struct osmo_routing_area_id raid = {}; struct sgsn_pdp_ctx *pctx; struct pdp_t *pdp; uint64_t imsi_ui64; @@ -273,9 +273,9 @@ /* Routing Area Identifier with LAC and RAC fixed values, as * requested in 29.006 7.3.1 */ raid = mmctx->ra; - raid.lac = 0xFFFE; + raid.lac.lac = 0xFFFE; raid.rac = 0xFF; - gsm48_encode_ra((struct gsm48_ra_id *)pdp->rai.v, &raid); + osmo_routing_area_id_encode_buf(pdp->rai.v, pdp->rai.l, &raid); /* Encode User Location Information accordint to TS 29.060 7.7.51 */ pdp->userloc_given = 1; @@ -290,12 +290,12 @@ pdp->userloc_given = 1; pdp->userloc.l = 8; pdp->userloc.v[0] = 0; /* CGI for GERAN */ - bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->gb.cell_id); + bssgp_create_cell_id2(&pdp->userloc.v[1], 8, &mmctx->ra, mmctx->gb.cell_id); break; case MM_CTX_T_UTRAN_Iu: pdp->userloc.v[0] = 1; /* SAI for UTRAN */ /* SAI is like CGI but with SAC instead of CID, so we can abuse this function */ - bssgp_create_cell_id(&pdp->userloc.v[1], &mmctx->ra, mmctx->iu.sac); + bssgp_create_cell_id2(&pdp->userloc.v[1], 8, &mmctx->ra, mmctx->iu.sac); break; } @@ -684,7 +684,7 @@ rc = osmo_fsm_inst_dispatch(mm->iu.mm_state_fsm, E_PMM_RX_GGSN_GTPU_DT_EI, pctx); rc = gtp_update_context_resp(sgsn->gsn, pdp, GTPCAUSE_ACC_REQ); - ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac, mm->ra.rac); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac.lac, mm->ra.rac); return rc; } #endif @@ -828,7 +828,7 @@ * 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); + ranap_iu_page_ps(mm->imsi, &mm->p_tmsi, mm->ra.lac.lac, mm->ra.rac); return 0; #else @@ -890,7 +890,7 @@ } /* Called by SNDCP when it has received/re-assembled a N-PDU */ -int sgsn_gtp_data_req(struct gprs_ra_id *ra_id, int32_t tlli, uint8_t nsapi, +int sgsn_gtp_data_req(struct osmo_routing_area_id *ra_id, int32_t tlli, uint8_t nsapi, struct msgb *msg, uint32_t npdu_len, uint8_t *npdu) { struct sgsn_mm_ctx *mmctx; diff --git a/src/sgsn/sgsn_vty.c b/src/sgsn/sgsn_vty.c index 6ca5a7d..bcb8dc2 100644 --- a/src/sgsn/sgsn_vty.c +++ b/src/sgsn/sgsn_vty.c @@ -651,7 +651,7 @@ pfx, mm->msisdn, id, mm->hlr, VTY_NEWLINE); vty_out(vty, "%s GMM State: %s, Routeing Area: %s, Cell ID: %u%s", pfx, osmo_fsm_inst_state_name(mm->gmm_fsm), - osmo_rai_name(&mm->ra), mm->gb.cell_id, VTY_NEWLINE); + osmo_rai_name2(&mm->ra), mm->gb.cell_id, VTY_NEWLINE); vty_out(vty, "%s MM State: %s, RAN Type: %s%s", pfx, mm_state_name, get_value_string(sgsn_ran_type_names, mm->ran_type), VTY_NEWLINE); diff --git a/tests/sgsn/sgsn_test.c b/tests/sgsn/sgsn_test.c index a149b8e..29dad74 100644 --- a/tests/sgsn/sgsn_test.c +++ b/tests/sgsn/sgsn_test.c @@ -181,7 +181,7 @@ /* * Create a context and search for it */ -static struct sgsn_mm_ctx *alloc_mm_ctx(uint32_t tlli, struct gprs_ra_id *raid) +static struct sgsn_mm_ctx *alloc_mm_ctx(uint32_t tlli, struct osmo_routing_area_id *raid) { struct sgsn_mm_ctx *ctx, *ictx; struct gprs_llc_lle *lle; @@ -200,7 +200,7 @@ } static void send_0408_message(struct gprs_llc_llme *llme, uint32_t tlli, - const struct gprs_ra_id *bssgp_raid, + const struct osmo_routing_area_id *bssgp_raid, const uint8_t *data, size_t data_len) { struct msgb *msg; @@ -210,7 +210,7 @@ msg = create_msg(data, data_len); msgb_tlli(msg) = tlli; - bssgp_create_cell_id(msgb_bcid(msg), bssgp_raid, 0); + bssgp_create_cell_id2(msgb_bcid(msg), 8, bssgp_raid, 0); gsm0408_gprs_rcvmsg_gb(msg, llme, false); msgb_free(msg); } @@ -375,7 +375,7 @@ const char *imsi1 = "1234567890"; struct gsm_auth_tuple *at; struct sgsn_mm_ctx *ctx; - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; uint32_t local_tlli = 0xffeeddcc; printf("Testing authentication triplet handling\n"); @@ -455,7 +455,7 @@ struct gprs_subscr *s1, *s1found; const char *imsi1 = "1234567890"; struct sgsn_mm_ctx *ctx; - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; uint32_t local_tlli = 0xffeeddcc; struct sgsn_subscriber_pdp_data *pdpd; int rc; @@ -740,7 +740,7 @@ */ static void test_gmm_detach(void) { - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; struct sgsn_mm_ctx *ctx, *ictx; uint32_t local_tlli; @@ -782,7 +782,7 @@ */ static void test_gmm_detach_power_off(void) { - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; struct sgsn_mm_ctx *ctx, *ictx; uint32_t local_tlli; @@ -823,7 +823,7 @@ */ static void test_gmm_detach_no_mmctx(void) { - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; struct gprs_llc_lle *lle; uint32_t local_tlli; @@ -860,7 +860,7 @@ */ static void test_gmm_detach_accept_unexpected(void) { - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; struct gprs_llc_lle *lle; uint32_t local_tlli; @@ -897,7 +897,7 @@ */ static void test_gmm_status_no_mmctx(void) { - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; struct gprs_llc_lle *lle; uint32_t local_tlli; @@ -1092,7 +1092,7 @@ */ static void test_gmm_reject(void) { - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; struct sgsn_mm_ctx *ctx = NULL; uint32_t foreign_tlli; struct gprs_llc_lle *lle; @@ -1237,7 +1237,7 @@ */ static void test_gmm_cancel(void) { - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; struct sgsn_mm_ctx *ctx = NULL; struct sgsn_mm_ctx *ictx; uint32_t ptmsi1; @@ -1446,7 +1446,7 @@ struct gprs_subscr *s1; const char *imsi1 = "1234567890"; struct sgsn_mm_ctx *ctx; - struct gprs_ra_id raid = { 0, }; + struct osmo_routing_area_id raid = { 0, }; uint32_t local_tlli = 0xffeeddcc; enum gsm48_gsm_cause gsm_cause; struct tlv_parsed tp; -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/37860?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: Ia41eb8f51d3836b1bc65325ff1ec6bdb16e20c7e Gerrit-Change-Number: 37860 Gerrit-PatchSet: 4 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-ttcn3-hacks[master]: mme: expect authentication during 2g->4G TAU procedure
by pespin 22 Aug '24

22 Aug '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37892?usp=email ) Change subject: mme: expect authentication during 2g->4G TAU procedure ...................................................................... mme: expect authentication during 2g->4G TAU procedure If TAU happens without an existing security context, network for sure wants to authenticate the UE. This is the scenario being tested here. If there was a security context (eg. from a previous 4G Attach), then it's up to the network to decide (or be capable) to implicitly authenticate the UE. Change-Id: I5ebcaf23a643b6cb97534328737257d26d3981fe --- M library/NAS_Templates.ttcn M mme/MME_Tests.ttcn 2 files changed, 27 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/library/NAS_Templates.ttcn b/library/NAS_Templates.ttcn index d45dc7d..a3e01f7 100644 --- a/library/NAS_Templates.ttcn +++ b/library/NAS_Templates.ttcn @@ -211,6 +211,18 @@ valueField := ptmsi_sig } +/* 9.9.3.34 UE network capability */ +template (value) UENetworkCapabilityLV +ts_UENetworkCapabilityLV(template (value) UENetworkCapabilityV ue_net_cap) := { + lengthIndicator := 0, /* overwritten */ + uENetworkCapabilityV := ue_net_cap +} +template (value) UENetworkCapabilityTLV +ts_UENetworkCapabilityTLV(template (value) UENetworkCapabilityV ue_net_cap) := { + elementIdentifier := '58'O, + uENetworkCapabilityLV := ts_UENetworkCapabilityLV(ue_net_cap) +} + /* 9.9.3.45 GUTI Type */ const BIT1 GUTI_TYPE_NATIVE := '0'B; const BIT1 GUTI_TYPE_MAPPED := '1'B; @@ -471,7 +483,8 @@ template (omit) P_TMSISignatureTV old_ptmsi_sig := omit, template (omit) GUTI_TypeTV old_guti_type := omit, template (omit) NonceTV nonce_ue := omit, - template (omit) CipheringKeySequenceNumberTV gprs_cksn := omit) := { + template (omit) CipheringKeySequenceNumberTV gprs_cksn := omit, + template (omit) UENetworkCapabilityTLV ue_net_cap := omit) := { protocolDiscriminator := c_EPS_NAS_PD_EMM, ePS_messages := { ePS_MobilityManagement := { @@ -486,7 +499,7 @@ old_P_TMSISignature := old_ptmsi_sig, additionalGUTI := omit, nonce := nonce_ue, - uENetworkCapability := omit, + uENetworkCapability := ue_net_cap, lastVisitedRegisteredTAI := omit, dRXParameter := omit, uE_RadioCapabilityInfoUpdateNeeded := omit, @@ -1286,8 +1299,4 @@ } } - - - - } diff --git a/mme/MME_Tests.ttcn b/mme/MME_Tests.ttcn index 4edeb99..ca36e24 100644 --- a/mme/MME_Tests.ttcn +++ b/mme/MME_Tests.ttcn @@ -980,7 +980,8 @@ private altstep as_gtp_sgsn_context_2g_to_4g(OCT4 new_sgsn_teid := 'ABABABAB'O, GTPv1C_Templates.GTP_RATType rat_type := GTP_RAT_TYPE_EUTRAN, RoutingAreaIdentity rai, OCT4 ptmsi, - OCT3 ptmsi_sig + OCT3 ptmsi_sig, + boolean exp_auth := false ) runs on ConnHdlr { var Gtp1cUnitdata gtpc_pdu; @@ -1009,6 +1010,12 @@ oct2int(gtpc_pdu.gtpc.opt_part.sequenceNumber), SGSNContextRespPDU)); + if (exp_auth) { + as_DIA_AuthInfo(); + as_s1ap_handle_auth(); + as_s1ap_handle_sec_mode(); + } + GTP[0].receive(tr_GTPC_SGSNContextAck(g_gn_iface_peer, new_sgsn_teid, tr_SGSNContextAckPDU(GTP_CAUSE_REQUEST_ACCEPTED))) -> value gtpc_pdu; setverdict(pass); @@ -1517,6 +1524,7 @@ timer T := 5.0; var bitstring ptmsi_bits := oct2bit(ptmsi); var OCT4 ptmsi_exp := bit2oct('11'B & substr(ptmsi_bits, 2, 30)); + var template (value) UENetworkCapabilityTLV ue_net_cap := ts_UENetworkCapabilityTLV(c_NAS_defaultUeNetCap); rai := valueof(ts_RoutingAreaIdentity(mp_gn_local_mcc, mp_gn_local_mnc, int2oct(mp_gn_local_lac, 2), int2oct(mp_gn_local_rac, 1))); @@ -1527,7 +1535,8 @@ ts_PTMSI_SignatureTV(ptmsi_sig), ts_GUTI_TypeTV(GUTI_TYPE_MAPPED), ts_NonceTV('12345678'O), - ts_CipheringKeySequenceNumberTV('000'B)); + ts_CipheringKeySequenceNumberTV('000'B), + ue_net_cap := ue_net_cap); tx := ts_S1AP_InitialUE(p_eNB_value := 0, p_nasPdu := enc_PDU_NAS_EPS(valueof(nas_tau)), p_tAI := ts_enb_S1AP_TAI(g_pars.enb_pars[g_pars.mme_idx]), p_eUTRAN_CGI := ts_enb_S1AP_CGI(g_pars.enb_pars[g_pars.mme_idx]), @@ -1541,7 +1550,7 @@ }; S1AP.send(cfg); - as_gtp_sgsn_context_2g_to_4g(new_sgsn_teid, GTP_RAT_TYPE_EUTRAN, rai, ptmsi_exp, ptmsi_sig); + as_gtp_sgsn_context_2g_to_4g(new_sgsn_teid, GTP_RAT_TYPE_EUTRAN, rai, ptmsi_exp, ptmsi_sig, exp_auth := true); /* We now expect the MME to send a Create Session Request to the SGW-C */ T.start; -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/37892?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: merged Gerrit-Project: osmo-ttcn3-hacks Gerrit-Branch: master Gerrit-Change-Id: I5ebcaf23a643b6cb97534328737257d26d3981fe Gerrit-Change-Number: 37892 Gerrit-PatchSet: 5 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de> Gerrit-Reviewer: fixeria <vyanitskiy(a)sysmocom.de> Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 31
  • 32
  • 33
  • 34
  • 35
  • 36
  • 37
  • ...
  • 148
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.