3 * Routines for GTPv2 dissection
4 * Copyright 2009 - 2012, Anders Broman <anders.broman [at] ericcsson.com>
6 * Wireshark - Network traffic analyzer
7 * By Gerald Combs <gerald@wireshark.org>
8 * Copyright 1998 Gerald Combs
10 * This program is free software; you can redistribute it and/or
11 * modify it under the terms of the GNU General Public License
12 * as published by the Free Software Foundation; either version 2
13 * of the License, or (at your option) any later version.
15 * This program is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 * GNU General Public License for more details.
20 * You should have received a copy of the GNU General Public License
21 * along with this program; if not, write to the Free Software
22 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 * Ref: 3GPP TS 29.274 version 11.1.0 Release 11 ETSI TS 129 274 V8.1.1 (2009-04)
30 #include <epan/packet.h>
31 #include <epan/to_str.h>
32 #include <epan/asn1.h>
33 #include <epan/expert.h>
34 #include <epan/sminmpec.h>
36 #include "packet-gsm_a_common.h"
37 #include "packet-gsm_map.h"
38 #include "packet-e164.h"
39 #include "packet-e212.h"
40 #include "packet-s1ap.h"
41 #include "packet-ranap.h"
42 #include "packet-bssgp.h"
43 #include "packet-ntp.h"
44 #include "packet-gtpv2.h"
45 #include "packet-diameter.h"
47 void proto_register_gtpv2(void);
48 void proto_reg_handoff_gtpv2(void);
50 static dissector_handle_t nas_eps_handle;
51 static dissector_table_t gtpv2_priv_ext_dissector_table;
54 /*GTPv2 Message->GTP Header(SB)*/
55 static int proto_gtpv2 = -1;
57 static int hf_gtpv2_reserved = -1;
58 static int hf_gtpv2_spare_half_octet = -1;
59 static int hf_gtpv2_spare_bits = -1;
60 static int hf_gtpv2_flags = -1;
61 static int hf_gtpv2_version = -1;
62 static int hf_gtpv2_p = -1;
63 static int hf_gtpv2_t = -1;
64 static int hf_gtpv2_message_type = -1;
65 static int hf_gtpv2_msg_length = -1;
66 static int hf_gtpv2_teid = -1;
67 static int hf_gtpv2_seq = -1;
68 static int hf_gtpv2_spare = -1;
71 static int hf_gtpv2_ie = -1;
72 static int hf_gtpv2_ie_len = -1;
73 static int hf_gtpv2_cr = -1;
74 static int hf_gtpv2_instance = -1;
75 static int hf_gtpv2_cause = -1;
76 static int hf_gtpv2_cause_cs = -1;
77 static int hf_gtpv2_cause_bce = -1;
78 static int hf_gtpv2_cause_pce = -1;
79 static int hf_gtpv2_cause_off_ie_t = -1;
80 static int hf_gtpv2_rec = -1;
81 /*Start SRVCC Messages*/
82 static int hf_gtpv2_stn_sr = -1;
83 static int hf_gtpv2_len_trans_con = -1;
84 static int hf_gtpv2_eksi = -1;
85 static int hf_gtpv2_ck = -1;
86 static int hf_gtpv2_ik = -1;
87 static int hf_gtpv2_len_ms_classmark2 = -1;
88 static int hf_gtpv2_len_ms_classmark3 = -1;
89 static int hf_gtpv2_len_supp_codec_list = -1;
90 static int hf_gtpv2_ksi = -1;
91 /*static int hf_gtpv2_kc = -1; */
92 static int hf_gtpv2_cksn = -1;
93 static int hf_gtpv2_srvcc_cause = -1;
94 static int hf_gtpv2_rac = -1;
95 static int hf_gtpv2_rnc_id = -1;
96 static int hf_gtpv2_ext_rnc_id = -1;
97 static int hf_gtpv2_lac = -1;
98 static int hf_gtpv2_sac = -1;
99 static int hf_gtpv2_tgt_g_cell_id = -1;
100 static int hf_gtpv2_teid_c = -1;
101 static int hf_gtpv2_sv_sti = -1;
102 static int hf_gtpv2_sv_ics = -1;
103 static int hf_gtpv2_sv_emind = -1;
104 /*End SRVCC Messages*/
105 static int hf_gtpv2_apn = -1;
106 static int hf_gtpv2_ebi = -1;
107 static int hf_gtpv2_daf = -1;
108 static int hf_gtpv2_dtf = -1;
109 static int hf_gtpv2_hi = -1;
110 static int hf_gtpv2_dfi = -1;
111 static int hf_gtpv2_oi = -1;
112 static int hf_gtpv2_isrsi = -1;
113 static int hf_gtpv2_israi = -1;
114 static int hf_gtpv2_sgwci = -1;
115 static int hf_gtpv2_sqci = -1;
116 static int hf_gtpv2_uimsi = -1;
117 static int hf_gtpv2_cfsi = -1;
118 static int hf_gtpv2_crsi = -1;
119 static int hf_gtpv2_pt = -1;
120 static int hf_gtpv2_ps = -1;
121 static int hf_gtpv2_si = -1;
122 static int hf_gtpv2_msv = -1;
123 static int hf_gtpv2_spare1 = -1;
124 static int hf_gtpv2_spare2 = -1;
125 static int hf_gtpv2_spare3 = -1;
126 static int hf_gtpv2_s6af = -1;
127 static int hf_gtpv2_s4af = -1;
128 static int hf_gtpv2_mbmdt = -1;
129 static int hf_gtpv2_israu = -1;
130 static int hf_gtpv2_ccrsi = -1;
131 static int hf_gtpv2_pdn_type = -1;
132 static int hf_gtpv2_pdn_ipv4 = -1;
133 static int hf_gtpv2_pdn_ipv6_len = -1;
134 static int hf_gtpv2_pdn_ipv6 = -1;
135 static int hf_gtpv2_pdn_numbers_nsapi = -1;
136 static int hf_gtpv2_p_tmsi = -1;
137 static int hf_gtpv2_p_tmsi_sig = -1;
138 static int hf_gtpv2_mmbr_ul = -1;
139 static int hf_gtpv2_mmbr_dl = -1;
141 static int hf_gtpv2_rat_type = -1;
142 static int hf_gtpv2_uli_ecgi_flg = -1;
143 static int hf_gtpv2_uli_lai_flg = -1;
144 static int hf_gtpv2_uli_tai_flg = -1;
145 static int hf_gtpv2_uli_rai_flg = -1;
146 static int hf_gtpv2_uli_sai_flg = -1;
147 static int hf_gtpv2_uli_cgi_flg = -1;
148 static int hf_gtpv2_glt = -1;
149 static int hf_gtpv2_cng_rep_act = -1;
151 static int hf_gtpv2_selec_mode = -1;
152 static int hf_gtpv2_source_type = -1;
153 static int hf_gtpv2_f_teid_v4 = -1;
154 static int hf_gtpv2_f_teid_v6 = -1;
155 static int hf_gtpv2_f_teid_interface_type= -1;
156 static int hf_gtpv2_f_teid_gre_key= -1;
157 static int hf_gtpv2_f_teid_ipv4= -1;
158 static int hf_gtpv2_f_teid_ipv6= -1;
159 static int hf_gtpv2_tmsi = -1;
160 static int hf_gtpv2_hsgw_addr_f_len = -1;
161 static int hf_gtpv2_hsgw_addr_ipv4 = -1;
162 static int hf_gtpv2_hsgw_addr_ipv6 = -1;
163 static int hf_gtpv2_gre_key = -1;
164 static int hf_gtpv2_sgw_addr_ipv4 = -1;
165 static int hf_gtpv2_sgw_addr_ipv6 = -1;
166 static int hf_gtpv2_sgw_s1u_teid = -1;
167 static int hf_gtpv2_imsi= -1;
168 static int hf_gtpv2_ipv4_addr = -1;
171 static int hf_gtpv2_ambr_up= -1;
172 static int hf_gtpv2_ambr_down= -1;
173 static int hf_gtpv2_ip_address_ipv4= -1;
174 static int hf_gtpv2_ip_address_ipv6= -1;
175 static int hf_gtpv2_mei= -1;
177 /* Trace Information */
178 /* static int hf_gtpv2_tra_info = -1; */
179 static int hf_gtpv2_tra_info_msc_momt_calls = -1;
180 static int hf_gtpv2_tra_info_msc_momt_sms = -1;
181 static int hf_gtpv2_tra_info_msc_lu_imsi_ad = -1;
182 static int hf_gtpv2_tra_info_msc_handovers = -1;
183 static int hf_gtpv2_tra_info_msc_ss = -1;
184 static int hf_gtpv2_tra_info_mgw_context = -1;
185 static int hf_gtpv2_tra_info_sgsn_pdp_context = -1;
186 static int hf_gtpv2_tra_info_sgsn_momt_sms = -1;
187 static int hf_gtpv2_tra_info_sgsn_rau_gprs_ad = -1;
188 static int hf_gtpv2_tra_info_sgsn_mbms = -1;
189 static int hf_gtpv2_tra_info_sgsn_reserved = -1;
190 static int hf_gtpv2_tra_info_ggsn_pdp = -1;
191 static int hf_gtpv2_tra_info_ggsn_mbms = -1;
192 static int hf_gtpv2_tra_info_bm_sc = -1;
193 static int hf_gtpv2_tra_info_mme_sgw_ss = -1;
194 static int hf_gtpv2_tra_info_mme_sgw_sr = -1;
195 static int hf_gtpv2_tra_info_mme_sgw_iataud = -1;
196 static int hf_gtpv2_tra_info_lne_msc_s = -1;
197 static int hf_gtpv2_tra_info_lne_mgw = -1;
198 static int hf_gtpv2_tra_info_lne_sgsn = -1;
199 static int hf_gtpv2_tra_info_lne_ggsn = -1;
200 static int hf_gtpv2_tra_info_lne_rnc = -1;
201 static int hf_gtpv2_tra_info_lne_bm_sc = -1;
202 static int hf_gtpv2_tra_info_lne_mme = -1;
203 static int hf_gtpv2_tra_info_lne_sgw = -1;
204 static int hf_gtpv2_tra_info_lne_pdn_gw = -1;
205 static int hf_gtpv2_tra_info_lne_enb = -1;
206 static int hf_gtpv2_tra_info_tdl = -1;
207 static int hf_gtpv2_tra_info_lmsc_a = -1;
208 static int hf_gtpv2_tra_info_lmsc_lu = -1;
209 static int hf_gtpv2_tra_info_lmsc_mc = -1;
210 static int hf_gtpv2_tra_info_lmsc_map_g = -1;
211 static int hf_gtpv2_tra_info_lmsc_map_b = -1;
212 static int hf_gtpv2_tra_info_lmsc_map_e = -1;
213 static int hf_gtpv2_tra_info_lmsc_map_f = -1;
214 static int hf_gtpv2_tra_info_lmsc_cap = -1;
215 static int hf_gtpv2_tra_info_lmsc_map_d = -1;
216 static int hf_gtpv2_tra_info_lmsc_map_c = -1;
217 static int hf_gtpv2_tra_info_lmgw_mc = -1;
218 static int hf_gtpv2_tra_info_lmgw_nb_up = -1;
219 static int hf_gtpv2_tra_info_lmgw_lu_up = -1;
220 static int hf_gtpv2_tra_info_lsgsn_gb = -1;
221 static int hf_gtpv2_tra_info_lsgsn_lu = -1;
222 static int hf_gtpv2_tra_info_lsgsn_gn = -1;
223 static int hf_gtpv2_tra_info_lsgsn_map_gr = -1;
224 static int hf_gtpv2_tra_info_lsgsn_map_gd = -1;
225 static int hf_gtpv2_tra_info_lsgsn_map_gf = -1;
226 static int hf_gtpv2_tra_info_lsgsn_gs = -1;
227 static int hf_gtpv2_tra_info_lsgsn_ge = -1;
228 static int hf_gtpv2_tra_info_lggsn_gn = -1;
229 static int hf_gtpv2_tra_info_lggsn_gi = -1;
230 static int hf_gtpv2_tra_info_lggsn_gmb = -1;
231 static int hf_gtpv2_tra_info_lrnc_lu = -1;
232 static int hf_gtpv2_tra_info_lrnc_lur = -1;
233 static int hf_gtpv2_tra_info_lrnc_lub = -1;
234 static int hf_gtpv2_tra_info_lrnc_uu = -1;
235 static int hf_gtpv2_tra_info_lbm_sc_gmb = -1;
236 static int hf_gtpv2_tra_info_lmme_s1_mme = -1;
237 static int hf_gtpv2_tra_info_lmme_s3 = -1;
238 static int hf_gtpv2_tra_info_lmme_s6a = -1;
239 static int hf_gtpv2_tra_info_lmme_s10 = -1;
240 static int hf_gtpv2_tra_info_lmme_s11 = -1;
241 static int hf_gtpv2_tra_info_lsgw_s4 = -1;
242 static int hf_gtpv2_tra_info_lsgw_s5 = -1;
243 static int hf_gtpv2_tra_info_lsgw_s8b = -1;
244 static int hf_gtpv2_tra_info_lsgw_s11 = -1;
245 static int hf_gtpv2_tra_info_lpdn_gw_s2a = -1;
246 static int hf_gtpv2_tra_info_lpdn_gw_s2b = -1;
247 static int hf_gtpv2_tra_info_lpdn_gw_s2c = -1;
248 static int hf_gtpv2_tra_info_lpdn_gw_s5 = -1;
249 static int hf_gtpv2_tra_info_lpdn_gw_s6c = -1;
250 static int hf_gtpv2_tra_info_lpdn_gw_gx = -1;
251 static int hf_gtpv2_tra_info_lpdn_gw_s8b = -1;
252 static int hf_gtpv2_tra_info_lpdn_gw_sgi = -1;
253 static int hf_gtpv2_tra_info_lenb_s1_mme = -1;
254 static int hf_gtpv2_tra_info_lenb_x2 = -1;
255 static int hf_gtpv2_tra_info_lenb_uu = -1;
257 static int hf_gtpv2_address_digits = -1;
258 static int hf_gtpv2_ti = -1;
260 static int hf_gtpv2_bearer_qos_pvi= -1;
261 static int hf_gtpv2_bearer_qos_pl= -1;
262 static int hf_gtpv2_bearer_qos_pci= -1;
263 static int hf_gtpv2_bearer_qos_label_qci = -1;
264 static int hf_gtpv2_bearer_qos_mbr_up = -1;
265 static int hf_gtpv2_bearer_qos_mbr_down = -1;
266 static int hf_gtpv2_bearer_qos_gbr_up = -1;
267 static int hf_gtpv2_bearer_qos_gbr_down = -1;
268 static int hf_gtpv2_flow_qos_label_qci = -1;
269 static int hf_gtpv2_flow_qos_mbr_up = -1;
270 static int hf_gtpv2_flow_qos_mbr_down = -1;
271 static int hf_gtpv2_flow_qos_gbr_up = -1;
272 static int hf_gtpv2_flow_qos_gbr_down = -1;
274 static int hf_gtpv2_delay_value = -1;
275 static int hf_gtpv2_charging_id = -1;
276 static int hf_gtpv2_charging_characteristic = -1;
277 static int hf_gtpv2_bearer_flag_ppc = -1;
278 static int hf_gtpv2_bearer_flag_vb = -1;
279 static int hf_gtpv2_ue_time_zone_dst = -1;
280 static int hf_gtpv2_fq_csid_type = -1;
281 static int hf_gtpv2_fq_csid_nr = -1;
282 static int hf_gtpv2_fq_csid_ipv4 = -1;
283 static int hf_gtpv2_fq_csid_ipv6 = -1;
284 static int hf_gtpv2_fq_csid_id = -1;
285 static int hf_gtpv2_complete_req_msg_type = -1;
286 static int hf_gtpv2_mme_grp_id = -1;
287 static int hf_gtpv2_mme_code = -1;
288 static int hf_gtpv2_m_tmsi = -1;
289 static int hf_gtpv2_container_type = -1;
290 static int hf_gtpv2_cause_type = -1;
291 static int hf_gtpv2_CauseRadioNetwork = -1;
292 static int hf_gtpv2_CauseTransport = -1;
293 static int hf_gtpv2_CauseNas = -1;
294 static int hf_gtpv2_CauseProtocol = -1;
295 static int hf_gtpv2_CauseMisc = -1;
296 static int hf_gtpv2_target_type = -1;
297 static int hf_gtpv2_macro_enodeb_id = -1;
299 static int hf_gtpv2_node_type= -1;
300 static int hf_gtpv2_fqdn = -1;
301 static int hf_gtpv2_enterprise_id = -1;
302 static int hf_gtpv2_apn_rest= -1;
303 static int hf_gtpv2_pti= -1;
304 static int hf_gtpv2_mm_context_sm = -1;
305 static int hf_gtpv2_mm_context_nhi = -1;
306 static int hf_gtpv2_mm_context_drxi = -1;
307 static int hf_gtpv2_mm_context_cksn = -1;
308 static int hf_gtpv2_mm_context_cksn_ksi = -1;
309 static int hf_gtpv2_mm_context_kasme = -1;
310 static int hf_gtpv2_mm_context_rand = -1;
311 static int hf_gtpv2_mm_context_xres_len = -1;
312 static int hf_gtpv2_mm_context_xres = -1;
313 static int hf_gtpv2_mm_context_autn_len = -1;
314 static int hf_gtpv2_mm_context_autn = -1;
315 static int hf_gtpv2_mm_context_drx = -1;
316 static int hf_gtpv2_mm_context_ue_net_cap_len = -1;
317 static int hf_gtpv2_mm_context_ms_net_cap_len = -1;
318 static int hf_gtpv2_mm_context_mei_len = -1;
319 static int hf_gtpv2_mm_context_vdp_len = -1;
320 static int hf_gtpv2_mm_context_higher_br_16mb_flg_len = -1;
321 static int hf_gtpv2_mm_context_higher_br_16mb_flg = -1;
322 static int hf_gtpv2_vdp_length = -1;
324 static int hf_gtpv2_una = -1;
325 static int hf_gtpv2_gena = -1;
326 static int hf_gtpv2_gana = -1;
327 static int hf_gtpv2_ina = -1;
328 static int hf_gtpv2_ena = -1;
329 static int hf_gtpv2_hnna = -1;
330 static int hf_gtpv2_mm_context_ksi_a= -1;
331 static int hf_gtpv2_mm_context_ksi = -1;
332 static int hf_gtpv2_mm_context_nr_tri = -1;
333 static int hf_gtpv2_mm_context_used_cipher = -1;
334 static int hf_gtpv2_mm_context_nr_qui = -1;
335 static int hf_gtpv2_mm_context_nr_qua = -1;
336 static int hf_gtpv2_mm_context_uamb_ri = -1;
337 static int hf_gtpv2_mm_context_osci = -1;
338 static int hf_gtpv2_mm_context_samb_ri = -1;
339 static int hf_gtpv2_mm_context_unipa = -1;
340 static int hf_gtpv2_mm_context_unc = -1;
341 static int hf_gtpv2_mm_context_nas_dl_cnt = -1;
342 static int hf_gtpv2_mm_context_nas_ul_cnt = -1;
344 static int hf_gtpv2_uli_cgi_lac= -1;
345 static int hf_gtpv2_uli_cgi_ci= -1;
346 static int hf_gtpv2_uli_sai_lac= -1;
347 static int hf_gtpv2_uli_sai_sac= -1;
348 static int hf_gtpv2_uli_rai_lac= -1;
349 static int hf_gtpv2_uli_rai_rac= -1;
350 static int hf_gtpv2_uli_tai_tac= -1;
351 static int hf_gtpv2_uli_ecgi_eci= -1;
352 static int hf_gtpv2_uli_lai_lac = -1;
353 static int hf_gtpv2_uli_ecgi_eci_spare= -1;
354 static int hf_gtpv2_nsapi = -1;
355 static int hf_gtpv2_bearer_control_mode= -1;
357 static int hf_gtpv2_bss_container_phx = -1;
358 static int hf_gtpv2_bss_con_sapi_flg = -1;
359 static int hf_gtpv2_bss_con_rp_flg = -1;
360 static int hf_gtpv2_bss_con_pfi_flg = -1;
361 static int hf_gtpv2_bss_con_pfi = -1;
362 static int hf_gtpv2_bss_con_rp = -1;
363 static int hf_gtpv2_bss_con_sapi = -1;
364 static int hf_gtpv2_bss_con_xid_len = -1;
365 static int hf_gtpv2_bss_con_xid = -1;
366 static int hf_gtpv2_home_enodeb_id = -1;
367 static int hf_gtpv2_tac = -1;
370 static int hf_gtpv2_mbms_service_area_nr = -1;
371 static int hf_gtpv2_mbms_service_area_id = -1;
372 static int hf_gtpv2_mbms_session_id = -1;
373 static int hf_gtpv2_mbms_flow_id = -1;
374 static int hf_gtpv2_cteid = -1;
375 static int hf_gtpv2_ip_addr_type = -1;
376 static int hf_gtpv2_ip_addr_len = -1;
377 static int hf_gtpv2_mbms_ip_mc_dist_addrv4 = -1;
378 static int hf_gtpv2_mbms_ip_mc_dist_addrv6 = -1;
379 static int hf_gtpv2_mbms_ip_mc_src_addrv4 = -1;
380 static int hf_gtpv2_mbms_ip_mc_src_addrv6 = -1;
381 static int hf_gtpv2_mbms_hc_indicator = -1;
382 static int hf_gtpv2_mbms_dist_indication = -1;
383 static int hf_gtpv2_subscriber_rfsp = -1;
384 static int hf_gtpv2_rfsp_inuse = -1;
385 static int hf_gtpv2_mbms_service_id = -1;
386 static int hf_gtpv2_add_flags_for_srvcc_ics = -1;
387 static int hf_gtpv2_vsrvcc_flag = -1;
388 static int hf_gtpv2_abs_time_mbms_data = -1;
389 static int hf_gtpv2_henb_info_report_fti = -1;
390 static int hf_gtpv2_ip4cp_subnet_prefix_len = -1;
391 static int hf_gtpv2_ip4cp_ipv4 = -1;
392 static int hf_gtpv2_change_report_flags_sncr = -1;
393 static int hf_gtpv2_change_report_flags_tzcr = -1;
394 static int hf_gtpv2_action_indication_val = -1;
395 static int hf_gtpv2_mbms_session_duration_days = -1;
396 static int hf_gtpv2_mbms_session_duration_secs = -1;
397 static int hf_gtpv2_node_features_prn = -1;
398 static int hf_gtpv2_node_features_mabr =-1;
399 static int hf_gtpv2_node_features_ntsr = -1;
400 static int hf_gtpv2_time_to_data_xfer = -1;
401 static int hf_gtpv2_arp_pvi = -1;
402 static int hf_gtpv2_arp_pl = -1;
403 static int hf_gtpv2_arp_pci = -1;
404 static int hf_gtpv2_timer_unit = -1;
405 static int hf_gtpv2_timer_value = -1;
406 static int hf_gtpv2_lapi = -1;
408 static gint ett_gtpv2 = -1;
409 static gint ett_gtpv2_flags = -1;
410 static gint ett_gtpv2_ie = -1;
411 static gint ett_gtpv2_uli_flags = -1;
412 static gint ett_gtpv2_uli_field = -1;
413 static gint ett_gtpv2_bearer_ctx = -1;
414 static gint ett_gtpv2_PDN_conn = -1;
415 static gint ett_gtpv2_mm_context_flag = -1;
416 static gint ett_gtpv2_pdn_numbers_nsapi = -1;
417 static gint ett_gtpv2_tra_info_trigg = -1;
418 static gint ett_gtpv2_tra_info_trigg_msc_server = -1;
419 static gint ett_gtpv2_tra_info_trigg_mgw = -1;
420 static gint ett_gtpv2_tra_info_trigg_sgsn = -1;
421 static gint ett_gtpv2_tra_info_trigg_ggsn = -1;
422 static gint ett_gtpv2_tra_info_trigg_bm_sc = -1;
423 static gint ett_gtpv2_tra_info_trigg_sgw_mme = -1;
424 static gint ett_gtpv2_tra_info_interfaces = -1;
425 static gint ett_gtpv2_tra_info_interfaces_imsc_server = -1;
426 static gint ett_gtpv2_tra_info_interfaces_lmgw = -1;
427 static gint ett_gtpv2_tra_info_interfaces_lsgsn = -1;
428 static gint ett_gtpv2_tra_info_interfaces_lggsn = -1;
429 static gint ett_gtpv2_tra_info_interfaces_lrnc = -1;
430 static gint ett_gtpv2_tra_info_interfaces_lbm_sc = -1;
431 static gint ett_gtpv2_tra_info_interfaces_lmme = -1;
432 static gint ett_gtpv2_tra_info_interfaces_lsgw = -1;
433 static gint ett_gtpv2_tra_info_interfaces_lpdn_gw = -1;
434 static gint ett_gtpv2_tra_info_interfaces_lpdn_lenb = -1;
435 static gint ett_gtpv2_tra_info_ne_types = -1;
436 static gint ett_gtpv2_rai = -1;
437 static gint ett_gtpv2_ms_mark = -1;
438 static gint ett_gtpv2_stn_sr = -1;
439 static gint ett_gtpv2_supp_codec_list = -1;
440 static gint ett_gtpv2_bss_con = -1;
441 static gint ett_gtpv2_mm_context_auth_qua = -1;
442 static gint ett_gtpv2_mm_context_auth_qui = -1;
443 static gint ett_gtpv2_mm_context_auth_tri = -1;
444 static gint ett_gtpv2_mm_context_net_cap = -1;
445 static gint ett_gtpv2_ms_network_capability = -1;
446 static gint ett_gtpv2_vd_pref = -1;
447 static gint ett_gtpv2_access_rest_data = -1;
448 static gint ett_gtpv2_qua = -1;
449 static gint ett_gtpv2_qui = -1;
451 static expert_field ei_gtpv2_ie_data_not_dissected = EI_INIT;
452 static expert_field ei_gtpv2_ie_len_invalid = EI_INIT;
453 static expert_field ei_gtpv2_source_type_unknown = EI_INIT;
454 static expert_field ei_gtpv2_fq_csid_type_bad = EI_INIT;
456 /* Definition of User Location Info (AVP 22) masks */
457 #define GTPv2_ULI_CGI_MASK 0x01
458 #define GTPv2_ULI_SAI_MASK 0x02
459 #define GTPv2_ULI_RAI_MASK 0x04
460 #define GTPv2_ULI_TAI_MASK 0x08
461 #define GTPv2_ULI_ECGI_MASK 0x10
462 #define GTPv2_ULI_LAI_MASK 0x20
464 #define GTPV2_CREATE_SESSION_REQUEST 32
465 #define GTPV2_CREATE_SESSION_RESPONSE 33
466 #define GTPV2_CONTEXT_RESPONSE 131
467 #define GTPV2_FORWARD_RELOCATION_REQ 133
468 #define GTPV2_FORWARD_CTX_NOTIFICATION 137
469 #define GTPV2_RAN_INFORMATION_RELAY 152
471 static void dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, gint offset, guint8 message_type);
473 /*Message Types for GTPv2 (Refer Pg19 29.274) (SB)*/
474 static const value_string gtpv2_message_type_vals[] = {
476 { 1, "Echo Request"},
477 { 2, "Echo Response"},
478 { 3, "Version Not Supported Indication"},
479 /* 4-24 Reserved for S101 interface TS 29.276 */
480 { 4, "Node Alive Request"},
481 { 5, "Node Alive Response"},
482 { 6, "Redirection Request"},
483 { 7, "Redirection Response"},
484 /* 25-31 Reserved for Sv interface TS 29.280 */
485 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 5.2.1*/
486 { 25, "SRVCC PS to CS Request"},
487 { 26, "SRVCC PS to CS Response"},
488 { 27, "SRVCC PS to CS Complete Notification"},
489 { 28, "SRVCC PS to CS Complete Acknowledge"},
490 { 29, "SRVCC PS to CS Cancel Notification"},
491 { 30, "SRVCC PS to CS Cancel Acknowledge"},
492 { 31, "For Future Sv interface use"},
493 /*End SRVCC Messages*/
494 /* SGSN/MME to PGW (S4/S11, S5/S8) */
495 { 32, "Create Session Request"},
496 { 33, "Create Session Response"},
497 { 34, "Modify Bearer Request"},
498 { 35, "Modify Bearer Response"},
499 { 36, "Delete Session Request"},
500 { 37, "Delete Session Response"},
501 /* SGSN to PGW (S4, S5/S8) */
502 { 38, "Change Notification Request"},
503 { 39, "Change Notification Response"},
504 /* 40-63 For future use */
505 /* Messages without explicit response */
506 { 64, "Modify Bearer Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
507 { 65, "Modify Bearer Failure Indication"}, /*(PGW to MME/SGSN -S5/S8, S11/S4) */
508 { 66, "Delete Bearer Command"}, /* (MME to PGW -S11, S5/S8) */
509 { 67, "Delete Bearer Failure Indication"}, /* (PGW to MME -S5/S8, S11) */
510 { 68, "Bearer Resource Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
511 { 69, "Bearer Resource Failure Indication"}, /* (PGW to MME/SGSN -S5/S8, S11/S4) */
512 { 70, "Downlink Data Notification Failure Indication"}, /*(SGSN/MME to SGW -S4/S11) */
513 { 71, "Trace Session Activation"},
514 { 72, "Trace Session Deactivation"},
515 { 73, "Stop Paging Indication"},
516 /* 74-94 For future use */
517 /* PDN-GW to SGSN/MME (S5/S8, S4/S11) */
518 { 95, "Create Bearer Request"},
519 { 96, "Create Bearer Response"},
520 { 97, "Update Bearer Request"},
521 { 98, "Update Bearer Response"},
522 { 99, "Delete Bearer Request"},
523 {100, "Delete Bearer Response"},
524 /* PGW to MME, MME to PGW, SGW to PGW, SGW to MME (S5/S8, S11) */
525 {101, "Delete PDN Connection Set Request"},
526 {102, "Delete PDN Connection Set Response"},
527 /* 103-127 For future use */
528 /* MME to MME, SGSN to MME, MME to SGSN, SGSN to SGSN (S3/10/S16) */
529 {128, "Identification Request"},
530 {129, "Identification Response"},
531 {130, "Context Request"},
532 {131, "Context Response"},
533 {132, "Context Acknowledge"},
534 {133, "Forward Relocation Request"},
535 {134, "Forward Relocation Response"},
536 {135, "Forward Relocation Complete Notification"},
537 {136, "Forward Relocation Complete Acknowledge"},
538 {137, "Forward Access Context Notification"},
539 {138, "Forward Access Context Acknowledge"},
540 {139, "Relocation Cancel Request"},
541 {140, "Relocation Cancel Response"},
542 {141, "Configuration Transfer Tunnel"},
543 /* 142-148 For future use */
544 /* SGSN to MME, MME to SGSN (S3)*/
545 {149, "Detach Notification"},
546 {150, "Detach Acknowledge"},
547 {151, "CS Paging Indication"},
548 {152, "RAN Information Relay"},
549 {153, "Alert MME Notification"},
550 {154, "Alert MME Acknowledge"},
551 {155, "UE Activity Notification"},
552 {156, "UE Activity Acknowledge"},
553 /* 157 to 159 For future use */
554 /* MME to SGW (S11) */
555 {160, "Create Forwarding Tunnel Request"},
556 {161, "Create Forwarding Tunnel Response"},
557 {162, "Suspend Notification"},
558 {163, "Suspend Acknowledge"},
559 {164, "Resume Notification"},
560 {165, "Resume Acknowledge"},
561 {166, "Create Indirect Data Forwarding Tunnel Request"},
562 {167, "Create Indirect Data Forwarding Tunnel Response"},
563 {168, "Delete Indirect Data Forwarding Tunnel Request"},
564 {169, "Delete Indirect Data Forwarding Tunnel Response"},
565 {170, "Release Access Bearers Request"},
566 {171, "Release Access Bearers Response"},
567 /* 172-175 For future use */
568 /* SGW to SGSN/MME (S4/S11) */
569 {176, "Downlink Data Notification"},
570 {177, "Downlink Data Notification Acknowledgement"},
571 {178, "Reserved. Allocated in earlier version of the specification."},
572 {179, "PGW Restart Notification"},
573 {180, "PGW Restart Notification Acknowledge"},
574 /* 181-199 For future use */
575 /* SGW to PGW, PGW to SGW (S5/S8) */
576 {200, "Update PDN Connection Set Request"},
577 {201, "Update PDN Connection Set Response"},
578 /* 202 to 210 For future use */
579 /* MME to SGW (S11) */
580 {211, "Modify Access Bearers Request"},
581 {212, "Modify Access Bearers Response"},
582 /* 213 to 230 For future use */
583 /* MBMS GW to MME/SGSN (Sm/Sn) */
584 {231, "MBMS Session Start Request"},
585 {232, "MBMS Session Start Response"},
586 {233, "MBMS Session Update Request"},
587 {234, "MBMS Session Update Response"},
588 {235, "MBMS Session Stop Request"},
589 {236, "MBMS Session Stop Response"},
590 /* 237 to 239 For future use */
591 {240, "SRVCC CS to PS Response"}, /* 5.2.9 3GPP TS 29.280 V11.5.0 (2013-09) */
592 {241, "SRVCC CS to PS Complete Notification"}, /* 5.2.10 3GPP TS 29.280 V11.5.0 (2013-09) */
593 {242, "SRVCC CS to PS Complete Acknowledge"}, /* 5.2.11 3GPP TS 29.280 V11.5.0 (2013-09) */
594 {243, "SRVCC CS to PS Cancel Notification"}, /* 5.2.12 3GPP TS 29.280 V11.5.0 (2013-09) */
595 {244, "SRVCC CS to PS Cancel Acknowledge"}, /* 5.2.13 3GPP TS 29.280 V11.5.0 (2013-09) */
596 /* 245 to 247 For future Sv interface use*/
597 /* 248 to 255 For future use */
600 static value_string_ext gtpv2_message_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_message_type_vals);
602 #define GTPV2_IE_RESERVED 0
603 #define GTPV2_IE_IMSI 1
604 #define GTPV2_IE_CAUSE 2
605 #define GTPV2_REC_REST_CNT 3
606 /*Start SRVCC Messages*/
607 #define GTPV2_IE_STN_SR 51
608 #define GTPV2_IE_SRC_TGT_TRANS_CON 52
609 #define GTPV2_IE_TGT_SRC_TRANS_CON 53
610 #define GTPV2_IE_MM_CON_EUTRAN_SRVCC 54
611 #define GTPV2_IE_MM_CON_UTRAN_SRVCC 55
612 #define GTPV2_IE_SRVCC_CAUSE 56
613 #define GTPV2_IE_TGT_RNC_ID 57
614 #define GTPV2_IE_TGT_GLOGAL_CELL_ID 58
615 #define GTPV2_IE_TEID_C 59
616 #define GTPV2_IE_SV_FLAGS 60
617 #define GTPV2_IE_SAI 61
618 /* 61 - 70 for future sv interface use*/
619 /*End SRVCC Messages*/
621 #define GTPV2_AMBR 72
623 #define GTPV2_IP_ADDRESS 74
625 #define GTPV2_IE_MSISDN 76
626 #define GTPV2_INDICATION 77
629 #define GTPV2_BEARER_QOS 80
630 #define GTPV2_IE_FLOW_QOS 81
631 #define GTPV2_IE_RAT_TYPE 82
632 #define GTPV2_IE_SERV_NET 83
633 #define GTPV2_IE_BEARER_TFT 84
634 #define GTPV2_IE_TAD 85
635 #define GTPV2_IE_ULI 86
636 #define GTPV2_IE_F_TEID 87
637 #define GTPV2_IE_TMSI 88
638 #define GTPV2_IE_GLOBAL_CNID 89
639 #define GTPV2_IE_S103PDF 90
640 #define GTPV2_IE_S1UDF 91
641 #define GTPV2_IE_DEL_VAL 92
642 #define GTPV2_IE_BEARER_CTX 93
643 #define GTPV2_IE_CHAR_ID 94
644 #define GTPV2_IE_CHAR_CHAR 95
645 #define GTPV2_IE_TRA_INFO 96
646 #define GTPV2_BEARER_FLAG 97
647 /* define GTPV2_IE_PAGING_CAUSE 98 (void) */
648 #define GTPV2_IE_PDN_TYPE 99
649 #define GTPV2_IE_PTI 100
650 #define GTPV2_IE_DRX_PARAM 101
651 #define GTPV2_IE_UE_NET_CAPABILITY 102
652 #define GTPV2_IE_MM_CONTEXT_GSM_T 103
653 #define GTPV2_IE_MM_CONTEXT_UTMS_CQ 104
654 #define GTPV2_IE_MM_CONTEXT_GSM_CQ 105
655 #define GTPV2_IE_MM_CONTEXT_UTMS_Q 106
656 #define GTPV2_IE_MM_CONTEXT_EPS_QQ 107
657 #define GTPV2_IE_MM_CONTEXT_UTMS_QQ 108
658 #define GTPV2_IE_PDN_CONNECTION 109
659 #define GTPV2_IE_PDN_NUMBERS 110
660 #define GTPV2_IE_P_TMSI 111
661 #define GTPV2_IE_P_TMSI_SIG 112
662 #define GTPV2_IE_HOP_COUNTER 113
663 #define GTPV2_IE_UE_TIME_ZONE 114
664 #define GTPV2_IE_TRACE_REFERENCE 115
665 #define GTPV2_IE_COMPLETE_REQUEST_MSG 116
666 #define GTPV2_IE_GUTI 117
667 #define GTPV2_IE_F_CONTAINER 118
668 #define GTPV2_IE_F_CAUSE 119
669 #define GTPV2_IE_SEL_PLMN_ID 120
670 #define GTPV2_IE_TARGET_ID 121
671 /* GTPV2_IE_NSAPI 122 */
672 #define GTPV2_IE_PKT_FLOW_ID 123
673 #define GTPV2_IE_RAB_CONTEXT 124
674 #define GTPV2_IE_S_RNC_PDCP_CTX_INFO 125
675 #define GTPV2_IE_UDP_S_PORT_NR 126
676 #define GTPV2_IE_APN_RESTRICTION 127
677 #define GTPV2_IE_SEL_MODE 128
678 #define GTPV2_IE_SOURCE_IDENT 129
679 #define GTPV2_IE_BEARER_CONTROL_MODE 130
680 #define GTPV2_IE_CNG_REP_ACT 131
681 #define GTPV2_IE_FQ_CSID 132
682 #define GTPV2_IE_CHANNEL_NEEDED 133
683 #define GTPV2_IE_EMLPP_PRI 134
684 #define GTPV2_IE_NODE_TYPE 135
685 #define GTPV2_IE_FQDN 136
686 #define GTPV2_IE_TI 137
687 #define GTPV2_IE_MBMS_SESSION_DURATION 138
688 #define GTPV2_IE_MBMS_SERVICE_AREA 139
689 #define GTPV2_IE_MBMS_SESSION_ID 140
690 #define GTPV2_IE_MBMS_FLOW_ID 141
691 #define GTPV2_IE_MBMS_IP_MC_DIST 142
692 #define GTPV2_IE_MBMS_DIST_ACK 143
693 #define GTPV2_IE_RFSP_INDEX 144
694 #define GTPV2_IE_UCI 145
695 #define GTPV2_IE_CSG_INFO_REP_ACTION 146
696 #define GTPV2_IE_CSG_ID 147
697 #define GTPV2_IE_CMI 148
698 #define GTPV2_IE_SERVICE_INDICATOR 149
699 #define GTPV2_IE_DETACH_TYPE 150
700 #define GTPV2_IE_LDN 151
701 #define GTPV2_IE_NODE_FEATURES 152
702 #define GTPV2_IE_MBMS_TIME_TO_DATA_XFER 153
703 #define GTPV2_IE_THROTTLING 154
704 #define GTPV2_IE_ARP 155
705 #define GTPV2_IE_EPC_TIMER 156
706 #define GTPV2_IE_SIG_PRIO_IND 157
707 #define GTPV2_IE_TMGI 158
708 #define GTPV2_IE_ADD_MM_CONT_FOR_SRVCC 159
709 #define GTPV2_IE_ADD_FLAGS_FOR_SRVCC 160
710 #define GTPV2_IE_MMBR 161
711 #define GTPV2_IE_MDT_CONFIG 162
712 #define GTPV2_IE_APCO 163
713 #define GTPV2_IE_ABS_MBMS_DATA_TF_TIME 164
714 #define GTPV2_IE_HENB_INFO_REPORT 165
715 #define GTPV2_IE_IP4CP 166
716 #define GTPV2_IE_CHANGE_TO_REPORT_FLAGS 167
717 #define GTPV2_IE_ACTION_INDICATION 168
718 /* 169 to 254 reserved for future use */
719 #define GTPV2_IE_PRIVATE_EXT 255
722 #define CREATE_NEW_TFT 0X20
723 #define DELETE_TFT 0X40
724 #define ADD_PACKET_FILTERS_TFT 0X60
725 #define REPLACE_PACKET_FILTERS_TFT 0X80
726 #define DELETE_PACKET_FILTERS_TFT 0XA0
727 #define NO_TFT_OPERATION 0XC0
728 #define RESERVED 0XE0
731 /* Table 8.1-1: Information Element types for GTPv2 */
732 static const value_string gtpv2_element_type_vals[] = {
734 { 1, "International Mobile Subscriber Identity (IMSI)"}, /* Variable Length / 8.3 */
735 { 2, "Cause"}, /* Variable Length / 8.4 */
736 { 3, "Recovery (Restart Counter)"}, /* Variable Length / 8.5 */
737 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
738 /* 51-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
739 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 6.1*/
740 { 51, "STN-SR"}, /* Variable Length / 6.2 */
741 { 52, "Source to Target Transparent Container"}, /* Variable Length / 6.3 */
742 { 53, "Target to Source Transparent Container"}, /* Variable Length / 6.4 */
743 { 54, "MM Context for E-UTRAN SRVCC"}, /* Variable Length / 6.5 */
744 { 55, "MM Context for UTRAN SRVCC"}, /* Variable Length / 6.6 */
745 { 56, "SRVCC Cause"}, /* Fixed Length / 6.7 */
746 { 57, "Target RNC ID"}, /* Variable Length / 6.8 */
747 { 58, "Target Global Cell ID"}, /* Variable Length / 6.9 */
748 { 59, "TEID-C"}, /* Extendable / 6.10 */
749 { 60, "Sv Flags"}, /* Extendable / 6.11 */
750 { 61, "Service Area Identifier"}, /* Extendable / 6.12 */
751 /* 62-70 For future Sv interface use */
752 /*End SRVCC Messages*/
753 { 71, "Access Point Name (APN)"}, /* Variable Length / 8.6 */
754 { 72, "Aggregate Maximum Bit Rate (AMBR)"}, /* Fixed Length / 8.7 */
755 { 73, "EPS Bearer ID (EBI)"}, /* Extendable / 8.8 */
756 { 74, "IP Address"}, /* Extendable / 8.9 */
757 { 75, "Mobile Equipment Identity (MEI)"}, /* Variable Length / 8.10 */
758 { 76, "MSISDN"}, /* Variable Length / 8.11 */
759 { 77, "Indication"}, /* Extendable / 8.12 */
760 { 78, "Protocol Configuration Options (PCO)"}, /* Variable Length / 8.13 */
761 { 79, "PDN Address Allocation (PAA)"}, /* Variable Length / 8.14 */
762 { 80, "Bearer Level Quality of Service (Bearer QoS)"}, /* Variable Length / 8.15 */
763 { 81, "Flow Quality of Service (Flow QoS)"}, /* Extendable / 8.16 */
764 { 82, "RAT Type"}, /* Extendable / 8.17 */
765 { 83, "Serving Network"}, /* Extendable / 8.18 */
766 { 84, "EPS Bearer Level Traffic Flow Template (Bearer TFT)"}, /* Variable Length / 8.19 */
767 { 85, "Traffic Aggregation Description (TAD)"}, /* Variable Length / 8.20 */
768 { 86, "User Location Info (ULI)"}, /* Variable Length / 8.21 */
769 { 87, "Fully Qualified Tunnel Endpoint Identifier (F-TEID)"}, /* Extendable / 8.22 */
770 { 88, "TMSI"}, /* Variable Length / 8.23 */
771 { 89, "Global CN-Id"}, /* Variable Length / 8.24 */
772 { 90, "S103 PDN Data Forwarding Info (S103PDF)"}, /* Variable Length / 8.25 */
773 { 91, "S1-U Data Forwarding Info (S1UDF)"}, /* Variable Length/ 8.26 */
774 { 92, "Delay Value"}, /* Extendable / 8.27 */
775 { 93, "Bearer Context"}, /* Extendable / 8.28 */
776 { 94, "Charging ID"}, /* Extendable / 8.29 */
777 { 95, "Charging Characteristics"}, /* Extendable / 8.30 */
778 { 96, "Trace Information"}, /* Extendable / 8.31 */
779 { 97, "Bearer Flags"}, /* Extendable / 8.32 */
780 { 98, "Paging Cause"}, /* Variable Length / 8.33 */
781 { 99, "PDN Type"}, /* Extendable / 8.34 */
782 {100, "Procedure Transaction ID"}, /* Extendable / 8.35 */
783 {101, "DRX Parameter"}, /* Variable Length/ 8.36 */
784 {102, "UE Network Capability"}, /* Variable Length / 8.37 */
785 {103, "MM Context (GSM Key and Triplets)"}, /* Variable Length / 8.38 */
786 {104, "MM Context (UMTS Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
787 {105, "MM Context (GSM Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
788 {106, "MM Context (UMTS Key and Quintuplets)"}, /* Variable Length / 8.38 */
789 {107, "MM Context (EPS Security Context, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
790 {108, "MM Context (UMTS Key, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
791 {109, "PDN Connection"}, /* Extendable / 8.39 */
792 {110, "PDU Numbers"}, /* Extendable / 8.40 */
793 {111, "P-TMSI"}, /* Variable Length / 8.41 */
794 {112, "P-TMSI Signature"}, /* Variable Length / 8.42 */
795 {113, "Hop Counter"}, /* Extendable / 8.43 */
796 {114, "UE Time Zone"}, /* Variable Length / 8.44 */
797 {115, "Trace Reference"}, /* Fixed Length / 8.45 */
798 {116, "Complete Request Message"}, /* Variable Length / 8.46 */
799 {117, "GUTI"}, /* Variable Length / 8.47 */
800 {118, "F-Container"}, /* Variable Length / 8.48 */
801 {119, "F-Cause"}, /* Variable Length / 8.49 */
802 {120, "Selected PLMN ID"}, /* Variable Length / 8.50 */
803 {121, "Target Identification"}, /* Variable Length / 8.51 */
804 {122, "NSAPI"}, /* Extendable / 8.52 */
805 {123, "Packet Flow ID"}, /* Variable Length / 8.53 */
806 {124, "RAB Context"}, /* Fixed Length / 8.54 */
807 {125, "Source RNC PDCP Context Info"}, /* Variable Length / 8.55 */
808 {126, "UDP Source Port Number"}, /* Extendable / 8.56 */
809 {127, "APN Restriction"}, /* Extendable / 8.57 */
810 {128, "Selection Mode"}, /* Extendable / 8.58 */
811 {129, "Source Identification"}, /* Variable Length / 8.50 */
812 {130, "Bearer Control Mode"}, /* Extendable / 8.60 */
813 {131, "Change Reporting Action"}, /* Variable Length / 8.61 */
814 {132, "Fully Qualified PDN Connection Set Identifier (FQ-CSID)"}, /* Variable Length / 8.62 */
815 {133, "Channel needed"}, /* Extendable / 8.63 */
816 {134, "eMLPP Priority"}, /* Extendable / 8.64 */
817 {135, "Node Type"}, /* Extendable / 8.65 */
818 {136, "Fully Qualified Domain Name (FQDN)"}, /* Variable Length / 8.66 */
819 {137, "Transaction Identifier (TI)"}, /* Variable Length / 8.68 */
820 {138, "MBMS Session Duration"}, /* Duration Extendable / 8.69 */
821 {139, "MBMS Service Area"}, /* Extendable / 8.70 */
822 {140, "MBMS Session Identifier"}, /* Extendable / 8.71 */
823 {141, "MBMS Flow Identifier"}, /* Extendable / 8.72 */
824 {142, "MBMS IP Multicast Distribution"}, /* Extendable / 8.73 */
825 {143, "MBMS Distribution Acknowledge"}, /* Extendable / 8.74 */
826 {144, "RFSP Index"}, /* Fixed Length / 8.77 */
827 {145, "User CSG Information (UCI)"}, /* Extendable / 8.75 */
828 {146, "CSG Information Reporting Action"}, /* Extendable / 8.76 */
829 {147, "CSG ID"}, /* Extendable / 8.78 */
830 {148, "CSG Membership Indication (CMI)"}, /* Extendable / 8.79 */
831 {149, "Service indicator"}, /* Fixed Length / 8.80 */
832 {150, "Detach Type"}, /* Fixed Length / 8.81 */
833 {151, "Local Distiguished Name (LDN)"}, /* Variable Length / 8.82 */
834 {152, "Node Features"}, /* Extendable / 8.83 */
835 {153, "MBMS Time to Data Transfer"}, /* Extendable / 8.84 */
836 {154, "Throttling"}, /* Extendable / 8.85 */
837 {155, "Allocation/Retention Priority (ARP)"}, /* Extendable / 8.86 */
838 {156, "EPC Timer"}, /* Extendable / 8.87 */
839 {157, "Signalling Priority Indication"}, /* Extendable / 8.88 */
840 {158, "Temporary Mobile Group Identity"}, /* Extendable / 8.89 */
841 {159, "Additional MM context for SRVCC"}, /* Extendable / 8.90 */
842 {160, "Additional flags for SRVCC"}, /* Extendable / 8.91 */
843 {161, "Max MBR/APN-AMBR (MMBR)"}, /* Extendable / 8.92 */
844 {162, "MDT Configuration"}, /* Extendable / 8.93 */
845 {163, "Additional Protocol Configuration Options (APCO)"}, /* Extendable / 8.94 */
846 {164, "Absolute Time of MBMS Data Transfer"}, /* Extendable / 8.95 */
847 {165, "H(e)NB Information Reporting"}, /* Extendable / 8.96*/
848 {166, "IPv4 Configuration Parameters (IP4CP)"}, /* Extendable / 8.97*/
849 {167, "Change to Report Flags"}, /* Extendable / 8.98 */
850 {168, "Action Indication"}, /* Extendable / 8.99 */
851 /* 169 to 254 Spare. For future use. */ /* For future use. FFS */
852 {255, "Private Extension"}, /* Variable Length / 8.67 */
855 static value_string_ext gtpv2_element_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_element_type_vals);
857 /* Code to dissect IE's */
860 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_)
862 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
866 * 8.3 International Mobile Subscriber Identity (IMSI)
868 * IMSI is defined in 3GPP TS 23.003
869 * Editor's note: IMSI coding will be defined in 3GPP TS 24.301
870 * Editor's note: In the first release of GTPv2 spec (TS 29.274v8.0.0) n = 8.
871 * That is, the overall length of the IE is 11 octets.
875 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_)
878 const gchar *imsi_str;
880 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
881 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
882 * allocated string will be returned.
884 imsi_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, length, NULL, FALSE);
886 proto_tree_add_string(tree, hf_gtpv2_imsi, tvb, offset, length, imsi_str);
887 proto_item_append_text(item, "%s", imsi_str);
895 /* Table 8.4-1: Cause values */
896 static const value_string gtpv2_cause_vals[] = {
898 /* Request / Initial message */
900 { 2, "Local Detach"},
901 { 3, "Complete Detach"},
902 { 4, "RAT changed from 3GPP to Non-3GPP"},
903 { 5, "ISR deactivation"},
904 { 6, "Error Indication received from RNC/eNodeB/S4-SGSN"},
905 { 7, "IMSI Detach Only"},
906 { 8, "Reactivation Requested"},
907 { 9, "PDN reconnection to this APN disallowed"},
908 { 10, "Access changed from Non-3GPP to 3GPP"},
909 { 11, "PDN connection inactivity timer expires"},
910 { 12, "PGW not responding"},
911 { 13, "Network Failure"},
912 { 14, "QoS parameter mismatch"},
913 /* 15 Spare. This value range is reserved for Cause values in a request message */
915 /* Acceptance in a Response / triggered message */
916 { 16, "Request accepted"},
917 { 17, "Request accepted partially"},
918 { 18, "New PDN type due to network preference"},
919 { 19, "New PDN type due to single address bearer only"},
920 /* 20-63 Spare. This value range shall be used by Cause values in an acceptance response/triggered message */
965 /* Rejection in a Response / triggered message */
966 { 64, "Context Not Found"},
967 { 65, "Invalid Message Format"},
968 { 66, "Version not supported by next peer"},
969 { 67, "Invalid length"},
970 { 68, "Service not supported"},
971 { 69, "Mandatory IE incorrect"},
972 { 70, "Mandatory IE missing"},
973 { 71, "Shall not be used"},
974 { 72, "System failure"},
975 { 73, "No resources available"},
976 { 74, "Semantic error in the TFT operation"},
977 { 75, "Syntactic error in the TFT operation"},
978 { 76, "Semantic errors in packet filter(s)"},
979 { 77, "Syntactic errors in packet filter(s)"},
980 { 78, "Missing or unknown APN"},
981 { 79, "Shall not be used"},
982 { 80, "GRE key not found"},
983 { 81, "Relocation failure"},
984 { 82, "Denied in RAT"},
985 { 83, "Preferred PDN type not supported"},
986 { 84, "All dynamic addresses are occupied"},
987 { 85, "UE context without TFT already activated"},
988 { 86, "Protocol type not supported"},
989 { 87, "UE not responding"},
991 { 89, "Service denied"},
992 { 90, "Unable to page UE"},
993 { 91, "No memory available"},
994 { 92, "User authentication failed"},
995 { 93, "APN access denied - no subscription"},
996 { 94, "Request rejected(reason not specified)"},
997 { 95, "P-TMSI Signature mismatch"},
998 { 96, "IMSI/IMEI not known"},
999 { 97, "Semantic error in the TAD operation"},
1000 { 98, "Syntactic error in the TAD operation"},
1001 { 99, "Shall not be used"},
1002 {100, "Remote peer not responding"},
1003 {101, "Collision with network initiated request"},
1004 {102, "Unable to page UE due to Suspension"},
1005 {103, "Conditional IE missing"},
1006 {104, "APN Restriction type Incompatible with currently active PDN connection"},
1007 {105, "Invalid overall length of the triggered response message and a piggybacked initial message"},
1008 {106, "Data forwarding not supported"},
1009 {107, "Invalid reply from remote peer"},
1010 {108, "Fallback to GTPv1"},
1011 {109, "Invalid peer"},
1012 {110, "Temporarily rejected due to handover procedure in progress"},
1013 {111, "Modifications not limited to S1-U bearers"},
1014 {112, "Request rejected for a PMIPv6 reason "},
1015 {113, "APN Congestion"},
1016 {114, "Bearer handling not supported"},
1017 {115, "UE already re-attached"},
1018 {116, "Multiple PDN connections for a given APN not allowed"},
1019 /* 117-239 Spare. For future use in a triggered/response message */
1020 /* 240-255 Spare. For future use in an initial/request message */
1023 value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals);
1025 /* Table 8.4-1: CS (Cause Source) */
1026 static const true_false_string gtpv2_cause_cs = {
1027 "Originated by remote node",
1028 "Originated by node sending the message",
1032 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_)
1037 /* Cause value octet 5 */
1038 tmp = tvb_get_guint8(tvb, offset);
1039 proto_tree_add_item(tree, hf_gtpv2_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1041 /* Add Cause to ie_tree */
1042 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(tmp, >pv2_cause_vals_ext, "Unknown"), tmp);
1045 /* Octet 6 Spare PCE BCE CS */
1046 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
1047 proto_tree_add_item(tree, hf_gtpv2_cause_pce, tvb, offset, 1, ENC_BIG_ENDIAN);
1048 proto_tree_add_item(tree, hf_gtpv2_cause_bce, tvb, offset, 1, ENC_BIG_ENDIAN);
1049 proto_tree_add_item(tree, hf_gtpv2_cause_cs, tvb, offset, 1, ENC_BIG_ENDIAN);
1052 /* If n = 2, a = 0 and the Cause IE shall be 6 octets long.
1053 * Therefore, octets "a(n+1) to a(n+4)" will not be present.
1054 * If n = 6, a = 1 and the Cause IE will be 10 octets long.
1056 if ( length == 2 ) {
1060 * If the rejection is due to a mandatory IE or a verifiable conditional IE is faulty
1061 * or missing, the offending IE shall be included within an additional field "a(n+1)
1062 * to a(n+4)". Only Type and Instance fields of the offending IE that caused the
1063 * rejection have a meaning. The length in the Octet 8-9 and spare bits in the Octet 10
1064 * shall be set to "0". In this case, the value of "n" shall be "6".
1065 * Otherwise, the value of "n" is equal to "2".
1068 /* Type of the offending IE */
1069 proto_tree_add_item(tree, hf_gtpv2_cause_off_ie_t, tvb, offset, 1, ENC_BIG_ENDIAN);
1073 proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1075 /* a(n+4) Spare Instance */
1076 proto_tree_add_bits_item(tree, hf_gtpv2_spare_half_octet, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
1077 proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
1082 * 8.5 Recovery (Restart Counter)
1085 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_)
1090 recovery = tvb_get_guint8(tvb, offset);
1091 proto_tree_add_item(tree, hf_gtpv2_rec, tvb, offset, 1, ENC_BIG_ENDIAN);
1092 proto_item_append_text(item, "%u", recovery);
1097 /*Start SRVCC Messages*/
1101 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_)
1103 proto_item *stn_sr_item;
1104 proto_tree *sub_tree;
1108 stn_sr_item = proto_tree_add_item(tree, hf_gtpv2_stn_sr, tvb, offset, length, ENC_NA);
1109 new_tvb = tvb_new_subset_length(tvb, offset, length);
1110 sub_tree = proto_item_add_subtree(stn_sr_item, ett_gtpv2_stn_sr);
1113 * contains the Nature of Address and Numbering Plan Indicator (NANPI) of the "AddressString" ASN.1 type (see 3GPP
1114 * 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
1115 * 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
1118 dissect_gsm_map_msisdn(new_tvb, pinfo, sub_tree);
1121 /* 6.3 Source to Target Transparent Container */
1124 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_)
1127 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1129 /*ra_type_flag = 0;*/
1131 /* Transparent Container
1132 * When target network is GERAN, this container carries the Old BSS to New BSS
1133 * Information IE defined in 3GPP TS 48.008 [8]. When target network is UTRAN, this container carries the Source RNC
1134 * to Target RNC Transparent Container IE defined in 3GPP TS 25.413 [9]. The Transparent container field includes the
1135 * IE value part as it is specified in the respective specification.
1137 proto_tree_add_text(tree, tvb, offset, length-1, "Transparent Container: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1139 * bssmap_old_bss_to_new_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo);
1140 * dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
1145 /* 6.4 Target to Source Transparent Container */
1147 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_)
1150 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1153 /* Transparent Container */
1154 proto_tree_add_text(tree, tvb, offset, length-1, "Transparent Container: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1159 /* 6.5 MM Context for E-UTRAN SRVCC */
1161 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_)
1165 proto_tree *ms_tree, *fi;
1167 proto_tree_add_item(tree, hf_gtpv2_eksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1169 proto_tree_add_text(tree, tvb, offset , 16, "CKsrvcc: %s ", tvb_bytes_to_ep_str(tvb, offset, 16));
1171 proto_tree_add_text(tree, tvb, offset, 16, "IKsrvcc: %s ", tvb_bytes_to_ep_str(tvb, offset, 16));
1174 /* Length of Mobile Station Classmark2 */
1175 elm_len = tvb_get_guint8(tvb, offset);
1176 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1178 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark2 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1179 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1180 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1183 /* Length of Mobile Station Classmark3 */
1184 elm_len = tvb_get_guint8(tvb, offset);
1185 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1187 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark3 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1188 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1189 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1192 /*Length of Supported Codec List */
1193 elm_len = tvb_get_guint8(tvb, offset);
1194 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1196 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Supported Codec List %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1197 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1198 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1202 /* 6.6 MM Context for UTRAN SRVCC */
1204 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_)
1208 proto_tree *ms_tree, *fi;
1210 proto_tree_add_item(tree, hf_gtpv2_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1213 proto_tree_add_text(tree, tvb, offset, 16, "CK'cs: %s", tvb_bytes_to_ep_str(tvb, offset, 16));
1215 proto_tree_add_text(tree, tvb, offset, 16, "IK'cs: %s", tvb_bytes_to_ep_str(tvb, offset, 16));
1217 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
1219 proto_tree_add_item(tree, hf_gtpv2_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
1222 /*Length of Mobile Station Classmark2 */
1223 elm_len = tvb_get_guint8(tvb, offset);
1224 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1226 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark2 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1227 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1228 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1231 /*Length of Mobile Station Classmark3 */
1232 elm_len = tvb_get_guint8(tvb, offset);
1233 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1235 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark3 %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1236 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1237 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1240 /*Length of Supported Codec List */
1241 elm_len = tvb_get_guint8(tvb, offset);
1242 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1244 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Supported Codec List %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1245 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1246 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1250 /* 6.7 SRVCC Cause */
1251 static const value_string gtpv2_srvcc_cause_vals[] = {
1254 {2, "Handover/Relocation cancelled by source system "},
1255 {3, "Handover /Relocation Failure with Target system"},
1256 {4, "Handover/Relocation Target not allowed"},
1257 {5, "Unknown Target ID"},
1258 {6, "Target Cell not available"},
1259 {7, "No Radio Resources Available in Target Cell"},
1260 {8, "Failure in Radio Interface Procedure"},
1261 {9, "Permanent session leg establishment error"},
1262 {10, "Temporary session leg establishment error"},
1266 static value_string_ext gtpv2_srvcc_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_srvcc_cause_vals);
1269 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_)
1274 srvcc_cause = tvb_get_guint8(tvb, offset);
1275 proto_tree_add_item(tree, hf_gtpv2_srvcc_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1276 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(srvcc_cause, >pv2_srvcc_cause_vals_ext, "Unknown"), srvcc_cause);
1281 * 3GPP TS 29.280 version 10.3.0
1285 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_)
1289 proto_tree *subtree;
1290 proto_item *rai_item;
1294 guint32 curr_offset;
1296 /*ra_type_flag = 1;*/ /*Flag to be set to differentiate GERAN and UTRAN*/
1297 curr_offset = offset;
1299 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1300 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1301 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1302 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1303 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1304 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1305 if ((mnc & 0x000f) == 0x000f)
1308 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1309 rnc_id = tvb_get_ntohs(tvb, curr_offset + 5);
1311 rai_item = proto_tree_add_text(tree,
1312 tvb, curr_offset, 6,
1313 "Routing area identification: %x-%x-%u-%u",
1314 mcc, mnc, lac, rnc_id);
1316 subtree = proto_item_add_subtree(rai_item, ett_gtpv2_rai);
1317 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, TRUE);
1320 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1322 proto_tree_add_item(subtree, hf_gtpv2_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1325 /* no length check possible */
1332 * 6.9 Target Global Cell ID
1333 * The encoding of this IE is defined in 3GPP TS 29.002
1334 * GlobalCellId ::= OCTET STRING (SIZE (5..7))
1335 * -- Refers to Cell Global Identification defined in TS 3GPP TS 23.003 [17].
1336 * -- The internal structure is defined as follows:
1337 * -- octet 1 bits 4321 Mobile Country Code 1st digit
1338 * -- bits 8765 Mobile Country Code 2nd digit
1339 * -- octet 2 bits 4321 Mobile Country Code 3rd digit
1340 * -- bits 8765 Mobile Network Code 3rd digit
1341 * -- or filler (1111) for 2 digit MNCs
1342 * -- octet 3 bits 4321 Mobile Network Code 1st digit
1343 * -- bits 8765 Mobile Network Code 2nd digit
1344 * -- octets 4 and 5 Location Area Code according to TS 3GPP TS 24.008 [35]
1345 * -- octets 6 and 7 Cell Identity (CI) according to TS 3GPP TS 24.008 [35]
1348 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_)
1352 proto_tree *subtree;
1353 proto_item *rai_item;
1357 guint32 curr_offset;
1359 curr_offset = offset;
1361 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1362 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1363 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1364 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1365 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1366 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1367 if ((mnc & 0x000f) == 0x000f)
1370 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1371 tgt_cell_id = tvb_get_guint8(tvb, curr_offset + 5);
1373 rai_item = proto_tree_add_text(tree,
1374 tvb, curr_offset, 6,
1375 "Routing area identification: %x-%x-%u-%u",
1376 mcc, mnc, lac, tgt_cell_id);
1378 subtree = proto_item_add_subtree(rai_item, ett_gtpv2_rai);
1379 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, TRUE);
1381 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset + 3, 2, ENC_BIG_ENDIAN);
1382 proto_tree_add_item(subtree, hf_gtpv2_tgt_g_cell_id, tvb, curr_offset + 5, 2, ENC_BIG_ENDIAN);
1384 proto_item_append_text(item, "%x-%x-%u-%u", mcc, mnc, lac, tgt_cell_id);
1385 /* no length check possible */
1389 /* 6.10 Tunnel Endpoint Identifier for Control Plane (TEID-C) */
1391 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_)
1395 proto_tree_add_item(tree, hf_gtpv2_teid_c, tvb, offset, 4, ENC_BIG_ENDIAN);
1398 proto_tree_add_text(tree, tvb, offset, length-4, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-4));
1400 proto_item_append_text(item, "%u", tvb_get_ntohl(tvb, offset-4));
1405 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_)
1408 proto_tree_add_item(tree, hf_gtpv2_sv_sti, tvb, offset, 1, ENC_BIG_ENDIAN);
1409 proto_tree_add_item(tree, hf_gtpv2_sv_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
1410 proto_tree_add_item(tree, hf_gtpv2_sv_emind, tvb, offset, 1, ENC_BIG_ENDIAN);
1413 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1416 /* 6.12 Service Area Identifier */
1419 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_)
1423 /* 5 MCC digit 2 MCC digit 1
1424 * 6 MNC digit 3 MCC digit 3
1425 * 7 MNC digit 2 MNC digit 1
1427 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
1430 /* 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
1431 * least significant bit. The coding of the location area code is the responsibility of each administration. Coding using full
1432 * hexadecimal representation shall be used.
1434 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1437 /* 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
1438 * least significant bit. The SAC is defined by the operator. See 3GPP TS 23.003 [4] subclause 12.5 for more information
1440 proto_tree_add_item(tree, hf_gtpv2_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
1443 /*End SRVCC Messages*/
1447 * 8.6 Access Point Name (APN)
1448 * The encoding the APN field follows 3GPP TS 23.003 [2] subclause 9.1.
1449 * The content of the APN field shall be the full APN with both the APN Network Identifier
1450 * and APN Operator Identifier being present as specified in 3GPP TS 23.003 [2]
1451 * 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.
1454 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_)
1461 name_len = tvb_get_guint8(tvb, offset);
1463 if (name_len < 0x20) {
1464 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
1466 if (name_len >= length - 1)
1469 name_len = name_len + apn[tmp] + 1;
1473 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
1475 proto_tree_add_string(tree, hf_gtpv2_apn, tvb, offset, length, apn);
1479 proto_item_append_text(item, "%s", apn);
1484 * 8.7 Aggregate Maximum Bit Rate (AMBR)
1488 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_)
1492 proto_tree_add_item(tree, hf_gtpv2_ambr_up, tvb, offset, 4, ENC_BIG_ENDIAN);
1494 proto_tree_add_item(tree, hf_gtpv2_ambr_down, tvb, offset, 4, ENC_BIG_ENDIAN);
1498 * 8.8 EPS Bearer ID (EBI)
1501 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_)
1507 /* Spare (all bits set to 0) B8 - B5*/
1508 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
1509 /* EPS Bearer ID (EBI) B4 - B1 */
1510 ebi = tvb_get_guint8(tvb, offset);
1511 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
1512 proto_item_append_text(item, "%u", ebi);
1519 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_)
1522 struct e_in6_addr ipv6_address;
1526 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv4, tvb, offset, length, ENC_BIG_ENDIAN);
1527 proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(tvb, offset));
1529 else if (length == 16)
1531 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv6, tvb, offset, length, ENC_NA);
1532 tvb_get_ipv6(tvb, offset, &ipv6_address);
1533 proto_item_append_text(item, "IPv6 %s", ip6_to_str(&ipv6_address));
1537 * 8.10 Mobile Equipment Identity (MEI)
1538 * The ME Identity field contains either the IMEI or the IMEISV
1539 * as defined in clause 6.2 of 3GPP TS 23.003 [2]. It is encoded
1540 * as specified in clause 7.7.53 of 3GPP TS 29.060 [4], beginning
1541 * with octet 4 of Figure 7.7.53.1. The IMEI(SV) digits are encoded
1542 * using BCD coding where IMEI is 15 BCD digits and IMEISV is 16 BCD
1543 * digits. For IMEI, bits 5 to 8 of the last octet shall be filled
1544 * with an end mark coded as '1111'.
1548 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_)
1551 const gchar *mei_str;
1553 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1554 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1555 * allocated string will be returned.
1557 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, 0, length, NULL, FALSE);
1559 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, length, mei_str);
1560 proto_item_append_text(item, "%s", mei_str);
1566 * MSISDN is defined in 3GPP TS 23.003
1567 * Editor's note: MSISDN coding will be defined in TS 24.301.
1570 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_)
1572 const char *digit_str;
1574 /* Octets 5 to (n+4) represent the MSISDN value is in international number format
1575 * as described in ITU-T Rec E.164 [25] and 3GPP TS 29.002 [41].
1576 * MSISDN value contains only the actual MSISDN number (does not contain the "nature of
1577 * address indicator" octet, which indicates "international number"
1578 * as in 3GPP TS 29.002 [41]) and is encoded as TBCD digits, i.e.
1579 * digits from 0 through 9 are encoded "0000" to "1001".
1580 * When there is an odd number of digits, bits 8 to 5 of the last octet are encoded with
1581 * the filler "1111".
1583 dissect_e164_cc(tvb, tree, 0, TRUE);
1584 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1585 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1586 * allocated string will be returned.
1588 digit_str = tvb_bcd_dig_to_wmem_packet_str( tvb, 0, length, NULL, FALSE);
1590 proto_tree_add_string(tree, hf_gtpv2_address_digits, tvb, 0, length, digit_str);
1591 proto_item_append_text(item, "%s", digit_str);
1598 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_)
1601 /* Octet 5 DAF DTF HI DFI OI ISRSI ISRAI SGWCI */
1602 proto_tree_add_item(tree, hf_gtpv2_daf, tvb, offset, 1, ENC_BIG_ENDIAN);
1603 proto_tree_add_item(tree, hf_gtpv2_dtf, tvb, offset, 1, ENC_BIG_ENDIAN);
1604 proto_tree_add_item(tree, hf_gtpv2_hi, tvb, offset, 1, ENC_BIG_ENDIAN);
1605 proto_tree_add_item(tree, hf_gtpv2_dfi, tvb, offset, 1, ENC_BIG_ENDIAN);
1606 proto_tree_add_item(tree, hf_gtpv2_oi, tvb, offset, 1, ENC_BIG_ENDIAN);
1607 proto_tree_add_item(tree, hf_gtpv2_isrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1608 proto_tree_add_item(tree, hf_gtpv2_israi, tvb, offset, 1, ENC_BIG_ENDIAN);
1609 proto_tree_add_item(tree, hf_gtpv2_sgwci, tvb, offset, 1, ENC_BIG_ENDIAN);
1612 proto_tree_add_text(tree, tvb, 0, length, "Older version?, should be 2 octets in 8.0.0");
1618 /* Octet 6 SQCI UIMSI CFSI CRSI P PT SI MSV
1619 * 3GPP TS 29.274 version 9.4.0 Release 9
1621 proto_tree_add_item(tree, hf_gtpv2_sqci, tvb, offset, 1, ENC_BIG_ENDIAN);
1622 proto_tree_add_item(tree, hf_gtpv2_uimsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1623 proto_tree_add_item(tree, hf_gtpv2_cfsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1624 proto_tree_add_item(tree, hf_gtpv2_crsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1626 proto_tree_add_item(tree, hf_gtpv2_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
1627 proto_tree_add_item(tree, hf_gtpv2_pt, tvb, offset, 1, ENC_BIG_ENDIAN);
1628 proto_tree_add_item(tree, hf_gtpv2_si, tvb, offset, 1, ENC_BIG_ENDIAN);
1629 proto_tree_add_item(tree, hf_gtpv2_msv, tvb, offset, 1, ENC_BIG_ENDIAN);
1635 /* Only present in version 9 and higher */
1636 /* Octet 7 Spare Spare Spare Spare Spare Spare Spare CCRSI */
1637 proto_tree_add_item(tree, hf_gtpv2_spare1, tvb, offset, 1, ENC_BIG_ENDIAN);
1638 proto_tree_add_item(tree, hf_gtpv2_spare2, tvb, offset, 1, ENC_BIG_ENDIAN);
1639 proto_tree_add_item(tree, hf_gtpv2_spare3, tvb, offset, 1, ENC_BIG_ENDIAN);
1640 proto_tree_add_item(tree, hf_gtpv2_s6af, tvb, offset, 1, ENC_BIG_ENDIAN);
1641 proto_tree_add_item(tree, hf_gtpv2_s4af, tvb, offset, 1, ENC_BIG_ENDIAN);
1642 proto_tree_add_item(tree, hf_gtpv2_mbmdt, tvb, offset, 1, ENC_BIG_ENDIAN);
1643 proto_tree_add_item(tree, hf_gtpv2_israu, tvb, offset, 1, ENC_BIG_ENDIAN);
1644 proto_tree_add_item(tree, hf_gtpv2_ccrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1650 * 8.13 Protocol Configuration Options (PCO)
1651 * Protocol Configuration Options (PCO) is transferred via GTP tunnels. The sending entity copies the value part of the
1652 * 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
1653 * as per clause 10.5.6.3 of 3GPP TS 24.008 [5], starting with octet 3.
1654 * Dissected in packet-gsm_a_gm.c
1657 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_)
1659 switch (message_type) {
1660 case GTPV2_CREATE_SESSION_REQUEST:
1661 /* PCO options as MS to network direction */
1662 pinfo->link_dir = P2P_DIR_UL;
1664 case GTPV2_CREATE_SESSION_RESPONSE:
1665 /* PCO options as Network to MS direction: */
1666 pinfo->link_dir = P2P_DIR_DL;
1671 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
1675 * 8.14 PDN Address Allocation (PAA)
1678 static const value_string gtpv2_pdn_type_vals[] = {
1686 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_)
1691 pdn_type = tvb_get_guint8(tvb, offset);
1692 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1698 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1702 /* If PDN type value indicates IPv6, octet 6 contains the IPv6 Prefix Length.
1703 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1704 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1705 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1707 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1709 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1713 /* If PDN type value indicates IPv4v6, octet 6 contains the IPv6 Prefix Length.
1714 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1715 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1716 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1717 * Octets 23 through 26 contain an IPv4 address. Bit 8 of octet 23 represents
1718 * the most significant bit of the IPv4 address and bit 1 of octet 26 the least
1721 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1723 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1725 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1732 * 8.15 Bearer Quality of Service (Bearer QoS)
1736 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_)
1739 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
1740 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
1741 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
1743 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1745 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1747 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1749 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1751 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1755 * 8.16 Flow Quality of Service (Flow QoS)
1759 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_)
1762 proto_tree_add_item(tree, hf_gtpv2_flow_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1764 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1766 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1768 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1770 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1776 static const value_string gtpv2_rat_type_vals[] = {
1782 {5, "HSPA Evolution"},
1787 static value_string_ext gtpv2_rat_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_rat_type_vals);
1791 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_)
1795 rat_type = tvb_get_guint8(tvb, 0);
1796 proto_tree_add_item(tree, hf_gtpv2_rat_type, tvb, 0, 1, ENC_BIG_ENDIAN);
1797 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(rat_type, >pv2_rat_type_vals_ext, "Unknown"), rat_type);
1802 * 8.18 Serving Network
1805 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_)
1809 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, TRUE);
1810 proto_item_append_text(item, "%s", mcc_mnc_str);
1814 * 8.19 EPS Bearer Level Traffic Flow Template (Bearer TFT)
1818 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_)
1820 /* The detailed coding of Traffic Aggregate
1821 * Description is specified in 3GPP TS 24.008 [5] ,
1822 * clause 10.5.6.12, beginning with octet 3..
1823 * Use the decoding in packet-gsm_a_gm.c
1825 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
1828 /* 8.20 Traffic Aggregate Description (TAD)
1831 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_)
1833 /* The detailed coding of Traffic Aggregate
1834 * Description is specified in 3GPP TS 24.008 [5] ,
1835 * clause 10.5.6.12, beginning with octet 3..
1836 * Use the decoding in packet-gsm_a_gm.c
1838 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
1842 * 8.21 User Location Info (ULI)
1844 * The flags ECGI, TAI, RAI, SAI and CGI in octed 5 indicate if the corresponding
1845 * fields are present in the IE or not. If one of these flags is set to "0",
1846 * the corresponding field is not present at all. The respective identities are defined in 3GPP
1848 * Editor's Note: The definition of ECGI is missing in 3GPP TS 23.003 v8.1.0.
1849 * It can be found in 3GPP TS 36.413 v8.3.0, but it is expected that it will be moved
1850 * to 23.003 in a future version.
1854 decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 instance _U_, guint flags)
1856 int offset = 1; /* flags are already dissected */
1858 proto_tree *part_tree;
1862 /* 8.21.1 CGI field */
1863 if (flags & GTPv2_ULI_CGI_MASK)
1867 proto_item_append_text(item, "CGI ");
1868 fi = proto_tree_add_text(tree, tvb, offset, 7, "Cell Global Identity (CGI)");
1869 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1870 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1872 lac = tvb_get_ntohs(tvb, offset);
1873 proto_tree_add_item(part_tree, hf_gtpv2_uli_cgi_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1875 ci = tvb_get_ntohs(tvb, offset);
1876 proto_tree_add_item(part_tree, hf_gtpv2_uli_cgi_ci, tvb, offset, 2, ENC_BIG_ENDIAN);
1878 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, CI 0x%x",
1882 if (offset == length)
1886 /* 8.21.2 SAI field */
1887 if (flags & GTPv2_ULI_SAI_MASK)
1891 proto_item_append_text(item, "SAI ");
1892 fi = proto_tree_add_text(tree, tvb, offset, 7, "Service Area Identity (SAI)");
1893 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1894 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1896 lac = tvb_get_ntohs(tvb, offset);
1897 proto_tree_add_item(part_tree, hf_gtpv2_uli_sai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1899 sac = tvb_get_ntohs(tvb, offset);
1900 proto_tree_add_item(part_tree, hf_gtpv2_uli_sai_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
1902 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, SAC 0x%x",
1906 if (offset == length)
1909 /* 8.21.3 RAI field */
1910 if (flags & GTPv2_ULI_RAI_MASK)
1913 proto_item_append_text(item, "RAI ");
1914 fi = proto_tree_add_text(tree, tvb, offset, 7, "Routeing Area Identity (RAI)");
1915 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1916 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1918 lac = tvb_get_ntohs(tvb, offset);
1919 proto_tree_add_item(part_tree, hf_gtpv2_uli_rai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1921 rac = tvb_get_ntohs(tvb, offset);
1922 proto_tree_add_item(part_tree, hf_gtpv2_uli_rai_rac, tvb, offset, 2, ENC_BIG_ENDIAN);
1924 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, RAC 0x%x",
1929 if (offset == length)
1932 /* 8.21.4 TAI field */
1933 if (flags & GTPv2_ULI_TAI_MASK)
1936 proto_item_append_text(item, "TAI ");
1937 fi = proto_tree_add_text(tree, tvb, offset, 5, "Tracking Area Identity (TAI)");
1938 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1939 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1941 tac = tvb_get_ntohs(tvb, offset);
1942 proto_tree_add_item(part_tree, hf_gtpv2_uli_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
1944 str = wmem_strdup_printf(wmem_packet_scope(), "%s, TAC 0x%x",
1947 if (offset == length)
1950 /* 8.21.5 ECGI field */
1951 if (flags & GTPv2_ULI_ECGI_MASK)
1958 proto_item_append_text(item, "ECGI ");
1959 fi = proto_tree_add_text(tree, tvb, offset, 7, "E-UTRAN Cell Global Identifier (ECGI)");
1960 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1961 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1963 /* The bits 8 through 5, of octet e+3 (Fig 8.21.5-1 in TS 29.274 V8.2.0) are spare
1964 * and hence they would not make any difference to the hex string following it,
1965 * thus we directly read 4 bytes from the tvb
1968 octet = tvb_get_guint8(tvb, offset);
1969 spare = octet & 0xF0;
1970 octet4 = tvb_get_ntohl(tvb, offset);
1971 ECGI = octet4 & 0x0FFFFFFF;
1972 proto_tree_add_uint(part_tree, hf_gtpv2_uli_ecgi_eci_spare, tvb, offset, 1, spare);
1973 /* The coding of the E-UTRAN cell identifier is the responsibility of each administration.
1974 * Coding using full hexadecimal representation shall be used.
1976 proto_tree_add_uint(part_tree, hf_gtpv2_uli_ecgi_eci, tvb, offset, 4, ECGI);
1977 /*proto_tree_add_item(tree, hf_gtpv2_uli_ecgi_eci, tvb, offset, 4, ENC_BIG_ENDIAN);*/
1979 str = wmem_strdup_printf(wmem_packet_scope(), "%s, ECGI 0x%x",
1983 if (offset == length)
1987 /* 8.21.6 LAI field */
1988 if (flags & GTPv2_ULI_LAI_MASK)
1991 proto_item_append_text(item, "LAI ");
1992 fi = proto_tree_add_text(tree, tvb, offset, 5, "LAI (Location Area Identifier)");
1993 part_tree = proto_item_add_subtree(fi, ett_gtpv2_uli_field);
1994 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1997 /* The Location Area Code (LAC) consists of 2 octets. Bit 8 of Octet f+3 is the most significant bit
1998 * and bit 1 of Octet f+4 the least significant bit. The coding of the location area code is the
1999 * responsibility of each administration. Coding using full hexadecimal representation shall be used.
2001 proto_tree_add_item(part_tree, hf_gtpv2_uli_lai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
2002 lac = tvb_get_ntohs(tvb, offset);
2003 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x",
2014 dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2016 proto_item *flags_item;
2017 proto_tree *flag_tree;
2021 flags_item = proto_tree_add_text(tree, tvb, offset, 1, "Flags");
2022 flag_tree = proto_item_add_subtree(flags_item, ett_gtpv2_uli_flags);
2023 flags = tvb_get_guint8(tvb, offset) & 0x3f;
2024 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset >> 3, 2, ENC_BIG_ENDIAN);
2027 proto_tree_add_item(flag_tree, hf_gtpv2_uli_lai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2029 proto_tree_add_item(flag_tree, hf_gtpv2_uli_ecgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2031 proto_tree_add_item(flag_tree, hf_gtpv2_uli_tai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2033 proto_tree_add_item(flag_tree, hf_gtpv2_uli_rai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2035 proto_tree_add_item(flag_tree, hf_gtpv2_uli_sai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2037 proto_tree_add_item(flag_tree, hf_gtpv2_uli_cgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2039 decode_gtpv2_uli(tvb, pinfo, tree, item, length, instance, flags);
2044 /* Diameter 3GPP AVP Code: 22 3GPP-User-Location-Info */
2047 * 16.4.7.2 Coding 3GPP Vendor-Specific RADIUS attributes
2049 * For P-GW, the Geographic Location Type values and coding are defined as follows:
2054 * 3-127 Spare for future use
2058 * 131-255 Spare for future use
2062 static const value_string geographic_location_type_vals[] = {
2068 {130, "TAI and ECGI"},
2073 dissect_diameter_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2075 diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
2080 length = tvb_length(tvb);
2081 flags_3gpp = tvb_get_guint8(tvb, offset);
2083 proto_tree_add_item(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN);
2089 flags = GTPv2_ULI_CGI_MASK;
2093 flags = GTPv2_ULI_SAI_MASK;
2097 flags = GTPv2_ULI_RAI_MASK;
2101 flags = GTPv2_ULI_TAI_MASK;
2105 flags = GTPv2_ULI_ECGI_MASK;
2109 flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_ECGI_MASK;
2112 proto_tree_add_text(tree, tvb, 1, -1, "Geographic Location");
2116 diam_sub_dis->avp_str = decode_gtpv2_uli(tvb, pinfo, tree, NULL, length, 0, flags);
2121 * 8.22 Fully Qualified TEID (F-TEID)
2123 static const value_string gtpv2_f_teid_interface_type_vals[] = {
2124 { 0, "S1-U eNodeB GTP-U interface"},
2125 { 1, "S1-U SGW GTP-U interface"},
2126 { 2, "S12 RNC GTP-U interface"},
2127 { 3, "S12 SGW GTP-U interface"},
2128 { 4, "S5/S8 SGW GTP-U interface"},
2129 { 5, "S5/S8 PGW GTP-U interface"},
2130 { 6, "S5/S8 SGW GTP-C interface"},
2131 { 7, "S5/S8 PGW GTP-C interface"},
2132 { 8, "S5/S8 SGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2133 "and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6)"}, */
2134 { 9, "S5/S8 PGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2135 "and the control plane and user plane addresses are the same for PMIPv6)"}, */
2136 {10, "S11 MME GTP-C interface"},
2137 {11, "S11/S4 SGW GTP-C interface"},
2138 {12, "S10 MME GTP-C interface"},
2139 {13, "S3 MME GTP-C interface"},
2140 {14, "S3 SGSN GTP-C interface"},
2141 {15, "S4 SGSN GTP-U interface"},
2142 {16, "S4 SGW GTP-U interface"},
2143 {17, "S4 SGSN GTP-C interface"},
2144 {18, "S16 SGSN GTP-C interface"},
2145 {19, "eNodeB GTP-U interface for DL data forwarding"},
2146 {20, "eNodeB GTP-U interface for UL data forwarding"},
2147 {21, "RNC GTP-U interface for data forwarding"},
2148 {22, "SGSN GTP-U interface for data forwarding"},
2149 {23, "SGW GTP-U interface for data forwarding"},
2150 {24, "Sm MBMS GW GTP-C interface"},
2151 {25, "Sn MBMS GW GTP-C interface"},
2152 {26, "Sm MME GTP-C interface"},
2153 {27, "Sn SGSN GTP-C interface"},
2154 {28, "SGW GTP-U interface for UL data forwarding"},
2155 {29, "Sn SGSN GTP-U interface"},
2156 {30, "S2b ePDG GTP-C interface"},
2157 {31, "S2b-U ePDG GTP-U interface"},
2158 {32, "S2b PGW GTP-C interface"},
2159 {33, "S2b-U PGW GTP-U interface"},
2160 {34, "S2a TWAN GTP-U interface"},
2161 {35, "S2a TWAN GTP-C interface"},
2162 {36, "S2a PGW GTP-C interface"},
2163 {37, "S2a PGW GTP-U interface"},
2166 static value_string_ext gtpv2_f_teid_interface_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_f_teid_interface_type_vals);
2168 static const true_false_string gtpv2_f_teid_v4_vals = {
2169 "IPv4 address present",
2170 "IPv4 address not present",
2173 static const true_false_string gtpv2_f_teid_v6_vals = {
2174 "IPv6 address present",
2175 "IPv6 address not present",
2179 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_)
2184 flags = tvb_get_guint8(tvb, offset);
2185 proto_tree_add_item(tree, hf_gtpv2_f_teid_v4, tvb, offset, 1, ENC_BIG_ENDIAN);
2186 proto_tree_add_item(tree, hf_gtpv2_f_teid_v6, tvb, offset, 1, ENC_BIG_ENDIAN);
2187 /* NOTE: "Interface type" IE is defined with 5 bits only in the earlier releases of this specification,
2188 * thus pre-Rel-10 GTPv2-C nodes can ignore bit "6" which is marked as "Spare" in earlier releases,
2189 * allowing backward compatibility.
2191 proto_tree_add_item(tree, hf_gtpv2_f_teid_interface_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2194 proto_tree_add_item(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2195 proto_item_append_text(item, "%s, TEID/GRE Key: 0x%s",
2196 val_to_str_ext_const((flags & 0x3f), >pv2_f_teid_interface_type_vals_ext, "Unknown"),
2197 tvb_bytes_to_ep_str(tvb, offset, 4));
2202 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
2203 proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(tvb, offset));
2208 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, ENC_NA);
2209 proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(tvb, offset));
2216 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_)
2218 proto_tree_add_item(tree, hf_gtpv2_tmsi, tvb, 0, 4, ENC_BIG_ENDIAN);
2219 proto_tree_add_text(item, tvb, 0, length, "TMSI: %s", tvb_bytes_to_ep_str(tvb, 0, 4));
2224 * 12.3 CN Identifier
2226 * A CN node is uniquely identified within a PLMN by its CN Identifier (CN-Id). The CN-Id together with the PLMN
2227 * identifier globally identifies the CN node. The CN-Id together with the PLMN-Id is used as the CN node identifier in
2228 * RANAP signalling over the Iu interface.
2229 * Global CN-Id = PLMN-Id || CN-Id
2230 * The CN-Id is defined by the operator, and set in the nodes via O&M.
2231 * For the syntax description and the use of this identifier in RANAP signalling, see 3GPP TS 25.413 [17].
2235 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_)
2239 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
2242 /* >CN-ID M INTEGER (0..4095) */
2243 proto_tree_add_text(tree, tvb, offset, 2, "CN-Id: %s",
2244 tvb_bytes_to_ep_str(tvb, offset, 2));
2247 * 8.25 S103 PDN Data Forwarding Info (S103PDF)
2250 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_)
2255 /* The HSGW Address and GRE Key identify a GRE Tunnel towards a HSGW over S103 interface for a specific PDN
2256 * connection of the UE. The EPS Bearer IDs specify the EPS Bearers which require data forwarding that belonging to this
2257 * PDN connection. The number of EPS bearer Ids included is specified by the value of EPS Bearer ID Number.
2259 /* Octet 5 HSGW Address for forwarding Length = m */
2260 m = tvb_get_guint8(tvb, offset);
2261 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_f_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2264 /* 6 to (m+5) HSGW Address for forwarding [4..16] */
2268 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2273 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2278 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2279 "Wrong length %u, should be 4 or 16", m);
2283 /* (m+6)- to (m+9) GRE Key */
2284 proto_tree_add_item(tree, hf_gtpv2_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2287 /* (m+10) EPS Bearer ID Number = k */
2288 k = tvb_get_guint8(tvb, offset);
2289 proto_tree_add_text(tree, tvb, offset, 1, "EPS Bearer ID Number = %d", k);
2292 /* (m+11) to (m+10+k)
2293 * Spare EPS Bearer ID
2295 for ( i = 0; i < k; i++ ) {
2296 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2297 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2303 * 8.26 S1-U Data Forwarding (S1UDF)
2306 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_)
2311 /* 5 Spare EPS Bearer ID */
2312 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2313 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2315 /* 6 Serving GW Address Length = m */
2316 m = tvb_get_guint8(tvb, offset);
2317 proto_tree_add_text(tree, tvb, offset, 1, "Serving GW Address Length = %u", m);
2319 /* 7 to (m+6) Serving GW Address [4..16] */
2323 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2328 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2333 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2334 "Wrong length %u, should be 4 or 16", m);
2339 * Serving GW S1-U TEID
2341 proto_tree_add_item(tree, hf_gtpv2_sgw_s1u_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
2349 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_)
2353 proto_tree_add_item(tree, hf_gtpv2_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2357 * 8.28 Bearer Context (grouped IE)
2361 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_)
2365 proto_tree *grouped_tree;
2367 proto_item_append_text(item, "[Grouped IE]");
2368 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_bearer_ctx);
2370 new_tvb = tvb_new_subset_length(tvb, offset, length);
2371 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type);
2374 /* 8.29 Charging ID */
2376 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_)
2380 proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, ENC_BIG_ENDIAN);
2384 /* 8.30 Charging Characteristics
2385 * The charging characteristics information element is defined in 3GPP TS 32.251 [8]
2386 * and is a way of informing both the SGW and PGW of the rules for producing charging
2387 * information based on operator configured triggers. For the encoding of this
2388 * information element see 3GPP TS 32.298 [9].
2391 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_)
2395 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, 2, ENC_BIG_ENDIAN);
2398 /* These octet(s) is/are present only if explicitly specified */
2399 proto_tree_add_text(tree, tvb, offset, length-2, "Remaining octets");
2408 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_)
2413 /* Octet 5 Spare VB PPC */
2414 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_ppc, tvb, offset, length, ENC_BIG_ENDIAN);
2415 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_vb, tvb, offset, length, ENC_BIG_ENDIAN);
2422 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_)
2429 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2430 "Wrong length indicated. Expected 1, got %u", length);
2434 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
2435 pdn = tvb_get_guint8(tvb, offset)& 0x7;
2436 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, ENC_BIG_ENDIAN);
2437 proto_item_append_text(item, "%s", val_to_str_const(pdn, gtpv2_pdn_type_vals, "Unknown"));
2442 * 8.31 Trace Information
2445 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_)
2447 proto_item *trigg, *msc_server, *mgw, *sgsn, *ggsn, *bm_sc, *sgw_mme, *ne_types;
2448 proto_tree *trigg_tree, *msc_server_tree, *mgw_tree, *sgsn_tree, *ggsn_tree;
2449 proto_tree *bm_sc_tree, *sgw_mme_tree, *ne_types_tree;
2450 proto_item *interfaces, *imsc_server, *lmgw, *lsgsn, *lggsn, *lrnc, *lbm_sc, *lmme, *lsgw, *lpdn_gw, *lenb;
2451 proto_tree *interfaces_tree, *imsc_server_tree, *lmgw_tree, *lsgsn_tree, *lggsn_tree, *lrnc_tree;
2452 proto_tree *lbm_sc_tree, *lmme_tree, *lsgw_tree, *lpdn_gw_tree, *lenb_tree;
2456 guint8 *trace_id = NULL;
2462 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
2465 /* Append Trace ID to main tree */
2466 tid = tvb_get_ntohs(tvb, offset);
2467 proto_item_append_text(item, "Trace ID: %d ", tid);
2470 /*--------------------------------------------------
2471 * trace_id = tvb_format_text(tvb, offset, 2);
2472 * proto_tree_add_string(tree, hf_gtpv2_tra_info, tvb, offset, length, trace_id);
2473 *--------------------------------------------------*/
2474 proto_tree_add_text(tree, tvb, offset, 3, "Trace ID: %d", tid);
2477 /* Triggering Events, put all into a new tree called trigging_tree */
2478 trigg = proto_tree_add_text(tree, tvb, offset, 8, "Trigging Events");
2479 trigg_tree = proto_item_add_subtree(trigg, ett_gtpv2_tra_info_trigg);
2481 /* Create all subtrees */
2482 msc_server = proto_tree_add_text(trigg_tree, tvb, offset, 2, "MSC Server");
2483 msc_server_tree = proto_item_add_subtree(msc_server, ett_gtpv2_tra_info_trigg_msc_server);
2485 mgw = proto_tree_add_text(trigg_tree, tvb, offset + 2, 1, "MGW");
2486 mgw_tree = proto_item_add_subtree(mgw, ett_gtpv2_tra_info_trigg_mgw);
2488 sgsn = proto_tree_add_text(trigg_tree, tvb, offset + 3, 2, "SGSN");
2489 sgsn_tree = proto_item_add_subtree(sgsn, ett_gtpv2_tra_info_trigg_sgsn);
2491 ggsn = proto_tree_add_text(trigg_tree, tvb, offset + 5, 1, "GGSN");
2492 ggsn_tree = proto_item_add_subtree(ggsn, ett_gtpv2_tra_info_trigg_ggsn);
2494 bm_sc = proto_tree_add_text(trigg_tree, tvb, offset + 6, 1, "BM-SC");
2495 bm_sc_tree = proto_item_add_subtree(bm_sc, ett_gtpv2_tra_info_trigg_bm_sc);
2497 sgw_mme = proto_tree_add_text(trigg_tree, tvb, offset + 7, 1, "SGW MME");
2498 sgw_mme_tree = proto_item_add_subtree(sgw_mme, ett_gtpv2_tra_info_trigg_sgw_mme);
2500 /* MSC Server - 2 octets */
2501 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_calls, tvb, offset, 1, ENC_BIG_ENDIAN);
2502 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2503 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_lu_imsi_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2504 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_handovers, tvb, offset, 1, ENC_BIG_ENDIAN);
2505 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2506 bit_offset = offset << 3;
2507 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2509 bit_offset = offset << 3;
2510 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2514 proto_tree_add_item(mgw_tree, hf_gtpv2_tra_info_mgw_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2515 bit_offset = offset << 3;
2516 proto_tree_add_bits_item(mgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2518 /* SGSN - 2 octets */
2519 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_pdp_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2520 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2521 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_rau_gprs_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2522 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2523 bit_offset = offset << 3;
2524 proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2526 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2527 bit_offset = offset << 3;
2528 proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_reserved, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2530 /* GGSN - 1 octet */
2531 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_pdp, tvb, offset, 1, ENC_BIG_ENDIAN);
2532 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2533 bit_offset = offset << 3;
2534 proto_tree_add_bits_item(ggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2536 /* BM-SC - 1 octet */
2537 proto_tree_add_item(bm_sc_tree, hf_gtpv2_tra_info_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2538 bit_offset = offset << 3;
2539 proto_tree_add_bits_item(bm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2541 /* MME/SGW - 1 octet */
2542 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2543 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_sr, tvb, offset, 1, ENC_BIG_ENDIAN);
2544 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_iataud, tvb, offset, 1, ENC_BIG_ENDIAN);
2545 bit_offset = offset << 3;
2546 proto_tree_add_bits_item(sgw_mme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2549 /* Create NE Types subtree */
2550 ne_types = proto_tree_add_text(tree, tvb, offset, 2, "List of NE Types");
2551 ne_types_tree = proto_item_add_subtree(ne_types, ett_gtpv2_tra_info_ne_types);
2554 /* List of NE Types */
2555 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_msc_s, tvb, offset, 1, ENC_BIG_ENDIAN);
2556 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2557 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2558 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_ggsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2559 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_rnc, tvb, offset, 1, ENC_BIG_ENDIAN);
2560 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2561 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2562 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2564 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_pdn_gw, tvb, offset, 1, ENC_BIG_ENDIAN);
2565 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_enb, tvb, offset, 1, ENC_BIG_ENDIAN);
2566 bit_offset = offset << 3;
2567 proto_tree_add_bits_item(ne_types_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2570 /* Trace Depth Length */
2571 tdl = tvb_get_guint8(tvb, offset);
2572 proto_tree_add_item(tree, hf_gtpv2_tra_info_tdl, tvb, offset, 1, ENC_BIG_ENDIAN);
2576 * Will be displayed if length of Trace Depth Length is > 0
2577 * The list will only contains UTF8String, RAW DATA
2579 proto_tree_add_text(tree, tvb, offset, tdl, "Trace Depth List: %s", tvb_bytes_to_ep_str(tvb, offset, tdl));
2582 /* Set up subtree interfaces and put all interfaces under it */
2583 interfaces = proto_tree_add_text(tree, tvb, offset, 12, "List of Interfaces");
2584 interfaces_tree = proto_item_add_subtree(interfaces, ett_gtpv2_tra_info_interfaces);
2586 /* Create all subtrees */
2587 imsc_server = proto_tree_add_text(interfaces_tree, tvb, offset, 2, "MSC Server");
2588 imsc_server_tree = proto_item_add_subtree(imsc_server, ett_gtpv2_tra_info_interfaces_imsc_server);
2590 lmgw = proto_tree_add_text(interfaces_tree, tvb, offset + 2, 1, "MGW");
2591 lmgw_tree = proto_item_add_subtree(lmgw, ett_gtpv2_tra_info_interfaces_lmgw);
2593 lsgsn = proto_tree_add_text(interfaces_tree, tvb, offset + 3, 2, "SGSN");
2594 lsgsn_tree = proto_item_add_subtree(lsgsn, ett_gtpv2_tra_info_interfaces_lsgsn);
2596 lggsn = proto_tree_add_text(interfaces_tree, tvb, offset + 5, 1, "GGSN");
2597 lggsn_tree = proto_item_add_subtree(lggsn, ett_gtpv2_tra_info_interfaces_lggsn);
2599 lrnc = proto_tree_add_text(interfaces_tree, tvb, offset + 6, 1, "RNC");
2600 lrnc_tree = proto_item_add_subtree(lrnc, ett_gtpv2_tra_info_interfaces_lrnc);
2602 lbm_sc = proto_tree_add_text(interfaces_tree, tvb, offset + 7, 1, "BM-SC");
2603 lbm_sc_tree = proto_item_add_subtree(lbm_sc, ett_gtpv2_tra_info_interfaces_lbm_sc);
2605 lmme = proto_tree_add_text(interfaces_tree, tvb, offset + 8, 1, "MME");
2606 lmme_tree = proto_item_add_subtree(lmme, ett_gtpv2_tra_info_interfaces_lmme);
2608 lsgw = proto_tree_add_text(interfaces_tree, tvb, offset + 9, 1, "SGW");
2609 lsgw_tree = proto_item_add_subtree(lsgw, ett_gtpv2_tra_info_interfaces_lsgw);
2611 lpdn_gw = proto_tree_add_text(interfaces_tree, tvb, offset + 10, 1, "PDN GW");
2612 lpdn_gw_tree = proto_item_add_subtree(lpdn_gw, ett_gtpv2_tra_info_interfaces_lpdn_gw);
2614 lenb = proto_tree_add_text(interfaces_tree, tvb, offset + 11, 1, "eNB");
2615 lenb_tree = proto_item_add_subtree(lenb, ett_gtpv2_tra_info_interfaces_lpdn_lenb);
2617 /* MSC Server - 2 octests */
2618 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_a, tvb, offset, 1, ENC_BIG_ENDIAN);
2619 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2620 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2621 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_g, tvb, offset, 1, ENC_BIG_ENDIAN);
2622 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_b, tvb, offset, 1, ENC_BIG_ENDIAN);
2623 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_e, tvb, offset, 1, ENC_BIG_ENDIAN);
2624 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_f, tvb, offset, 1, ENC_BIG_ENDIAN);
2625 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_cap, tvb, offset, 1, ENC_BIG_ENDIAN);
2627 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_d, tvb, offset, 1, ENC_BIG_ENDIAN);
2628 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_c, tvb, offset, 1, ENC_BIG_ENDIAN);
2629 bit_offset = offset << 3;
2630 proto_tree_add_bits_item(imsc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2633 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2634 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_nb_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2635 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_lu_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2636 bit_offset = offset << 3;
2637 proto_tree_add_bits_item(lmgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2639 /* SGSN - 2 octets */
2640 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gb, tvb, offset, 1, ENC_BIG_ENDIAN);
2641 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2642 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2643 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gr, tvb, offset, 1, ENC_BIG_ENDIAN);
2644 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gd, tvb, offset, 1, ENC_BIG_ENDIAN);
2645 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gf, tvb, offset, 1, ENC_BIG_ENDIAN);
2646 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gs, tvb, offset, 1, ENC_BIG_ENDIAN);
2647 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_ge, tvb, offset, 1, ENC_BIG_ENDIAN);
2649 bit_offset = offset << 3;
2650 proto_tree_add_bits_item(lsgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2653 /* GGSN - 1 octet */
2654 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2655 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gi, tvb, offset, 1, ENC_BIG_ENDIAN);
2656 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2657 bit_offset = offset << 3;
2658 proto_tree_add_bits_item(lggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2661 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2662 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lur, tvb, offset, 1, ENC_BIG_ENDIAN);
2663 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lub, tvb, offset, 1, ENC_BIG_ENDIAN);
2664 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2665 bit_offset = offset << 3;
2666 proto_tree_add_bits_item(lrnc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2668 /* BM_SC - 1 octet */
2669 proto_tree_add_item(lbm_sc_tree, hf_gtpv2_tra_info_lbm_sc_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2670 bit_offset = offset << 3;
2671 proto_tree_add_bits_item(lbm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2674 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2675 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s3, tvb, offset, 1, ENC_BIG_ENDIAN);
2676 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s6a, tvb, offset, 1, ENC_BIG_ENDIAN);
2677 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s10, tvb, offset, 1, ENC_BIG_ENDIAN);
2678 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2679 bit_offset = offset << 3;
2680 proto_tree_add_bits_item(lmme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2683 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s4, tvb, offset, 1, ENC_BIG_ENDIAN);
2684 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2685 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2686 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2687 bit_offset = offset << 3;
2688 proto_tree_add_bits_item(lsgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2690 /* PDN GW - 1 octet */
2691 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2a, tvb, offset, 1, ENC_BIG_ENDIAN);
2692 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2b, tvb, offset, 1, ENC_BIG_ENDIAN);
2693 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2c, tvb, offset, 1, ENC_BIG_ENDIAN);
2694 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2695 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s6c, tvb, offset, 1, ENC_BIG_ENDIAN);
2696 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_gx, tvb, offset, 1, ENC_BIG_ENDIAN);
2697 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2698 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_sgi, tvb, offset, 1, ENC_BIG_ENDIAN);
2701 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2702 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_x2, tvb, offset, 1, ENC_BIG_ENDIAN);
2703 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2704 bit_offset = offset << 3;
2705 proto_tree_add_bits_item(lenb_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2707 /*--------------------------------------------------
2709 *--------------------------------------------------*/
2711 /* IP Address of Trace Collection Entity */
2712 while ( (offset + 4) <= length ) {
2714 proto_tree_add_item(tree, hf_gtpv2_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
2721 * 8.33 Void (TS 129 274 V9.4.0 (2010-10))
2724 /* 8.35 Procedure Transaction ID (PTI) */
2726 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_)
2728 proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, ENC_BIG_ENDIAN);
2731 * 8.36 DRX Parameter
2734 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_)
2738 /* 36.413 : 9.2.1.17 Paging Cause, void */
2739 proto_tree_add_text(tree, tvb, offset, length, "DRX parameter: %s", tvb_bytes_to_ep_str(tvb, offset, (length )));
2743 * 8.37 UE Network Capability
2744 * UE Network Capability is coded as depicted in Figure 8.37-1. Actual coding of the UE Network Capability field is
2745 * defined in 3GPP TS 24.301
2748 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_)
2750 de_emm_ue_net_cap(tvb, tree, pinfo, 0, length, NULL, 0);
2756 static const value_string gtpv2_mm_context_security_mode[] = {
2757 {0, "GSM Key and Triplets"},
2758 {1, "UMTS Key, Used Cipher and Quintuplets"},
2759 {2, "GSM Key, Used Cipher and Quintuplets"},
2760 {3, "UMTS Key and Quintuplets"},
2761 {4, "EPS Security Context, Quadruplets and Quintuplets" },
2762 {5, "UMTS Key, Quadruplets and Quintuplets"},
2766 static const true_false_string gtpv2_nhi_vals = {
2767 "NH (Next Hop) and NCC (Next Hop Chaining Count) are both present",
2768 "NH (Next Hop) and NCC (Next Hop Chaining Count) not present",
2771 /* Table 8.38-2: Used NAS Cipher Values */
2773 static const value_string gtpv2_mm_context_unc_vals[] = {
2774 {0, "No ciphering"},
2785 /* Table 8.38-3: Used Cipher Values */
2786 static const value_string gtpv2_mm_context_used_cipher_vals[] = {
2787 {0, "No ciphering"},
2798 /* Table 8.38-4: Used NAS integrity protection algorithm Values */
2799 static const value_string gtpv2_mm_context_unipa_vals[] = {
2800 {0, "No ciphering"},
2811 /* Helper functions */
2813 /* Figure 8.38-7: Authentication Triplet */
2815 dissect_gtpv2_authentication_triplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 num_triplet)
2817 proto_item *auth_tri_item;
2818 proto_tree *auth_tri_tree;
2821 for (i = 0; i < num_triplet; i++) {
2822 auth_tri_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Triplet %u", i);
2823 auth_tri_tree = proto_item_add_subtree(auth_tri_item, ett_gtpv2_mm_context_auth_tri);
2825 * Figure 8.38-8: Authentication Quintuplet
2830 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
2832 proto_tree_add_text(auth_tri_tree, tvb, offset, 4, "SRES': %s", tvb_bytes_to_ep_str(tvb, offset, 4));
2834 proto_tree_add_text(auth_tri_tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
2843 dissect_gtpv2_authentication_quintuplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
2845 proto_item *auth_qui_item;
2846 proto_tree *auth_qui_tree;
2848 guint8 xres_len, autn_len;
2850 for (i = 0; i < nr_qui; i++) {
2851 auth_qui_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quintuplet %u", i);
2852 auth_qui_tree = proto_item_add_subtree(auth_qui_item, ett_gtpv2_mm_context_auth_qui);
2854 * Figure 8.38-8: Authentication Quintuplet
2858 * (m+1) to (m+16) CK
2859 * (m+17) to (m+32) IK
2863 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
2865 xres_len = tvb_get_guint8(tvb, offset);
2866 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2868 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres, tvb, offset, xres_len, ENC_NA);
2870 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
2872 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
2874 autn_len = tvb_get_guint8(tvb, offset);
2875 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2877 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn, tvb, offset, autn_len, ENC_NA);
2886 dissect_gtpv2_authentication_quadruplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
2888 proto_item *auth_qua_item;
2889 proto_tree *auth_qua_tree;
2893 for (i = 0; i < nr_qui; i++) {
2894 auth_qua_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quadruplet");
2895 auth_qua_tree = proto_item_add_subtree(auth_qua_item, ett_gtpv2_mm_context_auth_qua);
2897 proto_tree_add_text(auth_qua_tree, tvb, offset, 16, "RAND: %s",
2898 tvb_bytes_to_ep_str(tvb, offset, 16));
2901 tmp = tvb_get_guint8(tvb, offset++);
2903 proto_tree_add_text(auth_qua_tree, tvb, offset, tmp, "XRES: %s",
2904 tvb_bytes_to_ep_str(tvb, offset, tmp));
2907 tmp = tvb_get_guint8(tvb, offset++);
2909 proto_tree_add_text(auth_qua_tree, tvb, offset, tmp, "AUTN: %s",
2910 tvb_bytes_to_ep_str(tvb, offset, tmp));
2913 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
2920 static const value_string gtpv2_mm_context_higher_br_16mb_flg_vals[] = {
2927 dissect_gtpv2_mm_context_common_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint8 samb_ri, guint8 uamb_ri)
2929 proto_item *net_cap_item, *msnt_cap_item;
2930 proto_tree *net_cap_tree, *msnt_cap_tree;
2931 guint8 ue_net_cap_len, ms_net_cap_len, mei_len;
2934 * If SAMBRI (Subscribed UE AMBR Indicator), bit 1 of octet 6, is set to "1",
2935 * then the Uplink/downlink Subscribed UE AMBR parameter field is present,
2938 /* j to (j+3) Uplink Subscribed UE AMBR */
2939 proto_tree_add_text(tree, tvb, offset, 4, "Uplink Subscribed UE AMBR: %d Kbps",
2940 tvb_get_ntohl(tvb, offset));
2943 /* (j+4) to (j+7) Downlink Subscribed UE AMBR */
2944 proto_tree_add_text(tree, tvb, offset, 4, "Downlink Subscribed UE AMBR: %d Kbps",
2945 tvb_get_ntohl(tvb, offset));
2950 * If UAMBRI (Used UE AMBR Indicator), bit 2 of octet 6, is set to "1",
2951 * then the Uplink/downlink Used UE AMBR parameter field is present
2954 /* i to (i+3) Uplink Used UE AMBR */
2955 proto_tree_add_text(tree, tvb, offset, 4, "Uplink Used UE AMBR: %d Kbps",
2956 tvb_get_ntohl(tvb, offset));
2959 /* (i+4) to (i+7) Downlink Used UE AMBR */
2960 proto_tree_add_text(tree, tvb, offset, 4, "Downlink Used UE AMBR: %d Kbps",
2961 tvb_get_ntohl(tvb, offset));
2965 /* q Length of UE Network Capability */
2966 ue_net_cap_len = tvb_get_guint8(tvb, offset);
2967 proto_tree_add_item(tree, hf_gtpv2_mm_context_ue_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2969 /* (q+1) to k UE Network Capability */
2970 if (ue_net_cap_len) {
2971 /* The UE Network Capability coding is specified in clause 9.9.3.34 of 3GPP TS 24.301 [23].
2972 * If Length of UE Network Capability is zero, then the UE Network Capability parameter
2973 * shall not be present.
2975 net_cap_item = proto_tree_add_text(tree, tvb, offset, ue_net_cap_len, "UE Network Capability");
2976 net_cap_tree = proto_item_add_subtree(net_cap_item, ett_gtpv2_mm_context_net_cap);
2977 offset += de_emm_ue_net_cap(tvb, net_cap_tree, pinfo, offset, ue_net_cap_len, NULL, 0);
2979 /* k+1 Length of MS Network Capability */
2980 ms_net_cap_len = tvb_get_guint8(tvb, offset);
2981 proto_tree_add_item(tree, hf_gtpv2_mm_context_ms_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2983 /* (k+2) to m MS Network Capability
2984 * The MS Network Capability coding is specified in clause 10.5.5.12 of 3GPP TS 24.008 [5].
2985 * If Length of MS Network Capability is zero, then the MS Network Capability parameter shall not be present.
2987 if (ms_net_cap_len) {
2988 msnt_cap_item = proto_tree_add_text(tree, tvb, offset, ms_net_cap_len, "MS network capability");
2989 msnt_cap_tree = proto_item_add_subtree(msnt_cap_item, ett_gtpv2_ms_network_capability);
2990 offset += de_gmm_ms_net_cap(tvb, msnt_cap_tree, pinfo, offset, ms_net_cap_len, NULL, 0);
2992 /* m+1 Length of Mobile Equipment Identity (MEI) */
2993 mei_len = tvb_get_guint8(tvb, offset);
2994 proto_tree_add_item(tree, hf_gtpv2_mm_context_mei_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2996 /* (m+2) to r Mobile Equipment Identity (MEI) */
2998 const gchar *mei_str;
3000 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, mei_len, NULL, FALSE);
3001 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, mei_len, mei_str);
3008 dissect_gtpv2_access_restriction_data(tvbuff_t *tvb, proto_tree *tree, int offset)
3010 proto_item *accrstdata_item;
3011 proto_tree *accrstdata_tree;
3013 accrstdata_item = proto_tree_add_text(tree, tvb, offset, 1, "Access restriction data");
3014 accrstdata_tree = proto_item_add_subtree(accrstdata_item, ett_gtpv2_access_rest_data);
3015 /* Spare HNNA ENA INA GANA GENA UNA */
3016 proto_tree_add_bits_item(accrstdata_tree, hf_gtpv2_spare_bits, tvb, (offset << 3), 2, ENC_BIG_ENDIAN);
3017 proto_tree_add_item(accrstdata_tree, hf_gtpv2_hnna, tvb, offset, 1, ENC_BIG_ENDIAN);
3018 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ena, tvb, offset, 1, ENC_BIG_ENDIAN);
3019 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ina, tvb, offset, 1, ENC_BIG_ENDIAN);
3020 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gana, tvb, offset, 1, ENC_BIG_ENDIAN);
3021 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gena, tvb, offset, 1, ENC_BIG_ENDIAN);
3022 proto_tree_add_item(accrstdata_tree, hf_gtpv2_una, tvb, offset, 1, ENC_BIG_ENDIAN);
3028 /* Type = 103 (decimal)
3029 * Figure 8.38-1: GSM Key and Triplets
3032 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_)
3035 proto_tree *flag_tree;
3037 guint8 oct, drxi, num_triplet, uamb_ri, samb_ri;
3040 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3041 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3044 /* Security Mode | Spare | DRXI | CKSN */
3045 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3046 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3047 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
3048 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3049 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
3052 /* Number of Triplet | Spare | UAMB RI | SAMB RI */
3053 oct = tvb_get_guint8(tvb, offset);
3054 num_triplet = oct >> 5;
3055 uamb_ri = (oct & 0x02) >> 1;
3056 samb_ri = oct & 0x01;
3058 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_tri, tvb, offset, 1, ENC_BIG_ENDIAN);
3059 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3060 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3061 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3064 /* Octet 7 Spare Used Cipher */
3065 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3066 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3070 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
3073 /* 16 to h Authentication Triplet [0..4] */
3075 dissect_gtpv2_authentication_triplets(tvb, tree, offset, num_triplet);
3079 * (h+1) to (h+2) DRX parameter
3082 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3086 /* Dissect octet j to r */
3087 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3089 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3092 /* Type = 104 (decimal)
3093 * Figure 8.38-2: UMTS Key, Used Cipher and Quintuplets
3096 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_)
3099 proto_tree *flag_tree;
3101 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3104 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3105 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3108 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3109 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3110 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3111 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3112 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3115 oct = tvb_get_guint8(tvb, offset);
3117 uamb_ri = (oct & 0x02) >> 1;
3118 samb_ri = oct & 0x01;
3119 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3120 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3121 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3122 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3124 /* Octet 7 Spare Used Cipher */
3125 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3126 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3129 /* Octet 8 to 23 CK */
3130 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3132 /* Octet 24 to 39 IK */
3133 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3137 * 40 to h Authentication Quintuplet [0..4]
3140 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3144 * (h+1) to (h+2) DRX parameter
3147 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3152 /* Dissect octet j to r */
3153 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3155 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3156 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3157 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3158 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3160 if (offset < (gint)length) {
3161 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3165 if (offset == (gint)length) {
3169 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3170 vdp_len = tvb_get_guint8(tvb, offset);
3171 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3173 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3175 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3179 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3180 if (offset == (gint)length) {
3181 hbr_len = tvb_get_guint8(tvb, offset);
3182 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3184 /* s+2 Higher bitrates than 16 Mbps flag */
3186 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3193 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3197 /* Type = 105 (decimal)
3198 * Figure 8.38-3: GSM Key, Used Cipher and Quintuplets
3201 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_)
3204 proto_tree *flag_tree;
3206 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3209 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3210 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3213 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3214 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3215 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3216 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3217 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3220 oct = tvb_get_guint8(tvb, offset);
3222 uamb_ri = (oct & 0x02) >> 1;
3223 samb_ri = oct & 0x01;
3224 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3225 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3226 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3227 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3229 /* Octet 7 Spare Used Cipher */
3230 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3231 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3234 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
3238 * 40 to h Authentication Quintuplet [0..4]
3241 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3245 * (h+1) to (h+2) DRX parameter
3248 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3253 /* Dissect octet j to r */
3254 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3256 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3257 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3258 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3259 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3261 if (offset < (gint)length) {
3262 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3266 if (offset == (gint)length) {
3270 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3271 vdp_len = tvb_get_guint8(tvb, offset);
3272 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3274 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3276 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3280 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3281 if (offset < (gint)length) {
3282 hbr_len = tvb_get_guint8(tvb, offset);
3283 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3285 /* s+2 Higher bitrates than 16 Mbps flag */
3287 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3294 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3298 /* Type = 106 (decimal)
3299 * Figure 8.38-4: UMTS Key and Quintuplets
3302 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_)
3305 proto_tree *flag_tree;
3307 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3310 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3311 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3314 /* Security Mode Spare DRXI KSI */
3315 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3316 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3317 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3318 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3319 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3322 /* Number of Quintuplets Spare UAMB RI SAMB RI */
3323 oct = tvb_get_guint8(tvb, offset);
3325 uamb_ri = (oct & 0x02) >> 1;
3326 samb_ri = oct & 0x01;
3328 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3329 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3330 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3331 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3334 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3336 /* Octet 8 to 23 CK */
3337 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3339 /* Octet 24 to 39 IK */
3340 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3344 * 40 to h Authentication Quintuplet [0..4]
3347 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3351 * (h+1) to (h+2) DRX parameter
3354 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3359 /* Dissect octet j to r */
3360 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3362 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3363 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3364 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3365 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3367 if (offset < (gint)length) {
3368 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3372 if (offset == (gint)length) {
3376 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3377 vdp_len = tvb_get_guint8(tvb, offset);
3378 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3380 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3382 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3386 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3387 if (offset < (gint)length) {
3388 hbr_len = tvb_get_guint8(tvb, offset);
3389 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3391 /* s+2 Higher bitrates than 16 Mbps flag */
3393 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3400 /* (s+3) to (n+4) These octet(s) is/are present only if explicitly specified */
3401 proto_tree_add_text(flag_tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3406 * Type = 107 (decimal)
3407 * Figure 8.38-5: EPS Security Context and Quadruplets
3410 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_)
3412 proto_item *flag_item, *qua_item, *qui_item;
3413 proto_tree *flag_tree, *qua_tree, *qui_tree;
3415 guint8 tmp, nhi, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_len;
3419 flag_item = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3420 flag_tree = proto_item_add_subtree(flag_item, ett_gtpv2_mm_context_flag);
3425 * Security Mode | NHI | DRXI | KSIASME
3427 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3428 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nhi, tvb, offset, 1, ENC_BIG_ENDIAN);
3429 /* If NHI (Next Hop Indicator), bit 5 of octet 5, is set to "1",
3430 * then the optional parameters NH (Next Hop) and NCC (Next
3431 * Hop Chaining Count) are both present, otherwise their octets are not present.
3433 tmp = tvb_get_guint8(tvb, offset);
3434 nhi = (tmp & 0x10) >> 4;
3435 drxi = (tmp & 0x08) >> 3;
3436 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3437 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3443 * Number of | Number of | UAMB | OSCI
3444 * Quintuplets | Quadruplet | RI |
3446 tmp = tvb_get_guint8(tvb, offset);
3447 nr_qui = (tmp & 0xe0) >> 5;
3448 nr_qua = tmp & 0x1c;
3450 uamb_ri = (tmp & 0x2) >> 1;
3452 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3453 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3455 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3457 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_osci, tvb, offset, 1, ENC_BIG_ENDIAN);
3460 /* Octet 7 SAMB RI Used NAS integrity protection algorithm Used NAS Cipher*/
3462 samb_ri = tvb_get_guint8(tvb, offset) >> 7;
3463 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
3464 /* Used NAS integrity protection algorithm */
3465 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unipa, tvb, offset, 1, ENC_BIG_ENDIAN);
3466 /* Used NAS Cipher */
3467 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unc, tvb, offset, 1, ENC_BIG_ENDIAN);
3470 /* Octet 8-10 NAS Downlink Count*/
3471 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_dl_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3474 /* Octet 11-13 NAS Uplink Count */
3475 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_ul_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3479 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
3482 qua_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quadruplets %u", nr_qua);
3484 qua_tree = proto_item_add_subtree(qua_item, ett_gtpv2_qua);
3485 offset = dissect_gtpv2_authentication_quadruplets(tvb, qua_tree, offset, nr_qua);
3487 PROTO_ITEM_SET_GENERATED(qua_item);
3490 qui_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quintuplets %u", nr_qui);
3492 qui_tree = proto_item_add_subtree(qui_item, ett_gtpv2_qui);
3493 offset = dissect_gtpv2_authentication_quintuplets(tvb, qui_tree, offset, nr_qui);
3495 PROTO_ITEM_SET_GENERATED(qui_item);
3498 /* (h+1) to (h+2) DRX parameter */
3500 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3504 /* Octet p to p+31 & Octet p+32 */
3507 proto_tree_add_text(tree, tvb, offset, 32, "NH (Next Hop): %s",
3508 tvb_bytes_to_ep_str(tvb, offset, 32));
3511 proto_tree_add_text(tree, tvb, offset, 1, "NCC (Next Hop Chaining Count): %d",
3512 (tvb_get_guint8(tvb, offset) & 0x0f));
3517 /* Dissect octet j to r */
3518 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3520 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3521 if (offset < (gint)length) {
3522 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3527 if (offset == (gint)length) {
3531 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3532 vdp_len = tvb_get_guint8(tvb, offset);
3533 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3535 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3537 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3538 /*offset += vdp_len;*/
3544 * Type = 108 (decimal)
3545 * Figure 8.38-6: UMTS Key, Quadruplets and Quintuplets
3548 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_)
3551 proto_tree *flag_tree;
3553 guint8 tmp, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_length;
3556 flag = proto_tree_add_text(tree, tvb, offset, 3, "MM Context flags");
3557 flag_tree = proto_item_add_subtree(flag, ett_gtpv2_mm_context_flag);
3560 * Security Mode Spare DRXI KSIASME
3562 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3563 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3564 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3565 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3566 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3572 * Number of | Number of | UAMB | SAMB
3573 * Quintuplets | Quadruplet | RI | RI
3575 tmp = tvb_get_guint8(tvb, offset);
3576 nr_qui = (tmp & 0xe0) >> 5;
3577 nr_qua = tmp & 0x1c;
3579 uamb_ri = (tmp & 0x2) >> 1;
3580 samb_ri = tmp & 0x01;
3582 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3583 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3584 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3585 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3588 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3590 /* Octet 8 to 23 CK */
3591 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3593 /* Octet 24 to 39 IK */
3594 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3599 offset = dissect_gtpv2_authentication_quadruplets(tvb, tree, offset, nr_qui);
3603 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3606 /* (h+1) to (h+2) DRX parameter */
3608 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3612 /* Dissect octet j to r */
3613 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3615 if (offset >= (guint32)length) {
3618 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3619 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3621 if (offset >= (guint32)length) {
3625 /* 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
3626 * Length of Voice Domain Preference and UE's Usage Setting is zero, then the Voice Domain Preference and UE's Usage
3627 * Setting parameter shall not be present.
3629 vdp_length = tvb_get_guint8(tvb, offset);
3630 proto_tree_add_item(tree, hf_gtpv2_vdp_length, tvb, offset, 1, ENC_BIG_ENDIAN);
3634 offset += de_gmm_voice_domain_pref(tvb, tree, pinfo, offset, vdp_length, NULL, 0);
3637 if (offset < (guint32)length) {
3638 proto_tree_add_text(tree, tvb, offset, -1, "The rest of the IE not dissected yet");
3644 * 8.39 PDN Connection (grouped IE)
3647 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_)
3650 proto_tree *grouped_tree;
3653 proto_item_append_text(item, "[Grouped IE]");
3654 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
3655 new_tvb = tvb_new_subset_length(tvb, offset, length);
3657 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type);
3663 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_)
3665 proto_item *nsapi_ti;
3666 proto_tree *nsapi_tree;
3668 guint16 dlgtpu_seq, ulgtpu_seq, send_npdu_nr, rec_npdu_nr;
3671 nsapi = (tvb_get_guint8(tvb, offset) & 0x08);
3672 nsapi_ti = proto_tree_add_text(tree, tvb, offset, 1, "NSAPI: %d", nsapi);
3673 nsapi_tree = proto_item_add_subtree(nsapi_ti, ett_gtpv2_pdn_numbers_nsapi);
3674 proto_tree_add_bits_item(nsapi_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3675 proto_tree_add_item(nsapi_tree, hf_gtpv2_pdn_numbers_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
3676 proto_item_append_text(item, "NSAPI: %u", nsapi);
3679 dlgtpu_seq = tvb_get_ntohs(tvb, offset);
3680 proto_tree_add_text(tree, tvb, offset, 2, "DL GTP-U Sequence Number: %d", dlgtpu_seq);
3683 ulgtpu_seq = tvb_get_ntohs(tvb, offset);
3684 proto_tree_add_text(tree, tvb, offset, 2, "UL GTP-U Sequence Number: %d", ulgtpu_seq);
3687 send_npdu_nr = tvb_get_ntohs(tvb, offset);
3688 proto_tree_add_text(tree, tvb, offset, 2, "Send N-PDU Number: %d", send_npdu_nr);
3691 rec_npdu_nr = tvb_get_ntohs(tvb, offset);
3692 proto_tree_add_text(tree, tvb, offset, 2, "Receive N-PDU Number: %d", rec_npdu_nr);
3696 * 8.41 Packet TMSI (P-TMSI)
3699 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_)
3703 /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation. */
3704 proto_tree_add_item(tree, hf_gtpv2_p_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
3705 proto_item_append_text(item, "%s", tvb_bytes_to_ep_str(tvb, offset, 4));
3709 * 8.42 P-TMSI Signature
3712 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_)
3716 /* The P-TMSI Signature consists of 3 octets and may be allocated by the SGSN. */
3717 proto_tree_add_item(tree, hf_gtpv2_p_tmsi_sig, tvb, offset, 3, ENC_BIG_ENDIAN);
3718 proto_item_append_text(item, "%s", tvb_bytes_to_ep_str(tvb, offset, 3));
3726 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_)
3731 hop_counter = tvb_get_guint8(tvb, offset);
3733 proto_tree_add_text(tree, tvb, offset, 1, "Hop Counter: %d", hop_counter);
3734 proto_item_append_text(item, "%d", hop_counter);
3741 static const value_string gtpv2_ue_time_zone_dst_vals[] = {
3742 {0, "No Adjustments for Daylight Saving Time"},
3743 {1, "+1 Hour Adjustments for Daylight Saving Time"},
3744 {2, "+2 Hour Adjustments for Daylight Saving Time"},
3749 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_)
3754 * UE Time Zone is used to indicate the offset between universal time and local time in steps of 15 minutes of where the
3755 * UE currently resides. The "Time Zone" field uses the same format as the "Time Zone" IE in 3GPP TS 24.008 [5].
3756 * (packet-gsm_a_dtap.c)
3758 de_time_zone(tvb, tree, pinfo, offset, 1, NULL, 0);
3760 proto_tree_add_item(item, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, ENC_BIG_ENDIAN);
3764 * 8.45 Trace Reference
3767 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_)
3773 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, TRUE);
3776 trace_id = tvb_get_ntohs(tvb, offset);
3777 proto_tree_add_text(tree, tvb, offset, 3, "Trace ID: %d", trace_id);
3779 proto_item_append_text(item, "%s,Trace ID %u", mcc_mnc_str, trace_id);
3782 * 8.46 Complete Request Message
3784 static const value_string gtpv2_complete_req_msg_type_vals[] = {
3785 {0, "Complete Attach Request Message" },
3786 {1, "Complete TAU Request Message" },
3790 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_)
3797 proto_tree_add_item(tree, hf_gtpv2_complete_req_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3801 /* Add the Complete Request Message */
3802 new_tvb = tvb_new_subset_remaining(tvb, offset);
3803 call_dissector(nas_eps_handle, new_tvb, pinfo, tree);
3811 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_)
3817 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
3820 proto_tree_add_item(tree, hf_gtpv2_mme_grp_id, tvb, offset, 2, ENC_BIG_ENDIAN);
3823 proto_tree_add_item(tree, hf_gtpv2_mme_code, tvb, offset, 1, ENC_BIG_ENDIAN);
3826 proto_tree_add_item(tree, hf_gtpv2_m_tmsi, tvb, offset, 4, ENC_NA);
3830 * 8.48 Fully Qualified Container (F-Container)
3833 static const value_string gtpv2_container_type_vals[] = {
3834 {1, "UTRAN transparent container"},
3835 {2, "BSS container"},
3836 {3, "E-UTRAN transparent container"},
3842 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_)
3845 proto_item *bss_item;
3846 proto_tree *sub_tree;
3848 guint8 container_type;
3849 guint8 container_flags, xid_len;
3851 /* Octets 8 7 6 5 4 3 2 1
3852 * 5 Spare | Container Type
3854 proto_tree_add_item(tree, hf_gtpv2_container_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3855 container_type = tvb_get_guint8(tvb, offset);
3857 if ( (message_type == GTPV2_FORWARD_RELOCATION_REQ)
3858 || (message_type == GTPV2_CONTEXT_RESPONSE)
3859 || (message_type == GTPV2_RAN_INFORMATION_RELAY)) {
3860 switch (container_type) {
3863 bss_item = proto_tree_add_text(tree, tvb, offset, length, "BSS container");
3864 sub_tree = proto_item_add_subtree(bss_item, ett_gtpv2_bss_con);
3865 /* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of paratemer */
3866 proto_tree_add_item(sub_tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
3867 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3868 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3869 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3870 container_flags = tvb_get_guint8(tvb, offset);
3872 if ((container_flags & 0x01) == 1) {
3873 /* Packet Flow ID present */
3874 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
3877 if (((container_flags & 0x04) == 4) || ((container_flags & 0x02) == 2)) {
3878 if ((container_flags & 0x04) == 4) {
3880 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
3882 if ((container_flags & 0x02) == 2) {
3883 /* Radio Priority present */
3884 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
3888 if ((container_flags & 0x08) == 8) {
3889 /* XiD parameters length is present in Octet c.
3890 * XiD parameters are present in Octet d to n.
3892 xid_len = tvb_get_guint8(tvb, offset);
3893 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3895 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_NA);
3902 if (message_type == GTPV2_FORWARD_CTX_NOTIFICATION) {
3903 switch (container_type) {
3905 /* E-UTRAN transparent container */
3906 new_tvb = tvb_new_subset_remaining(tvb, offset);
3907 dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(new_tvb, pinfo, tree, NULL);
3914 /* 7.3.2 Forward Relocation Response
3915 * E-UTRAN Transparent Container
3916 * This IE is conditionally included only during a handover to
3917 * E-UTRAN and contains the radio-related and core network
3918 * information. If the Cause IE contains the value "Request
3919 * accepted", this IE shall be included.
3921 proto_tree_add_text(tree, tvb, offset, length-offset, "Not dissected yet");
3926 * 8.49 Fully Qualified Cause (F-Cause)
3929 static const value_string gtpv2_cause_type_vals[] = {
3930 {0, "Radio Network Layer"},
3931 {1, "Transport Layer"},
3934 {4, "Miscellaneous"},
3948 static value_string_ext gtpv2_cause_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_type_vals);
3951 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_)
3956 /* The value of Instance field of the F-Cause IE in a GTPv2 message shall indicate
3957 * whether the F-Cause field contains RANAP Cause, BSSGP Cause or RAN Cause.
3958 * If the F-Cause field contains RAN Cause, the Cause Type field shall contain
3959 * the RAN cause subcategory as specified in 3GPP TS 36.413 [10] and it shall be
3960 * encoded as in Table 8.49-1.
3961 * If the F-Cause field contains BSSGP Cause or RANAP Cause,
3962 * the Cause Type field shall be ignored by the receiver.
3964 if (message_type == GTPV2_FORWARD_RELOCATION_REQ) {
3967 proto_item_append_text(item, "[RAN Cause]");
3968 proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3969 cause_type = tvb_get_guint8(tvb, offset);
3971 switch (cause_type) {
3973 /* CauseRadioNetwork */
3974 proto_tree_add_item(tree, hf_gtpv2_CauseRadioNetwork, tvb, offset, 1, ENC_BIG_ENDIAN);
3977 /* CauseTransport */
3978 proto_tree_add_item(tree, hf_gtpv2_CauseTransport, tvb, offset, 1, ENC_BIG_ENDIAN);
3982 proto_tree_add_item(tree, hf_gtpv2_CauseNas, tvb, offset, 1, ENC_BIG_ENDIAN);
3986 proto_tree_add_item(tree, hf_gtpv2_CauseProtocol, tvb, offset, 1, ENC_BIG_ENDIAN);
3990 proto_tree_add_item(tree, hf_gtpv2_CauseMisc, tvb, offset, 1, ENC_BIG_ENDIAN);
3998 proto_item_append_text(item, "[RANAP Cause]");
4001 proto_item_append_text(item, "[BSSGP Cause]");
4007 proto_tree_add_text(tree, tvb, offset, length-offset, "Not dissected yet");
4012 * 8.50 Selected PLMN ID
4015 * The Selected PLMN ID IE contains the core network operator selected for tne UE
4016 * in a shared network. Octets 5-7 shall be encoded as the content part of the
4017 * "Selected PLMN Identity" parameter in 3GPP TS 36.413 [10].
4018 * -The Selected PLMN identity consists of 3 digits from MCC followed by
4019 * either -a filler digit plus 2 digits from MNC (in case of 2 digit MNC) or
4020 * -3 digits from MNC (in case of a 3 digit MNC).
4023 * +--+--+--+--+--+--+--+--+
4024 * Octet 5 |MCC digit 2|MCC digit 1|
4025 * +--+--+--+--+--+--+--+--+
4026 * Octet 6 |MNC digit 1|MCC digit 3|
4027 * +--+--+--+--+--+--+--+--+
4028 * Octet 7 |MNC digit 3|MNC digit 2|
4029 * +--+--+--+--+--+--+--+--+
4032 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_)
4036 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, FALSE);
4037 proto_item_append_text(item, "%s", mcc_mnc_str);
4041 * 8.51 Target Identification
4044 static const value_string gtpv2_target_type_vals[] = {
4046 {1, "Macro eNodeB ID"},
4047 {2, "Cell Identifier"},
4048 {3, "Home eNodeB ID"},
4051 static value_string_ext gtpv2_target_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_target_type_vals);
4054 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_)
4060 proto_tree_add_item(tree, hf_gtpv2_target_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4061 target_type = tvb_get_guint8(tvb, offset);
4063 switch (target_type) {
4065 new_tvb = tvb_new_subset_remaining(tvb, offset);
4066 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4069 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
4072 /* RAC (see NOTE 3) */
4073 proto_tree_add_item(tree, hf_gtpv2_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
4076 * In this case the Target ID field shall be encoded as the Target
4077 * RNC-ID part of the "Target ID" parameter in 3GPP TS 25.413 [33]. Therefore, the "Choice Target ID" that indicates
4078 * "Target RNC-ID" (numerical value of 0x20) shall not be included (value in octet 5 specifies the target type).
4080 proto_tree_add_item(tree, hf_gtpv2_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4081 /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
4082 * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
4085 proto_tree_add_item(tree, hf_gtpv2_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4089 /* Macro eNodeB ID*/
4090 new_tvb = tvb_new_subset_remaining(tvb, offset);
4091 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4093 /* The Macro eNodeB ID consists of 20 bits.
4094 * Bit 4 of Octet 4 is the most significant bit and bit 1 of Octet 6 is the least significant bit.
4096 proto_tree_add_item(tree, hf_gtpv2_macro_enodeb_id, tvb, offset, 3, ENC_BIG_ENDIAN);
4098 /* Tracking Area Code (TAC) */
4099 proto_tree_add_item(tree, hf_gtpv2_uli_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
4103 /* Cell Identifier */
4104 /* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
4105 * in 3GPP TS 48.018 [34].
4107 new_tvb = tvb_new_subset_remaining(tvb, offset);
4108 de_bssgp_cell_id(new_tvb, tree, pinfo, 0, 0/* not used */, NULL, 0);
4111 /* Home eNodeB ID */
4112 new_tvb = tvb_new_subset_remaining(tvb, offset);
4113 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4115 /* Octet 10 to 12 Home eNodeB ID
4116 * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
4117 * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
4118 * The coding of the Home eNodeB ID is the responsibility of each administration.
4119 * Coding using full hexadecimal representation shall be used.
4121 proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, offset, 4 , ENC_BIG_ENDIAN);
4123 /* Octet 13 to 14 Tracking Area Code (TAC) */
4124 proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
4130 proto_tree_add_text(tree, tvb, offset, length-offset, "Not dissected yet");
4138 * 8.53 Packet Flow ID
4141 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_)
4145 /* Octet 5 Spare EBI */
4146 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4147 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 2, ENC_BIG_ENDIAN);
4150 /* Packet Flow ID */
4151 proto_tree_add_text(tree, tvb, offset, length, "Packet Flow ID: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4158 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_)
4161 guint16 dlgtpu_seq, ulgtpu_seq, dl_pdcp_seq, ul_pdcp_seq;
4164 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4165 proto_tree_add_item(tree, hf_gtpv2_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
4168 /* 6 to 7 DL GTP-U Sequence Number */
4169 dlgtpu_seq = tvb_get_ntohs(tvb, offset);
4170 proto_tree_add_text(tree, tvb, offset, 2, "DL GTP-U Sequence Number: %d", dlgtpu_seq);
4173 /* 8 to 9 UL GTP-U Sequence Number */
4174 ulgtpu_seq = tvb_get_ntohs(tvb, offset);
4175 proto_tree_add_text(tree, tvb, offset, 2, "UL GTP-U Sequence Number: %d", ulgtpu_seq);
4178 /* 10 to 11 DL PDCP Sequence Number */
4179 dl_pdcp_seq = tvb_get_ntohs(tvb, offset);
4180 proto_tree_add_text(tree, tvb, offset, 2, "DL PDCP Sequence Number: %d", dl_pdcp_seq);
4183 /* 12 to 13 UL PDCP Sequence Number */
4184 ul_pdcp_seq = tvb_get_ntohs(tvb, offset);
4185 proto_tree_add_text(tree, tvb, offset, 2, "UL PDCP Sequence Number: %d", ul_pdcp_seq);
4190 * 8.55 Source RNC PDCP context info
4193 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_)
4195 proto_tree_add_text(tree, tvb, 0, length, "RRC Container");
4199 * 8.56 UDP Source Port Number
4202 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_)
4204 proto_tree_add_text(tree, tvb, 0, 2, "UPD Source Port Number: %u", tvb_get_ntohs(tvb, 0));
4205 proto_item_append_text(item, "%u", tvb_get_ntohs(tvb, 0));
4208 * 8.57 APN Restriction
4211 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_)
4215 type_value = tvb_get_guint8(tvb, 0);
4216 proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, 0, 1, ENC_BIG_ENDIAN);
4217 proto_item_append_text(item, "value %u", type_value);
4221 * 8.58 Selection Mode
4223 static const value_string gtpv2_selec_mode_vals[] = {
4224 {0, "MS or network provided APN, subscribed verified"},
4225 {1, "MS provided APN, subscription not verified"},
4226 {2, "Network provided APN, subscription not verified"},
4227 {3, "Network provided APN, subscription not verified (Basically for Future use"},
4232 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_)
4237 ss_mode = tvb_get_guint8(tvb, offset) & 0x03;
4238 proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
4239 proto_item_append_text(item, "%s", val_to_str_const(ss_mode, gtpv2_selec_mode_vals, "Unknown"));
4244 * 8.59 Source Identification
4247 static const value_string gtpv2_source_ident_types[] = {
4250 {2, "eNodeB ID(Reserved, used in erlier v of proto.)"},
4255 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_)
4260 /* Octet 5 to 12 Target Cell ID */
4261 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4263 /* Octet 13 Source Type */
4264 source_type = tvb_get_guint8(tvb, offset);
4265 proto_tree_add_item(tree, hf_gtpv2_source_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4267 /* Octet 14 to (n+4) Source ID */
4268 switch (source_type) {
4270 /* The Source Type is Cell ID for PS handover from GERAN A/Gb mode. In this case the coding of the Source ID field
4271 * shall be same as the Octets 3 to 10 of the Cell Identifier IEI in 3GPP TS 48.018 [34].
4273 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4276 /* The Source Type is RNC ID for PS handover from GERAN Iu mode or for inter-RAT handover from UTRAN. In this
4277 * case the Source ID field shall be encoded as as the Source RNC-ID part of the "Source ID" parameter in 3GPP TS
4280 /* RNC-ID M INTEGER (0..4095) */
4285 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_source_type_unknown, tvb, offset-1, 1);
4292 * 8.60 Bearer Control Mode
4294 static const value_string gtpv2_bearer_control_mode_vals[] = {
4295 {0, "Selected Bearer Control Mode-'MS_only'"},
4296 {1, "Selected Bearer Control Mode-'Network_only'"},
4297 {2, "Selected Bearer Control Mode-'MS/NW'"},
4301 static const value_string gtpv2_bearer_control_mode_short_vals[] = {
4303 {1, "Network_only"},
4309 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_)
4313 proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
4314 /* Add Bearer Control Mode to tree */
4315 bcm = tvb_get_guint8(tvb, 0);
4316 proto_item_append_text(item, "%s", val_to_str_const(bcm, gtpv2_bearer_control_mode_short_vals, "Unknown"));
4320 * 8.61 Change Reporting Action
4322 static const value_string gtpv2_cng_rep_act_vals[] = {
4323 {0, "Stop Reporting"},
4324 {1, "Start Reporting CGI/SAI"},
4325 {2, "Start Reporting RAI"},
4326 {3, "Start Reporting TAI"},
4327 {4, "Start Reporting ECGI"},
4328 {5, "Start Reporting CGI/SAI and RAI"},
4329 {6, "Start Reporting TAI and ECGI"},
4334 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_)
4338 /* Add Action to tree */
4339 action = tvb_get_guint8(tvb, 0);
4340 proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, ENC_BIG_ENDIAN);
4342 proto_item_append_text(item, "%s", val_to_str_const(action, gtpv2_cng_rep_act_vals, "Unknown"));
4345 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
4348 static const value_string gtpv2_fq_csid_type_vals[] = {
4349 {0, "Global unicast IPv4 address"},
4350 {1, "Global unicast IPv6 address"},
4351 {2, "4 octets long field"},
4357 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_)
4360 guint8 octet, node_id_type, csids;
4361 guint32 node_id, node_id_mcc_mnc;
4363 /* Octet 5 Node-ID Type Number of CSIDs= m */
4365 octet = tvb_get_guint8(tvb, offset);
4366 node_id_type = octet >> 4;
4367 csids = octet & 0x0f;
4368 proto_tree_add_item(tree, hf_gtpv2_fq_csid_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4369 proto_tree_add_item(tree, hf_gtpv2_fq_csid_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
4372 switch (node_id_type) {
4374 /* Indicates that Node-ID is a global unicast IPv4 address and p = 9 */
4375 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4379 /* Indicates that Node-ID is a global unicast IPv6 address and p = 21 */
4380 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv6, tvb, offset, 16, ENC_NA);
4384 /* Node-ID is a 4 octets long field with a 32 bit value stored in network order, and p= 9. The coding
4385 * of the field is specified below:
4386 * - Most significant 20 bits are the binary encoded value of (MCC * 1000 + MNC).
4387 * - Least significant 12 bits is a 12 bit integer assigned by an operator to an MME, SGW or PGW. Other values of
4388 * Node-ID Type are reserved.
4390 node_id = tvb_get_ntohl(tvb, offset);
4391 node_id_mcc_mnc = node_id >> 12;
4392 node_id = node_id & 0xfff;
4393 proto_tree_add_text(tree, tvb, offset, 4, "Node-ID: MCC+MNC %u, Id: %u", node_id_mcc_mnc, node_id);
4397 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_fq_csid_type_bad, tvb, offset-1, 1,
4398 "Wrong Node-ID Type %u, should be 0-2(Or tis is a newer spec)", node_id_type);
4402 /* First PDN Connection Set Identifier (CSID)
4403 * Second PDN Connection Set Identifier (CSID)
4405 * m-th PDN Connection Set Identifier (CSID)
4408 proto_tree_add_item(tree, hf_gtpv2_fq_csid_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4415 * 8.63 Channel needed
4418 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_)
4420 /* The Channel needed shall be coded as depicted in Figure 8.63-1. Channel needed is coded as the IEI part and the value
4421 * part of the Channel Needed IE defined in 3GPP TS 44.018[28]
4423 de_rr_chnl_needed(tvb, tree, pinfo, 0, length, NULL, 0);
4427 * 8.64 eMLPP Priority
4428 * The eMLPP-Priority shall be coded as depicted in Figure 8.64-1. The eMLPP Priority is coded as the value part of the
4429 * eMLPP-Priority IE defined in 3GPP TS 48.008 [29] (not including 3GPP TS 48.008 IEI and 3GPP TS 48.008 [29]
4430 * length indicator).
4433 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_)
4435 be_emlpp_prio(tvb, tree, pinfo, 0, length, NULL, 0);
4442 static const value_string gtpv2_node_type_vals[] = {
4449 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_)
4453 proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4454 /* Append Node Type to tree */
4455 node_type = tvb_get_guint8(tvb, 0);
4456 proto_item_append_text(item, "%s", val_to_str_const(node_type, gtpv2_node_type_vals, "Unknown"));
4461 * 8.66 Fully Qualified Domain Name (FQDN)
4464 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_)
4466 int offset = 0, name_len, tmp;
4467 guint8 *fqdn = NULL;
4469 /* The FQDN field encoding shall be identical to the encoding of
4470 * a FQDN within a DNS message of section 3.1 of IETF
4471 * RFC 1035 [31] but excluding the trailing zero byte.
4474 name_len = tvb_get_guint8(tvb, offset);
4476 if (name_len < 0x20) {
4477 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
4479 if (name_len >= length - 1)
4482 name_len = name_len + fqdn[tmp] + 1;
4486 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
4488 proto_tree_add_string(tree, hf_gtpv2_fqdn, tvb, offset, length, fqdn);
4489 proto_item_append_text(item, "%s", fqdn);
4494 * 8.67 Private Extension
4497 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)
4503 /* oct 5 -7 Enterprise ID */
4504 ext_id = tvb_get_ntohs(tvb, offset);
4505 proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4508 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(ext_id, &sminmpec_values_ext, "Unknown"), ext_id);
4510 next_tvb = tvb_new_subset_length(tvb, offset, length-2);
4511 if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, GUINT_TO_POINTER((guint32)instance))){
4515 proto_tree_add_text(tree, tvb, offset, length-2, "Proprietary value");
4519 * 8.68 Transaction Identifier (TI)
4522 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_)
4524 /* 5 to (n+4) Transaction Identifier */
4525 proto_tree_add_item(tree, hf_gtpv2_ti, tvb, 0, length, ENC_NA);
4530 * 8.69 MBMS Session Duration
4533 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_)
4542 /* From 3GPP TS 29.061 17.7.7 MBMS-Session-Duration AVP */
4543 /* Bits: ssss ssss ssss ssss sddd dddd where s bits = seconds, d bits = days */
4544 seconds = tvb_get_bits32(tvb, bit_offset, 17, ENC_BIG_ENDIAN);
4547 days = tvb_get_bits32(tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4549 /* Maximum allowed value for days: 18.
4550 * Maximum allowed value for seconds: 86,400 */
4551 if ((days > 18) || (seconds > 86400)) {
4552 proto_tree_add_text(tree, tvb, offset, offset + 3, "Days or Seconds out or allowed range");
4555 /* 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. */
4556 if ((seconds == 0) && (days == 0)) {
4557 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4558 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4559 proto_item_append_text(item, "Indefinite (always-on)");
4561 hours = seconds / 3600;
4562 minutes = (seconds % 3600) / 60;
4563 seconds = (seconds % 3600) % 60;
4565 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4566 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4567 proto_item_append_text(item, "%d days %02d:%02d:%02d (DD days HH:MM:SS)", days, hours, minutes, seconds);
4572 proto_tree_add_text(tree, tvb, offset, length-3, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-3));
4576 * 8.70 MBMS Service Area
4579 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_)
4582 proto_item *sai_item;
4587 binary_nr = tvb_get_guint8(tvb, offset);
4588 real_nr = (guint16)binary_nr + 1;
4590 /* 3GPP TS 29.061 17.7.6 MBMS-Service-Area AVP */
4591 proto_tree_add_uint(tree, hf_gtpv2_mbms_service_area_nr, tvb, offset, 1, real_nr);
4594 /* A consecutive list of MBMS Service Area Identities follow, each with a length of two octets. */
4595 while (offset < length) {
4596 /* 3GPP TS 23.003 15.3 Structure of MBMS SAI */
4597 sai = tvb_get_ntohs(tvb, offset);
4598 sai_item = proto_tree_add_item(tree, hf_gtpv2_mbms_service_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4599 /* The value 0 denotes the whole of PLMN as the MBMS Service Area */
4601 proto_item_append_text(sai_item, " Entire PLMN");
4603 proto_item_append_text(item, " %u", sai);
4609 * 8.71 MBMS Session Identifier
4612 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_)
4615 /* One octet OctetString. */
4616 proto_tree_add_item(tree, hf_gtpv2_mbms_session_id, tvb, offset, 1, ENC_NA);
4620 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4624 * 8.72 MBMS Flow Identifier
4627 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_)
4630 /* Two octets OctetString. */
4631 proto_tree_add_item(tree, hf_gtpv2_mbms_flow_id, tvb, offset, 2, ENC_NA);
4632 proto_item_append_text(item, " %s", tvb_bytes_to_ep_str(tvb, offset, 2));
4636 proto_tree_add_text(tree, tvb, offset, length-2, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-2));
4640 * 8.73 MBMS IP Multicast Distribution
4642 static const value_string gtpv2_mbms_hc_indicator_vals[] = {
4643 {0, "Uncompressed header"},
4644 {1, "Compressed header"},
4649 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_)
4653 proto_tree_add_item(tree, hf_gtpv2_cteid, tvb, offset, 4, ENC_BIG_ENDIAN);
4656 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4657 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4658 /* IP Multicast Distribution Address */
4659 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4661 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4662 proto_item_append_text(item, " IPv4 Dist %s", tvb_ip_to_str(tvb, offset));
4664 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4666 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv6, tvb, offset, 16, ENC_NA);
4667 proto_item_append_text(item, " IPv6 Dist %s", tvb_ip6_to_str(tvb, offset));
4671 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4672 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4673 /* IP Multicast Source Address */
4674 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4676 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4677 proto_item_append_text(item, " IPv4 Src %s", tvb_ip_to_str(tvb, offset));
4679 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4681 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv6, tvb, offset, 16, ENC_NA);
4682 proto_item_append_text(item, " IPv6 Src %s", tvb_ip6_to_str(tvb, offset));
4686 proto_tree_add_item(tree, hf_gtpv2_mbms_hc_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
4689 if (length > offset)
4690 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4695 * 8.74 MBMS Distribution Acknowledge
4697 static const value_string gtpv2_mbms_dist_indication_vals[] = {
4698 {0, "No RNCs have accepted IP multicast distribution"},
4699 {1, "All RNCs have accepted IP multicast distribution"},
4700 {2, "Some RNCs have accepted IP multicast distribution"},
4701 {3, "Spare. For future use."},
4706 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_)
4710 proto_tree_add_item(tree, hf_gtpv2_mbms_dist_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
4714 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4718 * 8.75 User CSG Information (UCI)
4721 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_)
4723 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4726 /* 8.76 CSG Information Reporting Action */
4728 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_)
4730 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4733 /* 8.77 RFSP Index */
4735 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_)
4740 proto_tree_add_item(tree, hf_gtpv2_subscriber_rfsp, tvb, offset, 2, ENC_BIG_ENDIAN);
4741 }else if(instance == 1){
4742 proto_tree_add_item(tree, hf_gtpv2_rfsp_inuse, tvb, offset, 2, ENC_BIG_ENDIAN);
4748 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_)
4750 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4753 /* 8.79 CSG Membership Indication (CMI) */
4755 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_)
4757 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4760 /* 8.80 Service indicator */
4762 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_)
4764 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4767 /* 8.81 Detach Type */
4769 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_)
4771 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4774 /* 8.82 Local Distinguished Name (LDN) */
4776 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_)
4778 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4781 /* 8.83 Node Features */
4783 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_)
4786 proto_tree_add_item(tree, hf_gtpv2_node_features_prn, tvb, offset, 1, ENC_BIG_ENDIAN);
4787 proto_tree_add_item(tree, hf_gtpv2_node_features_mabr, tvb, offset, 1, ENC_BIG_ENDIAN);
4788 proto_tree_add_item(tree, hf_gtpv2_node_features_ntsr, tvb, offset, 1, ENC_BIG_ENDIAN);
4791 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4795 * MBMS Time to Data Transfer
4798 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_)
4804 binary_secs = tvb_get_guint8(tvb, offset);
4805 real_secs = (guint16)binary_secs + 1;
4807 proto_tree_add_string_format_value(tree, hf_gtpv2_time_to_data_xfer, tvb, offset, 1, "", "%d second(s)", real_secs);
4808 proto_item_append_text(item, " %u second(s)", real_secs);
4811 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4814 /* 8.85 Throttling */
4816 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_)
4818 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4821 /* 8.86 Allocation/Retention Priority (ARP) */
4823 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_)
4827 proto_tree_add_item(tree, hf_gtpv2_arp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
4828 proto_tree_add_item(tree, hf_gtpv2_arp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
4829 proto_tree_add_item(tree, hf_gtpv2_arp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
4833 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4836 /* 8.87 EPC Timer */
4837 static const value_string gtpv2_timer_unit_vals[] = {
4838 {0, "value is incremented in multiples of 2 seconds"},
4839 {1, "value is incremented in multiples of 1 minute"},
4840 {2, "value is incremented in multiples of 10 minutes"},
4841 {3, "value is incremented in multiples of 1 hour"},
4842 {4, "value is incremented in multiples of 1 hour"},
4843 {5, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
4844 {6, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
4845 {7, "value indicates that the timer is infinite"},
4850 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_)
4852 proto_tree_add_item(tree, hf_gtpv2_timer_unit, tvb, 0, 1, ENC_BIG_ENDIAN);
4853 proto_tree_add_item(tree, hf_gtpv2_timer_value, tvb, 0, 1, ENC_BIG_ENDIAN);
4857 /* 8.88 Signalling Priority Indication */
4859 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_)
4861 proto_tree_add_item(tree, hf_gtpv2_lapi, tvb, 0, 1, ENC_BIG_ENDIAN);
4864 /* 8.89 Temporary Mobile Group Identity (TMGI) */
4866 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_)
4871 tmgi = tvb_get_ntoh48(tvb, offset);
4873 proto_item_append_text(item, "%012" G_GINT64_MODIFIER "x", tmgi);
4875 proto_tree_add_item(tree, hf_gtpv2_mbms_service_id, tvb, offset, 3, ENC_NA);
4878 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
4881 if (length > offset)
4882 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4886 * 8.90 Additional MM context for SRVCC
4887 * 3GPP TS 29.274 Figure 8.90-1
4890 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_)
4893 proto_item *ms_cm_item;
4894 proto_tree *ms_cm_tree;
4897 /* Length of Mobile Station Classmark 2 */
4898 elm_len = tvb_get_guint8(tvb, offset);
4899 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
4901 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));
4902 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
4903 /* Mobile Station Classmark 2 */
4904 de_ms_cm_2(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4907 /* Length of Mobile Station Classmark 3 */
4908 elm_len = tvb_get_guint8(tvb, offset);
4909 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
4911 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));
4912 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
4913 /* Mobile Station Classmark 3 */
4914 de_ms_cm_3(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4917 /* Length of Supported Codec List */
4918 elm_len = tvb_get_guint8(tvb, offset);
4919 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
4921 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));
4922 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_supp_codec_list);
4923 /* Supported Codec List */
4924 de_sup_codec_list(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4927 if (length > offset)
4928 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4931 /* 8.91 Additional flags for SRVCC */
4933 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_)
4937 proto_tree_add_item(tree, hf_gtpv2_add_flags_for_srvcc_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
4938 proto_tree_add_item(tree, hf_gtpv2_vsrvcc_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
4942 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4945 /* 8.92 Max MBR/APN-AMBR (MMBR) */
4947 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_)
4953 max_ul = tvb_get_ntohl(tvb, offset);
4954 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "%u %s",
4955 (max_ul) > 1000 ? max_ul/1000 : max_ul,
4956 (max_ul) > 1000 ? "Mbps" : "kbps");
4960 max_dl = tvb_get_ntohl(tvb, offset);
4961 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "%u %s",
4962 (max_dl) > 1000 ? max_dl/1000 : max_dl,
4963 (max_dl) > 1000 ? "Mbps" : "kbps");
4966 /* 8.93 MDT Configuration */
4968 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_)
4970 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4973 /* 8.94 Additional Protocol Configuration Options (APCO) */
4975 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_)
4977 switch (message_type) {
4978 case GTPV2_CREATE_SESSION_REQUEST:
4979 /* PCO options as MS to network direction */
4980 pinfo->link_dir = P2P_DIR_UL;
4982 case GTPV2_CREATE_SESSION_RESPONSE:
4983 /* PCO options as Network to MS direction: */
4984 pinfo->link_dir = P2P_DIR_DL;
4989 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
4992 /* 8.95 Absolute Time of MBMS Data Transfer */
4994 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_)
4997 const gchar *time_str;
4999 time_str = tvb_ntp_fmt_ts(tvb, offset);
5000 proto_tree_add_string(tree, hf_gtpv2_abs_time_mbms_data, tvb, offset, 8, time_str);
5001 proto_item_append_text(item, "%s", time_str);
5004 if (length > offset)
5005 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
5008 /* 8.96 H(e)NB Information Reporting */
5009 static const true_false_string gtpv2_henb_info_report_fti_vals = {
5010 "Start reporting H(e)NB local IP address and UDP port number information change",
5011 "Stop reporting H(e)NB local IP address and UDP port number information change",
5015 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_)
5019 proto_tree_add_item(tree, hf_gtpv2_henb_info_report_fti, tvb, offset, 1, ENC_BIG_ENDIAN);
5023 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5026 /* 8.97 IPv4 Configuration Parameters (IP4CP) */
5028 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_)
5032 proto_tree_add_item(tree, hf_gtpv2_ip4cp_subnet_prefix_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5034 proto_tree_add_item(tree, hf_gtpv2_ip4cp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
5037 if (length > offset)
5038 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
5041 /* 8.98 Change to Report Flags */
5043 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_)
5047 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_sncr, tvb, offset, 1, ENC_BIG_ENDIAN);
5048 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_tzcr, tvb, offset, 1, ENC_BIG_ENDIAN);
5052 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5055 /* 8.99 Action Indication */
5056 static const value_string gtpv2_action_indication_vals[] = {
5058 { 1, "Deactivation Indication"},
5059 { 2, "Paging Indication"},
5067 static value_string_ext gtpv2_action_indication_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_action_indication_vals);
5070 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_)
5074 proto_tree_add_item(tree, hf_gtpv2_action_indication_val, tvb, offset, 1, ENC_BIG_ENDIAN);
5078 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5081 typedef struct _gtpv2_ie {
5083 void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, guint16, guint8, guint8);
5086 static const gtpv2_ie_t gtpv2_ies[] = {
5087 {GTPV2_IE_IMSI, dissect_gtpv2_imsi}, /* 1, Internal Mobile Subscriber Identity (IMSI) */
5088 {GTPV2_IE_CAUSE, dissect_gtpv2_cause}, /* 2, Cause (without embedded offending IE) 8.4 */
5089 {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery}, /* 3, Recovery (Restart Counter) 8.5 */
5090 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
5091 /*Start SRVCC Messages 3GPP TS 29.280 */
5092 {GTPV2_IE_STN_SR, dissect_gtpv2_stn_sr}, /* 51 STN-SR */
5093 {GTPV2_IE_SRC_TGT_TRANS_CON, dissect_gtpv2_src_tgt_trans_con}, /* 52 Source to Target Transparent Container */
5094 {GTPV2_IE_TGT_SRC_TRANS_CON , dissect_gtpv2_tgt_src_trans_con}, /* 53 Target to Source Transparent Container */
5095 {GTPV2_IE_MM_CON_EUTRAN_SRVCC, dissect_gtpv2_mm_con_eutran_srvcc}, /* 54 MM Context for E-UTRAN SRVCC */
5096 {GTPV2_IE_MM_CON_UTRAN_SRVCC, dissect_gtpv2_mm_con_utran_srvcc}, /* 55 MM Context for UTRAN SRVCC */
5097 {GTPV2_IE_SRVCC_CAUSE, dissect_gtpv2_srvcc_cause}, /* 56 SRVCC Cause */
5098 {GTPV2_IE_TGT_RNC_ID, dissect_gtpv2_tgt_rnc_id}, /* 57 Target RNC ID */
5099 {GTPV2_IE_TGT_GLOGAL_CELL_ID, dissect_gtpv2_tgt_global_cell_id}, /* 58 Target Global Cell ID */
5100 {GTPV2_IE_TEID_C, dissect_gtpv2_teid_c}, /* 59 TEID-C */
5101 {GTPV2_IE_SV_FLAGS, dissect_gtpv2_sv_flags}, /* 60 Sv Flags */
5102 {GTPV2_IE_SAI, dissect_gtpv2_sai}, /* 61 Service Area Identifie */
5103 /* 61-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
5105 {GTPV2_APN, dissect_gtpv2_apn}, /* 71, Access Point Name (APN) 8.6 */
5106 {GTPV2_AMBR, dissect_gtpv2_ambr}, /* 72, Aggregate Maximum Bit Rate (AMBR) */
5107 {GTPV2_EBI, dissect_gtpv2_ebi}, /* 73, EPS Bearer ID (EBI) 8.8 */
5108 {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address}, /* 74, IP Address */
5109 {GTPV2_MEI, dissect_gtpv2_mei}, /* 74, Mobile Equipment Identity */
5110 {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn}, /* 76, MSISDN 8.11 */
5111 {GTPV2_INDICATION, dissect_gtpv2_ind}, /* 77 Indication 8.12 */
5112 {GTPV2_PCO, dissect_gtpv2_pco}, /* 78 Protocol Configuration Options (PCO) 8.13 */
5113 {GTPV2_PAA, dissect_gtpv2_paa}, /* 79 PDN Address Allocation (PAA) 8.14 */
5114 {GTPV2_BEARER_QOS, dissect_gtpv2_bearer_qos}, /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
5115 {GTPV2_IE_FLOW_QOS, dissect_gtpv2_flow_qos}, /* 81 Flow Quality of Service (Flow QoS) 8.16 */
5116 {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type}, /* 82, RAT Type 8.17 */
5117 {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net}, /* 83, Serving Network 8.18 */
5118 {GTPV2_IE_BEARER_TFT, dissect_gtpv2_bearer_tft}, /* 84, Bearer TFT 8.19 */
5119 {GTPV2_IE_TAD, dissect_gtpv2_tad}, /* 85, Traffic Aggregate Description 8.20 */
5120 {GTPV2_IE_ULI, dissect_gtpv2_uli}, /* 86, User Location Info (ULI) 8.22 */
5121 {GTPV2_IE_F_TEID, dissect_gtpv2_f_teid}, /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
5122 {GTPV2_IE_TMSI, dissect_gtpv2_tmsi}, /* 88, TMSI 8.23 */
5123 {GTPV2_IE_GLOBAL_CNID, dissect_gtpv2_g_cn_id}, /* 89, Global CN-Id 8.25 */
5124 {GTPV2_IE_S103PDF, dissect_gtpv2_s103pdf}, /* 90, S103 PDN Data Forwarding Info (S103PDF) 8.25 */
5125 {GTPV2_IE_S1UDF, dissect_gtpv2_s1udf}, /* 91, S1-U Data Forwarding (S1UDF) 8.26 */
5126 {GTPV2_IE_DEL_VAL, dissect_gtpv2_delay_value}, /* 92, Delay Value 8.29 */
5127 {GTPV2_IE_BEARER_CTX, dissect_gtpv2_bearer_ctx}, /* 93, Bearer Context 8.31 */
5128 {GTPV2_IE_CHAR_ID, dissect_gtpv2_charging_id}, /* 94, Charging Id */
5129 {GTPV2_IE_CHAR_CHAR, dissect_gtpv2_char_char}, /* 95 Charging Characteristic */
5130 {GTPV2_IE_TRA_INFO, dissect_gtpv2_tra_info}, /* 96, Trace Information 8.31 */
5131 {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag}, /* 97, Bearer Flag */
5133 {GTPV2_IE_PDN_TYPE, dissect_gtpv2_pdn_type}, /* 99, PDN Type */
5134 {GTPV2_IE_PTI, dissect_gtpv2_pti}, /* 100, Procedure Transaction Id */
5135 {GTPV2_IE_DRX_PARAM, dissect_gtpv2_drx_param}, /* 101, DRX Parameter 8.36 */
5136 {GTPV2_IE_UE_NET_CAPABILITY, dissect_gtpv2_ue_net_capability}, /* 102, UE network capability 8.37 */
5137 {GTPV2_IE_MM_CONTEXT_GSM_T, dissect_gtpv2_mm_context_gsm_t}, /* 103, MM Context 8.38 GSM Key and Triplets */
5138 {GTPV2_IE_MM_CONTEXT_UTMS_CQ, dissect_gtpv2_mm_context_utms_cq}, /* 104, MM Context 8.38 */
5139 {GTPV2_IE_MM_CONTEXT_GSM_CQ, dissect_gtpv2_mm_context_gsm_cq}, /* 105, MM Context 8.38 */
5140 {GTPV2_IE_MM_CONTEXT_UTMS_Q, dissect_gtpv2_mm_context_utms_q}, /* 106, MM Context 8.38 */
5141 {GTPV2_IE_MM_CONTEXT_EPS_QQ, dissect_gtpv2_mm_context_eps_qq}, /* 107, MM Context 8.38 */
5142 {GTPV2_IE_MM_CONTEXT_UTMS_QQ, dissect_gtpv2_mm_context_utms_qq}, /* 108, MM Context 8.38 */
5143 {GTPV2_IE_PDN_CONNECTION, dissect_gtpv2_PDN_conn}, /* 109, PDN Connection */
5144 {GTPV2_IE_PDN_NUMBERS, dissect_gtpv2_pdn_numbers}, /* 110, PDN Numbers 8.40 */
5145 {GTPV2_IE_P_TMSI, dissect_gtpv2_p_tmsi}, /* 111, P-TMSI 8.41 */
5146 {GTPV2_IE_P_TMSI_SIG, dissect_gtpv2_p_tmsi_sig}, /* 112, P-TMSI Signature 8.42 */
5147 {GTPV2_IE_HOP_COUNTER, dissect_gtpv2_hop_counter}, /* 113, Hop Counter 8.43 */
5148 {GTPV2_IE_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone}, /* 114, UE Time Zone */
5149 {GTPV2_IE_TRACE_REFERENCE, dissect_gtpv2_trace_reference}, /* 115, Trace Reference 8.45 */
5150 {GTPV2_IE_COMPLETE_REQUEST_MSG, dissect_complete_request_msg}, /* 116, Complete Request message 8.46 */
5151 {GTPV2_IE_GUTI, dissect_gtpv2_guti}, /* 117, GUTI 8.47 */
5152 {GTPV2_IE_F_CONTAINER, dissect_gtpv2_F_container}, /* 118, Fully Qualified Container (F-Container) */
5153 {GTPV2_IE_F_CAUSE, dissect_gtpv2_F_cause}, /* 119, Fully Qualified Cause (F-Cause) */
5154 {GTPV2_IE_SEL_PLMN_ID, dissect_gtpv2_sel_plmn_id}, /* 120, Selected PLMN ID 8.50 */
5155 {GTPV2_IE_TARGET_ID, dissect_gtpv2_target_id}, /* 121, Target Identification */
5156 /* 122, Void 8.52 */
5157 {GTPV2_IE_PKT_FLOW_ID, dissect_gtpv2_pkt_flow_id}, /* 123, Packet Flow ID 8.53 */
5158 {GTPV2_IE_RAB_CONTEXT, dissect_gtpv2_rab_context}, /* 124, RAB Context 8.54 */
5159 {GTPV2_IE_S_RNC_PDCP_CTX_INFO, dissect_gtpv2_s_rnc_pdcp_ctx_info}, /* 125, Source RNC PDCP context info 8.55 */
5160 {GTPV2_IE_UDP_S_PORT_NR, dissect_udp_s_port_nr}, /* 126, UDP Source Port Number 8.56 */
5161 {GTPV2_IE_APN_RESTRICTION, dissect_gtpv2_apn_rest}, /* 127, APN Restriction */
5162 {GTPV2_IE_SEL_MODE, dissect_gtpv2_selec_mode}, /* 128, Selection Mode */
5163 {GTPV2_IE_SOURCE_IDENT, dissect_gtpv2_source_ident}, /* 129, Source Identification 8.59 */
5164 {GTPV2_IE_BEARER_CONTROL_MODE, dissect_gtpv2_bearer_control_mode}, /* 130, Bearer Control Mode */
5165 {GTPV2_IE_CNG_REP_ACT , dissect_gtpv2_cng_rep_act}, /* 131, Change Reporting Action 8.61 */
5166 {GTPV2_IE_FQ_CSID, dissect_gtpv2_fq_csid}, /* 132, Fully Qualified PDN Connection Set Identifier (FQ-CSID) 8.62 */
5167 {GTPV2_IE_CHANNEL_NEEDED, dissect_gtpv2_channel_needed}, /* 133, Channel Needed 8.63 */
5168 {GTPV2_IE_EMLPP_PRI, dissect_gtpv2_emlpp_pri}, /* 134, eMLPP Priority 8.64 */
5169 {GTPV2_IE_NODE_TYPE , dissect_gtpv2_node_type}, /* 135, Node Type 8.65 */
5170 {GTPV2_IE_FQDN, dissect_gtpv2_fqdn}, /* 136, 8.66 Fully Qualified Domain Name (FQDN) */
5171 {GTPV2_IE_TI, dissect_gtpv2_ti}, /* 137, 8.68 Transaction Identifier (TI) */
5172 {GTPV2_IE_MBMS_SESSION_DURATION, dissect_gtpv2_mbms_session_duration}, /* 138, 8.69 MBMS Session Duration */
5173 {GTPV2_IE_MBMS_SERVICE_AREA, dissect_gtpv2_mbms_service_area}, /* 139, 8.70 MBMS Service Area */
5174 {GTPV2_IE_MBMS_SESSION_ID, dissect_gtpv2_mbms_session_id}, /* 140, 8.71 MBMS Session Identifier */
5175 {GTPV2_IE_MBMS_FLOW_ID, dissect_gtpv2_mbms_flow_id}, /* 141, 8.72 MBMS Flow Identifier */
5176 {GTPV2_IE_MBMS_IP_MC_DIST, dissect_gtpv2_mbms_ip_mc_dist}, /* 142, 8.73 MBMS IP Multicast Distribution */
5177 {GTPV2_IE_MBMS_DIST_ACK, dissect_gtpv2_mbms_dist_ack}, /* 143, 8.74 MBMS Distribution Acknowledge */
5178 {GTPV2_IE_RFSP_INDEX, dissect_gtpv2_rfsp_index}, /* 144, 8.77 RFSP Index */
5179 {GTPV2_IE_UCI, dissect_gtpv2_uci}, /* 145, 8.75 User CSG Information (UCI) */
5180 {GTPV2_IE_CSG_INFO_REP_ACTION, dissect_gtpv2_csg_info_rep_action}, /* 146, 8.76 CSG Information Reporting Action */
5181 {GTPV2_IE_CSG_ID, dissect_gtpv2_csg_id}, /* 147, 8.78 CSG ID */
5182 {GTPV2_IE_CMI, dissect_gtpv2_cmi}, /* 148, 8.79 CSG Membership Indication (CMI) */
5183 {GTPV2_IE_SERVICE_INDICATOR, dissect_gtpv2_service_indicator}, /* 149, 8.80 Service indicator */
5184 {GTPV2_IE_DETACH_TYPE, dissect_gtpv2_detach_type}, /* 150, 8.81 Detach Type */
5185 {GTPV2_IE_LDN, dissect_gtpv2_ldn}, /* 151, 8.82 Local Distinguished Name (LDN) */
5186 {GTPV2_IE_NODE_FEATURES, dissect_gtpv2_node_features}, /* 152, 8.83 Node Features */
5187 {GTPV2_IE_MBMS_TIME_TO_DATA_XFER, dissect_gtpv2_mbms_time_to_data_xfer}, /* 153, 8.84 MBMS Time to Data Transfer */
5188 {GTPV2_IE_THROTTLING, dissect_gtpv2_throttling}, /* 154, 8.85 Throttling */
5189 {GTPV2_IE_ARP, dissect_gtpv2_arp}, /* 155, 8.86 Allocation/Retention Priority (ARP) */
5190 {GTPV2_IE_EPC_TIMER, dissect_gtpv2_epc_timer}, /* 156, 8.87 EPC Timer */
5191 {GTPV2_IE_SIG_PRIO_IND, dissect_gtpv2_sig_prio_ind}, /* 157, 8.88 Signalling Priority Indication */
5192 {GTPV2_IE_TMGI, dissect_gtpv2_tmgi}, /* 158, 8.89 Temporary Mobile Group Identity (TMGI) */
5193 {GTPV2_IE_ADD_MM_CONT_FOR_SRVCC, dissect_gtpv2_add_mm_cont_for_srvcc}, /* 159, 8.90 Additional MM context for SRVCC */
5194 {GTPV2_IE_ADD_FLAGS_FOR_SRVCC, dissect_gtpv2_add_flags_for_srvcc}, /* 160, 8.91 Additional flags for SRVCC */
5195 {GTPV2_IE_MMBR, dissect_gtpv2_mmbr}, /* 161, 8.92 Max MBR/APN-AMBR (MMBR) */
5196 {GTPV2_IE_MDT_CONFIG, dissect_gtpv2_mdt_config}, /* 162, 8.93 MDT Configuration */
5197 {GTPV2_IE_APCO, dissect_gtpv2_apco}, /* 163, 8.94 Additional Protocol Configuration Options (APCO) */
5198 {GTPV2_IE_ABS_MBMS_DATA_TF_TIME, dissect_gtpv2_abs_mbms_data_tf_time}, /* 164, 8.95 Absolute Time of MBMS Data Transfer */
5199 {GTPV2_IE_HENB_INFO_REPORT, dissect_gtpv2_henb_info_report}, /* 165, 8.96 H(e)NB Information Reporting */
5200 {GTPV2_IE_IP4CP, dissect_gtpv2_ip4cp}, /* 166, 8.97 IPv4 Configuration Parameters (IPv4CP) */
5201 {GTPV2_IE_CHANGE_TO_REPORT_FLAGS, dissect_gtpv2_change_report_flags}, /* 167, 8.98 Change to Report Flags */
5202 {GTPV2_IE_ACTION_INDICATION, dissect_gtpv2_action_indication}, /* 168, 8.99 Action Indication */
5203 /* 169-254 Spare. For future use. FFS */
5204 {GTPV2_IE_PRIVATE_EXT, dissect_gtpv2_private_ext},
5206 {0, dissect_gtpv2_unknown}
5210 dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint offset, guint8 message_type)
5212 proto_tree *ie_tree;
5215 guint8 type, instance;
5219 * Octets 8 7 6 5 4 3 2 1
5222 * 4 CR Spare Instance
5223 * 5-(n+4) IE specific data
5225 while (offset < (gint)tvb_reported_length(tvb)) {
5226 /* Get the type and length */
5228 type = tvb_get_guint8(tvb, offset);
5229 length = tvb_get_ntohs(tvb, offset + 1);
5230 ti = proto_tree_add_text(tree, tvb, offset, 4 + length, "%s : ",
5231 val_to_str_ext_const(type, >pv2_element_type_vals_ext, "Unknown"));
5232 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
5235 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
5239 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
5241 /* CR Spare Instance Octet 4*/
5242 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, ENC_BIG_ENDIAN);
5244 instance = tvb_get_guint8(tvb, offset) & 0x0f;
5245 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
5248 /* TODO: call IE dissector here */
5249 if (type == GTPV2_IE_RESERVED) {
5250 /* Treat IE type zero specal as type zero is used to end the loop in the else branch */
5251 proto_tree_add_text(ie_tree, tvb, offset, length, "IE type Zero is Reserved and should not be used");
5254 /* Loop over the IE dissector list to se if we find an entry;
5255 the last entry will have ie_type=0 breaking the loop */
5256 while (gtpv2_ies[++i].ie_type) {
5257 if (gtpv2_ies[i].ie_type == type)
5260 /* Just give the IE dissector the IE */
5261 ie_tvb = tvb_new_subset_remaining(tvb, offset);
5262 (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, message_type, instance);
5270 dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
5272 proto_tree *gtpv2_tree, *flags_tree;
5273 proto_item *ti, *tf;
5274 guint8 message_type, t_flag, p_flag;
5280 /* Currently we get called from the GTP dissector no need to check the version */
5281 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
5282 col_clear(pinfo->cinfo, COL_INFO);
5284 /* message type is in octet 2 */
5285 message_type = tvb_get_guint8(tvb, 1);
5286 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
5289 p_flag = (tvb_get_guint8(tvb, offset) & 0x10) >> 4;
5290 msg_length = tvb_get_ntohs(tvb, offset + 2);
5291 proto_tree_add_item(tree, proto_gtpv2, tvb, offset, msg_length + 4, ENC_NA);
5294 ti = proto_tree_add_text(tree, tvb, offset, msg_length + 4, "%s",
5295 val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
5296 gtpv2_tree = proto_item_add_subtree(ti, ett_gtpv2);
5298 /* Control Plane GTP uses a variable length header. Control Plane GTP header
5299 * length shall be a multiple of 4 octets.
5300 * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
5301 * Bits 8 7 6 5 4 3 2 1
5302 * Octets 1 Version P T Spare Spare Spare
5304 * 3 Message Length (1st Octet)
5305 * 4 Message Length (2nd Octet)
5306 * m-k(m+3) If T flag is set to 1, then TEID shall be placed into octets 5-8.
5307 * Otherwise, TEID field is not present at all.
5308 * n-(n+2) Sequence Number
5310 * Figure 5.1-1: General format of GTPv2 Header for Control Plane
5312 tf = proto_tree_add_item(gtpv2_tree, hf_gtpv2_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
5313 flags_tree = proto_item_add_subtree(tf, ett_gtpv2_flags);
5316 t_flag = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
5317 proto_tree_add_item(flags_tree, hf_gtpv2_version, tvb, offset, 1, ENC_BIG_ENDIAN);
5318 proto_tree_add_item(flags_tree, hf_gtpv2_p, tvb, offset, 1, ENC_BIG_ENDIAN);
5319 proto_tree_add_item(flags_tree, hf_gtpv2_t, tvb, offset, 1, ENC_BIG_ENDIAN);
5323 proto_tree_add_item(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5326 proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5330 /* Tunnel Endpoint Identifier 4 octets */
5331 proto_tree_add_item(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
5334 /* Sequence Number 3 octets */
5335 proto_tree_add_item(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 3, ENC_BIG_ENDIAN);
5339 proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5343 msg_tvb = tvb_new_subset_length(tvb, 0, msg_length + 4);
5344 dissect_gtpv2_ie_common(msg_tvb, pinfo, gtpv2_tree, offset, message_type);
5346 dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset, message_type);
5349 /* Bit 5 represents a "P" flag. If the "P" flag is set to "0",
5350 * no piggybacked message shall be present. If the "P" flag is set to "1",
5351 * then another GTPv2-C message with its own header and body shall be present
5352 * at the end of the current message.
5355 tvbuff_t *new_p_tvb;
5356 /* Octets 3 to 4 represent the Length field. This field shall indicate the
5357 * length of the message in octets excluding the
5358 * mandatory part of the GTP-C header (the first 4 octets).
5360 new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
5361 col_append_str(pinfo->cinfo, COL_INFO, " / ");
5362 col_set_fence(pinfo->cinfo, COL_INFO);
5363 dissect_gtpv2(new_p_tvb, pinfo, tree);
5369 void proto_register_gtpv2(void)
5371 static hf_register_info hf_gtpv2[] = {
5372 { &hf_gtpv2_reserved,
5373 {"Reserved bit(s)", "gtpv2.reserved",
5374 FT_UINT8, BASE_DEC, NULL, 0x0,
5377 { &hf_gtpv2_spare_half_octet,
5378 {"Spare half octet", "gtpv2.spare_half_octet",
5379 FT_UINT8, BASE_DEC, NULL, 0x0,
5382 { &hf_gtpv2_spare_bits,
5383 {"Spare bit(s)", "gtpv2.spare_bits",
5384 FT_UINT8, BASE_DEC, NULL, 0x0,
5388 {"Flags", "gtpv2.flags",
5389 FT_UINT8, BASE_HEX, NULL, 0x0,
5393 {"Version", "gtpv2.version",
5394 FT_UINT8, BASE_DEC, NULL, 0xe0,
5398 {"Piggybacking flag (P)", "gtpv2.p",
5399 FT_UINT8, BASE_DEC, NULL, 0x10,
5400 "If Piggybacked message is present or not", HFILL}
5403 {"TEID flag (T)", "gtpv2.t",
5404 FT_UINT8, BASE_DEC, NULL, 0x08,
5405 "If TEID field is present or not", HFILL}
5407 { &hf_gtpv2_message_type,
5408 {"Message Type", "gtpv2.message_type",
5409 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_message_type_vals_ext, 0x0,
5412 { &hf_gtpv2_msg_length,
5413 {"Message Length", "gtpv2.msg_lengt",
5414 FT_UINT16, BASE_DEC, NULL, 0x0,
5418 {"Tunnel Endpoint Identifier", "gtpv2.teid",
5419 FT_UINT32, BASE_DEC, NULL, 0x0,
5423 {"Sequence Number", "gtpv2.seq",
5424 FT_UINT32, BASE_DEC, NULL, 0x0,
5428 {"Spare", "gtpv2.spare",
5429 FT_UINT16, BASE_DEC, NULL, 0x0,
5433 {"IE Type", "gtpv2.ie_type",
5434 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
5438 {"IE Length", "gtpv2.ie_len",
5439 FT_UINT16, BASE_DEC, NULL, 0x0,
5440 "length of the information element excluding the first four octets", HFILL}
5443 {"CR flag", "gtpv2.cr",
5444 FT_UINT8, BASE_DEC, NULL, 0xf0, /* SRVCC */
5447 { &hf_gtpv2_instance,
5448 {"Instance", "gtpv2.instance",
5449 FT_UINT8, BASE_DEC, NULL, 0x0f,
5453 {"IMSI(International Mobile Subscriber Identity number)", "gtpv2.imsi",
5454 FT_STRING, BASE_NONE, NULL, 0,
5457 { &hf_gtpv2_ipv4_addr,
5458 {"IPv4 Address", "gtpv2.ipv4_addr",
5459 FT_IPv4, BASE_NONE, NULL, 0x0,
5463 {"Cause", "gtpv2.cause",
5464 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_vals_ext, 0x0,
5467 {&hf_gtpv2_cause_cs,
5468 {"CS (Cause Source)", "gtpv2.cs",
5469 FT_BOOLEAN, 8, TFS(>pv2_cause_cs), 0x01,
5472 { &hf_gtpv2_cause_bce,
5473 {"BCE (Bearer Context IE Error)", "gtpv2.bce",
5474 FT_BOOLEAN, 8, NULL, 0x02,
5477 { &hf_gtpv2_cause_pce,
5478 {"PCE (PDN Connection IE Error)", "gtpv2.pce",
5479 FT_BOOLEAN, 8, NULL, 0x04,
5482 { &hf_gtpv2_cause_off_ie_t,
5483 {"Type of the offending IE", "gtpv2.cause_off_ie_t",
5484 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
5488 {"Restart Counter", "gtpv2.rec",
5489 FT_UINT8, BASE_DEC, NULL, 0x0,
5492 /*Start SRVCC Messages*/
5494 {"STN-SR", "gtpv2.stn_sr",
5495 FT_BYTES, BASE_NONE, NULL, 0x0,
5498 { &hf_gtpv2_len_trans_con,
5499 {"Length of the Transparent Container", "gtpv2.len_trans_con",
5500 FT_UINT8, BASE_DEC, NULL, 0x0,
5504 {"eKSI", "gtpv2.eksi",
5505 FT_UINT8, BASE_DEC, NULL, 0x07,
5510 FT_BYTES, BASE_NONE, NULL, 0x0,
5515 FT_BYTES, BASE_NONE, NULL, 0x0,
5518 { &hf_gtpv2_len_ms_classmark2,
5519 {"Length of Mobile Station Classmark2", "gtpv2.len_ms_classmark2",
5520 FT_UINT8, BASE_DEC, NULL, 0x0,
5523 { &hf_gtpv2_len_ms_classmark3,
5524 {"Length of Mobile Station Classmark3", "gtpv2.len_ms_classmark3",
5525 FT_UINT8, BASE_DEC, NULL, 0x0,
5528 { &hf_gtpv2_len_supp_codec_list,
5529 {"Length of Supported Codec List", "gtpv2.len_supp_codec_list",
5530 FT_UINT8, BASE_DEC, NULL, 0x0,
5534 {"KSI'cs", "gtpv2.ksi",
5535 FT_UINT8, BASE_DEC, NULL, 0x0F,
5539 {"CKSN'", "gtpv2.cksn",
5540 FT_UINT8, BASE_DEC, NULL, 0x0,
5543 { &hf_gtpv2_srvcc_cause,
5544 {"SRVCC Cause", "gtpv2.srvcc_cause",
5545 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_srvcc_cause_vals_ext, 0x0,
5549 { "Routing Area Code (RAC)", "gtpv2.rac",
5550 FT_UINT8, BASE_DEC, NULL, 0,
5551 "Routing Area Code", HFILL}
5555 {"RNC ID", "gtpv2.rnc_id",
5556 FT_UINT16, BASE_DEC, NULL, 0x0,
5559 { &hf_gtpv2_ext_rnc_id,
5560 {"Extended RNC-ID", "gtpv2.ext_rnc_id",
5561 FT_UINT16, BASE_DEC, NULL, 0x0,
5565 { "Location Area Code (LAC)", "gtpv2.lac",
5566 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
5570 { "Service Area Code (SAC)", "gtpv2.sac",
5571 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
5574 { &hf_gtpv2_tgt_g_cell_id,
5575 {"Cell ID", "gtpv2.tgt_g_cell_id",
5576 FT_UINT16, BASE_DEC, NULL, 0x0,
5580 {"Tunnel Endpoint Identifier for Control Plane(TEID-C)", "gtpv2.teid_c",
5581 FT_UINT32, BASE_DEC, NULL, 0x0,
5585 {"STI (Session Transfer Indicator)", "gtpv2.sv_sti",
5586 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5589 {"ICS (IMS Centralized Service)", "gtpv2.sv_ics",
5590 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5592 {&hf_gtpv2_sv_emind,
5593 {"EmInd(Emergency Indicator)", "gtpv2.sv_emind",
5594 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5597 /*End SRVCC Messages*/
5599 {"APN (Access Point Name)", "gtpv2.apn",
5600 FT_STRING, BASE_NONE, NULL, 0x0,
5604 {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
5605 FT_UINT32, BASE_DEC, NULL, 0x0,
5608 {&hf_gtpv2_ambr_down,
5609 {"AMBR Downlink(Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
5610 FT_UINT32, BASE_DEC, NULL, 0x0,
5614 {"EPS Bearer ID (EBI)", "gtpv2.ebi",
5615 FT_UINT8, BASE_DEC, NULL, 0x0f,
5618 { &hf_gtpv2_ip_address_ipv4,
5619 {"IP address IPv4", "gtpv2.ip_address_ipv4",
5620 FT_IPv4, BASE_NONE, NULL, 0x0,
5623 { &hf_gtpv2_ip_address_ipv6,
5624 {"IP address IPv6", "gtpv2.ip_address_ipv6",
5625 FT_IPv6, BASE_NONE, NULL, 0x0,
5629 {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
5630 FT_STRING, BASE_NONE, NULL, 0,
5633 { &hf_gtpv2_pdn_numbers_nsapi,
5634 {"NSAPI", "gtpv2.pdn_numbers_nsapi",
5635 FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}
5638 {"Packet TMSI (P-TMSI)", "gtpv2.p_tmsi",
5639 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
5641 { &hf_gtpv2_p_tmsi_sig,
5642 {"P-TMSI Signature", "gtpv2.p_tmsi_sig",
5643 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
5646 {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
5647 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5650 {"DTF (Direct Tunnel Flag)", "gtpv2.dtf",
5651 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5654 {"HI (Handover Indication)", "gtpv2.hi",
5655 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5658 {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
5659 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5662 {"OI (Operation Indication)", "gtpv2.oi",
5663 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5666 {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
5667 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5670 {"ISRAI (Idle mode Signalling Reduction Activation Indication)", "gtpv2.israi",
5671 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5674 {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
5675 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5678 {"SQCI (Subscribed QoS Change Indication", "gtpv2.sqci",
5679 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5682 {"UIMSI (Unauthenticated IMSI)", "gtpv2.uimsi",
5683 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5686 {"CFSI (Change F-TEID support indication)", "gtpv2.cfsi",
5687 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5690 {"CRSI (Change Reporting support indication):", "gtpv2.crsi",
5691 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5694 {"PS (Piggybacking Supported).)", "gtpv2.ps",
5695 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5698 {"PT (Protocol Type)", "gtpv2.pt",
5699 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5702 {"SI (Scope Indication)", "gtpv2.si",
5703 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5706 {"MSV (MS Validated)", "gtpv2.msv",
5707 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5710 {"Spare", "gtpv2.spare",
5711 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5714 {"Spare", "gtpv2.spare",
5715 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5718 {"Spare", "gtpv2.spare",
5719 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5722 {"S6AF (Static IPv6 Address Flag)", "gtpv2.s6af",
5723 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5726 {"S4AF (Static IPv4 Address Flag))", "gtpv2.s4af",
5727 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5730 {"MBMDT (Management Based MDT allowed flag)", "gtpv2.mbmdt",
5731 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5734 {"ISRAU (ISR is activated for the UE)", "gtpv2.israu",
5735 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5738 {"CCRSI (CSG Change Reporting support indication)", "gtpv2.ccrsi",
5739 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5741 { &hf_gtpv2_pdn_type,
5742 {"PDN Type", "gtpv2.pdn_type",
5743 FT_UINT8, BASE_DEC, VALS(gtpv2_pdn_type_vals), 0x07,
5747 { &hf_gtpv2_tra_info,
5748 {"Trace ID", "gtpv2.tra_info",
5749 FT_STRING, BASE_NONE, NULL, 0x0,
5753 { &hf_gtpv2_tra_info_msc_momt_calls,
5754 {"MO and MT calls", "gtpv2.tra_info_msc_momt_calls",
5755 FT_UINT8, BASE_DEC, NULL, 0x01,
5756 "MSC Server", HFILL}
5758 { &hf_gtpv2_tra_info_msc_momt_sms,
5759 {"MO and MT SMS", "gtpv2.tra_info_msc_momt_sms",
5760 FT_UINT8, BASE_DEC, NULL, 0x02,
5761 "MSC Server", HFILL}
5763 { &hf_gtpv2_tra_info_msc_lu_imsi_ad,
5764 {"LU, IMSI attach, IMSI detach", "gtpv2.tra_info_msc_lu_imsi_ad",
5765 FT_UINT8, BASE_DEC, NULL, 0x04,
5766 "MSC Server", HFILL}
5768 { &hf_gtpv2_tra_info_msc_handovers,
5769 {"Handovers", "gtpv2.tra_info_msc_handovers",
5770 FT_UINT8, BASE_DEC, NULL, 0x08,
5771 "MSC Server", HFILL}
5773 { &hf_gtpv2_tra_info_msc_ss,
5774 {"SS", "gtpv2.tra_info_msc_ss",
5775 FT_UINT8, BASE_DEC, NULL, 0x10,
5776 "MSC Server", HFILL}
5778 { &hf_gtpv2_tra_info_mgw_context,
5779 {"Context", "gtpv2.tra_info_mgw_context",
5780 FT_UINT8, BASE_DEC, NULL, 0x01,
5783 { &hf_gtpv2_tra_info_sgsn_pdp_context,
5784 {"PDP context", "gtpv2.tra_info_sgsn_pdp_context",
5785 FT_UINT8, BASE_DEC, NULL, 0x01,
5788 { &hf_gtpv2_tra_info_sgsn_momt_sms,
5789 {"MO and MT SMS", "gtpv2.tra_info_sgsn_momt_sms",
5790 FT_UINT8, BASE_DEC, NULL, 0x02,
5793 { &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
5794 {"RAU, GPRS attach, GPRS detach", "gtpv2.tra_info_sgsn_rau_gprs_ad",
5795 FT_UINT8, BASE_DEC, NULL, 0x04,
5798 { &hf_gtpv2_tra_info_sgsn_mbms,
5799 {"MBMS Context", "gtpv2.tra_into_sgsn_mbms",
5800 FT_UINT8, BASE_DEC, NULL, 0x08,
5803 { &hf_gtpv2_tra_info_sgsn_reserved,
5804 {"Reserved", "gtpv2.",
5805 FT_UINT8, BASE_DEC, NULL, 0x0,
5808 { &hf_gtpv2_tra_info_ggsn_pdp,
5809 {"PDP Cpntext", "gtpv2.tra_info_ggsn_pdp",
5810 FT_UINT8, BASE_DEC, NULL, 0x01,
5813 { &hf_gtpv2_tra_info_ggsn_mbms,
5814 {"MBMS Context", "gtpv2.tra_info_ggsn_mbms",
5815 FT_UINT8, BASE_DEC, NULL, 0x02,
5818 { &hf_gtpv2_tra_info_bm_sc,
5819 {"MBMS Multicast service activation", "gtpv2.tra_info_bm_sc",
5820 FT_UINT8, BASE_DEC, NULL, 0x01,
5823 { &hf_gtpv2_tra_info_mme_sgw_ss,
5824 {"Session setup", "gtpv2.tra_info_mme_sgw_ss",
5825 FT_UINT8, BASE_DEC, NULL, 0x01,
5828 { &hf_gtpv2_tra_info_mme_sgw_sr,
5829 {"Service Request", "gtpv2.tra_info_mme_sgw_sr",
5830 FT_UINT8, BASE_DEC, NULL, 0x02,
5833 { &hf_gtpv2_tra_info_mme_sgw_iataud,
5834 {"Initial Attach, Tracking area update, Detach", "gtpv2.tra_info_mme_sgw_iataud",
5835 FT_UINT8, BASE_DEC, NULL, 0x04,
5838 { &hf_gtpv2_tra_info_lne_msc_s,
5839 {"MSC-S", "gtpv2.tra_info_lne_msc_s",
5840 FT_UINT8, BASE_DEC, NULL, 0x01,
5841 "List of NE Types", HFILL}
5843 { &hf_gtpv2_tra_info_lne_mgw,
5844 {"MGW", "gtpv2.tra_info_lne_mgw",
5845 FT_UINT8, BASE_DEC, NULL, 0x02,
5846 "List of NE Types", HFILL}
5848 { &hf_gtpv2_tra_info_lne_sgsn,
5849 {"SGSN", "gtpv2.tra_info_lne_sgsn",
5850 FT_UINT8, BASE_DEC, NULL, 0x04,
5851 "List of NE Types", HFILL}
5853 { &hf_gtpv2_tra_info_lne_ggsn,
5854 {"GGSN", "gtpv2.tra_info_lne_ggsn",
5855 FT_UINT8, BASE_DEC, NULL, 0x08,
5856 "List of NE Types", HFILL}
5858 { &hf_gtpv2_tra_info_lne_rnc,
5859 {"RNC", "gtpv2.tra_info_lne_rnc",
5860 FT_UINT8, BASE_DEC, NULL, 0x10,
5861 "List of NE Types", HFILL}
5863 { &hf_gtpv2_tra_info_lne_bm_sc,
5864 {"BM-SC", "gtpv2.tra_info_lne_bm_sc",
5865 FT_UINT8, BASE_DEC, NULL, 0x20,
5866 "List of NE Types", HFILL}
5868 { &hf_gtpv2_tra_info_lne_mme,
5869 {"MME", "gtpv2.tra_info_lne_mme",
5870 FT_UINT8, BASE_DEC, NULL, 0x40,
5871 "List of NE Types", HFILL}
5873 { &hf_gtpv2_tra_info_lne_sgw,
5874 {"SGW", "gtpv2.tra_info_lne_sgw",
5875 FT_UINT8, BASE_DEC, NULL, 0x80,
5876 "List of NE Types", HFILL}
5878 { &hf_gtpv2_tra_info_lne_pdn_gw,
5879 {"PDN GW", "gtpv2.tra_info_lne_pdn_gw",
5880 FT_UINT8, BASE_DEC, NULL, 0x01,
5881 "List of NE Types", HFILL}
5883 { &hf_gtpv2_tra_info_lne_enb,
5884 {"eNB", "gtpv2.tra_info_lne_enb",
5885 FT_UINT8, BASE_DEC, NULL, 0x02,
5886 "List of NE Types", HFILL}
5888 { &hf_gtpv2_tra_info_tdl,
5889 {"Trace Depth Length", "gtpv2.tra_info_tdl",
5890 FT_UINT8, BASE_DEC, NULL, 0x0,
5893 { &hf_gtpv2_tra_info_lmsc_a,
5894 {"A", "gtpv2.tra_info_lmsc_a",
5895 FT_UINT8, BASE_DEC, NULL, 0x01,
5896 "MSC Server", HFILL}
5898 { &hf_gtpv2_tra_info_lmsc_lu,
5899 {"Iu", "gtpv2.tra_info_lmsc_lu",
5900 FT_UINT8, BASE_DEC, NULL, 0x02,
5901 "MSC Server", HFILL}
5903 { &hf_gtpv2_tra_info_lmsc_mc,
5904 {"Mc", "gtpv2.tra_info_lmsc_mc",
5905 FT_UINT8, BASE_DEC, NULL, 0x04,
5906 "MSC Server", HFILL}
5908 { &hf_gtpv2_tra_info_lmsc_map_g,
5909 {"MAP-G", "gtpv2.tra_info_lmsc_map_g",
5910 FT_UINT8, BASE_DEC, NULL, 0x08,
5911 "MSC Server", HFILL}
5913 { &hf_gtpv2_tra_info_lmsc_map_b,
5914 {"MAP-B", "gtpv2.tra_info_lmsc_map_b",
5915 FT_UINT8, BASE_DEC, NULL, 0x10,
5916 "MSC Server", HFILL}
5918 { &hf_gtpv2_tra_info_lmsc_map_e,
5919 {"MAP-E", "gtpv2.tra_info_lmsc_map_e",
5920 FT_UINT8, BASE_DEC, NULL, 0x20,
5921 "MSC Server", HFILL}
5923 { &hf_gtpv2_tra_info_lmsc_map_f,
5924 {"MAP-F", "gtpv2.tra_info_lmsc_map_f",
5925 FT_UINT8, BASE_DEC, NULL, 0x40,
5926 "MSC Server", HFILL}
5928 { &hf_gtpv2_tra_info_lmsc_cap,
5929 {"CAP", "gtpv2.tra_info_lmsc_cap",
5930 FT_UINT8, BASE_DEC, NULL, 0x80,
5931 "MSC Server", HFILL}
5933 { &hf_gtpv2_tra_info_lmsc_map_d,
5934 {"MAP-D", "gtpv2.tra_info_lmsc_map_d",
5935 FT_UINT8, BASE_DEC, NULL, 0x01,
5936 "MSC Server", HFILL}
5938 { &hf_gtpv2_tra_info_lmsc_map_c,
5939 {"MAP-C", "gtpv2.tra_info_lmsc_map_c",
5940 FT_UINT8, BASE_DEC, NULL, 0x02,
5941 "MSC Server", HFILL}
5943 { &hf_gtpv2_tra_info_lmgw_mc,
5944 {"Mc", "gtpv2.tra_info_lmgw_mc",
5945 FT_UINT8, BASE_DEC, NULL, 0x01,
5948 { &hf_gtpv2_tra_info_lmgw_nb_up,
5949 {"Nb-UP", "gtpv2.tra_info_lmgw_nb_up",
5950 FT_UINT8, BASE_DEC, NULL, 0x2,
5953 { &hf_gtpv2_tra_info_lmgw_lu_up,
5954 {"Iu-UP", "gtpv2.tra_info_lmgw_lu_up",
5955 FT_UINT8, BASE_DEC, NULL, 0x04,
5958 { &hf_gtpv2_tra_info_lsgsn_gb,
5959 {"Gb", "gtpv2.tra_info_lsgsn_gb",
5960 FT_UINT8, BASE_DEC, NULL, 0x01,
5963 { &hf_gtpv2_tra_info_lsgsn_lu,
5964 {"Iu", "gtpv2.tra_info_lsgsn_lu",
5965 FT_UINT8, BASE_DEC, NULL, 0x02,
5968 { &hf_gtpv2_tra_info_lsgsn_gn,
5969 {"Gn", "gtpv2.tra_info_lsgsn_gn",
5970 FT_UINT8, BASE_DEC, NULL, 0x04,
5973 { &hf_gtpv2_tra_info_lsgsn_map_gr,
5974 {"MAP-Gr", "gtpv2.tra_info_lsgsn_map_gr",
5975 FT_UINT8, BASE_DEC, NULL, 0x08,
5978 { &hf_gtpv2_tra_info_lsgsn_map_gd,
5979 {"MAP-Gd", "gtpv2.tra_info_lsgsn_map_gd",
5980 FT_UINT8, BASE_DEC, NULL, 0x10,
5983 { &hf_gtpv2_tra_info_lsgsn_map_gf,
5984 {"MAP-Gf", "gtpv2.tra_info_lsgsn_map_gf",
5985 FT_UINT8, BASE_DEC, NULL, 0x20,
5988 { &hf_gtpv2_tra_info_lsgsn_gs,
5989 {"Gs", "gtpv2.tra_info_lsgsn_gs",
5990 FT_UINT8, BASE_DEC, NULL, 0x40,
5993 { &hf_gtpv2_tra_info_lsgsn_ge,
5994 {"Ge", "gtpv2.tra_info_lsgsn_ge",
5995 FT_UINT8, BASE_DEC, NULL, 0x80,
5998 { &hf_gtpv2_tra_info_lggsn_gn,
5999 {"Gn", "gtpv2.tra_info_lggsn_gn",
6000 FT_UINT8, BASE_DEC, NULL, 0x01,
6003 { &hf_gtpv2_tra_info_lggsn_gi,
6004 {"Gi", "gtpv2.tra_info_lggsn_gi",
6005 FT_UINT8, BASE_DEC, NULL, 0x02,
6008 { &hf_gtpv2_tra_info_lggsn_gmb,
6009 {"Gmb", "gtpv2.tra_info_lggsn_gmb",
6010 FT_UINT8, BASE_DEC, NULL, 0x04,
6013 { &hf_gtpv2_tra_info_lrnc_lu,
6014 {"Iu", "gtpv2.tra_info_lrnc_lu",
6015 FT_UINT8, BASE_DEC, NULL, 0x01,
6018 { &hf_gtpv2_tra_info_lrnc_lur,
6019 {"Iur", "gtpv2.tra_info_lrnc_lur",
6020 FT_UINT8, BASE_DEC, NULL, 0x02,
6023 { &hf_gtpv2_tra_info_lrnc_lub,
6024 {"Iub", "gtpv2.tra_info_lrnc_lub",
6025 FT_UINT8, BASE_DEC, NULL, 0x04,
6028 { &hf_gtpv2_tra_info_lrnc_uu,
6029 {"Uu", "gtpv2.tra_info_lrnc_uu",
6030 FT_UINT8, BASE_DEC, NULL, 0x08,
6033 { &hf_gtpv2_tra_info_lbm_sc_gmb,
6034 {"Gmb", "gtpv2.tra_info_lbm_sc_gmb",
6035 FT_UINT8, BASE_DEC, NULL, 0x01,
6038 { &hf_gtpv2_tra_info_lmme_s1_mme,
6039 {"S1-MME", "gtpv2.tra_info_lmme_s1_mme",
6040 FT_UINT8, BASE_DEC, NULL, 0x01,
6043 { &hf_gtpv2_tra_info_lmme_s3,
6044 {"S3", "gtpv2.tra_info_lmme_s3",
6045 FT_UINT8, BASE_DEC, NULL, 0x02,
6048 { &hf_gtpv2_tra_info_lmme_s6a,
6049 {"S6a", "gtpv2.tra_info_lmme_s6a",
6050 FT_UINT8, BASE_DEC, NULL, 0x04,
6053 { &hf_gtpv2_tra_info_lmme_s10,
6054 {"S10", "gtpv2.tra_info_lmme_s10",
6055 FT_UINT8, BASE_DEC, NULL, 0x08,
6058 { &hf_gtpv2_tra_info_lmme_s11,
6059 {"S11", "gtpv2.tra_info_lmme_s11",
6060 FT_UINT8, BASE_DEC, NULL, 0x10,
6063 { &hf_gtpv2_tra_info_lsgw_s4,
6064 {"S4", "gtpv2.tra_info_lsgw_s4",
6065 FT_UINT8, BASE_DEC, NULL, 0x01,
6068 { &hf_gtpv2_tra_info_lsgw_s5,
6069 {"S5", "gtpv2.tra_info_lsgw_s5",
6070 FT_UINT8, BASE_DEC, NULL, 0x02,
6073 { &hf_gtpv2_tra_info_lsgw_s8b,
6074 {"S8b", "gtpv2.tra_info_lsgw_s8b",
6075 FT_UINT8, BASE_DEC, NULL, 0x04,
6078 { &hf_gtpv2_tra_info_lsgw_s11,
6079 {"S11", "gtpv2.tra_info_lsgw_s11",
6080 FT_UINT8, BASE_DEC, NULL, 0x08,
6083 { &hf_gtpv2_tra_info_lpdn_gw_s2a,
6084 {"S2a", "gtpv2.tra_info_lpdn_gw_s2a",
6085 FT_UINT8, BASE_DEC, NULL, 0x01,
6088 { &hf_gtpv2_tra_info_lpdn_gw_s2b,
6089 {"S2b", "gtpv2.tra_info_lpdn_gw_s2b",
6090 FT_UINT8, BASE_DEC, NULL, 0x02,
6093 { &hf_gtpv2_tra_info_lpdn_gw_s2c,
6094 {"S2c", "gtpv2.tra_info_lpdn_gw_s2c",
6095 FT_UINT8, BASE_DEC, NULL, 0x04,
6098 { &hf_gtpv2_tra_info_lpdn_gw_s5,
6099 {"S5", "gtpv2.tra_info_lpdn_gw_s5",
6100 FT_UINT8, BASE_DEC, NULL, 0x08,
6103 { &hf_gtpv2_tra_info_lpdn_gw_s6c,
6104 {"S6c", "gtpv2.tra_info_lpdn_gw_s6c",
6105 FT_UINT8, BASE_DEC, NULL, 0x10,
6108 { &hf_gtpv2_tra_info_lpdn_gw_gx,
6109 {"Gx", "gtpv2.tra_info_lpdn_gw_gx",
6110 FT_UINT8, BASE_DEC, NULL, 0x20,
6113 { &hf_gtpv2_tra_info_lpdn_gw_s8b,
6114 {"S8b", "gtpv2.tra_info_lpdn_gw_s8b",
6115 FT_UINT8, BASE_DEC, NULL, 0x40,
6118 { &hf_gtpv2_tra_info_lpdn_gw_sgi,
6119 {"SGi", "gtpv2.tra_info_lpdn_gw_sgi",
6120 FT_UINT8, BASE_DEC, NULL, 0x80,
6123 { &hf_gtpv2_tra_info_lenb_s1_mme,
6124 {"S1-MME", "gtpv2.tra_info_lenb_s1_mme",
6125 FT_UINT8, BASE_DEC, NULL, 0x01,
6128 { &hf_gtpv2_tra_info_lenb_x2,
6129 {"X2", "gtpv2.tra_info_lenb_x2",
6130 FT_UINT8, BASE_DEC, NULL, 0x02,
6133 { &hf_gtpv2_tra_info_lenb_uu,
6134 {"Uu", "gtpv2.tra_info_lenb_uu",
6135 FT_UINT8, BASE_DEC, NULL, 0x04,
6138 { &hf_gtpv2_pdn_ipv4,
6139 {"PDN Address and Prefix(IPv4)", "gtpv2.pdn_addr_and_prefix.ipv4",
6140 FT_IPv4, BASE_NONE, NULL, 0x0,
6143 { &hf_gtpv2_pdn_ipv6_len,
6144 {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
6145 FT_UINT8, BASE_DEC, NULL, 0x0,
6148 { &hf_gtpv2_pdn_ipv6,
6149 {"PDN Address and Prefix(IPv6)", "gtpv2.pdn_addr_and_prefix.ipv6",
6150 FT_BYTES, BASE_NONE, NULL, 0x0,
6153 /* Bit 1 - PVI (Pre-emption Vulnerability): See 3GPP TS 29.212[29],
6154 * clause 5.3.47 Pre-emption-Vulnerability AVP.
6155 * 5.3.47 Pre-emption-Vulnerability AVP
6156 * The following values are defined:
6157 * PRE-EMPTION_VULNERABILITY_ENABLED (0)
6158 * PRE-EMPTION_VULNERABILITY_DISABLED (1)
6160 {&hf_gtpv2_bearer_qos_pvi,
6161 {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
6162 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
6165 {&hf_gtpv2_bearer_qos_pl,
6166 {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
6167 FT_UINT8, BASE_DEC, NULL, 0x3c,
6170 /* Bit 7 - PCI (Pre-emption Capability): See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP.
6171 * clause 5.3.46 Pre-emption-Capability AVP.
6172 * 5.3.46 Pre-emption-Capability AVP
6173 * The following values are defined:
6174 * PRE-EMPTION_CAPABILITY_ENABLED (0)
6175 * PRE-EMPTION_CAPABILITY_DISABLED (1)
6177 {&hf_gtpv2_bearer_qos_pci,
6178 {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
6179 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
6182 {&hf_gtpv2_bearer_qos_label_qci,
6183 {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
6184 FT_UINT8, BASE_DEC, NULL, 0x0,
6187 {&hf_gtpv2_bearer_qos_mbr_up,
6188 {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
6189 FT_UINT64, BASE_DEC, NULL, 0x0,
6192 {&hf_gtpv2_bearer_qos_mbr_down,
6193 {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
6194 FT_UINT64, BASE_DEC, NULL, 0x0,
6197 {&hf_gtpv2_bearer_qos_gbr_up,
6198 {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
6199 FT_UINT64, BASE_DEC, NULL, 0x0,
6202 {&hf_gtpv2_bearer_qos_gbr_down,
6203 {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
6204 FT_UINT64, BASE_DEC, NULL, 0x0,
6207 {&hf_gtpv2_flow_qos_label_qci,
6208 {"Label (QCI)", "gtpv2.flow_qos_label_qci",
6209 FT_UINT8, BASE_DEC, NULL, 0x0,
6212 {&hf_gtpv2_flow_qos_mbr_up,
6213 {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
6214 FT_UINT64, BASE_DEC, NULL, 0x0,
6217 {&hf_gtpv2_flow_qos_mbr_down,
6218 {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
6219 FT_UINT64, BASE_DEC, NULL, 0x0,
6222 {&hf_gtpv2_flow_qos_gbr_up,
6223 {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
6224 FT_UINT64, BASE_DEC, NULL, 0x0,
6227 {&hf_gtpv2_flow_qos_gbr_down,
6228 {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
6229 FT_UINT64, BASE_DEC, NULL, 0x0,
6232 { &hf_gtpv2_rat_type,
6233 {"RAT Type", "gtpv2.rat_type",
6234 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_rat_type_vals_ext, 0x0,
6237 { &hf_gtpv2_uli_ecgi_flg,
6238 {"ECGI Present Flag", "gtpv2.uli_ecgi_flg",
6239 FT_BOOLEAN, 8, NULL, GTPv2_ULI_ECGI_MASK,
6242 { &hf_gtpv2_uli_lai_flg,
6243 {"LAI Present Flag", "gtpv2.uli_lai_flg",
6244 FT_BOOLEAN, 8, NULL, GTPv2_ULI_LAI_MASK,
6247 { &hf_gtpv2_uli_tai_flg,
6248 {"TAI Present Flag", "gtpv2.uli_tai_flg",
6249 FT_BOOLEAN, 8, NULL, GTPv2_ULI_TAI_MASK,
6252 { &hf_gtpv2_uli_rai_flg,
6253 {"RAI Present Flag", "gtpv2.uli_rai_flg",
6254 FT_BOOLEAN, 8, NULL, GTPv2_ULI_RAI_MASK,
6257 { &hf_gtpv2_uli_sai_flg,
6258 {"SAI Present Flag", "gtpv2.uli_sai_flg",
6259 FT_BOOLEAN, 8, NULL, GTPv2_ULI_SAI_MASK,
6262 { &hf_gtpv2_uli_cgi_flg,
6263 {"CGI Present Flag", "gtpv2.uli_cgi_flg",
6264 FT_BOOLEAN, 8, NULL, GTPv2_ULI_CGI_MASK,
6268 {"Geographic Location Type", "gtpv2.glt",
6269 FT_UINT8, BASE_DEC, VALS(geographic_location_type_vals), 0x0,
6272 { &hf_gtpv2_uli_cgi_lac,
6273 {"Location Area Code", "gtpv2.uli_cgi_lac",
6274 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6277 { &hf_gtpv2_uli_cgi_ci,
6278 {"Cell Identity", "gtpv2.uli_cgi_ci",
6279 FT_UINT16, BASE_DEC, NULL, 0x0,
6282 { &hf_gtpv2_uli_sai_lac,
6283 {"Location Area Code", "gtpv2.uli_sai_lac",
6284 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6287 { &hf_gtpv2_uli_sai_sac,
6288 {"Service Area Code", "gtpv2.uli_sai_sac",
6289 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6292 { &hf_gtpv2_uli_rai_lac,
6293 {"Location Area Code", "gtpv2.uli_rai_lac",
6294 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6297 { &hf_gtpv2_uli_rai_rac,
6298 {"Routing Area Code", "gtpv2.uli_rai_rac",
6299 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6302 { &hf_gtpv2_uli_tai_tac,
6303 {"Tracking Area Code", "gtpv2.uli_tai_tac",
6304 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6307 {&hf_gtpv2_uli_ecgi_eci,
6308 {"ECI (E-UTRAN Cell Identifier)", "gtpv2.uli_ecgi_eci",
6309 FT_UINT32, BASE_DEC, NULL, 0x0,
6312 {&hf_gtpv2_uli_lai_lac,
6313 {"Location Area Code (LAC)", "gtpv2.uli_lai_lac",
6314 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6317 {&hf_gtpv2_uli_ecgi_eci_spare,
6318 {"Spare", "gtpv2.uli_ecgi_eci_spare",
6319 FT_UINT8, BASE_DEC, NULL, 0x0,
6323 {"NSAPI", "gtpv2.nsapi",
6324 FT_UINT8, BASE_DEC, NULL, 0x0f,
6327 {&hf_gtpv2_f_teid_v4,
6328 {"V4", "gtpv2.f_teid_v4",
6329 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v4_vals), 0x80,
6332 {&hf_gtpv2_f_teid_v6,
6333 {"V6", "gtpv2.f_teid_v6",
6334 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v6_vals), 0x40,
6337 {&hf_gtpv2_f_teid_interface_type,
6338 {"Interface Type", "gtpv2.f_teid_interface_type",
6339 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_f_teid_interface_type_vals_ext, 0x3f,
6342 {&hf_gtpv2_f_teid_gre_key,
6343 {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
6344 FT_UINT32, BASE_HEX, NULL, 0x0,
6347 { &hf_gtpv2_f_teid_ipv4,
6348 {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
6349 FT_IPv4, BASE_NONE, NULL, 0x0,
6352 { &hf_gtpv2_f_teid_ipv6,
6353 {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
6354 FT_IPv6, BASE_NONE, NULL, 0x0,
6358 {"TMSI", "gtpv2.tmsi",
6359 FT_UINT32, BASE_HEX, NULL, 0x0,
6362 { &hf_gtpv2_hsgw_addr_f_len,
6363 {"HSGW Address for forwarding Length", "gtpv2.hsgw_addr_f_len",
6364 FT_UINT8, BASE_DEC, NULL, 0x0,
6367 { &hf_gtpv2_hsgw_addr_ipv4,
6368 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv4",
6369 FT_IPv4, BASE_NONE, NULL, 0x0,
6372 { &hf_gtpv2_hsgw_addr_ipv6,
6373 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv6",
6374 FT_IPv6, BASE_NONE, NULL, 0x0,
6377 { &hf_gtpv2_gre_key,
6378 {"GRE Key", "gtpv2.gre_key",
6379 FT_UINT32, BASE_DEC, NULL, 0x0,
6382 { &hf_gtpv2_sgw_addr_ipv4,
6383 {"Serving GW Address", "gtpv2.sgw_addr_ipv4",
6384 FT_IPv4, BASE_NONE, NULL, 0x0,
6387 { &hf_gtpv2_sgw_addr_ipv6,
6388 {"Serving GW Address", "gtpv2.sgw_addr_ipv6",
6389 FT_IPv6, BASE_NONE, NULL, 0x0,
6392 { &hf_gtpv2_sgw_s1u_teid,
6393 {"Serving GW S1-U TEID", "gtpv2.sgw_s1u_teid",
6394 FT_UINT32, BASE_HEX, NULL, 0x0,
6397 {&hf_gtpv2_delay_value,
6398 {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
6399 FT_UINT8, BASE_DEC, NULL, 0x0,
6402 {&hf_gtpv2_charging_id,
6403 {"Charging id", "gtpv2.charging_id",
6404 FT_UINT32, BASE_DEC, NULL, 0x0,
6407 {&hf_gtpv2_charging_characteristic,
6408 {"Charging Characteristic", "gtpv2.charging_characteristic",
6409 FT_UINT16, BASE_HEX, NULL, 0xffff,
6412 {&hf_gtpv2_bearer_flag_ppc,
6413 {"PPC (Prohibit Payload Compression)", "gtpv2.bearer_flag.ppc",
6414 FT_BOOLEAN, 8, NULL, 0x01,
6417 {&hf_gtpv2_bearer_flag_vb,
6418 {"VB (Voice Bearer)", "gtpv2.bearer_flag.vb",
6419 FT_BOOLEAN, 8, NULL, 0x02,
6423 {"Procedure Transaction Id", "gtpv2.pti",
6424 FT_UINT8, BASE_DEC, NULL, 0x0,
6428 { &hf_gtpv2_mm_context_sm,
6429 {"Security Mode", "gtpv2.mm_context_sm",
6430 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_security_mode), 0xe0,
6433 { &hf_gtpv2_mm_context_nhi,
6434 {"NHI(Next Hop Indicator)", "gtpv2.mm_context_nhi",
6435 FT_BOOLEAN, 8, TFS(>pv2_nhi_vals), 0x10,
6438 { &hf_gtpv2_mm_context_drxi,
6439 {"DRXI", "gtpv2.mm_context_drxi",
6440 FT_UINT8, BASE_DEC, NULL, 0x08,
6443 { &hf_gtpv2_mm_context_cksn,
6444 {"CKSN", "gtpv2.mm_context_cksn",
6445 FT_UINT8, BASE_DEC, NULL, 0x07,
6448 { &hf_gtpv2_mm_context_cksn_ksi,
6449 {"CKSN/KSI", "gtpv2.mm_context_cksn_ksi",
6450 FT_UINT8, BASE_DEC, NULL, 0x07,
6453 { &hf_gtpv2_mm_context_ksi_a,
6454 {"KSI_asme", "gtpv2.mm_context_ksi_a",
6455 FT_UINT8, BASE_DEC, NULL, 0x07,
6458 { &hf_gtpv2_mm_context_nr_tri,
6459 {"Number of Triplet", "gtpv2.mm_context_nr_tri",
6460 FT_UINT8, BASE_DEC, NULL, 0xe0,
6463 { &hf_gtpv2_mm_context_used_cipher,
6464 {"Used Cipher", "gtpv2.mm_context_used_cipher",
6465 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_used_cipher_vals), 0x07,
6468 { &hf_gtpv2_mm_context_unipa,
6469 {"Used NAS integrity protection algorithm", "gtpv2.mm_context_unipa",
6470 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unipa_vals), 0x70,
6474 { &hf_gtpv2_mm_context_unc,
6475 {"Used NAS Cipher", "gtpv2.mm_context_unc",
6476 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unc_vals), 0x0f,
6479 { &hf_gtpv2_mm_context_nas_dl_cnt,
6480 {"NAS Downlink Count", "gtpv2.mm_context_nas_dl_cnt",
6481 FT_UINT24, BASE_DEC, NULL, 0x0,
6484 { &hf_gtpv2_mm_context_nas_ul_cnt,
6485 {"NAS Uplink Count", "gtpv2.mm_context_nas_ul_cnt",
6486 FT_UINT24, BASE_DEC, NULL, 0x0,
6489 { &hf_gtpv2_mm_context_kasme,
6490 {"Kasme", "gtpv2.mm_context_kasme",
6491 FT_BYTES, BASE_NONE, NULL, 0x0,
6494 { &hf_gtpv2_mm_context_rand,
6495 {"RAND", "gtpv2.mm_context_rand",
6496 FT_BYTES, BASE_NONE, NULL, 0x0,
6499 { &hf_gtpv2_mm_context_xres_len,
6500 {"XRES Length", "gtpv2.mm_context_xres_len",
6501 FT_UINT8, BASE_DEC, NULL, 0x0,
6504 { &hf_gtpv2_mm_context_xres,
6505 {"XRES", "gtpv2.mm_context_xres",
6506 FT_BYTES, BASE_NONE, NULL, 0x0,
6509 { &hf_gtpv2_mm_context_autn_len,
6510 {"AUTN Length", "gtpv2.mm_context_autn_len",
6511 FT_UINT8, BASE_DEC, NULL, 0x0,
6514 { &hf_gtpv2_mm_context_autn,
6515 {"AUTN", "gtpv2.mm_context_autn",
6516 FT_BYTES, BASE_NONE, NULL, 0x0,
6519 { &hf_gtpv2_mm_context_drx,
6520 {"DRX", "gtpv2.mm_context_drx",
6521 FT_UINT16, BASE_HEX, NULL, 0x0,
6524 { &hf_gtpv2_vdp_length,
6525 {"VDP and UE's Usage Setting length", "gtpv2.vdp_length",
6526 FT_UINT8, BASE_DEC, NULL, 0x0,
6530 { &hf_gtpv2_mm_context_ue_net_cap_len,
6531 {"Length of UE Network Capability", "gtpv2.mm_context_ue_net_cap_len",
6532 FT_UINT8, BASE_DEC, NULL, 0x0,
6535 { &hf_gtpv2_mm_context_ms_net_cap_len,
6536 {"Length of MS Network Capability", "gtpv2.mm_context_ms_net_cap_len",
6537 FT_UINT8, BASE_DEC, NULL, 0x0,
6540 { &hf_gtpv2_mm_context_mei_len,
6541 {"Length of Mobile Equipment Identity (MEI)", "gtpv2.mm_context_mei_len",
6542 FT_UINT8, BASE_DEC, NULL, 0x0,
6545 { &hf_gtpv2_mm_context_vdp_len,
6546 {"Length of Voice Domain Preference and UE's Usage Setting", "gtpv2.mm_context_vdp_len",
6547 FT_UINT8, BASE_DEC, NULL, 0x0,
6551 { "UTRAN", "gtpv2.mm_context.una",
6552 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x01,
6556 { "GERAN", "gtpv2.mm_context.gena",
6557 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x02,
6561 { "GAN", "gtpv2.mm_context.gana",
6562 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x04,
6566 { "I-HSPA-EVOLUTION", "gtpv2.mm_context.ina",
6567 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x08,
6571 { "E-UTRAN", "gtpv2.mm_context.ena",
6572 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x10,
6576 { "HO-toNone3GPP-Access", "gtpv2.mm_context.hnna",
6577 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x20,
6580 { &hf_gtpv2_mm_context_ksi,
6581 {"KSI", "gtpv2.mm_context_ksi",
6582 FT_UINT8, BASE_DEC, NULL, 0x07,
6585 { &hf_gtpv2_mm_context_nr_qui,
6586 {"Number of Quintuplets", "gtpv2.mm_context_nr_qui",
6587 FT_UINT8, BASE_DEC, NULL, 0xe0,
6591 { &hf_gtpv2_mm_context_nr_qua,
6592 {"Number of Quadruplet", "gtpv2.mm_context_nr_qua",
6593 FT_UINT8, BASE_DEC, NULL, 0x1c,
6596 { &hf_gtpv2_mm_context_uamb_ri,
6597 {"UAMB RI", "gtpv2.mm_context_uamb_ri",
6598 FT_BOOLEAN, 8, NULL, 0x02,
6601 { &hf_gtpv2_mm_context_osci,
6602 {"OSCI", "gtpv2.mm_context_osci",
6603 FT_BOOLEAN, 8, NULL, 0x02,
6606 { &hf_gtpv2_mm_context_samb_ri,
6607 {"SAMB RI", "gtpv2.mm_context_samb_ri",
6608 FT_BOOLEAN, 8, NULL, 0x0,
6611 { &hf_gtpv2_ue_time_zone_dst,
6612 {"Daylight Saving Time", "gtpv2.ue_time_zone_dst",
6613 FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals), 0x03,
6616 { &hf_gtpv2_fq_csid_type,
6617 {"Node-ID Type", "gtpv2.fq_csid_type",
6618 FT_UINT8, BASE_DEC, NULL, 0xf0,
6621 { &hf_gtpv2_fq_csid_nr,
6622 {"Number of CSIDs", "gtpv2.fq_csid_nr",
6623 FT_UINT8, BASE_DEC, NULL, 0x0f,
6626 { &hf_gtpv2_fq_csid_ipv4,
6627 {"Node-ID (IPv4)", "gtpv2.fq_csid_ipv4",
6628 FT_IPv4, BASE_NONE, NULL, 0x0,
6631 { &hf_gtpv2_fq_csid_ipv6,
6632 {"Node-ID (IPv6)", "gtpv2.fq_csid_ipv6",
6633 FT_IPv6, BASE_NONE, NULL, 0x0,
6636 { &hf_gtpv2_fq_csid_id,
6637 {"CSID", "gtpv2.fq_csid_id",
6638 FT_UINT16, BASE_DEC, NULL, 0x0,
6641 { &hf_gtpv2_complete_req_msg_type,
6642 {"Complete Request Message Type", "gtpv2.complete_req_msg_type",
6643 FT_UINT8, BASE_DEC, VALS(gtpv2_complete_req_msg_type_vals), 0x0,
6646 {&hf_gtpv2_mme_grp_id,
6647 {"MME Group ID", "gtpv2.mme_grp_id",
6648 FT_UINT16, BASE_DEC, NULL, 0x0,
6651 { &hf_gtpv2_mme_code,
6652 {"MME Code", "gtpv2.mme_code",
6653 FT_UINT8, BASE_DEC, NULL, 0x0,
6657 {"M-TMSI", "gtpv2.m_tmsi",
6658 FT_BYTES, BASE_NONE, NULL, 0x0,
6661 { &hf_gtpv2_container_type,
6662 {"Container Type", "gtpv2.container_type",
6663 FT_UINT8, BASE_DEC, VALS(gtpv2_container_type_vals), 0x0f,
6666 { &hf_gtpv2_cause_type,
6667 {"Cause Type", "gtpv2.cause_type",
6668 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_type_vals_ext, 0x0f,
6671 { &hf_gtpv2_CauseRadioNetwork,
6672 {"Radio Network Layer Cause", "gtpv2.CauseRadioNetwork",
6673 FT_UINT8, BASE_DEC, VALS(s1ap_CauseRadioNetwork_vals), 0x0,
6676 { &hf_gtpv2_CauseTransport,
6677 {"Transport Layer Cause", "gtpv2.CauseTransport",
6678 FT_UINT8, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0x0,
6681 { &hf_gtpv2_CauseNas,
6682 {"NAS Cause", "gtpv2.CauseNas",
6683 FT_UINT8, BASE_DEC, VALS(s1ap_CauseNas_vals), 0x0,
6686 { &hf_gtpv2_CauseMisc,
6687 {"Miscellaneous Cause", "gtpv2.CauseMisc",
6688 FT_UINT8, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0x0,
6691 { &hf_gtpv2_target_type,
6692 {"Target Type", "gtpv2.target_type",
6693 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_target_type_vals_ext, 0x0,
6696 {&hf_gtpv2_macro_enodeb_id,
6697 {"Macro eNodeB ID", "gtpv2.macro_enodeb_id",
6698 FT_UINT24, BASE_HEX, NULL, 0x0fffff,
6701 { &hf_gtpv2_CauseProtocol,
6702 {"Protocol Cause", "gtpv2.CauseProtocol",
6703 FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0,
6706 {&hf_gtpv2_apn_rest,
6707 {"APN Restriction", "gtpv2.apn_rest",
6708 FT_UINT8, BASE_DEC, NULL, 0x0,
6711 {&hf_gtpv2_selec_mode,
6712 {"Selection Mode", "gtpv2.selec_mode",
6713 FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals), 0x03,
6716 { &hf_gtpv2_source_type,
6717 {"Source Type", "gtpv2.source_type",
6718 FT_UINT8, BASE_DEC, NULL, 0x0,
6721 {&hf_gtpv2_bearer_control_mode,
6722 {"Bearer Control Mode", "gtpv2.bearer_control_mode",
6723 FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals), 0x0,
6726 { &hf_gtpv2_cng_rep_act,
6727 {"Change Reporting Action", "gtpv2.cng_rep_act",
6728 FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
6731 { &hf_gtpv2_node_type,
6732 {"Node Type", "gtpv2.node_type",
6733 FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
6737 {"FQDN", "gtpv2.fqdn",
6738 FT_STRING, BASE_NONE, NULL, 0x0,
6741 { &hf_gtpv2_enterprise_id,
6742 {"Enterprise ID", "gtpv2.enterprise_id",
6743 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
6746 { &hf_gtpv2_address_digits,
6747 { "Address digits", "gtpv2.address_digits",
6748 FT_STRING, BASE_NONE, NULL, 0,
6752 {"Transaction Identifier", "gtpv2.ti",
6753 FT_BYTES, BASE_NONE, NULL, 0x0,
6756 { &hf_gtpv2_bss_container_phx,
6757 {"PHX", "gtpv2.bss_cont.phx",
6758 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
6761 { &hf_gtpv2_bss_con_sapi_flg,
6762 {"SAPI", "gtpv2.bss_cont.sapi_flg",
6763 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
6766 { &hf_gtpv2_bss_con_rp_flg,
6767 {"RP", "gtpv2.bss_cont.rp_flg",
6768 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
6771 { &hf_gtpv2_bss_con_pfi_flg,
6772 {"PFI", "gtpv2.bss_cont.pfi_flg",
6773 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
6776 { &hf_gtpv2_bss_con_pfi,
6777 {"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
6778 FT_UINT8, BASE_DEC, NULL, 0x0,
6781 { &hf_gtpv2_bss_con_rp,
6782 {"Radio Priority(RP)", "gtpv2.bss_cont.rp",
6783 FT_UINT8, BASE_DEC, NULL, 0x07,
6786 { &hf_gtpv2_bss_con_sapi,
6787 {"SAPI", "gtpv2.bss_cont.sapi",
6788 FT_UINT8, BASE_DEC, NULL, 0xf0,
6791 { &hf_gtpv2_bss_con_xid_len,
6792 {"XiD parameters length", "gtpv2.bss_cont.xid_len",
6793 FT_UINT8, BASE_DEC, NULL, 0x0,
6796 { &hf_gtpv2_bss_con_xid,
6797 {"XiD parameters", "gtpv2.bss_cont.xid",
6798 FT_BYTES, BASE_NONE, NULL, 0x0,
6801 { &hf_gtpv2_home_enodeb_id,
6802 {"Home eNodeB ID", "gtpv2.home_enodeb_id",
6803 FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
6807 {"Tracking Area Code (TAC)", "gtpv2.tac",
6808 FT_UINT16, BASE_DEC, NULL, 0x0,
6811 { &hf_gtpv2_mbms_service_area_nr,
6812 {"Number of MBMS Service Area codes", "gtpv2.mbms_service_area_nr",
6813 FT_UINT16, BASE_DEC, NULL, 0x0,
6816 { &hf_gtpv2_mbms_service_area_id,
6817 {"MBMS Service Area code (Service Area Identity)", "gtpv2.mbms_service_area_id",
6818 FT_UINT16, BASE_DEC, NULL, 0x0,
6821 { &hf_gtpv2_mbms_session_id,
6822 {"MBMS Session Identifier", "gtpv2.mbms_session_id",
6823 FT_BYTES, BASE_NONE, NULL, 0x0,
6826 { &hf_gtpv2_mbms_flow_id,
6827 {"MBMS Flow Identifier", "gtpv2.mbms_flow_id",
6828 FT_BYTES, BASE_NONE, NULL, 0x0,
6832 {"Common Tunnel Endpoint Identifier", "gtpv2.cetid",
6833 FT_UINT32, BASE_DEC, NULL, 0x0,
6836 { &hf_gtpv2_ip_addr_type,
6837 {"IP Address Type", "gtpv2.ip_addr_type",
6838 FT_UINT8, BASE_DEC, NULL, 0xc0,
6841 { &hf_gtpv2_ip_addr_len,
6842 {"IP Address Length", "gtpv2.ip_addr_len",
6843 FT_UINT8, BASE_DEC, NULL, 0x3f,
6846 { &hf_gtpv2_mbms_ip_mc_dist_addrv4,
6847 {"MBMS IP Multicast Distribution Address (IPv4)", "gtpv2.mbms_ip_mc_dist_addrv4",
6848 FT_IPv4, BASE_NONE, NULL, 0x0,
6851 { &hf_gtpv2_mbms_ip_mc_dist_addrv6,
6852 {"MBMS IP Multicast Distribution Address (IPv6)", "gtpv2.mbms_ip_mc_dist_addrv6",
6853 FT_IPv6, BASE_NONE, NULL, 0x0,
6856 { &hf_gtpv2_mbms_ip_mc_src_addrv4,
6857 {"MBMS IP Multicast Source Address (IPv4)", "gtpv2.mbms_ip_mc_src_addrv4",
6858 FT_IPv4, BASE_NONE, NULL, 0x0,
6861 { &hf_gtpv2_mbms_ip_mc_src_addrv6,
6862 {"MBMS IP Multicast Source Address (IPv6)", "gtpv2.mbms_ip_mc_src_addrv6",
6863 FT_IPv6, BASE_NONE, NULL, 0x0,
6866 { &hf_gtpv2_mbms_hc_indicator,
6867 {"MBMS HC Indicator", "gtpv2.mbms_hc_indicator",
6868 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_hc_indicator_vals), 0x0,
6871 { &hf_gtpv2_mbms_dist_indication,
6872 {"MBMS Distribution Indication", "gtpv2.mbms_dist_indication",
6873 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_dist_indication_vals), 0x03,
6876 { &hf_gtpv2_subscriber_rfsp,
6877 {"Subscribed RFSP Index", "gtpv2.subscriber_rfsp",
6878 FT_INT16, BASE_DEC, NULL, 0x0,
6881 { &hf_gtpv2_rfsp_inuse,
6882 {"RFSP Index in Use", "gtpv2.rfsp_inuse",
6883 FT_INT16, BASE_DEC, NULL, 0x0,
6886 { &hf_gtpv2_mbms_service_id,
6887 {"MBMS Service ID", "gtpv2.mbms_service_id",
6888 FT_BYTES, BASE_NONE, NULL, 0x0,
6891 { &hf_gtpv2_add_flags_for_srvcc_ics,
6892 {"ICS (IMS Centralized Service)", "gtpv2.add_flags_for_srvcc_ics",
6893 FT_BOOLEAN, 8, NULL, 0x01,
6896 { &hf_gtpv2_vsrvcc_flag,
6897 {"VF (vSRVCC Flag)", "gtpv2.vsrvcc_flag",
6898 FT_BOOLEAN, 8, NULL, 0x02,
6901 { &hf_gtpv2_henb_info_report_fti,
6902 {"FTI", "gtpv2.henb_info_report_fti",
6903 FT_BOOLEAN, 8, TFS(>pv2_henb_info_report_fti_vals), 0x01,
6906 { &hf_gtpv2_ip4cp_subnet_prefix_len,
6907 {"Subnet Prefix Length", "gtpv2.ip4cp_subnet_prefix_len",
6908 FT_UINT8, BASE_DEC, NULL, 0x0,
6911 { &hf_gtpv2_ip4cp_ipv4,
6912 {"IPv4 Default Router Address", "gtpv2.ip4cp_ipv4",
6913 FT_IPv4, BASE_NONE, NULL, 0x0,
6916 { &hf_gtpv2_change_report_flags_sncr,
6917 {"SNCR (Service Network Change to Report)", "gtpv2.change_report_flags_sncr",
6918 FT_BOOLEAN, 8, NULL, 0x01,
6921 { &hf_gtpv2_change_report_flags_tzcr,
6922 {"TZCR (Time Zone Change to Report)", "gtpv2.change_report_flags_tzcr",
6923 FT_BOOLEAN, 8, NULL, 0x02,
6926 {&hf_gtpv2_action_indication_val,
6927 {"Action Indication", "gtpv2.action_indication_val",
6928 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_action_indication_vals_ext, 0x07,
6931 { &hf_gtpv2_abs_time_mbms_data,
6932 {"Absolute Time of MBMS Data Transfer", "gtpv2.abs_time_mbms_data",
6933 FT_STRING, BASE_NONE, NULL, 0,
6936 { &hf_gtpv2_mbms_session_duration_days,
6937 {"MBMS Session Duration (days)", "gtpv2.mbms_session_duration_days",
6938 FT_UINT24, BASE_DEC, NULL, 0x00007F,
6941 { &hf_gtpv2_mbms_session_duration_secs,
6942 {"MBMS Session Duration (seconds)", "gtpv2.mbms_session_duration_secs",
6943 FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
6946 { &hf_gtpv2_node_features_prn,
6947 {"PGW Restart Notification (PRN)", "gtpv2.node_features_prn",
6948 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
6951 { &hf_gtpv2_node_features_mabr,
6952 {"Modify Access Bearers Request (MABR)", "gtpv2.node_features_mabr",
6953 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
6956 { &hf_gtpv2_node_features_ntsr,
6957 {"Network Triggered Service Restoration (NTSR)", "gtpv2.node_features_ntsr",
6958 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
6961 { &hf_gtpv2_time_to_data_xfer,
6962 {"MBMS Time to Data Transfer", "gtpv2.time_to_data_xfer",
6963 FT_STRING, BASE_NONE, NULL, 0,
6966 { &hf_gtpv2_arp_pvi,
6967 {"Pre-emption Vulnerability (PVI)", "gtpv2.arp_pvi",
6968 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
6972 {"Priority Level", "gtpv2.arp_pl",
6973 FT_UINT8, BASE_DEC, NULL, 0x3c,
6976 { &hf_gtpv2_arp_pci,
6977 {"Pre-emption Capability (PCI)", "gtpv2.arp_pci",
6978 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
6981 { &hf_gtpv2_timer_unit,
6982 {"Timer unit", "gtpv2.timer_unit",
6983 FT_UINT8, BASE_DEC, VALS(gtpv2_timer_unit_vals), 0xe0,
6986 { &hf_gtpv2_timer_value,
6987 {"Timer value", "gtpv2.timer_value",
6988 FT_UINT8, BASE_DEC, NULL, 0x1f,
6992 {"LAPI (Low Access Priority Indication)", "gtpv2.lapi",
6993 FT_BOOLEAN, 8, NULL, 0x01,
6996 { &hf_gtpv2_mm_context_higher_br_16mb_flg_len,
6997 {"Length of Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg_len",
6998 FT_UINT8, BASE_DEC, NULL, 0x0,
7001 { &hf_gtpv2_mm_context_higher_br_16mb_flg,
7002 {"Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg",
7003 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_higher_br_16mb_flg_vals), 0x0,
7006 { &hf_gtpv2_mmbr_ul,
7007 {"Max MBR/APN-AMBR for uplink", "gtpv2.mmbr_ul",
7008 FT_UINT32, BASE_DEC, NULL, 0x0,
7011 { &hf_gtpv2_mmbr_dl,
7012 {"Max MBR/APN-AMBR for downlink", "gtpv2.mmbr_dl",
7013 FT_UINT32, BASE_DEC, NULL, 0x0,
7018 static gint *ett_gtpv2_array[] = {
7022 &ett_gtpv2_uli_flags,
7023 &ett_gtpv2_uli_field,
7024 &ett_gtpv2_bearer_ctx,
7025 &ett_gtpv2_PDN_conn,
7026 &ett_gtpv2_mm_context_flag,
7027 &ett_gtpv2_pdn_numbers_nsapi,
7028 &ett_gtpv2_tra_info_trigg,
7029 &ett_gtpv2_tra_info_trigg_msc_server,
7030 &ett_gtpv2_tra_info_trigg_mgw,
7031 &ett_gtpv2_tra_info_trigg_sgsn,
7032 &ett_gtpv2_tra_info_trigg_ggsn,
7033 &ett_gtpv2_tra_info_trigg_bm_sc,
7034 &ett_gtpv2_tra_info_trigg_sgw_mme,
7035 &ett_gtpv2_tra_info_interfaces,
7036 &ett_gtpv2_tra_info_interfaces_imsc_server,
7037 &ett_gtpv2_tra_info_interfaces_lmgw,
7038 &ett_gtpv2_tra_info_interfaces_lsgsn,
7039 &ett_gtpv2_tra_info_interfaces_lggsn,
7040 &ett_gtpv2_tra_info_interfaces_lrnc,
7041 &ett_gtpv2_tra_info_interfaces_lbm_sc,
7042 &ett_gtpv2_tra_info_interfaces_lmme,
7043 &ett_gtpv2_tra_info_interfaces_lsgw,
7044 &ett_gtpv2_tra_info_interfaces_lpdn_gw,
7045 &ett_gtpv2_tra_info_interfaces_lpdn_lenb,
7046 &ett_gtpv2_tra_info_ne_types,
7050 &ett_gtpv2_supp_codec_list,
7052 &ett_gtpv2_mm_context_auth_qua,
7053 &ett_gtpv2_mm_context_auth_qui,
7054 &ett_gtpv2_mm_context_auth_tri,
7055 &ett_gtpv2_mm_context_net_cap,
7056 &ett_gtpv2_ms_network_capability,
7058 &ett_gtpv2_access_rest_data,
7063 static ei_register_info ei[] = {
7064 { &ei_gtpv2_ie_data_not_dissected, { "gtpv2.ie_data_not_dissected", PI_PROTOCOL, PI_NOTE, "IE data not dissected yet", EXPFILL }},
7065 { &ei_gtpv2_ie_len_invalid, { "gtpv2.ie_len_invalid", PI_PROTOCOL, PI_ERROR, "Wrong length", EXPFILL }},
7066 { &ei_gtpv2_source_type_unknown, { "gtpv2.source_type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown source type", EXPFILL }},
7067 { &ei_gtpv2_fq_csid_type_bad, { "gtpv2.fq_csid_type.unknown", PI_PROTOCOL, PI_ERROR, "Wrong Node-ID Type", EXPFILL }},
7070 expert_module_t* expert_gtpv2;
7072 proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
7073 proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
7074 proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
7075 expert_gtpv2 = expert_register_protocol(proto_gtpv2);
7076 expert_register_field_array(expert_gtpv2, ei, array_length(ei));
7078 /* AVP Code: 22 3GPP-User-Location-Info */
7079 dissector_add_uint("diameter.3gpp", 22, new_create_dissector_handle(dissect_diameter_3gpp_uli, proto_gtpv2));
7081 register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
7082 /* Dissector table for private extensions */
7083 gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 PRIVATE EXT", FT_UINT16, BASE_DEC);
7087 proto_reg_handoff_gtpv2(void)
7089 nas_eps_handle = find_dissector("nas-eps");
7098 * indent-tabs-mode: nil
7101 * ex: set shiftwidth=4 tabstop=8 expandtab:
7102 * :indentSize=4:tabSize=8:noTabs=true: