aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs
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
parent45b13244f0f72d17e372b3a0b0786f6ca10f8edf (diff)
iu_common wip
Diffstat (limited to 'openbsc/src/gprs')
-rw-r--r--openbsc/src/gprs/gprs_gmm.c3
-rw-r--r--openbsc/src/gprs/sgsn_iu.c17
-rw-r--r--openbsc/src/gprs/sgsn_main.c2
3 files changed, 17 insertions, 5 deletions
diff --git a/openbsc/src/gprs/gprs_gmm.c b/openbsc/src/gprs/gprs_gmm.c
index cf0d3ecb5..56d892f3a 100644
--- a/openbsc/src/gprs/gprs_gmm.c
+++ b/openbsc/src/gprs/gprs_gmm.c
@@ -55,6 +55,7 @@
#include <openbsc/gprs_utils.h>
#include <openbsc/sgsn.h>
#include <openbsc/signal.h>
+#include <openbsc/iu.h>
#include <pdp.h>
@@ -138,7 +139,7 @@ static int gsm48_gmm_sendmsg(struct msgb *msg, int command,
rate_ctr_inc(&mm->ctrg->ctr[GMM_CTR_PKTS_SIG_OUT]);
if (msg->dst)
- return gprs_iu_tx(msg, GPRS_SAPI_GMM, mm);
+ return iu_tx(msg, GPRS_SAPI_GMM);
/* caller needs to provide TLLI, BVCI and NSEI */
return gprs_llc_tx_ui(msg, GPRS_SAPI_GMM, command, mm);
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);
diff --git a/openbsc/src/gprs/sgsn_main.c b/openbsc/src/gprs/sgsn_main.c
index bb898fe7c..b0f758049 100644
--- a/openbsc/src/gprs/sgsn_main.c
+++ b/openbsc/src/gprs/sgsn_main.c
@@ -418,7 +418,7 @@ int main(int argc, char **argv)
}
asn_debug = 0;
- sgsn_iu_init(tall_bsc_ctx);
+ sgsn_iu_init(tall_bsc_ctx, gsm0408_gprs_rcvmsg_iu);
if (daemonize) {
rc = osmo_daemonize();