Add comments about new IEs
[obnox/wireshark/wip.git] / epan / dissectors / packet-gtp.c
index 5a5e8d18a26b80d01ddb9b4a7fc218b03c93e012..ea8ec34805d1c2609fda236ec594239b73148c3c 100644 (file)
@@ -1,4 +1,6 @@
 /* packet-gtp.c
+ *
+ * $Id$
  *
  * Routines for GTP dissection
  * Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com>
@@ -7,13 +9,18 @@
  * Updates and corrections:
  * Copyright 2006 - 2009, Anders Broman <anders.broman@ericsson.com>
  *
- * $Id$
+ * Added Bearer control mode dissection:
+ * Copyright 2011, Grzegorz Szczytowski <grzegorz.szczytowski@gmail.com>
+ *
+ * Updates and corrections:
+ * Copyright 2011, Anders Broman <anders.broman@ericsson.com>
+ *
+ * PDCP PDU number extension header support added by Martin Isaksson <martin.isaksson@ericsson.com>
  *
  * Control Plane Request-Response tracking code Largely based on similar routines in
  * packet-ldap.c by Ronnie Sahlberg
  * Added by Kari Tiirikainen <kari.tiirikainen@nsn.com>
  *
- *
  * Wireshark - Network traffic analyzer
  * By Gerald Combs <gerald@wireshark.org>
  * Copyright 1998 Gerald Combs
  * You should have received a copy of the GNU General Public License
  * along with this program; if not, write to the Free Software
  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
- * Ref: 3GPP TS 29.060 version 6.8.0 Release 6
+ * Ref: 3GPP TS 29.060
+ * http://www.3gpp.org/ftp/Specs/html-info/29060.htm
+ * GTP' 3GPP TS 32.295
  */
 
 #ifdef HAVE_CONFIG_H
 # include "config.h"
 #endif
 
-#include <stdlib.h>
-
-#include <glib.h>
-
 #include <epan/conversation.h>
 #include <epan/packet.h>
 #include <epan/prefs.h>
 #include <epan/sminmpec.h>
 #include <epan/asn1.h>
 #include <epan/tap.h>
-#include "packet-ipv6.h"
 #include "packet-ppp.h"
 #include "packet-radius.h"
 #include "packet-bssap.h"
 #include "packet-gsm_a_common.h"
 #include "packet-gsm_map.h"
+#include "packet-gprscdr.h"
 #include "packet-per.h"
 #include "packet-ranap.h"
 #include "packet-bssgp.h"
+#include "packet-e212.h"
 #include "packet-gtp.h"
 
 static dissector_table_t ppp_subdissector_table;
+static dissector_table_t gtp_priv_ext_dissector_table;
+static dissector_table_t gtp_cdr_fmt_dissector_table;
 
 #define GTPv0_PORT  3386
 #define GTPv1C_PORT 2123    /* 3G Control PDU */
@@ -103,11 +111,16 @@ static int hf_gtp_chrg_ipv6 = -1;
 static int hf_gtp_ext_flow_label = -1;
 static int hf_gtp_ext_id = -1;
 static int hf_gtp_ext_val = -1;
+static int hf_gtp_ext_hdr = -1;
+static int hf_gtp_ext_hdr_next = -1;
+static int hf_gtp_ext_hdr_length = -1;
+static int hf_gtp_ext_hdr_pdcpsn = -1;
 static int hf_gtp_flags = -1;
 static int hf_gtp_flags_ver = -1;
 static int hf_gtp_prime_flags_ver = -1;
 static int hf_gtp_flags_pt = -1;
 static int hf_gtp_flags_spare1 = -1;
+static int hf_gtp_flags_hdr_length = -1;
 static int hf_gtp_flags_snn = -1;
 static int hf_gtp_flags_spare2 = -1;
 static int hf_gtp_flags_e = -1;
@@ -163,8 +176,6 @@ static int hf_gtp_rab_gtpu_dn = -1;
 static int hf_gtp_rab_gtpu_up = -1;
 static int hf_gtp_rab_pdu_dn = -1;
 static int hf_gtp_rab_pdu_up = -1;
-static int hf_gtp_rai_mcc = -1;
-static int hf_gtp_rai_mnc = -1;
 static int hf_gtp_rai_rac = -1;
 static int hf_gtp_rai_lac = -1;
 static int hf_gtp_ranap_cause = -1;
@@ -214,8 +225,16 @@ static int hf_gtp_ext_sac = -1;
 static int hf_gtp_ext_imeisv = -1;
 static int hf_gtp_targetRNC_ID = -1;
 static int hf_gtp_bssgp_cause = -1;
+static int hf_gtp_bssgp_ra_discriminator = -1;
 static int hf_gtp_sapi = -1;
 static int hf_gtp_xid_par_len = -1;
+static int hf_gtp_earp_pvi = -1;
+static int hf_gtp_earp_pl = -1;
+static int hf_gtp_earp_pci = -1;
+static int hf_gtp_cdr_app = -1;
+static int hf_gtp_cdr_rel = -1;
+static int hf_gtp_cdr_ver = -1;
+static int hf_gtp_spare = -1;
 static int hf_gtp_cmn_flg_ppc = -1;
 static int hf_gtp_cmn_flg_mbs_srv_type = -1;
 static int hf_gtp_cmn_flg_mbs_ran_pcd_rdy = -1;
@@ -233,11 +252,15 @@ 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;
+static int hf_gtp_ra_prio_lcs = -1;
+static int hf_gtp_bcm = -1;
+static int hf_gtp_rim_routing_addr = -1;
 
 /* Initialize the subtree pointers */
 static gint ett_gtp = -1;
 static gint ett_gtp_flags = -1;
 static gint ett_gtp_ext = -1;
+static gint ett_gtp_ext_hdr = -1;
 static gint ett_gtp_rai = -1;
 static gint ett_gtp_qos = -1;
 static gint ett_gtp_auth_tri = -1;
@@ -303,6 +326,10 @@ static gint ett_gtp_ext_ra_prio_lcs = -1;
 static gint ett_gtp_ext_ps_handover_xid = -1;
 static gint ett_gtp_target_id = -1;
 static gint ett_gtp_utran_cont = -1;
+static gint ett_gtp_bcm = -1;
+static gint ett_gtp_cdr_ver = -1;
+static gint ett_gtp_cdr_dr = -1;
+static gint ett_gtp_uli_rai = -1;
 
 static gboolean g_gtp_tpdu = TRUE;
 static gboolean g_gtp_etsi_order = FALSE;
@@ -312,6 +339,11 @@ static int gtp_tap = -1;
 /* Definition of flags masks */
 #define GTP_VER_MASK 0xE0
 
+static const true_false_string gtp_hdr_length_vals = {
+    "6-Octet Header",
+    "20-Octet Header"
+};
+
 static const value_string ver_types[] = {
     {0, "GTP release 97/98 version"},
     {1, "GTP release 99 version"},
@@ -338,11 +370,13 @@ static const value_string pt_types[] = {
 #define GTP_SNN_MASK        0x01
 #define GTP_PN_MASK         0x01
 
+#define GTP_EXT_HDR_PDCP_SN 0xC0
+
 static const value_string next_extension_header_fieldvals[] = {
     {   0, "No more extension headers"},
     {   1, "MBMS support indication"},
     {   2, "MS Info Change Reporting support indication"},
-    {0xc0, "PDCP PDU number"},
+    {GTP_EXT_HDR_PDCP_SN, "PDCP PDU number"},
     {0xc1, "Suspend Request"},
     {0xc2, "Suspend Response"},
     {0, NULL}
@@ -389,83 +423,231 @@ static const value_string next_extension_header_fieldvals[] = {
 #define GTPv1_EXT_RP_SPARE_MASK         0x08
 #define GTPv1_EXT_RP_MASK               0x07
 
-static const value_string message_type[] = {
-    {GTP_MSG_UNKNOWN, "For future use"},
-    {GTP_MSG_ECHO_REQ, "Echo request"},
-    {GTP_MSG_ECHO_RESP, "Echo response"},
-    {GTP_MSG_VER_NOT_SUPP, "Version not supported"},
-    {GTP_MSG_NODE_ALIVE_REQ, "Node alive request"},
-    {GTP_MSG_NODE_ALIVE_RESP, "Node alive response"},
-    {GTP_MSG_REDIR_REQ, "Redirection request"},
-    {GTP_MSG_REDIR_RESP, "Redirection response"},
-    {GTP_MSG_CREATE_PDP_REQ, "Create PDP context request"},
-    {GTP_MSG_CREATE_PDP_RESP, "Create PDP context response"},
-    {GTP_MSG_UPDATE_PDP_REQ, "Update PDP context request"},
-    {GTP_MSG_UPDATE_PDP_RESP, "Update PDP context response"},
-    {GTP_MSG_DELETE_PDP_REQ, "Delete PDP context request"},
-    {GTP_MSG_DELETE_PDP_RESP, "Delete PDP context response"},
-    {GTP_MSG_CREATE_AA_PDP_REQ, "Create AA PDP Context Request"},
-    {GTP_MSG_CREATE_AA_PDP_RESP, "Create AA PDP Context Response"},
-    {GTP_MSG_DELETE_AA_PDP_REQ, "Delete AA PDP Context Request"},
-    {GTP_MSG_DELETE_AA_PDP_RESP, "Delete AA PDP Context Response"},
-    {GTP_MSG_ERR_IND, "Error indication"},
-    {GTP_MSG_PDU_NOTIFY_REQ, "PDU notification request"},
-    {GTP_MSG_PDU_NOTIFY_RESP, "PDU notification response"},
-    {GTP_MSG_PDU_NOTIFY_REJ_REQ, "PDU notification reject request"},
+static const value_string gtp_message_type[] = {
+    {GTP_MSG_UNKNOWN,             "For future use"},
+    {GTP_MSG_ECHO_REQ,            "Echo request"},
+    {GTP_MSG_ECHO_RESP,           "Echo response"},
+    {GTP_MSG_VER_NOT_SUPP,        "Version not supported"},
+    {GTP_MSG_NODE_ALIVE_REQ,      "Node alive request"},
+    {GTP_MSG_NODE_ALIVE_RESP,     "Node alive response"},
+    {GTP_MSG_REDIR_REQ,           "Redirection request"},
+    {GTP_MSG_REDIR_RESP,          "Redirection response"},
+    /*
+     * 8-15 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
+#if 0
+    {   8,                        "Unknown message(For future use)"},
+    {   9,                        "Unknown message(For future use)"},
+    {  10,                        "Unknown message(For future use)"},
+    {  11,                        "Unknown message(For future use)"},
+    {  12,                        "Unknown message(For future use)"},
+    {  13,                        "Unknown message(For future use)"},
+    {  14,                        "Unknown message(For future use)"},
+    {  15,                        "Unknown message(For future use)"},
+#endif
+    {GTP_MSG_CREATE_PDP_REQ,      "Create PDP context request"},
+    {GTP_MSG_CREATE_PDP_RESP,     "Create PDP context response"},
+    {GTP_MSG_UPDATE_PDP_REQ,      "Update PDP context request"},
+    {GTP_MSG_UPDATE_PDP_RESP,     "Update PDP context response"},
+    {GTP_MSG_DELETE_PDP_REQ,      "Delete PDP context request"},
+    {GTP_MSG_DELETE_PDP_RESP,     "Delete PDP context response"},
+    {GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ,   "Initiate PDP Context Activation Request"},
+    {GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP,  "Initiate PDP Context Activation Response"},
+/*
+ * 24-25 For future use. Shall not be sent. If received,
+ * shall be treated as an Unknown message.
+ */
+    {GTP_MSG_DELETE_AA_PDP_REQ,   "Delete AA PDP Context Request"},
+    {GTP_MSG_DELETE_AA_PDP_RESP,  "Delete AA PDP Context Response"},
+    {GTP_MSG_ERR_IND,             "Error indication"},
+    {GTP_MSG_PDU_NOTIFY_REQ,      "PDU notification request"},
+    {GTP_MSG_PDU_NOTIFY_RESP,     "PDU notification response"},
+    {GTP_MSG_PDU_NOTIFY_REJ_REQ,  "PDU notification reject request"},
     {GTP_MSG_PDU_NOTIFY_REJ_RESP, "PDU notification reject response"},
-    {GTP_MSG_SUPP_EXT_HDR, "Supported extension header notification"},
-    {GTP_MSG_SEND_ROUT_INFO_REQ, "Send routing information for GPRS request"},
+    {GTP_MSG_SUPP_EXT_HDR,        "Supported extension header notification"},
+    {GTP_MSG_SEND_ROUT_INFO_REQ,  "Send routing information for GPRS request"},
     {GTP_MSG_SEND_ROUT_INFO_RESP, "Send routing information for GPRS response"},
-    {GTP_MSG_FAIL_REP_REQ, "Failure report request"},
-    {GTP_MSG_FAIL_REP_RESP, "Failure report response"},
-    {GTP_MSG_MS_PRESENT_REQ, "Note MS GPRS present request"},
-    {GTP_MSG_MS_PRESENT_RESP, "Note MS GPRS present response"},
-    {GTP_MSG_IDENT_REQ, "Identification request"},
-    {GTP_MSG_IDENT_RESP, "Identification response"},
-    {GTP_MSG_SGSN_CNTXT_REQ, "SGSN context request"},
-    {GTP_MSG_SGSN_CNTXT_RESP, "SGSN context response"},
-    {GTP_MSG_SGSN_CNTXT_ACK, "SGSN context acknowledgement"},
-    {GTP_MSG_FORW_RELOC_REQ, "Forward relocation request"},
-    {GTP_MSG_FORW_RELOC_RESP, "Forward relocation response"},
-    {GTP_MSG_FORW_RELOC_COMP, "Forward relocation complete"},
-    {GTP_MSG_RELOC_CANCEL_REQ, "Relocation cancel request"},
-    {GTP_MSG_RELOC_CANCEL_RESP, "Relocation cancel response"},
-    {GTP_MSG_FORW_SRNS_CNTXT, "Forward SRNS context"},
-    {GTP_MSG_FORW_RELOC_ACK, "Forward relocation complete acknowledge"},
+    {GTP_MSG_FAIL_REP_REQ,        "Failure report request"},
+    {GTP_MSG_FAIL_REP_RESP,       "Failure report response"},
+    {GTP_MSG_MS_PRESENT_REQ,      "Note MS GPRS present request"},
+    {GTP_MSG_MS_PRESENT_RESP,     "Note MS GPRS present response"},
+    /* 38-47 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
+#if 0
+    {  38,                        "Unknown message(For future use)"},
+    {  39,                        "Unknown message(For future use)"},
+    {  40,                        "Unknown message(For future use)"},
+    {  41,                        "Unknown message(For future use)"},
+    {  42,                        "Unknown message(For future use)"},
+    {  43,                        "Unknown message(For future use)"},
+    {  44,                        "Unknown message(For future use)"},
+    {  45,                        "Unknown message(For future use)"},
+    {  46,                        "Unknown message(For future use)"},
+    {  47,                        "Unknown message(For future use)"},
+#endif
+    {GTP_MSG_IDENT_REQ,           "Identification request"},
+    {GTP_MSG_IDENT_RESP,          "Identification response"},
+    {GTP_MSG_SGSN_CNTXT_REQ,      "SGSN context request"},
+    {GTP_MSG_SGSN_CNTXT_RESP,     "SGSN context response"},
+    {GTP_MSG_SGSN_CNTXT_ACK,      "SGSN context acknowledgement"},
+    {GTP_MSG_FORW_RELOC_REQ,      "Forward relocation request"},
+    {GTP_MSG_FORW_RELOC_RESP,     "Forward relocation response"},
+    {GTP_MSG_FORW_RELOC_COMP,     "Forward relocation complete"},
+    {GTP_MSG_RELOC_CANCEL_REQ,    "Relocation cancel request"},
+    {GTP_MSG_RELOC_CANCEL_RESP,   "Relocation cancel response"},
+    {GTP_MSG_FORW_SRNS_CNTXT,     "Forward SRNS context"},
+    {GTP_MSG_FORW_RELOC_ACK,      "Forward relocation complete acknowledge"},
     {GTP_MSG_FORW_SRNS_CNTXT_ACK, "Forward SRNS context acknowledge"},
-    {GTP_MSG_RAN_INFO_RELAY, "RAN Information Relay"},
-    {GTP_MBMS_NOTIFY_REQ, "MBMS Notification Request"},
-    {GTP_MBMS_NOTIFY_RES, "MBMS Notification Response"},
-    {GTP_MBMS_NOTIFY_REJ_REQ, "MBMS Notification Reject Request"},
-    {GTP_MBMS_NOTIFY_REJ_RES, "MBMS Notification Reject Response"},
-    {GTP_CREATE_MBMS_CNTXT_REQ, "Create MBMS Context Request"},
-    {GTP_CREATE_MBMS_CNTXT_RES, "Create MBMS Context Response"},
-    {GTP_UPD_MBMS_CNTXT_REQ, "Update MBMS Context Request"},
-    {GTP_UPD_MBMS_CNTXT_RES, "Update MBMS Context Response"},
-    {GTP_DEL_MBMS_CNTXT_REQ, "Delete MBMS Context Request"},
-    {GTP_DEL_MBMS_CNTXT_RES, "Delete MBMS Context Response"},
-    {GTP_MBMS_REG_REQ, "MBMS Registration Request"},
-    {GTP_MBMS_REG_RES, "MBMS Registration Response"},
-    {GTP_MBMS_DE_REG_REQ, "MBMS De-Registration Request"},
-    {GTP_MBMS_DE_REG_RES, "MBMS De-Registration Response"},
-    {GTP_MBMS_SES_START_REQ, "MBMS Session Start Request"},
-    {GTP_MBMS_SES_START_RES, "MBMS Session Start Response"},
-    {GTP_MBMS_SES_STOP_REQ, "MBMS Session Stop Request"},
-    {GTP_MBMS_SES_STOP_RES, "MBMS Session Stop Response"},
-    {GTP_MBMS_SES_UPD_REQ, "MBMS Session Update Request"},
-    {GTP_MBMS_SES_UPD_RES, "MBMS Session Update Response"},
-/* 122-127 For future use. Shall not be sent.
- * If received, shall be treated as an Unknown message.
- */
-    {GTP_MS_INFO_CNG_NOT_REQ, "MS Info Change Notification Request"},
-    {GTP_MS_INFO_CNG_NOT_RES, "MS Info Change Notification Response"},
-    {GTP_MSG_DATA_TRANSF_REQ, "Data record transfer request"},
-    {GTP_MSG_DATA_TRANSF_RESP, "Data record transfer response"},
-    {GTP_MSG_END_MARKER, "End Marker"},
-    {GTP_MSG_TPDU, "T-PDU"},
+    /* 61-69 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
+#if 0
+    {  61,                        "Unknown message(For future use)"},
+    {  62,                        "Unknown message(For future use)"},
+    {  63,                        "Unknown message(For future use)"},
+    {  64,                        "Unknown message(For future use)"},
+    {  65,                        "Unknown message(For future use)"},
+    {  66,                        "Unknown message(For future use)"},
+    {  67,                        "Unknown message(For future use)"},
+    {  68,                        "Unknown message(For future use)"},
+    {  69,                        "Unknown message(For future use)"},
+#endif
+    {GTP_MSG_RAN_INFO_RELAY,      "RAN Information Relay"},
+    /* 71-95 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
+#if 0
+    {  71,                        "Unknown message(For future use)"},
+    {  72,                        "Unknown message(For future use)"},
+    {  73,                        "Unknown message(For future use)"},
+    {  74,                        "Unknown message(For future use)"},
+    {  75,                        "Unknown message(For future use)"},
+    {  76,                        "Unknown message(For future use)"},
+    {  77,                        "Unknown message(For future use)"},
+    {  78,                        "Unknown message(For future use)"},
+    {  79,                        "Unknown message(For future use)"},
+    {  80,                        "Unknown message(For future use)"},
+    {  81,                        "Unknown message(For future use)"},
+    {  82,                        "Unknown message(For future use)"},
+    {  83,                        "Unknown message(For future use)"},
+    {  84,                        "Unknown message(For future use)"},
+    {  85,                        "Unknown message(For future use)"},
+    {  86,                        "Unknown message(For future use)"},
+    {  87,                        "Unknown message(For future use)"},
+    {  88,                        "Unknown message(For future use)"},
+    {  89,                        "Unknown message(For future use)"},
+    {  90,                        "Unknown message(For future use)"},
+    {  91,                        "Unknown message(For future use)"},
+    {  92,                        "Unknown message(For future use)"},
+    {  93,                        "Unknown message(For future use)"},
+    {  94,                        "Unknown message(For future use)"},
+    {  95,                        "Unknown message(For future use)"},
+#endif
+    {GTP_MBMS_NOTIFY_REQ,         "MBMS Notification Request"},
+    {GTP_MBMS_NOTIFY_RES,         "MBMS Notification Response"},
+    {GTP_MBMS_NOTIFY_REJ_REQ,     "MBMS Notification Reject Request"},
+    {GTP_MBMS_NOTIFY_REJ_RES,     "MBMS Notification Reject Response"},
+    {GTP_CREATE_MBMS_CNTXT_REQ,   "Create MBMS Context Request"},
+    {GTP_CREATE_MBMS_CNTXT_RES,   "Create MBMS Context Response"},
+    {GTP_UPD_MBMS_CNTXT_REQ,      "Update MBMS Context Request"},
+    {GTP_UPD_MBMS_CNTXT_RES,      "Update MBMS Context Response"},
+    {GTP_DEL_MBMS_CNTXT_REQ,      "Delete MBMS Context Request"},
+    {GTP_DEL_MBMS_CNTXT_RES,      "Delete MBMS Context Response"},
+    /* 106 - 111 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
+#if 0
+    {  106,                       "Unknown message(For future use)"},
+    {  107,                       "Unknown message(For future use)"},
+    {  108,                       "Unknown message(For future use)"},
+    {  109,                       "Unknown message(For future use)"},
+    {  110,                       "Unknown message(For future use)"},
+    {  111,                       "Unknown message(For future use)"},
+#endif
+    {GTP_MBMS_REG_REQ,            "MBMS Registration Request"},
+    {GTP_MBMS_REG_RES,            "MBMS Registration Response"},
+    {GTP_MBMS_DE_REG_REQ,         "MBMS De-Registration Request"},
+    {GTP_MBMS_DE_REG_RES,         "MBMS De-Registration Response"},
+    {GTP_MBMS_SES_START_REQ,      "MBMS Session Start Request"},
+    {GTP_MBMS_SES_START_RES,      "MBMS Session Start Response"},
+    {GTP_MBMS_SES_STOP_REQ,       "MBMS Session Stop Request"},
+    {GTP_MBMS_SES_STOP_RES,       "MBMS Session Stop Response"},
+    {GTP_MBMS_SES_UPD_REQ,        "MBMS Session Update Request"},
+    {GTP_MBMS_SES_UPD_RES,        "MBMS Session Update Response"},
+    /* 122-127 For future use. Shall not be sent.
+     * If received, shall be treated as an Unknown message.
+     */
+#if 0
+    {  122,                       "Unknown message(For future use)"},
+    {  123,                       "Unknown message(For future use)"},
+    {  124,                       "Unknown message(For future use)"},
+    {  125,                       "Unknown message(For future use)"},
+    {  126,                       "Unknown message(For future use)"},
+    {  127,                       "Unknown message(For future use)"},
+#endif
+       {GTP_MS_INFO_CNG_NOT_REQ,     "MS Info Change Notification Request"},
+    {GTP_MS_INFO_CNG_NOT_RES,     "MS Info Change Notification Response"},
+    /* 130-239 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
+#if 0
+    {  130,                       "Unknown message(For future use)"},
+    {  131,                       "Unknown message(For future use)"},
+    {  132,                       "Unknown message(For future use)"},
+    {  133,                       "Unknown message(For future use)"},
+    {  134,                       "Unknown message(For future use)"},
+    {  135,                       "Unknown message(For future use)"},
+    {  136,                       "Unknown message(For future use)"},
+    {  137,                       "Unknown message(For future use)"},
+    {  138,                       "Unknown message(For future use)"},
+    {  139,                       "Unknown message(For future use)"},
+    {  140,                       "Unknown message(For future use)"},
+    {  141,                       "Unknown message(For future use)"},
+    {  142,                       "Unknown message(For future use)"},
+    {  143,                       "Unknown message(For future use)"},
+    {  144,                       "Unknown message(For future use)"},
+    {  145,                       "Unknown message(For future use)"},
+    {  146,                       "Unknown message(For future use)"},
+    {  147,                       "Unknown message(For future use)"},
+    {  148,                       "Unknown message(For future use)"},
+    {  149,                       "Unknown message(For future use)"},
+    {  150,                       "Unknown message(For future use)"},
+    {  151,                       "Unknown message(For future use)"},
+    {  152,                       "Unknown message(For future use)"},
+    {  153,                       "Unknown message(For future use)"},
+    {  154,                       "Unknown message(For future use)"},
+    {  155,                       "Unknown message(For future use)"},
+    {  156,                       "Unknown message(For future use)"},
+    {  157,                       "Unknown message(For future use)"},
+    {  158,                       "Unknown message(For future use)"},
+    {  159,                       "Unknown message(For future use)"},
+#endif
+    {GTP_MSG_DATA_TRANSF_REQ,     "Data record transfer request"},
+    {GTP_MSG_DATA_TRANSF_RESP,    "Data record transfer response"},
+    /* 242-253 For future use. Shall not be sent. If received,
+     * shall be treated as an Unknown message.
+     */
+#if 0
+    {  242,                       "Unknown message(For future use)"},
+    {  243,                       "Unknown message(For future use)"},
+    {  244,                       "Unknown message(For future use)"},
+    {  245,                       "Unknown message(For future use)"},
+    {  246,                       "Unknown message(For future use)"},
+    {  247,                       "Unknown message(For future use)"},
+    {  248,                       "Unknown message(For future use)"},
+    {  249,                       "Unknown message(For future use)"},
+    {  250,                       "Unknown message(For future use)"},
+    {  251,                       "Unknown message(For future use)"},
+    {  252,                       "Unknown message(For future use)"},
+    {  253,                       "Unknown message(For future use)"},
+#endif
+    {GTP_MSG_END_MARKER,          "End Marker"},
+    {GTP_MSG_TPDU,                "T-PDU"},
     {0, NULL}
 };
-static value_string_ext message_type_ext = VALUE_STRING_EXT_INIT(message_type);
+static value_string_ext gtp_message_type_ext = VALUE_STRING_EXT_INIT(gtp_message_type);
 
 /* definitions of fields in extension header */
 #define GTP_EXT_CAUSE                 0x01
@@ -494,7 +676,7 @@ static value_string_ext message_type_ext = VALUE_STRING_EXT_INIT(message_type);
 #define GTP_EXT_FLOW_II               0x12
 #define GTP_EXT_TEID_II               0x12    /* 0xFF12 3G */
 
-#define GTP_EXT_19                    0x13
+#define GTP_EXT_19                    0x13    /* 19 TV Teardown Ind 7.7.16 */
 #define GTP_EXT_MS_REASON             0x13    /* same as 0x1D GTPv1_EXT_MS_REASON */
 #define GTP_EXT_TEAR_IND              0x13    /* 0xFF13 3G */
 
@@ -507,9 +689,10 @@ static value_string_ext message_type_ext = VALUE_STRING_EXT_INIT(message_type);
 #define GTP_EXT_CHRG_CHAR             0x1A    /* 3G */
 #define GTP_EXT_TRACE_REF             0x1B    /* 3G */
 #define GTP_EXT_TRACE_TYPE            0x1C    /* 3G */
-#define GTPv1_EXT_MS_REASON           0x1D    /* 3G */
+#define GTPv1_EXT_MS_REASON           0x1D    /* 3G 29 TV MS Not Reachable Reason 7.7.25A */
+/* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
 #define GTP_EXT_TR_COMM               0x7E    /* charging */
-#define GTP_EXT_CHRG_ID               0x7F
+#define GTP_EXT_CHRG_ID               0x7F    /* 127 TV Charging ID 7.7.26 */
 #define GTP_EXT_USER_ADDR             0x80
 #define GTP_EXT_MM_CNTXT              0x81
 #define GTP_EXT_PDP_CNTXT             0x82
@@ -536,8 +719,7 @@ static value_string_ext message_type_ext = VALUE_STRING_EXT_INIT(message_type);
 #define GTP_EXT_RAT_TYPE              0x97    /* 3G   151 TLV RAT Type 7.7.50 */
 #define GTP_EXT_USR_LOC_INF           0x98    /* 3G   152 TLV User Location Information 7.7.51 */
 #define GTP_EXT_MS_TIME_ZONE          0x99    /* 3G   153 TLV MS Time Zone 7.7.52 */
-
-#define GTP_EXT_IMEISV                0x9A    /* 3G */
+#define GTP_EXT_IMEISV                0x9A    /* 3G   154 TLV IMEI(SV) 7.7.53 */
 #define GTP_EXT_CAMEL_CHG_INF_CON     0x9B    /* 3G   155 TLV CAMEL Charging Information Container 7.7.54 */
 #define GTP_EXT_MBMS_UE_CTX           0x9C    /* 3G   156 TLV MBMS UE Context 7.7.55 */
 #define GTP_EXT_TMGI                  0x9D    /* 3G   157 TLV Temporary Mobile Group Identity (TMGI) 7.7.56 */
@@ -568,6 +750,35 @@ static value_string_ext message_type_ext = VALUE_STRING_EXT_INIT(message_type);
 #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 */
+                                              /* 3G   185 TLV MBMS Flow Identifier    7.7.84 */
+                                              /* 3G   186 TLV MBMS IP Multicast Distribution    7.7.85 */
+                                              /* 3G   187 TLV MBMS Distribution Acknowledgement 7.7.86 */
+                                              /* 3G   188 TLV Reliable INTER RAT HANDOVER INFO  7.7.87 */
+                                              /* 3G   189 TLV RFSP Index        7.7.88 */
+                                              /* 3G   190 TLV Fully Qualified Domain Name (FQDN)        7.7.90 */
+#define GTP_EXT_EVO_ALLO_RETE_P1      0xBF    /* 3G   191 TLV Evolved Allocation/Retention Priority I   7.7.91 */
+                                              /* 3G   192 TLV Evolved Allocation/Retention Priority II  7.7.92 */
+                                              /* 3G   193 TLV Extended Common Flags     7.7.93 */
+                                              /* 3G   194 TLV User CSG Information (UCI)        7.7.94 */
+                                              /* 3G   195 TLV CSG Information Reporting Action  7.7.95 */
+                                              /* 3G   196 TLV CSG ID    7.7.96 */
+                                              /* 3G   197 TLV CSG Membership Indication (CMI)   7.7.97 */
+                                              /* 3G   198 TLV Aggregate Maximum Bit Rate (AMBR) 7.7.98 */
+                                              /* 3G   199 TLV UE Network Capability     7.7.99 */
+                                              /* 3G   200 TLV UE-AMBR   7.7.100 */
+                                              /* 3G   201 TLV APN-AMBR with NSAPI       7.7.101 */
+                                              /* 3G   202 TLV GGSN Back-Off Time 7.7.102 */
+                                              /* 3G   203 TLV Signalling Priority Indication 7.7.103 */
+                                              /* 3G   204 TLV Signalling Priority Indication with NSAPI 7.7.104 */
+                                              /* 3G   205 TLV Higher bitrates than 16 Mbps flag 7.7.105 */
+                                              /* 3G   206 TLV Max MBR/APN-AMBR 7.7.106 */
+                                              /* 3G   207 TLV Additional MM context for SRVCC 7.7.107 */
+                                              /* 3G   208 TLV Additional flags for SRVCC 7.7.108  */
+                                              /* 3G   209 TLV STN-SR 7.7.109  */
+                                              /* 3G   210 TLV C-MSISDN 7.7.110  */
+                                              /* 3G   211 TLV Extended RANAP Cause 7.7.111  */
+                                              /*  212-238 TLV Spare. For future use.     */
+
 /* 239-250  Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33])*/
 
 #define GTP_EXT_C1                    0xC1
@@ -587,18 +798,20 @@ static const value_string gtp_val[] = {
     {GTP_EXT_RAI, "Routing Area Identity"},
     {GTP_EXT_TLLI, "Temporary Logical Link Identity"},
     {GTP_EXT_PTMSI, "Packet TMSI"},
-    {GTP_EXT_QOS_GPRS, "Quality of Service"},
-    {GTP_EXT_REORDER, "Reorder required"},
-    {GTP_EXT_AUTH_TRI, "Authentication triplets"},
-    {GTP_EXT_MAP_CAUSE, "MAP cause"},
-    {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
-    {GTP_EXT_MS_VALID, "MS validated"},
-    {GTP_EXT_RECOVER, "Recovery"},
-    {GTP_EXT_SEL_MODE, "Selection mode"},
-
-    {GTP_EXT_16, "Flow label data I"},
-    {GTP_EXT_FLOW_LABEL, "Flow label data I"},
-    {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"},    /* 3G */
+/*   6 */  {GTP_EXT_QOS_GPRS, "Quality of Service"},
+    /* 6-7 Spare */
+/*   8 */  {GTP_EXT_REORDER, "Reorder required"},
+/*   9 */  {GTP_EXT_AUTH_TRI, "Authentication triplets"},
+       /* 10 Spare */
+/*  11 */  {GTP_EXT_MAP_CAUSE, "MAP cause"},
+/*  12 */  {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
+/*  13 */  {GTP_EXT_MS_VALID, "MS validated"},
+/*  14 */  {GTP_EXT_RECOVER, "Recovery"},
+/*  15 */  {GTP_EXT_SEL_MODE, "Selection mode"},
+
+/*  16 */  {GTP_EXT_16, "Flow label data I"},
+/*  16 */  {GTP_EXT_FLOW_LABEL, "Flow label data I"},
+/*  16 */  {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"},    /* 3G */
 
     {GTP_EXT_17, "Flow label signalling"},
     {GTP_EXT_FLOW_SIG, "Flow label signalling"},
@@ -621,9 +834,10 @@ static const value_string gtp_val[] = {
     {GTP_EXT_CHRG_CHAR, "Charging characteristics"},    /* 3G */
     {GTP_EXT_TRACE_REF, "Trace references"},    /* 3G */
     {GTP_EXT_TRACE_TYPE, "Trace type"}, /* 3G */
-    {GTPv1_EXT_MS_REASON, "MS not reachable reason"},   /* 3G */
-    {GTP_EXT_TR_COMM, "Packet transfer command"},   /* charging */
-    {GTP_EXT_CHRG_ID, "Charging ID"},
+/*  29 */  {GTPv1_EXT_MS_REASON, "MS not reachable reason"},   /* 3G */
+    /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
+/* 126 */  {GTP_EXT_TR_COMM, "Packet transfer command"},   /* charging */
+/* 127 */  {GTP_EXT_CHRG_ID, "Charging ID"},
     {GTP_EXT_USER_ADDR, "End user address"},
     {GTP_EXT_MM_CNTXT, "MM context"},
     {GTP_EXT_PDP_CNTXT, "PDP context"},
@@ -683,13 +897,43 @@ static const value_string gtp_val[] = {
     {GTP_EXT_DIRECT_TUNNEL_FLGS, "Direct Tunnel Flags"},    /* 7.7.81 */
     {GTP_EXT_CORRELATION_ID, "Correlation-ID"}, /* 7.7.82 */
     {GTP_EXT_BEARER_CONTROL_MODE, "Bearer Control Mode"},   /* 7.7.83 */
-    {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"},  /* charging */
-    {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"},  /* charging */
-    {GTP_EXT_CHRG_ADDR, "Charging Gateway address"},
-    {GTP_EXT_DATA_REQ, "Data record packet"},   /* charging */
-    {GTP_EXT_DATA_RESP, "Requests responded"},  /* charging */
-    {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
-    {GTP_EXT_PRIV_EXT, "Private Extension"},
+    {185, "MBMS Flow Identifier"},   /* 7.7.84 */
+    {186, "MBMS IP Multicast Distribution"},   /* 7.7.85 */
+    {187, "MBMS Distribution Acknowledgement"},   /* 7.7.86 */
+    {188, "Reliable INTER RAT HANDOVER INFO"},   /* 7.7.87 */
+    {189, "RFSP Index"},   /* 7.7.88 */
+    {190, "Fully Qualified Domain Name (FQDN)"},   /* 7.7.90 */
+    {GTP_EXT_EVO_ALLO_RETE_P1, "Evolved Allocation/Retention Priority I"},   /* 7.7.91 */
+    {192, "Evolved Allocation/Retention Priority II"},   /* 7.7.92 */
+    {193, "Extended Common Flags"},   /* 7.7.93 */
+    {194, "User CSG Information (UCI)"},   /* 7.7.94 */
+    {195, "CSG Information Reporting Action"},   /* 7.7.95 */
+    {196, "CSG ID"},   /* 7.7.96 */
+    {197, "CSG Membership Indication (CMI)"},   /* 7.7.97 */
+    {198, "Aggregate Maximum Bit Rate (AMBR)"},   /* 7.7.98 */
+    {199, "UE Network Capability"},   /* 7.7.99 */
+    {200, "UE-AMBR"},   /* 7.7.100 */
+    {201, "APN-AMBR with NSAPI"},   /* 7.7.101 */
+    {202, "GGSN Back-Off Time"},   /* 7.7.102 */
+    {203, "Signalling Priority Indication"},   /* 7.7.103 */
+    {204, "Signalling Priority Indication with NSAPI"},   /* 7.7.104 */
+    {205, "Higher bitrates than 16 Mbps flag"},   /* 7.7.105  */
+    {206, "Max MBR/APN-AMBR"},   /* 7.7.106  */
+    {207, "Additional MM context for SRVCC"},   /* 7.7.107  */
+    {208, "Additional flags for SRVCC"},   /* 7.7.108  */
+    {209, "STN-SR"},   /* 7.7.109  */
+    {210, "C-MSISDN"},   /* 7.7.110  */
+    {211, "Extended RANAP Cause"},   /* 7.7.111  */
+       /* 212-238 TLV Spare. For future use. */
+       /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
+/* 249 */  {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"},  /* charging */
+/* 250 */  {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"},  /* charging */
+/* 251 */  {GTP_EXT_CHRG_ADDR, "Charging Gateway address"}, /* 7.7.44 */
+       /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
+/* 252 */  {GTP_EXT_DATA_REQ, "Data record packet"},   /* charging */
+/* 253 */  {GTP_EXT_DATA_RESP, "Requests responded"},  /* charging */
+/* 254 */  {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
+/* 255 */  {GTP_EXT_PRIV_EXT, "Private Extension"},
     {0, NULL}
 };
 static value_string_ext gtp_val_ext = VALUE_STRING_EXT_INIT(gtp_val);
@@ -698,104 +942,146 @@ static value_string_ext gtp_val_ext = VALUE_STRING_EXT_INIT(gtp_val);
  * 3GPP TS 29.060 version 6.11.0 Release 6
  */
 static const value_string gtpv1_val[] = {
-    {GTP_EXT_CAUSE, "Cause of operation"},
-    {GTP_EXT_IMSI, "IMSI"},
-    {GTP_EXT_RAI, "Routing Area Identity"},
-    {GTP_EXT_TLLI, "Temporary Logical Link Identity"},
-    {GTP_EXT_PTMSI, "Packet TMSI"},
-    {GTP_EXT_QOS_GPRS, "Quality of Service"},
-    {GTP_EXT_REORDER, "Reorder required"},
-    {GTP_EXT_AUTH_TRI, "Authentication triplets"},
-    {GTP_EXT_MAP_CAUSE, "MAP cause"},
-    {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
-    {GTP_EXT_MS_VALID, "MS validated"},
-    {GTP_EXT_RECOVER, "Recovery"},
-    {GTP_EXT_SEL_MODE, "Selection mode"},
-
-    {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"},    /* 3G */
-
-    {GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane"}, /* 3G */
+/*   1 */  {GTP_EXT_CAUSE, "Cause of operation"},
+/*   2 */  {GTP_EXT_IMSI, "IMSI"},
+/*   3 */  {GTP_EXT_RAI, "Routing Area Identity"},
+/*   4 */  {GTP_EXT_TLLI, "Temporary Logical Link Identity"},
+/*   5 */  {GTP_EXT_PTMSI, "Packet TMSI"},
+/*   6 */  {GTP_EXT_QOS_GPRS, "Quality of Service"},
+    /* 6-7 Spare */
+/*   7 */  {7, "Spare"},
+/*   8 */  {GTP_EXT_REORDER, "Reorder required"},
+/*   9 */  {GTP_EXT_AUTH_TRI, "Authentication triplets"},
+       /* 10 Spare */
+/*  10 */  {10, "Spare"},
+/*  11 */  {GTP_EXT_MAP_CAUSE, "MAP cause"},
+/*  12 */  {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
+/*  13 */  {GTP_EXT_MS_VALID, "MS validated"},
+/*  14 */  {GTP_EXT_RECOVER, "Recovery"},
+/*  15 */  {GTP_EXT_SEL_MODE, "Selection mode"},
+/*  16 */  {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"},    /* 3G */
+/*  17 */  {GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane"}, /* 3G */
+/*  18 */  {GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II"},    /* 3G */
+/*  19 */  {GTP_EXT_TEAR_IND, "Teardown ID"},  /* 3G */
+
+/*  20 */  {GTP_EXT_NSAPI, "NSAPI"},   /* 3G */
+/*  21 */  {GTP_EXT_RANAP_CAUSE, "RANAP cause"},   /* 3G */
+/*  22 */  {GTP_EXT_RAB_CNTXT, "RAB context"}, /* 3G */
+/*  23 */  {GTP_EXT_RP_SMS, "Radio Priority for MO SMS"},  /* 3G */
+/*  24 */  {GTP_EXT_RP, "Radio Priority"}, /* 3G */
+/*  25 */  {GTP_EXT_PKT_FLOW_ID, "Packet Flow ID"},    /* 3G */
+/*  26 */  {GTP_EXT_CHRG_CHAR, "Charging characteristics"},    /* 3G */
+/*  27 */  {GTP_EXT_TRACE_REF, "Trace references"},    /* 3G */
+/*  28 */  {GTP_EXT_TRACE_TYPE, "Trace type"}, /* 3G */
+/*  29 */  {GTPv1_EXT_MS_REASON, "MS not reachable reason"},   /* 3G */
+    /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
+/* 126 */  {GTP_EXT_TR_COMM, "Packet transfer command"},   /* charging */
+/* 127 */  {GTP_EXT_CHRG_ID, "Charging ID"},
+
+/* 128 */  {GTP_EXT_USER_ADDR, "End user address"},
+/* 129 */  {GTP_EXT_MM_CNTXT, "MM context"},
+/* 130 */  {GTP_EXT_PDP_CNTXT, "PDP context"},
+/* 131 */  {GTP_EXT_APN, "Access Point Name"},
+/* 132 */  {GTP_EXT_PROTO_CONF, "Protocol configuration options"},
+/* 133 */  {GTP_EXT_GSN_ADDR, "GSN address"},
+/* 134 */  {GTP_EXT_MSISDN, "MS international PSTN/ISDN number"},
+/* 135 */  {GTP_EXT_QOS_UMTS, "Quality of service (UMTS)"},    /* 3G */
+/* 136 */  {GTP_EXT_AUTH_QUI, "Authentication quintuplets"},   /* 3G */
+/* 137 */  {GTP_EXT_TFT, "Traffic Flow Template (TFT)"},   /* 3G */
+/* 138 */  {GTP_EXT_TARGET_ID, "Target (RNC) identification"}, /* 3G */
+/* 139 */  {GTP_EXT_UTRAN_CONT, "UTRAN transparent field"},    /* 3G */
+/* 140 */  {GTP_EXT_RAB_SETUP, "RAB setup information"},   /* 3G */
+/* 141 */  {GTP_EXT_HDR_LIST, "Extension Header Types List"},  /* 3G */
+/* 142 */  {GTP_EXT_TRIGGER_ID, "Trigger Id"}, /* 3G */
+/* 143 */  {GTP_EXT_OMC_ID, "OMC Identity"},   /* 3G */
+/* 144 */  {GTP_EXT_RAN_TR_CONT, "RAN Transparent Container"}, /* 7.7.43 */
+/* 145 */  {GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization"},  /* 7.7.45 */
+/* 146 */  {GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information"},    /* 7.7.45A */
+/* 147 */  {GTP_EXT_SSGN_NO, "SGSN Number"},   /* 7.7.47 */
+/* 148 */  {GTP_EXT_COMMON_FLGS, "Common Flags"},  /* 7.7.48 */
+/* 149 */  {GTP_EXT_APN_RES, "APN Restriction"},   /* 3G */
+/* 150 */  {GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS"},    /* 7.7.25B */
+/* 151 */  {GTP_EXT_RAT_TYPE, "RAT Type"}, /* 3G */
+/* 152 */  {GTP_EXT_USR_LOC_INF, "User Location Information"}, /* 7.7.51 */
+/* 153 */  {GTP_EXT_MS_TIME_ZONE, "MS Time Zone"}, /* 7.7.52 */
+
+/* 154 */  {GTP_EXT_IMEISV, "IMEI(SV)"},   /* 3G */
+/* 155 */  {GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container"},    /* 7.7.54 */
+/* 156 */  {GTP_EXT_MBMS_UE_CTX, "MBMS UE Context"},   /* 7.7.55 */
+/* 157 */  {GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)"},   /* 7.7.56 */
+/* 158 */  {GTP_EXT_RIM_RA, "RIM Routing Address"},    /* 7.7.57 */
+/* 159 */  {GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options"},    /* 7.7.58 */
+/* 160 */  {GTP_EXT_MBMS_SA, "MBMS Service Area"}, /* 7.7.60 */
+/* 161 */  {GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info"},  /* 7.7.61 */
+/* 162 */  {GTP_EXT_ADD_TRS_INF, "Additional Trace Info"}, /* 7.7.62 */
+/* 163 */  {GTP_EXT_HOP_COUNT, "Hop Counter"}, /* 7.7.63 */
+/* 164 */  {GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID"},  /* 7.7.64 */
+/* 165 */  {GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier"},   /* 7.7.65 */
+/* 166 */  {GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator"},   /* 7.7.66 */
+/* 167 */  {GTP_EXT_ENH_NSAPI, "Enhanced NSAPI"},  /* 7.7.67 */
+/* 168 */  {GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration"},    /* 7.7.59 */
+/* 169 */  {GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info"},   /* 7.7.68 */
+/* 170 */  {GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number"},    /* 7.7.69 */
+/* 171 */  {GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer"},   /* 7.7.70 */
+/* 172 */  {GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context"}, /* 7.7.71 */
+/* 173 */  {GTP_EXT_BSS_CONT, "BSS Container"},    /* 7.7.72 */
+/* 174 */  {GTP_EXT_CELL_ID, "Cell Identification"},   /* 7.7.73 */
+/* 175 */  {GTP_EXT_PDU_NO, "PDU Numbers"},    /* 7.7.74 */
+/* 176 */  {GTP_EXT_BSSGP_CAUSE, "BSSGP Cause"},   /* 7.7.75 */
+
+/* 177 */  {GTP_EXT_REQ_MBMS_BEARER_CAP, "Required MBMS bearer capabilities"}, /* 7.7.76 */
+/* 178 */  {GTP_EXT_RIM_ROUTING_ADDR_DISC, "RIM Routing Address Discriminator"},   /* 7.7.77 */
+/* 179 */  {GTP_EXT_LIST_OF_SETUP_PFCS, "List of set-up PFCs"},    /* 7.7.78 */
+/* 180 */  {GTP_EXT_PS_HANDOVER_XIP_PAR, "PS Handover XID Parameters"},    /* 7.7.79 */
+/* 181 */  {GTP_EXT_MS_INF_CHG_REP_ACT, "MS Info Change Reporting Action"},    /* 7.7.80 */
+/* 182 */  {GTP_EXT_DIRECT_TUNNEL_FLGS, "Direct Tunnel Flags"},    /* 7.7.81 */
+/* 183 */  {GTP_EXT_CORRELATION_ID, "Correlation-ID"}, /* 7.7.82 */
+/* 184 */  {GTP_EXT_BEARER_CONTROL_MODE, "Bearer Control Mode"},   /* 7.7.83 */
+    {185, "MBMS Flow Identifier"},   /* 7.7.84 */
+    {186, "MBMS IP Multicast Distribution"},   /* 7.7.85 */
+    {187, "MBMS Distribution Acknowledgement"},   /* 7.7.86 */
+    {188, "Reliable INTER RAT HANDOVER INFO"},   /* 7.7.87 */
+    {189, "RFSP Index"},   /* 7.7.88 */
+    {190, "Fully Qualified Domain Name (FQDN)"},   /* 7.7.90 */
+    {GTP_EXT_EVO_ALLO_RETE_P1, "Evolved Allocation/Retention Priority I"},   /* 7.7.91 */
+    {192, "Evolved Allocation/Retention Priority II"},   /* 7.7.92 */
+    {193, "Extended Common Flags"},   /* 7.7.93 */
+    {194, "User CSG Information (UCI)"},   /* 7.7.94 */
+    {195, "CSG Information Reporting Action"},   /* 7.7.95 */
+    {196, "CSG ID"},   /* 7.7.96 */
+    {197, "CSG Membership Indication (CMI)"},   /* 7.7.97 */
+    {198, "Aggregate Maximum Bit Rate (AMBR)"},   /* 7.7.98 */
+    {199, "UE Network Capability"},   /* 7.7.99 */
+    {200, "UE-AMBR"},   /* 7.7.100 */
+    {201, "APN-AMBR with NSAPI"},   /* 7.7.101 */
+    {202, "GGSN Back-Off Time"},   /* 7.7.102 */
+    {203, "Signalling Priority Indication"},   /* 7.7.103 */
+    {204, "Signalling Priority Indication with NSAPI"},   /* 7.7.104 */
+    {205, "Higher bitrates than 16 Mbps flag"},   /* 7.7.105  */
+    {206, "Max MBR/APN-AMBR"},   /* 7.7.106  */
+    {207, "Additional MM context for SRVCC"},   /* 7.7.107  */
+    {208, "Additional flags for SRVCC"},   /* 7.7.108  */
+    {209, "STN-SR"},   /* 7.7.109  */
+    {210, "C-MSISDN"},   /* 7.7.110  */
+    {211, "Extended RANAP Cause"},   /* 7.7.111  */
+       /* 212-238 TLV Spare. For future use. */
+       /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
+/* 249 */  {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"},  /* charging */
+/* 250 */  {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"},  /* charging */
+/* 251 */  {GTP_EXT_CHRG_ADDR, "Charging Gateway address"}, /* 7.7.44 */
+       /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
+/* 252 */  {GTP_EXT_DATA_REQ, "Data record packet"},   /* charging */
+/* 253 */  {GTP_EXT_DATA_RESP, "Requests responded"},  /* charging */
+/* 254 */  {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
+/* 255 */  {GTP_EXT_PRIV_EXT, "Private Extension"},
 
-    {GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II"},    /* 3G */
-
-    {GTP_EXT_TEAR_IND, "Teardown ID"},  /* 3G */
-
-    {GTP_EXT_NSAPI, "NSAPI"},   /* 3G */
-    {GTP_EXT_RANAP_CAUSE, "RANAP cause"},   /* 3G */
-    {GTP_EXT_RAB_CNTXT, "RAB context"}, /* 3G */
-    {GTP_EXT_RP_SMS, "Radio Priority for MO SMS"},  /* 3G */
-    {GTP_EXT_RP, "Radio Priority"}, /* 3G */
-    {GTP_EXT_PKT_FLOW_ID, "Packet Flow ID"},    /* 3G */
-    {GTP_EXT_CHRG_CHAR, "Charging characteristics"},    /* 3G */
-    {GTP_EXT_TRACE_REF, "Trace references"},    /* 3G */
-    {GTP_EXT_TRACE_TYPE, "Trace type"}, /* 3G */
-    {GTPv1_EXT_MS_REASON, "MS not reachable reason"},   /* 3G */
-    {GTP_EXT_TR_COMM, "Packet transfer command"},   /* charging */
-    {GTP_EXT_CHRG_ID, "Charging ID"},
-    {GTP_EXT_USER_ADDR, "End user address"},
-    {GTP_EXT_MM_CNTXT, "MM context"},
-    {GTP_EXT_PDP_CNTXT, "PDP context"},
-    {GTP_EXT_APN, "Access Point Name"},
-    {GTP_EXT_PROTO_CONF, "Protocol configuration options"},
-    {GTP_EXT_GSN_ADDR, "GSN address"},
-    {GTP_EXT_MSISDN, "MS international PSTN/ISDN number"},
-    {GTP_EXT_QOS_UMTS, "Quality of service (UMTS)"},    /* 3G */
-    {GTP_EXT_AUTH_QUI, "Authentication quintuplets"},   /* 3G */
-    {GTP_EXT_TFT, "Traffic Flow Template (TFT)"},   /* 3G */
-    {GTP_EXT_TARGET_ID, "Target (RNC) identification"}, /* 3G */
-    {GTP_EXT_UTRAN_CONT, "UTRAN transparent field"},    /* 3G */
-    {GTP_EXT_RAB_SETUP, "RAB setup information"},   /* 3G */
-    {GTP_EXT_HDR_LIST, "Extension Header Types List"},  /* 3G */
-    {GTP_EXT_TRIGGER_ID, "Trigger Id"}, /* 3G */
-    {GTP_EXT_OMC_ID, "OMC Identity"},   /* 3G */
-
-    {GTP_EXT_RAN_TR_CONT, "RAN Transparent Container"}, /* 7.7.43 */
-    {GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization"},  /* 7.7.45 */
-    {GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information"},    /* 7.7.45A */
-    {GTP_EXT_SSGN_NO, "SGSN Number"},   /* 7.7.47 */
-    {GTP_EXT_COMMON_FLGS, "Common Flags"},  /* 7.7.48 */
-    {GTP_EXT_APN_RES, "APN Restriction"},   /* 3G */
-    {GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS"},    /* 7.7.25B */
-    {GTP_EXT_RAT_TYPE, "RAT Type"}, /* 3G */
-    {GTP_EXT_USR_LOC_INF, "User Location Information"}, /* 7.7.51 */
-    {GTP_EXT_MS_TIME_ZONE, "MS Time Zone"}, /* 7.7.52 */
-
-    {GTP_EXT_IMEISV, "IMEI(SV)"},   /* 3G */
-    {GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container"},    /* 7.7.54 */
-    {GTP_EXT_MBMS_UE_CTX, "MBMS UE Context"},   /* 7.7.55 */
-    {GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)"},   /* 7.7.56 */
-    {GTP_EXT_RIM_RA, "RIM Routing Address"},    /* 7.7.57 */
-    {GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options"},    /* 7.7.58 */
-    {GTP_EXT_MBMS_SA, "MBMS Service Area"}, /* 7.7.60 */
-    {GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info"},  /* 7.7.61 */
-    {GTP_EXT_ADD_TRS_INF, "Additional Trace Info"}, /* 7.7.62 */
-    {GTP_EXT_HOP_COUNT, "Hop Counter"}, /* 7.7.63 */
-    {GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID"},  /* 7.7.64 */
-    {GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier"},   /* 7.7.65 */
-    {GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator"},   /* 7.7.66 */
-    {GTP_EXT_ENH_NSAPI, "Enhanced NSAPI"},  /* 7.7.67 */
-    {GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration"},    /* 7.7.59 */
-    {GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info"},   /* 7.7.68 */
-    {GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number"},    /* 7.7.69 */
-    {GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer"},   /* 7.7.70 */
-    {GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context"}, /* 7.7.71 */
-    {GTP_EXT_BSS_CONT, "BSS Container"},    /* 7.7.72 */
-    {GTP_EXT_CELL_ID, "Cell Identification"},   /* 7.7.73 */
-    {GTP_EXT_PDU_NO, "PDU Numbers"},    /* 7.7.74 */
-    {GTP_EXT_BSSGP_CAUSE, "BSSGP Cause"},   /* 7.7.75 */
-    {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"},  /* charging */
-    {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"},  /* charging */
-    {GTP_EXT_CHRG_ADDR, "Charging Gateway address"},
-    {GTP_EXT_DATA_REQ, "Data record packet"},   /* charging */
-    {GTP_EXT_DATA_RESP, "Requests responded"},  /* charging */
-    {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
-    {GTP_EXT_PRIV_EXT, "Private Extension"},
     {0, NULL}
 };
 static value_string_ext gtpv1_val_ext = VALUE_STRING_EXT_INIT(gtpv1_val);
 
 /* GPRS:    9.60 v7.6.0, page 37
  * UMTS:    29.060 v4.0, page 45
+ * ETSI TS 129 060 V9.4.0 (2010-10) Ch 7.7.1
  */
 static const value_string cause_type[] = {
     {  0, "Request IMSI"},
@@ -804,12 +1090,27 @@ static const value_string cause_type[] = {
     {  3, "No identity needed"},
     {  4, "MS refuses"},
     {  5, "MS is not GPRS responding"},
+    /* For future use 6-48 */
+    /* Cause values reserved for GPRS charging
+     * protocol use (see GTP' in 3GPP TS 32.295 [33])
+     * 49-63
+     */
     { 59, "System failure"}, /* charging */
     { 60, "The transmit buffers are becoming full"}, /* charging */
     { 61, "The receive buffers are becoming full"},  /* charging */
     { 62, "Another node is about to go down"},       /* charging */
     { 63, "This node is about to go down"},          /* charging */
+    /* For future use 64-127 */
     {128, "Request accepted"},
+    {129, "New PDP type due to network preference"},
+    {130, "New PDP type due to single address bearer only"},
+    /* For future use 131-176 */
+    /* Cause values reserved for GPRS charging
+     * protocol use (see GTP' in 3GPP TS 32.295 [33])
+     * 177-191
+     */
+    {177, "CDR decoding error"},
+
     {192, "Non-existent"},
     {193, "Invalid message format"},
     {194, "IMSI not known"},
@@ -845,6 +1146,13 @@ static const value_string cause_type[] = {
     {224, "MS MBMS Capabilities Insufficient"},
     {225, "Invalid Correlation-ID"},
     {226, "MBMS Bearer Context Superseded"},
+    {227, "Bearer Control Mode violation"},
+    {228, "Collision with network initiated request"},
+    /* For future use 229-240 */
+    /* Cause values reserved for GPRS charging
+     * protocol use (see GTP' in 3GPP TS 32.295 [33])
+     * 241-255
+     */
     {252, "Request related to possibly duplicated packets already fulfilled"},  /* charging */
     {253, "Request already fulfilled"}, /* charging */
     {254, "Sequence numbers of released/cancelled packets IE incorrect"},   /* charging */
@@ -1186,6 +1494,8 @@ static const value_string ms_not_reachable_type[] = {
     {8, "MS purged for GPRS"},
     {9, "Unidentified subscriber via the MSC"},
     {10, "Unidentified subscriber via the SGSN"},
+    {11, "Deregistered in the HSS/HLR for IMS"},
+    {12, "No response via the IP-SM-GW"},
     {0, NULL}
 };
 
@@ -1351,6 +1661,7 @@ 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_handle_t bssgp_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);
@@ -1441,6 +1752,7 @@ static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info *
 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_evolved_allc_rtn_p1(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);
@@ -1544,7 +1856,7 @@ static const gtp_opt_t gtpopt[] = {
     {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_EVO_ALLO_RETE_P1, decode_gtp_evolved_allc_rtn_p1}, /* 7.7.91 */
     {GTP_EXT_REL_PACK, decode_gtp_rel_pack},    /* charging */
     {GTP_EXT_CAN_PACK, decode_gtp_can_pack},    /* charging */
     {GTP_EXT_CHRG_ADDR, decode_gtp_chrg_addr},
@@ -1564,58 +1876,53 @@ struct _gtp_hdr {
 static guint8 gtp_version = 0;
 static const char *yesno[] = { "no", "yes" };
 
-static gchar *id_to_str(const guint8 * ad)
-{
-
-    static gchar str[17] = "                ";
-    guint8 bits8to5, bits4to1;
-    int i, j = 0;
-    static const gchar hex_digits[10] = "0123456789";
-
-    for (i = 0; i < 8; i++) {
-        bits8to5 = (ad[i] >> 4) & 0x0F;
-        bits4to1 = ad[i] & 0x0F;
-        if (bits4to1 < 0xA)
-            str[j++] = hex_digits[bits4to1];
-        if (bits8to5 < 0xA)
-            str[j++] = hex_digits[bits8to5];
-    }
-    str[j] = '\0';
-    return str;
-}
+#define BCD2CHAR(d)         ((d) | 0x30)
 
-static gchar *imsi_to_str(const guint8 * ad)
+static gchar *
+id_to_str(tvbuff_t *tvb, gint offset)
 {
-
     static gchar str[17] = "                ";
-    int i, j = 0;
-
-    for (i = 0; i < 8; i++) {
-        if ((ad[i] & 0x0F) <= 9)
-            str[j++] = (ad[i] & 0x0F) + 0x30;
-        if (((ad[i] >> 4) & 0x0F) <= 9)
-            str[j++] = ((ad[i] >> 4) & 0x0F) + 0x30;
+    guint8 bits8to5, bits4to1;
+    int i, j;
+    guint8 ad;
+
+    for (i = j = 0; i < 8; i++) {
+        ad = tvb_get_guint8(tvb, offset + i);
+        bits8to5 = hi_nibble(ad);
+        bits4to1 = lo_nibble(ad);
+        if (bits4to1 <= 9)
+            str[j++] = BCD2CHAR(bits4to1);
+        else
+            j++;
+        if (bits8to5 <= 9)
+            str[j++] = BCD2CHAR(bits8to5);
+        else
+            j++;
     }
     str[j] = '\0';
-
     return str;
 }
 
-static gchar *msisdn_to_str(const guint8 * ad, int len)
+static gchar *
+msisdn_to_str(tvbuff_t *tvb, gint offset, int len)
 {
-
     static gchar str[18] = "+                ";
     guint8 bits8to5, bits4to1;
-    int i, j = 1;
-    static const gchar hex_digits[10] = "0123456789";
-
-    for (i = 1; i < len && i < 9; i++) {
-        bits8to5 = (ad[i] >> 4) & 0x0F;
-        bits4to1 = ad[i] & 0x0F;
-        if (bits4to1 < 0xA)
-            str[j++] = hex_digits[bits4to1];
-        if (bits8to5 < 0xA)
-            str[j++] = hex_digits[bits8to5];
+    int i, j;
+    guint ad;
+
+    for (i = j = 1; i < MIN(len, 9); i++) {
+        ad = tvb_get_guint8(tvb, offset + i);
+        bits8to5 = hi_nibble(ad);
+        bits4to1 = lo_nibble(ad);
+        if (bits4to1 <= 9)
+            str[j++] = BCD2CHAR(bits4to1);
+        else
+            j++;
+        if (bits8to5 <= 9)
+            str[j++] = BCD2CHAR(bits8to5);
+        else
+            j++;
     }
     str[j] = '\0';
 
@@ -1762,7 +2069,7 @@ static _gtp_mess_items gprs_mess_items[] = {
         }
     },
     {
-        GTP_MSG_CREATE_AA_PDP_REQ, {
+        GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ, {
             {GTP_EXT_QOS_GPRS, GTP_MANDATORY},
             {GTP_EXT_RECOVER, GTP_OPTIONAL},
             {GTP_EXT_SEL_MODE, GTP_MANDATORY},
@@ -1778,7 +2085,7 @@ static _gtp_mess_items gprs_mess_items[] = {
         }
     },
     {
-        GTP_MSG_CREATE_AA_PDP_RESP, {
+        GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP, {
             {GTP_EXT_CAUSE, GTP_MANDATORY},
             {GTP_EXT_QOS_GPRS, GTP_CONDITIONAL},
             {GTP_EXT_REORDER, GTP_CONDITIONAL},
@@ -2397,7 +2704,7 @@ static _gtp_mess_items umts_mess_items[] = {
     {
         GTP_MSG_RAN_INFO_RELAY, {
             {GTP_EXT_RAN_TR_CONT, GTP_MANDATORY},       /* RAN Transparent Container Mandatory 7.7.43 */
-            {GTP_EXT_RIM_RA, GTP_OPTIONAL},     /* RIM Routing Address Optional 7.7.57 */
+            {GTP_EXT_RIM_RA, GTP_OPTIONAL},             /* RIM Routing Address Optional 7.7.57 */
             {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
             {0, 0}
         }
@@ -2635,19 +2942,19 @@ typedef struct gtp_conv_info_t {
     GHashTable *matched;
 } gtp_conv_info_t;
 
-static gtp_conv_info_t *gtp_info_items;
+static gtp_conv_info_t *gtp_info_items = NULL;
 
 static guint gtp_sn_hash(gconstpointer k)
 {
-    const gtp_msg_hash_t *key = k;
+    const gtp_msg_hash_t *key = (const gtp_msg_hash_t *)k;
 
     return key->seq_nr;
 }
 
 static gint gtp_sn_equal_matched(gconstpointer k1, gconstpointer k2)
 {
-    const gtp_msg_hash_t *key1 = k1;
-    const gtp_msg_hash_t *key2 = k2;
+    const gtp_msg_hash_t *key1 = (const gtp_msg_hash_t *)k1;
+    const gtp_msg_hash_t *key2 = (const gtp_msg_hash_t *)k2;
 
     if ( key1->req_frame && key2->req_frame && (key1->req_frame!=key2->req_frame) ) {
         return 0;
@@ -2662,8 +2969,8 @@ static gint gtp_sn_equal_matched(gconstpointer k1, gconstpointer k2)
 
 static gint gtp_sn_equal_unmatched(gconstpointer k1, gconstpointer k2)
 {
-    const gtp_msg_hash_t *key1 = k1;
-    const gtp_msg_hash_t *key2 = k2;
+    const gtp_msg_hash_t *key1 = (const gtp_msg_hash_t *)k1;
+    const gtp_msg_hash_t *key2 = (const gtp_msg_hash_t *)k2;
 
     return key1->seq_nr == key2->seq_nr;
 }
@@ -2696,7 +3003,7 @@ static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, p
         break;
     }
 
-    gcrp = g_hash_table_lookup(gtp_info->matched, &gcr);
+    gcrp = (gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->matched, &gcr);
 
     if (gcrp) {
 
@@ -2712,13 +3019,13 @@ static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, p
         case GTP_MSG_DELETE_PDP_REQ:
             gcr.seq_nr=seq_nr;
 
-            gcrp=g_hash_table_lookup(gtp_info->unmatched, &gcr);
+            gcrp=(gtp_msg_hash_t *)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 = se_new(gtp_msg_hash_t);
             }
             gcrp->seq_nr=seq_nr;
             gcrp->req_frame = pinfo->fd->num;
@@ -2734,7 +3041,7 @@ static gtp_msg_hash_t *gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, p
         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);
+            gcrp=(gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->unmatched, &gcr);
 
             if (gcrp) {
                 if (!gcrp->rep_frame) {
@@ -2816,6 +3123,7 @@ static int check_field_presence(guint8 message, guint8 field, int *position)
 
 /* GPRS:        9.60 v7.6.0, chapter
  * UMTS:        29.060 v4.0, chapter
+ * 7.7.1 Cause
  */
 static int decode_gtp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -2834,43 +3142,29 @@ static int decode_gtp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_,
  */
 static int decode_gtp_imsi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
+    const gchar *imsi_str;
 
-    guint8 imsi_val[8];
-    gchar *imsi_str;
-
-    tvb_memcpy(tvb, imsi_val, offset + 1, 8);
-    imsi_str = imsi_to_str(imsi_val);
+    /* Octets 2 - 9 IMSI */
+    imsi_str =  tvb_bcd_dig_to_ep_str( tvb, offset+1, 8, NULL, FALSE);
 
-    proto_tree_add_string(tree, hf_gtp_imsi, tvb, offset, 9, imsi_str);
+    proto_tree_add_string(tree, hf_gtp_imsi, tvb, offset+1, 8, imsi_str);
 
     return 9;
 }
 
 /* GPRS:        9.60 v7.6.0, chapter 7.9.3
- * UMTS:        29.060 v4.0, chapter 7.7.3
+ * UMTS:        29.060 v4.0, chapter 7.7.3 Routeing Area Identity (RAI)
  */
 static int decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
     proto_tree *ext_tree_rai;
     proto_item *te;
-    guint8 byte[3];
-    guint16 mnc, mcc;
 
     te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_RAI, &gtp_val_ext, "Unknown message"));
     ext_tree_rai = proto_item_add_subtree(te, ett_gtp_rai);
 
-    byte[0] = tvb_get_guint8(tvb, offset + 1);
-    byte[1] = tvb_get_guint8(tvb, offset + 2);
-    byte[2] = tvb_get_guint8(tvb, offset + 3);
-    mcc = (byte[0] & 0x0F) * 100 + ((byte[0] & 0xF0) >> 4) * 10 + (byte[1] & 0x0F);
-    if ((byte[1] & 0xF0) == 0xF0)
-        mnc = (byte[2] & 0x0F) * 10 + ((byte[2] & 0xF0) >> 4);
-    else
-        mnc = (byte[2] & 0x0F) * 100 + ((byte[2] & 0xF0) >> 4) * 10 + ((byte[1] & 0xF0) >> 4);
-
-    proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_mcc, tvb, offset + 1, 2, mcc);
-    proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_mnc, tvb, offset + 2, 2, mnc);
+       dissect_e212_mcc_mnc(tvb, pinfo, ext_tree_rai, offset+1, TRUE);
     proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_lac, tvb, offset + 4, 2, tvb_get_ntohs(tvb, offset + 4));
     proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_rac, tvb, offset + 6, 1, tvb_get_guint8(tvb, offset + 6));
 
@@ -2878,7 +3172,7 @@ static int decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p
 }
 
 /* GPRS:        9.60 v7.6.0, chapter 7.9.4, page 39
- * UMTS:        29.060 v4.0, chapter 7.7.4, page 47
+ * UMTS:        29.060 v4.0, chapter 7.7.4 Temporary Logical Link Identity (TLLI)
  */
 static int decode_gtp_tlli(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -2892,7 +3186,7 @@ static int decode_gtp_tlli(tvbuff_t * tvb, int offset, packet_info * pinfo _U_,
 }
 
 /* GPRS:        9.60 v7.6.0, chapter 7.9.5, page 39
- * UMTS:        29.060 v4.0, chapter 7.7.5, page 47
+ * UMTS:        29.060 v4.0, chapter 7.7.5 Packet TMSI (P-TMSI)
  */
 static int decode_gtp_ptmsi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -2905,7 +3199,8 @@ static int decode_gtp_ptmsi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_,
     return 5;
 }
 
-/* adjust - how many bytes before offset should be highlighted
+/*
+ * adjust - how many bytes before offset should be highlighted
  */
 static int decode_qos_gprs(tvbuff_t * tvb, int offset, proto_tree * tree, const gchar * qos_str, guint8 adjust)
 {
@@ -2955,7 +3250,7 @@ static int decode_gtp_qos_gprs(tvbuff_t * tvb, int offset, packet_info * pinfo _
 }
 
 /* GPRS:        9.60 v7.6.0, chapter 7.9.7, page 39
- * UMTS:        29.060 v4.0, chapter 7.7.6, page 47
+ * UMTS:        29.060 v4.0, chapter 7.7.6 Reordering Required
  */
 static int decode_gtp_reorder(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -2980,7 +3275,7 @@ static int decode_gtp_auth_tri(tvbuff_t * tvb, int offset, packet_info * pinfo _
     proto_item *te;
 
     te = proto_tree_add_text(tree, tvb, offset, 29, "%s", val_to_str_ext_const(GTP_EXT_AUTH_TRI, &gtp_val_ext, "Unknown message"));
-    ext_tree_auth_tri = proto_item_add_subtree(tree, ett_gtp_auth_tri);
+    ext_tree_auth_tri = proto_item_add_subtree(te, ett_gtp_auth_tri);
 
     proto_tree_add_text(ext_tree_auth_tri, tvb, offset + 1, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset + 1, 16));
     proto_tree_add_text(ext_tree_auth_tri, tvb, offset + 17, 4, "SRES: %s", tvb_bytes_to_str(tvb, offset + 17, 4));
@@ -3034,7 +3329,7 @@ static int decode_gtp_ms_valid(tvbuff_t * tvb, int offset, packet_info * pinfo _
 }
 
 /* GPRS:        9.60 v7.6.0, chapter 7.9.12, page 41
- * UMTS:        29.060 v4.0, chapter 7.7.11, page 49
+ * UMTS:        29.060 v4.0, chapter 7.7.11 Recovery
  */
 static int decode_gtp_recovery(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -3048,11 +3343,11 @@ static int decode_gtp_recovery(tvbuff_t * tvb, int offset, packet_info * pinfo _
 }
 
 /* GPRS:        9.60 v7.6.0, chapter 7.9.13, page 42
- * UMTS:        29.060 v4.0, chapter 7.7.12, page 49
+ * UMTS:        29.060 v4.0, chapter 7.7.12 Selection Mode
  */
 
 
-static const gchar *dissect_radius_selection_mode(proto_tree * tree, tvbuff_t * tvb)
+static const gchar *dissect_radius_selection_mode(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo _U_)
 {
     guint8 sel_mode;
 
@@ -3066,7 +3361,7 @@ static const gchar *dissect_radius_selection_mode(proto_tree * tree, tvbuff_t *
 static int decode_gtp_sel_mode(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
-    proto_tree_add_item(tree, hf_gtp_sel_mode, tvb, offset, 2, FALSE);
+    proto_tree_add_item(tree, hf_gtp_sel_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
     return 2;
 }
 
@@ -3266,10 +3561,10 @@ static int decode_gtp_rab_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo
     nsapi = tvb_get_guint8(tvb, offset + 1) & 0x0F;
 
     proto_tree_add_uint(ext_tree_rab_cntxt, hf_gtp_nsapi, tvb, offset + 1, 1, nsapi);
-    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_dn, tvb, offset + 2, 2, FALSE);
-    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_up, tvb, offset + 4, 2, FALSE);
-    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_dn, tvb, offset + 6, 2, FALSE);
-    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_up, tvb, offset + 8, 2, FALSE);
+    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_dn, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_up, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_dn, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_up, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
 
     return 10;
 }
@@ -3304,7 +3599,7 @@ static int decode_gtp_rp(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, pr
     rp = tvb_get_guint8(tvb, offset + 1) & 0x07;
 
     te = proto_tree_add_uint_format(tree, hf_gtp_rp, tvb, offset, 2, rp, "Radio Priority for NSAPI(%u) : %u", nsapi, rp);
-    ext_tree_rp = proto_item_add_subtree(tree, ett_gtp_rp);
+    ext_tree_rp = proto_item_add_subtree(te, ett_gtp_rp);
 
     proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_nsapi, tvb, offset + 1, 1, nsapi);
     proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_spare, tvb, offset + 1, 1, spare);
@@ -3327,7 +3622,7 @@ static int decode_gtp_pkt_flow_id(tvbuff_t * tvb, int offset, packet_info * pinf
     pkt_flow_id = tvb_get_guint8(tvb, offset + 2);
 
     te = proto_tree_add_uint_format(tree, hf_gtp_pkt_flow_id, tvb, offset, 3, pkt_flow_id, "Packet Flow ID for NSAPI(%u) : %u", nsapi, pkt_flow_id);
-    ext_tree_pkt_flow_id = proto_item_add_subtree(tree, ett_gtp_pkt_flow_id);
+    ext_tree_pkt_flow_id = proto_item_add_subtree(te, ett_gtp_pkt_flow_id);
 
     proto_tree_add_uint(ext_tree_pkt_flow_id, hf_gtp_nsapi, tvb, offset + 1, 1, nsapi);
     proto_tree_add_uint_format(ext_tree_pkt_flow_id, hf_gtp_pkt_flow_id, tvb,
@@ -3403,6 +3698,7 @@ static int decode_gtp_ms_reason(tvbuff_t * tvb, int offset, packet_info * pinfo
 
     reason = tvb_get_guint8(tvb, offset + 1);
 
+    /* Reason for Absence is defined in 3GPP TS 23.040  */
     proto_tree_add_uint(tree, hf_gtp_ms_reason, tvb, offset, 2, reason);
 
     return 2;
@@ -3424,10 +3720,10 @@ static int decode_gtp_ra_prio_lcs(tvbuff_t * tvb, int offset, packet_info * pinf
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ra_prio_lcs);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     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_ra_prio_lcs, tvb, offset, 1, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
@@ -3580,17 +3876,15 @@ static int decode_quintuplet(tvbuff_t * tvb, int offset, proto_tree * tree, guin
  * TODO:        - check if for quintuplets first 2 bytes are length, according to AuthQuint
  *              - finish displaying last 3 parameters
  */
-static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
 {
 
     guint16 length, quint_len, con_len;
-    guint8 cksn, count, sec_mode, len;
+    guint8 count, sec_mode, len, iei;
     proto_tree *ext_tree_mm;
     proto_item *te;
     proto_item *tf = NULL;
     proto_tree *tf_tree = NULL;
-    tvbuff_t *l3_tvb;
-
 
     te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_MM_CNTXT, &gtp_val_ext, "Unknown message"));
     ext_tree_mm = proto_item_add_subtree(te, ett_gtp_mm);
@@ -3600,8 +3894,8 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _
     if (length < 1)
         return 3;
 
-    /* Octet 4 */
-    cksn = tvb_get_guint8(tvb, offset + 3) & 0x07;
+    /* Octet 4 (cksn)*/
+
     /* Octet 5 */
     sec_mode = (tvb_get_guint8(tvb, offset + 4) >> 6) & 0x03;
     count = (tvb_get_guint8(tvb, offset + 4) >> 3) & 0x07;
@@ -3613,10 +3907,10 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _
 
     switch (sec_mode) {
     case 0:                     /* Used cipher value, UMTS keys and Quintuplets */
-        proto_tree_add_item(ext_tree_mm, hf_gtp_cksn_ksi, tvb, offset + 3, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, FALSE);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_cksn_ksi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
         proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 16, "Ciphering key CK: %s", tvb_bytes_to_str(tvb, offset + 5, 16));
         proto_tree_add_text(ext_tree_mm, tvb, offset + 21, 16, "Integrity key IK: %s", tvb_bytes_to_str(tvb, offset + 21, 16));
         quint_len = tvb_get_ntohs(tvb, offset + 37);
@@ -3627,21 +3921,21 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _
 
         break;
     case 1:                     /* GSM key and triplets */
-        proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, FALSE);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
         if (gtp_version != 0)
-            proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, FALSE);
+            proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
 
-        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, FALSE);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
         proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 8, "Ciphering key Kc: %s", tvb_bytes_to_str(tvb, offset + 5, 8));
 
         offset = offset + decode_triplet(tvb, offset + 13, ext_tree_mm, count) + 13;
 
         break;
     case 2:                     /* UMTS key and quintuplets */
-        proto_tree_add_item(ext_tree_mm, hf_gtp_ksi, tvb, offset + 3, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, FALSE);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_ksi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
         proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 16, "Ciphering key CK: %s", tvb_bytes_to_str(tvb, offset + 5, 16));
         proto_tree_add_text(ext_tree_mm, tvb, offset + 21, 16, "Integrity key IK: %s", tvb_bytes_to_str(tvb, offset + 21, 16));
         quint_len = tvb_get_ntohs(tvb, offset + 37);
@@ -3651,10 +3945,10 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _
 
         break;
     case 3:                     /* GSM key and quintuplets */
-        proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, FALSE);
-        proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, FALSE);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
         proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 8, "Ciphering key Kc: %s", tvb_bytes_to_str(tvb, offset + 5, 8));
         quint_len = tvb_get_ntohs(tvb, offset + 13);
         proto_tree_add_text(ext_tree_mm, tvb, offset + 13, 2, "Quintuplets length: 0x%x (%u)", quint_len, quint_len);
@@ -3669,7 +3963,7 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _
 /*
  * 3GPP TS 24.008 10.5.5.6 ( see packet-gsm_a.c )
  */
-    de_gmm_drx_param(tvb, ext_tree_mm, offset, 2, NULL, 0);
+    de_gmm_drx_param(tvb, ext_tree_mm, pinfo, offset, 2, NULL, 0);
     offset = offset + 2;
 
     len = tvb_get_guint8(tvb, offset);
@@ -3683,12 +3977,26 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _
 /*
  * GPP TS 24.008 10.5.5.12 ( see packet-gsm_a.c )
  */
-    de_gmm_ms_net_cap(tvb, tf_tree, offset, len, NULL, 0);
+    de_gmm_ms_net_cap(tvb, tf_tree, pinfo, offset, len, NULL, 0);
     offset = offset + len;
 
-/* Container contains one or several optional information elements as described in the clause 'Overview',
- * from the clause 'General message format and information elements coding' in 3GPP TS 24.008.
- * The IMEISV shall, if available, be included in the Container.
+/* 3GPP TS 29.060 version 9.4.0 Release 9
+ *  The two octets Container Length holds the length of the Container, excluding the Container Length octets.
+ * Container contains one or several optional information elements as described in the clause "Overview", from the clause
+ * "General message format and information elements coding" in 3GPP TS 24.008 [5]. For the definition of the IEI see
+ * table 47a, "IEIs for information elements used in the container". The IMEISV shall, if available, be included in the
+ * Container. The IMEISV is included in the Mobile identity IE. If Container is not included, its Length field value shall
+ * be set to 0. If the MS is emergency attached and the MS is UICCless or the IMSI is unauthenticated, the International
+ * Mobile Equipment Identity (IMEI) shall be used as the MS identity.
+ *
+ * Table 47A: IEIs for information elements used in the container
+ * IEI            Information element
+ * 0x23           Mobile identity
+ *
+ * NOTE: In 3GPP TS 24.008 [5] the IEI definition is
+ * message dependent. The table is added to
+ * have a unique definition in the present
+ * document for the used IEI in the MMcontext.
  */
 
     con_len = tvb_get_ntohs(tvb, offset);
@@ -3696,10 +4004,19 @@ static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _
     offset = offset + 2;
 
     if (con_len > 0) {
-
-        l3_tvb = tvb_new_subset(tvb, offset, con_len, con_len);
-        if (!dissector_try_port(bssap_pdu_type_table, BSSAP_PDU_TYPE_DTAP, l3_tvb, pinfo, ext_tree_mm))
-            call_dissector(data_handle, l3_tvb, pinfo, ext_tree_mm);
+        proto_tree_add_text(ext_tree_mm, tvb, offset, con_len, "Container");
+
+        iei = tvb_get_guint8(tvb,offset);
+        if (iei == 0x23){
+            proto_tree_add_text(ext_tree_mm, tvb, offset, 1, "Mobile identity IEI %u",iei);
+            offset++;
+            len = tvb_get_guint8(tvb,offset);
+            proto_tree_add_text(ext_tree_mm, tvb, offset, 1, "Length %u",len);
+            offset++;
+            de_mid(tvb, ext_tree_mm, pinfo, offset, len, NULL, 0);
+        }else{
+            proto_tree_add_text(ext_tree_mm, tvb, offset, 1, "Unknown IEI %u - Later spec than TS 29.060 9.4.0 used?",iei);
+        }
     }
 
     return 3 + length;
@@ -3801,7 +4118,7 @@ static int decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const
 
         ext_tree_qos = proto_item_add_subtree(te, ett_gtp_qos);
 
-        proto_tree_add_item(ext_tree_qos, hf_gtp_qos_version, tvb, offset, 2, FALSE);
+        proto_tree_add_item(ext_tree_qos, hf_gtp_qos_version, tvb, offset, 2, ENC_ASCII|ENC_NA);
 
         /* Hyphen handling */
         hyphen = tvb_get_guint8(tvb, offset + 2);
@@ -3913,13 +4230,14 @@ static int decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const
             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) {
+        if (length > 16) {
             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
-         * */
+        /* 
+         * 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);
@@ -4096,7 +4414,7 @@ dissect_diameter_3gpp_qosprofile(tvbuff_t *tvb _U_, packet_info *pinfo _U_, prot
     return tvb_length(tvb);
 }
 
-static const gchar *dissect_radius_qos_umts(proto_tree * tree, tvbuff_t * tvb)
+static const gchar *dissect_radius_qos_umts(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo _U_)
 {
     decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3);
     return tvb_get_ephemeral_string(tvb, 0, tvb_length(tvb));
@@ -4127,14 +4445,15 @@ static void decode_apn(tvbuff_t * tvb, int offset, guint16 length, proto_tree *
     }
 }
 
-/* GPRS:        9.60 v7.6.0, chapter 7.9.20
- * UMTS:        29.060 v4.0, chapter 7.7.29
+/*
+ * GPRS:        9.60 v7.6.0, chapter 7.9.20
+ * UMTS:        29.060 v4.0, chapter 7.7.29 PDP Context
  * TODO:        unify addr functions
  */
 static int decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
-    guint8 ggsn_addr_len, apn_len, trans_id, vaa, order, nsapi, sapi, pdu_send_no, pdu_rec_no, pdp_cntxt_id, pdp_type_org, pdp_type_num, pdp_addr_len;
+    guint8 ggsn_addr_len, apn_len, trans_id, vaa, asi, order, nsapi, sapi, pdu_send_no, pdu_rec_no, pdp_cntxt_id, pdp_type_org, pdp_type_num, pdp_addr_len;
     guint16 length, sn_down, sn_up, up_flow;
     guint32 addr_ipv4;
     struct e_in6_addr addr_ipv6;
@@ -4147,11 +4466,13 @@ static int decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo
     ext_tree_pdp = proto_item_add_subtree(te, ett_gtp_pdp);
 
     vaa = (tvb_get_guint8(tvb, offset + 3) >> 6) & 0x01;
+    asi = (tvb_get_guint8(tvb, offset + 3) >> 5) & 0x01;
     order = (tvb_get_guint8(tvb, offset + 3) >> 4) & 0x01;
     nsapi = tvb_get_guint8(tvb, offset + 3) & 0x0F;
     sapi = tvb_get_guint8(tvb, offset + 4) & 0x0F;
 
     proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "VPLMN address allowed: %s", yesno[vaa]);
+    proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "Activity Status Indicator: %s", yesno[asi]);
     proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "Reordering required: %s", yesno[order]);
     proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "NSAPI: %u", nsapi);
     proto_tree_add_text(ext_tree_pdp, tvb, offset + 4, 1, "SAPI: %u", sapi);
@@ -4191,8 +4512,8 @@ static int decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo
         break;
     case 1:
         pdp_cntxt_id = tvb_get_guint8(tvb, offset + 14);
-        proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_cp, tvb, offset + 6, 4, FALSE);
-        proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_data, tvb, offset + 10, 4, FALSE);
+        proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_cp, tvb, offset + 6, 4, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_data, tvb, offset + 10, 4, ENC_BIG_ENDIAN);
         proto_tree_add_text(ext_tree_pdp, tvb, offset + 14, 1, "PDP context identifier: %u", pdp_cntxt_id);
         offset = offset + 15;
         break;
@@ -4306,19 +4627,16 @@ static int decode_gtp_apn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p
 
 /* GPRS:        9.60 v7.6.0, chapter 7.9.22
  *              4.08 v. 7.1.2, chapter 10.5.6.3 (p.580)
- * UMTS:        29.060 v4.0, chapter 7.7.31
+ * UMTS:        29.060 v4.0, chapter 7.7.31 Protocol Configuration Options
  *              24.008, v4.2, chapter 10.5.6.3
  */
 int decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
 {
 
-    guint16 length, proto_offset;
-    guint16 proto_id;
-    guint8 conf, proto_len, cnt = 1;
+    guint16 length;
     tvbuff_t *next_tvb;
     proto_tree *ext_tree_proto;
     proto_item *te;
-    gboolean save_writable;
 
     length = tvb_get_ntohs(tvb, offset + 1);
 
@@ -4330,50 +4648,13 @@ int decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto
     if (length < 1)
         return 3;
 
-    conf = tvb_get_guint8(tvb, offset + 3) & 0x07;
-    proto_tree_add_text(ext_tree_proto, tvb, offset + 3, 1, "Configuration protocol (00000xxx): %u", conf);
-
-    proto_offset = 1;           /* ... 1st byte is conf */
-    offset += 4;
-
-    for (;;) {
-        if (proto_offset >= length)
-            break;
-        proto_id = tvb_get_ntohs(tvb, offset);
-        proto_len = tvb_get_guint8(tvb, offset + 2);
-        proto_offset += proto_len + 3;  /* 3 = proto id + length byte */
-
-        if (proto_len > 0) {
-
-            proto_tree_add_text(ext_tree_proto, tvb, offset, 2, "Protocol %u ID: %s (0x%04x)",
-                                cnt, val_to_str_ext_const(proto_id, &ppp_vals_ext, "Unknown"), proto_id);
-            proto_tree_add_text(ext_tree_proto, tvb, offset + 2, 1, "Protocol %u length: %u", cnt, proto_len);
-
-            /*
-             * Don't allow the dissector for the configuration
-             * protocol in question to update the columns - this
-             * is GTP, not PPP.
-             */
-            save_writable = col_get_writable(pinfo->cinfo);
-            col_set_writable(pinfo->cinfo, FALSE);
-
-            /*
-             * XXX - should we have our own dissector table,
-             * solely for configuration protocols, so that bogus
-             * values don't cause us to dissect the protocol
-             * data as, for example, IP?
-             */
-            next_tvb = tvb_new_subset(tvb, offset + 3, proto_len, proto_len);
-            if (!dissector_try_port(ppp_subdissector_table, proto_id, next_tvb, pinfo, ext_tree_proto)) {
-                call_dissector(data_handle, next_tvb, pinfo, ext_tree_proto);
-            }
-
-            col_set_writable(pinfo->cinfo, save_writable);
-        }
-
-        offset += proto_len + 3;
-        cnt++;
-    }
+       /* The Protocol Configuration Options contains external network protocol options that may be necessary to transfer
+        * between the GGSN and the MS. The content and the coding of the Protocol Configuration are defined in octet 3-z of the
+        * Protocol Configuration Options in3GPP TS 24.008 [5].
+        */
+       next_tvb = tvb_new_subset(tvb, offset + 3, length, length);
+       pinfo->link_dir = P2P_DIR_UL;
+       de_sm_pco(next_tvb, ext_tree_proto, pinfo, 0, length, NULL, 0);
 
     return 3 + length;
 }
@@ -4443,7 +4724,6 @@ static int decode_gtp_gsn_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _
 static int decode_gtp_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
-    const guint8 *msisdn_val;
     gchar *msisdn_str;
     guint16 length;
 
@@ -4452,8 +4732,7 @@ static int decode_gtp_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_
     if (length < 1)
         return 3;
 
-    msisdn_val = tvb_get_ptr(tvb, offset + 3, length);
-    msisdn_str = msisdn_to_str(msisdn_val, length);
+    msisdn_str = msisdn_to_str(tvb, offset + 3, length);
 
     proto_tree_add_string(tree, hf_gtp_msisdn, tvb, offset, 3 + length, msisdn_str);
 
@@ -4488,7 +4767,7 @@ static int decode_gtp_auth_qui(tvbuff_t * tvb, int offset, packet_info * pinfo _
     ext_tree = proto_item_add_subtree(te_quint, ett_gtp_quint);
     offset++;
 
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
     proto_tree_add_text(ext_tree, tvb, offset, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset, 16));
@@ -4507,8 +4786,6 @@ static int decode_gtp_auth_qui(tvbuff_t * tvb, int offset, packet_info * pinfo _
     offset++;
     proto_tree_add_text(ext_tree, tvb, offset, auth_len, "AUTH: %s", tvb_bytes_to_str(tvb, offset, auth_len));
 
-    offset = offset + auth_len;
-
     return (3 + length);
 
 }
@@ -4521,7 +4798,7 @@ static int decode_gtp_tft(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p
 {
 
     guint16 length, port1, port2, tos;
-    guint8 tft_flags, tft_code, no_packet_filters, i, pf_id, pf_eval, pf_len, pf_content_id, proto, spare;
+    guint8 tft_flags, tft_code, no_packet_filters, i, pf_id, pf_eval, pf_len, pf_content_id, proto;
     guint pf_offset;
     guint32 mask_ipv4, addr_ipv4, ipsec_id, label;
     struct e_in6_addr addr_ipv6, mask_ipv6;
@@ -4535,7 +4812,6 @@ static int decode_gtp_tft(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p
 
     tft_flags = tvb_get_guint8(tvb, offset + 3);
     tft_code = (tft_flags >> 5) & 0x07;
-    spare = (tft_flags >> 4) & 0x01;
     no_packet_filters = tft_flags & 0x0F;
 
     proto_tree_add_text(ext_tree_tft, tvb, offset + 1, 2, "TFT length: %u", length);
@@ -4674,8 +4950,13 @@ static int decode_gtp_target_id(tvbuff_t * tvb, int offset, packet_info * pinfo
     target_id_item = proto_tree_add_text(tree, tvb, offset, 3 + length, "Target Identification");
     ext_tree = proto_item_add_subtree(target_id_item, ett_gtp_target_id);
     offset = offset + 1;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
+    /* The Target Identification information element contains the identification of a target RNC. Octets 4-n shall be encoded
+     * as the "Target RNC-ID" part of the "Target ID" parameter in 3GPP TS 25.413 [7]. Therefore, the "Choice Target ID"
+     * that indicates "Target RNC-ID" (numerical value of 0x20) shall not be included in the "Target RNC-ID" value in octets
+     * 4-n.
+     */
     next_tvb = tvb_new_subset(tvb, offset, length, length);
     dissect_ranap_TargetRNC_ID(next_tvb, 0, &asn1_ctx, ext_tree, hf_gtp_targetRNC_ID);
 
@@ -4699,7 +4980,7 @@ static int decode_gtp_utran_cont(tvbuff_t * tvb, int offset, packet_info * pinfo
     utran_cont_item = proto_tree_add_text(tree, tvb, offset, 3 + length, "UTRAN transparent field");
     ext_tree = proto_item_add_subtree(utran_cont_item, ett_gtp_utran_cont);
     offset = offset + 1;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     next_tvb = tvb_new_subset(tvb, offset, length, length);
     if (data_handle)
@@ -4857,7 +5138,10 @@ static int decode_gtp_chrg_addr(tvbuff_t * tvb, int offset, packet_info * pinfo
 }
 
 /* GPRS:        ?
- * UMTS:        29.060 v6.11.0, chapter 7.7.44 RAN Transparent Container
+ * UMTS:        29.060 V9.4.0, chapter 7.7.43 RAN Transparent Container
+ * The information in the value part of the RAN Transparent Container IE contains all information elements (starting with
+ * and including the BSSGP "PDU Type") in either of the RAN INFORMATION, RAN INFORMATION REQUEST,
+ * RAN INFORMATION ACK or RAN INFORMATION ERROR messages respectively as specified in 3GPP TS 48.018
  */
 static int decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -4865,16 +5149,21 @@ static int decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinf
     guint16 length;
     proto_tree *ext_tree;
     proto_item *te;
+    tvbuff_t    *next_tvb;
 
     length = tvb_get_ntohs(tvb, offset + 1);
     te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_RAN_TR_CONT, &gtp_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ran_tr_cont);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
-    /* TODO add decoding of data */
-    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+
+    next_tvb = tvb_new_subset(tvb, offset, length, length);
+    if (bssgp_handle){
+        col_set_fence(pinfo->cinfo, COL_INFO);
+        call_dissector(bssgp_handle, next_tvb, pinfo, ext_tree);
+    }
 
     return 3 + length;
 
@@ -4895,7 +5184,7 @@ static int decode_gtp_pdp_cont_prio(tvbuff_t * tvb, int offset, packet_info * pi
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdp_cont_prio);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -4919,7 +5208,7 @@ static int decode_gtp_add_rab_setup_inf(tvbuff_t * tvb, int offset, packet_info
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_rab_setup_inf);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -4944,7 +5233,7 @@ static int decode_gtp_ssgn_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ssgn_no);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -4968,22 +5257,22 @@ static int decode_gtp_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinf
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_common_flgs);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* Upgrade QoS Supported */
-    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_upgrd_qos_sup, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_upgrd_qos_sup, tvb, offset, 1, ENC_BIG_ENDIAN);
     /* NRSN bit field */
-    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_nrsn, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_nrsn, tvb, offset, 1, ENC_BIG_ENDIAN);
     /* No QoS negotiation */
-    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_no_qos_neg, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_no_qos_neg, tvb, offset, 1, ENC_BIG_ENDIAN);
     /* MBMS Counting Information bi */
-    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_cnt_inf, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_cnt_inf, tvb, offset, 1, ENC_BIG_ENDIAN);
     /* RAN Procedures Ready */
-    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_ran_pcd_rdy, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_ran_pcd_rdy, tvb, offset, 1, ENC_BIG_ENDIAN);
     /* MBMS Service Type */
-    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_srv_type, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_srv_type, tvb, offset, 1, ENC_BIG_ENDIAN);
     /* Prohibit Payload Compression */
-    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_ppc, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_ppc, tvb, offset, 1, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
@@ -5004,7 +5293,7 @@ static int decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo _U
     ext_tree_apn_res = proto_item_add_subtree(te, ett_gtp_ext_tree_apn_res);
 
     offset++;
-    proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
     /* Restriction Type value */
@@ -5016,12 +5305,12 @@ static int decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo _U
         return 3 + length;
     }
 
-    proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_apn_res, tvb, offset, length, FALSE);
+    proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_apn_res, tvb, offset, length, ENC_BIG_ENDIAN);
     return 3 + length;
 }
 
 /* GPRS:        ?
- * UMTS:        29.060 v6.11.0, chapter 7.7.50
+ * UMTS:        29.060 v6.11.0, chapter 7.7.50 RAT Type
  * RAT Type
  * Type = 151 (Decimal)
  */
@@ -5038,7 +5327,7 @@ static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo _
     ext_tree_rat_type = proto_item_add_subtree(te, ett_gtp_ext_rat_type);
 
     offset++;
-    proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
     /* RAT Type value */
@@ -5050,9 +5339,10 @@ static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo _
         return 3 + length;
     }
 
-   proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_rat_type, tvb, offset, length, FALSE);
+   proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_rat_type, tvb, offset, length, ENC_BIG_ENDIAN);
+   proto_item_append_text(te, ": %s", val_to_str_const(tvb_get_guint8(tvb,offset), gtp_ext_rat_type_vals, "Unknown"));
 
-    return 3 + length;
+   return 3 + length;
 }
 
 /* GPRS:        ?
@@ -5061,7 +5351,7 @@ static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo _
  * Type = 152 (Decimal)
  */
 
-static const gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb)
+static const gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo)
 {
 
     int offset = 0;
@@ -5069,30 +5359,34 @@ static const gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb)
     guint16 length = tvb_length(tvb);
 
     /* Geographic Location Type */
-    proto_tree_add_item(tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, FALSE);
+    proto_tree_add_item(tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
     geo_loc_type = tvb_get_guint8(tvb, offset);
     offset++;
 
     if (geo_loc_type == 0)
         /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 0) */
-        be_cell_id_aux(tvb, tree, offset, length - 1, NULL, 0, 0);
+        be_cell_id_aux(tvb, tree, pinfo, offset, length - 1, NULL, 0, 0);
     if (geo_loc_type == 1) {
         /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
-        be_cell_id_aux(tvb, tree, offset, length - 1, NULL, 0, 4);
+        be_cell_id_aux(tvb, tree, pinfo, offset, length - 1, NULL, 0, 4);
         offset = offset + 5;
-        proto_tree_add_item(tree, hf_gtp_ext_sac, tvb, offset, 2, FALSE);
+        proto_tree_add_item(tree, hf_gtp_ext_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
     }
 
 
     return tvb_bytes_to_str(tvb, 0, length);
 }
 
-static int decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+/*
+ * 7.7.51 User Location Information
+ */
+
+static int decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
 {
 
     guint16 length;
-    proto_tree *ext_tree;
-    proto_item *te;
+    proto_tree *ext_tree, *rai_tree;
+    proto_item *te, *fi;
     guint8 geo_loc_type;
 
     length = tvb_get_ntohs(tvb, offset + 1);
@@ -5100,23 +5394,51 @@ static int decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinf
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_usr_loc_inf);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     /* Geographic Location Type */
-    proto_tree_add_item(ext_tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
     geo_loc_type = tvb_get_guint8(tvb, offset);
     offset++;
 
-    if (geo_loc_type == 0)
-        /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 0) */
-        be_cell_id_aux(tvb, ext_tree, offset, length - 1, NULL, 0, 0);
-    if (geo_loc_type == 1) {
-        /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
-        be_cell_id_aux(tvb, ext_tree, offset, length - 1, NULL, 0, 4);
-        offset = offset + 5;
-        proto_tree_add_item(ext_tree, hf_gtp_ext_sac, tvb, offset, 2, FALSE);
-    }
+       switch(geo_loc_type){
+               case 0:
+                       /* Geographic Location field included and it holds the Cell Global
+                        * Identification (CGI) of where the user currently is registered.
+                        * CGI is defined in sub-clause 4.3.1 of 3GPP TS 23.003 [2].
+                        */
+            /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 0) */
+            be_cell_id_aux(tvb, ext_tree, pinfo, offset, length - 1, NULL, 0, 0);
+                       break;
+               case 1:
+                       /* Geographic Location field included and it holds the Service
+                        * Area Identity (SAI) of where the user currently is registered.
+                        * SAI is defined in sub-clause 9.2.3.9 of 3GPP TS 25.413 [7].
+                        */
+            /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
+            be_cell_id_aux(tvb, ext_tree, pinfo, offset, length - 1, NULL, 0, 4);
+            offset = offset + 5;
+            proto_tree_add_item(ext_tree, hf_gtp_ext_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
+                       break;
+               case 2:
+                       /* Geographic Location field included and it holds the Routing
+                        * Area Identification (RAI) of where the user currently is
+                        * registered. RAI is defined in sub-clause 4.2 of 3GPP TS 23.003
+                        * [2].
+                        */
+            fi = proto_tree_add_text(ext_tree, tvb, offset + 1, 7, "Routeing Area Identity (RAI)");
+            rai_tree = proto_item_add_subtree(fi, ett_gtp_uli_rai);
+
+                       dissect_e212_mcc_mnc(tvb, pinfo, rai_tree, offset, TRUE);
+            offset+=3;
+            proto_tree_add_item(rai_tree, hf_gtp_rai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
+            proto_tree_add_item(rai_tree, hf_gtp_rai_rac, tvb, offset, 2, ENC_BIG_ENDIAN);
+                       break;
+               default:
+                       proto_tree_add_text(tree, tvb, offset, length - 1, "Unknown Location type data");
+                       break;
+       }
 
     return 3 + length;
 
@@ -5153,7 +5475,7 @@ static int decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pin
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ms_time_zone);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
     /* 3GPP TS 23.040 version 6.6.0 Release 6
@@ -5199,7 +5521,7 @@ static int decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_
     ext_imeisv = proto_item_add_subtree(te, ett_gtp_ext_imeisv);
 
     offset++;
-    proto_tree_add_item(ext_imeisv, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_imeisv, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
     /* IMEI(SV)
@@ -5233,7 +5555,7 @@ static int decode_gtp_camel_chg_inf_con(tvbuff_t * tvb, int offset, packet_info
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_camel_chg_inf_con);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5258,7 +5580,7 @@ static int decode_gtp_mbms_ue_ctx(tvbuff_t * tvb, int offset, packet_info * pinf
     ext_tree = proto_item_add_subtree(te, ett_GTP_EXT_MBMS_UE_CTX);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5275,7 +5597,7 @@ static int decode_gtp_mbms_ue_ctx(tvbuff_t * tvb, int offset, packet_info * pinf
  * in 3GPP T S 24.008 [5] (i.e. the IEI and octet length indicator are not included).
  */
 
-static int decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+static int decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
 {
 
     guint16 length;
@@ -5288,14 +5610,14 @@ static int decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_,
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_tmgi);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
-    ti = proto_tree_add_item(ext_tree, hf_gtp_tmgi, tvb, offset, length, FALSE);
+    ti = proto_tree_add_item(ext_tree, hf_gtp_tmgi, tvb, offset, length, ENC_NA);
 
     tmgi_tree = proto_item_add_subtree(ti, ett_gtp_tmgi);
     next_tvb = tvb_new_subset(tvb, offset, length, length);
-    de_mid(next_tvb, tmgi_tree, 0, length, NULL, 0);
+    de_mid(next_tvb, tmgi_tree, pinfo, 0, length, NULL, 0);
     return 3 + length;
 
 }
@@ -5316,13 +5638,13 @@ static int decode_gtp_rim_ra(tvbuff_t * tvb, int offset, packet_info * pinfo _U_
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_rim_ra);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
-    /* TODO add decoding of data */
-    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+    /* To dissect the Address the Routing Address discriminator must be known */
     /*
      * Octets 4-n are coded according to 3GPP TS 48.018 [20] 11.3.77 RIM Routing Information IE octets 4-n.
      */
+       proto_tree_add_item(ext_tree, hf_gtp_rim_routing_addr, tvb, offset, length, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
@@ -5344,7 +5666,7 @@ static int decode_gtp_mbms_prot_conf_opt(tvbuff_t * tvb, int offset, packet_info
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_prot_conf_opt);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5363,8 +5685,8 @@ static int dissect_gtp_mbms_ses_dur(tvbuff_t * tvb _U_, packet_info * pinfo _U_,
 
     int offset = 0;
 
-    proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 1, FALSE);
-    proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, FALSE);
+    proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, ENC_BIG_ENDIAN);
 
     return 3;
 
@@ -5382,7 +5704,7 @@ static int decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pin
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bms_ses_dur);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* The MBMS Session Duration is defined in 3GPP TS 23.246 [26].
      * The MBMS Session Duration information element indicates the estimated
@@ -5398,8 +5720,8 @@ static int decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pin
      * for which the maximum allowed value is 18 days. For the whole session duration the seconds
      * and days are added together and the maximum session duration is 19 days.
      */
-    proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 1, FALSE);
-    proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
@@ -5409,22 +5731,13 @@ static int decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pin
  * UMTS:        3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.60
  * MBMS Service Area
  */
-static int decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
-{
+static int
+dissect_gtp_3gpp_mbms_service_area(tvbuff_t *tvb _U_, packet_info *pinfo _U_, proto_tree *tree _U_) {
 
-    guint16 length;
-    proto_tree *ext_tree;
-    proto_item *te, *item;
+    int offset = 0;
     guint8 no_of_mbms_sa_codes;
     int i;
 
-    length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SA, &gtp_val_ext, "Unknown"));
-    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_sa);
-
-    offset++;
-    item = proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
-    offset = offset + 2;
     /* The MBMS Service Area is defined in 3GPP TS 23.246 [26].
      * The MBMS Service Area information element indicates the area over
      * which the Multimedia Broadcast/Multicast Service is to be distributed.
@@ -5438,21 +5751,38 @@ static int decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo _U
      * 256 binary value is '11111111'
      */
     no_of_mbms_sa_codes = tvb_get_guint8(tvb, offset) + 1;
-    if (length != ((no_of_mbms_sa_codes << 1) + 1)) {
-        expert_add_info_format(pinfo, item, PI_RESPONSE_CODE, PI_WARN,
-                               "Wrong length: %u. The length of an MBMS service area code is 2 octets", length);
-    }
-    proto_tree_add_uint(ext_tree, hf_gtp_no_of_mbms_sa_codes, tvb, offset, 1, no_of_mbms_sa_codes);
+    proto_tree_add_uint(tree, hf_gtp_no_of_mbms_sa_codes, tvb, offset, 1, no_of_mbms_sa_codes);
     offset++;
     /* A consecutive list of N MBMS service area codes
      * The MBMS Service Area Identity and its semantics are defined in 3GPP TS 23.003
      * The length of an MBMS service area code is 2 octets.
      */
     for (i = 0; i < no_of_mbms_sa_codes; i++) {
-        proto_tree_add_item(ext_tree, hf_gtp_mbms_sa_code, tvb, offset, 2, FALSE);
+        proto_tree_add_item(tree, hf_gtp_mbms_sa_code, tvb, offset, 2, ENC_BIG_ENDIAN);
         offset = offset + 2;
     }
 
+    return offset;
+}
+
+static int decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
+{
+
+    tvbuff_t *next_tvb;
+    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_ext_const(GTP_EXT_MBMS_SA, &gtp_val_ext, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_sa);
+
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
+    offset = offset + 2;
+    next_tvb = tvb_new_subset(tvb, offset, length-3, length-3);
+    dissect_gtp_3gpp_mbms_service_area(next_tvb, pinfo,ext_tree);
+
     return 3 + length;
 
 }
@@ -5473,7 +5803,7 @@ static int decode_gtp_src_rnc_pdp_ctx_inf(tvbuff_t * tvb, int offset, packet_inf
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_src_rnc_pdp_ctx_inf);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5498,7 +5828,7 @@ static int decode_gtp_add_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinf
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_add_trs_inf);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5523,7 +5853,7 @@ static int decode_gtp_hop_count(tvbuff_t * tvb, int offset, packet_info * pinfo
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_hop_count);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5548,7 +5878,7 @@ static int decode_gtp_sel_plmn_id(tvbuff_t * tvb, int offset, packet_info * pinf
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_sel_plmn_id);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5573,7 +5903,7 @@ static int decode_gtp_mbms_ses_id(tvbuff_t * tvb, int offset, packet_info * pinf
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_ses_id);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5605,10 +5935,10 @@ static int decode_gtp_mbms_2g_3g_ind(tvbuff_t * tvb, int offset, packet_info * p
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_2g_3g_ind);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* MBMS 2G/3G Indicator */
-    proto_tree_add_item(ext_tree, hf_gtp_mbs_2g_3g_ind, tvb, offset, 1, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_mbs_2g_3g_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
@@ -5626,11 +5956,11 @@ static int decode_gtp_enh_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ENH_NSAPI, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ENH_NSAPI, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_enh_nsapi);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5651,11 +5981,11 @@ static int decode_gtp_add_mbms_trs_inf(tvbuff_t * tvb, int offset, packet_info *
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_MBMS_TRS_INF, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_MBMS_TRS_INF, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ad_mbms_trs_inf);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5676,11 +6006,11 @@ static int decode_gtp_mbms_ses_id_rep_no(tvbuff_t * tvb, int offset, packet_info
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_ID_REP_NO, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_ID_REP_NO, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_ses_id_rep_no);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5716,11 +6046,11 @@ static int decode_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, int offset, packet_in
     guint8 time_2_dta_tr;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_TIME_TO_DATA_TR, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_TIME_TO_DATA_TR, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_time_to_data_tr);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data
      * The MBMS Time To Data Transfer is defined in 3GPP TS 23.246 [26].
@@ -5760,11 +6090,11 @@ decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, pr
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HO_REQ_CTX, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HO_REQ_CTX, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ps_ho_req_ctx);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5786,11 +6116,11 @@ decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_t
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSS_CONT, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSS_CONT, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bss_cont);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5815,11 +6145,11 @@ decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tr
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CELL_ID, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CELL_ID, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_cell_id);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5848,11 +6178,11 @@ decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tre
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PDU_NO, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PDU_NO, &gtpv1_val_ext, "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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5874,17 +6204,17 @@ decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, prot
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bssgp_cause);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
     /*
      * The BSSGP Cause information element contains the cause as defined in 3GPP TS 48.018
      */
-    proto_tree_add_item(ext_tree, hf_gtp_bssgp_cause, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_bssgp_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
@@ -5901,12 +6231,14 @@ decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_,
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bssgp_cause);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
+#if 0 /* Fix Dead Store Warning */
     offset = offset + 2;
+#endif
     /* The payload shall be encoded as per the
      * Required-MBMS-Bearer-Capabilities AVP defined in 3GPP TS 29.061 [27],
      * excluding the AVP Header fields (as defined in IETF RFC 3588 [36], section 4.1).
@@ -5918,6 +6250,14 @@ decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_,
 /*
  * RIM Routing Address Discriminator    7.7.77
  */
+
+static const value_string gtp_bssgp_ra_discriminator_vals[] = {
+    { 0, "A Cell Identifier is used to identify a GERAN cell" },
+    { 1, "A Global RNC-ID is used to identify a UTRAN RNC" },
+    { 2, "An eNB identifier is used to identify an E-UTRAN eNodeB or HeNB" },
+    { 0, NULL },
+};
+
 static int
 decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
@@ -5927,14 +6267,17 @@ decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, prot
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RIM_ROUTING_ADDR_DISC, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RIM_ROUTING_ADDR_DISC, &gtpv1_val_ext, "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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
-    /* TODO add decoding of data */
-    proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
+    /* Octet 4 bits 4 - 1 is coded according to 3GPP TS 48.018 [20]
+     * RIM Routing Information IE octet 3 bits 4 - 1.
+     * Bits 8 - 5 are coded "0000".
+     */
+    proto_tree_add_item(ext_tree, hf_gtp_bssgp_ra_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
@@ -5951,11 +6294,11 @@ decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, p
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_LIST_OF_SETUP_PFCS, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_LIST_OF_SETUP_PFCS, &gtpv1_val_ext, "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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -5977,11 +6320,11 @@ static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info *
     guint8 xid_par_len;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HANDOVER_XIP_PAR, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HANDOVER_XIP_PAR, &gtpv1_val_ext, "Unknown"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ps_handover_xid);
 
     offset++;
-    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
 
     sapi = tvb_get_guint8(tvb, offset) & 0x0F;
@@ -6013,11 +6356,11 @@ static int decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MS_INF_CHG_REP_ACT, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MS_INF_CHG_REP_ACT, &gtpv1_val_ext, "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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -6036,19 +6379,20 @@ static int decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * p
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_DIRECT_TUNNEL_FLGS, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_DIRECT_TUNNEL_FLGS, &gtpv1_val_ext, "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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_ei, tvb, offset, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_gcsi, tvb, offset, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_dti, tvb, offset, 1, ENC_BIG_ENDIAN);
+#if 0 /* Fix Dead Store Warning */
     offset++;
-
+#endif
     return 3 + length;
 
 }
@@ -6063,11 +6407,11 @@ static int decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo _
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CORRELATION_ID, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CORRELATION_ID, &gtpv1_val_ext, "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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     /* TODO add decoding of data */
     proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
@@ -6077,7 +6421,14 @@ static int decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo _
 }
 /*
  * Bearer Control Mode  7.7.83
+ * version 10.0.0
  */
+static const value_string gtp_pdp_bcm_type_vals[] = {
+    {0, "MS_only"},
+    {1, "MS/NW"},
+    {0, NULL}
+};
+
 static int decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
@@ -6086,18 +6437,77 @@ static int decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info *
     proto_item *te;
 
     length = tvb_get_ntohs(tvb, offset + 1);
-    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BEARER_CONTROL_MODE, &gtp_val_ext, "Unknown"));
+    te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BEARER_CONTROL_MODE, &gtpv1_val_ext, "Unknown"));
+    ext_tree = proto_item_add_subtree(te, ett_gtp_bcm);
+
+    offset++;
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
+    offset = offset + 2;
+
+    proto_tree_add_item(ext_tree, hf_gtp_bcm, tvb, offset, 1, ENC_BIG_ENDIAN);
+
+    return 3 + length;
+
+}
+
+/*
+ * 7.7.84 MBMS Flow Identifier
+ * 7.7.85 MBMS IP Multicast Distribution
+ * 7.7.86 MBMS Distribution Acknowledgement
+ * 7.7.87 Reliable INTER RAT HANDOVER INFO
+ * 7.7.88 RFSP Index
+ * 7.7.89 PDP Type
+ * 7.7.90 Fully Qualified Domain Name (FQDN)
+ */
+/*
+ * 7.7.91 Evolved Allocation/Retention Priority I
+ */
+static int decode_gtp_evolved_allc_rtn_p1(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_ext_const(GTP_EXT_EVO_ALLO_RETE_P1, &gtpv1_val_ext, "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);
+    proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     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_earp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree, hf_gtp_earp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
+    proto_tree_add_item(ext_tree, hf_gtp_earp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
 
     return 3 + length;
 
+
 }
+
+/*
+ * 7.7.92 Evolved Allocation/Retention Priority II
+ * 7.7.93 Extended Common Flags
+ * 7.7.94 User CSG Information (UCI)
+ * 7.7.95 CSG Information Reporting Action
+ * 7.7.96 CSG ID
+ * 7.7.97 CSG Membership Indication (CMI)
+ * 7.7.98 APN Aggregate Maximum Bit Rate (APN-AMBR)
+ * 7.7.99 UE Network Capability
+ * 7.7.100 UE-AMBR
+ * 7.7.101 APN-AMBR with NSAPI
+ * 7.7.102 GGSN Back-Off Time
+ * 7.7.103 Signalling Priority Indication
+ * 7.7.104 Signalling Priority Indication with NSAPI
+ * 7.7.105 Higher bitrates than 16 Mbps flag
+ * 7.7.106 Max MBR/APN-AMBR
+ * 7.7.107 Additional MM context for SRVCC
+ * 7.7.108 Additional flags for SRVCC
+ * 7.7.109 STN-SR
+ * 7.7.110 C-MSISDN
+ * 7.7.111 Extended RANAP Cause
+ */
 /* GPRS:        12.15
  * UMTS:        33.015
  */
@@ -6153,34 +6563,105 @@ static int decode_gtp_can_pack(tvbuff_t * tvb, int offset, packet_info * pinfo _
     return 3 + length;
 }
 
-/* CDRs dissector */
+/* CDRs dissector
+ * 3GPP TS 32.295 version 9.0.0 Release 9
+ */
+
+
+static const value_string gtp_cdr_fmt_vals[] = {
+    {1, "Basic Encoding Rules (BER)"},
+    {2, "Unaligned basic Packed Encoding Rules (PER)"},
+    {3, "Aligned basic Packed Encoding Rules (PER)"},
+    {0, NULL}
+};
 static int decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
 {
 
-    guint16 length, format_ver;
-    guint8 no, format;
-    proto_tree *ext_tree;
-    proto_item *te;
+    guint16 length, cdr_length;
+    guint8 no, format, app_id, rel_id, ver_id, i;
+    proto_tree *ext_tree, *ver_tree, *cdr_dr_tree;
+    proto_item *te, *fmt_item, *ver_item;
     tvbuff_t *next_tvb;
 
     te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_DATA_REQ, &gtp_val_ext, "Unknown message"));
     ext_tree = proto_item_add_subtree(te, ett_gtp_ext);
+    offset++;
 
-    length = tvb_get_ntohs(tvb, offset + 1);
-    no = tvb_get_guint8(tvb, offset + 3);
-    format = tvb_get_guint8(tvb, offset + 4);
-    format_ver = tvb_get_ntohs(tvb, offset + 5);
+    length = tvb_get_ntohs(tvb, offset);
+    proto_tree_add_text(ext_tree, tvb, offset, 2, "Length: %u", length);
+    offset+=2;
+
+    /* Octet 4 Number of Data Records */
+    no = tvb_get_guint8(tvb, offset);
+    proto_tree_add_text(ext_tree, tvb, offset, 1, "Number of data records: %u", no);
+    offset++;
+
+    /* Octet 5 Data Record Format */
+    format = tvb_get_guint8(tvb, offset);
+    fmt_item = proto_tree_add_text(ext_tree, tvb, offset, 1, "Data record format: %u", format);
+    offset++;
+    /* The value range is 1-255 in decimal. The value '0' should not be used.
+     * Only the values 1-10 and 51-255 can be used for standards purposes.
+     * Values in the range of 11-50 are to be configured only by operators, and are not subject to standardization.
+     */
+    if(format<4){
+        proto_item_append_text(fmt_item, " %s", val_to_str_const(format, gtp_cdr_fmt_vals, "Unknown"));
+        /* Octet 6 -7  Data Record Format Version
+         *    8 7 6 5             4 3 2 1
+         * 6 Application Identifier Release Identifier
+         * 7 Version Identifier
+         */
+        app_id = tvb_get_guint8(tvb,offset);
+        rel_id = app_id & 0x0f;
+        app_id = app_id >>4;
+        ver_id =tvb_get_guint8(tvb,offset+1);
+        /* The second octet (#7 in Data Record Packet IE) identifies the version of the TS used to encode the CDR,
+         * i.e. its value corresponds to the second digit of the version number of the document [51]
+         * (as shown on the cover sheet), plus '1'.
+         * E.g. for version 3.4.0, the Version Identifier would be "5".
+         * In circumstances where the second digit is an alphabetical character, (e.g. 3.b.0), the corresponding ASCII value shall
+         * be taken, e.g. the Version Identifier would be "66" (ASCII(b)).
+         */
+        if(ver_id<0x65)
+            ver_id = ver_id -1;
+        /* XXX We don't handle ASCCI version */
+
+        ver_item = proto_tree_add_text(ext_tree, tvb, offset, 2, "Data record format version: AppId %u Rel %u.%u.0", app_id,rel_id,ver_id);
+        ver_tree = proto_item_add_subtree(ver_item, ett_gtp_cdr_ver);
+        proto_tree_add_item(ver_tree, hf_gtp_cdr_app, tvb, offset, 1, ENC_BIG_ENDIAN);
+        proto_tree_add_item(ver_tree, hf_gtp_cdr_rel, tvb, offset, 1, ENC_BIG_ENDIAN);
+        offset++;
+        proto_tree_add_item(ver_tree, hf_gtp_cdr_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
+        offset++;
+        for(i = 0; i < no; ++i) {
+            cdr_length = tvb_get_ntohs(tvb, offset);
+            te = proto_tree_add_text(ext_tree, tvb, offset, cdr_length+2, "Data record %d", i + 1);
+            cdr_dr_tree = proto_item_add_subtree(te, ett_gtp_cdr_dr);
+            proto_tree_add_text(cdr_dr_tree, tvb, offset, 2, "Length: %u", cdr_length);
+            offset+=2;
+            proto_tree_add_text(cdr_dr_tree, tvb, offset, cdr_length, "Content");
+            next_tvb = tvb_new_subset_remaining(tvb, offset);
 
-    proto_tree_add_text(ext_tree, tvb, offset + 1, 2, "Length: %u", length);
-    proto_tree_add_text(ext_tree, tvb, offset + 3, 1, "Number of data records: %u", no);
-    proto_tree_add_text(ext_tree, tvb, offset + 4, 1, "Data record format: %u", format);
-    proto_tree_add_text(ext_tree, tvb, offset + 5, 2, "Data record format version: %u", format_ver);
+            /* XXX this is for release 6, may not work for higer releases */
+            if(format==1){
+                dissect_gprscdr_GPRSCallEventRecord_PDU(next_tvb, pinfo, cdr_dr_tree);
+            }else{
+                /* Do we have a dissector regestering for this data format? */
+                dissector_try_uint(gtp_cdr_fmt_dissector_table, format, next_tvb, pinfo, cdr_dr_tree);
+            }
+
+            offset = offset + cdr_length;
+        }
+
+    }else{
+        /* Proprietary CDR format */
+        proto_item_append_text(fmt_item, " Proprietary or un documented format");
+    }
 
     if (gtpcdr_handle) {
         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");
+    }
 
     return 3 + length;
 }
@@ -6264,13 +6745,14 @@ static int decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo _
     guint16 length, ext_id;
     proto_tree *ext_tree_priv_ext;
     proto_item *te;
+    tvbuff_t *next_tvb;
 
     te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_PRIV_EXT, &gtp_val_ext, "Unknown message"));
     ext_tree_priv_ext = proto_item_add_subtree(te, ett_gtp_ext);
 
     offset++;
     length = tvb_get_ntohs(tvb, offset);
-    proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_length, tvb, offset, 2, FALSE);
+    proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
     offset = offset + 2;
     if (length >= 2) {
         ext_id = tvb_get_ntohs(tvb, offset);
@@ -6281,8 +6763,11 @@ static int decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo _
          * XXX - is this always a text string?  Or should it be
          * displayed as hex data?
          */
-        if (length > 2)
-            proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length - 2, FALSE);
+       if (length > 2){
+            proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length - 2, ENC_NA);
+            next_tvb = tvb_new_subset_remaining(tvb, offset);
+            dissector_try_uint(gtp_priv_ext_dissector_table, ext_id, next_tvb, pinfo, ext_tree_priv_ext);
+       }
     }
 
     return 3 + length;
@@ -6298,319 +6783,386 @@ static int decode_gtp_unknown(tvbuff_t * tvb, int offset, packet_info * pinfo _U
 
 static void dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
-    struct _gtp_hdr gtp_hdr;
-    proto_tree *gtp_tree, *flags_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;
-    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;
-    gtp_conv_info_t *gtp_info=(gtp_conv_info_t *)pinfo->private_data;
-    void* pd_save;
-
-
-    col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTP");
-    col_clear(pinfo->cinfo, COL_INFO);
-
-    /*
-     * Do we have a conversation for this connection?
-     */
-    conversation = find_or_create_conversation(pinfo);
-
-    /*
-     * 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;
-    else
-                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;
-    }
-
-    col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr.message, &message_type_ext, "Unknown"));
-
-    if (tree) {
-        ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, FALSE);
-        gtp_tree = proto_item_add_subtree(ti, ett_gtp);
-
-        tf = proto_tree_add_uint(gtp_tree, hf_gtp_flags, tvb, 0, 1, gtp_hdr.flags);
-        flags_tree = proto_item_add_subtree(tf, ett_gtp_flags);
-
-               if(gtp_prime==0){
-               proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
+       struct _gtp_hdr gtp_hdr;
+       proto_tree *gtp_tree, *flags_tree, *ext_tree;
+       proto_item *ti, *tf, *item;
+       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, noOfExtHdrs = 0, ext_hdr_length;
+       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;
+       gtp_conv_info_t *gtp_info;
+       void* pd_save;
+
+
+       col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTP");
+       col_clear(pinfo->cinfo, COL_INFO);
+
+       /*
+       * Do we have a conversation for this connection?
+       */
+       conversation = find_or_create_conversation(pinfo);
+
+       /*
+       * 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;
+       else
+               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;
+       }
+
+       col_add_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr.message, &gtp_message_type_ext, "Unknown"));
+
+       if (tree) {
+               ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, ENC_NA);
+               gtp_tree = proto_item_add_subtree(ti, ett_gtp);
+
+               tf = proto_tree_add_uint(gtp_tree, hf_gtp_flags, tvb, 0, 1, gtp_hdr.flags);
+               flags_tree = proto_item_add_subtree(tf, ett_gtp_flags);
+
+               if(gtp_prime==1){
+                       /* Octet  8    7    6    5    4    3    2    1
+             * 1      Version   | PT| Spare '1 1 1 '| ' 0/1 '
+                        */
+                       proto_tree_add_uint(flags_tree, hf_gtp_prime_flags_ver, tvb, 0, 1, gtp_hdr.flags);
+                       proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, 0, 1, gtp_hdr.flags);
+                       proto_tree_add_uint(flags_tree, hf_gtp_flags_spare1, tvb, 0, 1, gtp_hdr.flags);
+                       /* Bit 1 of octet 1 is not used in GTP' (except in v0), and it is marked '0'
+                        * in the GTP' header. It is in use in GTP' v0 and distinguishes the used header-length.
+                        * In the case of GTP' v0, this bit being marked one (1) indicates the usage of the 6
+                        * octets header. If the bit is set to '0' (usually the case) the 20-octet header is used.
+                        * For all other versions of GTP', this bit is not used and is set to '0'. However,
+                        * this does not suggest the use of the 20-octet header, rather a shorter 6-octet header.
+                        */
+                       if(gtp_version==0){
+                               proto_tree_add_item(flags_tree, hf_gtp_flags_hdr_length, tvb, 0, 1, ENC_BIG_ENDIAN);
+                       }
                }else{
-               proto_tree_add_uint(flags_tree, hf_gtp_prime_flags_ver, tvb, 0, 1, gtp_hdr.flags);
+                       proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
+                       proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, 0, 1, gtp_hdr.flags);
+                       if(gtp_version==0){
+                               proto_tree_add_uint(flags_tree, hf_gtp_flags_spare1, tvb, 0, 1, gtp_hdr.flags);
+                               proto_tree_add_boolean(flags_tree, hf_gtp_flags_snn, tvb, 0, 1, gtp_hdr.flags);
+                       }else{
+                               proto_tree_add_uint(flags_tree, hf_gtp_flags_spare2, tvb, 0, 1, gtp_hdr.flags);
+                               proto_tree_add_boolean(flags_tree, hf_gtp_flags_e, tvb, 0, 1, gtp_hdr.flags);
+                               proto_tree_add_boolean(flags_tree, hf_gtp_flags_s, tvb, 0, 1, gtp_hdr.flags);
+                               proto_tree_add_boolean(flags_tree, hf_gtp_flags_pn, tvb, 0, 1, gtp_hdr.flags);
+                       }
                }
 
-        proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, 0, 1, gtp_hdr.flags);
-
-        if((gtp_prime==1)||(gtp_version==0)){
-            proto_tree_add_uint(flags_tree, hf_gtp_flags_spare1, tvb, 0, 1, gtp_hdr.flags);
-            proto_tree_add_boolean(flags_tree, hf_gtp_flags_snn, tvb, 0, 1, gtp_hdr.flags);
-               }else{
-            proto_tree_add_uint(flags_tree, hf_gtp_flags_spare2, tvb, 0, 1, gtp_hdr.flags);
-            proto_tree_add_boolean(flags_tree, hf_gtp_flags_e, tvb, 0, 1, gtp_hdr.flags);
-            proto_tree_add_boolean(flags_tree, hf_gtp_flags_s, tvb, 0, 1, gtp_hdr.flags);
-            proto_tree_add_boolean(flags_tree, hf_gtp_flags_pn, tvb, 0, 1, gtp_hdr.flags);
-        }
-
-        proto_tree_add_uint(gtp_tree, hf_gtp_message_type, tvb, 1, 1, gtp_hdr.message);
-
-        gtp_hdr.length = g_ntohs(gtp_hdr.length);
-        proto_tree_add_uint(gtp_tree, hf_gtp_length, tvb, 2, 2, gtp_hdr.length);
-
-        offset = 4;
-
-        if (gtp_prime) {
-            seq_no = tvb_get_ntohs(tvb, offset);
-            proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
-            offset += 2;
-        } else
-            switch (gtp_version) {
-            case 0:
-                seq_no = tvb_get_ntohs(tvb, offset);
-                proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
-                offset += 2;
-
-                flow_label = tvb_get_ntohs(tvb, offset);
-                proto_tree_add_uint(gtp_tree, hf_gtp_flow_label, tvb, offset, 2, flow_label);
-                offset += 2;
-
-                pdu_no = tvb_get_guint8(tvb, offset);
-                proto_tree_add_uint(gtp_tree, hf_gtp_sndcp_number, tvb, offset, 1, pdu_no);
-                offset += 4;
-
-                tid_val = tvb_get_ptr(tvb, offset, 8);
-                tid_str = id_to_str(tid_val);
-                proto_tree_add_string(gtp_tree, hf_gtp_tid, tvb, offset, 8, tid_str);
-                offset += 8;
-                break;
-            case 1:
-                teid = tvb_get_ntohl(tvb, offset);
-                proto_tree_add_uint(gtp_tree, hf_gtp_teid, tvb, offset, 4, teid);
-                offset += 4;
-
-                if (gtp_hdr.flags & 0x07) {
-                    seq_no = tvb_get_ntohs(tvb, offset);
-                    proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
-                    offset += 2;
-
-                    pdu_no = tvb_get_guint8(tvb, offset);
-                    proto_tree_add_uint(gtp_tree, hf_gtp_npdu_number, tvb, offset, 1, pdu_no);
-                    offset++;
-
-                    next_hdr = tvb_get_guint8(tvb, offset);
-                    proto_tree_add_uint(gtp_tree, hf_gtp_next, tvb, offset, 1, next_hdr);
-                    if (!next_hdr)
-                        offset++;
-                }
-                break;
-            default:
-                break;
-            }
-
-        if (gtp_hdr.message != GTP_MSG_TPDU) {
-            /* TODO: This code should be cleaned up to handle more than one
-             * header and possibly display the header content */
-            if (next_hdr) {
-                offset++;
-                switch (next_hdr) {
-                case 1:
-                    /* MBMS support indication */
-                    proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- MBMS support indication header ---]");
-                    offset += 3;
-                    break;
-                case 2:
-                    /* MS Info Change Reporting support indication */
-                    proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- MS Info Change Reporting support indication header ---]");
-                    offset += 3;
-                    break;
-                case 0xc0:
-                    /* PDCP PDU number */
-                    proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- PDCP PDU number header ---]");
-                    offset += 3;
-                    break;
-                case 0xc1:
-                    /* Suspend Request */
-                    proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- Suspend Request header ---]");
-                    offset += 3;
-                    break;
-                case 0xc2:
-                    /* Suspend Response */
-                    proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- Suspend Response header ---]");
-                    offset += 3;
-                    break;
-                default:
-                    proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- Unknown extension header ---]");
-                    offset += 3;
-                    break;
-                }
-                next_hdr = tvb_get_guint8(tvb, offset);
-                proto_tree_add_uint(gtp_tree, hf_gtp_next, tvb, offset, 1, next_hdr);
-                offset++;
-            }
-            proto_tree_add_text(gtp_tree, tvb, 0, 0, "[--- end of GTP header, beginning of extension headers ---]");
-            length = tvb_length(tvb);
-            mandatory = 0;      /* check order of GTP fields against ETSI */
-            for (;;) {
-                if (offset >= length)
-                    break;
-                if (next_hdr) {
-                    ext_hdr_val = next_hdr;
-                    next_hdr = 0;
-                } else
-                    ext_hdr_val = tvb_get_guint8(tvb, offset);
-                if (g_gtp_etsi_order) {
-                    checked_field = check_field_presence(gtp_hdr.message, ext_hdr_val, (int *) &mandatory);
-                    switch (checked_field) {
-                    case -2:
-                        proto_tree_add_text(gtp_tree, tvb, 0, 0, "[WARNING] message not found");
-                        break;
-                    case -1:
-                        proto_tree_add_text(gtp_tree, tvb, 0, 0, "[WARNING] field not present");
-                        break;
-                    case 0:
-                        break;
-                    default:
-                        proto_tree_add_text(gtp_tree, tvb, offset, 1, "[WARNING] wrong next field, should be: %s",
-                                            val_to_str_ext_const(checked_field, &gtp_val_ext, "Unknown extension field"));
-                        break;
-                    }
-                }
-
-                i = -1;
-                while (gtpopt[++i].optcode)
-                    if (gtpopt[i].optcode == ext_hdr_val)
-                        break;
-                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);
-                }
-            }
-        }
-        proto_item_set_len (ti, offset);
-    }
-
-    if ((gtp_hdr.message == GTP_MSG_TPDU) && g_gtp_tpdu) {
-
-        if (gtp_prime)
-            offset = 6;
-        else if (gtp_version == 1) {
-            if (gtp_hdr.flags & 0x07) {
-                offset = 11;
-                if (tvb_get_guint8(tvb, offset) == 0)
-                    offset++;
-            } else
-                offset = 8;
-        } else
-            offset = 20;
-
-        sub_proto = tvb_get_guint8(tvb, offset);
-
-        if ((sub_proto >= 0x45) && (sub_proto <= 0x4e)) {
-            /* this is most likely an IPv4 packet
-             * we can exclude 0x40 - 0x44 because the minimum header size is 20 octets
-             * 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_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_remaining(tvb, offset);
-            call_dissector(ipv6_handle, next_tvb, pinfo, tree);
-        } else {
-            /* this seems to be a PPP packet */
-
-            if (sub_proto == 0xff) {
-                /* this might be an address field, even it shouldn't be here */
-                control_field = tvb_get_guint8(tvb, offset + 1);
-                if (control_field == 0x03)
-                    /* now we are pretty sure that address and control field are mistakenly inserted -> ignore it for PPP dissection */
-                    acfield_len = 2;
-            }
+               proto_tree_add_uint(gtp_tree, hf_gtp_message_type, tvb, 1, 1, gtp_hdr.message);
+
+               gtp_hdr.length = g_ntohs(gtp_hdr.length);
+               proto_tree_add_uint(gtp_tree, hf_gtp_length, tvb, 2, 2, gtp_hdr.length);
+
+               offset = 4;
+
+               if (gtp_prime) {
+                       seq_no = tvb_get_ntohs(tvb, offset);
+                       proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
+                       offset += 2;
+                       /* If GTP' version is 0 and bit 1 is 0 20 bytes header is used, step past it */
+                       if( (gtp_version==0)&&((gtp_hdr.flags & 0x01)==0) ){
+                               offset = GTPv0_HDR_LENGTH;
+                       }
+               } else
+                       switch (gtp_version) {
+                       case 0:
+                               seq_no = tvb_get_ntohs(tvb, offset);
+                               proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
+                               offset += 2;
+
+                               flow_label = tvb_get_ntohs(tvb, offset);
+                               proto_tree_add_uint(gtp_tree, hf_gtp_flow_label, tvb, offset, 2, flow_label);
+                               offset += 2;
+
+                               pdu_no = tvb_get_guint8(tvb, offset);
+                               proto_tree_add_uint(gtp_tree, hf_gtp_sndcp_number, tvb, offset, 1, pdu_no);
+                               offset += 4;
+
+                               tid_str = id_to_str(tvb, offset);
+                               proto_tree_add_string(gtp_tree, hf_gtp_tid, tvb, offset, 8, tid_str);
+                               offset += 8;
+                               break;
+                       case 1:
+                               teid = tvb_get_ntohl(tvb, offset);
+                               proto_tree_add_uint(gtp_tree, hf_gtp_teid, tvb, offset, 4, teid);
+                               offset += 4;
+
+                               /* Are sequence number/N-PDU Number/extension header present? */
+                               if (gtp_hdr.flags & 0x07) {
+                                       seq_no = tvb_get_ntohs(tvb, offset);
+                                       proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
+                                       offset += 2;
+
+                                       pdu_no = tvb_get_guint8(tvb, offset);
+                                       proto_tree_add_uint(gtp_tree, hf_gtp_npdu_number, tvb, offset, 1, pdu_no);
+                                       offset++;
+
+                                       next_hdr = tvb_get_guint8(tvb, offset);
+
+                                       /* Don't add extension header, we'll add a subtree for that */
+                                       /* proto_tree_add_uint(gtp_tree, hf_gtp_next, tvb, offset, 1, next_hdr); */
+
+                                       offset++;
+
+                                       /* Change to while? */
+                                       if (next_hdr) {
+
+                                               /* TODO Add support for more than one extension header */
+
+                                               noOfExtHdrs++;
+
+                                               tf = proto_tree_add_uint(gtp_tree, hf_gtp_ext_hdr, tvb, offset, 4, next_hdr);
+                                               ext_tree = proto_item_add_subtree(tf, ett_gtp_ext_hdr);
+
+                                               /* PDCP PDU
+                                               * 3GPP 29.281 v9.0.0, 5.2.2.2 PDCP PDU Number
+                                               *
+                                               * "This extension header is transmitted, for example in UTRAN, at SRNS relocation time,
+                                               * to provide the PDCP sequence number of not yet acknowledged N-PDUs. It is 4 octets long,
+                                               *  and therefore the Length field has value 1.
+                                               *
+                                               *  When used between two eNBs at the X2 interface in E-UTRAN, bits 5-8 of octet 2 are spare.
+                                               *  The meaning of the spare bits shall be set to zero.
+                                               *
+                                               * Wireshark Note: TS 29.060 does not define bit 5-6 as spare, so no check is possible unless a preference is used.
+                                               */
+                                               if (next_hdr == GTP_EXT_HDR_PDCP_SN) {
+
+                                                       /* First byte is length (should be 1) */
+                                                       ext_hdr_length = tvb_get_guint8(tvb, offset);
+                                                       if (ext_hdr_length != 1) {
+                                                               expert_add_info_format(pinfo, ext_tree, PI_PROTOCOL, PI_WARN, "The length field for the PDCP SN Extension header should be 1.");
+                                                       }
+                                                       proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_length, tvb, offset,1, ENC_BIG_ENDIAN);
+                                                       offset++;
+
+                                                       proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_pdcpsn, tvb, offset, 2, ENC_BIG_ENDIAN);
+                                                       offset += 2;
+
+                                                       /* Last is next_hdr */
+                                                       next_hdr = tvb_get_guint8(tvb, offset);
+                                                       item = proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_next, tvb, offset, 1, ENC_BIG_ENDIAN);
+
+                                                       if (next_hdr) {
+                                                               expert_add_info_format(pinfo, item, PI_UNDECODED, PI_WARN, "Can't decode more than one extension header.");
+                                                       }
+                                                       offset++;
+                                               }
+                                       }
+                               }
+                               break;
+                       default:
+                               break;
+               }
 
-            next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
-            call_dissector(ppp_handle, next_tvb, pinfo, tree);
-        }
+               if (gtp_hdr.message != GTP_MSG_TPDU) {
+                       /* TODO: This code should be cleaned up to handle more than one
+                       * header and possibly display the header content */
+                       if (next_hdr) {
+                               offset++;
+                               switch (next_hdr) {
+                               case 1:
+                                       /* MBMS support indication */
+                                       proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- MBMS support indication header ---]");
+                                       offset += 3;
+                                       break;
+                               case 2:
+                                       /* MS Info Change Reporting support indication */
+                                       proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- MS Info Change Reporting support indication header ---]");
+                                       offset += 3;
+                                       break;
+                               case 0xc0:
+                                       /* PDCP PDU number */
+                                       proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- PDCP PDU number header ---]");
+                                       offset += 3;
+                                       break;
+                               case 0xc1:
+                                       /* Suspend Request */
+                                       proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- Suspend Request header ---]");
+                                       offset += 3;
+                                       break;
+                               case 0xc2:
+                                       /* Suspend Response */
+                                       proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- Suspend Response header ---]");
+                                       offset += 3;
+                                       break;
+                               default:
+                                       proto_tree_add_text(gtp_tree, tvb, offset, 4, "[--- Unknown extension header ---]");
+                                       offset += 3;
+                                       break;
+                               }
+                               next_hdr = tvb_get_guint8(tvb, offset);
+                               proto_tree_add_uint(gtp_tree, hf_gtp_next, tvb, offset, 1, next_hdr);
+                               offset++;
+                       }
+                       /* proto_tree_add_text(gtp_tree, tvb, 0, 0, "[--- end of GTP header, beginning of extension headers ---]");*/
+                       length = tvb_length(tvb);
+                       mandatory = 0;      /* check order of GTP fields against ETSI */
+                       for (;;) {
+                               if (offset >= length)
+                                       break;
+                               if (next_hdr) {
+                                       ext_hdr_val = next_hdr;
+                                       next_hdr = 0;
+                               } else
+                                       ext_hdr_val = tvb_get_guint8(tvb, offset);
+                               if (g_gtp_etsi_order) {
+                                       checked_field = check_field_presence(gtp_hdr.message, ext_hdr_val, (int *) &mandatory);
+                                       switch (checked_field) {
+                                       case -2:
+                                               proto_tree_add_text(gtp_tree, tvb, 0, 0, "[WARNING] message not found");
+                                               break;
+                                       case -1:
+                                               proto_tree_add_text(gtp_tree, tvb, 0, 0, "[WARNING] field not present");
+                                               break;
+                                       case 0:
+                                               break;
+                                       default:
+                                               proto_tree_add_text(gtp_tree, tvb, offset, 1, "[WARNING] wrong next field, should be: %s",
+                                                       val_to_str_ext_const(checked_field, &gtp_val_ext, "Unknown extension field"));
+                                               break;
+                                       }
+                               }
+
+                               i = -1;
+                               while (gtpopt[++i].optcode)
+                                       if (gtpopt[i].optcode == ext_hdr_val)
+                                               break;
+                               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);
+                               }
+                       }
+               }
+               proto_item_set_len (ti, offset);
+       }
+
+       if ((gtp_hdr.message == GTP_MSG_TPDU) && g_gtp_tpdu) {
+
+               if (gtp_prime)
+                       offset = 6;
+               else if (gtp_version == 1) {
+                       if (gtp_hdr.flags & 0x07) {
+                               offset = 11;
+                               if (tvb_get_guint8(tvb, offset) == 0)
+                                       offset++;
+                       } else
+                               offset = 8;
+               } else
+                       offset = 20;
+
+               /* Can only handle one extension header type... */
+               if (noOfExtHdrs != 0) offset+= 1 + noOfExtHdrs*4;
+
+               sub_proto = tvb_get_guint8(tvb, offset);
+
+               if ((sub_proto >= 0x45) && (sub_proto <= 0x4e)) {
+                       /* this is most likely an IPv4 packet
+                       * we can exclude 0x40 - 0x44 because the minimum header size is 20 octets
+                       * 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_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_remaining(tvb, offset);
+                       call_dissector(ipv6_handle, next_tvb, pinfo, tree);
+               } else {
+                       /* this seems to be a PPP packet */
+
+                       if (sub_proto == 0xff) {
+                               /* this might be an address field, even it shouldn't be here */
+                               control_field = tvb_get_guint8(tvb, offset + 1);
+                               if (control_field == 0x03)
+                                       /* now we are pretty sure that address and control field are mistakenly inserted -> ignore it for PPP dissection */
+                                       acfield_len = 2;
+                       }
+
+                       next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
+                       call_dissector(ppp_handle, next_tvb, pinfo, tree);
+               }
 
-        col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <");
-        col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
-    }
-    pinfo->private_data = pd_save;
+               col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <");
+               col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
+       }
+       pinfo->private_data = pd_save;
 }
 
 static void dissect_gtpprim(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
 
-       dissect_gtp_common(tvb, pinfo, tree);
+    dissect_gtp_common(tvb, pinfo, tree);
 }
 
 static void dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
 {
-       guint8 version;
-        /*
-         * 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;
-                }
-        }
-        if(version>2){
-                proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version,
-                                    val_to_str_const(version, ver_types, "Unknown"));
-                return;
+    guint8 version;
+    /*
+     * 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;
         }
+    }
+    if(version>2){
+        proto_tree_add_text(tree, tvb, 0, -1, "No WS dissector for GTP version %u %s", version,
+                            val_to_str_const(version, ver_types, "Unknown"));
+        return;
+    }
 
-               dissect_gtp_common(tvb, pinfo, tree);
+    dissect_gtp_common(tvb, pinfo, tree);
 
 }
 
@@ -6668,6 +7220,10 @@ void proto_register_gtp(void)
         {&hf_gtp_ext_id, {"Extension identifier", "gtp.ext_id", FT_UINT16, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0, NULL, HFILL}},
         {&hf_gtp_ext_val, {"Extension value", "gtp.ext_val", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL}},
         {&hf_gtp_flags, {"Flags", "gtp.flags", FT_UINT8, BASE_HEX, NULL, 0, "Ver/PT/Spare...", HFILL}},
+        {&hf_gtp_ext_hdr, {"Extension header", "gtp.ext_hdr", FT_UINT8, BASE_HEX, VALS(next_extension_header_fieldvals), 0, NULL, HFILL}},
+        {&hf_gtp_ext_hdr_next, {"Next extension header", "gtp.ext_hdr.next", FT_UINT8, BASE_HEX, VALS(next_extension_header_fieldvals), 0, NULL, HFILL}},
+        {&hf_gtp_ext_hdr_pdcpsn, {"PDCP Sequence Number", "gtp.ext_hdr.pdcp_sn", FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL}},
+        {&hf_gtp_ext_hdr_length, {"Extension Header Length", "gtp.ext_hdr.length", FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL}},
         {&hf_gtp_flags_ver,
          {"Version", "gtp.flags.version",
           FT_UINT8, BASE_DEC, VALS(ver_types), GTP_VER_MASK,
@@ -6677,7 +7233,7 @@ void proto_register_gtp(void)
          {"Version", "gtp.prim.flags.version",
           FT_UINT8, BASE_DEC,NULL, GTP_VER_MASK,
           "GTP' Version", HFILL}
-               },
+        },
         {&hf_gtp_flags_pt,
          {"Protocol type", "gtp.flags.payload",
           FT_UINT8, BASE_DEC, VALS(pt_types), GTP_PT_MASK,
@@ -6688,7 +7244,12 @@ void proto_register_gtp(void)
           FT_UINT8, BASE_DEC, NULL, GTP_SPARE1_MASK,
           "Reserved (shall be sent as '111' )", HFILL}
         },
-        {&hf_gtp_flags_snn,
+        {&hf_gtp_flags_hdr_length,
+         {"Header length", "gtp.flags._hdr_length",
+          FT_BOOLEAN, 8,  TFS(&gtp_hdr_length_vals), 0x01,
+          NULL, HFILL}
+               },
+               {&hf_gtp_flags_snn,
          {"Is SNDCP N-PDU included?", "gtp.flags.snn", FT_BOOLEAN, 8, TFS(&yes_no_tfs), GTP_SNN_MASK,
           "Is SNDCP N-PDU LLC Number included? (1 = yes, 0 = no)", HFILL}},
         {&hf_gtp_flags_spare2,
@@ -6714,7 +7275,7 @@ void proto_register_gtp(void)
         {&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, NULL, HFILL}},
-        {&hf_gtp_message_type, {"Message Type", "gtp.message", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &message_type_ext, 0x0, "GTP Message Type", HFILL}},
+        {&hf_gtp_message_type, {"Message Type", "gtp.message", FT_UINT8, BASE_HEX|BASE_EXT_STRING, &gtp_message_type_ext, 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, NULL, HFILL}},
         {&hf_gtp_ms_valid, {"MS validated", "gtp.ms_valid", FT_BOOLEAN, BASE_NONE, NULL, 0x0, NULL, HFILL}},
@@ -6786,8 +7347,6 @@ void proto_register_gtp(void)
          {"Downlink next PDCP-PDU seq number", "gtp.rab_pdu_dn", FT_UINT16, BASE_DEC, NULL, 0, "Downlink next PDCP-PDU sequence number", HFILL}},
         {&hf_gtp_rab_pdu_up,
          {"Uplink next PDCP-PDU seq number", "gtp.rab_pdu_up", FT_UINT16, BASE_DEC, NULL, 0, "Uplink next PDCP-PDU sequence number", HFILL}},
-        {&hf_gtp_rai_mcc, {"MCC", "gtp.mcc", FT_UINT16, BASE_DEC, NULL, 0, "Mobile Country Code", HFILL}},
-        {&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|BASE_EXT_STRING, &ranap_cause_type_ext, 0, NULL, HFILL}},
@@ -6845,7 +7404,7 @@ void proto_register_gtp(void)
           NULL, HFILL}
         },
         {&hf_gtp_cipher_algorithm,
-         {"Cipher Algorithm", "gtp.no_of_vectors",
+         {"Cipher Algorithm", "gtp.cipher_algorithm",
           FT_UINT8, BASE_DEC, VALS(gtp_cipher_algorithm), 0x07,
           NULL, HFILL}
         },
@@ -6855,12 +7414,12 @@ void proto_register_gtp(void)
           "CKSN/KSI", HFILL}
         },
         {&hf_gtp_cksn,
-         {"Ciphering Key Sequence Number (CKSN)", "gtp.cksn_ksi",
+         {"Ciphering Key Sequence Number (CKSN)", "gtp.cksn",
           FT_UINT8, BASE_DEC, NULL, 0x07,
           "CKSN", HFILL}
         },
         {&hf_gtp_ksi,
-         {"Key Set Identifier (KSI)", "gtp.cksn_ksi",
+         {"Key Set Identifier (KSI)", "gtp.ksi",
           FT_UINT8, BASE_DEC, NULL, 0x07,
           "KSI", HFILL}
         },
@@ -6900,8 +7459,13 @@ void proto_register_gtp(void)
             NULL, HFILL }},
         {&hf_gtp_bssgp_cause,
          {"BSSGP Cause", "gtp.bssgp_cause",
-          FT_UINT8, BASE_DEC, VALS(tab_cause), 0,
+          FT_UINT8, BASE_DEC|BASE_EXT_STRING, &bssgp_cause_vals_ext, 0,
           NULL, HFILL}},
+        { &hf_gtp_bssgp_ra_discriminator,
+          { "Routing Address Discriminator", "gtp.bssgp.rad",
+            FT_UINT8, BASE_DEC, VALS(gtp_bssgp_ra_discriminator_vals), 0x0f,
+            NULL, HFILL }
+        },
         {&hf_gtp_sapi,
          {"PS Handover XID SAPI", "gtp.ps_handover_xid_sapi",
           FT_UINT8, BASE_DEC, NULL, 0x0F,
@@ -6910,6 +7474,34 @@ void proto_register_gtp(void)
          {"PS Handover XID parameter length", "gtp.ps_handover_xid_par_len",
           FT_UINT8, BASE_DEC, NULL, 0xFF,
           "XID parameter length", HFILL}},
+        {&hf_gtp_earp_pvi,
+         {"PVI Pre-emption Vulnerability", "gtp.EARP_pre_emption_par_vulnerability",
+          FT_UINT8, BASE_DEC, NULL, 0x01,
+          NULL, HFILL}},
+        {&hf_gtp_earp_pl,
+         {"PL Priority Level", "gtp.EARP_priority_level",
+          FT_UINT8, BASE_DEC, NULL, 0x3C,
+          NULL, HFILL}},
+        {&hf_gtp_earp_pci,
+         {"PCI Pre-emption Capability", "gtp.EARP_pre_emption_Capability",
+          FT_UINT8, BASE_DEC, NULL, 0x40,
+          NULL, HFILL}},
+        {&hf_gtp_cdr_app,
+         {"Application Identifier", "gtp.cdr_app",
+          FT_UINT8, BASE_DEC, NULL, 0xf0,
+          NULL, HFILL}},
+        { &hf_gtp_cdr_rel,
+         {"Release Identifier", "gtp.cdr_rel",
+          FT_UINT8, BASE_DEC, NULL, 0x0f,
+          NULL, HFILL}},
+        { &hf_gtp_cdr_ver,
+         {"Version Identifier", "gtp.cdr_ver",
+          FT_UINT8, BASE_DEC, NULL, 0x0,
+          NULL, HFILL}},
+        {&hf_gtp_spare,
+         {"Spare", "gtp.spare",
+          FT_UINT8, BASE_DEC, NULL, 0x02,
+          NULL, HFILL}},
         {&hf_gtp_cmn_flg_ppc,
          {"Prohibit Payload Compression", "gtp.cmn_flg.ppc",
           FT_BOOLEAN, 8, NULL, 0x01,
@@ -6919,7 +7511,7 @@ void proto_register_gtp(void)
           FT_BOOLEAN, 8, NULL, 0x02,
           NULL, HFILL}},
         {&hf_gtp_cmn_flg_mbs_ran_pcd_rdy,
-         {"RAN Procedures Ready", "gtp.cmn_flg.ran_pcd_rd",
+         {"RAN Procedures Ready", "gtp.cmn_flg.mbs_ran_pcd_rdy",
           FT_BOOLEAN, 8, NULL, 0x04,
           NULL, HFILL}},
         {&hf_gtp_cmn_flg_mbs_cnt_inf,
@@ -6935,11 +7527,11 @@ void proto_register_gtp(void)
           FT_BOOLEAN, 8, NULL, 0x20,
           NULL, HFILL}},
         {&hf_gtp_cmn_flg_upgrd_qos_sup,
-         {"Upgrade QoS Supported", "gtp.cmn_flg.ran_pcd_rd",
+         {"Upgrade QoS Supported", "gtp.cmn_flg.upgrd_qos_sup",
           FT_BOOLEAN, 8, NULL, 0x40,
           NULL, HFILL}},
         {&hf_gtp_tmgi,
-         {"Temporary Mobile Group Identity (TMGI)", "gtp.cmn_flg.ran_pcd_rd",
+         {"Temporary Mobile Group Identity (TMGI)", "gtp.tmgi",
           FT_BYTES, BASE_NONE, NULL, 0x0,
           NULL, HFILL}},
         {&hf_gtp_no_of_mbms_sa_codes,
@@ -6987,6 +7579,21 @@ void proto_register_gtp(void)
            FT_UINT8, BASE_DEC, NULL, 0x01,
            NULL, HFILL}
         },
+        { &hf_gtp_ra_prio_lcs,
+          {"Radio Priority LCS", "gtp.raplcs",
+           FT_UINT8, BASE_DEC, NULL, 0x07,
+           NULL, HFILL}
+        },
+        { &hf_gtp_bcm,
+         {"Bearer Control Mode", "gtp.bcm",
+          FT_UINT8, BASE_DEC, VALS(gtp_pdp_bcm_type_vals), 0,
+          NULL, HFILL}
+        },
+               { &hf_gtp_rim_routing_addr,
+         {"RIM Routing Address value", "gtp.rim_routing_addr_val",
+          FT_BYTES, BASE_NONE, NULL, 0,
+          NULL, HFILL}
+        },
     };
 
     static gint *ett_gtp_array[] = {
@@ -7058,6 +7665,11 @@ void proto_register_gtp(void)
         &ett_gtp_ext_ps_handover_xid,
         &ett_gtp_target_id,
         &ett_gtp_utran_cont,
+        &ett_gtp_bcm,
+        &ett_gtp_cdr_ver,
+        &ett_gtp_cdr_dr,
+        &ett_gtp_ext_hdr,
+               &ett_gtp_uli_rai,
     };
 
     module_t *gtp_module;
@@ -7089,6 +7701,9 @@ void proto_register_gtp(void)
     register_dissector("gtp", dissect_gtp, proto_gtp);
     register_dissector("gtpprim", dissect_gtpprim, proto_gtp);
 
+    gtp_priv_ext_dissector_table = register_dissector_table("gtp.priv_ext", "GTP PRIVATE EXT", FT_UINT16, BASE_DEC);
+    gtp_cdr_fmt_dissector_table = register_dissector_table("gtp.cdr_fmt", "GTP DATA RECORD TYPE", FT_UINT16, BASE_DEC);
+
     register_init_routine(gtp_reinit);
     gtp_tap=register_tap("gtp");
 }
@@ -7114,7 +7729,7 @@ void proto_reg_handoff_gtp(void)
 
     if (!Initialized) {
         gtp_handle = find_dissector("gtp");
-               gtp_prim_handle = find_dissector("gtpprim");
+        gtp_prim_handle = find_dissector("gtpprim");
         ppp_subdissector_table = find_dissector_table("ppp.protocol");
 
         radius_register_avp_dissector(VENDOR_THE3GPP, 5, dissect_radius_qos_umts);
@@ -7130,24 +7745,27 @@ void proto_reg_handoff_gtp(void)
         gtpcdr_handle = find_dissector("gtpcdr");
         sndcpxid_handle = find_dissector("sndcpxid");
         gtpv2_handle = find_dissector("gtpv2");
+        bssgp_handle = find_dissector("bssgp");
         bssap_pdu_type_table = find_dissector_table("bssap.pdu_type");
         /* AVP Code: 5 3GPP-GPRS Negotiated QoS profile */
-        dissector_add("diameter.3gpp", 5, new_create_dissector_handle(dissect_diameter_3gpp_qosprofile, proto_gtp));
+        dissector_add_uint("diameter.3gpp", 5, new_create_dissector_handle(dissect_diameter_3gpp_qosprofile, proto_gtp));
+        /* AVP Code: 903 MBMS-Service-Area */
+        dissector_add_uint("diameter.3gpp", 903, new_create_dissector_handle(dissect_gtp_3gpp_mbms_service_area, proto_gtp));
         /* AVP Code: 904 MBMS-Session-Duration */
-        dissector_add("diameter.3gpp", 904, new_create_dissector_handle(dissect_gtp_mbms_ses_dur, proto_gtp));
+        dissector_add_uint("diameter.3gpp", 904, new_create_dissector_handle(dissect_gtp_mbms_ses_dur, proto_gtp));
         /* AVP Code: 911 MBMS-Time-To-Data-Transfer */
-        dissector_add("diameter.3gpp", 911, new_create_dissector_handle(dissect_gtp_mbms_time_to_data_tr, proto_gtp));
+        dissector_add_uint("diameter.3gpp", 911, new_create_dissector_handle(dissect_gtp_mbms_time_to_data_tr, proto_gtp));
 
         Initialized = TRUE;
     } else {
-        dissector_delete("udp.port", gtpv0_port, gtp_prim_handle);
-        dissector_delete("udp.port", gtpv1c_port, gtp_handle);
-        dissector_delete("udp.port", gtpv1u_port, gtp_handle);
+        dissector_delete_uint("udp.port", gtpv0_port, gtp_prim_handle);
+        dissector_delete_uint("udp.port", gtpv1c_port, gtp_handle);
+        dissector_delete_uint("udp.port", gtpv1u_port, gtp_handle);
 
         if (gtp_over_tcp) {
-            dissector_delete("tcp.port", gtpv0_port, gtp_prim_handle);
-            dissector_delete("tcp.port", gtpv1c_port, gtp_handle);
-            dissector_delete("tcp.port", gtpv1u_port, gtp_handle);
+            dissector_delete_uint("tcp.port", gtpv0_port, gtp_prim_handle);
+            dissector_delete_uint("tcp.port", gtpv1c_port, gtp_handle);
+            dissector_delete_uint("tcp.port", gtpv1u_port, gtp_handle);
         }
     }
 
@@ -7156,14 +7774,14 @@ void proto_reg_handoff_gtp(void)
     gtpv1c_port  = g_gtpv1c_port;
     gtpv1u_port  = g_gtpv1u_port;
 
-    dissector_add("udp.port", g_gtpv0_port, gtp_prim_handle);
-    dissector_add("udp.port", g_gtpv1c_port, gtp_handle);
-    dissector_add("udp.port", g_gtpv1u_port, gtp_handle);
+    dissector_add_uint("udp.port", g_gtpv0_port, gtp_prim_handle);
+    dissector_add_uint("udp.port", g_gtpv1c_port, gtp_handle);
+    dissector_add_uint("udp.port", g_gtpv1u_port, gtp_handle);
 
     if (g_gtp_over_tcp) {
-        dissector_add("tcp.port", g_gtpv0_port, gtp_prim_handle);
-        dissector_add("tcp.port", g_gtpv1c_port, gtp_handle);
-        dissector_add("tcp.port", g_gtpv1u_port, gtp_handle);
+        dissector_add_uint("tcp.port", g_gtpv0_port, gtp_prim_handle);
+        dissector_add_uint("tcp.port", g_gtpv1c_port, gtp_handle);
+        dissector_add_uint("tcp.port", g_gtpv1u_port, gtp_handle);
     }
 }
 
@@ -7176,6 +7794,6 @@ void proto_reg_handoff_gtp(void)
  * indent-tabs-mode: nil
  * End:
  *
- * vi: set shiftwidth=4 tabstop=8 expandtab
+ * vi: set shiftwidth=4 tabstop=8 expandtab:
  * :indentSize=4:tabSize=8:noTabs=true:
  */