aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc/gprs_sgsn.h
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-25 12:26:49 +0800
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2015-05-25 15:57:57 +0800
commit39c430ee2929f0671203974db11dfdd4ff4841cb (patch)
treef7fedeadef2803179a16e187589f5647917279cf /openbsc/include/openbsc/gprs_sgsn.h
parent66e7106d393368b2dd0d04c08f31781ed997380b (diff)
sgsn: Allow to resolve the IPv4 address of a GGSN through DNS
For real networks we need to check if the requested APN string is allowed and then resolve the GGSN address through DNS. There are countries with two or three digit MNCs and one could either try to keep a list of countries that have two/three digits or just try both of them. I have opted for the later for the ease of the implementation. C-Ares doesn't allow to cancel a request so we will need to have the MMCTX and the Lookup have different lifetimes. We simply set ->mmctx to NULL in case the MMCTX dies more early. The selected and verified apn_str will be copied into the out parameter. In case no static APN/GGSN config is present and the dynamic mode is enabled a request will be made.
Diffstat (limited to 'openbsc/include/openbsc/gprs_sgsn.h')
-rw-r--r--openbsc/include/openbsc/gprs_sgsn.h30
1 files changed, 29 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index 8abe97c51..61120b1e3 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -70,6 +70,29 @@ enum sgsn_auth_state {
#define MS_RADIO_ACCESS_CAPA
+enum sgsn_ggsn_lookup_state {
+ SGSN_GGSN_2DIGIT,
+ SGSN_GGSN_3DIGIT,
+};
+
+struct sgsn_ggsn_lookup {
+ int state;
+
+ struct sgsn_mm_ctx *mmctx;
+
+ /* APN string */
+ char apn_str[GSM_APN_LENGTH];
+
+ /* the original data */
+ struct msgb *orig_msg;
+ struct tlv_parsed tp;
+
+ /* for dealing with re-transmissions */
+ uint8_t nsapi;
+ uint8_t sapi;
+ uint8_t ti;
+};
+
/* According to TS 03.60, Table 5: SGSN MM and PDP Contexts */
/* Extended by 3GPP TS 23.060, Table 6: SGSN MM and PDP Contexts */
struct sgsn_mm_ctx {
@@ -139,6 +162,9 @@ struct sgsn_mm_ctx {
/* the string representation of the current hlr */
char hlr[GSM_EXTENSION_LENGTH];
+ /* the current GGSN look-up operation */
+ struct sgsn_ggsn_lookup *ggsn_lookup;
+
struct gsm_subscriber *subscr;
};
@@ -159,7 +185,8 @@ void sgsn_mm_ctx_cleanup_free(struct sgsn_mm_ctx *ctx);
struct sgsn_ggsn_ctx *sgsn_mm_ctx_find_ggsn_ctx(struct sgsn_mm_ctx *mmctx,
struct tlv_parsed *tp,
- enum gsm48_gsm_cause *gsm_cause);
+ enum gsm48_gsm_cause *gsm_cause,
+ char *apn_str);
enum pdp_ctx_state {
PDP_STATE_NONE,
@@ -182,6 +209,7 @@ struct sgsn_pdp_ctx {
struct llist_head list; /* list_head for mmctx->pdp_list */
struct llist_head g_list; /* list_head for global list */
struct sgsn_mm_ctx *mm; /* back pointer to MM CTX */
+ int destroy_ggsn; /* destroy it on destruction */
struct sgsn_ggsn_ctx *ggsn; /* which GGSN serves this PDP */
struct rate_ctr_group *ctrg;