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 - 2009, Anders Broman <anders.broman@ericsson.com>
10 * Added Bearer control mode dissection:
11 * Copyright 2011, Grzegorz Szczytowski <grzegorz.szczytowski@gmail.com>
13 * Updates and corrections:
14 * Copyright 2011-2013, Anders Broman <anders.broman@ericsson.com>
16 * PDCP PDU number extension header support added by Martin Isaksson <martin.isaksson@ericsson.com>
18 * Control Plane Request-Response tracking code Largely based on similar routines in
19 * packet-ldap.c by Ronnie Sahlberg
20 * Added by Kari Tiirikainen <kari.tiirikainen@nsn.com>
22 * Wireshark - Network traffic analyzer
23 * By Gerald Combs <gerald@wireshark.org>
24 * Copyright 1998 Gerald Combs
26 * SPDX-License-Identifier: GPL-2.0-or-later
28 * GTP v0: 3GPP TS 09.60
30 * http://www.3gpp.org/ftp/Specs/html-info/0960.htm
32 * GTP v1: 3GPP TS 29.060
34 * http://www.3gpp.org/ftp/Specs/html-info/29060.htm
36 * GTP': 3GPP TS 32.295
38 * http://www.3gpp.org/ftp/Specs/html-info/32295.htm
43 #include <epan/packet.h>
44 #include <epan/conversation.h>
45 #include <epan/prefs.h>
46 #include <epan/expert.h>
47 #include <epan/sminmpec.h>
48 #include <epan/addr_resolv.h>
49 #include <epan/asn1.h>
51 #include <epan/srt_table.h>
52 #include <epan/to_str.h>
53 #include "packet-ppp.h"
54 #include "packet-radius.h"
55 #include "packet-gsm_a_common.h"
56 #include "packet-gsm_map.h"
57 #include "packet-gprscdr.h"
58 #include "packet-bssgp.h"
59 #include "packet-e212.h"
60 #include "packet-gtp.h"
61 #include "packet-ranap.h"
63 void proto_register_gtp(void);
64 void proto_reg_handoff_gtp(void);
66 static dissector_table_t ppp_subdissector_table;
67 static dissector_table_t gtp_priv_ext_dissector_table;
68 static dissector_table_t gtp_cdr_fmt_dissector_table;
69 static dissector_handle_t gtp_handle, gtp_prime_handle;
71 #define GTPv0_PORT 3386
72 #define GTPv1C_PORT 2123 /* 3G Control PDU */
73 #define GTPv1U_PORT 2152 /* 3G T-PDU */
75 #define GTPv0_HDR_LENGTH 20
76 #define GTPv1_HDR_LENGTH 12
77 #define GTP_PRIME_HDR_LENGTH 6
79 /* to check compliance with ETSI */
80 #define GTP_MANDATORY 1
81 #define GTP_OPTIONAL 2
82 #define GTP_CONDITIONAL 4
84 #define GTP_TPDU_AS_NONE -1
85 #define GTP_TPDU_AS_TPDU 0
86 #define GTP_TPDU_AS_SYNC 2
88 static gboolean g_gtp_over_tcp = TRUE;
89 gboolean g_gtp_session = FALSE;
91 static guint g_gtpv0_port = GTPv0_PORT;
92 static guint g_gtpv1c_port = GTPv1C_PORT;
93 static guint g_gtpv1u_port = GTPv1U_PORT;
95 static int proto_gtp = -1;
96 static int proto_gtpprime = -1;
99 static int hf_gtp_ie_id = -1;
100 static int hf_gtp_response_in = -1;
101 static int hf_gtp_response_to = -1;
102 static int hf_gtp_time = -1;
103 static int hf_gtp_apn = -1;
104 static int hf_gtp_cause = -1;
105 static int hf_gtp_chrg_char = -1;
106 static int hf_gtp_chrg_char_s = -1;
107 static int hf_gtp_chrg_char_n = -1;
108 static int hf_gtp_chrg_char_p = -1;
109 static int hf_gtp_chrg_char_f = -1;
110 static int hf_gtp_chrg_char_h = -1;
111 static int hf_gtp_chrg_char_r = -1;
112 static int hf_gtp_chrg_id = -1;
113 static int hf_gtp_chrg_ipv4 = -1;
114 static int hf_gtp_chrg_ipv6 = -1;
115 static int hf_gtp_ext_flow_label = -1;
116 static int hf_gtp_ext_id = -1;
117 static int hf_gtp_ext_val = -1;
118 static int hf_gtp_ext_hdr = -1;
119 static int hf_gtp_ext_hdr_next = -1;
120 static int hf_gtp_ext_hdr_length = -1;
121 static int hf_gtp_ext_hdr_ran_cont = -1;
122 static int hf_gtp_ext_hdr_spare_bits = -1;
123 static int hf_gtp_ext_hdr_spare_bytes = -1;
124 static int hf_gtp_ext_hdr_long_pdcp_sn = -1;
125 static int hf_gtp_ext_hdr_xw_ran_cont = -1;
126 static int hf_gtp_ext_hdr_nr_ran_cont = -1;
127 static int hf_gtp_ext_hdr_pdu_session_cont = -1;
128 static int hf_gtp_ext_hdr_pdcpsn = -1;
129 static int hf_gtp_ext_hdr_udp_port = -1;
130 static int hf_gtp_flags = -1;
131 static int hf_gtp_flags_ver = -1;
132 static int hf_gtp_prime_flags_ver = -1;
133 static int hf_gtp_flags_pt = -1;
134 static int hf_gtp_flags_spare1 = -1;
135 static int hf_gtp_flags_hdr_length = -1;
136 static int hf_gtp_flags_snn = -1;
137 static int hf_gtp_flags_spare2 = -1;
138 static int hf_gtp_flags_e = -1;
139 static int hf_gtp_flags_s = -1;
140 static int hf_gtp_flags_pn = -1;
141 static int hf_gtp_flow_ii = -1;
142 static int hf_gtp_flow_label = -1;
143 static int hf_gtp_flow_sig = -1;
144 static int hf_gtp_gsn_addr_len = -1;
145 static int hf_gtp_gsn_addr_type = -1;
146 static int hf_gtp_gsn_ipv4 = -1;
147 static int hf_gtp_gsn_ipv6 = -1;
148 static int hf_gtp_length = -1;
149 static int hf_gtp_map_cause = -1;
150 static int hf_gtp_message_type = -1;
151 static int hf_gtp_ms_reason = -1;
152 static int hf_gtp_ms_valid = -1;
153 static int hf_gtp_npdu_number = -1;
154 static int hf_gtp_node_ipv4 = -1;
155 static int hf_gtp_node_ipv6 = -1;
156 static int hf_gtp_nsapi = -1;
157 static int hf_gtp_ptmsi = -1;
158 static int hf_gtp_ptmsi_sig = -1;
159 static int hf_gtp_qos_version = -1;
160 static int hf_gtp_qos_spare1 = -1;
161 static int hf_gtp_qos_delay = -1;
162 static int hf_gtp_qos_mean = -1;
163 static int hf_gtp_qos_peak = -1;
164 static int hf_gtp_qos_spare2 = -1;
165 static int hf_gtp_qos_precedence = -1;
166 static int hf_gtp_qos_spare3 = -1;
167 static int hf_gtp_qos_reliability = -1;
168 static int hf_gtp_qos_al_ret_priority = -1;
169 static int hf_gtp_qos_traf_class = -1;
170 static int hf_gtp_qos_del_order = -1;
171 static int hf_gtp_qos_del_err_sdu = -1;
172 static int hf_gtp_qos_max_sdu_size = -1;
173 static int hf_gtp_qos_max_ul = -1;
174 static int hf_gtp_qos_max_dl = -1;
175 static int hf_gtp_qos_res_ber = -1;
176 static int hf_gtp_qos_sdu_err_ratio = -1;
177 static int hf_gtp_qos_trans_delay = -1;
178 static int hf_gtp_qos_traf_handl_prio = -1;
179 static int hf_gtp_qos_guar_ul = -1;
180 static int hf_gtp_qos_guar_dl = -1;
181 static int hf_gtp_qos_spare4 = -1;
182 static int hf_gtp_qos_sig_ind = -1;
183 static int hf_gtp_qos_src_stat_desc = -1;
184 static int hf_gtp_qos_arp = -1;
185 static int hf_gtp_qos_arp_pvi = -1;
186 static int hf_gtp_qos_arp_pl = -1;
187 static int hf_gtp_qos_arp_pci = -1;
188 static int hf_gtp_qos_qci = -1;
189 static int hf_gtp_qos_ul_mbr = -1;
190 static int hf_gtp_qos_dl_mbr = -1;
191 static int hf_gtp_qos_ul_gbr = -1;
192 static int hf_gtp_qos_dl_gbr = -1;
193 static int hf_gtp_qos_ul_apn_ambr = -1;
194 static int hf_gtp_qos_dl_apn_ambr = -1;
195 static int hf_gtp_pkt_flow_id = -1;
196 static int hf_gtp_rab_gtpu_dn = -1;
197 static int hf_gtp_rab_gtpu_up = -1;
198 static int hf_gtp_rab_pdu_dn = -1;
199 static int hf_gtp_rab_pdu_up = -1;
200 static int hf_gtp_uli_geo_loc_type = -1;
201 static int hf_gtp_cgi_ci = -1;
202 static int hf_gtp_sai_sac = -1;
203 static int hf_gtp_rai_rac = -1;
204 static int hf_gtp_lac = -1;
205 static int hf_gtp_tac = -1;
206 static int hf_gtp_eci = -1;
207 static int hf_gtp_ranap_cause = -1;
208 static int hf_gtp_recovery = -1;
209 static int hf_gtp_reorder = -1;
210 static int hf_gtp_rnc_ipv4 = -1;
211 static int hf_gtp_rnc_ipv6 = -1;
212 static int hf_gtp_rp = -1;
213 static int hf_gtp_rp_nsapi = -1;
214 static int hf_gtp_rp_sms = -1;
215 static int hf_gtp_rp_spare = -1;
216 static int hf_gtp_sel_mode = -1;
217 static int hf_gtp_seq_number = -1;
218 static int hf_gtp_session = -1;
219 static int hf_gtp_sndcp_number = -1;
220 static int hf_gtp_tear_ind = -1;
221 static int hf_gtp_teid = -1;
222 static int hf_gtp_teid_cp = -1;
223 static int hf_gtp_ulink_teid_cp = -1;
224 static int hf_gtp_teid_data = -1;
225 static int hf_gtp_ulink_teid_data = -1;
226 static int hf_gtp_teid_ii = -1;
227 static int hf_gtp_tid = -1;
228 static int hf_gtp_tlli = -1;
229 static int hf_gtp_tr_comm = -1;
230 static int hf_gtp_trace_ref = -1;
231 static int hf_gtp_trace_type = -1;
232 static int hf_gtp_user_addr_pdp_org = -1;
233 static int hf_gtp_user_addr_pdp_type = -1;
234 static int hf_gtp_user_ipv4 = -1;
235 static int hf_gtp_user_ipv6 = -1;
236 static int hf_gtp_security_mode = -1;
237 static int hf_gtp_no_of_vectors = -1;
238 static int hf_gtp_cipher_algorithm = -1;
239 static int hf_gtp_cksn_ksi = -1;
240 static int hf_gtp_cksn = -1;
241 static int hf_gtp_ksi = -1;
242 static int hf_gtp_ext_length = -1;
243 static int hf_gtp_utran_field = -1;
244 static int hf_gtp_ext_apn_res = -1;
245 static int hf_gtp_ext_rat_type = -1;
246 static int hf_gtp_ext_imeisv = -1;
247 static int hf_gtp_target_rnc_id = -1;
248 static int hf_gtp_target_ext_rnc_id = -1;
249 static int hf_gtp_bssgp_cause = -1;
250 static int hf_gtp_bssgp_ra_discriminator = -1;
251 static int hf_gtp_sapi = -1;
252 static int hf_gtp_xid_par_len = -1;
253 static int hf_gtp_rep_act_type = -1;
254 static int hf_gtp_correlation_id = -1;
255 static int hf_gtp_earp_pci = -1;
256 static int hf_gtp_earp_pl = -1;
257 static int hf_gtp_earp_pvi = -1;
258 static int hf_gtp_ext_comm_flags_uasi = -1;
259 static int hf_gtp_ext_comm_flags_II_pnsi = -1;
260 static int hf_gtp_ext_comm_flags_II_dtci = -1;
261 static int hf_gtp_ext_comm_flags_II_pmtsmi = -1;
262 static int hf_gtp_ext_comm_flags_II_spare = -1;
263 static int hf_gtp_cdr_app = -1;
264 static int hf_gtp_cdr_rel = -1;
265 static int hf_gtp_cdr_ver = -1;
266 static int hf_gtp_cdr_length = -1;
267 static int hf_gtp_cdr_context = -1;
268 static int hf_gtp_cmn_flg_ppc = -1;
269 static int hf_gtp_cmn_flg_mbs_srv_type = -1;
270 static int hf_gtp_cmn_flg_mbs_ran_pcd_rdy = -1;
271 static int hf_gtp_cmn_flg_mbs_cnt_inf = -1;
272 static int hf_gtp_cmn_flg_nrsn = -1;
273 static int hf_gtp_cmn_flg_no_qos_neg = -1;
274 static int hf_gtp_cmn_flg_upgrd_qos_sup = -1;
275 static int hf_gtp_cmn_flg_dual_addr_bearer_flg = -1;
276 static int hf_gtp_tmgi = -1;
277 static int hf_gtp_mbms_ses_dur_days = -1;
278 static int hf_gtp_mbms_ses_dur_s = -1;
279 static int hf_gtp_no_of_mbms_sa_codes = -1;
280 static int hf_gtp_mbms_sa_code = -1;
281 static int hf_gtp_mbs_2g_3g_ind = -1;
282 static int hf_gtp_time_2_dta_tr = -1;
283 static int hf_gtp_ext_ei = -1;
284 static int hf_gtp_ext_gcsi = -1;
285 static int hf_gtp_ext_dti = -1;
286 static int hf_gtp_ra_prio_lcs = -1;
287 static int hf_gtp_bcm = -1;
288 static int hf_gtp_fqdn = -1;
289 static int hf_gtp_rim_routing_addr = -1;
290 static int hf_gtp_mbms_flow_id = -1;
291 static int hf_gtp_mbms_dist_indic = -1;
292 static int hf_gtp_ext_apn_ambr_ul = -1;
293 static int hf_gtp_ext_apn_ambr_dl = -1;
294 static int hf_gtp_ext_sub_ue_ambr_ul = -1;
295 static int hf_gtp_ext_sub_ue_ambr_dl = -1;
296 static int hf_gtp_ext_auth_ue_ambr_ul = -1;
297 static int hf_gtp_ext_auth_ue_ambr_dl = -1;
298 static int hf_gtp_ext_auth_apn_ambr_ul = -1;
299 static int hf_gtp_ext_auth_apn_ambr_dl = -1;
300 static int hf_gtp_ext_ggsn_back_off_time_units = -1;
301 static int hf_gtp_ext_ggsn_back_off_timer = -1;
302 static int hf_gtp_higher_br_16mb_flg = -1;
303 static int hf_gtp_max_mbr_apn_ambr_ul = -1;
304 static int hf_gtp_max_mbr_apn_ambr_dl = -1;
305 static int hf_gtp_ext_enb_type = -1;
306 static int hf_gtp_macro_enodeb_id = -1;
307 static int hf_gtp_home_enodeb_id = -1;
308 static int hf_gtp_dummy_octets = -1;
310 /* Generated from convert_proto_tree_add_text.pl */
311 static int hf_gtp_ggsn_2_address_ipv4 = -1;
312 static int hf_gtp_rfsp_index = -1;
313 static int hf_gtp_quintuplet_ciphering_key = -1;
314 static int hf_gtp_kc = -1;
315 static int hf_gtp_rand = -1;
316 static int hf_gtp_pdp_context_identifier = -1;
317 static int hf_gtp_receive_n_pdu_number = -1;
318 static int hf_gtp_container_length = -1;
319 static int hf_gtp_quintuplets_length = -1;
320 static int hf_gtp_auth = -1;
321 static int hf_gtp_tft_length = -1;
322 static int hf_gtp_ggsn_address_for_control_plane = -1;
323 static int hf_gtp_integrity_key_ik = -1;
324 static int hf_gtp_gsn_address_information_element_length = -1;
325 static int hf_gtp_reordering_required = -1;
326 static int hf_gtp_sres = -1;
327 static int hf_gtp_data_record_format = -1;
328 static int hf_gtp_timezone = -1;
329 static int hf_gtp_timezone_dst = -1;
330 static int hf_gtp_authentication_length = -1;
331 static int hf_gtp_send_n_pdu_number = -1;
332 static int hf_gtp_sequence_number_up = -1;
333 static int hf_gtp_pdp_address_length = -1;
334 static int hf_gtp_transaction_identifier = -1;
335 static int hf_gtp_xres_length = -1;
336 static int hf_gtp_ggsn_address_length = -1;
337 static int hf_gtp_apn_length = -1;
338 static int hf_gtp_sequence_number_down = -1;
339 static int hf_gtp_ggsn_2_address_ipv6 = -1;
340 static int hf_gtp_pdp_address_ipv4 = -1;
341 static int hf_gtp_activity_status_indicator = -1;
342 static int hf_gtp_pdp_type = -1;
343 static int hf_gtp_ggsn_address_for_user_traffic = -1;
344 static int hf_gtp_quintuplet_integrity_key = -1;
345 static int hf_gtp_pdp_address_ipv6 = -1;
346 static int hf_gtp_rab_setup_length = -1;
347 static int hf_gtp_number_of_data_records = -1;
348 static int hf_gtp_ciphering_key_kc = -1;
349 static int hf_gtp_pdp_cntxt_sapi = -1;
350 static int hf_gtp_xres = -1;
351 static int hf_gtp_pdp_organization = -1;
352 static int hf_gtp_node_address_length = -1;
353 static int hf_gtp_ggsn_2_address_length = -1;
354 static int hf_gtp_gsn_address_length = -1;
355 static int hf_gtp_vplmn_address_allowed = -1;
356 static int hf_gtp_uplink_flow_label_signalling = -1;
357 static int hf_gtp_extended_end_user_address = -1;
358 static int hf_gtp_ciphering_key_ck = -1;
359 static int hf_gtp_fqdn_length = -1;
360 static int hf_gtp_seq_num_released = -1;
361 static int hf_gtp_seq_num_canceled = -1;
362 static int hf_gtp_requests_responded = -1;
363 static int hf_gtp_hyphen_separator = -1;
364 static int hf_gtp_ms_network_cap_content_len = -1;
365 static int hf_gtp_iei = -1;
366 static int hf_gtp_iei_mobile_id_len = -1;
367 static int hf_gtp_qos_umts_length = -1;
368 static int hf_gtp_num_ext_hdr_types = -1;
369 static int hf_gtp_ext_hdr_type = -1;
370 static int hf_gtp_tpdu_data = -1;
372 /* Initialize the subtree pointers */
373 static gint ett_gtp = -1;
374 static gint ett_gtp_flags = -1;
375 static gint ett_gtp_ext = -1;
376 static gint ett_gtp_ext_hdr = -1;
377 static gint ett_gtp_qos = -1;
378 static gint ett_gtp_qos_arp = -1;
379 static gint ett_gtp_flow_ii = -1;
380 static gint ett_gtp_rp = -1;
381 static gint ett_gtp_pkt_flow_id = -1;
382 static gint ett_gtp_trip = -1;
383 static gint ett_gtp_quint = -1;
384 static gint ett_gtp_proto = -1;
385 static gint ett_gtp_gsn_addr = -1;
386 static gint ett_gtp_tft = -1;
387 static gint ett_gtp_rab_setup = -1;
388 static gint ett_gtp_hdr_list = -1;
389 static gint ett_gtp_node_addr = -1;
390 static gint ett_gtp_rel_pack = -1;
391 static gint ett_gtp_can_pack = -1;
392 static gint ett_gtp_data_resp = -1;
393 static gint ett_gtp_drx = -1;
394 static gint ett_gtp_net_cap = -1;
395 static gint ett_gtp_tmgi = -1;
396 static gint ett_gtp_cdr_ver = -1;
397 static gint ett_gtp_cdr_dr = -1;
398 static gint ett_gtp_mm_cntxt = -1;
399 static gint ett_gtp_utran_cont = -1;
401 static expert_field ei_gtp_ext_hdr_pdcpsn = EI_INIT;
402 static expert_field ei_gtp_ext_length_mal = EI_INIT;
403 static expert_field ei_gtp_ext_length_warn = EI_INIT;
404 static expert_field ei_gtp_undecoded = EI_INIT;
405 static expert_field ei_gtp_message_not_found = EI_INIT;
406 static expert_field ei_gtp_field_not_present = EI_INIT;
407 static expert_field ei_gtp_wrong_next_field = EI_INIT;
408 static expert_field ei_gtp_field_not_support_in_version = EI_INIT;
409 static expert_field ei_gtp_guaranteed_bit_rate_value = EI_INIT;
410 static expert_field ei_gtp_max_bit_rate_value = EI_INIT;
411 static expert_field ei_gtp_ext_geo_loc_type = EI_INIT;
412 static expert_field ei_gtp_iei = EI_INIT;
413 static expert_field ei_gtp_unknown_extention_header = EI_INIT;
415 static gboolean g_gtp_etsi_order = FALSE;
417 static gint dissect_tpdu_as = GTP_TPDU_AS_TPDU;
418 static const enum_val_t gtp_decode_tpdu_as[] = {
419 {"none", "None", GTP_TPDU_AS_NONE},
420 {"tpdu", "TPDU", GTP_TPDU_AS_TPDU},
421 {"sync", "SYNC", GTP_TPDU_AS_SYNC},
426 static int gtp_tap = -1;
427 static int gtpv1_tap = -1;
429 /* Definition of flags masks */
430 #define GTP_VER_MASK 0xE0
432 static const true_false_string gtp_hdr_length_vals = {
437 static const value_string ver_types[] = {
438 {0, "GTP release 97/98 version"},
439 {1, "GTP release 99 version"},
449 static const value_string pt_types[] = {
455 #define GTP_PT_MASK 0x10
456 #define GTP_SPARE1_MASK 0x0E
457 #define GTP_SPARE2_MASK 0x08
458 #define GTP_E_MASK 0x04
459 #define GTP_S_MASK 0x02
460 #define GTP_SNN_MASK 0x01
461 #define GTP_PN_MASK 0x01
463 #define GTP_EXT_HDR_NO_MORE_EXT_HDRS 0x00
464 #define GTP_EXT_HDR_MBMS_SUPPORT_IND 0x01
465 #define GTP_EXT_HDR_MS_INFO_CHG_REP_SUPP_IND 0x02
466 #define GTP_EXT_HDR_UDP_PORT 0x40
467 #define GTP_EXT_HDR_RAN_CONT 0x81
468 #define GTP_EXT_HDR_LONG_PDCP_PDU 0x82
469 #define GTP_EXT_HDR_XW_RAN_CONT 0x83
470 #define GTP_EXT_HDR_NR_RAN_CONT 0x84
471 #define GTP_EXT_HDR_PDU_SESSION_CONT 0x85
472 #define GTP_EXT_HDR_PDCP_SN 0xC0
473 #define GTP_EXT_HDR_SUSPEND_REQ 0xC1
474 #define GTP_EXT_HDR_SUSPEND_RESP 0xC2
476 static const value_string next_extension_header_fieldvals[] = {
477 {GTP_EXT_HDR_NO_MORE_EXT_HDRS, "No more extension headers"},
478 {GTP_EXT_HDR_MBMS_SUPPORT_IND, "MBMS support indication"},
479 {GTP_EXT_HDR_MS_INFO_CHG_REP_SUPP_IND, "MS Info Change Reporting support indication"},
480 {GTP_EXT_HDR_UDP_PORT, "UDP Port number"},
481 {GTP_EXT_HDR_RAN_CONT,"RAN container"},
482 {GTP_EXT_HDR_LONG_PDCP_PDU,"Long PDCP PDU number"},
483 {GTP_EXT_HDR_XW_RAN_CONT,"Xw RAN container"},
484 {GTP_EXT_HDR_NR_RAN_CONT,"NR RAN container"},
485 {GTP_EXT_HDR_PDU_SESSION_CONT,"PDU Session container"},
486 {GTP_EXT_HDR_PDCP_SN, "PDCP PDU number"},
487 {GTP_EXT_HDR_SUSPEND_REQ, "Suspend Request"},
488 {GTP_EXT_HDR_SUSPEND_RESP, "Suspend Response"},
492 /* Definition of 3G charging characteristics masks */
493 #define GTP_MASK_CHRG_CHAR_S 0xF000
494 #define GTP_MASK_CHRG_CHAR_N 0x0800
495 #define GTP_MASK_CHRG_CHAR_P 0x0400
496 #define GTP_MASK_CHRG_CHAR_F 0x0200
497 #define GTP_MASK_CHRG_CHAR_H 0x0100
498 #define GTP_MASK_CHRG_CHAR_R 0x00FF
500 /* Definition of GSN Address masks */
501 #define GTP_EXT_GSN_ADDR_TYPE_MASK 0xC0
502 #define GTP_EXT_GSN_ADDR_LEN_MASK 0x3F
504 /* Definition of QoS masks */
505 #define GTP_EXT_QOS_SPARE1_MASK 0xC0
506 #define GTP_EXT_QOS_DELAY_MASK 0x38
507 #define GTP_EXT_QOS_RELIABILITY_MASK 0x07
508 #define GTP_EXT_QOS_PEAK_MASK 0xF0
509 #define GTP_EXT_QOS_SPARE2_MASK 0x08
510 #define GTP_EXT_QOS_PRECEDENCE_MASK 0x07
511 #define GTP_EXT_QOS_SPARE3_MASK 0xE0
512 #define GTP_EXT_QOS_MEAN_MASK 0x1F
513 #define GTP_EXT_QOS_TRAF_CLASS_MASK 0xE0
514 #define GTP_EXT_QOS_DEL_ORDER_MASK 0x18
515 #define GTP_EXT_QOS_DEL_ERR_SDU_MASK 0x07
516 #define GTP_EXT_QOS_RES_BER_MASK 0xF0
517 #define GTP_EXT_QOS_SDU_ERR_RATIO_MASK 0x0F
518 #define GTP_EXT_QOS_TRANS_DELAY_MASK 0xFC
519 #define GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK 0x03
520 #define GTP_EXT_QOS_SPARE4_MASK 0xE0
521 #define GTP_EXT_QOS_SIG_IND_MASK 0x10
522 #define GTP_EXT_QOS_SRC_STAT_DESC_MASK 0x0F
524 /* Definition of Radio Priority's masks */
525 #define GTPv1_EXT_RP_NSAPI_MASK 0xF0
526 #define GTPv1_EXT_RP_SPARE_MASK 0x08
527 #define GTPv1_EXT_RP_MASK 0x07
529 static const value_string gtp_message_type[] = {
530 {GTP_MSG_UNKNOWN, "For future use"},
531 {GTP_MSG_ECHO_REQ, "Echo request"},
532 {GTP_MSG_ECHO_RESP, "Echo response"},
533 {GTP_MSG_VER_NOT_SUPP, "Version not supported"},
534 {GTP_MSG_NODE_ALIVE_REQ, "Node alive request"},
535 {GTP_MSG_NODE_ALIVE_RESP, "Node alive response"},
536 {GTP_MSG_REDIR_REQ, "Redirection request"},
537 {GTP_MSG_REDIR_RESP, "Redirection response"},
539 * 8-15 For future use. Shall not be sent. If received,
540 * shall be treated as an Unknown message.
543 { 8, "Unknown message(For future use)"},
544 { 9, "Unknown message(For future use)"},
545 { 10, "Unknown message(For future use)"},
546 { 11, "Unknown message(For future use)"},
547 { 12, "Unknown message(For future use)"},
548 { 13, "Unknown message(For future use)"},
549 { 14, "Unknown message(For future use)"},
550 { 15, "Unknown message(For future use)"},
552 {GTP_MSG_CREATE_PDP_REQ, "Create PDP context request"},
553 {GTP_MSG_CREATE_PDP_RESP, "Create PDP context response"},
554 {GTP_MSG_UPDATE_PDP_REQ, "Update PDP context request"},
555 {GTP_MSG_UPDATE_PDP_RESP, "Update PDP context response"},
556 {GTP_MSG_DELETE_PDP_REQ, "Delete PDP context request"},
557 {GTP_MSG_DELETE_PDP_RESP, "Delete PDP context response"},
558 {GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ, "Initiate PDP Context Activation Request"},
559 {GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP, "Initiate PDP Context Activation Response"},
561 * 24-25 For future use. Shall not be sent. If received,
562 * shall be treated as an Unknown message.
564 {GTP_MSG_DELETE_AA_PDP_REQ, "Delete AA PDP Context Request"},
565 {GTP_MSG_DELETE_AA_PDP_RESP, "Delete AA PDP Context Response"},
566 {GTP_MSG_ERR_IND, "Error indication"},
567 {GTP_MSG_PDU_NOTIFY_REQ, "PDU notification request"},
568 {GTP_MSG_PDU_NOTIFY_RESP, "PDU notification response"},
569 {GTP_MSG_PDU_NOTIFY_REJ_REQ, "PDU notification reject request"},
570 {GTP_MSG_PDU_NOTIFY_REJ_RESP, "PDU notification reject response"},
571 {GTP_MSG_SUPP_EXT_HDR, "Supported extension header notification"},
572 {GTP_MSG_SEND_ROUT_INFO_REQ, "Send routing information for GPRS request"},
573 {GTP_MSG_SEND_ROUT_INFO_RESP, "Send routing information for GPRS response"},
574 {GTP_MSG_FAIL_REP_REQ, "Failure report request"},
575 {GTP_MSG_FAIL_REP_RESP, "Failure report response"},
576 {GTP_MSG_MS_PRESENT_REQ, "Note MS GPRS present request"},
577 {GTP_MSG_MS_PRESENT_RESP, "Note MS GPRS present response"},
578 /* 38-47 For future use. Shall not be sent. If received,
579 * shall be treated as an Unknown message.
582 { 38, "Unknown message(For future use)"},
583 { 39, "Unknown message(For future use)"},
584 { 40, "Unknown message(For future use)"},
585 { 41, "Unknown message(For future use)"},
586 { 42, "Unknown message(For future use)"},
587 { 43, "Unknown message(For future use)"},
588 { 44, "Unknown message(For future use)"},
589 { 45, "Unknown message(For future use)"},
590 { 46, "Unknown message(For future use)"},
591 { 47, "Unknown message(For future use)"},
593 {GTP_MSG_IDENT_REQ, "Identification request"},
594 {GTP_MSG_IDENT_RESP, "Identification response"},
595 {GTP_MSG_SGSN_CNTXT_REQ, "SGSN context request"},
596 {GTP_MSG_SGSN_CNTXT_RESP, "SGSN context response"},
597 {GTP_MSG_SGSN_CNTXT_ACK, "SGSN context acknowledgement"},
598 {GTP_MSG_FORW_RELOC_REQ, "Forward relocation request"},
599 {GTP_MSG_FORW_RELOC_RESP, "Forward relocation response"},
600 {GTP_MSG_FORW_RELOC_COMP, "Forward relocation complete"},
601 {GTP_MSG_RELOC_CANCEL_REQ, "Relocation cancel request"},
602 {GTP_MSG_RELOC_CANCEL_RESP, "Relocation cancel response"},
603 {GTP_MSG_FORW_SRNS_CNTXT, "Forward SRNS context"},
604 {GTP_MSG_FORW_RELOC_ACK, "Forward relocation complete acknowledge"},
605 {GTP_MSG_FORW_SRNS_CNTXT_ACK, "Forward SRNS context acknowledge"},
606 /* 61-69 For future use. Shall not be sent. If received,
607 * shall be treated as an Unknown message.
610 { 61, "Unknown message(For future use)"},
611 { 62, "Unknown message(For future use)"},
612 { 63, "Unknown message(For future use)"},
613 { 64, "Unknown message(For future use)"},
614 { 65, "Unknown message(For future use)"},
615 { 66, "Unknown message(For future use)"},
616 { 67, "Unknown message(For future use)"},
617 { 68, "Unknown message(For future use)"},
618 { 69, "Unknown message(For future use)"},
620 {GTP_MSG_RAN_INFO_RELAY, "RAN Information Relay"},
621 /* 71-95 For future use. Shall not be sent. If received,
622 * shall be treated as an Unknown message.
625 { 71, "Unknown message(For future use)"},
626 { 72, "Unknown message(For future use)"},
627 { 73, "Unknown message(For future use)"},
628 { 74, "Unknown message(For future use)"},
629 { 75, "Unknown message(For future use)"},
630 { 76, "Unknown message(For future use)"},
631 { 77, "Unknown message(For future use)"},
632 { 78, "Unknown message(For future use)"},
633 { 79, "Unknown message(For future use)"},
634 { 80, "Unknown message(For future use)"},
635 { 81, "Unknown message(For future use)"},
636 { 82, "Unknown message(For future use)"},
637 { 83, "Unknown message(For future use)"},
638 { 84, "Unknown message(For future use)"},
639 { 85, "Unknown message(For future use)"},
640 { 86, "Unknown message(For future use)"},
641 { 87, "Unknown message(For future use)"},
642 { 88, "Unknown message(For future use)"},
643 { 89, "Unknown message(For future use)"},
644 { 90, "Unknown message(For future use)"},
645 { 91, "Unknown message(For future use)"},
646 { 92, "Unknown message(For future use)"},
647 { 93, "Unknown message(For future use)"},
648 { 94, "Unknown message(For future use)"},
649 { 95, "Unknown message(For future use)"},
651 {GTP_MBMS_NOTIFY_REQ, "MBMS Notification Request"},
652 {GTP_MBMS_NOTIFY_RES, "MBMS Notification Response"},
653 {GTP_MBMS_NOTIFY_REJ_REQ, "MBMS Notification Reject Request"},
654 {GTP_MBMS_NOTIFY_REJ_RES, "MBMS Notification Reject Response"},
655 {GTP_CREATE_MBMS_CNTXT_REQ, "Create MBMS Context Request"},
656 {GTP_CREATE_MBMS_CNTXT_RES, "Create MBMS Context Response"},
657 {GTP_UPD_MBMS_CNTXT_REQ, "Update MBMS Context Request"},
658 {GTP_UPD_MBMS_CNTXT_RES, "Update MBMS Context Response"},
659 {GTP_DEL_MBMS_CNTXT_REQ, "Delete MBMS Context Request"},
660 {GTP_DEL_MBMS_CNTXT_RES, "Delete MBMS Context Response"},
661 /* 106 - 111 For future use. Shall not be sent. If received,
662 * shall be treated as an Unknown message.
665 { 106, "Unknown message(For future use)"},
666 { 107, "Unknown message(For future use)"},
667 { 108, "Unknown message(For future use)"},
668 { 109, "Unknown message(For future use)"},
669 { 110, "Unknown message(For future use)"},
670 { 111, "Unknown message(For future use)"},
672 {GTP_MBMS_REG_REQ, "MBMS Registration Request"},
673 {GTP_MBMS_REG_RES, "MBMS Registration Response"},
674 {GTP_MBMS_DE_REG_REQ, "MBMS De-Registration Request"},
675 {GTP_MBMS_DE_REG_RES, "MBMS De-Registration Response"},
676 {GTP_MBMS_SES_START_REQ, "MBMS Session Start Request"},
677 {GTP_MBMS_SES_START_RES, "MBMS Session Start Response"},
678 {GTP_MBMS_SES_STOP_REQ, "MBMS Session Stop Request"},
679 {GTP_MBMS_SES_STOP_RES, "MBMS Session Stop Response"},
680 {GTP_MBMS_SES_UPD_REQ, "MBMS Session Update Request"},
681 {GTP_MBMS_SES_UPD_RES, "MBMS Session Update Response"},
682 /* 122-127 For future use. Shall not be sent.
683 * If received, shall be treated as an Unknown message.
686 { 122, "Unknown message(For future use)"},
687 { 123, "Unknown message(For future use)"},
688 { 124, "Unknown message(For future use)"},
689 { 125, "Unknown message(For future use)"},
690 { 126, "Unknown message(For future use)"},
691 { 127, "Unknown message(For future use)"},
693 {GTP_MS_INFO_CNG_NOT_REQ, "MS Info Change Notification Request"},
694 {GTP_MS_INFO_CNG_NOT_RES, "MS Info Change Notification Response"},
695 /* 130-239 For future use. Shall not be sent. If received,
696 * shall be treated as an Unknown message.
699 { 130, "Unknown message(For future use)"},
700 { 131, "Unknown message(For future use)"},
701 { 132, "Unknown message(For future use)"},
702 { 133, "Unknown message(For future use)"},
703 { 134, "Unknown message(For future use)"},
704 { 135, "Unknown message(For future use)"},
705 { 136, "Unknown message(For future use)"},
706 { 137, "Unknown message(For future use)"},
707 { 138, "Unknown message(For future use)"},
708 { 139, "Unknown message(For future use)"},
709 { 140, "Unknown message(For future use)"},
710 { 141, "Unknown message(For future use)"},
711 { 142, "Unknown message(For future use)"},
712 { 143, "Unknown message(For future use)"},
713 { 144, "Unknown message(For future use)"},
714 { 145, "Unknown message(For future use)"},
715 { 146, "Unknown message(For future use)"},
716 { 147, "Unknown message(For future use)"},
717 { 148, "Unknown message(For future use)"},
718 { 149, "Unknown message(For future use)"},
719 { 150, "Unknown message(For future use)"},
720 { 151, "Unknown message(For future use)"},
721 { 152, "Unknown message(For future use)"},
722 { 153, "Unknown message(For future use)"},
723 { 154, "Unknown message(For future use)"},
724 { 155, "Unknown message(For future use)"},
725 { 156, "Unknown message(For future use)"},
726 { 157, "Unknown message(For future use)"},
727 { 158, "Unknown message(For future use)"},
728 { 159, "Unknown message(For future use)"},
730 {GTP_MSG_DATA_TRANSF_REQ, "Data record transfer request"},
731 {GTP_MSG_DATA_TRANSF_RESP, "Data record transfer response"},
732 /* 242-253 For future use. Shall not be sent. If received,
733 * shall be treated as an Unknown message.
736 { 242, "Unknown message(For future use)"},
737 { 243, "Unknown message(For future use)"},
738 { 244, "Unknown message(For future use)"},
739 { 245, "Unknown message(For future use)"},
740 { 246, "Unknown message(For future use)"},
741 { 247, "Unknown message(For future use)"},
742 { 248, "Unknown message(For future use)"},
743 { 249, "Unknown message(For future use)"},
744 { 250, "Unknown message(For future use)"},
745 { 251, "Unknown message(For future use)"},
746 { 252, "Unknown message(For future use)"},
747 { 253, "Unknown message(For future use)"},
749 {GTP_MSG_END_MARKER, "End Marker"},
750 {GTP_MSG_TPDU, "T-PDU"},
753 static value_string_ext gtp_message_type_ext = VALUE_STRING_EXT_INIT(gtp_message_type);
755 /* definitions of fields in extension header */
756 #define GTP_EXT_CAUSE 0x01
757 #define GTP_EXT_IMSI 0x02
758 #define GTP_EXT_RAI 0x03
759 #define GTP_EXT_TLLI 0x04
760 #define GTP_EXT_PTMSI 0x05
761 #define GTP_EXT_QOS_GPRS 0x06
762 #define GTP_EXT_REORDER 0x08
763 #define GTP_EXT_AUTH_TRI 0x09
764 #define GTP_EXT_MAP_CAUSE 0x0B
765 #define GTP_EXT_PTMSI_SIG 0x0C
766 #define GTP_EXT_MS_VALID 0x0D
767 #define GTP_EXT_RECOVER 0x0E
768 #define GTP_EXT_SEL_MODE 0x0F
770 #define GTP_EXT_16 0x10
771 #define GTP_EXT_FLOW_LABEL 0x10
772 #define GTP_EXT_TEID 0x10 /* 0xFF10 3G */
774 #define GTP_EXT_17 0x11
775 #define GTP_EXT_FLOW_SIG 0x11
776 #define GTP_EXT_TEID_CP 0x11 /* 0xFF11 3G */
778 #define GTP_EXT_18 0x12
779 #define GTP_EXT_FLOW_II 0x12
780 #define GTP_EXT_TEID_II 0x12 /* 0xFF12 3G */
782 #define GTP_EXT_19 0x13 /* 19 TV Teardown Ind 7.7.16 */
783 #define GTP_EXT_MS_REASON 0x13 /* same as 0x1D GTPv1_EXT_MS_REASON */
784 #define GTP_EXT_TEAR_IND 0x13 /* 0xFF13 3G */
786 #define GTP_EXT_NSAPI 0x14 /* 3G */
787 #define GTP_EXT_RANAP_CAUSE 0x15 /* 3G */
788 #define GTP_EXT_RAB_CNTXT 0x16 /* 3G */
789 #define GTP_EXT_RP_SMS 0x17 /* 3G */
790 #define GTP_EXT_RP 0x18 /* 3G */
791 #define GTP_EXT_PKT_FLOW_ID 0x19 /* 3G */
792 #define GTP_EXT_CHRG_CHAR 0x1A /* 3G */
793 #define GTP_EXT_TRACE_REF 0x1B /* 3G */
794 #define GTP_EXT_TRACE_TYPE 0x1C /* 3G */
795 #define GTPv1_EXT_MS_REASON 0x1D /* 3G 29 TV MS Not Reachable Reason 7.7.25A */
796 /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
797 #define GTP_EXT_TR_COMM 0x7E /* charging */
798 #define GTP_EXT_CHRG_ID 0x7F /* 127 TV Charging ID 7.7.26 */
799 #define GTP_EXT_USER_ADDR 0x80
800 #define GTP_EXT_MM_CNTXT 0x81
801 #define GTP_EXT_PDP_CNTXT 0x82
802 #define GTP_EXT_APN 0x83
803 #define GTP_EXT_PROTO_CONF 0x84
804 #define GTP_EXT_GSN_ADDR 0x85
805 #define GTP_EXT_MSISDN 0x86
806 #define GTP_EXT_QOS_UMTS 0x87 /* 3G */
807 #define GTP_EXT_AUTH_QUI 0x88 /* 3G */
808 #define GTP_EXT_TFT 0x89 /* 3G */
809 #define GTP_EXT_TARGET_ID 0x8A /* 3G */
810 #define GTP_EXT_UTRAN_CONT 0x8B /* 3G */
811 #define GTP_EXT_RAB_SETUP 0x8C /* 3G */
812 #define GTP_EXT_HDR_LIST 0x8D /* 3G */
813 #define GTP_EXT_TRIGGER_ID 0x8E /* 3G 142 7.7.41 */
814 #define GTP_EXT_OMC_ID 0x8F /* 3G 143 TLV OMC Identity 7.7.42 */
815 #define GTP_EXT_RAN_TR_CONT 0x90 /* 3G 144 TLV RAN Transparent Container 7.7.43 */
816 #define GTP_EXT_PDP_CONT_PRIO 0x91 /* 3G 145 TLV PDP Context Prioritization 7.7.45 */
817 #define GTP_EXT_ADD_RAB_SETUP_INF 0x92 /* 3G 146 TLV Additional RAB Setup Information 7.7.45A */
818 #define GTP_EXT_SSGN_NO 0x93 /* 3G 147 TLV SGSN Number 7.7.47 */
819 #define GTP_EXT_COMMON_FLGS 0x94 /* 3G 148 TLV Common Flags 7.7.48 */
820 #define GTP_EXT_APN_RES 0x95 /* 3G 149 */
821 #define GTP_EXT_RA_PRIO_LCS 0x96 /* 3G 150 TLV Radio Priority LCS 7.7.25B */
822 #define GTP_EXT_RAT_TYPE 0x97 /* 3G 151 TLV RAT Type 7.7.50 */
823 #define GTP_EXT_USR_LOC_INF 0x98 /* 3G 152 TLV User Location Information 7.7.51 */
824 #define GTP_EXT_MS_TIME_ZONE 0x99 /* 3G 153 TLV MS Time Zone 7.7.52 */
825 #define GTP_EXT_IMEISV 0x9A /* 3G 154 TLV IMEI(SV) 7.7.53 */
826 #define GTP_EXT_CAMEL_CHG_INF_CON 0x9B /* 3G 155 TLV CAMEL Charging Information Container 7.7.54 */
827 #define GTP_EXT_MBMS_UE_CTX 0x9C /* 3G 156 TLV MBMS UE Context 7.7.55 */
828 #define GTP_EXT_TMGI 0x9D /* 3G 157 TLV Temporary Mobile Group Identity (TMGI) 7.7.56 */
829 #define GTP_EXT_RIM_RA 0x9E /* 3G 158 TLV RIM Routing Address 7.7.57 */
830 #define GTP_EXT_MBMS_PROT_CONF_OPT 0x9F /* 3G 159 TLV MBMS Protocol Configuration Options 7.7.58 */
831 #define GTP_EXT_MBMS_SA 0xA0 /* 3G 160 TLV MBMS Service Area 7.7.60 */
832 #define GTP_EXT_SRC_RNC_PDP_CTX_INF 0xA1 /* 3G 161 TLV Source RNC PDCP context info 7.7.61 */
833 #define GTP_EXT_ADD_TRS_INF 0xA2 /* 3G 162 TLV Additional Trace Info 7.7.62 */
834 #define GTP_EXT_HOP_COUNT 0xA3 /* 3G 163 TLV Hop Counter 7.7.63 */
835 #define GTP_EXT_SEL_PLMN_ID 0xA4 /* 3G 164 TLV Selected PLMN ID 7.7.64 */
836 #define GTP_EXT_MBMS_SES_ID 0xA5 /* 3G 165 TLV MBMS Session Identifier 7.7.65 */
837 #define GTP_EXT_MBMS_2G_3G_IND 0xA6 /* 3G 166 TLV MBMS 2G/3G Indicator 7.7.66 */
838 #define GTP_EXT_ENH_NSAPI 0xA7 /* 3G 167 TLV Enhanced NSAPI 7.7.67 */
839 #define GTP_EXT_MBMS_SES_DUR 0xA8 /* 3G 168 TLV MBMS Session Duration 7.7.59 */
840 #define GTP_EXT_ADD_MBMS_TRS_INF 0xA9 /* 3G 169 TLV Additional MBMS Trace Info 7.7.68 */
841 #define GTP_EXT_MBMS_SES_ID_REP_NO 0xAA /* 3G 170 TLV MBMS Session Identity Repetition Number 7.7.69 */
842 #define GTP_EXT_MBMS_TIME_TO_DATA_TR 0xAB /* 3G 171 TLV MBMS Time To Data Transfer 7.7.70 */
843 #define GTP_EXT_PS_HO_REQ_CTX 0xAC /* 3G 172 TLV PS Handover Request Context 7.7.71 */
844 #define GTP_EXT_BSS_CONT 0xAD /* 3G 173 TLV BSS Container 7.7.72 */
845 #define GTP_EXT_CELL_ID 0xAE /* 3G 174 TLV Cell Identification 7.7.73 */
846 #define GTP_EXT_PDU_NO 0xAF /* 3G 175 TLV PDU Numbers 7.7.74 */
847 #define GTP_EXT_BSSGP_CAUSE 0xB0 /* 3G 176 TLV BSSGP Cause 7.7.75 */
848 #define GTP_EXT_REQ_MBMS_BEARER_CAP 0xB1 /* 3G 177 TLV Required MBMS bearer capabilities 7.7.76 */
849 #define GTP_EXT_RIM_ROUTING_ADDR_DISC 0xB2 /* 3G 178 TLV RIM Routing Address Discriminator 7.7.77 */
850 #define GTP_EXT_LIST_OF_SETUP_PFCS 0xB3 /* 3G 179 TLV List of set-up PFCs 7.7.78 */
851 #define GTP_EXT_PS_HANDOVER_XIP_PAR 0xB4 /* 3G 180 TLV PS Handover XID Parameters 7.7.79 */
852 #define GTP_EXT_MS_INF_CHG_REP_ACT 0xB5 /* 3G 181 TLV MS Info Change Reporting Action 7.7.80 */
853 #define GTP_EXT_DIRECT_TUNNEL_FLGS 0xB6 /* 3G 182 TLV Direct Tunnel Flags 7.7.81 */
854 #define GTP_EXT_CORRELATION_ID 0xB7 /* 3G 183 TLV Correlation-ID 7.7.82 */
855 #define GTP_EXT_BEARER_CONTROL_MODE 0xB8 /* 3G 184 TLV Bearer Control Mode 7.7.83 */
856 #define GTP_EXT_MBMS_FLOW_ID 0xB9 /* 3G 185 TLV MBMS Flow Identifier 7.7.84 */
857 #define GTP_EXT_MBMS_IP_MCAST_DIST 0xBA /* 3G 186 TLV MBMS IP Multicast Distribution 7.7.85 */
858 #define GTP_EXT_MBMS_DIST_ACK 0xBB /* 3G 187 TLV MBMS Distribution Acknowledgement 7.7.86 */
859 #define GTP_EXT_RELIABLE_IRAT_HO_INF 0xBC /* 3G 188 TLV Reliable INTER RAT HANDOVER INFO 7.7.87 */
860 #define GTP_EXT_RFSP_INDEX 0xBD /* 3G 189 TLV RFSP Index 7.7.88 */
861 #define GTP_EXT_FQDN 0xBE /* 3G 190 TLV Fully Qualified Domain Name (FQDN) 7.7.90 */
862 #define GTP_EXT_EVO_ALLO_RETE_P1 0xBF /* 3G 191 TLV Evolved Allocation/Retention Priority I 7.7.91 */
863 #define GTP_EXT_EVO_ALLO_RETE_P2 0xC0 /* 3G 192 TLV Evolved Allocation/Retention Priority II 7.7.92 */
864 #define GTP_EXT_EXTENDED_COMMON_FLGS 0xC1 /* 3G 193 TLV Extended Common Flags 7.7.93 */
865 #define GTP_EXT_UCI 0xC2 /* 3G 194 TLV User CSG Information (UCI) 7.7.94 */
866 #define GTP_EXT_CSG_INF_REP_ACT 0xC3 /* 3G 195 TLV CSG Information Reporting Action 7.7.95 */
867 #define GTP_EXT_CSG_ID 0xC4 /* 3G 196 TLV CSG ID 7.7.96 */
868 #define GTP_EXT_CMI 0xC5 /* 3G 197 TLV CSG Membership Indication (CMI) 7.7.97 */
869 #define GTP_EXT_AMBR 0xC6 /* 3G 198 TLV Aggregate Maximum Bit Rate (AMBR) 7.7.98 */
870 #define GTP_EXT_UE_NETWORK_CAP 0xC7 /* 3G 199 TLV UE Network Capability 7.7.99 */
871 #define GTP_EXT_UE_AMBR 0xC8 /* 3G 200 TLV UE-AMBR 7.7.100 */
872 #define GTP_EXT_APN_AMBR_WITH_NSAPI 0xC9 /* 3G 201 TLV APN-AMBR with NSAPI 7.7.101 */
873 #define GTP_EXT_GGSN_BACK_OFF_TIME 0xCA /* 3G 202 TLV GGSN Back-Off Time 7.7.102 */
874 #define GTP_EXT_SIG_PRI_IND 0xCB /* 3G 203 TLV Signalling Priority Indication 7.7.103 */
875 #define GTP_EXT_SIG_PRI_IND_W_NSAPI 0xCC /* 3G 204 TLV Signalling Priority Indication with NSAPI 7.7.104 */
876 #define GTP_EXT_HIGHER_BR_16MB_FLG 0xCD /* 3G 205 TLV Higher bitrates than 16 Mbps flag 7.7.105 */
877 #define GTP_EXT_MAX_MBR_APN_AMBR 0xCE /* 3G 206 TLV Max MBR/APN-AMBR 7.7.106 */
878 #define GTP_EXT_ADD_MM_CTX_SRVCC 0xCF /* 3G 207 TLV Additional MM context for SRVCC 7.7.107 */
879 #define GTP_EXT_ADD_FLGS_SRVCC 0xD0 /* 3G 208 TLV Additional flags for SRVCC 7.7.108 */
880 #define GTP_EXT_STN_SR 0xD1 /* 3G 209 TLV STN-SR 7.7.109 */
881 #define GTP_EXT_C_MSISDN 0xD2 /* 3G 210 TLV C-MSISDN 7.7.110 */
882 #define GTP_EXT_EXT_RANAP_CAUSE 0xD3 /* 3G 211 TLV Extended RANAP Cause 7.7.111 */
883 #define GTP_EXT_ENODEB_ID 0xD4 /* 3G 212 TLV eNodeB ID 7.7.112 */
884 #define GTP_EXT_SEL_MODE_W_NSAPI 0xD5 /* 3G 213 TLV Selection Mode with NSAPI 7.7.113 */
885 #define GTP_EXT_ULI_TIMESTAMP 0xD6 /* 3G 214 TLV ULI Timestamp 7.7.114 */
886 #define GTP_EXT_LHN_ID_W_SAPI 0xD7 /* 3G 215 TLV Local Home Network ID (LHN-ID) with NSAPI 7.7.115 */
887 #define GTP_EXT_CN_OP_SEL_ENTITY 0xD8 /* 3G 216 TLV CN Operator Selection Entity 7.7.116 */
888 #define GTP_EXT_UE_USAGE_TYPE 0xD9 /* 3G 217 TLV UE Usage Type 7.7.117 */
889 #define GTP_EXT_EXT_COMMON_FLGS_II 0xDA /* 3G 218 TLV Extended Common Flags II 7.7.118 */
890 #define GTP_EXT_NODE_IDENTIFIER 0xDB /* 3G 219 TLV Node Identifier 7.7.119 */
891 #define GTP_EXT_CIOT_OPT_SUP_IND 0xDC /* 3G 220 TLV CIoT Optimizations Support Indication 7.7.120 */
892 #define GTP_EXT_SCEF_PDN_CONNECTION 0xDD /* 3G 221 TLV SCEF PDN Connection 7.7.121 */
895 /* 222-238 TLV Spare. For future use. */
897 /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33])*/
899 #define GTP_EXT_C1 0xC1
900 #define GTP_EXT_C2 0xC2
901 #define GTP_EXT_REL_PACK 0xF9 /* charging */
902 #define GTP_EXT_CAN_PACK 0xFA /* charging */
903 #define GTP_EXT_CHRG_ADDR 0xFB /* 3G 251 TLV Charging Gateway Address 7.7.44 */
904 /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33])*/
905 #define GTP_EXT_DATA_REQ 0xFC /* charging */
906 #define GTP_EXT_DATA_RESP 0xFD /* charging */
907 #define GTP_EXT_NODE_ADDR 0xFE /* charging */
908 #define GTP_EXT_PRIV_EXT 0xFF
910 static const value_string gtp_val[] = {
911 {GTP_EXT_CAUSE, "Cause of operation"},
912 {GTP_EXT_IMSI, "IMSI"},
913 {GTP_EXT_RAI, "Routing Area Identity"},
914 {GTP_EXT_TLLI, "Temporary Logical Link Identity"},
915 {GTP_EXT_PTMSI, "Packet TMSI"},
916 /* 6 */ {GTP_EXT_QOS_GPRS, "Quality of Service"},
918 /* 8 */ {GTP_EXT_REORDER, "Reorder required"},
919 /* 9 */ {GTP_EXT_AUTH_TRI, "Authentication triplets"},
921 /* 11 */ {GTP_EXT_MAP_CAUSE, "MAP cause"},
922 /* 12 */ {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
923 /* 13 */ {GTP_EXT_MS_VALID, "MS validated"},
924 /* 14 */ {GTP_EXT_RECOVER, "Recovery"},
925 /* 15 */ {GTP_EXT_SEL_MODE, "Selection mode"},
927 /* 16 */ {GTP_EXT_16, "Flow label data I"},
928 /* 16 */ /* ??? {GTP_EXT_FLOW_LABEL, "Flow label data I"}, */
929 /* 16 */ /* ??? {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"}, */ /* 3G */
931 {GTP_EXT_17, "Flow label signalling"},
932 /* ??? {GTP_EXT_FLOW_SIG, "Flow label signalling"}, */
933 /* ??? {GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane"}, */ /* 3G */
935 {GTP_EXT_18, "Flow label data II"},
936 /* ??? {GTP_EXT_FLOW_II, "Flow label data II"}, */
937 /* ??? {GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II"}, */ /* 3G */
939 {GTP_EXT_19, "MS not reachable reason"},
940 /* ??? {GTP_EXT_MS_REASON, "MS not reachable reason"}, */
941 /* ??? {GTP_EXT_TEAR_IND, "Teardown ID"}, */ /* 3G */
943 {GTP_EXT_NSAPI, "NSAPI"}, /* 3G */
944 {GTP_EXT_RANAP_CAUSE, "RANAP cause"}, /* 3G */
945 {GTP_EXT_RAB_CNTXT, "RAB context"}, /* 3G */
946 {GTP_EXT_RP_SMS, "Radio Priority for MO SMS"}, /* 3G */
947 {GTP_EXT_RP, "Radio Priority"}, /* 3G */
948 {GTP_EXT_PKT_FLOW_ID, "Packet Flow ID"}, /* 3G */
949 {GTP_EXT_CHRG_CHAR, "Charging characteristics"}, /* 3G */
950 {GTP_EXT_TRACE_REF, "Trace references"}, /* 3G */
951 {GTP_EXT_TRACE_TYPE, "Trace type"}, /* 3G */
952 /* 29 */ {GTPv1_EXT_MS_REASON, "MS not reachable reason"}, /* 3G */
953 /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
954 /* 126 */ {GTP_EXT_TR_COMM, "Packet transfer command"}, /* charging */
955 /* 127 */ {GTP_EXT_CHRG_ID, "Charging ID"},
956 {GTP_EXT_USER_ADDR, "End user address"},
957 {GTP_EXT_MM_CNTXT, "MM context"},
958 {GTP_EXT_PDP_CNTXT, "PDP context"},
959 {GTP_EXT_APN, "Access Point Name"},
960 {GTP_EXT_PROTO_CONF, "Protocol configuration options"},
961 {GTP_EXT_GSN_ADDR, "GSN address"},
962 {GTP_EXT_MSISDN, "MS international PSTN/ISDN number"},
963 {GTP_EXT_QOS_UMTS, "Quality of service (UMTS)"}, /* 3G */
964 {GTP_EXT_AUTH_QUI, "Authentication quintuplets"}, /* 3G */
965 {GTP_EXT_TFT, "Traffic Flow Template (TFT)"}, /* 3G */
966 {GTP_EXT_TARGET_ID, "Target (RNC) identification"}, /* 3G */
967 {GTP_EXT_UTRAN_CONT, "UTRAN transparent field"}, /* 3G */
968 {GTP_EXT_RAB_SETUP, "RAB setup information"}, /* 3G */
969 {GTP_EXT_HDR_LIST, "Extension Header Types List"}, /* 3G */
970 {GTP_EXT_TRIGGER_ID, "Trigger Id"}, /* 3G */
971 {GTP_EXT_OMC_ID, "OMC Identity"}, /* 3G */
973 {GTP_EXT_RAN_TR_CONT, "RAN Transparent Container"}, /* 7.7.43 */
974 {GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization"}, /* 7.7.45 */
975 {GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information"}, /* 7.7.45A */
976 {GTP_EXT_SSGN_NO, "SGSN Number"}, /* 7.7.47 */
977 {GTP_EXT_COMMON_FLGS, "Common Flags"}, /* 7.7.48 */
978 {GTP_EXT_APN_RES, "APN Restriction"}, /* 3G */
979 {GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS"}, /* 7.7.25B */
980 {GTP_EXT_RAT_TYPE, "RAT Type"}, /* 3G */
981 {GTP_EXT_USR_LOC_INF, "User Location Information"}, /* 7.7.51 */
982 {GTP_EXT_MS_TIME_ZONE, "MS Time Zone"}, /* 7.7.52 */
984 {GTP_EXT_IMEISV, "IMEI(SV)"}, /* 3G */
985 {GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container"}, /* 7.7.54 */
986 {GTP_EXT_MBMS_UE_CTX, "MBMS UE Context"}, /* 7.7.55 */
987 {GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)"}, /* 7.7.56 */
988 {GTP_EXT_RIM_RA, "RIM Routing Address"}, /* 7.7.57 */
989 {GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options"}, /* 7.7.58 */
990 {GTP_EXT_MBMS_SA, "MBMS Service Area"}, /* 7.7.60 */
991 {GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info"}, /* 7.7.61 */
992 {GTP_EXT_ADD_TRS_INF, "Additional Trace Info"}, /* 7.7.62 */
993 {GTP_EXT_HOP_COUNT, "Hop Counter"}, /* 7.7.63 */
994 {GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID"}, /* 7.7.64 */
995 {GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier"}, /* 7.7.65 */
996 {GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator"}, /* 7.7.66 */
997 {GTP_EXT_ENH_NSAPI, "Enhanced NSAPI"}, /* 7.7.67 */
998 {GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration"}, /* 7.7.59 */
999 {GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info"}, /* 7.7.68 */
1000 {GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number"}, /* 7.7.69 */
1001 {GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer"}, /* 7.7.70 */
1002 {GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context"}, /* 7.7.71 */
1003 {GTP_EXT_BSS_CONT, "BSS Container"}, /* 7.7.72 */
1004 {GTP_EXT_CELL_ID, "Cell Identification"}, /* 7.7.73 */
1005 {GTP_EXT_PDU_NO, "PDU Numbers"}, /* 7.7.74 */
1006 {GTP_EXT_BSSGP_CAUSE, "BSSGP Cause"}, /* 7.7.75 */
1007 {GTP_EXT_REQ_MBMS_BEARER_CAP, "Required MBMS bearer capabilities"}, /* 7.7.76 */
1008 {GTP_EXT_RIM_ROUTING_ADDR_DISC, "RIM Routing Address Discriminator"}, /* 7.7.77 */
1009 {GTP_EXT_LIST_OF_SETUP_PFCS, "List of set-up PFCs"}, /* 7.7.78 */
1010 /* 180 */ {GTP_EXT_PS_HANDOVER_XIP_PAR, " PS Handover XID Parameters"}, /* 7.7.79 */
1011 /* 181 */ {GTP_EXT_MS_INF_CHG_REP_ACT, "MS Info Change Reporting Action"}, /* 7.7.80 */
1012 /* 182 */ {GTP_EXT_DIRECT_TUNNEL_FLGS, "Direct Tunnel Flags"}, /* 7.7.81 */
1013 /* 183 */ {GTP_EXT_CORRELATION_ID, "Correlation-ID"}, /* 7.7.82 */
1014 /* 184 */ {GTP_EXT_BEARER_CONTROL_MODE, "Bearer Control Mode"}, /* 7.7.83 */
1015 /* 185 */ {GTP_EXT_MBMS_FLOW_ID, "MBMS Flow Identifier"}, /* 7.7.84 */
1016 /* 186 */ {GTP_EXT_MBMS_IP_MCAST_DIST, "MBMS IP Multicast Distribution"}, /* 7.7.85 */
1017 /* 187 */ {GTP_EXT_MBMS_DIST_ACK, "MBMS Distribution Acknowledgement"}, /* 7.7.86 */
1018 /* 188 */ {GTP_EXT_RELIABLE_IRAT_HO_INF, "Reliable INTER RAT HANDOVER INFO"}, /* 7.7.87 */
1019 /* 189 */ {GTP_EXT_RFSP_INDEX, "RFSP Index"}, /* 7.7.88 */
1020 /* 190 */ {GTP_EXT_FQDN, "Fully Qualified Domain Name (FQDN)"}, /* 7.7.90 */
1021 /* 191 */ {GTP_EXT_EVO_ALLO_RETE_P1, "Evolved Allocation/Retention Priority I"}, /* 7.7.91 */
1022 /* 192 */ {GTP_EXT_EVO_ALLO_RETE_P2, "Evolved Allocation/Retention Priority II"}, /* 7.7.92 */
1023 /* 193 */ {GTP_EXT_EXTENDED_COMMON_FLGS, "Extended Common Flags"}, /* 7.7.93 */
1024 /* 194 */ {GTP_EXT_UCI, "User CSG Information (UCI)"}, /* 7.7.94 */
1025 /* 195 */ {GTP_EXT_CSG_INF_REP_ACT, "CSG Information Reporting Action"}, /* 7.7.95 */
1026 /* 196 */ {GTP_EXT_CSG_ID, "CSG ID"}, /* 7.7.96 */
1027 /* 197 */ {GTP_EXT_CMI, "CSG Membership Indication (CMI)"}, /* 7.7.97 */
1028 /* 198 */ {GTP_EXT_AMBR, "Aggregate Maximum Bit Rate (AMBR)"}, /* 7.7.98 */
1029 /* 199 */ {GTP_EXT_UE_NETWORK_CAP, "UE Network Capability"}, /* 7.7.99 */
1030 /* 200 */ {GTP_EXT_UE_AMBR, "UE-AMBR"}, /* 7.7.100 */
1031 /* 201 */ {GTP_EXT_APN_AMBR_WITH_NSAPI, "APN-AMBR with NSAPI"}, /* 7.7.101 */
1032 /* 202 */ {GTP_EXT_GGSN_BACK_OFF_TIME, "GGSN Back-Off Time"}, /* 7.7.102 */
1033 /* 203 */ {GTP_EXT_SIG_PRI_IND, "Signalling Priority Indication"}, /* 7.7.103 */
1034 /* 204 */ {GTP_EXT_SIG_PRI_IND_W_NSAPI, "Signalling Priority Indication with NSAPI"}, /* 7.7.104 */
1035 /* 205 */ {GTP_EXT_HIGHER_BR_16MB_FLG, "Higher bitrates than 16 Mbps flag"}, /* 7.7.105 */
1036 /* 206 */ {GTP_EXT_MAX_MBR_APN_AMBR, "Max MBR/APN-AMBR"}, /* 7.7.106 */
1037 /* 207 */ {GTP_EXT_ADD_MM_CTX_SRVCC, "Additional MM context for SRVCC"}, /* 7.7.107 */
1038 /* 208 */ {GTP_EXT_ADD_FLGS_SRVCC, "Additional flags for SRVCC"}, /* 7.7.108 */
1039 /* 209 */ {GTP_EXT_STN_SR, "STN-SR"}, /* 7.7.109 */
1040 /* 210 */ {GTP_EXT_C_MSISDN, "C-MSISDN"}, /* 7.7.110 */
1041 /* 211 */ {GTP_EXT_EXT_RANAP_CAUSE, "Extended RANAP Cause"}, /* 7.7.111 */
1042 /* 212 */ {GTP_EXT_ENODEB_ID, "eNodeB ID" }, /* 7.7.112 */
1043 /* 213 */ {GTP_EXT_SEL_MODE_W_NSAPI, "Selection Mode with NSAPI" }, /* 7.7.113 */
1044 /* 214 */ {GTP_EXT_ULI_TIMESTAMP, "ULI Timestamp" }, /* 7.7.114 */
1045 /* 215 */ {GTP_EXT_LHN_ID_W_SAPI, "Local Home Network ID (LHN-ID) with NSAPI" }, /* 7.7.115 */
1046 /* 216 */ {GTP_EXT_CN_OP_SEL_ENTITY, "Operator Selection Entity" }, /* 7.7.116 */
1047 /* 217 */ {GTP_EXT_UE_USAGE_TYPE, "UE Usage Type" }, /* 7.7.117 */
1048 /* 218 */ {GTP_EXT_EXT_COMMON_FLGS_II, "Extended Common Flags II"}, /* 7.7.118 */
1049 /* 219 */ {GTP_EXT_NODE_IDENTIFIER, "Node Identifier" }, /* 7.7.119 */
1050 /* 220 */ {GTP_EXT_CIOT_OPT_SUP_IND, "CIoT Optimizations Support Indication" }, /* 7.7.120 */
1051 /* 221 */ {GTP_EXT_SCEF_PDN_CONNECTION, "SCEF PDN Connection" }, /* 7.7.121 */
1054 /* 222-238 TLV Spare. For future use. */
1055 /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
1056 /* 249 */ {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"}, /* charging */
1057 /* 250 */ {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"}, /* charging */
1058 /* 251 */ {GTP_EXT_CHRG_ADDR, "Charging Gateway address"}, /* 7.7.44 */
1059 /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
1060 /* 252 */ {GTP_EXT_DATA_REQ, "Data record packet"}, /* charging */
1061 /* 253 */ {GTP_EXT_DATA_RESP, "Requests responded"}, /* charging */
1062 /* 254 */ {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
1063 /* 255 */ {GTP_EXT_PRIV_EXT, "Private Extension"},
1066 static value_string_ext gtp_val_ext = VALUE_STRING_EXT_INIT(gtp_val);
1068 /* It seems like some IE's are renamed in gtpv1 at least reading
1069 * 3GPP TS 29.060 version 6.11.0 Release 6
1071 static const value_string gtpv1_val[] = {
1072 /* 1 */ {GTP_EXT_CAUSE, "Cause of operation"},
1073 /* 2 */ {GTP_EXT_IMSI, "IMSI"},
1074 /* 3 */ {GTP_EXT_RAI, "Routing Area Identity"},
1075 /* 4 */ {GTP_EXT_TLLI, "Temporary Logical Link Identity"},
1076 /* 5 */ {GTP_EXT_PTMSI, "Packet TMSI"},
1077 /* 6 */ {GTP_EXT_QOS_GPRS, "Quality of Service"},
1079 /* 7 */ {7, "Spare"},
1080 /* 8 */ {GTP_EXT_REORDER, "Reorder required"},
1081 /* 9 */ {GTP_EXT_AUTH_TRI, "Authentication triplets"},
1083 /* 10 */ {10, "Spare"},
1084 /* 11 */ {GTP_EXT_MAP_CAUSE, "MAP cause"},
1085 /* 12 */ {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
1086 /* 13 */ {GTP_EXT_MS_VALID, "MS validated"},
1087 /* 14 */ {GTP_EXT_RECOVER, "Recovery"},
1088 /* 15 */ {GTP_EXT_SEL_MODE, "Selection mode"},
1089 /* 16 */ {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"}, /* 3G */
1090 /* 17 */ {GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane"}, /* 3G */
1091 /* 18 */ {GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II"}, /* 3G */
1092 /* 19 */ {GTP_EXT_TEAR_IND, "Teardown ID"}, /* 3G */
1094 /* 20 */ {GTP_EXT_NSAPI, "NSAPI"}, /* 3G */
1095 /* 21 */ {GTP_EXT_RANAP_CAUSE, "RANAP cause"}, /* 3G */
1096 /* 22 */ {GTP_EXT_RAB_CNTXT, "RAB context"}, /* 3G */
1097 /* 23 */ {GTP_EXT_RP_SMS, "Radio Priority for MO SMS"}, /* 3G */
1098 /* 24 */ {GTP_EXT_RP, "Radio Priority"}, /* 3G */
1099 /* 25 */ {GTP_EXT_PKT_FLOW_ID, "Packet Flow ID"}, /* 3G */
1100 /* 26 */ {GTP_EXT_CHRG_CHAR, "Charging characteristics"}, /* 3G */
1101 /* 27 */ {GTP_EXT_TRACE_REF, "Trace references"}, /* 3G */
1102 /* 28 */ {GTP_EXT_TRACE_TYPE, "Trace type"}, /* 3G */
1103 /* 29 */ {GTPv1_EXT_MS_REASON, "MS not reachable reason"}, /* 3G */
1104 /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
1105 /* 126 */ {GTP_EXT_TR_COMM, "Packet transfer command"}, /* charging */
1106 /* 127 */ {GTP_EXT_CHRG_ID, "Charging ID"},
1108 /* 128 */ {GTP_EXT_USER_ADDR, "End user address"},
1109 /* 129 */ {GTP_EXT_MM_CNTXT, "MM context"},
1110 /* 130 */ {GTP_EXT_PDP_CNTXT, "PDP context"},
1111 /* 131 */ {GTP_EXT_APN, "Access Point Name"},
1112 /* 132 */ {GTP_EXT_PROTO_CONF, "Protocol configuration options"},
1113 /* 133 */ {GTP_EXT_GSN_ADDR, "GSN address"},
1114 /* 134 */ {GTP_EXT_MSISDN, "MS international PSTN/ISDN number"},
1115 /* 135 */ {GTP_EXT_QOS_UMTS, "Quality of service (UMTS)"}, /* 3G */
1116 /* 136 */ {GTP_EXT_AUTH_QUI, "Authentication quintuplets"}, /* 3G */
1117 /* 137 */ {GTP_EXT_TFT, "Traffic Flow Template (TFT)"}, /* 3G */
1118 /* 138 */ {GTP_EXT_TARGET_ID, "Target (RNC) identification"}, /* 3G */
1119 /* 139 */ {GTP_EXT_UTRAN_CONT, "UTRAN transparent field"}, /* 3G */
1120 /* 140 */ {GTP_EXT_RAB_SETUP, "RAB setup information"}, /* 3G */
1121 /* 141 */ {GTP_EXT_HDR_LIST, "Extension Header Types List"}, /* 3G */
1122 /* 142 */ {GTP_EXT_TRIGGER_ID, "Trigger Id"}, /* 3G */
1123 /* 143 */ {GTP_EXT_OMC_ID, "OMC Identity"}, /* 3G */
1124 /* 144 */ {GTP_EXT_RAN_TR_CONT, "RAN Transparent Container"}, /* 7.7.43 */
1125 /* 145 */ {GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization"}, /* 7.7.45 */
1126 /* 146 */ {GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information"}, /* 7.7.45A */
1127 /* 147 */ {GTP_EXT_SSGN_NO, "SGSN Number"}, /* 7.7.47 */
1128 /* 148 */ {GTP_EXT_COMMON_FLGS, "Common Flags"}, /* 7.7.48 */
1129 /* 149 */ {GTP_EXT_APN_RES, "APN Restriction"}, /* 3G */
1130 /* 150 */ {GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS"}, /* 7.7.25B */
1131 /* 151 */ {GTP_EXT_RAT_TYPE, "RAT Type"}, /* 3G */
1132 /* 152 */ {GTP_EXT_USR_LOC_INF, "User Location Information"}, /* 7.7.51 */
1133 /* 153 */ {GTP_EXT_MS_TIME_ZONE, "MS Time Zone"}, /* 7.7.52 */
1135 /* 154 */ {GTP_EXT_IMEISV, "IMEI(SV)"}, /* 3G */
1136 /* 155 */ {GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container"}, /* 7.7.54 */
1137 /* 156 */ {GTP_EXT_MBMS_UE_CTX, "MBMS UE Context"}, /* 7.7.55 */
1138 /* 157 */ {GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)"}, /* 7.7.56 */
1139 /* 158 */ {GTP_EXT_RIM_RA, "RIM Routing Address"}, /* 7.7.57 */
1140 /* 159 */ {GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options"}, /* 7.7.58 */
1141 /* 160 */ {GTP_EXT_MBMS_SA, "MBMS Service Area"}, /* 7.7.60 */
1142 /* 161 */ {GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info"}, /* 7.7.61 */
1143 /* 162 */ {GTP_EXT_ADD_TRS_INF, "Additional Trace Info"}, /* 7.7.62 */
1144 /* 163 */ {GTP_EXT_HOP_COUNT, "Hop Counter"}, /* 7.7.63 */
1145 /* 164 */ {GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID"}, /* 7.7.64 */
1146 /* 165 */ {GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier"}, /* 7.7.65 */
1147 /* 166 */ {GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator"}, /* 7.7.66 */
1148 /* 167 */ {GTP_EXT_ENH_NSAPI, "Enhanced NSAPI"}, /* 7.7.67 */
1149 /* 168 */ {GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration"}, /* 7.7.59 */
1150 /* 169 */ {GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info"}, /* 7.7.68 */
1151 /* 170 */ {GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number"}, /* 7.7.69 */
1152 /* 171 */ {GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer"}, /* 7.7.70 */
1153 /* 172 */ {GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context"}, /* 7.7.71 */
1154 /* 173 */ {GTP_EXT_BSS_CONT, "BSS Container"}, /* 7.7.72 */
1155 /* 174 */ {GTP_EXT_CELL_ID, "Cell Identification"}, /* 7.7.73 */
1156 /* 175 */ {GTP_EXT_PDU_NO, "PDU Numbers"}, /* 7.7.74 */
1157 /* 176 */ {GTP_EXT_BSSGP_CAUSE, "BSSGP Cause"}, /* 7.7.75 */
1159 /* 177 */ {GTP_EXT_REQ_MBMS_BEARER_CAP, "Required MBMS bearer capabilities"}, /* 7.7.76 */
1160 /* 178 */ {GTP_EXT_RIM_ROUTING_ADDR_DISC, "RIM Routing Address Discriminator"}, /* 7.7.77 */
1161 /* 179 */ {GTP_EXT_LIST_OF_SETUP_PFCS, "List of set-up PFCs"}, /* 7.7.78 */
1162 /* 180 */ {GTP_EXT_PS_HANDOVER_XIP_PAR, "PS Handover XID Parameters"}, /* 7.7.79 */
1163 /* 181 */ {GTP_EXT_MS_INF_CHG_REP_ACT, "MS Info Change Reporting Action"}, /* 7.7.80 */
1164 /* 182 */ {GTP_EXT_DIRECT_TUNNEL_FLGS, "Direct Tunnel Flags"}, /* 7.7.81 */
1165 /* 183 */ {GTP_EXT_CORRELATION_ID, "Correlation-ID"}, /* 7.7.82 */
1166 /* 184 */ {GTP_EXT_BEARER_CONTROL_MODE, "Bearer Control Mode"}, /* 7.7.83 */
1167 /* 185 */ {GTP_EXT_MBMS_FLOW_ID, "MBMS Flow Identifier"}, /* 7.7.84 */
1168 /* 186 */ {GTP_EXT_MBMS_IP_MCAST_DIST, "MBMS IP Multicast Distribution"}, /* 7.7.85 */
1169 /* 187 */ {GTP_EXT_MBMS_DIST_ACK, "MBMS Distribution Acknowledgement"}, /* 7.7.86 */
1170 /* 188 */ {GTP_EXT_RELIABLE_IRAT_HO_INF, "Reliable INTER RAT HANDOVER INFO"}, /* 7.7.87 */
1171 /* 190 */ {GTP_EXT_RFSP_INDEX, "RFSP Index"}, /* 7.7.88 */
1172 /* 190 */ {GTP_EXT_FQDN, "Fully Qualified Domain Name (FQDN)"}, /* 7.7.90 */
1173 /* 191 */ {GTP_EXT_EVO_ALLO_RETE_P1, "Evolved Allocation/Retention Priority I"}, /* 7.7.91 */
1174 /* 192 */ {GTP_EXT_EVO_ALLO_RETE_P2, "Evolved Allocation/Retention Priority II"}, /* 7.7.92 */
1175 /* 193 */ {GTP_EXT_EXTENDED_COMMON_FLGS, "Extended Common Flags"}, /* 7.7.93 */
1176 /* 194 */ {GTP_EXT_UCI, "User CSG Information (UCI)"}, /* 7.7.94 */
1177 /* 195 */ {GTP_EXT_CSG_INF_REP_ACT, "CSG Information Reporting Action"}, /* 7.7.95 */
1178 /* 196 */ {GTP_EXT_CSG_ID, "CSG ID"}, /* 7.7.96 */
1179 /* 197 */ {GTP_EXT_CMI, "CSG Membership Indication (CMI)"}, /* 7.7.97 */
1180 /* 198 */ {198, "Aggregate Maximum Bit Rate (AMBR)"}, /* 7.7.98 */
1181 /* 199 */ {199, "UE Network Capability"}, /* 7.7.99 */
1182 /* 200 */ {200, "UE-AMBR"}, /* 7.7.100 */
1183 /* 201 */ {201, "APN-AMBR with NSAPI"}, /* 7.7.101 */
1184 /* 202 */ {202, "GGSN Back-Off Time"}, /* 7.7.102 */
1185 /* 203 */ {203, "Signalling Priority Indication"}, /* 7.7.103 */
1186 /* 204 */ {204, "Signalling Priority Indication with NSAPI"}, /* 7.7.104 */
1187 /* 205 */ {205, "Higher bitrates than 16 Mbps flag"}, /* 7.7.105 */
1188 /* 206 */ {206, "Max MBR/APN-AMBR"}, /* 7.7.106 */
1189 /* 207 */ {207, "Additional MM context for SRVCC"}, /* 7.7.107 */
1190 /* 208 */ {208, "Additional flags for SRVCC"}, /* 7.7.108 */
1191 /* 209 */ {209, "STN-SR"}, /* 7.7.109 */
1192 /* 210 */ {210, "C-MSISDN"}, /* 7.7.110 */
1193 /* 211 */ {211, "Extended RANAP Cause"}, /* 7.7.111 */
1194 /* 212 */ {GTP_EXT_ENODEB_ID, "eNodeB ID" }, /* 7.7.112 */
1195 /* 213 */ {GTP_EXT_SEL_MODE_W_NSAPI, "Selection Mode with NSAPI" }, /* 7.7.113 */
1196 /* 214 */ {GTP_EXT_ULI_TIMESTAMP, "ULI Timestamp" }, /* 7.7.114 */
1197 /* 215 */ {GTP_EXT_LHN_ID_W_SAPI, "Local Home Network ID (LHN-ID) with NSAPI" }, /* 7.7.115 */
1198 /* 216 */ {GTP_EXT_CN_OP_SEL_ENTITY, "Operator Selection Entity" }, /* 7.7.116 */
1199 /* 217 */ {GTP_EXT_UE_USAGE_TYPE, "UE Usage Type" }, /* 7.7.117 */
1200 /* 218 */ {GTP_EXT_EXT_COMMON_FLGS_II, "Extended Common Flags II"}, /* 7.7.118 */
1201 /* 219 */ {GTP_EXT_NODE_IDENTIFIER, "Node Identifier" }, /* 7.7.119 */
1202 /* 220 */ {GTP_EXT_CIOT_OPT_SUP_IND, "CIoT Optimizations Support Indication" }, /* 7.7.120 */
1203 /* 221 */ {GTP_EXT_SCEF_PDN_CONNECTION, "SCEF PDN Connection" }, /* 7.7.121 */
1205 /* 219-238 TLV Spare. For future use. */
1206 /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
1207 /* 249 */ {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"}, /* charging */
1208 /* 250 */ {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"}, /* charging */
1209 /* 251 */ {GTP_EXT_CHRG_ADDR, "Charging Gateway address"}, /* 7.7.44 */
1210 /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
1211 /* 252 */ {GTP_EXT_DATA_REQ, "Data record packet"}, /* charging */
1212 /* 253 */ {GTP_EXT_DATA_RESP, "Requests responded"}, /* charging */
1213 /* 254 */ {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
1214 /* 255 */ {GTP_EXT_PRIV_EXT, "Private Extension"},
1218 static value_string_ext gtpv1_val_ext = VALUE_STRING_EXT_INIT(gtpv1_val);
1220 /* GPRS: 9.60 v7.6.0, page 37
1221 * UMTS: 29.060 v4.0, page 45
1222 * ETSI TS 129 060 V9.4.0 (2010-10) Ch 7.7.1
1224 static const value_string cause_type[] = {
1225 { 0, "Request IMSI"},
1226 { 1, "Request IMEI"},
1227 { 2, "Request IMSI and IMEI"},
1228 { 3, "No identity needed"},
1230 { 5, "MS is not GPRS responding"},
1231 { 6, "Reactivation Requested"},
1232 { 7, "PDP address inactivity timer expires"},
1233 /* For future use 8-48 */
1234 /* Cause values reserved for GPRS charging
1235 * protocol use (see GTP' in 3GPP TS 32.295 [33])
1238 { 59, "System failure"}, /* charging */
1239 { 60, "The transmit buffers are becoming full"}, /* charging */
1240 { 61, "The receive buffers are becoming full"}, /* charging */
1241 { 62, "Another node is about to go down"}, /* charging */
1242 { 63, "This node is about to go down"}, /* charging */
1243 /* For future use 64-127 */
1244 {128, "Request accepted"},
1245 {129, "New PDP type due to network preference"},
1246 {130, "New PDP type due to single address bearer only"},
1247 /* For future use 131-176 */
1248 /* Cause values reserved for GPRS charging
1249 * protocol use (see GTP' in 3GPP TS 32.295 [33])
1252 {177, "CDR decoding error"},
1254 {192, "Non-existent"},
1255 {193, "Invalid message format"},
1256 {194, "IMSI not known"},
1257 {195, "MS is GPRS detached"},
1258 {196, "MS is not GPRS responding"},
1259 {197, "MS refuses"},
1260 {198, "Version not supported"},
1261 {199, "No resource available"},
1262 {200, "Service not supported"},
1263 {201, "Mandatory IE incorrect"},
1264 {202, "Mandatory IE missing"},
1265 {203, "Optional IE incorrect"},
1266 {204, "System failure"},
1267 {205, "Roaming restriction"},
1268 {206, "P-TMSI signature mismatch"},
1269 {207, "GPRS connection suspended"},
1270 {208, "Authentication failure"},
1271 {209, "User authentication failed"},
1272 {210, "Context not found"},
1273 {211, "All PDP dynamic addresses are occupied"},
1274 {212, "No memory is available"},
1275 {213, "Relocation failure"},
1276 {214, "Unknown mandatory extension header"},
1277 {215, "Semantic error in the TFT operation"},
1278 {216, "Syntactic error in the TFT operation"},
1279 {217, "Semantic errors in packet filter(s)"},
1280 {218, "Syntactic errors in packet filter(s)"},
1281 {219, "Missing or unknown APN"},
1282 {220, "Unknown PDP address or PDP type"},
1283 {221, "PDP context without TFT already activated"},
1284 {222, "APN access denied - no subscription"},
1285 {223, "APN Restriction type incompatibility with currently active PDP Contexts"},
1286 {224, "MS MBMS Capabilities Insufficient"},
1287 {225, "Invalid Correlation-ID"},
1288 {226, "MBMS Bearer Context Superseded"},
1289 {227, "Bearer Control Mode violation"},
1290 {228, "Collision with network initiated request"},
1291 {229, "APN Congestion"},
1292 {230, "Bearer handling not supported"},
1293 {231, "Target access restricted for the subscriber" },
1294 {232, "UE is temporarily not reachable due to power saving" },
1295 {233, "Relocation failure due to NAS message redirection"},
1296 /* For future use -240 */
1297 /* Cause values reserved for GPRS charging
1298 * protocol use (see GTP' in 3GPP TS 32.295 [33])
1301 {252, "Request related to possibly duplicated packets already fulfilled"}, /* charging */
1302 {253, "Request already fulfilled"}, /* charging */
1303 {254, "Sequence numbers of released/cancelled packets IE incorrect"}, /* charging */
1304 {255, "Request not fulfilled"}, /* charging */
1307 value_string_ext cause_type_ext = VALUE_STRING_EXT_INIT(cause_type);
1309 /* GPRS: 9.02 v7.7.0
1310 * UMTS: 29.002 v4.2.1, chapter 17.5, page 268
1311 * Imported gsm_old_GSMMAPLocalErrorcode_vals from gsm_map from gsm_map
1314 static const value_string gsn_addr_type[] = {
1320 static const value_string pdp_type[] = {
1323 {0x02, "OSP:IHOSS"},
1330 static const value_string pdp_org_type[] = {
1336 static const value_string qos_delay_type[] = {
1337 {0x00, "Subscribed delay class (in MS to network direction)"},
1338 {0x01, "Delay class 1"},
1339 {0x02, "Delay class 2"},
1340 {0x03, "Delay class 3"},
1341 {0x04, "Delay class 4 (best effort)"},
1346 static const value_string qos_reliability_type[] = {
1347 {0x00, "Subscribed reliability class (in MS to network direction)"},
1348 {0x01, "Acknowledged GTP, LLC, and RLC; Protected data"},
1349 {0x02, "Unacknowledged GTP, Ack LLC/RLC, Protected data"},
1350 {0x03, "Unacknowledged GTP/LLC, Ack RLC, Protected data"},
1351 {0x04, "Unacknowledged GTP/LLC/RLC, Protected data"},
1352 {0x05, "Unacknowledged GTP/LLC/RLC, Unprotected data"},
1357 static const value_string qos_peak_type[] = {
1358 {0x00, "Subscribed peak throughput (in MS to network direction)"},
1359 {0x01, "Up to 1 000 oct/s"},
1360 {0x02, "Up to 2 000 oct/s"},
1361 {0x03, "Up to 4 000 oct/s"},
1362 {0x04, "Up to 8 000 oct/s"},
1363 {0x05, "Up to 16 000 oct/s"},
1364 {0x06, "Up to 32 000 oct/s"},
1365 {0x07, "Up to 64 000 oct/s"},
1366 {0x08, "Up to 128 000 oct/s"},
1367 {0x09, "Up to 256 000 oct/s"},
1368 /* QoS Peak throughput classes from 0x0A to 0x0F (from 10 to 15) are subscribed */
1378 static const value_string qos_precedence_type[] = {
1379 {0x00, "Subscribed precedence (in MS to network direction)"},
1380 {0x01, "High priority"},
1381 {0x02, "Normal priority"},
1382 {0x03, "Low priority"},
1387 static const value_string qos_mean_type[] = {
1388 {0x00, "Subscribed mean throughput (in MS to network direction)"},
1389 {0x01, "100 oct/h"}, /* Class 2 */
1390 {0x02, "200 oct/h"}, /* Class 3 */
1391 {0x03, "500 oct/h"}, /* Class 4 */
1392 {0x04, "1 000 oct/h"}, /* Class 5 */
1393 {0x05, "2 000 oct/h"}, /* Class 6 */
1394 {0x06, "5 000 oct/h"}, /* Class 7 */
1395 {0x07, "10 000 oct/h"}, /* Class 8 */
1396 {0x08, "20 000 oct/h"}, /* Class 9 */
1397 {0x09, "50 000 oct/h"}, /* Class 10 */
1398 {0x0A, "100 000 oct/h"}, /* Class 11 */
1399 {0x0B, "200 000 oct/h"}, /* Class 12 */
1400 {0x0C, "500 000 oct/h"}, /* Class 13 */
1401 {0x0D, "1 000 000 oct/h"}, /* Class 14 */
1402 {0x0E, "2 000 000 oct/h"}, /* Class 15 */
1403 {0x0F, "5 000 000 oct/h"}, /* Class 16 */
1404 {0x10, "10 000 000 oct/h"}, /* Class 17 */
1405 {0x11, "20 000 000 oct/h"}, /* Class 18 */
1406 {0x12, "50 000 000 oct/h"}, /* Class 19 */
1407 /* QoS Mean throughput classes from 0x13 to 0x1E (from 19 to 30) are subscribed */
1420 {0x1F, "Best effort"}, /* Class 1 */
1423 static value_string_ext qos_mean_type_ext = VALUE_STRING_EXT_INIT(qos_mean_type);
1425 static const value_string qos_del_err_sdu[] = {
1426 {0x00, "Subscribed delivery of erroneous SDUs (in MS to network direction)"},
1427 {0x01, "No detect ('-')"},
1428 {0x02, "Erroneous SDUs are delivered ('yes')"},
1429 {0x03, "Erroneous SDUs are not delivered ('no')"},
1430 {0x07, "Reserved"}, /* All other values are reserved */
1434 static const value_string qos_del_order[] = {
1435 {0x00, "Subscribed delivery order (in MS to network direction)"},
1436 {0x01, "With delivery order ('yes')"},
1437 {0x02, "Without delivery order ('no')"},
1438 {0x03, "Reserved"}, /* All other values are reserved */
1442 static const value_string qos_traf_class[] = {
1443 {0x00, "Subscribed traffic class (in MS to network direction)"},
1444 {0x01, "Conversational class"},
1445 {0x02, "Streaming class"},
1446 {0x03, "Interactive class"},
1447 {0x04, "Background class"},
1448 {0x07, "Reserved"}, /* All other values are reserved */
1452 static const value_string qos_max_sdu_size[] = {
1453 {0x00, "Subscribed maximum SDU size (in MS to network direction"},
1454 /* For values from 0x01 to 0x96 (from 1 to 150), use a granularity of 10 octets */
1455 {0x97, "1502 octets"},
1456 {0x98, "1510 octets"},
1457 {0x99, "1520 octets"},
1458 {0, NULL} /* All other values are reserved */
1461 static const value_string qos_max_ul[] = {
1462 {0x00, "Subscribed maximum bit rate for uplink (in MS to network direction)"},
1463 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1464 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1465 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1470 static const value_string qos_max_dl[] = {
1471 {0x00, "Subscribed maximum bit rate for downlink (in MS to network direction)"},
1472 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1473 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1474 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1479 static const value_string qos_res_ber[] = {
1480 {0x00, "Subscribed residual BER (in MS to network direction)"},
1481 {0x01, "1/20 = 5x10^-2"},
1482 {0x02, "1/100 = 1x10^-2"},
1483 {0x03, "1/200 = 5x10^-3"},
1484 {0x04, "1/250 = 4x10^-3"},
1485 {0x05, "1/1 000 = 1x10^-3"},
1486 {0x06, "1/10 000 = 1x10^-4"},
1487 {0x07, "1/100 000 = 1x10^-5"},
1488 {0x08, "1/1 000 000 = 1x10^-6"},
1489 {0x09, "3/50 000 000 = 6x10^-8"},
1490 {0x0F, "Reserved"}, /* All other values are reserved */
1494 static const value_string qos_sdu_err_ratio[] = {
1495 {0x00, "Subscribed SDU error ratio (in MS to network direction)"},
1496 {0x01, "1/100 = 1x10^-2"},
1497 {0x02, "7/1000 = 7x10^-3"},
1498 {0x03, "1/1 000 = 1x10^-3"},
1499 {0x04, "1/10 000 = 1x10^-4"},
1500 {0x05, "1/100 000 = 1x10^-5"},
1501 {0x06, "1/1 000 000 = 1x10^-6"},
1502 {0x07, "1/10 = 1x10^-1"},
1503 {0x0F, "Reserved"}, /* All other values are reserved */
1507 static const value_string qos_traf_handl_prio[] = {
1508 {0x00, "Subscribed traffic handling priority (in MS to network direction)"},
1509 {0x01, "Priority level 1"},
1510 {0x02, "Priority level 2"},
1511 {0x03, "Priority level 3"},
1515 static const value_string qos_trans_delay[] = {
1516 {0x00, "Subscribed Transfer Delay (in MS to network direction)"},
1517 {0x01, "10 ms"}, /* Using a granularity of 10 ms */
1532 {0x10, "200 ms"}, /* (For values from 0x10 to 0x1F, value = 200 ms + (value - 0x10) * 50 ms */
1548 {0x20, "1000 ms"}, /* For values from 0x20 to 0x3E, value = 1000 ms + (value - 0x20) * 100 ms */
1582 static value_string_ext qos_trans_delay_ext = VALUE_STRING_EXT_INIT(qos_trans_delay);
1584 static const value_string qos_guar_ul[] = {
1585 {0x00, "Subscribed guaranteed bit rate for uplink (in MS to network direction)"},
1586 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1587 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1588 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1593 static const value_string src_stat_desc_vals[] = {
1600 static const true_false_string gtp_sig_ind = {
1601 "Optimised for signalling traffic",
1602 "Not optimised for signalling traffic"
1605 static const value_string qos_guar_dl[] = {
1606 {0x00, "Subscribed guaranteed bit rate for downlink (in MS to network direction)"},
1607 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1608 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1609 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1614 static const value_string sel_mode_type[] = {
1615 {0, "MS or network provided APN, subscribed verified"},
1616 {1, "MS provided APN, subscription not verified"},
1617 {2, "Network provided APN, subscription not verified"},
1618 {3, "For future use (Network provided APN, subscription not verified"}, /* Shall not be sent. If received, shall be sent as value 2 */
1622 static const value_string tr_comm_type[] = {
1623 {1, "Send data record packet"},
1624 {2, "Send possibly duplicated data record packet"},
1625 {3, "Cancel data record packet"},
1626 {4, "Release data record packet"},
1631 * UMTS: 23.040 v14.0.0, chapter 3.3.2
1633 static const value_string ms_not_reachable_type[] = {
1634 { 0, "No paging response via the MSC"},
1635 { 1, "IMSI detached"},
1636 { 2, "Roaming restriction"},
1637 { 3, "Deregistered in the HLR for non GPRS"},
1638 { 4, "MS purge for non GPRS"},
1639 { 5, "No paging response via the SGSN"},
1640 { 6, "GPRS detached"},
1641 { 7, "Deregistered in the HLR for non GPRS"},
1642 { 8, "MS purged for GPRS"},
1643 { 9, "Unidentified subscriber via the MSC"},
1644 {10, "Unidentified subscriber via the SGSN"},
1645 {11, "Deregistered in the HSS/HLR for IMS"},
1646 {12, "No response via the IP-SM-GW"},
1647 {13, "The MS is temporarily unavailable"},
1648 {0, NULL} /* All other values are reserved */
1651 /* UMTS: 25.413 v3.4.0, chapter 9.2.1.4, page 80
1653 static const value_string ranap_cause_type[] = {
1654 /* Radio Network Layer Cause (1-->64) */
1655 { 1, "RAB preempted"},
1656 { 2, "Trelocoverall Expiry"},
1657 { 3, "Trelocprep Expiry"},
1658 { 4, "Treloccomplete Expiry"},
1659 { 5, "Tqueuing Expiry"},
1660 { 6, "Relocation Triggered"},
1661 { 7, "TRELOCalloc Expiry"},
1662 { 8, "Unable to Establish During Relocation"},
1663 { 9, "Unknown Target RNC"},
1664 { 10, "Relocation Cancelled"},
1665 { 11, "Successful Relocation"},
1666 { 12, "Requested Ciphering and/or Integrity Protection Algorithms not Supported"},
1667 { 13, "Change of Ciphering and/or Integrity Protection is not supported"},
1668 { 14, "Failure in the Radio Interface Procedure"},
1669 { 15, "Release due to UTRAN Generated Reason"},
1670 { 16, "User Inactivity"},
1671 { 17, "Time Critical Relocation"},
1672 { 18, "Requested Traffic Class not Available"},
1673 { 19, "Invalid RAB Parameters Value"},
1674 { 20, "Requested Maximum Bit Rate not Available"},
1675 { 21, "Requested Guaranteed Bit Rate not Available"},
1676 { 22, "Requested Transfer Delay not Achievable"},
1677 { 23, "Invalid RAB Parameters Combination"},
1678 { 24, "Condition Violation for SDU Parameters"},
1679 { 25, "Condition Violation for Traffic Handling Priority"},
1680 { 26, "Condition Violation for Guaranteed Bit Rate"},
1681 { 27, "User Plane Versions not Supported"},
1682 { 28, "Iu UP Failure"},
1683 { 29, "Relocation Failure in Target CN/RNC or Target System"},
1684 { 30, "Invalid RAB ID"},
1685 { 31, "No Remaining RAB"},
1686 { 32, "Interaction with other procedure"},
1687 { 33, "Requested Maximum Bit Rate for DL not Available"},
1688 { 34, "Requested Maximum Bit Rate for UL not Available"},
1689 { 35, "Requested Guaranteed Bit Rate for DL not Available"},
1690 { 36, "Requested Guaranteed Bit Rate for UL not Available"},
1691 { 37, "Repeated Integrity Checking Failure"},
1692 { 38, "Requested Report Type not supported"},
1693 { 39, "Request superseded"},
1694 { 40, "Release due to UE generated signalling connection release"},
1695 { 41, "Resource Optimisation Relocation"},
1696 { 42, "Requested Information Not Available"},
1697 { 43, "Relocation desirable for radio reasons"},
1698 { 44, "Relocation not supported in Target RNC or Target System"},
1699 { 45, "Directed Retry"},
1700 { 46, "Radio Connection With UE Lost"},
1701 { 47, "rNC-unable-to-establish-all-RFCs"},
1702 { 48, "deciphering-keys-not-available"},
1703 { 49, "dedicated-assistance-data-not-available"},
1704 { 50, "relocation-target-not-allowed"},
1705 { 51, "location-reporting-congestion"},
1706 { 52, "reduce-load-in-serving-cell"},
1707 { 53, "no-radio-resources-available-in-target-cell"},
1708 { 54, "gERAN-Iumode-failure"},
1709 { 55, "access-restricted-due-to-shared-networks"},
1710 { 56, "incoming-relocation-not-supported-due-to-PUESBINE-feature"},
1711 { 57, "traffic-load-in-the-target-cell-higher-than-in-the-source-cell"},
1712 { 58, "mBMS-no-multicast-service-for-this-UE"},
1713 { 59, "mBMS-unknown-UE-ID"},
1714 { 60, "successful-MBMS-session-start-no-data-bearer-necessary"},
1715 { 61, "mBMS-superseded-due-to-NNSF"},
1716 { 62, "mBMS-UE-linking-already-done"},
1717 { 63, "mBMS-UE-de-linking-failure-no-existing-UE-linking"},
1718 { 64, "tMGI-unknown"},
1719 /* Transport Layer Cause (65-->80) */
1720 { 65, "Signalling Transport Resource Failure"},
1721 { 66, "Iu Transport Connection Failed to Establish"},
1722 /* NAS Cause (81-->96) */
1723 { 81, "User Restriction Start Indication"},
1724 { 82, "User Restriction End Indication"},
1725 { 83, "Normal Release"},
1726 /* Protocol Cause (97-->112) */
1727 { 97, "Transfer Syntax Error"},
1728 { 98, "Semantic Error"},
1729 { 99, "Message not compatible with receiver state"},
1730 { 100, "Abstract Syntax Error (Reject)"},
1731 { 101, "Abstract Syntax Error (Ignore and Notify)"},
1732 { 102, "Abstract Syntax Error (Falsely Constructed Message"},
1733 /* Miscellaneous Cause (113-->128) */
1734 { 113, "O & M Intervention"},
1735 { 114, "No Resource Available"},
1736 { 115, "Unspecified Failure"},
1737 { 116, "Network Optimisation"},
1738 /* Non-standard Cause (129-->255) */
1740 /* ranap_CauseRadioNetworkExtension ??
1741 { 257, "iP-multicast-address-and-APN-not-valid" },
1742 { 258, "mBMS-de-registration-rejected-due-to-implicit-registration" },
1743 { 259, "mBMS-request-superseded" },
1744 { 260, "mBMS-de-registration-during-session-not-allowed" },
1745 { 261, "mBMS-no-data-bearer-necessary" },
1750 static value_string_ext ranap_cause_type_ext = VALUE_STRING_EXT_INIT(ranap_cause_type);
1752 static const value_string mm_sec_modep[] = {
1753 {0, "Used cipher value, UMTS keys and Quintuplets"},
1754 {1, "GSM key and triplets"},
1755 {2, "UMTS key and quintuplets"},
1756 {3, "GSM key and quintuplets"},
1760 static const value_string gtp_cipher_algorithm[] = {
1761 {0, "No ciphering"},
1771 static const value_string gtp_ext_rat_type_vals[] = {
1777 {5, "HSPA Evolution"},
1778 {6, "EUTRAN (WB-E-UTRAN)"},
1780 {8, "EUTRAN-NB-IoT"},
1783 static const value_string chg_rep_act_type_vals[] = {
1784 {0, "Stop Reporting"},
1785 {1, "Start Reporting CGI/SAI"},
1786 {2, "Start Reporting RAI"},
1791 static const value_string geographic_location_type[] = {
1792 {0, "Cell Global Identification (CGI)"},
1793 {1, "Service Area Identity (SAI)"},
1794 {2, "Routing Area Identification (RAI)"},
1795 /* reserved for future used (3-->127) */
1796 {128, "Tracking Area identity (TAI)"}, /* Radius */
1797 {129, "E-UTRAN Cell Global Identification (ECGI)"}, /* Radius */
1798 {130, "Tracking Area identity & E-UTRAN Cell Global Identification (TAI & ECGI)"}, /* Radius */
1799 /* reserved for future used (131-->255) */
1803 #define MM_PROTO_GROUP_CALL_CONTROL 0x00
1804 #define MM_PROTO_BROADCAST_CALL_CONTROL 0x01
1805 #define MM_PROTO_PDSS1 0x02
1806 #define MM_PROTO_CALL_CONTROL 0x03
1807 #define MM_PROTO_PDSS2 0x04
1808 #define MM_PROTO_MM_NON_GPRS 0x05
1809 #define MM_PROTO_RR_MGMT 0x06
1810 #define MM_PROTO_MM_GPRS 0x08
1811 #define MM_PROTO_SMS 0x09
1812 #define MM_PROTO_SESSION_MGMT 0x0A
1813 #define MM_PROTO_NON_CALL_RELATED 0x0B
1816 gtpstat_init(struct register_srt* srt _U_, GArray* srt_array)
1818 srt_stat_table *gtp_srt_table;
1820 gtp_srt_table = init_srt_table("GTP Requests", NULL, srt_array, 4, NULL, NULL, NULL);
1821 init_srt_table_row(gtp_srt_table, 0, "Echo");
1822 init_srt_table_row(gtp_srt_table, 1, "Create PDP context");
1823 init_srt_table_row(gtp_srt_table, 2, "Update PDP context");
1824 init_srt_table_row(gtp_srt_table, 3, "Delete PDP context");
1828 gtpstat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv)
1831 srt_stat_table *gtp_srt_table;
1832 srt_data_t *data = (srt_data_t *)pss;
1833 const gtp_msg_hash_t *gtp=(const gtp_msg_hash_t *)prv;
1836 /* we are only interested in reply packets */
1837 if(gtp->is_request){
1840 /* if we have not seen the request, just ignore it */
1841 if(!gtp->req_frame){
1845 /* Only use the commands we know how to handle, this is not a comprehensive list */
1846 /* Redoing the message indexing is bit reduntant, */
1847 /* but using message type as such would yield a long gtp_srt_table. */
1848 /* Only a fraction of the messages are matchable req/resp pairs, */
1849 /* it just doesn't feel feasible. */
1851 switch(gtp->msgtype){
1852 case GTP_MSG_ECHO_REQ: idx=0;
1854 case GTP_MSG_CREATE_PDP_REQ: idx=1;
1856 case GTP_MSG_UPDATE_PDP_REQ: idx=2;
1858 case GTP_MSG_DELETE_PDP_REQ: idx=3;
1864 gtp_srt_table = g_array_index(data->srt_array, srt_stat_table*, i);
1865 add_srt_table_data(gtp_srt_table, idx, >p->req_time, pinfo);
1871 static dissector_handle_t ip_handle;
1872 static dissector_handle_t ipv6_handle;
1873 static dissector_handle_t ppp_handle;
1874 static dissector_handle_t sync_handle;
1875 static dissector_handle_t gtpcdr_handle;
1876 static dissector_handle_t sndcpxid_handle;
1877 static dissector_handle_t gtpv2_handle;
1878 static dissector_handle_t bssgp_handle;
1879 static dissector_table_t bssap_pdu_type_table;
1880 guint32 gtp_session_count;
1882 /* Relation between frame -> session */
1883 GHashTable* session_table;
1884 /* Relation between <teid,ip> -> frame */
1885 wmem_tree_t* frame_tree;
1887 typedef struct gtp_info {
1892 /* GTP Session funcs*/
1894 get_frame(address ip, guint32 teid, guint32 *frame) {
1895 gboolean found = FALSE;
1896 wmem_list_frame_t *elem;
1898 wmem_list_t *info_list;
1901 /* First we get the teid list*/
1902 ip_str = address_to_str(wmem_packet_scope(), &ip);
1903 info_list = (wmem_list_t*)wmem_tree_lookup_string(frame_tree, ip_str, 0);
1904 if (info_list != NULL) {
1905 elem = wmem_list_head(info_list);
1906 while (!found && elem) {
1907 info = (gtp_info_t*)wmem_list_frame_data(elem);
1908 if (teid == info->teid) {
1909 *frame = info->frame;
1912 elem = wmem_list_frame_next(elem);
1919 call_foreach_ip(const void *key _U_, void *value, void *data){
1920 wmem_list_frame_t * elem;
1921 wmem_list_t *info_list = (wmem_list_t *)value;
1923 guint32* frame = (guint32*)data;
1925 /* We loop over the <teid, frame> list */
1926 elem = wmem_list_head(info_list);
1928 info = (gtp_info_t*)wmem_list_frame_data(elem);
1929 if (info->frame == *frame) {
1930 wmem_list_frame_t * del = elem;
1931 /* proceed to next request */
1932 elem = wmem_list_frame_next(elem);
1933 /* If we find the frame we remove its information from the list */
1934 wmem_list_remove_frame(info_list, del);
1935 wmem_free(wmem_file_scope(), info);
1938 elem = wmem_list_frame_next(elem);
1946 remove_frame_info(guint32 *f) {
1947 /* For each ip node */
1948 wmem_tree_foreach(frame_tree, call_foreach_ip, (void *)f);
1952 add_gtp_session(guint32 frame, guint32 session) {
1953 guint32 *f, *session_count;
1955 f = wmem_new0(wmem_file_scope(), guint32);
1956 session_count = wmem_new0(wmem_file_scope(), guint32);
1958 *session_count = session;
1959 g_hash_table_insert(session_table, f, session_count);
1963 teid_exists(guint32 teid, wmem_list_t *teid_list) {
1964 wmem_list_frame_t *elem;
1968 elem = wmem_list_head(teid_list);
1969 while (!found && elem) {
1970 info = (guint32*)wmem_list_frame_data(elem);
1971 found = *info == teid;
1972 elem = wmem_list_frame_next(elem);
1978 ip_exists(address ip, wmem_list_t *ip_list) {
1979 wmem_list_frame_t *elem;
1983 elem = wmem_list_head(ip_list);
1984 while (!found && elem) {
1985 info = (address*)wmem_list_frame_data(elem);
1986 found = addresses_equal(info, &ip);
1987 elem = wmem_list_frame_next(elem);
1993 info_exists(gtp_info_t *wanted, wmem_list_t *info_list) {
1994 wmem_list_frame_t *elem;
1998 elem = wmem_list_head(info_list);
1999 while (!found && elem) {
2000 info = (gtp_info_t*)wmem_list_frame_data(elem);
2001 found = wanted->teid == info->teid;
2002 elem = wmem_list_frame_next(elem);
2008 fill_map(wmem_list_t *teid_list, wmem_list_t *ip_list, guint32 frame) {
2009 wmem_list_frame_t *elem_ip, *elem_teid;
2010 gtp_info_t *gtp_info;
2011 wmem_list_t * info_list; /* List of <teids,frames>*/
2012 guint32 *f, *session, *fr, *session_count;
2013 GHashTableIter iter;
2017 elem_ip = wmem_list_head(ip_list);
2019 ip = address_to_str(wmem_file_scope(), (address*)wmem_list_frame_data(elem_ip));
2020 /* We check if a teid list exists for this ip */
2021 info_list = (wmem_list_t*)wmem_tree_lookup_string(frame_tree, ip, 0);
2022 if (info_list == NULL) {
2023 info_list = wmem_list_new(wmem_file_scope());
2025 /* We loop over the teid list */
2026 elem_teid = wmem_list_head(teid_list);
2028 teid = *(guint32*)wmem_list_frame_data(elem_teid);
2029 f = wmem_new0(wmem_file_scope(), guint32);
2031 gtp_info = wmem_new0(wmem_file_scope(), gtp_info_t);
2032 gtp_info->teid = teid;
2033 gtp_info->frame = *f;
2034 if (info_exists(gtp_info, info_list)) {
2035 /* If the teid and ip already existed, that means that we need to remove old info about that session */
2036 /* We look for its session ID */
2037 session = (guint32 *)g_hash_table_lookup(session_table, f);
2039 g_hash_table_iter_init(&iter, session_table);
2040 while (g_hash_table_iter_next(&iter, (gpointer*)&fr, (gpointer*)&session_count)) {
2041 /* If the msg has the same session ID and it's not the upd req we have to remove its info */
2042 if (*session_count == *session) {
2043 /* If it's the session we are looking for, we remove all the frame information */
2044 remove_frame_info(fr);
2049 wmem_list_prepend(info_list, gtp_info);
2050 elem_teid = wmem_list_frame_next(elem_teid);
2052 wmem_tree_insert_string(frame_tree, ip, info_list, 0);
2053 elem_ip = wmem_list_frame_next(elem_ip);
2058 is_cause_accepted(guint8 cause, guint32 version) {
2060 return cause == 128 || cause == 129 || cause == 130;
2062 else if (version == 2) {
2063 return cause == 16 || cause == 17 || cause == 18 || cause == 19;
2068 static int decode_gtp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args);
2069 static int decode_gtp_imsi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2070 static int decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2071 static int decode_gtp_tlli(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2072 static int decode_gtp_ptmsi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2073 static int decode_gtp_qos_gprs(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2074 static int decode_gtp_reorder(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2075 static int decode_gtp_auth_tri(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2076 static int decode_gtp_map_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2077 static int decode_gtp_ptmsi_sig(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2078 static int decode_gtp_ms_valid(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2079 static int decode_gtp_recovery(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2080 static int decode_gtp_sel_mode(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2081 static int decode_gtp_16(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args);
2082 static int decode_gtp_17(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args);
2083 static int decode_gtp_18(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2084 static int decode_gtp_19(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2085 static int decode_gtp_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2086 static int decode_gtp_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2087 static int decode_gtp_rab_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2088 static int decode_gtp_rp_sms(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2089 static int decode_gtp_rp(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2090 static int decode_gtp_pkt_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2091 static int decode_gtp_chrg_char(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2092 static int decode_gtp_trace_ref(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2093 static int decode_gtp_trace_type(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2094 static int decode_gtp_ms_reason(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2095 static int decode_gtp_tr_comm(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2096 static int decode_gtp_chrg_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2097 static int decode_gtp_user_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2098 static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2099 static int decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2100 static int decode_gtp_apn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2101 static int decode_gtp_gsn_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args);
2102 static int decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2103 static int decode_gtp_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2104 static int decode_gtp_qos_umts(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2105 static int decode_gtp_auth_qui(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2106 static int decode_gtp_tft(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2107 static int decode_gtp_target_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2108 static int decode_gtp_utran_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2109 static int decode_gtp_rab_setup(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2110 static int decode_gtp_hdr_list(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2111 static int decode_gtp_trigger_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2112 static int decode_gtp_omc_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2114 static int decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2115 static int decode_gtp_pdp_cont_prio(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2116 static int decode_gtp_add_rab_setup_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2117 static int decode_gtp_ssgn_no(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2118 static int decode_gtp_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2119 static int decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2120 static int decode_gtp_ra_prio_lcs(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2121 static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2122 static int decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2123 static int decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2124 static int decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2125 static int decode_gtp_camel_chg_inf_con(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2126 static int decode_gtp_mbms_ue_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2127 static int decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2128 static int decode_gtp_rim_ra(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2129 static int decode_gtp_mbms_prot_conf_opt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2130 static int decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2131 static int decode_gtp_src_rnc_pdp_ctx_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2132 static int decode_gtp_add_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2133 static int decode_gtp_hop_count(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2134 static int decode_gtp_sel_plmn_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2135 static int decode_gtp_mbms_ses_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2136 static int decode_gtp_mbms_2g_3g_ind(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2137 static int decode_gtp_enh_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2138 static int decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2139 static int decode_gtp_add_mbms_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2140 static int decode_gtp_mbms_ses_id_rep_no(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2141 static int decode_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2142 static int decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2143 static int decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2144 static int decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2145 static int decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2146 static int decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2147 static int decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2148 static int decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2149 static int decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2150 static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2151 static int decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2152 static int decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2153 static int decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2154 static int decode_gtp_fqdn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2155 static int decode_gtp_evolved_allc_rtn_p1(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2156 static int decode_gtp_evolved_allc_rtn_p2(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2157 static int decode_gtp_extended_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2158 static int decode_gtp_uci(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2159 static int decode_gtp_csg_inf_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2160 static int decode_gtp_csg_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2161 static int decode_gtp_cmi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2162 static int decode_gtp_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2163 static int decode_gtp_ue_network_cap(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2164 static int decode_gtp_ue_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2165 static int decode_gtp_apn_ambr_with_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2166 static int decode_gtp_ggsn_back_off_time(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2167 static int decode_gtp_sig_pri_ind(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2168 static int decode_gtp_sig_pri_ind_w_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2169 static int decode_gtp_higher_br_16mb_flg(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2170 static int decode_gtp_max_mbr_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2171 static int decode_gtp_add_mm_ctx_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2172 static int decode_gtp_add_flgs_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2173 static int decode_gtp_stn_sr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2174 static int decode_gtp_c_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2175 static int decode_gtp_ext_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2176 static int decode_gtp_ext_enodeb_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2177 static int decode_gtp_ext_sel_mode_w_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2178 static int decode_gtp_ext_uli_timestamp(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2179 static int decode_gtp_ext_lhn_id_w_sapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2180 static int decode_gtp_ext_cn_op_sel_entity(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2181 static int decode_gtp_extended_common_flgs_II(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2183 static int decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2184 static int decode_gtp_mbms_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2185 static int decode_gtp_mbms_ip_mcast_dist(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2186 static int decode_gtp_mbms_dist_ack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2187 static int decode_gtp_reliable_irat_ho_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2188 static int decode_gtp_rfsp_index(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_);
2190 static int decode_gtp_chrg_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2191 static int decode_gtp_rel_pack(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2192 static int decode_gtp_can_pack(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2193 static int decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2194 static int decode_gtp_data_resp(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2195 static int decode_gtp_node_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2196 static int decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2197 static int decode_gtp_unknown(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_);
2199 typedef struct _gtp_opt {
2201 int (*decode) (tvbuff_t *, int, packet_info *, proto_tree *, session_args_t *);
2204 static const gtp_opt_t gtpopt[] = {
2205 /* 0x01 */ {GTP_EXT_CAUSE, decode_gtp_cause},
2206 /* 0x02 */ {GTP_EXT_IMSI, decode_gtp_imsi},
2207 /* 0x03 */ {GTP_EXT_RAI, decode_gtp_rai},
2208 /* 0x04 */ {GTP_EXT_TLLI, decode_gtp_tlli},
2209 /* 0x05 */ {GTP_EXT_PTMSI, decode_gtp_ptmsi},
2210 /* 0x06 */ {GTP_EXT_QOS_GPRS, decode_gtp_qos_gprs},
2212 /* 0x08 */ {GTP_EXT_REORDER, decode_gtp_reorder},
2213 /* 0x09 */ {GTP_EXT_AUTH_TRI, decode_gtp_auth_tri},
2215 /* 0x0b */ {GTP_EXT_MAP_CAUSE, decode_gtp_map_cause},
2216 /* 0x0c */ {GTP_EXT_PTMSI_SIG, decode_gtp_ptmsi_sig},
2217 /* 0x0d */ {GTP_EXT_MS_VALID, decode_gtp_ms_valid},
2218 /* 0x0e */ {GTP_EXT_RECOVER, decode_gtp_recovery},
2219 /* 0x0f */ {GTP_EXT_SEL_MODE, decode_gtp_sel_mode},
2220 /* 0x10 */ {GTP_EXT_16, decode_gtp_16},
2221 /* 0x11 */ {GTP_EXT_17, decode_gtp_17},
2222 /* 0x12 */ {GTP_EXT_18, decode_gtp_18},
2223 /* 0x13 */ {GTP_EXT_19, decode_gtp_19},
2224 /* 0x14 */ {GTP_EXT_NSAPI, decode_gtp_nsapi},
2225 /* 0x15 */ {GTP_EXT_RANAP_CAUSE, decode_gtp_ranap_cause},
2226 /* 0x16 */ {GTP_EXT_RAB_CNTXT, decode_gtp_rab_cntxt},
2227 /* 0x17 */ {GTP_EXT_RP_SMS, decode_gtp_rp_sms},
2228 /* 0x18 */ {GTP_EXT_RP, decode_gtp_rp},
2229 /* 0x19 */ {GTP_EXT_PKT_FLOW_ID, decode_gtp_pkt_flow_id},
2230 /* 0x1a */ {GTP_EXT_CHRG_CHAR, decode_gtp_chrg_char},
2231 /* 0x1b */ {GTP_EXT_TRACE_REF, decode_gtp_trace_ref},
2232 /* 0x1c */ {GTP_EXT_TRACE_TYPE, decode_gtp_trace_type},
2233 /* 0x1d */ {GTPv1_EXT_MS_REASON, decode_gtp_ms_reason},
2235 /* 0x7e */ {GTP_EXT_TR_COMM, decode_gtp_tr_comm},
2236 /* 0x7f */ {GTP_EXT_CHRG_ID, decode_gtp_chrg_id},
2237 /* 0x80 */ {GTP_EXT_USER_ADDR, decode_gtp_user_addr},
2238 /* 0x81 */ {GTP_EXT_MM_CNTXT, decode_gtp_mm_cntxt},
2239 /* 0x82 */ {GTP_EXT_PDP_CNTXT, decode_gtp_pdp_cntxt},
2240 /* 0x83 */ {GTP_EXT_APN, decode_gtp_apn},
2241 /* 0x84 */ {GTP_EXT_PROTO_CONF, decode_gtp_proto_conf},
2242 /* 0x85 */ {GTP_EXT_GSN_ADDR, decode_gtp_gsn_addr},
2243 /* 0x86 */ {GTP_EXT_MSISDN, decode_gtp_msisdn},
2244 /* 0x87 */ {GTP_EXT_QOS_UMTS, decode_gtp_qos_umts}, /* 3G */
2245 /* 0x88 */ {GTP_EXT_AUTH_QUI, decode_gtp_auth_qui}, /* 3G */
2246 /* 0x89 */ {GTP_EXT_TFT, decode_gtp_tft}, /* 3G */
2247 /* 0x8a */ {GTP_EXT_TARGET_ID, decode_gtp_target_id}, /* 3G */
2248 /* 0x8b */ {GTP_EXT_UTRAN_CONT, decode_gtp_utran_cont}, /* 3G */
2249 /* 0x8c */ {GTP_EXT_RAB_SETUP, decode_gtp_rab_setup}, /* 3G */
2250 /* 0x8d */ {GTP_EXT_HDR_LIST, decode_gtp_hdr_list}, /* 3G */
2251 /* 0x8e */ {GTP_EXT_TRIGGER_ID, decode_gtp_trigger_id}, /* 3G */
2252 /* 0x8f */ {GTP_EXT_OMC_ID, decode_gtp_omc_id}, /* 3G */
2253 /* TS 29 060 V6.11.0 */
2254 /* 0x90 */ {GTP_EXT_RAN_TR_CONT, decode_gtp_ran_tr_cont}, /* 7.7.43 */
2255 /* 0x91 */ {GTP_EXT_PDP_CONT_PRIO, decode_gtp_pdp_cont_prio}, /* 7.7.45 */
2256 /* 0x92 */ {GTP_EXT_ADD_RAB_SETUP_INF, decode_gtp_add_rab_setup_inf}, /* 7.7.45A */
2257 /* 0x93 */ {GTP_EXT_SSGN_NO, decode_gtp_ssgn_no}, /* 7.7.47 */
2258 /* 0x94 */ {GTP_EXT_COMMON_FLGS, decode_gtp_common_flgs}, /* 7.7.48 */
2259 /* 0x95 */ {GTP_EXT_APN_RES, decode_gtp_apn_res}, /* 3G */
2260 /* 0x96 */ {GTP_EXT_RA_PRIO_LCS, decode_gtp_ra_prio_lcs}, /* 7.7.25B */
2261 /* 0x97 */ {GTP_EXT_RAT_TYPE, decode_gtp_rat_type}, /* 3G */
2262 /* 0x98 */ {GTP_EXT_USR_LOC_INF, decode_gtp_usr_loc_inf}, /* 7.7.51 */
2263 /* 0x99 */ {GTP_EXT_MS_TIME_ZONE, decode_gtp_ms_time_zone}, /* 7.7.52 */
2264 /* 0x9a */ {GTP_EXT_IMEISV, decode_gtp_imeisv}, /* 3G 7.7.53 */
2265 /* 0x9b */ {GTP_EXT_CAMEL_CHG_INF_CON, decode_gtp_camel_chg_inf_con}, /* 7.7.54 */
2266 /* 0x9c */ {GTP_EXT_MBMS_UE_CTX, decode_gtp_mbms_ue_ctx}, /* 7.7.55 */
2267 /* 0x9d */ {GTP_EXT_TMGI, decode_gtp_tmgi}, /* 7.7.56 */
2268 /* 0x9e */ {GTP_EXT_RIM_RA, decode_gtp_rim_ra}, /* 7.7.57 */
2269 /* 0x9f */ {GTP_EXT_MBMS_PROT_CONF_OPT, decode_gtp_mbms_prot_conf_opt}, /* 7.7.58 */
2270 /* 0xa0 */ {GTP_EXT_MBMS_SA, decode_gtp_mbms_sa}, /* 7.7.60 */
2271 /* 0xa1 */ {GTP_EXT_SRC_RNC_PDP_CTX_INF, decode_gtp_src_rnc_pdp_ctx_inf}, /* 7.7.61 */
2272 /* 0xa2 */ {GTP_EXT_ADD_TRS_INF, decode_gtp_add_trs_inf}, /* 7.7.62 */
2273 /* 0xa3 */ {GTP_EXT_HOP_COUNT, decode_gtp_hop_count}, /* 7.7.63 */
2274 /* 0xa4 */ {GTP_EXT_SEL_PLMN_ID, decode_gtp_sel_plmn_id}, /* 7.7.64 */
2275 /* 0xa5 */ {GTP_EXT_MBMS_SES_ID, decode_gtp_mbms_ses_id}, /* 7.7.65 */
2276 /* 0xa6 */ {GTP_EXT_MBMS_2G_3G_IND, decode_gtp_mbms_2g_3g_ind}, /* 7.7.66 */
2277 /* 0xa7 */ {GTP_EXT_ENH_NSAPI, decode_gtp_enh_nsapi}, /* 7.7.67 */
2278 /* 0xa8 */ {GTP_EXT_MBMS_SES_DUR, decode_gtp_mbms_ses_dur}, /* 7.7.59 */
2279 /* 0xa9 */ {GTP_EXT_ADD_MBMS_TRS_INF, decode_gtp_add_mbms_trs_inf}, /* 7.7.68 */
2280 /* 0xaa */ {GTP_EXT_MBMS_SES_ID_REP_NO, decode_gtp_mbms_ses_id_rep_no}, /* 7.7.69 */
2281 /* 0xab */ {GTP_EXT_MBMS_TIME_TO_DATA_TR, decode_gtp_mbms_time_to_data_tr}, /* 7.7.70 */
2282 /* 0xac */ {GTP_EXT_PS_HO_REQ_CTX, decode_gtp_ps_ho_req_ctx}, /* 7.7.71 */
2283 /* 0xad */ {GTP_EXT_BSS_CONT, decode_gtp_bss_cont}, /* 7.7.72 */
2284 /* 0xae */ {GTP_EXT_CELL_ID, decode_gtp_cell_id}, /* 7.7.73 */
2285 /* 0xaf */ {GTP_EXT_PDU_NO, decode_gtp_pdu_no}, /* 7.7.74 */
2286 /* 0xb0 */ {GTP_EXT_BSSGP_CAUSE, decode_gtp_bssgp_cause}, /* 7.7.75 */
2287 /* 0xb1 */ {GTP_EXT_REQ_MBMS_BEARER_CAP, decode_gtp_mbms_bearer_cap}, /* 7.7.76 */
2288 /* 0xb2 */ {GTP_EXT_RIM_ROUTING_ADDR_DISC, decode_gtp_rim_ra_disc}, /* 7.7.77 */
2289 /* 0xb3 */ {GTP_EXT_LIST_OF_SETUP_PFCS, decode_gtp_lst_set_up_pfc}, /* 7.7.78 */
2290 /* 0xb4 */ {GTP_EXT_PS_HANDOVER_XIP_PAR, decode_gtp_ps_handover_xid}, /* 7.7.79 */
2291 /* 0xb5 */ {GTP_EXT_MS_INF_CHG_REP_ACT, decode_gtp_ms_inf_chg_rep_act}, /* 7.7.80 */
2292 /* 0xb6 */ {GTP_EXT_DIRECT_TUNNEL_FLGS, decode_gtp_direct_tnl_flg}, /* 7.7.81 */
2293 /* 0xb7 */ {GTP_EXT_CORRELATION_ID, decode_gtp_corrl_id}, /* 7.7.82 */
2294 /* 0xb8 */ {GTP_EXT_BEARER_CONTROL_MODE, decode_gtp_bearer_cntrl_mod}, /* 7.7.83 */
2295 /* 0xb9 */ {GTP_EXT_MBMS_FLOW_ID, decode_gtp_mbms_flow_id}, /* 7.7.84 */
2296 /* 0xba */ {GTP_EXT_MBMS_IP_MCAST_DIST, decode_gtp_mbms_ip_mcast_dist}, /* 7.7.85 */
2297 /* 0xba */ {GTP_EXT_MBMS_DIST_ACK, decode_gtp_mbms_dist_ack}, /* 7.7.86 */
2298 /* 0xbc */ {GTP_EXT_RELIABLE_IRAT_HO_INF, decode_gtp_reliable_irat_ho_inf}, /* 7.7.87 */
2299 /* 0xbd */ {GTP_EXT_RFSP_INDEX, decode_gtp_rfsp_index}, /* 7.7.87 */
2301 /* 0xbe */ {GTP_EXT_FQDN, decode_gtp_fqdn}, /* 7.7.90 */
2302 /* 0xbf */ {GTP_EXT_EVO_ALLO_RETE_P1, decode_gtp_evolved_allc_rtn_p1}, /* 7.7.91 */
2303 /* 0xc0 */ {GTP_EXT_EVO_ALLO_RETE_P2, decode_gtp_evolved_allc_rtn_p2}, /* 7.7.92 */
2304 /* 0xc1 */ {GTP_EXT_EXTENDED_COMMON_FLGS, decode_gtp_extended_common_flgs}, /* 7.7.93 */
2305 /* 0xc2 */ {GTP_EXT_UCI, decode_gtp_uci}, /* 7.7.94 */
2306 /* 0xc3 */ {GTP_EXT_CSG_INF_REP_ACT, decode_gtp_csg_inf_rep_act}, /* 7.7.95 */
2307 /* 0xc4 */ {GTP_EXT_CSG_ID, decode_gtp_csg_id}, /* 7.7.96 */
2308 /* 0xc5 */ {GTP_EXT_CMI, decode_gtp_cmi}, /* 7.7.97 */
2309 /* 0xc6 */ {GTP_EXT_AMBR, decode_gtp_apn_ambr}, /* 7.7.98 */
2310 /* 0xc7 */ {GTP_EXT_UE_NETWORK_CAP, decode_gtp_ue_network_cap}, /* 7.7.99 */
2311 /* 0xc8 */ {GTP_EXT_UE_AMBR, decode_gtp_ue_ambr}, /* 7.7.100 */
2312 /* 0xc9 */ {GTP_EXT_APN_AMBR_WITH_NSAPI, decode_gtp_apn_ambr_with_nsapi}, /* 7.7.101 */
2313 /* 0xCA */ {GTP_EXT_GGSN_BACK_OFF_TIME, decode_gtp_ggsn_back_off_time}, /* 7.7.102 */
2314 /* 0xCB */ {GTP_EXT_SIG_PRI_IND, decode_gtp_sig_pri_ind}, /* 7.7.103 */
2315 /* 0xCC */ {GTP_EXT_SIG_PRI_IND_W_NSAPI, decode_gtp_sig_pri_ind_w_nsapi}, /* 7.7.104 */
2316 /* 0xCD */ {GTP_EXT_HIGHER_BR_16MB_FLG, decode_gtp_higher_br_16mb_flg}, /* 7.7.105 */
2317 /* 0xCE */ {GTP_EXT_MAX_MBR_APN_AMBR, decode_gtp_max_mbr_apn_ambr}, /* 7.7.106 */
2318 /* 0xCF */ {GTP_EXT_ADD_MM_CTX_SRVCC, decode_gtp_add_mm_ctx_srvcc}, /* 7.7.107 */
2319 /* 0xD0 */ {GTP_EXT_ADD_FLGS_SRVCC, decode_gtp_add_flgs_srvcc}, /* 7.7.108 */
2320 /* 0xD1 */ {GTP_EXT_STN_SR, decode_gtp_stn_sr}, /* 7.7.109 */
2321 /* 0xD2 */ {GTP_EXT_C_MSISDN, decode_gtp_c_msisdn}, /* 7.7.110 */
2322 /* 0xD3 */ {GTP_EXT_EXT_RANAP_CAUSE, decode_gtp_ext_ranap_cause}, /* 7.7.111 */
2323 /* 0xD4 */ {GTP_EXT_ENODEB_ID, decode_gtp_ext_enodeb_id }, /* 7.7.112 */
2324 /* 0xD5 */ {GTP_EXT_SEL_MODE_W_NSAPI, decode_gtp_ext_sel_mode_w_nsapi }, /* 7.7.113 */
2325 /* 0xD6 */ {GTP_EXT_ULI_TIMESTAMP, decode_gtp_ext_uli_timestamp }, /* 7.7.114 */
2326 /* 0xD7 */ {GTP_EXT_LHN_ID_W_SAPI, decode_gtp_ext_lhn_id_w_sapi }, /* 7.7.115 */
2327 /* 0xD8 */ {GTP_EXT_CN_OP_SEL_ENTITY, decode_gtp_ext_cn_op_sel_entity }, /* 7.7.116 */
2329 /* 0xDA */ {GTP_EXT_EXT_COMMON_FLGS_II, decode_gtp_extended_common_flgs_II}, /* 7.7.118 */
2331 /* 0xf9 */ {GTP_EXT_REL_PACK, decode_gtp_rel_pack }, /* charging */
2332 /* 0xfa */ {GTP_EXT_CAN_PACK, decode_gtp_can_pack}, /* charging */
2333 /* 0xfb */ {GTP_EXT_CHRG_ADDR, decode_gtp_chrg_addr},
2335 /* 0xfc */ {GTP_EXT_DATA_REQ, decode_gtp_data_req}, /* charging */
2336 /* 0xfd */ {GTP_EXT_DATA_RESP, decode_gtp_data_resp}, /* charging */
2337 /* 0xfe */ {GTP_EXT_NODE_ADDR, decode_gtp_node_addr},
2338 /* 0xff */ {GTP_EXT_PRIV_EXT, decode_gtp_priv_ext},
2339 {0, decode_gtp_unknown}
2342 #define NUM_GTP_IES 255
2343 static gint ett_gtp_ies[NUM_GTP_IES];
2345 static guint8 gtp_version = 0;
2347 #define BCD2CHAR(d) ((d) | 0x30)
2350 id_to_str(tvbuff_t *tvb, gint offset)
2352 static gchar str[17] = " ";
2353 guint8 bits8to5, bits4to1;
2357 for (i = j = 0; i < 8; i++) {
2358 ad = tvb_get_guint8(tvb, offset + i);
2359 bits8to5 = hi_nibble(ad);
2360 bits4to1 = lo_nibble(ad);
2362 str[j++] = BCD2CHAR(bits4to1);
2366 str[j++] = BCD2CHAR(bits8to5);
2375 /* Next definitions and function check_field_presence checks if given field
2376 * in GTP packet is compliant with ETSI
2378 typedef struct _header {
2383 typedef struct _message {
2385 ext_header fields[32];
2388 /* ---------------------
2390 * ---------------------*/
2391 static _gtp_mess_items gprs_mess_items[] = {
2395 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2400 GTP_MSG_ECHO_RESP, {
2401 {GTP_EXT_RECOVER, GTP_MANDATORY},
2402 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2407 GTP_MSG_VER_NOT_SUPP, {
2412 GTP_MSG_NODE_ALIVE_REQ, {
2413 {GTP_EXT_NODE_ADDR, GTP_MANDATORY},
2414 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2419 GTP_MSG_NODE_ALIVE_RESP, {
2420 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2425 GTP_MSG_REDIR_REQ, {
2426 {GTP_EXT_CAUSE, GTP_MANDATORY},
2427 {GTP_EXT_NODE_ADDR, GTP_OPTIONAL},
2428 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2433 GTP_MSG_REDIR_RESP, {
2434 {GTP_EXT_CAUSE, GTP_MANDATORY},
2435 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2440 GTP_MSG_CREATE_PDP_REQ, {
2441 {GTP_EXT_QOS_GPRS, GTP_MANDATORY},
2442 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2443 {GTP_EXT_SEL_MODE, GTP_MANDATORY},
2444 {GTP_EXT_FLOW_LABEL, GTP_MANDATORY},
2445 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2446 {GTP_EXT_MSISDN, GTP_MANDATORY},
2447 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2448 {GTP_EXT_APN, GTP_MANDATORY},
2449 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2450 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2451 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2452 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2457 GTP_MSG_CREATE_PDP_RESP, {
2458 {GTP_EXT_CAUSE, GTP_MANDATORY},
2459 {GTP_EXT_QOS_GPRS, GTP_CONDITIONAL},
2460 {GTP_EXT_REORDER, GTP_CONDITIONAL},
2461 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2462 {GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL},
2463 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2464 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2465 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2466 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2467 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2468 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2469 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2470 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2475 GTP_MSG_UPDATE_PDP_REQ, {
2476 {GTP_EXT_QOS_GPRS, GTP_MANDATORY},
2477 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2478 {GTP_EXT_FLOW_LABEL, GTP_MANDATORY},
2479 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2480 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2481 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2482 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2487 GTP_MSG_UPDATE_PDP_RESP, {
2488 {GTP_EXT_CAUSE, GTP_MANDATORY},
2489 {GTP_EXT_QOS_GPRS, GTP_CONDITIONAL},
2490 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2491 {GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL},
2492 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2493 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2494 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2495 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2496 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2497 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2502 GTP_MSG_DELETE_PDP_REQ, {
2503 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2508 GTP_MSG_DELETE_PDP_RESP, {
2509 {GTP_EXT_CAUSE, GTP_MANDATORY},
2510 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2515 GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ, {
2516 {GTP_EXT_QOS_GPRS, GTP_MANDATORY},
2517 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2518 {GTP_EXT_SEL_MODE, GTP_MANDATORY},
2519 {GTP_EXT_FLOW_LABEL, GTP_MANDATORY},
2520 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2521 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2522 {GTP_EXT_APN, GTP_MANDATORY},
2523 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2524 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2525 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2526 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2531 GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP, {
2532 {GTP_EXT_CAUSE, GTP_MANDATORY},
2533 {GTP_EXT_QOS_GPRS, GTP_CONDITIONAL},
2534 {GTP_EXT_REORDER, GTP_CONDITIONAL},
2535 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2536 {GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL},
2537 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2538 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2539 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2540 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2541 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2542 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2543 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2544 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2549 GTP_MSG_DELETE_AA_PDP_REQ, {
2550 {GTP_EXT_CAUSE, GTP_MANDATORY},
2551 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2556 GTP_MSG_DELETE_AA_PDP_RESP, {
2557 {GTP_EXT_CAUSE, GTP_MANDATORY},
2558 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2564 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2569 GTP_MSG_PDU_NOTIFY_REQ, {
2570 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2571 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2576 GTP_MSG_PDU_NOTIFY_RESP, {
2577 {GTP_EXT_CAUSE, GTP_MANDATORY},
2578 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2583 GTP_MSG_PDU_NOTIFY_REJ_REQ, {
2584 {GTP_EXT_CAUSE, GTP_MANDATORY},
2585 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2586 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2591 GTP_MSG_PDU_NOTIFY_REJ_RESP, {
2592 {GTP_EXT_CAUSE, GTP_MANDATORY},
2593 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2598 GTP_MSG_SEND_ROUT_INFO_REQ, {
2599 {GTP_EXT_IMSI, GTP_MANDATORY},
2600 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2605 GTP_MSG_SEND_ROUT_INFO_RESP, {
2606 {GTP_EXT_CAUSE, GTP_MANDATORY},
2607 {GTP_EXT_IMSI, GTP_MANDATORY},
2608 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2609 {GTP_EXT_MS_REASON, GTP_OPTIONAL},
2610 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL},
2611 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2616 GTP_MSG_FAIL_REP_REQ, {
2617 {GTP_EXT_IMSI, GTP_MANDATORY},
2618 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2623 GTP_MSG_FAIL_REP_RESP, {
2624 {GTP_EXT_CAUSE, GTP_MANDATORY},
2625 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2626 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2631 GTP_MSG_MS_PRESENT_REQ, {
2632 {GTP_EXT_IMSI, GTP_MANDATORY},
2633 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2634 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2639 GTP_MSG_MS_PRESENT_RESP, {
2640 {GTP_EXT_CAUSE, GTP_MANDATORY},
2641 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2646 GTP_MSG_IDENT_REQ, {
2647 {GTP_EXT_RAI, GTP_MANDATORY},
2648 {GTP_EXT_PTMSI, GTP_MANDATORY},
2649 {GTP_EXT_PTMSI_SIG, GTP_OPTIONAL},
2650 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2655 GTP_MSG_IDENT_RESP, {
2656 {GTP_EXT_CAUSE, GTP_MANDATORY},
2657 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2658 {GTP_EXT_AUTH_TRI, GTP_OPTIONAL},
2659 {GTP_EXT_AUTH_QUI, GTP_OPTIONAL},
2660 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2665 GTP_MSG_SGSN_CNTXT_REQ, {
2666 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2667 {GTP_EXT_RAI, GTP_MANDATORY},
2668 {GTP_EXT_TLLI, GTP_MANDATORY},
2669 {GTP_EXT_PTMSI_SIG, GTP_OPTIONAL},
2670 {GTP_EXT_MS_VALID, GTP_OPTIONAL},
2671 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2676 GTP_MSG_SGSN_CNTXT_RESP, {
2677 {GTP_EXT_CAUSE, GTP_MANDATORY},
2678 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2679 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2680 {GTP_EXT_MM_CNTXT, GTP_CONDITIONAL},
2681 {GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL},
2682 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2687 GTP_MSG_SGSN_CNTXT_ACK, {
2688 {GTP_EXT_CAUSE, GTP_MANDATORY},
2689 {GTP_EXT_FLOW_II, GTP_CONDITIONAL},
2690 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2691 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2696 GTP_MSG_DATA_TRANSF_REQ, {
2697 {GTP_EXT_TR_COMM, GTP_MANDATORY},
2698 {GTP_EXT_DATA_REQ, GTP_CONDITIONAL},
2699 {GTP_EXT_REL_PACK, GTP_CONDITIONAL},
2700 {GTP_EXT_CAN_PACK, GTP_CONDITIONAL},
2701 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2706 GTP_MSG_DATA_TRANSF_RESP, {
2707 {GTP_EXT_CAUSE, GTP_MANDATORY},
2708 {GTP_EXT_DATA_RESP, GTP_MANDATORY},
2709 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2720 /* -----------------------------
2722 * -----------------------------*/
2723 static _gtp_mess_items umts_mess_items[] = {
2724 /* 7.2 Path Management Messages */
2727 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2732 GTP_MSG_ECHO_RESP, {
2733 {GTP_EXT_RECOVER, GTP_MANDATORY},
2734 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2739 GTP_MSG_VER_NOT_SUPP, {
2744 GTP_MSG_SUPP_EXT_HDR, {
2745 {GTP_EXT_HDR_LIST, GTP_MANDATORY},
2751 GTP_MSG_NODE_ALIVE_REQ, {
2752 {GTP_EXT_NODE_ADDR, GTP_MANDATORY},
2753 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2758 GTP_MSG_NODE_ALIVE_RESP, {
2759 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2764 GTP_MSG_REDIR_REQ, {
2765 {GTP_EXT_CAUSE, GTP_MANDATORY},
2766 {GTP_EXT_NODE_ADDR, GTP_OPTIONAL},
2767 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2772 GTP_MSG_REDIR_REQ, {
2776 /* 7.3 Tunnel Management Messages */
2778 GTP_MSG_CREATE_PDP_REQ, {
2779 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2780 /* RAI is in TS 29.060 V6.11.0 */
2781 {GTP_EXT_RAI, GTP_OPTIONAL}, /* Routeing Area Identity (RAI) Optional 7.7.3 */
2782 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2783 {GTP_EXT_SEL_MODE, GTP_CONDITIONAL},
2784 {GTP_EXT_TEID, GTP_MANDATORY},
2785 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2786 {GTP_EXT_NSAPI, GTP_MANDATORY},
2787 {GTP_EXT_NSAPI, GTP_CONDITIONAL},
2788 {GTP_EXT_CHRG_CHAR, GTP_OPTIONAL},
2789 {GTP_EXT_TRACE_REF, GTP_OPTIONAL},
2790 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL},
2791 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2792 {GTP_EXT_APN, GTP_CONDITIONAL},
2793 {GTP_EXT_PROTO_CONF, GTP_CONDITIONAL},
2794 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2795 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2796 {GTP_EXT_MSISDN, GTP_CONDITIONAL},
2797 {GTP_EXT_QOS_UMTS, GTP_MANDATORY},
2798 {GTP_EXT_TFT, GTP_CONDITIONAL},
2799 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL},
2800 {GTP_EXT_OMC_ID, GTP_OPTIONAL},
2801 /* TS 29.060 V6.11.0 */
2802 {GTP_EXT_APN_RES, GTP_OPTIONAL},
2803 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL},
2804 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL},
2805 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL},
2806 {GTP_EXT_IMEISV, GTP_OPTIONAL},
2807 {GTP_EXT_CAMEL_CHG_INF_CON, GTP_OPTIONAL},
2808 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL},
2809 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2814 GTP_MSG_CREATE_PDP_RESP, {
2815 {GTP_EXT_CAUSE, GTP_MANDATORY},
2816 {GTP_EXT_REORDER, GTP_CONDITIONAL},
2817 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2818 {GTP_EXT_TEID, GTP_CONDITIONAL},
2819 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2820 {GTP_EXT_NSAPI, GTP_CONDITIONAL},
2821 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2822 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2823 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2824 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2825 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2826 {GTP_EXT_QOS_UMTS, GTP_CONDITIONAL},
2827 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2828 /* TS 29.060 V6.11.0 */
2829 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
2830 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Optional 7.7.48 */
2831 {GTP_EXT_APN_RES, GTP_OPTIONAL}, /* APN Restriction Optional 7.7.49 */
2832 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2836 { /* checked, SGSN -> GGSN */
2837 GTP_MSG_UPDATE_PDP_REQ, {
2838 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2839 {GTP_EXT_RAI, GTP_OPTIONAL}, /* Routeing Area Identity (RAI) Optional 7.7.3 */
2840 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2841 {GTP_EXT_TEID, GTP_MANDATORY},
2842 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2843 {GTP_EXT_NSAPI, GTP_MANDATORY},
2844 {GTP_EXT_TRACE_REF, GTP_OPTIONAL},
2845 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL},
2846 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2847 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for Control Plane Mandatory GSN Address 7.7.32 */
2848 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for User Traffic Mandatory GSN Address 7.7.32 */
2849 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2850 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for User Traffic Conditional GSN Address 7.7.32 */
2851 {GTP_EXT_QOS_UMTS, GTP_MANDATORY},
2852 {GTP_EXT_TFT, GTP_OPTIONAL},
2853 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL},
2854 {GTP_EXT_OMC_ID, GTP_OPTIONAL},
2855 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Optional 7.7.48 */
2856 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL}, /* RAT Type Optional 7.7.50 */
2857 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL}, /* User Location Information Optional 7.7.51 */
2858 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL}, /* MS Time Zone Optional 7.7.52 */
2859 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL}, /* Additonal Trace Info Optional 7.7.62 */
2860 {GTP_EXT_DIRECT_TUNNEL_FLGS, GTP_OPTIONAL}, /* Direct Tunnel Flags 7.7.81 */
2861 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2865 { /* checked, GGSN -> SGSN */
2866 GTP_MSG_UPDATE_PDP_RESP, {
2867 {GTP_EXT_CAUSE, GTP_MANDATORY},
2868 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2869 {GTP_EXT_TEID, GTP_CONDITIONAL},
2870 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2871 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2872 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2873 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2874 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2875 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2876 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for User Traffic Conditional GSN Address 7.7.32 */
2877 {GTP_EXT_QOS_UMTS, GTP_CONDITIONAL},
2878 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2879 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
2880 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2881 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Optional 7.7.48 */
2882 {GTP_EXT_APN_RES, GTP_OPTIONAL}, /* APN Restriction Optional 7.7.49 */
2887 GTP_MSG_DELETE_PDP_REQ, {
2888 {GTP_EXT_TEAR_IND, GTP_CONDITIONAL},
2889 {GTP_EXT_NSAPI, GTP_MANDATORY},
2890 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2891 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2896 GTP_MSG_DELETE_PDP_RESP, {
2897 {GTP_EXT_CAUSE, GTP_MANDATORY},
2898 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2899 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2905 {GTP_EXT_TEID, GTP_MANDATORY},
2906 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* GSN Address Mandatory 7.7.32 */
2907 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2912 GTP_MSG_PDU_NOTIFY_REQ, {
2913 {GTP_EXT_IMSI, GTP_MANDATORY},
2914 {GTP_EXT_TEID_CP, GTP_MANDATORY},
2915 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2916 {GTP_EXT_APN, GTP_MANDATORY},
2917 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2918 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2919 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2924 GTP_MSG_PDU_NOTIFY_RESP, {
2925 {GTP_EXT_CAUSE, GTP_MANDATORY},
2926 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2931 GTP_MSG_PDU_NOTIFY_REJ_REQ, {
2932 {GTP_EXT_CAUSE, GTP_MANDATORY},
2933 {GTP_EXT_TEID_CP, GTP_MANDATORY},
2934 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2935 {GTP_EXT_APN, GTP_MANDATORY},
2936 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2937 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2942 GTP_MSG_PDU_NOTIFY_REJ_RESP, {
2943 {GTP_EXT_CAUSE, GTP_MANDATORY},
2944 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2948 /* 7.4 Location Management Messages */
2950 GTP_MSG_SEND_ROUT_INFO_REQ, {
2951 {GTP_EXT_IMSI, GTP_MANDATORY},
2952 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2957 GTP_MSG_SEND_ROUT_INFO_RESP, {
2958 {GTP_EXT_CAUSE, GTP_MANDATORY},
2959 {GTP_EXT_IMSI, GTP_MANDATORY},
2960 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2961 {GTPv1_EXT_MS_REASON, GTP_OPTIONAL},
2962 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL},
2963 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2968 GTP_MSG_FAIL_REP_REQ, {
2969 {GTP_EXT_IMSI, GTP_MANDATORY},
2970 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2975 GTP_MSG_FAIL_REP_RESP, {
2976 {GTP_EXT_CAUSE, GTP_MANDATORY},
2977 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2978 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2983 GTP_MSG_MS_PRESENT_REQ, {
2984 {GTP_EXT_IMSI, GTP_MANDATORY},
2985 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2986 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2991 GTP_MSG_MS_PRESENT_RESP, {
2992 {GTP_EXT_CAUSE, GTP_MANDATORY},
2993 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2997 /* 7.5 Mobility Management Messages */
2999 GTP_MSG_IDENT_REQ, {
3000 {GTP_EXT_RAI, GTP_MANDATORY},
3001 {GTP_EXT_PTMSI, GTP_MANDATORY},
3002 {GTP_EXT_PTMSI_SIG, GTP_CONDITIONAL},
3003 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* SGSN Address for Control Plane Optional 7.7.32 */
3004 {GTP_EXT_HOP_COUNT, GTP_OPTIONAL}, /* Hop Counter Optional 7.7.63 */
3005 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3010 GTP_MSG_IDENT_RESP, {
3011 {GTP_EXT_CAUSE, GTP_MANDATORY},
3012 {GTP_EXT_IMSI, GTP_CONDITIONAL},
3013 {GTP_EXT_AUTH_TRI, GTP_CONDITIONAL},
3014 {GTP_EXT_AUTH_QUI, GTP_CONDITIONAL},
3015 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3020 GTP_MSG_SGSN_CNTXT_REQ, {
3021 {GTP_EXT_IMSI, GTP_CONDITIONAL},
3022 {GTP_EXT_RAI, GTP_MANDATORY},
3023 {GTP_EXT_TLLI, GTP_CONDITIONAL},
3024 {GTP_EXT_PTMSI, GTP_CONDITIONAL},
3025 {GTP_EXT_PTMSI_SIG, GTP_CONDITIONAL},
3026 {GTP_EXT_MS_VALID, GTP_OPTIONAL},
3027 {GTP_EXT_TEID_CP, GTP_MANDATORY},
3028 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
3029 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for Control Plane Optional 7.7.32 */
3030 {GTP_EXT_SSGN_NO, GTP_OPTIONAL}, /* SGSN Number Optional 7.7.47 */
3031 {GTP_EXT_HOP_COUNT, GTP_OPTIONAL}, /* Hop Counter Optional 7.7.63 */
3032 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3037 GTP_MSG_SGSN_CNTXT_RESP, {
3038 {GTP_EXT_CAUSE, GTP_MANDATORY},
3039 {GTP_EXT_IMSI, GTP_CONDITIONAL},
3040 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
3041 {GTP_EXT_RAB_CNTXT, GTP_CONDITIONAL}, /* RAB Context Conditional 7.7.19 */
3042 {GTP_EXT_RP_SMS, GTP_OPTIONAL},
3043 {GTP_EXT_RP, GTP_OPTIONAL},
3044 {GTP_EXT_PKT_FLOW_ID, GTP_OPTIONAL},
3045 {GTP_EXT_CHRG_CHAR, GTP_OPTIONAL}, /* CharingCharacteristics Optional 7.7.23 */
3046 {GTP_EXT_RA_PRIO_LCS, GTP_OPTIONAL}, /* Radio Priority LCS Optional 7.7.25B */
3047 {GTP_EXT_MM_CNTXT, GTP_CONDITIONAL},
3048 {GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL},
3049 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
3050 {GTP_EXT_PDP_CONT_PRIO, GTP_OPTIONAL}, /* PDP Context Prioritization Optional 7.7.45 */
3051 {GTP_EXT_MBMS_UE_CTX, GTP_OPTIONAL}, /* MBMS UE Context Optional 7.7.55 */
3052 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3057 GTP_MSG_SGSN_CNTXT_ACK, {
3058 {GTP_EXT_CAUSE, GTP_MANDATORY},
3059 {GTP_EXT_TEID_II, GTP_CONDITIONAL},
3060 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
3061 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3066 GTP_MSG_FORW_RELOC_REQ, {
3067 {GTP_EXT_IMSI, GTP_MANDATORY},
3068 {GTP_EXT_TEID_CP, GTP_MANDATORY},
3069 {GTP_EXT_RANAP_CAUSE, GTP_MANDATORY},
3070 {GTP_EXT_CHRG_CHAR, GTP_OPTIONAL}, /* CharingCharacteristics Optional 7.7.23 */
3071 {GTP_EXT_MM_CNTXT, GTP_MANDATORY},
3072 {GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL},
3073 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
3074 {GTP_EXT_TARGET_ID, GTP_MANDATORY},
3075 {GTP_EXT_UTRAN_CONT, GTP_MANDATORY},
3076 {GTP_EXT_PDP_CONT_PRIO, GTP_OPTIONAL}, /* PDP Context Prioritization Optional 7.7.45 */
3077 {GTP_EXT_MBMS_UE_CTX, GTP_OPTIONAL}, /* MBMS UE Context Optional 7.7.55 */
3078 {GTP_EXT_SEL_PLMN_ID, GTP_OPTIONAL}, /* Selected PLMN ID Optional 7.7.64 */
3079 {GTP_EXT_PS_HO_REQ_CTX, GTP_OPTIONAL}, /* PS Handover Request Context Optional 7.7.71 */
3080 {GTP_EXT_BSS_CONT, GTP_OPTIONAL}, /* BSS Container Optional 7.7.72 */
3081 {GTP_EXT_CELL_ID, GTP_OPTIONAL}, /* Cell Identification Optional 7.7.73 */
3082 {GTP_EXT_BSSGP_CAUSE, GTP_OPTIONAL}, /* BSSGP Cause Optional 7.7.75 */
3083 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3084 {GTP_EXT_SSGN_NO, GTP_OPTIONAL},
3089 GTP_MSG_FORW_RELOC_RESP, {
3090 {GTP_EXT_CAUSE, GTP_MANDATORY},
3091 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
3092 {GTP_EXT_TEID_II, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Data II Optional 7.7.15 */
3093 {GTP_EXT_RANAP_CAUSE, GTP_CONDITIONAL},
3094 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
3095 {GTP_EXT_UTRAN_CONT, GTP_OPTIONAL},
3096 {GTP_EXT_RAB_SETUP, GTP_CONDITIONAL},
3097 {GTP_EXT_ADD_RAB_SETUP_INF, GTP_CONDITIONAL}, /* Additional RAB Setup Information Conditional 7.7.45A */
3098 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3103 GTP_MSG_FORW_RELOC_COMP, {
3104 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3109 GTP_MSG_RELOC_CANCEL_REQ, {
3110 {GTP_EXT_IMSI, GTP_MANDATORY},
3111 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3116 GTP_MSG_RELOC_CANCEL_RESP, {
3117 {GTP_EXT_CAUSE, GTP_MANDATORY},
3118 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3123 GTP_MSG_FORW_RELOC_ACK, {
3124 {GTP_EXT_CAUSE, GTP_MANDATORY},
3125 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3130 GTP_MSG_FORW_SRNS_CNTXT_ACK, {
3131 {GTP_EXT_CAUSE, GTP_MANDATORY},
3132 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3137 GTP_MSG_FORW_SRNS_CNTXT, {
3138 {GTP_EXT_RAB_CNTXT, GTP_MANDATORY},
3139 {GTP_EXT_SRC_RNC_PDP_CTX_INF, GTP_OPTIONAL}, /* Source RNC PDCP context info Optional 7.7.61 */
3140 {GTP_EXT_PDU_NO, GTP_OPTIONAL}, /* PDU Numbers Optional 7.7.74 */
3141 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3146 /* 7.5.14 RAN Information Management Messages */
3148 GTP_MSG_RAN_INFO_RELAY, {
3149 {GTP_EXT_RAN_TR_CONT, GTP_MANDATORY}, /* RAN Transparent Container Mandatory 7.7.43 */
3150 {GTP_EXT_RIM_RA, GTP_OPTIONAL}, /* RIM Routing Address Optional 7.7.57 */
3151 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3155 /* 7.5A MBMS Messages
3156 * 7.5A.1 UE Specific MBMS Messages
3159 GTP_MBMS_NOTIFY_REQ, {
3160 {GTP_EXT_IMSI, GTP_MANDATORY}, /* IMSI Mandatory 7.7.2 */
3161 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Mandatory 7.7.14 */
3162 {GTP_EXT_NSAPI, GTP_MANDATORY}, /* NSAPI Mandatory 7.7.17 */
3163 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
3164 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
3165 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* GGSN Address for Control Plane Mandatory 7.7.32 */
3166 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
3167 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3172 GTP_MBMS_NOTIFY_RES, {
3173 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3174 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3179 GTP_MBMS_NOTIFY_REJ_REQ, {
3180 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3181 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Mandatory 7.7.14 */
3182 {GTP_EXT_NSAPI, GTP_MANDATORY}, /* NSAPI Mandatory 7.7.17 */
3183 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
3184 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
3185 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3190 GTP_MBMS_NOTIFY_REJ_RES, {
3191 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3192 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3197 GTP_CREATE_MBMS_CNTXT_REQ, {
3198 {GTP_EXT_IMSI, GTP_CONDITIONAL}, /* IMSI Conditional 7.7.2 */
3199 {GTP_EXT_RAI, GTP_MANDATORY}, /* Routeing Area Identity (RAI) Mandatory 7.7.3 */
3200 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
3201 {GTP_EXT_SEL_MODE, GTP_CONDITIONAL}, /* Selection mode Conditional 7.7.12 */
3202 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
3203 {GTP_EXT_TRACE_REF, GTP_OPTIONAL}, /* Trace Reference Optional 7.7.24 */
3204 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL}, /* Trace Type Optional 7.7.25 */
3205 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
3206 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
3207 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for signalling Mandatory GSN Address 7.7.32 */
3208 {GTP_EXT_MSISDN, GTP_CONDITIONAL}, /* MSISDN Conditional 7.7.33 */
3209 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL}, /* Trigger Id Optional 7.7.41 */
3210 {GTP_EXT_OMC_ID, GTP_OPTIONAL}, /* OMC Identity Optional 7.7.42 */
3211 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL}, /* RAT Type Optional 7.7.50 */
3212 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL}, /* User Location Information Optional 7.7.51 */
3213 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL}, /* MS Time Zone Optional 7.7.52 */
3214 {GTP_EXT_IMEISV, GTP_OPTIONAL}, /* IMEI(SV) Optional 7.7.53 */
3215 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
3216 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL}, /* Additonal Trace Info Optional 7.7.62 */
3217 {GTP_EXT_ENH_NSAPI, GTP_MANDATORY}, /* Enhanced NSAPI Mandatory 7.7.67 */
3218 {GTP_EXT_ADD_MBMS_TRS_INF, GTP_OPTIONAL}, /* Additional MBMS Trace Info Optional 7.7.68 */
3219 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3224 GTP_CREATE_MBMS_CNTXT_RES, {
3225 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3226 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
3227 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
3228 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL}, /* Charging ID Conditional 7.7.26 */
3229 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
3230 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* Alternative GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
3231 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Charging Gateway Address Optional 7.7.44 */
3232 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
3233 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
3234 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3239 GTP_UPD_MBMS_CNTXT_REQ, {
3240 {GTP_EXT_IMSI, GTP_CONDITIONAL}, /* IMSI Conditional 7.7.2 */
3241 {GTP_EXT_RAI, GTP_MANDATORY}, /* Routeing Area Identity (RAI) Mandatory 7.7.3 */
3242 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
3243 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
3244 {GTP_EXT_TRACE_REF, GTP_OPTIONAL}, /* Trace Reference Optional 7.7.24 */
3245 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL}, /* Trace Type Optional 7.7.25 */
3246 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for Control Plane Mandatory GSN Address 7.7.32 */
3247 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
3248 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL}, /* Trigger Id Optional 7.7.41 */
3249 {GTP_EXT_OMC_ID, GTP_OPTIONAL}, /* OMC Identity Optional 7.7.42 */
3250 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL}, /* RAT Type Optional 7.7.50 */
3251 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL}, /* User Location Information Optional 7.7.51 */
3252 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL}, /* MS Time Zone Optional 7.7.52 */
3253 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL}, /* Additional Trace Info Optional 7.7.62 */
3254 {GTP_EXT_ENH_NSAPI, GTP_MANDATORY}, /* Enhanced NSAPI Mandatory 7.7.67 */
3255 {GTP_EXT_ADD_MBMS_TRS_INF, GTP_OPTIONAL}, /* Additional MBMS Trace Info Optional 7.7.68 */
3256 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3261 GTP_UPD_MBMS_CNTXT_RES, {
3262 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3263 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
3264 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
3265 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL}, /* Charging ID Conditional 7.7.26 */
3266 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
3267 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* Alternative GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
3268 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Charging Gateway Address Optional 7.7.44 */
3269 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
3270 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3275 GTP_DEL_MBMS_CNTXT_REQ, {
3276 {GTP_EXT_IMSI, GTP_CONDITIONAL}, /* IMSI Conditional 7.7.2 */
3277 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
3278 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL}, /* End User Address Conditional 7.7.27 */
3279 {GTP_EXT_APN, GTP_CONDITIONAL}, /* Access Point Name Conditional 7.7.30 */
3280 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
3281 {GTP_EXT_ENH_NSAPI, GTP_MANDATORY}, /* Enhanced NSAPI Conditional 7.7.67 */
3282 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3287 GTP_DEL_MBMS_CNTXT_RES, {
3288 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3289 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
3290 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
3296 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
3297 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
3298 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3304 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3305 {GTP_EXT_TMGI, GTP_MANDATORY}, /* Temporary Mobile Group Identity (TMGI) Conditional 7.7.56 */
3306 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3311 GTP_MBMS_DE_REG_REQ, {
3312 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
3313 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
3314 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3319 GTP_MBMS_DE_REG_RES, {
3320 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3321 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3326 GTP_MBMS_SES_START_REQ, {
3327 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
3328 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
3329 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
3330 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
3331 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
3332 {GTP_EXT_QOS_UMTS, GTP_MANDATORY}, /* Quality of Service Profile Mandatory 7.7.34 */
3333 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Mandatory 7.7.48 */
3334 {GTP_EXT_TMGI, GTP_MANDATORY}, /* Temporary Mobile Group Identity (TMGI) Mandatory 7.7.56 */
3335 {GTP_EXT_MBMS_SES_DUR, GTP_MANDATORY}, /* MBMS Session Duration Mandatory 7.7.59 */
3336 {GTP_EXT_MBMS_SA, GTP_MANDATORY}, /* MBMS Service Area Mandatory 7.7.60 */
3337 {GTP_EXT_MBMS_SES_ID, GTP_OPTIONAL}, /* MBMS Session Identifier Optional 7.7.65 */
3338 {GTP_EXT_MBMS_2G_3G_IND, GTP_MANDATORY}, /* MBMS 2G/3G Indicator Mandatory 7.7.66 */
3339 {GTP_EXT_MBMS_SES_ID_REP_NO, GTP_OPTIONAL}, /* MBMS Session Identity Repetition Number Optional 7.7.69 */
3340 {GTP_EXT_MBMS_TIME_TO_DATA_TR, GTP_MANDATORY}, /* MBMS Time To Data Transfer Mandatory 7.7.70 */
3341 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3346 GTP_MBMS_SES_START_RES, {
3347 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3348 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
3349 {GTP_EXT_TEID, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Data I Conditional 7.7.13 */
3350 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
3351 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
3352 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* SGSN Address for user traffic Conditional GSN Address 7.7.32 */
3353 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3358 GTP_MBMS_SES_STOP_REQ, {
3359 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
3360 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
3361 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3366 GTP_MBMS_SES_STOP_RES, {
3367 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
3368 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
3379 /* Data structure attached to a conversation,
3380 to keep track of request/response-pairs
3382 typedef struct gtp_conv_info_t {
3383 struct gtp_conv_info_t *next;
3384 GHashTable *unmatched;
3385 GHashTable *matched;
3388 static gtp_conv_info_t *gtp_info_items = NULL;
3391 gtp_sn_hash(gconstpointer k)
3393 const gtp_msg_hash_t *key = (const gtp_msg_hash_t *)k;
3399 gtp_sn_equal_matched(gconstpointer k1, gconstpointer k2)
3401 const gtp_msg_hash_t *key1 = (const gtp_msg_hash_t *)k1;
3402 const gtp_msg_hash_t *key2 = (const gtp_msg_hash_t *)k2;
3404 if ( key1->req_frame && key2->req_frame && (key1->req_frame != key2->req_frame) ) {
3408 if ( key1->rep_frame && key2->rep_frame && (key1->rep_frame != key2->rep_frame) ) {
3412 return key1->seq_nr == key2->seq_nr;
3416 gtp_sn_equal_unmatched(gconstpointer k1, gconstpointer k2)
3418 const gtp_msg_hash_t *key1 = (const gtp_msg_hash_t *)k1;
3419 const gtp_msg_hash_t *key2 = (const gtp_msg_hash_t *)k2;
3421 return key1->seq_nr == key2->seq_nr;
3424 static gtp_msg_hash_t *
3425 gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype, gtp_conv_info_t *gtp_info, guint8 last_cause)
3427 gtp_msg_hash_t gcr, *gcrp = NULL;
3432 case GTP_MSG_ECHO_REQ:
3433 case GTP_MSG_CREATE_PDP_REQ:
3434 case GTP_MSG_UPDATE_PDP_REQ:
3435 case GTP_MSG_DELETE_PDP_REQ:
3436 case GTP_MSG_FORW_RELOC_REQ:
3437 gcr.is_request=TRUE;
3438 gcr.req_frame=pinfo->num;
3441 case GTP_MSG_ECHO_RESP:
3442 case GTP_MSG_CREATE_PDP_RESP:
3443 case GTP_MSG_UPDATE_PDP_RESP:
3444 case GTP_MSG_DELETE_PDP_RESP:
3445 case GTP_MSG_FORW_RELOC_RESP:
3446 gcr.is_request=FALSE;
3448 gcr.rep_frame=pinfo->num;
3451 gcr.is_request=FALSE;
3457 gcrp = (gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->matched, &gcr);
3461 gcrp->is_request=gcr.is_request;
3465 /*no match, let's try to make one*/
3467 case GTP_MSG_ECHO_REQ:
3468 case GTP_MSG_CREATE_PDP_REQ:
3469 case GTP_MSG_UPDATE_PDP_REQ:
3470 case GTP_MSG_DELETE_PDP_REQ:
3471 case GTP_MSG_FORW_RELOC_REQ:
3474 gcrp=(gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->unmatched, &gcr);
3476 g_hash_table_remove(gtp_info->unmatched, gcrp);
3478 /* if we can't reuse the old one, grab a new chunk */
3480 gcrp = wmem_new(wmem_file_scope(), gtp_msg_hash_t);
3482 gcrp->seq_nr=seq_nr;
3483 gcrp->req_frame = pinfo->num;
3484 gcrp->req_time = pinfo->abs_ts;
3485 gcrp->rep_frame = 0;
3486 gcrp->msgtype = msgtype;
3487 gcrp->is_request = TRUE;
3488 g_hash_table_insert(gtp_info->unmatched, gcrp, gcrp);
3491 case GTP_MSG_ECHO_RESP:
3492 case GTP_MSG_CREATE_PDP_RESP:
3493 case GTP_MSG_UPDATE_PDP_RESP:
3494 case GTP_MSG_DELETE_PDP_RESP:
3495 case GTP_MSG_FORW_RELOC_RESP:
3497 gcrp=(gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->unmatched, &gcr);
3500 if (!gcrp->rep_frame) {
3501 g_hash_table_remove(gtp_info->unmatched, gcrp);
3502 gcrp->rep_frame=pinfo->num;
3503 gcrp->is_request=FALSE;
3504 g_hash_table_insert(gtp_info->matched, gcrp, gcrp);
3513 /* we have found a match */
3518 if (gcrp->is_request) {
3519 it = proto_tree_add_uint(tree, hf_gtp_response_in, tvb, 0, 0, gcrp->rep_frame);
3520 PROTO_ITEM_SET_GENERATED(it);
3524 it = proto_tree_add_uint(tree, hf_gtp_response_to, tvb, 0, 0, gcrp->req_frame);
3525 PROTO_ITEM_SET_GENERATED(it);
3526 nstime_delta(&ns, &pinfo->abs_ts, &gcrp->req_time);
3527 it = proto_tree_add_time(tree, hf_gtp_time, tvb, 0, 0, &ns);
3528 PROTO_ITEM_SET_GENERATED(it);
3529 if (g_gtp_session) {
3530 if (!PINFO_FD_VISITED(pinfo) && gtp_version == 1) {
3532 /* If it does not have any session assigned yet */
3533 session = (guint32 *)g_hash_table_lookup(session_table, &pinfo->num);
3535 session = (guint32 *)g_hash_table_lookup(session_table, &gcrp->req_frame);
3536 if (session != NULL) {
3537 add_gtp_session(pinfo->num, *session);
3541 if (!is_cause_accepted(last_cause, gtp_version)){
3542 /* If the cause is not accepted then we have to remove all the session information about its corresponding request */
3543 remove_frame_info(&gcrp->req_frame);
3554 check_field_presence(guint8 message, guint8 field, int *position)
3558 _gtp_mess_items *mess_items;
3560 switch (gtp_version) {
3562 mess_items = gprs_mess_items;
3565 mess_items = umts_mess_items;
3571 while (mess_items[i].code) {
3572 if (mess_items[i].code == message) {
3574 while (mess_items[i].fields[*position].code) {
3575 if (mess_items[i].fields[*position].code == field) {
3579 if (mess_items[i].fields[*position].presence == GTP_MANDATORY) {
3580 return mess_items[i].fields[(*position)++].code;
3594 /* Decoders of fields in extension headers, each function returns no of bytes from field */
3596 /* GPRS: 9.60 v7.6.0, chapter
3597 * UMTS: 29.060 v4.0, chapter
3601 decode_gtp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args)
3606 cause = tvb_get_guint8(tvb, offset + 1);
3607 if (g_gtp_session) {
3608 args->last_cause = cause;
3610 proto_tree_add_uint(tree, hf_gtp_cause, tvb, offset, 2, cause);
3615 /* GPRS: 9.60 v7.6.0, chapter 7.9.2
3616 * UMTS: 29.060 v4.0, chapter 7.7.2
3619 decode_gtp_imsi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
3621 /* const gchar *imsi_str; */
3623 /* Octets 2 - 9 IMSI */
3624 /* imsi_str = */ dissect_e212_imsi(tvb, pinfo, tree, offset+1, 8, FALSE);
3629 /* GPRS: 9.60 v7.6.0, chapter 7.9.3
3630 * UMTS: 29.060 v4.0, chapter 7.7.3 Routeing Area Identity (RAI)
3633 decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3636 proto_tree *ext_tree_rai;
3638 ext_tree_rai = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtp_ies[GTP_EXT_RAI], NULL,
3639 val_to_str_ext_const(GTP_EXT_RAI, >p_val_ext, "Unknown message"));
3641 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree_rai, offset+1, E212_RAI, TRUE);
3642 proto_tree_add_item(ext_tree_rai, hf_gtp_lac, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
3643 proto_tree_add_item(ext_tree_rai, hf_gtp_rai_rac, tvb, offset + 6, 1, ENC_BIG_ENDIAN);
3648 /* GPRS: 9.60 v7.6.0, chapter 7.9.4, page 39
3649 * UMTS: 29.060 v4.0, chapter 7.7.4 Temporary Logical Link Identity (TLLI)
3652 decode_gtp_tlli(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3657 tlli = tvb_get_ntohl(tvb, offset + 1);
3658 proto_tree_add_uint(tree, hf_gtp_tlli, tvb, offset, 5, tlli);
3663 /* GPRS: 9.60 v7.6.0, chapter 7.9.5, page 39
3664 * UMTS: 29.060 v4.0, chapter 7.7.5 Packet TMSI (P-TMSI)
3667 decode_gtp_ptmsi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3672 ptmsi = tvb_get_ntohl(tvb, offset + 1);
3673 proto_tree_add_uint(tree, hf_gtp_ptmsi, tvb, offset, 5, ptmsi);
3679 * adjust - how many bytes before offset should be highlighted
3682 decode_qos_gprs(tvbuff_t * tvb, int offset, proto_tree * tree, const gchar * qos_str, guint8 adjust)
3685 guint8 spare1, delay, reliability, peak, spare2, precedence, spare3, mean;
3686 proto_tree *ext_tree_qos;
3688 spare1 = tvb_get_guint8(tvb, offset) & GTP_EXT_QOS_SPARE1_MASK;
3689 delay = tvb_get_guint8(tvb, offset) & GTP_EXT_QOS_DELAY_MASK;
3690 reliability = tvb_get_guint8(tvb, offset) & GTP_EXT_QOS_RELIABILITY_MASK;
3691 peak = tvb_get_guint8(tvb, offset + 1) & GTP_EXT_QOS_PEAK_MASK;
3692 spare2 = tvb_get_guint8(tvb, offset + 1) & GTP_EXT_QOS_SPARE2_MASK;
3693 precedence = tvb_get_guint8(tvb, offset + 1) & GTP_EXT_QOS_PRECEDENCE_MASK;
3694 spare3 = tvb_get_guint8(tvb, offset + 2) & GTP_EXT_QOS_SPARE3_MASK;
3695 mean = tvb_get_guint8(tvb, offset + 2) & GTP_EXT_QOS_MEAN_MASK;
3697 ext_tree_qos = proto_tree_add_subtree_format(tree, tvb, offset - adjust, 3 + adjust, ett_gtp_qos, NULL,
3698 "%s: delay: %u, reliability: %u, peak: %u, precedence: %u, mean: %u",
3699 qos_str, (delay >> 3) & 0x07, reliability, (peak >> 4) & 0x0F, precedence, mean);
3702 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare1, tvb, offset, 1, spare1);
3703 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_delay, tvb, offset, 1, delay);
3704 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_reliability, tvb, offset, 1, reliability);
3705 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_peak, tvb, offset + 1, 1, peak);
3706 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare2, tvb, offset + 1, 1, spare2);
3707 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_precedence, tvb, offset + 1, 1, precedence);
3708 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare3, tvb, offset + 2, 1, spare3);
3709 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_mean, tvb, offset + 2, 1, mean);
3715 /* GPRS: 9.60 v7.6.0, chapter 7.9.6, page 39
3719 * TODO: check if length is included: ETSI 4.08 vs 9.60
3722 decode_gtp_qos_gprs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3725 return (1 + decode_qos_gprs(tvb, offset + 1, tree, "Quality of Service", 1));
3729 /* GPRS: 9.60 v7.6.0, chapter 7.9.7, page 39
3730 * UMTS: 29.060 v4.0, chapter 7.7.6 Reordering Required
3733 decode_gtp_reorder(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3738 reorder = tvb_get_guint8(tvb, offset + 1) & 0x01;
3739 proto_tree_add_boolean(tree, hf_gtp_reorder, tvb, offset, 2, reorder);
3744 /* GPRS: 9.60 v7.6.0, chapter 7.9.8, page 40
3745 * 4.08 v7.1.2, chapter 10.5.3.1+
3746 * UMTS: 29.060 v4.0, chapter 7.7.7
3747 * TODO: Add blurb support by registering items in the protocol registration
3750 decode_gtp_auth_tri(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3753 proto_tree *ext_tree_auth_tri;
3755 ext_tree_auth_tri = proto_tree_add_subtree(tree, tvb, offset, 29, ett_gtp_ies[GTP_EXT_AUTH_TRI], NULL,
3756 val_to_str_ext_const(GTP_EXT_AUTH_TRI, >p_val_ext, "Unknown message"));
3758 proto_tree_add_item(ext_tree_auth_tri, hf_gtp_rand, tvb, offset + 1, 16, ENC_NA);
3759 proto_tree_add_item(ext_tree_auth_tri, hf_gtp_sres, tvb, offset + 17, 4, ENC_NA);
3760 proto_tree_add_item(ext_tree_auth_tri, hf_gtp_kc, tvb, offset + 21, 8, ENC_NA);
3762 return 1 + 16 + 4 + 8;
3765 /* GPRS: 9.60 v7.6.0, chapter 7.9.9, page 40
3766 * 9.02 v7.7.0, page 1090
3767 * UMTS: 29.060 v4.0, chapter 7.7.8, page 48
3768 * 29.002 v4.2.1, chapter 17.5, page 268
3771 decode_gtp_map_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3776 map_cause = tvb_get_guint8(tvb, offset + 1);
3777 proto_tree_add_uint(tree, hf_gtp_map_cause, tvb, offset, 2, map_cause);
3782 /* GPRS: 9.60 v7.6.0, chapter 7.9.10, page 41
3783 * UMTS: 29.060 v4.0, chapter 7.7.9, page 48
3786 decode_gtp_ptmsi_sig(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3791 ptmsi_sig = tvb_get_ntoh24(tvb, offset + 1);
3792 proto_tree_add_uint(tree, hf_gtp_ptmsi_sig, tvb, offset, 4, ptmsi_sig);
3797 /* GPRS: 9.60 v7.6.0, chapter 7.9.11, page 41
3798 * UMTS: 29.060 v4.0, chapter 7.7.10, page 49
3801 decode_gtp_ms_valid(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3806 ms_valid = tvb_get_guint8(tvb, offset + 1) & 0x01;
3807 proto_tree_add_boolean(tree, hf_gtp_ms_valid, tvb, offset, 2, ms_valid);
3812 /* GPRS: 9.60 v7.6.0, chapter 7.9.12, page 41
3813 * UMTS: 29.060 v4.0, chapter 7.7.11 Recovery
3816 decode_gtp_recovery(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3821 recovery = tvb_get_guint8(tvb, offset + 1);
3822 proto_tree_add_uint(tree, hf_gtp_recovery, tvb, offset, 2, recovery);
3827 /* GPRS: 9.60 v7.6.0, chapter 7.9.13, page 42
3828 * UMTS: 29.060 v4.0, chapter 7.7.12 Selection Mode
3832 static const gchar *
3833 dissect_radius_selection_mode(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo _U_)
3837 /* Value in ASCII(UTF-8) */
3838 sel_mode = tvb_get_guint8(tvb, 0) - 0x30;
3839 proto_tree_add_uint(tree, hf_gtp_sel_mode, tvb, 0, 1, sel_mode);
3841 return val_to_str_const(sel_mode, sel_mode_type, "Unknown");
3845 decode_gtp_sel_mode(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
3847 proto_tree *ext_tree;
3851 sel_mode = tvb_get_guint8(tvb, offset + 1) & 0x03;
3853 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_gtp_ies[GTP_EXT_SEL_MODE], &te,
3854 val_to_str_ext_const(GTP_EXT_SEL_MODE, >p_val_ext, "Unknown message"));
3855 proto_item_append_text(te, ": %s", val_to_str_const(sel_mode, sel_mode_type, "Unknown"));
3856 proto_tree_add_item(ext_tree, hf_gtp_sel_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
3861 /* GPRS: 9.60 v7.6.0, chapter 7.9.14, page 42
3862 * UMTS: 29.060 v4.0, chapter 7.7.13, page 50
3865 decode_gtp_16(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args)
3868 guint16 ext_flow_label;
3869 guint32 teid_data, *teid;
3871 switch (gtp_version) {
3873 ext_flow_label = tvb_get_ntohs(tvb, offset + 1);
3874 proto_tree_add_uint(tree, hf_gtp_ext_flow_label, tvb, offset, 3, ext_flow_label);
3878 teid_data = tvb_get_ntohl(tvb, offset + 1);
3879 /* We save the teid_data so that we could assignate its corresponding session ID later */
3880 if (g_gtp_session && !PINFO_FD_VISITED(pinfo)) {
3881 args->last_teid = teid_data; /* We save it to track the error indication */
3882 if (!teid_exists(teid_data, args->teid_list)) {
3883 teid = wmem_new(wmem_packet_scope(), guint32);
3885 wmem_list_prepend(args->teid_list, teid);
3888 proto_tree_add_uint(tree, hf_gtp_teid_data, tvb, offset+1, 4, teid_data);
3892 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_field_not_support_in_version,
3893 tvb, offset, 1, "Flow label/TEID Data I : GTP version not supported");
3899 /* GPRS: 9.60 v7.6.0, chapter 7.9.15, page 42
3900 * UMTS: 29.060 v4.0, chapter 7.7.14, page 42
3903 decode_gtp_17(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args)
3910 switch (gtp_version) {
3912 flow_sig = tvb_get_ntohs(tvb, offset + 1);
3913 proto_tree_add_uint(tree, hf_gtp_flow_sig, tvb, offset, 3, flow_sig);
3916 teid_cp = tvb_get_ntohl(tvb, offset + 1);
3917 /* We save the teid_cp so that we could assignate its corresponding session ID later */
3918 if (g_gtp_session && !PINFO_FD_VISITED(pinfo)) {
3919 if (!teid_exists(teid_cp, args->teid_list)) {
3920 teid = wmem_new(wmem_packet_scope(), guint32);
3922 wmem_list_prepend(args->teid_list, teid);
3925 proto_tree_add_uint(tree, hf_gtp_teid_cp, tvb, offset, 5, teid_cp);
3928 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_field_not_support_in_version,
3929 tvb, offset, 1, "Flow label signalling/TEID control plane : GTP version not supported");
3934 /* GPRS: 9.60 v7.6.0, chapter 7.9.16, page 42
3935 * UMTS: 29.060 v4.0, chapter 7.7.15, page 51
3938 decode_gtp_18(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
3943 proto_tree *ext_tree_flow_ii;
3945 switch (gtp_version) {
3947 ext_tree_flow_ii = proto_tree_add_subtree(tree, tvb, offset, 4, ett_gtp_ies[GTP_EXT_FLOW_II], NULL,
3948 val_to_str_ext_const(GTP_EXT_FLOW_II, >p_val_ext, "Unknown message"));
3950 proto_tree_add_item(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3952 flow_ii = tvb_get_ntohs(tvb, offset + 2);
3953 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_flow_ii, tvb, offset + 2, 2, flow_ii);
3957 ext_tree_flow_ii = proto_tree_add_subtree(tree, tvb, offset, 6, ett_gtp_flow_ii, NULL,
3958 val_to_str_ext_const(GTP_EXT_TEID_II, >pv1_val_ext, "Unknown message"));
3960 proto_tree_add_item(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3962 teid_ii = tvb_get_ntohl(tvb, offset + 2);
3963 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_teid_ii, tvb, offset + 2, 4, teid_ii);
3967 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_field_not_support_in_version,
3968 tvb, offset, 1, "Flow data II/TEID Data II : GTP Version not supported");
3974 /* GPRS: 9.60 v7.6.0, chapter 7.9.16A, page 43
3975 * UMTS: 29.060 v4.0, chapter 7.7.16, page 51
3976 * Check if all ms_reason types are included
3979 decode_gtp_19(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
3984 field19 = tvb_get_guint8(tvb, offset + 1);
3986 switch (gtp_version) {
3988 proto_tree_add_uint(tree, hf_gtp_ms_reason, tvb, offset, 2, field19);
3991 proto_tree_add_boolean(tree, hf_gtp_tear_ind, tvb, offset, 2, field19 & 0x01);
3994 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_field_not_support_in_version,
3995 tvb, offset, 1, "Information Element Type = 19 : GTP Version not supported");
4002 /* GPRS: not present
4003 * UMTS: 29.060 v4.0, chapter 7.7.17, page 51
4006 decode_gtp_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4009 proto_tree *ext_tree;
4012 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_gtp_ies[GTP_EXT_NSAPI], &te,
4013 val_to_str_ext_const(GTP_EXT_NSAPI, >p_val_ext, "Unknown message"));
4015 nsapi = tvb_get_guint8(tvb, offset + 1) & 0x0F;
4016 proto_tree_add_item(ext_tree, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
4017 proto_item_append_text(te, ": %u",nsapi);
4022 /* GPRS: not present
4023 * UMTS: 29.060 v4.0, chapter 7.7.18, page 52
4026 decode_gtp_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4031 ranap = tvb_get_guint8(tvb, offset + 1);
4033 if ((ranap > 0) && (ranap <= 64))
4034 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
4035 ranap, "%s (Radio Network Layer Cause) : %s (%u)",
4036 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"),
4037 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
4039 if ((ranap > 64) && (ranap <= 80))
4040 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
4041 ranap, "%s (Transport Layer Cause) : %s (%u)",
4042 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"),
4043 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
4045 if ((ranap > 80) && (ranap <= 96))
4046 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
4047 ranap, "%s (NAS Cause) : %s (%u)",
4048 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"),
4049 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
4051 if ((ranap > 96) && (ranap <= 112))
4052 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
4053 "%s (Protocol Cause) : %s (%u)",
4054 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"),
4055 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
4057 if ((ranap > 112) && (ranap <= 128))
4058 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
4059 "%s (Miscellaneous Cause) : %s (%u)",
4060 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"),
4061 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
4063 if ((ranap > 128) /* && (ranap <= 255) */ )
4064 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
4065 "%s (Non-standard Cause) : %s (%u)",
4066 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, >p_val_ext, "Unknown"),
4067 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
4072 /* GPRS: not present
4073 * UMTS: 29.060 v4.0, chapter 7.7.19, page 52
4076 decode_gtp_rab_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4078 proto_tree *ext_tree_rab_cntxt;
4080 ext_tree_rab_cntxt = proto_tree_add_subtree(tree, tvb, offset, 10, ett_gtp_ies[GTP_EXT_RAB_CNTXT], NULL,
4081 val_to_str_ext_const(GTP_EXT_RAB_CNTXT, >p_val_ext, "Unknown message"));
4083 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
4084 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_dn, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
4085 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_up, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
4086 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_dn, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
4087 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_up, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
4093 /* GPRS: not present
4094 * UMTS: 29.060 v4.0, chapter 7.7.20, page 53
4097 decode_gtp_rp_sms(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4102 rp_sms = tvb_get_guint8(tvb, offset + 1) & 0x07;
4103 proto_tree_add_uint(tree, hf_gtp_rp_sms, tvb, offset, 2, rp_sms);
4108 /* GPRS: not present
4109 * UMTS: 29.060 v4.0, chapter 7.7.21, page 53
4112 decode_gtp_rp(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4115 proto_tree *ext_tree_rp;
4117 guint8 nsapi, rp, spare;
4119 nsapi = tvb_get_guint8(tvb, offset + 1) & 0xF0;
4120 spare = tvb_get_guint8(tvb, offset + 1) & 0x08;
4121 rp = tvb_get_guint8(tvb, offset + 1) & 0x07;
4123 te = proto_tree_add_uint_format(tree, hf_gtp_rp, tvb, offset, 2, rp, "Radio Priority for NSAPI(%u) : %u", nsapi, rp);
4124 ext_tree_rp = proto_item_add_subtree(te, ett_gtp_rp);
4126 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_nsapi, tvb, offset + 1, 1, nsapi);
4127 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_spare, tvb, offset + 1, 1, spare);
4128 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp, tvb, offset + 1, 1, rp);
4133 /* GPRS: not present
4134 * UMTS: 29.060 v4.0, chapter 7.7.22, page 53
4137 decode_gtp_pkt_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4140 proto_tree *ext_tree_pkt_flow_id;
4142 guint8 nsapi, pkt_flow_id;
4144 nsapi = tvb_get_guint8(tvb, offset + 1) & 0x0F;
4145 pkt_flow_id = tvb_get_guint8(tvb, offset + 2);
4147 te = proto_tree_add_uint_format(tree, hf_gtp_pkt_flow_id, tvb, offset, 3, pkt_flow_id, "Packet Flow ID for NSAPI(%u) : %u", nsapi, pkt_flow_id);
4148 ext_tree_pkt_flow_id = proto_item_add_subtree(te, ett_gtp_pkt_flow_id);
4150 proto_tree_add_item(ext_tree_pkt_flow_id, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
4151 proto_tree_add_uint_format(ext_tree_pkt_flow_id, hf_gtp_pkt_flow_id, tvb,
4152 offset + 2, 1, pkt_flow_id, "%s : %u", val_to_str_ext_const(GTP_EXT_PKT_FLOW_ID, >p_val_ext, "Unknown message"), pkt_flow_id);
4157 /* GPRS: not present
4158 * UMTS: 29.060 v4.0, chapter 7.7.23, page 53
4159 * TODO: Differenciate these uints?
4162 decode_gtp_chrg_char(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4167 proto_tree *ext_tree_chrg_char;
4169 chrg_char = tvb_get_ntohs(tvb, offset + 1);
4171 te = proto_tree_add_uint(tree, hf_gtp_chrg_char, tvb, offset, 3, chrg_char);
4172 /*"%s: %x", val_to_str_ext_const (GTP_EXT_CHRG_CHAR, >p_val_ext, "Unknown message"), chrg_char); */
4173 ext_tree_chrg_char = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CHRG_CHAR]);
4175 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_s, tvb, offset + 1, 2, chrg_char);
4176 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_n, tvb, offset + 1, 2, chrg_char);
4177 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_p, tvb, offset + 1, 2, chrg_char);
4178 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_f, tvb, offset + 1, 2, chrg_char);
4179 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_h, tvb, offset + 1, 2, chrg_char);
4180 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_r, tvb, offset + 1, 2, chrg_char);
4185 /* GPRS: not present
4186 * UMTS: 29.060 v4.0, chapter 7.7.24, page
4189 decode_gtp_trace_ref(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4194 trace_ref = tvb_get_ntohs(tvb, offset + 1);
4196 proto_tree_add_uint(tree, hf_gtp_trace_ref, tvb, offset, 3, trace_ref);
4201 /* GPRS: not present
4202 * UMTS: 29.060 v4.0, chapter 7.7.25, page
4205 decode_gtp_trace_type(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4210 trace_type = tvb_get_ntohs(tvb, offset + 1);
4212 proto_tree_add_uint(tree, hf_gtp_trace_type, tvb, offset, 3, trace_type);
4217 /* GPRS: 9.60 v7.6.0, chapter 7.9.16A
4218 * UMTS: 29.060 v4.0, chapter 7.7.25A, page
4221 decode_gtp_ms_reason(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4226 reason = tvb_get_guint8(tvb, offset + 1);
4228 /* Reason for Absence is defined in 3GPP TS 23.040 */
4229 proto_tree_add_uint(tree, hf_gtp_ms_reason, tvb, offset, 2, reason);
4235 * UMTS: 29.060 v6.11.0, chapter 7.7.25B
4236 * Radio Priority LCS
4239 decode_gtp_ra_prio_lcs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4243 proto_tree *ext_tree;
4245 length = tvb_get_ntohs(tvb, offset + 1);
4246 ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RA_PRIO_LCS], NULL,
4247 "%s : ", val_to_str_ext_const(GTP_EXT_RA_PRIO_LCS, >p_val_ext, "Unknown"));
4250 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
4251 offset = offset + 2;
4253 proto_tree_add_item(ext_tree, hf_gtp_ra_prio_lcs, tvb, offset, 1, ENC_BIG_ENDIAN);
4259 /* GPRS: 12.15 v7.6.0, chapter 7.3.3, page 45
4263 decode_gtp_tr_comm(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4268 tr_command = tvb_get_guint8(tvb, offset + 1);
4270 proto_tree_add_uint(tree, hf_gtp_tr_comm, tvb, offset, 2, tr_command);
4275 /* GPRS: 9.60 v7.6.0, chapter 7.9.17, page 43
4276 * UMTS: 29.060 v4.0, chapter 7.7.26, page 55
4279 decode_gtp_chrg_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4284 chrg_id = tvb_get_ntohl(tvb, offset + 1);
4285 proto_tree_add_uint(tree, hf_gtp_chrg_id, tvb, offset, 5, chrg_id);
4290 /* GPRS: 9.60 v7.6.0, chapter 7.9.18, page 43
4291 * UMTS: 29.060 v4.0, chapter 7.7.27, page 55
4294 decode_gtp_user_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
4298 guint8 pdp_typ, pdp_org;
4299 proto_tree *ext_tree_user;
4303 length = tvb_get_ntohs(tvb, offset + 1);
4304 pdp_org = tvb_get_guint8(tvb, offset + 3) & 0x0F;
4305 pdp_typ = tvb_get_guint8(tvb, offset + 4);
4307 ext_tree_user = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length,
4308 ett_gtp_ies[GTP_EXT_USER_ADDR], &te, "%s (%s/%s)",
4309 val_to_str_ext_const(GTP_EXT_USER_ADDR, >p_val_ext, "Unknown message"),
4310 val_to_str_const(pdp_org, pdp_org_type, "Unknown PDP Organization"),
4311 val_to_str_const(pdp_typ, pdp_type, "Unknown PDP Type"));
4313 proto_tree_add_item(ext_tree_user, hf_gtp_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
4314 proto_tree_add_uint(ext_tree_user, hf_gtp_user_addr_pdp_org, tvb, offset + 3, 1, pdp_org);
4315 proto_tree_add_uint(ext_tree_user, hf_gtp_user_addr_pdp_type, tvb, offset + 4, 1, pdp_typ);
4318 if ((pdp_org == 0) && (pdp_typ == 1))
4319 proto_item_append_text(te, " (Point to Point Protocol)");
4320 else if (pdp_typ == 2)
4321 proto_item_append_text(te, " (Octet Stream Protocol)");
4322 } else if (length > 2) {
4325 proto_tree_add_item(ext_tree_user, hf_gtp_user_ipv4, tvb, offset + 5, 4, ENC_BIG_ENDIAN);
4326 proto_item_append_text(te, " : %s", tvb_ip_to_str(tvb, offset + 5));
4329 proto_tree_add_item(ext_tree_user, hf_gtp_user_ipv6, tvb, offset + 5, 16, ENC_NA);
4330 proto_item_append_text(te, " : %s", tvb_ip6_to_str(tvb, offset + 5));
4335 memset(&ipv6, 0, sizeof(ws_in6_addr));
4336 proto_tree_add_item(ext_tree_user, hf_gtp_user_ipv4, tvb, offset + 5, 4, ENC_BIG_ENDIAN);
4337 proto_tree_add_ipv6_format_value(ext_tree_user, hf_gtp_user_ipv6, tvb, offset + 9, 0, &ipv6, "dynamic");
4338 proto_item_append_text(te, " : %s / dynamic", tvb_ip_to_str(tvb, offset + 5));
4339 } else if (length == 18) {
4340 proto_tree_add_ipv4_format_value(ext_tree_user, hf_gtp_user_ipv6, tvb, offset + 5, 0, 0, "dynamic");
4341 proto_tree_add_item(ext_tree_user, hf_gtp_user_ipv6, tvb, offset + 5, 16, ENC_NA);
4342 proto_item_append_text(te, " : dynamic / %s", tvb_ip6_to_str(tvb, offset + 5));
4343 } else if (length == 22) {
4344 proto_tree_add_item(ext_tree_user, hf_gtp_user_ipv4, tvb, offset + 5, 4, ENC_BIG_ENDIAN);
4345 proto_tree_add_item(ext_tree_user, hf_gtp_user_ipv6, tvb, offset + 9, 16, ENC_NA);
4346 proto_item_append_text(te, " : %s / %s", tvb_ip_to_str(tvb, offset + 5),
4347 tvb_ip6_to_str(tvb, offset + 9));
4349 proto_tree_add_expert_format(ext_tree_user, pinfo, &ei_gtp_ext_length_mal, tvb, offset + 3, length, "Wrong length indicated. Expected 6, 18 or 22, got %u", length);
4354 proto_item_append_text(te, " : empty PDP Address");
4360 decode_triplet(tvbuff_t * tvb, int offset, proto_tree * tree, guint16 count)
4363 proto_tree *ext_tree_trip;
4366 for (i = 0; i < count; i++) {
4367 ext_tree_trip = proto_tree_add_subtree_format(tree, tvb, offset + i * 28, 28, ett_gtp_trip, NULL, "Triplet no%x", i);
4369 proto_tree_add_item(ext_tree_trip, hf_gtp_rand, tvb, offset + i * 28, 16, ENC_NA);
4370 proto_tree_add_item(ext_tree_trip, hf_gtp_sres, tvb, offset + i * 28 + 16, 4, ENC_NA);
4371 proto_tree_add_item(ext_tree_trip, hf_gtp_kc, tvb, offset + i * 28 + 20, 8, ENC_NA);
4377 /* adjust - how many bytes before quintuplet should be highlighted
4380 decode_quintuplet(tvbuff_t * tvb, int offset, proto_tree * tree, guint16 count)
4383 proto_tree *ext_tree_quint;
4384 proto_item *te_quint;
4385 guint16 q_offset, i;
4386 guint8 xres_len, auth_len;
4390 for (i = 0; i < count; i++) {
4392 ext_tree_quint = proto_tree_add_subtree_format(tree, tvb, offset, -1,
4393 ett_gtp_quint, &te_quint, "Quintuplet #%x", i + 1);
4395 proto_tree_add_item(ext_tree_quint, hf_gtp_rand, tvb, offset + q_offset, 16, ENC_NA);
4396 q_offset = q_offset + 16;
4397 xres_len = tvb_get_guint8(tvb, offset + q_offset);
4398 proto_tree_add_item(ext_tree_quint, hf_gtp_xres_length, tvb, offset + q_offset, 1, ENC_BIG_ENDIAN);
4400 proto_tree_add_item(ext_tree_quint, hf_gtp_xres, tvb, offset + q_offset, xres_len, ENC_NA);
4401 q_offset = q_offset + xres_len;
4402 proto_tree_add_item(ext_tree_quint, hf_gtp_quintuplet_ciphering_key, tvb, offset + q_offset, 16, ENC_NA);
4403 q_offset = q_offset + 16;
4404 proto_tree_add_item(ext_tree_quint, hf_gtp_quintuplet_integrity_key, tvb, offset + q_offset, 16, ENC_NA);
4405 q_offset = q_offset + 16;
4406 auth_len = tvb_get_guint8(tvb, offset + q_offset);
4407 proto_tree_add_item(ext_tree_quint, hf_gtp_authentication_length, tvb, offset + q_offset, 1, ENC_BIG_ENDIAN);
4409 proto_tree_add_item(ext_tree_quint, hf_gtp_auth, tvb, offset + q_offset, auth_len, ENC_NA);
4411 q_offset = q_offset + auth_len;
4412 proto_item_set_end(te_quint, tvb, offset + q_offset);
4419 /* GPRS: 9.60 v7.6.0, chapter 7.9.19 page
4420 * UMTS: 29.060 v4.0, chapter 7.7.28 page 57
4421 * TODO: - check if for quintuplets first 2 bytes are length, according to AuthQuint
4422 * - finish displaying last 3 parameters
4425 decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
4428 guint16 length, con_len;
4429 guint8 count, sec_mode, len, iei;
4430 proto_tree *ext_tree_mm;
4431 proto_tree *tf_tree = NULL, *con_tree;
4433 ext_tree_mm = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtp_ies[GTP_EXT_MM_CNTXT], NULL,
4434 val_to_str_ext_const(GTP_EXT_MM_CNTXT, >p_val_ext, "Unknown message"));
4437 length = tvb_get_ntohs(tvb, offset + 1);
4444 sec_mode = (tvb_get_guint8(tvb, offset + 4) >> 6) & 0x03;
4445 count = (tvb_get_guint8(tvb, offset + 4) >> 3) & 0x07;
4447 proto_tree_add_item(ext_tree_mm, hf_gtp_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
4448 if (gtp_version == 0)
4453 case 0: /* Used cipher value, UMTS keys and Quintuplets */
4454 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn_ksi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4455 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4456 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4457 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4458 proto_tree_add_item(ext_tree_mm, hf_gtp_ciphering_key_ck, tvb, offset + 5, 16, ENC_NA);
4459 proto_tree_add_item(ext_tree_mm, hf_gtp_integrity_key_ik, tvb, offset + 21, 16, ENC_NA);
4460 proto_tree_add_item(ext_tree_mm, hf_gtp_quintuplets_length, tvb, offset + 37, 2, ENC_BIG_ENDIAN);
4462 offset = offset + decode_quintuplet(tvb, offset + 39, ext_tree_mm, count) + 39;
4466 case 1: /* GSM key and triplets */
4467 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4468 if (gtp_version != 0)
4469 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4471 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4472 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4473 proto_tree_add_item(ext_tree_mm, hf_gtp_ciphering_key_kc, tvb, offset + 5, 8, ENC_NA);
4475 offset = offset + decode_triplet(tvb, offset + 13, ext_tree_mm, count) + 13;
4478 case 2: /* UMTS key and quintuplets */
4479 proto_tree_add_item(ext_tree_mm, hf_gtp_ksi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4480 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4481 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4482 proto_tree_add_item(ext_tree_mm, hf_gtp_ciphering_key_ck, tvb, offset + 5, 16, ENC_NA);
4483 proto_tree_add_item(ext_tree_mm, hf_gtp_integrity_key_ik, tvb, offset + 21, 16, ENC_NA);
4484 proto_tree_add_item(ext_tree_mm, hf_gtp_quintuplets_length, tvb, offset + 37, 2, ENC_BIG_ENDIAN);
4486 offset = offset + decode_quintuplet(tvb, offset + 39, ext_tree_mm, count) + 39;
4489 case 3: /* GSM key and quintuplets */
4490 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4491 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4492 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4493 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4494 proto_tree_add_item(ext_tree_mm, hf_gtp_ciphering_key_kc, tvb, offset + 5, 8, ENC_NA);
4495 proto_tree_add_item(ext_tree_mm, hf_gtp_quintuplets_length, tvb, offset + 13, 2, ENC_BIG_ENDIAN);
4497 offset = offset + decode_quintuplet(tvb, offset + 15, ext_tree_mm, count) + 15;
4505 * 3GPP TS 24.008 10.5.5.6 ( see packet-gsm_a.c )
4507 tf_tree = proto_tree_add_subtree(ext_tree_mm, tvb, offset, 2, ett_gtp_drx, NULL, "DRX Parameter");
4508 de_gmm_drx_param(tvb, tf_tree, pinfo, offset, 2, NULL, 0);
4509 offset = offset + 2;
4511 len = tvb_get_guint8(tvb, offset);
4512 tf_tree = proto_tree_add_subtree(ext_tree_mm, tvb, offset, len + 1, ett_gtp_net_cap, NULL, "MS Network Capability");
4514 proto_tree_add_uint(tf_tree, hf_gtp_ms_network_cap_content_len, tvb, offset, 1, len);
4518 * GPP TS 24.008 10.5.5.12 ( see packet-gsm_a.c )
4520 de_gmm_ms_net_cap(tvb, tf_tree, pinfo, offset, len, NULL, 0);
4521 offset = offset + len;
4523 /* 3GPP TS 29.060 version 9.4.0 Release 9
4524 * The two octets Container Length holds the length of the Container, excluding the Container Length octets.
4525 * Container contains one or several optional information elements as described in the clause "Overview", from the clause
4526 * "General message format and information elements coding" in 3GPP TS 24.008 [5]. For the definition of the IEI see
4527 * table 47a, "IEIs for information elements used in the container". The IMEISV shall, if available, be included in the
4528 * Container. The IMEISV is included in the Mobile identity IE. If Container is not included, its Length field value shall
4529 * be set to 0. If the MS is emergency attached and the MS is UICCless or the IMSI is unauthenticated, the International
4530 * Mobile Equipment Identity (IMEI) shall be used as the MS identity.
4532 * Table 47A: IEIs for information elements used in the container
4533 * IEI Information element
4534 * 0x23 Mobile identity
4536 * NOTE: In 3GPP TS 24.008 [5] the IEI definition is
4537 * message dependent. The table is added to
4538 * have a unique definition in the present
4539 * document for the used IEI in the MMcontext.
4542 con_len = tvb_get_ntohs(tvb, offset);
4543 proto_tree_add_item(ext_tree_mm, hf_gtp_container_length, tvb, offset, 2, ENC_BIG_ENDIAN);
4544 offset = offset + 2;
4549 con_tree = proto_tree_add_subtree(ext_tree_mm, tvb, offset, con_len, ett_gtp_mm_cntxt, NULL, "Container");
4551 iei = tvb_get_guint8(tvb,offset);
4552 ti = proto_tree_add_uint(con_tree, hf_gtp_iei, tvb, offset, 1, iei);
4554 proto_item_append_text(ti, " (Mobile identity)");
4556 len = tvb_get_guint8(tvb,offset);
4557 proto_tree_add_uint(con_tree, hf_gtp_iei_mobile_id_len, tvb, offset, 1, len);
4559 de_mid(tvb, con_tree, pinfo, offset, len, NULL, 0);
4561 expert_add_info(pinfo, ti, &ei_gtp_iei);
4568 /* Function to extract the value of an hexadecimal octet. Only the lower
4569 * nybble will be non-zero in the output.
4574 /* XXX, ws_xton() */
4575 if ((x >= 'a') && (x <= 'f'))
4577 else if ((x >= 'A') && (x <= 'F'))
4579 else if ((x >= '0') && (x <= '9'))
4586 /* Wrapper function to add UTF-8 decoding for QoS attributes in
4590 wrapped_tvb_get_guint8(tvbuff_t * tvb, int offset, int type)
4593 return (hex2dec(tvb_get_guint8(tvb, offset)) << 4 | hex2dec(tvb_get_guint8(tvb, offset + 1)));
4595 return tvb_get_guint8(tvb, offset);
4598 /* WARNING : actually length is coded on 2 octets for QoS profile but on 1 octet for PDP Context!
4599 * so type means length of length :-)
4601 * WARNING :) type does not mean length of length any more... see below for
4605 decode_qos_umts(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, const gchar * qos_str, guint8 type)
4609 guint8 al_ret_priority;
4610 guint8 delay, reliability, peak, precedence, mean, spare1, spare2, spare3;
4611 guint8 traf_class, del_order, del_err_sdu;
4612 guint8 max_sdu_size, max_ul, max_dl, max_ul_ext, max_dl_ext, max_ul_ext2 = 0, max_dl_ext2 = 0;
4613 guint8 res_ber, sdu_err_ratio;
4614 guint8 trans_delay, traf_handl_prio;
4615 guint8 guar_ul, guar_dl, guar_ul_ext, guar_dl_ext, guar_ul_ext2 = 0, guar_dl_ext2 = 0;
4616 guint8 src_stat_desc, sig_ind, spare4;
4617 proto_tree *ext_tree_qos;
4618 int mss, mu, md, gu, gd;
4623 /* Will keep if the input is UTF-8 encoded (as in RADIUS messages).
4624 * If 1, input is *not* UTF-8 encoded (i.e. each input octet corresponds
4625 * to one byte to be dissected).
4626 * If 2, input is UTF-8 encoded (i.e. each *couple* of input octets
4627 * corresponds to one byte to be dissected)
4629 guint8 utf8_type = 1;
4631 /* Will keep the release indicator as indicated in the RADIUS message */
4634 /* In RADIUS messages the QoS has a version field of two octets prepended.
4635 * As of 29.061 v.3.a.0, there is an hyphen between "Release Indicator" and
4636 * <release specific QoS IE UTF-8 encoding>. Even if it sounds rather
4637 * inconsistent and unuseful, I will check hyphen presence here and
4638 * will signal its presence.
4642 /* Will keep the value that will be returned
4648 /* For QoS inside GPRS-CDR messages from GGSN/P-GW */
4649 length = tvb_reported_length(tvb);
4650 ext_tree_qos = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtp_qos, NULL, qos_str);
4651 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_umts_length, tvb, offset, 1, length);
4652 /* QoS inside GPRS-CDR has no length octet, so no extra offset needed */
4656 length = tvb_get_guint8(tvb, offset);
4657 ext_tree_qos = proto_tree_add_subtree(tree, tvb, offset, length + 1, ett_gtp_qos, NULL, qos_str);
4658 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_umts_length, tvb, offset, 1, length);
4660 retval = length + 1;
4663 length = tvb_get_ntohs(tvb, offset + 1);
4664 ext_tree_qos = proto_tree_add_subtree(tree, tvb, offset, length + 3, ett_gtp_qos, NULL, qos_str);
4665 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_umts_length, tvb, offset + 1, 2, length);
4666 offset += 3; /* +1 because of first 0x86 byte for UMTS QoS */
4667 retval = length + 3;
4670 /* For QoS inside RADIUS Client messages from GGSN/P-GW */
4673 /* The field in the RADIUS message is the length of the tvb we were given */
4674 length = tvb_reported_length(tvb);
4675 ext_tree_qos = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtp_qos, NULL, qos_str);
4677 rel_ind = wrapped_tvb_get_guint8(tvb, offset, 2);
4678 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_version, tvb, offset, 2, rel_ind);
4680 /* Hyphen handling */
4681 hyphen = tvb_get_guint8(tvb, offset + 2);
4682 if (hyphen == ((guint8) '-')) {
4683 /* Hyphen is present, put in protocol tree */
4684 proto_tree_add_item(ext_tree_qos, hf_gtp_hyphen_separator, tvb, offset + 2, 1, ENC_NA);
4685 offset++; /* "Get rid" of hyphen */
4688 /* Now, we modify offset here and in order to use type later
4695 /* Fake the length of the IE including the IE id and length octets
4696 * we are actually using it to determine precense of Octet n as counted in
4699 length = retval = length + 2; /* Actually, will be ignored. */
4702 /* XXX - what should we do with the length here? */
4705 ext_tree_qos = NULL;
4709 if ((type == 3) && (rel_ind == 8)) {
4710 /* Release 8 or higher P-GW QoS profile */
4711 static const int * arp_flags[] = {
4712 &hf_gtp_qos_arp_pci,
4714 &hf_gtp_qos_arp_pvi,
4719 arp = wrapped_tvb_get_guint8(tvb, offset, 2);
4720 proto_tree_add_bitmask_value_with_flags(ext_tree_qos, tvb, offset, hf_gtp_qos_arp,
4721 ett_gtp_qos_arp, arp_flags, arp, BMT_NO_APPEND);
4724 qci = wrapped_tvb_get_guint8(tvb, offset, 2);
4725 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_qci, tvb, offset, 2, qci);
4729 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4730 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4731 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4732 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4733 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4734 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_ul_mbr, tvb, offset, 10, br);
4736 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4737 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4738 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4739 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4740 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4741 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_dl_mbr, tvb, offset, 10, br);
4743 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4744 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4745 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4746 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4747 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4748 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_ul_gbr, tvb, offset, 10, br);
4750 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4751 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4752 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4753 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4754 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4755 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_dl_gbr, tvb, offset, 10, br);
4758 apn_ambr = (wrapped_tvb_get_guint8(tvb, offset , 2) << 24) |
4759 (wrapped_tvb_get_guint8(tvb, offset+2, 2) << 16) |
4760 (wrapped_tvb_get_guint8(tvb, offset+4, 2) << 8) |
4761 wrapped_tvb_get_guint8(tvb, offset+6, 2);
4762 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_ul_apn_ambr, tvb, offset, 8, apn_ambr);
4764 apn_ambr = (wrapped_tvb_get_guint8(tvb, offset , 2) << 24) |
4765 (wrapped_tvb_get_guint8(tvb, offset+2, 2) << 16) |
4766 (wrapped_tvb_get_guint8(tvb, offset+4, 2) << 8) |
4767 wrapped_tvb_get_guint8(tvb, offset+6, 2);
4768 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_dl_apn_ambr, tvb, offset, 8, apn_ambr);
4773 /* In RADIUS messages there is no allocation-retention priority
4774 * so I don't need to wrap the following call to tvb_get_guint8
4776 al_ret_priority = tvb_get_guint8(tvb, offset);
4778 /* All calls are wrapped to take into account the possibility that the
4779 * input is UTF-8 encoded. If utf8_type is equal to 1, the final value
4780 * of the offset will be the same as in the previous version of this
4781 * dissector, and the wrapped function will serve as a dumb wrapper;
4782 * otherwise, if utf_8_type is 2, the offset is correctly shifted by
4783 * two bytes for needed shift, and the wrapped function will unencode
4784 * two values from the input.
4786 spare1 = wrapped_tvb_get_guint8(tvb, offset + (1 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SPARE1_MASK;
4787 delay = wrapped_tvb_get_guint8(tvb, offset + (1 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_DELAY_MASK;
4788 reliability = wrapped_tvb_get_guint8(tvb, offset + (1 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_RELIABILITY_MASK;
4789 peak = wrapped_tvb_get_guint8(tvb, offset + (2 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_PEAK_MASK;
4790 spare2 = wrapped_tvb_get_guint8(tvb, offset + (2 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SPARE2_MASK;
4791 precedence = wrapped_tvb_get_guint8(tvb, offset + (2 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_PRECEDENCE_MASK;
4792 spare3 = wrapped_tvb_get_guint8(tvb, offset + (3 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SPARE3_MASK;
4793 mean = wrapped_tvb_get_guint8(tvb, offset + (3 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_MEAN_MASK;
4795 /* In RADIUS messages there is no allocation-retention priority */
4797 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_al_ret_priority, tvb, offset, 1, al_ret_priority);
4799 /* All additions must take care of the fact that QoS fields in RADIUS
4800 * messages are UTF-8 encoded, so we have to use the same trick as above.
4802 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare1, tvb, offset + (1 - 1) * utf8_type + 1, utf8_type, spare1);
4803 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_delay, tvb, offset + (1 - 1) * utf8_type + 1, utf8_type, delay);
4804 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_reliability, tvb, offset + (1 - 1) * utf8_type + 1, utf8_type, reliability);
4805 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_peak, tvb, offset + (2 - 1) * utf8_type + 1, utf8_type, peak);
4806 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare2, tvb, offset + (2 - 1) * utf8_type + 1, utf8_type, spare2);
4807 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_precedence, tvb, offset + (2 - 1) * utf8_type + 1, utf8_type, precedence);
4808 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare3, tvb, offset + (3 - 1) * utf8_type + 1, utf8_type, spare3);
4809 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_mean, tvb, offset + (3 - 1) * utf8_type + 1, utf8_type, mean);
4811 /* TS 24.008 V 7.8.0 10.5.6.5 Quality of service
4812 * The quality of service is a type 4 information element with a minimum length of 14 octets and a maximum length of 18
4813 * octets. The QoS requested by the MS shall be encoded both in the QoS attributes specified in octets 3-5 and in the QoS
4814 * attributes specified in octets 6-14.
4815 * In the MS to network direction and in the network to MS direction the following applies:
4816 * - Octets 15-18 are optional. If octet 15 is included, then octet 16 shall also be included, and octets 17 and 18 may
4818 * - If octet 17 is included, then octet 18 shall also be included.
4819 * - A QoS IE received without octets 6-18, without octets 14-18, without octets 15-18, or without octets 17-18 shall
4820 * be accepted by the receiving entity.
4825 /* See above for the need of wrapping
4829 traf_class = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_TRAF_CLASS_MASK;
4830 del_order = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_DEL_ORDER_MASK;
4831 del_err_sdu = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_DEL_ERR_SDU_MASK;
4832 max_sdu_size = wrapped_tvb_get_guint8(tvb, offset + (5 - 1) * utf8_type + 1, utf8_type);
4833 max_ul = wrapped_tvb_get_guint8(tvb, offset + (6 - 1) * utf8_type + 1, utf8_type);
4834 max_dl = wrapped_tvb_get_guint8(tvb, offset + (7 - 1) * utf8_type + 1, utf8_type);
4835 res_ber = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_RES_BER_MASK;
4836 sdu_err_ratio = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SDU_ERR_RATIO_MASK;
4837 trans_delay = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_TRANS_DELAY_MASK;
4838 traf_handl_prio = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK;
4839 guar_ul = wrapped_tvb_get_guint8(tvb, offset + (10 - 1) * utf8_type + 1, utf8_type);
4841 guar_dl = wrapped_tvb_get_guint8(tvb, offset + (11 - 1) * utf8_type + 1, utf8_type);
4851 if (length > 13 ||((type == 2) && (length == 13))) {
4852 spare4 = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SPARE4_MASK;
4853 sig_ind = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SIG_IND_MASK;
4854 src_stat_desc = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SRC_STAT_DESC_MASK;
4857 max_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (13 - 1) * utf8_type + 1, utf8_type);
4858 guar_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (14 - 1) * utf8_type + 1, utf8_type);
4861 max_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (15 - 1) * utf8_type + 1, utf8_type);
4862 guar_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (16 - 1) * utf8_type + 1, utf8_type);
4865 max_dl_ext2 = wrapped_tvb_get_guint8(tvb, offset + (17 - 1) * utf8_type + 1, utf8_type);
4866 guar_dl_ext2 = wrapped_tvb_get_guint8(tvb, offset + (18 - 1) * utf8_type + 1, utf8_type);
4869 max_ul_ext2 = wrapped_tvb_get_guint8(tvb, offset + (19 - 1) * utf8_type + 1, utf8_type);
4870 guar_ul_ext2 = wrapped_tvb_get_guint8(tvb, offset + (20 - 1) * utf8_type + 1, utf8_type);
4874 * See above comments for the changes
4876 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_class, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, traf_class);
4877 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_order, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, del_order);
4878 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);
4879 if (max_sdu_size == 0 || max_sdu_size > 150)
4880 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);
4881 if ((max_sdu_size > 0) && (max_sdu_size <= 150)) {
4882 mss = max_sdu_size * 10;
4883 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, mss,
4887 if (max_ul == 0 || max_ul == 255)
4888 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul);
4889 if ((max_ul > 0) && (max_ul <= 63))
4890 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul,
4892 if ((max_ul > 63) && (max_ul <= 127)) {
4893 mu = 64 + (max_ul - 64) * 8;
4894 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
4898 if ((max_ul > 127) && (max_ul <= 254)) {
4899 mu = 576 + (max_ul - 128) * 64;
4900 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
4904 if (max_dl == 0 || max_dl == 255)
4905 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl);
4906 if ((max_dl > 0) && (max_dl <= 63))
4907 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl,
4909 if ((max_dl > 63) && (max_dl <= 127)) {
4910 md = 64 + (max_dl - 64) * 8;
4911 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
4914 if ((max_dl > 127) && (max_dl <= 254)) {
4915 md = 576 + (max_dl - 128) * 64;
4916 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
4920 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_res_ber, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, res_ber);
4921 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);
4922 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_trans_delay, tvb, offset + (9 - 1) * utf8_type + 1, utf8_type, trans_delay);
4923 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);
4925 if (guar_ul == 0 || guar_ul == 255)
4926 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul);
4927 if ((guar_ul > 0) && (guar_ul <= 63))
4928 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul,
4929 "%u kbps", guar_ul);
4930 if ((guar_ul > 63) && (guar_ul <= 127)) {
4931 gu = 64 + (guar_ul - 64) * 8;
4932 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
4935 if ((guar_ul > 127) && (guar_ul <= 254)) {
4936 gu = 576 + (guar_ul - 128) * 64;
4937 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
4942 if (guar_dl == 0 || guar_dl == 255)
4943 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl);
4944 if ((guar_dl > 0) && (guar_dl <= 63))
4945 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl,
4946 "%u kbps", guar_dl);
4947 if ((guar_dl > 63) && (guar_dl <= 127)) {
4948 gd = 64 + (guar_dl - 64) * 8;
4949 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
4952 if ((guar_dl > 127) && (guar_dl <= 254)) {
4953 gd = 576 + (guar_dl - 128) * 64;
4954 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
4958 if(length > 13 ||((type == 2) && (length == 13))) {
4959 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare4, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, spare4);
4960 proto_tree_add_boolean(ext_tree_qos, hf_gtp_qos_sig_ind, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, sig_ind);
4961 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_src_stat_desc, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, src_stat_desc);
4967 if ((max_dl_ext > 0) && (max_dl_ext <= 0x4a)) {
4968 md = 8600 + max_dl_ext * 100;
4969 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
4970 "Ext Maximum bit rate for downlink: %u kbps", md);
4972 if ((max_dl_ext > 0x4a) && (max_dl_ext <= 0xba)) {
4973 md = 16 + (max_dl_ext-0x4a);
4974 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
4975 "Ext Maximum bit rate for downlink: %u Mbps", md);
4977 if ((max_dl_ext > 0xba) && (max_dl_ext <= 0xfa)) {
4978 md = 128 + (max_dl_ext-0xba)*2;
4979 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
4980 "Ext Maximum bit rate for downlink: %u Mbps", md);
4983 if(guar_dl_ext == 0)
4984 proto_tree_add_expert_format(ext_tree_qos, pinfo, &ei_gtp_guaranteed_bit_rate_value, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type,
4985 "Use the value indicated by the Guaranteed bit rate for downlink in octet 13");
4986 if ((guar_dl_ext > 0) && (guar_dl_ext <= 0x4a)) {
4987 gd = 8600 + guar_dl_ext * 100;
4988 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
4991 if ((guar_dl_ext > 0x4a) && (max_dl_ext <= 0xba)) {
4992 gd = 16 + (guar_dl_ext-0x4a);
4993 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
4996 if ((guar_dl_ext > 0xba) && (max_dl_ext <= 0xfa)) {
4997 gd = 128 + (guar_dl_ext-0xba)*2;
4998 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
5005 * This field is an extension of the Maximum bit rate for uplink in octet 8. The coding is identical to that of the Maximum bit
5006 * rate for downlink (extended).
5008 if ((max_ul_ext > 0) && (max_ul_ext <= 0x4a)) {
5009 md = 8600 + max_ul_ext * 100;
5010 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5011 "Ext Maximum bit rate for uplink: %u kbps", md);
5013 if ((max_ul_ext > 0x4a) && (max_ul_ext <= 0xba)) {
5014 md = 16 + (max_ul_ext-0x4a);
5015 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5016 "Ext Maximum bit rate for uplink: %u Mbps", md);
5018 if ((max_ul_ext > 0xba) && (max_ul_ext <= 0xfa)) {
5019 md = 128 + (max_ul_ext-0xba)*2;
5020 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5021 "Ext Maximum bit rate for uplink: %u Mbps", md);
5024 if (guar_ul_ext == 0)
5025 proto_tree_add_expert_format(ext_tree_qos, pinfo, &ei_gtp_guaranteed_bit_rate_value, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type,
5026 "Use the value indicated by the Guaranteed bit rate for uplink in octet 12");
5027 if ((guar_ul_ext > 0) && (guar_ul_ext <= 0x4a)) {
5028 gd = 8600 + guar_ul_ext * 100;
5029 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5030 "Ext Guaranteed bit rate for uplink: %u kbps", gd);
5032 if ((guar_ul_ext > 0x4a) && (guar_ul_ext <= 0xba)) {
5033 gd = 16 + (guar_ul_ext-0x4a);
5034 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5035 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
5037 if ((guar_ul_ext > 0xba) && (guar_ul_ext <= 0xfa)) {
5038 gd = 128 + (guar_ul_ext-0xba)*2;
5039 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5040 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
5045 /* Octet 19 Maximum bit rate for downlink (extended-2)
5046 * This field is an extension of the Maximum bit rate for uplink in octet 8. The coding is identical to that of the Maximum bit
5047 * rate for downlink (extended).
5049 if (guar_dl_ext2 == 0)
5050 proto_tree_add_expert_format(ext_tree_qos, pinfo, &ei_gtp_max_bit_rate_value, tvb, offset + (17 - 1) * utf8_type + 1, utf8_type,
5051 "Use the value indicated by the Maximum bit rate for downlink in octet 9 and octet 15.");
5053 if ((max_dl_ext2 > 0) && (max_dl_ext2 <= 0x3d)) {
5054 md = 256 + max_dl_ext2 * 4;
5055 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5056 "Ext Maximum bit rate for downlink: %u Mbps", md);
5058 if ((max_dl_ext2 > 0x3d) && (max_dl_ext2 <= 0xa1)) {
5059 md = 500 + (max_dl_ext2-0x3d) * 10;
5060 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5061 "Ext Maximum bit rate for downlink: %u Mbps", md);
5063 if ((max_dl_ext2 > 0xa1) && (max_dl_ext2 <= 0xf6)) {
5064 md = 1500 + (max_dl_ext2-0xa1)*10;
5065 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5066 "Ext Maximum bit rate for downlink: %u Mbps", md);
5068 /* Octet 20 Guaranteed bit rate for downlink (extended-2) */
5069 if (max_dl_ext2 == 0)
5070 proto_tree_add_expert_format(ext_tree_qos, pinfo, &ei_gtp_max_bit_rate_value, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type,
5071 "Use the value indicated by the Maximum bit rate for downlink in octet 13 and octet 16.");
5072 if ((max_dl_ext2 > 0) && (max_dl_ext2 <= 0x3d)) {
5073 gd = 256 + max_dl_ext2 * 4;
5074 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5075 "Ext Guaranteed bit rate for downlink: %u Mbps", gd);
5077 if ((max_dl_ext2 > 0x3d) && (max_dl_ext2 <= 0xa1)) {
5078 gd = 500 + (max_dl_ext2-0x3d) * 10;
5079 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5080 "Ext Guaranteed bit rate for downlink: %u Mbps", gd);
5082 if ((max_dl_ext2 > 0xba) && (max_dl_ext2 <= 0xfa)) {
5083 gd = 1500 + (max_dl_ext2-0xa1) * 10;
5084 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5085 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
5090 /* Maximum bit rate for uplink (extended-2), octet 21
5091 * This field is an extension of the Maximum bit rate for uplink in octet 8. The coding is identical to that of the Maximum bit
5092 * rate for downlink (extended).
5094 if (guar_ul_ext2 == 0)
5095 proto_tree_add_expert_format(ext_tree_qos, pinfo, &ei_gtp_max_bit_rate_value, tvb, offset + (17 - 1) * utf8_type + 1, utf8_type,
5096 "Use the value indicated by the Maximum bit rate for uplink in octet 9 and octet 15.");
5098 if ((max_ul_ext2 > 0) && (max_ul_ext2 <= 0x3d)) {
5099 md = 256 + max_ul_ext2 * 4;
5100 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5101 "Ext Maximum bit rate for uplink: %u Mbps", md);
5103 if ((max_ul_ext2 > 0x3d) && (max_ul_ext2 <= 0xa1)) {
5104 md = 500 + (max_ul_ext2-0x3d) * 10;
5105 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5106 "Ext Maximum bit rate for uplink: %u Mbps", md);
5108 if ((max_ul_ext2 > 0xa1) && (max_ul_ext2 <= 0xf6)) {
5109 md = 1500 + (max_ul_ext2-0xa1)*10;
5110 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
5111 "Ext Maximum bit rate for uplink: %u Mbps", md);
5113 /* Guaranteed bit rate for uplink (extended-2), octet 22 */
5114 if (max_ul_ext2 == 0)
5115 proto_tree_add_expert_format(ext_tree_qos, pinfo, &ei_gtp_max_bit_rate_value, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type,
5116 "Use the value indicated by the Maximum bit rate for uplink in octet 13 and octet 16.");
5117 if ((max_ul_ext2 > 0) && (max_ul_ext2 <= 0x3d)) {
5118 gd = 256 + max_ul_ext2 * 4;
5119 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5120 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
5122 if ((max_ul_ext2 > 0x3d) && (max_ul_ext2 <= 0xa1)) {
5123 gd = 500 + (max_ul_ext2-0x3d) * 10;
5124 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5125 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
5127 if ((max_ul_ext2 > 0xba) && (max_ul_ext2 <= 0xfa)) {
5128 gd = 1500 + (max_ul_ext2-0xa1) * 10;
5129 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
5130 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
5138 /* Diameter 3GPP AVP Code: 5 3GPP-GPRS Negotiated QoS profile */
5140 dissect_diameter_3gpp_qosprofile(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
5142 decode_qos_umts(tvb, 0, pinfo, tree, "UMTS GTP QoS Profile", 3);
5143 return tvb_reported_length(tvb);
5146 static const gchar *
5147 dissect_radius_qos_umts(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo)
5149 decode_qos_umts(tvb, 0, pinfo, tree, "UMTS GTP QoS Profile", 3);
5150 return tvb_get_string_enc(wmem_packet_scope(), tvb, 0, tvb_reported_length(tvb), ENC_UTF_8|ENC_NA);
5153 #define MAX_APN_LENGTH 100
5156 decode_apn(tvbuff_t * tvb, int offset, guint16 length, proto_tree * tree, proto_item *item)
5158 guint8 str[MAX_APN_LENGTH+1];
5161 /* init buffer and copy it */
5162 memset(str, 0, MAX_APN_LENGTH+1);
5163 tvb_memcpy(tvb, str, offset, length<MAX_APN_LENGTH?length:MAX_APN_LENGTH);
5166 while ((curr_len < length) && (curr_len < MAX_APN_LENGTH))
5168 guint step = str[curr_len];
5169 str[curr_len] = '.';
5173 /* Highlight bytes including the first length byte */
5174 proto_tree_add_string(tree, hf_gtp_apn, tvb, offset, length, str+1);
5176 proto_item_append_text(item, ": %s", str+1);
5182 decode_fqdn(tvbuff_t * tvb, int offset, guint16 length, proto_tree * tree, session_args_t * args _U_)
5184 guint8 *fqdn = NULL;
5188 name_len = tvb_get_guint8(tvb, offset);
5190 if (name_len < 0x20) {
5191 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
5193 if (name_len >= length - 1)
5196 name_len = name_len + fqdn[tmp] + 1;
5200 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
5202 proto_tree_add_string(tree, hf_gtp_fqdn, tvb, offset, length, fqdn);
5207 * GPRS: 9.60 v7.6.0, chapter 7.9.20
5208 * UMTS: 29.060 v4.0, chapter 7.7.29 PDP Context
5209 * TODO: unify addr functions
5212 decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5215 guint8 ggsn_addr_len, apn_len, trans_id, ea;
5216 guint8 pdp_type_num, pdp_addr_len;
5218 proto_tree *ext_tree_pdp;
5220 length = tvb_get_ntohs(tvb, offset + 1);
5222 ext_tree_pdp = proto_tree_add_subtree(tree, tvb, offset, length + 3, ett_gtp_ies[GTP_EXT_PDP_CNTXT], NULL,
5223 val_to_str_ext_const(GTP_EXT_PDP_CNTXT, >p_val_ext, "Unknown message"));
5225 ea = (tvb_get_guint8(tvb, offset + 3) >> 7) & 0x01;
5227 proto_tree_add_item(ext_tree_pdp, hf_gtp_extended_end_user_address, tvb, offset + 3, 1, ENC_NA);
5228 proto_tree_add_item(ext_tree_pdp, hf_gtp_vplmn_address_allowed, tvb, offset + 3, 1, ENC_NA);
5229 proto_tree_add_item(ext_tree_pdp, hf_gtp_activity_status_indicator, tvb, offset + 3, 1, ENC_NA);
5230 proto_tree_add_item(ext_tree_pdp, hf_gtp_reordering_required, tvb, offset + 3, 1, ENC_NA);
5231 proto_tree_add_item(ext_tree_pdp, hf_gtp_nsapi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
5232 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_cntxt_sapi, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
5234 switch (gtp_version) {
5236 decode_qos_gprs(tvb, offset + 5, ext_tree_pdp, "QoS subscribed", 0);
5237 decode_qos_gprs(tvb, offset + 8, ext_tree_pdp, "QoS requested", 0);
5238 decode_qos_gprs(tvb, offset + 11, ext_tree_pdp, "QoS negotiated", 0);
5239 offset = offset + 14;
5242 offset = offset + 5;
5243 offset = offset + decode_qos_umts(tvb, offset, pinfo, ext_tree_pdp, "QoS subscribed", 1);
5244 offset = offset + decode_qos_umts(tvb, offset, pinfo, ext_tree_pdp, "QoS requested", 1);
5245 offset = offset + decode_qos_umts(tvb, offset, pinfo, ext_tree_pdp, "QoS negotiated", 1);
5251 proto_tree_add_item(ext_tree_pdp, hf_gtp_sequence_number_down, tvb, offset, 2, ENC_BIG_ENDIAN);
5252 proto_tree_add_item(ext_tree_pdp, hf_gtp_sequence_number_up, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
5253 proto_tree_add_item(ext_tree_pdp, hf_gtp_send_n_pdu_number, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
5254 proto_tree_add_item(ext_tree_pdp, hf_gtp_receive_n_pdu_number, tvb, offset + 5, 1, ENC_BIG_ENDIAN);
5256 switch (gtp_version) {
5258 proto_tree_add_item(ext_tree_pdp, hf_gtp_uplink_flow_label_signalling, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
5259 offset = offset + 8;
5262 proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_cp, tvb, offset + 6, 4, ENC_BIG_ENDIAN);
5263 proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_data, tvb, offset + 10, 4, ENC_BIG_ENDIAN);
5264 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_context_identifier, tvb, offset + 14, 1, ENC_BIG_ENDIAN);
5265 offset = offset + 15;
5271 pdp_type_num = tvb_get_guint8(tvb, offset + 1);
5272 pdp_addr_len = tvb_get_guint8(tvb, offset + 2);
5274 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_organization, tvb, offset, 1, ENC_BIG_ENDIAN);
5275 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_type, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
5276 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_address_length, tvb, offset + 2, 1, ENC_BIG_ENDIAN);
5278 if (pdp_addr_len > 0) {
5279 switch (pdp_type_num) {
5281 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_address_ipv4, tvb, offset + 3, 4, ENC_BIG_ENDIAN);
5284 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_address_ipv6, tvb, offset + 3, 16, ENC_NA);
5291 offset = offset + 3 + pdp_addr_len;
5293 ggsn_addr_len = tvb_get_guint8(tvb, offset);
5294 proto_tree_add_item(ext_tree_pdp, hf_gtp_ggsn_address_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5296 switch (ggsn_addr_len) {
5298 proto_tree_add_item(ext_tree_pdp, hf_gtp_ggsn_address_for_control_plane, tvb, offset + 1, 4, ENC_BIG_ENDIAN);
5301 proto_tree_add_item(ext_tree_pdp, hf_gtp_ggsn_address_for_user_traffic, tvb, offset + 1, 16, ENC_BIG_ENDIAN);
5307 offset = offset + 1 + ggsn_addr_len;
5309 if (gtp_version == 1) {
5311 ggsn_addr_len = tvb_get_guint8(tvb, offset);
5312 proto_tree_add_item(ext_tree_pdp, hf_gtp_ggsn_2_address_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5314 switch (ggsn_addr_len) {
5316 proto_tree_add_item(ext_tree_pdp, hf_gtp_ggsn_2_address_ipv4, tvb, offset + 1, 4, ENC_BIG_ENDIAN);
5319 proto_tree_add_item(ext_tree_pdp, hf_gtp_ggsn_2_address_ipv6, tvb, offset + 1, 16, ENC_NA);
5324 offset = offset + 1 + ggsn_addr_len;
5328 apn_len = tvb_get_guint8(tvb, offset);
5329 proto_tree_add_item(ext_tree_pdp, hf_gtp_apn_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5330 decode_apn(tvb, offset + 1, apn_len, ext_tree_pdp, NULL);
5332 offset = offset + 1 + apn_len;
5334 * The Transaction Identifier is the 4 or 12 bit Transaction Identifier used in the 3GPP TS 24.008 [5] Session Management
5335 * messages which control this PDP Context. If the length of the Transaction Identifier is 4 bit, the second octet shall be
5336 * set to all zeros. The encoding is defined in 3GPP TS 24.007 [3]. The latest Transaction Identifier sent from SGSN to
5337 * MS is stored in the PDP context IE.
5338 * NOTE: Bit 5-8 of the first octet in the encoding defined in 3GPP TS 24.007 [3] is mapped into bit 1-4 of the first
5339 * octet in this field.
5341 trans_id = tvb_get_guint8(tvb, offset);
5342 proto_tree_add_uint(ext_tree_pdp, hf_gtp_transaction_identifier, tvb, offset, 2, trans_id);
5346 pdp_type_num = tvb_get_guint8(tvb, offset);
5347 pdp_addr_len = tvb_get_guint8(tvb, offset + 1);
5349 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5350 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_address_length, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
5352 if (pdp_addr_len > 0) {
5353 switch (pdp_type_num) {
5355 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_address_ipv4, tvb, offset + 2, 4, ENC_NA);
5358 proto_tree_add_item(ext_tree_pdp, hf_gtp_pdp_address_ipv6, tvb, offset + 2, 16, ENC_NA);
5369 /* GPRS: 9.60, v7.6.0, chapter 7.9.21
5370 * UMTS: 29.060, v4.0, chapter 7.7.30
5373 decode_gtp_apn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5377 proto_tree *ext_tree_apn;
5380 length = tvb_get_ntohs(tvb, offset + 1);
5382 ext_tree_apn = proto_tree_add_subtree(tree, tvb, offset, length + 3, ett_gtp_ies[GTP_EXT_APN], &te,
5383 val_to_str_ext_const(GTP_EXT_APN, >p_val_ext, "Unknown field"));
5385 proto_tree_add_item(ext_tree_apn, hf_gtp_apn_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
5386 decode_apn(tvb, offset + 3, length, ext_tree_apn, te);
5391 /* GPRS: 9.60 v7.6.0, chapter 7.9.22
5392 * 4.08 v. 7.1.2, chapter 10.5.6.3 (p.580)
5393 * UMTS: 29.060 v4.0, chapter 7.7.31 Protocol Configuration Options
5394 * 24.008, v4.2, chapter 10.5.6.3
5397 decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
5402 proto_tree *ext_tree_proto;
5404 length = tvb_get_ntohs(tvb, offset + 1);
5406 ext_tree_proto = proto_tree_add_subtree(tree, tvb, offset, length + 3,
5407 ett_gtp_proto, NULL, val_to_str_ext_const(GTP_EXT_PROTO_CONF, >p_val_ext, "Unknown message"));
5409 proto_tree_add_uint(ext_tree_proto, hf_gtp_length, tvb, offset + 1, 2, length);
5414 /* The Protocol Configuration Options contains external network protocol options that may be necessary to transfer
5415 * between the GGSN and the MS. The content and the coding of the Protocol Configuration are defined in octet 3-z of the
5416 * Protocol Configuration Options in3GPP TS 24.008 [5].
5418 next_tvb = tvb_new_subset_length(tvb, offset + 3, length);
5419 de_sm_pco(next_tvb, ext_tree_proto, pinfo, 0, length, NULL, 0);
5424 /* GPRS: 9.60 v7.6.0, chapter 7.9.23
5425 * UMTS: 29.060 v4.0, chapter 7.7.32
5428 decode_gtp_gsn_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args)
5431 guint8 addr_type, addr_len;
5433 proto_tree *ext_tree_gsn_addr;
5435 address *gsn_address;
5437 length = tvb_get_ntohs(tvb, offset + 1);
5439 ext_tree_gsn_addr = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_gsn_addr, &te, "GSN address : ");
5440 gsn_address = wmem_new0(wmem_packet_scope(), address);
5443 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_address_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
5444 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_ipv4, tvb, offset + 3, 4, ENC_BIG_ENDIAN);
5445 proto_item_append_text(te, "%s", tvb_ip_to_str(tvb, offset + 3));
5446 set_address_tvb(gsn_address, AT_IPv4, 4, tvb, offset + 3);
5449 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_address_information_element_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
5450 addr_type = tvb_get_guint8(tvb, offset + 3) & 0xC0;
5451 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_type, tvb, offset + 3, 1, addr_type);
5452 addr_len = tvb_get_guint8(tvb, offset + 3) & 0x3F;
5453 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_len, tvb, offset + 3, 1, addr_len);
5454 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_ipv4, tvb, offset + 4, 4, ENC_BIG_ENDIAN);
5455 proto_item_append_text(te, "%s", tvb_ip_to_str(tvb, offset + 4));
5456 set_address_tvb(gsn_address, AT_IPv6, 16, tvb, offset + 4);
5459 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_address_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
5460 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_ipv6, tvb, offset + 3, 16, ENC_NA);
5461 proto_item_append_text(te, "%s", tvb_ip6_to_str(tvb, offset + 3));
5462 set_address_tvb(gsn_address, AT_IPv4, 4, tvb, offset + 3);
5465 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_address_information_element_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
5466 addr_type = tvb_get_guint8(tvb, offset + 3) & 0xC0;
5467 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_type, tvb, offset + 3, 1, addr_type);
5468 addr_len = tvb_get_guint8(tvb, offset + 3) & 0x3F;
5469 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_len, tvb, offset + 3, 1, addr_len);
5470 proto_item_append_text(te, "%s", tvb_ip6_to_str(tvb, offset + 4));
5471 proto_tree_add_item(ext_tree_gsn_addr, hf_gtp_gsn_ipv6, tvb, offset + 4, 16, ENC_NA);
5472 set_address_tvb(gsn_address, AT_IPv6, 16, tvb, offset + 4);
5475 proto_item_append_text(te, "unknown type or wrong length");
5479 if (g_gtp_session && gtp_version == 1 && !PINFO_FD_VISITED(pinfo)) {
5480 if (!ip_exists(*gsn_address, args->ip_list)) {
5481 copy_address_wmem(wmem_packet_scope(), &args->last_ip, gsn_address);
5482 wmem_list_prepend(args->ip_list, gsn_address);
5488 /* GPRS: 9.60 v7.6.0, chapter 7.9.24
5489 * UMTS: 29.060 v4.0, chapter 7.7.33
5492 decode_gtp_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
5496 proto_tree *ext_tree_proto;
5498 length = tvb_get_ntohs(tvb, offset + 1);
5500 ext_tree_proto = proto_tree_add_subtree(tree, tvb, offset, length + 3, ett_gtp_proto, NULL,
5501 val_to_str_ext_const(GTP_EXT_MSISDN, >p_val_ext, "Unknown message"));
5503 proto_tree_add_uint(ext_tree_proto, hf_gtp_length, tvb, offset + 1, 2, length);
5505 length = tvb_get_ntohs(tvb, offset + 1);
5510 next_tvb = tvb_new_subset_length(tvb, offset+3, length);
5511 dissect_gsm_map_msisdn(next_tvb, pinfo, ext_tree_proto);
5516 /* GPRS: not present
5517 * UMTS: 29.060 v4.0, chapter 7.7.34
5518 * 24.008 v4.2, chapter 10.5.6.5
5521 decode_gtp_qos_umts(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
5524 return decode_qos_umts(tvb, offset, pinfo, tree, "Quality of Service", 2);
5527 /* GPRS: not present
5528 * UMTS: 29.060 v4.0, chapter 7.7.35
5531 decode_gtp_auth_qui(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5534 proto_tree *ext_tree;
5536 guint8 xres_len, auth_len;
5539 length = tvb_get_ntohs(tvb, offset + 1);
5541 ext_tree = proto_tree_add_subtree(tree, tvb, offset, length + 1, ett_gtp_quint, NULL, "Quintuplet");
5544 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5545 offset = offset + 2;
5547 proto_tree_add_item(ext_tree, hf_gtp_rand, tvb, offset, 16, ENC_NA);
5548 offset = offset + 16;
5549 xres_len = tvb_get_guint8(tvb, offset);
5550 proto_tree_add_item(ext_tree, hf_gtp_xres_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5552 proto_tree_add_item(ext_tree, hf_gtp_xres, tvb, offset, xres_len, ENC_NA);
5553 offset = offset + xres_len;
5554 proto_tree_add_item(ext_tree, hf_gtp_quintuplet_ciphering_key, tvb, offset, 16, ENC_NA);
5555 offset = offset + 16;
5556 proto_tree_add_item(ext_tree, hf_gtp_quintuplet_integrity_key, tvb, offset, 16, ENC_NA);
5557 offset = offset + 16;
5558 auth_len = tvb_get_guint8(tvb, offset);
5559 proto_tree_add_item(ext_tree, hf_gtp_authentication_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5561 proto_tree_add_item(ext_tree, hf_gtp_auth, tvb, offset, auth_len, ENC_NA);
5563 return (3 + length);
5567 /* GPRS: not present
5568 * UMTS: 29.060 v4.0, chapter 7.7.36
5569 * 24.008 v4.2, chapter 10.5.6.12
5572 decode_gtp_tft(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5574 proto_tree *ext_tree_tft;
5577 length = tvb_get_ntohs(tvb, offset + 1);
5579 ext_tree_tft = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_tft, NULL, "Traffic flow template");
5580 proto_tree_add_item(ext_tree_tft, hf_gtp_tft_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
5582 /* The detailed coding of Traffic Flow Template
5583 * Description is specified in 3GPP TS 24.008 [5] ,
5584 * clause 10.5.6.12, beginning with octet 3..
5585 * Use the decoding in packet-gsm_a_gm.c
5587 de_sm_tflow_temp(tvb, ext_tree_tft, pinfo, offset + 3, length, NULL, 0);
5592 /* GPRS: not present
5593 * UMTS: 3GPP TS 29.060 version 10.4.0 Release 10, chapter 7.7.37
5594 * Type = 138 (Decimal)
5595 * 25.413(RANAP) TargetID
5596 * There are several CRs to to this IE make sure to check with a recent spec if dissection is questioned.
5599 decode_gtp_target_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
5603 proto_tree *ext_tree;
5606 length = tvb_get_ntohs(tvb, offset + 1);
5608 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_TARGET_ID], NULL, "Target Identification");
5609 offset = offset + 1;
5610 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5611 offset = offset + 2;
5616 /* Quote from specification:
5617 * The Target Identification information element contains the identification of a target RNC. Octets 4-n shall contain a
5618 * non-transparent copy of the corresponding IEs (see subclause 7.7.2) and be encoded as specified in Figure 51 below.
5619 * The "Target RNC-ID" part of the "Target ID" parameter is specified in 3GPP TS 25.413 [7].
5620 * NOTE 1: The ASN.1 parameter "Target ID" is forwarded non-transparently in order to maintain backward compatibility.
5621 * NOTE 2: The preamble of the "Target RNC-ID" (numerical value of e.g. 0x20) however shall not be included in
5622 * octets 4-n. Also the optional "iE-Extensions" parameter shall not be included into the GTP IE.
5624 /* Octet 4-6 MCC + MNC */
5626 /* Patch for systems still not following NOTE 2 */
5627 proto_tree_add_expert_format(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, 1, "Not Compliant with 3GPP TS 29.060 7.7.37: The preamble of the \"Target RNC-ID\" (numerical value of e.g. 0x20) however shall not be included in octets 4-n.");
5629 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree, offset, E212_NONE, FALSE);
5631 /* Following Standards */
5632 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree, offset, E212_NONE, TRUE);
5637 proto_tree_add_item(ext_tree, hf_gtp_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
5640 proto_tree_add_item(ext_tree, hf_gtp_rai_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
5642 /* Octet 10-11 RNC-ID*/
5643 proto_tree_add_item(ext_tree, hf_gtp_target_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5645 /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
5646 * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
5649 proto_tree_add_item(ext_tree, hf_gtp_target_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5656 /* GPRS: not present
5657 * UMTS: 29.060 v4.0, chapter 7.7.38
5660 decode_gtp_utran_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5664 proto_tree *ext_tree;
5666 proto_tree *sub_tree;
5668 length = tvb_get_ntohs(tvb, offset + 1);
5670 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_UTRAN_CONT], NULL, "UTRAN transparent Container");
5672 offset = offset + 1;
5673 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5674 offset = offset + 2;
5675 proto_tree_add_item(ext_tree, hf_gtp_utran_field, tvb, offset, length, ENC_NA);
5677 switch (pinfo->link_dir) {
5679 sub_tree = proto_tree_add_subtree(ext_tree, tvb, offset, length, ett_gtp_utran_cont, NULL, "Source RNC to Target RNC Transparent Container");
5680 new_tvb = tvb_new_subset_remaining(tvb, offset);
5681 dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5684 sub_tree = proto_tree_add_subtree(ext_tree, tvb, offset, length, ett_gtp_utran_cont, NULL, "Target RNC to Source RNC Transparent Container");
5685 new_tvb = tvb_new_subset_remaining(tvb, offset);
5686 dissect_ranap_TargetRNC_ToSourceRNC_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5697 /* GPRS: not present
5698 * UMTS: 29.060 v4.0, chapter 7.7.39
5701 decode_gtp_rab_setup(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5706 proto_tree *ext_tree_rab_setup;
5708 length = tvb_get_ntohs(tvb, offset + 1);
5710 ext_tree_rab_setup = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_rab_setup, NULL, "Radio Access Bearer Setup Information");
5712 proto_tree_add_item(ext_tree_rab_setup, hf_gtp_rab_setup_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
5713 proto_tree_add_item(ext_tree_rab_setup, hf_gtp_nsapi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
5717 teid = tvb_get_ntohl(tvb, offset + 4);
5719 proto_tree_add_uint(ext_tree_rab_setup, hf_gtp_teid_data, tvb, offset + 4, 4, teid);
5723 proto_tree_add_item(ext_tree_rab_setup, hf_gtp_rnc_ipv4, tvb, offset + 8, 4, ENC_BIG_ENDIAN);
5726 proto_tree_add_item(ext_tree_rab_setup, hf_gtp_rnc_ipv6, tvb, offset + 8, 16, ENC_NA);
5737 /* GPRS: not present
5738 * UMTS: 29.060 v4.0, chapter 7.7.40
5741 decode_gtp_hdr_list(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5746 proto_tree *ext_tree_hdr_list;
5748 length = tvb_get_guint8(tvb, offset + 1);
5750 ext_tree_hdr_list = proto_tree_add_subtree(tree, tvb, offset, 2 + length, ett_gtp_hdr_list, NULL,
5751 val_to_str_ext_const(GTP_EXT_HDR_LIST, >p_val_ext, "Unknown"));
5753 proto_tree_add_item(ext_tree_hdr_list, hf_gtp_num_ext_hdr_types, tvb, offset + 1, 1, ENC_NA);
5755 for (i = 0; i < length; i++) {
5756 hdr = tvb_get_guint8(tvb, offset + 2 + i);
5758 proto_tree_add_uint_format(ext_tree_hdr_list, hf_gtp_ext_hdr_type, tvb, offset + 2 + i, 1, hdr, "No. %u --> Extension Header Type value : %s (0x%02x)", i + 1,
5759 val_to_str_const(hdr, next_extension_header_fieldvals, "Unknown Extension Header Type"), hdr);
5765 /* GPRS: not present
5766 * UMTS: 29.060 v4.0, chapter 7.7.41
5767 * TODO: find TriggerID description
5770 decode_gtp_trigger_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5775 length = tvb_get_ntohs(tvb, offset + 1);
5777 ti = proto_tree_add_uint_format(tree, hf_gtp_ext_length, tvb, offset, 2, length, "%s length : %u",
5778 val_to_str_ext_const(GTP_EXT_TRIGGER_ID, >p_val_ext, "Unknown"), length);
5779 proto_item_set_len(ti, 3 + length);
5785 /* GPRS: not present
5786 * UMTS: 29.060 v4.0, chapter 7.7.42
5787 * TODO: find OMC-ID description
5790 decode_gtp_omc_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5795 length = tvb_get_ntohs(tvb, offset + 1);
5797 ti = proto_tree_add_uint_format(tree, hf_gtp_ext_length, tvb, offset, 2, length, "%s length : %u",
5798 val_to_str_ext_const(GTP_EXT_OMC_ID, >p_val_ext, "Unknown"), length);
5799 proto_item_set_len(ti, 3 + length);
5805 /* GPRS: 9.60 v7.6.0, chapter 7.9.25
5806 * UMTS: 29.060 v6.11.0, chapter 7.7.44 Charging Gateway Address
5809 decode_gtp_chrg_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5813 proto_tree *ext_tree_chrg_addr;
5816 length = tvb_get_ntohs(tvb, offset + 1);
5818 ext_tree_chrg_addr = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CHRG_ADDR], &te,
5819 "%s : ", val_to_str_ext_const(GTP_EXT_CHRG_ADDR, >p_val_ext, "Unknown"));
5821 proto_tree_add_uint_format(ext_tree_chrg_addr, hf_gtp_ext_length, tvb, offset + 1, 2, length,
5822 "%s length : %u", val_to_str_ext_const(GTP_EXT_CHRG_ADDR, >p_val_ext, "Unknown"), length);
5826 proto_tree_add_item(ext_tree_chrg_addr, hf_gtp_chrg_ipv4, tvb, offset + 3, 4, ENC_BIG_ENDIAN);
5827 proto_item_append_text(te, "%s", tvb_ip_to_str(tvb, offset + 3));
5830 proto_tree_add_item(ext_tree_chrg_addr, hf_gtp_chrg_ipv6, tvb, offset + 3, 16, ENC_NA);
5831 proto_item_append_text(te, "%s", tvb_ip6_to_str(tvb, offset + 3));
5834 proto_item_append_text(te, "unknown type or wrong length");
5842 * UMTS: 29.060 V9.4.0, chapter 7.7.43 RAN Transparent Container
5843 * The information in the value part of the RAN Transparent Container IE contains all information elements (starting with
5844 * and including the BSSGP "PDU Type") in either of the RAN INFORMATION, RAN INFORMATION REQUEST,
5845 * RAN INFORMATION ACK or RAN INFORMATION ERROR messages respectively as specified in 3GPP TS 48.018
5848 decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
5852 proto_tree *ext_tree;
5855 length = tvb_get_ntohs(tvb, offset + 1);
5856 ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RAN_TR_CONT], NULL,
5857 "%s : ", val_to_str_ext_const(GTP_EXT_RAN_TR_CONT, >p_val_ext, "Unknown"));
5860 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5861 offset = offset + 2;
5863 next_tvb = tvb_new_subset_length(tvb, offset, length);
5866 col_set_fence(pinfo->cinfo, COL_INFO);
5868 call_dissector(bssgp_handle, next_tvb, pinfo, ext_tree);
5876 * UMTS: 29.060 v6.11.0, chapter 7.7.45 PDP Context Prioritization
5879 decode_gtp_pdp_cont_prio(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
5883 proto_tree *ext_tree;
5885 length = tvb_get_ntohs(tvb, offset + 1);
5886 ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_PDP_CONT_PRIO], NULL,
5887 "%s : ", val_to_str_ext_const(GTP_EXT_PDP_CONT_PRIO, >p_val_ext, "Unknown"));
5894 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5895 offset = offset + 2;
5896 /* TODO add decoding of data */
5897 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
5904 * UMTS: 29.060 v6.11.0, chapter 7.7.45A Additional RAB Setup Information
5907 decode_gtp_add_rab_setup_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5911 proto_tree *ext_tree;
5913 length = tvb_get_ntohs(tvb, offset + 1);
5914 ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ADD_RAB_SETUP_INF], NULL,
5915 "%s : ", val_to_str_ext_const(GTP_EXT_ADD_RAB_SETUP_INF, >p_val_ext, "Unknown"));
5918 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5919 offset = offset + 2;
5920 /* TODO add decoding of data */
5921 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
5929 * UMTS: 29.060 v6.11.0, chapter 7.7.47 SGSN Number
5932 decode_gtp_ssgn_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5936 proto_tree *ext_tree;
5938 length = tvb_get_ntohs(tvb, offset + 1);
5939 ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_SSGN_NO], NULL,
5940 "%s : ", val_to_str_ext_const(GTP_EXT_SSGN_NO, >p_val_ext, "Unknown"));
5943 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5944 offset = offset + 2;
5945 /* TODO add decoding of data */
5946 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
5953 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.48 Common Flags
5956 decode_gtp_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
5960 proto_tree *ext_tree;
5962 length = tvb_get_ntohs(tvb, offset + 1);
5963 ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_COMMON_FLGS], NULL,
5964 "%s : ", val_to_str_ext_const(GTP_EXT_COMMON_FLGS, >p_val_ext, "Unknown"));
5967 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5968 offset = offset + 2;
5969 /* Dual Address Bearer Flag */
5970 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_dual_addr_bearer_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5971 /* Upgrade QoS Supported */
5972 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_upgrd_qos_sup, tvb, offset, 1, ENC_BIG_ENDIAN);
5973 /* NRSN bit field */
5974 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_nrsn, tvb, offset, 1, ENC_BIG_ENDIAN);
5975 /* No QoS negotiation */
5976 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_no_qos_neg, tvb, offset, 1, ENC_BIG_ENDIAN);
5977 /* MBMS Counting Information bi */
5978 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_cnt_inf, tvb, offset, 1, ENC_BIG_ENDIAN);
5979 /* RAN Procedures Ready */
5980 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_ran_pcd_rdy, tvb, offset, 1, ENC_BIG_ENDIAN);
5981 /* MBMS Service Type */
5982 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_srv_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5983 /* Prohibit Payload Compression */
5984 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_ppc, tvb, offset, 1, ENC_BIG_ENDIAN);
5991 * UMTS: 29.060 v6.11.0, chapter 7.7.49
5994 decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
5998 proto_tree *ext_tree_apn_res;
6000 length = tvb_get_ntohs(tvb, offset + 1);
6001 ext_tree_apn_res = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_APN_RES], NULL,
6002 "%s : ", val_to_str_ext_const(GTP_EXT_APN_RES, >p_val_ext, "Unknown"));
6005 proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6006 offset = offset + 2;
6008 /* Restriction Type value */
6010 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_ext_length_mal, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length);
6014 proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_apn_res, tvb, offset, length, ENC_BIG_ENDIAN);
6019 * UMTS: 29.060 v6.11.0, chapter 7.7.50 RAT Type
6021 * Type = 151 (Decimal)
6025 decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
6029 proto_tree *ext_tree_rat_type;
6032 length = tvb_get_ntohs(tvb, offset + 1);
6033 ext_tree_rat_type = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RAT_TYPE], &te,
6034 val_to_str_ext_const(GTP_EXT_RAT_TYPE, >p_val_ext, "Unknown"));
6037 proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6038 offset = offset + 2;
6040 /* RAT Type value */
6042 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_ext_length_mal, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length);
6046 proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_rat_type, tvb, offset, length, ENC_BIG_ENDIAN);
6047 proto_item_append_text(te, ": %s", val_to_str_const(tvb_get_guint8(tvb,offset), gtp_ext_rat_type_vals, "Unknown"));
6053 * UMTS: 29.060 v6.11.0, chapter 7.7.51
6054 * User Location Information
6055 * Type = 152 (Decimal)
6059 gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo)
6063 guint8 geo_loc_type;
6064 guint16 length = tvb_reported_length(tvb);
6067 /* Geographic Location Type */
6068 geo_loc_type = tvb_get_guint8(tvb, offset);
6069 ti = proto_tree_add_uint(tree, hf_gtp_uli_geo_loc_type, tvb, offset, 1, geo_loc_type);
6072 switch(geo_loc_type) {
6074 /* Geographic Location field included and it holds the Cell Global
6075 * Identification (CGI) of where the user currently is registered.
6076 * CGI is defined in sub-clause 4.3.1 of 3GPP TS 23.003 [2].
6078 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_CGI, TRUE);
6080 proto_tree_add_item(tree, hf_gtp_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
6082 proto_tree_add_item(tree, hf_gtp_cgi_ci, tvb, offset, 2, ENC_BIG_ENDIAN);
6085 /* Geographic Location field included and it holds the Service
6086 * Area Identity (SAI) of where the user currently is registered.
6087 * SAI is defined in sub-clause 9.2.3.9 of 3GPP TS 25.413 [7].
6089 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_SAI, TRUE);
6091 proto_tree_add_item(tree, hf_gtp_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
6093 proto_tree_add_item(tree, hf_gtp_sai_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
6096 /* Geographic Location field included and it holds the Routing
6097 * Area Identification (RAI) of where the user currently is
6098 * registered. RAI is defined in sub-clause 4.2 of 3GPP TS 23.003
6101 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_RAI, TRUE);
6103 proto_tree_add_item(tree, hf_gtp_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
6105 proto_tree_add_item(tree, hf_gtp_rai_rac, tvb, offset, 2, ENC_BIG_ENDIAN);
6108 /* Geographic Location field included and it holds the Tracking
6109 * Area Identity (TAI) of where the user currently is registered.
6110 * TAI is defined in sub-clause 8.21.4 of 3GPP TS 29.274.
6112 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_TAI, TRUE);
6114 proto_tree_add_item(tree, hf_gtp_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6117 /* Geographic Location field included and it holds the E-UTRAN Cell
6118 * Global Identifier (ECGI) of where the user currently is registered.
6119 * ECGI is defined in sub-clause 8.21.5 of 3GPP TS 29.274.
6121 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_ECGI, TRUE);
6123 proto_tree_add_item(tree, hf_gtp_eci, tvb, offset, 4, ENC_BIG_ENDIAN);
6126 /* Geographic Location field included and it holds the Tracking
6127 * Area Identity (TAI) and E-UTRAN CellGlobal Identifier (ECGI)
6128 * of where the user currently is registered.
6129 * TAI is defined in sub-clause 8.21.4 of 3GPP TS 29.274.
6130 * ECGI is defined in sub-clause 8.21.5 of 3GPP TS 29.274.
6132 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_TAI, TRUE);
6134 proto_tree_add_item(tree, hf_gtp_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6136 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_ECGI, TRUE);
6138 proto_tree_add_item(tree, hf_gtp_eci, tvb, offset, 4, ENC_BIG_ENDIAN);
6141 expert_add_info(pinfo, ti, &ei_gtp_ext_geo_loc_type);
6145 return tvb_bytes_to_str(wmem_packet_scope(), tvb, 0, length);
6149 * 7.7.51 User Location Information
6153 dissect_gtp_uli(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
6155 guint8 geo_loc_type;
6158 /* Geographic Location Type */
6159 geo_loc_type = tvb_get_guint8(tvb, offset);
6160 ti = proto_tree_add_uint(tree, hf_gtp_uli_geo_loc_type, tvb, offset, 1, geo_loc_type);
6164 switch(geo_loc_type) {
6166 /* Geographic Location field included and it holds the Cell Global
6167 * Identification (CGI) of where the user currently is registered.
6168 * CGI is defined in sub-clause 4.3.1 of 3GPP TS 23.003 [2].
6170 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_CGI, TRUE);
6172 proto_tree_add_item(tree, hf_gtp_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
6174 proto_tree_add_item(tree, hf_gtp_cgi_ci, tvb, offset, 2, ENC_BIG_ENDIAN);
6177 /* Geographic Location field included and it holds the Service
6178 * Area Identity (SAI) of where the user currently is registered.
6179 * SAI is defined in sub-clause 9.2.3.9 of 3GPP TS 25.413 [7].
6181 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_SAI, TRUE);
6183 proto_tree_add_item(tree, hf_gtp_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
6185 proto_tree_add_item(tree, hf_gtp_sai_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
6188 /* Geographic Location field included and it holds the Routing
6189 * Area Identification (RAI) of where the user currently is
6190 * registered. RAI is defined in sub-clause 4.2 of 3GPP TS 23.003
6193 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_RAI, TRUE);
6195 proto_tree_add_item(tree, hf_gtp_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
6197 proto_tree_add_item(tree, hf_gtp_rai_rac, tvb, offset, 2, ENC_BIG_ENDIAN);
6200 expert_add_info(pinfo, ti, &ei_gtp_ext_geo_loc_type);
6206 decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
6210 proto_tree *ext_tree;
6212 length = tvb_get_ntohs(tvb, offset + 1);
6213 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_USR_LOC_INF], NULL,
6214 val_to_str_ext_const(GTP_EXT_USR_LOC_INF, >p_val_ext, "Unknown"));
6217 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6218 offset = offset + 2;
6220 dissect_gtp_uli(tvb, offset, pinfo, ext_tree, args);
6225 static const value_string daylight_saving_time_vals[] = {
6226 {0, "No adjustment"},
6227 {1, "+1 hour adjustment for Daylight Saving Time"},
6228 {2, "+2 hours adjustment for Daylight Saving Time"},
6234 * UMTS: 29.060 v6.11.0, chapter 7.7.52
6236 * Type = 153 (Decimal)
6237 * The ' MS Time Zone' IE is used to indicate the offset between universal time and local time
6238 * in steps of 15 minutes of where the MS currently resides. The 'Time Zone' field uses the same
6239 * format as the 'Time Zone' IE in 3GPP TS 24.008 (10.5.3.8)
6240 * its value shall be set as defined in 3GPP TS 22.042
6243 decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6247 proto_tree *ext_tree;
6252 length = tvb_get_ntohs(tvb, offset + 1);
6253 ext_tree = proto_tree_add_subtree_format(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MS_TIME_ZONE], &te,
6254 "%s: ", val_to_str_ext_const(GTP_EXT_MS_TIME_ZONE, >p_val_ext, "Unknown"));
6257 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6258 offset = offset + 2;
6260 /* 3GPP TS 23.040 version 6.6.0 Release 6
6261 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
6263 * The Time Zone indicates the difference, expressed in quarters of an hour,
6264 * between the local time and GMT. In the first of the two semi-octets,
6265 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
6266 * represents the algebraic sign of this difference (0: positive, 1: negative).
6269 data = tvb_get_guint8(tvb, offset);
6270 sign = (data & 0x08) ? '-' : '+';
6271 data = (data >> 4) + (data & 0x07) * 10;
6273 proto_tree_add_uint_format_value(ext_tree, hf_gtp_timezone, tvb, offset, 1, data, "GMT %c %d hours %d minutes", sign, data / 4, data % 4 * 15);
6274 proto_item_append_text(te, "GMT %c %d hours %d minutes", sign, data / 4, data % 4 * 15);
6277 proto_tree_add_item(ext_tree, hf_gtp_timezone_dst, tvb, offset, 1, ENC_NA);
6284 * UMTS: 29.060 v6.11.0, chapter 7.7.53
6285 * International Mobile Equipment Identity (and Software Version) (IMEI(SV))
6286 * Type = 154 (Decimal)
6289 decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6293 proto_tree *ext_imeisv;
6296 const char *digit_str;
6298 length = tvb_get_ntohs(tvb, offset + 1);
6299 ext_imeisv = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_IMEISV], &te,
6300 val_to_str_ext_const(GTP_EXT_IMEISV, >p_val_ext, "Unknown"));
6303 proto_tree_add_item(ext_imeisv, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6304 offset = offset + 2;
6307 * The structure of the IMEI and IMEISV are defined in sub-clause 6.2 of 3GPP TS 23.003 [2].
6308 * The 'IMEI(SV)' field shall contain the IMEISV if it is available. If only the IMEI is available,
6309 * then the IMEI shall be placed in the IMEI(SV) field and the last semi-octet of octet 11 shall be
6310 * set to '1111'. Both IMEI and IMEISV are BCD encoded.
6312 next_tvb = tvb_new_subset_length(tvb, offset, length);
6313 digit_str = tvb_bcd_dig_to_wmem_packet_str(next_tvb, 0, -1, NULL, FALSE);
6314 proto_tree_add_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str);
6315 proto_item_append_text(te, ": %s", digit_str);
6321 * UMTS: 29.060 v6.11.0, chapter 7.7.54
6322 * CAMEL Charging Information Container
6323 * Type = 155 (Decimal)
6326 decode_gtp_camel_chg_inf_con(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6330 proto_tree *ext_tree;
6332 length = tvb_get_ntohs(tvb, offset + 1);
6333 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CAMEL_CHG_INF_CON], NULL,
6334 val_to_str_ext_const(GTP_EXT_CAMEL_CHG_INF_CON, >p_val_ext, "Unknown"));
6337 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6338 offset = offset + 2;
6339 /* TODO add decoding of data */
6340 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6347 * UMTS: 29.060 v6.11.0, chapter 7.7.55
6351 decode_gtp_mbms_ue_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6355 proto_tree *ext_tree;
6357 length = tvb_get_ntohs(tvb, offset + 1);
6358 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_UE_CTX], NULL,
6359 val_to_str_ext_const(GTP_EXT_MBMS_UE_CTX, >p_val_ext, "Unknown"));
6362 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6363 offset = offset + 2;
6364 /* TODO add decoding of data */
6365 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6372 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.56
6373 * Temporary Mobile Group Identity (TMGI)
6374 * The Temporary Mobile Group Identity (TMGI) information element contains
6375 * a TMGI allocated by the BM-SC. It is coded as in the value part defined
6376 * in 3GPP T S 24.008 [5] (i.e. the IEI and octet length indicator are not included).
6380 decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
6384 proto_tree *ext_tree, *tmgi_tree;
6388 length = tvb_get_ntohs(tvb, offset + 1);
6389 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_TMGI], NULL,
6390 val_to_str_ext_const(GTP_EXT_TMGI, >p_val_ext, "Unknown"));
6393 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6394 offset = offset + 2;
6396 ti = proto_tree_add_item(ext_tree, hf_gtp_tmgi, tvb, offset, length, ENC_NA);
6398 tmgi_tree = proto_item_add_subtree(ti, ett_gtp_tmgi);
6399 next_tvb = tvb_new_subset_length(tvb, offset, length);
6400 de_mid(next_tvb, tmgi_tree, pinfo, 0, length, NULL, 0);
6406 * UMTS: 29.060 v6.11.0, chapter 7.7.57
6407 * RIM Routing Address
6410 decode_gtp_rim_ra(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6414 proto_tree *ext_tree;
6416 length = tvb_get_ntohs(tvb, offset + 1);
6417 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RIM_RA], NULL,
6418 val_to_str_ext_const(GTP_EXT_RIM_RA, >p_val_ext, "Unknown"));
6421 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6422 offset = offset + 2;
6423 /* To dissect the Address the Routing Address discriminator must be known */
6425 * Octets 4-n are coded according to 3GPP TS 48.018 [20] 11.3.77 RIM Routing Information IE octets 4-n.
6427 proto_tree_add_item(ext_tree, hf_gtp_rim_routing_addr, tvb, offset, length, ENC_NA);
6434 * UMTS: 29.060 v6.11.0, chapter 7.7.58
6435 * MBMS Protocol Configuration Options
6438 decode_gtp_mbms_prot_conf_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6442 proto_tree *ext_tree;
6444 length = tvb_get_ntohs(tvb, offset + 1);
6445 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_PROT_CONF_OPT], NULL,
6446 val_to_str_ext_const(GTP_EXT_MBMS_PROT_CONF_OPT, >p_val_ext, "Unknown"));
6449 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6450 offset = offset + 2;
6451 /* TODO add decoding of data */
6452 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6459 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.59
6460 * MBMS Session Duration
6462 /* Used for Diameter */
6464 dissect_gtp_mbms_ses_dur(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, void *data _U_)
6469 proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6470 proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, ENC_BIG_ENDIAN);
6477 decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6481 proto_tree *ext_tree;
6483 length = tvb_get_ntohs(tvb, offset + 1);
6484 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_SES_DUR], NULL,
6485 val_to_str_ext_const(GTP_EXT_MBMS_SES_DUR, >p_val_ext, "Unknown"));
6488 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6489 offset = offset + 2;
6490 /* The MBMS Session Duration is defined in 3GPP TS 23.246 [26].
6491 * The MBMS Session Duration information element indicates the estimated
6492 * session duration of the MBMS service data transmission if available.
6493 * The payload shall be encoded as per the MBMS-Session-Duration AVP defined
6494 * in 3GPP TS 29.061 [27], excluding the AVP Header fields
6495 * (as defined in IETF RFC 3588 [36], section 4.1).
6497 /* The MBMS-Session-Duration AVP (AVP code 904) is of type OctetString
6498 * with a length of three octets and indicates the estimated session duration
6499 * (MBMS Service data transmission). Bits 0 to 16 (17 bits) express seconds, for which the
6500 * maximum allowed value is 86400 seconds. Bits 17 to 23 (7 bits) express days,
6501 * for which the maximum allowed value is 18 days. For the whole session duration the seconds
6502 * and days are added together and the maximum session duration is 19 days.
6504 proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6505 proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, ENC_BIG_ENDIAN);
6512 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.60
6516 dissect_gtp_3gpp_mbms_service_area(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
6519 guint8 no_of_mbms_sa_codes;
6522 /* The MBMS Service Area is defined in 3GPP TS 23.246 [26].
6523 * The MBMS Service Area information element indicates the area over
6524 * which the Multimedia Broadcast/Multicast Service is to be distributed.
6525 * The payload shall be encoded as per the MBMS-Service-Area AVP defined
6526 * in 3GPP TS 29.061 [27], excluding the AVP Header fields (as defined in
6527 * IETF RFC 3588 [36], section 4.1).
6529 /* Number N of MBMS service area codes coded as:
6530 * 1 binary value is '00000000'
6532 * 256 binary value is '11111111'
6534 no_of_mbms_sa_codes = tvb_get_guint8(tvb, offset) + 1;
6535 proto_tree_add_uint(tree, hf_gtp_no_of_mbms_sa_codes, tvb, offset, 1, no_of_mbms_sa_codes);
6537 /* A consecutive list of N MBMS service area codes
6538 * The MBMS Service Area Identity and its semantics are defined in 3GPP TS 23.003
6539 * The length of an MBMS service area code is 2 octets.
6541 for (i = 0; i < no_of_mbms_sa_codes; i++) {
6542 proto_tree_add_item(tree, hf_gtp_mbms_sa_code, tvb, offset, 2, ENC_BIG_ENDIAN);
6543 offset = offset + 2;
6550 decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
6555 proto_tree *ext_tree;
6557 length = tvb_get_ntohs(tvb, offset + 1);
6558 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_SA], NULL,
6559 val_to_str_ext_const(GTP_EXT_MBMS_SA, >p_val_ext, "Unknown"));
6562 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6563 offset = offset + 2;
6564 next_tvb = tvb_new_subset_length(tvb, offset, length-3);
6565 dissect_gtp_3gpp_mbms_service_area(next_tvb, pinfo, ext_tree, NULL);
6572 * UMTS: 29.060 v6.11.0, chapter 7.7.61
6573 * Source RNC PDCP context info
6576 decode_gtp_src_rnc_pdp_ctx_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6580 proto_tree *ext_tree;
6582 length = tvb_get_ntohs(tvb, offset + 1);
6583 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_SRC_RNC_PDP_CTX_INF], NULL,
6584 val_to_str_ext_const(GTP_EXT_SRC_RNC_PDP_CTX_INF, >p_val_ext, "Unknown"));
6587 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6588 offset = offset + 2;
6589 /* TODO add decoding of data */
6590 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6597 * UMTS: 29.060 v6.11.0, chapter 7.7.62
6598 * Additional Trace Info
6601 decode_gtp_add_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6605 proto_tree *ext_tree;
6607 length = tvb_get_ntohs(tvb, offset + 1);
6608 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ADD_TRS_INF], NULL,
6609 val_to_str_ext_const(GTP_EXT_ADD_TRS_INF, >p_val_ext, "Unknown"));
6612 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6613 offset = offset + 2;
6614 /* TODO add decoding of data */
6615 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6622 * UMTS: 29.060 v6.11.0, chapter 7.7.63
6626 decode_gtp_hop_count(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6630 proto_tree *ext_tree;
6632 length = tvb_get_ntohs(tvb, offset + 1);
6633 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_HOP_COUNT], NULL,
6634 val_to_str_ext_const(GTP_EXT_HOP_COUNT, >p_val_ext, "Unknown"));
6637 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6638 offset = offset + 2;
6639 /* TODO add decoding of data */
6640 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6647 * UMTS: 29.060 v6.11.0, chapter 7.7.64
6651 decode_gtp_sel_plmn_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
6655 proto_tree *ext_tree;
6657 length = tvb_get_ntohs(tvb, offset + 1);
6658 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_SES_ID], NULL,
6659 val_to_str_ext_const(GTP_EXT_SEL_PLMN_ID, >p_val_ext, "Unknown"));
6662 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6663 offset = offset + 2;
6665 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree, offset, E212_NONE, FALSE);
6671 * UMTS: 29.060 v6.11.0, chapter 7.7.65
6672 * MBMS Session Identifier
6675 decode_gtp_mbms_ses_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6679 proto_tree *ext_tree;
6681 length = tvb_get_ntohs(tvb, offset + 1);
6682 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_SES_ID], NULL, val_to_str_ext_const(GTP_EXT_MBMS_SES_ID, >p_val_ext, "Unknown"));
6685 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6686 offset = offset + 2;
6687 /* TODO add decoding of data */
6688 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6695 * UMTS: 29.060 v6.11.0, chapter 7.7.66
6696 * MBMS 2G/3G Indicator
6698 static const value_string gtp_mbs_2g_3g_ind_vals[] = {
6701 {2, "Both 2G and 3G"},
6706 decode_gtp_mbms_2g_3g_ind(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6710 proto_tree *ext_tree;
6712 length = tvb_get_ntohs(tvb, offset + 1);
6713 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_2G_3G_IND], NULL,
6714 val_to_str_ext_const(GTP_EXT_MBMS_2G_3G_IND, >p_val_ext, "Unknown"));
6717 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6718 offset = offset + 2;
6719 /* MBMS 2G/3G Indicator */
6720 proto_tree_add_item(ext_tree, hf_gtp_mbs_2g_3g_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
6727 * UMTS: 29.060 v6.11.0, chapter 7.7.67
6731 decode_gtp_enh_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6735 proto_tree *ext_tree;
6737 length = tvb_get_ntohs(tvb, offset + 1);
6738 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ENH_NSAPI], NULL, val_to_str_ext_const(GTP_EXT_ENH_NSAPI, >pv1_val_ext, "Unknown"));
6741 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6742 offset = offset + 2;
6743 /* TODO add decoding of data */
6744 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6751 * UMTS: 29.060 v6.11.0, chapter 7.7.68
6752 * Additional MBMS Trace Info
6755 decode_gtp_add_mbms_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6759 proto_tree *ext_tree;
6761 length = tvb_get_ntohs(tvb, offset + 1);
6762 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ADD_MBMS_TRS_INF], NULL,
6763 val_to_str_ext_const(GTP_EXT_ADD_MBMS_TRS_INF, >pv1_val_ext, "Unknown"));
6766 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6767 offset = offset + 2;
6768 /* TODO add decoding of data */
6769 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6776 * UMTS: 29.060 v6.11.0, chapter 7.7.69
6777 * MBMS Session Identity Repetition Number
6780 decode_gtp_mbms_ses_id_rep_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6784 proto_tree *ext_tree;
6786 length = tvb_get_ntohs(tvb, offset + 1);
6787 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_SES_ID_REP_NO], NULL,
6788 val_to_str_ext_const(GTP_EXT_MBMS_SES_ID_REP_NO, >pv1_val_ext, "Unknown"));
6791 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6792 offset = offset + 2;
6793 /* TODO add decoding of data */
6794 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6801 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7
6802 * MBMS Time To Data Transfer
6804 /* Used for Diameter */
6806 dissect_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, void *data _U_)
6810 guint8 time_2_dta_tr;
6812 time_2_dta_tr = tvb_get_guint8(tvb, offset) + 1;
6813 proto_tree_add_uint(tree, hf_gtp_time_2_dta_tr, tvb, offset, 1, time_2_dta_tr);
6820 decode_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6824 proto_tree *ext_tree;
6825 guint8 time_2_dta_tr;
6827 length = tvb_get_ntohs(tvb, offset + 1);
6828 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_TIME_TO_DATA_TR], NULL,
6829 val_to_str_ext_const(GTP_EXT_MBMS_TIME_TO_DATA_TR, >pv1_val_ext, "Unknown"));
6832 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6833 offset = offset + 2;
6834 /* TODO add decoding of data
6835 * The MBMS Time To Data Transfer is defined in 3GPP TS 23.246 [26].
6836 * The MBMS Time To Data Transfer information element contains a
6837 * MBMS Time To Data Transfer allocated by the BM-SC.
6838 * The payload shall be encoded as per the MBMS-Time-To-Data-Transfer AVP
6839 * defined in 3GPP TS 29.061 [27], excluding the AVP Header fields
6840 * (as defined in IETF RFC 3588 [36], section 4.1).
6842 /* The coding is specified as per the Time to MBMS Data Transfer Value Part Coding
6843 * of the Time to MBMS Data Transfer IE in 3GPP TS 48.018
6846 * 0 0 0 0 0 0 0 0 1s
6847 * 0 0 0 0 0 0 0 1 2s
6848 * 0 0 0 0 0 0 1 0 3s
6850 * 1 1 1 1 1 1 1 1 256s
6852 time_2_dta_tr = tvb_get_guint8(tvb, offset) + 1;
6853 proto_tree_add_uint(ext_tree, hf_gtp_time_2_dta_tr, tvb, offset, 1, time_2_dta_tr);
6860 * UMTS: 29.060 v6.11.0, chapter 7.7.71
6861 * PS Handover Request Context
6864 decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6868 proto_tree *ext_tree;
6870 length = tvb_get_ntohs(tvb, offset + 1);
6871 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_PS_HO_REQ_CTX], NULL,
6872 val_to_str_ext_const(GTP_EXT_PS_HO_REQ_CTX, >pv1_val_ext, "Unknown"));
6875 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6876 offset = offset + 2;
6877 /* TODO add decoding of data */
6878 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6885 * UMTS: 29.060 v6.11.0, chapter 7.7.72
6889 decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6893 proto_tree *ext_tree;
6895 length = tvb_get_ntohs(tvb, offset + 1);
6896 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_BSS_CONT], NULL,
6897 val_to_str_ext_const(GTP_EXT_BSS_CONT, >pv1_val_ext, "Unknown"));
6900 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6901 offset = offset + 2;
6902 /* TODO add decoding of data */
6903 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6905 * The content of this container is defined in 3GPP TS 48.018
6913 * UMTS: 29.060 v6.11.0, chapter 7.7.73
6914 * Cell Identification
6917 decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6921 proto_tree *ext_tree;
6923 length = tvb_get_ntohs(tvb, offset + 1);
6924 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CELL_ID], NULL,
6925 val_to_str_ext_const(GTP_EXT_CELL_ID, >pv1_val_ext, "Unknown"));
6928 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6929 offset = offset + 2;
6930 /* TODO add decoding of data */
6931 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6933 * for PS handover from A/Gb mode, the identification of a target cell (Cell ID 1) and the identification of the
6934 * source cell (Cell ID 2) as defined in 3GPP TS 48.018 [20].
6936 * for PS handover from Iu mode, the identification of a target cell (Cell ID 1)) and the identification of the
6937 * source RNC (RNC-ID) as defined in 3GPP TS 48.018
6945 * UMTS: 29.060 v6.11.0, chapter 7.7.74
6949 decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6953 proto_tree *ext_tree;
6955 length = tvb_get_ntohs(tvb, offset + 1);
6956 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_PDU_NO], NULL,
6957 val_to_str_ext_const(GTP_EXT_PDU_NO, >pv1_val_ext, "Unknown"));
6960 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6961 offset = offset + 2;
6962 /* TODO add decoding of data */
6963 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
6970 * UMTS: 29.060 v6.11.0, chapter 7.7.75
6974 decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
6978 proto_tree *ext_tree;
6980 length = tvb_get_ntohs(tvb, offset + 1);
6981 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_BSSGP_CAUSE], NULL,
6982 val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, >pv1_val_ext, "Unknown"));
6985 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6986 offset = offset + 2;
6989 * The BSSGP Cause information element contains the cause as defined in 3GPP TS 48.018
6991 proto_tree_add_item(ext_tree, hf_gtp_bssgp_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
6998 * Required MBMS bearer capabilities 7.7.76
7001 decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7004 proto_tree *ext_tree;
7006 length = tvb_get_ntohs(tvb, offset + 1);
7007 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_REQ_MBMS_BEARER_CAP], NULL,
7008 val_to_str_ext_const(GTP_EXT_REQ_MBMS_BEARER_CAP, >pv1_val_ext, "Unknown"));
7011 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7012 #if 0 /* Fix Dead Store Warning */
7013 offset = offset + 2;
7015 /* The payload shall be encoded as per the
7016 * Required-MBMS-Bearer-Capabilities AVP defined in 3GPP TS 29.061 [27],
7017 * excluding the AVP Header fields (as defined in IETF RFC 3588 [36], section 4.1).
7019 /* TODO Add decoding (call Diameter dissector???) */
7024 * RIM Routing Address Discriminator 7.7.77
7027 static const value_string gtp_bssgp_ra_discriminator_vals[] = {
7028 { 0, "A Cell Identifier is used to identify a GERAN cell" },
7029 { 1, "A Global RNC-ID is used to identify a UTRAN RNC" },
7030 { 2, "An eNB identifier is used to identify an E-UTRAN eNodeB or HeNB" },
7035 decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7039 proto_tree *ext_tree;
7041 length = tvb_get_ntohs(tvb, offset + 1);
7042 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RIM_ROUTING_ADDR_DISC], NULL,
7043 val_to_str_ext_const(GTP_EXT_RIM_ROUTING_ADDR_DISC, >pv1_val_ext, "Unknown"));
7046 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7047 offset = offset + 2;
7048 /* Octet 4 bits 4 - 1 is coded according to 3GPP TS 48.018 [20]
7049 * RIM Routing Information IE octet 3 bits 4 - 1.
7050 * Bits 8 - 5 are coded "0000".
7052 proto_tree_add_item(ext_tree, hf_gtp_bssgp_ra_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
7058 * List of set-up PFCs 7.7.78
7061 decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7065 proto_tree *ext_tree;
7067 length = tvb_get_ntohs(tvb, offset + 1);
7068 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_LIST_OF_SETUP_PFCS], NULL,
7069 val_to_str_ext_const(GTP_EXT_LIST_OF_SETUP_PFCS, >pv1_val_ext, "Unknown"));
7072 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7073 offset = offset + 2;
7074 /* TODO add decoding of data */
7075 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7081 * PS Handover XID Parameters 7.7.79
7084 decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
7088 proto_tree *ext_tree;
7093 length = tvb_get_ntohs(tvb, offset + 1);
7094 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_PS_HANDOVER_XIP_PAR], NULL,
7095 val_to_str_ext_const(GTP_EXT_PS_HANDOVER_XIP_PAR, >pv1_val_ext, "Unknown"));
7098 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7099 offset = offset + 2;
7101 sapi = tvb_get_guint8(tvb, offset) & 0x0F;
7102 proto_tree_add_uint(ext_tree, hf_gtp_sapi, tvb, offset, 1, sapi);
7105 xid_par_len = tvb_get_guint8(tvb, offset);
7106 proto_tree_add_uint(ext_tree, hf_gtp_xid_par_len, tvb, offset, 1, xid_par_len);
7109 next_tvb = tvb_new_subset_remaining(tvb, offset);
7110 if (sndcpxid_handle)
7111 call_dissector(sndcpxid_handle, next_tvb, pinfo, tree);
7113 call_data_dissector(next_tvb, pinfo, tree);
7120 * MS Info Change Reporting Action 7.7.80
7123 decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7127 proto_tree *ext_tree;
7129 length = tvb_get_ntohs(tvb, offset + 1);
7130 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MS_INF_CHG_REP_ACT], NULL,
7131 val_to_str_ext_const(GTP_EXT_MS_INF_CHG_REP_ACT, >pv1_val_ext, "Unknown"));
7134 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7135 offset = offset + 2;
7137 proto_tree_add_item(ext_tree, hf_gtp_rep_act_type, tvb, offset, 1, ENC_BIG_ENDIAN);
7143 * Direct Tunnel Flags 7.7.81
7146 decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7150 proto_tree *ext_tree;
7152 length = tvb_get_ntohs(tvb, offset + 1);
7153 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_DIRECT_TUNNEL_FLGS], NULL,
7154 val_to_str_ext_const(GTP_EXT_DIRECT_TUNNEL_FLGS, >pv1_val_ext, "Unknown"));
7157 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7160 proto_tree_add_item(ext_tree, hf_gtp_ext_ei, tvb, offset, 1, ENC_BIG_ENDIAN);
7161 proto_tree_add_item(ext_tree, hf_gtp_ext_gcsi, tvb, offset, 1, ENC_BIG_ENDIAN);
7162 proto_tree_add_item(ext_tree, hf_gtp_ext_dti, tvb, offset, 1, ENC_BIG_ENDIAN);
7168 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7174 * Correlation-ID 7.7.82
7177 decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7181 proto_tree *ext_tree;
7183 length = tvb_get_ntohs(tvb, offset + 1);
7184 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CORRELATION_ID], NULL,
7185 val_to_str_ext_const(GTP_EXT_CORRELATION_ID, >pv1_val_ext, "Unknown"));
7188 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7189 offset = offset + 2;
7191 proto_tree_add_item(ext_tree, hf_gtp_correlation_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7197 * Bearer Control Mode 7.7.83
7200 static const value_string gtp_pdp_bcm_type_vals[] = {
7207 decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7211 proto_tree *ext_tree;
7213 length = tvb_get_ntohs(tvb, offset + 1);
7214 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_BEARER_CONTROL_MODE], NULL,
7215 val_to_str_ext_const(GTP_EXT_BEARER_CONTROL_MODE, >pv1_val_ext, "Unknown"));
7217 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7220 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7221 offset = offset + 2;
7223 proto_tree_add_item(ext_tree, hf_gtp_bcm, tvb, offset, 1, ENC_BIG_ENDIAN);
7230 * 7.7.84 MBMS Flow Identifier
7233 decode_gtp_mbms_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7236 proto_tree *ext_tree;
7238 length = tvb_get_ntohs(tvb, offset + 1);
7239 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_FLOW_ID], NULL,
7240 val_to_str_ext_const(GTP_EXT_MBMS_FLOW_ID, >pv1_val_ext, "Unknown"));
7241 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7244 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7245 offset = offset + 2;
7247 /* 4-n MBMS Flow Identifier */
7248 proto_tree_add_item(ext_tree, hf_gtp_mbms_flow_id, tvb, offset, length, ENC_NA);
7255 * 7.7.85 MBMS IP Multicast Distribution
7259 decode_gtp_mbms_ip_mcast_dist(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7262 proto_tree *ext_tree;
7264 length = tvb_get_ntohs(tvb, offset + 1);
7265 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_IP_MCAST_DIST], NULL,
7266 val_to_str_ext_const(GTP_EXT_MBMS_IP_MCAST_DIST, >pv1_val_ext, "Unknown"));
7267 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7270 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7271 offset = offset + 2;
7273 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7279 * 7.7.86 MBMS Distribution Acknowledgement
7281 /* Table 7.7.86.1: Distribution Indication values */
7282 static const value_string gtp_mbms_dist_indic_vals[] = {
7283 {0, "No RNCs have accepted IP multicast distribution"},
7284 {1, "All RNCs have accepted IP multicast distribution"},
7285 {2, "Some RNCs have accepted IP multicast distribution"},
7286 {3, "Spare. For future use."},
7290 decode_gtp_mbms_dist_ack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7293 proto_tree *ext_tree;
7295 length = tvb_get_ntohs(tvb, offset + 1);
7296 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MBMS_DIST_ACK], NULL,
7297 val_to_str_ext_const(GTP_EXT_MBMS_DIST_ACK, >pv1_val_ext, "Unknown"));
7298 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7301 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7302 offset = offset + 2;
7304 /* Distribution Indication values */
7305 proto_tree_add_item(ext_tree, hf_gtp_mbms_dist_indic, tvb, offset, 1, ENC_BIG_ENDIAN);
7311 * 7.7.87 Reliable INTER RAT HANDOVER INFO
7314 decode_gtp_reliable_irat_ho_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7317 proto_tree *ext_tree;
7319 length = tvb_get_ntohs(tvb, offset + 1);
7320 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RELIABLE_IRAT_HO_INF], NULL,
7321 val_to_str_ext_const(GTP_EXT_RELIABLE_IRAT_HO_INF, >pv1_val_ext, "Unknown"));
7322 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7325 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7326 offset = offset + 2;
7328 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7337 decode_gtp_rfsp_index(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7339 guint16 length, rfsp;
7340 proto_tree *ext_tree;
7342 length = tvb_get_ntohs(tvb, offset + 1);
7343 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RFSP_INDEX], NULL,
7344 val_to_str_ext_const(GTP_EXT_RFSP_INDEX, >pv1_val_ext, "Unknown"));
7345 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7348 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7349 offset = offset + 2;
7351 rfsp = tvb_get_ntohs(tvb, offset);
7352 proto_tree_add_uint(ext_tree, hf_gtp_rfsp_index, tvb, offset, length, rfsp+1);
7360 * 7.7.90 Fully Qualified Domain Name (FQDN)
7363 decode_gtp_fqdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7367 proto_tree *ext_tree;
7369 length = tvb_get_ntohs(tvb, offset + 1);
7371 ext_tree = proto_tree_add_subtree(tree, tvb, offset, length + 3, ett_gtp_ies[GTP_EXT_FQDN], NULL,
7372 val_to_str_ext_const(GTP_EXT_FQDN, >p_val_ext, "Unknown field"));
7373 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7375 proto_tree_add_item(ext_tree, hf_gtp_fqdn_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
7376 decode_fqdn(tvb, offset + 3, length, ext_tree, NULL);
7382 * 7.7.91 Evolved Allocation/Retention Priority I
7385 decode_gtp_evolved_allc_rtn_p1(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7389 proto_tree *ext_tree;
7391 length = tvb_get_ntohs(tvb, offset + 1);
7392 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_EVO_ALLO_RETE_P1], NULL,
7393 val_to_str_ext_const(GTP_EXT_EVO_ALLO_RETE_P1, >pv1_val_ext, "Unknown"));
7394 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7397 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7400 proto_tree_add_item(ext_tree, hf_gtp_earp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
7401 proto_tree_add_item(ext_tree, hf_gtp_earp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
7402 proto_tree_add_item(ext_tree, hf_gtp_earp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
7410 * 7.7.92 Evolved Allocation/Retention Priority II
7413 decode_gtp_evolved_allc_rtn_p2(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7417 proto_tree *ext_tree;
7419 length = tvb_get_ntohs(tvb, offset + 1);
7420 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_EVO_ALLO_RETE_P2], NULL,
7421 val_to_str_ext_const(GTP_EXT_EVO_ALLO_RETE_P2, >pv1_val_ext, "Unknown"));
7422 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7425 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7426 offset = offset + 2;
7428 proto_tree_add_item(ext_tree, hf_gtp_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
7431 proto_tree_add_item(ext_tree, hf_gtp_earp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
7432 proto_tree_add_item(ext_tree, hf_gtp_earp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
7433 proto_tree_add_item(ext_tree, hf_gtp_earp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
7441 * 7.7.93 Extended Common Flags
7444 decode_gtp_extended_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7447 proto_tree *ext_tree;
7449 length = tvb_get_ntohs(tvb, offset + 1);
7450 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_EXTENDED_COMMON_FLGS], NULL,
7451 val_to_str_ext_const(GTP_EXT_EXTENDED_COMMON_FLGS, >pv1_val_ext, "Unknown"));
7452 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7455 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7456 offset = offset + 2;
7458 proto_tree_add_item(ext_tree, hf_gtp_ext_comm_flags_uasi, tvb, offset, 1, ENC_BIG_ENDIAN);
7462 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length-1);
7469 * 7.7.94 User CSG Information (UCI)
7472 decode_gtp_uci(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7475 proto_tree *ext_tree;
7477 length = tvb_get_ntohs(tvb, offset + 1);
7478 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_UCI], NULL,
7479 val_to_str_ext_const(GTP_EXT_UCI, >pv1_val_ext, "Unknown"));
7480 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7483 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7484 offset = offset + 2;
7486 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7492 * 7.7.95 CSG Information Reporting Action
7496 decode_gtp_csg_inf_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7499 proto_tree *ext_tree;
7501 length = tvb_get_ntohs(tvb, offset + 1);
7502 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CSG_INF_REP_ACT], NULL,
7503 val_to_str_ext_const(GTP_EXT_CSG_INF_REP_ACT, >pv1_val_ext, "Unknown"));
7504 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7507 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7508 offset = offset + 2;
7510 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7519 decode_gtp_csg_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7522 proto_tree *ext_tree;
7524 length = tvb_get_ntohs(tvb, offset + 1);
7525 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CSG_ID], NULL,
7526 val_to_str_ext_const(GTP_EXT_CSG_ID, >pv1_val_ext, "Unknown"));
7527 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7530 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7531 offset = offset + 2;
7533 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7538 * 7.7.97 CSG Membership Indication (CMI)
7541 decode_gtp_cmi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7544 proto_tree *ext_tree;
7546 length = tvb_get_ntohs(tvb, offset + 1);
7547 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CMI], NULL,
7548 val_to_str_ext_const(GTP_EXT_CMI, >pv1_val_ext, "Unknown"));
7549 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7552 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7553 offset = offset + 2;
7555 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7560 * 7.7.98 APN Aggregate Maximum Bit Rate (APN-AMBR)
7563 decode_gtp_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7566 proto_tree *ext_tree;
7568 length = tvb_get_ntohs(tvb, offset + 1);
7569 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_RELIABLE_IRAT_HO_INF], NULL,
7570 val_to_str_ext_const(GTP_EXT_AMBR, >pv1_val_ext, "Unknown"));
7571 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7574 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7575 offset = offset + 2;
7577 /* APN Aggregate Maximum Bit Rate (APN-AMBR) is defined in clause 9.9.4.2 of 3GPP TS 24.301 [42], but shall be
7578 * formatted as shown in Figure 7.7.98-1 as Unsigned32 binary integer values in kbps (1000 bits per second).
7580 /* 4 to 7 APN-AMBR for Uplink */
7581 proto_tree_add_item(ext_tree, hf_gtp_ext_apn_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7583 /* 8 to 11 APN-AMBR for Downlink */
7584 proto_tree_add_item(ext_tree, hf_gtp_ext_apn_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7589 * 7.7.99 UE Network Capability
7592 decode_gtp_ue_network_cap(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
7595 proto_tree *ext_tree;
7597 length = tvb_get_ntohs(tvb, offset + 1);
7598 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_UE_NETWORK_CAP], NULL,
7599 val_to_str_ext_const(GTP_EXT_UE_NETWORK_CAP, >pv1_val_ext, "Unknown"));
7602 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7603 offset = offset + 2;
7605 de_emm_ue_net_cap(tvb, ext_tree, pinfo, offset, length, NULL, 0);
7614 decode_gtp_ue_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7617 proto_tree *ext_tree;
7619 length = tvb_get_ntohs(tvb, offset + 1);
7620 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_APN_AMBR_WITH_NSAPI], NULL,
7621 val_to_str_ext_const(GTP_EXT_APN_AMBR_WITH_NSAPI, >pv1_val_ext, "Unknown"));
7622 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7625 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7626 offset = offset + 2;
7628 /* 4 to 7 Subscribed UE-AMBR for Uplink */
7629 proto_tree_add_item(ext_tree, hf_gtp_ext_sub_ue_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7631 /* 8 to 11 Subscribed UE-AMBR for Downlink */
7632 proto_tree_add_item(ext_tree, hf_gtp_ext_sub_ue_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7635 /* Authorized UE-AMBR for Uplink and Downlink fields are present in the IE only if the sender has their valid values
7636 * available. Otherwise, the fields from m to (n+3) shall not be present.
7638 if(offset >= length)
7641 /* m to (m+3) Authorized UE-AMBR for Uplink */
7642 proto_tree_add_item(ext_tree, hf_gtp_ext_auth_ue_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7645 /* (m+4) to (n+3) Authorized UE-AMBR for Downlink */
7646 proto_tree_add_item(ext_tree, hf_gtp_ext_auth_ue_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7648 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7654 * 7.7.101 APN-AMBR with NSAPI
7657 decode_gtp_apn_ambr_with_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7660 proto_tree *ext_tree;
7662 length = tvb_get_ntohs(tvb, offset + 1);
7663 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_UE_AMBR], NULL,
7664 val_to_str_ext_const(GTP_EXT_UE_AMBR, >pv1_val_ext, "Unknown"));
7665 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7668 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7669 offset = offset + 2;
7671 proto_tree_add_item(ext_tree, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
7674 /* 5 to 8 Authorized APN-AMBR for Uplink */
7675 proto_tree_add_item(ext_tree, hf_gtp_ext_auth_apn_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7678 /* 9 to12 Authorized APN-AMBR for Downlink */
7679 proto_tree_add_item(ext_tree, hf_gtp_ext_auth_apn_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7684 * 7.7.102 GGSN Back-Off Time
7686 /* Table 7.7.102.1: GGSN Back-Off Time information element */
7687 static const value_string gtp_ggsn_back_off_time_units_vals[] = {
7688 {0, "value is incremented in multiples of 2 seconds"},
7689 {1, "value is incremented in multiples of 1 minute"},
7690 {2, "value is incremented in multiples of 10 minutes"},
7691 {3, "value is incremented in multiples of 1 hour"},
7692 {4, "value is incremented in multiples of 10 hours"},
7693 {5, "value indicates that the timer is infinite"},
7697 decode_gtp_ggsn_back_off_time(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7700 proto_tree *ext_tree;
7702 length = tvb_get_ntohs(tvb, offset + 1);
7703 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_GGSN_BACK_OFF_TIME], NULL,
7704 val_to_str_ext_const(GTP_EXT_GGSN_BACK_OFF_TIME, >pv1_val_ext, "Unknown"));
7705 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7708 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7711 /* 4 Timer unit Timer value */
7712 proto_tree_add_item(ext_tree, hf_gtp_ext_ggsn_back_off_time_units, tvb, offset, 1, ENC_BIG_ENDIAN);
7713 proto_tree_add_item(ext_tree, hf_gtp_ext_ggsn_back_off_timer, tvb, offset, 1, ENC_BIG_ENDIAN);
7719 * 7.7.103 Signalling Priority Indication
7723 decode_gtp_sig_pri_ind(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7726 proto_tree *ext_tree;
7728 length = tvb_get_ntohs(tvb, offset + 1);
7729 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_SIG_PRI_IND], NULL,
7730 val_to_str_ext_const(GTP_EXT_SIG_PRI_IND, >pv1_val_ext, "Unknown"));
7731 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7734 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7737 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7742 * 7.7.104 Signalling Priority Indication with NSAPI
7746 decode_gtp_sig_pri_ind_w_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7749 proto_tree *ext_tree;
7751 length = tvb_get_ntohs(tvb, offset + 1);
7752 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_SIG_PRI_IND_W_NSAPI], NULL,
7753 val_to_str_ext_const(GTP_EXT_SIG_PRI_IND_W_NSAPI, >pv1_val_ext, "Unknown"));
7754 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7757 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7760 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7765 * 7.7.105 Higher bitrates than 16 Mbps flag
7767 static const value_string gtp_higher_br_16mb_flg_vals[] = {
7774 decode_gtp_higher_br_16mb_flg(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7777 proto_tree *ext_tree;
7779 length = tvb_get_ntohs(tvb, offset + 1);
7780 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_HIGHER_BR_16MB_FLG], NULL,
7781 val_to_str_ext_const(GTP_EXT_HIGHER_BR_16MB_FLG, >pv1_val_ext, "Unknown"));
7782 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7785 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7788 /* Higher bitrates than 16 Mbps flag */
7789 proto_tree_add_item(ext_tree, hf_gtp_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
7794 * 7.7.106 Max MBR/APN-AMBR
7798 decode_gtp_max_mbr_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7801 proto_tree *ext_tree;
7805 length = tvb_get_ntohs(tvb, offset + 1);
7806 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_MAX_MBR_APN_AMBR], NULL,
7807 val_to_str_ext_const(GTP_EXT_MAX_MBR_APN_AMBR, >pv1_val_ext, "Unknown"));
7808 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7811 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7812 offset = offset + 2;
7814 /* Max MBR/APN-AMBR for uplink */
7815 max_ul = tvb_get_ntohl(tvb, offset);
7816 proto_tree_add_uint_format_value(ext_tree, hf_gtp_max_mbr_apn_ambr_ul, tvb, offset, 4, max_ul, "%u %s",
7817 (max_ul) > 1000 ? max_ul/1000 : max_ul,
7818 (max_ul) > 1000 ? "Mbps" : "kbps");
7822 /* Max MBR/APN-AMBR for downlink */
7823 max_dl = tvb_get_ntohl(tvb, offset);
7824 proto_tree_add_uint_format_value(ext_tree, hf_gtp_max_mbr_apn_ambr_dl, tvb, offset, 4, max_dl, "%u %s",
7825 (max_dl) > 1000 ? max_dl/1000 : max_dl,
7826 (max_dl) > 1000 ? "Mbps" : "kbps");
7831 * 7.7.107 Additional MM context for SRVCC
7835 decode_gtp_add_mm_ctx_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7838 proto_tree *ext_tree;
7840 length = tvb_get_ntohs(tvb, offset + 1);
7841 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ADD_MM_CTX_SRVCC], NULL,
7842 val_to_str_ext_const(GTP_EXT_ADD_MM_CTX_SRVCC, >pv1_val_ext, "Unknown"));
7843 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7846 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7849 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7855 * 7.7.108 Additional flags for SRVCC
7859 decode_gtp_add_flgs_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7862 proto_tree *ext_tree;
7864 length = tvb_get_ntohs(tvb, offset + 1);
7865 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ADD_FLGS_SRVCC], NULL,
7866 val_to_str_ext_const(GTP_EXT_ADD_FLGS_SRVCC, >pv1_val_ext, "Unknown"));
7867 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7870 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7873 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7881 decode_gtp_stn_sr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7884 proto_tree *ext_tree;
7886 length = tvb_get_ntohs(tvb, offset + 1);
7887 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_STN_SR], NULL,
7888 val_to_str_ext_const(GTP_EXT_STN_SR, >pv1_val_ext, "Unknown"));
7889 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7892 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7895 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7905 decode_gtp_c_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7908 proto_tree *ext_tree;
7910 length = tvb_get_ntohs(tvb, offset + 1);
7911 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_C_MSISDN], NULL,
7912 val_to_str_ext_const(GTP_EXT_C_MSISDN, >pv1_val_ext, "Unknown"));
7913 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7916 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7919 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7924 * 7.7.111 Extended RANAP Cause
7927 decode_gtp_ext_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7930 proto_tree *ext_tree;
7932 length = tvb_get_ntohs(tvb, offset + 1);
7933 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_EXT_RANAP_CAUSE], NULL,
7934 val_to_str_ext_const(GTP_EXT_EXT_RANAP_CAUSE, >pv1_val_ext, "Unknown"));
7935 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7938 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7941 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
7950 static const value_string gtp_enb_type_vals[] = {
7951 { 0, "Macro eNodeB ID" },
7952 { 1, "Home eNodeB ID" },
7957 decode_gtp_ext_enodeb_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
7960 proto_tree *ext_tree;
7963 length = tvb_get_ntohs(tvb, offset + 1);
7964 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ENODEB_ID], NULL,
7965 val_to_str_ext_const(GTP_EXT_ENODEB_ID, >pv1_val_ext, "Unknown"));
7966 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7969 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7973 proto_tree_add_item_ret_uint(ext_tree, hf_gtp_ext_enb_type, tvb, offset, 1, ENC_BIG_ENDIAN, &enb_type);
7976 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree, offset, E212_NONE, TRUE);
7981 /* Macro eNodeB ID */
7982 proto_tree_add_item(ext_tree, hf_gtp_macro_enodeb_id, tvb, offset, 3, ENC_BIG_ENDIAN);
7984 proto_tree_add_item(ext_tree, hf_gtp_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
7987 /* Home eNodeB ID */
7988 proto_tree_add_item(ext_tree, hf_gtp_home_enodeb_id, tvb, offset, 4, ENC_BIG_ENDIAN);
7990 proto_tree_add_item(ext_tree, hf_gtp_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
7993 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length - 4);
8001 * 7.7.113 Selection Mode with NSAPI
8004 decode_gtp_ext_sel_mode_w_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8007 proto_tree *ext_tree;
8009 length = tvb_get_ntohs(tvb, offset + 1);
8010 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_SEL_MODE_W_NSAPI], NULL,
8011 val_to_str_ext_const(GTP_EXT_SEL_MODE_W_NSAPI, >pv1_val_ext, "Unknown"));
8012 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
8015 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
8018 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
8023 * 7.7.114 ULI Timestamp
8026 decode_gtp_ext_uli_timestamp(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8029 proto_tree *ext_tree;
8031 length = tvb_get_ntohs(tvb, offset + 1);
8032 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_ULI_TIMESTAMP], NULL,
8033 val_to_str_ext_const(GTP_EXT_ULI_TIMESTAMP, >pv1_val_ext, "Unknown"));
8034 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
8037 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
8040 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
8046 * 7.7.115 Local Home Network ID (LHN-ID) with NSAPI
8049 decode_gtp_ext_lhn_id_w_sapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8052 proto_tree *ext_tree;
8054 length = tvb_get_ntohs(tvb, offset + 1);
8055 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_LHN_ID_W_SAPI], NULL,
8056 val_to_str_ext_const(GTP_EXT_LHN_ID_W_SAPI, >pv1_val_ext, "Unknown"));
8057 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
8060 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
8063 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
8068 * 7.7.116 CN Operator Selection Entity
8071 decode_gtp_ext_cn_op_sel_entity(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8074 proto_tree *ext_tree;
8076 length = tvb_get_ntohs(tvb, offset + 1);
8077 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_CN_OP_SEL_ENTITY], NULL,
8078 val_to_str_ext_const(GTP_EXT_CN_OP_SEL_ENTITY, >pv1_val_ext, "Unknown"));
8079 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
8082 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
8085 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length);
8091 * 7.7.118 Extended Common Flags II
8094 decode_gtp_extended_common_flgs_II(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8097 proto_tree *ext_tree;
8099 length = tvb_get_ntohs(tvb, offset + 1);
8100 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_ies[GTP_EXT_EXT_COMMON_FLGS_II], NULL,
8101 val_to_str_ext_const(GTP_EXT_EXT_COMMON_FLGS_II, >pv1_val_ext, "Unknown"));
8102 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
8105 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
8106 offset = offset + 2;
8108 proto_tree_add_item(ext_tree, hf_gtp_ext_comm_flags_II_pnsi, tvb, offset, 1, ENC_BIG_ENDIAN);
8109 proto_tree_add_item(ext_tree, hf_gtp_ext_comm_flags_II_dtci, tvb, offset, 1, ENC_BIG_ENDIAN);
8110 proto_tree_add_item(ext_tree, hf_gtp_ext_comm_flags_II_pmtsmi, tvb, offset, 1, ENC_BIG_ENDIAN);
8111 proto_tree_add_item(ext_tree, hf_gtp_ext_comm_flags_II_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
8116 proto_tree_add_expert(ext_tree, pinfo, &ei_gtp_undecoded, tvb, offset, length-1);
8124 decode_gtp_rel_pack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8127 guint16 length, n, number;
8128 proto_tree *ext_tree_rel_pack;
8130 length = tvb_get_ntohs(tvb, offset + 1);
8132 ext_tree_rel_pack = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_rel_pack, NULL,
8133 "Sequence numbers of released packets IE");
8137 while (n < length) {
8139 number = tvb_get_ntohs(tvb, offset + 3 + n);
8140 proto_tree_add_uint_format(ext_tree_rel_pack, hf_gtp_seq_num_released, tvb, offset + 3 + n, 2, number, "%u", number);
8152 decode_gtp_can_pack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8155 guint16 length, n, number;
8156 proto_tree *ext_tree_can_pack;
8158 length = tvb_get_ntohs(tvb, offset + 1);
8160 ext_tree_can_pack = proto_tree_add_subtree(tree, tvb, offset, 3 + length, ett_gtp_can_pack, NULL,
8161 "Sequence numbers of cancelled packets IE");
8165 while (n < length) {
8167 number = tvb_get_ntohs(tvb, offset + 3 + n);
8168 proto_tree_add_uint_format(ext_tree_can_pack, hf_gtp_seq_num_canceled, tvb, offset + 3 + n, 2, number, "%u", number);
8176 * 3GPP TS 32.295 version 9.0.0 Release 9
8180 static const value_string gtp_cdr_fmt_vals[] = {
8181 {1, "Basic Encoding Rules (BER)"},
8182 {2, "Unaligned basic Packed Encoding Rules (PER)"},
8183 {3, "Aligned basic Packed Encoding Rules (PER)"},
8187 decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
8190 guint16 length, cdr_length;
8191 guint8 no, format, app_id, rel_id, ver_id, i;
8192 proto_tree *ext_tree, *ver_tree, *cdr_dr_tree;
8193 proto_item *fmt_item;
8196 ext_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtp_ext, NULL,
8197 val_to_str_ext_const(GTP_EXT_DATA_REQ, >p_val_ext, "Unknown message"));
8200 length = tvb_get_ntohs(tvb, offset);
8201 proto_tree_add_uint(ext_tree, hf_gtp_length, tvb, offset, 2, length);
8208 /* Octet 4 Number of Data Records */
8209 no = tvb_get_guint8(tvb, offset);
8210 proto_tree_add_item(ext_tree, hf_gtp_number_of_data_records, tvb, offset, 1, ENC_BIG_ENDIAN);
8213 /* Octet 5 Data Record Format */
8214 format = tvb_get_guint8(tvb, offset);
8215 fmt_item = proto_tree_add_item(ext_tree, hf_gtp_data_record_format, tvb, offset, 1, ENC_BIG_ENDIAN);
8217 /* The value range is 1-255 in decimal. The value '0' should not be used.
8218 * Only the values 1-10 and 51-255 can be used for standards purposes.
8219 * Values in the range of 11-50 are to be configured only by operators, and are not subject to standardization.
8222 proto_item_append_text(fmt_item, " %s", val_to_str_const(format, gtp_cdr_fmt_vals, "Unknown"));
8223 /* Octet 6 -7 Data Record Format Version
8225 * 6 Application Identifier Release Identifier
8226 * 7 Version Identifier
8228 app_id = tvb_get_guint8(tvb,offset);
8229 rel_id = app_id & 0x0f;
8230 app_id = app_id >>4;
8231 ver_id =tvb_get_guint8(tvb,offset+1);
8232 /* The second octet (#7 in Data Record Packet IE) identifies the version of the TS used to encode the CDR,
8233 * i.e. its value corresponds to the second digit of the version number of the document [51]
8234 * (as shown on the cover sheet), plus '1'.
8235 * E.g. for version 3.4.0, the Version Identifier would be "5".
8236 * In circumstances where the second digit is an alphabetical character, (e.g. 3.b.0), the corresponding ASCII value shall
8237 * be taken, e.g. the Version Identifier would be "66" (ASCII(b)).
8241 /* XXX We don't handle ASCCI version */
8243 ver_tree = proto_tree_add_subtree_format(ext_tree, tvb, offset, 2, ett_gtp_cdr_ver, NULL,
8244 "Data record format version: AppId %u Rel %u.%u.0", app_id,rel_id,ver_id);
8245 proto_tree_add_item(ver_tree, hf_gtp_cdr_app, tvb, offset, 1, ENC_BIG_ENDIAN);
8246 proto_tree_add_item(ver_tree, hf_gtp_cdr_rel, tvb, offset, 1, ENC_BIG_ENDIAN);
8248 proto_tree_add_item(ver_tree, hf_gtp_cdr_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
8250 for(i = 0; i < no; ++i) {
8251 cdr_length = tvb_get_ntohs(tvb, offset);
8252 cdr_dr_tree = proto_tree_add_subtree_format(ext_tree, tvb, offset, cdr_length+2,
8253 ett_gtp_cdr_dr, NULL, "Data record %d", i + 1);
8254 proto_tree_add_uint(cdr_dr_tree, hf_gtp_cdr_length, tvb, offset, 2, cdr_length);
8256 proto_tree_add_item(cdr_dr_tree, hf_gtp_cdr_context, tvb, offset, cdr_length, ENC_NA);
8257 next_tvb = tvb_new_subset_remaining(tvb, offset);
8259 /* XXX this is for release 6, may not work for higher releases */
8262 dissect_gprscdr_GPRSCallEventRecord_PDU(next_tvb, pinfo, cdr_dr_tree, NULL);
8263 }else if(rel_id >6){
8264 dissect_gprscdr_GPRSRecord_PDU(next_tvb, pinfo, cdr_dr_tree, NULL);
8267 /* Do we have a dissector regestering for this data format? */
8268 dissector_try_uint(gtp_cdr_fmt_dissector_table, format, next_tvb, pinfo, cdr_dr_tree);
8271 offset = offset + cdr_length;
8275 /* Proprietary CDR format */
8276 proto_item_append_text(fmt_item, " Proprietary or un documented format");
8279 if (gtpcdr_handle) {
8280 next_tvb = tvb_new_subset_remaining(tvb, offset);
8281 call_dissector(gtpcdr_handle, next_tvb, pinfo, tree);
8291 decode_gtp_data_resp(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8294 guint16 length, n, number;
8295 proto_tree *ext_tree_data_resp;
8297 length = tvb_get_ntohs(tvb, offset + 1);
8299 ext_tree_data_resp = proto_tree_add_subtree(tree, tvb, offset, 3 + length,
8300 ett_gtp_data_resp, NULL, "Requests responded");
8304 while (n < length) {
8306 number = tvb_get_ntohs(tvb, offset + 3 + n);
8307 proto_tree_add_uint_format(ext_tree_data_resp, hf_gtp_requests_responded, tvb, offset + 3 + n, 2, number, "%u", number);
8320 decode_gtp_node_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree, session_args_t * args _U_)
8324 proto_tree *ext_tree_node_addr;
8327 length = tvb_get_ntohs(tvb, offset + 1);
8329 ext_tree_node_addr = proto_tree_add_subtree(tree, tvb, offset, 3 + length,
8330 ett_gtp_node_addr, &te, "Node address: ");
8332 proto_tree_add_item(ext_tree_node_addr, hf_gtp_node_address_length, tvb, offset + 1, 2, ENC_BIG_ENDIAN);
8336 proto_tree_add_item(ext_tree_node_addr, hf_gtp_node_ipv4, tvb, offset + 3, 4, ENC_BIG_ENDIAN);
8337 proto_item_append_text(te, "%s", tvb_ip_to_str(tvb, offset + 3));
8340 proto_tree_add_item(ext_tree_node_addr, hf_gtp_node_ipv6, tvb, offset + 3, 16, ENC_NA);
8341 proto_item_append_text(te, "%s", tvb_ip6_to_str(tvb, offset + 3));
8344 proto_item_append_text(te, "unknown type or wrong length");
8352 /* GPRS: 9.60 v7.6.0, chapter 7.9.26
8353 * UMTS: 29.060 v4.0, chapter 7.7.46 Private Extension
8358 decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
8361 guint16 length, ext_id;
8362 proto_tree *ext_tree_priv_ext;
8366 ext_tree_priv_ext = proto_tree_add_subtree_format(tree, tvb, offset, 1, ett_gtp_ext, &te,
8367 "%s : ", val_to_str_ext_const(GTP_EXT_PRIV_EXT, >p_val_ext, "Unknown message"));
8370 length = tvb_get_ntohs(tvb, offset);
8371 proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
8374 ext_id = tvb_get_ntohs(tvb, offset);
8375 proto_tree_add_uint(ext_tree_priv_ext, hf_gtp_ext_id, tvb, offset, 2, ext_id);
8376 proto_item_append_text(te, "%s (%u)", enterprises_lookup(ext_id, "Unknown"), ext_id);
8377 offset = offset + 2;
8380 next_tvb = tvb_new_subset_length(tvb, offset, length-2);
8381 if(!dissector_try_uint(gtp_priv_ext_dissector_table, ext_id, next_tvb, pinfo, ext_tree_priv_ext)){
8382 proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length - 2, ENC_NA);
8391 decode_gtp_unknown(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree, session_args_t * args _U_)
8394 proto_tree_add_expert(tree, pinfo, &ei_gtp_unknown_extention_header, tvb, offset, 1);
8396 return tvb_reported_length_remaining(tvb, offset);
8400 track_gtp_session(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gtp_hdr_t * gtp_hdr, wmem_list_t *teid_list, wmem_list_t *ip_list, guint32 last_teid, address last_ip)
8402 guint32 *session, frame_teid_cp;
8407 session = (guint32*)g_hash_table_lookup(session_table, &pinfo->num);
8409 it = proto_tree_add_uint(tree, hf_gtp_session, tvb, 0, 0, *session);
8410 PROTO_ITEM_SET_GENERATED(it);
8415 if (!PINFO_FD_VISITED(pinfo) && gtp_version == 1) {
8416 /* If the message does not have any session ID */
8417 session = (guint32*)g_hash_table_lookup(session_table, &pinfo->num);
8419 /* If the message is not a CPDPCRES, CPDPCREQ, UPDPREQ, UPDPRES then we remove its information from teid and ip lists */
8420 if ((gtp_hdr->message != GTP_MSG_CREATE_PDP_RESP && gtp_hdr->message != GTP_MSG_CREATE_PDP_REQ && gtp_hdr->message != GTP_MSG_UPDATE_PDP_RESP
8421 && gtp_hdr->message != GTP_MSG_UPDATE_PDP_REQ)) {
8422 /* If the lists are not empty*/
8423 if (wmem_list_count(teid_list) && wmem_list_count(ip_list)) {
8424 remove_frame_info(&pinfo->num);
8428 if (gtp_hdr->message == GTP_MSG_CREATE_PDP_REQ) {
8429 /* If CPDPCREQ and not already in the list then we create a new session*/
8430 add_gtp_session(pinfo->num, gtp_session_count++);
8431 } else if (gtp_hdr->message != GTP_MSG_CREATE_PDP_RESP) {
8432 /* If this is an error indication then we have to check the session id that belongs to the message with the same data teid and ip */
8433 if (gtp_hdr->message == GTP_MSG_ERR_IND) {
8434 if (get_frame(last_ip, last_teid, &frame_teid_cp) == 1) {
8435 session = (guint32*)g_hash_table_lookup(session_table, &frame_teid_cp);
8436 if (session != NULL) {
8437 /* We add the corresponding session to the session list*/
8438 add_gtp_session(pinfo->num, *session);
8443 /* We have to check if its teid == teid_cp and ip.dst == gsn_ipv4 from the lists, if that is the case then we have to assign
8444 the corresponding session ID */
8445 if ((get_frame(pinfo->dst, (guint32)gtp_hdr->teid, &frame_teid_cp) == 1)) {
8446 /* Then we have to set its session ID */
8447 session = (guint32*)g_hash_table_lookup(session_table, &frame_teid_cp);
8448 if (session != NULL) {
8449 /* We add the corresponding session to the list so that when a response came we can associate its session ID*/
8450 add_gtp_session(pinfo->num, *session);
8460 dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
8463 gtp_hdr_t *gtp_hdr = NULL;
8464 proto_tree *gtp_tree = NULL, *ext_tree;
8465 proto_item *ti = NULL, *tf, *ext_hdr_len_item, *message_item;
8466 int i, offset = 0, checked_field, mandatory;
8467 gboolean gtp_prime, has_SN;
8470 guint8 pdu_no, next_hdr = 0;
8472 guint ext_hdr_length;
8473 guint16 ext_hdr_pdcpsn;
8477 guint8 acfield_len = 0;
8478 guint8 control_field;
8479 gtp_msg_hash_t *gcrp = NULL;
8480 conversation_t *conversation;
8481 gtp_conv_info_t *gtp_info;
8482 session_args_t *args = NULL;
8484 /* Do we have enough bytes for the version and message type? */
8485 if (!tvb_bytes_exist(tvb, 0, 2)) {
8486 /* No - reject the packet. */
8489 octet = tvb_get_guint8(tvb, 0);
8490 if (((octet >> 5) & 0x07) > 2) {
8491 /* Version > 2; reject the packet */
8494 octet = tvb_get_guint8(tvb, 1);
8495 if (octet == GTP_MSG_UNKNOWN || try_val_to_str(octet, gtp_message_type) == NULL) {
8496 /* Unknown message type; reject the packet */
8500 /* Setting everything to 0, so that the TEID is 0 for GTP version 0
8501 * The magic number should perhaps be replaced.
8503 gtp_hdr = wmem_new0(wmem_packet_scope(), gtp_hdr_t);
8505 /* Setting the TEID to -1 to say that the TEID is not valid for this packet */
8508 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTP");
8509 col_clear(pinfo->cinfo, COL_INFO);
8511 if (g_gtp_session) {
8512 args = wmem_new0(wmem_packet_scope(), session_args_t);
8513 args->last_cause = 128; /* It stores the last cause decoded. Cause accepted by default */
8514 /* We create the auxiliary lists */
8515 args->teid_list = wmem_list_new(wmem_packet_scope());
8516 args->ip_list = wmem_list_new(wmem_packet_scope());
8520 * Do we have a conversation for this connection?
8522 conversation = find_or_create_conversation(pinfo);
8525 * Do we already know this conversation?
8527 gtp_info = (gtp_conv_info_t *)conversation_get_proto_data(conversation, proto_gtp);
8528 if (gtp_info == NULL) {
8529 /* No. Attach that information to the conversation, and add
8530 * it to the list of information structures.
8532 gtp_info = (gtp_conv_info_t *)wmem_alloc(wmem_file_scope(), sizeof(gtp_conv_info_t));
8533 /*Request/response matching tables*/
8534 gtp_info->matched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_matched);
8535 gtp_info->unmatched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_unmatched);
8537 conversation_add_proto_data(conversation, proto_gtp, gtp_info);
8539 gtp_info->next = gtp_info_items;
8540 gtp_info_items = gtp_info;
8543 gtp_hdr->flags = tvb_get_guint8(tvb, offset);
8545 if (!(gtp_hdr->flags & 0x10)){
8551 switch ((gtp_hdr->flags >> 5) & 0x07) {
8564 const int * gtp_prime_flags[] = {
8565 &hf_gtp_prime_flags_ver,
8567 &hf_gtp_flags_spare1,
8570 const int * gtp_prime_v0_flags[] = {
8571 &hf_gtp_prime_flags_ver,
8573 &hf_gtp_flags_spare1,
8574 &hf_gtp_flags_hdr_length,
8578 ti = proto_tree_add_item(tree, proto_gtpprime, tvb, 0, -1, ENC_NA);
8579 gtp_tree = proto_item_add_subtree(ti, ett_gtp);
8581 /* Octet 8 7 6 5 4 3 2 1
8582 * 1 Version | PT| Spare '1 1 1 '| ' 0/1 '
8585 /* Bit 1 of octet 1 is not used in GTP' (except in v0), and it is marked '0'
8586 * in the GTP' header. It is in use in GTP' v0 and distinguishes the used header-length.
8587 * In the case of GTP' v0, this bit being marked one (1) indicates the usage of the 6
8588 * octets header. If the bit is set to '0' (usually the case) the 20-octet header is used.
8589 * For all other versions of GTP', this bit is not used and is set to '0'. However,
8590 * this does not suggest the use of the 20-octet header, rather a shorter 6-octet header.
8592 if (gtp_version == 0) {
8593 proto_tree_add_bitmask_value_with_flags(gtp_tree, tvb, offset, hf_gtp_flags,
8594 ett_gtp_flags, gtp_prime_v0_flags, gtp_hdr->flags, BMT_NO_APPEND);
8596 proto_tree_add_bitmask_value_with_flags(gtp_tree, tvb, offset, hf_gtp_flags,
8597 ett_gtp_flags, gtp_prime_flags, gtp_hdr->flags, BMT_NO_APPEND);
8600 const int * gtp_flags[] = {
8603 &hf_gtp_flags_spare2,
8609 const int * gtp_v0_flags[] = {
8612 &hf_gtp_flags_spare1,
8616 ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, ENC_NA);
8617 gtp_tree = proto_item_add_subtree(ti, ett_gtp);
8619 if (gtp_version == 0) {
8620 proto_tree_add_bitmask_value_with_flags(gtp_tree, tvb, offset, hf_gtp_flags,
8621 ett_gtp_flags, gtp_v0_flags, gtp_hdr->flags, BMT_NO_APPEND);
8623 proto_tree_add_bitmask_value_with_flags(gtp_tree, tvb, offset, hf_gtp_flags,
8624 ett_gtp_flags, gtp_flags, gtp_hdr->flags, BMT_NO_APPEND);
8630 gtp_hdr->message = tvb_get_guint8(tvb, offset);
8631 /* Link direction is needed to properly dissect PCO */
8632 switch(gtp_hdr->message){
8633 case GTP_MSG_DELETE_PDP_REQ:
8634 case GTP_MSG_UPDATE_PDP_REQ:
8635 case GTP_MSG_CREATE_PDP_REQ:
8636 case GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ:
8637 case GTP_MSG_PDU_NOTIFY_REQ:
8638 case GTP_MSG_PDU_NOTIFY_REJ_REQ:
8639 case GTP_MSG_FORW_RELOC_REQ: /* direction added for UTRAN Container decode */
8640 pinfo->link_dir = P2P_DIR_UL;
8642 case GTP_MSG_DELETE_PDP_RESP:
8643 case GTP_MSG_UPDATE_PDP_RESP:
8644 case GTP_MSG_CREATE_PDP_RESP:
8645 case GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP:
8646 case GTP_MSG_FORW_RELOC_RESP: /* direction added for UTRAN Container decode */
8647 pinfo->link_dir = P2P_DIR_DL;
8652 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr->message, >p_message_type_ext, "Unknown"));
8653 message_item = proto_tree_add_uint(gtp_tree, hf_gtp_message_type, tvb, offset, 1, gtp_hdr->message);
8656 gtp_hdr->length = tvb_get_ntohs(tvb, offset);
8657 proto_tree_add_uint(gtp_tree, hf_gtp_length, tvb, 2, 2, gtp_hdr->length);
8660 /* We initialize the sequence number*/
8663 seq_no = tvb_get_ntohs(tvb, offset);
8665 proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
8667 /* If GTP' version is 0 and bit 1 is 0 20 bytes header is used, dissect it */
8668 if( (gtp_version == 0) && ((gtp_hdr->flags & 0x01) == 0) ) {
8669 proto_tree_add_item(gtp_tree, hf_gtp_dummy_octets, tvb, offset, 14, ENC_NA);
8673 set_actual_length(tvb, offset + gtp_hdr->length);
8675 switch (gtp_version) {
8677 seq_no = tvb_get_ntohs(tvb, offset);
8679 proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
8682 flow_label = tvb_get_ntohs(tvb, offset);
8683 proto_tree_add_uint(gtp_tree, hf_gtp_flow_label, tvb, offset, 2, flow_label);
8686 pdu_no = tvb_get_guint8(tvb, offset);
8687 proto_tree_add_uint(gtp_tree, hf_gtp_sndcp_number, tvb, offset, 1, pdu_no);
8690 tid_str = id_to_str(tvb, offset);
8691 proto_tree_add_string(gtp_tree, hf_gtp_tid, tvb, offset, 8, tid_str);
8694 set_actual_length(tvb, offset + gtp_hdr->length);
8698 gtp_hdr->teid = tvb_get_ntohl(tvb, offset);
8699 proto_tree_add_item(gtp_tree, hf_gtp_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
8702 set_actual_length(tvb, offset + gtp_hdr->length);
8704 /* Are sequence number/N-PDU Number/extension header present?
8705 See NOTE 5 of Figure 2 of 3GPP TS 29.060 version 4.3.0
8706 Release 4 - the Sequence Number, N-PDU Number, and
8707 Next Extension Header fields are present if any of
8708 GTP_E_MASK, GTP_S_MASK, or GTP_PN_MASK are set. */
8709 if (gtp_hdr->flags & (GTP_E_MASK|GTP_S_MASK|GTP_PN_MASK)) {
8710 /* Those fields are only *interpreted* if the
8711 particular flag for the field is set. */
8712 if (gtp_hdr->flags & GTP_S_MASK) {
8713 seq_no = tvb_get_ntohs(tvb, offset);
8715 proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
8719 if (gtp_hdr->flags & GTP_PN_MASK) {
8720 pdu_no = tvb_get_guint8(tvb, offset);
8721 proto_tree_add_uint(gtp_tree, hf_gtp_npdu_number, tvb, offset, 1, pdu_no);
8725 if (gtp_hdr->flags & GTP_E_MASK) {
8726 next_hdr = tvb_get_guint8(tvb, offset);
8727 proto_tree_add_uint(gtp_tree, hf_gtp_ext_hdr_next, tvb, offset, 1, next_hdr);
8729 while (next_hdr != 0) {
8730 ext_hdr_length = tvb_get_guint8(tvb, offset);
8731 tf = proto_tree_add_item(gtp_tree, hf_gtp_ext_hdr, tvb, offset, ext_hdr_length*4, ENC_NA);
8732 ext_tree = proto_item_add_subtree(tf, ett_gtp_ext_hdr);
8733 ext_hdr_len_item = proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_length, tvb, offset,1, ENC_BIG_ENDIAN);
8734 if (ext_hdr_length == 0) {
8735 expert_add_info_format(pinfo, ext_hdr_len_item, &ei_gtp_ext_length_mal,
8736 "Extension header length is zero");
8737 return tvb_reported_length(tvb);
8743 case GTP_EXT_HDR_UDP_PORT:
8745 * 3GPP 29.281 v9.0.0, 5.2.2.1 UDP Port
8746 * "This extension header may be transmitted in
8747 * Error Indication messages to provide the UDP
8748 * Source Port of the G-PDU that triggered the
8749 * Error Indication. It is 4 octets long, and
8750 * therefore the Length field has value 1"
8752 if (ext_hdr_length == 1) {
8753 /* UDP Port of source */
8754 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_udp_port, tvb, offset, 2, ENC_BIG_ENDIAN);
8757 expert_add_info_format(pinfo, ext_tree, &ei_gtp_ext_length_warn, "The length field for the UDP Port Extension header should be 1.");
8761 case GTP_EXT_HDR_RAN_CONT:
8763 * 3GPP 29.281 v15.2.0, 5.2.2.4 RAN Container
8764 * This extension header may be transmitted in
8765 * a G-PDU over the X2 user plane interface
8766 * between the eNBs. The RAN Container has a
8767 * variable length and its content is specified
8768 * in 3GPP TS 36.425 [25]. A G-PDU message with
8769 * this extension header may be sent without a T-PDU.
8771 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_ran_cont, tvb, offset, (4*ext_hdr_length)-1, ENC_NA);
8774 case GTP_EXT_HDR_LONG_PDCP_PDU:
8775 /* Long PDCP PDU Number
8776 * 3GPP 29.281 v15.2.0, 5.2.2.2A Long PDCP PDU Number
8777 * This extension header is used for direct X2 or
8778 * indirect S1 DL data forwarding during a Handover
8779 * procedure between two eNBs. The Long PDCP PDU number
8780 * extension header is 8 octets long, and therefore
8781 * the Length field has value 2.
8782 * The PDCP PDU number field of the Long PDCP PDU number
8783 * extension header has a maximum value which requires 18
8784 * bits (see 3GPP TS 36.323 [24]). Bit 2 of octet 2 is
8785 * the most significant bit and bit 1 of octet 4 is the
8786 * least significant bit, see Figure 5.2.2.2A-1. Bits 8 to
8787 * 3 of octet 2, and Bits 8 to 1 of octets 5 to 7 shall be
8789 * NOTE: A G-PDU which includes a PDCP PDU Number contains
8790 * either the extension header PDCP PDU Number or Long PDCP
8793 if (ext_hdr_length == 2) {
8794 proto_tree_add_bits_item(ext_tree, hf_gtp_ext_hdr_spare_bits, tvb, offset<<3, 6, ENC_BIG_ENDIAN);
8795 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_long_pdcp_sn, tvb, offset, 3, ENC_BIG_ENDIAN);
8796 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_spare_bytes, tvb, offset+3, 3, ENC_NA);
8798 expert_add_info_format(pinfo, ext_tree, &ei_gtp_ext_length_warn, "The length field for the Long PDCP SN Extension header should be 2.");
8802 case GTP_EXT_HDR_XW_RAN_CONT:
8804 * 3GPP 29.281 v15.2.0, 5.2.2.5 Xw RAN Container
8805 * This extension header may be transmitted in a
8806 * G-PDU over the Xw user plane interface between
8807 * the eNB and the WLAN Termination (WT). The Xw
8808 * RAN Container has a variable length and its
8809 * content is specified in 3GPP TS 36.464 [27].
8810 * A G-PDU message with this extension header may
8811 * be sent without a T-PDU.
8813 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_xw_ran_cont, tvb, offset, (4*ext_hdr_length)-1, ENC_NA);
8816 case GTP_EXT_HDR_NR_RAN_CONT:
8818 * 3GPP 29.281 v15.2.0, 5.2.2.6 NR RAN Container
8819 * This extension header may be transmitted in a
8820 * G-PDU over the X2-U, Xn-U and F1-U user plane
8821 * interfaces, within NG-RAN and, for EN-DC, within
8822 * E-UTRAN. The NR RAN Container has a variable
8823 * length and its content is specified in 3GPP TS
8824 * 38.425 [30]. A G-PDU message with this extension
8825 * header may be sent without a T-PDU.
8827 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_nr_ran_cont, tvb, offset, (4*ext_hdr_length)-1, ENC_NA);
8830 case GTP_EXT_HDR_PDU_SESSION_CONT:
8831 /* PDU Session Container
8832 * 3GPP 29.281 v15.2.0, 5.2.2.7 PDU Session Container
8833 * This extension header may be transmitted in a G-PDU
8834 * over the N3 and N9 user plane interfaces, between
8835 * NG-RAN and UPF, or between two UPFs. The PDU Session
8836 * Container has a variable length and its content is
8837 * specified in 3GPP TS 38.415 [31].
8839 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_pdu_session_cont, tvb, offset, (4*ext_hdr_length)-1, ENC_NA);
8842 case GTP_EXT_HDR_PDCP_SN:
8844 * 3GPP 29.281 v9.0.0, 5.2.2.2 PDCP PDU Number
8846 * "This extension header is transmitted, for
8847 * example in UTRAN, at SRNS relocation time,
8848 * to provide the PDCP sequence number of not
8849 * yet acknowledged N-PDUs. It is 4 octets long,
8850 * and therefore the Length field has value 1.
8852 * When used during a handover procedure between
8853 * two eNBs at the X2 interface (direct DL data
8854 * forwarding) or via the S1 interface (indirect
8855 * DL data forwarding) in E-UTRAN, bit 8 of octet
8856 * 2 is spare and shall be set to zero.
8858 * Wireshark Note: TS 29.060 does not define bit
8859 * 5-6 as spare, so no check is possible unless
8860 * a preference is used.
8862 /* First byte is length (should be 1) */
8863 if (ext_hdr_length == 1) {
8864 proto_item* ext_item;
8866 ext_hdr_pdcpsn = tvb_get_ntohs(tvb, offset);
8867 ext_item = proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_pdcpsn, tvb, offset, 2, ENC_BIG_ENDIAN);
8868 if (ext_hdr_pdcpsn & 0x8000) {
8869 expert_add_info(pinfo, ext_item, &ei_gtp_ext_hdr_pdcpsn);
8872 expert_add_info_format(pinfo, ext_tree, &ei_gtp_ext_length_warn, "The length field for the PDCP SN Extension header should be 1.");
8876 case GTP_EXT_HDR_SUSPEND_REQ:
8877 /* Suspend Request */
8880 case GTP_EXT_HDR_SUSPEND_RESP:
8881 /* Suspend Response */
8887 offset += ext_hdr_length*4 - 2;
8889 next_hdr = tvb_get_guint8(tvb, offset);
8890 proto_tree_add_uint(ext_tree, hf_gtp_ext_hdr_next, tvb, offset, 1, next_hdr);
8902 if (gtp_hdr->message != GTP_MSG_TPDU) {
8904 mandatory = 0; /* check order of GTP fields against ETSI */
8905 while (tvb_reported_length_remaining(tvb, offset) > 0) {
8906 ext_hdr_val = tvb_get_guint8(tvb, offset);
8907 if (g_gtp_etsi_order) {
8908 checked_field = check_field_presence(gtp_hdr->message, ext_hdr_val, &mandatory);
8909 switch (checked_field) {
8911 expert_add_info(pinfo, message_item, &ei_gtp_message_not_found);
8914 expert_add_info(pinfo, message_item, &ei_gtp_field_not_present);
8919 expert_add_info_format(pinfo, message_item, &ei_gtp_wrong_next_field, "[WARNING] wrong next field, should be: %s",
8920 val_to_str_ext_const(checked_field, >p_val_ext, "Unknown extension field"));
8926 while (gtpopt[++i].optcode)
8927 if (gtpopt[i].optcode == ext_hdr_val)
8929 offset = offset + (*gtpopt[i].decode) (tvb, offset, pinfo, gtp_tree, args);
8932 if (args && !PINFO_FD_VISITED(pinfo)) {
8933 /* We insert the lists inside the table*/
8934 fill_map(args->teid_list, args->ip_list, pinfo->num);
8936 /*Use sequence number to track Req/Resp pairs*/
8938 guint8 cause_aux = 128; /* Cause accepted by default. Only used when args is NULL */
8940 cause_aux = args->last_cause;
8942 gcrp = gtp_match_response(tvb, pinfo, gtp_tree, seq_no, gtp_hdr->message, gtp_info, cause_aux);
8943 /*pass packet to tap for response time reporting*/
8945 tap_queue_packet(gtp_tap,pinfo,gcrp);
8950 track_gtp_session(tvb, pinfo, gtp_tree, gtp_hdr, args->teid_list, args->ip_list, args->last_teid, args->last_ip);
8952 proto_item_set_end(ti, tvb, offset);
8954 if ((gtp_hdr->message == GTP_MSG_TPDU) && dissect_tpdu_as == GTP_TPDU_AS_TPDU) {
8955 if(tvb_reported_length_remaining(tvb, offset) > 0){
8956 proto_tree_add_item(gtp_tree, hf_gtp_tpdu_data, tvb, offset, -1, ENC_NA);
8958 sub_proto = tvb_get_guint8(tvb, offset);
8960 if ((sub_proto >= 0x45) && (sub_proto <= 0x4e)) {
8961 /* this is most likely an IPv4 packet
8962 * we can exclude 0x40 - 0x44 because the minimum header size is 20 octets
8963 * 0x4f is excluded because PPP protocol type "IPv6 header compression"
8964 * with protocol field compression is more likely than a plain IPv4 packet with 60 octet header size */
8966 next_tvb = tvb_new_subset_remaining(tvb, offset);
8967 call_dissector(ip_handle, next_tvb, pinfo, tree);
8969 } else if ((sub_proto & 0xf0) == 0x60) {
8970 /* this is most likely an IPv6 packet */
8971 next_tvb = tvb_new_subset_remaining(tvb, offset);
8972 call_dissector(ipv6_handle, next_tvb, pinfo, tree);
8974 /* this seems to be a PPP packet */
8976 if (sub_proto == 0xff) {
8977 /* this might be an address field, even it shouldn't be here */
8978 control_field = tvb_get_guint8(tvb, offset + 1);
8979 if (control_field == 0x03)
8980 /* now we are pretty sure that address and control field are mistakenly inserted -> ignore it for PPP dissection */
8984 next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
8985 call_dissector(ppp_handle, next_tvb, pinfo, tree);
8989 col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <");
8990 col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
8992 else if ((gtp_hdr->message == GTP_MSG_TPDU) && dissect_tpdu_as == GTP_TPDU_AS_SYNC) {
8993 next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
8994 call_dissector(sync_handle, next_tvb, pinfo, tree);
8995 col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <");
8996 col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
8999 tap_queue_packet(gtpv1_tap,pinfo, gtp_hdr);
9001 return tvb_reported_length(tvb);
9005 dissect_gtpprime(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
9006 void *private_data _U_)
9008 return dissect_gtp_common(tvb, pinfo, tree);
9012 dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
9013 void *private_data _U_)
9018 * Do we have enough data to check the first byte?
9020 if (!tvb_bytes_exist(tvb, 0, 1)) {
9026 * If this is GTPv2-C call the gtpv2 dissector if present
9027 * Should this be moved to after the conversation stuff to retain that functionality for GTPv2 ???
9029 version = tvb_get_guint8(tvb,0)>>5;
9031 /* Unknown version - reject the packet */
9035 /* GTPv2-C 3GPP TS 29.274 */
9037 call_dissector(gtpv2_handle, tvb, pinfo, tree);
9038 return tvb_reported_length(tvb);
9042 return dissect_gtp_common(tvb, pinfo, tree);
9048 gtp_session_count = 1;
9049 session_table = g_hash_table_new(g_int_hash, g_int_equal);
9050 frame_tree = wmem_tree_new(wmem_file_scope());
9056 gtp_conv_info_t *gtp_info;
9058 /* Free up state attached to the gtp_info structures */
9059 for (gtp_info = gtp_info_items; gtp_info != NULL; ) {
9060 gtp_conv_info_t *next;
9062 g_hash_table_destroy(gtp_info->matched);
9063 gtp_info->matched=NULL;
9064 g_hash_table_destroy(gtp_info->unmatched);
9065 gtp_info->unmatched=NULL;
9067 next = gtp_info->next;
9071 /* Free up state attached to the gtp session structures */
9072 gtp_info_items = NULL;
9074 if (session_table != NULL) {
9075 g_hash_table_destroy(session_table);
9077 session_table = NULL;
9081 proto_register_gtp(void)
9083 module_t *gtp_module;
9084 expert_module_t* expert_gtp;
9088 static hf_register_info hf_gtp[] = {
9091 { "IE Id", "gtp.ie_id",
9092 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >p_val_ext, 0x0,
9095 {&hf_gtp_response_in,
9096 { "Response In", "gtp.response_in",
9097 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9098 "The response to this GTP request is in this frame", HFILL}
9100 {&hf_gtp_response_to,
9101 { "Response To", "gtp.response_to",
9102 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
9103 "This is a response to the GTP request in this frame", HFILL}
9106 { "Time", "gtp.time",
9107 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
9108 "The time between the Request and the Response", HFILL}
9112 FT_STRING, BASE_NONE, NULL, 0,
9113 "Access Point Name", HFILL}
9116 { "Cause", "gtp.cause",
9117 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &cause_type_ext, 0,
9118 "Cause of operation", HFILL}
9121 { "Charging characteristics", "gtp.chrg_char",
9122 FT_UINT16, BASE_DEC, NULL, 0,
9125 {&hf_gtp_chrg_char_s,
9126 { "Spare", "gtp.chrg_char_s",
9127 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_S,
9130 {&hf_gtp_chrg_char_n,
9131 { "Normal charging", "gtp.chrg_char_n",
9132 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_N,
9135 {&hf_gtp_chrg_char_p,
9136 { "Prepaid charging", "gtp.chrg_char_p",
9137 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_P,
9140 {&hf_gtp_chrg_char_f,
9141 { "Flat rate charging", "gtp.chrg_char_f",
9142 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_F,
9145 {&hf_gtp_chrg_char_h,
9146 { "Hot billing charging", "gtp.chrg_char_h",
9147 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_H,
9150 {&hf_gtp_chrg_char_r,
9151 { "Reserved", "gtp.chrg_char_r",
9152 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_R,
9156 { "Charging ID", "gtp.chrg_id",
9157 FT_UINT32, BASE_HEX_DEC, NULL, 0,
9161 { "CG address IPv4", "gtp.chrg_ipv4",
9162 FT_IPv4, BASE_NONE, NULL, 0,
9163 "Charging Gateway address IPv4", HFILL}
9166 { "CG address IPv6", "gtp.chrg_ipv6",
9167 FT_IPv6, BASE_NONE, NULL, 0,
9168 "Charging Gateway address IPv6", HFILL}
9170 {&hf_gtp_ext_flow_label,
9171 { "Flow Label Data I", "gtp.ext_flow_label",
9172 FT_UINT16, BASE_HEX, NULL, 0,
9173 "Flow label data", HFILL}
9176 { "Extension identifier", "gtp.ext_id",
9177 FT_UINT16, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0,
9178 "Private Enterprise number", HFILL}
9181 { "Extension value", "gtp.ext_val",
9182 FT_BYTES, BASE_NONE, NULL, 0,
9186 { "Flags", "gtp.flags",
9187 FT_UINT8, BASE_HEX, NULL, 0,
9188 "Ver/PT/Spare...", HFILL}
9191 { "Extension header", "gtp.ext_hdr",
9192 FT_NONE, BASE_NONE, NULL, 0,
9195 {&hf_gtp_ext_hdr_next,
9196 { "Next extension header type", "gtp.ext_hdr.next",
9197 FT_UINT8, BASE_HEX, VALS(next_extension_header_fieldvals), 0,
9200 {&hf_gtp_ext_hdr_ran_cont,
9201 { "RAN Container", "gtp.ext_hdr.ran_cont",
9202 FT_BYTES, BASE_NONE, NULL, 0,
9205 {&hf_gtp_ext_hdr_spare_bits,
9206 { "Spare", "gtp.ext_hdr.spare_bits",
9207 FT_UINT8, BASE_HEX, NULL, 0,
9210 {&hf_gtp_ext_hdr_spare_bytes,
9211 { "Spare", "gtp.ext_hdr.spare_bytes",
9212 FT_BYTES, BASE_NONE, NULL, 0,
9215 {&hf_gtp_ext_hdr_long_pdcp_sn,
9216 { "Long PDCP Sequence Number", "gtp.ext_hdr.long_pdcp_sn",
9217 FT_UINT24, BASE_DEC, NULL, 0,
9220 {&hf_gtp_ext_hdr_xw_ran_cont,
9221 { "Xw RAN Container", "gtp.ext_hdr.xw_ran_cont",
9222 FT_BYTES, BASE_NONE, NULL, 0,
9225 {&hf_gtp_ext_hdr_nr_ran_cont,
9226 { "NR RAN Container", "gtp.ext_hdr.nr_ran_cont",
9227 FT_BYTES, BASE_NONE, NULL, 0,
9230 {&hf_gtp_ext_hdr_pdu_session_cont,
9231 { "PDU Session Container", "gtp.ext_hdr.pdu_session_cont",
9232 FT_BYTES, BASE_NONE, NULL, 0,
9235 {&hf_gtp_ext_hdr_pdcpsn,
9236 { "PDCP Sequence Number", "gtp.ext_hdr.pdcp_sn",
9237 FT_UINT16, BASE_DEC, NULL, 0,
9240 {&hf_gtp_ext_hdr_udp_port,
9241 { "UDP Port", "gtp.ext_hdr.udp_port",
9242 FT_UINT16, BASE_DEC, NULL, 0,
9245 {&hf_gtp_ext_hdr_length,
9246 { "Extension Header Length", "gtp.ext_hdr.length",
9247 FT_UINT8, BASE_DEC, NULL, 0,
9251 { "Version", "gtp.flags.version",
9252 FT_UINT8, BASE_DEC, VALS(ver_types), GTP_VER_MASK,
9253 "GTP Version", HFILL}
9255 {&hf_gtp_prime_flags_ver,
9256 { "Version", "gtp.prim.flags.version",
9257 FT_UINT8, BASE_DEC,NULL, GTP_VER_MASK,
9258 "GTP' Version", HFILL}
9261 { "Protocol type", "gtp.flags.payload",
9262 FT_UINT8, BASE_DEC, VALS(pt_types), GTP_PT_MASK,
9265 {&hf_gtp_flags_spare1,
9266 { "Reserved", "gtp.flags.reserved",
9267 FT_UINT8, BASE_DEC, NULL, GTP_SPARE1_MASK,
9268 "Reserved (shall be sent as '111' )", HFILL}
9270 {&hf_gtp_flags_hdr_length,
9271 { "Header length", "gtp.flags.hdr_length",
9272 FT_BOOLEAN, 8, TFS(>p_hdr_length_vals), 0x01,
9276 { "Is SNDCP N-PDU included?", "gtp.flags.snn",
9277 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_SNN_MASK,
9278 "Is SNDCP N-PDU LLC Number included? (1 = yes, 0 = no)", HFILL}
9280 {&hf_gtp_flags_spare2,
9281 { "Reserved", "gtp.flags.reserved",
9282 FT_UINT8, BASE_DEC, NULL, GTP_SPARE2_MASK,
9283 "Reserved (shall be sent as '1' )", HFILL}
9286 { "Is Next Extension Header present?", "gtp.flags.e",
9287 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_E_MASK,
9288 "Is Next Extension Header present? (1 = yes, 0 = no)", HFILL}
9291 { "Is Sequence Number present?", "gtp.flags.s",
9292 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_S_MASK,
9293 "Is Sequence Number present? (1 = yes, 0 = no)", HFILL}
9296 { "Is N-PDU number present?", "gtp.flags.pn",
9297 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_PN_MASK,
9298 "Is N-PDU number present? (1 = yes, 0 = no)", HFILL}
9301 { "Flow Label Data II", "gtp.flow_ii",
9302 FT_UINT16, BASE_DEC, NULL, 0,
9303 "Downlink flow label data", HFILL}
9305 {&hf_gtp_flow_label,
9306 { "Flow label", "gtp.flow_label",
9307 FT_UINT16, BASE_HEX, NULL, 0,
9311 { "Flow label Signalling", "gtp.flow_sig",
9312 FT_UINT16, BASE_HEX, NULL, 0,
9315 {&hf_gtp_gsn_addr_len,
9316 { "GSN Address Length", "gtp.gsn_addr_len",
9317 FT_UINT8, BASE_DEC, NULL, GTP_EXT_GSN_ADDR_LEN_MASK,
9320 {&hf_gtp_gsn_addr_type,
9321 { "GSN Address Type", "gtp.gsn_addr_type",
9322 FT_UINT8, BASE_DEC, VALS(gsn_addr_type), GTP_EXT_GSN_ADDR_TYPE_MASK,
9326 { "GSN address IPv4", "gtp.gsn_ipv4",
9327 FT_IPv4, BASE_NONE, NULL, 0,
9331 { "GSN address IPv6", "gtp.gsn_ipv6",
9332 FT_IPv6, BASE_NONE, NULL, 0,
9336 { "Length", "gtp.length",
9337 FT_UINT16, BASE_DEC, NULL, 0,
9338 "Length (i.e. number of octets after TID or TEID)", HFILL}
9341 { "MAP cause", "gtp.map_cause",
9342 FT_UINT8, BASE_DEC, VALS(gsm_old_GSMMAPLocalErrorcode_vals), 0,
9345 {&hf_gtp_message_type,
9346 { "Message Type", "gtp.message",
9347 FT_UINT8, BASE_HEX|BASE_EXT_STRING, >p_message_type_ext, 0x0,
9348 "GTP Message Type", HFILL}
9351 { "MS not reachable reason", "gtp.ms_reason",
9352 FT_UINT8, BASE_DEC, VALS(ms_not_reachable_type), 0,
9356 { "MS validated", "gtp.ms_valid",
9357 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9361 { "Node address IPv4", "gtp.node_ipv4",
9362 FT_IPv4, BASE_NONE, NULL, 0,
9363 "Recommended node address IPv4", HFILL}
9366 { "Node address IPv6", "gtp.node_ipv6",
9367 FT_IPv6, BASE_NONE, NULL, 0,
9368 "Recommended node address IPv6", HFILL}
9370 {&hf_gtp_npdu_number,
9371 { "N-PDU Number", "gtp.npdu_number",
9372 FT_UINT8, BASE_HEX, NULL, 0,
9376 { "NSAPI", "gtp.nsapi",
9377 FT_UINT8, BASE_DEC, NULL, 0x0f,
9378 "Network layer Service Access Point Identifier", HFILL}
9380 {&hf_gtp_qos_version,
9381 { "Version", "gtp.qos_version",
9382 FT_UINT8, BASE_HEX, NULL, 0,
9383 "Version of the QoS Profile", HFILL}
9385 {&hf_gtp_qos_spare1,
9386 { "Spare", "gtp.qos_spare1",
9387 FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE1_MASK,
9388 "Spare (shall be sent as '00' )", HFILL}
9391 { "QoS delay", "gtp.qos_delay",
9392 FT_UINT8, BASE_DEC, VALS(qos_delay_type), GTP_EXT_QOS_DELAY_MASK,
9393 "Quality of Service Delay Class", HFILL}
9395 {&hf_gtp_qos_reliability,
9396 { "QoS reliability", "gtp.qos_reliability",
9397 FT_UINT8, BASE_DEC, VALS(qos_reliability_type), GTP_EXT_QOS_RELIABILITY_MASK,
9398 "Quality of Service Reliability Class", HFILL}
9401 { "QoS peak", "gtp.qos_peak",
9402 FT_UINT8, BASE_DEC, VALS(qos_peak_type), GTP_EXT_QOS_PEAK_MASK,
9403 "Quality of Service Peak Throughput", HFILL}
9405 {&hf_gtp_qos_spare2,
9406 { "Spare", "gtp.qos_spare2",
9407 FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE2_MASK,
9408 "Spare (shall be sent as 0)", HFILL}
9410 {&hf_gtp_qos_precedence,
9411 { "QoS precedence", "gtp.qos_precedence",
9412 FT_UINT8, BASE_DEC, VALS(qos_precedence_type), GTP_EXT_QOS_PRECEDENCE_MASK,
9413 "Quality of Service Precedence Class", HFILL}
9415 {&hf_gtp_qos_spare3,
9416 { "Spare", "gtp.qos_spare3",
9417 FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE3_MASK,
9418 "Spare (shall be sent as '000' )", HFILL}
9421 { "QoS mean", "gtp.qos_mean",
9422 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &qos_mean_type_ext, GTP_EXT_QOS_MEAN_MASK,
9423 "Quality of Service Mean Throughput", HFILL}
9425 {&hf_gtp_qos_al_ret_priority,
9426 { "Allocation/Retention priority", "gtp.qos_al_ret_priority",
9427 FT_UINT8, BASE_DEC, NULL, 0,
9430 {&hf_gtp_qos_traf_class,
9431 { "Traffic class", "gtp.qos_traf_class",
9432 FT_UINT8, BASE_DEC, VALS(qos_traf_class), GTP_EXT_QOS_TRAF_CLASS_MASK,
9435 {&hf_gtp_qos_del_order,
9436 { "Delivery order", "gtp.qos_del_order",
9437 FT_UINT8, BASE_DEC, VALS(qos_del_order), GTP_EXT_QOS_DEL_ORDER_MASK,
9440 {&hf_gtp_qos_del_err_sdu,
9441 { "Delivery of erroneous SDU", "gtp.qos_del_err_sdu",
9442 FT_UINT8, BASE_DEC, VALS(qos_del_err_sdu), GTP_EXT_QOS_DEL_ERR_SDU_MASK,
9445 {&hf_gtp_qos_max_sdu_size,
9446 { "Maximum SDU size", "gtp.qos_max_sdu_size",
9447 FT_UINT8, BASE_DEC, VALS(qos_max_sdu_size), 0,
9450 {&hf_gtp_qos_max_ul,
9451 { "Maximum bit rate for uplink", "gtp.qos_max_ul",
9452 FT_UINT8, BASE_DEC, VALS(qos_max_ul), 0,
9455 {&hf_gtp_qos_max_dl,
9456 { "Maximum bit rate for downlink", "gtp.qos_max_dl",
9457 FT_UINT8, BASE_DEC, VALS(qos_max_dl), 0,
9460 {&hf_gtp_qos_res_ber,
9461 { "Residual BER", "gtp.qos_res_ber",
9462 FT_UINT8, BASE_DEC, VALS(qos_res_ber), GTP_EXT_QOS_RES_BER_MASK,
9463 "Residual Bit Error Rate", HFILL}
9465 {&hf_gtp_qos_sdu_err_ratio,
9466 { "SDU Error ratio", "gtp.qos_sdu_err_ratio",
9467 FT_UINT8, BASE_DEC, VALS(qos_sdu_err_ratio), GTP_EXT_QOS_SDU_ERR_RATIO_MASK,
9471 {&hf_gtp_qos_trans_delay,
9472 { "Transfer delay", "gtp.qos_trans_delay",
9473 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &qos_trans_delay_ext, GTP_EXT_QOS_TRANS_DELAY_MASK,
9476 {&hf_gtp_qos_traf_handl_prio,
9477 { "Traffic handling priority", "gtp.qos_traf_handl_prio",
9478 FT_UINT8, BASE_DEC, VALS(qos_traf_handl_prio), GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK,
9481 {&hf_gtp_qos_guar_ul,
9482 { "Guaranteed bit rate for uplink", "gtp.qos_guar_ul",
9483 FT_UINT8, BASE_DEC, VALS(qos_guar_ul), 0,
9486 {&hf_gtp_qos_guar_dl,
9487 { "Guaranteed bit rate for downlink", "gtp.qos_guar_dl",
9488 FT_UINT8, BASE_DEC, VALS(qos_guar_dl), 0,
9491 {&hf_gtp_qos_spare4,
9492 { "Spare", "gtp.qos_spare4",
9493 FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE4_MASK,
9494 "Spare (shall be sent as '000' )", HFILL}
9496 {&hf_gtp_qos_sig_ind,
9497 { "Signalling Indication", "gtp.sig_ind",
9498 FT_BOOLEAN, 8, TFS(>p_sig_ind), GTP_EXT_QOS_SIG_IND_MASK,
9501 {&hf_gtp_qos_src_stat_desc,
9502 { "Source Statistics Descriptor", "gtp.src_stat_desc",
9503 FT_UINT8, BASE_DEC, VALS(src_stat_desc_vals), GTP_EXT_QOS_SRC_STAT_DESC_MASK,
9507 {"Allocation/Retention Priority", "gtp.qos_arp",
9508 FT_UINT16, BASE_HEX, NULL, 0x0,
9511 { &hf_gtp_qos_arp_pci,
9512 {"Pre-emption Capability (PCI)", "gtp.qos_arp_pci",
9513 FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), 0x40,
9516 { &hf_gtp_qos_arp_pl,
9517 {"Priority Level", "gtp.qos_arp_pl",
9518 FT_UINT16, BASE_DEC, NULL, 0x3c,
9521 { &hf_gtp_qos_arp_pvi,
9522 {"Pre-emption Vulnerability (PVI)", "gtp.qos_arp_pvi",
9523 FT_BOOLEAN, 16, TFS(&tfs_disabled_enabled), 0x01,
9527 {"QCI", "gtp.qos_qci",
9528 FT_UINT8, BASE_DEC, NULL, 0x0,
9531 {&hf_gtp_qos_ul_mbr,
9532 {"Uplink Maximum Bit Rate", "gtp.qos_ul_mbr",
9533 FT_UINT64, BASE_DEC, NULL, 0x0,
9536 {&hf_gtp_qos_dl_mbr,
9537 {"Downlink Maximum Bit Rate", "gtp.qos_dl_mbr",
9538 FT_UINT64, BASE_DEC, NULL, 0x0,
9541 {&hf_gtp_qos_ul_gbr,
9542 {"Uplink Guaranteed Bit Rate", "gtp.qos_ul_gbr",
9543 FT_UINT64, BASE_DEC, NULL, 0x0,
9546 {&hf_gtp_qos_dl_gbr,
9547 {"Downlink Guaranteed Bit Rate", "gtp.qos_dl_gbr",
9548 FT_UINT64, BASE_DEC, NULL, 0x0,
9551 {&hf_gtp_qos_ul_apn_ambr,
9552 {"Uplink APN Aggregate Maximum Bit Rate", "gtp.qos_ul_apn_ambr",
9553 FT_UINT32, BASE_DEC, NULL, 0x0,
9556 {&hf_gtp_qos_dl_apn_ambr,
9557 {"Downlink APN Aggregate Maximum Bit Rate", "gtp.qos_dl_apn_ambr",
9558 FT_UINT32, BASE_DEC, NULL, 0x0,
9561 {&hf_gtp_pkt_flow_id,
9562 { "Packet Flow ID", "gtp.pkt_flow_id",
9563 FT_UINT8, BASE_DEC, NULL, 0,
9567 { "P-TMSI", "gtp.ptmsi",
9568 FT_UINT32, BASE_HEX, NULL, 0,
9569 "Packet-Temporary Mobile Subscriber Identity", HFILL}
9572 { "P-TMSI Signature", "gtp.ptmsi_sig",
9573 FT_UINT24, BASE_HEX, NULL, 0,
9576 {&hf_gtp_rab_gtpu_dn,
9577 { "Downlink GTP-U seq number", "gtp.rab_gtp_dn",
9578 FT_UINT16, BASE_DEC, NULL, 0,
9579 "Downlink GTP-U sequence number", HFILL}
9581 {&hf_gtp_rab_gtpu_up,
9582 { "Uplink GTP-U seq number", "gtp.rab_gtp_up",
9583 FT_UINT16, BASE_DEC, NULL, 0,
9584 "Uplink GTP-U sequence number", HFILL}
9586 {&hf_gtp_rab_pdu_dn,
9587 { "Downlink next PDCP-PDU seq number", "gtp.rab_pdu_dn",
9588 FT_UINT16, BASE_DEC, NULL, 0,
9589 "Downlink next PDCP-PDU sequence number", HFILL}
9591 {&hf_gtp_rab_pdu_up,
9592 { "Uplink next PDCP-PDU seq number", "gtp.rab_pdu_up",
9593 FT_UINT16, BASE_DEC, NULL, 0,
9594 "Uplink next PDCP-PDU sequence number", HFILL}
9596 {&hf_gtp_uli_geo_loc_type,
9597 { "Geographic Location Type", "gtp.geo_loc_type",
9598 FT_UINT8, BASE_DEC, VALS(geographic_location_type), 0,
9602 { "Cell ID (CI)", "gtp.cgi_ci",
9603 FT_UINT8, BASE_DEC, NULL, 0,
9607 { "Service Area Code (SAC)", "gtp.sai_sac",
9608 FT_UINT8, BASE_DEC, NULL, 0,
9612 { "Routing Area Code (RAC)", "gtp.rai_rac",
9613 FT_UINT8, BASE_DEC, NULL, 0,
9617 { "Location Area Code (LAC)", "gtp.lac",
9618 FT_UINT16, BASE_DEC, NULL, 0,
9623 FT_UINT16, BASE_DEC, NULL, 0,
9628 FT_UINT32, BASE_DEC, NULL, 0x0FFFFFFF,
9629 "E-UTRAN Cell Identifier", HFILL}
9631 {&hf_gtp_ranap_cause,
9632 { "RANAP cause", "gtp.ranap_cause",
9633 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ranap_cause_type_ext, 0,
9637 { "Recovery", "gtp.recovery",
9638 FT_UINT8, BASE_DEC, NULL, 0,
9639 "Restart counter", HFILL}
9642 { "Reordering required", "gtp.reorder",
9643 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9647 { "RNC address IPv4", "gtp.rnc_ipv4",
9648 FT_IPv4, BASE_NONE, NULL, 0,
9649 "Radio Network Controller address IPv4", HFILL}
9652 { "RNC address IPv6", "gtp.rnc_ipv6",
9653 FT_IPv6, BASE_NONE, NULL, 0,
9654 "Radio Network Controller address IPv6", HFILL}
9657 { "Radio Priority", "gtp.rp",
9658 FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_MASK,
9659 "Radio Priority for uplink tx", HFILL}
9662 { "NSAPI in Radio Priority", "gtp.rp_nsapi",
9663 FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_NSAPI_MASK,
9664 "Network layer Service Access Point Identifier in Radio Priority", HFILL}
9667 { "Radio Priority SMS", "gtp.rp_sms",
9668 FT_UINT8, BASE_DEC, NULL, 0,
9669 "Radio Priority for MO SMS", HFILL}
9672 { "Reserved", "gtp.rp_spare",
9673 FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_SPARE_MASK,
9677 { "Selection mode", "gtp.sel_mode",
9678 FT_UINT8, BASE_DEC, VALS(sel_mode_type), 0x03,
9681 {&hf_gtp_seq_number,
9682 { "Sequence number", "gtp.seq_number",
9683 FT_UINT16, BASE_HEX_DEC, NULL, 0,
9687 { "Session", "gtp.session",
9688 FT_UINT32, BASE_DEC, NULL, 0,
9691 {&hf_gtp_sndcp_number,
9692 { "SNDCP N-PDU LLC Number", "gtp.sndcp_number",
9693 FT_UINT8, BASE_HEX, NULL, 0,
9697 { "Teardown Indicator", "gtp.tear_ind",
9698 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
9702 { "TEID", "gtp.teid",
9703 FT_UINT32, BASE_HEX_DEC, NULL, 0,
9704 "Tunnel Endpoint Identifier", HFILL}
9707 { "TEID Control Plane", "gtp.teid_cp",
9708 FT_UINT32, BASE_HEX_DEC, NULL, 0,
9709 "Tunnel Endpoint Identifier Control Plane", HFILL}
9711 {&hf_gtp_ulink_teid_cp,
9712 { "Uplink TEID Control Plane", "gtp.ulink_teid_cp",
9713 FT_UINT32, BASE_HEX_DEC, NULL, 0,
9714 "Uplink Tunnel Endpoint Identifier Control Plane", HFILL}
9717 { "TEID Data I", "gtp.teid_data",
9718 FT_UINT32, BASE_HEX_DEC, NULL, 0,
9719 "Tunnel Endpoint Identifier Data I", HFILL}
9721 {&hf_gtp_ulink_teid_data,
9722 { "Uplink TEID Data I", "gtp.ulink_teid_data",
9723 FT_UINT32, BASE_HEX_DEC, NULL, 0,
9724 "UplinkTunnel Endpoint Identifier Data I", HFILL}
9727 { "TEID Data II", "gtp.teid_ii",
9728 FT_UINT32, BASE_HEX_DEC, NULL, 0,
9729 "Tunnel Endpoint Identifier Data II", HFILL}
9733 FT_STRING, BASE_NONE, NULL, 0,
9734 "Tunnel Identifier", HFILL}
9737 { "TLLI", "gtp.tlli",
9738 FT_UINT32, BASE_HEX, NULL, 0,
9739 "Temporary Logical Link Identity", HFILL}
9742 { "Packet transfer command", "gtp.tr_comm",
9743 FT_UINT8, BASE_DEC, VALS(tr_comm_type), 0,
9747 { "Trace reference", "gtp.trace_ref",
9748 FT_UINT16, BASE_HEX, NULL, 0,
9751 {&hf_gtp_trace_type,
9752 { "Trace type", "gtp.trace_type",
9753 FT_UINT16, BASE_HEX, NULL, 0,
9756 {&hf_gtp_user_addr_pdp_org,
9757 { "PDP type organization", "gtp.user_addr_pdp_org",
9758 FT_UINT8, BASE_DEC, VALS(pdp_org_type), 0,
9761 {&hf_gtp_user_addr_pdp_type,
9762 { "PDP type number", "gtp.user_addr_pdp_type",
9763 FT_UINT8, BASE_HEX, VALS(pdp_type), 0,
9767 { "End user address IPv4", "gtp.user_ipv4",
9768 FT_IPv4, BASE_NONE, NULL, 0,
9772 { "End user address IPv6", "gtp.user_ipv6",
9773 FT_IPv6, BASE_NONE, NULL, 0,
9776 {&hf_gtp_security_mode,
9777 { "Security Mode", "gtp.security_mode",
9778 FT_UINT8, BASE_DEC, VALS(mm_sec_modep), 0xc0,
9781 {&hf_gtp_no_of_vectors,
9782 { "No of Vectors", "gtp.no_of_vectors",
9783 FT_UINT8, BASE_DEC, NULL, 0x38,
9786 {&hf_gtp_cipher_algorithm,
9787 { "Cipher Algorithm", "gtp.cipher_algorithm",
9788 FT_UINT8, BASE_DEC, VALS(gtp_cipher_algorithm), 0x07,
9792 { "Ciphering Key Sequence Number (CKSN)/Key Set Identifier (KSI)", "gtp.cksn_ksi",
9793 FT_UINT8, BASE_DEC, NULL, 0x07,
9797 { "Ciphering Key Sequence Number (CKSN)", "gtp.cksn",
9798 FT_UINT8, BASE_DEC, NULL, 0x07,
9802 { "Key Set Identifier (KSI)", "gtp.ksi",
9803 FT_UINT8, BASE_DEC, NULL, 0x07,
9806 {&hf_gtp_ext_length,
9807 { "Length", "gtp.ext_length",
9808 FT_UINT16, BASE_DEC, NULL, 0x0,
9811 {&hf_gtp_utran_field,
9812 { "UTRAN Transparent Field", "gtp.utran_field",
9813 FT_BYTES, BASE_NONE, NULL, 0x0,
9816 {&hf_gtp_ext_apn_res,
9817 { "Restriction Type", "gtp.ext_apn_res",
9818 FT_UINT8, BASE_DEC, NULL, 0x0,
9821 {&hf_gtp_ext_rat_type,
9822 { "RAT Type", "gtp.ext_rat_type",
9823 FT_UINT8, BASE_DEC, VALS(gtp_ext_rat_type_vals), 0x0,
9826 {&hf_gtp_ext_imeisv,
9827 { "IMEI(SV)", "gtp.ext_imeisv",
9828 FT_STRING, BASE_NONE, NULL, 0x0,
9831 { &hf_gtp_target_rnc_id,
9832 { "targetRNC-ID", "gtp.targetRNC_ID",
9833 FT_UINT16, BASE_HEX, NULL, 0x0fff,
9836 { &hf_gtp_target_ext_rnc_id,
9837 { "Extended RNC-ID", "gtp.target_ext_RNC_ID",
9838 FT_UINT16, BASE_HEX, NULL, 0,
9841 {&hf_gtp_bssgp_cause,
9842 { "BSSGP Cause", "gtp.bssgp_cause",
9843 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &bssgp_cause_vals_ext, 0,
9846 { &hf_gtp_bssgp_ra_discriminator,
9847 { "Routing Address Discriminator", "gtp.bssgp.rad",
9848 FT_UINT8, BASE_DEC, VALS(gtp_bssgp_ra_discriminator_vals), 0x0f,
9852 { "PS Handover XID SAPI", "gtp.ps_handover_xid_sapi",
9853 FT_UINT8, BASE_DEC, NULL, 0x0F,
9856 {&hf_gtp_xid_par_len,
9857 { "PS Handover XID parameter length", "gtp.ps_handover_xid_par_len",
9858 FT_UINT8, BASE_DEC, NULL, 0xFF,
9859 "XID parameter length", HFILL}
9861 {&hf_gtp_rep_act_type,
9862 { "Action", "gtp.ms_inf_chg_rep_act",
9863 FT_UINT8, BASE_DEC, VALS(chg_rep_act_type_vals), 0xFF,
9866 {&hf_gtp_correlation_id,
9867 { "Correlation-ID", "gtp.correlation_id",
9868 FT_UINT8, BASE_DEC, NULL, 0,
9872 { "PCI Pre-emption Capability", "gtp.EARP_pre_emption_Capability",
9873 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
9877 { "PL Priority Level", "gtp.EARP_priority_level",
9878 FT_UINT8, BASE_DEC, NULL, 0x3C,
9882 { "PVI Pre-emption Vulnerability", "gtp.EARP_pre_emption_par_vulnerability",
9883 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
9886 {&hf_gtp_ext_comm_flags_uasi,
9887 { "UASI", "gtp.ext_comm_flags_uasi",
9888 FT_BOOLEAN, 8, NULL, 0x80,
9891 {&hf_gtp_ext_comm_flags_II_pnsi,
9892 { "PNSI", "gtp.ext_comm_flags_II_pnsi",
9893 FT_UINT8, BASE_DEC, NULL, 0x01,
9896 {&hf_gtp_ext_comm_flags_II_dtci,
9897 { "DTCI", "gtp.ext_comm_flags_II_dtci",
9898 FT_BOOLEAN, 8, NULL, 0x02,
9901 {&hf_gtp_ext_comm_flags_II_pmtsmi,
9902 { "PMTSMI", "gtp.ext_comm_flags_II_pmtsmi",
9903 FT_UINT8, BASE_DEC, NULL, 0x04,
9906 {&hf_gtp_ext_comm_flags_II_spare,
9907 { "SPARE", "gtp.ext_comm_flags_II_spare",
9908 FT_UINT8, BASE_HEX, NULL, 0xF8,
9912 { "Application Identifier", "gtp.cdr_app",
9913 FT_UINT8, BASE_DEC, NULL, 0xf0,
9917 { "Release Identifier", "gtp.cdr_rel",
9918 FT_UINT8, BASE_DEC, NULL, 0x0f,
9922 { "Version Identifier", "gtp.cdr_ver",
9923 FT_UINT8, BASE_DEC, NULL, 0x0,
9926 { &hf_gtp_cdr_length,
9927 { "Length", "gtp.cdr_length",
9928 FT_UINT16, BASE_DEC, NULL, 0x0,
9931 { &hf_gtp_cdr_context,
9932 { "Context", "gtp.cdr_context",
9933 FT_BYTES, BASE_NONE, NULL, 0x0,
9936 {&hf_gtp_cmn_flg_ppc,
9937 { "Prohibit Payload Compression", "gtp.cmn_flg.ppc",
9938 FT_BOOLEAN, 8, NULL, 0x01,
9941 {&hf_gtp_cmn_flg_mbs_srv_type,
9942 { "MBMS Service Type", "gtp.cmn_flg.mbs_srv_type",
9943 FT_BOOLEAN, 8, NULL, 0x02,
9946 {&hf_gtp_cmn_flg_mbs_ran_pcd_rdy,
9947 { "RAN Procedures Ready", "gtp.cmn_flg.mbs_ran_pcd_rdy",
9948 FT_BOOLEAN, 8, NULL, 0x04,
9951 {&hf_gtp_cmn_flg_mbs_cnt_inf,
9952 { "MBMS Counting Information", "gtp.cmn_flg.mbs_cnt_inf",
9953 FT_BOOLEAN, 8, NULL, 0x08,
9956 {&hf_gtp_cmn_flg_no_qos_neg,
9957 { "No QoS negotiation", "gtp.cmn_flg.no_qos_neg",
9958 FT_BOOLEAN, 8, NULL, 0x10,
9961 {&hf_gtp_cmn_flg_nrsn,
9962 { "NRSN bit field", "gtp.cmn_flg.nrsn",
9963 FT_BOOLEAN, 8, NULL, 0x20,
9966 {&hf_gtp_cmn_flg_upgrd_qos_sup,
9967 { "Upgrade QoS Supported", "gtp.cmn_flg.upgrd_qos_sup",
9968 FT_BOOLEAN, 8, NULL, 0x40,
9971 {&hf_gtp_cmn_flg_dual_addr_bearer_flg,
9972 { "Dual Address Bearer Flag", "gtp.cmn_flg.dual_addr_bearer_flg",
9973 FT_BOOLEAN, 8, NULL, 0x80,
9977 { "Temporary Mobile Group Identity (TMGI)", "gtp.tmgi",
9978 FT_BYTES, BASE_NONE, NULL, 0x0,
9981 {&hf_gtp_no_of_mbms_sa_codes,
9982 { "Number of MBMS service area codes", "gtp.no_of_mbms_sa_codes",
9983 FT_UINT8, BASE_DEC, NULL, 0x0,
9984 "Number N of MBMS service area codes", HFILL}
9987 {&hf_gtp_mbms_ses_dur_days,
9988 { "Estimated session duration days", "gtp.mbms_ses_dur_days",
9989 FT_UINT24, BASE_DEC, NULL, 0x00007F,
9992 {&hf_gtp_mbms_ses_dur_s,
9993 { "Estimated session duration seconds", "gtp.mbms_ses_dur_s",
9994 FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
9997 {&hf_gtp_mbms_sa_code,
9998 { "MBMS service area code", "gtp.mbms_sa_code",
9999 FT_UINT16, BASE_DEC, NULL, 0x0,
10002 {&hf_gtp_mbs_2g_3g_ind,
10003 { "MBMS 2G/3G Indicator", "gtp.mbs_2g_3g_ind",
10004 FT_UINT8, BASE_DEC, VALS(gtp_mbs_2g_3g_ind_vals), 0x0,
10007 {&hf_gtp_time_2_dta_tr,
10008 { "Time to MBMS Data Transfer", "gtp.time_2_dta_tr",
10009 FT_UINT8, BASE_DEC, NULL, 0x0,
10013 { "Error Indication (EI)", "gtp.ei",
10014 FT_UINT8, BASE_DEC, NULL, 0x04,
10018 { "GPRS-CSI (GCSI)", "gtp.gcsi",
10019 FT_UINT8, BASE_DEC, NULL, 0x02,
10023 { "Direct Tunnel Indicator (DTI)", "gtp.dti",
10024 FT_UINT8, BASE_DEC, NULL, 0x01,
10027 { &hf_gtp_ra_prio_lcs,
10028 { "Radio Priority LCS", "gtp.raplcs",
10029 FT_UINT8, BASE_DEC, NULL, 0x07,
10033 { "Bearer Control Mode", "gtp.bcm",
10034 FT_UINT8, BASE_DEC, VALS(gtp_pdp_bcm_type_vals), 0,
10038 { "FQDN", "gtp.fqdn",
10039 FT_STRING, BASE_NONE, NULL, 0,
10040 "Fully Qualified Domain Name", HFILL}
10042 { &hf_gtp_rim_routing_addr,
10043 { "RIM Routing Address value", "gtp.rim_routing_addr_val",
10044 FT_BYTES, BASE_NONE, NULL, 0,
10047 { &hf_gtp_mbms_flow_id,
10048 { "MBMS Flow Identifier", "gtp.mbms_flow_id",
10049 FT_BYTES, BASE_NONE, NULL, 0,
10052 { &hf_gtp_mbms_dist_indic,
10053 { "Distribution Indication", "gtp.mbms_dist_indic",
10054 FT_UINT8, BASE_DEC, VALS(gtp_mbms_dist_indic_vals), 0x03,
10057 { &hf_gtp_ext_apn_ambr_ul,
10058 { "APN-AMBR for Uplink", "gtp.apn_ambr_ul",
10059 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10062 { &hf_gtp_ext_apn_ambr_dl,
10063 { "APN-AMBR for Downlink", "gtp.apn_ambr_dl",
10064 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10067 { &hf_gtp_ext_sub_ue_ambr_ul,
10068 { "Subscribed UE-AMBR for Uplink", "gtp.sub_ue_ambr_ul",
10069 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10072 { &hf_gtp_ext_sub_ue_ambr_dl,
10073 { "Subscribed UE-AMBR for Downlink", "gtp.sub_ue_ambr_dl",
10074 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10077 { &hf_gtp_ext_auth_ue_ambr_ul,
10078 { "Authorized UE-AMBR for Uplink", "gtp.auth_ue_ambr_ul",
10079 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10082 { &hf_gtp_ext_auth_ue_ambr_dl,
10083 { "Authorized UE-AMBR for Downlink", "gtp.auth_ue_ambr_dl",
10084 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10087 { &hf_gtp_ext_auth_apn_ambr_ul,
10088 { "Authorized APN-AMBR for Uplink", "gtp.auth_apn_ambr_ul",
10089 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10092 { &hf_gtp_ext_auth_apn_ambr_dl,
10093 { "Authorized APN-AMBR for Downlink", "gtp.auth_apn_ambr_dl",
10094 FT_INT32, BASE_DEC|BASE_UNIT_STRING, &units_kbps, 0x0,
10097 { &hf_gtp_ext_ggsn_back_off_time_units,
10098 { "Timer unit", "gtp.ggsn_back_off_time_units",
10099 FT_UINT8, BASE_DEC, VALS(gtp_ggsn_back_off_time_units_vals), 0xe0,
10102 { &hf_gtp_ext_ggsn_back_off_timer,
10103 { "Timer value", "gtp.ggsn_back_off_timer",
10104 FT_UINT8, BASE_DEC, NULL, 0x1f,
10107 { &hf_gtp_higher_br_16mb_flg,
10108 { "Higher bitrates than 16 Mbps flag", "gtp.higher_br_16mb_flg",
10109 FT_UINT8, BASE_DEC, VALS(gtp_higher_br_16mb_flg_vals), 0x0,
10112 { &hf_gtp_max_mbr_apn_ambr_ul,
10113 { "Max MBR/APN-AMBR for uplink", "gtp.max_mbr_apn_ambr_ul",
10114 FT_UINT32, BASE_DEC, NULL, 0x0,
10117 { &hf_gtp_max_mbr_apn_ambr_dl,
10118 { "Max MBR/APN-AMBR for downlink", "gtp.max_mbr_apn_ambr_dl",
10119 FT_UINT32, BASE_DEC, NULL, 0x0,
10123 { &hf_gtp_rand, { "RAND", "gtp.rand", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10124 { &hf_gtp_sres, { "SRES", "gtp.sres", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10125 { &hf_gtp_kc, { "Kc", "gtp.kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10126 { &hf_gtp_xres_length, { "XRES length", "gtp.xres_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10127 { &hf_gtp_xres, { "XRES", "gtp.xres", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10128 { &hf_gtp_quintuplet_ciphering_key, { "Quintuplet Ciphering Key", "gtp.quintuplet_ciphering_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10129 { &hf_gtp_quintuplet_integrity_key, { "Quintuplet Integrity Key", "gtp.quintuplet_integrity_key", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10130 { &hf_gtp_authentication_length, { "Authentication length", "gtp.authentication_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10131 { &hf_gtp_auth, { "AUTH", "gtp.auth", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10132 { &hf_gtp_ciphering_key_ck, { "Ciphering key CK", "gtp.ciphering_key_ck", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10133 { &hf_gtp_integrity_key_ik, { "Integrity key IK", "gtp.integrity_key_ik", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10134 { &hf_gtp_quintuplets_length, { "Quintuplets length", "gtp.quintuplets_length", FT_UINT16, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL }},
10135 { &hf_gtp_ciphering_key_kc, { "Ciphering key Kc", "gtp.ciphering_key_kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10136 { &hf_gtp_container_length, { "Container length", "gtp.container_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10137 { &hf_gtp_extended_end_user_address, { "Extended End User Address", "gtp.extended_end_user_address", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x80, NULL, HFILL }},
10138 { &hf_gtp_vplmn_address_allowed, { "VPLMN address allowed", "gtp.vplmn_address_allowed", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x40, NULL, HFILL }},
10139 { &hf_gtp_activity_status_indicator, { "Activity Status Indicator", "gtp.activity_status_indicator", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x20, NULL, HFILL }},
10140 { &hf_gtp_reordering_required, { "Reordering required", "gtp.reordering_required", FT_BOOLEAN, 8, TFS(&tfs_yes_no), 0x10, NULL, HFILL }},
10141 { &hf_gtp_pdp_cntxt_sapi, { "SAPI", "gtp.pdp_cntxt.sapi", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }},
10142 { &hf_gtp_sequence_number_down, { "Sequence number down", "gtp.sequence_number_down", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10143 { &hf_gtp_sequence_number_up, { "Sequence number up", "gtp.sequence_number_up", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10144 { &hf_gtp_send_n_pdu_number, { "Send N-PDU number", "gtp.send_n_pdu_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10145 { &hf_gtp_receive_n_pdu_number, { "Receive N-PDU number", "gtp.receive_n_pdu_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10146 { &hf_gtp_uplink_flow_label_signalling, { "Uplink flow label signalling", "gtp.uplink_flow_label_signalling", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10147 { &hf_gtp_pdp_context_identifier, { "PDP context identifier", "gtp.pdp_context_identifier", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10148 { &hf_gtp_pdp_organization, { "PDP organization", "gtp.pdp_organization", FT_UINT8, BASE_DEC, VALS(pdp_type), 0x0F, NULL, HFILL }},
10149 { &hf_gtp_pdp_type, { "PDP type", "gtp.pdp_type", FT_UINT8, BASE_DEC, VALS(pdp_type), 0x0, NULL, HFILL }},
10150 { &hf_gtp_pdp_address_length, { "PDP address length", "gtp.pdp_address_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10151 { &hf_gtp_pdp_address_ipv4, { "PDP address", "gtp.pdp_address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10152 { &hf_gtp_pdp_address_ipv6, { "PDP address", "gtp.pdp_address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10153 { &hf_gtp_ggsn_address_length, { "GGSN address length", "gtp.ggsn_address_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10154 { &hf_gtp_ggsn_address_for_control_plane, { "GGSN Address for control plane", "gtp.ggsn_address_for_control_plane", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10155 { &hf_gtp_ggsn_address_for_user_traffic, { "GGSN Address for User Traffic", "gtp.ggsn_address_for_user_traffic", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10156 { &hf_gtp_ggsn_2_address_length, { "GGSN 2 address length", "gtp.ggsn_2_address_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10157 { &hf_gtp_ggsn_2_address_ipv4, { "GGSN 2 address", "gtp.ggsn_2_address.ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10158 { &hf_gtp_ggsn_2_address_ipv6, { "GGSN 2 address", "gtp.ggsn_2_address.ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10159 { &hf_gtp_apn_length, { "APN length", "gtp.apn_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10160 { &hf_gtp_transaction_identifier, { "Transaction identifier", "gtp.transaction_identifier", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10161 { &hf_gtp_gsn_address_length, { "GSN address length", "gtp.gsn_address_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10162 { &hf_gtp_gsn_address_information_element_length, { "GSN address Information Element length", "gtp.gsn_address_information_element_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10163 { &hf_gtp_tft_length, { "TFT length", "gtp.tft_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10164 { &hf_gtp_rab_setup_length, { "RAB setup length", "gtp.rab_setup_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10165 { &hf_gtp_timezone, { "Timezone", "gtp.timezone", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10166 { &hf_gtp_timezone_dst, { "DST", "gtp.timezone_dst", FT_UINT8, BASE_DEC, VALS(daylight_saving_time_vals), 0x03, NULL, HFILL }},
10167 { &hf_gtp_rfsp_index, { "RFSP Index", "gtp.rfsp_index", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10168 { &hf_gtp_fqdn_length, { "FQDN length", "gtp.fqdn_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10169 { &hf_gtp_number_of_data_records, { "Number of data records", "gtp.number_of_data_records", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10170 { &hf_gtp_data_record_format, { "Data record format", "gtp.data_record_format", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10171 { &hf_gtp_node_address_length, { "Node address length", "gtp.node_address_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10172 { &hf_gtp_seq_num_released, { "Sequence number released", "gtp.seq_num_released", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10173 { &hf_gtp_seq_num_canceled, { "Sequence number cancelled", "gtp.seq_num_canceled", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10174 { &hf_gtp_requests_responded, { "Requests responded", "gtp.requests_responded", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10175 { &hf_gtp_hyphen_separator, { "Hyphen separator: -", "gtp.hyphen_separator", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
10176 { &hf_gtp_ms_network_cap_content_len, { "Length of MS network capability contents", "gtp.ms_network_cap_content_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10177 { &hf_gtp_iei, { "IEI", "gtp.iei", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10178 { &hf_gtp_iei_mobile_id_len, { "Length", "gtp.iei.mobile_id_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10179 { &hf_gtp_qos_umts_length, { "Length", "gtp.qos_umts_length", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10180 { &hf_gtp_num_ext_hdr_types, { "Number of Extension Header Types in list (i.e., length)", "gtp.num_ext_hdr_types", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
10181 { &hf_gtp_ext_hdr_type, { "Extension Header Type", "gtp.ext_hdr_type", FT_UINT8, BASE_DEC, VALS(next_extension_header_fieldvals), 0x0, NULL, HFILL }},
10182 { &hf_gtp_tpdu_data, { "T-PDU Data", "gtp.tpdu_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
10183 { &hf_gtp_ext_enb_type, { "enb_type", "gtp.enb_type", FT_UINT8, BASE_DEC, VALS(gtp_enb_type_vals), 0x0, NULL, HFILL } },
10184 { &hf_gtp_macro_enodeb_id,
10185 { "Macro eNodeB ID", "gtp.macro_enodeb_id",
10186 FT_UINT24, BASE_HEX, NULL, 0x0fffff,
10189 { &hf_gtp_home_enodeb_id,
10190 { "Home eNodeB ID", "gtp.home_enodeb_id",
10191 FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
10194 { &hf_gtp_dummy_octets,
10195 { "Dummy octets", "gtp.dummy_octets",
10196 FT_BYTES, BASE_NONE, NULL, 0x0,
10202 static ei_register_info ei[] = {
10203 { &ei_gtp_ext_length_mal, { "gtp.ext_length.invalid", PI_MALFORMED, PI_ERROR, "Malformed length", EXPFILL }},
10204 { &ei_gtp_ext_hdr_pdcpsn, { "gtp.ext_hdr.pdcp_sn.non_zero", PI_PROTOCOL, PI_NOTE, "3GPP TS 29.281 v9.0.0: When used between two eNBs at the X2 interface in E-UTRAN, bit 8 of octet 2 is spare. The meaning of the spare bits shall be set to zero.", EXPFILL }},
10205 { &ei_gtp_ext_length_warn, { "gtp.ext_length.invalid", PI_PROTOCOL, PI_WARN, "Length warning", EXPFILL }},
10206 { &ei_gtp_undecoded, { "gtp.undecoded", PI_UNDECODED, PI_WARN, "Data not decoded yet", EXPFILL }},
10207 { &ei_gtp_message_not_found, { "gtp.message_not_found", PI_PROTOCOL, PI_WARN, "Message not found", EXPFILL }},
10208 { &ei_gtp_field_not_present, { "gtp.field_not_present", PI_PROTOCOL, PI_WARN, "Field not present", EXPFILL }},
10209 { &ei_gtp_wrong_next_field, { "gtp.wrong_next_field", PI_PROTOCOL, PI_WARN, "Wrong next field", EXPFILL }},
10210 { &ei_gtp_field_not_support_in_version, { "gtp.field_not_support_in_version", PI_PROTOCOL, PI_WARN, "GTP version not supported for field", EXPFILL }},
10211 { &ei_gtp_guaranteed_bit_rate_value, { "gtp.guaranteed_bit_rate_value", PI_PROTOCOL, PI_NOTE, "Use the value indicated by the Guaranteed bit rate", EXPFILL }},
10212 { &ei_gtp_max_bit_rate_value, { "gtp.max_bit_rate_value", PI_PROTOCOL, PI_NOTE, "Use the value indicated by the Maximum bit rate", EXPFILL }},
10213 { &ei_gtp_ext_geo_loc_type, { "gtp.ext_geo_loc_type.unknown", PI_PROTOCOL, PI_WARN, "Unknown Location type data", EXPFILL }},
10214 { &ei_gtp_iei, { "gtp.iei.unknown", PI_PROTOCOL, PI_WARN, "Unknown IEI - Later spec than TS 29.060 9.4.0 used?", EXPFILL }},
10215 { &ei_gtp_unknown_extention_header, { "gtp.unknown_extention_header", PI_PROTOCOL, PI_WARN, "Unknown extension header", EXPFILL }},
10218 /* Setup protocol subtree array */
10219 #define GTP_NUM_INDIVIDUAL_ELEMS 27
10220 static gint *ett_gtp_array[GTP_NUM_INDIVIDUAL_ELEMS + NUM_GTP_IES];
10222 ett_gtp_array[0] = &ett_gtp;
10223 ett_gtp_array[1] = &ett_gtp_flags;
10224 ett_gtp_array[2] = &ett_gtp_ext;
10225 ett_gtp_array[3] = &ett_gtp_cdr_dr;
10226 ett_gtp_array[4] = &ett_gtp_qos;
10227 ett_gtp_array[5] = &ett_gtp_qos_arp;
10228 ett_gtp_array[6] = &ett_gtp_flow_ii;
10229 ett_gtp_array[7] = &ett_gtp_ext_hdr;
10230 ett_gtp_array[8] = &ett_gtp_rp;
10231 ett_gtp_array[9] = &ett_gtp_pkt_flow_id;
10232 ett_gtp_array[10] = &ett_gtp_data_resp;
10233 ett_gtp_array[11] = &ett_gtp_cdr_ver;
10234 ett_gtp_array[12] = &ett_gtp_tmgi;
10235 ett_gtp_array[13] = &ett_gtp_trip;
10236 ett_gtp_array[14] = &ett_gtp_quint;
10237 ett_gtp_array[15] = &ett_gtp_drx;
10238 ett_gtp_array[16] = &ett_gtp_net_cap;
10239 ett_gtp_array[17] = &ett_gtp_can_pack;
10240 ett_gtp_array[18] = &ett_gtp_proto;
10241 ett_gtp_array[19] = &ett_gtp_gsn_addr;
10242 ett_gtp_array[20] = &ett_gtp_tft;
10243 ett_gtp_array[21] = &ett_gtp_rab_setup;
10244 ett_gtp_array[22] = &ett_gtp_hdr_list;
10245 ett_gtp_array[23] = &ett_gtp_rel_pack;
10246 ett_gtp_array[24] = &ett_gtp_node_addr;
10247 ett_gtp_array[25] = &ett_gtp_mm_cntxt;
10248 ett_gtp_array[26] = &ett_gtp_utran_cont;
10250 last_offset = GTP_NUM_INDIVIDUAL_ELEMS;
10252 for (i=0; i < NUM_GTP_IES; i++, last_offset++)
10254 ett_gtp_ies[i] = -1;
10255 ett_gtp_array[last_offset] = &ett_gtp_ies[i];
10260 proto_gtp = proto_register_protocol("GPRS Tunneling Protocol", "GTP", "gtp");
10261 proto_gtpprime = proto_register_protocol("GPRS Tunneling Protocol Prime", "GTP (Prime)", "gtpprime");
10263 proto_register_field_array(proto_gtp, hf_gtp, array_length(hf_gtp));
10264 proto_register_subtree_array(ett_gtp_array, array_length(ett_gtp_array));
10265 expert_gtp = expert_register_protocol(proto_gtp);
10266 expert_register_field_array(expert_gtp, ei, array_length(ei));
10268 gtp_module = prefs_register_protocol(proto_gtp, proto_reg_handoff_gtp);
10270 prefs_register_uint_preference(gtp_module, "v0_port", "GTPv0 and GTP' port", "GTPv0 and GTP' port (default 3386)", 10, &g_gtpv0_port);
10271 prefs_register_uint_preference(gtp_module, "v1c_port", "GTPv1 or GTPv2 control plane (GTP-C, GTPv2-C) port", "GTPv1 and GTPv2 control plane port (default 2123)", 10,
10273 prefs_register_uint_preference(gtp_module, "v1u_port", "GTPv1 user plane (GTP-U) port", "GTPv1 user plane port (default 2152)", 10,
10275 prefs_register_enum_preference(gtp_module, "dissect_tpdu_as",
10276 "Dissect T-PDU as",
10277 "Dissect T-PDU as",
10279 gtp_decode_tpdu_as,
10282 prefs_register_obsolete_preference(gtp_module, "v0_dissect_cdr_as");
10283 prefs_register_obsolete_preference(gtp_module, "v0_check_etsi");
10284 prefs_register_obsolete_preference(gtp_module, "v1_check_etsi");
10285 prefs_register_bool_preference(gtp_module, "check_etsi", "Compare GTP order with ETSI", "GTP ETSI order", &g_gtp_etsi_order);
10286 prefs_register_obsolete_preference(gtp_module, "ppp_reorder");
10287 prefs_register_obsolete_preference(gtp_module, "dissect_tpdu");
10289 /* This preference can be used to disable the dissection of GTP over TCP. Most of the Wireless operators uses GTP over UDP.
10290 * The preference is set to TRUE by default forbackward compatibility
10292 prefs_register_bool_preference(gtp_module, "dissect_gtp_over_tcp", "Dissect GTP over TCP", "Dissect GTP over TCP", &g_gtp_over_tcp);
10293 prefs_register_bool_preference(gtp_module, "track_gtp_session", "Track GTP session", "Track GTP session", &g_gtp_session);
10295 gtp_handle = register_dissector("gtp", dissect_gtp, proto_gtp);
10296 gtp_prime_handle = register_dissector("gtpprime", dissect_gtpprime, proto_gtpprime);
10298 gtp_priv_ext_dissector_table = register_dissector_table("gtp.priv_ext", "GTP Private Extension", proto_gtp, FT_UINT16, BASE_DEC);
10299 gtp_cdr_fmt_dissector_table = register_dissector_table("gtp.cdr_fmt", "GTP Data Record Type", proto_gtp, FT_UINT16, BASE_DEC);
10301 register_init_routine(gtp_init);
10302 register_cleanup_routine(gtp_cleanup);
10303 gtp_tap = register_tap("gtp");
10304 gtpv1_tap = register_tap("gtpv1");
10306 register_srt_table(proto_gtp, NULL, 1, gtpstat_packet, gtpstat_init, NULL);
10308 /* TS 132 295 V9.0.0 (2010-02)
10310 * - The UDP Destination Port may be the server port number 3386 which has been reserved for GTP'.
10311 * Alternatively another port can be used, which has been configured by O&M, except Port Number 2123
10312 * which is used by GTPv2-C.
10314 * The TCP Destination Port may be the server port number 3386, which has been reserved for G-PDUs. Alternatively,
10315 * another port may be used as configured by O&M. Extra implementation-specific destination ports are possible but
10316 * all CGFs shall support the server port number.
10320 proto_reg_handoff_gtp(void)
10322 static gboolean Initialized = FALSE;
10323 static gboolean gtp_over_tcp;
10324 static guint gtpv0_port;
10325 static guint gtpv1c_port;
10326 static guint gtpv1u_port;
10328 if (!Initialized) {
10329 ppp_subdissector_table = find_dissector_table("ppp.protocol");
10331 radius_register_avp_dissector(VENDOR_THE3GPP, 5, dissect_radius_qos_umts);
10332 radius_register_avp_dissector(VENDOR_THE3GPP, 12, dissect_radius_selection_mode);
10333 radius_register_avp_dissector(VENDOR_THE3GPP, 22, dissect_radius_user_loc);
10337 ip_handle = find_dissector_add_dependency("ip", proto_gtp);
10338 ipv6_handle = find_dissector_add_dependency("ipv6", proto_gtp);
10339 ppp_handle = find_dissector_add_dependency("ppp", proto_gtp);
10340 sync_handle = find_dissector_add_dependency("sync", proto_gtp);
10341 gtpcdr_handle = find_dissector_add_dependency("gtpcdr", proto_gtp);
10342 sndcpxid_handle = find_dissector_add_dependency("sndcpxid", proto_gtp);
10343 gtpv2_handle = find_dissector_add_dependency("gtpv2", proto_gtp);
10344 bssgp_handle = find_dissector_add_dependency("bssgp", proto_gtp);
10345 bssap_pdu_type_table = find_dissector_table("bssap.pdu_type");
10346 /* AVP Code: 5 3GPP-GPRS Negotiated QoS profile */
10347 dissector_add_uint("diameter.3gpp", 5, create_dissector_handle(dissect_diameter_3gpp_qosprofile, proto_gtp));
10348 /* AVP Code: 903 MBMS-Service-Area */
10349 dissector_add_uint("diameter.3gpp", 903, create_dissector_handle(dissect_gtp_3gpp_mbms_service_area, proto_gtp));
10350 /* AVP Code: 904 MBMS-Session-Duration */
10351 dissector_add_uint("diameter.3gpp", 904, create_dissector_handle(dissect_gtp_mbms_ses_dur, proto_gtp));
10352 /* AVP Code: 911 MBMS-Time-To-Data-Transfer */
10353 dissector_add_uint("diameter.3gpp", 911, create_dissector_handle(dissect_gtp_mbms_time_to_data_tr, proto_gtp));
10355 Initialized = TRUE;
10357 dissector_delete_uint("udp.port", gtpv0_port, gtp_prime_handle);
10358 dissector_delete_uint("udp.port", gtpv1c_port, gtp_handle);
10359 dissector_delete_uint("udp.port", gtpv1u_port, gtp_handle);
10361 if (gtp_over_tcp) {
10362 dissector_delete_uint("tcp.port", gtpv0_port, gtp_prime_handle);
10363 dissector_delete_uint("tcp.port", gtpv1c_port, gtp_handle);
10364 dissector_delete_uint("tcp.port", gtpv1u_port, gtp_handle);
10368 gtp_over_tcp = g_gtp_over_tcp;
10369 gtpv0_port = g_gtpv0_port;
10370 gtpv1c_port = g_gtpv1c_port;
10371 gtpv1u_port = g_gtpv1u_port;
10373 /* This doesn't use the "auto preference" API because the port
10374 description is too specific */
10375 dissector_add_uint("udp.port", g_gtpv0_port, gtp_prime_handle);
10376 dissector_add_uint("udp.port", g_gtpv1c_port, gtp_handle);
10377 dissector_add_uint("udp.port", g_gtpv1u_port, gtp_handle);
10379 if (g_gtp_over_tcp) {
10380 /* This doesn't use the "auto preference" API because the port
10381 description is too specific */
10382 dissector_add_uint("tcp.port", g_gtpv0_port, gtp_prime_handle);
10383 dissector_add_uint("tcp.port", g_gtpv1c_port, gtp_handle);
10384 dissector_add_uint("tcp.port", g_gtpv1u_port, gtp_handle);
10389 * Editor modelines - http://www.wireshark.org/tools/modelines.html
10392 * c-basic-offset: 4
10394 * indent-tabs-mode: nil
10397 * vi: set shiftwidth=4 tabstop=8 expandtab:
10398 * :indentSize=4:tabSize=8:noTabs=true: