3 * Routines for GTPv2 dissection
4 * Copyright 2009 - 2015, Anders Broman <anders.broman [at] ericsson.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)
28 #include <epan/packet.h>
29 #include <epan/to_str.h>
30 #include <epan/asn1.h>
31 #include <epan/expert.h>
32 #include <epan/sminmpec.h>
34 #include "packet-gsm_a_common.h"
35 #include "packet-gsm_map.h"
36 #include "packet-e164.h"
37 #include "packet-e212.h"
38 #include "packet-s1ap.h"
39 #include "packet-bssgp.h"
40 #include "packet-ntp.h"
41 #include "packet-gtpv2.h"
42 #include "packet-diameter.h"
44 void proto_register_gtpv2(void);
45 void proto_reg_handoff_gtpv2(void);
47 static dissector_handle_t nas_eps_handle;
48 static dissector_table_t gtpv2_priv_ext_dissector_table;
51 /*GTPv2 Message->GTP Header(SB)*/
52 static int proto_gtpv2 = -1;
54 static int hf_gtpv2_spare_half_octet = -1;
55 static int hf_gtpv2_spare_bits = -1;
56 static int hf_gtpv2_flags = -1;
57 static int hf_gtpv2_version = -1;
58 static int hf_gtpv2_p = -1;
59 static int hf_gtpv2_t = -1;
60 static int hf_gtpv2_message_type = -1;
61 static int hf_gtpv2_msg_length = -1;
62 static int hf_gtpv2_teid = -1;
63 static int hf_gtpv2_seq = -1;
64 static int hf_gtpv2_spare = -1;
67 static int hf_gtpv2_ie = -1;
68 static int hf_gtpv2_ie_len = -1;
69 static int hf_gtpv2_cr = -1;
70 static int hf_gtpv2_instance = -1;
71 static int hf_gtpv2_cause = -1;
72 static int hf_gtpv2_cause_cs = -1;
73 static int hf_gtpv2_cause_bce = -1;
74 static int hf_gtpv2_cause_pce = -1;
75 static int hf_gtpv2_cause_off_ie_t = -1;
76 static int hf_gtpv2_rec = -1;
77 /*Start SRVCC Messages*/
78 static int hf_gtpv2_stn_sr = -1;
79 static int hf_gtpv2_len_trans_con = -1;
80 static int hf_gtpv2_eksi = -1;
81 static int hf_gtpv2_ck = -1;
82 static int hf_gtpv2_ik = -1;
83 static int hf_gtpv2_len_ms_classmark2 = -1;
84 static int hf_gtpv2_len_ms_classmark3 = -1;
85 static int hf_gtpv2_len_supp_codec_list = -1;
86 static int hf_gtpv2_ksi = -1;
87 /*static int hf_gtpv2_kc = -1; */
88 static int hf_gtpv2_cksn = -1;
89 static int hf_gtpv2_srvcc_cause = -1;
90 static int hf_gtpv2_rac = -1;
91 static int hf_gtpv2_rnc_id = -1;
92 static int hf_gtpv2_ext_rnc_id = -1;
93 static int hf_gtpv2_lac = -1;
94 static int hf_gtpv2_sac = -1;
95 static int hf_gtpv2_tgt_g_cell_id = -1;
96 static int hf_gtpv2_teid_c = -1;
97 static int hf_gtpv2_sv_sti = -1;
98 static int hf_gtpv2_sv_ics = -1;
99 static int hf_gtpv2_sv_emind = -1;
100 /*End SRVCC Messages*/
101 static int hf_gtpv2_apn = -1;
102 static int hf_gtpv2_ebi = -1;
103 static int hf_gtpv2_daf = -1;
104 static int hf_gtpv2_dtf = -1;
105 static int hf_gtpv2_hi = -1;
106 static int hf_gtpv2_dfi = -1;
107 static int hf_gtpv2_oi = -1;
108 static int hf_gtpv2_isrsi = -1;
109 static int hf_gtpv2_israi = -1;
110 static int hf_gtpv2_sgwci = -1;
111 static int hf_gtpv2_sqci = -1;
112 static int hf_gtpv2_uimsi = -1;
113 static int hf_gtpv2_cfsi = -1;
114 static int hf_gtpv2_crsi = -1;
115 static int hf_gtpv2_pt = -1;
116 static int hf_gtpv2_ps = -1;
117 static int hf_gtpv2_si = -1;
118 static int hf_gtpv2_msv = -1;
119 static int hf_gtpv2_retloc = -1;
120 static int hf_gtpv2_pbic = -1;
121 static int hf_gtpv2_srni = -1;
122 static int hf_gtpv2_s6af = -1;
123 static int hf_gtpv2_s4af = -1;
124 static int hf_gtpv2_mbmdt = -1;
125 static int hf_gtpv2_israu = -1;
126 static int hf_gtpv2_ccrsi = -1;
127 static int hf_gtpv2_cprai = -1;
128 static int hf_gtpv2_arrl = -1;
129 static int hf_gtpv2_ppof = -1;
130 static int hf_gtpv2_ppon_ppei = -1;
131 static int hf_gtpv2_ppsi = -1;
132 static int hf_gtpv2_csfbi = -1;
133 static int hf_gtpv2_clii = -1;
134 static int hf_gtpv2_cpsr = -1;
135 static int hf_gtpv2_pcri = -1;
136 static int hf_gtpv2_aosi = -1;
137 static int hf_gtpv2_aopi = -1;
140 static int hf_gtpv2_pdn_type = -1;
141 static int hf_gtpv2_pdn_ipv4 = -1;
142 static int hf_gtpv2_pdn_ipv6_len = -1;
143 static int hf_gtpv2_pdn_ipv6 = -1;
144 static int hf_gtpv2_pdn_numbers_nsapi = -1;
145 static int hf_gtpv2_p_tmsi = -1;
146 static int hf_gtpv2_p_tmsi_sig = -1;
147 static int hf_gtpv2_mmbr_ul = -1;
148 static int hf_gtpv2_mmbr_dl = -1;
150 static int hf_gtpv2_rat_type = -1;
151 static int hf_gtpv2_uli_ecgi_flg = -1;
152 static int hf_gtpv2_uli_lai_flg = -1;
153 static int hf_gtpv2_uli_tai_flg = -1;
154 static int hf_gtpv2_uli_rai_flg = -1;
155 static int hf_gtpv2_uli_sai_flg = -1;
156 static int hf_gtpv2_uli_cgi_flg = -1;
157 static int hf_gtpv2_glt = -1;
158 static int hf_gtpv2_cng_rep_act = -1;
160 static int hf_gtpv2_selec_mode = -1;
161 static int hf_gtpv2_source_type = -1;
162 static int hf_gtpv2_f_teid_v4 = -1;
163 static int hf_gtpv2_f_teid_v6 = -1;
164 static int hf_gtpv2_f_teid_interface_type= -1;
165 static int hf_gtpv2_f_teid_gre_key= -1;
166 static int hf_gtpv2_f_teid_ipv4= -1;
167 static int hf_gtpv2_f_teid_ipv6= -1;
168 static int hf_gtpv2_tmsi = -1;
169 static int hf_gtpv2_hsgw_addr_f_len = -1;
170 static int hf_gtpv2_hsgw_addr_ipv4 = -1;
171 static int hf_gtpv2_hsgw_addr_ipv6 = -1;
172 static int hf_gtpv2_gre_key = -1;
173 static int hf_gtpv2_sgw_addr_ipv4 = -1;
174 static int hf_gtpv2_sgw_addr_ipv6 = -1;
175 static int hf_gtpv2_sgw_s1u_teid = -1;
176 static int hf_gtpv2_ipv4_addr = -1;
179 static int hf_gtpv2_ambr_up= -1;
180 static int hf_gtpv2_ambr_down= -1;
181 static int hf_gtpv2_ip_address_ipv4= -1;
182 static int hf_gtpv2_ip_address_ipv6= -1;
183 static int hf_gtpv2_mei= -1;
185 /* Trace Information */
186 /* static int hf_gtpv2_tra_info = -1; */
187 static int hf_gtpv2_tra_info_msc_momt_calls = -1;
188 static int hf_gtpv2_tra_info_msc_momt_sms = -1;
189 static int hf_gtpv2_tra_info_msc_lu_imsi_ad = -1;
190 static int hf_gtpv2_tra_info_msc_handovers = -1;
191 static int hf_gtpv2_tra_info_msc_ss = -1;
192 static int hf_gtpv2_tra_info_mgw_context = -1;
193 static int hf_gtpv2_tra_info_sgsn_pdp_context = -1;
194 static int hf_gtpv2_tra_info_sgsn_momt_sms = -1;
195 static int hf_gtpv2_tra_info_sgsn_rau_gprs_ad = -1;
196 static int hf_gtpv2_tra_info_sgsn_mbms = -1;
197 static int hf_gtpv2_tra_info_sgsn_reserved = -1;
198 static int hf_gtpv2_tra_info_ggsn_pdp = -1;
199 static int hf_gtpv2_tra_info_ggsn_mbms = -1;
200 static int hf_gtpv2_tra_info_bm_sc = -1;
201 static int hf_gtpv2_tra_info_mme_sgw_ss = -1;
202 static int hf_gtpv2_tra_info_mme_sgw_sr = -1;
203 static int hf_gtpv2_tra_info_mme_sgw_iataud = -1;
204 static int hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc = -1;
205 static int hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del = -1;
206 static int hf_gtpv2_tra_info_mme_sgw_ho = -1;
207 static int hf_gtpv2_tra_info_sgw_pdn_con_creat = -1;
208 static int hf_gtpv2_tra_info_sgw_pdn_con_term = -1;
209 static int hf_gtpv2_tra_info_sgw_bearer_act_mod_del = -1;
210 static int hf_gtpv2_tra_info_pgw_pdn_con_creat = -1;
211 static int hf_gtpv2_tra_info_pgw_pdn_con_term = -1;
212 static int hf_gtpv2_tra_info_pgw_bearer_act_mod_del = -1;
213 static int hf_gtpv2_tra_info_lne_msc_s = -1;
214 static int hf_gtpv2_tra_info_lne_mgw = -1;
215 static int hf_gtpv2_tra_info_lne_sgsn = -1;
216 static int hf_gtpv2_tra_info_lne_ggsn = -1;
217 static int hf_gtpv2_tra_info_lne_rnc = -1;
218 static int hf_gtpv2_tra_info_lne_bm_sc = -1;
219 static int hf_gtpv2_tra_info_lne_mme = -1;
220 static int hf_gtpv2_tra_info_lne_sgw = -1;
221 static int hf_gtpv2_tra_info_lne_pdn_gw = -1;
222 static int hf_gtpv2_tra_info_lne_enb = -1;
223 static int hf_gtpv2_tra_info_tdl = -1;
224 static int hf_gtpv2_tra_info_lmsc_a = -1;
225 static int hf_gtpv2_tra_info_lmsc_lu = -1;
226 static int hf_gtpv2_tra_info_lmsc_mc = -1;
227 static int hf_gtpv2_tra_info_lmsc_map_g = -1;
228 static int hf_gtpv2_tra_info_lmsc_map_b = -1;
229 static int hf_gtpv2_tra_info_lmsc_map_e = -1;
230 static int hf_gtpv2_tra_info_lmsc_map_f = -1;
231 static int hf_gtpv2_tra_info_lmsc_cap = -1;
232 static int hf_gtpv2_tra_info_lmsc_map_d = -1;
233 static int hf_gtpv2_tra_info_lmsc_map_c = -1;
234 static int hf_gtpv2_tra_info_lmgw_mc = -1;
235 static int hf_gtpv2_tra_info_lmgw_nb_up = -1;
236 static int hf_gtpv2_tra_info_lmgw_lu_up = -1;
237 static int hf_gtpv2_tra_info_lsgsn_gb = -1;
238 static int hf_gtpv2_tra_info_lsgsn_lu = -1;
239 static int hf_gtpv2_tra_info_lsgsn_gn = -1;
240 static int hf_gtpv2_tra_info_lsgsn_map_gr = -1;
241 static int hf_gtpv2_tra_info_lsgsn_map_gd = -1;
242 static int hf_gtpv2_tra_info_lsgsn_map_gf = -1;
243 static int hf_gtpv2_tra_info_lsgsn_gs = -1;
244 static int hf_gtpv2_tra_info_lsgsn_ge = -1;
245 static int hf_gtpv2_tra_info_lggsn_gn = -1;
246 static int hf_gtpv2_tra_info_lggsn_gi = -1;
247 static int hf_gtpv2_tra_info_lggsn_gmb = -1;
248 static int hf_gtpv2_tra_info_lrnc_lu = -1;
249 static int hf_gtpv2_tra_info_lrnc_lur = -1;
250 static int hf_gtpv2_tra_info_lrnc_lub = -1;
251 static int hf_gtpv2_tra_info_lrnc_uu = -1;
252 static int hf_gtpv2_tra_info_lbm_sc_gmb = -1;
253 static int hf_gtpv2_tra_info_lmme_s1_mme = -1;
254 static int hf_gtpv2_tra_info_lmme_s3 = -1;
255 static int hf_gtpv2_tra_info_lmme_s6a = -1;
256 static int hf_gtpv2_tra_info_lmme_s10 = -1;
257 static int hf_gtpv2_tra_info_lmme_s11 = -1;
258 static int hf_gtpv2_tra_info_lsgw_s4 = -1;
259 static int hf_gtpv2_tra_info_lsgw_s5 = -1;
260 static int hf_gtpv2_tra_info_lsgw_s8b = -1;
261 static int hf_gtpv2_tra_info_lsgw_s11 = -1;
262 static int hf_gtpv2_tra_info_lpdn_gw_s2a = -1;
263 static int hf_gtpv2_tra_info_lpdn_gw_s2b = -1;
264 static int hf_gtpv2_tra_info_lpdn_gw_s2c = -1;
265 static int hf_gtpv2_tra_info_lpdn_gw_s5 = -1;
266 static int hf_gtpv2_tra_info_lpdn_gw_s6c = -1;
267 static int hf_gtpv2_tra_info_lpdn_gw_gx = -1;
268 static int hf_gtpv2_tra_info_lpdn_gw_s8b = -1;
269 static int hf_gtpv2_tra_info_lpdn_gw_sgi = -1;
270 static int hf_gtpv2_tra_info_lenb_s1_mme = -1;
271 static int hf_gtpv2_tra_info_lenb_x2 = -1;
272 static int hf_gtpv2_tra_info_lenb_uu = -1;
274 static int hf_gtpv2_ti = -1;
276 static int hf_gtpv2_bearer_qos_pvi= -1;
277 static int hf_gtpv2_bearer_qos_pl= -1;
278 static int hf_gtpv2_bearer_qos_pci= -1;
279 static int hf_gtpv2_bearer_qos_label_qci = -1;
280 static int hf_gtpv2_bearer_qos_mbr_up = -1;
281 static int hf_gtpv2_bearer_qos_mbr_down = -1;
282 static int hf_gtpv2_bearer_qos_gbr_up = -1;
283 static int hf_gtpv2_bearer_qos_gbr_down = -1;
284 static int hf_gtpv2_flow_qos_label_qci = -1;
285 static int hf_gtpv2_flow_qos_mbr_up = -1;
286 static int hf_gtpv2_flow_qos_mbr_down = -1;
287 static int hf_gtpv2_flow_qos_gbr_up = -1;
288 static int hf_gtpv2_flow_qos_gbr_down = -1;
290 static int hf_gtpv2_delay_value = -1;
291 static int hf_gtpv2_charging_id = -1;
292 static int hf_gtpv2_charging_characteristic = -1;
293 static int hf_gtpv2_bearer_flag_ppc = -1;
294 static int hf_gtpv2_bearer_flag_vb = -1;
295 static int hf_gtpv2_ue_time_zone_dst = -1;
296 static int hf_gtpv2_fq_csid_type = -1;
297 static int hf_gtpv2_fq_csid_nr = -1;
298 static int hf_gtpv2_fq_csid_ipv4 = -1;
299 static int hf_gtpv2_fq_csid_ipv6 = -1;
300 static int hf_gtpv2_fq_csid_id = -1;
301 static int hf_gtpv2_complete_req_msg_type = -1;
302 static int hf_gtpv2_mme_grp_id = -1;
303 static int hf_gtpv2_mme_code = -1;
304 static int hf_gtpv2_m_tmsi = -1;
305 static int hf_gtpv2_container_type = -1;
306 static int hf_gtpv2_cause_type = -1;
307 static int hf_gtpv2_CauseRadioNetwork = -1;
308 static int hf_gtpv2_CauseTransport = -1;
309 static int hf_gtpv2_CauseNas = -1;
310 static int hf_gtpv2_CauseProtocol = -1;
311 static int hf_gtpv2_CauseMisc = -1;
312 static int hf_gtpv2_target_type = -1;
313 static int hf_gtpv2_macro_enodeb_id = -1;
315 static int hf_gtpv2_node_type= -1;
316 static int hf_gtpv2_fqdn = -1;
317 static int hf_gtpv2_enterprise_id = -1;
318 static int hf_gtpv2_apn_rest= -1;
319 static int hf_gtpv2_pti= -1;
320 static int hf_gtpv2_mm_context_sm = -1;
321 static int hf_gtpv2_mm_context_nhi = -1;
322 static int hf_gtpv2_mm_context_drxi = -1;
323 static int hf_gtpv2_mm_context_cksn = -1;
324 static int hf_gtpv2_mm_context_cksn_ksi = -1;
325 static int hf_gtpv2_mm_context_kasme = -1;
326 static int hf_gtpv2_mm_context_rand = -1;
327 static int hf_gtpv2_mm_context_xres_len = -1;
328 static int hf_gtpv2_mm_context_xres = -1;
329 static int hf_gtpv2_mm_context_autn_len = -1;
330 static int hf_gtpv2_mm_context_autn = -1;
331 static int hf_gtpv2_mm_context_drx = -1;
332 static int hf_gtpv2_mm_context_ue_net_cap_len = -1;
333 static int hf_gtpv2_mm_context_ms_net_cap_len = -1;
334 static int hf_gtpv2_mm_context_mei_len = -1;
335 static int hf_gtpv2_mm_context_vdp_len = -1;
336 static int hf_gtpv2_mm_context_higher_br_16mb_flg_len = -1;
337 static int hf_gtpv2_mm_context_higher_br_16mb_flg = -1;
338 static int hf_gtpv2_vdp_length = -1;
339 static int hf_gtpv2_uci_csg_id = -1;
340 static int hf_gtpv2_uci_csg_id_spare = -1;
341 static int hf_gtpv2_uci_access_mode = -1;
342 static int hf_gtpv2_uci_lcsg = -1;
343 static int hf_gtpv2_uci_csg_membership = -1;
345 static int hf_gtpv2_una = -1;
346 static int hf_gtpv2_gena = -1;
347 static int hf_gtpv2_gana = -1;
348 static int hf_gtpv2_ina = -1;
349 static int hf_gtpv2_ena = -1;
350 static int hf_gtpv2_hnna = -1;
351 static int hf_gtpv2_mm_context_ksi_a= -1;
352 static int hf_gtpv2_mm_context_ksi = -1;
353 static int hf_gtpv2_mm_context_nr_tri = -1;
354 static int hf_gtpv2_mm_context_used_cipher = -1;
355 static int hf_gtpv2_mm_context_nr_qui = -1;
356 static int hf_gtpv2_mm_context_nr_qua = -1;
357 static int hf_gtpv2_mm_context_uamb_ri = -1;
358 static int hf_gtpv2_mm_context_osci = -1;
359 static int hf_gtpv2_mm_context_samb_ri = -1;
360 static int hf_gtpv2_mm_context_unipa = -1;
361 static int hf_gtpv2_mm_context_unc = -1;
362 static int hf_gtpv2_mm_context_nas_dl_cnt = -1;
363 static int hf_gtpv2_mm_context_nas_ul_cnt = -1;
365 static int hf_gtpv2_uli_cgi_lac= -1;
366 static int hf_gtpv2_uli_cgi_ci= -1;
367 static int hf_gtpv2_sai_lac= -1;
368 static int hf_gtpv2_sai_sac= -1;
369 static int hf_gtpv2_rai_lac= -1;
370 static int hf_gtpv2_rai_rac= -1;
371 static int hf_gtpv2_tai_tac= -1;
372 static int hf_gtpv2_ecgi_eci= -1;
373 static int hf_gtpv2_uli_lai_lac = -1;
374 static int hf_gtpv2_ecgi_eci_spare= -1;
375 static int hf_gtpv2_nsapi = -1;
376 static int hf_gtpv2_bearer_control_mode= -1;
378 static int hf_gtpv2_bss_container_phx = -1;
379 static int hf_gtpv2_bss_con_sapi_flg = -1;
380 static int hf_gtpv2_bss_con_rp_flg = -1;
381 static int hf_gtpv2_bss_con_pfi_flg = -1;
382 static int hf_gtpv2_bss_con_pfi = -1;
383 static int hf_gtpv2_bss_con_rp = -1;
384 static int hf_gtpv2_bss_con_sapi = -1;
385 static int hf_gtpv2_bss_con_xid_len = -1;
386 static int hf_gtpv2_bss_con_xid = -1;
387 static int hf_gtpv2_home_enodeb_id = -1;
388 static int hf_gtpv2_tac = -1;
391 static int hf_gtpv2_mbms_service_area_nr = -1;
392 static int hf_gtpv2_mbms_service_area_id = -1;
393 static int hf_gtpv2_mbms_session_id = -1;
394 static int hf_gtpv2_mbms_flow_id = -1;
395 static int hf_gtpv2_cteid = -1;
396 static int hf_gtpv2_ip_addr_type = -1;
397 static int hf_gtpv2_ip_addr_len = -1;
398 static int hf_gtpv2_mbms_ip_mc_dist_addrv4 = -1;
399 static int hf_gtpv2_mbms_ip_mc_dist_addrv6 = -1;
400 static int hf_gtpv2_mbms_ip_mc_src_addrv4 = -1;
401 static int hf_gtpv2_mbms_ip_mc_src_addrv6 = -1;
402 static int hf_gtpv2_mbms_hc_indicator = -1;
403 static int hf_gtpv2_mbms_dist_indication = -1;
404 static int hf_gtpv2_subscriber_rfsp = -1;
405 static int hf_gtpv2_rfsp_inuse = -1;
406 static int hf_gtpv2_mbms_service_id = -1;
407 static int hf_gtpv2_add_flags_for_srvcc_ics = -1;
408 static int hf_gtpv2_vsrvcc_flag = -1;
409 static int hf_gtpv2_abs_time_mbms_data = -1;
410 static int hf_gtpv2_henb_info_report_fti = -1;
411 static int hf_gtpv2_ip4cp_subnet_prefix_len = -1;
412 static int hf_gtpv2_ip4cp_ipv4 = -1;
413 static int hf_gtpv2_change_report_flags_sncr = -1;
414 static int hf_gtpv2_change_report_flags_tzcr = -1;
415 static int hf_gtpv2_action_indication_val = -1;
416 static int hf_gtpv2_uli_timestamp = -1;
417 static int hf_gtpv2_mbms_session_duration_days = -1;
418 static int hf_gtpv2_mbms_session_duration_secs = -1;
419 static int hf_gtpv2_node_features_prn = -1;
420 static int hf_gtpv2_node_features_mabr =-1;
421 static int hf_gtpv2_node_features_ntsr = -1;
422 static int hf_gtpv2_time_to_data_xfer = -1;
423 static int hf_gtpv2_arp_pvi = -1;
424 static int hf_gtpv2_arp_pl = -1;
425 static int hf_gtpv2_arp_pci = -1;
426 static int hf_gtpv2_timer_unit = -1;
427 static int hf_gtpv2_throttling_delay_unit = -1;
428 static int hf_gtpv2_throttling_delay_value = -1;
429 static int hf_gtpv2_timer_value = -1;
430 static int hf_gtpv2_lapi = -1;
432 static int hf_gtpv2_pres_rep_area_action = -1;
433 static int hf_gtpv2_pres_rep_area_id = -1;
434 static int hf_gtpv2_pres_rep_area_act_no_tai = -1;
435 static int hf_gtpv2_pres_rep_area_act_no_rai = -1;
436 static int hf_gtpv2_pres_rep_area_act_no_m_enodeb = -1;
437 static int hf_gtpv2_pres_rep_area_act_no_h_enodeb = -1;
438 static int hf_gtpv2_pres_rep_area_act_no_ecgi = -1;
439 static int hf_gtpv2_pres_rep_area_act_no_sai = -1;
440 static int hf_gtpv2_pres_rep_area_act_no_cgi = -1;
441 static int hf_gtpv2_ksi_ps = -1;
442 static int hf_gtpv2_ck_ps = -1;
443 static int hf_gtpv2_ik_ps = -1;
444 static int hf_gtpv2_kc_ps = -1;
445 static int hf_gtpv2_cksn_ps = -1;
447 /* Generated from convert_proto_tree_add_text.pl */
448 static int hf_gtpv2_downlink_subscribed_ue_ambr = -1;
449 static int hf_gtpv2_mm_context_sres = -1;
450 static int hf_gtpv2_iksrvcc = -1;
451 static int hf_gtpv2_nsapi08 = -1;
452 static int hf_gtpv2_voice_domain_and_ue_usage_setting = -1;
453 static int hf_gtpv2_upd_source_port_number = -1;
454 static int hf_gtpv2_uplink_used_ue_ambr = -1;
455 static int hf_gtpv2_tmsi_bytes = -1;
456 static int hf_gtpv2_dl_gtp_u_sequence_number = -1;
457 static int hf_gtpv2_mm_context_nh = -1;
458 static int hf_gtpv2_teid_c_spare = -1;
459 static int hf_gtpv2_uplink_subscribed_ue_ambr = -1;
460 static int hf_gtpv2_transparent_container = -1;
461 static int hf_gtpv2_packet_flow_id = -1;
462 static int hf_gtpv2_utran_srvcc_ik_cs = -1;
463 static int hf_gtpv2_downlink_used_ue_ambr = -1;
464 static int hf_gtpv2_hop_counter = -1;
465 static int hf_gtpv2_ul_gtp_u_sequence_number = -1;
466 static int hf_gtpv2_authentication_quadruplets = -1;
467 static int hf_gtpv2_utran_srvcc_kc = -1;
468 static int hf_gtpv2_spare_bytes = -1;
469 static int hf_gtpv2_metric = -1;
470 static int hf_gtpv2_throttling_factor = -1;
471 static int hf_gtpv2_relative_capacity = -1;
472 static int hf_gtpv2_apn_length = -1;
473 static int hf_gtpv2_sequence_number = -1;
474 static int hf_gtpv2_receive_n_pdu_number = -1;
475 static int hf_gtpv2_trace_id = -1;
476 static int hf_gtpv2_drx_parameter = -1;
477 static int hf_gtpv2_charging_characteristic_remaining_octets = -1;
478 static int hf_gtpv2_mm_context_ncc = -1;
479 static int hf_gtpv2_proprietary_value = -1;
480 static int hf_gtpv2_mobile_station_classmark2 = -1;
481 static int hf_gtpv2_rrc_container = -1;
482 static int hf_gtpv2_send_n_pdu_number = -1;
483 static int hf_gtpv2_mobile_station_classmark3 = -1;
484 static int hf_gtpv2_eps_bearer_id_number = -1;
485 static int hf_gtpv2_geographic_location = -1;
486 static int hf_gtpv2_cn_id = -1;
487 static int hf_gtpv2_utran_srvcc_ck_cs = -1;
488 static int hf_gtpv2_authentication_quintuplets = -1;
489 static int hf_gtpv2_serving_gw_address_length = -1;
490 static int hf_gtpv2_supported_codec_list = -1;
491 static int hf_gtpv2_cksrvcc = -1;
492 static int hf_gtpv2_mm_context_kc = -1;
493 static int hf_gtpv2_dl_pdcp_sequence_number = -1;
494 static int hf_gtpv2_ul_pdcp_sequence_number = -1;
495 static int hf_gtpv2_fq_csid_node_id = -1;
496 static int hf_gtpv2_fq_csid_mcc_mnc = -1;
498 static gint ett_gtpv2 = -1;
499 static gint ett_gtpv2_flags = -1;
500 static gint ett_gtpv2_ie = -1;
501 static gint ett_gtpv2_uli_flags = -1;
502 static gint ett_gtpv2_uli_field = -1;
503 static gint ett_gtpv2_bearer_ctx = -1;
504 static gint ett_gtpv2_PDN_conn = -1;
505 static gint ett_gtpv2_overload_control_information = -1;
506 static gint ett_gtpv2_mm_context_flag = -1;
507 static gint ett_gtpv2_pdn_numbers_nsapi = -1;
508 static gint ett_gtpv2_tra_info_trigg = -1;
509 static gint ett_gtpv2_tra_info_trigg_msc_server = -1;
510 static gint ett_gtpv2_tra_info_trigg_mgw = -1;
511 static gint ett_gtpv2_tra_info_trigg_sgsn = -1;
512 static gint ett_gtpv2_tra_info_trigg_ggsn = -1;
513 static gint ett_gtpv2_tra_info_trigg_bm_sc = -1;
514 static gint ett_gtpv2_tra_info_trigg_sgw_mme = -1;
515 static gint ett_gtpv2_tra_info_trigg_sgw = -1;
516 static gint ett_gtpv2_tra_info_trigg_pgw = -1;
517 static gint ett_gtpv2_tra_info_interfaces = -1;
518 static gint ett_gtpv2_tra_info_interfaces_imsc_server = -1;
519 static gint ett_gtpv2_tra_info_interfaces_lmgw = -1;
520 static gint ett_gtpv2_tra_info_interfaces_lsgsn = -1;
521 static gint ett_gtpv2_tra_info_interfaces_lggsn = -1;
522 static gint ett_gtpv2_tra_info_interfaces_lrnc = -1;
523 static gint ett_gtpv2_tra_info_interfaces_lbm_sc = -1;
524 static gint ett_gtpv2_tra_info_interfaces_lmme = -1;
525 static gint ett_gtpv2_tra_info_interfaces_lsgw = -1;
526 static gint ett_gtpv2_tra_info_interfaces_lpdn_gw = -1;
527 static gint ett_gtpv2_tra_info_interfaces_lpdn_lenb = -1;
528 static gint ett_gtpv2_tra_info_ne_types = -1;
529 static gint ett_gtpv2_rai = -1;
530 static gint ett_gtpv2_ms_mark = -1;
531 static gint ett_gtpv2_stn_sr = -1;
532 static gint ett_gtpv2_supp_codec_list = -1;
533 static gint ett_gtpv2_bss_con = -1;
534 static gint ett_gtpv2_mm_context_auth_qua = -1;
535 static gint ett_gtpv2_mm_context_auth_qui = -1;
536 static gint ett_gtpv2_mm_context_auth_tri = -1;
537 static gint ett_gtpv2_mm_context_net_cap = -1;
538 static gint ett_gtpv2_ms_network_capability = -1;
539 static gint ett_gtpv2_vd_pref = -1;
540 static gint ett_gtpv2_access_rest_data = -1;
541 static gint ett_gtpv2_qua = -1;
542 static gint ett_gtpv2_qui = -1;
543 static gint ett_gtpv2_preaa_tais = -1;
544 static gint ett_gtpv2_preaa_menbs = -1;
545 static gint ett_gtpv2_preaa_henbs = -1;
546 static gint ett_gtpv2_preaa_ecgis = -1;
547 static gint ett_gtpv2_preaa_rais = -1;
548 static gint ett_gtpv2_preaa_sais = -1;
549 static gint ett_gtpv2_preaa_cgis = -1;
550 static gint ett_gtpv2_load_control_inf = -1;
552 static expert_field ei_gtpv2_ie_data_not_dissected = EI_INIT;
553 static expert_field ei_gtpv2_ie_len_invalid = EI_INIT;
554 static expert_field ei_gtpv2_source_type_unknown = EI_INIT;
555 static expert_field ei_gtpv2_fq_csid_type_bad = EI_INIT;
556 static expert_field ei_gtpv2_mbms_session_duration_days = EI_INIT;
557 static expert_field ei_gtpv2_mbms_session_duration_secs = EI_INIT;
558 static expert_field ei_gtpv2_ie = EI_INIT;
561 /* Definition of User Location Info (AVP 22) masks */
562 #define GTPv2_ULI_CGI_MASK 0x01
563 #define GTPv2_ULI_SAI_MASK 0x02
564 #define GTPv2_ULI_RAI_MASK 0x04
565 #define GTPv2_ULI_TAI_MASK 0x08
566 #define GTPv2_ULI_ECGI_MASK 0x10
567 #define GTPv2_ULI_LAI_MASK 0x20
569 #define GTPV2_CREATE_SESSION_REQUEST 32
570 #define GTPV2_CREATE_SESSION_RESPONSE 33
571 #define GTPV2_MODIFY_BEARER_RESPONSE 35
572 #define GTPV2_DELETE_SESSION_REQUEST 36
573 #define GTPV2_DELETE_SESSION_RESPONSE 37
574 #define GTPV2_BEARER_RESOURCE_COMMAND 68
575 #define GTPV2_CREATE_BEARER_REQUEST 95
576 #define GTPV2_CREATE_BEARER_RESPONSE 96
577 #define GTPV2_UPDATE_BEARER_REQUEST 97
578 #define GTPV2_UPDATE_BEARER_RESPONSE 98
579 #define GTPV2_DELETE_BEARER_REQUEST 99
580 #define GTPV2_DELETE_BEARER_RESPONSE 100
581 #define GTPV2_CONTEXT_RESPONSE 131
582 #define GTPV2_FORWARD_RELOCATION_REQ 133
583 #define GTPV2_FORWARD_RELOCATION_RESP 134
584 #define GTPV2_FORWARD_CTX_NOTIFICATION 137
585 #define GTPV2_RAN_INFORMATION_RELAY 152
587 static void dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, gint offset, guint8 message_type);
589 /*Message Types for GTPv2 (Refer Pg19 29.274) (SB)*/
590 static const value_string gtpv2_message_type_vals[] = {
592 { 1, "Echo Request"},
593 { 2, "Echo Response"},
594 { 3, "Version Not Supported Indication"},
595 /* 4-24 Reserved for S101 interface TS 29.276 */
596 { 4, "Node Alive Request"},
597 { 5, "Node Alive Response"},
598 { 6, "Redirection Request"},
599 { 7, "Redirection Response"},
600 /* 25-31 Reserved for Sv interface TS 29.280 */
601 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 5.2.1*/
602 { 25, "SRVCC PS to CS Request"},
603 { 26, "SRVCC PS to CS Response"},
604 { 27, "SRVCC PS to CS Complete Notification"},
605 { 28, "SRVCC PS to CS Complete Acknowledge"},
606 { 29, "SRVCC PS to CS Cancel Notification"},
607 { 30, "SRVCC PS to CS Cancel Acknowledge"},
608 { 31, "SRVCC CS to PS Request"},
609 /*End SRVCC Messages*/
610 /* SGSN/MME to PGW (S4/S11, S5/S8) */
611 { 32, "Create Session Request"},
612 { 33, "Create Session Response"},
613 { 34, "Modify Bearer Request"},
614 { 35, "Modify Bearer Response"},
615 { 36, "Delete Session Request"},
616 { 37, "Delete Session Response"},
617 /* SGSN to PGW (S4, S5/S8) */
618 { 38, "Change Notification Request"},
619 { 39, "Change Notification Response"},
620 /* 40-63 For future use */
621 /* Messages without explicit response */
622 { 64, "Modify Bearer Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
623 { 65, "Modify Bearer Failure Indication"}, /*(PGW to MME/SGSN -S5/S8, S11/S4) */
624 { 66, "Delete Bearer Command"}, /* (MME to PGW -S11, S5/S8) */
625 { 67, "Delete Bearer Failure Indication"}, /* (PGW to MME -S5/S8, S11) */
626 { 68, "Bearer Resource Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
627 { 69, "Bearer Resource Failure Indication"}, /* (PGW to MME/SGSN -S5/S8, S11/S4) */
628 { 70, "Downlink Data Notification Failure Indication"}, /*(SGSN/MME to SGW -S4/S11) */
629 { 71, "Trace Session Activation"},
630 { 72, "Trace Session Deactivation"},
631 { 73, "Stop Paging Indication"},
632 /* 74-94 For future use */
633 /* PDN-GW to SGSN/MME (S5/S8, S4/S11) */
634 { 95, "Create Bearer Request"},
635 { 96, "Create Bearer Response"},
636 { 97, "Update Bearer Request"},
637 { 98, "Update Bearer Response"},
638 { 99, "Delete Bearer Request"},
639 {100, "Delete Bearer Response"},
640 /* PGW to MME, MME to PGW, SGW to PGW, SGW to MME (S5/S8, S11) */
641 {101, "Delete PDN Connection Set Request"},
642 {102, "Delete PDN Connection Set Response"},
643 /* 103-127 For future use */
644 /* MME to MME, SGSN to MME, MME to SGSN, SGSN to SGSN (S3/10/S16) */
645 {128, "Identification Request"},
646 {129, "Identification Response"},
647 {130, "Context Request"},
648 {131, "Context Response"},
649 {132, "Context Acknowledge"},
650 {133, "Forward Relocation Request"},
651 {134, "Forward Relocation Response"},
652 {135, "Forward Relocation Complete Notification"},
653 {136, "Forward Relocation Complete Acknowledge"},
654 {137, "Forward Access Context Notification"},
655 {138, "Forward Access Context Acknowledge"},
656 {139, "Relocation Cancel Request"},
657 {140, "Relocation Cancel Response"},
658 {141, "Configuration Transfer Tunnel"},
659 /* 142-148 For future use */
660 /* SGSN to MME, MME to SGSN (S3)*/
661 {149, "Detach Notification"},
662 {150, "Detach Acknowledge"},
663 {151, "CS Paging Indication"},
664 {152, "RAN Information Relay"},
665 {153, "Alert MME Notification"},
666 {154, "Alert MME Acknowledge"},
667 {155, "UE Activity Notification"},
668 {156, "UE Activity Acknowledge"},
669 /* 157 to 159 For future use */
670 /* MME to SGW (S11) */
671 {160, "Create Forwarding Tunnel Request"},
672 {161, "Create Forwarding Tunnel Response"},
673 {162, "Suspend Notification"},
674 {163, "Suspend Acknowledge"},
675 {164, "Resume Notification"},
676 {165, "Resume Acknowledge"},
677 {166, "Create Indirect Data Forwarding Tunnel Request"},
678 {167, "Create Indirect Data Forwarding Tunnel Response"},
679 {168, "Delete Indirect Data Forwarding Tunnel Request"},
680 {169, "Delete Indirect Data Forwarding Tunnel Response"},
681 {170, "Release Access Bearers Request"},
682 {171, "Release Access Bearers Response"},
683 /* 172-175 For future use */
684 /* SGW to SGSN/MME (S4/S11) */
685 {176, "Downlink Data Notification"},
686 {177, "Downlink Data Notification Acknowledgement"},
687 {178, "Reserved. Allocated in earlier version of the specification."},
688 {179, "PGW Restart Notification"},
689 {180, "PGW Restart Notification Acknowledge"},
690 /* 181-199 For future use */
691 /* SGW to PGW, PGW to SGW (S5/S8) */
692 {200, "Update PDN Connection Set Request"},
693 {201, "Update PDN Connection Set Response"},
694 /* 202 to 210 For future use */
695 /* MME to SGW (S11) */
696 {211, "Modify Access Bearers Request"},
697 {212, "Modify Access Bearers Response"},
698 /* 213 to 230 For future use */
699 /* MBMS GW to MME/SGSN (Sm/Sn) */
700 {231, "MBMS Session Start Request"},
701 {232, "MBMS Session Start Response"},
702 {233, "MBMS Session Update Request"},
703 {234, "MBMS Session Update Response"},
704 {235, "MBMS Session Stop Request"},
705 {236, "MBMS Session Stop Response"},
706 /* 237 to 239 For future use */
707 {240, "SRVCC CS to PS Response"}, /* 5.2.9 3GPP TS 29.280 V11.5.0 (2013-09) */
708 {241, "SRVCC CS to PS Complete Notification"}, /* 5.2.10 3GPP TS 29.280 V11.5.0 (2013-09) */
709 {242, "SRVCC CS to PS Complete Acknowledge"}, /* 5.2.11 3GPP TS 29.280 V11.5.0 (2013-09) */
710 {243, "SRVCC CS to PS Cancel Notification"}, /* 5.2.12 3GPP TS 29.280 V11.5.0 (2013-09) */
711 {244, "SRVCC CS to PS Cancel Acknowledge"}, /* 5.2.13 3GPP TS 29.280 V11.5.0 (2013-09) */
712 /* 245 to 247 For future Sv interface use*/
713 /* 248 to 255 For future use */
716 static value_string_ext gtpv2_message_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_message_type_vals);
718 #define GTPV2_IE_RESERVED 0
719 #define GTPV2_IE_IMSI 1
720 #define GTPV2_IE_CAUSE 2
721 #define GTPV2_REC_REST_CNT 3
722 /*Start SRVCC Messages*/
723 #define GTPV2_IE_STN_SR 51
724 #define GTPV2_IE_SRC_TGT_TRANS_CON 52
725 #define GTPV2_IE_TGT_SRC_TRANS_CON 53
726 #define GTPV2_IE_MM_CON_EUTRAN_SRVCC 54
727 #define GTPV2_IE_MM_CON_UTRAN_SRVCC 55
728 #define GTPV2_IE_SRVCC_CAUSE 56
729 #define GTPV2_IE_TGT_RNC_ID 57
730 #define GTPV2_IE_TGT_GLOGAL_CELL_ID 58
731 #define GTPV2_IE_TEID_C 59
732 #define GTPV2_IE_SV_FLAGS 60
733 #define GTPV2_IE_SAI 61
734 #define GTPV2_IE_MM_CTX_FOR_CS_TO_PS_SRVCC 62
735 /* 61 - 70 for future sv interface use*/
736 /*End SRVCC Messages*/
738 #define GTPV2_AMBR 72
740 #define GTPV2_IP_ADDRESS 74
742 #define GTPV2_IE_MSISDN 76
743 #define GTPV2_INDICATION 77
746 #define GTPV2_BEARER_QOS 80
747 #define GTPV2_IE_FLOW_QOS 81
748 #define GTPV2_IE_RAT_TYPE 82
749 #define GTPV2_IE_SERV_NET 83
750 #define GTPV2_IE_BEARER_TFT 84
751 #define GTPV2_IE_TAD 85
752 #define GTPV2_IE_ULI 86
753 #define GTPV2_IE_F_TEID 87
754 #define GTPV2_IE_TMSI 88
755 #define GTPV2_IE_GLOBAL_CNID 89
756 #define GTPV2_IE_S103PDF 90
757 #define GTPV2_IE_S1UDF 91
758 #define GTPV2_IE_DEL_VAL 92
759 #define GTPV2_IE_BEARER_CTX 93
760 #define GTPV2_IE_CHAR_ID 94
761 #define GTPV2_IE_CHAR_CHAR 95
762 #define GTPV2_IE_TRA_INFO 96
763 #define GTPV2_BEARER_FLAG 97
764 /* define GTPV2_IE_PAGING_CAUSE 98 (void) */
765 #define GTPV2_IE_PDN_TYPE 99
766 #define GTPV2_IE_PTI 100
767 #define GTPV2_IE_DRX_PARAM 101
768 #define GTPV2_IE_UE_NET_CAPABILITY 102
769 #define GTPV2_IE_MM_CONTEXT_GSM_T 103
770 #define GTPV2_IE_MM_CONTEXT_UTMS_CQ 104
771 #define GTPV2_IE_MM_CONTEXT_GSM_CQ 105
772 #define GTPV2_IE_MM_CONTEXT_UTMS_Q 106
773 #define GTPV2_IE_MM_CONTEXT_EPS_QQ 107
774 #define GTPV2_IE_MM_CONTEXT_UTMS_QQ 108
775 #define GTPV2_IE_PDN_CONNECTION 109
776 #define GTPV2_IE_PDN_NUMBERS 110
777 #define GTPV2_IE_P_TMSI 111
778 #define GTPV2_IE_P_TMSI_SIG 112
779 #define GTPV2_IE_HOP_COUNTER 113
780 #define GTPV2_IE_UE_TIME_ZONE 114
781 #define GTPV2_IE_TRACE_REFERENCE 115
782 #define GTPV2_IE_COMPLETE_REQUEST_MSG 116
783 #define GTPV2_IE_GUTI 117
784 #define GTPV2_IE_F_CONTAINER 118
785 #define GTPV2_IE_F_CAUSE 119
786 #define GTPV2_IE_SEL_PLMN_ID 120
787 #define GTPV2_IE_TARGET_ID 121
788 /* GTPV2_IE_NSAPI 122 */
789 #define GTPV2_IE_PKT_FLOW_ID 123
790 #define GTPV2_IE_RAB_CONTEXT 124
791 #define GTPV2_IE_S_RNC_PDCP_CTX_INFO 125
792 #define GTPV2_IE_UDP_S_PORT_NR 126
793 #define GTPV2_IE_APN_RESTRICTION 127
794 #define GTPV2_IE_SEL_MODE 128
795 #define GTPV2_IE_SOURCE_IDENT 129
796 #define GTPV2_IE_BEARER_CONTROL_MODE 130
797 #define GTPV2_IE_CNG_REP_ACT 131
798 #define GTPV2_IE_FQ_CSID 132
799 #define GTPV2_IE_CHANNEL_NEEDED 133
800 #define GTPV2_IE_EMLPP_PRI 134
801 #define GTPV2_IE_NODE_TYPE 135
802 #define GTPV2_IE_FQDN 136
803 #define GTPV2_IE_TI 137
804 #define GTPV2_IE_MBMS_SESSION_DURATION 138
805 #define GTPV2_IE_MBMS_SERVICE_AREA 139
806 #define GTPV2_IE_MBMS_SESSION_ID 140
807 #define GTPV2_IE_MBMS_FLOW_ID 141
808 #define GTPV2_IE_MBMS_IP_MC_DIST 142
809 #define GTPV2_IE_MBMS_DIST_ACK 143
810 #define GTPV2_IE_RFSP_INDEX 144
811 #define GTPV2_IE_UCI 145
812 #define GTPV2_IE_CSG_INFO_REP_ACTION 146
813 #define GTPV2_IE_CSG_ID 147
814 #define GTPV2_IE_CMI 148
815 #define GTPV2_IE_SERVICE_INDICATOR 149
816 #define GTPV2_IE_DETACH_TYPE 150
817 #define GTPV2_IE_LDN 151
818 #define GTPV2_IE_NODE_FEATURES 152
819 #define GTPV2_IE_MBMS_TIME_TO_DATA_XFER 153
820 #define GTPV2_IE_THROTTLING 154
821 #define GTPV2_IE_ARP 155
822 #define GTPV2_IE_EPC_TIMER 156
823 #define GTPV2_IE_SIG_PRIO_IND 157
824 #define GTPV2_IE_TMGI 158
825 #define GTPV2_IE_ADD_MM_CONT_FOR_SRVCC 159
826 #define GTPV2_IE_ADD_FLAGS_FOR_SRVCC 160
827 #define GTPV2_IE_MMBR 161
828 #define GTPV2_IE_MDT_CONFIG 162
829 #define GTPV2_IE_APCO 163
830 #define GTPV2_IE_ABS_MBMS_DATA_TF_TIME 164
831 #define GTPV2_IE_HENB_INFO_REPORT 165
832 #define GTPV2_IE_IP4CP 166
833 #define GTPV2_IE_CHANGE_TO_REPORT_FLAGS 167
834 #define GTPV2_IE_ACTION_INDICATION 168
835 #define GTPV2_IE_TWAN_IDENTIFIER 169
836 #define GTPV2_IE_ULI_TIMESTAMP 170
837 #define GTPV2_IE_MBMS_FLAGS 171
838 #define GTPV2_IE_RAN_NAS_CAUSE 172
839 #define GTPV2_IE_CN_OP_SEL_ENT 173
840 #define GTPV2_IE_TRUST_WLAN_MODE_IND 174
841 #define GTPV2_IE_NODE_NUMBER 175
842 #define GTPV2_IE_NODE_IDENTIFIER 176
843 #define GTPV2_IE_PRES_REP_AREA_ACT 177
844 #define GTPV2_IE_PRES_REP_AREA_INF 178
845 #define GTPV2_IE_TWAN_ID_TS 179
846 #define GTPV2_IE_OVERLOAD_CONTROL_INF 180
847 #define GTPV2_IE_LOAD_CONTROL_INF 181
848 #define GTPV2_IE_METRIC 182
849 #define GTPV2_IE_SEQ_NO 183
850 #define GTPV2_IE_APN_AND_REL_CAP 184
852 /* 169 to 254 reserved for future use */
853 #define GTPV2_IE_PRIVATE_EXT 255
856 #define CREATE_NEW_TFT 0X20
857 #define DELETE_TFT 0X40
858 #define ADD_PACKET_FILTERS_TFT 0X60
859 #define REPLACE_PACKET_FILTERS_TFT 0X80
860 #define DELETE_PACKET_FILTERS_TFT 0XA0
861 #define NO_TFT_OPERATION 0XC0
862 #define RESERVED 0XE0
865 /* Table 8.1-1: Information Element types for GTPv2 */
866 static const value_string gtpv2_element_type_vals[] = {
868 { 1, "International Mobile Subscriber Identity (IMSI)"}, /* Variable Length / 8.3 */
869 { 2, "Cause"}, /* Variable Length / 8.4 */
870 { 3, "Recovery (Restart Counter)"}, /* Variable Length / 8.5 */
871 /* 4-34 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
872 /* 4-34 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
873 /* 35-50 / See 3GPP TS 29.276 */
874 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 6.1*/
875 { 51, "STN-SR"}, /* Variable Length / 6.2 */
876 { 52, "Source to Target Transparent Container"}, /* Variable Length / 6.3 */
877 { 53, "Target to Source Transparent Container"}, /* Variable Length / 6.4 */
878 { 54, "MM Context for E-UTRAN SRVCC"}, /* Variable Length / 6.5 */
879 { 55, "MM Context for UTRAN SRVCC"}, /* Variable Length / 6.6 */
880 { 56, "SRVCC Cause"}, /* Fixed Length / 6.7 */
881 { 57, "Target RNC ID"}, /* Variable Length / 6.8 */
882 { 58, "Target Global Cell ID"}, /* Variable Length / 6.9 */
883 { 59, "TEID-C"}, /* Extendable / 6.10 */
884 { 60, "Sv Flags" }, /* Extendable / 6.11 */
885 { 61, "Service Area Identifier" }, /* Extendable / 6.12 */
886 { 62, "MM Context for CS to PS SRVCC" }, /* Extendable / 6.13 */
887 /* 63-70 For future Sv interface use */
888 /*End SRVCC Messages*/
889 { 71, "Access Point Name (APN)"}, /* Variable Length / 8.6 */
890 { 72, "Aggregate Maximum Bit Rate (AMBR)"}, /* Fixed Length / 8.7 */
891 { 73, "EPS Bearer ID (EBI)"}, /* Extendable / 8.8 */
892 { 74, "IP Address"}, /* Extendable / 8.9 */
893 { 75, "Mobile Equipment Identity (MEI)"}, /* Variable Length / 8.10 */
894 { 76, "MSISDN"}, /* Variable Length / 8.11 */
895 { 77, "Indication"}, /* Extendable / 8.12 */
896 { 78, "Protocol Configuration Options (PCO)"}, /* Variable Length / 8.13 */
897 { 79, "PDN Address Allocation (PAA)"}, /* Variable Length / 8.14 */
898 { 80, "Bearer Level Quality of Service (Bearer QoS)"}, /* Variable Length / 8.15 */
899 { 81, "Flow Quality of Service (Flow QoS)"}, /* Extendable / 8.16 */
900 { 82, "RAT Type"}, /* Extendable / 8.17 */
901 { 83, "Serving Network"}, /* Extendable / 8.18 */
902 { 84, "EPS Bearer Level Traffic Flow Template (Bearer TFT)"}, /* Variable Length / 8.19 */
903 { 85, "Traffic Aggregation Description (TAD)"}, /* Variable Length / 8.20 */
904 { 86, "User Location Info (ULI)"}, /* Variable Length / 8.21 */
905 { 87, "Fully Qualified Tunnel Endpoint Identifier (F-TEID)"}, /* Extendable / 8.22 */
906 { 88, "TMSI"}, /* Variable Length / 8.23 */
907 { 89, "Global CN-Id"}, /* Variable Length / 8.24 */
908 { 90, "S103 PDN Data Forwarding Info (S103PDF)"}, /* Variable Length / 8.25 */
909 { 91, "S1-U Data Forwarding Info (S1UDF)"}, /* Variable Length/ 8.26 */
910 { 92, "Delay Value"}, /* Extendable / 8.27 */
911 { 93, "Bearer Context"}, /* Extendable / 8.28 */
912 { 94, "Charging ID"}, /* Extendable / 8.29 */
913 { 95, "Charging Characteristics"}, /* Extendable / 8.30 */
914 { 96, "Trace Information"}, /* Extendable / 8.31 */
915 { 97, "Bearer Flags"}, /* Extendable / 8.32 */
916 { 98, "Paging Cause"}, /* Variable Length / 8.33 */
917 { 99, "PDN Type"}, /* Extendable / 8.34 */
918 {100, "Procedure Transaction ID"}, /* Extendable / 8.35 */
919 {101, "DRX Parameter"}, /* Variable Length/ 8.36 */
920 {102, "UE Network Capability"}, /* Variable Length / 8.37 */
921 {103, "MM Context (GSM Key and Triplets)"}, /* Variable Length / 8.38 */
922 {104, "MM Context (UMTS Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
923 {105, "MM Context (GSM Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
924 {106, "MM Context (UMTS Key and Quintuplets)"}, /* Variable Length / 8.38 */
925 {107, "MM Context (EPS Security Context, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
926 {108, "MM Context (UMTS Key, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
927 {109, "PDN Connection"}, /* Extendable / 8.39 */
928 {110, "PDU Numbers"}, /* Extendable / 8.40 */
929 {111, "P-TMSI"}, /* Variable Length / 8.41 */
930 {112, "P-TMSI Signature"}, /* Variable Length / 8.42 */
931 {113, "Hop Counter"}, /* Extendable / 8.43 */
932 {114, "UE Time Zone"}, /* Variable Length / 8.44 */
933 {115, "Trace Reference"}, /* Fixed Length / 8.45 */
934 {116, "Complete Request Message"}, /* Variable Length / 8.46 */
935 {117, "GUTI"}, /* Variable Length / 8.47 */
936 {118, "F-Container"}, /* Variable Length / 8.48 */
937 {119, "F-Cause"}, /* Variable Length / 8.49 */
938 {120, "Selected PLMN ID"}, /* Variable Length / 8.50 */
939 {121, "Target Identification"}, /* Variable Length / 8.51 */
940 {122, "NSAPI"}, /* Extendable / 8.52 */
941 {123, "Packet Flow ID"}, /* Variable Length / 8.53 */
942 {124, "RAB Context"}, /* Fixed Length / 8.54 */
943 {125, "Source RNC PDCP Context Info"}, /* Variable Length / 8.55 */
944 {126, "UDP Source Port Number"}, /* Extendable / 8.56 */
945 {127, "APN Restriction"}, /* Extendable / 8.57 */
946 {128, "Selection Mode"}, /* Extendable / 8.58 */
947 {129, "Source Identification"}, /* Variable Length / 8.50 */
948 {130, "Bearer Control Mode"}, /* Extendable / 8.60 */
949 {131, "Change Reporting Action"}, /* Variable Length / 8.61 */
950 {132, "Fully Qualified PDN Connection Set Identifier (FQ-CSID)"}, /* Variable Length / 8.62 */
951 {133, "Channel needed"}, /* Extendable / 8.63 */
952 {134, "eMLPP Priority"}, /* Extendable / 8.64 */
953 {135, "Node Type"}, /* Extendable / 8.65 */
954 {136, "Fully Qualified Domain Name (FQDN)"}, /* Variable Length / 8.66 */
955 {137, "Transaction Identifier (TI)"}, /* Variable Length / 8.68 */
956 {138, "MBMS Session Duration"}, /* Duration Extendable / 8.69 */
957 {139, "MBMS Service Area"}, /* Extendable / 8.70 */
958 {140, "MBMS Session Identifier"}, /* Extendable / 8.71 */
959 {141, "MBMS Flow Identifier"}, /* Extendable / 8.72 */
960 {142, "MBMS IP Multicast Distribution"}, /* Extendable / 8.73 */
961 {143, "MBMS Distribution Acknowledge"}, /* Extendable / 8.74 */
962 {144, "RFSP Index"}, /* Fixed Length / 8.77 */
963 {145, "User CSG Information (UCI)"}, /* Extendable / 8.75 */
964 {146, "CSG Information Reporting Action"}, /* Extendable / 8.76 */
965 {147, "CSG ID"}, /* Extendable / 8.78 */
966 {148, "CSG Membership Indication (CMI)"}, /* Extendable / 8.79 */
967 {149, "Service indicator"}, /* Fixed Length / 8.80 */
968 {150, "Detach Type"}, /* Fixed Length / 8.81 */
969 {151, "Local Distiguished Name (LDN)"}, /* Variable Length / 8.82 */
970 {152, "Node Features"}, /* Extendable / 8.83 */
971 {153, "MBMS Time to Data Transfer"}, /* Extendable / 8.84 */
972 {154, "Throttling"}, /* Extendable / 8.85 */
973 {155, "Allocation/Retention Priority (ARP)"}, /* Extendable / 8.86 */
974 {156, "EPC Timer"}, /* Extendable / 8.87 */
975 {157, "Signalling Priority Indication"}, /* Extendable / 8.88 */
976 {158, "Temporary Mobile Group Identity"}, /* Extendable / 8.89 */
977 {159, "Additional MM context for SRVCC"}, /* Extendable / 8.90 */
978 {160, "Additional flags for SRVCC"}, /* Extendable / 8.91 */
979 {161, "Max MBR/APN-AMBR (MMBR)"}, /* Extendable / 8.92 */
980 {162, "MDT Configuration"}, /* Extendable / 8.93 */
981 {163, "Additional Protocol Configuration Options (APCO)"}, /* Extendable / 8.94 */
982 {164, "Absolute Time of MBMS Data Transfer"}, /* Extendable / 8.95 */
983 {165, "H(e)NB Information Reporting"}, /* Extendable / 8.96*/
984 {166, "IPv4 Configuration Parameters (IP4CP)"}, /* Extendable / 8.97*/
985 {167, "Change to Report Flags"}, /* Extendable / 8.98 */
986 {168, "Action Indication"}, /* Extendable / 8.99 */
987 {169, "TWAN Identifier "}, /* Extendable / 8.100 */
988 {170, "ULI Timestamp"}, /* Extendable / 8.101 */
989 {171, "MBMS Flags"}, /* Extendable / 8.102 */
990 {172, "RAN/NAS Cause"}, /* Extendable / 8.103 */
991 {173, "CN Operator Selection Entity"}, /* Extendable / 8.104 */
992 {174, "Trusted WLAN Mode Indication"}, /* Extendable / 8.105 */
993 {175, "Node Number"}, /* Extendable / 8.106 */
994 {176, "Node Identifier"}, /* Extendable / 8.107 */
995 {177, "Presence Reporting Area Action"}, /* Extendable / 8.108 */
996 {178, "Presence Reporting Area Information"}, /* Extendable / 8.109 */
997 {179, "TWAN Identifier Timestamp"}, /* Extendable / 8.110 */
998 {180, "Overload Control Information"}, /* Extendable / 8.111 */
999 {181, "Load Control Information"}, /* Extendable / 8.112 */
1000 {182, "Metric"}, /* Fixed Length / 8.113 */
1001 {183, "Sequence Number"}, /* Fixed Length / 8.114 */
1002 {184, "APN and Relative Capacity"}, /* Extendable / 8.115 */
1004 /* 185 to 254 Spare. For future use. */
1006 {255, "Private Extension"}, /* Variable Length / 8.67 */
1009 static value_string_ext gtpv2_element_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_element_type_vals);
1011 /* Code to dissect IE's */
1014 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_)
1016 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
1020 * 8.3 International Mobile Subscriber Identity (IMSI)
1022 * IMSI is defined in 3GPP TS 23.003
1023 * Editor's note: IMSI coding will be defined in 3GPP TS 24.301
1024 * Editor's note: In the first release of GTPv2 spec (TS 29.274v8.0.0) n = 8.
1025 * That is, the overall length of the IE is 11 octets.
1029 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_)
1032 const gchar *imsi_str;
1034 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1035 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the wmem
1036 * allocated string will be returned.
1038 imsi_str = dissect_e212_imsi(tvb, pinfo, tree, offset, length, FALSE);
1039 proto_item_append_text(item, "%s", imsi_str);
1047 /* Table 8.4-1: Cause values */
1048 static const value_string gtpv2_cause_vals[] = {
1050 /* Request / Initial message */
1052 { 2, "Local Detach"},
1053 { 3, "Complete Detach"},
1054 { 4, "RAT changed from 3GPP to Non-3GPP"},
1055 { 5, "ISR deactivation"},
1056 { 6, "Error Indication received from RNC/eNodeB/S4-SGSN"},
1057 { 7, "IMSI Detach Only"},
1058 { 8, "Reactivation Requested"},
1059 { 9, "PDN reconnection to this APN disallowed"},
1060 { 10, "Access changed from Non-3GPP to 3GPP"},
1061 { 11, "PDN connection inactivity timer expires"},
1062 { 12, "PGW not responding"},
1063 { 13, "Network Failure"},
1064 { 14, "QoS parameter mismatch"},
1065 /* 15 Spare. This value range is reserved for Cause values in a request message */
1067 /* Acceptance in a Response / triggered message */
1068 { 16, "Request accepted"},
1069 { 17, "Request accepted partially"},
1070 { 18, "New PDN type due to network preference"},
1071 { 19, "New PDN type due to single address bearer only"},
1072 /* 20-63 Spare. This value range shall be used by Cause values in an acceptance response/triggered message */
1117 /* Rejection in a Response / triggered message */
1118 { 64, "Context Not Found"},
1119 { 65, "Invalid Message Format"},
1120 { 66, "Version not supported by next peer"},
1121 { 67, "Invalid length"},
1122 { 68, "Service not supported"},
1123 { 69, "Mandatory IE incorrect"},
1124 { 70, "Mandatory IE missing"},
1125 { 71, "Shall not be used"},
1126 { 72, "System failure"},
1127 { 73, "No resources available"},
1128 { 74, "Semantic error in the TFT operation"},
1129 { 75, "Syntactic error in the TFT operation"},
1130 { 76, "Semantic errors in packet filter(s)"},
1131 { 77, "Syntactic errors in packet filter(s)"},
1132 { 78, "Missing or unknown APN"},
1133 { 79, "Shall not be used"},
1134 { 80, "GRE key not found"},
1135 { 81, "Relocation failure"},
1136 { 82, "Denied in RAT"},
1137 { 83, "Preferred PDN type not supported"},
1138 { 84, "All dynamic addresses are occupied"},
1139 { 85, "UE context without TFT already activated"},
1140 { 86, "Protocol type not supported"},
1141 { 87, "UE not responding"},
1142 { 88, "UE refuses"},
1143 { 89, "Service denied"},
1144 { 90, "Unable to page UE"},
1145 { 91, "No memory available"},
1146 { 92, "User authentication failed"},
1147 { 93, "APN access denied - no subscription"},
1148 { 94, "Request rejected(reason not specified)"},
1149 { 95, "P-TMSI Signature mismatch"},
1150 { 96, "IMSI/IMEI not known"},
1151 { 97, "Semantic error in the TAD operation"},
1152 { 98, "Syntactic error in the TAD operation"},
1153 { 99, "Shall not be used"},
1154 {100, "Remote peer not responding"},
1155 {101, "Collision with network initiated request"},
1156 {102, "Unable to page UE due to Suspension"},
1157 {103, "Conditional IE missing"},
1158 {104, "APN Restriction type Incompatible with currently active PDN connection"},
1159 {105, "Invalid overall length of the triggered response message and a piggybacked initial message"},
1160 {106, "Data forwarding not supported"},
1161 {107, "Invalid reply from remote peer"},
1162 {108, "Fallback to GTPv1"},
1163 {109, "Invalid peer"},
1164 {110, "Temporarily rejected due to handover procedure in progress"},
1165 {111, "Modifications not limited to S1-U bearers"},
1166 {112, "Request rejected for a PMIPv6 reason "},
1167 {113, "APN Congestion"},
1168 {114, "Bearer handling not supported"},
1169 {115, "UE already re-attached"},
1170 {116, "Multiple PDN connections for a given APN not allowed"},
1171 /* 117-239 Spare. For future use in a triggered/response message */
1172 /* 240-255 Spare. For future use in an initial/request message */
1175 value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals);
1177 /* Table 8.4-1: CS (Cause Source) */
1178 static const true_false_string gtpv2_cause_cs = {
1179 "Originated by remote node",
1180 "Originated by node sending the message",
1184 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_)
1189 /* Cause value octet 5 */
1190 tmp = tvb_get_guint8(tvb, offset);
1191 proto_tree_add_item(tree, hf_gtpv2_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1193 /* Add Cause to ie_tree */
1194 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(tmp, >pv2_cause_vals_ext, "Unknown"), tmp);
1197 /* Octet 6 Spare PCE BCE CS */
1198 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
1199 proto_tree_add_item(tree, hf_gtpv2_cause_pce, tvb, offset, 1, ENC_BIG_ENDIAN);
1200 proto_tree_add_item(tree, hf_gtpv2_cause_bce, tvb, offset, 1, ENC_BIG_ENDIAN);
1201 proto_tree_add_item(tree, hf_gtpv2_cause_cs, tvb, offset, 1, ENC_BIG_ENDIAN);
1204 /* If n = 2, a = 0 and the Cause IE shall be 6 octets long.
1205 * Therefore, octets "a(n+1) to a(n+4)" will not be present.
1206 * If n = 6, a = 1 and the Cause IE will be 10 octets long.
1208 if ( length == 2 ) {
1212 * If the rejection is due to a mandatory IE or a verifiable conditional IE is faulty
1213 * or missing, the offending IE shall be included within an additional field "a(n+1)
1214 * to a(n+4)". Only Type and Instance fields of the offending IE that caused the
1215 * rejection have a meaning. The length in the Octet 8-9 and spare bits in the Octet 10
1216 * shall be set to "0". In this case, the value of "n" shall be "6".
1217 * Otherwise, the value of "n" is equal to "2".
1220 /* Type of the offending IE */
1221 proto_tree_add_item(tree, hf_gtpv2_cause_off_ie_t, tvb, offset, 1, ENC_BIG_ENDIAN);
1225 proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
1227 /* a(n+4) Spare Instance */
1228 proto_tree_add_bits_item(tree, hf_gtpv2_spare_half_octet, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
1229 proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
1234 * 8.5 Recovery (Restart Counter)
1237 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_)
1242 recovery = tvb_get_guint8(tvb, offset);
1243 proto_tree_add_item(tree, hf_gtpv2_rec, tvb, offset, 1, ENC_BIG_ENDIAN);
1244 proto_item_append_text(item, "%u", recovery);
1249 /*Start SRVCC Messages*/
1253 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_)
1255 proto_item *stn_sr_item;
1256 proto_tree *sub_tree;
1260 stn_sr_item = proto_tree_add_item(tree, hf_gtpv2_stn_sr, tvb, offset, length, ENC_NA);
1261 new_tvb = tvb_new_subset_length(tvb, offset, length);
1262 sub_tree = proto_item_add_subtree(stn_sr_item, ett_gtpv2_stn_sr);
1265 * contains the Nature of Address and Numbering Plan Indicator (NANPI) of the "AddressString" ASN.1 type (see 3GPP
1266 * 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
1267 * 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
1270 dissect_gsm_map_msisdn(new_tvb, pinfo, sub_tree);
1273 /* 6.3 Source to Target Transparent Container */
1276 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_)
1279 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1281 /*ra_type_flag = 0;*/
1283 /* Transparent Container
1284 * When target network is GERAN, this container carries the Old BSS to New BSS
1285 * Information IE defined in 3GPP TS 48.008 [8]. When target network is UTRAN, this container carries the Source RNC
1286 * to Target RNC Transparent Container IE defined in 3GPP TS 25.413 [9]. The Transparent container field includes the
1287 * IE value part as it is specified in the respective specification.
1289 proto_tree_add_item(tree, hf_gtpv2_transparent_container, tvb, offset, length-1, ENC_NA);
1291 * bssmap_old_bss_to_new_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo);
1292 * dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
1297 /* 6.4 Target to Source Transparent Container */
1299 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_)
1302 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
1305 /* Transparent Container */
1306 proto_tree_add_item(tree, hf_gtpv2_transparent_container, tvb, offset, length-1, ENC_NA);
1311 /* 6.5 MM Context for E-UTRAN SRVCC */
1313 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_)
1317 proto_tree *ms_tree, *fi;
1319 proto_tree_add_item(tree, hf_gtpv2_eksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1321 proto_tree_add_item(tree, hf_gtpv2_cksrvcc, tvb, offset, 16, ENC_NA);
1323 proto_tree_add_item(tree, hf_gtpv2_iksrvcc, tvb, offset, 16, ENC_NA);
1326 /* Length of Mobile Station Classmark2 */
1327 elm_len = tvb_get_guint8(tvb, offset);
1328 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1330 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
1331 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1332 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1335 /* Length of Mobile Station Classmark3 */
1336 elm_len = tvb_get_guint8(tvb, offset);
1337 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1339 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
1340 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1341 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1344 /*Length of Supported Codec List */
1345 elm_len = tvb_get_guint8(tvb, offset);
1346 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1348 fi = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
1349 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1350 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1354 /* 6.6 MM Context for UTRAN SRVCC */
1356 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_)
1360 proto_tree *ms_tree, *fi;
1362 proto_tree_add_item(tree, hf_gtpv2_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
1365 proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_ck_cs, tvb, offset, 16, ENC_NA);
1367 proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_ik_cs, tvb, offset, 16, ENC_NA);
1369 proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_kc, tvb, offset, 8, ENC_NA);
1371 proto_tree_add_item(tree, hf_gtpv2_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
1374 /*Length of Mobile Station Classmark2 */
1375 elm_len = tvb_get_guint8(tvb, offset);
1376 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
1378 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
1379 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1380 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1383 /*Length of Mobile Station Classmark3 */
1384 elm_len = tvb_get_guint8(tvb, offset);
1385 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
1387 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
1388 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
1389 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1392 /*Length of Supported Codec List */
1393 elm_len = tvb_get_guint8(tvb, offset);
1394 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
1396 fi = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
1397 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
1398 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
1402 /* 6.7 SRVCC Cause */
1403 static const value_string gtpv2_srvcc_cause_vals[] = {
1406 {2, "Handover/Relocation cancelled by source system "},
1407 {3, "Handover /Relocation Failure with Target system"},
1408 {4, "Handover/Relocation Target not allowed"},
1409 {5, "Unknown Target ID"},
1410 {6, "Target Cell not available"},
1411 {7, "No Radio Resources Available in Target Cell"},
1412 {8, "Failure in Radio Interface Procedure"},
1413 {9, "Permanent session leg establishment error"},
1414 {10, "Temporary session leg establishment error"},
1418 static value_string_ext gtpv2_srvcc_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_srvcc_cause_vals);
1421 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_)
1426 srvcc_cause = tvb_get_guint8(tvb, offset);
1427 proto_tree_add_item(tree, hf_gtpv2_srvcc_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
1428 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(srvcc_cause, >pv2_srvcc_cause_vals_ext, "Unknown"), srvcc_cause);
1433 * 3GPP TS 29.280 version 10.3.0
1437 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_)
1441 proto_tree *subtree;
1445 guint32 curr_offset;
1447 /*ra_type_flag = 1;*/ /*Flag to be set to differentiate GERAN and UTRAN*/
1448 curr_offset = offset;
1450 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1451 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1452 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1453 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1454 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1455 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1456 if ((mnc & 0x000f) == 0x000f)
1459 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1460 rnc_id = tvb_get_ntohs(tvb, curr_offset + 5);
1462 subtree = proto_tree_add_subtree_format(tree,
1463 tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
1464 "Routing area identification: %x-%x-%u-%u",
1465 mcc, mnc, lac, rnc_id);
1467 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, E212_RAI, TRUE);
1470 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1472 proto_tree_add_item(subtree, hf_gtpv2_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
1475 /* no length check possible */
1482 * 6.9 Target Global Cell ID
1483 * The encoding of this IE is defined in 3GPP TS 29.002
1484 * GlobalCellId ::= OCTET STRING (SIZE (5..7))
1485 * -- Refers to Cell Global Identification defined in TS 3GPP TS 23.003 [17].
1486 * -- The internal structure is defined as follows:
1487 * -- octet 1 bits 4321 Mobile Country Code 1st digit
1488 * -- bits 8765 Mobile Country Code 2nd digit
1489 * -- octet 2 bits 4321 Mobile Country Code 3rd digit
1490 * -- bits 8765 Mobile Network Code 3rd digit
1491 * -- or filler (1111) for 2 digit MNCs
1492 * -- octet 3 bits 4321 Mobile Network Code 1st digit
1493 * -- bits 8765 Mobile Network Code 2nd digit
1494 * -- octets 4 and 5 Location Area Code according to TS 3GPP TS 24.008 [35]
1495 * -- octets 6 and 7 Cell Identity (CI) according to TS 3GPP TS 24.008 [35]
1498 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_)
1502 proto_tree *subtree;
1506 guint32 curr_offset;
1508 curr_offset = offset;
1510 mcc = (tvb_get_guint8(tvb, curr_offset) & 0x0f) << 8;
1511 mcc |= (tvb_get_guint8(tvb, curr_offset) & 0xf0);
1512 mcc |= (tvb_get_guint8(tvb, curr_offset+1) & 0x0f);
1513 mnc = (tvb_get_guint8(tvb, curr_offset+2) & 0x0f) << 8;
1514 mnc |= (tvb_get_guint8(tvb, curr_offset+2) & 0xf0);
1515 mnc |= (tvb_get_guint8(tvb, curr_offset+1) & 0xf0) >> 4;
1516 if ((mnc & 0x000f) == 0x000f)
1519 lac = tvb_get_ntohs(tvb, curr_offset + 3);
1520 tgt_cell_id = tvb_get_guint8(tvb, curr_offset + 5);
1522 subtree = proto_tree_add_subtree_format(tree,
1523 tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
1524 "Routing area identification: %x-%x-%u-%u",
1525 mcc, mnc, lac, tgt_cell_id);
1527 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, E212_RAI, TRUE);
1529 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset + 3, 2, ENC_BIG_ENDIAN);
1530 proto_tree_add_item(subtree, hf_gtpv2_tgt_g_cell_id, tvb, curr_offset + 5, 2, ENC_BIG_ENDIAN);
1532 proto_item_append_text(item, "%x-%x-%u-%u", mcc, mnc, lac, tgt_cell_id);
1533 /* no length check possible */
1537 /* 6.10 Tunnel Endpoint Identifier for Control Plane (TEID-C) */
1539 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_)
1543 proto_tree_add_item(tree, hf_gtpv2_teid_c, tvb, offset, 4, ENC_BIG_ENDIAN);
1546 proto_tree_add_item(tree, hf_gtpv2_teid_c_spare, tvb, offset, length-4, ENC_NA);
1548 proto_item_append_text(item, "%u", tvb_get_ntohl(tvb, offset-4));
1553 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_)
1556 proto_tree_add_item(tree, hf_gtpv2_sv_sti, tvb, offset, 1, ENC_BIG_ENDIAN);
1557 proto_tree_add_item(tree, hf_gtpv2_sv_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
1558 proto_tree_add_item(tree, hf_gtpv2_sv_emind, tvb, offset, 1, ENC_BIG_ENDIAN);
1561 proto_tree_add_item(tree, hf_gtpv2_teid_c_spare, tvb, offset, length-1, ENC_NA);
1564 /* 6.12 Service Area Identifier */
1567 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_)
1571 /* 5 MCC digit 2 MCC digit 1
1572 * 6 MNC digit 3 MCC digit 3
1573 * 7 MNC digit 2 MNC digit 1
1575 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_SAI, TRUE);
1578 /* 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
1579 * least significant bit. The coding of the location area code is the responsibility of each administration. Coding using full
1580 * hexadecimal representation shall be used.
1582 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
1585 /* 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
1586 * least significant bit. The SAC is defined by the operator. See 3GPP TS 23.003 [4] subclause 12.5 for more information
1588 proto_tree_add_item(tree, hf_gtpv2_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
1591 /* 6.13 MM Context for CS to PS SRVCC */
1593 dissect_gtpv2_mm_ctx_for_cs_to_ps_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_)
1597 /* Octet 5 KSI"PS */
1598 proto_tree_add_item(tree, hf_gtpv2_ksi_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
1601 /* octet 6 - 21 CK'PS */
1602 proto_tree_add_item(tree, hf_gtpv2_ck_ps, tvb, offset, 16, ENC_NA);
1605 /* octet 22 - 37 IK'PS */
1606 proto_tree_add_item(tree, hf_gtpv2_ik_ps, tvb, offset, 16, ENC_NA);
1609 /* octet 38 to 45 kc'PS */
1610 proto_tree_add_item(tree, hf_gtpv2_kc_ps, tvb, offset, 8, ENC_NA);
1613 /* Octet 46 CKSN"PS */
1614 proto_tree_add_item(tree, hf_gtpv2_cksn_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
1618 /*End SRVCC Messages*/
1622 * 8.6 Access Point Name (APN)
1623 * The encoding the APN field follows 3GPP TS 23.003 [2] subclause 9.1.
1624 * The content of the APN field shall be the full APN with both the APN Network Identifier
1625 * and APN Operator Identifier being present as specified in 3GPP TS 23.003 [2]
1626 * 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.
1629 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_)
1636 name_len = tvb_get_guint8(tvb, offset);
1638 if (name_len < 0x20) {
1639 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
1641 if (name_len >= length - 1)
1644 name_len = name_len + apn[tmp] + 1;
1648 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
1650 proto_tree_add_string(tree, hf_gtpv2_apn, tvb, offset, length, apn);
1654 proto_item_append_text(item, "%s", apn);
1659 * 8.7 Aggregate Maximum Bit Rate (AMBR)
1663 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_)
1667 proto_tree_add_item(tree, hf_gtpv2_ambr_up, tvb, offset, 4, ENC_BIG_ENDIAN);
1669 proto_tree_add_item(tree, hf_gtpv2_ambr_down, tvb, offset, 4, ENC_BIG_ENDIAN);
1673 * 8.8 EPS Bearer ID (EBI)
1676 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_)
1682 /* Spare (all bits set to 0) B8 - B5*/
1683 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
1684 /* EPS Bearer ID (EBI) B4 - B1 */
1685 ebi = tvb_get_guint8(tvb, offset);
1686 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
1687 proto_item_append_text(item, "%u", ebi);
1694 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_)
1700 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv4, tvb, offset, length, ENC_BIG_ENDIAN);
1701 proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(tvb, offset));
1703 else if (length == 16)
1705 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv6, tvb, offset, length, ENC_NA);
1706 proto_item_append_text(item, "IPv6 %s", tvb_ip6_to_str(tvb, offset));
1710 * 8.10 Mobile Equipment Identity (MEI)
1711 * The ME Identity field contains either the IMEI or the IMEISV
1712 * as defined in clause 6.2 of 3GPP TS 23.003 [2]. It is encoded
1713 * as specified in clause 7.7.53 of 3GPP TS 29.060 [4], beginning
1714 * with octet 4 of Figure 7.7.53.1. The IMEI(SV) digits are encoded
1715 * using BCD coding where IMEI is 15 BCD digits and IMEISV is 16 BCD
1716 * digits. For IMEI, bits 5 to 8 of the last octet shall be filled
1717 * with an end mark coded as '1111'.
1721 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_)
1724 const gchar *mei_str;
1726 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1727 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1728 * allocated string will be returned.
1730 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, 0, length, NULL, FALSE);
1732 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, length, mei_str);
1733 proto_item_append_text(item, "%s", mei_str);
1739 * MSISDN is defined in 3GPP TS 23.003
1740 * Editor's note: MSISDN coding will be defined in TS 24.301.
1743 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_)
1745 const char *digit_str;
1747 /* Octets 5 to (n+4) represent the MSISDN value is in international number format
1748 * as described in ITU-T Rec E.164 [25] and 3GPP TS 29.002 [41].
1749 * MSISDN value contains only the actual MSISDN number (does not contain the "nature of
1750 * address indicator" octet, which indicates "international number"
1751 * as in 3GPP TS 29.002 [41]) and is encoded as TBCD digits, i.e.
1752 * digits from 0 through 9 are encoded "0000" to "1001".
1753 * When there is an odd number of digits, bits 8 to 5 of the last octet are encoded with
1754 * the filler "1111".
1756 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1757 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
1758 * allocated string will be returned.
1760 digit_str = dissect_e164_msisdn(tvb, tree, 0, length, E164_ENC_BCD);
1761 proto_item_append_text(item, "%s", digit_str);
1768 dissect_gtpv2_ind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
1771 /* Octet 5 DAF DTF HI DFI OI ISRSI ISRAI SGWCI */
1772 proto_tree_add_item(tree, hf_gtpv2_daf, tvb, offset, 1, ENC_BIG_ENDIAN);
1773 proto_tree_add_item(tree, hf_gtpv2_dtf, tvb, offset, 1, ENC_BIG_ENDIAN);
1774 proto_tree_add_item(tree, hf_gtpv2_hi, tvb, offset, 1, ENC_BIG_ENDIAN);
1775 proto_tree_add_item(tree, hf_gtpv2_dfi, tvb, offset, 1, ENC_BIG_ENDIAN);
1776 proto_tree_add_item(tree, hf_gtpv2_oi, tvb, offset, 1, ENC_BIG_ENDIAN);
1777 proto_tree_add_item(tree, hf_gtpv2_isrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1778 proto_tree_add_item(tree, hf_gtpv2_israi, tvb, offset, 1, ENC_BIG_ENDIAN);
1779 proto_tree_add_item(tree, hf_gtpv2_sgwci, tvb, offset, 1, ENC_BIG_ENDIAN);
1782 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length, "Older version?, should be 2 octets in 8.0.0");
1788 /* Octet 6 SQCI UIMSI CFSI CRSI P PT SI MSV
1789 * 3GPP TS 29.274 version 9.4.0 Release 9
1791 proto_tree_add_item(tree, hf_gtpv2_sqci, tvb, offset, 1, ENC_BIG_ENDIAN);
1792 proto_tree_add_item(tree, hf_gtpv2_uimsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1793 proto_tree_add_item(tree, hf_gtpv2_cfsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1794 proto_tree_add_item(tree, hf_gtpv2_crsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1796 proto_tree_add_item(tree, hf_gtpv2_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
1797 proto_tree_add_item(tree, hf_gtpv2_pt, tvb, offset, 1, ENC_BIG_ENDIAN);
1798 proto_tree_add_item(tree, hf_gtpv2_si, tvb, offset, 1, ENC_BIG_ENDIAN);
1799 proto_tree_add_item(tree, hf_gtpv2_msv, tvb, offset, 1, ENC_BIG_ENDIAN);
1805 /* Only present in version 9 and higher */
1806 /* Octet 7 RetLoc PBIC SRNI S6AF S4AF MBMDT ISRAU CCRSI */
1807 proto_tree_add_item(tree, hf_gtpv2_retloc, tvb, offset, 1, ENC_BIG_ENDIAN);
1808 proto_tree_add_item(tree, hf_gtpv2_pbic, tvb, offset, 1, ENC_BIG_ENDIAN);
1809 proto_tree_add_item(tree, hf_gtpv2_srni, tvb, offset, 1, ENC_BIG_ENDIAN);
1810 proto_tree_add_item(tree, hf_gtpv2_s6af, tvb, offset, 1, ENC_BIG_ENDIAN);
1811 proto_tree_add_item(tree, hf_gtpv2_s4af, tvb, offset, 1, ENC_BIG_ENDIAN);
1812 proto_tree_add_item(tree, hf_gtpv2_mbmdt, tvb, offset, 1, ENC_BIG_ENDIAN);
1813 proto_tree_add_item(tree, hf_gtpv2_israu, tvb, offset, 1, ENC_BIG_ENDIAN);
1814 proto_tree_add_item(tree, hf_gtpv2_ccrsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1820 /* Octet 8 CPRAI ARRL PPOF PPON/PPEI PPSI CSFBI CLII CPSR */
1821 proto_tree_add_item(tree, hf_gtpv2_cprai, tvb, offset, 1, ENC_BIG_ENDIAN);
1822 proto_tree_add_item(tree, hf_gtpv2_arrl, tvb, offset, 1, ENC_BIG_ENDIAN);
1823 proto_tree_add_item(tree, hf_gtpv2_ppof, tvb, offset, 1, ENC_BIG_ENDIAN);
1824 proto_tree_add_item(tree, hf_gtpv2_ppon_ppei, tvb, offset, 1, ENC_BIG_ENDIAN);
1825 proto_tree_add_item(tree, hf_gtpv2_ppsi, tvb, offset, 1, ENC_BIG_ENDIAN);
1826 proto_tree_add_item(tree, hf_gtpv2_csfbi, tvb, offset, 1, ENC_BIG_ENDIAN);
1827 proto_tree_add_item(tree, hf_gtpv2_clii, tvb, offset, 1, ENC_BIG_ENDIAN);
1828 proto_tree_add_item(tree, hf_gtpv2_cpsr, tvb, offset, 1, ENC_BIG_ENDIAN);
1835 /* Octet 9 Spare Spare Spare Spare Spare PCRI AOSI AOPI */
1836 proto_tree_add_item(tree, hf_gtpv2_pcri, tvb, offset, 1, ENC_BIG_ENDIAN);
1837 proto_tree_add_item(tree, hf_gtpv2_aosi, tvb, offset, 1, ENC_BIG_ENDIAN);
1838 proto_tree_add_item(tree, hf_gtpv2_aopi, tvb, offset, 1, ENC_BIG_ENDIAN);
1845 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
1851 * 8.13 Protocol Configuration Options (PCO)
1852 * Protocol Configuration Options (PCO) is transferred via GTP tunnels. The sending entity copies the value part of the
1853 * 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
1854 * as per clause 10.5.6.3 of 3GPP TS 24.008 [5], starting with octet 3.
1855 * Dissected in packet-gsm_a_gm.c
1858 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_)
1860 switch (message_type) {
1861 case GTPV2_CREATE_SESSION_REQUEST:
1862 case GTPV2_DELETE_SESSION_REQUEST:
1863 case GTPV2_BEARER_RESOURCE_COMMAND:
1864 case GTPV2_CREATE_BEARER_RESPONSE:
1865 case GTPV2_UPDATE_BEARER_RESPONSE:
1866 case GTPV2_DELETE_BEARER_RESPONSE:
1867 /* PCO options as MS to network direction */
1868 pinfo->link_dir = P2P_DIR_UL;
1870 case GTPV2_CREATE_SESSION_RESPONSE:
1871 case GTPV2_MODIFY_BEARER_RESPONSE:
1872 case GTPV2_DELETE_SESSION_RESPONSE:
1873 case GTPV2_CREATE_BEARER_REQUEST:
1874 case GTPV2_UPDATE_BEARER_REQUEST:
1875 case GTPV2_DELETE_BEARER_REQUEST:
1876 /* PCO options as Network to MS direction: */
1877 pinfo->link_dir = P2P_DIR_DL;
1882 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
1886 * 8.14 PDN Address Allocation (PAA)
1889 static const value_string gtpv2_pdn_type_vals[] = {
1897 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_)
1902 pdn_type = tvb_get_guint8(tvb, offset);
1903 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, 1, ENC_BIG_ENDIAN);
1909 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1913 /* If PDN type value indicates IPv6, octet 6 contains the IPv6 Prefix Length.
1914 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1915 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1916 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1918 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1920 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1924 /* If PDN type value indicates IPv4v6, octet 6 contains the IPv6 Prefix Length.
1925 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
1926 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
1927 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
1928 * Octets 23 through 26 contain an IPv4 address. Bit 8 of octet 23 represents
1929 * the most significant bit of the IPv4 address and bit 1 of octet 26 the least
1932 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
1934 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
1936 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
1943 * 8.15 Bearer Quality of Service (Bearer QoS)
1947 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_)
1950 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
1951 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
1952 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
1954 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1956 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1958 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1960 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1962 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1966 * 8.16 Flow Quality of Service (Flow QoS)
1970 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_)
1973 proto_tree_add_item(tree, hf_gtpv2_flow_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
1975 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1977 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1979 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
1981 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
1987 static const value_string gtpv2_rat_type_vals[] = {
1993 {5, "HSPA Evolution"},
1998 static value_string_ext gtpv2_rat_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_rat_type_vals);
2002 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_)
2006 rat_type = tvb_get_guint8(tvb, 0);
2007 proto_tree_add_item(tree, hf_gtpv2_rat_type, tvb, 0, 1, ENC_BIG_ENDIAN);
2008 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(rat_type, >pv2_rat_type_vals_ext, "Unknown"), rat_type);
2013 * 8.18 Serving Network
2016 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_)
2020 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, TRUE);
2021 proto_item_append_text(item, "%s", mcc_mnc_str);
2025 * 8.19 EPS Bearer Level Traffic Flow Template (Bearer TFT)
2029 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_)
2031 /* The detailed coding of Traffic Aggregate
2032 * Description is specified in 3GPP TS 24.008 [5] ,
2033 * clause 10.5.6.12, beginning with octet 3..
2034 * Use the decoding in packet-gsm_a_gm.c
2036 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
2039 /* 8.20 Traffic Aggregate Description (TAD)
2042 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_)
2044 /* The detailed coding of Traffic Aggregate
2045 * Description is specified in 3GPP TS 24.008 [5] ,
2046 * clause 10.5.6.12, beginning with octet 3..
2047 * Use the decoding in packet-gsm_a_gm.c
2049 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
2053 * 8.21 User Location Info (ULI)
2055 * The flags ECGI, TAI, RAI, SAI and CGI in octed 5 indicate if the corresponding
2056 * fields are present in the IE or not. If one of these flags is set to "0",
2057 * the corresponding field is not present at all. The respective identities are defined in 3GPP
2059 * Editor's Note: The definition of ECGI is missing in 3GPP TS 23.003 v8.1.0.
2060 * It can be found in 3GPP TS 36.413 v8.3.0, but it is expected that it will be moved
2061 * to 23.003 in a future version.
2064 dissect_gtpv2_tai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
2070 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, TRUE);
2072 tac = tvb_get_ntohs(tvb, *offset);
2073 proto_tree_add_item(tree, hf_gtpv2_tai_tac, tvb, *offset, 2, ENC_BIG_ENDIAN);
2075 str = wmem_strdup_printf(wmem_packet_scope(), "%s, TAC 0x%x",
2083 dissect_gtpv2_ecgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
2092 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, TRUE);
2094 /* The bits 8 through 5, of octet e+3 (Fig 8.21.5-1 in TS 29.274 V8.2.0) are spare
2095 * and hence they would not make any difference to the hex string following it,
2096 * thus we directly read 4 bytes from the tvb
2099 octet = tvb_get_guint8(tvb, *offset);
2100 spare = octet & 0xF0;
2101 octet4 = tvb_get_ntohl(tvb, *offset);
2102 ECGI = octet4 & 0x0FFFFFFF;
2103 proto_tree_add_uint(tree, hf_gtpv2_ecgi_eci_spare, tvb, *offset, 1, spare);
2104 /* The coding of the E-UTRAN cell identifier is the responsibility of each administration.
2105 * Coding using full hexadecimal representation shall be used.
2107 proto_tree_add_uint(tree, hf_gtpv2_ecgi_eci, tvb, *offset, 4, ECGI);
2108 /*proto_tree_add_item(tree, hf_gtpv2_ecgi_eci, tvb, offset, 4, ENC_BIG_ENDIAN);*/
2110 str = wmem_strdup_printf(wmem_packet_scope(), "%s, ECGI 0x%x",
2119 dissect_gtpv2_rai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
2125 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_RAI, TRUE);
2127 lac = tvb_get_ntohs(tvb, *offset);
2128 proto_tree_add_item(tree, hf_gtpv2_rai_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
2130 rac = tvb_get_ntohs(tvb, *offset);
2131 proto_tree_add_item(tree, hf_gtpv2_rai_rac, tvb, *offset, 2, ENC_BIG_ENDIAN);
2133 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, RAC 0x%x",
2142 dissect_gtpv2_sai_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
2148 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_SAI, TRUE);
2150 lac = tvb_get_ntohs(tvb, *offset);
2151 proto_tree_add_item(tree, hf_gtpv2_sai_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
2153 sac = tvb_get_ntohs(tvb, *offset);
2154 proto_tree_add_item(tree, hf_gtpv2_sai_sac, tvb, *offset, 2, ENC_BIG_ENDIAN);
2156 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, SAC 0x%x",
2165 dissect_gtpv2_cgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
2171 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, TRUE);
2173 lac = tvb_get_ntohs(tvb, *offset);
2174 proto_tree_add_item(tree, hf_gtpv2_uli_cgi_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
2176 ci = tvb_get_ntohs(tvb, *offset);
2177 proto_tree_add_item(tree, hf_gtpv2_uli_cgi_ci, tvb, *offset, 2, ENC_BIG_ENDIAN);
2179 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x, CI 0x%x",
2188 decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 instance _U_, guint flags)
2190 int offset = 1; /* flags are already dissected */
2191 proto_tree *part_tree;
2195 /* 8.21.1 CGI field */
2196 if (flags & GTPv2_ULI_CGI_MASK)
2199 proto_item_append_text(item, "CGI ");
2200 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
2201 ett_gtpv2_uli_field, NULL, "Cell Global Identity (CGI)");
2203 str = dissect_gtpv2_cgi(tvb, pinfo, part_tree, &offset);
2205 if (offset == length)
2209 /* 8.21.2 SAI field */
2210 if (flags & GTPv2_ULI_SAI_MASK)
2212 proto_item_append_text(item, "SAI ");
2213 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
2214 ett_gtpv2_uli_field, NULL, "Service Area Identity (SAI)");
2216 str = dissect_gtpv2_sai_common(tvb, pinfo, part_tree, &offset);
2218 if (offset == length)
2221 /* 8.21.3 RAI field */
2222 if (flags & GTPv2_ULI_RAI_MASK)
2224 proto_item_append_text(item, "RAI ");
2225 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
2226 ett_gtpv2_uli_field, NULL, "Routeing Area Identity (RAI)");
2228 str = dissect_gtpv2_rai(tvb, pinfo, part_tree, &offset);
2230 if (offset == length)
2233 /* 8.21.4 TAI field */
2234 if (flags & GTPv2_ULI_TAI_MASK)
2236 proto_item_append_text(item, "TAI ");
2237 part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
2238 ett_gtpv2_uli_field, NULL, "Tracking Area Identity (TAI)");
2240 str = dissect_gtpv2_tai(tvb, pinfo, part_tree, &offset);
2242 if (offset == length)
2245 /* 8.21.5 ECGI field */
2246 if (flags & GTPv2_ULI_ECGI_MASK)
2248 proto_item_append_text(item, "ECGI ");
2249 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
2250 ett_gtpv2_uli_field, NULL, "E-UTRAN Cell Global Identifier (ECGI)");
2252 str = dissect_gtpv2_ecgi(tvb, pinfo, part_tree, &offset);
2254 if (offset == length)
2258 /* 8.21.6 LAI field */
2259 if (flags & GTPv2_ULI_LAI_MASK)
2262 proto_item_append_text(item, "LAI ");
2263 part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
2264 ett_gtpv2_uli_field, NULL, "LAI (Location Area Identifier)");
2265 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, E212_LAI, TRUE);
2268 /* The Location Area Code (LAC) consists of 2 octets. Bit 8 of Octet f+3 is the most significant bit
2269 * and bit 1 of Octet f+4 the least significant bit. The coding of the location area code is the
2270 * responsibility of each administration. Coding using full hexadecimal representation shall be used.
2272 proto_tree_add_item(part_tree, hf_gtpv2_uli_lai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
2273 lac = tvb_get_ntohs(tvb, offset);
2274 str = wmem_strdup_printf(wmem_packet_scope(), "%s, LAC 0x%x",
2285 dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
2287 proto_tree *flag_tree;
2291 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtpv2_uli_flags, NULL, "Flags");
2292 flags = tvb_get_guint8(tvb, offset) & 0x3f;
2293 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset >> 3, 2, ENC_BIG_ENDIAN);
2296 proto_tree_add_item(flag_tree, hf_gtpv2_uli_lai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2298 proto_tree_add_item(flag_tree, hf_gtpv2_uli_ecgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2300 proto_tree_add_item(flag_tree, hf_gtpv2_uli_tai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2302 proto_tree_add_item(flag_tree, hf_gtpv2_uli_rai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2304 proto_tree_add_item(flag_tree, hf_gtpv2_uli_sai_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2306 proto_tree_add_item(flag_tree, hf_gtpv2_uli_cgi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
2308 decode_gtpv2_uli(tvb, pinfo, tree, item, length, instance, flags);
2313 /* Diameter 3GPP AVP Code: 22 3GPP-User-Location-Info */
2316 * 16.4.7.2 Coding 3GPP Vendor-Specific RADIUS attributes
2318 * For P-GW, the Geographic Location Type values and coding are defined as follows:
2323 * 3-127 Spare for future use
2327 * 131-255 Spare for future use
2331 static const value_string geographic_location_type_vals[] = {
2337 {130, "TAI and ECGI"},
2342 dissect_diameter_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
2344 diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
2349 length = tvb_reported_length(tvb);
2350 flags_3gpp = tvb_get_guint8(tvb, offset);
2352 proto_tree_add_item(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN);
2358 flags = GTPv2_ULI_CGI_MASK;
2362 flags = GTPv2_ULI_SAI_MASK;
2366 flags = GTPv2_ULI_RAI_MASK;
2370 flags = GTPv2_ULI_TAI_MASK;
2374 flags = GTPv2_ULI_ECGI_MASK;
2378 flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_ECGI_MASK;
2381 proto_tree_add_item(tree, hf_gtpv2_geographic_location, tvb, 1, -1, ENC_NA);
2385 diam_sub_dis->avp_str = decode_gtpv2_uli(tvb, pinfo, tree, NULL, length, 0, flags);
2390 * 8.22 Fully Qualified TEID (F-TEID)
2392 static const value_string gtpv2_f_teid_interface_type_vals[] = {
2393 { 0, "S1-U eNodeB GTP-U interface"},
2394 { 1, "S1-U SGW GTP-U interface"},
2395 { 2, "S12 RNC GTP-U interface"},
2396 { 3, "S12 SGW GTP-U interface"},
2397 { 4, "S5/S8 SGW GTP-U interface"},
2398 { 5, "S5/S8 PGW GTP-U interface"},
2399 { 6, "S5/S8 SGW GTP-C interface"},
2400 { 7, "S5/S8 PGW GTP-C interface"},
2401 { 8, "S5/S8 SGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2402 "and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6)"}, */
2403 { 9, "S5/S8 PGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
2404 "and the control plane and user plane addresses are the same for PMIPv6)"}, */
2405 {10, "S11 MME GTP-C interface"},
2406 {11, "S11/S4 SGW GTP-C interface"},
2407 {12, "S10 MME GTP-C interface"},
2408 {13, "S3 MME GTP-C interface"},
2409 {14, "S3 SGSN GTP-C interface"},
2410 {15, "S4 SGSN GTP-U interface"},
2411 {16, "S4 SGW GTP-U interface"},
2412 {17, "S4 SGSN GTP-C interface"},
2413 {18, "S16 SGSN GTP-C interface"},
2414 {19, "eNodeB GTP-U interface for DL data forwarding"},
2415 {20, "eNodeB GTP-U interface for UL data forwarding"},
2416 {21, "RNC GTP-U interface for data forwarding"},
2417 {22, "SGSN GTP-U interface for data forwarding"},
2418 {23, "SGW GTP-U interface for data forwarding"},
2419 {24, "Sm MBMS GW GTP-C interface"},
2420 {25, "Sn MBMS GW GTP-C interface"},
2421 {26, "Sm MME GTP-C interface"},
2422 {27, "Sn SGSN GTP-C interface"},
2423 {28, "SGW GTP-U interface for UL data forwarding"},
2424 {29, "Sn SGSN GTP-U interface"},
2425 {30, "S2b ePDG GTP-C interface"},
2426 {31, "S2b-U ePDG GTP-U interface"},
2427 {32, "S2b PGW GTP-C interface"},
2428 {33, "S2b-U PGW GTP-U interface"},
2429 {34, "S2a TWAN GTP-U interface"},
2430 {35, "S2a TWAN GTP-C interface"},
2431 {36, "S2a PGW GTP-C interface"},
2432 {37, "S2a PGW GTP-U interface"},
2435 static value_string_ext gtpv2_f_teid_interface_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_f_teid_interface_type_vals);
2437 static const true_false_string gtpv2_f_teid_v4_vals = {
2438 "IPv4 address present",
2439 "IPv4 address not present",
2442 static const true_false_string gtpv2_f_teid_v6_vals = {
2443 "IPv6 address present",
2444 "IPv6 address not present",
2448 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_)
2453 flags = tvb_get_guint8(tvb, offset);
2454 proto_tree_add_item(tree, hf_gtpv2_f_teid_v4, tvb, offset, 1, ENC_BIG_ENDIAN);
2455 proto_tree_add_item(tree, hf_gtpv2_f_teid_v6, tvb, offset, 1, ENC_BIG_ENDIAN);
2456 /* NOTE: "Interface type" IE is defined with 5 bits only in the earlier releases of this specification,
2457 * thus pre-Rel-10 GTPv2-C nodes can ignore bit "6" which is marked as "Spare" in earlier releases,
2458 * allowing backward compatibility.
2460 proto_tree_add_item(tree, hf_gtpv2_f_teid_interface_type, tvb, offset, 1, ENC_BIG_ENDIAN);
2463 proto_tree_add_item(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2464 proto_item_append_text(item, "%s, TEID/GRE Key: 0x%s",
2465 val_to_str_ext_const((flags & 0x3f), >pv2_f_teid_interface_type_vals_ext, "Unknown"),
2466 tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 4));
2471 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
2472 proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(tvb, offset));
2477 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, ENC_NA);
2478 proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(tvb, offset));
2485 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_)
2487 proto_tree_add_item(tree, hf_gtpv2_tmsi, tvb, 0, 4, ENC_BIG_ENDIAN);
2488 proto_tree_add_item(item, hf_gtpv2_tmsi_bytes, tvb, 0, length, ENC_NA);
2493 * 12.3 CN Identifier
2495 * A CN node is uniquely identified within a PLMN by its CN Identifier (CN-Id). The CN-Id together with the PLMN
2496 * identifier globally identifies the CN node. The CN-Id together with the PLMN-Id is used as the CN node identifier in
2497 * RANAP signalling over the Iu interface.
2498 * Global CN-Id = PLMN-Id || CN-Id
2499 * The CN-Id is defined by the operator, and set in the nodes via O&M.
2500 * For the syntax description and the use of this identifier in RANAP signalling, see 3GPP TS 25.413 [17].
2504 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_)
2508 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, TRUE);
2511 /* >CN-ID M INTEGER (0..4095) */
2512 proto_tree_add_item(tree, hf_gtpv2_cn_id, tvb, offset, 2, ENC_NA);
2515 * 8.25 S103 PDN Data Forwarding Info (S103PDF)
2518 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_)
2523 /* The HSGW Address and GRE Key identify a GRE Tunnel towards a HSGW over S103 interface for a specific PDN
2524 * connection of the UE. The EPS Bearer IDs specify the EPS Bearers which require data forwarding that belonging to this
2525 * PDN connection. The number of EPS bearer Ids included is specified by the value of EPS Bearer ID Number.
2527 /* Octet 5 HSGW Address for forwarding Length = m */
2528 m = tvb_get_guint8(tvb, offset);
2529 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_f_len, tvb, offset, 1, ENC_BIG_ENDIAN);
2532 /* 6 to (m+5) HSGW Address for forwarding [4..16] */
2536 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2541 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2546 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2547 "Wrong length %u, should be 4 or 16", m);
2551 /* (m+6)- to (m+9) GRE Key */
2552 proto_tree_add_item(tree, hf_gtpv2_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
2555 /* (m+10) EPS Bearer ID Number = k */
2556 k = tvb_get_guint8(tvb, offset);
2557 proto_tree_add_item(tree, hf_gtpv2_eps_bearer_id_number, tvb, offset, 1, ENC_BIG_ENDIAN);
2560 /* (m+11) to (m+10+k)
2561 * Spare EPS Bearer ID
2563 for ( i = 0; i < k; i++ ) {
2564 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2565 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2571 * 8.26 S1-U Data Forwarding (S1UDF)
2574 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_)
2579 /* 5 Spare EPS Bearer ID */
2580 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2581 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2583 /* 6 Serving GW Address Length = m */
2584 m = tvb_get_guint8(tvb, offset);
2585 proto_tree_add_item(tree, hf_gtpv2_serving_gw_address_length, tvb, offset, 1, ENC_BIG_ENDIAN);
2587 /* 7 to (m+6) Serving GW Address [4..16] */
2591 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv4, tvb, offset, 1, ENC_BIG_ENDIAN);
2596 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv6, tvb, offset, 1, ENC_NA);
2601 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2602 "Wrong length %u, should be 4 or 16", m);
2607 * Serving GW S1-U TEID
2609 proto_tree_add_item(tree, hf_gtpv2_sgw_s1u_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
2617 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_)
2621 proto_tree_add_item(tree, hf_gtpv2_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
2625 * 8.28 Bearer Context (grouped IE)
2629 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_)
2633 proto_tree *grouped_tree;
2635 proto_item_append_text(item, "[Grouped IE]");
2636 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_bearer_ctx);
2638 new_tvb = tvb_new_subset_length(tvb, offset, length);
2639 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type);
2642 /* 8.29 Charging ID */
2644 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_)
2648 proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, ENC_BIG_ENDIAN);
2652 /* 8.30 Charging Characteristics
2653 * The charging characteristics information element is defined in 3GPP TS 32.251 [8]
2654 * and is a way of informing both the SGW and PGW of the rules for producing charging
2655 * information based on operator configured triggers. For the encoding of this
2656 * information element see 3GPP TS 32.298 [9].
2659 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_)
2663 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, 2, ENC_BIG_ENDIAN);
2666 /* These octet(s) is/are present only if explicitly specified */
2667 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic_remaining_octets, tvb, offset, length-2, ENC_NA);
2676 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_)
2681 /* Octet 5 Spare VB PPC */
2682 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_ppc, tvb, offset, length, ENC_BIG_ENDIAN);
2683 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_vb, tvb, offset, length, ENC_BIG_ENDIAN);
2690 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_)
2697 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
2698 "Wrong length indicated. Expected 1, got %u", length);
2702 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
2703 pdn = tvb_get_guint8(tvb, offset)& 0x7;
2704 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, ENC_BIG_ENDIAN);
2705 proto_item_append_text(item, "%s", val_to_str_const(pdn, gtpv2_pdn_type_vals, "Unknown"));
2710 * 8.31 Trace Information
2713 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_)
2715 proto_tree *trigg_tree, *msc_server_tree, *mgw_tree, *sgsn_tree, *ggsn_tree;
2716 proto_tree *bm_sc_tree, *sgw_mme_tree, *sgw_tree, *pgw_tree, *ne_types_tree;
2717 proto_tree *interfaces_tree, *imsc_server_tree, *lmgw_tree, *lsgsn_tree, *lggsn_tree, *lrnc_tree;
2718 proto_tree *lbm_sc_tree, *lmme_tree, *lsgw_tree, *lpdn_gw_tree, *lenb_tree;
2722 guint8 *trace_id = NULL;
2727 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, TRUE);
2730 /* Append Trace ID to main tree */
2731 tid = tvb_get_ntohs(tvb, offset);
2732 proto_item_append_text(item, "Trace ID: %d ", tid);
2735 /*--------------------------------------------------
2736 * trace_id = tvb_format_text(tvb, offset, 2);
2737 * proto_tree_add_string(tree, hf_gtpv2_tra_info, tvb, offset, length, trace_id);
2738 *--------------------------------------------------*/
2739 proto_tree_add_item(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN);
2742 /* Triggering Events, put all into a new tree called triggering_tree */
2743 trigg_tree = proto_tree_add_subtree(tree, tvb, offset, 9, ett_gtpv2_tra_info_trigg, NULL, "Triggering Events");
2745 /* Create all subtrees */
2746 msc_server_tree = proto_tree_add_subtree(trigg_tree, tvb, offset, 2, ett_gtpv2_tra_info_trigg_msc_server, NULL, "MSC Server");
2748 mgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_trigg_mgw, NULL, "MGW");
2750 sgsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_trigg_sgsn, NULL, "SGSN");
2752 ggsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_trigg_ggsn, NULL, "GGSN");
2754 bm_sc_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_trigg_bm_sc, NULL, "BM-SC");
2756 sgw_mme_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_trigg_sgw_mme, NULL, "SGW MME");
2758 sgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_sgw, NULL, "SGW");
2760 pgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_pgw, NULL, "PGW");
2762 /* MSC Server - 2 octets */
2763 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_calls, tvb, offset, 1, ENC_BIG_ENDIAN);
2764 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2765 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_lu_imsi_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2766 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_handovers, tvb, offset, 1, ENC_BIG_ENDIAN);
2767 proto_tree_add_item(msc_server_tree, hf_gtpv2_tra_info_msc_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2768 bit_offset = offset << 3;
2769 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2771 bit_offset = offset << 3;
2772 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2776 proto_tree_add_item(mgw_tree, hf_gtpv2_tra_info_mgw_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2777 bit_offset = offset << 3;
2778 proto_tree_add_bits_item(mgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2780 /* SGSN - 2 octets */
2781 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_pdp_context, tvb, offset, 1, ENC_BIG_ENDIAN);
2782 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_momt_sms, tvb, offset, 1, ENC_BIG_ENDIAN);
2783 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_rau_gprs_ad, tvb, offset, 1, ENC_BIG_ENDIAN);
2784 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2785 bit_offset = offset << 3;
2786 proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2788 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
2790 /* GGSN - 1 octet */
2791 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_pdp, tvb, offset, 1, ENC_BIG_ENDIAN);
2792 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
2793 bit_offset = offset << 3;
2794 proto_tree_add_bits_item(ggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2796 /* BM-SC - 1 octet */
2797 proto_tree_add_item(bm_sc_tree, hf_gtpv2_tra_info_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2798 bit_offset = offset << 3;
2799 proto_tree_add_bits_item(bm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2801 /* MME/SGW - 1 octet */
2802 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ss, tvb, offset, 1, ENC_BIG_ENDIAN);
2803 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_sr, tvb, offset, 1, ENC_BIG_ENDIAN);
2804 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_iataud, tvb, offset, 1, ENC_BIG_ENDIAN);
2805 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc, tvb, offset, 1, ENC_BIG_ENDIAN);
2806 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del, tvb, offset, 1, ENC_BIG_ENDIAN);
2807 proto_tree_add_item(sgw_mme_tree, hf_gtpv2_tra_info_mme_sgw_ho, tvb, offset, 1, ENC_BIG_ENDIAN);
2808 bit_offset = offset << 3;
2809 proto_tree_add_bits_item(sgw_mme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
2811 /* PGW/SGW - 1 octet */
2812 proto_tree_add_item(sgw_tree, hf_gtpv2_tra_info_sgw_pdn_con_creat, tvb, offset, 1, ENC_BIG_ENDIAN);
2813 proto_tree_add_item(sgw_tree, hf_gtpv2_tra_info_sgw_pdn_con_term, tvb, offset, 1, ENC_BIG_ENDIAN);
2814 proto_tree_add_item(sgw_tree, hf_gtpv2_tra_info_sgw_bearer_act_mod_del, tvb, offset, 1, ENC_BIG_ENDIAN);
2815 bit_offset = (offset << 3) + 4;
2816 proto_tree_add_bits_item(sgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2817 proto_tree_add_item(pgw_tree, hf_gtpv2_tra_info_pgw_pdn_con_creat, tvb, offset, 1, ENC_BIG_ENDIAN);
2818 proto_tree_add_item(pgw_tree, hf_gtpv2_tra_info_pgw_pdn_con_term, tvb, offset, 1, ENC_BIG_ENDIAN);
2819 proto_tree_add_item(pgw_tree, hf_gtpv2_tra_info_pgw_bearer_act_mod_del, tvb, offset, 1, ENC_BIG_ENDIAN);
2820 bit_offset = offset << 3;
2821 proto_tree_add_bits_item(pgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
2824 /* Create NE Types subtree */
2825 ne_types_tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_gtpv2_tra_info_ne_types, NULL, "List of NE Types");
2828 /* List of NE Types */
2829 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_msc_s, tvb, offset, 1, ENC_BIG_ENDIAN);
2830 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2831 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2832 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_ggsn, tvb, offset, 1, ENC_BIG_ENDIAN);
2833 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_rnc, tvb, offset, 1, ENC_BIG_ENDIAN);
2834 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
2835 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2836 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_sgw, tvb, offset, 1, ENC_BIG_ENDIAN);
2838 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_pdn_gw, tvb, offset, 1, ENC_BIG_ENDIAN);
2839 proto_tree_add_item(ne_types_tree, hf_gtpv2_tra_info_lne_enb, tvb, offset, 1, ENC_BIG_ENDIAN);
2840 bit_offset = offset << 3;
2841 proto_tree_add_bits_item(ne_types_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2844 /* Trace Depth Length */
2845 proto_tree_add_item(tree, hf_gtpv2_tra_info_tdl, tvb, offset, 1, ENC_BIG_ENDIAN);
2848 /* Set up subtree interfaces and put all interfaces under it */
2849 interfaces_tree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_gtpv2_tra_info_interfaces, NULL, "List of Interfaces");
2851 /* Create all subtrees */
2852 imsc_server_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset, 2, ett_gtpv2_tra_info_interfaces_imsc_server, NULL, "MSC Server");
2854 lmgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_interfaces_lmgw, NULL, "MGW");
2856 lsgsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_interfaces_lsgsn, NULL, "SGSN");
2858 lggsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_interfaces_lggsn, NULL, "GGSN");
2860 lrnc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_interfaces_lrnc, NULL, "RNC");
2862 lbm_sc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_interfaces_lbm_sc, NULL, "BM-SC");
2864 lmme_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_interfaces_lmme, NULL, "MME");
2866 lsgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 9, 1,ett_gtpv2_tra_info_interfaces_lsgw, NULL, "SGW");
2868 lpdn_gw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 10, 1, ett_gtpv2_tra_info_interfaces_lpdn_gw, NULL, "PDN GW");
2870 lenb_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 11, 1, ett_gtpv2_tra_info_interfaces_lpdn_lenb, NULL, "eNB");
2872 /* MSC Server - 2 octests */
2873 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_a, tvb, offset, 1, ENC_BIG_ENDIAN);
2874 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2875 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2876 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_g, tvb, offset, 1, ENC_BIG_ENDIAN);
2877 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_b, tvb, offset, 1, ENC_BIG_ENDIAN);
2878 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_e, tvb, offset, 1, ENC_BIG_ENDIAN);
2879 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_f, tvb, offset, 1, ENC_BIG_ENDIAN);
2880 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_cap, tvb, offset, 1, ENC_BIG_ENDIAN);
2882 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_d, tvb, offset, 1, ENC_BIG_ENDIAN);
2883 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_c, tvb, offset, 1, ENC_BIG_ENDIAN);
2884 bit_offset = offset << 3;
2885 proto_tree_add_bits_item(imsc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
2888 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_mc, tvb, offset, 1, ENC_BIG_ENDIAN);
2889 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_nb_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2890 proto_tree_add_item(lmgw_tree, hf_gtpv2_tra_info_lmgw_lu_up, tvb, offset, 1, ENC_BIG_ENDIAN);
2891 bit_offset = offset << 3;
2892 proto_tree_add_bits_item(lmgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2894 /* SGSN - 2 octets */
2895 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gb, tvb, offset, 1, ENC_BIG_ENDIAN);
2896 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2897 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2898 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gr, tvb, offset, 1, ENC_BIG_ENDIAN);
2899 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gd, tvb, offset, 1, ENC_BIG_ENDIAN);
2900 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_map_gf, tvb, offset, 1, ENC_BIG_ENDIAN);
2901 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_gs, tvb, offset, 1, ENC_BIG_ENDIAN);
2902 proto_tree_add_item(lsgsn_tree, hf_gtpv2_tra_info_lsgsn_ge, tvb, offset, 1, ENC_BIG_ENDIAN);
2904 bit_offset = offset << 3;
2905 proto_tree_add_bits_item(lsgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
2908 /* GGSN - 1 octet */
2909 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gn, tvb, offset, 1, ENC_BIG_ENDIAN);
2910 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gi, tvb, offset, 1, ENC_BIG_ENDIAN);
2911 proto_tree_add_item(lggsn_tree, hf_gtpv2_tra_info_lggsn_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2912 bit_offset = offset << 3;
2913 proto_tree_add_bits_item(lggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2916 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lu, tvb, offset, 1, ENC_BIG_ENDIAN);
2917 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lur, tvb, offset, 1, ENC_BIG_ENDIAN);
2918 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_lub, tvb, offset, 1, ENC_BIG_ENDIAN);
2919 proto_tree_add_item(lrnc_tree, hf_gtpv2_tra_info_lrnc_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2920 bit_offset = offset << 3;
2921 proto_tree_add_bits_item(lrnc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2923 /* BM_SC - 1 octet */
2924 proto_tree_add_item(lbm_sc_tree, hf_gtpv2_tra_info_lbm_sc_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
2925 bit_offset = offset << 3;
2926 proto_tree_add_bits_item(lbm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
2929 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2930 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s3, tvb, offset, 1, ENC_BIG_ENDIAN);
2931 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s6a, tvb, offset, 1, ENC_BIG_ENDIAN);
2932 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s10, tvb, offset, 1, ENC_BIG_ENDIAN);
2933 proto_tree_add_item(lmme_tree, hf_gtpv2_tra_info_lmme_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2934 bit_offset = offset << 3;
2935 proto_tree_add_bits_item(lmme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
2938 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s4, tvb, offset, 1, ENC_BIG_ENDIAN);
2939 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2940 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2941 proto_tree_add_item(lsgw_tree, hf_gtpv2_tra_info_lsgw_s11, tvb, offset, 1, ENC_BIG_ENDIAN);
2942 bit_offset = offset << 3;
2943 proto_tree_add_bits_item(lsgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
2945 /* PDN GW - 1 octet */
2946 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2a, tvb, offset, 1, ENC_BIG_ENDIAN);
2947 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2b, tvb, offset, 1, ENC_BIG_ENDIAN);
2948 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s2c, tvb, offset, 1, ENC_BIG_ENDIAN);
2949 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s5, tvb, offset, 1, ENC_BIG_ENDIAN);
2950 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s6c, tvb, offset, 1, ENC_BIG_ENDIAN);
2951 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_gx, tvb, offset, 1, ENC_BIG_ENDIAN);
2952 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_s8b, tvb, offset, 1, ENC_BIG_ENDIAN);
2953 proto_tree_add_item(lpdn_gw_tree, hf_gtpv2_tra_info_lpdn_gw_sgi, tvb, offset, 1, ENC_BIG_ENDIAN);
2956 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_s1_mme, tvb, offset, 1, ENC_BIG_ENDIAN);
2957 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_x2, tvb, offset, 1, ENC_BIG_ENDIAN);
2958 proto_tree_add_item(lenb_tree, hf_gtpv2_tra_info_lenb_uu, tvb, offset, 1, ENC_BIG_ENDIAN);
2959 bit_offset = offset << 3;
2960 proto_tree_add_bits_item(lenb_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
2962 /*--------------------------------------------------
2964 *--------------------------------------------------*/
2966 /* IP Address of Trace Collection Entity */
2967 while ( (offset + 4) <= length ) {
2969 proto_tree_add_item(tree, hf_gtpv2_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
2976 * 8.33 Void (TS 129 274 V9.4.0 (2010-10))
2979 /* 8.35 Procedure Transaction ID (PTI) */
2981 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_)
2983 proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, ENC_BIG_ENDIAN);
2986 * 8.36 DRX Parameter
2989 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_)
2993 /* 36.413 : 9.2.1.17 Paging Cause, void */
2994 proto_tree_add_item(tree, hf_gtpv2_drx_parameter, tvb, offset, length, ENC_NA);
2998 * 8.37 UE Network Capability
2999 * UE Network Capability is coded as depicted in Figure 8.37-1. Actual coding of the UE Network Capability field is
3000 * defined in 3GPP TS 24.301
3003 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_)
3005 de_emm_ue_net_cap(tvb, tree, pinfo, 0, length, NULL, 0);
3011 static const value_string gtpv2_mm_context_security_mode[] = {
3012 {0, "GSM Key and Triplets"},
3013 {1, "UMTS Key, Used Cipher and Quintuplets"},
3014 {2, "GSM Key, Used Cipher and Quintuplets"},
3015 {3, "UMTS Key and Quintuplets"},
3016 {4, "EPS Security Context, Quadruplets and Quintuplets" },
3017 {5, "UMTS Key, Quadruplets and Quintuplets"},
3021 static const true_false_string gtpv2_nhi_vals = {
3022 "NH (Next Hop) and NCC (Next Hop Chaining Count) are both present",
3023 "NH (Next Hop) and NCC (Next Hop Chaining Count) not present",
3026 /* Table 8.38-2: Used NAS Cipher Values */
3028 static const value_string gtpv2_mm_context_unc_vals[] = {
3029 {0, "No ciphering"},
3040 /* Table 8.38-3: Used Cipher Values */
3041 static const value_string gtpv2_mm_context_used_cipher_vals[] = {
3042 {0, "No ciphering"},
3053 /* Table 8.38-4: Used NAS integrity protection algorithm Values */
3054 static const value_string gtpv2_mm_context_unipa_vals[] = {
3055 {0, "No ciphering"},
3066 /* Helper functions */
3068 /* Figure 8.38-7: Authentication Triplet */
3070 dissect_gtpv2_authentication_triplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 num_triplet)
3072 proto_tree *auth_tri_tree;
3075 for (i = 0; i < num_triplet; i++) {
3076 auth_tri_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
3077 ett_gtpv2_mm_context_auth_tri, NULL, "Authentication Triplet %u", i);
3079 * Figure 8.38-8: Authentication Quintuplet
3084 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
3086 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_sres, tvb, offset, 4, ENC_NA);
3088 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
3097 dissect_gtpv2_authentication_quintuplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
3099 proto_tree *auth_qui_tree;
3101 guint8 xres_len, autn_len;
3103 for (i = 0; i < nr_qui; i++) {
3104 auth_qui_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
3105 ett_gtpv2_mm_context_auth_qui, NULL, "Authentication Quintuplet %u", i);
3107 * Figure 8.38-8: Authentication Quintuplet
3111 * (m+1) to (m+16) CK
3112 * (m+17) to (m+32) IK
3116 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
3118 xres_len = tvb_get_guint8(tvb, offset);
3119 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3121 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres, tvb, offset, xres_len, ENC_NA);
3123 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3125 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3127 autn_len = tvb_get_guint8(tvb, offset);
3128 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3130 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn, tvb, offset, autn_len, ENC_NA);
3139 dissect_gtpv2_authentication_quadruplets(tvbuff_t *tvb, proto_tree *tree, int offset, guint8 nr_qui)
3141 proto_tree *auth_qua_tree;
3145 for (i = 0; i < nr_qui; i++) {
3146 auth_qua_tree = proto_tree_add_subtree(tree, tvb, offset, 0,
3147 ett_gtpv2_mm_context_auth_qua, NULL, "Authentication Quadruplet");
3149 proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
3152 tmp = tvb_get_guint8(tvb, offset++);
3154 proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_xres, tvb, offset, tmp, ENC_NA);
3157 tmp = tvb_get_guint8(tvb, offset++);
3159 proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_autn, tvb, offset, tmp, ENC_NA);
3162 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
3169 static const value_string gtpv2_mm_context_higher_br_16mb_flg_vals[] = {
3176 dissect_gtpv2_mm_context_common_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, guint8 samb_ri, guint8 uamb_ri)
3178 proto_tree *net_cap_tree, *msnt_cap_tree;
3179 guint8 ue_net_cap_len, ms_net_cap_len, mei_len;
3183 * If SAMBRI (Subscribed UE AMBR Indicator), bit 1 of octet 6, is set to "1",
3184 * then the Uplink/downlink Subscribed UE AMBR parameter field is present,
3187 /* j to (j+3) Uplink Subscribed UE AMBR */
3188 tmp = tvb_get_ntohl(tvb, offset);
3189 proto_tree_add_uint_format_value(tree, hf_gtpv2_uplink_subscribed_ue_ambr, tvb, offset, 4, tmp, "%d Kbps", tmp);
3192 /* (j+4) to (j+7) Downlink Subscribed UE AMBR */
3193 tmp = tvb_get_ntohl(tvb, offset);
3194 proto_tree_add_uint_format_value(tree, hf_gtpv2_downlink_subscribed_ue_ambr, tvb, offset, 4, tmp, "%d Kbps", tmp);
3199 * If UAMBRI (Used UE AMBR Indicator), bit 2 of octet 6, is set to "1",
3200 * then the Uplink/downlink Used UE AMBR parameter field is present
3203 /* i to (i+3) Uplink Used UE AMBR */
3204 tmp = tvb_get_ntohl(tvb, offset);
3205 proto_tree_add_uint_format_value(tree, hf_gtpv2_uplink_used_ue_ambr, tvb, offset, 4, tmp, "%d Kbps", tmp);
3208 /* (i+4) to (i+7) Downlink Used UE AMBR */
3209 tmp = tvb_get_ntohl(tvb, offset);
3210 proto_tree_add_uint_format_value(tree, hf_gtpv2_downlink_used_ue_ambr, tvb, offset, 4, tmp, "%d Kbps", tmp);
3214 /* q Length of UE Network Capability */
3215 ue_net_cap_len = tvb_get_guint8(tvb, offset);
3216 proto_tree_add_item(tree, hf_gtpv2_mm_context_ue_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3218 /* (q+1) to k UE Network Capability */
3219 if (ue_net_cap_len) {
3220 /* The UE Network Capability coding is specified in clause 9.9.3.34 of 3GPP TS 24.301 [23].
3221 * If Length of UE Network Capability is zero, then the UE Network Capability parameter
3222 * shall not be present.
3224 net_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ue_net_cap_len,
3225 ett_gtpv2_mm_context_net_cap, NULL, "UE Network Capability");
3226 offset += de_emm_ue_net_cap(tvb, net_cap_tree, pinfo, offset, ue_net_cap_len, NULL, 0);
3228 /* k+1 Length of MS Network Capability */
3229 ms_net_cap_len = tvb_get_guint8(tvb, offset);
3230 proto_tree_add_item(tree, hf_gtpv2_mm_context_ms_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3232 /* (k+2) to m MS Network Capability
3233 * The MS Network Capability coding is specified in clause 10.5.5.12 of 3GPP TS 24.008 [5].
3234 * If Length of MS Network Capability is zero, then the MS Network Capability parameter shall not be present.
3236 if (ms_net_cap_len) {
3237 msnt_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ms_net_cap_len,
3238 ett_gtpv2_ms_network_capability, NULL, "MS network capability");
3239 offset += de_gmm_ms_net_cap(tvb, msnt_cap_tree, pinfo, offset, ms_net_cap_len, NULL, 0);
3241 /* m+1 Length of Mobile Equipment Identity (MEI) */
3242 mei_len = tvb_get_guint8(tvb, offset);
3243 proto_tree_add_item(tree, hf_gtpv2_mm_context_mei_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3245 /* (m+2) to r Mobile Equipment Identity (MEI) */
3247 const gchar *mei_str;
3249 mei_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset, mei_len, NULL, FALSE);
3250 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, mei_len, mei_str);
3257 dissect_gtpv2_access_restriction_data(tvbuff_t *tvb, proto_tree *tree, int offset)
3259 proto_tree *accrstdata_tree;
3261 accrstdata_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtpv2_access_rest_data, NULL, "Access restriction data");
3262 /* Spare HNNA ENA INA GANA GENA UNA */
3263 proto_tree_add_bits_item(accrstdata_tree, hf_gtpv2_spare_bits, tvb, (offset << 3), 2, ENC_BIG_ENDIAN);
3264 proto_tree_add_item(accrstdata_tree, hf_gtpv2_hnna, tvb, offset, 1, ENC_BIG_ENDIAN);
3265 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ena, tvb, offset, 1, ENC_BIG_ENDIAN);
3266 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ina, tvb, offset, 1, ENC_BIG_ENDIAN);
3267 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gana, tvb, offset, 1, ENC_BIG_ENDIAN);
3268 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gena, tvb, offset, 1, ENC_BIG_ENDIAN);
3269 proto_tree_add_item(accrstdata_tree, hf_gtpv2_una, tvb, offset, 1, ENC_BIG_ENDIAN);
3275 /* Type = 103 (decimal)
3276 * Figure 8.38-1: GSM Key and Triplets
3279 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_)
3281 proto_tree *flag_tree;
3283 guint8 oct, drxi, num_triplet, uamb_ri, samb_ri;
3286 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3289 /* Security Mode | Spare | DRXI | CKSN */
3290 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3291 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3292 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
3293 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3294 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
3297 /* Number of Triplet | Spare | UAMB RI | SAMB RI */
3298 oct = tvb_get_guint8(tvb, offset);
3299 num_triplet = oct >> 5;
3300 uamb_ri = (oct & 0x02) >> 1;
3301 samb_ri = oct & 0x01;
3303 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_tri, tvb, offset, 1, ENC_BIG_ENDIAN);
3304 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3305 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3306 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3309 /* Octet 7 Spare Used Cipher */
3310 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3311 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3315 proto_tree_add_item(tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
3318 /* 16 to h Authentication Triplet [0..4] */
3320 dissect_gtpv2_authentication_triplets(tvb, tree, offset, num_triplet);
3324 * (h+1) to (h+2) DRX parameter
3327 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3331 /* Dissect octet j to r */
3332 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3334 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");
3337 /* Type = 104 (decimal)
3338 * Figure 8.38-2: UMTS Key, Used Cipher and Quintuplets
3341 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_)
3343 proto_tree *flag_tree;
3345 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3348 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3351 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3352 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3353 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3354 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3355 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3358 oct = tvb_get_guint8(tvb, offset);
3360 uamb_ri = (oct & 0x02) >> 1;
3361 samb_ri = oct & 0x01;
3362 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3363 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3364 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3365 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3367 /* Octet 7 Spare Used Cipher */
3368 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3369 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3372 /* Octet 8 to 23 CK */
3373 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3375 /* Octet 24 to 39 IK */
3376 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3380 * 40 to h Authentication Quintuplet [0..4]
3383 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3387 * (h+1) to (h+2) DRX parameter
3390 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3395 /* Dissect octet j to r */
3396 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3398 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3399 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3400 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3401 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3403 if (offset < (gint)length) {
3404 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3408 if (offset == (gint)length) {
3412 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3413 vdp_len = tvb_get_guint8(tvb, offset);
3414 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3416 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3418 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
3422 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3423 if (offset == (gint)length) {
3424 hbr_len = tvb_get_guint8(tvb, offset);
3425 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3427 /* s+2 Higher bitrates than 16 Mbps flag */
3429 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3436 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");
3440 /* Type = 105 (decimal)
3441 * Figure 8.38-3: GSM Key, Used Cipher and Quintuplets
3444 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_)
3446 proto_tree *flag_tree;
3448 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3451 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3454 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3455 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3456 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3457 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3458 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3461 oct = tvb_get_guint8(tvb, offset);
3463 uamb_ri = (oct & 0x02) >> 1;
3464 samb_ri = oct & 0x01;
3465 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3466 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3467 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3468 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3470 /* Octet 7 Spare Used Cipher */
3471 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
3472 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
3475 proto_tree_add_item(tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
3479 * 40 to h Authentication Quintuplet [0..4]
3482 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3486 * (h+1) to (h+2) DRX parameter
3489 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3494 /* Dissect octet j to r */
3495 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3497 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3498 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3499 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3500 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3502 if (offset < (gint)length) {
3503 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3507 if (offset == (gint)length) {
3511 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3512 vdp_len = tvb_get_guint8(tvb, offset);
3513 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3515 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3517 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
3521 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3522 if (offset < (gint)length) {
3523 hbr_len = tvb_get_guint8(tvb, offset);
3524 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3526 /* s+2 Higher bitrates than 16 Mbps flag */
3528 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3535 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");
3539 /* Type = 106 (decimal)
3540 * Figure 8.38-4: UMTS Key and Quintuplets
3543 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_)
3545 proto_tree *flag_tree;
3547 guint8 oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
3550 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3553 /* Security Mode Spare DRXI KSI */
3554 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3555 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3556 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3557 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3558 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
3561 /* Number of Quintuplets Spare UAMB RI SAMB RI */
3562 oct = tvb_get_guint8(tvb, offset);
3564 uamb_ri = (oct & 0x02) >> 1;
3565 samb_ri = oct & 0x01;
3567 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3568 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
3569 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3570 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3573 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3575 /* Octet 8 to 23 CK */
3576 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3578 /* Octet 24 to 39 IK */
3579 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3583 * 40 to h Authentication Quintuplet [0..4]
3586 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3590 * (h+1) to (h+2) DRX parameter
3593 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3598 /* Dissect octet j to r */
3599 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3601 /* r+1 Spare HNNA ENA INA GANA GENA UNA
3602 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
3603 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
3604 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
3606 if (offset < (gint)length) {
3607 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3611 if (offset == (gint)length) {
3615 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3616 vdp_len = tvb_get_guint8(tvb, offset);
3617 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3619 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3621 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
3625 /* s+1 Length of Higher bitrates than 16 Mbps flag */
3626 if (offset < (gint)length) {
3627 hbr_len = tvb_get_guint8(tvb, offset);
3628 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3630 /* s+2 Higher bitrates than 16 Mbps flag */
3632 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
3639 /* (s+3) to (n+4) These octet(s) is/are present only if explicitly specified */
3640 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");
3645 * Type = 107 (decimal)
3646 * Figure 8.38-5: EPS Security Context and Quadruplets
3649 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_)
3651 proto_item *qua_item, *qui_item;
3652 proto_tree *flag_tree, *qua_tree, *qui_tree;
3654 guint8 tmp, nhi, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_len;
3658 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3663 * Security Mode | NHI | DRXI | KSIASME
3665 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3666 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nhi, tvb, offset, 1, ENC_BIG_ENDIAN);
3667 /* If NHI (Next Hop Indicator), bit 5 of octet 5, is set to "1",
3668 * then the optional parameters NH (Next Hop) and NCC (Next
3669 * Hop Chaining Count) are both present, otherwise their octets are not present.
3671 tmp = tvb_get_guint8(tvb, offset);
3672 nhi = (tmp & 0x10) >> 4;
3673 drxi = (tmp & 0x08) >> 3;
3674 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3675 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3681 * Number of | Number of | UAMB | OSCI
3682 * Quintuplets | Quadruplet | RI |
3684 tmp = tvb_get_guint8(tvb, offset);
3685 nr_qui = (tmp & 0xe0) >> 5;
3686 nr_qua = tmp & 0x1c;
3688 uamb_ri = (tmp & 0x2) >> 1;
3690 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3691 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3693 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3695 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_osci, tvb, offset, 1, ENC_BIG_ENDIAN);
3698 /* Octet 7 SAMB RI Used NAS integrity protection algorithm Used NAS Cipher*/
3700 samb_ri = tvb_get_guint8(tvb, offset) >> 7;
3701 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
3702 /* Used NAS integrity protection algorithm */
3703 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unipa, tvb, offset, 1, ENC_BIG_ENDIAN);
3704 /* Used NAS Cipher */
3705 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unc, tvb, offset, 1, ENC_BIG_ENDIAN);
3708 /* Octet 8-10 NAS Downlink Count*/
3709 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_dl_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3712 /* Octet 11-13 NAS Uplink Count */
3713 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_ul_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
3717 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
3720 qua_item = proto_tree_add_uint(tree, hf_gtpv2_authentication_quadruplets, tvb, offset, 0, nr_qua);
3722 qua_tree = proto_item_add_subtree(qua_item, ett_gtpv2_qua);
3723 offset = dissect_gtpv2_authentication_quadruplets(tvb, qua_tree, offset, nr_qua);
3725 PROTO_ITEM_SET_GENERATED(qua_item);
3728 qui_item = proto_tree_add_uint(tree, hf_gtpv2_authentication_quintuplets, tvb, offset, 0, nr_qui);
3730 qui_tree = proto_item_add_subtree(qui_item, ett_gtpv2_qui);
3731 offset = dissect_gtpv2_authentication_quintuplets(tvb, qui_tree, offset, nr_qui);
3733 PROTO_ITEM_SET_GENERATED(qui_item);
3736 /* (h+1) to (h+2) DRX parameter */
3738 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3742 /* Octet p to p+31 & Octet p+32 */
3745 proto_tree_add_item(tree, hf_gtpv2_mm_context_nh, tvb, offset, 32, ENC_NA);
3748 proto_tree_add_item(tree, hf_gtpv2_mm_context_ncc, tvb, offset, 1, ENC_BIG_ENDIAN);
3753 /* Dissect octet j to r */
3754 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3756 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3757 if (offset < (gint)length) {
3758 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3763 if (offset == (gint)length) {
3767 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
3768 vdp_len = tvb_get_guint8(tvb, offset);
3769 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3771 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
3773 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
3774 /*offset += vdp_len;*/
3780 * Type = 108 (decimal)
3781 * Figure 8.38-6: UMTS Key, Quadruplets and Quintuplets
3784 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_)
3786 proto_tree *flag_tree;
3788 guint8 tmp, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_length;
3791 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
3794 * Security Mode Spare DRXI KSIASME
3796 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
3797 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
3798 drxi = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
3799 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
3800 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
3806 * Number of | Number of | UAMB | SAMB
3807 * Quintuplets | Quadruplet | RI | RI
3809 tmp = tvb_get_guint8(tvb, offset);
3810 nr_qui = (tmp & 0xe0) >> 5;
3811 nr_qua = tmp & 0x1c;
3813 uamb_ri = (tmp & 0x2) >> 1;
3814 samb_ri = tmp & 0x01;
3816 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
3817 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
3818 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
3819 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
3822 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
3824 /* Octet 8 to 23 CK */
3825 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
3827 /* Octet 24 to 39 IK */
3828 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
3832 offset = dissect_gtpv2_authentication_quadruplets(tvb, tree, offset, nr_qua);
3836 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
3839 /* (h+1) to (h+2) DRX parameter */
3841 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
3845 /* Dissect octet j to r */
3846 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
3848 if (offset >= (guint32)length) {
3851 /* r+1 Spare HNNA ENA INA GANA GENA UNA */
3852 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
3854 if (offset >= (guint32)length) {
3858 /* 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
3859 * Length of Voice Domain Preference and UE's Usage Setting is zero, then the Voice Domain Preference and UE's Usage
3860 * Setting parameter shall not be present.
3862 vdp_length = tvb_get_guint8(tvb, offset);
3863 proto_tree_add_item(tree, hf_gtpv2_vdp_length, tvb, offset, 1, ENC_BIG_ENDIAN);
3867 offset += de_gmm_voice_domain_pref(tvb, tree, pinfo, offset, vdp_length, NULL, 0);
3870 if (offset < (guint32)length) {
3871 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
3877 * 8.39 PDN Connection (grouped IE)
3880 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_)
3883 proto_tree *grouped_tree;
3886 proto_item_append_text(item, "[Grouped IE]");
3887 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
3888 new_tvb = tvb_new_subset_length(tvb, offset, length);
3890 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type);
3896 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_)
3898 proto_item *nsapi_ti;
3899 proto_tree *nsapi_tree;
3903 nsapi = (tvb_get_guint8(tvb, offset) & 0x08);
3904 nsapi_ti = proto_tree_add_item(tree, hf_gtpv2_nsapi08, tvb, offset, 1, ENC_BIG_ENDIAN);
3905 nsapi_tree = proto_item_add_subtree(nsapi_ti, ett_gtpv2_pdn_numbers_nsapi);
3906 proto_tree_add_bits_item(nsapi_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3907 proto_tree_add_item(nsapi_tree, hf_gtpv2_pdn_numbers_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
3908 proto_item_append_text(item, "NSAPI: %u", nsapi);
3911 proto_tree_add_item(tree, hf_gtpv2_dl_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
3914 proto_tree_add_item(tree, hf_gtpv2_ul_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
3917 proto_tree_add_item(tree, hf_gtpv2_send_n_pdu_number, tvb, offset, 2, ENC_BIG_ENDIAN);
3920 proto_tree_add_item(tree, hf_gtpv2_receive_n_pdu_number, tvb, offset, 2, ENC_BIG_ENDIAN);
3924 * 8.41 Packet TMSI (P-TMSI)
3927 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_)
3931 /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation. */
3932 proto_tree_add_item(tree, hf_gtpv2_p_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
3933 proto_item_append_text(item, "%s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 4));
3937 * 8.42 P-TMSI Signature
3940 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_)
3944 /* The P-TMSI Signature consists of 3 octets and may be allocated by the SGSN. */
3945 proto_tree_add_item(tree, hf_gtpv2_p_tmsi_sig, tvb, offset, 3, ENC_BIG_ENDIAN);
3946 proto_item_append_text(item, "%s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 3));
3954 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_)
3959 hop_counter = tvb_get_guint8(tvb, offset);
3961 proto_tree_add_item(tree, hf_gtpv2_hop_counter, tvb, offset, 1, ENC_BIG_ENDIAN);
3962 proto_item_append_text(item, "%d", hop_counter);
3969 static const value_string gtpv2_ue_time_zone_dst_vals[] = {
3970 {0, "No Adjustments for Daylight Saving Time"},
3971 {1, "+1 Hour Adjustments for Daylight Saving Time"},
3972 {2, "+2 Hour Adjustments for Daylight Saving Time"},
3977 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_)
3982 * UE Time Zone is used to indicate the offset between universal time and local time in steps of 15 minutes of where the
3983 * UE currently resides. The "Time Zone" field uses the same format as the "Time Zone" IE in 3GPP TS 24.008 [5].
3984 * (packet-gsm_a_dtap.c)
3986 de_time_zone(tvb, tree, pinfo, offset, 1, NULL, 0);
3988 proto_tree_add_item(item, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, ENC_BIG_ENDIAN);
3992 * 8.45 Trace Reference
3995 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_)
4001 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, TRUE);
4004 trace_id = tvb_get_ntohs(tvb, offset);
4005 proto_tree_add_item(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN);
4007 proto_item_append_text(item, "%s,Trace ID %u", mcc_mnc_str, trace_id);
4010 * 8.46 Complete Request Message
4012 static const value_string gtpv2_complete_req_msg_type_vals[] = {
4013 {0, "Complete Attach Request Message" },
4014 {1, "Complete TAU Request Message" },
4018 dissect_complete_request_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
4025 proto_tree_add_item(tree, hf_gtpv2_complete_req_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4029 /* Add the Complete Request Message */
4030 new_tvb = tvb_new_subset(tvb, offset, length-1, length-1);
4031 call_dissector(nas_eps_handle, new_tvb, pinfo, tree);
4039 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_)
4045 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, TRUE);
4048 proto_tree_add_item(tree, hf_gtpv2_mme_grp_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4051 proto_tree_add_item(tree, hf_gtpv2_mme_code, tvb, offset, 1, ENC_BIG_ENDIAN);
4054 proto_tree_add_item(tree, hf_gtpv2_m_tmsi, tvb, offset, 4, ENC_NA);
4058 * 8.48 Fully Qualified Container (F-Container)
4061 static const value_string gtpv2_container_type_vals[] = {
4062 {1, "UTRAN transparent container"},
4063 {2, "BSS container"},
4064 {3, "E-UTRAN transparent container"},
4070 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_)
4073 proto_tree *sub_tree;
4075 guint8 container_type;
4076 guint8 container_flags, xid_len;
4078 /* Octets 8 7 6 5 4 3 2 1
4079 * 5 Spare | Container Type
4081 proto_tree_add_item(tree, hf_gtpv2_container_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4082 container_type = tvb_get_guint8(tvb, offset);
4084 if ( (message_type == GTPV2_FORWARD_RELOCATION_REQ)
4085 || (message_type == GTPV2_CONTEXT_RESPONSE)
4086 || (message_type == GTPV2_RAN_INFORMATION_RELAY)) {
4087 switch (container_type) {
4090 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_bss_con, NULL, "BSS container");
4091 /* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of paratemer */
4092 proto_tree_add_item(sub_tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
4093 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
4094 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
4095 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
4096 container_flags = tvb_get_guint8(tvb, offset);
4098 if ((container_flags & 0x01) == 1) {
4099 /* Packet Flow ID present */
4100 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
4103 if (((container_flags & 0x04) == 4) || ((container_flags & 0x02) == 2)) {
4104 if ((container_flags & 0x04) == 4) {
4106 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
4108 if ((container_flags & 0x02) == 2) {
4109 /* Radio Priority present */
4110 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
4114 if ((container_flags & 0x08) == 8) {
4115 /* XiD parameters length is present in Octet c.
4116 * XiD parameters are present in Octet d to n.
4118 xid_len = tvb_get_guint8(tvb, offset);
4119 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4121 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_NA);
4128 if (message_type == GTPV2_FORWARD_CTX_NOTIFICATION) {
4129 switch (container_type) {
4131 /* E-UTRAN transparent container */
4132 new_tvb = tvb_new_subset_remaining(tvb, offset);
4133 dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(new_tvb, pinfo, tree, NULL);
4140 /* 7.3.2 Forward Relocation Response
4141 * E-UTRAN Transparent Container
4142 * This IE is conditionally included only during a handover to
4143 * E-UTRAN and contains the radio-related and core network
4144 * information. If the Cause IE contains the value "Request
4145 * accepted", this IE shall be included.
4147 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
4152 * 8.49 Fully Qualified Cause (F-Cause)
4155 static const value_string gtpv2_cause_type_vals[] = {
4156 {0, "Radio Network Layer"},
4157 {1, "Transport Layer"},
4160 {4, "Miscellaneous"},
4174 static value_string_ext gtpv2_cause_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_type_vals);
4177 dissect_gtpv2_s1ap_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, guint8 cause_type)
4180 switch (cause_type) {
4182 /* CauseRadioNetwork */
4183 proto_tree_add_item(tree, hf_gtpv2_CauseRadioNetwork, tvb, offset, 1, ENC_BIG_ENDIAN);
4186 /* CauseTransport */
4187 proto_tree_add_item(tree, hf_gtpv2_CauseTransport, tvb, offset, 1, ENC_BIG_ENDIAN);
4191 proto_tree_add_item(tree, hf_gtpv2_CauseNas, tvb, offset, 1, ENC_BIG_ENDIAN);
4195 proto_tree_add_item(tree, hf_gtpv2_CauseProtocol, tvb, offset, 1, ENC_BIG_ENDIAN);
4199 proto_tree_add_item(tree, hf_gtpv2_CauseMisc, tvb, offset, 1, ENC_BIG_ENDIAN);
4209 dissect_gtpv2_F_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type, guint8 instance)
4214 /* The value of Instance field of the F-Cause IE in a GTPv2 message shall indicate
4215 * whether the F-Cause field contains RANAP Cause, BSSGP Cause or RAN Cause.
4216 * If the F-Cause field contains RAN Cause, the Cause Type field shall contain
4217 * the RAN cause subcategory as specified in 3GPP TS 36.413 [10] and it shall be
4218 * encoded as in Table 8.49-1.
4219 * If the F-Cause field contains BSSGP Cause or RANAP Cause,
4220 * the Cause Type field shall be ignored by the receiver.
4222 if (message_type == GTPV2_FORWARD_RELOCATION_REQ) {
4225 proto_item_append_text(item, "[RAN Cause]");
4226 proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4227 cause_type = tvb_get_guint8(tvb, offset);
4229 dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
4232 proto_item_append_text(item, "[RANAP Cause]");
4235 proto_item_append_text(item, "[BSSGP Cause]");
4241 else if (message_type == GTPV2_FORWARD_RELOCATION_RESP) {
4242 /* Table 7.3.2-1: Information Elements in a Forward Relocation Response */
4245 /* Instance 0 S1-AP Cause */
4246 proto_item_append_text(item, "[S1-AP Cause]");
4247 proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4248 cause_type = tvb_get_guint8(tvb, offset);
4250 dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
4253 /* Instance 1 RANAP Cause */
4254 proto_item_append_text(item, "[RANAP Cause]");
4257 /* Instance 2 BSSGP Cause */
4258 proto_item_append_text(item, "[BSSGP Cause]");
4264 }/* GTPV2_FORWARD_RELOCATION_RESP */
4266 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
4271 * 8.50 Selected PLMN ID
4274 * The Selected PLMN ID IE contains the core network operator selected for tne UE
4275 * in a shared network. Octets 5-7 shall be encoded as the content part of the
4276 * "Selected PLMN Identity" parameter in 3GPP TS 36.413 [10].
4277 * -The Selected PLMN identity consists of 3 digits from MCC followed by
4278 * either -a filler digit plus 2 digits from MNC (in case of 2 digit MNC) or
4279 * -3 digits from MNC (in case of a 3 digit MNC).
4282 * +--+--+--+--+--+--+--+--+
4283 * Octet 5 |MCC digit 2|MCC digit 1|
4284 * +--+--+--+--+--+--+--+--+
4285 * Octet 6 |MNC digit 1|MCC digit 3|
4286 * +--+--+--+--+--+--+--+--+
4287 * Octet 7 |MNC digit 3|MNC digit 2|
4288 * +--+--+--+--+--+--+--+--+
4291 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_)
4295 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, FALSE);
4296 proto_item_append_text(item, "%s", mcc_mnc_str);
4300 * 8.51 Target Identification
4303 static const value_string gtpv2_target_type_vals[] = {
4305 {1, "Macro eNodeB ID"},
4306 {2, "Cell Identifier"},
4307 {3, "Home eNodeB ID"},
4310 static value_string_ext gtpv2_target_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_target_type_vals);
4313 dissect_gtpv2_macro_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
4317 guint32 macro_enodeb_id;
4319 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, TRUE);
4321 /* The Macro eNodeB ID consists of 20 bits.
4322 * Bit 4 of Octet 4 is the most significant bit and bit 1 of Octet 6 is the least significant bit.
4324 macro_enodeb_id = tvb_get_ntoh24(tvb, *offset) & 0x0fffff;
4325 proto_tree_add_item(tree, hf_gtpv2_macro_enodeb_id, tvb, *offset, 3, ENC_BIG_ENDIAN);
4328 str = wmem_strdup_printf(wmem_packet_scope(), "%s, Macro eNodeB ID 0x%x",
4336 dissect_gtpv2_home_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
4340 guint32 home_enodeb_id;
4342 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, TRUE);
4345 /* Octet 10 to 12 Home eNodeB ID
4346 * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
4347 * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
4348 * The coding of the Home eNodeB ID is the responsibility of each administration.
4349 * Coding using full hexadecimal representation shall be used.
4351 home_enodeb_id = tvb_get_ntohl(tvb, *offset) & 0x0fffffff;
4352 proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, *offset, 4 , ENC_BIG_ENDIAN);
4355 str = wmem_strdup_printf(wmem_packet_scope(), "%s, Home eNodeB ID 0x%x",
4363 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_)
4369 proto_tree_add_item(tree, hf_gtpv2_target_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4370 target_type = tvb_get_guint8(tvb, offset);
4372 switch (target_type) {
4374 new_tvb = tvb_new_subset_remaining(tvb, offset);
4375 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, E212_NONE, TRUE);
4378 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
4381 /* RAC (see NOTE 3) */
4382 proto_tree_add_item(tree, hf_gtpv2_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
4385 * In this case the Target ID field shall be encoded as the Target
4386 * RNC-ID part of the "Target ID" parameter in 3GPP TS 25.413 [33]. Therefore, the "Choice Target ID" that indicates
4387 * "Target RNC-ID" (numerical value of 0x20) shall not be included (value in octet 5 specifies the target type).
4389 proto_tree_add_item(tree, hf_gtpv2_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4390 /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
4391 * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
4394 proto_tree_add_item(tree, hf_gtpv2_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4398 /* Macro eNodeB ID*/
4399 dissect_gtpv2_macro_enodeb_id(tvb, pinfo, tree, &offset);
4401 /* Tracking Area Code (TAC) */
4402 proto_tree_add_item(tree, hf_gtpv2_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
4407 /* Cell Identifier */
4408 /* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
4409 * in 3GPP TS 48.018 [34].
4411 new_tvb = tvb_new_subset_remaining(tvb, offset);
4412 de_bssgp_cell_id(new_tvb, tree, pinfo, 0, 0/* not used */, NULL, 0);
4415 /* Home eNodeB ID */
4416 dissect_gtpv2_home_enodeb_id(tvb, pinfo, tree, &offset);
4418 /* Octet 13 to 14 Tracking Area Code (TAC) */
4419 proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
4425 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
4433 * 8.53 Packet Flow ID
4436 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_)
4440 /* Octet 5 Spare EBI */
4441 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4442 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 2, ENC_BIG_ENDIAN);
4445 /* Packet Flow ID */
4446 proto_tree_add_item(tree, hf_gtpv2_packet_flow_id, tvb, offset, length, ENC_NA);
4453 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_)
4458 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
4459 proto_tree_add_item(tree, hf_gtpv2_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
4462 /* 6 to 7 DL GTP-U Sequence Number */
4463 proto_tree_add_item(tree, hf_gtpv2_dl_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
4466 /* 8 to 9 UL GTP-U Sequence Number */
4467 proto_tree_add_item(tree, hf_gtpv2_ul_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
4470 /* 10 to 11 DL PDCP Sequence Number */
4471 proto_tree_add_item(tree, hf_gtpv2_dl_pdcp_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
4474 /* 12 to 13 UL PDCP Sequence Number */
4475 proto_tree_add_item(tree, hf_gtpv2_ul_pdcp_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
4480 * 8.55 Source RNC PDCP context info
4483 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_)
4485 proto_tree_add_item(tree, hf_gtpv2_rrc_container, tvb, 0, length, ENC_NA);
4489 * 8.56 UDP Source Port Number
4492 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_)
4494 proto_tree_add_item(tree, hf_gtpv2_upd_source_port_number, tvb, 0, 2, ENC_BIG_ENDIAN);
4495 proto_item_append_text(item, "%u", tvb_get_ntohs(tvb, 0));
4498 * 8.57 APN Restriction
4501 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_)
4505 type_value = tvb_get_guint8(tvb, 0);
4506 proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, 0, 1, ENC_BIG_ENDIAN);
4507 proto_item_append_text(item, "value %u", type_value);
4511 * 8.58 Selection Mode
4513 static const value_string gtpv2_selec_mode_vals[] = {
4514 {0, "MS or network provided APN, subscribed verified"},
4515 {1, "MS provided APN, subscription not verified"},
4516 {2, "Network provided APN, subscription not verified"},
4517 {3, "Network provided APN, subscription not verified (Basically for Future use"},
4522 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_)
4527 ss_mode = tvb_get_guint8(tvb, offset) & 0x03;
4528 proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
4529 proto_item_append_text(item, "%s", val_to_str_const(ss_mode, gtpv2_selec_mode_vals, "Unknown"));
4534 * 8.59 Source Identification
4537 static const value_string gtpv2_source_ident_types[] = {
4540 {2, "eNodeB ID(Reserved, used in erlier v of proto.)"},
4545 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_)
4550 /* Octet 5 to 12 Target Cell ID */
4551 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4553 /* Octet 13 Source Type */
4554 source_type = tvb_get_guint8(tvb, offset);
4555 proto_tree_add_item(tree, hf_gtpv2_source_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4557 /* Octet 14 to (n+4) Source ID */
4558 switch (source_type) {
4560 /* The Source Type is Cell ID for PS handover from GERAN A/Gb mode. In this case the coding of the Source ID field
4561 * shall be same as the Octets 3 to 10 of the Cell Identifier IEI in 3GPP TS 48.018 [34].
4563 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
4566 /* The Source Type is RNC ID for PS handover from GERAN Iu mode or for inter-RAT handover from UTRAN. In this
4567 * case the Source ID field shall be encoded as as the Source RNC-ID part of the "Source ID" parameter in 3GPP TS
4570 /* RNC-ID M INTEGER (0..4095) */
4575 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_source_type_unknown, tvb, offset-1, 1);
4582 * 8.60 Bearer Control Mode
4584 static const value_string gtpv2_bearer_control_mode_vals[] = {
4585 {0, "Selected Bearer Control Mode-'MS_only'"},
4586 {1, "Selected Bearer Control Mode-'Network_only'"},
4587 {2, "Selected Bearer Control Mode-'MS/NW'"},
4591 static const value_string gtpv2_bearer_control_mode_short_vals[] = {
4593 {1, "Network_only"},
4599 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_)
4603 proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
4604 /* Add Bearer Control Mode to tree */
4605 bcm = tvb_get_guint8(tvb, 0);
4606 proto_item_append_text(item, "%s", val_to_str_const(bcm, gtpv2_bearer_control_mode_short_vals, "Unknown"));
4610 * 8.61 Change Reporting Action
4612 static const value_string gtpv2_cng_rep_act_vals[] = {
4613 {0, "Stop Reporting"},
4614 {1, "Start Reporting CGI/SAI"},
4615 {2, "Start Reporting RAI"},
4616 {3, "Start Reporting TAI"},
4617 {4, "Start Reporting ECGI"},
4618 {5, "Start Reporting CGI/SAI and RAI"},
4619 {6, "Start Reporting TAI and ECGI"},
4624 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_)
4628 /* Add Action to tree */
4629 action = tvb_get_guint8(tvb, 0);
4630 proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, ENC_BIG_ENDIAN);
4632 proto_item_append_text(item, "%s", val_to_str_const(action, gtpv2_cng_rep_act_vals, "Unknown"));
4635 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
4638 static const value_string gtpv2_fq_csid_type_vals[] = {
4639 {0, "Global unicast IPv4 address"},
4640 {1, "Global unicast IPv6 address"},
4641 {2, "4 octets long field"},
4647 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_)
4650 guint8 octet, node_id_type, csids;
4652 /* Octet 5 Node-ID Type Number of CSIDs= m */
4654 octet = tvb_get_guint8(tvb, offset);
4655 node_id_type = octet >> 4;
4656 csids = octet & 0x0f;
4657 proto_tree_add_item(tree, hf_gtpv2_fq_csid_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4658 proto_tree_add_item(tree, hf_gtpv2_fq_csid_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
4661 switch (node_id_type) {
4663 /* Indicates that Node-ID is a global unicast IPv4 address and p = 9 */
4664 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4668 /* Indicates that Node-ID is a global unicast IPv6 address and p = 21 */
4669 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv6, tvb, offset, 16, ENC_NA);
4673 /* Node-ID is a 4 octets long field with a 32 bit value stored in network order, and p= 9. The coding
4674 * of the field is specified below:
4675 * - Most significant 20 bits are the binary encoded value of (MCC * 1000 + MNC).
4676 * - Least significant 12 bits is a 12 bit integer assigned by an operator to an MME, SGW or PGW. Other values of
4677 * Node-ID Type are reserved.
4679 proto_tree_add_item(tree, hf_gtpv2_fq_csid_node_id, tvb, offset, 4, ENC_BIG_ENDIAN);
4680 proto_tree_add_item(tree, hf_gtpv2_fq_csid_mcc_mnc, tvb, offset, 4, ENC_BIG_ENDIAN);
4684 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_fq_csid_type_bad, tvb, offset-1, 1,
4685 "Wrong Node-ID Type %u, should be 0-2(Or this is a newer spec)", node_id_type);
4689 /* First PDN Connection Set Identifier (CSID)
4690 * Second PDN Connection Set Identifier (CSID)
4692 * m-th PDN Connection Set Identifier (CSID)
4695 proto_tree_add_item(tree, hf_gtpv2_fq_csid_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4702 * 8.63 Channel needed
4705 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_)
4707 /* The Channel needed shall be coded as depicted in Figure 8.63-1. Channel needed is coded as the IEI part and the value
4708 * part of the Channel Needed IE defined in 3GPP TS 44.018[28]
4710 de_rr_chnl_needed(tvb, tree, pinfo, 0, length, NULL, 0);
4714 * 8.64 eMLPP Priority
4715 * The eMLPP-Priority shall be coded as depicted in Figure 8.64-1. The eMLPP Priority is coded as the value part of the
4716 * eMLPP-Priority IE defined in 3GPP TS 48.008 [29] (not including 3GPP TS 48.008 IEI and 3GPP TS 48.008 [29]
4717 * length indicator).
4720 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_)
4722 be_emlpp_prio(tvb, tree, pinfo, 0, length, NULL, 0);
4729 static const value_string gtpv2_node_type_vals[] = {
4736 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_)
4740 proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, ENC_BIG_ENDIAN);
4741 /* Append Node Type to tree */
4742 node_type = tvb_get_guint8(tvb, 0);
4743 proto_item_append_text(item, "%s", val_to_str_const(node_type, gtpv2_node_type_vals, "Unknown"));
4748 * 8.66 Fully Qualified Domain Name (FQDN)
4751 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_)
4753 int offset = 0, name_len, tmp;
4754 guint8 *fqdn = NULL;
4756 /* The FQDN field encoding shall be identical to the encoding of
4757 * a FQDN within a DNS message of section 3.1 of IETF
4758 * RFC 1035 [31] but excluding the trailing zero byte.
4761 name_len = tvb_get_guint8(tvb, offset);
4763 if (name_len < 0x20) {
4764 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, length - 1, ENC_ASCII);
4766 if (name_len >= length - 1)
4769 name_len = name_len + fqdn[tmp] + 1;
4773 fqdn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, length, ENC_ASCII);
4775 proto_tree_add_string(tree, hf_gtpv2_fqdn, tvb, offset, length, fqdn);
4776 proto_item_append_text(item, "%s", fqdn);
4781 * 8.67 Private Extension
4784 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)
4790 /* oct 5 -7 Enterprise ID */
4791 ext_id = tvb_get_ntohs(tvb, offset);
4792 proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4795 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(ext_id, &sminmpec_values_ext, "Unknown"), ext_id);
4797 next_tvb = tvb_new_subset_length(tvb, offset, length-2);
4798 if (dissector_try_uint_new(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, FALSE, GUINT_TO_POINTER((guint32)instance))){
4802 proto_tree_add_item(tree, hf_gtpv2_proprietary_value, tvb, offset, length-2, ENC_NA);
4806 * 8.68 Transaction Identifier (TI)
4809 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_)
4811 /* 5 to (n+4) Transaction Identifier */
4812 proto_tree_add_item(tree, hf_gtpv2_ti, tvb, 0, length, ENC_NA);
4817 * 8.69 MBMS Session Duration
4820 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_)
4828 guint32 durations_seconds;
4829 proto_item *day_item, *sec_item;
4831 /* From 3GPP TS 29.061 17.7.7 MBMS-Session-Duration AVP */
4832 /* Bits: ssss ssss ssss ssss sddd dddd where s bits = seconds, d bits = days */
4833 durations_seconds = tvb_get_bits32(tvb, bit_offset, 17, ENC_BIG_ENDIAN);
4836 days = tvb_get_bits32(tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4838 /* 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. */
4839 if ((durations_seconds == 0) && (days == 0)) {
4840 day_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4841 sec_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4842 proto_item_append_text(item, "Indefinite (always-on)");
4844 hours = durations_seconds / 3600;
4845 minutes = (durations_seconds % 3600) / 60;
4846 seconds = (durations_seconds % 3600) % 60;
4848 day_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
4849 sec_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
4850 proto_item_append_text(item, "%d days %02d:%02d:%02d (DD days HH:MM:SS)", days, hours, minutes, seconds);
4853 /* Maximum allowed value for days: 18.
4854 * Maximum allowed value for seconds: 86,400 */
4856 expert_add_info(pinfo, day_item, &ei_gtpv2_mbms_session_duration_days);
4858 if (durations_seconds > 86400) {
4859 expert_add_info(pinfo, sec_item, &ei_gtpv2_mbms_session_duration_secs);
4864 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-3, ENC_NA);
4868 * 8.70 MBMS Service Area
4871 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_)
4874 proto_item *sai_item;
4879 binary_nr = tvb_get_guint8(tvb, offset);
4880 real_nr = (guint16)binary_nr + 1;
4882 /* 3GPP TS 29.061 17.7.6 MBMS-Service-Area AVP */
4883 proto_tree_add_uint(tree, hf_gtpv2_mbms_service_area_nr, tvb, offset, 1, real_nr);
4886 /* A consecutive list of MBMS Service Area Identities follow, each with a length of two octets. */
4887 while (offset < length) {
4888 /* 3GPP TS 23.003 15.3 Structure of MBMS SAI */
4889 sai = tvb_get_ntohs(tvb, offset);
4890 sai_item = proto_tree_add_item(tree, hf_gtpv2_mbms_service_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
4891 /* The value 0 denotes the whole of PLMN as the MBMS Service Area */
4893 proto_item_append_text(sai_item, " Entire PLMN");
4895 proto_item_append_text(item, " %u", sai);
4901 * 8.71 MBMS Session Identifier
4904 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_)
4907 /* One octet OctetString. */
4908 proto_tree_add_item(tree, hf_gtpv2_mbms_session_id, tvb, offset, 1, ENC_NA);
4912 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
4916 * 8.72 MBMS Flow Identifier
4919 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_)
4922 /* Two octets OctetString. */
4923 proto_tree_add_item(tree, hf_gtpv2_mbms_flow_id, tvb, offset, 2, ENC_NA);
4924 proto_item_append_text(item, " %s", tvb_bytes_to_str(wmem_packet_scope(), tvb, offset, 2));
4928 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-2, ENC_NA);
4932 * 8.73 MBMS IP Multicast Distribution
4934 static const value_string gtpv2_mbms_hc_indicator_vals[] = {
4935 {0, "Uncompressed header"},
4936 {1, "Compressed header"},
4941 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_)
4945 proto_tree_add_item(tree, hf_gtpv2_cteid, tvb, offset, 4, ENC_BIG_ENDIAN);
4948 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4949 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4950 /* IP Multicast Distribution Address */
4951 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4953 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4954 proto_item_append_text(item, " IPv4 Dist %s", tvb_ip_to_str(tvb, offset));
4956 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4958 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv6, tvb, offset, 16, ENC_NA);
4959 proto_item_append_text(item, " IPv6 Dist %s", tvb_ip6_to_str(tvb, offset));
4963 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
4964 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4965 /* IP Multicast Source Address */
4966 if ((tvb_get_guint8(tvb, offset) & 0x3f) == 4) {
4968 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
4969 proto_item_append_text(item, " IPv4 Src %s", tvb_ip_to_str(tvb, offset));
4971 } else if ((tvb_get_guint8(tvb, offset) & 0x3f) == 16) {
4973 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv6, tvb, offset, 16, ENC_NA);
4974 proto_item_append_text(item, " IPv6 Src %s", tvb_ip6_to_str(tvb, offset));
4978 proto_tree_add_item(tree, hf_gtpv2_mbms_hc_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
4981 if (length > offset)
4982 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
4987 * 8.74 MBMS Distribution Acknowledge
4989 static const value_string gtpv2_mbms_dist_indication_vals[] = {
4990 {0, "No RNCs have accepted IP multicast distribution"},
4991 {1, "All RNCs have accepted IP multicast distribution"},
4992 {2, "Some RNCs have accepted IP multicast distribution"},
4993 {3, "Spare. For future use."},
4998 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_)
5002 proto_tree_add_item(tree, hf_gtpv2_mbms_dist_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
5006 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5010 * 8.75 User CSG Information (UCI)
5012 static const value_string gtpv2_uci_csg_membership_status[] = {
5013 {0, "Non CSG membership"},
5014 {1, "CSG membership"},
5018 static const value_string gtpv2_uci_access_mode[] = {
5026 static const value_string gtpv2_uci_leave_csg[] = {
5027 {0, "Access CSG cell/Hybrid cell"},
5028 {1, "Leaves CSG cell/Hybrid cell"},
5033 dissect_gtpv2_uci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5037 /* Value of MCC & MNC */
5038 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, TRUE);
5040 /* Value of CSG ID */
5041 proto_tree_add_item(tree, hf_gtpv2_uci_csg_id_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5042 proto_tree_add_item(tree, hf_gtpv2_uci_csg_id, tvb, offset, 4, ENC_BIG_ENDIAN);
5045 /* Value of access mode */
5046 proto_tree_add_item(tree, hf_gtpv2_uci_access_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
5049 proto_tree_add_item(tree, hf_gtpv2_uci_lcsg, tvb, offset, 1, ENC_BIG_ENDIAN);
5051 /* Value of CSG membership */
5052 proto_tree_add_item(tree, hf_gtpv2_uci_csg_membership, tvb, offset, 1, ENC_BIG_ENDIAN);
5056 /* 8.76 CSG Information Reporting Action */
5058 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_)
5060 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5063 /* 8.77 RFSP Index */
5065 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_)
5070 proto_tree_add_item(tree, hf_gtpv2_subscriber_rfsp, tvb, offset, 2, ENC_BIG_ENDIAN);
5071 }else if(instance == 1){
5072 proto_tree_add_item(tree, hf_gtpv2_rfsp_inuse, tvb, offset, 2, ENC_BIG_ENDIAN);
5078 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_)
5080 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5083 /* 8.79 CSG Membership Indication (CMI) */
5085 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_)
5087 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5090 /* 8.80 Service indicator */
5092 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_)
5094 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5097 /* 8.81 Detach Type */
5099 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_)
5101 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5104 /* 8.82 Local Distinguished Name (LDN) */
5106 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_)
5108 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5111 /* 8.83 Node Features */
5113 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_)
5116 proto_tree_add_item(tree, hf_gtpv2_node_features_prn, tvb, offset, 1, ENC_BIG_ENDIAN);
5117 proto_tree_add_item(tree, hf_gtpv2_node_features_mabr, tvb, offset, 1, ENC_BIG_ENDIAN);
5118 proto_tree_add_item(tree, hf_gtpv2_node_features_ntsr, tvb, offset, 1, ENC_BIG_ENDIAN);
5121 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5125 * MBMS Time to Data Transfer
5128 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_)
5134 binary_secs = tvb_get_guint8(tvb, offset);
5135 real_secs = (guint16)binary_secs + 1;
5137 proto_tree_add_string_format_value(tree, hf_gtpv2_time_to_data_xfer, tvb, offset, 1, "", "%d second(s)", real_secs);
5138 proto_item_append_text(item, " %u second(s)", real_secs);
5141 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5144 static const value_string gtpv2_throttling_delay_unit_vals[] = {
5145 { 0, "value is incremented in multiples of 2 seconds" },
5146 { 1, "value is incremented in multiples of 1 minute" },
5147 { 2, "value is incremented in multiples of 10 minutes" },
5148 { 3, "value is incremented in multiples of 1 hour" },
5149 { 4, "value is incremented in multiples of 10 hour" },
5150 { 7, "value indicates that the timer is deactivated" },
5154 /* 8.85 Throttling */
5156 dissect_gtpv2_throttling(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, guint16 length, guint8 message_type _U_, guint8 instance _U_)
5161 proto_tree_add_item(tree, hf_gtpv2_throttling_delay_unit, tvb, offset, 1, ENC_BIG_ENDIAN);
5162 proto_tree_add_item(tree, hf_gtpv2_throttling_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
5165 oct = tvb_get_guint8(tvb, offset);
5166 proto_tree_add_item(tree, hf_gtpv2_throttling_factor, tvb, offset, 1, ENC_BIG_ENDIAN);
5168 proto_item_append_text(item, "Throttling factor: value beyond (0,100) is considered as 0");
5172 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length - 2, ENC_NA);
5177 /* 8.86 Allocation/Retention Priority (ARP) */
5179 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_)
5183 proto_tree_add_item(tree, hf_gtpv2_arp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
5184 proto_tree_add_item(tree, hf_gtpv2_arp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
5185 proto_tree_add_item(tree, hf_gtpv2_arp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
5189 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5192 /* 8.87 EPC Timer */
5193 static const value_string gtpv2_timer_unit_vals[] = {
5194 {0, "value is incremented in multiples of 2 seconds"},
5195 {1, "value is incremented in multiples of 1 minute"},
5196 {2, "value is incremented in multiples of 10 minutes"},
5197 {3, "value is incremented in multiples of 1 hour"},
5198 {4, "value is incremented in multiples of 10 hour"},
5199 {5, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
5200 {6, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
5201 {7, "value indicates that the timer is infinite"},
5206 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_)
5208 proto_tree_add_item(tree, hf_gtpv2_timer_unit, tvb, 0, 1, ENC_BIG_ENDIAN);
5209 proto_tree_add_item(tree, hf_gtpv2_timer_value, tvb, 0, 1, ENC_BIG_ENDIAN);
5213 /* 8.88 Signalling Priority Indication */
5215 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_)
5217 proto_tree_add_item(tree, hf_gtpv2_lapi, tvb, 0, 1, ENC_BIG_ENDIAN);
5220 /* 8.89 Temporary Mobile Group Identity (TMGI) */
5222 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_)
5227 tmgi = tvb_get_ntoh48(tvb, offset);
5229 proto_item_append_text(item, "%012" G_GINT64_MODIFIER "x", tmgi);
5231 proto_tree_add_item(tree, hf_gtpv2_mbms_service_id, tvb, offset, 3, ENC_NA);
5234 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_NONE, TRUE);
5237 if (length > offset)
5238 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
5242 * 8.90 Additional MM context for SRVCC
5243 * 3GPP TS 29.274 Figure 8.90-1
5246 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_)
5249 proto_item *ms_cm_item;
5250 proto_tree *ms_cm_tree;
5253 /* Length of Mobile Station Classmark 2 */
5254 elm_len = tvb_get_guint8(tvb, offset);
5255 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
5257 ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
5258 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
5259 /* Mobile Station Classmark 2 */
5260 de_ms_cm_2(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
5263 /* Length of Mobile Station Classmark 3 */
5264 elm_len = tvb_get_guint8(tvb, offset);
5265 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
5267 ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
5268 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
5269 /* Mobile Station Classmark 3 */
5270 de_ms_cm_3(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
5273 /* Length of Supported Codec List */
5274 elm_len = tvb_get_guint8(tvb, offset);
5275 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
5277 ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
5278 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_supp_codec_list);
5279 /* Supported Codec List */
5280 de_sup_codec_list(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
5283 if (length > offset)
5284 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
5287 /* 8.91 Additional flags for SRVCC */
5289 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_)
5293 proto_tree_add_item(tree, hf_gtpv2_add_flags_for_srvcc_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
5294 proto_tree_add_item(tree, hf_gtpv2_vsrvcc_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
5298 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5301 /* 8.92 Max MBR/APN-AMBR (MMBR) */
5303 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_)
5309 max_ul = tvb_get_ntohl(tvb, offset);
5310 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "%u %s",
5311 (max_ul) > 1000 ? max_ul/1000 : max_ul,
5312 (max_ul) > 1000 ? "Mbps" : "kbps");
5316 max_dl = tvb_get_ntohl(tvb, offset);
5317 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "%u %s",
5318 (max_dl) > 1000 ? max_dl/1000 : max_dl,
5319 (max_dl) > 1000 ? "Mbps" : "kbps");
5322 /* 8.93 MDT Configuration */
5324 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_)
5326 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5329 /* 8.94 Additional Protocol Configuration Options (APCO) */
5331 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_)
5333 switch (message_type) {
5334 case GTPV2_CREATE_SESSION_REQUEST:
5335 case GTPV2_DELETE_SESSION_REQUEST:
5336 case GTPV2_BEARER_RESOURCE_COMMAND:
5337 case GTPV2_CREATE_BEARER_RESPONSE:
5338 case GTPV2_UPDATE_BEARER_RESPONSE:
5339 case GTPV2_DELETE_BEARER_RESPONSE:
5340 /* PCO options as MS to network direction */
5341 pinfo->link_dir = P2P_DIR_UL;
5343 case GTPV2_CREATE_SESSION_RESPONSE:
5344 case GTPV2_MODIFY_BEARER_RESPONSE:
5345 case GTPV2_DELETE_SESSION_RESPONSE:
5346 case GTPV2_CREATE_BEARER_REQUEST:
5347 case GTPV2_UPDATE_BEARER_REQUEST:
5348 case GTPV2_DELETE_BEARER_REQUEST:
5349 /* PCO options as Network to MS direction: */
5350 pinfo->link_dir = P2P_DIR_DL;
5355 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
5358 /* 8.95 Absolute Time of MBMS Data Transfer */
5360 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_)
5363 const gchar *time_str;
5365 time_str = tvb_ntp_fmt_ts(tvb, offset);
5366 proto_tree_add_string(tree, hf_gtpv2_abs_time_mbms_data, tvb, offset, 8, time_str);
5367 proto_item_append_text(item, "%s", time_str);
5370 if (length > offset)
5371 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
5374 /* 8.96 H(e)NB Information Reporting */
5375 static const true_false_string gtpv2_henb_info_report_fti_vals = {
5376 "Start reporting H(e)NB local IP address and UDP port number information change",
5377 "Stop reporting H(e)NB local IP address and UDP port number information change",
5381 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_)
5385 proto_tree_add_item(tree, hf_gtpv2_henb_info_report_fti, tvb, offset, 1, ENC_BIG_ENDIAN);
5389 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5392 /* 8.97 IPv4 Configuration Parameters (IP4CP) */
5394 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_)
5398 proto_tree_add_item(tree, hf_gtpv2_ip4cp_subnet_prefix_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5400 proto_tree_add_item(tree, hf_gtpv2_ip4cp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
5403 if (length > offset)
5404 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
5407 /* 8.98 Change to Report Flags */
5409 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_)
5413 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_sncr, tvb, offset, 1, ENC_BIG_ENDIAN);
5414 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_tzcr, tvb, offset, 1, ENC_BIG_ENDIAN);
5418 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5421 /* 8.99 Action Indication */
5422 static const value_string gtpv2_action_indication_vals[] = {
5424 { 1, "Deactivation Indication"},
5425 { 2, "Paging Indication"},
5433 static value_string_ext gtpv2_action_indication_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_action_indication_vals);
5436 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_)
5440 proto_tree_add_item(tree, hf_gtpv2_action_indication_val, tvb, offset, 1, ENC_BIG_ENDIAN);
5444 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
5448 * 8.100 TWAN Identifier
5451 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_)
5453 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5456 * 8.101 ULI Timestamp
5459 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_)
5461 const gchar *time_str;
5463 /* Octets 5 to 8 are encoded in the same format as the first four octets of the 64-bit timestamp
5464 * format as defined in section 6 of IETF RFC 5905
5467 time_str = tvb_ntp_fmt_ts_sec(tvb, 0);
5468 proto_tree_add_string(tree, hf_gtpv2_uli_timestamp, tvb, 0, 8, time_str);
5469 proto_item_append_text(item, "%s", time_str);
5476 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_)
5478 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5481 * 8.103 RAN/NAS Cause
5484 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_)
5486 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5489 * 8.104 CN Operator Selection Entity
5492 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_)
5494 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5497 * 8.105 Trusted WLAN Mode Indication
5500 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_)
5502 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5508 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_)
5510 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5513 * 8.107 Node Identifier
5516 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_)
5518 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5521 * 8.108 Presence Reporting Area Action
5525 * The Presence-Reporting-Area-Elements-List AVP (AVP code 2820)
5526 * is of type Octetstring and is coded as specified in 3GPP TS 29.274 [22]
5527 * in Presence Reporting Area Action IE, starting from octet 9.
5531 dissect_diameter_3gpp_presence_reporting_area_elements_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
5533 /*diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;*/
5534 proto_tree *sub_tree;
5538 guint8 oct, no_tai, no_rai, no_mENB, no_hENB, no_ECGI, no_sai, no_cgi;
5540 length = tvb_reported_length(tvb);
5542 /* Octet 9 Number of TAI Number of RAI */
5543 oct = tvb_get_guint8(tvb,offset);
5545 no_rai = oct & 0x0f;
5546 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_act_no_tai, tvb, offset, 1, ENC_BIG_ENDIAN);
5547 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_act_no_rai, tvb, offset, 1, ENC_BIG_ENDIAN);
5549 /* Octet 10 Spare Number of Macro eNodeB */
5550 no_mENB = tvb_get_guint8(tvb,offset) & 0x3f;
5551 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_act_no_m_enodeb, tvb, offset, 1, ENC_BIG_ENDIAN);
5553 /* Octet 11 Spare Number of Home eNodeB */
5554 no_hENB = tvb_get_guint8(tvb,offset) & 0x3f;
5555 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_act_no_h_enodeb, tvb, offset, 1, ENC_BIG_ENDIAN);
5557 /* Octet 12 Spare Number of ECGI */
5558 no_ECGI = tvb_get_guint8(tvb,offset) & 0x3f;
5559 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_act_no_ecgi, tvb, offset, 1, ENC_BIG_ENDIAN);
5561 /* Octet 13 Spare Number of SAI */
5562 no_sai = tvb_get_guint8(tvb,offset) & 0x3f;
5563 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_act_no_sai, tvb, offset, 1, ENC_BIG_ENDIAN);
5565 /* Octet 14 Spare Number of CGI */
5566 no_cgi = tvb_get_guint8(tvb,offset) & 0x3f;
5567 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_act_no_cgi, tvb, offset, 1, ENC_BIG_ENDIAN);
5569 /* Octet 15 to k TAIs [1..15] */
5573 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 5, ett_gtpv2_preaa_tais, &item, "Tracking Area Identity (TAI) Number %u",i);
5574 append_str = dissect_gtpv2_tai(tvb, pinfo, sub_tree, &offset);
5575 proto_item_append_text(item, " %s",append_str);
5580 /* Octet (k+1) to m Macro eNB IDs [1..63]
5581 * Macro eNB IDs in octets 'k+1' to 'm', if any, shall be encoded as per octets 6 to 11 of the Target ID for type Macro eNodeB in figure 8.51-2.
5582 * Octets 'k+1' to 'm' shall be absent if the field 'Number of Macro eNodeB' is set to the value '0'.
5586 while (no_mENB > 0){
5587 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 6, ett_gtpv2_preaa_menbs, &item, "Macro eNB ID %u",i);
5588 append_str = dissect_gtpv2_macro_enodeb_id(tvb, pinfo, sub_tree, &offset);
5589 proto_item_append_text(item, " %s",append_str);
5594 /* Octet (m+1) to p Home eNB IDs [1..63]
5595 * Home eNB IDs in octets 'm+1' to 'p', if any, shall be encoded as per octets 6 to 12 of the Target ID for type Home eNodeB in figure 8.51-3.
5596 * Octets 'm+1' to 'p' shall be absent if the field 'Number of Home eNodeB' is set to the value '0'.
5600 while (no_hENB > 0){
5601 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_henbs, &item, "Home eNB ID %u",i);
5602 append_str = dissect_gtpv2_home_enodeb_id(tvb, pinfo, sub_tree, &offset);
5603 proto_item_append_text(item, " %s",append_str);
5608 /* Octet (p+1) to q ECGIs [1..63]
5609 * ECGIs in octets 'p+1' to 'q', if any, shall be encoded as per the ECGI field in subclause 8.21.5.
5610 * Octets 'p+1' to 'q' shall be absent if the field 'Number of ECGI' is set to the value '0'.
5614 while (no_ECGI > 0){
5615 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_ecgis, &item, "ECGI ID %u",i);
5616 append_str = dissect_gtpv2_ecgi(tvb, pinfo, sub_tree, &offset);
5617 proto_item_append_text(item, " %s",append_str);
5622 /* Octet (q+1) to r RAIs [1..15]
5623 * RAIs in octets 'q+1' to 'r', if any, shall be encoded as per the RAI field in subclause 8.21.3.
5624 * Octets 'q+1' to 'r' shall be absent if the field 'Number of RAI' is set to the value '0'.
5629 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_rais, &item, "RAI ID %u",i);
5630 append_str = dissect_gtpv2_rai(tvb, pinfo, sub_tree, &offset);
5631 proto_item_append_text(item, " %s",append_str);
5636 /* Octet (r+1) to s SAIs [1..63]
5637 * SAIs in octets 'r+1' to 's', if any, shall be encoded as per the SAI field in subclause 8.21.2.
5638 * Octets 'r+1' to 's' shall be absent if the field 'Number of SAI' is set to the value '0'.
5643 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_sais, &item, "SAI ID %u",i);
5644 append_str = dissect_gtpv2_sai_common(tvb, pinfo, sub_tree, &offset);
5645 proto_item_append_text(item, " %s",append_str);
5650 /* Octet (s+1) to t CGIs [1..63]
5651 * CGIs in octets 's+1' to 't', if any, shall be encoded as per the CGI field in subclause 8.21.1.
5652 * Octets 's+1' to 't' shall be absent if the field 'Number of CGI' is set to the value '0'.
5657 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_cgis, &item, "CGI ID %u",i);
5658 append_str = dissect_gtpv2_cgi(tvb, pinfo, sub_tree, &offset);
5659 proto_item_append_text(item, " %s",append_str);
5668 static const value_string gtpv2_pres_rep_area_action_vals[] = {
5669 { 1, "Start Reporting change"},
5670 { 2, "Stop Reporting change"},
5675 dissect_gtpv2_pres_rep_area_action(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length, guint8 message_type _U_, guint8 instance _U_)
5680 /* Octet 5 Spare Action */
5681 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_action, tvb, offset, 1, ENC_BIG_ENDIAN);
5686 /* Octet 6 to 8 Presence Reporting Area Identifier */
5687 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5692 new_tvb = tvb_new_subset_length(tvb, offset, length-3);
5694 /* Share the rest of the dissection with the AVP dissector */
5695 dissect_diameter_3gpp_presence_reporting_area_elements_list(new_tvb, pinfo, tree, NULL);
5699 * 8.109 Presence Reporting Area Information
5702 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_)
5704 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5707 * 8.110 TWAN Identifier Timestamp
5710 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_)
5712 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
5715 * 8.111 Overload Control Information
5719 dissect_gtpv2_overload_control_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, guint16 length _U_, guint8 message_type _U_, guint8 instance _U_)
5723 proto_tree *grouped_tree;
5726 proto_item_append_text(item, "[Grouped IE]");
5727 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_overload_control_information);
5728 new_tvb = tvb_new_subset_length(tvb, offset, length);
5730 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type);
5733 * 8.112 Load Control Information
5736 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_)
5740 proto_tree *grouped_tree;
5742 proto_item_append_text(item, "[Grouped IE]");
5743 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_load_control_inf);
5745 new_tvb = tvb_new_subset_length(tvb, offset, length);
5746 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type);
5752 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_)
5756 proto_tree_add_item_ret_uint(tree, hf_gtpv2_metric, tvb, 0, 1, ENC_BIG_ENDIAN, &oct);
5758 proto_item_append_text(item, "Metric: value beyond 100 is considered as 0");
5760 proto_item_append_text(item, "%u", oct);
5765 * 8.114 Sequence Number
5768 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_)
5771 proto_tree_add_item_ret_uint(tree, hf_gtpv2_sequence_number, tvb, 0, 4, ENC_BIG_ENDIAN, &seq);
5772 proto_item_append_text(item, "%u", seq);
5775 * 8.115 APN and Relative Capacity
5778 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_)
5781 guint8 oct, apn_length;
5785 oct = tvb_get_guint8(tvb, offset);
5786 proto_tree_add_item(tree, hf_gtpv2_relative_capacity, tvb, offset, 1, ENC_BIG_ENDIAN);
5787 if((oct > 0x64) || (oct < 0x01))
5788 proto_item_append_text(item, "Relative Capacity: value beyond (1,100) is considered as 0");
5790 apn_length = tvb_get_guint8(tvb, offset);
5791 proto_tree_add_item(tree, hf_gtpv2_apn_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5796 name_len = tvb_get_guint8(tvb, offset);
5798 if (name_len < 0x20)
5800 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 1, apn_length - 1, ENC_ASCII);
5803 if (name_len >= apn_length - 1)
5806 name_len = name_len + apn[tmp] + 1;
5812 apn = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, apn_length, ENC_ASCII);
5814 proto_tree_add_string(tree, hf_gtpv2_apn, tvb, offset, apn_length, apn);
5819 typedef struct _gtpv2_ie {
5821 void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, guint16, guint8, guint8);
5824 static const gtpv2_ie_t gtpv2_ies[] = {
5825 {GTPV2_IE_IMSI, dissect_gtpv2_imsi}, /* 1, Internal Mobile Subscriber Identity (IMSI) */
5826 {GTPV2_IE_CAUSE, dissect_gtpv2_cause}, /* 2, Cause (without embedded offending IE) 8.4 */
5827 {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery}, /* 3, Recovery (Restart Counter) 8.5 */
5828 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
5829 /*Start SRVCC Messages 3GPP TS 29.280 */
5830 {GTPV2_IE_STN_SR, dissect_gtpv2_stn_sr}, /* 51 STN-SR */
5831 {GTPV2_IE_SRC_TGT_TRANS_CON, dissect_gtpv2_src_tgt_trans_con}, /* 52 Source to Target Transparent Container */
5832 {GTPV2_IE_TGT_SRC_TRANS_CON , dissect_gtpv2_tgt_src_trans_con}, /* 53 Target to Source Transparent Container */
5833 {GTPV2_IE_MM_CON_EUTRAN_SRVCC, dissect_gtpv2_mm_con_eutran_srvcc}, /* 54 MM Context for E-UTRAN SRVCC */
5834 {GTPV2_IE_MM_CON_UTRAN_SRVCC, dissect_gtpv2_mm_con_utran_srvcc}, /* 55 MM Context for UTRAN SRVCC */
5835 {GTPV2_IE_SRVCC_CAUSE, dissect_gtpv2_srvcc_cause}, /* 56 SRVCC Cause */
5836 {GTPV2_IE_TGT_RNC_ID, dissect_gtpv2_tgt_rnc_id}, /* 57 Target RNC ID */
5837 {GTPV2_IE_TGT_GLOGAL_CELL_ID, dissect_gtpv2_tgt_global_cell_id}, /* 58 Target Global Cell ID */
5838 {GTPV2_IE_TEID_C, dissect_gtpv2_teid_c}, /* 59 TEID-C */
5839 {GTPV2_IE_SV_FLAGS, dissect_gtpv2_sv_flags}, /* 60 Sv Flags */
5840 {GTPV2_IE_SAI, dissect_gtpv2_sai}, /* 61 Service Area Identifie */
5841 {GTPV2_IE_MM_CTX_FOR_CS_TO_PS_SRVCC, dissect_gtpv2_mm_ctx_for_cs_to_ps_srvcc }, /* 62 Service Area Identifie */
5842 /* 61-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
5843 {GTPV2_APN, dissect_gtpv2_apn}, /* 71, Access Point Name (APN) 8.6 */
5844 {GTPV2_AMBR, dissect_gtpv2_ambr}, /* 72, Aggregate Maximum Bit Rate (AMBR) */
5845 {GTPV2_EBI, dissect_gtpv2_ebi}, /* 73, EPS Bearer ID (EBI) 8.8 */
5846 {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address}, /* 74, IP Address */
5847 {GTPV2_MEI, dissect_gtpv2_mei}, /* 74, Mobile Equipment Identity */
5848 {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn}, /* 76, MSISDN 8.11 */
5849 {GTPV2_INDICATION, dissect_gtpv2_ind}, /* 77 Indication 8.12 */
5850 {GTPV2_PCO, dissect_gtpv2_pco}, /* 78 Protocol Configuration Options (PCO) 8.13 */
5851 {GTPV2_PAA, dissect_gtpv2_paa}, /* 79 PDN Address Allocation (PAA) 8.14 */
5852 {GTPV2_BEARER_QOS, dissect_gtpv2_bearer_qos}, /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
5853 {GTPV2_IE_FLOW_QOS, dissect_gtpv2_flow_qos}, /* 81 Flow Quality of Service (Flow QoS) 8.16 */
5854 {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type}, /* 82, RAT Type 8.17 */
5855 {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net}, /* 83, Serving Network 8.18 */
5856 {GTPV2_IE_BEARER_TFT, dissect_gtpv2_bearer_tft}, /* 84, Bearer TFT 8.19 */
5857 {GTPV2_IE_TAD, dissect_gtpv2_tad}, /* 85, Traffic Aggregate Description 8.20 */
5858 {GTPV2_IE_ULI, dissect_gtpv2_uli}, /* 86, User Location Info (ULI) 8.22 */
5859 {GTPV2_IE_F_TEID, dissect_gtpv2_f_teid}, /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
5860 {GTPV2_IE_TMSI, dissect_gtpv2_tmsi}, /* 88, TMSI 8.23 */
5861 {GTPV2_IE_GLOBAL_CNID, dissect_gtpv2_g_cn_id}, /* 89, Global CN-Id 8.25 */
5862 {GTPV2_IE_S103PDF, dissect_gtpv2_s103pdf}, /* 90, S103 PDN Data Forwarding Info (S103PDF) 8.25 */
5863 {GTPV2_IE_S1UDF, dissect_gtpv2_s1udf}, /* 91, S1-U Data Forwarding (S1UDF) 8.26 */
5864 {GTPV2_IE_DEL_VAL, dissect_gtpv2_delay_value}, /* 92, Delay Value 8.29 */
5865 {GTPV2_IE_BEARER_CTX, dissect_gtpv2_bearer_ctx}, /* 93, Bearer Context 8.31 */
5866 {GTPV2_IE_CHAR_ID, dissect_gtpv2_charging_id}, /* 94, Charging Id */
5867 {GTPV2_IE_CHAR_CHAR, dissect_gtpv2_char_char}, /* 95 Charging Characteristic */
5868 {GTPV2_IE_TRA_INFO, dissect_gtpv2_tra_info}, /* 96, Trace Information 8.31 */
5869 {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag}, /* 97, Bearer Flag */
5871 {GTPV2_IE_PDN_TYPE, dissect_gtpv2_pdn_type}, /* 99, PDN Type */
5872 {GTPV2_IE_PTI, dissect_gtpv2_pti}, /* 100, Procedure Transaction Id */
5873 {GTPV2_IE_DRX_PARAM, dissect_gtpv2_drx_param}, /* 101, DRX Parameter 8.36 */
5874 {GTPV2_IE_UE_NET_CAPABILITY, dissect_gtpv2_ue_net_capability}, /* 102, UE network capability 8.37 */
5875 {GTPV2_IE_MM_CONTEXT_GSM_T, dissect_gtpv2_mm_context_gsm_t}, /* 103, MM Context 8.38 GSM Key and Triplets */
5876 {GTPV2_IE_MM_CONTEXT_UTMS_CQ, dissect_gtpv2_mm_context_utms_cq}, /* 104, MM Context 8.38 */
5877 {GTPV2_IE_MM_CONTEXT_GSM_CQ, dissect_gtpv2_mm_context_gsm_cq}, /* 105, MM Context 8.38 */
5878 {GTPV2_IE_MM_CONTEXT_UTMS_Q, dissect_gtpv2_mm_context_utms_q}, /* 106, MM Context 8.38 */
5879 {GTPV2_IE_MM_CONTEXT_EPS_QQ, dissect_gtpv2_mm_context_eps_qq}, /* 107, MM Context 8.38 */
5880 {GTPV2_IE_MM_CONTEXT_UTMS_QQ, dissect_gtpv2_mm_context_utms_qq}, /* 108, MM Context 8.38 */
5881 {GTPV2_IE_PDN_CONNECTION, dissect_gtpv2_PDN_conn}, /* 109, PDN Connection */
5882 {GTPV2_IE_PDN_NUMBERS, dissect_gtpv2_pdn_numbers}, /* 110, PDN Numbers 8.40 */
5883 {GTPV2_IE_P_TMSI, dissect_gtpv2_p_tmsi}, /* 111, P-TMSI 8.41 */
5884 {GTPV2_IE_P_TMSI_SIG, dissect_gtpv2_p_tmsi_sig}, /* 112, P-TMSI Signature 8.42 */
5885 {GTPV2_IE_HOP_COUNTER, dissect_gtpv2_hop_counter}, /* 113, Hop Counter 8.43 */
5886 {GTPV2_IE_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone}, /* 114, UE Time Zone */
5887 {GTPV2_IE_TRACE_REFERENCE, dissect_gtpv2_trace_reference}, /* 115, Trace Reference 8.45 */
5888 {GTPV2_IE_COMPLETE_REQUEST_MSG, dissect_complete_request_msg}, /* 116, Complete Request message 8.46 */
5889 {GTPV2_IE_GUTI, dissect_gtpv2_guti}, /* 117, GUTI 8.47 */
5890 {GTPV2_IE_F_CONTAINER, dissect_gtpv2_F_container}, /* 118, Fully Qualified Container (F-Container) */
5891 {GTPV2_IE_F_CAUSE, dissect_gtpv2_F_cause}, /* 119, Fully Qualified Cause (F-Cause) */
5892 {GTPV2_IE_SEL_PLMN_ID, dissect_gtpv2_sel_plmn_id}, /* 120, Selected PLMN ID 8.50 */
5893 {GTPV2_IE_TARGET_ID, dissect_gtpv2_target_id}, /* 121, Target Identification */
5894 /* 122, Void 8.52 */
5895 {GTPV2_IE_PKT_FLOW_ID, dissect_gtpv2_pkt_flow_id}, /* 123, Packet Flow ID 8.53 */
5896 {GTPV2_IE_RAB_CONTEXT, dissect_gtpv2_rab_context}, /* 124, RAB Context 8.54 */
5897 {GTPV2_IE_S_RNC_PDCP_CTX_INFO, dissect_gtpv2_s_rnc_pdcp_ctx_info}, /* 125, Source RNC PDCP context info 8.55 */
5898 {GTPV2_IE_UDP_S_PORT_NR, dissect_udp_s_port_nr}, /* 126, UDP Source Port Number 8.56 */
5899 {GTPV2_IE_APN_RESTRICTION, dissect_gtpv2_apn_rest}, /* 127, APN Restriction */
5900 {GTPV2_IE_SEL_MODE, dissect_gtpv2_selec_mode}, /* 128, Selection Mode */
5901 {GTPV2_IE_SOURCE_IDENT, dissect_gtpv2_source_ident}, /* 129, Source Identification 8.59 */
5902 {GTPV2_IE_BEARER_CONTROL_MODE, dissect_gtpv2_bearer_control_mode}, /* 130, Bearer Control Mode */
5903 {GTPV2_IE_CNG_REP_ACT , dissect_gtpv2_cng_rep_act}, /* 131, Change Reporting Action 8.61 */
5904 {GTPV2_IE_FQ_CSID, dissect_gtpv2_fq_csid}, /* 132, Fully Qualified PDN Connection Set Identifier (FQ-CSID) 8.62 */
5905 {GTPV2_IE_CHANNEL_NEEDED, dissect_gtpv2_channel_needed}, /* 133, Channel Needed 8.63 */
5906 {GTPV2_IE_EMLPP_PRI, dissect_gtpv2_emlpp_pri}, /* 134, eMLPP Priority 8.64 */
5907 {GTPV2_IE_NODE_TYPE , dissect_gtpv2_node_type}, /* 135, Node Type 8.65 */
5908 {GTPV2_IE_FQDN, dissect_gtpv2_fqdn}, /* 136, 8.66 Fully Qualified Domain Name (FQDN) */
5909 {GTPV2_IE_TI, dissect_gtpv2_ti}, /* 137, 8.68 Transaction Identifier (TI) */
5910 {GTPV2_IE_MBMS_SESSION_DURATION, dissect_gtpv2_mbms_session_duration}, /* 138, 8.69 MBMS Session Duration */
5911 {GTPV2_IE_MBMS_SERVICE_AREA, dissect_gtpv2_mbms_service_area}, /* 139, 8.70 MBMS Service Area */
5912 {GTPV2_IE_MBMS_SESSION_ID, dissect_gtpv2_mbms_session_id}, /* 140, 8.71 MBMS Session Identifier */
5913 {GTPV2_IE_MBMS_FLOW_ID, dissect_gtpv2_mbms_flow_id}, /* 141, 8.72 MBMS Flow Identifier */
5914 {GTPV2_IE_MBMS_IP_MC_DIST, dissect_gtpv2_mbms_ip_mc_dist}, /* 142, 8.73 MBMS IP Multicast Distribution */
5915 {GTPV2_IE_MBMS_DIST_ACK, dissect_gtpv2_mbms_dist_ack}, /* 143, 8.74 MBMS Distribution Acknowledge */
5916 {GTPV2_IE_RFSP_INDEX, dissect_gtpv2_rfsp_index}, /* 144, 8.77 RFSP Index */
5917 {GTPV2_IE_UCI, dissect_gtpv2_uci}, /* 145, 8.75 User CSG Information (UCI) */
5918 {GTPV2_IE_CSG_INFO_REP_ACTION, dissect_gtpv2_csg_info_rep_action}, /* 146, 8.76 CSG Information Reporting Action */
5919 {GTPV2_IE_CSG_ID, dissect_gtpv2_csg_id}, /* 147, 8.78 CSG ID */
5920 {GTPV2_IE_CMI, dissect_gtpv2_cmi}, /* 148, 8.79 CSG Membership Indication (CMI) */
5921 {GTPV2_IE_SERVICE_INDICATOR, dissect_gtpv2_service_indicator}, /* 149, 8.80 Service indicator */
5922 {GTPV2_IE_DETACH_TYPE, dissect_gtpv2_detach_type}, /* 150, 8.81 Detach Type */
5923 {GTPV2_IE_LDN, dissect_gtpv2_ldn}, /* 151, 8.82 Local Distinguished Name (LDN) */
5924 {GTPV2_IE_NODE_FEATURES, dissect_gtpv2_node_features}, /* 152, 8.83 Node Features */
5925 {GTPV2_IE_MBMS_TIME_TO_DATA_XFER, dissect_gtpv2_mbms_time_to_data_xfer}, /* 153, 8.84 MBMS Time to Data Transfer */
5926 {GTPV2_IE_THROTTLING, dissect_gtpv2_throttling}, /* 154, 8.85 Throttling */
5927 {GTPV2_IE_ARP, dissect_gtpv2_arp}, /* 155, 8.86 Allocation/Retention Priority (ARP) */
5928 {GTPV2_IE_EPC_TIMER, dissect_gtpv2_epc_timer}, /* 156, 8.87 EPC Timer */
5929 {GTPV2_IE_SIG_PRIO_IND, dissect_gtpv2_sig_prio_ind}, /* 157, 8.88 Signalling Priority Indication */
5930 {GTPV2_IE_TMGI, dissect_gtpv2_tmgi}, /* 158, 8.89 Temporary Mobile Group Identity (TMGI) */
5931 {GTPV2_IE_ADD_MM_CONT_FOR_SRVCC, dissect_gtpv2_add_mm_cont_for_srvcc}, /* 159, 8.90 Additional MM context for SRVCC */
5932 {GTPV2_IE_ADD_FLAGS_FOR_SRVCC, dissect_gtpv2_add_flags_for_srvcc}, /* 160, 8.91 Additional flags for SRVCC */
5933 {GTPV2_IE_MMBR, dissect_gtpv2_mmbr}, /* 161, 8.92 Max MBR/APN-AMBR (MMBR) */
5934 {GTPV2_IE_MDT_CONFIG, dissect_gtpv2_mdt_config}, /* 162, 8.93 MDT Configuration */
5935 {GTPV2_IE_APCO, dissect_gtpv2_apco}, /* 163, 8.94 Additional Protocol Configuration Options (APCO) */
5936 {GTPV2_IE_ABS_MBMS_DATA_TF_TIME, dissect_gtpv2_abs_mbms_data_tf_time}, /* 164, 8.95 Absolute Time of MBMS Data Transfer */
5937 {GTPV2_IE_HENB_INFO_REPORT, dissect_gtpv2_henb_info_report}, /* 165, 8.96 H(e)NB Information Reporting */
5938 {GTPV2_IE_IP4CP, dissect_gtpv2_ip4cp}, /* 166, 8.97 IPv4 Configuration Parameters (IPv4CP) */
5939 {GTPV2_IE_CHANGE_TO_REPORT_FLAGS, dissect_gtpv2_change_report_flags}, /* 167, 8.98 Change to Report Flags */
5940 {GTPV2_IE_ACTION_INDICATION, dissect_gtpv2_action_indication}, /* 168, 8.99 Action Indication */
5941 {GTPV2_IE_TWAN_IDENTIFIER, dissect_gtpv2_twan_Identifier}, /* 169, 8.100 TWAN Identifier */
5942 {GTPV2_IE_ULI_TIMESTAMP, dissect_gtpv2_uli_timestamp}, /* 170, 8.101 ULI Timestamp */
5943 {GTPV2_IE_MBMS_FLAGS, dissect_gtpv2_mbms_flags}, /* 171, 8.102 MBMS Flags */
5944 {GTPV2_IE_RAN_NAS_CAUSE, dissect_gtpv2_ran_nas_cause}, /* 172, 8.103 RAN/NAS Cause */
5945 {GTPV2_IE_CN_OP_SEL_ENT, dissect_gtpv2_cn_operator_selection_entity}, /* 173, 8.104 CN Operator Selection Entity */
5946 {GTPV2_IE_TRUST_WLAN_MODE_IND, dissect_gtpv2_trust_wlan_mode_ind}, /* 174, 8.105 Trusted WLAN Mode Indication */
5947 {GTPV2_IE_NODE_NUMBER, dissect_gtpv2_node_number}, /* 175, 8.106 Node Number */
5948 {GTPV2_IE_NODE_IDENTIFIER, dissect_gtpv2_node_identifier}, /* 176, 8.107 Node Identifier */
5949 {GTPV2_IE_PRES_REP_AREA_ACT, dissect_gtpv2_pres_rep_area_action}, /* 177, 8.108 Presence Reporting Area Action */
5950 {GTPV2_IE_PRES_REP_AREA_INF, dissect_gtpv2_pres_rep_area_information}, /* 178, 8.109 Presence Reporting Area Information */
5951 {GTPV2_IE_TWAN_ID_TS, dissect_gtpv2_twan_identifier_timestamp}, /* 179, 8.110 TWAN Identifier Timestamp */
5952 {GTPV2_IE_OVERLOAD_CONTROL_INF, dissect_gtpv2_overload_control_inf}, /* 180, 8.111 Overload Control Information */
5953 {GTPV2_IE_LOAD_CONTROL_INF, dissect_gtpv2_load_control_inf}, /* 181, 8.112 Load Control Information */
5954 {GTPV2_IE_METRIC, dissect_gtpv2_metric}, /* 182, 8.113 Metric */
5955 {GTPV2_IE_SEQ_NO, dissect_gtpv2_seq_no}, /* 183, 8.114 Sequence Number */
5956 {GTPV2_IE_APN_AND_REL_CAP, dissect_gtpv2_apn_and_relative_capacity}, /* 184, 8.115 APN and Relative Capacity */
5958 {GTPV2_IE_PRIVATE_EXT, dissect_gtpv2_private_ext},
5960 {0, dissect_gtpv2_unknown}
5964 dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint offset, guint8 message_type)
5966 proto_tree *ie_tree;
5969 guint8 type, instance;
5973 * Octets 8 7 6 5 4 3 2 1
5976 * 4 CR Spare Instance
5977 * 5-(n+4) IE specific data
5979 while (offset < (gint)tvb_reported_length(tvb)) {
5980 /* Get the type and length */
5982 type = tvb_get_guint8(tvb, offset);
5983 length = tvb_get_ntohs(tvb, offset + 1);
5984 ie_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4 + length, ett_gtpv2_ie, &ti, "%s : ",
5985 val_to_str_ext_const(type, >pv2_element_type_vals_ext, "Unknown"));
5988 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
5992 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
5994 /* CR Spare Instance Octet 4*/
5995 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, ENC_BIG_ENDIAN);
5997 instance = tvb_get_guint8(tvb, offset) & 0x0f;
5998 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
6001 /* TODO: call IE dissector here */
6002 if (type == GTPV2_IE_RESERVED) {
6003 /* Treat IE type zero specal as type zero is used to end the loop in the else branch */
6004 expert_add_info(pinfo, ti, &ei_gtpv2_ie);
6007 /* Loop over the IE dissector list to se if we find an entry;
6008 the last entry will have ie_type=0 breaking the loop */
6009 while (gtpv2_ies[++i].ie_type) {
6010 if (gtpv2_ies[i].ie_type == type)
6013 /* Just give the IE dissector the IE */
6014 ie_tvb = tvb_new_subset_remaining(tvb, offset);
6015 (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, message_type, instance);
6023 dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
6025 proto_tree *gtpv2_tree, *flags_tree;
6027 guint8 message_type, t_flag, p_flag;
6033 /* Currently we get called from the GTP dissector no need to check the version */
6034 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
6035 col_clear(pinfo->cinfo, COL_INFO);
6037 /* message type is in octet 2 */
6038 message_type = tvb_get_guint8(tvb, 1);
6039 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
6042 p_flag = (tvb_get_guint8(tvb, offset) & 0x10) >> 4;
6043 msg_length = tvb_get_ntohs(tvb, offset + 2);
6044 proto_tree_add_item(tree, proto_gtpv2, tvb, offset, msg_length + 4, ENC_NA);
6047 gtpv2_tree = proto_tree_add_subtree(tree, tvb, offset, msg_length + 4, ett_gtpv2, NULL,
6048 val_to_str_ext_const(message_type, >pv2_message_type_vals_ext, "Unknown"));
6050 /* Control Plane GTP uses a variable length header. Control Plane GTP header
6051 * length shall be a multiple of 4 octets.
6052 * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
6053 * Bits 8 7 6 5 4 3 2 1
6054 * Octets 1 Version P T Spare Spare Spare
6056 * 3 Message Length (1st Octet)
6057 * 4 Message Length (2nd Octet)
6058 * m-k(m+3) If T flag is set to 1, then TEID shall be placed into octets 5-8.
6059 * Otherwise, TEID field is not present at all.
6060 * n-(n+2) Sequence Number
6062 * Figure 5.1-1: General format of GTPv2 Header for Control Plane
6064 tf = proto_tree_add_item(gtpv2_tree, hf_gtpv2_flags, tvb, offset, 1, ENC_BIG_ENDIAN);
6065 flags_tree = proto_item_add_subtree(tf, ett_gtpv2_flags);
6068 t_flag = (tvb_get_guint8(tvb, offset) & 0x08) >> 3;
6069 proto_tree_add_item(flags_tree, hf_gtpv2_version, tvb, offset, 1, ENC_BIG_ENDIAN);
6070 proto_tree_add_item(flags_tree, hf_gtpv2_p, tvb, offset, 1, ENC_BIG_ENDIAN);
6071 proto_tree_add_item(flags_tree, hf_gtpv2_t, tvb, offset, 1, ENC_BIG_ENDIAN);
6075 proto_tree_add_item(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6078 proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6082 /* Tunnel Endpoint Identifier 4 octets */
6083 proto_tree_add_item(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
6086 /* Sequence Number 3 octets */
6087 proto_tree_add_item(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 3, ENC_BIG_ENDIAN);
6091 proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
6095 msg_tvb = tvb_new_subset_length(tvb, 0, msg_length + 4);
6096 dissect_gtpv2_ie_common(msg_tvb, pinfo, gtpv2_tree, offset, message_type);
6098 dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset, message_type);
6101 /* Bit 5 represents a "P" flag. If the "P" flag is set to "0",
6102 * no piggybacked message shall be present. If the "P" flag is set to "1",
6103 * then another GTPv2-C message with its own header and body shall be present
6104 * at the end of the current message.
6107 tvbuff_t *new_p_tvb;
6108 /* Octets 3 to 4 represent the Length field. This field shall indicate the
6109 * length of the message in octets excluding the
6110 * mandatory part of the GTP-C header (the first 4 octets).
6112 new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
6113 col_append_str(pinfo->cinfo, COL_INFO, " / ");
6114 col_set_fence(pinfo->cinfo, COL_INFO);
6115 dissect_gtpv2(new_p_tvb, pinfo, tree);
6121 void proto_register_gtpv2(void)
6123 static hf_register_info hf_gtpv2[] = {
6124 { &hf_gtpv2_spare_half_octet,
6125 {"Spare half octet", "gtpv2.spare_half_octet",
6126 FT_UINT8, BASE_DEC, NULL, 0x0,
6129 { &hf_gtpv2_spare_bits,
6130 {"Spare bit(s)", "gtpv2.spare_bits",
6131 FT_UINT8, BASE_DEC, NULL, 0x0,
6135 {"Flags", "gtpv2.flags",
6136 FT_UINT8, BASE_HEX, NULL, 0x0,
6140 {"Version", "gtpv2.version",
6141 FT_UINT8, BASE_DEC, NULL, 0xe0,
6145 {"Piggybacking flag (P)", "gtpv2.p",
6146 FT_UINT8, BASE_DEC, NULL, 0x10,
6147 "If Piggybacked message is present or not", HFILL}
6150 {"TEID flag (T)", "gtpv2.t",
6151 FT_UINT8, BASE_DEC, NULL, 0x08,
6152 "If TEID field is present or not", HFILL}
6154 { &hf_gtpv2_message_type,
6155 {"Message Type", "gtpv2.message_type",
6156 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_message_type_vals_ext, 0x0,
6159 { &hf_gtpv2_msg_length,
6160 {"Message Length", "gtpv2.msg_lengt",
6161 FT_UINT16, BASE_DEC, NULL, 0x0,
6165 {"Tunnel Endpoint Identifier", "gtpv2.teid",
6166 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
6170 {"Sequence Number", "gtpv2.seq",
6171 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
6175 {"Spare", "gtpv2.spare",
6176 FT_UINT16, BASE_DEC, NULL, 0x0,
6180 {"IE Type", "gtpv2.ie_type",
6181 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
6185 {"IE Length", "gtpv2.ie_len",
6186 FT_UINT16, BASE_DEC, NULL, 0x0,
6187 "length of the information element excluding the first four octets", HFILL}
6190 {"CR flag", "gtpv2.cr",
6191 FT_UINT8, BASE_DEC, NULL, 0xf0, /* SRVCC */
6194 { &hf_gtpv2_instance,
6195 {"Instance", "gtpv2.instance",
6196 FT_UINT8, BASE_DEC, NULL, 0x0f,
6199 { &hf_gtpv2_ipv4_addr,
6200 {"IPv4 Address", "gtpv2.ipv4_addr",
6201 FT_IPv4, BASE_NONE, NULL, 0x0,
6205 {"Cause", "gtpv2.cause",
6206 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_vals_ext, 0x0,
6209 {&hf_gtpv2_cause_cs,
6210 {"CS (Cause Source)", "gtpv2.cs",
6211 FT_BOOLEAN, 8, TFS(>pv2_cause_cs), 0x01,
6214 { &hf_gtpv2_cause_bce,
6215 {"BCE (Bearer Context IE Error)", "gtpv2.bce",
6216 FT_BOOLEAN, 8, NULL, 0x02,
6219 { &hf_gtpv2_cause_pce,
6220 {"PCE (PDN Connection IE Error)", "gtpv2.pce",
6221 FT_BOOLEAN, 8, NULL, 0x04,
6224 { &hf_gtpv2_cause_off_ie_t,
6225 {"Type of the offending IE", "gtpv2.cause_off_ie_t",
6226 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_element_type_vals_ext, 0x0,
6230 {"Restart Counter", "gtpv2.rec",
6231 FT_UINT8, BASE_DEC, NULL, 0x0,
6234 /*Start SRVCC Messages*/
6236 {"STN-SR", "gtpv2.stn_sr",
6237 FT_BYTES, BASE_NONE, NULL, 0x0,
6240 { &hf_gtpv2_len_trans_con,
6241 {"Length of the Transparent Container", "gtpv2.len_trans_con",
6242 FT_UINT8, BASE_DEC, NULL, 0x0,
6246 {"eKSI", "gtpv2.eksi",
6247 FT_UINT8, BASE_DEC, NULL, 0x07,
6252 FT_BYTES, BASE_NONE, NULL, 0x0,
6257 FT_BYTES, BASE_NONE, NULL, 0x0,
6260 { &hf_gtpv2_len_ms_classmark2,
6261 {"Length of Mobile Station Classmark2", "gtpv2.len_ms_classmark2",
6262 FT_UINT8, BASE_DEC, NULL, 0x0,
6265 { &hf_gtpv2_len_ms_classmark3,
6266 {"Length of Mobile Station Classmark3", "gtpv2.len_ms_classmark3",
6267 FT_UINT8, BASE_DEC, NULL, 0x0,
6270 { &hf_gtpv2_len_supp_codec_list,
6271 {"Length of Supported Codec List", "gtpv2.len_supp_codec_list",
6272 FT_UINT8, BASE_DEC, NULL, 0x0,
6276 {"KSI'cs", "gtpv2.ksi",
6277 FT_UINT8, BASE_DEC, NULL, 0x0F,
6281 {"CKSN'", "gtpv2.cksn",
6282 FT_UINT8, BASE_DEC, NULL, 0x0,
6285 { &hf_gtpv2_srvcc_cause,
6286 {"SRVCC Cause", "gtpv2.srvcc_cause",
6287 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_srvcc_cause_vals_ext, 0x0,
6291 { "Routing Area Code (RAC)", "gtpv2.rac",
6292 FT_UINT8, BASE_DEC, NULL, 0,
6293 "Routing Area Code", HFILL}
6297 {"RNC ID", "gtpv2.rnc_id",
6298 FT_UINT16, BASE_DEC, NULL, 0x0,
6301 { &hf_gtpv2_ext_rnc_id,
6302 {"Extended RNC-ID", "gtpv2.ext_rnc_id",
6303 FT_UINT16, BASE_DEC, NULL, 0x0,
6307 { "Location Area Code (LAC)", "gtpv2.lac",
6308 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
6312 { "Service Area Code (SAC)", "gtpv2.sac",
6313 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
6316 { &hf_gtpv2_tgt_g_cell_id,
6317 {"Cell ID", "gtpv2.tgt_g_cell_id",
6318 FT_UINT16, BASE_DEC, NULL, 0x0,
6322 {"Tunnel Endpoint Identifier for Control Plane(TEID-C)", "gtpv2.teid_c",
6323 FT_UINT32, BASE_DEC, NULL, 0x0,
6327 {"STI (Session Transfer Indicator)", "gtpv2.sv_sti",
6328 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
6331 {"ICS (IMS Centralized Service)", "gtpv2.sv_ics",
6332 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
6334 {&hf_gtpv2_sv_emind,
6335 {"EmInd(Emergency Indicator)", "gtpv2.sv_emind",
6336 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
6339 /*End SRVCC Messages*/
6341 {"APN (Access Point Name)", "gtpv2.apn",
6342 FT_STRING, BASE_NONE, NULL, 0x0,
6346 {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
6347 FT_UINT32, BASE_DEC, NULL, 0x0,
6350 {&hf_gtpv2_ambr_down,
6351 {"AMBR Downlink(Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
6352 FT_UINT32, BASE_DEC, NULL, 0x0,
6356 {"EPS Bearer ID (EBI)", "gtpv2.ebi",
6357 FT_UINT8, BASE_DEC, NULL, 0x0f,
6360 { &hf_gtpv2_ip_address_ipv4,
6361 {"IP address IPv4", "gtpv2.ip_address_ipv4",
6362 FT_IPv4, BASE_NONE, NULL, 0x0,
6365 { &hf_gtpv2_ip_address_ipv6,
6366 {"IP address IPv6", "gtpv2.ip_address_ipv6",
6367 FT_IPv6, BASE_NONE, NULL, 0x0,
6371 {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
6372 FT_STRING, BASE_NONE, NULL, 0,
6375 { &hf_gtpv2_pdn_numbers_nsapi,
6376 {"NSAPI", "gtpv2.pdn_numbers_nsapi",
6377 FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}
6380 {"Packet TMSI (P-TMSI)", "gtpv2.p_tmsi",
6381 FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL}
6383 { &hf_gtpv2_p_tmsi_sig,
6384 {"P-TMSI Signature", "gtpv2.p_tmsi_sig",
6385 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
6388 {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
6389 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6392 {"DTF (Direct Tunnel Flag)", "gtpv2.dtf",
6393 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
6396 {"HI (Handover Indication)", "gtpv2.hi",
6397 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
6400 {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
6401 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
6404 {"OI (Operation Indication)", "gtpv2.oi",
6405 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
6408 {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
6409 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
6412 {"ISRAI (Idle mode Signalling Reduction Activation Indication)", "gtpv2.israi",
6413 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
6416 {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
6417 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
6420 {"SQCI (Subscribed QoS Change Indication", "gtpv2.sqci",
6421 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6424 {"UIMSI (Unauthenticated IMSI)", "gtpv2.uimsi",
6425 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
6428 {"CFSI (Change F-TEID support indication)", "gtpv2.cfsi",
6429 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
6432 {"CRSI (Change Reporting support indication):", "gtpv2.crsi",
6433 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
6436 {"PS (Piggybacking Supported).)", "gtpv2.ps",
6437 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
6440 {"PT (Protocol Type)", "gtpv2.pt",
6441 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
6444 {"SI (Scope Indication)", "gtpv2.si",
6445 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
6448 {"MSV (MS Validated)", "gtpv2.msv",
6449 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
6452 {"RetLoc (Retrieve Location Indication Flag)", "gtpv2.retloc",
6453 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6456 {"PBIC (Propagate BBAI Information Change)", "gtpv2.pbic",
6457 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
6460 {"SRNI (SGW Restoration Needed Indication)", "gtpv2.snri",
6461 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
6464 {"S6AF (Static IPv6 Address Flag)", "gtpv2.s6af",
6465 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
6468 {"S4AF (Static IPv4 Address Flag))", "gtpv2.s4af",
6469 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
6472 {"MBMDT (Management Based MDT allowed flag)", "gtpv2.mbmdt",
6473 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
6476 {"ISRAU (ISR is activated for the UE)", "gtpv2.israu",
6477 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
6480 {"CCRSI (CSG Change Reporting support indication)", "gtpv2.ccrsi",
6481 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
6485 {"CPRAI (Change of Presence Reporting Area information Indication)", "gtpv2.cprai",
6486 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
6489 {"ARRL (Abnormal Release of Radio Link)", "gtpv2.arrl",
6490 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
6493 {"PPOFF (PDN Pause Off Indication)", "gtpv2.ppof",
6494 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
6496 {&hf_gtpv2_ppon_ppei,
6497 {"PPON (PDN Pause On Indication) / PPEI (PDN Pause Enabled Indication)", "gtpv2.ppon_ppei",
6498 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
6501 {"PPSI (PDN Pause Support Indication)", "gtpv2.ppsi",
6502 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
6505 {"CSFBI (CSFB Indication)", "gtpv2.csfbi",
6506 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
6509 {"CLII (Change of Location Information Indication):", "gtpv2.clii",
6510 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
6513 {"CPSR (CS to PS SRVCC indication)", "gtpv2.cpsr",
6514 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
6517 {"PCRI (P-CSCF Restoration Indication)", "gtpv2.pcri",
6518 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
6521 {"AOSI (Associate OCI with SGW node's Identity)", "gtpv2.aosi",
6522 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
6525 {"AOPI (Associate OCI with PGW node's Identity)", "gtpv2.aopi",
6526 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
6528 { &hf_gtpv2_pdn_type,
6529 {"PDN Type", "gtpv2.pdn_type",
6530 FT_UINT8, BASE_DEC, VALS(gtpv2_pdn_type_vals), 0x07,
6534 { &hf_gtpv2_tra_info,
6535 {"Trace ID", "gtpv2.tra_info",
6536 FT_STRING, BASE_NONE, NULL, 0x0,
6540 { &hf_gtpv2_tra_info_msc_momt_calls,
6541 {"MO and MT calls", "gtpv2.tra_info_msc_momt_calls",
6542 FT_UINT8, BASE_DEC, NULL, 0x01,
6543 "MSC Server", HFILL}
6545 { &hf_gtpv2_tra_info_msc_momt_sms,
6546 {"MO and MT SMS", "gtpv2.tra_info_msc_momt_sms",
6547 FT_UINT8, BASE_DEC, NULL, 0x02,
6548 "MSC Server", HFILL}
6550 { &hf_gtpv2_tra_info_msc_lu_imsi_ad,
6551 {"LU, IMSI attach, IMSI detach", "gtpv2.tra_info_msc_lu_imsi_ad",
6552 FT_UINT8, BASE_DEC, NULL, 0x04,
6553 "MSC Server", HFILL}
6555 { &hf_gtpv2_tra_info_msc_handovers,
6556 {"Handovers", "gtpv2.tra_info_msc_handovers",
6557 FT_UINT8, BASE_DEC, NULL, 0x08,
6558 "MSC Server", HFILL}
6560 { &hf_gtpv2_tra_info_msc_ss,
6561 {"SS", "gtpv2.tra_info_msc_ss",
6562 FT_UINT8, BASE_DEC, NULL, 0x10,
6563 "MSC Server", HFILL}
6565 { &hf_gtpv2_tra_info_mgw_context,
6566 {"Context", "gtpv2.tra_info_mgw_context",
6567 FT_UINT8, BASE_DEC, NULL, 0x01,
6570 { &hf_gtpv2_tra_info_sgsn_pdp_context,
6571 {"PDP context", "gtpv2.tra_info_sgsn_pdp_context",
6572 FT_UINT8, BASE_DEC, NULL, 0x01,
6575 { &hf_gtpv2_tra_info_sgsn_momt_sms,
6576 {"MO and MT SMS", "gtpv2.tra_info_sgsn_momt_sms",
6577 FT_UINT8, BASE_DEC, NULL, 0x02,
6580 { &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
6581 {"RAU, GPRS attach, GPRS detach", "gtpv2.tra_info_sgsn_rau_gprs_ad",
6582 FT_UINT8, BASE_DEC, NULL, 0x04,
6585 { &hf_gtpv2_tra_info_sgsn_mbms,
6586 {"MBMS Context", "gtpv2.tra_into_sgsn_mbms",
6587 FT_UINT8, BASE_DEC, NULL, 0x08,
6590 { &hf_gtpv2_tra_info_sgsn_reserved,
6591 {"Reserved", "gtpv2.",
6592 FT_UINT8, BASE_DEC, NULL, 0x0,
6595 { &hf_gtpv2_tra_info_ggsn_pdp,
6596 {"PDP Cpntext", "gtpv2.tra_info_ggsn_pdp",
6597 FT_UINT8, BASE_DEC, NULL, 0x01,
6600 { &hf_gtpv2_tra_info_ggsn_mbms,
6601 {"MBMS Context", "gtpv2.tra_info_ggsn_mbms",
6602 FT_UINT8, BASE_DEC, NULL, 0x02,
6605 { &hf_gtpv2_tra_info_bm_sc,
6606 {"MBMS Multicast service activation", "gtpv2.tra_info_bm_sc",
6607 FT_UINT8, BASE_DEC, NULL, 0x01,
6610 { &hf_gtpv2_tra_info_mme_sgw_ss,
6611 {"Session setup", "gtpv2.tra_info_mme_sgw_ss",
6612 FT_UINT8, BASE_DEC, NULL, 0x01,
6615 { &hf_gtpv2_tra_info_mme_sgw_sr,
6616 {"Service Request", "gtpv2.tra_info_mme_sgw_sr",
6617 FT_UINT8, BASE_DEC, NULL, 0x02,
6620 { &hf_gtpv2_tra_info_mme_sgw_iataud,
6621 {"Initial Attach, Tracking area update, Detach", "gtpv2.tra_info_mme_sgw_iataud",
6622 FT_UINT8, BASE_DEC, NULL, 0x04,
6625 { &hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc,
6626 {"UE initiated PDN disconnection", "gtpv2.tra_info_mme_sgw_ue_init_pdn_disc",
6627 FT_UINT8, BASE_DEC, NULL, 0x08,
6630 { &hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del,
6631 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_mme_sgw_bearer_act_mod_del",
6632 FT_UINT8, BASE_DEC, NULL, 0x10,
6635 { &hf_gtpv2_tra_info_mme_sgw_ho,
6636 {"Handover", "gtpv2.tra_info_mme_sgw_ho",
6637 FT_UINT8, BASE_DEC, NULL, 0x20,
6640 { &hf_gtpv2_tra_info_sgw_pdn_con_creat,
6641 {"PDN Connection creation", "gtpv2.tra_info_sgw_pdn_con_creat",
6642 FT_UINT8, BASE_DEC, NULL, 0x01,
6645 { &hf_gtpv2_tra_info_sgw_pdn_con_term,
6646 {"PDN connection termination", "gtpv2.tra_info_sgw_pdn_con_term",
6647 FT_UINT8, BASE_DEC, NULL, 0x02,
6650 { &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
6651 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_sgw_bearer_act_mod_del",
6652 FT_UINT8, BASE_DEC, NULL, 0x04,
6655 { &hf_gtpv2_tra_info_pgw_pdn_con_creat,
6656 {"PDN Connection creation", "gtpv2.tra_info_pgw_pdn_con_creat",
6657 FT_UINT8, BASE_DEC, NULL, 0x10,
6660 { &hf_gtpv2_tra_info_pgw_pdn_con_term,
6661 {"PDN connection termination", "gtpv2.tra_info_pgw_pdn_con_term",
6662 FT_UINT8, BASE_DEC, NULL, 0x20,
6665 { &hf_gtpv2_tra_info_pgw_bearer_act_mod_del,
6666 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_pgw_bearer_act_mod_del",
6667 FT_UINT8, BASE_DEC, NULL, 0x40,
6670 { &hf_gtpv2_tra_info_lne_msc_s,
6671 {"MSC-S", "gtpv2.tra_info_lne_msc_s",
6672 FT_UINT8, BASE_DEC, NULL, 0x01,
6673 "List of NE Types", HFILL}
6675 { &hf_gtpv2_tra_info_lne_mgw,
6676 {"MGW", "gtpv2.tra_info_lne_mgw",
6677 FT_UINT8, BASE_DEC, NULL, 0x02,
6678 "List of NE Types", HFILL}
6680 { &hf_gtpv2_tra_info_lne_sgsn,
6681 {"SGSN", "gtpv2.tra_info_lne_sgsn",
6682 FT_UINT8, BASE_DEC, NULL, 0x04,
6683 "List of NE Types", HFILL}
6685 { &hf_gtpv2_tra_info_lne_ggsn,
6686 {"GGSN", "gtpv2.tra_info_lne_ggsn",
6687 FT_UINT8, BASE_DEC, NULL, 0x08,
6688 "List of NE Types", HFILL}
6690 { &hf_gtpv2_tra_info_lne_rnc,
6691 {"RNC", "gtpv2.tra_info_lne_rnc",
6692 FT_UINT8, BASE_DEC, NULL, 0x10,
6693 "List of NE Types", HFILL}
6695 { &hf_gtpv2_tra_info_lne_bm_sc,
6696 {"BM-SC", "gtpv2.tra_info_lne_bm_sc",
6697 FT_UINT8, BASE_DEC, NULL, 0x20,
6698 "List of NE Types", HFILL}
6700 { &hf_gtpv2_tra_info_lne_mme,
6701 {"MME", "gtpv2.tra_info_lne_mme",
6702 FT_UINT8, BASE_DEC, NULL, 0x40,
6703 "List of NE Types", HFILL}
6705 { &hf_gtpv2_tra_info_lne_sgw,
6706 {"SGW", "gtpv2.tra_info_lne_sgw",
6707 FT_UINT8, BASE_DEC, NULL, 0x80,
6708 "List of NE Types", HFILL}
6710 { &hf_gtpv2_tra_info_lne_pdn_gw,
6711 {"PDN GW", "gtpv2.tra_info_lne_pdn_gw",
6712 FT_UINT8, BASE_DEC, NULL, 0x01,
6713 "List of NE Types", HFILL}
6715 { &hf_gtpv2_tra_info_lne_enb,
6716 {"eNB", "gtpv2.tra_info_lne_enb",
6717 FT_UINT8, BASE_DEC, NULL, 0x02,
6718 "List of NE Types", HFILL}
6720 { &hf_gtpv2_tra_info_tdl,
6721 {"Trace Depth Length", "gtpv2.tra_info_tdl",
6722 FT_UINT8, BASE_DEC, NULL, 0x0,
6725 { &hf_gtpv2_tra_info_lmsc_a,
6726 {"A", "gtpv2.tra_info_lmsc_a",
6727 FT_UINT8, BASE_DEC, NULL, 0x01,
6728 "MSC Server", HFILL}
6730 { &hf_gtpv2_tra_info_lmsc_lu,
6731 {"Iu", "gtpv2.tra_info_lmsc_lu",
6732 FT_UINT8, BASE_DEC, NULL, 0x02,
6733 "MSC Server", HFILL}
6735 { &hf_gtpv2_tra_info_lmsc_mc,
6736 {"Mc", "gtpv2.tra_info_lmsc_mc",
6737 FT_UINT8, BASE_DEC, NULL, 0x04,
6738 "MSC Server", HFILL}
6740 { &hf_gtpv2_tra_info_lmsc_map_g,
6741 {"MAP-G", "gtpv2.tra_info_lmsc_map_g",
6742 FT_UINT8, BASE_DEC, NULL, 0x08,
6743 "MSC Server", HFILL}
6745 { &hf_gtpv2_tra_info_lmsc_map_b,
6746 {"MAP-B", "gtpv2.tra_info_lmsc_map_b",
6747 FT_UINT8, BASE_DEC, NULL, 0x10,
6748 "MSC Server", HFILL}
6750 { &hf_gtpv2_tra_info_lmsc_map_e,
6751 {"MAP-E", "gtpv2.tra_info_lmsc_map_e",
6752 FT_UINT8, BASE_DEC, NULL, 0x20,
6753 "MSC Server", HFILL}
6755 { &hf_gtpv2_tra_info_lmsc_map_f,
6756 {"MAP-F", "gtpv2.tra_info_lmsc_map_f",
6757 FT_UINT8, BASE_DEC, NULL, 0x40,
6758 "MSC Server", HFILL}
6760 { &hf_gtpv2_tra_info_lmsc_cap,
6761 {"CAP", "gtpv2.tra_info_lmsc_cap",
6762 FT_UINT8, BASE_DEC, NULL, 0x80,
6763 "MSC Server", HFILL}
6765 { &hf_gtpv2_tra_info_lmsc_map_d,
6766 {"MAP-D", "gtpv2.tra_info_lmsc_map_d",
6767 FT_UINT8, BASE_DEC, NULL, 0x01,
6768 "MSC Server", HFILL}
6770 { &hf_gtpv2_tra_info_lmsc_map_c,
6771 {"MAP-C", "gtpv2.tra_info_lmsc_map_c",
6772 FT_UINT8, BASE_DEC, NULL, 0x02,
6773 "MSC Server", HFILL}
6775 { &hf_gtpv2_tra_info_lmgw_mc,
6776 {"Mc", "gtpv2.tra_info_lmgw_mc",
6777 FT_UINT8, BASE_DEC, NULL, 0x01,
6780 { &hf_gtpv2_tra_info_lmgw_nb_up,
6781 {"Nb-UP", "gtpv2.tra_info_lmgw_nb_up",
6782 FT_UINT8, BASE_DEC, NULL, 0x2,
6785 { &hf_gtpv2_tra_info_lmgw_lu_up,
6786 {"Iu-UP", "gtpv2.tra_info_lmgw_lu_up",
6787 FT_UINT8, BASE_DEC, NULL, 0x04,
6790 { &hf_gtpv2_tra_info_lsgsn_gb,
6791 {"Gb", "gtpv2.tra_info_lsgsn_gb",
6792 FT_UINT8, BASE_DEC, NULL, 0x01,
6795 { &hf_gtpv2_tra_info_lsgsn_lu,
6796 {"Iu", "gtpv2.tra_info_lsgsn_lu",
6797 FT_UINT8, BASE_DEC, NULL, 0x02,
6800 { &hf_gtpv2_tra_info_lsgsn_gn,
6801 {"Gn", "gtpv2.tra_info_lsgsn_gn",
6802 FT_UINT8, BASE_DEC, NULL, 0x04,
6805 { &hf_gtpv2_tra_info_lsgsn_map_gr,
6806 {"MAP-Gr", "gtpv2.tra_info_lsgsn_map_gr",
6807 FT_UINT8, BASE_DEC, NULL, 0x08,
6810 { &hf_gtpv2_tra_info_lsgsn_map_gd,
6811 {"MAP-Gd", "gtpv2.tra_info_lsgsn_map_gd",
6812 FT_UINT8, BASE_DEC, NULL, 0x10,
6815 { &hf_gtpv2_tra_info_lsgsn_map_gf,
6816 {"MAP-Gf", "gtpv2.tra_info_lsgsn_map_gf",
6817 FT_UINT8, BASE_DEC, NULL, 0x20,
6820 { &hf_gtpv2_tra_info_lsgsn_gs,
6821 {"Gs", "gtpv2.tra_info_lsgsn_gs",
6822 FT_UINT8, BASE_DEC, NULL, 0x40,
6825 { &hf_gtpv2_tra_info_lsgsn_ge,
6826 {"Ge", "gtpv2.tra_info_lsgsn_ge",
6827 FT_UINT8, BASE_DEC, NULL, 0x80,
6830 { &hf_gtpv2_tra_info_lggsn_gn,
6831 {"Gn", "gtpv2.tra_info_lggsn_gn",
6832 FT_UINT8, BASE_DEC, NULL, 0x01,
6835 { &hf_gtpv2_tra_info_lggsn_gi,
6836 {"Gi", "gtpv2.tra_info_lggsn_gi",
6837 FT_UINT8, BASE_DEC, NULL, 0x02,
6840 { &hf_gtpv2_tra_info_lggsn_gmb,
6841 {"Gmb", "gtpv2.tra_info_lggsn_gmb",
6842 FT_UINT8, BASE_DEC, NULL, 0x04,
6845 { &hf_gtpv2_tra_info_lrnc_lu,
6846 {"Iu", "gtpv2.tra_info_lrnc_lu",
6847 FT_UINT8, BASE_DEC, NULL, 0x01,
6850 { &hf_gtpv2_tra_info_lrnc_lur,
6851 {"Iur", "gtpv2.tra_info_lrnc_lur",
6852 FT_UINT8, BASE_DEC, NULL, 0x02,
6855 { &hf_gtpv2_tra_info_lrnc_lub,
6856 {"Iub", "gtpv2.tra_info_lrnc_lub",
6857 FT_UINT8, BASE_DEC, NULL, 0x04,
6860 { &hf_gtpv2_tra_info_lrnc_uu,
6861 {"Uu", "gtpv2.tra_info_lrnc_uu",
6862 FT_UINT8, BASE_DEC, NULL, 0x08,
6865 { &hf_gtpv2_tra_info_lbm_sc_gmb,
6866 {"Gmb", "gtpv2.tra_info_lbm_sc_gmb",
6867 FT_UINT8, BASE_DEC, NULL, 0x01,
6870 { &hf_gtpv2_tra_info_lmme_s1_mme,
6871 {"S1-MME", "gtpv2.tra_info_lmme_s1_mme",
6872 FT_UINT8, BASE_DEC, NULL, 0x01,
6875 { &hf_gtpv2_tra_info_lmme_s3,
6876 {"S3", "gtpv2.tra_info_lmme_s3",
6877 FT_UINT8, BASE_DEC, NULL, 0x02,
6880 { &hf_gtpv2_tra_info_lmme_s6a,
6881 {"S6a", "gtpv2.tra_info_lmme_s6a",
6882 FT_UINT8, BASE_DEC, NULL, 0x04,
6885 { &hf_gtpv2_tra_info_lmme_s10,
6886 {"S10", "gtpv2.tra_info_lmme_s10",
6887 FT_UINT8, BASE_DEC, NULL, 0x08,
6890 { &hf_gtpv2_tra_info_lmme_s11,
6891 {"S11", "gtpv2.tra_info_lmme_s11",
6892 FT_UINT8, BASE_DEC, NULL, 0x10,
6895 { &hf_gtpv2_tra_info_lsgw_s4,
6896 {"S4", "gtpv2.tra_info_lsgw_s4",
6897 FT_UINT8, BASE_DEC, NULL, 0x01,
6900 { &hf_gtpv2_tra_info_lsgw_s5,
6901 {"S5", "gtpv2.tra_info_lsgw_s5",
6902 FT_UINT8, BASE_DEC, NULL, 0x02,
6905 { &hf_gtpv2_tra_info_lsgw_s8b,
6906 {"S8b", "gtpv2.tra_info_lsgw_s8b",
6907 FT_UINT8, BASE_DEC, NULL, 0x04,
6910 { &hf_gtpv2_tra_info_lsgw_s11,
6911 {"S11", "gtpv2.tra_info_lsgw_s11",
6912 FT_UINT8, BASE_DEC, NULL, 0x08,
6915 { &hf_gtpv2_tra_info_lpdn_gw_s2a,
6916 {"S2a", "gtpv2.tra_info_lpdn_gw_s2a",
6917 FT_UINT8, BASE_DEC, NULL, 0x01,
6920 { &hf_gtpv2_tra_info_lpdn_gw_s2b,
6921 {"S2b", "gtpv2.tra_info_lpdn_gw_s2b",
6922 FT_UINT8, BASE_DEC, NULL, 0x02,
6925 { &hf_gtpv2_tra_info_lpdn_gw_s2c,
6926 {"S2c", "gtpv2.tra_info_lpdn_gw_s2c",
6927 FT_UINT8, BASE_DEC, NULL, 0x04,
6930 { &hf_gtpv2_tra_info_lpdn_gw_s5,
6931 {"S5", "gtpv2.tra_info_lpdn_gw_s5",
6932 FT_UINT8, BASE_DEC, NULL, 0x08,
6935 { &hf_gtpv2_tra_info_lpdn_gw_s6c,
6936 {"S6c", "gtpv2.tra_info_lpdn_gw_s6c",
6937 FT_UINT8, BASE_DEC, NULL, 0x10,
6940 { &hf_gtpv2_tra_info_lpdn_gw_gx,
6941 {"Gx", "gtpv2.tra_info_lpdn_gw_gx",
6942 FT_UINT8, BASE_DEC, NULL, 0x20,
6945 { &hf_gtpv2_tra_info_lpdn_gw_s8b,
6946 {"S8b", "gtpv2.tra_info_lpdn_gw_s8b",
6947 FT_UINT8, BASE_DEC, NULL, 0x40,
6950 { &hf_gtpv2_tra_info_lpdn_gw_sgi,
6951 {"SGi", "gtpv2.tra_info_lpdn_gw_sgi",
6952 FT_UINT8, BASE_DEC, NULL, 0x80,
6955 { &hf_gtpv2_tra_info_lenb_s1_mme,
6956 {"S1-MME", "gtpv2.tra_info_lenb_s1_mme",
6957 FT_UINT8, BASE_DEC, NULL, 0x01,
6960 { &hf_gtpv2_tra_info_lenb_x2,
6961 {"X2", "gtpv2.tra_info_lenb_x2",
6962 FT_UINT8, BASE_DEC, NULL, 0x02,
6965 { &hf_gtpv2_tra_info_lenb_uu,
6966 {"Uu", "gtpv2.tra_info_lenb_uu",
6967 FT_UINT8, BASE_DEC, NULL, 0x04,
6970 { &hf_gtpv2_pdn_ipv4,
6971 {"PDN Address and Prefix(IPv4)", "gtpv2.pdn_addr_and_prefix.ipv4",
6972 FT_IPv4, BASE_NONE, NULL, 0x0,
6975 { &hf_gtpv2_pdn_ipv6_len,
6976 {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
6977 FT_UINT8, BASE_DEC, NULL, 0x0,
6980 { &hf_gtpv2_pdn_ipv6,
6981 {"PDN Address and Prefix(IPv6)", "gtpv2.pdn_addr_and_prefix.ipv6",
6982 FT_BYTES, BASE_NONE, NULL, 0x0,
6985 /* Bit 1 - PVI (Pre-emption Vulnerability): See 3GPP TS 29.212[29],
6986 * clause 5.3.47 Pre-emption-Vulnerability AVP.
6987 * 5.3.47 Pre-emption-Vulnerability AVP
6988 * The following values are defined:
6989 * PRE-EMPTION_VULNERABILITY_ENABLED (0)
6990 * PRE-EMPTION_VULNERABILITY_DISABLED (1)
6992 {&hf_gtpv2_bearer_qos_pvi,
6993 {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
6994 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
6997 {&hf_gtpv2_bearer_qos_pl,
6998 {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
6999 FT_UINT8, BASE_DEC, NULL, 0x3c,
7002 /* Bit 7 - PCI (Pre-emption Capability): See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP.
7003 * clause 5.3.46 Pre-emption-Capability AVP.
7004 * 5.3.46 Pre-emption-Capability AVP
7005 * The following values are defined:
7006 * PRE-EMPTION_CAPABILITY_ENABLED (0)
7007 * PRE-EMPTION_CAPABILITY_DISABLED (1)
7009 {&hf_gtpv2_bearer_qos_pci,
7010 {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
7011 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
7014 {&hf_gtpv2_bearer_qos_label_qci,
7015 {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
7016 FT_UINT8, BASE_DEC, NULL, 0x0,
7019 {&hf_gtpv2_bearer_qos_mbr_up,
7020 {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
7021 FT_UINT64, BASE_DEC, NULL, 0x0,
7024 {&hf_gtpv2_bearer_qos_mbr_down,
7025 {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
7026 FT_UINT64, BASE_DEC, NULL, 0x0,
7029 {&hf_gtpv2_bearer_qos_gbr_up,
7030 {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
7031 FT_UINT64, BASE_DEC, NULL, 0x0,
7034 {&hf_gtpv2_bearer_qos_gbr_down,
7035 {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
7036 FT_UINT64, BASE_DEC, NULL, 0x0,
7039 {&hf_gtpv2_flow_qos_label_qci,
7040 {"Label (QCI)", "gtpv2.flow_qos_label_qci",
7041 FT_UINT8, BASE_DEC, NULL, 0x0,
7044 {&hf_gtpv2_flow_qos_mbr_up,
7045 {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
7046 FT_UINT64, BASE_DEC, NULL, 0x0,
7049 {&hf_gtpv2_flow_qos_mbr_down,
7050 {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
7051 FT_UINT64, BASE_DEC, NULL, 0x0,
7054 {&hf_gtpv2_flow_qos_gbr_up,
7055 {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
7056 FT_UINT64, BASE_DEC, NULL, 0x0,
7059 {&hf_gtpv2_flow_qos_gbr_down,
7060 {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
7061 FT_UINT64, BASE_DEC, NULL, 0x0,
7064 { &hf_gtpv2_rat_type,
7065 {"RAT Type", "gtpv2.rat_type",
7066 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_rat_type_vals_ext, 0x0,
7069 { &hf_gtpv2_uli_ecgi_flg,
7070 {"ECGI Present Flag", "gtpv2.uli_ecgi_flg",
7071 FT_BOOLEAN, 8, NULL, GTPv2_ULI_ECGI_MASK,
7074 { &hf_gtpv2_uli_lai_flg,
7075 {"LAI Present Flag", "gtpv2.uli_lai_flg",
7076 FT_BOOLEAN, 8, NULL, GTPv2_ULI_LAI_MASK,
7079 { &hf_gtpv2_uli_tai_flg,
7080 {"TAI Present Flag", "gtpv2.uli_tai_flg",
7081 FT_BOOLEAN, 8, NULL, GTPv2_ULI_TAI_MASK,
7084 { &hf_gtpv2_uli_rai_flg,
7085 {"RAI Present Flag", "gtpv2.uli_rai_flg",
7086 FT_BOOLEAN, 8, NULL, GTPv2_ULI_RAI_MASK,
7089 { &hf_gtpv2_uli_sai_flg,
7090 {"SAI Present Flag", "gtpv2.uli_sai_flg",
7091 FT_BOOLEAN, 8, NULL, GTPv2_ULI_SAI_MASK,
7094 { &hf_gtpv2_uli_cgi_flg,
7095 {"CGI Present Flag", "gtpv2.uli_cgi_flg",
7096 FT_BOOLEAN, 8, NULL, GTPv2_ULI_CGI_MASK,
7100 {"Geographic Location Type", "gtpv2.glt",
7101 FT_UINT8, BASE_DEC, VALS(geographic_location_type_vals), 0x0,
7104 { &hf_gtpv2_uli_cgi_lac,
7105 {"Location Area Code", "gtpv2.uli_cgi_lac",
7106 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
7109 { &hf_gtpv2_uli_cgi_ci,
7110 {"Cell Identity", "gtpv2.uli_cgi_ci",
7111 FT_UINT16, BASE_DEC, NULL, 0x0,
7114 { &hf_gtpv2_sai_lac,
7115 {"Location Area Code", "gtpv2.sai_lac",
7116 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
7119 { &hf_gtpv2_sai_sac,
7120 {"Service Area Code", "gtpv2.sai_sac",
7121 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
7124 { &hf_gtpv2_rai_lac,
7125 {"Location Area Code", "gtpv2.rai_lac",
7126 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
7129 { &hf_gtpv2_rai_rac,
7130 {"Routing Area Code", "gtpv2.rai_rac",
7131 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
7134 { &hf_gtpv2_tai_tac,
7135 {"Tracking Area Code", "gtpv2.tai_tac",
7136 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
7139 {&hf_gtpv2_ecgi_eci,
7140 {"ECI (E-UTRAN Cell Identifier)", "gtpv2.ecgi_eci",
7141 FT_UINT32, BASE_DEC, NULL, 0x0,
7144 {&hf_gtpv2_uli_lai_lac,
7145 {"Location Area Code (LAC)", "gtpv2.uli_lai_lac",
7146 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
7149 {&hf_gtpv2_ecgi_eci_spare,
7150 {"Spare", "gtpv2.uli_ecgi_eci_spare",
7151 FT_UINT8, BASE_DEC, NULL, 0x0,
7155 {"NSAPI", "gtpv2.nsapi",
7156 FT_UINT8, BASE_DEC, NULL, 0x0f,
7159 {&hf_gtpv2_f_teid_v4,
7160 {"V4", "gtpv2.f_teid_v4",
7161 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v4_vals), 0x80,
7164 {&hf_gtpv2_f_teid_v6,
7165 {"V6", "gtpv2.f_teid_v6",
7166 FT_BOOLEAN, 8, TFS(>pv2_f_teid_v6_vals), 0x40,
7169 {&hf_gtpv2_f_teid_interface_type,
7170 {"Interface Type", "gtpv2.f_teid_interface_type",
7171 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_f_teid_interface_type_vals_ext, 0x3f,
7174 {&hf_gtpv2_f_teid_gre_key,
7175 {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
7176 FT_UINT32, BASE_HEX, NULL, 0x0,
7179 { &hf_gtpv2_f_teid_ipv4,
7180 {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
7181 FT_IPv4, BASE_NONE, NULL, 0x0,
7184 { &hf_gtpv2_f_teid_ipv6,
7185 {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
7186 FT_IPv6, BASE_NONE, NULL, 0x0,
7190 {"TMSI", "gtpv2.tmsi",
7191 FT_UINT32, BASE_HEX, NULL, 0x0,
7194 { &hf_gtpv2_hsgw_addr_f_len,
7195 {"HSGW Address for forwarding Length", "gtpv2.hsgw_addr_f_len",
7196 FT_UINT8, BASE_DEC, NULL, 0x0,
7199 { &hf_gtpv2_hsgw_addr_ipv4,
7200 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv4",
7201 FT_IPv4, BASE_NONE, NULL, 0x0,
7204 { &hf_gtpv2_hsgw_addr_ipv6,
7205 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv6",
7206 FT_IPv6, BASE_NONE, NULL, 0x0,
7209 { &hf_gtpv2_gre_key,
7210 {"GRE Key", "gtpv2.gre_key",
7211 FT_UINT32, BASE_DEC, NULL, 0x0,
7214 { &hf_gtpv2_sgw_addr_ipv4,
7215 {"Serving GW Address", "gtpv2.sgw_addr_ipv4",
7216 FT_IPv4, BASE_NONE, NULL, 0x0,
7219 { &hf_gtpv2_sgw_addr_ipv6,
7220 {"Serving GW Address", "gtpv2.sgw_addr_ipv6",
7221 FT_IPv6, BASE_NONE, NULL, 0x0,
7224 { &hf_gtpv2_sgw_s1u_teid,
7225 {"Serving GW S1-U TEID", "gtpv2.sgw_s1u_teid",
7226 FT_UINT32, BASE_HEX, NULL, 0x0,
7229 {&hf_gtpv2_delay_value,
7230 {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
7231 FT_UINT8, BASE_DEC, NULL, 0x0,
7234 {&hf_gtpv2_charging_id,
7235 {"Charging id", "gtpv2.charging_id",
7236 FT_UINT32, BASE_DEC, NULL, 0x0,
7239 {&hf_gtpv2_charging_characteristic,
7240 {"Charging Characteristic", "gtpv2.charging_characteristic",
7241 FT_UINT16, BASE_HEX, NULL, 0xffff,
7244 {&hf_gtpv2_bearer_flag_ppc,
7245 {"PPC (Prohibit Payload Compression)", "gtpv2.bearer_flag.ppc",
7246 FT_BOOLEAN, 8, NULL, 0x01,
7249 {&hf_gtpv2_bearer_flag_vb,
7250 {"VB (Voice Bearer)", "gtpv2.bearer_flag.vb",
7251 FT_BOOLEAN, 8, NULL, 0x02,
7255 {"Procedure Transaction Id", "gtpv2.pti",
7256 FT_UINT8, BASE_DEC, NULL, 0x0,
7260 { &hf_gtpv2_mm_context_sm,
7261 {"Security Mode", "gtpv2.mm_context_sm",
7262 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_security_mode), 0xe0,
7265 { &hf_gtpv2_mm_context_nhi,
7266 {"NHI(Next Hop Indicator)", "gtpv2.mm_context_nhi",
7267 FT_BOOLEAN, 8, TFS(>pv2_nhi_vals), 0x10,
7270 { &hf_gtpv2_mm_context_drxi,
7271 {"DRXI", "gtpv2.mm_context_drxi",
7272 FT_UINT8, BASE_DEC, NULL, 0x08,
7275 { &hf_gtpv2_mm_context_cksn,
7276 {"CKSN", "gtpv2.mm_context_cksn",
7277 FT_UINT8, BASE_DEC, NULL, 0x07,
7280 { &hf_gtpv2_mm_context_cksn_ksi,
7281 {"CKSN/KSI", "gtpv2.mm_context_cksn_ksi",
7282 FT_UINT8, BASE_DEC, NULL, 0x07,
7286 {"Metric", "gtpv2.metric",
7287 FT_UINT8, BASE_DEC, NULL, 0x0,
7290 { &hf_gtpv2_throttling_factor,
7291 {"Throttling Factor", "gtpv2.throttling_factor",
7292 FT_UINT8, BASE_DEC, NULL, 0x0,
7295 { &hf_gtpv2_relative_capacity,
7296 {"Relative Capacity", "gtpv2.relative_capacity",
7297 FT_UINT8, BASE_DEC, NULL, 0x0,
7300 { &hf_gtpv2_apn_length,
7301 {"APN Length", "gtpv2.apn_length",
7302 FT_UINT8, BASE_HEX, NULL, 0x0,
7305 { &hf_gtpv2_sequence_number,
7306 {"Sequence Number", "gtpv2.sequence_number",
7307 FT_UINT32, BASE_HEX, NULL, 0x0,
7310 { &hf_gtpv2_mm_context_ksi_a,
7311 {"KSI_asme", "gtpv2.mm_context_ksi_a",
7312 FT_UINT8, BASE_DEC, NULL, 0x07,
7315 { &hf_gtpv2_mm_context_nr_tri,
7316 {"Number of Triplet", "gtpv2.mm_context_nr_tri",
7317 FT_UINT8, BASE_DEC, NULL, 0xe0,
7320 { &hf_gtpv2_mm_context_used_cipher,
7321 {"Used Cipher", "gtpv2.mm_context_used_cipher",
7322 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_used_cipher_vals), 0x07,
7325 { &hf_gtpv2_mm_context_unipa,
7326 {"Used NAS integrity protection algorithm", "gtpv2.mm_context_unipa",
7327 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unipa_vals), 0x70,
7331 { &hf_gtpv2_mm_context_unc,
7332 {"Used NAS Cipher", "gtpv2.mm_context_unc",
7333 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unc_vals), 0x0f,
7336 { &hf_gtpv2_mm_context_nas_dl_cnt,
7337 {"NAS Downlink Count", "gtpv2.mm_context_nas_dl_cnt",
7338 FT_UINT24, BASE_DEC, NULL, 0x0,
7341 { &hf_gtpv2_mm_context_nas_ul_cnt,
7342 {"NAS Uplink Count", "gtpv2.mm_context_nas_ul_cnt",
7343 FT_UINT24, BASE_DEC, NULL, 0x0,
7346 { &hf_gtpv2_mm_context_kasme,
7347 {"Kasme", "gtpv2.mm_context_kasme",
7348 FT_BYTES, BASE_NONE, NULL, 0x0,
7351 { &hf_gtpv2_mm_context_rand,
7352 {"RAND", "gtpv2.mm_context_rand",
7353 FT_BYTES, BASE_NONE, NULL, 0x0,
7356 {&hf_gtpv2_uci_csg_id,
7357 {"CSG ID", "gtpv2.cui_csg_id",
7358 FT_UINT32, BASE_DEC, NULL, 0x07FFFFFF,
7361 {&hf_gtpv2_uci_csg_id_spare,
7362 {"Spare", "gtpv2.cui_csg_id_spare",
7363 FT_UINT8, BASE_DEC, NULL, 0xF8,
7366 { &hf_gtpv2_uci_csg_membership,
7367 { "CSG Membership Indication", "gtpv2.uci_csg_membership",
7368 FT_UINT8, BASE_DEC, VALS(gtpv2_uci_csg_membership_status), 0x01,
7371 { &hf_gtpv2_uci_access_mode,
7372 {"Access Mode", "gtpv2.uci_access_mode",
7373 FT_UINT8, BASE_DEC, VALS(gtpv2_uci_access_mode), 0xC0,
7376 { &hf_gtpv2_uci_lcsg,
7377 {"Leave CSG", "gtpv2.uci_leave_csg",
7378 FT_UINT8, BASE_DEC, VALS(gtpv2_uci_leave_csg), 0x02,
7381 { &hf_gtpv2_mm_context_xres_len,
7382 {"XRES Length", "gtpv2.mm_context_xres_len",
7383 FT_UINT8, BASE_DEC, NULL, 0x0,
7386 { &hf_gtpv2_mm_context_xres,
7387 {"XRES", "gtpv2.mm_context_xres",
7388 FT_BYTES, BASE_NONE, NULL, 0x0,
7391 { &hf_gtpv2_mm_context_autn_len,
7392 {"AUTN Length", "gtpv2.mm_context_autn_len",
7393 FT_UINT8, BASE_DEC, NULL, 0x0,
7396 { &hf_gtpv2_mm_context_autn,
7397 {"AUTN", "gtpv2.mm_context_autn",
7398 FT_BYTES, BASE_NONE, NULL, 0x0,
7401 { &hf_gtpv2_mm_context_drx,
7402 {"DRX", "gtpv2.mm_context_drx",
7403 FT_UINT16, BASE_HEX, NULL, 0x0,
7406 { &hf_gtpv2_vdp_length,
7407 {"VDP and UE's Usage Setting length", "gtpv2.vdp_length",
7408 FT_UINT8, BASE_DEC, NULL, 0x0,
7412 { &hf_gtpv2_mm_context_ue_net_cap_len,
7413 {"Length of UE Network Capability", "gtpv2.mm_context_ue_net_cap_len",
7414 FT_UINT8, BASE_DEC, NULL, 0x0,
7417 { &hf_gtpv2_mm_context_ms_net_cap_len,
7418 {"Length of MS Network Capability", "gtpv2.mm_context_ms_net_cap_len",
7419 FT_UINT8, BASE_DEC, NULL, 0x0,
7422 { &hf_gtpv2_mm_context_mei_len,
7423 {"Length of Mobile Equipment Identity (MEI)", "gtpv2.mm_context_mei_len",
7424 FT_UINT8, BASE_DEC, NULL, 0x0,
7427 { &hf_gtpv2_mm_context_vdp_len,
7428 {"Length of Voice Domain Preference and UE's Usage Setting", "gtpv2.mm_context_vdp_len",
7429 FT_UINT8, BASE_DEC, NULL, 0x0,
7433 { "UTRAN", "gtpv2.mm_context.una",
7434 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x01,
7438 { "GERAN", "gtpv2.mm_context.gena",
7439 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x02,
7443 { "GAN", "gtpv2.mm_context.gana",
7444 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x04,
7448 { "I-HSPA-EVOLUTION", "gtpv2.mm_context.ina",
7449 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x08,
7453 { "E-UTRAN", "gtpv2.mm_context.ena",
7454 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x10,
7458 { "HO-toNone3GPP-Access", "gtpv2.mm_context.hnna",
7459 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x20,
7462 { &hf_gtpv2_mm_context_ksi,
7463 {"KSI", "gtpv2.mm_context_ksi",
7464 FT_UINT8, BASE_DEC, NULL, 0x07,
7467 { &hf_gtpv2_mm_context_nr_qui,
7468 {"Number of Quintuplets", "gtpv2.mm_context_nr_qui",
7469 FT_UINT8, BASE_DEC, NULL, 0xe0,
7473 { &hf_gtpv2_mm_context_nr_qua,
7474 {"Number of Quadruplet", "gtpv2.mm_context_nr_qua",
7475 FT_UINT8, BASE_DEC, NULL, 0x1c,
7478 { &hf_gtpv2_mm_context_uamb_ri,
7479 {"UAMB RI", "gtpv2.mm_context_uamb_ri",
7480 FT_BOOLEAN, 8, NULL, 0x02,
7483 { &hf_gtpv2_mm_context_osci,
7484 {"OSCI", "gtpv2.mm_context_osci",
7485 FT_BOOLEAN, 8, NULL, 0x02,
7488 { &hf_gtpv2_mm_context_samb_ri,
7489 {"SAMB RI", "gtpv2.mm_context_samb_ri",
7490 FT_BOOLEAN, 8, NULL, 0x0,
7493 { &hf_gtpv2_ue_time_zone_dst,
7494 {"Daylight Saving Time", "gtpv2.ue_time_zone_dst",
7495 FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals), 0x03,
7498 { &hf_gtpv2_fq_csid_type,
7499 {"Node-ID Type", "gtpv2.fq_csid_type",
7500 FT_UINT8, BASE_DEC, NULL, 0xf0,
7503 { &hf_gtpv2_fq_csid_nr,
7504 {"Number of CSIDs", "gtpv2.fq_csid_nr",
7505 FT_UINT8, BASE_DEC, NULL, 0x0f,
7508 { &hf_gtpv2_fq_csid_ipv4,
7509 {"Node-ID (IPv4)", "gtpv2.fq_csid_ipv4",
7510 FT_IPv4, BASE_NONE, NULL, 0x0,
7513 { &hf_gtpv2_fq_csid_ipv6,
7514 {"Node-ID (IPv6)", "gtpv2.fq_csid_ipv6",
7515 FT_IPv6, BASE_NONE, NULL, 0x0,
7518 { &hf_gtpv2_fq_csid_id,
7519 {"CSID", "gtpv2.fq_csid_id",
7520 FT_UINT16, BASE_DEC, NULL, 0x0,
7523 { &hf_gtpv2_complete_req_msg_type,
7524 {"Complete Request Message Type", "gtpv2.complete_req_msg_type",
7525 FT_UINT8, BASE_DEC, VALS(gtpv2_complete_req_msg_type_vals), 0x0,
7528 {&hf_gtpv2_mme_grp_id,
7529 {"MME Group ID", "gtpv2.mme_grp_id",
7530 FT_UINT16, BASE_DEC, NULL, 0x0,
7533 { &hf_gtpv2_mme_code,
7534 {"MME Code", "gtpv2.mme_code",
7535 FT_UINT8, BASE_DEC, NULL, 0x0,
7539 {"M-TMSI", "gtpv2.m_tmsi",
7540 FT_BYTES, BASE_NONE, NULL, 0x0,
7543 { &hf_gtpv2_container_type,
7544 {"Container Type", "gtpv2.container_type",
7545 FT_UINT8, BASE_DEC, VALS(gtpv2_container_type_vals), 0x0f,
7548 { &hf_gtpv2_cause_type,
7549 {"Cause Type", "gtpv2.cause_type",
7550 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_cause_type_vals_ext, 0x0f,
7553 { &hf_gtpv2_CauseRadioNetwork,
7554 {"Radio Network Layer Cause", "gtpv2.CauseRadioNetwork",
7555 FT_UINT8, BASE_DEC, VALS(s1ap_CauseRadioNetwork_vals), 0x0,
7558 { &hf_gtpv2_CauseTransport,
7559 {"Transport Layer Cause", "gtpv2.CauseTransport",
7560 FT_UINT8, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0x0,
7563 { &hf_gtpv2_CauseNas,
7564 {"NAS Cause", "gtpv2.CauseNas",
7565 FT_UINT8, BASE_DEC, VALS(s1ap_CauseNas_vals), 0x0,
7568 { &hf_gtpv2_CauseMisc,
7569 {"Miscellaneous Cause", "gtpv2.CauseMisc",
7570 FT_UINT8, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0x0,
7573 { &hf_gtpv2_target_type,
7574 {"Target Type", "gtpv2.target_type",
7575 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_target_type_vals_ext, 0x0,
7578 {&hf_gtpv2_macro_enodeb_id,
7579 {"Macro eNodeB ID", "gtpv2.macro_enodeb_id",
7580 FT_UINT24, BASE_HEX, NULL, 0x0fffff,
7583 { &hf_gtpv2_CauseProtocol,
7584 {"Protocol Cause", "gtpv2.CauseProtocol",
7585 FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0,
7588 {&hf_gtpv2_apn_rest,
7589 {"APN Restriction", "gtpv2.apn_rest",
7590 FT_UINT8, BASE_DEC, NULL, 0x0,
7593 {&hf_gtpv2_selec_mode,
7594 {"Selection Mode", "gtpv2.selec_mode",
7595 FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals), 0x03,
7598 { &hf_gtpv2_source_type,
7599 {"Source Type", "gtpv2.source_type",
7600 FT_UINT8, BASE_DEC, NULL, 0x0,
7603 {&hf_gtpv2_bearer_control_mode,
7604 {"Bearer Control Mode", "gtpv2.bearer_control_mode",
7605 FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals), 0x0,
7608 { &hf_gtpv2_cng_rep_act,
7609 {"Change Reporting Action", "gtpv2.cng_rep_act",
7610 FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
7613 { &hf_gtpv2_node_type,
7614 {"Node Type", "gtpv2.node_type",
7615 FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
7619 {"FQDN", "gtpv2.fqdn",
7620 FT_STRING, BASE_NONE, NULL, 0x0,
7623 { &hf_gtpv2_enterprise_id,
7624 {"Enterprise ID", "gtpv2.enterprise_id",
7625 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0x0,
7629 {"Transaction Identifier", "gtpv2.ti",
7630 FT_BYTES, BASE_NONE, NULL, 0x0,
7633 { &hf_gtpv2_bss_container_phx,
7634 {"PHX", "gtpv2.bss_cont.phx",
7635 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
7638 { &hf_gtpv2_bss_con_sapi_flg,
7639 {"SAPI", "gtpv2.bss_cont.sapi_flg",
7640 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
7643 { &hf_gtpv2_bss_con_rp_flg,
7644 {"RP", "gtpv2.bss_cont.rp_flg",
7645 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
7648 { &hf_gtpv2_bss_con_pfi_flg,
7649 {"PFI", "gtpv2.bss_cont.pfi_flg",
7650 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
7653 { &hf_gtpv2_bss_con_pfi,
7654 {"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
7655 FT_UINT8, BASE_DEC, NULL, 0x0,
7658 { &hf_gtpv2_bss_con_rp,
7659 {"Radio Priority(RP)", "gtpv2.bss_cont.rp",
7660 FT_UINT8, BASE_DEC, NULL, 0x07,
7663 { &hf_gtpv2_bss_con_sapi,
7664 {"SAPI", "gtpv2.bss_cont.sapi",
7665 FT_UINT8, BASE_DEC, NULL, 0xf0,
7668 { &hf_gtpv2_bss_con_xid_len,
7669 {"XiD parameters length", "gtpv2.bss_cont.xid_len",
7670 FT_UINT8, BASE_DEC, NULL, 0x0,
7673 { &hf_gtpv2_bss_con_xid,
7674 {"XiD parameters", "gtpv2.bss_cont.xid",
7675 FT_BYTES, BASE_NONE, NULL, 0x0,
7678 { &hf_gtpv2_home_enodeb_id,
7679 {"Home eNodeB ID", "gtpv2.home_enodeb_id",
7680 FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
7684 {"Tracking Area Code (TAC)", "gtpv2.tac",
7685 FT_UINT16, BASE_DEC, NULL, 0x0,
7688 { &hf_gtpv2_mbms_service_area_nr,
7689 {"Number of MBMS Service Area codes", "gtpv2.mbms_service_area_nr",
7690 FT_UINT16, BASE_DEC, NULL, 0x0,
7693 { &hf_gtpv2_mbms_service_area_id,
7694 {"MBMS Service Area code (Service Area Identity)", "gtpv2.mbms_service_area_id",
7695 FT_UINT16, BASE_DEC, NULL, 0x0,
7698 { &hf_gtpv2_mbms_session_id,
7699 {"MBMS Session Identifier", "gtpv2.mbms_session_id",
7700 FT_BYTES, BASE_NONE, NULL, 0x0,
7703 { &hf_gtpv2_mbms_flow_id,
7704 {"MBMS Flow Identifier", "gtpv2.mbms_flow_id",
7705 FT_BYTES, BASE_NONE, NULL, 0x0,
7709 {"Common Tunnel Endpoint Identifier", "gtpv2.cetid",
7710 FT_UINT32, BASE_DEC, NULL, 0x0,
7713 { &hf_gtpv2_ip_addr_type,
7714 {"IP Address Type", "gtpv2.ip_addr_type",
7715 FT_UINT8, BASE_DEC, NULL, 0xc0,
7718 { &hf_gtpv2_ip_addr_len,
7719 {"IP Address Length", "gtpv2.ip_addr_len",
7720 FT_UINT8, BASE_DEC, NULL, 0x3f,
7723 { &hf_gtpv2_mbms_ip_mc_dist_addrv4,
7724 {"MBMS IP Multicast Distribution Address (IPv4)", "gtpv2.mbms_ip_mc_dist_addrv4",
7725 FT_IPv4, BASE_NONE, NULL, 0x0,
7728 { &hf_gtpv2_mbms_ip_mc_dist_addrv6,
7729 {"MBMS IP Multicast Distribution Address (IPv6)", "gtpv2.mbms_ip_mc_dist_addrv6",
7730 FT_IPv6, BASE_NONE, NULL, 0x0,
7733 { &hf_gtpv2_mbms_ip_mc_src_addrv4,
7734 {"MBMS IP Multicast Source Address (IPv4)", "gtpv2.mbms_ip_mc_src_addrv4",
7735 FT_IPv4, BASE_NONE, NULL, 0x0,
7738 { &hf_gtpv2_mbms_ip_mc_src_addrv6,
7739 {"MBMS IP Multicast Source Address (IPv6)", "gtpv2.mbms_ip_mc_src_addrv6",
7740 FT_IPv6, BASE_NONE, NULL, 0x0,
7743 { &hf_gtpv2_mbms_hc_indicator,
7744 {"MBMS HC Indicator", "gtpv2.mbms_hc_indicator",
7745 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_hc_indicator_vals), 0x0,
7748 { &hf_gtpv2_mbms_dist_indication,
7749 {"MBMS Distribution Indication", "gtpv2.mbms_dist_indication",
7750 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_dist_indication_vals), 0x03,
7753 { &hf_gtpv2_subscriber_rfsp,
7754 {"Subscribed RFSP Index", "gtpv2.subscriber_rfsp",
7755 FT_INT16, BASE_DEC, NULL, 0x0,
7758 { &hf_gtpv2_rfsp_inuse,
7759 {"RFSP Index in Use", "gtpv2.rfsp_inuse",
7760 FT_INT16, BASE_DEC, NULL, 0x0,
7763 { &hf_gtpv2_mbms_service_id,
7764 {"MBMS Service ID", "gtpv2.mbms_service_id",
7765 FT_BYTES, BASE_NONE, NULL, 0x0,
7768 { &hf_gtpv2_add_flags_for_srvcc_ics,
7769 {"ICS (IMS Centralized Service)", "gtpv2.add_flags_for_srvcc_ics",
7770 FT_BOOLEAN, 8, NULL, 0x01,
7773 { &hf_gtpv2_vsrvcc_flag,
7774 {"VF (vSRVCC Flag)", "gtpv2.vsrvcc_flag",
7775 FT_BOOLEAN, 8, NULL, 0x02,
7778 { &hf_gtpv2_henb_info_report_fti,
7779 {"FTI", "gtpv2.henb_info_report_fti",
7780 FT_BOOLEAN, 8, TFS(>pv2_henb_info_report_fti_vals), 0x01,
7783 { &hf_gtpv2_ip4cp_subnet_prefix_len,
7784 {"Subnet Prefix Length", "gtpv2.ip4cp_subnet_prefix_len",
7785 FT_UINT8, BASE_DEC, NULL, 0x0,
7788 { &hf_gtpv2_ip4cp_ipv4,
7789 {"IPv4 Default Router Address", "gtpv2.ip4cp_ipv4",
7790 FT_IPv4, BASE_NONE, NULL, 0x0,
7793 { &hf_gtpv2_change_report_flags_sncr,
7794 {"SNCR (Service Network Change to Report)", "gtpv2.change_report_flags_sncr",
7795 FT_BOOLEAN, 8, NULL, 0x01,
7798 { &hf_gtpv2_change_report_flags_tzcr,
7799 {"TZCR (Time Zone Change to Report)", "gtpv2.change_report_flags_tzcr",
7800 FT_BOOLEAN, 8, NULL, 0x02,
7803 {&hf_gtpv2_action_indication_val,
7804 {"Action Indication", "gtpv2.action_indication_val",
7805 FT_UINT8, BASE_DEC|BASE_EXT_STRING, >pv2_action_indication_vals_ext, 0x07,
7808 { &hf_gtpv2_uli_timestamp,
7809 { "ULI Timestamp", "gtpv2.uli_timestamp",
7810 FT_STRING, BASE_NONE, NULL, 0,
7813 { &hf_gtpv2_abs_time_mbms_data,
7814 { "Absolute Time of MBMS Data Transfer", "gtpv2.abs_time_mbms_data",
7815 FT_STRING, BASE_NONE, NULL, 0,
7818 { &hf_gtpv2_mbms_session_duration_days,
7819 {"MBMS Session Duration (days)", "gtpv2.mbms_session_duration_days",
7820 FT_UINT24, BASE_DEC, NULL, 0x00007F,
7823 { &hf_gtpv2_mbms_session_duration_secs,
7824 {"MBMS Session Duration (seconds)", "gtpv2.mbms_session_duration_secs",
7825 FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
7828 { &hf_gtpv2_node_features_prn,
7829 {"PGW Restart Notification (PRN)", "gtpv2.node_features_prn",
7830 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
7833 { &hf_gtpv2_node_features_mabr,
7834 {"Modify Access Bearers Request (MABR)", "gtpv2.node_features_mabr",
7835 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
7838 { &hf_gtpv2_node_features_ntsr,
7839 {"Network Triggered Service Restoration (NTSR)", "gtpv2.node_features_ntsr",
7840 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
7843 { &hf_gtpv2_time_to_data_xfer,
7844 {"MBMS Time to Data Transfer", "gtpv2.time_to_data_xfer",
7845 FT_STRING, BASE_NONE, NULL, 0,
7848 { &hf_gtpv2_arp_pvi,
7849 {"Pre-emption Vulnerability (PVI)", "gtpv2.arp_pvi",
7850 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
7854 {"Priority Level", "gtpv2.arp_pl",
7855 FT_UINT8, BASE_DEC, NULL, 0x3c,
7858 { &hf_gtpv2_arp_pci,
7859 {"Pre-emption Capability (PCI)", "gtpv2.arp_pci",
7860 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
7863 { &hf_gtpv2_timer_unit,
7864 {"Timer unit", "gtpv2.timer_unit",
7865 FT_UINT8, BASE_DEC, VALS(gtpv2_timer_unit_vals), 0xe0,
7868 { &hf_gtpv2_throttling_delay_unit,
7869 {"Throttling Delay unit", "gtpv2.throttling_delay_unit",
7870 FT_UINT8, BASE_DEC, VALS(gtpv2_throttling_delay_unit_vals), 0xe0,
7873 { &hf_gtpv2_timer_value,
7874 {"Timer value", "gtpv2.timer_value",
7875 FT_UINT8, BASE_DEC, NULL, 0x1f,
7878 { &hf_gtpv2_throttling_delay_value,
7879 {"Throttling Delay value", "gtpv2.throttling_delay_value",
7880 FT_UINT8, BASE_DEC, NULL, 0x1f,
7884 {"LAPI (Low Access Priority Indication)", "gtpv2.lapi",
7885 FT_BOOLEAN, 8, NULL, 0x01,
7888 { &hf_gtpv2_mm_context_higher_br_16mb_flg_len,
7889 {"Length of Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg_len",
7890 FT_UINT8, BASE_DEC, NULL, 0x0,
7893 { &hf_gtpv2_mm_context_higher_br_16mb_flg,
7894 {"Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg",
7895 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_higher_br_16mb_flg_vals), 0x0,
7898 { &hf_gtpv2_mmbr_ul,
7899 {"Max MBR/APN-AMBR for uplink", "gtpv2.mmbr_ul",
7900 FT_UINT32, BASE_DEC, NULL, 0x0,
7903 { &hf_gtpv2_mmbr_dl,
7904 {"Max MBR/APN-AMBR for downlink", "gtpv2.mmbr_dl",
7905 FT_UINT32, BASE_DEC, NULL, 0x0,
7908 { &hf_gtpv2_pres_rep_area_action,
7909 {"Action", "gtpv2.pres_rep_area_action.action",
7910 FT_UINT8, BASE_DEC, VALS(gtpv2_pres_rep_area_action_vals), 0x03,
7913 { &hf_gtpv2_pres_rep_area_id,
7914 {"Presence Reporting Area Identifier", "gtpv2.pres_rep_area_action.pres_rep_area_id",
7915 FT_UINT16, BASE_HEX, NULL, 0x0,
7918 { &hf_gtpv2_pres_rep_area_act_no_tai,
7919 {"Number of TAI", "gtpv2.pres_rep_area_action.no_tai",
7920 FT_UINT8, BASE_DEC, NULL, 0xf0,
7923 { &hf_gtpv2_pres_rep_area_act_no_rai,
7924 {"Number of RAI", "gtpv2.pres_rep_area_action.no_rai",
7925 FT_UINT8, BASE_DEC, NULL, 0x0f,
7928 { &hf_gtpv2_pres_rep_area_act_no_m_enodeb,
7929 {"Number of Macro eNodeB", "gtpv2.pres_rep_area_action.no_m_enodeb",
7930 FT_UINT8, BASE_DEC, NULL, 0x3f,
7933 { &hf_gtpv2_pres_rep_area_act_no_h_enodeb,
7934 {"Number of Home eNodeB", "gtpv2.pres_rep_area_action.no_h_enodeb",
7935 FT_UINT8, BASE_DEC, NULL, 0x3f,
7938 { &hf_gtpv2_pres_rep_area_act_no_ecgi,
7939 {"Number of ECGI", "gtpv2.pres_rep_area_action.no_ecgi",
7940 FT_UINT8, BASE_DEC, NULL, 0x3f,
7943 { &hf_gtpv2_pres_rep_area_act_no_sai,
7944 {"Number of SAI", "gtpv2.pres_rep_area_action.no_sai",
7945 FT_UINT8, BASE_DEC, NULL, 0x3f,
7948 { &hf_gtpv2_pres_rep_area_act_no_cgi,
7949 {"Number of CGI", "gtpv2.pres_rep_area_action.no_cgi",
7950 FT_UINT8, BASE_DEC, NULL, 0x3f,
7954 { "KSI'ps", "gtpv2.ksi_ps",
7955 FT_UINT8, BASE_HEX, NULL, 0x0f,
7959 { "CK'ps", "gtpv2.ck_ps",
7960 FT_BYTES, BASE_NONE, NULL, 0,
7964 { "IK'ps", "gtpv2.ik_ps",
7965 FT_BYTES, BASE_NONE, NULL, 0,
7969 { "KC'ps", "gtpv2.kc_ps",
7970 FT_BYTES, BASE_NONE, NULL, 0,
7973 { &hf_gtpv2_cksn_ps,
7974 { "CKSN'ps", "gtpv2.cksn_ps",
7975 FT_UINT8, BASE_HEX, NULL, 0x0,
7979 /* Generated from convert_proto_tree_add_text.pl */
7980 { &hf_gtpv2_transparent_container, { "Transparent Container", "gtpv2.transparent_container", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7981 { &hf_gtpv2_cksrvcc, { "CKsrvcc", "gtpv2.cksrvcc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7982 { &hf_gtpv2_iksrvcc, { "IKsrvcc", "gtpv2.iksrvcc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7983 { &hf_gtpv2_mobile_station_classmark2, { "Mobile Station Classmark2", "gtpv2.mobile_station_classmark2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7984 { &hf_gtpv2_mobile_station_classmark3, { "Mobile Station Classmark3", "gtpv2.mobile_station_classmark3", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7985 { &hf_gtpv2_supported_codec_list, { "Supported Codec List", "gtpv2.supported_codec_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7986 { &hf_gtpv2_utran_srvcc_ck_cs, { "CK'cs", "gtpv2.utran_srvcc.ck_cs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7987 { &hf_gtpv2_utran_srvcc_ik_cs, { "IK'cs", "gtpv2.utran_srvcc.ik_cs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7988 { &hf_gtpv2_utran_srvcc_kc, { "Kc'", "gtpv2.utran_srvcc.kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7989 { &hf_gtpv2_teid_c_spare, { "Spare", "gtpv2.teid_c.spare", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7990 { &hf_gtpv2_geographic_location, { "Geographic Location", "gtpv2.geographic_location", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7991 { &hf_gtpv2_tmsi_bytes, { "TMSI", "gtpv2.tmsi_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7992 { &hf_gtpv2_cn_id, { "CN-Id", "gtpv2.cn_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7993 { &hf_gtpv2_eps_bearer_id_number, { "EPS Bearer ID Number", "gtpv2.eps_bearer_id_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7994 { &hf_gtpv2_serving_gw_address_length, { "Serving GW Address Length", "gtpv2.serving_gw_address_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7995 { &hf_gtpv2_charging_characteristic_remaining_octets, { "Remaining octets", "gtpv2.charging_characteristic.remaining_octets", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7996 { &hf_gtpv2_trace_id, { "Trace ID", "gtpv2.trace_id", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
7997 { &hf_gtpv2_drx_parameter, { "DRX parameter", "gtpv2.drx_parameter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7998 { &hf_gtpv2_mm_context_sres, { "SRES'", "gtpv2.mm_context_sres", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
7999 { &hf_gtpv2_mm_context_kc, { "Kc'", "gtpv2.mm_context_kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8000 { &hf_gtpv2_uplink_subscribed_ue_ambr, { "Uplink Subscribed UE AMBR", "gtpv2.uplink_subscribed_ue_ambr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8001 { &hf_gtpv2_downlink_subscribed_ue_ambr, { "Downlink Subscribed UE AMBR", "gtpv2.downlink_subscribed_ue_ambr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8002 { &hf_gtpv2_uplink_used_ue_ambr, { "Uplink Used UE AMBR", "gtpv2.uplink_used_ue_ambr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8003 { &hf_gtpv2_downlink_used_ue_ambr, { "Downlink Used UE AMBR", "gtpv2.downlink_used_ue_ambr", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8004 { &hf_gtpv2_voice_domain_and_ue_usage_setting, { "Voice Domain Preference and UE's Usage Setting", "gtpv2.voice_domain_and_ue_usage_setting", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8005 { &hf_gtpv2_authentication_quadruplets, { "Authentication Quadruplets", "gtpv2.authentication_quadruplets", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8006 { &hf_gtpv2_authentication_quintuplets, { "Authentication Quintuplets", "gtpv2.authentication_quintuplets", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8007 { &hf_gtpv2_mm_context_nh, { "NH (Next Hop)", "gtpv2.mm_context_nh", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8008 { &hf_gtpv2_mm_context_ncc, { "NCC (Next Hop Chaining Count)", "gtpv2.mm_context_ncc", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }},
8009 { &hf_gtpv2_nsapi08, { "NSAPI", "gtpv2.nsapi", FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
8010 { &hf_gtpv2_dl_gtp_u_sequence_number, { "DL GTP-U Sequence Number", "gtpv2.dl_gtp_u_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8011 { &hf_gtpv2_ul_gtp_u_sequence_number, { "UL GTP-U Sequence Number", "gtpv2.ul_gtp_u_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8012 { &hf_gtpv2_send_n_pdu_number, { "Send N-PDU Number", "gtpv2.send_n_pdu_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8013 { &hf_gtpv2_receive_n_pdu_number, { "Receive N-PDU Number", "gtpv2.receive_n_pdu_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8014 { &hf_gtpv2_hop_counter, { "Hop Counter", "gtpv2.hop_counter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8015 { &hf_gtpv2_packet_flow_id, { "Packet Flow ID", "gtpv2.packet_flow_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8016 { &hf_gtpv2_rrc_container, { "RRC Container", "gtpv2.rrc_container", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8017 { &hf_gtpv2_upd_source_port_number, { "UPD Source Port Number", "gtpv2.upd_source_port_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8018 { &hf_gtpv2_proprietary_value, { "Proprietary value", "gtpv2.proprietary_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8019 { &hf_gtpv2_spare_bytes, { "Spare", "gtpv2.spare_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
8020 { &hf_gtpv2_dl_pdcp_sequence_number, { "DL PDCP Sequence Number", "gtpv2.dl_pdcp_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8021 { &hf_gtpv2_ul_pdcp_sequence_number, { "UL PDCP Sequence Number", "gtpv2.ul_pdcp_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
8022 { &hf_gtpv2_fq_csid_node_id, { "Node-ID", "gtpv2.fq_csid_node_id", FT_UINT32, BASE_DEC, NULL, 0x00000FFF, NULL, HFILL }},
8023 { &hf_gtpv2_fq_csid_mcc_mnc, { "MCC+MNC", "gtpv2.fq_csid_mcc_mnc", FT_UINT32, BASE_DEC, NULL, 0xFFFFF000, NULL, HFILL }},
8026 static gint *ett_gtpv2_array[] = {
8030 &ett_gtpv2_uli_flags,
8031 &ett_gtpv2_uli_field,
8032 &ett_gtpv2_bearer_ctx,
8033 &ett_gtpv2_PDN_conn,
8034 &ett_gtpv2_overload_control_information,
8035 &ett_gtpv2_mm_context_flag,
8036 &ett_gtpv2_pdn_numbers_nsapi,
8037 &ett_gtpv2_tra_info_trigg,
8038 &ett_gtpv2_tra_info_trigg_msc_server,
8039 &ett_gtpv2_tra_info_trigg_mgw,
8040 &ett_gtpv2_tra_info_trigg_sgsn,
8041 &ett_gtpv2_tra_info_trigg_ggsn,
8042 &ett_gtpv2_tra_info_trigg_bm_sc,
8043 &ett_gtpv2_tra_info_trigg_sgw_mme,
8044 &ett_gtpv2_tra_info_trigg_sgw,
8045 &ett_gtpv2_tra_info_trigg_pgw,
8046 &ett_gtpv2_tra_info_interfaces,
8047 &ett_gtpv2_tra_info_interfaces_imsc_server,
8048 &ett_gtpv2_tra_info_interfaces_lmgw,
8049 &ett_gtpv2_tra_info_interfaces_lsgsn,
8050 &ett_gtpv2_tra_info_interfaces_lggsn,
8051 &ett_gtpv2_tra_info_interfaces_lrnc,
8052 &ett_gtpv2_tra_info_interfaces_lbm_sc,
8053 &ett_gtpv2_tra_info_interfaces_lmme,
8054 &ett_gtpv2_tra_info_interfaces_lsgw,
8055 &ett_gtpv2_tra_info_interfaces_lpdn_gw,
8056 &ett_gtpv2_tra_info_interfaces_lpdn_lenb,
8057 &ett_gtpv2_tra_info_ne_types,
8061 &ett_gtpv2_supp_codec_list,
8063 &ett_gtpv2_mm_context_auth_qua,
8064 &ett_gtpv2_mm_context_auth_qui,
8065 &ett_gtpv2_mm_context_auth_tri,
8066 &ett_gtpv2_mm_context_net_cap,
8067 &ett_gtpv2_ms_network_capability,
8069 &ett_gtpv2_access_rest_data,
8072 &ett_gtpv2_preaa_tais,
8073 &ett_gtpv2_preaa_menbs,
8074 &ett_gtpv2_preaa_henbs,
8075 &ett_gtpv2_preaa_ecgis,
8076 &ett_gtpv2_preaa_rais,
8077 &ett_gtpv2_preaa_sais,
8078 &ett_gtpv2_preaa_cgis,
8079 &ett_gtpv2_load_control_inf,
8082 static ei_register_info ei[] = {
8083 { &ei_gtpv2_ie_data_not_dissected, { "gtpv2.ie_data_not_dissected", PI_UNDECODED, PI_NOTE, "IE data not dissected yet", EXPFILL }},
8084 { &ei_gtpv2_ie_len_invalid, { "gtpv2.ie_len_invalid", PI_PROTOCOL, PI_ERROR, "Wrong length", EXPFILL }},
8085 { &ei_gtpv2_source_type_unknown, { "gtpv2.source_type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown source type", EXPFILL }},
8086 { &ei_gtpv2_fq_csid_type_bad, { "gtpv2.fq_csid_type.unknown", PI_PROTOCOL, PI_ERROR, "Wrong Node-ID Type", EXPFILL }},
8087 { &ei_gtpv2_mbms_session_duration_days, { "gtpv2.mbms_session_duration_days.invalid", PI_PROTOCOL, PI_WARN, "Days out of allowed range", EXPFILL }},
8088 { &ei_gtpv2_mbms_session_duration_secs, { "gtpv2.mbms_session_duration_secs.unknown", PI_PROTOCOL, PI_WARN, "Seconds out of allowed range", EXPFILL }},
8089 { &ei_gtpv2_ie, { "gtpv2.ie_type.reserved", PI_PROTOCOL, PI_WARN, "IE type Zero is Reserved and should not be used", EXPFILL }},
8092 expert_module_t* expert_gtpv2;
8094 proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
8095 proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
8096 proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
8097 expert_gtpv2 = expert_register_protocol(proto_gtpv2);
8098 expert_register_field_array(expert_gtpv2, ei, array_length(ei));
8100 /* AVP Code: 22 3GPP-User-Location-Info */
8101 dissector_add_uint("diameter.3gpp", 22, new_create_dissector_handle(dissect_diameter_3gpp_uli, proto_gtpv2));
8103 /* AVP Code: 2820 Presence-Reporting-Area-Elements-List */
8104 dissector_add_uint("diameter.3gpp", 2820, new_create_dissector_handle(dissect_diameter_3gpp_presence_reporting_area_elements_list, proto_gtpv2));
8106 register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
8107 /* Dissector table for private extensions */
8108 gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 PRIVATE EXT", FT_UINT16, BASE_DEC);
8112 proto_reg_handoff_gtpv2(void)
8114 nas_eps_handle = find_dissector("nas-eps");
8123 * indent-tabs-mode: nil
8126 * ex: set shiftwidth=4 tabstop=8 expandtab:
8127 * :indentSize=4:tabSize=8:noTabs=true: