3 * Routines for GTP dissection
4 * Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com>
5 * Nicolas Balkota <balkota@mac.com>
7 * Updates and corrections:
8 * Copyright 2006, Anders Broman <anders.broman@ericsson.com>
12 * Wireshark - Network traffic analyzer
13 * By Gerald Combs <gerald@wireshark.org>
14 * Copyright 1998 Gerald Combs
16 * This program is free software; you can redistribute it and/or
17 * modify it under the terms of the GNU General Public License
18 * as published by the Free Software Foundation; either version 2
19 * of the License, or (at your option) any later version.
21 * This program is distributed in the hope that it will be useful,
22 * but WITHOUT ANY WARRANTY; without even the implied warranty of
23 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
24 * GNU General Public License for more details.
26 * You should have received a copy of the GNU General Public License
27 * along with this program; if not, write to the Free Software
28 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
29 * Ref: 3GPP TS 29.060 version 6.8.0 Release 6
42 #include <epan/packet.h>
43 #include <epan/prefs.h>
44 #include <epan/sminmpec.h>
45 #include "packet-ipv6.h"
46 #include "packet-ppp.h"
47 #include "packet-radius.h"
48 #include "packet-bssap.h"
49 #include "packet-gsm_a.h"
50 #include "packet-gsm_map.h"
51 #include "packet-per.h"
52 #include "packet-ranap.h"
53 #include "packet-bssgp.h"
55 static dissector_table_t ppp_subdissector_table;
57 #define GTPv0_PORT 3386
58 #define GTPv1C_PORT 2123 /* 3G Control PDU */
59 #define GTPv1U_PORT 2152 /* 3G T-PDU */
61 #define GTPv0_HDR_LENGTH 20
62 #define GTPv1_HDR_LENGTH 12
63 #define GTP_PRIME_HDR_LENGTH 6
65 /* to check compliance with ETSI */
66 #define GTP_MANDATORY 1
67 #define GTP_OPTIONAL 2
68 #define GTP_CONDITIONAL 4
70 static guint g_gtpv0_port = GTPv0_PORT;
71 static guint g_gtpv1c_port = GTPv1C_PORT;
72 static guint g_gtpv1u_port = GTPv1U_PORT;
74 void proto_reg_handoff_gtp(void);
76 static int proto_gtp = -1;
78 static int hf_gtp_apn = -1;
79 static int hf_gtp_cause = -1;
80 static int hf_gtp_chrg_char = -1;
81 static int hf_gtp_chrg_char_s = -1;
82 static int hf_gtp_chrg_char_n = -1;
83 static int hf_gtp_chrg_char_p = -1;
84 static int hf_gtp_chrg_char_f = -1;
85 static int hf_gtp_chrg_char_h = -1;
86 static int hf_gtp_chrg_char_r = -1;
87 static int hf_gtp_chrg_id = -1;
88 static int hf_gtp_chrg_ipv4 = -1;
89 static int hf_gtp_chrg_ipv6 = -1;
90 static int hf_gtp_ext_flow_label = -1;
91 static int hf_gtp_ext_id = -1;
92 static int hf_gtp_ext_val = -1;
93 static int hf_gtp_flags = -1;
94 static int hf_gtp_flags_ver = -1;
95 static int hf_gtp_flags_pt = -1;
96 static int hf_gtp_flags_spare1 = -1;
97 static int hf_gtp_flags_snn = -1;
98 static int hf_gtp_flags_spare2 = -1;
99 static int hf_gtp_flags_e = -1;
100 static int hf_gtp_flags_s = -1;
101 static int hf_gtp_flags_pn = -1;
102 static int hf_gtp_flow_ii = -1;
103 static int hf_gtp_flow_label = -1;
104 static int hf_gtp_flow_sig = -1;
105 static int hf_gtp_gsn_addr_len = -1;
106 static int hf_gtp_gsn_addr_type = -1;
107 static int hf_gtp_gsn_ipv4 = -1;
108 static int hf_gtp_gsn_ipv6 = -1;
109 static int hf_gtp_imsi = -1;
110 static int hf_gtp_length = -1;
111 static int hf_gtp_map_cause = -1;
112 static int hf_gtp_message_type = -1;
113 static int hf_gtp_ms_reason = -1;
114 static int hf_gtp_ms_valid = -1;
115 static int hf_gtp_msisdn = -1;
116 static int hf_gtp_next = -1;
117 static int hf_gtp_npdu_number = -1;
118 static int hf_gtp_node_ipv4 = -1;
119 static int hf_gtp_node_ipv6 = -1;
120 static int hf_gtp_nsapi = -1;
121 static int hf_gtp_ptmsi = -1;
122 static int hf_gtp_ptmsi_sig = -1;
123 static int hf_gtp_qos_version = -1;
124 static int hf_gtp_qos_spare1 = -1;
125 static int hf_gtp_qos_delay = -1;
126 static int hf_gtp_qos_mean = -1;
127 static int hf_gtp_qos_peak = -1;
128 static int hf_gtp_qos_spare2 = -1;
129 static int hf_gtp_qos_precedence = -1;
130 static int hf_gtp_qos_spare3 = -1;
131 static int hf_gtp_qos_reliability = -1;
132 static int hf_gtp_qos_al_ret_priority = -1;
133 static int hf_gtp_qos_traf_class = -1;
134 static int hf_gtp_qos_del_order = -1;
135 static int hf_gtp_qos_del_err_sdu = -1;
136 static int hf_gtp_qos_max_sdu_size = -1;
137 static int hf_gtp_qos_max_ul = -1;
138 static int hf_gtp_qos_max_dl = -1;
139 static int hf_gtp_qos_res_ber = -1;
140 static int hf_gtp_qos_sdu_err_ratio = -1;
141 static int hf_gtp_qos_trans_delay = -1;
142 static int hf_gtp_qos_traf_handl_prio = -1;
143 static int hf_gtp_qos_guar_ul = -1;
144 static int hf_gtp_qos_guar_dl = -1;
145 static int hf_gtp_pkt_flow_id = -1;
146 static int hf_gtp_rab_gtpu_dn = -1;
147 static int hf_gtp_rab_gtpu_up = -1;
148 static int hf_gtp_rab_pdu_dn = -1;
149 static int hf_gtp_rab_pdu_up = -1;
150 static int hf_gtp_rai_mcc = -1;
151 static int hf_gtp_rai_mnc = -1;
152 static int hf_gtp_rai_rac = -1;
153 static int hf_gtp_rai_lac = -1;
154 static int hf_gtp_ranap_cause = -1;
155 static int hf_gtp_recovery = -1;
156 static int hf_gtp_reorder = -1;
157 static int hf_gtp_rnc_ipv4 = -1;
158 static int hf_gtp_rnc_ipv6 = -1;
159 static int hf_gtp_rp = -1;
160 static int hf_gtp_rp_nsapi = -1;
161 static int hf_gtp_rp_sms = -1;
162 static int hf_gtp_rp_spare = -1;
163 static int hf_gtp_sel_mode = -1;
164 static int hf_gtp_seq_number = -1;
165 static int hf_gtp_sndcp_number = -1;
166 static int hf_gtp_tear_ind = -1;
167 static int hf_gtp_teid = -1;
168 static int hf_gtp_teid_cp = -1;
169 static int hf_gtp_teid_data = -1;
170 static int hf_gtp_teid_ii = -1;
171 static int hf_gtp_tft_code = -1;
172 static int hf_gtp_tft_spare = -1;
173 static int hf_gtp_tft_number = -1;
174 static int hf_gtp_tft_eval = -1;
175 static int hf_gtp_tid = -1;
176 static int hf_gtp_tlli = -1;
177 static int hf_gtp_tr_comm = -1;
178 static int hf_gtp_trace_ref = -1;
179 static int hf_gtp_trace_type = -1;
180 static int hf_gtp_unknown = -1;
181 static int hf_gtp_user_addr_pdp_org = -1;
182 static int hf_gtp_user_addr_pdp_type = -1;
183 static int hf_gtp_user_ipv4 = -1;
184 static int hf_gtp_user_ipv6 = -1;
185 static int hf_gtp_security_mode = -1;
186 static int hf_gtp_no_of_vectors = -1;
187 static int hf_gtp_cipher_algorithm = -1;
188 static int hf_gtp_cksn_ksi = -1;
189 static int hf_gtp_cksn = -1;
190 static int hf_gtp_ksi = -1;
191 static int hf_gtp_ext_length = -1;
192 static int hf_gtp_ext_apn_res = -1;
193 static int hf_gtp_ext_rat_type = -1;
194 static int hf_gtp_ext_geo_loc_type = -1;
195 static int hf_gtp_ext_sac = -1;
196 static int hf_gtp_ext_imeisv = -1;
197 static int hf_gtp_targetid = -1;
198 static int hf_gtp_bssgp_cause = -1;
201 /* Initialize the subtree pointers */
202 static gint ett_gtp = -1;
203 static gint ett_gtp_flags = -1;
204 static gint ett_gtp_ext = -1;
205 static gint ett_gtp_rai = -1;
206 static gint ett_gtp_qos = -1;
207 static gint ett_gtp_auth_tri = -1;
208 static gint ett_gtp_flow_ii = -1;
209 static gint ett_gtp_rab_cntxt = -1;
210 static gint ett_gtp_rp = -1;
211 static gint ett_gtp_pkt_flow_id = -1;
212 static gint ett_gtp_chrg_char = -1;
213 static gint ett_gtp_user = -1;
214 static gint ett_gtp_mm = -1;
215 static gint ett_gtp_trip = -1;
216 static gint ett_gtp_quint = -1;
217 static gint ett_gtp_pdp = -1;
218 static gint ett_gtp_apn = -1;
219 static gint ett_gtp_proto = -1;
220 static gint ett_gtp_gsn_addr = -1;
221 static gint ett_gtp_tft = -1;
222 static gint ett_gtp_tft_pf = -1;
223 static gint ett_gtp_tft_flags = -1;
224 static gint ett_gtp_rab_setup = -1;
225 static gint ett_gtp_hdr_list = -1;
226 static gint ett_gtp_chrg_addr = -1;
227 static gint ett_gtp_node_addr = -1;
228 static gint ett_gtp_rel_pack = -1;
229 static gint ett_gtp_can_pack = -1;
230 static gint ett_gtp_data_resp = -1;
231 static gint ett_gtp_priv_ext = -1;
232 static gint ett_gtp_net_cap = -1;
233 static gint ett_gtp_ext_tree_apn_res = -1;
234 static gint ett_gtp_ext_rat_type = -1;
235 static gint ett_gtp_ext_imeisv = -1;
236 static gint ett_gtp_ext_ran_tr_cont = -1;
237 static gint ett_gtp_ext_pdp_cont_prio = -1;
238 static gint ett_gtp_ext_ssgn_no = -1;
239 static gint ett_gtp_ext_rab_setup_inf = -1;
240 static gint ett_gtp_ext_common_flgs = -1;
241 static gint ett_gtp_ext_usr_loc_inf = -1;
242 static gint ett_gtp_ext_ms_time_zone = -1;
243 static gint ett_gtp_ext_camel_chg_inf_con = -1;
244 static gint ett_GTP_EXT_MBMS_UE_CTX = -1;
245 static gint ett_gtp_ext_tmgi = -1;
246 static gint ett_gtp_ext_rim_ra = -1;
247 static gint ett_gtp_ext_mbms_prot_conf_opt = -1;
248 static gint ett_gtp_ext_mbms_sa = -1;
249 static gint ett_gtp_ext_bms_ses_dur = -1;
250 static gint ett_gtp_ext_src_rnc_pdp_ctx_inf = -1;
251 static gint ett_gtp_ext_add_trs_inf = -1;
252 static gint ett_gtp_ext_hop_count = -1;
253 static gint ett_gtp_ext_sel_plmn_id = -1;
254 static gint ett_gtp_ext_mbms_ses_id = -1;
255 static gint ett_gtp_ext_mbms_2g_3g_ind = -1;
256 static gint ett_gtp_ext_enh_nsapi = -1;
257 static gint ett_gtp_ext_ad_mbms_trs_inf = -1;
258 static gint ett_gtp_ext_mbms_ses_id_rep_no = -1;
259 static gint ett_gtp_ext_mbms_time_to_data_tr = -1;
260 static gint ett_gtp_ext_ps_ho_req_ctx = -1;
261 static gint ett_gtp_ext_bss_cont = -1;
262 static gint ett_gtp_ext_cell_id = -1;
263 static gint ett_gtp_ext_pdu_no = -1;
264 static gint ett_gtp_ext_bssgp_cause = -1;
265 static gint ett_gtp_ext_ra_prio_lcs = -1;
266 static gint ett_gtp_target_id = -1;
267 static gint ett_gtp_utran_cont = -1;
269 static gboolean gtp_tpdu = TRUE;
270 static gboolean gtp_over_tcp = TRUE;
271 static gboolean gtp_etsi_order = FALSE;
272 static guint gtpv0_port = 0;
273 static guint gtpv1c_port = 0;
274 static guint gtpv1u_port = 0;
276 /* Definition of flags masks */
277 #define GTP_VER_MASK 0xE0
279 static const value_string ver_types[] = {
280 { 0, "GTP release 97/98 version" },
281 { 1, "GTP release 99 version" },
290 static const value_string pt_types[] = {
296 #define GTP_PT_MASK 0x10
297 #define GTP_SPARE1_MASK 0x0E
298 #define GTP_SPARE2_MASK 0x08
299 #define GTP_E_MASK 0x04
300 #define GTP_S_MASK 0x02
301 #define GTP_SNN_MASK 0x01
302 #define GTP_PN_MASK 0x01
304 /* Definition of 3G charging characteristics masks */
305 #define GTP_MASK_CHRG_CHAR_S 0xF000
306 #define GTP_MASK_CHRG_CHAR_N 0x0800
307 #define GTP_MASK_CHRG_CHAR_P 0x0400
308 #define GTP_MASK_CHRG_CHAR_F 0x0200
309 #define GTP_MASK_CHRG_CHAR_H 0x0100
310 #define GTP_MASK_CHRG_CHAR_R 0x00FF
312 /* Traffic Flow Templates mask */
313 #define GTPv1_TFT_CODE_MASK 0xE0
314 #define GTPv1_TFT_SPARE_MASK 0x10
315 #define GTPv1_TFT_NUMBER_MASK 0x0F
317 /* Definition of GSN Address masks */
318 #define GTP_EXT_GSN_ADDR_TYPE_MASK 0xC0
319 #define GTP_EXT_GSN_ADDR_LEN_MASK 0x3F
321 /* Definition of QoS masks */
322 #define GTP_EXT_QOS_SPARE1_MASK 0xC0
323 #define GTP_EXT_QOS_DELAY_MASK 0x38
324 #define GTP_EXT_QOS_RELIABILITY_MASK 0x07
325 #define GTP_EXT_QOS_PEAK_MASK 0xF0
326 #define GTP_EXT_QOS_SPARE2_MASK 0x08
327 #define GTP_EXT_QOS_PRECEDENCE_MASK 0x07
328 #define GTP_EXT_QOS_SPARE3_MASK 0xE0
329 #define GTP_EXT_QOS_MEAN_MASK 0x1F
330 #define GTP_EXT_QOS_TRAF_CLASS_MASK 0xE0
331 #define GTP_EXT_QOS_DEL_ORDER_MASK 0x18
332 #define GTP_EXT_QOS_DEL_ERR_SDU_MASK 0x07
333 #define GTP_EXT_QOS_RES_BER_MASK 0xF0
334 #define GTP_EXT_QOS_SDU_ERR_RATIO_MASK 0x0F
335 #define GTP_EXT_QOS_TRANS_DELAY_MASK 0xFC
336 #define GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK 0x03
338 /* Definition of Radio Priority's masks */
339 #define GTPv1_EXT_RP_NSAPI_MASK 0xF0
340 #define GTPv1_EXT_RP_SPARE_MASK 0x08
341 #define GTPv1_EXT_RP_MASK 0x07
343 /* definitions of GTP messages */
344 #define GTP_MSG_UNKNOWN 0x00
345 #define GTP_MSG_ECHO_REQ 0x01
346 #define GTP_MSG_ECHO_RESP 0x02
347 #define GTP_MSG_VER_NOT_SUPP 0x03
348 #define GTP_MSG_NODE_ALIVE_REQ 0x04
349 #define GTP_MSG_NODE_ALIVE_RESP 0x05
350 #define GTP_MSG_REDIR_REQ 0x06
351 #define GTP_MSG_REDIR_RESP 0x07
352 #define GTP_MSG_CREATE_PDP_REQ 0x10
353 #define GTP_MSG_CREATE_PDP_RESP 0x11
354 #define GTP_MSG_UPDATE_PDP_REQ 0x12
355 #define GTP_MSG_UPDATE_PDP_RESP 0x13
356 #define GTP_MSG_DELETE_PDP_REQ 0x14
357 #define GTP_MSG_DELETE_PDP_RESP 0x15
358 #define GTP_MSG_CREATE_AA_PDP_REQ 0x16 /* 2G */
359 #define GTP_MSG_CREATE_AA_PDP_RESP 0x17 /* 2G */
360 #define GTP_MSG_DELETE_AA_PDP_REQ 0x18 /* 2G */
361 #define GTP_MSG_DELETE_AA_PDP_RESP 0x19 /* 2G */
362 #define GTP_MSG_ERR_IND 0x1A
363 #define GTP_MSG_PDU_NOTIFY_REQ 0x1B
364 #define GTP_MSG_PDU_NOTIFY_RESP 0x1C
365 #define GTP_MSG_PDU_NOTIFY_REJ_REQ 0x1D
366 #define GTP_MSG_PDU_NOTIFY_REJ_RESP 0x1E
367 #define GTP_MSG_SUPP_EXT_HDR 0x1F
368 #define GTP_MSG_SEND_ROUT_INFO_REQ 0x20
369 #define GTP_MSG_SEND_ROUT_INFO_RESP 0x21
370 #define GTP_MSG_FAIL_REP_REQ 0x22
371 #define GTP_MSG_FAIL_REP_RESP 0x23
372 #define GTP_MSG_MS_PRESENT_REQ 0x24
373 #define GTP_MSG_MS_PRESENT_RESP 0x25
374 #define GTP_MSG_IDENT_REQ 0x30
375 #define GTP_MSG_IDENT_RESP 0x31
376 #define GTP_MSG_SGSN_CNTXT_REQ 0x32
377 #define GTP_MSG_SGSN_CNTXT_RESP 0x33
378 #define GTP_MSG_SGSN_CNTXT_ACK 0x34
379 #define GTP_MSG_FORW_RELOC_REQ 0x35
380 #define GTP_MSG_FORW_RELOC_RESP 0x36
381 #define GTP_MSG_FORW_RELOC_COMP 0x37
382 #define GTP_MSG_RELOC_CANCEL_REQ 0x38
383 #define GTP_MSG_RELOC_CANCEL_RESP 0x39
384 #define GTP_MSG_FORW_SRNS_CNTXT 0x3A
385 #define GTP_MSG_FORW_RELOC_ACK 0x3B
386 #define GTP_MSG_FORW_SRNS_CNTXT_ACK 0x3C
388 #define GTP_MSG_RAN_INFO_RELAY 70
389 #define GTP_MBMS_NOTIFY_REQ 96
390 #define GTP_MBMS_NOTIFY_RES 97
391 #define GTP_MBMS_NOTIFY_REJ_REQ 98
392 #define GTP_MBMS_NOTIFY_REJ_RES 99
393 #define GTP_CREATE_MBMS_CNTXT_REQ 100
394 #define GTP_CREATE_MBMS_CNTXT_RES 101
395 #define GTP_UPD_MBMS_CNTXT_REQ 102
396 #define GTP_UPD_MBMS_CNTXT_RES 103
397 #define GTP_DEL_MBMS_CNTXT_REQ 104
398 #define GTP_DEL_MBMS_CNTXT_RES 105
399 #define GTP_MBMS_REG_REQ 112
400 #define GTP_MBMS_REG_RES 113
401 #define GTP_MBMS_DE_REG_REQ 114
402 #define GTP_MBMS_DE_REG_RES 115
403 #define GTP_MBMS_SES_START_REQ 116
404 #define GTP_MBMS_SES_START_RES 117
405 #define GTP_MBMS_SES_STOP_REQ 118
406 #define GTP_MBMS_SES_STOP_RES 119
407 #define GTP_MSG_DATA_TRANSF_REQ 0xF0
408 #define GTP_MSG_DATA_TRANSF_RESP 0xF1
409 #define GTP_MSG_TPDU 0xFF
411 static const value_string message_type[] = {
412 { GTP_MSG_UNKNOWN, "For future use" },
413 { GTP_MSG_ECHO_REQ, "Echo request" },
414 { GTP_MSG_ECHO_RESP, "Echo response" },
415 { GTP_MSG_VER_NOT_SUPP, "Version not supported" },
416 { GTP_MSG_NODE_ALIVE_REQ, "Node alive request" },
417 { GTP_MSG_NODE_ALIVE_RESP, "Node alive response" },
418 { GTP_MSG_REDIR_REQ, "Redirection request" },
419 { GTP_MSG_REDIR_RESP, "Redirection response" },
420 { GTP_MSG_CREATE_PDP_REQ, "Create PDP context request" },
421 { GTP_MSG_CREATE_PDP_RESP, "Create PDP context response" },
422 { GTP_MSG_UPDATE_PDP_REQ, "Update PDP context request" },
423 { GTP_MSG_UPDATE_PDP_RESP, "Update PDP context response" },
424 { GTP_MSG_DELETE_PDP_REQ, "Delete PDP context request" },
425 { GTP_MSG_DELETE_PDP_RESP, "Delete PDP context response" },
426 { GTP_MSG_CREATE_AA_PDP_REQ, "Create AA PDP Context Request" },
427 { GTP_MSG_CREATE_AA_PDP_RESP, "Create AA PDP Context Response" },
428 { GTP_MSG_DELETE_AA_PDP_REQ, "Delete AA PDP Context Request" },
429 { GTP_MSG_DELETE_AA_PDP_RESP, "Delete AA PDP Context Response" },
430 { GTP_MSG_ERR_IND, "Error indication" },
431 { GTP_MSG_PDU_NOTIFY_REQ, "PDU notification request" },
432 { GTP_MSG_PDU_NOTIFY_RESP, "PDU notification response" },
433 { GTP_MSG_PDU_NOTIFY_REJ_REQ, "PDU notification reject request" },
434 { GTP_MSG_PDU_NOTIFY_REJ_RESP, "PDU notification reject response" },
435 { GTP_MSG_SUPP_EXT_HDR, "Supported extension header notification" },
436 { GTP_MSG_SEND_ROUT_INFO_REQ, "Send routing information for GPRS request" },
437 { GTP_MSG_SEND_ROUT_INFO_RESP, "Send routing information for GPRS response" },
438 { GTP_MSG_FAIL_REP_REQ, "Failure report request" },
439 { GTP_MSG_FAIL_REP_RESP, "Failure report response" },
440 { GTP_MSG_MS_PRESENT_REQ, "Note MS GPRS present request" },
441 { GTP_MSG_MS_PRESENT_RESP, "Note MS GPRS present response" },
442 { GTP_MSG_IDENT_REQ, "Identification request" },
443 { GTP_MSG_IDENT_RESP, "Identification response" },
444 { GTP_MSG_SGSN_CNTXT_REQ, "SGSN context request" },
445 { GTP_MSG_SGSN_CNTXT_RESP, "SGSN context response" },
446 { GTP_MSG_SGSN_CNTXT_ACK, "SGSN context acknowledgement" },
447 { GTP_MSG_FORW_RELOC_REQ, "Forward relocation request" },
448 { GTP_MSG_FORW_RELOC_RESP, "Forward relocation response" },
449 { GTP_MSG_FORW_RELOC_COMP, "Forward relocation complete" },
450 { GTP_MSG_RELOC_CANCEL_REQ, "Relocation cancel request" },
451 { GTP_MSG_RELOC_CANCEL_RESP, "Relocation cancel response" },
452 { GTP_MSG_FORW_SRNS_CNTXT, "Forward SRNS context" },
453 { GTP_MSG_FORW_RELOC_ACK, "Forward relocation complete acknowledge" },
454 { GTP_MSG_FORW_SRNS_CNTXT_ACK, "Forward SRNS context acknowledge" },
455 { GTP_MSG_RAN_INFO_RELAY, "RAN Information Relay" },
456 { GTP_MBMS_NOTIFY_REQ, "MBMS Notification Request" },
457 { GTP_MBMS_NOTIFY_RES, "MBMS Notification Response" },
458 { GTP_MBMS_NOTIFY_REJ_REQ, "MBMS Notification Reject Request" },
459 { GTP_MBMS_NOTIFY_REJ_RES, "MBMS Notification Reject Response" },
460 { GTP_CREATE_MBMS_CNTXT_REQ, "Create MBMS Context Request" },
461 { GTP_CREATE_MBMS_CNTXT_RES, "Create MBMS Context Response" },
462 { GTP_UPD_MBMS_CNTXT_REQ, "Update MBMS Context Request" },
463 { GTP_UPD_MBMS_CNTXT_RES, "Update MBMS Context Response" },
464 { GTP_DEL_MBMS_CNTXT_REQ, "Delete MBMS Context Request" },
465 { GTP_DEL_MBMS_CNTXT_RES, "Delete MBMS Context Response" },
466 { GTP_MBMS_REG_REQ, "MBMS Registration Request" },
467 { GTP_MBMS_REG_RES, "MBMS Registration Response" },
468 { GTP_MBMS_DE_REG_REQ, "MBMS De-Registration Request" },
469 { GTP_MBMS_DE_REG_RES, "MBMS De-Registration Response" },
470 { GTP_MBMS_SES_START_REQ, "MBMS Session Start Request" },
471 { GTP_MBMS_SES_START_RES, "MBMS Session Start Response" },
472 { GTP_MBMS_SES_STOP_REQ, "MBMS Session Stop Request" },
473 { GTP_MBMS_SES_STOP_RES, "MBMS Session Stop Response" },
474 { GTP_MSG_DATA_TRANSF_REQ, "Data record transfer request" },
475 { GTP_MSG_DATA_TRANSF_RESP, "Data record transfer response" },
476 { GTP_MSG_TPDU, "T-PDU" },
480 /* definitions of fields in extension header */
481 #define GTP_EXT_CAUSE 0x01
482 #define GTP_EXT_IMSI 0x02
483 #define GTP_EXT_RAI 0x03
484 #define GTP_EXT_TLLI 0x04
485 #define GTP_EXT_PTMSI 0x05
486 #define GTP_EXT_QOS_GPRS 0x06
487 #define GTP_EXT_REORDER 0x08
488 #define GTP_EXT_AUTH_TRI 0x09
489 #define GTP_EXT_MAP_CAUSE 0x0B
490 #define GTP_EXT_PTMSI_SIG 0x0C
491 #define GTP_EXT_MS_VALID 0x0D
492 #define GTP_EXT_RECOVER 0x0E
493 #define GTP_EXT_SEL_MODE 0x0F
495 #define GTP_EXT_16 0x10
496 #define GTP_EXT_FLOW_LABEL 0x10
497 #define GTP_EXT_TEID 0x10 /* 0xFF10 3G */
499 #define GTP_EXT_17 0x11
500 #define GTP_EXT_FLOW_SIG 0x11
501 #define GTP_EXT_TEID_CP 0x11 /* 0xFF11 3G */
503 #define GTP_EXT_18 0x12
504 #define GTP_EXT_FLOW_II 0x12
505 #define GTP_EXT_TEID_II 0x12 /* 0xFF12 3G*/
507 #define GTP_EXT_19 0x13
508 #define GTP_EXT_MS_REASON 0x13 /* same as 0x1D GTPv1_EXT_MS_REASON */
509 #define GTP_EXT_TEAR_IND 0x13 /* 0xFF13 3G*/
511 #define GTP_EXT_NSAPI 0x14 /* 3G */
512 #define GTP_EXT_RANAP_CAUSE 0x15 /* 3G */
513 #define GTP_EXT_RAB_CNTXT 0x16 /* 3G */
514 #define GTP_EXT_RP_SMS 0x17 /* 3G */
515 #define GTP_EXT_RP 0x18 /* 3G */
516 #define GTP_EXT_PKT_FLOW_ID 0x19 /* 3G */
517 #define GTP_EXT_CHRG_CHAR 0x1A /* 3G */
518 #define GTP_EXT_TRACE_REF 0x1B /* 3G */
519 #define GTP_EXT_TRACE_TYPE 0x1C /* 3G */
520 #define GTPv1_EXT_MS_REASON 0x1D /* 3G */
521 #define GTP_EXT_TR_COMM 0x7E /* charging */
522 #define GTP_EXT_CHRG_ID 0x7F
523 #define GTP_EXT_USER_ADDR 0x80
524 #define GTP_EXT_MM_CNTXT 0x81
525 #define GTP_EXT_PDP_CNTXT 0x82
526 #define GTP_EXT_APN 0x83
527 #define GTP_EXT_PROTO_CONF 0x84
528 #define GTP_EXT_GSN_ADDR 0x85
529 #define GTP_EXT_MSISDN 0x86
530 #define GTP_EXT_QOS_UMTS 0x87 /* 3G */
531 #define GTP_EXT_AUTH_QUI 0x88 /* 3G */
532 #define GTP_EXT_TFT 0x89 /* 3G */
533 #define GTP_EXT_TARGET_ID 0x8A /* 3G */
534 #define GTP_EXT_UTRAN_CONT 0x8B /* 3G */
535 #define GTP_EXT_RAB_SETUP 0x8C /* 3G */
536 #define GTP_EXT_HDR_LIST 0x8D /* 3G */
537 #define GTP_EXT_TRIGGER_ID 0x8E /* 3G 142 7.7.41 */
538 #define GTP_EXT_OMC_ID 0x8F /* 3G 143 TLV OMC Identity 7.7.42 */
539 #define GTP_EXT_RAN_TR_CONT 0x90 /* 3G 144 TLV RAN Transparent Container 7.7.43 */
540 #define GTP_EXT_PDP_CONT_PRIO 0x91 /* 3G 145 TLV PDP Context Prioritization 7.7.45 */
541 #define GTP_EXT_ADD_RAB_SETUP_INF 0x92 /* 3G 146 TLV Additional RAB Setup Information 7.7.45A */
542 #define GTP_EXT_SSGN_NO 0x93 /* 3G 147 TLV SGSN Number 7.7.47 */
543 #define GTP_EXT_COMMON_FLGS 0x94 /* 3G 148 TLV Common Flags 7.7.48 */
544 #define GTP_EXT_APN_RES 0x95 /* 3G 149 */
545 #define GTP_EXT_RA_PRIO_LCS 0x96 /* 3G 150 TLV Radio Priority LCS 7.7.25B */
546 #define GTP_EXT_RAT_TYPE 0x97 /* 3G 151 TLV RAT Type 7.7.50 */
547 #define GTP_EXT_USR_LOC_INF 0x98 /* 3G 152 TLV User Location Information 7.7.51 */
548 #define GTP_EXT_MS_TIME_ZONE 0x99 /* 3G 153 TLV MS Time Zone 7.7.52 */
550 #define GTP_EXT_IMEISV 0x9A /* 3G */
551 #define GTP_EXT_CAMEL_CHG_INF_CON 0x9B /* 3G 155 TLV CAMEL Charging Information Container 7.7.54 */
552 #define GTP_EXT_MBMS_UE_CTX 0x9C /* 3G 156 TLV MBMS UE Context 7.7.55 */
553 #define GTP_EXT_TMGI 0x9D /* 3G 157 TLV Temporary Mobile Group Identity (TMGI) 7.7.56 */
554 #define GTP_EXT_RIM_RA 0x9E /* 3G 158 TLV RIM Routing Address 7.7.57 */
555 #define GTP_EXT_MBMS_PROT_CONF_OPT 0x9F /* 3G 159 TLV MBMS Protocol Configuration Options 7.7.58 */
556 #define GTP_EXT_MBMS_SA 0xA0 /* 3G 160 TLV MBMS Service Area 7.7.60 */
557 #define GTP_EXT_SRC_RNC_PDP_CTX_INF 0xA1 /* 3G 161 TLV Source RNC PDCP context info 7.7.61 */
558 #define GTP_EXT_ADD_TRS_INF 0xA2 /* 3G 162 TLV Additional Trace Info 7.7.62 */
559 #define GTP_EXT_HOP_COUNT 0xA3 /* 3G 163 TLV Hop Counter 7.7.63 */
560 #define GTP_EXT_SEL_PLMN_ID 0xA4 /* 3G 164 TLV Selected PLMN ID 7.7.64 */
561 #define GTP_EXT_MBMS_SES_ID 0xA5 /* 3G 165 TLV MBMS Session Identifier 7.7.65 */
562 #define GTP_EXT_MBMS_2G_3G_IND 0xA6 /* 3G 166 TLV MBMS 2G/3G Indicator 7.7.66 */
563 #define GTP_EXT_ENH_NSAPI 0xA7 /* 3G 167 TLV Enhanced NSAPI 7.7.67 */
564 #define GTP_EXT_MBMS_SES_DUR 0xA8 /* 3G 168 TLV MBMS Session Duration 7.7.59 */
565 #define GTP_EXT_ADD_MBMS_TRS_INF 0xA9 /* 3G 169 TLV Additional MBMS Trace Info 7.7.68 */
566 #define GTP_EXT_MBMS_SES_ID_REP_NO 0xAA /* 3G 170 TLV MBMS Session Identity Repetition Number 7.7.69 */
567 #define GTP_EXT_MBMS_TIME_TO_DATA_TR 0xAB /* 3G 171 TLV MBMS Time To Data Transfer 7.7.70 */
568 #define GTP_EXT_PS_HO_REQ_CTX 0xAC /* 3G 172 TLV PS Handover Request Context 7.7.71 */
569 #define GTP_EXT_BSS_CONT 0xAD /* 3G 173 TLV BSS Container 7.7.72 */
570 #define GTP_EXT_CELL_ID 0xAE /* 3G 174 TLV Cell Identification 7.7.73 */
571 #define GTP_EXT_PDU_NO 0xAF /* 3G 175 TLV PDU Numbers 7.7.74 */
572 #define GTP_EXT_BSSGP_CAUSE 0xA0 /* 3G 176 TLV BSSGP Cause 7.7.75 */
574 #define GTP_EXT_C1 0xC1
575 #define GTP_EXT_C2 0xC2
576 #define GTP_EXT_REL_PACK 0xF9 /* charging */
577 #define GTP_EXT_CAN_PACK 0xFA /* charging */
578 #define GTP_EXT_CHRG_ADDR 0xFB
579 #define GTP_EXT_DATA_REQ 0xFC /* charging */
580 #define GTP_EXT_DATA_RESP 0xFD /* charging */
581 #define GTP_EXT_NODE_ADDR 0xFE /* charging */
582 #define GTP_EXT_PRIV_EXT 0xFF
584 static const value_string gtp_val[] = {
585 { GTP_EXT_CAUSE, "Cause of operation" },
586 { GTP_EXT_IMSI, "IMSI" },
587 { GTP_EXT_RAI, "Routing Area Identity" },
588 { GTP_EXT_TLLI, "Temporary Logical Link Identity" },
589 { GTP_EXT_PTMSI, "Packet TMSI" },
590 { GTP_EXT_QOS_GPRS, "Quality of Service" },
591 { GTP_EXT_REORDER, "Reorder required" },
592 { GTP_EXT_AUTH_TRI, "Authentication triplets" },
593 { GTP_EXT_MAP_CAUSE, "MAP cause" },
594 { GTP_EXT_PTMSI_SIG, "P-TMSI signature" },
595 { GTP_EXT_MS_VALID, "MS validated" },
596 { GTP_EXT_RECOVER, "Recovery" },
597 { GTP_EXT_SEL_MODE, "Selection mode" },
599 { GTP_EXT_16, "Flow label data I" },
600 { GTP_EXT_FLOW_LABEL, "Flow label data I" },
601 { GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I" }, /* 3G */
603 { GTP_EXT_17, "Flow label signalling" },
604 { GTP_EXT_FLOW_SIG, "Flow label signalling" },
605 { GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane" }, /* 3G */
607 { GTP_EXT_18, "Flow label data II" },
608 { GTP_EXT_FLOW_II, "Flow label data II" },
609 { GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II" }, /* 3G */
611 { GTP_EXT_19, "MS not reachable reason" },
612 { GTP_EXT_MS_REASON, "MS not reachable reason" },
613 { GTP_EXT_TEAR_IND, "Teardown ID" }, /* 3G */
615 { GTP_EXT_NSAPI, "NSAPI" }, /* 3G */
616 { GTP_EXT_RANAP_CAUSE, "RANAP cause" }, /* 3G */
617 { GTP_EXT_RAB_CNTXT, "RAB context" }, /* 3G */
618 { GTP_EXT_RP_SMS, "Radio Priority for MO SMS" }, /* 3G */
619 { GTP_EXT_RP, "Radio Priority" }, /* 3G */
620 { GTP_EXT_PKT_FLOW_ID, "Packet Flow ID" }, /* 3G */
621 { GTP_EXT_CHRG_CHAR, "Charging characteristics" }, /* 3G */
622 { GTP_EXT_TRACE_REF, "Trace references" }, /* 3G */
623 { GTP_EXT_TRACE_TYPE, "Trace type" }, /* 3G */
624 { GTPv1_EXT_MS_REASON, "MS not reachable reason" }, /* 3G */
625 { GTP_EXT_TR_COMM, "Packet transfer command" }, /* charging */
626 { GTP_EXT_CHRG_ID, "Charging ID" },
627 { GTP_EXT_USER_ADDR, "End user address" },
628 { GTP_EXT_MM_CNTXT, "MM context" },
629 { GTP_EXT_PDP_CNTXT, "PDP context" },
630 { GTP_EXT_APN, "Access Point Name" },
631 { GTP_EXT_PROTO_CONF, "Protocol configuration options" },
632 { GTP_EXT_GSN_ADDR, "GSN address" },
633 { GTP_EXT_MSISDN, "MS international PSTN/ISDN number" },
634 { GTP_EXT_QOS_UMTS, "Quality of service (UMTS)" }, /* 3G */
635 { GTP_EXT_AUTH_QUI, "Authentication quintuplets" }, /* 3G */
636 { GTP_EXT_TFT, "Traffic Flow Template (TFT)" }, /* 3G */
637 { GTP_EXT_TARGET_ID, "Target (RNC) identification" }, /* 3G */
638 { GTP_EXT_UTRAN_CONT, "UTRAN transparent field" }, /* 3G */
639 { GTP_EXT_RAB_SETUP, "RAB setup information" }, /* 3G */
640 { GTP_EXT_HDR_LIST, "Extension Header Types List" }, /* 3G */
641 { GTP_EXT_TRIGGER_ID, "Trigger Id" }, /* 3G */
642 { GTP_EXT_OMC_ID, "OMC Identity" }, /* 3G */
644 { GTP_EXT_RAN_TR_CONT, "RAN Transparent Container" }, /* 7.7.43 */
645 { GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization" }, /* 7.7.45 */
646 { GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information" }, /* 7.7.45A */
647 { GTP_EXT_SSGN_NO, "SGSN Number" }, /* 7.7.47 */
648 { GTP_EXT_COMMON_FLGS, "Common Flags" }, /* 7.7.48 */
649 { GTP_EXT_APN_RES, "APN Restriction" }, /* 3G */
650 { GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS" }, /* 7.7.25B */
651 { GTP_EXT_RAT_TYPE, "RAT Type" }, /* 3G */
652 { GTP_EXT_USR_LOC_INF, "User Location Information" }, /* 7.7.51 */
653 { GTP_EXT_MS_TIME_ZONE, "MS Time Zone" }, /* 7.7.52 */
655 { GTP_EXT_IMEISV, "IMEI(SV)" }, /* 3G */
656 { GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container" }, /* 7.7.54 */
657 { GTP_EXT_MBMS_UE_CTX, "MBMS UE Context" }, /* 7.7.55 */
658 { GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)" }, /* 7.7.56 */
659 { GTP_EXT_RIM_RA, "RIM Routing Address" }, /* 7.7.57 */
660 { GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options" }, /* 7.7.58 */
661 { GTP_EXT_MBMS_SA, "MBMS Service Area" }, /* 7.7.60 */
662 { GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info" }, /* 7.7.61 */
663 { GTP_EXT_ADD_TRS_INF, "Additional Trace Info" }, /* 7.7.62 */
664 { GTP_EXT_HOP_COUNT, "Hop Counter" }, /* 7.7.63 */
665 { GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID" }, /* 7.7.64 */
666 { GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier" }, /* 7.7.65 */
667 { GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator" }, /* 7.7.66 */
668 { GTP_EXT_ENH_NSAPI, "Enhanced NSAPI" }, /* 7.7.67 */
669 { GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration" }, /* 7.7.59 */
670 { GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info" }, /* 7.7.68 */
671 { GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number" }, /* 7.7.69 */
672 { GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer" }, /* 7.7.70 */
673 { GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context" }, /* 7.7.71 */
674 { GTP_EXT_BSS_CONT, "BSS Container" }, /* 7.7.72 */
675 { GTP_EXT_CELL_ID, "Cell Identification" }, /* 7.7.73 */
676 { GTP_EXT_PDU_NO, "PDU Numbers" }, /* 7.7.74 */
677 { GTP_EXT_BSSGP_CAUSE, "BSSGP Cause" }, /* 7.7.75 */
678 { GTP_EXT_REL_PACK, "Sequence numbers of released packets IE" }, /* charging */
679 { GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE" }, /* charging */
680 { GTP_EXT_CHRG_ADDR, "Charging Gateway address" },
681 { GTP_EXT_DATA_REQ, "Data record packet" }, /* charging */
682 { GTP_EXT_DATA_RESP, "Requests responded" }, /* charging */
683 { GTP_EXT_NODE_ADDR, "Address of recommended node" }, /* charging */
684 { GTP_EXT_PRIV_EXT, "Private Extension" },
687 /* It seems like some IE's are renamed in gtpv1 at least reading
688 * 3GPP TS 29.060 version 6.11.0 Release 6
690 static const value_string gtpv1_val[] = {
691 { GTP_EXT_CAUSE, "Cause of operation" },
692 { GTP_EXT_IMSI, "IMSI" },
693 { GTP_EXT_RAI, "Routing Area Identity" },
694 { GTP_EXT_TLLI, "Temporary Logical Link Identity" },
695 { GTP_EXT_PTMSI, "Packet TMSI" },
696 { GTP_EXT_QOS_GPRS, "Quality of Service" },
697 { GTP_EXT_REORDER, "Reorder required" },
698 { GTP_EXT_AUTH_TRI, "Authentication triplets" },
699 { GTP_EXT_MAP_CAUSE, "MAP cause" },
700 { GTP_EXT_PTMSI_SIG, "P-TMSI signature" },
701 { GTP_EXT_MS_VALID, "MS validated" },
702 { GTP_EXT_RECOVER, "Recovery" },
703 { GTP_EXT_SEL_MODE, "Selection mode" },
705 { GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I" }, /* 3G */
707 { GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane" }, /* 3G */
709 { GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II" }, /* 3G */
711 { GTP_EXT_TEAR_IND, "Teardown ID" }, /* 3G */
713 { GTP_EXT_NSAPI, "NSAPI" }, /* 3G */
714 { GTP_EXT_RANAP_CAUSE, "RANAP cause" }, /* 3G */
715 { GTP_EXT_RAB_CNTXT, "RAB context" }, /* 3G */
716 { GTP_EXT_RP_SMS, "Radio Priority for MO SMS" }, /* 3G */
717 { GTP_EXT_RP, "Radio Priority" }, /* 3G */
718 { GTP_EXT_PKT_FLOW_ID, "Packet Flow ID" }, /* 3G */
719 { GTP_EXT_CHRG_CHAR, "Charging characteristics" }, /* 3G */
720 { GTP_EXT_TRACE_REF, "Trace references" }, /* 3G */
721 { GTP_EXT_TRACE_TYPE, "Trace type" }, /* 3G */
722 { GTPv1_EXT_MS_REASON, "MS not reachable reason" }, /* 3G */
723 { GTP_EXT_TR_COMM, "Packet transfer command" }, /* charging */
724 { GTP_EXT_CHRG_ID, "Charging ID" },
725 { GTP_EXT_USER_ADDR, "End user address" },
726 { GTP_EXT_MM_CNTXT, "MM context" },
727 { GTP_EXT_PDP_CNTXT, "PDP context" },
728 { GTP_EXT_APN, "Access Point Name" },
729 { GTP_EXT_PROTO_CONF, "Protocol configuration options" },
730 { GTP_EXT_GSN_ADDR, "GSN address" },
731 { GTP_EXT_MSISDN, "MS international PSTN/ISDN number" },
732 { GTP_EXT_QOS_UMTS, "Quality of service (UMTS)" }, /* 3G */
733 { GTP_EXT_AUTH_QUI, "Authentication quintuplets" }, /* 3G */
734 { GTP_EXT_TFT, "Traffic Flow Template (TFT)" }, /* 3G */
735 { GTP_EXT_TARGET_ID, "Target (RNC) identification" }, /* 3G */
736 { GTP_EXT_UTRAN_CONT, "UTRAN transparent field" }, /* 3G */
737 { GTP_EXT_RAB_SETUP, "RAB setup information" }, /* 3G */
738 { GTP_EXT_HDR_LIST, "Extension Header Types List" }, /* 3G */
739 { GTP_EXT_TRIGGER_ID, "Trigger Id" }, /* 3G */
740 { GTP_EXT_OMC_ID, "OMC Identity" }, /* 3G */
742 { GTP_EXT_RAN_TR_CONT, "RAN Transparent Container" }, /* 7.7.43 */
743 { GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization" }, /* 7.7.45 */
744 { GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information" }, /* 7.7.45A */
745 { GTP_EXT_SSGN_NO, "SGSN Number" }, /* 7.7.47 */
746 { GTP_EXT_COMMON_FLGS, "Common Flags" }, /* 7.7.48 */
747 { GTP_EXT_APN_RES, "APN Restriction" }, /* 3G */
748 { GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS" }, /* 7.7.25B */
749 { GTP_EXT_RAT_TYPE, "RAT Type" }, /* 3G */
750 { GTP_EXT_USR_LOC_INF, "User Location Information" }, /* 7.7.51 */
751 { GTP_EXT_MS_TIME_ZONE, "MS Time Zone" }, /* 7.7.52 */
753 { GTP_EXT_IMEISV, "IMEI(SV)" }, /* 3G */
754 { GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container" }, /* 7.7.54 */
755 { GTP_EXT_MBMS_UE_CTX, "MBMS UE Context" }, /* 7.7.55 */
756 { GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)" }, /* 7.7.56 */
757 { GTP_EXT_RIM_RA, "RIM Routing Address" }, /* 7.7.57 */
758 { GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options" }, /* 7.7.58 */
759 { GTP_EXT_MBMS_SA, "MBMS Service Area" }, /* 7.7.60 */
760 { GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info" }, /* 7.7.61 */
761 { GTP_EXT_ADD_TRS_INF, "Additional Trace Info" }, /* 7.7.62 */
762 { GTP_EXT_HOP_COUNT, "Hop Counter" }, /* 7.7.63 */
763 { GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID" }, /* 7.7.64 */
764 { GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier" }, /* 7.7.65 */
765 { GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator" }, /* 7.7.66 */
766 { GTP_EXT_ENH_NSAPI, "Enhanced NSAPI" }, /* 7.7.67 */
767 { GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration" }, /* 7.7.59 */
768 { GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info" }, /* 7.7.68 */
769 { GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number" }, /* 7.7.69 */
770 { GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer" }, /* 7.7.70 */
771 { GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context" }, /* 7.7.71 */
772 { GTP_EXT_BSS_CONT, "BSS Container" }, /* 7.7.72 */
773 { GTP_EXT_CELL_ID, "Cell Identification" }, /* 7.7.73 */
774 { GTP_EXT_PDU_NO, "PDU Numbers" }, /* 7.7.74 */
775 { GTP_EXT_BSSGP_CAUSE, "BSSGP Cause" }, /* 7.7.75 */
776 { GTP_EXT_REL_PACK, "Sequence numbers of released packets IE" }, /* charging */
777 { GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE" }, /* charging */
778 { GTP_EXT_CHRG_ADDR, "Charging Gateway address" },
779 { GTP_EXT_DATA_REQ, "Data record packet" }, /* charging */
780 { GTP_EXT_DATA_RESP, "Requests responded" }, /* charging */
781 { GTP_EXT_NODE_ADDR, "Address of recommended node" }, /* charging */
782 { GTP_EXT_PRIV_EXT, "Private Extension" },
785 /* GPRS: 9.60 v7.6.0, page 37
786 * UMTS: 29.060 v4.0, page 45
788 static const value_string cause_type[] = {
789 { 0, "Request IMSI" },
790 { 1, "Request IMEI" },
791 { 2, "Request IMSI and IMEI" },
792 { 3, "No identity needed" },
794 { 5, "MS is not GPRS responding" },
795 { 59, "System failure" }, /* charging */
796 { 60, "The transmit buffers are becoming full" }, /* charging */
797 { 61, "The receive buffers are becoming full" }, /* charging */
798 { 62, "Another node is about to go down" }, /* charging */
799 { 63, "This node is about to go down" }, /* charging */
800 { 128, "Request accepted" },
801 { 192, "Non-existent" },
802 { 193, "Invalid message format" },
803 { 194, "IMSI not known" },
804 { 195, "MS is GPRS detached" },
805 { 196, "MS is not GPRS responding" },
806 { 197, "MS refuses" },
807 { 198, "Version not supported" },
808 { 199, "No resource available" },
809 { 200, "Service not supported" },
810 { 201, "Mandatory IE incorrect" },
811 { 202, "Mandatory IE missing" },
812 { 203, "Optional IE incorrect" },
813 { 204, "System failure" },
814 { 205, "Roaming restriction" },
815 { 206, "P-TMSI signature mismatch" },
816 { 207, "GPRS connection suspended" },
817 { 208, "Authentication failure" },
818 { 209, "User authentication failed" },
819 { 210, "Context not found" },
820 { 211, "All PDP dynamic addresses are occupied" },
821 { 212, "No memory is available" },
822 { 213, "Relocation failure" },
823 { 214, "Unknown mandatory extension header" },
824 { 215, "Semantic error in the TFT operation" },
825 { 216, "Syntactic error in the TFT operation" },
826 { 217, "Semantic errors in packet filter(s)" },
827 { 218, "Syntactic errors in packet filter(s)" },
828 { 219, "Missing or unknown APN" },
829 { 220, "Unknown PDP address or PDP type" },
830 { 221, "PDP context without TFT already activated" },
831 { 222, "APN access denied - no subscription" },
832 { 223, "APN Restriction type incompatibility with currently active PDP Contexts" },
833 { 224, "MS MBMS Capabilities Insufficient" },
834 { 252, "Request related to possibly duplicated packets already fulfilled" }, /* charging */
835 { 253, "Request already fulfilled" }, /* charging */
836 { 254, "Sequence numbers of released/cancelled packets IE incorrect" }, /* charging */
837 { 255, "Request not fulfilled" }, /* charging */
842 * UMTS: 29.002 v4.2.1, chapter 17.5, page 268
843 * Imported gsm_map_GSMMAPLocalErrorcode_vals from gsm_map from gsm_map
846 static const value_string gsn_addr_type[] = {
852 static const value_string pdp_type[] = {
855 { 0x02, "OSP:IHOSS" },
861 static const value_string pdp_org_type[] = {
867 static const value_string qos_delay_type[] = {
868 { 0x00, "Subscribed delay class (in MS to network direction)" },
869 { 0x01, "Delay class 1" },
870 { 0x02, "Delay class 2" },
871 { 0x03, "Delay class 3" },
872 { 0x04, "Delay class 4 (best effort)" },
873 { 0x07, "Reserved" },
877 static const value_string qos_reliability_type[] = {
878 { 0x00, "Subscribed reliability class (in MS to network direction)" },
879 { 0x01, "Ack GTP/LLC/RLC, Protected data" },
880 { 0x02, "Unack GTP, Ack LLC/RLC, Protected data" },
881 { 0x03, "Unack GTP/LLC, Ack RLC, Protected data" },
882 { 0x04, "Unack GTP/LLC/RLC, Protected data" },
883 { 0x05, "Unack GTP/LLC/RLC, Unprotected data" },
884 { 0x07, "Reserved" },
888 static const value_string qos_peak_type[] = {
889 { 0x00, "Subscribed peak throughput (in MS to network direction)" },
890 { 0x01, "Up to 1 000 oct/s" },
891 { 0x02, "Up to 2 000 oct/s" },
892 { 0x03, "Up to 4 000 oct/s" },
893 { 0x04, "Up to 8 000 oct/s" },
894 { 0x05, "Up to 16 000 oct/s" },
895 { 0x06, "Up to 32 000 oct/s" },
896 { 0x07, "Up to 64 000 oct/s" },
897 { 0x08, "Up to 128 000 oct/s" },
898 { 0x09, "Up to 256 000 oct/s" },
899 /* QoS Peak throughput classes from 0x0A to 0x0F (from 10 to 15) are subscribed */
900 { 0x0A, "Reserved" },
901 { 0x0B, "Reserved" },
902 { 0x0C, "Reserved" },
903 { 0x0D, "Reserved" },
904 { 0x0E, "Reserved" },
905 { 0x0F, "Reserved" },
909 static const value_string qos_precedence_type[] = {
910 { 0x00, "Subscribed precedence (in MS to network direction)" },
911 { 0x01, "High priority" },
912 { 0x02, "Normal priority" },
913 { 0x03, "Low priority" },
914 { 0x07, "Reserved" },
918 static const value_string qos_mean_type[] = {
919 { 0x00, "Subscribed mean throughput (in MS to network direction)" },
920 { 0x01, "100 oct/h" }, /* Class 2 */
921 { 0x02, "200 oct/h" }, /* Class 3 */
922 { 0x03, "500 oct/h" }, /* Class 4 */
923 { 0x04, "1 000 oct/h" }, /* Class 5 */
924 { 0x05, "2 000 oct/h" }, /* Class 6 */
925 { 0x06, "5 000 oct/h" }, /* Class 7 */
926 { 0x07, "10 000 oct/h" }, /* Class 8 */
927 { 0x08, "20 000 oct/h" }, /* Class 9 */
928 { 0x09, "50 000 oct/h" }, /* Class 10 */
929 { 0x0A, "100 000 oct/h" }, /* Class 11 */
930 { 0x0B, "200 000 oct/h" }, /* Class 12 */
931 { 0x0C, "500 000 oct/h" }, /* Class 13 */
932 { 0x0D, "1 000 000 oct/h" }, /* Class 14 */
933 { 0x0E, "2 000 000 oct/h" }, /* Class 15 */
934 { 0x0F, "5 000 000 oct/h" }, /* Class 16 */
935 { 0x10, "10 000 000 oct/h" }, /* Class 17 */
936 { 0x11, "20 000 000 oct/h" }, /* Class 18 */
937 { 0x12, "50 000 000 oct/h" }, /* Class 19 */
938 /* QoS Mean throughput classes from 0x13 to 0x1E (from 19 to 30) are subscribed */
939 { 0x13, "Reserved" },
940 { 0x14, "Reserved" },
941 { 0x15, "Reserved" },
942 { 0x16, "Reserved" },
943 { 0x17, "Reserved" },
944 { 0x18, "Reserved" },
945 { 0x19, "Reserved" },
946 { 0x1A, "Reserved" },
947 { 0x1B, "Reserved" },
948 { 0x1C, "Reserved" },
949 { 0x1D, "Reserved" },
950 { 0x1E, "Reserved" },
951 { 0x1F, "Best effort" }, /* Class 1 */
955 static const value_string qos_del_err_sdu[] = {
956 { 0x00, "Subscribed delivery of erroneous SDUs (in MS to network direction)" },
957 { 0x01, "No detect ('-')" },
958 { 0x02, "Erroneous SDUs are delivered ('yes')" },
959 { 0x03, "Erroneous SDUs are not delivered ('no')" },
960 { 0x07, "Reserved" }, /* All other values are reserved */
964 static const value_string qos_del_order[] = {
965 { 0x00, "Subscribed delivery order (in MS to network direction)" },
966 { 0x01, "With delivery order ('yes')" },
967 { 0x02, "Without delivery order ('no')" },
968 { 0x03, "Reserved" }, /* All other values are reserved */
972 static const value_string qos_traf_class[] = {
973 { 0x00, "Subscribed traffic class (in MS to network direction)" },
974 { 0x01, "Conversational class" },
975 { 0x02, "Streaming class" },
976 { 0x03, "Interactive class" },
977 { 0x04, "Background class" },
978 { 0x07, "Reserved" }, /* All other values are reserved */
982 static const value_string qos_max_sdu_size[] = {
983 { 0x00, "Subscribed maximum SDU size (in MS to network direction" },
984 /* For values from 0x01 to 0x96 (from 1 to 150), use a granularity of 10 octets */
985 { 0x97, "1502 octets" },
986 { 0x98, "1510 octets" },
987 { 0x99, "1520 octets" },
988 { 0, NULL } /* All other values are reserved */
991 static const value_string qos_max_ul[] = {
992 { 0x00, "Subscribed maximum bit rate for uplink (in MS to network direction)" },
993 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
994 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
995 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1000 static const value_string qos_max_dl[] = {
1001 { 0x00, "Subscribed maximum bit rate for downlink (in MS to network direction)" },
1002 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1003 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1004 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1009 static const value_string qos_res_ber[] = {
1010 { 0x00, "Subscribed residual BER (in MS to network direction)" },
1011 { 0x01, "1/20 = 5x10^-2" },
1012 { 0x02, "1/100 = 1x10^-2" },
1013 { 0x03, "1/200 = 5x10^-3" },
1014 { 0x04, "1/250 = 4x10^-3" },
1015 { 0x05, "1/1 000 = 1x10^-3" },
1016 { 0x06, "1/10 000 = 1x10^-4" },
1017 { 0x07, "1/100 000 = 1x10^-5" },
1018 { 0x08, "1/1 000 000 = 1x10^-6" },
1019 { 0x09, "3/50 000 000 = 6x10^-8" },
1020 { 0x0F, "Reserved" }, /* All other values are reserved */
1024 static const value_string qos_sdu_err_ratio[] = {
1025 { 0x00, "Subscribed SDU error ratio (in MS to network direction)" },
1026 { 0x01, "1/100 = 1x10^-2" },
1027 { 0x02, "7/1000 = 7x10^-3" },
1028 { 0x03, "1/1 000 = 1x10^-3" },
1029 { 0x04, "1/10 000 = 1x10^-4" },
1030 { 0x05, "1/100 000 = 1x10^-5" },
1031 { 0x06, "1/1 000 000 = 1x10^-6" },
1032 { 0x07, "1/10 = 1x10^-1" },
1033 { 0x0F, "Reserved" }, /* All other values are reserved */
1037 static const value_string qos_traf_handl_prio[] = {
1038 { 0x00, "Subscribed traffic handling priority (in MS to network direction)" },
1039 { 0x01, "Priority level 1" },
1040 { 0x02, "Priority level 2" },
1041 { 0x03, "Priority level 3" },
1045 static const value_string qos_trans_delay[] = {
1046 { 0x00, "Subscribed Transfer Delay (in MS to network direction)" },
1047 { 0x01, "10 ms" }, /* Using a granularity of 10 ms */
1062 { 0x10, "200 ms" }, /* (For values from 0x10 to 0x1F, value = 200 ms + (value - 0x10) * 50 ms */
1078 { 0x20, "1000 ms" }, /* For values from 0x20 to 0x3E, value = 1000 ms + (value - 0x20) * 100 ms */
1079 { 0x21, "1100 ms" },
1080 { 0x22, "1200 ms" },
1081 { 0x23, "1300 ms" },
1082 { 0x24, "1400 ms" },
1083 { 0x25, "1500 ms" },
1084 { 0x26, "1600 ms" },
1085 { 0x27, "1700 ms" },
1086 { 0x28, "1800 ms" },
1087 { 0x29, "1900 ms" },
1088 { 0x2A, "2000 ms" },
1089 { 0x2B, "2100 ms" },
1090 { 0x2C, "2200 ms" },
1091 { 0x2D, "2300 ms" },
1092 { 0x2E, "2400 ms" },
1093 { 0x2F, "2500 ms" },
1094 { 0x30, "2600 ms" },
1095 { 0x31, "2700 ms" },
1096 { 0x32, "2800 ms" },
1097 { 0x33, "2900 ms" },
1098 { 0x34, "3000 ms" },
1099 { 0x35, "3100 ms" },
1100 { 0x36, "3200 ms" },
1101 { 0x37, "3300 ms" },
1102 { 0x38, "3400 ms" },
1103 { 0x39, "3500 ms" },
1104 { 0x3A, "3600 ms" },
1105 { 0x3B, "3700 ms" },
1106 { 0x3C, "3800 ms" },
1107 { 0x3D, "3900 ms" },
1108 { 0x3E, "4000 ms" },
1109 { 0x3F, "Reserved"},
1113 static const value_string qos_guar_ul[] = {
1114 { 0x00, "Subscribed guaranteed bit rate for uplink (in MS to network direction)" },
1115 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1116 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1117 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1122 static const value_string qos_guar_dl[] = {
1123 { 0x00, "Subscribed guaranteed bit rate for downlink (in MS to network direction)" },
1124 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1125 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1126 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1131 static const value_string sel_mode_type[] = {
1132 { 0, "MS or network provided APN, subscribed verified" },
1133 { 1, "MS provided APN, subscription not verified" },
1134 { 2, "Network provided APN, subscription not verified" },
1135 { 3, "For future use (Network provided APN, subscription not verified" },/* Shall not be sent. If received, shall be sent as value 2 */
1139 static const value_string tr_comm_type[] = {
1140 { 1, "Send data record packet" },
1141 { 2, "Send possibly duplicated data record packet" },
1142 { 3, "Cancel data record packet" },
1143 { 4, "Release data record packet"},
1147 /* TODO: CHeck if all ms_reasons are included */
1148 static const value_string ms_not_reachable_type[] = {
1149 { 0, "No paging response via the MSC" },
1150 { 1, "IMSI detached" },
1151 { 2, "Roaming restriction" },
1152 { 3, "Deregistered in the HLR for non GPRS" },
1153 { 4, "MS purge for non GPRS" },
1154 { 5, "No paging response via the SGSN" },
1155 { 6, "GPRS detached" },
1156 { 7, "Deregistered in the HLR for non GPRS" },
1157 { 8, "MS purged for GPRS" },
1158 { 9, "Unidentified subscriber via the MSC" },
1159 { 10, "Unidentified subscriber via the SGSN" },
1163 /* UMTS: 25.413 v3.4.0, chapter 9.2.1.4, page 80
1165 static const value_string ranap_cause_type[] = {
1166 /* Radio Network Layer Cause (1-->64) */
1167 { 1, "RAB preempted" },
1168 { 2, "Trelocoverall Expiry" },
1169 { 3, "Trelocprep Expiry" },
1170 { 4, "Treloccomplete Expiry" },
1171 { 5, "Tqueing Expiry" },
1172 { 6, "Relocation Triggered" },
1173 { 7, "TRELOCalloc Expiry" },
1174 { 8, "Unable to Estabish During Relocation" },
1175 { 9, "Unknown Target RNC" },
1176 { 10, "Relocation Cancelled" },
1177 { 11, "Successful Relocation" },
1178 { 12, "Requested Ciphering and/or Integrity Protection Algorithms not Supported" },
1179 { 13, "Change of Ciphering and/or Integrity Protection is not supported" },
1180 { 14, "Failure in the Radio Interface Procedure" },
1181 { 15, "Release due to UTRAN Generated Reason" },
1182 { 16, "User Inactivity" },
1183 { 17, "Time Critical Relocation" },
1184 { 18, "Requested Traffic Class not Available" },
1185 { 19, "Invalid RAB Parameters Value" },
1186 { 20, "Requested Maximum Bit Rate not Available" },
1187 { 21, "Requested Guaranteed Bit Rate not Available" },
1188 { 22, "Requested Transfer Delay not Achievable" },
1189 { 23, "Invalid RAB Parameters Combination" },
1190 { 24, "Condition Violation for SDU Parameters" },
1191 { 25, "Condition Violation for Traffic Handling Priority" },
1192 { 26, "Condition Violation for Guaranteed Bit Rate" },
1193 { 27, "User Plane Versions not Supported" },
1194 { 28, "Iu UP Failure" },
1195 { 29, "Relocation Failure in Target CN/RNC or Target System" },
1196 { 30, "Invalid RAB ID" },
1197 { 31, "No Remaining RAB" },
1198 { 32, "Interaction with other procedure" },
1199 { 33, "Requested Maximum Bit Rate for DL not Available" },
1200 { 34, "Requested Maximum Bit Rate for UL not Available" },
1201 { 35, "Requested Guaranteed Bit Rate for DL not Available" },
1202 { 36, "Requested Guaranteed Bit Rate for UL not Available" },
1203 { 37, "Repeated Integrity Checking Failure" },
1204 { 38, "Requested Report Type not supported" },
1205 { 39, "Request superseded" },
1206 { 40, "Release due to UE generated signalling connection release" },
1207 { 41, "Resource Optimisation Relocation" },
1208 { 42, "Requested Information Not Available" },
1209 { 43, "Relocation desirable for radio reasons" },
1210 { 44, "Relocation not supported in Target RNC or Target System" },
1211 { 45, "Directed Retry" },
1212 { 46, "Radio Connection With UE Lost" },
1213 { 47, "rNC-unable-to-establish-all-RFCs" },
1214 { 48, "deciphering-keys-not-available" },
1215 { 49, "dedicated-assistance-data-not-available" },
1216 { 50, "relocation-target-not-allowed" },
1217 { 51, "location-reporting-congestion" },
1218 { 52, "reduce-load-in-serving-cell" },
1219 { 53, "no-radio-resources-available-in-target-cell" },
1220 { 54, "gERAN-Iumode-failure" },
1221 { 55, "access-restricted-due-to-shared-networks" },
1222 { 56, "incoming-relocation-not-supported-due-to-PUESBINE-feature" },
1223 { 57, "traffic-load-in-the-target-cell-higher-than-in-the-source-cell" },
1224 { 58, "mBMS-no-multicast-service-for-this-UE" },
1225 { 59, "mBMS-unknown-UE-ID" },
1226 { 60, "successful-MBMS-session-start-no-data-bearer-necessary" },
1227 { 61, "mBMS-superseded-due-to-NNSF" },
1228 { 62, "mBMS-UE-linking-already-done" },
1229 { 63, "mBMS-UE-de-linking-failure-no-existing-UE-linking" },
1230 { 64, "tMGI-unknown" },
1231 /* Transport Layer Cause (65-->80) */
1232 { 65, "Signalling Transport Resource Failure" },
1233 { 66, "Iu Transport Connection Failed to Establish" },
1234 /* NAS Cause (81-->96) */
1235 { 81, "User Restriction Start Indication" },
1236 { 82, "User Restriction End Indication" },
1237 { 83, "Normal Release" },
1238 /* Protocol Cause (97-->112) */
1239 { 97, "Transfer Syntax Error" },
1240 { 98, "Semantic Error" },
1241 { 99, "Message not compatible with receiver state" },
1242 { 100, "Abstract Syntax Error (Reject)" },
1243 { 101, "Abstract Syntax Error (Ignore and Notify)" },
1244 { 102, "Abstract Syntax Error (Falsely Constructed Message" },
1245 /* Miscellaneous Cause (113-->128) */
1246 { 113, "O & M Intervention" },
1247 { 114, "No Resource Available" },
1248 { 115, "Unspecified Failure" },
1249 { 116, "Network Opimisation" },
1250 /* Non-standard Cause (129-->255) */
1252 /* ranap_CauseRadioNetworkExtension ??
1253 { 257, "iP-multicast-address-and-APN-not-valid" },
1254 { 258, "mBMS-de-registration-rejected-due-to-implicit-registration" },
1255 { 259, "mBMS-request-superseded" },
1256 { 260, "mBMS-de-registration-during-session-not-allowed" },
1257 { 261, "mBMS-no-data-bearer-necessary" },
1263 static const value_string mm_sec_modep[] = {
1264 { 0, "Used cipher value, UMTS keys and Quintuplets" },
1265 { 1, "GSM key and triplets" },
1266 { 2, "UMTS key and quintuplets" },
1267 { 3, "GSM key and quintuplets" },
1271 static const value_string gtp_cipher_algorithm[] = {
1272 { 0, "No ciphering" },
1283 static const value_string gtp_ext_rat_type_vals[] = {
1293 #define MM_PROTO_GROUP_CALL_CONTROL 0x00
1294 #define MM_PROTO_BROADCAST_CALL_CONTROL 0x01
1295 #define MM_PROTO_PDSS1 0x02
1296 #define MM_PROTO_CALL_CONTROL 0x03
1297 #define MM_PROTO_PDSS2 0x04
1298 #define MM_PROTO_MM_NON_GPRS 0x05
1299 #define MM_PROTO_RR_MGMT 0x06
1300 #define MM_PROTO_MM_GPRS 0x08
1301 #define MM_PROTO_SMS 0x09
1302 #define MM_PROTO_SESSION_MGMT 0x0A
1303 #define MM_PROTO_NON_CALL_RELATED 0x0B
1305 static const value_string tft_code_type[] = {
1307 { 1, "Create new TFT" },
1308 { 2, "Delete existing TFT" },
1309 { 3, "Add packet filters to existing TFT" },
1310 { 4, "Replace packet filters in existing TFT" },
1311 { 5, "Delete packet filters from existing TFT" },
1318 static dissector_handle_t ip_handle;
1319 static dissector_handle_t ipv6_handle;
1320 static dissector_handle_t ppp_handle;
1321 static dissector_handle_t data_handle;
1322 static dissector_handle_t gtpcdr_handle;
1323 static dissector_table_t bssap_pdu_type_table=NULL;
1325 static int decode_gtp_cause (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1326 static int decode_gtp_imsi (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1327 static int decode_gtp_rai (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1328 static int decode_gtp_tlli (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1329 static int decode_gtp_ptmsi (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1330 static int decode_gtp_qos_gprs (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1331 static int decode_gtp_reorder (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1332 static int decode_gtp_auth_tri (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1333 static int decode_gtp_map_cause (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1334 static int decode_gtp_ptmsi_sig (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1335 static int decode_gtp_ms_valid (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1336 static int decode_gtp_recovery (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1337 static int decode_gtp_sel_mode (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1338 static int decode_gtp_16 (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1339 static int decode_gtp_17 (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1340 static int decode_gtp_18 (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1341 static int decode_gtp_19 (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1342 static int decode_gtp_nsapi (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1343 static int decode_gtp_ranap_cause (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1344 static int decode_gtp_rab_cntxt (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1345 static int decode_gtp_rp_sms (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1346 static int decode_gtp_rp (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1347 static int decode_gtp_pkt_flow_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1348 static int decode_gtp_chrg_char (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1349 static int decode_gtp_trace_ref (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1350 static int decode_gtp_trace_type (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1351 static int decode_gtp_ms_reason (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1352 static int decode_gtp_tr_comm (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1353 static int decode_gtp_chrg_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1354 static int decode_gtp_user_addr (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1355 static int decode_gtp_mm_cntxt (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1356 static int decode_gtp_pdp_cntxt (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1357 static int decode_gtp_apn (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1358 static int decode_gtp_gsn_addr (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1359 static int decode_gtp_proto_conf (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1360 static int decode_gtp_msisdn (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1361 static int decode_gtp_qos_umts (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1362 static int decode_gtp_auth_qui (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1363 static int decode_gtp_tft (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1364 static int decode_gtp_target_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1365 static int decode_gtp_utran_cont (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1366 static int decode_gtp_rab_setup (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1367 static int decode_gtp_hdr_list (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1368 static int decode_gtp_trigger_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1369 static int decode_gtp_omc_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1371 static int decode_gtp_ran_tr_cont (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1372 static int decode_gtp_pdp_cont_prio (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1373 static int decode_gtp_add_rab_setup_inf (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1374 static int decode_gtp_ssgn_no (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1375 static int decode_gtp_common_flgs (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1376 static int decode_gtp_apn_res (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1377 static int decode_gtp_ra_prio_lcs (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1378 static int decode_gtp_rat_type (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1379 static int decode_gtp_usr_loc_inf (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1380 static int decode_gtp_ms_time_zone (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1381 static int decode_gtp_imeisv (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1382 static int decode_gtp_camel_chg_inf_con (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1383 static int decode_gtp_mbms_ue_ctx (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1384 static int decode_gtp_tmgi (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1385 static int decode_gtp_rim_ra (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1386 static int decode_gtp_mbms_prot_conf_opt (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1387 static int decode_gtp_mbms_sa (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1388 static int decode_gtp_src_rnc_pdp_ctx_inf (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1389 static int decode_gtp_add_trs_inf (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1390 static int decode_gtp_hop_count (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1391 static int decode_gtp_sel_plmn_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1392 static int decode_gtp_mbms_ses_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1393 static int decode_gtp_mbms_2g_3g_ind (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1394 static int decode_gtp_enh_nsapi (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1395 static int decode_gtp_mbms_ses_dur (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1396 static int decode_gtp_add_mbms_trs_inf (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1397 static int decode_gtp_mbms_ses_id_rep_no(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1398 static int decode_gtp_mbms_time_to_data_tr(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1399 static int decode_gtp_ps_ho_req_ctx (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1400 static int decode_gtp_bss_cont (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1401 static int decode_gtp_cell_id (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1402 static int decode_gtp_pdu_no (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1403 static int decode_gtp_bssgp_cause (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1405 static int decode_gtp_chrg_addr (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1406 static int decode_gtp_rel_pack (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1407 static int decode_gtp_can_pack (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1408 static int decode_gtp_data_req (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1409 static int decode_gtp_data_resp (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1410 static int decode_gtp_node_addr (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1411 static int decode_gtp_priv_ext (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1412 static int decode_gtp_unknown (tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree);
1414 typedef struct _gtp_opt {
1416 int (*decode)(tvbuff_t *, int, packet_info *, proto_tree *);
1419 static const gtp_opt_t gtpopt[] = {
1420 { GTP_EXT_CAUSE, decode_gtp_cause },
1421 { GTP_EXT_IMSI, decode_gtp_imsi },
1422 { GTP_EXT_RAI, decode_gtp_rai },
1423 { GTP_EXT_TLLI, decode_gtp_tlli },
1424 { GTP_EXT_PTMSI, decode_gtp_ptmsi },
1425 { GTP_EXT_QOS_GPRS, decode_gtp_qos_gprs },
1426 { GTP_EXT_REORDER, decode_gtp_reorder },
1427 { GTP_EXT_AUTH_TRI, decode_gtp_auth_tri },
1428 { GTP_EXT_MAP_CAUSE, decode_gtp_map_cause },
1429 { GTP_EXT_PTMSI_SIG, decode_gtp_ptmsi_sig },
1430 { GTP_EXT_MS_VALID, decode_gtp_ms_valid },
1431 { GTP_EXT_RECOVER, decode_gtp_recovery },
1432 { GTP_EXT_SEL_MODE, decode_gtp_sel_mode },
1433 { GTP_EXT_16, decode_gtp_16 },
1434 { GTP_EXT_17, decode_gtp_17 },
1435 { GTP_EXT_18, decode_gtp_18 },
1436 { GTP_EXT_19, decode_gtp_19 },
1437 { GTP_EXT_NSAPI, decode_gtp_nsapi },
1438 { GTP_EXT_RANAP_CAUSE, decode_gtp_ranap_cause },
1439 { GTP_EXT_RAB_CNTXT, decode_gtp_rab_cntxt },
1440 { GTP_EXT_RP_SMS, decode_gtp_rp_sms },
1441 { GTP_EXT_RP, decode_gtp_rp },
1442 { GTP_EXT_PKT_FLOW_ID, decode_gtp_pkt_flow_id },
1443 { GTP_EXT_CHRG_CHAR, decode_gtp_chrg_char },
1444 { GTP_EXT_TRACE_REF, decode_gtp_trace_ref },
1445 { GTP_EXT_TRACE_TYPE, decode_gtp_trace_type },
1446 { GTPv1_EXT_MS_REASON, decode_gtp_ms_reason },
1447 { GTP_EXT_TR_COMM, decode_gtp_tr_comm },
1448 { GTP_EXT_CHRG_ID, decode_gtp_chrg_id },
1449 { GTP_EXT_USER_ADDR, decode_gtp_user_addr },
1450 { GTP_EXT_MM_CNTXT, decode_gtp_mm_cntxt },
1451 { GTP_EXT_PDP_CNTXT, decode_gtp_pdp_cntxt },
1452 { GTP_EXT_APN, decode_gtp_apn },
1453 { GTP_EXT_PROTO_CONF, decode_gtp_proto_conf },
1454 { GTP_EXT_GSN_ADDR, decode_gtp_gsn_addr },
1455 { GTP_EXT_MSISDN, decode_gtp_msisdn },
1456 { GTP_EXT_QOS_UMTS, decode_gtp_qos_umts }, /* 3G */
1457 { GTP_EXT_AUTH_QUI, decode_gtp_auth_qui }, /* 3G */
1458 { GTP_EXT_TFT, decode_gtp_tft }, /* 3G */
1459 { GTP_EXT_TARGET_ID, decode_gtp_target_id }, /* 3G */
1460 { GTP_EXT_UTRAN_CONT, decode_gtp_utran_cont }, /* 3G */
1461 { GTP_EXT_RAB_SETUP, decode_gtp_rab_setup }, /* 3G */
1462 { GTP_EXT_HDR_LIST, decode_gtp_hdr_list }, /* 3G */
1463 { GTP_EXT_TRIGGER_ID, decode_gtp_trigger_id }, /* 3G */
1464 { GTP_EXT_OMC_ID, decode_gtp_omc_id }, /* 3G */
1465 /* TS 29 060 V6.11.0 */
1466 { GTP_EXT_RAN_TR_CONT, decode_gtp_ran_tr_cont }, /* 7.7.43 */
1467 { GTP_EXT_PDP_CONT_PRIO, decode_gtp_pdp_cont_prio }, /* 7.7.45 */
1468 { GTP_EXT_ADD_RAB_SETUP_INF, decode_gtp_add_rab_setup_inf }, /* 7.7.45A */
1469 { GTP_EXT_SSGN_NO, decode_gtp_ssgn_no }, /* 7.7.47 */
1470 { GTP_EXT_COMMON_FLGS, decode_gtp_common_flgs }, /* 7.7.48 */
1471 { GTP_EXT_APN_RES, decode_gtp_apn_res }, /* 3G */
1472 { GTP_EXT_RA_PRIO_LCS, decode_gtp_ra_prio_lcs }, /* 7.7.25B */
1473 { GTP_EXT_RAT_TYPE, decode_gtp_rat_type }, /* 3G */
1474 { GTP_EXT_USR_LOC_INF, decode_gtp_usr_loc_inf}, /* 7.7.51 */
1475 { GTP_EXT_MS_TIME_ZONE, decode_gtp_ms_time_zone}, /* 7.7.52 */
1476 { GTP_EXT_IMEISV, decode_gtp_imeisv }, /* 3G 7.7.53*/
1477 { GTP_EXT_CAMEL_CHG_INF_CON, decode_gtp_camel_chg_inf_con }, /* 7.7.54 */
1478 { GTP_EXT_MBMS_UE_CTX, decode_gtp_mbms_ue_ctx }, /* 7.7.55 */
1479 { GTP_EXT_TMGI, decode_gtp_tmgi }, /* 7.7.56 */
1480 { GTP_EXT_RIM_RA, decode_gtp_rim_ra }, /* 7.7.57 */
1481 { GTP_EXT_MBMS_PROT_CONF_OPT, decode_gtp_mbms_prot_conf_opt }, /* 7.7.58 */
1482 { GTP_EXT_MBMS_SA, decode_gtp_mbms_sa }, /* 7.7.60 */
1483 { GTP_EXT_SRC_RNC_PDP_CTX_INF, decode_gtp_src_rnc_pdp_ctx_inf }, /* 7.7.61 */
1484 { GTP_EXT_ADD_TRS_INF, decode_gtp_add_trs_inf }, /* 7.7.62 */
1485 { GTP_EXT_HOP_COUNT, decode_gtp_hop_count }, /* 7.7.63 */
1486 { GTP_EXT_SEL_PLMN_ID, decode_gtp_sel_plmn_id }, /* 7.7.64 */
1487 { GTP_EXT_MBMS_SES_ID, decode_gtp_mbms_ses_id }, /* 7.7.65 */
1488 { GTP_EXT_MBMS_2G_3G_IND, decode_gtp_mbms_2g_3g_ind }, /* 7.7.66 */
1489 { GTP_EXT_ENH_NSAPI, decode_gtp_enh_nsapi }, /* 7.7.67 */
1490 { GTP_EXT_MBMS_SES_DUR, decode_gtp_mbms_ses_dur }, /* 7.7.59 */
1491 { GTP_EXT_ADD_MBMS_TRS_INF, decode_gtp_add_mbms_trs_inf }, /* 7.7.68 */
1492 { GTP_EXT_MBMS_SES_ID_REP_NO, decode_gtp_mbms_ses_id_rep_no }, /* 7.7.69 */
1493 { GTP_EXT_MBMS_TIME_TO_DATA_TR, decode_gtp_mbms_time_to_data_tr }, /* 7.7.70 */
1494 { GTP_EXT_PS_HO_REQ_CTX, decode_gtp_ps_ho_req_ctx }, /* 7.7.71 */
1495 { GTP_EXT_BSS_CONT, decode_gtp_bss_cont }, /* 7.7.72 */
1496 { GTP_EXT_CELL_ID, decode_gtp_cell_id }, /* 7.7.73 */
1497 { GTP_EXT_PDU_NO, decode_gtp_pdu_no }, /* 7.7.74 */
1498 { GTP_EXT_BSSGP_CAUSE, decode_gtp_bssgp_cause }, /* 7.7.75 */
1500 { GTP_EXT_REL_PACK, decode_gtp_rel_pack }, /* charging */
1501 { GTP_EXT_CAN_PACK, decode_gtp_can_pack }, /* charging */
1502 { GTP_EXT_CHRG_ADDR, decode_gtp_chrg_addr },
1503 { GTP_EXT_DATA_REQ, decode_gtp_data_req }, /* charging */
1504 { GTP_EXT_DATA_RESP, decode_gtp_data_resp }, /* charging */
1505 { GTP_EXT_NODE_ADDR, decode_gtp_node_addr },
1506 { GTP_EXT_PRIV_EXT, decode_gtp_priv_ext },
1507 { 0, decode_gtp_unknown }
1516 static guint8 gtp_version = 0;
1517 static const char *yesno[] = { "no", "yes" };
1520 col_append_str_gtp(column_info *cinfo, gint el, const gchar *proto_name) {
1524 gchar _tmp[COL_MAX_LEN];
1526 max_len = COL_MAX_LEN;
1528 for (i = 0; i < cinfo->num_cols; i++) {
1529 if (cinfo->fmt_matx[i][el]) {
1530 if (cinfo->col_data[i] != cinfo->col_buf[i]) {
1532 strncpy(cinfo->col_buf[i], cinfo->col_data[i], max_len);
1533 cinfo->col_buf[i][max_len - 1] = '\0';
1537 strcat(_tmp, proto_name);
1539 strcat(_tmp, cinfo->col_buf[i]);
1541 cinfo->col_buf[i][0] = '\0';
1542 strcat(cinfo->col_buf[i], _tmp);
1543 cinfo->col_data[i] = cinfo->col_buf[i];
1549 id_to_str(const guint8 *ad) {
1551 static gchar str[17] = " ";
1552 guint8 bits8to5, bits4to1;
1554 static const gchar hex_digits[10] = "0123456789";
1556 for (i = 0; i < 8; i++) {
1557 bits8to5 = (ad[i] >> 4) & 0x0F;
1558 bits4to1 = ad[i] & 0x0F;
1560 str[j++] = hex_digits[bits4to1];
1562 str[j++] = hex_digits[bits8to5];
1569 imsi_to_str(const guint8 *ad) {
1571 static gchar str[17] = " ";
1574 for (i = 0; i < 8; i++) {
1575 if ((ad[i] & 0x0F) <= 9) str[j++] = (ad[i] & 0x0F) + 0x30;
1576 if (((ad[i] >> 4) & 0x0F) <= 9) str[j++] = ((ad[i] >> 4) & 0x0F) + 0x30;
1584 msisdn_to_str(const guint8 *ad, int len) {
1586 static gchar str[18] = "+ ";
1587 guint8 bits8to5, bits4to1;
1589 static const gchar hex_digits[10] = "0123456789";
1591 for (i = 1; i < len && i < 9; i++) {
1592 bits8to5 = (ad[i] >> 4) & 0x0F;
1593 bits4to1 = ad[i] & 0x0F;
1595 str[j++] = hex_digits[bits4to1];
1597 str[j++] = hex_digits[bits8to5];
1604 /* Next definitions and function check_field_presence checks if given field
1605 * in GTP packet is compliant with ETSI
1607 typedef struct _header {
1612 typedef struct _message {
1614 ext_header fields[32];
1617 /* ---------------------
1619 * ---------------------*/
1620 static _gtp_mess_items gprs_mess_items[] = {
1624 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1629 GTP_MSG_ECHO_RESP, {
1630 { GTP_EXT_RECOVER, GTP_MANDATORY },
1631 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1636 GTP_MSG_VER_NOT_SUPP, {
1641 GTP_MSG_NODE_ALIVE_REQ, {
1642 { GTP_EXT_NODE_ADDR, GTP_MANDATORY },
1643 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1648 GTP_MSG_NODE_ALIVE_RESP, {
1649 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1654 GTP_MSG_REDIR_REQ, {
1655 { GTP_EXT_CAUSE, GTP_MANDATORY },
1656 { GTP_EXT_NODE_ADDR, GTP_OPTIONAL },
1657 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1662 GTP_MSG_REDIR_RESP, {
1663 { GTP_EXT_CAUSE, GTP_MANDATORY },
1664 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1669 GTP_MSG_CREATE_PDP_REQ, {
1670 { GTP_EXT_QOS_GPRS, GTP_MANDATORY },
1671 { GTP_EXT_RECOVER, GTP_OPTIONAL },
1672 { GTP_EXT_SEL_MODE, GTP_MANDATORY },
1673 { GTP_EXT_FLOW_LABEL, GTP_MANDATORY },
1674 { GTP_EXT_FLOW_SIG, GTP_MANDATORY },
1675 { GTP_EXT_MSISDN, GTP_MANDATORY },
1676 { GTP_EXT_USER_ADDR, GTP_MANDATORY },
1677 { GTP_EXT_APN, GTP_MANDATORY },
1678 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL },
1679 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
1680 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
1681 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1686 GTP_MSG_CREATE_PDP_RESP, {
1687 { GTP_EXT_CAUSE, GTP_MANDATORY },
1688 { GTP_EXT_QOS_GPRS, GTP_CONDITIONAL },
1689 { GTP_EXT_REORDER, GTP_CONDITIONAL },
1690 { GTP_EXT_RECOVER, GTP_OPTIONAL },
1691 { GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL },
1692 { GTP_EXT_FLOW_SIG, GTP_CONDITIONAL },
1693 { GTP_EXT_CHRG_ID, GTP_CONDITIONAL },
1694 { GTP_EXT_USER_ADDR, GTP_CONDITIONAL },
1695 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL },
1696 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
1697 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
1698 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL },
1699 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1704 GTP_MSG_UPDATE_PDP_REQ, {
1705 { GTP_EXT_QOS_GPRS, GTP_MANDATORY },
1706 { GTP_EXT_RECOVER, GTP_OPTIONAL },
1707 { GTP_EXT_FLOW_LABEL, GTP_MANDATORY },
1708 { GTP_EXT_FLOW_SIG, GTP_MANDATORY },
1709 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
1710 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
1711 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1716 GTP_MSG_UPDATE_PDP_RESP, {
1717 { GTP_EXT_CAUSE, GTP_MANDATORY },
1718 { GTP_EXT_QOS_GPRS, GTP_CONDITIONAL },
1719 { GTP_EXT_RECOVER, GTP_OPTIONAL },
1720 { GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL },
1721 { GTP_EXT_FLOW_SIG, GTP_CONDITIONAL },
1722 { GTP_EXT_CHRG_ID, GTP_CONDITIONAL },
1723 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
1724 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
1725 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL },
1726 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1731 GTP_MSG_DELETE_PDP_REQ, {
1732 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1737 GTP_MSG_DELETE_PDP_RESP, {
1738 { GTP_EXT_CAUSE, GTP_MANDATORY },
1739 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1744 GTP_MSG_CREATE_AA_PDP_REQ, {
1745 { GTP_EXT_QOS_GPRS, GTP_MANDATORY },
1746 { GTP_EXT_RECOVER, GTP_OPTIONAL },
1747 { GTP_EXT_SEL_MODE, GTP_MANDATORY },
1748 { GTP_EXT_FLOW_LABEL, GTP_MANDATORY },
1749 { GTP_EXT_FLOW_SIG, GTP_MANDATORY },
1750 { GTP_EXT_USER_ADDR, GTP_MANDATORY },
1751 { GTP_EXT_APN, GTP_MANDATORY },
1752 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL },
1753 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
1754 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
1755 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1760 GTP_MSG_CREATE_AA_PDP_RESP, {
1761 { GTP_EXT_CAUSE, GTP_MANDATORY },
1762 { GTP_EXT_QOS_GPRS, GTP_CONDITIONAL },
1763 { GTP_EXT_REORDER, GTP_CONDITIONAL },
1764 { GTP_EXT_RECOVER, GTP_OPTIONAL },
1765 { GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL },
1766 { GTP_EXT_FLOW_SIG, GTP_CONDITIONAL },
1767 { GTP_EXT_CHRG_ID, GTP_CONDITIONAL },
1768 { GTP_EXT_USER_ADDR, GTP_CONDITIONAL },
1769 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL },
1770 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
1771 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
1772 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL },
1773 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1778 GTP_MSG_DELETE_AA_PDP_REQ, {
1779 { GTP_EXT_CAUSE, GTP_MANDATORY },
1780 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1785 GTP_MSG_DELETE_AA_PDP_RESP, {
1786 { GTP_EXT_CAUSE, GTP_MANDATORY },
1787 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1793 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1798 GTP_MSG_PDU_NOTIFY_REQ, {
1799 { GTP_EXT_USER_ADDR, GTP_MANDATORY },
1800 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1805 GTP_MSG_PDU_NOTIFY_RESP, {
1806 { GTP_EXT_CAUSE, GTP_MANDATORY },
1807 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1812 GTP_MSG_PDU_NOTIFY_REJ_REQ, {
1813 { GTP_EXT_CAUSE, GTP_MANDATORY },
1814 { GTP_EXT_USER_ADDR, GTP_MANDATORY },
1815 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1820 GTP_MSG_PDU_NOTIFY_REJ_RESP, {
1821 { GTP_EXT_CAUSE, GTP_MANDATORY },
1822 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1827 GTP_MSG_SEND_ROUT_INFO_REQ, {
1828 { GTP_EXT_IMSI, GTP_MANDATORY },
1829 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1834 GTP_MSG_SEND_ROUT_INFO_RESP, {
1835 { GTP_EXT_CAUSE, GTP_MANDATORY },
1836 { GTP_EXT_IMSI, GTP_MANDATORY },
1837 { GTP_EXT_MAP_CAUSE, GTP_OPTIONAL },
1838 { GTP_EXT_MS_REASON, GTP_OPTIONAL },
1839 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL },
1840 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1845 GTP_MSG_FAIL_REP_REQ, {
1846 { GTP_EXT_IMSI, GTP_MANDATORY },
1847 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1852 GTP_MSG_FAIL_REP_RESP, {
1853 { GTP_EXT_CAUSE, GTP_MANDATORY },
1854 { GTP_EXT_MAP_CAUSE, GTP_OPTIONAL },
1855 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1860 GTP_MSG_MS_PRESENT_REQ, {
1861 { GTP_EXT_IMSI, GTP_MANDATORY },
1862 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
1863 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1868 GTP_MSG_MS_PRESENT_RESP, {
1869 { GTP_EXT_CAUSE, GTP_MANDATORY },
1870 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1875 GTP_MSG_IDENT_REQ, {
1876 { GTP_EXT_RAI, GTP_MANDATORY },
1877 { GTP_EXT_PTMSI, GTP_MANDATORY },
1878 { GTP_EXT_PTMSI_SIG, GTP_OPTIONAL },
1879 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1884 GTP_MSG_IDENT_RESP, {
1885 { GTP_EXT_CAUSE, GTP_MANDATORY },
1886 { GTP_EXT_IMSI, GTP_CONDITIONAL },
1887 { GTP_EXT_AUTH_TRI, GTP_OPTIONAL },
1888 { GTP_EXT_AUTH_QUI, GTP_OPTIONAL },
1889 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1894 GTP_MSG_SGSN_CNTXT_REQ, {
1895 { GTP_EXT_IMSI, GTP_CONDITIONAL },
1896 { GTP_EXT_RAI, GTP_MANDATORY },
1897 { GTP_EXT_TLLI, GTP_MANDATORY },
1898 { GTP_EXT_PTMSI_SIG, GTP_OPTIONAL },
1899 { GTP_EXT_MS_VALID, GTP_OPTIONAL },
1900 { GTP_EXT_FLOW_SIG, GTP_MANDATORY },
1905 GTP_MSG_SGSN_CNTXT_RESP, {
1906 { GTP_EXT_CAUSE, GTP_MANDATORY },
1907 { GTP_EXT_IMSI, GTP_CONDITIONAL },
1908 { GTP_EXT_FLOW_SIG, GTP_CONDITIONAL },
1909 { GTP_EXT_MM_CNTXT, GTP_CONDITIONAL },
1910 { GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL },
1911 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1916 GTP_MSG_SGSN_CNTXT_ACK, {
1917 { GTP_EXT_CAUSE, GTP_MANDATORY },
1918 { GTP_EXT_FLOW_II, GTP_CONDITIONAL },
1919 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
1920 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1925 GTP_MSG_DATA_TRANSF_REQ, {
1926 { GTP_EXT_TR_COMM, GTP_MANDATORY },
1927 { GTP_EXT_DATA_REQ, GTP_CONDITIONAL },
1928 { GTP_EXT_REL_PACK, GTP_CONDITIONAL },
1929 { GTP_EXT_CAN_PACK, GTP_CONDITIONAL },
1930 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1935 GTP_MSG_DATA_TRANSF_RESP, {
1936 { GTP_EXT_CAUSE, GTP_MANDATORY },
1937 { GTP_EXT_DATA_RESP, GTP_MANDATORY },
1938 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1949 /* -----------------------------
1951 * -----------------------------*/
1952 static _gtp_mess_items umts_mess_items[] = {
1953 /* 7.2 Path Management Messages */
1956 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1961 GTP_MSG_ECHO_RESP, {
1962 { GTP_EXT_RECOVER, GTP_MANDATORY },
1963 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1968 GTP_MSG_VER_NOT_SUPP, {
1973 GTP_MSG_SUPP_EXT_HDR, {
1974 { GTP_EXT_HDR_LIST, GTP_MANDATORY },
1980 GTP_MSG_NODE_ALIVE_REQ, {
1981 { GTP_EXT_NODE_ADDR, GTP_MANDATORY },
1982 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1987 GTP_MSG_NODE_ALIVE_RESP, {
1988 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
1993 GTP_MSG_REDIR_REQ, {
1994 { GTP_EXT_CAUSE, GTP_MANDATORY },
1995 { GTP_EXT_NODE_ADDR, GTP_OPTIONAL },
1996 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2001 GTP_MSG_REDIR_REQ, {
2005 /* 7.3 Tunnel Management Messages */
2007 GTP_MSG_CREATE_PDP_REQ, {
2008 { GTP_EXT_IMSI, GTP_CONDITIONAL },
2009 /* RAI is in TS 29.060 V6.11.0 */
2010 { GTP_EXT_RAI, GTP_OPTIONAL }, /* Routeing Area Identity (RAI) Optional 7.7.3 */
2011 { GTP_EXT_RECOVER, GTP_OPTIONAL },
2012 { GTP_EXT_SEL_MODE, GTP_CONDITIONAL },
2013 { GTP_EXT_TEID, GTP_MANDATORY },
2014 { GTP_EXT_TEID_CP, GTP_CONDITIONAL },
2015 { GTP_EXT_NSAPI, GTP_MANDATORY },
2016 { GTP_EXT_NSAPI, GTP_CONDITIONAL },
2017 { GTP_EXT_CHRG_CHAR, GTP_OPTIONAL },
2018 { GTP_EXT_TRACE_REF, GTP_OPTIONAL },
2019 { GTP_EXT_TRACE_TYPE, GTP_OPTIONAL },
2020 { GTP_EXT_USER_ADDR, GTP_CONDITIONAL },
2021 { GTP_EXT_APN, GTP_CONDITIONAL },
2022 { GTP_EXT_PROTO_CONF, GTP_CONDITIONAL },
2023 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
2024 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
2025 { GTP_EXT_MSISDN, GTP_CONDITIONAL },
2026 { GTP_EXT_QOS_UMTS, GTP_MANDATORY },
2027 { GTP_EXT_TFT, GTP_CONDITIONAL },
2028 { GTP_EXT_TRIGGER_ID, GTP_OPTIONAL },
2029 { GTP_EXT_OMC_ID, GTP_OPTIONAL },
2030 /* TS 29.060 V6.11.0 */
2031 { GTP_EXT_APN_RES, GTP_OPTIONAL },
2032 { GTP_EXT_RAT_TYPE, GTP_OPTIONAL },
2033 { GTP_EXT_USR_LOC_INF, GTP_OPTIONAL },
2034 { GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL },
2035 { GTP_EXT_IMEISV, GTP_OPTIONAL },
2036 { GTP_EXT_CAMEL_CHG_INF_CON, GTP_OPTIONAL },
2037 { GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL },
2038 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2043 GTP_MSG_CREATE_PDP_RESP, {
2044 { GTP_EXT_CAUSE, GTP_MANDATORY },
2045 { GTP_EXT_REORDER, GTP_CONDITIONAL },
2046 { GTP_EXT_RECOVER, GTP_OPTIONAL },
2047 { GTP_EXT_TEID, GTP_CONDITIONAL },
2048 { GTP_EXT_TEID_CP, GTP_CONDITIONAL },
2049 { GTP_EXT_CHRG_ID, GTP_CONDITIONAL },
2050 { GTP_EXT_USER_ADDR, GTP_CONDITIONAL },
2051 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL },
2052 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
2053 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
2054 { GTP_EXT_QOS_UMTS, GTP_CONDITIONAL },
2055 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL },
2056 /* TS 29.060 V6.11.0 */
2057 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL }, /* Alternative Charging Gateway Address Optional 7.7.44 */
2058 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2059 { GTP_EXT_COMMON_FLGS, GTP_OPTIONAL }, /* Common Flags Optional 7.7.48 */
2060 { GTP_EXT_APN_RES, GTP_OPTIONAL }, /* APN Restriction Optional 7.7.49 */
2064 { /* checked, SGSN -> GGSN */
2065 GTP_MSG_UPDATE_PDP_REQ, {
2066 { GTP_EXT_IMSI, GTP_CONDITIONAL },
2067 { GTP_EXT_RAI, GTP_OPTIONAL }, /* Routeing Area Identity (RAI) Optional 7.7.3 */
2068 { GTP_EXT_RECOVER, GTP_OPTIONAL },
2069 { GTP_EXT_TEID, GTP_MANDATORY },
2070 { GTP_EXT_TEID_CP, GTP_CONDITIONAL },
2071 { GTP_EXT_NSAPI, GTP_MANDATORY },
2072 { GTP_EXT_TRACE_REF, GTP_OPTIONAL },
2073 { GTP_EXT_TRACE_TYPE, GTP_OPTIONAL },
2074 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL }, /* Protocol Configuration Options Optional 7.7.31 */
2075 { GTP_EXT_GSN_ADDR, GTP_MANDATORY }, /* SGSN Address for Control Plane Mandatory GSN Address 7.7.32 */
2076 { GTP_EXT_GSN_ADDR, GTP_MANDATORY }, /* SGSN Address for User Traffic Mandatory GSN Address 7.7.32 */
2077 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL }, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2078 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL }, /* Alternative SGSN Address for User Traffic Conditional GSN Address 7.7.32 */
2079 { GTP_EXT_QOS_UMTS, GTP_MANDATORY },
2080 { GTP_EXT_TFT, GTP_OPTIONAL },
2081 { GTP_EXT_TRIGGER_ID, GTP_OPTIONAL },
2082 { GTP_EXT_OMC_ID, GTP_OPTIONAL },
2083 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2084 { GTP_EXT_RAT_TYPE, GTP_OPTIONAL }, /* RAT Type Optional 7.7.50 */
2085 { GTP_EXT_USR_LOC_INF, GTP_OPTIONAL }, /* User Location Information Optional 7.7.51 */
2086 { GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL }, /* MS Time Zone Optional 7.7.52 */
2087 { GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL }, /* Additonal Trace Info Optional 7.7.62 */
2088 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2092 { /* checked, GGSN -> SGSN */
2093 GTP_MSG_UPDATE_PDP_RESP, {
2094 { GTP_EXT_CAUSE, GTP_MANDATORY },
2095 { GTP_EXT_RECOVER, GTP_OPTIONAL },
2096 { GTP_EXT_TEID, GTP_CONDITIONAL },
2097 { GTP_EXT_TEID_CP, GTP_CONDITIONAL },
2098 { GTP_EXT_CHRG_ID, GTP_CONDITIONAL },
2099 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL }, /* Protocol Configuration Options Optional 7.7.31 */
2100 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
2101 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
2102 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL }, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2103 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL }, /* Alternative SGSN Address for User Traffic Conditional GSN Address 7.7.32 */
2104 { GTP_EXT_QOS_UMTS, GTP_CONDITIONAL },
2105 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL },
2106 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL }, /* Alternative Charging Gateway Address Optional 7.7.44 */
2107 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2108 { GTP_EXT_COMMON_FLGS, GTP_OPTIONAL }, /* Common Flags Optional 7.7.48 */
2109 { GTP_EXT_APN_RES, GTP_OPTIONAL }, /* APN Restriction Optional 7.7.49 */
2114 GTP_MSG_DELETE_PDP_REQ, {
2115 { GTP_EXT_TEAR_IND, GTP_CONDITIONAL },
2116 { GTP_EXT_NSAPI, GTP_MANDATORY },
2117 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL }, /* Protocol Configuration Options Optional 7.7.31 */
2118 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2123 GTP_MSG_DELETE_PDP_RESP, {
2124 { GTP_EXT_CAUSE, GTP_MANDATORY },
2125 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL }, /* Protocol Configuration Options Optional 7.7.31 */
2126 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2132 { GTP_EXT_TEID, GTP_MANDATORY },
2133 { GTP_EXT_GSN_ADDR, GTP_MANDATORY }, /* GSN Address Mandatory 7.7.32 */
2134 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2139 GTP_MSG_PDU_NOTIFY_REQ, {
2140 { GTP_EXT_IMSI, GTP_MANDATORY },
2141 { GTP_EXT_TEID_CP, GTP_MANDATORY },
2142 { GTP_EXT_USER_ADDR, GTP_MANDATORY },
2143 { GTP_EXT_APN, GTP_MANDATORY },
2144 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL }, /* Protocol Configuration Options Optional 7.7.31 */
2145 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
2146 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2151 GTP_MSG_PDU_NOTIFY_RESP, {
2152 { GTP_EXT_CAUSE, GTP_MANDATORY },
2153 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2158 GTP_MSG_PDU_NOTIFY_REJ_REQ, {
2159 { GTP_EXT_CAUSE, GTP_MANDATORY },
2160 { GTP_EXT_TEID_CP, GTP_MANDATORY },
2161 { GTP_EXT_USER_ADDR, GTP_MANDATORY },
2162 { GTP_EXT_APN, GTP_MANDATORY },
2163 { GTP_EXT_PROTO_CONF, GTP_OPTIONAL }, /* Protocol Configuration Options Optional 7.7.31 */
2164 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2169 GTP_MSG_PDU_NOTIFY_REJ_RESP, {
2170 { GTP_EXT_CAUSE, GTP_MANDATORY },
2171 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2175 /* 7.4 Location Management Messages */
2177 GTP_MSG_SEND_ROUT_INFO_REQ, {
2178 { GTP_EXT_IMSI, GTP_MANDATORY },
2179 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2184 GTP_MSG_SEND_ROUT_INFO_RESP, {
2185 { GTP_EXT_CAUSE, GTP_MANDATORY },
2186 { GTP_EXT_IMSI, GTP_MANDATORY },
2187 { GTP_EXT_MAP_CAUSE, GTP_OPTIONAL },
2188 { GTPv1_EXT_MS_REASON, GTP_OPTIONAL },
2189 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL },
2190 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2195 GTP_MSG_FAIL_REP_REQ, {
2196 { GTP_EXT_IMSI, GTP_MANDATORY },
2197 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2202 GTP_MSG_FAIL_REP_RESP, {
2203 { GTP_EXT_CAUSE, GTP_MANDATORY },
2204 { GTP_EXT_MAP_CAUSE, GTP_OPTIONAL },
2205 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2210 GTP_MSG_MS_PRESENT_REQ, {
2211 { GTP_EXT_IMSI, GTP_MANDATORY },
2212 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
2213 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2218 GTP_MSG_MS_PRESENT_RESP, {
2219 { GTP_EXT_CAUSE, GTP_MANDATORY },
2220 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2224 /* 7.5 Mobility Management Messages */
2226 GTP_MSG_IDENT_REQ, {
2227 { GTP_EXT_RAI, GTP_MANDATORY },
2228 { GTP_EXT_PTMSI, GTP_MANDATORY },
2229 { GTP_EXT_PTMSI_SIG, GTP_CONDITIONAL },
2230 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL }, /* SGSN Address for Control Plane Optional 7.7.32 */
2231 { GTP_EXT_HOP_COUNT, GTP_OPTIONAL }, /* Hop Counter Optional 7.7.63 */
2232 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2237 GTP_MSG_IDENT_RESP, {
2238 { GTP_EXT_CAUSE, GTP_MANDATORY },
2239 { GTP_EXT_IMSI, GTP_CONDITIONAL },
2240 { GTP_EXT_AUTH_TRI, GTP_CONDITIONAL },
2241 { GTP_EXT_AUTH_QUI, GTP_CONDITIONAL },
2242 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2247 GTP_MSG_SGSN_CNTXT_REQ, {
2248 { GTP_EXT_IMSI, GTP_CONDITIONAL },
2249 { GTP_EXT_RAI, GTP_MANDATORY },
2250 { GTP_EXT_TLLI, GTP_CONDITIONAL },
2251 { GTP_EXT_PTMSI, GTP_CONDITIONAL },
2252 { GTP_EXT_PTMSI_SIG, GTP_CONDITIONAL },
2253 { GTP_EXT_MS_VALID, GTP_OPTIONAL },
2254 { GTP_EXT_TEID_CP, GTP_MANDATORY },
2255 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
2256 { GTP_EXT_GSN_ADDR, GTP_OPTIONAL }, /* Alternative SGSN Address for Control Plane Optional 7.7.32 */
2257 { GTP_EXT_SSGN_NO, GTP_OPTIONAL }, /* SGSN Number Optional 7.7.47 */
2258 { GTP_EXT_HOP_COUNT, GTP_OPTIONAL }, /* Hop Counter Optional 7.7.63 */
2259 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2264 GTP_MSG_SGSN_CNTXT_RESP, {
2265 { GTP_EXT_CAUSE, GTP_MANDATORY },
2266 { GTP_EXT_IMSI, GTP_CONDITIONAL },
2267 { GTP_EXT_TEID_CP, GTP_CONDITIONAL },
2268 { GTP_EXT_RAB_CNTXT, GTP_CONDITIONAL }, /* RAB Context Conditional 7.7.19 */
2269 { GTP_EXT_RP_SMS, GTP_OPTIONAL },
2270 { GTP_EXT_RP, GTP_OPTIONAL },
2271 { GTP_EXT_PKT_FLOW_ID, GTP_OPTIONAL },
2272 { GTP_EXT_CHRG_CHAR, GTP_OPTIONAL }, /* CharingCharacteristics Optional 7.7.23 */
2273 { GTP_EXT_RA_PRIO_LCS, GTP_OPTIONAL }, /* Radio Priority LCS Optional 7.7.25B */
2274 { GTP_EXT_MM_CNTXT, GTP_CONDITIONAL },
2275 { GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL },
2276 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
2277 { GTP_EXT_PDP_CONT_PRIO,GTP_OPTIONAL }, /* PDP Context Prioritization Optional 7.7.45 */
2278 { GTP_EXT_MBMS_UE_CTX, GTP_OPTIONAL }, /* MBMS UE Context Optional 7.7.55 */
2279 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2284 GTP_MSG_SGSN_CNTXT_ACK, {
2285 { GTP_EXT_CAUSE, GTP_MANDATORY },
2286 { GTP_EXT_TEID_II, GTP_CONDITIONAL },
2287 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
2288 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2293 GTP_MSG_FORW_RELOC_REQ, {
2294 { GTP_EXT_IMSI, GTP_MANDATORY },
2295 { GTP_EXT_TEID_CP, GTP_MANDATORY },
2296 { GTP_EXT_RANAP_CAUSE, GTP_MANDATORY },
2297 { GTP_EXT_CHRG_CHAR, GTP_OPTIONAL }, /* CharingCharacteristics Optional 7.7.23 */
2298 { GTP_EXT_MM_CNTXT, GTP_MANDATORY },
2299 { GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL },
2300 { GTP_EXT_GSN_ADDR, GTP_MANDATORY },
2301 { GTP_EXT_TARGET_ID, GTP_MANDATORY },
2302 { GTP_EXT_UTRAN_CONT, GTP_MANDATORY },
2303 { GTP_EXT_PDP_CONT_PRIO,GTP_OPTIONAL }, /* PDP Context Prioritization Optional 7.7.45 */
2304 { GTP_EXT_MBMS_UE_CTX, GTP_OPTIONAL }, /* MBMS UE Context Optional 7.7.55 */
2305 { GTP_EXT_SEL_PLMN_ID, GTP_OPTIONAL }, /* Selected PLMN ID Optional 7.7.64 */
2306 { GTP_EXT_PS_HO_REQ_CTX,GTP_OPTIONAL }, /* PS Handover Request Context Optional 7.7.71 */
2307 { GTP_EXT_BSS_CONT, GTP_OPTIONAL }, /* BSS Container Optional 7.7.72 */
2308 { GTP_EXT_CELL_ID, GTP_OPTIONAL }, /* Cell Identification Optional 7.7.73 */
2309 { GTP_EXT_BSSGP_CAUSE, GTP_OPTIONAL }, /* BSSGP Cause Optional 7.7.75 */
2310 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2311 { GTP_EXT_SSGN_NO, GTP_OPTIONAL },
2316 GTP_MSG_FORW_RELOC_RESP, {
2317 { GTP_EXT_CAUSE, GTP_MANDATORY },
2318 { GTP_EXT_TEID_CP, GTP_CONDITIONAL },
2319 { GTP_EXT_TEID_II, GTP_CONDITIONAL }, /* Tunnel Endpoint Identifier Data II Optional 7.7.15 */
2320 { GTP_EXT_RANAP_CAUSE, GTP_CONDITIONAL },
2321 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL },
2322 { GTP_EXT_UTRAN_CONT, GTP_OPTIONAL },
2323 { GTP_EXT_RAB_SETUP, GTP_CONDITIONAL },
2324 { GTP_EXT_ADD_RAB_SETUP_INF, GTP_CONDITIONAL }, /* Additional RAB Setup Information Conditional 7.7.45A */
2325 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2330 GTP_MSG_FORW_RELOC_COMP, {
2331 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2336 GTP_MSG_RELOC_CANCEL_REQ, {
2337 { GTP_EXT_IMSI, GTP_MANDATORY },
2338 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2343 GTP_MSG_RELOC_CANCEL_RESP, {
2344 { GTP_EXT_CAUSE, GTP_MANDATORY },
2345 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2350 GTP_MSG_FORW_RELOC_ACK, {
2351 { GTP_EXT_CAUSE, GTP_MANDATORY },
2352 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2357 GTP_MSG_FORW_SRNS_CNTXT_ACK, {
2358 { GTP_EXT_CAUSE, GTP_MANDATORY },
2359 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2364 GTP_MSG_FORW_SRNS_CNTXT, {
2365 { GTP_EXT_RAB_CNTXT, GTP_MANDATORY },
2366 { GTP_EXT_SRC_RNC_PDP_CTX_INF, GTP_OPTIONAL }, /* Source RNC PDCP context info Optional 7.7.61 */
2367 { GTP_EXT_PDU_NO, GTP_OPTIONAL }, /* PDU Numbers Optional 7.7.74 */
2368 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2373 /* 7.5.14 RAN Information Management Messages */
2375 GTP_MSG_RAN_INFO_RELAY, {
2376 { GTP_EXT_RAN_TR_CONT, GTP_MANDATORY }, /* RAN Transparent Container Mandatory 7.7.43 */
2377 { GTP_EXT_RIM_RA, GTP_OPTIONAL }, /* RIM Routing Address Optional 7.7.57 */
2378 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2382 /* 7.5A MBMS Messages
2383 * 7.5A.1 UE Specific MBMS Messages
2386 GTP_MBMS_NOTIFY_REQ, {
2387 { GTP_EXT_IMSI, GTP_MANDATORY }, /* IMSI Mandatory 7.7.2 */
2388 { GTP_EXT_TEID_CP, GTP_MANDATORY }, /* Tunnel Endpoint Identifier Control Plane Mandatory 7.7.14 */
2389 { GTP_EXT_NSAPI, GTP_MANDATORY }, /* NSAPI Mandatory 7.7.17 */
2390 { GTP_EXT_USER_ADDR, GTP_MANDATORY }, /* End User Address Mandatory 7.7.27 */
2391 { GTP_EXT_APN, GTP_MANDATORY }, /* Access Point Name Mandatory 7.7.30 */
2392 { GTP_EXT_GSN_ADDR, GTP_MANDATORY }, /* GGSN Address for Control Plane Mandatory 7.7.32 */
2393 { GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL }, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2394 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2399 GTP_MBMS_NOTIFY_RES, {
2400 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2401 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2406 GTP_MBMS_NOTIFY_REJ_REQ, {
2407 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2408 { GTP_EXT_TEID_CP, GTP_MANDATORY }, /* Tunnel Endpoint Identifier Control Plane Mandatory 7.7.14 */
2409 { GTP_EXT_NSAPI, GTP_MANDATORY }, /* NSAPI Mandatory 7.7.17 */
2410 { GTP_EXT_USER_ADDR, GTP_MANDATORY }, /* End User Address Mandatory 7.7.27 */
2411 { GTP_EXT_APN, GTP_MANDATORY }, /* Access Point Name Mandatory 7.7.30 */
2412 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2417 GTP_MBMS_NOTIFY_REJ_RES, {
2418 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2419 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2424 GTP_CREATE_MBMS_CNTXT_REQ, {
2425 { GTP_EXT_IMSI, GTP_CONDITIONAL }, /* IMSI Conditional 7.7.2 */
2426 { GTP_EXT_RAI, GTP_MANDATORY }, /* Routeing Area Identity (RAI) Mandatory 7.7.3 */
2427 { GTP_EXT_RECOVER, GTP_OPTIONAL }, /* Recovery Optional 7.7.11 */
2428 { GTP_EXT_SEL_MODE, GTP_CONDITIONAL }, /* Selection mode Conditional 7.7.12 */
2429 { GTP_EXT_TEID_CP, GTP_CONDITIONAL }, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2430 { GTP_EXT_TRACE_REF, GTP_OPTIONAL }, /* Trace Reference Optional 7.7.24 */
2431 { GTP_EXT_TRACE_TYPE, GTP_OPTIONAL }, /* Trace Type Optional 7.7.25 */
2432 { GTP_EXT_USER_ADDR, GTP_MANDATORY }, /* End User Address Mandatory 7.7.27 */
2433 { GTP_EXT_APN, GTP_MANDATORY }, /* Access Point Name Mandatory 7.7.30 */
2434 { GTP_EXT_GSN_ADDR, GTP_MANDATORY }, /* SGSN Address for signalling Mandatory GSN Address 7.7.32 */
2435 { GTP_EXT_MSISDN, GTP_CONDITIONAL }, /* MSISDN Conditional 7.7.33 */
2436 { GTP_EXT_TRIGGER_ID, GTP_OPTIONAL }, /* Trigger Id Optional 7.7.41 */
2437 { GTP_EXT_OMC_ID, GTP_OPTIONAL }, /* OMC Identity Optional 7.7.42 */
2438 { GTP_EXT_RAT_TYPE, GTP_OPTIONAL }, /* RAT Type Optional 7.7.50 */
2439 { GTP_EXT_USR_LOC_INF, GTP_OPTIONAL }, /* User Location Information Optional 7.7.51 */
2440 { GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL }, /* MS Time Zone Optional 7.7.52 */
2441 { GTP_EXT_IMEISV, GTP_OPTIONAL }, /* IMEI(SV) Optional 7.7.53 */
2442 { GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL }, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2443 { GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL }, /* Additonal Trace Info Optional 7.7.62 */
2444 { GTP_EXT_ENH_NSAPI, GTP_MANDATORY }, /* Enhanced NSAPI Mandatory 7.7.67 */
2445 { GTP_EXT_ADD_MBMS_TRS_INF, GTP_OPTIONAL }, /* Additional MBMS Trace Info Optional 7.7.68 */
2446 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2451 GTP_CREATE_MBMS_CNTXT_RES, {
2452 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2453 { GTP_EXT_RECOVER, GTP_OPTIONAL }, /* Recovery Optional 7.7.11 */
2454 { GTP_EXT_TEID_CP, GTP_CONDITIONAL }, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2455 { GTP_EXT_CHRG_ID, GTP_CONDITIONAL }, /* Charging ID Conditional 7.7.26 */
2456 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2457 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* Alternative GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2458 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL }, /* Charging Gateway Address Optional 7.7.44 */
2459 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL }, /* Alternative Charging Gateway Address Optional 7.7.44 */
2460 { GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL }, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2461 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2466 GTP_UPD_MBMS_CNTXT_REQ, {
2467 { GTP_EXT_IMSI, GTP_CONDITIONAL }, /* IMSI Conditional 7.7.2 */
2468 { GTP_EXT_RAI, GTP_MANDATORY }, /* Routeing Area Identity (RAI) Mandatory 7.7.3 */
2469 { GTP_EXT_RECOVER, GTP_OPTIONAL }, /* Recovery Optional 7.7.11 */
2470 { GTP_EXT_TEID_CP, GTP_CONDITIONAL }, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2471 { GTP_EXT_TRACE_REF, GTP_OPTIONAL }, /* Trace Reference Optional 7.7.24 */
2472 { GTP_EXT_TRACE_TYPE, GTP_OPTIONAL }, /* Trace Type Optional 7.7.25 */
2473 { GTP_EXT_GSN_ADDR, GTP_MANDATORY }, /* SGSN Address for Control Plane Mandatory GSN Address 7.7.32 */
2474 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2475 { GTP_EXT_TRIGGER_ID, GTP_OPTIONAL }, /* Trigger Id Optional 7.7.41 */
2476 { GTP_EXT_OMC_ID, GTP_OPTIONAL }, /* OMC Identity Optional 7.7.42 */
2477 { GTP_EXT_RAT_TYPE, GTP_OPTIONAL }, /* RAT Type Optional 7.7.50 */
2478 { GTP_EXT_USR_LOC_INF, GTP_OPTIONAL }, /* User Location Information Optional 7.7.51 */
2479 { GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL }, /* MS Time Zone Optional 7.7.52 */
2480 { GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL }, /* Additional Trace Info Optional 7.7.62 */
2481 { GTP_EXT_ENH_NSAPI, GTP_MANDATORY }, /* Enhanced NSAPI Mandatory 7.7.67 */
2482 { GTP_EXT_ADD_MBMS_TRS_INF, GTP_OPTIONAL }, /* Additional MBMS Trace Info Optional 7.7.68 */
2483 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2488 GTP_UPD_MBMS_CNTXT_RES, {
2489 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2490 { GTP_EXT_RECOVER, GTP_OPTIONAL }, /* Recovery Optional 7.7.11 */
2491 { GTP_EXT_TEID_CP, GTP_MANDATORY }, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2492 { GTP_EXT_CHRG_ID, GTP_CONDITIONAL }, /* Charging ID Conditional 7.7.26 */
2493 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2494 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* Alternative GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2495 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL }, /* Charging Gateway Address Optional 7.7.44 */
2496 { GTP_EXT_CHRG_ADDR, GTP_OPTIONAL }, /* Alternative Charging Gateway Address Optional 7.7.44 */
2497 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2502 GTP_DEL_MBMS_CNTXT_REQ, {
2503 { GTP_EXT_IMSI, GTP_CONDITIONAL }, /* IMSI Conditional 7.7.2 */
2504 { GTP_EXT_TEID_CP, GTP_MANDATORY }, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2505 { GTP_EXT_USER_ADDR, GTP_CONDITIONAL }, /* End User Address Conditional 7.7.27 */
2506 { GTP_EXT_APN, GTP_CONDITIONAL }, /* Access Point Name Conditional 7.7.30 */
2507 { GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL }, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2508 { GTP_EXT_ENH_NSAPI, GTP_MANDATORY }, /* Enhanced NSAPI Conditional 7.7.67 */
2509 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2514 GTP_DEL_MBMS_CNTXT_RES, {
2515 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2516 { GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL }, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2517 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL },
2523 { GTP_EXT_USER_ADDR, GTP_MANDATORY }, /* End User Address Mandatory 7.7.27 */
2524 { GTP_EXT_APN, GTP_MANDATORY }, /* Access Point Name Mandatory 7.7.30 */
2525 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2531 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2532 { GTP_EXT_TMGI, GTP_MANDATORY }, /* Temporary Mobile Group Identity (TMGI) Conditional 7.7.56 */
2533 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2538 GTP_MBMS_DE_REG_REQ, {
2539 { GTP_EXT_USER_ADDR, GTP_MANDATORY }, /* End User Address Mandatory 7.7.27 */
2540 { GTP_EXT_APN, GTP_MANDATORY }, /* Access Point Name Mandatory 7.7.30 */
2541 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2546 GTP_MBMS_DE_REG_RES, {
2547 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2548 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2553 GTP_MBMS_SES_START_REQ, {
2554 { GTP_EXT_RECOVER, GTP_OPTIONAL }, /* Recovery Optional 7.7.11 */
2555 { GTP_EXT_TEID_CP, GTP_CONDITIONAL }, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2556 { GTP_EXT_USER_ADDR, GTP_MANDATORY }, /* End User Address Mandatory 7.7.27 */
2557 { GTP_EXT_APN, GTP_MANDATORY }, /* Access Point Name Mandatory 7.7.30 */
2558 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2559 { GTP_EXT_QOS_UMTS, GTP_MANDATORY }, /* Quality of Service Profile Mandatory 7.7.34 */
2560 { GTP_EXT_COMMON_FLGS, GTP_OPTIONAL }, /* Common Flags Mandatory 7.7.48 */
2561 { GTP_EXT_TMGI, GTP_MANDATORY }, /* Temporary Mobile Group Identity (TMGI) Mandatory 7.7.56 */
2562 { GTP_EXT_MBMS_SES_DUR, GTP_MANDATORY }, /* MBMS Session Duration Mandatory 7.7.59 */
2563 { GTP_EXT_MBMS_SA, GTP_MANDATORY }, /* MBMS Service Area Mandatory 7.7.60 */
2564 { GTP_EXT_MBMS_SES_ID, GTP_OPTIONAL }, /* MBMS Session Identifier Optional 7.7.65 */
2565 { GTP_EXT_MBMS_2G_3G_IND, GTP_MANDATORY }, /* MBMS 2G/3G Indicator Mandatory 7.7.66 */
2566 { GTP_EXT_MBMS_SES_ID_REP_NO, GTP_OPTIONAL }, /* MBMS Session Identity Repetition Number Optional 7.7.69 */
2567 { GTP_EXT_MBMS_TIME_TO_DATA_TR, GTP_MANDATORY }, /* MBMS Time To Data Transfer Mandatory 7.7.70 */
2568 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2573 GTP_MBMS_SES_START_RES, {
2574 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2575 { GTP_EXT_RECOVER, GTP_OPTIONAL }, /* Recovery Optional 7.7.11 */
2576 { GTP_EXT_TEID, GTP_CONDITIONAL }, /* Tunnel Endpoint Identifier Data I Conditional 7.7.13 */
2577 { GTP_EXT_TEID_CP, GTP_CONDITIONAL }, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2578 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2579 { GTP_EXT_GSN_ADDR, GTP_CONDITIONAL }, /* SGSN Address for user traffic Conditional GSN Address 7.7.32 */
2580 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2585 GTP_MBMS_SES_STOP_REQ, {
2586 { GTP_EXT_USER_ADDR, GTP_MANDATORY }, /* End User Address Mandatory 7.7.27 */
2587 { GTP_EXT_APN, GTP_MANDATORY }, /* Access Point Name Mandatory 7.7.30 */
2588 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2593 GTP_MBMS_SES_STOP_RES, {
2594 { GTP_EXT_CAUSE, GTP_MANDATORY }, /* Cause Mandatory 7.7.1 */
2595 { GTP_EXT_PRIV_EXT, GTP_OPTIONAL }, /* Private Extension Optional 7.7.46 */
2607 check_field_presence(guint8 message, guint8 field, int *position) {
2610 _gtp_mess_items *mess_items;
2612 switch(gtp_version) {
2614 mess_items = gprs_mess_items;
2617 mess_items = umts_mess_items;
2623 while (mess_items[i].code) {
2624 if (mess_items[i].code == message) {
2626 while (mess_items[i].fields[*position].code) {
2627 if (mess_items[i].fields[*position].code == field) {
2631 if (mess_items[i].fields[*position].presence == GTP_MANDATORY) {
2632 return mess_items[i].fields[(*position)++].code;
2645 /* Decoders of fields in extension headers, each function returns no of bytes from field */
2647 /* GPRS: 9.60 v7.6.0, chapter
2648 * UMTS: 29.060 v4.0, chapter
2651 decode_gtp_cause(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2655 cause = tvb_get_guint8(tvb, offset+1);
2657 proto_tree_add_uint(tree, hf_gtp_cause, tvb, offset, 2, cause);
2662 /* GPRS: 9.60 v7.6.0, chapter 7.9.2
2663 * UMTS: 29.060 v4.0, chapter 7.7.2
2666 decode_gtp_imsi(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2671 tvb_memcpy(tvb, imsi_val, offset+1, 8);
2672 imsi_str = imsi_to_str (imsi_val);
2674 proto_tree_add_string (tree, hf_gtp_imsi, tvb, offset, 9, imsi_str);
2679 /* GPRS: 9.60 v7.6.0, chapter 7.9.3
2680 * UMTS: 29.060 v4.0, chapter 7.7.3
2683 decode_gtp_rai(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2685 proto_tree *ext_tree_rai;
2690 te = proto_tree_add_text(tree, tvb, offset, 1, val_to_str(GTP_EXT_RAI, gtp_val, "Unknown message"));
2691 ext_tree_rai = proto_item_add_subtree(te, ett_gtp_rai);
2693 byte[0] = tvb_get_guint8 (tvb, offset + 1);
2694 byte[1] = tvb_get_guint8 (tvb, offset + 2);
2695 byte[2] = tvb_get_guint8 (tvb, offset + 3);
2696 mcc = (byte[0] & 0x0F) * 100 + ((byte[0] & 0xF0) >> 4) * 10 + (byte[1] & 0x0F );
2697 if ((byte[1] & 0xF0) == 0xF0)
2698 mnc = (byte[2] & 0x0F) * 10 + ((byte[2] & 0xF0) >> 4);
2700 mnc = (byte[2] & 0x0F) * 100 + ((byte[2] & 0xF0) >> 4 ) * 10 + ((byte[1] & 0xF0) >> 4);
2702 proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_mcc, tvb, offset+1, 2, mcc);
2703 proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_mnc, tvb, offset+2, 2, mnc);
2704 proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_lac, tvb, offset+4, 2, tvb_get_ntohs (tvb, offset+4));
2705 proto_tree_add_uint(ext_tree_rai, hf_gtp_rai_rac, tvb, offset+6, 1, tvb_get_guint8 (tvb, offset+6));
2710 /* GPRS: 9.60 v7.6.0, chapter 7.9.4, page 39
2711 * UMTS: 29.060 v4.0, chapter 7.7.4, page 47
2714 decode_gtp_tlli(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2718 tlli = tvb_get_ntohl(tvb, offset+1);
2719 proto_tree_add_uint(tree, hf_gtp_tlli, tvb, offset, 5, tlli);
2724 /* GPRS: 9.60 v7.6.0, chapter 7.9.5, page 39
2725 * UMTS: 29.060 v4.0, chapter 7.7.5, page 47
2728 decode_gtp_ptmsi(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2732 ptmsi = tvb_get_ntohl (tvb, offset+1);
2733 proto_tree_add_uint (tree, hf_gtp_ptmsi, tvb, offset, 5, ptmsi);
2738 /* adjust - how many bytes before offset should be highlighted
2741 decode_qos_gprs(tvbuff_t *tvb, int offset, proto_tree *tree, const gchar* qos_str, guint8 adjust) {
2743 guint8 spare1, delay, reliability, peak, spare2, precedence, spare3, mean;
2744 proto_tree *ext_tree_qos;
2747 spare1 = tvb_get_guint8(tvb, offset) & 0xC0;
2748 delay = tvb_get_guint8(tvb, offset) & 0x38;
2749 reliability = tvb_get_guint8(tvb, offset) & 0x07;
2750 peak = tvb_get_guint8(tvb, offset+1) & 0xF0;
2751 spare2 = tvb_get_guint8(tvb, offset+1) & 0x08;
2752 precedence = tvb_get_guint8(tvb, offset+1) & 0x07;
2753 spare3 = tvb_get_guint8(tvb, offset+2) & 0xE0;
2754 mean = tvb_get_guint8(tvb, offset+2) & 0x1F;
2756 te = proto_tree_add_text(tree, tvb, offset-adjust, 3+adjust, "%s: delay: %u, reliability: %u, peak: %u, precedence: %u, mean: %u",
2757 qos_str, (delay >> 3) & 0x07, reliability, (peak >> 4) & 0x0F, precedence, mean);
2758 ext_tree_qos = proto_item_add_subtree(te, ett_gtp_qos);
2761 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare1, tvb, offset, 1, spare1);
2762 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_delay, tvb, offset, 1, delay);
2763 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_reliability, tvb, offset, 1, reliability);
2764 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_peak, tvb, offset+1, 1, peak);
2765 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare2, tvb, offset+1, 1, spare2);
2766 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_precedence, tvb, offset+1, 1, precedence);
2767 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare3, tvb, offset+2, 1, spare3);
2768 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_mean, tvb, offset+2, 1, mean);
2774 /* GPRS: 9.60 v7.6.0, chapter 7.9.6, page 39
2778 * TODO: check if length is included: ETSI 4.08 vs 9.60
2781 decode_gtp_qos_gprs(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2783 return (1+decode_qos_gprs(tvb, offset+1, tree, "Quality of Service", 1));
2787 /* GPRS: 9.60 v7.6.0, chapter 7.9.7, page 39
2788 * UMTS: 29.060 v4.0, chapter 7.7.6, page 47
2791 decode_gtp_reorder(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2795 reorder = tvb_get_guint8(tvb, offset+1) & 0x01;
2796 proto_tree_add_boolean(tree, hf_gtp_reorder, tvb, offset, 2, reorder);
2801 /* GPRS: 9.60 v7.6.0, chapter 7.9.8, page 40
2802 * 4.08 v7.1.2, chapter 10.5.3.1+
2803 * UMTS: 29.060 v4.0, chapter 7.7.7
2804 * TODO: Add blurb support by registering items in the protocol registration
2807 decode_gtp_auth_tri(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2809 proto_tree *ext_tree_auth_tri;
2812 te = proto_tree_add_text(tree, tvb, offset, 29, val_to_str(GTP_EXT_AUTH_TRI, gtp_val, "Unknown message"));
2813 ext_tree_auth_tri = proto_item_add_subtree(tree, ett_gtp_auth_tri);
2815 proto_tree_add_text(ext_tree_auth_tri, tvb, offset+1, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset+1, 16));
2816 proto_tree_add_text(ext_tree_auth_tri, tvb, offset+17, 4, "SRES: %s", tvb_bytes_to_str(tvb, offset+17, 4));
2817 proto_tree_add_text(ext_tree_auth_tri, tvb, offset+21, 8, "Kc: %s", tvb_bytes_to_str(tvb, offset+21, 8));
2822 /* GPRS: 9.60 v7.6.0, chapter 7.9.9, page 40
2823 * 9.02 v7.7.0, page 1090
2824 * UMTS: 29.060 v4.0, chapter 7.7.8, page 48
2825 * 29.002 v4.2.1, chapter 17.5, page 268
2828 decode_gtp_map_cause(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2832 map_cause = tvb_get_guint8(tvb, offset+1);
2833 proto_tree_add_uint (tree, hf_gtp_map_cause, tvb, offset, 2, map_cause);
2838 /* GPRS: 9.60 v7.6.0, chapter 7.9.10, page 41
2839 * UMTS: 29.060 v4.0, chapter 7.7.9, page 48
2842 decode_gtp_ptmsi_sig(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2846 ptmsi_sig = tvb_get_ntoh24(tvb, offset+1);
2847 proto_tree_add_uint(tree, hf_gtp_ptmsi_sig, tvb, offset, 4, ptmsi_sig);
2852 /* GPRS: 9.60 v7.6.0, chapter 7.9.11, page 41
2853 * UMTS: 29.060 v4.0, chapter 7.7.10, page 49
2856 decode_gtp_ms_valid(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2860 ms_valid = tvb_get_guint8(tvb, offset+1) & 0x01;
2861 proto_tree_add_boolean (tree, hf_gtp_ms_valid, tvb, offset, 2, ms_valid);
2866 /* GPRS: 9.60 v7.6.0, chapter 7.9.12, page 41
2867 * UMTS: 29.060 v4.0, chapter 7.7.11, page 49
2870 decode_gtp_recovery(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2874 recovery = tvb_get_guint8(tvb, offset+1);
2875 proto_tree_add_uint (tree, hf_gtp_recovery, tvb, offset, 2, recovery);
2880 /* GPRS: 9.60 v7.6.0, chapter 7.9.13, page 42
2881 * UMTS: 29.060 v4.0, chapter 7.7.12, page 49
2884 decode_gtp_sel_mode(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2888 sel_mode = tvb_get_guint8(tvb, offset+1) & 0x03;
2889 proto_tree_add_uint(tree, hf_gtp_sel_mode, tvb, offset, 2, sel_mode);
2894 /* GPRS: 9.60 v7.6.0, chapter 7.9.14, page 42
2895 * UMTS: 29.060 v4.0, chapter 7.7.13, page 50
2898 decode_gtp_16(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2900 guint16 ext_flow_label;
2903 switch (gtp_version) {
2905 ext_flow_label = tvb_get_ntohs(tvb, offset+1);
2906 proto_tree_add_uint(tree, hf_gtp_ext_flow_label, tvb, offset, 3, ext_flow_label);
2910 teid_data = tvb_get_ntohl(tvb, offset+1);
2911 proto_tree_add_uint(tree, hf_gtp_teid_data, tvb, offset, 5, teid_data);
2915 proto_tree_add_text(tree, tvb, offset, 1, "Flow label/TEID Data I : GTP version not supported");
2921 /* GPRS: 9.60 v7.6.0, chapter 7.9.15, page 42
2922 * UMTS: 29.060 v4.0, chapter 7.7.14, page 42
2925 decode_gtp_17(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2930 switch (gtp_version) {
2932 flow_sig = tvb_get_ntohs(tvb, offset+1);
2933 proto_tree_add_uint (tree, hf_gtp_flow_sig, tvb, offset, 3, flow_sig);
2936 teid_cp = tvb_get_ntohl(tvb, offset+1);
2937 proto_tree_add_uint (tree, hf_gtp_teid_cp, tvb, offset, 5, teid_cp);
2940 proto_tree_add_text(tree, tvb, offset, 1, "Flow label signalling/TEID control plane : GTP version not supported");
2945 /* GPRS: 9.60 v7.6.0, chapter 7.9.16, page 42
2946 * UMTS: 29.060 v4.0, chapter 7.7.15, page 51
2949 decode_gtp_18(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2953 proto_tree *ext_tree_flow_ii;
2956 switch (gtp_version) {
2958 te = proto_tree_add_text(tree, tvb, offset, 4, val_to_str(GTP_EXT_FLOW_II, gtp_val, "Unknown message"));
2959 ext_tree_flow_ii = proto_item_add_subtree (te, ett_gtp_flow_ii);
2961 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset+1, 1, tvb_get_guint8(tvb, offset+1) & 0x0F);
2963 flow_ii = tvb_get_ntohs(tvb, offset+2);
2964 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_flow_ii, tvb, offset+2, 2, flow_ii);
2968 te = proto_tree_add_text (tree, tvb, offset, 6, val_to_str(GTP_EXT_TEID_II, gtpv1_val, "Unknown message"));
2969 ext_tree_flow_ii = proto_item_add_subtree(te, ett_gtp_flow_ii);
2971 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset+1, 1, tvb_get_guint8(tvb, offset+1) & 0x0F);
2974 teid_ii = tvb_get_ntohl(tvb, offset+2);
2975 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_teid_ii, tvb, offset+2, 4, teid_ii);
2979 proto_tree_add_text(tree, tvb, offset, 1, "Flow data II/TEID Data II : GTP Version not supported");
2985 /* GPRS: 9.60 v7.6.0, chapter 7.9.16A, page 43
2986 * UMTS: 29.060 v4.0, chapter 7.7.16, page 51
2987 * Check if all ms_reason types are included
2990 decode_gtp_19(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
2994 field19 = tvb_get_guint8(tvb, offset+1);
2996 switch (gtp_version) {
2998 proto_tree_add_uint(tree, hf_gtp_ms_reason, tvb, offset, 2, field19);
3001 proto_tree_add_boolean(tree, hf_gtp_tear_ind, tvb, offset, 2, field19 & 0x01);
3004 proto_tree_add_text(tree, tvb, offset, 1, "Information Element Type = 19 : GTP Version not supported");
3011 /* GPRS: not present
3012 * UMTS: 29.060 v4.0, chapter 7.7.17, page 51
3015 decode_gtp_nsapi(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3019 nsapi = tvb_get_guint8(tvb, offset+1) & 0x0F;
3020 proto_tree_add_uint(tree, hf_gtp_nsapi, tvb, offset, 2, nsapi);
3025 /* GPRS: not present
3026 * UMTS: 29.060 v4.0, chapter 7.7.18, page 52
3029 decode_gtp_ranap_cause(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3033 ranap = tvb_get_guint8(tvb, offset+1);
3035 if(ranap > 0 && ranap <=64)
3036 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
3037 ranap, "%s (Radio Network Layer Cause) : %s (%u)",
3038 val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"),
3039 val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap);
3041 if(ranap > 64 && ranap <=80)
3042 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
3043 ranap, "%s (Transport Layer Cause) : %s (%u)",
3044 val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"),
3045 val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap);
3047 if(ranap > 80 && ranap <=96)
3048 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
3049 ranap, "%s (NAS Cause) : %s (%u)",
3050 val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"),
3051 val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap);
3053 if(ranap > 96 && ranap <=112)
3054 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
3055 "%s (Protocol Cause) : %s (%u)",
3056 val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"),
3057 val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap);
3059 if(ranap > 112 && ranap <=128)
3060 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
3061 "%s (Miscellaneous Cause) : %s (%u)",
3062 val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"),
3063 val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap);
3065 if(ranap > 128 /* && ranap <=255 */)
3066 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
3067 "%s (Non-standard Cause) : %s (%u)",
3068 val_to_str(GTP_EXT_RANAP_CAUSE, gtp_val, "Unknown"),
3069 val_to_str(ranap, ranap_cause_type, "Unknown RANAP Cause"), ranap);
3074 /* GPRS: not present
3075 * UMTS: 29.060 v4.0, chapter 7.7.19, page 52
3078 decode_gtp_rab_cntxt(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3081 proto_tree *ext_tree_rab_cntxt;
3084 te = proto_tree_add_text(tree, tvb, offset, 10, val_to_str(GTP_EXT_RAB_CNTXT, gtp_val, "Unknown message"));
3085 ext_tree_rab_cntxt = proto_item_add_subtree(te, ett_gtp_rab_cntxt);
3087 nsapi = tvb_get_guint8(tvb, offset+1) & 0x0F;
3089 proto_tree_add_uint (ext_tree_rab_cntxt, hf_gtp_nsapi, tvb, offset+1, 1, nsapi);
3090 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_dn, tvb, offset+2, 2, FALSE);
3091 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_up, tvb, offset+4, 2, FALSE);
3092 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_dn, tvb, offset+6, 2, FALSE);
3093 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_up, tvb, offset+8, 2, FALSE);
3099 /* GPRS: not present
3100 * UMTS: 29.060 v4.0, chapter 7.7.20, page 53
3103 decode_gtp_rp_sms(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3107 rp_sms = tvb_get_guint8(tvb, offset+1) & 0x07;
3108 proto_tree_add_uint(tree, hf_gtp_rp_sms, tvb, offset, 2, rp_sms);
3113 /* GPRS: not present
3114 * UMTS: 29.060 v4.0, chapter 7.7.21, page 53
3117 decode_gtp_rp(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3119 proto_tree *ext_tree_rp;
3121 guint8 nsapi, rp, spare;
3123 nsapi = tvb_get_guint8(tvb, offset+1) & 0xF0;
3124 spare = tvb_get_guint8(tvb, offset+1) & 0x08;
3125 rp = tvb_get_guint8(tvb, offset+1) & 0x07;
3127 te = proto_tree_add_uint_format(tree, hf_gtp_rp, tvb, offset, 2, rp, "Radio Priority for NSAPI(%u) : %u", nsapi, rp);
3128 ext_tree_rp = proto_item_add_subtree(tree, ett_gtp_rp);
3130 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_nsapi, tvb, offset+1, 1, nsapi);
3131 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_spare, tvb, offset+1, 1, spare);
3132 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp, tvb, offset+1, 1, rp);
3137 /* GPRS: not present
3138 * UMTS: 29.060 v4.0, chapter 7.7.22, page 53
3141 decode_gtp_pkt_flow_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3143 proto_tree *ext_tree_pkt_flow_id;
3145 guint8 nsapi, pkt_flow_id;
3147 nsapi = tvb_get_guint8(tvb, offset+1) & 0x0F;
3148 pkt_flow_id = tvb_get_guint8(tvb, offset+2);
3150 te = proto_tree_add_uint_format (tree, hf_gtp_pkt_flow_id, tvb, offset,
3151 3, pkt_flow_id, "Packet Flow ID for NSAPI(%u) : %u", nsapi,
3153 ext_tree_pkt_flow_id = proto_item_add_subtree(tree, ett_gtp_pkt_flow_id);
3155 proto_tree_add_uint(ext_tree_pkt_flow_id, hf_gtp_nsapi, tvb, offset+1, 1, nsapi);
3156 proto_tree_add_uint_format(ext_tree_pkt_flow_id, hf_gtp_pkt_flow_id, tvb,
3157 offset+2, 1, pkt_flow_id, "%s : %u",
3158 val_to_str(GTP_EXT_PKT_FLOW_ID, gtp_val, "Unknown message"),
3164 /* GPRS: not present
3165 * UMTS: 29.060 v4.0, chapter 7.7.23, page 53
3166 * TODO: Differenciate these uints?
3169 decode_gtp_chrg_char(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3173 proto_tree *ext_tree_chrg_char;
3175 chrg_char = tvb_get_ntohs(tvb, offset+1);
3177 te = proto_tree_add_uint (tree, hf_gtp_chrg_char, tvb, offset, 3, chrg_char);
3178 /*"%s: %x", val_to_str (GTP_EXT_CHRG_CHAR, gtp_val, "Unknown message"), chrg_char);*/
3179 ext_tree_chrg_char = proto_item_add_subtree(te, ett_gtp_chrg_char);
3181 proto_tree_add_uint (ext_tree_chrg_char, hf_gtp_chrg_char_s, tvb, offset+1, 2, chrg_char);
3182 proto_tree_add_uint (ext_tree_chrg_char, hf_gtp_chrg_char_n, tvb, offset+1, 2, chrg_char);
3183 proto_tree_add_uint (ext_tree_chrg_char, hf_gtp_chrg_char_p, tvb, offset+1, 2, chrg_char);
3184 proto_tree_add_uint (ext_tree_chrg_char, hf_gtp_chrg_char_f, tvb, offset+1, 2, chrg_char);
3185 proto_tree_add_uint (ext_tree_chrg_char, hf_gtp_chrg_char_h, tvb, offset+1, 2, chrg_char);
3186 proto_tree_add_uint (ext_tree_chrg_char, hf_gtp_chrg_char_r, tvb, offset+1, 2, chrg_char);
3191 /* GPRS: not present
3192 * UMTS: 29.060 v4.0, chapter 7.7.24, page
3195 decode_gtp_trace_ref(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3199 trace_ref = tvb_get_ntohs(tvb, offset+1);
3201 proto_tree_add_uint (tree, hf_gtp_trace_ref, tvb, offset, 3, trace_ref);
3206 /* GPRS: not present
3207 * UMTS: 29.060 v4.0, chapter 7.7.25, page
3210 decode_gtp_trace_type(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3214 trace_type = tvb_get_ntohs(tvb, offset+1);
3216 proto_tree_add_uint (tree, hf_gtp_trace_type, tvb, offset, 3, trace_type);
3221 /* GPRS: 9.60 v7.6.0, chapter 7.9.16A
3222 * UMTS: 29.060 v4.0, chapter 7.7.25A, page
3225 decode_gtp_ms_reason(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3229 reason = tvb_get_guint8(tvb, offset+1);
3231 proto_tree_add_uint (tree, hf_gtp_ms_reason, tvb, offset, 2, reason);
3237 * UMTS: 29.060 v6.11.0, chapter 7.7.25B
3238 * Radio Priority LCS
3241 decode_gtp_ra_prio_lcs(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3244 proto_tree *ext_tree;
3247 length = tvb_get_ntohs(tvb, offset+1);
3248 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_RA_PRIO_LCS, gtp_val, "Unknown"));
3249 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ra_prio_lcs);
3252 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
3254 /* TODO add decoding of data */
3255 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
3261 /* GPRS: 12.15 v7.6.0, chapter 7.3.3, page 45
3265 decode_gtp_tr_comm(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3269 tr_command = tvb_get_guint8(tvb, offset+1);
3271 proto_tree_add_uint (tree, hf_gtp_tr_comm, tvb, offset, 2, tr_command);
3276 /* GPRS: 9.60 v7.6.0, chapter 7.9.17, page 43
3277 * UMTS: 29.060 v4.0, chapter 7.7.26, page 55
3280 decode_gtp_chrg_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3284 chrg_id = tvb_get_ntohl(tvb, offset+1);
3285 proto_tree_add_uint (tree, hf_gtp_chrg_id, tvb, offset, 5, chrg_id);
3290 /* GPRS: 9.60 v7.6.0, chapter 7.9.18, page 43
3291 * UMTS: 29.060 v4.0, chapter 7.7.27, page 55
3294 decode_gtp_user_addr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3297 guint8 pdp_typ, pdp_org;
3299 struct e_in6_addr addr_ipv6;
3300 proto_tree *ext_tree_user;
3304 length = tvb_get_ntohs(tvb, offset+1);
3305 pdp_org = tvb_get_guint8(tvb, offset+3) & 0x0F;
3306 pdp_typ = tvb_get_guint8(tvb, offset+4);
3308 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s (%s/%s)",
3309 val_to_str(GTP_EXT_USER_ADDR, gtp_val, "Unknown message"),
3310 val_to_str(pdp_org, pdp_org_type, "Unknown PDP Organization"),
3311 val_to_str(pdp_typ, pdp_type, "Unknown PDP Type"));
3312 ext_tree_user = proto_item_add_subtree(te, ett_gtp_user);
3314 proto_tree_add_text(ext_tree_user, tvb, offset+1, 2, "Length : %u", length);
3315 proto_tree_add_uint(ext_tree_user, hf_gtp_user_addr_pdp_org, tvb, offset+3, 1, pdp_org);
3316 proto_tree_add_uint(ext_tree_user, hf_gtp_user_addr_pdp_type, tvb, offset+4, 1, pdp_typ);
3319 if (pdp_org == 0 && pdp_typ == 1)
3320 proto_item_append_text(te, " (Point to Point Protocol)");
3321 else if (pdp_typ == 2)
3322 proto_item_append_text(te, " (Octet Stream Protocol)");
3323 } else if (length > 2) {
3326 addr_ipv4 = tvb_get_ipv4(tvb, offset+5);
3327 proto_tree_add_ipv4(ext_tree_user, hf_gtp_user_ipv4, tvb, offset+5, 4, addr_ipv4);
3328 proto_item_append_text(te, " : %s", ip_to_str((guint8 *)&addr_ipv4));
3331 tvb_get_ipv6(tvb, offset+5, &addr_ipv6);
3332 proto_tree_add_ipv6 (ext_tree_user, hf_gtp_user_ipv6, tvb, offset+5, 16, (guint8 *)&addr_ipv6);
3333 proto_item_append_text(te, " : %s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
3337 proto_item_append_text(te, " : empty PDP Address");
3343 decode_triplet(tvbuff_t *tvb, int offset, proto_tree *tree, guint16 count) {
3345 proto_tree *ext_tree_trip;
3346 proto_item *te_trip;
3349 for (i=0;i<count;i++) {
3350 te_trip = proto_tree_add_text(tree, tvb, offset+i*28, 28, "Triplet no%x", i);
3351 ext_tree_trip = proto_item_add_subtree(te_trip, ett_gtp_trip);
3353 proto_tree_add_text(ext_tree_trip, tvb, offset+i*28, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset+i*28, 16));
3354 proto_tree_add_text(ext_tree_trip, tvb, offset+i*28+16, 4, "SRES: %s", tvb_bytes_to_str(tvb, offset+i*28+16, 4));
3355 proto_tree_add_text(ext_tree_trip, tvb, offset+i*28+20, 8, "Kc: %s", tvb_bytes_to_str(tvb, offset+i*28+20, 8));
3361 /* adjust - how many bytes before quintuplet should be highlighted
3364 decode_quintuplet(tvbuff_t *tvb, int offset, proto_tree *tree, guint16 count) {
3366 proto_tree *ext_tree_quint;
3367 proto_item *te_quint;
3368 guint16 q_offset, i;
3369 guint8 xres_len, auth_len;
3373 for (i=0;i<count;i++) {
3375 te_quint = proto_tree_add_text(tree, tvb, offset, -1, "Quintuplet #%x", i+1);
3376 ext_tree_quint = proto_item_add_subtree(te_quint, ett_gtp_quint);
3379 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset, 16));
3380 q_offset = q_offset + 16;
3381 xres_len = tvb_get_guint8(tvb, offset+q_offset);
3382 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 1, "XRES length: %u", xres_len);
3384 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, xres_len, "XRES: %s", tvb_bytes_to_str(tvb, offset + q_offset, xres_len));
3385 q_offset = q_offset + xres_len;
3386 proto_tree_add_text(ext_tree_quint, tvb ,offset + q_offset, 16, "Quintuplet Ciphering Key: %s", tvb_bytes_to_str(tvb, offset + q_offset, 16));
3387 q_offset = q_offset + 16;
3388 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 16, "Quintuplet Integrity Key: %s", tvb_bytes_to_str(tvb, offset + q_offset, 16));
3389 q_offset = q_offset +16;
3390 auth_len = tvb_get_guint8(tvb, offset + q_offset);
3391 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 1, "Authentication length: %u", auth_len);
3393 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, auth_len, "AUTH: %s", tvb_bytes_to_str(tvb, offset + q_offset, auth_len));
3395 q_offset = q_offset+auth_len;
3396 proto_item_set_end(te_quint, tvb, offset+q_offset);
3403 /* GPRS: 9.60 v7.6.0, chapter 7.9.19 page
3404 * UMTS: 29.060 v4.0, chapter 7.7.28 page 57
3405 * TODO: - check if for quintuplets first 2 bytes are length, according to AuthQuint
3406 * - finish displaying last 3 parameters
3409 decode_gtp_mm_cntxt(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3411 guint16 length, quint_len, con_len;
3412 guint8 cksn, count, sec_mode, len;
3413 proto_tree *ext_tree_mm;
3415 proto_item *tf = NULL;
3416 proto_tree *tf_tree = NULL;
3420 te = proto_tree_add_text(tree, tvb, offset, 1, val_to_str(GTP_EXT_MM_CNTXT, gtp_val, "Unknown message"));
3421 ext_tree_mm = proto_item_add_subtree(te, ett_gtp_mm);
3424 length = tvb_get_ntohs(tvb, offset+1);
3425 if (length < 1) return 3;
3428 cksn = tvb_get_guint8(tvb, offset+3) & 0x07;
3430 sec_mode = (tvb_get_guint8(tvb, offset+4) >> 6) & 0x03;
3431 count = (tvb_get_guint8(tvb, offset+4) >> 3) & 0x07;
3433 proto_tree_add_text(ext_tree_mm, tvb, offset+1, 2, "Length: %x", length);
3434 if (gtp_version == 0)
3439 case 0: /* Used cipher value, UMTS keys and Quintuplets */
3440 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn_ksi, tvb, offset+3, 1, FALSE);
3441 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset+4, 1, FALSE);
3442 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset+4, 1, FALSE);
3443 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset+4, 1, FALSE);
3444 proto_tree_add_text(ext_tree_mm, tvb, offset+5, 16, "Ciphering key CK: %s", tvb_bytes_to_str(tvb, offset+5, 16));
3445 proto_tree_add_text(ext_tree_mm, tvb, offset+21, 16, "Integrity key IK: %s", tvb_bytes_to_str(tvb, offset+21, 16));
3446 quint_len = tvb_get_ntohs(tvb, offset+37);
3447 proto_tree_add_text(ext_tree_mm, tvb, offset+37, 2, "Quintuplets length: 0x%x (%u)", quint_len, quint_len);
3449 offset = offset + decode_quintuplet(tvb, offset+39, ext_tree_mm, count) + 39;
3453 case 1: /* GSM key and triplets */
3454 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset+3, 1, FALSE);
3455 if (gtp_version != 0)
3456 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset+4, 1, FALSE);
3458 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset+4, 1, FALSE);
3459 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset+4, 1, FALSE);
3460 proto_tree_add_text(ext_tree_mm, tvb, offset+5, 8, "Ciphering key Kc: %s", tvb_bytes_to_str(tvb, offset+5, 8));
3462 offset = offset + decode_triplet(tvb, offset+13, ext_tree_mm, count) + 13;
3465 case 2: /* UMTS key and quintuplets */
3466 proto_tree_add_item(ext_tree_mm, hf_gtp_ksi, tvb, offset+3, 1, FALSE);
3467 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset+4, 1, FALSE);
3468 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset+4, 1, FALSE);
3469 proto_tree_add_text(ext_tree_mm, tvb, offset+5, 16, "Ciphering key CK: %s", tvb_bytes_to_str(tvb, offset+5, 16));
3470 proto_tree_add_text(ext_tree_mm, tvb, offset+21, 16, "Integrity key IK: %s", tvb_bytes_to_str(tvb, offset+21, 16));
3471 quint_len = tvb_get_ntohs(tvb, offset+37);
3472 proto_tree_add_text(ext_tree_mm, tvb, offset+37, 2, "Quintuplets length: 0x%x (%u)", quint_len, quint_len);
3474 offset = offset + decode_quintuplet(tvb, offset+39, ext_tree_mm, count) + 39;
3477 case 3: /* GSM key and quintuplets */
3478 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset+3, 1, FALSE);
3479 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset+4, 1, FALSE);
3480 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset+4, 1, FALSE);
3481 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset+4, 1, FALSE);
3482 proto_tree_add_text(ext_tree_mm, tvb, offset+5, 8, "Ciphering key Kc: %s", tvb_bytes_to_str(tvb, offset+5, 8));
3483 quint_len = tvb_get_ntohs(tvb, offset+13);
3484 proto_tree_add_text(ext_tree_mm, tvb, offset+13, 2, "Quintuplets length: 0x%x (%u)", quint_len, quint_len);
3486 offset = offset + decode_quintuplet(tvb, offset+15, ext_tree_mm, count) + 15;
3494 * 3GPP TS 24.008 10.5.5.6 ( see packet-gsm_a.c )
3496 de_gmm_drx_param(tvb, ext_tree_mm, offset, 2, NULL, 0);
3499 len = tvb_get_guint8(tvb, offset);
3500 tf = proto_tree_add_text(ext_tree_mm,
3502 "MS Network Capability");
3504 tf_tree = proto_item_add_subtree(tf, ett_gtp_net_cap);
3506 proto_tree_add_text(tf_tree, tvb, offset, 1, "Length of MS network capability contents: %u", len);
3510 * GPP TS 24.008 10.5.5.12 ( see packet-gsm_a.c )
3512 de_gmm_ms_net_cap(tvb, tf_tree, offset, len, NULL, 0);
3513 offset = offset +len;
3515 /* Container contains one or several optional information elements as described in the clause 'Overview',
3516 * from the clause 'General message format and information elements coding' in 3GPP TS 24.008.
3517 * The IMEISV shall, if available, be included in the Container.
3520 con_len = tvb_get_ntohs(tvb, offset);
3521 proto_tree_add_text(ext_tree_mm, tvb, offset, 2, "Container length: %u", con_len);
3522 offset = offset + 2;
3526 l3_tvb = tvb_new_subset(tvb, offset,con_len, con_len );
3527 if (!dissector_try_port(bssap_pdu_type_table,BSSAP_PDU_TYPE_DTAP, l3_tvb, pinfo, ext_tree_mm))
3528 call_dissector(data_handle, l3_tvb, pinfo, ext_tree_mm);
3534 /* Function to extract the value of an hexadecimal octet. Only the lower
3535 * nybble will be non-zero in the output.
3537 static guint8 hex2dec (guint8 x)
3539 if ((x >= 'a') && (x <= 'f'))
3541 else if ((x >= 'A') && (x <= 'F'))
3543 else if ((x >= '0') && (x <= '9'))
3550 /* Wrapper function to add UTF-8 decoding for QoS attributes in
3553 static guint8 wrapped_tvb_get_guint8( tvbuff_t *tvb, int offset, int type)
3556 return (hex2dec(tvb_get_guint8(tvb, offset)) << 4
3557 | hex2dec(tvb_get_guint8(tvb, offset + 1)));
3559 return tvb_get_guint8(tvb, offset);
3562 /* WARNING : actually length is coded on 2 octets for QoS profile but on 1 octet for PDP Context!
3563 * so type means length of length :-)
3565 * WARNING :) type does not mean length of length any more... see below for
3569 decode_qos_umts(tvbuff_t *tvb, int offset, proto_tree *tree, const gchar* qos_str, guint8 type) {
3572 guint8 al_ret_priority;
3573 guint8 delay, reliability, peak, precedence, mean, spare1, spare2, spare3;
3574 guint8 traf_class, del_order, del_err_sdu;
3575 guint8 max_sdu_size, max_ul, max_dl;
3576 guint8 res_ber, sdu_err_ratio;
3577 guint8 trans_delay, traf_handl_prio;
3578 guint8 guar_ul, guar_dl;
3579 proto_tree *ext_tree_qos;
3581 int mss, mu, md, gu, gd;
3583 /* Will keep if the input is UTF-8 encoded (as in RADIUS messages).
3584 * If 1, input is *not* UTF-8 encoded (i.e. each input octet corresponds
3585 * to one byte to be dissected).
3586 * If 2, input is UTF-8 encoded (i.e. each *couple* of input octets
3587 * corresponds to one byte to be dissected)
3589 guint8 utf8_type = 1;
3591 /* In RADIUS messages the QoS has a version field of two octets prepended.
3592 * As of 29.061 v.3.a.0, there is an hyphen between "Release Indicator" and
3593 * <release specific QoS IE UTF-8 encoding>. Even if it sounds rather
3594 * inconsistent and unuseful, I will check hyphen presence here and
3595 * will signal its presence.
3599 /* Will keep the value that will be returned
3605 length = tvb_get_guint8 (tvb, offset);
3606 te = proto_tree_add_text (tree, tvb, offset, length + 1, "%s", qos_str);
3607 ext_tree_qos = proto_item_add_subtree (te, ett_gtp_qos);
3608 proto_tree_add_text (ext_tree_qos, tvb, offset, 1, "Length: %u", length);
3610 retval = length + 1;
3613 length = tvb_get_ntohs (tvb, offset + 1);
3614 te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", qos_str);
3615 ext_tree_qos = proto_item_add_subtree (te, ett_gtp_qos);
3616 proto_tree_add_text (ext_tree_qos, tvb, offset + 1, 2, "Length: %u", length);
3617 offset += 3; /* +1 because of first 0x86 byte for UMTS QoS */
3618 retval = length + 3;
3621 /* For QoS inside RADIUS Client messages from GGSN */
3624 /* The field in the RADIUS message is the length of the tvb we were given */
3625 length = tvb_length(tvb);
3626 te = proto_tree_add_text (tree, tvb, offset, length, "%s", qos_str);
3628 ext_tree_qos = proto_item_add_subtree (te, ett_gtp_qos);
3630 proto_tree_add_item (ext_tree_qos, hf_gtp_qos_version, tvb, offset, 2, FALSE);
3632 /* Hyphen handling */
3633 hyphen = tvb_get_guint8(tvb, offset + 2);
3634 if (hyphen == ((guint8) '-'))
3636 /* Hyphen is present, put in protocol tree */
3637 proto_tree_add_text (ext_tree_qos, tvb, offset + 2, 1, "Hyphen separator: -");
3638 offset++; /* "Get rid" of hyphen */
3641 /* Now, we modify offset here and in order to use type later
3648 retval = length + 2; /* Actually, will be ignored. */
3651 /* XXX - what should we do with the length here? */
3654 ext_tree_qos = NULL;
3658 /* In RADIUS messages there is no allocation-retention priority
3659 * so I don't need to wrap the following call to tvb_get_guint8
3661 al_ret_priority = tvb_get_guint8 (tvb, offset);
3663 /* All calls are wrapped to take into account the possibility that the
3664 * input is UTF-8 encoded. If utf8_type is equal to 1, the final value
3665 * of the offset will be the same as in the previous version of this
3666 * dissector, and the wrapped function will serve as a dumb wrapper;
3667 * otherwise, if utf_8_type is 2, the offset is correctly shifted by
3668 * two bytes for needed shift, and the wrapped function will unencode
3669 * two values from the input.
3671 spare1 = wrapped_tvb_get_guint8(tvb, offset+(1 - 1) * utf8_type + 1, utf8_type) & 0xC0;
3672 delay = wrapped_tvb_get_guint8(tvb, offset+(1 - 1) * utf8_type + 1, utf8_type) & 0x38;
3673 reliability = wrapped_tvb_get_guint8(tvb, offset+(1 - 1) * utf8_type + 1, utf8_type) & 0x07;
3674 peak = wrapped_tvb_get_guint8(tvb, offset+(2 - 1) * utf8_type + 1, utf8_type) & 0xF0;
3675 spare2 = wrapped_tvb_get_guint8(tvb, offset+(2 - 1) * utf8_type + 1, utf8_type) & 0x08;
3676 precedence = wrapped_tvb_get_guint8(tvb, offset+(2 - 1) * utf8_type + 1, utf8_type) & 0x07;
3677 spare3 = wrapped_tvb_get_guint8(tvb, offset+(3 - 1) * utf8_type + 1, utf8_type) & 0xE0;
3678 mean = wrapped_tvb_get_guint8(tvb, offset+(3 - 1) * utf8_type + 1, utf8_type) & 0x1F;
3680 /* In RADIUS messages there is no allocation-retention priority */
3682 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_al_ret_priority, tvb, offset, 1, al_ret_priority);
3684 /* All additions must take care of the fact that QoS fields in RADIUS
3685 * messages are UTF-8 encoded, so we have to use the same trick as above.
3687 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare1, tvb, offset+(1 - 1) * utf8_type + 1, utf8_type, spare1);
3688 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_delay, tvb, offset+(1 - 1) * utf8_type + 1, utf8_type, delay);
3689 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_reliability, tvb, offset+(1 - 1) * utf8_type + 1, utf8_type, reliability);
3690 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_peak, tvb, offset+(2 - 1) * utf8_type + 1, utf8_type, peak);
3691 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare2, tvb, offset+(2 - 1) * utf8_type + 1, utf8_type, spare2);
3692 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_precedence, tvb, offset+(2 - 1) * utf8_type + 1, utf8_type, precedence);
3693 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare3, tvb, offset+(3 - 1) * utf8_type + 1, utf8_type, spare3);
3694 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_mean, tvb, offset+(3 - 1) * utf8_type + 1, utf8_type, mean);
3698 /* See above for the need of wrapping
3700 traf_class = wrapped_tvb_get_guint8(tvb, offset+(4 - 1) * utf8_type + 1, utf8_type) & 0xE0;
3701 del_order = wrapped_tvb_get_guint8(tvb, offset+(4 - 1) * utf8_type + 1, utf8_type) & 0x18;
3702 del_err_sdu = wrapped_tvb_get_guint8(tvb, offset+(4 - 1) * utf8_type + 1, utf8_type) & 0x07;
3703 max_sdu_size = wrapped_tvb_get_guint8(tvb, offset+(5 - 1) * utf8_type + 1, utf8_type);
3704 max_ul = wrapped_tvb_get_guint8(tvb, offset+(6 - 1) * utf8_type + 1, utf8_type);
3705 max_dl = wrapped_tvb_get_guint8(tvb, offset+(7 - 1) * utf8_type + 1, utf8_type);
3706 res_ber = wrapped_tvb_get_guint8(tvb, offset+(8 - 1) * utf8_type + 1, utf8_type) & 0xF0;
3707 sdu_err_ratio = wrapped_tvb_get_guint8(tvb, offset+(8 - 1) * utf8_type + 1, utf8_type) & 0x0F;
3708 trans_delay = wrapped_tvb_get_guint8(tvb, offset+(9 - 1) * utf8_type + 1, utf8_type) & 0xFC;
3709 traf_handl_prio = wrapped_tvb_get_guint8(tvb, offset+(9 - 1) * utf8_type + 1, utf8_type) & 0x03;
3710 guar_ul = wrapped_tvb_get_guint8(tvb, offset+(10 - 1) * utf8_type + 1, utf8_type);
3711 guar_dl = wrapped_tvb_get_guint8(tvb, offset+(11 - 1) * utf8_type + 1, utf8_type);
3713 /* See above comments for the changes
3715 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_class, tvb, offset+(4 - 1) * utf8_type + 1, utf8_type, traf_class);
3716 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_order, tvb, offset+(4 - 1) * utf8_type + 1, utf8_type, del_order);
3717 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);
3718 if (max_sdu_size == 0 || max_sdu_size > 150)
3719 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset+(5 - 1) * utf8_type + 1, utf8_type, max_sdu_size);
3720 if (max_sdu_size > 0 && max_sdu_size <= 150) {
3721 mss = max_sdu_size*10;
3722 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset+(5 - 1) * utf8_type + 1, utf8_type, mss, "Maximum SDU size : %u octets", mss);
3725 if(max_ul == 0 || max_ul == 255)
3726 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset+(6 - 1) * utf8_type + 1, utf8_type, max_ul);
3727 if(max_ul > 0 && max_ul <= 63)
3728 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset+(6 - 1) * utf8_type + 1, utf8_type, max_ul, "Maximum bit rate for uplink : %u kbps", max_ul);
3729 if(max_ul > 63 && max_ul <=127) {
3730 mu = 64 + ( max_ul - 64 ) * 8;
3731 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset+(6 - 1) * utf8_type + 1, utf8_type, mu, "Maximum bit rate for uplink : %u kbps", mu);
3734 if(max_ul > 127 && max_ul <=254) {
3735 mu = 576 + ( max_ul - 128 ) * 64;
3736 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset+(6 - 1) * utf8_type + 1, utf8_type, mu, "Maximum bit rate for uplink : %u kbps", mu);
3739 if(max_dl == 0 || max_dl == 255)
3740 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset+(7 - 1) * utf8_type + 1, utf8_type, max_dl);
3741 if(max_dl > 0 && max_dl <= 63)
3742 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset+(7 - 1) * utf8_type + 1, utf8_type, max_dl, "Maximum bit rate for downlink : %u kbps", max_dl);
3743 if(max_dl > 63 && max_dl <=127) {
3744 md = 64 + ( max_dl - 64 ) * 8;
3745 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset+(7 - 1) * utf8_type + 1, utf8_type, md, "Maximum bit rate for downlink : %u kbps", md);
3747 if(max_dl > 127 && max_dl <=254) {
3748 md = 576 + ( max_dl - 128 ) * 64;
3749 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset+(7 - 1) * utf8_type + 1, utf8_type, md, "Maximum bit rate for downlink : %u kbps", md);
3752 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_res_ber, tvb, offset+(8 - 1) * utf8_type + 1, utf8_type, res_ber);
3753 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_sdu_err_ratio, tvb, offset+(8 - 1) * utf8_type + 1, utf8_type, sdu_err_ratio);
3754 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_trans_delay, tvb, offset+(9 - 1) * utf8_type + 1, utf8_type, trans_delay);
3755 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_handl_prio, tvb, offset+(9 - 1) * utf8_type + 1, utf8_type, traf_handl_prio);
3757 if(guar_ul == 0 || guar_ul == 255)
3758 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset+(10 - 1) * utf8_type + 1, utf8_type, guar_ul);
3759 if(guar_ul > 0 && guar_ul <= 63)
3760 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset+(10 - 1) * utf8_type + 1, utf8_type, guar_ul, "Guaranteed bit rate for uplink : %u kbps", guar_ul);
3761 if(guar_ul > 63 && guar_ul <=127) {
3762 gu = 64 + ( guar_ul - 64 ) * 8;
3763 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset+(10 - 1) * utf8_type + 1, utf8_type, gu, "Guaranteed bit rate for uplink : %u kbps", gu);
3765 if(guar_ul > 127 && guar_ul <=254) {
3766 gu = 576 + ( guar_ul - 128 ) * 64;
3767 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset+(10 - 1) * utf8_type + 1, utf8_type, gu, "Guaranteed bit rate for uplink : %u kbps", gu);
3770 if(guar_dl == 0 || guar_dl == 255)
3771 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset+(11 - 1) * utf8_type + 1, utf8_type, guar_dl);
3772 if(guar_dl > 0 && guar_dl <= 63)
3773 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset+(11 - 1) * utf8_type + 1, utf8_type, guar_dl, "Guaranteed bit rate for downlink : %u kbps", guar_dl);
3774 if(guar_dl > 63 && guar_dl <=127) {
3775 gd = 64 + ( guar_dl - 64 ) * 8;
3776 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset+(11 - 1) * utf8_type + 1, utf8_type, gd, "Guaranteed bit rate for downlink : %u kbps", gd);
3778 if(guar_dl > 127 && guar_dl <=254) {
3779 gd = 576 + ( guar_dl - 128 ) * 64;
3780 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset+(11 - 1) * utf8_type + 1, utf8_type, gd, "Guaranteed bit rate for downlink : %u kbps", gd);
3788 static const gchar* dissect_radius_qos_umts(proto_tree *tree, tvbuff_t *tvb) {
3789 decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3);
3790 return tvb_get_ephemeral_string(tvb,0,tvb_length(tvb));
3794 decode_apn(tvbuff_t *tvb, int offset, guint16 length, proto_tree *tree) {
3800 name_len = tvb_get_guint8 (tvb, offset);
3802 if (name_len < 0x20) {
3803 apn = tvb_get_ephemeral_string(tvb, offset + 1, length - 1);
3805 if (name_len >= length - 1) break;
3807 name_len = name_len + apn[tmp] + 1;
3811 apn = tvb_get_ephemeral_string(tvb, offset, length);
3813 proto_tree_add_string (tree, hf_gtp_apn, tvb, offset, length, apn);
3817 /* GPRS: 9.60 v7.6.0, chapter 7.9.20
3818 * UMTS: 29.060 v4.0, chapter 7.7.29
3819 * TODO: unify addr functions
3822 decode_gtp_pdp_cntxt(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3824 guint8 ggsn_addr_len, apn_len, trans_id, vaa, order, nsapi, sapi, pdu_send_no, pdu_rec_no, pdp_cntxt_id,
3825 pdp_type_org, pdp_type_num, pdp_addr_len;
3826 guint16 length, sn_down, sn_up, up_flow;
3827 guint32 addr_ipv4, up_teid, up_teid_cp;
3828 struct e_in6_addr addr_ipv6;
3829 proto_tree *ext_tree_pdp;
3832 length = tvb_get_ntohs(tvb, offset+1);
3834 te = proto_tree_add_text(tree, tvb, offset, length+3, val_to_str(GTP_EXT_PDP_CNTXT, gtp_val, "Unknown message"));
3835 ext_tree_pdp = proto_item_add_subtree(te, ett_gtp_pdp);
3837 vaa = (tvb_get_guint8(tvb, offset+3) >> 6) & 0x01;
3838 order = (tvb_get_guint8(tvb, offset+3) >> 4) & 0x01;
3839 nsapi = tvb_get_guint8(tvb, offset+3) & 0x0F;
3840 sapi = tvb_get_guint8(tvb, offset+4) & 0x0F;
3842 proto_tree_add_text(ext_tree_pdp, tvb, offset+3, 1, "VPLMN address allowed: %s", yesno[vaa]);
3843 proto_tree_add_text(ext_tree_pdp, tvb, offset+3, 1, "Reordering required: %s", yesno[order]);
3844 proto_tree_add_text(ext_tree_pdp, tvb, offset+3, 1, "NSAPI: %u", nsapi);
3845 proto_tree_add_text(ext_tree_pdp, tvb, offset+4, 1, "SAPI: %u", sapi);
3847 switch (gtp_version) {
3849 decode_qos_gprs(tvb, offset+5, ext_tree_pdp, "QoS subscribed", 0);
3850 decode_qos_gprs(tvb, offset+8, ext_tree_pdp, "QoS requested", 0);
3851 decode_qos_gprs(tvb, offset+11, ext_tree_pdp, "QoS negotiated", 0);
3852 offset = offset + 14;
3855 offset = offset + 5;
3856 offset = offset + decode_qos_umts(tvb, offset, ext_tree_pdp, "QoS subscribed", 1);
3857 offset = offset + decode_qos_umts(tvb, offset, ext_tree_pdp, "QoS requested", 1);
3858 offset = offset + decode_qos_umts(tvb, offset, ext_tree_pdp, "QoS negotiated", 1);
3864 sn_down = tvb_get_ntohs(tvb, offset);
3865 sn_up = tvb_get_ntohs(tvb, offset+2);
3866 pdu_send_no = tvb_get_guint8(tvb, offset+4);
3867 pdu_rec_no = tvb_get_guint8(tvb, offset+5);
3869 proto_tree_add_text(ext_tree_pdp, tvb, offset, 2, "Sequence number down: %u", sn_down);
3870 proto_tree_add_text(ext_tree_pdp, tvb, offset+2, 2, "Sequence number up: %u", sn_up);
3871 proto_tree_add_text(ext_tree_pdp, tvb, offset+4, 1, "Send N-PDU number: %u", pdu_send_no);
3872 proto_tree_add_text(ext_tree_pdp, tvb, offset+5, 1, "Receive N-PDU number: %u", pdu_rec_no);
3874 switch (gtp_version) {
3876 up_flow = tvb_get_ntohs(tvb, offset+6);
3877 proto_tree_add_text(ext_tree_pdp, tvb, offset+6, 2, "Uplink flow label signalling: %u", up_flow);
3878 offset = offset + 8;
3881 up_teid = tvb_get_ntohl(tvb, offset+6);
3882 up_teid_cp = tvb_get_ntohl(tvb, offset+10);
3883 pdp_cntxt_id = tvb_get_guint8(tvb, offset+14);
3884 proto_tree_add_text(ext_tree_pdp, tvb, offset+6, 4, "Uplink TEID: %x", up_teid);
3885 proto_tree_add_text(ext_tree_pdp, tvb, offset+10, 4, "Uplink TEID control plane: %x", up_teid_cp);
3886 proto_tree_add_text(ext_tree_pdp, tvb, offset+14, 1, "PDP context identifier: %u", pdp_cntxt_id);
3887 offset = offset + 15;
3893 pdp_type_org = tvb_get_guint8(tvb, offset) & 0x0F;
3894 pdp_type_num = tvb_get_guint8(tvb, offset+1);
3895 pdp_addr_len = tvb_get_guint8(tvb, offset+2);
3897 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "PDP organization: %s", val_to_str(pdp_type_org, pdp_type, "Unknown PDP org"));
3898 proto_tree_add_text(ext_tree_pdp, tvb, offset+1, 1, "PDP type: %s", val_to_str(pdp_type_num, pdp_type, "Unknown PDP type"));
3899 proto_tree_add_text(ext_tree_pdp, tvb, offset+2, 1, "PDP address length: %u", pdp_addr_len);
3901 if (pdp_addr_len > 0) {
3902 switch (pdp_type_num) {
3904 addr_ipv4 = tvb_get_ipv4(tvb, offset+3);
3905 proto_tree_add_text(ext_tree_pdp, tvb, offset+3, 4, "PDP address: %s", ip_to_str((guint8 *)&addr_ipv4));
3908 tvb_get_ipv6(tvb, offset+3, &addr_ipv6);
3909 proto_tree_add_text(ext_tree_pdp, tvb, offset+3, 16, "PDP address: %s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
3916 offset = offset + 3 + pdp_addr_len;
3918 ggsn_addr_len = tvb_get_guint8(tvb, offset);
3919 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "GGSN address length: %u", ggsn_addr_len);
3921 switch (ggsn_addr_len) {
3923 addr_ipv4 = tvb_get_ipv4(tvb, offset+1);
3924 proto_tree_add_text(ext_tree_pdp, tvb, offset+1, 4, "GGSN address: %s", ip_to_str((guint8 *)&addr_ipv4));
3927 tvb_get_ipv6(tvb, offset+1, &addr_ipv6);
3928 proto_tree_add_text(ext_tree_pdp, tvb, offset+1, 16, "GGSN address: %s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
3934 offset = offset + 1 + ggsn_addr_len;
3936 if (gtp_version == 1) {
3938 ggsn_addr_len = tvb_get_guint8(tvb, offset);
3939 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "GGSN 2 address length: %u", ggsn_addr_len);
3941 switch (ggsn_addr_len) {
3943 addr_ipv4 = tvb_get_ipv4(tvb, offset+1);
3944 proto_tree_add_text(ext_tree_pdp, tvb, offset+1, 4, "GGSN 2 address: %s", ip_to_str((guint8 *)&addr_ipv4));
3947 tvb_get_ipv6(tvb, offset+1, &addr_ipv6);
3948 proto_tree_add_text(ext_tree_pdp, tvb, offset+1, 16, "GGSN 2 address: %s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
3953 offset = offset + 1 + ggsn_addr_len;
3957 apn_len = tvb_get_guint8(tvb, offset);
3958 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "APN length: %u", apn_len);
3959 decode_apn(tvb, offset+1, apn_len, ext_tree_pdp);
3961 offset = offset + 1 + apn_len;
3963 trans_id = tvb_get_guint8(tvb, offset);
3964 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "Transaction identifier: %u", trans_id);
3969 /* GPRS: 9.60, v7.6.0, chapter 7.9.21
3970 * UMTS: 29.060, v4.0, chapter 7.7.30
3973 decode_gtp_apn(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
3976 proto_tree *ext_tree_apn;
3979 length = tvb_get_ntohs(tvb, offset+1);
3981 te = proto_tree_add_text (tree, tvb, offset, length+3, val_to_str(GTP_EXT_APN, gtp_val, "Unknown field"));
3982 ext_tree_apn = proto_item_add_subtree(te, ett_gtp_apn);
3984 proto_tree_add_text (ext_tree_apn, tvb, offset+1, 2, "APN length : %u", length);
3985 decode_apn (tvb, offset+3, length, ext_tree_apn);
3990 /* GPRS: 9.60 v7.6.0, chapter 7.9.22
3991 * 4.08 v. 7.1.2, chapter 10.5.6.3 (p.580)
3992 * UMTS: 29.060 v4.0, chapter 7.7.31
3993 * 24.008, v4.2, chapter 10.5.6.3
3996 decode_gtp_proto_conf(tvbuff_t *tvb, int offset, packet_info *pinfo, proto_tree *tree) {
3998 guint16 length, proto_offset;
4000 guint8 conf, proto_len, cnt = 1;
4002 proto_tree *ext_tree_proto;
4004 gboolean save_writable;
4006 length = tvb_get_ntohs(tvb, offset + 1);
4008 te = proto_tree_add_text(tree, tvb, offset, length + 3, val_to_str(GTP_EXT_PROTO_CONF, gtp_val, "Unknown message"));
4009 ext_tree_proto = proto_item_add_subtree(te, ett_gtp_proto);
4011 proto_tree_add_text(ext_tree_proto, tvb, offset + 1, 2, "Length: %u", length);
4013 if (length < 1) return 3;
4015 conf = tvb_get_guint8 (tvb, offset + 3) & 0x07;
4016 proto_tree_add_text (ext_tree_proto, tvb, offset + 3, 1, "Configuration protocol (00000xxx): %u", conf);
4018 proto_offset = 1; /* ... 1st byte is conf */
4022 if (proto_offset >= length) break;
4023 proto_id = tvb_get_ntohs (tvb, offset);
4024 proto_len = tvb_get_guint8 (tvb, offset + 2);
4025 proto_offset += proto_len + 3; /* 3 = proto id + length byte */
4027 if (proto_len > 0) {
4029 proto_tree_add_text (ext_tree_proto, tvb, offset, 2, "Protocol %u ID: %s (0x%04x)",
4030 cnt, val_to_str(proto_id, ppp_vals, "Unknown"),
4032 proto_tree_add_text (ext_tree_proto, tvb, offset+2, 1, "Protocol %u length: %u", cnt, proto_len);
4035 * Don't allow the dissector for the configuration
4036 * protocol in question to update the columns - this
4039 save_writable = col_get_writable(pinfo->cinfo);
4040 col_set_writable(pinfo->cinfo, FALSE);
4043 * XXX - should we have our own dissector table,
4044 * solely for configuration protocols, so that bogus
4045 * values don't cause us to dissect the protocol
4046 * data as, for example, IP?
4048 next_tvb = tvb_new_subset (tvb, offset + 3, proto_len, proto_len);
4049 if (!dissector_try_port(ppp_subdissector_table,
4050 proto_id, next_tvb, pinfo, ext_tree_proto)) {
4051 call_dissector(data_handle, next_tvb, pinfo,
4055 col_set_writable(pinfo->cinfo, save_writable);
4058 offset += proto_len + 3;
4065 /* GPRS: 9.60 v7.6.0, chapter 7.9.23
4066 * UMTS: 29.060 v4.0, chapter 7.7.32
4069 decode_gtp_gsn_addr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4071 guint8 addr_type, addr_len;
4074 struct e_in6_addr addr_ipv6;
4075 proto_tree *ext_tree_gsn_addr;
4078 length = tvb_get_ntohs(tvb, offset+1);
4080 te = proto_tree_add_text(tree, tvb, offset, 3+length, "GSN address : ");
4081 ext_tree_gsn_addr = proto_item_add_subtree(te, ett_gtp_gsn_addr);
4085 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset+1, 2, "GSN address length : %u", length);
4086 addr_ipv4 = tvb_get_ipv4(tvb, offset+3);
4087 proto_item_append_text(te, "%s", ip_to_str((guint8 *)&addr_ipv4));
4088 proto_tree_add_ipv4(ext_tree_gsn_addr, hf_gtp_gsn_ipv4, tvb, offset+3, 4, addr_ipv4);
4091 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset+1, 2, "GSN address Information Element length : %u", length);
4092 addr_type = tvb_get_guint8(tvb, offset+3) & 0xC0;
4093 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_type, tvb, offset+3, 1, addr_type);
4094 addr_len = tvb_get_guint8(tvb, offset+3) & 0x3F;
4095 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_len, tvb, offset+3, 1, addr_len);
4096 addr_ipv4 = tvb_get_ipv4(tvb, offset+4);
4097 proto_item_append_text(te, "%s", ip_to_str((guint8 *)&addr_ipv4));
4098 proto_tree_add_ipv4(ext_tree_gsn_addr, hf_gtp_gsn_ipv4, tvb, offset+4, 4, addr_ipv4);
4101 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset+1, 2, "GSN address length : %u", length);
4102 tvb_get_ipv6(tvb, offset+3, &addr_ipv6);
4103 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
4104 proto_tree_add_ipv6(ext_tree_gsn_addr, hf_gtp_gsn_ipv6, tvb, offset+3, 16, (guint8*)&addr_ipv6);
4107 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset+1, 2, "GSN address Information Element length : %u", length);
4108 addr_type = tvb_get_guint8(tvb, offset+3) & 0xC0;
4109 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_type, tvb, offset+3, 1, addr_type);
4110 addr_len = tvb_get_guint8(tvb, offset+3) & 0x3F;
4111 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_len, tvb, offset+3, 1, addr_len);
4112 tvb_get_ipv6(tvb, offset+4, &addr_ipv6);
4113 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
4114 proto_tree_add_ipv6(ext_tree_gsn_addr, hf_gtp_gsn_ipv6, tvb, offset+4, 16, (guint8*)&addr_ipv6);
4117 proto_item_append_text(te, "unknown type or wrong length");
4124 /* GPRS: 9.60 v7.6.0, chapter 7.9.24
4125 * UMTS: 29.060 v4.0, chapter 7.7.33
4128 decode_gtp_msisdn(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4130 const guint8 *msisdn_val;
4134 length = tvb_get_ntohs(tvb, offset+1);
4136 if (length < 1) return 3;
4138 msisdn_val = tvb_get_ptr(tvb, offset+3, length);
4139 msisdn_str = msisdn_to_str(msisdn_val, length);
4141 proto_tree_add_string(tree, hf_gtp_msisdn, tvb, offset, 3+length, msisdn_str);
4146 /* GPRS: not present
4147 * UMTS: 29.060 v4.0, chapter 7.7.34
4148 * 24.008 v4.2, chapter 10.5.6.5
4151 decode_gtp_qos_umts(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4153 return decode_qos_umts(tvb, offset, tree, "Quality of Service", 2);
4156 /* GPRS: not present
4157 * UMTS: 29.060 v4.0, chapter 7.7.35
4160 decode_gtp_auth_qui(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4162 proto_tree *ext_tree;
4163 proto_item *te_quint;
4165 guint8 xres_len, auth_len;
4168 length = tvb_get_ntohs(tvb, offset + 1);
4170 te_quint = proto_tree_add_text(tree, tvb, offset, length+1, "Quintuplet");
4171 ext_tree = proto_item_add_subtree(te_quint, ett_gtp_quint);
4174 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4177 proto_tree_add_text(ext_tree, tvb, offset, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset, 16));
4178 offset = offset + 16;
4179 xres_len = tvb_get_guint8(tvb, offset);
4180 proto_tree_add_text(ext_tree, tvb, offset, 1, "XRES length: %u", xres_len);
4182 proto_tree_add_text(ext_tree, tvb, offset , xres_len, "XRES: %s", tvb_bytes_to_str(tvb, offset, xres_len));
4183 offset = offset + xres_len;
4184 proto_tree_add_text(ext_tree, tvb ,offset, 16, "Quintuplet Ciphering Key: %s", tvb_bytes_to_str(tvb, offset, 16));
4185 offset = offset + 16;
4186 proto_tree_add_text(ext_tree, tvb, offset, 16, "Quintuplet Integrity Key: %s", tvb_bytes_to_str(tvb, offset, 16));
4187 offset = offset +16;
4188 auth_len = tvb_get_guint8(tvb, offset);
4189 proto_tree_add_text(ext_tree, tvb, offset, 1, "Authentication length: %u", auth_len);
4191 proto_tree_add_text(ext_tree, tvb, offset , auth_len, "AUTH: %s", tvb_bytes_to_str(tvb, offset, auth_len));
4193 offset = offset+auth_len;
4195 return (3 + length);
4199 /* GPRS: not present
4200 * UMTS: 29.060 v4.0, chapter 7.7.36
4201 * 24.008 v4.2, chapter 10.5.6.12
4204 decode_gtp_tft(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4206 guint16 length, port1, port2, tos;
4207 guint8 tft_flags, tft_code, no_packet_filters, i, pf_id, pf_eval, pf_len, pf_content_id, proto, spare;
4209 guint32 mask_ipv4, addr_ipv4, ipsec_id, label;
4210 struct e_in6_addr addr_ipv6, mask_ipv6;
4211 proto_tree *ext_tree_tft, *ext_tree_tft_pf, *ext_tree_tft_flags;
4212 proto_item *te, *tee, *tef;
4214 length = tvb_get_ntohs(tvb, offset+1);
4216 te = proto_tree_add_text(tree, tvb, offset, 3+length, "Traffic flow template");
4217 ext_tree_tft = proto_item_add_subtree(te, ett_gtp_tft);
4219 tft_flags = tvb_get_guint8(tvb, offset+3);
4220 tft_code = (tft_flags >> 5) & 0x07;
4221 spare = (tft_flags >> 4) & 0x01;
4222 no_packet_filters = tft_flags & 0x0F;
4224 proto_tree_add_text(ext_tree_tft, tvb, offset+1, 2, "TFT length: %u", length);
4226 tef = proto_tree_add_text (ext_tree_tft, tvb, offset + 3, 1, "TFT flags");
4227 ext_tree_tft_flags = proto_item_add_subtree (tef, ett_gtp_tft_flags);
4228 proto_tree_add_uint (ext_tree_tft_flags, hf_gtp_tft_code, tvb, offset + 3, 1, tft_flags);
4229 proto_tree_add_uint (ext_tree_tft_flags, hf_gtp_tft_spare, tvb, offset + 3, 1, tft_flags);
4230 proto_tree_add_uint (ext_tree_tft_flags, hf_gtp_tft_number, tvb, offset + 3, 1, tft_flags);
4232 offset = offset + 4;
4234 for (i=0;i<no_packet_filters;i++) {
4236 pf_id = tvb_get_guint8(tvb, offset);
4238 tee = proto_tree_add_text (ext_tree_tft, tvb, offset, 1, "Packet filter id: %u", pf_id);
4239 ext_tree_tft_pf = proto_item_add_subtree (tee, ett_gtp_tft_pf);
4242 if (tft_code != 2) {
4244 pf_eval = tvb_get_guint8(tvb, offset);
4245 pf_len = tvb_get_guint8(tvb, offset + 1);
4247 proto_tree_add_uint (ext_tree_tft_pf, hf_gtp_tft_eval, tvb, offset, 1, pf_eval);
4248 proto_tree_add_text (ext_tree_tft_pf, tvb, offset+1, 1, "Content length: %u", pf_len);
4250 offset = offset + 2;
4253 while (pf_offset < pf_len) {
4255 pf_content_id = tvb_get_guint8 (tvb, offset + pf_offset);
4257 switch (pf_content_id) {
4258 /* address IPv4 and mask = 8 bytes*/
4260 addr_ipv4 = tvb_get_ipv4 (tvb, offset + pf_offset + 1);
4261 mask_ipv4 = tvb_get_ipv4 (tvb, offset + pf_offset + 5);
4262 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 9, "ID 0x10: IPv4/mask: %s/%s", ip_to_str ((guint8 *)&addr_ipv4), ip_to_str ((guint8 *)&mask_ipv4));
4263 pf_offset = pf_offset + 9;
4265 /* address IPv6 and mask = 32 bytes*/
4267 tvb_get_ipv6 (tvb, offset+pf_offset+1, &addr_ipv6);
4268 tvb_get_ipv6 (tvb, offset+pf_offset+17, &mask_ipv6);
4269 proto_tree_add_text (ext_tree_tft_pf, tvb, offset+pf_offset, 33, "ID 0x20: IPv6/mask: %s/%s", ip6_to_str ((struct e_in6_addr*)&addr_ipv6), ip6_to_str ((struct e_in6_addr*)&mask_ipv6));
4270 pf_offset = pf_offset + 33;
4272 /* protocol identifier/next header type = 1 byte*/
4274 proto = tvb_get_guint8 (tvb, offset + pf_offset + 1);
4275 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 2, "ID 0x30: IPv4 protocol identifier/IPv6 next header: %u (%x)", proto, proto);
4276 pf_offset = pf_offset + 2;
4278 /* single destination port type = 2 bytes */
4280 port1 = tvb_get_ntohs (tvb, offset + pf_offset + 1);
4281 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 3, "ID 0x40: destination port: %u", port1);
4282 pf_offset = pf_offset + 3;
4284 /* destination port range type = 4 bytes */
4286 port1 = tvb_get_ntohs (tvb, offset + pf_offset + 1);
4287 port2 = tvb_get_ntohs (tvb, offset + pf_offset + 3);
4288 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 5, "ID 0x41: destination port range: %u - %u", port1, port2);
4289 pf_offset = pf_offset + 5;
4291 /* single source port type = 2 bytes */
4293 port1 = tvb_get_ntohs (tvb, offset + pf_offset + 1);
4294 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 3, "ID 0x50: source port: %u", port1);
4295 pf_offset = pf_offset + 3;
4297 /* source port range type = 4 bytes */
4299 port1 = tvb_get_ntohs (tvb, offset + pf_offset + 1);
4300 port2 = tvb_get_ntohs (tvb, offset + pf_offset + 3);
4301 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 5, "ID 0x51: source port range: %u - %u", port1, port2);
4302 pf_offset = pf_offset + 5;
4304 /* security parameter index type = 4 bytes */
4306 ipsec_id = tvb_get_ntohl (tvb, offset + pf_offset + 1);
4307 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 5, "ID 0x60: security parameter index: %x", ipsec_id);
4308 pf_offset = pf_offset + 5;
4310 /* type of service/traffic class type = 2 bytes */
4312 tos = tvb_get_ntohs (tvb, offset + pf_offset + 1);
4313 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 2, "ID 0x70: Type of Service/Traffic Class: %u (%x)", tos, tos);
4314 pf_offset = pf_offset + 3;
4316 /* flow label type = 3 bytes */
4318 label = tvb_get_ntoh24(tvb, offset + pf_offset + 1) & 0x0FFFFF;
4319 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 4, "ID 0x80: Flow Label: %u (%x)", label, label);
4320 pf_offset = pf_offset + 4;
4324 proto_tree_add_text (ext_tree_tft_pf, tvb, offset + pf_offset, 1, "Unknown value: %x ", pf_content_id);
4325 pf_offset++; /* to avoid infinite loop */
4330 offset = offset + pf_offset;
4337 /* GPRS: not present
4338 * UMTS: 29.060 v4.0, chapter 7.7.37
4339 * Type = 138 (Decimal)
4340 * 25.413(RANAP) TargetID
4343 decode_gtp_target_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4346 proto_item *target_id_item;
4347 proto_tree *ext_tree;
4349 asn1_ctx_t asn1_ctx;
4350 asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, TRUE, pinfo);
4352 length = tvb_get_ntohs(tvb, offset + 1);
4354 target_id_item = proto_tree_add_text (tree, tvb, offset, 3 + length, "Target Identification");
4355 ext_tree = proto_item_add_subtree (target_id_item, ett_gtp_target_id);
4357 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4359 next_tvb = tvb_new_subset (tvb, offset, length, length);
4360 dissect_ranap_TargetID(next_tvb, 0, &asn1_ctx, ext_tree, hf_gtp_targetid);
4366 /* GPRS: not present
4367 * UMTS: 29.060 v4.0, chapter 7.7.38
4370 decode_gtp_utran_cont(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4373 proto_item *utran_cont_item;
4374 proto_tree *ext_tree;
4377 length = tvb_get_ntohs(tvb, offset + 1);
4379 utran_cont_item = proto_tree_add_text(tree, tvb, offset, 3 + length, "UTRAN transparent field");
4380 ext_tree = proto_item_add_subtree (utran_cont_item, ett_gtp_utran_cont);
4382 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4384 next_tvb = tvb_new_subset (tvb, offset, length, length);
4391 /* GPRS: not present
4392 * UMTS: 29.060 v4.0, chapter 7.7.39
4395 decode_gtp_rab_setup(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4397 guint32 teid, addr_ipv4;
4400 struct e_in6_addr addr_ipv6;
4401 proto_tree *ext_tree_rab_setup;
4404 length = tvb_get_ntohs(tvb, offset + 1);
4405 nsapi = tvb_get_guint8(tvb, offset + 3) & 0x0F;
4407 te = proto_tree_add_text(tree, tvb, offset, 3+length, "Radio Access Bearer Setup Information");
4408 ext_tree_rab_setup = proto_item_add_subtree(te, ett_gtp_rab_setup);
4410 proto_tree_add_text(ext_tree_rab_setup, tvb, offset+1, 2, "RAB setup length : %u", length);
4411 proto_tree_add_uint(ext_tree_rab_setup, hf_gtp_nsapi, tvb, offset+3, 1, nsapi);
4415 teid = tvb_get_ntohl(tvb, offset + 4);
4417 proto_tree_add_uint(ext_tree_rab_setup, hf_gtp_teid_data, tvb, offset+4, 4, teid);
4421 addr_ipv4 = tvb_get_ipv4(tvb, offset+8);
4422 proto_tree_add_ipv4(ext_tree_rab_setup, hf_gtp_rnc_ipv4, tvb, offset+8, 4, addr_ipv4);
4425 tvb_get_ipv6(tvb, offset+8, &addr_ipv6);
4426 proto_tree_add_ipv6(ext_tree_rab_setup, hf_gtp_rnc_ipv6, tvb, offset+8, 16, (guint8 *)&addr_ipv6);
4437 /* GPRS: not present
4438 * UMTS: 29.060 v4.0, chapter 7.7.40
4441 decode_gtp_hdr_list(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4445 proto_tree *ext_tree_hdr_list;
4448 length = tvb_get_guint8(tvb, offset + 1);
4450 te = proto_tree_add_text(tree, tvb, offset, 2+length, "%s", val_to_str(GTP_EXT_HDR_LIST, gtp_val, "Unknown"));
4451 ext_tree_hdr_list = proto_item_add_subtree(te, ett_gtp_hdr_list);
4453 proto_tree_add_text(ext_tree_hdr_list, tvb, offset+1, 1, "Number of Extension Header Types in list (i.e., length) : %u", length);
4455 for(i=0 ; i<length ; i++) {
4456 hdr = tvb_get_guint8(tvb, offset+2+i);
4458 proto_tree_add_text(ext_tree_hdr_list, tvb, offset+2+i, 1, "No. %u --> Extension Header Type value : %s (%u)", i+1, val_to_str(hdr, gtp_val, "Unknown Extension Header Type"), hdr);
4464 /* GPRS: not present
4465 * UMTS: 29.060 v4.0, chapter 7.7.41
4466 * TODO: find TriggerID description
4469 decode_gtp_trigger_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4473 length = tvb_get_ntohs(tvb, offset + 1);
4475 proto_tree_add_text(tree, tvb, offset, 3+length, "%s length : %u", val_to_str(GTP_EXT_TRIGGER_ID, gtp_val, "Unknown"), length);
4481 /* GPRS: not present
4482 * UMTS: 29.060 v4.0, chapter 7.7.42
4483 * TODO: find OMC-ID description
4486 decode_gtp_omc_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4490 length = tvb_get_ntohs(tvb, offset + 1);
4492 proto_tree_add_text(tree, tvb, offset, 3+length, "%s length : %u", val_to_str(GTP_EXT_OMC_ID, gtp_val, "Unknown"), length);
4498 /* GPRS: 9.60 v7.6.0, chapter 7.9.25
4499 * UMTS: 29.060 v6.11.0, chapter 7.7.44 Charging Gateway Address
4502 decode_gtp_chrg_addr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4506 struct e_in6_addr addr_ipv6;
4507 proto_tree *ext_tree_chrg_addr;
4510 length = tvb_get_ntohs(tvb, offset+1);
4512 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_CHRG_ADDR, gtp_val, "Unknown"));
4513 ext_tree_chrg_addr = proto_item_add_subtree(te, ett_gtp_chrg_addr);
4515 proto_tree_add_text(ext_tree_chrg_addr, tvb, offset+1, 2, "%s length : %u", val_to_str(GTP_EXT_CHRG_ADDR, gtp_val, "Unknown"), length);
4519 addr_ipv4 = tvb_get_ipv4(tvb, offset+3);
4520 proto_item_append_text(te, "%s", ip_to_str((guint8 *)&addr_ipv4));
4521 proto_tree_add_ipv4 (ext_tree_chrg_addr, hf_gtp_chrg_ipv4, tvb, offset+3, 4, addr_ipv4);
4524 tvb_get_ipv6(tvb, offset+3, &addr_ipv6);
4525 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
4526 proto_tree_add_ipv6 (ext_tree_chrg_addr, hf_gtp_chrg_ipv6, tvb, offset+3, 16, (guint8*)&addr_ipv6);
4529 proto_item_append_text(te, "unknown type or wrong length");
4537 * UMTS: 29.060 v6.11.0, chapter 7.7.44 RAN Transparent Container
4540 decode_gtp_ran_tr_cont(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4543 proto_tree *ext_tree;
4546 length = tvb_get_ntohs(tvb, offset+1);
4547 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_RAN_TR_CONT, gtp_val, "Unknown"));
4548 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ran_tr_cont);
4551 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4553 /* TODO add decoding of data */
4554 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4561 * UMTS: 29.060 v6.11.0, chapter 7.7.45 PDP Context Prioritization
4564 decode_gtp_pdp_cont_prio(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4567 proto_tree *ext_tree;
4570 length = tvb_get_ntohs(tvb, offset+1);
4571 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_PDP_CONT_PRIO, gtp_val, "Unknown"));
4572 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdp_cont_prio);
4575 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4577 /* TODO add decoding of data */
4578 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4584 * UMTS: 29.060 v6.11.0, chapter 7.7.45A Additional RAB Setup Information
4587 decode_gtp_add_rab_setup_inf(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4590 proto_tree *ext_tree;
4593 length = tvb_get_ntohs(tvb, offset+1);
4594 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_ADD_RAB_SETUP_INF, gtp_val, "Unknown"));
4595 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_rab_setup_inf);
4598 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4600 /* TODO add decoding of data */
4601 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4609 * UMTS: 29.060 v6.11.0, chapter 7.7.47 SGSN Number
4612 decode_gtp_ssgn_no(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4615 proto_tree *ext_tree;
4618 length = tvb_get_ntohs(tvb, offset+1);
4619 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_SSGN_NO, gtp_val, "Unknown"));
4620 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ssgn_no);
4623 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4625 /* TODO add decoding of data */
4626 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4633 * UMTS: 29.060 v6.11.0, chapter 7.7.48 Common Flags
4636 decode_gtp_common_flgs(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4639 proto_tree *ext_tree;
4642 length = tvb_get_ntohs(tvb, offset+1);
4643 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_COMMON_FLGS, gtp_val, "Unknown"));
4644 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_common_flgs);
4647 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4649 /* TODO add decoding of data */
4650 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4657 * UMTS: 29.060 v6.11.0, chapter 7.7.49
4660 decode_gtp_apn_res(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4663 proto_tree *ext_tree_apn_res;
4666 length = tvb_get_ntohs(tvb, offset+1);
4667 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_APN_RES, gtp_val, "Unknown"));
4668 ext_tree_apn_res = proto_item_add_subtree(te, ett_gtp_ext_tree_apn_res);
4671 proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4674 /* Restriction Type value */
4675 proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_apn_res, tvb, offset, length, FALSE);
4680 * UMTS: 29.060 v6.11.0, chapter 7.7.50
4682 * Type = 151 (Decimal)
4685 decode_gtp_rat_type(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4688 proto_tree *ext_tree_rat_type;
4691 length = tvb_get_ntohs(tvb, offset+1);
4692 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_RAT_TYPE, gtp_val, "Unknown"));
4693 ext_tree_rat_type = proto_item_add_subtree(te, ett_gtp_ext_rat_type);
4696 proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4699 /* RAT Type value */
4700 proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_rat_type, tvb, offset, length, FALSE);
4705 * UMTS: 29.060 v6.11.0, chapter 7.7.51
4706 * User Location Information
4707 * Type = 152 (Decimal)
4710 decode_gtp_usr_loc_inf(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4713 proto_tree *ext_tree;
4715 guint8 geo_loc_type;
4717 length = tvb_get_ntohs(tvb, offset+1);
4718 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_USR_LOC_INF, gtp_val, "Unknown"));
4719 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_usr_loc_inf);
4722 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4724 /* TODO add decoding of data */
4725 /* Geographic Location Type */
4726 proto_tree_add_item(ext_tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, FALSE);
4727 geo_loc_type = tvb_get_guint8(tvb,offset);
4730 if (geo_loc_type == 0)
4731 /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 0) */
4732 be_cell_id_aux(tvb, ext_tree, offset, length-1, NULL, 0, 0);
4733 if (geo_loc_type == 1){
4734 /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
4735 be_cell_id_aux(tvb, ext_tree, offset, length-1, NULL, 0, 4);
4736 offset = offset + 5;
4737 proto_tree_add_item(ext_tree, hf_gtp_ext_sac, tvb, offset, 2, FALSE);
4745 * UMTS: 29.060 v6.11.0, chapter 7.7.52
4747 * Type = 153 (Decimal)
4750 decode_gtp_ms_time_zone(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4753 proto_tree *ext_tree;
4758 length = tvb_get_ntohs(tvb, offset+1);
4759 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s : ", val_to_str(GTP_EXT_MS_TIME_ZONE, gtp_val, "Unknown"));
4760 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ms_time_zone);
4763 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4766 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4767 /* 3GPP TS 23.040 version 6.6.0 Release 6
4768 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
4770 * The Time Zone indicates the difference, expressed in quarters of an hour,
4771 * between the local time and GMT. In the first of the two semi-octets,
4772 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
4773 * represents the algebraic sign of this difference (0: positive, 1: negative).
4776 data = tvb_get_guint8(tvb, offset);
4777 sign = (data & 0x08)?'-':'+';
4778 data = (data >> 4) + (data & 0x07) * 10;
4780 proto_tree_add_text(tree, tvb, offset, 1,"Timezone: GMT %c %d hours %d minutes",
4781 sign, data / 4, data % 4 * 15);
4788 * UMTS: 29.060 v6.11.0, chapter 7.7.53
4789 * International Mobile Equipment Identity (and Software Version) (IMEI(SV))
4790 * Type = 154 (Decimal)
4793 decode_gtp_imeisv(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4796 proto_tree *ext_imeisv;
4799 length = tvb_get_ntohs(tvb, offset+1);
4800 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_IMEISV, gtp_val, "Unknown"));
4801 ext_imeisv = proto_item_add_subtree(te, ett_gtp_ext_imeisv);
4804 proto_tree_add_item(ext_imeisv, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4808 proto_tree_add_item(ext_imeisv, hf_gtp_ext_imeisv, tvb, offset, length, FALSE);
4813 * UMTS: 29.060 v6.11.0, chapter 7.7.54
4814 * CAMEL Charging Information Container
4815 * Type = 155 (Decimal)
4818 decode_gtp_camel_chg_inf_con(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4821 proto_tree *ext_tree;
4824 length = tvb_get_ntohs(tvb, offset+1);
4825 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_CAMEL_CHG_INF_CON, gtp_val, "Unknown"));
4826 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_camel_chg_inf_con);
4829 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4831 /* TODO add decoding of data */
4832 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4838 * UMTS: 29.060 v6.11.0, chapter 7.7.55
4842 decode_gtp_mbms_ue_ctx(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4845 proto_tree *ext_tree;
4848 length = tvb_get_ntohs(tvb, offset+1);
4849 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_UE_CTX, gtp_val, "Unknown"));
4850 ext_tree = proto_item_add_subtree(te, ett_GTP_EXT_MBMS_UE_CTX);
4853 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4855 /* TODO add decoding of data */
4856 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4863 * UMTS: 29.060 v6.11.0, chapter 7.7.56
4864 * Temporary Mobile Group Identity (TMGI)
4867 decode_gtp_tmgi(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4870 proto_tree *ext_tree;
4873 length = tvb_get_ntohs(tvb, offset+1);
4874 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_TMGI, gtp_val, "Unknown"));
4875 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_tmgi);
4878 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4881 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4888 * UMTS: 29.060 v6.11.0, chapter 7.7.57
4889 * RIM Routing Address
4892 decode_gtp_rim_ra(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4895 proto_tree *ext_tree;
4898 length = tvb_get_ntohs(tvb, offset+1);
4899 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_RIM_RA, gtp_val, "Unknown"));
4900 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_rim_ra);
4903 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4905 /* TODO add decoding of data */
4906 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4908 * Octets 4-n are coded according to 3GPP TS 48.018 [20] 11.3.77 RIM Routing Information IE octets 4-n.
4916 * UMTS: 29.060 v6.11.0, chapter 7.7.58
4917 * MBMS Protocol Configuration Options
4920 decode_gtp_mbms_prot_conf_opt(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4923 proto_tree *ext_tree;
4926 length = tvb_get_ntohs(tvb, offset+1);
4927 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_PROT_CONF_OPT, gtp_val, "Unknown"));
4928 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_prot_conf_opt);
4931 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4933 /* TODO add decoding of data */
4934 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4940 * UMTS: 29.060 v6.11.0, chapter 7.7.59
4941 * MBMS Session Duration
4944 decode_gtp_mbms_ses_dur(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4947 proto_tree *ext_tree;
4950 length = tvb_get_ntohs(tvb, offset+1);
4951 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_SES_DUR, gtp_val, "Unknown"));
4952 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bms_ses_dur);
4955 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4957 /* TODO add decoding of data */
4958 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4965 * UMTS: 29.060 v6.11.0, chapter 7.7.60
4969 decode_gtp_mbms_sa(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4972 proto_tree *ext_tree;
4975 length = tvb_get_ntohs(tvb, offset+1);
4976 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_SA, gtp_val, "Unknown"));
4977 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_sa);
4980 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
4982 /* TODO add decoding of data */
4983 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
4990 * UMTS: 29.060 v6.11.0, chapter 7.7.61
4991 * Source RNC PDCP context info
4994 decode_gtp_src_rnc_pdp_ctx_inf(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
4997 proto_tree *ext_tree;
5000 length = tvb_get_ntohs(tvb, offset+1);
5001 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_SRC_RNC_PDP_CTX_INF, gtp_val, "Unknown"));
5002 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_src_rnc_pdp_ctx_inf);
5005 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5007 /* TODO add decoding of data */
5008 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5015 * UMTS: 29.060 v6.11.0, chapter 7.7.62
5016 * Additional Trace Info
5019 decode_gtp_add_trs_inf(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5022 proto_tree *ext_tree;
5025 length = tvb_get_ntohs(tvb, offset+1);
5026 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_ADD_TRS_INF, gtp_val, "Unknown"));
5027 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_add_trs_inf);
5030 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5032 /* TODO add decoding of data */
5033 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5040 * UMTS: 29.060 v6.11.0, chapter 7.7.63
5044 decode_gtp_hop_count(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5047 proto_tree *ext_tree;
5050 length = tvb_get_ntohs(tvb, offset+1);
5051 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_HOP_COUNT, gtp_val, "Unknown"));
5052 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_hop_count);
5055 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5057 /* TODO add decoding of data */
5058 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5065 * UMTS: 29.060 v6.11.0, chapter 7.7.64
5069 decode_gtp_sel_plmn_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5072 proto_tree *ext_tree;
5075 length = tvb_get_ntohs(tvb, offset+1);
5076 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_SEL_PLMN_ID, gtp_val, "Unknown"));
5077 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_sel_plmn_id);
5080 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5082 /* TODO add decoding of data */
5083 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5090 * UMTS: 29.060 v6.11.0, chapter 7.7.65
5091 * MBMS Session Identifier
5094 decode_gtp_mbms_ses_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5097 proto_tree *ext_tree;
5100 length = tvb_get_ntohs(tvb, offset+1);
5101 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_SES_ID, gtp_val, "Unknown"));
5102 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_ses_id);
5105 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5107 /* TODO add decoding of data */
5108 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5115 * UMTS: 29.060 v6.11.0, chapter 7.7.66
5116 * MBMS 2G/3G Indicator
5119 decode_gtp_mbms_2g_3g_ind(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5122 proto_tree *ext_tree;
5125 length = tvb_get_ntohs(tvb, offset+1);
5126 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_2G_3G_IND, gtp_val, "Unknown"));
5127 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_2g_3g_ind);
5130 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5132 /* TODO add decoding of data */
5133 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5140 * UMTS: 29.060 v6.11.0, chapter 7.7.67
5144 decode_gtp_enh_nsapi(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5147 proto_tree *ext_tree;
5150 length = tvb_get_ntohs(tvb, offset+1);
5151 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_ENH_NSAPI, gtp_val, "Unknown"));
5152 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_enh_nsapi);
5155 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5157 /* TODO add decoding of data */
5158 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5165 * UMTS: 29.060 v6.11.0, chapter 7.7.68
5166 * Additional MBMS Trace Info
5169 decode_gtp_add_mbms_trs_inf(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5172 proto_tree *ext_tree;
5175 length = tvb_get_ntohs(tvb, offset+1);
5176 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_ADD_MBMS_TRS_INF, gtp_val, "Unknown"));
5177 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ad_mbms_trs_inf);
5180 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5182 /* TODO add decoding of data */
5183 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5190 * UMTS: 29.060 v6.11.0, chapter 7.7.69
5191 * MBMS Session Identity Repetition Number
5194 decode_gtp_mbms_ses_id_rep_no(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5197 proto_tree *ext_tree;
5200 length = tvb_get_ntohs(tvb, offset+1);
5201 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_SES_ID_REP_NO, gtp_val, "Unknown"));
5202 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_ses_id_rep_no);
5205 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5207 /* TODO add decoding of data */
5208 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5215 * UMTS: 29.060 v6.11.0, chapter 7.7.70
5216 * MBMS Time To Data Transfer
5219 decode_gtp_mbms_time_to_data_tr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5222 proto_tree *ext_tree;
5225 length = tvb_get_ntohs(tvb, offset+1);
5226 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_MBMS_TIME_TO_DATA_TR, gtp_val, "Unknown"));
5227 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_mbms_time_to_data_tr);
5230 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5232 /* TODO add decoding of data */
5233 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5240 * UMTS: 29.060 v6.11.0, chapter 7.7.71
5241 * PS Handover Request Context
5244 decode_gtp_ps_ho_req_ctx(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5247 proto_tree *ext_tree;
5250 length = tvb_get_ntohs(tvb, offset+1);
5251 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_PS_HO_REQ_CTX, gtp_val, "Unknown"));
5252 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_ps_ho_req_ctx);
5255 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5257 /* TODO add decoding of data */
5258 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5265 * UMTS: 29.060 v6.11.0, chapter 7.7.72
5269 decode_gtp_bss_cont(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5272 proto_tree *ext_tree;
5275 length = tvb_get_ntohs(tvb, offset+1);
5276 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_BSS_CONT, gtp_val, "Unknown"));
5277 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bss_cont);
5280 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5282 /* TODO add decoding of data */
5283 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5285 * The content of this container is defined in 3GPP TS 48.018
5293 * UMTS: 29.060 v6.11.0, chapter 7.7.73
5294 * Cell Identification
5297 decode_gtp_cell_id(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5300 proto_tree *ext_tree;
5303 length = tvb_get_ntohs(tvb, offset+1);
5304 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_CELL_ID, gtp_val, "Unknown"));
5305 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_cell_id);
5308 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5310 /* TODO add decoding of data */
5311 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5313 * for PS handover from A/Gb mode, the identification of a target cell (Cell ID 1) and the identification of the
5314 * source cell (Cell ID 2) as defined in 3GPP TS 48.018 [20].
5316 * for PS handover from Iu mode, the identification of a target cell (Cell ID 1)) and the identification of the
5317 * source RNC (RNC-ID) as defined in 3GPP TS 48.018
5325 * UMTS: 29.060 v6.11.0, chapter 7.7.74
5329 decode_gtp_pdu_no(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5332 proto_tree *ext_tree;
5335 length = tvb_get_ntohs(tvb, offset+1);
5336 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_PDU_NO, gtp_val, "Unknown"));
5337 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_pdu_no);
5340 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5342 /* TODO add decoding of data */
5343 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5350 * UMTS: 29.060 v6.11.0, chapter 7.7.75
5354 decode_gtp_bssgp_cause(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5357 proto_tree *ext_tree;
5360 length = tvb_get_ntohs(tvb, offset+1);
5361 te = proto_tree_add_text(tree, tvb, offset, 3+length, "%s", val_to_str(GTP_EXT_BSSGP_CAUSE, gtp_val, "Unknown"));
5362 ext_tree = proto_item_add_subtree(te, ett_gtp_ext_bssgp_cause);
5365 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5369 * The BSSGP Cause information element contains the cause as defined in 3GPP TS 48.018
5371 proto_tree_add_item(ext_tree, hf_gtp_bssgp_cause, tvb, offset, 2, FALSE);
5381 decode_gtp_rel_pack(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5383 guint16 length, n, number;
5384 proto_tree *ext_tree_rel_pack;
5387 length = tvb_get_ntohs(tvb, offset + 1);
5389 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Sequence numbers of released packets IE");
5390 ext_tree_rel_pack = proto_item_add_subtree(te, ett_gtp_rel_pack);
5394 while (n < length) {
5396 number = tvb_get_ntohs(tvb, offset + 3 + n);
5397 proto_tree_add_text(ext_tree_rel_pack, tvb, offset + 3 + n, 2, "%u", number);
5409 decode_gtp_can_pack(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5411 guint16 length, n, number;
5412 proto_tree *ext_tree_can_pack;
5415 length = tvb_get_ntohs(tvb, offset + 1);
5417 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Sequence numbers of cancelled packets IE");
5418 ext_tree_can_pack = proto_item_add_subtree(te, ett_gtp_can_pack);
5422 while (n < length) {
5424 number = tvb_get_ntohs(tvb, offset + 3 + n);
5425 proto_tree_add_text(ext_tree_can_pack, tvb, offset + 3 + n, 2, "%u", number);
5432 /* CDRs dissector */
5434 decode_gtp_data_req(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5436 guint16 length, format_ver;
5438 proto_tree *ext_tree;
5442 te = proto_tree_add_text(tree, tvb, offset, 1, val_to_str(GTP_EXT_DATA_REQ, gtp_val, "Unknown message"));
5443 ext_tree = proto_item_add_subtree(te, ett_gtp_ext);
5445 length = tvb_get_ntohs(tvb, offset + 1);
5446 no = tvb_get_guint8(tvb, offset + 3);
5447 format = tvb_get_guint8(tvb, offset + 4);
5448 format_ver = tvb_get_ntohs(tvb, offset + 5);
5450 proto_tree_add_text(ext_tree, tvb, offset+1, 2, "Length: %u", length);
5451 proto_tree_add_text(ext_tree, tvb, offset+3, 1, "Number of data records: %u", no);
5452 proto_tree_add_text(ext_tree, tvb, offset+4, 1, "Data record format: %u", format);
5453 proto_tree_add_text(ext_tree, tvb, offset+5, 2, "Data record format version: %u", format_ver);
5455 if (gtpcdr_handle) {
5456 next_tvb = tvb_new_subset (tvb, offset, -1, -1);
5457 call_dissector (gtpcdr_handle, next_tvb, pinfo, tree);
5460 proto_tree_add_text (tree, tvb, offset, 0, "Data");
5469 decode_gtp_data_resp(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5471 guint16 length, n, number;
5472 proto_tree *ext_tree_data_resp;
5475 length = tvb_get_ntohs(tvb, offset + 1);
5477 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Requests responded");
5478 ext_tree_data_resp = proto_item_add_subtree(te, ett_gtp_data_resp);
5482 while (n < length) {
5484 number = tvb_get_ntohs(tvb, offset + 3 + n);
5485 proto_tree_add_text(ext_tree_data_resp, tvb, offset + 3 + n, 2, "%u", number);
5498 decode_gtp_node_addr(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5502 struct e_in6_addr addr_ipv6;
5503 proto_tree *ext_tree_node_addr;
5506 length = tvb_get_ntohs(tvb, offset+1);
5508 te = proto_tree_add_text(tree, tvb, offset, 3+length, "Node address: ");
5509 ext_tree_node_addr = proto_item_add_subtree(te, ett_gtp_node_addr);
5511 proto_tree_add_text (ext_tree_node_addr, tvb, offset+1, 2, "Node address length: %u", length);
5515 addr_ipv4 = tvb_get_ipv4(tvb, offset+3);
5516 proto_item_append_text(te, "%s", ip_to_str((guint8 *)&addr_ipv4));
5517 proto_tree_add_ipv4 (ext_tree_node_addr, hf_gtp_node_ipv4, tvb, offset+3, 4, addr_ipv4);
5520 tvb_get_ipv6(tvb, offset+3, &addr_ipv6);
5521 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr*)&addr_ipv6));
5522 proto_tree_add_ipv6 (ext_tree_node_addr, hf_gtp_node_ipv6, tvb, offset+3, 16, (guint8*)&addr_ipv6);
5525 proto_item_append_text(te, "unknown type or wrong length");
5533 /* GPRS: 9.60 v7.6.0, chapter 7.9.26
5534 * UMTS: 29.060 v4.0, chapter 7.7.46 Private Extension
5539 decode_gtp_priv_ext(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5541 guint16 length, ext_id;
5542 proto_tree *ext_tree_priv_ext;
5545 te = proto_tree_add_text(tree, tvb, offset, 1, val_to_str(GTP_EXT_PRIV_EXT, gtp_val, "Unknown message"));
5546 ext_tree_priv_ext = proto_item_add_subtree(te, ett_gtp_ext);
5549 length = tvb_get_ntohs(tvb, offset);
5550 proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_length, tvb, offset, 2, FALSE);
5553 ext_id = tvb_get_ntohs(tvb, offset);
5554 proto_tree_add_uint(ext_tree_priv_ext, hf_gtp_ext_id, tvb, offset, 2, ext_id);
5558 * XXX - is this always a text string? Or should it be
5559 * displayed as hex data?
5562 proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length-2, FALSE);
5569 decode_gtp_unknown(tvbuff_t *tvb, int offset, packet_info *pinfo _U_, proto_tree *tree) {
5571 proto_tree_add_text(tree, tvb, offset, 1, "Unknown extension header");
5573 return tvb_length_remaining(tvb, offset);
5577 dissect_gtp (tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
5579 struct _gtp_hdr gtp_hdr;
5580 proto_tree *gtp_tree, *flags_tree;
5581 proto_item *ti, *tf;
5582 int i, offset, length, gtp_prime, checked_field, mandatory;
5583 int seq_no, flow_label;
5584 guint8 pdu_no, next_hdr = 0, ext_hdr_val;
5585 const guint8 *tid_val;
5589 guint8 sub_proto, acfield_len = 0, control_field;
5591 if (check_col(pinfo->cinfo, COL_PROTOCOL))
5592 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTP");
5593 if (check_col(pinfo->cinfo, COL_INFO))
5594 col_clear(pinfo->cinfo, COL_INFO);
5596 tvb_memcpy(tvb, (guint8 *)>p_hdr, 0, 4);
5598 if (!(gtp_hdr.flags & 0x10))
5603 switch ((gtp_hdr.flags >> 5) & 0x07) {
5615 if (check_col(pinfo->cinfo, COL_INFO))
5616 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(gtp_hdr.message, message_type, "Unknown"));
5619 ti = proto_tree_add_item (tree, proto_gtp, tvb, 0, -1, FALSE);
5620 gtp_tree = proto_item_add_subtree(ti, ett_gtp);
5622 tf = proto_tree_add_uint (gtp_tree, hf_gtp_flags, tvb, 0, 1, gtp_hdr.flags);
5623 flags_tree = proto_item_add_subtree (tf, ett_gtp_flags);
5625 proto_tree_add_uint (flags_tree, hf_gtp_flags_ver, tvb, 0, 1, gtp_hdr.flags);
5626 proto_tree_add_uint (flags_tree, hf_gtp_flags_pt, tvb, 0, 1, gtp_hdr.flags);
5628 switch (gtp_version) {
5630 proto_tree_add_uint (flags_tree, hf_gtp_flags_spare1, tvb, 0, 1, gtp_hdr.flags);
5631 proto_tree_add_boolean (flags_tree, hf_gtp_flags_snn, tvb, 0, 1, gtp_hdr.flags);
5634 proto_tree_add_uint (flags_tree, hf_gtp_flags_spare2, tvb, 0, 1, gtp_hdr.flags);
5635 proto_tree_add_boolean (flags_tree, hf_gtp_flags_e, tvb, 0, 1, gtp_hdr.flags);
5636 proto_tree_add_boolean (flags_tree, hf_gtp_flags_s, tvb, 0, 1, gtp_hdr.flags);
5637 proto_tree_add_boolean (flags_tree, hf_gtp_flags_pn, tvb, 0, 1, gtp_hdr.flags);
5643 proto_tree_add_uint (gtp_tree, hf_gtp_message_type, tvb, 1, 1, gtp_hdr.message);
5645 gtp_hdr.length = g_ntohs (gtp_hdr.length);
5646 proto_tree_add_uint (gtp_tree, hf_gtp_length, tvb, 2, 2, gtp_hdr.length);
5651 seq_no = tvb_get_ntohs (tvb, offset);
5652 proto_tree_add_uint (gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
5655 switch (gtp_version) {
5657 seq_no = tvb_get_ntohs (tvb, offset);
5658 proto_tree_add_uint (gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
5661 flow_label = tvb_get_ntohs (tvb, offset);
5662 proto_tree_add_uint (gtp_tree, hf_gtp_flow_label, tvb, offset, 2, flow_label);
5665 pdu_no = tvb_get_guint8 (tvb, offset);
5666 proto_tree_add_uint (gtp_tree, hf_gtp_sndcp_number, tvb, offset, 1, pdu_no);
5669 tid_val = tvb_get_ptr(tvb, offset, 8);
5670 tid_str = id_to_str (tid_val);
5671 proto_tree_add_string (gtp_tree, hf_gtp_tid, tvb, offset, 8, tid_str);
5675 teid = tvb_get_ntohl (tvb, offset);
5676 proto_tree_add_uint (gtp_tree, hf_gtp_teid, tvb, offset, 4, teid);
5679 if (gtp_hdr.flags & 0x07) {
5680 seq_no = tvb_get_ntohs (tvb, offset);
5681 proto_tree_add_uint (gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
5684 pdu_no = tvb_get_guint8 (tvb, offset);
5685 proto_tree_add_uint (gtp_tree, hf_gtp_npdu_number, tvb, offset, 1, pdu_no);
5688 next_hdr = tvb_get_guint8 (tvb, offset);
5689 proto_tree_add_uint (gtp_tree, hf_gtp_next, tvb, offset, 1, next_hdr);
5699 if (gtp_hdr.message != GTP_MSG_TPDU) {
5700 proto_tree_add_text(gtp_tree, tvb, 0, 0, "[--- end of GTP header, beginning of extension headers ---]");
5701 length = tvb_length (tvb);
5702 mandatory = 0; /* check order of GTP fields against ETSI */
5704 if (offset >= length)
5707 ext_hdr_val = next_hdr;
5711 ext_hdr_val = tvb_get_guint8 (tvb, offset);
5712 if (gtp_etsi_order) {
5713 checked_field = check_field_presence (gtp_hdr.message, ext_hdr_val , (int *)&mandatory);
5714 switch (checked_field) {
5715 case -2: proto_tree_add_text (gtp_tree, tvb, 0, 0, "[WARNING] message not found");
5717 case -1: proto_tree_add_text (gtp_tree, tvb, 0, 0, "[WARNING] field not present");
5720 default: proto_tree_add_text (gtp_tree, tvb, offset, 1, "[WARNING] wrong next field, should be: %s", val_to_str(checked_field, gtp_val, "Unknown extension field"));
5726 while (gtpopt[++i].optcode)
5727 if (gtpopt[i].optcode == ext_hdr_val)
5729 offset = offset + (*gtpopt[i].decode)(tvb, offset, pinfo, gtp_tree);
5734 if ((gtp_hdr.message == GTP_MSG_TPDU) && gtp_tpdu) {
5739 if (gtp_version == 1) {
5740 if (gtp_hdr.flags & 0x07) {
5742 if (tvb_get_guint8 (tvb, offset) == 0)
5751 sub_proto = tvb_get_guint8 (tvb, offset);
5753 if ((sub_proto >= 0x45) && (sub_proto <= 0x4e)) {
5754 /* this is most likely an IPv4 packet
5755 * we can exclude 0x40 - 0x44 because the minimum header size is 20 octets
5756 * 0x4f is excluded because PPP protocol type "IPv6 header compression"
5757 * with protocol field compression is more likely than a plain IPv4 packet with 60 octet header size */
5759 next_tvb = tvb_new_subset (tvb, offset, -1, -1);
5760 call_dissector(ip_handle, next_tvb, pinfo, tree);
5763 if ((sub_proto & 0xf0) == 0x60){
5764 /* this is most likely an IPv6 packet */
5765 next_tvb = tvb_new_subset (tvb, offset, -1, -1);
5766 call_dissector (ipv6_handle, next_tvb, pinfo, tree);
5768 /* this seems to be a PPP packet */
5770 if (sub_proto == 0xff) {
5771 /* this might be an address field, even it shouldn't be here */
5772 control_field = tvb_get_guint8 (tvb, offset + 1);
5773 if (control_field == 0x03)
5774 /* now we are pretty sure that address and control field are mistakenly inserted -> ignore it for PPP dissection */
5778 next_tvb = tvb_new_subset (tvb, offset + acfield_len, -1, -1);
5779 call_dissector (ppp_handle, next_tvb, pinfo, tree);
5782 if (check_col(pinfo->cinfo, COL_PROTOCOL))
5783 col_append_str_gtp(pinfo->cinfo, COL_PROTOCOL, "GTP");
5787 static const true_false_string yes_no_tfs = {
5793 proto_register_gtp(void)
5795 static hf_register_info hf_gtp[] = {
5796 { &hf_gtp_apn, { "APN", "gtp.apn", FT_STRING, BASE_DEC, NULL, 0, "Access Point Name", HFILL }},
5797 { &hf_gtp_cause, { "Cause ", "gtp.cause", FT_UINT8, BASE_DEC, VALS(cause_type), 0, "Cause of operation", HFILL }},
5798 { &hf_gtp_chrg_char, { "Charging characteristics", "gtp.chrg_char", FT_UINT16, BASE_DEC, NULL, 0, "Charging characteristics", HFILL }},
5799 { &hf_gtp_chrg_char_s, { "Spare", "gtp.chrg_char_s", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_S, "Spare", HFILL }},
5800 { &hf_gtp_chrg_char_n, { "Normal charging", "gtp.chrg_char_n", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_N, "Normal charging", HFILL }},
5801 { &hf_gtp_chrg_char_p, { "Prepaid charging", "gtp.chrg_char_p", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_P, "Prepaid charging", HFILL }},
5802 { &hf_gtp_chrg_char_f, { "Flat rate charging", "gtp.chrg_char_f", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_F, "Flat rate charging", HFILL }},
5803 { &hf_gtp_chrg_char_h, { "Hot billing charging", "gtp.chrg_char_h", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_H, "Hot billing charging", HFILL }},
5804 { &hf_gtp_chrg_char_r, { "Reserved", "gtp.chrg_char_r", FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_R, "Reserved", HFILL }},
5805 { &hf_gtp_chrg_id, { "Charging ID", "gtp.chrg_id", FT_UINT32, BASE_HEX, NULL, 0, "Charging ID", HFILL }},
5806 { &hf_gtp_chrg_ipv4, { "CG address IPv4", "gtp.chrg_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "Charging Gateway address IPv4", HFILL }},
5807 { &hf_gtp_chrg_ipv6, { "CG address IPv6", "gtp.chrg_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "Charging Gateway address IPv6", HFILL }},
5808 { &hf_gtp_ext_flow_label, { "Flow Label Data I", "gtp.ext_flow_label", FT_UINT16, BASE_HEX, NULL, 0, "Flow label data", HFILL }},
5809 { &hf_gtp_ext_id, { "Extension identifier", "gtp.ext_id", FT_UINT16, BASE_DEC, VALS(sminmpec_values), 0, "Extension Identifier", HFILL }},
5810 { &hf_gtp_ext_val, { "Extension value", "gtp.ext_val", FT_BYTES, BASE_HEX, NULL, 0, "Extension Value", HFILL }},
5811 { &hf_gtp_flags, { "Flags", "gtp.flags", FT_UINT8, BASE_HEX, NULL, 0, "Ver/PT/Spare...", HFILL }},
5812 { &hf_gtp_flags_ver,
5813 { "Version", "gtp.flags.version",
5814 FT_UINT8, BASE_DEC, VALS(ver_types), GTP_VER_MASK,
5815 "GTP Version", HFILL }
5818 { "Protocol type", "gtp.flags.payload",
5819 FT_UINT8, BASE_DEC, VALS(pt_types), GTP_PT_MASK,
5820 "Protocol Type", HFILL }
5822 { &hf_gtp_flags_spare1,
5823 { "Reserved", "gtp.flags.reserved",
5824 FT_UINT8, BASE_DEC, NULL, GTP_SPARE1_MASK,
5825 "Reserved (shall be sent as '111' )", HFILL }
5827 { &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 }},
5828 { &hf_gtp_flags_spare2, { "Reserved", "gtp.flags.reserved", FT_UINT8, BASE_DEC, NULL, GTP_SPARE2_MASK, "Reserved (shall be sent as '1' )", HFILL }},
5829 { &hf_gtp_flags_e, { "Is Next Extension Header present?", "gtp.flags.e", FT_BOOLEAN, 8, TFS(&yes_no_tfs), GTP_E_MASK, "Is Next Extension Header present? (1 = yes, 0 = no)", HFILL }},
5830 { &hf_gtp_flags_s, { "Is Sequence Number present?", "gtp.flags.s", FT_BOOLEAN, 8, TFS(&yes_no_tfs), GTP_S_MASK, "Is Sequence Number present? (1 = yes, 0 = no)", HFILL }},
5831 { &hf_gtp_flags_pn, { "Is N-PDU number present?", "gtp.flags.pn", FT_BOOLEAN, 8, TFS(&yes_no_tfs), GTP_PN_MASK, "Is N-PDU number present? (1 = yes, 0 = no)", HFILL }},
5832 { &hf_gtp_flow_ii, { "Flow Label Data II ", "gtp.flow_ii", FT_UINT16, BASE_DEC, NULL, 0, "Downlink flow label data", HFILL }},
5833 { &hf_gtp_flow_label, { "Flow label", "gtp.flow_label", FT_UINT16, BASE_HEX, NULL, 0, "Flow label", HFILL }},
5834 { &hf_gtp_flow_sig, { "Flow label Signalling", "gtp.flow_sig", FT_UINT16, BASE_HEX, NULL, 0, "Flow label signalling", HFILL }},
5835 { &hf_gtp_gsn_addr_len, { "GSN Address Length", "gtp.gsn_addr_len", FT_UINT8, BASE_DEC, NULL, GTP_EXT_GSN_ADDR_LEN_MASK, "GSN Address Length", HFILL }},
5836 { &hf_gtp_gsn_addr_type, { "GSN Address Type", "gtp.gsn_addr_type", FT_UINT8, BASE_DEC, VALS(gsn_addr_type), GTP_EXT_GSN_ADDR_TYPE_MASK, "GSN Address Type", HFILL }},
5837 { &hf_gtp_gsn_ipv4, { "GSN address IPv4", "gtp.gsn_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "GSN address IPv4", HFILL }},
5838 { &hf_gtp_gsn_ipv6, { "GSN address IPv6", "gtp.gsn_ipv6", FT_IPv6, BASE_DEC, NULL, 0, "GSN address IPv6", HFILL }},
5839 { &hf_gtp_imsi, { "IMSI", "gtp.imsi", FT_STRING, BASE_DEC, NULL, 0, "International Mobile Subscriber Identity number", HFILL }},
5840 { &hf_gtp_length, { "Length", "gtp.length", FT_UINT16, BASE_DEC, NULL, 0, "Length (i.e. number of octets after TID or TEID)", HFILL }},
5841 { &hf_gtp_map_cause, { "MAP cause", "gtp.map_cause", FT_UINT8, BASE_DEC, VALS(gsm_map_GSMMAPLocalErrorcode_vals), 0, "MAP cause", HFILL }},
5842 { &hf_gtp_message_type, { "Message Type", "gtp.message", FT_UINT8, BASE_HEX, VALS(message_type), 0x0, "GTP Message Type", HFILL }},
5843 { &hf_gtp_ms_reason, { "MS not reachable reason", "gtp.ms_reason", FT_UINT8, BASE_DEC, VALS(ms_not_reachable_type), 0, "MS Not Reachable Reason", HFILL }},
5844 { &hf_gtp_ms_valid, { "MS validated", "gtp.ms_valid", FT_BOOLEAN, BASE_NONE,NULL, 0, "MS validated", HFILL }},
5845 { &hf_gtp_msisdn, { "MSISDN", "gtp.msisdn", FT_STRING, BASE_DEC, NULL, 0, "MS international PSTN/ISDN number", HFILL }},
5846 { &hf_gtp_next, { "Next extension header type", "gtp.next", FT_UINT8, BASE_HEX, NULL, 0, "Next Extension Header Type", HFILL }},
5847 { &hf_gtp_node_ipv4, { "Node address IPv4", "gtp.node_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "Recommended node address IPv4", HFILL }},
5848 { &hf_gtp_node_ipv6, { "Node address IPv6", "gtp.node_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "Recommended node address IPv6", HFILL }},
5849 { &hf_gtp_npdu_number, { "N-PDU Number", "gtp.npdu_number", FT_UINT8, BASE_HEX, NULL, 0, "N-PDU Number", HFILL }},
5850 { &hf_gtp_nsapi, { "NSAPI", "gtp.nsapi", FT_UINT8, BASE_DEC, NULL, 0, "Network layer Service Access Point Identifier", HFILL }},
5851 { &hf_gtp_qos_version, { "Version", "gtp.qos_version", FT_STRING, BASE_DEC, NULL, 0, "Version of the QoS Profile", HFILL }},
5852 { &hf_gtp_qos_spare1, { "Spare", "gtp.qos_spare1", FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE1_MASK, "Spare (shall be sent as '00' )", HFILL }},
5853 { &hf_gtp_qos_delay, { "QoS delay", "gtp.qos_delay", FT_UINT8, BASE_DEC, VALS(qos_delay_type), GTP_EXT_QOS_DELAY_MASK, "Quality of Service Delay Class", HFILL }},
5854 { &hf_gtp_qos_reliability, { "QoS reliability", "gtp.qos_reliabilty", FT_UINT8, BASE_DEC, VALS(qos_reliability_type), GTP_EXT_QOS_RELIABILITY_MASK, "Quality of Service Reliability Class", HFILL }},
5855 { &hf_gtp_qos_peak, { "QoS peak", "gtp.qos_peak", FT_UINT8, BASE_DEC, VALS(qos_peak_type), GTP_EXT_QOS_PEAK_MASK, "Quality of Service Peak Throughput", HFILL }},
5856 { &hf_gtp_qos_spare2, { "Spare", "gtp.qos_spare2",FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE2_MASK, "Spare (shall be sent as 0)", HFILL }},
5857 { &hf_gtp_qos_precedence, { "QoS precedence", "gtp.qos_precedence", FT_UINT8, BASE_DEC, VALS(qos_precedence_type), GTP_EXT_QOS_PRECEDENCE_MASK, "Quality of Service Precedence Class", HFILL }},
5858 { &hf_gtp_qos_spare3, { "Spare", "gtp.qos_spare3", FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE3_MASK, "Spare (shall be sent as '000' )", HFILL }},
5859 { &hf_gtp_qos_mean, { "QoS mean", "gtp.qos_mean", FT_UINT8, BASE_DEC, VALS(qos_mean_type), GTP_EXT_QOS_MEAN_MASK, "Quality of Service Mean Throughput", HFILL }},
5860 { &hf_gtp_qos_al_ret_priority, { "Allocation/Retention priority ","gtp.qos_al_ret_priority", FT_UINT8, BASE_DEC, NULL, 0, "Allocation/Retention Priority", HFILL }},
5861 { &hf_gtp_qos_traf_class, { "Traffic class", "gtp.qos_traf_class", FT_UINT8, BASE_DEC, VALS(qos_traf_class), GTP_EXT_QOS_TRAF_CLASS_MASK, "Traffic Class", HFILL }},
5862 { &hf_gtp_qos_del_order, { "Delivery order", "gtp.qos_del_order", FT_UINT8, BASE_DEC, VALS(qos_del_order), GTP_EXT_QOS_DEL_ORDER_MASK, "Delivery Order", HFILL }},
5863 { &hf_gtp_qos_del_err_sdu, { "Delivery of erroneous SDU", "gtp.qos_del_err_sdu", FT_UINT8, BASE_DEC, VALS(qos_del_err_sdu), GTP_EXT_QOS_DEL_ERR_SDU_MASK, "Delivery of Erroneous SDU", HFILL }},
5864 { &hf_gtp_qos_max_sdu_size, { "Maximum SDU size", "gtp.qos_max_sdu_size", FT_UINT8, BASE_DEC, VALS(qos_max_sdu_size), 0, "Maximum SDU size", HFILL }},
5865 { &hf_gtp_qos_max_ul, { "Maximum bit rate for uplink", "gtp.qos_max_ul", FT_UINT8, BASE_DEC, VALS(qos_max_ul), 0, "Maximum bit rate for uplink", HFILL }},
5866 { &hf_gtp_qos_max_dl, { "Maximum bit rate for downlink", "gtp.qos_max_dl", FT_UINT8, BASE_DEC, VALS(qos_max_dl), 0, "Maximum bit rate for downlink", HFILL }},
5867 { &hf_gtp_qos_res_ber, { "Residual BER", "gtp.qos_res_ber", FT_UINT8, BASE_DEC, VALS(qos_res_ber), GTP_EXT_QOS_RES_BER_MASK, "Residual Bit Error Rate", HFILL }},
5868 { &hf_gtp_qos_sdu_err_ratio, { "SDU Error ratio", "gtp.qos_sdu_err_ratio", FT_UINT8, BASE_DEC, VALS(qos_sdu_err_ratio), GTP_EXT_QOS_SDU_ERR_RATIO_MASK, "SDU Error Ratio", HFILL }},
5869 { &hf_gtp_qos_trans_delay, { "Transfer delay", "gtp.qos_trans_delay", FT_UINT8, BASE_DEC, VALS(qos_trans_delay), GTP_EXT_QOS_TRANS_DELAY_MASK, "Transfer Delay", HFILL }},
5870 { &hf_gtp_qos_traf_handl_prio, { "Traffic handling priority", "gtp.qos_traf_handl_prio", FT_UINT8, BASE_DEC, VALS(qos_traf_handl_prio), GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK, "Traffic Handling Priority", HFILL }},
5871 { &hf_gtp_qos_guar_ul, { "Guaranteed bit rate for uplink", "gtp.qos_guar_ul", FT_UINT8, BASE_DEC, VALS(qos_guar_ul), 0, "Guaranteed bit rate for uplink", HFILL }},
5872 { &hf_gtp_qos_guar_dl, { "Guaranteed bit rate for downlink", "gtp.qos_guar_dl", FT_UINT8, BASE_DEC, VALS(qos_guar_dl), 0, "Guaranteed bit rate for downlink", HFILL }},
5873 { &hf_gtp_pkt_flow_id, { "Packet Flow ID", "gtp.pkt_flow_id", FT_UINT8, BASE_DEC, NULL, 0, "Packet Flow ID", HFILL }},
5874 { &hf_gtp_ptmsi, { "P-TMSI", "gtp.ptmsi", FT_UINT32, BASE_HEX, NULL, 0, "Packet-Temporary Mobile Subscriber Identity", HFILL }},
5875 { &hf_gtp_ptmsi_sig, { "P-TMSI Signature", "gtp.ptmsi_sig", FT_UINT24, BASE_HEX, NULL, 0, "P-TMSI Signature", HFILL }},
5876 { &hf_gtp_rab_gtpu_dn, { "Downlink GTP-U seq number", "gtp.rab_gtp_dn", FT_UINT16, BASE_DEC, NULL, 0, "Downlink GTP-U sequence number", HFILL }},
5877 { &hf_gtp_rab_gtpu_up, { "Uplink GTP-U seq number", "gtp.rab_gtp_up", FT_UINT16, BASE_DEC, NULL, 0, "Uplink GTP-U sequence number", HFILL }},
5878 { &hf_gtp_rab_pdu_dn, { "Downlink next PDCP-PDU seq number", "gtp.rab_pdu_dn", FT_UINT16, BASE_DEC, NULL, 0, "Downlink next PDCP-PDU sequence number", HFILL }},
5879 { &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 }},
5880 { &hf_gtp_rai_mcc, { "MCC", "gtp.mcc", FT_UINT16, BASE_DEC, NULL, 0, "Mobile Country Code", HFILL }},
5881 { &hf_gtp_rai_mnc, { "MNC", "gtp.mnc", FT_UINT8, BASE_DEC, NULL, 0, "Mobile Network Code", HFILL }},
5882 { &hf_gtp_rai_rac, { "RAC", "gtp.rac", FT_UINT8, BASE_DEC, NULL, 0, "Routing Area Code", HFILL }},
5883 { &hf_gtp_rai_lac, { "LAC", "gtp.lac", FT_UINT16, BASE_DEC, NULL, 0, "Location Area Code", HFILL }},
5884 { &hf_gtp_ranap_cause, { "RANAP cause", "gtp.ranap_cause", FT_UINT8, BASE_DEC, VALS(ranap_cause_type), 0, "RANAP cause", HFILL }},
5885 { &hf_gtp_recovery, { "Recovery", "gtp.recovery", FT_UINT8, BASE_DEC, NULL, 0, "Restart counter", HFILL }},
5886 { &hf_gtp_reorder, { "Reordering required","gtp.reorder", FT_BOOLEAN, BASE_NONE,NULL, 0, "Reordering required", HFILL }},
5887 { &hf_gtp_rnc_ipv4, { "RNC address IPv4", "gtp.rnc_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "Radio Network Controller address IPv4", HFILL }},
5888 { &hf_gtp_rnc_ipv6, { "RNC address IPv6", "gtp.rnc_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "Radio Network Controller address IPv6", HFILL }},
5889 { &hf_gtp_rp, { "Radio Priority", "gtp.rp", FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_MASK, "Radio Priority for uplink tx", HFILL }},
5890 { &hf_gtp_rp_nsapi, { "NSAPI in Radio Priority", "gtp.rp_nsapi", FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_NSAPI_MASK, "Network layer Service Access Point Identifier in Radio Priority", HFILL }},
5891 { &hf_gtp_rp_sms, { "Radio Priority SMS", "gtp.rp_sms", FT_UINT8, BASE_DEC, NULL, 0, "Radio Priority for MO SMS", HFILL }},
5892 { &hf_gtp_rp_spare, { "Reserved", "gtp.rp_spare", FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_SPARE_MASK, "Spare bit", HFILL }},
5893 { &hf_gtp_sel_mode, { "Selection mode", "gtp.sel_mode", FT_UINT8, BASE_DEC, VALS(sel_mode_type), 0, "Selection Mode", HFILL }},
5894 { &hf_gtp_seq_number, { "Sequence number", "gtp.seq_number", FT_UINT16, BASE_HEX, NULL, 0, "Sequence Number", HFILL }},
5895 { &hf_gtp_sndcp_number, { "SNDCP N-PDU LLC Number", "gtp.sndcp_number", FT_UINT8, BASE_HEX, NULL, 0, "SNDCP N-PDU LLC Number", HFILL }},
5896 { &hf_gtp_tear_ind, { "Teardown Indicator", "gtp.tear_ind", FT_BOOLEAN, BASE_NONE,NULL, 0, "Teardown Indicator", HFILL }},
5897 { &hf_gtp_teid, { "TEID", "gtp.teid", FT_UINT32, BASE_HEX, NULL, 0, "Tunnel Endpoint Identifier", HFILL }},
5898 { &hf_gtp_teid_cp, { "TEID Control Plane", "gtp.teid_cp", FT_UINT32, BASE_HEX, NULL, 0, "Tunnel Endpoint Identifier Control Plane", HFILL }},
5899 { &hf_gtp_teid_data, { "TEID Data I", "gtp.teid_data", FT_UINT32, BASE_HEX, NULL, 0, "Tunnel Endpoint Identifier Data I", HFILL }},
5900 { &hf_gtp_teid_ii, { "TEID Data II", "gtp.teid_ii", FT_UINT32, BASE_HEX, NULL, 0, "Tunnel Endpoint Identifier Data II", HFILL }},
5901 { &hf_gtp_tft_code, { "TFT operation code", "gtp.tft_code", FT_UINT8, BASE_DEC, VALS (tft_code_type), GTPv1_TFT_CODE_MASK, "TFT operation code", HFILL }},
5902 { &hf_gtp_tft_spare, { "TFT spare bit", "gtp.tft_spare", FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_SPARE_MASK, "TFT spare bit", HFILL }},
5903 { &hf_gtp_tft_number, { "Number of packet filters", "gtp.tft_number", FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_NUMBER_MASK, "Number of packet filters", HFILL }},
5904 { &hf_gtp_tft_eval, { "Evaluation precedence", "gtp.tft_eval", FT_UINT8, BASE_DEC, NULL, 0, "Evaluation precedence", HFILL }},
5905 { &hf_gtp_tid, { "TID", "gtp.tid", FT_STRING, BASE_DEC, NULL, 0, "Tunnel Identifier", HFILL }},
5906 { &hf_gtp_tlli, { "TLLI", "gtp.tlli", FT_UINT32, BASE_HEX, NULL, 0, "Temporary Logical Link Identity", HFILL }},
5907 { &hf_gtp_tr_comm, { "Packet transfer command", "gtp.tr_comm", FT_UINT8, BASE_DEC, VALS (tr_comm_type), 0, "Packat transfer command", HFILL }},
5908 { &hf_gtp_trace_ref, { "Trace reference", "gtp.trace_ref", FT_UINT16, BASE_HEX, NULL, 0, "Trace reference", HFILL }},
5909 { &hf_gtp_trace_type, { "Trace type", "gtp.trace_type", FT_UINT16, BASE_HEX, NULL, 0, "Trace type", HFILL }},
5910 { &hf_gtp_unknown, { "Unknown data (length)", "gtp.unknown", FT_UINT16, BASE_DEC, NULL, 0, "Unknown data", HFILL }},
5911 { &hf_gtp_user_addr_pdp_org, { "PDP type organization", "gtp.user_addr_pdp_org", FT_UINT8, BASE_DEC, VALS(pdp_org_type), 0, "PDP type organization", HFILL }},
5912 { &hf_gtp_user_addr_pdp_type, { "PDP type number", "gtp.user_addr_pdp_type", FT_UINT8, BASE_HEX, VALS (pdp_type), 0, "PDP type", HFILL }},
5913 { &hf_gtp_user_ipv4, { "End user address IPv4", "gtp.user_ipv4", FT_IPv4, BASE_DEC, NULL, 0, "End user address IPv4", HFILL }},
5914 { &hf_gtp_user_ipv6, { "End user address IPv6", "gtp.user_ipv6", FT_IPv6, BASE_HEX, NULL, 0, "End user address IPv6", HFILL }},
5915 { &hf_gtp_security_mode,
5916 { "Security Mode", "gtp.security_mode",
5917 FT_UINT8, BASE_DEC, VALS(mm_sec_modep), 0xc0,
5918 "Security Mode", HFILL }
5920 { &hf_gtp_no_of_vectors,
5921 { "No of Vectors", "gtp.no_of_vectors",
5922 FT_UINT8, BASE_DEC, NULL, 0x38,
5923 "No of Vectors", HFILL }
5925 { &hf_gtp_cipher_algorithm,
5926 { "Cipher Algorithm", "gtp.no_of_vectors",
5927 FT_UINT8, BASE_DEC, VALS(gtp_cipher_algorithm), 0x07,
5928 "Cipher Algorithm", HFILL }
5931 { "Ciphering Key Sequence Number (CKSN)/Key Set Identifier (KSI)", "gtp.cksn_ksi",
5932 FT_UINT8, BASE_DEC, NULL, 0x07,
5936 { "Ciphering Key Sequence Number (CKSN)", "gtp.cksn_ksi",
5937 FT_UINT8, BASE_DEC, NULL, 0x07,
5941 { "Key Set Identifier (KSI)", "gtp.cksn_ksi",
5942 FT_UINT8, BASE_DEC, NULL, 0x07,
5945 { &hf_gtp_ext_length,
5946 { "Length", "gtp.ext_length",
5947 FT_UINT16, BASE_DEC, NULL, 0x0,
5948 "IE Length", HFILL }
5950 { &hf_gtp_ext_apn_res,
5951 { "Restriction Type", "gtp.ext_apn_res",
5952 FT_UINT8, BASE_DEC, NULL, 0x0,
5953 "Restriction Type", HFILL }
5955 { &hf_gtp_ext_rat_type,
5956 { "RAT Type", "gtp.ext_rat_type",
5957 FT_UINT8, BASE_DEC, VALS(gtp_ext_rat_type_vals), 0x0,
5960 { &hf_gtp_ext_geo_loc_type,
5961 { "Geographic Location Type", "gtp.ext_geo_loc_type",
5962 FT_UINT8, BASE_DEC, NULL, 0x0,
5963 "Geographic Location Type", HFILL }
5966 { "SAC", "gtp.ext_sac",
5967 FT_UINT16, BASE_HEX, NULL, 0x0,
5970 { &hf_gtp_ext_imeisv,
5971 { "IMEI(SV)", "gtp.ext_imeisv",
5972 FT_BYTES, BASE_NONE, NULL, 0x0,
5976 { "TargetID", "gtp.targetid",
5977 FT_UINT32, BASE_DEC, VALS(ranap_TargetID_vals), 0,
5978 "TargetID", HFILL }},
5979 { &hf_gtp_bssgp_cause,
5980 { "BSSGP Cause", "gtp.bssgp_cause",
5981 FT_UINT8, BASE_DEC, VALS(tab_cause), 0,
5982 "BSSGP Cause", HFILL }},
5986 static gint *ett_gtp_array[] = {
5996 &ett_gtp_pkt_flow_id,
6018 &ett_gtp_ext_tree_apn_res,
6019 &ett_gtp_ext_rat_type,
6020 &ett_gtp_ext_imeisv,
6021 &ett_gtp_ext_ran_tr_cont,
6022 &ett_gtp_ext_pdp_cont_prio,
6023 &ett_gtp_ext_ssgn_no,
6024 &ett_gtp_ext_rab_setup_inf,
6025 &ett_gtp_ext_common_flgs,
6026 &ett_gtp_ext_usr_loc_inf,
6027 &ett_gtp_ext_ms_time_zone,
6028 &ett_gtp_ext_camel_chg_inf_con,
6029 &ett_GTP_EXT_MBMS_UE_CTX,
6031 &ett_gtp_ext_rim_ra,
6032 &ett_gtp_ext_mbms_prot_conf_opt,
6033 &ett_gtp_ext_mbms_sa,
6034 &ett_gtp_ext_bms_ses_dur,
6035 &ett_gtp_ext_src_rnc_pdp_ctx_inf,
6036 &ett_gtp_ext_add_trs_inf,
6037 &ett_gtp_ext_hop_count,
6038 &ett_gtp_ext_sel_plmn_id,
6039 &ett_gtp_ext_mbms_ses_id,
6040 &ett_gtp_ext_mbms_2g_3g_ind,
6041 &ett_gtp_ext_enh_nsapi,
6042 &ett_gtp_ext_ad_mbms_trs_inf,
6043 &ett_gtp_ext_mbms_ses_id_rep_no,
6044 &ett_gtp_ext_mbms_time_to_data_tr,
6045 &ett_gtp_ext_ps_ho_req_ctx,
6046 &ett_gtp_ext_bss_cont,
6047 &ett_gtp_ext_cell_id,
6048 &ett_gtp_ext_pdu_no,
6049 &ett_gtp_ext_bssgp_cause,
6050 &ett_gtp_ext_ra_prio_lcs,
6052 &ett_gtp_utran_cont,
6055 module_t *gtp_module;
6057 proto_gtp = proto_register_protocol ("GPRS Tunneling Protocol", "GTP", "gtp");
6058 proto_register_field_array (proto_gtp, hf_gtp, array_length (hf_gtp));
6059 proto_register_subtree_array (ett_gtp_array, array_length (ett_gtp_array));
6061 gtp_module = prefs_register_protocol(proto_gtp, proto_reg_handoff_gtp);
6063 prefs_register_uint_preference(gtp_module, "v0_port", "GTPv0 port", "GTPv0 port (default 3386)", 10, &g_gtpv0_port);
6064 prefs_register_uint_preference(gtp_module, "v1c_port", "GTPv1 control plane (GTP-C) port", "GTPv1 control plane port (default 2123)", 10, &g_gtpv1c_port);
6065 prefs_register_uint_preference(gtp_module, "v1u_port", "GTPv1 user plane (GTP-U) port", "GTPv1 user plane port (default 2152)", 10, &g_gtpv1u_port);
6066 prefs_register_bool_preference(gtp_module, "dissect_tpdu", "Dissect T-PDU", "Dissect T-PDU", >p_tpdu);
6068 prefs_register_obsolete_preference (gtp_module, "v0_dissect_cdr_as");
6069 prefs_register_obsolete_preference (gtp_module, "v0_check_etsi");
6070 prefs_register_obsolete_preference (gtp_module, "v1_check_etsi");
6071 prefs_register_bool_preference (gtp_module, "check_etsi", "Compare GTP order with ETSI", "GTP ETSI order", >p_etsi_order);
6072 prefs_register_obsolete_preference(gtp_module, "ppp_reorder");
6074 /* This preference can be used to disable the dissection of GTP over TCP. Most of the Wireless operators uses GTP over UDP.
6075 * The preference is set to TRUE by default forbackward compatibility
6077 prefs_register_bool_preference(gtp_module, "dissect_gtp_over_tcp", "Dissect GTP over TCP", "Dissect GTP over TCP", >p_over_tcp);
6079 register_dissector("gtp", dissect_gtp, proto_gtp);
6083 proto_reg_handoff_gtp(void)
6085 static int Initialized = FALSE;
6086 static dissector_handle_t gtp_handle;
6090 gtp_handle = find_dissector("gtp");
6091 ppp_subdissector_table = find_dissector_table("ppp.protocol");
6093 radius_register_avp_dissector(VENDOR_THE3GPP,5,dissect_radius_qos_umts);
6097 dissector_delete ("udp.port", gtpv0_port, gtp_handle);
6098 dissector_delete ("udp.port", gtpv1c_port, gtp_handle);
6099 dissector_delete ("udp.port", gtpv1u_port, gtp_handle);
6101 if ( !gtp_over_tcp ) {
6102 dissector_delete ("tcp.port", gtpv0_port, gtp_handle);
6103 dissector_delete ("tcp.port", gtpv1c_port, gtp_handle);
6104 dissector_delete ("tcp.port", gtpv1u_port, gtp_handle);
6109 gtpv0_port = g_gtpv0_port;
6110 gtpv1c_port = g_gtpv1c_port;
6111 gtpv1u_port = g_gtpv1u_port;
6113 dissector_add ("udp.port", g_gtpv0_port, gtp_handle);
6114 dissector_add ("udp.port", g_gtpv1c_port, gtp_handle);
6115 dissector_add ("udp.port", g_gtpv1u_port, gtp_handle);
6118 if ( gtp_over_tcp ) {
6119 dissector_add ("tcp.port", g_gtpv0_port, gtp_handle);
6120 dissector_add ("tcp.port", g_gtpv1c_port, gtp_handle);
6121 dissector_add ("tcp.port", g_gtpv1u_port, gtp_handle);
6124 ip_handle = find_dissector("ip");
6125 ipv6_handle = find_dissector("ipv6");
6126 ppp_handle = find_dissector("ppp");
6127 data_handle = find_dissector("data");
6128 gtpcdr_handle = find_dissector("gtpcdr");
6129 bssap_pdu_type_table = find_dissector_table("bssap.pdu_type");