Change in libosmo-sccp[master]: xua_asp_fsm: Ensure xUA client includes routing contexts in ASPAC/ASPIA

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

laforge gerrit-no-reply at lists.osmocom.org
Sun Dec 1 19:41:37 UTC 2019


laforge has uploaded this change for review. ( https://gerrit.osmocom.org/c/libosmo-sccp/+/16390 )


Change subject: xua_asp_fsm: Ensure xUA client includes routing contexts in ASPAC/ASPIA
......................................................................

xua_asp_fsm: Ensure xUA client includes routing contexts in ASPAC/ASPIA

If we are running in ASP (client) role, and we are about to transmit an
ASPAC or ASPIA to the SG, we must make sure to include any applicable
routing contexts.

Change-Id: Iee4f0d553d6845a9ae08cb5e4f57fdec443e4ef9
Related: OS#4285
---
M src/xua_asp_fsm.c
1 file changed, 26 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/libosmo-sccp refs/changes/90/16390/1

diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index 6114b47..546c665 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -167,6 +167,30 @@
 	return tmode;
 }
 
+/* add M3UA_IEI_ROUTE_CTX to xua_msg containig all routing keys of ASs within ASP */
+static int xua_msg_add_asp_rctx(struct xua_msg *xua, struct osmo_ss7_asp *asp)
+{
+	struct osmo_ss7_as *as;
+	uint32_t rctx[128];
+	unsigned int i = 0;
+
+	/* iterate over all ASs and build array of routing contexts */
+	llist_for_each_entry(as, &asp->inst->as_list, list) {
+		if (!osmo_ss7_as_has_asp(as, asp))
+			continue;
+		rctx[i++] = htonl(as->cfg.routing_key.context);
+		if (i >= ARRAY_SIZE(rctx)-1) {
+			break;
+		}
+	}
+	/* add xUA IE with routing contests to the message (if any) */
+	if (i)
+		xua_msg_add_data(xua, M3UA_IEI_ROUTE_CTX, i*sizeof(uint32_t), (uint8_t *)rctx);
+
+	/* return count of routing contexts added */
+	return i;
+}
+
 /* ask the xUA implementation to transmit a specific message */
 static int peer_send(struct osmo_fsm_inst *fi, int out_event, struct xua_msg *in)
 {
@@ -219,6 +243,7 @@
 		if (rc >= 0)
 			xua_msg_add_u32(xua, M3UA_IEI_TRAF_MODE_TYP, osmo_ss7_tmode_to_xua(rc));
 		/* Optional: Routing Context */
+		xua_msg_add_asp_rctx(xua, asp);
 		/* Optional: TID Label */
 		/* Optional: DRN Label */
 		/* Optional: Info String */
@@ -236,6 +261,7 @@
 		/* RFC3868 Ch. 3.6.3 */
 		xua->hdr = XUA_HDR(SUA_MSGC_ASPTM, SUA_ASPTM_INACTIVE);
 		/* Optional: Routing Context */
+		xua_msg_add_asp_rctx(xua, asp);
 		/* Optional: Info String */
 		break;
 	case XUA_ASP_E_ASPTM_ASPIA_ACK:

-- 
To view, visit https://gerrit.osmocom.org/c/libosmo-sccp/+/16390
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Change-Id: Iee4f0d553d6845a9ae08cb5e4f57fdec443e4ef9
Gerrit-Change-Number: 16390
Gerrit-PatchSet: 1
Gerrit-Owner: laforge <laforge at osmocom.org>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20191201/38324e95/attachment.htm>


More information about the gerrit-log mailing list