pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40498?usp=email )
Change subject: xua_snm.c: Handle DAUD with aff_pc containing wildcards
......................................................................
xua_snm.c: Handle DAUD with aff_pc containing wildcards
Handle it with a really basic implementation for completeness.
In theory we shouldn't in general be receiving such big masks,
since RFC466 3.4.3 states:
"""
It is recommended that during normal operation (traffic handling) the
mask field of the Affected Point Code parameter in the DAUD message
be kept to a zero value in order to avoid SG overloading.
"""
Change-Id: Icdb726ae66d3bee19b2113b1e77d68b517e8fb4d
---
M src/xua_snm.c
1 file changed, 47 insertions(+), 12 deletions(-)
Approvals:
pespin: Looks good to me, approved
osmith: Looks good to me, but someone else must approve
Jenkins Builder: Verified
laforge: Looks good to me, but someone else must approve
diff --git a/src/xua_snm.c b/src/xua_snm.c
index 079cd96..f3c8bb8 100644
--- a/src/xua_snm.c
+++ b/src/xua_snm.c
@@ -316,26 +316,61 @@
uint32_t _aff_pc = ntohl(aff_pc[i]);
uint32_t pc = _aff_pc & 0xffffff;
uint8_t mask = _aff_pc >> 24;
- bool is_available = false;
+ bool is_available;
+
+ struct osmo_ss7_route_label rtlabel = {
+ .opc = xua->mtp.opc, /* Use OPC of received DAUD. */
+ .dpc = pc,
+ .sls = 0,
+ };
if (mask == 0) {
/* one single point code */
-
- struct osmo_ss7_route_label rtlabel = {
- .opc = xua->mtp.opc, /* Use OPC of received DAUD. FIXME: is this correct? */
- .dpc = pc,
- .sls = 0,
- };
-
/* Check if there's an "active" route available: */
- if (ss7_instance_lookup_route(s7i, &rtlabel))
- is_available = true;
+ is_available = !!ss7_instance_lookup_route(s7i, &rtlabel);
xua_tx_snm_available(asp, rctx, num_rctx, &aff_pc[i], 1, "Response to DAUD",
is_available);
} else {
- /* TODO: wildcard match */
- LOGPASP(asp, log_ss, LOGL_NOTICE, "DAUD with wildcard match not supported yet\n");
+ /* Multiple single point codes with mask indicating number of wildcarded bits. */
+ uint32_t maskbits = (1 << mask) - 1;
+ uint32_t fullpc;
+ unsigned int num_aff_pc_avail = 0;
+ unsigned int num_aff_pc_unavail = 0;
+ uint32_t *aff_pc_avail = talloc_size(asp, sizeof(uint32_t)*(1 << mask));
+ uint32_t *aff_pc_unavail = talloc_size(asp, sizeof(uint32_t)*(1 << mask));
+ for (fullpc = (pc & ~maskbits); fullpc <= (pc | maskbits); fullpc++) {
+ rtlabel.dpc = fullpc;
+ is_available = !!ss7_instance_lookup_route(s7i, &rtlabel);
+ if (is_available)
+ aff_pc_avail[num_aff_pc_avail++] = htonl(fullpc); /* mask = 0 */
+ else
+ aff_pc_unavail[num_aff_pc_unavail++] = htonl(fullpc); /* mask = 0 */
+ }
+ /* TODO: Ideally an extra step would be needed here to pack again all
+ * concurrent PCs on each array sharing a suffix mask, in order to
+ * shrink the transmitted list of Affected PCs. */
+ const unsigned int MAX_PC_PER_MSG = 32;
+ for (unsigned int i = 0; i < num_aff_pc_avail; i += MAX_PC_PER_MSG) {
+ unsigned int num_transmit;
+ if (i + MAX_PC_PER_MSG < num_aff_pc_avail)
+ num_transmit = MAX_PC_PER_MSG;
+ else
+ num_transmit = (num_aff_pc_avail - i);
+ xua_tx_snm_available(asp, rctx, num_rctx, &aff_pc_avail[i],
+ num_transmit, "Response to DAUD", true);
+ }
+ for (unsigned int i = 0; i < num_aff_pc_unavail; i += MAX_PC_PER_MSG) {
+ unsigned int num_transmit;
+ if (i + MAX_PC_PER_MSG < num_aff_pc_unavail)
+ num_transmit = MAX_PC_PER_MSG;
+ else
+ num_transmit = (num_aff_pc_unavail - i);
+ xua_tx_snm_available(asp, rctx, num_rctx, &aff_pc_unavail[i],
+ num_transmit, "Response to DAUD", false);
+ }
+ talloc_free(aff_pc_avail);
+ talloc_free(aff_pc_unavail);
}
}
}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40498?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: Icdb726ae66d3bee19b2113b1e77d68b517e8fb4d
Gerrit-Change-Number: 40498
Gerrit-PatchSet: 5
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: daniel <dwillmann(a)sysmocom.de>
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
pespin has submitted this change. ( https://gerrit.osmocom.org/c/libosmo-sigtran/+/40499?usp=email )
Change subject: cosmetic: sua: Fix API documentation typo
......................................................................
cosmetic: sua: Fix API documentation typo
Change-Id: I5aa42a3dfd5782425e23278f1b6a8ee8b9af2cac
---
M src/sua.c
1 file changed, 1 insertion(+), 1 deletion(-)
Approvals:
Jenkins Builder: Verified
osmith: Looks good to me, approved
laforge: Looks good to me, approved
diff --git a/src/sua.c b/src/sua.c
index 41bea1b..7d14f3b 100644
--- a/src/sua.c
+++ b/src/sua.c
@@ -863,7 +863,7 @@
}
/*! Transmit SSNM DUNA/DAVA message indicating [un]availability of certain point code[s]
- * \param[in] asp ASP through whihc to transmit message. Must be ACTIVE.
+ * \param[in] asp ASP through which to transmit message. Must be ACTIVE.
* \param[in] rctx array of Routing Contexts in network byte order.
* \param[in] num_rctx number of rctx
* \param[in] aff_pc array of 'Affected Point Code' in network byte order.
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/40499?usp=email
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: merged
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I5aa42a3dfd5782425e23278f1b6a8ee8b9af2cac
Gerrit-Change-Number: 40499
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <pespin(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: laforge <laforge(a)osmocom.org>
Gerrit-Reviewer: osmith <osmith(a)sysmocom.de>
Gerrit-Reviewer: pespin <pespin(a)sysmocom.de>
Attention is currently required from: Hoernchen, laforge, pespin.
osmith has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341?usp=email )
Change subject: octsim: initial commit
......................................................................
Patch Set 5:
(2 comments)
File octsim/OCTSIM_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341/comment/0b427f35_173c… :
PS4, Line 22: //USB_Device_Match mp_usb_dev_match := { vid_pid := { vid := '1d50'H, pid := '60e3'H} };
> can this be dropped?
Done
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341/comment/60ee2d75_b280… :
PS4, Line 74: //activate(as_Tguard);
> would be great to have Tguard working from the first commit...
I took over the patches from Eric, but can't test them currently as I don't have access to an octsim-tester setup. In SYS#5489#note-20 I posted an idea of how to test it in jenkins.
I'll wait with making more (especially non-cosmetic) changes until I can actually run the tests and verify they still work as intended.
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341?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: Iada6422d694eb5fc862477c8b43b8642c8d96692
Gerrit-Change-Number: 27341
Gerrit-PatchSet: 5
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 25 Jun 2025 13:23:48 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: Hoernchen, pespin.
osmith has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27345?usp=email )
Change subject: octsim: tester support
......................................................................
Patch Set 6:
(1 comment)
File octsim/OCTSIM_Tests.cfg:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27345/comment/1e9c90c5_3583… :
PS5, Line 10: LogFile := "%e-%c-%h-%r.%s"
> I don't recall we have all of this in any testsuite. […]
@ewild@sysmocom.de: do you recall what the purpose of using custom logging here was / can this be removed?
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27345?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: Id7c7e529a5444cffc8e79b385959a522dc9a6beb
Gerrit-Change-Number: 27345
Gerrit-PatchSet: 6
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 25 Jun 2025 13:18:53 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: Hoernchen, pespin.
osmith has posted comments on this change by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27345?usp=email )
Change subject: octsim: tester support
......................................................................
Patch Set 5:
(2 comments)
File octsim/OCTSIM_Tests.cfg:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27345/comment/6196c74d_5cb1… :
PS5, Line 28: #OCTSIM_Tests.TC_test_grouped
> this can be removed.
Done
File octsim/OCTSIM_Tests.ttcn:
https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27345/comment/95459b15_5458… :
PS5, Line 583: python to generate tests
> This can most probably go into a separate file?
Done
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27345?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: Id7c7e529a5444cffc8e79b385959a522dc9a6beb
Gerrit-Change-Number: 27345
Gerrit-PatchSet: 5
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: pespin <pespin(a)sysmocom.de>
Gerrit-Comment-Date: Wed, 25 Jun 2025 13:18:03 +0000
Gerrit-HasComments: Yes
Gerrit-Has-Labels: No
Comment-In-Reply-To: pespin <pespin(a)sysmocom.de>
Attention is currently required from: Hoernchen, laforge, osmith.
osmith has uploaded a new patch set (#5) to the change originally created by Hoernchen. ( https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341?usp=email )
The following approvals got outdated and were removed:
Verified+1 by Jenkins Builder
Change subject: octsim: initial commit
......................................................................
octsim: initial commit
This testsuite is for the sysmoOCTSIM.
Related: https://www.sysmocom.de/products/sim/sysmooctsim/
Related: SYS#5489
Tweaked-by: Eric Wild <ewild(a)sysmocom.de>
Tweaked-by: Oliver Smith <osmith(a)sysmocom.de>
Change-Id: Iada6422d694eb5fc862477c8b43b8642c8d96692
---
M Makefile
A octsim/OCTSIM_Tests.cfg
A octsim/OCTSIM_Tests.default
A octsim/OCTSIM_Tests.ttcn
A octsim/README.md
A octsim/gen_links.sh
A octsim/regen_makefile.sh
7 files changed, 312 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ttcn3-hacks refs/changes/41/27341/5
--
To view, visit https://gerrit.osmocom.org/c/osmo-ttcn3-hacks/+/27341?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: Iada6422d694eb5fc862477c8b43b8642c8d96692
Gerrit-Change-Number: 27341
Gerrit-PatchSet: 5
Gerrit-Owner: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Reviewer: Jenkins Builder
Gerrit-CC: laforge <laforge(a)osmocom.org>
Gerrit-CC: osmith <osmith(a)sysmocom.de>
Gerrit-CC: pespin <pespin(a)sysmocom.de>
Gerrit-Attention: osmith <osmith(a)sysmocom.de>
Gerrit-Attention: Hoernchen <ewild(a)sysmocom.de>
Gerrit-Attention: laforge <laforge(a)osmocom.org>