diff options
-rw-r--r-- | src/osmo_ss7.c | 14 | ||||
-rw-r--r-- | src/xua_asp_fsm.c | 14 | ||||
-rw-r--r-- | src/xua_internal.h | 3 |
3 files changed, 25 insertions, 6 deletions
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 @@ static int xua_cli_connect_cb(struct osmo_stream_cli *cli) 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 @@ static int xua_accept_cb(struct osmo_stream_srv_link *link, int fd) * 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 @@ void xua_asp_send_xlm_prim(struct osmo_ss7_asp *asp, struct osmo_xlm_prim *prim) } /* 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 @@ struct osmo_xlm_prim *xua_xlm_prim_alloc(enum osmo_xlm_prim_type prim_type, 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); |