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

move layer_manager from xua_asp_fsm priv to osmo_ss7_asp

... this way it is publicly accessible/reachable

Change-Id: I00ec1689bfb068b9067d893fdba14d12d59f73f0
---
M include/osmocom/sigtran/osmo_ss7.h
M src/xua_asp_fsm.c
2 files changed, 10 insertions(+), 9 deletions(-)


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

diff --git a/include/osmocom/sigtran/osmo_ss7.h 
b/include/osmocom/sigtran/osmo_ss7.h
index 21c3768..6e35ee6 100644
--- a/include/osmocom/sigtran/osmo_ss7.h
+++ b/include/osmocom/sigtran/osmo_ss7.h
@@ -13,6 +13,7 @@
 struct osmo_ss7_user;
 struct osmo_sccp_instance;
 struct osmo_mtp_prim;
+struct osmo_xua_layer_manager;
 
 int osmo_ss7_init(void);
 int osmo_ss7_find_free_rctx(struct osmo_ss7_instance *inst);
@@ -336,6 +337,9 @@
        uint32_t asp_id;
        bool asp_id_present;
 
+       /* Layer Manager to which we talk */
+       struct osmo_xua_layer_manager *lm;
+
        struct {
                char *name;
                char *description;
@@ -366,6 +370,10 @@
  * xUA Servers
  ***********************************************************************/
 
+struct osmo_xua_layer_manager {
+       osmo_prim_cb prim_cb;
+};
+
 struct osmo_xua_server {
        struct llist_head list;
        struct osmo_ss7_instance *inst;
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index d38a18a..e16e26a 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -67,18 +67,12 @@
        { 0, NULL }
 };
 
-struct xua_layer_manager {
-       osmo_prim_cb prim_cb;
-};
-
 /* private data structure for each FSM instance */
 struct xua_asp_fsm_priv {
        /* pointer back to ASP to which we belong */
        struct osmo_ss7_asp *asp;
        /* Role (ASP/SG/IPSP) */
        enum xua_asp_role role;
-       /* Layer Manager to which we talk */
-       struct xua_layer_manager *lm;
 
        /* routing context[s]: list of 32bit integers */
        /* ACTIVE: traffic mode type, tid label, drn label ? */
@@ -106,11 +100,10 @@
 /* Send a XUA LM Primitive to the XUA Layer Manager (LM) */
 void xua_asp_send_xlm_prim(struct osmo_ss7_asp *asp, struct osmo_xlm_prim 
*prim)
 {
-       struct xua_asp_fsm_priv *xafp = asp->fi->priv;
-       struct xua_layer_manager *lm = xafp->lm;
+       struct osmo_xua_layer_manager *lm = asp->lm;
 
        if (lm && lm->prim_cb)
-               lm->prim_cb(&prim->oph, xafp->asp);
+               lm->prim_cb(&prim->oph, asp);
 
        msgb_free(prim->oph.msg);
 }

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: I00ec1689bfb068b9067d893fdba14d12d59f73f0
Gerrit-PatchSet: 1
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <[email protected]>

Reply via email to