[PATCH] libosmo-sccp[master]: ipa: Automatically create / destroy route on IPA connect/dis...

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/.

Harald Welte gerrit-no-reply at lists.osmocom.org
Sat Nov 11 19:26:36 UTC 2017


Review at  https://gerrit.osmocom.org/4787

ipa: Automatically create / destroy route on IPA connect/disconnect

>From the STP point of view: In order to be able to route messages back
to an IPA client, we need to create a route at the time we have
successfully identified the AS for this client based on the name
presented in the IPA CCM ACK "name" field.  Once the IPA client is
destroyed, the route must be deleted again.

With this commit present, we can have an IPA client (such as
osmo-bsc-sccplite) connect to OsmoSTP and exchange BSS[M]AP
with an M3UA-speaking osmo-msc.  Basically, the STP reaches
the point where it can translate between IPA-style SCCPlite
and proper M3UA/SUA on the other side.

Change-Id: I901f06c5d0f2eae60f8d931215ed65190330ce66
---
M src/xua_asp_fsm.c
1 file changed, 33 insertions(+), 0 deletions(-)


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

diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index d54d45e..823402e 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -835,11 +835,22 @@
 /* Server: We're waiting for an ID ACK */
 static void ipa_asp_fsm_wait_id_ack2(struct osmo_fsm_inst *fi, uint32_t event, void *data)
 {
+	struct ipa_asp_fsm_priv *iafp = fi->priv;
+	struct osmo_ss7_asp *asp = iafp->asp;
+	struct osmo_ss7_instance *inst = asp->inst;
+	struct osmo_ss7_as *as = osmo_ss7_as_find_by_rctx(inst, 0);
+
+	OSMO_ASSERT(as);
+
 	switch (event) {
 	case IPA_ASP_E_ID_ACK:
 		/* ACK received, we can go to active state now.  The
 		 * ACTIVE onenter function will inform the AS */
 		osmo_fsm_inst_state_chg(fi, IPA_ASP_S_ACTIVE, 0, 0);
+		/* As opposed to M3UA, there is no RKM and we have to implicitly automatically add
+		 * a route once an IPA connection has come up */
+		osmo_ss7_route_create(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff,
+				      as->cfg.name);
 		break;
 	}
 }
@@ -1007,6 +1018,27 @@
 	},
 };
 
+static void ipa_asp_fsm_cleanup(struct osmo_fsm_inst *fi, enum osmo_fsm_term_cause cause)
+{
+	struct ipa_asp_fsm_priv *iafp = fi->priv;
+	struct osmo_ss7_asp *asp = iafp->asp;
+	struct osmo_ss7_instance *inst = asp->inst;
+	struct osmo_ss7_as *as = osmo_ss7_as_find_by_rctx(inst, 0);
+	struct osmo_ss7_route *rt;
+
+	OSMO_ASSERT(as);
+
+	/* find the route which we have created if we ever reached ipa_asp_fsm_wait_id_ack2 */
+	rt = osmo_ss7_route_find_dpc_mask(inst->rtable_system, as->cfg.routing_key.pc, 0xffffff);
+	/* no route found, bail out */
+	if (!rt)
+		return;
+	/* route points to different AS, bail out */
+	if (rt->dest.as != as)
+		return;
+
+	osmo_ss7_route_destroy(rt);
+}
 
 struct osmo_fsm ipa_asp_fsm = {
 	.name = "IPA_ASP",
@@ -1020,6 +1052,7 @@
 			       S(XUA_ASP_E_ASPSM_BEAT) |
 			       S(XUA_ASP_E_ASPSM_BEAT_ACK),
 	.allstate_action = ipa_asp_allstate,
+	.cleanup = ipa_asp_fsm_cleanup,
 };
 
 

-- 
To view, visit https://gerrit.osmocom.org/4787
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I901f06c5d0f2eae60f8d931215ed65190330ce66
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <laforge at gnumonks.org>



More information about the gerrit-log mailing list