* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
* 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 "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 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;
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;
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_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_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;
/* 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"},
#define GTPv1_EXT_RP_SPARE_MASK 0x08
#define GTPv1_EXT_RP_MASK 0x07
-static const value_string message_type[] = {
+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_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_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"},
/* 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"},
/* 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"},
+#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
#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 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 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 */
- /* 202-238 TLV Spare. For future use. */
+ /* 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])*/
{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"},
{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"},
{199, "UE Network Capability"}, /* 7.7.99 */
{200, "UE-AMBR"}, /* 7.7.100 */
{201, "APN-AMBR with NSAPI"}, /* 7.7.101 */
-
- {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"},
+ {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);
* 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 */
-
- {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 */
+/* 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_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);
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);
}
},
{
- 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},
}
},
{
- 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},
{
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}
}
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;
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;
}
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) {
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;
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) {
{
const gchar *imsi_str;
- /* Octets 2 - 9 IMSI */
+ /* 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+1, 8, imsi_str);
}
/* 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, >p_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));
}
/* 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)
{
}
/* 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)
{
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)
{
}
/* 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)
{
}
/* 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)
{
}
/* 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
*/
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, ENC_BIG_ENDIAN);
+ 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);
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);
}
}
-/* 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)
/* 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);
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, ENC_BIG_ENDIAN);
-
- /*
- * 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_uint(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;
}
}
/* 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)
{
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, >p_val_ext, "Unknown"));
offset++;
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;
}
/* 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)
*/
}
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: ?
return tvb_bytes_to_str(tvb, 0, length);
}
+/*
+ * 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);
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, 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, 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);
- }
+ 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;
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, ENC_BIG_ENDIAN);
+ 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);
offset++;
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;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ENH_NSAPI, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_enh_nsapi);
offset++;
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, >p_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, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ad_mbms_trs_inf);
offset++;
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, >p_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, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_ses_id_rep_no);
offset++;
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, >p_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, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_time_to_data_tr);
offset++;
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, >p_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, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ps_ho_req_ctx);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSS_CONT, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bss_cont);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CELL_ID, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_cell_id);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PDU_NO, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bssgp_cause);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bssgp_cause);
offset++;
/*
* 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)
{
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, >p_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, >pv1_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, 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;
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, >p_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, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
offset++;
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, >p_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, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ps_handover_xid);
offset++;
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, >p_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, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_DIRECT_TUNNEL_FLGS, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CORRELATION_ID, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
offset++;
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BEARER_CONTROL_MODE, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_bcm);
offset++;
}
+/*
+ * 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
*/
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, >p_val_ext, "Unknown"));
+ te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_EVO_ALLO_RETE_P1, >pv1_val_ext, "Unknown"));
ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
offset++;
}
+
+/*
+ * 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
*/
/* 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);
- }
+ }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;
}
* displayed as hex data?
*/
if (length > 2){
- proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length - 2, ENC_BIG_ENDIAN);
+ 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);
}
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, *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;
- guint16 pdcpsn;
- 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, &message_type_ext, "Unknown"));
-
- if (tree) {
- ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, ENC_BIG_ENDIAN);
- 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);
- }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_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);
- }
+ 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, >p_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_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(gtp_tree, hf_gtp_message_type, tvb, 1, 1, gtp_hdr.message);
+ 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);
+ 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;
+ 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_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;
+ 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;
+ 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++;
+ 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.
- *
- *
- */
- 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.");
- }
- item = proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_length, tvb, offset,1, ENC_BIG_ENDIAN);
-
- offset++;
-
- /* Second and third bytes are PDCP SN, bits 5-8 of first byte should be 0. */
- pdcpsn = tvb_get_ntohs(tvb,offset);
-
- item = proto_tree_add_uint(ext_tree, hf_gtp_ext_hdr_pdcpsn, tvb, offset, 2, pdcpsn & 0x0FFF);
-
- if (pdcpsn & 0xF000) {
- expert_add_info_format(pinfo, item, PI_PROTOCOL, PI_WARN, "Reserved bits should be zero.");
- }
-
- offset += 2;
-
- /* Last is next_hdr */
- next_hdr = tvb_get_guint8(tvb, offset);
- item = proto_tree_add_uint(ext_tree, hf_gtp_ext_hdr_next, tvb, offset, 1, next_hdr);
-
- 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;
- }
-
- 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, >p_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);
+ /* 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;
+ }
+
+ 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, >p_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);
+ }
- } 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;
- }
+ /*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);
- }
+ 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)
{&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, "Extension header", HFILL}},
- {&hf_gtp_ext_hdr_next, {"Next extension header", "gtp.ext_hdr.next", FT_UINT8, BASE_HEX, VALS(next_extension_header_fieldvals), 0, "Extension header", HFILL}},
- {&hf_gtp_ext_hdr_pdcpsn, {"PDCP Sequence Number", "gtp.ext_hdr.pdcp_sn", FT_UINT8, BASE_DEC, NULL, 0, NULL, 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, 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(>p_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,
{&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, >p_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}},
{"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}},
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}
},
"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}
},
{"BSSGP Cause", "gtp.bssgp_cause",
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,
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,
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,
{"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}
},
};
&ett_gtp_bcm,
&ett_gtp_cdr_ver,
&ett_gtp_cdr_dr,
- &ett_gtp_ext_hdr,
+ &ett_gtp_ext_hdr,
+ &ett_gtp_uli_rai,
};
module_t *gtp_module;
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_uint("diameter.3gpp", 5, new_create_dissector_handle(dissect_diameter_3gpp_qosprofile, proto_gtp));
* 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:
*/