aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/include/openbsc
diff options
context:
space:
mode:
authorHarald Welte <laforge@gnumonks.org>2010-05-17 00:44:57 +0200
committerHarald Welte <laforge@gnumonks.org>2010-05-17 00:44:57 +0200
commit2720e7310d3cce36bc3cbcf87d3e8eb2eecf5c75 (patch)
tree3136b5836493c1ad2841ef595a27042172cb7f26 /openbsc/include/openbsc
parent7363e92cd3b89eaa77db4bf502433524e16667b6 (diff)
[GPRS] Initial untested support for libgtp
libgtp of the OpenGGSN project will allow us to speak the GTPv0/v1 protocol of the interface between SGSN and GGSN. This commit includes code for the main libgtp integration (file descriptor, select loop, timer) as well as code to encode/send a CREATE PDP CONTEXT request.
Diffstat (limited to 'openbsc/include/openbsc')
-rw-r--r--openbsc/include/openbsc/gprs_sgsn.h10
-rw-r--r--openbsc/include/openbsc/gsm_04_08_gprs.h14
-rw-r--r--openbsc/include/openbsc/sgsn.h16
3 files changed, 39 insertions, 1 deletions
diff --git a/openbsc/include/openbsc/gprs_sgsn.h b/openbsc/include/openbsc/gprs_sgsn.h
index bdc0b1c8f..f70c6bed2 100644
--- a/openbsc/include/openbsc/gprs_sgsn.h
+++ b/openbsc/include/openbsc/gprs_sgsn.h
@@ -3,6 +3,10 @@
#include <stdint.h>
+#define GSM_IMSI_LENGTH 17
+#define GSM_IMEI_LENGTH 17
+#define GSM_EXTENSION_LENGTH 15
+
/* TS 04.08 4.1.3.3 GMM mobility management states on the network side */
enum gprs_mm_state {
GMM_DEREGISTERED, /* 4.1.3.3.1.1 */
@@ -20,11 +24,15 @@ enum gprs_ciph_algo {
#define MS_RADIO_ACCESS_CAPA
+struct sgsn_instance;
+
/* 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 {
struct llist_head list;
+ struct sgsn_instance *sgsn;
+
char imsi[GSM_IMSI_LENGTH];
enum gprs_mm_state mm_state;
uint32_t p_tmsi;
@@ -82,7 +90,7 @@ struct sgsn_pdp_ctx {
unsigned int id;
enum pdp_ctx_state state;
enum pdp_type type;
- uint32_t addresss;
+ uint32_t address;
char *apn_subscribed;
char *apn_used;
uint16_t nsapi;
diff --git a/openbsc/include/openbsc/gsm_04_08_gprs.h b/openbsc/include/openbsc/gsm_04_08_gprs.h
index 344b2774b..d9fb285bf 100644
--- a/openbsc/include/openbsc/gsm_04_08_gprs.h
+++ b/openbsc/include/openbsc/gsm_04_08_gprs.h
@@ -46,6 +46,15 @@
#define GPRS_ATT_T_ATT_WHILE_IMSI 2
#define GPRS_ATT_T_COMBINED 3
+/* Chapter 10.5.5.5 / Table 10.5.138 */
+#define GPRS_DET_T_MO_GPRS 1
+#define GPRS_DET_T_MO_IMSI 2
+#define GPRS_DET_T_MO_COMBINED 3
+/* Network to MS direction */
+#define GPRS_DET_T_MT_REATT_REQ 1
+#define GPRS_DET_T_MT_REATT_NOTREQ 2
+#define GPRS_DET_T_MT_IMSI 3
+
/* Chapter 10.5.5.18 / Table 105.150 */
#define GPRS_UPD_T_RA 0
#define GPRS_UPD_T_RA_LA 1
@@ -72,6 +81,11 @@ enum gsm48_gprs_ie_sm {
GSM48_IE_GSM_TIMEZONE = 0x46, /* 10.5.3.8 */
GSM48_IE_GSM_UTC_AND_TZ = 0x47, /* 10.5.3.9 */
GSM48_IE_GSM_LSA_ID = 0x48, /* 10.5.3.11 */
+
+ /* Fake IEs that are not present on the Layer3 air interface,
+ * but which we use to simplify internal APIs */
+ OSMO_IE_GSM_REQ_QOS = 0xfd,
+ OSMO_IE_GSM_REQ_PDP_ADDR = 0xfe,
};
/* Chapter 9.4.15 / Table 9.4.15 */
diff --git a/openbsc/include/openbsc/sgsn.h b/openbsc/include/openbsc/sgsn.h
index 2dc53c13d..2c4378bca 100644
--- a/openbsc/include/openbsc/sgsn.h
+++ b/openbsc/include/openbsc/sgsn.h
@@ -12,10 +12,26 @@ struct sgsn_config {
u_int32_t nsip_listen_ip;
u_int16_t nsip_listen_port;
+ char *gtp_statedir;
+ struct sockaddr_in gtp_listenaddr;
+
/* misc */
struct gprs_ns_inst *nsi;
};
+struct sgsn_instance {
+ char *config_file;
+ struct sgsn_config cfg;
+ /* File descriptor wrappers for LibGTP */
+ struct bsc_fd gtp_fd0;
+ struct bsc_fd gtp_fd1c;
+ struct bsc_fd gtp_fd1u;
+ /* Timer for libGTP */
+ struct timer_list gtp_timer;
+ /* GSN instance for libgtp */
+ struct gsn_t *gsn;
+};
+
/* sgsn_vty.c */