aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_iu.c
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-01-08 02:41:23 +0100
committerNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-03 16:19:08 +0100
commit5d145b54771548fa95f80d72308fb19a6d95f085 (patch)
tree6871b0f2a08f330df411d02a30e7803b5166339a /openbsc/src/gprs/sgsn_iu.c
parent45b13244f0f72d17e372b3a0b0786f6ca10f8edf (diff)
iu_common wip
Diffstat (limited to 'openbsc/src/gprs/sgsn_iu.c')
-rw-r--r--openbsc/src/gprs/sgsn_iu.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/openbsc/src/gprs/sgsn_iu.c b/openbsc/src/gprs/sgsn_iu.c
index 388f65935..edd31ffe6 100644
--- a/openbsc/src/gprs/sgsn_iu.c
+++ b/openbsc/src/gprs/sgsn_iu.c
@@ -18,14 +18,21 @@
#include <osmocom/sigtran/sccp_sap.h>
#include <openbsc/gprs_sgsn.h>
+#include <openbsc/iu.h>
#include <openbsc/debug.h>
#include <osmocom/ranap/ranap_ies_defs.h>
+#include <osmocom/ranap/ranap_common.h>
#include <osmocom/ranap/ranap_common_cn.h>
+#include <osmocom/ranap/ranap_msg_factory.h>
+
+#include <asn1c/asn1helpers.h>
int asn1_xer_print = 1;
void *talloc_asn1_ctx;
+iu_recv_cb_t global_iu_recv_cb = NULL;
+
struct ue_conn_ctx {
struct llist_head list;
struct osmo_sua_link *link;
@@ -125,6 +132,7 @@ int gprs_transp_upd_key(struct sgsn_mm_ctx *mm)
return 0;
}
+
static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *ies)
{
struct gprs_ra_id ra_id;
@@ -138,7 +146,8 @@ static int ranap_handle_co_initial_ue(void *ctx, RANAP_InitialUE_MessageIEs_t *i
/* Feed into the MM layer */
msg->dst = ctx;
- gsm0408_gprs_rcvmsg_iu(msg, ra_id, sai);
+ global_iu_recv_cb(msg, &ra_id, sai);
+ // gsm0408_gprs_rcvmsg_iu(msg, ra_id, sai);
return 0;
}
@@ -182,7 +191,7 @@ static int ranap_handle_co_err_ind(void *ctx, RANAP_ErrorIndicationIEs_t *ies)
return 0;
}
-int gprs_iu_tx(struct msgb *msg, uint8_t sapi, struct mm_context *mm)
+int iu_tx(struct msgb *msg, uint8_t sapi)
{
struct ue_conn_ctx *uectx = msg->dst;
struct osmo_scu_prim *prim;
@@ -405,13 +414,15 @@ static int sccp_sap_up(struct osmo_prim_hdr *oph, void *link)
return 0;
}
-int sgsn_iu_init(void *ctx)
+int sgsn_iu_init(void *ctx, iu_recv_cb_t iu_recv_cb)
{
struct osmo_sua_user *user;
int rc;
talloc_asn1_ctx = talloc_named_const(ctx, 1, "asn1");
+ global_iu_recv_cb = iu_recv_cb;
+
osmo_sua_set_log_area(DSUA);
user = osmo_sua_user_create(ctx, sccp_sap_up, ctx);