Revert "TODO epan/dissectors/asn1/kerberos/packet-kerberos-template.c new GSS flags"
[wireshark-sm.git] / epan / dissectors / packet-gtpv2.c
blobd74497775382aa9df14af37e98a174bd733841b4
1 /* packet-gtpv2.c
3 * Routines for GTPv2 dissection
4 * Copyright 2009 - 2021, 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 * SPDX-License-Identifier: GPL-2.0-or-later
12 * Ref: 3GPP TS 29.274 V18.7.0 (2024-06-26)
15 #include "config.h"
17 #include <math.h>
19 #include <epan/packet.h>
20 #include <epan/conversation.h>
21 #include <epan/to_str.h>
22 #include <epan/asn1.h>
23 #include <epan/expert.h>
24 #include <epan/sminmpec.h>
25 #include <epan/addr_resolv.h>
26 #include <epan/tap.h>
27 #include <epan/srt_table.h>
28 #include <epan/tfs.h>
29 #include <proto.h>
30 #include <unit_strings.h>
32 #include "packet-gsm_a_common.h"
33 #include "packet-gsm_map.h"
34 #include "packet-e164.h"
35 #include "packet-e212.h"
36 #include "packet-s1ap.h"
37 #include "packet-ranap.h"
38 #include "packet-bssgp.h"
39 #include "packet-ngap.h"
40 #include "packet-gtpv2.h"
41 #include "packet-radius.h"
42 #include "packet-diameter.h"
43 #include "packet-diameter_3gpp.h"
44 #include "packet-ip.h"
46 void proto_register_gtpv2(void);
47 void proto_reg_handoff_gtpv2(void);
49 static dissector_handle_t nas_eps_handle;
50 static dissector_table_t gtpv2_priv_ext_dissector_table;
53 /*GTPv2 Message->GTP Header(SB)*/
54 static int proto_gtpv2;
56 static int hf_gtpv2_response_in;
57 static int hf_gtpv2_response_to;
58 static int hf_gtpv2_response_time;
59 static int hf_gtpv2_spare_half_octet;
60 //static int hf_gtpv2_spare_b7_b1;
61 static int hf_gtpv2_spare_b7_b2;
62 static int hf_gtpv2_spare_b7_b3;
63 static int hf_gtpv2_spare_b7_b4;
64 static int hf_gtpv2_spare_b7_b5;
66 static int hf_gtpv2_spare_bits;
67 static int hf_gtpv2_flags;
68 static int hf_gtpv2_version;
69 static int hf_gtpv2_p;
70 static int hf_gtpv2_t;
71 static int hf_gtpv2_mp;
72 static int hf_gtpv2_message_type;
73 static int hf_gtpv2_msg_length;
74 static int hf_gtpv2_teid;
75 static int hf_gtpv2_seq;
76 static int hf_gtpv2_msg_prio;
77 static int hf_gtpv2_spare;
78 static int hf_gtpv2_spare_w0;
80 static int hf_gtpv2_ie;
81 static int hf_gtpv2_ie_len;
82 static int hf_gtpv2_cr;
83 static int hf_gtpv2_instance;
84 static int hf_gtpv2_cause;
85 static int hf_gtpv2_cause_cs;
86 static int hf_gtpv2_cause_bce;
87 static int hf_gtpv2_cause_pce;
88 static int hf_gtpv2_cause_off_ie_t;
89 static int hf_gtpv2_rec;
90 /*Start SRVCC Messages*/
91 static int hf_gtpv2_stn_sr;
92 static int hf_gtpv2_len_trans_con;
93 static int hf_gtpv2_eksi;
94 static int hf_gtpv2_ck;
95 static int hf_gtpv2_ik;
96 static int hf_gtpv2_len_ms_classmark2;
97 static int hf_gtpv2_len_ms_classmark3;
98 static int hf_gtpv2_len_supp_codec_list;
99 static int hf_gtpv2_ksi;
100 /*static int hf_gtpv2_kc; */
101 static int hf_gtpv2_cksn;
102 static int hf_gtpv2_srvcc_cause;
103 static int hf_gtpv2_rac;
104 static int hf_gtpv2_rnc_id;
105 static int hf_gtpv2_ext_rnc_id;
106 static int hf_gtpv2_lac;
107 static int hf_gtpv2_sac;
108 static int hf_gtpv2_tgt_g_cell_id;
109 static int hf_gtpv2_teid_c;
110 static int hf_gtpv2_sv_sti;
111 static int hf_gtpv2_sv_ics;
112 static int hf_gtpv2_sv_emind;
113 /*End SRVCC Messages*/
114 static int hf_gtpv2_apn;
115 static int hf_gtpv2_ebi;
116 static int hf_gtpv2_daf;
117 static int hf_gtpv2_dtf;
118 static int hf_gtpv2_hi;
119 static int hf_gtpv2_dfi;
120 static int hf_gtpv2_oi;
121 static int hf_gtpv2_isrsi;
122 static int hf_gtpv2_israi;
123 static int hf_gtpv2_sgwci;
124 static int hf_gtpv2_sqci;
125 static int hf_gtpv2_uimsi;
126 static int hf_gtpv2_cfsi;
127 static int hf_gtpv2_crsi;
128 static int hf_gtpv2_pt;
129 static int hf_gtpv2_ps;
130 static int hf_gtpv2_si;
131 static int hf_gtpv2_msv;
132 static int hf_gtpv2_retloc;
133 static int hf_gtpv2_pbic;
134 static int hf_gtpv2_srni;
135 static int hf_gtpv2_s6af;
136 static int hf_gtpv2_s4af;
137 static int hf_gtpv2_mbmdt;
138 static int hf_gtpv2_israu;
139 static int hf_gtpv2_ccrsi;
140 static int hf_gtpv2_cprai;
141 static int hf_gtpv2_arrl;
142 static int hf_gtpv2_ppof;
143 static int hf_gtpv2_ppon_ppei;
144 static int hf_gtpv2_ppsi;
145 static int hf_gtpv2_csfbi;
146 static int hf_gtpv2_clii;
147 static int hf_gtpv2_cpsr;
148 static int hf_gtpv2_nsi;
149 static int hf_gtpv2_uasi;
150 static int hf_gtpv2_dtci;
151 static int hf_gtpv2_bdwi;
152 static int hf_gtpv2_psci;
153 static int hf_gtpv2_pcri;
154 static int hf_gtpv2_aosi;
155 static int hf_gtpv2_aopi;
156 static int hf_gtpv2_roaai;
157 static int hf_gtpv2_epcosi;
158 static int hf_gtpv2_cpopci;
159 static int hf_gtpv2_pmtsmi;
160 static int hf_gtpv2_s11tf;
161 static int hf_gtpv2_pnsi;
162 static int hf_gtpv2_unaccsi;
163 static int hf_gtpv2_wpmsi;
165 static int hf_gtpv2_5gsnn26;
166 static int hf_gtpv2_reprefi;
167 static int hf_gtpv2_5gsiwk;
168 static int hf_gtpv2_eevrsi;
169 static int hf_gtpv2_ltemui;
170 static int hf_gtpv2_ltempi;
171 static int hf_gtpv2_enbcrsi;
172 static int hf_gtpv2_tspcmi;
173 static int hf_gtpv2_ethpdn;
175 static int hf_gtpv2_csrmfi;
176 static int hf_gtpv2_mtedtn;
177 static int hf_gtpv2_mtedta;
178 static int hf_gtpv2_n5gnmi;
179 static int hf_gtpv2_5gcnrs;
180 static int hf_gtpv2_5gcnri;
181 static int hf_gtpv2_5srhoi;
183 static int hf_gtpv2_nspusi;
184 static int hf_gtpv2_pgwrnsi;
185 static int hf_gtpv2_rppcsi;
186 static int hf_gtpv2_pgwchi;
187 static int hf_gtpv2_sissme;
188 static int hf_gtpv2_nsenbi;
189 static int hf_gtpv2_idfupf;
190 static int hf_gtpv2_emci;
192 static int hf_gtpv2_lapcosi;
193 static int hf_gtpv2_ltemsai;
194 static int hf_gtpv2_srtpi;
195 static int hf_gtpv2_upipsi;
197 static int hf_gtpv2_pdn_type;
198 static int hf_gtpv2_pdn_ipv4;
199 static int hf_gtpv2_pdn_ipv6_len;
200 static int hf_gtpv2_pdn_ipv6;
201 static int hf_gtpv2_pdn_numbers_nsapi;
202 static int hf_gtpv2_p_tmsi;
203 static int hf_gtpv2_p_tmsi_sig;
204 static int hf_gtpv2_mmbr_ul;
205 static int hf_gtpv2_mmbr_dl;
207 static int hf_gtpv2_rat_type;
208 static int hf_gtpv2_uli_ext_macro_enb_id_flg;
209 static int hf_gtpv2_uli_macro_enb_id_flg;
210 static int hf_gtpv2_uli_lai_flg;
211 static int hf_gtpv2_uli_ecgi_flg;
212 static int hf_gtpv2_uli_tai_flg;
213 static int hf_gtpv2_uli_rai_flg;
214 static int hf_gtpv2_uli_sai_flg;
215 static int hf_gtpv2_uli_cgi_flg;
216 static int hf_gtpv2_glt;
217 static int hf_gtpv2_cng_rep_act;
219 static int hf_gtpv2_selec_mode;
220 static int hf_gtpv2_source_type;
221 static int hf_gtpv2_f_teid_v4;
222 static int hf_gtpv2_f_teid_v6;
223 static int hf_gtpv2_f_teid_interface_type;
224 static int hf_gtpv2_f_teid_gre_key;
225 static int hf_gtpv2_f_teid_ipv4;
226 static int hf_gtpv2_f_teid_ipv6;
227 static int hf_gtpv2_tmsi;
228 static int hf_gtpv2_hsgw_addr_f_len;
229 static int hf_gtpv2_hsgw_addr_ipv4;
230 static int hf_gtpv2_hsgw_addr_ipv6;
231 static int hf_gtpv2_gre_key;
232 static int hf_gtpv2_sgw_addr_ipv4;
233 static int hf_gtpv2_sgw_addr_ipv6;
234 static int hf_gtpv2_sgw_s1u_teid;
235 static int hf_gtpv2_ipv4_addr;
238 static int hf_gtpv2_ambr_up;
239 static int hf_gtpv2_ambr_down;
240 static int hf_gtpv2_ip_address_ipv4;
241 static int hf_gtpv2_ip_address_ipv6;
242 static int hf_gtpv2_mei;
244 /* Trace Information */
245 /* static int hf_gtpv2_tra_info; */
246 static int hf_gtpv2_tra_info_msc_momt_calls;
247 static int hf_gtpv2_tra_info_msc_momt_sms;
248 static int hf_gtpv2_tra_info_msc_lu_imsi_ad;
249 static int hf_gtpv2_tra_info_msc_handovers;
250 static int hf_gtpv2_tra_info_msc_ss;
251 static int hf_gtpv2_tra_info_mgw_context;
252 static int hf_gtpv2_tra_info_sgsn_pdp_context;
253 static int hf_gtpv2_tra_info_sgsn_momt_sms;
254 static int hf_gtpv2_tra_info_sgsn_rau_gprs_ad;
255 static int hf_gtpv2_tra_info_sgsn_mbms;
256 static int hf_gtpv2_tra_info_sgsn_reserved;
257 static int hf_gtpv2_tra_info_ggsn_pdp;
258 static int hf_gtpv2_tra_info_ggsn_mbms;
259 static int hf_gtpv2_tra_info_bm_sc;
260 static int hf_gtpv2_tra_info_mme_sgw_ss;
261 static int hf_gtpv2_tra_info_mme_sgw_sr;
262 static int hf_gtpv2_tra_info_mme_sgw_iataud;
263 static int hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc;
264 static int hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del;
265 static int hf_gtpv2_tra_info_mme_sgw_ho;
266 static int hf_gtpv2_tra_info_sgw_pdn_con_creat;
267 static int hf_gtpv2_tra_info_sgw_pdn_con_term;
268 static int hf_gtpv2_tra_info_sgw_bearer_act_mod_del;
269 static int hf_gtpv2_tra_info_pgw_pdn_con_creat;
270 static int hf_gtpv2_tra_info_pgw_pdn_con_term;
271 static int hf_gtpv2_tra_info_pgw_bearer_act_mod_del;
272 static int hf_gtpv2_tra_info_lne_msc_s;
273 static int hf_gtpv2_tra_info_lne_mgw;
274 static int hf_gtpv2_tra_info_lne_sgsn;
275 static int hf_gtpv2_tra_info_lne_ggsn;
276 static int hf_gtpv2_tra_info_lne_rnc;
277 static int hf_gtpv2_tra_info_lne_bm_sc;
278 static int hf_gtpv2_tra_info_lne_mme;
279 static int hf_gtpv2_tra_info_lne_sgw;
280 static int hf_gtpv2_tra_info_lne_pdn_gw;
281 static int hf_gtpv2_tra_info_lne_enb;
282 static int hf_gtpv2_tra_info_lne_amf;
283 static int hf_gtpv2_tra_info_lne_smf;
284 static int hf_gtpv2_tra_info_lne_pcf;
285 static int hf_gtpv2_tra_info_lne_upf;
286 static int hf_gtpv2_tra_info_tra_info_ng_ran_node;
287 static int hf_gtpv2_tra_info_tdl;
288 static int hf_gtpv2_tra_info_lmsc_a;
289 static int hf_gtpv2_tra_info_lmsc_lu;
290 static int hf_gtpv2_tra_info_lmsc_mc;
291 static int hf_gtpv2_tra_info_lmsc_map_g;
292 static int hf_gtpv2_tra_info_lmsc_map_b;
293 static int hf_gtpv2_tra_info_lmsc_map_e;
294 static int hf_gtpv2_tra_info_lmsc_map_f;
295 static int hf_gtpv2_tra_info_lmsc_cap;
296 static int hf_gtpv2_tra_info_lmsc_map_d;
297 static int hf_gtpv2_tra_info_lmsc_map_c;
298 static int hf_gtpv2_tra_info_lmgw_mc;
299 static int hf_gtpv2_tra_info_lmgw_nb_up;
300 static int hf_gtpv2_tra_info_lmgw_lu_up;
301 static int hf_gtpv2_tra_info_lsgsn_gb;
302 static int hf_gtpv2_tra_info_lsgsn_lu;
303 static int hf_gtpv2_tra_info_lsgsn_gn;
304 static int hf_gtpv2_tra_info_lsgsn_map_gr;
305 static int hf_gtpv2_tra_info_lsgsn_map_gd;
306 static int hf_gtpv2_tra_info_lsgsn_map_gf;
307 static int hf_gtpv2_tra_info_lsgsn_gs;
308 static int hf_gtpv2_tra_info_lsgsn_ge;
309 static int hf_gtpv2_tra_info_lggsn_gn;
310 static int hf_gtpv2_tra_info_lggsn_gi;
311 static int hf_gtpv2_tra_info_lggsn_gmb;
312 static int hf_gtpv2_tra_info_lrnc_lu;
313 static int hf_gtpv2_tra_info_lrnc_lur;
314 static int hf_gtpv2_tra_info_lrnc_lub;
315 static int hf_gtpv2_tra_info_lrnc_uu;
316 static int hf_gtpv2_tra_info_lbm_sc_gmb;
317 static int hf_gtpv2_tra_info_lmme_s1_mme;
318 static int hf_gtpv2_tra_info_lmme_s3;
319 static int hf_gtpv2_tra_info_lmme_s6a;
320 static int hf_gtpv2_tra_info_lmme_s10;
321 static int hf_gtpv2_tra_info_lmme_s11;
322 static int hf_gtpv2_tra_info_lsgw_s4;
323 static int hf_gtpv2_tra_info_lsgw_s5;
324 static int hf_gtpv2_tra_info_lsgw_s8b;
325 static int hf_gtpv2_tra_info_lsgw_s11;
326 static int hf_gtpv2_tra_info_lpdn_gw_s2a;
327 static int hf_gtpv2_tra_info_lpdn_gw_s2b;
328 static int hf_gtpv2_tra_info_lpdn_gw_s2c;
329 static int hf_gtpv2_tra_info_lpdn_gw_s5;
330 static int hf_gtpv2_tra_info_lpdn_gw_s6c;
331 static int hf_gtpv2_tra_info_lpdn_gw_gx;
332 static int hf_gtpv2_tra_info_lpdn_gw_s8b;
333 static int hf_gtpv2_tra_info_lpdn_gw_sgi;
334 static int hf_gtpv2_tra_info_lenb_s1_mme;
335 static int hf_gtpv2_tra_info_lenb_x2;
336 static int hf_gtpv2_tra_info_lenb_uu;
338 static int hf_gtpv2_ti;
340 static int hf_gtpv2_bearer_qos_pci;
341 static int hf_gtpv2_bearer_qos_pl;
342 static int hf_gtpv2_bearer_qos_pvi;
343 static int hf_gtpv2_bearer_qos_label_qci;
344 static int hf_gtpv2_bearer_qos_mbr_up;
345 static int hf_gtpv2_bearer_qos_mbr_down;
346 static int hf_gtpv2_bearer_qos_gbr_up;
347 static int hf_gtpv2_bearer_qos_gbr_down;
348 static int hf_gtpv2_flow_qos_label_qci;
349 static int hf_gtpv2_flow_qos_mbr_up;
350 static int hf_gtpv2_flow_qos_mbr_down;
351 static int hf_gtpv2_flow_qos_gbr_up;
352 static int hf_gtpv2_flow_qos_gbr_down;
354 static int hf_gtpv2_delay_value;
355 static int hf_gtpv2_charging_id;
356 static int hf_gtpv2_charging_characteristic;
357 static int hf_gtpv2_bearer_flag_ppc;
358 static int hf_gtpv2_bearer_flag_vb;
359 static int hf_gtpv2_ue_time_zone_dst;
360 static int hf_gtpv2_fq_csid_type;
361 static int hf_gtpv2_fq_csid_nr;
362 static int hf_gtpv2_fq_csid_ipv4;
363 static int hf_gtpv2_fq_csid_ipv6;
364 static int hf_gtpv2_fq_csid_id;
365 static int hf_gtpv2_complete_req_msg_type;
366 static int hf_gtpv2_mme_grp_id;
367 static int hf_gtpv2_mme_code;
368 static int hf_gtpv2_m_tmsi;
369 static int hf_gtpv2_container_type;
370 static int hf_gtpv2_cause_type;
371 static int hf_gtpv2_CauseRadioNetwork;
372 static int hf_gtpv2_CauseTransport;
373 static int hf_gtpv2_CauseNas;
374 static int hf_gtpv2_CauseProtocol;
375 static int hf_gtpv2_CauseMisc;
376 static int hf_gtpv2_target_type;
377 static int hf_gtpv2_macro_enodeb_id;
378 static int hf_gtpv2_smenb;
379 static int hf_gtpv2_ext_macro_enodeb_id;
380 static int hf_gtpv2_ext_macro_ng_enodeb_id;
381 static int hf_gtpv2_enodebid;
382 static int hf_gtpv2_cellid;
384 static int hf_gtpv2_node_type;
385 static int hf_gtpv2_fqdn;
386 static int hf_gtpv2_enterprise_id;
387 static int hf_gtpv2_apn_rest;
388 static int hf_gtpv2_pti;
389 static int hf_gtpv2_mm_context_sm;
390 static int hf_gtpv2_mm_context_nhi;
391 static int hf_gtpv2_mm_context_drxi;
392 static int hf_gtpv2_mm_context_cksn;
393 static int hf_gtpv2_mm_context_cksn_ksi;
394 static int hf_gtpv2_mm_context_kasme;
395 static int hf_gtpv2_mm_context_rand;
396 static int hf_gtpv2_mm_context_xres_len;
397 static int hf_gtpv2_mm_context_xres;
398 static int hf_gtpv2_mm_context_autn_len;
399 static int hf_gtpv2_mm_context_autn;
400 static int hf_gtpv2_mm_context_drx;
401 static int hf_gtpv2_mm_context_ue_net_cap_len;
402 static int hf_gtpv2_mm_context_ms_net_cap_len;
403 static int hf_gtpv2_mm_context_mei_len;
404 static int hf_gtpv2_mm_context_vdp_len;
405 static int hf_gtpv2_mm_contex_nhi_old;
406 static int hf_gtpv2_mm_context_old_ksiasme;
407 static int hf_gtpv2_mm_context_old_ncc;
408 static int hf_gtpv2_mm_context_old_kasme;
409 static int hf_gtpv2_mm_context_old_nh;
410 static int hf_gtpv2_mm_context_higher_br_16mb_flg_len;
411 static int hf_gtpv2_mm_context_higher_br_16mb_flg;
412 static int hf_gtpv2_vdp_length;
413 static int hf_gtpv2_mm_context_paging_len;
414 static int hf_gtpv2_mm_context_ex_access_res_data_len;
415 static int hf_gtpv2_mm_context_ue_add_sec_cap_len;
416 static int hf_gtpv2_mm_context_ue_nr_sec_cap_len;
417 static int hf_gtpv2_mm_context_apn_rte_ctrl_sts_len;
418 static int hf_gtpv2_mm_context_cnr_len;
419 static int hf_gtpv2_mm_context_ue_radio_cap_len;
420 static int hf_gtpv2_uci_csg_id;
421 static int hf_gtpv2_uci_csg_id_spare;
422 static int hf_gtpv2_uci_access_mode;
423 static int hf_gtpv2_uci_lcsg;
424 static int hf_gtpv2_uci_csg_membership;
426 static int hf_gtpv2_una;
427 static int hf_gtpv2_gena;
428 static int hf_gtpv2_gana;
429 static int hf_gtpv2_ina;
430 static int hf_gtpv2_ena;
431 static int hf_gtpv2_hnna;
432 static int hf_gtpv2_hbna;
433 static int hf_gtpv2_mm_context_ksi_a;
434 static int hf_gtpv2_mm_context_ksi;
435 static int hf_gtpv2_mm_context_nr_tri;
436 static int hf_gtpv2_mm_context_used_cipher;
437 static int hf_gtpv2_mm_context_nr_qui;
438 static int hf_gtpv2_mm_context_nr_qua;
439 static int hf_gtpv2_mm_context_uamb_ri;
440 static int hf_gtpv2_mm_context_osci;
441 static int hf_gtpv2_mm_context_nruna;
442 static int hf_gtpv2_mm_context_nrusrna;
443 static int hf_gtpv2_mm_context_nrna;
444 static int hf_gtpv2_mm_context_ussrna;
445 static int hf_gtpv2_mm_context_nrsrna;
446 static int hf_gtpv2_mm_context_ensct;
448 static int hf_gtpv2_mm_context_samb_ri;
449 static int hf_gtpv2_mm_context_unipa;
450 static int hf_gtpv2_mm_context_unc;
451 static int hf_gtpv2_mm_context_nas_dl_cnt;
452 static int hf_gtpv2_mm_context_nas_ul_cnt;
454 static int hf_gtpv2_uli_cgi_lac;
455 static int hf_gtpv2_uli_cgi_ci;
456 static int hf_gtpv2_sai_lac;
457 static int hf_gtpv2_sai_sac;
458 static int hf_gtpv2_rai_lac;
459 static int hf_gtpv2_rai_rac;
460 static int hf_gtpv2_tai_tac;
461 static int hf_gtpv2_5gs_tai_tac;
462 static int hf_gtpv2_ecgi_eci;
463 static int hf_gtpv2_ncgi_nrci;
464 static int hf_gtpv2_uli_lai_lac;
465 static int hf_gtpv2_ecgi_eci_spare;
466 static int hf_gtpv2_nsapi;
467 static int hf_gtpv2_bearer_control_mode;
469 static int hf_gtpv2_bss_container_phx;
470 static int hf_gtpv2_bss_con_sapi_flg;
471 static int hf_gtpv2_bss_con_rp_flg;
472 static int hf_gtpv2_bss_con_pfi_flg;
473 static int hf_gtpv2_bss_con_pfi;
474 static int hf_gtpv2_bss_con_rp;
475 static int hf_gtpv2_bss_con_sapi;
476 static int hf_gtpv2_bss_con_xid_len;
477 static int hf_gtpv2_bss_con_xid;
478 static int hf_gtpv2_home_enodeb_id;
479 static int hf_gtpv2_tac;
481 /* MBMS */
482 static int hf_gtpv2_mbms_service_area_nr;
483 static int hf_gtpv2_mbms_service_area_id;
484 static int hf_gtpv2_mbms_session_id;
485 static int hf_gtpv2_mbms_flow_id;
486 static int hf_gtpv2_cteid;
487 static int hf_gtpv2_ip_addr_type;
488 static int hf_gtpv2_ip_addr_len;
489 static int hf_gtpv2_mbms_ip_mc_dist_addrv4;
490 static int hf_gtpv2_mbms_ip_mc_dist_addrv6;
491 static int hf_gtpv2_mbms_ip_mc_src_addrv4;
492 static int hf_gtpv2_mbms_ip_mc_src_addrv6;
493 static int hf_gtpv2_mbms_hc_indicator;
494 static int hf_gtpv2_mbms_dist_indication;
495 static int hf_gtpv2_subscriber_rfsp;
496 static int hf_gtpv2_rfsp_inuse;
497 static int hf_gtpv2_mbms_service_id;
498 static int hf_gtpv2_add_flags_for_srvcc_ics;
499 static int hf_gtpv2_vsrvcc_flag;
500 static int hf_gtpv2_abs_time_mbms_data;
501 static int hf_gtpv2_henb_info_report_fti;
502 static int hf_gtpv2_ip4cp_subnet_prefix_len;
503 static int hf_gtpv2_ip4cp_ipv4;
504 static int hf_gtpv2_change_report_flags_sncr;
505 static int hf_gtpv2_change_report_flags_tzcr;
506 static int hf_gtpv2_action_indication_val;
507 static int hf_gtpv2_uli_timestamp;
508 static int hf_gtpv2_mbms_session_duration_days;
509 static int hf_gtpv2_mbms_session_duration_secs;
510 static int hf_gtpv2_csg_id;
511 static int hf_gtpv2_cmi;
512 static int hf_gtpv2_service_indicator;
513 static int hf_gtpv2_detach_type;
514 static int hf_gtpv2_ldn;
515 static int hf_gtpv2_node_features_prn;
516 static int hf_gtpv2_node_features_mabr;
517 static int hf_gtpv2_node_features_ntsr;
518 static int hf_gtpv2_node_features_ciot;
519 static int hf_gtpv2_node_features_s1un;
520 static int hf_gtpv2_node_features_eth;
521 static int hf_gtpv2_node_features_mtedt;
522 static int hf_gtpv2_node_features_psset;
523 static int hf_gtpv2_time_to_data_xfer;
524 static int hf_gtpv2_arp_pvi;
525 static int hf_gtpv2_arp_pl;
526 static int hf_gtpv2_arp_pci;
527 static int hf_gtpv2_timer_unit;
528 static int hf_gtpv2_throttling_delay_unit;
529 static int hf_gtpv2_throttling_delay_value;
530 static int hf_gtpv2_timer_value;
531 static int hf_gtpv2_lapi;
533 static int hf_gtpv2_pres_rep_area_act_inapra;
534 static int hf_gtpv2_pres_rep_area_action;
535 static int hf_gtpv2_pres_rep_area_id;
536 static int hf_gtpv2_pres_rep_area_act_no_tai;
537 static int hf_gtpv2_pres_rep_area_act_no_rai;
538 static int hf_gtpv2_pres_rep_area_act_no_m_enodeb;
539 static int hf_gtpv2_pres_rep_area_act_no_h_enodeb;
540 static int hf_gtpv2_pres_rep_area_act_no_ecgi;
541 static int hf_gtpv2_pres_rep_area_act_no_sai;
542 static int hf_gtpv2_pres_rep_area_act_no_cgi;
543 static int hf_gtpv2_pres_rep_area_act_no_ext_m_enodeb;
544 static int hf_gtpv2_ksi_ps;
545 static int hf_gtpv2_ck_ps;
546 static int hf_gtpv2_ik_ps;
547 static int hf_gtpv2_kc_ps;
548 static int hf_gtpv2_cksn_ps;
550 static int hf_gtpv2_pres_rep_area_info_id;
551 static int hf_gtpv2_pres_rep_area_info_additional_id;
552 static int hf_gtpv2_pres_rep_area_info_flags;
553 static int hf_gtpv2_pres_rep_area_info_flags_no_inapra;
554 static int hf_gtpv2_pres_rep_area_info_flags_b4_b7_spare;
555 static int hf_gtpv2_pres_rep_area_info_flags_b3_b7_spare;
556 static int hf_gtpv2_pres_rep_area_info_flags_b3_inapra;
557 static int hf_gtpv2_pres_rep_area_info_flags_b2_apra;
558 static int hf_gtpv2_pres_rep_area_info_flags_b1_opra;
559 static int hf_gtpv2_pres_rep_area_info_flags_b0_ipra;
561 /* Generated from convert_proto_tree_add_text.pl */
562 static int hf_gtpv2_downlink_subscribed_ue_ambr;
563 static int hf_gtpv2_mm_context_sres;
564 static int hf_gtpv2_iksrvcc;
565 static int hf_gtpv2_nsapi08;
566 static int hf_gtpv2_voice_domain_and_ue_usage_setting;
567 static int hf_gtpv2_ue_radio_capability_for_paging_information;
568 static int hf_gtpv2_port_number;
569 static int hf_gtpv2_uplink_used_ue_ambr;
570 static int hf_gtpv2_tmsi_bytes;
571 static int hf_gtpv2_dl_gtp_u_sequence_number;
572 static int hf_gtpv2_mm_context_nh;
573 static int hf_gtpv2_teid_c_spare;
574 static int hf_gtpv2_uplink_subscribed_ue_ambr;
575 static int hf_gtpv2_transparent_container;
576 static int hf_gtpv2_packet_flow_id;
577 static int hf_gtpv2_utran_srvcc_ik_cs;
578 static int hf_gtpv2_downlink_used_ue_ambr;
579 static int hf_gtpv2_hop_counter;
580 static int hf_gtpv2_ul_gtp_u_sequence_number;
581 static int hf_gtpv2_authentication_quadruplets;
582 static int hf_gtpv2_utran_srvcc_kc;
583 static int hf_gtpv2_spare_bytes;
584 static int hf_gtpv2_metric;
585 static int hf_gtpv2_throttling_factor;
586 static int hf_gtpv2_relative_capacity;
587 static int hf_gtpv2_apn_length;
588 static int hf_gtpv2_sequence_number;
589 static int hf_gtpv2_receive_n_pdu_number;
590 static int hf_gtpv2_trace_id;
591 static int hf_gtpv2_drx_parameter;
592 static int hf_gtpv2_charging_characteristic_remaining_octets;
593 static int hf_gtpv2_mm_context_ncc;
594 static int hf_gtpv2_proprietary_value;
595 static int hf_gtpv2_mobile_station_classmark2;
596 static int hf_gtpv2_rrc_container;
597 static int hf_gtpv2_send_n_pdu_number;
598 static int hf_gtpv2_mobile_station_classmark3;
599 static int hf_gtpv2_eps_bearer_id_number;
600 static int hf_gtpv2_geographic_location;
601 static int hf_gtpv2_cn_id;
602 static int hf_gtpv2_utran_srvcc_ck_cs;
603 static int hf_gtpv2_authentication_quintuplets;
604 static int hf_gtpv2_serving_gw_address_length;
605 static int hf_gtpv2_supported_codec_list;
606 static int hf_gtpv2_cksrvcc;
607 static int hf_gtpv2_mm_context_kc;
608 static int hf_gtpv2_dl_pdcp_sequence_number;
609 static int hf_gtpv2_ul_pdcp_sequence_number;
610 static int hf_gtpv2_fq_csid_node_id;
611 static int hf_gtpv2_fq_csid_mcc_mnc;
612 static int hf_gtpv2_ppi_value;
613 static int hf_gtpv2_ppi_flag;
614 static int hf_gtpv2_session;
615 static int hf_gtpv2_twan_id_ts;
616 static int hf_gtpv2_twan_flags;
617 static int hf_gtpv2_twan_bssidi;
618 static int hf_gtpv2_twan_civai;
619 static int hf_gtpv2_twan_plmni;
620 static int hf_gtpv2_twan_opnai;
621 static int hf_gtpv2_twan_laii;
622 static int hf_gtpv2_twan_ssid_len;
623 static int hf_gtpv2_twan_ssid;
624 static int hf_gtpv2_twan_bssid;
625 static int hf_gtpv2_twan_civa_len;
626 static int hf_gtpv2_twan_civa;
627 static int hf_gtpv2_twan_plmnid;
628 static int hf_gtpv2_twan_op_name_len;
629 static int hf_gtpv2_twan_op_name;
630 static int hf_gtpv2_twan_relay_id_type;
631 static int hf_gtpv2_twan_relay_id_len;
632 static int hf_gtpv2_twan_relay_id;
633 static int hf_gtpv2_twan_relay_id_ipv4;
634 static int hf_gtpv2_twan_relay_id_ipv6;
635 static int hf_gtpv2_twan_circuit_id_len;
636 static int hf_gtpv2_twan_circuit_id;
637 static int hf_gtpv2_integer_number_val;
638 static int hf_gtpv2_maximum_wait_time;
639 static int hf_gtpv2_dl_buf_sug_pkt_cnt;
640 static int hf_gtpv2_ue_usage_type;
641 static int hf_gtpv2_rem_run_serv_gap_t;
642 static int hf_gtpv2_ran_nas_protocol_type;
643 static int hf_gtpv2_ran_nas_cause_type;
644 static int hf_gtpv2_ran_nas_cause_value;
645 static int hf_gtpv2_emm_cause;
646 static int hf_gtpv2_esm_cause;
647 static int hf_gtpv2_diameter_cause;
648 static int hf_gtpv2_ikev2_cause;
650 static int hf_gtpv2_ciot_support_ind;
651 static int hf_gtpv2_ciot_support_ind_spare_bits;
652 static int hf_gtpv2_ciot_support_ind_bit4;
653 static int hf_gtpv2_ciot_support_ind_bit3;
654 static int hf_gtpv2_ciot_support_ind_bit2;
655 static int hf_gtpv2_ciot_support_ind_bit1;
657 static int hf_gtpv2_length_of_node_name;
658 static int hf_gtpv2_node_name;
659 static int hf_gtpv2_length_of_node_realm;
660 static int hf_gtpv2_node_realm;
661 static int hf_gtpv2_ms_ts;
662 static int hf_gtpv2_origination_ts;
663 static int hf_gtpv2_mon_event_inf_nsur;
664 static int hf_gtpv2_mon_event_inf_nsui;
665 static int hf_gtpv2_mon_event_inf_nscf;
666 static int hf_gtpv2_mon_event_inf_srie;
667 static int hf_gtpv2_mon_event_inf_scef_reference_id;
668 static int hf_gtpv2_mon_event_inf_scef_reference_id_ext;
669 static int hf_gtpv2_mon_event_inf_scef_id_length;
670 static int hf_gtpv2_mon_event_inf_scef_id;
671 static int hf_gtpv2_mon_event_inf_remaining_number_of_reports;
672 static int hf_gtpv2_mon_event_ext_inf_lrtp;
673 static int hf_gtpv2_mon_event_ext_inf_srie;
674 static int hf_gtpv2_mon_event_ext_inf_scef_reference_id;
675 static int hf_gtpv2_mon_event_ext_inf_scef_id_length;
676 static int hf_gtpv2_mon_event_ext_inf_scef_id;
677 static int hf_gtpv2_mon_event_ext_inf_remain_min_period_loc_report_type;
678 static int hf_gtpv2_mon_event_ext_inf_scef_reference_id_ext;
679 static int hf_gtpv2_rohc_profiles_bit0;
680 static int hf_gtpv2_rohc_profiles_bit1;
681 static int hf_gtpv2_rohc_profiles_bit2;
682 static int hf_gtpv2_rohc_profiles_bit3;
683 static int hf_gtpv2_rohc_profiles_bit4;
684 static int hf_gtpv2_rohc_profiles_bit5;
685 static int hf_gtpv2_rohc_profiles_bit6;
686 static int hf_gtpv2_rohc_profiles_bit7;
687 static int hf_gtpv2_max_cid;
688 static int hf_gtpv2_uplink_rate_limit;
689 static int hf_gtpv2_downlink_rate_limit;
690 static int hf_gtpv2_timestamp_value;
691 static int hf_gtpv2_counter_value;
692 static int hf_gtpv2_mapped_ue_usage_type;
693 static int hf_gtpv2_uli_flags;
694 static int hf_gtpv2_rohc_profile_flags;
695 static int hf_gtpv2_dcnr;
697 static int hf_gtpv2_secondary_rat_usage_data_report;
698 static int hf_gtpv2_secondary_rat_usage_data_report_spare_bits;
699 static int hf_gtpv2_secondary_rat_usage_data_report_bit3;
700 static int hf_gtpv2_secondary_rat_usage_data_report_bit2;
701 static int hf_gtpv2_secondary_rat_usage_data_report_bit1;
702 static int hf_gtpv2_secondary_rat_usage_data_report_rat_type;
703 static int hf_gtpv2_secondary_rat_usage_data_report_start_timestamp;
704 static int hf_gtpv2_secondary_rat_usage_data_report_end_timestamp;
705 static int hf_gtpv2_secondary_rat_usage_data_report_usage_data_dl;
706 static int hf_gtpv2_secondary_rat_usage_data_report_usage_data_ul;
707 static int hf_gtpv2_secondary_rat_usage_data_report_srudn_length;
708 static int hf_gtpv2_secondary_rat_usage_data_report_srudn_value;
709 static int hf_gtpv2_csg_info_rep_action_b0;
710 static int hf_gtpv2_csg_info_rep_action_b1;
711 static int hf_gtpv2_csg_info_rep_action_b2;
712 static int hf_gtpv2_gnodeb_id_len;
713 static int hf_gtpv2_gnodeb_id;
714 static int hf_gtpv2_macro_ng_enodeb_id;
715 static int hf_gtpv2_5gs_tac;
716 static int hf_gtpv2_en_gnb_id_len;
717 static int hf_gtpv2_5tac;
718 static int hf_gtpv2_etac;
719 static int hf_gtpv2_en_gnb_id;
720 static int hf_gtpv2_trig_event_len;
721 static int hf_gtpv2_ne_list_len;
722 static int hf_gtpv2_ses_trs_depth;
723 static int hf_gtpv2_list_of_if_len;
724 static int hf_gtpv2_trs_coll_ip_addr_len;
725 static int hf_gtpv2_trs_coll_ipv4_addr;
726 static int hf_gtpv2_trs_coll_ipv6_addr;
728 static int hf_gtpv2_ext_tra_info_loi_mscs_cap;
729 static int hf_gtpv2_ext_tra_info_loi_mscs_map_f;
730 static int hf_gtpv2_ext_tra_info_loi_mscs_map_e;
731 static int hf_gtpv2_ext_tra_info_loi_mscs_map_b;
732 static int hf_gtpv2_ext_tra_info_loi_mscs_map_g;
733 static int hf_gtpv2_ext_tra_info_loi_mscs_mc;
734 static int hf_gtpv2_ext_tra_info_loi_mscs_iu;
735 static int hf_gtpv2_ext_tra_info_loi_mscs_a;
736 static int hf_gtpv2_ext_tra_info_loi_mscs_map_c;
737 static int hf_gtpv2_ext_tra_info_loi_mscs_map_d;
738 static int hf_gtpv2_ext_tra_info_loi_mgw_iuup;
739 static int hf_gtpv2_ext_tra_info_loi_mgw_nbup;
740 static int hf_gtpv2_ext_tra_info_loi_mgw_mc;
741 static int hf_gtpv2_ext_tra_info_loi_sgsn_ge;
742 static int hf_gtpv2_ext_tra_info_loi_sgsn_gs;
743 static int hf_gtpv2_ext_tra_info_loi_sgsn_map_gf;
744 static int hf_gtpv2_ext_tra_info_loi_sgsn_map_gd;
745 static int hf_gtpv2_ext_tra_info_loi_sgsn_map_gr;
746 static int hf_gtpv2_ext_tra_info_loi_sgsn_gn;
747 static int hf_gtpv2_ext_tra_info_loi_sgsn_iu;
748 static int hf_gtpv2_ext_tra_info_loi_sgsn_gb;
749 static int hf_gtpv2_ext_tra_info_loi_sgsn_s13;
750 static int hf_gtpv2_ext_tra_info_loi_sgsn_s3;
751 static int hf_gtpv2_ext_tra_info_loi_sgsn_s4;
752 static int hf_gtpv2_ext_tra_info_loi_sgsn_s6d;
753 static int hf_gtpv2_ext_tra_info_loi_ggsn_gmb;
754 static int hf_gtpv2_ext_tra_info_loi_ggsn_gi;
755 static int hf_gtpv2_ext_tra_info_loi_ggsn_gn;
756 static int hf_gtpv2_ext_tra_info_loi_rnc_uu;
757 static int hf_gtpv2_ext_tra_info_loi_rnc_iub;
758 static int hf_gtpv2_ext_tra_info_loi_rnc_iur;
759 static int hf_gtpv2_ext_tra_info_loi_rnc_iu;
760 static int hf_gtpv2_ext_tra_info_loi_bm_sc_gmb;
761 static int hf_gtpv2_ext_tra_info_loi_mme_s13;
762 static int hf_gtpv2_ext_tra_info_loi_mme_s11;
763 static int hf_gtpv2_ext_tra_info_loi_mme_s10;
764 static int hf_gtpv2_ext_tra_info_loi_mme_s6a;
765 static int hf_gtpv2_ext_tra_info_loi_mme_s3;
766 static int hf_gtpv2_ext_tra_info_loi_mme_s1_mme;
767 static int hf_gtpv2_ext_tra_info_loi_sgw_gxc;
768 static int hf_gtpv2_ext_tra_info_loi_sgw_s11;
769 static int hf_gtpv2_ext_tra_info_loi_sgw_s8b;
770 static int hf_gtpv2_ext_tra_info_loi_sgw_s5;
771 static int hf_gtpv2_ext_tra_info_loi_sgw_s4;
772 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_sgi;
773 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s8b;
774 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_gx;
775 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s6b;
776 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s5;
777 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s2c;
778 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s2b;
779 static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s2a;
780 static int hf_gtpv2_ext_tra_info_loi_enb_uu;
781 static int hf_gtpv2_ext_tra_info_loi_enb_x2;
782 static int hf_gtpv2_ext_tra_info_loi_enb_s1_mme;
783 static int hf_gtpv2_ext_tra_info_loi_hss_sh;
784 static int hf_gtpv2_ext_tra_info_loi_hss_s6a;
785 static int hf_gtpv2_ext_tra_info_loi_hss_s6d;
786 static int hf_gtpv2_ext_tra_info_loi_hss_cx;
787 static int hf_gtpv2_ext_tra_info_loi_hss_map_gr;
788 static int hf_gtpv2_ext_tra_info_loi_hss_map_gc;
789 static int hf_gtpv2_ext_tra_info_loi_hss_map_d;
790 static int hf_gtpv2_ext_tra_info_loi_hss_map_c;
791 static int hf_gtpv2_ext_tra_info_loi_eir_map_gf;
792 static int hf_gtpv2_ext_tra_info_loi_eir_s13p;
793 static int hf_gtpv2_ext_tra_info_loi_eir_s13;
794 static int hf_gtpv2_ext_tra_info_loi_eir_map_f;
795 static int hf_gtpv2_ext_tra_info_loi_amf_n20;
796 static int hf_gtpv2_ext_tra_info_loi_amf_n15;
797 static int hf_gtpv2_ext_tra_info_loi_amf_n14;
798 static int hf_gtpv2_ext_tra_info_loi_amf_n12;
799 static int hf_gtpv2_ext_tra_info_loi_amf_n11;
800 static int hf_gtpv2_ext_tra_info_loi_amf_n8;
801 static int hf_gtpv2_ext_tra_info_loi_amf_n2;
802 static int hf_gtpv2_ext_tra_info_loi_amf_n1;
803 static int hf_gtpv2_ext_tra_info_loi_amf_n22;
804 static int hf_gtpv2_ext_tra_info_loi_amf_n26;
805 static int hf_gtpv2_ext_tra_info_loi_pcf_n15;
806 static int hf_gtpv2_ext_tra_info_loi_pcf_n7;
807 static int hf_gtpv2_ext_tra_info_loi_pcf_n5;
808 static int hf_gtpv2_ext_tra_info_loi_smf_s5_c;
809 static int hf_gtpv2_ext_tra_info_loi_smf_n11;
810 static int hf_gtpv2_ext_tra_info_loi_smf_n10;
811 static int hf_gtpv2_ext_tra_info_loi_smf_n7;
812 static int hf_gtpv2_ext_tra_info_loi_smf_n4;
813 static int hf_gtpv2_ext_tra_info_loi_upf_n4;
814 static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_e1_c;
815 static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_f1_c;
816 static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_Uu;
817 static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_xn_c;
818 static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_ng_c;
820 static int hf_gtpv2_nr_dl_pkts_all;
821 static int hf_gtpv2_nr_ul_pkts_all;
822 static int hf_gtpv2_nr_add_exception_rpts;
823 static int hf_apn_rte_cntrl_status_val_time;
824 static int hf_gtpv2_max_pkt_loss_rte_ul_flg;
825 static int hf_gtpv2_max_pkt_loss_rte_dl_flg;
826 static int hf_gtpv2_max_pkt_loss_rte_ul;
827 static int hf_gtpv2_max_pkt_loss_rte_dl;
829 static int hf_gtpv2_mm_context_iov_updates_counter;
830 static int hf_gtpv2_mm_context_ear_len;
831 static int hf_gtpv2_node_number_len;
832 static int hf_gtpv2_additional_rrm_policy_index;
834 static int hf_gtpv2_group_id;
836 static int hf_gtpv2_ie_pscell_id_spare;
837 static int hf_gtpv2_ie_pscell_id_nr_cgi;
838 static int hf_gtpv2_ie_up_security_policy_up_ip_policy;
839 static int hf_gtpv2_ie_up_security_policy_spare;
840 static int hf_gtpv2_nf_instance_id_nf_instance_id;
841 static int hf_gtpv2_nf_timer_in_seconds_timer_value;
844 static int ett_gtpv2;
845 static int ett_gtpv2_flags;
846 static int ett_gtpv2_uli_flags;
847 static int ett_gtpv2_uli_field;
848 static int ett_gtpv2_bearer_ctx;
849 static int ett_gtpv2_PDN_conn;
850 static int ett_gtpv2_overload_control_information;
851 static int ett_gtpv2_mm_context_flag;
852 static int ett_gtpv2_pdn_numbers_nsapi;
853 static int ett_gtpv2_tra_info_trigg;
854 static int ett_gtpv2_tra_info_trigg_msc_server;
855 static int ett_gtpv2_tra_info_trigg_mgw;
856 static int ett_gtpv2_tra_info_trigg_sgsn;
857 static int ett_gtpv2_tra_info_trigg_ggsn;
858 static int ett_gtpv2_tra_info_trigg_bm_sc;
859 static int ett_gtpv2_tra_info_trigg_sgw_mme;
860 static int ett_gtpv2_tra_info_trigg_sgw;
861 static int ett_gtpv2_tra_info_trigg_pgw;
862 static int ett_gtpv2_tra_info_interfaces;
863 static int ett_gtpv2_tra_info_interfaces_imsc_server;
864 static int ett_gtpv2_tra_info_interfaces_lmgw;
865 static int ett_gtpv2_tra_info_interfaces_lsgsn;
866 static int ett_gtpv2_tra_info_interfaces_lggsn;
867 static int ett_gtpv2_tra_info_interfaces_lrnc;
868 static int ett_gtpv2_tra_info_interfaces_lbm_sc;
869 static int ett_gtpv2_tra_info_interfaces_lmme;
870 static int ett_gtpv2_tra_info_interfaces_lsgw;
871 static int ett_gtpv2_tra_info_interfaces_lpdn_gw;
872 static int ett_gtpv2_tra_info_interfaces_lpdn_lenb;
873 static int ett_gtpv2_tra_info_ne_types;
874 static int ett_gtpv2_rai;
875 static int ett_gtpv2_ms_mark;
876 static int ett_gtpv2_stn_sr;
877 static int ett_gtpv2_supp_codec_list;
878 static int ett_gtpv2_bss_con;
879 static int ett_gtpv2_utran_con;
880 static int ett_gtpv2_eutran_con;
881 static int ett_gtpv2_son_con;
882 static int ett_gtpv2_endc_son_con;
883 static int ett_gtpv2_intersys_son_con;
884 static int ett_gtpv2_mm_context_auth_qua;
885 static int ett_gtpv2_mm_context_auth_qui;
886 static int ett_gtpv2_mm_context_auth_tri;
887 static int ett_gtpv2_mm_context_net_cap;
888 static int ett_gtpv2_ms_network_capability;
889 static int ett_gtpv2_mm_context_sc;
890 static int ett_gtpv2_vd_pref;
891 static int ett_gtpv2_access_rest_data;
892 static int ett_gtpv2_qua;
893 static int ett_gtpv2_qui;
894 static int ett_gtpv2_preaa_tais;
895 static int ett_gtpv2_preaa_menbs;
896 static int ett_gtpv2_preaa_henbs;
897 static int ett_gtpv2_preaa_ecgis;
898 static int ett_gtpv2_preaa_rais;
899 static int ett_gtpv2_preaa_sais;
900 static int ett_gtpv2_preaa_cgis;
901 static int ett_gtpv2_load_control_inf;
902 static int ett_gtpv2_eci;
903 static int ett_gtpv2_twan_flags;
904 static int ett_gtpv2_ciot_support_ind;
905 static int ett_gtpv2_rohc_profile_flags;
906 static int ett_gtpv2_secondary_rat_usage_data_report;
907 static int ett_gtpv2_pres_rep_area_info;
908 static int ett_gtpv2_preaa_ext_menbs;
909 static int ett_gtpv2_ue_nr_sec_cap_len;
910 static int ett_gtpv2_apn_rte_ctrl_sts_len;
911 static int ett_gtpv2_if_mgcs;
912 static int ett_gtpv2_if_mgw;
913 static int ett_gtpv2_if_sgsn;
914 static int ett_gtpv2_if_ggsn;
915 static int ett_gtpv2_if_rnc;
916 static int ett_gtpv2_if_bm_sc;
917 static int ett_gtpv2_if_mme;
918 static int ett_gtpv2_if_sgw;
919 static int ett_gtpv2_if_pdn_gw;
920 static int ett_gtpv2_if_enb;
921 static int ett_gtpv2_if_hss;
922 static int ett_gtpv2_if_eir;
923 static int ett_gtpv2_if_amf;
924 static int ett_gtpv2_if_pcf;
925 static int ett_gtpv2_if_smf;
926 static int ett_gtpv2_if_upf;
927 static int ett_gtpv2_if_ng_ran_node;
928 static int ett_gtpv2_PGW_change_info;
931 static expert_field ei_gtpv2_ie_data_not_dissected;
932 static expert_field ei_gtpv2_ie_len_invalid;
933 static expert_field ei_gtpv2_source_type_unknown;
934 static expert_field ei_gtpv2_fq_csid_type_bad;
935 static expert_field ei_gtpv2_mbms_session_duration_days;
936 static expert_field ei_gtpv2_mbms_session_duration_secs;
937 static expert_field ei_gtpv2_ie;
938 static expert_field ei_gtpv2_int_size_not_handled;
939 static expert_field ei_gtpv2_apn_too_long;
941 static int gtpv2_tap;
943 /* Definition of User Location Info (AVP 22) masks */
944 #define GTPv2_ULI_CGI_MASK 0x01
945 #define GTPv2_ULI_SAI_MASK 0x02
946 #define GTPv2_ULI_RAI_MASK 0x04
947 #define GTPv2_ULI_TAI_MASK 0x08
948 #define GTPv2_ULI_ECGI_MASK 0x10
949 #define GTPv2_ULI_LAI_MASK 0x20
950 #define GTPv2_ULI_MACRO_eNB_ID_MASK 0x40
951 #define GTPv2_ULI_EXT_MACRO_eNB_ID_MASK 0x80
953 #define GTPV2_PPI_VAL_MASK 0x3F
955 #define GTPV2_SRVCC_PS_TO_CS_REQUEST 25
956 #define GTPV2_SRVCC_PS_TO_CS_RESPONSE 26
957 #define GTPV2_SRVCC_PS_TO_CS_COMPLETE_NOTIFICATION 27
958 #define GTPV2_SRVCC_PS_TO_CS_COMPLETE_ACKNOWLEDGE 28
959 #define GTPV2_SRVCC_PS_TO_CS_CANCEL_NOTIFICATION 29
960 #define GTPV2_SRVCC_PS_TO_CS_CANCEL_ACKNOWLEDGE 30
961 #define GTPV2_CREATE_SESSION_REQUEST 32
962 #define GTPV2_CREATE_SESSION_RESPONSE 33
963 #define GTPV2_MODIFY_BEARER_REQUEST 34
964 #define GTPV2_MODIFY_BEARER_RESPONSE 35
965 #define GTPV2_DELETE_SESSION_REQUEST 36
966 #define GTPV2_DELETE_SESSION_RESPONSE 37
967 #define GTPV2_REMOTE_UE_REPORT_NOTIFICATION 40
968 #define GTPV2_REMOTE_UE_REPORT_ACKNOWLEDGE 41
969 #define GTPV2_MODIFY_BEARER_COMMAND 64
970 #define GTPV2_MODIFY_BEARER_FAILURE_INDICATION 65
971 #define GTPV2_DELETE_BEARER_COMMAND 66
972 #define GTPV2_DELETE_BEARER_FAILURE_INDICATION 67
973 #define GTPV2_BEARER_RESOURCE_COMMAND 68
974 #define GTPV2_BEARER_RESOURCE_FAILURE_INDICATION 69
975 #define GTPV2_CREATE_BEARER_REQUEST 95
976 #define GTPV2_CREATE_BEARER_RESPONSE 96
977 #define GTPV2_UPDATE_BEARER_REQUEST 97
978 #define GTPV2_UPDATE_BEARER_RESPONSE 98
979 #define GTPV2_DELETE_BEARER_REQUEST 99
980 #define GTPV2_DELETE_BEARER_RESPONSE 100
981 #define GTPV2_IDENTIFICATION_RESPONSE 129
982 #define GTPV2_CONTEXT_REQUEST 130
983 #define GTPV2_CONTEXT_RESPONSE 131
984 #define GTPV2_CONTEXT_ACKNOWLEDGE 132
985 #define GTPV2_FORWARD_RELOCATION_REQ 133
986 #define GTPV2_FORWARD_RELOCATION_RESP 134
987 #define GTPV2_FORWARD_RELOCATION_COMPLETE_NOTIFICATION 135
988 #define GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE 136
989 #define GTPV2_FORWARD_CTX_NOTIFICATION 137
990 #define GTPV2_FORWARD_CTX_ACKNOWLEDGE 138
991 #define GTPV2_RELOCATION_CANCEL_REQUEST 139
992 #define GTPV2_RELOCATION_CANCEL_RESPONSE 140
993 #define GTPV2_CONFIGURATION_TRANSFER_TUNNEL 141
994 #define GTPV2_RAN_INFORMATION_RELAY 152
995 #define GTPV2_DL_DATA_NOTIF_ACK 177
996 #define GTPV2_MODIFY_ACESSS_BEARER_REQUEST 211
997 #define GTPV2_MODIFY_ACCESS_BEARER_RESPONSE 212
999 /* Table 6.1-1: Message types for GTPv2 */
1000 static const value_string gtpv2_message_type_vals[] = {
1001 { 0, "Reserved"},
1002 { 1, "Echo Request"},
1003 { 2, "Echo Response"},
1004 { 3, "Version Not Supported Indication"},
1005 /* 4-24 Reserved for S101 interface TS 29.276 */
1006 { 4, "Node Alive Request"},
1007 { 5, "Node Alive Response"},
1008 { 6, "Redirection Request"},
1009 { 7, "Redirection Response"},
1010 /* 25-31 Reserved for Sv interface TS 29.280 */
1011 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 5.2.1*/
1012 { 25, "SRVCC PS to CS Request"},
1013 { 26, "SRVCC PS to CS Response"},
1014 { 27, "SRVCC PS to CS Complete Notification"},
1015 { 28, "SRVCC PS to CS Complete Acknowledge"},
1016 { 29, "SRVCC PS to CS Cancel Notification"},
1017 { 30, "SRVCC PS to CS Cancel Acknowledge"},
1018 { 31, "SRVCC CS to PS Request"},
1019 /*End SRVCC Messages*/
1020 /* SGSN/MME to PGW (S4/S11, S5/S8) */
1021 { 32, "Create Session Request"},
1022 { 33, "Create Session Response"},
1023 { 34, "Modify Bearer Request"},
1024 { 35, "Modify Bearer Response"},
1025 { 36, "Delete Session Request"},
1026 { 37, "Delete Session Response"},
1027 /* SGSN/MME to PGW (S4/S11, S5/S8) */
1028 { 38, "Change Notification Request"},
1029 { 39, "Change Notification Response"},
1030 /* MME to PGW (S11, S5/S8) */
1031 { 40, "Remote UE Report Notification" },
1032 { 41, "Remote UE Report Acknowledge" },
1033 /* 42-63 For future use */
1034 /* Messages without explicit response */
1035 { 64, "Modify Bearer Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
1036 { 65, "Modify Bearer Failure Indication"}, /*(PGW to MME/SGSN -S5/S8, S11/S4) */
1037 { 66, "Delete Bearer Command"}, /* (MME to PGW -S11, S5/S8) */
1038 { 67, "Delete Bearer Failure Indication"}, /* (PGW to MME -S5/S8, S11) */
1039 { 68, "Bearer Resource Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
1040 { 69, "Bearer Resource Failure Indication"}, /* (PGW to MME/SGSN -S5/S8, S11/S4) */
1041 { 70, "Downlink Data Notification Failure Indication"}, /*(SGSN/MME to SGW -S4/S11) */
1042 { 71, "Trace Session Activation"},
1043 { 72, "Trace Session Deactivation"},
1044 { 73, "Stop Paging Indication"},
1045 /* 74-94 For future use */
1046 /* PGW to SGSN/MME/ TWAN/ePDG (S5/S8, S4/S11, S2a, S2b) */
1047 { 95, "Create Bearer Request"},
1048 { 96, "Create Bearer Response"},
1049 { 97, "Update Bearer Request"},
1050 { 98, "Update Bearer Response"},
1051 { 99, "Delete Bearer Request"},
1052 {100, "Delete Bearer Response"},
1053 /* PGW to MME, MME to PGW, SGW to PGW, SGW to MME (S5/S8, S11) */
1054 {101, "Delete PDN Connection Set Request"},
1055 {102, "Delete PDN Connection Set Response"},
1056 /* PGW to SGSN/MME(S5, S4/S11) */
1057 {103, "PGW Downlink Triggering Notification" },
1058 {104, "PGW Downlink Triggering Acknowledge" },
1059 /* 105-127 For future use */
1060 /* MME to MME, SGSN to MME, MME to SGSN, SGSN to SGSN (S3/10/S16) */
1061 {128, "Identification Request"},
1062 {129, "Identification Response"},
1063 {130, "Context Request"},
1064 {131, "Context Response"},
1065 {132, "Context Acknowledge"},
1066 {133, "Forward Relocation Request"},
1067 {134, "Forward Relocation Response"},
1068 {135, "Forward Relocation Complete Notification"},
1069 {136, "Forward Relocation Complete Acknowledge"},
1070 {137, "Forward Access Context Notification"},
1071 {138, "Forward Access Context Acknowledge"},
1072 {139, "Relocation Cancel Request"},
1073 {140, "Relocation Cancel Response"},
1074 {141, "Configuration Transfer Tunnel"},
1075 /* 142-148 For future use */
1076 /* SGSN to MME, MME to SGSN (S3)*/
1077 {149, "Detach Notification"},
1078 {150, "Detach Acknowledge"},
1079 {151, "CS Paging Indication"},
1080 {152, "RAN Information Relay"},
1081 {153, "Alert MME Notification"},
1082 {154, "Alert MME Acknowledge"},
1083 {155, "UE Activity Notification"},
1084 {156, "UE Activity Acknowledge" },
1085 {157, "ISR Status Indication" },
1086 {158, "UE Registration Query Request" },
1087 {159, "UE Registration Query Response" },
1088 /* MME to SGW (S11) */
1089 {160, "Create Forwarding Tunnel Request"},
1090 {161, "Create Forwarding Tunnel Response"},
1091 {162, "Suspend Notification"},
1092 {163, "Suspend Acknowledge"},
1093 {164, "Resume Notification"},
1094 {165, "Resume Acknowledge"},
1095 {166, "Create Indirect Data Forwarding Tunnel Request"},
1096 {167, "Create Indirect Data Forwarding Tunnel Response"},
1097 {168, "Delete Indirect Data Forwarding Tunnel Request"},
1098 {169, "Delete Indirect Data Forwarding Tunnel Response"},
1099 {170, "Release Access Bearers Request"},
1100 {171, "Release Access Bearers Response"},
1101 /* 172-175 For future use */
1102 /* SGW to SGSN/MME (S4/S11) */
1103 {176, "Downlink Data Notification"},
1104 {177, "Downlink Data Notification Acknowledgement"},
1105 {178, "Reserved. Allocated in earlier version of the specification."},
1106 {179, "PGW Restart Notification"},
1107 {180, "PGW Restart Notification Acknowledge"},
1108 /* 181-199 For future use */
1109 /* SGW to PGW, PGW to SGW (S5/S8) */
1110 {200, "Update PDN Connection Set Request"},
1111 {201, "Update PDN Connection Set Response"},
1112 /* 202 to 210 For future use */
1113 /* MME to SGW (S11) */
1114 {211, "Modify Access Bearers Request"},
1115 {212, "Modify Access Bearers Response"},
1116 /* 213 to 230 For future use */
1117 /* MBMS GW to MME/SGSN (Sm/Sn) */
1118 {231, "MBMS Session Start Request"},
1119 {232, "MBMS Session Start Response"},
1120 {233, "MBMS Session Update Request"},
1121 {234, "MBMS Session Update Response"},
1122 {235, "MBMS Session Stop Request"},
1123 {236, "MBMS Session Stop Response"},
1124 /* 237 to 239 For future use */
1125 /* Reserved for Sv interface (see also types 25 to 31) TS 29.280 */
1126 {240, "SRVCC CS to PS Response"}, /* 5.2.9 3GPP TS 29.280 V11.5.0 (2013-09) */
1127 {241, "SRVCC CS to PS Complete Notification"}, /* 5.2.10 3GPP TS 29.280 V11.5.0 (2013-09) */
1128 {242, "SRVCC CS to PS Complete Acknowledge"}, /* 5.2.11 3GPP TS 29.280 V11.5.0 (2013-09) */
1129 {243, "SRVCC CS to PS Cancel Notification"}, /* 5.2.12 3GPP TS 29.280 V11.5.0 (2013-09) */
1130 {244, "SRVCC CS to PS Cancel Acknowledge"}, /* 5.2.13 3GPP TS 29.280 V11.5.0 (2013-09) */
1131 /* 245 to 247 For future Sv interface use*/
1132 /* 248 to 255 For future use */
1133 {0, NULL}
1135 static value_string_ext gtpv2_message_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_message_type_vals);
1137 #define NUM_GTPV2_IES 256
1138 static int ett_gtpv2_ies[NUM_GTPV2_IES];
1140 #define GTPV2_IE_RESERVED 0
1141 #define GTPV2_IE_IMSI 1
1142 #define GTPV2_IE_CAUSE 2
1143 #define GTPV2_REC_REST_CNT 3
1144 /*Start SRVCC Messages*/
1145 #define GTPV2_IE_STN_SR 51
1146 #define GTPV2_IE_SRC_TGT_TRANS_CON 52
1147 #define GTPV2_IE_TGT_SRC_TRANS_CON 53
1148 #define GTPV2_IE_MM_CON_EUTRAN_SRVCC 54
1149 #define GTPV2_IE_MM_CON_UTRAN_SRVCC 55
1150 #define GTPV2_IE_SRVCC_CAUSE 56
1151 #define GTPV2_IE_TGT_RNC_ID 57
1152 #define GTPV2_IE_TGT_GLOGAL_CELL_ID 58
1153 #define GTPV2_IE_TEID_C 59
1154 #define GTPV2_IE_SV_FLAGS 60
1155 #define GTPV2_IE_SAI 61
1156 #define GTPV2_IE_MM_CTX_FOR_CS_TO_PS_SRVCC 62
1157 /* 61 - 70 for future sv interface use*/
1158 /*End SRVCC Messages*/
1159 #define GTPV2_APN 71
1160 #define GTPV2_AMBR 72
1161 #define GTPV2_EBI 73
1162 #define GTPV2_IP_ADDRESS 74
1163 #define GTPV2_MEI 75
1164 #define GTPV2_IE_MSISDN 76
1165 #define GTPV2_INDICATION 77
1166 #define GTPV2_PCO 78
1167 #define GTPV2_PAA 79
1168 #define GTPV2_BEARER_QOS 80
1169 #define GTPV2_IE_FLOW_QOS 81
1170 #define GTPV2_IE_RAT_TYPE 82
1171 #define GTPV2_IE_SERV_NET 83
1172 #define GTPV2_IE_BEARER_TFT 84
1173 #define GTPV2_IE_TAD 85
1174 #define GTPV2_IE_ULI 86
1175 #define GTPV2_IE_F_TEID 87
1176 #define GTPV2_IE_TMSI 88
1177 #define GTPV2_IE_GLOBAL_CNID 89
1178 #define GTPV2_IE_S103PDF 90
1179 #define GTPV2_IE_S1UDF 91
1180 #define GTPV2_IE_DEL_VAL 92
1181 #define GTPV2_IE_BEARER_CTX 93
1182 #define GTPV2_IE_CHAR_ID 94
1183 #define GTPV2_IE_CHAR_CHAR 95
1184 #define GTPV2_IE_TRA_INFO 96
1185 #define GTPV2_BEARER_FLAG 97
1186 /* define GTPV2_IE_PAGING_CAUSE 98 (void) */
1187 #define GTPV2_IE_PDN_TYPE 99
1188 #define GTPV2_IE_PTI 100
1189 #define GTPV2_IE_DRX_PARAM 101
1190 #define GTPV2_IE_UE_NET_CAPABILITY 102
1191 #define GTPV2_IE_MM_CONTEXT_GSM_T 103
1192 #define GTPV2_IE_MM_CONTEXT_UTMS_CQ 104
1193 #define GTPV2_IE_MM_CONTEXT_GSM_CQ 105
1194 #define GTPV2_IE_MM_CONTEXT_UTMS_Q 106
1195 #define GTPV2_IE_MM_CONTEXT_EPS_QQ 107
1196 #define GTPV2_IE_MM_CONTEXT_UTMS_QQ 108
1197 #define GTPV2_IE_PDN_CONNECTION 109
1198 #define GTPV2_IE_PDN_NUMBERS 110
1199 #define GTPV2_IE_P_TMSI 111
1200 #define GTPV2_IE_P_TMSI_SIG 112
1201 #define GTPV2_IE_HOP_COUNTER 113
1202 #define GTPV2_IE_UE_TIME_ZONE 114
1203 #define GTPV2_IE_TRACE_REFERENCE 115
1204 #define GTPV2_IE_COMPLETE_REQUEST_MSG 116
1205 #define GTPV2_IE_GUTI 117
1206 #define GTPV2_IE_F_CONTAINER 118
1207 #define GTPV2_IE_F_CAUSE 119
1208 #define GTPV2_IE_PLMN_ID 120
1209 #define GTPV2_IE_TARGET_ID 121
1210 /* GTPV2_IE_NSAPI 122 */
1211 #define GTPV2_IE_PKT_FLOW_ID 123
1212 #define GTPV2_IE_RAB_CONTEXT 124
1213 #define GTPV2_IE_S_RNC_PDCP_CTX_INFO 125
1214 #define GTPV2_IE_PORT_NR 126
1215 #define GTPV2_IE_APN_RESTRICTION 127
1216 #define GTPV2_IE_SEL_MODE 128
1217 #define GTPV2_IE_SOURCE_IDENT 129
1218 #define GTPV2_IE_BEARER_CONTROL_MODE 130
1219 #define GTPV2_IE_CNG_REP_ACT 131
1220 #define GTPV2_IE_FQ_CSID 132
1221 #define GTPV2_IE_CHANNEL_NEEDED 133
1222 #define GTPV2_IE_EMLPP_PRI 134
1223 #define GTPV2_IE_NODE_TYPE 135
1224 #define GTPV2_IE_FQDN 136
1225 #define GTPV2_IE_TI 137
1226 #define GTPV2_IE_MBMS_SESSION_DURATION 138
1227 #define GTPV2_IE_MBMS_SERVICE_AREA 139
1228 #define GTPV2_IE_MBMS_SESSION_ID 140
1229 #define GTPV2_IE_MBMS_FLOW_ID 141
1230 #define GTPV2_IE_MBMS_IP_MC_DIST 142
1231 #define GTPV2_IE_MBMS_DIST_ACK 143
1232 #define GTPV2_IE_RFSP_INDEX 144
1233 #define GTPV2_IE_UCI 145
1234 #define GTPV2_IE_CSG_INFO_REP_ACTION 146
1235 #define GTPV2_IE_CSG_ID 147
1236 #define GTPV2_IE_CMI 148
1237 #define GTPV2_IE_SERVICE_INDICATOR 149
1238 #define GTPV2_IE_DETACH_TYPE 150
1239 #define GTPV2_IE_LDN 151
1240 #define GTPV2_IE_NODE_FEATURES 152
1241 #define GTPV2_IE_MBMS_TIME_TO_DATA_XFER 153
1242 #define GTPV2_IE_THROTTLING 154
1243 #define GTPV2_IE_ARP 155
1244 #define GTPV2_IE_EPC_TIMER 156
1245 #define GTPV2_IE_SIG_PRIO_IND 157
1246 #define GTPV2_IE_TMGI 158
1247 #define GTPV2_IE_ADD_MM_CONT_FOR_SRVCC 159
1248 #define GTPV2_IE_ADD_FLAGS_FOR_SRVCC 160
1249 #define GTPV2_IE_MMBR 161
1250 #define GTPV2_IE_MDT_CONFIG 162
1251 #define GTPV2_IE_APCO 163
1252 #define GTPV2_IE_ABS_MBMS_DATA_TF_TIME 164
1253 #define GTPV2_IE_HENB_INFO_REPORT 165
1254 #define GTPV2_IE_IP4CP 166
1255 #define GTPV2_IE_CHANGE_TO_REPORT_FLAGS 167
1256 #define GTPV2_IE_ACTION_INDICATION 168
1257 #define GTPV2_IE_TWAN_IDENTIFIER 169
1258 #define GTPV2_IE_ULI_TIMESTAMP 170
1259 #define GTPV2_IE_MBMS_FLAGS 171
1260 #define GTPV2_IE_RAN_NAS_CAUSE 172
1261 #define GTPV2_IE_CN_OP_SEL_ENT 173
1262 #define GTPV2_IE_TRUST_WLAN_MODE_IND 174
1263 #define GTPV2_IE_NODE_NUMBER 175
1264 #define GTPV2_IE_NODE_IDENTIFIER 176
1265 #define GTPV2_IE_PRES_REP_AREA_ACT 177
1266 #define GTPV2_IE_PRES_REP_AREA_INF 178
1267 #define GTPV2_IE_TWAN_ID_TS 179
1268 #define GTPV2_IE_OVERLOAD_CONTROL_INF 180
1269 #define GTPV2_IE_LOAD_CONTROL_INF 181
1270 #define GTPV2_IE_METRIC 182
1271 #define GTPV2_IE_SEQ_NO 183
1272 #define GTPV2_IE_APN_AND_REL_CAP 184
1273 #define GTPV2_IE_WLAN_OFFLOADABILITY_IND 185
1274 #define GTPV2_IE_PAGING_AND_SERVICE_INF 186
1275 #define GTPV2_IE_INTEGER_NUMBER 187
1276 #define GTPV2_IE_MILLISECOND_TS 188
1277 #define GTPV2_IE_MON_EVENT_INF 189
1279 190 ECGI List
1280 191 Remote UE Context
1281 192 Remote User ID
1282 193 Remote UE IP information
1284 #define GTPV2_IE_CIOT_OPT_SUPPORT_IND 194
1285 #define GTPV2_IE_SCEF_PDN_CONNECTION 195
1286 #define GTPV2_IE_HEADER_COMP_CONF 196
1287 #define GTPV2_IE_EXTENDED_PCO 197
1288 #define GTPV2_IE_SERV_PLMN_RATE_CONTROL 198
1289 #define GTPV2_IE_COUNTER 199
1290 #define GTPV2_IE_MAPPED_UE_USAGE_TYPE 200
1291 #define GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT 201
1292 #define GTPV2_IE_UP_FUNC_SEL_INDI_FLG 202
1293 #define GTPV2_IE_MAX_PKT_LOSS_RTE 203
1294 #define GTPV2_IE_APN_RTE_CNTRL_STATUS 204
1295 #define GTPV2_IE_EXT_TRS_INF 205
1296 #define GTPV2_IE_MON_EVENT_EXT_INF 206
1297 #define GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX 207
1298 #define GTPV2_IE_V2X_CONTEXT 208
1299 #define GTPV2_IE_PC5_QOS_PARAMETERS 209
1300 #define GTPV2_IE_SERVICES_AUTHORIZED 210
1301 #define GTPV2_IE_BIT_RATE 211
1302 #define GTPV2_IE_PC5_QOS_FLOW 212
1303 #define GTPV2_IE_SGI_PTP_TUNNEL_ADDRESS 213
1304 #define GTPV2_IE_PGW_CHANGE_INFO 214
1305 #define GTPV2_IE_PGW_FQDN 215
1306 #define GTPV2_IE_GROUP_ID 216
1307 #define GTPV2_IE_PSCELL_ID 217
1308 #define GTPV2_IE_UP_SECURITY_POLICY 218
1309 #define GTPV2_IE_ALT_IMSI 219
1310 #define GTPV2_IE_NF_INSTANCE_ID 220
1311 #define GTPV2_IE_TIMER_IN_SECONDS 221
1313 220 to 253 Spare. For future use.
1314 254 Special IE type for IE Type Extension
1315 255 Private Extension
1316 256 to 65535 Spare. For future use.
1319 /* 169 to 254 reserved for future use */
1320 #define GTPV2_IE_PRIVATE_EXT 255
1322 #define SPARE 0X0
1323 #define CREATE_NEW_TFT 0X20
1324 #define DELETE_TFT 0X40
1325 #define ADD_PACKET_FILTERS_TFT 0X60
1326 #define REPLACE_PACKET_FILTERS_TFT 0X80
1327 #define DELETE_PACKET_FILTERS_TFT 0XA0
1328 #define NO_TFT_OPERATION 0XC0
1329 #define RESERVED 0XE0
1331 /* SRVCC PS-to-CS Transparent Container Preference */
1332 #define PREF_DECODE_SRVCC_P2C_TRANS_CONT_NO 0
1333 #define PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN 1
1334 static int pref_decode_srvcc_p2c_trans_cont = PREF_DECODE_SRVCC_P2C_TRANS_CONT_NO;
1336 static unsigned pref_pair_matching_max_interval_ms; /* Default: disable */
1338 /* Table 8.1-1: Information Element types for GTPv2 */
1339 static const value_string gtpv2_element_type_vals[] = {
1340 { 0, "Reserved"},
1341 { 1, "International Mobile Subscriber Identity (IMSI)"}, /* Variable Length / 8.3 */
1342 { 2, "Cause"}, /* Variable Length / 8.4 */
1343 { 3, "Recovery (Restart Counter)"}, /* Variable Length / 8.5 */
1344 /* 4-34 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
1345 /* 35-50 / See 3GPP TS 29.276 */
1346 /*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 6.1*/
1347 { 51, "STN-SR"}, /* Variable Length / 6.2 */
1348 { 52, "Source to Target Transparent Container"}, /* Variable Length / 6.3 */
1349 { 53, "Target to Source Transparent Container"}, /* Variable Length / 6.4 */
1350 { 54, "MM Context for E-UTRAN SRVCC"}, /* Variable Length / 6.5 */
1351 { 55, "MM Context for UTRAN SRVCC"}, /* Variable Length / 6.6 */
1352 { 56, "SRVCC Cause"}, /* Fixed Length / 6.7 */
1353 { 57, "Target RNC ID"}, /* Variable Length / 6.8 */
1354 { 58, "Target Global Cell ID"}, /* Variable Length / 6.9 */
1355 { 59, "TEID-C"}, /* Extendable / 6.10 */
1356 { 60, "Sv Flags" }, /* Extendable / 6.11 */
1357 { 61, "Service Area Identifier" }, /* Extendable / 6.12 */
1358 { 62, "MM Context for CS to PS SRVCC" }, /* Extendable / 6.13 */
1359 /* 63-70 For future Sv interface use */
1360 /*End SRVCC Messages*/
1361 { 71, "Access Point Name (APN)"}, /* Variable Length / 8.6 */
1362 { 72, "Aggregate Maximum Bit Rate (AMBR)"}, /* Fixed Length / 8.7 */
1363 { 73, "EPS Bearer ID (EBI)"}, /* Extendable / 8.8 */
1364 { 74, "IP Address"}, /* Extendable / 8.9 */
1365 { 75, "Mobile Equipment Identity (MEI)"}, /* Variable Length / 8.10 */
1366 { 76, "MSISDN"}, /* Variable Length / 8.11 */
1367 { 77, "Indication"}, /* Extendable / 8.12 */
1368 { 78, "Protocol Configuration Options (PCO)"}, /* Variable Length / 8.13 */
1369 { 79, "PDN Address Allocation (PAA)"}, /* Variable Length / 8.14 */
1370 { 80, "Bearer Level Quality of Service (Bearer QoS)"}, /* Variable Length / 8.15 */
1371 { 81, "Flow Quality of Service (Flow QoS)"}, /* Extendable / 8.16 */
1372 { 82, "RAT Type"}, /* Extendable / 8.17 */
1373 { 83, "Serving Network"}, /* Extendable / 8.18 */
1374 { 84, "EPS Bearer Level Traffic Flow Template (Bearer TFT)"}, /* Variable Length / 8.19 */
1375 { 85, "Traffic Aggregation Description (TAD)"}, /* Variable Length / 8.20 */
1376 { 86, "User Location Info (ULI)"}, /* Variable Length / 8.21 */
1377 { 87, "Fully Qualified Tunnel Endpoint Identifier (F-TEID)"}, /* Extendable / 8.22 */
1378 { 88, "TMSI"}, /* Variable Length / 8.23 */
1379 { 89, "Global CN-Id"}, /* Variable Length / 8.24 */
1380 { 90, "S103 PDN Data Forwarding Info (S103PDF)"}, /* Variable Length / 8.25 */
1381 { 91, "S1-U Data Forwarding Info (S1UDF)"}, /* Variable Length/ 8.26 */
1382 { 92, "Delay Value"}, /* Extendable / 8.27 */
1383 { 93, "Bearer Context"}, /* Extendable / 8.28 */
1384 { 94, "Charging ID"}, /* Extendable / 8.29 */
1385 { 95, "Charging Characteristics"}, /* Extendable / 8.30 */
1386 { 96, "Trace Information"}, /* Extendable / 8.31 */
1387 { 97, "Bearer Flags"}, /* Extendable / 8.32 */
1388 { 98, "Paging Cause"}, /* Variable Length / 8.33 */
1389 { 99, "PDN Type"}, /* Extendable / 8.34 */
1390 {100, "Procedure Transaction ID"}, /* Extendable / 8.35 */
1391 {101, "DRX Parameter"}, /* Variable Length/ 8.36 */
1392 {102, "UE Network Capability"}, /* Variable Length / 8.37 */
1393 {103, "MM Context (GSM Key and Triplets)"}, /* Variable Length / 8.38 */
1394 {104, "MM Context (UMTS Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
1395 {105, "MM Context (GSM Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
1396 {106, "MM Context (UMTS Key and Quintuplets)"}, /* Variable Length / 8.38 */
1397 {107, "MM Context (EPS Security Context, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
1398 {108, "MM Context (UMTS Key, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
1399 {109, "PDN Connection"}, /* Extendable / 8.39 */
1400 {110, "PDU Numbers"}, /* Extendable / 8.40 */
1401 {111, "P-TMSI"}, /* Variable Length / 8.41 */
1402 {112, "P-TMSI Signature"}, /* Variable Length / 8.42 */
1403 {113, "Hop Counter"}, /* Extendable / 8.43 */
1404 {114, "UE Time Zone"}, /* Variable Length / 8.44 */
1405 {115, "Trace Reference"}, /* Fixed Length / 8.45 */
1406 {116, "Complete Request Message"}, /* Variable Length / 8.46 */
1407 {117, "GUTI"}, /* Variable Length / 8.47 */
1408 {118, "F-Container"}, /* Variable Length / 8.48 */
1409 {119, "F-Cause"}, /* Variable Length / 8.49 */
1410 {120, "PLMN ID"}, /* Variable Length / 8.50 */
1411 {121, "Target Identification"}, /* Variable Length / 8.51 */
1412 {122, "NSAPI"}, /* Extendable / 8.52 */
1413 {123, "Packet Flow ID"}, /* Variable Length / 8.53 */
1414 {124, "RAB Context"}, /* Fixed Length / 8.54 */
1415 {125, "Source RNC PDCP Context Info"}, /* Variable Length / 8.55 */
1416 {126, "Port Number"}, /* Extendable / 8.56 */
1417 {127, "APN Restriction"}, /* Extendable / 8.57 */
1418 {128, "Selection Mode"}, /* Extendable / 8.58 */
1419 {129, "Source Identification"}, /* Variable Length / 8.50 */
1420 {130, "Bearer Control Mode"}, /* Extendable / 8.60 */
1421 {131, "Change Reporting Action"}, /* Variable Length / 8.61 */
1422 {132, "Fully Qualified PDN Connection Set Identifier (FQ-CSID)"}, /* Variable Length / 8.62 */
1423 {133, "Channel needed"}, /* Extendable / 8.63 */
1424 {134, "eMLPP Priority"}, /* Extendable / 8.64 */
1425 {135, "Node Type"}, /* Extendable / 8.65 */
1426 {136, "Fully Qualified Domain Name (FQDN)"}, /* Variable Length / 8.66 */
1427 {137, "Transaction Identifier (TI)"}, /* Variable Length / 8.68 */
1428 {138, "MBMS Session Duration"}, /* Duration Extendable / 8.69 */
1429 {139, "MBMS Service Area"}, /* Extendable / 8.70 */
1430 {140, "MBMS Session Identifier"}, /* Extendable / 8.71 */
1431 {141, "MBMS Flow Identifier"}, /* Extendable / 8.72 */
1432 {142, "MBMS IP Multicast Distribution"}, /* Extendable / 8.73 */
1433 {143, "MBMS Distribution Acknowledge"}, /* Extendable / 8.74 */
1434 {144, "RFSP Index"}, /* Fixed Length / 8.77 */
1435 {145, "User CSG Information (UCI)"}, /* Extendable / 8.75 */
1436 {146, "CSG Information Reporting Action"}, /* Extendable / 8.76 */
1437 {147, "CSG ID"}, /* Extendable / 8.78 */
1438 {148, "CSG Membership Indication (CMI)"}, /* Extendable / 8.79 */
1439 {149, "Service indicator"}, /* Fixed Length / 8.80 */
1440 {150, "Detach Type"}, /* Fixed Length / 8.81 */
1441 {151, "Local Distinguished Name (LDN)"}, /* Variable Length / 8.82 */
1442 {152, "Node Features"}, /* Extendable / 8.83 */
1443 {153, "MBMS Time to Data Transfer"}, /* Extendable / 8.84 */
1444 {154, "Throttling"}, /* Extendable / 8.85 */
1445 {155, "Allocation/Retention Priority (ARP)"}, /* Extendable / 8.86 */
1446 {156, "EPC Timer"}, /* Extendable / 8.87 */
1447 {157, "Signalling Priority Indication"}, /* Extendable / 8.88 */
1448 {158, "Temporary Mobile Group Identity"}, /* Extendable / 8.89 */
1449 {159, "Additional MM context for SRVCC"}, /* Extendable / 8.90 */
1450 {160, "Additional flags for SRVCC"}, /* Extendable / 8.91 */
1451 {161, "Max MBR/APN-AMBR (MMBR)"}, /* Extendable / 8.92 */
1452 {162, "MDT Configuration"}, /* Extendable / 8.93 */
1453 {163, "Additional Protocol Configuration Options (APCO)"}, /* Extendable / 8.94 */
1454 {164, "Absolute Time of MBMS Data Transfer"}, /* Extendable / 8.95 */
1455 {165, "H(e)NB Information Reporting"}, /* Extendable / 8.96*/
1456 {166, "IPv4 Configuration Parameters (IP4CP)"}, /* Extendable / 8.97*/
1457 {167, "Change to Report Flags"}, /* Extendable / 8.98 */
1458 {168, "Action Indication"}, /* Extendable / 8.99 */
1459 {169, "TWAN Identifier "}, /* Extendable / 8.100 */
1460 {170, "ULI Timestamp"}, /* Extendable / 8.101 */
1461 {171, "MBMS Flags"}, /* Extendable / 8.102 */
1462 {172, "RAN/NAS Cause"}, /* Extendable / 8.103 */
1463 {173, "CN Operator Selection Entity"}, /* Extendable / 8.104 */
1464 {174, "Trusted WLAN Mode Indication"}, /* Extendable / 8.105 */
1465 {175, "Node Number"}, /* Extendable / 8.106 */
1466 {176, "Node Identifier"}, /* Extendable / 8.107 */
1467 {177, "Presence Reporting Area Action"}, /* Extendable / 8.108 */
1468 {178, "Presence Reporting Area Information"}, /* Extendable / 8.109 */
1469 {179, "TWAN Identifier Timestamp"}, /* Extendable / 8.110 */
1470 {180, "Overload Control Information"}, /* Extendable / 8.111 */
1471 {181, "Load Control Information"}, /* Extendable / 8.112 */
1472 {182, "Metric"}, /* Fixed Length / 8.113 */
1473 {183, "Sequence Number"}, /* Fixed Length / 8.114 */
1474 {184, "APN and Relative Capacity"}, /* Extendable / 8.115 */
1475 {185, "WLAN Offloadability Indication"}, /* Extendable / 8.116 */
1476 {186, "Paging and Service Information"}, /* Extendable / 8.117 */
1477 {187, "Integer Number" }, /* Variable / 8.118 */
1478 {188, "Millisecond Time Stamp" }, /* Extendable / 8.119 */
1479 {189, "Monitoring Event Information"}, /* Extendable / 8.120 */
1480 {190, "ECGI List"}, /* Extendable / 8.121 */
1481 {191, "Remote UE Context"}, /* Extendable / 8.122 */
1482 {192, "Remote User ID"}, /* Extendable / 8.123 */
1483 {193, "Remote UE IP information"}, /* Variable Length / 8.124 */
1484 {194, "CIoT Optimizations Support Indication"}, /* Extendable / 8.125 */
1485 {195, "SCEF PDN Connection"}, /* Extendable / 8.126 */
1486 {196, "Header Compression Configuration"}, /* Extendable / 8.127 */
1487 {197, "Extended Protocol Configuration Options(ePCO)"}, /* Variable Length / 8.128 */
1488 {198, "Serving PLMN Rate Control"}, /* Extendable / 8.129 */
1489 {199, "Counter" }, /* Extendable / 8.130 */
1490 {200, "Mapped UE Usage Type" }, /* Extendable / 8.131 */
1491 {201, "Secondary RAT Usage Data Report" }, /* Extendable / 8.132 */
1492 {202, "UP Function Selection Indication Flags" }, /* Extendable / 8.133 */
1493 {203, "Maximum Packet Loss Rate" }, /* Extendable / 8.134 */
1494 {204, "APN Rate Control Status" }, /* Extendable / 8.135 */
1495 {205, "Extended Trace Information" }, /* Extendable / 8.136 */
1496 {206, "Monitoring Event Extension Information" }, /* Extendable / 8.137 */
1497 {207, "Additional RRM Policy Index" }, /* Fixed Length / 8.138 */
1498 {208, "V2X Context" }, /* Extendable / 8.139 */
1499 {209, "PC5 QoS Parameters" }, /* Extendable / 8.140 */
1500 {210, "Services Authorized" }, /* Extendable / 8.141 */
1501 {211, "Bit Rate" }, /* Extendable / 8.142 */
1502 {212, "PC5 QoS Flow" }, /* Extendable / 8.143 */
1503 {213, "SGi PtP Tunnel Address" }, /* Extendable / 8.144 */
1504 {214, "PGW Change Info" }, /* Extendable / 8.145 */
1505 {215, "PGW FQDN" }, /* Extendable / 8.146 */
1506 {216, "Group Id" }, /* Variable Length / 8.147 */
1507 {217, "PSCell ID" }, /* Fixed Length / 8.148*/
1508 {218, "UP Security Policy" }, /* Extendable / 8.149*/
1509 {219, "Alternative IMSI" }, /* Variable Length / 8.150 */
1510 {220, "NF Instance ID" }, /* Fixed Length / 8.151 */
1511 {221, "Timer in Seconds"}, /* Variable Length / 8.152 */
1512 /* 222 to 254 Spare. For future use. */
1513 {255, "Private Extension"}, /* Variable Length / 8.67 */
1514 {0, NULL}
1516 static value_string_ext gtpv2_element_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_element_type_vals);
1518 typedef struct _gtpv2_hdr {
1519 uint8_t flags; /* GTP header flags */
1520 uint8_t message; /* Message type */
1521 uint16_t length; /* Length of header */
1522 int64_t teid; /* Tunnel End-point ID */
1523 } gtpv2_hdr_t;
1525 /* Data structure attached to a conversation,
1526 to keep track of request/response-pairs
1528 typedef struct gtpv2_conv_info_t {
1529 wmem_map_t *unmatched;
1530 wmem_map_t *matched;
1531 } gtpv2_conv_info_t;
1533 /*structure used to track responses to requests using sequence number*/
1534 typedef struct gtpv2_msg_hash_entry {
1535 bool is_request; /*true/false*/
1536 uint32_t req_frame; /*frame with request */
1537 nstime_t req_time; /*req time */
1538 uint32_t rep_frame; /*frame with reply */
1539 int seq_nr; /*sequence number*/
1540 unsigned msgtype; /*messagetype*/
1541 } gtpv2_msg_hash_t;
1543 static unsigned
1544 gtpv2_sn_hash(const void *k)
1546 const gtpv2_msg_hash_t *key = (const gtpv2_msg_hash_t *)k;
1548 return key->seq_nr;
1551 static int
1552 gtpv2_sn_equal_matched(const void *k1, const void *k2)
1554 const gtpv2_msg_hash_t *key1 = (const gtpv2_msg_hash_t *)k1;
1555 const gtpv2_msg_hash_t *key2 = (const gtpv2_msg_hash_t *)k2;
1556 double diff;
1557 nstime_t delta;
1559 if (key1->req_frame && key2->req_frame && (key1->req_frame != key2->req_frame)) {
1560 return 0;
1563 if (key1->rep_frame && key2->rep_frame && (key1->rep_frame != key2->rep_frame)) {
1564 return 0;
1567 if (pref_pair_matching_max_interval_ms) {
1568 nstime_delta(&delta, &key1->req_time, &key2->req_time);
1569 diff = fabs(nstime_to_msec(&delta));
1571 return key1->seq_nr == key2->seq_nr && diff < pref_pair_matching_max_interval_ms;
1574 return key1->seq_nr == key2->seq_nr;
1577 static int
1578 gtpv2_sn_equal_unmatched(const void *k1, const void *k2)
1580 const gtpv2_msg_hash_t *key1 = (const gtpv2_msg_hash_t *)k1;
1581 const gtpv2_msg_hash_t *key2 = (const gtpv2_msg_hash_t *)k2;
1582 double diff;
1583 nstime_t delta;
1585 if (pref_pair_matching_max_interval_ms) {
1586 nstime_delta(&delta, &key1->req_time, &key2->req_time);
1587 diff = fabs(nstime_to_msec(&delta));
1589 return key1->seq_nr == key2->seq_nr && diff < pref_pair_matching_max_interval_ms;
1592 return key1->seq_nr == key2->seq_nr;
1595 static GHashTable *gtpv2_stat_msg_idx_hash;
1597 static void
1598 gtpv2_stat_init(struct register_srt* srt _U_, GArray*srt_array)
1600 if (gtpv2_stat_msg_idx_hash != NULL) {
1601 g_hash_table_destroy(gtpv2_stat_msg_idx_hash);
1603 gtpv2_stat_msg_idx_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
1605 init_srt_table("GTPv2 Requests", NULL, srt_array, 0, NULL, NULL, NULL);
1608 static tap_packet_status
1609 gtpv2_stat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv, tap_flags_t flags _U_)
1611 unsigned i = 0;
1612 srt_stat_table *gtpv2_srt_table;
1613 srt_data_t *srt_data = (srt_data_t*)pss;
1614 const gtpv2_msg_hash_t *gcrp = (const gtpv2_msg_hash_t *)prv;
1615 int idx = 0;
1617 /* We are only interested in matched reply packets. */
1618 if (gcrp->is_request) {
1619 return TAP_PACKET_DONT_REDRAW;
1621 if (!gcrp->req_frame) {
1622 return TAP_PACKET_DONT_REDRAW;
1625 gtpv2_srt_table = g_array_index(srt_data->srt_array, srt_stat_table*, i);
1627 /* XXX: It would be nice if srt_table handled hashing so that the
1628 * real procedure number could be displayed in the table without
1629 * having to add empty rows for unused message types and responses
1630 * (requests and responses have different message types, and we
1631 * only use the request value.)
1633 idx = GPOINTER_TO_UINT(g_hash_table_lookup(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype)));
1635 /* Store the row value incremented by 1 to distinguish 0 from NULL */
1636 if (idx == 0) {
1637 idx = g_hash_table_size(gtpv2_stat_msg_idx_hash);
1638 g_hash_table_insert(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype), GUINT_TO_POINTER(idx + 1));
1639 init_srt_table_row(gtpv2_srt_table, idx, val_to_str_ext_const(gcrp->msgtype, &gtpv2_message_type_vals_ext, "Unknown"));
1640 } else {
1641 idx -= 1;
1644 add_srt_table_data(gtpv2_srt_table, idx, &gcrp->req_time, pinfo);
1646 return TAP_PACKET_REDRAW;
1649 /* Make this a common function ???*/
1650 static void
1651 value_in_tenth_of_percent_fmt(char* s, uint32_t v)
1653 snprintf(s, ITEM_LABEL_LENGTH, "%.1f%% (%u)", (float)v / 10, v);
1656 /* Add Info element on IE types with multiple instances in same group */
1657 typedef struct _gtpv2_information_element_instance {
1658 uint8_t message_type; /* Message type */
1659 uint8_t parent_ie; /* Parent group IE for which our IE is in. 0 if on message level */
1660 uint8_t type; /* This IE type */
1661 uint8_t instance; /* Which Instance */
1662 const char *info_element; /* Information element for the IE type */
1663 } gtpv2_information_element_instance_t;
1665 /* IE types which defines with multiple instances in ch7.2 Tunnel Management Messages and ch7.3 Mobility Management Messages */
1666 static const gtpv2_information_element_instance_t gtpv2_information_element_instance_vals[] = {
1667 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_F_TEID, 0, "Sender F-TEID for Control Plane" },
1668 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_F_TEID, 1, "PGW S5/S8 Address for Control Plane or PMIP" },
1669 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Created" },
1670 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1671 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1672 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1673 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1674 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1675 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 0, "MME/S4-SGSN LDN" },
1676 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 1, "SGW LDN" },
1677 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 2, "ePDG LDN" },
1678 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 3, "TWAN LDN" },
1679 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 0, "UE Local IP Address" },
1680 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 1, "H(e)NB Local IP Address" },
1681 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 2, "MME/S4-SGSN Identifier" },
1682 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 3, "ePDG IP Address" },
1683 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1684 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 1, "H(e)NB Local UDP Port" },
1685 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 2, "UE TCP Port" },
1686 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1687 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1688 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1689 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1690 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1691 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_ID_TS, 0, "WLAN Location Timestamp" },
1692 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_ULI, 0, "User Location Info" },
1693 { GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_ULI, 1, "User Location Info for SGW" },
1695 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_F_TEID, 0, "Sender F-TEID for Control Plane" },
1696 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_F_TEID, 1, "PGW S5/S8 Address for Control Plane or PMIP" },
1697 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Created" },
1698 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1699 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1700 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1701 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LDN, 0, "SGW LDN" },
1702 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LDN, 1, "PGW LDN" },
1703 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1704 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1705 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1706 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1707 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1708 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQDN, 0, "Charging Gateway Name" },
1709 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQDN, 1, "PGW Node Name" },
1710 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1711 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IP_ADDRESS, 0, "Charging Gateway Address" },
1712 { GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IP_ADDRESS, 1, "Alternative PGW-C/SMF Address" },
1713 { GTPV2_CREATE_SESSION_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1714 { GTPV2_CREATE_SESSION_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1715 { GTPV2_CREATE_SESSION_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1717 { GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1718 { GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1719 { GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1720 { GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1721 { GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1722 { GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1723 { GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1724 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1725 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1726 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1727 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1728 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 2, "New PGW Control Plane IP Address" },
1729 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 3, "New SGW-C Address" },
1730 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 0, "Group Id" },
1731 { GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 1, "New Group Id" },
1733 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1734 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1735 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1736 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1737 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1738 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1739 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1740 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1741 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1742 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1743 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1744 { GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1746 { GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1747 { GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_EBI, 1, "EPS Bearer ID" },
1748 { GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1749 { GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1751 { GTPV2_BEARER_RESOURCE_FAILURE_INDICATION, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1752 { GTPV2_BEARER_RESOURCE_FAILURE_INDICATION, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1754 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1755 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1756 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1757 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1758 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IP_ADDRESS, 0, "H(e)NB Local IP Address" },
1759 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IP_ADDRESS, 1, "UE Local IP Address" },
1760 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IP_ADDRESS, 2, "MME/S4-SGSN Identifier" },
1761 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_PORT_NR, 0, "H(e)NB Local UDP Port" },
1762 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_PORT_NR, 1, "UE UDP Port" },
1763 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1764 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1765 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "ePDG Overload Control Info" },
1766 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_ULI, 0, "User Location Info" }, /* redundant */
1767 { GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_ULI, 1, "User Location Info for SGW" }, /* redundant ? */
1769 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1770 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1771 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1772 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1773 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LDN, 0, "SGW LDN" },
1774 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LDN, 1, "PGW LDN" },
1775 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1776 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1777 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1778 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1779 { GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1780 { GTPV2_MODIFY_BEARER_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1781 { GTPV2_MODIFY_BEARER_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1782 { GTPV2_MODIFY_BEARER_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1784 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1785 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1786 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1787 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1788 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1789 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1790 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1791 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1792 { GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1794 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1795 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_EBI, 1, "EPS Bearer ID" },
1796 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1797 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1798 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1799 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1800 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1801 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1802 { GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1803 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1804 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1805 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1806 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1807 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 2, "New PGW Control Plane IP Address" },
1808 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 3, "New SGW-C Address" },
1809 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 0, "Group Id" },
1810 { GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 1, "New Group Id" },
1812 { GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1813 { GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1814 { GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1815 { GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1816 { GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1818 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1819 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1820 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1821 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1822 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1823 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1824 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1825 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1826 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1827 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1828 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1829 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1830 { GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1832 { GTPV2_MODIFY_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1833 { GTPV2_MODIFY_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1834 { GTPV2_MODIFY_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1836 { GTPV2_MODIFY_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1837 { GTPV2_MODIFY_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "SGW node level Load Control Info" },
1839 { GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1840 { GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1841 { GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1842 { GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1843 { GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1844 { GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1845 { GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1846 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1847 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1848 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1849 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1850 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 2, "New PGW Control Plane IP Address" },
1851 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 3, "New SGW-C Address" },
1852 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 0, "Group Id" },
1853 { GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 1, "New Group Id" },
1855 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1856 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1857 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1858 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1859 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1860 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1861 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1862 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1863 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1864 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1865 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1866 { GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1868 { GTPV2_DELETE_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1869 { GTPV2_DELETE_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1871 { GTPV2_DELETE_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1872 { GTPV2_DELETE_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "SGW node level Load Control Info" },
1874 { GTPV2_MODIFY_ACESSS_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1875 { GTPV2_MODIFY_ACESSS_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1877 { GTPV2_MODIFY_ACCESS_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1878 { GTPV2_MODIFY_ACCESS_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1880 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_F_CONTAINER, 0, "E-UTRAN Transparent Container" },
1881 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_F_CONTAINER, 1, "UTRAN Transparent Container" },
1882 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_F_CONTAINER, 2, "BSS Container" },
1883 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IP_ADDRESS, 0, "HRPD access node S101 IP Address" },
1884 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IP_ADDRESS, 1, "1xIWS S102 IP Address" },
1885 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_CAUSE, 0, "S1-AP Cause" },
1886 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_CAUSE, 1, "RANAP Cause" },
1887 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_CAUSE, 2, "BSSGP Cause" },
1888 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_RFSP_INDEX, 0, "Subscribed RFSP Index" },
1889 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_RFSP_INDEX, 1, "RFSP Index in Use" },
1890 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_FQDN, 0, "SGW FQDN" },
1891 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_FQDN, 1, "SGSN FQDN" },
1892 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_FQDN, 2, "MME FQDN" },
1893 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 0, "Subscribed Additional RRM Policy Index" },
1894 { GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 1, "Additional RRM Policy Index in Use" },
1895 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 0, "PGW FQDN" },
1896 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 1, "Local Home Network ID" },
1897 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_SERVICES_AUTHORIZED, 0, "LTE V2X Service Authorized" },
1898 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_SERVICES_AUTHORIZED, 1, "NR V2X Service Authorized" },
1899 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_BIT_RATE, 0, "LTE UE Sidelink Aggregate Maximum Bit Rate" },
1900 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_BIT_RATE, 1, "NR UE Sidelink Aggregate Maximum Bit Rate" },
1901 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1902 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1903 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1904 { GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1906 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 0, "List of Set-up Bearers" },
1907 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 1, "List of Set-up RABs" },
1908 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 2, "List of Set-up PFCs" },
1909 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 2, "List of Set-up Bearers for SCEF PDN Connections" },
1910 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_CAUSE, 0, "S1-AP Cause" },
1911 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_CAUSE, 1, "RANAP Cause" },
1912 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_CAUSE, 2, "BSSGP Cause" },
1913 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_F_CONTAINER, 0, "E-UTRAN Transparent Container" },
1914 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_F_CONTAINER, 1, "UTRAN Transparent Container" },
1915 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_F_CONTAINER, 2, "BSS Container" },
1916 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_FQDN, 0, "SGSN Node Name" },
1917 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_FQDN, 1, "MME Node Name" },
1918 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 0, "SGSN Identifier" },
1919 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 1, "MME Identifier" },
1920 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 2, "SGSN Identifier for MT-SMS" },
1921 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 3, "MME Identifier for MT-SMS" },
1922 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_NUMBER, 0, "SGSN Number" },
1923 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_NUMBER, 1, "MME Number for MT-SMS" },
1924 { GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_NUMBER, 2, "MSC Number" },
1926 { GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE, 0, GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT, 0, "Secondary RAT Usage Data Report" },
1927 { GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE, 0, GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT, 1, "Secondary RAT Usage Data Report from NG-RAN" },
1929 { GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_FQDN, 0, "SGSN Node Name" },
1930 { GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_FQDN, 1, "MME Node Name" },
1931 { GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_NODE_IDENTIFIER, 0, "SGSN Identifier" },
1932 { GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_NODE_IDENTIFIER, 1, "MME Identifier" },
1934 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IP_ADDRESS, 0, "HRPD access node S101 IP Address" },
1935 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IP_ADDRESS, 1, "1xIWS S102 IP Address" },
1936 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_RFSP_INDEX, 0, "Subscribed RFSP Index" },
1937 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_RFSP_INDEX, 1, "RFSP Index in Use" },
1938 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_FQDN, 0, "SGW Node Name" },
1939 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_FQDN, 1, "SGSN Node Name" },
1940 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_FQDN, 2, "MME Node Name" },
1941 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_INTEGER_NUMBER, 0, "UE Usage Type" },
1942 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_INTEGER_NUMBER, 1, "Remaining Running Service Gap Timer" },
1943 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 0, "Subscribed Additional RRM Policy Index" },
1944 { GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 1, "Additional RRM Policy Index in Use" },
1945 { GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 0, "PGW FQDN" },
1946 { GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 1, "Local Home Network ID" },
1947 { GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1948 { GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1949 { GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1951 { GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_NUMBER, 0, "SGSN Number" },
1952 { GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_NUMBER, 1, "MME Number for MT-SMS" },
1953 { GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_IDENTIFIER, 0, "SGSN Identifier for MT-SMS" },
1954 { GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_IDENTIFIER, 1, "MME Identifier for MT-SMS" },
1956 { GTPV2_CONFIGURATION_TRANSFER_TUNNEL, 0, GTPV2_IE_TARGET_ID, 0, "Target eNodeB ID / en-gNB ID / gnB ID" },
1957 { GTPV2_CONFIGURATION_TRANSFER_TUNNEL, 0, GTPV2_IE_TARGET_ID, 1, "Connected Target eNodeB ID" },
1959 { 0, 0, 0, 0, NULL },
1962 #define NUM_GTPV2_IE_INFO_ELEM_INSTANCES array_length(gtpv2_information_element_instance_vals)
1964 /* Code to dissect IE's */
1966 static void
1967 dissect_gtpv2_unknown(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
1969 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
1973 * 8.3 International Mobile Subscriber Identity (IMSI)
1975 * IMSI is defined in 3GPP TS 23.003
1976 * Editor's note: IMSI coding will be defined in 3GPP TS 24.301
1977 * Editor's note: In the first release of GTPv2 spec (TS 29.274v8.0.0) n = 8.
1978 * That is, the overall length of the IE is 11 octets.
1981 static void
1982 dissect_gtpv2_imsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
1984 int offset = 0;
1985 const char *imsi_str;
1987 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1988 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the wmem
1989 * allocated string will be returned.
1991 imsi_str = dissect_e212_imsi(tvb, pinfo, tree, offset, length, false);
1992 proto_item_append_text(item, "%s", imsi_str);
1997 * 8.4 Cause
2000 /* Table 8.4-1: Cause values */
2001 static const value_string gtpv2_cause_vals[] = {
2002 {0, "Reserved"},
2003 /* Request / Initial message */
2004 { 1, "Reserved"},
2005 { 2, "Local Detach"},
2006 { 3, "Complete Detach"},
2007 { 4, "RAT changed from 3GPP to Non-3GPP"},
2008 { 5, "ISR deactivation"},
2009 { 6, "Error Indication received from RNC/eNodeB/S4-SGSN"},
2010 { 7, "IMSI Detach Only"},
2011 { 8, "Reactivation Requested"},
2012 { 9, "PDN reconnection to this APN disallowed"},
2013 { 10, "Access changed from Non-3GPP to 3GPP"},
2014 { 11, "PDN connection inactivity timer expires"},
2015 { 12, "PGW not responding"},
2016 { 13, "Network Failure"},
2017 { 14, "QoS parameter mismatch"},
2018 { 15, "EPS to 5GS Mobility"},
2019 /* Acceptance in a Response / triggered message */
2020 { 16, "Request accepted"},
2021 { 17, "Request accepted partially"},
2022 { 18, "New PDN type due to network preference"},
2023 { 19, "New PDN type due to single address bearer only"},
2024 /* 20-63 Spare. This value range shall be used by Cause values in an acceptance response/triggered message */
2025 { 20, "Spare"},
2026 { 21, "Spare"},
2027 { 22, "Spare"},
2028 { 23, "Spare"},
2029 { 24, "Spare"},
2030 { 25, "Spare"},
2031 { 26, "Spare"},
2032 { 27, "Spare"},
2033 { 28, "Spare"},
2034 { 29, "Spare"},
2035 { 30, "Spare"},
2036 { 31, "Spare"},
2037 { 32, "Spare"},
2038 { 33, "Spare"},
2039 { 34, "Spare"},
2040 { 35, "Spare"},
2041 { 36, "Spare"},
2042 { 37, "Spare"},
2043 { 38, "Spare"},
2044 { 39, "Spare"},
2045 { 40, "Spare"},
2046 { 41, "Spare"},
2047 { 42, "Spare"},
2048 { 43, "Spare"},
2049 { 44, "Spare"},
2050 { 45, "Spare"},
2051 { 46, "Spare"},
2052 { 47, "Spare"},
2053 { 48, "Spare"},
2054 { 49, "Spare"},
2055 { 50, "Spare"},
2056 { 51, "Spare"},
2057 { 52, "Spare"},
2058 { 53, "Spare"},
2059 { 54, "Spare"},
2060 { 55, "Spare"},
2061 { 56, "Spare"},
2062 { 57, "Spare"},
2063 { 58, "Spare"},
2064 { 59, "Spare"},
2065 { 60, "Spare"},
2066 { 61, "Spare"},
2067 { 62, "Spare"},
2068 { 63, "Spare"},
2069 /* Rejection in a Response / triggered message */
2070 { 64, "Context Not Found"},
2071 { 65, "Invalid Message Format"},
2072 { 66, "Version not supported by next peer"},
2073 { 67, "Invalid length"},
2074 { 68, "Service not supported"},
2075 { 69, "Mandatory IE incorrect"},
2076 { 70, "Mandatory IE missing"},
2077 { 71, "Shall not be used"},
2078 { 72, "System failure"},
2079 { 73, "No resources available"},
2080 { 74, "Semantic error in the TFT operation"},
2081 { 75, "Syntactic error in the TFT operation"},
2082 { 76, "Semantic errors in packet filter(s)"},
2083 { 77, "Syntactic errors in packet filter(s)"},
2084 { 78, "Missing or unknown APN"},
2085 { 79, "Shall not be used"},
2086 { 80, "GRE key not found"},
2087 { 81, "Relocation failure"},
2088 { 82, "Denied in RAT"},
2089 { 83, "Preferred PDN type not supported"},
2090 { 84, "All dynamic addresses are occupied"},
2091 { 85, "UE context without TFT already activated"},
2092 { 86, "Protocol type not supported"},
2093 { 87, "UE not responding"},
2094 { 88, "UE refuses"},
2095 { 89, "Service denied"},
2096 { 90, "Unable to page UE"},
2097 { 91, "No memory available"},
2098 { 92, "User authentication failed"},
2099 { 93, "APN access denied - no subscription"},
2100 { 94, "Request rejected(reason not specified)"},
2101 { 95, "P-TMSI Signature mismatch"},
2102 { 96, "IMSI/IMEI not known"},
2103 { 97, "Semantic error in the TAD operation"},
2104 { 98, "Syntactic error in the TAD operation"},
2105 { 99, "Shall not be used"},
2106 {100, "Remote peer not responding"},
2107 {101, "Collision with network initiated request"},
2108 {102, "Unable to page UE due to Suspension"},
2109 {103, "Conditional IE missing"},
2110 {104, "APN Restriction type Incompatible with currently active PDN connection"},
2111 {105, "Invalid overall length of the triggered response message and a piggybacked initial message"},
2112 {106, "Data forwarding not supported"},
2113 {107, "Invalid reply from remote peer"},
2114 {108, "Fallback to GTPv1"},
2115 {109, "Invalid peer"},
2116 {110, "Temporarily rejected due to handover/TAU/RAU procedure in progress"},
2117 {111, "Modifications not limited to S1-U bearers"},
2118 {112, "Request rejected for a PMIPv6 reason "},
2119 {113, "APN Congestion"},
2120 {114, "Bearer handling not supported"},
2121 {115, "UE already re-attached"},
2122 {116, "Multiple PDN connections for a given APN not allowed"},
2123 {117, "Target access restricted for the subscriber"},
2124 {118, "Shall not be used. See NOTE 2 and NOTE 3."},
2125 {119, "MME/SGSN refuses due to VPLMN Policy"},
2126 {120, "GTP-C Entity Congestion"},
2127 {121, "Late Overlapping Request"},
2128 {122, "Timed out Request"},
2129 {123, "UE is temporarily not reachable due to power saving"},
2130 {124, "Relocation failure due to NAS message redirection"},
2131 {125, "UE not authorised by OCS or external AAA Server"},
2132 {126, "Multiple accesses to a PDN connection not allowed"},
2133 {127, "Request rejected due to UE capability"},
2134 {128, "S1-U Path Failure" },
2135 {129, "5GC not allowed" },
2136 {130, "PGW mismatch with network slice subscribed by the UE" },
2137 {131, "Rejection due to paging restriction" },
2139 /* 132-239 Spare. For future use in a triggered/response message */
2140 /* 240-255 Spare. For future use in an initial/request message */
2141 {0, NULL}
2143 value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals);
2145 /* Table 8.4-1: CS (Cause Source) */
2146 static const true_false_string gtpv2_cause_cs = {
2147 "Originated by remote node",
2148 "Originated by node sending the message",
2151 static void
2152 dissect_gtpv2_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args)
2154 int offset = 0;
2155 uint8_t tmp;
2157 /* Cause value octet 5 */
2158 tmp = tvb_get_uint8(tvb, offset);
2159 if (g_gtp_session) {
2160 args->last_cause = tmp;
2162 proto_tree_add_item(tree, hf_gtpv2_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
2164 /* Add Cause to ie_tree */
2165 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(tmp, &gtpv2_cause_vals_ext, "Unknown"), tmp);
2166 offset += 1;
2168 /* Octet 6 Spare PCE BCE CS */
2169 static int* const oct6_flags[] = {
2170 &hf_gtpv2_spare_b7_b3,
2171 &hf_gtpv2_cause_pce,
2172 &hf_gtpv2_cause_bce,
2173 &hf_gtpv2_cause_cs,
2174 NULL
2177 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct6_flags, ENC_NA);
2178 offset += 1;
2180 /* If n = 2, a = 0 and the Cause IE shall be 6 octets long.
2181 * Therefore, octets "a(n+1) to a(n+4)" will not be present.
2182 * If n = 6, a = 1 and the Cause IE will be 10 octets long.
2184 if ( length == 2 ) {
2185 return;
2188 * If the rejection is due to a mandatory IE or a verifiable conditional IE is faulty
2189 * or missing, the offending IE shall be included within an additional field "a(n+1)
2190 * to a(n+4)". Only Type and Instance fields of the offending IE that caused the
2191 * rejection have a meaning. The length in the Octet 8-9 and spare bits in the Octet 10
2192 * shall be set to "0". In this case, the value of "n" shall be "6".
2193 * Otherwise, the value of "n" is equal to "2".
2196 /* Type of the offending IE */
2197 proto_tree_add_item(tree, hf_gtpv2_cause_off_ie_t, tvb, offset, 1, ENC_BIG_ENDIAN);
2198 offset += 1;
2200 /* Length */
2201 proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2202 offset += 2;
2203 /* a(n+4) Spare Instance */
2204 proto_tree_add_bits_item(tree, hf_gtpv2_spare_half_octet, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2205 proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
2210 * 8.5 Recovery (Restart Counter)
2212 static void
2213 dissect_gtpv2_recovery(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2215 int offset = 0;
2216 uint8_t recovery;
2218 recovery = tvb_get_uint8(tvb, offset);
2219 proto_tree_add_item(tree, hf_gtpv2_rec, tvb, offset, 1, ENC_BIG_ENDIAN);
2220 proto_item_append_text(item, "%u", recovery);
2225 /*Start SRVCC Messages*/
2227 /* 6.2 STN-SR */
2228 static void
2229 dissect_gtpv2_stn_sr(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2231 proto_item *stn_sr_item;
2232 proto_tree *sub_tree;
2233 tvbuff_t *new_tvb;
2234 int offset = 0;
2236 stn_sr_item = proto_tree_add_item(tree, hf_gtpv2_stn_sr, tvb, offset, length, ENC_NA);
2237 new_tvb = tvb_new_subset_length(tvb, offset, length);
2238 sub_tree = proto_item_add_subtree(stn_sr_item, ett_gtpv2_stn_sr);
2240 /* Octet 5
2241 * contains the Nature of Address and Numbering Plan Indicator (NANPI) of the "AddressString" ASN.1 type (see 3GPP
2242 * 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
2243 * 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
2244 * filler "1111".
2246 dissect_gsm_map_msisdn(new_tvb, pinfo, sub_tree);
2249 /* 6.3 Source to Target Transparent Container */
2251 static void
2252 dissect_gtpv2_src_tgt_trans_con(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2254 int offset = 0;
2256 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
2257 offset += 1;
2258 /*ra_type_flag = 0;*/
2260 /* Transparent Container
2261 * When target network is GERAN, this container carries the Old BSS to New BSS
2262 * Information IE defined in 3GPP TS 48.008 [8]. When target network is UTRAN, this container carries the Source RNC
2263 * to Target RNC Transparent Container IE defined in 3GPP TS 25.413 [9]. The Transparent container field includes the
2264 * IE value part as it is specified in the respective specification.
2266 proto_tree_add_item(tree, hf_gtpv2_transparent_container, tvb, offset, length-1, ENC_NA);
2268 * bssmap_old_bss_to_new_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo);
2269 * dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
2271 if ((message_type == GTPV2_SRVCC_PS_TO_CS_REQUEST) && (pref_decode_srvcc_p2c_trans_cont == PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN)) {
2272 tvbuff_t *new_tvb;
2273 proto_tree *sub_tree;
2275 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length-1, ett_gtpv2_utran_con, NULL, "Source RNC to Target RNC Transparent Container");
2276 new_tvb = tvb_new_subset_remaining(tvb, offset);
2277 dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
2282 /* 6.4 Target to Source Transparent Container */
2283 static void
2284 dissect_gtpv2_tgt_src_trans_con(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2286 int offset = 0;
2288 proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
2289 offset += 1;
2291 /* Transparent Container */
2292 proto_tree_add_item(tree, hf_gtpv2_transparent_container, tvb, offset, length-1, ENC_NA);
2294 /* It's too hard to figure out the content...
2295 6.4 Target to Source Transparent Container
2297 The Target to Source Transparent Container contains information that shall be transferred transparently by CN entities
2298 from the target RAN to the source RAN.
2300 When the target network is GERAN, the Transparent container field contains the value part of the Layer 3 Information
2301 IE defined in 3GPP TS 48.008 [8], i.e., octets 3 to n, excluding octet 1 (Element ID) and octet 2 (Length).
2303 When the target network is UTRAN, this container carries the Target RNC to Source RNC Transparent Container IE
2304 defined in 3GPP TS 25.413 [9]. The Transparent container field contains a transparent copy of the corresponding
2305 ASN.1/PER IE (see subclauses 8.2.2 and 8.48 in 3GPP TS 29.274 [3]).
2307 When the target network is E-UTRAN, the container carries the Target eNB To Source eNB Transparent Container IE
2308 defined in 3GPP TS 36.413 [14]. The Transparent container field contains a transparent copy of the corresponding
2309 ASN.1/PER IE (see subclauses 8.2.2 and 8.48 in 3GPP TS 29.274 [3]).
2311 The receiver of this Information Element shall ignore the length of the transparent container encoded in octet 5 and shall
2312 derive the actual length of the container from the length encoded in octets 2 to 3 minus 1.
2314 For backward compatibility, the sender of this Information Element shall set the octet 5 to the actual length of the
2315 transparent container if the size of the container is smaller or equal to 255 octets, and to the value "255" otherwise.
2318 if ((message_type == GTPV2_SRVCC_PS_TO_CS_RESPONSE) && (pref_decode_srvcc_p2c_trans_cont == PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN)) {
2319 tvbuff_t *new_tvb;
2320 proto_tree *sub_tree;
2322 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length-1, ett_gtpv2_utran_con, NULL, "Target RNC to Source RNC Transparent Container");
2323 new_tvb = tvb_new_subset_remaining(tvb, offset);
2324 dissect_ranap_TargetRNC_ToSourceRNC_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
2329 /* 6.5 MM Context for E-UTRAN SRVCC */
2330 static void
2331 dissect_gtpv2_mm_con_eutran_srvcc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2333 int offset = 0;
2334 uint8_t elm_len;
2335 proto_tree *ms_tree, *fi;
2337 proto_tree_add_item(tree, hf_gtpv2_eksi, tvb, offset, 1, ENC_BIG_ENDIAN);
2338 offset += 1;
2339 proto_tree_add_item(tree, hf_gtpv2_cksrvcc, tvb, offset, 16, ENC_NA);
2340 offset += 16;
2341 proto_tree_add_item(tree, hf_gtpv2_iksrvcc, tvb, offset, 16, ENC_NA);
2342 offset += 16;
2344 /* For each of the Mobile Station Classmark 2, Mobile Station Classmark 3 and Supported Codec List parameters, if they are not available,
2345 then the associated length field shall be set to zero, and the particular parameter field shall not be present.
2347 /* Length of Mobile Station Classmark2 */
2348 elm_len = tvb_get_uint8(tvb, offset);
2349 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
2350 offset += 1;
2351 if (elm_len) {
2352 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
2353 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2354 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2355 offset += elm_len;
2358 /* Length of Mobile Station Classmark3 */
2359 elm_len = tvb_get_uint8(tvb, offset);
2360 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
2361 offset += 1;
2362 if (elm_len) {
2363 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
2364 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2365 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2366 offset += elm_len;
2369 /*Length of Supported Codec List */
2370 elm_len = tvb_get_uint8(tvb, offset);
2371 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
2372 offset += 1;
2373 if (elm_len) {
2374 fi = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
2375 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
2376 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2380 /* 6.6 MM Context for UTRAN SRVCC */
2381 static void
2382 dissect_gtpv2_mm_con_utran_srvcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2384 int offset = 0;
2385 uint8_t elm_len;
2386 proto_tree *ms_tree, *fi;
2388 proto_tree_add_item(tree, hf_gtpv2_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
2389 offset += 1;
2391 proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_ck_cs, tvb, offset, 16, ENC_NA);
2392 offset += 16;
2393 proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_ik_cs, tvb, offset, 16, ENC_NA);
2394 offset += 16;
2395 proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_kc, tvb, offset, 8, ENC_NA);
2396 offset += 8;
2397 proto_tree_add_item(tree, hf_gtpv2_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
2398 offset += 1;
2400 /* For each of the Mobile Station Classmark 2, Mobile Station Classmark 3 and Supported Codec List parameters, if they are not available,
2401 then the associated length field shall be set to zero, and the particular parameter field shall not be present.
2404 /*Length of Mobile Station Classmark2 */
2405 elm_len = tvb_get_uint8(tvb, offset);
2406 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
2407 offset += 1;
2408 if (elm_len) {
2409 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
2410 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2411 de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2412 offset += elm_len;
2415 /*Length of Mobile Station Classmark3 */
2416 elm_len = tvb_get_uint8(tvb, offset);
2417 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
2418 offset += 1;
2419 if (elm_len) {
2420 fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
2421 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2422 de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2423 offset += elm_len;
2426 /*Length of Supported Codec List */
2427 elm_len = tvb_get_uint8(tvb, offset);
2428 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
2429 offset += 1;
2430 if (elm_len) {
2431 fi = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
2432 ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
2433 de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2438 /* 6.7 SRVCC Cause */
2439 static const value_string gtpv2_srvcc_cause_vals[] = {
2440 {0, "Reserved"},
2441 {1, "Unspecified"},
2442 {2, "Handover/Relocation cancelled by source system "},
2443 {3, "Handover /Relocation Failure with Target system"},
2444 {4, "Handover/Relocation Target not allowed"},
2445 {5, "Unknown Target ID"},
2446 {6, "Target Cell not available"},
2447 {7, "No Radio Resources Available in Target Cell"},
2448 {8, "Failure in Radio Interface Procedure"},
2449 {9, "Permanent session leg establishment error"},
2450 {10, "Temporary session leg establishment error"},
2452 {0, NULL}
2454 static value_string_ext gtpv2_srvcc_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_srvcc_cause_vals);
2456 static void
2457 dissect_gtpv2_srvcc_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2459 int offset = 0;
2460 uint8_t srvcc_cause;
2462 srvcc_cause = tvb_get_uint8(tvb, offset);
2463 proto_tree_add_item(tree, hf_gtpv2_srvcc_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
2464 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(srvcc_cause, &gtpv2_srvcc_cause_vals_ext, "Unknown"), srvcc_cause);
2469 * 3GPP TS 29.280 version 10.3.0
2470 * 6.8 Target RNC ID
2472 static void
2473 dissect_gtpv2_tgt_rnc_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2475 int offset = 0;
2476 uint16_t rnc_id;
2477 proto_tree *subtree;
2478 uint32_t mcc;
2479 uint32_t mnc;
2480 uint32_t lac;
2481 uint32_t curr_offset;
2483 /*ra_type_flag = 1;*/ /*Flag to be set to differentiate GERAN and UTRAN*/
2484 curr_offset = offset;
2486 mcc = (tvb_get_uint8(tvb, curr_offset) & 0x0f) << 8;
2487 mcc |= (tvb_get_uint8(tvb, curr_offset) & 0xf0);
2488 mcc |= (tvb_get_uint8(tvb, curr_offset+1) & 0x0f);
2489 mnc = (tvb_get_uint8(tvb, curr_offset+2) & 0x0f) << 8;
2490 mnc |= (tvb_get_uint8(tvb, curr_offset+2) & 0xf0);
2491 mnc |= (tvb_get_uint8(tvb, curr_offset+1) & 0xf0) >> 4;
2492 if ((mnc & 0x000f) == 0x000f)
2493 mnc = mnc >> 4;
2495 lac = tvb_get_ntohs(tvb, curr_offset + 3);
2496 rnc_id = tvb_get_ntohs(tvb, curr_offset + 5);
2498 subtree = proto_tree_add_subtree_format(tree,
2499 tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
2500 "Routing area identification: %x-%x-%u-%u",
2501 mcc, mnc, lac, rnc_id);
2503 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, E212_RAI, true);
2504 curr_offset+=3;
2506 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2507 curr_offset+=2;
2508 proto_tree_add_item(subtree, hf_gtpv2_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2509 /*curr_offset+=2;*/
2511 /* no length check possible */
2517 * 3GPP TS 29.280
2518 * 6.9 Target Global Cell ID
2519 * The encoding of this IE is defined in 3GPP TS 29.002
2520 * GlobalCellId ::= OCTET STRING (SIZE (5..7))
2521 * -- Refers to Cell Global Identification defined in TS 3GPP TS 23.003 [17].
2522 * -- The internal structure is defined as follows:
2523 * -- octet 1 bits 4321 Mobile Country Code 1st digit
2524 * -- bits 8765 Mobile Country Code 2nd digit
2525 * -- octet 2 bits 4321 Mobile Country Code 3rd digit
2526 * -- bits 8765 Mobile Network Code 3rd digit
2527 * -- or filler (1111) for 2 digit MNCs
2528 * -- octet 3 bits 4321 Mobile Network Code 1st digit
2529 * -- bits 8765 Mobile Network Code 2nd digit
2530 * -- octets 4 and 5 Location Area Code according to TS 3GPP TS 24.008 [35]
2531 * -- octets 6 and 7 Cell Identity (CI) according to TS 3GPP TS 24.008 [35]
2533 static void
2534 dissect_gtpv2_tgt_global_cell_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2536 int offset = 0;
2537 uint8_t tgt_cell_id;
2538 proto_tree *subtree;
2539 uint32_t mcc;
2540 uint32_t mnc;
2541 uint32_t lac;
2542 uint32_t curr_offset;
2544 curr_offset = offset;
2546 mcc = (tvb_get_uint8(tvb, curr_offset) & 0x0f) << 8;
2547 mcc |= (tvb_get_uint8(tvb, curr_offset) & 0xf0);
2548 mcc |= (tvb_get_uint8(tvb, curr_offset+1) & 0x0f);
2549 mnc = (tvb_get_uint8(tvb, curr_offset+2) & 0x0f) << 8;
2550 mnc |= (tvb_get_uint8(tvb, curr_offset+2) & 0xf0);
2551 mnc |= (tvb_get_uint8(tvb, curr_offset+1) & 0xf0) >> 4;
2552 if ((mnc & 0x000f) == 0x000f)
2553 mnc = mnc >> 4;
2555 lac = tvb_get_ntohs(tvb, curr_offset + 3);
2556 tgt_cell_id = tvb_get_uint8(tvb, curr_offset + 5);
2558 subtree = proto_tree_add_subtree_format(tree,
2559 tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
2560 "Routing area identification: %x-%x-%u-%u",
2561 mcc, mnc, lac, tgt_cell_id);
2563 dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, E212_RAI, true);
2565 proto_tree_add_item(subtree, hf_gtpv2_lac, tvb, curr_offset + 3, 2, ENC_BIG_ENDIAN);
2566 proto_tree_add_item(subtree, hf_gtpv2_tgt_g_cell_id, tvb, curr_offset + 5, 2, ENC_BIG_ENDIAN);
2568 proto_item_append_text(item, "%x-%x-%u-%u", mcc, mnc, lac, tgt_cell_id);
2569 /* no length check possible */
2573 /* 6.10 Tunnel Endpoint Identifier for Control Plane (TEID-C) */
2574 static void
2575 dissect_gtpv2_teid_c(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2577 int offset = 0;
2579 proto_tree_add_item(tree, hf_gtpv2_teid_c, tvb, offset, 4, ENC_BIG_ENDIAN);
2580 offset += 4;
2581 if (length > 4)
2582 proto_tree_add_item(tree, hf_gtpv2_teid_c_spare, tvb, offset, length-4, ENC_NA);
2584 proto_item_append_text(item, "%u", tvb_get_ntohl(tvb, offset-4));
2587 /* 6.11 Sv Flags */
2588 static void
2589 dissect_gtpv2_sv_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2591 int offset = 0;
2592 static int* const sv_flags[] = {
2593 &hf_gtpv2_sv_sti,
2594 &hf_gtpv2_sv_ics,
2595 &hf_gtpv2_sv_emind,
2596 NULL
2599 proto_tree_add_bitmask_list(tree, tvb, offset, 1, sv_flags, ENC_NA);
2600 offset += 1;
2601 if (length > 1)
2602 proto_tree_add_item(tree, hf_gtpv2_teid_c_spare, tvb, offset, length-1, ENC_NA);
2605 /* 6.12 Service Area Identifier */
2607 static void
2608 dissect_gtpv2_sai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2610 int offset = 0;
2612 /* 5 MCC digit 2 MCC digit 1
2613 * 6 MNC digit 3 MCC digit 3
2614 * 7 MNC digit 2 MNC digit 1
2616 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_SAI, true);
2617 offset += 3;
2619 /* 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
2620 * least significant bit. The coding of the location area code is the responsibility of each administration. Coding using full
2621 * hexadecimal representation shall be used.
2623 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
2624 offset += 2;
2626 /* 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
2627 * least significant bit. The SAC is defined by the operator. See 3GPP TS 23.003 [4] subclause 12.5 for more information
2629 proto_tree_add_item(tree, hf_gtpv2_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
2632 /* 6.13 MM Context for CS to PS SRVCC */
2633 static void
2634 dissect_gtpv2_mm_ctx_for_cs_to_ps_srvcc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2636 int offset = 0;
2638 /* Octet 5 KSI"PS */
2639 proto_tree_add_item(tree, hf_gtpv2_ksi_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
2640 offset++;
2642 /* octet 6 - 21 CK'PS */
2643 proto_tree_add_item(tree, hf_gtpv2_ck_ps, tvb, offset, 16, ENC_NA);
2644 offset+=16;
2646 /* octet 22 - 37 IK'PS */
2647 proto_tree_add_item(tree, hf_gtpv2_ik_ps, tvb, offset, 16, ENC_NA);
2648 offset += 16;
2650 /* octet 38 to 45 kc'PS */
2651 proto_tree_add_item(tree, hf_gtpv2_kc_ps, tvb, offset, 8, ENC_NA);
2652 offset += 8;
2654 /* Octet 46 CKSN"PS */
2655 proto_tree_add_item(tree, hf_gtpv2_cksn_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
2656 /*offset++;*/
2659 /*End SRVCC Messages*/
2663 * 8.6 Access Point Name (APN)
2664 * The encoding the APN field follows 3GPP TS 23.003 [2] subclause 9.1.
2665 * The content of the APN field shall be the full APN with both the APN Network Identifier
2666 * and APN Operator Identifier being present as specified in 3GPP TS 23.003 [2]
2667 * 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.
2669 void
2670 dissect_gtpv2_apn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2672 const uint8_t *apn = NULL;
2674 proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, 0, length, ENC_APN_STR | ENC_NA, pinfo->pool, &apn);
2675 if (apn) {
2676 proto_item_append_text(item, "%s", apn);
2682 * 8.7 Aggregate Maximum Bit Rate (AMBR)
2685 void
2686 dissect_gtpv2_ambr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2688 int offset = 0;
2690 proto_tree_add_item(tree, hf_gtpv2_ambr_up, tvb, offset, 4, ENC_BIG_ENDIAN);
2691 offset += 4;
2692 proto_tree_add_item(tree, hf_gtpv2_ambr_down, tvb, offset, 4, ENC_BIG_ENDIAN);
2696 * 8.8 EPS Bearer ID (EBI)
2698 static void
2699 dissect_gtpv2_ebi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2702 int offset = 0;
2703 uint8_t ebi;
2705 /* Spare (all bits set to 0) B8 - B5*/
2706 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
2707 /* EPS Bearer ID (EBI) B4 - B1 */
2708 ebi = tvb_get_uint8(tvb, offset);
2709 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2710 proto_item_append_text(item, "%u", ebi);
2714 * 8.9 IP Address
2716 static void
2717 dissect_gtpv2_ip_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2719 int offset = 0;
2721 if (length == 4)
2723 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv4, tvb, offset, length, ENC_BIG_ENDIAN);
2724 proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
2726 else if (length == 16)
2728 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv6, tvb, offset, length, ENC_NA);
2729 proto_item_append_text(item, "IPv6 %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
2733 * 8.10 Mobile Equipment Identity (MEI)
2734 * The ME Identity field contains either the IMEI or the IMEISV
2735 * as defined in clause 6.2 of 3GPP TS 23.003 [2]. It is encoded
2736 * as specified in clause 7.7.53 of 3GPP TS 29.060 [4], beginning
2737 * with octet 4 of Figure 7.7.53.1. The IMEI(SV) digits are encoded
2738 * using BCD coding where IMEI is 15 BCD digits and IMEISV is 16 BCD
2739 * digits. For IMEI, bits 5 to 8 of the last octet shall be filled
2740 * with an end mark coded as '1111'.
2743 void
2744 dissect_gtpv2_mei(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2746 int offset = 0;
2747 char *mei_str;
2749 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
2750 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
2751 * allocated string will be returned.
2753 proto_tree_add_item_ret_display_string(tree, hf_gtpv2_mei, tvb, offset, length, ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN, pinfo->pool, &mei_str);
2754 proto_item_append_text(item, "%s", mei_str);
2758 * 8.11 MSISDN
2760 * MSISDN is defined in 3GPP TS 23.003
2761 * Editor's note: MSISDN coding will be defined in TS 24.301.
2763 static void
2764 dissect_gtpv2_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2766 const char *digit_str;
2768 /* Octets 5 to (n+4) represent the MSISDN value is in international number format
2769 * as described in ITU-T Rec E.164 [25] and 3GPP TS 29.002 [41].
2770 * MSISDN value contains only the actual MSISDN number (does not contain the "nature of
2771 * address indicator" octet, which indicates "international number"
2772 * as in 3GPP TS 29.002 [41]) and is encoded as TBCD digits, i.e.
2773 * digits from 0 through 9 are encoded "0000" to "1001".
2774 * When there is an odd number of digits, bits 8 to 5 of the last octet are encoded with
2775 * the filler "1111".
2777 /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
2778 * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
2779 * allocated string will be returned.
2781 digit_str = dissect_e164_msisdn(tvb, tree, 0, length, E164_ENC_BCD);
2782 proto_item_append_text(item, "%s", digit_str);
2786 * 8.12 Indication
2788 void
2789 dissect_gtpv2_ind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
2791 int offset = 0;
2793 static int* const oct5_flags[] = {
2794 &hf_gtpv2_daf,
2795 &hf_gtpv2_dtf,
2796 &hf_gtpv2_hi,
2797 &hf_gtpv2_dfi,
2798 &hf_gtpv2_oi,
2799 &hf_gtpv2_isrsi,
2800 &hf_gtpv2_israi,
2801 &hf_gtpv2_sgwci,
2802 NULL
2805 /* Octet 5 DAF DTF HI DFI OI ISRSI ISRAI SGWCI */
2806 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct5_flags, ENC_NA);
2807 if (length == 1) {
2808 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");
2809 return;
2812 offset += 1;
2814 static int* const oct6_flags[] = {
2815 &hf_gtpv2_sqci,
2816 &hf_gtpv2_uimsi,
2817 &hf_gtpv2_cfsi,
2818 &hf_gtpv2_crsi,
2819 &hf_gtpv2_ps,
2820 &hf_gtpv2_pt,
2821 &hf_gtpv2_si,
2822 &hf_gtpv2_msv,
2823 NULL
2826 /* Octet 6 SQCI UIMSI CFSI CRSI P PT SI MSV
2827 * 3GPP TS 29.274 version 9.4.0 Release 9
2830 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct6_flags, ENC_NA);
2831 offset += 1;
2833 if (length == 2) {
2834 return;
2836 /* Only present in version 9 and higher */
2837 static int* const oct7_flags[] = {
2838 &hf_gtpv2_retloc,
2839 &hf_gtpv2_pbic,
2840 &hf_gtpv2_srni,
2841 &hf_gtpv2_s6af,
2842 &hf_gtpv2_s4af,
2843 &hf_gtpv2_mbmdt,
2844 &hf_gtpv2_israu,
2845 &hf_gtpv2_ccrsi,
2846 NULL
2849 /* Octet 7 RetLoc PBIC SRNI S6AF S4AF MBMDT ISRAU CCRSI */
2850 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct7_flags, ENC_NA);
2851 offset += 1;
2853 if (length == 3) {
2854 return;
2856 static int* const oct8_flags[] = {
2857 &hf_gtpv2_cprai,
2858 &hf_gtpv2_arrl,
2859 &hf_gtpv2_ppof,
2860 &hf_gtpv2_ppon_ppei,
2861 &hf_gtpv2_ppsi,
2862 &hf_gtpv2_csfbi,
2863 &hf_gtpv2_clii,
2864 &hf_gtpv2_cpsr,
2865 NULL
2868 /* Octet 8 CPRAI ARRL PPOF PPON/PPEI PPSI CSFBI CLII CPSR */
2869 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct8_flags, ENC_NA);
2870 offset += 1;
2872 if (length == 4) {
2873 return;
2876 static int* const oct9_flags[] = {
2877 &hf_gtpv2_nsi,
2878 &hf_gtpv2_uasi,
2879 &hf_gtpv2_dtci,
2880 &hf_gtpv2_bdwi,
2881 &hf_gtpv2_psci,
2882 &hf_gtpv2_pcri,
2883 &hf_gtpv2_aosi,
2884 &hf_gtpv2_aopi,
2885 NULL
2888 /* Octet 9 NSI UASI DTCI BDWI PSCI PCRI AOSI AOPI */
2889 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct9_flags, ENC_NA);
2890 offset += 1;
2892 if (length == 5) {
2893 return;
2896 static int* const oct10_flags[] = {
2897 &hf_gtpv2_roaai,
2898 &hf_gtpv2_epcosi,
2899 &hf_gtpv2_cpopci,
2900 &hf_gtpv2_pmtsmi,
2901 &hf_gtpv2_s11tf,
2902 &hf_gtpv2_pnsi,
2903 &hf_gtpv2_unaccsi,
2904 &hf_gtpv2_wpmsi,
2905 NULL
2907 /* Octet 10 ROAAI EPCOSI CPOPCI PMTSMI S11TF PNSI UNACCSI WPMSI */
2908 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct10_flags, ENC_NA);
2909 offset += 1;
2911 if (length == 6){
2912 return;
2915 static int* const oct11_flags[] = {
2916 &hf_gtpv2_5gsnn26,
2917 &hf_gtpv2_reprefi,
2918 &hf_gtpv2_5gsiwk,
2919 &hf_gtpv2_eevrsi,
2920 &hf_gtpv2_ltemui,
2921 &hf_gtpv2_ltempi,
2922 &hf_gtpv2_enbcrsi,
2923 &hf_gtpv2_tspcmi,
2924 NULL
2926 /*Octet 11 5GSNN26 REPREFI 5GSIWK EEVRSI LTEMUI LTEMPI ENBCRSI TSPCMI */
2927 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct11_flags, ENC_NA);
2928 offset += 1;
2930 if (length == 7){
2931 return;
2934 static int* const oct12_flags[] = {
2935 &hf_gtpv2_csrmfi,
2936 &hf_gtpv2_mtedtn,
2937 &hf_gtpv2_mtedta,
2938 &hf_gtpv2_n5gnmi,
2939 &hf_gtpv2_5gcnrs,
2940 &hf_gtpv2_5gcnri,
2941 &hf_gtpv2_5srhoi,
2942 &hf_gtpv2_ethpdn,
2943 NULL
2945 /* Octet 12 CSRMFI MTEDTN MTEDTA N5GNMI 5GCNRS 5GCNRI 5SRHOI ETHPDN */
2947 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct12_flags, ENC_NA);
2948 offset += 1;
2950 if (length == 8) {
2951 return;
2954 static int* const oct13_flags[] = {
2955 &hf_gtpv2_nspusi,
2956 &hf_gtpv2_pgwrnsi,
2957 &hf_gtpv2_rppcsi,
2958 &hf_gtpv2_pgwchi,
2959 &hf_gtpv2_sissme,
2960 &hf_gtpv2_nsenbi,
2961 &hf_gtpv2_idfupf,
2962 &hf_gtpv2_emci,
2963 NULL
2966 /* Octet 13 NSOUSI PGWRNSI RPPCSI PGWCHI SISSME NSENBI IDFUPF EMCI */
2967 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct13_flags, ENC_NA);
2968 offset += 1;
2970 if (length == 9) {
2971 return;
2974 static int* const oct14_flags[] = {
2975 &hf_gtpv2_spare_b7_b4,
2976 &hf_gtpv2_lapcosi,
2977 &hf_gtpv2_ltemsai,
2978 &hf_gtpv2_srtpi,
2979 &hf_gtpv2_upipsi,
2980 NULL
2983 /* Octet 13 Spare LAPCOSI LTEMSAI SRTPI UPIPSI */
2984 proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct14_flags, ENC_NA);
2985 offset += 1;
2987 if (length == 10) {
2988 return;
2991 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
2997 * 8.13 Protocol Configuration Options (PCO)
2998 * Protocol Configuration Options (PCO) is transferred via GTP tunnels. The sending entity copies the value part of the
2999 * 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
3000 * as per clause 10.5.6.3 of 3GPP TS 24.008 [5], starting with octet 3.
3001 * Dissected in packet-gsm_a_gm.c
3003 static void
3004 dissect_gtpv2_pco(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3006 switch (message_type) {
3007 case GTPV2_CREATE_SESSION_REQUEST:
3008 case GTPV2_DELETE_SESSION_REQUEST:
3009 case GTPV2_BEARER_RESOURCE_COMMAND:
3010 case GTPV2_CREATE_BEARER_RESPONSE:
3011 case GTPV2_UPDATE_BEARER_RESPONSE:
3012 case GTPV2_DELETE_BEARER_RESPONSE:
3013 /* PCO options as MS to network direction */
3014 pinfo->link_dir = P2P_DIR_UL;
3015 break;
3016 case GTPV2_CREATE_SESSION_RESPONSE:
3017 case GTPV2_MODIFY_BEARER_RESPONSE:
3018 case GTPV2_DELETE_SESSION_RESPONSE:
3019 case GTPV2_CREATE_BEARER_REQUEST:
3020 case GTPV2_UPDATE_BEARER_REQUEST:
3021 case GTPV2_DELETE_BEARER_REQUEST:
3022 /* PCO options as Network to MS direction: */
3023 pinfo->link_dir = P2P_DIR_DL;
3024 break;
3025 default:
3026 break;
3028 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
3032 * 8.14 PDN Address Allocation (PAA)
3035 static const value_string gtpv2_pdn_type_vals[] = {
3036 {1, "IPv4"},
3037 {2, "IPv6"},
3038 {3, "IPv4/IPv6"},
3039 {4, "Non-IP"},
3040 {5, "Ethernet"},
3041 {0, NULL}
3043 value_string_ext gtpv2_pdn_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_pdn_type_vals);
3045 void
3046 dissect_gtpv2_paa(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3048 int offset = 0;
3049 uint8_t pdn_type;
3051 pdn_type = tvb_get_uint8(tvb, offset);
3052 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3053 offset += 1;
3054 switch (pdn_type)
3056 case 1:
3057 /* IPv4 */
3058 if (length != 5) {
3059 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3060 "Wrong length indicated. Expected 5, got %u", length);
3061 return;
3063 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
3064 proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3065 break;
3066 case 2:
3067 /* IPv6*/
3068 /* If PDN type value indicates IPv6, octet 6 contains the IPv6 Prefix Length.
3069 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
3070 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
3071 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
3073 if (length != 18) {
3074 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3075 "Wrong length indicated. Expected 18, got %u", length);
3076 return;
3078 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3079 offset += 1;
3080 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
3081 proto_item_append_text(item, "IPv6 %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
3082 break;
3083 case 3:
3084 /* IPv4/IPv6 */
3085 /* If PDN type value indicates IPv4v6, octet 6 contains the IPv6 Prefix Length.
3086 * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
3087 * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
3088 * and Interface Identifier and bit 1 of octet 22 the least significant bit.
3089 * Octets 23 through 26 contain an IPv4 address. Bit 8 of octet 23 represents
3090 * the most significant bit of the IPv4 address and bit 1 of octet 26 the least
3091 * significant bit.
3093 if (length != 22) {
3094 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3095 "Wrong length indicated. Expected 22, got %u", length);
3096 return;
3098 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3099 offset += 1;
3100 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
3101 proto_item_append_text(item, "IPv6 %s, ", tvb_ip6_to_str(pinfo->pool, tvb, offset));
3102 offset += 16;
3103 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
3104 proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3105 break;
3106 case 4: /* Non IP */
3107 case 5: /* Ethernet */
3108 /* If PDN type value indicates Non-IP or Ethernet, octets from 6 to 'n+4'
3109 shall not be present. */
3110 if (length != 1) {
3111 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3112 "Wrong length indicated. Expected 1, got %u", length);
3113 return;
3115 default:
3116 break;
3120 * 8.15 Bearer Quality of Service (Bearer QoS)
3123 void
3124 dissect_gtpv2_bearer_qos(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3126 int offset = 0;
3127 static int* const bearer_qos_oct1_flags[] = {
3128 &hf_gtpv2_bearer_qos_pci,
3129 &hf_gtpv2_bearer_qos_pl,
3130 &hf_gtpv2_bearer_qos_pvi,
3131 NULL
3133 proto_tree_add_bitmask_list(tree, tvb, offset, 1, bearer_qos_oct1_flags, ENC_BIG_ENDIAN);
3134 offset += 1;
3135 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
3136 offset += 1;
3137 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
3138 offset += 5;
3139 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
3140 offset += 5;
3141 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
3142 offset += 5;
3143 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
3147 * 8.16 Flow Quality of Service (Flow QoS)
3150 static void
3151 dissect_gtpv2_flow_qos(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3153 int offset = 0;
3154 proto_tree_add_item(tree, hf_gtpv2_flow_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
3155 offset += 1;
3156 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
3157 offset += 5;
3158 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
3159 offset += 5;
3160 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_up, tvb, offset, 5, ENC_BIG_ENDIAN);
3161 offset += 5;
3162 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_down, tvb, offset, 5, ENC_BIG_ENDIAN);
3166 * 8.17 RAT Type
3168 static const value_string gtpv2_rat_type_vals[] = {
3169 {0, "Reserved"},
3170 {1, "UTRAN"},
3171 {2, "GERAN"},
3172 {3, "WLAN"},
3173 {4, "GAN"},
3174 {5, "HSPA Evolution"},
3175 {6, "EUTRAN"},
3176 {7, "Virtual"},
3177 {8, "EUTRAN-NB-IoT"},
3178 {9, "LTE-M"},
3179 {10, "NR"},
3180 {11, "WB-E-UTRAN(LEO)"},
3181 {12, "WB-E-UTRAN(MEO)"},
3182 {13, "WB-E-UTRAN(GEO)"},
3183 {14, "WB-E-UTRAN(OTHERSAT)"},
3184 {15, "EUTRAN-NB-IoT(LEO)"},
3185 {16, "EUTRAN-NB-IoT(MEO)"},
3186 {17, "EUTRAN-NB-IoT(GEO)"},
3187 {18, "EUTRAN-NB-IoT(OTHERSAT)"},
3188 {19, "LTE-M(LEO)"},
3189 {20, "LTE-M(MEO)"},
3190 {21, "LTE-M(GEO)"},
3191 {22, "LTE-M(OTHERSAT)"},
3192 {0, NULL}
3194 value_string_ext gtpv2_rat_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_rat_type_vals);
3197 static void
3198 dissect_gtpv2_rat_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3200 uint8_t rat_type;
3202 rat_type = tvb_get_uint8(tvb, 0);
3203 proto_tree_add_item(tree, hf_gtpv2_rat_type, tvb, 0, 1, ENC_BIG_ENDIAN);
3204 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(rat_type, &gtpv2_rat_type_vals_ext, "Unknown"), rat_type);
3209 * 8.18 Serving Network
3211 static void
3212 dissect_gtpv2_serv_net(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3214 char *mcc_mnc_str;
3216 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_SERV_NET, true);
3217 proto_item_append_text(item, "%s", mcc_mnc_str);
3221 * 8.19 EPS Bearer Level Traffic Flow Template (Bearer TFT)
3224 static void
3225 dissect_gtpv2_bearer_tft(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3227 /* The detailed coding of Traffic Aggregate
3228 * Description is specified in 3GPP TS 24.008 [5] ,
3229 * clause 10.5.6.12, beginning with octet 3..
3230 * Use the decoding in packet-gsm_a_gm.c
3232 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
3235 /* 8.20 Traffic Aggregate Description (TAD)
3237 static void
3238 dissect_gtpv2_tad(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3240 /* The detailed coding of Traffic Aggregate
3241 * Description is specified in 3GPP TS 24.008 [5] ,
3242 * clause 10.5.6.12, beginning with octet 3..
3243 * Use the decoding in packet-gsm_a_gm.c
3245 de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
3249 * 8.21 User Location Info (ULI)
3251 * The flags ECGI, TAI, RAI, SAI and CGI in octed 5 indicate if the corresponding
3252 * fields are present in the IE or not. If one of these flags is set to "0",
3253 * the corresponding field is not present at all. The respective identities are defined in 3GPP
3254 * TS 23.003 [2].
3255 * Editor's Note: The definition of ECGI is missing in 3GPP TS 23.003 v8.1.0.
3256 * It can be found in 3GPP TS 36.413 v8.3.0, but it is expected that it will be moved
3257 * to 23.003 in a future version.
3259 char*
3260 dissect_gtpv2_tai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, bool is_5gs)
3262 char *str = NULL;
3263 char *mcc_mnc_str;
3264 uint32_t tac;
3266 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_TAI, true);
3267 *offset += 3;
3268 if (is_5gs) {
3269 proto_tree_add_item_ret_uint(tree, hf_gtpv2_5gs_tai_tac, tvb, *offset, 3, ENC_BIG_ENDIAN, &tac);
3270 *offset += 3;
3271 } else {
3272 proto_tree_add_item_ret_uint(tree, hf_gtpv2_tai_tac, tvb, *offset, 2, ENC_BIG_ENDIAN, &tac);
3273 *offset += 2;
3275 str = wmem_strdup_printf(pinfo->pool, "%s, TAC 0x%x",
3276 mcc_mnc_str,
3277 tac);
3279 return str;
3282 static char*
3283 dissect_gtpv2_ecgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3285 char *str = NULL;
3286 char *mcc_mnc_str;
3287 uint8_t octet;
3288 uint32_t octet4;
3289 uint8_t spare;
3290 uint32_t ECGI;
3291 static int* const ECGI_flags[] = {
3292 &hf_gtpv2_enodebid,
3293 &hf_gtpv2_cellid,
3294 NULL
3297 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_ECGI, true);
3298 *offset += 3;
3299 /* The bits 8 through 5, of octet e+3 (Fig 8.21.5-1 in TS 29.274 V8.2.0) are spare
3300 * and hence they would not make any difference to the hex string following it,
3301 * thus we directly read 4 bytes from the tvb
3304 octet = tvb_get_uint8(tvb, *offset);
3305 spare = octet & 0xF0;
3306 octet4 = tvb_get_ntohl(tvb, *offset);
3307 ECGI = octet4 & 0x0FFFFFFF;
3308 proto_tree_add_uint(tree, hf_gtpv2_ecgi_eci_spare, tvb, *offset, 1, spare);
3309 /* The coding of the E-UTRAN cell identifier is the responsibility of each administration.
3310 * Coding using full hexadecimal representation shall be used.
3312 proto_tree_add_bitmask(tree, tvb, *offset, hf_gtpv2_ecgi_eci, ett_gtpv2_eci, ECGI_flags, ENC_BIG_ENDIAN);
3313 *offset += 4;
3314 str = wmem_strdup_printf(pinfo->pool, "%s, ECGI 0x%x",
3315 mcc_mnc_str,
3316 ECGI);
3319 return str;
3322 static char*
3323 dissect_gtpv2_rai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3325 char *str = NULL;
3326 char *mcc_mnc_str;
3327 uint16_t lac, rac;
3329 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_RAI, true);
3330 *offset += 3;
3331 lac = tvb_get_ntohs(tvb, *offset);
3332 proto_tree_add_item(tree, hf_gtpv2_rai_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3333 *offset += 2;
3334 /* 3GPP 29.274 8.21.3 RAI Field
3335 * "Only Octet c+5 contains the RAC. Octet c+6 is coded as all 1's (11111111)."
3336 * (We could, here and in GTP, check that the other octet is all 1's.)
3338 rac = tvb_get_uint8(tvb, *offset);
3339 proto_tree_add_item(tree, hf_gtpv2_rai_rac, tvb, *offset, 1, ENC_BIG_ENDIAN);
3340 *offset += 2;
3341 str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, RAC 0x%x",
3342 mcc_mnc_str,
3343 lac,
3344 rac);
3346 return str;
3349 static char*
3350 dissect_gtpv2_sai_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3352 char *str = NULL;
3353 char *mcc_mnc_str;
3354 uint16_t lac, sac;
3356 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_SAI, true);
3357 *offset += 3;
3358 lac = tvb_get_ntohs(tvb, *offset);
3359 proto_tree_add_item(tree, hf_gtpv2_sai_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3360 *offset += 2;
3361 sac = tvb_get_ntohs(tvb, *offset);
3362 proto_tree_add_item(tree, hf_gtpv2_sai_sac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3363 *offset += 2;
3364 str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, SAC 0x%x",
3365 mcc_mnc_str,
3366 lac,
3367 sac);
3369 return str;
3372 static char*
3373 dissect_gtpv2_cgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3375 char *str = NULL;
3376 char *mcc_mnc_str;
3377 uint16_t lac, ci;
3379 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_CGI, true);
3380 *offset += 3;
3381 lac = tvb_get_ntohs(tvb, *offset);
3382 proto_tree_add_item(tree, hf_gtpv2_uli_cgi_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3383 *offset += 2;
3384 ci = tvb_get_ntohs(tvb, *offset);
3385 proto_tree_add_item(tree, hf_gtpv2_uli_cgi_ci, tvb, *offset, 2, ENC_BIG_ENDIAN);
3386 *offset += 2;
3387 str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, CI 0x%x",
3388 mcc_mnc_str,
3389 lac,
3390 ci);
3392 return str;
3395 static char*
3396 dissect_gtpv2_macro_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3398 char *str = NULL;
3399 char *mcc_mnc_str;
3400 uint32_t macro_enodeb_id;
3402 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
3403 *offset += 3;
3404 /* The Macro eNodeB ID consists of 20 bits.
3405 * Bit 4 of Octet 4 is the most significant bit and bit 1 of Octet 6 is the least significant bit.
3407 proto_tree_add_item_ret_uint(tree, hf_gtpv2_macro_enodeb_id, tvb, *offset, 3, ENC_BIG_ENDIAN, &macro_enodeb_id);
3408 *offset += 3;
3410 str = wmem_strdup_printf(pinfo->pool, "%s, Macro eNodeB ID 0x%x",
3411 mcc_mnc_str,
3412 macro_enodeb_id);
3414 return str;
3417 static const true_false_string gtpv2_smenb = {
3418 "Short Macro eNodeB ID",
3419 "Long Macro eNodeB ID",
3422 static char*
3423 dissect_gtpv2_ext_macro_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, int hfindex)
3425 char *str = NULL;
3426 char *mcc_mnc_str;
3427 uint32_t ext_macro_enodeb_id;
3429 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
3430 *offset += 3;
3431 /* The Extended Macro eNodeB ID consists of 21 bits. */
3432 proto_tree_add_item(tree, hf_gtpv2_smenb, tvb, *offset, 1, ENC_BIG_ENDIAN);
3433 proto_tree_add_item_ret_uint(tree, hfindex, tvb, *offset, 3, ENC_BIG_ENDIAN, &ext_macro_enodeb_id);
3434 *offset += 3;
3436 str = wmem_strdup_printf(pinfo->pool, "%s, Extended Macro %seNodeB ID 0x%x",
3437 mcc_mnc_str,
3438 hfindex == hf_gtpv2_ext_macro_ng_enodeb_id ? "ng-" : "",
3439 ext_macro_enodeb_id);
3441 return str;
3445 static char*
3446 decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t instance _U_, unsigned flags)
3448 int offset = 1; /* flags are already dissected */
3449 proto_tree *part_tree;
3450 char *mcc_mnc_str;
3451 char *str = NULL;
3453 /* 8.21.1 CGI field */
3454 if (flags & GTPv2_ULI_CGI_MASK)
3457 proto_item_append_text(item, "CGI ");
3458 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3459 ett_gtpv2_uli_field, NULL, "Cell Global Identity (CGI)");
3461 str = dissect_gtpv2_cgi(tvb, pinfo, part_tree, &offset);
3463 if (offset == length)
3464 return str;
3467 /* 8.21.2 SAI field */
3468 if (flags & GTPv2_ULI_SAI_MASK)
3470 proto_item_append_text(item, "SAI ");
3471 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3472 ett_gtpv2_uli_field, NULL, "Service Area Identity (SAI)");
3474 str = dissect_gtpv2_sai_common(tvb, pinfo, part_tree, &offset);
3476 if (offset == length)
3477 return str;
3479 /* 8.21.3 RAI field */
3480 if (flags & GTPv2_ULI_RAI_MASK)
3482 proto_item_append_text(item, "RAI ");
3483 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3484 ett_gtpv2_uli_field, NULL, "Routeing Area Identity (RAI)");
3486 str = dissect_gtpv2_rai(tvb, pinfo, part_tree, &offset);
3488 if (offset == length)
3489 return str;
3491 /* 8.21.4 TAI field */
3492 if (flags & GTPv2_ULI_TAI_MASK)
3494 proto_item_append_text(item, "TAI ");
3495 part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
3496 ett_gtpv2_uli_field, NULL, "Tracking Area Identity (TAI)");
3498 str = dissect_gtpv2_tai(tvb, pinfo, part_tree, &offset, false);
3500 if (offset == length)
3501 return str;
3503 /* 8.21.5 ECGI field */
3504 if (flags & GTPv2_ULI_ECGI_MASK)
3506 proto_item_append_text(item, "ECGI ");
3507 part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3508 ett_gtpv2_uli_field, NULL, "E-UTRAN Cell Global Identifier (ECGI)");
3510 str = dissect_gtpv2_ecgi(tvb, pinfo, part_tree, &offset);
3512 if (offset == length)
3513 return str;
3516 /* 8.21.6 LAI field */
3517 if (flags & GTPv2_ULI_LAI_MASK)
3519 uint16_t lac;
3520 proto_item_append_text(item, "LAI ");
3521 part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
3522 ett_gtpv2_uli_field, NULL, "LAI (Location Area Identifier)");
3523 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, E212_LAI, true);
3524 offset += 3;
3526 /* The Location Area Code (LAC) consists of 2 octets. Bit 8 of Octet f+3 is the most significant bit
3527 * and bit 1 of Octet f+4 the least significant bit. The coding of the location area code is the
3528 * responsibility of each administration. Coding using full hexadecimal representation shall be used.
3530 proto_tree_add_item(part_tree, hf_gtpv2_uli_lai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
3531 lac = tvb_get_ntohs(tvb, offset);
3532 str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x",
3533 mcc_mnc_str,
3534 lac);
3537 /* 8.21.7 Macro eNodeB ID field */
3538 if (flags & GTPv2_ULI_MACRO_eNB_ID_MASK)
3540 proto_item_append_text(item, "Macro eNodeB ID ");
3541 part_tree = proto_tree_add_subtree(tree, tvb, offset, 6,
3542 ett_gtpv2_uli_field, NULL, "Macro eNodeB ID");
3544 str = dissect_gtpv2_macro_enodeb_id(tvb, pinfo, part_tree, &offset);
3546 if (offset == length)
3547 return str;
3550 /* 8.21.8 Extended Macro eNodeB ID field */
3551 if (flags & GTPv2_ULI_EXT_MACRO_eNB_ID_MASK)
3553 proto_item_append_text(item, "Ext Macro eNodeB ID ");
3554 part_tree = proto_tree_add_subtree(tree, tvb, offset, 6,
3555 ett_gtpv2_uli_field, NULL, "Extended Macro eNodeB ID");
3557 str = dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, part_tree, &offset, hf_gtpv2_ext_macro_enodeb_id);
3559 if (offset == length)
3560 return str;
3563 return str;
3567 void
3568 dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3570 int offset = 0;
3571 unsigned flags;
3573 static int * const gtpv2_uli_flags[] = {
3574 &hf_gtpv2_uli_ext_macro_enb_id_flg,
3575 &hf_gtpv2_uli_macro_enb_id_flg,
3576 &hf_gtpv2_uli_lai_flg,
3577 &hf_gtpv2_uli_ecgi_flg,
3578 &hf_gtpv2_uli_tai_flg,
3579 &hf_gtpv2_uli_rai_flg,
3580 &hf_gtpv2_uli_sai_flg,
3581 &hf_gtpv2_uli_cgi_flg,
3582 NULL
3585 flags = tvb_get_uint8(tvb, offset) & 0x3f;
3586 proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_gtpv2_uli_flags,
3587 ett_gtpv2_uli_flags, gtpv2_uli_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE| BMT_NO_INT);
3589 decode_gtpv2_uli(tvb, pinfo, tree, item, length, instance, flags);
3591 return;
3594 /* Diameter 3GPP AVP Code: 22 3GPP-User-Location-Info */
3596 * TS 29.061 v15.5.0
3597 * 16.4.7.2 Coding 3GPP Vendor-Specific RADIUS attributes
3599 static const value_string geographic_location_type_vals[] = {
3600 {0, "CGI"},
3601 {1, "SAI"},
3602 {2, "RAI"},
3603 {128, "TAI"},
3604 {129, "ECGI"},
3605 {130, "TAI and ECGI"},
3606 {131, "eNodeB ID"},
3607 {132, "TAI and eNodeB ID"},
3608 {133, "extended eNodeB ID"},
3609 {134, "TAI and extended eNodeB ID"},
3610 {135, "NCGI"},
3611 {136, "5GS TAI"},
3612 {137, "5GS TAI and NCGI"},
3613 {138, "NG-RAN Node ID"},
3614 {139, "5GS TAI and NG-RAN Node ID"},
3615 /* 140-255 Spare for future use */
3616 {0, NULL}
3619 static int
3620 dissect_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char **avp_str)
3622 int offset = 0;
3623 unsigned length;
3624 unsigned flags;
3625 uint32_t flags_3gpp;
3626 char *str_buf = NULL;
3627 length = tvb_reported_length(tvb);
3629 if (!avp_str)
3630 avp_str = &str_buf;
3632 proto_tree_add_item_ret_uint(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN, &flags_3gpp);
3633 offset++;
3635 switch (flags_3gpp)
3637 case 0:
3638 /* CGI */
3639 flags = GTPv2_ULI_CGI_MASK;
3640 break;
3641 case 1:
3642 /* SAI */
3643 flags = GTPv2_ULI_SAI_MASK;
3644 break;
3645 case 2:
3646 /* RAI */
3647 flags = GTPv2_ULI_RAI_MASK;
3648 break;
3649 case 128:
3650 /* TAI */
3651 flags = GTPv2_ULI_TAI_MASK;
3652 break;
3653 case 129:
3654 /* ECGI */
3655 flags = GTPv2_ULI_ECGI_MASK;
3656 break;
3657 case 130:
3658 /* TAI and ECGI */
3659 flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_ECGI_MASK;
3660 break;
3661 case 131:
3662 /* eNodeB ID */
3663 flags = GTPv2_ULI_MACRO_eNB_ID_MASK;
3664 break;
3665 case 132:
3666 /* TAI and eNodeB ID */
3667 flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_MACRO_eNB_ID_MASK;
3668 break;
3669 case 133:
3670 /* extended eNodeB ID */
3671 flags = GTPv2_ULI_EXT_MACRO_eNB_ID_MASK;
3672 break;
3673 case 134:
3674 /* TAI and extended eNodeB ID */
3675 flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_EXT_MACRO_eNB_ID_MASK;
3676 break;
3677 case 135:
3678 /* NCGI */
3680 char *mcc_mnc_str;
3681 uint64_t nr_cell_id;
3682 proto_tree *subtree;
3684 subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_gtpv2_uli_field, NULL,
3685 "NR Cell Global Identifier (NCGI)");
3686 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, offset, E212_NRCGI, true);
3687 offset += 3;
3688 proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id);
3689 *avp_str = wmem_strdup_printf(pinfo->pool,
3690 "%s, NR Cell Id 0x%" PRIx64,
3691 mcc_mnc_str, nr_cell_id);
3693 return length;
3694 case 136:
3695 /* 5GS TAI */
3697 proto_tree *subtree;
3699 subtree = proto_tree_add_subtree(tree, tvb, offset, 6, ett_gtpv2_uli_field, NULL,
3700 "Tracking Area Identity (TAI)");
3701 *avp_str = dissect_gtpv2_tai(tvb, pinfo, subtree, &offset, true);
3703 return length;
3704 case 137:
3705 /* 5GS TAI and NCGI */
3707 char *mcc_mnc_str;
3708 uint64_t nr_cell_id;
3709 proto_tree *subtree;
3711 subtree = proto_tree_add_subtree(tree, tvb, offset, 6, ett_gtpv2_uli_field, NULL,
3712 "Tracking Area Identity (TAI)");
3713 *avp_str = dissect_gtpv2_tai(tvb, pinfo, subtree, &offset, true);
3714 subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_gtpv2_uli_field, NULL,
3715 "NR Cell Global Identifier (NCGI)");
3716 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, offset, E212_NRCGI, true);
3717 offset += 3;
3718 proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id);
3719 *avp_str = wmem_strdup_printf(pinfo->pool,
3720 "%s, %s, NR Cell Id 0x%" PRIx64,
3721 *avp_str, mcc_mnc_str, nr_cell_id);
3723 return length;
3724 default:
3725 proto_tree_add_item(tree, hf_gtpv2_geographic_location, tvb, offset, -1, ENC_NA);
3726 return length;
3729 *avp_str = decode_gtpv2_uli(tvb, pinfo, tree, NULL, length, 0, flags);
3730 return length;
3733 static const
3734 char *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo)
3736 uint16_t length;
3738 length = dissect_3gpp_uli(tvb, pinfo, tree, NULL);
3739 return tvb_bytes_to_str(pinfo->pool, tvb, 0, length);
3744 dissect_diameter_3gpp_uli(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data)
3746 diam_sub_dis_t* diam_sub_dis = (diam_sub_dis_t*)data;
3748 if (diam_sub_dis) {
3749 return dissect_3gpp_uli(tvb, pinfo, tree, &diam_sub_dis->avp_str);
3750 } else {
3751 return dissect_3gpp_uli(tvb, pinfo, tree, NULL);
3756 * 8.22 Fully Qualified TEID (F-TEID)
3758 static const value_string gtpv2_f_teid_interface_type_vals[] = {
3759 { 0, "S1-U eNodeB GTP-U interface"},
3760 { 1, "S1-U SGW GTP-U interface"},
3761 { 2, "S12 RNC GTP-U interface"},
3762 { 3, "S12 SGW GTP-U interface"},
3763 { 4, "S5/S8 SGW GTP-U interface"},
3764 { 5, "S5/S8 PGW GTP-U interface"},
3765 { 6, "S5/S8 SGW GTP-C interface"},
3766 { 7, "S5/S8 PGW GTP-C interface"},
3767 { 8, "S5/S8 SGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
3768 "and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6)"}, */
3769 { 9, "S5/S8 PGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
3770 "and the control plane and user plane addresses are the same for PMIPv6)"}, */
3771 {10, "S11 MME GTP-C interface"},
3772 {11, "S11/S4 SGW GTP-C interface"},
3773 {12, "S10 MME GTP-C interface"},
3774 {13, "S3 MME GTP-C interface"},
3775 {14, "S3 SGSN GTP-C interface"},
3776 {15, "S4 SGSN GTP-U interface"},
3777 {16, "S4 SGW GTP-U interface"},
3778 {17, "S4 SGSN GTP-C interface"},
3779 {18, "S16 SGSN GTP-C interface"},
3780 {19, "eNodeB/gNodeB GTP-U interface for DL data forwarding"},
3781 {20, "eNodeB GTP-U interface for UL data forwarding"},
3782 {21, "RNC GTP-U interface for data forwarding"},
3783 {22, "SGSN GTP-U interface for data forwarding"},
3784 {23, "SGW GTP-U interface for data forwarding"},
3785 {24, "Sm MBMS GW GTP-C interface"},
3786 {25, "Sn MBMS GW GTP-C interface"},
3787 {26, "Sm MME GTP-C interface"},
3788 {27, "Sn SGSN GTP-C interface"},
3789 {28, "SGW GTP-U interface for UL data forwarding"},
3790 {29, "Sn SGSN GTP-U interface"},
3791 {30, "S2b ePDG GTP-C interface"},
3792 {31, "S2b-U ePDG GTP-U interface"},
3793 {32, "S2b PGW GTP-C interface"},
3794 {33, "S2b-U PGW GTP-U interface"},
3795 {34, "S2a TWAN GTP-U interface"},
3796 {35, "S2a TWAN GTP-C interface"},
3797 {36, "S2a PGW GTP-C interface"},
3798 {37, "S2a PGW GTP-U interface"},
3799 {38, "S11 MME GTP-U interface"},
3800 {39, "S11 SGW GTP-U interface"},
3801 {40, "N26 AMF GTP-C interface"},
3802 {41, "N19mb UPF GTP-U interface"},
3803 {0, NULL}
3805 static value_string_ext gtpv2_f_teid_interface_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_f_teid_interface_type_vals);
3807 static const true_false_string gtpv2_f_teid_v4_vals = {
3808 "IPv4 address present",
3809 "IPv4 address not present",
3812 static const true_false_string gtpv2_f_teid_v6_vals = {
3813 "IPv6 address present",
3814 "IPv6 address not present",
3817 static void
3818 dissect_gtpv2_f_teid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t *args)
3820 int offset = 0;
3821 uint8_t flags;
3822 address *ipv4 = NULL, *ipv6 = NULL;
3823 uint32_t teid_cp, *teid, session;
3825 flags = tvb_get_uint8(tvb, offset);
3826 proto_tree_add_item(tree, hf_gtpv2_f_teid_v4, tvb, offset, 1, ENC_BIG_ENDIAN);
3827 proto_tree_add_item(tree, hf_gtpv2_f_teid_v6, tvb, offset, 1, ENC_BIG_ENDIAN);
3828 /* NOTE: "Interface type" IE is defined with 5 bits only in the earlier releases of this specification,
3829 * thus pre-Rel-10 GTPv2-C nodes can ignore bit "6" which is marked as "Spare" in earlier releases,
3830 * allowing backward compatibility.
3832 proto_tree_add_item(tree, hf_gtpv2_f_teid_interface_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3834 offset += 1;
3835 proto_tree_add_item_ret_uint(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN, &teid_cp);
3836 proto_item_append_text(item, "%s, TEID/GRE Key: 0x%s",
3837 val_to_str_ext_const((flags & 0x3f), &gtpv2_f_teid_interface_type_vals_ext, "Unknown"),
3838 tvb_bytes_to_str(pinfo->pool, tvb, offset, 4));
3840 offset += 4;
3841 if (flags & 0x80)
3843 ipv4 = wmem_new0(pinfo->pool, address);
3844 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
3845 proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3846 set_address_tvb(ipv4, AT_IPv4, 4, tvb, offset);
3847 offset += 4;
3849 if (flags & 0x40)
3851 ipv6 = wmem_new0(pinfo->pool, address);
3852 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, ENC_NA);
3853 proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
3854 set_address_tvb(ipv6, AT_IPv6, 16, tvb, offset);
3857 if (g_gtp_session && args) {
3858 session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
3859 if (!session) {
3860 /* We save the teid so that we could assignate its corresponding session ID later */
3861 args->last_teid = teid_cp;
3862 if (!teid_exists(teid_cp, args->teid_list)) {
3863 teid = wmem_new(pinfo->pool, uint32_t);
3864 *teid = teid_cp;
3865 wmem_list_prepend(args->teid_list, teid);
3867 if (ipv4 != NULL && !ip_exists(*ipv4, args->ip_list)) {
3868 copy_address_wmem(pinfo->pool, &args->last_ip, ipv4);
3869 wmem_list_prepend(args->ip_list, ipv4);
3871 if (ipv6 != NULL && !ip_exists(*ipv6, args->ip_list)) {
3872 copy_address_wmem(pinfo->pool, &args->last_ip, ipv6);
3873 wmem_list_prepend(args->ip_list, ipv6);
3879 * 8.23 TMSI
3881 static void
3882 dissect_gtpv2_tmsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3884 proto_tree_add_item(tree, hf_gtpv2_tmsi, tvb, 0, 4, ENC_BIG_ENDIAN);
3885 proto_tree_add_item(item, hf_gtpv2_tmsi_bytes, tvb, 0, length, ENC_NA);
3888 * 8.24 Global CN-Id
3889 * (TS 23.003)
3890 * 12.3 CN Identifier
3892 * A CN node is uniquely identified within a PLMN by its CN Identifier (CN-Id). The CN-Id together with the PLMN
3893 * identifier globally identifies the CN node. The CN-Id together with the PLMN-Id is used as the CN node identifier in
3894 * RANAP signalling over the Iu interface.
3895 * Global CN-Id = PLMN-Id || CN-Id
3896 * The CN-Id is defined by the operator, and set in the nodes via O&M.
3897 * For the syntax description and the use of this identifier in RANAP signalling, see 3GPP TS 25.413 [17].
3900 static void
3901 dissect_gtpv2_g_cn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3903 int offset = 0;
3905 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
3906 offset += 3;
3908 /* >CN-ID M INTEGER (0..4095) */
3909 proto_tree_add_item(tree, hf_gtpv2_cn_id, tvb, offset, 2, ENC_NA);
3912 * 8.25 S103 PDN Data Forwarding Info (S103PDF)
3914 static void
3915 dissect_gtpv2_s103pdf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3917 int offset = 0;
3918 uint8_t m, k, i;
3920 /* The HSGW Address and GRE Key identify a GRE Tunnel towards a HSGW over S103 interface for a specific PDN
3921 * connection of the UE. The EPS Bearer IDs specify the EPS Bearers which require data forwarding that belonging to this
3922 * PDN connection. The number of EPS bearer Ids included is specified by the value of EPS Bearer ID Number.
3924 /* Octet 5 HSGW Address for forwarding Length = m */
3925 m = tvb_get_uint8(tvb, offset);
3926 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_f_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3927 offset += 1;
3929 /* 6 to (m+5) HSGW Address for forwarding [4..16] */
3930 switch (m) {
3931 case 4:
3932 /* IPv4 */
3933 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv4, tvb, offset, m, ENC_BIG_ENDIAN);
3934 offset += 4;
3935 break;
3936 case 16:
3937 /* IPv6 */
3938 proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv6, tvb, offset, m, ENC_NA);
3939 offset += 16;
3940 break;
3941 default:
3942 /* Error */
3943 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3944 "Wrong length %u, should be 4 or 16", m);
3945 return;
3948 /* (m+6)- to (m+9) GRE Key */
3949 proto_tree_add_item(tree, hf_gtpv2_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
3950 offset += 4;
3952 /* (m+10) EPS Bearer ID Number = k */
3953 k = tvb_get_uint8(tvb, offset);
3954 proto_tree_add_item(tree, hf_gtpv2_eps_bearer_id_number, tvb, offset, 1, ENC_BIG_ENDIAN);
3955 offset += 1;
3957 /* (m+11) to (m+10+k)
3958 * Spare EPS Bearer ID
3960 for ( i = 0; i < k; i++ ) {
3961 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3962 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
3963 offset += 1;
3968 * 8.26 S1-U Data Forwarding (S1UDF)
3970 static void
3971 dissect_gtpv2_s1udf(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
3973 int offset = 0;
3974 uint8_t m;
3976 /* 5 Spare EPS Bearer ID */
3977 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3978 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
3979 offset += 1;
3980 /* 6 Serving GW Address Length = m */
3981 m = tvb_get_uint8(tvb, offset);
3982 proto_tree_add_item(tree, hf_gtpv2_serving_gw_address_length, tvb, offset, 1, ENC_BIG_ENDIAN);
3983 offset += 1;
3984 /* 7 to (m+6) Serving GW Address [4..16] */
3985 switch (m) {
3986 case 4:
3987 /* IPv4 */
3988 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv4, tvb, offset, m, ENC_BIG_ENDIAN);
3989 offset += 4;
3990 break;
3991 case 16:
3992 /* IPv6 */
3993 proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv6, tvb, offset, m, ENC_NA);
3994 offset += 16;
3995 break;
3996 default:
3997 /* Error */
3998 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3999 "Wrong length %u, should be 4 or 16", m);
4000 return;
4003 /* (m+7) to (m+10)
4004 * Serving GW S1-U TEID
4006 proto_tree_add_item(tree, hf_gtpv2_sgw_s1u_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
4010 * 8.27 Delay Value
4013 static void
4014 dissect_gtpv2_delay_value(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4016 int offset = 0;
4018 proto_tree_add_item(tree, hf_gtpv2_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
4022 * 8.28 Bearer Context (grouped IE)
4025 static void
4026 dissect_gtpv2_bearer_ctx(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4028 int offset = 0;
4029 tvbuff_t *new_tvb;
4030 proto_tree *grouped_tree;
4032 proto_item_append_text(item, "[Grouped IE]");
4033 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_bearer_ctx);
4035 new_tvb = tvb_new_subset_length(tvb, offset, length);
4036 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type, args, GTPV2_IE_BEARER_CTX);
4039 /* 8.29 Charging ID */
4040 static void
4041 dissect_gtpv2_charging_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4043 int offset = 0;
4045 proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, ENC_BIG_ENDIAN);
4049 /* 8.30 Charging Characteristics
4050 * The charging characteristics information element is defined in 3GPP TS 32.251 [8]
4051 * and is a way of informing both the SGW and PGW of the rules for producing charging
4052 * information based on operator configured triggers. For the encoding of this
4053 * information element see 3GPP TS 32.298 [9].
4055 static void
4056 dissect_gtpv2_char_char(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4058 int offset = 0;
4060 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, 2, ENC_BIG_ENDIAN);
4061 if (length > 2) {
4062 offset += 2;
4063 /* These octet(s) is/are present only if explicitly specified */
4064 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic_remaining_octets, tvb, offset, length-2, ENC_NA);
4070 * 8.30 Bearer Flag
4072 static void
4073 dissect_gtpv2_bearer_flag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4076 int offset = 0;
4078 /* Octet 5 Spare VB PPC */
4079 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_ppc, tvb, offset, length, ENC_BIG_ENDIAN);
4080 proto_tree_add_item(tree, hf_gtpv2_bearer_flag_vb, tvb, offset, length, ENC_BIG_ENDIAN);
4084 * 8.34 PDN Type
4086 void
4087 dissect_gtpv2_pdn_type(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4090 int offset = 0;
4091 uint8_t pdn;
4093 if (length != 1) {
4094 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
4095 "Wrong length indicated. Expected 1, got %u", length);
4096 return;
4099 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
4100 pdn = tvb_get_uint8(tvb, offset)& 0x7;
4101 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, ENC_BIG_ENDIAN);
4102 proto_item_append_text(item, "%s", val_to_str_ext_const(pdn, &gtpv2_pdn_type_vals_ext, "Unknown"));
4107 * 8.31 Trace Information
4109 /* List of NE Types */
4110 static int* const trace_ne_types_flags_oct1[] = {
4111 &hf_gtpv2_tra_info_lne_sgw,
4112 &hf_gtpv2_tra_info_lne_mme,
4113 &hf_gtpv2_tra_info_lne_bm_sc,
4114 &hf_gtpv2_tra_info_lne_rnc,
4115 &hf_gtpv2_tra_info_lne_ggsn,
4116 &hf_gtpv2_tra_info_lne_sgsn,
4117 &hf_gtpv2_tra_info_lne_mgw,
4118 &hf_gtpv2_tra_info_lne_msc_s,
4119 NULL
4122 static int* const trace_ne_types_flags_oct2[] = {
4123 &hf_gtpv2_tra_info_tra_info_ng_ran_node,
4124 &hf_gtpv2_tra_info_lne_upf,
4125 &hf_gtpv2_tra_info_lne_pcf,
4126 &hf_gtpv2_tra_info_lne_smf,
4127 &hf_gtpv2_tra_info_lne_amf,
4128 &hf_gtpv2_tra_info_lne_enb,
4129 &hf_gtpv2_tra_info_lne_pdn_gw,
4130 NULL
4133 static void
4134 dissect_gtpv2_tra_info(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4136 proto_tree *trigg_tree, *msc_server_tree, *mgw_tree, *sgsn_tree, *ggsn_tree;
4137 proto_tree *bm_sc_tree, *sgw_mme_tree, *sgw_tree, *pgw_tree, *ne_types_tree;
4138 proto_tree *interfaces_tree, *imsc_server_tree, *lmgw_tree, *lsgsn_tree, *lggsn_tree, *lrnc_tree;
4139 proto_tree *lbm_sc_tree, *lmme_tree, *lsgw_tree, *lpdn_gw_tree, *lenb_tree;
4141 int offset = 0;
4142 #if 0
4143 uint8_t *trace_id = NULL;
4144 #endif
4145 uint16_t tid;
4146 uint32_t bit_offset;
4148 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
4149 offset += 3;
4151 /* Append Trace ID to main tree */
4152 tid = tvb_get_ntohs(tvb, offset);
4153 proto_item_append_text(item, "Trace ID: %d ", tid);
4155 /* Trace ID */
4156 /*--------------------------------------------------
4157 * trace_id = tvb_format_text(tvb, offset, 2);
4158 * proto_tree_add_string(tree, hf_gtpv2_tra_info, tvb, offset, length, trace_id);
4159 *--------------------------------------------------*/
4160 proto_tree_add_item(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN);
4161 offset += 3;
4163 /* Triggering Events, put all into a new tree called triggering_tree */
4164 trigg_tree = proto_tree_add_subtree(tree, tvb, offset, 9, ett_gtpv2_tra_info_trigg, NULL, "Triggering Events");
4166 /* Create all subtrees */
4167 msc_server_tree = proto_tree_add_subtree(trigg_tree, tvb, offset, 2, ett_gtpv2_tra_info_trigg_msc_server, NULL, "MSC Server");
4169 mgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_trigg_mgw, NULL, "MGW");
4171 sgsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_trigg_sgsn, NULL, "SGSN");
4173 ggsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_trigg_ggsn, NULL, "GGSN");
4175 bm_sc_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_trigg_bm_sc, NULL, "BM-SC");
4177 sgw_mme_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_trigg_sgw_mme, NULL, "SGW MME");
4179 sgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_sgw, NULL, "SGW");
4181 pgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_pgw, NULL, "PGW");
4183 /* MSC Server - 2 octets */
4184 static int* const tra_info_msc_flags[] = {
4185 &hf_gtpv2_tra_info_msc_ss,
4186 &hf_gtpv2_tra_info_msc_handovers,
4187 &hf_gtpv2_tra_info_msc_lu_imsi_ad,
4188 &hf_gtpv2_tra_info_msc_momt_sms,
4189 &hf_gtpv2_tra_info_msc_momt_calls,
4190 NULL
4192 proto_tree_add_bitmask_list(msc_server_tree, tvb, offset, 1, tra_info_msc_flags, ENC_BIG_ENDIAN);
4193 bit_offset = offset << 3;
4194 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4195 offset += 1;
4196 bit_offset = offset << 3;
4197 proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
4198 offset += 1;
4200 /* MGW - 1 octet */
4201 proto_tree_add_item(mgw_tree, hf_gtpv2_tra_info_mgw_context, tvb, offset, 1, ENC_BIG_ENDIAN);
4202 bit_offset = offset << 3;
4203 proto_tree_add_bits_item(mgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4204 offset += 1;
4205 /* SGSN - 2 octets */
4206 static int* const tra_info_sgsn_flags[] = {
4207 &hf_gtpv2_tra_info_sgsn_mbms,
4208 &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
4209 &hf_gtpv2_tra_info_sgsn_momt_sms,
4210 &hf_gtpv2_tra_info_sgsn_pdp_context,
4211 NULL
4213 proto_tree_add_bitmask_list(sgsn_tree, tvb, offset, 1, tra_info_sgsn_flags, ENC_BIG_ENDIAN);
4214 bit_offset = offset << 3;
4215 proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4216 offset += 1;
4217 proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_reserved, tvb, offset, 1, ENC_BIG_ENDIAN);
4218 offset += 1;
4219 /* GGSN - 1 octet */
4220 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_pdp, tvb, offset, 1, ENC_BIG_ENDIAN);
4221 proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_mbms, tvb, offset, 1, ENC_BIG_ENDIAN);
4222 bit_offset = offset << 3;
4223 proto_tree_add_bits_item(ggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4224 offset += 1;
4225 /* BM-SC - 1 octet */
4226 proto_tree_add_item(bm_sc_tree, hf_gtpv2_tra_info_bm_sc, tvb, offset, 1, ENC_BIG_ENDIAN);
4227 bit_offset = offset << 3;
4228 proto_tree_add_bits_item(bm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4229 offset += 1;
4230 /* MME/SGW - 1 octet */
4231 static int* const tra_info_mme_flags[] = {
4232 &hf_gtpv2_tra_info_mme_sgw_ho,
4233 &hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del,
4234 &hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc,
4235 &hf_gtpv2_tra_info_mme_sgw_iataud,
4236 &hf_gtpv2_tra_info_mme_sgw_sr,
4237 &hf_gtpv2_tra_info_mme_sgw_ss,
4238 NULL
4240 proto_tree_add_bitmask_list(sgw_mme_tree, tvb, offset, 1, tra_info_mme_flags, ENC_BIG_ENDIAN);
4241 bit_offset = offset << 3;
4242 proto_tree_add_bits_item(sgw_mme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4243 offset += 1;
4244 /* PGW/SGW - 1 octet */
4245 static int* const tra_info_sgw_pdn_flags[] = {
4246 &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
4247 &hf_gtpv2_tra_info_sgw_pdn_con_term,
4248 &hf_gtpv2_tra_info_sgw_pdn_con_creat,
4249 NULL
4251 proto_tree_add_bitmask_list(sgw_mme_tree, tvb, offset, 1, tra_info_sgw_pdn_flags, ENC_BIG_ENDIAN);
4252 bit_offset = (offset << 3) + 4;
4253 proto_tree_add_bits_item(sgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4255 static int* const tra_info_pgw_flags[] = {
4256 &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
4257 &hf_gtpv2_tra_info_pgw_pdn_con_term,
4258 &hf_gtpv2_tra_info_pgw_pdn_con_creat,
4259 NULL
4261 proto_tree_add_bitmask_list(pgw_tree, tvb, offset, 1, tra_info_pgw_flags, ENC_BIG_ENDIAN);
4263 bit_offset = offset << 3;
4264 proto_tree_add_bits_item(pgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4265 offset += 1;
4267 /* Create NE Types subtree */
4268 ne_types_tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_gtpv2_tra_info_ne_types, NULL, "List of NE Types");
4270 proto_tree_add_bitmask_list(tree, tvb, offset, 1, trace_ne_types_flags_oct1, ENC_BIG_ENDIAN);
4271 offset += 1;
4273 proto_tree_add_bitmask_list(tree, tvb, offset, 1, trace_ne_types_flags_oct2, ENC_BIG_ENDIAN);
4274 bit_offset = offset << 3;
4275 proto_tree_add_bits_item(ne_types_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4276 offset += 1;
4278 /* Trace Depth Length */
4279 proto_tree_add_item(tree, hf_gtpv2_tra_info_tdl, tvb, offset, 1, ENC_BIG_ENDIAN);
4280 offset += 1;
4282 /* Set up subtree interfaces and put all interfaces under it */
4283 interfaces_tree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_gtpv2_tra_info_interfaces, NULL, "List of Interfaces");
4285 /* Create all subtrees */
4286 imsc_server_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset, 2, ett_gtpv2_tra_info_interfaces_imsc_server, NULL, "MSC Server");
4288 lmgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_interfaces_lmgw, NULL, "MGW");
4290 lsgsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_interfaces_lsgsn, NULL, "SGSN");
4292 lggsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_interfaces_lggsn, NULL, "GGSN");
4294 lrnc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_interfaces_lrnc, NULL, "RNC");
4296 lbm_sc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_interfaces_lbm_sc, NULL, "BM-SC");
4298 lmme_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_interfaces_lmme, NULL, "MME");
4300 lsgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 9, 1,ett_gtpv2_tra_info_interfaces_lsgw, NULL, "SGW");
4302 lpdn_gw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 10, 1, ett_gtpv2_tra_info_interfaces_lpdn_gw, NULL, "PDN GW");
4304 lenb_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 11, 1, ett_gtpv2_tra_info_interfaces_lpdn_lenb, NULL, "eNB");
4306 /* MSC Server - 2 octets */
4307 static int* const tra_info_lmsc_flags[] = {
4308 &hf_gtpv2_tra_info_lmsc_cap,
4309 &hf_gtpv2_tra_info_lmsc_map_f,
4310 &hf_gtpv2_tra_info_lmsc_map_e,
4311 &hf_gtpv2_tra_info_lmsc_map_b,
4312 &hf_gtpv2_tra_info_lmsc_map_g,
4313 &hf_gtpv2_tra_info_lmsc_mc,
4314 &hf_gtpv2_tra_info_lmsc_lu,
4315 &hf_gtpv2_tra_info_lmsc_a,
4316 NULL
4318 proto_tree_add_bitmask_list(imsc_server_tree, tvb, offset, 1, tra_info_lmsc_flags, ENC_BIG_ENDIAN);
4319 offset += 1;
4320 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_d, tvb, offset, 1, ENC_BIG_ENDIAN);
4321 proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_c, tvb, offset, 1, ENC_BIG_ENDIAN);
4322 bit_offset = offset << 3;
4323 proto_tree_add_bits_item(imsc_server_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4324 offset += 1;
4325 /* MGW - 1 octet */
4326 static int* const tra_info_lmgw_flags[] = {
4327 &hf_gtpv2_tra_info_lmgw_lu_up,
4328 &hf_gtpv2_tra_info_lmgw_nb_up,
4329 &hf_gtpv2_tra_info_lmgw_mc,
4330 NULL
4332 proto_tree_add_bitmask_list(lmgw_tree, tvb, offset, 1, tra_info_lmgw_flags, ENC_BIG_ENDIAN);
4333 bit_offset = offset << 3;
4334 proto_tree_add_bits_item(lmgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
4335 offset += 1;
4336 /* SGSN - 2 octets */
4337 static int* const tra_info_lsgsn_flags[] = {
4338 &hf_gtpv2_tra_info_lsgsn_ge,
4339 &hf_gtpv2_tra_info_lsgsn_gs,
4340 &hf_gtpv2_tra_info_lsgsn_map_gf,
4341 &hf_gtpv2_tra_info_lsgsn_map_gd,
4342 &hf_gtpv2_tra_info_lsgsn_map_gr,
4343 &hf_gtpv2_tra_info_lsgsn_gn,
4344 &hf_gtpv2_tra_info_lsgsn_lu,
4345 &hf_gtpv2_tra_info_lsgsn_gb,
4346 NULL
4348 proto_tree_add_bitmask_list(lsgsn_tree, tvb, offset, 1, tra_info_lsgsn_flags, ENC_BIG_ENDIAN);
4349 offset += 1;
4350 bit_offset = offset << 3;
4351 proto_tree_add_bits_item(lsgsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 8, ENC_BIG_ENDIAN);
4352 offset += 1;
4354 /* GGSN - 1 octet */
4355 static int* const tra_info_lggsn_flags[] = {
4356 &hf_gtpv2_tra_info_lggsn_gmb,
4357 & hf_gtpv2_tra_info_lggsn_gi,
4358 & hf_gtpv2_tra_info_lggsn_gn,
4359 NULL
4361 proto_tree_add_bitmask_list(lggsn_tree, tvb, offset, 1, tra_info_lggsn_flags, ENC_BIG_ENDIAN);
4362 bit_offset = offset << 3;
4363 proto_tree_add_bits_item(lggsn_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
4364 offset += 1;
4365 /* RNC - 1 octet */
4366 static int* const tra_info_lrnc_flags[] = {
4367 &hf_gtpv2_tra_info_lrnc_uu,
4368 &hf_gtpv2_tra_info_lrnc_lub,
4369 &hf_gtpv2_tra_info_lrnc_lur,
4370 &hf_gtpv2_tra_info_lrnc_lu,
4371 NULL
4373 proto_tree_add_bitmask_list(lrnc_tree, tvb, offset, 1, tra_info_lrnc_flags, ENC_BIG_ENDIAN);
4374 bit_offset = offset << 3;
4375 proto_tree_add_bits_item(lrnc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4376 offset += 1;
4377 /* BM_SC - 1 octet */
4378 proto_tree_add_item(lbm_sc_tree, hf_gtpv2_tra_info_lbm_sc_gmb, tvb, offset, 1, ENC_BIG_ENDIAN);
4379 bit_offset = offset << 3;
4380 proto_tree_add_bits_item(lbm_sc_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4381 offset += 1;
4382 /* MME - 1 octet */
4383 static int* const tra_info_lmme_flags[] = {
4384 &hf_gtpv2_tra_info_lmme_s11,
4385 &hf_gtpv2_tra_info_lmme_s10,
4386 &hf_gtpv2_tra_info_lmme_s6a,
4387 &hf_gtpv2_tra_info_lmme_s3,
4388 &hf_gtpv2_tra_info_lmme_s1_mme,
4389 NULL
4391 proto_tree_add_bitmask_list(lmme_tree, tvb, offset, 1, tra_info_lmme_flags, ENC_BIG_ENDIAN);
4392 bit_offset = offset << 3;
4393 proto_tree_add_bits_item(lmme_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4394 offset += 1;
4395 /* SGW - 1 octet */
4396 static int* const tra_info_lsgw_flags[] = {
4397 &hf_gtpv2_tra_info_lsgw_s11,
4398 &hf_gtpv2_tra_info_lsgw_s8b,
4399 &hf_gtpv2_tra_info_lsgw_s5,
4400 &hf_gtpv2_tra_info_lsgw_s4,
4401 NULL
4403 proto_tree_add_bitmask_list(lsgw_tree, tvb, offset, 1, tra_info_lsgw_flags, ENC_BIG_ENDIAN);
4404 bit_offset = offset << 3;
4405 proto_tree_add_bits_item(lsgw_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4406 offset += 1;
4407 /* PDN GW - 1 octet */
4408 static int* const tra_info_lpdn_gw_flags[] = {
4409 &hf_gtpv2_tra_info_lpdn_gw_sgi,
4410 &hf_gtpv2_tra_info_lpdn_gw_s8b,
4411 &hf_gtpv2_tra_info_lpdn_gw_gx,
4412 &hf_gtpv2_tra_info_lpdn_gw_s6c,
4413 &hf_gtpv2_tra_info_lpdn_gw_s5,
4414 &hf_gtpv2_tra_info_lpdn_gw_s2c,
4415 &hf_gtpv2_tra_info_lpdn_gw_s2b,
4416 &hf_gtpv2_tra_info_lpdn_gw_s2a,
4417 NULL
4419 proto_tree_add_bitmask_list(lpdn_gw_tree, tvb, offset, 1, tra_info_lpdn_gw_flags, ENC_BIG_ENDIAN);
4420 offset += 1;
4421 /* eNB - 1 octet */
4422 static int* const tra_info_lenb_flags[] = {
4423 &hf_gtpv2_tra_info_lenb_uu,
4424 &hf_gtpv2_tra_info_lenb_x2,
4425 &hf_gtpv2_tra_info_lenb_s1_mme,
4426 NULL
4428 proto_tree_add_bitmask_list(lenb_tree, tvb, offset, 1, tra_info_lenb_flags, ENC_BIG_ENDIAN);
4429 bit_offset = offset << 3;
4430 proto_tree_add_bits_item(lenb_tree, hf_gtpv2_spare_bits, tvb, bit_offset, 5, ENC_BIG_ENDIAN);
4432 /*--------------------------------------------------
4433 * offset += 1;
4434 *--------------------------------------------------*/
4436 /* IP Address of Trace Collection Entity */
4437 while ( (offset + 4) <= length ) {
4438 offset += 1;
4439 proto_tree_add_item(tree, hf_gtpv2_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4440 offset += 3;
4445 * 8.33 Paging Cause
4446 * 8.33 Void (TS 129 274 V9.4.0 (2010-10))
4449 /* 8.35 Procedure Transaction ID (PTI) */
4450 static void
4451 dissect_gtpv2_pti(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4453 proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, ENC_BIG_ENDIAN);
4456 * 8.36 DRX Parameter
4458 static void
4459 dissect_gtpv2_drx_param(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4461 int offset = 0;
4463 /* 36.413 : 9.2.1.17 Paging Cause, void */
4464 proto_tree_add_item(tree, hf_gtpv2_drx_parameter, tvb, offset, length, ENC_NA);
4468 * 8.37 UE Network Capability
4469 * UE Network Capability is coded as depicted in Figure 8.37-1. Actual coding of the UE Network Capability field is
4470 * defined in 3GPP TS 24.301
4472 static void
4473 dissect_gtpv2_ue_net_capability(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4475 de_emm_ue_net_cap(tvb, tree, pinfo, 0, length, NULL, 0);
4479 * 8.38 MM Context
4481 static const value_string gtpv2_mm_context_security_mode[] = {
4482 {0, "GSM Key and Triplets"},
4483 {1, "UMTS Key, Used Cipher and Quintuplets"},
4484 {2, "GSM Key, Used Cipher and Quintuplets"},
4485 {3, "UMTS Key and Quintuplets"},
4486 {4, "EPS Security Context, Quadruplets and Quintuplets" },
4487 {5, "UMTS Key, Quadruplets and Quintuplets"},
4488 {0, NULL }
4491 static const true_false_string gtpv2_nhi_vals = {
4492 "NH (Next Hop) and NCC (Next Hop Chaining Count) are both present",
4493 "NH (Next Hop) and NCC (Next Hop Chaining Count) not present",
4496 /* Table 8.38-2: Used NAS Cipher Values */
4498 static const value_string gtpv2_mm_context_unc_vals[] = {
4499 {0, "No ciphering"},
4500 {1, "128-EEA1"},
4501 {2, "128-EEA2"},
4502 {3, "128-EEA3"},
4503 {4, "EEA4" },
4504 {5, "EEA5"},
4505 {6, "EEA6"},
4506 {7, "EEA7"},
4507 {0, NULL}
4510 /* Table 8.38-3: Used Cipher Values */
4511 static const value_string gtpv2_mm_context_used_cipher_vals[] = {
4512 {0, "No ciphering"},
4513 {1, "GEA/1"},
4514 {2, "GEA/2"},
4515 {3, "GEA/3"},
4516 {4, "GEA/4" },
4517 {5, "GEA/5"},
4518 {6, "GEA/6"},
4519 {7, "GEA/7"},
4520 {0, NULL}
4523 /* Table 8.38-4: Used NAS integrity protection algorithm Values */
4524 static const value_string gtpv2_mm_context_unipa_vals[] = {
4525 {0, "No integrity protection"},
4526 {1, "128-EIA1"},
4527 {2, "128-EIA2"},
4528 {3, "128-EIA3"},
4529 {4, "EIA4" },
4530 {5, "EIA5"},
4531 {6, "EIA6"},
4532 {7, "EIA7"},
4533 {0, NULL}
4536 /* Table 8.38-6: EPS NAS Security Context Type Values */
4537 static const value_string gtpv2_mm_context_eps_nas_security_context_type_vals[] = {
4538 {0, "Reporting EPS NAS Security Context Type is not supported"},
4539 {1, "Native EPS NAS Security Context Type"},
4540 {2, "Mapped EPS NAS Security Context Type"},
4541 {0, NULL}
4544 /* Helper functions */
4546 /* Figure 8.38-7: Authentication Triplet */
4547 static int
4548 dissect_gtpv2_authentication_triplets(tvbuff_t *tvb, proto_tree *tree, int offset, uint8_t num_triplet)
4550 proto_tree *auth_tri_tree;
4551 int i;
4553 for (i = 0; i < num_triplet; i++) {
4554 auth_tri_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
4555 ett_gtpv2_mm_context_auth_tri, NULL, "Authentication Triplet %u", i);
4557 * Figure 8.38-8: Authentication Quintuplet
4558 * 1 to 16 RAND
4559 * 17 to 20 SRES
4560 * 21 to 28 Kc
4562 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
4563 offset += 16;
4564 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_sres, tvb, offset, 4, ENC_NA);
4565 offset += 4;
4566 proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
4567 offset += 8;
4571 return offset;
4574 static int
4575 dissect_gtpv2_authentication_quintuplets(tvbuff_t *tvb, proto_tree *tree, int offset, uint8_t nr_qui)
4577 proto_tree *auth_qui_tree;
4578 int i;
4579 uint32_t tmp;
4581 for (i = 0; i < nr_qui; i++) {
4582 auth_qui_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
4583 ett_gtpv2_mm_context_auth_qui, NULL, "Authentication Quintuplet %u", i);
4585 * Figure 8.38-8: Authentication Quintuplet
4586 * 1 to 16 RAND
4587 * 17 XRES Length
4588 * 18 to m XRES
4589 * (m+1) to (m+16) CK
4590 * (m+17) to (m+32) IK
4591 * m+33 AUTN Length
4592 * (m+34) to n AUTN
4594 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
4595 offset += 16;
4596 proto_tree_add_item_ret_uint(auth_qui_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_NA, &tmp);
4597 offset += 1;
4598 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres, tvb, offset, tmp, ENC_NA);
4599 offset += tmp;
4600 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
4601 offset += 16;
4602 proto_tree_add_item(auth_qui_tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
4603 offset += 16;
4604 proto_tree_add_item_ret_uint(auth_qui_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_NA, &tmp);
4605 offset += 1;
4606 proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn, tvb, offset, tmp, ENC_NA);
4607 offset += tmp;
4610 return offset;
4614 static int
4615 dissect_gtpv2_authentication_quadruplets(tvbuff_t *tvb, proto_tree *tree, int offset, uint8_t nr_qui)
4617 proto_tree *auth_qua_tree;
4618 uint32_t tmp;
4619 int i;
4621 for (i = 0; i < nr_qui; i++) {
4622 auth_qua_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
4623 ett_gtpv2_mm_context_auth_qua, NULL, "Authentication Quadruplet %u",i+1);
4625 proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
4626 offset += 16;
4628 proto_tree_add_item_ret_uint(auth_qua_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_NA, &tmp);
4629 offset++;
4631 proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_xres, tvb, offset, tmp, ENC_NA);
4632 offset += tmp;
4634 proto_tree_add_item_ret_uint(auth_qua_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_NA, &tmp);
4635 offset++;
4637 proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_autn, tvb, offset, tmp, ENC_NA);
4638 offset += tmp;
4640 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
4642 offset += 32;
4644 return offset;
4647 static const value_string gtpv2_mm_context_higher_br_16mb_flg_vals[] = {
4648 {0, "Not allowed"},
4649 {1, "Allowed"},
4650 {0, NULL}
4653 static int
4654 dissect_gtpv2_mm_context_common_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint8_t samb_ri, uint8_t uamb_ri)
4656 proto_tree *net_cap_tree, *msnt_cap_tree;
4657 uint8_t ue_net_cap_len, ms_net_cap_len, mei_len;
4660 * If SAMBRI (Subscribed UE AMBR Indicator), bit 1 of octet 6, is set to "1",
4661 * then the Uplink/downlink Subscribed UE AMBR parameter field is present,
4663 if (samb_ri) {
4664 /* j to (j+3) Uplink Subscribed UE AMBR */
4665 proto_tree_add_item(tree, hf_gtpv2_uplink_subscribed_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4667 offset += 4;
4668 /* (j+4) to (j+7) Downlink Subscribed UE AMBR */
4669 proto_tree_add_item(tree, hf_gtpv2_downlink_subscribed_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4671 offset += 4;
4674 * If UAMBRI (Used UE AMBR Indicator), bit 2 of octet 6, is set to "1",
4675 * then the Uplink/downlink Used UE AMBR parameter field is present
4677 if (uamb_ri) {
4678 /* i to (i+3) Uplink Used UE AMBR */
4679 proto_tree_add_item(tree, hf_gtpv2_uplink_used_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4681 offset += 4;
4682 /* (i+4) to (i+7) Downlink Used UE AMBR */
4683 proto_tree_add_item(tree, hf_gtpv2_downlink_used_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4685 offset += 4;
4687 /* q Length of UE Network Capability */
4688 ue_net_cap_len = tvb_get_uint8(tvb, offset);
4689 proto_tree_add_item(tree, hf_gtpv2_mm_context_ue_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4690 offset += 1;
4691 /* (q+1) to k UE Network Capability */
4692 if (ue_net_cap_len) {
4693 /* The UE Network Capability coding is specified in clause 9.9.3.34 of 3GPP TS 24.301 [23].
4694 * If Length of UE Network Capability is zero, then the UE Network Capability parameter
4695 * shall not be present.
4697 net_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ue_net_cap_len,
4698 ett_gtpv2_mm_context_net_cap, NULL, "UE Network Capability");
4699 offset += de_emm_ue_net_cap(tvb, net_cap_tree, pinfo, offset, ue_net_cap_len, NULL, 0);
4701 /* k+1 Length of MS Network Capability */
4702 ms_net_cap_len = tvb_get_uint8(tvb, offset);
4703 proto_tree_add_item(tree, hf_gtpv2_mm_context_ms_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4704 offset += 1;
4705 /* (k+2) to m MS Network Capability
4706 * The MS Network Capability coding is specified in clause 10.5.5.12 of 3GPP TS 24.008 [5].
4707 * If Length of MS Network Capability is zero, then the MS Network Capability parameter shall not be present.
4709 if (ms_net_cap_len) {
4710 msnt_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ms_net_cap_len,
4711 ett_gtpv2_ms_network_capability, NULL, "MS network capability");
4712 offset += de_gmm_ms_net_cap(tvb, msnt_cap_tree, pinfo, offset, ms_net_cap_len, NULL, 0);
4714 /* m+1 Length of Mobile Equipment Identity (MEI) */
4715 mei_len = tvb_get_uint8(tvb, offset);
4716 proto_tree_add_item(tree, hf_gtpv2_mm_context_mei_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4717 offset += 1;
4718 /* (m+2) to r Mobile Equipment Identity (MEI) */
4719 if (mei_len) {
4720 proto_tree_add_item(tree, hf_gtpv2_mei, tvb, offset, mei_len, ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN);
4721 offset += mei_len;
4723 return offset;
4726 static int
4727 dissect_gtpv2_access_restriction_data(tvbuff_t *tvb, proto_tree *tree, int offset)
4729 proto_tree *accrstdata_tree;
4731 accrstdata_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtpv2_access_rest_data, NULL, "Access restriction data");
4732 /* Spare HNNA ENA INA GANA GENA UNA */
4733 proto_tree_add_bits_item(accrstdata_tree, hf_gtpv2_spare_bits, tvb, (offset << 3), 1, ENC_BIG_ENDIAN);
4734 proto_tree_add_item(accrstdata_tree, hf_gtpv2_hbna, tvb, offset, 1, ENC_BIG_ENDIAN);
4735 proto_tree_add_item(accrstdata_tree, hf_gtpv2_hnna, tvb, offset, 1, ENC_BIG_ENDIAN);
4736 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ena, tvb, offset, 1, ENC_BIG_ENDIAN);
4737 proto_tree_add_item(accrstdata_tree, hf_gtpv2_ina, tvb, offset, 1, ENC_BIG_ENDIAN);
4738 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gana, tvb, offset, 1, ENC_BIG_ENDIAN);
4739 proto_tree_add_item(accrstdata_tree, hf_gtpv2_gena, tvb, offset, 1, ENC_BIG_ENDIAN);
4740 proto_tree_add_item(accrstdata_tree, hf_gtpv2_una, tvb, offset, 1, ENC_BIG_ENDIAN);
4741 offset += 1;
4743 return offset;
4746 /* Type = 103 (decimal)
4747 * Figure 8.38-1: GSM Key and Triplets
4749 static void
4750 dissect_gtpv2_mm_context_gsm_t(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4752 proto_tree *flag_tree;
4753 int offset;
4754 uint8_t oct, drxi, num_triplet, uamb_ri, samb_ri;
4756 offset = 0;
4757 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
4759 /* Octet 5 */
4760 /* Security Mode | Spare | DRXI | CKSN */
4761 drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
4762 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
4763 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
4764 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
4765 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
4766 offset += 1;
4767 /* Octet 6 */
4768 /* Number of Triplet | Spare | UAMB RI | SAMB RI */
4769 oct = tvb_get_uint8(tvb, offset);
4770 num_triplet = oct >> 5;
4771 uamb_ri = (oct & 0x02) >> 1;
4772 samb_ri = oct & 0x01;
4774 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_tri, tvb, offset, 1, ENC_BIG_ENDIAN);
4775 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
4776 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
4777 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
4778 offset += 1;
4780 /* Octet 7 Spare Used Cipher */
4781 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
4782 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
4783 offset += 1;
4785 /* 8 to 15 Kc */
4786 proto_tree_add_item(tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
4787 offset += 8;
4789 /* 16 to h Authentication Triplet [0..4] */
4790 if (num_triplet) {
4791 dissect_gtpv2_authentication_triplets(tvb, tree, offset, num_triplet);
4795 * (h+1) to (h+2) DRX parameter
4797 if (drxi) {
4798 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
4799 offset += 2;
4802 /* Dissect octet j to r */
4803 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
4805 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");
4808 /* Type = 104 (decimal)
4809 * Figure 8.38-2: UMTS Key, Used Cipher and Quintuplets
4811 static void
4812 dissect_gtpv2_mm_context_utms_cq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4814 proto_tree *flag_tree;
4815 int offset;
4816 uint8_t oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
4818 offset = 0;
4819 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
4821 /* Octet 5 */
4822 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
4823 drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
4824 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
4825 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
4826 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
4827 offset += 1;
4828 /* Octet 6 */
4829 oct = tvb_get_uint8(tvb, offset);
4830 nr_qui = oct >> 5;
4831 uamb_ri = (oct & 0x02) >> 1;
4832 samb_ri = oct & 0x01;
4833 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
4834 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
4835 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
4836 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
4837 offset += 1;
4838 /* Octet 7 Spare Used Cipher */
4839 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
4840 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
4841 offset += 1;
4843 /* Octet 8 to 23 CK */
4844 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
4845 offset += 16;
4846 /* Octet 24 to 39 IK */
4847 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
4848 offset += 16;
4851 * 40 to h Authentication Quintuplet [0..4]
4853 if (nr_qui) {
4854 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
4858 * (h+1) to (h+2) DRX parameter
4860 if (drxi) {
4861 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
4862 offset += 2;
4866 /* Dissect octet j to r */
4867 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
4869 /* r+1 Spare HNNA ENA INA GANA GENA UNA
4870 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
4871 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
4872 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
4874 if (offset < (int)length) {
4875 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
4876 } else {
4877 return;
4879 if (offset == (int)length) {
4880 return;
4883 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
4884 vdp_len = tvb_get_uint8(tvb, offset);
4885 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4886 offset += 1;
4887 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
4888 if (vdp_len) {
4889 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
4890 offset += vdp_len;
4893 /* s+1 Length of Higher bitrates than 16 Mbps flag */
4894 if (offset == (int)length) {
4895 hbr_len = tvb_get_uint8(tvb, offset);
4896 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4897 offset += 1;
4898 /* s+2 Higher bitrates than 16 Mbps flag */
4899 if (hbr_len) {
4900 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
4901 offset += hbr_len;
4903 } else {
4904 return;
4907 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");
4911 /* Type = 105 (decimal)
4912 * Figure 8.38-3: GSM Key, Used Cipher and Quintuplets
4914 static void
4915 dissect_gtpv2_mm_context_gsm_cq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
4917 proto_tree *flag_tree;
4918 int offset;
4919 uint8_t oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
4921 offset = 0;
4922 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
4924 /* Octet 5 */
4925 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
4926 drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
4927 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
4928 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
4929 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
4930 offset += 1;
4931 /* Octet 6 */
4932 oct = tvb_get_uint8(tvb, offset);
4933 nr_qui = oct >> 5;
4934 uamb_ri = (oct & 0x02) >> 1;
4935 samb_ri = oct & 0x01;
4936 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
4937 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
4938 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
4939 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
4940 offset += 1;
4941 /* Octet 7 Spare Used Cipher */
4942 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
4943 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
4944 offset += 1;
4945 /* 8 to 15 Kc */
4946 proto_tree_add_item(tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
4947 offset += 8;
4950 * 40 to h Authentication Quintuplet [0..4]
4952 if (nr_qui) {
4953 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
4957 * (h+1) to (h+2) DRX parameter
4959 if (drxi) {
4960 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
4961 offset += 2;
4965 /* Dissect octet j to r */
4966 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
4968 /* r+1 Spare HNNA ENA INA GANA GENA UNA
4969 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
4970 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
4971 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
4973 if (offset < (int)length) {
4974 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
4975 } else {
4976 return;
4978 if (offset == (int)length) {
4979 return;
4982 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
4983 vdp_len = tvb_get_uint8(tvb, offset);
4984 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4985 offset += 1;
4986 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
4987 if (vdp_len) {
4988 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
4989 offset += vdp_len;
4992 /* s+1 Length of Higher bitrates than 16 Mbps flag */
4993 if (offset < (int)length) {
4994 hbr_len = tvb_get_uint8(tvb, offset);
4995 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4996 offset += 1;
4997 /* s+2 Higher bitrates than 16 Mbps flag */
4998 if (hbr_len) {
4999 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5000 offset += hbr_len;
5002 } else {
5003 return;
5006 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");
5010 /* Type = 106 (decimal)
5011 * Figure 8.38-4: UMTS Key and Quintuplets
5013 static void
5014 dissect_gtpv2_mm_context_utms_q(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5016 proto_tree *flag_tree;
5017 int offset;
5018 uint8_t oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len, ear_len;
5020 offset = 0;
5021 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
5023 /* Octet 5 */
5024 /* Security Mode Spare DRXI KSI */
5025 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
5026 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
5027 drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
5028 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
5029 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
5030 offset += 1;
5031 /* Octet 6 */
5032 /* Number of Quintuplets Spare UAMB RI SAMB RI */
5033 oct = tvb_get_uint8(tvb, offset);
5034 nr_qui = oct >> 5;
5035 uamb_ri = (oct & 0x02) >> 1;
5036 samb_ri = oct & 0x01;
5038 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
5039 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
5040 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
5041 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
5042 offset += 1;
5043 /* Octet 7 Spare */
5044 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5045 offset += 1;
5046 /* Octet 8 to 23 CK */
5047 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
5048 offset += 16;
5049 /* Octet 24 to 39 IK */
5050 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
5051 offset += 16;
5054 * 40 to h Authentication Quintuplet [0..4]
5056 if (nr_qui) {
5057 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
5061 * (h+1) to (h+2) DRX parameter
5063 if (drxi) {
5064 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
5065 offset += 2;
5069 /* Dissect octet j to r */
5070 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
5072 /* r+1 Spare HNNA ENA INA GANA GENA UNA
5073 * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
5074 * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
5075 * HNNA(HO-To-Non-3GPPAccess Not Allowed).
5077 if (offset < (int)length) {
5078 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
5079 } else {
5080 return;
5082 if (offset == (int)length) {
5083 return;
5086 /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
5087 vdp_len = tvb_get_uint8(tvb, offset);
5088 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5089 offset += 1;
5090 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
5091 if (vdp_len) {
5092 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
5093 offset += vdp_len;
5096 /* s+1 Length of Higher bitrates than 16 Mbps flag */
5097 if (offset < (int)length) {
5098 hbr_len = tvb_get_uint8(tvb, offset);
5099 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5100 offset += 1;
5101 /* s+2 Higher bitrates than 16 Mbps flag */
5102 if (hbr_len) {
5103 proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5104 offset += hbr_len;
5106 } else {
5107 return;
5110 /* s+3 IOV_updates counter */
5111 if (offset < (int)length) {
5112 proto_tree_add_item(tree, hf_gtpv2_mm_context_iov_updates_counter, tvb, offset, 1, ENC_BIG_ENDIAN);
5113 offset += 1;
5114 } else {
5115 return;
5117 /* s+4 Length of Extended Access Restriction Data */
5118 if (offset < (int)length) {
5119 ear_len = tvb_get_uint8(tvb, offset);
5120 proto_tree_add_item(tree, hf_gtpv2_mm_context_ear_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5121 offset += 1;
5122 static int * const ear_flags[] = {
5123 &hf_gtpv2_mm_context_nrsrna,
5124 NULL
5126 proto_tree_add_bitmask_list(tree, tvb, offset, 1, ear_flags, ENC_BIG_ENDIAN);
5127 offset += 1;
5128 if (ear_len > 1) {
5129 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
5130 offset += ear_len - 1;
5132 } else {
5133 return;
5136 if (offset == (int)length) {
5137 return;
5139 /* ts+1) to (n+4) These octet(s) is/are present only if explicitly specified */
5140 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
5144 /* 8.38 MM Context
5145 * Type = 107 (decimal)
5146 * Figure 8.38-5: EPS Security Context and Quadruplets
5148 static void
5149 dissect_gtpv2_mm_context_eps_qq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5151 proto_item *qua_item, *qui_item;
5152 proto_tree *flag_tree, *qua_tree, *qui_tree, *sc_tree;
5153 int offset;
5154 uint8_t tmp, nhi, drxi, nr_qua, nr_qui, uamb_ri, osci, samb_ri, vdp_len;
5155 uint32_t dword, paging_len, ue_add_sec_cap_len, ex_access_res_data_len, ue_nr_sec_cap_len, apn_rte_ctrl_sts_len, ie_len;
5157 offset = 0;
5159 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
5161 /* Octet 5
5162 * Bits
5163 * 8 7 6 5 4 3 2 1
5164 * Security Mode | NHI | DRXI | KSIASME
5166 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
5167 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nhi, tvb, offset, 1, ENC_BIG_ENDIAN);
5168 /* If NHI (Next Hop Indicator), bit 5 of octet 5, is set to "1",
5169 * then the optional parameters NH (Next Hop) and NCC (Next
5170 * Hop Chaining Count) are both present, otherwise their octets are not present.
5172 tmp = tvb_get_uint8(tvb, offset);
5173 nhi = (tmp & 0x10) >> 4;
5174 drxi = (tmp & 0x08) >> 3;
5175 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
5176 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
5177 offset += 1;
5179 /* Octet 6
5180 * Bits
5181 * 8 7 6 5 4 3 2 1
5182 * Number of | Number of | UAMB | OSCI
5183 * Quintuplets | Quadruplet | RI |
5185 tmp = tvb_get_uint8(tvb, offset);
5186 nr_qui = (tmp & 0xe0) >> 5;
5187 nr_qua = tmp & 0x1c;
5188 nr_qua >>= 2;
5189 uamb_ri = (tmp & 0x2) >> 1;
5190 osci = tmp & 1;
5192 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
5193 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
5194 /* UAMB RI */
5195 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
5196 /* OSCI */
5197 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_osci, tvb, offset, 1, ENC_BIG_ENDIAN);
5198 offset += 1;
5200 /* Octet 7 SAMB RI Used NAS integrity protection algorithm Used NAS Cipher*/
5201 /* SAMB RI */
5202 samb_ri = tvb_get_uint8(tvb, offset) >> 7;
5203 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
5204 /* Used NAS integrity protection algorithm */
5205 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unipa, tvb, offset, 1, ENC_BIG_ENDIAN);
5206 /* Used NAS Cipher */
5207 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unc, tvb, offset, 1, ENC_BIG_ENDIAN);
5208 offset += 1;
5210 /* Octet 8-10 NAS Downlink Count*/
5211 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_dl_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
5212 offset += 3;
5214 /* Octet 11-13 NAS Uplink Count */
5215 proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_ul_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
5216 offset += 3;
5218 /* Octet 14-45 */
5219 proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
5220 offset += 32;
5222 qua_item = proto_tree_add_uint(tree, hf_gtpv2_authentication_quadruplets, tvb, offset, 0, nr_qua);
5223 if ( nr_qua ){
5224 qua_tree = proto_item_add_subtree(qua_item, ett_gtpv2_qua);
5225 offset = dissect_gtpv2_authentication_quadruplets(tvb, qua_tree, offset, nr_qua);
5226 }else {
5227 proto_item_set_generated(qua_item);
5230 qui_item = proto_tree_add_uint(tree, hf_gtpv2_authentication_quintuplets, tvb, offset, 0, nr_qui);
5231 if (nr_qui) {
5232 qui_tree = proto_item_add_subtree(qui_item, ett_gtpv2_qui);
5233 offset = dissect_gtpv2_authentication_quintuplets(tvb, qui_tree, offset, nr_qui);
5234 }else{
5235 proto_item_set_generated(qui_item);
5238 /* (h+1) to (h+2) DRX parameter */
5239 if (drxi) {
5240 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
5241 offset += 2;
5244 /* Octet p to p+31 & Octet p+32 */
5245 if ( nhi )
5247 proto_tree_add_item(tree, hf_gtpv2_mm_context_nh, tvb, offset, 32, ENC_NA);
5248 offset += 32;
5250 proto_tree_add_item(tree, hf_gtpv2_mm_context_ncc, tvb, offset, 1, ENC_BIG_ENDIAN);
5251 offset += 1;
5255 /* Dissect octet j to r */
5256 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
5258 /* r+1 Spare HBNA HNNA ENA INA GANA GENA UNA */
5259 if (offset < (int)length) {
5260 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
5261 } else {
5262 return;
5265 if (offset == (int)length) {
5266 return;
5269 /* the fields for the Old EPS Security Context (i.e. octets from s to s+64)
5270 * may be present only in S10 Forward Relocation Request message according to
5271 * the Rules on Concurrent Running of Security Procedures, which are specified in 3GPP TS 33.401 [12].
5272 * The octets for Old EPS Security Context shall be present if the OSCI (Old Security Context Indicator),
5273 * bit 1 of octet 6) is set to "1"; otherwise they shall not be present.
5275 if (osci == 1) {
5276 /* s */
5277 /* If NHI_old (Next Hop Indicator for old EPS Security Context), bit 1 of octet s, is set to "1",
5278 * then the parameters old NH (Next Hop) and old NCC (Next Hop Chaining Count) shall be present;
5279 * otherwise the octets for old NH parameter shall not be present and the value of old NCC parameter
5280 * shall be ignored by the receiver
5282 /* NHI_old Spare old KSIASME old NCC*/
5283 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_contex_nhi_old, tvb, offset, 1, ENC_BIG_ENDIAN, &dword);
5284 proto_tree_add_item(tree, hf_gtpv2_mm_context_old_ksiasme, tvb, offset, 1, ENC_BIG_ENDIAN);
5285 proto_tree_add_item(tree, hf_gtpv2_mm_context_old_ncc, tvb, offset, 1, ENC_BIG_ENDIAN);
5286 offset++;
5287 /* (s+1) to (s+32) old KASME */
5288 proto_tree_add_item(tree, hf_gtpv2_mm_context_old_kasme, tvb, offset, 32, ENC_NA);
5289 offset += 32;
5290 /* (s+33) to (s+64) old NH */
5291 if (dword) {
5292 proto_tree_add_item(tree, hf_gtpv2_mm_context_old_nh, tvb, offset, 32, ENC_NA);
5293 offset += 32;
5297 if (offset == (int)length) {
5298 return;
5301 /* w Length of Voice Domain Preference and UE's Usage Setting */
5302 vdp_len = tvb_get_uint8(tvb, offset);
5303 proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5304 offset += 1;
5305 /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
5306 if (vdp_len) {
5307 proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
5308 offset += vdp_len;
5311 if (offset == (int)length) {
5312 return;
5315 /* (t+1) to (t+2) Length of UE Radio Capability for Paging information*/
5316 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_paging_len, tvb, offset, 2, ENC_BIG_ENDIAN, &paging_len);
5317 offset += 2;
5319 if (paging_len > 0) {
5320 proto_tree_add_item(tree, hf_gtpv2_ue_radio_capability_for_paging_information, tvb, offset, paging_len, ENC_NA);
5321 offset +=paging_len;
5324 if (offset == (int)length) {
5325 return;
5328 /*(u+1) Length of Extended Access Restriction Data */
5329 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_ex_access_res_data_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ex_access_res_data_len);
5330 offset += 1;
5332 /*(u+2) to v
5333 *8 7 6 5 4 3 2 1
5334 * spare | USSRNA | NRSRNA
5336 if(ex_access_res_data_len > 0){
5337 static int* const ear_flags[] = {
5338 &hf_gtpv2_spare_b7_b5,
5339 &hf_gtpv2_mm_context_nruna,
5340 &hf_gtpv2_mm_context_nrusrna,
5341 &hf_gtpv2_mm_context_nrna,
5342 &hf_gtpv2_mm_context_ussrna,
5343 &hf_gtpv2_mm_context_nrsrna,
5344 NULL
5346 proto_tree_add_bitmask_list(tree, tvb, offset, 1, ear_flags, ENC_BIG_ENDIAN);
5348 offset += 1;
5349 if (ex_access_res_data_len > 1) {
5350 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, ex_access_res_data_len - 1, "The rest of the IE not dissected yet");
5351 offset += ex_access_res_data_len - 1;
5355 if (offset == (int)length) {
5356 return;
5360 * The UE additional security capability coding is specified in clause 9.9.3.53 of 3GPP TS 24.301 [23].
5361 * If Length of UE additional security capability is zero, then the field UE additional security capability in octets "(v+2) to x" shall not be present.
5363 /*(v+1) Length of UE additional security capability*/
5364 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_ue_add_sec_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ue_add_sec_cap_len);
5365 offset += 1;
5367 /*(v+2) to x UE additional security capability*/
5368 if(ue_add_sec_cap_len > 0){
5369 sc_tree = proto_tree_add_subtree(tree, tvb, offset, ue_add_sec_cap_len, ett_gtpv2_mm_context_sc, NULL, "UE additional Security Capability");
5370 offset += de_emm_ue_add_sec_cap(tvb, sc_tree, NULL, offset, ue_add_sec_cap_len, NULL, 0);
5373 if (offset == (int)length) {
5374 return;
5377 /* x+1 Length of UE NR security capability */
5378 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_ue_nr_sec_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ue_nr_sec_cap_len);
5379 offset += 1;
5380 /* The UE NR security capability coding is specified in clause 9.8.3.57 of 3GPP TS 24.501.
5381 * If Length of UE NR security capability is zero, then the field UE NR security capability in octets
5382 "(x+2) to y" shall not be present.
5384 if (ue_nr_sec_cap_len) {
5385 /* (x+2) to y UE NR security capability */
5386 /* The UE NR security capability coding is specified in clause 9.8.3.57 of 3GPP TS 24.501 */
5387 sc_tree = proto_tree_add_subtree(tree, tvb, offset, ue_nr_sec_cap_len, ett_gtpv2_ue_nr_sec_cap_len, NULL, "UE NR security capability");
5388 proto_tree_add_expert_format(sc_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, ue_nr_sec_cap_len, "The rest of the IE not dissected yet");
5389 offset += ue_nr_sec_cap_len;
5392 if (offset == (int)length) {
5393 return;
5396 /* (y+1) to (y+2) Length of APN Rate Control Statuses */
5397 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_apn_rte_ctrl_sts_len, tvb, offset, 2, ENC_BIG_ENDIAN, &apn_rte_ctrl_sts_len);
5398 offset += 2;
5399 if (apn_rte_ctrl_sts_len) {
5400 /* (y+3) to l APN Rate Control Status [1..z] */
5401 sc_tree = proto_tree_add_subtree(tree, tvb, offset, apn_rte_ctrl_sts_len, ett_gtpv2_apn_rte_ctrl_sts_len, NULL, "APN Rate Control Status");
5402 proto_tree_add_expert_format(sc_tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, apn_rte_ctrl_sts_len, "The rest of the IE not dissected yet");
5403 offset += apn_rte_ctrl_sts_len;
5405 if (offset == (int)length) {
5406 return;
5409 /* (l+1) Length of Core Network Restrictions */
5410 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_cnr_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ie_len);
5411 offset += 1;
5412 if (ie_len) {
5413 /* (l+2) to (l+5) Core Network Restrictions */
5414 /* The Core Network Restrictions coding is specified in clause 7.2.230 of 3GPP TS 29.272 [70].
5415 If Length of Core Network Restrictions is zero, then the field of Core Network Restrictions
5416 in octets "(l+2) to (l+5)" shall not be present.
5418 tvbuff_t *new_tvb = tvb_new_subset_length(tvb, offset, ie_len);
5419 dissect_diameter_3gpp_core_network_restrictions(new_tvb, pinfo, tree, NULL);
5420 offset += ie_len;
5423 if (offset == (int)length) {
5424 return;
5427 /* (l+6) Length of UE Radio Capability ID */
5428 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_ue_radio_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ie_len);
5429 offset += 1;
5430 if (ie_len) {
5431 /* (l+7) to z UE Radio Capability ID
5432 * The UE Radio Capability ID is specified in the clause 9.9.3.60 of 3GPP TS24.301
5434 de_nas_5gs_mm_ue_radio_cap_id(tvb, tree, pinfo, offset, ie_len, NULL, 0);
5435 offset += ie_len;
5438 if (offset == (int)length) {
5439 return;
5442 /*(a) ENSCT */
5443 proto_tree_add_item(tree, hf_gtpv2_mm_context_ensct, tvb, offset, 1, ENC_BIG_ENDIAN);
5444 offset += 1;
5446 if (offset < (int)length){
5447 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length - offset, "The rest of the IE not dissected yet");
5452 * Type = 108 (decimal)
5453 * Figure 8.38-6: UMTS Key, Quadruplets and Quintuplets
5455 static void
5456 dissect_gtpv2_mm_context_utms_qq(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5458 proto_tree *flag_tree;
5459 uint32_t offset;
5460 uint8_t tmp, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_length;
5462 offset = 0;
5463 flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
5465 /* Octet 5
5466 * Security Mode Spare DRXI KSIASME
5468 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
5469 proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
5470 drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
5471 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
5472 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
5473 offset += 1;
5475 /* Octet 6
5476 * Bits
5477 * 8 7 6 5 4 3 2 1
5478 * Number of | Number of | UAMB | SAMB
5479 * Quintuplets | Quadruplet | RI | RI
5481 tmp = tvb_get_uint8(tvb, offset);
5482 nr_qui = (tmp & 0xe0) >> 5;
5483 nr_qua = tmp & 0x1c;
5484 nr_qua >>= 2;
5485 uamb_ri = (tmp & 0x2) >> 1;
5486 samb_ri = tmp & 0x01;
5488 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
5489 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
5490 proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
5491 proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
5492 offset += 1;
5493 /* Octet 7 Spare */
5494 proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5495 offset += 1;
5496 /* Octet 8 to 23 CK */
5497 proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
5498 offset += 16;
5499 /* Octet 24 to 39 IK */
5500 proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
5501 offset += 16;
5503 if ( nr_qua ) {
5504 offset = dissect_gtpv2_authentication_quadruplets(tvb, tree, offset, nr_qua);
5507 if (nr_qui) {
5508 offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
5511 /* (h+1) to (h+2) DRX parameter */
5512 if (drxi) {
5513 proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
5514 offset += 2;
5517 /* Dissect octet j to r */
5518 offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
5520 if (offset >= (uint32_t)length) {
5521 return;
5523 /* r+1 Spare HBNA HNNA ENA INA GANA GENA UNA */
5524 offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
5526 if (offset >= (uint32_t)length) {
5527 return;
5530 /* 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
5531 * Length of Voice Domain Preference and UE's Usage Setting is zero, then the Voice Domain Preference and UE's Usage
5532 * Setting parameter shall not be present.
5534 /* r+2 */
5535 vdp_length = tvb_get_uint8(tvb, offset);
5536 proto_tree_add_item(tree, hf_gtpv2_vdp_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5537 offset++;
5539 if(vdp_length !=0){
5540 offset += de_gmm_voice_domain_pref(tvb, tree, pinfo, offset, vdp_length, NULL, 0);
5543 if (offset < (uint32_t)length) {
5544 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
5550 * 8.39 PDN Connection (grouped IE)
5552 static void
5553 dissect_gtpv2_PDN_conn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5555 int offset = 0;
5556 proto_tree *grouped_tree;
5557 tvbuff_t *new_tvb;
5559 proto_item_append_text(item, "[Grouped IE]");
5560 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
5561 new_tvb = tvb_new_subset_length(tvb, offset, length);
5563 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_PDN_CONNECTION);
5566 * 8.40 PDU Numbers
5568 static void
5569 dissect_gtpv2_pdn_numbers(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5571 proto_item *nsapi_ti;
5572 proto_tree *nsapi_tree;
5573 uint8_t nsapi;
5574 int offset = 0;
5576 nsapi = (tvb_get_uint8(tvb, offset) & 0x08);
5577 nsapi_ti = proto_tree_add_item(tree, hf_gtpv2_nsapi08, tvb, offset, 1, ENC_BIG_ENDIAN);
5578 nsapi_tree = proto_item_add_subtree(nsapi_ti, ett_gtpv2_pdn_numbers_nsapi);
5579 proto_tree_add_bits_item(nsapi_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
5580 proto_tree_add_item(nsapi_tree, hf_gtpv2_pdn_numbers_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
5581 proto_item_append_text(item, "NSAPI: %u", nsapi);
5582 offset += 1;
5584 proto_tree_add_item(tree, hf_gtpv2_dl_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5585 offset += 2;
5587 proto_tree_add_item(tree, hf_gtpv2_ul_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5588 offset += 2;
5590 proto_tree_add_item(tree, hf_gtpv2_send_n_pdu_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5591 offset += 2;
5593 proto_tree_add_item(tree, hf_gtpv2_receive_n_pdu_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5597 * 8.41 Packet TMSI (P-TMSI)
5599 static void
5600 dissect_gtpv2_p_tmsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5602 int offset = 0;
5603 proto_item* ti;
5605 /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation. */
5606 proto_tree_add_item(tree, hf_gtpv2_p_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
5607 ti = proto_tree_add_item(tree, hf_3gpp_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
5608 proto_item_set_hidden(ti);
5609 proto_item_append_text(item, "%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 4));
5613 * 8.42 P-TMSI Signature
5615 static void
5616 dissect_gtpv2_p_tmsi_sig(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5618 int offset = 0;
5620 /* The P-TMSI Signature consists of 3 octets and may be allocated by the SGSN. */
5621 proto_tree_add_item(tree, hf_gtpv2_p_tmsi_sig, tvb, offset, 3, ENC_BIG_ENDIAN);
5622 proto_item_append_text(item, "%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 3));
5627 * 8.43 Hop Counter
5629 static void
5630 dissect_gtpv2_hop_counter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5632 int offset = 0;
5633 uint8_t hop_counter;
5635 hop_counter = tvb_get_uint8(tvb, offset);
5637 proto_tree_add_item(tree, hf_gtpv2_hop_counter, tvb, offset, 1, ENC_BIG_ENDIAN);
5638 proto_item_append_text(item, "%d", hop_counter);
5642 * 8.44 UE Time Zone
5645 static const value_string gtpv2_ue_time_zone_dst_vals[] = {
5646 {0, "No Adjustments for Daylight Saving Time"},
5647 {1, "+1 Hour Adjustments for Daylight Saving Time"},
5648 {2, "+2 Hour Adjustments for Daylight Saving Time"},
5649 {3, "Spare"},
5650 {0, NULL}
5652 static void
5653 dissect_gtpv2_ue_time_zone(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5655 int offset = 0;
5658 * UE Time Zone is used to indicate the offset between universal time and local time in steps of 15 minutes of where the
5659 * UE currently resides. The "Time Zone" field uses the same format as the "Time Zone" IE in 3GPP TS 24.008 [5].
5660 * (packet-gsm_a_dtap.c)
5662 de_time_zone(tvb, tree, pinfo, offset, 1, NULL, 0);
5663 offset += 1;
5664 proto_tree_add_item(item, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, ENC_BIG_ENDIAN);
5668 * 8.45 Trace Reference
5670 static void
5671 dissect_gtpv2_trace_reference(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5673 int offset = 0;
5674 uint32_t trace_id;
5675 char *mcc_mnc_str;
5677 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, true);
5678 offset += 3;
5680 trace_id = tvb_get_ntohs(tvb, offset);
5681 proto_tree_add_item(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN);
5683 proto_item_append_text(item, "%s,Trace ID %u", mcc_mnc_str, trace_id);
5686 * 8.46 Complete Request Message
5688 static const value_string gtpv2_complete_req_msg_type_vals[] = {
5689 {0, "Complete Attach Request Message" },
5690 {1, "Complete TAU Request Message" },
5691 {0, NULL }
5693 static void
5694 dissect_complete_request_msg(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5696 tvbuff_t *new_tvb;
5697 int offset;
5699 offset = 0;
5701 proto_tree_add_item(tree, hf_gtpv2_complete_req_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5703 offset += 1;
5705 /* Add the Complete Request Message */
5706 new_tvb = tvb_new_subset_length(tvb, offset, length-1);
5707 call_dissector(nas_eps_handle, new_tvb, pinfo, tree);
5712 * 8.47 GUTI
5714 static void
5715 dissect_gtpv2_guti(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
5717 int offset = 0;
5719 offset = 0;
5721 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
5722 offset += 3;
5724 proto_tree_add_item(tree, hf_gtpv2_mme_grp_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5725 offset += 2;
5727 proto_tree_add_item(tree, hf_gtpv2_mme_code, tvb, offset, 1, ENC_BIG_ENDIAN);
5728 offset += 1;
5730 proto_tree_add_item(tree, hf_gtpv2_m_tmsi, tvb, offset, 4, ENC_NA);
5734 * 8.48 Fully Qualified Container (F-Container)
5737 static const value_string gtpv2_container_type_vals[] = {
5738 {1, "UTRAN transparent container"},
5739 {2, "BSS container"},
5740 {3, "E-UTRAN transparent container"},
5741 {4, "NBIFOM Container"},
5742 {5, "EN-DC Container"},
5743 {6, "Inter-System SON Container"},
5744 {0, NULL}
5748 static void
5749 dissect_gtpv2_F_container(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type, uint8_t instance _U_, session_args_t * args _U_)
5751 tvbuff_t *new_tvb;
5752 proto_tree *sub_tree;
5753 int offset = 0;
5754 uint32_t container_type;
5755 uint8_t container_flags, xid_len;
5757 /* Octets 8 7 6 5 4 3 2 1
5758 * 5 Spare | Container Type
5760 proto_tree_add_item_ret_uint(tree, hf_gtpv2_container_type, tvb, offset, 1, ENC_BIG_ENDIAN, &container_type);
5761 offset += 1;
5762 length--;
5763 if (length == 0) {
5764 expert_add_info(pinfo, item, &ei_gtpv2_ie_len_invalid);
5765 return;
5767 if ( (message_type == GTPV2_FORWARD_RELOCATION_REQ)
5768 || (message_type == GTPV2_CONTEXT_RESPONSE)
5769 || (message_type == GTPV2_RAN_INFORMATION_RELAY)) {
5770 switch (container_type) {
5771 case 1:
5772 /* UTRAN transparent container (1)
5773 * Contains the "Source to Target
5774 * Transparent Container", if the message is used for PS
5775 * handover to UTRAN Iu mode procedures, SRNS relocation
5776 * procedure and E-UTRAN to UTRAN inter RAT handover
5777 * procedure.
5779 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_utran_con, NULL, "UTRAN transparent container");
5780 new_tvb = tvb_new_subset_length(tvb, offset, length);
5781 dissect_ranap_Source_ToTarget_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5782 return;
5783 case 2:
5784 /* BSS container */
5785 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_bss_con, NULL, "BSS container");
5786 /* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of parameter */
5787 proto_tree_add_item(sub_tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
5788 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5789 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5790 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5791 container_flags = tvb_get_uint8(tvb, offset);
5792 offset += 1;
5793 if ((container_flags & 0x01) == 1) {
5794 /* Packet Flow ID present */
5795 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
5796 offset += 1;
5798 if (((container_flags & 0x04) == 4) || ((container_flags & 0x02) == 2)) {
5799 if ((container_flags & 0x04) == 4) {
5800 /* SAPI present */
5801 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
5803 if ((container_flags & 0x02) == 2) {
5804 /* Radio Priority present */
5805 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
5807 offset += 1;
5809 if ((container_flags & 0x08) == 8) {
5810 /* XiD parameters length is present in Octet c.
5811 * XiD parameters are present in Octet d to n.
5813 xid_len = tvb_get_uint8(tvb, offset);
5814 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5815 offset += 1;
5816 proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_NA);
5818 return;
5819 case 3:
5820 /* E-UTRAN transparent container
5821 * This IE shall be included to contain the "Source to Target
5822 * Transparent Container", if the message is used for
5823 * UTRAN/GERAN to E-UTRAN inter RAT handover
5824 * procedure, E-UTRAN intra RAT handover procedure and
5825 * 3G SGSN to MME combined hard handover and SRNS
5826 * relocation procedure. The Container Type shall be set to 3.
5828 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_eutran_con, NULL, "E-UTRAN transparent container");
5829 new_tvb = tvb_new_subset_length(tvb, offset, length);
5830 dissect_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5831 return;
5832 default:
5833 break;
5836 if (message_type == GTPV2_FORWARD_CTX_NOTIFICATION) {
5837 switch (container_type) {
5838 case 3:
5839 /* E-UTRAN transparent container */
5840 new_tvb = tvb_new_subset_length(tvb, offset, length);
5841 dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(new_tvb, pinfo, tree, NULL);
5842 return;
5843 default:
5844 break;
5847 if (message_type == GTPV2_FORWARD_RELOCATION_RESP) {
5849 /* 7.3.2 Forward Relocation Response */
5850 switch (container_type) {
5851 case 3:
5852 /* E-UTRAN transparent container
5853 * This IE shall be included to contain the "Target to Source Transparent Container"
5854 * during a handover to E-UTRAN, 5GS to EPS handover and EPS to 5GS handover.
5855 * If the Cause IE contains the value "Request accepted". The Container Type shall be set to 3.
5857 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_eutran_con, NULL, "E-UTRAN transparent container");
5858 new_tvb = tvb_new_subset_length(tvb, offset, length);
5859 dissect_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5860 return;
5861 default:
5862 break;
5865 if (message_type == GTPV2_CONFIGURATION_TRANSFER_TUNNEL) {
5866 /* 7.3.18 Configuration Transfer Tunnel */
5867 switch (container_type) {
5868 case 3:
5869 /* SON Configuration Transfer
5870 * This IE shall be included to contain the "SON Configuration Transfer" as specified in 3GPP TS 36.413 [10].
5871 * The Container Type shall be set to 3.
5873 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_son_con, NULL, "SON Configuration Transfer");
5874 new_tvb = tvb_new_subset_length(tvb, offset, length);
5875 dissect_s1ap_SONConfigurationTransfer_PDU(new_tvb, pinfo, sub_tree, NULL);
5876 return;
5877 case 5:
5878 /* EN-DC SON Configuration Transfer
5879 * This IE shall be included to contain the "EN-DC SON Configuration Transfer" as specified in 3GPP TS 36.413 [10].
5880 * The Container Type shall be set to 5.
5882 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_endc_son_con, NULL, "EN-DC SON Configuration Transfer");
5883 new_tvb = tvb_new_subset_length(tvb, offset, length);
5884 dissect_s1ap_EN_DCSONConfigurationTransfer_PDU(new_tvb, pinfo, sub_tree, NULL);
5885 return;
5886 case 6:
5887 /* Inter-System SON Container
5888 * This IE shall be included to contain the "Inter-System SON Container" as specified in 3GPP TS 36.413 [10].
5889 * The Container Type shall be set to 6.
5891 sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_intersys_son_con, NULL, "Inter-System SON Container");
5892 new_tvb = tvb_new_subset_length(tvb, offset, length);
5893 dissect_s1ap_IntersystemSONConfigurationTransfer_PDU(new_tvb, pinfo, sub_tree, NULL);
5894 return;
5895 default:
5896 break;
5899 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length);
5904 * 8.49 Fully Qualified Cause (F-Cause)
5907 static const value_string gtpv2_cause_type_vals[] = {
5908 {0, "Radio Network Layer"},
5909 {1, "Transport Layer"},
5910 {2, "NAS"},
5911 {3, "Protocol"},
5912 {4, "Miscellaneous"},
5913 {5, "<spare>"},
5914 {6, "<spare>"},
5915 {7, "<spare>"},
5916 {8, "<spare>"},
5917 {9, "<spare>"},
5918 {10, "<spare>"},
5919 {11, "<spare>"},
5920 {12, "<spare>"},
5921 {13, "<spare>"},
5922 {14, "<spare>"},
5923 {15, "<spare>"},
5924 {0, NULL}
5926 static value_string_ext gtpv2_cause_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_type_vals);
5928 static void
5929 dissect_gtpv2_s1ap_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, uint8_t cause_type)
5932 switch (cause_type) {
5933 case 0:
5934 /* CauseRadioNetwork */
5935 proto_tree_add_item(tree, hf_gtpv2_CauseRadioNetwork, tvb, offset, 1, ENC_BIG_ENDIAN);
5936 break;
5937 case 1:
5938 /* CauseTransport */
5939 proto_tree_add_item(tree, hf_gtpv2_CauseTransport, tvb, offset, 1, ENC_BIG_ENDIAN);
5940 break;
5941 case 2:
5942 /* CauseNas */
5943 proto_tree_add_item(tree, hf_gtpv2_CauseNas, tvb, offset, 1, ENC_BIG_ENDIAN);
5944 break;
5945 case 3:
5946 /* CauseProtocol */
5947 proto_tree_add_item(tree, hf_gtpv2_CauseProtocol, tvb, offset, 1, ENC_BIG_ENDIAN);
5948 break;
5949 case 4:
5950 /* CauseMisc */
5951 proto_tree_add_item(tree, hf_gtpv2_CauseMisc, tvb, offset, 1, ENC_BIG_ENDIAN);
5952 break;
5953 default:
5954 break;
5957 return;
5960 static void
5961 dissect_gtpv2_F_cause(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type, uint8_t instance, session_args_t * args _U_)
5963 int offset = 0;
5964 uint8_t cause_type;
5966 /* The value of Instance field of the F-Cause IE in a GTPv2 message shall indicate
5967 * whether the F-Cause field contains RANAP Cause, BSSGP Cause or RAN Cause.
5968 * If the F-Cause field contains RAN Cause, the Cause Type field shall contain
5969 * the RAN cause subcategory as specified in 3GPP TS 36.413 [10] and it shall be
5970 * encoded as in Table 8.49-1.
5971 * If the F-Cause field contains BSSGP Cause or RANAP Cause,
5972 * the Cause Type field shall be ignored by the receiver.
5974 if (message_type == GTPV2_FORWARD_RELOCATION_REQ) {
5975 switch (instance) {
5976 case 0:
5977 proto_item_append_text(item, "[RAN Cause]");
5978 proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5979 cause_type = tvb_get_uint8(tvb, offset);
5980 offset += 1;
5981 dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
5982 return;
5983 case 1:
5984 proto_item_append_text(item, "[RANAP Cause]");
5985 break;
5986 case 2:
5987 proto_item_append_text(item, "[BSSGP Cause]");
5988 break;
5989 default:
5990 break;
5993 else if (message_type == GTPV2_FORWARD_RELOCATION_RESP) {
5994 /* Table 7.3.2-1: Information Elements in a Forward Relocation Response */
5995 switch (instance) {
5996 case 0:
5997 /* Instance 0 S1-AP Cause */
5998 proto_item_append_text(item, "[S1-AP Cause]");
5999 proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6000 cause_type = tvb_get_uint8(tvb, offset);
6001 offset++;
6002 dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
6003 return;
6004 case 1:
6005 /* Instance 1 RANAP Cause */
6006 proto_item_append_text(item, "[RANAP Cause]");
6007 break;
6008 case 2:
6009 /* Instance 2 BSSGP Cause */
6010 proto_item_append_text(item, "[BSSGP Cause]");
6011 break;
6012 default:
6013 break;
6016 }/* GTPV2_FORWARD_RELOCATION_RESP */
6018 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
6023 * 8.50 PLMN ID
6026 * The Selected PLMN ID IE contains the core network operator selected for tne UE
6027 * in a shared network. Octets 5-7 shall be encoded as the content part of the
6028 * "Selected PLMN Identity" parameter in 3GPP TS 36.413 [10].
6029 * -The Selected PLMN identity consists of 3 digits from MCC followed by
6030 * either -a filler digit plus 2 digits from MNC (in case of 2 digit MNC) or
6031 * -3 digits from MNC (in case of a 3 digit MNC).
6033 * 8 7 6 5 4 3 2 1
6034 * +--+--+--+--+--+--+--+--+
6035 * Octet 5 |MCC digit 2|MCC digit 1|
6036 * +--+--+--+--+--+--+--+--+
6037 * Octet 6 |MNC digit 1|MCC digit 3|
6038 * +--+--+--+--+--+--+--+--+
6039 * Octet 7 |MNC digit 3|MNC digit 2|
6040 * +--+--+--+--+--+--+--+--+
6042 static void
6043 dissect_gtpv2_plmn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6045 char *mcc_mnc_str;
6047 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, false);
6048 proto_item_append_text(item, "%s", mcc_mnc_str);
6052 * 8.51 Target Identification
6055 static const value_string gtpv2_target_type_vals[] = {
6056 {0, "RNC ID"},
6057 {1, "Macro eNodeB ID"},
6058 {2, "Cell Identifier"},
6059 {3, "Home eNodeB ID"},
6060 {4, "Extended Macro eNodeB ID"},
6061 {5, "gNodeB ID"},
6062 {6, "Macro ng-eNodeB ID"},
6063 {7, "Extended ng-eNodeB ID"},
6064 {8, "en-gNB ID"},
6065 {0, NULL}
6067 static value_string_ext gtpv2_target_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_target_type_vals);
6069 static char*
6070 dissect_gtpv2_home_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
6072 char *str = NULL;
6073 char *mcc_mnc_str;
6074 uint32_t home_enodeb_id;
6076 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
6077 *offset += 3;
6079 /* Octet 10 to 12 Home eNodeB ID
6080 * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
6081 * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
6082 * The coding of the Home eNodeB ID is the responsibility of each administration.
6083 * Coding using full hexadecimal representation shall be used.
6085 home_enodeb_id = tvb_get_ntohl(tvb, *offset) & 0x0fffffff;
6086 proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, *offset, 4 , ENC_BIG_ENDIAN);
6087 *offset += 4;
6089 str = wmem_strdup_printf(pinfo->pool, "%s, Home eNodeB ID 0x%x",
6090 mcc_mnc_str,
6091 home_enodeb_id);
6093 return str;
6096 static char*
6097 dissect_gtpv2_gnodeb_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, int* offset)
6099 char* str = NULL;
6100 char* mcc_mnc_str;
6101 uint32_t gnodeb_id;
6103 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
6104 *offset += 3;
6106 /* The gNodeB ID Length field, in bits 1 to 6 of octet 9,
6107 * indicates the length of the gNodeB ID in number of bits
6110 proto_tree_add_item(tree, hf_gtpv2_gnodeb_id_len, tvb, *offset, 1, ENC_BIG_ENDIAN);
6111 *offset += 1;
6113 proto_tree_add_item_ret_uint(tree, hf_gtpv2_gnodeb_id, tvb, *offset, 4, ENC_BIG_ENDIAN, &gnodeb_id);
6114 *offset += 4;
6116 str = wmem_strdup_printf(pinfo->pool, "%s, gNodeB ID 0x%x",
6117 mcc_mnc_str,
6118 gnodeb_id);
6120 return str;
6123 static char*
6124 dissect_gtpv2_macro_ng_enodeb_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, int* offset)
6126 char *str = NULL;
6127 char *mcc_mnc_str;
6128 uint32_t ng_enodeb_id;
6130 mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
6131 *offset += 3;
6133 proto_tree_add_item_ret_uint(tree, hf_gtpv2_macro_ng_enodeb_id, tvb, *offset, 3, ENC_BIG_ENDIAN, &ng_enodeb_id);
6134 *offset += 3;
6136 str = wmem_strdup_printf(pinfo->pool, "%s, Macro ng-eNodeB ID 0x%x",
6137 mcc_mnc_str,
6138 ng_enodeb_id);
6140 return str;
6143 static void
6144 dissect_gtpv2_target_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6146 tvbuff_t *new_tvb;
6147 int offset = 0;
6148 uint8_t target_type, oct;
6150 proto_tree_add_item(tree, hf_gtpv2_target_type, tvb, 0, 1, ENC_BIG_ENDIAN);
6151 target_type = tvb_get_uint8(tvb, offset);
6152 offset += 1;
6153 switch (target_type) {
6154 case 0:
6155 /* 8.51.2 RNC ID*/
6156 new_tvb = tvb_new_subset_remaining(tvb, offset);
6157 dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, E212_NONE, true);
6158 offset += 3;
6159 /* LAC */
6160 proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
6161 offset+=2;
6163 /* RAC (see NOTE 3) */
6164 proto_tree_add_item(tree, hf_gtpv2_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
6165 offset++;
6166 /* RNC ID
6167 * In this case the Target ID field shall be encoded as the Target
6168 * RNC-ID part of the "Target ID" parameter in 3GPP TS 25.413 [33]. Therefore, the "Choice Target ID" that indicates
6169 * "Target RNC-ID" (numerical value of 0x20) shall not be included (value in octet 5 specifies the target type).
6171 proto_tree_add_item(tree, hf_gtpv2_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6172 /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
6173 * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
6175 if(length == 11){
6176 proto_tree_add_item(tree, hf_gtpv2_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6178 return;
6179 case 1:
6180 /* Macro eNodeB ID*/
6181 dissect_gtpv2_macro_enodeb_id(tvb, pinfo, tree, &offset);
6183 /* Tracking Area Code (TAC) */
6184 proto_tree_add_item(tree, hf_gtpv2_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6186 return;
6188 case 2:
6189 /* Cell Identifier */
6190 /* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
6191 * in 3GPP TS 48.018 [34].
6193 new_tvb = tvb_new_subset_remaining(tvb, offset);
6194 de_bssgp_cell_id(new_tvb, tree, pinfo, 0, 0/* not used */, NULL, 0);
6195 return;
6196 case 3:
6197 /* Home eNodeB ID */
6198 dissect_gtpv2_home_enodeb_id(tvb, pinfo, tree, &offset);
6200 /* Octet 13 to 14 Tracking Area Code (TAC) */
6201 proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
6202 return;
6204 case 4:
6205 /* 8.51.5 Extended Macro eNodeB ID */
6206 dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, tree, &offset, hf_gtpv2_ext_macro_enodeb_id);
6208 /* Octet 12 to 13 Tracking Area Code (TAC) */
6209 proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6210 return;
6212 case 5:
6213 /* gNodeB ID */
6214 dissect_gtpv2_gnodeb_id(tvb, pinfo, tree, &offset);
6216 /* Octet 14 to 16 5GS Tracking Area Code (TAC) */
6217 proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6218 return;
6220 case 6:
6221 /* Macro ng-eNodeB ID */
6222 dissect_gtpv2_macro_ng_enodeb_id(tvb, pinfo, tree, &offset);
6223 /* Octet 14 to 16 5GS Tracking Area Code (TAC) */
6224 proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6225 return;
6227 case 7:
6228 /* Extended ng-eNodeB ID */
6229 dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, tree, &offset, hf_gtpv2_ext_macro_ng_enodeb_id);
6230 /* Octet 12 to 14 5GS Tracking Area Code (TAC) */
6231 proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6232 return;
6234 case 8:
6235 /* en-gNB ID */
6236 dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_NONE, true);
6237 offset += 3;
6238 /* Octet 9 5TAC ETAC en-gNB ID Length */
6239 oct = tvb_get_uint8(tvb, offset);
6240 proto_tree_add_item(tree, hf_gtpv2_5tac, tvb, offset, 1, ENC_BIG_ENDIAN);
6241 proto_tree_add_item(tree, hf_gtpv2_etac, tvb, offset, 1, ENC_BIG_ENDIAN);
6242 proto_tree_add_item(tree, hf_gtpv2_en_gnb_id_len, tvb, offset, 1, ENC_BIG_ENDIAN);
6243 offset++;
6245 /* Octet 10 to 13 en-gNB ID */
6246 proto_tree_add_item(tree, hf_gtpv2_en_gnb_id, tvb, offset, 4, ENC_BIG_ENDIAN);
6247 offset += 4;
6249 if ((oct & 0x40) == 0x40) {
6250 /* ETAC*/
6251 /* p to (p+1 */
6252 proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6253 offset += 2;
6256 if ((oct & 0x80) == 0x80) {
6257 /* 5 TAC*/
6258 /* q to(q + 2) */
6259 proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6261 return;
6263 default:
6264 break;
6266 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
6271 * 8.52 Void
6274 * 8.53 Packet Flow ID
6276 static void
6277 dissect_gtpv2_pkt_flow_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6279 int offset = 0;
6281 /* Octet 5 Spare EBI */
6282 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
6283 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
6284 offset += 1;
6286 /* Packet Flow ID */
6287 proto_tree_add_item(tree, hf_gtpv2_packet_flow_id, tvb, offset, length - 1, ENC_NA);
6291 * 8.54 RAB Context
6293 static void
6294 dissect_gtpv2_rab_context(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6296 int offset = 0;
6298 /* 5 Spare NSAPI */
6299 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
6300 proto_tree_add_item(tree, hf_gtpv2_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
6301 offset++;
6303 /* 6 to 7 DL GTP-U Sequence Number */
6304 proto_tree_add_item(tree, hf_gtpv2_dl_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6305 offset += 2;
6307 /* 8 to 9 UL GTP-U Sequence Number */
6308 proto_tree_add_item(tree, hf_gtpv2_ul_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6309 offset += 2;
6311 /* 10 to 11 DL PDCP Sequence Number */
6312 proto_tree_add_item(tree, hf_gtpv2_dl_pdcp_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6313 offset += 2;
6315 /* 12 to 13 UL PDCP Sequence Number */
6316 proto_tree_add_item(tree, hf_gtpv2_ul_pdcp_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6321 * 8.55 Source RNC PDCP context info
6323 static void
6324 dissect_gtpv2_s_rnc_pdcp_ctx_info(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6326 proto_tree_add_item(tree, hf_gtpv2_rrc_container, tvb, 0, length, ENC_NA);
6330 * 8.56 Port Number
6332 static void
6333 dissect_port_nr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6335 proto_tree_add_item(tree, hf_gtpv2_port_number, tvb, 0, 2, ENC_BIG_ENDIAN);
6336 proto_item_append_text(item, "%u", tvb_get_ntohs(tvb, 0));
6339 * 8.57 APN Restriction
6342 /* Table 8.57-1: Valid Combinations of APN Restriction */
6343 static const value_string gtpv2_apn_restriction_vals[] = {
6344 {0, "No Existing Contexts or Restriction"},
6345 {1, "Public-1"},
6346 {2, "Public-2"},
6347 {3, "Private-1"},
6348 {4, "Private-2"},
6349 {0, NULL}
6351 static value_string_ext gtpv2_apn_restriction_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_apn_restriction_vals);
6353 static void
6354 dissect_gtpv2_apn_rest(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6356 uint8_t type_value;
6357 int offset = 0;
6359 /* APN restriction value octet 5 */
6360 type_value = tvb_get_uint8(tvb, offset);
6361 proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, offset, 1, ENC_BIG_ENDIAN);
6363 /* Add APN restriction to ie_tree */
6364 proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(type_value, &gtpv2_apn_restriction_vals_ext, "Unknown"), type_value);
6365 offset += 1;
6367 if (length > offset)
6368 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
6372 * 8.58 Selection Mode
6374 static const value_string gtpv2_selec_mode_vals[] = {
6375 {0, "MS or network provided APN, subscribed verified"},
6376 {1, "MS provided APN, subscription not verified"},
6377 {2, "Network provided APN, subscription not verified"},
6378 {3, "Network provided APN, subscription not verified (Basically for Future use"},
6379 {0, NULL}
6382 void
6383 dissect_gtpv2_selec_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6385 int offset = 0;
6386 uint8_t ss_mode;
6388 ss_mode = tvb_get_uint8(tvb, offset) & 0x03;
6389 proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
6390 proto_item_append_text(item, "%s", val_to_str_const(ss_mode, gtpv2_selec_mode_vals, "Unknown"));
6395 * 8.59 Source Identification
6397 #if 0
6398 static const value_string gtpv2_source_ident_types[] = {
6399 {0, "Cell ID"},
6400 {1, "RNC ID"},
6401 {2, "eNodeB ID(Reserved, used in earlier v of proto.)"},
6402 {0, NULL}
6404 #endif
6405 static void
6406 dissect_gtpv2_source_ident(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6408 int offset = 0;
6409 uint8_t source_type;
6411 /* Octet 5 to 12 Target Cell ID */
6412 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
6413 offset += 8;
6414 /* Octet 13 Source Type */
6415 source_type = tvb_get_uint8(tvb, offset);
6416 proto_tree_add_item(tree, hf_gtpv2_source_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6417 offset += 1;
6418 /* Octet 14 to (n+4) Source ID */
6419 switch (source_type) {
6420 case 0:
6421 /* The Source Type is Cell ID for PS handover from GERAN A/Gb mode. In this case the coding of the Source ID field
6422 * shall be same as the Octets 3 to 10 of the Cell Identifier IEI in 3GPP TS 48.018 [34].
6424 de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
6425 break;
6426 case 1:
6427 /* The Source Type is RNC ID for PS handover from GERAN Iu mode or for inter-RAT handover from UTRAN. In this
6428 * case the Source ID field shall be encoded as the Source RNC-ID part of the "Source ID" parameter in 3GPP TS
6429 * 25.413 [33].
6431 /* RNC-ID M INTEGER (0..4095) */
6432 break;
6433 case 2:
6434 break;
6435 default:
6436 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_source_type_unknown, tvb, offset-1, 1);
6437 break;
6443 * 8.60 Bearer Control Mode
6445 static const value_string gtpv2_bearer_control_mode_vals[] = {
6446 {0, "Selected Bearer Control Mode-'MS_only'"},
6447 {1, "Selected Bearer Control Mode-'Network_only'"},
6448 {2, "Selected Bearer Control Mode-'MS/NW'"},
6449 {0, NULL}
6452 static const value_string gtpv2_bearer_control_mode_short_vals[] = {
6453 {0, "MS_only"},
6454 {1, "Network_only"},
6455 {2, "MS/NW"},
6456 {0, NULL}
6459 static void
6460 dissect_gtpv2_bearer_control_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6462 uint8_t bcm;
6464 proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
6465 /* Add Bearer Control Mode to tree */
6466 bcm = tvb_get_uint8(tvb, 0);
6467 proto_item_append_text(item, "%s", val_to_str_const(bcm, gtpv2_bearer_control_mode_short_vals, "Unknown"));
6471 * 8.61 Change Reporting Action
6473 static const value_string gtpv2_cng_rep_act_vals[] = {
6474 {0, "Stop Reporting"},
6475 {1, "Start Reporting CGI/SAI"},
6476 {2, "Start Reporting RAI"},
6477 {3, "Start Reporting TAI"},
6478 {4, "Start Reporting ECGI"},
6479 {5, "Start Reporting CGI/SAI and RAI"},
6480 {6, "Start Reporting TAI and ECGI"},
6481 {0, NULL}
6484 static void
6485 dissect_gtpv2_cng_rep_act(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6487 uint8_t action;
6489 /* Add Action to tree */
6490 action = tvb_get_uint8(tvb, 0);
6491 proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, ENC_BIG_ENDIAN);
6493 proto_item_append_text(item, "%s", val_to_str_const(action, gtpv2_cng_rep_act_vals, "Unknown"));
6496 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
6498 #if 0
6499 static const value_string gtpv2_fq_csid_type_vals[] = {
6500 {0, "Global unicast IPv4 address"},
6501 {1, "Global unicast IPv6 address"},
6502 {2, "4 octets long field"},
6503 {0, NULL}
6505 #endif
6507 void
6508 dissect_gtpv2_fq_csid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6510 int offset = 0;
6511 uint8_t octet, node_id_type, csids;
6513 /* Octet 5 Node-ID Type Number of CSIDs= m */
6515 octet = tvb_get_uint8(tvb, offset);
6516 node_id_type = octet >> 4;
6517 csids = octet & 0x0f;
6518 proto_tree_add_item(tree, hf_gtpv2_fq_csid_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6519 proto_tree_add_item(tree, hf_gtpv2_fq_csid_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
6520 offset += 1;
6522 switch (node_id_type) {
6523 case 0:
6524 /* Indicates that Node-ID is a global unicast IPv4 address and p = 9 */
6525 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
6526 offset += 4;
6527 break;
6528 case 1:
6529 /* Indicates that Node-ID is a global unicast IPv6 address and p = 21 */
6530 proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv6, tvb, offset, 16, ENC_NA);
6531 offset += 16;
6532 break;
6533 case 2:
6534 /* Node-ID is a 4 octets long field with a 32 bit value stored in network order, and p= 9. The coding
6535 * of the field is specified below:
6536 * - Most significant 20 bits are the binary encoded value of (MCC * 1000 + MNC).
6537 * - Least significant 12 bits is a 12 bit integer assigned by an operator to an MME, SGW or PGW. Other values of
6538 * Node-ID Type are reserved.
6540 proto_tree_add_item(tree, hf_gtpv2_fq_csid_node_id, tvb, offset, 4, ENC_BIG_ENDIAN);
6541 proto_tree_add_item(tree, hf_gtpv2_fq_csid_mcc_mnc, tvb, offset, 4, ENC_BIG_ENDIAN);
6542 offset += 4;
6543 break;
6544 default:
6545 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_fq_csid_type_bad, tvb, offset-1, 1,
6546 "Wrong Node-ID Type %u, should be 0-2(Or this is a newer spec)", node_id_type);
6547 return;
6550 /* First PDN Connection Set Identifier (CSID)
6551 * Second PDN Connection Set Identifier (CSID)
6553 * m-th PDN Connection Set Identifier (CSID)
6555 while ( csids-- ) {
6556 proto_tree_add_item(tree, hf_gtpv2_fq_csid_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6557 offset += 2;
6563 * 8.63 Channel needed
6565 static void
6566 dissect_gtpv2_channel_needed(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6568 /* The Channel needed shall be coded as depicted in Figure 8.63-1. Channel needed is coded as the IEI part and the value
6569 * part of the Channel Needed IE defined in 3GPP TS 44.018[28]
6571 de_rr_chnl_needed(tvb, tree, pinfo, 0, length, NULL, 0);
6575 * 8.64 eMLPP Priority
6576 * The eMLPP-Priority shall be coded as depicted in Figure 8.64-1. The eMLPP Priority is coded as the value part of the
6577 * eMLPP-Priority IE defined in 3GPP TS 48.008 [29] (not including 3GPP TS 48.008 IEI and 3GPP TS 48.008 [29]
6578 * length indicator).
6580 static void
6581 dissect_gtpv2_emlpp_pri(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6583 be_emlpp_prio(tvb, tree, pinfo, 0, length, NULL, 0);
6588 * 8.65 Node Type
6590 static const value_string gtpv2_node_type_vals[] = {
6591 {0, "MME"},
6592 {1, "SGSN"},
6593 {0, NULL}
6596 static void
6597 dissect_gtpv2_node_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6599 uint8_t node_type;
6601 proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, ENC_BIG_ENDIAN);
6602 /* Append Node Type to tree */
6603 node_type = tvb_get_uint8(tvb, 0);
6604 proto_item_append_text(item, "%s", val_to_str_const(node_type, gtpv2_node_type_vals, "Unknown"));
6609 * 8.66 Fully Qualified Domain Name (FQDN)
6611 static int
6612 decode_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, int offset, uint16_t length)
6614 int name_len;
6615 const uint8_t *fqdn = NULL;
6617 /* The FQDN field encoding shall be identical to the encoding of
6618 * a FQDN within a DNS message of section 3.1 of IETF
6619 * RFC 1035 [31] but excluding the trailing zero byte.
6621 * XXX: is compression possible?
6623 if (offset < length) {
6624 name_len = tvb_get_uint8(tvb, offset);
6626 /* "NOTE 1: The FQDN field in the IE is not encoded as a dotted string"
6627 * but if the first byte is large (in the letter range or higher),
6628 * assume that it is so encoded incorrectly.
6630 if (name_len < 0x40) {
6631 proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_APN_STR, pinfo->pool, &fqdn);
6632 } else {
6633 proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_ASCII, pinfo->pool, &fqdn);
6635 proto_item_append_text(item, "%s", fqdn);
6638 return length; //TODO return length of fqdn
6641 static void
6642 dissect_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6644 int offset = 0;
6645 decode_gtpv2_fqdn(tvb, pinfo, tree, item, offset, length);
6649 * 8.67 Private Extension
6651 static void
6652 dissect_gtpv2_private_ext(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance, session_args_t * args _U_)
6654 int offset = 0;
6655 tvbuff_t *next_tvb;
6656 uint16_t ext_id;
6657 gtpv2_priv_ext_info_t gtpv2_inf;
6659 gtpv2_inf.instance = instance;
6660 gtpv2_inf.item = item;
6662 /* oct 5 -7 Enterprise ID */
6663 ext_id = tvb_get_ntohs(tvb, offset);
6664 proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6665 offset += 2;
6667 proto_item_append_text(item, "%s (%u)", enterprises_lookup(ext_id, "Unknown"), ext_id);
6669 next_tvb = tvb_new_subset_length(tvb, offset, length-2);
6670 if (dissector_try_uint_with_data(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, false, &gtpv2_inf)){
6671 return;
6674 proto_tree_add_item(tree, hf_gtpv2_proprietary_value, tvb, offset, length-2, ENC_NA);
6678 * 8.68 Transaction Identifier (TI)
6680 static void
6681 dissect_gtpv2_ti(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6683 /* 5 to (n+4) Transaction Identifier */
6684 proto_tree_add_item(tree, hf_gtpv2_ti, tvb, 0, length, ENC_NA);
6689 * 8.69 MBMS Session Duration
6691 void
6692 dissect_gtpv2_mbms_session_duration(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6694 int offset = 0;
6695 int bit_offset = 0;
6696 uint32_t days;
6697 uint32_t hours;
6698 uint32_t minutes;
6699 uint32_t seconds;
6700 uint32_t durations_seconds;
6701 proto_item *day_item, *sec_item;
6703 /* From 3GPP TS 29.061 17.7.7 MBMS-Session-Duration AVP */
6704 /* Bits: ssss ssss ssss ssss sddd dddd where s bits = seconds, d bits = days */
6705 durations_seconds = tvb_get_bits32(tvb, bit_offset, 17, ENC_BIG_ENDIAN);
6706 bit_offset += 17;
6708 days = tvb_get_bits32(tvb, bit_offset, 7, ENC_BIG_ENDIAN);
6710 /* 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. */
6711 if ((durations_seconds == 0) && (days == 0)) {
6712 day_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6713 sec_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
6714 proto_item_append_text(item, "Indefinite (always-on)");
6715 } else {
6716 hours = durations_seconds / 3600;
6717 minutes = (durations_seconds % 3600) / 60;
6718 seconds = (durations_seconds % 3600) % 60;
6720 day_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6721 sec_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
6722 proto_item_append_text(item, "%d days %02d:%02d:%02d (DD days HH:MM:SS)", days, hours, minutes, seconds);
6725 /* Maximum allowed value for days: 18.
6726 * Maximum allowed value for seconds: 86,400 */
6727 if (days > 18) {
6728 expert_add_info(pinfo, day_item, &ei_gtpv2_mbms_session_duration_days);
6730 if (durations_seconds > 86400) {
6731 expert_add_info(pinfo, sec_item, &ei_gtpv2_mbms_session_duration_secs);
6734 offset += 3;
6735 if (length > 3)
6736 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-3, ENC_NA);
6740 * 8.70 MBMS Service Area
6742 void
6743 dissect_gtpv2_mbms_service_area(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6745 int offset = 0;
6746 proto_item *sai_item;
6747 uint8_t binary_nr;
6748 uint16_t real_nr;
6749 uint16_t sai;
6751 binary_nr = tvb_get_uint8(tvb, offset);
6752 real_nr = (uint16_t)binary_nr + 1;
6754 /* 3GPP TS 29.061 17.7.6 MBMS-Service-Area AVP */
6755 proto_tree_add_uint(tree, hf_gtpv2_mbms_service_area_nr, tvb, offset, 1, real_nr);
6756 offset += 1;
6758 /* A consecutive list of MBMS Service Area Identities follow, each with a length of two octets. */
6759 while (offset < length) {
6760 /* 3GPP TS 23.003 15.3 Structure of MBMS SAI */
6761 sai = tvb_get_ntohs(tvb, offset);
6762 sai_item = proto_tree_add_item(tree, hf_gtpv2_mbms_service_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6763 /* The value 0 denotes the whole of PLMN as the MBMS Service Area */
6764 if (sai == 0) {
6765 proto_item_append_text(sai_item, " Entire PLMN");
6767 proto_item_append_text(item, " %u", sai);
6768 offset += 2;
6773 * 8.71 MBMS Session Identifier
6775 static void
6776 dissect_gtpv2_mbms_session_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, _U_ uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6778 int offset = 0;
6779 /* One octet OctetString. */
6780 proto_tree_add_item(tree, hf_gtpv2_mbms_session_id, tvb, offset, 1, ENC_NA);
6782 offset += 1;
6783 if (length > 1)
6784 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
6788 * 8.72 MBMS Flow Identifier
6790 static void
6791 dissect_gtpv2_mbms_flow_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6793 int offset = 0;
6794 /* Two octets OctetString. */
6795 proto_tree_add_item(tree, hf_gtpv2_mbms_flow_id, tvb, offset, 2, ENC_NA);
6796 proto_item_append_text(item, " %s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 2));
6798 offset += 2;
6799 if (length > 2)
6800 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-2, ENC_NA);
6804 * 8.73 MBMS IP Multicast Distribution
6806 static const value_string gtpv2_mbms_hc_indicator_vals[] = {
6807 {0, "Uncompressed header"},
6808 {1, "Compressed header"},
6809 {0, NULL}
6812 static void
6813 dissect_gtpv2_mbms_ip_mc_dist(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6815 int offset = 0;
6817 proto_tree_add_item(tree, hf_gtpv2_cteid, tvb, offset, 4, ENC_BIG_ENDIAN);
6818 offset += 4;
6820 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6821 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
6822 /* IP Multicast Distribution Address */
6823 if ((tvb_get_uint8(tvb, offset) & 0x3f) == 4) {
6824 offset += 1;
6825 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
6826 proto_item_append_text(item, " IPv4 Dist %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
6827 offset += 4;
6828 } else if ((tvb_get_uint8(tvb, offset) & 0x3f) == 16) {
6829 offset += 1;
6830 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv6, tvb, offset, 16, ENC_NA);
6831 proto_item_append_text(item, " IPv6 Dist %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
6832 offset += 16;
6835 proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6836 proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
6837 /* IP Multicast Source Address */
6838 if ((tvb_get_uint8(tvb, offset) & 0x3f) == 4) {
6839 offset += 1;
6840 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
6841 proto_item_append_text(item, " IPv4 Src %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
6842 offset += 4;
6843 } else if ((tvb_get_uint8(tvb, offset) & 0x3f) == 16) {
6844 offset += 1;
6845 proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv6, tvb, offset, 16, ENC_NA);
6846 proto_item_append_text(item, " IPv6 Src %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
6847 offset += 16;
6850 proto_tree_add_item(tree, hf_gtpv2_mbms_hc_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
6852 offset += 1;
6853 if (length > offset)
6854 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
6859 * 8.74 MBMS Distribution Acknowledge
6861 static const value_string gtpv2_mbms_dist_indication_vals[] = {
6862 {0, "No RNCs have accepted IP multicast distribution"},
6863 {1, "All RNCs have accepted IP multicast distribution"},
6864 {2, "Some RNCs have accepted IP multicast distribution"},
6865 {3, "Spare. For future use."},
6866 {0, NULL}
6869 static void
6870 dissect_gtpv2_mbms_dist_ack(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6872 int offset = 0;
6874 proto_tree_add_item(tree, hf_gtpv2_mbms_dist_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
6876 offset += 1;
6877 if (length > 1)
6878 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
6882 * 8.75 User CSG Information (UCI)
6884 static const value_string gtpv2_uci_csg_membership_status[] = {
6885 {0, "Non CSG membership"},
6886 {1, "CSG membership"},
6887 {0, NULL }
6890 static const value_string gtpv2_uci_access_mode[] = {
6891 {0, "Closed Mode"},
6892 {1, "Hybrid Mode"},
6893 {2, "Reserved" },
6894 {3, "Reserved"},
6895 {0, NULL }
6898 static const value_string gtpv2_uci_leave_csg[] = {
6899 {0, "Access CSG cell/Hybrid cell"},
6900 {1, "Leaves CSG cell/Hybrid cell"},
6901 {0, NULL }
6904 static void
6905 dissect_gtpv2_uci(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6907 int offset = 0;
6909 /* Value of MCC & MNC */
6910 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
6911 offset += 3;
6912 /* Value of CSG ID */
6913 proto_tree_add_item(tree, hf_gtpv2_uci_csg_id_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
6914 proto_tree_add_item(tree, hf_gtpv2_uci_csg_id, tvb, offset, 4, ENC_BIG_ENDIAN);
6915 offset += 4;
6917 /* Value of access mode */
6918 proto_tree_add_item(tree, hf_gtpv2_uci_access_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
6920 /* Value of LCSG */
6921 proto_tree_add_item(tree, hf_gtpv2_uci_lcsg, tvb, offset, 1, ENC_BIG_ENDIAN);
6923 /* Value of CSG membership */
6924 proto_tree_add_item(tree, hf_gtpv2_uci_csg_membership, tvb, offset, 1, ENC_BIG_ENDIAN);
6928 /* 8.76 CSG Information Reporting Action */
6929 static void
6930 dissect_gtpv2_csg_info_rep_action(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6932 int offset = 0;
6934 static int * const flags[] = {
6935 &hf_gtpv2_csg_info_rep_action_b2,
6936 &hf_gtpv2_csg_info_rep_action_b1,
6937 &hf_gtpv2_csg_info_rep_action_b0,
6938 NULL
6940 if (length == 0) {
6941 expert_add_info(pinfo, item, &ei_gtpv2_ie_len_invalid);
6942 return;
6944 /* Spare UCIUHC UCISHC UCICSG */
6946 proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN);
6950 /* 8.77 RFSP Index */
6951 static void
6952 dissect_gtpv2_rfsp_index(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6954 int offset = 0;
6956 if(instance == 0){
6957 proto_tree_add_item(tree, hf_gtpv2_subscriber_rfsp, tvb, offset, 2, ENC_BIG_ENDIAN);
6958 }else if(instance == 1){
6959 proto_tree_add_item(tree, hf_gtpv2_rfsp_inuse, tvb, offset, 2, ENC_BIG_ENDIAN);
6963 /* 8.78 CSG ID */
6964 static void
6965 dissect_gtpv2_csg_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6967 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, 0, 5, ENC_BIG_ENDIAN);
6968 proto_tree_add_item(tree, hf_gtpv2_csg_id, tvb, 0, 4, ENC_BIG_ENDIAN);
6969 if (length > 1) {
6970 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, 1, length-1, ENC_NA);
6974 /* 8.79 CSG Membership Indication (CMI) */
6975 static void
6976 dissect_gtpv2_cmi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6978 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, 0, 7, ENC_BIG_ENDIAN);
6979 proto_tree_add_item(tree, hf_gtpv2_cmi, tvb, 0, 1, ENC_BIG_ENDIAN);
6980 if (length > 1) {
6981 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, 1, length-1, ENC_NA);
6985 /* 8.80 Service indicator */
6986 static const value_string gtpv2_service_indicator_vals[] = {
6987 { 1, "CS call indicator" },
6988 { 2, "SMS indicator" },
6989 { 0, NULL }
6992 static void
6993 dissect_gtpv2_service_indicator(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
6995 proto_tree_add_item(tree, hf_gtpv2_service_indicator, tvb, 0, 1, ENC_BIG_ENDIAN);
6998 /* 8.81 Detach Type */
6999 static const value_string gtpv2_detach_type_vals[] = {
7000 { 1, "PS Detach" },
7001 { 2, "Combined PS/CS Detach" },
7002 { 0, NULL }
7005 static void
7006 dissect_gtpv2_detach_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7008 proto_tree_add_item(tree, hf_gtpv2_detach_type, tvb, 0, 1, ENC_BIG_ENDIAN);
7011 /* 8.82 Local Distinguished Name (LDN) */
7012 static void
7013 dissect_gtpv2_ldn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7015 proto_tree_add_item(tree, hf_gtpv2_ldn, tvb, 0, length, ENC_ASCII);
7018 /* 8.83 Node Features */
7019 static void
7020 dissect_gtpv2_node_features(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7022 int offset = 0;
7023 static int * const features[] = {
7024 &hf_gtpv2_node_features_psset,
7025 &hf_gtpv2_node_features_mtedt,
7026 &hf_gtpv2_node_features_eth,
7027 &hf_gtpv2_node_features_s1un,
7028 &hf_gtpv2_node_features_ciot,
7029 &hf_gtpv2_node_features_ntsr,
7030 &hf_gtpv2_node_features_mabr,
7031 &hf_gtpv2_node_features_prn,
7032 NULL
7035 proto_tree_add_bitmask_list(tree, tvb, offset, 1, features, ENC_BIG_ENDIAN);
7036 offset++;
7037 if (length > offset)
7038 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7041 /* 8.84
7042 * MBMS Time to Data Transfer
7044 void
7045 dissect_gtpv2_mbms_time_to_data_xfer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7047 int offset = 0;
7048 uint8_t binary_secs;
7049 uint16_t real_secs;
7051 binary_secs = tvb_get_uint8(tvb, offset);
7052 real_secs = (uint16_t)binary_secs + 1;
7054 proto_tree_add_string_format_value(tree, hf_gtpv2_time_to_data_xfer, tvb, offset, 1, "", "%d second(s)", real_secs);
7055 proto_item_append_text(item, " %u second(s)", real_secs);
7056 offset += 1;
7057 if (length > 1)
7058 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7061 static const value_string gtpv2_throttling_delay_unit_vals[] = {
7062 { 0, "value is incremented in multiples of 2 seconds" },
7063 { 1, "value is incremented in multiples of 1 minute" },
7064 { 2, "value is incremented in multiples of 10 minutes" },
7065 { 3, "value is incremented in multiples of 1 hour" },
7066 { 4, "value is incremented in multiples of 10 hour" },
7067 { 7, "value indicates that the timer is deactivated" },
7068 { 0, NULL }
7071 /* 8.85 Throttling */
7072 static void
7073 dissect_gtpv2_throttling(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7075 int offset = 0;
7076 uint8_t oct;
7078 proto_tree_add_item(tree, hf_gtpv2_throttling_delay_unit, tvb, offset, 1, ENC_BIG_ENDIAN);
7079 proto_tree_add_item(tree, hf_gtpv2_throttling_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
7080 offset++;
7082 oct = tvb_get_uint8(tvb, offset);
7083 proto_tree_add_item(tree, hf_gtpv2_throttling_factor, tvb, offset, 1, ENC_BIG_ENDIAN);
7084 if (oct > 0x64)
7085 proto_item_append_text(item, "Throttling factor: value beyond (0,100) is considered as 0");
7086 offset++;
7088 if (length > 2)
7089 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length - 2, ENC_NA);
7094 /* 8.86 Allocation/Retention Priority (ARP) */
7095 void
7096 dissect_gtpv2_arp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7098 int offset = 0;
7100 proto_tree_add_item(tree, hf_gtpv2_arp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
7101 proto_tree_add_item(tree, hf_gtpv2_arp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
7102 proto_tree_add_item(tree, hf_gtpv2_arp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
7104 offset += 1;
7105 if (length > 1)
7106 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7109 /* 8.87 EPC Timer */
7110 static const value_string gtpv2_timer_unit_vals[] = {
7111 {0, "value is incremented in multiples of 2 seconds"},
7112 {1, "value is incremented in multiples of 1 minute"},
7113 {2, "value is incremented in multiples of 10 minutes"},
7114 {3, "value is incremented in multiples of 1 hour"},
7115 {4, "value is incremented in multiples of 10 hour"},
7116 {5, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
7117 {6, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
7118 {7, "value indicates that the timer is infinite"},
7119 {0, NULL}
7122 void
7123 dissect_gtpv2_epc_timer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length _U_, uint8_t message_type, uint8_t instance _U_, session_args_t * args _U_)
7125 switch (message_type) {
7126 case GTPV2_DL_DATA_NOTIF_ACK:
7127 proto_item_append_text(item, "DL Buffering Duration");
7128 break;
7130 /* XXX Todo: use code from packet-gsm_a_gm.c ? 10.5.7.4a GPRS TIMER 3*/
7131 proto_tree_add_item(tree, hf_gtpv2_timer_unit, tvb, 0, 1, ENC_BIG_ENDIAN);
7132 proto_tree_add_item(tree, hf_gtpv2_timer_value, tvb, 0, 1, ENC_BIG_ENDIAN);
7136 /* 8.88 Signalling Priority Indication */
7137 static void
7138 dissect_gtpv2_sig_prio_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7140 proto_tree_add_item(tree, hf_gtpv2_lapi, tvb, 0, 1, ENC_BIG_ENDIAN);
7143 /* 8.89 Temporary Mobile Group Identity (TMGI) */
7144 static void
7145 dissect_gtpv2_tmgi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7147 int offset = 0;
7148 uint64_t tmgi;
7150 tmgi = tvb_get_ntoh48(tvb, offset);
7152 proto_item_append_text(item, "%012" PRIx64, tmgi);
7154 proto_tree_add_item(tree, hf_gtpv2_mbms_service_id, tvb, offset, 3, ENC_NA);
7155 offset += 3;
7157 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_NONE, true);
7158 offset += 3;
7160 if (length > offset)
7161 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7165 * 8.90 Additional MM context for SRVCC
7166 * 3GPP TS 29.274 Figure 8.90-1
7168 static void
7169 dissect_gtpv2_add_mm_cont_for_srvcc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7171 int offset = 0;
7172 proto_item *ms_cm_item;
7173 proto_tree *ms_cm_tree;
7174 uint8_t elm_len;
7176 /* Length of Mobile Station Classmark 2 */
7177 elm_len = tvb_get_uint8(tvb, offset);
7178 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
7179 offset += 1;
7181 /* For each of the Mobile Station Classmark 2, Mobile Station Classmark 3 and Supported Codec List parameters,
7182 * if they are not available, then the associated length field shall be set to zero, and the particular
7183 * parameter field shall not be present.
7185 if(elm_len > 0){
7186 ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
7187 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
7188 /* Mobile Station Classmark 2 */
7189 de_ms_cm_2(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
7190 offset += elm_len;
7193 /* Length of Mobile Station Classmark 3 */
7194 elm_len = tvb_get_uint8(tvb, offset);
7195 proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
7196 offset += 1;
7197 if (elm_len > 0) {
7198 ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
7199 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
7200 /* Mobile Station Classmark 3 */
7201 de_ms_cm_3(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
7202 offset += elm_len;
7205 /* Length of Supported Codec List */
7206 elm_len = tvb_get_uint8(tvb, offset);
7207 proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
7208 offset += 1;
7209 if (elm_len > 0) {
7210 ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
7211 ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_supp_codec_list);
7212 /* Supported Codec List */
7213 de_sup_codec_list(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
7214 offset += elm_len;
7217 if (length > offset)
7218 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7221 /* 8.91 Additional flags for SRVCC */
7222 static void
7223 dissect_gtpv2_add_flags_for_srvcc(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7225 int offset = 0;
7227 proto_tree_add_item(tree, hf_gtpv2_add_flags_for_srvcc_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
7228 proto_tree_add_item(tree, hf_gtpv2_vsrvcc_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
7229 offset += 1;
7231 if (length > 1)
7232 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7235 /* 8.92 Max MBR/APN-AMBR (MMBR) */
7236 static void
7237 dissect_gtpv2_mmbr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7239 int offset = 0;
7240 uint32_t max_ul;
7241 uint32_t max_dl;
7243 max_ul = tvb_get_ntohl(tvb, offset);
7244 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "%u %s",
7245 (max_ul) > 1000 ? max_ul/1000 : max_ul,
7246 (max_ul) > 1000 ? "Mbps" : "kbps");
7248 offset += 4;
7250 max_dl = tvb_get_ntohl(tvb, offset);
7251 proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "%u %s",
7252 (max_dl) > 1000 ? max_dl/1000 : max_dl,
7253 (max_dl) > 1000 ? "Mbps" : "kbps");
7256 /* 8.93 MDT Configuration */
7257 static void
7258 dissect_gtpv2_mdt_config(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7260 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7263 /* 8.94 Additional Protocol Configuration Options (APCO) */
7264 static void
7265 dissect_gtpv2_apco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7267 switch (message_type) {
7268 case GTPV2_CREATE_SESSION_REQUEST:
7269 case GTPV2_DELETE_SESSION_REQUEST:
7270 case GTPV2_BEARER_RESOURCE_COMMAND:
7271 case GTPV2_CREATE_BEARER_RESPONSE:
7272 case GTPV2_UPDATE_BEARER_RESPONSE:
7273 case GTPV2_DELETE_BEARER_RESPONSE:
7274 /* PCO options as MS to network direction */
7275 pinfo->link_dir = P2P_DIR_UL;
7276 break;
7277 case GTPV2_CREATE_SESSION_RESPONSE:
7278 case GTPV2_MODIFY_BEARER_RESPONSE:
7279 case GTPV2_DELETE_SESSION_RESPONSE:
7280 case GTPV2_CREATE_BEARER_REQUEST:
7281 case GTPV2_UPDATE_BEARER_REQUEST:
7282 case GTPV2_DELETE_BEARER_REQUEST:
7283 /* PCO options as Network to MS direction: */
7284 pinfo->link_dir = P2P_DIR_DL;
7285 break;
7286 default:
7287 break;
7289 de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
7292 /* 8.95 Absolute Time of MBMS Data Transfer */
7293 static void
7294 dissect_gtpv2_abs_mbms_data_tf_time(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7296 int offset = 0;
7297 char *time_str;
7299 proto_tree_add_item_ret_time_string(tree, hf_gtpv2_abs_time_mbms_data, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str);
7300 proto_item_append_text(item, "%s", time_str);
7302 offset += 8;
7303 if (length > offset)
7304 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7307 /* 8.96 H(e)NB Information Reporting */
7308 static const true_false_string gtpv2_henb_info_report_fti_vals = {
7309 "Start reporting H(e)NB local IP address and UDP port number information change",
7310 "Stop reporting H(e)NB local IP address and UDP port number information change",
7313 static void
7314 dissect_gtpv2_henb_info_report(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7316 int offset = 0;
7318 proto_tree_add_item(tree, hf_gtpv2_henb_info_report_fti, tvb, offset, 1, ENC_BIG_ENDIAN);
7319 offset += 1;
7321 if (length > 1)
7322 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7325 /* 8.97 IPv4 Configuration Parameters (IP4CP) */
7326 static void
7327 dissect_gtpv2_ip4cp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7329 int offset = 0;
7331 proto_tree_add_item(tree, hf_gtpv2_ip4cp_subnet_prefix_len, tvb, offset, 1, ENC_BIG_ENDIAN);
7332 offset += 1;
7333 proto_tree_add_item(tree, hf_gtpv2_ip4cp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
7334 offset += 4;
7336 if (length > offset)
7337 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7340 /* 8.98 Change to Report Flags */
7341 static void
7342 dissect_gtpv2_change_report_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7344 int offset = 0;
7346 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_sncr, tvb, offset, 1, ENC_BIG_ENDIAN);
7347 proto_tree_add_item(tree, hf_gtpv2_change_report_flags_tzcr, tvb, offset, 1, ENC_BIG_ENDIAN);
7348 offset += 1;
7350 if (length > 1)
7351 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7354 /* 8.99 Action Indication */
7355 static const value_string gtpv2_action_indication_vals[] = {
7356 { 0, "No Action"},
7357 { 1, "Deactivation Indication"},
7358 { 2, "Paging Indication"},
7359 { 3, "Spare"},
7360 { 4, "Spare"},
7361 { 5, "Spare"},
7362 { 6, "Spare"},
7363 { 7, "Spare"},
7364 { 0, NULL}
7366 static value_string_ext gtpv2_action_indication_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_action_indication_vals);
7368 static void
7369 dissect_gtpv2_action_indication(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7371 int offset = 0;
7373 proto_tree_add_item(tree, hf_gtpv2_action_indication_val, tvb, offset, 1, ENC_BIG_ENDIAN);
7374 offset += 1;
7376 if (length > 1)
7377 proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7381 * 8.100 TWAN Identifier
7383 static const value_string gtpv2_twan_relay_id_type_vals[] = {
7384 { 0, "IPv4 or IPv6 Address" },
7385 { 1, "FQDN" },
7386 { 0, NULL }
7389 void
7390 dissect_gtpv2_twan_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7392 int offset = 0;
7393 uint8_t flags=0;
7394 uint32_t ssid_len, civa_len, op_name_len, relay_id_type, relay_id_len, circuit_id_id_len;
7395 static int* const twan_id_flags[] = {
7396 &hf_gtpv2_twan_laii,
7397 &hf_gtpv2_twan_opnai,
7398 &hf_gtpv2_twan_plmni,
7399 &hf_gtpv2_twan_civai,
7400 &hf_gtpv2_twan_bssidi,
7401 NULL
7404 /* Octet 5 Spare LAII OPNAI PLMNI CIVAI BSSIDI */
7405 flags = tvb_get_uint8(tvb, offset);
7406 proto_tree_add_bitmask(tree, tvb, offset, hf_gtpv2_twan_flags, ett_gtpv2_twan_flags, twan_id_flags, ENC_BIG_ENDIAN);
7407 offset++;
7408 /* Octet 6 SSID Length */
7409 proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_ssid_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ssid_len);
7410 offset += 1;
7411 /* 7 to k SSID */
7412 proto_tree_add_item(tree, hf_gtpv2_twan_ssid, tvb, offset, ssid_len, ENC_NA);
7413 offset += ssid_len;
7414 /* (k+1) to (k+6) BSSID The BSSIDI flag in octet 5 indicates whether the BSSID in octets 'k+1' to 'k+6' shall be present.*/
7415 if (flags & 0x01) {
7416 proto_tree_add_item(tree, hf_gtpv2_twan_bssid, tvb, offset, 6, ENC_NA);
7417 offset += 6;
7419 /* q Civic Address Length The CIVAI flag in octet 5 indicates whether the Civic Address Length
7420 * and Civic Address Information in octets 'q' and 'q+1' to 'q+r' shall be present.
7422 if (flags & 0x02) {
7423 proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_civa_len, tvb, offset, 1, ENC_BIG_ENDIAN, &civa_len);
7424 offset += 1;
7425 /* (q+1) to (q+r) Civic Address Information
7426 * ...it shall be encoded as defined in subclause 3.1 of IETF RFC 4776 [59] excluding the first 3 octets.
7427 * RFC 4776:
7428 * 3.1. Overall Format for DHCPv4
7430 * 0 1 2 3
7431 * 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
7432 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7433 * | GEOCONF_CIVIC | N | what | country |
7434 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7435 * | code | civic address elements ...
7436 * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7438 proto_tree_add_item(tree, hf_gtpv2_twan_civa, tvb, offset, civa_len, ENC_NA);
7439 offset += civa_len;
7441 /* s to (s+3) TWAN PLMN-ID The PLMNI flag in octet 5 indicates whether the TWAN PLMN-ID
7442 * in octets 's' to 's+3' shall be present
7444 if (flags & 0x04) {
7445 proto_tree_add_item(tree, hf_gtpv2_twan_plmnid, tvb, offset, 3, ENC_NA);
7446 offset += 3;
7447 /* (q+1) to (q+r) Civic Address Information
7448 * ...it shall be encoded as defined in subclause 3.1 of IETF RFC 4776 [59] excluding the first 3 octets.
7451 /* t TWAN Operator Name Length, The OPNAI flag in octet 5 indicates whether the TWAN Operator Name Length and
7452 * TWAN Operator Name in octets 't' and 't+1' to 't+u' shall be present.
7454 if (flags & 0x08) {
7455 proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_op_name_len, tvb, offset, 1, ENC_BIG_ENDIAN, &op_name_len);
7456 offset += 1;
7457 /* (t+1) to (t+u) TWAN Operator Name. The TWAN Operator Name shall be encoded as specified in subclause 19. 8 of 3GPP TS 23.003 */
7458 proto_tree_add_item(tree, hf_gtpv2_twan_op_name, tvb, offset, op_name_len, ENC_NA);
7459 offset += op_name_len;
7461 /* The LAII flag in octet 5 indicates whether the Logical Access ID information is present in the TWAN Identifier */
7462 if (flags & 0x10) {
7463 /* v Relay Identity Type */
7464 proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_relay_id_type, tvb, offset, 1, ENC_BIG_ENDIAN, &relay_id_type);
7465 offset += 1;
7466 /* (v+1) Relay Identity Length*/
7467 proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_relay_id_len, tvb, offset, 1, ENC_BIG_ENDIAN, &relay_id_len);
7468 offset += 1;
7469 /* (v+2) to (v+w) Relay Identity */
7470 switch (relay_id_type) {
7471 case 0:
7472 /* IPv4 or IPv6 Address */
7473 if (relay_id_len == 4) {
7474 /* IPv4 */
7475 proto_tree_add_item(tree, hf_gtpv2_twan_relay_id_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
7476 offset += 4;
7477 } else {
7478 proto_tree_add_item(tree, hf_gtpv2_twan_relay_id_ipv6, tvb, offset, 16, ENC_NA);
7479 offset += 16;
7481 break;
7482 case 1:
7483 /* fall trough */
7484 proto_tree_add_item(tree, hf_gtpv2_twan_relay_id, tvb, offset, relay_id_len, ENC_ASCII);
7485 offset += relay_id_len;
7486 default:
7487 break;
7489 /* X Circuit-ID Length */
7490 proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_circuit_id_len, tvb, offset, 1, ENC_BIG_ENDIAN, &circuit_id_id_len);
7491 offset += 1;
7492 /* (x+1) to (x+y) Circuit-ID */
7493 proto_tree_add_item(tree, hf_gtpv2_twan_circuit_id, tvb, offset, circuit_id_id_len, ENC_NA);
7494 offset += circuit_id_id_len;
7497 if (offset < (int)length) {
7498 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
7503 * 8.101 ULI Timestamp
7505 static void
7506 dissect_gtpv2_uli_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7508 char *time_str;
7510 /* Octets 5 to 8 are encoded in the same format as the first four octets of the 64-bit timestamp
7511 * format as defined in section 6 of IETF RFC 5905
7514 proto_tree_add_item_ret_time_string(tree, hf_gtpv2_uli_timestamp, tvb, 0, 4, ENC_TIME_NTP|ENC_BIG_ENDIAN, pinfo->pool, &time_str);
7515 proto_item_append_text(item, "%s", time_str);
7519 * 8.102 MBMS Flags
7521 static void
7522 dissect_gtpv2_mbms_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7524 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7527 * 8.103 RAN/NAS Cause
7529 static const value_string ran_nas_prot_type_vals[] = {
7530 { 1, "S1AP Cause" },
7531 { 2, "EMM Cause" },
7532 { 3, "ESM Cause" },
7533 { 4, "Diameter Cause" },
7534 { 5, "IKEv2 Cause" },
7535 { 0, NULL },
7538 static void
7539 dissect_gtpv2_ran_nas_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7541 int offset = 0;
7542 uint8_t octet = tvb_get_uint8(tvb, offset);
7543 uint8_t proto_type = (octet >> 4);
7544 int cause_type = 0;
7546 proto_tree_add_item(tree, hf_gtpv2_ran_nas_protocol_type, tvb, offset, 1, ENC_BIG_ENDIAN);
7548 if (proto_type == 1) {
7549 proto_tree_add_item(tree, hf_gtpv2_ran_nas_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
7550 cause_type = octet & 0x0F;
7552 offset += 1;
7554 switch (proto_type) {
7555 case 1:
7556 dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
7557 break;
7558 case 2:
7559 proto_tree_add_item(tree, hf_gtpv2_emm_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
7560 break;
7561 case 3:
7562 proto_tree_add_item(tree, hf_gtpv2_esm_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
7563 break;
7564 case 4:
7565 proto_tree_add_item(tree, hf_gtpv2_diameter_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
7566 break;
7567 case 5:
7568 proto_tree_add_item(tree, hf_gtpv2_ikev2_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
7569 break;
7570 default:
7571 proto_tree_add_item(tree, hf_gtpv2_ran_nas_cause_value, tvb, offset, length - offset, ENC_BIG_ENDIAN);
7572 break;
7576 * 8.104 CN Operator Selection Entity
7578 static void
7579 dissect_gtpv2_cn_operator_selection_entity(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7581 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7584 * 8.105 Trusted WLAN Mode Indication
7586 static void
7587 dissect_gtpv2_trust_wlan_mode_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7589 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7592 * 8.106 Node Number
7594 static void
7595 dissect_gtpv2_node_number(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7597 int offset = 0;
7598 uint32_t len;
7599 tvbuff_t* new_tvb;
7601 /* Octet 5 Length of Node Number*/
7602 proto_tree_add_item_ret_uint(tree, hf_gtpv2_node_number_len, tvb, offset, 1, ENC_BIG_ENDIAN, &len);
7603 offset += 1;
7605 /* The Node number shall carry an ISDN number...
7606 * shall be coded according to the contents of ISDN-AddressString data type
7607 * defined in 3GPP TS 29.002
7609 new_tvb = tvb_new_subset_length(tvb, offset, len);
7610 dissect_gsm_map_msisdn(new_tvb, pinfo, tree);
7613 * 8.107 Node Identifier
7615 static void
7616 dissect_gtpv2_node_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7618 int offset = 0;
7619 uint32_t name_len;
7622 RFC 6733
7623 DiameterIdentity
7625 The DiameterIdentity format is derived from the OctetString Basic
7626 AVP Format....In this document, note that DiameterIdentity is
7627 in ASCII form.
7629 TS 29.274
7631 If the Node Identifier contains a SGSN Identifier then:
7632 - the Node Name shall be coded as the Diameter identity of the SGSN as defined in subclause 6.4.13 of 3GPP TS 29.173 [57] and;
7633 - the Node Realm shall be coded as the Diameter realm identity of the SGSN and as defined in subclause 6.4.14 of 3GPP TS 29.173 [57] and;
7634 - Both the Node Name and the Node Realm shall be present and neither the Length of Node Name nor the Length of Node Realm shall be zero.
7635 6.4.13 SGSN-Name
7636 The SGSN-Name AVP is of type DiameterIdentity...see IETF RFC 6733
7637 6.4.14 SGSN-Realm
7638 The SGSN-Realm AVP is of type DiameterIdentity...see IETF RFC 6733
7640 If the Node Identifier contains a MME Identifier then:
7641 - the Node Name shall be coded as the Diameter identity of the MME as defined in subclause 6.4.4 of 3GPP TS 29.173 [57] and;
7642 - the Node Realm shall be coded as the Diameter realm identity of the MME as defined in subclause 6.4.12 of 3GPP TS 29.173 [57] and;
7643 - Both the Node Name and the Node Realm shall be present and neither the Length of Node Name nor the Length of Node Realm shall be zero.
7644 6.4.4 MME-Name
7645 The MME-Name AVP is of type DiameterIdentity...see IETF RFC 6733
7646 6.4.12 MME-Realm
7647 The MME-Realm AVP is of type DiameterIdentity...see IETF RFC 6733
7649 If the Node Identifer contains a 3GPP AAA Server Identifier then:
7650 - the Node Name shall be coded as the 3GPP-AAA-Server-Name as defined in subclause 8.2.3.24 of 3GPP TS 29.273 [68] and;
7651 8.2.3.24 3GPP-AAA-Server-Name
7652 The 3GPP-AAA-Server-Name AVP is of type DiameterIdentity
7653 - the Node Realm shall be coded as the Diameter realm of the 3GPP AAA server in the format of a Diameter identity as defined in IETF RFC 3588 [39].
7655 If the Node Identifier contains an SCEF/IWK-SCEF information, then:
7656 - the Node Name shall be coded as the SCEF-ID as defined in subclause 8.4.5 of 3GPP TS 29.336 [69] and;
7657 8.4.5 SCEF-ID
7658 The SCEF- ID AVP is of type DiameterIdentity
7659 - the Node Realm shall be coded as the Diameter realm of the SCEF as defined in subclause 7.3.207 of 3GPP TS 29.272 [70].
7662 /* Octet 5 Length of Node Name */
7663 proto_tree_add_item_ret_uint(tree, hf_gtpv2_length_of_node_name, tvb, offset, 1, ENC_BIG_ENDIAN, &name_len);
7664 offset++;
7665 /* Node Name */
7666 proto_tree_add_item(tree, hf_gtpv2_node_name, tvb, offset, name_len, ENC_UTF_8 | ENC_NA);
7667 offset = offset + name_len;
7668 /* Length of Node Realm */
7669 proto_tree_add_item_ret_uint(tree, hf_gtpv2_length_of_node_realm, tvb, offset, 1, ENC_BIG_ENDIAN, &name_len);
7670 offset++;
7671 /* Node Realm */
7672 proto_tree_add_item(tree, hf_gtpv2_node_realm, tvb, offset, name_len, ENC_UTF_8 | ENC_NA);
7673 offset = offset + name_len;
7674 if(offset < length){
7675 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length- offset);
7679 * 8.108 Presence Reporting Area Action
7683 * The Presence-Reporting-Area-Elements-List AVP (AVP code 2820)
7684 * is of type Octetstring and is coded as specified in 3GPP TS 29.274 [22]
7685 * in Presence Reporting Area Action IE, starting from octet 9.
7688 static int
7689 dissect_diameter_3gpp_presence_reporting_area_elements_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
7691 /*diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;*/
7692 proto_tree *sub_tree;
7693 proto_item *item;
7694 int offset = 0, i;
7695 unsigned length;
7696 uint32_t no_tai, no_rai, no_mENB, no_hENB, no_ECGI, no_sai, no_cgi, no_ext_mENB;
7697 char *append_str;
7698 length = tvb_reported_length(tvb);
7700 /* Octet 9 Number of TAI Number of RAI */
7701 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_tai, tvb, offset, 1, ENC_BIG_ENDIAN, &no_tai);
7702 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_rai, tvb, offset, 1, ENC_BIG_ENDIAN, &no_rai);
7703 offset++;
7704 /* Octet 10 Spare Number of Macro eNodeB */
7705 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_m_enodeb, tvb, offset, 1, ENC_BIG_ENDIAN, &no_mENB);
7706 offset++;
7707 /* Octet 11 Spare Number of Home eNodeB */
7708 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_h_enodeb, tvb, offset, 1, ENC_BIG_ENDIAN, &no_hENB);
7709 offset++;
7710 /* Octet 12 Spare Number of ECGI */
7711 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_ecgi, tvb, offset, 1, ENC_BIG_ENDIAN, &no_ECGI);
7712 offset++;
7713 /* Octet 13 Spare Number of SAI */
7714 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_sai, tvb, offset, 1, ENC_BIG_ENDIAN, &no_sai);
7715 offset++;
7716 /* Octet 14 Spare Number of CGI */
7717 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_cgi, tvb, offset, 1, ENC_BIG_ENDIAN, &no_cgi);
7718 offset++;
7719 /* Octet 15 to k TAIs [1..15] */
7720 i = 1;
7721 while (no_tai > 0){
7722 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 5, ett_gtpv2_preaa_tais, &item, "Tracking Area Identity (TAI) Number %u",i);
7723 append_str = dissect_gtpv2_tai(tvb, pinfo, sub_tree, &offset, false);
7724 proto_item_append_text(item, " %s",append_str);
7725 i++;
7726 no_tai--;
7728 /* Octet (k+1) to m Macro eNB IDs [1..63]
7729 * 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.
7730 * Octets 'k+1' to 'm' shall be absent if the field 'Number of Macro eNodeB' is set to the value '0'.
7732 i = 1;
7733 while (no_mENB > 0){
7734 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 6, ett_gtpv2_preaa_menbs, &item, "Macro eNB ID %u",i);
7735 append_str = dissect_gtpv2_macro_enodeb_id(tvb, pinfo, sub_tree, &offset);
7736 proto_item_append_text(item, " %s",append_str);
7737 i++;
7738 no_mENB--;
7740 /* Octet (m+1) to p Home eNB IDs [1..63]
7741 * 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.
7742 * Octets 'm+1' to 'p' shall be absent if the field 'Number of Home eNodeB' is set to the value '0'.
7744 i = 1;
7745 while (no_hENB > 0){
7746 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_henbs, &item, "Home eNB ID %u",i);
7747 append_str = dissect_gtpv2_home_enodeb_id(tvb, pinfo, sub_tree, &offset);
7748 proto_item_append_text(item, " %s",append_str);
7749 i++;
7750 no_hENB--;
7752 /* Octet (p+1) to q ECGIs [1..63]
7753 * ECGIs in octets 'p+1' to 'q', if any, shall be encoded as per the ECGI field in subclause 8.21.5.
7754 * Octets 'p+1' to 'q' shall be absent if the field 'Number of ECGI' is set to the value '0'.
7756 i = 1;
7757 while (no_ECGI > 0){
7758 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_ecgis, &item, "ECGI ID %u",i);
7759 append_str = dissect_gtpv2_ecgi(tvb, pinfo, sub_tree, &offset);
7760 proto_item_append_text(item, " %s",append_str);
7761 i++;
7762 no_ECGI--;
7764 /* Octet (q+1) to r RAIs [1..15]
7765 * RAIs in octets 'q+1' to 'r', if any, shall be encoded as per the RAI field in subclause 8.21.3.
7766 * Octets 'q+1' to 'r' shall be absent if the field 'Number of RAI' is set to the value '0'.
7768 i = 1;
7769 while (no_rai > 0){
7770 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_rais, &item, "RAI ID %u",i);
7771 append_str = dissect_gtpv2_rai(tvb, pinfo, sub_tree, &offset);
7772 proto_item_append_text(item, " %s",append_str);
7773 i++;
7774 no_rai--;
7776 /* Octet (r+1) to s SAIs [1..63]
7777 * SAIs in octets 'r+1' to 's', if any, shall be encoded as per the SAI field in subclause 8.21.2.
7778 * Octets 'r+1' to 's' shall be absent if the field 'Number of SAI' is set to the value '0'.
7780 i = 1;
7781 while (no_sai > 0){
7782 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_sais, &item, "SAI ID %u",i);
7783 append_str = dissect_gtpv2_sai_common(tvb, pinfo, sub_tree, &offset);
7784 proto_item_append_text(item, " %s",append_str);
7785 i++;
7786 no_sai--;
7788 /* Octet (s+1) to t CGIs [1..63]
7789 * CGIs in octets 's+1' to 't', if any, shall be encoded as per the CGI field in subclause 8.21.1.
7790 * Octets 's+1' to 't' shall be absent if the field 'Number of CGI' is set to the value '0'.
7792 i = 1;
7793 while (no_cgi > 0){
7794 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_cgis, &item, "CGI ID %u",i);
7795 append_str = dissect_gtpv2_cgi(tvb, pinfo, sub_tree, &offset);
7796 proto_item_append_text(item, " %s",append_str);
7797 i++;
7798 no_cgi--;
7800 if (offset >= (int) length)
7801 return length;
7802 /* Octet t+1 Spare Number of Extended Macro eNodeB */
7803 proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_ext_m_enodeb, tvb, offset, 1, ENC_BIG_ENDIAN, &no_ext_mENB);
7804 offset++;
7805 /* Octet (t+2) to v Extended Macro eNB IDs [1..63]
7806 * Extended Macro eNB IDs in octets 't+2' to 'v', if any, shall be encoded as per octets 6 to 11 of the Target ID for type Extended Macro eNodeB in figure 8.51-5.
7807 * Octets 'k+1' to 'm' shall be absent if the field 'Number of Extended Macro eNodeB' is set to the value '0'.
7809 i = 1;
7810 while (no_ext_mENB > 0){
7811 sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 6, ett_gtpv2_preaa_ext_menbs, &item, "Extended Macro eNB ID %u",i);
7812 append_str = dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, sub_tree, &offset, hf_gtpv2_ext_macro_enodeb_id);
7813 proto_item_append_text(item, " %s",append_str);
7814 i++;
7815 no_ext_mENB--;
7818 return length;
7821 static const value_string gtpv2_pres_rep_area_action_vals[] = {
7822 { 1, "Start Reporting change"},
7823 { 2, "Stop Reporting change"},
7824 { 3, "Modify Presence Reporting Area elements"},
7825 { 0, NULL}
7828 static void
7829 dissect_gtpv2_pres_rep_area_action(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7831 int offset = 0;
7832 tvbuff_t * new_tvb;
7834 static int * const flags[] = {
7835 &hf_gtpv2_pres_rep_area_act_inapra,
7836 &hf_gtpv2_pres_rep_area_action,
7837 NULL
7840 /* Octet 5 Spare INAPRA Action */
7841 proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN);
7842 offset++;
7844 if (length == 1)
7845 return;
7846 /* Octet 6 to 8 Presence Reporting Area Identifier */
7847 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_id, tvb, offset, 3, ENC_BIG_ENDIAN);
7848 offset+=3;
7849 if (length == 4)
7850 return;
7852 new_tvb = tvb_new_subset_length(tvb, offset, length-4);
7854 /* Share the rest of the dissection with the AVP dissector */
7855 dissect_diameter_3gpp_presence_reporting_area_elements_list(new_tvb, pinfo, tree, NULL);
7859 * 8.109 Presence Reporting Area Information
7861 static void
7862 dissect_gtpv2_pres_rep_area_information(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7864 int offset = 0;
7865 uint64_t gtpv2_pres_rep_area_info_flags_val = 0;
7867 /*Octet 5 to 7 Presence Reporting Area Identifier */
7868 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_info_id, tvb, offset, 3 , ENC_BIG_ENDIAN);
7869 offset+=3;
7871 /*Octet 8 Spare Spare Spare Spare INAPRA APRA OPRA IPRA */
7872 static int * const gtpv2_pres_rep_area_info_flags[] = {
7873 &hf_gtpv2_pres_rep_area_info_flags_b4_b7_spare,
7874 &hf_gtpv2_pres_rep_area_info_flags_b3_inapra,
7875 &hf_gtpv2_pres_rep_area_info_flags_b2_apra,
7876 &hf_gtpv2_pres_rep_area_info_flags_b1_opra,
7877 &hf_gtpv2_pres_rep_area_info_flags_b0_ipra,
7878 NULL
7881 proto_tree_add_bitmask_with_flags_ret_uint64(tree, tvb, offset, hf_gtpv2_pres_rep_area_info_flags, ett_gtpv2_pres_rep_area_info,
7882 gtpv2_pres_rep_area_info_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT | BMT_NO_TFS, &gtpv2_pres_rep_area_info_flags_val);
7883 offset+=1;
7885 /* 3GPP TS 29.212 v14.7.0:
7886 * If the Additional PRA (APRA) flag is set to 1, [...]
7887 * subsequent 4 octets shall then be present
7888 * and shall contain the identifier of the individual PRA
7890 if(gtpv2_pres_rep_area_info_flags_val & 0x04){
7891 /* Octets a to (a+2) Additional PRA Identifier */
7892 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_info_additional_id, tvb, offset, 3, ENC_BIG_ENDIAN);
7893 offset+=3;
7895 /*Octet a+3 Spare Spare Spare Spare Spare APRA OPRA IPRA */
7896 static int * const gtpv2_pres_rep_area_info_flags_no_inapra[] = {
7897 &hf_gtpv2_pres_rep_area_info_flags_b3_b7_spare,
7898 &hf_gtpv2_pres_rep_area_info_flags_b2_apra,
7899 &hf_gtpv2_pres_rep_area_info_flags_b1_opra,
7900 &hf_gtpv2_pres_rep_area_info_flags_b0_ipra,
7901 NULL
7904 while(offset < length){
7905 proto_tree_add_bitmask_with_flags_ret_uint64(tree, tvb, offset, hf_gtpv2_pres_rep_area_info_flags_no_inapra, ett_gtpv2_pres_rep_area_info,
7906 gtpv2_pres_rep_area_info_flags_no_inapra, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT | BMT_NO_TFS, &gtpv2_pres_rep_area_info_flags_val);
7907 offset+=1;
7909 if(gtpv2_pres_rep_area_info_flags_val & 0x04){
7910 /* Octets b to (b+2) Additional PRA Identifier */
7911 proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_info_additional_id, tvb, offset, 3, ENC_BIG_ENDIAN);
7912 offset+=3;
7918 * 8.110 TWAN Identifier Timestamp
7920 static void
7921 dissect_gtpv2_twan_identifier_timestamp(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7923 char *time_str;
7925 /* TWAN Identifier Timestamp value */
7926 /* Octets 5 to 8 are encoded in the same format as the first four octets of the 64-bit timestamp
7927 * format as defined in section 6 of IETF RFC 5905
7930 proto_tree_add_item_ret_time_string(tree, hf_gtpv2_twan_id_ts, tvb, 0, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN, pinfo->pool, &time_str);
7931 proto_item_append_text(item, "%s", time_str);
7935 * 8.111 Overload Control Information
7937 static void
7939 dissect_gtpv2_overload_control_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7942 int offset = 0;
7943 proto_tree *grouped_tree;
7944 tvbuff_t *new_tvb;
7946 proto_item_append_text(item, "[Grouped IE]");
7947 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_overload_control_information);
7948 new_tvb = tvb_new_subset_length(tvb, offset, length);
7950 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_OVERLOAD_CONTROL_INF);
7953 * 8.112 Load Control Information
7955 static void
7956 dissect_gtpv2_load_control_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, proto_item *item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7958 int offset = 0;
7959 tvbuff_t *new_tvb;
7960 proto_tree *grouped_tree;
7962 proto_item_append_text(item, "[Grouped IE]");
7963 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_load_control_inf);
7965 new_tvb = tvb_new_subset_length(tvb, offset, length);
7966 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type, args, GTPV2_IE_LOAD_CONTROL_INF);
7969 * 8.113 Metric
7971 static void
7972 dissect_gtpv2_metric(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7974 uint32_t oct;
7976 proto_tree_add_item_ret_uint(tree, hf_gtpv2_metric, tvb, 0, 1, ENC_BIG_ENDIAN, &oct);
7977 if (oct > 0x64) {
7978 proto_item_append_text(item, "Metric: value beyond 100 is considered as 0");
7979 } else {
7980 proto_item_append_text(item, "%u", oct);
7985 * 8.114 Sequence Number
7987 static void
7988 dissect_gtpv2_seq_no(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
7990 uint32_t seq;
7991 proto_tree_add_item_ret_uint(tree, hf_gtpv2_sequence_number, tvb, 0, 4, ENC_BIG_ENDIAN, &seq);
7992 proto_item_append_text(item, "%u", seq);
7995 * 8.115 APN and Relative Capacity
7997 static void
7998 dissect_gtpv2_apn_and_relative_capacity(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8000 int offset = 0;
8001 uint8_t oct, apn_length;
8002 const uint8_t *apn = NULL;
8004 oct = tvb_get_uint8(tvb, offset);
8005 proto_tree_add_item(tree, hf_gtpv2_relative_capacity, tvb, offset, 1, ENC_BIG_ENDIAN);
8006 if((oct > 0x64) || (oct < 0x01))
8007 proto_item_append_text(item, "Relative Capacity: value beyond (1,100) is considered as 0");
8008 offset += 1;
8009 apn_length = tvb_get_uint8(tvb, offset);
8010 proto_tree_add_item(tree, hf_gtpv2_apn_length, tvb, offset, 1, ENC_BIG_ENDIAN);
8011 offset += 1;
8013 if (apn_length > 0) {
8014 proto_item* pi;
8015 pi = proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, offset, apn_length, ENC_APN_STR | ENC_NA, pinfo->pool, &apn);
8016 if (apn_length > 100)
8017 expert_add_info(pinfo, pi, &ei_gtpv2_apn_too_long);
8021 * 8.117 Paging and Service Information
8023 static void
8024 dissect_gtpv2_paging_and_service_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8026 int offset = 0;
8027 uint8_t ppi_flag;
8029 /* Spare (all bits set to 0) B8 - B5 */
8030 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
8031 /* EPS Bearer ID (EBI) B4 - B1 */
8032 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
8033 offset += 1;
8035 /* Spare B8 - B2 */
8036 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 7, ENC_BIG_ENDIAN);
8037 /* Paging Policy Indication flag (PPI) */
8038 ppi_flag = tvb_get_uint8(tvb, offset);
8039 proto_tree_add_item(tree, hf_gtpv2_ppi_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
8040 offset += 1;
8042 if(ppi_flag & 1){
8043 /* Spare B8 - B7 */
8044 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 2, ENC_BIG_ENDIAN);
8045 /* Paging Policy Indication Value */
8046 proto_item_append_text(tree, " (PPI Value: %s)", val_to_str_ext_const(tvb_get_uint8(tvb, offset), &dscp_vals_ext, "Unknown"));
8047 proto_tree_add_item(tree, hf_gtpv2_ppi_value, tvb, offset, 1, ENC_BIG_ENDIAN);
8051 * 8.118 Integer Number
8053 static void
8054 dissect_gtpv2_integer_number(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item, uint16_t length, uint8_t message_type, uint8_t instance _U_, session_args_t * args _U_)
8056 int offset = 0;
8057 /* The Integer Number value shall be encoded as further described below for the following information elements:
8058 * Maximum Wait Time IE: the length shall be set to 2, i.e. the integer number value shall be encoded as a 16 bit unsigned integer.
8059 * DL Buffering Suggested Packet Count IE: the length shall be set to 1 or 2;
8060 * UE Usage Type IE: the length shall be set to 1, i.e. the integer number value shall be encoded as a 8 bit unsigned integer as specified in subclause 7.3.202 of 3GPP TS 29.272 [70].
8062 if (length <= 4) {
8063 /* Only handle up to 32 bits for now */
8064 switch (message_type) {
8065 case GTPV2_CREATE_SESSION_REQUEST:
8066 proto_item_append_text(item, "Maximum Wait Time");
8067 proto_tree_add_item(tree, hf_gtpv2_maximum_wait_time, tvb, offset, length, ENC_BIG_ENDIAN);
8068 break;
8069 case GTPV2_DL_DATA_NOTIF_ACK:
8070 proto_item_append_text(item, "DL Buffering Suggested Packet Count");
8071 proto_tree_add_item(tree, hf_gtpv2_dl_buf_sug_pkt_cnt, tvb, offset, length, ENC_BIG_ENDIAN);
8072 break;
8073 case GTPV2_FORWARD_RELOCATION_REQ:
8074 case GTPV2_CONTEXT_RESPONSE:
8075 case GTPV2_IDENTIFICATION_RESPONSE:
8076 switch (instance) {
8077 case 0:
8078 /* If the UE Usage Type is not available in the old MME/SGSN/AMF, the length field of this IE shall be set to 0. */
8079 proto_item_append_text(item, "UE Usage Type");
8080 if (length > 0) {
8081 proto_tree_add_item(tree, hf_gtpv2_ue_usage_type, tvb, offset, length, ENC_BIG_ENDIAN);
8082 } else {
8083 proto_item_append_text(item, " not available in the old MME/SGSN/AMF");
8085 break;
8086 case 1:
8087 /* Remaining Running Service Gap Timer */
8088 proto_tree_add_item(tree, hf_gtpv2_rem_run_serv_gap_t, tvb, offset, length, ENC_BIG_ENDIAN);
8089 break;
8090 default:
8091 proto_tree_add_item(tree, hf_gtpv2_integer_number_val, tvb, offset, length, ENC_BIG_ENDIAN);
8092 break;
8094 break;
8095 default:
8096 proto_tree_add_item(tree, hf_gtpv2_integer_number_val, tvb, offset, length, ENC_BIG_ENDIAN);
8097 break;
8099 } else {
8100 /* value not handled, yet*/
8101 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_int_size_not_handled, tvb, offset, length);
8107 * 8.119 Millisecond Time Stamp
8110 static void
8111 dissect_gtpv2_ms_ts(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type, uint8_t instance _U_, session_args_t * args _U_)
8113 int offset = 0;
8114 /* Octets 5 to 10 represent a 48 bit unsigned integer in network order format and are encoded as
8115 * the number of milliseconds since 00:00:00 January 1, 1900 00:00 UTC, i.e. as the
8116 * rounded value of 1000 x the value of the 64-bit timestamp (Seconds + (Fraction / (1<<32)))
8117 * defined in section 6 of IETF RFC 5905
8119 switch (message_type) {
8120 case GTPV2_CREATE_SESSION_REQUEST:
8121 /*proto_item_append_text(item, "Origination time stamp");*/
8122 proto_tree_add_item(tree, hf_gtpv2_origination_ts, tvb, offset, length, ENC_TIME_MSEC_NTP | ENC_BIG_ENDIAN);
8123 break;
8124 default:
8125 proto_tree_add_item(tree, hf_gtpv2_ms_ts, tvb, offset, 6, ENC_TIME_MSEC_NTP | ENC_BIG_ENDIAN);
8126 break;
8131 * 8.120 Monitoring Event Information
8133 static void
8134 dissect_gtpv2_mon_event_inf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8136 int offset = 0;
8137 bool srie;
8138 uint32_t scef_id_len;
8140 /* Octet 4 higher four bits flags SIRE, NSCF, NSUI and NSUR */
8141 proto_tree_add_item_ret_boolean(tree, hf_gtpv2_mon_event_inf_srie, tvb, offset, 1, ENC_BIG_ENDIAN, &srie);
8142 proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_nscf, tvb, offset, 1, ENC_BIG_ENDIAN);
8143 proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_nsui, tvb, offset, 1, ENC_BIG_ENDIAN);
8144 proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_nsur, tvb, offset, 1, ENC_BIG_ENDIAN);
8146 /* Octet 4 lower four bits Instance */
8147 proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
8148 offset++;
8150 /* Octet 5 to 8 SCEF Reference ID */
8151 proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_scef_reference_id, tvb, offset, 4, ENC_BIG_ENDIAN);
8152 offset += 4;
8153 /* Octet 9 Length of SCEF ID */
8154 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mon_event_inf_scef_id_length, tvb, offset, 1, ENC_BIG_ENDIAN, &scef_id_len);
8155 offset++;
8156 /* Octet 10 to k SCEF ID */
8157 proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_scef_id, tvb, offset, scef_id_len, ENC_UTF_8 | ENC_NA);
8158 offset = offset + scef_id_len;
8159 /* Octet (k+1) to (k+2) Remaining Number of Reports */
8160 proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_remaining_number_of_reports, tvb, offset, 2, ENC_BIG_ENDIAN );
8161 offset += 2;
8163 if (srie) {
8164 proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_scef_reference_id_ext, tvb, offset, 8, ENC_BIG_ENDIAN);
8165 offset += 8;
8168 if(offset < length){
8169 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length - offset);
8174 * 8.125 CIoT Optimizations Support Indication
8176 static void
8177 dissect_gtpv2_ciot_opt_support_ind(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8179 int offset;
8180 static int * const ciot_flags[] = {
8181 &hf_gtpv2_ciot_support_ind_spare_bits,
8182 &hf_gtpv2_ciot_support_ind_bit4,
8183 &hf_gtpv2_ciot_support_ind_bit3,
8184 &hf_gtpv2_ciot_support_ind_bit2,
8185 &hf_gtpv2_ciot_support_ind_bit1,
8186 NULL
8189 offset = 0;
8190 proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_gtpv2_ciot_support_ind, ett_gtpv2_ciot_support_ind, ciot_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
8192 offset += 1;
8193 if (length - offset) {
8194 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
8199 * 8.126 SCEF PDN Connection
8201 static void
8202 dissect_gtpv2_scef_pdn_connection(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree _U_, proto_item *item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args)
8204 int offset = 0;
8205 proto_tree *grouped_tree;
8206 tvbuff_t *new_tvb;
8208 proto_item_append_text(item, "[Grouped IE]");
8209 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
8210 new_tvb = tvb_new_subset_length(tvb, offset, length);
8212 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_SCEF_PDN_CONNECTION);
8218 * 8.127 Header Compression Configuration
8220 static void
8221 dissect_gtpv2_header_comp_comf(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8223 int offset = 0;
8225 static int * const gtpv2_rohc_profile_flags_flags[] = {
8226 &hf_gtpv2_rohc_profiles_bit7,
8227 &hf_gtpv2_rohc_profiles_bit6,
8228 &hf_gtpv2_rohc_profiles_bit5,
8229 &hf_gtpv2_rohc_profiles_bit4,
8230 &hf_gtpv2_rohc_profiles_bit3,
8231 &hf_gtpv2_rohc_profiles_bit2,
8232 &hf_gtpv2_rohc_profiles_bit1,
8233 &hf_gtpv2_rohc_profiles_bit0,
8234 NULL
8237 /* Octet 5 to 6 ROHC Profiles */
8239 proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_gtpv2_rohc_profile_flags,
8240 ett_gtpv2_rohc_profile_flags, gtpv2_rohc_profile_flags_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT);
8241 offset++;
8242 proto_tree_add_item(tree, hf_gtpv2_spare_w0, tvb, offset, 1, ENC_BIG_ENDIAN);
8243 offset++;
8244 /* Octet 7 to 8 MAX_CID*/
8245 proto_tree_add_item(tree, hf_gtpv2_max_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
8250 * 8.129 Serving PLMN Rate Control
8252 static void
8253 dissect_gtpv2_serv_plmn_rate_control(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8255 int offset = 0;
8256 proto_tree_add_item(tree, hf_gtpv2_uplink_rate_limit, tvb, offset, 2, ENC_BIG_ENDIAN);
8257 offset += 2;
8258 proto_tree_add_item(tree, hf_gtpv2_downlink_rate_limit, tvb, offset, 2, ENC_BIG_ENDIAN);
8262 * 8.130 Counter
8264 static void
8265 dissect_gtpv2_counter(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8267 int offset = 0;
8269 /* Timestamp value */
8270 /* Octets 5 to 8 shall be encoded in the same format as the first four octets of the 64-bit timestamp
8271 *format as defined in section 6 of IETF RFC 5905
8274 proto_tree_add_item(tree, hf_gtpv2_timestamp_value, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8275 offset += 4;
8276 proto_tree_add_item(tree, hf_gtpv2_counter_value, tvb, offset, 1, ENC_BIG_ENDIAN);
8280 * 8.131 Mapped UE Usage Type
8283 static void
8284 dissect_gtpv2_mapped_ue_usage_type(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8286 int offset = 0;
8288 proto_tree_add_item(tree, hf_gtpv2_mapped_ue_usage_type, tvb, offset, 2, ENC_BIG_ENDIAN);
8289 offset += 2;
8290 if (length > offset) {
8291 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
8296 * 8.132 Secondary RAT Usage Data Report
8298 static const value_string gtpv2_secondary_rat_type_vals[] = {
8299 { 0, "NR" },
8300 { 1, "Unlicensed Spectrum"},
8301 { 0, NULL }
8304 static void
8305 dissect_gtpv2_secondary_rat_usage_data_report(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8307 tvbuff_t *new_tvb;
8308 proto_tree *sub_tree;
8309 int offset = 0;
8310 uint32_t srudn_len;
8311 uint64_t gtpv2_secondary_rat_usage_data_report_flags_val = 0;
8313 static int * const secondary_rat_usage_data_report_flags[] = {
8314 &hf_gtpv2_secondary_rat_usage_data_report_spare_bits,
8315 &hf_gtpv2_secondary_rat_usage_data_report_bit3,
8316 &hf_gtpv2_secondary_rat_usage_data_report_bit2,
8317 &hf_gtpv2_secondary_rat_usage_data_report_bit1,
8318 NULL
8322 * The following bits within Octet 5 shall indicate:
8323 * Bit 8 to 3 - Spare, for future use and set to zero.
8324 * Bit 3 - SRUDN (Secondary RAT Usage Report from NG-RAN)
8325 * Bit 2 - IRSGW (Intended Receiver SGW)
8326 * Bit 1 - IRPGW (Intended Receiver PGW)
8328 proto_tree_add_bitmask_with_flags_ret_uint64(tree, tvb, 0, hf_gtpv2_secondary_rat_usage_data_report, ett_gtpv2_secondary_rat_usage_data_report,
8329 secondary_rat_usage_data_report_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND, &gtpv2_secondary_rat_usage_data_report_flags_val);
8330 offset += 1;
8332 /* Octet 6 RAT Type */
8333 proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_rat_type, tvb, offset, 1, ENC_BIG_ENDIAN);
8334 offset += 1;
8336 /* Octet 7 EPS Bearer ID */
8337 /* Spare (all bits set to 0) B8 - B5 */
8338 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
8339 /* EPS Bearer ID (EBI) B4 - B1 */
8340 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
8341 offset += 1;
8344 * Octets 8 to 11 and 12 to 15 shall be encoded in the same format as the first four octets of the 64-bit timestamp
8345 * format as defined in section 6 of IETF RFC 5905
8348 /* Octets 8 to 11 Start timestamp */
8349 proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_start_timestamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8350 offset += 4;
8352 /* Octets 12 to 15 End timestamp */
8353 proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_end_timestamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8354 offset += 4;
8356 /* 16 to 23 Usage Data DL */
8357 proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_usage_data_dl, tvb, offset, 8, ENC_BIG_ENDIAN);
8358 offset += 8;
8360 /* 24 to 32 Usage Data UL */
8361 proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_usage_data_ul, tvb, offset, 8, ENC_BIG_ENDIAN);
8362 offset += 8;
8364 if(gtpv2_secondary_rat_usage_data_report_flags_val & 0x04) {
8365 /* Octet k Length of Secondary RAT Data Usage Report Transfer */
8366 proto_tree_add_item_ret_uint(tree, hf_gtpv2_secondary_rat_usage_data_report_srudn_length, tvb, offset, 1, ENC_BIG_ENDIAN, &srudn_len);
8367 offset++;
8368 /* Octet (k+1) to a SRUDN */
8369 sub_tree = proto_tree_add_subtree(tree, tvb, offset, srudn_len, ett_gtpv2_son_con, NULL, "SecondaryRATDataUsageReportTransfer");
8370 new_tvb = tvb_new_subset_length(tvb, offset, srudn_len);
8371 asn1_ctx_t asn1_ctx;
8372 asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, true, pinfo);
8373 dissect_ngap_SecondaryRATDataUsageReportTransfer(new_tvb, 0, &asn1_ctx, sub_tree, hf_gtpv2_secondary_rat_usage_data_report_srudn_value);
8374 offset = offset + srudn_len;
8377 if (length - offset) {
8378 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
8385 * 8.133 UP Function Selection Indication Flags
8388 static void
8389 dissect_gtpv2_up_func_slec_indic_flg(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t * args _U_)
8391 int offset = 0;
8393 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 7, ENC_BIG_ENDIAN);
8394 proto_tree_add_item(tree, hf_gtpv2_dcnr, tvb, offset, 1, ENC_BIG_ENDIAN);
8398 /* 8.134 Maximum Packet Loss Rate */
8399 static void
8400 dissect_gtpv2_max_pkt_loss_rte(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, proto_item* item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8402 int offset = 0;
8403 uint8_t oct;
8405 static int* const flags_oct1[] = {
8406 &hf_gtpv2_spare_b7_b2,
8407 &hf_gtpv2_max_pkt_loss_rte_dl_flg,
8408 &hf_gtpv2_max_pkt_loss_rte_ul_flg,
8409 NULL
8411 /*5 Spare DL UL*/
8412 oct = tvb_get_uint8(tvb, offset);
8413 proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags_oct1, ENC_BIG_ENDIAN);
8414 offset++;
8416 if((oct & 0x01) == 1){
8417 /*m to m+1 Maximum Packet Loss Rate UL*/
8418 proto_tree_add_item(tree, hf_gtpv2_max_pkt_loss_rte_ul, tvb, offset, 2, ENC_BIG_ENDIAN);
8419 offset += 2;
8421 if ((oct & 0x02) == 2) {
8422 /*o to o+1 Maximum Packet Loss Rate DL*/
8423 proto_tree_add_item(tree, hf_gtpv2_max_pkt_loss_rte_dl, tvb, offset, 2, ENC_BIG_ENDIAN);
8429 /* 8.135 APN Rate Control Status */
8430 static void
8431 dissect_gtpv2_apn_rte_cntrl_status(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, proto_item* item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8433 int offset = 0;
8435 /*5 to 8 Number of Uplink packets allowed*/
8436 proto_tree_add_item(tree, hf_gtpv2_nr_ul_pkts_all, tvb, offset, 4, ENC_BIG_ENDIAN);
8437 offset += 4;
8438 /*9 to 12 Number of additional exception reports*/
8439 proto_tree_add_item(tree, hf_gtpv2_nr_add_exception_rpts, tvb, offset, 4, ENC_BIG_ENDIAN);
8440 offset += 4;
8441 /*13 to 16 Number of Downlink packets allowed*/
8442 proto_tree_add_item(tree, hf_gtpv2_nr_dl_pkts_all, tvb, offset, 4, ENC_BIG_ENDIAN);
8443 offset += 4;
8444 /*17 to 24 APN Rate Control Status validity Time*/
8445 proto_tree_add_item(tree, hf_apn_rte_cntrl_status_val_time, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8448 /* 3GPP TS 32.422 V15.1.0 (2018-06) 5.5 List of interfaces (O)*/
8450 static int* const ext_tra_info_list_of_if_flags_oct1[] = {
8451 &hf_gtpv2_ext_tra_info_loi_mscs_cap,
8452 &hf_gtpv2_ext_tra_info_loi_mscs_map_f,
8453 &hf_gtpv2_ext_tra_info_loi_mscs_map_e,
8454 &hf_gtpv2_ext_tra_info_loi_mscs_map_b,
8455 &hf_gtpv2_ext_tra_info_loi_mscs_map_g,
8456 &hf_gtpv2_ext_tra_info_loi_mscs_mc,
8457 &hf_gtpv2_ext_tra_info_loi_mscs_iu,
8458 &hf_gtpv2_ext_tra_info_loi_mscs_a,
8459 NULL
8462 static int* const ext_tra_info_list_of_if_flags_oct2[] = {
8463 &hf_gtpv2_ext_tra_info_loi_mscs_map_c,
8464 &hf_gtpv2_ext_tra_info_loi_mscs_map_d,
8465 NULL
8468 static int* const ext_tra_info_list_of_if_flags_oct3[] = {
8469 &hf_gtpv2_ext_tra_info_loi_mgw_iuup,
8470 &hf_gtpv2_ext_tra_info_loi_mgw_nbup,
8471 &hf_gtpv2_ext_tra_info_loi_mgw_mc,
8472 NULL
8475 static int* const ext_tra_info_list_of_if_flags_oct4[] = {
8476 &hf_gtpv2_ext_tra_info_loi_sgsn_ge,
8477 &hf_gtpv2_ext_tra_info_loi_sgsn_gs,
8478 &hf_gtpv2_ext_tra_info_loi_sgsn_map_gf,
8479 &hf_gtpv2_ext_tra_info_loi_sgsn_map_gd,
8480 &hf_gtpv2_ext_tra_info_loi_sgsn_map_gr,
8481 &hf_gtpv2_ext_tra_info_loi_sgsn_gn,
8482 &hf_gtpv2_ext_tra_info_loi_sgsn_iu,
8483 &hf_gtpv2_ext_tra_info_loi_sgsn_gb,
8484 NULL
8487 static int* const ext_tra_info_list_of_if_flags_oct5[] = {
8488 &hf_gtpv2_ext_tra_info_loi_sgsn_s13,
8489 &hf_gtpv2_ext_tra_info_loi_sgsn_s3,
8490 &hf_gtpv2_ext_tra_info_loi_sgsn_s4,
8491 &hf_gtpv2_ext_tra_info_loi_sgsn_s6d,
8492 NULL
8495 static int* const ext_tra_info_list_of_if_flags_oct6[] = {
8496 &hf_gtpv2_ext_tra_info_loi_ggsn_gmb,
8497 &hf_gtpv2_ext_tra_info_loi_ggsn_gi,
8498 &hf_gtpv2_ext_tra_info_loi_ggsn_gn,
8499 NULL
8502 static int* const ext_tra_info_list_of_if_flags_oct7[] = {
8503 &hf_gtpv2_ext_tra_info_loi_rnc_uu,
8504 &hf_gtpv2_ext_tra_info_loi_rnc_iub,
8505 &hf_gtpv2_ext_tra_info_loi_rnc_iur,
8506 &hf_gtpv2_ext_tra_info_loi_rnc_iu,
8507 NULL
8510 static int* const ext_tra_info_list_of_if_flags_oct8[] = {
8511 &hf_gtpv2_ext_tra_info_loi_bm_sc_gmb,
8512 NULL
8515 static int* const ext_tra_info_list_of_if_flags_oct9[] = {
8516 &hf_gtpv2_ext_tra_info_loi_mme_s13,
8517 &hf_gtpv2_ext_tra_info_loi_mme_s11,
8518 &hf_gtpv2_ext_tra_info_loi_mme_s10,
8519 &hf_gtpv2_ext_tra_info_loi_mme_s6a,
8520 &hf_gtpv2_ext_tra_info_loi_mme_s3,
8521 &hf_gtpv2_ext_tra_info_loi_mme_s1_mme,
8522 NULL
8525 static int* const ext_tra_info_list_of_if_flags_oct10[] = {
8526 &hf_gtpv2_ext_tra_info_loi_sgw_gxc,
8527 &hf_gtpv2_ext_tra_info_loi_sgw_s11,
8528 &hf_gtpv2_ext_tra_info_loi_sgw_s8b,
8529 &hf_gtpv2_ext_tra_info_loi_sgw_s5,
8530 &hf_gtpv2_ext_tra_info_loi_sgw_s4,
8531 NULL
8534 static int* const ext_tra_info_list_of_if_flags_oct11[] = {
8535 &hf_gtpv2_ext_tra_info_loi_pdn_gw_sgi,
8536 &hf_gtpv2_ext_tra_info_loi_pdn_gw_s8b,
8537 &hf_gtpv2_ext_tra_info_loi_pdn_gw_gx,
8538 &hf_gtpv2_ext_tra_info_loi_pdn_gw_s6b,
8539 &hf_gtpv2_ext_tra_info_loi_pdn_gw_s5,
8540 &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2c,
8541 &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2b,
8542 &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2a,
8543 NULL
8546 static int* const ext_tra_info_list_of_if_flags_oct12[] = {
8547 &hf_gtpv2_ext_tra_info_loi_enb_uu,
8548 &hf_gtpv2_ext_tra_info_loi_enb_x2,
8549 &hf_gtpv2_ext_tra_info_loi_enb_s1_mme,
8550 NULL
8553 static int* const ext_tra_info_list_of_if_flags_oct13[] = {
8554 &hf_gtpv2_ext_tra_info_loi_hss_sh,
8555 &hf_gtpv2_ext_tra_info_loi_hss_s6a,
8556 &hf_gtpv2_ext_tra_info_loi_hss_s6d,
8557 &hf_gtpv2_ext_tra_info_loi_hss_cx,
8558 &hf_gtpv2_ext_tra_info_loi_hss_map_gr,
8559 &hf_gtpv2_ext_tra_info_loi_hss_map_gc,
8560 &hf_gtpv2_ext_tra_info_loi_hss_map_d,
8561 &hf_gtpv2_ext_tra_info_loi_hss_map_c,
8562 NULL
8565 static int* const ext_tra_info_list_of_if_flags_oct14[] = {
8566 &hf_gtpv2_ext_tra_info_loi_eir_map_gf,
8567 &hf_gtpv2_ext_tra_info_loi_eir_s13p,
8568 &hf_gtpv2_ext_tra_info_loi_eir_s13,
8569 &hf_gtpv2_ext_tra_info_loi_eir_map_f,
8570 NULL
8573 static int* const ext_tra_info_list_of_if_flags_oct15[] = {
8574 &hf_gtpv2_ext_tra_info_loi_amf_n20,
8575 &hf_gtpv2_ext_tra_info_loi_amf_n15,
8576 &hf_gtpv2_ext_tra_info_loi_amf_n14,
8577 &hf_gtpv2_ext_tra_info_loi_amf_n12,
8578 &hf_gtpv2_ext_tra_info_loi_amf_n11,
8579 &hf_gtpv2_ext_tra_info_loi_amf_n8,
8580 &hf_gtpv2_ext_tra_info_loi_amf_n2,
8581 &hf_gtpv2_ext_tra_info_loi_amf_n1,
8582 NULL
8585 static int* const ext_tra_info_list_of_if_flags_oct16[] = {
8586 &hf_gtpv2_ext_tra_info_loi_amf_n22,
8587 &hf_gtpv2_ext_tra_info_loi_amf_n26,
8588 NULL
8591 static int* const ext_tra_info_list_of_if_flags_oct17[] = {
8592 &hf_gtpv2_ext_tra_info_loi_pcf_n15,
8593 &hf_gtpv2_ext_tra_info_loi_pcf_n7,
8594 &hf_gtpv2_ext_tra_info_loi_pcf_n5,
8595 NULL
8598 static int* const ext_tra_info_list_of_if_flags_oct18[] = {
8599 &hf_gtpv2_ext_tra_info_loi_smf_s5_c,
8600 &hf_gtpv2_ext_tra_info_loi_smf_n11,
8601 &hf_gtpv2_ext_tra_info_loi_smf_n10,
8602 &hf_gtpv2_ext_tra_info_loi_smf_n7,
8603 &hf_gtpv2_ext_tra_info_loi_smf_n4,
8604 NULL
8607 static int* const ext_tra_info_list_of_if_flags_oct19[] = {
8608 &hf_gtpv2_ext_tra_info_loi_upf_n4,
8609 NULL
8612 static int* const ext_tra_info_list_of_if_flags_oct20[] = {
8613 &hf_gtpv2_ext_tra_info_loi_ng_ran_node_e1_c,
8614 &hf_gtpv2_ext_tra_info_loi_ng_ran_node_f1_c,
8615 &hf_gtpv2_ext_tra_info_loi_ng_ran_node_Uu,
8616 &hf_gtpv2_ext_tra_info_loi_ng_ran_node_xn_c,
8617 &hf_gtpv2_ext_tra_info_loi_ng_ran_node_ng_c,
8618 NULL
8621 /* 8.136 Extended Trace Information */
8622 static void
8623 dissect_gtpv2_ext_trs_inf(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, proto_item* item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8625 proto_tree *trigg_tree, *ne_tree, *if_tree;
8626 proto_item* ti;
8627 int offset = 0;
8628 uint32_t tid, ev_len;
8630 dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
8631 offset += 3;
8633 /* Append Trace ID to main tree */
8634 tid = tvb_get_ntohs(tvb, offset);
8636 proto_tree_add_item_ret_uint(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN, &tid);
8637 proto_item_append_text(item, "Trace ID: %d ", tid);
8639 offset += 3;
8641 /* Triggering Events, put all into a new tree called triggering_tree */
8642 trigg_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gtpv2_tra_info_trigg, &ti, "Triggering Events");
8643 /* Octet 11 Length of Triggering Events */
8644 proto_tree_add_item_ret_uint(trigg_tree, hf_gtpv2_trig_event_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8645 offset++;
8647 proto_item_set_len(ti, ev_len + 1);
8648 offset += ev_len;
8650 ne_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gtpv2_tra_info_trigg, &ti, "List of NE Types");
8651 /* m + 1*/
8652 /* Length of List of NE Types */
8653 proto_tree_add_item_ret_uint(ne_tree, hf_gtpv2_ne_list_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8654 offset++;
8655 if (ev_len > 0) {
8656 proto_tree_add_bitmask_list(ne_tree, tvb, offset, 1, trace_ne_types_flags_oct1, ENC_BIG_ENDIAN);
8658 if (ev_len > 1) {
8659 proto_tree_add_bitmask_list(ne_tree, tvb, offset+1, 1, trace_ne_types_flags_oct2, ENC_BIG_ENDIAN);
8662 proto_item_set_len(ti, ev_len + 1);
8663 offset += ev_len;
8665 /* p+1 Session Trace Depth */
8666 proto_tree_add_item(tree, hf_gtpv2_ses_trs_depth, tvb, offset, 1, ENC_BIG_ENDIAN);
8667 offset++;
8670 if_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gtpv2_tra_info_trigg, &ti, "List of Interfaces");
8671 /* p+2 Length of List of Interfaces */
8672 proto_tree_add_item_ret_uint(if_tree, hf_gtpv2_list_of_if_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8673 offset++;
8675 if (ev_len > 1) {
8676 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset, 2,
8677 ett_gtpv2_if_mgcs, NULL, "MSC Server interfaces");
8678 proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, ext_tra_info_list_of_if_flags_oct1, ENC_BIG_ENDIAN);
8679 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 1, 1, ext_tra_info_list_of_if_flags_oct2, ENC_BIG_ENDIAN);
8681 if (ev_len > 2) {
8682 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 2, 1,
8683 ett_gtpv2_if_mgw, NULL, "MGW interfaces");
8684 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 2, 1, ext_tra_info_list_of_if_flags_oct3, ENC_BIG_ENDIAN);
8687 if (ev_len > 4) {
8688 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 3, 2,
8689 ett_gtpv2_if_sgsn, NULL, "SGSN interfaces");
8690 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 3, 1, ext_tra_info_list_of_if_flags_oct4, ENC_BIG_ENDIAN);
8691 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 4, 1, ext_tra_info_list_of_if_flags_oct5, ENC_BIG_ENDIAN);
8694 if (ev_len > 5) {
8695 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 5, 1,
8696 ett_gtpv2_if_ggsn, NULL, "GGSN interfaces");
8697 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 5, 1, ext_tra_info_list_of_if_flags_oct6, ENC_BIG_ENDIAN);
8699 if (ev_len > 6) {
8700 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 6, 1,
8701 ett_gtpv2_if_rnc, NULL, "RNC interfaces");
8702 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 6, 1, ext_tra_info_list_of_if_flags_oct7, ENC_BIG_ENDIAN);
8704 if (ev_len > 7) {
8705 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 7, 1,
8706 ett_gtpv2_if_bm_sc, NULL, "BM-SC interfaces");
8707 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 7, 1, ext_tra_info_list_of_if_flags_oct8, ENC_BIG_ENDIAN);
8709 if (ev_len > 8) {
8710 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 8, 1,
8711 ett_gtpv2_if_mme, NULL, "MME interfaces");
8712 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 8, 1, ext_tra_info_list_of_if_flags_oct9, ENC_BIG_ENDIAN);
8714 if (ev_len > 9) {
8715 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 9, 1,
8716 ett_gtpv2_if_sgw, NULL, "SGW interfaces");
8717 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 9, 1, ext_tra_info_list_of_if_flags_oct10, ENC_BIG_ENDIAN);
8719 if (ev_len > 10) {
8720 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 10, 1,
8721 ett_gtpv2_if_pdn_gw, NULL, "PDN GW interfaces");
8722 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 10, 1, ext_tra_info_list_of_if_flags_oct11, ENC_BIG_ENDIAN);
8724 if (ev_len > 11) {
8725 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 11, 1,
8726 ett_gtpv2_if_enb, NULL, "eNB interfaces");
8727 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 11, 1, ext_tra_info_list_of_if_flags_oct12, ENC_BIG_ENDIAN);
8729 if (ev_len > 12) {
8730 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 12, 1,
8731 ett_gtpv2_if_hss, NULL, "HSS interfaces");
8732 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 11, 1, ext_tra_info_list_of_if_flags_oct13, ENC_BIG_ENDIAN);
8734 if (ev_len > 13) {
8735 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 13, 1,
8736 ett_gtpv2_if_eir, NULL, "EIR interfaces");
8737 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 11, 1, ext_tra_info_list_of_if_flags_oct14, ENC_BIG_ENDIAN);
8739 if (ev_len > 15) {
8740 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 14, 2,
8741 ett_gtpv2_if_amf, NULL, "AMF interfaces");
8742 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 14, 1, ext_tra_info_list_of_if_flags_oct15, ENC_BIG_ENDIAN);
8743 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 15, 1, ext_tra_info_list_of_if_flags_oct16, ENC_BIG_ENDIAN);
8745 if (ev_len > 16) {
8746 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 16, 1,
8747 ett_gtpv2_if_pcf, NULL, "PCF interfaces");
8748 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 16, 1, ext_tra_info_list_of_if_flags_oct17, ENC_BIG_ENDIAN);
8750 if (ev_len > 17) {
8751 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 17, 1,
8752 ett_gtpv2_if_smf, NULL, "SMF interfaces");
8753 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 17, 1, ext_tra_info_list_of_if_flags_oct18, ENC_BIG_ENDIAN);
8755 if (ev_len > 18) {
8756 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 18, 1,
8757 ett_gtpv2_if_upf, NULL, "UPF interfaces");
8758 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 18, 1, ext_tra_info_list_of_if_flags_oct19, ENC_BIG_ENDIAN);
8760 if (ev_len > 19) {
8761 proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 19, 1,
8762 ett_gtpv2_if_upf, NULL, "NG-RAN node interfaces");
8763 proto_tree_add_bitmask_list(sub_tree, tvb, offset + 19, 1, ext_tra_info_list_of_if_flags_oct20, ENC_BIG_ENDIAN);
8766 proto_item_set_len(ti, ev_len + 1);
8767 offset += ev_len;
8769 /* q+1 Length of IP Address of Trace Collection Entity */
8770 proto_tree_add_item_ret_uint(tree, hf_gtpv2_trs_coll_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8771 offset++;
8772 /*(q+2) to r IP Address of Trace Collection Entity */
8773 if (ev_len == 4) {
8774 proto_tree_add_item(tree, hf_gtpv2_trs_coll_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
8777 if (ev_len == 16) {
8778 proto_tree_add_item(tree, hf_gtpv2_trs_coll_ipv6_addr, tvb, offset, 16, ENC_NA);
8782 /* 8.137 Monitoring Event Extension Information */
8783 static void
8784 dissect_gtpv2_ie_mon_event_ext_inf(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8786 int offset = 0;
8787 bool lrtp;
8788 bool srie;
8789 uint32_t scef_id_len;
8791 /* Octet 5 Bit 8-3 Spare Bit 2 SRIE Bit 1 LRTP */
8792 proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 6, ENC_BIG_ENDIAN);
8793 proto_tree_add_item_ret_boolean(tree, hf_gtpv2_mon_event_ext_inf_srie, tvb, offset, 1, ENC_BIG_ENDIAN, &srie);
8794 proto_tree_add_item_ret_boolean(tree, hf_gtpv2_mon_event_ext_inf_lrtp, tvb, offset, 1, ENC_BIG_ENDIAN, &lrtp);
8795 offset++;
8796 /* Octet 6 to 9 SCEF Reference ID */
8797 proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_scef_reference_id, tvb, offset, 4, ENC_BIG_ENDIAN);
8798 offset += 4;
8799 /* Octet 10 Length of SCEF ID */
8800 proto_tree_add_item_ret_uint(tree, hf_gtpv2_mon_event_ext_inf_scef_id_length, tvb, offset, 1, ENC_BIG_ENDIAN, &scef_id_len);
8801 offset++;
8802 /* Octet 11 to k SCEF ID */
8803 proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_scef_id, tvb, offset, scef_id_len, ENC_UTF_8 | ENC_NA);
8804 offset = offset + scef_id_len;
8805 if (lrtp) {
8806 proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_remain_min_period_loc_report_type, tvb, offset, 4, ENC_BIG_ENDIAN);
8807 offset += 4;
8810 if (srie) {
8811 proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_scef_reference_id_ext, tvb, offset, 8, ENC_BIG_ENDIAN);
8812 offset += 8;
8815 if(offset < length){
8816 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length- offset);
8820 /* 207 Additional RRM Policy Index Fixed Length / 8.138 */
8821 static void
8822 dissect_gtpv2_ie_additional_rrm_policy_index(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, proto_item* item, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8824 uint32_t rrm_policy_index;
8826 /*5 to 8 Additional RRM Policy Index, The ARPI is encoded as Unsigned32 binary integer values.*/
8827 proto_tree_add_item_ret_uint(tree, hf_gtpv2_additional_rrm_policy_index, tvb, 0, 4, ENC_BIG_ENDIAN, &rrm_policy_index);
8828 proto_item_append_text(item, "%u", rrm_policy_index);
8831 /* 208 V2X Context Extendable / 8.139 */
8832 static void
8833 dissect_gtpv2_ie_v2x_context(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8835 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8838 /* 209 PC5 QoS Parameters Extendable / 8.140 */
8839 static void
8840 dissect_gtpv2_ie_pc5_qos_parameters(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8842 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8845 /* 210 Services Authorized Extendable / 8.141 */
8846 static void
8847 dissect_gtpv2_ie_services_authorized(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8849 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8852 /* 211 Bit Rate Extendable / 8.142 */
8853 static void
8854 dissect_gtpv2_ie_bit_rate(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8856 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8859 /* 212 PC5 QoS Flow Extendable / 8.143 */
8860 static void
8861 dissect_gtpv2_ie_pc5_qos_flow(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8863 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8866 /* 213 SGi PtP Tunnel Address Extendable / 8.144 */
8867 static void
8868 dissect_gtpv2_ie_sgi_ptp_tunnel_address(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8870 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8873 /* 214 PGW Change Info Extendable / 8.145 */
8874 static void
8875 dissect_gtpv2_ie_pgw_change_info(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree _U_, proto_item* item, uint16_t length, uint8_t message_type, uint8_t instance _U_, session_args_t* args)
8877 int offset = 0;
8878 proto_tree *grouped_tree;
8879 tvbuff_t *new_tvb;
8881 proto_item_append_text(item, "[Grouped IE]");
8882 grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PGW_change_info);
8883 new_tvb = tvb_new_subset_length(tvb, offset, length);
8885 dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_PGW_CHANGE_INFO);
8888 /* 215 PGW FQDN Extendable / 8.146 */
8889 static void
8890 dissect_gtpv2_ie_pgw_fqdn(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8892 int offset = 0;
8893 offset = decode_gtpv2_fqdn(tvb, pinfo, tree, item, offset, length);
8895 if(offset < length){
8896 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length- offset);
8900 /* 216 Group Id / 8.147 */
8901 static void
8902 dissect_gtpv2_ie_group_id(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8904 proto_tree_add_item(tree, hf_gtpv2_group_id, tvb, 0, length, ENC_UTF_8);
8907 /* 217 PSCell Id / 8.148 */
8908 static void
8909 dissect_gtpv2_ie_pscell_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length _U_, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8911 int offset = 0;
8913 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_NONE, true);
8914 offset += 3;
8915 proto_tree_add_item(tree, hf_gtpv2_ie_pscell_id_spare, tvb, offset, 5, ENC_BIG_ENDIAN);
8916 proto_tree_add_item(tree, hf_gtpv2_ie_pscell_id_nr_cgi, tvb, offset, 5, ENC_NA);
8920 /* 218 UP Security Policy / 8.149 */
8921 static const value_string gtpv2_up_ip_policy_vals[] = {
8922 {0, "User Plane Integrity protection with EPS is not needed"},
8923 {1, "User Plane Integrity protection with EPS is preferred"},
8924 {2, "User Plane Integrity protection with EPS is required"},
8925 {3, "Spare"},
8926 {0, NULL}
8929 static void
8930 dissect_gtpv2_ie_up_security_policy(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item _U_, uint16_t length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8932 proto_tree_add_item(tree, hf_gtpv2_ie_up_security_policy_spare, tvb, 0, 1, ENC_BIG_ENDIAN);
8933 proto_tree_add_item(tree, hf_gtpv2_ie_up_security_policy_up_ip_policy, tvb, 0, 1, ENC_BIG_ENDIAN);
8934 if (length > 2) {
8935 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 1, length - 2);
8939 /* 219 Alternative IMSI / 8.150 */
8940 static void
8941 dissect_gtpv2_ie_alternative_imsi(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, proto_item* item, uint16_t length, uint8_t message_type, uint8_t instance, session_args_t* args)
8944 * TS 29.274 V18.4.0 says:
8945 * Alternative IMSI is in the form of an IMSI as defined in 3GPP TS 23.003.
8947 dissect_gtpv2_imsi(tvb, pinfo, tree, item, length, message_type, instance, args);
8950 /* 220 NF Instance ID / 8.151 */
8951 static void
8952 dissect_gtpv2_ie_nf_instance_id(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, proto_item* item _U_, uint16_t _U_ length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8955 * String uniquely identifying a NF instance. The format of the NF Instance ID shall be a
8956 * Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122 [15]. The
8957 * hexadecimal letters should be formatted as lower-case characters by the sender, and they
8958 * shall be handled as case-insensitive by the receiver.
8960 * Example: "4ace9d34-2c69-4f99-92d5-a73a3fe8e23b"
8962 proto_tree_add_item(tree, hf_gtpv2_nf_instance_id_nf_instance_id, tvb, 0, 36, ENC_BIG_ENDIAN);
8965 /* 221 Timer in Seconds / 8.152 */
8966 static void
8967 dissect_gtpv2_timer_in_seconds(tvbuff_t* tvb, packet_info* pinfo _U_, proto_tree* tree, proto_item* item _U_, uint16_t _U_ length, uint8_t message_type _U_, uint8_t instance _U_, session_args_t* args _U_)
8969 proto_tree_add_item(tree, hf_gtpv2_nf_timer_in_seconds_timer_value, tvb, 0, 3, ENC_BIG_ENDIAN);
8970 if (length > 4) {
8971 proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 3, length - 4);
8975 /* Table 8.1-1: Information Element types for GTPv2 */
8977 typedef struct _gtpv2_ie {
8978 int ie_type;
8979 void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, uint16_t, uint8_t, uint8_t, session_args_t *);
8980 } gtpv2_ie_t;
8982 static const gtpv2_ie_t gtpv2_ies[] = {
8983 {GTPV2_IE_IMSI, dissect_gtpv2_imsi}, /* 1, Internal Mobile Subscriber Identity (IMSI) */
8984 {GTPV2_IE_CAUSE, dissect_gtpv2_cause}, /* 2, Cause (without embedded offending IE) 8.4 */
8985 {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery}, /* 3, Recovery (Restart Counter) 8.5 */
8986 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
8987 /*Start SRVCC Messages 3GPP TS 29.280 */
8988 {GTPV2_IE_STN_SR, dissect_gtpv2_stn_sr}, /* 51 STN-SR */
8989 {GTPV2_IE_SRC_TGT_TRANS_CON, dissect_gtpv2_src_tgt_trans_con}, /* 52 Source to Target Transparent Container */
8990 {GTPV2_IE_TGT_SRC_TRANS_CON , dissect_gtpv2_tgt_src_trans_con}, /* 53 Target to Source Transparent Container */
8991 {GTPV2_IE_MM_CON_EUTRAN_SRVCC, dissect_gtpv2_mm_con_eutran_srvcc}, /* 54 MM Context for E-UTRAN SRVCC */
8992 {GTPV2_IE_MM_CON_UTRAN_SRVCC, dissect_gtpv2_mm_con_utran_srvcc}, /* 55 MM Context for UTRAN SRVCC */
8993 {GTPV2_IE_SRVCC_CAUSE, dissect_gtpv2_srvcc_cause}, /* 56 SRVCC Cause */
8994 {GTPV2_IE_TGT_RNC_ID, dissect_gtpv2_tgt_rnc_id}, /* 57 Target RNC ID */
8995 {GTPV2_IE_TGT_GLOGAL_CELL_ID, dissect_gtpv2_tgt_global_cell_id}, /* 58 Target Global Cell ID */
8996 {GTPV2_IE_TEID_C, dissect_gtpv2_teid_c}, /* 59 TEID-C */
8997 {GTPV2_IE_SV_FLAGS, dissect_gtpv2_sv_flags}, /* 60 Sv Flags */
8998 {GTPV2_IE_SAI, dissect_gtpv2_sai}, /* 61 Service Area Identifier */
8999 {GTPV2_IE_MM_CTX_FOR_CS_TO_PS_SRVCC, dissect_gtpv2_mm_ctx_for_cs_to_ps_srvcc }, /* 62 Service Area Identifier */
9000 /* 61-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
9001 {GTPV2_APN, dissect_gtpv2_apn}, /* 71, Access Point Name (APN) 8.6 */
9002 {GTPV2_AMBR, dissect_gtpv2_ambr}, /* 72, Aggregate Maximum Bit Rate (AMBR) */
9003 {GTPV2_EBI, dissect_gtpv2_ebi}, /* 73, EPS Bearer ID (EBI) 8.8 */
9004 {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address}, /* 74, IP Address */
9005 {GTPV2_MEI, dissect_gtpv2_mei}, /* 74, Mobile Equipment Identity */
9006 {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn}, /* 76, MSISDN 8.11 */
9007 {GTPV2_INDICATION, dissect_gtpv2_ind}, /* 77 Indication 8.12 */
9008 {GTPV2_PCO, dissect_gtpv2_pco}, /* 78 Protocol Configuration Options (PCO) 8.13 */
9009 {GTPV2_PAA, dissect_gtpv2_paa}, /* 79 PDN Address Allocation (PAA) 8.14 */
9010 {GTPV2_BEARER_QOS, dissect_gtpv2_bearer_qos}, /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
9011 {GTPV2_IE_FLOW_QOS, dissect_gtpv2_flow_qos}, /* 81 Flow Quality of Service (Flow QoS) 8.16 */
9012 {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type}, /* 82, RAT Type 8.17 */
9013 {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net}, /* 83, Serving Network 8.18 */
9014 {GTPV2_IE_BEARER_TFT, dissect_gtpv2_bearer_tft}, /* 84, Bearer TFT 8.19 */
9015 {GTPV2_IE_TAD, dissect_gtpv2_tad}, /* 85, Traffic Aggregate Description 8.20 */
9016 {GTPV2_IE_ULI, dissect_gtpv2_uli}, /* 86, User Location Info (ULI) 8.22 */
9017 {GTPV2_IE_F_TEID, dissect_gtpv2_f_teid}, /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
9018 {GTPV2_IE_TMSI, dissect_gtpv2_tmsi}, /* 88, TMSI 8.23 */
9019 {GTPV2_IE_GLOBAL_CNID, dissect_gtpv2_g_cn_id}, /* 89, Global CN-Id 8.25 */
9020 {GTPV2_IE_S103PDF, dissect_gtpv2_s103pdf}, /* 90, S103 PDN Data Forwarding Info (S103PDF) 8.25 */
9021 {GTPV2_IE_S1UDF, dissect_gtpv2_s1udf}, /* 91, S1-U Data Forwarding (S1UDF) 8.26 */
9022 {GTPV2_IE_DEL_VAL, dissect_gtpv2_delay_value}, /* 92, Delay Value 8.29 */
9023 {GTPV2_IE_BEARER_CTX, dissect_gtpv2_bearer_ctx}, /* 93, Bearer Context 8.31 */
9024 {GTPV2_IE_CHAR_ID, dissect_gtpv2_charging_id}, /* 94, Charging Id */
9025 {GTPV2_IE_CHAR_CHAR, dissect_gtpv2_char_char}, /* 95 Charging Characteristic */
9026 {GTPV2_IE_TRA_INFO, dissect_gtpv2_tra_info}, /* 96, Trace Information 8.31 */
9027 {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag}, /* 97, Bearer Flag */
9028 /* 98, Void 8.33 */
9029 {GTPV2_IE_PDN_TYPE, dissect_gtpv2_pdn_type}, /* 99, PDN Type */
9030 {GTPV2_IE_PTI, dissect_gtpv2_pti}, /* 100, Procedure Transaction Id */
9031 {GTPV2_IE_DRX_PARAM, dissect_gtpv2_drx_param}, /* 101, DRX Parameter 8.36 */
9032 {GTPV2_IE_UE_NET_CAPABILITY, dissect_gtpv2_ue_net_capability}, /* 102, UE network capability 8.37 */
9033 {GTPV2_IE_MM_CONTEXT_GSM_T, dissect_gtpv2_mm_context_gsm_t}, /* 103, MM Context 8.38 GSM Key and Triplets */
9034 {GTPV2_IE_MM_CONTEXT_UTMS_CQ, dissect_gtpv2_mm_context_utms_cq}, /* 104, MM Context 8.38 */
9035 {GTPV2_IE_MM_CONTEXT_GSM_CQ, dissect_gtpv2_mm_context_gsm_cq}, /* 105, MM Context 8.38 */
9036 {GTPV2_IE_MM_CONTEXT_UTMS_Q, dissect_gtpv2_mm_context_utms_q}, /* 106, MM Context 8.38 */
9037 {GTPV2_IE_MM_CONTEXT_EPS_QQ, dissect_gtpv2_mm_context_eps_qq}, /* 107, MM Context 8.38 */
9038 {GTPV2_IE_MM_CONTEXT_UTMS_QQ, dissect_gtpv2_mm_context_utms_qq}, /* 108, MM Context 8.38 */
9039 {GTPV2_IE_PDN_CONNECTION, dissect_gtpv2_PDN_conn}, /* 109, PDN Connection */
9040 {GTPV2_IE_PDN_NUMBERS, dissect_gtpv2_pdn_numbers}, /* 110, PDN Numbers 8.40 */
9041 {GTPV2_IE_P_TMSI, dissect_gtpv2_p_tmsi}, /* 111, P-TMSI 8.41 */
9042 {GTPV2_IE_P_TMSI_SIG, dissect_gtpv2_p_tmsi_sig}, /* 112, P-TMSI Signature 8.42 */
9043 {GTPV2_IE_HOP_COUNTER, dissect_gtpv2_hop_counter}, /* 113, Hop Counter 8.43 */
9044 {GTPV2_IE_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone}, /* 114, UE Time Zone */
9045 {GTPV2_IE_TRACE_REFERENCE, dissect_gtpv2_trace_reference}, /* 115, Trace Reference 8.45 */
9046 {GTPV2_IE_COMPLETE_REQUEST_MSG, dissect_complete_request_msg}, /* 116, Complete Request message 8.46 */
9047 {GTPV2_IE_GUTI, dissect_gtpv2_guti}, /* 117, GUTI 8.47 */
9048 {GTPV2_IE_F_CONTAINER, dissect_gtpv2_F_container}, /* 118, Fully Qualified Container (F-Container) */
9049 {GTPV2_IE_F_CAUSE, dissect_gtpv2_F_cause}, /* 119, Fully Qualified Cause (F-Cause) */
9050 {GTPV2_IE_PLMN_ID, dissect_gtpv2_plmn_id}, /* 120, PLMN ID 8.50 */
9051 {GTPV2_IE_TARGET_ID, dissect_gtpv2_target_id}, /* 121, Target Identification */
9052 /* 122, Void 8.52 */
9053 {GTPV2_IE_PKT_FLOW_ID, dissect_gtpv2_pkt_flow_id}, /* 123, Packet Flow ID 8.53 */
9054 {GTPV2_IE_RAB_CONTEXT, dissect_gtpv2_rab_context}, /* 124, RAB Context 8.54 */
9055 {GTPV2_IE_S_RNC_PDCP_CTX_INFO, dissect_gtpv2_s_rnc_pdcp_ctx_info}, /* 125, Source RNC PDCP context info 8.55 */
9056 {GTPV2_IE_PORT_NR, dissect_port_nr}, /* 126, Port Number 8.56 */
9057 {GTPV2_IE_APN_RESTRICTION, dissect_gtpv2_apn_rest}, /* 127, APN Restriction */
9058 {GTPV2_IE_SEL_MODE, dissect_gtpv2_selec_mode}, /* 128, Selection Mode */
9059 {GTPV2_IE_SOURCE_IDENT, dissect_gtpv2_source_ident}, /* 129, Source Identification 8.59 */
9060 {GTPV2_IE_BEARER_CONTROL_MODE, dissect_gtpv2_bearer_control_mode}, /* 130, Bearer Control Mode */
9061 {GTPV2_IE_CNG_REP_ACT , dissect_gtpv2_cng_rep_act}, /* 131, Change Reporting Action 8.61 */
9062 {GTPV2_IE_FQ_CSID, dissect_gtpv2_fq_csid}, /* 132, Fully Qualified PDN Connection Set Identifier (FQ-CSID) 8.62 */
9063 {GTPV2_IE_CHANNEL_NEEDED, dissect_gtpv2_channel_needed}, /* 133, Channel Needed 8.63 */
9064 {GTPV2_IE_EMLPP_PRI, dissect_gtpv2_emlpp_pri}, /* 134, eMLPP Priority 8.64 */
9065 {GTPV2_IE_NODE_TYPE , dissect_gtpv2_node_type}, /* 135, Node Type 8.65 */
9066 {GTPV2_IE_FQDN, dissect_gtpv2_fqdn}, /* 136, 8.66 Fully Qualified Domain Name (FQDN) */
9067 {GTPV2_IE_TI, dissect_gtpv2_ti}, /* 137, 8.68 Transaction Identifier (TI) */
9068 {GTPV2_IE_MBMS_SESSION_DURATION, dissect_gtpv2_mbms_session_duration}, /* 138, 8.69 MBMS Session Duration */
9069 {GTPV2_IE_MBMS_SERVICE_AREA, dissect_gtpv2_mbms_service_area}, /* 139, 8.70 MBMS Service Area */
9070 {GTPV2_IE_MBMS_SESSION_ID, dissect_gtpv2_mbms_session_id}, /* 140, 8.71 MBMS Session Identifier */
9071 {GTPV2_IE_MBMS_FLOW_ID, dissect_gtpv2_mbms_flow_id}, /* 141, 8.72 MBMS Flow Identifier */
9072 {GTPV2_IE_MBMS_IP_MC_DIST, dissect_gtpv2_mbms_ip_mc_dist}, /* 142, 8.73 MBMS IP Multicast Distribution */
9073 {GTPV2_IE_MBMS_DIST_ACK, dissect_gtpv2_mbms_dist_ack}, /* 143, 8.74 MBMS Distribution Acknowledge */
9074 {GTPV2_IE_RFSP_INDEX, dissect_gtpv2_rfsp_index}, /* 144, 8.77 RFSP Index */
9075 {GTPV2_IE_UCI, dissect_gtpv2_uci}, /* 145, 8.75 User CSG Information (UCI) */
9076 {GTPV2_IE_CSG_INFO_REP_ACTION, dissect_gtpv2_csg_info_rep_action}, /* 146, 8.76 CSG Information Reporting Action */
9077 {GTPV2_IE_CSG_ID, dissect_gtpv2_csg_id}, /* 147, 8.78 CSG ID */
9078 {GTPV2_IE_CMI, dissect_gtpv2_cmi}, /* 148, 8.79 CSG Membership Indication (CMI) */
9079 {GTPV2_IE_SERVICE_INDICATOR, dissect_gtpv2_service_indicator}, /* 149, 8.80 Service indicator */
9080 {GTPV2_IE_DETACH_TYPE, dissect_gtpv2_detach_type}, /* 150, 8.81 Detach Type */
9081 {GTPV2_IE_LDN, dissect_gtpv2_ldn}, /* 151, 8.82 Local Distinguished Name (LDN) */
9082 {GTPV2_IE_NODE_FEATURES, dissect_gtpv2_node_features}, /* 152, 8.83 Node Features */
9083 {GTPV2_IE_MBMS_TIME_TO_DATA_XFER, dissect_gtpv2_mbms_time_to_data_xfer}, /* 153, 8.84 MBMS Time to Data Transfer */
9084 {GTPV2_IE_THROTTLING, dissect_gtpv2_throttling}, /* 154, 8.85 Throttling */
9085 {GTPV2_IE_ARP, dissect_gtpv2_arp}, /* 155, 8.86 Allocation/Retention Priority (ARP) */
9086 {GTPV2_IE_EPC_TIMER, dissect_gtpv2_epc_timer}, /* 156, 8.87 EPC Timer */
9087 {GTPV2_IE_SIG_PRIO_IND, dissect_gtpv2_sig_prio_ind}, /* 157, 8.88 Signalling Priority Indication */
9088 {GTPV2_IE_TMGI, dissect_gtpv2_tmgi}, /* 158, 8.89 Temporary Mobile Group Identity (TMGI) */
9089 {GTPV2_IE_ADD_MM_CONT_FOR_SRVCC, dissect_gtpv2_add_mm_cont_for_srvcc}, /* 159, 8.90 Additional MM context for SRVCC */
9090 {GTPV2_IE_ADD_FLAGS_FOR_SRVCC, dissect_gtpv2_add_flags_for_srvcc}, /* 160, 8.91 Additional flags for SRVCC */
9091 {GTPV2_IE_MMBR, dissect_gtpv2_mmbr}, /* 161, 8.92 Max MBR/APN-AMBR (MMBR) */
9092 {GTPV2_IE_MDT_CONFIG, dissect_gtpv2_mdt_config}, /* 162, 8.93 MDT Configuration */
9093 {GTPV2_IE_APCO, dissect_gtpv2_apco}, /* 163, 8.94 Additional Protocol Configuration Options (APCO) */
9094 {GTPV2_IE_ABS_MBMS_DATA_TF_TIME, dissect_gtpv2_abs_mbms_data_tf_time}, /* 164, 8.95 Absolute Time of MBMS Data Transfer */
9095 {GTPV2_IE_HENB_INFO_REPORT, dissect_gtpv2_henb_info_report}, /* 165, 8.96 H(e)NB Information Reporting */
9096 {GTPV2_IE_IP4CP, dissect_gtpv2_ip4cp}, /* 166, 8.97 IPv4 Configuration Parameters (IPv4CP) */
9097 {GTPV2_IE_CHANGE_TO_REPORT_FLAGS, dissect_gtpv2_change_report_flags}, /* 167, 8.98 Change to Report Flags */
9098 {GTPV2_IE_ACTION_INDICATION, dissect_gtpv2_action_indication}, /* 168, 8.99 Action Indication */
9099 {GTPV2_IE_TWAN_IDENTIFIER, dissect_gtpv2_twan_identifier}, /* 169, 8.100 TWAN Identifier */
9100 {GTPV2_IE_ULI_TIMESTAMP, dissect_gtpv2_uli_timestamp}, /* 170, 8.101 ULI Timestamp */
9101 {GTPV2_IE_MBMS_FLAGS, dissect_gtpv2_mbms_flags}, /* 171, 8.102 MBMS Flags */
9102 {GTPV2_IE_RAN_NAS_CAUSE, dissect_gtpv2_ran_nas_cause}, /* 172, 8.103 RAN/NAS Cause */
9103 {GTPV2_IE_CN_OP_SEL_ENT, dissect_gtpv2_cn_operator_selection_entity}, /* 173, 8.104 CN Operator Selection Entity */
9104 {GTPV2_IE_TRUST_WLAN_MODE_IND, dissect_gtpv2_trust_wlan_mode_ind}, /* 174, 8.105 Trusted WLAN Mode Indication */
9105 {GTPV2_IE_NODE_NUMBER, dissect_gtpv2_node_number}, /* 175, 8.106 Node Number */
9106 {GTPV2_IE_NODE_IDENTIFIER, dissect_gtpv2_node_identifier}, /* 176, 8.107 Node Identifier */
9107 {GTPV2_IE_PRES_REP_AREA_ACT, dissect_gtpv2_pres_rep_area_action}, /* 177, 8.108 Presence Reporting Area Action */
9108 {GTPV2_IE_PRES_REP_AREA_INF, dissect_gtpv2_pres_rep_area_information}, /* 178, 8.109 Presence Reporting Area Information */
9109 {GTPV2_IE_TWAN_ID_TS, dissect_gtpv2_twan_identifier_timestamp}, /* 179, 8.110 TWAN Identifier Timestamp */
9110 {GTPV2_IE_OVERLOAD_CONTROL_INF, dissect_gtpv2_overload_control_inf}, /* 180, 8.111 Overload Control Information */
9111 {GTPV2_IE_LOAD_CONTROL_INF, dissect_gtpv2_load_control_inf}, /* 181, 8.112 Load Control Information */
9112 {GTPV2_IE_METRIC, dissect_gtpv2_metric}, /* 182, 8.113 Metric */
9113 {GTPV2_IE_SEQ_NO, dissect_gtpv2_seq_no}, /* 183, 8.114 Sequence Number */
9114 {GTPV2_IE_APN_AND_REL_CAP, dissect_gtpv2_apn_and_relative_capacity}, /* 184, 8.115 APN and Relative Capacity */
9115 {GTPV2_IE_WLAN_OFFLOADABILITY_IND,dissect_gtpv2_unknown }, /* 185, 8.116 WLAN Offloadability Indication */
9117 {GTPV2_IE_PAGING_AND_SERVICE_INF, dissect_gtpv2_paging_and_service_inf}, /* 186, 8.117 Paging and Service Information */
9118 {GTPV2_IE_INTEGER_NUMBER, dissect_gtpv2_integer_number}, /* 187, 8.118 Integer Number */
9119 {GTPV2_IE_MILLISECOND_TS, dissect_gtpv2_ms_ts}, /* 188, 8.119 Millisecond Time Stamp */
9120 {GTPV2_IE_MON_EVENT_INF, dissect_gtpv2_mon_event_inf}, /* 189, 8.120 Monitoring Event Information */
9121 /* 190, 8.121 ECGI List */
9122 /* 191, 8.122 Remote UE Context */
9123 /* 192, 8.123 Remote User ID */
9124 /* 193, 8.124 Remote UE IP Information */
9125 {GTPV2_IE_CIOT_OPT_SUPPORT_IND, dissect_gtpv2_ciot_opt_support_ind}, /* 194, 8.125 CIoT Optimizations Support Indication */
9126 {GTPV2_IE_SCEF_PDN_CONNECTION , dissect_gtpv2_scef_pdn_connection }, /* 195, 8.126 SCEF PDN Connection */
9127 {GTPV2_IE_HEADER_COMP_CONF, dissect_gtpv2_header_comp_comf}, /* 196, 8.127 Header Compression Configuration */
9128 {GTPV2_IE_EXTENDED_PCO, dissect_gtpv2_pco}, /* 197, 8.128 Extended Protocol Configuration Options (ePCO) */
9129 {GTPV2_IE_SERV_PLMN_RATE_CONTROL, dissect_gtpv2_serv_plmn_rate_control}, /* 198, 8.129 Serving PLMN Rate Control */
9130 {GTPV2_IE_COUNTER, dissect_gtpv2_counter}, /* 199, 8.130 Counter */
9131 {GTPV2_IE_MAPPED_UE_USAGE_TYPE, dissect_gtpv2_mapped_ue_usage_type }, /* 199, 8.131 Mapped UE Usage Type */
9132 {GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT, dissect_gtpv2_secondary_rat_usage_data_report}, /* 201, 8.132 Secondary RAT Usage Data Report */
9133 {GTPV2_IE_UP_FUNC_SEL_INDI_FLG, dissect_gtpv2_up_func_slec_indic_flg }, /* 202, 8.133 UP Function Selection Indication Flags */
9134 {GTPV2_IE_MAX_PKT_LOSS_RTE, dissect_gtpv2_max_pkt_loss_rte }, /* 203, 8.134 Maximum Packet Loss Rate */
9135 {GTPV2_IE_APN_RTE_CNTRL_STATUS, dissect_gtpv2_apn_rte_cntrl_status }, /* 204, 8.135 APN Rate Control Status */
9136 {GTPV2_IE_EXT_TRS_INF, dissect_gtpv2_ext_trs_inf }, /* 205, 8.136 Extended Trace Information */
9137 {GTPV2_IE_MON_EVENT_EXT_INF, dissect_gtpv2_ie_mon_event_ext_inf }, /* 206, 8.137 Monitoring Event Extension Information */
9138 {GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, dissect_gtpv2_ie_additional_rrm_policy_index }, /* 207 Additional RRM Policy Index Fixed Length / 8.138 */
9139 {GTPV2_IE_V2X_CONTEXT, dissect_gtpv2_ie_v2x_context }, /* 208 V2X Context Extendable / 8.139 */
9140 {GTPV2_IE_PC5_QOS_PARAMETERS, dissect_gtpv2_ie_pc5_qos_parameters }, /* 209 PC5 QoS Parameters Extendable / 8.140 */
9141 {GTPV2_IE_SERVICES_AUTHORIZED, dissect_gtpv2_ie_services_authorized }, /* 210 Services Authorized Extendable / 8.141 */
9142 {GTPV2_IE_BIT_RATE, dissect_gtpv2_ie_bit_rate }, /* 211 Bit Rate Extendable / 8.142 */
9143 {GTPV2_IE_PC5_QOS_FLOW, dissect_gtpv2_ie_pc5_qos_flow }, /* 212 PC5 QoS Flow Extendable / 8.143 */
9144 {GTPV2_IE_SGI_PTP_TUNNEL_ADDRESS, dissect_gtpv2_ie_sgi_ptp_tunnel_address }, /* 213 SGi PtP Tunnel Address Extendable / 8.144 */
9145 {GTPV2_IE_PGW_CHANGE_INFO, dissect_gtpv2_ie_pgw_change_info }, /* 214 PGW Change Info Extendable / 8.145 */
9146 {GTPV2_IE_PGW_FQDN, dissect_gtpv2_ie_pgw_fqdn }, /* 215 PGW FQDN Extendable / 8.146 */
9147 {GTPV2_IE_GROUP_ID, dissect_gtpv2_ie_group_id }, /* 216 Group Id Variable Length / 8.147 */
9148 {GTPV2_IE_PSCELL_ID, dissect_gtpv2_ie_pscell_id }, /* 217 PSCell Id Fixed Length / 8.148 */
9149 {GTPV2_IE_UP_SECURITY_POLICY, dissect_gtpv2_ie_up_security_policy }, /* 218 UP Security Policy Extendable / 8.149 */
9150 {GTPV2_IE_ALT_IMSI, dissect_gtpv2_ie_alternative_imsi }, /* 219 Alternative IMSI Variable Length / 8.150 */
9151 {GTPV2_IE_NF_INSTANCE_ID, dissect_gtpv2_ie_nf_instance_id }, /* 220 NF Instance ID*/
9152 {GTPV2_IE_TIMER_IN_SECONDS, dissect_gtpv2_timer_in_seconds }, /* 221 Timer in Seconds*/
9153 {GTPV2_IE_PRIVATE_EXT, dissect_gtpv2_private_ext },
9154 {0, dissect_gtpv2_unknown}
9157 static gtpv2_msg_hash_t *
9158 gtpv2_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int seq_nr, unsigned msgtype, gtpv2_conv_info_t *gtpv2_info, uint8_t last_cause)
9160 gtpv2_msg_hash_t gcr, *gcrp = NULL;
9161 uint32_t session;
9163 gcr.seq_nr = seq_nr;
9164 gcr.req_time = pinfo->abs_ts;
9166 switch (msgtype) {
9167 case GTPV2_CREATE_SESSION_REQUEST:
9168 case GTPV2_CREATE_BEARER_REQUEST:
9169 case GTPV2_UPDATE_BEARER_REQUEST:
9170 case GTPV2_MODIFY_BEARER_REQUEST:
9171 case GTPV2_DELETE_BEARER_REQUEST:
9172 case GTPV2_DELETE_SESSION_REQUEST:
9173 case GTPV2_MODIFY_BEARER_COMMAND:
9174 case GTPV2_DELETE_BEARER_COMMAND:
9175 case GTPV2_BEARER_RESOURCE_COMMAND:
9176 case GTPV2_SRVCC_PS_TO_CS_REQUEST:
9177 case GTPV2_SRVCC_PS_TO_CS_COMPLETE_NOTIFICATION:
9178 case GTPV2_SRVCC_PS_TO_CS_CANCEL_NOTIFICATION:
9179 case GTPV2_CONTEXT_REQUEST:
9180 case GTPV2_FORWARD_RELOCATION_REQ:
9181 case GTPV2_RELOCATION_CANCEL_REQUEST:
9182 case GTPV2_FORWARD_CTX_NOTIFICATION:
9183 case GTPV2_FORWARD_RELOCATION_COMPLETE_NOTIFICATION:
9184 gcr.is_request = true;
9185 gcr.req_frame = pinfo->num;
9186 gcr.rep_frame = 0;
9187 break;
9188 case GTPV2_CREATE_SESSION_RESPONSE:
9189 case GTPV2_CREATE_BEARER_RESPONSE:
9190 case GTPV2_UPDATE_BEARER_RESPONSE:
9191 case GTPV2_MODIFY_BEARER_RESPONSE:
9192 case GTPV2_DELETE_BEARER_RESPONSE:
9193 case GTPV2_DELETE_SESSION_RESPONSE:
9194 case GTPV2_MODIFY_BEARER_FAILURE_INDICATION:
9195 case GTPV2_DELETE_BEARER_FAILURE_INDICATION:
9196 case GTPV2_BEARER_RESOURCE_FAILURE_INDICATION:
9197 case GTPV2_SRVCC_PS_TO_CS_RESPONSE:
9198 case GTPV2_SRVCC_PS_TO_CS_COMPLETE_ACKNOWLEDGE:
9199 case GTPV2_SRVCC_PS_TO_CS_CANCEL_ACKNOWLEDGE:
9200 case GTPV2_CONTEXT_RESPONSE:
9201 case GTPV2_FORWARD_RELOCATION_RESP:
9202 case GTPV2_RELOCATION_CANCEL_RESPONSE:
9203 case GTPV2_FORWARD_CTX_ACKNOWLEDGE:
9204 case GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE:
9206 gcr.is_request = false;
9207 gcr.req_frame = 0;
9208 gcr.rep_frame = pinfo->num;
9209 break;
9210 default:
9211 gcr.is_request = false;
9212 gcr.req_frame = 0;
9213 gcr.rep_frame = 0;
9214 break;
9217 gcrp = (gtpv2_msg_hash_t *)wmem_map_lookup(gtpv2_info->matched, &gcr);
9219 if (gcrp) {
9220 gcrp->is_request = gcr.is_request;
9221 } else {
9222 /*no match, let's try to make one*/
9223 switch (msgtype) {
9224 case GTPV2_CREATE_SESSION_REQUEST:
9225 case GTPV2_CREATE_BEARER_REQUEST:
9226 case GTPV2_UPDATE_BEARER_REQUEST:
9227 case GTPV2_MODIFY_BEARER_REQUEST:
9228 case GTPV2_DELETE_BEARER_REQUEST:
9229 case GTPV2_DELETE_SESSION_REQUEST:
9230 case GTPV2_MODIFY_BEARER_COMMAND:
9231 case GTPV2_DELETE_BEARER_COMMAND:
9232 case GTPV2_BEARER_RESOURCE_COMMAND:
9233 case GTPV2_SRVCC_PS_TO_CS_REQUEST:
9234 case GTPV2_SRVCC_PS_TO_CS_COMPLETE_NOTIFICATION:
9235 case GTPV2_SRVCC_PS_TO_CS_CANCEL_NOTIFICATION:
9236 case GTPV2_CONTEXT_REQUEST:
9237 case GTPV2_FORWARD_RELOCATION_REQ:
9238 case GTPV2_RELOCATION_CANCEL_REQUEST:
9239 case GTPV2_FORWARD_CTX_NOTIFICATION:
9240 case GTPV2_FORWARD_RELOCATION_COMPLETE_NOTIFICATION:
9242 gcr.seq_nr = seq_nr;
9244 gcrp = (gtpv2_msg_hash_t *)wmem_map_lookup(gtpv2_info->unmatched, &gcr);
9245 if (gcrp) {
9246 wmem_map_remove(gtpv2_info->unmatched, gcrp);
9248 /* if we can't reuse the old one, grab a new chunk */
9249 if (!gcrp) {
9250 gcrp = wmem_new(wmem_file_scope(), gtpv2_msg_hash_t);
9252 gcrp->seq_nr = seq_nr;
9253 gcrp->req_frame = pinfo->num;
9254 gcrp->req_time = pinfo->abs_ts;
9255 gcrp->rep_frame = 0;
9256 gcrp->msgtype = msgtype;
9257 gcrp->is_request = true;
9258 wmem_map_insert(gtpv2_info->unmatched, gcrp, gcrp);
9259 return NULL;
9260 case GTPV2_CREATE_SESSION_RESPONSE:
9261 case GTPV2_CREATE_BEARER_RESPONSE:
9262 case GTPV2_UPDATE_BEARER_RESPONSE:
9263 case GTPV2_MODIFY_BEARER_RESPONSE:
9264 case GTPV2_DELETE_BEARER_RESPONSE:
9265 case GTPV2_DELETE_SESSION_RESPONSE:
9266 case GTPV2_MODIFY_BEARER_FAILURE_INDICATION:
9267 case GTPV2_DELETE_BEARER_FAILURE_INDICATION:
9268 case GTPV2_BEARER_RESOURCE_FAILURE_INDICATION:
9269 case GTPV2_SRVCC_PS_TO_CS_RESPONSE:
9270 case GTPV2_SRVCC_PS_TO_CS_COMPLETE_ACKNOWLEDGE:
9271 case GTPV2_SRVCC_PS_TO_CS_CANCEL_ACKNOWLEDGE:
9272 case GTPV2_CONTEXT_RESPONSE:
9273 case GTPV2_FORWARD_RELOCATION_RESP:
9274 case GTPV2_RELOCATION_CANCEL_RESPONSE:
9275 case GTPV2_FORWARD_CTX_ACKNOWLEDGE:
9276 case GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE:
9278 gcr.seq_nr = seq_nr;
9279 gcrp = (gtpv2_msg_hash_t *)wmem_map_lookup(gtpv2_info->unmatched, &gcr);
9281 if (gcrp) {
9282 if (!gcrp->rep_frame) {
9283 wmem_map_remove(gtpv2_info->unmatched, gcrp);
9284 gcrp->rep_frame = pinfo->num;
9285 gcrp->is_request = false;
9286 wmem_map_insert(gtpv2_info->matched, gcrp, gcrp);
9289 break;
9290 default:
9291 break;
9295 /* we have found a match */
9296 if (gcrp) {
9297 proto_item *it;
9299 if (gcrp->is_request) {
9300 it = proto_tree_add_uint(tree, hf_gtpv2_response_in, tvb, 0, 0, gcrp->rep_frame);
9301 proto_item_set_generated(it);
9302 } else {
9303 nstime_t ns;
9305 it = proto_tree_add_uint(tree, hf_gtpv2_response_to, tvb, 0, 0, gcrp->req_frame);
9306 proto_item_set_generated(it);
9307 nstime_delta(&ns, &pinfo->abs_ts, &gcrp->req_time);
9308 it = proto_tree_add_time(tree, hf_gtpv2_response_time, tvb, 0, 0, &ns);
9309 proto_item_set_generated(it);
9310 if (g_gtp_session && !PINFO_FD_VISITED(pinfo)) {
9311 /* GTP session */
9312 /* If it's not already in the list */
9313 session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
9314 if (!session) {
9315 session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(gcrp->req_frame)));
9316 if (session) {
9317 add_gtp_session(pinfo->num, session);
9321 if (!is_cause_accepted(last_cause, 2)){
9322 /* If the cause is not accepted then we have to remove all the session information about its corresponding request */
9323 remove_frame_info(gcrp->req_frame);
9328 return gcrp;
9331 static void
9332 track_gtpv2_session(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gtpv2_hdr_t * gtpv2_hdr, wmem_list_t *teid_list, wmem_list_t *ip_list, uint32_t last_teid _U_, address last_ip _U_)
9334 uint32_t session, frame_teid_cp;
9335 proto_item *it;
9337 /* GTP session */
9338 if (tree) {
9339 session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
9340 if (session) {
9341 it = proto_tree_add_uint(tree, hf_gtpv2_session, tvb, 0, 0, session);
9342 proto_item_set_generated(it);
9346 if (!PINFO_FD_VISITED(pinfo)) {
9347 /* If the message does not have any session ID */
9348 session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
9349 if (!session) {
9350 /* If the message is not a CSESRES, CSESREQ, UBEAREQ, UBEARES, CBEAREQ, CBEARES, MBEAREQ or MBEARES then we remove its information from teid and ip lists */
9351 if ((gtpv2_hdr->message != GTPV2_CREATE_SESSION_RESPONSE && gtpv2_hdr->message != GTPV2_CREATE_SESSION_REQUEST && gtpv2_hdr->message != GTPV2_UPDATE_BEARER_RESPONSE
9352 && gtpv2_hdr->message != GTPV2_UPDATE_BEARER_REQUEST && gtpv2_hdr->message != GTPV2_CREATE_BEARER_REQUEST && gtpv2_hdr->message != GTPV2_CREATE_BEARER_RESPONSE
9353 && gtpv2_hdr->message != GTPV2_MODIFY_BEARER_REQUEST && gtpv2_hdr->message != GTPV2_MODIFY_BEARER_RESPONSE)) {
9354 /* If the lists are not empty*/
9355 if (wmem_list_count(teid_list) && wmem_list_count(ip_list)) {
9356 remove_frame_info(pinfo->num);
9360 if (gtpv2_hdr->message == GTPV2_CREATE_SESSION_REQUEST){
9361 /* If CPDPCREQ and not already in the list then we create a new session*/
9362 add_gtp_session(pinfo->num, gtp_session_count++);
9364 else if (gtpv2_hdr->message != GTPV2_CREATE_SESSION_RESPONSE) {
9365 /* We have to check if its teid == teid_cp and ip.dst == gsn_ipv4 from the lists, if that is the case then we have to assign
9366 the corresponding session ID */
9367 if ((get_frame(pinfo->dst, (uint32_t)gtpv2_hdr->teid, &frame_teid_cp) == 1)) {
9368 /* Then we have to set its session ID */
9369 session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(frame_teid_cp)));
9370 if (session) {
9371 /* We add the corresponding session to the list so that when a response came we can associate its session ID*/
9372 add_gtp_session(pinfo->num, session);
9375 else if (gtpv2_hdr->message == GTPV2_MODIFY_BEARER_REQUEST) {
9376 /* If MBEAREQ and not already in the list then we create a new session*/
9377 add_gtp_session(pinfo->num, gtp_session_count++);
9384 void
9385 dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, int offset, uint8_t message_type, session_args_t * args, uint8_t parent_ie)
9387 proto_tree *ie_tree;
9388 proto_item *ti;
9389 tvbuff_t *ie_tvb;
9390 uint8_t type, instance;
9391 uint16_t length;
9392 int i, remaining_length, msg_length;
9393 unsigned info_elem;
9395 * Octets 8 7 6 5 4 3 2 1
9396 * 1 Type
9397 * 2-3 Length = n
9398 * 4 CR Spare Instance
9399 * 5-(n+4) IE specific data
9401 msg_length = (int)tvb_reported_length(tvb);
9402 while (offset < msg_length) {
9403 /* Get the type and length */
9404 remaining_length = msg_length - offset;
9405 if (remaining_length < 3) {
9406 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, offset, remaining_length,
9407 "Not enough data left for IE and length, %i bytes", remaining_length);
9408 return;
9410 type = tvb_get_uint8(tvb, offset);
9411 length = tvb_get_ntohs(tvb, offset + 1);
9412 remaining_length = remaining_length -4;
9413 if (remaining_length < length) {
9414 proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, offset+4, remaining_length,
9415 "Less data left than indicated by length %u, remaining length %i", length, remaining_length);
9416 /* Octet 1 */
9417 proto_tree_add_item(tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
9418 offset += 1;
9420 /*Octet 2 - 3 */
9421 proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
9422 return;
9424 ie_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4 + length, ett_gtpv2_ies[type], &ti, "%s: ",
9425 val_to_str_ext_const(type, &gtpv2_element_type_vals_ext, "Unknown"));
9427 /* Octet 1 */
9428 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
9429 offset += 1;
9431 /*Octet 2 - 3 */
9432 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
9433 offset += 2;
9435 /* ch8.120 breaks the format described in ch8.2.1 */
9436 if (type == GTPV2_IE_MON_EVENT_INF) {
9437 instance = tvb_get_uint8(tvb, offset) & 0x0f;
9438 } else {
9439 /* CR Spare Instance Octet 4*/
9440 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, ENC_BIG_ENDIAN);
9442 instance = tvb_get_uint8(tvb, offset) & 0x0f;
9443 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
9445 /* Add Info element on IE types with multiple instances in same group */
9446 if (tree && message_type > 0) {
9447 /* XXX - This has 250+ entries and should really be a different
9448 * data structure, perhaps lazily creating a table. */
9449 for (info_elem = 0; info_elem < NUM_GTPV2_IE_INFO_ELEM_INSTANCES; info_elem++) {
9450 if (gtpv2_information_element_instance_vals[info_elem].message_type == message_type &&
9451 gtpv2_information_element_instance_vals[info_elem].parent_ie == parent_ie &&
9452 gtpv2_information_element_instance_vals[info_elem].type == type &&
9453 gtpv2_information_element_instance_vals[info_elem].instance == instance)
9455 proto_item_append_text(ie_tree, " %s: ", gtpv2_information_element_instance_vals[info_elem].info_element);
9456 break;
9460 offset++;
9463 /* TODO: call IE dissector here */
9464 if (type == GTPV2_IE_RESERVED) {
9465 /* Treat IE type zero special as type zero is used to end the loop in the else branch */
9466 expert_add_info(pinfo, ti, &ei_gtpv2_ie);
9467 } else {
9468 i = -1;
9469 /* Loop over the IE dissector list to se if we find an entry;
9470 the last entry will have ie_type=0 breaking the loop */
9471 while (gtpv2_ies[++i].ie_type) {
9472 if (gtpv2_ies[i].ie_type == type)
9473 break;
9475 /* Just give the IE dissector the IE */
9476 ie_tvb = tvb_new_subset_remaining(tvb, offset);
9477 (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, message_type, instance, args);
9480 /* ch8.120 breaks the format described in ch8.2.1 */
9481 if (type == GTPV2_IE_MON_EVENT_INF) {
9482 offset++;
9485 offset += length;
9489 static int
9490 // NOLINTNEXTLINE(misc-no-recursion)
9491 dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
9493 proto_tree *gtpv2_tree;
9494 proto_item *ti;
9495 uint8_t message_type, t_flag, p_flag, mp_flag, cause_aux;
9496 int offset = 0;
9497 uint16_t msg_length;
9498 tvbuff_t *msg_tvb;
9499 int seq_no = 0;
9500 conversation_t *conversation;
9501 gtpv2_conv_info_t *gtpv2_info;
9502 session_args_t *args = NULL;
9503 gtpv2_hdr_t * gtpv2_hdr = NULL;
9504 gtpv2_msg_hash_t *gcrp = NULL;
9505 uint64_t gtpv2_hdr_flags;
9507 static int * const gtpv2_flags[] = {
9508 &hf_gtpv2_version,
9509 &hf_gtpv2_p,
9510 &hf_gtpv2_t,
9511 &hf_gtpv2_mp,
9512 NULL
9515 gtpv2_hdr = wmem_new0(pinfo->pool, gtpv2_hdr_t);
9517 /* Setting the TEID to -1 to say that the TEID is not valid for this packet */
9518 gtpv2_hdr->teid = -1;
9520 /* Currently we get called from the GTP dissector no need to check the version */
9521 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
9522 col_clear(pinfo->cinfo, COL_INFO);
9524 /* message type is in octet 2 */
9525 message_type = tvb_get_uint8(tvb, 1);
9526 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, &gtpv2_message_type_vals_ext, "Unknown"));
9529 msg_length = tvb_get_ntohs(tvb, offset + 2);
9530 ti = proto_tree_add_item(tree, proto_gtpv2, tvb, offset, msg_length + 4, ENC_NA);
9531 gtpv2_tree = proto_item_add_subtree(ti, ett_gtpv2);
9533 if (g_gtp_session) {
9534 args = wmem_new0(pinfo->pool, session_args_t);
9535 args->last_cause = 16; /* It stores the last cause decoded. Cause accepted by default */
9536 /* We create the auxiliary lists */
9537 args->teid_list = wmem_list_new(pinfo->pool);
9538 args->ip_list = wmem_list_new(pinfo->pool);
9542 * Do we have a conversation for this connection?
9544 conversation = find_or_create_conversation(pinfo);
9547 * Do we already know this conversation?
9549 gtpv2_info = (gtpv2_conv_info_t *)conversation_get_proto_data(conversation, proto_gtpv2);
9550 if (gtpv2_info == NULL) {
9551 /* No. Attach that information to the conversation, and add
9552 * it to the list of information structures.
9554 gtpv2_info = wmem_new(wmem_file_scope(), gtpv2_conv_info_t);
9555 /*Request/response matching tables*/
9556 gtpv2_info->matched = wmem_map_new(wmem_file_scope(), gtpv2_sn_hash, gtpv2_sn_equal_matched);
9557 gtpv2_info->unmatched = wmem_map_new(wmem_file_scope(), gtpv2_sn_hash, gtpv2_sn_equal_unmatched);
9559 conversation_add_proto_data(conversation, proto_gtpv2, gtpv2_info);
9562 /* Control Plane GTP uses a variable length header. Control Plane GTP header
9563 * length shall be a multiple of 4 octets.
9564 * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
9565 * Bits 8 7 6 5 4 3 2 1
9566 * Octets 1 Version P T Spare Spare Spare
9567 * 2 Message Type
9568 * 3 Message Length (1st Octet)
9569 * 4 Message Length (2nd Octet)
9570 * m-k(m+3) If T flag is set to 1, then TEID shall be placed into octets 5-8.
9571 * Otherwise, TEID field is not present at all.
9572 * n-(n+2) Sequence Number
9573 * (n+3) Spare
9574 * Figure 5.1-1: General format of GTPv2 Header for Control Plane
9577 /* 5.4 EPC specific GTP-C header
9578 * Bits 8 7 6 5 4 3 2 1
9579 * Octets 1 Version P T=1 MP Spare Spare
9580 * 2 Message Type
9581 * 3 Message Length (1st Octet)
9582 * 4 Message Length (2nd Octet)
9583 * 5 Tunnel Endpoint Identifier (1st Octet)
9584 * 6 Tunnel Endpoint Identifier (2nd Octet)
9585 * 7 Tunnel Endpoint Identifier (3rd Octet)
9586 * 8 Tunnel Endpoint Identifier (4th Octet)
9587 * 9 Sequence Number (1st Octet)
9588 * 10 Sequence Number (2nd Octet)
9589 * 11 Sequence Number (3rd Octet)
9590 * 12 Message Priority Spare
9593 /* Octet 1 */
9594 proto_tree_add_bitmask_with_flags_ret_uint64(gtpv2_tree, tvb, offset, hf_gtpv2_flags,
9595 ett_gtpv2_flags, gtpv2_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT, &gtpv2_hdr_flags);
9597 gtpv2_hdr->flags = (uint8_t)gtpv2_hdr_flags;
9598 p_flag = (gtpv2_hdr->flags & 0x10) >> 4;
9599 t_flag = (gtpv2_hdr->flags & 0x08) >> 3;
9600 mp_flag = (gtpv2_hdr->flags & 0x04) >> 2;
9602 offset += 1;
9604 /* Octet 2 */
9605 gtpv2_hdr->message = tvb_get_uint8(tvb, offset);
9606 proto_tree_add_uint(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, gtpv2_hdr->message);
9607 offset += 1;
9608 /* Octet 3 - 4 */
9609 gtpv2_hdr->length = tvb_get_ntohs(tvb, offset);
9610 proto_tree_add_uint(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, gtpv2_hdr->length);
9611 offset += 2;
9613 if (t_flag) {
9614 /* Tunnel Endpoint Identifier 4 octets */
9615 gtpv2_hdr->teid = tvb_get_ntohl(tvb, offset);
9616 proto_tree_add_uint(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, (uint32_t)gtpv2_hdr->teid);
9617 offset += 4;
9619 /* Sequence Number 3 octets */
9620 proto_tree_add_item_ret_uint(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 3, ENC_BIG_ENDIAN, &seq_no);
9621 offset += 3;
9623 /* Spare 1 octet or if the "MP" flag is set to "1",
9624 * then bits 8 to 5 of octet 12 shall indicate the message priority.
9626 if (mp_flag) {
9627 /* Bits 8 to 5 of octet 12 shall be encoded as the binary value of the Message Priority
9628 * and it may take any value between 0 and 15, where 0 corresponds to the highest priority
9629 * and 15 the lowest priority.
9631 proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
9632 }else{
9633 proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
9635 offset += 1;
9637 if (p_flag) {
9638 msg_tvb = tvb_new_subset_length(tvb, 0, msg_length + 4);
9639 dissect_gtpv2_ie_common(msg_tvb, pinfo, gtpv2_tree, offset, message_type, args, 0);
9640 } else {
9641 dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset, message_type, args, 0);
9643 /*Use sequence number to track Req/Resp pairs*/
9644 cause_aux = 16; /* Cause accepted by default. Only used when args is NULL */
9645 if (args && !PINFO_FD_VISITED(pinfo)) {
9646 /* We insert the lists inside the table*/
9647 fill_map(args->teid_list, args->ip_list, pinfo->num);
9648 cause_aux = args->last_cause;
9650 gcrp = gtpv2_match_response(tvb, pinfo, gtpv2_tree, seq_no, message_type, gtpv2_info, cause_aux);
9651 if (gcrp) {
9652 tap_queue_packet(gtpv2_tap, pinfo, gcrp);
9654 if (args) {
9655 track_gtpv2_session(tvb, pinfo, gtpv2_tree, gtpv2_hdr, args->teid_list, args->ip_list, args->last_teid, args->last_ip);
9658 /* Bit 5 represents a "P" flag. If the "P" flag is set to "0",
9659 * no piggybacked message shall be present. If the "P" flag is set to "1",
9660 * then another GTPv2-C message with its own header and body shall be present
9661 * at the end of the current message.
9663 if (p_flag) {
9664 tvbuff_t *new_p_tvb;
9665 /* Octets 3 to 4 represent the Length field. This field shall indicate the
9666 * length of the message in octets excluding the
9667 * mandatory part of the GTP-C header (the first 4 octets).
9669 new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
9670 col_append_str(pinfo->cinfo, COL_INFO, " / ");
9671 col_set_fence(pinfo->cinfo, COL_INFO);
9672 increment_dissection_depth(pinfo);
9673 dissect_gtpv2(new_p_tvb, pinfo, tree, NULL);
9674 decrement_dissection_depth(pinfo);
9677 return tvb_captured_length(tvb);
9680 void proto_register_gtpv2(void)
9682 unsigned i, last_offset;
9684 static hf_register_info hf_gtpv2[] = {
9685 { &hf_gtpv2_response_in,
9686 { "Response In", "gtpv2.response_in",
9687 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
9688 "The response to this GTP request is in this frame", HFILL }
9690 { &hf_gtpv2_response_to,
9691 { "Response To", "gtpv2.response_to",
9692 FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
9693 "This is a response to the GTP request in this frame", HFILL }
9695 { &hf_gtpv2_response_time,
9696 { "Response Time", "gtpv2.response_time",
9697 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
9698 "The time between the Request and the Response", HFILL }
9700 { &hf_gtpv2_spare_half_octet,
9701 {"Spare half octet", "gtpv2.spare_half_octet",
9702 FT_UINT8, BASE_DEC, NULL, 0x0,
9703 NULL, HFILL }
9705 { &hf_gtpv2_spare_bits,
9706 {"Spare bit(s)", "gtpv2.spare_bits",
9707 FT_UINT8, BASE_DEC, NULL, 0x0,
9708 NULL, HFILL }
9710 //{ &hf_gtpv2_spare_b7_b1,
9711 // {"Spare bit(s)", "gtpv2.spare_b7_b1",
9712 // FT_UINT8, BASE_DEC, NULL, 0xfe,
9713 // NULL, HFILL }
9714 //},
9715 { &hf_gtpv2_spare_b7_b2,
9716 { "Spare", "gtpv2.spare.b7_b2",
9717 FT_UINT8, BASE_HEX, NULL, 0xfc,
9718 NULL, HFILL }
9720 { &hf_gtpv2_spare_b7_b3,
9721 {"Spare bit(s)", "gtpv2.spare_b7_b3",
9722 FT_UINT8, BASE_DEC, NULL, 0xf8,
9723 NULL, HFILL }
9725 { &hf_gtpv2_spare_b7_b4,
9726 { "Spare", "gtpv2.spare.b7_b4",
9727 FT_UINT8, BASE_HEX, NULL, 0xf0,
9728 NULL, HFILL }
9730 { &hf_gtpv2_spare_b7_b5,
9731 { "Spare", "gtpv2.spare.b7_b5",
9732 FT_UINT8, BASE_HEX, NULL, 0xe0,
9733 NULL, HFILL }
9735 {&hf_gtpv2_flags,
9736 {"Flags", "gtpv2.flags",
9737 FT_UINT8, BASE_HEX, NULL, 0x0,
9738 NULL, HFILL}
9740 {&hf_gtpv2_version,
9741 {"Version", "gtpv2.version",
9742 FT_UINT8, BASE_DEC, NULL, 0xe0,
9743 NULL, HFILL}
9745 {&hf_gtpv2_p,
9746 {"Piggybacking flag (P)", "gtpv2.p",
9747 FT_UINT8, BASE_DEC, NULL, 0x10,
9748 "If Piggybacked message is present or not", HFILL}
9750 { &hf_gtpv2_t,
9751 {"TEID flag (T)", "gtpv2.t",
9752 FT_UINT8, BASE_DEC, NULL, 0x08,
9753 "If TEID field is present or not", HFILL}
9755 { &hf_gtpv2_mp,
9756 {"Message Priority(MP)", "gtpv2.mp",
9757 FT_UINT8, BASE_DEC, NULL, 0x04,
9758 "If Message Priority field is present or not", HFILL}
9760 { &hf_gtpv2_message_type,
9761 {"Message Type", "gtpv2.message_type",
9762 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_message_type_vals_ext, 0x0,
9763 NULL, HFILL}
9765 { &hf_gtpv2_msg_length,
9766 {"Message Length", "gtpv2.msg_length",
9767 FT_UINT16, BASE_DEC, NULL, 0x0,
9768 NULL, HFILL}
9770 { &hf_gtpv2_teid,
9771 {"Tunnel Endpoint Identifier", "gtpv2.teid",
9772 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
9773 "TEID", HFILL}
9775 { &hf_gtpv2_seq,
9776 {"Sequence Number", "gtpv2.seq",
9777 FT_UINT24, BASE_HEX_DEC, NULL, 0x0,
9778 "SEQ", HFILL}
9780 { &hf_gtpv2_msg_prio,
9781 {"Message Priority", "gtpv2.mp",
9782 FT_UINT8, BASE_HEX_DEC, NULL, 0xf0,
9783 NULL, HFILL}
9785 { &hf_gtpv2_spare,
9786 {"Spare", "gtpv2.spare",
9787 FT_UINT16, BASE_DEC, NULL, 0x0,
9788 NULL, HFILL}
9790 { &hf_gtpv2_spare_w0,
9791 { "Spare", "gtpv2.spare.w0",
9792 FT_UINT8, BASE_DEC, NULL, 0x0,
9793 NULL, HFILL }
9795 { &hf_gtpv2_ie,
9796 {"IE Type", "gtpv2.ie_type",
9797 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_element_type_vals_ext, 0x0,
9798 NULL, HFILL}
9800 { &hf_gtpv2_ie_len,
9801 {"IE Length", "gtpv2.ie_len",
9802 FT_UINT16, BASE_DEC, NULL, 0x0,
9803 "length of the information element excluding the first four octets", HFILL}
9805 { &hf_gtpv2_cr,
9806 {"CR flag", "gtpv2.cr",
9807 FT_UINT8, BASE_DEC, NULL, 0xf0, /* SRVCC */
9808 NULL, HFILL}
9810 { &hf_gtpv2_instance,
9811 {"Instance", "gtpv2.instance",
9812 FT_UINT8, BASE_DEC, NULL, 0x0f,
9813 NULL, HFILL}
9815 { &hf_gtpv2_ipv4_addr,
9816 {"IPv4 Address", "gtpv2.ipv4_addr",
9817 FT_IPv4, BASE_NONE, NULL, 0x0,
9818 NULL, HFILL}
9820 { &hf_gtpv2_cause,
9821 {"Cause", "gtpv2.cause",
9822 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_cause_vals_ext, 0x0,
9823 NULL, HFILL}
9825 {&hf_gtpv2_cause_cs,
9826 {"CS (Cause Source)", "gtpv2.cs",
9827 FT_BOOLEAN, 8, TFS(&gtpv2_cause_cs), 0x01,
9828 NULL, HFILL}
9830 { &hf_gtpv2_cause_bce,
9831 {"BCE (Bearer Context IE Error)", "gtpv2.bce",
9832 FT_BOOLEAN, 8, NULL, 0x02,
9833 NULL, HFILL}
9835 { &hf_gtpv2_cause_pce,
9836 {"PCE (PDN Connection IE Error)", "gtpv2.pce",
9837 FT_BOOLEAN, 8, NULL, 0x04,
9838 NULL, HFILL}
9840 { &hf_gtpv2_cause_off_ie_t,
9841 {"Type of the offending IE", "gtpv2.cause_off_ie_t",
9842 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_element_type_vals_ext, 0x0,
9843 NULL, HFILL}
9845 { &hf_gtpv2_rec,
9846 {"Restart Counter", "gtpv2.rec",
9847 FT_UINT8, BASE_DEC, NULL, 0x0,
9848 NULL, HFILL}
9850 /*Start SRVCC Messages*/
9851 { &hf_gtpv2_stn_sr,
9852 {"STN-SR", "gtpv2.stn_sr",
9853 FT_BYTES, BASE_NONE, NULL, 0x0,
9854 NULL, HFILL}
9856 { &hf_gtpv2_len_trans_con,
9857 {"Length of the Transparent Container", "gtpv2.len_trans_con",
9858 FT_UINT8, BASE_DEC, NULL, 0x0,
9859 NULL, HFILL}
9861 { &hf_gtpv2_eksi,
9862 {"eKSI", "gtpv2.eksi",
9863 FT_UINT8, BASE_DEC, NULL, 0x07,
9864 NULL, HFILL}
9866 { &hf_gtpv2_ck,
9867 {"CK", "gtpv2.ck",
9868 FT_BYTES, BASE_NONE, NULL, 0x0,
9869 NULL, HFILL}
9871 { &hf_gtpv2_ik,
9872 {"IK", "gtpv2.ik",
9873 FT_BYTES, BASE_NONE, NULL, 0x0,
9874 NULL, HFILL}
9876 { &hf_gtpv2_len_ms_classmark2,
9877 {"Length of Mobile Station Classmark2", "gtpv2.len_ms_classmark2",
9878 FT_UINT8, BASE_DEC, NULL, 0x0,
9879 NULL, HFILL}
9881 { &hf_gtpv2_len_ms_classmark3,
9882 {"Length of Mobile Station Classmark3", "gtpv2.len_ms_classmark3",
9883 FT_UINT8, BASE_DEC, NULL, 0x0,
9884 NULL, HFILL}
9886 { &hf_gtpv2_len_supp_codec_list,
9887 {"Length of Supported Codec List", "gtpv2.len_supp_codec_list",
9888 FT_UINT8, BASE_DEC, NULL, 0x0,
9889 NULL, HFILL}
9891 { &hf_gtpv2_ksi,
9892 {"KSI'cs", "gtpv2.ksi",
9893 FT_UINT8, BASE_DEC, NULL, 0x0F,
9894 NULL, HFILL}
9896 { &hf_gtpv2_cksn,
9897 {"CKSN'", "gtpv2.cksn",
9898 FT_UINT8, BASE_DEC, NULL, 0x0,
9899 NULL, HFILL}
9901 { &hf_gtpv2_srvcc_cause,
9902 {"SRVCC Cause", "gtpv2.srvcc_cause",
9903 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_srvcc_cause_vals_ext, 0x0,
9904 NULL, HFILL}
9906 {&hf_gtpv2_rac,
9907 { "Routing Area Code (RAC)", "gtpv2.rac",
9908 FT_UINT8, BASE_DEC, NULL, 0,
9909 NULL, HFILL}
9912 { &hf_gtpv2_rnc_id,
9913 {"RNC ID", "gtpv2.rnc_id",
9914 FT_UINT16, BASE_DEC, NULL, 0x0,
9915 NULL, HFILL}
9917 { &hf_gtpv2_ext_rnc_id,
9918 {"Extended RNC-ID", "gtpv2.ext_rnc_id",
9919 FT_UINT16, BASE_DEC, NULL, 0x0,
9920 NULL, HFILL}
9922 { &hf_gtpv2_lac,
9923 { "Location Area Code (LAC)", "gtpv2.lac",
9924 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
9925 NULL, HFILL }
9927 { &hf_gtpv2_sac,
9928 { "Service Area Code (SAC)", "gtpv2.sac",
9929 FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
9930 NULL, HFILL }
9932 { &hf_gtpv2_tgt_g_cell_id,
9933 {"Cell ID", "gtpv2.tgt_g_cell_id",
9934 FT_UINT16, BASE_DEC, NULL, 0x0,
9935 NULL, HFILL}
9937 {&hf_gtpv2_teid_c,
9938 {"Tunnel Endpoint Identifier for Control Plane(TEID-C)", "gtpv2.teid_c",
9939 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
9940 NULL, HFILL}
9942 {&hf_gtpv2_sv_sti,
9943 {"STI (Session Transfer Indicator)", "gtpv2.sv_sti",
9944 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
9946 {&hf_gtpv2_sv_ics,
9947 {"ICS (IMS Centralized Service)", "gtpv2.sv_ics",
9948 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
9950 {&hf_gtpv2_sv_emind,
9951 {"EmInd(Emergency Indicator)", "gtpv2.sv_emind",
9952 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
9955 /*End SRVCC Messages*/
9956 {&hf_gtpv2_apn,
9957 {"APN (Access Point Name)", "gtpv2.apn",
9958 FT_STRING, BASE_NONE, NULL, 0x0,
9959 NULL, HFILL}
9961 {&hf_gtpv2_ambr_up,
9962 {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
9963 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
9964 NULL, HFILL}
9966 {&hf_gtpv2_ambr_down,
9967 {"AMBR Downlink (Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
9968 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
9969 NULL, HFILL}
9971 {&hf_gtpv2_ebi,
9972 {"EPS Bearer ID (EBI)", "gtpv2.ebi",
9973 FT_UINT8, BASE_DEC, NULL, 0x0f,
9974 NULL, HFILL}
9976 { &hf_gtpv2_ip_address_ipv4,
9977 {"IP address IPv4", "gtpv2.ip_address_ipv4",
9978 FT_IPv4, BASE_NONE, NULL, 0x0,
9979 NULL, HFILL}
9981 { &hf_gtpv2_ip_address_ipv6,
9982 {"IP address IPv6", "gtpv2.ip_address_ipv6",
9983 FT_IPv6, BASE_NONE, NULL, 0x0,
9984 NULL, HFILL}
9986 {&hf_gtpv2_mei,
9987 {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
9988 FT_STRING, BASE_NONE, NULL, 0,
9989 NULL, HFILL}
9991 { &hf_gtpv2_pdn_numbers_nsapi,
9992 {"NSAPI", "gtpv2.pdn_numbers_nsapi",
9993 FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}
9995 { &hf_gtpv2_p_tmsi,
9996 {"Packet TMSI (P-TMSI)", "gtpv2.p_tmsi",
9997 FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}
9999 { &hf_gtpv2_p_tmsi_sig,
10000 {"P-TMSI Signature", "gtpv2.p_tmsi_sig",
10001 FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
10003 {&hf_gtpv2_daf,
10004 {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
10005 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10007 {&hf_gtpv2_dtf,
10008 {"DTF (Direct Tunnel Flag)", "gtpv2.dtf",
10009 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10011 {&hf_gtpv2_hi,
10012 {"HI (Handover Indication)", "gtpv2.hi",
10013 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10015 {&hf_gtpv2_dfi,
10016 {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
10017 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10019 {&hf_gtpv2_oi,
10020 {"OI (Operation Indication)", "gtpv2.oi",
10021 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10023 {&hf_gtpv2_isrsi,
10024 {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
10025 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10027 {&hf_gtpv2_israi,
10028 {"ISRAI (Idle mode Signalling Reduction Activation Indication)", "gtpv2.israi",
10029 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10031 {&hf_gtpv2_sgwci,
10032 {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
10033 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10035 {&hf_gtpv2_sqci,
10036 {"SQCI (Subscribed QoS Change Indication)", "gtpv2.sqci",
10037 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10039 {&hf_gtpv2_uimsi,
10040 {"UIMSI (Unauthenticated IMSI)", "gtpv2.uimsi",
10041 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10043 {&hf_gtpv2_cfsi,
10044 {"CFSI (Change F-TEID support indication)", "gtpv2.cfsi",
10045 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10047 {&hf_gtpv2_crsi,
10048 {"CRSI (Change Reporting support indication)", "gtpv2.crsi",
10049 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10051 {&hf_gtpv2_ps,
10052 {"PS (Piggybacking Supported)", "gtpv2.ps",
10053 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10055 {&hf_gtpv2_pt,
10056 {"PT (Protocol Type)", "gtpv2.pt",
10057 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10059 {&hf_gtpv2_si,
10060 {"SI (Scope Indication)", "gtpv2.si",
10061 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10063 {&hf_gtpv2_msv,
10064 {"MSV (MS Validated)", "gtpv2.msv",
10065 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10067 {&hf_gtpv2_retloc,
10068 {"RetLoc (Retrieve Location Indication Flag)", "gtpv2.retloc",
10069 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10071 {&hf_gtpv2_pbic,
10072 {"PBIC (Propagate BBAI Information Change)", "gtpv2.pbic",
10073 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10075 {&hf_gtpv2_srni,
10076 {"SRNI (SGW Restoration Needed Indication)", "gtpv2.snri",
10077 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10079 {&hf_gtpv2_s6af,
10080 {"S6AF (Static IPv6 Address Flag)", "gtpv2.s6af",
10081 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10083 {&hf_gtpv2_s4af,
10084 {"S4AF (Static IPv4 Address Flag)", "gtpv2.s4af",
10085 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10087 {&hf_gtpv2_mbmdt,
10088 {"MBMDT (Management Based MDT allowed flag)", "gtpv2.mbmdt",
10089 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10091 {&hf_gtpv2_israu,
10092 {"ISRAU (ISR is activated for the UE)", "gtpv2.israu",
10093 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10095 {&hf_gtpv2_ccrsi,
10096 {"CCRSI (CSG Change Reporting support indication)", "gtpv2.ccrsi",
10097 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10100 {&hf_gtpv2_cprai,
10101 {"CPRAI (Change of Presence Reporting Area information Indication)", "gtpv2.cprai",
10102 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10104 {&hf_gtpv2_arrl,
10105 {"ARRL (Abnormal Release of Radio Link)", "gtpv2.arrl",
10106 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10108 {&hf_gtpv2_ppof,
10109 {"PPOFF (PDN Pause Off Indication)", "gtpv2.ppof",
10110 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10112 {&hf_gtpv2_ppon_ppei,
10113 {"PPON (PDN Pause On Indication) / PPEI (PDN Pause Enabled Indication)", "gtpv2.ppon_ppei",
10114 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10116 {&hf_gtpv2_ppsi,
10117 {"PPSI (PDN Pause Support Indication)", "gtpv2.ppsi",
10118 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10120 {&hf_gtpv2_csfbi,
10121 {"CSFBI (CSFB Indication)", "gtpv2.csfbi",
10122 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10124 {&hf_gtpv2_clii,
10125 {"CLII (Change of Location Information Indication)", "gtpv2.clii",
10126 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10128 {&hf_gtpv2_cpsr,
10129 {"CPSR (CS to PS SRVCC Indication)", "gtpv2.cpsr",
10130 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10132 {&hf_gtpv2_nsi,
10133 {"NSI (NBIFOM Support Indication)", "gtpv2.nsi",
10134 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10136 {&hf_gtpv2_uasi,
10137 {"UASI (UE Available for Signalling Indication)", "gtpv2.uasi",
10138 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10140 {&hf_gtpv2_dtci,
10141 {"DTCI (Delay Tolerant Connection Indication)", "gtpv2.dtci",
10142 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10144 {&hf_gtpv2_bdwi,
10145 {"BDWI (Buffered DL Data Waiting Indication)", "gtpv2.bdwi",
10146 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10148 {&hf_gtpv2_psci,
10149 {"PSCI (Pending Subscription Change Indication)", "gtpv2.psci",
10150 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10152 {&hf_gtpv2_pcri,
10153 {"PCRI (P-CSCF Restoration Indication)", "gtpv2.pcri",
10154 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10156 {&hf_gtpv2_aosi,
10157 {"AOSI (Associate OCI with SGW node's Identity)", "gtpv2.aosi",
10158 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10160 {&hf_gtpv2_aopi,
10161 {"AOPI (Associate OCI with PGW node's Identity)", "gtpv2.aopi",
10162 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10164 {&hf_gtpv2_roaai,
10165 {"ROAAI (Release Over Any Access Indication)", "gtpv2.roaai",
10166 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10168 {&hf_gtpv2_epcosi,
10169 {"EPCOSI (Extended PCO Support Indication)", "gtpv2.epcosi",
10170 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10172 {&hf_gtpv2_cpopci,
10173 {"CPOPCI (Control Plane Only PDN Connection Indication)", "gtpv2.cpopci",
10174 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10176 {&hf_gtpv2_pmtsmi,
10177 {"PMTSMI (Pending MT Short Message Indication)", "gtpv2.pmtsmi",
10178 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10180 {&hf_gtpv2_s11tf,
10181 {"S11TF (S11-U Tunnel Flag)", "gtpv2.s11tf",
10182 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10184 {&hf_gtpv2_pnsi,
10185 {"PNSI (Pending Network Initiated PDN Connection Signalling Indication)", "gtpv2.pnsi",
10186 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10188 {&hf_gtpv2_unaccsi,
10189 {"UNACCSI (UE Not Authorized Cause Code Support Indication)", "gtpv2.unaccsi",
10190 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10192 {&hf_gtpv2_wpmsi,
10193 {"WPMSI (WLCP PDN Connection Modification Support Indication)", "gtpv2.wpmsi",
10194 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10196 {&hf_gtpv2_5gsnn26,
10197 { "5GSNN26 (5GS Interworking without N26 Indication)", "gtpv2.5gsnn26",
10198 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }
10200 {&hf_gtpv2_reprefi,
10201 { "REPREFI (Return Preferred Indication)", "gtpv2.reprefi",
10202 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }
10204 {&hf_gtpv2_5gsiwk,
10205 { "5GSIWKI (5GS Interworking Indication)", "gtpv2.5gsiwk",
10206 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }
10208 {&hf_gtpv2_eevrsi,
10209 { "EEVRSI (Extended EBI Value Range Support Indication)", "gtpv2.eevrsi",
10210 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }
10212 {&hf_gtpv2_ltemui,
10213 { "LTEMUI (LTE-M UE Indication)", "gtpv2.ltemui",
10214 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }
10216 {&hf_gtpv2_ltempi,
10217 { "LTEMPI (LTE-M RAT Type reporting to PGW Indication)", "gtpv2.ltempi",
10218 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }
10220 {&hf_gtpv2_enbcrsi,
10221 {"ENBCRSI (eNB Change Reporting Support Indication)", "gtpv2.enbcrsi",
10222 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10224 {&hf_gtpv2_tspcmi,
10225 {"TSPCMI (Triggering SGSN Initiated PDP Context Creation/Modification Indication)", "gtpv2.tspcmi",
10226 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10228 {&hf_gtpv2_csrmfi,
10229 { "CSRMFI (Create Session Request Message Forwarded Indication)", "gtpv2.csrmfi",
10230 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }
10232 {&hf_gtpv2_mtedtn,
10233 { "MTEDTN (MT-EDT Not Applicable)", "gtpv2.mtedtn",
10234 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x40, NULL, HFILL }
10237 {&hf_gtpv2_mtedta,
10238 { "MTEDTA (MT-EDT Applicable)", "gtpv2.mtedta",
10239 FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x20, NULL, HFILL }
10242 {&hf_gtpv2_n5gnmi,
10243 { "N5GNMI (No 5GS N26 Mobility Indication)", "gtpv2.n5gnmi",
10244 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }
10246 { &hf_gtpv2_5gcnrs,
10247 { "5GCNRS (5GC Not Restricted Support)", "gtpv2.5gcnrs",
10248 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08, NULL, HFILL }
10250 { &hf_gtpv2_5gcnri,
10251 { "5GCNRI (5GC Not Restricted Indication)", "gtpv2.5gcnri",
10252 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }
10254 { &hf_gtpv2_5srhoi,
10255 { "5SRHOI (5G-SRVCC HO Indication)", "gtpv2.5srhoi",
10256 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }
10258 { &hf_gtpv2_ethpdn,
10259 {"ETHPDN (Ethernet PDN Support Indication)", "gtpv2.ethpdn",
10260 FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL}
10262 { &hf_gtpv2_nspusi,
10263 {"NSPUSI (Notify Start of Pause of Charging via User plane Support Indication)", "gtpv2.nspusi",
10264 FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10266 { &hf_gtpv2_pgwrnsi,
10267 {"PGWRNSI (PGW Redirection due to mismatch with Network Slice subscribed by UE Support Indication)", "gtpv2.pgwrnsi",
10268 FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10270 { &hf_gtpv2_rppcsi,
10271 {"RPPCSI (Restoration of PDN connections after an PGW-C/SMF change Support Indication)", "gtpv2.rppcsi",
10272 FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10274 { &hf_gtpv2_pgwchi,
10275 {"PGWCHI (PGW CHange Indication)", "gtpv2.pgwchi",
10276 FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10278 { &hf_gtpv2_sissme,
10279 {"SISSME (Same IWK-SCEF Selected for Monitoring Event Indication)", "gtpv2.sissme",
10280 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10282 { &hf_gtpv2_nsenbi,
10283 {"NSENBI (Notify Source eNodeB Indication)", "gtpv2.nsenbi",
10284 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10286 { &hf_gtpv2_idfupf,
10287 {"IDFUPF (Indirect Data Forwarding with UPF Indication)", "gtpv2.idfupf",
10288 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10290 { &hf_gtpv2_emci,
10291 {"EMCI (Emergency PDU Session Indication)", "gtpv2.emci",
10292 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10294 { &hf_gtpv2_lapcosi,
10295 {"LAPCOSI (Large Additional Protocol Configuration Options Support Indication)", "gtpv2.lapcosi",
10296 FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10298 { &hf_gtpv2_ltemsai,
10299 {"LTEMSAI (LTE-M Satellite Access Indication)", "gtpv2.ltemsai",
10300 FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10302 { &hf_gtpv2_srtpi,
10303 {"SRTPI (Satellite RAT Type reporting to PGW Indication)", "gtpv2.srtpi",
10304 FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10306 { &hf_gtpv2_upipsi,
10307 {"UPIPSI (User Plane Integrity Protection Support Indication)", "gtpv2.upipsi",
10308 FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10312 { &hf_gtpv2_pdn_type,
10313 {"PDN Type", "gtpv2.pdn_type",
10314 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_pdn_type_vals_ext, 0x07,
10315 NULL, HFILL}
10317 #if 0
10318 { &hf_gtpv2_tra_info,
10319 {"Trace ID", "gtpv2.tra_info",
10320 FT_STRING, BASE_NONE, NULL, 0x0,
10321 NULL, HFILL}
10323 #endif
10324 { &hf_gtpv2_tra_info_msc_momt_calls,
10325 {"MO and MT calls", "gtpv2.tra_info_msc_momt_calls",
10326 FT_UINT8, BASE_DEC, NULL, 0x01,
10327 "MSC Server", HFILL}
10329 { &hf_gtpv2_tra_info_msc_momt_sms,
10330 {"MO and MT SMS", "gtpv2.tra_info_msc_momt_sms",
10331 FT_UINT8, BASE_DEC, NULL, 0x02,
10332 "MSC Server", HFILL}
10334 { &hf_gtpv2_tra_info_msc_lu_imsi_ad,
10335 {"LU, IMSI attach, IMSI detach", "gtpv2.tra_info_msc_lu_imsi_ad",
10336 FT_UINT8, BASE_DEC, NULL, 0x04,
10337 "MSC Server", HFILL}
10339 { &hf_gtpv2_tra_info_msc_handovers,
10340 {"Handovers", "gtpv2.tra_info_msc_handovers",
10341 FT_UINT8, BASE_DEC, NULL, 0x08,
10342 "MSC Server", HFILL}
10344 { &hf_gtpv2_tra_info_msc_ss,
10345 {"SS", "gtpv2.tra_info_msc_ss",
10346 FT_UINT8, BASE_DEC, NULL, 0x10,
10347 "MSC Server", HFILL}
10349 { &hf_gtpv2_tra_info_mgw_context,
10350 {"Context", "gtpv2.tra_info_mgw_context",
10351 FT_UINT8, BASE_DEC, NULL, 0x01,
10352 "MGW", HFILL}
10354 { &hf_gtpv2_tra_info_sgsn_pdp_context,
10355 {"PDP context", "gtpv2.tra_info_sgsn_pdp_context",
10356 FT_UINT8, BASE_DEC, NULL, 0x01,
10357 "SGSN", HFILL}
10359 { &hf_gtpv2_tra_info_sgsn_momt_sms,
10360 {"MO and MT SMS", "gtpv2.tra_info_sgsn_momt_sms",
10361 FT_UINT8, BASE_DEC, NULL, 0x02,
10362 "SGSN", HFILL}
10364 { &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
10365 {"RAU, GPRS attach, GPRS detach", "gtpv2.tra_info_sgsn_rau_gprs_ad",
10366 FT_UINT8, BASE_DEC, NULL, 0x04,
10367 "SGSN", HFILL}
10369 { &hf_gtpv2_tra_info_sgsn_mbms,
10370 {"MBMS Context", "gtpv2.tra_info_sgsn_mbms",
10371 FT_UINT8, BASE_DEC, NULL, 0x08,
10372 "SGSN", HFILL}
10374 { &hf_gtpv2_tra_info_sgsn_reserved,
10375 {"Reserved", "gtpv2.tra_info_sgsn_reserved",
10376 FT_UINT8, BASE_DEC, NULL, 0x0,
10377 "SGSN", HFILL}
10379 { &hf_gtpv2_tra_info_ggsn_pdp,
10380 {"PDP Context", "gtpv2.tra_info_ggsn_pdp",
10381 FT_UINT8, BASE_DEC, NULL, 0x01,
10382 "GGSN", HFILL}
10384 { &hf_gtpv2_tra_info_ggsn_mbms,
10385 {"MBMS Context", "gtpv2.tra_info_ggsn_mbms",
10386 FT_UINT8, BASE_DEC, NULL, 0x02,
10387 "GGSN", HFILL}
10389 { &hf_gtpv2_tra_info_bm_sc,
10390 {"MBMS Multicast service activation", "gtpv2.tra_info_bm_sc",
10391 FT_UINT8, BASE_DEC, NULL, 0x01,
10392 "BM-SC", HFILL}
10394 { &hf_gtpv2_tra_info_mme_sgw_ss,
10395 {"Session setup", "gtpv2.tra_info_mme_sgw_ss",
10396 FT_UINT8, BASE_DEC, NULL, 0x01,
10397 "MME", HFILL}
10399 { &hf_gtpv2_tra_info_mme_sgw_sr,
10400 {"Service Request", "gtpv2.tra_info_mme_sgw_sr",
10401 FT_UINT8, BASE_DEC, NULL, 0x02,
10402 "MME", HFILL}
10404 { &hf_gtpv2_tra_info_mme_sgw_iataud,
10405 {"Initial Attach, Tracking area update, Detach", "gtpv2.tra_info_mme_sgw_iataud",
10406 FT_UINT8, BASE_DEC, NULL, 0x04,
10407 "MME", HFILL}
10409 { &hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc,
10410 {"UE initiated PDN disconnection", "gtpv2.tra_info_mme_sgw_ue_init_pdn_disc",
10411 FT_UINT8, BASE_DEC, NULL, 0x08,
10412 "MME", HFILL}
10414 { &hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del,
10415 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_mme_sgw_bearer_act_mod_del",
10416 FT_UINT8, BASE_DEC, NULL, 0x10,
10417 "MME", HFILL}
10419 { &hf_gtpv2_tra_info_mme_sgw_ho,
10420 {"Handover", "gtpv2.tra_info_mme_sgw_ho",
10421 FT_UINT8, BASE_DEC, NULL, 0x20,
10422 "MME", HFILL}
10424 { &hf_gtpv2_tra_info_sgw_pdn_con_creat,
10425 {"PDN Connection creation", "gtpv2.tra_info_sgw_pdn_con_creat",
10426 FT_UINT8, BASE_DEC, NULL, 0x01,
10427 "SGW", HFILL}
10429 { &hf_gtpv2_tra_info_sgw_pdn_con_term,
10430 {"PDN connection termination", "gtpv2.tra_info_sgw_pdn_con_term",
10431 FT_UINT8, BASE_DEC, NULL, 0x02,
10432 "SGW", HFILL}
10434 { &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
10435 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_sgw_bearer_act_mod_del",
10436 FT_UINT8, BASE_DEC, NULL, 0x04,
10437 "SGW", HFILL}
10439 { &hf_gtpv2_tra_info_pgw_pdn_con_creat,
10440 {"PDN Connection creation", "gtpv2.tra_info_pgw_pdn_con_creat",
10441 FT_UINT8, BASE_DEC, NULL, 0x10,
10442 "PGW", HFILL}
10444 { &hf_gtpv2_tra_info_pgw_pdn_con_term,
10445 {"PDN connection termination", "gtpv2.tra_info_pgw_pdn_con_term",
10446 FT_UINT8, BASE_DEC, NULL, 0x20,
10447 "PGW", HFILL}
10449 { &hf_gtpv2_tra_info_pgw_bearer_act_mod_del,
10450 {"Bearer Activation Modification Deletion", "gtpv2.tra_info_pgw_bearer_act_mod_del",
10451 FT_UINT8, BASE_DEC, NULL, 0x40,
10452 "PGW", HFILL}
10454 { &hf_gtpv2_tra_info_lne_msc_s,
10455 {"MSC-S", "gtpv2.tra_info_lne_msc_s",
10456 FT_BOOLEAN, 8, NULL, 0x01,
10457 NULL, HFILL}
10459 { &hf_gtpv2_tra_info_lne_mgw,
10460 {"MGW", "gtpv2.tra_info_lne_mgw",
10461 FT_BOOLEAN, 8, NULL, 0x02,
10462 NULL, HFILL}
10464 { &hf_gtpv2_tra_info_lne_sgsn,
10465 {"SGSN", "gtpv2.tra_info_lne_sgsn",
10466 FT_BOOLEAN, 8, NULL, 0x04,
10467 NULL, HFILL}
10469 { &hf_gtpv2_tra_info_lne_ggsn,
10470 {"GGSN", "gtpv2.tra_info_lne_ggsn",
10471 FT_BOOLEAN, 8, NULL, 0x08,
10472 NULL, HFILL}
10474 { &hf_gtpv2_tra_info_lne_rnc,
10475 {"RNC", "gtpv2.tra_info_lne_rnc",
10476 FT_UINT8, BASE_DEC, NULL, 0x10,
10477 NULL, HFILL}
10479 { &hf_gtpv2_tra_info_lne_bm_sc,
10480 {"BM-SC", "gtpv2.tra_info_lne_bm_sc",
10481 FT_BOOLEAN, 8, NULL, 0x20,
10482 NULL, HFILL}
10484 { &hf_gtpv2_tra_info_lne_mme,
10485 {"MME", "gtpv2.tra_info_lne_mme",
10486 FT_BOOLEAN, 8, NULL, 0x40,
10487 NULL, HFILL}
10489 { &hf_gtpv2_tra_info_lne_sgw,
10490 {"SGW", "gtpv2.tra_info_lne_sgw",
10491 FT_BOOLEAN, 8, NULL, 0x80,
10492 NULL, HFILL}
10494 { &hf_gtpv2_tra_info_lne_pdn_gw,
10495 {"PDN GW", "gtpv2.tra_info_lne_pdn_gw",
10496 FT_BOOLEAN, 8, NULL, 0x01,
10497 NULL, HFILL}
10499 { &hf_gtpv2_tra_info_lne_enb,
10500 {"eNB", "gtpv2.tra_info_lne_enb",
10501 FT_BOOLEAN, 8, NULL, 0x02,
10502 NULL, HFILL}
10504 { &hf_gtpv2_tra_info_lne_amf,
10505 {"AMF", "gtpv2.tra_info_lne_amf",
10506 FT_BOOLEAN, 8, NULL, 0x04,
10507 NULL, HFILL}
10509 { &hf_gtpv2_tra_info_lne_smf,
10510 {"SMF", "gtpv2.tra_info_lne_smf",
10511 FT_BOOLEAN, 8, NULL, 0x08,
10512 NULL, HFILL}
10514 { &hf_gtpv2_tra_info_lne_pcf,
10515 {"PCF", "gtpv2.tra_info_lne_pcf",
10516 FT_BOOLEAN, 8, NULL, 0x10,
10517 NULL, HFILL}
10519 { &hf_gtpv2_tra_info_lne_upf,
10520 {"UPF", "gtpv2.tra_info_lne_upf",
10521 FT_BOOLEAN, 8, NULL, 0x20,
10522 NULL, HFILL}
10524 { &hf_gtpv2_tra_info_tra_info_ng_ran_node,
10525 {"NG-RAN node", "gtpv2.tra_info_ng_ran_node",
10526 FT_BOOLEAN, 8, NULL, 0x40,
10527 NULL, HFILL}
10530 { &hf_gtpv2_tra_info_tdl,
10531 {"Trace Depth Length", "gtpv2.tra_info_tdl",
10532 FT_UINT8, BASE_DEC, NULL, 0x0,
10533 NULL, HFILL}
10535 { &hf_gtpv2_tra_info_lmsc_a,
10536 {"A", "gtpv2.tra_info_lmsc_a",
10537 FT_UINT8, BASE_DEC, NULL, 0x01,
10538 "MSC Server", HFILL}
10540 { &hf_gtpv2_tra_info_lmsc_lu,
10541 {"Iu", "gtpv2.tra_info_lmsc_lu",
10542 FT_UINT8, BASE_DEC, NULL, 0x02,
10543 "MSC Server", HFILL}
10545 { &hf_gtpv2_tra_info_lmsc_mc,
10546 {"Mc", "gtpv2.tra_info_lmsc_mc",
10547 FT_UINT8, BASE_DEC, NULL, 0x04,
10548 "MSC Server", HFILL}
10550 { &hf_gtpv2_tra_info_lmsc_map_g,
10551 {"MAP-G", "gtpv2.tra_info_lmsc_map_g",
10552 FT_UINT8, BASE_DEC, NULL, 0x08,
10553 "MSC Server", HFILL}
10555 { &hf_gtpv2_tra_info_lmsc_map_b,
10556 {"MAP-B", "gtpv2.tra_info_lmsc_map_b",
10557 FT_UINT8, BASE_DEC, NULL, 0x10,
10558 "MSC Server", HFILL}
10560 { &hf_gtpv2_tra_info_lmsc_map_e,
10561 {"MAP-E", "gtpv2.tra_info_lmsc_map_e",
10562 FT_UINT8, BASE_DEC, NULL, 0x20,
10563 "MSC Server", HFILL}
10565 { &hf_gtpv2_tra_info_lmsc_map_f,
10566 {"MAP-F", "gtpv2.tra_info_lmsc_map_f",
10567 FT_UINT8, BASE_DEC, NULL, 0x40,
10568 "MSC Server", HFILL}
10570 { &hf_gtpv2_tra_info_lmsc_cap,
10571 {"CAP", "gtpv2.tra_info_lmsc_cap",
10572 FT_UINT8, BASE_DEC, NULL, 0x80,
10573 "MSC Server", HFILL}
10575 { &hf_gtpv2_tra_info_lmsc_map_d,
10576 {"MAP-D", "gtpv2.tra_info_lmsc_map_d",
10577 FT_UINT8, BASE_DEC, NULL, 0x01,
10578 "MSC Server", HFILL}
10580 { &hf_gtpv2_tra_info_lmsc_map_c,
10581 {"MAP-C", "gtpv2.tra_info_lmsc_map_c",
10582 FT_UINT8, BASE_DEC, NULL, 0x02,
10583 "MSC Server", HFILL}
10585 { &hf_gtpv2_tra_info_lmgw_mc,
10586 {"Mc", "gtpv2.tra_info_lmgw_mc",
10587 FT_UINT8, BASE_DEC, NULL, 0x01,
10588 "MGW", HFILL}
10590 { &hf_gtpv2_tra_info_lmgw_nb_up,
10591 {"Nb-UP", "gtpv2.tra_info_lmgw_nb_up",
10592 FT_UINT8, BASE_DEC, NULL, 0x2,
10593 "MGW", HFILL}
10595 { &hf_gtpv2_tra_info_lmgw_lu_up,
10596 {"Iu-UP", "gtpv2.tra_info_lmgw_lu_up",
10597 FT_UINT8, BASE_DEC, NULL, 0x04,
10598 "MGW", HFILL}
10600 { &hf_gtpv2_tra_info_lsgsn_gb,
10601 {"Gb", "gtpv2.tra_info_lsgsn_gb",
10602 FT_UINT8, BASE_DEC, NULL, 0x01,
10603 "SGSN", HFILL}
10605 { &hf_gtpv2_tra_info_lsgsn_lu,
10606 {"Iu", "gtpv2.tra_info_lsgsn_lu",
10607 FT_UINT8, BASE_DEC, NULL, 0x02,
10608 "SGSN", HFILL}
10610 { &hf_gtpv2_tra_info_lsgsn_gn,
10611 {"Gn", "gtpv2.tra_info_lsgsn_gn",
10612 FT_UINT8, BASE_DEC, NULL, 0x04,
10613 "SGSN", HFILL}
10615 { &hf_gtpv2_tra_info_lsgsn_map_gr,
10616 {"MAP-Gr", "gtpv2.tra_info_lsgsn_map_gr",
10617 FT_UINT8, BASE_DEC, NULL, 0x08,
10618 "SGSN", HFILL}
10620 { &hf_gtpv2_tra_info_lsgsn_map_gd,
10621 {"MAP-Gd", "gtpv2.tra_info_lsgsn_map_gd",
10622 FT_UINT8, BASE_DEC, NULL, 0x10,
10623 "SGSN", HFILL}
10625 { &hf_gtpv2_tra_info_lsgsn_map_gf,
10626 {"MAP-Gf", "gtpv2.tra_info_lsgsn_map_gf",
10627 FT_UINT8, BASE_DEC, NULL, 0x20,
10628 "SGSN", HFILL}
10630 { &hf_gtpv2_tra_info_lsgsn_gs,
10631 {"Gs", "gtpv2.tra_info_lsgsn_gs",
10632 FT_UINT8, BASE_DEC, NULL, 0x40,
10633 "SGSN", HFILL}
10635 { &hf_gtpv2_tra_info_lsgsn_ge,
10636 {"Ge", "gtpv2.tra_info_lsgsn_ge",
10637 FT_UINT8, BASE_DEC, NULL, 0x80,
10638 "SGSN", HFILL}
10640 { &hf_gtpv2_tra_info_lggsn_gn,
10641 {"Gn", "gtpv2.tra_info_lggsn_gn",
10642 FT_UINT8, BASE_DEC, NULL, 0x01,
10643 "GGSN", HFILL}
10645 { &hf_gtpv2_tra_info_lggsn_gi,
10646 {"Gi", "gtpv2.tra_info_lggsn_gi",
10647 FT_UINT8, BASE_DEC, NULL, 0x02,
10648 "GGSN", HFILL}
10650 { &hf_gtpv2_tra_info_lggsn_gmb,
10651 {"Gmb", "gtpv2.tra_info_lggsn_gmb",
10652 FT_UINT8, BASE_DEC, NULL, 0x04,
10653 "GGSN", HFILL}
10655 { &hf_gtpv2_tra_info_lrnc_lu,
10656 {"Iu", "gtpv2.tra_info_lrnc_lu",
10657 FT_UINT8, BASE_DEC, NULL, 0x01,
10658 "RNC", HFILL}
10660 { &hf_gtpv2_tra_info_lrnc_lur,
10661 {"Iur", "gtpv2.tra_info_lrnc_lur",
10662 FT_UINT8, BASE_DEC, NULL, 0x02,
10663 "RNC", HFILL}
10665 { &hf_gtpv2_tra_info_lrnc_lub,
10666 {"Iub", "gtpv2.tra_info_lrnc_lub",
10667 FT_UINT8, BASE_DEC, NULL, 0x04,
10668 "RNC", HFILL}
10670 { &hf_gtpv2_tra_info_lrnc_uu,
10671 {"Uu", "gtpv2.tra_info_lrnc_uu",
10672 FT_UINT8, BASE_DEC, NULL, 0x08,
10673 "RNC", HFILL}
10675 { &hf_gtpv2_tra_info_lbm_sc_gmb,
10676 {"Gmb", "gtpv2.tra_info_lbm_sc_gmb",
10677 FT_UINT8, BASE_DEC, NULL, 0x01,
10678 "BM-SC", HFILL}
10680 { &hf_gtpv2_tra_info_lmme_s1_mme,
10681 {"S1-MME", "gtpv2.tra_info_lmme_s1_mme",
10682 FT_UINT8, BASE_DEC, NULL, 0x01,
10683 "MME", HFILL}
10685 { &hf_gtpv2_tra_info_lmme_s3,
10686 {"S3", "gtpv2.tra_info_lmme_s3",
10687 FT_UINT8, BASE_DEC, NULL, 0x02,
10688 "MME", HFILL}
10690 { &hf_gtpv2_tra_info_lmme_s6a,
10691 {"S6a", "gtpv2.tra_info_lmme_s6a",
10692 FT_UINT8, BASE_DEC, NULL, 0x04,
10693 "MME", HFILL}
10695 { &hf_gtpv2_tra_info_lmme_s10,
10696 {"S10", "gtpv2.tra_info_lmme_s10",
10697 FT_UINT8, BASE_DEC, NULL, 0x08,
10698 "MME", HFILL}
10700 { &hf_gtpv2_tra_info_lmme_s11,
10701 {"S11", "gtpv2.tra_info_lmme_s11",
10702 FT_UINT8, BASE_DEC, NULL, 0x10,
10703 "MME", HFILL}
10705 { &hf_gtpv2_tra_info_lsgw_s4,
10706 {"S4", "gtpv2.tra_info_lsgw_s4",
10707 FT_UINT8, BASE_DEC, NULL, 0x01,
10708 "SGW", HFILL}
10710 { &hf_gtpv2_tra_info_lsgw_s5,
10711 {"S5", "gtpv2.tra_info_lsgw_s5",
10712 FT_UINT8, BASE_DEC, NULL, 0x02,
10713 "SGW", HFILL}
10715 { &hf_gtpv2_tra_info_lsgw_s8b,
10716 {"S8b", "gtpv2.tra_info_lsgw_s8b",
10717 FT_UINT8, BASE_DEC, NULL, 0x04,
10718 "SGW", HFILL}
10720 { &hf_gtpv2_tra_info_lsgw_s11,
10721 {"S11", "gtpv2.tra_info_lsgw_s11",
10722 FT_UINT8, BASE_DEC, NULL, 0x08,
10723 "SGW", HFILL}
10725 { &hf_gtpv2_tra_info_lpdn_gw_s2a,
10726 {"S2a", "gtpv2.tra_info_lpdn_gw_s2a",
10727 FT_UINT8, BASE_DEC, NULL, 0x01,
10728 "PDN GW", HFILL}
10730 { &hf_gtpv2_tra_info_lpdn_gw_s2b,
10731 {"S2b", "gtpv2.tra_info_lpdn_gw_s2b",
10732 FT_UINT8, BASE_DEC, NULL, 0x02,
10733 "PDN GW", HFILL}
10735 { &hf_gtpv2_tra_info_lpdn_gw_s2c,
10736 {"S2c", "gtpv2.tra_info_lpdn_gw_s2c",
10737 FT_UINT8, BASE_DEC, NULL, 0x04,
10738 "PDN GW", HFILL}
10740 { &hf_gtpv2_tra_info_lpdn_gw_s5,
10741 {"S5", "gtpv2.tra_info_lpdn_gw_s5",
10742 FT_UINT8, BASE_DEC, NULL, 0x08,
10743 "PDN GW", HFILL}
10745 { &hf_gtpv2_tra_info_lpdn_gw_s6c,
10746 {"S6c", "gtpv2.tra_info_lpdn_gw_s6c",
10747 FT_UINT8, BASE_DEC, NULL, 0x10,
10748 "PDN GW", HFILL}
10750 { &hf_gtpv2_tra_info_lpdn_gw_gx,
10751 {"Gx", "gtpv2.tra_info_lpdn_gw_gx",
10752 FT_UINT8, BASE_DEC, NULL, 0x20,
10753 "PDN GW", HFILL}
10755 { &hf_gtpv2_tra_info_lpdn_gw_s8b,
10756 {"S8b", "gtpv2.tra_info_lpdn_gw_s8b",
10757 FT_UINT8, BASE_DEC, NULL, 0x40,
10758 "PDN GW", HFILL}
10760 { &hf_gtpv2_tra_info_lpdn_gw_sgi,
10761 {"SGi", "gtpv2.tra_info_lpdn_gw_sgi",
10762 FT_UINT8, BASE_DEC, NULL, 0x80,
10763 "PDN GW", HFILL}
10765 { &hf_gtpv2_tra_info_lenb_s1_mme,
10766 {"S1-MME", "gtpv2.tra_info_lenb_s1_mme",
10767 FT_UINT8, BASE_DEC, NULL, 0x01,
10768 "eNB", HFILL}
10770 { &hf_gtpv2_tra_info_lenb_x2,
10771 {"X2", "gtpv2.tra_info_lenb_x2",
10772 FT_UINT8, BASE_DEC, NULL, 0x02,
10773 "eNB", HFILL}
10775 { &hf_gtpv2_tra_info_lenb_uu,
10776 {"Uu", "gtpv2.tra_info_lenb_uu",
10777 FT_UINT8, BASE_DEC, NULL, 0x04,
10778 "eNB", HFILL}
10780 { &hf_gtpv2_pdn_ipv4,
10781 {"PDN Address and Prefix(IPv4)", "gtpv2.pdn_addr_and_prefix.ipv4",
10782 FT_IPv4, BASE_NONE, NULL, 0x0,
10783 NULL, HFILL}
10785 { &hf_gtpv2_pdn_ipv6_len,
10786 {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
10787 FT_UINT8, BASE_DEC, NULL, 0x0,
10788 NULL, HFILL}
10790 { &hf_gtpv2_pdn_ipv6,
10791 {"PDN Address and Prefix(IPv6)", "gtpv2.pdn_addr_and_prefix.ipv6",
10792 FT_IPv6, BASE_NONE, NULL, 0x0,
10793 NULL, HFILL}
10795 /* Bit 7 - PCI (Pre-emption Capability): See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP.
10796 * clause 5.3.46 Pre-emption-Capability AVP.
10797 * 5.3.46 Pre-emption-Capability AVP
10798 * The following values are defined:
10799 * PRE-EMPTION_CAPABILITY_ENABLED (0)
10800 * PRE-EMPTION_CAPABILITY_DISABLED (1)
10802 {&hf_gtpv2_bearer_qos_pci,
10803 {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
10804 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
10805 NULL, HFILL}
10807 {&hf_gtpv2_bearer_qos_pl,
10808 {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
10809 FT_UINT8, BASE_DEC, NULL, 0x3c,
10810 NULL, HFILL}
10812 /* Bit 1 - PVI (Pre-emption Vulnerability): See 3GPP TS 29.212[29],
10813 * clause 5.3.47 Pre-emption-Vulnerability AVP.
10814 * 5.3.47 Pre-emption-Vulnerability AVP
10815 * The following values are defined:
10816 * PRE-EMPTION_VULNERABILITY_ENABLED (0)
10817 * PRE-EMPTION_VULNERABILITY_DISABLED (1)
10819 {&hf_gtpv2_bearer_qos_pvi,
10820 {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
10821 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
10822 NULL, HFILL}
10824 {&hf_gtpv2_bearer_qos_label_qci,
10825 {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
10826 FT_UINT8, BASE_DEC, NULL, 0x0,
10827 NULL, HFILL}
10829 {&hf_gtpv2_bearer_qos_mbr_up,
10830 {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
10831 FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10832 NULL, HFILL}
10834 {&hf_gtpv2_bearer_qos_mbr_down,
10835 {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
10836 FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10837 NULL, HFILL}
10839 {&hf_gtpv2_bearer_qos_gbr_up,
10840 {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
10841 FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10842 NULL, HFILL}
10844 {&hf_gtpv2_bearer_qos_gbr_down,
10845 {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
10846 FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10847 NULL, HFILL}
10849 {&hf_gtpv2_flow_qos_label_qci,
10850 {"Label (QCI)", "gtpv2.flow_qos_label_qci",
10851 FT_UINT8, BASE_DEC, NULL, 0x0,
10852 NULL, HFILL}
10854 {&hf_gtpv2_flow_qos_mbr_up,
10855 {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
10856 FT_UINT64, BASE_DEC, NULL, 0x0,
10857 NULL, HFILL}
10859 {&hf_gtpv2_flow_qos_mbr_down,
10860 {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
10861 FT_UINT64, BASE_DEC, NULL, 0x0,
10862 NULL, HFILL}
10864 {&hf_gtpv2_flow_qos_gbr_up,
10865 {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
10866 FT_UINT64, BASE_DEC, NULL, 0x0,
10867 NULL, HFILL}
10869 {&hf_gtpv2_flow_qos_gbr_down,
10870 {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
10871 FT_UINT64, BASE_DEC, NULL, 0x0,
10872 NULL, HFILL}
10874 { &hf_gtpv2_rat_type,
10875 {"RAT Type", "gtpv2.rat_type",
10876 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_rat_type_vals_ext, 0x0,
10877 NULL, HFILL}
10879 { &hf_gtpv2_uli_ecgi_flg,
10880 {"ECGI Present", "gtpv2.uli_ecgi_flg",
10881 FT_BOOLEAN, 8, NULL, GTPv2_ULI_ECGI_MASK,
10882 NULL, HFILL}
10884 { &hf_gtpv2_uli_ext_macro_enb_id_flg,
10885 {"Extended Macro eNodeB ID Present", "gtpv2.uli_ext_macro_enb_id_flg",
10886 FT_BOOLEAN, 8, NULL, GTPv2_ULI_EXT_MACRO_eNB_ID_MASK,
10887 NULL, HFILL}
10889 { &hf_gtpv2_uli_macro_enb_id_flg,
10890 {"Macro eNodeB ID Present", "gtpv2.uli_macro_enb_id_flg",
10891 FT_BOOLEAN, 8, NULL, GTPv2_ULI_MACRO_eNB_ID_MASK,
10892 NULL, HFILL}
10894 { &hf_gtpv2_uli_lai_flg,
10895 {"LAI Present", "gtpv2.uli_lai_flg",
10896 FT_BOOLEAN, 8, NULL, GTPv2_ULI_LAI_MASK,
10897 NULL, HFILL}
10899 { &hf_gtpv2_uli_tai_flg,
10900 {"TAI Present", "gtpv2.uli_tai_flg",
10901 FT_BOOLEAN, 8, NULL, GTPv2_ULI_TAI_MASK,
10902 NULL, HFILL}
10904 { &hf_gtpv2_uli_rai_flg,
10905 {"RAI Present", "gtpv2.uli_rai_flg",
10906 FT_BOOLEAN, 8, NULL, GTPv2_ULI_RAI_MASK,
10907 NULL, HFILL}
10909 { &hf_gtpv2_uli_sai_flg,
10910 {"SAI Present", "gtpv2.uli_sai_flg",
10911 FT_BOOLEAN, 8, NULL, GTPv2_ULI_SAI_MASK,
10912 NULL, HFILL}
10914 { &hf_gtpv2_uli_cgi_flg,
10915 {"CGI Present", "gtpv2.uli_cgi_flg",
10916 FT_BOOLEAN, 8, NULL, GTPv2_ULI_CGI_MASK,
10917 NULL, HFILL}
10919 { &hf_gtpv2_glt,
10920 {"Geographic Location Type", "gtpv2.glt",
10921 FT_UINT8, BASE_DEC, VALS(geographic_location_type_vals), 0x0,
10922 NULL, HFILL}
10924 { &hf_gtpv2_uli_cgi_lac,
10925 {"Location Area Code", "gtpv2.uli_cgi_lac",
10926 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
10927 NULL, HFILL}
10929 { &hf_gtpv2_uli_cgi_ci,
10930 {"Cell Identity", "gtpv2.uli_cgi_ci",
10931 FT_UINT16, BASE_DEC, NULL, 0x0,
10932 NULL, HFILL}
10934 { &hf_gtpv2_sai_lac,
10935 {"Location Area Code", "gtpv2.sai_lac",
10936 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
10937 NULL, HFILL}
10939 { &hf_gtpv2_sai_sac,
10940 {"Service Area Code", "gtpv2.sai_sac",
10941 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
10942 NULL, HFILL}
10944 { &hf_gtpv2_rai_lac,
10945 {"Location Area Code", "gtpv2.rai_lac",
10946 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
10947 NULL, HFILL}
10949 { &hf_gtpv2_rai_rac,
10950 {"Routing Area Code", "gtpv2.rai_rac",
10951 FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
10952 NULL, HFILL}
10954 { &hf_gtpv2_tai_tac,
10955 {"Tracking Area Code", "gtpv2.tai_tac",
10956 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
10957 NULL, HFILL}
10959 { &hf_gtpv2_5gs_tai_tac,
10960 {"5GS Tracking Area Code", "gtpv2.5gs_tai_tac",
10961 FT_UINT24, BASE_HEX_DEC, NULL, 0x0,
10962 NULL, HFILL}
10964 {&hf_gtpv2_ecgi_eci,
10965 {"ECI (E-UTRAN Cell Identifier)", "gtpv2.ecgi_eci",
10966 FT_UINT32, BASE_DEC, NULL, 0x0,
10967 NULL, HFILL}
10969 {&hf_gtpv2_ncgi_nrci,
10970 {"NR Cell Identifier", "gtpv2.ncgi_nrci",
10971 FT_UINT40, BASE_HEX, NULL, 0xfffffffff0,
10972 NULL, HFILL}
10974 {&hf_gtpv2_uli_lai_lac,
10975 {"Location Area Code (LAC)", "gtpv2.uli_lai_lac",
10976 FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
10977 NULL, HFILL}
10979 {&hf_gtpv2_ecgi_eci_spare,
10980 {"Spare", "gtpv2.uli_ecgi_eci_spare",
10981 FT_UINT8, BASE_DEC, NULL, 0x0,
10982 NULL, HFILL}
10984 { &hf_gtpv2_nsapi,
10985 {"NSAPI", "gtpv2.nsapi",
10986 FT_UINT8, BASE_DEC, NULL, 0x0f,
10987 NULL, HFILL}
10989 {&hf_gtpv2_f_teid_v4,
10990 {"V4", "gtpv2.f_teid_v4",
10991 FT_BOOLEAN, 8, TFS(&gtpv2_f_teid_v4_vals), 0x80,
10992 NULL, HFILL}
10994 {&hf_gtpv2_f_teid_v6,
10995 {"V6", "gtpv2.f_teid_v6",
10996 FT_BOOLEAN, 8, TFS(&gtpv2_f_teid_v6_vals), 0x40,
10997 NULL, HFILL}
10999 {&hf_gtpv2_f_teid_interface_type,
11000 {"Interface Type", "gtpv2.f_teid_interface_type",
11001 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_f_teid_interface_type_vals_ext, 0x3f,
11002 NULL , HFILL}
11004 {&hf_gtpv2_f_teid_gre_key,
11005 {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
11006 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
11007 NULL , HFILL}
11009 { &hf_gtpv2_f_teid_ipv4,
11010 {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
11011 FT_IPv4, BASE_NONE, NULL, 0x0,
11012 NULL, HFILL}
11014 { &hf_gtpv2_f_teid_ipv6,
11015 {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
11016 FT_IPv6, BASE_NONE, NULL, 0x0,
11017 NULL, HFILL}
11019 { &hf_gtpv2_tmsi,
11020 {"TMSI", "gtpv2.tmsi",
11021 FT_UINT32, BASE_HEX, NULL, 0x0,
11022 NULL, HFILL}
11024 { &hf_gtpv2_hsgw_addr_f_len,
11025 {"HSGW Address for forwarding Length", "gtpv2.hsgw_addr_f_len",
11026 FT_UINT8, BASE_DEC, NULL, 0x0,
11027 NULL, HFILL}
11029 { &hf_gtpv2_hsgw_addr_ipv4,
11030 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv4",
11031 FT_IPv4, BASE_NONE, NULL, 0x0,
11032 NULL, HFILL}
11034 { &hf_gtpv2_hsgw_addr_ipv6,
11035 {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv6",
11036 FT_IPv6, BASE_NONE, NULL, 0x0,
11037 NULL, HFILL}
11039 { &hf_gtpv2_gre_key,
11040 {"GRE Key", "gtpv2.gre_key",
11041 FT_UINT32, BASE_DEC, NULL, 0x0,
11042 NULL , HFILL}
11044 { &hf_gtpv2_sgw_addr_ipv4,
11045 {"Serving GW Address", "gtpv2.sgw_addr_ipv4",
11046 FT_IPv4, BASE_NONE, NULL, 0x0,
11047 NULL, HFILL}
11049 { &hf_gtpv2_sgw_addr_ipv6,
11050 {"Serving GW Address", "gtpv2.sgw_addr_ipv6",
11051 FT_IPv6, BASE_NONE, NULL, 0x0,
11052 NULL, HFILL}
11054 { &hf_gtpv2_sgw_s1u_teid,
11055 {"Serving GW S1-U TEID", "gtpv2.sgw_s1u_teid",
11056 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
11057 NULL, HFILL}
11059 {&hf_gtpv2_delay_value,
11060 {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
11061 FT_UINT8, BASE_DEC, NULL, 0x0,
11062 NULL, HFILL}
11064 {&hf_gtpv2_charging_id,
11065 {"Charging id", "gtpv2.charging_id",
11066 FT_UINT32, BASE_DEC, NULL, 0x0,
11067 NULL, HFILL}
11069 {&hf_gtpv2_charging_characteristic,
11070 {"Charging Characteristic", "gtpv2.charging_characteristic",
11071 FT_UINT16, BASE_HEX, NULL, 0x0,
11072 NULL, HFILL}
11074 {&hf_gtpv2_bearer_flag_ppc,
11075 {"PPC (Prohibit Payload Compression)", "gtpv2.bearer_flag.ppc",
11076 FT_BOOLEAN, 8, NULL, 0x01,
11077 NULL, HFILL}
11079 {&hf_gtpv2_bearer_flag_vb,
11080 {"VB (Voice Bearer)", "gtpv2.bearer_flag.vb",
11081 FT_BOOLEAN, 8, NULL, 0x02,
11082 NULL, HFILL}
11084 {&hf_gtpv2_pti,
11085 {"Procedure Transaction Id", "gtpv2.pti",
11086 FT_UINT8, BASE_DEC, NULL, 0x0,
11087 NULL, HFILL}
11089 /* MM Context */
11090 { &hf_gtpv2_mm_context_sm,
11091 {"Security Mode", "gtpv2.mm_context_sm",
11092 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_security_mode), 0xe0,
11093 NULL, HFILL}
11095 { &hf_gtpv2_mm_context_nhi,
11096 {"NHI(Next Hop Indicator)", "gtpv2.mm_context_nhi",
11097 FT_BOOLEAN, 8, TFS(&gtpv2_nhi_vals), 0x10,
11098 NULL, HFILL}
11100 { &hf_gtpv2_mm_context_drxi,
11101 {"DRXI", "gtpv2.mm_context_drxi",
11102 FT_UINT8, BASE_DEC, NULL, 0x08,
11103 NULL, HFILL}
11105 { &hf_gtpv2_mm_context_cksn,
11106 {"CKSN", "gtpv2.mm_context_cksn",
11107 FT_UINT8, BASE_DEC, NULL, 0x07,
11108 NULL, HFILL}
11110 { &hf_gtpv2_mm_context_cksn_ksi,
11111 {"CKSN/KSI", "gtpv2.mm_context_cksn_ksi",
11112 FT_UINT8, BASE_DEC, NULL, 0x07,
11113 NULL, HFILL}
11115 { &hf_gtpv2_metric,
11116 {"Metric", "gtpv2.metric",
11117 FT_UINT8, BASE_DEC, NULL, 0x0,
11118 NULL, HFILL}
11120 { &hf_gtpv2_throttling_factor,
11121 {"Throttling Factor", "gtpv2.throttling_factor",
11122 FT_UINT8, BASE_DEC, NULL, 0x0,
11123 NULL, HFILL }
11125 { &hf_gtpv2_relative_capacity,
11126 {"Relative Capacity", "gtpv2.relative_capacity",
11127 FT_UINT8, BASE_DEC, NULL, 0x0,
11128 NULL, HFILL}
11130 { &hf_gtpv2_apn_length,
11131 {"APN Length", "gtpv2.apn_length",
11132 FT_UINT8, BASE_HEX, NULL, 0x0,
11133 NULL, HFILL}
11135 { &hf_gtpv2_sequence_number,
11136 {"Sequence Number", "gtpv2.sequence_number",
11137 FT_UINT32, BASE_HEX, NULL, 0x0,
11138 NULL, HFILL}
11140 { &hf_gtpv2_mm_context_ksi_a,
11141 {"KSI_asme", "gtpv2.mm_context_ksi_a",
11142 FT_UINT8, BASE_DEC, NULL, 0x07,
11143 NULL, HFILL}
11145 { &hf_gtpv2_mm_context_nr_tri,
11146 {"Number of Triplet", "gtpv2.mm_context_nr_tri",
11147 FT_UINT8, BASE_DEC, NULL, 0xe0,
11148 NULL, HFILL}
11150 { &hf_gtpv2_mm_context_used_cipher,
11151 {"Used Cipher", "gtpv2.mm_context_used_cipher",
11152 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_used_cipher_vals), 0x07,
11153 NULL, HFILL}
11155 { &hf_gtpv2_mm_context_unipa,
11156 {"Used NAS integrity protection algorithm", "gtpv2.mm_context_unipa",
11157 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unipa_vals), 0x70,
11158 NULL, HFILL}
11161 { &hf_gtpv2_mm_context_unc,
11162 {"Used NAS Cipher", "gtpv2.mm_context_unc",
11163 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unc_vals), 0x0f,
11164 NULL, HFILL}
11166 { &hf_gtpv2_mm_context_nas_dl_cnt,
11167 {"NAS Downlink Count", "gtpv2.mm_context_nas_dl_cnt",
11168 FT_UINT24, BASE_DEC, NULL, 0x0,
11169 NULL, HFILL}
11171 { &hf_gtpv2_mm_context_nas_ul_cnt,
11172 {"NAS Uplink Count", "gtpv2.mm_context_nas_ul_cnt",
11173 FT_UINT24, BASE_DEC, NULL, 0x0,
11174 NULL, HFILL}
11176 { &hf_gtpv2_mm_context_kasme,
11177 {"Kasme", "gtpv2.mm_context_kasme",
11178 FT_BYTES, BASE_NONE, NULL, 0x0,
11179 NULL, HFILL}
11181 { &hf_gtpv2_mm_context_rand,
11182 {"RAND", "gtpv2.mm_context_rand",
11183 FT_BYTES, BASE_NONE, NULL, 0x0,
11184 NULL, HFILL}
11186 {&hf_gtpv2_uci_csg_id,
11187 {"CSG ID", "gtpv2.cui_csg_id",
11188 FT_UINT32, BASE_DEC, NULL, 0x07FFFFFF,
11189 NULL, HFILL}
11191 {&hf_gtpv2_uci_csg_id_spare,
11192 {"Spare", "gtpv2.cui_csg_id_spare",
11193 FT_UINT8, BASE_DEC, NULL, 0xF8,
11194 NULL, HFILL}
11196 { &hf_gtpv2_uci_csg_membership,
11197 { "CSG Membership Indication", "gtpv2.uci_csg_membership",
11198 FT_UINT8, BASE_DEC, VALS(gtpv2_uci_csg_membership_status), 0x01,
11199 NULL, HFILL }
11201 { &hf_gtpv2_uci_access_mode,
11202 {"Access Mode", "gtpv2.uci_access_mode",
11203 FT_UINT8, BASE_DEC, VALS(gtpv2_uci_access_mode), 0xC0,
11204 NULL, HFILL }
11206 { &hf_gtpv2_uci_lcsg,
11207 {"Leave CSG", "gtpv2.uci_leave_csg",
11208 FT_UINT8, BASE_DEC, VALS(gtpv2_uci_leave_csg), 0x02,
11209 NULL, HFILL }
11211 { &hf_gtpv2_mm_context_xres_len,
11212 {"XRES Length", "gtpv2.mm_context_xres_len",
11213 FT_UINT8, BASE_DEC, NULL, 0x0,
11214 NULL, HFILL}
11216 { &hf_gtpv2_mm_context_xres,
11217 {"XRES", "gtpv2.mm_context_xres",
11218 FT_BYTES, BASE_NONE, NULL, 0x0,
11219 NULL, HFILL}
11221 { &hf_gtpv2_mm_context_autn_len,
11222 {"AUTN Length", "gtpv2.mm_context_autn_len",
11223 FT_UINT8, BASE_DEC, NULL, 0x0,
11224 NULL, HFILL}
11226 { &hf_gtpv2_mm_context_autn,
11227 {"AUTN", "gtpv2.mm_context_autn",
11228 FT_BYTES, BASE_NONE, NULL, 0x0,
11229 NULL, HFILL}
11231 { &hf_gtpv2_mm_context_drx,
11232 {"DRX", "gtpv2.mm_context_drx",
11233 FT_UINT16, BASE_HEX, NULL, 0x0,
11234 NULL, HFILL}
11236 { &hf_gtpv2_vdp_length,
11237 {"VDP and UE's Usage Setting length", "gtpv2.vdp_length",
11238 FT_UINT8, BASE_DEC, NULL, 0x0,
11239 NULL, HFILL}
11242 { &hf_gtpv2_mm_context_ue_net_cap_len,
11243 {"Length of UE Network Capability", "gtpv2.mm_context_ue_net_cap_len",
11244 FT_UINT8, BASE_DEC, NULL, 0x0,
11245 NULL, HFILL}
11247 { &hf_gtpv2_mm_context_ms_net_cap_len,
11248 {"Length of MS Network Capability", "gtpv2.mm_context_ms_net_cap_len",
11249 FT_UINT8, BASE_DEC, NULL, 0x0,
11250 NULL, HFILL}
11252 { &hf_gtpv2_mm_context_mei_len,
11253 {"Length of Mobile Equipment Identity (MEI)", "gtpv2.mm_context_mei_len",
11254 FT_UINT8, BASE_DEC, NULL, 0x0,
11255 NULL, HFILL}
11257 { &hf_gtpv2_mm_contex_nhi_old,
11258 { "Next Hop Indicator for old EPS Security Context", "gtpv2.mm_context_nhi_old",
11259 FT_UINT8, BASE_DEC, NULL, 0x80,
11260 NULL, HFILL }
11262 { &hf_gtpv2_mm_context_old_ksiasme,
11263 { "old KSIASME", "gtpv2.old_ksiasme",
11264 FT_UINT8, BASE_DEC, NULL, 0x38,
11265 NULL, HFILL }
11267 { &hf_gtpv2_mm_context_old_ncc,
11268 { "old NCC", "gtpv2.old_ncc",
11269 FT_UINT8, BASE_DEC, NULL, 0x07,
11270 NULL, HFILL }
11272 { &hf_gtpv2_mm_context_old_kasme,
11273 { "Old Kasme", "gtpv2.mm_context_old_kasme",
11274 FT_BYTES, BASE_NONE, NULL, 0x0,
11275 NULL, HFILL }
11277 { &hf_gtpv2_mm_context_old_nh,{ "Old NH (Old Next Hop)", "gtpv2.mm_context.old_nh", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
11278 { &hf_gtpv2_mm_context_vdp_len,
11279 { "Length of Voice Domain Preference and UE's Usage Setting", "gtpv2.mm_context.vdp_len",
11280 FT_UINT8, BASE_DEC, NULL, 0x0,
11281 NULL, HFILL }
11283 { &hf_gtpv2_mm_context_paging_len,
11284 { "Length of UE Radio Capability for Paging information", "gtpv2.mm_context.paging_len",
11285 FT_UINT16, BASE_DEC, NULL, 0x0,
11286 NULL, HFILL }
11288 { &hf_gtpv2_mm_context_ex_access_res_data_len,
11289 { "Length of Extended Access Restriction Data", "gtpv2.mm_context.ex_access_res_data_len",
11290 FT_UINT8, BASE_DEC, NULL, 0x0,
11291 NULL, HFILL }
11293 { &hf_gtpv2_mm_context_ue_add_sec_cap_len,
11294 { "Length of UE additional security capability", "gtpv2.mm_context.ue_add_sec_cap_len",
11295 FT_UINT8, BASE_DEC, NULL, 0x0,
11296 NULL, HFILL }
11298 { &hf_gtpv2_mm_context_ue_nr_sec_cap_len,
11299 { "Length of UE NR security capability", "gtpv2.mm_context.ue_nr_sec_cap_len",
11300 FT_UINT8, BASE_DEC, NULL, 0x0,
11301 NULL, HFILL }
11303 { &hf_gtpv2_mm_context_apn_rte_ctrl_sts_len,
11304 { "Length of APN Rate Control Statuses", "gtpv2.mm_context.apn_rte_ctrl_sts_len",
11305 FT_UINT16, BASE_DEC, NULL, 0x0,
11306 NULL, HFILL }
11308 { &hf_gtpv2_mm_context_cnr_len,
11309 { "Length of Core Network Restrictions", "gtpv2.mm_context.cnr_len",
11310 FT_UINT8, BASE_DEC, NULL, 0x0,
11311 NULL, HFILL }
11313 { &hf_gtpv2_mm_context_ue_radio_cap_len,
11314 { "Length of UE Radio Capability ID", "gtpv2.mm_context.radio_cap_len",
11315 FT_UINT8, BASE_DEC, NULL, 0x0,
11316 NULL, HFILL }
11318 { &hf_gtpv2_una,
11319 { "UTRAN", "gtpv2.mm_context.una",
11320 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x01,
11321 NULL, HFILL }
11323 { &hf_gtpv2_gena,
11324 { "GERAN", "gtpv2.mm_context.gena",
11325 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x02,
11326 NULL, HFILL }
11328 { &hf_gtpv2_gana,
11329 { "GAN", "gtpv2.mm_context.gana",
11330 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x04,
11331 NULL, HFILL }
11333 { &hf_gtpv2_ina,
11334 { "I-HSPA-EVOLUTION", "gtpv2.mm_context.ina",
11335 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x08,
11336 NULL, HFILL }
11338 { &hf_gtpv2_ena,
11339 { "E-UTRAN", "gtpv2.mm_context.ena",
11340 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x10,
11341 NULL, HFILL }
11343 { &hf_gtpv2_hnna,
11344 { "HO-toNone3GPP-Access", "gtpv2.mm_context.hnna",
11345 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x20,
11346 NULL, HFILL }
11348 { &hf_gtpv2_hbna,
11349 { "NB-IoT Not Allowed", "gtpv2.mm_context.hbna",
11350 FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x40,
11351 NULL, HFILL }
11353 { &hf_gtpv2_mm_context_ksi,
11354 {"KSI", "gtpv2.mm_context_ksi",
11355 FT_UINT8, BASE_DEC, NULL, 0x07,
11356 NULL, HFILL}
11358 { &hf_gtpv2_mm_context_nr_qui,
11359 {"Number of Quintuplets", "gtpv2.mm_context_nr_qui",
11360 FT_UINT8, BASE_DEC, NULL, 0xe0,
11361 NULL, HFILL}
11364 { &hf_gtpv2_mm_context_nr_qua,
11365 {"Number of Quadruplet", "gtpv2.mm_context_nr_qua",
11366 FT_UINT8, BASE_DEC, NULL, 0x1c,
11367 NULL, HFILL}
11369 { &hf_gtpv2_mm_context_uamb_ri,
11370 {"UAMB RI", "gtpv2.mm_context_uamb_ri",
11371 FT_BOOLEAN, 8, NULL, 0x02,
11372 NULL, HFILL}
11374 { &hf_gtpv2_mm_context_osci,
11375 {"OSCI", "gtpv2.mm_context_osci",
11376 FT_BOOLEAN, 8, NULL, 0x01,
11377 "Old Security Context Indicator", HFILL}
11379 { &hf_gtpv2_mm_context_nruna,
11380 { "NRUNA (NR-U in 5GS Not Allowed)", "gtpv2.mm_context.nruna",
11381 FT_BOOLEAN, 8, NULL, 0x10,
11382 NULL, HFILL }
11384 { &hf_gtpv2_mm_context_nrusrna,
11385 { "NRUSRNA (New Radio Unlicensed as Secondary RAT Not Allowed)", "gtpv2.mm_context.nrusrna",
11386 FT_BOOLEAN, 8, NULL, 0x08,
11387 NULL, HFILL }
11389 { &hf_gtpv2_mm_context_nrna,
11390 { "NRNA(NR in 5GS Not Allowed)", "gtpv2.mm_context.nrna",
11391 FT_BOOLEAN, 8, NULL, 0x04,
11392 NULL, HFILL }
11394 { &hf_gtpv2_mm_context_ussrna,
11395 {"USSRNA", "gtpv2.mm_context_ussrna",
11396 FT_BOOLEAN, 8, NULL, 0x02,
11397 "Unlicensed Spectrum in the form of LAA or LWA/LWIP as Secondary RAT Not Allowed", HFILL}
11399 { &hf_gtpv2_mm_context_nrsrna,
11400 {"NRSRNA(NR as Secondary RAT Not Allowed)", "gtpv2.mm_context_nrsrna",
11401 FT_BOOLEAN, 8, NULL, 0x01,
11402 NULL, HFILL}
11404 { &hf_gtpv2_mm_context_ensct,
11405 {"ENSCT (EPS NAS Security Context Type)", "gtpv2.mm_context_ensct",
11406 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_eps_nas_security_context_type_vals), 0x03,
11407 NULL, HFILL}
11409 { &hf_gtpv2_mm_context_samb_ri,
11410 {"SAMB RI", "gtpv2.mm_context_samb_ri",
11411 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
11412 NULL, HFILL}
11414 { &hf_gtpv2_ue_time_zone_dst,
11415 {"Daylight Saving Time", "gtpv2.ue_time_zone_dst",
11416 FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals), 0x03,
11417 NULL, HFILL}
11419 { &hf_gtpv2_fq_csid_type,
11420 {"Node-ID Type", "gtpv2.fq_csid_type",
11421 FT_UINT8, BASE_DEC, NULL, 0xf0,
11422 NULL, HFILL}
11424 { &hf_gtpv2_fq_csid_nr,
11425 {"Number of CSIDs", "gtpv2.fq_csid_nr",
11426 FT_UINT8, BASE_DEC, NULL, 0x0f,
11427 NULL, HFILL}
11429 { &hf_gtpv2_fq_csid_ipv4,
11430 {"Node-ID (IPv4)", "gtpv2.fq_csid_ipv4",
11431 FT_IPv4, BASE_NONE, NULL, 0x0,
11432 NULL, HFILL}
11434 { &hf_gtpv2_fq_csid_ipv6,
11435 {"Node-ID (IPv6)", "gtpv2.fq_csid_ipv6",
11436 FT_IPv6, BASE_NONE, NULL, 0x0,
11437 NULL, HFILL}
11439 { &hf_gtpv2_fq_csid_id,
11440 {"CSID", "gtpv2.fq_csid_id",
11441 FT_UINT16, BASE_DEC, NULL, 0x0,
11442 NULL, HFILL}
11444 { &hf_gtpv2_complete_req_msg_type,
11445 {"Complete Request Message Type", "gtpv2.complete_req_msg_type",
11446 FT_UINT8, BASE_DEC, VALS(gtpv2_complete_req_msg_type_vals), 0x0,
11447 NULL, HFILL}
11449 {&hf_gtpv2_mme_grp_id,
11450 {"MME Group ID", "gtpv2.mme_grp_id",
11451 FT_UINT16, BASE_DEC, NULL, 0x0,
11452 NULL, HFILL}
11454 { &hf_gtpv2_mme_code,
11455 {"MME Code", "gtpv2.mme_code",
11456 FT_UINT8, BASE_DEC, NULL, 0x0,
11457 NULL, HFILL}
11459 { &hf_gtpv2_m_tmsi,
11460 {"M-TMSI", "gtpv2.m_tmsi",
11461 FT_BYTES, BASE_NONE, NULL, 0x0,
11462 NULL, HFILL}
11464 { &hf_gtpv2_container_type,
11465 {"Container Type", "gtpv2.container_type",
11466 FT_UINT8, BASE_DEC, VALS(gtpv2_container_type_vals), 0x0f,
11467 NULL, HFILL}
11469 { &hf_gtpv2_cause_type,
11470 {"Cause Type", "gtpv2.cause_type",
11471 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_cause_type_vals_ext, 0x0f,
11472 NULL, HFILL}
11474 { &hf_gtpv2_CauseRadioNetwork,
11475 {"Radio Network Layer Cause", "gtpv2.CauseRadioNetwork",
11476 FT_UINT8, BASE_DEC, VALS(s1ap_CauseRadioNetwork_vals), 0x0,
11477 NULL, HFILL}
11479 { &hf_gtpv2_CauseTransport,
11480 {"Transport Layer Cause", "gtpv2.CauseTransport",
11481 FT_UINT8, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0x0,
11482 NULL, HFILL}
11484 { &hf_gtpv2_CauseNas,
11485 {"NAS Cause", "gtpv2.CauseNas",
11486 FT_UINT8, BASE_DEC, VALS(s1ap_CauseNas_vals), 0x0,
11487 NULL, HFILL}
11489 { &hf_gtpv2_CauseMisc,
11490 {"Miscellaneous Cause", "gtpv2.CauseMisc",
11491 FT_UINT8, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0x0,
11492 NULL, HFILL}
11494 { &hf_gtpv2_target_type,
11495 {"Target Type", "gtpv2.target_type",
11496 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_target_type_vals_ext, 0x0,
11497 NULL, HFILL}
11499 {&hf_gtpv2_macro_enodeb_id,
11500 {"Macro eNodeB ID", "gtpv2.macro_enodeb_id",
11501 FT_UINT24, BASE_HEX, NULL, 0x0fffff,
11502 NULL, HFILL}
11504 {&hf_gtpv2_smenb,
11505 {"SMeNB", "gtpv2.smenb",
11506 FT_BOOLEAN, 8, TFS(&gtpv2_smenb), 0x80,
11507 NULL, HFILL}
11509 {&hf_gtpv2_ext_macro_enodeb_id,
11510 {"Extended Macro eNodeB ID", "gtpv2.ext_macro_enodeb_id",
11511 FT_UINT24, BASE_HEX, NULL, 0x1fffff,
11512 NULL, HFILL}
11514 {&hf_gtpv2_ext_macro_ng_enodeb_id,
11515 {"Extended Macro ng-eNodeB ID", "gtpv2.ext_macro_ng_enodeb_id",
11516 FT_UINT24, BASE_HEX, NULL, 0x1fffff,
11517 NULL, HFILL}
11519 {&hf_gtpv2_cellid,
11520 {"CellId", "gtpv2.cellid",
11521 FT_UINT32, BASE_DEC, NULL, 0xFF,
11522 NULL, HFILL}
11524 { &hf_gtpv2_enodebid,
11525 { "eNodeB Id", "gtpv2.enodebid",
11526 FT_UINT32, BASE_DEC, NULL, 0x0FFFFF00,
11527 NULL, HFILL }
11529 { &hf_gtpv2_CauseProtocol,
11530 {"Protocol Cause", "gtpv2.CauseProtocol",
11531 FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0,
11532 NULL, HFILL}
11534 {&hf_gtpv2_apn_rest,
11535 {"APN Restriction", "gtpv2.apn_rest",
11536 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_apn_restriction_vals_ext, 0x0,
11537 NULL, HFILL}
11539 {&hf_gtpv2_selec_mode,
11540 {"Selection Mode", "gtpv2.selec_mode",
11541 FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals), 0x03,
11542 NULL, HFILL}
11544 { &hf_gtpv2_source_type,
11545 {"Source Type", "gtpv2.source_type",
11546 FT_UINT8, BASE_DEC, NULL, 0x0,
11547 NULL, HFILL}
11549 {&hf_gtpv2_bearer_control_mode,
11550 {"Bearer Control Mode", "gtpv2.bearer_control_mode",
11551 FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals), 0x0,
11552 NULL, HFILL}
11554 { &hf_gtpv2_cng_rep_act,
11555 {"Change Reporting Action", "gtpv2.cng_rep_act",
11556 FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
11557 NULL, HFILL}
11559 { &hf_gtpv2_node_type,
11560 {"Node Type", "gtpv2.node_type",
11561 FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
11562 NULL, HFILL}
11564 {&hf_gtpv2_fqdn,
11565 {"FQDN", "gtpv2.fqdn",
11566 FT_STRING, BASE_NONE, NULL, 0x0,
11567 NULL, HFILL}
11569 { &hf_gtpv2_enterprise_id,
11570 {"Enterprise ID", "gtpv2.enterprise_id",
11571 FT_UINT16, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
11572 NULL, HFILL}
11574 { &hf_gtpv2_ti,
11575 {"Transaction Identifier", "gtpv2.ti",
11576 FT_BYTES, BASE_NONE, NULL, 0x0,
11577 NULL, HFILL}
11579 { &hf_gtpv2_bss_container_phx,
11580 {"PHX", "gtpv2.bss_cont.phx",
11581 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
11582 NULL, HFILL}
11584 { &hf_gtpv2_bss_con_sapi_flg,
11585 {"SAPI", "gtpv2.bss_cont.sapi_flg",
11586 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
11587 NULL, HFILL}
11589 { &hf_gtpv2_bss_con_rp_flg,
11590 {"RP", "gtpv2.bss_cont.rp_flg",
11591 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
11592 NULL, HFILL}
11594 { &hf_gtpv2_bss_con_pfi_flg,
11595 {"PFI", "gtpv2.bss_cont.pfi_flg",
11596 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
11597 NULL, HFILL}
11599 { &hf_gtpv2_bss_con_pfi,
11600 {"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
11601 FT_UINT8, BASE_DEC, NULL, 0x0,
11602 NULL, HFILL}
11604 { &hf_gtpv2_bss_con_rp,
11605 {"Radio Priority(RP)", "gtpv2.bss_cont.rp",
11606 FT_UINT8, BASE_DEC, NULL, 0x07,
11607 NULL, HFILL}
11609 { &hf_gtpv2_bss_con_sapi,
11610 {"SAPI", "gtpv2.bss_cont.sapi",
11611 FT_UINT8, BASE_DEC, NULL, 0xf0,
11612 NULL, HFILL}
11614 { &hf_gtpv2_bss_con_xid_len,
11615 {"XiD parameters length", "gtpv2.bss_cont.xid_len",
11616 FT_UINT8, BASE_DEC, NULL, 0x0,
11617 NULL, HFILL}
11619 { &hf_gtpv2_bss_con_xid,
11620 {"XiD parameters", "gtpv2.bss_cont.xid",
11621 FT_BYTES, BASE_NONE, NULL, 0x0,
11622 NULL, HFILL}
11624 { &hf_gtpv2_home_enodeb_id,
11625 {"Home eNodeB ID", "gtpv2.home_enodeb_id",
11626 FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
11627 NULL, HFILL}
11629 { &hf_gtpv2_tac,
11630 {"Tracking Area Code (TAC)", "gtpv2.tac",
11631 FT_UINT16, BASE_DEC, NULL, 0x0,
11632 NULL, HFILL}
11634 { &hf_gtpv2_mbms_service_area_nr,
11635 {"Number of MBMS Service Area codes", "gtpv2.mbms_service_area_nr",
11636 FT_UINT16, BASE_DEC, NULL, 0x0,
11637 NULL, HFILL}
11639 { &hf_gtpv2_mbms_service_area_id,
11640 {"MBMS Service Area code (Service Area Identity)", "gtpv2.mbms_service_area_id",
11641 FT_UINT16, BASE_DEC, NULL, 0x0,
11642 NULL, HFILL}
11644 { &hf_gtpv2_mbms_session_id,
11645 {"MBMS Session Identifier", "gtpv2.mbms_session_id",
11646 FT_BYTES, BASE_NONE, NULL, 0x0,
11647 NULL, HFILL}
11649 { &hf_gtpv2_mbms_flow_id,
11650 {"MBMS Flow Identifier", "gtpv2.mbms_flow_id",
11651 FT_BYTES, BASE_NONE, NULL, 0x0,
11652 NULL, HFILL}
11654 { &hf_gtpv2_cteid,
11655 {"Common Tunnel Endpoint Identifier", "gtpv2.cetid",
11656 FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
11657 NULL, HFILL}
11659 { &hf_gtpv2_ip_addr_type,
11660 {"IP Address Type", "gtpv2.ip_addr_type",
11661 FT_UINT8, BASE_DEC, NULL, 0xc0,
11662 NULL, HFILL}
11664 { &hf_gtpv2_ip_addr_len,
11665 {"IP Address Length", "gtpv2.ip_addr_len",
11666 FT_UINT8, BASE_DEC, NULL, 0x3f,
11667 NULL, HFILL}
11669 { &hf_gtpv2_mbms_ip_mc_dist_addrv4,
11670 {"MBMS IP Multicast Distribution Address (IPv4)", "gtpv2.mbms_ip_mc_dist_addrv4",
11671 FT_IPv4, BASE_NONE, NULL, 0x0,
11672 NULL, HFILL}
11674 { &hf_gtpv2_mbms_ip_mc_dist_addrv6,
11675 {"MBMS IP Multicast Distribution Address (IPv6)", "gtpv2.mbms_ip_mc_dist_addrv6",
11676 FT_IPv6, BASE_NONE, NULL, 0x0,
11677 NULL, HFILL}
11679 { &hf_gtpv2_mbms_ip_mc_src_addrv4,
11680 {"MBMS IP Multicast Source Address (IPv4)", "gtpv2.mbms_ip_mc_src_addrv4",
11681 FT_IPv4, BASE_NONE, NULL, 0x0,
11682 NULL, HFILL}
11684 { &hf_gtpv2_mbms_ip_mc_src_addrv6,
11685 {"MBMS IP Multicast Source Address (IPv6)", "gtpv2.mbms_ip_mc_src_addrv6",
11686 FT_IPv6, BASE_NONE, NULL, 0x0,
11687 NULL, HFILL}
11689 { &hf_gtpv2_mbms_hc_indicator,
11690 {"MBMS HC Indicator", "gtpv2.mbms_hc_indicator",
11691 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_hc_indicator_vals), 0x0,
11692 NULL, HFILL}
11694 { &hf_gtpv2_mbms_dist_indication,
11695 {"MBMS Distribution Indication", "gtpv2.mbms_dist_indication",
11696 FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_dist_indication_vals), 0x03,
11697 NULL, HFILL}
11699 { &hf_gtpv2_subscriber_rfsp,
11700 {"Subscribed RFSP Index", "gtpv2.subscriber_rfsp",
11701 FT_INT16, BASE_DEC, NULL, 0x0,
11702 NULL, HFILL}
11704 { &hf_gtpv2_rfsp_inuse,
11705 {"RFSP Index in Use", "gtpv2.rfsp_inuse",
11706 FT_INT16, BASE_DEC, NULL, 0x0,
11707 NULL, HFILL}
11709 { &hf_gtpv2_mbms_service_id,
11710 {"MBMS Service ID", "gtpv2.mbms_service_id",
11711 FT_BYTES, BASE_NONE, NULL, 0x0,
11712 NULL, HFILL}
11714 { &hf_gtpv2_add_flags_for_srvcc_ics,
11715 {"ICS (IMS Centralized Service)", "gtpv2.add_flags_for_srvcc_ics",
11716 FT_BOOLEAN, 8, NULL, 0x01,
11717 NULL, HFILL}
11719 { &hf_gtpv2_vsrvcc_flag,
11720 {"VF (vSRVCC Flag)", "gtpv2.vsrvcc_flag",
11721 FT_BOOLEAN, 8, NULL, 0x02,
11722 NULL, HFILL}
11724 { &hf_gtpv2_henb_info_report_fti,
11725 {"FTI", "gtpv2.henb_info_report_fti",
11726 FT_BOOLEAN, 8, TFS(&gtpv2_henb_info_report_fti_vals), 0x01,
11727 NULL, HFILL}
11729 { &hf_gtpv2_ip4cp_subnet_prefix_len,
11730 {"Subnet Prefix Length", "gtpv2.ip4cp_subnet_prefix_len",
11731 FT_UINT8, BASE_DEC, NULL, 0x0,
11732 NULL, HFILL}
11734 { &hf_gtpv2_ip4cp_ipv4,
11735 {"IPv4 Default Router Address", "gtpv2.ip4cp_ipv4",
11736 FT_IPv4, BASE_NONE, NULL, 0x0,
11737 NULL, HFILL}
11739 { &hf_gtpv2_change_report_flags_sncr,
11740 {"SNCR (Service Network Change to Report)", "gtpv2.change_report_flags_sncr",
11741 FT_BOOLEAN, 8, NULL, 0x01,
11742 NULL, HFILL}
11744 { &hf_gtpv2_change_report_flags_tzcr,
11745 {"TZCR (Time Zone Change to Report)", "gtpv2.change_report_flags_tzcr",
11746 FT_BOOLEAN, 8, NULL, 0x02,
11747 NULL, HFILL}
11749 {&hf_gtpv2_action_indication_val,
11750 {"Action Indication", "gtpv2.action_indication_val",
11751 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_action_indication_vals_ext, 0x07,
11752 NULL , HFILL}
11754 { &hf_gtpv2_uli_timestamp,
11755 { "ULI Timestamp", "gtpv2.uli_timestamp",
11756 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0,
11757 NULL, HFILL }
11759 { &hf_gtpv2_abs_time_mbms_data,
11760 { "Absolute Time of MBMS Data Transfer", "gtpv2.abs_time_mbms_data",
11761 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0,
11762 NULL, HFILL }
11764 { &hf_gtpv2_mbms_session_duration_days,
11765 {"MBMS Session Duration (days)", "gtpv2.mbms_session_duration_days",
11766 FT_UINT24, BASE_DEC, NULL, 0x00007F,
11767 NULL, HFILL}
11769 { &hf_gtpv2_mbms_session_duration_secs,
11770 {"MBMS Session Duration (seconds)", "gtpv2.mbms_session_duration_secs",
11771 FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
11772 NULL, HFILL}
11774 { &hf_gtpv2_csg_id,
11775 {"CSG ID", "gtpv2.csg_id",
11776 FT_UINT32, BASE_HEX, NULL, 0x07ffffff,
11777 NULL, HFILL}
11779 { &hf_gtpv2_cmi,
11780 {"CSG Membership Indication (CMI)", "gtpv2.cmi",
11781 FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x01,
11782 NULL, HFILL}
11784 { &hf_gtpv2_service_indicator,
11785 {"Service Indicator", "gtpv2.service_indicator",
11786 FT_UINT8, BASE_DEC, VALS(gtpv2_service_indicator_vals), 0,
11787 NULL, HFILL}
11789 { &hf_gtpv2_detach_type,
11790 {"Detach Type", "gtpv2.detach_type",
11791 FT_UINT8, BASE_DEC, VALS(gtpv2_detach_type_vals), 0,
11792 NULL, HFILL}
11794 { &hf_gtpv2_ldn,
11795 {"Local Distinguished Name (LDN)", "gtpv2.ldn",
11796 FT_STRING, BASE_NONE, NULL, 0,
11797 NULL, HFILL}
11799 { &hf_gtpv2_node_features_prn,
11800 {"PGW Restart Notification (PRN)", "gtpv2.node_features_prn",
11801 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
11802 NULL, HFILL}
11804 { &hf_gtpv2_node_features_mabr,
11805 {"Modify Access Bearers Request (MABR)", "gtpv2.node_features_mabr",
11806 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
11807 NULL, HFILL}
11809 { &hf_gtpv2_node_features_ntsr,
11810 {"Network Triggered Service Restoration (NTSR)", "gtpv2.node_features_ntsr",
11811 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
11812 NULL, HFILL}
11814 { &hf_gtpv2_node_features_ciot,
11815 {"Cellular Internet Of Things (CIOT)", "gtpv2.node_features_ciot",
11816 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
11817 NULL, HFILL}
11819 { &hf_gtpv2_node_features_s1un,
11820 {"S1-U path failure notification feature (S1UN)", "gtpv2.node_features_s1un",
11821 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
11822 NULL, HFILL}
11824 { &hf_gtpv2_node_features_eth,
11825 {"Ethernet PDN type (ETH)", "gtpv2.node_features_eth",
11826 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
11827 NULL, HFILL}
11829 { &hf_gtpv2_node_features_mtedt,
11830 {"Support of MT-EDT (MTEDT)", "gtpv2.node_features_mtedt",
11831 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x40,
11832 NULL, HFILL}
11834 { &hf_gtpv2_node_features_psset,
11835 {"Support of PGW-C/SMF Set (PSSET)", "gtpv2.node_features_psset",
11836 FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
11837 NULL, HFILL}
11839 { &hf_gtpv2_time_to_data_xfer,
11840 {"MBMS Time to Data Transfer", "gtpv2.time_to_data_xfer",
11841 FT_STRING, BASE_NONE, NULL, 0,
11842 NULL, HFILL}
11844 { &hf_gtpv2_arp_pvi,
11845 {"Pre-emption Vulnerability (PVI)", "gtpv2.arp_pvi",
11846 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
11847 NULL, HFILL}
11849 { &hf_gtpv2_arp_pl,
11850 {"Priority Level", "gtpv2.arp_pl",
11851 FT_UINT8, BASE_DEC, NULL, 0x3c,
11852 NULL, HFILL}
11854 { &hf_gtpv2_arp_pci,
11855 {"Pre-emption Capability (PCI)", "gtpv2.arp_pci",
11856 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
11857 NULL, HFILL}
11859 { &hf_gtpv2_timer_unit,
11860 {"Timer unit", "gtpv2.timer_unit",
11861 FT_UINT8, BASE_DEC, VALS(gtpv2_timer_unit_vals), 0xe0,
11862 NULL, HFILL}
11864 { &hf_gtpv2_throttling_delay_unit,
11865 {"Throttling Delay unit", "gtpv2.throttling_delay_unit",
11866 FT_UINT8, BASE_DEC, VALS(gtpv2_throttling_delay_unit_vals), 0xe0,
11867 NULL, HFILL }
11869 { &hf_gtpv2_timer_value,
11870 {"Timer value", "gtpv2.timer_value",
11871 FT_UINT8, BASE_DEC, NULL, 0x1f,
11872 NULL, HFILL}
11874 { &hf_gtpv2_throttling_delay_value,
11875 {"Throttling Delay value", "gtpv2.throttling_delay_value",
11876 FT_UINT8, BASE_DEC, NULL, 0x1f,
11877 NULL, HFILL }
11879 { &hf_gtpv2_lapi,
11880 {"LAPI (Low Access Priority Indication)", "gtpv2.lapi",
11881 FT_BOOLEAN, 8, NULL, 0x01,
11882 NULL, HFILL}
11884 { &hf_gtpv2_mm_context_higher_br_16mb_flg_len,
11885 {"Length of Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg_len",
11886 FT_UINT8, BASE_DEC, NULL, 0x0,
11887 NULL, HFILL}
11889 { &hf_gtpv2_mm_context_higher_br_16mb_flg,
11890 {"Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg",
11891 FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_higher_br_16mb_flg_vals), 0x0,
11892 NULL, HFILL}
11894 { &hf_gtpv2_mmbr_ul,
11895 {"Max MBR/APN-AMBR for uplink", "gtpv2.mmbr_ul",
11896 FT_UINT32, BASE_DEC, NULL, 0x0,
11897 NULL, HFILL}
11899 { &hf_gtpv2_mmbr_dl,
11900 {"Max MBR/APN-AMBR for downlink", "gtpv2.mmbr_dl",
11901 FT_UINT32, BASE_DEC, NULL, 0x0,
11902 NULL, HFILL}
11904 { &hf_gtpv2_pres_rep_area_act_inapra,
11905 {"INAPRA", "gtpv2.pres_rep_area_action.inapra",
11906 FT_UINT8, BASE_DEC, NULL, 0x08,
11907 NULL, HFILL}
11909 { &hf_gtpv2_pres_rep_area_action,
11910 {"Action", "gtpv2.pres_rep_area_action.action",
11911 FT_UINT8, BASE_DEC, VALS(gtpv2_pres_rep_area_action_vals), 0x03,
11912 NULL, HFILL}
11914 { &hf_gtpv2_pres_rep_area_id,
11915 {"Presence Reporting Area Identifier", "gtpv2.pres_rep_area_action.pres_rep_area_id",
11916 FT_UINT24, BASE_HEX, NULL, 0x0,
11917 NULL, HFILL}
11919 { &hf_gtpv2_pres_rep_area_act_no_tai,
11920 {"Number of TAI", "gtpv2.pres_rep_area_action.no_tai",
11921 FT_UINT8, BASE_DEC, NULL, 0xf0,
11922 NULL, HFILL}
11924 { &hf_gtpv2_pres_rep_area_act_no_rai,
11925 {"Number of RAI", "gtpv2.pres_rep_area_action.no_rai",
11926 FT_UINT8, BASE_DEC, NULL, 0x0f,
11927 NULL, HFILL}
11929 { &hf_gtpv2_pres_rep_area_act_no_m_enodeb,
11930 {"Number of Macro eNodeB", "gtpv2.pres_rep_area_action.no_m_enodeb",
11931 FT_UINT8, BASE_DEC, NULL, 0x3f,
11932 NULL, HFILL}
11934 { &hf_gtpv2_pres_rep_area_act_no_h_enodeb,
11935 {"Number of Home eNodeB", "gtpv2.pres_rep_area_action.no_h_enodeb",
11936 FT_UINT8, BASE_DEC, NULL, 0x3f,
11937 NULL, HFILL}
11939 { &hf_gtpv2_pres_rep_area_act_no_ecgi,
11940 {"Number of ECGI", "gtpv2.pres_rep_area_action.no_ecgi",
11941 FT_UINT8, BASE_DEC, NULL, 0x3f,
11942 NULL, HFILL}
11944 { &hf_gtpv2_pres_rep_area_act_no_sai,
11945 {"Number of SAI", "gtpv2.pres_rep_area_action.no_sai",
11946 FT_UINT8, BASE_DEC, NULL, 0x3f,
11947 NULL, HFILL}
11949 { &hf_gtpv2_pres_rep_area_act_no_cgi,
11950 {"Number of CGI", "gtpv2.pres_rep_area_action.no_cgi",
11951 FT_UINT8, BASE_DEC, NULL, 0x3f,
11952 NULL, HFILL}
11954 { &hf_gtpv2_pres_rep_area_act_no_ext_m_enodeb,
11955 {"Number of Extended Macro eNodeB", "gtpv2.pres_rep_area_action.no_ext_m_enodeb",
11956 FT_UINT8, BASE_DEC, NULL, 0x3f,
11957 NULL, HFILL}
11959 { &hf_gtpv2_ksi_ps,
11960 { "KSI'ps", "gtpv2.ksi_ps",
11961 FT_UINT8, BASE_HEX, NULL, 0x0f,
11962 NULL, HFILL }
11964 { &hf_gtpv2_ck_ps,
11965 { "CK'ps", "gtpv2.ck_ps",
11966 FT_BYTES, BASE_NONE, NULL, 0,
11967 NULL, HFILL }
11969 { &hf_gtpv2_ik_ps,
11970 { "IK'ps", "gtpv2.ik_ps",
11971 FT_BYTES, BASE_NONE, NULL, 0,
11972 NULL, HFILL }
11974 { &hf_gtpv2_kc_ps,
11975 { "KC'ps", "gtpv2.kc_ps",
11976 FT_BYTES, BASE_NONE, NULL, 0,
11977 NULL, HFILL }
11979 { &hf_gtpv2_cksn_ps,
11980 { "CKSN'ps", "gtpv2.cksn_ps",
11981 FT_UINT8, BASE_HEX, NULL, 0x0,
11982 NULL, HFILL }
11984 { &hf_gtpv2_pres_rep_area_info_id,
11985 {"Presence Reporting Area Identifier", "gtpv2.pres_rep_area_info_id",
11986 FT_UINT24, BASE_HEX, NULL, 0x0,
11987 NULL, HFILL}
11989 { &hf_gtpv2_pres_rep_area_info_additional_id,
11990 {"Additional Presence Reporting Area Identifier", "gtpv2.pres_rep_area_info_additional_id",
11991 FT_UINT24, BASE_HEX, NULL, 0x0,
11992 NULL, HFILL}
11994 { &hf_gtpv2_pres_rep_area_info_flags,
11995 {"Flags", "gtpv2.pres_rep_area_info_flags",
11996 FT_UINT8, BASE_HEX, NULL, 0x0,
11997 NULL, HFILL}
11999 { &hf_gtpv2_pres_rep_area_info_flags_no_inapra,
12000 {"Flags", "gtpv2.pres_rep_area_info_flags",
12001 FT_UINT8, BASE_HEX, NULL, 0x0,
12002 NULL, HFILL}
12004 { &hf_gtpv2_pres_rep_area_info_flags_b0_ipra,
12005 {"Inside Presence Reporting Area(IPRA)", "gtpv2.pres_rep_area_info_flag_ipra",
12006 FT_BOOLEAN, 8, NULL, 0x01,
12007 NULL, HFILL}
12009 { &hf_gtpv2_pres_rep_area_info_flags_b1_opra,
12010 {"Outside Presence Reporting Area(OPRA)", "gtpv2.pres_rep_area_info_flag_opra",
12011 FT_BOOLEAN, 8, NULL, 0x02,
12012 NULL, HFILL}
12014 { &hf_gtpv2_pres_rep_area_info_flags_b2_apra,
12015 {"Additional Presence Reporting Area(APRA)", "gtpv2.pres_rep_area_info_flag_apra",
12016 FT_BOOLEAN, 8, NULL, 0x04,
12017 NULL, HFILL}
12019 { &hf_gtpv2_pres_rep_area_info_flags_b3_inapra,
12020 {"Inactive Presence Reporting Area(INAPRA)", "gtpv2.pres_rep_area_info_flag_inapra",
12021 FT_BOOLEAN, 8, NULL, 0x08,
12022 NULL, HFILL}
12024 { &hf_gtpv2_pres_rep_area_info_flags_b3_b7_spare,
12025 {"Spare", "gtpv2.pres_rep_area_info_spare",
12026 FT_UINT8, BASE_HEX, NULL, 0xF8,
12027 NULL, HFILL}
12029 { &hf_gtpv2_pres_rep_area_info_flags_b4_b7_spare,
12030 {"Spare", "gtpv2.pres_rep_area_info_spare",
12031 FT_UINT8, BASE_HEX, NULL, 0xF0,
12032 NULL, HFILL}
12034 { &hf_gtpv2_ppi_value,
12035 {"Paging and Policy Information Value", "gtpv2.ppi_value",
12036 FT_UINT8, BASE_DEC | BASE_EXT_STRING,
12037 &dscp_vals_ext, GTPV2_PPI_VAL_MASK, NULL, HFILL}
12039 { &hf_gtpv2_ppi_flag,
12040 {"Paging Policy Indication", "gtpv2.ppi_flag",
12041 FT_UINT8, BASE_DEC, NULL, 0x0,
12042 NULL, HFILL}
12044 { &hf_gtpv2_session,
12045 { "Session", "gtpv2.session",
12046 FT_UINT32, BASE_DEC, NULL, 0,
12047 NULL, HFILL }
12050 /* Generated from convert_proto_tree_add_text.pl */
12051 { &hf_gtpv2_transparent_container, { "Transparent Container", "gtpv2.transparent_container", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12052 { &hf_gtpv2_cksrvcc, { "CKsrvcc", "gtpv2.cksrvcc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12053 { &hf_gtpv2_iksrvcc, { "IKsrvcc", "gtpv2.iksrvcc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12054 { &hf_gtpv2_mobile_station_classmark2, { "Mobile Station Classmark2", "gtpv2.mobile_station_classmark2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12055 { &hf_gtpv2_mobile_station_classmark3, { "Mobile Station Classmark3", "gtpv2.mobile_station_classmark3", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12056 { &hf_gtpv2_supported_codec_list, { "Supported Codec List", "gtpv2.supported_codec_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12057 { &hf_gtpv2_utran_srvcc_ck_cs, { "CK'cs", "gtpv2.utran_srvcc.ck_cs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12058 { &hf_gtpv2_utran_srvcc_ik_cs, { "IK'cs", "gtpv2.utran_srvcc.ik_cs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12059 { &hf_gtpv2_utran_srvcc_kc, { "Kc'", "gtpv2.utran_srvcc.kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12060 { &hf_gtpv2_teid_c_spare, { "Spare", "gtpv2.teid_c.spare", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12061 { &hf_gtpv2_geographic_location, { "Geographic Location", "gtpv2.geographic_location", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12062 { &hf_gtpv2_tmsi_bytes, { "TMSI", "gtpv2.tmsi_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12063 { &hf_gtpv2_cn_id, { "CN-Id", "gtpv2.cn_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12064 { &hf_gtpv2_eps_bearer_id_number, { "EPS Bearer ID Number", "gtpv2.eps_bearer_id_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12065 { &hf_gtpv2_serving_gw_address_length, { "Serving GW Address Length", "gtpv2.serving_gw_address_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12066 { &hf_gtpv2_charging_characteristic_remaining_octets, { "Remaining octets", "gtpv2.charging_characteristic.remaining_octets", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12067 { &hf_gtpv2_trace_id, { "Trace ID", "gtpv2.trace_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12068 { &hf_gtpv2_drx_parameter, { "DRX parameter", "gtpv2.drx_parameter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12069 { &hf_gtpv2_mm_context_sres, { "SRES'", "gtpv2.mm_context_sres", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12070 { &hf_gtpv2_mm_context_kc, { "Kc'", "gtpv2.mm_context_kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12071 { &hf_gtpv2_uplink_subscribed_ue_ambr, { "Uplink Subscribed UE AMBR", "gtpv2.uplink_subscribed_ue_ambr", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0, NULL, HFILL }},
12072 { &hf_gtpv2_downlink_subscribed_ue_ambr, { "Downlink Subscribed UE AMBR", "gtpv2.downlink_subscribed_ue_ambr", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0, NULL, HFILL }},
12073 { &hf_gtpv2_uplink_used_ue_ambr, { "Uplink Used UE AMBR", "gtpv2.uplink_used_ue_ambr", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0, NULL, HFILL }},
12074 { &hf_gtpv2_downlink_used_ue_ambr, { "Downlink Used UE AMBR", "gtpv2.downlink_used_ue_ambr", FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0, NULL, HFILL }},
12075 { &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 }},
12076 { &hf_gtpv2_ue_radio_capability_for_paging_information,{ "UE Radio Capability for Paging information", "gtpv2.UE_Radio_Capability_for_Paging_information", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12077 { &hf_gtpv2_authentication_quadruplets, { "Authentication Quadruplets", "gtpv2.authentication_quadruplets", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12078 { &hf_gtpv2_authentication_quintuplets, { "Authentication Quintuplets", "gtpv2.authentication_quintuplets", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12079 { &hf_gtpv2_mm_context_nh, { "NH (Next Hop)", "gtpv2.mm_context_nh", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12080 { &hf_gtpv2_mm_context_ncc, { "NCC (Next Hop Chaining Count)", "gtpv2.mm_context_ncc", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }},
12081 { &hf_gtpv2_nsapi08, { "NSAPI", "gtpv2.nsapi", FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
12082 { &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 }},
12083 { &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 }},
12084 { &hf_gtpv2_send_n_pdu_number, { "Send N-PDU Number", "gtpv2.send_n_pdu_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12085 { &hf_gtpv2_receive_n_pdu_number, { "Receive N-PDU Number", "gtpv2.receive_n_pdu_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12086 { &hf_gtpv2_hop_counter, { "Hop Counter", "gtpv2.hop_counter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12087 { &hf_gtpv2_packet_flow_id, { "Packet Flow ID", "gtpv2.packet_flow_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12088 { &hf_gtpv2_rrc_container, { "RRC Container", "gtpv2.rrc_container", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12089 { &hf_gtpv2_port_number, { "Port Number", "gtpv2.port_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12090 { &hf_gtpv2_proprietary_value, { "Proprietary value", "gtpv2.proprietary_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12091 { &hf_gtpv2_spare_bytes, { "Spare", "gtpv2.spare_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12092 { &hf_gtpv2_dl_pdcp_sequence_number, { "DL PDCP Sequence Number", "gtpv2.dl_pdcp_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12093 { &hf_gtpv2_ul_pdcp_sequence_number, { "UL PDCP Sequence Number", "gtpv2.ul_pdcp_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12094 { &hf_gtpv2_fq_csid_node_id, { "Node-ID", "gtpv2.fq_csid_node_id", FT_UINT32, BASE_DEC, NULL, 0x00000FFF, NULL, HFILL }},
12095 { &hf_gtpv2_fq_csid_mcc_mnc, { "MCC+MNC", "gtpv2.fq_csid_mcc_mnc", FT_UINT32, BASE_DEC, NULL, 0xFFFFF000, NULL, HFILL }},
12097 { &hf_gtpv2_twan_id_ts, { "TWAN Identifier Timestamp", "gtpv2.twan.id_ts", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0, NULL, HFILL } },
12098 { &hf_gtpv2_twan_flags,{ "Flags", "gtpv2.twan_id.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12099 { &hf_gtpv2_twan_bssidi,{ "BSSIDI", "gtpv2.twan_id.bssidi", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01, NULL, HFILL } },
12100 { &hf_gtpv2_twan_civai,{ "CIVAI", "gtpv2.twan_id.civai", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02, NULL, HFILL } },
12101 { &hf_gtpv2_twan_plmni,{ "PLMNI", "gtpv2.twan_id.plmni", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL } },
12102 { &hf_gtpv2_twan_opnai,{ "OPNAI", "gtpv2.twan_id.opnai", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08, NULL, HFILL } },
12103 { &hf_gtpv2_twan_laii,{ "LAII", "gtpv2.twan_id.laii", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10, NULL, HFILL } },
12104 { &hf_gtpv2_twan_ssid_len,{ "SSID Length", "gtpv2.twan_id.ssid_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12105 { &hf_gtpv2_twan_ssid,{ "SSID", "gtpv2.twan_id.ssid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12106 { &hf_gtpv2_twan_bssid,{ "BSSID", "gtpv2.twan_id.bssid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12107 { &hf_gtpv2_twan_civa_len,{ "Civic Address Length", "gtpv2.twan_id.civa_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12108 { &hf_gtpv2_twan_civa,{ "Civic Address Information", "gtpv2.twan_id.civa", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12109 { &hf_gtpv2_twan_plmnid,{ "TWAN PLMN-ID", "gtpv2.twan_id.plmnid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12110 { &hf_gtpv2_twan_op_name_len,{ "TWAN Operator Name Length", "gtpv2.twan_id.op_name_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12111 { &hf_gtpv2_twan_op_name,{ "TWAN Operator Name", "gtpv2.twan_id.op_name", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12112 { &hf_gtpv2_twan_relay_id_type,{ "Relay Identity Type", "gtpv2.twan_id.relay_id_type", FT_UINT8, BASE_DEC, VALS(gtpv2_twan_relay_id_type_vals), 0x0, NULL, HFILL } },
12113 { &hf_gtpv2_twan_relay_id_len,{ "Relay Identity Type Length", "gtpv2.twan_id.relay_id_type_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12114 { &hf_gtpv2_twan_relay_id,{ "Relay Identity", "gtpv2.twan_id.relay_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12115 { &hf_gtpv2_twan_relay_id_ipv4,{ "Relay Identity", "gtpv2.twan_id.relay_id_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12116 { &hf_gtpv2_twan_relay_id_ipv6,{ "Relay Identity", "gtpv2.twan_id.relay_id_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12117 { &hf_gtpv2_twan_circuit_id_len,{ "Relay Identity Type Length", "gtpv2.twan_id.relay_id_type_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12118 { &hf_gtpv2_twan_circuit_id,{ "Circuit-ID", "gtpv2.twan_id.circuit_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12119 { &hf_gtpv2_integer_number_val,{ "Value", "gtpv2.integer_number_val", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12120 { &hf_gtpv2_maximum_wait_time,{ "Maximum Wait Time", "gtpv2.maximum_wait_time", FT_UINT32, BASE_DEC | BASE_UNIT_STRING, UNS(&units_milliseconds), 0x0, NULL, HFILL } },
12121 { &hf_gtpv2_dl_buf_sug_pkt_cnt,{ "DL Buffering Suggested Packet Count", "gtpv2.dl_buf_sug_pkt_cnt", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12122 { &hf_gtpv2_ue_usage_type,{ "UE Usage Type", "gtpv2.ue_usage_type", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12123 { &hf_gtpv2_rem_run_serv_gap_t,{ "Remaining Running Service Gap Timer", "gtpv2.rem_run_serv_gap_t", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12124 { &hf_gtpv2_ran_nas_protocol_type, {"RAN/NAS Protocol Type", "gtpv2.ran_nas.protocol_type", FT_UINT8, BASE_DEC, VALS(ran_nas_prot_type_vals), 0xF0, NULL, HFILL} },
12125 { &hf_gtpv2_ran_nas_cause_type, {"RAN/NAS S1AP Cause Type", "gtpv2.ran_nas.s1ap_type", FT_UINT8, BASE_DEC, VALS(s1ap_Cause_vals), 0x0F, NULL, HFILL} },
12126 { &hf_gtpv2_ran_nas_cause_value, {"RAN/NAS Cause Value", "gtpv2.ran_nas.cause_value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} },
12127 { &hf_gtpv2_emm_cause, {"EMM Cause Value", "gtpv2.ran_nas.emm_cause", FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cause_values), 0x0, NULL, HFILL} },
12128 { &hf_gtpv2_esm_cause, {"ESM Cause Value", "gtpv2.ran_nas.esm_cause", FT_UINT8, BASE_DEC, VALS(nas_eps_esm_cause_vals), 0x0, NULL, HFILL} },
12129 { &hf_gtpv2_diameter_cause, {"Diameter Cause Value", "gtpv2.ran_nas.diameter_cause", FT_UINT16, BASE_DEC, VALS(diameter_3gpp_termination_cause_vals), 0x0, NULL, HFILL} },
12130 { &hf_gtpv2_ikev2_cause, {"IKEv2 Cause Value", "gtpv2.ran_nas.ikev2_cause", FT_UINT16, BASE_DEC, VALS(diameter_3gpp_IKEv2_error_type_vals), 0x0, NULL, HFILL} },
12131 { &hf_gtpv2_ciot_support_ind,{ "CIoT Optimizations Support Indication", "gtpv2.ciot_support_ind", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12132 { &hf_gtpv2_ciot_support_ind_spare_bits,
12133 { "Spare", "gtpv2.ciot_support_ind.spare_bits",
12134 FT_UINT8, BASE_HEX, NULL, 0xF0,
12135 NULL, HFILL }
12137 { &hf_gtpv2_ciot_support_ind_bit4,
12138 { "IHCSI (IP Header Compression Support)", "gtpv2.ciot_support_ind.ihcsi",
12139 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12140 NULL, HFILL }
12142 { &hf_gtpv2_ciot_support_ind_bit3,
12143 { "AWOPDN (Attach without PDN Support)", "gtpv2.ciot_support_ind.awopdn",
12144 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12145 NULL, HFILL }
12147 { &hf_gtpv2_ciot_support_ind_bit2,
12148 { "SCNIPDN (SCEF Non-IP PDN Support)", "gtpv2.ciot_support_ind.scnipdn",
12149 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12150 NULL, HFILL }
12152 { &hf_gtpv2_ciot_support_ind_bit1,
12153 { "SGNIPDN (SGi Non-IP PDN Support)", "gtpv2.ciot_support_ind.sgnipdn",
12154 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12155 NULL, HFILL }
12157 { &hf_gtpv2_length_of_node_name,
12158 { "Length of Node Name", "gtpv2.length_of_node_name",
12159 FT_UINT8, BASE_DEC, NULL, 0x0,
12160 NULL, HFILL }
12162 { &hf_gtpv2_length_of_node_realm,
12163 { "Length of Node Realm", "gtpv2.length_of_node_realm",
12164 FT_UINT8, BASE_DEC, NULL, 0x0,
12165 NULL, HFILL }
12167 { &hf_gtpv2_node_name,
12168 { "Node Name", "gtpv2.node_name",
12169 FT_STRING, BASE_NONE, NULL, 0x0,
12170 NULL, HFILL }
12172 { &hf_gtpv2_node_realm,
12173 { "Node Realm", "gtpv2.node_realm",
12174 FT_STRING, BASE_NONE, NULL, 0x0,
12175 NULL, HFILL }
12177 { &hf_gtpv2_ms_ts,
12178 { "Millisecond Time Stamp", "gtpv2.ms_ts",
12179 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
12180 NULL, HFILL }
12182 { &hf_gtpv2_origination_ts,
12183 { "Origination Time Stamp", "gtpv2.origination_ts",
12184 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
12185 NULL, HFILL }
12187 { &hf_gtpv2_mon_event_inf_nsur,
12188 { "NSUR (Notify SCEF when UE becomes Reachable)", "gtpv2.mon_event_inf.nsur",
12189 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
12190 NULL, HFILL }
12192 { &hf_gtpv2_mon_event_inf_nsui,
12193 { "NSUI (Notify SCEF when UE becomes Idle)", "gtpv2.mon_event_inf.nsui",
12194 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
12195 NULL, HFILL }
12197 { &hf_gtpv2_mon_event_inf_nscf,
12198 { "NSCF (Notify SCEF about Communication Failure events)", "gtpv2.mon_event_inf.nscf",
12199 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
12200 NULL, HFILL }
12202 { &hf_gtpv2_mon_event_inf_srie,
12203 { "SRIE (SCEF Reference Id Extension)", "gtpv2.mon_event_ext_inf.srie",
12204 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
12205 NULL, HFILL }
12207 { &hf_gtpv2_mon_event_inf_scef_reference_id,
12208 { "SCEF Reference ID", "gtpv2.mon_event_inf.scef_reference_id",
12209 FT_UINT32, BASE_DEC, NULL, 0x0,
12210 NULL, HFILL }
12212 { &hf_gtpv2_mon_event_inf_scef_reference_id_ext,
12213 { "SCEF Reference ID Ext", "gtpv2.mon_event_inf.scef_reference_id_ext",
12214 FT_UINT64, BASE_DEC, NULL, 0x0,
12215 NULL, HFILL }
12217 { &hf_gtpv2_mon_event_inf_scef_id_length,
12218 { "SCEF ID length", "gtpv2.mon_event_inf.scef_id_length",
12219 FT_UINT8, BASE_DEC, NULL, 0x0,
12220 NULL, HFILL }
12222 { &hf_gtpv2_mon_event_inf_scef_id,
12223 { "SCEF ID", "gtpv2.mon_event_inf.scef_id",
12224 FT_STRING, BASE_NONE, NULL, 0x0,
12225 NULL, HFILL }
12227 { &hf_gtpv2_mon_event_inf_remaining_number_of_reports,
12228 { "Remaining Number of Reports", "gtpv2.mon_event_inf.remaining_number_of_reports",
12229 FT_UINT16, BASE_DEC, NULL, 0x0,
12230 NULL, HFILL }
12232 { &hf_gtpv2_mon_event_ext_inf_lrtp,
12233 { "LRTP (Remaining Minimum Periodic Location Reporting Time Present)", "gtpv2.mon_event_ext_inf.lrtp",
12234 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
12235 NULL, HFILL }
12237 { &hf_gtpv2_mon_event_ext_inf_srie,
12238 { "SRIE (SCEF Reference Id Extension)", "gtpv2.mon_event_ext_inf.srie",
12239 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
12240 NULL, HFILL }
12242 { &hf_gtpv2_mon_event_ext_inf_scef_reference_id,
12243 { "SCEF Reference ID", "gtpv2.mon_event_ext_inf.scef_reference_id",
12244 FT_UINT32, BASE_DEC, NULL, 0x0,
12245 NULL, HFILL }
12247 { &hf_gtpv2_mon_event_ext_inf_scef_id_length,
12248 { "SCEF ID length", "gtpv2.mon_event_ext_inf.scef_id_length",
12249 FT_UINT8, BASE_DEC, NULL, 0x0,
12250 NULL, HFILL }
12252 { &hf_gtpv2_mon_event_ext_inf_scef_id,
12253 { "SCEF ID", "gtpv2.mon_event_ext_inf.scef_id",
12254 FT_STRING, BASE_NONE, NULL, 0x0,
12255 NULL, HFILL }
12257 { &hf_gtpv2_mon_event_ext_inf_remain_min_period_loc_report_type,
12258 { "Remaining Minimum Periodic Location Reporting Time", "gtpv2.mon_event_ext_inf.remain_min_period_loc_report_type",
12259 FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
12260 NULL, HFILL }
12262 { &hf_gtpv2_mon_event_ext_inf_scef_reference_id_ext,
12263 { "SCEF Reference ID Ext", "gtpv2.mon_event_ext_inf.scef_reference_id_ext",
12264 FT_UINT64, BASE_DEC, NULL, 0x0,
12265 NULL, HFILL }
12267 { &hf_gtpv2_rohc_profile_flags,
12268 { "ROHC Profiles flags", "gtpv2.rohc_profile_flags",
12269 FT_UINT8, BASE_HEX, NULL, 0x0,
12270 NULL, HFILL }
12272 { &hf_gtpv2_rohc_profiles_bit0,
12273 { "Profile Identifier: 0x0002, UDP/IP", "gtpv2.rohc_profiles.b0",
12274 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x01,
12275 NULL, HFILL }
12277 { &hf_gtpv2_rohc_profiles_bit1,
12278 { "Profile Identifier: 0x0003, ESP/IP", "gtpv2.rohc_profiles.b1",
12279 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x02,
12280 NULL, HFILL }
12282 { &hf_gtpv2_rohc_profiles_bit2,
12283 { "Profile Identifier: 0x0004, IP", "gtpv2.rohc_profiles.b2",
12284 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x04,
12285 NULL, HFILL }
12287 { &hf_gtpv2_rohc_profiles_bit3,
12288 { "Profile Identifier: 0x0006, TCP/IP", "gtpv2.rohc_profiles.b3",
12289 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x08,
12290 NULL, HFILL }
12292 { &hf_gtpv2_rohc_profiles_bit4,
12293 { "Profile Identifier: 0x0102, UDP/IP", "gtpv2.rohc_profiles.b4",
12294 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x10,
12295 NULL, HFILL }
12297 { &hf_gtpv2_rohc_profiles_bit5,
12298 { "Profile Identifier: 0x0103, ESP/IP", "gtpv2.rohc_profiles.b5",
12299 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x20,
12300 NULL, HFILL }
12302 { &hf_gtpv2_rohc_profiles_bit6,
12303 { "Profile Identifier: 0x0104, IP", "gtpv2.rohc_profiles.b6",
12304 FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x40,
12305 NULL, HFILL }
12307 { &hf_gtpv2_rohc_profiles_bit7,
12308 { "Spare", "gtpv2.rohc_profiles.b7",
12309 FT_BOOLEAN, 8, NULL, 0x80,
12310 NULL, HFILL }
12312 { &hf_gtpv2_max_cid,
12313 { "MAX_CID", "gtpv2.max_cid",
12314 FT_UINT16, BASE_DEC, NULL, 0x0,
12315 NULL, HFILL }
12317 { &hf_gtpv2_uplink_rate_limit,
12318 { "Uplink Rate Limit", "gtpv2.uplink_rate_limit",
12319 FT_UINT16, BASE_DEC, NULL, 0x0,
12320 NULL, HFILL }
12322 { &hf_gtpv2_downlink_rate_limit,
12323 { "Downlink Rate Limit", "gtpv2.downlink_rate_limit",
12324 FT_UINT16, BASE_DEC, NULL, 0x0,
12325 NULL, HFILL }
12327 { &hf_gtpv2_timestamp_value,
12328 { "Timestamp value", "gtpv2.timestamp_value",
12329 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0x0,
12330 NULL, HFILL }
12332 { &hf_gtpv2_counter_value,
12333 { "Counter value", "gtpv2.counter_value",
12334 FT_UINT8, BASE_DEC, NULL, 0x0,
12335 NULL, HFILL }
12337 { &hf_gtpv2_mapped_ue_usage_type,
12338 { "Mapped UE usage type", "gtpv2.mapped_ue_usage_type",
12339 FT_UINT16, BASE_DEC, NULL, 0x0,
12340 NULL, HFILL }
12342 { &hf_gtpv2_uli_flags,
12343 { "ULI Flags", "gtpv2.uli_flags",
12344 FT_UINT8, BASE_HEX, NULL, 0x0,
12345 NULL, HFILL }
12347 { &hf_gtpv2_dcnr,
12348 { "DCNR (Dual connectivity with NR)", "gtpv2.dcnr",
12349 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12350 NULL, HFILL }
12352 { &hf_gtpv2_secondary_rat_usage_data_report,
12353 { "Secondary RAT Usage Data Report", "gtpv2.secondary_rat_usage_data_report",
12354 FT_UINT8, BASE_DEC, NULL, 0x0,
12355 NULL, HFILL }
12357 { &hf_gtpv2_secondary_rat_usage_data_report_spare_bits,
12358 { "Spare", "gtpv2.secondary_rat_usage_data_report.spare_bits",
12359 FT_UINT8, BASE_HEX, NULL, 0xF8,
12360 NULL, HFILL }
12362 { &hf_gtpv2_secondary_rat_usage_data_report_bit3,
12363 { "SRUDN (Secondary RAT Usage Report from NG-RAN)", "gtpv2.secondary_rat_usage_data_report.srudn",
12364 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12365 NULL, HFILL }
12367 { &hf_gtpv2_secondary_rat_usage_data_report_bit2,
12368 { "IRSGW (Intended Receiver SGW)", "gtpv2.secondary_rat_usage_data_report.irsgw",
12369 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12370 NULL, HFILL }
12372 { &hf_gtpv2_secondary_rat_usage_data_report_bit1,
12373 { "IRPGW (Intended Receiver PGW)", "gtpv2.secondary_rat_usage_data_report.irpgw",
12374 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12375 NULL, HFILL }
12377 { &hf_gtpv2_secondary_rat_usage_data_report_rat_type,
12378 {"RAT Type", "gtpv2.secondary_rat_usage_data_report.rat_type",
12379 FT_UINT8, BASE_DEC, VALS(gtpv2_secondary_rat_type_vals), 0x0,
12380 NULL, HFILL}
12382 { &hf_gtpv2_secondary_rat_usage_data_report_start_timestamp,
12383 { "Start timestamp", "gtpv2.secondary_rat_usage_data_report.start_timestamp",
12384 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0x0,
12385 NULL, HFILL }
12387 { &hf_gtpv2_secondary_rat_usage_data_report_end_timestamp,
12388 { "End timestamp", "gtpv2.secondary_rat_usage_data_report.end_timestamp",
12389 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0x0,
12390 NULL, HFILL }
12392 { &hf_gtpv2_secondary_rat_usage_data_report_usage_data_dl,
12393 { "Usage Data DL", "gtpv2.secondary_rat_usage_data_report.usage_data_dl",
12394 FT_UINT64, BASE_DEC, NULL, 0x0,
12395 NULL, HFILL }
12397 { &hf_gtpv2_secondary_rat_usage_data_report_usage_data_ul,
12398 { "Usage Data UL", "gtpv2.secondary_rat_usage_data_report.usage_data_ul",
12399 FT_UINT64, BASE_DEC, NULL, 0x0,
12400 NULL, HFILL }
12402 { &hf_gtpv2_secondary_rat_usage_data_report_srudn_length,
12403 { "SRUDN length", "gtpv2.mon_event_inf.srudn_length",
12404 FT_UINT8, BASE_DEC, NULL, 0x0,
12405 NULL, HFILL }
12407 { &hf_gtpv2_secondary_rat_usage_data_report_srudn_value,
12408 { "SecondaryRATDataUsageReportTransfer", "gtpv2.mon_event_inf.srudn_value",
12409 FT_BYTES, BASE_NONE, NULL, 0x0,
12410 NULL, HFILL }
12412 { &hf_gtpv2_csg_info_rep_action_b0,
12413 { "UCICSG", "gtpv2.csg_info_rep_action.ucicsg",
12414 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12415 NULL, HFILL }
12417 { &hf_gtpv2_csg_info_rep_action_b1,
12418 { "UCISHC", "gtpv2.csg_info_rep_action.ucishc",
12419 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12420 NULL, HFILL }
12422 { &hf_gtpv2_csg_info_rep_action_b2,
12423 { "UCIUHC", "gtpv2.csg_info_rep_action.uciuhc",
12424 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12425 NULL, HFILL }
12427 { &hf_gtpv2_gnodeb_id_len,
12428 {"gNodeB ID Length", "gtpv2.gnodeb_id_len",
12429 FT_UINT8, BASE_DEC, NULL, 0x3f,
12430 NULL, HFILL}
12432 { &hf_gtpv2_gnodeb_id,
12433 { "gNodeB ID", "gtpv2.gnodeb_id",
12434 FT_UINT32, BASE_DEC, NULL, 0x0,
12435 NULL, HFILL }
12437 { &hf_gtpv2_macro_ng_enodeb_id,
12438 { "Macro ng-eNodeB ID", "gtpv2.ng_enodeb_id",
12439 FT_UINT24, BASE_DEC, NULL, 0x0fffff,
12440 NULL, HFILL }
12442 { &hf_gtpv2_5gs_tac,
12443 { "5GS Tracking Area Code (TAC)", "gtpv2.5gs_tac",
12444 FT_UINT24, BASE_DEC, NULL, 0x0,
12445 NULL, HFILL }
12447 { &hf_gtpv2_en_gnb_id_len,
12448 {"en-gNB ID Length", "gtpv2.en_gnb_id_len",
12449 FT_UINT8, BASE_DEC, NULL, 0x3f,
12450 NULL, HFILL}
12452 { &hf_gtpv2_5tac,
12453 { "5TAC", "gtpv2.5tac",
12454 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
12455 NULL, HFILL }
12457 { &hf_gtpv2_etac,
12458 { "ETAC", "gtpv2.etac",
12459 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
12460 NULL, HFILL }
12462 { &hf_gtpv2_en_gnb_id,
12463 { "gNodeB ID", "gtpv2.en_gnb_id",
12464 FT_UINT32, BASE_DEC, NULL,0x0,
12465 NULL, HFILL }
12467 { &hf_gtpv2_trig_event_len,
12468 { "Length of Triggering Events", "gtpv2.trig_event_len",
12469 FT_UINT8, BASE_DEC, NULL,0x0,
12470 NULL, HFILL }
12472 { &hf_gtpv2_ne_list_len,
12473 { "Length of List of NE Types", "gtpv2.ne_list_len",
12474 FT_UINT8, BASE_DEC, NULL,0x0,
12475 NULL, HFILL }
12477 { &hf_gtpv2_ses_trs_depth,
12478 { "Session Trace Depth", "gtpv2.ses_trs_dept",
12479 FT_UINT8, BASE_DEC, NULL,0x0,
12480 NULL, HFILL }
12482 { &hf_gtpv2_list_of_if_len,
12483 { "Length of List of Interfaces", "gtpv2.list_of_if_len",
12484 FT_UINT8, BASE_DEC, NULL,0x0,
12485 NULL, HFILL }
12487 { &hf_gtpv2_trs_coll_ip_addr_len,
12488 { "Length of IP Address of Trace Collection Entity", "gtpv2.trs_coll_ip_addr_len",
12489 FT_UINT8, BASE_DEC, NULL,0x0,
12490 NULL, HFILL }
12492 { &hf_gtpv2_trs_coll_ipv4_addr,
12493 {"IP Address of Trace Collection Entity", "gtpv2.trs_coll_ipv4_addr",
12494 FT_IPv4, BASE_NONE, NULL, 0x0,
12495 NULL, HFILL}
12497 { &hf_gtpv2_trs_coll_ipv6_addr,
12498 {"IP Address of Trace Collection Entity", "gtpv2.trs_coll_ipv6_addr",
12499 FT_IPv6, BASE_NONE, NULL, 0x0,
12500 NULL, HFILL}
12502 { &hf_gtpv2_ext_tra_info_loi_mscs_cap,
12503 { "CAP", "gtpv2.ext_tra_info_loi.mscs.cap",
12504 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12505 NULL, HFILL }
12507 { &hf_gtpv2_ext_tra_info_loi_mscs_map_f,
12508 { "MAP-F", "gtpv2.ext_tra_info_loi.mscs.map_f",
12509 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12510 NULL, HFILL }
12512 { &hf_gtpv2_ext_tra_info_loi_mscs_map_e,
12513 { "MAP-E", "gtpv2.ext_tra_info_loi.mscs.map_e",
12514 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12515 NULL, HFILL }
12517 { &hf_gtpv2_ext_tra_info_loi_mscs_map_b,
12518 { "MAP-B", "gtpv2.ext_tra_info_loi.mscs.map_b",
12519 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12520 NULL, HFILL }
12522 { &hf_gtpv2_ext_tra_info_loi_mscs_map_g,
12523 { "MAP-G", "gtpv2.ext_tra_info_loi.mscs.map_g",
12524 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12525 NULL, HFILL }
12527 { &hf_gtpv2_ext_tra_info_loi_mscs_mc,
12528 { "Mc", "gtpv2.ext_tra_info_loi.mscs.mc",
12529 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12530 NULL, HFILL }
12532 { &hf_gtpv2_ext_tra_info_loi_mscs_iu,
12533 { "Iu", "gtpv2.ext_tra_info_loi.mscs.iu",
12534 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12535 NULL, HFILL }
12537 { &hf_gtpv2_ext_tra_info_loi_mscs_a,
12538 { "A","gtpv2.ext_tra_info_loi.mscs.a",
12539 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12540 NULL, HFILL }
12542 { &hf_gtpv2_ext_tra_info_loi_mscs_map_c,
12543 { "MAP-C", "gtpv2.ext_tra_info_loi.mscs.map_c",
12544 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12545 NULL, HFILL }
12547 { &hf_gtpv2_ext_tra_info_loi_mscs_map_d,
12548 { "MAP-D", "gtpv2.ext_tra_info_loi.mscs.map_d",
12549 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12550 NULL, HFILL }
12552 { &hf_gtpv2_ext_tra_info_loi_mgw_iuup,
12553 { "Iu-UP", "gtpv2.ext_tra_info_loi.mgw.iuup",
12554 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12555 NULL, HFILL }
12557 { &hf_gtpv2_ext_tra_info_loi_mgw_nbup,
12558 { "Nb-UP", "gtpv2.ext_tra_info_loi.mgw.nbup",
12559 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12560 NULL, HFILL }
12562 { &hf_gtpv2_ext_tra_info_loi_mgw_mc,
12563 { "Mc", "gtpv2.ext_tra_info_loi.mgw.mc",
12564 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12565 NULL, HFILL }
12567 { &hf_gtpv2_ext_tra_info_loi_sgsn_ge,
12568 { "Ge", "gtpv2.ext_tra_info_loi.sgsn.ge",
12569 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12570 NULL, HFILL }
12572 { &hf_gtpv2_ext_tra_info_loi_sgsn_gs,
12573 { "Gs", "gtpv2.ext_tra_info_loi.sgsn.gs",
12574 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12575 NULL, HFILL }
12577 { &hf_gtpv2_ext_tra_info_loi_sgsn_map_gf,
12578 { "MAP-Gf", "gtpv2.ext_tra_info_loi.sgsn.map_gf",
12579 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12580 NULL, HFILL }
12582 { &hf_gtpv2_ext_tra_info_loi_sgsn_map_gd,
12583 { "MAP-Gd", "gtpv2.ext_tra_info_loi.sgsn.map_gd",
12584 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12585 NULL, HFILL }
12587 { &hf_gtpv2_ext_tra_info_loi_sgsn_map_gr,
12588 { "MAP-Gr", "gtpv2.ext_tra_info_loi.sgsn.map_gr",
12589 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12590 NULL, HFILL }
12592 { &hf_gtpv2_ext_tra_info_loi_sgsn_gn,
12593 { "Gn", "gtpv2.ext_tra_info_loi.sgsn.gn",
12594 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12595 NULL, HFILL }
12597 { &hf_gtpv2_ext_tra_info_loi_sgsn_iu,
12598 { "Iu", "gtpv2.ext_tra_info_loi.sgsn.iu",
12599 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12600 NULL, HFILL }
12602 { &hf_gtpv2_ext_tra_info_loi_sgsn_gb,
12603 { "Gb", "gtpv2.ext_tra_info_loi.sgsn.gb",
12604 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12605 NULL, HFILL }
12607 { &hf_gtpv2_ext_tra_info_loi_sgsn_s13,
12608 { "S13", "gtpv2.ext_tra_info_loi.sgsn.s13",
12609 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12610 NULL, HFILL }
12612 { &hf_gtpv2_ext_tra_info_loi_sgsn_s3,
12613 { "S3", "gtpv2.ext_tra_info_loi.sgsn.s3",
12614 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12615 NULL, HFILL }
12617 { &hf_gtpv2_ext_tra_info_loi_sgsn_s4,
12618 { "S4", "gtpv2.ext_tra_info_loi.sgsn.s4",
12619 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12620 NULL, HFILL }
12622 { &hf_gtpv2_ext_tra_info_loi_sgsn_s6d,
12623 { "S6d", "gtpv2.ext_tra_info_loi.sgsn.s6d",
12624 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12625 NULL, HFILL }
12627 { &hf_gtpv2_ext_tra_info_loi_ggsn_gmb,
12628 { "Gmb", "gtpv2.ext_tra_info_loi.ggsn.gmb",
12629 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12630 NULL, HFILL }
12632 { &hf_gtpv2_ext_tra_info_loi_ggsn_gi,
12633 { "Gi", "gtpv2.ext_tra_info_loi.ggsn.gi",
12634 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12635 NULL, HFILL }
12637 { &hf_gtpv2_ext_tra_info_loi_ggsn_gn,
12638 { "Gn", "gtpv2.ext_tra_info_loi.ggsn.gn",
12639 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12640 NULL, HFILL }
12642 { &hf_gtpv2_ext_tra_info_loi_rnc_uu,
12643 { "Uu", "gtpv2.ext_tra_info_loi.rrc.uu",
12644 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12645 NULL, HFILL }
12647 { &hf_gtpv2_ext_tra_info_loi_rnc_iub,
12648 { "Iub", "gtpv2.ext_tra_info_loi.rrc.iub",
12649 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12650 NULL, HFILL }
12652 { &hf_gtpv2_ext_tra_info_loi_rnc_iur,
12653 { "Iur", "gtpv2.ext_tra_info_loi.rrc.iur",
12654 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12655 NULL, HFILL }
12657 { &hf_gtpv2_ext_tra_info_loi_rnc_iu,
12658 { "Iu", "gtpv2.ext_tra_info_loi.rrc.iu",
12659 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12660 NULL, HFILL }
12662 { &hf_gtpv2_ext_tra_info_loi_bm_sc_gmb,
12663 { "Gmb", "gtpv2.ext_tra_info_loi.bm_sc.gmb",
12664 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12665 NULL, HFILL }
12667 { &hf_gtpv2_ext_tra_info_loi_mme_s13,
12668 { "S13", "gtpv2.ext_tra_info_loi.mme.s13",
12669 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12670 NULL, HFILL }
12672 { &hf_gtpv2_ext_tra_info_loi_mme_s11,
12673 { "S11", "gtpv2.ext_tra_info_loi.mme.s11",
12674 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12675 NULL, HFILL }
12677 { &hf_gtpv2_ext_tra_info_loi_mme_s10,
12678 { "S10", "gtpv2.ext_tra_info_loi.mme.s10",
12679 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12680 NULL, HFILL }
12682 { &hf_gtpv2_ext_tra_info_loi_mme_s6a,
12683 { "S6a", "gtpv2.ext_tra_info_loi.mme.s6a",
12684 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12685 NULL, HFILL }
12687 { &hf_gtpv2_ext_tra_info_loi_mme_s3,
12688 { "S3", "gtpv2.ext_tra_info_loi.mme.s3",
12689 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12690 NULL, HFILL }
12692 { &hf_gtpv2_ext_tra_info_loi_mme_s1_mme,
12693 { "S1-mme", "gtpv2.ext_tra_info_loi.mme.s1_mme",
12694 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12695 NULL, HFILL }
12697 { &hf_gtpv2_ext_tra_info_loi_sgw_gxc,
12698 { "Gxc", "gtpv2.ext_tra_info_loi.sgw.gxc",
12699 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12700 NULL, HFILL }
12702 { &hf_gtpv2_ext_tra_info_loi_sgw_s11,
12703 { "S11", "gtpv2.ext_tra_info_loi.sgw.s11",
12704 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12705 NULL, HFILL }
12707 { &hf_gtpv2_ext_tra_info_loi_sgw_s8b,
12708 { "S8b", "gtpv2.ext_tra_info_loi.sgw.s8b",
12709 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12710 NULL, HFILL }
12712 { &hf_gtpv2_ext_tra_info_loi_sgw_s5,
12713 { "S5", "gtpv2.ext_tra_info_loi.sgw.s5",
12714 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12715 NULL, HFILL }
12717 { &hf_gtpv2_ext_tra_info_loi_sgw_s4,
12718 { "S4", "gtpv2.ext_tra_info_loi.sgw.s4",
12719 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12720 NULL, HFILL }
12722 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_sgi,
12723 { "Sgi", "gtpv2.ext_tra_info_loi.pdn_gw.sgi",
12724 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12725 NULL, HFILL }
12727 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s8b,
12728 { "S8b", "gtpv2.ext_tra_info_loi.pdn_gw.s8b",
12729 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12730 NULL, HFILL }
12732 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_gx,
12733 { "Gx", "gtpv2.ext_tra_info_loi.pdn_gw.gx",
12734 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12735 NULL, HFILL }
12737 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s6b,
12738 { "S6b", "gtpv2.ext_tra_info_loi.pdn_gw.s6b",
12739 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12740 NULL, HFILL }
12742 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s5,
12743 { "S5", "gtpv2.ext_tra_info_loi.pdn_gw.s5",
12744 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12745 NULL, HFILL }
12747 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2c,
12748 { "S2c", "gtpv2.ext_tra_info_loi.pdn_gw.s2c",
12749 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12750 NULL, HFILL }
12752 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2b,
12753 { "S2b", "gtpv2.ext_tra_info_loi.pdn_gw.s2b",
12754 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12755 NULL, HFILL }
12757 { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2a,
12758 { "S2a", "gtpv2.ext_tra_info_loi.pdn_gw.s2a",
12759 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12760 NULL, HFILL }
12762 { &hf_gtpv2_ext_tra_info_loi_enb_uu,
12763 { "Uu", "gtpv2.ext_tra_info_loi.enb.uu",
12764 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12765 NULL, HFILL }
12767 { &hf_gtpv2_ext_tra_info_loi_enb_x2,
12768 { "X2", "gtpv2.ext_tra_info_loi.enb.x2",
12769 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12770 NULL, HFILL }
12772 { &hf_gtpv2_ext_tra_info_loi_enb_s1_mme,
12773 { "S1-MME", "gtpv2.ext_tra_info_loi.enb.s1_mme",
12774 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12775 NULL, HFILL }
12777 { &hf_gtpv2_ext_tra_info_loi_hss_sh,
12778 { "Sh", "gtpv2.ext_tra_info_loi.hss.Sh",
12779 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12780 NULL, HFILL }
12782 { &hf_gtpv2_ext_tra_info_loi_hss_s6a,
12783 { "S6a", "gtpv2.ext_tra_info_loi.hss.S6a",
12784 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12785 NULL, HFILL }
12787 { &hf_gtpv2_ext_tra_info_loi_hss_s6d,
12788 { "S6d", "gtpv2.ext_tra_info_loi.hss.S6d",
12789 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12790 NULL, HFILL }
12792 { &hf_gtpv2_ext_tra_info_loi_hss_cx,
12793 { "Cx", "gtpv2.ext_tra_info_loi.hss.cx",
12794 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12795 NULL, HFILL }
12797 { &hf_gtpv2_ext_tra_info_loi_hss_map_gr,
12798 { "MAP-Gr", "gtpv2.ext_tra_info_loi.hss.map_gr",
12799 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12800 NULL, HFILL }
12802 { &hf_gtpv2_ext_tra_info_loi_hss_map_gc,
12803 { "MAP-Gc", "gtpv2.ext_tra_info_loi.hss.map_gc",
12804 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12805 NULL, HFILL }
12807 { &hf_gtpv2_ext_tra_info_loi_hss_map_d,
12808 { "MAP-D", "gtpv2.ext_tra_info_loi.hss.map_d",
12809 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12810 NULL, HFILL }
12812 { &hf_gtpv2_ext_tra_info_loi_hss_map_c,
12813 { "MAP-C", "gtpv2.ext_tra_info_loi.hss.map_c",
12814 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12815 NULL, HFILL }
12817 { &hf_gtpv2_ext_tra_info_loi_eir_map_gf,
12818 { "MAP-Gf", "gtpv2.ext_tra_info_loi.eir.map_gf",
12819 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12820 NULL, HFILL }
12822 { &hf_gtpv2_ext_tra_info_loi_eir_s13p,
12823 { "S13'", "gtpv2.ext_tra_info_loi.eir.s13p",
12824 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12825 NULL, HFILL }
12827 { &hf_gtpv2_ext_tra_info_loi_eir_s13,
12828 { "S13", "gtpv2.ext_tra_info_loi.eir.s13",
12829 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12830 NULL, HFILL }
12832 { &hf_gtpv2_ext_tra_info_loi_eir_map_f,
12833 { "MAP-F", "gtpv2.ext_tra_info_loi.eir.map_f",
12834 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12835 NULL, HFILL }
12837 { &hf_gtpv2_ext_tra_info_loi_amf_n20,
12838 { "N20", "gtpv2.ext_tra_info_loi.amf.n20",
12839 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12840 NULL, HFILL }
12842 { &hf_gtpv2_ext_tra_info_loi_amf_n15,
12843 { "N15", "gtpv2.ext_tra_info_loi.amf.n15",
12844 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12845 NULL, HFILL }
12847 { &hf_gtpv2_ext_tra_info_loi_amf_n14,
12848 { "N14", "gtpv2.ext_tra_info_loi.amf.n14",
12849 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12850 NULL, HFILL }
12852 { &hf_gtpv2_ext_tra_info_loi_amf_n12,
12853 { "N12", "gtpv2.ext_tra_info_loi.amf.n12",
12854 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12855 NULL, HFILL }
12857 { &hf_gtpv2_ext_tra_info_loi_amf_n11,
12858 { "N11", "gtpv2.ext_tra_info_loi.amf.n11",
12859 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12860 NULL, HFILL }
12862 { &hf_gtpv2_ext_tra_info_loi_amf_n8,
12863 { "N8", "gtpv2.ext_tra_info_loi.amf.n8",
12864 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12865 NULL, HFILL }
12867 { &hf_gtpv2_ext_tra_info_loi_amf_n2,
12868 { "N2", "gtpv2.ext_tra_info_loi.amf.n2",
12869 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12870 NULL, HFILL }
12872 { &hf_gtpv2_ext_tra_info_loi_amf_n1,
12873 { "N1", "gtpv2.ext_tra_info_loi.amf.n1",
12874 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12875 NULL, HFILL }
12877 { &hf_gtpv2_ext_tra_info_loi_amf_n22,
12878 { "N22", "gtpv2.ext_tra_info_loi.amf.n22",
12879 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12880 NULL, HFILL }
12882 { &hf_gtpv2_ext_tra_info_loi_amf_n26,
12883 { "N26", "gtpv2.ext_tra_info_loi.amf.n26",
12884 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12885 NULL, HFILL }
12887 { &hf_gtpv2_ext_tra_info_loi_pcf_n15,
12888 { "N15", "gtpv2.ext_tra_info_loi.pcf.n15",
12889 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12890 NULL, HFILL }
12892 { &hf_gtpv2_ext_tra_info_loi_pcf_n7,
12893 { "N7", "gtpv2.ext_tra_info_loi.pcf.n7",
12894 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12895 NULL, HFILL }
12897 { &hf_gtpv2_ext_tra_info_loi_pcf_n5,
12898 { "N5", "gtpv2.ext_tra_info_loi.pcf.n5",
12899 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12900 NULL, HFILL }
12902 { &hf_gtpv2_ext_tra_info_loi_smf_s5_c,
12903 { "S5-C", "gtpv2.ext_tra_info_loi.smf.s5_c",
12904 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12905 NULL, HFILL }
12907 { &hf_gtpv2_ext_tra_info_loi_smf_n11,
12908 { "N11", "gtpv2.ext_tra_info_loi.smf.n11",
12909 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12910 NULL, HFILL }
12912 { &hf_gtpv2_ext_tra_info_loi_smf_n10,
12913 { "N10", "gtpv2.ext_tra_info_loi.smf.n10",
12914 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12915 NULL, HFILL }
12917 { &hf_gtpv2_ext_tra_info_loi_smf_n7,
12918 { "N7", "gtpv2.ext_tra_info_loi.smf.n7",
12919 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12920 NULL, HFILL }
12922 { &hf_gtpv2_ext_tra_info_loi_smf_n4,
12923 { "N4", "gtpv2.ext_tra_info_loi.smf.n4",
12924 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12925 NULL, HFILL }
12927 { &hf_gtpv2_ext_tra_info_loi_upf_n4,
12928 { "N4", "gtpv2.ext_tra_info_loi.upf.n4",
12929 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12930 NULL, HFILL }
12932 { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_e1_c,
12933 { "E1-C", "gtpv2.ext_tra_info_loi.ng_ran_node.e1_c",
12934 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12935 NULL, HFILL }
12937 { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_f1_c,
12938 { "F1-C", "gtpv2.ext_tra_info_loi.ng_ran_node.f1_c",
12939 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12940 NULL, HFILL }
12942 { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_Uu,
12943 { "Uu", "gtpv2.ext_tra_info_loi.ng_ran_node.uu",
12944 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12945 NULL, HFILL }
12947 { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_xn_c,
12948 { "Xn-C", "gtpv2.ext_tra_info_loi.ng_ran_node.xn_c",
12949 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12950 NULL, HFILL }
12952 { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_ng_c,
12953 { "NG-C", "gtpv2.ext_tra_info_loi.ng_ran_node.ng_c",
12954 FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12955 NULL, HFILL }
12957 { &hf_gtpv2_nr_add_exception_rpts,
12958 { "Number of additional exception reports", "gtpv2.r_add_exception_rpts",
12959 FT_UINT32, BASE_DEC, NULL,0x0,
12960 NULL, HFILL }
12962 { &hf_gtpv2_nr_ul_pkts_all,
12963 { "Number of Uplink packets allowed", "gtpv2.nr_ul_pkts_all",
12964 FT_UINT32, BASE_DEC, NULL,0x0,
12965 NULL, HFILL }
12967 { &hf_gtpv2_nr_dl_pkts_all,
12968 { "Number of Downlink packets allowed", "gtpv2.nr_dl_pkts_all",
12969 FT_UINT32, BASE_DEC, NULL,0x0,
12970 NULL, HFILL }
12972 { &hf_apn_rte_cntrl_status_val_time,
12973 { "APN Rate Control Status validity Time", "gtpv2.pn_rte_cntrl_status_val_time",
12974 FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL,0x0,
12975 NULL, HFILL }
12977 { &hf_gtpv2_max_pkt_loss_rte_ul_flg,
12978 { "UL", "gtpv2.max_pkt_loss_rte_ul_flg",
12979 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
12980 NULL, HFILL }
12982 { &hf_gtpv2_max_pkt_loss_rte_dl_flg,
12983 { "DL", "gtpv2.max_pkt_loss_rte_dl_flg",
12984 FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
12985 NULL, HFILL }
12987 { &hf_gtpv2_max_pkt_loss_rte_ul,
12988 { "Maximum Packet Loss Rate UL", "gtpv2.max_pkt_loss_rte_ul",
12989 FT_UINT16, BASE_CUSTOM, CF_FUNC(value_in_tenth_of_percent_fmt), 0x0,
12990 NULL, HFILL }
12992 { &hf_gtpv2_max_pkt_loss_rte_dl,
12993 { "Maximum Packet Loss Rate DL", "gtpv2.max_pkt_loss_rte_dl",
12994 FT_UINT16, BASE_CUSTOM, CF_FUNC(value_in_tenth_of_percent_fmt), 0x0,
12995 NULL, HFILL }
12997 { &hf_gtpv2_mm_context_iov_updates_counter,
12998 { "IOV_updates counter", "gtpv2.mm_context.iov_updates_counter",
12999 FT_UINT8, BASE_DEC, NULL, 0x0,
13000 NULL, HFILL }
13002 { &hf_gtpv2_mm_context_ear_len,
13003 { "Length of Extended Access Restriction Data", "gtpv2.mm_context.ear_len",
13004 FT_UINT8, BASE_DEC, NULL, 0x0,
13005 NULL, HFILL }
13007 { &hf_gtpv2_node_number_len,
13008 { "Length", "gtpv2.node_number.len",
13009 FT_UINT8, BASE_DEC, NULL, 0x0,
13010 NULL, HFILL }
13012 { &hf_gtpv2_additional_rrm_policy_index,
13013 { "Additional RRM Policy Index", "gtpv2.additional_rrm_policy_index",
13014 FT_UINT32, BASE_DEC, NULL, 0x0,
13015 NULL, HFILL }
13017 { &hf_gtpv2_group_id,
13018 { "Group ID", "gtpv2.group_id",
13019 FT_STRING, BASE_NONE, NULL, 0x0,
13020 NULL, HFILL }
13022 { &hf_gtpv2_ie_up_security_policy_up_ip_policy,
13023 { "UP IP Policy", "gtpv2.ie_up_security_policy.up_ip_policy",
13024 FT_UINT8, BASE_DEC, VALS(gtpv2_up_ip_policy_vals), 0x3,
13025 NULL, HFILL }
13027 { &hf_gtpv2_ie_pscell_id_spare,
13028 { "Spare", "gtpv2.pscell_id.spare",
13029 FT_UINT40, BASE_DEC, NULL, 0xF000000000,
13030 NULL, HFILL }
13032 { &hf_gtpv2_ie_pscell_id_nr_cgi,
13033 { "NR CGI", "gtpv2.pscell_id.nr_cgi",
13034 FT_UINT40, BASE_HEX, NULL, 0x0FFFFFFFFF,
13035 NULL, HFILL }
13037 { &hf_gtpv2_ie_up_security_policy_spare,
13038 { "Spare", "gtpv2.up_security_policy.spare",
13039 FT_UINT8, BASE_DEC, NULL, 0xFC,
13040 NULL, HFILL }
13042 { &hf_gtpv2_nf_instance_id_nf_instance_id,
13043 { "NF Instance ID", "gtpv2.nf_instance_id_nf_instance_id",
13044 FT_GUID, BASE_NONE, NULL, 0x0,
13045 NULL, HFILL}
13047 { &hf_gtpv2_nf_timer_in_seconds_timer_value,
13048 { "Timer in Seconds", "gtpv2.timer_in_seconds_timer_value",
13049 FT_UINT32, BASE_DEC, NULL, 0x0,
13050 NULL, HFILL}
13054 /* Setup protocol subtree array */
13055 #define GTPV2_NUM_INDIVIDUAL_ELEMS 85
13056 static int *ett_gtpv2_array[GTPV2_NUM_INDIVIDUAL_ELEMS + NUM_GTPV2_IES];
13058 ett_gtpv2_array[0] = &ett_gtpv2;
13059 ett_gtpv2_array[1] = &ett_gtpv2_flags;
13060 ett_gtpv2_array[2] = &ett_gtpv2_uli_flags;
13061 ett_gtpv2_array[3] = &ett_gtpv2_uli_field;
13062 ett_gtpv2_array[4] = &ett_gtpv2_bearer_ctx;
13063 ett_gtpv2_array[5] = &ett_gtpv2_PDN_conn;
13064 ett_gtpv2_array[6] = &ett_gtpv2_overload_control_information;
13065 ett_gtpv2_array[7] = &ett_gtpv2_mm_context_flag;
13066 ett_gtpv2_array[8] = &ett_gtpv2_pdn_numbers_nsapi;
13067 ett_gtpv2_array[9] = &ett_gtpv2_tra_info_trigg;
13068 ett_gtpv2_array[10] = &ett_gtpv2_tra_info_trigg_msc_server;
13069 ett_gtpv2_array[11] = &ett_gtpv2_tra_info_trigg_mgw;
13070 ett_gtpv2_array[12] = &ett_gtpv2_tra_info_trigg_sgsn;
13071 ett_gtpv2_array[13] = &ett_gtpv2_tra_info_trigg_ggsn;
13072 ett_gtpv2_array[14] = &ett_gtpv2_tra_info_trigg_bm_sc;
13073 ett_gtpv2_array[15] = &ett_gtpv2_tra_info_trigg_sgw_mme;
13074 ett_gtpv2_array[16] = &ett_gtpv2_tra_info_trigg_sgw;
13075 ett_gtpv2_array[17] = &ett_gtpv2_tra_info_trigg_pgw;
13076 ett_gtpv2_array[18] = &ett_gtpv2_tra_info_interfaces;
13077 ett_gtpv2_array[19] = &ett_gtpv2_tra_info_interfaces_imsc_server;
13078 ett_gtpv2_array[20] = &ett_gtpv2_tra_info_interfaces_lmgw;
13079 ett_gtpv2_array[21] = &ett_gtpv2_tra_info_interfaces_lsgsn;
13080 ett_gtpv2_array[22] = &ett_gtpv2_tra_info_interfaces_lggsn;
13081 ett_gtpv2_array[23] = &ett_gtpv2_tra_info_interfaces_lrnc;
13082 ett_gtpv2_array[24] = &ett_gtpv2_tra_info_interfaces_lbm_sc;
13083 ett_gtpv2_array[25] = &ett_gtpv2_tra_info_interfaces_lmme;
13084 ett_gtpv2_array[26] = &ett_gtpv2_tra_info_interfaces_lsgw;
13085 ett_gtpv2_array[27] = &ett_gtpv2_tra_info_interfaces_lpdn_gw;
13086 ett_gtpv2_array[28] = &ett_gtpv2_tra_info_interfaces_lpdn_lenb;
13087 ett_gtpv2_array[29] = &ett_gtpv2_tra_info_ne_types;
13088 ett_gtpv2_array[30] = &ett_gtpv2_rai;
13089 ett_gtpv2_array[31] = &ett_gtpv2_stn_sr;
13090 ett_gtpv2_array[32] = &ett_gtpv2_ms_mark;
13091 ett_gtpv2_array[33] = &ett_gtpv2_supp_codec_list;
13092 ett_gtpv2_array[34] = &ett_gtpv2_bss_con;
13093 ett_gtpv2_array[35] = &ett_gtpv2_utran_con;
13094 ett_gtpv2_array[36] = &ett_gtpv2_eutran_con;
13095 ett_gtpv2_array[37] = &ett_gtpv2_son_con;
13096 ett_gtpv2_array[38] = &ett_gtpv2_endc_son_con;
13097 ett_gtpv2_array[39] = &ett_gtpv2_intersys_son_con;
13098 ett_gtpv2_array[40] = &ett_gtpv2_mm_context_auth_qua;
13099 ett_gtpv2_array[41] = &ett_gtpv2_mm_context_auth_qui;
13100 ett_gtpv2_array[42] = &ett_gtpv2_mm_context_auth_tri;
13101 ett_gtpv2_array[43] = &ett_gtpv2_mm_context_net_cap;
13102 ett_gtpv2_array[44] = &ett_gtpv2_ms_network_capability;
13103 ett_gtpv2_array[45] = &ett_gtpv2_mm_context_sc;
13104 ett_gtpv2_array[46] = &ett_gtpv2_vd_pref;
13105 ett_gtpv2_array[47] = &ett_gtpv2_access_rest_data;
13106 ett_gtpv2_array[48] = &ett_gtpv2_qua;
13107 ett_gtpv2_array[49] = &ett_gtpv2_qui;
13108 ett_gtpv2_array[50] = &ett_gtpv2_preaa_tais;
13109 ett_gtpv2_array[51] = &ett_gtpv2_preaa_menbs;
13110 ett_gtpv2_array[52] = &ett_gtpv2_preaa_henbs;
13111 ett_gtpv2_array[53] = &ett_gtpv2_preaa_ecgis;
13112 ett_gtpv2_array[54] = &ett_gtpv2_preaa_rais;
13113 ett_gtpv2_array[55] = &ett_gtpv2_preaa_sais;
13114 ett_gtpv2_array[56] = &ett_gtpv2_preaa_cgis;
13115 ett_gtpv2_array[57] = &ett_gtpv2_load_control_inf;
13116 ett_gtpv2_array[58] = &ett_gtpv2_eci;
13117 ett_gtpv2_array[59] = &ett_gtpv2_twan_flags;
13118 ett_gtpv2_array[60] = &ett_gtpv2_ciot_support_ind;
13119 ett_gtpv2_array[61] = &ett_gtpv2_rohc_profile_flags;
13120 ett_gtpv2_array[62] = &ett_gtpv2_secondary_rat_usage_data_report;
13121 ett_gtpv2_array[63] = &ett_gtpv2_pres_rep_area_info;
13122 ett_gtpv2_array[64] = &ett_gtpv2_preaa_ext_menbs;
13123 ett_gtpv2_array[65] = &ett_gtpv2_ue_nr_sec_cap_len;
13124 ett_gtpv2_array[66] = &ett_gtpv2_apn_rte_ctrl_sts_len;
13125 ett_gtpv2_array[67] = &ett_gtpv2_if_mgcs;
13126 ett_gtpv2_array[68] = &ett_gtpv2_if_mgw;
13127 ett_gtpv2_array[69] = &ett_gtpv2_if_sgsn;
13128 ett_gtpv2_array[70] = &ett_gtpv2_if_ggsn;
13129 ett_gtpv2_array[71] = &ett_gtpv2_if_rnc;
13130 ett_gtpv2_array[72] = &ett_gtpv2_if_bm_sc;
13131 ett_gtpv2_array[73] = &ett_gtpv2_if_mme;
13132 ett_gtpv2_array[74] = &ett_gtpv2_if_sgw;
13133 ett_gtpv2_array[75] = &ett_gtpv2_if_pdn_gw;
13134 ett_gtpv2_array[76] = &ett_gtpv2_if_enb;
13135 ett_gtpv2_array[77] = &ett_gtpv2_if_hss;
13136 ett_gtpv2_array[78] = &ett_gtpv2_if_eir;
13137 ett_gtpv2_array[79] = &ett_gtpv2_if_amf;
13138 ett_gtpv2_array[80] = &ett_gtpv2_if_pcf;
13139 ett_gtpv2_array[81] = &ett_gtpv2_if_smf;
13140 ett_gtpv2_array[82] = &ett_gtpv2_if_upf;
13141 ett_gtpv2_array[83] = &ett_gtpv2_if_ng_ran_node;
13142 ett_gtpv2_array[84] = &ett_gtpv2_PGW_change_info;
13143 last_offset = GTPV2_NUM_INDIVIDUAL_ELEMS;
13145 for (i=0; i < NUM_GTPV2_IES; i++, last_offset++)
13147 ett_gtpv2_array[last_offset] = &ett_gtpv2_ies[i];
13150 static ei_register_info ei[] = {
13151 { &ei_gtpv2_ie_data_not_dissected, { "gtpv2.ie_data_not_dissected", PI_UNDECODED, PI_NOTE, "IE data not dissected yet", EXPFILL }},
13152 { &ei_gtpv2_ie_len_invalid, { "gtpv2.ie_len_invalid", PI_PROTOCOL, PI_ERROR, "Wrong length", EXPFILL }},
13153 { &ei_gtpv2_source_type_unknown, { "gtpv2.source_type.unknown", PI_PROTOCOL, PI_ERROR, "Unknown source type", EXPFILL }},
13154 { &ei_gtpv2_fq_csid_type_bad, { "gtpv2.fq_csid_type.unknown", PI_PROTOCOL, PI_ERROR, "Wrong Node-ID Type", EXPFILL }},
13155 { &ei_gtpv2_mbms_session_duration_days, { "gtpv2.mbms_session_duration_days.invalid", PI_PROTOCOL, PI_WARN, "Days out of allowed range", EXPFILL }},
13156 { &ei_gtpv2_mbms_session_duration_secs, { "gtpv2.mbms_session_duration_secs.unknown", PI_PROTOCOL, PI_WARN, "Seconds out of allowed range", EXPFILL }},
13157 { &ei_gtpv2_ie, { "gtpv2.ie_type.reserved", PI_PROTOCOL, PI_WARN, "IE type Zero is Reserved and should not be used", EXPFILL }},
13158 { &ei_gtpv2_int_size_not_handled, { "gtpv2.ie_type.int_size_not_handled", PI_PROTOCOL, PI_WARN, "Integer size not handled yet", EXPFILL } },
13159 { &ei_gtpv2_apn_too_long, { "gtpv2.apn_too_long", PI_PROTOCOL, PI_WARN, "APN encoding has more than 100 octets", EXPFILL } },
13162 expert_module_t* expert_gtpv2;
13163 module_t *gtpv2_module;
13165 static const enum_val_t decode_srvcc_ps_to_cs_trans_cont_vals[] = {
13166 {"no", "Don't decode", PREF_DECODE_SRVCC_P2C_TRANS_CONT_NO},
13167 {"utran", "Assume UTRAN target", PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN},
13168 {NULL, NULL, -1}
13171 proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
13173 gtpv2_module = prefs_register_protocol(proto_gtpv2, NULL);
13174 prefs_register_enum_preference(gtpv2_module, "decode_srvcc_p2c_trans_cont_target",
13175 "Decode SRVCC PS-to-CS Transparent Containers",
13176 "Use this setting to decode the Transparent Containers in the SRVCC PS-to-CS messages.\n"
13177 "This is needed until there's a reliable way to determine the contents of the transparent containers.",
13178 &pref_decode_srvcc_p2c_trans_cont, decode_srvcc_ps_to_cs_trans_cont_vals, false);
13180 prefs_register_uint_preference(gtpv2_module, "pair_max_interval", "Max interval allowed in pair matching", "Request/reply pair matches only if their timestamps are closer than that value, in ms (default 0, i.e. don't use timestamps)", 10, &pref_pair_matching_max_interval_ms);
13182 proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
13183 proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
13184 expert_gtpv2 = expert_register_protocol(proto_gtpv2);
13185 expert_register_field_array(expert_gtpv2, ei, array_length(ei));
13187 register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
13188 /* Dissector table for private extensions */
13189 gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 Private Extension", proto_gtpv2, FT_UINT16, BASE_DEC);
13191 gtpv2_tap = register_tap("gtpv2");
13193 register_srt_table(proto_gtpv2, NULL, 1, gtpv2_stat_packet, gtpv2_stat_init, NULL);
13196 void
13197 proto_reg_handoff_gtpv2(void)
13199 //static bool Initialized = false;
13201 nas_eps_handle = find_dissector_add_dependency("nas-eps", proto_gtpv2);
13203 radius_register_avp_dissector(VENDOR_THE3GPP, 22, dissect_radius_user_loc);
13205 /* AVP Code: 22 3GPP-User-Location-Info */
13206 dissector_add_uint("diameter.3gpp", 22, create_dissector_handle(dissect_diameter_3gpp_uli, proto_gtpv2));
13208 /* AVP Code: 2820 Presence-Reporting-Area-Elements-List */
13209 dissector_add_uint("diameter.3gpp", 2820, create_dissector_handle(dissect_diameter_3gpp_presence_reporting_area_elements_list, proto_gtpv2));
13214 * Editor modelines
13216 * Local Variables:
13217 * c-basic-offset: 4
13218 * tab-width: 8
13219 * indent-tabs-mode: nil
13220 * End:
13222 * ex: set shiftwidth=4 tabstop=8 expandtab:
13223 * :indentSize=4:tabSize=8:noTabs=true: