Switch a bunch of dissectors over to using tvb_new_subset_remaining()
[obnox/wireshark/wip.git] / epan / dissectors / packet-gtp.c
index 90bbf669f068b6a75ec46a63edd381d5e3ada5f9..4146539adc60cf184b1ab869467b4e505b8f6083 100644 (file)
@@ -5,7 +5,7 @@
  *                 Nicolas Balkota <balkota@mac.com>
  *
  * Updates and corrections:
- * Copyright 2006 - 2008, Anders Broman <anders.broman@ericsson.com>
+ * Copyright 2006 - 2009, Anders Broman <anders.broman@ericsson.com>
  *
  * $Id$
  *
@@ -231,6 +231,9 @@ static int hf_gtp_no_of_mbms_sa_codes = -1;
 static int hf_gtp_mbms_sa_code = -1;
 static int hf_gtp_mbs_2g_3g_ind = -1;
 static int hf_gtp_time_2_dta_tr = -1;
+static int hf_gtp_ext_ei = -1;
+static int hf_gtp_ext_gcsi = -1;
+static int hf_gtp_ext_dti = -1;
 
 /* Initialize the subtree pointers */
 static gint ett_gtp = -1;
@@ -313,7 +316,7 @@ static int gtp_tap = -1;
 static const value_string ver_types[] = {
     {0, "GTP release 97/98 version"},
     {1, "GTP release 99 version"},
-    {2, "None"},
+    {2, "GTPv2-C"},
     {3, "None"},
     {4, "None"},
     {5, "None"},
@@ -553,15 +556,15 @@ static const value_string message_type[] = {
 #define GTP_EXT_BSS_CONT                       0xAD    /* 3G   173 TLV BSS Container 7.7.72 */
 #define GTP_EXT_CELL_ID                                0xAE    /* 3G   174 TLV Cell Identification 7.7.73 */
 #define GTP_EXT_PDU_NO                         0xAF    /* 3G   175 TLV PDU Numbers 7.7.74 */
-#define GTP_EXT_BSSGP_CAUSE                    0xA0    /* 3G   176 TLV BSSGP Cause 7.7.75 */
-#define GTP_EXT_REQ_MBMS_BEARER_CAP 0xA1       /* 3G   177     TLV     Required MBMS bearer capabilities       7.7.76 */
-#define GTP_EXT_RIM_ROUTING_ADDR_DISC 0xA2     /* 3G   178     TLV     RIM Routing Address Discriminator       7.7.77 */
-#define GTP_EXT_LIST_OF_SETUP_PFCS     0xA3    /* 3G   179     TLV     List of set-up PFCs     7.7.78 */
-#define GTP_EXT_PS_HANDOVER_XIP_PAR 0xA4       /* 3G   180     TLV     PS Handover XID Parameters      7.7.79 */
-#define GTP_EXT_MS_INF_CHG_REP_ACT     0xA5    /* 3G   181     TLV     MS Info Change Reporting Action 7.7.80 */
-#define GTP_EXT_DIRECT_TUNNEL_FLGS     0xA6    /* 3G   182     TLV     Direct Tunnel Flags     7.7.81 */
-#define GTP_EXT_CORRELATION_ID         0xA7    /* 3G   183     TLV     Correlation-ID  7.7.82 */
-#define GTP_EXT_BEARER_CONTROL_MODE 0xA8       /* 3G   184     TLV     Bearer Control Mode     7.7.83 */
+#define GTP_EXT_BSSGP_CAUSE                    0xB0    /* 3G   176 TLV BSSGP Cause 7.7.75 */
+#define GTP_EXT_REQ_MBMS_BEARER_CAP 0xB1       /* 3G   177 TLV Required MBMS bearer capabilities       7.7.76 */
+#define GTP_EXT_RIM_ROUTING_ADDR_DISC 0xB2     /* 3G   178 TLV RIM Routing Address Discriminator       7.7.77 */
+#define GTP_EXT_LIST_OF_SETUP_PFCS     0xB3    /* 3G   179 TLV List of set-up PFCs     7.7.78 */
+#define GTP_EXT_PS_HANDOVER_XIP_PAR 0xB4       /* 3G   180 TLV PS Handover XID Parameters      7.7.79 */
+#define GTP_EXT_MS_INF_CHG_REP_ACT     0xB5    /* 3G   181 TLV MS Info Change Reporting Action 7.7.80 */
+#define GTP_EXT_DIRECT_TUNNEL_FLGS     0xB6    /* 3G   182 TLV Direct Tunnel Flags     7.7.81 */
+#define GTP_EXT_CORRELATION_ID         0xB7    /* 3G   183 TLV Correlation-ID  7.7.82 */
+#define GTP_EXT_BEARER_CONTROL_MODE 0xB8       /* 3G   184 TLV Bearer Control Mode     7.7.83 */
 /* 239-250     Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33])*/
 
 #define GTP_EXT_C1                     0xC1
@@ -1186,10 +1189,10 @@ static const value_string ranap_cause_type[] = {
     {2, "Trelocoverall Expiry"},
     {3, "Trelocprep Expiry"},
     {4, "Treloccomplete Expiry"},
-    {5, "Tqueing Expiry"},
+    {5, "Tqueuing Expiry"},
     {6, "Relocation Triggered"},
     {7, "TRELOCalloc Expiry"},
-    {8, "Unable to Estabish During Relocation"},
+    {8, "Unable to Establish During Relocation"},
     {9, "Unknown Target RNC"},
     {10, "Relocation Cancelled"},
     {11, "Successful Relocation"},
@@ -1264,15 +1267,15 @@ static const value_string ranap_cause_type[] = {
     {113, "O & M Intervention"},
     {114, "No Resource Available"},
     {115, "Unspecified Failure"},
-    {116, "Network Opimisation"},
+    {116, "Network Optimisation"},
 /* Non-standard Cause (129-->255) */
 
 /* ranap_CauseRadioNetworkExtension ??
-       { 257, "iP-multicast-address-and-APN-not-valid" },
-       { 258, "mBMS-de-registration-rejected-due-to-implicit-registration" },
-       { 259, "mBMS-request-superseded" },
-       { 260, "mBMS-de-registration-during-session-not-allowed" },
-       { 261, "mBMS-no-data-bearer-necessary" },
+    { 257, "iP-multicast-address-and-APN-not-valid" },
+    { 258, "mBMS-de-registration-rejected-due-to-implicit-registration" },
+    { 259, "mBMS-request-superseded" },
+    { 260, "mBMS-de-registration-during-session-not-allowed" },
+    { 261, "mBMS-no-data-bearer-necessary" },
   */
 
     {0, NULL}
@@ -1297,18 +1300,15 @@ static const value_string gtp_cipher_algorithm[] = {
     {7, "GEA/7"},
     {0, NULL}
 };
-
-static const value_string gtp_ext_rat_type_vals[] = {
-    {0, "Reserved"},
-    {1, "UTRAN"},
-    {2, "GERAN"},
-    {3, "WLAN"},
-    {4, "GAN"},
-    {5, "HSPA Evolution"},
-    {0, NULL}
-};
-
-
+static const value_string gtp_ext_rat_type_vals[] = {   
+      {0, "Reserved"},   
+      {1, "UTRAN"},   
+      {2, "GERAN"},   
+      {3, "WLAN"},   
+      {4, "GAN"},   
+      {5, "HSPA Evolution"},   
+      {0, NULL}   
+}; 
 
 #define MM_PROTO_GROUP_CALL_CONTROL    0x00
 #define MM_PROTO_BROADCAST_CALL_CONTROL        0x01
@@ -1341,6 +1341,7 @@ static dissector_handle_t ppp_handle;
 static dissector_handle_t data_handle;
 static dissector_handle_t gtpcdr_handle;
 static dissector_handle_t sndcpxid_handle;
+static dissector_handle_t gtpv2_handle;
 static dissector_table_t bssap_pdu_type_table;
 
 static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype);
@@ -1424,8 +1425,14 @@ static int decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo,
 static int decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
 static int decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
 static int decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
+static int decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
+static int decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
+static int decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
 static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
-
+static int decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
+static int decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
+static int decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
+static int decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
 static int decode_gtp_chrg_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
 static int decode_gtp_rel_pack(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
 static int decode_gtp_can_pack(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
@@ -1520,7 +1527,14 @@ static const gtp_opt_t gtpopt[] = {
     {GTP_EXT_CELL_ID, decode_gtp_cell_id},     /* 7.7.73 */
     {GTP_EXT_PDU_NO, decode_gtp_pdu_no},       /* 7.7.74 */
     {GTP_EXT_BSSGP_CAUSE, decode_gtp_bssgp_cause},     /* 7.7.75 */
+    {GTP_EXT_REQ_MBMS_BEARER_CAP, decode_gtp_mbms_bearer_cap}, /* 7.7.76 */
+    {GTP_EXT_RIM_ROUTING_ADDR_DISC, decode_gtp_rim_ra_disc},   /* 7.7.77 */
+    {GTP_EXT_LIST_OF_SETUP_PFCS, decode_gtp_lst_set_up_pfc},   /* 7.7.78 */
     {GTP_EXT_PS_HANDOVER_XIP_PAR, decode_gtp_ps_handover_xid}, /* 7.7.79 */
+    {GTP_EXT_MS_INF_CHG_REP_ACT, decode_gtp_ms_inf_chg_rep_act},       /* 7.7.80 */
+    {GTP_EXT_DIRECT_TUNNEL_FLGS, decode_gtp_direct_tnl_flg},   /* 7.7.81 */
+    {GTP_EXT_CORRELATION_ID, decode_gtp_corrl_id},     /* 7.7.82 */
+    {GTP_EXT_BEARER_CONTROL_MODE, decode_gtp_bearer_cntrl_mod},        /* 7.7.83 */
 
     {GTP_EXT_REL_PACK, decode_gtp_rel_pack},   /* charging */
     {GTP_EXT_CAN_PACK, decode_gtp_can_pack},   /* charging */
@@ -2044,6 +2058,7 @@ static _gtp_mess_items umts_mess_items[] = {
                               {GTP_EXT_RECOVER, GTP_OPTIONAL},
                               {GTP_EXT_TEID, GTP_CONDITIONAL},
                               {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
+                                  {GTP_EXT_NSAPI, GTP_CONDITIONAL},
                               {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
                               {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
                               {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
@@ -2053,9 +2068,9 @@ static _gtp_mess_items umts_mess_items[] = {
                               {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
                               /* TS 29.060 V6.11.0 */
                               {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},       /* Alternative Charging Gateway Address Optional 7.7.44 */
-                              {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
                               {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL},     /* Common Flags Optional 7.7.48 */
                               {GTP_EXT_APN_RES, GTP_OPTIONAL}, /* APN Restriction Optional 7.7.49 */
+                              {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
                               {0, 0}
                               }
      },
@@ -2078,11 +2093,12 @@ static _gtp_mess_items umts_mess_items[] = {
                              {GTP_EXT_TFT, GTP_OPTIONAL},
                              {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL},
                              {GTP_EXT_OMC_ID, GTP_OPTIONAL},
-                             {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
-                             {GTP_EXT_RAT_TYPE, GTP_OPTIONAL}, /* RAT Type Optional 7.7.50 */
-                             {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL},      /* User Location Information Optional 7.7.51 */
-                             {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL},     /* MS Time Zone Optional 7.7.52 */
-                             {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL},      /* Additonal Trace Info Optional 7.7.62 */
+                             {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL},                      /* Common Flags Optional 7.7.48 */
+                             {GTP_EXT_RAT_TYPE, GTP_OPTIONAL},                         /* RAT Type Optional 7.7.50 */
+                             {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL},                      /* User Location Information Optional 7.7.51 */
+                             {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL},                     /* MS Time Zone Optional 7.7.52 */
+                             {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL},                      /* Additonal Trace Info Optional 7.7.62 */
+                             {GTP_EXT_DIRECT_TUNNEL_FLGS, GTP_OPTIONAL},       /* Direct Tunnel Flags     7.7.81 */
                              {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
                              {0, 0}
                              }
@@ -2605,9 +2621,9 @@ static _gtp_mess_items umts_mess_items[] = {
        to keep track of request/response-pairs
  */
 typedef struct gtp_conv_info_t {
-  struct gtp_conv_info_t *next;
-  GHashTable *unmatched;
-  GHashTable *matched;
+    struct gtp_conv_info_t *next;
+    GHashTable *unmatched;
+    GHashTable *matched;
 } gtp_conv_info_t;
 
 static gtp_conv_info_t *gtp_info_items;
@@ -2624,13 +2640,13 @@ static gint gtp_sn_equal_matched(gconstpointer k1, gconstpointer k2)
     const gtp_msg_hash_t *key1 = k1;
     const gtp_msg_hash_t *key2 = k2;
 
-       if( key1->req_frame && key2->req_frame && (key1->req_frame!=key2->req_frame) ){
-       return 0;
-       }
+    if( key1->req_frame && key2->req_frame && (key1->req_frame!=key2->req_frame) ){
+        return 0;
+    }
 
-  if( key1->rep_frame && key2->rep_frame && (key1->rep_frame!=key2->rep_frame) ){
-    return 0;
-  }
+    if( key1->rep_frame && key2->rep_frame && (key1->rep_frame!=key2->rep_frame) ){
+        return 0;
+    }
 
     return key1->seq_nr == key2->seq_nr;
 }
@@ -2646,9 +2662,9 @@ static gint gtp_sn_equal_unmatched(gconstpointer k1, gconstpointer k2)
 static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype)
 {
     gtp_msg_hash_t gcr, *gcrp = NULL;
-       gtp_conv_info_t *gtp_info = (gtp_conv_info_t *)pinfo->private_data;
+    gtp_conv_info_t *gtp_info = (gtp_conv_info_t *)pinfo->private_data;
 
-       gcr.seq_nr=seq_nr;
+    gcr.seq_nr=seq_nr;
 
     switch (msgtype) {
     case GTP_MSG_ECHO_REQ:
@@ -2657,73 +2673,73 @@ static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, p
     case GTP_MSG_DELETE_PDP_REQ:
        gcr.is_request=TRUE;
        gcr.req_frame=pinfo->fd->num;
-    gcr.rep_frame=0;
+        gcr.rep_frame=0;
        break;
     case GTP_MSG_ECHO_RESP:
     case GTP_MSG_CREATE_PDP_RESP:
     case GTP_MSG_UPDATE_PDP_RESP:
     case GTP_MSG_DELETE_PDP_RESP:
        gcr.is_request=FALSE;
-    gcr.req_frame=0;
+        gcr.req_frame=0;
        gcr.rep_frame=pinfo->fd->num;
        break;
        default:;
        break;
     }
 
-       gcrp = g_hash_table_lookup(gtp_info->matched, &gcr);
+    gcrp = g_hash_table_lookup(gtp_info->matched, &gcr);
 
-        if(gcrp){
+    if(gcrp){
 
         gcrp->is_request=gcr.is_request;
 
-      } else {
+    } else {
 
        /*no match, let's try to make one*/     
        switch (msgtype) {
-    case GTP_MSG_ECHO_REQ:
+        case GTP_MSG_ECHO_REQ:
        case GTP_MSG_CREATE_PDP_REQ:
        case GTP_MSG_UPDATE_PDP_REQ:
        case GTP_MSG_DELETE_PDP_REQ:
-               gcr.seq_nr=seq_nr;
-
-                gcrp=g_hash_table_lookup(gtp_info->unmatched, &gcr);
-        if(gcrp){
-          g_hash_table_remove(gtp_info->unmatched, gcrp);
-        }
-        /* if we cant reuse the old one, grab a new chunk */
-        if(!gcrp){
-           gcrp = se_alloc(sizeof(gtp_msg_hash_t));
-        }
-               gcrp->seq_nr=seq_nr;
+            gcr.seq_nr=seq_nr;
+
+            gcrp=g_hash_table_lookup(gtp_info->unmatched, &gcr);
+            if(gcrp){
+                g_hash_table_remove(gtp_info->unmatched, gcrp);
+            }
+            /* if we cant reuse the old one, grab a new chunk */
+            if(!gcrp){
+                gcrp = se_alloc(sizeof(gtp_msg_hash_t));
+            }
+            gcrp->seq_nr=seq_nr;
            gcrp->req_frame = pinfo->fd->num;
            gcrp->req_time = pinfo->fd->abs_ts;
            gcrp->rep_frame = 0;
            gcrp->msgtype = msgtype;
            gcrp->is_request = TRUE;
            g_hash_table_insert(gtp_info->unmatched, gcrp, gcrp);
-               return NULL;
+            return NULL;
            break;
-    case GTP_MSG_ECHO_RESP:
+        case GTP_MSG_ECHO_RESP:
        case GTP_MSG_CREATE_PDP_RESP:
        case GTP_MSG_UPDATE_PDP_RESP:
        case GTP_MSG_DELETE_PDP_RESP:
-               gcr.seq_nr=seq_nr;
-               gcrp=g_hash_table_lookup(gtp_info->unmatched, &gcr);
+            gcr.seq_nr=seq_nr;
+            gcrp=g_hash_table_lookup(gtp_info->unmatched, &gcr);
 
-               if (gcrp) {
+            if (gcrp) {
                if(!gcrp->rep_frame){
-            g_hash_table_remove(gtp_info->unmatched, gcrp);
-            gcrp->rep_frame=pinfo->fd->num;
-            gcrp->is_request=FALSE;
-            g_hash_table_insert(gtp_info->matched, gcrp, gcrp);                        
-          }
-               }
-               break;
+                    g_hash_table_remove(gtp_info->unmatched, gcrp);
+                    gcrp->rep_frame=pinfo->fd->num;
+                    gcrp->is_request=FALSE;
+                    g_hash_table_insert(gtp_info->matched, gcrp, gcrp);                        
+                }
+            }
+            break;
        default:;
        break;
-               }
-        }
+        }
+    }
     
     /* we have found a match */
     if (gcrp) {
@@ -3723,7 +3739,7 @@ static int decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const
     guint8 res_ber, sdu_err_ratio;
     guint8 trans_delay, traf_handl_prio;
     guint8 guar_ul, guar_dl, guar_ul_ext, guar_dl_ext;
-       guint8 src_stat_desc, sig_ind;
+    guint8 src_stat_desc, sig_ind;
     proto_tree *ext_tree_qos;
     proto_item *te;
     int mss, mu, md, gu, gd;
@@ -3840,222 +3856,222 @@ static int decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const
     proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare3, tvb, offset + (3 - 1) * utf8_type + 1, utf8_type, spare3);
     proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_mean, tvb, offset + (3 - 1) * utf8_type + 1, utf8_type, mean);
 
-       /* TS 24.008 V 7.8.0
-        * The quality of service is a type 4 information element with a minimum length of 14 octets and a maximum length of 18
-        * octets. The QoS requested by the MS shall be encoded both in the QoS attributes specified in octets 3-5 and in the QoS
-        * attributes specified in octets 6-14.
-        * In the MS to network direction and in the network to MS direction the following applies:
-        * - Octets 15-18 are optional. If octet 15 is included, then octet 16 shall also be included, and octets 17 and 18 may
-        * be included.
-        * - If octet 17 is included, then octet 18 shall also be included.
-        * - A QoS IE received without octets 6-18, without octets 14-18, without octets 15-18, or without octets 17-18 shall
-        * be accepted by the receiving entity.
-        */
+    /* TS 24.008 V 7.8.0
+     * The quality of service is a type 4 information element with a minimum length of 14 octets and a maximum length of 18
+     * octets. The QoS requested by the MS shall be encoded both in the QoS attributes specified in octets 3-5 and in the QoS
+     * attributes specified in octets 6-14.
+     * In the MS to network direction and in the network to MS direction the following applies:
+     * - Octets 15-18 are optional. If octet 15 is included, then octet 16 shall also be included, and octets 17 and 18 may
+     * be included.
+     * - If octet 17 is included, then octet 18 shall also be included.
+     * - A QoS IE received without octets 6-18, without octets 14-18, without octets 15-18, or without octets 17-18 shall
+     * be accepted by the receiving entity.
+     */
 
     if (length > 4) {
 
-               /* See above for the need of wrapping
-                
-                */
-               /* Octet 6 */
-               traf_class = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & 0xE0;
-               del_order = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & 0x18;
-               del_err_sdu = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & 0x07;
-               max_sdu_size = wrapped_tvb_get_guint8(tvb, offset + (5 - 1) * utf8_type + 1, utf8_type);
-               max_ul = wrapped_tvb_get_guint8(tvb, offset + (6 - 1) * utf8_type + 1, utf8_type);
-               max_dl = wrapped_tvb_get_guint8(tvb, offset + (7 - 1) * utf8_type + 1, utf8_type);
-               res_ber = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & 0xF0;
-               sdu_err_ratio = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & 0x0F;
-               trans_delay = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & 0xFC;
-               traf_handl_prio = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & 0x03;
-               guar_ul = wrapped_tvb_get_guint8(tvb, offset + (10 - 1) * utf8_type + 1, utf8_type);
-               /* Octet 13 */
-               guar_dl = wrapped_tvb_get_guint8(tvb, offset + (11 - 1) * utf8_type + 1, utf8_type);
-
-               src_stat_desc = 0;
-               sig_ind = 0;
-               max_dl_ext = 0;
-               guar_dl_ext = 0;
-               max_ul_ext = 0;
-               guar_ul_ext =0;
-
-               if (length > 13) {
-                       src_stat_desc = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type)& 0xf;
-                       sig_ind = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type)& 0x01;
-               }
-               if (length > 14) {
-                       max_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (13 - 1) * utf8_type + 1, utf8_type);
-                       guar_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (14 - 1) * utf8_type + 1, utf8_type);
-               }
-               if (length > 17) {
-                       max_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (15 - 1) * utf8_type + 1, utf8_type);
-                       guar_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (16 - 1) * utf8_type + 1, utf8_type);
-               }
+        /* See above for the need of wrapping
+         * 
+         */
+        /* Octet 6 */
+        traf_class = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & 0xE0;
+        del_order = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & 0x18;
+        del_err_sdu = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & 0x07;
+        max_sdu_size = wrapped_tvb_get_guint8(tvb, offset + (5 - 1) * utf8_type + 1, utf8_type);
+        max_ul = wrapped_tvb_get_guint8(tvb, offset + (6 - 1) * utf8_type + 1, utf8_type);
+        max_dl = wrapped_tvb_get_guint8(tvb, offset + (7 - 1) * utf8_type + 1, utf8_type);
+        res_ber = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & 0xF0;
+        sdu_err_ratio = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & 0x0F;
+        trans_delay = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & 0xFC;
+        traf_handl_prio = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & 0x03;
+        guar_ul = wrapped_tvb_get_guint8(tvb, offset + (10 - 1) * utf8_type + 1, utf8_type);
+        /* Octet 13 */
+        guar_dl = wrapped_tvb_get_guint8(tvb, offset + (11 - 1) * utf8_type + 1, utf8_type);
+
+        src_stat_desc = 0;
+        sig_ind = 0;
+        max_dl_ext = 0;
+        guar_dl_ext = 0;
+        max_ul_ext = 0;
+        guar_ul_ext =0;
+
+        if (length > 13) {
+            src_stat_desc = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type)& 0xf;
+            sig_ind = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type)& 0x01;
+        }
+        if (length > 14) {
+            max_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (13 - 1) * utf8_type + 1, utf8_type);
+            guar_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (14 - 1) * utf8_type + 1, utf8_type);
+        }
+        if (length > 17) {
+            max_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (15 - 1) * utf8_type + 1, utf8_type);
+            guar_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (16 - 1) * utf8_type + 1, utf8_type);
+        }
 
-               /* See above comments for the changes
-                * */
-               proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_class, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, traf_class);
-               proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_order, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, del_order);
-               proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_err_sdu, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, del_err_sdu);
-               if (max_sdu_size == 0 || max_sdu_size > 150)
-                   proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, max_sdu_size);
-               if (max_sdu_size > 0 && max_sdu_size <= 150) {
-                   mss = max_sdu_size * 10;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, mss,
-                                              "Maximum SDU size : %u octets", mss);
-               }
+        /* See above comments for the changes
+         * */
+        proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_class, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, traf_class);
+        proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_order, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, del_order);
+        proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_err_sdu, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, del_err_sdu);
+        if (max_sdu_size == 0 || max_sdu_size > 150)
+            proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, max_sdu_size);
+        if (max_sdu_size > 0 && max_sdu_size <= 150) {
+            mss = max_sdu_size * 10;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, mss,
+                                       "Maximum SDU size : %u octets", mss);
+        }
 
-               if (max_ul == 0 || max_ul == 255)
-                   proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul);
-               if (max_ul > 0 && max_ul <= 63)
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul,
+        if (max_ul == 0 || max_ul == 255)
+            proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul);
+        if (max_ul > 0 && max_ul <= 63)
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul,
                                       "Maximum bit rate for uplink : %u kbps", max_ul);
-               if (max_ul > 63 && max_ul <= 127) {
-                   mu = 64 + (max_ul - 64) * 8;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
+        if (max_ul > 63 && max_ul <= 127) {
+            mu = 64 + (max_ul - 64) * 8;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
                                       "Maximum bit rate for uplink : %u kbps", mu);
-               }
+        }
 
-               if (max_ul > 127 && max_ul <= 254) {
-                   mu = 576 + (max_ul - 128) * 64;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
+        if (max_ul > 127 && max_ul <= 254) {
+            mu = 576 + (max_ul - 128) * 64;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
                                       "Maximum bit rate for uplink : %u kbps", mu);
-               }
+        }
 
-               if (max_dl == 0 || max_dl == 255)
-                   proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl);
-               if (max_dl > 0 && max_dl <= 63)
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl,
+        if (max_dl == 0 || max_dl == 255)
+            proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl);
+        if (max_dl > 0 && max_dl <= 63)
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl,
                                       "Maximum bit rate for downlink : %u kbps", max_dl);
-               if (max_dl > 63 && max_dl <= 127) {
-                   md = 64 + (max_dl - 64) * 8;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
+        if (max_dl > 63 && max_dl <= 127) {
+            md = 64 + (max_dl - 64) * 8;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
                                       "Maximum bit rate for downlink : %u kbps", md);
-               }
-               if (max_dl > 127 && max_dl <= 254) {
-                   md = 576 + (max_dl - 128) * 64;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
+        }
+        if (max_dl > 127 && max_dl <= 254) {
+            md = 576 + (max_dl - 128) * 64;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
                                       "Maximum bit rate for downlink : %u kbps", md);
-               }
+        }
 
-               proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_res_ber, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, res_ber);
-               proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_sdu_err_ratio, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, sdu_err_ratio);
-               proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_trans_delay, tvb, offset + (9 - 1) * utf8_type + 1, utf8_type, trans_delay);
-               proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_handl_prio, tvb, offset + (9 - 1) * utf8_type + 1, utf8_type, traf_handl_prio);
+        proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_res_ber, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, res_ber);
+        proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_sdu_err_ratio, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, sdu_err_ratio);
+        proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_trans_delay, tvb, offset + (9 - 1) * utf8_type + 1, utf8_type, trans_delay);
+        proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_handl_prio, tvb, offset + (9 - 1) * utf8_type + 1, utf8_type, traf_handl_prio);
 
-               if (guar_ul == 0 || guar_ul == 255)
-                   proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul);
-               if (guar_ul > 0 && guar_ul <= 63)
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul,
+        if (guar_ul == 0 || guar_ul == 255)
+            proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul);
+        if (guar_ul > 0 && guar_ul <= 63)
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul,
                                       "Guaranteed bit rate for uplink : %u kbps", guar_ul);
-               if (guar_ul > 63 && guar_ul <= 127) {
-                   gu = 64 + (guar_ul - 64) * 8;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
+        if (guar_ul > 63 && guar_ul <= 127) {
+            gu = 64 + (guar_ul - 64) * 8;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
                                       "Guaranteed bit rate for uplink : %u kbps", gu);
-               }
-               if (guar_ul > 127 && guar_ul <= 254) {
-                   gu = 576 + (guar_ul - 128) * 64;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
+        }
+        if (guar_ul > 127 && guar_ul <= 254) {
+            gu = 576 + (guar_ul - 128) * 64;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
                                       "Guaranteed bit rate for uplink : %u kbps", gu);
-               }
+        }
 
-               /* Octet 13 */
-               if (guar_dl == 0 || guar_dl == 255)
-                   proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl);
-               if (guar_dl > 0 && guar_dl <= 63)
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl,
+        /* Octet 13 */
+        if (guar_dl == 0 || guar_dl == 255)
+            proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl);
+        if (guar_dl > 0 && guar_dl <= 63)
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl,
                                       "Guaranteed bit rate for downlink : %u kbps", guar_dl);
-               if (guar_dl > 63 && guar_dl <= 127) {
-                   gd = 64 + (guar_dl - 64) * 8;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
+        if (guar_dl > 63 && guar_dl <= 127) {
+            gd = 64 + (guar_dl - 64) * 8;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
                                       "Guaranteed bit rate for downlink : %u kbps", gd);
-               }
-               if (guar_dl > 127 && guar_dl <= 254) {
-                   gd = 576 + (guar_dl - 128) * 64;
-                   proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
+        }
+        if (guar_dl > 127 && guar_dl <= 254) {
+            gd = 576 + (guar_dl - 128) * 64;
+            proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
                                       "Guaranteed bit rate for downlink : %u kbps", gd);
-               }
+        }
                
-               if(length > 13){
-                       proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_src_stat_desc, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, src_stat_desc);
-                       proto_tree_add_boolean(ext_tree_qos, hf_gtp_qos_sig_ind, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, sig_ind);
-               }
-               if(length > 14){
-                       /* Octet 15 */
-                       if (max_dl_ext > 0 && max_dl_ext <= 0x4a) {
-                           md = 8600 + max_dl_ext * 100;
-                           proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
-                                              "Ext Maximum bit rate for downlink : %u kbps", md);
-                       }
-                       if (max_dl_ext > 0x4a && max_dl_ext <= 0xba) {
-                               md = 16 + (max_dl_ext-0x4a);
-                           proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
-                                              "Ext Maximum bit rate for downlink : %u Mbps", md);
-                       }
-                       if (max_dl_ext > 0xba && max_dl_ext <= 0xfa) {
-                               md = 128 + (max_dl_ext-0xba)*2;
-                           proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
-                                              "Ext Maximum bit rate for downlink : %u Mbps", md);
-                       }
-                       /* Octet 16 */
-                       if(guar_dl_ext == 0)
-                               proto_tree_add_text(ext_tree_qos, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, "Use the value indicated by the Guaranteed bit rate for downlink in octet 13");
-                       if (guar_dl_ext > 0 && guar_dl_ext <= 0x4a) {
-                               gd = 8600 + guar_dl_ext * 100;
-                               proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
-                                               "Ext Guaranteed bit rate for downlink : %u kbps", gd);
-                       }
-                       if (guar_dl_ext > 0x4a && max_dl_ext <= 0xba) {
-                               gd = 16 + (guar_dl_ext-0x4a);
-                               proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
-                                               "Ext Guaranteed bit rate for downlink : %u Mbps", gd);
-                       }
-                       if (guar_dl_ext > 0xba && max_dl_ext <= 0xfa) {
-                               gd = 128 + (guar_dl_ext-0xba)*2;
-                               proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
-                                               "Ext Guaranteed bit rate for downlink : %u Mbps", gd);
-                       }
+        if(length > 13){
+            proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_src_stat_desc, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, src_stat_desc);
+            proto_tree_add_boolean(ext_tree_qos, hf_gtp_qos_sig_ind, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, sig_ind);
+        }
+        if(length > 14){
+            /* Octet 15 */
+            if (max_dl_ext > 0 && max_dl_ext <= 0x4a) {
+                md = 8600 + max_dl_ext * 100;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
+                                           "Ext Maximum bit rate for downlink : %u kbps", md);
+            }
+            if (max_dl_ext > 0x4a && max_dl_ext <= 0xba) {
+                md = 16 + (max_dl_ext-0x4a);
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
+                                           "Ext Maximum bit rate for downlink : %u Mbps", md);
+            }
+            if (max_dl_ext > 0xba && max_dl_ext <= 0xfa) {
+                md = 128 + (max_dl_ext-0xba)*2;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
+                                           "Ext Maximum bit rate for downlink : %u Mbps", md);
+            }
+            /* Octet 16 */
+            if(guar_dl_ext == 0)
+                proto_tree_add_text(ext_tree_qos, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, "Use the value indicated by the Guaranteed bit rate for downlink in octet 13");
+            if (guar_dl_ext > 0 && guar_dl_ext <= 0x4a) {
+                gd = 8600 + guar_dl_ext * 100;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
+                                           "Ext Guaranteed bit rate for downlink : %u kbps", gd);
+            }
+            if (guar_dl_ext > 0x4a && max_dl_ext <= 0xba) {
+                gd = 16 + (guar_dl_ext-0x4a);
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
+                                           "Ext Guaranteed bit rate for downlink : %u Mbps", gd);
+            }
+            if (guar_dl_ext > 0xba && max_dl_ext <= 0xfa) {
+                gd = 128 + (guar_dl_ext-0xba)*2;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
+                                           "Ext Guaranteed bit rate for downlink : %u Mbps", gd);
+            }
 
-               }
-               if(length > 16){
-                       /* Octet 17
-                        * This field is an extension of the Maximum bit rate for uplink in octet 8. The coding is identical to that of the Maximum bit
-                        * rate for downlink (extended).
-                        */
-                       if (max_ul_ext > 0 && max_ul_ext <= 0x4a) {
-                           md = 8600 + max_ul_ext * 100;
-                           proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
-                                              "Ext Maximum bit rate for uplink : %u kbps", md);
-                       }
-                       if (max_ul_ext > 0x4a && max_ul_ext <= 0xba) {
-                               md = 16 + (max_ul_ext-0x4a);
-                           proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
-                                              "Ext Maximum bit rate for uplink : %u Mbps", md);
-                       }
-                       if (max_ul_ext > 0xba && max_ul_ext <= 0xfa) {
-                               md = 128 + (max_ul_ext-0xba)*2;
-                           proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
-                                              "Ext Maximum bit rate for uplink : %u Mbps", md);
-                       }
-                       /* Octet 18 */
-                       if(guar_ul_ext == 0)
-                               proto_tree_add_text(ext_tree_qos, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, "Use the value indicated by the Guaranteed bit rate for uplink in octet 13");
-                       if (guar_ul_ext > 0 && guar_ul_ext <= 0x4a) {
-                               gd = 8600 + guar_ul_ext * 100;
-                               proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
-                                               "Ext Guaranteed bit rate for uplink : %u kbps", gd);
-                       }
-                       if (guar_ul_ext > 0x4a && max_ul_ext <= 0xba) {
-                               gd = 16 + (guar_ul_ext-0x4a);
-                               proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
-                                               "Ext Guaranteed bit rate for uplink : %u Mbps", gd);
-                       }
-                       if (guar_ul_ext > 0xba && max_ul_ext <= 0xfa) {
-                               gd = 128 + (guar_ul_ext-0xba)*2;
-                               proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
-                                               "Ext Guaranteed bit rate for uplink : %u Mbps", gd);
-                       }
-               }
+        }
+        if(length > 16){
+            /* Octet 17
+             * This field is an extension of the Maximum bit rate for uplink in octet 8. The coding is identical to that of the Maximum bit
+             * rate for downlink (extended).
+             */
+            if (max_ul_ext > 0 && max_ul_ext <= 0x4a) {
+                md = 8600 + max_ul_ext * 100;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
+                                           "Ext Maximum bit rate for uplink : %u kbps", md);
+            }
+            if (max_ul_ext > 0x4a && max_ul_ext <= 0xba) {
+                md = 16 + (max_ul_ext-0x4a);
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
+                                           "Ext Maximum bit rate for uplink : %u Mbps", md);
+            }
+            if (max_ul_ext > 0xba && max_ul_ext <= 0xfa) {
+                md = 128 + (max_ul_ext-0xba)*2;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
+                                           "Ext Maximum bit rate for uplink : %u Mbps", md);
+            }
+            /* Octet 18 */
+            if(guar_ul_ext == 0)
+                proto_tree_add_text(ext_tree_qos, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, "Use the value indicated by the Guaranteed bit rate for uplink in octet 13");
+            if (guar_ul_ext > 0 && guar_ul_ext <= 0x4a) {
+                gd = 8600 + guar_ul_ext * 100;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
+                                           "Ext Guaranteed bit rate for uplink : %u kbps", gd);
+            }
+            if (guar_ul_ext > 0x4a && max_ul_ext <= 0xba) {
+                gd = 16 + (guar_ul_ext-0x4a);
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
+                                           "Ext Guaranteed bit rate for uplink : %u Mbps", gd);
+            }
+            if (guar_ul_ext > 0xba && max_ul_ext <= 0xfa) {
+                gd = 128 + (guar_ul_ext-0xba)*2;
+                proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
+                                           "Ext Guaranteed bit rate for uplink : %u Mbps", gd);
+            }
+        }
 
     }
 
@@ -4974,6 +4990,14 @@ static int decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo _U
     offset = offset + 2;
 
     /* Restriction Type value */
+    if (length != 1) {
+       proto_item *expert_item;
+       expert_item = proto_tree_add_text(tree, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length);
+       expert_add_info_format(pinfo, expert_item, PI_MALFORMED, PI_ERROR, "Wrong length indicated. Expected 1, got %u", length);
+       PROTO_ITEM_SET_GENERATED(expert_item);
+       return 3 + length;
+    }
+
     proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_apn_res, tvb, offset, length, FALSE);
     return 3 + length;
 }
@@ -4984,14 +5008,6 @@ static int decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo _U
  * Type = 151 (Decimal)
  */
 
-static const gchar *dissect_radius_rat_type(proto_tree * tree, tvbuff_t * tvb)
-{
-    guint8 octet;
-    octet = tvb_get_guint8(tvb, 0);
-    proto_tree_add_item(tree, hf_gtp_ext_rat_type, tvb, 0, 1, FALSE);
-    return val_to_str(octet, gtp_ext_rat_type_vals, "Unknown");
-}
-
 static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
@@ -5008,7 +5024,15 @@ static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo _
     offset = offset + 2;
 
     /* RAT Type value */
-    proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_rat_type, tvb, offset, length, FALSE);
+    if (length != 1) {
+       proto_item *expert_item;
+       expert_item = proto_tree_add_text(tree, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length);
+       expert_add_info_format(pinfo, expert_item, PI_MALFORMED, PI_ERROR, "Wrong length indicated. Expected 1, got %u", length);
+       PROTO_ITEM_SET_GENERATED(expert_item);
+       return 3 + length;
+    }
+
+   proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_rat_type, tvb, offset, length, FALSE);
 
     return 3 + length;
 }
@@ -5092,6 +5116,10 @@ static const value_string daylight_saving_time_vals[] = {
  * UMTS:       29.060 v6.11.0, chapter 7.7.52 
  * MS Time Zone
  * Type = 153 (Decimal)
+ * The ' MS Time Zone' IE is used to indicate the offset between universal time and local time 
+ * in steps of 15 minutes of where the MS currently resides. The 'Time Zone' field uses the same 
+ * format as the 'Time Zone' IE in 3GPP TS 24.008 (10.5.3.8)
+ * its value shall be set as defined in 3GPP TS 22.042
  */
 static int decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -5164,7 +5192,8 @@ static int decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_
      */
     next_tvb = tvb_new_subset(tvb, offset, length, length);
     digit_str = unpack_digits(next_tvb, 0);
-    proto_tree_add_string(tree, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str);
+    proto_tree_add_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str);
+       proto_item_append_text(te, ": %s", digit_str);
 
     return 3 + length;
 }
@@ -5704,7 +5733,8 @@ static int decode_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, int offset, packet_in
  * UMTS:       29.060 v6.11.0, chapter 7.7.71
  * PS Handover Request Context
  */
-static int decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int 
+decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
     guint16 length;
@@ -5729,7 +5759,8 @@ static int decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pi
  * UMTS:       29.060 v6.11.0, chapter 7.7.72
  * BSS Container
  */
-static int decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int 
+decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
     guint16 length;
@@ -5757,7 +5788,8 @@ static int decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _
  * UMTS:       29.060 v6.11.0, chapter 7.7.73
  * Cell Identification
  */
-static int decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int 
+decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
     guint16 length;
@@ -5789,7 +5821,8 @@ static int decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U
  * UMTS:       29.060 v6.11.0, chapter 7.7.74
  * PDU Numbers
  */
-static int decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int 
+decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
     guint16 length;
@@ -5814,7 +5847,8 @@ static int decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_
  * UMTS:       29.060 v6.11.0, chapter 7.7.75
  * BSSGP Cause
  */
-static int decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int 
+decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
     guint16 length;
@@ -5838,11 +5872,11 @@ static int decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinf
 
 }
 
-#if 0
 /*
  * Required MBMS bearer capabilities   7.7.76
  */
-static int decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int 
+decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
     guint16 length;
     proto_tree *ext_tree;
@@ -5860,15 +5894,57 @@ static int decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info *
      * excluding the AVP Header fields (as defined in IETF RFC 3588 [36], section 4.1).
      */
     /* TODO Add decoding (call Diameter dissector???) */
+       return 3 + length;
 }
-#endif                         /* 0 */
 
 /*
  * RIM Routing Address Discriminator   7.7.77
  */
+static int 
+decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+{
+
+    guint16 length;
+    proto_tree *ext_tree;
+    proto_item *te;
+
+    length = tvb_get_ntohs(tvb, offset + 1);
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_RIM_ROUTING_ADDR_DISC, gtp_val, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
+
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    offset = offset + 2;
+    /* TODO add decoding of data */
+    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+
+    return 3 + length;
+
+}
 /*
  * List of set-up PFCs 7.7.78
  */
+static int 
+decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+{
+
+    guint16 length;
+    proto_tree *ext_tree;
+    proto_item *te;
+
+    length = tvb_get_ntohs(tvb, offset + 1);
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_LIST_OF_SETUP_PFCS, gtp_val, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
+
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    offset = offset + 2;
+    /* TODO add decoding of data */
+    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+
+    return 3 + length;
+
+}
 /*
  * PS Handover XID Parameters  7.7.79
  */
@@ -5899,7 +5975,7 @@ static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info *
     offset++;
 
     if (sndcpxid_handle) {
-       next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+       next_tvb = tvb_new_subset_remaining(tvb, offset);
        call_dissector(sndcpxid_handle, next_tvb, pinfo, tree);
     } else
        proto_tree_add_text(tree, tvb, offset, 0, "Data");
@@ -5911,16 +5987,99 @@ static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info *
 /*
  * MS Info Change Reporting Action     7.7.80
  */
+static int decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+{
+
+    guint16 length;
+    proto_tree *ext_tree;
+    proto_item *te;
+
+    length = tvb_get_ntohs(tvb, offset + 1);
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_MS_INF_CHG_REP_ACT, gtp_val, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
+
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    offset = offset + 2;
+    /* TODO add decoding of data */
+    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+
+    return 3 + length;
+
+}
 /*
  * Direct Tunnel Flags 7.7.81
  */
+static int decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+{
+
+    guint16 length;
+    proto_tree *ext_tree;
+    proto_item *te;
+
+    length = tvb_get_ntohs(tvb, offset + 1);
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_DIRECT_TUNNEL_FLGS, gtp_val, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
+
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    offset = offset + 2;
+    /* TODO add decoding of data */
+    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+    proto_tree_add_item(ext_tree, hf_gtp_ext_ei, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_gcsi, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_dti, tvb, offset, 1, FALSE);
+    offset++;
+
+    return 3 + length;
+
+}
 /*
  * Correlation-ID      7.7.82
  */
+static int decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+{
+
+    guint16 length;
+    proto_tree *ext_tree;
+    proto_item *te;
+
+    length = tvb_get_ntohs(tvb, offset + 1);
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_CORRELATION_ID, gtp_val, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
+
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    offset = offset + 2;
+    /* TODO add decoding of data */
+    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+
+    return 3 + length;
+
+}
 /*
  * Bearer Control Mode 7.7.83
  */
+static int decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+{
+
+    guint16 length;
+    proto_tree *ext_tree;
+    proto_item *te;
+
+    length = tvb_get_ntohs(tvb, offset + 1);
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str(GTP_EXT_BEARER_CONTROL_MODE, gtp_val, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
 
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    offset = offset + 2;
+    /* TODO add decoding of data */
+    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+
+    return 3 + length;
+
+}
 /* GPRS:       12.15
  * UMTS:       33.015
  */
@@ -6000,7 +6159,7 @@ static int decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo _
     proto_tree_add_text(ext_tree, tvb, offset + 5, 2, "Data record format version: %u", format_ver);
 
     if (gtpcdr_handle) {
-       next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+       next_tvb = tvb_new_subset_remaining(tvb, offset);
        call_dissector(gtpcdr_handle, next_tvb, pinfo, tree);
     } else
        proto_tree_add_text(tree, tvb, offset, 0, "Data");
@@ -6126,75 +6285,87 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
     proto_item *ti, *tf;
     int i, offset, length, gtp_prime, checked_field, mandatory;
     int seq_no=0, flow_label=0;
-    guint8 pdu_no, next_hdr = 0, ext_hdr_val;
+    guint8 pdu_no, next_hdr = 0, ext_hdr_val, version;
     const guint8 *tid_val;
     gchar *tid_str;
     guint32 teid = 0;
     tvbuff_t *next_tvb;
     guint8 sub_proto, acfield_len = 0, control_field;
     gtp_msg_hash_t *gcrp=NULL;
-       conversation_t *conversation=NULL;
+    conversation_t *conversation=NULL;
     gtp_conv_info_t *gtp_info=(gtp_conv_info_t *)pinfo->private_data;
+    void* pd_save;
 
-    if (check_col(pinfo->cinfo, COL_PROTOCOL))
-       col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTP");
-    if (check_col(pinfo->cinfo, COL_INFO))
-       col_clear(pinfo->cinfo, COL_INFO);
-
-        /*
-   * Do we have a conversation for this connection?
-   */
-  conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
-                                   pinfo->ptype, pinfo->srcport,
-                                   pinfo->destport, 0);
-  if (conversation == NULL) {
-    /* We don't yet have a conversation, so create one. */
-    conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
-                                    pinfo->ptype, pinfo->srcport,
-                                    pinfo->destport, 0);
+       /* 
+        * If this is GTPv2-C call the gtpv2 dissector if present 
+        * Should this be moved to after the conversation stuff to retain that functionality for GTPv2 ???
+        */
+       version = tvb_get_guint8(tvb,0)>>5;
+       if(version==2){
+               /* GTPv2-C 3GPP TS 29.274 */
+               if(gtpv2_handle){
+                       call_dissector(gtpv2_handle, tvb, pinfo, tree);
+                       return;
+               }
        }
-         /*
-   * Do we already know this conversation?
-   */
-  gtp_info = conversation_get_proto_data(conversation, proto_gtp);
-  if (gtp_info == NULL) {
-    /* No.  Attach that information to the conversation, and add
-     * it to the list of information structures.
-     */
-    gtp_info = g_malloc(sizeof(gtp_conv_info_t));
-       /*Request/response matching tables*/
-       gtp_info->matched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_matched);
-       gtp_info->unmatched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_unmatched);
 
-    conversation_add_proto_data(conversation, proto_gtp, gtp_info);
-       
+    col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTP");
+    col_clear(pinfo->cinfo, COL_INFO);
 
-    gtp_info->next = gtp_info_items;
-    gtp_info_items = gtp_info;
-       }
-       pinfo->private_data = gtp_info;
+    /*
+     * Do we have a conversation for this connection?
+     */
+    conversation = find_conversation(pinfo->fd->num, &pinfo->src, &pinfo->dst,
+                                     pinfo->ptype, pinfo->srcport,
+                                     pinfo->destport, 0);
+    if (conversation == NULL) {
+        /* We don't yet have a conversation, so create one. */
+        conversation = conversation_new(pinfo->fd->num, &pinfo->src, &pinfo->dst,
+                                        pinfo->ptype, pinfo->srcport,
+                                        pinfo->destport, 0);
+    }
+    /*
+     * Do we already know this conversation?
+     */
+    gtp_info = conversation_get_proto_data(conversation, proto_gtp);
+    if (gtp_info == NULL) {
+        /* No.  Attach that information to the conversation, and add
+         * it to the list of information structures.
+         */
+        gtp_info = g_malloc(sizeof(gtp_conv_info_t));
+        /*Request/response matching tables*/
+        gtp_info->matched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_matched);
+        gtp_info->unmatched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_unmatched);
+
+        conversation_add_proto_data(conversation, proto_gtp, gtp_info);
+
+        gtp_info->next = gtp_info_items;
+        gtp_info_items = gtp_info;
+    }
+    pd_save = pinfo->private_data;
+    pinfo->private_data = gtp_info;
        
     tvb_memcpy(tvb, (guint8 *) & gtp_hdr, 0, 4);
 
     if (!(gtp_hdr.flags & 0x10))
-       gtp_prime = 1;
+               gtp_prime = 1;
     else
-       gtp_prime = 0;
+               gtp_prime = 0;
 
     switch ((gtp_hdr.flags >> 5) & 0x07) {
-    case 0:
-       gtp_version = 0;
-       break;
-    case 1:
-       gtp_version = 1;
-       break;
-    default:
-       gtp_version = 1;
-       break;
+           case 0:
+                       gtp_version = 0;
+                       break;
+               case 1:
+                       gtp_version = 1;
+                       break;
+           default:
+                       gtp_version = 1;
+                       break;
     }
 
     if (check_col(pinfo->cinfo, COL_INFO))
-       col_add_str(pinfo->cinfo, COL_INFO, val_to_str(gtp_hdr.message, message_type, "Unknown"));
+               col_add_str(pinfo->cinfo, COL_INFO, val_to_str(gtp_hdr.message, message_type, "Unknown"));
 
     if (tree) {
        ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, FALSE);
@@ -6204,6 +6375,13 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
        flags_tree = proto_item_add_subtree(tf, ett_gtp_flags);
 
        proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
+       
+       if(version>=2){
+               proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version, val_to_str(version, ver_types, "Unknown"));
+               pinfo->private_data = pd_save;
+               return;
+       }
+
        proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, 0, 1, gtp_hdr.flags);
 
        switch (gtp_version) {
@@ -6352,16 +6530,16 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                offset = offset + (*gtpopt[i].decode) (tvb, offset, pinfo, gtp_tree);
            }
 
-               /*Use sequence number to track Req/Resp pairs*/
-               if(seq_no) {
-                       gcrp = gtp_match_response(tvb, pinfo, gtp_tree, seq_no, gtp_hdr.message);
-                       /*pass packet to tap for response time reporting*/
-                       if(gcrp) {
-                       tap_queue_packet(gtp_tap,pinfo,gcrp);
-                       }
-               }
-               }
-       }
+            /*Use sequence number to track Req/Resp pairs*/
+            if(seq_no) {
+                gcrp = gtp_match_response(tvb, pinfo, gtp_tree, seq_no, gtp_hdr.message);
+                /*pass packet to tap for response time reporting*/
+                if(gcrp) {
+                    tap_queue_packet(gtp_tap,pinfo,gcrp);
+                }
+            }
+        }
+    }
     
     if ((gtp_hdr.message == GTP_MSG_TPDU) && g_gtp_tpdu) {
 
@@ -6385,12 +6563,12 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
             * 0x4f is excluded because PPP protocol type "IPv6 header compression"
             * with protocol field compression is more likely than a plain IPv4 packet with 60 octet header size */
 
-           next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+           next_tvb = tvb_new_subset_remaining(tvb, offset);
            call_dissector(ip_handle, next_tvb, pinfo, tree);
 
        } else if ((sub_proto & 0xf0) == 0x60) {
            /* this is most likely an IPv6 packet */
-           next_tvb = tvb_new_subset(tvb, offset, -1, -1);
+           next_tvb = tvb_new_subset_remaining(tvb, offset);
            call_dissector(ipv6_handle, next_tvb, pinfo, tree);
        } else {
            /* this seems to be a PPP packet */
@@ -6403,7 +6581,7 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
                    acfield_len = 2;
            }
 
-           next_tvb = tvb_new_subset(tvb, offset + acfield_len, -1, -1);
+           next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
            call_dissector(ppp_handle, next_tvb, pinfo, tree);
        }
 
@@ -6412,7 +6590,7 @@ static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
            col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
        }
     }
-
+    pinfo->private_data = pd_save;
 }
 
 static const true_false_string yes_no_tfs = {
@@ -6422,23 +6600,23 @@ static const true_false_string yes_no_tfs = {
 
 static void gtp_reinit(void)
 {
-  gtp_conv_info_t *gtp_info;
+    gtp_conv_info_t *gtp_info;
 
-  /* Free up state attached to the gtp_info structures */
-  for (gtp_info = gtp_info_items; gtp_info != NULL; ) {
-    gtp_conv_info_t *next;
+    /* Free up state attached to the gtp_info structures */
+    for (gtp_info = gtp_info_items; gtp_info != NULL; ) {
+        gtp_conv_info_t *next;
 
-    g_hash_table_destroy(gtp_info->matched);
-    gtp_info->matched=NULL;
-    g_hash_table_destroy(gtp_info->unmatched);
-    gtp_info->unmatched=NULL;
+        g_hash_table_destroy(gtp_info->matched);
+        gtp_info->matched=NULL;
+        g_hash_table_destroy(gtp_info->unmatched);
+        gtp_info->unmatched=NULL;
 
-    next = gtp_info->next;
-    g_free(gtp_info);
-    gtp_info = next;
-  }
+        next = gtp_info->next;
+        g_free(gtp_info);
+        gtp_info = next;
+    }
 
-  gtp_info_items = NULL;
+    gtp_info_items = NULL;
 }
 
 void proto_register_gtp(void)
@@ -6446,27 +6624,27 @@ void proto_register_gtp(void)
     static hf_register_info hf_gtp[] = {
 
        {&hf_gtp_response_in,
-        {"Response In", "gtp.response_in", FT_FRAMENUM, BASE_DEC, NULL, 0x0, "The response to this GTP request is in this frame", HFILL}},
+        {"Response In", "gtp.response_in", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "The response to this GTP request is in this frame", HFILL}},
        {&hf_gtp_response_to,
-        {"Response To", "gtp.response_to", FT_FRAMENUM, BASE_DEC, NULL, 0x0, "This is a response to the GTP request in this frame", HFILL}},
+        {"Response To", "gtp.response_to", FT_FRAMENUM, BASE_NONE, NULL, 0x0, "This is a response to the GTP request in this frame", HFILL}},
        {&hf_gtp_time, {"Time", "gtp.time", FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0, "The time between the Request and the Response", HFILL}},
-       {&hf_gtp_apn, {"APN", "gtp.apn", FT_STRING, BASE_DEC, NULL, 0, "Access Point Name", HFILL}},
-       {&hf_gtp_cause, {"Cause ", "gtp.cause", FT_UINT8, BASE_DEC, VALS(cause_type), 0, "Cause of operation", HFILL}},
-       {&hf_gtp_chrg_char, {"Charging characteristics", "gtp.chrg_char", FT_UINT16, BASE_DEC, NULL, 0, "Charging characteristics", HFILL}},
-       {&hf_gtp_chrg_char_s, {"Spare", "gtp.chrg_char_s", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_S, "Spare", HFILL}},
-       {&hf_gtp_chrg_char_n, {"Normal charging", "gtp.chrg_char_n", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_N, "Normal charging", HFILL}},
-       {&hf_gtp_chrg_char_p, {"Prepaid charging", "gtp.chrg_char_p", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_P, "Prepaid charging", HFILL}},
+       {&hf_gtp_apn, {"APN", "gtp.apn", FT_STRING, BASE_NONE, NULL, 0, "Access Point Name", HFILL}},
+       {&hf_gtp_cause, {"Cause", "gtp.cause", FT_UINT8, BASE_DEC, VALS(cause_type), 0, "Cause of operation", HFILL}},
+       {&hf_gtp_chrg_char, {"Charging characteristics", "gtp.chrg_char", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_chrg_char_s, {"Spare", "gtp.chrg_char_s", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_S, NULL, HFILL}},
+       {&hf_gtp_chrg_char_n, {"Normal charging", "gtp.chrg_char_n", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_N, NULL, HFILL}},
+       {&hf_gtp_chrg_char_p, {"Prepaid charging", "gtp.chrg_char_p", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_P, NULL, HFILL}},
        {&hf_gtp_chrg_char_f,
-        {"Flat rate charging", "gtp.chrg_char_f", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_F, "Flat rate charging", HFILL}},
+        {"Flat rate charging", "gtp.chrg_char_f", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_F, NULL, HFILL}},
        {&hf_gtp_chrg_char_h,
-        {"Hot billing charging", "gtp.chrg_char_h", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_H, "Hot billing charging", HFILL}},
-       {&hf_gtp_chrg_char_r, {"Reserved", "gtp.chrg_char_r", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_R, "Reserved", HFILL}},
-       {&hf_gtp_chrg_id, {"Charging ID", "gtp.chrg_id", FT_UINT32, BASE_HEX, NULL, 0, "Charging ID", HFILL}},
-       {&hf_gtp_chrg_ipv4, {"CG address IPv4", "gtp.chrg_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "Charging Gateway address IPv4", HFILL}},
-       {&hf_gtp_chrg_ipv6, {"CG address IPv6", "gtp.chrg_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "Charging Gateway address IPv6", HFILL}},
+        {"Hot billing charging", "gtp.chrg_char_h", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_H, NULL, HFILL}},
+       {&hf_gtp_chrg_char_r, {"Reserved", "gtp.chrg_char_r", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_R, NULL, HFILL}},
+       {&hf_gtp_chrg_id, {"Charging ID", "gtp.chrg_id", FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_chrg_ipv4, {"CG address IPv4", "gtp.chrg_ipv4", FT_IPv4, BASE_NONE, NULL, 0, "Charging Gateway address IPv4", HFILL}},
+       {&hf_gtp_chrg_ipv6, {"CG address IPv6", "gtp.chrg_ipv6", FT_IPv6, BASE_NONE, NULL, 0, "Charging Gateway address IPv6", HFILL}},
        {&hf_gtp_ext_flow_label, {"Flow Label Data I", "gtp.ext_flow_label", FT_UINT16, BASE_HEX, NULL, 0, "Flow label data", HFILL}},
        {&hf_gtp_ext_id, {"Extension identifier", "gtp.ext_id", FT_UINT16, BASE_DEC, VALS(sminmpec_values), 0, "Extension Identifier", HFILL}},
-       {&hf_gtp_ext_val, {"Extension value", "gtp.ext_val", FT_BYTES, BASE_HEX, NULL, 0, "Extension Value", HFILL}},
+       {&hf_gtp_ext_val, {"Extension value", "gtp.ext_val", FT_BYTES, BASE_NONE, NULL, 0, "Extension Value", HFILL}},
        {&hf_gtp_flags, {"Flags", "gtp.flags", FT_UINT8, BASE_HEX, NULL, 0, "Ver/PT/Spare...", HFILL}},
        {&hf_gtp_flags_ver,
         {"Version", "gtp.flags.version",
@@ -6497,31 +6675,31 @@ void proto_register_gtp(void)
        {&hf_gtp_flags_pn,
         {"Is N-PDU number present?", "gtp.flags.pn", FT_BOOLEAN, 8, TFS(&yes_no_tfs), GTP_PN_MASK, "Is N-PDU number present? (1 = yes, 0 = no)",
          HFILL}},
-       {&hf_gtp_flow_ii, {"Flow Label Data II ", "gtp.flow_ii", FT_UINT16, BASE_DEC, NULL, 0, "Downlink flow label data", HFILL}},
-       {&hf_gtp_flow_label, {"Flow label", "gtp.flow_label", FT_UINT16, BASE_HEX, NULL, 0, "Flow label", HFILL}},
+       {&hf_gtp_flow_ii, {"Flow Label Data II", "gtp.flow_ii", FT_UINT16, BASE_DEC, NULL, 0, "Downlink flow label data", HFILL}},
+       {&hf_gtp_flow_label, {"Flow label", "gtp.flow_label", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}},
        {&hf_gtp_flow_sig, {"Flow label Signalling", "gtp.flow_sig", FT_UINT16, BASE_HEX, NULL, 0, "Flow label signalling", HFILL}},
        {&hf_gtp_gsn_addr_len,
-        {"GSN Address Length", "gtp.gsn_addr_len", FT_UINT8, BASE_DEC, NULL, GTP_EXT_GSN_ADDR_LEN_MASK, "GSN Address Length", HFILL}},
+        {"GSN Address Length", "gtp.gsn_addr_len", FT_UINT8, BASE_DEC, NULL, GTP_EXT_GSN_ADDR_LEN_MASK, NULL, HFILL}},
        {&hf_gtp_gsn_addr_type,
-        {"GSN Address Type", "gtp.gsn_addr_type", FT_UINT8, BASE_DEC, VALS(gsn_addr_type), GTP_EXT_GSN_ADDR_TYPE_MASK, "GSN Address Type", HFILL}},
-       {&hf_gtp_gsn_ipv4, {"GSN address IPv4", "gtp.gsn_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "GSN address IPv4", HFILL}},
-       {&hf_gtp_gsn_ipv6, {"GSN address IPv6", "gtp.gsn_ipv6", FT_IPv6, BASE_DEC, NULL, 0, "GSN address IPv6", HFILL}},
-       {&hf_gtp_imsi, {"IMSI", "gtp.imsi", FT_STRING, BASE_DEC, NULL, 0, "International Mobile Subscriber Identity number", HFILL}},
+        {"GSN Address Type", "gtp.gsn_addr_type", FT_UINT8, BASE_DEC, VALS(gsn_addr_type), GTP_EXT_GSN_ADDR_TYPE_MASK, NULL, HFILL}},
+       {&hf_gtp_gsn_ipv4, {"GSN address IPv4", "gtp.gsn_ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_gsn_ipv6, {"GSN address IPv6", "gtp.gsn_ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_imsi, {"IMSI", "gtp.imsi", FT_STRING, BASE_NONE, NULL, 0, "International Mobile Subscriber Identity number", HFILL}},
        {&hf_gtp_length, {"Length", "gtp.length", FT_UINT16, BASE_DEC, NULL, 0, "Length (i.e. number of octets after TID or TEID)", HFILL}},
-       {&hf_gtp_map_cause, {"MAP cause", "gtp.map_cause", FT_UINT8, BASE_DEC, VALS(gsm_old_GSMMAPLocalErrorcode_vals), 0, "MAP cause", HFILL}},
+       {&hf_gtp_map_cause, {"MAP cause", "gtp.map_cause", FT_UINT8, BASE_DEC, VALS(gsm_old_GSMMAPLocalErrorcode_vals), 0, NULL, HFILL}},
        {&hf_gtp_message_type, {"Message Type", "gtp.message", FT_UINT8, BASE_HEX, VALS(message_type), 0x0, "GTP Message Type", HFILL}},
        {&hf_gtp_ms_reason,
         {"MS not reachable reason", "gtp.ms_reason", FT_UINT8, BASE_DEC, VALS(ms_not_reachable_type), 0, "MS Not Reachable Reason", HFILL}},
-       {&hf_gtp_ms_valid, {"MS validated", "gtp.ms_valid", FT_BOOLEAN, BASE_NONE, NULL, 0, "MS validated", HFILL}},
-       {&hf_gtp_msisdn, {"MSISDN", "gtp.msisdn", FT_STRING, BASE_DEC, NULL, 0, "MS international PSTN/ISDN number", HFILL}},
+       {&hf_gtp_ms_valid, {"MS validated", "gtp.ms_valid", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+       {&hf_gtp_msisdn, {"MSISDN", "gtp.msisdn", FT_STRING, BASE_NONE, NULL, 0, "MS international PSTN/ISDN number", HFILL}},
        {&hf_gtp_next,
         {"Next extension header type", "gtp.next", FT_UINT8, BASE_HEX, VALS(next_extension_header_fieldvals), 0, "Next Extension Header Type",
          HFILL}},
-       {&hf_gtp_node_ipv4, {"Node address IPv4", "gtp.node_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "Recommended node address IPv4", HFILL}},
-       {&hf_gtp_node_ipv6, {"Node address IPv6", "gtp.node_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "Recommended node address IPv6", HFILL}},
-       {&hf_gtp_npdu_number, {"N-PDU Number", "gtp.npdu_number", FT_UINT8, BASE_HEX, NULL, 0, "N-PDU Number", HFILL}},
+       {&hf_gtp_node_ipv4, {"Node address IPv4", "gtp.node_ipv4", FT_IPv4, BASE_NONE, NULL, 0, "Recommended node address IPv4", HFILL}},
+       {&hf_gtp_node_ipv6, {"Node address IPv6", "gtp.node_ipv6", FT_IPv6, BASE_NONE, NULL, 0, "Recommended node address IPv6", HFILL}},
+       {&hf_gtp_npdu_number, {"N-PDU Number", "gtp.npdu_number", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}},
        {&hf_gtp_nsapi, {"NSAPI", "gtp.nsapi", FT_UINT8, BASE_DEC, NULL, 0, "Network layer Service Access Point Identifier", HFILL}},
-       {&hf_gtp_qos_version, {"Version", "gtp.qos_version", FT_STRING, BASE_DEC, NULL, 0, "Version of the QoS Profile", HFILL}},
+       {&hf_gtp_qos_version, {"Version", "gtp.qos_version", FT_STRING, BASE_NONE, NULL, 0, "Version of the QoS Profile", HFILL}},
        {&hf_gtp_qos_spare1, {"Spare", "gtp.qos_spare1", FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE1_MASK, "Spare (shall be sent as '00' )", HFILL}},
        {&hf_gtp_qos_delay,
         {"QoS delay", "gtp.qos_delay", FT_UINT8, BASE_DEC, VALS(qos_delay_type), GTP_EXT_QOS_DELAY_MASK, "Quality of Service Delay Class", HFILL}},
@@ -6539,7 +6717,7 @@ void proto_register_gtp(void)
        {&hf_gtp_qos_mean,
         {"QoS mean", "gtp.qos_mean", FT_UINT8, BASE_DEC, VALS(qos_mean_type), GTP_EXT_QOS_MEAN_MASK, "Quality of Service Mean Throughput", HFILL}},
        {&hf_gtp_qos_al_ret_priority,
-        {"Allocation/Retention priority ", "gtp.qos_al_ret_priority", FT_UINT8, BASE_DEC, NULL, 0, "Allocation/Retention Priority", HFILL}},
+        {"Allocation/Retention priority", "gtp.qos_al_ret_priority", FT_UINT8, BASE_DEC, NULL, 0, "Allocation/Retention Priority", HFILL}},
        {&hf_gtp_qos_traf_class,
         {"Traffic class", "gtp.qos_traf_class", FT_UINT8, BASE_DEC, VALS(qos_traf_class), GTP_EXT_QOS_TRAF_CLASS_MASK, "Traffic Class", HFILL}},
        {&hf_gtp_qos_del_order,
@@ -6548,11 +6726,11 @@ void proto_register_gtp(void)
         {"Delivery of erroneous SDU", "gtp.qos_del_err_sdu", FT_UINT8, BASE_DEC, VALS(qos_del_err_sdu), GTP_EXT_QOS_DEL_ERR_SDU_MASK,
          "Delivery of Erroneous SDU", HFILL}},
        {&hf_gtp_qos_max_sdu_size,
-        {"Maximum SDU size", "gtp.qos_max_sdu_size", FT_UINT8, BASE_DEC, VALS(qos_max_sdu_size), 0, "Maximum SDU size", HFILL}},
+        {"Maximum SDU size", "gtp.qos_max_sdu_size", FT_UINT8, BASE_DEC, VALS(qos_max_sdu_size), 0, NULL, HFILL}},
        {&hf_gtp_qos_max_ul,
-        {"Maximum bit rate for uplink", "gtp.qos_max_ul", FT_UINT8, BASE_DEC, VALS(qos_max_ul), 0, "Maximum bit rate for uplink", HFILL}},
+        {"Maximum bit rate for uplink", "gtp.qos_max_ul", FT_UINT8, BASE_DEC, VALS(qos_max_ul), 0, NULL, HFILL}},
        {&hf_gtp_qos_max_dl,
-        {"Maximum bit rate for downlink", "gtp.qos_max_dl", FT_UINT8, BASE_DEC, VALS(qos_max_dl), 0, "Maximum bit rate for downlink", HFILL}},
+        {"Maximum bit rate for downlink", "gtp.qos_max_dl", FT_UINT8, BASE_DEC, VALS(qos_max_dl), 0, NULL, HFILL}},
        {&hf_gtp_qos_res_ber,
         {"Residual BER", "gtp.qos_res_ber", FT_UINT8, BASE_DEC, VALS(qos_res_ber), GTP_EXT_QOS_RES_BER_MASK, "Residual Bit Error Rate", HFILL}},
        {&hf_gtp_qos_sdu_err_ratio,
@@ -6564,17 +6742,17 @@ void proto_register_gtp(void)
         {"Traffic handling priority", "gtp.qos_traf_handl_prio", FT_UINT8, BASE_DEC, VALS(qos_traf_handl_prio), GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK,
          "Traffic Handling Priority", HFILL}},
        {&hf_gtp_qos_guar_ul,
-        {"Guaranteed bit rate for uplink", "gtp.qos_guar_ul", FT_UINT8, BASE_DEC, VALS(qos_guar_ul), 0, "Guaranteed bit rate for uplink", HFILL}},
+        {"Guaranteed bit rate for uplink", "gtp.qos_guar_ul", FT_UINT8, BASE_DEC, VALS(qos_guar_ul), 0, NULL, HFILL}},
        {&hf_gtp_qos_guar_dl,
-        {"Guaranteed bit rate for downlink", "gtp.qos_guar_dl", FT_UINT8, BASE_DEC, VALS(qos_guar_dl), 0, "Guaranteed bit rate for downlink",
+        {"Guaranteed bit rate for downlink", "gtp.qos_guar_dl", FT_UINT8, BASE_DEC, VALS(qos_guar_dl), 0, NULL,
          HFILL}},
        {&hf_gtp_qos_src_stat_desc,
-                {"Source Statistics Descriptor", "gtp.src_stat_desc", FT_UINT8, BASE_DEC, VALS(src_stat_desc_vals), 0xf, "Source Statistics Descriptor", HFILL}},
+                {"Source Statistics Descriptor", "gtp.src_stat_desc", FT_UINT8, BASE_DEC, VALS(src_stat_desc_vals), 0xf, NULL, HFILL}},
        {&hf_gtp_qos_sig_ind,
-                {"Signalling Indication", "gtp.sig_ind", FT_BOOLEAN, 8, TFS(&gtp_sig_ind), 0x10, "Signalling Indication", HFILL}},
-       {&hf_gtp_pkt_flow_id, {"Packet Flow ID", "gtp.pkt_flow_id", FT_UINT8, BASE_DEC, NULL, 0, "Packet Flow ID", HFILL}},
+                {"Signalling Indication", "gtp.sig_ind", FT_BOOLEAN, 8, TFS(&gtp_sig_ind), 0x10, NULL, HFILL}},
+       {&hf_gtp_pkt_flow_id, {"Packet Flow ID", "gtp.pkt_flow_id", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}},
        {&hf_gtp_ptmsi, {"P-TMSI", "gtp.ptmsi", FT_UINT32, BASE_HEX, NULL, 0, "Packet-Temporary Mobile Subscriber Identity", HFILL}},
-       {&hf_gtp_ptmsi_sig, {"P-TMSI Signature", "gtp.ptmsi_sig", FT_UINT24, BASE_HEX, NULL, 0, "P-TMSI Signature", HFILL}},
+       {&hf_gtp_ptmsi_sig, {"P-TMSI Signature", "gtp.ptmsi_sig", FT_UINT24, BASE_HEX, NULL, 0, NULL, HFILL}},
        {&hf_gtp_rab_gtpu_dn, {"Downlink GTP-U seq number", "gtp.rab_gtp_dn", FT_UINT16, BASE_DEC, NULL, 0, "Downlink GTP-U sequence number", HFILL}},
        {&hf_gtp_rab_gtpu_up, {"Uplink GTP-U seq number", "gtp.rab_gtp_up", FT_UINT16, BASE_DEC, NULL, 0, "Uplink GTP-U sequence number", HFILL}},
        {&hf_gtp_rab_pdu_dn,
@@ -6585,11 +6763,11 @@ void proto_register_gtp(void)
        {&hf_gtp_rai_mnc, {"MNC", "gtp.mnc", FT_UINT8, BASE_DEC, NULL, 0, "Mobile Network Code", HFILL}},
        {&hf_gtp_rai_rac, {"RAC", "gtp.rac", FT_UINT8, BASE_DEC, NULL, 0, "Routing Area Code", HFILL}},
        {&hf_gtp_rai_lac, {"LAC", "gtp.lac", FT_UINT16, BASE_DEC, NULL, 0, "Location Area Code", HFILL}},
-       {&hf_gtp_ranap_cause, {"RANAP cause", "gtp.ranap_cause", FT_UINT8, BASE_DEC, VALS(ranap_cause_type), 0, "RANAP cause", HFILL}},
+       {&hf_gtp_ranap_cause, {"RANAP cause", "gtp.ranap_cause", FT_UINT8, BASE_DEC, VALS(ranap_cause_type), 0, NULL, HFILL}},
        {&hf_gtp_recovery, {"Recovery", "gtp.recovery", FT_UINT8, BASE_DEC, NULL, 0, "Restart counter", HFILL}},
-       {&hf_gtp_reorder, {"Reordering required", "gtp.reorder", FT_BOOLEAN, BASE_NONE, NULL, 0, "Reordering required", HFILL}},
-       {&hf_gtp_rnc_ipv4, {"RNC address IPv4", "gtp.rnc_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "Radio Network Controller address IPv4", HFILL}},
-       {&hf_gtp_rnc_ipv6, {"RNC address IPv6", "gtp.rnc_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "Radio Network Controller address IPv6", HFILL}},
+       {&hf_gtp_reorder, {"Reordering required", "gtp.reorder", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},
+       {&hf_gtp_rnc_ipv4, {"RNC address IPv4", "gtp.rnc_ipv4", FT_IPv4, BASE_NONE, NULL, 0, "Radio Network Controller address IPv4", HFILL}},
+       {&hf_gtp_rnc_ipv6, {"RNC address IPv6", "gtp.rnc_ipv6", FT_IPv6, BASE_NONE, NULL, 0, "Radio Network Controller address IPv6", HFILL}},
        {&hf_gtp_rp, {"Radio Priority", "gtp.rp", FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_MASK, "Radio Priority for uplink tx", HFILL}},
        {&hf_gtp_rp_nsapi,
         {"NSAPI in Radio Priority", "gtp.rp_nsapi", FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_NSAPI_MASK,
@@ -6602,8 +6780,8 @@ void proto_register_gtp(void)
          "Selection Mode", HFILL}
         },
        {&hf_gtp_seq_number, {"Sequence number", "gtp.seq_number", FT_UINT16, BASE_HEX, NULL, 0, "Sequence Number", HFILL}},
-       {&hf_gtp_sndcp_number, {"SNDCP N-PDU LLC Number", "gtp.sndcp_number", FT_UINT8, BASE_HEX, NULL, 0, "SNDCP N-PDU LLC Number", HFILL}},
-       {&hf_gtp_tear_ind, {"Teardown Indicator", "gtp.tear_ind", FT_BOOLEAN, BASE_NONE, NULL, 0, "Teardown Indicator", HFILL}},
+       {&hf_gtp_sndcp_number, {"SNDCP N-PDU LLC Number", "gtp.sndcp_number", FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_tear_ind, {"Teardown Indicator", "gtp.tear_ind", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},
        {&hf_gtp_teid, {"TEID", "gtp.teid", FT_UINT32, BASE_HEX, NULL, 0, "Tunnel Endpoint Identifier", HFILL}},
        {&hf_gtp_teid_cp, {"TEID Control Plane", "gtp.teid_cp", FT_UINT32, BASE_HEX, NULL, 0, "Tunnel Endpoint Identifier Control Plane", HFILL}},
        {&hf_gtp_ulink_teid_cp,
@@ -6613,36 +6791,36 @@ void proto_register_gtp(void)
         {"Uplink TEID Data I", "gtp.ulink_teid_data", FT_UINT32, BASE_HEX, NULL, 0, "UplinkTunnel Endpoint Identifier Data I", HFILL}},
        {&hf_gtp_teid_ii, {"TEID Data II", "gtp.teid_ii", FT_UINT32, BASE_HEX, NULL, 0, "Tunnel Endpoint Identifier Data II", HFILL}},
        {&hf_gtp_tft_code,
-        {"TFT operation code", "gtp.tft_code", FT_UINT8, BASE_DEC, VALS(tft_code_type), GTPv1_TFT_CODE_MASK, "TFT operation code", HFILL}},
-       {&hf_gtp_tft_spare, {"TFT spare bit", "gtp.tft_spare", FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_SPARE_MASK, "TFT spare bit", HFILL}},
+        {"TFT operation code", "gtp.tft_code", FT_UINT8, BASE_DEC, VALS(tft_code_type), GTPv1_TFT_CODE_MASK, NULL, HFILL}},
+       {&hf_gtp_tft_spare, {"TFT spare bit", "gtp.tft_spare", FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_SPARE_MASK, NULL, HFILL}},
        {&hf_gtp_tft_number,
-        {"Number of packet filters", "gtp.tft_number", FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_NUMBER_MASK, "Number of packet filters", HFILL}},
-       {&hf_gtp_tft_eval, {"Evaluation precedence", "gtp.tft_eval", FT_UINT8, BASE_DEC, NULL, 0, "Evaluation precedence", HFILL}},
-       {&hf_gtp_tid, {"TID", "gtp.tid", FT_STRING, BASE_DEC, NULL, 0, "Tunnel Identifier", HFILL}},
+        {"Number of packet filters", "gtp.tft_number", FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_NUMBER_MASK, NULL, HFILL}},
+       {&hf_gtp_tft_eval, {"Evaluation precedence", "gtp.tft_eval", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_tid, {"TID", "gtp.tid", FT_STRING, BASE_NONE, NULL, 0, "Tunnel Identifier", HFILL}},
        {&hf_gtp_tlli, {"TLLI", "gtp.tlli", FT_UINT32, BASE_HEX, NULL, 0, "Temporary Logical Link Identity", HFILL}},
        {&hf_gtp_tr_comm, {"Packet transfer command", "gtp.tr_comm", FT_UINT8, BASE_DEC, VALS(tr_comm_type), 0, "Packat transfer command", HFILL}},
-       {&hf_gtp_trace_ref, {"Trace reference", "gtp.trace_ref", FT_UINT16, BASE_HEX, NULL, 0, "Trace reference", HFILL}},
-       {&hf_gtp_trace_type, {"Trace type", "gtp.trace_type", FT_UINT16, BASE_HEX, NULL, 0, "Trace type", HFILL}},
+       {&hf_gtp_trace_ref, {"Trace reference", "gtp.trace_ref", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_trace_type, {"Trace type", "gtp.trace_type", FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL}},
        {&hf_gtp_unknown, {"Unknown data (length)", "gtp.unknown", FT_UINT16, BASE_DEC, NULL, 0, "Unknown data", HFILL}},
        {&hf_gtp_user_addr_pdp_org,
-        {"PDP type organization", "gtp.user_addr_pdp_org", FT_UINT8, BASE_DEC, VALS(pdp_org_type), 0, "PDP type organization", HFILL}},
+        {"PDP type organization", "gtp.user_addr_pdp_org", FT_UINT8, BASE_DEC, VALS(pdp_org_type), 0, NULL, HFILL}},
        {&hf_gtp_user_addr_pdp_type, {"PDP type number", "gtp.user_addr_pdp_type", FT_UINT8, BASE_HEX, VALS(pdp_type), 0, "PDP type", HFILL}},
-       {&hf_gtp_user_ipv4, {"End user address IPv4", "gtp.user_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "End user address IPv4", HFILL}},
-       {&hf_gtp_user_ipv6, {"End user address IPv6", "gtp.user_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "End user address IPv6", HFILL}},
+       {&hf_gtp_user_ipv4, {"End user address IPv4", "gtp.user_ipv4", FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL}},
+       {&hf_gtp_user_ipv6, {"End user address IPv6", "gtp.user_ipv6", FT_IPv6, BASE_NONE, NULL, 0, NULL, HFILL}},
        {&hf_gtp_security_mode,
         {"Security Mode", "gtp.security_mode",
          FT_UINT8, BASE_DEC, VALS(mm_sec_modep), 0xc0,
-         "Security Mode", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_no_of_vectors,
         {"No of Vectors", "gtp.no_of_vectors",
          FT_UINT8, BASE_DEC, NULL, 0x38,
-         "No of Vectors", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_cipher_algorithm,
         {"Cipher Algorithm", "gtp.no_of_vectors",
          FT_UINT8, BASE_DEC, VALS(gtp_cipher_algorithm), 0x07,
-         "Cipher Algorithm", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_cksn_ksi,
         {"Ciphering Key Sequence Number (CKSN)/Key Set Identifier (KSI)", "gtp.cksn_ksi",
@@ -6667,36 +6845,36 @@ void proto_register_gtp(void)
        {&hf_gtp_ext_apn_res,
         {"Restriction Type", "gtp.ext_apn_res",
          FT_UINT8, BASE_DEC, NULL, 0x0,
-         "Restriction Type", HFILL}
-        },
-       {&hf_gtp_ext_rat_type,
-        {"RAT Type", "gtp.ext_rat_type",
-         FT_UINT8, BASE_DEC, VALS(gtp_ext_rat_type_vals), 0x0,
-         "RAT Type", HFILL}
+         NULL, HFILL}
         },
+       {&hf_gtp_ext_rat_type,   
+      {"RAT Type", "gtp.ext_rat_type",   
+       FT_UINT8, BASE_DEC, VALS(gtp_ext_rat_type_vals), 0x0,   
+       NULL, HFILL}   
+     }, 
        {&hf_gtp_ext_geo_loc_type,
         {"Geographic Location Type", "gtp.ext_geo_loc_type",
          FT_UINT8, BASE_DEC, NULL, 0x0,
-         "Geographic Location Type", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_ext_sac,
         {"SAC", "gtp.ext_sac",
          FT_UINT16, BASE_HEX, NULL, 0x0,
-         "SAC", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_ext_imeisv,
         {"IMEI(SV)", "gtp.ext_imeisv",
          FT_STRING, BASE_NONE, NULL, 0x0,
-         "IMEI(SV)", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_targetid,
         {"TargetID", "gtp.targetid",
          FT_UINT32, BASE_DEC, VALS(ranap_TargetID_vals), 0,
-         "TargetID", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_bssgp_cause,
         {"BSSGP Cause", "gtp.bssgp_cause",
          FT_UINT8, BASE_DEC, VALS(tab_cause), 0,
-         "BSSGP Cause", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_sapi,
         {"PS Handover XID SAPI", "gtp.ps_handover_xid_sapi",
          FT_UINT8, BASE_DEC, NULL, 0x0F,
@@ -6708,35 +6886,35 @@ void proto_register_gtp(void)
        {&hf_gtp_cmn_flg_ppc,
         {"Prohibit Payload Compression", "gtp.cmn_flg.ppc",
          FT_BOOLEAN, 8, NULL, 0x01,
-         "Prohibit Payload Compression", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_cmn_flg_mbs_srv_type,
         {"MBMS Service Type", "gtp.cmn_flg.mbs_srv_type",
          FT_BOOLEAN, 8, NULL, 0x02,
-         "MBMS Service Type", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_cmn_flg_mbs_ran_pcd_rdy,
         {"RAN Procedures Ready", "gtp.cmn_flg.ran_pcd_rd",
          FT_BOOLEAN, 8, NULL, 0x04,
-         "RAN Procedures Ready", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_cmn_flg_mbs_cnt_inf,
         {"MBMS Counting Information", "gtp.cmn_flg.mbs_cnt_inf",
          FT_BOOLEAN, 8, NULL, 0x08,
-         "MBMS Counting Information", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_cmn_flg_no_qos_neg,
         {"No QoS negotiation", "gtp.cmn_flg.no_qos_neg",
          FT_BOOLEAN, 8, NULL, 0x10,
-         "No QoS negotiation", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_cmn_flg_nrsn,
         {"NRSN bit field", "gtp.cmn_flg.nrsn",
          FT_BOOLEAN, 8, NULL, 0x20,
-         "NRSN bit field", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_cmn_flg_upgrd_qos_sup,
         {"Upgrade QoS Supported", "gtp.cmn_flg.ran_pcd_rd",
          FT_BOOLEAN, 8, NULL, 0x40,
-         "Upgrade QoS Supported", HFILL}},
+         NULL, HFILL}},
        {&hf_gtp_tmgi,
         {"Temporary Mobile Group Identity (TMGI)", "gtp.cmn_flg.ran_pcd_rd",
-         FT_BYTES, BASE_HEX, NULL, 0x0,
-         "Temporary Mobile Group Identity (TMGI)", HFILL}},
+         FT_BYTES, BASE_NONE, NULL, 0x0,
+         NULL, HFILL}},
        {&hf_gtp_no_of_mbms_sa_codes,
         {"Number of MBMS service area codes", "gtp.no_of_mbms_sa_codes",
          FT_UINT8, BASE_DEC, NULL, 0x0,
@@ -6745,27 +6923,42 @@ void proto_register_gtp(void)
        {&hf_gtp_mbms_ses_dur_days,
         {"Estimated session duration days", "gtp.mbms_ses_dur_days",
          FT_UINT8, BASE_DEC, NULL, 0xfe,
-         "Estimated session duration days", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_mbms_ses_dur_s,
         {"Estimated session duration seconds", "gtp.mbms_ses_dur_s",
          FT_UINT24, BASE_DEC, NULL, 0x01ffff,
-         "Estimated session duration seconds", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_mbms_sa_code,
         {"MBMS service area code", "gtp.mbms_sa_code",
          FT_UINT16, BASE_DEC, NULL, 0x0,
-         "MBMS service area code", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_mbs_2g_3g_ind,
         {"MBMS 2G/3G Indicator", "gtp.mbs_2g_3g_ind",
          FT_UINT8, BASE_DEC, VALS(gtp_mbs_2g_3g_ind_vals), 0x0,
-         "MBMS 2G/3G Indicator", HFILL}
+         NULL, HFILL}
         },
        {&hf_gtp_time_2_dta_tr,
         {"Time to MBMS Data Transfer", "gtp.time_2_dta_tr",
          FT_UINT8, BASE_DEC, NULL, 0x0,
-         "Time to MBMS Data Transfer", HFILL}
+         NULL, HFILL}
+        },
+        { &hf_gtp_ext_ei,
+        {"Error Indication (EI)", "gtp.ei",
+         FT_UINT8, BASE_DEC, NULL, 0x04,
+         NULL, HFILL}
+        },
+        {&hf_gtp_ext_gcsi,
+        {"GPRS-CSI (GCSI)", "gtp.gcsi",
+         FT_UINT8, BASE_DEC, NULL, 0x02,
+         NULL, HFILL}
+        },
+        { &hf_gtp_ext_dti,
+        {"Direct Tunnel Indicator (DTI)", "gtp.dti",
+         FT_UINT8, BASE_DEC, NULL, 0x01,
+         NULL, HFILL}
         },
     };
 
@@ -6887,7 +7080,6 @@ void proto_reg_handoff_gtp(void)
 
        radius_register_avp_dissector(VENDOR_THE3GPP, 5, dissect_radius_qos_umts);
        radius_register_avp_dissector(VENDOR_THE3GPP, 12, dissect_radius_selection_mode);
-       radius_register_avp_dissector(VENDOR_THE3GPP, 21, dissect_radius_rat_type);
        radius_register_avp_dissector(VENDOR_THE3GPP, 22, dissect_radius_user_loc);
 
        ip_handle = find_dissector("ip");
@@ -6896,6 +7088,7 @@ void proto_reg_handoff_gtp(void)
        data_handle = find_dissector("data");
        gtpcdr_handle = find_dissector("gtpcdr");
        sndcpxid_handle = find_dissector("sndcpxid");
+       gtpv2_handle = find_dissector("gtpv2");
        bssap_pdu_type_table = find_dissector_table("bssap.pdu_type");
        /* AVP Code: 904 MBMS-Session-Duration */
        dissector_add("diameter.3gpp", 904, new_create_dissector_handle(dissect_gtp_mbms_ses_dur, proto_gtp));
@@ -6930,3 +7123,16 @@ void proto_reg_handoff_gtp(void)
        dissector_add("tcp.port", g_gtpv1u_port, gtp_handle);
     }
 }
+
+/*
+ * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
+ *
+ * Local variables:
+ * c-basic-offset: 4
+ * tab-width: 8
+ * indent-tabs-mode: t
+ * End:
+ *
+ * vi: set shiftwidth=4 tabstop=8 noexpandtab
+ * :indentSize=4:tabSize=8:noTabs=false:
+ */