diff options
authorJacob Erlbeck <>2014-11-12 09:53:45 +0100
committerHolger Hans Peter Freyther <>2014-11-14 10:26:49 +0100
commit02ab91e6a73e16da51918b52548a0f4be4c6a0f6 (patch)
parenta0b6efb3685ea90190cfbd9423a74c181ea4f12f (diff)
sgsn: Cross-link gsm_subscriber and sgsn_mm_ctx
To implement subscriber based authorization a data structure is needed that keeps the subscriber data. The MSC already uses a similar struct named gsm_subscriber whose implementation is split into a generic part (allocation, retrieval, reference counting, list maintenance) and MSC related parts. For GPRS, only the generic part will be used and specific fields may be added when needed. This patch adds a field mm to struct gsm_subscriber that will be used by the SGSN to store a reference to the current MM context (or NULL if there is none). This also adds a field subscr to struct sgsn_mm_ctx that reversely points to a gsm_subscriber (or NULL if there is none). Either both fields are NULL or both fields are non-NULL. Note that subscr is being reference counted. Sponsored-by: On-Waves ehf
2 files changed, 7 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index 7ee68cc79..4572ac23d 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -16,6 +16,7 @@
struct gprs_llc_lle;
struct ctrl_handle;
+struct gsm_subscriber;
/* TS 04.08 GMM mobility management states on the network side */
enum gprs_mm_state {
@@ -126,6 +127,8 @@ struct sgsn_mm_ctx {
* whether one of them can be dropped. */
enum sgsn_auth_state auth_state;
+ struct gsm_subscriber *subscr;
#define LOGMMCTXP(level, mm, fmt, args...) \
diff --git a/openbsc/include/openbsc/gsm_subscriber.h b/openbsc/include/openbsc/gsm_subscriber.h
index 7aae4c332..7e0a419ae 100644
--- a/openbsc/include/openbsc/gsm_subscriber.h
+++ b/openbsc/include/openbsc/gsm_subscriber.h
@@ -18,6 +18,7 @@
struct vty;
+struct sgsn_mm_ctx;
struct gsm_equipment {
long long unsigned int id;
@@ -56,6 +57,9 @@ struct gsm_subscriber {
/* pending requests */
int in_callback;
struct llist_head requests;
+ /* GPRS/SGSN related fields */
+ struct sgsn_mm_ctx *mm;
enum gsm_subscriber_field {