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_ipv4_addr = -1;
170 static int hf_gtpv2_ambr_up= -1;
171 static int hf_gtpv2_ambr_down= -1;
172 static int hf_gtpv2_ip_address_ipv4= -1;
173 static int hf_gtpv2_ip_address_ipv6= -1;
174 static int hf_gtpv2_mei= -1;
176 /* Trace Information */
177 /* static int hf_gtpv2_tra_info = -1; */
178 static int hf_gtpv2_tra_info_msc_momt_calls = -1;
179 static int hf_gtpv2_tra_info_msc_momt_sms = -1;
180 static int hf_gtpv2_tra_info_msc_lu_imsi_ad = -1;
181 static int hf_gtpv2_tra_info_msc_handovers = -1;
182 static int hf_gtpv2_tra_info_msc_ss = -1;
183 static int hf_gtpv2_tra_info_mgw_context = -1;
184 static int hf_gtpv2_tra_info_sgsn_pdp_context = -1;
185 static int hf_gtpv2_tra_info_sgsn_momt_sms = -1;
186 static int hf_gtpv2_tra_info_sgsn_rau_gprs_ad = -1;
187 static int hf_gtpv2_tra_info_sgsn_mbms = -1;
188 static int hf_gtpv2_tra_info_sgsn_reserved = -1;
189 static int hf_gtpv2_tra_info_ggsn_pdp = -1;
190 static int hf_gtpv2_tra_info_ggsn_mbms = -1;
191 static int hf_gtpv2_tra_info_bm_sc = -1;
192 static int hf_gtpv2_tra_info_mme_sgw_ss = -1;
193 static int hf_gtpv2_tra_info_mme_sgw_sr = -1;
194 static int hf_gtpv2_tra_info_mme_sgw_iataud = -1;
195 static int hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc = -1;
196 static int hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del = -1;
197 static int hf_gtpv2_tra_info_mme_sgw_ho = -1;
198 static int hf_gtpv2_tra_info_sgw_pdn_con_creat = -1;
199 static int hf_gtpv2_tra_info_sgw_pdn_con_term = -1;
200 static int hf_gtpv2_tra_info_sgw_bearer_act_mod_del = -1;
201 static int hf_gtpv2_tra_info_pgw_pdn_con_creat = -1;
202 static int hf_gtpv2_tra_info_pgw_pdn_con_term = -1;
203 static int hf_gtpv2_tra_info_pgw_bearer_act_mod_del = -1;
204 static int hf_gtpv2_tra_info_lne_msc_s = -1;
205 static int hf_gtpv2_tra_info_lne_mgw = -1;
206 static int hf_gtpv2_tra_info_lne_sgsn = -1;
207 static int hf_gtpv2_tra_info_lne_ggsn = -1;
208 static int hf_gtpv2_tra_info_lne_rnc = -1;
209 static int hf_gtpv2_tra_info_lne_bm_sc = -1;
210 static int hf_gtpv2_tra_info_lne_mme = -1;
211 static int hf_gtpv2_tra_info_lne_sgw = -1;
212 static int hf_gtpv2_tra_info_lne_pdn_gw = -1;
213 static int hf_gtpv2_tra_info_lne_enb = -1;
214 static int hf_gtpv2_tra_info_tdl = -1;
215 static int hf_gtpv2_tra_info_lmsc_a = -1;
216 static int hf_gtpv2_tra_info_lmsc_lu = -1;
217 static int hf_gtpv2_tra_info_lmsc_mc = -1;
218 static int hf_gtpv2_tra_info_lmsc_map_g = -1;
219 static int hf_gtpv2_tra_info_lmsc_map_b = -1;
220 static int hf_gtpv2_tra_info_lmsc_map_e = -1;
221 static int hf_gtpv2_tra_info_lmsc_map_f = -1;
222 static int hf_gtpv2_tra_info_lmsc_cap = -1;
223 static int hf_gtpv2_tra_info_lmsc_map_d = -1;
224 static int hf_gtpv2_tra_info_lmsc_map_c = -1;
225 static int hf_gtpv2_tra_info_lmgw_mc = -1;
226 static int hf_gtpv2_tra_info_lmgw_nb_up = -1;
227 static int hf_gtpv2_tra_info_lmgw_lu_up = -1;
228 static int hf_gtpv2_tra_info_lsgsn_gb = -1;
229 static int hf_gtpv2_tra_info_lsgsn_lu = -1;
230 static int hf_gtpv2_tra_info_lsgsn_gn = -1;
231 static int hf_gtpv2_tra_info_lsgsn_map_gr = -1;
232 static int hf_gtpv2_tra_info_lsgsn_map_gd = -1;
233 static int hf_gtpv2_tra_info_lsgsn_map_gf = -1;
234 static int hf_gtpv2_tra_info_lsgsn_gs = -1;
235 static int hf_gtpv2_tra_info_lsgsn_ge = -1;
236 static int hf_gtpv2_tra_info_lggsn_gn = -1;
237 static int hf_gtpv2_tra_info_lggsn_gi = -1;
238 static int hf_gtpv2_tra_info_lggsn_gmb = -1;
239 static int hf_gtpv2_tra_info_lrnc_lu = -1;
240 static int hf_gtpv2_tra_info_lrnc_lur = -1;
241 static int hf_gtpv2_tra_info_lrnc_lub = -1;
242 static int hf_gtpv2_tra_info_lrnc_uu = -1;
243 static int hf_gtpv2_tra_info_lbm_sc_gmb = -1;
244 static int hf_gtpv2_tra_info_lmme_s1_mme = -1;
245 static int hf_gtpv2_tra_info_lmme_s3 = -1;
246 static int hf_gtpv2_tra_info_lmme_s6a = -1;
247 static int hf_gtpv2_tra_info_lmme_s10 = -1;
248 static int hf_gtpv2_tra_info_lmme_s11 = -1;
249 static int hf_gtpv2_tra_info_lsgw_s4 = -1;
250 static int hf_gtpv2_tra_info_lsgw_s5 = -1;
251 static int hf_gtpv2_tra_info_lsgw_s8b = -1;
252 static int hf_gtpv2_tra_info_lsgw_s11 = -1;
253 static int hf_gtpv2_tra_info_lpdn_gw_s2a = -1;
254 static int hf_gtpv2_tra_info_lpdn_gw_s2b = -1;
255 static int hf_gtpv2_tra_info_lpdn_gw_s2c = -1;
256 static int hf_gtpv2_tra_info_lpdn_gw_s5 = -1;
257 static int hf_gtpv2_tra_info_lpdn_gw_s6c = -1;
258 static int hf_gtpv2_tra_info_lpdn_gw_gx = -1;
259 static int hf_gtpv2_tra_info_lpdn_gw_s8b = -1;
260 static int hf_gtpv2_tra_info_lpdn_gw_sgi = -1;
261 static int hf_gtpv2_tra_info_lenb_s1_mme = -1;
262 static int hf_gtpv2_tra_info_lenb_x2 = -1;
263 static int hf_gtpv2_tra_info_lenb_uu = -1;
265 static int hf_gtpv2_ti = -1;
267 static int hf_gtpv2_bearer_qos_pvi= -1;
268 static int hf_gtpv2_bearer_qos_pl= -1;
269 static int hf_gtpv2_bearer_qos_pci= -1;
270 static int hf_gtpv2_bearer_qos_label_qci = -1;
271 static int hf_gtpv2_bearer_qos_mbr_up = -1;
272 static int hf_gtpv2_bearer_qos_mbr_down = -1;
273 static int hf_gtpv2_bearer_qos_gbr_up = -1;
274 static int hf_gtpv2_bearer_qos_gbr_down = -1;
275 static int hf_gtpv2_flow_qos_label_qci = -1;
276 static int hf_gtpv2_flow_qos_mbr_up = -1;
277 static int hf_gtpv2_flow_qos_mbr_down = -1;
278 static int hf_gtpv2_flow_qos_gbr_up = -1;
279 static int hf_gtpv2_flow_qos_gbr_down = -1;
281 static int hf_gtpv2_delay_value = -1;
282 static int hf_gtpv2_charging_id = -1;
283 static int hf_gtpv2_charging_characteristic = -1;
284 static int hf_gtpv2_bearer_flag_ppc = -1;
285 static int hf_gtpv2_bearer_flag_vb = -1;
286 static int hf_gtpv2_ue_time_zone_dst = -1;
287 static int hf_gtpv2_fq_csid_type = -1;
288 static int hf_gtpv2_fq_csid_nr = -1;
289 static int hf_gtpv2_fq_csid_ipv4 = -1;
290 static int hf_gtpv2_fq_csid_ipv6 = -1;
291 static int hf_gtpv2_fq_csid_id = -1;
292 static int hf_gtpv2_complete_req_msg_type = -1;
293 static int hf_gtpv2_mme_grp_id = -1;
294 static int hf_gtpv2_mme_code = -1;
295 static int hf_gtpv2_m_tmsi = -1;
296 static int hf_gtpv2_container_type = -1;
297 static int hf_gtpv2_cause_type = -1;
298 static int hf_gtpv2_CauseRadioNetwork = -1;
299 static int hf_gtpv2_CauseTransport = -1;
300 static int hf_gtpv2_CauseNas = -1;
301 static int hf_gtpv2_CauseProtocol = -1;
302 static int hf_gtpv2_CauseMisc = -1;
303 static int hf_gtpv2_target_type = -1;
304 static int hf_gtpv2_macro_enodeb_id = -1;
306 static int hf_gtpv2_node_type= -1;
307 static int hf_gtpv2_fqdn = -1;
308 static int hf_gtpv2_enterprise_id = -1;
309 static int hf_gtpv2_apn_rest= -1;
310 static int hf_gtpv2_pti= -1;
311 static int hf_gtpv2_mm_context_sm = -1;
312 static int hf_gtpv2_mm_context_nhi = -1;
313 static int hf_gtpv2_mm_context_drxi = -1;
314 static int hf_gtpv2_mm_context_cksn = -1;
315 static int hf_gtpv2_mm_context_cksn_ksi = -1;
316 static int hf_gtpv2_mm_context_kasme = -1;
317 static int hf_gtpv2_mm_context_rand = -1;
318 static int hf_gtpv2_mm_context_xres_len = -1;
319 static int hf_gtpv2_mm_context_xres = -1;
320 static int hf_gtpv2_mm_context_autn_len = -1;
321 static int hf_gtpv2_mm_context_autn = -1;
322 static int hf_gtpv2_mm_context_drx = -1;
323 static int hf_gtpv2_mm_context_ue_net_cap_len = -1;
324 static int hf_gtpv2_mm_context_ms_net_cap_len = -1;
325 static int hf_gtpv2_mm_context_mei_len = -1;
326 static int hf_gtpv2_mm_context_vdp_len = -1;
327 static int hf_gtpv2_mm_context_higher_br_16mb_flg_len = -1;
328 static int hf_gtpv2_mm_context_higher_br_16mb_flg = -1;
329 static int hf_gtpv2_vdp_length = -1;
331 static int hf_gtpv2_una = -1;
332 static int hf_gtpv2_gena = -1;
333 static int hf_gtpv2_gana = -1;
334 static int hf_gtpv2_ina = -1;
335 static int hf_gtpv2_ena = -1;
336 static int hf_gtpv2_hnna = -1;
337 static int hf_gtpv2_mm_context_ksi_a= -1;
338 static int hf_gtpv2_mm_context_ksi = -1;
339 static int hf_gtpv2_mm_context_nr_tri = -1;
340 static int hf_gtpv2_mm_context_used_cipher = -1;
341 static int hf_gtpv2_mm_context_nr_qui = -1;
342 static int hf_gtpv2_mm_context_nr_qua = -1;
343 static int hf_gtpv2_mm_context_uamb_ri = -1;
344 static int hf_gtpv2_mm_context_osci = -1;
345 static int hf_gtpv2_mm_context_samb_ri = -1;
346 static int hf_gtpv2_mm_context_unipa = -1;
347 static int hf_gtpv2_mm_context_unc = -1;
348 static int hf_gtpv2_mm_context_nas_dl_cnt = -1;
349 static int hf_gtpv2_mm_context_nas_ul_cnt = -1;
351 static int hf_gtpv2_uli_cgi_lac= -1;
352 static int hf_gtpv2_uli_cgi_ci= -1;
353 static int hf_gtpv2_uli_sai_lac= -1;
354 static int hf_gtpv2_uli_sai_sac= -1;
355 static int hf_gtpv2_uli_rai_lac= -1;
356 static int hf_gtpv2_uli_rai_rac= -1;
357 static int hf_gtpv2_uli_tai_tac= -1;
358 static int hf_gtpv2_uli_ecgi_eci= -1;
359 static int hf_gtpv2_uli_lai_lac = -1;
360 static int hf_gtpv2_uli_ecgi_eci_spare= -1;
361 static int hf_gtpv2_nsapi = -1;
362 static int hf_gtpv2_bearer_control_mode= -1;
364 static int hf_gtpv2_bss_container_phx = -1;
365 static int hf_gtpv2_bss_con_sapi_flg = -1;
366 static int hf_gtpv2_bss_con_rp_flg = -1;
367 static int hf_gtpv2_bss_con_pfi_flg = -1;
368 static int hf_gtpv2_bss_con_pfi = -1;
369 static int hf_gtpv2_bss_con_rp = -1;
370 static int hf_gtpv2_bss_con_sapi = -1;
371 static int hf_gtpv2_bss_con_xid_len = -1;
372 static int hf_gtpv2_bss_con_xid = -1;
373 static int hf_gtpv2_home_enodeb_id = -1;
374 static int hf_gtpv2_tac = -1;
377 static int hf_gtpv2_mbms_service_area_nr = -1;
378 static int hf_gtpv2_mbms_service_area_id = -1;
379 static int hf_gtpv2_mbms_session_id = -1;
380 static int hf_gtpv2_mbms_flow_id = -1;
381 static int hf_gtpv2_cteid = -1;
382 static int hf_gtpv2_ip_addr_type = -1;
383 static int hf_gtpv2_ip_addr_len = -1;
384 static int hf_gtpv2_mbms_ip_mc_dist_addrv4 = -1;
385 static int hf_gtpv2_mbms_ip_mc_dist_addrv6 = -1;
386 static int hf_gtpv2_mbms_ip_mc_src_addrv4 = -1;
387 static int hf_gtpv2_mbms_ip_mc_src_addrv6 = -1;
388 static int hf_gtpv2_mbms_hc_indicator = -1;
389 static int hf_gtpv2_mbms_dist_indication = -1;
390 static int hf_gtpv2_subscriber_rfsp = -1;
391 static int hf_gtpv2_rfsp_inuse = -1;
392 static int hf_gtpv2_mbms_service_id = -1;
393 static int hf_gtpv2_add_flags_for_srvcc_ics = -1;
394 static int hf_gtpv2_vsrvcc_flag = -1;
395 static int hf_gtpv2_abs_time_mbms_data = -1;
396 static int hf_gtpv2_henb_info_report_fti = -1;
397 static int hf_gtpv2_ip4cp_subnet_prefix_len = -1;
398 static int hf_gtpv2_ip4cp_ipv4 = -1;
399 static int hf_gtpv2_change_report_flags_sncr = -1;
400 static int hf_gtpv2_change_report_flags_tzcr = -1;
401 static int hf_gtpv2_action_indication_val = -1;
402 static int hf_gtpv2_mbms_session_duration_days = -1;
403 static int hf_gtpv2_mbms_session_duration_secs = -1;
404 static int hf_gtpv2_node_features_prn = -1;
405 static int hf_gtpv2_node_features_mabr =-1;
406 static int hf_gtpv2_node_features_ntsr = -1;
407 static int hf_gtpv2_time_to_data_xfer = -1;
408 static int hf_gtpv2_arp_pvi = -1;
409 static int hf_gtpv2_arp_pl = -1;
410 static int hf_gtpv2_arp_pci = -1;
411 static int hf_gtpv2_timer_unit = -1;
412 static int hf_gtpv2_timer_value = -1;
413 static int hf_gtpv2_lapi = -1;
415 static int hf_gtpv2_pres_rep_area_action = -1;
416 static int hf_gtpv2_pres_rep_area_id = -1;
418 static gint ett_gtpv2 = -1;
419 static gint ett_gtpv2_flags = -1;
420 static gint ett_gtpv2_ie = -1;
421 static gint ett_gtpv2_uli_flags = -1;
422 static gint ett_gtpv2_uli_field = -1;
423 static gint ett_gtpv2_bearer_ctx = -1;
424 static gint ett_gtpv2_PDN_conn = -1;
425 static gint ett_gtpv2_mm_context_flag = -1;
426 static gint ett_gtpv2_pdn_numbers_nsapi = -1;
427 static gint ett_gtpv2_tra_info_trigg = -1;
428 static gint ett_gtpv2_tra_info_trigg_msc_server = -1;
429 static gint ett_gtpv2_tra_info_trigg_mgw = -1;
430 static gint ett_gtpv2_tra_info_trigg_sgsn = -1;
431 static gint ett_gtpv2_tra_info_trigg_ggsn = -1;
432 static gint ett_gtpv2_tra_info_trigg_bm_sc = -1;
433 static gint ett_gtpv2_tra_info_trigg_sgw_mme = -1;
434 static gint ett_gtpv2_tra_info_trigg_sgw = -1;
435 static gint ett_gtpv2_tra_info_trigg_pgw = -1;
436 static gint ett_gtpv2_tra_info_interfaces = -1;
437 static gint ett_gtpv2_tra_info_interfaces_imsc_server = -1;
438 static gint ett_gtpv2_tra_info_interfaces_lmgw = -1;
439 static gint ett_gtpv2_tra_info_interfaces_lsgsn = -1;
440 static gint ett_gtpv2_tra_info_interfaces_lggsn = -1;
441 static gint ett_gtpv2_tra_info_interfaces_lrnc = -1;
442 static gint ett_gtpv2_tra_info_interfaces_lbm_sc = -1;
443 static gint ett_gtpv2_tra_info_interfaces_lmme = -1;
444 static gint ett_gtpv2_tra_info_interfaces_lsgw = -1;
445 static gint ett_gtpv2_tra_info_interfaces_lpdn_gw = -1;
446 static gint ett_gtpv2_tra_info_interfaces_lpdn_lenb = -1;
447 static gint ett_gtpv2_tra_info_ne_types = -1;
448 static gint ett_gtpv2_rai = -1;
449 static gint ett_gtpv2_ms_mark = -1;
450 static gint ett_gtpv2_stn_sr = -1;
451 static gint ett_gtpv2_supp_codec_list = -1;
452 static gint ett_gtpv2_bss_con = -1;
453 static gint ett_gtpv2_mm_context_auth_qua = -1;
454 static gint ett_gtpv2_mm_context_auth_qui = -1;
455 static gint ett_gtpv2_mm_context_auth_tri = -1;
456 static gint ett_gtpv2_mm_context_net_cap = -1;
457 static gint ett_gtpv2_ms_network_capability = -1;
458 static gint ett_gtpv2_vd_pref = -1;
459 static gint ett_gtpv2_access_rest_data = -1;
460 static gint ett_gtpv2_qua = -1;
461 static gint ett_gtpv2_qui = -1;
463 static expert_field ei_gtpv2_ie_data_not_dissected = EI_INIT;
464 static expert_field ei_gtpv2_ie_len_invalid = EI_INIT;
465 static expert_field ei_gtpv2_source_type_unknown = EI_INIT;
466 static expert_field ei_gtpv2_fq_csid_type_bad = EI_INIT;
468 /* Definition of User Location Info (AVP 22) masks */
469 #define GTPv2_ULI_CGI_MASK 0x01
470 #define GTPv2_ULI_SAI_MASK 0x02
471 #define GTPv2_ULI_RAI_MASK 0x04
472 #define GTPv2_ULI_TAI_MASK 0x08
473 #define GTPv2_ULI_ECGI_MASK 0x10
474 #define GTPv2_ULI_LAI_MASK 0x20
476 #define GTPV2_CREATE_SESSION_REQUEST 32
477 #define GTPV2_CREATE_SESSION_RESPONSE 33
478 #define GTPV2_CONTEXT_RESPONSE 131
479 #define GTPV2_FORWARD_RELOCATION_REQ 133
480 #define GTPV2_FORWARD_CTX_NOTIFICATION 137
481 #define GTPV2_RAN_INFORMATION_RELAY 152
483 static void dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, gint offset, guint8 message_type);
485 /*Message Types for GTPv2 (Refer Pg19 29.274) (SB)*/
486 static const value_string gtpv2_message_type_vals[] = {
488 { 1, "Echo Request"},
489 { 2, "Echo Response"},
490 { 3, "Version Not Supported Indication"},
491 /* 4-24 Reserved for S101 interface TS 29.276 */
492 { 4, "Node Alive Request"},
493 { 5, "Node Alive Response"},
494 { 6, "Redirection Request"},
495 { 7, "Redirection Response"},
496 /* 25-31 Reserved for Sv interface TS 29.280 */
497 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 5.2.1*/
498 { 25, "SRVCC PS to CS Request"},
499 { 26, "SRVCC PS to CS Response"},
500 { 27, "SRVCC PS to CS Complete Notification"},
501 { 28, "SRVCC PS to CS Complete Acknowledge"},
502 { 29, "SRVCC PS to CS Cancel Notification"},
503 { 30, "SRVCC PS to CS Cancel Acknowledge"},
504 { 31, "For Future Sv interface use"},
505 /*End SRVCC Messages*/
506 /* SGSN/MME to PGW (S4/S11, S5/S8) */
507 { 32, "Create Session Request"},
508 { 33, "Create Session Response"},
509 { 34, "Modify Bearer Request"},
510 { 35, "Modify Bearer Response"},
511 { 36, "Delete Session Request"},
512 { 37, "Delete Session Response"},
513 /* SGSN to PGW (S4, S5/S8) */
514 { 38, "Change Notification Request"},
515 { 39, "Change Notification Response"},
516 /* 40-63 For future use */
517 /* Messages without explicit response */
518 { 64, "Modify Bearer Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
519 { 65, "Modify Bearer Failure Indication"}, /*(PGW to MME/SGSN -S5/S8, S11/S4) */
520 { 66, "Delete Bearer Command"}, /* (MME to PGW -S11, S5/S8) */
521 { 67, "Delete Bearer Failure Indication"}, /* (PGW to MME -S5/S8, S11) */
522 { 68, "Bearer Resource Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
523 { 69, "Bearer Resource Failure Indication"}, /* (PGW to MME/SGSN -S5/S8, S11/S4) */
524 { 70, "Downlink Data Notification Failure Indication"}, /*(SGSN/MME to SGW -S4/S11) */
525 { 71, "Trace Session Activation"},
526 { 72, "Trace Session Deactivation"},
527 { 73, "Stop Paging Indication"},
528 /* 74-94 For future use */
529 /* PDN-GW to SGSN/MME (S5/S8, S4/S11) */
530 { 95, "Create Bearer Request"},
531 { 96, "Create Bearer Response"},
532 { 97, "Update Bearer Request"},
533 { 98, "Update Bearer Response"},
534 { 99, "Delete Bearer Request"},
535 {100, "Delete Bearer Response"},
536 /* PGW to MME, MME to PGW, SGW to PGW, SGW to MME (S5/S8, S11) */
537 {101, "Delete PDN Connection Set Request"},
538 {102, "Delete PDN Connection Set Response"},
539 /* 103-127 For future use */
540 /* MME to MME, SGSN to MME, MME to SGSN, SGSN to SGSN (S3/10/S16) */
541 {128, "Identification Request"},
542 {129, "Identification Response"},
543 {130, "Context Request"},
544 {131, "Context Response"},
545 {132, "Context Acknowledge"},
546 {133, "Forward Relocation Request"},
547 {134, "Forward Relocation Response"},
548 {135, "Forward Relocation Complete Notification"},
549 {136, "Forward Relocation Complete Acknowledge"},
550 {137, "Forward Access Context Notification"},
551 {138, "Forward Access Context Acknowledge"},
552 {139, "Relocation Cancel Request"},
553 {140, "Relocation Cancel Response"},
554 {141, "Configuration Transfer Tunnel"},
555 /* 142-148 For future use */
556 /* SGSN to MME, MME to SGSN (S3)*/
557 {149, "Detach Notification"},
558 {150, "Detach Acknowledge"},
559 {151, "CS Paging Indication"},
560 {152, "RAN Information Relay"},
561 {153, "Alert MME Notification"},
562 {154, "Alert MME Acknowledge"},
563 {155, "UE Activity Notification"},
564 {156, "UE Activity Acknowledge"},
565 /* 157 to 159 For future use */
566 /* MME to SGW (S11) */
567 {160, "Create Forwarding Tunnel Request"},
568 {161, "Create Forwarding Tunnel Response"},
569 {162, "Suspend Notification"},
570 {163, "Suspend Acknowledge"},
571 {164, "Resume Notification"},
572 {165, "Resume Acknowledge"},
573 {166, "Create Indirect Data Forwarding Tunnel Request"},
574 {167, "Create Indirect Data Forwarding Tunnel Response"},
575 {168, "Delete Indirect Data Forwarding Tunnel Request"},
576 {169, "Delete Indirect Data Forwarding Tunnel Response"},
577 {170, "Release Access Bearers Request"},
578 {171, "Release Access Bearers Response"},
579 /* 172-175 For future use */
580 /* SGW to SGSN/MME (S4/S11) */
581 {176, "Downlink Data Notification"},
582 {177, "Downlink Data Notification Acknowledgement"},
583 {178, "Reserved. Allocated in earlier version of the specification."},
584 {179, "PGW Restart Notification"},
585 {180, "PGW Restart Notification Acknowledge"},
586 /* 181-199 For future use */
587 /* SGW to PGW, PGW to SGW (S5/S8) */
588 {200, "Update PDN Connection Set Request"},
589 {201, "Update PDN Connection Set Response"},
590 /* 202 to 210 For future use */
591 /* MME to SGW (S11) */
592 {211, "Modify Access Bearers Request"},
593 {212, "Modify Access Bearers Response"},
594 /* 213 to 230 For future use */
595 /* MBMS GW to MME/SGSN (Sm/Sn) */
596 {231, "MBMS Session Start Request"},
597 {232, "MBMS Session Start Response"},
598 {233, "MBMS Session Update Request"},
599 {234, "MBMS Session Update Response"},
600 {235, "MBMS Session Stop Request"},
601 {236, "MBMS Session Stop Response"},
602 /* 237 to 239 For future use */
603 {240, "SRVCC CS to PS Response"}, /* 5.2.9 3GPP TS 29.280 V11.5.0 (2013-09) */
604 {241, "SRVCC CS to PS Complete Notification"}, /* 5.2.10 3GPP TS 29.280 V11.5.0 (2013-09) */
605 {242, "SRVCC CS to PS Complete Acknowledge"}, /* 5.2.11 3GPP TS 29.280 V11.5.0 (2013-09) */
606 {243, "SRVCC CS to PS Cancel Notification"}, /* 5.2.12 3GPP TS 29.280 V11.5.0 (2013-09) */
607 {244, "SRVCC CS to PS Cancel Acknowledge"}, /* 5.2.13 3GPP TS 29.280 V11.5.0 (2013-09) */
608 /* 245 to 247 For future Sv interface use*/
609 /* 248 to 255 For future use */
612 static value_string_ext gtpv2_message_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_message_type_vals);
614 #define GTPV2_IE_RESERVED 0
615 #define GTPV2_IE_IMSI 1
616 #define GTPV2_IE_CAUSE 2
617 #define GTPV2_REC_REST_CNT 3
618 /*Start SRVCC Messages*/
619 #define GTPV2_IE_STN_SR 51
620 #define GTPV2_IE_SRC_TGT_TRANS_CON 52
621 #define GTPV2_IE_TGT_SRC_TRANS_CON 53
622 #define GTPV2_IE_MM_CON_EUTRAN_SRVCC 54
623 #define GTPV2_IE_MM_CON_UTRAN_SRVCC 55
624 #define GTPV2_IE_SRVCC_CAUSE 56
625 #define GTPV2_IE_TGT_RNC_ID 57
626 #define GTPV2_IE_TGT_GLOGAL_CELL_ID 58
627 #define GTPV2_IE_TEID_C 59
628 #define GTPV2_IE_SV_FLAGS 60
629 #define GTPV2_IE_SAI 61
630 /* 61 - 70 for future sv interface use*/
631 /*End SRVCC Messages*/
633 #define GTPV2_AMBR 72
635 #define GTPV2_IP_ADDRESS 74
637 #define GTPV2_IE_MSISDN 76
638 #define GTPV2_INDICATION 77
641 #define GTPV2_BEARER_QOS 80
642 #define GTPV2_IE_FLOW_QOS 81
643 #define GTPV2_IE_RAT_TYPE 82
644 #define GTPV2_IE_SERV_NET 83
645 #define GTPV2_IE_BEARER_TFT 84
646 #define GTPV2_IE_TAD 85
647 #define GTPV2_IE_ULI 86
648 #define GTPV2_IE_F_TEID 87
649 #define GTPV2_IE_TMSI 88
650 #define GTPV2_IE_GLOBAL_CNID 89
651 #define GTPV2_IE_S103PDF 90
652 #define GTPV2_IE_S1UDF 91
653 #define GTPV2_IE_DEL_VAL 92
654 #define GTPV2_IE_BEARER_CTX 93
655 #define GTPV2_IE_CHAR_ID 94
656 #define GTPV2_IE_CHAR_CHAR 95
657 #define GTPV2_IE_TRA_INFO 96
658 #define GTPV2_BEARER_FLAG 97
659 /* define GTPV2_IE_PAGING_CAUSE 98 (void) */
660 #define GTPV2_IE_PDN_TYPE 99
661 #define GTPV2_IE_PTI 100
662 #define GTPV2_IE_DRX_PARAM 101
663 #define GTPV2_IE_UE_NET_CAPABILITY 102
664 #define GTPV2_IE_MM_CONTEXT_GSM_T 103
665 #define GTPV2_IE_MM_CONTEXT_UTMS_CQ 104
666 #define GTPV2_IE_MM_CONTEXT_GSM_CQ 105
667 #define GTPV2_IE_MM_CONTEXT_UTMS_Q 106
668 #define GTPV2_IE_MM_CONTEXT_EPS_QQ 107
669 #define GTPV2_IE_MM_CONTEXT_UTMS_QQ 108
670 #define GTPV2_IE_PDN_CONNECTION 109
671 #define GTPV2_IE_PDN_NUMBERS 110
672 #define GTPV2_IE_P_TMSI 111
673 #define GTPV2_IE_P_TMSI_SIG 112
674 #define GTPV2_IE_HOP_COUNTER 113
675 #define GTPV2_IE_UE_TIME_ZONE 114
676 #define GTPV2_IE_TRACE_REFERENCE 115
677 #define GTPV2_IE_COMPLETE_REQUEST_MSG 116
678 #define GTPV2_IE_GUTI 117
679 #define GTPV2_IE_F_CONTAINER 118
680 #define GTPV2_IE_F_CAUSE 119
681 #define GTPV2_IE_SEL_PLMN_ID 120
682 #define GTPV2_IE_TARGET_ID 121
683 /* GTPV2_IE_NSAPI 122 */
684 #define GTPV2_IE_PKT_FLOW_ID 123
685 #define GTPV2_IE_RAB_CONTEXT 124
686 #define GTPV2_IE_S_RNC_PDCP_CTX_INFO 125
687 #define GTPV2_IE_UDP_S_PORT_NR 126
688 #define GTPV2_IE_APN_RESTRICTION 127
689 #define GTPV2_IE_SEL_MODE 128
690 #define GTPV2_IE_SOURCE_IDENT 129
691 #define GTPV2_IE_BEARER_CONTROL_MODE 130
692 #define GTPV2_IE_CNG_REP_ACT 131
693 #define GTPV2_IE_FQ_CSID 132
694 #define GTPV2_IE_CHANNEL_NEEDED 133
695 #define GTPV2_IE_EMLPP_PRI 134
696 #define GTPV2_IE_NODE_TYPE 135
697 #define GTPV2_IE_FQDN 136
698 #define GTPV2_IE_TI 137
699 #define GTPV2_IE_MBMS_SESSION_DURATION 138
700 #define GTPV2_IE_MBMS_SERVICE_AREA 139
701 #define GTPV2_IE_MBMS_SESSION_ID 140
702 #define GTPV2_IE_MBMS_FLOW_ID 141
703 #define GTPV2_IE_MBMS_IP_MC_DIST 142
704 #define GTPV2_IE_MBMS_DIST_ACK 143
705 #define GTPV2_IE_RFSP_INDEX 144
706 #define GTPV2_IE_UCI 145
707 #define GTPV2_IE_CSG_INFO_REP_ACTION 146
708 #define GTPV2_IE_CSG_ID 147
709 #define GTPV2_IE_CMI 148
710 #define GTPV2_IE_SERVICE_INDICATOR 149
711 #define GTPV2_IE_DETACH_TYPE 150
712 #define GTPV2_IE_LDN 151
713 #define GTPV2_IE_NODE_FEATURES 152
714 #define GTPV2_IE_MBMS_TIME_TO_DATA_XFER 153
715 #define GTPV2_IE_THROTTLING 154
716 #define GTPV2_IE_ARP 155
717 #define GTPV2_IE_EPC_TIMER 156
718 #define GTPV2_IE_SIG_PRIO_IND 157
719 #define GTPV2_IE_TMGI 158
720 #define GTPV2_IE_ADD_MM_CONT_FOR_SRVCC 159
721 #define GTPV2_IE_ADD_FLAGS_FOR_SRVCC 160
722 #define GTPV2_IE_MMBR 161
723 #define GTPV2_IE_MDT_CONFIG 162
724 #define GTPV2_IE_APCO 163
725 #define GTPV2_IE_ABS_MBMS_DATA_TF_TIME 164
726 #define GTPV2_IE_HENB_INFO_REPORT 165
727 #define GTPV2_IE_IP4CP 166
728 #define GTPV2_IE_CHANGE_TO_REPORT_FLAGS 167
729 #define GTPV2_IE_ACTION_INDICATION 168
730 #define GTPV2_IE_TWAN_IDENTIFIER 169
731 #define GTPV2_IE_ULI_TIMESTAMP 170
732 #define GTPV2_IE_MBMS_FLAGS 171
733 #define GTPV2_IE_RAN_NAS_CAUSE 172
734 #define GTPV2_IE_CN_OP_SEL_ENT 173
735 #define GTPV2_IE_TRUST_WLAN_MODE_IND 174
736 #define GTPV2_IE_NODE_NUMBER 175
737 #define GTPV2_IE_NODE_IDENTIFIER 176
738 #define GTPV2_IE_PRES_REP_AREA_ACT 177
739 #define GTPV2_IE_PRES_REP_AREA_INF 178
740 #define GTPV2_IE_TWAN_ID_TS 179
741 #define GTPV2_IE_OVERLOAD_CONTROL_INF 180
742 #define GTPV2_IE_LOAD_CONTROL_INF 181
743 #define GTPV2_IE_METRIC 182
744 #define GTPV2_IE_SEQ_NO 183
745 #define GTPV2_IE_APN_AND_REL_CAP 184
747 /* 169 to 254 reserved for future use */
748 #define GTPV2_IE_PRIVATE_EXT 255
751 #define CREATE_NEW_TFT 0X20
752 #define DELETE_TFT 0X40
753 #define ADD_PACKET_FILTERS_TFT 0X60
754 #define REPLACE_PACKET_FILTERS_TFT 0X80
755 #define DELETE_PACKET_FILTERS_TFT 0XA0
756 #define NO_TFT_OPERATION 0XC0
757 #define RESERVED 0XE0
760 /* Table 8.1-1: Information Element types for GTPv2 */
761 static const value_string gtpv2_element_type_vals[] = {
763 { 1, "International Mobile Subscriber Identity (IMSI)"}, /* Variable Length / 8.3 */
764 { 2, "Cause"}, /* Variable Length / 8.4 */
765 { 3, "Recovery (Restart Counter)"}, /* Variable Length / 8.5 */
766 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
767 /* 51-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
768 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 6.1*/
769 { 51, "STN-SR"}, /* Variable Length / 6.2 */
770 { 52, "Source to Target Transparent Container"}, /* Variable Length / 6.3 */
771 { 53, "Target to Source Transparent Container"}, /* Variable Length / 6.4 */
772 { 54, "MM Context for E-UTRAN SRVCC"}, /* Variable Length / 6.5 */
773 { 55, "MM Context for UTRAN SRVCC"}, /* Variable Length / 6.6 */
774 { 56, "SRVCC Cause"}, /* Fixed Length / 6.7 */
775 { 57, "Target RNC ID"}, /* Variable Length / 6.8 */
776 { 58, "Target Global Cell ID"}, /* Variable Length / 6.9 */
777 { 59, "TEID-C"}, /* Extendable / 6.10 */
778 { 60, "Sv Flags"}, /* Extendable / 6.11 */
779 { 61, "Service Area Identifier"}, /* Extendable / 6.12 */
780 /* 62-70 For future Sv interface use */
781 /*End SRVCC Messages*/
782 { 71, "Access Point Name (APN)"}, /* Variable Length / 8.6 */
783 { 72, "Aggregate Maximum Bit Rate (AMBR)"}, /* Fixed Length / 8.7 */
784 { 73, "EPS Bearer ID (EBI)"}, /* Extendable / 8.8 */
785 { 74, "IP Address"}, /* Extendable / 8.9 */
786 { 75, "Mobile Equipment Identity (MEI)"}, /* Variable Length / 8.10 */
787 { 76, "MSISDN"}, /* Variable Length / 8.11 */
788 { 77, "Indication"}, /* Extendable / 8.12 */
789 { 78, "Protocol Configuration Options (PCO)"}, /* Variable Length / 8.13 */
790 { 79, "PDN Address Allocation (PAA)"}, /* Variable Length / 8.14 */
791 { 80, "Bearer Level Quality of Service (Bearer QoS)"}, /* Variable Length / 8.15 */
792 { 81, "Flow Quality of Service (Flow QoS)"}, /* Extendable / 8.16 */
793 { 82, "RAT Type"}, /* Extendable / 8.17 */
794 { 83, "Serving Network"}, /* Extendable / 8.18 */
795 { 84, "EPS Bearer Level Traffic Flow Template (Bearer TFT)"}, /* Variable Length / 8.19 */
796 { 85, "Traffic Aggregation Description (TAD)"}, /* Variable Length / 8.20 */
797 { 86, "User Location Info (ULI)"}, /* Variable Length / 8.21 */
798 { 87, "Fully Qualified Tunnel Endpoint Identifier (F-TEID)"}, /* Extendable / 8.22 */
799 { 88, "TMSI"}, /* Variable Length / 8.23 */
800 { 89, "Global CN-Id"}, /* Variable Length / 8.24 */
801 { 90, "S103 PDN Data Forwarding Info (S103PDF)"}, /* Variable Length / 8.25 */
802 { 91, "S1-U Data Forwarding Info (S1UDF)"}, /* Variable Length/ 8.26 */
803 { 92, "Delay Value"}, /* Extendable / 8.27 */
804 { 93, "Bearer Context"}, /* Extendable / 8.28 */
805 { 94, "Charging ID"}, /* Extendable / 8.29 */
806 { 95, "Charging Characteristics"}, /* Extendable / 8.30 */
807 { 96, "Trace Information"}, /* Extendable / 8.31 */
808 { 97, "Bearer Flags"}, /* Extendable / 8.32 */
809 { 98, "Paging Cause"}, /* Variable Length / 8.33 */
810 { 99, "PDN Type"}, /* Extendable / 8.34 */
811 {100, "Procedure Transaction ID"}, /* Extendable / 8.35 */
812 {101, "DRX Parameter"}, /* Variable Length/ 8.36 */
813 {102, "UE Network Capability"}, /* Variable Length / 8.37 */
814 {103, "MM Context (GSM Key and Triplets)"}, /* Variable Length / 8.38 */
815 {104, "MM Context (UMTS Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
816 {105, "MM Context (GSM Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
817 {106, "MM Context (UMTS Key and Quintuplets)"}, /* Variable Length / 8.38 */
818 {107, "MM Context (EPS Security Context, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
819 {108, "MM Context (UMTS Key, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
820 {109, "PDN Connection"}, /* Extendable / 8.39 */
821 {110, "PDU Numbers"}, /* Extendable / 8.40 */
822 {111, "P-TMSI"}, /* Variable Length / 8.41 */
823 {112, "P-TMSI Signature"}, /* Variable Length / 8.42 */
824 {113, "Hop Counter"}, /* Extendable / 8.43 */
825 {114, "UE Time Zone"}, /* Variable Length / 8.44 */
826 {115, "Trace Reference"}, /* Fixed Length / 8.45 */
827 {116, "Complete Request Message"}, /* Variable Length / 8.46 */
828 {117, "GUTI"}, /* Variable Length / 8.47 */
829 {118, "F-Container"}, /* Variable Length / 8.48 */
830 {119, "F-Cause"}, /* Variable Length / 8.49 */
831 {120, "Selected PLMN ID"}, /* Variable Length / 8.50 */
832 {121, "Target Identification"}, /* Variable Length / 8.51 */
833 {122, "NSAPI"}, /* Extendable / 8.52 */
834 {123, "Packet Flow ID"}, /* Variable Length / 8.53 */
835 {124, "RAB Context"}, /* Fixed Length / 8.54 */
836 {125, "Source RNC PDCP Context Info"}, /* Variable Length / 8.55 */
837 {126, "UDP Source Port Number"}, /* Extendable / 8.56 */
838 {127, "APN Restriction"}, /* Extendable / 8.57 */
839 {128, "Selection Mode"}, /* Extendable / 8.58 */
840 {129, "Source Identification"}, /* Variable Length / 8.50 */
841 {130, "Bearer Control Mode"}, /* Extendable / 8.60 */
842 {131, "Change Reporting Action"}, /* Variable Length / 8.61 */
843 {132, "Fully Qualified PDN Connection Set Identifier (FQ-CSID)"}, /* Variable Length / 8.62 */
844 {133, "Channel needed"}, /* Extendable / 8.63 */
845 {134, "eMLPP Priority"}, /* Extendable / 8.64 */
846 {135, "Node Type"}, /* Extendable / 8.65 */
847 {136, "Fully Qualified Domain Name (FQDN)"}, /* Variable Length / 8.66 */
848 {137, "Transaction Identifier (TI)"}, /* Variable Length / 8.68 */
849 {138, "MBMS Session Duration"}, /* Duration Extendable / 8.69 */
850 {139, "MBMS Service Area"}, /* Extendable / 8.70 */
851 {140, "MBMS Session Identifier"}, /* Extendable / 8.71 */
852 {141, "MBMS Flow Identifier"}, /* Extendable / 8.72 */
853 {142, "MBMS IP Multicast Distribution"}, /* Extendable / 8.73 */
854 {143, "MBMS Distribution Acknowledge"}, /* Extendable / 8.74 */
855 {144, "RFSP Index"}, /* Fixed Length / 8.77 */
856 {145, "User CSG Information (UCI)"}, /* Extendable / 8.75 */
857 {146, "CSG Information Reporting Action"}, /* Extendable / 8.76 */
858 {147, "CSG ID"}, /* Extendable / 8.78 */
859 {148, "CSG Membership Indication (CMI)"}, /* Extendable / 8.79 */
860 {149, "Service indicator"}, /* Fixed Length / 8.80 */
861 {150, "Detach Type"}, /* Fixed Length / 8.81 */
862 {151, "Local Distiguished Name (LDN)"}, /* Variable Length / 8.82 */
863 {152, "Node Features"}, /* Extendable / 8.83 */
864 {153, "MBMS Time to Data Transfer"}, /* Extendable / 8.84 */
865 {154, "Throttling"}, /* Extendable / 8.85 */
866 {155, "Allocation/Retention Priority (ARP)"}, /* Extendable / 8.86 */
867 {156, "EPC Timer"}, /* Extendable / 8.87 */
868 {157, "Signalling Priority Indication"}, /* Extendable / 8.88 */
869 {158, "Temporary Mobile Group Identity"}, /* Extendable / 8.89 */
870 {159, "Additional MM context for SRVCC"}, /* Extendable / 8.90 */
871 {160, "Additional flags for SRVCC"}, /* Extendable / 8.91 */
872 {161, "Max MBR/APN-AMBR (MMBR)"}, /* Extendable / 8.92 */
873 {162, "MDT Configuration"}, /* Extendable / 8.93 */
874 {163, "Additional Protocol Configuration Options (APCO)"}, /* Extendable / 8.94 */
875 {164, "Absolute Time of MBMS Data Transfer"}, /* Extendable / 8.95 */
876 {165, "H(e)NB Information Reporting"}, /* Extendable / 8.96*/
877 {166, "IPv4 Configuration Parameters (IP4CP)"}, /* Extendable / 8.97*/
878 {167, "Change to Report Flags"}, /* Extendable / 8.98 */
879 {168, "Action Indication"}, /* Extendable / 8.99 */
880 {169, "TWAN Identifier "}, /* Extendable / 8.100 */
881 {170, "ULI Timestamp"}, /* Extendable / 8.101 */
882 {171, "MBMS Flags"}, /* Extendable / 8.102 */
883 {172, "RAN/NAS Cause"}, /* Extendable / 8.103 */
884 {173, "CN Operator Selection Entity"}, /* Extendable / 8.104 */
885 {174, "Trusted WLAN Mode Indication"}, /* Extendable / 8.105 */
886 {175, "Node Number"}, /* Extendable / 8.106 */
887 {176, "Node Identifier"}, /* Extendable / 8.107 */
888 {177, "Presence Reporting Area Action"}, /* Extendable / 8.108 */
889 {178, "Presence Reporting Area Information"}, /* Extendable / 8.109 */
890 {179, "TWAN Identifier Timestamp"}, /* Extendable / 8.110 */
891 {180, "Overload Control Information"}, /* Extendable / 8.111 */
892 {181, "Load Control Information"}, /* Extendable / 8.112 */
893 {182, "Metric"}, /* Fixed Length / 8.113 */
894 {183, "Sequence Number"}, /* Fixed Length / 8.114 */
895 {184, "APN and Relative Capacity"}, /* Extendable / 8.115 */
897 /* 185 to 254 Spare. For future use. */
899 {255, "Private Extension"}, /* Variable Length / 8.67 */
902 static value_string_ext gtpv2_element_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_element_type_vals);
904 /* Code to dissect IE's */
907 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_)
909 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
913 * 8.3 International Mobile Subscriber Identity (IMSI)
915 * IMSI is defined in 3GPP TS 23.003
916 * Editor's note: IMSI coding will be defined in 3GPP TS 24.301
917 * Editor's note: In the first release of GTPv2 spec (TS 29.274v8.0.0) n = 8.
918 * That is, the overall length of the IE is 11 octets.
922 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_)
925 const gchar *imsi_str;
927 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
928 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the wmem
929 * allocated string will be returned.
931 imsi_str = dissect_e212_imsi(tvb, pinfo, tree, offset, length, FALSE);
932 proto_item_append_text(item, "%s", imsi_str);
940 /* Table 8.4-1: Cause values */
941 static const value_string gtpv2_cause_vals[] = {
943 /* Request / Initial message */
945 { 2, "Local Detach"},
946 { 3, "Complete Detach"},
947 { 4, "RAT changed from 3GPP to Non-3GPP"},
948 { 5, "ISR deactivation"},
949 { 6, "Error Indication received from RNC/eNodeB/S4-SGSN"},
950 { 7, "IMSI Detach Only"},
951 { 8, "Reactivation Requested"},
952 { 9, "PDN reconnection to this APN disallowed"},
953 { 10, "Access changed from Non-3GPP to 3GPP"},
954 { 11, "PDN connection inactivity timer expires"},
955 { 12, "PGW not responding"},
956 { 13, "Network Failure"},
957 { 14, "QoS parameter mismatch"},
958 /* 15 Spare. This value range is reserved for Cause values in a request message */
960 /* Acceptance in a Response / triggered message */
961 { 16, "Request accepted"},
962 { 17, "Request accepted partially"},
963 { 18, "New PDN type due to network preference"},
964 { 19, "New PDN type due to single address bearer only"},
965 /* 20-63 Spare. This value range shall be used by Cause values in an acceptance response/triggered message */
1010 /* Rejection in a Response / triggered message */
1011 { 64, "Context Not Found"},
1012 { 65, "Invalid Message Format"},
1013 { 66, "Version not supported by next peer"},
1014 { 67, "Invalid length"},
1015 { 68, "Service not supported"},
1016 { 69, "Mandatory IE incorrect"},
1017 { 70, "Mandatory IE missing"},
1018 { 71, "Shall not be used"},
1019 { 72, "System failure"},
1020 { 73, "No resources available"},
1021 { 74, "Semantic error in the TFT operation"},
1022 { 75, "Syntactic error in the TFT operation"},
1023 { 76, "Semantic errors in packet filter(s)"},
1024 { 77, "Syntactic errors in packet filter(s)"},
1025 { 78, "Missing or unknown APN"},
1026 { 79, "Shall not be used"},
1027 { 80, "GRE key not found"},
1028 { 81, "Relocation failure"},
1029 { 82, "Denied in RAT"},
1030 { 83, "Preferred PDN type not supported"},
1031 { 84, "All dynamic addresses are occupied"},
1032 { 85, "UE context without TFT already activated"},
1033 { 86, "Protocol type not supported"},
1034 { 87, "UE not responding"},
1035 { 88, "UE refuses"},
1036 { 89, "Service denied"},
1037 { 90, "Unable to page UE"},
1038 { 91, "No memory available"},
1039 { 92, "User authentication failed"},
1040 { 93, "APN access denied - no subscription"},
1041 { 94, "Request rejected(reason not specified)"},
1042 { 95, "P-TMSI Signature mismatch"},
1043 { 96, "IMSI/IMEI not known"},
1044 { 97, "Semantic error in the TAD operation"},
1045 { 98, "Syntactic error in the TAD operation"},
1046 { 99, "Shall not be used"},
1047 {100, "Remote peer not responding"},
1048 {101, "Collision with network initiated request"},
1049 {102, "Unable to page UE due to Suspension"},
1050 {103, "Conditional IE missing"},
1051 {104, "APN Restriction type Incompatible with currently active PDN connection"},
1052 {105, "Invalid overall length of the triggered response message and a piggybacked initial message"},
1053 {106, "Data forwarding not supported"},
1054 {107, "Invalid reply from remote peer"},
1055 {108, "Fallback to GTPv1"},
1056 {109, "Invalid peer"},
1057 {110, "Temporarily rejected due to handover procedure in progress"},
1058 {111, "Modifications not limited to S1-U bearers"},
1059 {112, "Request rejected for a PMIPv6 reason "},
1060 {113, "APN Congestion"},
1061 {114, "Bearer handling not supported"},
1062 {115, "UE already re-attached"},
1063 {116, "Multiple PDN connections for a given APN not allowed"},
1064 /* 117-239 Spare. For future use in a triggered/response message */
1065 /* 240-255 Spare. For future use in an initial/request message */
1068 value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals);
1070 /* Table 8.4-1: CS (Cause Source) */
1071 static const true_false_string gtpv2_cause_cs = {
1072 "Originated by remote node",
1073 "Originated by node sending the message",
1077 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_)
1082 /* Cause value octet 5 */
1083 tmp = tvb_get_guint8(tvb, offset);
1084 proto_tree_add_item(tree, hf_gtpv2_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1086 /* Add Cause to ie_tree */
1087 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(tmp, >pv2_cause_vals_ext, "Unknown"), tmp);
1090 /* Octet 6 Spare PCE BCE CS */
1091 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
1092 proto_tree_add_item(tree, hf_gtpv2_cause_pce, tvb, offset, 1, ENC_BIG_ENDIAN);
1093 proto_tree_add_item(tree, hf_gtpv2_cause_bce, tvb, offset, 1, ENC_BIG_ENDIAN);
1094 proto_tree_add_item(tree, hf_gtpv2_cause_cs, tvb, offset, 1, ENC_BIG_ENDIAN);
1097 /* If n = 2, a = 0 and the Cause IE shall be 6 octets long.
1098 * Therefore, octets "a(n+1) to a(n+4)" will not be present.
1099 * If n = 6, a = 1 and the Cause IE will be 10 octets long.
1101 if ( length == 2 ) {
1105 * If the rejection is due to a mandatory IE or a verifiable conditional IE is faulty
1106 * or missing, the offending IE shall be included within an additional field "a(n+1)
1107 * to a(n+4)". Only Type and Instance fields of the offending IE that caused the
1108 * rejection have a meaning. The length in the Octet 8-9 and spare bits in the Octet 10
1109 * shall be set to "0". In this case, the value of "n" shall be "6".
1110 * Otherwise, the value of "n" is equal to "2".
1113 /* Type of the offending IE */
1114 proto_tree_add_item(tree, hf_gtpv2_cause_off_ie_t, tvb, offset, 1, ENC_BIG_ENDIAN);
1118 proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1120 /* a(n+4) Spare Instance */
1121 proto_tree_add_bits_item(tree, hf_gtpv2_spare_half_octet, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
1122 proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
1127 * 8.5 Recovery (Restart Counter)
1130 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_)
1135 recovery = tvb_get_guint8(tvb, offset);
1136 proto_tree_add_item(tree, hf_gtpv2_rec, tvb, offset, 1, ENC_BIG_ENDIAN);
1137 proto_item_append_text(item, "%u", recovery);
1142 /*Start SRVCC Messages*/
1146 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_)
1148 proto_item *stn_sr_item;
1149 proto_tree *sub_tree;
1153 stn_sr_item = proto_tree_add_item(tree, hf_gtpv2_stn_sr, tvb, offset, length, ENC_NA);
1154 new_tvb = tvb_new_subset_length(tvb, offset, length);
1155 sub_tree = proto_item_add_subtree(stn_sr_item, ett_gtpv2_stn_sr);
1158 * contains the Nature of Address and Numbering Plan Indicator (NANPI) of the "AddressString" ASN.1 type (see 3GPP
1159 * 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
1160 * 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
1163 dissect_gsm_map_msisdn(new_tvb, pinfo, sub_tree);
1166 /* 6.3 Source to Target Transparent Container */
1169 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_)
1172 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1174 /*ra_type_flag = 0;*/
1176 /* Transparent Container
1177 * When target network is GERAN, this container carries the Old BSS to New BSS
1178 * Information IE defined in 3GPP TS 48.008 [8]. When target network is UTRAN, this container carries the Source RNC
1179 * to Target RNC Transparent Container IE defined in 3GPP TS 25.413 [9]. The Transparent container field includes the
1180 * IE value part as it is specified in the respective specification.
1182 proto_tree_add_text(tree, tvb, offset, length-1, "Transparent Container: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1184 * bssmap_old_bss_to_new_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo);
1185 * dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
1190 /* 6.4 Target to Source Transparent Container */
1192 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_)
1195 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1198 /* Transparent Container */
1199 proto_tree_add_text(tree, tvb, offset, length-1, "Transparent Container: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1204 /* 6.5 MM Context for E-UTRAN SRVCC */
1206 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_)
1210 proto_tree *ms_tree, *fi;
1212 proto_tree_add_item(tree, hf_gtpv2_eksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1214 proto_tree_add_text(tree, tvb, offset , 16, "CKsrvcc: %s ", tvb_bytes_to_ep_str(tvb, offset, 16));
1216 proto_tree_add_text(tree, tvb, offset, 16, "IKsrvcc: %s ", tvb_bytes_to_ep_str(tvb, offset, 16));
1219 /* Length of Mobile Station Classmark2 */
1220 elm_len = tvb_get_guint8(tvb, offset);
1221 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1223 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark2: %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1224 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1225 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1228 /* Length of Mobile Station Classmark3 */
1229 elm_len = tvb_get_guint8(tvb, offset);
1230 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1232 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark3: %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1233 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1234 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1237 /*Length of Supported Codec List */
1238 elm_len = tvb_get_guint8(tvb, offset);
1239 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1241 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Supported Codec List: %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1242 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1243 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1247 /* 6.6 MM Context for UTRAN SRVCC */
1249 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_)
1253 proto_tree *ms_tree, *fi;
1255 proto_tree_add_item(tree, hf_gtpv2_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1258 proto_tree_add_text(tree, tvb, offset, 16, "CK'cs: %s", tvb_bytes_to_ep_str(tvb, offset, 16));
1260 proto_tree_add_text(tree, tvb, offset, 16, "IK'cs: %s", tvb_bytes_to_ep_str(tvb, offset, 16));
1262 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
1264 proto_tree_add_item(tree, hf_gtpv2_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
1267 /*Length of Mobile Station Classmark2 */
1268 elm_len = tvb_get_guint8(tvb, offset);
1269 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1271 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark2: %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1272 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1273 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1276 /*Length of Mobile Station Classmark3 */
1277 elm_len = tvb_get_guint8(tvb, offset);
1278 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1280 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark3: %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1281 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1282 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1285 /*Length of Supported Codec List */
1286 elm_len = tvb_get_guint8(tvb, offset);
1287 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1289 fi = proto_tree_add_text(tree, tvb, offset, elm_len, "Supported Codec List: %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
1290 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1291 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1295 /* 6.7 SRVCC Cause */
1296 static const value_string gtpv2_srvcc_cause_vals[] = {
1299 {2, "Handover/Relocation cancelled by source system "},
1300 {3, "Handover /Relocation Failure with Target system"},
1301 {4, "Handover/Relocation Target not allowed"},
1302 {5, "Unknown Target ID"},
1303 {6, "Target Cell not available"},
1304 {7, "No Radio Resources Available in Target Cell"},
1305 {8, "Failure in Radio Interface Procedure"},
1306 {9, "Permanent session leg establishment error"},
1307 {10, "Temporary session leg establishment error"},
1311 static value_string_ext gtpv2_srvcc_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_srvcc_cause_vals);
1314 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_)
1319 srvcc_cause = tvb_get_guint8(tvb, offset);
1320 proto_tree_add_item(tree, hf_gtpv2_srvcc_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1321 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(srvcc_cause, >pv2_srvcc_cause_vals_ext, "Unknown"), srvcc_cause);
1326 * 3GPP TS 29.280 version 10.3.0
1330 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_)
1334 proto_tree *subtree;
1338 guint32 curr_offset;
1340 /*ra_type_flag = 1;*/ /*Flag to be set to differentiate GERAN and UTRAN*/
1341 curr_offset = offset;
1343 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1344 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1345 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1346 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1347 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1348 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1349 if ((mnc & 0x000f) == 0x000f)
1352 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1353 rnc_id = tvb_get_ntohs(tvb, curr_offset + 5);
1355 subtree = proto_tree_add_subtree_format(tree,
1356 tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
1357 "Routing area identification: %x-%x-%u-%u",
1358 mcc, mnc, lac, rnc_id);
1360 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, TRUE);
1363 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1365 proto_tree_add_item(subtree, hf_gtpv2_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1368 /* no length check possible */
1375 * 6.9 Target Global Cell ID
1376 * The encoding of this IE is defined in 3GPP TS 29.002
1377 * GlobalCellId ::= OCTET STRING (SIZE (5..7))
1378 * -- Refers to Cell Global Identification defined in TS 3GPP TS 23.003 [17].
1379 * -- The internal structure is defined as follows:
1380 * -- octet 1 bits 4321 Mobile Country Code 1st digit
1381 * -- bits 8765 Mobile Country Code 2nd digit
1382 * -- octet 2 bits 4321 Mobile Country Code 3rd digit
1383 * -- bits 8765 Mobile Network Code 3rd digit
1384 * -- or filler (1111) for 2 digit MNCs
1385 * -- octet 3 bits 4321 Mobile Network Code 1st digit
1386 * -- bits 8765 Mobile Network Code 2nd digit
1387 * -- octets 4 and 5 Location Area Code according to TS 3GPP TS 24.008 [35]
1388 * -- octets 6 and 7 Cell Identity (CI) according to TS 3GPP TS 24.008 [35]
1391 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_)
1395 proto_tree *subtree;
1399 guint32 curr_offset;
1401 curr_offset = offset;
1403 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1404 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1405 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1406 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1407 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1408 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1409 if ((mnc & 0x000f) == 0x000f)
1412 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1413 tgt_cell_id = tvb_get_guint8(tvb, curr_offset + 5);
1415 subtree = proto_tree_add_subtree_format(tree,
1416 tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
1417 "Routing area identification: %x-%x-%u-%u",
1418 mcc, mnc, lac, tgt_cell_id);
1420 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, TRUE);
1422 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset + 3, 2, ENC_BIG_ENDIAN);
1423 proto_tree_add_item(subtree, hf_gtpv2_tgt_g_cell_id, tvb, curr_offset + 5, 2, ENC_BIG_ENDIAN);
1425 proto_item_append_text(item, "%x-%x-%u-%u", mcc, mnc, lac, tgt_cell_id);
1426 /* no length check possible */
1430 /* 6.10 Tunnel Endpoint Identifier for Control Plane (TEID-C) */
1432 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_)
1436 proto_tree_add_item(tree, hf_gtpv2_teid_c, tvb, offset, 4, ENC_BIG_ENDIAN);
1439 proto_tree_add_text(tree, tvb, offset, length-4, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-4));
1441 proto_item_append_text(item, "%u", tvb_get_ntohl(tvb, offset-4));
1446 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_)
1449 proto_tree_add_item(tree, hf_gtpv2_sv_sti, tvb, offset, 1, ENC_BIG_ENDIAN);
1450 proto_tree_add_item(tree, hf_gtpv2_sv_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
1451 proto_tree_add_item(tree, hf_gtpv2_sv_emind, tvb, offset, 1, ENC_BIG_ENDIAN);
1454 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
1457 /* 6.12 Service Area Identifier */
1460 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_)
1464 /* 5 MCC digit 2 MCC digit 1
1465 * 6 MNC digit 3 MCC digit 3
1466 * 7 MNC digit 2 MNC digit 1
1468 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
1471 /* 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
1472 * least significant bit. The coding of the location area code is the responsibility of each administration. Coding using full
1473 * hexadecimal representation shall be used.
1475 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1478 /* 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
1479 * least significant bit. The SAC is defined by the operator. See 3GPP TS 23.003 [4] subclause 12.5 for more information
1481 proto_tree_add_item(tree, hf_gtpv2_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
1484 /*End SRVCC Messages*/
1488 * 8.6 Access Point Name (APN)
1489 * The encoding the APN field follows 3GPP TS 23.003 [2] subclause 9.1.
1490 * The content of the APN field shall be the full APN with both the APN Network Identifier
1491 * and APN Operator Identifier being present as specified in 3GPP TS 23.003 [2]
1492 * 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.
1495 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_)
1502 name_len = tvb_get_guint8(tvb, offset);
1504 if (name_len < 0x20) {
1505 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
1507 if (name_len >= length - 1)
1510 name_len = name_len + apn[tmp] + 1;
1514 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
1516 proto_tree_add_string(tree, hf_gtpv2_apn, tvb, offset, length, apn);
1520 proto_item_append_text(item, "%s", apn);
1525 * 8.7 Aggregate Maximum Bit Rate (AMBR)
1529 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_)
1533 proto_tree_add_item(tree, hf_gtpv2_ambr_up, tvb, offset, 4, ENC_BIG_ENDIAN);
1535 proto_tree_add_item(tree, hf_gtpv2_ambr_down, tvb, offset, 4, ENC_BIG_ENDIAN);
1539 * 8.8 EPS Bearer ID (EBI)
1542 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_)
1548 /* Spare (all bits set to 0) B8 - B5*/
1549 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
1550 /* EPS Bearer ID (EBI) B4 - B1 */
1551 ebi = tvb_get_guint8(tvb, offset);
1552 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
1553 proto_item_append_text(item, "%u", ebi);
1560 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_)
1563 struct e_in6_addr ipv6_address;
1567 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv4, tvb, offset, length, ENC_BIG_ENDIAN);
1568 proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(tvb, offset));
1570 else if (length == 16)
1572 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv6, tvb, offset, length, ENC_NA);
1573 tvb_get_ipv6(tvb, offset, &ipv6_address);
1574 proto_item_append_text(item, "IPv6 %s", ip6_to_str(&ipv6_address));
1578 * 8.10 Mobile Equipment Identity (MEI)
1579 * The ME Identity field contains either the IMEI or the IMEISV
1580 * as defined in clause 6.2 of 3GPP TS 23.003 [2]. It is encoded
1581 * as specified in clause 7.7.53 of 3GPP TS 29.060 [4], beginning
1582 * with octet 4 of Figure 7.7.53.1. The IMEI(SV) digits are encoded
1583 * using BCD coding where IMEI is 15 BCD digits and IMEISV is 16 BCD
1584 * digits. For IMEI, bits 5 to 8 of the last octet shall be filled
1585 * with an end mark coded as '1111'.
1589 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_)
1592 const gchar *mei_str;
1594 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1595 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1596 * allocated string will be returned.
1598 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, 0, length, NULL, FALSE);
1600 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, length, mei_str);
1601 proto_item_append_text(item, "%s", mei_str);
1607 * MSISDN is defined in 3GPP TS 23.003
1608 * Editor's note: MSISDN coding will be defined in TS 24.301.
1611 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_)
1613 const char *digit_str;
1615 /* Octets 5 to (n+4) represent the MSISDN value is in international number format
1616 * as described in ITU-T Rec E.164 [25] and 3GPP TS 29.002 [41].
1617 * MSISDN value contains only the actual MSISDN number (does not contain the "nature of
1618 * address indicator" octet, which indicates "international number"
1619 * as in 3GPP TS 29.002 [41]) and is encoded as TBCD digits, i.e.
1620 * digits from 0 through 9 are encoded "0000" to "1001".
1621 * When there is an odd number of digits, bits 8 to 5 of the last octet are encoded with
1622 * the filler "1111".
1624 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1625 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1626 * allocated string will be returned.
1628 digit_str = dissect_e164_msisdn(tvb, tree, 0, length, E164_ENC_BCD);
1629 proto_item_append_text(item, "%s", digit_str);
1636 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_)
1639 /* Octet 5 DAF DTF HI DFI OI ISRSI ISRAI SGWCI */
1640 proto_tree_add_item(tree, hf_gtpv2_daf, tvb, offset, 1, ENC_BIG_ENDIAN);
1641 proto_tree_add_item(tree, hf_gtpv2_dtf, tvb, offset, 1, ENC_BIG_ENDIAN);
1642 proto_tree_add_item(tree, hf_gtpv2_hi, tvb, offset, 1, ENC_BIG_ENDIAN);
1643 proto_tree_add_item(tree, hf_gtpv2_dfi, tvb, offset, 1, ENC_BIG_ENDIAN);
1644 proto_tree_add_item(tree, hf_gtpv2_oi, tvb, offset, 1, ENC_BIG_ENDIAN);
1645 proto_tree_add_item(tree, hf_gtpv2_isrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1646 proto_tree_add_item(tree, hf_gtpv2_israi, tvb, offset, 1, ENC_BIG_ENDIAN);
1647 proto_tree_add_item(tree, hf_gtpv2_sgwci, tvb, offset, 1, ENC_BIG_ENDIAN);
1650 proto_tree_add_text(tree, tvb, 0, length, "Older version?, should be 2 octets in 8.0.0");
1656 /* Octet 6 SQCI UIMSI CFSI CRSI P PT SI MSV
1657 * 3GPP TS 29.274 version 9.4.0 Release 9
1659 proto_tree_add_item(tree, hf_gtpv2_sqci, tvb, offset, 1, ENC_BIG_ENDIAN);
1660 proto_tree_add_item(tree, hf_gtpv2_uimsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1661 proto_tree_add_item(tree, hf_gtpv2_cfsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1662 proto_tree_add_item(tree, hf_gtpv2_crsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1664 proto_tree_add_item(tree, hf_gtpv2_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
1665 proto_tree_add_item(tree, hf_gtpv2_pt, tvb, offset, 1, ENC_BIG_ENDIAN);
1666 proto_tree_add_item(tree, hf_gtpv2_si, tvb, offset, 1, ENC_BIG_ENDIAN);
1667 proto_tree_add_item(tree, hf_gtpv2_msv, tvb, offset, 1, ENC_BIG_ENDIAN);
1673 /* Only present in version 9 and higher */
1674 /* Octet 7 Spare Spare Spare Spare Spare Spare Spare CCRSI */
1675 proto_tree_add_item(tree, hf_gtpv2_spare1, tvb, offset, 1, ENC_BIG_ENDIAN);
1676 proto_tree_add_item(tree, hf_gtpv2_spare2, tvb, offset, 1, ENC_BIG_ENDIAN);
1677 proto_tree_add_item(tree, hf_gtpv2_spare3, tvb, offset, 1, ENC_BIG_ENDIAN);
1678 proto_tree_add_item(tree, hf_gtpv2_s6af, tvb, offset, 1, ENC_BIG_ENDIAN);
1679 proto_tree_add_item(tree, hf_gtpv2_s4af, tvb, offset, 1, ENC_BIG_ENDIAN);
1680 proto_tree_add_item(tree, hf_gtpv2_mbmdt, tvb, offset, 1, ENC_BIG_ENDIAN);
1681 proto_tree_add_item(tree, hf_gtpv2_israu, tvb, offset, 1, ENC_BIG_ENDIAN);
1682 proto_tree_add_item(tree, hf_gtpv2_ccrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1688 * 8.13 Protocol Configuration Options (PCO)
1689 * Protocol Configuration Options (PCO) is transferred via GTP tunnels. The sending entity copies the value part of the
1690 * 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
1691 * as per clause 10.5.6.3 of 3GPP TS 24.008 [5], starting with octet 3.
1692 * Dissected in packet-gsm_a_gm.c
1695 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_)
1697 switch (message_type) {
1698 case GTPV2_CREATE_SESSION_REQUEST:
1699 /* PCO options as MS to network direction */
1700 pinfo->link_dir = P2P_DIR_UL;
1702 case GTPV2_CREATE_SESSION_RESPONSE:
1703 /* PCO options as Network to MS direction: */
1704 pinfo->link_dir = P2P_DIR_DL;
1709 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
1713 * 8.14 PDN Address Allocation (PAA)
1716 static const value_string gtpv2_pdn_type_vals[] = {
1724 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_)
1729 pdn_type = tvb_get_guint8(tvb, offset);
1730 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1736 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1740 /* If PDN type value indicates IPv6, octet 6 contains the IPv6 Prefix Length.
1741 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1742 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1743 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1745 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1747 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1751 /* If PDN type value indicates IPv4v6, octet 6 contains the IPv6 Prefix Length.
1752 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1753 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1754 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1755 * Octets 23 through 26 contain an IPv4 address. Bit 8 of octet 23 represents
1756 * the most significant bit of the IPv4 address and bit 1 of octet 26 the least
1759 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1761 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1763 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1770 * 8.15 Bearer Quality of Service (Bearer QoS)
1774 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_)
1777 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
1778 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
1779 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
1781 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1783 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1785 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1787 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1789 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1793 * 8.16 Flow Quality of Service (Flow QoS)
1797 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_)
1800 proto_tree_add_item(tree, hf_gtpv2_flow_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1802 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1804 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1806 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1808 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1814 static const value_string gtpv2_rat_type_vals[] = {
1820 {5, "HSPA Evolution"},
1825 static value_string_ext gtpv2_rat_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_rat_type_vals);
1829 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_)
1833 rat_type = tvb_get_guint8(tvb, 0);
1834 proto_tree_add_item(tree, hf_gtpv2_rat_type, tvb, 0, 1, ENC_BIG_ENDIAN);
1835 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(rat_type, >pv2_rat_type_vals_ext, "Unknown"), rat_type);
1840 * 8.18 Serving Network
1843 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_)
1847 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, TRUE);
1848 proto_item_append_text(item, "%s", mcc_mnc_str);
1852 * 8.19 EPS Bearer Level Traffic Flow Template (Bearer TFT)
1856 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_)
1858 /* The detailed coding of Traffic Aggregate
1859 * Description is specified in 3GPP TS 24.008 [5] ,
1860 * clause 10.5.6.12, beginning with octet 3..
1861 * Use the decoding in packet-gsm_a_gm.c
1863 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
1866 /* 8.20 Traffic Aggregate Description (TAD)
1869 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_)
1871 /* The detailed coding of Traffic Aggregate
1872 * Description is specified in 3GPP TS 24.008 [5] ,
1873 * clause 10.5.6.12, beginning with octet 3..
1874 * Use the decoding in packet-gsm_a_gm.c
1876 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
1880 * 8.21 User Location Info (ULI)
1882 * The flags ECGI, TAI, RAI, SAI and CGI in octed 5 indicate if the corresponding
1883 * fields are present in the IE or not. If one of these flags is set to "0",
1884 * the corresponding field is not present at all. The respective identities are defined in 3GPP
1886 * Editor's Note: The definition of ECGI is missing in 3GPP TS 23.003 v8.1.0.
1887 * It can be found in 3GPP TS 36.413 v8.3.0, but it is expected that it will be moved
1888 * to 23.003 in a future version.
1892 decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 instance _U_, guint flags)
1894 int offset = 1; /* flags are already dissected */
1895 proto_tree *part_tree;
1899 /* 8.21.1 CGI field */
1900 if (flags & GTPv2_ULI_CGI_MASK)
1904 proto_item_append_text(item, "CGI ");
1905 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
1906 ett_gtpv2_uli_field, NULL, "Cell Global Identity (CGI)");
1907 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1909 lac = tvb_get_ntohs(tvb, offset);
1910 proto_tree_add_item(part_tree, hf_gtpv2_uli_cgi_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1912 ci = tvb_get_ntohs(tvb, offset);
1913 proto_tree_add_item(part_tree, hf_gtpv2_uli_cgi_ci, tvb, offset, 2, ENC_BIG_ENDIAN);
1915 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, CI 0x%x",
1919 if (offset == length)
1923 /* 8.21.2 SAI field */
1924 if (flags & GTPv2_ULI_SAI_MASK)
1928 proto_item_append_text(item, "SAI ");
1929 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
1930 ett_gtpv2_uli_field, NULL, "Service Area Identity (SAI)");
1931 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1933 lac = tvb_get_ntohs(tvb, offset);
1934 proto_tree_add_item(part_tree, hf_gtpv2_uli_sai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1936 sac = tvb_get_ntohs(tvb, offset);
1937 proto_tree_add_item(part_tree, hf_gtpv2_uli_sai_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
1939 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, SAC 0x%x",
1943 if (offset == length)
1946 /* 8.21.3 RAI field */
1947 if (flags & GTPv2_ULI_RAI_MASK)
1950 proto_item_append_text(item, "RAI ");
1951 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
1952 ett_gtpv2_uli_field, NULL, "Routeing Area Identity (RAI)");
1953 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1955 lac = tvb_get_ntohs(tvb, offset);
1956 proto_tree_add_item(part_tree, hf_gtpv2_uli_rai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1958 rac = tvb_get_ntohs(tvb, offset);
1959 proto_tree_add_item(part_tree, hf_gtpv2_uli_rai_rac, tvb, offset, 2, ENC_BIG_ENDIAN);
1961 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, RAC 0x%x",
1966 if (offset == length)
1969 /* 8.21.4 TAI field */
1970 if (flags & GTPv2_ULI_TAI_MASK)
1973 proto_item_append_text(item, "TAI ");
1974 part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
1975 ett_gtpv2_uli_field, NULL, "Tracking Area Identity (TAI)");
1976 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
1978 tac = tvb_get_ntohs(tvb, offset);
1979 proto_tree_add_item(part_tree, hf_gtpv2_uli_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
1981 str = wmem_strdup_printf(wmem_packet_scope(), "%s, TAC 0x%x",
1984 if (offset == length)
1987 /* 8.21.5 ECGI field */
1988 if (flags & GTPv2_ULI_ECGI_MASK)
1995 proto_item_append_text(item, "ECGI ");
1996 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
1997 ett_gtpv2_uli_field, NULL, "E-UTRAN Cell Global Identifier (ECGI)");
1998 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
2000 /* The bits 8 through 5, of octet e+3 (Fig 8.21.5-1 in TS 29.274 V8.2.0) are spare
2001 * and hence they would not make any difference to the hex string following it,
2002 * thus we directly read 4 bytes from the tvb
2005 octet = tvb_get_guint8(tvb, offset);
2006 spare = octet & 0xF0;
2007 octet4 = tvb_get_ntohl(tvb, offset);
2008 ECGI = octet4 & 0x0FFFFFFF;
2009 proto_tree_add_uint(part_tree, hf_gtpv2_uli_ecgi_eci_spare, tvb, offset, 1, spare);
2010 /* The coding of the E-UTRAN cell identifier is the responsibility of each administration.
2011 * Coding using full hexadecimal representation shall be used.
2013 proto_tree_add_uint(part_tree, hf_gtpv2_uli_ecgi_eci, tvb, offset, 4, ECGI);
2014 /*proto_tree_add_item(tree, hf_gtpv2_uli_ecgi_eci, tvb, offset, 4, ENC_BIG_ENDIAN);*/
2016 str = wmem_strdup_printf(wmem_packet_scope(), "%s, ECGI 0x%x",
2020 if (offset == length)
2024 /* 8.21.6 LAI field */
2025 if (flags & GTPv2_ULI_LAI_MASK)
2028 proto_item_append_text(item, "LAI ");
2029 part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
2030 ett_gtpv2_uli_field, NULL, "LAI (Location Area Identifier)");
2031 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, TRUE);
2034 /* The Location Area Code (LAC) consists of 2 octets. Bit 8 of Octet f+3 is the most significant bit
2035 * and bit 1 of Octet f+4 the least significant bit. The coding of the location area code is the
2036 * responsibility of each administration. Coding using full hexadecimal representation shall be used.
2038 proto_tree_add_item(part_tree, hf_gtpv2_uli_lai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
2039 lac = tvb_get_ntohs(tvb, offset);
2040 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x",
2051 dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2053 proto_tree *flag_tree;
2057 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtpv2_uli_flags, NULL, "Flags");
2058 flags = tvb_get_guint8(tvb, offset) & 0x3f;
2059 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset >> 3, 2, ENC_BIG_ENDIAN);
2062 proto_tree_add_item(flag_tree, hf_gtpv2_uli_lai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2064 proto_tree_add_item(flag_tree, hf_gtpv2_uli_ecgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2066 proto_tree_add_item(flag_tree, hf_gtpv2_uli_tai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2068 proto_tree_add_item(flag_tree, hf_gtpv2_uli_rai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2070 proto_tree_add_item(flag_tree, hf_gtpv2_uli_sai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2072 proto_tree_add_item(flag_tree, hf_gtpv2_uli_cgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2074 decode_gtpv2_uli(tvb, pinfo, tree, item, length, instance, flags);
2079 /* Diameter 3GPP AVP Code: 22 3GPP-User-Location-Info */
2082 * 16.4.7.2 Coding 3GPP Vendor-Specific RADIUS attributes
2084 * For P-GW, the Geographic Location Type values and coding are defined as follows:
2089 * 3-127 Spare for future use
2093 * 131-255 Spare for future use
2097 static const value_string geographic_location_type_vals[] = {
2103 {130, "TAI and ECGI"},
2108 dissect_diameter_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2110 diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
2115 length = tvb_reported_length(tvb);
2116 flags_3gpp = tvb_get_guint8(tvb, offset);
2118 proto_tree_add_item(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN);
2124 flags = GTPv2_ULI_CGI_MASK;
2128 flags = GTPv2_ULI_SAI_MASK;
2132 flags = GTPv2_ULI_RAI_MASK;
2136 flags = GTPv2_ULI_TAI_MASK;
2140 flags = GTPv2_ULI_ECGI_MASK;
2144 flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_ECGI_MASK;
2147 proto_tree_add_text(tree, tvb, 1, -1, "Geographic Location");
2151 diam_sub_dis->avp_str = decode_gtpv2_uli(tvb, pinfo, tree, NULL, length, 0, flags);
2156 * 8.22 Fully Qualified TEID (F-TEID)
2158 static const value_string gtpv2_f_teid_interface_type_vals[] = {
2159 { 0, "S1-U eNodeB GTP-U interface"},
2160 { 1, "S1-U SGW GTP-U interface"},
2161 { 2, "S12 RNC GTP-U interface"},
2162 { 3, "S12 SGW GTP-U interface"},
2163 { 4, "S5/S8 SGW GTP-U interface"},
2164 { 5, "S5/S8 PGW GTP-U interface"},
2165 { 6, "S5/S8 SGW GTP-C interface"},
2166 { 7, "S5/S8 PGW GTP-C interface"},
2167 { 8, "S5/S8 SGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2168 "and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6)"}, */
2169 { 9, "S5/S8 PGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2170 "and the control plane and user plane addresses are the same for PMIPv6)"}, */
2171 {10, "S11 MME GTP-C interface"},
2172 {11, "S11/S4 SGW GTP-C interface"},
2173 {12, "S10 MME GTP-C interface"},
2174 {13, "S3 MME GTP-C interface"},
2175 {14, "S3 SGSN GTP-C interface"},
2176 {15, "S4 SGSN GTP-U interface"},
2177 {16, "S4 SGW GTP-U interface"},
2178 {17, "S4 SGSN GTP-C interface"},
2179 {18, "S16 SGSN GTP-C interface"},
2180 {19, "eNodeB GTP-U interface for DL data forwarding"},
2181 {20, "eNodeB GTP-U interface for UL data forwarding"},
2182 {21, "RNC GTP-U interface for data forwarding"},
2183 {22, "SGSN GTP-U interface for data forwarding"},
2184 {23, "SGW GTP-U interface for data forwarding"},
2185 {24, "Sm MBMS GW GTP-C interface"},
2186 {25, "Sn MBMS GW GTP-C interface"},
2187 {26, "Sm MME GTP-C interface"},
2188 {27, "Sn SGSN GTP-C interface"},
2189 {28, "SGW GTP-U interface for UL data forwarding"},
2190 {29, "Sn SGSN GTP-U interface"},
2191 {30, "S2b ePDG GTP-C interface"},
2192 {31, "S2b-U ePDG GTP-U interface"},
2193 {32, "S2b PGW GTP-C interface"},
2194 {33, "S2b-U PGW GTP-U interface"},
2195 {34, "S2a TWAN GTP-U interface"},
2196 {35, "S2a TWAN GTP-C interface"},
2197 {36, "S2a PGW GTP-C interface"},
2198 {37, "S2a PGW GTP-U interface"},
2201 static value_string_ext gtpv2_f_teid_interface_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_f_teid_interface_type_vals);
2203 static const true_false_string gtpv2_f_teid_v4_vals = {
2204 "IPv4 address present",
2205 "IPv4 address not present",
2208 static const true_false_string gtpv2_f_teid_v6_vals = {
2209 "IPv6 address present",
2210 "IPv6 address not present",
2214 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_)
2219 flags = tvb_get_guint8(tvb, offset);
2220 proto_tree_add_item(tree, hf_gtpv2_f_teid_v4, tvb, offset, 1, ENC_BIG_ENDIAN);
2221 proto_tree_add_item(tree, hf_gtpv2_f_teid_v6, tvb, offset, 1, ENC_BIG_ENDIAN);
2222 /* NOTE: "Interface type" IE is defined with 5 bits only in the earlier releases of this specification,
2223 * thus pre-Rel-10 GTPv2-C nodes can ignore bit "6" which is marked as "Spare" in earlier releases,
2224 * allowing backward compatibility.
2226 proto_tree_add_item(tree, hf_gtpv2_f_teid_interface_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2229 proto_tree_add_item(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2230 proto_item_append_text(item, "%s, TEID/GRE Key: 0x%s",
2231 val_to_str_ext_const((flags & 0x3f), >pv2_f_teid_interface_type_vals_ext, "Unknown"),
2232 tvb_bytes_to_ep_str(tvb, offset, 4));
2237 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
2238 proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(tvb, offset));
2243 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, ENC_NA);
2244 proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(tvb, offset));
2251 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_)
2253 proto_tree_add_item(tree, hf_gtpv2_tmsi, tvb, 0, 4, ENC_BIG_ENDIAN);
2254 proto_tree_add_text(item, tvb, 0, length, "TMSI: %s", tvb_bytes_to_ep_str(tvb, 0, 4));
2259 * 12.3 CN Identifier
2261 * A CN node is uniquely identified within a PLMN by its CN Identifier (CN-Id). The CN-Id together with the PLMN
2262 * identifier globally identifies the CN node. The CN-Id together with the PLMN-Id is used as the CN node identifier in
2263 * RANAP signalling over the Iu interface.
2264 * Global CN-Id = PLMN-Id || CN-Id
2265 * The CN-Id is defined by the operator, and set in the nodes via O&M.
2266 * For the syntax description and the use of this identifier in RANAP signalling, see 3GPP TS 25.413 [17].
2270 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_)
2274 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
2277 /* >CN-ID M INTEGER (0..4095) */
2278 proto_tree_add_text(tree, tvb, offset, 2, "CN-Id: %s",
2279 tvb_bytes_to_ep_str(tvb, offset, 2));
2282 * 8.25 S103 PDN Data Forwarding Info (S103PDF)
2285 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_)
2290 /* The HSGW Address and GRE Key identify a GRE Tunnel towards a HSGW over S103 interface for a specific PDN
2291 * connection of the UE. The EPS Bearer IDs specify the EPS Bearers which require data forwarding that belonging to this
2292 * PDN connection. The number of EPS bearer Ids included is specified by the value of EPS Bearer ID Number.
2294 /* Octet 5 HSGW Address for forwarding Length = m */
2295 m = tvb_get_guint8(tvb, offset);
2296 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_f_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2299 /* 6 to (m+5) HSGW Address for forwarding [4..16] */
2303 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2308 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2313 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2314 "Wrong length %u, should be 4 or 16", m);
2318 /* (m+6)- to (m+9) GRE Key */
2319 proto_tree_add_item(tree, hf_gtpv2_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2322 /* (m+10) EPS Bearer ID Number = k */
2323 k = tvb_get_guint8(tvb, offset);
2324 proto_tree_add_text(tree, tvb, offset, 1, "EPS Bearer ID Number = %d", k);
2327 /* (m+11) to (m+10+k)
2328 * Spare EPS Bearer ID
2330 for ( i = 0; i < k; i++ ) {
2331 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2332 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2338 * 8.26 S1-U Data Forwarding (S1UDF)
2341 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_)
2346 /* 5 Spare EPS Bearer ID */
2347 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2348 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2350 /* 6 Serving GW Address Length = m */
2351 m = tvb_get_guint8(tvb, offset);
2352 proto_tree_add_text(tree, tvb, offset, 1, "Serving GW Address Length = %u", m);
2354 /* 7 to (m+6) Serving GW Address [4..16] */
2358 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2363 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2368 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2369 "Wrong length %u, should be 4 or 16", m);
2374 * Serving GW S1-U TEID
2376 proto_tree_add_item(tree, hf_gtpv2_sgw_s1u_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
2384 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_)
2388 proto_tree_add_item(tree, hf_gtpv2_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2392 * 8.28 Bearer Context (grouped IE)
2396 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_)
2400 proto_tree *grouped_tree;
2402 proto_item_append_text(item, "[Grouped IE]");
2403 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_bearer_ctx);
2405 new_tvb = tvb_new_subset_length(tvb, offset, length);
2406 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type);
2409 /* 8.29 Charging ID */
2411 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_)
2415 proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, ENC_BIG_ENDIAN);
2419 /* 8.30 Charging Characteristics
2420 * The charging characteristics information element is defined in 3GPP TS 32.251 [8]
2421 * and is a way of informing both the SGW and PGW of the rules for producing charging
2422 * information based on operator configured triggers. For the encoding of this
2423 * information element see 3GPP TS 32.298 [9].
2426 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_)
2430 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, 2, ENC_BIG_ENDIAN);
2433 /* These octet(s) is/are present only if explicitly specified */
2434 proto_tree_add_text(tree, tvb, offset, length-2, "Remaining octets");
2443 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_)
2448 /* Octet 5 Spare VB PPC */
2449 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_ppc, tvb, offset, length, ENC_BIG_ENDIAN);
2450 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_vb, tvb, offset, length, ENC_BIG_ENDIAN);
2457 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_)
2464 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2465 "Wrong length indicated. Expected 1, got %u", length);
2469 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
2470 pdn = tvb_get_guint8(tvb, offset)& 0x7;
2471 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, ENC_BIG_ENDIAN);
2472 proto_item_append_text(item, "%s", val_to_str_const(pdn, gtpv2_pdn_type_vals, "Unknown"));
2477 * 8.31 Trace Information
2480 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_)
2482 proto_tree *trigg_tree, *msc_server_tree, *mgw_tree, *sgsn_tree, *ggsn_tree;
2483 proto_tree *bm_sc_tree, *sgw_mme_tree, *sgw_tree, *pgw_tree, *ne_types_tree;
2484 proto_tree *interfaces_tree, *imsc_server_tree, *lmgw_tree, *lsgsn_tree, *lggsn_tree, *lrnc_tree;
2485 proto_tree *lbm_sc_tree, *lmme_tree, *lsgw_tree, *lpdn_gw_tree, *lenb_tree;
2489 guint8 *trace_id = NULL;
2494 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
2497 /* Append Trace ID to main tree */
2498 tid = tvb_get_ntohs(tvb, offset);
2499 proto_item_append_text(item, "Trace ID: %d ", tid);
2502 /*--------------------------------------------------
2503 * trace_id = tvb_format_text(tvb, offset, 2);
2504 * proto_tree_add_string(tree, hf_gtpv2_tra_info, tvb, offset, length, trace_id);
2505 *--------------------------------------------------*/
2506 proto_tree_add_text(tree, tvb, offset, 3, "Trace ID: %d", tid);
2509 /* Triggering Events, put all into a new tree called triggering_tree */
2510 trigg_tree = proto_tree_add_subtree(tree, tvb, offset, 9, ett_gtpv2_tra_info_trigg, NULL, "Triggering Events");
2512 /* Create all subtrees */
2513 msc_server_tree = proto_tree_add_subtree(trigg_tree, tvb, offset, 2, ett_gtpv2_tra_info_trigg_msc_server, NULL, "MSC Server");
2515 mgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_trigg_mgw, NULL, "MGW");
2517 sgsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_trigg_sgsn, NULL, "SGSN");
2519 ggsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_trigg_ggsn, NULL, "GGSN");
2521 bm_sc_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_trigg_bm_sc, NULL, "BM-SC");
2523 sgw_mme_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_trigg_sgw_mme, NULL, "SGW MME");
2525 sgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_sgw, NULL, "SGW");
2527 pgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_pgw, NULL, "PGW");
2529 /* MSC Server - 2 octets */
2530 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_calls, tvb, offset, 1, ENC_BIG_ENDIAN);
2531 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2532 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_lu_imsi_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2533 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_handovers, tvb, offset, 1, ENC_BIG_ENDIAN);
2534 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2535 bit_offset = offset << 3;
2536 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2538 bit_offset = offset << 3;
2539 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2543 proto_tree_add_item(mgw_tree, hf_gtpv2_tra_info_mgw_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2544 bit_offset = offset << 3;
2545 proto_tree_add_bits_item(mgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2547 /* SGSN - 2 octets */
2548 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_pdp_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2549 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2550 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_rau_gprs_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2551 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2552 bit_offset = offset << 3;
2553 proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2555 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2557 /* GGSN - 1 octet */
2558 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_pdp, tvb, offset, 1, ENC_BIG_ENDIAN);
2559 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2560 bit_offset = offset << 3;
2561 proto_tree_add_bits_item(ggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2563 /* BM-SC - 1 octet */
2564 proto_tree_add_item(bm_sc_tree, hf_gtpv2_tra_info_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2565 bit_offset = offset << 3;
2566 proto_tree_add_bits_item(bm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2568 /* MME/SGW - 1 octet */
2569 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2570 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_sr, tvb, offset, 1, ENC_BIG_ENDIAN);
2571 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_iataud, tvb, offset, 1, ENC_BIG_ENDIAN);
2572 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc, tvb, offset, 1, ENC_BIG_ENDIAN);
2573 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del, tvb, offset, 1, ENC_BIG_ENDIAN);
2574 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ho, tvb, offset, 1, ENC_BIG_ENDIAN);
2575 bit_offset = offset << 3;
2576 proto_tree_add_bits_item(sgw_mme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2578 /* PGW/SGW - 1 octet */
2579 proto_tree_add_item(sgw_tree, hf_gtpv2_tra_info_sgw_pdn_con_creat, tvb, offset, 1, ENC_BIG_ENDIAN);
2580 proto_tree_add_item(sgw_tree, hf_gtpv2_tra_info_sgw_pdn_con_term, tvb, offset, 1, ENC_BIG_ENDIAN);
2581 proto_tree_add_item(sgw_tree, hf_gtpv2_tra_info_sgw_bearer_act_mod_del, tvb, offset, 1, ENC_BIG_ENDIAN);
2582 bit_offset = (offset << 3) + 4;
2583 proto_tree_add_bits_item(sgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2584 proto_tree_add_item(pgw_tree, hf_gtpv2_tra_info_pgw_pdn_con_creat, tvb, offset, 1, ENC_BIG_ENDIAN);
2585 proto_tree_add_item(pgw_tree, hf_gtpv2_tra_info_pgw_pdn_con_term, tvb, offset, 1, ENC_BIG_ENDIAN);
2586 proto_tree_add_item(pgw_tree, hf_gtpv2_tra_info_pgw_bearer_act_mod_del, tvb, offset, 1, ENC_BIG_ENDIAN);
2587 bit_offset = offset << 3;
2588 proto_tree_add_bits_item(pgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2591 /* Create NE Types subtree */
2592 ne_types_tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_gtpv2_tra_info_ne_types, NULL, "List of NE Types");
2595 /* List of NE Types */
2596 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_msc_s, tvb, offset, 1, ENC_BIG_ENDIAN);
2597 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2598 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2599 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_ggsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2600 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_rnc, tvb, offset, 1, ENC_BIG_ENDIAN);
2601 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2602 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2603 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2605 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_pdn_gw, tvb, offset, 1, ENC_BIG_ENDIAN);
2606 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_enb, tvb, offset, 1, ENC_BIG_ENDIAN);
2607 bit_offset = offset << 3;
2608 proto_tree_add_bits_item(ne_types_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2611 /* Trace Depth Length */
2612 proto_tree_add_item(tree, hf_gtpv2_tra_info_tdl, tvb, offset, 1, ENC_BIG_ENDIAN);
2615 /* Set up subtree interfaces and put all interfaces under it */
2616 interfaces_tree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_gtpv2_tra_info_interfaces, NULL, "List of Interfaces");
2618 /* Create all subtrees */
2619 imsc_server_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset, 2, ett_gtpv2_tra_info_interfaces_imsc_server, NULL, "MSC Server");
2621 lmgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_interfaces_lmgw, NULL, "MGW");
2623 lsgsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_interfaces_lsgsn, NULL, "SGSN");
2625 lggsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_interfaces_lggsn, NULL, "GGSN");
2627 lrnc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_interfaces_lrnc, NULL, "RNC");
2629 lbm_sc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_interfaces_lbm_sc, NULL, "BM-SC");
2631 lmme_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_interfaces_lmme, NULL, "MME");
2633 lsgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 9, 1,ett_gtpv2_tra_info_interfaces_lsgw, NULL, "SGW");
2635 lpdn_gw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 10, 1, ett_gtpv2_tra_info_interfaces_lpdn_gw, NULL, "PDN GW");
2637 lenb_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 11, 1, ett_gtpv2_tra_info_interfaces_lpdn_lenb, NULL, "eNB");
2639 /* MSC Server - 2 octests */
2640 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_a, tvb, offset, 1, ENC_BIG_ENDIAN);
2641 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2642 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2643 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_g, tvb, offset, 1, ENC_BIG_ENDIAN);
2644 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_b, tvb, offset, 1, ENC_BIG_ENDIAN);
2645 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_e, tvb, offset, 1, ENC_BIG_ENDIAN);
2646 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_f, tvb, offset, 1, ENC_BIG_ENDIAN);
2647 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_cap, tvb, offset, 1, ENC_BIG_ENDIAN);
2649 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_d, tvb, offset, 1, ENC_BIG_ENDIAN);
2650 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_c, tvb, offset, 1, ENC_BIG_ENDIAN);
2651 bit_offset = offset << 3;
2652 proto_tree_add_bits_item(imsc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2655 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2656 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_nb_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2657 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_lu_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2658 bit_offset = offset << 3;
2659 proto_tree_add_bits_item(lmgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2661 /* SGSN - 2 octets */
2662 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gb, tvb, offset, 1, ENC_BIG_ENDIAN);
2663 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2664 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2665 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gr, tvb, offset, 1, ENC_BIG_ENDIAN);
2666 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gd, tvb, offset, 1, ENC_BIG_ENDIAN);
2667 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gf, tvb, offset, 1, ENC_BIG_ENDIAN);
2668 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gs, tvb, offset, 1, ENC_BIG_ENDIAN);
2669 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_ge, tvb, offset, 1, ENC_BIG_ENDIAN);
2671 bit_offset = offset << 3;
2672 proto_tree_add_bits_item(lsgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2675 /* GGSN - 1 octet */
2676 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2677 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gi, tvb, offset, 1, ENC_BIG_ENDIAN);
2678 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2679 bit_offset = offset << 3;
2680 proto_tree_add_bits_item(lggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2683 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2684 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lur, tvb, offset, 1, ENC_BIG_ENDIAN);
2685 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lub, tvb, offset, 1, ENC_BIG_ENDIAN);
2686 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2687 bit_offset = offset << 3;
2688 proto_tree_add_bits_item(lrnc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2690 /* BM_SC - 1 octet */
2691 proto_tree_add_item(lbm_sc_tree, hf_gtpv2_tra_info_lbm_sc_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2692 bit_offset = offset << 3;
2693 proto_tree_add_bits_item(lbm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2696 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2697 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s3, tvb, offset, 1, ENC_BIG_ENDIAN);
2698 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s6a, tvb, offset, 1, ENC_BIG_ENDIAN);
2699 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s10, tvb, offset, 1, ENC_BIG_ENDIAN);
2700 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2701 bit_offset = offset << 3;
2702 proto_tree_add_bits_item(lmme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2705 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s4, tvb, offset, 1, ENC_BIG_ENDIAN);
2706 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2707 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2708 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2709 bit_offset = offset << 3;
2710 proto_tree_add_bits_item(lsgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2712 /* PDN GW - 1 octet */
2713 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2a, tvb, offset, 1, ENC_BIG_ENDIAN);
2714 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2b, tvb, offset, 1, ENC_BIG_ENDIAN);
2715 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2c, tvb, offset, 1, ENC_BIG_ENDIAN);
2716 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2717 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s6c, tvb, offset, 1, ENC_BIG_ENDIAN);
2718 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_gx, tvb, offset, 1, ENC_BIG_ENDIAN);
2719 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2720 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_sgi, tvb, offset, 1, ENC_BIG_ENDIAN);
2723 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2724 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_x2, tvb, offset, 1, ENC_BIG_ENDIAN);
2725 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2726 bit_offset = offset << 3;
2727 proto_tree_add_bits_item(lenb_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2729 /*--------------------------------------------------
2731 *--------------------------------------------------*/
2733 /* IP Address of Trace Collection Entity */
2734 while ( (offset + 4) <= length ) {
2736 proto_tree_add_item(tree, hf_gtpv2_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
2743 * 8.33 Void (TS 129 274 V9.4.0 (2010-10))
2746 /* 8.35 Procedure Transaction ID (PTI) */
2748 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_)
2750 proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, ENC_BIG_ENDIAN);
2753 * 8.36 DRX Parameter
2756 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_)
2760 /* 36.413 : 9.2.1.17 Paging Cause, void */
2761 proto_tree_add_text(tree, tvb, offset, length, "DRX parameter: %s", tvb_bytes_to_ep_str(tvb, offset, (length )));
2765 * 8.37 UE Network Capability
2766 * UE Network Capability is coded as depicted in Figure 8.37-1. Actual coding of the UE Network Capability field is
2767 * defined in 3GPP TS 24.301
2770 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_)
2772 de_emm_ue_net_cap(tvb, tree, pinfo, 0, length, NULL, 0);
2778 static const value_string gtpv2_mm_context_security_mode[] = {
2779 {0, "GSM Key and Triplets"},
2780 {1, "UMTS Key, Used Cipher and Quintuplets"},
2781 {2, "GSM Key, Used Cipher and Quintuplets"},
2782 {3, "UMTS Key and Quintuplets"},
2783 {4, "EPS Security Context, Quadruplets and Quintuplets" },
2784 {5, "UMTS Key, Quadruplets and Quintuplets"},
2788 static const true_false_string gtpv2_nhi_vals = {
2789 "NH (Next Hop) and NCC (Next Hop Chaining Count) are both present",
2790 "NH (Next Hop) and NCC (Next Hop Chaining Count) not present",
2793 /* Table 8.38-2: Used NAS Cipher Values */
2795 static const value_string gtpv2_mm_context_unc_vals[] = {
2796 {0, "No ciphering"},
2807 /* Table 8.38-3: Used Cipher Values */
2808 static const value_string gtpv2_mm_context_used_cipher_vals[] = {
2809 {0, "No ciphering"},
2820 /* Table 8.38-4: Used NAS integrity protection algorithm Values */
2821 static const value_string gtpv2_mm_context_unipa_vals[] = {
2822 {0, "No ciphering"},
2833 /* Helper functions */
2835 /* Figure 8.38-7: Authentication Triplet */
2837 dissect_gtpv2_authentication_triplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 num_triplet)
2839 proto_tree *auth_tri_tree;
2842 for (i = 0; i < num_triplet; i++) {
2843 auth_tri_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
2844 ett_gtpv2_mm_context_auth_tri, NULL, "Authentication Triplet %u", i);
2846 * Figure 8.38-8: Authentication Quintuplet
2851 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
2853 proto_tree_add_text(auth_tri_tree, tvb, offset, 4, "SRES': %s", tvb_bytes_to_ep_str(tvb, offset, 4));
2855 proto_tree_add_text(auth_tri_tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
2864 dissect_gtpv2_authentication_quintuplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
2866 proto_tree *auth_qui_tree;
2868 guint8 xres_len, autn_len;
2870 for (i = 0; i < nr_qui; i++) {
2871 auth_qui_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
2872 ett_gtpv2_mm_context_auth_qui, NULL, "Authentication Quintuplet %u", i);
2874 * Figure 8.38-8: Authentication Quintuplet
2878 * (m+1) to (m+16) CK
2879 * (m+17) to (m+32) IK
2883 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
2885 xres_len = tvb_get_guint8(tvb, offset);
2886 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2888 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres, tvb, offset, xres_len, ENC_NA);
2890 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
2892 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
2894 autn_len = tvb_get_guint8(tvb, offset);
2895 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2897 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn, tvb, offset, autn_len, ENC_NA);
2906 dissect_gtpv2_authentication_quadruplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
2908 proto_tree *auth_qua_tree;
2912 for (i = 0; i < nr_qui; i++) {
2913 auth_qua_tree = proto_tree_add_subtree(tree, tvb, offset, 0,
2914 ett_gtpv2_mm_context_auth_qua, NULL, "Authentication Quadruplet");
2916 proto_tree_add_text(auth_qua_tree, tvb, offset, 16, "RAND: %s",
2917 tvb_bytes_to_ep_str(tvb, offset, 16));
2920 tmp = tvb_get_guint8(tvb, offset++);
2922 proto_tree_add_text(auth_qua_tree, tvb, offset, tmp, "XRES: %s",
2923 tvb_bytes_to_ep_str(tvb, offset, tmp));
2926 tmp = tvb_get_guint8(tvb, offset++);
2928 proto_tree_add_text(auth_qua_tree, tvb, offset, tmp, "AUTN: %s",
2929 tvb_bytes_to_ep_str(tvb, offset, tmp));
2932 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
2939 static const value_string gtpv2_mm_context_higher_br_16mb_flg_vals[] = {
2946 dissect_gtpv2_mm_context_common_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint8 samb_ri, guint8 uamb_ri)
2948 proto_tree *net_cap_tree, *msnt_cap_tree;
2949 guint8 ue_net_cap_len, ms_net_cap_len, mei_len;
2952 * If SAMBRI (Subscribed UE AMBR Indicator), bit 1 of octet 6, is set to "1",
2953 * then the Uplink/downlink Subscribed UE AMBR parameter field is present,
2956 /* j to (j+3) Uplink Subscribed UE AMBR */
2957 proto_tree_add_text(tree, tvb, offset, 4, "Uplink Subscribed UE AMBR: %d Kbps",
2958 tvb_get_ntohl(tvb, offset));
2961 /* (j+4) to (j+7) Downlink Subscribed UE AMBR */
2962 proto_tree_add_text(tree, tvb, offset, 4, "Downlink Subscribed UE AMBR: %d Kbps",
2963 tvb_get_ntohl(tvb, offset));
2968 * If UAMBRI (Used UE AMBR Indicator), bit 2 of octet 6, is set to "1",
2969 * then the Uplink/downlink Used UE AMBR parameter field is present
2972 /* i to (i+3) Uplink Used UE AMBR */
2973 proto_tree_add_text(tree, tvb, offset, 4, "Uplink Used UE AMBR: %d Kbps",
2974 tvb_get_ntohl(tvb, offset));
2977 /* (i+4) to (i+7) Downlink Used UE AMBR */
2978 proto_tree_add_text(tree, tvb, offset, 4, "Downlink Used UE AMBR: %d Kbps",
2979 tvb_get_ntohl(tvb, offset));
2983 /* q Length of UE Network Capability */
2984 ue_net_cap_len = tvb_get_guint8(tvb, offset);
2985 proto_tree_add_item(tree, hf_gtpv2_mm_context_ue_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2987 /* (q+1) to k UE Network Capability */
2988 if (ue_net_cap_len) {
2989 /* The UE Network Capability coding is specified in clause 9.9.3.34 of 3GPP TS 24.301 [23].
2990 * If Length of UE Network Capability is zero, then the UE Network Capability parameter
2991 * shall not be present.
2993 net_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ue_net_cap_len,
2994 ett_gtpv2_mm_context_net_cap, NULL, "UE Network Capability");
2995 offset += de_emm_ue_net_cap(tvb, net_cap_tree, pinfo, offset, ue_net_cap_len, NULL, 0);
2997 /* k+1 Length of MS Network Capability */
2998 ms_net_cap_len = tvb_get_guint8(tvb, offset);
2999 proto_tree_add_item(tree, hf_gtpv2_mm_context_ms_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3001 /* (k+2) to m MS Network Capability
3002 * The MS Network Capability coding is specified in clause 10.5.5.12 of 3GPP TS 24.008 [5].
3003 * If Length of MS Network Capability is zero, then the MS Network Capability parameter shall not be present.
3005 if (ms_net_cap_len) {
3006 msnt_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ms_net_cap_len,
3007 ett_gtpv2_ms_network_capability, NULL, "MS network capability");
3008 offset += de_gmm_ms_net_cap(tvb, msnt_cap_tree, pinfo, offset, ms_net_cap_len, NULL, 0);
3010 /* m+1 Length of Mobile Equipment Identity (MEI) */
3011 mei_len = tvb_get_guint8(tvb, offset);
3012 proto_tree_add_item(tree, hf_gtpv2_mm_context_mei_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3014 /* (m+2) to r Mobile Equipment Identity (MEI) */
3016 const gchar *mei_str;
3018 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, mei_len, NULL, FALSE);
3019 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, mei_len, mei_str);
3026 dissect_gtpv2_access_restriction_data(tvbuff_t *tvb, proto_tree *tree, int offset)
3028 proto_tree *accrstdata_tree;
3030 accrstdata_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtpv2_access_rest_data, NULL, "Access restriction data");
3031 /* Spare HNNA ENA INA GANA GENA UNA */
3032 proto_tree_add_bits_item(accrstdata_tree, hf_gtpv2_spare_bits, tvb, (offset << 3), 2, ENC_BIG_ENDIAN);
3033 proto_tree_add_item(accrstdata_tree, hf_gtpv2_hnna, tvb, offset, 1, ENC_BIG_ENDIAN);
3034 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ena, tvb, offset, 1, ENC_BIG_ENDIAN);
3035 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ina, tvb, offset, 1, ENC_BIG_ENDIAN);
3036 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gana, tvb, offset, 1, ENC_BIG_ENDIAN);
3037 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gena, tvb, offset, 1, ENC_BIG_ENDIAN);
3038 proto_tree_add_item(accrstdata_tree, hf_gtpv2_una, tvb, offset, 1, ENC_BIG_ENDIAN);
3044 /* Type = 103 (decimal)
3045 * Figure 8.38-1: GSM Key and Triplets
3048 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_)
3050 proto_tree *flag_tree;
3052 guint8 oct, drxi, num_triplet, uamb_ri, samb_ri;
3055 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3058 /* Security Mode | Spare | DRXI | CKSN */
3059 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3060 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3061 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
3062 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3063 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
3066 /* Number of Triplet | Spare | UAMB RI | SAMB RI */
3067 oct = tvb_get_guint8(tvb, offset);
3068 num_triplet = oct >> 5;
3069 uamb_ri = (oct & 0x02) >> 1;
3070 samb_ri = oct & 0x01;
3072 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_tri, tvb, offset, 1, ENC_BIG_ENDIAN);
3073 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3074 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3075 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3078 /* Octet 7 Spare Used Cipher */
3079 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3080 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3084 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
3087 /* 16 to h Authentication Triplet [0..4] */
3089 dissect_gtpv2_authentication_triplets(tvb, tree, offset, num_triplet);
3093 * (h+1) to (h+2) DRX parameter
3096 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3100 /* Dissect octet j to r */
3101 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3103 proto_tree_add_expert_format(flag_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
3106 /* Type = 104 (decimal)
3107 * Figure 8.38-2: UMTS Key, Used Cipher and Quintuplets
3110 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_)
3112 proto_tree *flag_tree;
3114 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3117 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3120 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3121 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3122 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3123 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3124 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3127 oct = tvb_get_guint8(tvb, offset);
3129 uamb_ri = (oct & 0x02) >> 1;
3130 samb_ri = oct & 0x01;
3131 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3132 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3133 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3134 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3136 /* Octet 7 Spare Used Cipher */
3137 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3138 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3141 /* Octet 8 to 23 CK */
3142 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3144 /* Octet 24 to 39 IK */
3145 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3149 * 40 to h Authentication Quintuplet [0..4]
3152 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3156 * (h+1) to (h+2) DRX parameter
3159 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3164 /* Dissect octet j to r */
3165 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3167 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3168 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3169 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3170 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3172 if (offset < (gint)length) {
3173 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3177 if (offset == (gint)length) {
3181 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3182 vdp_len = tvb_get_guint8(tvb, offset);
3183 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3185 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3187 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3191 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3192 if (offset == (gint)length) {
3193 hbr_len = tvb_get_guint8(tvb, offset);
3194 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3196 /* s+2 Higher bitrates than 16 Mbps flag */
3198 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3205 proto_tree_add_expert_format(flag_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
3209 /* Type = 105 (decimal)
3210 * Figure 8.38-3: GSM Key, Used Cipher and Quintuplets
3213 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_)
3215 proto_tree *flag_tree;
3217 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3220 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3223 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3224 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3225 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3226 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3227 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3230 oct = tvb_get_guint8(tvb, offset);
3232 uamb_ri = (oct & 0x02) >> 1;
3233 samb_ri = oct & 0x01;
3234 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3235 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3236 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3237 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3239 /* Octet 7 Spare Used Cipher */
3240 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3241 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3244 proto_tree_add_text(tree, tvb, offset, 8, "Kc': %s", tvb_bytes_to_ep_str(tvb, offset, 8));
3248 * 40 to h Authentication Quintuplet [0..4]
3251 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3255 * (h+1) to (h+2) DRX parameter
3258 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3263 /* Dissect octet j to r */
3264 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3266 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3267 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3268 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3269 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3271 if (offset < (gint)length) {
3272 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3276 if (offset == (gint)length) {
3280 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3281 vdp_len = tvb_get_guint8(tvb, offset);
3282 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3284 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3286 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3290 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3291 if (offset < (gint)length) {
3292 hbr_len = tvb_get_guint8(tvb, offset);
3293 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3295 /* s+2 Higher bitrates than 16 Mbps flag */
3297 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3304 proto_tree_add_expert_format(flag_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
3308 /* Type = 106 (decimal)
3309 * Figure 8.38-4: UMTS Key and Quintuplets
3312 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_)
3314 proto_tree *flag_tree;
3316 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3319 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3322 /* Security Mode Spare DRXI KSI */
3323 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3324 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3325 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3326 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3327 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3330 /* Number of Quintuplets Spare UAMB RI SAMB RI */
3331 oct = tvb_get_guint8(tvb, offset);
3333 uamb_ri = (oct & 0x02) >> 1;
3334 samb_ri = oct & 0x01;
3336 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3337 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3338 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3339 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3342 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3344 /* Octet 8 to 23 CK */
3345 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3347 /* Octet 24 to 39 IK */
3348 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3352 * 40 to h Authentication Quintuplet [0..4]
3355 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3359 * (h+1) to (h+2) DRX parameter
3362 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3367 /* Dissect octet j to r */
3368 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3370 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3371 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3372 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3373 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3375 if (offset < (gint)length) {
3376 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3380 if (offset == (gint)length) {
3384 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3385 vdp_len = tvb_get_guint8(tvb, offset);
3386 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3388 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3390 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3394 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3395 if (offset < (gint)length) {
3396 hbr_len = tvb_get_guint8(tvb, offset);
3397 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3399 /* s+2 Higher bitrates than 16 Mbps flag */
3401 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3408 /* (s+3) to (n+4) These octet(s) is/are present only if explicitly specified */
3409 proto_tree_add_expert_format(flag_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
3414 * Type = 107 (decimal)
3415 * Figure 8.38-5: EPS Security Context and Quadruplets
3418 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_)
3420 proto_item *qua_item, *qui_item;
3421 proto_tree *flag_tree, *qua_tree, *qui_tree;
3423 guint8 tmp, nhi, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_len;
3427 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3432 * Security Mode | NHI | DRXI | KSIASME
3434 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3435 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nhi, tvb, offset, 1, ENC_BIG_ENDIAN);
3436 /* If NHI (Next Hop Indicator), bit 5 of octet 5, is set to "1",
3437 * then the optional parameters NH (Next Hop) and NCC (Next
3438 * Hop Chaining Count) are both present, otherwise their octets are not present.
3440 tmp = tvb_get_guint8(tvb, offset);
3441 nhi = (tmp & 0x10) >> 4;
3442 drxi = (tmp & 0x08) >> 3;
3443 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3444 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3450 * Number of | Number of | UAMB | OSCI
3451 * Quintuplets | Quadruplet | RI |
3453 tmp = tvb_get_guint8(tvb, offset);
3454 nr_qui = (tmp & 0xe0) >> 5;
3455 nr_qua = tmp & 0x1c;
3457 uamb_ri = (tmp & 0x2) >> 1;
3459 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3460 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3462 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3464 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_osci, tvb, offset, 1, ENC_BIG_ENDIAN);
3467 /* Octet 7 SAMB RI Used NAS integrity protection algorithm Used NAS Cipher*/
3469 samb_ri = tvb_get_guint8(tvb, offset) >> 7;
3470 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
3471 /* Used NAS integrity protection algorithm */
3472 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unipa, tvb, offset, 1, ENC_BIG_ENDIAN);
3473 /* Used NAS Cipher */
3474 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unc, tvb, offset, 1, ENC_BIG_ENDIAN);
3477 /* Octet 8-10 NAS Downlink Count*/
3478 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_dl_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3481 /* Octet 11-13 NAS Uplink Count */
3482 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_ul_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3486 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
3489 qua_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quadruplets: %u", nr_qua);
3491 qua_tree = proto_item_add_subtree(qua_item, ett_gtpv2_qua);
3492 offset = dissect_gtpv2_authentication_quadruplets(tvb, qua_tree, offset, nr_qua);
3494 PROTO_ITEM_SET_GENERATED(qua_item);
3497 qui_item = proto_tree_add_text(tree, tvb, offset, 0, "Authentication Quintuplets: %u", nr_qui);
3499 qui_tree = proto_item_add_subtree(qui_item, ett_gtpv2_qui);
3500 offset = dissect_gtpv2_authentication_quintuplets(tvb, qui_tree, offset, nr_qui);
3502 PROTO_ITEM_SET_GENERATED(qui_item);
3505 /* (h+1) to (h+2) DRX parameter */
3507 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3511 /* Octet p to p+31 & Octet p+32 */
3514 proto_tree_add_text(tree, tvb, offset, 32, "NH (Next Hop): %s",
3515 tvb_bytes_to_ep_str(tvb, offset, 32));
3518 proto_tree_add_text(tree, tvb, offset, 1, "NCC (Next Hop Chaining Count): %d",
3519 (tvb_get_guint8(tvb, offset) & 0x0f));
3524 /* Dissect octet j to r */
3525 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3527 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3528 if (offset < (gint)length) {
3529 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3534 if (offset == (gint)length) {
3538 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3539 vdp_len = tvb_get_guint8(tvb, offset);
3540 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3542 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3544 proto_tree_add_text(tree, tvb, offset, vdp_len, "Voice Domain Preference and UE's Usage Setting");
3545 /*offset += vdp_len;*/
3551 * Type = 108 (decimal)
3552 * Figure 8.38-6: UMTS Key, Quadruplets and Quintuplets
3555 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_)
3557 proto_tree *flag_tree;
3559 guint8 tmp, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_length;
3562 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3565 * Security Mode Spare DRXI KSIASME
3567 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3568 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3569 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3570 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3571 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3577 * Number of | Number of | UAMB | SAMB
3578 * Quintuplets | Quadruplet | RI | RI
3580 tmp = tvb_get_guint8(tvb, offset);
3581 nr_qui = (tmp & 0xe0) >> 5;
3582 nr_qua = tmp & 0x1c;
3584 uamb_ri = (tmp & 0x2) >> 1;
3585 samb_ri = tmp & 0x01;
3587 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3588 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3589 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3590 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3593 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3595 /* Octet 8 to 23 CK */
3596 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3598 /* Octet 24 to 39 IK */
3599 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3604 offset = dissect_gtpv2_authentication_quadruplets(tvb, tree, offset, nr_qui);
3608 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3611 /* (h+1) to (h+2) DRX parameter */
3613 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3617 /* Dissect octet j to r */
3618 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3620 if (offset >= (guint32)length) {
3623 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3624 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3626 if (offset >= (guint32)length) {
3630 /* 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
3631 * Length of Voice Domain Preference and UE's Usage Setting is zero, then the Voice Domain Preference and UE's Usage
3632 * Setting parameter shall not be present.
3634 vdp_length = tvb_get_guint8(tvb, offset);
3635 proto_tree_add_item(tree, hf_gtpv2_vdp_length, tvb, offset, 1, ENC_BIG_ENDIAN);
3639 offset += de_gmm_voice_domain_pref(tvb, tree, pinfo, offset, vdp_length, NULL, 0);
3642 if (offset < (guint32)length) {
3643 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
3649 * 8.39 PDN Connection (grouped IE)
3652 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_)
3655 proto_tree *grouped_tree;
3658 proto_item_append_text(item, "[Grouped IE]");
3659 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
3660 new_tvb = tvb_new_subset_length(tvb, offset, length);
3662 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type);
3668 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_)
3670 proto_item *nsapi_ti;
3671 proto_tree *nsapi_tree;
3673 guint16 dlgtpu_seq, ulgtpu_seq, send_npdu_nr, rec_npdu_nr;
3676 nsapi = (tvb_get_guint8(tvb, offset) & 0x08);
3677 nsapi_ti = proto_tree_add_text(tree, tvb, offset, 1, "NSAPI: %d", nsapi);
3678 nsapi_tree = proto_item_add_subtree(nsapi_ti, ett_gtpv2_pdn_numbers_nsapi);
3679 proto_tree_add_bits_item(nsapi_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3680 proto_tree_add_item(nsapi_tree, hf_gtpv2_pdn_numbers_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
3681 proto_item_append_text(item, "NSAPI: %u", nsapi);
3684 dlgtpu_seq = tvb_get_ntohs(tvb, offset);
3685 proto_tree_add_text(tree, tvb, offset, 2, "DL GTP-U Sequence Number: %d", dlgtpu_seq);
3688 ulgtpu_seq = tvb_get_ntohs(tvb, offset);
3689 proto_tree_add_text(tree, tvb, offset, 2, "UL GTP-U Sequence Number: %d", ulgtpu_seq);
3692 send_npdu_nr = tvb_get_ntohs(tvb, offset);
3693 proto_tree_add_text(tree, tvb, offset, 2, "Send N-PDU Number: %d", send_npdu_nr);
3696 rec_npdu_nr = tvb_get_ntohs(tvb, offset);
3697 proto_tree_add_text(tree, tvb, offset, 2, "Receive N-PDU Number: %d", rec_npdu_nr);
3701 * 8.41 Packet TMSI (P-TMSI)
3704 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_)
3708 /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation. */
3709 proto_tree_add_item(tree, hf_gtpv2_p_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
3710 proto_item_append_text(item, "%s", tvb_bytes_to_ep_str(tvb, offset, 4));
3714 * 8.42 P-TMSI Signature
3717 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_)
3721 /* The P-TMSI Signature consists of 3 octets and may be allocated by the SGSN. */
3722 proto_tree_add_item(tree, hf_gtpv2_p_tmsi_sig, tvb, offset, 3, ENC_BIG_ENDIAN);
3723 proto_item_append_text(item, "%s", tvb_bytes_to_ep_str(tvb, offset, 3));
3731 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_)
3736 hop_counter = tvb_get_guint8(tvb, offset);
3738 proto_tree_add_text(tree, tvb, offset, 1, "Hop Counter: %d", hop_counter);
3739 proto_item_append_text(item, "%d", hop_counter);
3746 static const value_string gtpv2_ue_time_zone_dst_vals[] = {
3747 {0, "No Adjustments for Daylight Saving Time"},
3748 {1, "+1 Hour Adjustments for Daylight Saving Time"},
3749 {2, "+2 Hour Adjustments for Daylight Saving Time"},
3754 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_)
3759 * UE Time Zone is used to indicate the offset between universal time and local time in steps of 15 minutes of where the
3760 * UE currently resides. The "Time Zone" field uses the same format as the "Time Zone" IE in 3GPP TS 24.008 [5].
3761 * (packet-gsm_a_dtap.c)
3763 de_time_zone(tvb, tree, pinfo, offset, 1, NULL, 0);
3765 proto_tree_add_item(item, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, ENC_BIG_ENDIAN);
3769 * 8.45 Trace Reference
3772 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_)
3778 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, TRUE);
3781 trace_id = tvb_get_ntohs(tvb, offset);
3782 proto_tree_add_text(tree, tvb, offset, 3, "Trace ID: %d", trace_id);
3784 proto_item_append_text(item, "%s,Trace ID %u", mcc_mnc_str, trace_id);
3787 * 8.46 Complete Request Message
3789 static const value_string gtpv2_complete_req_msg_type_vals[] = {
3790 {0, "Complete Attach Request Message" },
3791 {1, "Complete TAU Request Message" },
3795 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_)
3802 proto_tree_add_item(tree, hf_gtpv2_complete_req_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3806 /* Add the Complete Request Message */
3807 new_tvb = tvb_new_subset_remaining(tvb, offset);
3808 call_dissector(nas_eps_handle, new_tvb, pinfo, tree);
3816 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_)
3822 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, TRUE);
3825 proto_tree_add_item(tree, hf_gtpv2_mme_grp_id, tvb, offset, 2, ENC_BIG_ENDIAN);
3828 proto_tree_add_item(tree, hf_gtpv2_mme_code, tvb, offset, 1, ENC_BIG_ENDIAN);
3831 proto_tree_add_item(tree, hf_gtpv2_m_tmsi, tvb, offset, 4, ENC_NA);
3835 * 8.48 Fully Qualified Container (F-Container)
3838 static const value_string gtpv2_container_type_vals[] = {
3839 {1, "UTRAN transparent container"},
3840 {2, "BSS container"},
3841 {3, "E-UTRAN transparent container"},
3847 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_)
3850 proto_tree *sub_tree;
3852 guint8 container_type;
3853 guint8 container_flags, xid_len;
3855 /* Octets 8 7 6 5 4 3 2 1
3856 * 5 Spare | Container Type
3858 proto_tree_add_item(tree, hf_gtpv2_container_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3859 container_type = tvb_get_guint8(tvb, offset);
3861 if ( (message_type == GTPV2_FORWARD_RELOCATION_REQ)
3862 || (message_type == GTPV2_CONTEXT_RESPONSE)
3863 || (message_type == GTPV2_RAN_INFORMATION_RELAY)) {
3864 switch (container_type) {
3867 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_bss_con, NULL, "BSS container");
3868 /* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of paratemer */
3869 proto_tree_add_item(sub_tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
3870 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3871 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3872 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3873 container_flags = tvb_get_guint8(tvb, offset);
3875 if ((container_flags & 0x01) == 1) {
3876 /* Packet Flow ID present */
3877 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
3880 if (((container_flags & 0x04) == 4) || ((container_flags & 0x02) == 2)) {
3881 if ((container_flags & 0x04) == 4) {
3883 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
3885 if ((container_flags & 0x02) == 2) {
3886 /* Radio Priority present */
3887 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
3891 if ((container_flags & 0x08) == 8) {
3892 /* XiD parameters length is present in Octet c.
3893 * XiD parameters are present in Octet d to n.
3895 xid_len = tvb_get_guint8(tvb, offset);
3896 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3898 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_NA);
3905 if (message_type == GTPV2_FORWARD_CTX_NOTIFICATION) {
3906 switch (container_type) {
3908 /* E-UTRAN transparent container */
3909 new_tvb = tvb_new_subset_remaining(tvb, offset);
3910 dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(new_tvb, pinfo, tree, NULL);
3917 /* 7.3.2 Forward Relocation Response
3918 * E-UTRAN Transparent Container
3919 * This IE is conditionally included only during a handover to
3920 * E-UTRAN and contains the radio-related and core network
3921 * information. If the Cause IE contains the value "Request
3922 * accepted", this IE shall be included.
3924 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
3929 * 8.49 Fully Qualified Cause (F-Cause)
3932 static const value_string gtpv2_cause_type_vals[] = {
3933 {0, "Radio Network Layer"},
3934 {1, "Transport Layer"},
3937 {4, "Miscellaneous"},
3951 static value_string_ext gtpv2_cause_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_type_vals);
3954 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_)
3959 /* The value of Instance field of the F-Cause IE in a GTPv2 message shall indicate
3960 * whether the F-Cause field contains RANAP Cause, BSSGP Cause or RAN Cause.
3961 * If the F-Cause field contains RAN Cause, the Cause Type field shall contain
3962 * the RAN cause subcategory as specified in 3GPP TS 36.413 [10] and it shall be
3963 * encoded as in Table 8.49-1.
3964 * If the F-Cause field contains BSSGP Cause or RANAP Cause,
3965 * the Cause Type field shall be ignored by the receiver.
3967 if (message_type == GTPV2_FORWARD_RELOCATION_REQ) {
3970 proto_item_append_text(item, "[RAN Cause]");
3971 proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3972 cause_type = tvb_get_guint8(tvb, offset);
3974 switch (cause_type) {
3976 /* CauseRadioNetwork */
3977 proto_tree_add_item(tree, hf_gtpv2_CauseRadioNetwork, tvb, offset, 1, ENC_BIG_ENDIAN);
3980 /* CauseTransport */
3981 proto_tree_add_item(tree, hf_gtpv2_CauseTransport, tvb, offset, 1, ENC_BIG_ENDIAN);
3985 proto_tree_add_item(tree, hf_gtpv2_CauseNas, tvb, offset, 1, ENC_BIG_ENDIAN);
3989 proto_tree_add_item(tree, hf_gtpv2_CauseProtocol, tvb, offset, 1, ENC_BIG_ENDIAN);
3993 proto_tree_add_item(tree, hf_gtpv2_CauseMisc, tvb, offset, 1, ENC_BIG_ENDIAN);
4001 proto_item_append_text(item, "[RANAP Cause]");
4004 proto_item_append_text(item, "[BSSGP Cause]");
4010 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
4015 * 8.50 Selected PLMN ID
4018 * The Selected PLMN ID IE contains the core network operator selected for tne UE
4019 * in a shared network. Octets 5-7 shall be encoded as the content part of the
4020 * "Selected PLMN Identity" parameter in 3GPP TS 36.413 [10].
4021 * -The Selected PLMN identity consists of 3 digits from MCC followed by
4022 * either -a filler digit plus 2 digits from MNC (in case of 2 digit MNC) or
4023 * -3 digits from MNC (in case of a 3 digit MNC).
4026 * +--+--+--+--+--+--+--+--+
4027 * Octet 5 |MCC digit 2|MCC digit 1|
4028 * +--+--+--+--+--+--+--+--+
4029 * Octet 6 |MNC digit 1|MCC digit 3|
4030 * +--+--+--+--+--+--+--+--+
4031 * Octet 7 |MNC digit 3|MNC digit 2|
4032 * +--+--+--+--+--+--+--+--+
4035 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_)
4039 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, FALSE);
4040 proto_item_append_text(item, "%s", mcc_mnc_str);
4044 * 8.51 Target Identification
4047 static const value_string gtpv2_target_type_vals[] = {
4049 {1, "Macro eNodeB ID"},
4050 {2, "Cell Identifier"},
4051 {3, "Home eNodeB ID"},
4054 static value_string_ext gtpv2_target_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_target_type_vals);
4057 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_)
4063 proto_tree_add_item(tree, hf_gtpv2_target_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4064 target_type = tvb_get_guint8(tvb, offset);
4066 switch (target_type) {
4068 new_tvb = tvb_new_subset_remaining(tvb, offset);
4069 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4072 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
4075 /* RAC (see NOTE 3) */
4076 proto_tree_add_item(tree, hf_gtpv2_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
4079 * In this case the Target ID field shall be encoded as the Target
4080 * RNC-ID part of the "Target ID" parameter in 3GPP TS 25.413 [33]. Therefore, the "Choice Target ID" that indicates
4081 * "Target RNC-ID" (numerical value of 0x20) shall not be included (value in octet 5 specifies the target type).
4083 proto_tree_add_item(tree, hf_gtpv2_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4084 /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
4085 * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
4088 proto_tree_add_item(tree, hf_gtpv2_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4092 /* Macro eNodeB ID*/
4093 new_tvb = tvb_new_subset_remaining(tvb, offset);
4094 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4096 /* The Macro eNodeB ID consists of 20 bits.
4097 * Bit 4 of Octet 4 is the most significant bit and bit 1 of Octet 6 is the least significant bit.
4099 proto_tree_add_item(tree, hf_gtpv2_macro_enodeb_id, tvb, offset, 3, ENC_BIG_ENDIAN);
4101 /* Tracking Area Code (TAC) */
4102 proto_tree_add_item(tree, hf_gtpv2_uli_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
4106 /* Cell Identifier */
4107 /* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
4108 * in 3GPP TS 48.018 [34].
4110 new_tvb = tvb_new_subset_remaining(tvb, offset);
4111 de_bssgp_cell_id(new_tvb, tree, pinfo, 0, 0/* not used */, NULL, 0);
4114 /* Home eNodeB ID */
4115 new_tvb = tvb_new_subset_remaining(tvb, offset);
4116 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, TRUE);
4118 /* Octet 10 to 12 Home eNodeB ID
4119 * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
4120 * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
4121 * The coding of the Home eNodeB ID is the responsibility of each administration.
4122 * Coding using full hexadecimal representation shall be used.
4124 proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, offset, 4 , ENC_BIG_ENDIAN);
4126 /* Octet 13 to 14 Tracking Area Code (TAC) */
4127 proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
4133 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
4141 * 8.53 Packet Flow ID
4144 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_)
4148 /* Octet 5 Spare EBI */
4149 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4150 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 2, ENC_BIG_ENDIAN);
4153 /* Packet Flow ID */
4154 proto_tree_add_text(tree, tvb, offset, length, "Packet Flow ID: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4161 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_)
4164 guint16 dlgtpu_seq, ulgtpu_seq, dl_pdcp_seq, ul_pdcp_seq;
4167 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4168 proto_tree_add_item(tree, hf_gtpv2_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
4171 /* 6 to 7 DL GTP-U Sequence Number */
4172 dlgtpu_seq = tvb_get_ntohs(tvb, offset);
4173 proto_tree_add_text(tree, tvb, offset, 2, "DL GTP-U Sequence Number: %d", dlgtpu_seq);
4176 /* 8 to 9 UL GTP-U Sequence Number */
4177 ulgtpu_seq = tvb_get_ntohs(tvb, offset);
4178 proto_tree_add_text(tree, tvb, offset, 2, "UL GTP-U Sequence Number: %d", ulgtpu_seq);
4181 /* 10 to 11 DL PDCP Sequence Number */
4182 dl_pdcp_seq = tvb_get_ntohs(tvb, offset);
4183 proto_tree_add_text(tree, tvb, offset, 2, "DL PDCP Sequence Number: %d", dl_pdcp_seq);
4186 /* 12 to 13 UL PDCP Sequence Number */
4187 ul_pdcp_seq = tvb_get_ntohs(tvb, offset);
4188 proto_tree_add_text(tree, tvb, offset, 2, "UL PDCP Sequence Number: %d", ul_pdcp_seq);
4193 * 8.55 Source RNC PDCP context info
4196 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_)
4198 proto_tree_add_text(tree, tvb, 0, length, "RRC Container");
4202 * 8.56 UDP Source Port Number
4205 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_)
4207 proto_tree_add_text(tree, tvb, 0, 2, "UPD Source Port Number: %u", tvb_get_ntohs(tvb, 0));
4208 proto_item_append_text(item, "%u", tvb_get_ntohs(tvb, 0));
4211 * 8.57 APN Restriction
4214 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_)
4218 type_value = tvb_get_guint8(tvb, 0);
4219 proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, 0, 1, ENC_BIG_ENDIAN);
4220 proto_item_append_text(item, "value %u", type_value);
4224 * 8.58 Selection Mode
4226 static const value_string gtpv2_selec_mode_vals[] = {
4227 {0, "MS or network provided APN, subscribed verified"},
4228 {1, "MS provided APN, subscription not verified"},
4229 {2, "Network provided APN, subscription not verified"},
4230 {3, "Network provided APN, subscription not verified (Basically for Future use"},
4235 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_)
4240 ss_mode = tvb_get_guint8(tvb, offset) & 0x03;
4241 proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
4242 proto_item_append_text(item, "%s", val_to_str_const(ss_mode, gtpv2_selec_mode_vals, "Unknown"));
4247 * 8.59 Source Identification
4250 static const value_string gtpv2_source_ident_types[] = {
4253 {2, "eNodeB ID(Reserved, used in erlier v of proto.)"},
4258 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_)
4263 /* Octet 5 to 12 Target Cell ID */
4264 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4266 /* Octet 13 Source Type */
4267 source_type = tvb_get_guint8(tvb, offset);
4268 proto_tree_add_item(tree, hf_gtpv2_source_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4270 /* Octet 14 to (n+4) Source ID */
4271 switch (source_type) {
4273 /* The Source Type is Cell ID for PS handover from GERAN A/Gb mode. In this case the coding of the Source ID field
4274 * shall be same as the Octets 3 to 10 of the Cell Identifier IEI in 3GPP TS 48.018 [34].
4276 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4279 /* The Source Type is RNC ID for PS handover from GERAN Iu mode or for inter-RAT handover from UTRAN. In this
4280 * case the Source ID field shall be encoded as as the Source RNC-ID part of the "Source ID" parameter in 3GPP TS
4283 /* RNC-ID M INTEGER (0..4095) */
4288 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_source_type_unknown, tvb, offset-1, 1);
4295 * 8.60 Bearer Control Mode
4297 static const value_string gtpv2_bearer_control_mode_vals[] = {
4298 {0, "Selected Bearer Control Mode-'MS_only'"},
4299 {1, "Selected Bearer Control Mode-'Network_only'"},
4300 {2, "Selected Bearer Control Mode-'MS/NW'"},
4304 static const value_string gtpv2_bearer_control_mode_short_vals[] = {
4306 {1, "Network_only"},
4312 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_)
4316 proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
4317 /* Add Bearer Control Mode to tree */
4318 bcm = tvb_get_guint8(tvb, 0);
4319 proto_item_append_text(item, "%s", val_to_str_const(bcm, gtpv2_bearer_control_mode_short_vals, "Unknown"));
4323 * 8.61 Change Reporting Action
4325 static const value_string gtpv2_cng_rep_act_vals[] = {
4326 {0, "Stop Reporting"},
4327 {1, "Start Reporting CGI/SAI"},
4328 {2, "Start Reporting RAI"},
4329 {3, "Start Reporting TAI"},
4330 {4, "Start Reporting ECGI"},
4331 {5, "Start Reporting CGI/SAI and RAI"},
4332 {6, "Start Reporting TAI and ECGI"},
4337 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_)
4341 /* Add Action to tree */
4342 action = tvb_get_guint8(tvb, 0);
4343 proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, ENC_BIG_ENDIAN);
4345 proto_item_append_text(item, "%s", val_to_str_const(action, gtpv2_cng_rep_act_vals, "Unknown"));
4348 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
4351 static const value_string gtpv2_fq_csid_type_vals[] = {
4352 {0, "Global unicast IPv4 address"},
4353 {1, "Global unicast IPv6 address"},
4354 {2, "4 octets long field"},
4360 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_)
4363 guint8 octet, node_id_type, csids;
4364 guint32 node_id, node_id_mcc_mnc;
4366 /* Octet 5 Node-ID Type Number of CSIDs= m */
4368 octet = tvb_get_guint8(tvb, offset);
4369 node_id_type = octet >> 4;
4370 csids = octet & 0x0f;
4371 proto_tree_add_item(tree, hf_gtpv2_fq_csid_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4372 proto_tree_add_item(tree, hf_gtpv2_fq_csid_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
4375 switch (node_id_type) {
4377 /* Indicates that Node-ID is a global unicast IPv4 address and p = 9 */
4378 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4382 /* Indicates that Node-ID is a global unicast IPv6 address and p = 21 */
4383 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv6, tvb, offset, 16, ENC_NA);
4387 /* Node-ID is a 4 octets long field with a 32 bit value stored in network order, and p= 9. The coding
4388 * of the field is specified below:
4389 * - Most significant 20 bits are the binary encoded value of (MCC * 1000 + MNC).
4390 * - Least significant 12 bits is a 12 bit integer assigned by an operator to an MME, SGW or PGW. Other values of
4391 * Node-ID Type are reserved.
4393 node_id = tvb_get_ntohl(tvb, offset);
4394 node_id_mcc_mnc = node_id >> 12;
4395 node_id = node_id & 0xfff;
4396 proto_tree_add_text(tree, tvb, offset, 4, "Node-ID: MCC+MNC %u, Id: %u", node_id_mcc_mnc, node_id);
4400 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_fq_csid_type_bad, tvb, offset-1, 1,
4401 "Wrong Node-ID Type %u, should be 0-2(Or tis is a newer spec)", node_id_type);
4405 /* First PDN Connection Set Identifier (CSID)
4406 * Second PDN Connection Set Identifier (CSID)
4408 * m-th PDN Connection Set Identifier (CSID)
4411 proto_tree_add_item(tree, hf_gtpv2_fq_csid_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4418 * 8.63 Channel needed
4421 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_)
4423 /* The Channel needed shall be coded as depicted in Figure 8.63-1. Channel needed is coded as the IEI part and the value
4424 * part of the Channel Needed IE defined in 3GPP TS 44.018[28]
4426 de_rr_chnl_needed(tvb, tree, pinfo, 0, length, NULL, 0);
4430 * 8.64 eMLPP Priority
4431 * The eMLPP-Priority shall be coded as depicted in Figure 8.64-1. The eMLPP Priority is coded as the value part of the
4432 * eMLPP-Priority IE defined in 3GPP TS 48.008 [29] (not including 3GPP TS 48.008 IEI and 3GPP TS 48.008 [29]
4433 * length indicator).
4436 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_)
4438 be_emlpp_prio(tvb, tree, pinfo, 0, length, NULL, 0);
4445 static const value_string gtpv2_node_type_vals[] = {
4452 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_)
4456 proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4457 /* Append Node Type to tree */
4458 node_type = tvb_get_guint8(tvb, 0);
4459 proto_item_append_text(item, "%s", val_to_str_const(node_type, gtpv2_node_type_vals, "Unknown"));
4464 * 8.66 Fully Qualified Domain Name (FQDN)
4467 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_)
4469 int offset = 0, name_len, tmp;
4470 guint8 *fqdn = NULL;
4472 /* The FQDN field encoding shall be identical to the encoding of
4473 * a FQDN within a DNS message of section 3.1 of IETF
4474 * RFC 1035 [31] but excluding the trailing zero byte.
4477 name_len = tvb_get_guint8(tvb, offset);
4479 if (name_len < 0x20) {
4480 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
4482 if (name_len >= length - 1)
4485 name_len = name_len + fqdn[tmp] + 1;
4489 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
4491 proto_tree_add_string(tree, hf_gtpv2_fqdn, tvb, offset, length, fqdn);
4492 proto_item_append_text(item, "%s", fqdn);
4497 * 8.67 Private Extension
4500 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)
4506 /* oct 5 -7 Enterprise ID */
4507 ext_id = tvb_get_ntohs(tvb, offset);
4508 proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4511 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(ext_id, &sminmpec_values_ext, "Unknown"), ext_id);
4513 next_tvb = tvb_new_subset_length(tvb, offset, length-2);
4514 if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, GUINT_TO_POINTER((guint32)instance))){
4518 proto_tree_add_text(tree, tvb, offset, length-2, "Proprietary value");
4522 * 8.68 Transaction Identifier (TI)
4525 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_)
4527 /* 5 to (n+4) Transaction Identifier */
4528 proto_tree_add_item(tree, hf_gtpv2_ti, tvb, 0, length, ENC_NA);
4533 * 8.69 MBMS Session Duration
4536 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_)
4545 /* From 3GPP TS 29.061 17.7.7 MBMS-Session-Duration AVP */
4546 /* Bits: ssss ssss ssss ssss sddd dddd where s bits = seconds, d bits = days */
4547 seconds = tvb_get_bits32(tvb, bit_offset, 17, ENC_BIG_ENDIAN);
4550 days = tvb_get_bits32(tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4552 /* Maximum allowed value for days: 18.
4553 * Maximum allowed value for seconds: 86,400 */
4554 if ((days > 18) || (seconds > 86400)) {
4555 proto_tree_add_text(tree, tvb, offset, offset + 3, "Days or Seconds out or allowed range");
4558 /* 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. */
4559 if ((seconds == 0) && (days == 0)) {
4560 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4561 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4562 proto_item_append_text(item, "Indefinite (always-on)");
4564 hours = seconds / 3600;
4565 minutes = (seconds % 3600) / 60;
4566 seconds = (seconds % 3600) % 60;
4568 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4569 proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4570 proto_item_append_text(item, "%d days %02d:%02d:%02d (DD days HH:MM:SS)", days, hours, minutes, seconds);
4575 proto_tree_add_text(tree, tvb, offset, length-3, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-3));
4579 * 8.70 MBMS Service Area
4582 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_)
4585 proto_item *sai_item;
4590 binary_nr = tvb_get_guint8(tvb, offset);
4591 real_nr = (guint16)binary_nr + 1;
4593 /* 3GPP TS 29.061 17.7.6 MBMS-Service-Area AVP */
4594 proto_tree_add_uint(tree, hf_gtpv2_mbms_service_area_nr, tvb, offset, 1, real_nr);
4597 /* A consecutive list of MBMS Service Area Identities follow, each with a length of two octets. */
4598 while (offset < length) {
4599 /* 3GPP TS 23.003 15.3 Structure of MBMS SAI */
4600 sai = tvb_get_ntohs(tvb, offset);
4601 sai_item = proto_tree_add_item(tree, hf_gtpv2_mbms_service_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4602 /* The value 0 denotes the whole of PLMN as the MBMS Service Area */
4604 proto_item_append_text(sai_item, " Entire PLMN");
4606 proto_item_append_text(item, " %u", sai);
4612 * 8.71 MBMS Session Identifier
4615 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_)
4618 /* One octet OctetString. */
4619 proto_tree_add_item(tree, hf_gtpv2_mbms_session_id, tvb, offset, 1, ENC_NA);
4623 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4627 * 8.72 MBMS Flow Identifier
4630 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_)
4633 /* Two octets OctetString. */
4634 proto_tree_add_item(tree, hf_gtpv2_mbms_flow_id, tvb, offset, 2, ENC_NA);
4635 proto_item_append_text(item, " %s", tvb_bytes_to_ep_str(tvb, offset, 2));
4639 proto_tree_add_text(tree, tvb, offset, length-2, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-2));
4643 * 8.73 MBMS IP Multicast Distribution
4645 static const value_string gtpv2_mbms_hc_indicator_vals[] = {
4646 {0, "Uncompressed header"},
4647 {1, "Compressed header"},
4652 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_)
4656 proto_tree_add_item(tree, hf_gtpv2_cteid, tvb, offset, 4, ENC_BIG_ENDIAN);
4659 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4660 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4661 /* IP Multicast Distribution Address */
4662 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4664 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4665 proto_item_append_text(item, " IPv4 Dist %s", tvb_ip_to_str(tvb, offset));
4667 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4669 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv6, tvb, offset, 16, ENC_NA);
4670 proto_item_append_text(item, " IPv6 Dist %s", tvb_ip6_to_str(tvb, offset));
4674 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4675 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4676 /* IP Multicast Source Address */
4677 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4679 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4680 proto_item_append_text(item, " IPv4 Src %s", tvb_ip_to_str(tvb, offset));
4682 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4684 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv6, tvb, offset, 16, ENC_NA);
4685 proto_item_append_text(item, " IPv6 Src %s", tvb_ip6_to_str(tvb, offset));
4689 proto_tree_add_item(tree, hf_gtpv2_mbms_hc_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
4692 if (length > offset)
4693 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4698 * 8.74 MBMS Distribution Acknowledge
4700 static const value_string gtpv2_mbms_dist_indication_vals[] = {
4701 {0, "No RNCs have accepted IP multicast distribution"},
4702 {1, "All RNCs have accepted IP multicast distribution"},
4703 {2, "Some RNCs have accepted IP multicast distribution"},
4704 {3, "Spare. For future use."},
4709 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_)
4713 proto_tree_add_item(tree, hf_gtpv2_mbms_dist_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
4717 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4721 * 8.75 User CSG Information (UCI)
4724 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_)
4726 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4729 /* 8.76 CSG Information Reporting Action */
4731 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_)
4733 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4736 /* 8.77 RFSP Index */
4738 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_)
4743 proto_tree_add_item(tree, hf_gtpv2_subscriber_rfsp, tvb, offset, 2, ENC_BIG_ENDIAN);
4744 }else if(instance == 1){
4745 proto_tree_add_item(tree, hf_gtpv2_rfsp_inuse, tvb, offset, 2, ENC_BIG_ENDIAN);
4751 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_)
4753 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4756 /* 8.79 CSG Membership Indication (CMI) */
4758 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_)
4760 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4763 /* 8.80 Service indicator */
4765 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_)
4767 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4770 /* 8.81 Detach Type */
4772 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_)
4774 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4777 /* 8.82 Local Distinguished Name (LDN) */
4779 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_)
4781 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4784 /* 8.83 Node Features */
4786 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_)
4789 proto_tree_add_item(tree, hf_gtpv2_node_features_prn, tvb, offset, 1, ENC_BIG_ENDIAN);
4790 proto_tree_add_item(tree, hf_gtpv2_node_features_mabr, tvb, offset, 1, ENC_BIG_ENDIAN);
4791 proto_tree_add_item(tree, hf_gtpv2_node_features_ntsr, tvb, offset, 1, ENC_BIG_ENDIAN);
4794 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4798 * MBMS Time to Data Transfer
4801 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_)
4807 binary_secs = tvb_get_guint8(tvb, offset);
4808 real_secs = (guint16)binary_secs + 1;
4810 proto_tree_add_string_format_value(tree, hf_gtpv2_time_to_data_xfer, tvb, offset, 1, "", "%d second(s)", real_secs);
4811 proto_item_append_text(item, " %u second(s)", real_secs);
4814 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4817 /* 8.85 Throttling */
4819 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_)
4821 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4824 /* 8.86 Allocation/Retention Priority (ARP) */
4826 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_)
4830 proto_tree_add_item(tree, hf_gtpv2_arp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
4831 proto_tree_add_item(tree, hf_gtpv2_arp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
4832 proto_tree_add_item(tree, hf_gtpv2_arp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
4836 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4839 /* 8.87 EPC Timer */
4840 static const value_string gtpv2_timer_unit_vals[] = {
4841 {0, "value is incremented in multiples of 2 seconds"},
4842 {1, "value is incremented in multiples of 1 minute"},
4843 {2, "value is incremented in multiples of 10 minutes"},
4844 {3, "value is incremented in multiples of 1 hour"},
4845 {4, "value is incremented in multiples of 1 hour"},
4846 {5, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
4847 {6, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
4848 {7, "value indicates that the timer is infinite"},
4853 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_)
4855 proto_tree_add_item(tree, hf_gtpv2_timer_unit, tvb, 0, 1, ENC_BIG_ENDIAN);
4856 proto_tree_add_item(tree, hf_gtpv2_timer_value, tvb, 0, 1, ENC_BIG_ENDIAN);
4860 /* 8.88 Signalling Priority Indication */
4862 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_)
4864 proto_tree_add_item(tree, hf_gtpv2_lapi, tvb, 0, 1, ENC_BIG_ENDIAN);
4867 /* 8.89 Temporary Mobile Group Identity (TMGI) */
4869 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_)
4874 tmgi = tvb_get_ntoh48(tvb, offset);
4876 proto_item_append_text(item, "%012" G_GINT64_MODIFIER "x", tmgi);
4878 proto_tree_add_item(tree, hf_gtpv2_mbms_service_id, tvb, offset, 3, ENC_NA);
4881 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
4884 if (length > offset)
4885 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4889 * 8.90 Additional MM context for SRVCC
4890 * 3GPP TS 29.274 Figure 8.90-1
4893 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_)
4896 proto_item *ms_cm_item;
4897 proto_tree *ms_cm_tree;
4900 /* Length of Mobile Station Classmark 2 */
4901 elm_len = tvb_get_guint8(tvb, offset);
4902 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
4904 ms_cm_item = proto_tree_add_text(tree, tvb, offset, elm_len, "Mobile Station Classmark2: %s", tvb_bytes_to_ep_str(tvb, offset, elm_len));
4905 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
4906 /* Mobile Station Classmark 2 */
4907 de_ms_cm_2(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4910 /* Length of Mobile Station Classmark 3 */
4911 elm_len = tvb_get_guint8(tvb, offset);
4912 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
4914 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));
4915 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
4916 /* Mobile Station Classmark 3 */
4917 de_ms_cm_3(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4920 /* Length of Supported Codec List */
4921 elm_len = tvb_get_guint8(tvb, offset);
4922 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
4924 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));
4925 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_supp_codec_list);
4926 /* Supported Codec List */
4927 de_sup_codec_list(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
4930 if (length > offset)
4931 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
4934 /* 8.91 Additional flags for SRVCC */
4936 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_)
4940 proto_tree_add_item(tree, hf_gtpv2_add_flags_for_srvcc_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
4941 proto_tree_add_item(tree, hf_gtpv2_vsrvcc_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
4945 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
4948 /* 8.92 Max MBR/APN-AMBR (MMBR) */
4950 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_)
4956 max_ul = tvb_get_ntohl(tvb, offset);
4957 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "%u %s",
4958 (max_ul) > 1000 ? max_ul/1000 : max_ul,
4959 (max_ul) > 1000 ? "Mbps" : "kbps");
4963 max_dl = tvb_get_ntohl(tvb, offset);
4964 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "%u %s",
4965 (max_dl) > 1000 ? max_dl/1000 : max_dl,
4966 (max_dl) > 1000 ? "Mbps" : "kbps");
4969 /* 8.93 MDT Configuration */
4971 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_)
4973 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
4976 /* 8.94 Additional Protocol Configuration Options (APCO) */
4978 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_)
4980 switch (message_type) {
4981 case GTPV2_CREATE_SESSION_REQUEST:
4982 /* PCO options as MS to network direction */
4983 pinfo->link_dir = P2P_DIR_UL;
4985 case GTPV2_CREATE_SESSION_RESPONSE:
4986 /* PCO options as Network to MS direction: */
4987 pinfo->link_dir = P2P_DIR_DL;
4992 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
4995 /* 8.95 Absolute Time of MBMS Data Transfer */
4997 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_)
5000 const gchar *time_str;
5002 time_str = tvb_ntp_fmt_ts(tvb, offset);
5003 proto_tree_add_string(tree, hf_gtpv2_abs_time_mbms_data, tvb, offset, 8, time_str);
5004 proto_item_append_text(item, "%s", time_str);
5007 if (length > offset)
5008 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
5011 /* 8.96 H(e)NB Information Reporting */
5012 static const true_false_string gtpv2_henb_info_report_fti_vals = {
5013 "Start reporting H(e)NB local IP address and UDP port number information change",
5014 "Stop reporting H(e)NB local IP address and UDP port number information change",
5018 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_)
5022 proto_tree_add_item(tree, hf_gtpv2_henb_info_report_fti, tvb, offset, 1, ENC_BIG_ENDIAN);
5026 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5029 /* 8.97 IPv4 Configuration Parameters (IP4CP) */
5031 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_)
5035 proto_tree_add_item(tree, hf_gtpv2_ip4cp_subnet_prefix_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5037 proto_tree_add_item(tree, hf_gtpv2_ip4cp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
5040 if (length > offset)
5041 proto_tree_add_text(tree, tvb, offset, length-offset, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-offset));
5044 /* 8.98 Change to Report Flags */
5046 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_)
5050 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_sncr, tvb, offset, 1, ENC_BIG_ENDIAN);
5051 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_tzcr, tvb, offset, 1, ENC_BIG_ENDIAN);
5055 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5058 /* 8.99 Action Indication */
5059 static const value_string gtpv2_action_indication_vals[] = {
5061 { 1, "Deactivation Indication"},
5062 { 2, "Paging Indication"},
5070 static value_string_ext gtpv2_action_indication_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_action_indication_vals);
5073 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_)
5077 proto_tree_add_item(tree, hf_gtpv2_action_indication_val, tvb, offset, 1, ENC_BIG_ENDIAN);
5081 proto_tree_add_text(tree, tvb, offset, length-1, "Spare: %s", tvb_bytes_to_ep_str(tvb, offset, length-1));
5085 * 8.100 TWAN Identifier
5088 dissect_gtpv2_twan_Identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5090 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5093 * 8.101 ULI Timestamp
5096 dissect_gtpv2_uli_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5098 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5104 dissect_gtpv2_mbms_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_)
5106 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5109 * 8.103 RAN/NAS Cause
5112 dissect_gtpv2_ran_nas_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5114 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5117 * 8.104 CN Operator Selection Entity
5120 dissect_gtpv2_cn_operator_selection_entity(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5122 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5125 * 8.105 Trusted WLAN Mode Indication
5128 dissect_gtpv2_trust_wlan_mode_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_)
5130 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5136 dissect_gtpv2_node_number(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5138 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5141 * 8.107 Node Identifier
5144 dissect_gtpv2_node_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5146 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5149 * 8.108 Presence Reporting Area Action
5153 static const value_string gtpv2_pres_rep_area_action_vals[] = {
5154 { 1, "Start Reporting change"},
5155 { 2, "Stop Reporting change"},
5160 dissect_gtpv2_pres_rep_area_action(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
5164 /* Octet 5 Spare Action */
5165 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_action, tvb, offset, 1, ENC_BIG_ENDIAN);
5170 /* Octet 6 to 8 Presence Reporting Area Identifier */
5171 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5175 /* Octet 9 Number of TAI Number of RAI */
5176 /* Octet 10 Spare Number of Macro eNodeB */
5177 /* Octet 11 Spare Number of Home eNodeB */
5178 /* Octet 12 Spare Number of ECGI */
5179 /* Octet 13 Spare Number of SAI */
5180 /* Octet 14 Spare Number of CGI */
5181 /* Octet 15 to k TAIs [1..15] */
5182 /* Octet (k+1) to m Macro eNB IDs [1..63] */
5183 /* Octet (m+1) to p Home eNB IDs [1..63] */
5184 /* Octet (p+1) to q ECGIs [1..63] */
5185 /* Octet (q+1) to r RAIs [1..15] */
5186 /* Octet (r+1) to s SAIs [1..63] */
5187 /* Octet (s+1) to t CGIs [1..63] */
5189 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
5192 * 8.109 Presence Reporting Area Information
5195 dissect_gtpv2_pres_rep_area_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5197 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5200 * 8.110 TWAN Identifier Timestamp
5203 dissect_gtpv2_twan_identifier_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5205 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5208 * 8.111 Overload Control Information
5211 dissect_gtpv2_overload_control_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5213 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5216 * 8.112 Load Control Information
5219 dissect_gtpv2_load_control_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5221 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5227 dissect_gtpv2_metric(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5229 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5232 * 8.114 Sequence Number
5235 dissect_gtpv2_seq_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5237 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5240 * 8.115 APN and Relative Capacity
5243 dissect_gtpv2_apn_and_relative_capacity(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5245 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5248 typedef struct _gtpv2_ie {
5250 void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, guint16, guint8, guint8);
5253 static const gtpv2_ie_t gtpv2_ies[] = {
5254 {GTPV2_IE_IMSI, dissect_gtpv2_imsi}, /* 1, Internal Mobile Subscriber Identity (IMSI) */
5255 {GTPV2_IE_CAUSE, dissect_gtpv2_cause}, /* 2, Cause (without embedded offending IE) 8.4 */
5256 {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery}, /* 3, Recovery (Restart Counter) 8.5 */
5257 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
5258 /*Start SRVCC Messages 3GPP TS 29.280 */
5259 {GTPV2_IE_STN_SR, dissect_gtpv2_stn_sr}, /* 51 STN-SR */
5260 {GTPV2_IE_SRC_TGT_TRANS_CON, dissect_gtpv2_src_tgt_trans_con}, /* 52 Source to Target Transparent Container */
5261 {GTPV2_IE_TGT_SRC_TRANS_CON , dissect_gtpv2_tgt_src_trans_con}, /* 53 Target to Source Transparent Container */
5262 {GTPV2_IE_MM_CON_EUTRAN_SRVCC, dissect_gtpv2_mm_con_eutran_srvcc}, /* 54 MM Context for E-UTRAN SRVCC */
5263 {GTPV2_IE_MM_CON_UTRAN_SRVCC, dissect_gtpv2_mm_con_utran_srvcc}, /* 55 MM Context for UTRAN SRVCC */
5264 {GTPV2_IE_SRVCC_CAUSE, dissect_gtpv2_srvcc_cause}, /* 56 SRVCC Cause */
5265 {GTPV2_IE_TGT_RNC_ID, dissect_gtpv2_tgt_rnc_id}, /* 57 Target RNC ID */
5266 {GTPV2_IE_TGT_GLOGAL_CELL_ID, dissect_gtpv2_tgt_global_cell_id}, /* 58 Target Global Cell ID */
5267 {GTPV2_IE_TEID_C, dissect_gtpv2_teid_c}, /* 59 TEID-C */
5268 {GTPV2_IE_SV_FLAGS, dissect_gtpv2_sv_flags}, /* 60 Sv Flags */
5269 {GTPV2_IE_SAI, dissect_gtpv2_sai}, /* 61 Service Area Identifie */
5270 /* 61-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
5272 {GTPV2_APN, dissect_gtpv2_apn}, /* 71, Access Point Name (APN) 8.6 */
5273 {GTPV2_AMBR, dissect_gtpv2_ambr}, /* 72, Aggregate Maximum Bit Rate (AMBR) */
5274 {GTPV2_EBI, dissect_gtpv2_ebi}, /* 73, EPS Bearer ID (EBI) 8.8 */
5275 {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address}, /* 74, IP Address */
5276 {GTPV2_MEI, dissect_gtpv2_mei}, /* 74, Mobile Equipment Identity */
5277 {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn}, /* 76, MSISDN 8.11 */
5278 {GTPV2_INDICATION, dissect_gtpv2_ind}, /* 77 Indication 8.12 */
5279 {GTPV2_PCO, dissect_gtpv2_pco}, /* 78 Protocol Configuration Options (PCO) 8.13 */
5280 {GTPV2_PAA, dissect_gtpv2_paa}, /* 79 PDN Address Allocation (PAA) 8.14 */
5281 {GTPV2_BEARER_QOS, dissect_gtpv2_bearer_qos}, /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
5282 {GTPV2_IE_FLOW_QOS, dissect_gtpv2_flow_qos}, /* 81 Flow Quality of Service (Flow QoS) 8.16 */
5283 {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type}, /* 82, RAT Type 8.17 */
5284 {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net}, /* 83, Serving Network 8.18 */
5285 {GTPV2_IE_BEARER_TFT, dissect_gtpv2_bearer_tft}, /* 84, Bearer TFT 8.19 */
5286 {GTPV2_IE_TAD, dissect_gtpv2_tad}, /* 85, Traffic Aggregate Description 8.20 */
5287 {GTPV2_IE_ULI, dissect_gtpv2_uli}, /* 86, User Location Info (ULI) 8.22 */
5288 {GTPV2_IE_F_TEID, dissect_gtpv2_f_teid}, /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
5289 {GTPV2_IE_TMSI, dissect_gtpv2_tmsi}, /* 88, TMSI 8.23 */
5290 {GTPV2_IE_GLOBAL_CNID, dissect_gtpv2_g_cn_id}, /* 89, Global CN-Id 8.25 */
5291 {GTPV2_IE_S103PDF, dissect_gtpv2_s103pdf}, /* 90, S103 PDN Data Forwarding Info (S103PDF) 8.25 */
5292 {GTPV2_IE_S1UDF, dissect_gtpv2_s1udf}, /* 91, S1-U Data Forwarding (S1UDF) 8.26 */
5293 {GTPV2_IE_DEL_VAL, dissect_gtpv2_delay_value}, /* 92, Delay Value 8.29 */
5294 {GTPV2_IE_BEARER_CTX, dissect_gtpv2_bearer_ctx}, /* 93, Bearer Context 8.31 */
5295 {GTPV2_IE_CHAR_ID, dissect_gtpv2_charging_id}, /* 94, Charging Id */
5296 {GTPV2_IE_CHAR_CHAR, dissect_gtpv2_char_char}, /* 95 Charging Characteristic */
5297 {GTPV2_IE_TRA_INFO, dissect_gtpv2_tra_info}, /* 96, Trace Information 8.31 */
5298 {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag}, /* 97, Bearer Flag */
5300 {GTPV2_IE_PDN_TYPE, dissect_gtpv2_pdn_type}, /* 99, PDN Type */
5301 {GTPV2_IE_PTI, dissect_gtpv2_pti}, /* 100, Procedure Transaction Id */
5302 {GTPV2_IE_DRX_PARAM, dissect_gtpv2_drx_param}, /* 101, DRX Parameter 8.36 */
5303 {GTPV2_IE_UE_NET_CAPABILITY, dissect_gtpv2_ue_net_capability}, /* 102, UE network capability 8.37 */
5304 {GTPV2_IE_MM_CONTEXT_GSM_T, dissect_gtpv2_mm_context_gsm_t}, /* 103, MM Context 8.38 GSM Key and Triplets */
5305 {GTPV2_IE_MM_CONTEXT_UTMS_CQ, dissect_gtpv2_mm_context_utms_cq}, /* 104, MM Context 8.38 */
5306 {GTPV2_IE_MM_CONTEXT_GSM_CQ, dissect_gtpv2_mm_context_gsm_cq}, /* 105, MM Context 8.38 */
5307 {GTPV2_IE_MM_CONTEXT_UTMS_Q, dissect_gtpv2_mm_context_utms_q}, /* 106, MM Context 8.38 */
5308 {GTPV2_IE_MM_CONTEXT_EPS_QQ, dissect_gtpv2_mm_context_eps_qq}, /* 107, MM Context 8.38 */
5309 {GTPV2_IE_MM_CONTEXT_UTMS_QQ, dissect_gtpv2_mm_context_utms_qq}, /* 108, MM Context 8.38 */
5310 {GTPV2_IE_PDN_CONNECTION, dissect_gtpv2_PDN_conn}, /* 109, PDN Connection */
5311 {GTPV2_IE_PDN_NUMBERS, dissect_gtpv2_pdn_numbers}, /* 110, PDN Numbers 8.40 */
5312 {GTPV2_IE_P_TMSI, dissect_gtpv2_p_tmsi}, /* 111, P-TMSI 8.41 */
5313 {GTPV2_IE_P_TMSI_SIG, dissect_gtpv2_p_tmsi_sig}, /* 112, P-TMSI Signature 8.42 */
5314 {GTPV2_IE_HOP_COUNTER, dissect_gtpv2_hop_counter}, /* 113, Hop Counter 8.43 */
5315 {GTPV2_IE_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone}, /* 114, UE Time Zone */
5316 {GTPV2_IE_TRACE_REFERENCE, dissect_gtpv2_trace_reference}, /* 115, Trace Reference 8.45 */
5317 {GTPV2_IE_COMPLETE_REQUEST_MSG, dissect_complete_request_msg}, /* 116, Complete Request message 8.46 */
5318 {GTPV2_IE_GUTI, dissect_gtpv2_guti}, /* 117, GUTI 8.47 */
5319 {GTPV2_IE_F_CONTAINER, dissect_gtpv2_F_container}, /* 118, Fully Qualified Container (F-Container) */
5320 {GTPV2_IE_F_CAUSE, dissect_gtpv2_F_cause}, /* 119, Fully Qualified Cause (F-Cause) */
5321 {GTPV2_IE_SEL_PLMN_ID, dissect_gtpv2_sel_plmn_id}, /* 120, Selected PLMN ID 8.50 */
5322 {GTPV2_IE_TARGET_ID, dissect_gtpv2_target_id}, /* 121, Target Identification */
5323 /* 122, Void 8.52 */
5324 {GTPV2_IE_PKT_FLOW_ID, dissect_gtpv2_pkt_flow_id}, /* 123, Packet Flow ID 8.53 */
5325 {GTPV2_IE_RAB_CONTEXT, dissect_gtpv2_rab_context}, /* 124, RAB Context 8.54 */
5326 {GTPV2_IE_S_RNC_PDCP_CTX_INFO, dissect_gtpv2_s_rnc_pdcp_ctx_info}, /* 125, Source RNC PDCP context info 8.55 */
5327 {GTPV2_IE_UDP_S_PORT_NR, dissect_udp_s_port_nr}, /* 126, UDP Source Port Number 8.56 */
5328 {GTPV2_IE_APN_RESTRICTION, dissect_gtpv2_apn_rest}, /* 127, APN Restriction */
5329 {GTPV2_IE_SEL_MODE, dissect_gtpv2_selec_mode}, /* 128, Selection Mode */
5330 {GTPV2_IE_SOURCE_IDENT, dissect_gtpv2_source_ident}, /* 129, Source Identification 8.59 */
5331 {GTPV2_IE_BEARER_CONTROL_MODE, dissect_gtpv2_bearer_control_mode}, /* 130, Bearer Control Mode */
5332 {GTPV2_IE_CNG_REP_ACT , dissect_gtpv2_cng_rep_act}, /* 131, Change Reporting Action 8.61 */
5333 {GTPV2_IE_FQ_CSID, dissect_gtpv2_fq_csid}, /* 132, Fully Qualified PDN Connection Set Identifier (FQ-CSID) 8.62 */
5334 {GTPV2_IE_CHANNEL_NEEDED, dissect_gtpv2_channel_needed}, /* 133, Channel Needed 8.63 */
5335 {GTPV2_IE_EMLPP_PRI, dissect_gtpv2_emlpp_pri}, /* 134, eMLPP Priority 8.64 */
5336 {GTPV2_IE_NODE_TYPE , dissect_gtpv2_node_type}, /* 135, Node Type 8.65 */
5337 {GTPV2_IE_FQDN, dissect_gtpv2_fqdn}, /* 136, 8.66 Fully Qualified Domain Name (FQDN) */
5338 {GTPV2_IE_TI, dissect_gtpv2_ti}, /* 137, 8.68 Transaction Identifier (TI) */
5339 {GTPV2_IE_MBMS_SESSION_DURATION, dissect_gtpv2_mbms_session_duration}, /* 138, 8.69 MBMS Session Duration */
5340 {GTPV2_IE_MBMS_SERVICE_AREA, dissect_gtpv2_mbms_service_area}, /* 139, 8.70 MBMS Service Area */
5341 {GTPV2_IE_MBMS_SESSION_ID, dissect_gtpv2_mbms_session_id}, /* 140, 8.71 MBMS Session Identifier */
5342 {GTPV2_IE_MBMS_FLOW_ID, dissect_gtpv2_mbms_flow_id}, /* 141, 8.72 MBMS Flow Identifier */
5343 {GTPV2_IE_MBMS_IP_MC_DIST, dissect_gtpv2_mbms_ip_mc_dist}, /* 142, 8.73 MBMS IP Multicast Distribution */
5344 {GTPV2_IE_MBMS_DIST_ACK, dissect_gtpv2_mbms_dist_ack}, /* 143, 8.74 MBMS Distribution Acknowledge */
5345 {GTPV2_IE_RFSP_INDEX, dissect_gtpv2_rfsp_index}, /* 144, 8.77 RFSP Index */
5346 {GTPV2_IE_UCI, dissect_gtpv2_uci}, /* 145, 8.75 User CSG Information (UCI) */
5347 {GTPV2_IE_CSG_INFO_REP_ACTION, dissect_gtpv2_csg_info_rep_action}, /* 146, 8.76 CSG Information Reporting Action */
5348 {GTPV2_IE_CSG_ID, dissect_gtpv2_csg_id}, /* 147, 8.78 CSG ID */
5349 {GTPV2_IE_CMI, dissect_gtpv2_cmi}, /* 148, 8.79 CSG Membership Indication (CMI) */
5350 {GTPV2_IE_SERVICE_INDICATOR, dissect_gtpv2_service_indicator}, /* 149, 8.80 Service indicator */
5351 {GTPV2_IE_DETACH_TYPE, dissect_gtpv2_detach_type}, /* 150, 8.81 Detach Type */
5352 {GTPV2_IE_LDN, dissect_gtpv2_ldn}, /* 151, 8.82 Local Distinguished Name (LDN) */
5353 {GTPV2_IE_NODE_FEATURES, dissect_gtpv2_node_features}, /* 152, 8.83 Node Features */
5354 {GTPV2_IE_MBMS_TIME_TO_DATA_XFER, dissect_gtpv2_mbms_time_to_data_xfer}, /* 153, 8.84 MBMS Time to Data Transfer */
5355 {GTPV2_IE_THROTTLING, dissect_gtpv2_throttling}, /* 154, 8.85 Throttling */
5356 {GTPV2_IE_ARP, dissect_gtpv2_arp}, /* 155, 8.86 Allocation/Retention Priority (ARP) */
5357 {GTPV2_IE_EPC_TIMER, dissect_gtpv2_epc_timer}, /* 156, 8.87 EPC Timer */
5358 {GTPV2_IE_SIG_PRIO_IND, dissect_gtpv2_sig_prio_ind}, /* 157, 8.88 Signalling Priority Indication */
5359 {GTPV2_IE_TMGI, dissect_gtpv2_tmgi}, /* 158, 8.89 Temporary Mobile Group Identity (TMGI) */
5360 {GTPV2_IE_ADD_MM_CONT_FOR_SRVCC, dissect_gtpv2_add_mm_cont_for_srvcc}, /* 159, 8.90 Additional MM context for SRVCC */
5361 {GTPV2_IE_ADD_FLAGS_FOR_SRVCC, dissect_gtpv2_add_flags_for_srvcc}, /* 160, 8.91 Additional flags for SRVCC */
5362 {GTPV2_IE_MMBR, dissect_gtpv2_mmbr}, /* 161, 8.92 Max MBR/APN-AMBR (MMBR) */
5363 {GTPV2_IE_MDT_CONFIG, dissect_gtpv2_mdt_config}, /* 162, 8.93 MDT Configuration */
5364 {GTPV2_IE_APCO, dissect_gtpv2_apco}, /* 163, 8.94 Additional Protocol Configuration Options (APCO) */
5365 {GTPV2_IE_ABS_MBMS_DATA_TF_TIME, dissect_gtpv2_abs_mbms_data_tf_time}, /* 164, 8.95 Absolute Time of MBMS Data Transfer */
5366 {GTPV2_IE_HENB_INFO_REPORT, dissect_gtpv2_henb_info_report}, /* 165, 8.96 H(e)NB Information Reporting */
5367 {GTPV2_IE_IP4CP, dissect_gtpv2_ip4cp}, /* 166, 8.97 IPv4 Configuration Parameters (IPv4CP) */
5368 {GTPV2_IE_CHANGE_TO_REPORT_FLAGS, dissect_gtpv2_change_report_flags}, /* 167, 8.98 Change to Report Flags */
5369 {GTPV2_IE_ACTION_INDICATION, dissect_gtpv2_action_indication}, /* 168, 8.99 Action Indication */
5370 {GTPV2_IE_TWAN_IDENTIFIER, dissect_gtpv2_twan_Identifier}, /* 169, 8.100 TWAN Identifier */
5371 {GTPV2_IE_ULI_TIMESTAMP, dissect_gtpv2_uli_timestamp}, /* 170, 8.101 ULI Timestamp */
5372 {GTPV2_IE_MBMS_FLAGS, dissect_gtpv2_mbms_flags}, /* 171, 8.102 MBMS Flags */
5373 {GTPV2_IE_RAN_NAS_CAUSE, dissect_gtpv2_ran_nas_cause}, /* 172, 8.103 RAN/NAS Cause */
5374 {GTPV2_IE_CN_OP_SEL_ENT, dissect_gtpv2_cn_operator_selection_entity}, /* 173, 8.104 CN Operator Selection Entity */
5375 {GTPV2_IE_TRUST_WLAN_MODE_IND, dissect_gtpv2_trust_wlan_mode_ind}, /* 174, 8.105 Trusted WLAN Mode Indication */
5376 {GTPV2_IE_NODE_NUMBER, dissect_gtpv2_node_number}, /* 175, 8.106 Node Number */
5377 {GTPV2_IE_NODE_IDENTIFIER, dissect_gtpv2_node_identifier}, /* 176, 8.107 Node Identifier */
5378 {GTPV2_IE_PRES_REP_AREA_ACT, dissect_gtpv2_pres_rep_area_action}, /* 177, 8.108 Presence Reporting Area Action */
5379 {GTPV2_IE_PRES_REP_AREA_INF, dissect_gtpv2_pres_rep_area_information}, /* 178, 8.109 Presence Reporting Area Information */
5380 {GTPV2_IE_TWAN_ID_TS, dissect_gtpv2_twan_identifier_timestamp}, /* 179, 8.110 TWAN Identifier Timestamp */
5381 {GTPV2_IE_OVERLOAD_CONTROL_INF, dissect_gtpv2_overload_control_inf}, /* 180, 8.111 Overload Control Information */
5382 {GTPV2_IE_LOAD_CONTROL_INF, dissect_gtpv2_load_control_inf}, /* 181, 8.112 Load Control Information */
5383 {GTPV2_IE_METRIC, dissect_gtpv2_metric}, /* 182, 8.113 Metric */
5384 {GTPV2_IE_SEQ_NO, dissect_gtpv2_seq_no}, /* 183, 8.114 Sequence Number */
5385 {GTPV2_IE_APN_AND_REL_CAP, dissect_gtpv2_apn_and_relative_capacity}, /* 184, 8.115 APN and Relative Capacity */
5387 {GTPV2_IE_PRIVATE_EXT, dissect_gtpv2_private_ext},
5389 {0, dissect_gtpv2_unknown}
5393 dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint offset, guint8 message_type)
5395 proto_tree *ie_tree;
5398 guint8 type, instance;
5402 * Octets 8 7 6 5 4 3 2 1
5405 * 4 CR Spare Instance
5406 * 5-(n+4) IE specific data
5408 while (offset < (gint)tvb_reported_length(tvb)) {
5409 /* Get the type and length */
5411 type = tvb_get_guint8(tvb, offset);
5412 length = tvb_get_ntohs(tvb, offset + 1);
5413 ie_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4 + length, ett_gtpv2_ie, &ti, "%s : ",
5414 val_to_str_ext_const(type, >pv2_element_type_vals_ext, "Unknown"));
5417 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
5421 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
5423 /* CR Spare Instance Octet 4*/
5424 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, ENC_BIG_ENDIAN);
5426 instance = tvb_get_guint8(tvb, offset) & 0x0f;
5427 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
5430 /* TODO: call IE dissector here */
5431 if (type == GTPV2_IE_RESERVED) {
5432 /* Treat IE type zero specal as type zero is used to end the loop in the else branch */
5433 proto_tree_add_text(ie_tree, tvb, offset, length, "IE type Zero is Reserved and should not be used");
5436 /* Loop over the IE dissector list to se if we find an entry;
5437 the last entry will have ie_type=0 breaking the loop */
5438 while (gtpv2_ies[++i].ie_type) {
5439 if (gtpv2_ies[i].ie_type == type)
5442 /* Just give the IE dissector the IE */
5443 ie_tvb = tvb_new_subset_remaining(tvb, offset);
5444 (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, message_type, instance);
5452 dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
5454 proto_tree *gtpv2_tree, *flags_tree;
5456 guint8 message_type, t_flag, p_flag;
5462 /* Currently we get called from the GTP dissector no need to check the version */
5463 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
5464 col_clear(pinfo->cinfo, COL_INFO);
5466 /* message type is in octet 2 */
5467 message_type = tvb_get_guint8(tvb, 1);
5468 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
5471 p_flag = (tvb_get_guint8(tvb, offset) & 0x10) >> 4;
5472 msg_length = tvb_get_ntohs(tvb, offset + 2);
5473 proto_tree_add_item(tree, proto_gtpv2, tvb, offset, msg_length + 4, ENC_NA);
5476 gtpv2_tree = proto_tree_add_subtree(tree, tvb, offset, msg_length + 4, ett_gtpv2, NULL,
5477 val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
5479 /* Control Plane GTP uses a variable length header. Control Plane GTP header
5480 * length shall be a multiple of 4 octets.
5481 * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
5482 * Bits 8 7 6 5 4 3 2 1
5483 * Octets 1 Version P T Spare Spare Spare
5485 * 3 Message Length (1st Octet)
5486 * 4 Message Length (2nd Octet)
5487 * m-k(m+3) If T flag is set to 1, then TEID shall be placed into octets 5-8.
5488 * Otherwise, TEID field is not present at all.
5489 * n-(n+2) Sequence Number
5491 * Figure 5.1-1: General format of GTPv2 Header for Control Plane
5493 tf = proto_tree_add_item(gtpv2_tree, hf_gtpv2_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
5494 flags_tree = proto_item_add_subtree(tf, ett_gtpv2_flags);
5497 t_flag = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
5498 proto_tree_add_item(flags_tree, hf_gtpv2_version, tvb, offset, 1, ENC_BIG_ENDIAN);
5499 proto_tree_add_item(flags_tree, hf_gtpv2_p, tvb, offset, 1, ENC_BIG_ENDIAN);
5500 proto_tree_add_item(flags_tree, hf_gtpv2_t, tvb, offset, 1, ENC_BIG_ENDIAN);
5504 proto_tree_add_item(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5507 proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5511 /* Tunnel Endpoint Identifier 4 octets */
5512 proto_tree_add_item(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
5515 /* Sequence Number 3 octets */
5516 proto_tree_add_item(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 3, ENC_BIG_ENDIAN);
5520 proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5524 msg_tvb = tvb_new_subset_length(tvb, 0, msg_length + 4);
5525 dissect_gtpv2_ie_common(msg_tvb, pinfo, gtpv2_tree, offset, message_type);
5527 dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset, message_type);
5530 /* Bit 5 represents a "P" flag. If the "P" flag is set to "0",
5531 * no piggybacked message shall be present. If the "P" flag is set to "1",
5532 * then another GTPv2-C message with its own header and body shall be present
5533 * at the end of the current message.
5536 tvbuff_t *new_p_tvb;
5537 /* Octets 3 to 4 represent the Length field. This field shall indicate the
5538 * length of the message in octets excluding the
5539 * mandatory part of the GTP-C header (the first 4 octets).
5541 new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
5542 col_append_str(pinfo->cinfo, COL_INFO, " / ");
5543 col_set_fence(pinfo->cinfo, COL_INFO);
5544 dissect_gtpv2(new_p_tvb, pinfo, tree);
5550 void proto_register_gtpv2(void)
5552 static hf_register_info hf_gtpv2[] = {
5553 { &hf_gtpv2_reserved,
5554 {"Reserved bit(s)", "gtpv2.reserved",
5555 FT_UINT8, BASE_DEC, NULL, 0x0,
5558 { &hf_gtpv2_spare_half_octet,
5559 {"Spare half octet", "gtpv2.spare_half_octet",
5560 FT_UINT8, BASE_DEC, NULL, 0x0,
5563 { &hf_gtpv2_spare_bits,
5564 {"Spare bit(s)", "gtpv2.spare_bits",
5565 FT_UINT8, BASE_DEC, NULL, 0x0,
5569 {"Flags", "gtpv2.flags",
5570 FT_UINT8, BASE_HEX, NULL, 0x0,
5574 {"Version", "gtpv2.version",
5575 FT_UINT8, BASE_DEC, NULL, 0xe0,
5579 {"Piggybacking flag (P)", "gtpv2.p",
5580 FT_UINT8, BASE_DEC, NULL, 0x10,
5581 "If Piggybacked message is present or not", HFILL}
5584 {"TEID flag (T)", "gtpv2.t",
5585 FT_UINT8, BASE_DEC, NULL, 0x08,
5586 "If TEID field is present or not", HFILL}
5588 { &hf_gtpv2_message_type,
5589 {"Message Type", "gtpv2.message_type",
5590 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_message_type_vals_ext, 0x0,
5593 { &hf_gtpv2_msg_length,
5594 {"Message Length", "gtpv2.msg_lengt",
5595 FT_UINT16, BASE_DEC, NULL, 0x0,
5599 {"Tunnel Endpoint Identifier", "gtpv2.teid",
5600 FT_UINT32, BASE_DEC, NULL, 0x0,
5604 {"Sequence Number", "gtpv2.seq",
5605 FT_UINT32, BASE_DEC, NULL, 0x0,
5609 {"Spare", "gtpv2.spare",
5610 FT_UINT16, BASE_DEC, NULL, 0x0,
5614 {"IE Type", "gtpv2.ie_type",
5615 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
5619 {"IE Length", "gtpv2.ie_len",
5620 FT_UINT16, BASE_DEC, NULL, 0x0,
5621 "length of the information element excluding the first four octets", HFILL}
5624 {"CR flag", "gtpv2.cr",
5625 FT_UINT8, BASE_DEC, NULL, 0xf0, /* SRVCC */
5628 { &hf_gtpv2_instance,
5629 {"Instance", "gtpv2.instance",
5630 FT_UINT8, BASE_DEC, NULL, 0x0f,
5633 { &hf_gtpv2_ipv4_addr,
5634 {"IPv4 Address", "gtpv2.ipv4_addr",
5635 FT_IPv4, BASE_NONE, NULL, 0x0,
5639 {"Cause", "gtpv2.cause",
5640 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_vals_ext, 0x0,
5643 {&hf_gtpv2_cause_cs,
5644 {"CS (Cause Source)", "gtpv2.cs",
5645 FT_BOOLEAN, 8, TFS(>pv2_cause_cs), 0x01,
5648 { &hf_gtpv2_cause_bce,
5649 {"BCE (Bearer Context IE Error)", "gtpv2.bce",
5650 FT_BOOLEAN, 8, NULL, 0x02,
5653 { &hf_gtpv2_cause_pce,
5654 {"PCE (PDN Connection IE Error)", "gtpv2.pce",
5655 FT_BOOLEAN, 8, NULL, 0x04,
5658 { &hf_gtpv2_cause_off_ie_t,
5659 {"Type of the offending IE", "gtpv2.cause_off_ie_t",
5660 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
5664 {"Restart Counter", "gtpv2.rec",
5665 FT_UINT8, BASE_DEC, NULL, 0x0,
5668 /*Start SRVCC Messages*/
5670 {"STN-SR", "gtpv2.stn_sr",
5671 FT_BYTES, BASE_NONE, NULL, 0x0,
5674 { &hf_gtpv2_len_trans_con,
5675 {"Length of the Transparent Container", "gtpv2.len_trans_con",
5676 FT_UINT8, BASE_DEC, NULL, 0x0,
5680 {"eKSI", "gtpv2.eksi",
5681 FT_UINT8, BASE_DEC, NULL, 0x07,
5686 FT_BYTES, BASE_NONE, NULL, 0x0,
5691 FT_BYTES, BASE_NONE, NULL, 0x0,
5694 { &hf_gtpv2_len_ms_classmark2,
5695 {"Length of Mobile Station Classmark2", "gtpv2.len_ms_classmark2",
5696 FT_UINT8, BASE_DEC, NULL, 0x0,
5699 { &hf_gtpv2_len_ms_classmark3,
5700 {"Length of Mobile Station Classmark3", "gtpv2.len_ms_classmark3",
5701 FT_UINT8, BASE_DEC, NULL, 0x0,
5704 { &hf_gtpv2_len_supp_codec_list,
5705 {"Length of Supported Codec List", "gtpv2.len_supp_codec_list",
5706 FT_UINT8, BASE_DEC, NULL, 0x0,
5710 {"KSI'cs", "gtpv2.ksi",
5711 FT_UINT8, BASE_DEC, NULL, 0x0F,
5715 {"CKSN'", "gtpv2.cksn",
5716 FT_UINT8, BASE_DEC, NULL, 0x0,
5719 { &hf_gtpv2_srvcc_cause,
5720 {"SRVCC Cause", "gtpv2.srvcc_cause",
5721 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_srvcc_cause_vals_ext, 0x0,
5725 { "Routing Area Code (RAC)", "gtpv2.rac",
5726 FT_UINT8, BASE_DEC, NULL, 0,
5727 "Routing Area Code", HFILL}
5731 {"RNC ID", "gtpv2.rnc_id",
5732 FT_UINT16, BASE_DEC, NULL, 0x0,
5735 { &hf_gtpv2_ext_rnc_id,
5736 {"Extended RNC-ID", "gtpv2.ext_rnc_id",
5737 FT_UINT16, BASE_DEC, NULL, 0x0,
5741 { "Location Area Code (LAC)", "gtpv2.lac",
5742 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
5746 { "Service Area Code (SAC)", "gtpv2.sac",
5747 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
5750 { &hf_gtpv2_tgt_g_cell_id,
5751 {"Cell ID", "gtpv2.tgt_g_cell_id",
5752 FT_UINT16, BASE_DEC, NULL, 0x0,
5756 {"Tunnel Endpoint Identifier for Control Plane(TEID-C)", "gtpv2.teid_c",
5757 FT_UINT32, BASE_DEC, NULL, 0x0,
5761 {"STI (Session Transfer Indicator)", "gtpv2.sv_sti",
5762 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5765 {"ICS (IMS Centralized Service)", "gtpv2.sv_ics",
5766 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5768 {&hf_gtpv2_sv_emind,
5769 {"EmInd(Emergency Indicator)", "gtpv2.sv_emind",
5770 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5773 /*End SRVCC Messages*/
5775 {"APN (Access Point Name)", "gtpv2.apn",
5776 FT_STRING, BASE_NONE, NULL, 0x0,
5780 {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
5781 FT_UINT32, BASE_DEC, NULL, 0x0,
5784 {&hf_gtpv2_ambr_down,
5785 {"AMBR Downlink(Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
5786 FT_UINT32, BASE_DEC, NULL, 0x0,
5790 {"EPS Bearer ID (EBI)", "gtpv2.ebi",
5791 FT_UINT8, BASE_DEC, NULL, 0x0f,
5794 { &hf_gtpv2_ip_address_ipv4,
5795 {"IP address IPv4", "gtpv2.ip_address_ipv4",
5796 FT_IPv4, BASE_NONE, NULL, 0x0,
5799 { &hf_gtpv2_ip_address_ipv6,
5800 {"IP address IPv6", "gtpv2.ip_address_ipv6",
5801 FT_IPv6, BASE_NONE, NULL, 0x0,
5805 {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
5806 FT_STRING, BASE_NONE, NULL, 0,
5809 { &hf_gtpv2_pdn_numbers_nsapi,
5810 {"NSAPI", "gtpv2.pdn_numbers_nsapi",
5811 FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}
5814 {"Packet TMSI (P-TMSI)", "gtpv2.p_tmsi",
5815 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
5817 { &hf_gtpv2_p_tmsi_sig,
5818 {"P-TMSI Signature", "gtpv2.p_tmsi_sig",
5819 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
5822 {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
5823 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5826 {"DTF (Direct Tunnel Flag)", "gtpv2.dtf",
5827 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5830 {"HI (Handover Indication)", "gtpv2.hi",
5831 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5834 {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
5835 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5838 {"OI (Operation Indication)", "gtpv2.oi",
5839 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5842 {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
5843 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5846 {"ISRAI (Idle mode Signalling Reduction Activation Indication)", "gtpv2.israi",
5847 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5850 {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
5851 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5854 {"SQCI (Subscribed QoS Change Indication", "gtpv2.sqci",
5855 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5858 {"UIMSI (Unauthenticated IMSI)", "gtpv2.uimsi",
5859 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5862 {"CFSI (Change F-TEID support indication)", "gtpv2.cfsi",
5863 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5866 {"CRSI (Change Reporting support indication):", "gtpv2.crsi",
5867 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5870 {"PS (Piggybacking Supported).)", "gtpv2.ps",
5871 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5874 {"PT (Protocol Type)", "gtpv2.pt",
5875 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5878 {"SI (Scope Indication)", "gtpv2.si",
5879 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5882 {"MSV (MS Validated)", "gtpv2.msv",
5883 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5886 {"Spare", "gtpv2.spare",
5887 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
5890 {"Spare", "gtpv2.spare",
5891 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
5894 {"Spare", "gtpv2.spare",
5895 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
5898 {"S6AF (Static IPv6 Address Flag)", "gtpv2.s6af",
5899 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
5902 {"S4AF (Static IPv4 Address Flag))", "gtpv2.s4af",
5903 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
5906 {"MBMDT (Management Based MDT allowed flag)", "gtpv2.mbmdt",
5907 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
5910 {"ISRAU (ISR is activated for the UE)", "gtpv2.israu",
5911 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
5914 {"CCRSI (CSG Change Reporting support indication)", "gtpv2.ccrsi",
5915 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
5917 { &hf_gtpv2_pdn_type,
5918 {"PDN Type", "gtpv2.pdn_type",
5919 FT_UINT8, BASE_DEC, VALS(gtpv2_pdn_type_vals), 0x07,
5923 { &hf_gtpv2_tra_info,
5924 {"Trace ID", "gtpv2.tra_info",
5925 FT_STRING, BASE_NONE, NULL, 0x0,
5929 { &hf_gtpv2_tra_info_msc_momt_calls,
5930 {"MO and MT calls", "gtpv2.tra_info_msc_momt_calls",
5931 FT_UINT8, BASE_DEC, NULL, 0x01,
5932 "MSC Server", HFILL}
5934 { &hf_gtpv2_tra_info_msc_momt_sms,
5935 {"MO and MT SMS", "gtpv2.tra_info_msc_momt_sms",
5936 FT_UINT8, BASE_DEC, NULL, 0x02,
5937 "MSC Server", HFILL}
5939 { &hf_gtpv2_tra_info_msc_lu_imsi_ad,
5940 {"LU, IMSI attach, IMSI detach", "gtpv2.tra_info_msc_lu_imsi_ad",
5941 FT_UINT8, BASE_DEC, NULL, 0x04,
5942 "MSC Server", HFILL}
5944 { &hf_gtpv2_tra_info_msc_handovers,
5945 {"Handovers", "gtpv2.tra_info_msc_handovers",
5946 FT_UINT8, BASE_DEC, NULL, 0x08,
5947 "MSC Server", HFILL}
5949 { &hf_gtpv2_tra_info_msc_ss,
5950 {"SS", "gtpv2.tra_info_msc_ss",
5951 FT_UINT8, BASE_DEC, NULL, 0x10,
5952 "MSC Server", HFILL}
5954 { &hf_gtpv2_tra_info_mgw_context,
5955 {"Context", "gtpv2.tra_info_mgw_context",
5956 FT_UINT8, BASE_DEC, NULL, 0x01,
5959 { &hf_gtpv2_tra_info_sgsn_pdp_context,
5960 {"PDP context", "gtpv2.tra_info_sgsn_pdp_context",
5961 FT_UINT8, BASE_DEC, NULL, 0x01,
5964 { &hf_gtpv2_tra_info_sgsn_momt_sms,
5965 {"MO and MT SMS", "gtpv2.tra_info_sgsn_momt_sms",
5966 FT_UINT8, BASE_DEC, NULL, 0x02,
5969 { &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
5970 {"RAU, GPRS attach, GPRS detach", "gtpv2.tra_info_sgsn_rau_gprs_ad",
5971 FT_UINT8, BASE_DEC, NULL, 0x04,
5974 { &hf_gtpv2_tra_info_sgsn_mbms,
5975 {"MBMS Context", "gtpv2.tra_into_sgsn_mbms",
5976 FT_UINT8, BASE_DEC, NULL, 0x08,
5979 { &hf_gtpv2_tra_info_sgsn_reserved,
5980 {"Reserved", "gtpv2.",
5981 FT_UINT8, BASE_DEC, NULL, 0x0,
5984 { &hf_gtpv2_tra_info_ggsn_pdp,
5985 {"PDP Cpntext", "gtpv2.tra_info_ggsn_pdp",
5986 FT_UINT8, BASE_DEC, NULL, 0x01,
5989 { &hf_gtpv2_tra_info_ggsn_mbms,
5990 {"MBMS Context", "gtpv2.tra_info_ggsn_mbms",
5991 FT_UINT8, BASE_DEC, NULL, 0x02,
5994 { &hf_gtpv2_tra_info_bm_sc,
5995 {"MBMS Multicast service activation", "gtpv2.tra_info_bm_sc",
5996 FT_UINT8, BASE_DEC, NULL, 0x01,
5999 { &hf_gtpv2_tra_info_mme_sgw_ss,
6000 {"Session setup", "gtpv2.tra_info_mme_sgw_ss",
6001 FT_UINT8, BASE_DEC, NULL, 0x01,
6004 { &hf_gtpv2_tra_info_mme_sgw_sr,
6005 {"Service Request", "gtpv2.tra_info_mme_sgw_sr",
6006 FT_UINT8, BASE_DEC, NULL, 0x02,
6009 { &hf_gtpv2_tra_info_mme_sgw_iataud,
6010 {"Initial Attach, Tracking area update, Detach", "gtpv2.tra_info_mme_sgw_iataud",
6011 FT_UINT8, BASE_DEC, NULL, 0x04,
6014 { &hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc,
6015 {"UE initiated PDN disconnection", "gtpv2.tra_info_mme_sgw_ue_init_pdn_disc",
6016 FT_UINT8, BASE_DEC, NULL, 0x08,
6019 { &hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del,
6020 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_mme_sgw_bearer_act_mod_del",
6021 FT_UINT8, BASE_DEC, NULL, 0x10,
6024 { &hf_gtpv2_tra_info_mme_sgw_ho,
6025 {"Handover", "gtpv2.tra_info_mme_sgw_ho",
6026 FT_UINT8, BASE_DEC, NULL, 0x20,
6029 { &hf_gtpv2_tra_info_sgw_pdn_con_creat,
6030 {"PDN Connection creation", "gtpv2.tra_info_sgw_pdn_con_creat",
6031 FT_UINT8, BASE_DEC, NULL, 0x01,
6034 { &hf_gtpv2_tra_info_sgw_pdn_con_term,
6035 {"PDN connection termination", "gtpv2.tra_info_sgw_pdn_con_term",
6036 FT_UINT8, BASE_DEC, NULL, 0x02,
6039 { &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
6040 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_sgw_bearer_act_mod_del",
6041 FT_UINT8, BASE_DEC, NULL, 0x04,
6044 { &hf_gtpv2_tra_info_pgw_pdn_con_creat,
6045 {"PDN Connection creation", "gtpv2.tra_info_pgw_pdn_con_creat",
6046 FT_UINT8, BASE_DEC, NULL, 0x10,
6049 { &hf_gtpv2_tra_info_pgw_pdn_con_term,
6050 {"PDN connection termination", "gtpv2.tra_info_pgw_pdn_con_term",
6051 FT_UINT8, BASE_DEC, NULL, 0x20,
6054 { &hf_gtpv2_tra_info_pgw_bearer_act_mod_del,
6055 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_pgw_bearer_act_mod_del",
6056 FT_UINT8, BASE_DEC, NULL, 0x40,
6059 { &hf_gtpv2_tra_info_lne_msc_s,
6060 {"MSC-S", "gtpv2.tra_info_lne_msc_s",
6061 FT_UINT8, BASE_DEC, NULL, 0x01,
6062 "List of NE Types", HFILL}
6064 { &hf_gtpv2_tra_info_lne_mgw,
6065 {"MGW", "gtpv2.tra_info_lne_mgw",
6066 FT_UINT8, BASE_DEC, NULL, 0x02,
6067 "List of NE Types", HFILL}
6069 { &hf_gtpv2_tra_info_lne_sgsn,
6070 {"SGSN", "gtpv2.tra_info_lne_sgsn",
6071 FT_UINT8, BASE_DEC, NULL, 0x04,
6072 "List of NE Types", HFILL}
6074 { &hf_gtpv2_tra_info_lne_ggsn,
6075 {"GGSN", "gtpv2.tra_info_lne_ggsn",
6076 FT_UINT8, BASE_DEC, NULL, 0x08,
6077 "List of NE Types", HFILL}
6079 { &hf_gtpv2_tra_info_lne_rnc,
6080 {"RNC", "gtpv2.tra_info_lne_rnc",
6081 FT_UINT8, BASE_DEC, NULL, 0x10,
6082 "List of NE Types", HFILL}
6084 { &hf_gtpv2_tra_info_lne_bm_sc,
6085 {"BM-SC", "gtpv2.tra_info_lne_bm_sc",
6086 FT_UINT8, BASE_DEC, NULL, 0x20,
6087 "List of NE Types", HFILL}
6089 { &hf_gtpv2_tra_info_lne_mme,
6090 {"MME", "gtpv2.tra_info_lne_mme",
6091 FT_UINT8, BASE_DEC, NULL, 0x40,
6092 "List of NE Types", HFILL}
6094 { &hf_gtpv2_tra_info_lne_sgw,
6095 {"SGW", "gtpv2.tra_info_lne_sgw",
6096 FT_UINT8, BASE_DEC, NULL, 0x80,
6097 "List of NE Types", HFILL}
6099 { &hf_gtpv2_tra_info_lne_pdn_gw,
6100 {"PDN GW", "gtpv2.tra_info_lne_pdn_gw",
6101 FT_UINT8, BASE_DEC, NULL, 0x01,
6102 "List of NE Types", HFILL}
6104 { &hf_gtpv2_tra_info_lne_enb,
6105 {"eNB", "gtpv2.tra_info_lne_enb",
6106 FT_UINT8, BASE_DEC, NULL, 0x02,
6107 "List of NE Types", HFILL}
6109 { &hf_gtpv2_tra_info_tdl,
6110 {"Trace Depth Length", "gtpv2.tra_info_tdl",
6111 FT_UINT8, BASE_DEC, NULL, 0x0,
6114 { &hf_gtpv2_tra_info_lmsc_a,
6115 {"A", "gtpv2.tra_info_lmsc_a",
6116 FT_UINT8, BASE_DEC, NULL, 0x01,
6117 "MSC Server", HFILL}
6119 { &hf_gtpv2_tra_info_lmsc_lu,
6120 {"Iu", "gtpv2.tra_info_lmsc_lu",
6121 FT_UINT8, BASE_DEC, NULL, 0x02,
6122 "MSC Server", HFILL}
6124 { &hf_gtpv2_tra_info_lmsc_mc,
6125 {"Mc", "gtpv2.tra_info_lmsc_mc",
6126 FT_UINT8, BASE_DEC, NULL, 0x04,
6127 "MSC Server", HFILL}
6129 { &hf_gtpv2_tra_info_lmsc_map_g,
6130 {"MAP-G", "gtpv2.tra_info_lmsc_map_g",
6131 FT_UINT8, BASE_DEC, NULL, 0x08,
6132 "MSC Server", HFILL}
6134 { &hf_gtpv2_tra_info_lmsc_map_b,
6135 {"MAP-B", "gtpv2.tra_info_lmsc_map_b",
6136 FT_UINT8, BASE_DEC, NULL, 0x10,
6137 "MSC Server", HFILL}
6139 { &hf_gtpv2_tra_info_lmsc_map_e,
6140 {"MAP-E", "gtpv2.tra_info_lmsc_map_e",
6141 FT_UINT8, BASE_DEC, NULL, 0x20,
6142 "MSC Server", HFILL}
6144 { &hf_gtpv2_tra_info_lmsc_map_f,
6145 {"MAP-F", "gtpv2.tra_info_lmsc_map_f",
6146 FT_UINT8, BASE_DEC, NULL, 0x40,
6147 "MSC Server", HFILL}
6149 { &hf_gtpv2_tra_info_lmsc_cap,
6150 {"CAP", "gtpv2.tra_info_lmsc_cap",
6151 FT_UINT8, BASE_DEC, NULL, 0x80,
6152 "MSC Server", HFILL}
6154 { &hf_gtpv2_tra_info_lmsc_map_d,
6155 {"MAP-D", "gtpv2.tra_info_lmsc_map_d",
6156 FT_UINT8, BASE_DEC, NULL, 0x01,
6157 "MSC Server", HFILL}
6159 { &hf_gtpv2_tra_info_lmsc_map_c,
6160 {"MAP-C", "gtpv2.tra_info_lmsc_map_c",
6161 FT_UINT8, BASE_DEC, NULL, 0x02,
6162 "MSC Server", HFILL}
6164 { &hf_gtpv2_tra_info_lmgw_mc,
6165 {"Mc", "gtpv2.tra_info_lmgw_mc",
6166 FT_UINT8, BASE_DEC, NULL, 0x01,
6169 { &hf_gtpv2_tra_info_lmgw_nb_up,
6170 {"Nb-UP", "gtpv2.tra_info_lmgw_nb_up",
6171 FT_UINT8, BASE_DEC, NULL, 0x2,
6174 { &hf_gtpv2_tra_info_lmgw_lu_up,
6175 {"Iu-UP", "gtpv2.tra_info_lmgw_lu_up",
6176 FT_UINT8, BASE_DEC, NULL, 0x04,
6179 { &hf_gtpv2_tra_info_lsgsn_gb,
6180 {"Gb", "gtpv2.tra_info_lsgsn_gb",
6181 FT_UINT8, BASE_DEC, NULL, 0x01,
6184 { &hf_gtpv2_tra_info_lsgsn_lu,
6185 {"Iu", "gtpv2.tra_info_lsgsn_lu",
6186 FT_UINT8, BASE_DEC, NULL, 0x02,
6189 { &hf_gtpv2_tra_info_lsgsn_gn,
6190 {"Gn", "gtpv2.tra_info_lsgsn_gn",
6191 FT_UINT8, BASE_DEC, NULL, 0x04,
6194 { &hf_gtpv2_tra_info_lsgsn_map_gr,
6195 {"MAP-Gr", "gtpv2.tra_info_lsgsn_map_gr",
6196 FT_UINT8, BASE_DEC, NULL, 0x08,
6199 { &hf_gtpv2_tra_info_lsgsn_map_gd,
6200 {"MAP-Gd", "gtpv2.tra_info_lsgsn_map_gd",
6201 FT_UINT8, BASE_DEC, NULL, 0x10,
6204 { &hf_gtpv2_tra_info_lsgsn_map_gf,
6205 {"MAP-Gf", "gtpv2.tra_info_lsgsn_map_gf",
6206 FT_UINT8, BASE_DEC, NULL, 0x20,
6209 { &hf_gtpv2_tra_info_lsgsn_gs,
6210 {"Gs", "gtpv2.tra_info_lsgsn_gs",
6211 FT_UINT8, BASE_DEC, NULL, 0x40,
6214 { &hf_gtpv2_tra_info_lsgsn_ge,
6215 {"Ge", "gtpv2.tra_info_lsgsn_ge",
6216 FT_UINT8, BASE_DEC, NULL, 0x80,
6219 { &hf_gtpv2_tra_info_lggsn_gn,
6220 {"Gn", "gtpv2.tra_info_lggsn_gn",
6221 FT_UINT8, BASE_DEC, NULL, 0x01,
6224 { &hf_gtpv2_tra_info_lggsn_gi,
6225 {"Gi", "gtpv2.tra_info_lggsn_gi",
6226 FT_UINT8, BASE_DEC, NULL, 0x02,
6229 { &hf_gtpv2_tra_info_lggsn_gmb,
6230 {"Gmb", "gtpv2.tra_info_lggsn_gmb",
6231 FT_UINT8, BASE_DEC, NULL, 0x04,
6234 { &hf_gtpv2_tra_info_lrnc_lu,
6235 {"Iu", "gtpv2.tra_info_lrnc_lu",
6236 FT_UINT8, BASE_DEC, NULL, 0x01,
6239 { &hf_gtpv2_tra_info_lrnc_lur,
6240 {"Iur", "gtpv2.tra_info_lrnc_lur",
6241 FT_UINT8, BASE_DEC, NULL, 0x02,
6244 { &hf_gtpv2_tra_info_lrnc_lub,
6245 {"Iub", "gtpv2.tra_info_lrnc_lub",
6246 FT_UINT8, BASE_DEC, NULL, 0x04,
6249 { &hf_gtpv2_tra_info_lrnc_uu,
6250 {"Uu", "gtpv2.tra_info_lrnc_uu",
6251 FT_UINT8, BASE_DEC, NULL, 0x08,
6254 { &hf_gtpv2_tra_info_lbm_sc_gmb,
6255 {"Gmb", "gtpv2.tra_info_lbm_sc_gmb",
6256 FT_UINT8, BASE_DEC, NULL, 0x01,
6259 { &hf_gtpv2_tra_info_lmme_s1_mme,
6260 {"S1-MME", "gtpv2.tra_info_lmme_s1_mme",
6261 FT_UINT8, BASE_DEC, NULL, 0x01,
6264 { &hf_gtpv2_tra_info_lmme_s3,
6265 {"S3", "gtpv2.tra_info_lmme_s3",
6266 FT_UINT8, BASE_DEC, NULL, 0x02,
6269 { &hf_gtpv2_tra_info_lmme_s6a,
6270 {"S6a", "gtpv2.tra_info_lmme_s6a",
6271 FT_UINT8, BASE_DEC, NULL, 0x04,
6274 { &hf_gtpv2_tra_info_lmme_s10,
6275 {"S10", "gtpv2.tra_info_lmme_s10",
6276 FT_UINT8, BASE_DEC, NULL, 0x08,
6279 { &hf_gtpv2_tra_info_lmme_s11,
6280 {"S11", "gtpv2.tra_info_lmme_s11",
6281 FT_UINT8, BASE_DEC, NULL, 0x10,
6284 { &hf_gtpv2_tra_info_lsgw_s4,
6285 {"S4", "gtpv2.tra_info_lsgw_s4",
6286 FT_UINT8, BASE_DEC, NULL, 0x01,
6289 { &hf_gtpv2_tra_info_lsgw_s5,
6290 {"S5", "gtpv2.tra_info_lsgw_s5",
6291 FT_UINT8, BASE_DEC, NULL, 0x02,
6294 { &hf_gtpv2_tra_info_lsgw_s8b,
6295 {"S8b", "gtpv2.tra_info_lsgw_s8b",
6296 FT_UINT8, BASE_DEC, NULL, 0x04,
6299 { &hf_gtpv2_tra_info_lsgw_s11,
6300 {"S11", "gtpv2.tra_info_lsgw_s11",
6301 FT_UINT8, BASE_DEC, NULL, 0x08,
6304 { &hf_gtpv2_tra_info_lpdn_gw_s2a,
6305 {"S2a", "gtpv2.tra_info_lpdn_gw_s2a",
6306 FT_UINT8, BASE_DEC, NULL, 0x01,
6309 { &hf_gtpv2_tra_info_lpdn_gw_s2b,
6310 {"S2b", "gtpv2.tra_info_lpdn_gw_s2b",
6311 FT_UINT8, BASE_DEC, NULL, 0x02,
6314 { &hf_gtpv2_tra_info_lpdn_gw_s2c,
6315 {"S2c", "gtpv2.tra_info_lpdn_gw_s2c",
6316 FT_UINT8, BASE_DEC, NULL, 0x04,
6319 { &hf_gtpv2_tra_info_lpdn_gw_s5,
6320 {"S5", "gtpv2.tra_info_lpdn_gw_s5",
6321 FT_UINT8, BASE_DEC, NULL, 0x08,
6324 { &hf_gtpv2_tra_info_lpdn_gw_s6c,
6325 {"S6c", "gtpv2.tra_info_lpdn_gw_s6c",
6326 FT_UINT8, BASE_DEC, NULL, 0x10,
6329 { &hf_gtpv2_tra_info_lpdn_gw_gx,
6330 {"Gx", "gtpv2.tra_info_lpdn_gw_gx",
6331 FT_UINT8, BASE_DEC, NULL, 0x20,
6334 { &hf_gtpv2_tra_info_lpdn_gw_s8b,
6335 {"S8b", "gtpv2.tra_info_lpdn_gw_s8b",
6336 FT_UINT8, BASE_DEC, NULL, 0x40,
6339 { &hf_gtpv2_tra_info_lpdn_gw_sgi,
6340 {"SGi", "gtpv2.tra_info_lpdn_gw_sgi",
6341 FT_UINT8, BASE_DEC, NULL, 0x80,
6344 { &hf_gtpv2_tra_info_lenb_s1_mme,
6345 {"S1-MME", "gtpv2.tra_info_lenb_s1_mme",
6346 FT_UINT8, BASE_DEC, NULL, 0x01,
6349 { &hf_gtpv2_tra_info_lenb_x2,
6350 {"X2", "gtpv2.tra_info_lenb_x2",
6351 FT_UINT8, BASE_DEC, NULL, 0x02,
6354 { &hf_gtpv2_tra_info_lenb_uu,
6355 {"Uu", "gtpv2.tra_info_lenb_uu",
6356 FT_UINT8, BASE_DEC, NULL, 0x04,
6359 { &hf_gtpv2_pdn_ipv4,
6360 {"PDN Address and Prefix(IPv4)", "gtpv2.pdn_addr_and_prefix.ipv4",
6361 FT_IPv4, BASE_NONE, NULL, 0x0,
6364 { &hf_gtpv2_pdn_ipv6_len,
6365 {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
6366 FT_UINT8, BASE_DEC, NULL, 0x0,
6369 { &hf_gtpv2_pdn_ipv6,
6370 {"PDN Address and Prefix(IPv6)", "gtpv2.pdn_addr_and_prefix.ipv6",
6371 FT_BYTES, BASE_NONE, NULL, 0x0,
6374 /* Bit 1 - PVI (Pre-emption Vulnerability): See 3GPP TS 29.212[29],
6375 * clause 5.3.47 Pre-emption-Vulnerability AVP.
6376 * 5.3.47 Pre-emption-Vulnerability AVP
6377 * The following values are defined:
6378 * PRE-EMPTION_VULNERABILITY_ENABLED (0)
6379 * PRE-EMPTION_VULNERABILITY_DISABLED (1)
6381 {&hf_gtpv2_bearer_qos_pvi,
6382 {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
6383 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
6386 {&hf_gtpv2_bearer_qos_pl,
6387 {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
6388 FT_UINT8, BASE_DEC, NULL, 0x3c,
6391 /* Bit 7 - PCI (Pre-emption Capability): See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP.
6392 * clause 5.3.46 Pre-emption-Capability AVP.
6393 * 5.3.46 Pre-emption-Capability AVP
6394 * The following values are defined:
6395 * PRE-EMPTION_CAPABILITY_ENABLED (0)
6396 * PRE-EMPTION_CAPABILITY_DISABLED (1)
6398 {&hf_gtpv2_bearer_qos_pci,
6399 {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
6400 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
6403 {&hf_gtpv2_bearer_qos_label_qci,
6404 {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
6405 FT_UINT8, BASE_DEC, NULL, 0x0,
6408 {&hf_gtpv2_bearer_qos_mbr_up,
6409 {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
6410 FT_UINT64, BASE_DEC, NULL, 0x0,
6413 {&hf_gtpv2_bearer_qos_mbr_down,
6414 {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
6415 FT_UINT64, BASE_DEC, NULL, 0x0,
6418 {&hf_gtpv2_bearer_qos_gbr_up,
6419 {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
6420 FT_UINT64, BASE_DEC, NULL, 0x0,
6423 {&hf_gtpv2_bearer_qos_gbr_down,
6424 {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
6425 FT_UINT64, BASE_DEC, NULL, 0x0,
6428 {&hf_gtpv2_flow_qos_label_qci,
6429 {"Label (QCI)", "gtpv2.flow_qos_label_qci",
6430 FT_UINT8, BASE_DEC, NULL, 0x0,
6433 {&hf_gtpv2_flow_qos_mbr_up,
6434 {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
6435 FT_UINT64, BASE_DEC, NULL, 0x0,
6438 {&hf_gtpv2_flow_qos_mbr_down,
6439 {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
6440 FT_UINT64, BASE_DEC, NULL, 0x0,
6443 {&hf_gtpv2_flow_qos_gbr_up,
6444 {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
6445 FT_UINT64, BASE_DEC, NULL, 0x0,
6448 {&hf_gtpv2_flow_qos_gbr_down,
6449 {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
6450 FT_UINT64, BASE_DEC, NULL, 0x0,
6453 { &hf_gtpv2_rat_type,
6454 {"RAT Type", "gtpv2.rat_type",
6455 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_rat_type_vals_ext, 0x0,
6458 { &hf_gtpv2_uli_ecgi_flg,
6459 {"ECGI Present Flag", "gtpv2.uli_ecgi_flg",
6460 FT_BOOLEAN, 8, NULL, GTPv2_ULI_ECGI_MASK,
6463 { &hf_gtpv2_uli_lai_flg,
6464 {"LAI Present Flag", "gtpv2.uli_lai_flg",
6465 FT_BOOLEAN, 8, NULL, GTPv2_ULI_LAI_MASK,
6468 { &hf_gtpv2_uli_tai_flg,
6469 {"TAI Present Flag", "gtpv2.uli_tai_flg",
6470 FT_BOOLEAN, 8, NULL, GTPv2_ULI_TAI_MASK,
6473 { &hf_gtpv2_uli_rai_flg,
6474 {"RAI Present Flag", "gtpv2.uli_rai_flg",
6475 FT_BOOLEAN, 8, NULL, GTPv2_ULI_RAI_MASK,
6478 { &hf_gtpv2_uli_sai_flg,
6479 {"SAI Present Flag", "gtpv2.uli_sai_flg",
6480 FT_BOOLEAN, 8, NULL, GTPv2_ULI_SAI_MASK,
6483 { &hf_gtpv2_uli_cgi_flg,
6484 {"CGI Present Flag", "gtpv2.uli_cgi_flg",
6485 FT_BOOLEAN, 8, NULL, GTPv2_ULI_CGI_MASK,
6489 {"Geographic Location Type", "gtpv2.glt",
6490 FT_UINT8, BASE_DEC, VALS(geographic_location_type_vals), 0x0,
6493 { &hf_gtpv2_uli_cgi_lac,
6494 {"Location Area Code", "gtpv2.uli_cgi_lac",
6495 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6498 { &hf_gtpv2_uli_cgi_ci,
6499 {"Cell Identity", "gtpv2.uli_cgi_ci",
6500 FT_UINT16, BASE_DEC, NULL, 0x0,
6503 { &hf_gtpv2_uli_sai_lac,
6504 {"Location Area Code", "gtpv2.uli_sai_lac",
6505 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6508 { &hf_gtpv2_uli_sai_sac,
6509 {"Service Area Code", "gtpv2.uli_sai_sac",
6510 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6513 { &hf_gtpv2_uli_rai_lac,
6514 {"Location Area Code", "gtpv2.uli_rai_lac",
6515 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6518 { &hf_gtpv2_uli_rai_rac,
6519 {"Routing Area Code", "gtpv2.uli_rai_rac",
6520 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6523 { &hf_gtpv2_uli_tai_tac,
6524 {"Tracking Area Code", "gtpv2.uli_tai_tac",
6525 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6528 {&hf_gtpv2_uli_ecgi_eci,
6529 {"ECI (E-UTRAN Cell Identifier)", "gtpv2.uli_ecgi_eci",
6530 FT_UINT32, BASE_DEC, NULL, 0x0,
6533 {&hf_gtpv2_uli_lai_lac,
6534 {"Location Area Code (LAC)", "gtpv2.uli_lai_lac",
6535 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
6538 {&hf_gtpv2_uli_ecgi_eci_spare,
6539 {"Spare", "gtpv2.uli_ecgi_eci_spare",
6540 FT_UINT8, BASE_DEC, NULL, 0x0,
6544 {"NSAPI", "gtpv2.nsapi",
6545 FT_UINT8, BASE_DEC, NULL, 0x0f,
6548 {&hf_gtpv2_f_teid_v4,
6549 {"V4", "gtpv2.f_teid_v4",
6550 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v4_vals), 0x80,
6553 {&hf_gtpv2_f_teid_v6,
6554 {"V6", "gtpv2.f_teid_v6",
6555 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v6_vals), 0x40,
6558 {&hf_gtpv2_f_teid_interface_type,
6559 {"Interface Type", "gtpv2.f_teid_interface_type",
6560 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_f_teid_interface_type_vals_ext, 0x3f,
6563 {&hf_gtpv2_f_teid_gre_key,
6564 {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
6565 FT_UINT32, BASE_HEX, NULL, 0x0,
6568 { &hf_gtpv2_f_teid_ipv4,
6569 {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
6570 FT_IPv4, BASE_NONE, NULL, 0x0,
6573 { &hf_gtpv2_f_teid_ipv6,
6574 {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
6575 FT_IPv6, BASE_NONE, NULL, 0x0,
6579 {"TMSI", "gtpv2.tmsi",
6580 FT_UINT32, BASE_HEX, NULL, 0x0,
6583 { &hf_gtpv2_hsgw_addr_f_len,
6584 {"HSGW Address for forwarding Length", "gtpv2.hsgw_addr_f_len",
6585 FT_UINT8, BASE_DEC, NULL, 0x0,
6588 { &hf_gtpv2_hsgw_addr_ipv4,
6589 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv4",
6590 FT_IPv4, BASE_NONE, NULL, 0x0,
6593 { &hf_gtpv2_hsgw_addr_ipv6,
6594 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv6",
6595 FT_IPv6, BASE_NONE, NULL, 0x0,
6598 { &hf_gtpv2_gre_key,
6599 {"GRE Key", "gtpv2.gre_key",
6600 FT_UINT32, BASE_DEC, NULL, 0x0,
6603 { &hf_gtpv2_sgw_addr_ipv4,
6604 {"Serving GW Address", "gtpv2.sgw_addr_ipv4",
6605 FT_IPv4, BASE_NONE, NULL, 0x0,
6608 { &hf_gtpv2_sgw_addr_ipv6,
6609 {"Serving GW Address", "gtpv2.sgw_addr_ipv6",
6610 FT_IPv6, BASE_NONE, NULL, 0x0,
6613 { &hf_gtpv2_sgw_s1u_teid,
6614 {"Serving GW S1-U TEID", "gtpv2.sgw_s1u_teid",
6615 FT_UINT32, BASE_HEX, NULL, 0x0,
6618 {&hf_gtpv2_delay_value,
6619 {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
6620 FT_UINT8, BASE_DEC, NULL, 0x0,
6623 {&hf_gtpv2_charging_id,
6624 {"Charging id", "gtpv2.charging_id",
6625 FT_UINT32, BASE_DEC, NULL, 0x0,
6628 {&hf_gtpv2_charging_characteristic,
6629 {"Charging Characteristic", "gtpv2.charging_characteristic",
6630 FT_UINT16, BASE_HEX, NULL, 0xffff,
6633 {&hf_gtpv2_bearer_flag_ppc,
6634 {"PPC (Prohibit Payload Compression)", "gtpv2.bearer_flag.ppc",
6635 FT_BOOLEAN, 8, NULL, 0x01,
6638 {&hf_gtpv2_bearer_flag_vb,
6639 {"VB (Voice Bearer)", "gtpv2.bearer_flag.vb",
6640 FT_BOOLEAN, 8, NULL, 0x02,
6644 {"Procedure Transaction Id", "gtpv2.pti",
6645 FT_UINT8, BASE_DEC, NULL, 0x0,
6649 { &hf_gtpv2_mm_context_sm,
6650 {"Security Mode", "gtpv2.mm_context_sm",
6651 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_security_mode), 0xe0,
6654 { &hf_gtpv2_mm_context_nhi,
6655 {"NHI(Next Hop Indicator)", "gtpv2.mm_context_nhi",
6656 FT_BOOLEAN, 8, TFS(>pv2_nhi_vals), 0x10,
6659 { &hf_gtpv2_mm_context_drxi,
6660 {"DRXI", "gtpv2.mm_context_drxi",
6661 FT_UINT8, BASE_DEC, NULL, 0x08,
6664 { &hf_gtpv2_mm_context_cksn,
6665 {"CKSN", "gtpv2.mm_context_cksn",
6666 FT_UINT8, BASE_DEC, NULL, 0x07,
6669 { &hf_gtpv2_mm_context_cksn_ksi,
6670 {"CKSN/KSI", "gtpv2.mm_context_cksn_ksi",
6671 FT_UINT8, BASE_DEC, NULL, 0x07,
6674 { &hf_gtpv2_mm_context_ksi_a,
6675 {"KSI_asme", "gtpv2.mm_context_ksi_a",
6676 FT_UINT8, BASE_DEC, NULL, 0x07,
6679 { &hf_gtpv2_mm_context_nr_tri,
6680 {"Number of Triplet", "gtpv2.mm_context_nr_tri",
6681 FT_UINT8, BASE_DEC, NULL, 0xe0,
6684 { &hf_gtpv2_mm_context_used_cipher,
6685 {"Used Cipher", "gtpv2.mm_context_used_cipher",
6686 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_used_cipher_vals), 0x07,
6689 { &hf_gtpv2_mm_context_unipa,
6690 {"Used NAS integrity protection algorithm", "gtpv2.mm_context_unipa",
6691 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unipa_vals), 0x70,
6695 { &hf_gtpv2_mm_context_unc,
6696 {"Used NAS Cipher", "gtpv2.mm_context_unc",
6697 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unc_vals), 0x0f,
6700 { &hf_gtpv2_mm_context_nas_dl_cnt,
6701 {"NAS Downlink Count", "gtpv2.mm_context_nas_dl_cnt",
6702 FT_UINT24, BASE_DEC, NULL, 0x0,
6705 { &hf_gtpv2_mm_context_nas_ul_cnt,
6706 {"NAS Uplink Count", "gtpv2.mm_context_nas_ul_cnt",
6707 FT_UINT24, BASE_DEC, NULL, 0x0,
6710 { &hf_gtpv2_mm_context_kasme,
6711 {"Kasme", "gtpv2.mm_context_kasme",
6712 FT_BYTES, BASE_NONE, NULL, 0x0,
6715 { &hf_gtpv2_mm_context_rand,
6716 {"RAND", "gtpv2.mm_context_rand",
6717 FT_BYTES, BASE_NONE, NULL, 0x0,
6720 { &hf_gtpv2_mm_context_xres_len,
6721 {"XRES Length", "gtpv2.mm_context_xres_len",
6722 FT_UINT8, BASE_DEC, NULL, 0x0,
6725 { &hf_gtpv2_mm_context_xres,
6726 {"XRES", "gtpv2.mm_context_xres",
6727 FT_BYTES, BASE_NONE, NULL, 0x0,
6730 { &hf_gtpv2_mm_context_autn_len,
6731 {"AUTN Length", "gtpv2.mm_context_autn_len",
6732 FT_UINT8, BASE_DEC, NULL, 0x0,
6735 { &hf_gtpv2_mm_context_autn,
6736 {"AUTN", "gtpv2.mm_context_autn",
6737 FT_BYTES, BASE_NONE, NULL, 0x0,
6740 { &hf_gtpv2_mm_context_drx,
6741 {"DRX", "gtpv2.mm_context_drx",
6742 FT_UINT16, BASE_HEX, NULL, 0x0,
6745 { &hf_gtpv2_vdp_length,
6746 {"VDP and UE's Usage Setting length", "gtpv2.vdp_length",
6747 FT_UINT8, BASE_DEC, NULL, 0x0,
6751 { &hf_gtpv2_mm_context_ue_net_cap_len,
6752 {"Length of UE Network Capability", "gtpv2.mm_context_ue_net_cap_len",
6753 FT_UINT8, BASE_DEC, NULL, 0x0,
6756 { &hf_gtpv2_mm_context_ms_net_cap_len,
6757 {"Length of MS Network Capability", "gtpv2.mm_context_ms_net_cap_len",
6758 FT_UINT8, BASE_DEC, NULL, 0x0,
6761 { &hf_gtpv2_mm_context_mei_len,
6762 {"Length of Mobile Equipment Identity (MEI)", "gtpv2.mm_context_mei_len",
6763 FT_UINT8, BASE_DEC, NULL, 0x0,
6766 { &hf_gtpv2_mm_context_vdp_len,
6767 {"Length of Voice Domain Preference and UE's Usage Setting", "gtpv2.mm_context_vdp_len",
6768 FT_UINT8, BASE_DEC, NULL, 0x0,
6772 { "UTRAN", "gtpv2.mm_context.una",
6773 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x01,
6777 { "GERAN", "gtpv2.mm_context.gena",
6778 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x02,
6782 { "GAN", "gtpv2.mm_context.gana",
6783 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x04,
6787 { "I-HSPA-EVOLUTION", "gtpv2.mm_context.ina",
6788 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x08,
6792 { "E-UTRAN", "gtpv2.mm_context.ena",
6793 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x10,
6797 { "HO-toNone3GPP-Access", "gtpv2.mm_context.hnna",
6798 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x20,
6801 { &hf_gtpv2_mm_context_ksi,
6802 {"KSI", "gtpv2.mm_context_ksi",
6803 FT_UINT8, BASE_DEC, NULL, 0x07,
6806 { &hf_gtpv2_mm_context_nr_qui,
6807 {"Number of Quintuplets", "gtpv2.mm_context_nr_qui",
6808 FT_UINT8, BASE_DEC, NULL, 0xe0,
6812 { &hf_gtpv2_mm_context_nr_qua,
6813 {"Number of Quadruplet", "gtpv2.mm_context_nr_qua",
6814 FT_UINT8, BASE_DEC, NULL, 0x1c,
6817 { &hf_gtpv2_mm_context_uamb_ri,
6818 {"UAMB RI", "gtpv2.mm_context_uamb_ri",
6819 FT_BOOLEAN, 8, NULL, 0x02,
6822 { &hf_gtpv2_mm_context_osci,
6823 {"OSCI", "gtpv2.mm_context_osci",
6824 FT_BOOLEAN, 8, NULL, 0x02,
6827 { &hf_gtpv2_mm_context_samb_ri,
6828 {"SAMB RI", "gtpv2.mm_context_samb_ri",
6829 FT_BOOLEAN, 8, NULL, 0x0,
6832 { &hf_gtpv2_ue_time_zone_dst,
6833 {"Daylight Saving Time", "gtpv2.ue_time_zone_dst",
6834 FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals), 0x03,
6837 { &hf_gtpv2_fq_csid_type,
6838 {"Node-ID Type", "gtpv2.fq_csid_type",
6839 FT_UINT8, BASE_DEC, NULL, 0xf0,
6842 { &hf_gtpv2_fq_csid_nr,
6843 {"Number of CSIDs", "gtpv2.fq_csid_nr",
6844 FT_UINT8, BASE_DEC, NULL, 0x0f,
6847 { &hf_gtpv2_fq_csid_ipv4,
6848 {"Node-ID (IPv4)", "gtpv2.fq_csid_ipv4",
6849 FT_IPv4, BASE_NONE, NULL, 0x0,
6852 { &hf_gtpv2_fq_csid_ipv6,
6853 {"Node-ID (IPv6)", "gtpv2.fq_csid_ipv6",
6854 FT_IPv6, BASE_NONE, NULL, 0x0,
6857 { &hf_gtpv2_fq_csid_id,
6858 {"CSID", "gtpv2.fq_csid_id",
6859 FT_UINT16, BASE_DEC, NULL, 0x0,
6862 { &hf_gtpv2_complete_req_msg_type,
6863 {"Complete Request Message Type", "gtpv2.complete_req_msg_type",
6864 FT_UINT8, BASE_DEC, VALS(gtpv2_complete_req_msg_type_vals), 0x0,
6867 {&hf_gtpv2_mme_grp_id,
6868 {"MME Group ID", "gtpv2.mme_grp_id",
6869 FT_UINT16, BASE_DEC, NULL, 0x0,
6872 { &hf_gtpv2_mme_code,
6873 {"MME Code", "gtpv2.mme_code",
6874 FT_UINT8, BASE_DEC, NULL, 0x0,
6878 {"M-TMSI", "gtpv2.m_tmsi",
6879 FT_BYTES, BASE_NONE, NULL, 0x0,
6882 { &hf_gtpv2_container_type,
6883 {"Container Type", "gtpv2.container_type",
6884 FT_UINT8, BASE_DEC, VALS(gtpv2_container_type_vals), 0x0f,
6887 { &hf_gtpv2_cause_type,
6888 {"Cause Type", "gtpv2.cause_type",
6889 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_type_vals_ext, 0x0f,
6892 { &hf_gtpv2_CauseRadioNetwork,
6893 {"Radio Network Layer Cause", "gtpv2.CauseRadioNetwork",
6894 FT_UINT8, BASE_DEC, VALS(s1ap_CauseRadioNetwork_vals), 0x0,
6897 { &hf_gtpv2_CauseTransport,
6898 {"Transport Layer Cause", "gtpv2.CauseTransport",
6899 FT_UINT8, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0x0,
6902 { &hf_gtpv2_CauseNas,
6903 {"NAS Cause", "gtpv2.CauseNas",
6904 FT_UINT8, BASE_DEC, VALS(s1ap_CauseNas_vals), 0x0,
6907 { &hf_gtpv2_CauseMisc,
6908 {"Miscellaneous Cause", "gtpv2.CauseMisc",
6909 FT_UINT8, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0x0,
6912 { &hf_gtpv2_target_type,
6913 {"Target Type", "gtpv2.target_type",
6914 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_target_type_vals_ext, 0x0,
6917 {&hf_gtpv2_macro_enodeb_id,
6918 {"Macro eNodeB ID", "gtpv2.macro_enodeb_id",
6919 FT_UINT24, BASE_HEX, NULL, 0x0fffff,
6922 { &hf_gtpv2_CauseProtocol,
6923 {"Protocol Cause", "gtpv2.CauseProtocol",
6924 FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0,
6927 {&hf_gtpv2_apn_rest,
6928 {"APN Restriction", "gtpv2.apn_rest",
6929 FT_UINT8, BASE_DEC, NULL, 0x0,
6932 {&hf_gtpv2_selec_mode,
6933 {"Selection Mode", "gtpv2.selec_mode",
6934 FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals), 0x03,
6937 { &hf_gtpv2_source_type,
6938 {"Source Type", "gtpv2.source_type",
6939 FT_UINT8, BASE_DEC, NULL, 0x0,
6942 {&hf_gtpv2_bearer_control_mode,
6943 {"Bearer Control Mode", "gtpv2.bearer_control_mode",
6944 FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals), 0x0,
6947 { &hf_gtpv2_cng_rep_act,
6948 {"Change Reporting Action", "gtpv2.cng_rep_act",
6949 FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
6952 { &hf_gtpv2_node_type,
6953 {"Node Type", "gtpv2.node_type",
6954 FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
6958 {"FQDN", "gtpv2.fqdn",
6959 FT_STRING, BASE_NONE, NULL, 0x0,
6962 { &hf_gtpv2_enterprise_id,
6963 {"Enterprise ID", "gtpv2.enterprise_id",
6964 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
6968 {"Transaction Identifier", "gtpv2.ti",
6969 FT_BYTES, BASE_NONE, NULL, 0x0,
6972 { &hf_gtpv2_bss_container_phx,
6973 {"PHX", "gtpv2.bss_cont.phx",
6974 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
6977 { &hf_gtpv2_bss_con_sapi_flg,
6978 {"SAPI", "gtpv2.bss_cont.sapi_flg",
6979 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
6982 { &hf_gtpv2_bss_con_rp_flg,
6983 {"RP", "gtpv2.bss_cont.rp_flg",
6984 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
6987 { &hf_gtpv2_bss_con_pfi_flg,
6988 {"PFI", "gtpv2.bss_cont.pfi_flg",
6989 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
6992 { &hf_gtpv2_bss_con_pfi,
6993 {"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
6994 FT_UINT8, BASE_DEC, NULL, 0x0,
6997 { &hf_gtpv2_bss_con_rp,
6998 {"Radio Priority(RP)", "gtpv2.bss_cont.rp",
6999 FT_UINT8, BASE_DEC, NULL, 0x07,
7002 { &hf_gtpv2_bss_con_sapi,
7003 {"SAPI", "gtpv2.bss_cont.sapi",
7004 FT_UINT8, BASE_DEC, NULL, 0xf0,
7007 { &hf_gtpv2_bss_con_xid_len,
7008 {"XiD parameters length", "gtpv2.bss_cont.xid_len",
7009 FT_UINT8, BASE_DEC, NULL, 0x0,
7012 { &hf_gtpv2_bss_con_xid,
7013 {"XiD parameters", "gtpv2.bss_cont.xid",
7014 FT_BYTES, BASE_NONE, NULL, 0x0,
7017 { &hf_gtpv2_home_enodeb_id,
7018 {"Home eNodeB ID", "gtpv2.home_enodeb_id",
7019 FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
7023 {"Tracking Area Code (TAC)", "gtpv2.tac",
7024 FT_UINT16, BASE_DEC, NULL, 0x0,
7027 { &hf_gtpv2_mbms_service_area_nr,
7028 {"Number of MBMS Service Area codes", "gtpv2.mbms_service_area_nr",
7029 FT_UINT16, BASE_DEC, NULL, 0x0,
7032 { &hf_gtpv2_mbms_service_area_id,
7033 {"MBMS Service Area code (Service Area Identity)", "gtpv2.mbms_service_area_id",
7034 FT_UINT16, BASE_DEC, NULL, 0x0,
7037 { &hf_gtpv2_mbms_session_id,
7038 {"MBMS Session Identifier", "gtpv2.mbms_session_id",
7039 FT_BYTES, BASE_NONE, NULL, 0x0,
7042 { &hf_gtpv2_mbms_flow_id,
7043 {"MBMS Flow Identifier", "gtpv2.mbms_flow_id",
7044 FT_BYTES, BASE_NONE, NULL, 0x0,
7048 {"Common Tunnel Endpoint Identifier", "gtpv2.cetid",
7049 FT_UINT32, BASE_DEC, NULL, 0x0,
7052 { &hf_gtpv2_ip_addr_type,
7053 {"IP Address Type", "gtpv2.ip_addr_type",
7054 FT_UINT8, BASE_DEC, NULL, 0xc0,
7057 { &hf_gtpv2_ip_addr_len,
7058 {"IP Address Length", "gtpv2.ip_addr_len",
7059 FT_UINT8, BASE_DEC, NULL, 0x3f,
7062 { &hf_gtpv2_mbms_ip_mc_dist_addrv4,
7063 {"MBMS IP Multicast Distribution Address (IPv4)", "gtpv2.mbms_ip_mc_dist_addrv4",
7064 FT_IPv4, BASE_NONE, NULL, 0x0,
7067 { &hf_gtpv2_mbms_ip_mc_dist_addrv6,
7068 {"MBMS IP Multicast Distribution Address (IPv6)", "gtpv2.mbms_ip_mc_dist_addrv6",
7069 FT_IPv6, BASE_NONE, NULL, 0x0,
7072 { &hf_gtpv2_mbms_ip_mc_src_addrv4,
7073 {"MBMS IP Multicast Source Address (IPv4)", "gtpv2.mbms_ip_mc_src_addrv4",
7074 FT_IPv4, BASE_NONE, NULL, 0x0,
7077 { &hf_gtpv2_mbms_ip_mc_src_addrv6,
7078 {"MBMS IP Multicast Source Address (IPv6)", "gtpv2.mbms_ip_mc_src_addrv6",
7079 FT_IPv6, BASE_NONE, NULL, 0x0,
7082 { &hf_gtpv2_mbms_hc_indicator,
7083 {"MBMS HC Indicator", "gtpv2.mbms_hc_indicator",
7084 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_hc_indicator_vals), 0x0,
7087 { &hf_gtpv2_mbms_dist_indication,
7088 {"MBMS Distribution Indication", "gtpv2.mbms_dist_indication",
7089 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_dist_indication_vals), 0x03,
7092 { &hf_gtpv2_subscriber_rfsp,
7093 {"Subscribed RFSP Index", "gtpv2.subscriber_rfsp",
7094 FT_INT16, BASE_DEC, NULL, 0x0,
7097 { &hf_gtpv2_rfsp_inuse,
7098 {"RFSP Index in Use", "gtpv2.rfsp_inuse",
7099 FT_INT16, BASE_DEC, NULL, 0x0,
7102 { &hf_gtpv2_mbms_service_id,
7103 {"MBMS Service ID", "gtpv2.mbms_service_id",
7104 FT_BYTES, BASE_NONE, NULL, 0x0,
7107 { &hf_gtpv2_add_flags_for_srvcc_ics,
7108 {"ICS (IMS Centralized Service)", "gtpv2.add_flags_for_srvcc_ics",
7109 FT_BOOLEAN, 8, NULL, 0x01,
7112 { &hf_gtpv2_vsrvcc_flag,
7113 {"VF (vSRVCC Flag)", "gtpv2.vsrvcc_flag",
7114 FT_BOOLEAN, 8, NULL, 0x02,
7117 { &hf_gtpv2_henb_info_report_fti,
7118 {"FTI", "gtpv2.henb_info_report_fti",
7119 FT_BOOLEAN, 8, TFS(>pv2_henb_info_report_fti_vals), 0x01,
7122 { &hf_gtpv2_ip4cp_subnet_prefix_len,
7123 {"Subnet Prefix Length", "gtpv2.ip4cp_subnet_prefix_len",
7124 FT_UINT8, BASE_DEC, NULL, 0x0,
7127 { &hf_gtpv2_ip4cp_ipv4,
7128 {"IPv4 Default Router Address", "gtpv2.ip4cp_ipv4",
7129 FT_IPv4, BASE_NONE, NULL, 0x0,
7132 { &hf_gtpv2_change_report_flags_sncr,
7133 {"SNCR (Service Network Change to Report)", "gtpv2.change_report_flags_sncr",
7134 FT_BOOLEAN, 8, NULL, 0x01,
7137 { &hf_gtpv2_change_report_flags_tzcr,
7138 {"TZCR (Time Zone Change to Report)", "gtpv2.change_report_flags_tzcr",
7139 FT_BOOLEAN, 8, NULL, 0x02,
7142 {&hf_gtpv2_action_indication_val,
7143 {"Action Indication", "gtpv2.action_indication_val",
7144 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_action_indication_vals_ext, 0x07,
7147 { &hf_gtpv2_abs_time_mbms_data,
7148 {"Absolute Time of MBMS Data Transfer", "gtpv2.abs_time_mbms_data",
7149 FT_STRING, BASE_NONE, NULL, 0,
7152 { &hf_gtpv2_mbms_session_duration_days,
7153 {"MBMS Session Duration (days)", "gtpv2.mbms_session_duration_days",
7154 FT_UINT24, BASE_DEC, NULL, 0x00007F,
7157 { &hf_gtpv2_mbms_session_duration_secs,
7158 {"MBMS Session Duration (seconds)", "gtpv2.mbms_session_duration_secs",
7159 FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
7162 { &hf_gtpv2_node_features_prn,
7163 {"PGW Restart Notification (PRN)", "gtpv2.node_features_prn",
7164 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
7167 { &hf_gtpv2_node_features_mabr,
7168 {"Modify Access Bearers Request (MABR)", "gtpv2.node_features_mabr",
7169 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
7172 { &hf_gtpv2_node_features_ntsr,
7173 {"Network Triggered Service Restoration (NTSR)", "gtpv2.node_features_ntsr",
7174 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
7177 { &hf_gtpv2_time_to_data_xfer,
7178 {"MBMS Time to Data Transfer", "gtpv2.time_to_data_xfer",
7179 FT_STRING, BASE_NONE, NULL, 0,
7182 { &hf_gtpv2_arp_pvi,
7183 {"Pre-emption Vulnerability (PVI)", "gtpv2.arp_pvi",
7184 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
7188 {"Priority Level", "gtpv2.arp_pl",
7189 FT_UINT8, BASE_DEC, NULL, 0x3c,
7192 { &hf_gtpv2_arp_pci,
7193 {"Pre-emption Capability (PCI)", "gtpv2.arp_pci",
7194 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
7197 { &hf_gtpv2_timer_unit,
7198 {"Timer unit", "gtpv2.timer_unit",
7199 FT_UINT8, BASE_DEC, VALS(gtpv2_timer_unit_vals), 0xe0,
7202 { &hf_gtpv2_timer_value,
7203 {"Timer value", "gtpv2.timer_value",
7204 FT_UINT8, BASE_DEC, NULL, 0x1f,
7208 {"LAPI (Low Access Priority Indication)", "gtpv2.lapi",
7209 FT_BOOLEAN, 8, NULL, 0x01,
7212 { &hf_gtpv2_mm_context_higher_br_16mb_flg_len,
7213 {"Length of Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg_len",
7214 FT_UINT8, BASE_DEC, NULL, 0x0,
7217 { &hf_gtpv2_mm_context_higher_br_16mb_flg,
7218 {"Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg",
7219 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_higher_br_16mb_flg_vals), 0x0,
7222 { &hf_gtpv2_mmbr_ul,
7223 {"Max MBR/APN-AMBR for uplink", "gtpv2.mmbr_ul",
7224 FT_UINT32, BASE_DEC, NULL, 0x0,
7227 { &hf_gtpv2_mmbr_dl,
7228 {"Max MBR/APN-AMBR for downlink", "gtpv2.mmbr_dl",
7229 FT_UINT32, BASE_DEC, NULL, 0x0,
7232 { &hf_gtpv2_pres_rep_area_action,
7233 {"Action", "gtpv2._pres_rep_area_action.action",
7234 FT_UINT8, BASE_DEC, VALS(gtpv2_pres_rep_area_action_vals), 0x03,
7237 { &hf_gtpv2_pres_rep_area_id,
7238 {"Presence Reporting Area Identifier", "gtpv2._pres_rep_area_action.pres_rep_area_id",
7239 FT_UINT16, BASE_HEX, NULL, 0x0,
7244 static gint *ett_gtpv2_array[] = {
7248 &ett_gtpv2_uli_flags,
7249 &ett_gtpv2_uli_field,
7250 &ett_gtpv2_bearer_ctx,
7251 &ett_gtpv2_PDN_conn,
7252 &ett_gtpv2_mm_context_flag,
7253 &ett_gtpv2_pdn_numbers_nsapi,
7254 &ett_gtpv2_tra_info_trigg,
7255 &ett_gtpv2_tra_info_trigg_msc_server,
7256 &ett_gtpv2_tra_info_trigg_mgw,
7257 &ett_gtpv2_tra_info_trigg_sgsn,
7258 &ett_gtpv2_tra_info_trigg_ggsn,
7259 &ett_gtpv2_tra_info_trigg_bm_sc,
7260 &ett_gtpv2_tra_info_trigg_sgw_mme,
7261 &ett_gtpv2_tra_info_trigg_sgw,
7262 &ett_gtpv2_tra_info_trigg_pgw,
7263 &ett_gtpv2_tra_info_interfaces,
7264 &ett_gtpv2_tra_info_interfaces_imsc_server,
7265 &ett_gtpv2_tra_info_interfaces_lmgw,
7266 &ett_gtpv2_tra_info_interfaces_lsgsn,
7267 &ett_gtpv2_tra_info_interfaces_lggsn,
7268 &ett_gtpv2_tra_info_interfaces_lrnc,
7269 &ett_gtpv2_tra_info_interfaces_lbm_sc,
7270 &ett_gtpv2_tra_info_interfaces_lmme,
7271 &ett_gtpv2_tra_info_interfaces_lsgw,
7272 &ett_gtpv2_tra_info_interfaces_lpdn_gw,
7273 &ett_gtpv2_tra_info_interfaces_lpdn_lenb,
7274 &ett_gtpv2_tra_info_ne_types,
7278 &ett_gtpv2_supp_codec_list,
7280 &ett_gtpv2_mm_context_auth_qua,
7281 &ett_gtpv2_mm_context_auth_qui,
7282 &ett_gtpv2_mm_context_auth_tri,
7283 &ett_gtpv2_mm_context_net_cap,
7284 &ett_gtpv2_ms_network_capability,
7286 &ett_gtpv2_access_rest_data,
7291 static ei_register_info ei[] = {
7292 { &ei_gtpv2_ie_data_not_dissected, { "gtpv2.ie_data_not_dissected", PI_UNDECODED, PI_NOTE, "IE data not dissected yet", EXPFILL }},
7293 { &ei_gtpv2_ie_len_invalid, { "gtpv2.ie_len_invalid", PI_PROTOCOL, PI_ERROR, "Wrong length", EXPFILL }},
7294 { &ei_gtpv2_source_type_unknown, { "gtpv2.source_type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown source type", EXPFILL }},
7295 { &ei_gtpv2_fq_csid_type_bad, { "gtpv2.fq_csid_type.unknown", PI_PROTOCOL, PI_ERROR, "Wrong Node-ID Type", EXPFILL }},
7298 expert_module_t* expert_gtpv2;
7300 proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
7301 proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
7302 proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
7303 expert_gtpv2 = expert_register_protocol(proto_gtpv2);
7304 expert_register_field_array(expert_gtpv2, ei, array_length(ei));
7306 /* AVP Code: 22 3GPP-User-Location-Info */
7307 dissector_add_uint("diameter.3gpp", 22, new_create_dissector_handle(dissect_diameter_3gpp_uli, proto_gtpv2));
7309 register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
7310 /* Dissector table for private extensions */
7311 gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 PRIVATE EXT", FT_UINT16, BASE_DEC);
7315 proto_reg_handoff_gtpv2(void)
7317 nas_eps_handle = find_dissector("nas-eps");
7326 * indent-tabs-mode: nil
7329 * ex: set shiftwidth=4 tabstop=8 expandtab:
7330 * :indentSize=4:tabSize=8:noTabs=true: