3 * Routines for GTPv2 dissection
4 * Copyright 2009 - 2012, Anders Broman <anders.broman [at] ericcsson.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25 * Ref: 3GPP TS 29.274 version 11.1.0 Release 11 ETSI TS 129 274 V8.1.1 (2009-04)
32 #include <epan/packet.h>
33 #include <epan/to_str.h>
34 #include <epan/asn1.h>
35 #include <epan/expert.h>
36 #include <epan/sminmpec.h>
38 #include "packet-gsm_a_common.h"
39 #include "packet-gsm_map.h"
40 #include "packet-e164.h"
41 #include "packet-e212.h"
42 #include "packet-s1ap.h"
43 #include "packet-ranap.h"
44 #include "packet-bssgp.h"
45 #include "packet-ntp.h"
46 #include "packet-gtpv2.h"
48 void proto_register_gtpv2(void);
49 void proto_reg_handoff_gtpv2(void);
51 static dissector_handle_t nas_eps_handle;
52 static dissector_table_t gtpv2_priv_ext_dissector_table;
55 /*GTPv2 Message->GTP Header(SB)*/
56 static int proto_gtpv2 = -1;
58 static int hf_gtpv2_reserved = -1;
59 static int hf_gtpv2_spare_half_octet = -1;
60 static int hf_gtpv2_spare_bits = -1;
61 static int hf_gtpv2_flags = -1;
62 static int hf_gtpv2_version = -1;
63 static int hf_gtpv2_p = -1;
64 static int hf_gtpv2_t = -1;
65 static int hf_gtpv2_message_type = -1;
66 static int hf_gtpv2_msg_length = -1;
67 static int hf_gtpv2_teid = -1;
68 static int hf_gtpv2_seq = -1;
69 static int hf_gtpv2_spare = -1;
72 static int hf_gtpv2_ie = -1;
73 static int hf_gtpv2_ie_len = -1;
74 static int hf_gtpv2_cr = -1;
75 static int hf_gtpv2_instance = -1;
76 static int hf_gtpv2_cause = -1;
77 static int hf_gtpv2_cause_cs = -1;
78 static int hf_gtpv2_cause_bce = -1;
79 static int hf_gtpv2_cause_pce = -1;
80 static int hf_gtpv2_cause_off_ie_t = -1;
81 static int hf_gtpv2_rec = -1;
82 /*Start SRVCC Messages*/
83 static int hf_gtpv2_stn_sr = -1;
84 static int hf_gtpv2_len_trans_con = -1;
85 static int hf_gtpv2_eksi = -1;
86 static int hf_gtpv2_ck = -1;
87 static int hf_gtpv2_ik = -1;
88 static int hf_gtpv2_len_ms_classmark2 = -1;
89 static int hf_gtpv2_len_ms_classmark3 = -1;
90 static int hf_gtpv2_len_supp_codec_list = -1;
91 static int hf_gtpv2_ksi = -1;
92 /*static int hf_gtpv2_kc = -1; */
93 static int hf_gtpv2_cksn = -1;
94 static int hf_gtpv2_srvcc_cause = -1;
95 static int hf_gtpv2_rac = -1;
96 static int hf_gtpv2_rnc_id = -1;
97 static int hf_gtpv2_ext_rnc_id = -1;
98 static int hf_gtpv2_lac = -1;
99 static int hf_gtpv2_sac = -1;
100 static int hf_gtpv2_tgt_g_cell_id = -1;
101 static int hf_gtpv2_teid_c = -1;
102 static int hf_gtpv2_sv_sti = -1;
103 static int hf_gtpv2_sv_ics = -1;
104 static int hf_gtpv2_sv_emind = -1;
105 /*End SRVCC Messages*/
106 static int hf_gtpv2_apn = -1;
107 static int hf_gtpv2_ebi = -1;
108 static int hf_gtpv2_daf = -1;
109 static int hf_gtpv2_dtf = -1;
110 static int hf_gtpv2_hi = -1;
111 static int hf_gtpv2_dfi = -1;
112 static int hf_gtpv2_oi = -1;
113 static int hf_gtpv2_isrsi = -1;
114 static int hf_gtpv2_israi = -1;
115 static int hf_gtpv2_sgwci = -1;
116 static int hf_gtpv2_sqci = -1;
117 static int hf_gtpv2_uimsi = -1;
118 static int hf_gtpv2_cfsi = -1;
119 static int hf_gtpv2_crsi = -1;
120 static int hf_gtpv2_pt = -1;
121 static int hf_gtpv2_ps = -1;
122 static int hf_gtpv2_si = -1;
123 static int hf_gtpv2_msv = -1;
124 static int hf_gtpv2_spare1 = -1;
125 static int hf_gtpv2_spare2 = -1;
126 static int hf_gtpv2_spare3 = -1;
127 static int hf_gtpv2_s6af = -1;
128 static int hf_gtpv2_s4af = -1;
129 static int hf_gtpv2_mbmdt = -1;
130 static int hf_gtpv2_israu = -1;
131 static int hf_gtpv2_ccrsi = -1;
132 static int hf_gtpv2_pdn_type = -1;
133 static int hf_gtpv2_pdn_ipv4 = -1;
134 static int hf_gtpv2_pdn_ipv6_len = -1;
135 static int hf_gtpv2_pdn_ipv6 = -1;
136 static int hf_gtpv2_pdn_numbers_nsapi = -1;
137 static int hf_gtpv2_p_tmsi = -1;
138 static int hf_gtpv2_p_tmsi_sig = -1;
139 static int hf_gtpv2_mmbr_ul = -1;
140 static int hf_gtpv2_mmbr_dl = -1;
142 static int hf_gtpv2_rat_type = -1;
143 static int hf_gtpv2_uli_ecgi_flg = -1;
144 static int hf_gtpv2_uli_lai_flg = -1;
145 static int hf_gtpv2_uli_tai_flg = -1;
146 static int hf_gtpv2_uli_rai_flg = -1;
147 static int hf_gtpv2_uli_sai_flg = -1;
148 static int hf_gtpv2_uli_cgi_flg = -1;
149 static int hf_gtpv2_glt = -1;
150 static int hf_gtpv2_cng_rep_act = -1;
152 static int hf_gtpv2_selec_mode = -1;
153 static int hf_gtpv2_source_type = -1;
154 static int hf_gtpv2_f_teid_v4 = -1;
155 static int hf_gtpv2_f_teid_v6 = -1;
156 static int hf_gtpv2_f_teid_interface_type= -1;
157 static int hf_gtpv2_f_teid_gre_key= -1;
158 static int hf_gtpv2_f_teid_ipv4= -1;
159 static int hf_gtpv2_f_teid_ipv6= -1;
160 static int hf_gtpv2_tmsi = -1;
161 static int hf_gtpv2_hsgw_addr_f_len = -1;
162 static int hf_gtpv2_hsgw_addr_ipv4 = -1;
163 static int hf_gtpv2_hsgw_addr_ipv6 = -1;
164 static int hf_gtpv2_gre_key = -1;
165 static int hf_gtpv2_sgw_addr_ipv4 = -1;
166 static int hf_gtpv2_sgw_addr_ipv6 = -1;
167 static int hf_gtpv2_sgw_s1u_teid = -1;
168 static int hf_gtpv2_imsi= -1;
169 static int hf_gtpv2_ipv4_addr = -1;
172 static int hf_gtpv2_ambr_up= -1;
173 static int hf_gtpv2_ambr_down= -1;
174 static int hf_gtpv2_ip_address_ipv4= -1;
175 static int hf_gtpv2_ip_address_ipv6= -1;
176 static int hf_gtpv2_mei= -1;
178 /* Trace Information */
179 /* static int hf_gtpv2_tra_info = -1; */
180 static int hf_gtpv2_tra_info_msc_momt_calls = -1;
181 static int hf_gtpv2_tra_info_msc_momt_sms = -1;
182 static int hf_gtpv2_tra_info_msc_lu_imsi_ad = -1;
183 static int hf_gtpv2_tra_info_msc_handovers = -1;
184 static int hf_gtpv2_tra_info_msc_ss = -1;
185 static int hf_gtpv2_tra_info_mgw_context = -1;
186 static int hf_gtpv2_tra_info_sgsn_pdp_context = -1;
187 static int hf_gtpv2_tra_info_sgsn_momt_sms = -1;
188 static int hf_gtpv2_tra_info_sgsn_rau_gprs_ad = -1;
189 static int hf_gtpv2_tra_info_sgsn_mbms = -1;
190 static int hf_gtpv2_tra_info_sgsn_reserved = -1;
191 static int hf_gtpv2_tra_info_ggsn_pdp = -1;
192 static int hf_gtpv2_tra_info_ggsn_mbms = -1;
193 static int hf_gtpv2_tra_info_bm_sc = -1;
194 static int hf_gtpv2_tra_info_mme_sgw_ss = -1;
195 static int hf_gtpv2_tra_info_mme_sgw_sr = -1;
196 static int hf_gtpv2_tra_info_mme_sgw_iataud = -1;
197 static int hf_gtpv2_tra_info_lne_msc_s = -1;
198 static int hf_gtpv2_tra_info_lne_mgw = -1;
199 static int hf_gtpv2_tra_info_lne_sgsn = -1;
200 static int hf_gtpv2_tra_info_lne_ggsn = -1;
201 static int hf_gtpv2_tra_info_lne_rnc = -1;
202 static int hf_gtpv2_tra_info_lne_bm_sc = -1;
203 static int hf_gtpv2_tra_info_lne_mme = -1;
204 static int hf_gtpv2_tra_info_lne_sgw = -1;
205 static int hf_gtpv2_tra_info_lne_pdn_gw = -1;
206 static int hf_gtpv2_tra_info_lne_enb = -1;
207 static int hf_gtpv2_tra_info_tdl = -1;
208 static int hf_gtpv2_tra_info_lmsc_a = -1;
209 static int hf_gtpv2_tra_info_lmsc_lu = -1;
210 static int hf_gtpv2_tra_info_lmsc_mc = -1;
211 static int hf_gtpv2_tra_info_lmsc_map_g = -1;
212 static int hf_gtpv2_tra_info_lmsc_map_b = -1;
213 static int hf_gtpv2_tra_info_lmsc_map_e = -1;
214 static int hf_gtpv2_tra_info_lmsc_map_f = -1;
215 static int hf_gtpv2_tra_info_lmsc_cap = -1;
216 static int hf_gtpv2_tra_info_lmsc_map_d = -1;
217 static int hf_gtpv2_tra_info_lmsc_map_c = -1;
218 static int hf_gtpv2_tra_info_lmgw_mc = -1;
219 static int hf_gtpv2_tra_info_lmgw_nb_up = -1;
220 static int hf_gtpv2_tra_info_lmgw_lu_up = -1;
221 static int hf_gtpv2_tra_info_lsgsn_gb = -1;
222 static int hf_gtpv2_tra_info_lsgsn_lu = -1;
223 static int hf_gtpv2_tra_info_lsgsn_gn = -1;
224 static int hf_gtpv2_tra_info_lsgsn_map_gr = -1;
225 static int hf_gtpv2_tra_info_lsgsn_map_gd = -1;
226 static int hf_gtpv2_tra_info_lsgsn_map_gf = -1;
227 static int hf_gtpv2_tra_info_lsgsn_gs = -1;
228 static int hf_gtpv2_tra_info_lsgsn_ge = -1;
229 static int hf_gtpv2_tra_info_lggsn_gn = -1;
230 static int hf_gtpv2_tra_info_lggsn_gi = -1;
231 static int hf_gtpv2_tra_info_lggsn_gmb = -1;
232 static int hf_gtpv2_tra_info_lrnc_lu = -1;
233 static int hf_gtpv2_tra_info_lrnc_lur = -1;
234 static int hf_gtpv2_tra_info_lrnc_lub = -1;
235 static int hf_gtpv2_tra_info_lrnc_uu = -1;
236 static int hf_gtpv2_tra_info_lbm_sc_gmb = -1;
237 static int hf_gtpv2_tra_info_lmme_s1_mme = -1;
238 static int hf_gtpv2_tra_info_lmme_s3 = -1;
239 static int hf_gtpv2_tra_info_lmme_s6a = -1;
240 static int hf_gtpv2_tra_info_lmme_s10 = -1;
241 static int hf_gtpv2_tra_info_lmme_s11 = -1;
242 static int hf_gtpv2_tra_info_lsgw_s4 = -1;
243 static int hf_gtpv2_tra_info_lsgw_s5 = -1;
244 static int hf_gtpv2_tra_info_lsgw_s8b = -1;
245 static int hf_gtpv2_tra_info_lsgw_s11 = -1;
246 static int hf_gtpv2_tra_info_lpdn_gw_s2a = -1;
247 static int hf_gtpv2_tra_info_lpdn_gw_s2b = -1;
248 static int hf_gtpv2_tra_info_lpdn_gw_s2c = -1;
249 static int hf_gtpv2_tra_info_lpdn_gw_s5 = -1;
250 static int hf_gtpv2_tra_info_lpdn_gw_s6c = -1;
251 static int hf_gtpv2_tra_info_lpdn_gw_gx = -1;
252 static int hf_gtpv2_tra_info_lpdn_gw_s8b = -1;
253 static int hf_gtpv2_tra_info_lpdn_gw_sgi = -1;
254 static int hf_gtpv2_tra_info_lenb_s1_mme = -1;
255 static int hf_gtpv2_tra_info_lenb_x2 = -1;
256 static int hf_gtpv2_tra_info_lenb_uu = -1;
258 static int hf_gtpv2_address_digits = -1;
259 static int hf_gtpv2_ti = -1;
261 static int hf_gtpv2_bearer_qos_pvi= -1;
262 static int hf_gtpv2_bearer_qos_pl= -1;
263 static int hf_gtpv2_bearer_qos_pci= -1;
264 static int hf_gtpv2_bearer_qos_label_qci = -1;
265 static int hf_gtpv2_bearer_qos_mbr_up = -1;
266 static int hf_gtpv2_bearer_qos_mbr_down = -1;
267 static int hf_gtpv2_bearer_qos_gbr_up = -1;
268 static int hf_gtpv2_bearer_qos_gbr_down = -1;
269 static int hf_gtpv2_flow_qos_label_qci = -1;
270 static int hf_gtpv2_flow_qos_mbr_up = -1;
271 static int hf_gtpv2_flow_qos_mbr_down = -1;
272 static int hf_gtpv2_flow_qos_gbr_up = -1;
273 static int hf_gtpv2_flow_qos_gbr_down = -1;
275 static int hf_gtpv2_delay_value = -1;
276 static int hf_gtpv2_charging_id = -1;
277 static int hf_gtpv2_charging_characteristic = -1;
278 static int hf_gtpv2_bearer_flag_ppc = -1;
279 static int hf_gtpv2_bearer_flag_vb = -1;
280 static int hf_gtpv2_ue_time_zone_dst = -1;
281 static int hf_gtpv2_fq_csid_type = -1;
282 static int hf_gtpv2_fq_csid_nr = -1;
283 static int hf_gtpv2_fq_csid_ipv4 = -1;
284 static int hf_gtpv2_fq_csid_ipv6 = -1;
285 static int hf_gtpv2_fq_csid_id = -1;
286 static int hf_gtpv2_complete_req_msg_type = -1;
287 static int hf_gtpv2_mme_grp_id = -1;
288 static int hf_gtpv2_mme_code = -1;
289 static int hf_gtpv2_m_tmsi = -1;
290 static int hf_gtpv2_container_type = -1;
291 static int hf_gtpv2_cause_type = -1;
292 static int hf_gtpv2_CauseRadioNetwork = -1;
293 static int hf_gtpv2_CauseTransport = -1;
294 static int hf_gtpv2_CauseNas = -1;
295 static int hf_gtpv2_CauseProtocol = -1;
296 static int hf_gtpv2_CauseMisc = -1;
297 static int hf_gtpv2_target_type = -1;
298 static int hf_gtpv2_macro_enodeb_id = -1;
300 static int hf_gtpv2_node_type= -1;
301 static int hf_gtpv2_fqdn = -1;
302 static int hf_gtpv2_enterprise_id = -1;
303 static int hf_gtpv2_apn_rest= -1;
304 static int hf_gtpv2_pti= -1;
305 static int hf_gtpv2_mm_context_sm = -1;
306 static int hf_gtpv2_mm_context_nhi = -1;
307 static int hf_gtpv2_mm_context_drxi = -1;
308 static int hf_gtpv2_mm_context_cksn = -1;
309 static int hf_gtpv2_mm_context_cksn_ksi = -1;
310 static int hf_gtpv2_mm_context_kasme = -1;
311 static int hf_gtpv2_mm_context_rand = -1;
312 static int hf_gtpv2_mm_context_xres_len = -1;
313 static int hf_gtpv2_mm_context_xres = -1;
314 static int hf_gtpv2_mm_context_autn_len = -1;
315 static int hf_gtpv2_mm_context_autn = -1;
316 static int hf_gtpv2_mm_context_drx = -1;
317 static int hf_gtpv2_mm_context_ue_net_cap_len = -1;
318 static int hf_gtpv2_mm_context_ms_net_cap_len = -1;
319 static int hf_gtpv2_mm_context_mei_len = -1;
320 static int hf_gtpv2_mm_context_vdp_len = -1;
321 static int hf_gtpv2_mm_context_higher_br_16mb_flg_len = -1;
322 static int hf_gtpv2_mm_context_higher_br_16mb_flg = -1;
323 static int hf_gtpv2_vdp_length = -1;
325 static int hf_gtpv2_una = -1;
326 static int hf_gtpv2_gena = -1;
327 static int hf_gtpv2_gana = -1;
328 static int hf_gtpv2_ina = -1;
329 static int hf_gtpv2_ena = -1;
330 static int hf_gtpv2_hnna = -1;
331 static int hf_gtpv2_mm_context_ksi_a= -1;
332 static int hf_gtpv2_mm_context_ksi = -1;
333 static int hf_gtpv2_mm_context_nr_tri = -1;
334 static int hf_gtpv2_mm_context_used_cipher = -1;
335 static int hf_gtpv2_mm_context_nr_qui = -1;
336 static int hf_gtpv2_mm_context_nr_qua = -1;
337 static int hf_gtpv2_mm_context_uamb_ri = -1;
338 static int hf_gtpv2_mm_context_osci = -1;
339 static int hf_gtpv2_mm_context_samb_ri = -1;
340 static int hf_gtpv2_mm_context_unipa = -1;
341 static int hf_gtpv2_mm_context_unc = -1;
342 static int hf_gtpv2_mm_context_nas_dl_cnt = -1;
343 static int hf_gtpv2_mm_context_nas_ul_cnt = -1;
345 static int hf_gtpv2_uli_cgi_lac= -1;
346 static int hf_gtpv2_uli_cgi_ci= -1;
347 static int hf_gtpv2_uli_sai_lac= -1;
348 static int hf_gtpv2_uli_sai_sac= -1;
349 static int hf_gtpv2_uli_rai_lac= -1;
350 static int hf_gtpv2_uli_rai_rac= -1;
351 static int hf_gtpv2_uli_tai_tac= -1;
352 static int hf_gtpv2_uli_ecgi_eci= -1;
353 static int hf_gtpv2_uli_lai_lac = -1;
354 static int hf_gtpv2_uli_ecgi_eci_spare= -1;
355 static int hf_gtpv2_nsapi = -1;
356 static int hf_gtpv2_bearer_control_mode= -1;
358 static int hf_gtpv2_bss_container_phx = -1;
359 static int hf_gtpv2_bss_con_sapi_flg = -1;
360 static int hf_gtpv2_bss_con_rp_flg = -1;
361 static int hf_gtpv2_bss_con_pfi_flg = -1;
362 static int hf_gtpv2_bss_con_pfi = -1;
363 static int hf_gtpv2_bss_con_rp = -1;
364 static int hf_gtpv2_bss_con_sapi = -1;
365 static int hf_gtpv2_bss_con_xid_len = -1;
366 static int hf_gtpv2_bss_con_xid = -1;
367 static int hf_gtpv2_home_enodeb_id = -1;
368 static int hf_gtpv2_tac = -1;
371 static int hf_gtpv2_mbms_service_area_nr = -1;
372 static int hf_gtpv2_mbms_service_area_id = -1;
373 static int hf_gtpv2_mbms_session_id = -1;
374 static int hf_gtpv2_mbms_flow_id = -1;
375 static int hf_gtpv2_cteid = -1;
376 static int hf_gtpv2_ip_addr_type = -1;
377 static int hf_gtpv2_ip_addr_len = -1;
378 static int hf_gtpv2_mbms_ip_mc_dist_addrv4 = -1;
379 static int hf_gtpv2_mbms_ip_mc_dist_addrv6 = -1;
380 static int hf_gtpv2_mbms_ip_mc_src_addrv4 = -1;
381 static int hf_gtpv2_mbms_ip_mc_src_addrv6 = -1;
382 static int hf_gtpv2_mbms_hc_indicator = -1;
383 static int hf_gtpv2_mbms_dist_indication = -1;
384 static int hf_gtpv2_subscriber_rfsp = -1;
385 static int hf_gtpv2_rfsp_inuse = -1;
386 static int hf_gtpv2_mbms_service_id = -1;
387 static int hf_gtpv2_add_flags_for_srvcc_ics = -1;
388 static int hf_gtpv2_vsrvcc_flag = -1;
389 static int hf_gtpv2_abs_time_mbms_data = -1;
390 static int hf_gtpv2_henb_info_report_fti = -1;
391 static int hf_gtpv2_ip4cp_subnet_prefix_len = -1;
392 static int hf_gtpv2_ip4cp_ipv4 = -1;
393 static int hf_gtpv2_change_report_flags_sncr = -1;
394 static int hf_gtpv2_change_report_flags_tzcr = -1;
395 static int hf_gtpv2_action_indication_val = -1;
396 static int hf_gtpv2_mbms_session_duration_days = -1;
397 static int hf_gtpv2_mbms_session_duration_secs = -1;
398 static int hf_gtpv2_node_features_prn = -1;
399 static int hf_gtpv2_node_features_mabr =-1;
400 static int hf_gtpv2_node_features_ntsr = -1;
401 static int hf_gtpv2_time_to_data_xfer = -1;
402 static int hf_gtpv2_arp_pvi = -1;
403 static int hf_gtpv2_arp_pl = -1;
404 static int hf_gtpv2_arp_pci = -1;
405 static int hf_gtpv2_timer_unit = -1;
406 static int hf_gtpv2_timer_value = -1;
407 static int hf_gtpv2_lapi = -1;
409 static gint ett_gtpv2 = -1;
410 static gint ett_gtpv2_flags = -1;
411 static gint ett_gtpv2_ie = -1;
412 static gint ett_gtpv2_uli_flags = -1;
413 static gint ett_gtpv2_uli_field = -1;
414 static gint ett_gtpv2_bearer_ctx = -1;
415 static gint ett_gtpv2_PDN_conn = -1;
416 static gint ett_gtpv2_mm_context_flag = -1;
417 static gint ett_gtpv2_pdn_numbers_nsapi = -1;
418 static gint ett_gtpv2_tra_info_trigg = -1;
419 static gint ett_gtpv2_tra_info_trigg_msc_server = -1;
420 static gint ett_gtpv2_tra_info_trigg_mgw = -1;
421 static gint ett_gtpv2_tra_info_trigg_sgsn = -1;
422 static gint ett_gtpv2_tra_info_trigg_ggsn = -1;
423 static gint ett_gtpv2_tra_info_trigg_bm_sc = -1;
424 static gint ett_gtpv2_tra_info_trigg_sgw_mme = -1;
425 static gint ett_gtpv2_tra_info_interfaces = -1;
426 static gint ett_gtpv2_tra_info_interfaces_imsc_server = -1;
427 static gint ett_gtpv2_tra_info_interfaces_lmgw = -1;
428 static gint ett_gtpv2_tra_info_interfaces_lsgsn = -1;
429 static gint ett_gtpv2_tra_info_interfaces_lggsn = -1;
430 static gint ett_gtpv2_tra_info_interfaces_lrnc = -1;
431 static gint ett_gtpv2_tra_info_interfaces_lbm_sc = -1;
432 static gint ett_gtpv2_tra_info_interfaces_lmme = -1;
433 static gint ett_gtpv2_tra_info_interfaces_lsgw = -1;
434 static gint ett_gtpv2_tra_info_interfaces_lpdn_gw = -1;
435 static gint ett_gtpv2_tra_info_interfaces_lpdn_lenb = -1;
436 static gint ett_gtpv2_tra_info_ne_types = -1;
437 static gint ett_gtpv2_rai = -1;
438 static gint ett_gtpv2_ms_mark = -1;
439 static gint ett_gtpv2_stn_sr = -1;
440 static gint ett_gtpv2_supp_codec_list = -1;
441 static gint ett_gtpv2_bss_con = -1;
442 static gint ett_gtpv2_mm_context_auth_qua = -1;
443 static gint ett_gtpv2_mm_context_auth_qui = -1;
444 static gint ett_gtpv2_mm_context_auth_tri = -1;
445 static gint ett_gtpv2_mm_context_net_cap = -1;
446 static gint ett_gtpv2_ms_network_capability = -1;
447 static gint ett_gtpv2_vd_pref = -1;
448 static gint ett_gtpv2_access_rest_data = -1;
449 static gint ett_gtpv2_qua = -1;
450 static gint ett_gtpv2_qui = -1;
452 static expert_field ei_gtpv2_ie_data_not_dissected = EI_INIT;
453 static expert_field ei_gtpv2_ie_len_invalid = EI_INIT;
454 static expert_field ei_gtpv2_source_type_unknown = EI_INIT;
455 static expert_field ei_gtpv2_fq_csid_type_bad = EI_INIT;
457 /* Definition of User Location Info (AVP 22) masks */
458 #define GTPv2_ULI_CGI_MASK 0x01
459 #define GTPv2_ULI_SAI_MASK 0x02
460 #define GTPv2_ULI_RAI_MASK 0x04
461 #define GTPv2_ULI_TAI_MASK 0x08
462 #define GTPv2_ULI_ECGI_MASK 0x10
463 #define GTPv2_ULI_LAI_MASK 0x20
465 #define GTPV2_CREATE_SESSION_REQUEST 32
466 #define GTPV2_CREATE_SESSION_RESPONSE 33
467 #define GTPV2_CONTEXT_RESPONSE 131
468 #define GTPV2_FORWARD_RELOCATION_REQ 133
469 #define GTPV2_FORWARD_CTX_NOTIFICATION 137
470 #define GTPV2_RAN_INFORMATION_RELAY 152
472 static void dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, gint offset, guint8 message_type);
474 /*Message Types for GTPv2 (Refer Pg19 29.274) (SB)*/
475 static const value_string gtpv2_message_type_vals[] = {
477 { 1, "Echo Request"},
478 { 2, "Echo Response"},
479 { 3, "Version Not Supported Indication"},
480 /* 4-24 Reserved for S101 interface TS 29.276 */
481 { 4, "Node Alive Request"},
482 { 5, "Node Alive Response"},
483 { 6, "Redirection Request"},
484 { 7, "Redirection Response"},
485 /* 25-31 Reserved for Sv interface TS 29.280 */
486 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 5.2.1*/
487 { 25, "SRVCC PS to CS Request"},
488 { 26, "SRVCC PS to CS Response"},
489 { 27, "SRVCC PS to CS Complete Notification"},
490 { 28, "SRVCC PS to CS Complete Acknowledge"},
491 { 29, "SRVCC PS to CS Cancel Notification"},
492 { 30, "SRVCC PS to CS Cancel Acknowledge"},
493 { 31, "For Future Sv interface use"},
494 /*End SRVCC Messages*/
495 /* SGSN/MME to PGW (S4/S11, S5/S8) */
496 { 32, "Create Session Request"},
497 { 33, "Create Session Response"},
498 { 34, "Modify Bearer Request"},
499 { 35, "Modify Bearer Response"},
500 { 36, "Delete Session Request"},
501 { 37, "Delete Session Response"},
502 /* SGSN to PGW (S4, S5/S8) */
503 { 38, "Change Notification Request"},
504 { 39, "Change Notification Response"},
505 /* 40-63 For future use */
506 /* Messages without explicit response */
507 { 64, "Modify Bearer Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
508 { 65, "Modify Bearer Failure Indication"}, /*(PGW to MME/SGSN -S5/S8, S11/S4) */
509 { 66, "Delete Bearer Command"}, /* (MME to PGW -S11, S5/S8) */
510 { 67, "Delete Bearer Failure Indication"}, /* (PGW to MME -S5/S8, S11) */
511 { 68, "Bearer Resource Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
512 { 69, "Bearer Resource Failure Indication"}, /* (PGW to MME/SGSN -S5/S8, S11/S4) */
513 { 70, "Downlink Data Notification Failure Indication"}, /*(SGSN/MME to SGW -S4/S11) */
514 { 71, "Trace Session Activation"},
515 { 72, "Trace Session Deactivation"},
516 { 73, "Stop Paging Indication"},
517 /* 74-94 For future use */
518 /* PDN-GW to SGSN/MME (S5/S8, S4/S11) */
519 { 95, "Create Bearer Request"},
520 { 96, "Create Bearer Response"},
521 { 97, "Update Bearer Request"},
522 { 98, "Update Bearer Response"},
523 { 99, "Delete Bearer Request"},
524 {100, "Delete Bearer Response"},
525 /* PGW to MME, MME to PGW, SGW to PGW, SGW to MME (S5/S8, S11) */
526 {101, "Delete PDN Connection Set Request"},
527 {102, "Delete PDN Connection Set Response"},
528 /* 103-127 For future use */
529 /* MME to MME, SGSN to MME, MME to SGSN, SGSN to SGSN (S3/10/S16) */
530 {128, "Identification Request"},
531 {129, "Identification Response"},
532 {130, "Context Request"},
533 {131, "Context Response"},
534 {132, "Context Acknowledge"},
535 {133, "Forward Relocation Request"},
536 {134, "Forward Relocation Response"},
537 {135, "Forward Relocation Complete Notification"},
538 {136, "Forward Relocation Complete Acknowledge"},
539 {137, "Forward Access Context Notification"},
540 {138, "Forward Access Context Acknowledge"},
541 {139, "Relocation Cancel Request"},
542 {140, "Relocation Cancel Response"},
543 {141, "Configuration Transfer Tunnel"},
544 /* 142-148 For future use */
545 /* SGSN to MME, MME to SGSN (S3)*/
546 {149, "Detach Notification"},
547 {150, "Detach Acknowledge"},
548 {151, "CS Paging Indication"},
549 {152, "RAN Information Relay"},
550 {153, "Alert MME Notification"},
551 {154, "Alert MME Acknowledge"},
552 {155, "UE Activity Notification"},
553 {156, "UE Activity Acknowledge"},
554 /* 157 to 159 For future use */
555 /* MME to SGW (S11) */
556 {160, "Create Forwarding Tunnel Request"},
557 {161, "Create Forwarding Tunnel Response"},
558 {162, "Suspend Notification"},
559 {163, "Suspend Acknowledge"},
560 {164, "Resume Notification"},
561 {165, "Resume Acknowledge"},
562 {166, "Create Indirect Data Forwarding Tunnel Request"},
563 {167, "Create Indirect Data Forwarding Tunnel Response"},
564 {168, "Delete Indirect Data Forwarding Tunnel Request"},
565 {169, "Delete Indirect Data Forwarding Tunnel Response"},
566 {170, "Release Access Bearers Request"},
567 {171, "Release Access Bearers Response"},
568 /* 172-175 For future use */
569 /* SGW to SGSN/MME (S4/S11) */
570 {176, "Downlink Data Notification"},
571 {177, "Downlink Data Notification Acknowledgement"},
572 {178, "Reserved. Allocated in earlier version of the specification."},
573 {179, "PGW Restart Notification"},
574 {180, "PGW Restart Notification Acknowledge"},
575 /* 181-199 For future use */
576 /* SGW to PGW, PGW to SGW (S5/S8) */
577 {200, "Update PDN Connection Set Request"},
578 {201, "Update PDN Connection Set Response"},
579 /* 202 to 210 For future use */
580 /* MME to SGW (S11) */
581 {211, "Modify Access Bearers Request"},
582 {212, "Modify Access Bearers Response"},
583 /* 213 to 230 For future use */
584 /* MBMS GW to MME/SGSN (Sm/Sn) */
585 {231, "MBMS Session Start Request"},
586 {232, "MBMS Session Start Response"},
587 {233, "MBMS Session Update Request"},
588 {234, "MBMS Session Update Response"},
589 {235, "MBMS Session Stop Request"},
590 {236, "MBMS Session Stop Response"},
591 /* 237 to 239 For future use */
592 /* 240-255 Reserved for GTP-U TS 29.281 [13] */
593 {240, "Data Record Transfer Request"},
594 {241, "Data Record Transfer Response"},
597 static value_string_ext gtpv2_message_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_message_type_vals);
599 #define GTPV2_IE_RESERVED 0
600 #define GTPV2_IE_IMSI 1
601 #define GTPV2_IE_CAUSE 2
602 #define GTPV2_REC_REST_CNT 3
603 /*Start SRVCC Messages*/
604 #define GTPV2_IE_STN_SR 51
605 #define GTPV2_IE_SRC_TGT_TRANS_CON 52
606 #define GTPV2_IE_TGT_SRC_TRANS_CON 53
607 #define GTPV2_IE_MM_CON_EUTRAN_SRVCC 54
608 #define GTPV2_IE_MM_CON_UTRAN_SRVCC 55
609 #define GTPV2_IE_SRVCC_CAUSE 56
610 #define GTPV2_IE_TGT_RNC_ID 57
611 #define GTPV2_IE_TGT_GLOGAL_CELL_ID 58
612 #define GTPV2_IE_TEID_C 59
613 #define GTPV2_IE_SV_FLAGS 60
614 #define GTPV2_IE_SAI 61
615 /* 61 - 70 for future sv interface use*/
616 /*End SRVCC Messages*/
618 #define GTPV2_AMBR 72
620 #define GTPV2_IP_ADDRESS 74
622 #define GTPV2_IE_MSISDN 76
623 #define GTPV2_INDICATION 77
626 #define GTPV2_BEARER_QOS 80
627 #define GTPV2_IE_FLOW_QOS 81
628 #define GTPV2_IE_RAT_TYPE 82
629 #define GTPV2_IE_SERV_NET 83
630 #define GTPV2_IE_BEARER_TFT 84
631 #define GTPV2_IE_TAD 85
632 #define GTPV2_IE_ULI 86
633 #define GTPV2_IE_F_TEID 87
634 #define GTPV2_IE_TMSI 88
635 #define GTPV2_IE_GLOBAL_CNID 89
636 #define GTPV2_IE_S103PDF 90
637 #define GTPV2_IE_S1UDF 91
638 #define GTPV2_IE_DEL_VAL 92
639 #define GTPV2_IE_BEARER_CTX 93
640 #define GTPV2_IE_CHAR_ID 94
641 #define GTPV2_IE_CHAR_CHAR 95
642 #define GTPV2_IE_TRA_INFO 96
643 #define GTPV2_BEARER_FLAG 97
644 /* define GTPV2_IE_PAGING_CAUSE 98 (void) */
645 #define GTPV2_IE_PDN_TYPE 99
646 #define GTPV2_IE_PTI 100
647 #define GTPV2_IE_DRX_PARAM 101
648 #define GTPV2_IE_UE_NET_CAPABILITY 102
649 #define GTPV2_IE_MM_CONTEXT_GSM_T 103
650 #define GTPV2_IE_MM_CONTEXT_UTMS_CQ 104
651 #define GTPV2_IE_MM_CONTEXT_GSM_CQ 105
652 #define GTPV2_IE_MM_CONTEXT_UTMS_Q 106
653 #define GTPV2_IE_MM_CONTEXT_EPS_QQ 107
654 #define GTPV2_IE_MM_CONTEXT_UTMS_QQ 108
655 #define GTPV2_IE_PDN_CONNECTION 109
656 #define GTPV2_IE_PDN_NUMBERS 110
657 #define GTPV2_IE_P_TMSI 111
658 #define GTPV2_IE_P_TMSI_SIG 112
659 #define GTPV2_IE_HOP_COUNTER 113
660 #define GTPV2_IE_UE_TIME_ZONE 114
661 #define GTPV2_IE_TRACE_REFERENCE 115
662 #define GTPV2_IE_COMPLETE_REQUEST_MSG 116
663 #define GTPV2_IE_GUTI 117
664 #define GTPV2_IE_F_CONTAINER 118
665 #define GTPV2_IE_F_CAUSE 119
666 #define GTPV2_IE_SEL_PLMN_ID 120
667 #define GTPV2_IE_TARGET_ID 121
668 /* GTPV2_IE_NSAPI 122 */
669 #define GTPV2_IE_PKT_FLOW_ID 123
670 #define GTPV2_IE_RAB_CONTEXT 124
671 #define GTPV2_IE_S_RNC_PDCP_CTX_INFO 125
672 #define GTPV2_IE_UDP_S_PORT_NR 126
673 #define GTPV2_IE_APN_RESTRICTION 127
674 #define GTPV2_IE_SEL_MODE 128
675 #define GTPV2_IE_SOURCE_IDENT 129
676 #define GTPV2_IE_BEARER_CONTROL_MODE 130
677 #define GTPV2_IE_CNG_REP_ACT 131
678 #define GTPV2_IE_FQ_CSID 132
679 #define GTPV2_IE_CHANNEL_NEEDED 133
680 #define GTPV2_IE_EMLPP_PRI 134
681 #define GTPV2_IE_NODE_TYPE 135
682 #define GTPV2_IE_FQDN 136
683 #define GTPV2_IE_TI 137
684 #define GTPV2_IE_MBMS_SESSION_DURATION 138
685 #define GTPV2_IE_MBMS_SERVICE_AREA 139
686 #define GTPV2_IE_MBMS_SESSION_ID 140
687 #define GTPV2_IE_MBMS_FLOW_ID 141
688 #define GTPV2_IE_MBMS_IP_MC_DIST 142
689 #define GTPV2_IE_MBMS_DIST_ACK 143
690 #define GTPV2_IE_RFSP_INDEX 144
691 #define GTPV2_IE_UCI 145
692 #define GTPV2_IE_CSG_INFO_REP_ACTION 146
693 #define GTPV2_IE_CSG_ID 147
694 #define GTPV2_IE_CMI 148
695 #define GTPV2_IE_SERVICE_INDICATOR 149
696 #define GTPV2_IE_DETACH_TYPE 150
697 #define GTPV2_IE_LDN 151
698 #define GTPV2_IE_NODE_FEATURES 152
699 #define GTPV2_IE_MBMS_TIME_TO_DATA_XFER 153
700 #define GTPV2_IE_THROTTLING 154
701 #define GTPV2_IE_ARP 155
702 #define GTPV2_IE_EPC_TIMER 156
703 #define GTPV2_IE_SIG_PRIO_IND 157
704 #define GTPV2_IE_TMGI 158
705 #define GTPV2_IE_ADD_MM_CONT_FOR_SRVCC 159
706 #define GTPV2_IE_ADD_FLAGS_FOR_SRVCC 160
707 #define GTPV2_IE_MMBR 161
708 #define GTPV2_IE_MDT_CONFIG 162
709 #define GTPV2_IE_APCO 163
710 #define GTPV2_IE_ABS_MBMS_DATA_TF_TIME 164
711 #define GTPV2_IE_HENB_INFO_REPORT 165
712 #define GTPV2_IE_IP4CP 166
713 #define GTPV2_IE_CHANGE_TO_REPORT_FLAGS 167
714 #define GTPV2_IE_ACTION_INDICATION 168
715 /* 169 to 254 reserved for future use */
716 #define GTPV2_IE_PRIVATE_EXT 255
719 #define CREATE_NEW_TFT 0X20
720 #define DELETE_TFT 0X40
721 #define ADD_PACKET_FILTERS_TFT 0X60
722 #define REPLACE_PACKET_FILTERS_TFT 0X80
723 #define DELETE_PACKET_FILTERS_TFT 0XA0
724 #define NO_TFT_OPERATION 0XC0
725 #define RESERVED 0XE0
728 /* Table 8.1-1: Information Element types for GTPv2 */
729 static const value_string gtpv2_element_type_vals[] = {
731 { 1, "International Mobile Subscriber Identity (IMSI)"}, /* Variable Length / 8.3 */
732 { 2, "Cause"}, /* Variable Length / 8.4 */
733 { 3, "Recovery (Restart Counter)"}, /* Variable Length / 8.5 */
734 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
735 /* 51-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
736 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 6.1*/
737 { 51, "STN-SR"}, /* Variable Length / 6.2 */
738 { 52, "Source to Target Transparent Container"}, /* Variable Length / 6.3 */
739 { 53, "Target to Source Transparent Container"}, /* Variable Length / 6.4 */
740 { 54, "MM Context for E-UTRAN SRVCC"}, /* Variable Length / 6.5 */
741 { 55, "MM Context for UTRAN SRVCC"}, /* Variable Length / 6.6 */
742 { 56, "SRVCC Cause"}, /* Fixed Length / 6.7 */
743 { 57, "Target RNC ID"}, /* Variable Length / 6.8 */
744 { 58, "Target Global Cell ID"}, /* Variable Length / 6.9 */
745 { 59, "TEID-C"}, /* Extendable / 6.10 */
746 { 60, "Sv Flags"}, /* Extendable / 6.11 */
747 { 61, "Service Area Identifier"}, /* Extendable / 6.12 */
748 /* 62-70 For future Sv interface use */
749 /*End SRVCC Messages*/
750 { 71, "Access Point Name (APN)"}, /* Variable Length / 8.6 */
751 { 72, "Aggregate Maximum Bit Rate (AMBR)"}, /* Fixed Length / 8.7 */
752 { 73, "EPS Bearer ID (EBI)"}, /* Extendable / 8.8 */
753 { 74, "IP Address"}, /* Extendable / 8.9 */
754 { 75, "Mobile Equipment Identity (MEI)"}, /* Variable Length / 8.10 */
755 { 76, "MSISDN"}, /* Variable Length / 8.11 */
756 { 77, "Indication"}, /* Extendable / 8.12 */
757 { 78, "Protocol Configuration Options (PCO)"}, /* Variable Length / 8.13 */
758 { 79, "PDN Address Allocation (PAA)"}, /* Variable Length / 8.14 */
759 { 80, "Bearer Level Quality of Service (Bearer QoS)"}, /* Variable Length / 8.15 */
760 { 81, "Flow Quality of Service (Flow QoS)"}, /* Extendable / 8.16 */
761 { 82, "RAT Type"}, /* Extendable / 8.17 */
762 { 83, "Serving Network"}, /* Extendable / 8.18 */
763 { 84, "EPS Bearer Level Traffic Flow Template (Bearer TFT)"}, /* Variable Length / 8.19 */
764 { 85, "Traffic Aggregation Description (TAD)"}, /* Variable Length / 8.20 */
765 { 86, "User Location Info (ULI)"}, /* Variable Length / 8.21 */
766 { 87, "Fully Qualified Tunnel Endpoint Identifier (F-TEID)"}, /* Extendable / 8.22 */
767 { 88, "TMSI"}, /* Variable Length / 8.23 */
768 { 89, "Global CN-Id"}, /* Variable Length / 8.24 */
769 { 90, "S103 PDN Data Forwarding Info (S103PDF)"}, /* Variable Length / 8.25 */
770 { 91, "S1-U Data Forwarding Info (S1UDF)"}, /* Variable Length/ 8.26 */
771 { 92, "Delay Value"}, /* Extendable / 8.27 */
772 { 93, "Bearer Context"}, /* Extendable / 8.28 */
773 { 94, "Charging ID"}, /* Extendable / 8.29 */
774 { 95, "Charging Characteristics"}, /* Extendable / 8.30 */
775 { 96, "Trace Information"}, /* Extendable / 8.31 */
776 { 97, "Bearer Flags"}, /* Extendable / 8.32 */
777 { 98, "Paging Cause"}, /* Variable Length / 8.33 */
778 { 99, "PDN Type"}, /* Extendable / 8.34 */
779 {100, "Procedure Transaction ID"}, /* Extendable / 8.35 */
780 {101, "DRX Parameter"}, /* Variable Length/ 8.36 */
781 {102, "UE Network Capability"}, /* Variable Length / 8.37 */
782 {103, "MM Context (GSM Key and Triplets)"}, /* Variable Length / 8.38 */
783 {104, "MM Context (UMTS Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
784 {105, "MM Context (GSM Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
785 {106, "MM Context (UMTS Key and Quintuplets)"}, /* Variable Length / 8.38 */
786 {107, "MM Context (EPS Security Context, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
787 {108, "MM Context (UMTS Key, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
788 {109, "PDN Connection"}, /* Extendable / 8.39 */
789 {110, "PDU Numbers"}, /* Extendable / 8.40 */
790 {111, "P-TMSI"}, /* Variable Length / 8.41 */
791 {112, "P-TMSI Signature"}, /* Variable Length / 8.42 */
792 {113, "Hop Counter"}, /* Extendable / 8.43 */
793 {114, "UE Time Zone"}, /* Variable Length / 8.44 */
794 {115, "Trace Reference"}, /* Fixed Length / 8.45 */
795 {116, "Complete Request Message"}, /* Variable Length / 8.46 */
796 {117, "GUTI"}, /* Variable Length / 8.47 */
797 {118, "F-Container"}, /* Variable Length / 8.48 */
798 {119, "F-Cause"}, /* Variable Length / 8.49 */
799 {120, "Selected PLMN ID"}, /* Variable Length / 8.50 */
800 {121, "Target Identification"}, /* Variable Length / 8.51 */
801 {122, "NSAPI"}, /* Extendable / 8.52 */
802 {123, "Packet Flow ID"}, /* Variable Length / 8.53 */
803 {124, "RAB Context"}, /* Fixed Length / 8.54 */
804 {125, "Source RNC PDCP Context Info"}, /* Variable Length / 8.55 */
805 {126, "UDP Source Port Number"}, /* Extendable / 8.56 */
806 {127, "APN Restriction"}, /* Extendable / 8.57 */
807 {128, "Selection Mode"}, /* Extendable / 8.58 */
808 {129, "Source Identification"}, /* Variable Length / 8.50 */
809 {130, "Bearer Control Mode"}, /* Extendable / 8.60 */
810 {131, "Change Reporting Action"}, /* Variable Length / 8.61 */
811 {132, "Fully Qualified PDN Connection Set Identifier (FQ-CSID)"}, /* Variable Length / 8.62 */
812 {133, "Channel needed"}, /* Extendable / 8.63 */
813 {134, "eMLPP Priority"}, /* Extendable / 8.64 */
814 {135, "Node Type"}, /* Extendable / 8.65 */
815 {136, "Fully Qualified Domain Name (FQDN)"}, /* Variable Length / 8.66 */
816 {137, "Transaction Identifier (TI)"}, /* Variable Length / 8.68 */
817 {138, "MBMS Session Duration"}, /* Duration Extendable / 8.69 */
818 {139, "MBMS Service Area"}, /* Extendable / 8.70 */
819 {140, "MBMS Session Identifier"}, /* Extendable / 8.71 */
820 {141, "MBMS Flow Identifier"}, /* Extendable / 8.72 */
821 {142, "MBMS IP Multicast Distribution"}, /* Extendable / 8.73 */
822 {143, "MBMS Distribution Acknowledge"}, /* Extendable / 8.74 */
823 {144, "RFSP Index"}, /* Fixed Length / 8.77 */
824 {145, "User CSG Information (UCI)"}, /* Extendable / 8.75 */
825 {146, "CSG Information Reporting Action"}, /* Extendable / 8.76 */
826 {147, "CSG ID"}, /* Extendable / 8.78 */
827 {148, "CSG Membership Indication (CMI)"}, /* Extendable / 8.79 */
828 {149, "Service indicator"}, /* Fixed Length / 8.80 */
829 {150, "Detach Type"}, /* Fixed Length / 8.81 */
830 {151, "Local Distiguished Name (LDN)"}, /* Variable Length / 8.82 */
831 {152, "Node Features"}, /* Extendable / 8.83 */
832 {153, "MBMS Time to Data Transfer"}, /* Extendable / 8.84 */
833 {154, "Throttling"}, /* Extendable / 8.85 */
834 {155, "Allocation/Retention Priority (ARP)"}, /* Extendable / 8.86 */
835 {156, "EPC Timer"}, /* Extendable / 8.87 */
836 {157, "Signalling Priority Indication"}, /* Extendable / 8.88 */
837 {158, "Temporary Mobile Group Identity"}, /* Extendable / 8.89 */
838 {159, "Additional MM context for SRVCC"}, /* Extendable / 8.90 */
839 {160, "Additional flags for SRVCC"}, /* Extendable / 8.91 */
840 {161, "Max MBR/APN-AMBR (MMBR)"}, /* Extendable / 8.92 */
841 {162, "MDT Configuration"}, /* Extendable / 8.93 */
842 {163, "Additional Protocol Configuration Options (APCO)"}, /* Extendable / 8.94 */
843 {164, "Absolute Time of MBMS Data Transfer"}, /* Extendable / 8.95 */
844 {165, "H(e)NB Information Reporting"}, /* Extendable / 8.96*/
845 {166, "IPv4 Configuration Parameters (IP4CP)"}, /* Extendable / 8.97*/
846 {167, "Change to Report Flags"}, /* Extendable / 8.98 */
847 {168, "Action Indication"}, /* Extendable / 8.99 */
848 /* 169 to 254 Spare. For future use. */ /* For future use. FFS */
849 {255, "Private Extension"}, /* Variable Length / 8.67 */
852 static value_string_ext gtpv2_element_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_element_type_vals);
854 /* Code to dissect IE's */
857 dissect_gtpv2_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
859 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
863 * 8.3 International Mobile Subscriber Identity (IMSI)
865 * IMSI is defined in 3GPP TS 23.003
866 * Editor's note: IMSI coding will be defined in 3GPP TS 24.301
867 * Editor's note: In the first release of GTPv2 spec (TS 29.274v8.0.0) n = 8.
868 * That is, the overall length of the IE is 11 octets.
872 dissect_gtpv2_imsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
875 const gchar *imsi_str;
877 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
878 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
879 * allocated string will be returned.
881 imsi_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, length, NULL, FALSE);
883 proto_tree_add_string(tree, hf_gtpv2_imsi, tvb, offset, length, imsi_str);
884 proto_item_append_text(item, "%s", imsi_str);
892 /* Table 8.4-1: Cause values */
893 static const value_string gtpv2_cause_vals[] = {
895 /* Request / Initial message */
897 { 2, "Local Detach"},
898 { 3, "Complete Detach"},
899 { 4, "RAT changed from 3GPP to Non-3GPP"},
900 { 5, "ISR deactivation"},
901 { 6, "Error Indication received from RNC/eNodeB/S4-SGSN"},
902 { 7, "IMSI Detach Only"},
903 { 8, "Reactivation Requested"},
904 { 9, "PDN reconnection to this APN disallowed"},
905 { 10, "Access changed from Non-3GPP to 3GPP"},
906 { 11, "PDN connection inactivity timer expires"},
907 { 12, "PGW not responding"},
908 { 13, "Network Failure"},
909 { 14, "QoS parameter mismatch"},
910 /* 15 Spare. This value range is reserved for Cause values in a request message */
912 /* Acceptance in a Response / triggered message */
913 { 16, "Request accepted"},
914 { 17, "Request accepted partially"},
915 { 18, "New PDN type due to network preference"},
916 { 19, "New PDN type due to single address bearer only"},
917 /* 20-63 Spare. This value range shall be used by Cause values in an acceptance response/triggered message */
962 /* Rejection in a Response / triggered message */
963 { 64, "Context Not Found"},
964 { 65, "Invalid Message Format"},
965 { 66, "Version not supported by next peer"},
966 { 67, "Invalid length"},
967 { 68, "Service not supported"},
968 { 69, "Mandatory IE incorrect"},
969 { 70, "Mandatory IE missing"},
970 { 71, "Shall not be used"},
971 { 72, "System failure"},
972 { 73, "No resources available"},
973 { 74, "Semantic error in the TFT operation"},
974 { 75, "Syntactic error in the TFT operation"},
975 { 76, "Semantic errors in packet filter(s)"},
976 { 77, "Syntactic errors in packet filter(s)"},
977 { 78, "Missing or unknown APN"},
978 { 79, "Shall not be used"},
979 { 80, "GRE key not found"},
980 { 81, "Relocation failure"},
981 { 82, "Denied in RAT"},
982 { 83, "Preferred PDN type not supported"},
983 { 84, "All dynamic addresses are occupied"},
984 { 85, "UE context without TFT already activated"},
985 { 86, "Protocol type not supported"},
986 { 87, "UE not responding"},
988 { 89, "Service denied"},
989 { 90, "Unable to page UE"},
990 { 91, "No memory available"},
991 { 92, "User authentication failed"},
992 { 93, "APN access denied - no subscription"},
993 { 94, "Request rejected(reason not specified)"},
994 { 95, "P-TMSI Signature mismatch"},
995 { 96, "IMSI/IMEI not known"},
996 { 97, "Semantic error in the TAD operation"},
997 { 98, "Syntactic error in the TAD operation"},
998 { 99, "Shall not be used"},
999 {100, "Remote peer not responding"},
1000 {101, "Collision with network initiated request"},
1001 {102, "Unable to page UE due to Suspension"},
1002 {103, "Conditional IE missing"},
1003 {104, "APN Restriction type Incompatible with currently active PDN connection"},
1004 {105, "Invalid overall length of the triggered response message and a piggybacked initial message"},
1005 {106, "Data forwarding not supported"},
1006 {107, "Invalid reply from remote peer"},
1007 {108, "Fallback to GTPv1"},
1008 {109, "Invalid peer"},
1009 {110, "Temporarily rejected due to handover procedure in progress"},
1010 {111, "Modifications not limited to S1-U bearers"},
1011 {112, "Request rejected for a PMIPv6 reason "},
1012 {113, "APN Congestion"},
1013 {114, "Bearer handling not supported"},
1014 {115, "UE already re-attached"},
1015 {116, "Multiple PDN connections for a given APN not allowed"},
1016 /* 117-239 Spare. For future use in a triggered/response message */
1017 /* 240-255 Spare. For future use in an initial/request message */
1020 value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals);
1022 /* Table 8.4-1: CS (Cause Source) */
1023 static const true_false_string gtpv2_cause_cs = {
1024 "Originated by remote node",
1025 "Originated by node sending the message",
1029 dissect_gtpv2_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1034 /* Cause value octet 5 */
1035 tmp = tvb_get_guint8(tvb, offset);
1036 proto_tree_add_item(tree, hf_gtpv2_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1038 /* Add Cause to ie_tree */
1039 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(tmp, >pv2_cause_vals_ext, "Unknown"), tmp);
1042 /* Octet 6 Spare PCE BCE CS */
1043 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
1044 proto_tree_add_item(tree, hf_gtpv2_cause_pce, tvb, offset, 1, ENC_BIG_ENDIAN);
1045 proto_tree_add_item(tree, hf_gtpv2_cause_bce, tvb, offset, 1, ENC_BIG_ENDIAN);
1046 proto_tree_add_item(tree, hf_gtpv2_cause_cs, tvb, offset, 1, ENC_BIG_ENDIAN);
1049 /* If n = 2, a = 0 and the Cause IE shall be 6 octets long.
1050 * Therefore, octets "a(n+1) to a(n+4)" will not be present.
1051 * If n = 6, a = 1 and the Cause IE will be 10 octets long.
1053 if ( length == 2 ) {
1057 * If the rejection is due to a mandatory IE or a verifiable conditional IE is faulty
1058 * or missing, the offending IE shall be included within an additional field "a(n+1)
1059 * to a(n+4)". Only Type and Instance fields of the offending IE that caused the
1060 * rejection have a meaning. The length in the Octet 8-9 and spare bits in the Octet 10
1061 * shall be set to "0". In this case, the value of "n" shall be "6".
1062 * Otherwise, the value of "n" is equal to "2".
1065 /* Type of the offending IE */
1066 proto_tree_add_item(tree, hf_gtpv2_cause_off_ie_t, tvb, offset, 1, ENC_BIG_ENDIAN);
1070 proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1072 /* a(n+4) Spare Instance */
1073 proto_tree_add_bits_item(tree, hf_gtpv2_spare_half_octet, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
1074 proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
1079 * 8.5 Recovery (Restart Counter)
1082 dissect_gtpv2_recovery(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1087 recovery = tvb_get_guint8(tvb, offset);
1088 proto_tree_add_item(tree, hf_gtpv2_rec, tvb, offset, 1, ENC_BIG_ENDIAN);
1089 proto_item_append_text(item, "%u", recovery);
1094 /*Start SRVCC Messages*/
1098 dissect_gtpv2_stn_sr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1100 proto_item *stn_sr_item;
1101 proto_tree *sub_tree;
1105 stn_sr_item = proto_tree_add_item(tree, hf_gtpv2_stn_sr, tvb, offset, length, ENC_NA);
1106 new_tvb = tvb_new_subset(tvb, offset, length, length );
1107 sub_tree = proto_item_add_subtree(stn_sr_item, ett_gtpv2_stn_sr);
1110 * contains the Nature of Address and Numbering Plan Indicator (NANPI) of the "AddressString" ASN.1 type (see 3GPP
1111 * TS 29.002 [11]). Octets 6 to (n+4) contain the actual STN-SR (digits of an address encoded as a TBCD-STRING as in
1112 * the "AddressString" ASN.1 type). For an odd number of STN-SR digits, bits 8 to 5 of the last octet are encoded with the
1115 dissect_gsm_map_msisdn(new_tvb, pinfo, sub_tree);
1118 /* 6.3 Source to Target Transparent Container */
1121 dissect_gtpv2_src_tgt_trans_con(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1124 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1126 /*ra_type_flag = 0;*/
1128 /* Transparent Container
1129 * When target network is GERAN, this container carries the Old BSS to New BSS
1130 * Information IE defined in 3GPP TS 48.008 [8]. When target network is UTRAN, this container carries the Source RNC
1131 * to Target RNC Transparent Container IE defined in 3GPP TS 25.413 [9]. The Transparent container field includes the
1132 * IE value part as it is specified in the respective specification.
1134 proto_tree_add_text(tree, tvb, offset, length-1, "Transparent Container: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1136 * bssmap_old_bss_to_new_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo);
1137 * dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
1142 /* 6.4 Target to Source Transparent Container */
1144 dissect_gtpv2_tgt_src_trans_con(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1147 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1150 /* Transparent Container */
1151 proto_tree_add_text(tree, tvb, offset, length-1, "Transparent Container: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1156 /* 6.5 MM Context for E-UTRAN SRVCC */
1158 dissect_gtpv2_mm_con_eutran_srvcc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1162 proto_tree *ms_tree, *fi;
1164 proto_tree_add_item(tree, hf_gtpv2_eksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1166 proto_tree_add_text(tree, tvb, offset , 16, "CKsrvcc: %s ", tvb_bytes_to_ep_str(tvb, offset, 16));
1168 proto_tree_add_text(tree, tvb, offset, 16, "IKsrvcc: %s ", tvb_bytes_to_ep_str(tvb, offset, 16));
1171 /* Length of Mobile Station Classmark2 */
1172 elm_len = tvb_get_guint8(tvb, offset);
1173 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1175 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark2 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1176 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1177 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1180 /* Length of Mobile Station Classmark3 */
1181 elm_len = tvb_get_guint8(tvb, offset);
1182 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1184 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark3 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1185 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1186 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1189 /*Length of Supported Codec List */
1190 elm_len = tvb_get_guint8(tvb, offset);
1191 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1193 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Supported Codec List %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1194 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1195 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1199 /* 6.6 MM Context for UTRAN SRVCC */
1201 dissect_gtpv2_mm_con_utran_srvcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1205 proto_tree *ms_tree, *fi;
1207 proto_tree_add_item(tree, hf_gtpv2_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1210 proto_tree_add_text(tree, tvb, offset, 16, "CK'cs: %s", tvb_bytes_to_ep_str(tvb, offset, 16));
1212 proto_tree_add_text(tree, tvb, offset, 16, "IK'cs: %s", tvb_bytes_to_ep_str(tvb, offset, 16));
1214 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
1216 proto_tree_add_item(tree, hf_gtpv2_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
1219 /*Length of Mobile Station Classmark2 */
1220 elm_len = tvb_get_guint8(tvb, offset);
1221 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1223 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark2 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1224 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1225 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1228 /*Length of Mobile Station Classmark3 */
1229 elm_len = tvb_get_guint8(tvb, offset);
1230 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1232 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark3 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1233 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1234 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1237 /*Length of Supported Codec List */
1238 elm_len = tvb_get_guint8(tvb, offset);
1239 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1241 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Supported Codec List %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1242 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1243 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1247 /* 6.7 SRVCC Cause */
1248 static const value_string gtpv2_srvcc_cause_vals[] = {
1251 {2, "Handover/Relocation cancelled by source system "},
1252 {3, "Handover /Relocation Failure with Target system"},
1253 {4, "Handover/Relocation Target not allowed"},
1254 {5, "Unknown Target ID"},
1255 {6, "Target Cell not available"},
1256 {7, "No Radio Resources Available in Target Cell"},
1257 {8, "Failure in Radio Interface Procedure"},
1260 static value_string_ext gtpv2_srvcc_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_srvcc_cause_vals);
1263 dissect_gtpv2_srvcc_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1268 srvcc_cause = tvb_get_guint8(tvb, offset);
1269 proto_tree_add_item(tree, hf_gtpv2_srvcc_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1270 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(srvcc_cause, >pv2_srvcc_cause_vals_ext, "Unknown"), srvcc_cause);
1275 * 3GPP TS 29.280 version 10.3.0
1279 dissect_gtpv2_tgt_rnc_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1283 proto_tree *subtree;
1284 proto_item *rai_item;
1288 guint32 curr_offset;
1290 /*ra_type_flag = 1;*/ /*Flag to be set to differentiate GERAN and UTRAN*/
1291 curr_offset = offset;
1293 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1294 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1295 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1296 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1297 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1298 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1299 if ((mnc & 0x000f) == 0x000f)
1302 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1303 rnc_id = tvb_get_ntohs(tvb, curr_offset + 5);
1305 rai_item = proto_tree_add_text(tree,
1306 tvb, curr_offset, 6,
1307 "Routing area identification: %x-%x-%u-%u",
1308 mcc, mnc, lac, rnc_id);
1310 subtree = proto_item_add_subtree(rai_item, ett_gtpv2_rai);
1311 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, TRUE);
1314 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1316 proto_tree_add_item(subtree, hf_gtpv2_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1319 /* no length check possible */
1326 * 6.9 Target Global Cell ID
1327 * The encoding of this IE is defined in 3GPP TS 29.002
1328 * GlobalCellId ::= OCTET STRING (SIZE (5..7))
1329 * -- Refers to Cell Global Identification defined in TS 3GPP TS 23.003 [17].
1330 * -- The internal structure is defined as follows:
1331 * -- octet 1 bits 4321 Mobile Country Code 1st digit
1332 * -- bits 8765 Mobile Country Code 2nd digit
1333 * -- octet 2 bits 4321 Mobile Country Code 3rd digit
1334 * -- bits 8765 Mobile Network Code 3rd digit
1335 * -- or filler (1111) for 2 digit MNCs
1336 * -- octet 3 bits 4321 Mobile Network Code 1st digit
1337 * -- bits 8765 Mobile Network Code 2nd digit
1338 * -- octets 4 and 5 Location Area Code according to TS 3GPP TS 24.008 [35]
1339 * -- octets 6 and 7 Cell Identity (CI) according to TS 3GPP TS 24.008 [35]
1342 dissect_gtpv2_tgt_global_cell_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1346 proto_tree *subtree;
1347 proto_item *rai_item;
1351 guint32 curr_offset;
1353 curr_offset = offset;
1355 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1356 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1357 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1358 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1359 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1360 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1361 if ((mnc & 0x000f) == 0x000f)
1364 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1365 tgt_cell_id = tvb_get_guint8(tvb, curr_offset + 5);
1367 rai_item = proto_tree_add_text(tree,
1368 tvb, curr_offset, 6,
1369 "Routing area identification: %x-%x-%u-%u",
1370 mcc, mnc, lac, tgt_cell_id);
1372 subtree = proto_item_add_subtree(rai_item, ett_gtpv2_rai);
1373 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, TRUE);
1375 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset + 3, 2, ENC_BIG_ENDIAN);
1376 proto_tree_add_item(subtree, hf_gtpv2_tgt_g_cell_id, tvb, curr_offset + 5, 2, ENC_BIG_ENDIAN);
1378 proto_item_append_text(item, "%x-%x-%u-%u", mcc, mnc, lac, tgt_cell_id);
1379 /* no length check possible */
1383 /* 6.10 Tunnel Endpoint Identifier for Control Plane (TEID-C) */
1385 dissect_gtpv2_teid_c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1389 proto_tree_add_item(tree, hf_gtpv2_teid_c, tvb, offset, 4, ENC_BIG_ENDIAN);
1392 proto_tree_add_text(tree, tvb, offset, length-4, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-4));
1394 proto_item_append_text(item, "%u", tvb_get_ntohl(tvb, offset-4));
1399 dissect_gtpv2_sv_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1402 proto_tree_add_item(tree, hf_gtpv2_sv_sti, tvb, offset, 1, ENC_BIG_ENDIAN);
1403 proto_tree_add_item(tree, hf_gtpv2_sv_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
1404 proto_tree_add_item(tree, hf_gtpv2_sv_emind, tvb, offset, 1, ENC_BIG_ENDIAN);
1407 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1410 /* 6.12 Service Area Identifier */
1413 dissect_gtpv2_sai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1417 /* 5 MCC digit 2 MCC digit 1
1418 * 6 MNC digit 3 MCC digit 3
1419 * 7 MNC digit 2 MNC digit 1
1421 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
1424 /* The Location Area Code (LAC) consists of 2 octets. Bit 8 of Octet 8 is the most significant bit and bit 1 of Octet 9 the
1425 * least significant bit. The coding of the location area code is the responsibility of each administration. Coding using full
1426 * hexadecimal representation shall be used.
1428 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1431 /* The Service Area Code (SAC) consists of 2 octets. Bit 8 of Octet 10 is the most significant bit and bit 1 of Octet 11 the
1432 * least significant bit. The SAC is defined by the operator. See 3GPP TS 23.003 [4] subclause 12.5 for more information
1434 proto_tree_add_item(tree, hf_gtpv2_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
1437 /*End SRVCC Messages*/
1441 * 8.6 Access Point Name (APN)
1442 * The encoding the APN field follows 3GPP TS 23.003 [2] subclause 9.1.
1443 * The content of the APN field shall be the full APN with both the APN Network Identifier
1444 * and APN Operator Identifier being present as specified in 3GPP TS 23.003 [2]
1445 * subclauses 9.1.1 and 9.1.2, 3GPP TS 23.060 [35] Annex A and 3GPP TS 23.401 [3] subclauses 4.3.8.1.
1448 dissect_gtpv2_apn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1455 name_len = tvb_get_guint8(tvb, offset);
1457 if (name_len < 0x20) {
1458 apn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, length - 1);
1460 if (name_len >= length - 1)
1463 name_len = name_len + apn[tmp] + 1;
1467 apn = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
1469 proto_tree_add_string(tree, hf_gtpv2_apn, tvb, offset, length, apn);
1473 proto_item_append_text(item, "%s", apn);
1478 * 8.7 Aggregate Maximum Bit Rate (AMBR)
1482 dissect_gtpv2_ambr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1486 proto_tree_add_item(tree, hf_gtpv2_ambr_up, tvb, offset, 4, ENC_BIG_ENDIAN);
1488 proto_tree_add_item(tree, hf_gtpv2_ambr_down, tvb, offset, 4, ENC_BIG_ENDIAN);
1492 * 8.8 EPS Bearer ID (EBI)
1495 dissect_gtpv2_ebi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1501 /* Spare (all bits set to 0) B8 - B5*/
1502 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
1503 /* EPS Bearer ID (EBI) B4 - B1 */
1504 ebi = tvb_get_guint8(tvb, offset);
1505 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
1506 proto_item_append_text(item, "%u", ebi);
1513 dissect_gtpv2_ip_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1516 struct e_in6_addr ipv6_address;
1520 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv4, tvb, offset, length, ENC_BIG_ENDIAN);
1521 proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(tvb, offset));
1523 else if (length == 16)
1525 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv6, tvb, offset, length, ENC_NA);
1526 tvb_get_ipv6(tvb, offset, &ipv6_address);
1527 proto_item_append_text(item, "IPv6 %s", ip6_to_str(&ipv6_address));
1531 * 8.10 Mobile Equipment Identity (MEI)
1532 * The ME Identity field contains either the IMEI or the IMEISV
1533 * as defined in clause 6.2 of 3GPP TS 23.003 [2]. It is encoded
1534 * as specified in clause 7.7.53 of 3GPP TS 29.060 [4], beginning
1535 * with octet 4 of Figure 7.7.53.1. The IMEI(SV) digits are encoded
1536 * using BCD coding where IMEI is 15 BCD digits and IMEISV is 16 BCD
1537 * digits. For IMEI, bits 5 to 8 of the last octet shall be filled
1538 * with an end mark coded as '1111'.
1542 dissect_gtpv2_mei(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1545 const gchar *mei_str;
1547 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1548 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1549 * allocated string will be returned.
1551 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, 0, length, NULL, FALSE);
1553 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, length, mei_str);
1554 proto_item_append_text(item, "%s", mei_str);
1560 * MSISDN is defined in 3GPP TS 23.003
1561 * Editor's note: MSISDN coding will be defined in TS 24.301.
1564 dissect_gtpv2_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1566 const char *digit_str;
1568 /* Octets 5 to (n+4) represent the MSISDN value is in international number format
1569 * as described in ITU-T Rec E.164 [25] and 3GPP TS 29.002 [41].
1570 * MSISDN value contains only the actual MSISDN number (does not contain the "nature of
1571 * address indicator" octet, which indicates "international number"
1572 * as in 3GPP TS 29.002 [41]) and is encoded as TBCD digits, i.e.
1573 * digits from 0 through 9 are encoded "0000" to "1001".
1574 * When there is an odd number of digits, bits 8 to 5 of the last octet are encoded with
1575 * the filler "1111".
1577 dissect_e164_cc(tvb, tree, 0, TRUE);
1578 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1579 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1580 * allocated string will be returned.
1582 digit_str = tvb_bcd_dig_to_wmem_packet_str( tvb, 0, length, NULL, FALSE);
1584 proto_tree_add_string(tree, hf_gtpv2_address_digits, tvb, 0, length, digit_str);
1585 proto_item_append_text(item, "%s", digit_str);
1592 dissect_gtpv2_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1595 /* Octet 5 DAF DTF HI DFI OI ISRSI ISRAI SGWCI */
1596 proto_tree_add_item(tree, hf_gtpv2_daf, tvb, offset, 1, ENC_BIG_ENDIAN);
1597 proto_tree_add_item(tree, hf_gtpv2_dtf, tvb, offset, 1, ENC_BIG_ENDIAN);
1598 proto_tree_add_item(tree, hf_gtpv2_hi, tvb, offset, 1, ENC_BIG_ENDIAN);
1599 proto_tree_add_item(tree, hf_gtpv2_dfi, tvb, offset, 1, ENC_BIG_ENDIAN);
1600 proto_tree_add_item(tree, hf_gtpv2_oi, tvb, offset, 1, ENC_BIG_ENDIAN);
1601 proto_tree_add_item(tree, hf_gtpv2_isrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1602 proto_tree_add_item(tree, hf_gtpv2_israi, tvb, offset, 1, ENC_BIG_ENDIAN);
1603 proto_tree_add_item(tree, hf_gtpv2_sgwci, tvb, offset, 1, ENC_BIG_ENDIAN);
1606 proto_tree_add_text(tree, tvb, 0, length, "Older version?, should be 2 octets in 8.0.0");
1612 /* Octet 6 SQCI UIMSI CFSI CRSI P PT SI MSV
1613 * 3GPP TS 29.274 version 9.4.0 Release 9
1615 proto_tree_add_item(tree, hf_gtpv2_sqci, tvb, offset, 1, ENC_BIG_ENDIAN);
1616 proto_tree_add_item(tree, hf_gtpv2_uimsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1617 proto_tree_add_item(tree, hf_gtpv2_cfsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1618 proto_tree_add_item(tree, hf_gtpv2_crsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1620 proto_tree_add_item(tree, hf_gtpv2_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
1621 proto_tree_add_item(tree, hf_gtpv2_pt, tvb, offset, 1, ENC_BIG_ENDIAN);
1622 proto_tree_add_item(tree, hf_gtpv2_si, tvb, offset, 1, ENC_BIG_ENDIAN);
1623 proto_tree_add_item(tree, hf_gtpv2_msv, tvb, offset, 1, ENC_BIG_ENDIAN);
1629 /* Only present in version 9 and higher */
1630 /* Octet 7 Spare Spare Spare Spare Spare Spare Spare CCRSI */
1631 proto_tree_add_item(tree, hf_gtpv2_spare1, tvb, offset, 1, ENC_BIG_ENDIAN);
1632 proto_tree_add_item(tree, hf_gtpv2_spare2, tvb, offset, 1, ENC_BIG_ENDIAN);
1633 proto_tree_add_item(tree, hf_gtpv2_spare3, tvb, offset, 1, ENC_BIG_ENDIAN);
1634 proto_tree_add_item(tree, hf_gtpv2_s6af, tvb, offset, 1, ENC_BIG_ENDIAN);
1635 proto_tree_add_item(tree, hf_gtpv2_s4af, tvb, offset, 1, ENC_BIG_ENDIAN);
1636 proto_tree_add_item(tree, hf_gtpv2_mbmdt, tvb, offset, 1, ENC_BIG_ENDIAN);
1637 proto_tree_add_item(tree, hf_gtpv2_israu, tvb, offset, 1, ENC_BIG_ENDIAN);
1638 proto_tree_add_item(tree, hf_gtpv2_ccrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1644 * 8.13 Protocol Configuration Options (PCO)
1645 * Protocol Configuration Options (PCO) is transferred via GTP tunnels. The sending entity copies the value part of the
1646 * PCO into the Value field of the PCO IE. The detailed coding of the PCO field from octets 5 to (n+4) shall be specified
1647 * as per clause 10.5.6.3 of 3GPP TS 24.008 [5], starting with octet 3.
1648 * Dissected in packet-gsm_a_gm.c
1651 dissect_gtpv2_pco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1653 switch (message_type) {
1654 case GTPV2_CREATE_SESSION_REQUEST:
1655 /* PCO options as MS to network direction */
1656 pinfo->link_dir = P2P_DIR_UL;
1658 case GTPV2_CREATE_SESSION_RESPONSE:
1659 /* PCO options as Network to MS direction: */
1660 pinfo->link_dir = P2P_DIR_DL;
1665 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
1669 * 8.14 PDN Address Allocation (PAA)
1672 static const value_string gtpv2_pdn_type_vals[] = {
1680 dissect_gtpv2_paa(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1685 pdn_type = tvb_get_guint8(tvb, offset);
1686 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1692 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1696 /* If PDN type value indicates IPv6, octet 6 contains the IPv6 Prefix Length.
1697 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1698 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1699 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1701 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1703 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1707 /* If PDN type value indicates IPv4v6, octet 6 contains the IPv6 Prefix Length.
1708 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1709 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1710 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1711 * Octets 23 through 26 contain an IPv4 address. Bit 8 of octet 23 represents
1712 * the most significant bit of the IPv4 address and bit 1 of octet 26 the least
1715 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1717 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1719 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1726 * 8.15 Bearer Quality of Service (Bearer QoS)
1730 dissect_gtpv2_bearer_qos(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1733 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
1734 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
1735 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
1737 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1739 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1741 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1743 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1745 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1749 * 8.16 Flow Quality of Service (Flow QoS)
1753 dissect_gtpv2_flow_qos(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1756 proto_tree_add_item(tree, hf_gtpv2_flow_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1758 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1760 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1762 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1764 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1770 static const value_string gtpv2_rat_type_vals[] = {
1776 {5, "HSPA Evolution"},
1781 static value_string_ext gtpv2_rat_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_rat_type_vals);
1785 dissect_gtpv2_rat_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1789 rat_type = tvb_get_guint8(tvb, 0);
1790 proto_tree_add_item(tree, hf_gtpv2_rat_type, tvb, 0, 1, ENC_BIG_ENDIAN);
1791 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(rat_type, >pv2_rat_type_vals_ext, "Unknown"), rat_type);
1796 * 8.18 Serving Network
1799 dissect_gtpv2_serv_net(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
1803 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, TRUE);
1804 proto_item_append_text(item, "%s", mcc_mnc_str);
1808 * 8.19 EPS Bearer Level Traffic Flow Template (Bearer TFT)
1812 dissect_gtpv2_bearer_tft(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1814 /* The detailed coding of Traffic Aggregate
1815 * Description is specified in 3GPP TS 24.008 [5] ,
1816 * clause 10.5.6.12, beginning with octet 3..
1817 * Use the decoding in packet-gsm_a_gm.c
1819 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
1822 /* 8.20 Traffic Aggregate Description (TAD)
1825 dissect_gtpv2_tad(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1827 /* The detailed coding of Traffic Aggregate
1828 * Description is specified in 3GPP TS 24.008 [5] ,
1829 * clause 10.5.6.12, beginning with octet 3..
1830 * Use the decoding in packet-gsm_a_gm.c
1832 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
1836 * 8.21 User Location Info (ULI)
1838 * The flags ECGI, TAI, RAI, SAI and CGI in octed 5 indicate if the corresponding
1839 * fields are present in the IE or not. If one of these flags is set to "0",
1840 * the corresponding field is not present at all. The respective identities are defined in 3GPP
1842 * Editor's Note: The definition of ECGI is missing in 3GPP TS 23.003 v8.1.0.
1843 * It can be found in 3GPP TS 36.413 v8.3.0, but it is expected that it will be moved
1844 * to 23.003 in a future version.
1848 decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 instance _U_, guint flags)
1850 int offset = 1; /* flags are already dissected */
1852 proto_tree *part_tree;
1854 /* 8.21.1 CGI field */
1855 if (flags & GTPv2_ULI_CGI_MASK)
1857 proto_item_append_text(item, "CGI ");
1858 fi = proto_tree_add_text(tree, tvb, offset, 7, "Cell Global Identity (CGI)");
1859 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1860 dissect_e212_mcc_mnc(tvb, pinfo, part_tree, offset, TRUE);
1862 proto_tree_add_item(part_tree, hf_gtpv2_uli_cgi_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1864 proto_tree_add_item(part_tree, hf_gtpv2_uli_cgi_ci, tvb, offset, 2, ENC_BIG_ENDIAN);
1866 if (offset == length)
1870 /* 8.21.2 SAI field */
1871 if (flags & GTPv2_ULI_SAI_MASK)
1873 proto_item_append_text(item, "SAI ");
1874 fi = proto_tree_add_text(tree, tvb, offset, 7, "Service Area Identity (SAI)");
1875 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1876 dissect_e212_mcc_mnc(tvb, pinfo, part_tree, offset, TRUE);
1878 proto_tree_add_item(part_tree, hf_gtpv2_uli_sai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1880 proto_tree_add_item(part_tree, hf_gtpv2_uli_sai_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
1882 if (offset == length)
1885 /* 8.21.3 RAI field */
1886 if (flags & GTPv2_ULI_RAI_MASK)
1888 proto_item_append_text(item, "RAI ");
1889 fi = proto_tree_add_text(tree, tvb, offset, 7, "Routeing Area Identity (RAI)");
1890 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1891 dissect_e212_mcc_mnc(tvb, pinfo, part_tree, offset, TRUE);
1893 proto_tree_add_item(part_tree, hf_gtpv2_uli_rai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1895 proto_tree_add_item(part_tree, hf_gtpv2_uli_rai_rac, tvb, offset, 2, ENC_BIG_ENDIAN);
1897 if (offset == length)
1900 /* 8.21.4 TAI field */
1901 if (flags & GTPv2_ULI_TAI_MASK)
1903 proto_item_append_text(item, "TAI ");
1904 fi = proto_tree_add_text(tree, tvb, offset, 5, "Tracking Area Identity (TAI)");
1905 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1906 dissect_e212_mcc_mnc(tvb, pinfo, part_tree, offset, TRUE);
1908 proto_tree_add_item(part_tree, hf_gtpv2_uli_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
1910 if (offset == length)
1913 /* 8.21.5 ECGI field */
1914 if (flags & GTPv2_ULI_ECGI_MASK)
1921 proto_item_append_text(item, "ECGI ");
1922 fi = proto_tree_add_text(tree, tvb, offset, 7, "E-UTRAN Cell Global Identifier (ECGI)");
1923 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1924 dissect_e212_mcc_mnc(tvb, pinfo, part_tree, offset, TRUE);
1926 /* The bits 8 through 5, of octet e+3 (Fig 8.21.5-1 in TS 29.274 V8.2.0) are spare
1927 * and hence they would not make any difference to the hex string following it,
1928 * thus we directly read 4 bytes from the tvb
1931 octet = tvb_get_guint8(tvb, offset);
1932 spare = octet & 0xF0;
1933 octet4 = tvb_get_ntohl(tvb, offset);
1934 ECGI = octet4 & 0x0FFFFFFF;
1935 proto_tree_add_uint(part_tree, hf_gtpv2_uli_ecgi_eci_spare, tvb, offset, 1, spare);
1936 /* The coding of the E-UTRAN cell identifier is the responsibility of each administration.
1937 * Coding using full hexadecimal representation shall be used.
1939 proto_tree_add_uint(part_tree, hf_gtpv2_uli_ecgi_eci, tvb, offset, 4, ECGI);
1940 /*proto_tree_add_item(tree, hf_gtpv2_uli_ecgi_eci, tvb, offset, 4, ENC_BIG_ENDIAN);*/
1942 if (offset == length)
1946 /* 8.21.6 LAI field */
1947 if (flags & GTPv2_ULI_LAI_MASK)
1949 proto_item_append_text(item, "LAI ");
1950 fi = proto_tree_add_text(tree, tvb, offset, 5, "LAI (Location Area Identifier)");
1951 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1952 dissect_e212_mcc_mnc(tvb, pinfo, part_tree, offset, TRUE);
1955 /* The Location Area Code (LAC) consists of 2 octets. Bit 8 of Octet f+3 is the most significant bit
1956 * and bit 1 of Octet f+4 the least significant bit. The coding of the location area code is the
1957 * responsibility of each administration. Coding using full hexadecimal representation shall be used.
1959 proto_tree_add_item(part_tree, hf_gtpv2_uli_lai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1966 dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1968 proto_item *flags_item;
1969 proto_tree *flag_tree;
1973 flags_item = proto_tree_add_text(tree, tvb, offset, 1, "Flags");
1974 flag_tree = proto_item_add_subtree(flags_item, ett_gtpv2_uli_flags);
1975 flags = tvb_get_guint8(tvb, offset) & 0x3f;
1976 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset >> 3, 2, ENC_BIG_ENDIAN);
1979 proto_tree_add_item(flag_tree, hf_gtpv2_uli_lai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1981 proto_tree_add_item(flag_tree, hf_gtpv2_uli_ecgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1983 proto_tree_add_item(flag_tree, hf_gtpv2_uli_tai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1985 proto_tree_add_item(flag_tree, hf_gtpv2_uli_rai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1987 proto_tree_add_item(flag_tree, hf_gtpv2_uli_sai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1989 proto_tree_add_item(flag_tree, hf_gtpv2_uli_cgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
1991 decode_gtpv2_uli(tvb, pinfo, tree, item, length, instance, flags);
1996 /* Diameter 3GPP AVP Code: 22 3GPP-User-Location-Info */
1999 * 16.4.7.2 Coding 3GPP Vendor-Specific RADIUS attributes
2001 * For P-GW, the Geographic Location Type values and coding are defined as follows:
2006 * 3-127 Spare for future use
2010 * 131-255 Spare for future use
2014 static const value_string geographic_location_type_vals[] = {
2020 {130, "TAI and ECGI"},
2025 dissect_diameter_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
2031 length = tvb_length(tvb);
2032 flags_3gpp = tvb_get_guint8(tvb, offset);
2034 proto_tree_add_item(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN);
2040 flags = GTPv2_ULI_CGI_MASK;
2044 flags = GTPv2_ULI_SAI_MASK;
2048 flags = GTPv2_ULI_RAI_MASK;
2052 flags = GTPv2_ULI_TAI_MASK;
2056 flags = GTPv2_ULI_ECGI_MASK;
2060 flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_ECGI_MASK;
2063 proto_tree_add_text(tree, tvb, 1, -1, "Geographic Location");
2067 decode_gtpv2_uli(tvb, pinfo, tree, NULL, length, 0, flags);
2072 * 8.22 Fully Qualified TEID (F-TEID)
2074 static const value_string gtpv2_f_teid_interface_type_vals[] = {
2075 { 0, "S1-U eNodeB GTP-U interface"},
2076 { 1, "S1-U SGW GTP-U interface"},
2077 { 2, "S12 RNC GTP-U interface"},
2078 { 3, "S12 SGW GTP-U interface"},
2079 { 4, "S5/S8 SGW GTP-U interface"},
2080 { 5, "S5/S8 PGW GTP-U interface"},
2081 { 6, "S5/S8 SGW GTP-C interface"},
2082 { 7, "S5/S8 PGW GTP-C interface"},
2083 { 8, "S5/S8 SGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2084 "and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6)"}, */
2085 { 9, "S5/S8 PGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2086 "and the control plane and user plane addresses are the same for PMIPv6)"}, */
2087 {10, "S11 MME GTP-C interface"},
2088 {11, "S11/S4 SGW GTP-C interface"},
2089 {12, "S10 MME GTP-C interface"},
2090 {13, "S3 MME GTP-C interface"},
2091 {14, "S3 SGSN GTP-C interface"},
2092 {15, "S4 SGSN GTP-U interface"},
2093 {16, "S4 SGW GTP-U interface"},
2094 {17, "S4 SGSN GTP-C interface"},
2095 {18, "S16 SGSN GTP-C interface"},
2096 {19, "eNodeB GTP-U interface for DL data forwarding"},
2097 {20, "eNodeB GTP-U interface for UL data forwarding"},
2098 {21, "RNC GTP-U interface for data forwarding"},
2099 {22, "SGSN GTP-U interface for data forwarding"},
2100 {23, "SGW GTP-U interface for data forwarding"},
2101 {24, "Sm MBMS GW GTP-C interface"},
2102 {25, "Sn MBMS GW GTP-C interface"},
2103 {26, "Sm MME GTP-C interface"},
2104 {27, "Sn SGSN GTP-C interface"},
2105 {28, "SGW GTP-U interface for UL data forwarding"},
2106 {29, "Sn SGSN GTP-U interface"},
2107 {30, "S2b ePDG GTP-C interface"},
2108 {31, "S2b-U ePDG GTP-U interface"},
2109 {32, "S2b PGW GTP-C interface"},
2110 {33, "S2b-U PGW GTP-U interface"},
2111 {34, "S2a TWAN GTP-U interface"},
2112 {35, "S2a TWAN GTP-C interface"},
2113 {36, "S2a PGW GTP-C interface"},
2114 {37, "S2a PGW GTP-U interface"},
2117 static value_string_ext gtpv2_f_teid_interface_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_f_teid_interface_type_vals);
2119 static const true_false_string gtpv2_f_teid_v4_vals = {
2120 "IPv4 address present",
2121 "IPv4 address not present",
2124 static const true_false_string gtpv2_f_teid_v6_vals = {
2125 "IPv6 address present",
2126 "IPv6 address not present",
2130 dissect_gtpv2_f_teid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
2135 flags = tvb_get_guint8(tvb, offset);
2136 proto_tree_add_item(tree, hf_gtpv2_f_teid_v4, tvb, offset, 1, ENC_BIG_ENDIAN);
2137 proto_tree_add_item(tree, hf_gtpv2_f_teid_v6, tvb, offset, 1, ENC_BIG_ENDIAN);
2138 /* NOTE: "Interface type" IE is defined with 5 bits only in the earlier releases of this specification,
2139 * thus pre-Rel-10 GTPv2-C nodes can ignore bit "6" which is marked as "Spare" in earlier releases,
2140 * allowing backward compatibility.
2142 proto_tree_add_item(tree, hf_gtpv2_f_teid_interface_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2145 proto_tree_add_item(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2146 proto_item_append_text(item, "%s, TEID/GRE Key: 0x%s",
2147 val_to_str_ext_const((flags & 0x3f), >pv2_f_teid_interface_type_vals_ext, "Unknown"),
2148 tvb_bytes_to_ep_str(tvb, offset, 4));
2153 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
2154 proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(tvb, offset));
2159 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, ENC_NA);
2160 proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(tvb, offset));
2167 dissect_gtpv2_tmsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2169 proto_tree_add_item(tree, hf_gtpv2_tmsi, tvb, 0, 4, ENC_BIG_ENDIAN);
2170 proto_tree_add_text(item, tvb, 0, length, "TMSI: %s", tvb_bytes_to_ep_str(tvb, 0, 4));
2175 * 12.3 CN Identifier
2177 * A CN node is uniquely identified within a PLMN by its CN Identifier (CN-Id). The CN-Id together with the PLMN
2178 * identifier globally identifies the CN node. The CN-Id together with the PLMN-Id is used as the CN node identifier in
2179 * RANAP signalling over the Iu interface.
2180 * Global CN-Id = PLMN-Id || CN-Id
2181 * The CN-Id is defined by the operator, and set in the nodes via O&M.
2182 * For the syntax description and the use of this identifier in RANAP signalling, see 3GPP TS 25.413 [17].
2186 dissect_gtpv2_g_cn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
2190 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
2193 /* >CN-ID M INTEGER (0..4095) */
2194 proto_tree_add_text(tree, tvb, offset, 2, "CN-Id: %s",
2195 tvb_bytes_to_ep_str(tvb, offset, 2));
2198 * 8.25 S103 PDN Data Forwarding Info (S103PDF)
2201 dissect_gtpv2_s103pdf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2206 /* The HSGW Address and GRE Key identify a GRE Tunnel towards a HSGW over S103 interface for a specific PDN
2207 * connection of the UE. The EPS Bearer IDs specify the EPS Bearers which require data forwarding that belonging to this
2208 * PDN connection. The number of EPS bearer Ids included is specified by the value of EPS Bearer ID Number.
2210 /* Octet 5 HSGW Address for forwarding Length = m */
2211 m = tvb_get_guint8(tvb, offset);
2212 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_f_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2215 /* 6 to (m+5) HSGW Address for forwarding [4..16] */
2219 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2224 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2229 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2230 "Wrong length %u, should be 4 or 16", m);
2234 /* (m+6)- to (m+9) GRE Key */
2235 proto_tree_add_item(tree, hf_gtpv2_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2238 /* (m+10) EPS Bearer ID Number = k */
2239 k = tvb_get_guint8(tvb, offset);
2240 proto_tree_add_text(tree, tvb, offset, 1, "EPS Bearer ID Number = %d", k);
2243 /* (m+11) to (m+10+k)
2244 * Spare EPS Bearer ID
2246 for ( i = 0; i < k; i++ ) {
2247 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2248 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2254 * 8.26 S1-U Data Forwarding (S1UDF)
2257 dissect_gtpv2_s1udf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2262 /* 5 Spare EPS Bearer ID */
2263 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2264 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2266 /* 6 Serving GW Address Length = m */
2267 m = tvb_get_guint8(tvb, offset);
2268 proto_tree_add_text(tree, tvb, offset, 1, "Serving GW Address Length = %u", m);
2270 /* 7 to (m+6) Serving GW Address [4..16] */
2274 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2279 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2284 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2285 "Wrong length %u, should be 4 or 16", m);
2290 * Serving GW S1-U TEID
2292 proto_tree_add_item(tree, hf_gtpv2_sgw_s1u_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
2300 dissect_gtpv2_delay_value(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
2304 proto_tree_add_item(tree, hf_gtpv2_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2308 * 8.28 Bearer Context (grouped IE)
2312 dissect_gtpv2_bearer_ctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
2316 proto_tree *grouped_tree;
2318 proto_item_append_text(item, "[Grouped IE]");
2319 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_bearer_ctx);
2321 new_tvb = tvb_new_subset(tvb, offset, length, length );
2322 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type);
2325 /* 8.29 Charging ID */
2327 dissect_gtpv2_charging_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2331 proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, ENC_BIG_ENDIAN);
2335 /* 8.30 Charging Characteristics
2336 * The charging characteristics information element is defined in 3GPP TS 32.251 [8]
2337 * and is a way of informing both the SGW and PGW of the rules for producing charging
2338 * information based on operator configured triggers. For the encoding of this
2339 * information element see 3GPP TS 32.298 [9].
2342 dissect_gtpv2_char_char(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2346 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, 2, ENC_BIG_ENDIAN);
2349 /* These octet(s) is/are present only if explicitly specified */
2350 proto_tree_add_text(tree, tvb, offset, length-2, "Remaining octets");
2359 dissect_gtpv2_bearer_flag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2364 /* Octet 5 Spare VB PPC */
2365 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_ppc, tvb, offset, length, ENC_BIG_ENDIAN);
2366 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_vb, tvb, offset, length, ENC_BIG_ENDIAN);
2373 dissect_gtpv2_pdn_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2380 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2381 "Wrong length indicated. Expected 1, got %u", length);
2385 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
2386 pdn = tvb_get_guint8(tvb, offset)& 0x7;
2387 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, ENC_BIG_ENDIAN);
2388 proto_item_append_text(item, "%s", val_to_str_const(pdn, gtpv2_pdn_type_vals, "Unknown"));
2393 * 8.31 Trace Information
2396 dissect_gtpv2_tra_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2398 proto_item *trigg, *msc_server, *mgw, *sgsn, *ggsn, *bm_sc, *sgw_mme, *ne_types;
2399 proto_tree *trigg_tree, *msc_server_tree, *mgw_tree, *sgsn_tree, *ggsn_tree;
2400 proto_tree *bm_sc_tree, *sgw_mme_tree, *ne_types_tree;
2401 proto_item *interfaces, *imsc_server, *lmgw, *lsgsn, *lggsn, *lrnc, *lbm_sc, *lmme, *lsgw, *lpdn_gw, *lenb;
2402 proto_tree *interfaces_tree, *imsc_server_tree, *lmgw_tree, *lsgsn_tree, *lggsn_tree, *lrnc_tree;
2403 proto_tree *lbm_sc_tree, *lmme_tree, *lsgw_tree, *lpdn_gw_tree, *lenb_tree;
2407 guint8 *trace_id = NULL;
2413 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
2416 /* Append Trace ID to main tree */
2417 tid = tvb_get_ntohs(tvb, offset);
2418 proto_item_append_text(item, "Trace ID: %d ", tid);
2421 /*--------------------------------------------------
2422 * trace_id = tvb_format_text(tvb, offset, 2);
2423 * proto_tree_add_string(tree, hf_gtpv2_tra_info, tvb, offset, length, trace_id);
2424 *--------------------------------------------------*/
2425 proto_tree_add_text(tree, tvb, offset, 3, "Trace ID: %d", tid);
2428 /* Triggering Events, put all into a new tree called trigging_tree */
2429 trigg = proto_tree_add_text(tree, tvb, offset, 8, "Trigging Events");
2430 trigg_tree = proto_item_add_subtree(trigg, ett_gtpv2_tra_info_trigg);
2432 /* Create all subtrees */
2433 msc_server = proto_tree_add_text(trigg_tree, tvb, offset, 2, "MSC Server");
2434 msc_server_tree = proto_item_add_subtree(msc_server, ett_gtpv2_tra_info_trigg_msc_server);
2436 mgw = proto_tree_add_text(trigg_tree, tvb, offset + 2, 1, "MGW");
2437 mgw_tree = proto_item_add_subtree(mgw, ett_gtpv2_tra_info_trigg_mgw);
2439 sgsn = proto_tree_add_text(trigg_tree, tvb, offset + 3, 2, "SGSN");
2440 sgsn_tree = proto_item_add_subtree(sgsn, ett_gtpv2_tra_info_trigg_sgsn);
2442 ggsn = proto_tree_add_text(trigg_tree, tvb, offset + 5, 1, "GGSN");
2443 ggsn_tree = proto_item_add_subtree(ggsn, ett_gtpv2_tra_info_trigg_ggsn);
2445 bm_sc = proto_tree_add_text(trigg_tree, tvb, offset + 6, 1, "BM-SC");
2446 bm_sc_tree = proto_item_add_subtree(bm_sc, ett_gtpv2_tra_info_trigg_bm_sc);
2448 sgw_mme = proto_tree_add_text(trigg_tree, tvb, offset + 7, 1, "SGW MME");
2449 sgw_mme_tree = proto_item_add_subtree(sgw_mme, ett_gtpv2_tra_info_trigg_sgw_mme);
2451 /* MSC Server - 2 octets */
2452 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_calls, tvb, offset, 1, ENC_BIG_ENDIAN);
2453 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2454 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_lu_imsi_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2455 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_handovers, tvb, offset, 1, ENC_BIG_ENDIAN);
2456 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2457 bit_offset = offset << 3;
2458 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2460 bit_offset = offset << 3;
2461 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2465 proto_tree_add_item(mgw_tree, hf_gtpv2_tra_info_mgw_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2466 bit_offset = offset << 3;
2467 proto_tree_add_bits_item(mgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2469 /* SGSN - 2 octets */
2470 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_pdp_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2471 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2472 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_rau_gprs_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2473 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2474 bit_offset = offset << 3;
2475 proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2477 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2478 bit_offset = offset << 3;
2479 proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_reserved, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2481 /* GGSN - 1 octet */
2482 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_pdp, tvb, offset, 1, ENC_BIG_ENDIAN);
2483 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2484 bit_offset = offset << 3;
2485 proto_tree_add_bits_item(ggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2487 /* BM-SC - 1 octet */
2488 proto_tree_add_item(bm_sc_tree, hf_gtpv2_tra_info_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2489 bit_offset = offset << 3;
2490 proto_tree_add_bits_item(bm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2492 /* MME/SGW - 1 octet */
2493 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2494 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_sr, tvb, offset, 1, ENC_BIG_ENDIAN);
2495 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_iataud, tvb, offset, 1, ENC_BIG_ENDIAN);
2496 bit_offset = offset << 3;
2497 proto_tree_add_bits_item(sgw_mme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2500 /* Create NE Types subtree */
2501 ne_types = proto_tree_add_text(tree, tvb, offset, 2, "List of NE Types");
2502 ne_types_tree = proto_item_add_subtree(ne_types, ett_gtpv2_tra_info_ne_types);
2505 /* List of NE Types */
2506 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_msc_s, tvb, offset, 1, ENC_BIG_ENDIAN);
2507 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2508 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2509 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_ggsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2510 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_rnc, tvb, offset, 1, ENC_BIG_ENDIAN);
2511 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2512 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2513 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2515 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_pdn_gw, tvb, offset, 1, ENC_BIG_ENDIAN);
2516 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_enb, tvb, offset, 1, ENC_BIG_ENDIAN);
2517 bit_offset = offset << 3;
2518 proto_tree_add_bits_item(ne_types_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2521 /* Trace Depth Length */
2522 tdl = tvb_get_guint8(tvb, offset);
2523 proto_tree_add_item(tree, hf_gtpv2_tra_info_tdl, tvb, offset, 1, ENC_BIG_ENDIAN);
2527 * Will be displayed if length of Trace Depth Length is > 0
2528 * The list will only contains UTF8String, RAW DATA
2530 proto_tree_add_text(tree, tvb, offset, tdl, "Trace Depth List: %s", tvb_bytes_to_ep_str(tvb, offset, tdl));
2533 /* Set up subtree interfaces and put all interfaces under it */
2534 interfaces = proto_tree_add_text(tree, tvb, offset, 12, "List of Interfaces");
2535 interfaces_tree = proto_item_add_subtree(interfaces, ett_gtpv2_tra_info_interfaces);
2537 /* Create all subtrees */
2538 imsc_server = proto_tree_add_text(interfaces_tree, tvb, offset, 2, "MSC Server");
2539 imsc_server_tree = proto_item_add_subtree(imsc_server, ett_gtpv2_tra_info_interfaces_imsc_server);
2541 lmgw = proto_tree_add_text(interfaces_tree, tvb, offset + 2, 1, "MGW");
2542 lmgw_tree = proto_item_add_subtree(lmgw, ett_gtpv2_tra_info_interfaces_lmgw);
2544 lsgsn = proto_tree_add_text(interfaces_tree, tvb, offset + 3, 2, "SGSN");
2545 lsgsn_tree = proto_item_add_subtree(lsgsn, ett_gtpv2_tra_info_interfaces_lsgsn);
2547 lggsn = proto_tree_add_text(interfaces_tree, tvb, offset + 5, 1, "GGSN");
2548 lggsn_tree = proto_item_add_subtree(lggsn, ett_gtpv2_tra_info_interfaces_lggsn);
2550 lrnc = proto_tree_add_text(interfaces_tree, tvb, offset + 6, 1, "RNC");
2551 lrnc_tree = proto_item_add_subtree(lrnc, ett_gtpv2_tra_info_interfaces_lrnc);
2553 lbm_sc = proto_tree_add_text(interfaces_tree, tvb, offset + 7, 1, "BM-SC");
2554 lbm_sc_tree = proto_item_add_subtree(lbm_sc, ett_gtpv2_tra_info_interfaces_lbm_sc);
2556 lmme = proto_tree_add_text(interfaces_tree, tvb, offset + 8, 1, "MME");
2557 lmme_tree = proto_item_add_subtree(lmme, ett_gtpv2_tra_info_interfaces_lmme);
2559 lsgw = proto_tree_add_text(interfaces_tree, tvb, offset + 9, 1, "SGW");
2560 lsgw_tree = proto_item_add_subtree(lsgw, ett_gtpv2_tra_info_interfaces_lsgw);
2562 lpdn_gw = proto_tree_add_text(interfaces_tree, tvb, offset + 10, 1, "PDN GW");
2563 lpdn_gw_tree = proto_item_add_subtree(lpdn_gw, ett_gtpv2_tra_info_interfaces_lpdn_gw);
2565 lenb = proto_tree_add_text(interfaces_tree, tvb, offset + 11, 1, "eNB");
2566 lenb_tree = proto_item_add_subtree(lenb, ett_gtpv2_tra_info_interfaces_lpdn_lenb);
2568 /* MSC Server - 2 octests */
2569 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_a, tvb, offset, 1, ENC_BIG_ENDIAN);
2570 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2571 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2572 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_g, tvb, offset, 1, ENC_BIG_ENDIAN);
2573 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_b, tvb, offset, 1, ENC_BIG_ENDIAN);
2574 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_e, tvb, offset, 1, ENC_BIG_ENDIAN);
2575 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_f, tvb, offset, 1, ENC_BIG_ENDIAN);
2576 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_cap, tvb, offset, 1, ENC_BIG_ENDIAN);
2578 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_d, tvb, offset, 1, ENC_BIG_ENDIAN);
2579 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_c, tvb, offset, 1, ENC_BIG_ENDIAN);
2580 bit_offset = offset << 3;
2581 proto_tree_add_bits_item(imsc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2584 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2585 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_nb_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2586 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_lu_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2587 bit_offset = offset << 3;
2588 proto_tree_add_bits_item(lmgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2590 /* SGSN - 2 octets */
2591 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gb, tvb, offset, 1, ENC_BIG_ENDIAN);
2592 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2593 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2594 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gr, tvb, offset, 1, ENC_BIG_ENDIAN);
2595 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gd, tvb, offset, 1, ENC_BIG_ENDIAN);
2596 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gf, tvb, offset, 1, ENC_BIG_ENDIAN);
2597 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gs, tvb, offset, 1, ENC_BIG_ENDIAN);
2598 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_ge, tvb, offset, 1, ENC_BIG_ENDIAN);
2600 bit_offset = offset << 3;
2601 proto_tree_add_bits_item(lsgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2604 /* GGSN - 1 octet */
2605 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2606 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gi, tvb, offset, 1, ENC_BIG_ENDIAN);
2607 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2608 bit_offset = offset << 3;
2609 proto_tree_add_bits_item(lggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2612 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2613 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lur, tvb, offset, 1, ENC_BIG_ENDIAN);
2614 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lub, tvb, offset, 1, ENC_BIG_ENDIAN);
2615 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2616 bit_offset = offset << 3;
2617 proto_tree_add_bits_item(lrnc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2619 /* BM_SC - 1 octet */
2620 proto_tree_add_item(lbm_sc_tree, hf_gtpv2_tra_info_lbm_sc_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2621 bit_offset = offset << 3;
2622 proto_tree_add_bits_item(lbm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2625 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2626 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s3, tvb, offset, 1, ENC_BIG_ENDIAN);
2627 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s6a, tvb, offset, 1, ENC_BIG_ENDIAN);
2628 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s10, tvb, offset, 1, ENC_BIG_ENDIAN);
2629 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2630 bit_offset = offset << 3;
2631 proto_tree_add_bits_item(lmme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2634 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s4, tvb, offset, 1, ENC_BIG_ENDIAN);
2635 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2636 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2637 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2638 bit_offset = offset << 3;
2639 proto_tree_add_bits_item(lsgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2641 /* PDN GW - 1 octet */
2642 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2a, tvb, offset, 1, ENC_BIG_ENDIAN);
2643 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2b, tvb, offset, 1, ENC_BIG_ENDIAN);
2644 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2c, tvb, offset, 1, ENC_BIG_ENDIAN);
2645 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2646 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s6c, tvb, offset, 1, ENC_BIG_ENDIAN);
2647 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_gx, tvb, offset, 1, ENC_BIG_ENDIAN);
2648 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2649 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_sgi, tvb, offset, 1, ENC_BIG_ENDIAN);
2652 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2653 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_x2, tvb, offset, 1, ENC_BIG_ENDIAN);
2654 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2655 bit_offset = offset << 3;
2656 proto_tree_add_bits_item(lenb_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2658 /*--------------------------------------------------
2660 *--------------------------------------------------*/
2662 /* IP Address of Trace Collection Entity */
2663 while ( (offset + 4) <= length ) {
2665 proto_tree_add_item(tree, hf_gtpv2_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
2672 * 8.33 Void (TS 129 274 V9.4.0 (2010-10))
2675 /* 8.35 Procedure Transaction ID (PTI) */
2677 dissect_gtpv2_pti(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
2679 proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, ENC_BIG_ENDIAN);
2682 * 8.36 DRX Parameter
2685 dissect_gtpv2_drx_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2689 /* 36.413 : 9.2.1.17 Paging Cause, void */
2690 proto_tree_add_text(tree, tvb, offset, length, "DRX parameter: %s", tvb_bytes_to_ep_str(tvb, offset, (length )));
2694 * 8.37 UE Network Capability
2695 * UE Network Capability is coded as depicted in Figure 8.37-1. Actual coding of the UE Network Capability field is
2696 * defined in 3GPP TS 24.301
2699 dissect_gtpv2_ue_net_capability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2701 de_emm_ue_net_cap(tvb, tree, pinfo, 0, length, NULL, 0);
2707 static const value_string gtpv2_mm_context_security_mode[] = {
2708 {0, "GSM Key and Triplets"},
2709 {1, "UMTS Key, Used Cipher and Quintuplets"},
2710 {2, "GSM Key, Used Cipher and Quintuplets"},
2711 {3, "UMTS Key and Quintuplets"},
2712 {4, "EPS Security Context, Quadruplets and Quintuplets" },
2713 {5, "UMTS Key, Quadruplets and Quintuplets"},
2717 static const true_false_string gtpv2_nhi_vals = {
2718 "NH (Next Hop) and NCC (Next Hop Chaining Count) are both present",
2719 "NH (Next Hop) and NCC (Next Hop Chaining Count) not present",
2722 /* Table 8.38-2: Used NAS Cipher Values */
2724 static const value_string gtpv2_mm_context_unc_vals[] = {
2725 {0, "No ciphering"},
2736 /* Table 8.38-3: Used Cipher Values */
2737 static const value_string gtpv2_mm_context_used_cipher_vals[] = {
2738 {0, "No ciphering"},
2749 /* Table 8.38-4: Used NAS integrity protection algorithm Values */
2750 static const value_string gtpv2_mm_context_unipa_vals[] = {
2751 {0, "No ciphering"},
2762 /* Helper functions */
2764 /* Figure 8.38-7: Authentication Triplet */
2766 dissect_gtpv2_authentication_triplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 num_triplet)
2768 proto_item *auth_tri_item;
2769 proto_tree *auth_tri_tree;
2772 for (i = 0; i < num_triplet; i++) {
2773 auth_tri_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Triplet %u", i);
2774 auth_tri_tree = proto_item_add_subtree(auth_tri_item, ett_gtpv2_mm_context_auth_tri);
2776 * Figure 8.38-8: Authentication Quintuplet
2781 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
2783 proto_tree_add_text(auth_tri_tree, tvb, offset, 4, "SRES': %s", tvb_bytes_to_ep_str(tvb, offset, 4));
2785 proto_tree_add_text(auth_tri_tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
2794 dissect_gtpv2_authentication_quintuplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
2796 proto_item *auth_qui_item;
2797 proto_tree *auth_qui_tree;
2799 guint8 xres_len, autn_len;
2801 for (i = 0; i < nr_qui; i++) {
2802 auth_qui_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quintuplet %u", i);
2803 auth_qui_tree = proto_item_add_subtree(auth_qui_item, ett_gtpv2_mm_context_auth_qui);
2805 * Figure 8.38-8: Authentication Quintuplet
2809 * (m+1) to (m+16) CK
2810 * (m+17) to (m+32) IK
2814 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
2816 xres_len = tvb_get_guint8(tvb, offset);
2817 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2819 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres, tvb, offset, xres_len, ENC_BIG_ENDIAN);
2821 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ck, tvb, offset, 16, ENC_BIG_ENDIAN);
2823 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ik, tvb, offset, 16, ENC_BIG_ENDIAN);
2825 autn_len = tvb_get_guint8(tvb, offset);
2826 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2828 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn, tvb, offset, autn_len, ENC_BIG_ENDIAN);
2837 dissect_gtpv2_authentication_quadruplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
2839 proto_item *auth_qua_item;
2840 proto_tree *auth_qua_tree;
2844 for (i = 0; i < nr_qui; i++) {
2845 auth_qua_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quadruplet");
2846 auth_qua_tree = proto_item_add_subtree(auth_qua_item, ett_gtpv2_mm_context_auth_qua);
2848 proto_tree_add_text(auth_qua_tree, tvb, offset, 16, "RAND: %s",
2849 tvb_bytes_to_ep_str(tvb, offset, 16));
2852 tmp = tvb_get_guint8(tvb, offset++);
2854 proto_tree_add_text(auth_qua_tree, tvb, offset, tmp, "XRES: %s",
2855 tvb_bytes_to_ep_str(tvb, offset, tmp));
2858 tmp = tvb_get_guint8(tvb, offset++);
2860 proto_tree_add_text(auth_qua_tree, tvb, offset, tmp, "AUTN: %s",
2861 tvb_bytes_to_ep_str(tvb, offset, tmp));
2864 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_BIG_ENDIAN);
2871 static const value_string gtpv2_mm_context_higher_br_16mb_flg_vals[] = {
2878 dissect_gtpv2_mm_context_common_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint8 samb_ri, guint8 uamb_ri)
2880 proto_item *net_cap_item, *msnt_cap_item;
2881 proto_tree *net_cap_tree, *msnt_cap_tree;
2882 guint8 ue_net_cap_len, ms_net_cap_len, mei_len;
2885 * If SAMBRI (Subscribed UE AMBR Indicator), bit 1 of octet 6, is set to "1",
2886 * then the Uplink/downlink Subscribed UE AMBR parameter field is present,
2889 /* j to (j+3) Uplink Subscribed UE AMBR */
2890 proto_tree_add_text(tree, tvb, offset, 4, "Uplink Subscribed UE AMBR: %d Kbps",
2891 tvb_get_ntohl(tvb, offset));
2894 /* (j+4) to (j+7) Downlink Subscribed UE AMBR */
2895 proto_tree_add_text(tree, tvb, offset, 4, "Downlink Subscribed UE AMBR: %d Kbps",
2896 tvb_get_ntohl(tvb, offset));
2901 * If UAMBRI (Used UE AMBR Indicator), bit 2 of octet 6, is set to "1",
2902 * then the Uplink/downlink Used UE AMBR parameter field is present
2905 /* i to (i+3) Uplink Used UE AMBR */
2906 proto_tree_add_text(tree, tvb, offset, 4, "Uplink Used UE AMBR: %d Kbps",
2907 tvb_get_ntohl(tvb, offset));
2910 /* (i+4) to (i+7) Downlink Used UE AMBR */
2911 proto_tree_add_text(tree, tvb, offset, 4, "Downlink Used UE AMBR: %d Kbps",
2912 tvb_get_ntohl(tvb, offset));
2916 /* q Length of UE Network Capability */
2917 ue_net_cap_len = tvb_get_guint8(tvb, offset);
2918 proto_tree_add_item(tree, hf_gtpv2_mm_context_ue_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2920 /* (q+1) to k UE Network Capability */
2921 if (ue_net_cap_len) {
2922 /* The UE Network Capability coding is specified in clause 9.9.3.34 of 3GPP TS 24.301 [23].
2923 * If Length of UE Network Capability is zero, then the UE Network Capability parameter
2924 * shall not be present.
2926 net_cap_item = proto_tree_add_text(tree, tvb, offset, ue_net_cap_len, "UE Network Capability");
2927 net_cap_tree = proto_item_add_subtree(net_cap_item, ett_gtpv2_mm_context_net_cap);
2928 offset += de_emm_ue_net_cap(tvb, net_cap_tree, pinfo, offset, ue_net_cap_len, NULL, 0);
2930 /* k+1 Length of MS Network Capability */
2931 ms_net_cap_len = tvb_get_guint8(tvb, offset);
2932 proto_tree_add_item(tree, hf_gtpv2_mm_context_ms_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2934 /* (k+2) to m MS Network Capability
2935 * The MS Network Capability coding is specified in clause 10.5.5.12 of 3GPP TS 24.008 [5].
2936 * If Length of MS Network Capability is zero, then the MS Network Capability parameter shall not be present.
2938 if (ms_net_cap_len) {
2939 msnt_cap_item = proto_tree_add_text(tree, tvb, offset, ms_net_cap_len, "MS network capability");
2940 msnt_cap_tree = proto_item_add_subtree(msnt_cap_item, ett_gtpv2_ms_network_capability);
2941 offset += de_gmm_ms_net_cap(tvb, msnt_cap_tree, pinfo, offset, ms_net_cap_len, NULL, 0);
2943 /* m+1 Length of Mobile Equipment Identity (MEI) */
2944 mei_len = tvb_get_guint8(tvb, offset);
2945 proto_tree_add_item(tree, hf_gtpv2_mm_context_mei_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2947 /* (m+2) to r Mobile Equipment Identity (MEI) */
2949 const gchar *mei_str;
2951 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, mei_len, NULL, FALSE);
2952 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, mei_len, mei_str);
2959 dissect_gtpv2_access_restriction_data(tvbuff_t *tvb, proto_tree *tree, int offset)
2961 proto_item *accrstdata_item;
2962 proto_tree *accrstdata_tree;
2964 accrstdata_item = proto_tree_add_text(tree, tvb, offset, 1, "Access restriction data");
2965 accrstdata_tree = proto_item_add_subtree(accrstdata_item, ett_gtpv2_access_rest_data);
2966 /* Spare HNNA ENA INA GANA GENA UNA */
2967 proto_tree_add_bits_item(accrstdata_tree, hf_gtpv2_spare_bits, tvb, (offset << 3), 2, ENC_BIG_ENDIAN);
2968 proto_tree_add_item(accrstdata_tree, hf_gtpv2_hnna, tvb, offset, 1, ENC_BIG_ENDIAN);
2969 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ena, tvb, offset, 1, ENC_BIG_ENDIAN);
2970 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ina, tvb, offset, 1, ENC_BIG_ENDIAN);
2971 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gana, tvb, offset, 1, ENC_BIG_ENDIAN);
2972 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gena, tvb, offset, 1, ENC_BIG_ENDIAN);
2973 proto_tree_add_item(accrstdata_tree, hf_gtpv2_una, tvb, offset, 1, ENC_BIG_ENDIAN);
2979 /* Type = 103 (decimal)
2980 * Figure 8.38-1: GSM Key and Triplets
2983 dissect_gtpv2_mm_context_gsm_t(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
2986 proto_tree *flag_tree;
2988 guint8 oct, drxi, num_triplet, uamb_ri, samb_ri;
2991 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
2992 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
2995 /* Security Mode | Spare | DRXI | CKSN */
2996 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
2997 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
2998 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
2999 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3000 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
3003 /* Number of Triplet | Spare | UAMB RI | SAMB RI */
3004 oct = tvb_get_guint8(tvb, offset);
3005 num_triplet = oct >> 5;
3006 uamb_ri = (oct & 0x02) >> 1;
3007 samb_ri = oct & 0x01;
3009 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_tri, tvb, offset, 1, ENC_BIG_ENDIAN);
3010 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3011 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3012 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3015 /* Octet 7 Spare Used Cipher */
3016 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3017 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3021 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
3024 /* 16 to h Authentication Triplet [0..4] */
3026 dissect_gtpv2_authentication_triplets(tvb, tree, offset, num_triplet);
3030 * (h+1) to (h+2) DRX parameter
3033 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3037 /* Dissect octet j to r */
3038 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3040 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3043 /* Type = 104 (decimal)
3044 * Figure 8.38-2: UMTS Key, Used Cipher and Quintuplets
3047 dissect_gtpv2_mm_context_utms_cq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3050 proto_tree *flag_tree;
3052 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3055 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3056 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3059 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3060 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3061 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3062 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3063 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3066 oct = tvb_get_guint8(tvb, offset);
3068 uamb_ri = (oct & 0x02) >> 1;
3069 samb_ri = oct & 0x01;
3070 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3071 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3072 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3073 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3075 /* Octet 7 Spare Used Cipher */
3076 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3077 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3080 /* Octet 8 to 23 CK */
3081 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_BIG_ENDIAN);
3083 /* Octet 24 to 39 IK */
3084 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_BIG_ENDIAN);
3088 * 40 to h Authentication Quintuplet [0..4]
3091 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3095 * (h+1) to (h+2) DRX parameter
3098 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3103 /* Dissect octet j to r */
3104 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3106 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3107 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3108 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3109 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3111 if (offset < (gint)length) {
3112 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3116 if (offset == (gint)length) {
3120 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3121 vdp_len = tvb_get_guint8(tvb, offset);
3122 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3124 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3126 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3130 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3131 if (offset == (gint)length) {
3132 hbr_len = tvb_get_guint8(tvb, offset);
3133 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3135 /* s+2 Higher bitrates than 16 Mbps flag */
3137 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3144 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3148 /* Type = 105 (decimal)
3149 * Figure 8.38-3: GSM Key, Used Cipher and Quintuplets
3152 dissect_gtpv2_mm_context_gsm_cq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3155 proto_tree *flag_tree;
3157 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3160 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3161 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3164 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3165 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3166 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3167 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3168 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3171 oct = tvb_get_guint8(tvb, offset);
3173 uamb_ri = (oct & 0x02) >> 1;
3174 samb_ri = oct & 0x01;
3175 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3176 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3177 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3178 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3180 /* Octet 7 Spare Used Cipher */
3181 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3182 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3185 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
3189 * 40 to h Authentication Quintuplet [0..4]
3192 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3196 * (h+1) to (h+2) DRX parameter
3199 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3204 /* Dissect octet j to r */
3205 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3207 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3208 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3209 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3210 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3212 if (offset < (gint)length) {
3213 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3217 if (offset == (gint)length) {
3221 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3222 vdp_len = tvb_get_guint8(tvb, offset);
3223 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3225 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3227 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3231 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3232 if (offset < (gint)length) {
3233 hbr_len = tvb_get_guint8(tvb, offset);
3234 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3236 /* s+2 Higher bitrates than 16 Mbps flag */
3238 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3245 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3249 /* Type = 106 (decimal)
3250 * Figure 8.38-4: UMTS Key and Quintuplets
3253 dissect_gtpv2_mm_context_utms_q(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
3256 proto_tree *flag_tree;
3258 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3261 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3262 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3265 /* Security Mode Spare DRXI KSI */
3266 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3267 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3268 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3269 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3270 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3273 /* Number of Quintuplets Spare UAMB RI SAMB RI */
3274 oct = tvb_get_guint8(tvb, offset);
3276 uamb_ri = (oct & 0x02) >> 1;
3277 samb_ri = oct & 0x01;
3279 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3280 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3281 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3282 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3285 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3287 /* Octet 8 to 23 CK */
3288 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_BIG_ENDIAN);
3290 /* Octet 24 to 39 IK */
3291 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_BIG_ENDIAN);
3295 * 40 to h Authentication Quintuplet [0..4]
3298 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3302 * (h+1) to (h+2) DRX parameter
3305 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3310 /* Dissect octet j to r */
3311 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3313 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3314 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3315 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3316 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3318 if (offset < (gint)length) {
3319 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3323 if (offset == (gint)length) {
3327 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3328 vdp_len = tvb_get_guint8(tvb, offset);
3329 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3331 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3333 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3337 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3338 if (offset < (gint)length) {
3339 hbr_len = tvb_get_guint8(tvb, offset);
3340 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3342 /* s+2 Higher bitrates than 16 Mbps flag */
3344 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3351 /* (s+3) to (n+4) These octet(s) is/are present only if explicitly specified */
3352 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3357 * Type = 107 (decimal)
3358 * Figure 8.38-5: EPS Security Context and Quadruplets
3361 dissect_gtpv2_mm_context_eps_qq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
3363 proto_item *flag_item, *qua_item, *qui_item;
3364 proto_tree *flag_tree, *qua_tree, *qui_tree;
3366 guint8 tmp, nhi, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_len;
3370 flag_item = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3371 flag_tree = proto_item_add_subtree(flag_item, ett_gtpv2_mm_context_flag);
3376 * Security Mode | NHI | DRXI | KSIASME
3378 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3379 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nhi, tvb, offset, 1, ENC_BIG_ENDIAN);
3380 /* If NHI (Next Hop Indicator), bit 5 of octet 5, is set to "1",
3381 * then the optional parameters NH (Next Hop) and NCC (Next
3382 * Hop Chaining Count) are both present, otherwise their octets are not present.
3384 tmp = tvb_get_guint8(tvb, offset);
3385 nhi = (tmp & 0x10) >> 4;
3386 drxi = (tmp & 0x08) >> 3;
3387 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3388 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3394 * Number of | Number of | UAMB | OSCI
3395 * Quintuplets | Quadruplet | RI |
3397 tmp = tvb_get_guint8(tvb, offset);
3398 nr_qui = (tmp & 0xe0) >> 5;
3399 nr_qua = tmp & 0x1c;
3401 uamb_ri = (tmp & 0x2) >> 1;
3403 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3404 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3406 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3408 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_osci, tvb, offset, 1, ENC_BIG_ENDIAN);
3411 /* Octet 7 SAMB RI Used NAS integrity protection algorithm Used NAS Cipher*/
3413 samb_ri = tvb_get_guint8(tvb, offset) >> 7;
3414 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
3415 /* Used NAS integrity protection algorithm */
3416 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unipa, tvb, offset, 1, ENC_BIG_ENDIAN);
3417 /* Used NAS Cipher */
3418 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unc, tvb, offset, 1, ENC_BIG_ENDIAN);
3421 /* Octet 8-10 NAS Downlink Count*/
3422 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_dl_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3425 /* Octet 11-13 NAS Uplink Count */
3426 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_ul_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3430 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_BIG_ENDIAN);
3433 qua_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quadruplets %u", nr_qua);
3435 qua_tree = proto_item_add_subtree(qua_item, ett_gtpv2_qua);
3436 offset = dissect_gtpv2_authentication_quadruplets(tvb, qua_tree, offset, nr_qua);
3438 PROTO_ITEM_SET_GENERATED(qua_item);
3441 qui_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quintuplets %u", nr_qui);
3443 qui_tree = proto_item_add_subtree(qui_item, ett_gtpv2_qui);
3444 offset = dissect_gtpv2_authentication_quintuplets(tvb, qui_tree, offset, nr_qui);
3446 PROTO_ITEM_SET_GENERATED(qui_item);
3449 /* (h+1) to (h+2) DRX parameter */
3451 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3455 /* Octet p to p+31 & Octet p+32 */
3458 proto_tree_add_text(tree, tvb, offset, 32, "NH (Next Hop): %s",
3459 tvb_bytes_to_ep_str(tvb, offset, 32));
3462 proto_tree_add_text(tree, tvb, offset, 1, "NCC (Next Hop Chaining Count): %d",
3463 (tvb_get_guint8(tvb, offset) & 0x0f));
3468 /* Dissect octet j to r */
3469 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3471 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3472 if (offset < (gint)length) {
3473 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3478 if (offset == (gint)length) {
3482 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3483 vdp_len = tvb_get_guint8(tvb, offset);
3484 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3486 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3488 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3489 /*offset += vdp_len;*/
3495 * Type = 108 (decimal)
3496 * Figure 8.38-6: UMTS Key, Quadruplets and Quintuplets
3499 dissect_gtpv2_mm_context_utms_qq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3502 proto_tree *flag_tree;
3504 guint8 tmp, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_length;
3507 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3508 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3511 * Security Mode Spare DRXI KSIASME
3513 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3514 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3515 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3516 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3517 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3523 * Number of | Number of | UAMB | SAMB
3524 * Quintuplets | Quadruplet | RI | RI
3526 tmp = tvb_get_guint8(tvb, offset);
3527 nr_qui = (tmp & 0xe0) >> 5;
3528 nr_qua = tmp & 0x1c;
3530 uamb_ri = (tmp & 0x2) >> 1;
3531 samb_ri = tmp & 0x01;
3533 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3534 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3535 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3536 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3539 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3541 /* Octet 8 to 23 CK */
3542 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_BIG_ENDIAN);
3544 /* Octet 24 to 39 IK */
3545 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_BIG_ENDIAN);
3550 offset = dissect_gtpv2_authentication_quadruplets(tvb, tree, offset, nr_qui);
3554 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3557 /* (h+1) to (h+2) DRX parameter */
3559 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3563 /* Dissect octet j to r */
3564 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3566 if (offset >= (guint32)length) {
3569 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3570 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3572 if (offset >= (guint32)length) {
3576 /* The Voice Domain Preference and UE's Usage Setting coding is specified in clause 10.5.5.28 of 3GPP TS 24.008 [5]. If
3577 * Length of Voice Domain Preference and UE's Usage Setting is zero, then the Voice Domain Preference and UE's Usage
3578 * Setting parameter shall not be present.
3580 vdp_length = tvb_get_guint8(tvb, offset);
3581 proto_tree_add_item(tree, hf_gtpv2_vdp_length, tvb, offset, 1, ENC_BIG_ENDIAN);
3585 offset += de_gmm_voice_domain_pref(tvb, tree, pinfo, offset, vdp_length, NULL, 0);
3588 if (offset < (guint32)length) {
3589 proto_tree_add_text(tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3595 * 8.39 PDN Connection (grouped IE)
3598 dissect_gtpv2_PDN_conn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
3601 proto_tree *grouped_tree;
3604 proto_item_append_text(item, "[Grouped IE]");
3605 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
3606 new_tvb = tvb_new_subset(tvb, offset, length, length );
3608 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type);
3614 dissect_gtpv2_pdn_numbers(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3616 proto_item *nsapi_ti;
3617 proto_tree *nsapi_tree;
3619 guint16 dlgtpu_seq, ulgtpu_seq, send_npdu_nr, rec_npdu_nr;
3622 nsapi = (tvb_get_guint8(tvb, offset) & 0x08);
3623 nsapi_ti = proto_tree_add_text(tree, tvb, offset, 1, "NSAPI: %d", nsapi);
3624 nsapi_tree = proto_item_add_subtree(nsapi_ti, ett_gtpv2_pdn_numbers_nsapi);
3625 proto_tree_add_bits_item(nsapi_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3626 proto_tree_add_item(nsapi_tree, hf_gtpv2_pdn_numbers_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
3627 proto_item_append_text(item, "NSAPI: %u", nsapi);
3630 dlgtpu_seq = tvb_get_ntohs(tvb, offset);
3631 proto_tree_add_text(tree, tvb, offset, 2, "DL GTP-U Sequence Number: %d", dlgtpu_seq);
3634 ulgtpu_seq = tvb_get_ntohs(tvb, offset);
3635 proto_tree_add_text(tree, tvb, offset, 2, "UL GTP-U Sequence Number: %d", ulgtpu_seq);
3638 send_npdu_nr = tvb_get_ntohs(tvb, offset);
3639 proto_tree_add_text(tree, tvb, offset, 2, "Send N-PDU Number: %d", send_npdu_nr);
3642 rec_npdu_nr = tvb_get_ntohs(tvb, offset);
3643 proto_tree_add_text(tree, tvb, offset, 2, "Receive N-PDU Number: %d", rec_npdu_nr);
3647 * 8.41 Packet TMSI (P-TMSI)
3650 dissect_gtpv2_p_tmsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3654 /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation. */
3655 proto_tree_add_item(tree, hf_gtpv2_p_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
3656 proto_item_append_text(item, "%s", tvb_bytes_to_ep_str(tvb, offset, 4));
3660 * 8.42 P-TMSI Signature
3663 dissect_gtpv2_p_tmsi_sig(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3667 /* The P-TMSI Signature consists of 3 octets and may be allocated by the SGSN. */
3668 proto_tree_add_item(tree, hf_gtpv2_p_tmsi_sig, tvb, offset, 3, ENC_BIG_ENDIAN);
3669 proto_item_append_text(item, "%s", tvb_bytes_to_ep_str(tvb, offset, 3));
3677 dissect_gtpv2_hop_counter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3682 hop_counter = tvb_get_guint8(tvb, offset);
3684 proto_tree_add_text(tree, tvb, offset, 1, "Hop Counter: %d", hop_counter);
3685 proto_item_append_text(item, "%d", hop_counter);
3692 static const value_string gtpv2_ue_time_zone_dst_vals[] = {
3693 {0, "No Adjustments for Daylight Saving Time"},
3694 {1, "+1 Hour Adjustments for Daylight Saving Time"},
3695 {2, "+2 Hour Adjustments for Daylight Saving Time"},
3700 dissect_gtpv2_ue_time_zone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3705 * UE Time Zone is used to indicate the offset between universal time and local time in steps of 15 minutes of where the
3706 * UE currently resides. The "Time Zone" field uses the same format as the "Time Zone" IE in 3GPP TS 24.008 [5].
3707 * (packet-gsm_a_dtap.c)
3709 de_time_zone(tvb, tree, pinfo, offset, 1, NULL, 0);
3711 proto_tree_add_item(item, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, ENC_BIG_ENDIAN);
3715 * 8.45 Trace Reference
3718 dissect_gtpv2_trace_reference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3724 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, TRUE);
3727 trace_id = tvb_get_ntohs(tvb, offset);
3728 proto_tree_add_text(tree, tvb, offset, 3, "Trace ID: %d", trace_id);
3730 proto_item_append_text(item, "%s,Trace ID %u", mcc_mnc_str, trace_id);
3733 * 8.46 Complete Request Message
3735 static const value_string gtpv2_complete_req_msg_type_vals[] = {
3736 {0, "Complete Attach Request Message" },
3737 {1, "Complete TAU Request Message" },
3741 dissect_complete_request_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3748 proto_tree_add_item(tree, hf_gtpv2_complete_req_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3752 /* Add the Complete Request Message */
3753 new_tvb = tvb_new_subset_remaining(tvb, offset);
3754 call_dissector(nas_eps_handle, new_tvb, pinfo, tree);
3762 dissect_gtpv2_guti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3768 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
3771 proto_tree_add_item(tree, hf_gtpv2_mme_grp_id, tvb, offset, 2, ENC_BIG_ENDIAN);
3774 proto_tree_add_item(tree, hf_gtpv2_mme_code, tvb, offset, 1, ENC_BIG_ENDIAN);
3777 proto_tree_add_item(tree, hf_gtpv2_m_tmsi, tvb, offset, 4, ENC_NA);
3781 * 8.48 Fully Qualified Container (F-Container)
3784 static const value_string gtpv2_container_type_vals[] = {
3785 {1, "UTRAN transparent container"},
3786 {2, "BSS container"},
3787 {3, "E-UTRAN transparent container"},
3793 dissect_gtpv2_F_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type, guint8 instance _U_)
3796 proto_item *bss_item;
3797 proto_tree *sub_tree;
3799 guint8 container_type;
3800 guint8 container_flags, xid_len;
3802 /* Octets 8 7 6 5 4 3 2 1
3803 * 5 Spare | Container Type
3805 proto_tree_add_item(tree, hf_gtpv2_container_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3806 container_type = tvb_get_guint8(tvb, offset);
3808 if ( (message_type == GTPV2_FORWARD_RELOCATION_REQ)
3809 || (message_type == GTPV2_CONTEXT_RESPONSE)
3810 || (message_type == GTPV2_RAN_INFORMATION_RELAY)) {
3811 switch (container_type) {
3814 bss_item = proto_tree_add_text(tree, tvb, offset, length, "BSS container");
3815 sub_tree = proto_item_add_subtree(bss_item, ett_gtpv2_bss_con);
3816 /* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of paratemer */
3817 proto_tree_add_item(sub_tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
3818 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3819 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3820 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3821 container_flags = tvb_get_guint8(tvb, offset);
3823 if ((container_flags & 0x01) == 1) {
3824 /* Packet Flow ID present */
3825 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
3828 if (((container_flags & 0x04) == 4) || ((container_flags & 0x02) == 2)) {
3829 if ((container_flags & 0x04) == 4) {
3831 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
3833 if ((container_flags & 0x02) == 2) {
3834 /* Radio Priority present */
3835 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
3839 if ((container_flags & 0x08) == 8) {
3840 /* XiD parameters length is present in Octet c.
3841 * XiD parameters are present in Octet d to n.
3843 xid_len = tvb_get_guint8(tvb, offset);
3844 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3846 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_BIG_ENDIAN);
3853 if (message_type == GTPV2_FORWARD_CTX_NOTIFICATION) {
3854 switch (container_type) {
3856 /* E-UTRAN transparent container */
3857 new_tvb = tvb_new_subset_remaining(tvb, offset);
3858 dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(new_tvb, pinfo, tree, NULL);
3865 /* 7.3.2 Forward Relocation Response
3866 * E-UTRAN Transparent Container
3867 * This IE is conditionally included only during a handover to
3868 * E-UTRAN and contains the radio-related and core network
3869 * information. If the Cause IE contains the value "Request
3870 * accepted", this IE shall be included.
3872 proto_tree_add_text(tree, tvb, offset, length-offset, "Not dissected yet");
3877 * 8.49 Fully Qualified Cause (F-Cause)
3880 static const value_string gtpv2_cause_type_vals[] = {
3881 {0, "Radio Network Layer"},
3882 {1, "Transport Layer"},
3885 {4, "Miscellaneous"},
3899 static value_string_ext gtpv2_cause_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_type_vals);
3902 dissect_gtpv2_F_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
3907 /* The value of Instance field of the F-Cause IE in a GTPv2 message shall indicate
3908 * whether the F-Cause field contains RANAP Cause, BSSGP Cause or RAN Cause.
3909 * If the F-Cause field contains RAN Cause, the Cause Type field shall contain
3910 * the RAN cause subcategory as specified in 3GPP TS 36.413 [10] and it shall be
3911 * encoded as in Table 8.49-1.
3912 * If the F-Cause field contains BSSGP Cause or RANAP Cause,
3913 * the Cause Type field shall be ignored by the receiver.
3915 if (message_type == GTPV2_FORWARD_RELOCATION_REQ) {
3918 proto_item_append_text(item, "[RAN Cause]");
3919 proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3920 cause_type = tvb_get_guint8(tvb, offset);
3922 switch (cause_type) {
3924 /* CauseRadioNetwork */
3925 proto_tree_add_item(tree, hf_gtpv2_CauseRadioNetwork, tvb, offset, 1, ENC_BIG_ENDIAN);
3928 /* CauseTransport */
3929 proto_tree_add_item(tree, hf_gtpv2_CauseTransport, tvb, offset, 1, ENC_BIG_ENDIAN);
3933 proto_tree_add_item(tree, hf_gtpv2_CauseNas, tvb, offset, 1, ENC_BIG_ENDIAN);
3937 proto_tree_add_item(tree, hf_gtpv2_CauseProtocol, tvb, offset, 1, ENC_BIG_ENDIAN);
3941 proto_tree_add_item(tree, hf_gtpv2_CauseMisc, tvb, offset, 1, ENC_BIG_ENDIAN);
3949 proto_item_append_text(item, "[RANAP Cause]");
3952 proto_item_append_text(item, "[BSSGP Cause]");
3958 proto_tree_add_text(tree, tvb, offset, length-offset, "Not dissected yet");
3963 * 8.50 Selected PLMN ID
3966 * The Selected PLMN ID IE contains the core network operator selected for tne UE
3967 * in a shared network. Octets 5-7 shall be encoded as the content part of the
3968 * "Selected PLMN Identity" parameter in 3GPP TS 36.413 [10].
3969 * -The Selected PLMN identity consists of 3 digits from MCC followed by
3970 * either -a filler digit plus 2 digits from MNC (in case of 2 digit MNC) or
3971 * -3 digits from MNC (in case of a 3 digit MNC).
3974 * +--+--+--+--+--+--+--+--+
3975 * Octet 5 |MCC digit 2|MCC digit 1|
3976 * +--+--+--+--+--+--+--+--+
3977 * Octet 6 |MNC digit 1|MCC digit 3|
3978 * +--+--+--+--+--+--+--+--+
3979 * Octet 7 |MNC digit 3|MNC digit 2|
3980 * +--+--+--+--+--+--+--+--+
3983 dissect_gtpv2_sel_plmn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
3987 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, FALSE);
3988 proto_item_append_text(item, "%s", mcc_mnc_str);
3992 * 8.51 Target Identification
3995 static const value_string gtpv2_target_type_vals[] = {
3997 {1, "Macro eNodeB ID"},
3998 {2, "Cell Identifier"},
3999 {3, "Home eNodeB ID"},
4002 static value_string_ext gtpv2_target_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_target_type_vals);
4005 dissect_gtpv2_target_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4011 proto_tree_add_item(tree, hf_gtpv2_target_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4012 target_type = tvb_get_guint8(tvb, offset);
4014 switch (target_type) {
4016 new_tvb = tvb_new_subset_remaining(tvb, offset);
4017 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4020 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
4023 /* RAC (see NOTE 3) */
4024 proto_tree_add_item(tree, hf_gtpv2_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
4027 * In this case the Target ID field shall be encoded as the Target
4028 * RNC-ID part of the "Target ID" parameter in 3GPP TS 25.413 [33]. Therefore, the "Choice Target ID" that indicates
4029 * "Target RNC-ID" (numerical value of 0x20) shall not be included (value in octet 5 specifies the target type).
4031 proto_tree_add_item(tree, hf_gtpv2_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4032 /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
4033 * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
4036 proto_tree_add_item(tree, hf_gtpv2_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4040 /* Macro eNodeB ID*/
4041 new_tvb = tvb_new_subset_remaining(tvb, offset);
4042 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4044 /* The Macro eNodeB ID consists of 20 bits.
4045 * Bit 4 of Octet 4 is the most significant bit and bit 1 of Octet 6 is the least significant bit.
4047 proto_tree_add_item(tree, hf_gtpv2_macro_enodeb_id, tvb, offset, 3, ENC_BIG_ENDIAN);
4049 /* Tracking Area Code (TAC) */
4050 proto_tree_add_item(tree, hf_gtpv2_uli_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
4054 /* Cell Identifier */
4055 /* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
4056 * in 3GPP TS 48.018 [34].
4058 new_tvb = tvb_new_subset_remaining(tvb, offset);
4059 de_bssgp_cell_id(new_tvb, tree, pinfo, 0, 0/* not used */, NULL, 0);
4062 /* Home eNodeB ID */
4063 new_tvb = tvb_new_subset_remaining(tvb, offset);
4064 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4066 /* Octet 10 to 12 Home eNodeB ID
4067 * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
4068 * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
4069 * The coding of the Home eNodeB ID is the responsibility of each administration.
4070 * Coding using full hexadecimal representation shall be used.
4072 proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, offset, 4 , ENC_BIG_ENDIAN);
4074 /* Octet 13 to 14 Tracking Area Code (TAC) */
4075 proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
4081 proto_tree_add_text(tree, tvb, offset, length-offset, "Not dissected yet");
4089 * 8.53 Packet Flow ID
4092 dissect_gtpv2_pkt_flow_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4096 /* Octet 5 Spare EBI */
4097 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4098 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 2, ENC_BIG_ENDIAN);
4101 /* Packet Flow ID */
4102 proto_tree_add_text(tree, tvb, offset, length, "Packet Flow ID: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4109 dissect_gtpv2_rab_context(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4112 guint16 dlgtpu_seq, ulgtpu_seq, dl_pdcp_seq, ul_pdcp_seq;
4115 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4116 proto_tree_add_item(tree, hf_gtpv2_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
4119 /* 6 to 7 DL GTP-U Sequence Number */
4120 dlgtpu_seq = tvb_get_ntohs(tvb, offset);
4121 proto_tree_add_text(tree, tvb, offset, 2, "DL GTP-U Sequence Number: %d", dlgtpu_seq);
4124 /* 8 to 9 UL GTP-U Sequence Number */
4125 ulgtpu_seq = tvb_get_ntohs(tvb, offset);
4126 proto_tree_add_text(tree, tvb, offset, 2, "UL GTP-U Sequence Number: %d", ulgtpu_seq);
4129 /* 10 to 11 DL PDCP Sequence Number */
4130 dl_pdcp_seq = tvb_get_ntohs(tvb, offset);
4131 proto_tree_add_text(tree, tvb, offset, 2, "DL PDCP Sequence Number: %d", dl_pdcp_seq);
4134 /* 12 to 13 UL PDCP Sequence Number */
4135 ul_pdcp_seq = tvb_get_ntohs(tvb, offset);
4136 proto_tree_add_text(tree, tvb, offset, 2, "UL PDCP Sequence Number: %d", ul_pdcp_seq);
4141 * 8.55 Source RNC PDCP context info
4144 dissect_gtpv2_s_rnc_pdcp_ctx_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4146 proto_tree_add_text(tree, tvb, 0, length, "RRC Container");
4150 * 8.56 UDP Source Port Number
4153 dissect_udp_s_port_nr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4155 proto_tree_add_text(tree, tvb, 0, 2, "UPD Source Port Number: %u", tvb_get_ntohs(tvb, 0));
4156 proto_item_append_text(item, "%u", tvb_get_ntohs(tvb, 0));
4159 * 8.57 APN Restriction
4162 dissect_gtpv2_apn_rest(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4166 type_value = tvb_get_guint8(tvb, 0);
4167 proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, 0, 1, ENC_BIG_ENDIAN);
4168 proto_item_append_text(item, "value %u", type_value);
4172 * 8.58 Selection Mode
4174 static const value_string gtpv2_selec_mode_vals[] = {
4175 {0, "MS or network provided APN, subscribed verified"},
4176 {1, "MS provided APN, subscription not verified"},
4177 {2, "Network provided APN, subscription not verified"},
4178 {3, "Network provided APN, subscription not verified (Basically for Future use"},
4183 dissect_gtpv2_selec_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4188 ss_mode = tvb_get_guint8(tvb, offset) & 0x03;
4189 proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
4190 proto_item_append_text(item, "%s", val_to_str_const(ss_mode, gtpv2_selec_mode_vals, "Unknown"));
4195 * 8.59 Source Identification
4198 static const value_string gtpv2_source_ident_types[] = {
4201 {2, "eNodeB ID(Reserved, used in erlier v of proto.)"},
4206 dissect_gtpv2_source_ident(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4211 /* Octet 5 to 12 Target Cell ID */
4212 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4214 /* Octet 13 Source Type */
4215 source_type = tvb_get_guint8(tvb, offset);
4216 proto_tree_add_item(tree, hf_gtpv2_source_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4218 /* Octet 14 to (n+4) Source ID */
4219 switch (source_type) {
4221 /* The Source Type is Cell ID for PS handover from GERAN A/Gb mode. In this case the coding of the Source ID field
4222 * shall be same as the Octets 3 to 10 of the Cell Identifier IEI in 3GPP TS 48.018 [34].
4224 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4227 /* The Source Type is RNC ID for PS handover from GERAN Iu mode or for inter-RAT handover from UTRAN. In this
4228 * case the Source ID field shall be encoded as as the Source RNC-ID part of the "Source ID" parameter in 3GPP TS
4231 /* RNC-ID M INTEGER (0..4095) */
4236 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_source_type_unknown, tvb, offset-1, 1);
4243 * 8.60 Bearer Control Mode
4245 static const value_string gtpv2_bearer_control_mode_vals[] = {
4246 {0, "Selected Bearer Control Mode-'MS_only'"},
4247 {1, "Selected Bearer Control Mode-'Network_only'"},
4248 {2, "Selected Bearer Control Mode-'MS/NW'"},
4252 static const value_string gtpv2_bearer_control_mode_short_vals[] = {
4254 {1, "Network_only"},
4260 dissect_gtpv2_bearer_control_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4264 proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
4265 /* Add Bearer Control Mode to tree */
4266 bcm = tvb_get_guint8(tvb, 0);
4267 proto_item_append_text(item, "%s", val_to_str_const(bcm, gtpv2_bearer_control_mode_short_vals, "Unknown"));
4271 * 8.61 Change Reporting Action
4273 static const value_string gtpv2_cng_rep_act_vals[] = {
4274 {0, "Stop Reporting"},
4275 {1, "Start Reporting CGI/SAI"},
4276 {2, "Start Reporting RAI"},
4277 {3, "Start Reporting TAI"},
4278 {4, "Start Reporting ECGI"},
4279 {5, "Start Reporting CGI/SAI and RAI"},
4280 {6, "Start Reporting TAI and ECGI"},
4285 dissect_gtpv2_cng_rep_act(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4289 /* Add Action to tree */
4290 action = tvb_get_guint8(tvb, 0);
4291 proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, ENC_BIG_ENDIAN);
4293 proto_item_append_text(item, "%s", val_to_str_const(action, gtpv2_cng_rep_act_vals, "Unknown"));
4296 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
4299 static const value_string gtpv2_fq_csid_type_vals[] = {
4300 {0, "Global unicast IPv4 address"},
4301 {1, "Global unicast IPv6 address"},
4302 {2, "4 octets long field"},
4308 dissect_gtpv2_fq_csid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4311 guint8 octet, node_id_type, csids;
4312 guint32 node_id, node_id_mcc_mnc;
4314 /* Octet 5 Node-ID Type Number of CSIDs= m */
4316 octet = tvb_get_guint8(tvb, offset);
4317 node_id_type = octet >> 4;
4318 csids = octet & 0x0f;
4319 proto_tree_add_item(tree, hf_gtpv2_fq_csid_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4320 proto_tree_add_item(tree, hf_gtpv2_fq_csid_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
4323 switch (node_id_type) {
4325 /* Indicates that Node-ID is a global unicast IPv4 address and p = 9 */
4326 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4330 /* Indicates that Node-ID is a global unicast IPv6 address and p = 21 */
4331 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv6, tvb, offset, 16, ENC_NA);
4335 /* Node-ID is a 4 octets long field with a 32 bit value stored in network order, and p= 9. The coding
4336 * of the field is specified below:
4337 * - Most significant 20 bits are the binary encoded value of (MCC * 1000 + MNC).
4338 * - Least significant 12 bits is a 12 bit integer assigned by an operator to an MME, SGW or PGW. Other values of
4339 * Node-ID Type are reserved.
4341 node_id = tvb_get_ntohl(tvb, offset);
4342 node_id_mcc_mnc = node_id >> 12;
4343 node_id = node_id & 0xfff;
4344 proto_tree_add_text(tree, tvb, offset, 4, "Node-ID: MCC+MNC %u, Id: %u", node_id_mcc_mnc, node_id);
4348 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_fq_csid_type_bad, tvb, offset-1, 1,
4349 "Wrong Node-ID Type %u, should be 0-2(Or tis is a newer spec)", node_id_type);
4353 /* First PDN Connection Set Identifier (CSID)
4354 * Second PDN Connection Set Identifier (CSID)
4356 * m-th PDN Connection Set Identifier (CSID)
4359 proto_tree_add_item(tree, hf_gtpv2_fq_csid_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4366 * 8.63 Channel needed
4369 dissect_gtpv2_channel_needed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4371 /* The Channel needed shall be coded as depicted in Figure 8.63-1. Channel needed is coded as the IEI part and the value
4372 * part of the Channel Needed IE defined in 3GPP TS 44.018[28]
4374 de_rr_chnl_needed(tvb, tree, pinfo, 0, length, NULL, 0);
4378 * 8.64 eMLPP Priority
4379 * The eMLPP-Priority shall be coded as depicted in Figure 8.64-1. The eMLPP Priority is coded as the value part of the
4380 * eMLPP-Priority IE defined in 3GPP TS 48.008 [29] (not including 3GPP TS 48.008 IEI and 3GPP TS 48.008 [29]
4381 * length indicator).
4384 dissect_gtpv2_emlpp_pri(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4386 be_emlpp_prio(tvb, tree, pinfo, 0, length, NULL, 0);
4393 static const value_string gtpv2_node_type_vals[] = {
4400 dissect_gtpv2_node_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4404 proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4405 /* Append Node Type to tree */
4406 node_type = tvb_get_guint8(tvb, 0);
4407 proto_item_append_text(item, "%s", val_to_str_const(node_type, gtpv2_node_type_vals, "Unknown"));
4412 * 8.66 Fully Qualified Domain Name (FQDN)
4415 dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4417 int offset = 0, name_len, tmp;
4418 guint8 *fqdn = NULL;
4420 /* The FQDN field encoding shall be identical to the encoding of
4421 * a FQDN within a DNS message of section 3.1 of IETF
4422 * RFC 1035 [31] but excluding the trailing zero byte.
4425 name_len = tvb_get_guint8(tvb, offset);
4427 if (name_len < 0x20) {
4428 fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, length - 1);
4430 if (name_len >= length - 1)
4433 name_len = name_len + fqdn[tmp] + 1;
4437 fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
4439 proto_tree_add_string(tree, hf_gtpv2_fqdn, tvb, offset, length, fqdn);
4440 proto_item_append_text(item, "%s", fqdn);
4445 * 8.67 Private Extension
4448 dissect_gtpv2_private_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance)
4454 /* oct 5 -7 Enterprise ID */
4455 ext_id = tvb_get_ntohs(tvb, offset);
4456 proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4459 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(ext_id, &sminmpec_values_ext, "Unknown"), ext_id);
4461 next_tvb = tvb_new_subset(tvb, offset, length-2, length-2);
4462 if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, GUINT_TO_POINTER((guint32)instance))){
4466 proto_tree_add_text(tree, tvb, offset, length-2, "Proprietary value");
4470 * 8.68 Transaction Identifier (TI)
4473 dissect_gtpv2_ti(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4475 /* 5 to (n+4) Transaction Identifier */
4476 proto_tree_add_item(tree, hf_gtpv2_ti, tvb, 0, length, ENC_NA);
4481 * 8.69 MBMS Session Duration
4484 dissect_gtpv2_mbms_session_duration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4493 /* From 3GPP TS 29.061 17.7.7 MBMS-Session-Duration AVP */
4494 /* Bits: ssss ssss ssss ssss sddd dddd where s bits = seconds, d bits = days */
4495 seconds = tvb_get_bits32(tvb, bit_offset, 17, ENC_BIG_ENDIAN);
4498 days = tvb_get_bits32(tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4500 /* Maximum allowed value for days: 18.
4501 * Maximum allowed value for seconds: 86,400 */
4502 if ((days > 18) || (seconds > 86400)) {
4503 proto_tree_add_text(tree, tvb, offset, offset + 3, "Days or Seconds out or allowed range");
4506 /* The lowest value of this AVP (i.e. all 0:s) is reserved to indicate an indefinite value to denote sessions that are expected to be always-on. */
4507 if ((seconds == 0) && (days == 0)) {
4508 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4509 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4510 proto_item_append_text(item, "Indefinite (always-on)");
4512 hours = seconds / 3600;
4513 minutes = (seconds % 3600) / 60;
4514 seconds = (seconds % 3600) % 60;
4516 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4517 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4518 proto_item_append_text(item, "%d days %02d:%02d:%02d (DD days HH:MM:SS)", days, hours, minutes, seconds);
4523 proto_tree_add_text(tree, tvb, offset, length-3, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-3));
4527 * 8.70 MBMS Service Area
4530 dissect_gtpv2_mbms_service_area(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4533 proto_item *sai_item;
4538 binary_nr = tvb_get_guint8(tvb, offset);
4539 real_nr = (guint16)binary_nr + 1;
4541 /* 3GPP TS 29.061 17.7.6 MBMS-Service-Area AVP */
4542 proto_tree_add_uint(tree, hf_gtpv2_mbms_service_area_nr, tvb, offset, 1, real_nr);
4545 /* A consecutive list of MBMS Service Area Identities follow, each with a length of two octets. */
4546 while (offset < length) {
4547 /* 3GPP TS 23.003 15.3 Structure of MBMS SAI */
4548 sai = tvb_get_ntohs(tvb, offset);
4549 sai_item = proto_tree_add_item(tree, hf_gtpv2_mbms_service_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4550 /* The value 0 denotes the whole of PLMN as the MBMS Service Area */
4552 proto_item_append_text(sai_item, " Entire PLMN");
4554 proto_item_append_text(item, " %u", sai);
4560 * 8.71 MBMS Session Identifier
4563 dissect_gtpv2_mbms_session_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, _U_ guint8 message_type _U_, guint8 instance _U_)
4566 /* One octet OctetString. */
4567 proto_tree_add_item(tree, hf_gtpv2_mbms_session_id, tvb, offset, 1, ENC_NA);
4571 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4575 * 8.72 MBMS Flow Identifier
4578 dissect_gtpv2_mbms_flow_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4581 /* Two octets OctetString. */
4582 proto_tree_add_item(tree, hf_gtpv2_mbms_flow_id, tvb, offset, 2, ENC_NA);
4583 proto_item_append_text(item, " %s", tvb_bytes_to_ep_str(tvb, offset, 2));
4587 proto_tree_add_text(tree, tvb, offset, length-2, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-2));
4591 * 8.73 MBMS IP Multicast Distribution
4593 static const value_string gtpv2_mbms_hc_indicator_vals[] = {
4594 {0, "Uncompressed header"},
4595 {1, "Compressed header"},
4600 dissect_gtpv2_mbms_ip_mc_dist(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4604 proto_tree_add_item(tree, hf_gtpv2_cteid, tvb, offset, 4, ENC_BIG_ENDIAN);
4607 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4608 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4609 /* IP Multicast Distribution Address */
4610 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4612 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4613 proto_item_append_text(item, " IPv4 Dist %s", tvb_ip_to_str(tvb, offset));
4615 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4617 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv6, tvb, offset, 16, ENC_NA);
4618 proto_item_append_text(item, " IPv6 Dist %s", tvb_ip6_to_str(tvb, offset));
4622 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4623 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4624 /* IP Multicast Source Address */
4625 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4627 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4628 proto_item_append_text(item, " IPv4 Src %s", tvb_ip_to_str(tvb, offset));
4630 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4632 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv6, tvb, offset, 16, ENC_NA);
4633 proto_item_append_text(item, " IPv6 Src %s", tvb_ip6_to_str(tvb, offset));
4637 proto_tree_add_item(tree, hf_gtpv2_mbms_hc_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
4640 if (length > offset)
4641 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4646 * 8.74 MBMS Distribution Acknowledge
4648 static const value_string gtpv2_mbms_dist_indication_vals[] = {
4649 {0, "No RNCs have accepted IP multicast distribution"},
4650 {1, "All RNCs have accepted IP multicast distribution"},
4651 {2, "Some RNCs have accepted IP multicast distribution"},
4652 {3, "Spare. For future use."},
4657 dissect_gtpv2_mbms_dist_ack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4661 proto_tree_add_item(tree, hf_gtpv2_mbms_dist_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
4665 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4669 * 8.75 User CSG Information (UCI)
4672 dissect_gtpv2_uci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4674 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4677 /* 8.76 CSG Information Reporting Action */
4679 dissect_gtpv2_csg_info_rep_action(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4681 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4684 /* 8.77 RFSP Index */
4686 dissect_gtpv2_rfsp_index(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4691 proto_tree_add_item(tree, hf_gtpv2_subscriber_rfsp, tvb, offset, 2, ENC_BIG_ENDIAN);
4692 }else if(instance == 1){
4693 proto_tree_add_item(tree, hf_gtpv2_rfsp_inuse, tvb, offset, 2, ENC_BIG_ENDIAN);
4699 dissect_gtpv2_csg_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4701 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4704 /* 8.79 CSG Membership Indication (CMI) */
4706 dissect_gtpv2_cmi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4708 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4711 /* 8.80 Service indicator */
4713 dissect_gtpv2_service_indicator(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4715 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4718 /* 8.81 Detach Type */
4720 dissect_gtpv2_detach_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4722 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4725 /* 8.82 Local Distinguished Name (LDN) */
4727 dissect_gtpv2_ldn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4729 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4732 /* 8.83 Node Features */
4734 dissect_gtpv2_node_features(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4737 proto_tree_add_item(tree, hf_gtpv2_node_features_prn, tvb, offset, 1, ENC_BIG_ENDIAN);
4738 proto_tree_add_item(tree, hf_gtpv2_node_features_mabr, tvb, offset, 1, ENC_BIG_ENDIAN);
4739 proto_tree_add_item(tree, hf_gtpv2_node_features_ntsr, tvb, offset, 1, ENC_BIG_ENDIAN);
4742 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4746 * MBMS Time to Data Transfer
4749 dissect_gtpv2_mbms_time_to_data_xfer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4755 binary_secs = tvb_get_guint8(tvb, offset);
4756 real_secs = (guint16)binary_secs + 1;
4758 proto_tree_add_string_format_value(tree, hf_gtpv2_time_to_data_xfer, tvb, offset, 1, "", "%d second(s)", real_secs);
4759 proto_item_append_text(item, " %u second(s)", real_secs);
4762 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4765 /* 8.85 Throttling */
4767 dissect_gtpv2_throttling(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4769 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4772 /* 8.86 Allocation/Retention Priority (ARP) */
4774 dissect_gtpv2_arp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4778 proto_tree_add_item(tree, hf_gtpv2_arp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
4779 proto_tree_add_item(tree, hf_gtpv2_arp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
4780 proto_tree_add_item(tree, hf_gtpv2_arp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
4784 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4787 /* 8.87 EPC Timer */
4788 static const value_string gtpv2_timer_unit_vals[] = {
4789 {0, "value is incremented in multiples of 2 seconds"},
4790 {1, "value is incremented in multiples of 1 minute"},
4791 {2, "value is incremented in multiples of 10 minutes"},
4792 {3, "value is incremented in multiples of 1 hour"},
4793 {4, "value is incremented in multiples of 1 hour"},
4794 {5, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
4795 {6, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
4796 {7, "value indicates that the timer is infinite"},
4801 dissect_gtpv2_epc_timer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4803 proto_tree_add_item(tree, hf_gtpv2_timer_unit, tvb, 0, 1, ENC_BIG_ENDIAN);
4804 proto_tree_add_item(tree, hf_gtpv2_timer_value, tvb, 0, 1, ENC_BIG_ENDIAN);
4808 /* 8.88 Signalling Priority Indication */
4810 dissect_gtpv2_sig_prio_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4812 proto_tree_add_item(tree, hf_gtpv2_lapi, tvb, 0, 1, ENC_BIG_ENDIAN);
4815 /* 8.89 Temporary Mobile Group Identity (TMGI) */
4817 dissect_gtpv2_tmgi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4822 tmgi = tvb_get_ntoh48(tvb, offset);
4824 proto_item_append_text(item, "%012" G_GINT64_MODIFIER "x", tmgi);
4826 proto_tree_add_item(tree, hf_gtpv2_mbms_service_id, tvb, offset, 3, ENC_BIG_ENDIAN);
4829 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
4832 if (length > offset)
4833 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4837 * 8.90 Additional MM context for SRVCC
4838 * 3GPP TS 29.274 Figure 8.90-1
4841 dissect_gtpv2_add_mm_cont_for_srvcc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4844 proto_item *ms_cm_item;
4845 proto_tree *ms_cm_tree;
4848 /* Length of Mobile Station Classmark 2 */
4849 elm_len = tvb_get_guint8(tvb, offset);
4850 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
4852 ms_cm_item = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark 2 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
4853 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
4854 /* Mobile Station Classmark 2 */
4855 de_ms_cm_2(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4858 /* Length of Mobile Station Classmark 3 */
4859 elm_len = tvb_get_guint8(tvb, offset);
4860 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
4862 ms_cm_item = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark3 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
4863 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
4864 /* Mobile Station Classmark 3 */
4865 de_ms_cm_3(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4868 /* Length of Supported Codec List */
4869 elm_len = tvb_get_guint8(tvb, offset);
4870 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
4872 ms_cm_item = proto_tree_add_text(tree, tvb, offset, elm_len, "Supported Codec List %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
4873 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_supp_codec_list);
4874 /* Supported Codec List */
4875 de_sup_codec_list(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4878 if (length > offset)
4879 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4882 /* 8.91 Additional flags for SRVCC */
4884 dissect_gtpv2_add_flags_for_srvcc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4888 proto_tree_add_item(tree, hf_gtpv2_add_flags_for_srvcc_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
4889 proto_tree_add_item(tree, hf_gtpv2_vsrvcc_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
4893 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4896 /* 8.92 Max MBR/APN-AMBR (MMBR) */
4898 dissect_gtpv2_mmbr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4904 max_ul = tvb_get_ntohl(tvb, offset);
4905 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "%u %s",
4906 (max_ul) > 1000 ? max_ul/1000 : max_ul,
4907 (max_ul) > 1000 ? "Mbps" : "kbps");
4911 max_dl = tvb_get_ntohl(tvb, offset);
4912 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "%u %s",
4913 (max_dl) > 1000 ? max_dl/1000 : max_dl,
4914 (max_dl) > 1000 ? "Mbps" : "kbps");
4917 /* 8.93 MDT Configuration */
4919 dissect_gtpv2_mdt_config(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4921 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4924 /* 8.94 Additional Protocol Configuration Options (APCO) */
4926 dissect_gtpv2_apco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4928 switch (message_type) {
4929 case GTPV2_CREATE_SESSION_REQUEST:
4930 /* PCO options as MS to network direction */
4931 pinfo->link_dir = P2P_DIR_UL;
4933 case GTPV2_CREATE_SESSION_RESPONSE:
4934 /* PCO options as Network to MS direction: */
4935 pinfo->link_dir = P2P_DIR_DL;
4940 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
4943 /* 8.95 Absolute Time of MBMS Data Transfer */
4945 dissect_gtpv2_abs_mbms_data_tf_time(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4948 const gchar *time_str;
4950 time_str = tvb_ntp_fmt_ts(tvb, offset);
4951 proto_tree_add_string(tree, hf_gtpv2_abs_time_mbms_data, tvb, offset, 8, time_str);
4952 proto_item_append_text(item, "%s", time_str);
4955 if (length > offset)
4956 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4959 /* 8.96 H(e)NB Information Reporting */
4960 static const true_false_string gtpv2_henb_info_report_fti_vals = {
4961 "Start reporting H(e)NB local IP address and UDP port number information change",
4962 "Stop reporting H(e)NB local IP address and UDP port number information change",
4966 dissect_gtpv2_henb_info_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4970 proto_tree_add_item(tree, hf_gtpv2_henb_info_report_fti, tvb, offset, 1, ENC_BIG_ENDIAN);
4974 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4977 /* 8.97 IPv4 Configuration Parameters (IP4CP) */
4979 dissect_gtpv2_ip4cp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4983 proto_tree_add_item(tree, hf_gtpv2_ip4cp_subnet_prefix_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4985 proto_tree_add_item(tree, hf_gtpv2_ip4cp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4988 if (length > offset)
4989 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4992 /* 8.98 Change to Report Flags */
4994 dissect_gtpv2_change_report_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
4998 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_sncr, tvb, offset, 1, ENC_BIG_ENDIAN);
4999 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_tzcr, tvb, offset, 1, ENC_BIG_ENDIAN);
5003 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5006 /* 8.99 Action Indication */
5007 static const value_string gtpv2_action_indication_vals[] = {
5009 { 1, "Deactivation Indication"},
5010 { 2, "Paging Indication"},
5018 static value_string_ext gtpv2_action_indication_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_action_indication_vals);
5021 dissect_gtpv2_action_indication(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5025 proto_tree_add_item(tree, hf_gtpv2_action_indication_val, tvb, offset, 1, ENC_BIG_ENDIAN);
5029 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5032 typedef struct _gtpv2_ie {
5034 void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, guint16, guint8, guint8);
5037 static const gtpv2_ie_t gtpv2_ies[] = {
5038 {GTPV2_IE_IMSI, dissect_gtpv2_imsi}, /* 1, Internal Mobile Subscriber Identity (IMSI) */
5039 {GTPV2_IE_CAUSE, dissect_gtpv2_cause}, /* 2, Cause (without embedded offending IE) 8.4 */
5040 {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery}, /* 3, Recovery (Restart Counter) 8.5 */
5041 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
5042 /*Start SRVCC Messages 3GPP TS 29.280 */
5043 {GTPV2_IE_STN_SR, dissect_gtpv2_stn_sr}, /* 51 STN-SR */
5044 {GTPV2_IE_SRC_TGT_TRANS_CON, dissect_gtpv2_src_tgt_trans_con}, /* 52 Source to Target Transparent Container */
5045 {GTPV2_IE_TGT_SRC_TRANS_CON , dissect_gtpv2_tgt_src_trans_con}, /* 53 Target to Source Transparent Container */
5046 {GTPV2_IE_MM_CON_EUTRAN_SRVCC, dissect_gtpv2_mm_con_eutran_srvcc}, /* 54 MM Context for E-UTRAN SRVCC */
5047 {GTPV2_IE_MM_CON_UTRAN_SRVCC, dissect_gtpv2_mm_con_utran_srvcc}, /* 55 MM Context for UTRAN SRVCC */
5048 {GTPV2_IE_SRVCC_CAUSE, dissect_gtpv2_srvcc_cause}, /* 56 SRVCC Cause */
5049 {GTPV2_IE_TGT_RNC_ID, dissect_gtpv2_tgt_rnc_id}, /* 57 Target RNC ID */
5050 {GTPV2_IE_TGT_GLOGAL_CELL_ID, dissect_gtpv2_tgt_global_cell_id}, /* 58 Target Global Cell ID */
5051 {GTPV2_IE_TEID_C, dissect_gtpv2_teid_c}, /* 59 TEID-C */
5052 {GTPV2_IE_SV_FLAGS, dissect_gtpv2_sv_flags}, /* 60 Sv Flags */
5053 {GTPV2_IE_SAI, dissect_gtpv2_sai}, /* 61 Service Area Identifie */
5054 /* 61-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
5056 {GTPV2_APN, dissect_gtpv2_apn}, /* 71, Access Point Name (APN) 8.6 */
5057 {GTPV2_AMBR, dissect_gtpv2_ambr}, /* 72, Aggregate Maximum Bit Rate (AMBR) */
5058 {GTPV2_EBI, dissect_gtpv2_ebi}, /* 73, EPS Bearer ID (EBI) 8.8 */
5059 {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address}, /* 74, IP Address */
5060 {GTPV2_MEI, dissect_gtpv2_mei}, /* 74, Mobile Equipment Identity */
5061 {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn}, /* 76, MSISDN 8.11 */
5062 {GTPV2_INDICATION, dissect_gtpv2_ind}, /* 77 Indication 8.12 */
5063 {GTPV2_PCO, dissect_gtpv2_pco}, /* 78 Protocol Configuration Options (PCO) 8.13 */
5064 {GTPV2_PAA, dissect_gtpv2_paa}, /* 79 PDN Address Allocation (PAA) 8.14 */
5065 {GTPV2_BEARER_QOS, dissect_gtpv2_bearer_qos}, /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
5066 {GTPV2_IE_FLOW_QOS, dissect_gtpv2_flow_qos}, /* 81 Flow Quality of Service (Flow QoS) 8.16 */
5067 {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type}, /* 82, RAT Type 8.17 */
5068 {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net}, /* 83, Serving Network 8.18 */
5069 {GTPV2_IE_BEARER_TFT, dissect_gtpv2_bearer_tft}, /* 84, Bearer TFT 8.19 */
5070 {GTPV2_IE_TAD, dissect_gtpv2_tad}, /* 85, Traffic Aggregate Description 8.20 */
5071 {GTPV2_IE_ULI, dissect_gtpv2_uli}, /* 86, User Location Info (ULI) 8.22 */
5072 {GTPV2_IE_F_TEID, dissect_gtpv2_f_teid}, /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
5073 {GTPV2_IE_TMSI, dissect_gtpv2_tmsi}, /* 88, TMSI 8.23 */
5074 {GTPV2_IE_GLOBAL_CNID, dissect_gtpv2_g_cn_id}, /* 89, Global CN-Id 8.25 */
5075 {GTPV2_IE_S103PDF, dissect_gtpv2_s103pdf}, /* 90, S103 PDN Data Forwarding Info (S103PDF) 8.25 */
5076 {GTPV2_IE_S1UDF, dissect_gtpv2_s1udf}, /* 91, S1-U Data Forwarding (S1UDF) 8.26 */
5077 {GTPV2_IE_DEL_VAL, dissect_gtpv2_delay_value}, /* 92, Delay Value 8.29 */
5078 {GTPV2_IE_BEARER_CTX, dissect_gtpv2_bearer_ctx}, /* 93, Bearer Context 8.31 */
5079 {GTPV2_IE_CHAR_ID, dissect_gtpv2_charging_id}, /* 94, Charging Id */
5080 {GTPV2_IE_CHAR_CHAR, dissect_gtpv2_char_char}, /* 95 Charging Characteristic */
5081 {GTPV2_IE_TRA_INFO, dissect_gtpv2_tra_info}, /* 96, Trace Information 8.31 */
5082 {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag}, /* 97, Bearer Flag */
5084 {GTPV2_IE_PDN_TYPE, dissect_gtpv2_pdn_type}, /* 99, PDN Type */
5085 {GTPV2_IE_PTI, dissect_gtpv2_pti}, /* 100, Procedure Transaction Id */
5086 {GTPV2_IE_DRX_PARAM, dissect_gtpv2_drx_param}, /* 101, DRX Parameter 8.36 */
5087 {GTPV2_IE_UE_NET_CAPABILITY, dissect_gtpv2_ue_net_capability}, /* 102, UE network capability 8.37 */
5088 {GTPV2_IE_MM_CONTEXT_GSM_T, dissect_gtpv2_mm_context_gsm_t}, /* 103, MM Context 8.38 GSM Key and Triplets */
5089 {GTPV2_IE_MM_CONTEXT_UTMS_CQ, dissect_gtpv2_mm_context_utms_cq}, /* 104, MM Context 8.38 */
5090 {GTPV2_IE_MM_CONTEXT_GSM_CQ, dissect_gtpv2_mm_context_gsm_cq}, /* 105, MM Context 8.38 */
5091 {GTPV2_IE_MM_CONTEXT_UTMS_Q, dissect_gtpv2_mm_context_utms_q}, /* 106, MM Context 8.38 */
5092 {GTPV2_IE_MM_CONTEXT_EPS_QQ, dissect_gtpv2_mm_context_eps_qq}, /* 107, MM Context 8.38 */
5093 {GTPV2_IE_MM_CONTEXT_UTMS_QQ, dissect_gtpv2_mm_context_utms_qq}, /* 108, MM Context 8.38 */
5094 {GTPV2_IE_PDN_CONNECTION, dissect_gtpv2_PDN_conn}, /* 109, PDN Connection */
5095 {GTPV2_IE_PDN_NUMBERS, dissect_gtpv2_pdn_numbers}, /* 110, PDN Numbers 8.40 */
5096 {GTPV2_IE_P_TMSI, dissect_gtpv2_p_tmsi}, /* 111, P-TMSI 8.41 */
5097 {GTPV2_IE_P_TMSI_SIG, dissect_gtpv2_p_tmsi_sig}, /* 112, P-TMSI Signature 8.42 */
5098 {GTPV2_IE_HOP_COUNTER, dissect_gtpv2_hop_counter}, /* 113, Hop Counter 8.43 */
5099 {GTPV2_IE_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone}, /* 114, UE Time Zone */
5100 {GTPV2_IE_TRACE_REFERENCE, dissect_gtpv2_trace_reference}, /* 115, Trace Reference 8.45 */
5101 {GTPV2_IE_COMPLETE_REQUEST_MSG, dissect_complete_request_msg}, /* 116, Complete Request message 8.46 */
5102 {GTPV2_IE_GUTI, dissect_gtpv2_guti}, /* 117, GUTI 8.47 */
5103 {GTPV2_IE_F_CONTAINER, dissect_gtpv2_F_container}, /* 118, Fully Qualified Container (F-Container) */
5104 {GTPV2_IE_F_CAUSE, dissect_gtpv2_F_cause}, /* 119, Fully Qualified Cause (F-Cause) */
5105 {GTPV2_IE_SEL_PLMN_ID, dissect_gtpv2_sel_plmn_id}, /* 120, Selected PLMN ID 8.50 */
5106 {GTPV2_IE_TARGET_ID, dissect_gtpv2_target_id}, /* 121, Target Identification */
5107 /* 122, Void 8.52 */
5108 {GTPV2_IE_PKT_FLOW_ID, dissect_gtpv2_pkt_flow_id}, /* 123, Packet Flow ID 8.53 */
5109 {GTPV2_IE_RAB_CONTEXT, dissect_gtpv2_rab_context}, /* 124, RAB Context 8.54 */
5110 {GTPV2_IE_S_RNC_PDCP_CTX_INFO, dissect_gtpv2_s_rnc_pdcp_ctx_info}, /* 125, Source RNC PDCP context info 8.55 */
5111 {GTPV2_IE_UDP_S_PORT_NR, dissect_udp_s_port_nr}, /* 126, UDP Source Port Number 8.56 */
5112 {GTPV2_IE_APN_RESTRICTION, dissect_gtpv2_apn_rest}, /* 127, APN Restriction */
5113 {GTPV2_IE_SEL_MODE, dissect_gtpv2_selec_mode}, /* 128, Selection Mode */
5114 {GTPV2_IE_SOURCE_IDENT, dissect_gtpv2_source_ident}, /* 129, Source Identification 8.59 */
5115 {GTPV2_IE_BEARER_CONTROL_MODE, dissect_gtpv2_bearer_control_mode}, /* 130, Bearer Control Mode */
5116 {GTPV2_IE_CNG_REP_ACT , dissect_gtpv2_cng_rep_act}, /* 131, Change Reporting Action 8.61 */
5117 {GTPV2_IE_FQ_CSID, dissect_gtpv2_fq_csid}, /* 132, Fully Qualified PDN Connection Set Identifier (FQ-CSID) 8.62 */
5118 {GTPV2_IE_CHANNEL_NEEDED, dissect_gtpv2_channel_needed}, /* 133, Channel Needed 8.63 */
5119 {GTPV2_IE_EMLPP_PRI, dissect_gtpv2_emlpp_pri}, /* 134, eMLPP Priority 8.64 */
5120 {GTPV2_IE_NODE_TYPE , dissect_gtpv2_node_type}, /* 135, Node Type 8.65 */
5121 {GTPV2_IE_FQDN, dissect_gtpv2_fqdn}, /* 136, 8.66 Fully Qualified Domain Name (FQDN) */
5122 {GTPV2_IE_TI, dissect_gtpv2_ti}, /* 137, 8.68 Transaction Identifier (TI) */
5123 {GTPV2_IE_MBMS_SESSION_DURATION, dissect_gtpv2_mbms_session_duration}, /* 138, 8.69 MBMS Session Duration */
5124 {GTPV2_IE_MBMS_SERVICE_AREA, dissect_gtpv2_mbms_service_area}, /* 139, 8.70 MBMS Service Area */
5125 {GTPV2_IE_MBMS_SESSION_ID, dissect_gtpv2_mbms_session_id}, /* 140, 8.71 MBMS Session Identifier */
5126 {GTPV2_IE_MBMS_FLOW_ID, dissect_gtpv2_mbms_flow_id}, /* 141, 8.72 MBMS Flow Identifier */
5127 {GTPV2_IE_MBMS_IP_MC_DIST, dissect_gtpv2_mbms_ip_mc_dist}, /* 142, 8.73 MBMS IP Multicast Distribution */
5128 {GTPV2_IE_MBMS_DIST_ACK, dissect_gtpv2_mbms_dist_ack}, /* 143, 8.74 MBMS Distribution Acknowledge */
5129 {GTPV2_IE_RFSP_INDEX, dissect_gtpv2_rfsp_index}, /* 144, 8.77 RFSP Index */
5130 {GTPV2_IE_UCI, dissect_gtpv2_uci}, /* 145, 8.75 User CSG Information (UCI) */
5131 {GTPV2_IE_CSG_INFO_REP_ACTION, dissect_gtpv2_csg_info_rep_action}, /* 146, 8.76 CSG Information Reporting Action */
5132 {GTPV2_IE_CSG_ID, dissect_gtpv2_csg_id}, /* 147, 8.78 CSG ID */
5133 {GTPV2_IE_CMI, dissect_gtpv2_cmi}, /* 148, 8.79 CSG Membership Indication (CMI) */
5134 {GTPV2_IE_SERVICE_INDICATOR, dissect_gtpv2_service_indicator}, /* 149, 8.80 Service indicator */
5135 {GTPV2_IE_DETACH_TYPE, dissect_gtpv2_detach_type}, /* 150, 8.81 Detach Type */
5136 {GTPV2_IE_LDN, dissect_gtpv2_ldn}, /* 151, 8.82 Local Distinguished Name (LDN) */
5137 {GTPV2_IE_NODE_FEATURES, dissect_gtpv2_node_features}, /* 152, 8.83 Node Features */
5138 {GTPV2_IE_MBMS_TIME_TO_DATA_XFER, dissect_gtpv2_mbms_time_to_data_xfer}, /* 153, 8.84 MBMS Time to Data Transfer */
5139 {GTPV2_IE_THROTTLING, dissect_gtpv2_throttling}, /* 154, 8.85 Throttling */
5140 {GTPV2_IE_ARP, dissect_gtpv2_arp}, /* 155, 8.86 Allocation/Retention Priority (ARP) */
5141 {GTPV2_IE_EPC_TIMER, dissect_gtpv2_epc_timer}, /* 156, 8.87 EPC Timer */
5142 {GTPV2_IE_SIG_PRIO_IND, dissect_gtpv2_sig_prio_ind}, /* 157, 8.88 Signalling Priority Indication */
5143 {GTPV2_IE_TMGI, dissect_gtpv2_tmgi}, /* 158, 8.89 Temporary Mobile Group Identity (TMGI) */
5144 {GTPV2_IE_ADD_MM_CONT_FOR_SRVCC, dissect_gtpv2_add_mm_cont_for_srvcc}, /* 159, 8.90 Additional MM context for SRVCC */
5145 {GTPV2_IE_ADD_FLAGS_FOR_SRVCC, dissect_gtpv2_add_flags_for_srvcc}, /* 160, 8.91 Additional flags for SRVCC */
5146 {GTPV2_IE_MMBR, dissect_gtpv2_mmbr}, /* 161, 8.92 Max MBR/APN-AMBR (MMBR) */
5147 {GTPV2_IE_MDT_CONFIG, dissect_gtpv2_mdt_config}, /* 162, 8.93 MDT Configuration */
5148 {GTPV2_IE_APCO, dissect_gtpv2_apco}, /* 163, 8.94 Additional Protocol Configuration Options (APCO) */
5149 {GTPV2_IE_ABS_MBMS_DATA_TF_TIME, dissect_gtpv2_abs_mbms_data_tf_time}, /* 164, 8.95 Absolute Time of MBMS Data Transfer */
5150 {GTPV2_IE_HENB_INFO_REPORT, dissect_gtpv2_henb_info_report}, /* 165, 8.96 H(e)NB Information Reporting */
5151 {GTPV2_IE_IP4CP, dissect_gtpv2_ip4cp}, /* 166, 8.97 IPv4 Configuration Parameters (IPv4CP) */
5152 {GTPV2_IE_CHANGE_TO_REPORT_FLAGS, dissect_gtpv2_change_report_flags}, /* 167, 8.98 Change to Report Flags */
5153 {GTPV2_IE_ACTION_INDICATION, dissect_gtpv2_action_indication}, /* 168, 8.99 Action Indication */
5154 /* 169-254 Spare. For future use. FFS */
5155 {GTPV2_IE_PRIVATE_EXT, dissect_gtpv2_private_ext},
5157 {0, dissect_gtpv2_unknown}
5161 dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint offset, guint8 message_type)
5163 proto_tree *ie_tree;
5166 guint8 type, instance;
5170 * Octets 8 7 6 5 4 3 2 1
5173 * 4 CR Spare Instance
5174 * 5-(n+4) IE specific data
5176 while (offset < (gint)tvb_reported_length(tvb)) {
5177 /* Get the type and length */
5179 type = tvb_get_guint8(tvb, offset);
5180 length = tvb_get_ntohs(tvb, offset + 1);
5181 ti = proto_tree_add_text(tree, tvb, offset, 4 + length, "%s : ",
5182 val_to_str_ext_const(type, >pv2_element_type_vals_ext, "Unknown"));
5183 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
5186 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
5190 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
5192 /* CR Spare Instance Octet 4*/
5193 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, ENC_BIG_ENDIAN);
5195 instance = tvb_get_guint8(tvb, offset) & 0x0f;
5196 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
5199 /* TODO: call IE dissector here */
5200 if (type == GTPV2_IE_RESERVED) {
5201 /* Treat IE type zero specal as type zero is used to end the loop in the else branch */
5202 proto_tree_add_text(ie_tree, tvb, offset, length, "IE type Zero is Reserved and should not be used");
5205 /* Loop over the IE dissector list to se if we find an entry;
5206 the last entry will have ie_type=0 breaking the loop */
5207 while (gtpv2_ies[++i].ie_type) {
5208 if (gtpv2_ies[i].ie_type == type)
5211 /* Just give the IE dissector the IE */
5212 ie_tvb = tvb_new_subset_remaining(tvb, offset);
5213 (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, message_type, instance);
5221 dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
5223 proto_tree *gtpv2_tree, *flags_tree;
5224 proto_item *ti, *tf;
5225 guint8 message_type, t_flag, p_flag;
5231 /* Currently we get called from the GTP dissector no need to check the version */
5232 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
5233 col_clear(pinfo->cinfo, COL_INFO);
5235 /* message type is in octet 2 */
5236 message_type = tvb_get_guint8(tvb, 1);
5237 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
5240 p_flag = (tvb_get_guint8(tvb, offset) & 0x10) >> 4;
5241 msg_length = tvb_get_ntohs(tvb, offset + 2);
5242 proto_tree_add_item(tree, proto_gtpv2, tvb, offset, msg_length + 4, ENC_NA);
5245 ti = proto_tree_add_text(tree, tvb, offset, msg_length + 4, "%s",
5246 val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
5247 gtpv2_tree = proto_item_add_subtree(ti, ett_gtpv2);
5249 /* Control Plane GTP uses a variable length header. Control Plane GTP header
5250 * length shall be a multiple of 4 octets.
5251 * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
5252 * Bits 8 7 6 5 4 3 2 1
5253 * Octets 1 Version P T Spare Spare Spare
5255 * 3 Message Length (1st Octet)
5256 * 4 Message Length (2nd Octet)
5257 * m-k(m+3) If T flag is set to 1, then TEID shall be placed into octets 5-8.
5258 * Otherwise, TEID field is not present at all.
5259 * n-(n+2) Sequence Number
5261 * Figure 5.1-1: General format of GTPv2 Header for Control Plane
5263 tf = proto_tree_add_item(gtpv2_tree, hf_gtpv2_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
5264 flags_tree = proto_item_add_subtree(tf, ett_gtpv2_flags);
5267 t_flag = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
5268 proto_tree_add_item(flags_tree, hf_gtpv2_version, tvb, offset, 1, ENC_BIG_ENDIAN);
5269 proto_tree_add_item(flags_tree, hf_gtpv2_p, tvb, offset, 1, ENC_BIG_ENDIAN);
5270 proto_tree_add_item(flags_tree, hf_gtpv2_t, tvb, offset, 1, ENC_BIG_ENDIAN);
5274 proto_tree_add_item(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5277 proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5281 /* Tunnel Endpoint Identifier 4 octets */
5282 proto_tree_add_item(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
5285 /* Sequence Number 3 octets */
5286 proto_tree_add_item(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 3, ENC_BIG_ENDIAN);
5290 proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5294 msg_tvb = tvb_new_subset(tvb, 0, msg_length + 4, msg_length + 4);
5295 dissect_gtpv2_ie_common(msg_tvb, pinfo, gtpv2_tree, offset, message_type);
5297 dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset, message_type);
5300 /* Bit 5 represents a "P" flag. If the "P" flag is set to "0",
5301 * no piggybacked message shall be present. If the "P" flag is set to "1",
5302 * then another GTPv2-C message with its own header and body shall be present
5303 * at the end of the current message.
5306 tvbuff_t *new_p_tvb;
5307 /* Octets 3 to 4 represent the Length field. This field shall indicate the
5308 * length of the message in octets excluding the
5309 * mandatory part of the GTP-C header (the first 4 octets).
5311 new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
5312 col_append_str(pinfo->cinfo, COL_INFO, " / ");
5313 col_set_fence(pinfo->cinfo, COL_INFO);
5314 dissect_gtpv2(new_p_tvb, pinfo, tree);
5320 void proto_register_gtpv2(void)
5322 static hf_register_info hf_gtpv2[] = {
5323 { &hf_gtpv2_reserved,
5324 {"Reserved bit(s)", "gtpv2.reserved",
5325 FT_UINT8, BASE_DEC, NULL, 0x0,
5328 { &hf_gtpv2_spare_half_octet,
5329 {"Spare half octet", "gtpv2.spare_half_octet",
5330 FT_UINT8, BASE_DEC, NULL, 0x0,
5333 { &hf_gtpv2_spare_bits,
5334 {"Spare bit(s)", "gtpv2.spare_bits",
5335 FT_UINT8, BASE_DEC, NULL, 0x0,
5339 {"Flags", "gtpv2.flags",
5340 FT_UINT8, BASE_HEX, NULL, 0x0,
5344 {"Version", "gtpv2.version",
5345 FT_UINT8, BASE_DEC, NULL, 0xe0,
5349 {"Piggybacking flag (P)", "gtpv2.p",
5350 FT_UINT8, BASE_DEC, NULL, 0x10,
5351 "If Piggybacked message is present or not", HFILL}
5354 {"TEID flag (T)", "gtpv2.t",
5355 FT_UINT8, BASE_DEC, NULL, 0x08,
5356 "If TEID field is present or not", HFILL}
5358 { &hf_gtpv2_message_type,
5359 {"Message Type", "gtpv2.message_type",
5360 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_message_type_vals_ext, 0x0,
5363 { &hf_gtpv2_msg_length,
5364 {"Message Length", "gtpv2.msg_lengt",
5365 FT_UINT16, BASE_DEC, NULL, 0x0,
5369 {"Tunnel Endpoint Identifier", "gtpv2.teid",
5370 FT_UINT32, BASE_DEC, NULL, 0x0,
5374 {"Sequence Number", "gtpv2.seq",
5375 FT_UINT32, BASE_DEC, NULL, 0x0,
5379 {"Spare", "gtpv2.spare",
5380 FT_UINT16, BASE_DEC, NULL, 0x0,
5384 {"IE Type", "gtpv2.ie_type",
5385 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
5389 {"IE Length", "gtpv2.ie_len",
5390 FT_UINT16, BASE_DEC, NULL, 0x0,
5391 "length of the information element excluding the first four octets", HFILL}
5394 {"CR flag", "gtpv2.cr",
5395 FT_UINT8, BASE_DEC, NULL, 0xf0, /* SRVCC */
5398 { &hf_gtpv2_instance,
5399 {"Instance", "gtpv2.instance",
5400 FT_UINT8, BASE_DEC, NULL, 0x0f,
5404 {"IMSI(International Mobile Subscriber Identity number)", "gtpv2.imsi",
5405 FT_STRING, BASE_NONE, NULL, 0,
5408 { &hf_gtpv2_ipv4_addr,
5409 {"IPv4 Address", "gtpv2.ipv4_addr",
5410 FT_IPv4, BASE_NONE, NULL, 0x0,
5414 {"Cause", "gtpv2.cause",
5415 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_vals_ext, 0x0,
5418 {&hf_gtpv2_cause_cs,
5419 {"CS (Cause Source)", "gtpv2.cs",
5420 FT_BOOLEAN, 8, TFS(>pv2_cause_cs), 0x01,
5423 { &hf_gtpv2_cause_bce,
5424 {"BCE (Bearer Context IE Error)", "gtpv2.bce",
5425 FT_BOOLEAN, 8, NULL, 0x02,
5428 { &hf_gtpv2_cause_pce,
5429 {"PCE (PDN Connection IE Error)", "gtpv2.pce",
5430 FT_BOOLEAN, 8, NULL, 0x04,
5433 { &hf_gtpv2_cause_off_ie_t,
5434 {"Type of the offending IE", "gtpv2.cause_off_ie_t",
5435 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
5439 {"Restart Counter", "gtpv2.rec",
5440 FT_UINT8, BASE_DEC, NULL, 0x0,
5443 /*Start SRVCC Messages*/
5445 {"STN-SR", "gtpv2.stn_sr",
5446 FT_BYTES, BASE_NONE, NULL, 0x0,
5449 { &hf_gtpv2_len_trans_con,
5450 {"Length of the Transparent Container", "gtpv2.len_trans_con",
5451 FT_UINT8, BASE_DEC, NULL, 0x0,
5455 {"eKSI", "gtpv2.eksi",
5456 FT_UINT8, BASE_DEC, NULL, 0x07,
5461 FT_BYTES, BASE_NONE, NULL, 0x0,
5466 FT_BYTES, BASE_NONE, NULL, 0x0,
5469 { &hf_gtpv2_len_ms_classmark2,
5470 {"Length of Mobile Station Classmark2", "gtpv2.len_ms_classmark2",
5471 FT_UINT8, BASE_DEC, NULL, 0x0,
5474 { &hf_gtpv2_len_ms_classmark3,
5475 {"Length of Mobile Station Classmark3", "gtpv2.len_ms_classmark3",
5476 FT_UINT8, BASE_DEC, NULL, 0x0,
5479 { &hf_gtpv2_len_supp_codec_list,
5480 {"Length of Supported Codec List", "gtpv2.len_supp_codec_list",
5481 FT_UINT8, BASE_DEC, NULL, 0x0,
5485 {"KSI'cs", "gtpv2.ksi",
5486 FT_UINT8, BASE_DEC, NULL, 0x0F,
5490 {"CKSN'", "gtpv2.cksn",
5491 FT_UINT8, BASE_DEC, NULL, 0x0,
5494 { &hf_gtpv2_srvcc_cause,
5495 {"SRVCC Cause", "gtpv2.srvcc_cause",
5496 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_srvcc_cause_vals_ext, 0x0,
5500 { "Routing Area Code (RAC)", "gtpv2.rac",
5501 FT_UINT8, BASE_DEC, NULL, 0,
5502 "Routing Area Code", HFILL}
5506 {"RNC ID", "gtpv2.rnc_id",
5507 FT_UINT16, BASE_DEC, NULL, 0x0,
5510 { &hf_gtpv2_ext_rnc_id,
5511 {"Extended RNC-ID", "gtpv2.ext_rnc_id",
5512 FT_UINT16, BASE_DEC, NULL, 0x0,
5516 { "Location Area Code (LAC)", "gtpv2.lac",
5517 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
5521 { "Service Area Code (SAC)", "gtpv2.sac",
5522 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
5525 { &hf_gtpv2_tgt_g_cell_id,
5526 {"Cell ID", "gtpv2.tgt_g_cell_id",
5527 FT_UINT16, BASE_DEC, NULL, 0x0,
5531 {"Tunnel Endpoint Identifier for Control Plane(TEID-C)", "gtpv2.teid_c",
5532 FT_UINT32, BASE_DEC, NULL, 0x0,
5536 {"STI (Session Transfer Indicator)", "gtpv2.sv_sti",
5537 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5540 {"ICS (IMS Centralized Service)", "gtpv2.sv_ics",
5541 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5543 {&hf_gtpv2_sv_emind,
5544 {"EmInd(Emergency Indicator)", "gtpv2.sv_emind",
5545 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5548 /*End SRVCC Messages*/
5550 {"APN (Access Point Name)", "gtpv2.apn",
5551 FT_STRING, BASE_NONE, NULL, 0x0,
5555 {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
5556 FT_UINT32, BASE_DEC, NULL, 0x0,
5559 {&hf_gtpv2_ambr_down,
5560 {"AMBR Downlink(Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
5561 FT_UINT32, BASE_DEC, NULL, 0x0,
5565 {"EPS Bearer ID (EBI)", "gtpv2.ebi",
5566 FT_UINT8, BASE_DEC, NULL, 0x0f,
5569 { &hf_gtpv2_ip_address_ipv4,
5570 {"IP address IPv4", "gtpv2.ip_address_ipv4",
5571 FT_IPv4, BASE_NONE, NULL, 0x0,
5574 { &hf_gtpv2_ip_address_ipv6,
5575 {"IP address IPv6", "gtpv2.ip_address_ipv6",
5576 FT_IPv6, BASE_NONE, NULL, 0x0,
5580 {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
5581 FT_STRING, BASE_NONE, NULL, 0,
5584 { &hf_gtpv2_pdn_numbers_nsapi,
5585 {"NSAPI", "gtpv2.pdn_numbers_nsapi",
5586 FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}
5589 {"Packet TMSI (P-TMSI)", "gtpv2.p_tmsi",
5590 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
5592 { &hf_gtpv2_p_tmsi_sig,
5593 {"P-TMSI Signature", "gtpv2.p_tmsi_sig",
5594 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
5597 {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
5598 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5601 {"DTF (Direct Tunnel Flag)", "gtpv2.dtf",
5602 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5605 {"HI (Handover Indication)", "gtpv2.hi",
5606 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5609 {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
5610 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5613 {"OI (Operation Indication)", "gtpv2.oi",
5614 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5617 {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
5618 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5621 {"ISRAI (Idle mode Signalling Reduction Activation Indication)", "gtpv2.israi",
5622 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5625 {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
5626 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5629 {"SQCI (Subscribed QoS Change Indication", "gtpv2.sqci",
5630 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5633 {"UIMSI (Unauthenticated IMSI)", "gtpv2.uimsi",
5634 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5637 {"CFSI (Change F-TEID support indication)", "gtpv2.cfsi",
5638 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5641 {"CRSI (Change Reporting support indication):", "gtpv2.crsi",
5642 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5645 {"PS (Piggybacking Supported).)", "gtpv2.ps",
5646 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5649 {"PT (Protocol Type)", "gtpv2.pt",
5650 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5653 {"SI (Scope Indication)", "gtpv2.si",
5654 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5657 {"MSV (MS Validated)", "gtpv2.msv",
5658 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5661 {"Spare", "gtpv2.spare",
5662 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5665 {"Spare", "gtpv2.spare",
5666 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5669 {"Spare", "gtpv2.spare",
5670 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5673 {"S6AF (Static IPv6 Address Flag)", "gtpv2.s6af",
5674 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5677 {"S4AF (Static IPv4 Address Flag))", "gtpv2.s4af",
5678 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5681 {"MBMDT (Management Based MDT allowed flag)", "gtpv2.mbmdt",
5682 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5685 {"ISRAU (ISR is activated for the UE)", "gtpv2.israu",
5686 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5689 {"CCRSI (CSG Change Reporting support indication)", "gtpv2.ccrsi",
5690 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5692 { &hf_gtpv2_pdn_type,
5693 {"PDN Type", "gtpv2.pdn_type",
5694 FT_UINT8, BASE_DEC, VALS(gtpv2_pdn_type_vals), 0x07,
5698 { &hf_gtpv2_tra_info,
5699 {"Trace ID", "gtpv2.tra_info",
5700 FT_STRING, BASE_NONE, NULL, 0x0,
5704 { &hf_gtpv2_tra_info_msc_momt_calls,
5705 {"MO and MT calls", "gtpv2.tra_info_msc_momt_calls",
5706 FT_UINT8, BASE_DEC, NULL, 0x01,
5707 "MSC Server", HFILL}
5709 { &hf_gtpv2_tra_info_msc_momt_sms,
5710 {"MO and MT SMS", "gtpv2.tra_info_msc_momt_sms",
5711 FT_UINT8, BASE_DEC, NULL, 0x02,
5712 "MSC Server", HFILL}
5714 { &hf_gtpv2_tra_info_msc_lu_imsi_ad,
5715 {"LU, IMSI attach, IMSI detach", "gtpv2.tra_info_msc_lu_imsi_ad",
5716 FT_UINT8, BASE_DEC, NULL, 0x04,
5717 "MSC Server", HFILL}
5719 { &hf_gtpv2_tra_info_msc_handovers,
5720 {"Handovers", "gtpv2.tra_info_msc_handovers",
5721 FT_UINT8, BASE_DEC, NULL, 0x08,
5722 "MSC Server", HFILL}
5724 { &hf_gtpv2_tra_info_msc_ss,
5725 {"SS", "gtpv2.tra_info_msc_ss",
5726 FT_UINT8, BASE_DEC, NULL, 0x10,
5727 "MSC Server", HFILL}
5729 { &hf_gtpv2_tra_info_mgw_context,
5730 {"Context", "gtpv2.tra_info_mgw_context",
5731 FT_UINT8, BASE_DEC, NULL, 0x01,
5734 { &hf_gtpv2_tra_info_sgsn_pdp_context,
5735 {"PDP context", "gtpv2.tra_info_sgsn_pdp_context",
5736 FT_UINT8, BASE_DEC, NULL, 0x01,
5739 { &hf_gtpv2_tra_info_sgsn_momt_sms,
5740 {"MO and MT SMS", "gtpv2.tra_info_sgsn_momt_sms",
5741 FT_UINT8, BASE_DEC, NULL, 0x02,
5744 { &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
5745 {"RAU, GPRS attach, GPRS detach", "gtpv2.tra_info_sgsn_rau_gprs_ad",
5746 FT_UINT8, BASE_DEC, NULL, 0x04,
5749 { &hf_gtpv2_tra_info_sgsn_mbms,
5750 {"MBMS Context", "gtpv2.tra_into_sgsn_mbms",
5751 FT_UINT8, BASE_DEC, NULL, 0x08,
5754 { &hf_gtpv2_tra_info_sgsn_reserved,
5755 {"Reserved", "gtpv2.",
5756 FT_UINT8, BASE_DEC, NULL, 0x0,
5759 { &hf_gtpv2_tra_info_ggsn_pdp,
5760 {"PDP Cpntext", "gtpv2.tra_info_ggsn_pdp",
5761 FT_UINT8, BASE_DEC, NULL, 0x01,
5764 { &hf_gtpv2_tra_info_ggsn_mbms,
5765 {"MBMS Context", "gtpv2.tra_info_ggsn_mbms",
5766 FT_UINT8, BASE_DEC, NULL, 0x02,
5769 { &hf_gtpv2_tra_info_bm_sc,
5770 {"MBMS Multicast service activation", "gtpv2.tra_info_bm_sc",
5771 FT_UINT8, BASE_DEC, NULL, 0x01,
5774 { &hf_gtpv2_tra_info_mme_sgw_ss,
5775 {"Session setup", "gtpv2.tra_info_mme_sgw_ss",
5776 FT_UINT8, BASE_DEC, NULL, 0x01,
5779 { &hf_gtpv2_tra_info_mme_sgw_sr,
5780 {"Service Request", "gtpv2.tra_info_mme_sgw_sr",
5781 FT_UINT8, BASE_DEC, NULL, 0x02,
5784 { &hf_gtpv2_tra_info_mme_sgw_iataud,
5785 {"Initial Attach, Tracking area update, Detach", "gtpv2.tra_info_mme_sgw_iataud",
5786 FT_UINT8, BASE_DEC, NULL, 0x04,
5789 { &hf_gtpv2_tra_info_lne_msc_s,
5790 {"MSC-S", "gtpv2.tra_info_lne_msc_s",
5791 FT_UINT8, BASE_DEC, NULL, 0x01,
5792 "List of NE Types", HFILL}
5794 { &hf_gtpv2_tra_info_lne_mgw,
5795 {"MGW", "gtpv2.tra_info_lne_mgw",
5796 FT_UINT8, BASE_DEC, NULL, 0x02,
5797 "List of NE Types", HFILL}
5799 { &hf_gtpv2_tra_info_lne_sgsn,
5800 {"SGSN", "gtpv2.tra_info_lne_sgsn",
5801 FT_UINT8, BASE_DEC, NULL, 0x04,
5802 "List of NE Types", HFILL}
5804 { &hf_gtpv2_tra_info_lne_ggsn,
5805 {"GGSN", "gtpv2.tra_info_lne_ggsn",
5806 FT_UINT8, BASE_DEC, NULL, 0x08,
5807 "List of NE Types", HFILL}
5809 { &hf_gtpv2_tra_info_lne_rnc,
5810 {"RNC", "gtpv2.tra_info_lne_rnc",
5811 FT_UINT8, BASE_DEC, NULL, 0x10,
5812 "List of NE Types", HFILL}
5814 { &hf_gtpv2_tra_info_lne_bm_sc,
5815 {"BM-SC", "gtpv2.tra_info_lne_bm_sc",
5816 FT_UINT8, BASE_DEC, NULL, 0x20,
5817 "List of NE Types", HFILL}
5819 { &hf_gtpv2_tra_info_lne_mme,
5820 {"MME", "gtpv2.tra_info_lne_mme",
5821 FT_UINT8, BASE_DEC, NULL, 0x40,
5822 "List of NE Types", HFILL}
5824 { &hf_gtpv2_tra_info_lne_sgw,
5825 {"SGW", "gtpv2.tra_info_lne_sgw",
5826 FT_UINT8, BASE_DEC, NULL, 0x80,
5827 "List of NE Types", HFILL}
5829 { &hf_gtpv2_tra_info_lne_pdn_gw,
5830 {"PDN GW", "gtpv2.tra_info_lne_pdn_gw",
5831 FT_UINT8, BASE_DEC, NULL, 0x01,
5832 "List of NE Types", HFILL}
5834 { &hf_gtpv2_tra_info_lne_enb,
5835 {"eNB", "gtpv2.tra_info_lne_enb",
5836 FT_UINT8, BASE_DEC, NULL, 0x02,
5837 "List of NE Types", HFILL}
5839 { &hf_gtpv2_tra_info_tdl,
5840 {"Trace Depth Length", "gtpv2.tra_info_tdl",
5841 FT_UINT8, BASE_DEC, NULL, 0x0,
5844 { &hf_gtpv2_tra_info_lmsc_a,
5845 {"A", "gtpv2.tra_info_lmsc_a",
5846 FT_UINT8, BASE_DEC, NULL, 0x01,
5847 "MSC Server", HFILL}
5849 { &hf_gtpv2_tra_info_lmsc_lu,
5850 {"Iu", "gtpv2.tra_info_lmsc_lu",
5851 FT_UINT8, BASE_DEC, NULL, 0x02,
5852 "MSC Server", HFILL}
5854 { &hf_gtpv2_tra_info_lmsc_mc,
5855 {"Mc", "gtpv2.tra_info_lmsc_mc",
5856 FT_UINT8, BASE_DEC, NULL, 0x04,
5857 "MSC Server", HFILL}
5859 { &hf_gtpv2_tra_info_lmsc_map_g,
5860 {"MAP-G", "gtpv2.tra_info_lmsc_map_g",
5861 FT_UINT8, BASE_DEC, NULL, 0x08,
5862 "MSC Server", HFILL}
5864 { &hf_gtpv2_tra_info_lmsc_map_b,
5865 {"MAP-B", "gtpv2.tra_info_lmsc_map_b",
5866 FT_UINT8, BASE_DEC, NULL, 0x10,
5867 "MSC Server", HFILL}
5869 { &hf_gtpv2_tra_info_lmsc_map_e,
5870 {"MAP-E", "gtpv2.tra_info_lmsc_map_e",
5871 FT_UINT8, BASE_DEC, NULL, 0x20,
5872 "MSC Server", HFILL}
5874 { &hf_gtpv2_tra_info_lmsc_map_f,
5875 {"MAP-F", "gtpv2.tra_info_lmsc_map_f",
5876 FT_UINT8, BASE_DEC, NULL, 0x40,
5877 "MSC Server", HFILL}
5879 { &hf_gtpv2_tra_info_lmsc_cap,
5880 {"CAP", "gtpv2.tra_info_lmsc_cap",
5881 FT_UINT8, BASE_DEC, NULL, 0x80,
5882 "MSC Server", HFILL}
5884 { &hf_gtpv2_tra_info_lmsc_map_d,
5885 {"MAP-D", "gtpv2.tra_info_lmsc_map_d",
5886 FT_UINT8, BASE_DEC, NULL, 0x01,
5887 "MSC Server", HFILL}
5889 { &hf_gtpv2_tra_info_lmsc_map_c,
5890 {"MAP-C", "gtpv2.tra_info_lmsc_map_c",
5891 FT_UINT8, BASE_DEC, NULL, 0x02,
5892 "MSC Server", HFILL}
5894 { &hf_gtpv2_tra_info_lmgw_mc,
5895 {"Mc", "gtpv2.tra_info_lmgw_mc",
5896 FT_UINT8, BASE_DEC, NULL, 0x01,
5899 { &hf_gtpv2_tra_info_lmgw_nb_up,
5900 {"Nb-UP", "gtpv2.tra_info_lmgw_nb_up",
5901 FT_UINT8, BASE_DEC, NULL, 0x2,
5904 { &hf_gtpv2_tra_info_lmgw_lu_up,
5905 {"Iu-UP", "gtpv2.tra_info_lmgw_lu_up",
5906 FT_UINT8, BASE_DEC, NULL, 0x04,
5909 { &hf_gtpv2_tra_info_lsgsn_gb,
5910 {"Gb", "gtpv2.tra_info_lsgsn_gb",
5911 FT_UINT8, BASE_DEC, NULL, 0x01,
5914 { &hf_gtpv2_tra_info_lsgsn_lu,
5915 {"Iu", "gtpv2.tra_info_lsgsn_lu",
5916 FT_UINT8, BASE_DEC, NULL, 0x02,
5919 { &hf_gtpv2_tra_info_lsgsn_gn,
5920 {"Gn", "gtpv2.tra_info_lsgsn_gn",
5921 FT_UINT8, BASE_DEC, NULL, 0x04,
5924 { &hf_gtpv2_tra_info_lsgsn_map_gr,
5925 {"MAP-Gr", "gtpv2.tra_info_lsgsn_map_gr",
5926 FT_UINT8, BASE_DEC, NULL, 0x08,
5929 { &hf_gtpv2_tra_info_lsgsn_map_gd,
5930 {"MAP-Gd", "gtpv2.tra_info_lsgsn_map_gd",
5931 FT_UINT8, BASE_DEC, NULL, 0x10,
5934 { &hf_gtpv2_tra_info_lsgsn_map_gf,
5935 {"MAP-Gf", "gtpv2.tra_info_lsgsn_map_gf",
5936 FT_UINT8, BASE_DEC, NULL, 0x20,
5939 { &hf_gtpv2_tra_info_lsgsn_gs,
5940 {"Gs", "gtpv2.tra_info_lsgsn_gs",
5941 FT_UINT8, BASE_DEC, NULL, 0x40,
5944 { &hf_gtpv2_tra_info_lsgsn_ge,
5945 {"Ge", "gtpv2.tra_info_lsgsn_ge",
5946 FT_UINT8, BASE_DEC, NULL, 0x80,
5949 { &hf_gtpv2_tra_info_lggsn_gn,
5950 {"Gn", "gtpv2.tra_info_lggsn_gn",
5951 FT_UINT8, BASE_DEC, NULL, 0x01,
5954 { &hf_gtpv2_tra_info_lggsn_gi,
5955 {"Gi", "gtpv2.tra_info_lggsn_gi",
5956 FT_UINT8, BASE_DEC, NULL, 0x02,
5959 { &hf_gtpv2_tra_info_lggsn_gmb,
5960 {"Gmb", "gtpv2.tra_info_lggsn_gmb",
5961 FT_UINT8, BASE_DEC, NULL, 0x04,
5964 { &hf_gtpv2_tra_info_lrnc_lu,
5965 {"Iu", "gtpv2.tra_info_lrnc_lu",
5966 FT_UINT8, BASE_DEC, NULL, 0x01,
5969 { &hf_gtpv2_tra_info_lrnc_lur,
5970 {"Iur", "gtpv2.tra_info_lrnc_lur",
5971 FT_UINT8, BASE_DEC, NULL, 0x02,
5974 { &hf_gtpv2_tra_info_lrnc_lub,
5975 {"Iub", "gtpv2.tra_info_lrnc_lub",
5976 FT_UINT8, BASE_DEC, NULL, 0x04,
5979 { &hf_gtpv2_tra_info_lrnc_uu,
5980 {"Uu", "gtpv2.tra_info_lrnc_uu",
5981 FT_UINT8, BASE_DEC, NULL, 0x08,
5984 { &hf_gtpv2_tra_info_lbm_sc_gmb,
5985 {"Gmb", "gtpv2.tra_info_lbm_sc_gmb",
5986 FT_UINT8, BASE_DEC, NULL, 0x01,
5989 { &hf_gtpv2_tra_info_lmme_s1_mme,
5990 {"S1-MME", "gtpv2.tra_info_lmme_s1_mme",
5991 FT_UINT8, BASE_DEC, NULL, 0x01,
5994 { &hf_gtpv2_tra_info_lmme_s3,
5995 {"S3", "gtpv2.tra_info_lmme_s3",
5996 FT_UINT8, BASE_DEC, NULL, 0x02,
5999 { &hf_gtpv2_tra_info_lmme_s6a,
6000 {"S6a", "gtpv2.tra_info_lmme_s6a",
6001 FT_UINT8, BASE_DEC, NULL, 0x04,
6004 { &hf_gtpv2_tra_info_lmme_s10,
6005 {"S10", "gtpv2.tra_info_lmme_s10",
6006 FT_UINT8, BASE_DEC, NULL, 0x08,
6009 { &hf_gtpv2_tra_info_lmme_s11,
6010 {"S11", "gtpv2.tra_info_lmme_s11",
6011 FT_UINT8, BASE_DEC, NULL, 0x10,
6014 { &hf_gtpv2_tra_info_lsgw_s4,
6015 {"S4", "gtpv2.tra_info_lsgw_s4",
6016 FT_UINT8, BASE_DEC, NULL, 0x01,
6019 { &hf_gtpv2_tra_info_lsgw_s5,
6020 {"S5", "gtpv2.tra_info_lsgw_s5",
6021 FT_UINT8, BASE_DEC, NULL, 0x02,
6024 { &hf_gtpv2_tra_info_lsgw_s8b,
6025 {"S8b", "gtpv2.tra_info_lsgw_s8b",
6026 FT_UINT8, BASE_DEC, NULL, 0x04,
6029 { &hf_gtpv2_tra_info_lsgw_s11,
6030 {"S11", "gtpv2.tra_info_lsgw_s11",
6031 FT_UINT8, BASE_DEC, NULL, 0x08,
6034 { &hf_gtpv2_tra_info_lpdn_gw_s2a,
6035 {"S2a", "gtpv2.tra_info_lpdn_gw_s2a",
6036 FT_UINT8, BASE_DEC, NULL, 0x01,
6039 { &hf_gtpv2_tra_info_lpdn_gw_s2b,
6040 {"S2b", "gtpv2.tra_info_lpdn_gw_s2b",
6041 FT_UINT8, BASE_DEC, NULL, 0x02,
6044 { &hf_gtpv2_tra_info_lpdn_gw_s2c,
6045 {"S2c", "gtpv2.tra_info_lpdn_gw_s2c",
6046 FT_UINT8, BASE_DEC, NULL, 0x04,
6049 { &hf_gtpv2_tra_info_lpdn_gw_s5,
6050 {"S5", "gtpv2.tra_info_lpdn_gw_s5",
6051 FT_UINT8, BASE_DEC, NULL, 0x08,
6054 { &hf_gtpv2_tra_info_lpdn_gw_s6c,
6055 {"S6c", "gtpv2.tra_info_lpdn_gw_s6c",
6056 FT_UINT8, BASE_DEC, NULL, 0x10,
6059 { &hf_gtpv2_tra_info_lpdn_gw_gx,
6060 {"Gx", "gtpv2.tra_info_lpdn_gw_gx",
6061 FT_UINT8, BASE_DEC, NULL, 0x20,
6064 { &hf_gtpv2_tra_info_lpdn_gw_s8b,
6065 {"S8b", "gtpv2.tra_info_lpdn_gw_s8b",
6066 FT_UINT8, BASE_DEC, NULL, 0x40,
6069 { &hf_gtpv2_tra_info_lpdn_gw_sgi,
6070 {"SGi", "gtpv2.tra_info_lpdn_gw_sgi",
6071 FT_UINT8, BASE_DEC, NULL, 0x80,
6074 { &hf_gtpv2_tra_info_lenb_s1_mme,
6075 {"S1-MME", "gtpv2.tra_info_lenb_s1_mme",
6076 FT_UINT8, BASE_DEC, NULL, 0x01,
6079 { &hf_gtpv2_tra_info_lenb_x2,
6080 {"X2", "gtpv2.tra_info_lenb_x2",
6081 FT_UINT8, BASE_DEC, NULL, 0x02,
6084 { &hf_gtpv2_tra_info_lenb_uu,
6085 {"Uu", "gtpv2.tra_info_lenb_uu",
6086 FT_UINT8, BASE_DEC, NULL, 0x04,
6089 { &hf_gtpv2_pdn_ipv4,
6090 {"PDN Address and Prefix(IPv4)", "gtpv2.pdn_addr_and_prefix.ipv4",
6091 FT_IPv4, BASE_NONE, NULL, 0x0,
6094 { &hf_gtpv2_pdn_ipv6_len,
6095 {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
6096 FT_UINT8, BASE_DEC, NULL, 0x0,
6099 { &hf_gtpv2_pdn_ipv6,
6100 {"PDN Address and Prefix(IPv6)", "gtpv2.pdn_addr_and_prefix.ipv6",
6101 FT_BYTES, BASE_NONE, NULL, 0x0,
6104 /* Bit 1 - PVI (Pre-emption Vulnerability): See 3GPP TS 29.212[29],
6105 * clause 5.3.47 Pre-emption-Vulnerability AVP.
6106 * 5.3.47 Pre-emption-Vulnerability AVP
6107 * The following values are defined:
6108 * PRE-EMPTION_VULNERABILITY_ENABLED (0)
6109 * PRE-EMPTION_VULNERABILITY_DISABLED (1)
6111 {&hf_gtpv2_bearer_qos_pvi,
6112 {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
6113 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
6116 {&hf_gtpv2_bearer_qos_pl,
6117 {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
6118 FT_UINT8, BASE_DEC, NULL, 0x3c,
6121 /* Bit 7 - PCI (Pre-emption Capability): See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP.
6122 * clause 5.3.46 Pre-emption-Capability AVP.
6123 * 5.3.46 Pre-emption-Capability AVP
6124 * The following values are defined:
6125 * PRE-EMPTION_CAPABILITY_ENABLED (0)
6126 * PRE-EMPTION_CAPABILITY_DISABLED (1)
6128 {&hf_gtpv2_bearer_qos_pci,
6129 {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
6130 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
6133 {&hf_gtpv2_bearer_qos_label_qci,
6134 {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
6135 FT_UINT8, BASE_DEC, NULL, 0x0,
6138 {&hf_gtpv2_bearer_qos_mbr_up,
6139 {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
6140 FT_UINT64, BASE_DEC, NULL, 0x0,
6143 {&hf_gtpv2_bearer_qos_mbr_down,
6144 {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
6145 FT_UINT64, BASE_DEC, NULL, 0x0,
6148 {&hf_gtpv2_bearer_qos_gbr_up,
6149 {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
6150 FT_UINT64, BASE_DEC, NULL, 0x0,
6153 {&hf_gtpv2_bearer_qos_gbr_down,
6154 {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
6155 FT_UINT64, BASE_DEC, NULL, 0x0,
6158 {&hf_gtpv2_flow_qos_label_qci,
6159 {"Label (QCI)", "gtpv2.flow_qos_label_qci",
6160 FT_UINT8, BASE_DEC, NULL, 0x0,
6163 {&hf_gtpv2_flow_qos_mbr_up,
6164 {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
6165 FT_UINT64, BASE_DEC, NULL, 0x0,
6168 {&hf_gtpv2_flow_qos_mbr_down,
6169 {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
6170 FT_UINT64, BASE_DEC, NULL, 0x0,
6173 {&hf_gtpv2_flow_qos_gbr_up,
6174 {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
6175 FT_UINT64, BASE_DEC, NULL, 0x0,
6178 {&hf_gtpv2_flow_qos_gbr_down,
6179 {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
6180 FT_UINT64, BASE_DEC, NULL, 0x0,
6183 { &hf_gtpv2_rat_type,
6184 {"RAT Type", "gtpv2.rat_type",
6185 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_rat_type_vals_ext, 0x0,
6188 { &hf_gtpv2_uli_ecgi_flg,
6189 {"ECGI Present Flag", "gtpv2.uli_ecgi_flg",
6190 FT_BOOLEAN, 8, NULL, GTPv2_ULI_ECGI_MASK,
6193 { &hf_gtpv2_uli_lai_flg,
6194 {"LAI Present Flag", "gtpv2.uli_lai_flg",
6195 FT_BOOLEAN, 8, NULL, GTPv2_ULI_LAI_MASK,
6198 { &hf_gtpv2_uli_tai_flg,
6199 {"TAI Present Flag", "gtpv2.uli_tai_flg",
6200 FT_BOOLEAN, 8, NULL, GTPv2_ULI_TAI_MASK,
6203 { &hf_gtpv2_uli_rai_flg,
6204 {"RAI Present Flag", "gtpv2.uli_rai_flg",
6205 FT_BOOLEAN, 8, NULL, GTPv2_ULI_RAI_MASK,
6208 { &hf_gtpv2_uli_sai_flg,
6209 {"SAI Present Flag", "gtpv2.uli_sai_flg",
6210 FT_BOOLEAN, 8, NULL, GTPv2_ULI_SAI_MASK,
6213 { &hf_gtpv2_uli_cgi_flg,
6214 {"CGI Present Flag", "gtpv2.uli_cgi_flg",
6215 FT_BOOLEAN, 8, NULL, GTPv2_ULI_CGI_MASK,
6219 {"Geographic Location Type", "gtpv2.glt",
6220 FT_UINT8, BASE_DEC, VALS(geographic_location_type_vals), 0x0,
6223 { &hf_gtpv2_uli_cgi_lac,
6224 {"Location Area Code", "gtpv2.uli_cgi_lac",
6225 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6228 { &hf_gtpv2_uli_cgi_ci,
6229 {"Cell Identity", "gtpv2.uli_cgi_ci",
6230 FT_UINT16, BASE_DEC, NULL, 0x0,
6233 { &hf_gtpv2_uli_sai_lac,
6234 {"Location Area Code", "gtpv2.uli_sai_lac",
6235 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6238 { &hf_gtpv2_uli_sai_sac,
6239 {"Service Area Code", "gtpv2.uli_sai_sac",
6240 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6243 { &hf_gtpv2_uli_rai_lac,
6244 {"Location Area Code", "gtpv2.uli_rai_lac",
6245 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6248 { &hf_gtpv2_uli_rai_rac,
6249 {"Routing Area Code", "gtpv2.uli_rai_rac",
6250 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6253 { &hf_gtpv2_uli_tai_tac,
6254 {"Tracking Area Code", "gtpv2.uli_tai_tac",
6255 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6258 {&hf_gtpv2_uli_ecgi_eci,
6259 {"ECI (E-UTRAN Cell Identifier)", "gtpv2.uli_ecgi_eci",
6260 FT_UINT32, BASE_DEC, NULL, 0x0,
6263 {&hf_gtpv2_uli_lai_lac,
6264 {"Location Area Code (LAC)", "gtpv2.uli_lai_lac",
6265 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6268 {&hf_gtpv2_uli_ecgi_eci_spare,
6269 {"Spare", "gtpv2.uli_ecgi_eci_spare",
6270 FT_UINT8, BASE_DEC, NULL, 0x0,
6274 {"NSAPI", "gtpv2.nsapi",
6275 FT_UINT8, BASE_DEC, NULL, 0x0f,
6278 {&hf_gtpv2_f_teid_v4,
6279 {"V4", "gtpv2.f_teid_v4",
6280 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v4_vals), 0x80,
6283 {&hf_gtpv2_f_teid_v6,
6284 {"V6", "gtpv2.f_teid_v6",
6285 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v6_vals), 0x40,
6288 {&hf_gtpv2_f_teid_interface_type,
6289 {"Interface Type", "gtpv2.f_teid_interface_type",
6290 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_f_teid_interface_type_vals_ext, 0x3f,
6293 {&hf_gtpv2_f_teid_gre_key,
6294 {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
6295 FT_UINT32, BASE_HEX, NULL, 0x0,
6298 { &hf_gtpv2_f_teid_ipv4,
6299 {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
6300 FT_IPv4, BASE_NONE, NULL, 0x0,
6303 { &hf_gtpv2_f_teid_ipv6,
6304 {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
6305 FT_IPv6, BASE_NONE, NULL, 0x0,
6309 {"TMSI", "gtpv2.tmsi",
6310 FT_UINT32, BASE_HEX, NULL, 0x0,
6313 { &hf_gtpv2_hsgw_addr_f_len,
6314 {"HSGW Address for forwarding Length", "gtpv2.hsgw_addr_f_len",
6315 FT_UINT8, BASE_DEC, NULL, 0x0,
6318 { &hf_gtpv2_hsgw_addr_ipv4,
6319 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv4",
6320 FT_IPv4, BASE_NONE, NULL, 0x0,
6323 { &hf_gtpv2_hsgw_addr_ipv6,
6324 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv6",
6325 FT_IPv6, BASE_NONE, NULL, 0x0,
6328 { &hf_gtpv2_gre_key,
6329 {"GRE Key", "gtpv2.gre_key",
6330 FT_UINT32, BASE_DEC, NULL, 0x0,
6333 { &hf_gtpv2_sgw_addr_ipv4,
6334 {"Serving GW Address", "gtpv2.sgw_addr_ipv4",
6335 FT_IPv4, BASE_NONE, NULL, 0x0,
6338 { &hf_gtpv2_sgw_addr_ipv6,
6339 {"Serving GW Address", "gtpv2.sgw_addr_ipv6",
6340 FT_IPv6, BASE_NONE, NULL, 0x0,
6343 { &hf_gtpv2_sgw_s1u_teid,
6344 {"Serving GW S1-U TEID", "gtpv2.sgw_s1u_teid",
6345 FT_UINT32, BASE_HEX, NULL, 0x0,
6348 {&hf_gtpv2_delay_value,
6349 {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
6350 FT_UINT8, BASE_DEC, NULL, 0x0,
6353 {&hf_gtpv2_charging_id,
6354 {"Charging id", "gtpv2.charging_id",
6355 FT_UINT32, BASE_DEC, NULL, 0x0,
6358 {&hf_gtpv2_charging_characteristic,
6359 {"Charging Characteristic", "gtpv2.charging_characteristic",
6360 FT_UINT16, BASE_HEX, NULL, 0xffff,
6363 {&hf_gtpv2_bearer_flag_ppc,
6364 {"PPC (Prohibit Payload Compression)", "gtpv2.bearer_flag.ppc",
6365 FT_BOOLEAN, 8, NULL, 0x01,
6368 {&hf_gtpv2_bearer_flag_vb,
6369 {"VB (Voice Bearer)", "gtpv2.bearer_flag.vb",
6370 FT_BOOLEAN, 8, NULL, 0x02,
6374 {"Procedure Transaction Id", "gtpv2.pti",
6375 FT_UINT8, BASE_DEC, NULL, 0x0,
6379 { &hf_gtpv2_mm_context_sm,
6380 {"Security Mode", "gtpv2.mm_context_sm",
6381 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_security_mode), 0xe0,
6384 { &hf_gtpv2_mm_context_nhi,
6385 {"NHI(Next Hop Indicator)", "gtpv2.mm_context_nhi",
6386 FT_BOOLEAN, 8, TFS(>pv2_nhi_vals), 0x10,
6389 { &hf_gtpv2_mm_context_drxi,
6390 {"DRXI", "gtpv2.mm_context_drxi",
6391 FT_UINT8, BASE_DEC, NULL, 0x08,
6394 { &hf_gtpv2_mm_context_cksn,
6395 {"CKSN", "gtpv2.mm_context_cksn",
6396 FT_UINT8, BASE_DEC, NULL, 0x07,
6399 { &hf_gtpv2_mm_context_cksn_ksi,
6400 {"CKSN/KSI", "gtpv2.mm_context_cksn_ksi",
6401 FT_UINT8, BASE_DEC, NULL, 0x07,
6404 { &hf_gtpv2_mm_context_ksi_a,
6405 {"KSI_asme", "gtpv2.mm_context_ksi_a",
6406 FT_UINT8, BASE_DEC, NULL, 0x07,
6409 { &hf_gtpv2_mm_context_nr_tri,
6410 {"Number of Triplet", "gtpv2.mm_context_nr_tri",
6411 FT_UINT8, BASE_DEC, NULL, 0xe0,
6414 { &hf_gtpv2_mm_context_used_cipher,
6415 {"Used Cipher", "gtpv2.mm_context_used_cipher",
6416 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_used_cipher_vals), 0x07,
6419 { &hf_gtpv2_mm_context_unipa,
6420 {"Used NAS integrity protection algorithm", "gtpv2.mm_context_unipa",
6421 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unipa_vals), 0x70,
6425 { &hf_gtpv2_mm_context_unc,
6426 {"Used NAS Cipher", "gtpv2.mm_context_unc",
6427 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unc_vals), 0x0f,
6430 { &hf_gtpv2_mm_context_nas_dl_cnt,
6431 {"NAS Downlink Count", "gtpv2.mm_context_nas_dl_cnt",
6432 FT_UINT24, BASE_DEC, NULL, 0x0,
6435 { &hf_gtpv2_mm_context_nas_ul_cnt,
6436 {"NAS Uplink Count", "gtpv2.mm_context_nas_ul_cnt",
6437 FT_UINT24, BASE_DEC, NULL, 0x0,
6440 { &hf_gtpv2_mm_context_kasme,
6441 {"Kasme", "gtpv2.mm_context_kasme",
6442 FT_BYTES, BASE_NONE, NULL, 0x0,
6445 { &hf_gtpv2_mm_context_rand,
6446 {"RAND", "gtpv2.mm_context_rand",
6447 FT_BYTES, BASE_NONE, NULL, 0x0,
6450 { &hf_gtpv2_mm_context_xres_len,
6451 {"XRES Length", "gtpv2.mm_context_xres_len",
6452 FT_UINT8, BASE_DEC, NULL, 0x0,
6455 { &hf_gtpv2_mm_context_xres,
6456 {"XRES", "gtpv2.mm_context_xres",
6457 FT_BYTES, BASE_NONE, NULL, 0x0,
6460 { &hf_gtpv2_mm_context_autn_len,
6461 {"AUTN Length", "gtpv2.mm_context_autn_len",
6462 FT_UINT8, BASE_DEC, NULL, 0x0,
6465 { &hf_gtpv2_mm_context_autn,
6466 {"AUTN", "gtpv2.mm_context_autn",
6467 FT_BYTES, BASE_NONE, NULL, 0x0,
6470 { &hf_gtpv2_mm_context_drx,
6471 {"DRX", "gtpv2.mm_context_drx",
6472 FT_UINT16, BASE_HEX, NULL, 0x0,
6475 { &hf_gtpv2_vdp_length,
6476 {"VDP and UE's Usage Setting length", "gtpv2.vdp_length",
6477 FT_UINT8, BASE_DEC, NULL, 0x0,
6481 { &hf_gtpv2_mm_context_ue_net_cap_len,
6482 {"Length of UE Network Capability", "gtpv2.mm_context_ue_net_cap_len",
6483 FT_UINT8, BASE_DEC, NULL, 0x0,
6486 { &hf_gtpv2_mm_context_ms_net_cap_len,
6487 {"Length of MS Network Capability", "gtpv2.mm_context_ms_net_cap_len",
6488 FT_UINT8, BASE_DEC, NULL, 0x0,
6491 { &hf_gtpv2_mm_context_mei_len,
6492 {"Length of Mobile Equipment Identity (MEI)", "gtpv2.mm_context_mei_len",
6493 FT_UINT8, BASE_DEC, NULL, 0x0,
6496 { &hf_gtpv2_mm_context_vdp_len,
6497 {"Length of Voice Domain Preference and UE's Usage Setting", "gtpv2.mm_context_vdp_len",
6498 FT_UINT8, BASE_DEC, NULL, 0x0,
6502 { "UTRAN", "gtpv2.mm_context.una",
6503 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x01,
6507 { "GERAN", "gtpv2.mm_context.gena",
6508 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x02,
6512 { "GAN", "gtpv2.mm_context.gana",
6513 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x04,
6517 { "I-HSPA-EVOLUTION", "gtpv2.mm_context.ina",
6518 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x08,
6522 { "E-UTRAN", "gtpv2.mm_context.ena",
6523 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x10,
6527 { "HO-toNone3GPP-Access", "gtpv2.mm_context.hnna",
6528 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x20,
6531 { &hf_gtpv2_mm_context_ksi,
6532 {"KSI", "gtpv2.mm_context_ksi",
6533 FT_UINT8, BASE_DEC, NULL, 0x07,
6536 { &hf_gtpv2_mm_context_nr_qui,
6537 {"Number of Quintuplets", "gtpv2.mm_context_nr_qui",
6538 FT_UINT8, BASE_DEC, NULL, 0xe0,
6542 { &hf_gtpv2_mm_context_nr_qua,
6543 {"Number of Quadruplet", "gtpv2.mm_context_nr_qua",
6544 FT_UINT8, BASE_DEC, NULL, 0x1c,
6547 { &hf_gtpv2_mm_context_uamb_ri,
6548 {"UAMB RI", "gtpv2.mm_context_uamb_ri",
6549 FT_BOOLEAN, 8, NULL, 0x02,
6552 { &hf_gtpv2_mm_context_osci,
6553 {"OSCI", "gtpv2.mm_context_osci",
6554 FT_BOOLEAN, 8, NULL, 0x02,
6557 { &hf_gtpv2_mm_context_samb_ri,
6558 {"SAMB RI", "gtpv2.mm_context_samb_ri",
6559 FT_BOOLEAN, 8, NULL, 0x0,
6562 { &hf_gtpv2_ue_time_zone_dst,
6563 {"Daylight Saving Time", "gtpv2.ue_time_zone_dst",
6564 FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals), 0x03,
6567 { &hf_gtpv2_fq_csid_type,
6568 {"Node-ID Type", "gtpv2.fq_csid_type",
6569 FT_UINT8, BASE_DEC, NULL, 0xf0,
6572 { &hf_gtpv2_fq_csid_nr,
6573 {"Number of CSIDs", "gtpv2.fq_csid_nr",
6574 FT_UINT8, BASE_DEC, NULL, 0x0f,
6577 { &hf_gtpv2_fq_csid_ipv4,
6578 {"Node-ID (IPv4)", "gtpv2.fq_csid_ipv4",
6579 FT_IPv4, BASE_NONE, NULL, 0x0,
6582 { &hf_gtpv2_fq_csid_ipv6,
6583 {"Node-ID (IPv6)", "gtpv2.fq_csid_ipv6",
6584 FT_IPv6, BASE_NONE, NULL, 0x0,
6587 { &hf_gtpv2_fq_csid_id,
6588 {"CSID", "gtpv2.fq_csid_id",
6589 FT_UINT16, BASE_DEC, NULL, 0x0,
6592 { &hf_gtpv2_complete_req_msg_type,
6593 {"Complete Request Message Type", "gtpv2.complete_req_msg_type",
6594 FT_UINT8, BASE_DEC, VALS(gtpv2_complete_req_msg_type_vals), 0x0,
6597 {&hf_gtpv2_mme_grp_id,
6598 {"MME Group ID", "gtpv2.mme_grp_id",
6599 FT_UINT16, BASE_DEC, NULL, 0x0,
6602 { &hf_gtpv2_mme_code,
6603 {"MME Code", "gtpv2.mme_code",
6604 FT_UINT8, BASE_DEC, NULL, 0x0,
6608 {"M-TMSI", "gtpv2.m_tmsi",
6609 FT_BYTES, BASE_NONE, NULL, 0x0,
6612 { &hf_gtpv2_container_type,
6613 {"Container Type", "gtpv2.container_type",
6614 FT_UINT8, BASE_DEC, VALS(gtpv2_container_type_vals), 0x0f,
6617 { &hf_gtpv2_cause_type,
6618 {"Cause Type", "gtpv2.cause_type",
6619 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_type_vals_ext, 0x0f,
6622 { &hf_gtpv2_CauseRadioNetwork,
6623 {"Radio Network Layer Cause", "gtpv2.CauseRadioNetwork",
6624 FT_UINT8, BASE_DEC, VALS(s1ap_CauseRadioNetwork_vals), 0x0,
6627 { &hf_gtpv2_CauseTransport,
6628 {"Transport Layer Cause", "gtpv2.CauseTransport",
6629 FT_UINT8, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0x0,
6632 { &hf_gtpv2_CauseNas,
6633 {"NAS Cause", "gtpv2.CauseNas",
6634 FT_UINT8, BASE_DEC, VALS(s1ap_CauseNas_vals), 0x0,
6637 { &hf_gtpv2_CauseMisc,
6638 {"Miscellaneous Cause", "gtpv2.CauseMisc",
6639 FT_UINT8, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0x0,
6642 { &hf_gtpv2_target_type,
6643 {"Target Type", "gtpv2.target_type",
6644 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_target_type_vals_ext, 0x0,
6647 {&hf_gtpv2_macro_enodeb_id,
6648 {"Macro eNodeB ID", "gtpv2.macro_enodeb_id",
6649 FT_UINT24, BASE_HEX, NULL, 0x0fffff,
6652 { &hf_gtpv2_CauseProtocol,
6653 {"Protocol Cause", "gtpv2.CauseProtocol",
6654 FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0,
6657 {&hf_gtpv2_apn_rest,
6658 {"APN Restriction", "gtpv2.apn_rest",
6659 FT_UINT8, BASE_DEC, NULL, 0x0,
6662 {&hf_gtpv2_selec_mode,
6663 {"Selection Mode", "gtpv2.selec_mode",
6664 FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals), 0x03,
6667 { &hf_gtpv2_source_type,
6668 {"Source Type", "gtpv2.source_type",
6669 FT_UINT8, BASE_DEC, NULL, 0x0,
6672 {&hf_gtpv2_bearer_control_mode,
6673 {"Bearer Control Mode", "gtpv2.bearer_control_mode",
6674 FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals), 0x0,
6677 { &hf_gtpv2_cng_rep_act,
6678 {"Change Reporting Action", "gtpv2.cng_rep_act",
6679 FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
6682 { &hf_gtpv2_node_type,
6683 {"Node Type", "gtpv2.node_type",
6684 FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
6688 {"FQDN", "gtpv2.fqdn",
6689 FT_STRING, BASE_NONE, NULL, 0x0,
6692 { &hf_gtpv2_enterprise_id,
6693 {"Enterprise ID", "gtpv2.enterprise_id",
6694 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
6697 { &hf_gtpv2_address_digits,
6698 { "Address digits", "gtpv2.address_digits",
6699 FT_STRING, BASE_NONE, NULL, 0,
6703 {"Transaction Identifier", "gtpv2.ti",
6704 FT_BYTES, BASE_NONE, NULL, 0x0,
6707 { &hf_gtpv2_bss_container_phx,
6708 {"PHX", "gtpv2.bss_cont.phx",
6709 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
6712 { &hf_gtpv2_bss_con_sapi_flg,
6713 {"SAPI", "gtpv2.bss_cont.sapi_flg",
6714 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
6717 { &hf_gtpv2_bss_con_rp_flg,
6718 {"RP", "gtpv2.bss_cont.rp_flg",
6719 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
6722 { &hf_gtpv2_bss_con_pfi_flg,
6723 {"PFI", "gtpv2.bss_cont.pfi_flg",
6724 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
6727 { &hf_gtpv2_bss_con_pfi,
6728 {"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
6729 FT_UINT8, BASE_DEC, NULL, 0x0,
6732 { &hf_gtpv2_bss_con_rp,
6733 {"Radio Priority(RP)", "gtpv2.bss_cont.rp",
6734 FT_UINT8, BASE_DEC, NULL, 0x07,
6737 { &hf_gtpv2_bss_con_sapi,
6738 {"SAPI", "gtpv2.bss_cont.sapi",
6739 FT_UINT8, BASE_DEC, NULL, 0xf0,
6742 { &hf_gtpv2_bss_con_xid_len,
6743 {"XiD parameters length", "gtpv2.bss_cont.xid_len",
6744 FT_UINT8, BASE_DEC, NULL, 0x0,
6747 { &hf_gtpv2_bss_con_xid,
6748 {"XiD parameters", "gtpv2.bss_cont.xid",
6749 FT_BYTES, BASE_NONE, NULL, 0x0,
6752 { &hf_gtpv2_home_enodeb_id,
6753 {"Home eNodeB ID", "gtpv2.home_enodeb_id",
6754 FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
6758 {"Tracking Area Code (TAC)", "gtpv2.tac",
6759 FT_UINT16, BASE_DEC, NULL, 0x0,
6762 { &hf_gtpv2_mbms_service_area_nr,
6763 {"Number of MBMS Service Area codes", "gtpv2.mbms_service_area_nr",
6764 FT_UINT16, BASE_DEC, NULL, 0x0,
6767 { &hf_gtpv2_mbms_service_area_id,
6768 {"MBMS Service Area code (Service Area Identity)", "gtpv2.mbms_service_area_id",
6769 FT_UINT16, BASE_DEC, NULL, 0x0,
6772 { &hf_gtpv2_mbms_session_id,
6773 {"MBMS Session Identifier", "gtpv2.mbms_session_id",
6774 FT_BYTES, BASE_NONE, NULL, 0x0,
6777 { &hf_gtpv2_mbms_flow_id,
6778 {"MBMS Flow Identifier", "gtpv2.mbms_flow_id",
6779 FT_BYTES, BASE_NONE, NULL, 0x0,
6783 {"Common Tunnel Endpoint Identifier", "gtpv2.cetid",
6784 FT_UINT32, BASE_DEC, NULL, 0x0,
6787 { &hf_gtpv2_ip_addr_type,
6788 {"IP Address Type", "gtpv2.ip_addr_type",
6789 FT_UINT8, BASE_DEC, NULL, 0xc0,
6792 { &hf_gtpv2_ip_addr_len,
6793 {"IP Address Length", "gtpv2.ip_addr_len",
6794 FT_UINT8, BASE_DEC, NULL, 0x3f,
6797 { &hf_gtpv2_mbms_ip_mc_dist_addrv4,
6798 {"MBMS IP Multicast Distribution Address (IPv4)", "gtpv2.mbms_ip_mc_dist_addrv4",
6799 FT_IPv4, BASE_NONE, NULL, 0x0,
6802 { &hf_gtpv2_mbms_ip_mc_dist_addrv6,
6803 {"MBMS IP Multicast Distribution Address (IPv6)", "gtpv2.mbms_ip_mc_dist_addrv6",
6804 FT_IPv6, BASE_NONE, NULL, 0x0,
6807 { &hf_gtpv2_mbms_ip_mc_src_addrv4,
6808 {"MBMS IP Multicast Source Address (IPv4)", "gtpv2.mbms_ip_mc_src_addrv4",
6809 FT_IPv4, BASE_NONE, NULL, 0x0,
6812 { &hf_gtpv2_mbms_ip_mc_src_addrv6,
6813 {"MBMS IP Multicast Source Address (IPv6)", "gtpv2.mbms_ip_mc_src_addrv6",
6814 FT_IPv6, BASE_NONE, NULL, 0x0,
6817 { &hf_gtpv2_mbms_hc_indicator,
6818 {"MBMS HC Indicator", "gtpv2.mbms_hc_indicator",
6819 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_hc_indicator_vals), 0x0,
6822 { &hf_gtpv2_mbms_dist_indication,
6823 {"MBMS Distribution Indication", "gtpv2.mbms_dist_indication",
6824 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_dist_indication_vals), 0x03,
6827 { &hf_gtpv2_subscriber_rfsp,
6828 {"Subscribed RFSP Index", "gtpv2.subscriber_rfsp",
6829 FT_INT16, BASE_DEC, NULL, 0x0,
6832 { &hf_gtpv2_rfsp_inuse,
6833 {"RFSP Index in Use", "gtpv2.rfsp_inuse",
6834 FT_INT16, BASE_DEC, NULL, 0x0,
6837 { &hf_gtpv2_mbms_service_id,
6838 {"MBMS Service ID", "gtpv2.mbms_service_id",
6839 FT_BYTES, BASE_NONE, NULL, 0x0,
6842 { &hf_gtpv2_add_flags_for_srvcc_ics,
6843 {"ICS (IMS Centralized Service)", "gtpv2.add_flags_for_srvcc_ics",
6844 FT_BOOLEAN, 8, NULL, 0x01,
6847 { &hf_gtpv2_vsrvcc_flag,
6848 {"VF (vSRVCC Flag)", "gtpv2.vsrvcc_flag",
6849 FT_BOOLEAN, 8, NULL, 0x02,
6852 { &hf_gtpv2_henb_info_report_fti,
6853 {"FTI", "gtpv2.henb_info_report_fti",
6854 FT_BOOLEAN, 8, TFS(>pv2_henb_info_report_fti_vals), 0x01,
6857 { &hf_gtpv2_ip4cp_subnet_prefix_len,
6858 {"Subnet Prefix Length", "gtpv2.ip4cp_subnet_prefix_len",
6859 FT_UINT8, BASE_DEC, NULL, 0x0,
6862 { &hf_gtpv2_ip4cp_ipv4,
6863 {"IPv4 Default Router Address", "gtpv2.ip4cp_ipv4",
6864 FT_IPv4, BASE_NONE, NULL, 0x0,
6867 { &hf_gtpv2_change_report_flags_sncr,
6868 {"SNCR (Service Network Change to Report)", "gtpv2.change_report_flags_sncr",
6869 FT_BOOLEAN, 8, NULL, 0x01,
6872 { &hf_gtpv2_change_report_flags_tzcr,
6873 {"TZCR (Time Zone Change to Report)", "gtpv2.change_report_flags_tzcr",
6874 FT_BOOLEAN, 8, NULL, 0x02,
6877 {&hf_gtpv2_action_indication_val,
6878 {"Action Indication", "gtpv2.action_indication_val",
6879 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_action_indication_vals_ext, 0x07,
6882 { &hf_gtpv2_abs_time_mbms_data,
6883 {"Absolute Time of MBMS Data Transfer", "gtpv2.abs_time_mbms_data",
6884 FT_STRING, BASE_NONE, NULL, 0,
6887 { &hf_gtpv2_mbms_session_duration_days,
6888 {"MBMS Session Duration (days)", "gtpv2.mbms_session_duration_days",
6889 FT_UINT24, BASE_DEC, NULL, 0x00007F,
6892 { &hf_gtpv2_mbms_session_duration_secs,
6893 {"MBMS Session Duration (seconds)", "gtpv2.mbms_session_duration_secs",
6894 FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
6897 { &hf_gtpv2_node_features_prn,
6898 {"PGW Restart Notification (PRN)", "gtpv2.node_features_prn",
6899 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
6902 { &hf_gtpv2_node_features_mabr,
6903 {"Modify Access Bearers Request (MABR)", "gtpv2.node_features_mabr",
6904 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
6907 { &hf_gtpv2_node_features_ntsr,
6908 {"Network Triggered Service Restoration (NTSR)", "gtpv2.node_features_ntsr",
6909 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
6912 { &hf_gtpv2_time_to_data_xfer,
6913 {"MBMS Time to Data Transfer", "gtpv2.time_to_data_xfer",
6914 FT_STRING, BASE_NONE, NULL, 0,
6917 { &hf_gtpv2_arp_pvi,
6918 {"Pre-emption Vulnerability (PVI)", "gtpv2.arp_pvi",
6919 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
6923 {"Priority Level", "gtpv2.arp_pl",
6924 FT_UINT8, BASE_DEC, NULL, 0x3c,
6927 { &hf_gtpv2_arp_pci,
6928 {"Pre-emption Capability (PCI)", "gtpv2.arp_pci",
6929 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
6932 { &hf_gtpv2_timer_unit,
6933 {"Timer unit", "gtpv2.timer_unit",
6934 FT_UINT8, BASE_DEC, VALS(gtpv2_timer_unit_vals), 0xe0,
6937 { &hf_gtpv2_timer_value,
6938 {"Timer value", "gtpv2.timer_value",
6939 FT_UINT8, BASE_DEC, NULL, 0x1f,
6943 {"LAPI (Low Access Priority Indication)", "gtpv2.lapi",
6944 FT_BOOLEAN, 8, NULL, 0x01,
6947 { &hf_gtpv2_mm_context_higher_br_16mb_flg_len,
6948 {"Length of Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg_len",
6949 FT_UINT8, BASE_DEC, NULL, 0x0,
6952 { &hf_gtpv2_mm_context_higher_br_16mb_flg,
6953 {"Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg",
6954 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_higher_br_16mb_flg_vals), 0x0,
6957 { &hf_gtpv2_mmbr_ul,
6958 {"Max MBR/APN-AMBR for uplink", "gtpv2.mmbr_ul",
6959 FT_UINT32, BASE_DEC, NULL, 0x0,
6962 { &hf_gtpv2_mmbr_dl,
6963 {"Max MBR/APN-AMBR for downlink", "gtpv2.mmbr_dl",
6964 FT_UINT32, BASE_DEC, NULL, 0x0,
6969 static gint *ett_gtpv2_array[] = {
6973 &ett_gtpv2_uli_flags,
6974 &ett_gtpv2_uli_field,
6975 &ett_gtpv2_bearer_ctx,
6976 &ett_gtpv2_PDN_conn,
6977 &ett_gtpv2_mm_context_flag,
6978 &ett_gtpv2_pdn_numbers_nsapi,
6979 &ett_gtpv2_tra_info_trigg,
6980 &ett_gtpv2_tra_info_trigg_msc_server,
6981 &ett_gtpv2_tra_info_trigg_mgw,
6982 &ett_gtpv2_tra_info_trigg_sgsn,
6983 &ett_gtpv2_tra_info_trigg_ggsn,
6984 &ett_gtpv2_tra_info_trigg_bm_sc,
6985 &ett_gtpv2_tra_info_trigg_sgw_mme,
6986 &ett_gtpv2_tra_info_interfaces,
6987 &ett_gtpv2_tra_info_interfaces_imsc_server,
6988 &ett_gtpv2_tra_info_interfaces_lmgw,
6989 &ett_gtpv2_tra_info_interfaces_lsgsn,
6990 &ett_gtpv2_tra_info_interfaces_lggsn,
6991 &ett_gtpv2_tra_info_interfaces_lrnc,
6992 &ett_gtpv2_tra_info_interfaces_lbm_sc,
6993 &ett_gtpv2_tra_info_interfaces_lmme,
6994 &ett_gtpv2_tra_info_interfaces_lsgw,
6995 &ett_gtpv2_tra_info_interfaces_lpdn_gw,
6996 &ett_gtpv2_tra_info_interfaces_lpdn_lenb,
6997 &ett_gtpv2_tra_info_ne_types,
7001 &ett_gtpv2_supp_codec_list,
7003 &ett_gtpv2_mm_context_auth_qua,
7004 &ett_gtpv2_mm_context_auth_qui,
7005 &ett_gtpv2_mm_context_auth_tri,
7006 &ett_gtpv2_mm_context_net_cap,
7007 &ett_gtpv2_ms_network_capability,
7009 &ett_gtpv2_access_rest_data,
7014 static ei_register_info ei[] = {
7015 { &ei_gtpv2_ie_data_not_dissected, { "gtpv2.ie_data_not_dissected", PI_PROTOCOL, PI_NOTE, "IE data not dissected yet", EXPFILL }},
7016 { &ei_gtpv2_ie_len_invalid, { "gtpv2.ie_len_invalid", PI_PROTOCOL, PI_ERROR, "Wrong length", EXPFILL }},
7017 { &ei_gtpv2_source_type_unknown, { "gtpv2.source_type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown source type", EXPFILL }},
7018 { &ei_gtpv2_fq_csid_type_bad, { "gtpv2.fq_csid_type.unknown", PI_PROTOCOL, PI_ERROR, "Wrong Node-ID Type", EXPFILL }},
7021 expert_module_t* expert_gtpv2;
7023 proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
7024 proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
7025 proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
7026 expert_gtpv2 = expert_register_protocol(proto_gtpv2);
7027 expert_register_field_array(expert_gtpv2, ei, array_length(ei));
7029 /* AVP Code: 22 3GPP-User-Location-Info */
7030 dissector_add_uint("diameter.3gpp", 22, new_create_dissector_handle(dissect_diameter_3gpp_uli, proto_gtpv2));
7032 register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
7033 /* Dissector table for private extensions */
7034 gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 PRIVATE EXT", FT_UINT16, BASE_DEC);
7038 proto_reg_handoff_gtpv2(void)
7040 nas_eps_handle = find_dissector("nas-eps");
7049 * indent-tabs-mode: nil
7052 * ex: set shiftwidth=4 tabstop=8 expandtab:
7053 * :indentSize=4:tabSize=8:noTabs=true: