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
This commit is contained in:
Jacob Erlbeck 2014-11-12 09:53:45 +01:00 committed by Holger Hans Peter Freyther
parent a0b6efb368
commit 02ab91e6a7
2 changed files with 7 additions and 0 deletions

View File

@ -16,6 +16,7 @@
struct gprs_llc_lle;
struct ctrl_handle;
struct gsm_subscriber;
/* TS 04.08 4.1.3.3 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...) \

View File

@ -18,6 +18,7 @@
#define GSM_SUBSCRIBER_NO_EXPIRATION 0x0
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 {