lynxis lazus has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-sgsn/+/40699?usp=email )
Change subject: ranap: split mmctx related iu events into own function
......................................................................
ranap: split mmctx related iu events into own function
In preparation of Routing Areas for Iu, split
off mmctx related events into an own function.
All mmctx related events must contain a valid ctx or are
otherwise invalid.
Change-Id: Ie6f131d29da299f09e897240ec5c39a395ce6f1b
---
M src/sgsn/gprs_ranap.c
1 file changed, 24 insertions(+), 1 deletion(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/99/40699/1
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index af764de..d721255 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -137,11 +137,17 @@
return -1;
}
-int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type,
void *data)
+static int sgsn_ranap_iu_event_mmctx(struct ranap_ue_conn_ctx *ctx, enum
ranap_iu_event_type type, void *data)
{
struct sgsn_mm_ctx *mm;
int rc = -1;
+ if (!ctx) {
+ LOGIUP(ctx, LOGL_ERROR, "NULL ctx given for IU event %s\n",
+ ranap_iu_event_type_str(type));
+ return rc;
+ }
+
mm = sgsn_mm_ctx_by_ue_ctx(ctx);
if (!mm) {
LOGIUP(ctx, LOGL_NOTICE, "Cannot find mm ctx for IU event %s\n",
@@ -193,6 +199,23 @@
return rc;
}
+
+int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type,
void *data)
+{
+ struct ranap_iu_event_new_area *new_area;
+
+ switch (type) {
+ case RANAP_IU_EVENT_RAB_ASSIGN:
+ case RANAP_IU_EVENT_IU_RELEASE:
+ case RANAP_IU_EVENT_LINK_INVALIDATED:
+ case RANAP_IU_EVENT_SECURITY_MODE_COMPLETE:
+ return sgsn_ranap_iu_event_mmctx(ctx, type, data);
+ default:
+ LOGP(DRANAP, LOGL_NOTICE, "Iu: Unknown event received: type: %d\n", type);
+ return -1;
+ }
+}
+
void sgsn_ranap_iu_free(struct sgsn_mm_ctx *ctx)
{
if (!ctx)
--
To view, visit
https://gerrit.osmocom.org/c/osmo-sgsn/+/40699?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Ie6f131d29da299f09e897240ec5c39a395ce6f1b
Gerrit-Change-Number: 40699
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis(a)fe80.eu>