aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2015-12-26 23:38:38 +0100
committerHarald Welte <laforge@gnumonks.org>2015-12-26 23:38:38 +0100
commit2ebe42fed79ab116fdb84927f57bdca565eb427b (patch)
treefa107592d02e485737a6508351e6736cec481717
parentcee5a2878bd7311115b144b6ff372481e1c2fad6 (diff)
properly resolve the cnlink from SUA signalling link
-rw-r--r--src/hnbgw_cn.c10
-rw-r--r--src/tests/dummy_cn_sua.c2
2 files changed, 7 insertions, 5 deletions
diff --git a/src/hnbgw_cn.c b/src/hnbgw_cn.c
index f94a198..5c4a77a 100644
--- a/src/hnbgw_cn.c
+++ b/src/hnbgw_cn.c
@@ -250,7 +250,7 @@ static int handle_cn_unitdata(struct hnbgw_cnlink *cnlink,
return handle_cn_ranap(cnlink, msgb_l2(oph->msg), msgb_l2len(oph->msg));
}
-static int handle_cn_conn_conf(struct hnbgw_cnlink *cnlink,
+static int handle_cn_conn_conf(void *slink,
const struct osmo_scu_connect_param *param,
struct osmo_prim_hdr *oph)
{
@@ -261,11 +261,12 @@ static int handle_cn_conn_conf(struct hnbgw_cnlink *cnlink,
return 0;
}
-static int handle_cn_data_ind(struct hnbgw_cnlink *cnlink,
+static int handle_cn_data_ind(void *slink,
const struct osmo_scu_data_param *param,
struct osmo_prim_hdr *oph)
{
struct hnbgw_context_map *map;
+ struct hnbgw_cnlink *cnlink = osmo_sua_link_get_user_priv(slink);
/* connection-oriented data is always passed transparently
* towards the specific HNB, via a RUA connection identified by
@@ -281,11 +282,12 @@ static int handle_cn_data_ind(struct hnbgw_cnlink *cnlink,
msgb_l2(oph->msg), msgb_l2len(oph->msg));
}
-static int handle_cn_disc_ind(struct hnbgw_cnlink *cnlink,
+static int handle_cn_disc_ind(void *slink,
const struct osmo_scu_disconn_param *param,
struct osmo_prim_hdr *oph)
{
struct hnbgw_context_map *map;
+ struct hnbgw_cnlink *cnlink = osmo_sua_link_get_user_priv(slink);
RUA_Cause_t rua_cause = {
.present = RUA_Cause_PR_NOTHING,
@@ -350,7 +352,7 @@ struct hnbgw_cnlink *hnbgw_cnlink_init(struct hnb_gw *gw, const char *host, uint
sccp_make_addr_pc_ssn(&cnlink->local_addr, 2, OSMO_SCCP_SSN_RANAP);
sccp_make_addr_pc_ssn(&cnlink->remote_addr, 1, OSMO_SCCP_SSN_RANAP);
- cnlink->sua_user = osmo_sua_user_create(cnlink, sccp_sap_up);
+ cnlink->sua_user = osmo_sua_user_create(cnlink, sccp_sap_up, cnlink);
if (!cnlink->sua_user) {
LOGP(DMAIN, LOGL_ERROR, "Failed to init SUA\n");
goto out_free;
diff --git a/src/tests/dummy_cn_sua.c b/src/tests/dummy_cn_sua.c
index 6d8098a..9e9b98c 100644
--- a/src/tests/dummy_cn_sua.c
+++ b/src/tests/dummy_cn_sua.c
@@ -251,7 +251,7 @@ int main(int argc, char **argv)
test_common_init();
- user = osmo_sua_user_create(ctx, sccp_sap_up);
+ user = osmo_sua_user_create(ctx, sccp_sap_up, ctx);
rc = osmo_sua_server_listen(user, "127.0.0.1", 14001);
if (rc < 0) {