Harald Welte has submitted this change and it was merged.

Change subject: send M-SCTP_ESTABLISH.ind to Layer Manager
......................................................................


send M-SCTP_ESTABLISH.ind to Layer Manager

Change-Id: I2904f8ebd97036690ba8a9525b31354c0252123b
---
M src/osmo_ss7.c
M src/xua_asp_fsm.c
M src/xua_internal.h
3 files changed, 25 insertions(+), 6 deletions(-)

Approvals:
  Harald Welte: Looks good to me, approved
  Jenkins Builder: Verified



diff --git a/src/osmo_ss7.c b/src/osmo_ss7.c
index 4d3ced1..d657b81 100644
--- a/src/osmo_ss7.c
+++ b/src/osmo_ss7.c
@@ -1234,9 +1234,14 @@
 
        LOGPASP(asp, DLSS7, LOGL_INFO, "Client connected %s\n", asp->sock_name);
 
-       /* Notify the ASP FSM that the connection has just been
-        * established */
-       osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_M_ASP_UP_REQ, NULL);
+       if (asp->lm && asp->lm->prim_cb) {
+               /* Notify layer manager that a connection has been
+                * established */
+               xua_asp_send_xlm_prim_simple(asp, 
OSMO_XLM_PRIM_M_SCTP_ESTABLISH, PRIM_OP_INDICATION);
+       } else {
+               /* directly as the ASP FSM to start by sending an ASP-UP ... */
+               osmo_fsm_inst_dispatch(asp->fi, XUA_ASP_E_M_ASP_UP_REQ, NULL);
+       }
 
        return 0;
 }
@@ -1381,6 +1386,9 @@
         * data */
        osmo_stream_srv_set_data(srv, asp);
 
+       /* send M-SCTP_ESTABLISH.ind to Layer Manager */
+       xua_asp_send_xlm_prim_simple(asp, OSMO_XLM_PRIM_M_SCTP_ESTABLISH, 
PRIM_OP_INDICATION);
+
        return 0;
 }
 
diff --git a/src/xua_asp_fsm.c b/src/xua_asp_fsm.c
index e16e26a..1570bc9 100644
--- a/src/xua_asp_fsm.c
+++ b/src/xua_asp_fsm.c
@@ -109,15 +109,23 @@
 }
 
 /* wrapper around send_xlm_prim for primitives without data */
-static void send_xlm_prim_simple(struct osmo_fsm_inst *fi,
+void xua_asp_send_xlm_prim_simple(struct osmo_ss7_asp *asp,
                                enum osmo_xlm_prim_type prim_type,
                                enum osmo_prim_operation op)
 {
        struct osmo_xlm_prim *prim = xua_xlm_prim_alloc(prim_type, op);
-       struct xua_asp_fsm_priv *xafp = fi->priv;
        if (!prim)
                return;
-       xua_asp_send_xlm_prim(xafp->asp, prim);
+       xua_asp_send_xlm_prim(asp, prim);
+}
+
+static void send_xlm_prim_simple(struct osmo_fsm_inst *fi,
+                                enum osmo_xlm_prim_type prim_type,
+                               enum osmo_prim_operation op)
+{
+       struct xua_asp_fsm_priv *xafp = fi->priv;
+       struct osmo_ss7_asp *asp = xafp->asp;
+       xua_asp_send_xlm_prim_simple(asp, prim_type, op);
 }
 
 /* ask the xUA implementation to transmit a specific message */
diff --git a/src/xua_internal.h b/src/xua_internal.h
index 6a3f723..3921309 100644
--- a/src/xua_internal.h
+++ b/src/xua_internal.h
@@ -52,3 +52,6 @@
                                         enum osmo_prim_operation op);
 
 void xua_asp_send_xlm_prim(struct osmo_ss7_asp *asp, struct osmo_xlm_prim 
*prim);
+void xua_asp_send_xlm_prim_simple(struct osmo_ss7_asp *asp,
+                               enum osmo_xlm_prim_type prim_type,
+                               enum osmo_prim_operation op);

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

Gerrit-MessageType: merged
Gerrit-Change-Id: I2904f8ebd97036690ba8a9525b31354c0252123b
Gerrit-PatchSet: 7
Gerrit-Project: libosmo-sccp
Gerrit-Branch: master
Gerrit-Owner: Harald Welte <[email protected]>
Gerrit-Reviewer: Harald Welte <[email protected]>
Gerrit-Reviewer: Jenkins Builder

Reply via email to