aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--openbsc/include/openbsc/gprs_sgsn.h17
-rw-r--r--openbsc/src/gprs/gprs_subscriber.c14
2 files changed, 31 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index 00cf5ccef..ad7463e3e 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -271,6 +271,22 @@ struct imsi_acl_entry {
char imsi[16+1];
};
+/* see GSM 09.02, 17.7.1, PDP-Context and GPRSSubscriptionData */
+/* see GSM 09.02, B.1, gprsSubscriptionData */
+struct sgsn_subscriber_pdp_data {
+ struct llist_head list;
+
+ /* raw binary data */
+ int pdp_context_id;
+ uint8_t pdp_type[2];
+ uint8_t pdp_address[16];
+ size_t pdp_address_size; /* 0: not present */
+ uint8_t qos_subscribed[3];
+ int vplmn_address_allowed;
+ uint8_t apn[63];
+ size_t apn_size;
+};
+
enum sgsn_subscriber_proc {
SGSN_SUBSCR_PROC_NONE = 0,
SGSN_SUBSCR_PROC_PURGE,
@@ -282,6 +298,7 @@ struct sgsn_subscriber_data {
struct sgsn_mm_ctx *mm;
struct gsm_auth_tuple auth_triplets[5];
int auth_triplets_updated;
+ struct llist_head pdp_list;
int error_cause;
struct osmo_timer_list timer;
int retries;
diff --git a/openbsc/src/gprs/gprs_subscriber.c b/openbsc/src/gprs/gprs_subscriber.c
index 5bde6a090..25785d451 100644
--- a/openbsc/src/gprs/gprs_subscriber.c
+++ b/openbsc/src/gprs/gprs_subscriber.c
@@ -172,9 +172,23 @@ static struct sgsn_subscriber_data *sgsn_subscriber_data_alloc(void *ctx)
for (idx = 0; idx < ARRAY_SIZE(sdata->auth_triplets); idx++)
sdata->auth_triplets[idx].key_seq = GSM_KEY_SEQ_INVAL;
+ INIT_LLIST_HEAD(&sdata->pdp_list);
+
return sdata;
}
+struct sgsn_subscriber_pdp_data* sgsn_subscriber_pdp_data_alloc(
+ struct sgsn_subscriber_data *sdata)
+{
+ struct sgsn_subscriber_pdp_data* pdata;
+
+ pdata = talloc_zero(sdata, struct sgsn_subscriber_pdp_data);
+
+ llist_add(&sdata->pdp_list, &pdata->list);
+
+ return pdata;
+}
+
struct gsm_subscriber *gprs_subscr_get_or_create(const char *imsi)
{
struct gsm_subscriber *subscr;