Change in ...osmo-sgsn[master]: gprs_ranap: introduce Iu helper to free the UE context

This is merely a historical archive of years 2008-2021, before the migration to mailman3.

A maintained and still updated list archive can be found at https://lists.osmocom.org/hyperkitty/list/gerrit-log@lists.osmocom.org/.

lynxis lazus gerrit-no-reply at lists.osmocom.org
Wed Sep 11 01:41:44 UTC 2019


lynxis lazus has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-sgsn/+/15481


Change subject: gprs_ranap: introduce Iu helper to free the UE context
......................................................................

gprs_ranap: introduce Iu helper to free the UE context

Prepare to free Iu UE contexts when moving between the
PMM states.

Change-Id: Id1c1d453cf91f566a01ef9480ffffff3850a1031
---
M include/osmocom/sgsn/gprs_ranap.h
M src/sgsn/gprs_ranap.c
2 files changed, 36 insertions(+), 0 deletions(-)



  git pull ssh://gerrit.osmocom.org:29418/osmo-sgsn refs/changes/81/15481/1

diff --git a/include/osmocom/sgsn/gprs_ranap.h b/include/osmocom/sgsn/gprs_ranap.h
index b300130..8cb9f66 100644
--- a/include/osmocom/sgsn/gprs_ranap.h
+++ b/include/osmocom/sgsn/gprs_ranap.h
@@ -12,6 +12,13 @@
 int sgsn_ranap_iu_event(struct ranap_ue_conn_ctx *ctx, enum ranap_iu_event_type type, void *data);
 int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp);
 
+/* free the Iu UE context */
+void sgsn_ranap_iu_free(struct sgsn_mm_ctx *ctx);
+
+/* send a Iu Release Command and free afterwards the UE context */
+void sgsn_ranap_iu_release_free(struct sgsn_mm_ctx *ctx,
+				const struct RANAP_Cause *cause);
+
 int gsm0408_gprs_rcvmsg_iu(struct msgb *msg, struct gprs_ra_id *ra_id, uint16_t *sai);
 #endif
 
diff --git a/src/sgsn/gprs_ranap.c b/src/sgsn/gprs_ranap.c
index acd9eb6..2d2bdc5 100644
--- a/src/sgsn/gprs_ranap.c
+++ b/src/sgsn/gprs_ranap.c
@@ -155,6 +155,35 @@
 	return rc;
 }
 
+/* TODO: use timers */
+#define TIMEOUT_RANAP_RELEASE_SEC 5
+void sgsn_ranap_iu_free(struct sgsn_mm_ctx *ctx)
+{
+	if (!ctx)
+		return;
+
+	if (!ctx->iu.ue_ctx)
+		return;
+
+	ranap_iu_free_ue(ctx->iu.ue_ctx);
+	ctx->iu.ue_ctx = NULL;
+}
+
+void sgsn_ranap_iu_release_free(struct sgsn_mm_ctx *ctx,
+				const struct RANAP_Cause *cause)
+{
+	if (!ctx)
+		return;
+
+	if (!ctx->iu.ue_ctx)
+		return;
+
+	ranap_iu_tx_release_free(ctx->iu.ue_ctx,
+				 cause,
+				 TIMEOUT_RANAP_RELEASE_SEC);
+	ctx->iu.ue_ctx = NULL;
+}
+
 int iu_rab_act_ps(uint8_t rab_id, struct sgsn_pdp_ctx *pdp)
 {
 	struct msgb *msg;

-- 
To view, visit https://gerrit.osmocom.org/c/osmo-sgsn/+/15481
To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings

Gerrit-Project: osmo-sgsn
Gerrit-Branch: master
Gerrit-Change-Id: Id1c1d453cf91f566a01ef9480ffffff3850a1031
Gerrit-Change-Number: 15481
Gerrit-PatchSet: 1
Gerrit-Owner: lynxis lazus <lynxis at fe80.eu>
Gerrit-MessageType: newchange
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osmocom.org/pipermail/gerrit-log/attachments/20190911/4f9c7c56/attachment.htm>


More information about the gerrit-log mailing list