aboutsummaryrefslogtreecommitdiffstats
path: root/gtp
diff options
context:
space:
mode:
authorYann BONNAMY <yann_bonnamy@yahoo.fr>2010-10-29 17:07:44 +0200
committerHarald Welte <laforge@gnumonks.org>2010-10-29 17:07:44 +0200
commit944dce3e66f3bc5b74f24dfbbee2370a231a39a9 (patch)
treea7450adfa49d387929c5f5dc97313d60737a53db /gtp
parent87490d7fa9052ca1fe1b67ba01c46611f9925ded (diff)
Add support for GTP IE's from 3GPP R7
This adds support for the followng new GTP Information Elements: RAT_TYPE, USER_LOC, MS_TZ, IMEI_SV Furthermore, it allows to specify those fields as sgsnemu command line arguments.
Diffstat (limited to 'gtp')
-rw-r--r--gtp/gtp.c17
-rw-r--r--gtp/gtpie.c4
-rw-r--r--gtp/gtpie.h4
-rw-r--r--gtp/pdp.h8
4 files changed, 33 insertions, 0 deletions
diff --git a/gtp/gtp.c b/gtp/gtp.c
index 3ffdb60..133e2aa 100644
--- a/gtp/gtp.c
+++ b/gtp/gtp.c
@@ -1136,6 +1136,23 @@ extern int gtp_create_context_req(struct gsn_t *gsn, struct pdp_t *pdp,
gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_OMC_ID,
pdp->omcid.l, pdp->omcid.v);
+ /* new R7 fields */
+ if (pdp->rattype_given == 1)
+ gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_RAT_TYPE,
+ pdp->rattype.l, pdp->rattype.v);
+
+ if (pdp->userloc_given == 1)
+ gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_USER_LOC,
+ pdp->userloc.l, pdp->userloc.v);
+
+ if (pdp->mstz_given == 1)
+ gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_MS_TZ,
+ pdp->mstz.l, pdp->mstz.v);
+
+ if (pdp->imeisv_given == 1)
+ gtpie_tlv(&packet, &length, GTP_MAX, GTPIE_IMEI_SV,
+ pdp->imeisv.l, pdp->imeisv.v);
+
/* TODO hisaddr0 */
gtp_req(gsn, pdp->version, pdp, &packet, length, &pdp->hisaddr0, cbp);
diff --git a/gtp/gtpie.c b/gtp/gtpie.c
index c75408e..80370a5 100644
--- a/gtp/gtpie.c
+++ b/gtp/gtpie.c
@@ -328,6 +328,10 @@ int gtpie_decaps(union gtpie_member* ie[], int version, void *pack, unsigned len
case GTPIE_TRIGGER_ID:
case GTPIE_OMC_ID:
case GTPIE_CHARGING_ADDR:
+ case GTPIE_RAT_TYPE:
+ case GTPIE_USER_LOC:
+ case GTPIE_MS_TZ:
+ case GTPIE_IMEI_SV:
case GTPIE_PRIVATE:
if (j<GTPIE_SIZE) {
ie[j] = (union gtpie_member*) p;
diff --git a/gtp/gtpie.h b/gtp/gtpie.h
index 83886f5..b8fe1e7 100644
--- a/gtp/gtpie.h
+++ b/gtp/gtpie.h
@@ -104,6 +104,10 @@ hton64(uint64_t q)
#define GTPIE_EXT_HEADER_T 141 /* Extension Header Type List */
#define GTPIE_TRIGGER_ID 142 /* Trigger Id */
#define GTPIE_OMC_ID 143 /* OMC Identity */
+#define GTPIE_RAT_TYPE 151 /* Radio Access Technology Type */
+#define GTPIE_USER_LOC 152 /* User Location Information */
+#define GTPIE_MS_TZ 153 /* MS Time Zone */
+#define GTPIE_IMEI_SV 154 /* IMEI Software Version */
/* 239-250 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */
#define GTPIE_CHARGING_ADDR 251 /* Charging Gateway Address */
/* 252-254 Reserved for the GPRS charging protocol (see GTP' in GSM 12.15) */
diff --git a/gtp/pdp.h b/gtp/pdp.h
index 624c4ac..d826d77 100644
--- a/gtp/pdp.h
+++ b/gtp/pdp.h
@@ -188,6 +188,14 @@ struct pdp_t {
struct ul255_t pco_req; /* Requested packet control options. */
struct ul255_t pco_neg; /* Negotiated packet control options. */
uint32_t selmode; /* Selection mode. */
+ struct ul255_t rattype; /* Radio Access Technology Type */
+ int rattype_given; /* Radio Access Technology Type given*/
+ struct ul255_t userloc; /* User Location Information */
+ int userloc_given; /* User Location Information given*/
+ struct ul255_t mstz; /* MS Time Zone */
+ int mstz_given; /* MS Time Zone given*/
+ struct ul255_t imeisv; /* IMEI Software Version */
+ int imeisv_given; /* IMEI Software Version given*/
/* Additional parameters used by library */