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

October 2024

  • 1 participants
  • 1631 discussions
[S] Change in osmo-ci[master]: jobs/ttcn3-testsuites-testenv: tweak description
by osmith 18 Oct '24

18 Oct '24
Hello Jenkins Builder, I'd like you to reexamine a change. Please visit https://gerrit.osmocom.org/c/osmo-ci/+/38459?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: jobs/ttcn3-testsuites-testenv: tweak description ...................................................................... jobs/ttcn3-testsuites-testenv: tweak description Don't link to osmo-ttcn3-hacks.git directly anymore, the wiki page that is also linked already refers to it. This shortens the boilerplate of the description with every one of these jenkins jobs. Instead of only displaying the arguments, display the full command so users can easily run the testsuite the same way it is running on jenkins. Omit the arguments --cache, --ccache, --log-dir, which only need to be adjusted for jenkins, for users the defaults make sense. Let the kernel line link to the related build-kernel job. Related: OS#6494 Change-Id: Ifad86aa3982c325394d47b5c8cf98c43b2d3d1eb --- M jobs/ttcn3-testsuites-testenv.yml 1 file changed, 8 insertions(+), 8 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/59/38459/2 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/38459?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: newpatchset Gerrit-Project: osmo-ci Gerrit-Branch: master Gerrit-Change-Id: Ifad86aa3982c325394d47b5c8cf98c43b2d3d1eb Gerrit-Change-Number: 38459 Gerrit-PatchSet: 2 Gerrit-Owner: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder
1 0
0 0
[XS] Change in osmo-ci[master]: jobs/ttcn3-testsuites-testenv: tweak description
by osmith 18 Oct '24

18 Oct '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ci/+/38459?usp=email ) Change subject: jobs/ttcn3-testsuites-testenv: tweak description ...................................................................... jobs/ttcn3-testsuites-testenv: tweak description Instead of only displaying the arguments, display the full command so users can easily run the testsuite the same way it is running on jenkins. Omit the aruments --cache, --ccache, --log-dir, which only need to be adjusted for jenkins, for users the defaults make sense. Let the kernel line link to the related build-kernel job. Change-Id: Ifad86aa3982c325394d47b5c8cf98c43b2d3d1eb --- M jobs/ttcn3-testsuites-testenv.yml 1 file changed, 5 insertions(+), 3 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/59/38459/1 diff --git a/jobs/ttcn3-testsuites-testenv.yml b/jobs/ttcn3-testsuites-testenv.yml index a9e62d6..640ff2d 100644 --- a/jobs/ttcn3-testsuites-testenv.yml +++ b/jobs/ttcn3-testsuites-testenv.yml @@ -10,11 +10,13 @@ See <a href="https://osmocom.org/projects/cellular-infrastructure/wiki/Titan_TTCN3_Tests…"> TTCN3 Testsuite</a> for more information.<br> <br> - Arguments:<br> - <code>{args}</code><br> + Command:<br> + <code>./testenv.py run {testsuite} --podman {args}</code><br> <br> Kernel:<br> - <code>{kernel}</code><br> + <a href="https://jenkins.osmocom.org/jenkins/job/build-kernel-{kernel}/"> + <code>{kernel}</code> + </a><br> timer: "@midnight" kernel: "none" node: ttcn3 -- To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/38459?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: Ifad86aa3982c325394d47b5c8cf98c43b2d3d1eb Gerrit-Change-Number: 38459 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: ggsn: README: document how to run with testenv
by osmith 18 Oct '24

18 Oct '24
osmith has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38458?usp=email ) Change subject: ggsn: README: document how to run with testenv ...................................................................... ggsn: README: document how to run with testenv It is possible to run the GGSN testsuite in a lot of ways (as it was ported from docker-playground, which had the same variations but with a less consistent way of running them). Document how it is typically run for development / in jenkins. This should make it easier for users, in addition to testenv already telling which configs are available if trying to run the ggsn testsuite without the -c argument, and to the general help output in "./testenv.py run -h". $ ./testenv.py run ggsn [testenv] Using testsuite ggsn_tests (via alias ggsn) [testenv] Found multiple testenv.cfg files: [testenv] * testenv_open5gs.cfg [testenv] * testenv_osmo_ggsn_all.cfg [testenv] * testenv_osmo_ggsn_v4_only.cfg [testenv] * testenv_osmo_ggsn_v4v6_only.cfg [testenv] * testenv_osmo_ggsn_v6_only.cfg [testenv] Select a specific config (e.g. '-c open5gs') or all ('-c all') Change-Id: I49421151b199fa6536da784b6c412b03f3fdbd05 --- M ggsn_tests/README.md 1 file changed, 72 insertions(+), 4 deletions(-) git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/58/38458/1 diff --git a/ggsn_tests/README.md b/ggsn_tests/README.md index 71468d5..f40c4b0 100644 --- a/ggsn_tests/README.md +++ b/ggsn_tests/README.md @@ -1,9 +1,10 @@ # GGSN_Tests.ttcn -* external interfaces - * Gp: GTP (emulates SGSN) - * Gi: IP (emulates Internet) - * VTY +## External interfaces + +* Gp: GTP (emulates SGSN) +* Gi: IP (emulates Internet) +* VTY {% dot ggsn_tests.svg digraph G { @@ -16,3 +17,70 @@ ATS -> GGSN [label="VTY"]; } %} + +## How to run + +### osmo-ggsn + +osmo-ggsn with APN config [all](osmo-ggsn/osmo-ggsn-all.confmerge): +``` +$ ./testenv.py run ggsn -c osmo_ggsn_all +``` + +osmo-ggsn with APN config [v4_only](osmo-ggsn/osmo-ggsn-v4_only.confmerge): +``` +$ ./testenv.py run ggsn -c osmo_ggsn_v4_only +``` + +osmo-ggsn with APN configs +[all](osmo-ggsn/osmo-ggsn-all.confmerge), +[v4_only](osmo-ggsn/osmo-ggsn-v4_only.confmerge), +[v6_only](osmo-ggsn/osmo-ggsn-v6_only.confmerge) and +[v4v6_only](osmo-ggsn/osmo-ggsn-v4v6_only.confmerge): +``` +$ ./testenv.py run ggsn -c 'osmo_ggsn_*' +``` + +### osmo-ggsn + kernel GTP-U + +osmo-ggsn with APN config [v4_only](osmo-ggsn/osmo-ggsn-v4_only.confmerge) +and kernel GTP-U with a custom kernel: +``` +$ wget -O .linux https://jenkins.osmocom.org/jenkins/job/build-kernel-net-next/lastSuccessfu… +$ ./testenv.py run ggsn -c osmo_ggsn_v4_only -C +``` + +osmo-ggsn with APN config [v4_only](osmo-ggsn/osmo-ggsn-v4_only.confmerge) +and kernel GTP-U with Debian kernel: +``` +$ ./testenv.py run ggsn -c osmo_ggsn_v4_only --podman -D +``` + +osmo-ggsn with APN configs +[v4_only](osmo-ggsn/osmo-ggsn-v4_only.confmerge), +[v6_only](osmo-ggsn/osmo-ggsn-v6_only.confmerge) and +[v4v6_only](osmo-ggsn/osmo-ggsn-v4v6_only.confmerge) +and kernel GTP-U with Debian kernel: +``` +$ ./testenv.py run ggsn -c 'osmo_ggsn_v*_only' --podman -D +``` + +### open5gs + +``` +$ ./testenv.py run ggsn -c open5gs +``` + +## Related Jenkins jobs + +The jenkins jobs have the testenv arguments they use in their description. + +* [ttcn3-ggsn-test](https://jenkins.osmocom.org/jenkins/job/ttcn3-ggsn-test/) +* [ttcn3-ggsn-test-latest](https://jenkins.osmocom.org/jenkins/job/ttcn3-ggsn-… +* [ttcn3-ggsn-test-kernel](https://jenkins.osmocom.org/jenkins/job/ttcn3-ggsn-… +* [ttcn3-ggsn-test-kernel-latest](https://jenkins.osmocom.org/jenkins/job/ttcn… +* [ttcn3-ggsn-test-kernel-net-next](https://jenkins.osmocom.org/jenkins/job/tt… +* [ttcn3-ggsn-test-kernel-latest-net-next](https://jenkins.osmocom.org/jenkins… +* [ttcn3-ggsn-test-kernel-torvalds](https://jenkins.osmocom.org/jenkins/job/tt… +* [ttcn3-ggsn-test-kernel-latest-torvalds](https://jenkins.osmocom.org/jenkins… +* [ttcn3-ggsn-test-ogs](https://jenkins.osmocom.org/jenkins/job/ttcn3-ggsn-tes… -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38458?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: I49421151b199fa6536da784b6c412b03f3fdbd05 Gerrit-Change-Number: 38458 Gerrit-PatchSet: 1 Gerrit-Owner: osmith <osmith(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-sgsn[master]: GTP: CreatePDPContext: only use IMEISV IE when IMEISV is known
by pespin 17 Oct '24

17 Oct '24
Attention is currently required from: laforge, lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/38444?usp=email ) Change subject: GTP: CreatePDPContext: only use IMEISV IE when IMEISV is known ...................................................................... Patch Set 1: (1 comment) File src/sgsn/sgsn_libgtp.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/38444/comment/fb5f4440_56193715?us… : PS1, Line 303: if (mmctx->imei[0] != 0x00) { > Would be strlen() more clear? […] IMHO checking against ='\0' is good enough and more efficient. It clarifies it is a string and your are checking if it's empty. -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38444?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I812af1e702e77214244f32ae65663c1a03b23962 Gerrit-Change-Number: 38444 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Thu, 17 Oct 2024 17:25:10 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de> Comment-In-Reply-To: lynxis lazus <lynxis(a)fe80.eu>
1 0
0 0
[S] Change in osmo-sgsn[master]: GTP: CreatePDPContext: only use IMEISV IE when IMEISV is known
by lynxis lazus 17 Oct '24

17 Oct '24
Attention is currently required from: laforge. lynxis lazus has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/38444?usp=email ) Change subject: GTP: CreatePDPContext: only use IMEISV IE when IMEISV is known ...................................................................... Patch Set 1: (1 comment) File src/sgsn/sgsn_libgtp.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/38444/comment/c3f83f58_332710fe?us… : PS1, Line 303: if (mmctx->imei[0] != 0x00) { > a 0 digit would be 0x30, not 0x00. But yes, '\0' is more clear. Would be strlen() more clear? The imei handling in general could also receive some love. Since mm->imei contains imei+checksum digits+nullbyte But we don't have the Software Version somewhere. -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38444?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I812af1e702e77214244f32ae65663c1a03b23962 Gerrit-Change-Number: 38444 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Comment-Date: Thu, 17 Oct 2024 17:23:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[S] Change in osmo-sgsn[master]: GTP: CreatePDPContext: only use IMEISV IE when IMEISV is known
by pespin 17 Oct '24

17 Oct '24
Attention is currently required from: laforge, lynxis lazus. pespin has posted comments on this change by lynxis lazus. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/38444?usp=email ) Change subject: GTP: CreatePDPContext: only use IMEISV IE when IMEISV is known ...................................................................... Patch Set 1: (1 comment) File src/sgsn/sgsn_libgtp.c: https://gerrit.osmocom.org/c/osmo-sgsn/+/38444/comment/6a72aa88_7a40c337?us… : PS1, Line 303: if (mmctx->imei[0] != 0x00) { > a 0 digit would be 0x30, not 0x00. But yes, '\0' is more clear. So if this is a string, please use '\0', otherwise it's confusing when reading at the code. -- To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/38444?usp=email To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email Gerrit-MessageType: comment Gerrit-Project: osmo-sgsn Gerrit-Branch: master Gerrit-Change-Id: I812af1e702e77214244f32ae65663c1a03b23962 Gerrit-Change-Number: 38444 Gerrit-PatchSet: 1 Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: Jenkins Builder Gerrit-CC: laforge <laforge(a)osmocom.org> Gerrit-CC: pespin <pespin(a)sysmocom.de> Gerrit-Attention: laforge <laforge(a)osmocom.org> Gerrit-Attention: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Comment-Date: Thu, 17 Oct 2024 17:23:59 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Comment-In-Reply-To: laforge <laforge(a)osmocom.org> Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: cosmetic: sgsn: Fix indenation whitespace
by pespin 17 Oct '24

17 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38453?usp=email ) Change subject: cosmetic: sgsn: Fix indenation whitespace ...................................................................... cosmetic: sgsn: Fix indenation whitespace Use tabs as done in all the file. Change-Id: I8cb9283fee9d5a4ff5c34b9cde4d8fcce400343a --- M sgsn/BSSGP_ConnHdlr.ttcn 1 file changed, 25 insertions(+), 25 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index a966a43..78a81bc 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -111,31 +111,31 @@ }; function f_new_BSSGP_ConnHdlrPars(integer imsi_suffix, - template (value) BssgpCellIds cell_ids, - template (value) SGSN_ConnHdlrNetworkPars net_pars := t_NetPars(), - float t_guard := 30.0) return BSSGP_ConnHdlrPars { - var template (value) BSSGP_ConnHdlrPars pars; - pars := { - imei := f_gen_imei(imsi_suffix), - imsi := f_gen_imsi(imsi_suffix), - msisdn := f_gen_msisdn(imsi_suffix), - p_tmsi := omit, - p_tmsi_sig := omit, - tlli := f_gprs_tlli_random(), - tlli_old := omit, - ra := omit, - bssgp_cell_id := cell_ids, - rnc_send_initial_ue := true, - vec := omit, - net := net_pars, - t_guard := t_guard, - sccp_addr_local := omit, - sccp_addr_peer := omit, - ranap_exp_itu_x213_addr_format := omit, - ranap_use_itu_x213_addr_format := false, - ranap_itu_x213_addr_format_padding := ''O - } - return valueof(pars); + template (value) BssgpCellIds cell_ids, + template (value) SGSN_ConnHdlrNetworkPars net_pars := t_NetPars(), + float t_guard := 30.0) return BSSGP_ConnHdlrPars { + var template (value) BSSGP_ConnHdlrPars pars; + pars := { + imei := f_gen_imei(imsi_suffix), + imsi := f_gen_imsi(imsi_suffix), + msisdn := f_gen_msisdn(imsi_suffix), + p_tmsi := omit, + p_tmsi_sig := omit, + tlli := f_gprs_tlli_random(), + tlli_old := omit, + ra := omit, + bssgp_cell_id := cell_ids, + rnc_send_initial_ue := true, + vec := omit, + net := net_pars, + t_guard := t_guard, + sccp_addr_local := omit, + sccp_addr_peer := omit, + ranap_exp_itu_x213_addr_format := omit, + ranap_use_itu_x213_addr_format := false, + ranap_itu_x213_addr_format_padding := ''O + } + return valueof(pars); } private altstep as_Tguard() runs on BSSGP_ConnHdlr { -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38453?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: I8cb9283fee9d5a4ff5c34b9cde4d8fcce400343a Gerrit-Change-Number: 38453 Gerrit-PatchSet: 1 Gerrit-Owner: pespin <pespin(a)sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <laforge(a)osmocom.org> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Improve validation of TLA encoded in RAB Ass Req
by pespin 17 Oct '24

17 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38452?usp=email ) Change subject: sgsn: Improve validation of TLA encoded in RAB Ass Req ...................................................................... sgsn: Improve validation of TLA encoded in RAB Ass Req Validate received TLA in RAB Ass Req according to confguration and test expectancies. Related: OS#6508 Related: SYS#7119 Change-Id: I725bf39c5564fb320954fc9e387ac569fc1a0136 --- M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests_Iu.ttcn 2 files changed, 65 insertions(+), 13 deletions(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved fixeria: Looks good to me, but someone else must approve diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index e6503ac..a966a43 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -103,6 +103,8 @@ /* only in IuPS / RANAP case */ SCCP_PAR_Address sccp_addr_local optional, SCCP_PAR_Address sccp_addr_peer optional, + /* Whether to expect an specific addr format in RAB Ass Req: true = X.213, false = raw IPv4, omit = don't care */ + boolean ranap_exp_itu_x213_addr_format optional, /* Whether to encode HNBGW addr with ITU X.213 format when sending RAB Ass Resp: */ boolean ranap_use_itu_x213_addr_format, octetstring ranap_itu_x213_addr_format_padding @@ -129,6 +131,7 @@ t_guard := t_guard, sccp_addr_local := omit, sccp_addr_peer := omit, + ranap_exp_itu_x213_addr_format := omit, ranap_use_itu_x213_addr_format := false, ranap_itu_x213_addr_format_padding := ''O } @@ -698,22 +701,38 @@ } } +/* Validate received IP address + TEID from SGSN is the one we + * did set up from the GGSN, since the SGSN is expected to do + * Direct Tunnel: */ +private function f_ranap_rab_ass_req_validate_tli(RANAP_PDU rab_ass_req, PdpActPars apars) +runs on BSSGP_ConnHdlr { + var TransportLayerInformation tli := f_ranap_rab_ass_req_extract_tli(rab_ass_req); + var template (present) TransportLayerAddress exp_tla_x213 := decmatch tr_NSAP_Address_IANA_BIN_IPv4(apars.ggsn_ip_u); + var template (present) TransportLayerAddress exp_tla_raw := oct2bit(apars.ggsn_ip_u); + var template (present) TransportLayerAddress exp_tla; + var template (present) TransportLayerInformation exp_tli; + if (ispresent(g_pars.ranap_exp_itu_x213_addr_format)) { + if (g_pars.ranap_exp_itu_x213_addr_format) { + exp_tla := exp_tla_x213; + } else { + exp_tla := exp_tla_raw; + } + } else { /* Accept any of the known formats: */ + exp_tla := (exp_tla_x213, exp_tla_raw); + } + exp_tli := tr_TLI_ps(exp_tla, apars.ggsn_tei_u); + if (not match(tli, exp_tli)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx RAB Ass Req with TLI ", tli, " vs exp ", exp_tli)); + } +} + altstep as_ranap_rab_ass_req(inout PdpActPars apars) runs on BSSGP_ConnHdlr { var RANAP_PDU ranap; [] BSSAP.receive(tr_RANAP_RabAssReq(?)) -> value ranap { var RAB_ID rab_id := f_ranap_rab_ass_req_extract_rab_id(ranap); - var TransportLayerInformation tli := f_ranap_rab_ass_req_extract_tli(ranap); - /* Validate received IP address + TEID from SGSN is the one we - * did set up from the GGSN, since the SGSN is expected to do - * Direct Tunnel: */ - var template (present) TransportLayerInformation exp_tli := - tr_TLI_ps(oct2bit(enc_NSAP_Address(valueof(ts_NSAP_Address_IANA_BIN_IPv4Len20(apars.ggsn_ip_u)))), - apars.ggsn_tei_u); - if (not match(tli, exp_tli)) { - Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, - log2str("Rx RAB Ass Req with TLI ", tli, " vs exp ", exp_tli)); - } + f_ranap_rab_ass_req_validate_tli(ranap, apars); var template (value) RAB_SetupOrModifiedList l; var bitstring tla_bits; diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn index 61bd8a9..7a7ee7c 100644 --- a/sgsn/SGSN_Tests_Iu.ttcn +++ b/sgsn/SGSN_Tests_Iu.ttcn @@ -19,6 +19,7 @@ import from BSSGP_ConnHdlr all; + private function f_init() runs on test_CT { g_iu_enable := true; SGSN_Tests.f_init(); @@ -27,6 +28,14 @@ f_vty_config(SGSNVTY, "sgsn", "encryption uea 0"); } +private function f_vty_iu_rab_assign_addr_enc(boolean use_itu_x213 := true) runs on test_CT { + if (use_itu_x213) { + f_vty_config(SGSNVTY, "sgsn", "iu rab-assign-addr-enc x213"); + } else { + f_vty_config(SGSNVTY, "sgsn", "iu rab-assign-addr-enc v4raw"); + } +} + private function f_TC_iu_attach(charstring id) runs on BSSGP_ConnHdlr { var PdpActPars apars := valueof(t_PdpActPars(mp_ggsn_ip, mp_ranap_cfg[0].sctp_addr.local_ip_addr)); @@ -147,14 +156,37 @@ vc_conn.done; f_cleanup(); } -/* Same as TC_attach_pdp_act_user, but encoding HNBGW addr using ITU X.213 -format (IPv4, with padding to reach 20 bytes) in RAB Ass Resp. See OS#6508. */ + +/* Same as TC_attach_pdp_act_user, but: + * - Configure SGSN to send v4raw address in RAB Ass REQ + * - Transmit HNBGW addr using v4raw format in RAB Ass Resp. + */ +testcase TC_attach_pdp_act_user_addr_v4raw() runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + var BSSGP_ConnHdlrPars pars; + f_init(); + f_sleep(1.0); + f_vty_iu_rab_assign_addr_enc(false); /* Force v4raw */ + pars := f_new_BSSGP_ConnHdlrPars(1058, f_cell_ids_from_gb(g_gb)); + pars.ranap_exp_itu_x213_addr_format := false; + pars.ranap_use_itu_x213_addr_format := false; + vc_conn := f_start_handler_pars(refers(f_TC_attach_pdp_act_user), testcasename(), g_gb, pars); + vc_conn.done; + f_cleanup(); +} +/* Same as TC_attach_pdp_act_user, but: + * - Configure SGSN to send ITU X.213 address in RAB Ass REQ + * - Transmit HNBGW addr using ITU X.213 format (IPv4, with different padding) + * in RAB Ass Resp. See OS#6508. + */ function f_TC_attach_pdp_act_user_addr_itu_x213_ipv4len(integer imsi_suffix, octetstring padding) runs on test_CT { var BSSGP_ConnHdlr vc_conn; var BSSGP_ConnHdlrPars pars; f_init(); f_sleep(1.0); + f_vty_iu_rab_assign_addr_enc(true); pars := f_new_BSSGP_ConnHdlrPars(imsi_suffix, f_cell_ids_from_gb(g_gb)); + pars.ranap_exp_itu_x213_addr_format := true; pars.ranap_use_itu_x213_addr_format := true; pars.ranap_itu_x213_addr_format_padding := padding; vc_conn := f_start_handler_pars(refers(f_TC_attach_pdp_act_user), testcasename(), g_gb, pars); @@ -390,6 +422,7 @@ execute( TC_iu_attach_geran_rau() ); execute( TC_geran_attach_iu_rau() ); execute( TC_attach_pdp_act_user() ); + execute( TC_attach_pdp_act_user_addr_v4raw() ); execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4len7() ); execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4len20() ); execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4lentoolarge() ); -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38452?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: I725bf39c5564fb320954fc9e387ac569fc1a0136 Gerrit-Change-Number: 38452 Gerrit-PatchSet: 1 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: pespin <pespin(a)sysmocom.de>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Test tx Rab Ass Resp with ITU X.213 IPv4 address format
by pespin 17 Oct '24

17 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38434?usp=email ) Change subject: sgsn: Test tx Rab Ass Resp with ITU X.213 IPv4 address format ...................................................................... sgsn: Test tx Rab Ass Resp with ITU X.213 IPv4 address format Related: OS#6508 Related: SYS#7119 Change-Id: I38dd85f617600a974cbe8fd17597282eaf950a78 --- M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/SGSN_Tests.ttcn M sgsn/SGSN_Tests_Iu.ttcn M sgsn/expected-results.xml 4 files changed, 55 insertions(+), 9 deletions(-) Approvals: Jenkins Builder: Verified pespin: Looks good to me, approved laforge: Looks good to me, but someone else must approve diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index 121ac2d..e578748 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -102,7 +102,10 @@ float t_guard, /* only in IuPS / RANAP case */ SCCP_PAR_Address sccp_addr_local optional, - SCCP_PAR_Address sccp_addr_peer optional + SCCP_PAR_Address sccp_addr_peer optional, + /* Whether to encode HNBGW addr with ITU X.213 format when sending RAB Ass Resp: */ + boolean ranap_use_itu_x213_addr_format, + octetstring ranap_itu_x213_addr_format_padding }; function f_new_BSSGP_ConnHdlrPars(integer imsi_suffix, @@ -125,7 +128,9 @@ net := net_pars, t_guard := t_guard, sccp_addr_local := omit, - sccp_addr_peer := omit + sccp_addr_peer := omit, + ranap_use_itu_x213_addr_format := false, + ranap_itu_x213_addr_format_padding := ''O } return valueof(pars); } @@ -709,8 +714,15 @@ Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, log2str("Rx RAB Ass Req with TLI ", tli, " vs exp ", exp_tli)); } + var template (value) RAB_SetupOrModifiedList l; - l := ts_RAB_SMdL_ps(rab_id, oct2bit(apars.rnc_ip_u), apars.rnc_tei_u); + var bitstring tla_bits; + if (g_pars.ranap_use_itu_x213_addr_format) { + tla_bits := oct2bit(enc_NSAP_Address(valueof(ts_NSAP_Address_IANA_BIN_IPv4(apars.rnc_ip_u, g_pars.ranap_itu_x213_addr_format_padding)))); + } else { + tla_bits := oct2bit(apars.rnc_ip_u); + } + l := ts_RAB_SMdL_ps(rab_id, tla_bits, apars.rnc_tei_u); BSSAP.send(ts_RANAP_RabAssResp(l)); } } diff --git a/sgsn/SGSN_Tests.ttcn b/sgsn/SGSN_Tests.ttcn index 1d6d924..4148c6c 100644 --- a/sgsn/SGSN_Tests.ttcn +++ b/sgsn/SGSN_Tests.ttcn @@ -448,18 +448,28 @@ sccp_addr_peer := omit }; +function f_cell_ids_from_gb(GbInstances gb) return BssgpCellIds +{ + var BssgpCellIds cell_ids := { + gb[0].cfg.bvc[0].cell_id, + gb[1].cfg.bvc[0].cell_id, + gb[2].cfg.bvc[0].cell_id + } + return cell_ids; +} + /* helper function to create, connect and start a BSSGP_ConnHdlr component */ function f_start_handler(bssgp_connhdlr_void_fn fn, charstring id, GbInstances gb, integer imsi_suffix, float t_guard := 30.0, boolean expect_ciph := false) runs on test_CT return BSSGP_ConnHdlr { var BSSGP_ConnHdlrPars pars; + pars := f_new_BSSGP_ConnHdlrPars(imsi_suffix, f_cell_ids_from_gb(gb), t_NetPars(expect_ciph := expect_ciph), t_guard := t_guard); + return f_start_handler_pars(fn, id, gb, pars); +} + +function f_start_handler_pars(bssgp_connhdlr_void_fn fn, charstring id, GbInstances gb, BSSGP_ConnHdlrPars pars) +runs on test_CT return BSSGP_ConnHdlr { var BSSGP_ConnHdlr vc_conn; - var BssgpCellIds cell_ids := { - gb[0].cfg.bvc[0].cell_id, - gb[1].cfg.bvc[0].cell_id, - gb[2].cfg.bvc[0].cell_id - } - pars := f_new_BSSGP_ConnHdlrPars(imsi_suffix, cell_ids, t_NetPars(expect_ciph := expect_ciph), t_guard := t_guard); if (g_iu_enable) { pars.sccp_addr_local := g_iu[0].ranap.sccp_addr_own; pars.sccp_addr_peer := g_iu[0].ranap.sccp_addr_peer; diff --git a/sgsn/SGSN_Tests_Iu.ttcn b/sgsn/SGSN_Tests_Iu.ttcn index f5339d4..cc9167a 100644 --- a/sgsn/SGSN_Tests_Iu.ttcn +++ b/sgsn/SGSN_Tests_Iu.ttcn @@ -146,6 +146,26 @@ vc_conn.done; f_cleanup(); } +/* Same as TC_attach_pdp_act_user, but encoding HNBGW addr using ITU X.213 +format (IPv4, with padding to reach 20 bytes) in RAB Ass Resp. See OS#6508. */ +function f_TC_attach_pdp_act_user_addr_itu_x213_ipv4len(integer imsi_suffix, octetstring padding) runs on test_CT { + var BSSGP_ConnHdlr vc_conn; + var BSSGP_ConnHdlrPars pars; + f_init(); + f_sleep(1.0); + pars := f_new_BSSGP_ConnHdlrPars(imsi_suffix, f_cell_ids_from_gb(g_gb)); + pars.ranap_use_itu_x213_addr_format := true; + pars.ranap_itu_x213_addr_format_padding := padding; + vc_conn := f_start_handler_pars(refers(f_TC_attach_pdp_act_user), testcasename(), g_gb, pars); + vc_conn.done; + f_cleanup(); +} +testcase TC_attach_pdp_act_user_addr_itu_x213_ipv4len7() runs on test_CT { + f_TC_attach_pdp_act_user_addr_itu_x213_ipv4len(1055, ''O) +} +testcase TC_attach_pdp_act_user_addr_itu_x213_ipv4len20() runs on test_CT { + f_TC_attach_pdp_act_user_addr_itu_x213_ipv4len(1056, '00000000000000000000000000'O) +} /* Test UE going to PMM IDLE state after having activated the PDP context. * SGSN is expected to update the GGSN cancelling the Direct Tunnel feature. */ @@ -330,6 +350,8 @@ execute( TC_iu_attach_geran_rau() ); execute( TC_geran_attach_iu_rau() ); execute( TC_attach_pdp_act_user() ); + execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4len7() ); + execute( TC_attach_pdp_act_user_addr_itu_x213_ipv4len20() ); execute( TC_attach_pdp_act_pmm_idle() ); execute( TC_pmm_idle_rx_mt_data() ); execute( TC_update_ctx_err_ind_from_ggsn() ); diff --git a/sgsn/expected-results.xml b/sgsn/expected-results.xml index 40b6592..fbd31e6 100644 --- a/sgsn/expected-results.xml +++ b/sgsn/expected-results.xml @@ -94,6 +94,8 @@ <testcase classname='SGSN_Tests_Iu' name='TC_iu_attach_geran_rau' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_geran_attach_iu_rau' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_user' time='MASKED'/> + <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_user_addr_itu_x213_ipv4len7' time='MASKED'/> + <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_user_addr_itu_x213_ipv4len20' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_pmm_idle' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_attach_pdp_act_pmm_idle_lost_pdp_status' time='MASKED'/> <testcase classname='SGSN_Tests_Iu' name='TC_pmm_idle_rx_mt_data' time='MASKED'/> -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38434?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: I38dd85f617600a974cbe8fd17597282eaf950a78 Gerrit-Change-Number: 38434 Gerrit-PatchSet: 4 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>
1 0
0 0
[M] Change in osmo-ttcn3-hacks[master]: sgsn: Validate TLI received in RAB Ass Req
by pespin 17 Oct '24

17 Oct '24
pespin has submitted this change. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38433?usp=email ) Change subject: sgsn: Validate TLI received in RAB Ass Req ...................................................................... sgsn: Validate TLI received in RAB Ass Req Related: OS#6508 Change-Id: I3a3699cea981caa89b30742c031d5f232418b0ee --- A library/ITU_X213_Types.ttcn M library/ranap/RANAP_Templates.ttcn M sgsn/BSSGP_ConnHdlr.ttcn M sgsn/gen_links.sh 4 files changed, 193 insertions(+), 1 deletion(-) Approvals: osmith: Looks good to me, but someone else must approve Jenkins Builder: Verified laforge: Looks good to me, but someone else must approve pespin: Looks good to me, approved diff --git a/library/ITU_X213_Types.ttcn b/library/ITU_X213_Types.ttcn new file mode 100644 index 0000000..3242e9d --- /dev/null +++ b/library/ITU_X213_Types.ttcn @@ -0,0 +1,172 @@ +module ITU_X213_Types { + +/* ITU_X213_Types, defining abstract TTCN-3 data types for ITU-T Rec. X.213. + * + * (C) 2024 by sysmocom - s.f.m.c. GmbH <info(a)sysmocom.de> + * All rights reserved. + * Author: Pau Espin Pedrol <pespin(a)sysmocom.de> + * + * Released under the terms of GNU General Public License, Version 2 or + * (at your option) any later version. + * + * SPDX-License-Identifier: GPL-2.0-or-later + */ + + +import from General_Types all; +import from Osmocom_Types all; + +/* Network Service access point */ + +/* initial domain part (IDP). = authority and format identifier (AFI) + initial domain identifier (IDI). */ + +type enumerated NSAP_AFI { + NSAP_AFI_IANA_ICP_DEC ('34'H), + NSAP_AFI_IANA_ICP_BIN ('35'H) +} with { variant "FIELDLENGTH(8)" }; + +type enumerated NSAP_IDI_IANA_ICP { + NSAP_IDI_IANA_ICP_IPv6 ('0000'H), + NSAP_IDI_IANA_ICP_IPv4 ('0001'H) +} with { variant "FIELDLENGTH(16)" + variant "BYTEORDER(last)" }; + +type record NSAP_DSP_IANA_ICP_BIN_IPv6 { + OCT16 addr, + OCT1 padding +}; + +type record NSAP_DSP_IANA_ICP_BIN_IPv4 { + OCT4 addr, + octetstring padding length (0..13) optional +}; + +type union NSAP_DSP_IANA_ICP_BIN { + NSAP_DSP_IANA_ICP_BIN_IPv6 ipv6, + NSAP_DSP_IANA_ICP_BIN_IPv4 ipv4, + octetstring other +}; + +type record NSAP_IDI_IANA_ICP_BIN { + NSAP_IDI_IANA_ICP icp, + NSAP_DSP_IANA_ICP_BIN dsp +} with { variant (dsp) "CROSSTAG(ipv6, icp = NSAP_IDI_IANA_ICP_IPv6; + ipv4, icp = NSAP_IDI_IANA_ICP_IPv4; + other, OTHERWISE)" +}; + +type union NSAP_IDI { + NSAP_IDI_IANA_ICP_BIN iana_icp_bin, + octetstring other +}; + +type record NSAP_IDP { + NSAP_AFI afi, + NSAP_IDI idi +} with { variant (idi) "CROSSTAG(iana_icp_bin, afi = NSAP_AFI_IANA_ICP_BIN; + other, OTHERWISE)" +}; + +type record NSAP_Address { + NSAP_IDP idp +}; + + +external function enc_NSAP_Address(in NSAP_Address pco_data) return octetstring +with { extension "prototype(convert)" extension "encode(RAW)" } + +external function dec_NSAP_Address(in octetstring pco_payload) return NSAP_Address +with { extension "prototype(convert) decode(RAW)" }; + +/********************** + * ITU_X213_Templates: + **********************/ + +template (present) NSAP_DSP_IANA_ICP_BIN_IPv6 tr_NSAP_IANA_IPv6_Address(template (present) OCT16 addr := ?) := { + addr := addr, + padding := ? +}; +template (value) NSAP_DSP_IANA_ICP_BIN_IPv6 ts_NSAP_IANA_IPv6_Address(template (value) OCT16 addr) := { + addr := addr, + padding := '00'O +}; + +template (present) NSAP_DSP_IANA_ICP_BIN_IPv4 tr_NSAP_IANA_IPv4_Address(template (present) OCT4 addr := ?, template octetstring padding := *) := { + addr := addr, + padding := padding +}; +template (value) NSAP_DSP_IANA_ICP_BIN_IPv4 ts_NSAP_IANA_IPv4_Address(template (value) OCT4 addr, template (omit) octetstring padding := omit) := { + addr := addr, + padding := padding +}; + +template (present) NSAP_DSP_IANA_ICP_BIN tr_NSAP_IANA_u_IPv6_Address(template (present) OCT16 addr := ?) := { + ipv6 := tr_NSAP_IANA_IPv6_Address(addr) +}; +template (value) NSAP_DSP_IANA_ICP_BIN ts_NSAP_IANA_u_IPv6_Address(template (value) OCT16 addr) := { + ipv6 := ts_NSAP_IANA_IPv6_Address(addr) +}; + +template (present) NSAP_DSP_IANA_ICP_BIN tr_NSAP_IANA_u_IPv4_Address(template (present) OCT4 addr := ?, template octetstring padding := *) := { + ipv4 := tr_NSAP_IANA_IPv4_Address(addr, padding) +}; +template (value) NSAP_DSP_IANA_ICP_BIN ts_NSAP_IANA_u_IPv4_Address(template (value) OCT4 addr, template (omit) octetstring padding := omit) := { + ipv4 := ts_NSAP_IANA_IPv4_Address(addr, padding) +}; + +template (present) NSAP_IDI_IANA_ICP_BIN tr_NSAP_IDI_IANA_ICP_BIN(template (present) NSAP_IDI_IANA_ICP icp := ?, + template (present) NSAP_DSP_IANA_ICP_BIN dsp := ?) := { + icp := icp, + dsp := dsp +}; +template (value) NSAP_IDI_IANA_ICP_BIN ts_NSAP_IDI_IANA_ICP_BIN(template (value) NSAP_IDI_IANA_ICP icp, + template (value) NSAP_DSP_IANA_ICP_BIN dsp) := { + icp := icp, + dsp := dsp +}; + +template (present) NSAP_IDI tr_NSAP_IDI_u_IANA_ICP_BIN(template (present) NSAP_IDI_IANA_ICP_BIN iana_icp_bin := ?) := { + iana_icp_bin := iana_icp_bin +}; +template (value) NSAP_IDI ts_NSAP_IDI_u_IANA_ICP_BIN(template (value) NSAP_IDI_IANA_ICP_BIN iana_icp_bin) := { + iana_icp_bin := iana_icp_bin +}; + +template (present) NSAP_IDP tr_NSAP_IDP(template (present) NSAP_AFI afi := ?, template (present) NSAP_IDI idi := ?) := { + afi := afi, + idi := idi +}; +template (value) NSAP_IDP ts_NSAP_IDP(template (value) NSAP_AFI afi, template (value) NSAP_IDI idi) := { + afi := afi, + idi := idi +}; + +template (present) NSAP_Address tr_NSAP_Address_IANA_BIN_IPv6(template (present) OCT16 addr := ?) := { + idp := tr_NSAP_IDP(NSAP_AFI_IANA_ICP_BIN, + tr_NSAP_IDI_u_IANA_ICP_BIN(tr_NSAP_IDI_IANA_ICP_BIN(NSAP_IDI_IANA_ICP_IPv6, + tr_NSAP_IANA_u_IPv6_Address(addr)))) +}; +template (value) NSAP_Address ts_NSAP_Address_IANA_BIN_IPv6(template (value) OCT16 addr) := { + idp := ts_NSAP_IDP(NSAP_AFI_IANA_ICP_BIN, + ts_NSAP_IDI_u_IANA_ICP_BIN(ts_NSAP_IDI_IANA_ICP_BIN(NSAP_IDI_IANA_ICP_IPv6, + ts_NSAP_IANA_u_IPv6_Address(addr)))) +}; + +template (present) NSAP_Address tr_NSAP_Address_IANA_BIN_IPv4(template (present) OCT4 addr := ?, + template octetstring padding := *) := { + idp := tr_NSAP_IDP(NSAP_AFI_IANA_ICP_BIN, + tr_NSAP_IDI_u_IANA_ICP_BIN(tr_NSAP_IDI_IANA_ICP_BIN(NSAP_IDI_IANA_ICP_IPv4, + tr_NSAP_IANA_u_IPv4_Address(addr, padding)))) +}; +template (value) NSAP_Address ts_NSAP_Address_IANA_BIN_IPv4(template (value) OCT4 addr, + template (omit) octetstring padding := omit) := { + idp := ts_NSAP_IDP(NSAP_AFI_IANA_ICP_BIN, + ts_NSAP_IDI_u_IANA_ICP_BIN(ts_NSAP_IDI_IANA_ICP_BIN(NSAP_IDI_IANA_ICP_IPv4, + ts_NSAP_IANA_u_IPv4_Address(addr, padding)))) +}; +/* IPv4 with padding so that TLA is 20 bytes. This is quite common: */ +template (value) NSAP_Address ts_NSAP_Address_IANA_BIN_IPv4Len20(template (value) OCT4 addr) := + ts_NSAP_Address_IANA_BIN_IPv4(addr, '00000000000000000000000000'O); + + +} with { encode "RAW"; variant "FIELDORDER(msb)" } diff --git a/library/ranap/RANAP_Templates.ttcn b/library/ranap/RANAP_Templates.ttcn index a433d62..5cd9353 100644 --- a/library/ranap/RANAP_Templates.ttcn +++ b/library/ranap/RANAP_Templates.ttcn @@ -1878,5 +1878,12 @@ return rab_id; } +function f_ranap_rab_ass_req_extract_tli(RANAP_PDU ranap) return TransportLayerInformation +{ + var RAB_AssignmentRequest.protocolIEs ies := ranap.initiatingMessage.value_.rAB_AssignmentRequest.protocolIEs; + var TransportLayerInformation tli := ies[0].value_.rAB_SetupOrModifyList[0][0].firstValue.rAB_SetupOrModifyItemFirst.transportLayerInformation; + return tli; +} + } diff --git a/sgsn/BSSGP_ConnHdlr.ttcn b/sgsn/BSSGP_ConnHdlr.ttcn index c39b614..121ac2d 100644 --- a/sgsn/BSSGP_ConnHdlr.ttcn +++ b/sgsn/BSSGP_ConnHdlr.ttcn @@ -17,6 +17,7 @@ import from MobileL3_Types all; import from L3_Templates all; import from L3_Common all; +import from ITU_X213_Types all; import from GSUP_Types all; import from GSUP_Templates all; @@ -696,7 +697,18 @@ var RANAP_PDU ranap; [] BSSAP.receive(tr_RANAP_RabAssReq(?)) -> value ranap { var RAB_ID rab_id := f_ranap_rab_ass_req_extract_rab_id(ranap); - /*TODO: validate received remote IP addr + TEID = apars.ggsn_ip_u + apars.ggsn_tei_u */ + var TransportLayerInformation tli := f_ranap_rab_ass_req_extract_tli(ranap); + + /* Validate received IP address + TEID from SGSN is the one we + * did set up from the GGSN, since the SGSN is expected to do + * Direct Tunnel: */ + var template (present) TransportLayerInformation exp_tli := + tr_TLI_ps(oct2bit(enc_NSAP_Address(valueof(ts_NSAP_Address_IANA_BIN_IPv4Len20(apars.ggsn_ip_u)))), + apars.ggsn_tei_u); + if (not match(tli, exp_tli)) { + Misc_Helpers.f_shutdown(__BFILE__, __LINE__, fail, + log2str("Rx RAB Ass Req with TLI ", tli, " vs exp ", exp_tli)); + } var template (value) RAB_SetupOrModifiedList l; l := ts_RAB_SMdL_ps(rab_id, oct2bit(apars.rnc_ip_u), apars.rnc_tei_u); BSSAP.send(ts_RANAP_RabAssResp(l)); diff --git a/sgsn/gen_links.sh b/sgsn/gen_links.sh index 8df1a87..2e5d9f9 100755 --- a/sgsn/gen_links.sh +++ b/sgsn/gen_links.sh @@ -89,6 +89,7 @@ FILES+="Osmocom_CTRL_Types.ttcn Osmocom_CTRL_Functions.ttcn Osmocom_CTRL_Adapter.ttcn " FILES+="Osmocom_VTY_Functions.ttcn " FILES+="LLC_Templates.ttcn L3_Templates.ttcn L3_Common.ttcn " +FILES+="ITU_X213_Types.ttcn " FILES+="RAN_Emulation.ttcnpp RAN_Adapter.ttcnpp SCCP_Templates.ttcn " # IPA_Emulation + dependencies FILES+="IPA_Types.ttcn IPA_Emulation.ttcnpp IPA_CodecPort.ttcn IPA_CodecPort_CtrlFunct.ttcn IPA_CodecPort_CtrlFunctDef.cc Native_Functions.ttcn Native_FunctionDefs.cc " -- To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/38433?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: I3a3699cea981caa89b30742c031d5f232418b0ee Gerrit-Change-Number: 38433 Gerrit-PatchSet: 3 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: lynxis lazus <lynxis(a)fe80.eu> Gerrit-Reviewer: osmith <osmith(a)sysmocom.de> Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
1 0
0 0
  • ← Newer
  • 1
  • ...
  • 77
  • 78
  • 79
  • 80
  • 81
  • 82
  • 83
  • ...
  • 164
  • Older →

HyperKitty Powered by HyperKitty version 1.3.12.