pespin has uploaded this change for review. (
https://gerrit.osmocom.org/c/libosmo-sigtran/+/42056?usp=email )
Change subject: Move osmo_xlm_sap_down to ss7_asp.c
......................................................................
Move osmo_xlm_sap_down to ss7_asp.c
That's a generic function to interact with the ASP from the LM.
Only some of the primitives are related to RKM.
Change-Id: I9a8d0e0fc1fd193db8dd3901911848ed8564616f
---
M src/ss7_asp.c
M src/xua_internal.h
M src/xua_rkm.c
3 files changed, 36 insertions(+), 31 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/libosmo-sigtran
refs/changes/56/42056/1
diff --git a/src/ss7_asp.c b/src/ss7_asp.c
index 6071317..4109325 100644
--- a/src/ss7_asp.c
+++ b/src/ss7_asp.c
@@ -1603,3 +1603,30 @@
}
return tmode;
}
+
+/* process a primitive from the xUA Layer Manager (LM) */
+int osmo_xlm_sap_down(struct osmo_ss7_asp *asp, struct osmo_prim_hdr *oph)
+{
+ struct osmo_xlm_prim *prim = (struct osmo_xlm_prim *) oph;
+
+ LOGPASP(asp, DLSS7, LOGL_DEBUG, "Received XUA Layer Manager Primitive:
%s)\n",
+ osmo_xlm_prim_name(&prim->oph));
+
+ switch (OSMO_PRIM_HDR(&prim->oph)) {
+ case OSMO_PRIM(OSMO_XLM_PRIM_M_RK_REG, PRIM_OP_REQUEST):
+ /* Layer Manager asks us to send a Routing Key Reg Request */
+ xua_rkm_send_reg_req(asp, &prim->u.rk_reg.key,
prim->u.rk_reg.traf_mode);
+ break;
+ case OSMO_PRIM(OSMO_XLM_PRIM_M_RK_DEREG, PRIM_OP_REQUEST):
+ /* Layer Manager asks us to send a Routing Key De-Reg Request */
+ xua_rkm_send_dereg_req(asp, prim->u.rk_dereg.route_ctx);
+ break;
+ default:
+ LOGPASP(asp, DLSS7, LOGL_ERROR, "Unknown XUA Layer Manager
Primitive: %s\n",
+ osmo_xlm_prim_name(&prim->oph));
+ break;
+ }
+
+ msgb_free(prim->oph.msg);
+ return 0;
+}
diff --git a/src/xua_internal.h b/src/xua_internal.h
index a2f0af6..ebd1442 100644
--- a/src/xua_internal.h
+++ b/src/xua_internal.h
@@ -155,3 +155,8 @@
int osmo_sccp_addr_encode(struct msgb *msg, const struct osmo_sccp_addr *in);
int ss7_asp_rx_unknown(struct osmo_ss7_asp *asp, int ppid_mux, struct msgb
*msg);
+
+void xua_rkm_send_reg_req(struct osmo_ss7_asp *asp,
+ const struct osmo_ss7_routing_key *rkey,
+ enum osmo_ss7_as_traffic_mode traf_mode);
+void xua_rkm_send_dereg_req(struct osmo_ss7_asp *asp, uint32_t route_ctx);
diff --git a/src/xua_rkm.c b/src/xua_rkm.c
index 038098f..21591e9 100644
--- a/src/xua_rkm.c
+++ b/src/xua_rkm.c
@@ -113,9 +113,9 @@
}
/* ASP: send a RKM Registration Request message for a single routing key */
-static void xua_rkm_send_reg_req(struct osmo_ss7_asp *asp,
- const struct osmo_ss7_routing_key *rkey,
- enum osmo_ss7_as_traffic_mode traf_mode)
+void xua_rkm_send_reg_req(struct osmo_ss7_asp *asp,
+ const struct osmo_ss7_routing_key *rkey,
+ enum osmo_ss7_as_traffic_mode traf_mode)
{
struct msgb *msg = m3ua_msgb_alloc(__func__);
int tmod = osmo_ss7_tmode_to_xua(traf_mode);
@@ -135,7 +135,7 @@
}
/* ASP: send a RKM De-Registration Request message for a single routing
context */
-static void xua_rkm_send_dereg_req(struct osmo_ss7_asp *asp, uint32_t
route_ctx)
+void xua_rkm_send_dereg_req(struct osmo_ss7_asp *asp, uint32_t route_ctx)
{
struct msgb *msg = m3ua_msgb_alloc(__func__);
@@ -623,30 +623,3 @@
xua_msg_free(xua);
return rc;
}
-
-/* process a primitive from the xUA Layer Manager (LM) */
-int osmo_xlm_sap_down(struct osmo_ss7_asp *asp, struct osmo_prim_hdr *oph)
-{
- struct osmo_xlm_prim *prim = (struct osmo_xlm_prim *) oph;
-
- LOGPASP(asp, DLSS7, LOGL_DEBUG, "Received XUA Layer Manager Primitive:
%s)\n",
- osmo_xlm_prim_name(&prim->oph));
-
- switch (OSMO_PRIM_HDR(&prim->oph)) {
- case OSMO_PRIM(OSMO_XLM_PRIM_M_RK_REG, PRIM_OP_REQUEST):
- /* Layer Manager asks us to send a Routing Key Reg Request */
- xua_rkm_send_reg_req(asp, &prim->u.rk_reg.key,
prim->u.rk_reg.traf_mode);
- break;
- case OSMO_PRIM(OSMO_XLM_PRIM_M_RK_DEREG, PRIM_OP_REQUEST):
- /* Layer Manager asks us to send a Routing Key De-Reg Request */
- xua_rkm_send_dereg_req(asp, prim->u.rk_dereg.route_ctx);
- break;
- default:
- LOGPASP(asp, DLSS7, LOGL_ERROR, "Unknown XUA Layer Manager
Primitive: %s\n",
- osmo_xlm_prim_name(&prim->oph));
- break;
- }
-
- msgb_free(prim->oph.msg);
- return 0;
-}
--
To view, visit https://gerrit.osmocom.org/c/libosmo-sigtran/+/42056?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: libosmo-sigtran
Gerrit-Branch: master
Gerrit-Change-Id: I9a8d0e0fc1fd193db8dd3901911848ed8564616f
Gerrit-Change-Number: 42056
Gerrit-PatchSet: 1
Gerrit-Owner: pespin <[email protected]>