summaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/sgsn_libgtp.c
diff options
context:
space:
mode:
authorDaniel Willmann <dwillmann@sysmocom.de>2016-03-16 10:35:09 +0100
committerDaniel Willmann <dwillmann@sysmocom.de>2016-03-16 10:35:09 +0100
commitd04db9d90758d2abd572336942fd7e9246d41a22 (patch)
tree7b2a69c4dffa49b26f4c40db5f2430bda1a1f280 /openbsc/src/gprs/sgsn_libgtp.c
parent3c94c2c5975774282e49d2d9a1d2041b01c8378e (diff)
libiu: Replace RAB assignment response callback with a general one
The new iu event callback will now be called for RAB assignment response, IU release and security mode complete
Diffstat (limited to 'openbsc/src/gprs/sgsn_libgtp.c')
-rw-r--r--openbsc/src/gprs/sgsn_libgtp.c29
1 files changed, 27 insertions, 2 deletions
diff --git a/openbsc/src/gprs/sgsn_libgtp.c b/openbsc/src/gprs/sgsn_libgtp.c
index e48c103f1..1077cce5d 100644
--- a/openbsc/src/gprs/sgsn_libgtp.c
+++ b/openbsc/src/gprs/sgsn_libgtp.c
@@ -393,14 +393,16 @@ reject:
}
/* Callback for RAB assignment response */
-int sgsn_ranap_rab_ass_resp(struct ue_conn_ctx *ctx, uint8_t rab_id, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies)
+int sgsn_ranap_rab_ass_resp(struct ue_conn_ctx *ctx, RANAP_RAB_SetupOrModifiedItemIEs_t *setup_ies)
{
- int rc = -1;
+ uint8_t rab_id;
struct sgsn_mm_ctx *mm;
struct sgsn_pdp_ctx *pdp = NULL;
uint32_t gtp_tei;
RANAP_RAB_SetupOrModifiedItem_t *item = &setup_ies->raB_SetupOrModifiedItem;
+ rab_id = item->rAB_ID.buf[0];
+
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
/* XXX: Error handling */
@@ -427,6 +429,29 @@ int sgsn_ranap_rab_ass_resp(struct ue_conn_ctx *ctx, uint8_t rab_id, RANAP_RAB_S
}
+int sgsn_ranap_iu_event(struct ue_conn_ctx *ctx, int type, void *data)
+{
+ int rc = -1;
+
+ switch (type) {
+ case IU_EVENT_RAB_ASSIGN:
+ rc = sgsn_ranap_rab_ass_resp(ctx, (RANAP_RAB_SetupOrModifiedItemIEs_t *)data);
+ break;
+ case IU_EVENT_IU_RELEASE:
+ /* Clean up ue_conn_ctx here */
+ break;
+ case IU_EVENT_SECURITY_MODE_COMPLETE:
+ /* Continue authentication here */
+ break;
+ default:
+ LOGP(DRANAP, LOGL_NOTICE, "Unknown event received: %i\n", type);
+ rc = -1;
+ break;
+ }
+ return rc;
+}
+
+
/* Confirmation of a PDP Context Delete */
static int delete_pdp_conf(struct pdp_t *pdp, void *cbp, int cause)
{