[PATCH] openbsc[master]: Support Deactivate PDP Context Request from network

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/.

pravin gerrit-no-reply at lists.osmocom.org
Wed Nov 30 07:19:09 UTC 2016


Hello Harald Welte, Jenkins Builder, Holger Freyther,

I'd like you to reexamine a change.  Please visit

    https://gerrit.osmocom.org/1262

to look at the new patch set (#3).

Support Deactivate PDP Context Request from network

Enable Deactivate PDP context based on the IMSI of the subscriber.
When there are PDP contexts present for a MM context,
PDP context will be deactivated along with GMM Detach(MM context deletion).
If there are no PDP present, MM context will be deleted to avoid
further PDP context request from the MS.

Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13
---
M openbsc/include/openbsc/gprs_sgsn.h
M openbsc/src/gprs/gprs_sgsn.c
2 files changed, 40 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.osmocom.org:29418/openbsc refs/changes/62/1262/3

diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index 24e286c..c72171a 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -369,6 +369,8 @@
  * ottherwise lost state (recovery procedure) */
 int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn);
 
+void drop_pdp_for_ms(const char *imsi);
+
 char *gprs_pdpaddr2str(uint8_t *pdpa, uint8_t len);
 
 /*
diff --git a/openbsc/src/gprs/gprs_sgsn.c b/openbsc/src/gprs/gprs_sgsn.c
index e5a54d9..42fb6a3 100644
--- a/openbsc/src/gprs/gprs_sgsn.c
+++ b/openbsc/src/gprs/gprs_sgsn.c
@@ -667,6 +667,44 @@
 	}
 }
 
+/*
+ * High-level function to be called for PDP deactivation initiated from SGSN VTY.
+ * When there are PDP contexts present for a MM context, PDP context will be
+ * deactivated along with GMM Detach(MM context deletion).
+ * If there are no PDP present, MM context will be deleted to avoid further
+ * PDP context activation for that MS.
+ */
+void drop_pdp_for_ms(const char *imsi)
+{
+	OSMO_ASSERT(imsi != NULL);
+	struct sgsn_mm_ctx *mm;
+	struct sgsn_pdp_ctx *pdp;
+
+	LOGP(DGPRS, LOGL_NOTICE, "SGSN intiated Deactivate PDP for IMSI: %s\n",
+		imsi);
+	/* Search the MM context subscriber */
+	mm = sgsn_mm_ctx_by_imsi(imsi);
+	if (mm) {
+		/* Search the PDP for this subscriber */
+		if (llist_empty(&mm->pdp_list)) {
+			/*
+			 * Deleting mm context for the subscriber when no PDP
+			 * context is present.
+			 */
+			gsm0408_gprs_access_cancelled(mm, GMM_CAUSE_GPRS_NOTALLOWED);
+			LOGP(DGPRS, LOGL_NOTICE, "No pdp context for this IMSI: %s\n",
+				imsi);
+		} else {
+			llist_for_each_entry(pdp, &mm->pdp_list, list) {
+				gsm48_tx_gsm_deact_pdp_req(pdp, GSM_CAUSE_DEACT_REGULAR);
+				LOGPDPCTXP(LOGL_NOTICE, pdp, "PDP Deactivation "
+					"Successful\n");
+			}
+		}
+	} else
+		LOGP(DGPRS, LOGL_NOTICE, "No mm context for this IMSI: %s\n", imsi);
+}
+
 /* High-level function to be called in case a GGSN has disappeared or
  * otherwise lost state (recovery procedure) */
 int drop_all_pdp_for_ggsn(struct sgsn_ggsn_ctx *ggsn)

-- 
To view, visit https://gerrit.osmocom.org/1262
To unsubscribe, visit https://gerrit.osmocom.org/settings

Gerrit-MessageType: newpatchset
Gerrit-Change-Id: Ia0a41aa2218ec2fda4ea17a37c8cc55cba63dd13
Gerrit-PatchSet: 3
Gerrit-Project: openbsc
Gerrit-Branch: master
Gerrit-Owner: pravin <pravin.manoharan at radisys.com>
Gerrit-Reviewer: Harald Welte <laforge at gnumonks.org>
Gerrit-Reviewer: Holger Freyther <holger at freyther.de>
Gerrit-Reviewer: Jenkins Builder



More information about the gerrit-log mailing list