Coverage Report

Created: 2025-12-27 06:52

next uncovered line (L), next uncovered region (R), next uncovered branch (B)
/src/wireshark/epan/dissectors/packet-gtpv2.c
Line
Count
Source
1
/* packet-gtpv2.c
2
 *
3
 * Routines for GTPv2 dissection
4
 * Copyright 2009 - 2021, Anders Broman <anders.broman [at] ericsson.com>
5
 *
6
 * Wireshark - Network traffic analyzer
7
 * By Gerald Combs <gerald@wireshark.org>
8
 * Copyright 1998 Gerald Combs
9
 *
10
 * SPDX-License-Identifier: GPL-2.0-or-later
11
 *
12
 * Ref: 3GPP TS 29.274 V18.7.0 (2024-06-26)
13
 */
14
15
#include "config.h"
16
17
#include <math.h>
18
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>
31
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"
45
#include "packet-http2.h"
46
47
void proto_register_gtpv2(void);
48
void proto_reg_handoff_gtpv2(void);
49
50
static dissector_handle_t nas_eps_handle;
51
static dissector_table_t gtpv2_priv_ext_dissector_table;
52
53
54
/*GTPv2 Message->GTP Header(SB)*/
55
static int proto_gtpv2;
56
57
static int hf_gtpv2_response_in;
58
static int hf_gtpv2_response_to;
59
static int hf_gtpv2_response_time;
60
static int hf_gtpv2_spare_half_octet;
61
//static int hf_gtpv2_spare_b7_b1;
62
static int hf_gtpv2_spare_b7_b2;
63
static int hf_gtpv2_spare_b7_b3;
64
static int hf_gtpv2_spare_b7_b4;
65
static int hf_gtpv2_spare_b7_b5;
66
67
static int hf_gtpv2_spare_bits;
68
static int hf_gtpv2_flags;
69
static int hf_gtpv2_version;
70
static int hf_gtpv2_p;
71
static int hf_gtpv2_t;
72
static int hf_gtpv2_mp;
73
static int hf_gtpv2_message_type;
74
static int hf_gtpv2_msg_length;
75
static int hf_gtpv2_teid;
76
static int hf_gtpv2_seq;
77
static int hf_gtpv2_msg_prio;
78
static int hf_gtpv2_spare;
79
static int hf_gtpv2_spare_w0;
80
81
static int hf_gtpv2_ie;
82
static int hf_gtpv2_ie_len;
83
static int hf_gtpv2_cr;
84
static int hf_gtpv2_instance;
85
static int hf_gtpv2_cause;
86
static int hf_gtpv2_cause_cs;
87
static int hf_gtpv2_cause_bce;
88
static int hf_gtpv2_cause_pce;
89
static int hf_gtpv2_cause_off_ie_t;
90
static int hf_gtpv2_rec;
91
/*Start SRVCC Messages*/
92
static int hf_gtpv2_stn_sr;
93
static int hf_gtpv2_len_trans_con;
94
static int hf_gtpv2_eksi;
95
static int hf_gtpv2_ck;
96
static int hf_gtpv2_ik;
97
static int hf_gtpv2_len_ms_classmark2;
98
static int hf_gtpv2_len_ms_classmark3;
99
static int hf_gtpv2_len_supp_codec_list;
100
static int hf_gtpv2_ksi;
101
/*static int hf_gtpv2_kc; */
102
static int hf_gtpv2_cksn;
103
static int hf_gtpv2_srvcc_cause;
104
static int hf_gtpv2_rac;
105
static int hf_gtpv2_rnc_id;
106
static int hf_gtpv2_ext_rnc_id;
107
static int hf_gtpv2_lac;
108
static int hf_gtpv2_sac;
109
static int hf_gtpv2_tgt_g_cell_id;
110
static int hf_gtpv2_teid_c;
111
static int hf_gtpv2_sv_sti;
112
static int hf_gtpv2_sv_ics;
113
static int hf_gtpv2_sv_emind;
114
/*End SRVCC Messages*/
115
static int hf_gtpv2_apn;
116
static int hf_gtpv2_ebi;
117
static int hf_gtpv2_daf;
118
static int hf_gtpv2_dtf;
119
static int hf_gtpv2_hi;
120
static int hf_gtpv2_dfi;
121
static int hf_gtpv2_oi;
122
static int hf_gtpv2_isrsi;
123
static int hf_gtpv2_israi;
124
static int hf_gtpv2_sgwci;
125
static int hf_gtpv2_sqci;
126
static int hf_gtpv2_uimsi;
127
static int hf_gtpv2_cfsi;
128
static int hf_gtpv2_crsi;
129
static int hf_gtpv2_pt;
130
static int hf_gtpv2_ps;
131
static int hf_gtpv2_si;
132
static int hf_gtpv2_msv;
133
static int hf_gtpv2_retloc;
134
static int hf_gtpv2_pbic;
135
static int hf_gtpv2_srni;
136
static int hf_gtpv2_s6af;
137
static int hf_gtpv2_s4af;
138
static int hf_gtpv2_mbmdt;
139
static int hf_gtpv2_israu;
140
static int hf_gtpv2_ccrsi;
141
static int hf_gtpv2_cprai;
142
static int hf_gtpv2_arrl;
143
static int hf_gtpv2_ppof;
144
static int hf_gtpv2_ppon_ppei;
145
static int hf_gtpv2_ppsi;
146
static int hf_gtpv2_csfbi;
147
static int hf_gtpv2_clii;
148
static int hf_gtpv2_cpsr;
149
static int hf_gtpv2_nsi;
150
static int hf_gtpv2_uasi;
151
static int hf_gtpv2_dtci;
152
static int hf_gtpv2_bdwi;
153
static int hf_gtpv2_psci;
154
static int hf_gtpv2_pcri;
155
static int hf_gtpv2_aosi;
156
static int hf_gtpv2_aopi;
157
static int hf_gtpv2_roaai;
158
static int hf_gtpv2_epcosi;
159
static int hf_gtpv2_cpopci;
160
static int hf_gtpv2_pmtsmi;
161
static int hf_gtpv2_s11tf;
162
static int hf_gtpv2_pnsi;
163
static int hf_gtpv2_unaccsi;
164
static int hf_gtpv2_wpmsi;
165
166
static int hf_gtpv2_5gsnn26;
167
static int hf_gtpv2_reprefi;
168
static int hf_gtpv2_5gsiwk;
169
static int hf_gtpv2_eevrsi;
170
static int hf_gtpv2_ltemui;
171
static int hf_gtpv2_ltempi;
172
static int hf_gtpv2_enbcrsi;
173
static int hf_gtpv2_tspcmi;
174
static int hf_gtpv2_ethpdn;
175
176
static int hf_gtpv2_csrmfi;
177
static int hf_gtpv2_mtedtn;
178
static int hf_gtpv2_mtedta;
179
static int hf_gtpv2_n5gnmi;
180
static int hf_gtpv2_5gcnrs;
181
static int hf_gtpv2_5gcnri;
182
static int hf_gtpv2_5srhoi;
183
184
static int hf_gtpv2_nspusi;
185
static int hf_gtpv2_pgwrnsi;
186
static int hf_gtpv2_rppcsi;
187
static int hf_gtpv2_pgwchi;
188
static int hf_gtpv2_sissme;
189
static int hf_gtpv2_nsenbi;
190
static int hf_gtpv2_idfupf;
191
static int hf_gtpv2_emci;
192
193
static int hf_gtpv2_lapcosi;
194
static int hf_gtpv2_ltemsai;
195
static int hf_gtpv2_srtpi;
196
static int hf_gtpv2_upipsi;
197
198
static int hf_gtpv2_pdn_type;
199
static int hf_gtpv2_pdn_ipv4;
200
static int hf_gtpv2_pdn_ipv6_len;
201
static int hf_gtpv2_pdn_ipv6;
202
static int hf_gtpv2_pdn_numbers_nsapi;
203
static int hf_gtpv2_p_tmsi;
204
static int hf_gtpv2_p_tmsi_sig;
205
static int hf_gtpv2_mmbr_ul;
206
static int hf_gtpv2_mmbr_dl;
207
208
static int hf_gtpv2_rat_type;
209
static int hf_gtpv2_uli_ext_macro_enb_id_flg;
210
static int hf_gtpv2_uli_macro_enb_id_flg;
211
static int hf_gtpv2_uli_lai_flg;
212
static int hf_gtpv2_uli_ecgi_flg;
213
static int hf_gtpv2_uli_tai_flg;
214
static int hf_gtpv2_uli_rai_flg;
215
static int hf_gtpv2_uli_sai_flg;
216
static int hf_gtpv2_uli_cgi_flg;
217
static int hf_gtpv2_glt;
218
static int hf_gtpv2_cng_rep_act;
219
220
static int hf_gtpv2_selec_mode;
221
static int hf_gtpv2_source_type;
222
static int hf_gtpv2_f_teid_v4;
223
static int hf_gtpv2_f_teid_v6;
224
static int hf_gtpv2_f_teid_interface_type;
225
static int hf_gtpv2_f_teid_gre_key;
226
static int hf_gtpv2_f_teid_ipv4;
227
static int hf_gtpv2_f_teid_ipv6;
228
static int hf_gtpv2_tmsi;
229
static int hf_gtpv2_hsgw_addr_f_len;
230
static int hf_gtpv2_hsgw_addr_ipv4;
231
static int hf_gtpv2_hsgw_addr_ipv6;
232
static int hf_gtpv2_gre_key;
233
static int hf_gtpv2_sgw_addr_ipv4;
234
static int hf_gtpv2_sgw_addr_ipv6;
235
static int hf_gtpv2_sgw_s1u_teid;
236
static int hf_gtpv2_ipv4_addr;
237
238
239
static int hf_gtpv2_ambr_up;
240
static int hf_gtpv2_ambr_down;
241
static int hf_gtpv2_ip_address_ipv4;
242
static int hf_gtpv2_ip_address_ipv6;
243
static int hf_gtpv2_mei;
244
245
/* Trace Information */
246
/* static int hf_gtpv2_tra_info; */
247
static int hf_gtpv2_tra_info_msc_momt_calls;
248
static int hf_gtpv2_tra_info_msc_momt_sms;
249
static int hf_gtpv2_tra_info_msc_lu_imsi_ad;
250
static int hf_gtpv2_tra_info_msc_handovers;
251
static int hf_gtpv2_tra_info_msc_ss;
252
static int hf_gtpv2_tra_info_mgw_context;
253
static int hf_gtpv2_tra_info_sgsn_pdp_context;
254
static int hf_gtpv2_tra_info_sgsn_momt_sms;
255
static int hf_gtpv2_tra_info_sgsn_rau_gprs_ad;
256
static int hf_gtpv2_tra_info_sgsn_mbms;
257
static int hf_gtpv2_tra_info_sgsn_reserved;
258
static int hf_gtpv2_tra_info_ggsn_pdp;
259
static int hf_gtpv2_tra_info_ggsn_mbms;
260
static int hf_gtpv2_tra_info_bm_sc;
261
static int hf_gtpv2_tra_info_mme_sgw_ss;
262
static int hf_gtpv2_tra_info_mme_sgw_sr;
263
static int hf_gtpv2_tra_info_mme_sgw_iataud;
264
static int hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc;
265
static int hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del;
266
static int hf_gtpv2_tra_info_mme_sgw_ho;
267
static int hf_gtpv2_tra_info_sgw_pdn_con_creat;
268
static int hf_gtpv2_tra_info_sgw_pdn_con_term;
269
static int hf_gtpv2_tra_info_sgw_bearer_act_mod_del;
270
static int hf_gtpv2_tra_info_pgw_pdn_con_creat;
271
static int hf_gtpv2_tra_info_pgw_pdn_con_term;
272
static int hf_gtpv2_tra_info_pgw_bearer_act_mod_del;
273
static int hf_gtpv2_tra_info_lne_msc_s;
274
static int hf_gtpv2_tra_info_lne_mgw;
275
static int hf_gtpv2_tra_info_lne_sgsn;
276
static int hf_gtpv2_tra_info_lne_ggsn;
277
static int hf_gtpv2_tra_info_lne_rnc;
278
static int hf_gtpv2_tra_info_lne_bm_sc;
279
static int hf_gtpv2_tra_info_lne_mme;
280
static int hf_gtpv2_tra_info_lne_sgw;
281
static int hf_gtpv2_tra_info_lne_pdn_gw;
282
static int hf_gtpv2_tra_info_lne_enb;
283
static int hf_gtpv2_tra_info_lne_amf;
284
static int hf_gtpv2_tra_info_lne_smf;
285
static int hf_gtpv2_tra_info_lne_pcf;
286
static int hf_gtpv2_tra_info_lne_upf;
287
static int hf_gtpv2_tra_info_tra_info_ng_ran_node;
288
static int hf_gtpv2_tra_info_tdl;
289
static int hf_gtpv2_tra_info_lmsc_a;
290
static int hf_gtpv2_tra_info_lmsc_lu;
291
static int hf_gtpv2_tra_info_lmsc_mc;
292
static int hf_gtpv2_tra_info_lmsc_map_g;
293
static int hf_gtpv2_tra_info_lmsc_map_b;
294
static int hf_gtpv2_tra_info_lmsc_map_e;
295
static int hf_gtpv2_tra_info_lmsc_map_f;
296
static int hf_gtpv2_tra_info_lmsc_cap;
297
static int hf_gtpv2_tra_info_lmsc_map_d;
298
static int hf_gtpv2_tra_info_lmsc_map_c;
299
static int hf_gtpv2_tra_info_lmgw_mc;
300
static int hf_gtpv2_tra_info_lmgw_nb_up;
301
static int hf_gtpv2_tra_info_lmgw_lu_up;
302
static int hf_gtpv2_tra_info_lsgsn_gb;
303
static int hf_gtpv2_tra_info_lsgsn_lu;
304
static int hf_gtpv2_tra_info_lsgsn_gn;
305
static int hf_gtpv2_tra_info_lsgsn_map_gr;
306
static int hf_gtpv2_tra_info_lsgsn_map_gd;
307
static int hf_gtpv2_tra_info_lsgsn_map_gf;
308
static int hf_gtpv2_tra_info_lsgsn_gs;
309
static int hf_gtpv2_tra_info_lsgsn_ge;
310
static int hf_gtpv2_tra_info_lggsn_gn;
311
static int hf_gtpv2_tra_info_lggsn_gi;
312
static int hf_gtpv2_tra_info_lggsn_gmb;
313
static int hf_gtpv2_tra_info_lrnc_lu;
314
static int hf_gtpv2_tra_info_lrnc_lur;
315
static int hf_gtpv2_tra_info_lrnc_lub;
316
static int hf_gtpv2_tra_info_lrnc_uu;
317
static int hf_gtpv2_tra_info_lbm_sc_gmb;
318
static int hf_gtpv2_tra_info_lmme_s1_mme;
319
static int hf_gtpv2_tra_info_lmme_s3;
320
static int hf_gtpv2_tra_info_lmme_s6a;
321
static int hf_gtpv2_tra_info_lmme_s10;
322
static int hf_gtpv2_tra_info_lmme_s11;
323
static int hf_gtpv2_tra_info_lsgw_s4;
324
static int hf_gtpv2_tra_info_lsgw_s5;
325
static int hf_gtpv2_tra_info_lsgw_s8b;
326
static int hf_gtpv2_tra_info_lsgw_s11;
327
static int hf_gtpv2_tra_info_lpdn_gw_s2a;
328
static int hf_gtpv2_tra_info_lpdn_gw_s2b;
329
static int hf_gtpv2_tra_info_lpdn_gw_s2c;
330
static int hf_gtpv2_tra_info_lpdn_gw_s5;
331
static int hf_gtpv2_tra_info_lpdn_gw_s6c;
332
static int hf_gtpv2_tra_info_lpdn_gw_gx;
333
static int hf_gtpv2_tra_info_lpdn_gw_s8b;
334
static int hf_gtpv2_tra_info_lpdn_gw_sgi;
335
static int hf_gtpv2_tra_info_lenb_s1_mme;
336
static int hf_gtpv2_tra_info_lenb_x2;
337
static int hf_gtpv2_tra_info_lenb_uu;
338
339
static int hf_gtpv2_ti;
340
341
static int hf_gtpv2_bearer_qos_pci;
342
static int hf_gtpv2_bearer_qos_pl;
343
static int hf_gtpv2_bearer_qos_pvi;
344
static int hf_gtpv2_bearer_qos_label_qci;
345
static int hf_gtpv2_bearer_qos_mbr_up;
346
static int hf_gtpv2_bearer_qos_mbr_down;
347
static int hf_gtpv2_bearer_qos_gbr_up;
348
static int hf_gtpv2_bearer_qos_gbr_down;
349
static int hf_gtpv2_flow_qos_label_qci;
350
static int hf_gtpv2_flow_qos_mbr_up;
351
static int hf_gtpv2_flow_qos_mbr_down;
352
static int hf_gtpv2_flow_qos_gbr_up;
353
static int hf_gtpv2_flow_qos_gbr_down;
354
355
static int hf_gtpv2_delay_value;
356
static int hf_gtpv2_charging_id;
357
static int hf_gtpv2_charging_characteristic;
358
static int hf_gtpv2_bearer_flag_ppc;
359
static int hf_gtpv2_bearer_flag_vb;
360
static int hf_gtpv2_ue_time_zone_dst;
361
static int hf_gtpv2_fq_csid_type;
362
static int hf_gtpv2_fq_csid_nr;
363
static int hf_gtpv2_fq_csid_ipv4;
364
static int hf_gtpv2_fq_csid_ipv6;
365
static int hf_gtpv2_fq_csid_id;
366
static int hf_gtpv2_complete_req_msg_type;
367
static int hf_gtpv2_mme_grp_id;
368
static int hf_gtpv2_mme_code;
369
static int hf_gtpv2_m_tmsi;
370
static int hf_gtpv2_container_type;
371
static int hf_gtpv2_cause_type;
372
static int hf_gtpv2_CauseRadioNetwork;
373
static int hf_gtpv2_CauseTransport;
374
static int hf_gtpv2_CauseNas;
375
static int hf_gtpv2_CauseProtocol;
376
static int hf_gtpv2_CauseMisc;
377
static int hf_gtpv2_target_type;
378
static int hf_gtpv2_macro_enodeb_id;
379
static int hf_gtpv2_smenb;
380
static int hf_gtpv2_ext_macro_enodeb_id;
381
static int hf_gtpv2_ext_macro_ng_enodeb_id;
382
static int hf_gtpv2_enodebid;
383
static int hf_gtpv2_cellid;
384
385
static int hf_gtpv2_node_type;
386
static int hf_gtpv2_fqdn;
387
static int hf_gtpv2_enterprise_id;
388
static int hf_gtpv2_apn_rest;
389
static int hf_gtpv2_pti;
390
static int hf_gtpv2_mm_context_sm;
391
static int hf_gtpv2_mm_context_nhi;
392
static int hf_gtpv2_mm_context_drxi;
393
static int hf_gtpv2_mm_context_cksn;
394
static int hf_gtpv2_mm_context_cksn_ksi;
395
static int hf_gtpv2_mm_context_kasme;
396
static int hf_gtpv2_mm_context_rand;
397
static int hf_gtpv2_mm_context_xres_len;
398
static int hf_gtpv2_mm_context_xres;
399
static int hf_gtpv2_mm_context_autn_len;
400
static int hf_gtpv2_mm_context_autn;
401
static int hf_gtpv2_mm_context_drx;
402
static int hf_gtpv2_mm_context_ue_net_cap_len;
403
static int hf_gtpv2_mm_context_ms_net_cap_len;
404
static int hf_gtpv2_mm_context_mei_len;
405
static int hf_gtpv2_mm_context_vdp_len;
406
static int hf_gtpv2_mm_contex_nhi_old;
407
static int hf_gtpv2_mm_context_old_ksiasme;
408
static int hf_gtpv2_mm_context_old_ncc;
409
static int hf_gtpv2_mm_context_old_kasme;
410
static int hf_gtpv2_mm_context_old_nh;
411
static int hf_gtpv2_mm_context_higher_br_16mb_flg_len;
412
static int hf_gtpv2_mm_context_higher_br_16mb_flg;
413
static int hf_gtpv2_vdp_length;
414
static int hf_gtpv2_mm_context_paging_len;
415
static int hf_gtpv2_mm_context_ex_access_res_data_len;
416
static int hf_gtpv2_mm_context_ue_add_sec_cap_len;
417
static int hf_gtpv2_mm_context_ue_nr_sec_cap_len;
418
static int hf_gtpv2_mm_context_apn_rte_ctrl_sts_len;
419
static int hf_gtpv2_mm_context_cnr_len;
420
static int hf_gtpv2_mm_context_ue_radio_cap_len;
421
static int hf_gtpv2_uci_csg_id;
422
static int hf_gtpv2_uci_csg_id_spare;
423
static int hf_gtpv2_uci_access_mode;
424
static int hf_gtpv2_uci_lcsg;
425
static int hf_gtpv2_uci_csg_membership;
426
427
static int hf_gtpv2_una;
428
static int hf_gtpv2_gena;
429
static int hf_gtpv2_gana;
430
static int hf_gtpv2_ina;
431
static int hf_gtpv2_ena;
432
static int hf_gtpv2_hnna;
433
static int hf_gtpv2_hbna;
434
static int hf_gtpv2_mm_context_ksi_a;
435
static int hf_gtpv2_mm_context_ksi;
436
static int hf_gtpv2_mm_context_nr_tri;
437
static int hf_gtpv2_mm_context_used_cipher;
438
static int hf_gtpv2_mm_context_nr_qui;
439
static int hf_gtpv2_mm_context_nr_qua;
440
static int hf_gtpv2_mm_context_uamb_ri;
441
static int hf_gtpv2_mm_context_osci;
442
static int hf_gtpv2_mm_context_nruna;
443
static int hf_gtpv2_mm_context_nrusrna;
444
static int hf_gtpv2_mm_context_nrna;
445
static int hf_gtpv2_mm_context_ussrna;
446
static int hf_gtpv2_mm_context_nrsrna;
447
static int hf_gtpv2_mm_context_ensct;
448
449
static int hf_gtpv2_mm_context_samb_ri;
450
static int hf_gtpv2_mm_context_unipa;
451
static int hf_gtpv2_mm_context_unc;
452
static int hf_gtpv2_mm_context_nas_dl_cnt;
453
static int hf_gtpv2_mm_context_nas_ul_cnt;
454
455
static int hf_gtpv2_uli_cgi_lac;
456
static int hf_gtpv2_uli_cgi_ci;
457
static int hf_gtpv2_sai_lac;
458
static int hf_gtpv2_sai_sac;
459
static int hf_gtpv2_rai_lac;
460
static int hf_gtpv2_rai_rac;
461
static int hf_gtpv2_tai_tac;
462
static int hf_gtpv2_5gs_tai_tac;
463
static int hf_gtpv2_ecgi_eci;
464
static int hf_gtpv2_ncgi_nrci;
465
static int hf_gtpv2_uli_lai_lac;
466
static int hf_gtpv2_ecgi_eci_spare;
467
static int hf_gtpv2_nsapi;
468
static int hf_gtpv2_bearer_control_mode;
469
470
static int hf_gtpv2_bss_container_phx;
471
static int hf_gtpv2_bss_con_sapi_flg;
472
static int hf_gtpv2_bss_con_rp_flg;
473
static int hf_gtpv2_bss_con_pfi_flg;
474
static int hf_gtpv2_bss_con_pfi;
475
static int hf_gtpv2_bss_con_rp;
476
static int hf_gtpv2_bss_con_sapi;
477
static int hf_gtpv2_bss_con_xid_len;
478
static int hf_gtpv2_bss_con_xid;
479
static int hf_gtpv2_home_enodeb_id;
480
static int hf_gtpv2_tac;
481
482
/* MBMS */
483
static int hf_gtpv2_mbms_service_area_nr;
484
static int hf_gtpv2_mbms_service_area_id;
485
static int hf_gtpv2_mbms_session_id;
486
static int hf_gtpv2_mbms_flow_id;
487
static int hf_gtpv2_cteid;
488
static int hf_gtpv2_ip_addr_type;
489
static int hf_gtpv2_ip_addr_len;
490
static int hf_gtpv2_mbms_ip_mc_dist_addrv4;
491
static int hf_gtpv2_mbms_ip_mc_dist_addrv6;
492
static int hf_gtpv2_mbms_ip_mc_src_addrv4;
493
static int hf_gtpv2_mbms_ip_mc_src_addrv6;
494
static int hf_gtpv2_mbms_hc_indicator;
495
static int hf_gtpv2_mbms_dist_indication;
496
static int hf_gtpv2_subscriber_rfsp;
497
static int hf_gtpv2_rfsp_inuse;
498
static int hf_gtpv2_mbms_service_id;
499
static int hf_gtpv2_add_flags_for_srvcc_ics;
500
static int hf_gtpv2_vsrvcc_flag;
501
static int hf_gtpv2_abs_time_mbms_data;
502
static int hf_gtpv2_henb_info_report_fti;
503
static int hf_gtpv2_ip4cp_subnet_prefix_len;
504
static int hf_gtpv2_ip4cp_ipv4;
505
static int hf_gtpv2_change_report_flags_sncr;
506
static int hf_gtpv2_change_report_flags_tzcr;
507
static int hf_gtpv2_action_indication_val;
508
static int hf_gtpv2_uli_timestamp;
509
static int hf_gtpv2_mbms_session_duration_days;
510
static int hf_gtpv2_mbms_session_duration_secs;
511
static int hf_gtpv2_csg_id;
512
static int hf_gtpv2_cmi;
513
static int hf_gtpv2_service_indicator;
514
static int hf_gtpv2_detach_type;
515
static int hf_gtpv2_ldn;
516
static int hf_gtpv2_node_features_prn;
517
static int hf_gtpv2_node_features_mabr;
518
static int hf_gtpv2_node_features_ntsr;
519
static int hf_gtpv2_node_features_ciot;
520
static int hf_gtpv2_node_features_s1un;
521
static int hf_gtpv2_node_features_eth;
522
static int hf_gtpv2_node_features_mtedt;
523
static int hf_gtpv2_node_features_psset;
524
static int hf_gtpv2_time_to_data_xfer;
525
static int hf_gtpv2_arp_pvi;
526
static int hf_gtpv2_arp_pl;
527
static int hf_gtpv2_arp_pci;
528
static int hf_gtpv2_timer_unit;
529
static int hf_gtpv2_throttling_delay_unit;
530
static int hf_gtpv2_throttling_delay_value;
531
static int hf_gtpv2_timer_value;
532
static int hf_gtpv2_lapi;
533
534
static int hf_gtpv2_pres_rep_area_act_inapra;
535
static int hf_gtpv2_pres_rep_area_action;
536
static int hf_gtpv2_pres_rep_area_id;
537
static int hf_gtpv2_pres_rep_area_act_no_tai;
538
static int hf_gtpv2_pres_rep_area_act_no_rai;
539
static int hf_gtpv2_pres_rep_area_act_no_m_enodeb;
540
static int hf_gtpv2_pres_rep_area_act_no_h_enodeb;
541
static int hf_gtpv2_pres_rep_area_act_no_ecgi;
542
static int hf_gtpv2_pres_rep_area_act_no_sai;
543
static int hf_gtpv2_pres_rep_area_act_no_cgi;
544
static int hf_gtpv2_pres_rep_area_act_no_ext_m_enodeb;
545
static int hf_gtpv2_ksi_ps;
546
static int hf_gtpv2_ck_ps;
547
static int hf_gtpv2_ik_ps;
548
static int hf_gtpv2_kc_ps;
549
static int hf_gtpv2_cksn_ps;
550
551
static int hf_gtpv2_pres_rep_area_info_id;
552
static int hf_gtpv2_pres_rep_area_info_additional_id;
553
static int hf_gtpv2_pres_rep_area_info_flags;
554
static int hf_gtpv2_pres_rep_area_info_flags_no_inapra;
555
static int hf_gtpv2_pres_rep_area_info_flags_b4_b7_spare;
556
static int hf_gtpv2_pres_rep_area_info_flags_b3_b7_spare;
557
static int hf_gtpv2_pres_rep_area_info_flags_b3_inapra;
558
static int hf_gtpv2_pres_rep_area_info_flags_b2_apra;
559
static int hf_gtpv2_pres_rep_area_info_flags_b1_opra;
560
static int hf_gtpv2_pres_rep_area_info_flags_b0_ipra;
561
562
/* Generated from convert_proto_tree_add_text.pl */
563
static int hf_gtpv2_downlink_subscribed_ue_ambr;
564
static int hf_gtpv2_mm_context_sres;
565
static int hf_gtpv2_iksrvcc;
566
static int hf_gtpv2_nsapi08;
567
static int hf_gtpv2_voice_domain_and_ue_usage_setting;
568
static int hf_gtpv2_ue_radio_capability_for_paging_information;
569
static int hf_gtpv2_port_number;
570
static int hf_gtpv2_uplink_used_ue_ambr;
571
static int hf_gtpv2_tmsi_bytes;
572
static int hf_gtpv2_dl_gtp_u_sequence_number;
573
static int hf_gtpv2_mm_context_nh;
574
static int hf_gtpv2_teid_c_spare;
575
static int hf_gtpv2_uplink_subscribed_ue_ambr;
576
static int hf_gtpv2_transparent_container;
577
static int hf_gtpv2_packet_flow_id;
578
static int hf_gtpv2_utran_srvcc_ik_cs;
579
static int hf_gtpv2_downlink_used_ue_ambr;
580
static int hf_gtpv2_hop_counter;
581
static int hf_gtpv2_ul_gtp_u_sequence_number;
582
static int hf_gtpv2_authentication_quadruplets;
583
static int hf_gtpv2_utran_srvcc_kc;
584
static int hf_gtpv2_spare_bytes;
585
static int hf_gtpv2_metric;
586
static int hf_gtpv2_throttling_factor;
587
static int hf_gtpv2_relative_capacity;
588
static int hf_gtpv2_apn_length;
589
static int hf_gtpv2_sequence_number;
590
static int hf_gtpv2_receive_n_pdu_number;
591
static int hf_gtpv2_trace_id;
592
static int hf_gtpv2_drx_parameter;
593
static int hf_gtpv2_charging_characteristic_remaining_octets;
594
static int hf_gtpv2_mm_context_ncc;
595
static int hf_gtpv2_proprietary_value;
596
static int hf_gtpv2_mobile_station_classmark2;
597
static int hf_gtpv2_rrc_container;
598
static int hf_gtpv2_send_n_pdu_number;
599
static int hf_gtpv2_mobile_station_classmark3;
600
static int hf_gtpv2_eps_bearer_id_number;
601
static int hf_gtpv2_geographic_location;
602
static int hf_gtpv2_cn_id;
603
static int hf_gtpv2_utran_srvcc_ck_cs;
604
static int hf_gtpv2_authentication_quintuplets;
605
static int hf_gtpv2_serving_gw_address_length;
606
static int hf_gtpv2_supported_codec_list;
607
static int hf_gtpv2_cksrvcc;
608
static int hf_gtpv2_mm_context_kc;
609
static int hf_gtpv2_dl_pdcp_sequence_number;
610
static int hf_gtpv2_ul_pdcp_sequence_number;
611
static int hf_gtpv2_fq_csid_node_id;
612
static int hf_gtpv2_fq_csid_mcc_mnc;
613
static int hf_gtpv2_ppi_value;
614
static int hf_gtpv2_ppi_flag;
615
static int hf_gtpv2_session;
616
static int hf_gtpv2_twan_id_ts;
617
static int hf_gtpv2_twan_flags;
618
static int hf_gtpv2_twan_bssidi;
619
static int hf_gtpv2_twan_civai;
620
static int hf_gtpv2_twan_plmni;
621
static int hf_gtpv2_twan_opnai;
622
static int hf_gtpv2_twan_laii;
623
static int hf_gtpv2_twan_ssid_len;
624
static int hf_gtpv2_twan_ssid;
625
static int hf_gtpv2_twan_bssid;
626
static int hf_gtpv2_twan_civa_len;
627
static int hf_gtpv2_twan_civa;
628
static int hf_gtpv2_twan_plmnid;
629
static int hf_gtpv2_twan_op_name_len;
630
static int hf_gtpv2_twan_op_name;
631
static int hf_gtpv2_twan_relay_id_type;
632
static int hf_gtpv2_twan_relay_id_len;
633
static int hf_gtpv2_twan_relay_id;
634
static int hf_gtpv2_twan_relay_id_ipv4;
635
static int hf_gtpv2_twan_relay_id_ipv6;
636
static int hf_gtpv2_twan_circuit_id_len;
637
static int hf_gtpv2_twan_circuit_id;
638
static int hf_gtpv2_integer_number_val;
639
static int hf_gtpv2_maximum_wait_time;
640
static int hf_gtpv2_dl_buf_sug_pkt_cnt;
641
static int hf_gtpv2_ue_usage_type;
642
static int hf_gtpv2_rem_run_serv_gap_t;
643
static int hf_gtpv2_ran_nas_protocol_type;
644
static int hf_gtpv2_ran_nas_cause_type;
645
static int hf_gtpv2_ran_nas_cause_value;
646
static int hf_gtpv2_emm_cause;
647
static int hf_gtpv2_esm_cause;
648
static int hf_gtpv2_diameter_cause;
649
static int hf_gtpv2_ikev2_cause;
650
651
static int hf_gtpv2_ciot_support_ind;
652
static int hf_gtpv2_ciot_support_ind_spare_bits;
653
static int hf_gtpv2_ciot_support_ind_bit4;
654
static int hf_gtpv2_ciot_support_ind_bit3;
655
static int hf_gtpv2_ciot_support_ind_bit2;
656
static int hf_gtpv2_ciot_support_ind_bit1;
657
658
static int hf_gtpv2_length_of_node_name;
659
static int hf_gtpv2_node_name;
660
static int hf_gtpv2_length_of_node_realm;
661
static int hf_gtpv2_node_realm;
662
static int hf_gtpv2_ms_ts;
663
static int hf_gtpv2_origination_ts;
664
static int hf_gtpv2_mon_event_inf_nsur;
665
static int hf_gtpv2_mon_event_inf_nsui;
666
static int hf_gtpv2_mon_event_inf_nscf;
667
static int hf_gtpv2_mon_event_inf_srie;
668
static int hf_gtpv2_mon_event_inf_scef_reference_id;
669
static int hf_gtpv2_mon_event_inf_scef_reference_id_ext;
670
static int hf_gtpv2_mon_event_inf_scef_id_length;
671
static int hf_gtpv2_mon_event_inf_scef_id;
672
static int hf_gtpv2_mon_event_inf_remaining_number_of_reports;
673
static int hf_gtpv2_mon_event_ext_inf_lrtp;
674
static int hf_gtpv2_mon_event_ext_inf_srie;
675
static int hf_gtpv2_mon_event_ext_inf_scef_reference_id;
676
static int hf_gtpv2_mon_event_ext_inf_scef_id_length;
677
static int hf_gtpv2_mon_event_ext_inf_scef_id;
678
static int hf_gtpv2_mon_event_ext_inf_remain_min_period_loc_report_type;
679
static int hf_gtpv2_mon_event_ext_inf_scef_reference_id_ext;
680
static int hf_gtpv2_rohc_profiles_bit0;
681
static int hf_gtpv2_rohc_profiles_bit1;
682
static int hf_gtpv2_rohc_profiles_bit2;
683
static int hf_gtpv2_rohc_profiles_bit3;
684
static int hf_gtpv2_rohc_profiles_bit4;
685
static int hf_gtpv2_rohc_profiles_bit5;
686
static int hf_gtpv2_rohc_profiles_bit6;
687
static int hf_gtpv2_rohc_profiles_bit7;
688
static int hf_gtpv2_max_cid;
689
static int hf_gtpv2_uplink_rate_limit;
690
static int hf_gtpv2_downlink_rate_limit;
691
static int hf_gtpv2_timestamp_value;
692
static int hf_gtpv2_counter_value;
693
static int hf_gtpv2_mapped_ue_usage_type;
694
static int hf_gtpv2_uli_flags;
695
static int hf_gtpv2_rohc_profile_flags;
696
static int hf_gtpv2_dcnr;
697
698
static int hf_gtpv2_secondary_rat_usage_data_report;
699
static int hf_gtpv2_secondary_rat_usage_data_report_spare_bits;
700
static int hf_gtpv2_secondary_rat_usage_data_report_bit3;
701
static int hf_gtpv2_secondary_rat_usage_data_report_bit2;
702
static int hf_gtpv2_secondary_rat_usage_data_report_bit1;
703
static int hf_gtpv2_secondary_rat_usage_data_report_rat_type;
704
static int hf_gtpv2_secondary_rat_usage_data_report_start_timestamp;
705
static int hf_gtpv2_secondary_rat_usage_data_report_end_timestamp;
706
static int hf_gtpv2_secondary_rat_usage_data_report_usage_data_dl;
707
static int hf_gtpv2_secondary_rat_usage_data_report_usage_data_ul;
708
static int hf_gtpv2_secondary_rat_usage_data_report_srudn_length;
709
static int hf_gtpv2_secondary_rat_usage_data_report_srudn_value;
710
static int hf_gtpv2_csg_info_rep_action_b0;
711
static int hf_gtpv2_csg_info_rep_action_b1;
712
static int hf_gtpv2_csg_info_rep_action_b2;
713
static int hf_gtpv2_gnodeb_id_len;
714
static int hf_gtpv2_gnodeb_id;
715
static int hf_gtpv2_macro_ng_enodeb_id;
716
static int hf_gtpv2_5gs_tac;
717
static int hf_gtpv2_en_gnb_id_len;
718
static int hf_gtpv2_5tac;
719
static int hf_gtpv2_etac;
720
static int hf_gtpv2_en_gnb_id;
721
static int hf_gtpv2_trig_event_len;
722
static int hf_gtpv2_ne_list_len;
723
static int hf_gtpv2_ses_trs_depth;
724
static int hf_gtpv2_list_of_if_len;
725
static int hf_gtpv2_trs_coll_ip_addr_len;
726
static int hf_gtpv2_trs_coll_ipv4_addr;
727
static int hf_gtpv2_trs_coll_ipv6_addr;
728
729
static int hf_gtpv2_ext_tra_info_loi_mscs_cap;
730
static int hf_gtpv2_ext_tra_info_loi_mscs_map_f;
731
static int hf_gtpv2_ext_tra_info_loi_mscs_map_e;
732
static int hf_gtpv2_ext_tra_info_loi_mscs_map_b;
733
static int hf_gtpv2_ext_tra_info_loi_mscs_map_g;
734
static int hf_gtpv2_ext_tra_info_loi_mscs_mc;
735
static int hf_gtpv2_ext_tra_info_loi_mscs_iu;
736
static int hf_gtpv2_ext_tra_info_loi_mscs_a;
737
static int hf_gtpv2_ext_tra_info_loi_mscs_map_c;
738
static int hf_gtpv2_ext_tra_info_loi_mscs_map_d;
739
static int hf_gtpv2_ext_tra_info_loi_mgw_iuup;
740
static int hf_gtpv2_ext_tra_info_loi_mgw_nbup;
741
static int hf_gtpv2_ext_tra_info_loi_mgw_mc;
742
static int hf_gtpv2_ext_tra_info_loi_sgsn_ge;
743
static int hf_gtpv2_ext_tra_info_loi_sgsn_gs;
744
static int hf_gtpv2_ext_tra_info_loi_sgsn_map_gf;
745
static int hf_gtpv2_ext_tra_info_loi_sgsn_map_gd;
746
static int hf_gtpv2_ext_tra_info_loi_sgsn_map_gr;
747
static int hf_gtpv2_ext_tra_info_loi_sgsn_gn;
748
static int hf_gtpv2_ext_tra_info_loi_sgsn_iu;
749
static int hf_gtpv2_ext_tra_info_loi_sgsn_gb;
750
static int hf_gtpv2_ext_tra_info_loi_sgsn_s13;
751
static int hf_gtpv2_ext_tra_info_loi_sgsn_s3;
752
static int hf_gtpv2_ext_tra_info_loi_sgsn_s4;
753
static int hf_gtpv2_ext_tra_info_loi_sgsn_s6d;
754
static int hf_gtpv2_ext_tra_info_loi_ggsn_gmb;
755
static int hf_gtpv2_ext_tra_info_loi_ggsn_gi;
756
static int hf_gtpv2_ext_tra_info_loi_ggsn_gn;
757
static int hf_gtpv2_ext_tra_info_loi_rnc_uu;
758
static int hf_gtpv2_ext_tra_info_loi_rnc_iub;
759
static int hf_gtpv2_ext_tra_info_loi_rnc_iur;
760
static int hf_gtpv2_ext_tra_info_loi_rnc_iu;
761
static int hf_gtpv2_ext_tra_info_loi_bm_sc_gmb;
762
static int hf_gtpv2_ext_tra_info_loi_mme_s13;
763
static int hf_gtpv2_ext_tra_info_loi_mme_s11;
764
static int hf_gtpv2_ext_tra_info_loi_mme_s10;
765
static int hf_gtpv2_ext_tra_info_loi_mme_s6a;
766
static int hf_gtpv2_ext_tra_info_loi_mme_s3;
767
static int hf_gtpv2_ext_tra_info_loi_mme_s1_mme;
768
static int hf_gtpv2_ext_tra_info_loi_sgw_gxc;
769
static int hf_gtpv2_ext_tra_info_loi_sgw_s11;
770
static int hf_gtpv2_ext_tra_info_loi_sgw_s8b;
771
static int hf_gtpv2_ext_tra_info_loi_sgw_s5;
772
static int hf_gtpv2_ext_tra_info_loi_sgw_s4;
773
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_sgi;
774
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s8b;
775
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_gx;
776
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s6b;
777
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s5;
778
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s2c;
779
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s2b;
780
static int hf_gtpv2_ext_tra_info_loi_pdn_gw_s2a;
781
static int hf_gtpv2_ext_tra_info_loi_enb_uu;
782
static int hf_gtpv2_ext_tra_info_loi_enb_x2;
783
static int hf_gtpv2_ext_tra_info_loi_enb_s1_mme;
784
static int hf_gtpv2_ext_tra_info_loi_hss_sh;
785
static int hf_gtpv2_ext_tra_info_loi_hss_s6a;
786
static int hf_gtpv2_ext_tra_info_loi_hss_s6d;
787
static int hf_gtpv2_ext_tra_info_loi_hss_cx;
788
static int hf_gtpv2_ext_tra_info_loi_hss_map_gr;
789
static int hf_gtpv2_ext_tra_info_loi_hss_map_gc;
790
static int hf_gtpv2_ext_tra_info_loi_hss_map_d;
791
static int hf_gtpv2_ext_tra_info_loi_hss_map_c;
792
static int hf_gtpv2_ext_tra_info_loi_eir_map_gf;
793
static int hf_gtpv2_ext_tra_info_loi_eir_s13p;
794
static int hf_gtpv2_ext_tra_info_loi_eir_s13;
795
static int hf_gtpv2_ext_tra_info_loi_eir_map_f;
796
static int hf_gtpv2_ext_tra_info_loi_amf_n20;
797
static int hf_gtpv2_ext_tra_info_loi_amf_n15;
798
static int hf_gtpv2_ext_tra_info_loi_amf_n14;
799
static int hf_gtpv2_ext_tra_info_loi_amf_n12;
800
static int hf_gtpv2_ext_tra_info_loi_amf_n11;
801
static int hf_gtpv2_ext_tra_info_loi_amf_n8;
802
static int hf_gtpv2_ext_tra_info_loi_amf_n2;
803
static int hf_gtpv2_ext_tra_info_loi_amf_n1;
804
static int hf_gtpv2_ext_tra_info_loi_amf_n22;
805
static int hf_gtpv2_ext_tra_info_loi_amf_n26;
806
static int hf_gtpv2_ext_tra_info_loi_pcf_n15;
807
static int hf_gtpv2_ext_tra_info_loi_pcf_n7;
808
static int hf_gtpv2_ext_tra_info_loi_pcf_n5;
809
static int hf_gtpv2_ext_tra_info_loi_smf_s5_c;
810
static int hf_gtpv2_ext_tra_info_loi_smf_n11;
811
static int hf_gtpv2_ext_tra_info_loi_smf_n10;
812
static int hf_gtpv2_ext_tra_info_loi_smf_n7;
813
static int hf_gtpv2_ext_tra_info_loi_smf_n4;
814
static int hf_gtpv2_ext_tra_info_loi_upf_n4;
815
static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_e1_c;
816
static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_f1_c;
817
static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_Uu;
818
static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_xn_c;
819
static int hf_gtpv2_ext_tra_info_loi_ng_ran_node_ng_c;
820
821
static int hf_gtpv2_nr_dl_pkts_all;
822
static int hf_gtpv2_nr_ul_pkts_all;
823
static int hf_gtpv2_nr_add_exception_rpts;
824
static int hf_apn_rte_cntrl_status_val_time;
825
static int hf_gtpv2_max_pkt_loss_rte_ul_flg;
826
static int hf_gtpv2_max_pkt_loss_rte_dl_flg;
827
static int hf_gtpv2_max_pkt_loss_rte_ul;
828
static int hf_gtpv2_max_pkt_loss_rte_dl;
829
830
static int hf_gtpv2_mm_context_iov_updates_counter;
831
static int hf_gtpv2_mm_context_ear_len;
832
static int hf_gtpv2_node_number_len;
833
static int hf_gtpv2_additional_rrm_policy_index;
834
835
static int hf_gtpv2_group_id;
836
837
static int hf_gtpv2_ie_pscell_id_spare;
838
static int hf_gtpv2_ie_pscell_id_nr_cgi;
839
static int hf_gtpv2_ie_up_security_policy_up_ip_policy;
840
static int hf_gtpv2_ie_up_security_policy_spare;
841
static int hf_gtpv2_nf_instance_id_nf_instance_id;
842
static int hf_gtpv2_nf_timer_in_seconds_timer_value;
843
844
845
static int ett_gtpv2;
846
static int ett_gtpv2_flags;
847
static int ett_gtpv2_uli_flags;
848
static int ett_gtpv2_uli_field;
849
static int ett_gtpv2_bearer_ctx;
850
static int ett_gtpv2_PDN_conn;
851
static int ett_gtpv2_overload_control_information;
852
static int ett_gtpv2_mm_context_flag;
853
static int ett_gtpv2_pdn_numbers_nsapi;
854
static int ett_gtpv2_tra_info_trigg;
855
static int ett_gtpv2_tra_info_trigg_msc_server;
856
static int ett_gtpv2_tra_info_trigg_mgw;
857
static int ett_gtpv2_tra_info_trigg_sgsn;
858
static int ett_gtpv2_tra_info_trigg_ggsn;
859
static int ett_gtpv2_tra_info_trigg_bm_sc;
860
static int ett_gtpv2_tra_info_trigg_sgw_mme;
861
static int ett_gtpv2_tra_info_trigg_sgw;
862
static int ett_gtpv2_tra_info_trigg_pgw;
863
static int ett_gtpv2_tra_info_interfaces;
864
static int ett_gtpv2_tra_info_interfaces_imsc_server;
865
static int ett_gtpv2_tra_info_interfaces_lmgw;
866
static int ett_gtpv2_tra_info_interfaces_lsgsn;
867
static int ett_gtpv2_tra_info_interfaces_lggsn;
868
static int ett_gtpv2_tra_info_interfaces_lrnc;
869
static int ett_gtpv2_tra_info_interfaces_lbm_sc;
870
static int ett_gtpv2_tra_info_interfaces_lmme;
871
static int ett_gtpv2_tra_info_interfaces_lsgw;
872
static int ett_gtpv2_tra_info_interfaces_lpdn_gw;
873
static int ett_gtpv2_tra_info_interfaces_lpdn_lenb;
874
static int ett_gtpv2_tra_info_ne_types;
875
static int ett_gtpv2_rai;
876
static int ett_gtpv2_ms_mark;
877
static int ett_gtpv2_stn_sr;
878
static int ett_gtpv2_supp_codec_list;
879
static int ett_gtpv2_bss_con;
880
static int ett_gtpv2_utran_con;
881
static int ett_gtpv2_eutran_con;
882
static int ett_gtpv2_son_con;
883
static int ett_gtpv2_endc_son_con;
884
static int ett_gtpv2_intersys_son_con;
885
static int ett_gtpv2_mm_context_auth_qua;
886
static int ett_gtpv2_mm_context_auth_qui;
887
static int ett_gtpv2_mm_context_auth_tri;
888
static int ett_gtpv2_mm_context_net_cap;
889
static int ett_gtpv2_ms_network_capability;
890
static int ett_gtpv2_mm_context_sc;
891
static int ett_gtpv2_vd_pref;
892
static int ett_gtpv2_access_rest_data;
893
static int ett_gtpv2_qua;
894
static int ett_gtpv2_qui;
895
static int ett_gtpv2_preaa_tais;
896
static int ett_gtpv2_preaa_menbs;
897
static int ett_gtpv2_preaa_henbs;
898
static int ett_gtpv2_preaa_ecgis;
899
static int ett_gtpv2_preaa_rais;
900
static int ett_gtpv2_preaa_sais;
901
static int ett_gtpv2_preaa_cgis;
902
static int ett_gtpv2_load_control_inf;
903
static int ett_gtpv2_eci;
904
static int ett_gtpv2_twan_flags;
905
static int ett_gtpv2_ciot_support_ind;
906
static int ett_gtpv2_rohc_profile_flags;
907
static int ett_gtpv2_secondary_rat_usage_data_report;
908
static int ett_gtpv2_pres_rep_area_info;
909
static int ett_gtpv2_preaa_ext_menbs;
910
static int ett_gtpv2_ue_nr_sec_cap_len;
911
static int ett_gtpv2_apn_rte_ctrl_sts_len;
912
static int ett_gtpv2_if_mgcs;
913
static int ett_gtpv2_if_mgw;
914
static int ett_gtpv2_if_sgsn;
915
static int ett_gtpv2_if_ggsn;
916
static int ett_gtpv2_if_rnc;
917
static int ett_gtpv2_if_bm_sc;
918
static int ett_gtpv2_if_mme;
919
static int ett_gtpv2_if_sgw;
920
static int ett_gtpv2_if_pdn_gw;
921
static int ett_gtpv2_if_enb;
922
static int ett_gtpv2_if_hss;
923
static int ett_gtpv2_if_eir;
924
static int ett_gtpv2_if_amf;
925
static int ett_gtpv2_if_pcf;
926
static int ett_gtpv2_if_smf;
927
static int ett_gtpv2_if_upf;
928
static int ett_gtpv2_if_ng_ran_node;
929
static int ett_gtpv2_PGW_change_info;
930
931
932
static expert_field ei_gtpv2_ie_data_not_dissected;
933
static expert_field ei_gtpv2_ie_len_invalid;
934
static expert_field ei_gtpv2_source_type_unknown;
935
static expert_field ei_gtpv2_fq_csid_type_bad;
936
static expert_field ei_gtpv2_mbms_session_duration_days;
937
static expert_field ei_gtpv2_mbms_session_duration_secs;
938
static expert_field ei_gtpv2_ie;
939
static expert_field ei_gtpv2_int_size_not_handled;
940
static expert_field ei_gtpv2_apn_too_long;
941
942
static int gtpv2_tap;
943
944
/* Definition of User Location Info (AVP 22) masks */
945
24
#define GTPv2_ULI_CGI_MASK              0x01
946
24
#define GTPv2_ULI_SAI_MASK              0x02
947
24
#define GTPv2_ULI_RAI_MASK              0x04
948
24
#define GTPv2_ULI_TAI_MASK              0x08
949
24
#define GTPv2_ULI_ECGI_MASK             0x10
950
24
#define GTPv2_ULI_LAI_MASK              0x20
951
24
#define GTPv2_ULI_MACRO_eNB_ID_MASK     0x40
952
24
#define GTPv2_ULI_EXT_MACRO_eNB_ID_MASK 0x80
953
954
14
#define GTPV2_PPI_VAL_MASK          0x3F
955
956
109
#define GTPV2_SRVCC_PS_TO_CS_REQUEST     25
957
129
#define GTPV2_SRVCC_PS_TO_CS_RESPONSE    26
958
104
#define GTPV2_SRVCC_PS_TO_CS_COMPLETE_NOTIFICATION 27
959
126
#define GTPV2_SRVCC_PS_TO_CS_COMPLETE_ACKNOWLEDGE  28
960
106
#define GTPV2_SRVCC_PS_TO_CS_CANCEL_NOTIFICATION   29
961
126
#define GTPV2_SRVCC_PS_TO_CS_CANCEL_ACKNOWLEDGE    30
962
5
#define GTPV2_CREATE_SESSION_REQUEST     32
963
14
#define GTPV2_CREATE_SESSION_RESPONSE    33
964
34
#define GTPV2_MODIFY_BEARER_REQUEST      34
965
26
#define GTPV2_MODIFY_BEARER_RESPONSE     35
966
51
#define GTPV2_DELETE_SESSION_REQUEST     36
967
47
#define GTPV2_DELETE_SESSION_RESPONSE    37
968
#define GTPV2_REMOTE_UE_REPORT_NOTIFICATION     40
969
#define GTPV2_REMOTE_UE_REPORT_ACKNOWLEDGE    41
970
88
#define GTPV2_MODIFY_BEARER_COMMAND      64
971
52
#define GTPV2_MODIFY_BEARER_FAILURE_INDICATION    65
972
94
#define GTPV2_DELETE_BEARER_COMMAND      66
973
56
#define GTPV2_DELETE_BEARER_FAILURE_INDICATION    67
974
102
#define GTPV2_BEARER_RESOURCE_COMMAND    68
975
116
#define GTPV2_BEARER_RESOURCE_FAILURE_INDICATION  69
976
13
#define GTPV2_CREATE_BEARER_REQUEST      95
977
20
#define GTPV2_CREATE_BEARER_RESPONSE     96
978
36
#define GTPV2_UPDATE_BEARER_REQUEST      97
979
24
#define GTPV2_UPDATE_BEARER_RESPONSE     98
980
44
#define GTPV2_DELETE_BEARER_REQUEST      99
981
32
#define GTPV2_DELETE_BEARER_RESPONSE    100
982
0
#define GTPV2_IDENTIFICATION_RESPONSE   129
983
110
#define GTPV2_CONTEXT_REQUEST           130
984
138
#define GTPV2_CONTEXT_RESPONSE          131
985
#define GTPV2_CONTEXT_ACKNOWLEDGE       132
986
191
#define GTPV2_FORWARD_RELOCATION_REQ    133
987
173
#define GTPV2_FORWARD_RELOCATION_RESP   134
988
124
#define GTPV2_FORWARD_RELOCATION_COMPLETE_NOTIFICATION    135
989
180
#define GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE     136
990
127
#define GTPV2_FORWARD_CTX_NOTIFICATION  137
991
176
#define GTPV2_FORWARD_CTX_ACKNOWLEDGE   138
992
114
#define GTPV2_RELOCATION_CANCEL_REQUEST         139
993
138
#define GTPV2_RELOCATION_CANCEL_RESPONSE        140
994
4
#define GTPV2_CONFIGURATION_TRANSFER_TUNNEL        141
995
4
#define GTPV2_RAN_INFORMATION_RELAY     152
996
132
#define GTPV2_RELEASE_ACCESS_BEARERS_REQUEST      170
997
180
#define GTPV2_RELEASE_ACCESS_BEARERS_RESPONSE      171
998
136
#define GTPV2_DL_DATA_NOTIF            176
999
184
#define GTPV2_DL_DATA_NOTIF_ACK        177
1000
#define GTPV2_MODIFY_ACESSS_BEARER_REQUEST      211
1001
#define GTPV2_MODIFY_ACCESS_BEARER_RESPONSE     212
1002
1003
/* Table 6.1-1: Message types for GTPv2 */
1004
static const value_string gtpv2_message_type_vals[] = {
1005
    {  0, "Reserved"},
1006
    {  1, "Echo Request"},
1007
    {  2, "Echo Response"},
1008
    {  3, "Version Not Supported Indication"},
1009
    /* 4-24 Reserved for S101 interface TS 29.276 */
1010
    {  4, "Node Alive Request"},
1011
    {  5, "Node Alive Response"},
1012
    {  6, "Redirection Request"},
1013
    {  7, "Redirection Response"},
1014
    /* 25-31 Reserved for Sv interface TS 29.280 */
1015
/*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 5.2.1*/
1016
    { 25, "SRVCC PS to CS Request"},
1017
    { 26, "SRVCC PS to CS Response"},
1018
    { 27, "SRVCC PS to CS Complete Notification"},
1019
    { 28, "SRVCC PS to CS Complete Acknowledge"},
1020
    { 29, "SRVCC PS to CS Cancel Notification"},
1021
    { 30, "SRVCC PS to CS Cancel Acknowledge"},
1022
    { 31, "SRVCC CS to PS Request"},
1023
/*End SRVCC Messages*/
1024
    /* SGSN/MME to PGW (S4/S11, S5/S8) */
1025
    { 32, "Create Session Request"},
1026
    { 33, "Create Session Response"},
1027
    { 34, "Modify Bearer Request"},
1028
    { 35, "Modify Bearer Response"},
1029
    { 36, "Delete Session Request"},
1030
    { 37, "Delete Session Response"},
1031
    /* SGSN/MME to PGW (S4/S11, S5/S8) */
1032
    { 38, "Change Notification Request"},
1033
    { 39, "Change Notification Response"},
1034
    /* MME to PGW (S11, S5/S8) */
1035
    { 40, "Remote UE Report Notification" },
1036
    { 41, "Remote UE Report Acknowledge" },
1037
    /* 42-63 For future use */
1038
    /* Messages without explicit response */
1039
    { 64, "Modify Bearer Command"},                          /* (MME/SGSN to PGW -S11/S4, S5/S8) */
1040
    { 65, "Modify Bearer Failure Indication"},               /*(PGW to MME/SGSN -S5/S8, S11/S4) */
1041
    { 66, "Delete Bearer Command"},                          /* (MME to PGW -S11, S5/S8) */
1042
    { 67, "Delete Bearer Failure Indication"},               /* (PGW to MME -S5/S8, S11) */
1043
    { 68, "Bearer Resource Command"},                        /* (MME/SGSN to PGW -S11/S4, S5/S8) */
1044
    { 69, "Bearer Resource Failure Indication"},             /* (PGW to MME/SGSN -S5/S8, S11/S4) */
1045
    { 70, "Downlink Data Notification Failure Indication"},  /*(SGSN/MME to SGW -S4/S11) */
1046
    { 71, "Trace Session Activation"},
1047
    { 72, "Trace Session Deactivation"},
1048
    { 73, "Stop Paging Indication"},
1049
    /* 74-94 For future use */
1050
    /* PGW to SGSN/MME/ TWAN/ePDG (S5/S8, S4/S11, S2a, S2b) */
1051
    { 95, "Create Bearer Request"},
1052
    { 96, "Create Bearer Response"},
1053
    { 97, "Update Bearer Request"},
1054
    { 98, "Update Bearer Response"},
1055
    { 99, "Delete Bearer Request"},
1056
    {100, "Delete Bearer Response"},
1057
    /* PGW to MME, MME to PGW, SGW to PGW, SGW to MME (S5/S8, S11) */
1058
    {101, "Delete PDN Connection Set Request"},
1059
    {102, "Delete PDN Connection Set Response"},
1060
    /* PGW to SGSN/MME(S5, S4/S11) */
1061
    {103, "PGW Downlink Triggering Notification" },
1062
    {104, "PGW Downlink Triggering Acknowledge" },
1063
    /* 105-127 For future use */
1064
    /* MME to MME, SGSN to MME, MME to SGSN, SGSN to SGSN (S3/10/S16) */
1065
    {128, "Identification Request"},
1066
    {129, "Identification Response"},
1067
    {130, "Context Request"},
1068
    {131, "Context Response"},
1069
    {132, "Context Acknowledge"},
1070
    {133, "Forward Relocation Request"},
1071
    {134, "Forward Relocation Response"},
1072
    {135, "Forward Relocation Complete Notification"},
1073
    {136, "Forward Relocation Complete Acknowledge"},
1074
    {137, "Forward Access Context Notification"},
1075
    {138, "Forward Access Context Acknowledge"},
1076
    {139, "Relocation Cancel Request"},
1077
    {140, "Relocation Cancel Response"},
1078
    {141, "Configuration Transfer Tunnel"},
1079
    /* 142-148 For future use */
1080
    /* SGSN to MME, MME to SGSN (S3)*/
1081
    {149, "Detach Notification"},
1082
    {150, "Detach Acknowledge"},
1083
    {151, "CS Paging Indication"},
1084
    {152, "RAN Information Relay"},
1085
    {153, "Alert MME Notification"},
1086
    {154, "Alert MME Acknowledge"},
1087
    {155, "UE Activity Notification"},
1088
    {156, "UE Activity Acknowledge" },
1089
    {157, "ISR Status Indication" },
1090
    {158, "UE Registration Query Request" },
1091
    {159, "UE Registration Query Response" },
1092
    /* MME to SGW (S11) */
1093
    {160, "Create Forwarding Tunnel Request"},
1094
    {161, "Create Forwarding Tunnel Response"},
1095
    {162, "Suspend Notification"},
1096
    {163, "Suspend Acknowledge"},
1097
    {164, "Resume Notification"},
1098
    {165, "Resume Acknowledge"},
1099
    {166, "Create Indirect Data Forwarding Tunnel Request"},
1100
    {167, "Create Indirect Data Forwarding Tunnel Response"},
1101
    {168, "Delete Indirect Data Forwarding Tunnel Request"},
1102
    {169, "Delete Indirect Data Forwarding Tunnel Response"},
1103
    {170, "Release Access Bearers Request"},
1104
    {171, "Release Access Bearers Response"},
1105
    /* 172-175 For future use */
1106
    /* SGW to SGSN/MME (S4/S11) */
1107
    {176, "Downlink Data Notification"},
1108
    {177, "Downlink Data Notification Acknowledgement"},
1109
    {178, "Reserved. Allocated in earlier version of the specification."},
1110
    {179, "PGW Restart Notification"},
1111
    {180, "PGW Restart Notification Acknowledge"},
1112
    /* 181-199 For future use */
1113
    /* SGW to PGW, PGW to SGW (S5/S8) */
1114
    {200, "Update PDN Connection Set Request"},
1115
    {201, "Update PDN Connection Set Response"},
1116
    /* 202 to 210 For future use */
1117
    /* MME to SGW (S11) */
1118
    {211, "Modify Access Bearers Request"},
1119
    {212, "Modify Access Bearers Response"},
1120
    /* 213 to 230 For future use */
1121
    /* MBMS GW to MME/SGSN (Sm/Sn) */
1122
    {231, "MBMS Session Start Request"},
1123
    {232, "MBMS Session Start Response"},
1124
    {233, "MBMS Session Update Request"},
1125
    {234, "MBMS Session Update Response"},
1126
    {235, "MBMS Session Stop Request"},
1127
    {236, "MBMS Session Stop Response"},
1128
    /* 237 to 239 For future use */
1129
    /* Reserved for Sv interface (see also types 25 to 31)    TS 29.280 */
1130
    {240, "SRVCC CS to PS Response"},               /* 5.2.9  3GPP TS 29.280 V11.5.0 (2013-09) */
1131
    {241, "SRVCC CS to PS Complete Notification"},  /* 5.2.10 3GPP TS 29.280 V11.5.0 (2013-09) */
1132
    {242, "SRVCC CS to PS Complete Acknowledge"},   /* 5.2.11 3GPP TS 29.280 V11.5.0 (2013-09) */
1133
    {243, "SRVCC CS to PS Cancel Notification"},    /* 5.2.12 3GPP TS 29.280 V11.5.0 (2013-09) */
1134
    {244, "SRVCC CS to PS Cancel Acknowledge"},     /* 5.2.13 3GPP TS 29.280 V11.5.0 (2013-09) */
1135
    /* 245 to 247       For future Sv interface use*/
1136
    /* 248 to 255 For future use */
1137
    {0, NULL}
1138
};
1139
static value_string_ext gtpv2_message_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_message_type_vals);
1140
1141
3.59k
#define NUM_GTPV2_IES 256
1142
static int ett_gtpv2_ies[NUM_GTPV2_IES];
1143
1144
4.91k
#define GTPV2_IE_RESERVED                 0
1145
#define GTPV2_IE_IMSI                     1
1146
#define GTPV2_IE_CAUSE                    2
1147
#define GTPV2_REC_REST_CNT                3
1148
/*Start SRVCC Messages*/
1149
#define GTPV2_IE_STN_SR                  51
1150
#define GTPV2_IE_SRC_TGT_TRANS_CON       52
1151
#define GTPV2_IE_TGT_SRC_TRANS_CON       53
1152
#define GTPV2_IE_MM_CON_EUTRAN_SRVCC     54
1153
#define GTPV2_IE_MM_CON_UTRAN_SRVCC      55
1154
#define GTPV2_IE_SRVCC_CAUSE             56
1155
#define GTPV2_IE_TGT_RNC_ID              57
1156
#define GTPV2_IE_TGT_GLOGAL_CELL_ID      58
1157
#define GTPV2_IE_TEID_C                  59
1158
#define GTPV2_IE_SV_FLAGS                60
1159
#define GTPV2_IE_SAI                     61
1160
#define GTPV2_IE_MM_CTX_FOR_CS_TO_PS_SRVCC 62
1161
/* 61 - 70 for future sv interface use*/
1162
/*End SRVCC Messages*/
1163
#define GTPV2_APN                        71
1164
#define GTPV2_AMBR                       72
1165
#define GTPV2_EBI                        73
1166
#define GTPV2_IP_ADDRESS                 74
1167
#define GTPV2_MEI                        75
1168
#define GTPV2_IE_MSISDN                  76
1169
#define GTPV2_INDICATION                 77
1170
#define GTPV2_PCO                        78
1171
#define GTPV2_PAA                        79
1172
#define GTPV2_BEARER_QOS                 80
1173
#define GTPV2_IE_FLOW_QOS                81
1174
#define GTPV2_IE_RAT_TYPE                82
1175
#define GTPV2_IE_SERV_NET                83
1176
#define GTPV2_IE_BEARER_TFT              84
1177
#define GTPV2_IE_TAD                     85
1178
#define GTPV2_IE_ULI                     86
1179
#define GTPV2_IE_F_TEID                  87
1180
#define GTPV2_IE_TMSI                    88
1181
#define GTPV2_IE_GLOBAL_CNID             89
1182
#define GTPV2_IE_S103PDF                 90
1183
#define GTPV2_IE_S1UDF                   91
1184
#define GTPV2_IE_DEL_VAL                 92
1185
3
#define GTPV2_IE_BEARER_CTX              93
1186
#define GTPV2_IE_CHAR_ID                 94
1187
#define GTPV2_IE_CHAR_CHAR               95
1188
#define GTPV2_IE_TRA_INFO                96
1189
#define GTPV2_BEARER_FLAG                97
1190
/* define GTPV2_IE_PAGING_CAUSE          98 (void) */
1191
#define GTPV2_IE_PDN_TYPE                99
1192
#define GTPV2_IE_PTI                    100
1193
#define GTPV2_IE_DRX_PARAM              101
1194
#define GTPV2_IE_UE_NET_CAPABILITY      102
1195
#define GTPV2_IE_MM_CONTEXT_GSM_T       103
1196
#define GTPV2_IE_MM_CONTEXT_UTMS_CQ     104
1197
#define GTPV2_IE_MM_CONTEXT_GSM_CQ      105
1198
#define GTPV2_IE_MM_CONTEXT_UTMS_Q      106
1199
#define GTPV2_IE_MM_CONTEXT_EPS_QQ      107
1200
#define GTPV2_IE_MM_CONTEXT_UTMS_QQ     108
1201
5
#define GTPV2_IE_PDN_CONNECTION         109
1202
#define GTPV2_IE_PDN_NUMBERS            110
1203
#define GTPV2_IE_P_TMSI                 111
1204
#define GTPV2_IE_P_TMSI_SIG             112
1205
#define GTPV2_IE_HOP_COUNTER            113
1206
#define GTPV2_IE_UE_TIME_ZONE           114
1207
#define GTPV2_IE_TRACE_REFERENCE        115
1208
#define GTPV2_IE_COMPLETE_REQUEST_MSG   116
1209
#define GTPV2_IE_GUTI                   117
1210
#define GTPV2_IE_F_CONTAINER            118
1211
#define GTPV2_IE_F_CAUSE                119
1212
#define GTPV2_IE_PLMN_ID                120
1213
#define GTPV2_IE_TARGET_ID              121
1214
/* GTPV2_IE_NSAPI                       122 */
1215
#define GTPV2_IE_PKT_FLOW_ID            123
1216
#define GTPV2_IE_RAB_CONTEXT            124
1217
#define GTPV2_IE_S_RNC_PDCP_CTX_INFO    125
1218
#define GTPV2_IE_PORT_NR                 126
1219
#define GTPV2_IE_APN_RESTRICTION        127
1220
#define GTPV2_IE_SEL_MODE               128
1221
#define GTPV2_IE_SOURCE_IDENT           129
1222
#define GTPV2_IE_BEARER_CONTROL_MODE    130
1223
#define GTPV2_IE_CNG_REP_ACT            131
1224
#define GTPV2_IE_FQ_CSID                132
1225
#define GTPV2_IE_CHANNEL_NEEDED         133
1226
#define GTPV2_IE_EMLPP_PRI              134
1227
#define GTPV2_IE_NODE_TYPE              135
1228
#define GTPV2_IE_FQDN                   136
1229
#define GTPV2_IE_TI                     137
1230
#define GTPV2_IE_MBMS_SESSION_DURATION  138
1231
#define GTPV2_IE_MBMS_SERVICE_AREA      139
1232
#define GTPV2_IE_MBMS_SESSION_ID        140
1233
#define GTPV2_IE_MBMS_FLOW_ID           141
1234
#define GTPV2_IE_MBMS_IP_MC_DIST        142
1235
#define GTPV2_IE_MBMS_DIST_ACK          143
1236
#define GTPV2_IE_RFSP_INDEX             144
1237
#define GTPV2_IE_UCI                    145
1238
#define GTPV2_IE_CSG_INFO_REP_ACTION    146
1239
#define GTPV2_IE_CSG_ID                 147
1240
#define GTPV2_IE_CMI                    148
1241
#define GTPV2_IE_SERVICE_INDICATOR      149
1242
#define GTPV2_IE_DETACH_TYPE            150
1243
#define GTPV2_IE_LDN                    151
1244
#define GTPV2_IE_NODE_FEATURES          152
1245
#define GTPV2_IE_MBMS_TIME_TO_DATA_XFER 153
1246
#define GTPV2_IE_THROTTLING             154
1247
#define GTPV2_IE_ARP                    155
1248
#define GTPV2_IE_EPC_TIMER              156
1249
#define GTPV2_IE_SIG_PRIO_IND           157
1250
#define GTPV2_IE_TMGI                   158
1251
#define GTPV2_IE_ADD_MM_CONT_FOR_SRVCC  159
1252
#define GTPV2_IE_ADD_FLAGS_FOR_SRVCC    160
1253
#define GTPV2_IE_MMBR                   161
1254
#define GTPV2_IE_MDT_CONFIG             162
1255
#define GTPV2_IE_APCO                   163
1256
#define GTPV2_IE_ABS_MBMS_DATA_TF_TIME  164
1257
#define GTPV2_IE_HENB_INFO_REPORT       165
1258
#define GTPV2_IE_IP4CP                  166
1259
#define GTPV2_IE_CHANGE_TO_REPORT_FLAGS 167
1260
#define GTPV2_IE_ACTION_INDICATION      168
1261
#define GTPV2_IE_TWAN_IDENTIFIER        169
1262
#define GTPV2_IE_ULI_TIMESTAMP          170
1263
#define GTPV2_IE_MBMS_FLAGS             171
1264
#define GTPV2_IE_RAN_NAS_CAUSE          172
1265
#define GTPV2_IE_CN_OP_SEL_ENT          173
1266
#define GTPV2_IE_TRUST_WLAN_MODE_IND    174
1267
#define GTPV2_IE_NODE_NUMBER            175
1268
#define GTPV2_IE_NODE_IDENTIFIER        176
1269
#define GTPV2_IE_PRES_REP_AREA_ACT      177
1270
#define GTPV2_IE_PRES_REP_AREA_INF      178
1271
#define GTPV2_IE_TWAN_ID_TS             179
1272
12
#define GTPV2_IE_OVERLOAD_CONTROL_INF   180
1273
8
#define GTPV2_IE_LOAD_CONTROL_INF       181
1274
#define GTPV2_IE_METRIC                 182
1275
#define GTPV2_IE_SEQ_NO                 183
1276
#define GTPV2_IE_APN_AND_REL_CAP        184
1277
#define GTPV2_IE_WLAN_OFFLOADABILITY_IND 185
1278
#define GTPV2_IE_PAGING_AND_SERVICE_INF 186
1279
#define GTPV2_IE_INTEGER_NUMBER         187
1280
#define GTPV2_IE_MILLISECOND_TS         188
1281
9.82k
#define GTPV2_IE_MON_EVENT_INF          189
1282
/*
1283
190    ECGI List
1284
191    Remote UE Context
1285
192    Remote User ID
1286
193    Remote UE IP information
1287
*/
1288
#define GTPV2_IE_CIOT_OPT_SUPPORT_IND       194
1289
1
#define GTPV2_IE_SCEF_PDN_CONNECTION        195
1290
#define GTPV2_IE_HEADER_COMP_CONF           196
1291
#define GTPV2_IE_EXTENDED_PCO               197
1292
#define GTPV2_IE_SERV_PLMN_RATE_CONTROL     198
1293
#define GTPV2_IE_COUNTER                    199
1294
#define GTPV2_IE_MAPPED_UE_USAGE_TYPE                200
1295
#define GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT     201
1296
#define GTPV2_IE_UP_FUNC_SEL_INDI_FLG                202
1297
#define GTPV2_IE_MAX_PKT_LOSS_RTE                    203
1298
#define GTPV2_IE_APN_RTE_CNTRL_STATUS                204
1299
#define GTPV2_IE_EXT_TRS_INF                         205
1300
#define GTPV2_IE_MON_EVENT_EXT_INF                   206
1301
#define GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX         207
1302
#define GTPV2_IE_V2X_CONTEXT                         208
1303
#define GTPV2_IE_PC5_QOS_PARAMETERS                  209
1304
#define GTPV2_IE_SERVICES_AUTHORIZED                 210
1305
#define GTPV2_IE_BIT_RATE                            211
1306
#define GTPV2_IE_PC5_QOS_FLOW                        212
1307
#define GTPV2_IE_SGI_PTP_TUNNEL_ADDRESS              213
1308
6
#define GTPV2_IE_PGW_CHANGE_INFO                     214
1309
#define GTPV2_IE_PGW_FQDN                            215
1310
#define GTPV2_IE_GROUP_ID                            216
1311
#define GTPV2_IE_PSCELL_ID                           217
1312
#define GTPV2_IE_UP_SECURITY_POLICY                  218
1313
#define GTPV2_IE_ALT_IMSI                            219
1314
#define GTPV2_IE_NF_INSTANCE_ID                      220
1315
#define GTPV2_IE_TIMER_IN_SECONDS                    221
1316
/*
1317
220 to 253    Spare. For future use.
1318
254    Special IE type for IE Type Extension
1319
255    Private Extension
1320
256 to 65535    Spare. For future use.
1321
1322
*/
1323
/* 169 to 254 reserved for future use */
1324
#define GTPV2_IE_PRIVATE_EXT            255
1325
1326
#define SPARE                               0X0
1327
#define CREATE_NEW_TFT                      0X20
1328
#define DELETE_TFT                          0X40
1329
#define ADD_PACKET_FILTERS_TFT              0X60
1330
#define REPLACE_PACKET_FILTERS_TFT          0X80
1331
#define DELETE_PACKET_FILTERS_TFT           0XA0
1332
#define NO_TFT_OPERATION                    0XC0
1333
#define RESERVED                            0XE0
1334
1335
/* SRVCC PS-to-CS Transparent Container Preference */
1336
14
#define PREF_DECODE_SRVCC_P2C_TRANS_CONT_NO            0
1337
14
#define PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN  1
1338
static int pref_decode_srvcc_p2c_trans_cont = PREF_DECODE_SRVCC_P2C_TRANS_CONT_NO;
1339
1340
static unsigned pref_pair_matching_max_interval_ms; /* Default: disable */
1341
1342
/* Table 8.1-1: Information Element types for GTPv2 */
1343
static const value_string gtpv2_element_type_vals[] = {
1344
    {  0, "Reserved"},
1345
    {  1, "International Mobile Subscriber Identity (IMSI)"},                   /* Variable Length / 8.3 */
1346
    {  2, "Cause"},                                                             /* Variable Length / 8.4 */
1347
    {  3, "Recovery (Restart Counter)"},                                        /* Variable Length / 8.5 */
1348
                                                                                /* 4-34 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
1349
                                                                                /* 35-50  / See 3GPP TS 29.276 */
1350
/*Start SRVCC Messages ETSI TS 129 280 V10.1.0 (2011-06) 6.1*/
1351
    { 51, "STN-SR"},                                                            /* Variable Length / 6.2 */
1352
    { 52, "Source to Target Transparent Container"},                            /* Variable Length / 6.3 */
1353
    { 53, "Target to Source Transparent Container"},                            /* Variable Length / 6.4 */
1354
    { 54, "MM Context for E-UTRAN SRVCC"},                                      /* Variable Length / 6.5 */
1355
    { 55, "MM Context for UTRAN SRVCC"},                                        /* Variable Length / 6.6 */
1356
    { 56, "SRVCC Cause"},                                                       /* Fixed Length / 6.7 */
1357
    { 57, "Target RNC ID"},                                                     /* Variable Length / 6.8 */
1358
    { 58, "Target Global Cell ID"},                                             /* Variable Length / 6.9 */
1359
    { 59, "TEID-C"},                                                            /* Extendable / 6.10 */
1360
    { 60, "Sv Flags" },                                                         /* Extendable / 6.11 */
1361
    { 61, "Service Area Identifier" },                                          /* Extendable / 6.12 */
1362
    { 62, "MM Context for CS to PS SRVCC" },                                    /* Extendable / 6.13 */
1363
                                                                                /* 63-70 For future Sv interface use */
1364
/*End SRVCC Messages*/
1365
    { 71, "Access Point Name (APN)"},                                           /* Variable Length / 8.6 */
1366
    { 72, "Aggregate Maximum Bit Rate (AMBR)"},                                 /* Fixed Length / 8.7 */
1367
    { 73, "EPS Bearer ID (EBI)"},                                               /* Extendable / 8.8 */
1368
    { 74, "IP Address"},                                                        /* Extendable / 8.9 */
1369
    { 75, "Mobile Equipment Identity (MEI)"},                                   /* Variable Length / 8.10 */
1370
    { 76, "MSISDN"},                                                            /* Variable Length / 8.11 */
1371
    { 77, "Indication"},                                                        /* Extendable / 8.12 */
1372
    { 78, "Protocol Configuration Options (PCO)"},                              /* Variable Length / 8.13 */
1373
    { 79, "PDN Address Allocation (PAA)"},                                      /* Variable Length / 8.14 */
1374
    { 80, "Bearer Level Quality of Service (Bearer QoS)"},                      /* Variable Length / 8.15 */
1375
    { 81, "Flow Quality of Service (Flow QoS)"},                                /* Extendable / 8.16 */
1376
    { 82, "RAT Type"},                                                          /* Extendable / 8.17 */
1377
    { 83, "Serving Network"},                                                   /* Extendable / 8.18 */
1378
    { 84, "EPS Bearer Level Traffic Flow Template (Bearer TFT)"},               /* Variable Length / 8.19 */
1379
    { 85, "Traffic Aggregation Description (TAD)"},                             /* Variable Length / 8.20 */
1380
    { 86, "User Location Info (ULI)"},                                          /* Variable Length / 8.21 */
1381
    { 87, "Fully Qualified Tunnel Endpoint Identifier (F-TEID)"},               /* Extendable / 8.22 */
1382
    { 88, "TMSI"},                                                              /* Variable Length / 8.23 */
1383
    { 89, "Global CN-Id"},                                                      /* Variable Length / 8.24 */
1384
    { 90, "S103 PDN Data Forwarding Info (S103PDF)"},                           /* Variable Length / 8.25 */
1385
    { 91, "S1-U Data Forwarding Info (S1UDF)"},                                 /* Variable Length/ 8.26 */
1386
    { 92, "Delay Value"},                                                       /* Extendable / 8.27 */
1387
    { 93, "Bearer Context"},                                                    /* Extendable / 8.28 */
1388
    { 94, "Charging ID"},                                                       /* Extendable / 8.29 */
1389
    { 95, "Charging Characteristics"},                                          /* Extendable / 8.30 */
1390
    { 96, "Trace Information"},                                                 /* Extendable / 8.31 */
1391
    { 97, "Bearer Flags"},                                                      /* Extendable / 8.32 */
1392
    { 98, "Paging Cause"},                                                      /* Variable Length / 8.33 */
1393
    { 99, "PDN Type"},                                                          /* Extendable / 8.34 */
1394
    {100, "Procedure Transaction ID"},                                          /* Extendable / 8.35 */
1395
    {101, "DRX Parameter"},                                                     /* Variable Length/ 8.36 */
1396
    {102, "UE Network Capability"},                                             /* Variable Length / 8.37 */
1397
    {103, "MM Context (GSM Key and Triplets)"},                                 /* Variable Length / 8.38 */
1398
    {104, "MM Context (UMTS Key, Used Cipher and Quintuplets)"},                /* Variable Length / 8.38 */
1399
    {105, "MM Context (GSM Key, Used Cipher and Quintuplets)"},                 /* Variable Length / 8.38 */
1400
    {106, "MM Context (UMTS Key and Quintuplets)"},                             /* Variable Length / 8.38 */
1401
    {107, "MM Context (EPS Security Context, Quadruplets and Quintuplets)"},    /* Variable Length / 8.38 */
1402
    {108, "MM Context (UMTS Key, Quadruplets and Quintuplets)"},                /* Variable Length / 8.38 */
1403
    {109, "PDN Connection"},                                                    /* Extendable / 8.39 */
1404
    {110, "PDU Numbers"},                                                       /* Extendable / 8.40 */
1405
    {111, "P-TMSI"},                                                            /* Variable Length / 8.41 */
1406
    {112, "P-TMSI Signature"},                                                  /* Variable Length / 8.42 */
1407
    {113, "Hop Counter"},                                                       /* Extendable / 8.43 */
1408
    {114, "UE Time Zone"},                                                      /* Variable Length / 8.44 */
1409
    {115, "Trace Reference"},                                                   /* Fixed Length / 8.45 */
1410
    {116, "Complete Request Message"},                                          /* Variable Length / 8.46 */
1411
    {117, "GUTI"},                                                              /* Variable Length / 8.47 */
1412
    {118, "F-Container"},                                                       /* Variable Length / 8.48 */
1413
    {119, "F-Cause"},                                                           /* Variable Length / 8.49 */
1414
    {120, "PLMN ID"},                                                           /* Variable Length / 8.50 */
1415
    {121, "Target Identification"},                                             /* Variable Length / 8.51 */
1416
    {122, "NSAPI"},                                                             /* Extendable / 8.52 */
1417
    {123, "Packet Flow ID"},                                                    /* Variable Length / 8.53 */
1418
    {124, "RAB Context"},                                                       /* Fixed Length / 8.54 */
1419
    {125, "Source RNC PDCP Context Info"},                                      /* Variable Length / 8.55 */
1420
    {126, "Port Number"},                                                       /* Extendable / 8.56 */
1421
    {127, "APN Restriction"},                                                   /* Extendable / 8.57 */
1422
    {128, "Selection Mode"},                                                    /* Extendable / 8.58 */
1423
    {129, "Source Identification"},                                             /* Variable Length / 8.50 */
1424
    {130, "Bearer Control Mode"},                                               /* Extendable / 8.60 */
1425
    {131, "Change Reporting Action"},                                           /* Variable Length / 8.61 */
1426
    {132, "Fully Qualified PDN Connection Set Identifier (FQ-CSID)"},           /* Variable Length / 8.62 */
1427
    {133, "Channel needed"},                                                    /* Extendable / 8.63 */
1428
    {134, "eMLPP Priority"},                                                    /* Extendable / 8.64 */
1429
    {135, "Node Type"},                                                         /* Extendable / 8.65 */
1430
    {136, "Fully Qualified Domain Name (FQDN)"},                                /* Variable Length / 8.66 */
1431
    {137, "Transaction Identifier (TI)"},                                       /* Variable Length / 8.68 */
1432
    {138, "MBMS Session Duration"},                                             /* Duration Extendable / 8.69 */
1433
    {139, "MBMS Service Area"},                                                 /* Extendable / 8.70 */
1434
    {140, "MBMS Session Identifier"},                                           /* Extendable / 8.71 */
1435
    {141, "MBMS Flow Identifier"},                                              /* Extendable / 8.72 */
1436
    {142, "MBMS IP Multicast Distribution"},                                    /* Extendable / 8.73 */
1437
    {143, "MBMS Distribution Acknowledge"},                                     /* Extendable / 8.74 */
1438
    {144, "RFSP Index"},                                                        /* Fixed Length / 8.77 */
1439
    {145, "User CSG Information (UCI)"},                                        /* Extendable / 8.75 */
1440
    {146, "CSG Information Reporting Action"},                                  /* Extendable / 8.76 */
1441
    {147, "CSG ID"},                                                            /* Extendable / 8.78 */
1442
    {148, "CSG Membership Indication (CMI)"},                                   /* Extendable / 8.79 */
1443
    {149, "Service indicator"},                                                 /* Fixed Length / 8.80 */
1444
    {150, "Detach Type"},                                                       /* Fixed Length / 8.81 */
1445
    {151, "Local Distinguished Name (LDN)"},                                    /* Variable Length / 8.82 */
1446
    {152, "Node Features"},                                                     /* Extendable / 8.83 */
1447
    {153, "MBMS Time to Data Transfer"},                                        /* Extendable / 8.84 */
1448
    {154, "Throttling"},                                                        /* Extendable / 8.85 */
1449
    {155, "Allocation/Retention Priority (ARP)"},                               /* Extendable / 8.86 */
1450
    {156, "EPC Timer"},                                                         /* Extendable / 8.87 */
1451
    {157, "Signalling Priority Indication"},                                    /* Extendable / 8.88 */
1452
    {158, "Temporary Mobile Group Identity"},                                   /* Extendable / 8.89 */
1453
    {159, "Additional MM context for SRVCC"},                                   /* Extendable / 8.90 */
1454
    {160, "Additional flags for SRVCC"},                                        /* Extendable / 8.91 */
1455
    {161, "Max MBR/APN-AMBR (MMBR)"},                                           /* Extendable / 8.92 */
1456
    {162, "MDT Configuration"},                                                 /* Extendable / 8.93 */
1457
    {163, "Additional Protocol Configuration Options (APCO)"},                  /* Extendable / 8.94 */
1458
    {164, "Absolute Time of MBMS Data Transfer"},                               /* Extendable / 8.95 */
1459
    {165, "H(e)NB Information Reporting"},                                      /* Extendable / 8.96*/
1460
    {166, "IPv4 Configuration Parameters (IP4CP)"},                             /* Extendable / 8.97*/
1461
    {167, "Change to Report Flags"},                                            /* Extendable / 8.98 */
1462
    {168, "Action Indication"},                                                 /* Extendable / 8.99 */
1463
    {169, "TWAN Identifier "},                                                  /* Extendable / 8.100 */
1464
    {170, "ULI Timestamp"},                                                     /* Extendable / 8.101 */
1465
    {171, "MBMS Flags"},                                                        /* Extendable / 8.102 */
1466
    {172, "RAN/NAS Cause"},                                                     /* Extendable / 8.103 */
1467
    {173, "CN Operator Selection Entity"},                                      /* Extendable / 8.104 */
1468
    {174, "Trusted WLAN Mode Indication"},                                      /* Extendable / 8.105 */
1469
    {175, "Node Number"},                                                       /* Extendable / 8.106 */
1470
    {176, "Node Identifier"},                                                   /* Extendable / 8.107 */
1471
    {177, "Presence Reporting Area Action"},                                    /* Extendable / 8.108 */
1472
    {178, "Presence Reporting Area Information"},                               /* Extendable / 8.109 */
1473
    {179, "TWAN Identifier Timestamp"},                                         /* Extendable / 8.110 */
1474
    {180, "Overload Control Information"},                                      /* Extendable / 8.111 */
1475
    {181, "Load Control Information"},                                          /* Extendable / 8.112 */
1476
    {182, "Metric"},                                                            /* Fixed Length / 8.113 */
1477
    {183, "Sequence Number"},                                                   /* Fixed Length / 8.114 */
1478
    {184, "APN and Relative Capacity"},                                         /* Extendable / 8.115 */
1479
    {185, "WLAN Offloadability Indication"},                                    /* Extendable / 8.116 */
1480
    {186, "Paging and Service Information"},                                    /* Extendable / 8.117 */
1481
    {187, "Integer Number" },                                                   /* Variable / 8.118 */
1482
    {188, "Millisecond Time Stamp" },                                           /* Extendable / 8.119 */
1483
    {189, "Monitoring Event Information"},                                      /* Extendable / 8.120 */
1484
    {190, "ECGI List"},                                                         /* Extendable / 8.121 */
1485
    {191, "Remote UE Context"},                                                 /* Extendable / 8.122 */
1486
    {192, "Remote User ID"},                                                    /* Extendable / 8.123 */
1487
    {193, "Remote UE IP information"},                                          /* Variable Length / 8.124 */
1488
    {194, "CIoT Optimizations Support Indication"},                             /* Extendable / 8.125 */
1489
    {195, "SCEF PDN Connection"},                                               /* Extendable / 8.126 */
1490
    {196, "Header Compression Configuration"},                                  /* Extendable / 8.127 */
1491
    {197, "Extended Protocol Configuration Options(ePCO)"},                     /* Variable Length / 8.128 */
1492
    {198, "Serving PLMN Rate Control"},                                         /* Extendable / 8.129 */
1493
    {199, "Counter" },                                                          /* Extendable / 8.130 */
1494
    {200, "Mapped UE Usage Type" },                                             /* Extendable / 8.131 */
1495
    {201, "Secondary RAT Usage Data Report" },                                  /* Extendable / 8.132 */
1496
    {202, "UP Function Selection Indication Flags" },                           /* Extendable / 8.133 */
1497
    {203, "Maximum Packet Loss Rate" },                                         /* Extendable / 8.134 */
1498
    {204, "APN Rate Control Status" },                                          /* Extendable / 8.135 */
1499
    {205, "Extended Trace Information" },                                       /* Extendable / 8.136 */
1500
    {206, "Monitoring Event Extension Information" },                           /* Extendable / 8.137 */
1501
    {207, "Additional RRM Policy Index" },                                      /* Fixed Length / 8.138 */
1502
    {208, "V2X Context" },                                                      /* Extendable / 8.139 */
1503
    {209, "PC5 QoS Parameters" },                                               /* Extendable / 8.140 */
1504
    {210, "Services Authorized" },                                              /* Extendable / 8.141 */
1505
    {211, "Bit Rate" },                                                         /* Extendable / 8.142 */
1506
    {212, "PC5 QoS Flow" },                                                     /* Extendable / 8.143 */
1507
    {213, "SGi PtP Tunnel Address" },                                           /* Extendable / 8.144 */
1508
    {214, "PGW Change Info" },                                                  /* Extendable / 8.145 */
1509
    {215, "PGW FQDN" },                                                         /* Extendable / 8.146 */
1510
    {216, "Group Id" },                                                         /* Variable Length / 8.147 */
1511
    {217, "PSCell ID" },                                                        /* Fixed Length / 8.148*/
1512
    {218, "UP Security Policy" },                                               /* Extendable / 8.149*/
1513
    {219, "Alternative IMSI" },                                                 /* Variable Length / 8.150 */
1514
    {220, "NF Instance ID" },                                                   /* Fixed Length / 8.151 */
1515
    {221, "Timer in Seconds"},                                                  /* Variable Length / 8.152 */
1516
                                                                                /* 222 to 254    Spare. For future use.    */
1517
    {255, "Private Extension"},                                                 /* Variable Length / 8.67 */
1518
    {0, NULL}
1519
};
1520
static value_string_ext gtpv2_element_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_element_type_vals);
1521
1522
typedef struct _gtpv2_hdr {
1523
    uint8_t flags;   /* GTP header flags */
1524
    uint8_t message; /* Message type */
1525
    uint16_t length; /* Length of header */
1526
    int64_t teid;    /* Tunnel End-point ID */
1527
} gtpv2_hdr_t;
1528
1529
/* Data structure attached to a  conversation,
1530
to keep track of request/response-pairs
1531
*/
1532
typedef struct gtpv2_conv_info_t {
1533
    wmem_map_t             *unmatched;
1534
    wmem_map_t             *matched;
1535
} gtpv2_conv_info_t;
1536
1537
/*structure used to track responses to requests using sequence number*/
1538
typedef struct gtpv2_msg_hash_entry {
1539
    bool is_request;    /*true/false*/
1540
    uint32_t req_frame;      /*frame with request */
1541
    nstime_t req_time;      /*req time */
1542
    uint32_t rep_frame;      /*frame with reply */
1543
    unsigned seq_nr;            /*sequence number*/
1544
    unsigned msgtype;          /*messagetype*/
1545
    uint32_t conv_id;      /*IP conversation ID, for handling deinterlacing*/
1546
} gtpv2_msg_hash_t;
1547
1548
static unsigned
1549
gtpv2_sn_hash(const void *k)
1550
437
{
1551
437
    const gtpv2_msg_hash_t *key = (const gtpv2_msg_hash_t *)k;
1552
1553
437
    return key->seq_nr;
1554
437
}
1555
1556
static int
1557
gtpv2_sn_equal_matched(const void *k1, const void *k2)
1558
144
{
1559
144
    const gtpv2_msg_hash_t *key1 = (const gtpv2_msg_hash_t *)k1;
1560
144
    const gtpv2_msg_hash_t *key2 = (const gtpv2_msg_hash_t *)k2;
1561
144
    double diff;
1562
144
    nstime_t delta;
1563
1564
144
    if (key1->req_frame && key2->req_frame && (key1->req_frame != key2->req_frame)) {
1565
71
        return 0;
1566
71
    }
1567
1568
73
    if (key1->rep_frame && key2->rep_frame && (key1->rep_frame != key2->rep_frame)) {
1569
55
        return 0;
1570
55
    }
1571
1572
18
    if (pref_pair_matching_max_interval_ms) {
1573
0
        nstime_delta(&delta, &key1->req_time, &key2->req_time);
1574
0
        diff = fabs(nstime_to_msec(&delta));
1575
1576
0
        return key1->seq_nr == key2->seq_nr && diff < pref_pair_matching_max_interval_ms;
1577
0
    }
1578
1579
18
    return key1->seq_nr == key2->seq_nr;
1580
18
}
1581
1582
static int
1583
gtpv2_sn_equal_unmatched(const void *k1, const void *k2)
1584
52
{
1585
52
    const gtpv2_msg_hash_t *key1 = (const gtpv2_msg_hash_t *)k1;
1586
52
    const gtpv2_msg_hash_t *key2 = (const gtpv2_msg_hash_t *)k2;
1587
52
    double diff;
1588
52
    nstime_t delta;
1589
1590
52
    if (pref_pair_matching_max_interval_ms) {
1591
0
        nstime_delta(&delta, &key1->req_time, &key2->req_time);
1592
0
        diff = fabs(nstime_to_msec(&delta));
1593
1594
0
        return key1->seq_nr == key2->seq_nr && diff < pref_pair_matching_max_interval_ms;
1595
0
    }
1596
1597
52
    return key1->seq_nr == key2->seq_nr;
1598
52
}
1599
1600
static GHashTable *gtpv2_stat_msg_idx_hash;
1601
1602
static void
1603
gtpv2_stat_init(struct register_srt* srt _U_, GArray*srt_array)
1604
0
{
1605
0
    if (gtpv2_stat_msg_idx_hash != NULL) {
1606
0
        g_hash_table_destroy(gtpv2_stat_msg_idx_hash);
1607
0
    }
1608
0
    gtpv2_stat_msg_idx_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
1609
1610
0
    init_srt_table("GTPv2 Requests", NULL, srt_array, 0, NULL, NULL, NULL);
1611
0
}
1612
1613
static tap_packet_status
1614
gtpv2_stat_packet(void *pss, packet_info *pinfo, epan_dissect_t *edt _U_, const void *prv, tap_flags_t flags _U_)
1615
0
{
1616
0
    unsigned i = 0;
1617
0
    srt_stat_table *gtpv2_srt_table;
1618
0
    srt_data_t *srt_data = (srt_data_t*)pss;
1619
0
    const gtpv2_msg_hash_t *gcrp = (const gtpv2_msg_hash_t *)prv;
1620
0
    int idx = 0;
1621
1622
    /* We are only interested in matched reply packets. */
1623
0
    if (gcrp->is_request) {
1624
0
        return TAP_PACKET_DONT_REDRAW;
1625
0
    }
1626
0
    if (!gcrp->req_frame) {
1627
0
        return TAP_PACKET_DONT_REDRAW;
1628
0
    }
1629
1630
0
    gtpv2_srt_table = g_array_index(srt_data->srt_array, srt_stat_table*, i);
1631
1632
    /* XXX: It would be nice if srt_table handled hashing so that the
1633
     * real procedure number could be displayed in the table without
1634
     * having to add empty rows for unused message types and responses
1635
     * (requests and responses have different message types, and we
1636
     * only use the request value.)
1637
     */
1638
0
    idx = GPOINTER_TO_UINT(g_hash_table_lookup(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype)));
1639
1640
    /* Store the row value incremented by 1 to distinguish 0 from NULL */
1641
0
    if (idx == 0) {
1642
0
        idx = g_hash_table_size(gtpv2_stat_msg_idx_hash);
1643
0
        g_hash_table_insert(gtpv2_stat_msg_idx_hash, GUINT_TO_POINTER(gcrp->msgtype), GUINT_TO_POINTER(idx + 1));
1644
0
        init_srt_table_row(gtpv2_srt_table, idx, val_to_str_ext_const(gcrp->msgtype, &gtpv2_message_type_vals_ext, "Unknown"));
1645
0
    } else {
1646
0
        idx -= 1;
1647
0
    }
1648
1649
0
    add_srt_table_data(gtpv2_srt_table, idx, &gcrp->req_time, pinfo);
1650
1651
0
    return TAP_PACKET_REDRAW;
1652
0
}
1653
1654
/* Make this a common function ???*/
1655
static void
1656
value_in_tenth_of_percent_fmt(char* s, uint32_t v)
1657
0
{
1658
0
    snprintf(s, ITEM_LABEL_LENGTH, "%.1f%% (%u)", (float)v / 10, v);
1659
0
}
1660
1661
/* Add Info element on IE types with multiple instances in same group */
1662
typedef struct _gtpv2_information_element_instance {
1663
    uint8_t      message_type;  /* Message type */
1664
    uint8_t      parent_ie;     /* Parent group IE for which our IE is in. 0 if on message level */
1665
    uint8_t      type;          /* This IE type */
1666
    uint8_t      instance;      /* Which Instance */
1667
    const char *info_element;  /* Information element for the IE type */
1668
} gtpv2_information_element_instance_t;
1669
1670
/* IE types which defines with multiple instances in ch7.2 Tunnel Management Messages and ch7.3 Mobility Management Messages */
1671
static const gtpv2_information_element_instance_t gtpv2_information_element_instance_vals[] = {
1672
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_F_TEID, 0, "Sender F-TEID for Control Plane" },
1673
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_F_TEID, 1, "PGW S5/S8 Address for Control Plane or PMIP" },
1674
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Created" },
1675
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1676
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1677
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1678
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1679
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1680
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 0, "MME/S4-SGSN LDN" },
1681
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 1, "SGW LDN" },
1682
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 2, "ePDG LDN" },
1683
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_LDN, 3, "TWAN LDN" },
1684
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 0, "UE Local IP Address" },
1685
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 1, "H(e)NB Local IP Address" },
1686
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 2, "MME/S4-SGSN Identifier" },
1687
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IP_ADDRESS, 3, "ePDG IP Address" },
1688
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1689
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 1, "H(e)NB Local UDP Port" },
1690
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 2, "UE TCP Port" },
1691
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1692
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1693
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1694
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1695
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1696
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_ID_TS, 0, "WLAN Location Timestamp" },
1697
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_ULI, 0, "User Location Info" },
1698
    {  GTPV2_CREATE_SESSION_REQUEST, 0, GTPV2_IE_ULI, 1, "User Location Info for SGW" },
1699
1700
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_F_TEID, 0, "Sender F-TEID for Control Plane" },
1701
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_F_TEID, 1, "PGW S5/S8 Address for Control Plane or PMIP" },
1702
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Created" },
1703
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1704
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1705
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1706
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LDN, 0, "SGW LDN" },
1707
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LDN, 1, "PGW LDN" },
1708
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1709
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1710
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1711
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1712
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1713
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQDN, 0, "Charging Gateway Name" },
1714
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQDN, 1, "PGW Node Name" },
1715
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IE_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1716
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IP_ADDRESS, 0, "Charging Gateway Address" },
1717
    {  GTPV2_CREATE_SESSION_RESPONSE, 0, GTPV2_IP_ADDRESS, 1, "Alternative PGW-C/SMF Address" },
1718
    {  GTPV2_CREATE_SESSION_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1719
    {  GTPV2_CREATE_SESSION_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1720
    {  GTPV2_CREATE_SESSION_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1721
1722
    {  GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1723
    {  GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1724
    {  GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1725
    {  GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1726
    {  GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1727
    {  GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1728
    {  GTPV2_CREATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1729
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1730
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1731
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1732
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1733
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 2, "PGW Control Plane IP Address" },
1734
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 3, "New SGW-C Address" },
1735
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 0, "Group Id" },
1736
    {  GTPV2_CREATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 1, "New Group Id" },
1737
1738
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1739
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1740
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1741
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1742
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1743
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1744
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1745
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1746
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1747
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1748
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1749
    {  GTPV2_CREATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1750
1751
    {  GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1752
    {  GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_EBI, 1, "EPS Bearer ID" },
1753
    {  GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1754
    {  GTPV2_BEARER_RESOURCE_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1755
1756
    {  GTPV2_BEARER_RESOURCE_FAILURE_INDICATION, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1757
    {  GTPV2_BEARER_RESOURCE_FAILURE_INDICATION, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1758
1759
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1760
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1761
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1762
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1763
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IP_ADDRESS, 0, "H(e)NB Local IP Address" },
1764
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IP_ADDRESS, 1, "UE Local IP Address" },
1765
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IP_ADDRESS, 2, "MME/S4-SGSN Identifier" },
1766
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_PORT_NR, 0, "H(e)NB Local UDP Port" },
1767
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_PORT_NR, 1, "UE UDP Port" },
1768
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1769
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1770
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "ePDG Overload Control Info" },
1771
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_ULI, 0, "User Location Info" },                    /* redundant */
1772
    {  GTPV2_MODIFY_BEARER_REQUEST, 0, GTPV2_IE_ULI, 1, "User Location Info for SGW" },            /* redundant ? */
1773
1774
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1775
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1776
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1777
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1778
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LDN, 0, "SGW LDN" },
1779
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LDN, 1, "PGW LDN" },
1780
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1781
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1782
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1783
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1784
    {  GTPV2_MODIFY_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1785
    {  GTPV2_MODIFY_BEARER_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1786
    {  GTPV2_MODIFY_BEARER_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1787
    {  GTPV2_MODIFY_BEARER_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1788
1789
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1790
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1791
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1792
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1793
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1794
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1795
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1796
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1797
    {  GTPV2_DELETE_SESSION_REQUEST, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1798
1799
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1800
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_EBI, 1, "EPS Bearer ID" },
1801
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1802
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1803
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1804
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1805
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1806
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1807
    {  GTPV2_DELETE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1808
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1809
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1810
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1811
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1812
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 2, "PGW Control Plane IP Address" },
1813
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 3, "New SGW-C Address" },
1814
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 0, "Group Id" },
1815
    {  GTPV2_DELETE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 1, "New Group Id" },
1816
1817
    {  GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1818
    {  GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1819
    {  GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1820
    {  GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1821
    {  GTPV2_DELETE_SESSION_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1822
1823
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_EBI, 0, "Linked EPS Bearer ID (LBI)" },
1824
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1825
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1826
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1827
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1828
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1829
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1830
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1831
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1832
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1833
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1834
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1835
    {  GTPV2_DELETE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1836
1837
    {  GTPV2_MODIFY_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1838
    {  GTPV2_MODIFY_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1839
    {  GTPV2_MODIFY_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1840
1841
    {  GTPV2_MODIFY_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1842
    {  GTPV2_MODIFY_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "SGW node level Load Control Info" },
1843
1844
    {  GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 0, "PGW-FQ-CSID" },
1845
    {  GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1846
    {  GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1847
    {  GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "PGW APN level Load Control Info" },
1848
    {  GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_LOAD_CONTROL_INF, 2, "SGW node level Load Control Info" },
1849
    {  GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "PGW Overload Control Info" },
1850
    {  GTPV2_UPDATE_BEARER_REQUEST, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1851
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1852
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1853
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1854
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1855
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 2, "PGW Control Plane IP Address" },
1856
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 3, "New SGW-C Address" },
1857
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 0, "Group Id" },
1858
    {  GTPV2_UPDATE_BEARER_REQUEST, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_GROUP_ID, 1, "New Group Id" },
1859
1860
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 0, "MME-FQ-CSID" },
1861
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 1, "SGW-FQ-CSID" },
1862
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 2, "ePDG-FQ-CSID" },
1863
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_FQ_CSID, 3, "TWAN-FQ-CSID" },
1864
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1865
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1866
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 2, "TWAN/ePDG Overload Control Info" },
1867
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 0, "TWAN Identifier" },
1868
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_IDENTIFIER, 1, "WLAN Location Info" },
1869
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_TWAN_ID_TS, 1, "WLAN Location Timestamp" },
1870
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 0, "UE UDP Port" },
1871
    {  GTPV2_UPDATE_BEARER_RESPONSE, 0, GTPV2_IE_PORT_NR, 1, "UE TCP Por" },
1872
1873
    {  GTPV2_DELETE_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 0, "MME/S4-SGSN Overload Control Info" },
1874
    {  GTPV2_DELETE_BEARER_COMMAND, 0, GTPV2_IE_OVERLOAD_CONTROL_INF, 1, "SGW Overload Control Info" },
1875
1876
    {  GTPV2_DELETE_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 0, "PGW node level Load Control Info" },
1877
    {  GTPV2_DELETE_BEARER_FAILURE_INDICATION, 0, GTPV2_IE_LOAD_CONTROL_INF, 1, "SGW node level Load Control Info" },
1878
1879
    {  GTPV2_MODIFY_ACESSS_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1880
    {  GTPV2_MODIFY_ACESSS_BEARER_REQUEST, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1881
1882
    {  GTPV2_MODIFY_ACCESS_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 0, "Bearer Contexts to be Modified" },
1883
    {  GTPV2_MODIFY_ACCESS_BEARER_RESPONSE, 0, GTPV2_IE_BEARER_CTX, 1, "Bearer Contexts to be Removed" },
1884
1885
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_F_CONTAINER, 0, "E-UTRAN Transparent Container" },
1886
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_F_CONTAINER, 1, "UTRAN Transparent Container" },
1887
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_F_CONTAINER, 2, "BSS Container" },
1888
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IP_ADDRESS, 0, "HRPD access node S101 IP Address" },
1889
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IP_ADDRESS, 1, "1xIWS S102 IP Address" },
1890
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_CAUSE, 0, "S1-AP Cause" },
1891
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_CAUSE, 1, "RANAP Cause" },
1892
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_CAUSE, 2, "BSSGP Cause" },
1893
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_RFSP_INDEX, 0, "Subscribed RFSP Index" },
1894
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_RFSP_INDEX, 1, "RFSP Index in Use" },
1895
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_FQDN, 0, "SGW FQDN" },
1896
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_FQDN, 1, "SGSN FQDN" },
1897
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_FQDN, 2, "MME FQDN" },
1898
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 0, "Subscribed Additional RRM Policy Index" },
1899
    {  GTPV2_FORWARD_RELOCATION_REQ, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 1, "Additional RRM Policy Index in Use" },
1900
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 0, "PGW FQDN" },
1901
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 1, "Local Home Network ID" },
1902
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_SERVICES_AUTHORIZED, 0, "LTE V2X Service Authorized" },
1903
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_SERVICES_AUTHORIZED, 1, "NR V2X Service Authorized" },
1904
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_BIT_RATE, 0, "LTE UE Sidelink Aggregate Maximum Bit Rate" },
1905
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_V2X_CONTEXT, GTPV2_IE_BIT_RATE, 1, "NR UE Sidelink Aggregate Maximum Bit Rate" },
1906
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1907
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1908
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1909
    {  GTPV2_FORWARD_RELOCATION_REQ, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 1, "New PGW-C/SMF Address" },
1910
1911
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 0, "List of Set-up Bearers" },
1912
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 1, "List of Set-up RABs" },
1913
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 2, "List of Set-up PFCs" },
1914
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_BEARER_CTX, 2, "List of Set-up Bearers for SCEF PDN Connections" },
1915
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_CAUSE, 0, "S1-AP Cause" },
1916
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_CAUSE, 1, "RANAP Cause" },
1917
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_CAUSE, 2, "BSSGP Cause" },
1918
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_F_CONTAINER, 0, "E-UTRAN Transparent Container" },
1919
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_F_CONTAINER, 1, "UTRAN Transparent Container" },
1920
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_F_CONTAINER, 2, "BSS Container" },
1921
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_FQDN, 0, "SGSN Node Name" },
1922
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_FQDN, 1, "MME Node Name" },
1923
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 0, "SGSN Identifier" },
1924
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 1, "MME Identifier" },
1925
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 2, "SGSN Identifier for MT-SMS" },
1926
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_IDENTIFIER, 3, "MME Identifier for MT-SMS" },
1927
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_NUMBER, 0, "SGSN Number" },
1928
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_NUMBER, 1, "MME Number for MT-SMS" },
1929
    {  GTPV2_FORWARD_RELOCATION_RESP, 0, GTPV2_IE_NODE_NUMBER, 2, "MSC Number" },
1930
1931
    {  GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE, 0, GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT, 0, "Secondary RAT Usage Data Report" },
1932
    {  GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE, 0, GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT, 1, "Secondary RAT Usage Data Report from NG-RAN" },
1933
1934
    {  GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_FQDN, 0, "SGSN Node Name" },
1935
    {  GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_FQDN, 1, "MME Node Name" },
1936
    {  GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_NODE_IDENTIFIER, 0, "SGSN Identifier" },
1937
    {  GTPV2_CONTEXT_REQUEST, 0, GTPV2_IE_NODE_IDENTIFIER, 1, "MME Identifier" },
1938
1939
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IP_ADDRESS, 0, "HRPD access node S101 IP Address" },
1940
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IP_ADDRESS, 1, "1xIWS S102 IP Address" },
1941
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_RFSP_INDEX, 0, "Subscribed RFSP Index" },
1942
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_RFSP_INDEX, 1, "RFSP Index in Use" },
1943
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_FQDN, 0, "SGW Node Name" },
1944
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_FQDN, 1, "SGSN Node Name" },
1945
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_FQDN, 2, "MME Node Name" },
1946
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_INTEGER_NUMBER, 0, "UE Usage Type" },
1947
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_INTEGER_NUMBER, 1, "Remaining Running Service Gap Timer" },
1948
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 0, "Subscribed Additional RRM Policy Index" },
1949
    {  GTPV2_CONTEXT_RESPONSE, 0, GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, 1, "Additional RRM Policy Index in Use" },
1950
    {  GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 0, "PGW FQDN" },
1951
    {  GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PDN_CONNECTION, GTPV2_IE_FQDN, 1, "Local Home Network ID" },
1952
    {  GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 0, "PGW Set FQDN" },
1953
    {  GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IE_PGW_FQDN, 1, "Alternative PGW-C/SMF FQDN" },
1954
    {  GTPV2_CONTEXT_RESPONSE, GTPV2_IE_PGW_CHANGE_INFO, GTPV2_IP_ADDRESS, 0, "Alternative PGW-C/SMF Address" },
1955
1956
    {  GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_NUMBER, 0, "SGSN Number" },
1957
    {  GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_NUMBER, 1, "MME Number for MT-SMS" },
1958
    {  GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_IDENTIFIER, 0, "SGSN Identifier for MT-SMS" },
1959
    {  GTPV2_CONTEXT_ACKNOWLEDGE, 0, GTPV2_IE_NODE_IDENTIFIER, 1, "MME Identifier for MT-SMS" },
1960
1961
    {  GTPV2_CONFIGURATION_TRANSFER_TUNNEL, 0, GTPV2_IE_TARGET_ID, 0, "Target eNodeB ID / en-gNB ID / gnB ID" },
1962
    {  GTPV2_CONFIGURATION_TRANSFER_TUNNEL, 0, GTPV2_IE_TARGET_ID, 1, "Connected Target eNodeB ID" },
1963
1964
    {  0, 0, 0, 0, NULL },
1965
};
1966
1967
1.04M
#define NUM_GTPV2_IE_INFO_ELEM_INSTANCES array_length(gtpv2_information_element_instance_vals)
1968
1969
/* Code to dissect IE's */
1970
1971
static void
1972
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_)
1973
286
{
1974
286
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
1975
286
}
1976
1977
/*
1978
 * 8.3 International Mobile Subscriber Identity (IMSI)
1979
 *
1980
 * IMSI is defined in 3GPP TS 23.003
1981
 * Editor's note: IMSI coding will be defined in 3GPP TS 24.301
1982
 * Editor's note: In the first release of GTPv2 spec (TS 29.274v8.0.0) n = 8.
1983
 * That is, the overall length of the IE is 11 octets.
1984
 */
1985
1986
static void
1987
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)
1988
38
{
1989
38
    int          offset = 0;
1990
38
    const char *imsi_str;
1991
1992
    /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
1993
     * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the wmem
1994
     * allocated string will be returned.
1995
     */
1996
38
    imsi_str =  dissect_e212_imsi(tvb, pinfo, tree,  offset, length, false);
1997
38
    proto_item_append_text(item, "%s", imsi_str);
1998
1999
38
    if (g_gtp_session) {
2000
0
        args->imsi = imsi_str;
2001
0
    }
2002
38
}
2003
2004
/*
2005
 * 8.4 Cause
2006
 */
2007
2008
/* Table 8.4-1: Cause values */
2009
static const value_string gtpv2_cause_vals[] = {
2010
    {0, "Reserved"},
2011
    /* Request / Initial message */
2012
    {  1, "Reserved"},
2013
    {  2, "Local Detach"},
2014
    {  3, "Complete Detach"},
2015
    {  4, "RAT changed from 3GPP to Non-3GPP"},
2016
    {  5, "ISR deactivation"},
2017
    {  6, "Error Indication received from RNC/eNodeB/S4-SGSN"},
2018
    {  7, "IMSI Detach Only"},
2019
    {  8, "Reactivation Requested"},
2020
    {  9, "PDN reconnection to this APN disallowed"},
2021
    { 10, "Access changed from Non-3GPP to 3GPP"},
2022
    { 11, "PDN connection inactivity timer expires"},
2023
    { 12, "PGW not responding"},
2024
    { 13, "Network Failure"},
2025
    { 14, "QoS parameter mismatch"},
2026
    { 15, "EPS to 5GS Mobility"},
2027
    /* Acceptance in a Response / triggered message */
2028
    { 16, "Request accepted"},
2029
    { 17, "Request accepted partially"},
2030
    { 18, "New PDN type due to network preference"},
2031
    { 19, "New PDN type due to single address bearer only"},
2032
    /* 20-63 Spare. This value range shall be used by Cause values in an acceptance response/triggered message */
2033
    { 20, "Spare"},
2034
    { 21, "Spare"},
2035
    { 22, "Spare"},
2036
    { 23, "Spare"},
2037
    { 24, "Spare"},
2038
    { 25, "Spare"},
2039
    { 26, "Spare"},
2040
    { 27, "Spare"},
2041
    { 28, "Spare"},
2042
    { 29, "Spare"},
2043
    { 30, "Spare"},
2044
    { 31, "Spare"},
2045
    { 32, "Spare"},
2046
    { 33, "Spare"},
2047
    { 34, "Spare"},
2048
    { 35, "Spare"},
2049
    { 36, "Spare"},
2050
    { 37, "Spare"},
2051
    { 38, "Spare"},
2052
    { 39, "Spare"},
2053
    { 40, "Spare"},
2054
    { 41, "Spare"},
2055
    { 42, "Spare"},
2056
    { 43, "Spare"},
2057
    { 44, "Spare"},
2058
    { 45, "Spare"},
2059
    { 46, "Spare"},
2060
    { 47, "Spare"},
2061
    { 48, "Spare"},
2062
    { 49, "Spare"},
2063
    { 50, "Spare"},
2064
    { 51, "Spare"},
2065
    { 52, "Spare"},
2066
    { 53, "Spare"},
2067
    { 54, "Spare"},
2068
    { 55, "Spare"},
2069
    { 56, "Spare"},
2070
    { 57, "Spare"},
2071
    { 58, "Spare"},
2072
    { 59, "Spare"},
2073
    { 60, "Spare"},
2074
    { 61, "Spare"},
2075
    { 62, "Spare"},
2076
    { 63, "Spare"},
2077
    /* Rejection in a Response / triggered message */
2078
    { 64, "Context Not Found"},
2079
    { 65, "Invalid Message Format"},
2080
    { 66, "Version not supported by next peer"},
2081
    { 67, "Invalid length"},
2082
    { 68, "Service not supported"},
2083
    { 69, "Mandatory IE incorrect"},
2084
    { 70, "Mandatory IE missing"},
2085
    { 71, "Shall not be used"},
2086
    { 72, "System failure"},
2087
    { 73, "No resources available"},
2088
    { 74, "Semantic error in the TFT operation"},
2089
    { 75, "Syntactic error in the TFT operation"},
2090
    { 76, "Semantic errors in packet filter(s)"},
2091
    { 77, "Syntactic errors in packet filter(s)"},
2092
    { 78, "Missing or unknown APN"},
2093
    { 79, "Shall not be used"},
2094
    { 80, "GRE key not found"},
2095
    { 81, "Relocation failure"},
2096
    { 82, "Denied in RAT"},
2097
    { 83, "Preferred PDN type not supported"},
2098
    { 84, "All dynamic addresses are occupied"},
2099
    { 85, "UE context without TFT already activated"},
2100
    { 86, "Protocol type not supported"},
2101
    { 87, "UE not responding"},
2102
    { 88, "UE refuses"},
2103
    { 89, "Service denied"},
2104
    { 90, "Unable to page UE"},
2105
    { 91, "No memory available"},
2106
    { 92, "User authentication failed"},
2107
    { 93, "APN access denied - no subscription"},
2108
    { 94, "Request rejected(reason not specified)"},
2109
    { 95, "P-TMSI Signature mismatch"},
2110
    { 96, "IMSI/IMEI not known"},
2111
    { 97, "Semantic error in the TAD operation"},
2112
    { 98, "Syntactic error in the TAD operation"},
2113
    { 99, "Shall not be used"},
2114
    {100, "Remote peer not responding"},
2115
    {101, "Collision with network initiated request"},
2116
    {102, "Unable to page UE due to Suspension"},
2117
    {103, "Conditional IE missing"},
2118
    {104, "APN Restriction type Incompatible with currently active PDN connection"},
2119
    {105, "Invalid overall length of the triggered response message and a piggybacked initial message"},
2120
    {106, "Data forwarding not supported"},
2121
    {107, "Invalid reply from remote peer"},
2122
    {108, "Fallback to GTPv1"},
2123
    {109, "Invalid peer"},
2124
    {110, "Temporarily rejected due to handover/TAU/RAU procedure in progress"},
2125
    {111, "Modifications not limited to S1-U bearers"},
2126
    {112, "Request rejected for a PMIPv6 reason "},
2127
    {113, "APN Congestion"},
2128
    {114, "Bearer handling not supported"},
2129
    {115, "UE already re-attached"},
2130
    {116, "Multiple PDN connections for a given APN not allowed"},
2131
    {117, "Target access restricted for the subscriber"},
2132
    {118, "Shall not be used. See NOTE 2 and NOTE 3."},
2133
    {119, "MME/SGSN refuses due to VPLMN Policy"},
2134
    {120, "GTP-C Entity Congestion"},
2135
    {121, "Late Overlapping Request"},
2136
    {122, "Timed out Request"},
2137
    {123, "UE is temporarily not reachable due to power saving"},
2138
    {124, "Relocation failure due to NAS message redirection"},
2139
    {125, "UE not authorised by OCS or external AAA Server"},
2140
    {126, "Multiple accesses to a PDN connection not allowed"},
2141
    {127, "Request rejected due to UE capability"},
2142
    {128, "S1-U Path Failure" },
2143
    {129, "5GC not allowed" },
2144
    {130, "PGW mismatch with network slice subscribed by the UE" },
2145
    {131, "Rejection due to paging restriction" },
2146
2147
    /* 132-239 Spare. For future use in a triggered/response message  */
2148
    /* 240-255 Spare. For future use in an initial/request message */
2149
    {0, NULL}
2150
};
2151
value_string_ext gtpv2_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_vals);
2152
2153
/* Table 8.4-1: CS (Cause Source) */
2154
static const true_false_string gtpv2_cause_cs = {
2155
    "Originated by remote node",
2156
    "Originated by node sending the message",
2157
};
2158
2159
static void
2160
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)
2161
28
{
2162
28
    int    offset = 0;
2163
28
    uint8_t tmp;
2164
2165
    /* Cause value octet 5 */
2166
28
    tmp = tvb_get_uint8(tvb, offset);
2167
28
    if (g_gtp_session) {
2168
0
        args->last_cause = tmp;
2169
0
    }
2170
28
    proto_tree_add_item(tree, hf_gtpv2_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
2171
2172
    /* Add Cause to ie_tree */
2173
28
    proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(tmp, &gtpv2_cause_vals_ext, "Unknown"), tmp);
2174
28
    offset += 1;
2175
2176
    /* Octet 6 Spare PCE BCE CS */
2177
28
    static int* const oct6_flags[] = {
2178
28
        &hf_gtpv2_spare_b7_b3,
2179
28
        &hf_gtpv2_cause_pce,
2180
28
        &hf_gtpv2_cause_bce,
2181
28
        &hf_gtpv2_cause_cs,
2182
28
        NULL
2183
28
    };
2184
2185
28
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct6_flags, ENC_NA);
2186
28
    offset += 1;
2187
2188
    /* If n = 2, a = 0 and the Cause IE shall be 6 octets long.
2189
     * Therefore, octets "a(n+1) to a(n+4)" will not be present.
2190
     * If n = 6, a = 1 and the Cause IE will be 10 octets long.
2191
     */
2192
28
    if ( length == 2 ) {
2193
2
        return;
2194
2
    }
2195
    /*
2196
     * If the rejection is due to a mandatory IE or a verifiable conditional IE is faulty
2197
     * or missing, the offending IE shall be included within an additional field "a(n+1)
2198
     * to a(n+4)". Only Type and Instance fields of the offending IE that caused the
2199
     * rejection have a meaning. The length in the Octet 8-9 and spare bits in the Octet 10
2200
     * shall be set to "0". In this case, the value of "n" shall be "6".
2201
     * Otherwise, the value of "n" is equal to "2".
2202
     */
2203
2204
    /* Type of the offending IE */
2205
26
    proto_tree_add_item(tree, hf_gtpv2_cause_off_ie_t, tvb, offset, 1, ENC_BIG_ENDIAN);
2206
26
    offset += 1;
2207
2208
    /* Length */
2209
26
    proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
2210
26
    offset += 2;
2211
    /* a(n+4) Spare Instance */
2212
26
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_half_octet, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
2213
26
    proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
2214
2215
26
}
2216
2217
/*
2218
 * 8.5 Recovery (Restart Counter)
2219
 */
2220
static void
2221
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_)
2222
16
{
2223
16
    int    offset = 0;
2224
16
    uint8_t recovery;
2225
2226
16
    recovery = tvb_get_uint8(tvb, offset);
2227
16
    proto_tree_add_item(tree, hf_gtpv2_rec, tvb, offset, 1, ENC_BIG_ENDIAN);
2228
16
    proto_item_append_text(item, "%u", recovery);
2229
2230
16
}
2231
2232
2233
/*Start SRVCC Messages*/
2234
2235
/* 6.2 STN-SR */
2236
static void
2237
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_)
2238
9
{
2239
9
    proto_item *stn_sr_item;
2240
9
    proto_tree *sub_tree;
2241
9
    tvbuff_t   *new_tvb;
2242
9
    int         offset = 0;
2243
2244
9
    stn_sr_item = proto_tree_add_item(tree, hf_gtpv2_stn_sr, tvb, offset, length, ENC_NA);
2245
9
    new_tvb = tvb_new_subset_length(tvb, offset, length);
2246
9
    sub_tree = proto_item_add_subtree(stn_sr_item, ett_gtpv2_stn_sr);
2247
2248
    /* Octet 5
2249
     * contains the Nature of Address and Numbering Plan Indicator (NANPI) of the "AddressString" ASN.1 type (see 3GPP
2250
     * 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
2251
     * 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
2252
     * filler "1111".
2253
     */
2254
9
    dissect_gsm_map_msisdn(new_tvb, pinfo, sub_tree);
2255
9
}
2256
2257
/* 6.3 Source to Target Transparent Container */
2258
2259
static void
2260
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_)
2261
7
{
2262
7
    int offset = 0;
2263
2264
7
    proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
2265
7
    offset += 1;
2266
    /*ra_type_flag = 0;*/
2267
2268
    /* Transparent Container
2269
     * When target network is GERAN, this container carries the Old BSS to New BSS
2270
     * Information IE defined in 3GPP TS 48.008 [8]. When target network is UTRAN, this container carries the Source RNC
2271
     * to Target RNC Transparent Container IE defined in 3GPP TS 25.413 [9]. The Transparent container field includes the
2272
     * IE value part as it is specified in the respective specification.
2273
     */
2274
7
    proto_tree_add_item(tree, hf_gtpv2_transparent_container, tvb, offset, length-1, ENC_NA);
2275
    /*
2276
    * bssmap_old_bss_to_new_bss_info(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo);
2277
    * dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU
2278
    */
2279
7
    if ((message_type == GTPV2_SRVCC_PS_TO_CS_REQUEST) && (pref_decode_srvcc_p2c_trans_cont == PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN)) {
2280
0
        tvbuff_t   *new_tvb;
2281
0
        proto_tree *sub_tree;
2282
2283
0
        sub_tree = proto_tree_add_subtree(tree, tvb, offset, length-1, ett_gtpv2_utran_con, NULL, "Source RNC to Target RNC Transparent Container");
2284
0
        new_tvb = tvb_new_subset_remaining(tvb, offset);
2285
0
        dissect_ranap_SourceRNC_ToTargetRNC_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
2286
0
    }
2287
2288
7
}
2289
2290
/* 6.4 Target to Source Transparent Container */
2291
static void
2292
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_)
2293
7
{
2294
7
    int offset = 0;
2295
2296
7
    proto_tree_add_item(tree, hf_gtpv2_len_trans_con, tvb, offset, 1, ENC_BIG_ENDIAN);
2297
7
    offset += 1;
2298
2299
    /* Transparent Container */
2300
7
    proto_tree_add_item(tree, hf_gtpv2_transparent_container, tvb, offset, length-1, ENC_NA);
2301
2302
    /* It's too hard to figure out the content...
2303
    6.4 Target to Source Transparent Container
2304
2305
    The Target to Source Transparent Container contains information that shall be transferred transparently by CN entities
2306
    from the target RAN to the source RAN.
2307
2308
    When the target network is GERAN, the Transparent container field contains the value part of the Layer 3 Information
2309
    IE defined in 3GPP TS 48.008 [8], i.e., octets 3 to n, excluding octet 1 (Element ID) and octet 2 (Length).
2310
2311
    When the target network is UTRAN, this container carries the Target RNC to Source RNC Transparent Container IE
2312
    defined in 3GPP TS 25.413 [9]. The Transparent container field contains a transparent copy of the corresponding
2313
    ASN.1/PER IE (see subclauses 8.2.2 and 8.48 in 3GPP TS 29.274 [3]).
2314
2315
    When the target network is E-UTRAN, the container carries the Target eNB To Source eNB Transparent Container IE
2316
    defined in 3GPP TS 36.413 [14]. The Transparent container field contains a transparent copy of the corresponding
2317
    ASN.1/PER IE (see subclauses 8.2.2 and 8.48 in 3GPP TS 29.274 [3]).
2318
2319
    The receiver of this Information Element shall ignore the length of the transparent container encoded in octet 5 and shall
2320
    derive the actual length of the container from the length encoded in octets 2 to 3 minus 1.
2321
2322
    For backward compatibility, the sender of this Information Element shall set the octet 5 to the actual length of the
2323
    transparent container if the size of the container is smaller or equal to 255 octets, and to the value "255" otherwise.
2324
2325
    */
2326
7
    if ((message_type == GTPV2_SRVCC_PS_TO_CS_RESPONSE) && (pref_decode_srvcc_p2c_trans_cont == PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN)) {
2327
0
        tvbuff_t   *new_tvb;
2328
0
        proto_tree *sub_tree;
2329
2330
0
        sub_tree = proto_tree_add_subtree(tree, tvb, offset, length-1, ett_gtpv2_utran_con, NULL, "Target RNC to Source RNC Transparent Container");
2331
0
        new_tvb = tvb_new_subset_remaining(tvb, offset);
2332
0
        dissect_ranap_TargetRNC_ToSourceRNC_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
2333
0
    }
2334
2335
7
}
2336
2337
/* 6.5 MM Context for E-UTRAN SRVCC */
2338
static void
2339
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_)
2340
51
{
2341
51
    int         offset = 0;
2342
51
    uint8_t     elm_len;
2343
51
    proto_tree *ms_tree, *fi;
2344
2345
51
    proto_tree_add_item(tree, hf_gtpv2_eksi, tvb, offset, 1, ENC_BIG_ENDIAN);
2346
51
    offset += 1;
2347
51
    proto_tree_add_item(tree, hf_gtpv2_cksrvcc, tvb, offset, 16, ENC_NA);
2348
51
    offset += 16;
2349
51
    proto_tree_add_item(tree, hf_gtpv2_iksrvcc, tvb, offset, 16, ENC_NA);
2350
51
    offset += 16;
2351
2352
  /* For each of the Mobile Station Classmark 2, Mobile Station Classmark 3 and Supported Codec List parameters, if they are not available,
2353
     then the associated length field shall be set to zero, and the particular parameter field shall not be present.
2354
     */
2355
  /* Length of Mobile Station Classmark2  */
2356
51
    elm_len = tvb_get_uint8(tvb, offset);
2357
51
    proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
2358
51
    offset += 1;
2359
51
    if (elm_len) {
2360
32
        fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
2361
32
        ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2362
32
        de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2363
32
        offset += elm_len;
2364
32
    }
2365
2366
  /* Length of Mobile Station Classmark3  */
2367
51
    elm_len = tvb_get_uint8(tvb, offset);
2368
51
    proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
2369
51
    offset += 1;
2370
51
    if (elm_len) {
2371
31
        fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
2372
31
        ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2373
31
        de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2374
31
        offset += elm_len;
2375
31
    }
2376
2377
   /*Length of Supported Codec List  */
2378
51
    elm_len = tvb_get_uint8(tvb, offset);
2379
51
    proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
2380
51
    offset += 1;
2381
51
    if (elm_len) {
2382
32
        fi = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
2383
32
        ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
2384
32
        de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2385
32
    }
2386
51
}
2387
2388
/* 6.6 MM Context for UTRAN SRVCC */
2389
static void
2390
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_)
2391
52
{
2392
52
    int         offset = 0;
2393
52
    uint8_t     elm_len;
2394
52
    proto_tree *ms_tree, *fi;
2395
2396
52
    proto_tree_add_item(tree, hf_gtpv2_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
2397
52
    offset += 1;
2398
2399
52
    proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_ck_cs, tvb, offset, 16, ENC_NA);
2400
52
    offset += 16;
2401
52
    proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_ik_cs, tvb, offset, 16, ENC_NA);
2402
52
    offset += 16;
2403
52
    proto_tree_add_item(tree, hf_gtpv2_utran_srvcc_kc, tvb, offset, 8, ENC_NA);
2404
52
    offset += 8;
2405
52
    proto_tree_add_item(tree, hf_gtpv2_cksn, tvb, offset, 1, ENC_BIG_ENDIAN);
2406
52
    offset += 1;
2407
2408
   /* For each of the Mobile Station Classmark 2, Mobile Station Classmark 3 and Supported Codec List parameters, if they are not available,
2409
      then the associated length field shall be set to zero, and the particular parameter field shall not be present.
2410
   */
2411
2412
    /*Length of Mobile Station Classmark2  */
2413
52
    elm_len = tvb_get_uint8(tvb, offset);
2414
52
    proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
2415
52
    offset += 1;
2416
52
    if (elm_len) {
2417
40
        fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
2418
40
        ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2419
40
        de_ms_cm_2(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2420
40
        offset += elm_len;
2421
40
    }
2422
2423
    /*Length of Mobile Station Classmark3  */
2424
52
    elm_len = tvb_get_uint8(tvb, offset);
2425
52
    proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
2426
52
    offset += 1;
2427
52
    if (elm_len) {
2428
40
        fi = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
2429
40
        ms_tree = proto_item_add_subtree(fi, ett_gtpv2_ms_mark);
2430
40
        de_ms_cm_3(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2431
40
        offset += elm_len;
2432
40
    }
2433
2434
    /*Length of Supported Codec List  */
2435
52
    elm_len = tvb_get_uint8(tvb, offset);
2436
52
    proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
2437
52
    offset += 1;
2438
52
    if (elm_len) {
2439
33
        fi = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
2440
33
        ms_tree = proto_item_add_subtree(fi, ett_gtpv2_supp_codec_list);
2441
33
        de_sup_codec_list(tvb, ms_tree, pinfo, offset, elm_len, NULL, 0);
2442
33
    }
2443
2444
52
}
2445
2446
/* 6.7 SRVCC Cause */
2447
static const value_string gtpv2_srvcc_cause_vals[] = {
2448
    {0, "Reserved"},
2449
    {1, "Unspecified"},
2450
    {2, "Handover/Relocation cancelled by source system "},
2451
    {3, "Handover /Relocation Failure with Target system"},
2452
    {4, "Handover/Relocation Target not allowed"},
2453
    {5, "Unknown Target ID"},
2454
    {6, "Target Cell not available"},
2455
    {7, "No Radio Resources Available in Target Cell"},
2456
    {8, "Failure in Radio Interface Procedure"},
2457
    {9, "Permanent session leg establishment error"},
2458
    {10, "Temporary session leg establishment error"},
2459
2460
    {0, NULL}
2461
};
2462
static value_string_ext gtpv2_srvcc_cause_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_srvcc_cause_vals);
2463
2464
static void
2465
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_)
2466
7
{
2467
7
    int    offset = 0;
2468
7
    uint8_t srvcc_cause;
2469
2470
7
    srvcc_cause = tvb_get_uint8(tvb, offset);
2471
7
    proto_tree_add_item(tree, hf_gtpv2_srvcc_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
2472
7
    proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(srvcc_cause, &gtpv2_srvcc_cause_vals_ext, "Unknown"), srvcc_cause);
2473
2474
7
}
2475
2476
/*
2477
 * 3GPP TS 29.280 version 10.3.0
2478
 * 6.8 Target RNC ID
2479
 */
2480
static void
2481
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_)
2482
4
{
2483
4
    int         offset = 0;
2484
4
    uint16_t    rnc_id;
2485
4
    proto_tree *subtree;
2486
4
    uint32_t    mcc;
2487
4
    uint32_t    mnc;
2488
4
    uint32_t    lac;
2489
4
    uint32_t    curr_offset;
2490
2491
    /*ra_type_flag = 1;*/ /*Flag to be set to differentiate GERAN and UTRAN*/
2492
4
    curr_offset = offset;
2493
2494
4
    mcc  = (tvb_get_uint8(tvb, curr_offset)   & 0x0f) << 8;
2495
4
    mcc |= (tvb_get_uint8(tvb, curr_offset)   & 0xf0);
2496
4
    mcc |= (tvb_get_uint8(tvb, curr_offset+1) & 0x0f);
2497
4
    mnc  = (tvb_get_uint8(tvb, curr_offset+2) & 0x0f) << 8;
2498
4
    mnc |= (tvb_get_uint8(tvb, curr_offset+2) & 0xf0);
2499
4
    mnc |= (tvb_get_uint8(tvb, curr_offset+1) & 0xf0) >> 4;
2500
4
    if ((mnc & 0x000f) == 0x000f)
2501
0
        mnc = mnc >> 4;
2502
2503
4
    lac = tvb_get_ntohs(tvb, curr_offset + 3);
2504
4
    rnc_id = tvb_get_ntohs(tvb,  curr_offset + 5);
2505
2506
4
    subtree = proto_tree_add_subtree_format(tree,
2507
4
                                   tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
2508
4
                                   "Routing area identification: %x-%x-%u-%u",
2509
4
                                   mcc, mnc, lac, rnc_id);
2510
2511
4
    dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, E212_RAI, true);
2512
4
    curr_offset+=3;
2513
2514
4
    proto_tree_add_item(subtree, hf_gtpv2_lac,    tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2515
4
    curr_offset+=2;
2516
4
    proto_tree_add_item(subtree, hf_gtpv2_rnc_id, tvb, curr_offset, 2, ENC_BIG_ENDIAN);
2517
    /*curr_offset+=2;*/
2518
2519
    /* no length check possible */
2520
2521
2522
4
}
2523
2524
/*
2525
 * 3GPP TS 29.280
2526
 * 6.9 Target Global Cell ID
2527
 * The encoding of this IE is defined in 3GPP TS 29.002
2528
 *  GlobalCellId ::= OCTET STRING (SIZE (5..7))
2529
 *      -- Refers to Cell Global Identification defined in TS 3GPP TS 23.003 [17].
2530
 *      -- The internal structure is defined as follows:
2531
 *      -- octet 1 bits 4321    Mobile Country Code 1st digit
2532
 *      --         bits 8765    Mobile Country Code 2nd digit
2533
 *      -- octet 2 bits 4321    Mobile Country Code 3rd digit
2534
 *      --         bits 8765    Mobile Network Code 3rd digit
2535
 *      --                      or filler (1111) for 2 digit MNCs
2536
 *      -- octet 3 bits 4321    Mobile Network Code 1st digit
2537
 *      --         bits 8765    Mobile Network Code 2nd digit
2538
 *      -- octets 4 and 5       Location Area Code according to TS 3GPP TS 24.008 [35]
2539
 *      -- octets 6 and 7       Cell Identity (CI) according to TS 3GPP TS 24.008 [35]
2540
 */
2541
static void
2542
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_)
2543
2
{
2544
2
    int         offset = 0;
2545
2
    uint8_t     tgt_cell_id;
2546
2
    proto_tree *subtree;
2547
2
    uint32_t    mcc;
2548
2
    uint32_t    mnc;
2549
2
    uint32_t    lac;
2550
2
    uint32_t    curr_offset;
2551
2552
2
    curr_offset = offset;
2553
2554
2
    mcc  = (tvb_get_uint8(tvb, curr_offset)   & 0x0f) << 8;
2555
2
    mcc |= (tvb_get_uint8(tvb, curr_offset)   & 0xf0);
2556
2
    mcc |= (tvb_get_uint8(tvb, curr_offset+1) & 0x0f);
2557
2
    mnc  = (tvb_get_uint8(tvb, curr_offset+2) & 0x0f) << 8;
2558
2
    mnc |= (tvb_get_uint8(tvb, curr_offset+2) & 0xf0);
2559
2
    mnc |= (tvb_get_uint8(tvb, curr_offset+1) & 0xf0) >> 4;
2560
2
    if ((mnc & 0x000f) == 0x000f)
2561
0
        mnc = mnc >> 4;
2562
2563
2
    lac = tvb_get_ntohs(tvb, curr_offset + 3);
2564
2
    tgt_cell_id = tvb_get_uint8(tvb,  curr_offset + 5);
2565
2566
2
    subtree = proto_tree_add_subtree_format(tree,
2567
2
                                   tvb, curr_offset, 6, ett_gtpv2_rai, NULL,
2568
2
                                   "Routing area identification: %x-%x-%u-%u",
2569
2
                                   mcc, mnc, lac, tgt_cell_id);
2570
2571
2
    dissect_e212_mcc_mnc(tvb, pinfo, subtree, offset, E212_RAI, true);
2572
2573
2
    proto_tree_add_item(subtree, hf_gtpv2_lac,           tvb, curr_offset + 3, 2, ENC_BIG_ENDIAN);
2574
2
    proto_tree_add_item(subtree, hf_gtpv2_tgt_g_cell_id, tvb, curr_offset + 5, 2, ENC_BIG_ENDIAN);
2575
2576
2
    proto_item_append_text(item, "%x-%x-%u-%u", mcc, mnc, lac, tgt_cell_id);
2577
    /* no length check possible */
2578
2579
2
}
2580
2581
/* 6.10 Tunnel Endpoint Identifier for Control Plane (TEID-C) */
2582
static void
2583
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_)
2584
12
{
2585
12
    int offset = 0;
2586
2587
12
    proto_tree_add_item(tree, hf_gtpv2_teid_c, tvb, offset, 4, ENC_BIG_ENDIAN);
2588
12
    offset += 4;
2589
12
    if (length > 4)
2590
7
        proto_tree_add_item(tree, hf_gtpv2_teid_c_spare, tvb, offset, length-4, ENC_NA);
2591
2592
12
    proto_item_append_text(item, "%u", tvb_get_ntohl(tvb, offset-4));
2593
12
}
2594
2595
/* 6.11 Sv Flags */
2596
static void
2597
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_)
2598
5
{
2599
5
    int offset = 0;
2600
5
    static int* const sv_flags[] = {
2601
5
        &hf_gtpv2_sv_sti,
2602
5
        &hf_gtpv2_sv_ics,
2603
5
        &hf_gtpv2_sv_emind,
2604
5
        NULL
2605
5
    };
2606
2607
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, sv_flags, ENC_NA);
2608
5
    offset += 1;
2609
5
    if (length > 1)
2610
4
        proto_tree_add_item(tree, hf_gtpv2_teid_c_spare, tvb, offset, length-1, ENC_NA);
2611
5
}
2612
2613
/* 6.12 Service Area Identifier */
2614
2615
static void
2616
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_)
2617
4
{
2618
4
    int offset = 0;
2619
2620
    /* 5 MCC digit 2 MCC digit 1
2621
     * 6 MNC digit 3 MCC digit 3
2622
     * 7 MNC digit 2 MNC digit 1
2623
     */
2624
4
    dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_SAI, true);
2625
4
    offset += 3;
2626
2627
    /* 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
2628
     * least significant bit. The coding of the location area code is the responsibility of each administration. Coding using full
2629
     * hexadecimal representation shall be used.
2630
     */
2631
4
    proto_tree_add_item(tree, hf_gtpv2_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
2632
4
    offset += 2;
2633
2634
    /* 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
2635
     * least significant bit. The SAC is defined by the operator. See 3GPP TS 23.003 [4] subclause 12.5 for more information
2636
     */
2637
4
    proto_tree_add_item(tree, hf_gtpv2_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
2638
4
}
2639
2640
/* 6.13 MM Context for CS to PS SRVCC */
2641
static void
2642
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_)
2643
2
{
2644
2
    int offset = 0;
2645
2646
    /* Octet 5 KSI"PS */
2647
2
    proto_tree_add_item(tree, hf_gtpv2_ksi_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
2648
2
    offset++;
2649
2650
    /* octet 6 - 21 CK'PS */
2651
2
    proto_tree_add_item(tree, hf_gtpv2_ck_ps, tvb, offset, 16, ENC_NA);
2652
2
    offset+=16;
2653
2654
    /* octet 22 - 37 IK'PS */
2655
2
    proto_tree_add_item(tree, hf_gtpv2_ik_ps, tvb, offset, 16, ENC_NA);
2656
2
    offset += 16;
2657
2658
    /* octet 38 to 45 kc'PS */
2659
2
    proto_tree_add_item(tree, hf_gtpv2_kc_ps, tvb, offset, 8, ENC_NA);
2660
2
    offset += 8;
2661
2662
    /* Octet 46 CKSN"PS */
2663
2
    proto_tree_add_item(tree, hf_gtpv2_cksn_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
2664
    /*offset++;*/
2665
2666
2
}
2667
/*End SRVCC Messages*/
2668
2669
2670
/*
2671
 * 8.6 Access Point Name (APN)
2672
 * The encoding the APN field follows 3GPP TS 23.003 [2] subclause 9.1.
2673
 * The content of the APN field shall be the full APN with both the APN Network Identifier
2674
 * and APN Operator Identifier being present as specified in 3GPP TS 23.003 [2]
2675
 * 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.
2676
 */
2677
void
2678
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_)
2679
6
{
2680
6
    const uint8_t *apn    = NULL;
2681
2682
6
    proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, 0, length, ENC_APN_STR | ENC_NA, pinfo->pool, &apn);
2683
6
    if (apn) {
2684
4
        proto_item_append_text(item, "%s", apn);
2685
4
    }
2686
2687
6
}
2688
2689
/*
2690
 * 8.7 Aggregate Maximum Bit Rate (AMBR)
2691
 */
2692
2693
void
2694
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_)
2695
2
{
2696
2
    int offset = 0;
2697
2698
2
    proto_tree_add_item(tree, hf_gtpv2_ambr_up, tvb, offset, 4, ENC_BIG_ENDIAN);
2699
2
    offset += 4;
2700
2
    proto_tree_add_item(tree, hf_gtpv2_ambr_down, tvb, offset, 4, ENC_BIG_ENDIAN);
2701
2
}
2702
2703
/*
2704
 * 8.8 EPS Bearer ID (EBI)
2705
 */
2706
static void
2707
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_)
2708
4
{
2709
2710
4
    int    offset = 0;
2711
4
    uint8_t ebi;
2712
2713
    /* Spare (all bits set to 0) B8 - B5*/
2714
4
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
2715
    /* EPS Bearer ID (EBI) B4 - B1 */
2716
4
    ebi = tvb_get_uint8(tvb, offset);
2717
4
    proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
2718
4
    proto_item_append_text(item, "%u", ebi);
2719
2720
4
}
2721
/*
2722
 * 8.9 IP Address
2723
 */
2724
static void
2725
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_)
2726
5
{
2727
5
    int               offset = 0;
2728
2729
5
    if (length == 4)
2730
0
    {
2731
0
        proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv4, tvb, offset, length, ENC_BIG_ENDIAN);
2732
0
        proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
2733
0
    }
2734
5
    else if (length == 16)
2735
0
    {
2736
0
        proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv6, tvb, offset, length, ENC_NA);
2737
0
        proto_item_append_text(item, "IPv6 %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
2738
0
    }
2739
5
}
2740
/*
2741
 * 8.10 Mobile Equipment Identity (MEI)
2742
 * The ME Identity field contains either the IMEI or the IMEISV
2743
 * as defined in clause 6.2 of 3GPP TS 23.003 [2]. It is encoded
2744
 * as specified in clause 7.7.53 of 3GPP TS 29.060 [4], beginning
2745
 * with octet 4 of Figure 7.7.53.1. The IMEI(SV) digits are encoded
2746
 * using BCD coding where IMEI is 15 BCD digits and IMEISV is 16 BCD
2747
 * digits. For IMEI, bits 5 to 8 of the last octet shall be filled
2748
 * with an end mark coded as '1111'.
2749
 */
2750
2751
void
2752
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_)
2753
1
{
2754
1
    int          offset = 0;
2755
1
    char         *mei_str;
2756
2757
    /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
2758
     * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
2759
     * allocated string will be returned.
2760
     */
2761
1
    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);
2762
1
    proto_item_append_text(item, "%s", mei_str);
2763
1
}
2764
2765
/*
2766
 * 8.11 MSISDN
2767
 *
2768
 * MSISDN is defined in 3GPP TS 23.003
2769
 * Editor's note: MSISDN coding will be defined in TS 24.301.
2770
 */
2771
static void
2772
dissect_gtpv2_msisdn(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_)
2773
2
{
2774
2
    const char *digit_str;
2775
2776
    /* Octets 5 to (n+4) represent the MSISDN value is in international number format
2777
     * as described in ITU-T Rec E.164 [25] and 3GPP TS 29.002 [41].
2778
     * MSISDN value contains only the actual MSISDN number (does not contain the "nature of
2779
     * address indicator" octet, which indicates "international number"
2780
     * as in 3GPP TS 29.002 [41]) and is encoded as TBCD digits, i.e.
2781
     * digits from 0 through 9 are encoded "0000" to "1001".
2782
     * When there is an odd number of digits, bits 8 to 5 of the last octet are encoded with
2783
     * the filler "1111".
2784
     */
2785
    /* Fetch the BCD encoded digits from tvb low half byte, formating the digits according to
2786
     * a default digit set of 0-9 returning "?" for overdecadic digits a pointer to the EP
2787
     * allocated string will be returned.
2788
     */
2789
2
    digit_str = dissect_e164_msisdn(tvb, pinfo, tree, 0, length, E164_ENC_BCD);
2790
2
    proto_item_append_text(item, "%s", digit_str);
2791
2
}
2792
2793
/*
2794
 * 8.12 Indication
2795
 */
2796
void
2797
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_)
2798
5
{
2799
5
    int offset = 0;
2800
2801
5
    static int* const oct5_flags[] = {
2802
5
        &hf_gtpv2_daf,
2803
5
        &hf_gtpv2_dtf,
2804
5
        &hf_gtpv2_hi,
2805
5
        &hf_gtpv2_dfi,
2806
5
        &hf_gtpv2_oi,
2807
5
        &hf_gtpv2_isrsi,
2808
5
        &hf_gtpv2_israi,
2809
5
        &hf_gtpv2_sgwci,
2810
5
        NULL
2811
5
    };
2812
2813
    /* Octet 5 DAF DTF HI DFI OI ISRSI ISRAI SGWCI */
2814
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct5_flags, ENC_NA);
2815
5
    if (length == 1) {
2816
0
        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");
2817
0
        return;
2818
0
    }
2819
2820
5
    offset += 1;
2821
2822
5
    static int* const oct6_flags[] = {
2823
5
    &hf_gtpv2_sqci,
2824
5
    &hf_gtpv2_uimsi,
2825
5
    &hf_gtpv2_cfsi,
2826
5
    &hf_gtpv2_crsi,
2827
5
    &hf_gtpv2_ps,
2828
5
    &hf_gtpv2_pt,
2829
5
    &hf_gtpv2_si,
2830
5
    &hf_gtpv2_msv,
2831
5
    NULL
2832
5
    };
2833
2834
    /* Octet 6 SQCI UIMSI CFSI CRSI P PT SI MSV
2835
     * 3GPP TS 29.274 version 9.4.0 Release 9
2836
     */
2837
2838
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct6_flags, ENC_NA);
2839
5
    offset += 1;
2840
2841
5
    if (length == 2) {
2842
0
        return;
2843
0
    }
2844
    /* Only present in version 9 and higher */
2845
5
    static int* const oct7_flags[] = {
2846
5
        &hf_gtpv2_retloc,
2847
5
        &hf_gtpv2_pbic,
2848
5
        &hf_gtpv2_srni,
2849
5
        &hf_gtpv2_s6af,
2850
5
        &hf_gtpv2_s4af,
2851
5
        &hf_gtpv2_mbmdt,
2852
5
        &hf_gtpv2_israu,
2853
5
        &hf_gtpv2_ccrsi,
2854
5
        NULL
2855
5
    };
2856
2857
    /* Octet 7 RetLoc PBIC SRNI S6AF S4AF MBMDT ISRAU CCRSI */
2858
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct7_flags, ENC_NA);
2859
5
    offset += 1;
2860
2861
5
    if (length == 3) {
2862
0
        return;
2863
0
    }
2864
5
    static int* const oct8_flags[] = {
2865
5
        &hf_gtpv2_cprai,
2866
5
        &hf_gtpv2_arrl,
2867
5
        &hf_gtpv2_ppof,
2868
5
        &hf_gtpv2_ppon_ppei,
2869
5
        &hf_gtpv2_ppsi,
2870
5
        &hf_gtpv2_csfbi,
2871
5
        &hf_gtpv2_clii,
2872
5
        &hf_gtpv2_cpsr,
2873
5
        NULL
2874
5
    };
2875
2876
    /* Octet 8 CPRAI ARRL PPOF PPON/PPEI PPSI CSFBI CLII CPSR */
2877
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct8_flags, ENC_NA);
2878
5
    offset += 1;
2879
2880
5
    if (length == 4) {
2881
0
        return;
2882
0
    }
2883
2884
5
    static int* const oct9_flags[] = {
2885
5
        &hf_gtpv2_nsi,
2886
5
        &hf_gtpv2_uasi,
2887
5
        &hf_gtpv2_dtci,
2888
5
        &hf_gtpv2_bdwi,
2889
5
        &hf_gtpv2_psci,
2890
5
        &hf_gtpv2_pcri,
2891
5
        &hf_gtpv2_aosi,
2892
5
        &hf_gtpv2_aopi,
2893
5
        NULL
2894
5
    };
2895
2896
    /* Octet 9 NSI UASI DTCI BDWI PSCI PCRI AOSI AOPI */
2897
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct9_flags, ENC_NA);
2898
5
    offset += 1;
2899
2900
5
    if (length == 5) {
2901
0
        return;
2902
0
    }
2903
2904
5
    static int* const oct10_flags[] = {
2905
5
        &hf_gtpv2_roaai,
2906
5
        &hf_gtpv2_epcosi,
2907
5
        &hf_gtpv2_cpopci,
2908
5
        &hf_gtpv2_pmtsmi,
2909
5
        &hf_gtpv2_s11tf,
2910
5
        &hf_gtpv2_pnsi,
2911
5
        &hf_gtpv2_unaccsi,
2912
5
        &hf_gtpv2_wpmsi,
2913
5
        NULL
2914
5
    };
2915
    /* Octet 10 ROAAI EPCOSI CPOPCI PMTSMI S11TF PNSI UNACCSI WPMSI */
2916
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct10_flags, ENC_NA);
2917
5
    offset += 1;
2918
2919
5
    if (length == 6){
2920
0
        return;
2921
0
    }
2922
2923
5
    static int* const oct11_flags[] = {
2924
5
        &hf_gtpv2_5gsnn26,
2925
5
        &hf_gtpv2_reprefi,
2926
5
        &hf_gtpv2_5gsiwk,
2927
5
        &hf_gtpv2_eevrsi,
2928
5
        &hf_gtpv2_ltemui,
2929
5
        &hf_gtpv2_ltempi,
2930
5
        &hf_gtpv2_enbcrsi,
2931
5
        &hf_gtpv2_tspcmi,
2932
5
        NULL
2933
5
    };
2934
    /*Octet 11 5GSNN26 REPREFI 5GSIWK EEVRSI LTEMUI LTEMPI ENBCRSI TSPCMI */
2935
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct11_flags, ENC_NA);
2936
5
    offset += 1;
2937
2938
5
    if (length == 7){
2939
0
        return;
2940
0
    }
2941
2942
5
    static int* const oct12_flags[] = {
2943
5
        &hf_gtpv2_csrmfi,
2944
5
        &hf_gtpv2_mtedtn,
2945
5
        &hf_gtpv2_mtedta,
2946
5
        &hf_gtpv2_n5gnmi,
2947
5
        &hf_gtpv2_5gcnrs,
2948
5
        &hf_gtpv2_5gcnri,
2949
5
        &hf_gtpv2_5srhoi,
2950
5
        &hf_gtpv2_ethpdn,
2951
5
        NULL
2952
5
    };
2953
    /* Octet 12 CSRMFI MTEDTN MTEDTA N5GNMI 5GCNRS 5GCNRI 5SRHOI ETHPDN */
2954
2955
5
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct12_flags, ENC_NA);
2956
5
    offset += 1;
2957
2958
5
    if (length == 8) {
2959
1
        return;
2960
1
    }
2961
2962
4
    static int* const oct13_flags[] = {
2963
4
        &hf_gtpv2_nspusi,
2964
4
        &hf_gtpv2_pgwrnsi,
2965
4
        &hf_gtpv2_rppcsi,
2966
4
        &hf_gtpv2_pgwchi,
2967
4
        &hf_gtpv2_sissme,
2968
4
        &hf_gtpv2_nsenbi,
2969
4
        &hf_gtpv2_idfupf,
2970
4
        &hf_gtpv2_emci,
2971
4
        NULL
2972
4
    };
2973
2974
    /* Octet 13 NSOUSI PGWRNSI RPPCSI PGWCHI SISSME NSENBI IDFUPF EMCI */
2975
4
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct13_flags, ENC_NA);
2976
4
    offset += 1;
2977
2978
4
    if (length == 9) {
2979
0
        return;
2980
0
    }
2981
2982
4
    static int* const oct14_flags[] = {
2983
4
        &hf_gtpv2_spare_b7_b4,
2984
4
        &hf_gtpv2_lapcosi,
2985
4
        &hf_gtpv2_ltemsai,
2986
4
        &hf_gtpv2_srtpi,
2987
4
        &hf_gtpv2_upipsi,
2988
4
        NULL
2989
4
    };
2990
2991
    /* Octet 13 Spare LAPCOSI LTEMSAI SRTPI UPIPSI */
2992
4
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, oct14_flags, ENC_NA);
2993
4
    offset += 1;
2994
2995
4
    if (length == 10) {
2996
0
        return;
2997
0
    }
2998
2999
4
    proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
3000
3001
3002
4
}
3003
3004
/*
3005
 * 8.13 Protocol Configuration Options (PCO)
3006
 * Protocol Configuration Options (PCO) is transferred via GTP tunnels. The sending entity copies the value part of the
3007
 * 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
3008
 * as per clause 10.5.6.3 of 3GPP TS 24.008 [5], starting with octet 3.
3009
 * Dissected in packet-gsm_a_gm.c
3010
 */
3011
static void
3012
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_)
3013
16
{
3014
16
    switch (message_type) {
3015
1
    case GTPV2_CREATE_SESSION_REQUEST:
3016
1
    case GTPV2_DELETE_SESSION_REQUEST:
3017
2
    case GTPV2_BEARER_RESOURCE_COMMAND:
3018
2
    case GTPV2_CREATE_BEARER_RESPONSE:
3019
2
    case GTPV2_UPDATE_BEARER_RESPONSE:
3020
2
    case GTPV2_DELETE_BEARER_RESPONSE:
3021
        /* PCO options as MS to network direction */
3022
2
        pinfo->link_dir = P2P_DIR_UL;
3023
2
        break;
3024
0
    case GTPV2_CREATE_SESSION_RESPONSE:
3025
0
    case GTPV2_MODIFY_BEARER_RESPONSE:
3026
3
    case GTPV2_DELETE_SESSION_RESPONSE:
3027
3
    case GTPV2_CREATE_BEARER_REQUEST:
3028
3
    case GTPV2_UPDATE_BEARER_REQUEST:
3029
3
    case GTPV2_DELETE_BEARER_REQUEST:
3030
        /* PCO options as Network to MS direction: */
3031
3
        pinfo->link_dir = P2P_DIR_DL;
3032
3
        break;
3033
11
    default:
3034
11
        break;
3035
16
    }
3036
16
    de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
3037
16
}
3038
3039
/*
3040
 * 8.14 PDN Address Allocation (PAA)
3041
 */
3042
3043
static const value_string gtpv2_pdn_type_vals[] = {
3044
    {1, "IPv4"},
3045
    {2, "IPv6"},
3046
    {3, "IPv4/IPv6"},
3047
    {4, "Non-IP"},
3048
    {5, "Ethernet"},
3049
    {0, NULL}
3050
};
3051
value_string_ext gtpv2_pdn_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_pdn_type_vals);
3052
3053
void
3054
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_)
3055
2
{
3056
2
    int    offset = 0;
3057
2
    uint8_t pdn_type;
3058
3059
2
    pdn_type = tvb_get_uint8(tvb, offset);
3060
2
    proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3061
2
    offset += 1;
3062
2
    switch (pdn_type)
3063
2
    {
3064
0
    case 1:
3065
        /* IPv4 */
3066
0
        if (length != 5) {
3067
0
            proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3068
0
                                         "Wrong length indicated. Expected 5, got %u", length);
3069
0
            return;
3070
0
        }
3071
0
        proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
3072
0
        proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3073
0
        break;
3074
0
    case 2:
3075
        /* IPv6*/
3076
        /* If PDN type value indicates IPv6, octet 6 contains the IPv6 Prefix Length.
3077
         * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
3078
         * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
3079
         * and Interface Identifier and bit 1 of octet 22 the least significant bit.
3080
         */
3081
0
        if (length != 18) {
3082
0
            proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3083
0
                                         "Wrong length indicated. Expected 18, got %u", length);
3084
0
            return;
3085
0
        }
3086
0
        proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3087
0
        offset += 1;
3088
0
        proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
3089
0
        proto_item_append_text(item, "IPv6 %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
3090
0
        break;
3091
0
    case 3:
3092
        /* IPv4/IPv6 */
3093
        /* If PDN type value indicates IPv4v6, octet 6 contains the IPv6 Prefix Length.
3094
         * Octets 7 through 22 contain an IPv6 Prefix and Interface Identifier.
3095
         * Bit 8 of octet 7 represents the most significant bit of the IPv6 Prefix
3096
         * and Interface Identifier and bit 1 of octet 22 the least significant bit.
3097
         * Octets 23 through 26 contain an IPv4 address. Bit 8 of octet 23 represents
3098
         * the most significant bit of the IPv4 address and bit 1 of octet 26 the least
3099
         * significant bit.
3100
         */
3101
0
        if (length != 22) {
3102
0
            proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3103
0
                                         "Wrong length indicated. Expected 22, got %u", length);
3104
0
            return;
3105
0
        }
3106
0
        proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3107
0
        offset += 1;
3108
0
        proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, ENC_NA);
3109
0
        proto_item_append_text(item, "IPv6 %s, ", tvb_ip6_to_str(pinfo->pool, tvb, offset));
3110
0
        offset += 16;
3111
0
        proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
3112
0
        proto_item_append_text(item, "IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3113
0
        break;
3114
0
    case 4: /* Non IP */
3115
0
    case 5: /* Ethernet */
3116
        /* If PDN type value indicates Non-IP or Ethernet, octets from 6 to 'n+4'
3117
           shall not be present. */
3118
0
        if (length != 1) {
3119
0
            proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3120
0
                                         "Wrong length indicated. Expected 1, got %u", length);
3121
0
            return;
3122
0
        }
3123
2
    default:
3124
2
        break;
3125
2
    }
3126
2
}
3127
/*
3128
 * 8.15 Bearer Quality of Service (Bearer QoS)
3129
 */
3130
3131
void
3132
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_)
3133
4
{
3134
4
    int offset = 0;
3135
4
    static int* const bearer_qos_oct1_flags[] = {
3136
4
        &hf_gtpv2_bearer_qos_pci,
3137
4
        &hf_gtpv2_bearer_qos_pl,
3138
4
        &hf_gtpv2_bearer_qos_pvi,
3139
4
        NULL
3140
4
    };
3141
4
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, bearer_qos_oct1_flags, ENC_BIG_ENDIAN);
3142
4
    offset += 1;
3143
4
    proto_tree_add_item(tree, hf_gtpv2_bearer_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
3144
4
    offset += 1;
3145
4
    proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_up,    tvb, offset, 5, ENC_BIG_ENDIAN);
3146
4
    offset += 5;
3147
4
    proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_down,  tvb, offset, 5, ENC_BIG_ENDIAN);
3148
4
    offset += 5;
3149
4
    proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_up,    tvb, offset, 5, ENC_BIG_ENDIAN);
3150
4
    offset += 5;
3151
4
    proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_down,  tvb, offset, 5, ENC_BIG_ENDIAN);
3152
4
}
3153
3154
/*
3155
 * 8.16 Flow Quality of Service (Flow QoS)
3156
 */
3157
3158
static void
3159
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_)
3160
3
{
3161
3
    int offset = 0;
3162
3
    proto_tree_add_item(tree, hf_gtpv2_flow_qos_label_qci, tvb, offset, 1, ENC_BIG_ENDIAN);
3163
3
    offset += 1;
3164
3
    proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_up,    tvb, offset, 5, ENC_BIG_ENDIAN);
3165
3
    offset += 5;
3166
3
    proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_down,  tvb, offset, 5, ENC_BIG_ENDIAN);
3167
3
    offset += 5;
3168
3
    proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_up,    tvb, offset, 5, ENC_BIG_ENDIAN);
3169
3
    offset += 5;
3170
3
    proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_down,  tvb, offset, 5, ENC_BIG_ENDIAN);
3171
3
}
3172
3173
/*
3174
 * 8.17 RAT Type
3175
 */
3176
static const value_string gtpv2_rat_type_vals[] = {
3177
    {0, "Reserved"},
3178
    {1, "UTRAN"},
3179
    {2, "GERAN"},
3180
    {3, "WLAN"},
3181
    {4, "GAN"},
3182
    {5, "HSPA Evolution"},
3183
    {6, "EUTRAN"},
3184
    {7, "Virtual"},
3185
    {8, "EUTRAN-NB-IoT"},
3186
    {9, "LTE-M"},
3187
    {10, "NR"},
3188
    {11, "WB-E-UTRAN(LEO)"},
3189
    {12, "WB-E-UTRAN(MEO)"},
3190
    {13, "WB-E-UTRAN(GEO)"},
3191
    {14, "WB-E-UTRAN(OTHERSAT)"},
3192
    {15, "EUTRAN-NB-IoT(LEO)"},
3193
    {16, "EUTRAN-NB-IoT(MEO)"},
3194
    {17, "EUTRAN-NB-IoT(GEO)"},
3195
    {18, "EUTRAN-NB-IoT(OTHERSAT)"},
3196
    {19, "LTE-M(LEO)"},
3197
    {20, "LTE-M(MEO)"},
3198
    {21, "LTE-M(GEO)"},
3199
    {22, "LTE-M(OTHERSAT)"},
3200
    {0, NULL}
3201
};
3202
value_string_ext gtpv2_rat_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_rat_type_vals);
3203
3204
3205
static void
3206
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_)
3207
2
{
3208
2
    uint8_t rat_type;
3209
3210
2
    rat_type = tvb_get_uint8(tvb, 0);
3211
2
    proto_tree_add_item(tree, hf_gtpv2_rat_type, tvb, 0, 1, ENC_BIG_ENDIAN);
3212
2
    proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(rat_type, &gtpv2_rat_type_vals_ext, "Unknown"), rat_type);
3213
3214
2
}
3215
3216
/*
3217
 * 8.18 Serving Network
3218
 */
3219
static void
3220
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_)
3221
4
{
3222
4
    char *mcc_mnc_str;
3223
3224
4
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_SERV_NET, true);
3225
4
    proto_item_append_text(item, "%s", mcc_mnc_str);
3226
4
}
3227
3228
/*
3229
 * 8.19 EPS Bearer Level Traffic Flow Template (Bearer TFT)
3230
 */
3231
3232
static void
3233
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_)
3234
30
{
3235
    /* The detailed coding of Traffic Aggregate
3236
     * Description is specified in 3GPP TS 24.008 [5] ,
3237
     * clause 10.5.6.12, beginning with octet 3..
3238
     * Use the decoding in packet-gsm_a_gm.c
3239
     */
3240
30
    de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
3241
3242
30
}
3243
 /* 8.20 Traffic Aggregate Description (TAD)
3244
 */
3245
static void
3246
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_)
3247
27
{
3248
    /* The detailed coding of Traffic Aggregate
3249
     * Description is specified in 3GPP TS 24.008 [5] ,
3250
     * clause 10.5.6.12, beginning with octet 3..
3251
     * Use the decoding in packet-gsm_a_gm.c
3252
     */
3253
27
    de_sm_tflow_temp(tvb, tree, pinfo, 0, length, NULL, 0);
3254
27
}
3255
3256
/*
3257
 * 8.21 User Location Info (ULI)
3258
 *
3259
 * The flags ECGI, TAI, RAI, SAI and CGI in octed 5 indicate if the corresponding
3260
 * fields are present in the IE or not. If one of these flags is set to "0",
3261
 * the corresponding field is not present at all. The respective identities are defined in 3GPP
3262
 * TS 23.003 [2].
3263
 * Editor's Note: The definition of ECGI is missing in 3GPP TS 23.003 v8.1.0.
3264
 * It can be found in 3GPP TS 36.413 v8.3.0, but it is expected that it will be moved
3265
 * to 23.003 in a future version.
3266
 */
3267
char*
3268
dissect_gtpv2_tai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, bool is_5gs)
3269
561
{
3270
561
    char       *str = NULL;
3271
561
    char       *mcc_mnc_str;
3272
561
    uint32_t    tac;
3273
3274
561
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_TAI, true);
3275
561
    *offset += 3;
3276
561
    if (is_5gs) {
3277
0
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_5gs_tai_tac, tvb, *offset, 3, ENC_BIG_ENDIAN, &tac);
3278
0
        *offset += 3;
3279
561
    } else {
3280
561
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_tai_tac, tvb, *offset, 2, ENC_BIG_ENDIAN, &tac);
3281
561
        *offset += 2;
3282
561
    }
3283
561
    str = wmem_strdup_printf(pinfo->pool, "%s, TAC 0x%x",
3284
561
        mcc_mnc_str,
3285
561
        tac);
3286
3287
561
    return str;
3288
561
}
3289
3290
static char*
3291
dissect_gtpv2_ecgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3292
667
{
3293
667
    char       *str = NULL;
3294
667
    char       *mcc_mnc_str;
3295
667
    uint8_t     octet;
3296
667
    uint32_t    octet4;
3297
667
    uint8_t     spare;
3298
667
    uint32_t    ECGI;
3299
667
    static int* const ECGI_flags[] = {
3300
667
        &hf_gtpv2_enodebid,
3301
667
        &hf_gtpv2_cellid,
3302
667
        NULL
3303
667
    };
3304
3305
667
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_ECGI, true);
3306
667
    *offset += 3;
3307
    /* The bits 8 through 5, of octet e+3 (Fig 8.21.5-1 in TS 29.274 V8.2.0) are spare
3308
        * and hence they would not make any difference to the hex string following it,
3309
        * thus we directly read 4 bytes from the tvb
3310
        */
3311
3312
667
    octet = tvb_get_uint8(tvb, *offset);
3313
667
    spare = octet & 0xF0;
3314
667
    octet4 = tvb_get_ntohl(tvb, *offset);
3315
667
    ECGI = octet4 & 0x0FFFFFFF;
3316
667
    proto_tree_add_uint(tree, hf_gtpv2_ecgi_eci_spare, tvb, *offset, 1, spare);
3317
    /* The coding of the E-UTRAN cell identifier is the responsibility of each administration.
3318
     * Coding using full hexadecimal representation shall be used.
3319
     */
3320
667
    proto_tree_add_bitmask(tree, tvb, *offset, hf_gtpv2_ecgi_eci, ett_gtpv2_eci, ECGI_flags, ENC_BIG_ENDIAN);
3321
667
    *offset += 4;
3322
667
    str = wmem_strdup_printf(pinfo->pool, "%s, ECGI 0x%x",
3323
667
        mcc_mnc_str,
3324
667
        ECGI);
3325
3326
3327
667
    return str;
3328
667
}
3329
3330
static char*
3331
dissect_gtpv2_rai(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3332
294
{
3333
294
    char       *str = NULL;
3334
294
    char       *mcc_mnc_str;
3335
294
    uint16_t    lac, rac;
3336
3337
294
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_RAI, true);
3338
294
    *offset += 3;
3339
294
    lac = tvb_get_ntohs(tvb, *offset);
3340
294
    proto_tree_add_item(tree, hf_gtpv2_rai_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3341
294
    *offset += 2;
3342
    /* 3GPP 29.274 8.21.3 RAI Field
3343
     * "Only Octet c+5 contains the RAC. Octet c+6 is coded as all 1's (11111111)."
3344
     * (We could, here and in GTP, check that the other octet is all 1's.)
3345
     */
3346
294
    rac = tvb_get_uint8(tvb, *offset);
3347
294
    proto_tree_add_item(tree, hf_gtpv2_rai_rac, tvb, *offset, 1, ENC_BIG_ENDIAN);
3348
294
    *offset += 2;
3349
294
    str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, RAC 0x%x",
3350
294
        mcc_mnc_str,
3351
294
        lac,
3352
294
        rac);
3353
3354
294
    return str;
3355
294
}
3356
3357
static char*
3358
dissect_gtpv2_sai_common(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3359
831
{
3360
831
    char       *str = NULL;
3361
831
    char       *mcc_mnc_str;
3362
831
    uint16_t    lac, sac;
3363
3364
831
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_SAI, true);
3365
831
    *offset += 3;
3366
831
    lac = tvb_get_ntohs(tvb, *offset);
3367
831
    proto_tree_add_item(tree, hf_gtpv2_sai_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3368
831
    *offset += 2;
3369
831
    sac = tvb_get_ntohs(tvb, *offset);
3370
831
    proto_tree_add_item(tree, hf_gtpv2_sai_sac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3371
831
    *offset += 2;
3372
831
    str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, SAC 0x%x",
3373
831
        mcc_mnc_str,
3374
831
        lac,
3375
831
        sac);
3376
3377
831
    return str;
3378
831
}
3379
3380
static char*
3381
dissect_gtpv2_cgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3382
579
{
3383
579
    char       *str = NULL;
3384
579
    char       *mcc_mnc_str;
3385
579
    uint16_t    lac, ci;
3386
3387
579
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_CGI, true);
3388
579
    *offset += 3;
3389
579
    lac = tvb_get_ntohs(tvb, *offset);
3390
579
    proto_tree_add_item(tree, hf_gtpv2_uli_cgi_lac, tvb, *offset, 2, ENC_BIG_ENDIAN);
3391
579
    *offset += 2;
3392
579
    ci = tvb_get_ntohs(tvb, *offset);
3393
579
    proto_tree_add_item(tree, hf_gtpv2_uli_cgi_ci, tvb, *offset, 2, ENC_BIG_ENDIAN);
3394
579
    *offset += 2;
3395
579
    str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x, CI 0x%x",
3396
579
        mcc_mnc_str,
3397
579
        lac,
3398
579
        ci);
3399
3400
579
    return str;
3401
579
}
3402
3403
static char*
3404
dissect_gtpv2_macro_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
3405
943
{
3406
943
    char       *str = NULL;
3407
943
    char       *mcc_mnc_str;
3408
943
    uint32_t    macro_enodeb_id;
3409
3410
943
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
3411
943
    *offset += 3;
3412
    /* The Macro eNodeB ID consists of 20 bits.
3413
     * Bit 4 of Octet 4 is the most significant bit and bit 1 of Octet 6 is the least significant bit.
3414
     */
3415
943
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_macro_enodeb_id, tvb, *offset, 3, ENC_BIG_ENDIAN, &macro_enodeb_id);
3416
943
    *offset += 3;
3417
3418
943
    str = wmem_strdup_printf(pinfo->pool, "%s, Macro eNodeB ID 0x%x",
3419
943
        mcc_mnc_str,
3420
943
        macro_enodeb_id);
3421
3422
943
    return str;
3423
943
}
3424
3425
static const true_false_string gtpv2_smenb = {
3426
    "Short Macro eNodeB ID",
3427
    "Long Macro eNodeB ID",
3428
};
3429
3430
static char*
3431
dissect_gtpv2_ext_macro_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset, int hfindex)
3432
206
{
3433
206
    char       *str = NULL;
3434
206
    char       *mcc_mnc_str;
3435
206
    uint32_t    ext_macro_enodeb_id;
3436
3437
206
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
3438
206
    *offset += 3;
3439
    /* The Extended Macro eNodeB ID consists of 21 bits. */
3440
206
    proto_tree_add_item(tree, hf_gtpv2_smenb, tvb, *offset, 1, ENC_BIG_ENDIAN);
3441
206
    proto_tree_add_item_ret_uint(tree, hfindex, tvb, *offset, 3, ENC_BIG_ENDIAN, &ext_macro_enodeb_id);
3442
206
    *offset += 3;
3443
3444
206
    str = wmem_strdup_printf(pinfo->pool, "%s, Extended Macro %seNodeB ID 0x%x",
3445
206
        mcc_mnc_str,
3446
206
        hfindex == hf_gtpv2_ext_macro_ng_enodeb_id ? "ng-" : "",
3447
206
        ext_macro_enodeb_id);
3448
3449
206
    return str;
3450
206
}
3451
3452
3453
static char*
3454
decode_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, uint16_t length, uint8_t instance _U_, unsigned flags)
3455
10
{
3456
10
    int         offset = 1;     /* flags are already dissected */
3457
10
    proto_tree *part_tree;
3458
10
    char       *mcc_mnc_str;
3459
10
    char       *str = NULL;
3460
3461
    /* 8.21.1 CGI field  */
3462
10
    if (flags & GTPv2_ULI_CGI_MASK)
3463
3
    {
3464
3465
3
        proto_item_append_text(item, "CGI ");
3466
3
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3467
3
                ett_gtpv2_uli_field, NULL, "Cell Global Identity (CGI)");
3468
3469
3
        str = dissect_gtpv2_cgi(tvb, pinfo, part_tree, &offset);
3470
3471
3
        if (offset == length)
3472
0
            return str;
3473
3
    }
3474
3475
    /* 8.21.2 SAI field  */
3476
10
    if (flags & GTPv2_ULI_SAI_MASK)
3477
4
    {
3478
4
        proto_item_append_text(item, "SAI ");
3479
4
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3480
4
                ett_gtpv2_uli_field, NULL, "Service Area Identity (SAI)");
3481
3482
4
        str = dissect_gtpv2_sai_common(tvb, pinfo, part_tree, &offset);
3483
3484
4
        if (offset == length)
3485
0
            return str;
3486
4
    }
3487
    /* 8.21.3 RAI field  */
3488
10
    if (flags & GTPv2_ULI_RAI_MASK)
3489
8
    {
3490
8
        proto_item_append_text(item, "RAI ");
3491
8
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3492
8
                ett_gtpv2_uli_field, NULL, "Routeing Area Identity (RAI)");
3493
3494
8
        str = dissect_gtpv2_rai(tvb, pinfo, part_tree, &offset);
3495
3496
8
        if (offset == length)
3497
0
            return str;
3498
8
    }
3499
    /* 8.21.4 TAI field  */
3500
10
    if (flags & GTPv2_ULI_TAI_MASK)
3501
2
    {
3502
2
        proto_item_append_text(item, "TAI ");
3503
2
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
3504
2
            ett_gtpv2_uli_field, NULL, "Tracking Area Identity (TAI)");
3505
3506
2
        str = dissect_gtpv2_tai(tvb, pinfo, part_tree, &offset, false);
3507
3508
2
        if (offset == length)
3509
0
            return str;
3510
2
    }
3511
    /* 8.21.5 ECGI field */
3512
10
    if (flags & GTPv2_ULI_ECGI_MASK)
3513
4
    {
3514
4
        proto_item_append_text(item, "ECGI ");
3515
4
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 7,
3516
4
            ett_gtpv2_uli_field, NULL, "E-UTRAN Cell Global Identifier (ECGI)");
3517
3518
4
        str = dissect_gtpv2_ecgi(tvb, pinfo, part_tree, &offset);
3519
3520
4
        if (offset == length)
3521
0
            return str;
3522
3523
4
    }
3524
    /* 8.21.6  LAI field */
3525
10
    if (flags & GTPv2_ULI_LAI_MASK)
3526
4
    {
3527
4
        uint32_t lac;
3528
4
        proto_item_append_text(item, "LAI ");
3529
4
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 5,
3530
4
            ett_gtpv2_uli_field, NULL, "LAI (Location Area Identifier)");
3531
4
        mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, part_tree, offset, E212_LAI, true);
3532
4
        offset += 3;
3533
3534
        /* The Location Area Code (LAC) consists of 2 octets. Bit 8 of Octet f+3 is the most significant bit
3535
         * and bit 1 of Octet f+4 the least significant bit. The coding of the location area code is the
3536
         * responsibility of each administration. Coding using full hexadecimal representation shall be used.
3537
         */
3538
4
        proto_tree_add_item_ret_uint(part_tree, hf_gtpv2_uli_lai_lac, tvb, offset, 2, ENC_BIG_ENDIAN, &lac);
3539
4
        offset += 2;
3540
4
        str = wmem_strdup_printf(pinfo->pool, "%s, LAC 0x%x",
3541
4
            mcc_mnc_str,
3542
4
            lac);
3543
3544
4
    }
3545
    /* 8.21.7  Macro eNodeB ID field */
3546
10
    if (flags & GTPv2_ULI_MACRO_eNB_ID_MASK)
3547
5
    {
3548
5
        proto_item_append_text(item, "Macro eNodeB ID ");
3549
5
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 6,
3550
5
            ett_gtpv2_uli_field, NULL, "Macro eNodeB ID");
3551
3552
5
        str = dissect_gtpv2_macro_enodeb_id(tvb, pinfo, part_tree, &offset);
3553
3554
5
        if (offset == length)
3555
0
            return str;
3556
5
    }
3557
3558
    /* 8.21.8  Extended Macro eNodeB ID field */
3559
10
    if (flags & GTPv2_ULI_EXT_MACRO_eNB_ID_MASK)
3560
2
    {
3561
2
        proto_item_append_text(item, "Ext Macro eNodeB ID ");
3562
2
        part_tree = proto_tree_add_subtree(tree, tvb, offset, 6,
3563
2
            ett_gtpv2_uli_field, NULL, "Extended Macro eNodeB ID");
3564
3565
2
        str = dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, part_tree, &offset, hf_gtpv2_ext_macro_enodeb_id);
3566
3567
2
        if (offset == length)
3568
0
            return str;
3569
2
    }
3570
3571
10
    return str;
3572
3573
10
}
3574
3575
void
3576
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_)
3577
10
{
3578
10
    int         offset = 0;
3579
10
    uint64_t    flags;
3580
3581
10
    static int * const gtpv2_uli_flags[] = {
3582
10
        &hf_gtpv2_uli_ext_macro_enb_id_flg,
3583
10
        &hf_gtpv2_uli_macro_enb_id_flg,
3584
10
        &hf_gtpv2_uli_lai_flg,
3585
10
        &hf_gtpv2_uli_ecgi_flg,
3586
10
        &hf_gtpv2_uli_tai_flg,
3587
10
        &hf_gtpv2_uli_rai_flg,
3588
10
        &hf_gtpv2_uli_sai_flg,
3589
10
        &hf_gtpv2_uli_cgi_flg,
3590
10
        NULL
3591
10
    };
3592
3593
10
    proto_tree_add_bitmask_with_flags_ret_uint64(tree, tvb, offset, hf_gtpv2_uli_flags,
3594
10
        ett_gtpv2_uli_flags, gtpv2_uli_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE| BMT_NO_INT, &flags);
3595
3596
10
    decode_gtpv2_uli(tvb, pinfo, tree, item, length, instance, (unsigned)flags);
3597
3598
10
    return;
3599
10
}
3600
3601
/* Diameter 3GPP AVP Code: 22 3GPP-User-Location-Info */
3602
/*
3603
 * TS 29.061 v15.5.0
3604
 * 16.4.7.2 Coding 3GPP Vendor-Specific RADIUS attributes
3605
 */
3606
static const value_string geographic_location_type_vals[] = {
3607
    {0,   "CGI"},
3608
    {1,   "SAI"},
3609
    {2,   "RAI"},
3610
    {128, "TAI"},
3611
    {129, "ECGI"},
3612
    {130, "TAI and ECGI"},
3613
    {131, "eNodeB ID"},
3614
    {132, "TAI and eNodeB ID"},
3615
    {133, "extended eNodeB ID"},
3616
    {134, "TAI and extended eNodeB ID"},
3617
    {135, "NCGI"},
3618
    {136, "5GS TAI"},
3619
    {137, "5GS TAI and NCGI"},
3620
    {138, "NG-RAN Node ID"},
3621
    {139, "5GS TAI and NG-RAN Node ID"},
3622
    /* 140-255    Spare for future use */
3623
    {0, NULL}
3624
};
3625
3626
static int
3627
dissect_3gpp_uli(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, char **avp_str)
3628
0
{
3629
0
    int   offset = 0;
3630
0
    unsigned length;
3631
0
    unsigned flags;
3632
0
    uint32_t flags_3gpp;
3633
0
    char *str_buf = NULL;
3634
0
    length       = tvb_reported_length(tvb);
3635
3636
0
    if (!avp_str)
3637
0
        avp_str = &str_buf;
3638
3639
0
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_glt, tvb, offset, 1, ENC_BIG_ENDIAN, &flags_3gpp);
3640
0
    offset++;
3641
3642
0
    switch (flags_3gpp)
3643
0
    {
3644
0
    case 0:
3645
        /* CGI */
3646
0
        flags = GTPv2_ULI_CGI_MASK;
3647
0
        break;
3648
0
    case 1:
3649
        /* SAI */
3650
0
        flags = GTPv2_ULI_SAI_MASK;
3651
0
        break;
3652
0
    case 2:
3653
        /* RAI */
3654
0
        flags = GTPv2_ULI_RAI_MASK;
3655
0
        break;
3656
0
    case 128:
3657
        /* TAI */
3658
0
        flags = GTPv2_ULI_TAI_MASK;
3659
0
        break;
3660
0
    case 129:
3661
        /* ECGI */
3662
0
        flags = GTPv2_ULI_ECGI_MASK;
3663
0
        break;
3664
0
    case 130:
3665
        /* TAI and ECGI */
3666
0
        flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_ECGI_MASK;
3667
0
        break;
3668
0
    case 131:
3669
        /* eNodeB ID */
3670
0
        flags = GTPv2_ULI_MACRO_eNB_ID_MASK;
3671
0
        break;
3672
0
    case 132:
3673
        /* TAI and eNodeB ID */
3674
0
        flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_MACRO_eNB_ID_MASK;
3675
0
        break;
3676
0
    case 133:
3677
        /* extended eNodeB ID */
3678
0
        flags = GTPv2_ULI_EXT_MACRO_eNB_ID_MASK;
3679
0
        break;
3680
0
    case 134:
3681
        /* TAI and extended eNodeB ID */
3682
0
        flags = GTPv2_ULI_TAI_MASK + GTPv2_ULI_EXT_MACRO_eNB_ID_MASK;
3683
0
        break;
3684
0
    case 135:
3685
        /* NCGI */
3686
0
        {
3687
0
            char *mcc_mnc_str;
3688
0
            uint64_t nr_cell_id;
3689
0
            proto_tree *subtree;
3690
3691
0
            subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_gtpv2_uli_field, NULL,
3692
0
                                             "NR Cell Global Identifier (NCGI)");
3693
0
            mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, offset, E212_NRCGI, true);
3694
0
            offset += 3;
3695
0
            proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id);
3696
0
            *avp_str = wmem_strdup_printf(pinfo->pool,
3697
0
                                          "%s, NR Cell Id 0x%" PRIx64,
3698
0
                                          mcc_mnc_str, nr_cell_id);
3699
0
        }
3700
0
        return length;
3701
0
    case 136:
3702
        /* 5GS TAI */
3703
0
        {
3704
0
            proto_tree *subtree;
3705
3706
0
            subtree = proto_tree_add_subtree(tree, tvb, offset, 6, ett_gtpv2_uli_field, NULL,
3707
0
                                             "Tracking Area Identity (TAI)");
3708
0
            *avp_str = dissect_gtpv2_tai(tvb, pinfo, subtree, &offset, true);
3709
0
        }
3710
0
        return length;
3711
0
    case 137:
3712
        /* 5GS TAI and NCGI */
3713
0
        {
3714
0
            char *mcc_mnc_str;
3715
0
            uint64_t nr_cell_id;
3716
0
            proto_tree *subtree;
3717
3718
0
            subtree = proto_tree_add_subtree(tree, tvb, offset, 6, ett_gtpv2_uli_field, NULL,
3719
0
                                             "Tracking Area Identity (TAI)");
3720
0
            *avp_str = dissect_gtpv2_tai(tvb, pinfo, subtree, &offset, true);
3721
0
            subtree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_gtpv2_uli_field, NULL,
3722
0
                                             "NR Cell Global Identifier (NCGI)");
3723
0
            mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, subtree, offset, E212_NRCGI, true);
3724
0
            offset += 3;
3725
0
            proto_tree_add_item_ret_uint64(subtree, hf_gtpv2_ncgi_nrci, tvb, offset, 5, ENC_BIG_ENDIAN, &nr_cell_id);
3726
0
            *avp_str = wmem_strdup_printf(pinfo->pool,
3727
0
                                          "%s, %s, NR Cell Id 0x%" PRIx64,
3728
0
                                          *avp_str, mcc_mnc_str, nr_cell_id);
3729
0
        }
3730
0
        return length;
3731
0
    default:
3732
0
        proto_tree_add_item(tree, hf_gtpv2_geographic_location, tvb, offset, -1, ENC_NA);
3733
0
        return length;
3734
0
    }
3735
3736
0
    *avp_str = decode_gtpv2_uli(tvb, pinfo, tree, NULL, length, 0, flags);
3737
0
    return length;
3738
0
}
3739
3740
static const
3741
char *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo)
3742
0
{
3743
0
    uint16_t length;
3744
3745
0
    length = dissect_3gpp_uli(tvb, pinfo, tree, NULL);
3746
0
    return tvb_bytes_to_str(pinfo->pool, tvb, 0, length);
3747
3748
0
}
3749
3750
int
3751
dissect_diameter_3gpp_uli(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, void* data)
3752
0
{
3753
0
    diam_sub_dis_t* diam_sub_dis = (diam_sub_dis_t*)data;
3754
3755
0
    if (diam_sub_dis) {
3756
0
        return dissect_3gpp_uli(tvb, pinfo, tree, &diam_sub_dis->avp_str);
3757
0
    } else {
3758
0
        return dissect_3gpp_uli(tvb, pinfo, tree, NULL);
3759
0
    }
3760
0
}
3761
3762
/*
3763
 * 8.22 Fully Qualified TEID (F-TEID)
3764
 */
3765
static const value_string gtpv2_f_teid_interface_type_vals[] = {
3766
    { 0, "S1-U eNodeB GTP-U interface"},
3767
    { 1, "S1-U SGW GTP-U interface"},
3768
    { 2, "S12 RNC GTP-U interface"},
3769
    { 3, "S12 SGW GTP-U interface"},
3770
    { 4, "S5/S8 SGW GTP-U interface"},
3771
    { 5, "S5/S8 PGW GTP-U interface"},
3772
    { 6, "S5/S8 SGW GTP-C interface"},
3773
    { 7, "S5/S8 PGW GTP-C interface"},
3774
    { 8, "S5/S8 SGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
3775
         "and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6)"}, */
3776
    { 9, "S5/S8 PGW PMIPv6 interface"}, /* (the 32 bit GRE key is encoded in 32 bit TEID field "
3777
         "and the control plane and user plane addresses are the same for PMIPv6)"}, */
3778
    {10, "S11 MME GTP-C interface"},
3779
    {11, "S11/S4 SGW GTP-C interface"},
3780
    {12, "S10 MME GTP-C interface"},
3781
    {13, "S3 MME GTP-C interface"},
3782
    {14, "S3 SGSN GTP-C interface"},
3783
    {15, "S4 SGSN GTP-U interface"},
3784
    {16, "S4 SGW GTP-U interface"},
3785
    {17, "S4 SGSN GTP-C interface"},
3786
    {18, "S16 SGSN GTP-C interface"},
3787
    {19, "eNodeB/gNodeB GTP-U interface for DL data forwarding"},
3788
    {20, "eNodeB GTP-U interface for UL data forwarding"},
3789
    {21, "RNC GTP-U interface for data forwarding"},
3790
    {22, "SGSN GTP-U interface for data forwarding"},
3791
    {23, "SGW GTP-U interface for data forwarding"},
3792
    {24, "Sm MBMS GW GTP-C interface"},
3793
    {25, "Sn MBMS GW GTP-C interface"},
3794
    {26, "Sm MME GTP-C interface"},
3795
    {27, "Sn SGSN GTP-C interface"},
3796
    {28, "SGW GTP-U interface for UL data forwarding"},
3797
    {29, "Sn SGSN GTP-U interface"},
3798
    {30, "S2b ePDG GTP-C interface"},
3799
    {31, "S2b-U ePDG GTP-U interface"},
3800
    {32, "S2b PGW GTP-C interface"},
3801
    {33, "S2b-U PGW GTP-U interface"},
3802
    {34, "S2a TWAN GTP-U interface"},
3803
    {35, "S2a TWAN GTP-C interface"},
3804
    {36, "S2a PGW GTP-C interface"},
3805
    {37, "S2a PGW GTP-U interface"},
3806
    {38, "S11 MME GTP-U interface"},
3807
    {39, "S11 SGW GTP-U interface"},
3808
    {40, "N26 AMF GTP-C interface"},
3809
    {41, "N19mb UPF GTP-U interface"},
3810
    {0, NULL}
3811
};
3812
static value_string_ext gtpv2_f_teid_interface_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_f_teid_interface_type_vals);
3813
3814
static const true_false_string gtpv2_f_teid_v4_vals = {
3815
    "IPv4 address present",
3816
    "IPv4 address not present",
3817
};
3818
3819
static const true_false_string gtpv2_f_teid_v6_vals = {
3820
    "IPv6 address present",
3821
    "IPv6 address not present",
3822
};
3823
3824
static void
3825
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)
3826
3
{
3827
3
    int    offset = 0;
3828
3
    uint8_t flags;
3829
3
    address *ipv4 = NULL, *ipv6 = NULL;
3830
3
    uint32_t teid_cp, *teid, session;
3831
3832
3
    flags = tvb_get_uint8(tvb, offset);
3833
3
    proto_tree_add_item(tree, hf_gtpv2_f_teid_v4, tvb, offset, 1, ENC_BIG_ENDIAN);
3834
3
    proto_tree_add_item(tree, hf_gtpv2_f_teid_v6, tvb, offset, 1, ENC_BIG_ENDIAN);
3835
    /* NOTE:  "Interface type" IE is defined with 5 bits only in the earlier releases of this specification,
3836
     * thus pre-Rel-10 GTPv2-C nodes can ignore bit "6" which is marked as "Spare" in earlier releases,
3837
     * allowing backward compatibility.
3838
     */
3839
3
    proto_tree_add_item(tree, hf_gtpv2_f_teid_interface_type, tvb, offset, 1, ENC_BIG_ENDIAN);
3840
3841
3
    offset += 1;
3842
3
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN, &teid_cp);
3843
3
    proto_item_append_text(item, "%s, TEID/GRE Key: 0x%s",
3844
3
                           val_to_str_ext_const((flags & 0x3f), &gtpv2_f_teid_interface_type_vals_ext, "Unknown"),
3845
3
                           tvb_bytes_to_str(pinfo->pool, tvb, offset, 4));
3846
3847
3
    offset += 4;
3848
3
    if (flags & 0x80)
3849
1
    {
3850
1
        ipv4 = wmem_new0(pinfo->pool, address);
3851
1
        proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
3852
1
        proto_item_append_text(item, ", IPv4 %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
3853
1
        set_address_tvb(ipv4, AT_IPv4, 4, tvb, offset);
3854
1
        offset += 4;
3855
1
    }
3856
3
    if (flags & 0x40)
3857
1
    {
3858
1
        ipv6 = wmem_new0(pinfo->pool, address);
3859
1
        proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, ENC_NA);
3860
1
        proto_item_append_text(item, ", IPv6 %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
3861
1
        set_address_tvb(ipv6, AT_IPv6, 16, tvb, offset);
3862
1
    }
3863
3864
3
    if (g_gtp_session && args) {
3865
0
        session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
3866
0
        if (!session) {
3867
            /* We save the teid so that we could assignate its corresponding session ID later */
3868
0
            args->last_teid = teid_cp;
3869
0
            if (!teid_exists(teid_cp, args->teid_list)) {
3870
0
                teid = wmem_new(pinfo->pool, uint32_t);
3871
0
                *teid = teid_cp;
3872
0
                wmem_list_prepend(args->teid_list, teid);
3873
0
            }
3874
0
            if (ipv4 != NULL && !ip_exists(*ipv4, args->ip_list)) {
3875
0
                copy_address_wmem(pinfo->pool, &args->last_ip, ipv4);
3876
0
                wmem_list_prepend(args->ip_list, ipv4);
3877
0
            }
3878
0
            if (ipv6 != NULL && !ip_exists(*ipv6, args->ip_list)) {
3879
0
                copy_address_wmem(pinfo->pool, &args->last_ip, ipv6);
3880
0
                wmem_list_prepend(args->ip_list, ipv6);
3881
0
            }
3882
0
        }
3883
0
    }
3884
3
}
3885
/*
3886
 * 8.23 TMSI
3887
 */
3888
static void
3889
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_)
3890
2
{
3891
2
    proto_tree_add_item(tree, hf_gtpv2_tmsi, tvb, 0, 4, ENC_BIG_ENDIAN);
3892
2
    proto_tree_add_item(item, hf_gtpv2_tmsi_bytes, tvb, 0, length, ENC_NA);
3893
2
}
3894
/*
3895
 * 8.24 Global CN-Id
3896
 * (TS 23.003)
3897
 * 12.3 CN Identifier
3898
 *
3899
 * A CN node is uniquely identified within a PLMN by its CN Identifier (CN-Id). The CN-Id together with the PLMN
3900
 * identifier globally identifies the CN node. The CN-Id together with the PLMN-Id is used as the CN node identifier in
3901
 * RANAP signalling over the Iu interface.
3902
 * Global CN-Id = PLMN-Id || CN-Id
3903
 * The CN-Id is defined by the operator, and set in the nodes via O&M.
3904
 * For the syntax description and the use of this identifier in RANAP signalling, see 3GPP TS 25.413 [17].
3905
 */
3906
3907
static void
3908
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_)
3909
2
{
3910
2
    int offset = 0;
3911
3912
2
    dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
3913
2
    offset += 3;
3914
3915
    /* >CN-ID M INTEGER (0..4095) */
3916
2
    proto_tree_add_item(tree, hf_gtpv2_cn_id, tvb, offset, 2, ENC_NA);
3917
2
}
3918
/*
3919
 * 8.25 S103 PDN Data Forwarding Info (S103PDF)
3920
 */
3921
static void
3922
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_)
3923
2
{
3924
2
    int         offset = 0;
3925
2
    uint8_t     m, k, i;
3926
3927
    /* The HSGW Address and GRE Key identify a GRE Tunnel towards a HSGW over S103 interface for a specific PDN
3928
     * connection of the UE. The EPS Bearer IDs specify the EPS Bearers which require data forwarding that belonging to this
3929
     * PDN connection. The number of EPS bearer Ids included is specified by the value of EPS Bearer ID Number.
3930
     */
3931
    /* Octet 5 HSGW Address for forwarding Length = m */
3932
2
    m = tvb_get_uint8(tvb, offset);
3933
2
    proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_f_len, tvb, offset, 1, ENC_BIG_ENDIAN);
3934
2
    offset += 1;
3935
3936
    /* 6 to (m+5) HSGW Address for forwarding [4..16] */
3937
2
    switch (m) {
3938
0
    case 4:
3939
        /* IPv4 */
3940
0
        proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv4, tvb, offset, m, ENC_BIG_ENDIAN);
3941
0
        offset += 4;
3942
0
        break;
3943
0
    case 16:
3944
        /* IPv6 */
3945
0
        proto_tree_add_item(tree, hf_gtpv2_hsgw_addr_ipv6, tvb, offset, m, ENC_NA);
3946
0
        offset += 16;
3947
0
        break;
3948
2
    default:
3949
        /* Error */
3950
2
        proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
3951
2
                                     "Wrong length %u, should be 4 or 16", m);
3952
2
        return;
3953
2
    }
3954
3955
    /* (m+6)- to (m+9) GRE Key */
3956
0
    proto_tree_add_item(tree, hf_gtpv2_gre_key, tvb, offset, 4, ENC_BIG_ENDIAN);
3957
0
    offset += 4;
3958
3959
    /* (m+10) EPS Bearer ID Number = k */
3960
0
    k = tvb_get_uint8(tvb, offset);
3961
0
    proto_tree_add_item(tree, hf_gtpv2_eps_bearer_id_number, tvb, offset, 1, ENC_BIG_ENDIAN);
3962
0
    offset += 1;
3963
3964
    /* (m+11) to (m+10+k)
3965
     * Spare EPS Bearer ID
3966
     */
3967
0
    for ( i = 0; i < k; i++ ) {
3968
0
        proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3969
0
        proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
3970
0
        offset += 1;
3971
0
    }
3972
3973
0
}
3974
/*
3975
 * 8.26 S1-U Data Forwarding (S1UDF)
3976
 */
3977
static void
3978
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_)
3979
7
{
3980
7
    int         offset = 0;
3981
7
    uint8_t     m;
3982
3983
    /* 5 Spare EPS Bearer ID */
3984
7
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
3985
7
    proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
3986
7
    offset += 1;
3987
    /* 6 Serving GW Address Length = m */
3988
7
    m = tvb_get_uint8(tvb, offset);
3989
7
    proto_tree_add_item(tree, hf_gtpv2_serving_gw_address_length, tvb, offset, 1, ENC_BIG_ENDIAN);
3990
7
    offset += 1;
3991
    /* 7 to (m+6) Serving GW Address [4..16] */
3992
7
    switch (m) {
3993
1
    case 4:
3994
        /* IPv4 */
3995
1
        proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv4, tvb, offset, m, ENC_BIG_ENDIAN);
3996
1
        offset += 4;
3997
1
        break;
3998
1
    case 16:
3999
        /* IPv6 */
4000
1
        proto_tree_add_item(tree, hf_gtpv2_sgw_addr_ipv6, tvb, offset, m, ENC_NA);
4001
1
        offset += 16;
4002
1
        break;
4003
5
    default:
4004
        /* Error */
4005
5
        proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
4006
5
                                     "Wrong length %u, should be 4 or 16", m);
4007
5
        return;
4008
7
    }
4009
4010
    /* (m+7) to (m+10)
4011
     * Serving GW S1-U TEID
4012
     */
4013
2
    proto_tree_add_item(tree, hf_gtpv2_sgw_s1u_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
4014
4015
2
}
4016
/*
4017
 * 8.27 Delay Value
4018
 */
4019
4020
static void
4021
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_)
4022
6
{
4023
6
    int offset = 0;
4024
4025
6
    proto_tree_add_item(tree, hf_gtpv2_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
4026
6
}
4027
4028
/*
4029
 * 8.28 Bearer Context (grouped IE)
4030
 */
4031
4032
static void
4033
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_)
4034
3
{
4035
3
    int         offset = 0;
4036
3
    tvbuff_t   *new_tvb;
4037
3
    proto_tree *grouped_tree;
4038
4039
3
    proto_item_append_text(item, "[Grouped IE]");
4040
3
    grouped_tree = proto_item_add_subtree(item, ett_gtpv2_bearer_ctx);
4041
4042
3
    new_tvb = tvb_new_subset_length(tvb, offset, length);
4043
3
    dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type, args, GTPV2_IE_BEARER_CTX);
4044
3
}
4045
4046
/* 8.29 Charging ID */
4047
static void
4048
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_)
4049
3
{
4050
3
    int offset = 0;
4051
4052
3
    proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, ENC_BIG_ENDIAN);
4053
3
}
4054
4055
4056
 /* 8.30 Charging Characteristics
4057
  * The charging characteristics information element is defined in 3GPP TS 32.251 [8]
4058
  * and is a way of informing both the SGW and PGW of the rules for producing charging
4059
  * information based on operator configured triggers. For the encoding of this
4060
  * information element see 3GPP TS 32.298 [9].
4061
  */
4062
static void
4063
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_)
4064
3
{
4065
3
    int offset = 0;
4066
4067
3
    proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, 2, ENC_BIG_ENDIAN);
4068
3
    if (length > 2) {
4069
2
        offset += 2;
4070
        /* These octet(s) is/are present only if explicitly specified */
4071
2
        proto_tree_add_item(tree, hf_gtpv2_charging_characteristic_remaining_octets, tvb, offset, length-2, ENC_NA);
4072
2
    }
4073
4074
3
}
4075
4076
/*
4077
 * 8.30 Bearer Flag
4078
 */
4079
static void
4080
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_)
4081
3
{
4082
4083
3
    int offset = 0;
4084
4085
    /* Octet 5 Spare VB PPC */
4086
3
    proto_tree_add_item(tree, hf_gtpv2_bearer_flag_ppc, tvb, offset, length, ENC_BIG_ENDIAN);
4087
3
    proto_tree_add_item(tree, hf_gtpv2_bearer_flag_vb, tvb, offset, length, ENC_BIG_ENDIAN);
4088
4089
3
}
4090
/*
4091
 * 8.34 PDN Type
4092
 */
4093
void
4094
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_)
4095
18
{
4096
4097
18
    int offset = 0;
4098
18
    uint8_t pdn;
4099
4100
18
    if (length != 1) {
4101
18
        proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, 0, length,
4102
18
                                     "Wrong length indicated. Expected 1, got %u", length);
4103
18
        return;
4104
18
    }
4105
4106
0
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 5, ENC_BIG_ENDIAN);
4107
0
    pdn = tvb_get_uint8(tvb, offset)& 0x7;
4108
0
    proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, ENC_BIG_ENDIAN);
4109
0
    proto_item_append_text(item, "%s", val_to_str_ext_const(pdn, &gtpv2_pdn_type_vals_ext, "Unknown"));
4110
4111
0
}
4112
4113
/*
4114
 * 8.31 Trace Information
4115
 */
4116
 /* List of NE Types */
4117
static int* const trace_ne_types_flags_oct1[] = {
4118
    &hf_gtpv2_tra_info_lne_sgw,
4119
    &hf_gtpv2_tra_info_lne_mme,
4120
    &hf_gtpv2_tra_info_lne_bm_sc,
4121
    &hf_gtpv2_tra_info_lne_rnc,
4122
    &hf_gtpv2_tra_info_lne_ggsn,
4123
    &hf_gtpv2_tra_info_lne_sgsn,
4124
    &hf_gtpv2_tra_info_lne_mgw,
4125
    &hf_gtpv2_tra_info_lne_msc_s,
4126
    NULL
4127
};
4128
4129
static int* const trace_ne_types_flags_oct2[] = {
4130
    &hf_gtpv2_tra_info_tra_info_ng_ran_node,
4131
    &hf_gtpv2_tra_info_lne_upf,
4132
    &hf_gtpv2_tra_info_lne_pcf,
4133
    &hf_gtpv2_tra_info_lne_smf,
4134
    &hf_gtpv2_tra_info_lne_amf,
4135
    &hf_gtpv2_tra_info_lne_enb,
4136
    &hf_gtpv2_tra_info_lne_pdn_gw,
4137
    NULL
4138
};
4139
4140
static void
4141
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_)
4142
20
{
4143
20
    proto_tree  *trigg_tree, *msc_server_tree, *mgw_tree, *sgsn_tree, *ggsn_tree;
4144
20
    proto_tree  *bm_sc_tree, *sgw_mme_tree, *sgw_tree, *pgw_tree, *ne_types_tree;
4145
20
    proto_tree  *interfaces_tree, *imsc_server_tree, *lmgw_tree, *lsgsn_tree, *lggsn_tree, *lrnc_tree;
4146
20
    proto_tree  *lbm_sc_tree, *lmme_tree, *lsgw_tree, *lpdn_gw_tree, *lenb_tree;
4147
4148
20
    int         offset = 0;
4149
#if 0
4150
    uint8_t     *trace_id = NULL;
4151
#endif
4152
20
    uint16_t    tid;
4153
20
    uint32_t    bit_offset;
4154
4155
20
    dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
4156
20
    offset += 3;
4157
4158
    /* Append Trace ID to main tree */
4159
20
    tid = tvb_get_ntohs(tvb, offset);
4160
20
    proto_item_append_text(item, "Trace ID: %d  ", tid);
4161
4162
    /* Trace ID */
4163
    /*--------------------------------------------------
4164
     * trace_id = tvb_format_text(tvb, offset, 2);
4165
     * proto_tree_add_string(tree, hf_gtpv2_tra_info, tvb, offset, length, trace_id);
4166
     *--------------------------------------------------*/
4167
20
    proto_tree_add_item(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN);
4168
20
    offset += 3;
4169
4170
    /* Triggering Events, put all into a new tree called triggering_tree */
4171
20
    trigg_tree = proto_tree_add_subtree(tree, tvb, offset, 9, ett_gtpv2_tra_info_trigg, NULL, "Triggering Events");
4172
4173
    /* Create all subtrees */
4174
20
    msc_server_tree = proto_tree_add_subtree(trigg_tree, tvb, offset, 2, ett_gtpv2_tra_info_trigg_msc_server, NULL, "MSC Server");
4175
4176
20
    mgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_trigg_mgw, NULL, "MGW");
4177
4178
20
    sgsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_trigg_sgsn, NULL, "SGSN");
4179
4180
20
    ggsn_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_trigg_ggsn, NULL, "GGSN");
4181
4182
20
    bm_sc_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_trigg_bm_sc, NULL, "BM-SC");
4183
4184
20
    sgw_mme_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_trigg_sgw_mme, NULL, "SGW MME");
4185
4186
20
    sgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_sgw, NULL, "SGW");
4187
4188
20
    pgw_tree = proto_tree_add_subtree(trigg_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_trigg_pgw, NULL, "PGW");
4189
4190
    /* MSC Server - 2 octets */
4191
20
    static int* const tra_info_msc_flags[] = {
4192
20
        &hf_gtpv2_tra_info_msc_ss,
4193
20
        &hf_gtpv2_tra_info_msc_handovers,
4194
20
        &hf_gtpv2_tra_info_msc_lu_imsi_ad,
4195
20
        &hf_gtpv2_tra_info_msc_momt_sms,
4196
20
        &hf_gtpv2_tra_info_msc_momt_calls,
4197
20
        NULL
4198
20
    };
4199
20
    proto_tree_add_bitmask_list(msc_server_tree, tvb, offset, 1, tra_info_msc_flags, ENC_BIG_ENDIAN);
4200
20
    bit_offset = offset << 3;
4201
20
    proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits,          tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4202
20
    offset += 1;
4203
20
    bit_offset = offset << 3;
4204
20
    proto_tree_add_bits_item(msc_server_tree, hf_gtpv2_spare_bits,          tvb, bit_offset, 8, ENC_BIG_ENDIAN);
4205
20
    offset += 1;
4206
4207
    /* MGW - 1 octet */
4208
20
    proto_tree_add_item(mgw_tree, hf_gtpv2_tra_info_mgw_context,            tvb, offset, 1, ENC_BIG_ENDIAN);
4209
20
    bit_offset = offset << 3;
4210
20
    proto_tree_add_bits_item(mgw_tree, hf_gtpv2_spare_bits,                 tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4211
20
    offset += 1;
4212
    /* SGSN - 2 octets */
4213
20
    static int* const tra_info_sgsn_flags[] = {
4214
20
        &hf_gtpv2_tra_info_sgsn_mbms,
4215
20
        &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
4216
20
        &hf_gtpv2_tra_info_sgsn_momt_sms,
4217
20
        &hf_gtpv2_tra_info_sgsn_pdp_context,
4218
20
        NULL
4219
20
    };
4220
20
    proto_tree_add_bitmask_list(sgsn_tree, tvb, offset, 1, tra_info_sgsn_flags, ENC_BIG_ENDIAN);
4221
20
    bit_offset = offset << 3;
4222
20
    proto_tree_add_bits_item(sgsn_tree, hf_gtpv2_spare_bits,                tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4223
20
    offset += 1;
4224
20
    proto_tree_add_item(sgsn_tree, hf_gtpv2_tra_info_sgsn_reserved,         tvb, offset, 1, ENC_BIG_ENDIAN);
4225
20
    offset += 1;
4226
    /* GGSN - 1 octet */
4227
20
    proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_pdp,              tvb, offset, 1, ENC_BIG_ENDIAN);
4228
20
    proto_tree_add_item(ggsn_tree, hf_gtpv2_tra_info_ggsn_mbms,             tvb, offset, 1, ENC_BIG_ENDIAN);
4229
20
    bit_offset = offset << 3;
4230
20
    proto_tree_add_bits_item(ggsn_tree, hf_gtpv2_spare_bits,                tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4231
20
    offset += 1;
4232
    /* BM-SC - 1 octet */
4233
20
    proto_tree_add_item(bm_sc_tree, hf_gtpv2_tra_info_bm_sc,                tvb, offset, 1, ENC_BIG_ENDIAN);
4234
20
    bit_offset = offset << 3;
4235
20
    proto_tree_add_bits_item(bm_sc_tree, hf_gtpv2_spare_bits,               tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4236
20
    offset += 1;
4237
    /* MME/SGW - 1 octet */
4238
20
    static int* const tra_info_mme_flags[] = {
4239
20
        &hf_gtpv2_tra_info_mme_sgw_ho,
4240
20
        &hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del,
4241
20
        &hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc,
4242
20
        &hf_gtpv2_tra_info_mme_sgw_iataud,
4243
20
        &hf_gtpv2_tra_info_mme_sgw_sr,
4244
20
        &hf_gtpv2_tra_info_mme_sgw_ss,
4245
20
        NULL
4246
20
    };
4247
20
    proto_tree_add_bitmask_list(sgw_mme_tree, tvb, offset, 1, tra_info_mme_flags, ENC_BIG_ENDIAN);
4248
20
    bit_offset = offset << 3;
4249
20
    proto_tree_add_bits_item(sgw_mme_tree, hf_gtpv2_spare_bits,                     tvb, bit_offset, 2, ENC_BIG_ENDIAN);
4250
20
    offset += 1;
4251
    /* PGW/SGW - 1 octet */
4252
20
    static int* const tra_info_sgw_pdn_flags[] = {
4253
20
        &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
4254
20
        &hf_gtpv2_tra_info_sgw_pdn_con_term,
4255
20
        &hf_gtpv2_tra_info_sgw_pdn_con_creat,
4256
20
        NULL
4257
20
    };
4258
20
    proto_tree_add_bitmask_list(sgw_mme_tree, tvb, offset, 1, tra_info_sgw_pdn_flags, ENC_BIG_ENDIAN);
4259
20
    bit_offset = (offset << 3) + 4;
4260
20
    proto_tree_add_bits_item(sgw_tree, hf_gtpv2_spare_bits,                 tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4261
4262
20
    static int* const tra_info_pgw_flags[] = {
4263
20
        &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
4264
20
        &hf_gtpv2_tra_info_pgw_pdn_con_term,
4265
20
        &hf_gtpv2_tra_info_pgw_pdn_con_creat,
4266
20
        NULL
4267
20
    };
4268
20
    proto_tree_add_bitmask_list(pgw_tree, tvb, offset, 1, tra_info_pgw_flags, ENC_BIG_ENDIAN);
4269
4270
20
    bit_offset = offset << 3;
4271
20
    proto_tree_add_bits_item(pgw_tree, hf_gtpv2_spare_bits,                 tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4272
20
    offset += 1;
4273
4274
    /* Create NE Types subtree */
4275
20
    ne_types_tree = proto_tree_add_subtree(tree, tvb, offset, 2, ett_gtpv2_tra_info_ne_types, NULL, "List of NE Types");
4276
4277
20
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, trace_ne_types_flags_oct1, ENC_BIG_ENDIAN);
4278
20
    offset += 1;
4279
4280
20
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, trace_ne_types_flags_oct2, ENC_BIG_ENDIAN);
4281
20
    bit_offset = offset << 3;
4282
20
    proto_tree_add_bits_item(ne_types_tree, hf_gtpv2_spare_bits,        tvb, bit_offset, 1, ENC_BIG_ENDIAN);
4283
20
    offset += 1;
4284
4285
    /* Trace Depth Length */
4286
20
    proto_tree_add_item(tree, hf_gtpv2_tra_info_tdl,                    tvb, offset, 1, ENC_BIG_ENDIAN);
4287
20
    offset += 1;
4288
4289
    /* Set up subtree interfaces and put all interfaces under it */
4290
20
    interfaces_tree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_gtpv2_tra_info_interfaces, NULL, "List of Interfaces");
4291
4292
    /* Create all subtrees */
4293
20
    imsc_server_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset, 2, ett_gtpv2_tra_info_interfaces_imsc_server, NULL, "MSC Server");
4294
4295
20
    lmgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 2, 1, ett_gtpv2_tra_info_interfaces_lmgw, NULL, "MGW");
4296
4297
20
    lsgsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 3, 2, ett_gtpv2_tra_info_interfaces_lsgsn, NULL, "SGSN");
4298
4299
20
    lggsn_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 5, 1, ett_gtpv2_tra_info_interfaces_lggsn, NULL, "GGSN");
4300
4301
20
    lrnc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 6, 1, ett_gtpv2_tra_info_interfaces_lrnc, NULL, "RNC");
4302
4303
20
    lbm_sc_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 7, 1, ett_gtpv2_tra_info_interfaces_lbm_sc, NULL, "BM-SC");
4304
4305
20
    lmme_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 8, 1, ett_gtpv2_tra_info_interfaces_lmme, NULL, "MME");
4306
4307
20
    lsgw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 9, 1,ett_gtpv2_tra_info_interfaces_lsgw, NULL, "SGW");
4308
4309
20
    lpdn_gw_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 10, 1, ett_gtpv2_tra_info_interfaces_lpdn_gw, NULL, "PDN GW");
4310
4311
20
    lenb_tree = proto_tree_add_subtree(interfaces_tree, tvb, offset + 11, 1, ett_gtpv2_tra_info_interfaces_lpdn_lenb, NULL, "eNB");
4312
4313
    /* MSC Server - 2 octets */
4314
20
    static int* const tra_info_lmsc_flags[] = {
4315
20
        &hf_gtpv2_tra_info_lmsc_cap,
4316
20
        &hf_gtpv2_tra_info_lmsc_map_f,
4317
20
        &hf_gtpv2_tra_info_lmsc_map_e,
4318
20
        &hf_gtpv2_tra_info_lmsc_map_b,
4319
20
        &hf_gtpv2_tra_info_lmsc_map_g,
4320
20
        &hf_gtpv2_tra_info_lmsc_mc,
4321
20
        &hf_gtpv2_tra_info_lmsc_lu,
4322
20
        &hf_gtpv2_tra_info_lmsc_a,
4323
20
        NULL
4324
20
    };
4325
20
    proto_tree_add_bitmask_list(imsc_server_tree, tvb, offset, 1, tra_info_lmsc_flags, ENC_BIG_ENDIAN);
4326
20
    offset += 1;
4327
20
    proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_d,     tvb, offset, 1, ENC_BIG_ENDIAN);
4328
20
    proto_tree_add_item(imsc_server_tree, hf_gtpv2_tra_info_lmsc_map_c,     tvb, offset, 1, ENC_BIG_ENDIAN);
4329
20
    bit_offset = offset << 3;
4330
20
    proto_tree_add_bits_item(imsc_server_tree, hf_gtpv2_spare_bits,         tvb, bit_offset, 6, ENC_BIG_ENDIAN);
4331
20
    offset += 1;
4332
    /* MGW - 1 octet */
4333
20
    static int* const tra_info_lmgw_flags[] = {
4334
20
        &hf_gtpv2_tra_info_lmgw_lu_up,
4335
20
        &hf_gtpv2_tra_info_lmgw_nb_up,
4336
20
        &hf_gtpv2_tra_info_lmgw_mc,
4337
20
        NULL
4338
20
    };
4339
20
    proto_tree_add_bitmask_list(lmgw_tree, tvb, offset, 1, tra_info_lmgw_flags, ENC_BIG_ENDIAN);
4340
20
    bit_offset = offset << 3;
4341
20
    proto_tree_add_bits_item(lmgw_tree, hf_gtpv2_spare_bits,                tvb, bit_offset, 5, ENC_BIG_ENDIAN);
4342
20
    offset += 1;
4343
    /* SGSN - 2 octets */
4344
20
    static int* const tra_info_lsgsn_flags[] = {
4345
20
        &hf_gtpv2_tra_info_lsgsn_ge,
4346
20
        &hf_gtpv2_tra_info_lsgsn_gs,
4347
20
        &hf_gtpv2_tra_info_lsgsn_map_gf,
4348
20
        &hf_gtpv2_tra_info_lsgsn_map_gd,
4349
20
        &hf_gtpv2_tra_info_lsgsn_map_gr,
4350
20
        &hf_gtpv2_tra_info_lsgsn_gn,
4351
20
        &hf_gtpv2_tra_info_lsgsn_lu,
4352
20
        &hf_gtpv2_tra_info_lsgsn_gb,
4353
20
        NULL
4354
20
    };
4355
20
    proto_tree_add_bitmask_list(lsgsn_tree, tvb, offset, 1, tra_info_lsgsn_flags, ENC_BIG_ENDIAN);
4356
20
    offset += 1;
4357
20
    bit_offset = offset << 3;
4358
20
    proto_tree_add_bits_item(lsgsn_tree, hf_gtpv2_spare_bits,               tvb, bit_offset, 8, ENC_BIG_ENDIAN);
4359
20
    offset += 1;
4360
4361
    /* GGSN - 1 octet */
4362
20
    static int* const tra_info_lggsn_flags[] = {
4363
20
        &hf_gtpv2_tra_info_lggsn_gmb,
4364
20
        & hf_gtpv2_tra_info_lggsn_gi,
4365
20
        & hf_gtpv2_tra_info_lggsn_gn,
4366
20
        NULL
4367
20
    };
4368
20
    proto_tree_add_bitmask_list(lggsn_tree, tvb, offset, 1, tra_info_lggsn_flags, ENC_BIG_ENDIAN);
4369
20
    bit_offset = offset << 3;
4370
20
    proto_tree_add_bits_item(lggsn_tree, hf_gtpv2_spare_bits,               tvb, bit_offset, 5, ENC_BIG_ENDIAN);
4371
20
    offset += 1;
4372
    /* RNC - 1 octet */
4373
20
    static int* const tra_info_lrnc_flags[] = {
4374
20
        &hf_gtpv2_tra_info_lrnc_uu,
4375
20
        &hf_gtpv2_tra_info_lrnc_lub,
4376
20
        &hf_gtpv2_tra_info_lrnc_lur,
4377
20
        &hf_gtpv2_tra_info_lrnc_lu,
4378
20
        NULL
4379
20
    };
4380
20
    proto_tree_add_bitmask_list(lrnc_tree, tvb, offset, 1, tra_info_lrnc_flags, ENC_BIG_ENDIAN);
4381
20
    bit_offset = offset << 3;
4382
20
    proto_tree_add_bits_item(lrnc_tree, hf_gtpv2_spare_bits,                tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4383
20
    offset += 1;
4384
    /* BM_SC - 1 octet */
4385
20
    proto_tree_add_item(lbm_sc_tree, hf_gtpv2_tra_info_lbm_sc_gmb,          tvb, offset, 1, ENC_BIG_ENDIAN);
4386
20
    bit_offset = offset << 3;
4387
20
    proto_tree_add_bits_item(lbm_sc_tree, hf_gtpv2_spare_bits,              tvb, bit_offset, 7, ENC_BIG_ENDIAN);
4388
20
    offset += 1;
4389
    /* MME - 1 octet */
4390
20
    static int* const tra_info_lmme_flags[] = {
4391
20
        &hf_gtpv2_tra_info_lmme_s11,
4392
20
        &hf_gtpv2_tra_info_lmme_s10,
4393
20
        &hf_gtpv2_tra_info_lmme_s6a,
4394
20
        &hf_gtpv2_tra_info_lmme_s3,
4395
20
        &hf_gtpv2_tra_info_lmme_s1_mme,
4396
20
        NULL
4397
20
    };
4398
20
    proto_tree_add_bitmask_list(lmme_tree, tvb, offset, 1, tra_info_lmme_flags, ENC_BIG_ENDIAN);
4399
20
    bit_offset = offset << 3;
4400
20
    proto_tree_add_bits_item(lmme_tree, hf_gtpv2_spare_bits,                tvb, bit_offset, 3, ENC_BIG_ENDIAN);
4401
20
    offset += 1;
4402
    /* SGW - 1 octet */
4403
20
    static int* const tra_info_lsgw_flags[] = {
4404
20
        &hf_gtpv2_tra_info_lsgw_s11,
4405
20
        &hf_gtpv2_tra_info_lsgw_s8b,
4406
20
        &hf_gtpv2_tra_info_lsgw_s5,
4407
20
        &hf_gtpv2_tra_info_lsgw_s4,
4408
20
        NULL
4409
20
    };
4410
20
    proto_tree_add_bitmask_list(lsgw_tree, tvb, offset, 1, tra_info_lsgw_flags, ENC_BIG_ENDIAN);
4411
20
    bit_offset = offset << 3;
4412
20
    proto_tree_add_bits_item(lsgw_tree, hf_gtpv2_spare_bits,                tvb, bit_offset, 4, ENC_BIG_ENDIAN);
4413
20
    offset += 1;
4414
    /* PDN GW - 1 octet */
4415
20
    static int* const tra_info_lpdn_gw_flags[] = {
4416
20
        &hf_gtpv2_tra_info_lpdn_gw_sgi,
4417
20
        &hf_gtpv2_tra_info_lpdn_gw_s8b,
4418
20
        &hf_gtpv2_tra_info_lpdn_gw_gx,
4419
20
        &hf_gtpv2_tra_info_lpdn_gw_s6c,
4420
20
        &hf_gtpv2_tra_info_lpdn_gw_s5,
4421
20
        &hf_gtpv2_tra_info_lpdn_gw_s2c,
4422
20
        &hf_gtpv2_tra_info_lpdn_gw_s2b,
4423
20
        &hf_gtpv2_tra_info_lpdn_gw_s2a,
4424
20
        NULL
4425
20
    };
4426
20
    proto_tree_add_bitmask_list(lpdn_gw_tree, tvb, offset, 1, tra_info_lpdn_gw_flags, ENC_BIG_ENDIAN);
4427
20
    offset += 1;
4428
    /* eNB - 1 octet */
4429
20
    static int* const tra_info_lenb_flags[] = {
4430
20
        &hf_gtpv2_tra_info_lenb_uu,
4431
20
        &hf_gtpv2_tra_info_lenb_x2,
4432
20
        &hf_gtpv2_tra_info_lenb_s1_mme,
4433
20
        NULL
4434
20
    };
4435
20
    proto_tree_add_bitmask_list(lenb_tree, tvb, offset, 1, tra_info_lenb_flags, ENC_BIG_ENDIAN);
4436
20
    bit_offset = offset << 3;
4437
20
    proto_tree_add_bits_item(lenb_tree, hf_gtpv2_spare_bits,                tvb, bit_offset, 5, ENC_BIG_ENDIAN);
4438
4439
    /*--------------------------------------------------
4440
     * offset += 1;
4441
     *--------------------------------------------------*/
4442
4443
    /* IP Address of Trace Collection Entity */
4444
352
    while ( (offset + 4) <= length ) {
4445
332
        offset += 1;
4446
332
        proto_tree_add_item(tree, hf_gtpv2_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
4447
332
        offset += 3;
4448
332
    }
4449
20
}
4450
4451
/*
4452
 * 8.33 Paging Cause
4453
 * 8.33 Void (TS 129 274 V9.4.0 (2010-10))
4454
 */
4455
4456
/* 8.35 Procedure Transaction ID (PTI) */
4457
static void
4458
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_)
4459
7
{
4460
7
    proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, ENC_BIG_ENDIAN);
4461
7
}
4462
/*
4463
 * 8.36 DRX Parameter
4464
 */
4465
static void
4466
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_)
4467
2
{
4468
2
    int offset = 0;
4469
4470
    /* 36.413 : 9.2.1.17   Paging Cause, void */
4471
2
    proto_tree_add_item(tree, hf_gtpv2_drx_parameter, tvb, offset, length, ENC_NA);
4472
2
}
4473
4474
/*
4475
 * 8.37 UE Network Capability
4476
 * UE Network Capability is coded as depicted in Figure 8.37-1. Actual coding of the UE Network Capability field is
4477
 * defined in 3GPP TS 24.301
4478
 */
4479
static void
4480
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_)
4481
8
{
4482
8
    de_emm_ue_net_cap(tvb, tree, pinfo, 0, length, NULL, 0);
4483
4484
8
}
4485
/*
4486
 * 8.38 MM Context
4487
 */
4488
static const value_string gtpv2_mm_context_security_mode[] = {
4489
    {0, "GSM Key and Triplets"},
4490
    {1, "UMTS Key, Used Cipher and Quintuplets"},
4491
    {2, "GSM Key, Used Cipher and Quintuplets"},
4492
    {3, "UMTS Key and Quintuplets"},
4493
    {4, "EPS Security Context, Quadruplets and Quintuplets" },
4494
    {5, "UMTS Key, Quadruplets and Quintuplets"},
4495
    {0, NULL                                                                                                    }
4496
};
4497
4498
static const true_false_string gtpv2_nhi_vals = {
4499
    "NH (Next Hop) and NCC (Next Hop Chaining Count) are both present",
4500
    "NH (Next Hop) and NCC (Next Hop Chaining Count) not present",
4501
};
4502
4503
/* Table 8.38-2: Used NAS Cipher Values */
4504
4505
static const value_string gtpv2_mm_context_unc_vals[] = {
4506
    {0, "No ciphering"},
4507
    {1, "128-EEA1"},
4508
    {2, "128-EEA2"},
4509
    {3, "128-EEA3"},
4510
    {4, "EEA4"  },
4511
    {5, "EEA5"},
4512
    {6, "EEA6"},
4513
    {7, "EEA7"},
4514
    {0, NULL}
4515
};
4516
4517
/* Table 8.38-3: Used Cipher Values */
4518
static const value_string gtpv2_mm_context_used_cipher_vals[] = {
4519
    {0, "No ciphering"},
4520
    {1, "GEA/1"},
4521
    {2, "GEA/2"},
4522
    {3, "GEA/3"},
4523
    {4, "GEA/4" },
4524
    {5, "GEA/5"},
4525
    {6, "GEA/6"},
4526
    {7, "GEA/7"},
4527
    {0, NULL}
4528
};
4529
4530
/* Table 8.38-4: Used NAS integrity protection algorithm Values */
4531
static const value_string gtpv2_mm_context_unipa_vals[] = {
4532
    {0, "No integrity protection"},
4533
    {1, "128-EIA1"},
4534
    {2, "128-EIA2"},
4535
    {3, "128-EIA3"},
4536
    {4, "EIA4"  },
4537
    {5, "EIA5"},
4538
    {6, "EIA6"},
4539
    {7, "EIA7"},
4540
    {0, NULL}
4541
};
4542
4543
/* Table 8.38-6: EPS NAS Security Context Type Values */
4544
static const value_string gtpv2_mm_context_eps_nas_security_context_type_vals[] = {
4545
    {0, "Reporting EPS NAS Security Context Type is not supported"},
4546
    {1, "Native EPS NAS Security Context Type"},
4547
    {2, "Mapped EPS NAS Security Context Type"},
4548
    {0, NULL}
4549
};
4550
4551
/* Helper functions */
4552
4553
/* Figure 8.38-7: Authentication Triplet */
4554
static int
4555
dissect_gtpv2_authentication_triplets(tvbuff_t *tvb, proto_tree *tree, int offset, uint8_t num_triplet)
4556
9
{
4557
9
    proto_tree *auth_tri_tree;
4558
9
    int         i;
4559
4560
44
    for (i = 0; i < num_triplet; i++) {
4561
35
        auth_tri_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
4562
35
                ett_gtpv2_mm_context_auth_tri, NULL, "Authentication Triplet %u", i);
4563
        /*
4564
        * Figure 8.38-8: Authentication Quintuplet
4565
        * 1 to 16 RAND
4566
        * 17 to 20 SRES
4567
        * 21 to 28 Kc
4568
        */
4569
35
        proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
4570
35
        offset += 16;
4571
35
        proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_sres, tvb, offset, 4, ENC_NA);
4572
35
        offset += 4;
4573
35
        proto_tree_add_item(auth_tri_tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
4574
35
        offset += 8;
4575
4576
35
    }
4577
4578
9
    return offset;
4579
9
}
4580
4581
static int
4582
dissect_gtpv2_authentication_quintuplets(tvbuff_t *tvb, proto_tree *tree, int offset, uint8_t nr_qui)
4583
22
{
4584
22
    proto_tree *auth_qui_tree;
4585
22
    int         i;
4586
22
    uint32_t     tmp;
4587
4588
69
    for (i = 0; i < nr_qui; i++) {
4589
47
        auth_qui_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
4590
47
            ett_gtpv2_mm_context_auth_qui, NULL, "Authentication Quintuplet %u", i);
4591
        /*
4592
        * Figure 8.38-8: Authentication Quintuplet
4593
        * 1 to 16 RAND
4594
        * 17 XRES Length
4595
        * 18 to m XRES
4596
        * (m+1) to (m+16) CK
4597
        * (m+17) to (m+32) IK
4598
        * m+33 AUTN Length
4599
        * (m+34) to n AUTN
4600
        */
4601
47
        proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
4602
47
        offset += 16;
4603
47
        proto_tree_add_item_ret_uint(auth_qui_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_NA, &tmp);
4604
47
        offset += 1;
4605
47
        proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_xres, tvb, offset, tmp, ENC_NA);
4606
47
        offset += tmp;
4607
47
        proto_tree_add_item(auth_qui_tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
4608
47
        offset += 16;
4609
47
        proto_tree_add_item(auth_qui_tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
4610
47
        offset += 16;
4611
47
        proto_tree_add_item_ret_uint(auth_qui_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_NA, &tmp);
4612
47
        offset += 1;
4613
47
        proto_tree_add_item(auth_qui_tree, hf_gtpv2_mm_context_autn, tvb, offset, tmp, ENC_NA);
4614
47
        offset += tmp;
4615
47
    }
4616
4617
22
    return offset;
4618
4619
22
}
4620
4621
static int
4622
dissect_gtpv2_authentication_quadruplets(tvbuff_t *tvb, proto_tree *tree, int offset, uint8_t nr_qui)
4623
14
{
4624
14
    proto_tree *auth_qua_tree;
4625
14
    uint32_t    tmp;
4626
14
    int         i;
4627
4628
54
    for (i = 0; i < nr_qui; i++) {
4629
40
        auth_qua_tree = proto_tree_add_subtree_format(tree, tvb, offset, 0,
4630
40
            ett_gtpv2_mm_context_auth_qua, NULL, "Authentication Quadruplet %u",i+1);
4631
4632
40
        proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_rand, tvb, offset, 16, ENC_NA);
4633
40
        offset += 16;
4634
4635
40
        proto_tree_add_item_ret_uint(auth_qua_tree, hf_gtpv2_mm_context_xres_len, tvb, offset, 1, ENC_NA, &tmp);
4636
40
        offset++;
4637
4638
40
        proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_xres, tvb, offset, tmp, ENC_NA);
4639
40
        offset += tmp;
4640
4641
40
        proto_tree_add_item_ret_uint(auth_qua_tree, hf_gtpv2_mm_context_autn_len, tvb, offset, 1, ENC_NA, &tmp);
4642
40
        offset++;
4643
4644
40
        proto_tree_add_item(auth_qua_tree, hf_gtpv2_mm_context_autn, tvb, offset, tmp, ENC_NA);
4645
40
        offset += tmp;
4646
4647
40
        proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
4648
4649
40
        offset += 32;
4650
40
    }
4651
14
    return offset;
4652
14
}
4653
4654
static const value_string gtpv2_mm_context_higher_br_16mb_flg_vals[] = {
4655
    {0, "Not allowed"},
4656
    {1, "Allowed"},
4657
    {0, NULL}
4658
};
4659
4660
static int
4661
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)
4662
100
{
4663
100
    proto_tree *net_cap_tree, *msnt_cap_tree;
4664
100
    uint8_t     ue_net_cap_len, ms_net_cap_len, mei_len;
4665
4666
    /*
4667
     * If SAMBRI (Subscribed UE AMBR Indicator), bit 1 of octet 6, is set to "1",
4668
     * then the Uplink/downlink Subscribed UE AMBR parameter field is present,
4669
     */
4670
100
    if (samb_ri) {
4671
        /* j to (j+3) Uplink Subscribed UE AMBR */
4672
16
        proto_tree_add_item(tree, hf_gtpv2_uplink_subscribed_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4673
4674
16
        offset += 4;
4675
        /* (j+4) to (j+7) Downlink Subscribed UE AMBR */
4676
16
        proto_tree_add_item(tree, hf_gtpv2_downlink_subscribed_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4677
4678
16
        offset += 4;
4679
16
    }
4680
    /*
4681
     * If UAMBRI (Used UE AMBR Indicator), bit 2 of octet 6, is set to "1",
4682
     * then the Uplink/downlink Used UE AMBR parameter field is present
4683
     */
4684
100
    if (uamb_ri) {
4685
        /* i to (i+3) Uplink Used UE AMBR  */
4686
13
        proto_tree_add_item(tree, hf_gtpv2_uplink_used_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4687
4688
13
        offset += 4;
4689
        /* (i+4) to (i+7) Downlink Used UE AMBR */
4690
13
        proto_tree_add_item(tree, hf_gtpv2_downlink_used_ue_ambr, tvb, offset, 4, ENC_BIG_ENDIAN);
4691
4692
13
        offset += 4;
4693
13
    }
4694
    /* q Length of UE Network Capability */
4695
100
    ue_net_cap_len = tvb_get_uint8(tvb, offset);
4696
100
    proto_tree_add_item(tree, hf_gtpv2_mm_context_ue_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4697
100
    offset += 1;
4698
    /* (q+1) to k UE Network Capability */
4699
100
    if (ue_net_cap_len) {
4700
        /* The UE Network Capability coding is specified in clause 9.9.3.34 of 3GPP TS 24.301 [23].
4701
         * If Length of UE Network Capability is zero, then the UE Network Capability parameter
4702
         * shall not be present.
4703
         */
4704
38
        net_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ue_net_cap_len,
4705
38
            ett_gtpv2_mm_context_net_cap, NULL, "UE Network Capability");
4706
38
        offset += de_emm_ue_net_cap(tvb, net_cap_tree, pinfo, offset, ue_net_cap_len, NULL, 0);
4707
38
    }
4708
    /* k+1 Length of MS Network Capability */
4709
100
    ms_net_cap_len = tvb_get_uint8(tvb, offset);
4710
100
    proto_tree_add_item(tree, hf_gtpv2_mm_context_ms_net_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4711
100
    offset += 1;
4712
    /* (k+2) to m MS Network Capability
4713
     * The MS Network Capability coding is specified in clause 10.5.5.12 of 3GPP TS 24.008 [5].
4714
     * If Length of MS Network Capability is zero, then the MS Network Capability parameter shall not be present.
4715
     */
4716
100
    if (ms_net_cap_len) {
4717
39
        msnt_cap_tree = proto_tree_add_subtree(tree, tvb, offset, ms_net_cap_len,
4718
39
            ett_gtpv2_ms_network_capability, NULL, "MS network capability");
4719
39
        offset += de_gmm_ms_net_cap(tvb, msnt_cap_tree, pinfo, offset, ms_net_cap_len, NULL, 0);
4720
39
    }
4721
    /* m+1 Length of Mobile Equipment Identity (MEI) */
4722
100
    mei_len = tvb_get_uint8(tvb, offset);
4723
100
    proto_tree_add_item(tree, hf_gtpv2_mm_context_mei_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4724
100
    offset += 1;
4725
    /* (m+2) to r Mobile Equipment Identity (MEI) */
4726
100
    if (mei_len) {
4727
39
        proto_tree_add_item(tree, hf_gtpv2_mei, tvb, offset, mei_len, ENC_BCD_DIGITS_0_9|ENC_LITTLE_ENDIAN);
4728
39
        offset += mei_len;
4729
39
    }
4730
100
    return offset;
4731
100
}
4732
4733
static int
4734
dissect_gtpv2_access_restriction_data(tvbuff_t *tvb, proto_tree *tree, int offset)
4735
37
{
4736
37
    proto_tree *accrstdata_tree;
4737
4738
37
    accrstdata_tree = proto_tree_add_subtree(tree, tvb, offset, 1, ett_gtpv2_access_rest_data, NULL, "Access restriction data");
4739
    /* Spare HNNA ENA INA GANA GENA UNA */
4740
37
    proto_tree_add_bits_item(accrstdata_tree, hf_gtpv2_spare_bits, tvb, (offset << 3), 1, ENC_BIG_ENDIAN);
4741
37
    proto_tree_add_item(accrstdata_tree, hf_gtpv2_hbna, tvb, offset, 1, ENC_BIG_ENDIAN);
4742
37
    proto_tree_add_item(accrstdata_tree, hf_gtpv2_hnna, tvb, offset, 1, ENC_BIG_ENDIAN);
4743
37
    proto_tree_add_item(accrstdata_tree, hf_gtpv2_ena,  tvb, offset, 1, ENC_BIG_ENDIAN);
4744
37
    proto_tree_add_item(accrstdata_tree, hf_gtpv2_ina,  tvb, offset, 1, ENC_BIG_ENDIAN);
4745
37
    proto_tree_add_item(accrstdata_tree, hf_gtpv2_gana, tvb, offset, 1, ENC_BIG_ENDIAN);
4746
37
    proto_tree_add_item(accrstdata_tree, hf_gtpv2_gena, tvb, offset, 1, ENC_BIG_ENDIAN);
4747
37
    proto_tree_add_item(accrstdata_tree, hf_gtpv2_una,  tvb, offset, 1, ENC_BIG_ENDIAN);
4748
37
    offset += 1;
4749
4750
37
    return offset;
4751
37
}
4752
4753
/* Type = 103 (decimal)
4754
 * Figure 8.38-1: GSM Key and Triplets
4755
 */
4756
static void
4757
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_)
4758
17
{
4759
17
    proto_tree *flag_tree;
4760
17
    int         offset;
4761
17
    uint8_t     oct, drxi, num_triplet, uamb_ri, samb_ri;
4762
4763
17
    offset = 0;
4764
17
    flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
4765
4766
    /* Octet 5 */
4767
    /* Security Mode | Spare | DRXI | CKSN */
4768
17
    drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
4769
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm,   tvb, offset,      1, ENC_BIG_ENDIAN);
4770
17
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
4771
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset,      1, ENC_BIG_ENDIAN);
4772
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn, tvb, offset,      1, ENC_BIG_ENDIAN);
4773
17
    offset += 1;
4774
    /* Octet 6 */
4775
    /* Number of Triplet | Spare  | UAMB RI | SAMB RI */
4776
17
    oct = tvb_get_uint8(tvb, offset);
4777
17
    num_triplet = oct >> 5;
4778
17
    uamb_ri = (oct & 0x02) >> 1;
4779
17
    samb_ri = oct & 0x01;
4780
4781
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_tri,       tvb, offset,            1, ENC_BIG_ENDIAN);
4782
17
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits,         tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
4783
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri,      tvb, offset,            1, ENC_BIG_ENDIAN);
4784
17
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
4785
17
    offset += 1;
4786
4787
    /* Octet 7 Spare Used Cipher */
4788
17
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits,         tvb, ((offset << 3)),   5, ENC_BIG_ENDIAN);
4789
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher,  tvb, offset,            1, ENC_BIG_ENDIAN);
4790
17
    offset += 1;
4791
4792
    /* 8 to 15 Kc */
4793
17
    proto_tree_add_item(tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
4794
17
    offset += 8;
4795
4796
    /* 16 to h Authentication Triplet [0..4] */
4797
17
    if (num_triplet) {
4798
9
        dissect_gtpv2_authentication_triplets(tvb, tree, offset, num_triplet);
4799
9
    }
4800
4801
    /*
4802
     * (h+1) to (h+2) DRX parameter
4803
     */
4804
17
    if (drxi) {
4805
4
        proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
4806
4
        offset += 2;
4807
4
    }
4808
4809
    /* Dissect octet j to r */
4810
17
    offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
4811
4812
17
    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");
4813
17
}
4814
4815
/* Type = 104 (decimal)
4816
 * Figure 8.38-2: UMTS Key, Used Cipher and Quintuplets
4817
 */
4818
static void
4819
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_)
4820
12
{
4821
12
    proto_tree *flag_tree;
4822
12
    int         offset;
4823
12
    uint8_t     oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
4824
4825
12
    offset = 0;
4826
12
    flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
4827
4828
    /* Octet 5 */
4829
12
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
4830
12
    drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
4831
12
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
4832
12
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
4833
12
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
4834
12
    offset += 1;
4835
    /* Octet 6 */
4836
12
    oct = tvb_get_uint8(tvb, offset);
4837
12
    nr_qui = oct >> 5;
4838
12
    uamb_ri = (oct & 0x02) >> 1;
4839
12
    samb_ri = oct & 0x01;
4840
12
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
4841
12
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
4842
12
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
4843
12
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
4844
12
    offset += 1;
4845
    /* Octet 7 Spare Used Cipher */
4846
12
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
4847
12
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
4848
12
    offset += 1;
4849
4850
    /* Octet 8 to 23  CK */
4851
12
    proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
4852
12
    offset += 16;
4853
    /* Octet 24 to 39 IK */
4854
12
    proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
4855
12
    offset += 16;
4856
4857
    /*
4858
     * 40 to h Authentication Quintuplet [0..4]
4859
     */
4860
12
    if (nr_qui) {
4861
2
        offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
4862
2
    }
4863
4864
    /*
4865
     * (h+1) to (h+2) DRX parameter
4866
     */
4867
12
    if (drxi) {
4868
3
        proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
4869
3
        offset += 2;
4870
3
    }
4871
4872
4873
    /* Dissect octet j to r */
4874
12
    offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
4875
4876
    /* r+1 Spare HNNA ENA INA GANA GENA UNA
4877
     * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
4878
     * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
4879
     * HNNA(HO-To-Non-3GPPAccess Not Allowed).
4880
     */
4881
12
    if (offset < (int)length) {
4882
4
        offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
4883
8
    } else {
4884
8
        return;
4885
8
    }
4886
4
    if (offset == (int)length) {
4887
0
        return;
4888
0
    }
4889
4890
    /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
4891
4
    vdp_len = tvb_get_uint8(tvb, offset);
4892
4
    proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4893
4
    offset += 1;
4894
    /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
4895
4
    if (vdp_len) {
4896
0
        proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
4897
0
        offset += vdp_len;
4898
0
    }
4899
4900
    /* s+1 Length of Higher bitrates than 16 Mbps flag */
4901
4
    if (offset == (int)length) {
4902
0
        hbr_len = tvb_get_uint8(tvb, offset);
4903
0
        proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4904
0
        offset += 1;
4905
        /* s+2 Higher bitrates than 16 Mbps flag */
4906
0
        if (hbr_len) {
4907
0
            proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
4908
0
            offset += hbr_len;
4909
0
        }
4910
4
    } else {
4911
4
        return;
4912
4
    }
4913
4914
0
    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");
4915
4916
0
}
4917
4918
/* Type = 105 (decimal)
4919
 * Figure 8.38-3: GSM Key, Used Cipher and Quintuplets
4920
 */
4921
static void
4922
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_)
4923
25
{
4924
25
    proto_tree *flag_tree;
4925
25
    int         offset;
4926
25
    uint8_t     oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len;
4927
4928
25
    offset = 0;
4929
25
    flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
4930
4931
    /* Octet 5 */
4932
25
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
4933
25
    drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
4934
25
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
4935
25
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
4936
25
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_cksn_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
4937
25
    offset += 1;
4938
    /* Octet 6 */
4939
25
    oct = tvb_get_uint8(tvb, offset);
4940
25
    nr_qui = oct >> 5;
4941
25
    uamb_ri = (oct & 0x02) >> 1;
4942
25
    samb_ri = oct & 0x01;
4943
25
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
4944
25
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
4945
25
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
4946
25
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
4947
25
    offset += 1;
4948
    /* Octet 7 Spare Used Cipher */
4949
25
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3)), 5, ENC_BIG_ENDIAN);
4950
25
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_used_cipher, tvb, offset, 1, ENC_BIG_ENDIAN);
4951
25
    offset += 1;
4952
    /* 8 to 15 Kc */
4953
25
    proto_tree_add_item(tree, hf_gtpv2_mm_context_kc, tvb, offset, 8, ENC_NA);
4954
25
    offset += 8;
4955
4956
    /*
4957
     * 40 to h Authentication Quintuplet [0..4]
4958
     */
4959
25
    if (nr_qui) {
4960
10
        offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
4961
10
    }
4962
4963
    /*
4964
     * (h+1) to (h+2) DRX parameter
4965
     */
4966
25
    if (drxi) {
4967
6
        proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
4968
6
        offset += 2;
4969
6
    }
4970
4971
4972
    /* Dissect octet j to r */
4973
25
    offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
4974
4975
    /* r+1 Spare HNNA ENA INA GANA GENA UNA
4976
     * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
4977
     * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
4978
     * HNNA(HO-To-Non-3GPPAccess Not Allowed).
4979
     */
4980
25
    if (offset < (int)length) {
4981
6
        offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
4982
19
    } else {
4983
19
        return;
4984
19
    }
4985
6
    if (offset == (int)length) {
4986
0
        return;
4987
0
    }
4988
4989
    /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
4990
6
    vdp_len = tvb_get_uint8(tvb, offset);
4991
6
    proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
4992
6
    offset += 1;
4993
    /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
4994
6
    if (vdp_len) {
4995
3
        proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
4996
3
        offset += vdp_len;
4997
3
    }
4998
4999
    /* s+1 Length of Higher bitrates than 16 Mbps flag */
5000
6
    if (offset < (int)length) {
5001
5
        hbr_len = tvb_get_uint8(tvb, offset);
5002
5
        proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5003
5
        offset += 1;
5004
        /* s+2 Higher bitrates than 16 Mbps flag */
5005
5
        if (hbr_len) {
5006
3
            proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5007
3
            offset += hbr_len;
5008
3
        }
5009
5
    } else {
5010
1
        return;
5011
1
    }
5012
5013
5
    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");
5014
5015
5
}
5016
5017
/* Type = 106 (decimal)
5018
 * Figure 8.38-4: UMTS Key and Quintuplets
5019
 */
5020
static void
5021
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_)
5022
33
{
5023
33
    proto_tree *flag_tree;
5024
33
    int         offset;
5025
33
    uint8_t     oct, drxi, nr_qui, uamb_ri, samb_ri, vdp_len, hbr_len, ear_len;
5026
5027
33
    offset = 0;
5028
33
    flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
5029
5030
    /* Octet 5 */
5031
    /* Security Mode Spare DRXI KSI */
5032
33
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
5033
33
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
5034
33
    drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
5035
33
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
5036
33
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi, tvb, offset, 1, ENC_BIG_ENDIAN);
5037
33
    offset += 1;
5038
    /* Octet 6 */
5039
    /* Number of Quintuplets Spare UAMB RI SAMB RI */
5040
33
    oct = tvb_get_uint8(tvb, offset);
5041
33
    nr_qui = oct >> 5;
5042
33
    uamb_ri = (oct & 0x02) >> 1;
5043
33
    samb_ri = oct & 0x01;
5044
5045
33
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
5046
33
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, (offset << 3) + 3, 3, ENC_BIG_ENDIAN);
5047
33
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
5048
33
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
5049
33
    offset += 1;
5050
    /* Octet 7 Spare */
5051
33
    proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5052
33
    offset += 1;
5053
    /* Octet 8 to 23  CK */
5054
33
    proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
5055
33
    offset += 16;
5056
    /* Octet 24 to 39 IK */
5057
33
    proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
5058
33
    offset += 16;
5059
5060
    /*
5061
     * 40 to h Authentication Quintuplet [0..4]
5062
     */
5063
33
    if (nr_qui) {
5064
2
        offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
5065
2
    }
5066
5067
    /*
5068
     * (h+1) to (h+2) DRX parameter
5069
     */
5070
33
    if (drxi) {
5071
12
        proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
5072
12
        offset += 2;
5073
12
    }
5074
5075
5076
    /* Dissect octet j to r */
5077
33
    offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
5078
5079
    /* r+1 Spare HNNA ENA INA GANA GENA UNA
5080
     * The Access restriction data is composed of UNA(UTRAN Not Allowed), GENA(GERAN Not Allowed),
5081
     * GANA(GAN Not Allowed), INA(I-HSPA-Evolution Not Allowed), ENA(E-UTRAN Not Allowed) and
5082
     * HNNA(HO-To-Non-3GPPAccess Not Allowed).
5083
     */
5084
33
    if (offset < (int)length) {
5085
11
        offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
5086
22
    } else {
5087
22
        return;
5088
22
    }
5089
11
    if (offset == (int)length) {
5090
0
        return;
5091
0
    }
5092
5093
    /* r+2 Length of Voice Domain Preference and UE's Usage Setting */
5094
11
    vdp_len = tvb_get_uint8(tvb, offset);
5095
11
    proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5096
11
    offset += 1;
5097
    /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
5098
11
    if (vdp_len) {
5099
8
        proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
5100
8
        offset += vdp_len;
5101
8
    }
5102
5103
    /* s+1 Length of Higher bitrates than 16 Mbps flag */
5104
11
    if (offset < (int)length) {
5105
8
        hbr_len = tvb_get_uint8(tvb, offset);
5106
8
        proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5107
8
        offset += 1;
5108
        /* s+2 Higher bitrates than 16 Mbps flag */
5109
8
        if (hbr_len) {
5110
5
            proto_tree_add_item(tree, hf_gtpv2_mm_context_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5111
5
            offset += hbr_len;
5112
5
        }
5113
8
    } else {
5114
3
        return;
5115
3
    }
5116
5117
    /* s+3    IOV_updates counter */
5118
8
    if (offset < (int)length) {
5119
7
        proto_tree_add_item(tree, hf_gtpv2_mm_context_iov_updates_counter, tvb, offset, 1, ENC_BIG_ENDIAN);
5120
7
        offset += 1;
5121
7
    } else {
5122
1
        return;
5123
1
    }
5124
    /* s+4    Length of Extended Access Restriction Data */
5125
7
    if (offset < (int)length) {
5126
5
        ear_len = tvb_get_uint8(tvb, offset);
5127
5
        proto_tree_add_item(tree, hf_gtpv2_mm_context_ear_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5128
5
        offset += 1;
5129
5
        static int * const ear_flags[] = {
5130
5
            &hf_gtpv2_mm_context_nrsrna,
5131
5
            NULL
5132
5
        };
5133
5
        proto_tree_add_bitmask_list(tree, tvb, offset, 1, ear_flags, ENC_BIG_ENDIAN);
5134
5
        offset += 1;
5135
5
        if (ear_len > 1) {
5136
3
            proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
5137
3
            offset += ear_len - 1;
5138
3
        }
5139
5
    } else {
5140
2
        return;
5141
2
    }
5142
5143
5
    if (offset == (int)length) {
5144
0
        return;
5145
0
    }
5146
    /* ts+1) to (n+4) These octet(s) is/are present only if explicitly specified */
5147
5
    proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
5148
5149
5
}
5150
5151
/* 8.38 MM Context
5152
 * Type = 107 (decimal)
5153
 * Figure 8.38-5: EPS Security Context and Quadruplets
5154
 */
5155
static void
5156
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_)
5157
21
{
5158
21
    proto_item *qua_item, *qui_item;
5159
21
    proto_tree *flag_tree, *qua_tree, *qui_tree, *sc_tree;
5160
21
    int         offset;
5161
21
    uint8_t     tmp, nhi, drxi, nr_qua, nr_qui, uamb_ri, osci, samb_ri, vdp_len;
5162
21
    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;
5163
5164
21
    offset = 0;
5165
5166
21
    flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
5167
5168
    /* Octet 5
5169
     * Bits
5170
     * 8      7     6     5     4      3      2      1
5171
     * Security Mode    | NHI | DRXI | KSIASME
5172
     */
5173
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
5174
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nhi, tvb, offset, 1, ENC_BIG_ENDIAN);
5175
    /* If NHI (Next Hop Indicator), bit 5 of octet 5, is set to "1",
5176
     * then the optional parameters NH (Next Hop) and NCC (Next
5177
     * Hop Chaining Count) are both present, otherwise their octets are not present.
5178
     */
5179
21
    tmp = tvb_get_uint8(tvb, offset);
5180
21
    nhi = (tmp & 0x10) >> 4;
5181
21
    drxi = (tmp & 0x08) >> 3;
5182
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
5183
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
5184
21
    offset += 1;
5185
5186
    /* Octet 6
5187
     * Bits
5188
     * 8      7     6     5     4      3      2      1
5189
     * Number of        | Number of       | UAMB  | OSCI
5190
     * Quintuplets      | Quadruplet      |  RI   |
5191
     */
5192
21
    tmp = tvb_get_uint8(tvb, offset);
5193
21
    nr_qui = (tmp & 0xe0) >> 5;
5194
21
    nr_qua = tmp & 0x1c;
5195
21
    nr_qua >>= 2;
5196
21
    uamb_ri = (tmp & 0x2) >> 1;
5197
21
    osci = tmp & 1;
5198
5199
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
5200
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
5201
    /* UAMB RI */
5202
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
5203
    /* OSCI */
5204
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_osci, tvb, offset, 1, ENC_BIG_ENDIAN);
5205
21
    offset += 1;
5206
5207
    /* Octet 7 SAMB RI Used NAS integrity protection algorithm Used NAS Cipher*/
5208
    /* SAMB RI */
5209
21
    samb_ri = tvb_get_uint8(tvb, offset) >> 7;
5210
21
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, offset << 3, 1, ENC_BIG_ENDIAN);
5211
    /* Used NAS integrity protection algorithm */
5212
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unipa, tvb, offset, 1, ENC_BIG_ENDIAN);
5213
    /* Used NAS Cipher */
5214
21
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_unc, tvb, offset, 1, ENC_BIG_ENDIAN);
5215
21
    offset += 1;
5216
5217
    /* Octet 8-10 NAS Downlink Count*/
5218
21
    proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_dl_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
5219
21
    offset += 3;
5220
5221
    /* Octet 11-13 NAS Uplink Count */
5222
21
    proto_tree_add_item(tree, hf_gtpv2_mm_context_nas_ul_cnt, tvb, offset, 3, ENC_BIG_ENDIAN);
5223
21
    offset += 3;
5224
5225
    /* Octet 14-45 */
5226
21
    proto_tree_add_item(tree, hf_gtpv2_mm_context_kasme, tvb, offset, 32, ENC_NA);
5227
21
    offset += 32;
5228
5229
21
    qua_item = proto_tree_add_uint(tree, hf_gtpv2_authentication_quadruplets, tvb, offset, 0, nr_qua);
5230
21
    if ( nr_qua ){
5231
6
        qua_tree = proto_item_add_subtree(qua_item, ett_gtpv2_qua);
5232
6
        offset = dissect_gtpv2_authentication_quadruplets(tvb, qua_tree, offset, nr_qua);
5233
15
    }else {
5234
15
        proto_item_set_generated(qua_item);
5235
15
    }
5236
5237
21
    qui_item = proto_tree_add_uint(tree, hf_gtpv2_authentication_quintuplets, tvb, offset, 0, nr_qui);
5238
21
    if (nr_qui) {
5239
4
        qui_tree = proto_item_add_subtree(qui_item, ett_gtpv2_qui);
5240
4
        offset = dissect_gtpv2_authentication_quintuplets(tvb, qui_tree, offset, nr_qui);
5241
17
    }else{
5242
17
        proto_item_set_generated(qui_item);
5243
17
    }
5244
5245
    /* (h+1) to (h+2) DRX parameter */
5246
21
    if (drxi) {
5247
3
        proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
5248
3
        offset += 2;
5249
3
    }
5250
5251
    /* Octet p to p+31 & Octet p+32 */
5252
21
    if ( nhi )
5253
2
    {
5254
2
        proto_tree_add_item(tree, hf_gtpv2_mm_context_nh, tvb, offset, 32, ENC_NA);
5255
2
        offset += 32;
5256
5257
2
        proto_tree_add_item(tree, hf_gtpv2_mm_context_ncc, tvb, offset, 1, ENC_BIG_ENDIAN);
5258
2
        offset += 1;
5259
2
    }
5260
5261
5262
    /* Dissect octet j to r */
5263
21
    offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
5264
5265
    /* r+1 Spare HBNA HNNA ENA INA GANA GENA UNA */
5266
21
    if (offset < (int)length) {
5267
12
        offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
5268
12
    } else {
5269
9
        return;
5270
9
    }
5271
5272
12
    if (offset == (int)length) {
5273
0
        return;
5274
0
    }
5275
5276
    /* the fields for the Old EPS Security Context (i.e. octets from s to s+64)
5277
     * may be present only in S10 Forward Relocation Request message according to
5278
     * the Rules on Concurrent Running of Security Procedures, which are specified in 3GPP TS 33.401 [12].
5279
     * The octets for Old EPS Security Context shall be present if the OSCI (Old Security Context Indicator),
5280
     * bit 1 of octet 6) is set to "1"; otherwise they shall not be present.
5281
     */
5282
12
    if (osci == 1) {
5283
        /* s */
5284
        /* If NHI_old (Next Hop Indicator for old EPS Security Context), bit 1 of octet s, is set to "1",
5285
         * then the parameters old NH (Next Hop) and old NCC (Next Hop Chaining Count) shall be present;
5286
         * otherwise the octets for old NH parameter shall not be present and the value of old NCC parameter
5287
         * shall be ignored by the receiver
5288
         */
5289
        /* NHI_old Spare old KSIASME old NCC*/
5290
3
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_contex_nhi_old, tvb, offset, 1, ENC_BIG_ENDIAN, &dword);
5291
3
        proto_tree_add_item(tree, hf_gtpv2_mm_context_old_ksiasme, tvb, offset, 1, ENC_BIG_ENDIAN);
5292
3
        proto_tree_add_item(tree, hf_gtpv2_mm_context_old_ncc, tvb, offset, 1, ENC_BIG_ENDIAN);
5293
3
        offset++;
5294
        /* (s+1) to (s+32) old KASME */
5295
3
        proto_tree_add_item(tree, hf_gtpv2_mm_context_old_kasme, tvb, offset, 32, ENC_NA);
5296
3
        offset += 32;
5297
        /* (s+33) to (s+64) old NH */
5298
3
        if (dword) {
5299
0
            proto_tree_add_item(tree, hf_gtpv2_mm_context_old_nh, tvb, offset, 32, ENC_NA);
5300
0
            offset += 32;
5301
0
        }
5302
3
    }
5303
5304
12
    if (offset == (int)length) {
5305
0
        return;
5306
0
    }
5307
5308
    /* w Length of Voice Domain Preference and UE's Usage Setting */
5309
12
    vdp_len = tvb_get_uint8(tvb, offset);
5310
12
    proto_tree_add_item(tree, hf_gtpv2_mm_context_vdp_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5311
12
    offset += 1;
5312
    /* (r+3) to s Voice Domain Preference and UE's Usage Setting */
5313
12
    if (vdp_len) {
5314
6
        proto_tree_add_item(tree, hf_gtpv2_voice_domain_and_ue_usage_setting, tvb, offset, vdp_len, ENC_NA);
5315
6
        offset += vdp_len;
5316
6
    }
5317
5318
12
    if (offset == (int)length) {
5319
0
        return;
5320
0
    }
5321
5322
    /* (t+1) to (t+2) Length of UE Radio Capability for Paging information*/
5323
12
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_paging_len, tvb, offset, 2, ENC_BIG_ENDIAN, &paging_len);
5324
12
    offset += 2;
5325
5326
12
    if (paging_len > 0) {
5327
4
        proto_tree_add_item(tree, hf_gtpv2_ue_radio_capability_for_paging_information, tvb, offset, paging_len, ENC_NA);
5328
4
        offset +=paging_len;
5329
4
    }
5330
5331
12
    if (offset == (int)length) {
5332
0
        return;
5333
0
    }
5334
5335
    /*(u+1) Length of Extended Access Restriction Data */
5336
12
    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);
5337
12
    offset += 1;
5338
5339
    /*(u+2) to v
5340
     *8      7     6     5     4      3      2      1
5341
     *            spare               |    USSRNA | NRSRNA
5342
     */
5343
12
    if(ex_access_res_data_len > 0){
5344
3
        static int* const ear_flags[] = {
5345
3
            &hf_gtpv2_spare_b7_b5,
5346
3
            &hf_gtpv2_mm_context_nruna,
5347
3
            &hf_gtpv2_mm_context_nrusrna,
5348
3
            &hf_gtpv2_mm_context_nrna,
5349
3
            &hf_gtpv2_mm_context_ussrna,
5350
3
            &hf_gtpv2_mm_context_nrsrna,
5351
3
            NULL
5352
3
        };
5353
3
        proto_tree_add_bitmask_list(tree, tvb, offset, 1, ear_flags, ENC_BIG_ENDIAN);
5354
5355
3
        offset += 1;
5356
3
        if (ex_access_res_data_len > 1) {
5357
2
            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");
5358
2
            offset += ex_access_res_data_len - 1;
5359
2
        }
5360
3
    }
5361
5362
12
    if (offset == (int)length) {
5363
0
        return;
5364
0
    }
5365
5366
    /*
5367
    * The UE additional security capability coding is specified in clause 9.9.3.53 of 3GPP TS 24.301 [23].
5368
    * 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.
5369
    */
5370
    /*(v+1) Length of UE additional security capability*/
5371
12
    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);
5372
12
    offset += 1;
5373
5374
    /*(v+2) to x UE additional security capability*/
5375
12
    if(ue_add_sec_cap_len > 0){
5376
3
        sc_tree = proto_tree_add_subtree(tree, tvb, offset, ue_add_sec_cap_len, ett_gtpv2_mm_context_sc, NULL, "UE additional Security Capability");
5377
3
        offset += de_emm_ue_add_sec_cap(tvb, sc_tree, NULL, offset, ue_add_sec_cap_len, NULL, 0);
5378
3
    }
5379
5380
12
    if (offset == (int)length) {
5381
0
        return;
5382
0
    }
5383
5384
    /* x+1 Length of UE NR security capability */
5385
12
    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);
5386
12
    offset += 1;
5387
    /* The UE NR security capability coding is specified in clause 9.8.3.57 of 3GPP TS 24.501.
5388
     * If Length of UE NR security capability is zero, then the field UE NR security capability in octets
5389
     "(x+2) to y" shall not be present.
5390
     */
5391
12
    if (ue_nr_sec_cap_len) {
5392
        /* (x+2) to y UE NR security capability */
5393
        /* The UE NR security capability coding is specified in clause 9.8.3.57 of 3GPP TS 24.501 */
5394
3
        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");
5395
3
        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");
5396
3
        offset += ue_nr_sec_cap_len;
5397
3
    }
5398
5399
12
    if (offset == (int)length) {
5400
0
        return;
5401
0
    }
5402
5403
    /* (y+1) to (y+2) Length of APN Rate Control Statuses */
5404
12
    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);
5405
12
    offset += 2;
5406
12
    if (apn_rte_ctrl_sts_len) {
5407
        /* (y+3) to l APN Rate Control Status [1..z] */
5408
3
        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");
5409
3
        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");
5410
3
        offset += apn_rte_ctrl_sts_len;
5411
3
    }
5412
12
    if (offset == (int)length) {
5413
0
        return;
5414
0
    }
5415
5416
    /* (l+1)  Length of Core Network Restrictions */
5417
12
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_cnr_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ie_len);
5418
12
    offset += 1;
5419
12
    if (ie_len) {
5420
        /* (l+2) to (l+5)    Core Network Restrictions */
5421
        /* The Core Network Restrictions coding is specified in clause 7.2.230 of 3GPP TS 29.272 [70].
5422
           If Length of Core Network Restrictions is zero, then the field of Core Network Restrictions
5423
           in octets "(l+2) to (l+5)" shall not be present.
5424
         */
5425
0
        tvbuff_t *new_tvb = tvb_new_subset_length(tvb, offset, ie_len);
5426
0
        dissect_diameter_3gpp_core_network_restrictions(new_tvb, pinfo, tree, NULL);
5427
0
        offset += ie_len;
5428
0
    }
5429
5430
12
    if (offset == (int)length) {
5431
0
        return;
5432
0
    }
5433
5434
    /* (l+6)  Length of UE Radio Capability ID */
5435
12
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_mm_context_ue_radio_cap_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ie_len);
5436
12
    offset += 1;
5437
12
    if (ie_len) {
5438
        /* (l+7) to z UE Radio Capability ID
5439
         * The UE Radio Capability ID is specified in the clause 9.9.3.60 of 3GPP TS24.301
5440
         */
5441
1
        de_nas_5gs_mm_ue_radio_cap_id(tvb, tree, pinfo, offset, ie_len, NULL, 0);
5442
1
        offset += ie_len;
5443
1
    }
5444
5445
12
    if (offset == (int)length) {
5446
0
        return;
5447
0
    }
5448
5449
    /*(a) ENSCT */
5450
12
    proto_tree_add_item(tree, hf_gtpv2_mm_context_ensct, tvb, offset, 1, ENC_BIG_ENDIAN);
5451
12
    offset += 1;
5452
5453
12
    if (offset < (int)length){
5454
3
        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");
5455
3
    }
5456
12
}
5457
5458
/*
5459
 * Type = 108 (decimal)
5460
 * Figure 8.38-6: UMTS Key, Quadruplets and Quintuplets
5461
 */
5462
static void
5463
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_)
5464
17
{
5465
17
    proto_tree *flag_tree;
5466
17
    uint32_t    offset;
5467
17
    uint8_t     tmp, drxi, nr_qua, nr_qui, uamb_ri, samb_ri, vdp_length;
5468
5469
17
    offset = 0;
5470
17
    flag_tree = proto_tree_add_subtree(tree, tvb, offset, 3, ett_gtpv2_mm_context_flag, NULL, "MM Context flags");
5471
5472
    /* Octet 5
5473
     * Security Mode Spare DRXI KSIASME
5474
     */
5475
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_sm, tvb, offset, 1, ENC_BIG_ENDIAN);
5476
17
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_spare_bits, tvb, ((offset << 3) + 3), 1, ENC_BIG_ENDIAN);
5477
17
    drxi = (tvb_get_uint8(tvb, offset) & 0x08) >> 3;
5478
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_drxi, tvb, offset, 1, ENC_BIG_ENDIAN);
5479
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_ksi_a, tvb, offset, 1, ENC_BIG_ENDIAN);
5480
17
    offset += 1;
5481
5482
    /* Octet 6
5483
     * Bits
5484
     * 8      7     6     5     4      3      2      1
5485
     * Number of        | Number of       | UAMB  | SAMB
5486
     * Quintuplets      | Quadruplet      |  RI   |  RI
5487
     */
5488
17
    tmp = tvb_get_uint8(tvb, offset);
5489
17
    nr_qui = (tmp & 0xe0) >> 5;
5490
17
    nr_qua = tmp & 0x1c;
5491
17
    nr_qua >>= 2;
5492
17
    uamb_ri = (tmp & 0x2) >> 1;
5493
17
    samb_ri = tmp & 0x01;
5494
5495
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qui, tvb, offset, 1, ENC_BIG_ENDIAN);
5496
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_nr_qua, tvb, offset, 1, ENC_BIG_ENDIAN);
5497
17
    proto_tree_add_item(flag_tree, hf_gtpv2_mm_context_uamb_ri, tvb, offset, 1, ENC_BIG_ENDIAN);
5498
17
    proto_tree_add_bits_item(flag_tree, hf_gtpv2_mm_context_samb_ri, tvb, (offset << 3) + 7, 1, ENC_BIG_ENDIAN);
5499
17
    offset += 1;
5500
    /* Octet 7 Spare */
5501
17
    proto_tree_add_item(flag_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
5502
17
    offset += 1;
5503
    /* Octet 8 to 23  CK */
5504
17
    proto_tree_add_item(tree, hf_gtpv2_ck, tvb, offset, 16, ENC_NA);
5505
17
    offset += 16;
5506
    /* Octet 24 to 39 IK */
5507
17
    proto_tree_add_item(tree, hf_gtpv2_ik, tvb, offset, 16, ENC_NA);
5508
17
    offset += 16;
5509
5510
17
    if ( nr_qua ) {
5511
8
        offset = dissect_gtpv2_authentication_quadruplets(tvb, tree, offset, nr_qua);
5512
8
    }
5513
5514
17
    if (nr_qui) {
5515
4
        offset = dissect_gtpv2_authentication_quintuplets(tvb, tree, offset, nr_qui);
5516
4
    }
5517
5518
    /* (h+1) to (h+2) DRX parameter */
5519
17
    if (drxi) {
5520
3
        proto_tree_add_item(tree, hf_gtpv2_mm_context_drx, tvb, offset, 2, ENC_BIG_ENDIAN);
5521
3
        offset += 2;
5522
3
    }
5523
5524
    /* Dissect octet j to r */
5525
17
    offset = dissect_gtpv2_mm_context_common_data(tvb, pinfo, tree, offset, samb_ri, uamb_ri);
5526
5527
17
    if (offset >= (uint32_t)length) {
5528
2
        return;
5529
2
    }
5530
    /* r+1 Spare HBNA HNNA ENA INA GANA GENA UNA */
5531
15
    offset = dissect_gtpv2_access_restriction_data(tvb, tree, offset);
5532
5533
15
    if (offset >= (uint32_t)length) {
5534
0
        return;
5535
0
    }
5536
5537
    /* 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
5538
     * Length of Voice Domain Preference and UE's Usage Setting is zero, then the Voice Domain Preference and UE's Usage
5539
     * Setting parameter shall not be present.
5540
     */
5541
    /* r+2 */
5542
15
    vdp_length = tvb_get_uint8(tvb, offset);
5543
15
    proto_tree_add_item(tree, hf_gtpv2_vdp_length, tvb, offset, 1, ENC_BIG_ENDIAN);
5544
15
    offset++;
5545
5546
15
    if(vdp_length !=0){
5547
2
        offset += de_gmm_voice_domain_pref(tvb, tree, pinfo, offset, vdp_length, NULL, 0);
5548
2
    }
5549
5550
15
    if (offset < (uint32_t)length) {
5551
3
        proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
5552
3
    }
5553
5554
15
}
5555
5556
/*
5557
  * 8.39 PDN Connection (grouped IE)
5558
 */
5559
static void
5560
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_)
5561
5
{
5562
5
    int         offset = 0;
5563
5
    proto_tree *grouped_tree;
5564
5
    tvbuff_t   *new_tvb;
5565
5566
5
    proto_item_append_text(item, "[Grouped IE]");
5567
5
    grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
5568
5
    new_tvb = tvb_new_subset_length(tvb, offset, length);
5569
5570
5
    dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_PDN_CONNECTION);
5571
5
}
5572
/*
5573
 * 8.40 PDU Numbers
5574
 */
5575
static void
5576
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_)
5577
4
{
5578
4
    proto_item *nsapi_ti;
5579
4
    proto_tree *nsapi_tree;
5580
4
    uint8_t     nsapi;
5581
4
    int         offset = 0;
5582
5583
4
    nsapi = (tvb_get_uint8(tvb, offset) & 0x08);
5584
4
    nsapi_ti = proto_tree_add_item(tree, hf_gtpv2_nsapi08, tvb, offset, 1, ENC_BIG_ENDIAN);
5585
4
    nsapi_tree = proto_item_add_subtree(nsapi_ti, ett_gtpv2_pdn_numbers_nsapi);
5586
4
    proto_tree_add_bits_item(nsapi_tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
5587
4
    proto_tree_add_item(nsapi_tree, hf_gtpv2_pdn_numbers_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
5588
4
    proto_item_append_text(item, "NSAPI: %u", nsapi);
5589
4
    offset += 1;
5590
5591
4
    proto_tree_add_item(tree, hf_gtpv2_dl_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5592
4
    offset += 2;
5593
5594
4
    proto_tree_add_item(tree, hf_gtpv2_ul_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5595
4
    offset += 2;
5596
5597
4
    proto_tree_add_item(tree, hf_gtpv2_send_n_pdu_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5598
4
    offset += 2;
5599
5600
4
    proto_tree_add_item(tree, hf_gtpv2_receive_n_pdu_number, tvb, offset, 2, ENC_BIG_ENDIAN);
5601
4
}
5602
5603
/*
5604
 * 8.41 Packet TMSI (P-TMSI)
5605
 */
5606
static void
5607
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_)
5608
20
{
5609
20
    int offset = 0;
5610
20
    proto_item* ti;
5611
5612
    /* The TMSI consists of 4 octets. It can be coded using a full hexadecimal representation. */
5613
20
    proto_tree_add_item(tree, hf_gtpv2_p_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
5614
20
    ti = proto_tree_add_item(tree, hf_3gpp_tmsi, tvb, offset, 4, ENC_BIG_ENDIAN);
5615
20
    proto_item_set_hidden(ti);
5616
20
    proto_item_append_text(item, "%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 4));
5617
20
}
5618
5619
/*
5620
 * 8.42 P-TMSI Signature
5621
 */
5622
static void
5623
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_)
5624
1
{
5625
1
    int offset = 0;
5626
5627
    /* The P-TMSI Signature consists of 3 octets and may be allocated by the SGSN. */
5628
1
    proto_tree_add_item(tree, hf_gtpv2_p_tmsi_sig, tvb, offset, 3, ENC_BIG_ENDIAN);
5629
1
    proto_item_append_text(item, "%s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 3));
5630
5631
1
}
5632
5633
/*
5634
 * 8.43 Hop Counter
5635
 */
5636
static void
5637
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_)
5638
4
{
5639
4
    int    offset = 0;
5640
4
    uint8_t hop_counter;
5641
5642
4
    hop_counter = tvb_get_uint8(tvb, offset);
5643
5644
4
    proto_tree_add_item(tree, hf_gtpv2_hop_counter, tvb, offset, 1, ENC_BIG_ENDIAN);
5645
4
    proto_item_append_text(item, "%d", hop_counter);
5646
4
}
5647
5648
/*
5649
 * 8.44 UE Time Zone
5650
 */
5651
5652
static const value_string gtpv2_ue_time_zone_dst_vals[] = {
5653
    {0, "No Adjustments for Daylight Saving Time"},
5654
    {1, "+1 Hour Adjustments for Daylight Saving Time"},
5655
    {2, "+2 Hour Adjustments for Daylight Saving Time"},
5656
    {3, "Spare"},
5657
    {0, NULL}
5658
};
5659
static void
5660
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_)
5661
8
{
5662
8
    int offset = 0;
5663
5664
    /*
5665
     * UE Time Zone is used to indicate the offset between universal time and local time in steps of 15 minutes of where the
5666
     * UE currently resides. The "Time Zone" field uses the same format as the "Time Zone" IE in 3GPP TS 24.008 [5].
5667
     * (packet-gsm_a_dtap.c)
5668
     */
5669
8
    de_time_zone(tvb, tree, pinfo, offset, 1, NULL, 0);
5670
8
    offset += 1;
5671
8
    proto_tree_add_item(item, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, ENC_BIG_ENDIAN);
5672
8
}
5673
5674
/*
5675
 * 8.45 Trace Reference
5676
 */
5677
static void
5678
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_)
5679
1
{
5680
1
    int      offset = 0;
5681
1
    uint32_t trace_id;
5682
1
    char    *mcc_mnc_str;
5683
5684
1
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, true);
5685
1
    offset += 3;
5686
5687
1
    trace_id = tvb_get_ntohs(tvb, offset);
5688
1
    proto_tree_add_item(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN);
5689
5690
1
    proto_item_append_text(item, "%s,Trace ID %u", mcc_mnc_str, trace_id);
5691
1
}
5692
/*
5693
 * 8.46 Complete Request Message
5694
 */
5695
static const value_string gtpv2_complete_req_msg_type_vals[] = {
5696
    {0, "Complete Attach Request Message"  },
5697
    {1, "Complete TAU Request Message"     },
5698
    {0, NULL                               }
5699
};
5700
static void
5701
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_)
5702
10
{
5703
10
    tvbuff_t  *new_tvb;
5704
10
    int        offset;
5705
5706
10
    offset = 0;
5707
5708
10
    proto_tree_add_item(tree, hf_gtpv2_complete_req_msg_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5709
5710
10
    offset += 1;
5711
5712
    /* Add the Complete Request Message */
5713
10
    new_tvb = tvb_new_subset_length(tvb, offset, length-1);
5714
10
    call_dissector(nas_eps_handle, new_tvb, pinfo, tree);
5715
5716
10
}
5717
5718
/*
5719
 * 8.47 GUTI
5720
 */
5721
static void
5722
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_)
5723
2
{
5724
2
    int offset = 0;
5725
5726
2
    offset = 0;
5727
5728
2
    dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
5729
2
    offset += 3;
5730
5731
2
    proto_tree_add_item(tree, hf_gtpv2_mme_grp_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5732
2
    offset += 2;
5733
5734
2
    proto_tree_add_item(tree, hf_gtpv2_mme_code, tvb, offset, 1, ENC_BIG_ENDIAN);
5735
2
    offset += 1;
5736
5737
2
    proto_tree_add_item(tree, hf_gtpv2_m_tmsi, tvb, offset, 4, ENC_NA);
5738
2
}
5739
5740
/*
5741
 * 8.48 Fully Qualified Container (F-Container)
5742
 */
5743
5744
static const value_string gtpv2_container_type_vals[] = {
5745
    {1, "UTRAN transparent container"},
5746
    {2, "BSS container"},
5747
    {3, "E-UTRAN transparent container"},
5748
    {4, "NBIFOM Container"},
5749
    {5, "EN-DC Container"},
5750
    {6, "Inter-System SON Container"},
5751
    {0, NULL}
5752
};
5753
5754
5755
static void
5756
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_)
5757
46
{
5758
46
    tvbuff_t   *new_tvb;
5759
46
    proto_tree *sub_tree;
5760
46
    int         offset = 0;
5761
46
    uint32_t     container_type;
5762
46
    uint8_t     container_flags, xid_len;
5763
5764
    /* Octets   8   7   6   5   4   3   2   1
5765
     * 5            Spare     | Container Type
5766
     */
5767
46
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_container_type, tvb, offset, 1, ENC_BIG_ENDIAN, &container_type);
5768
46
    offset += 1;
5769
46
    length--;
5770
46
    if (length == 0) {
5771
0
        expert_add_info(pinfo, item, &ei_gtpv2_ie_len_invalid);
5772
0
        return;
5773
0
    }
5774
46
    if (   (message_type == GTPV2_FORWARD_RELOCATION_REQ)
5775
4
        || (message_type == GTPV2_CONTEXT_RESPONSE)
5776
42
        || (message_type == GTPV2_RAN_INFORMATION_RELAY)) {
5777
42
        switch (container_type) {
5778
18
        case 1:
5779
            /* UTRAN transparent container (1)
5780
             * Contains the "Source to Target
5781
             * Transparent Container", if the message is used for PS
5782
             * handover to UTRAN Iu mode procedures, SRNS relocation
5783
             * procedure and E-UTRAN to UTRAN inter RAT handover
5784
             * procedure.
5785
             */
5786
18
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_utran_con, NULL, "UTRAN transparent container");
5787
18
            new_tvb = tvb_new_subset_length(tvb, offset, length);
5788
18
            dissect_ranap_Source_ToTarget_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5789
18
            return;
5790
0
        case 2:
5791
            /* BSS container */
5792
0
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_bss_con, NULL, "BSS container");
5793
            /* The flags PFI, RP, SAPI and PHX in octet 6 indicate the corresponding type of parameter */
5794
0
            proto_tree_add_item(sub_tree, hf_gtpv2_bss_container_phx, tvb, offset, 1, ENC_BIG_ENDIAN);
5795
0
            proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5796
0
            proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5797
0
            proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5798
0
            container_flags = tvb_get_uint8(tvb, offset);
5799
0
            offset += 1;
5800
0
            if ((container_flags & 0x01) == 1) {
5801
                /* Packet Flow ID present */
5802
0
                proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_pfi, tvb, offset, 1, ENC_BIG_ENDIAN);
5803
0
                offset += 1;
5804
0
            }
5805
0
            if (((container_flags & 0x04) == 4) || ((container_flags & 0x02) == 2)) {
5806
0
                if ((container_flags & 0x04) == 4) {
5807
                    /* SAPI present */
5808
0
                    proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_sapi, tvb, offset, 1, ENC_BIG_ENDIAN);
5809
0
                }
5810
0
                if ((container_flags & 0x02) == 2) {
5811
                    /* Radio Priority present */
5812
0
                    proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_rp, tvb, offset, 1, ENC_BIG_ENDIAN);
5813
0
                }
5814
0
                offset += 1;
5815
0
            }
5816
0
            if ((container_flags & 0x08) == 8) {
5817
                /* XiD parameters length is present in Octet c.
5818
                 * XiD parameters are present in Octet d to n.
5819
                 */
5820
0
                xid_len = tvb_get_uint8(tvb, offset);
5821
0
                proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid_len, tvb, offset, 1, ENC_BIG_ENDIAN);
5822
0
                offset += 1;
5823
0
                proto_tree_add_item(sub_tree, hf_gtpv2_bss_con_xid, tvb, offset, xid_len, ENC_NA);
5824
0
            }
5825
0
            return;
5826
23
        case 3:
5827
            /* E-UTRAN transparent container
5828
            * This IE shall be included to contain the "Source to Target
5829
            * Transparent Container", if the message is used for
5830
            * UTRAN/GERAN to E-UTRAN inter RAT handover
5831
            * procedure, E-UTRAN intra RAT handover procedure and
5832
            * 3G SGSN to MME combined hard handover and SRNS
5833
            * relocation procedure. The Container Type shall be set to 3.
5834
            */
5835
23
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_eutran_con, NULL, "E-UTRAN transparent container");
5836
23
            new_tvb = tvb_new_subset_length(tvb, offset, length);
5837
23
            dissect_s1ap_SourceeNB_ToTargeteNB_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5838
23
            return;
5839
1
        default:
5840
1
            break;
5841
42
        }
5842
42
    }
5843
5
    if (message_type == GTPV2_FORWARD_CTX_NOTIFICATION) {
5844
2
        switch (container_type) {
5845
1
        case 3:
5846
            /* E-UTRAN transparent container */
5847
1
            new_tvb = tvb_new_subset_length(tvb, offset, length);
5848
1
            dissect_s1ap_ENB_StatusTransfer_TransparentContainer_PDU(new_tvb, pinfo, tree, NULL);
5849
1
            return;
5850
1
        default:
5851
1
            break;
5852
2
        }
5853
2
    }
5854
4
    if (message_type == GTPV2_FORWARD_RELOCATION_RESP) {
5855
5856
    /* 7.3.2 Forward Relocation Response */
5857
0
        switch (container_type) {
5858
0
        case 3:
5859
            /* E-UTRAN transparent container
5860
             * This IE shall be included to contain the "Target to Source Transparent Container"
5861
             * during a handover to E-UTRAN, 5GS to EPS handover and EPS to 5GS handover.
5862
             * If the Cause IE contains the value "Request accepted". The Container Type shall be set to 3.
5863
             */
5864
0
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_eutran_con, NULL, "E-UTRAN transparent container");
5865
0
            new_tvb = tvb_new_subset_length(tvb, offset, length);
5866
0
            dissect_s1ap_TargeteNB_ToSourceeNB_TransparentContainer_PDU(new_tvb, pinfo, sub_tree, NULL);
5867
0
            return;
5868
0
        default:
5869
0
            break;
5870
0
        }
5871
0
    }
5872
4
    if (message_type == GTPV2_CONFIGURATION_TRANSFER_TUNNEL) {
5873
    /* 7.3.18 Configuration Transfer Tunnel */
5874
0
        switch (container_type) {
5875
0
        case 3:
5876
            /* SON Configuration Transfer
5877
             * This IE shall be included to contain the "SON Configuration Transfer" as specified in 3GPP TS 36.413 [10].
5878
             * The Container Type shall be set to 3.
5879
             */
5880
0
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_son_con, NULL, "SON Configuration Transfer");
5881
0
            new_tvb = tvb_new_subset_length(tvb, offset, length);
5882
0
            dissect_s1ap_SONConfigurationTransfer_PDU(new_tvb, pinfo, sub_tree, NULL);
5883
0
            return;
5884
0
        case 5:
5885
            /* EN-DC SON Configuration Transfer
5886
             * This IE shall be included to contain the "EN-DC SON Configuration Transfer" as specified in 3GPP TS 36.413 [10].
5887
             * The Container Type shall be set to 5.
5888
             */
5889
0
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_endc_son_con, NULL, "EN-DC SON Configuration Transfer");
5890
0
            new_tvb = tvb_new_subset_length(tvb, offset, length);
5891
0
            dissect_s1ap_EN_DCSONConfigurationTransfer_PDU(new_tvb, pinfo, sub_tree, NULL);
5892
0
            return;
5893
0
        case 6:
5894
            /* Inter-System SON Container
5895
             * This IE shall be included to contain the "Inter-System SON Container" as specified in 3GPP TS 36.413 [10].
5896
             * The Container Type shall be set to 6.
5897
             */
5898
0
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, length, ett_gtpv2_intersys_son_con, NULL, "Inter-System SON Container");
5899
0
            new_tvb = tvb_new_subset_length(tvb, offset, length);
5900
0
            dissect_s1ap_IntersystemSONConfigurationTransfer_PDU(new_tvb, pinfo, sub_tree, NULL);
5901
0
            return;
5902
0
        default:
5903
0
            break;
5904
0
        }
5905
0
    }
5906
4
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length);
5907
5908
4
}
5909
5910
/*
5911
 * 8.49 Fully Qualified Cause (F-Cause)
5912
 */
5913
5914
static const value_string gtpv2_cause_type_vals[] = {
5915
    {0,  "Radio Network Layer"},
5916
    {1,  "Transport Layer"},
5917
    {2,  "NAS"},
5918
    {3,  "Protocol"},
5919
    {4,  "Miscellaneous"},
5920
    {5,  "<spare>"},
5921
    {6,  "<spare>"},
5922
    {7,  "<spare>"},
5923
    {8,  "<spare>"},
5924
    {9,  "<spare>"},
5925
    {10, "<spare>"},
5926
    {11, "<spare>"},
5927
    {12, "<spare>"},
5928
    {13, "<spare>"},
5929
    {14, "<spare>"},
5930
    {15, "<spare>"},
5931
    {0, NULL}
5932
};
5933
static value_string_ext gtpv2_cause_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_cause_type_vals);
5934
5935
static void
5936
dissect_gtpv2_s1ap_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, int offset, uint8_t cause_type)
5937
0
{
5938
5939
0
    switch (cause_type) {
5940
0
    case 0:
5941
        /* CauseRadioNetwork */
5942
0
        proto_tree_add_item(tree, hf_gtpv2_CauseRadioNetwork, tvb, offset, 1, ENC_BIG_ENDIAN);
5943
0
        break;
5944
0
    case 1:
5945
        /* CauseTransport */
5946
0
        proto_tree_add_item(tree, hf_gtpv2_CauseTransport, tvb, offset, 1, ENC_BIG_ENDIAN);
5947
0
        break;
5948
0
    case 2:
5949
        /* CauseNas */
5950
0
        proto_tree_add_item(tree, hf_gtpv2_CauseNas, tvb, offset, 1, ENC_BIG_ENDIAN);
5951
0
        break;
5952
0
    case 3:
5953
        /* CauseProtocol */
5954
0
        proto_tree_add_item(tree, hf_gtpv2_CauseProtocol, tvb, offset, 1, ENC_BIG_ENDIAN);
5955
0
        break;
5956
0
    case 4:
5957
        /* CauseMisc */
5958
0
        proto_tree_add_item(tree, hf_gtpv2_CauseMisc, tvb, offset, 1, ENC_BIG_ENDIAN);
5959
0
        break;
5960
0
    default:
5961
0
        break;
5962
0
    }
5963
5964
0
    return;
5965
5966
0
}
5967
static void
5968
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_)
5969
33
{
5970
33
    int    offset = 0;
5971
33
    uint8_t cause_type;
5972
5973
    /* The value of Instance field of the F-Cause IE in a GTPv2 message shall indicate
5974
     * whether the F-Cause field contains RANAP Cause, BSSGP Cause or RAN Cause.
5975
     * If the F-Cause field contains RAN Cause, the Cause Type field shall contain
5976
     * the RAN cause subcategory as specified in 3GPP TS 36.413 [10] and it shall be
5977
     * encoded as in Table 8.49-1.
5978
     * If the F-Cause field contains BSSGP Cause or RANAP Cause,
5979
     * the Cause Type field shall be ignored by the receiver.
5980
     */
5981
33
    if (message_type == GTPV2_FORWARD_RELOCATION_REQ) {
5982
0
        switch (instance) {
5983
0
        case 0:
5984
0
            proto_item_append_text(item, "[RAN Cause]");
5985
0
            proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5986
0
            cause_type = tvb_get_uint8(tvb, offset);
5987
0
            offset += 1;
5988
0
            dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
5989
0
            return;
5990
0
        case 1:
5991
0
            proto_item_append_text(item, "[RANAP Cause]");
5992
0
            break;
5993
0
        case 2:
5994
0
            proto_item_append_text(item, "[BSSGP Cause]");
5995
0
            break;
5996
0
        default:
5997
0
            break;
5998
0
        }
5999
0
    }
6000
33
    else if (message_type == GTPV2_FORWARD_RELOCATION_RESP) {
6001
        /* Table 7.3.2-1: Information Elements in a Forward Relocation Response */
6002
0
        switch (instance) {
6003
0
        case 0:
6004
            /* Instance 0 S1-AP Cause */
6005
0
            proto_item_append_text(item, "[S1-AP Cause]");
6006
0
            proto_tree_add_item(tree, hf_gtpv2_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6007
0
            cause_type = tvb_get_uint8(tvb, offset);
6008
0
            offset++;
6009
0
            dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
6010
0
            return;
6011
0
        case 1:
6012
            /* Instance 1 RANAP Cause */
6013
0
            proto_item_append_text(item, "[RANAP Cause]");
6014
0
            break;
6015
0
        case 2:
6016
            /* Instance 2 BSSGP Cause */
6017
0
            proto_item_append_text(item, "[BSSGP Cause]");
6018
0
            break;
6019
0
        default:
6020
0
            break;
6021
0
        }
6022
6023
0
    }/* GTPV2_FORWARD_RELOCATION_RESP */
6024
6025
33
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
6026
6027
33
}
6028
6029
/*
6030
 * 8.50 PLMN ID
6031
 */
6032
/*
6033
 * The Selected PLMN ID IE contains the core network operator selected for tne UE
6034
 * in a shared network. Octets 5-7 shall be encoded as the content part of the
6035
 *  "Selected PLMN Identity" parameter in 3GPP TS 36.413 [10].
6036
 * -The Selected PLMN identity consists of 3 digits from MCC followed by
6037
 * either -a filler digit plus 2 digits from MNC (in case of 2 digit MNC) or
6038
 * -3 digits from MNC (in case of a 3 digit MNC).
6039
 *
6040
 *         8  7  6  5  4  3  2  1
6041
 *         +--+--+--+--+--+--+--+--+
6042
 * Octet 5 |MCC digit 2|MCC digit 1|
6043
 *         +--+--+--+--+--+--+--+--+
6044
 * Octet 6 |MNC digit 1|MCC digit 3|
6045
 *         +--+--+--+--+--+--+--+--+
6046
 * Octet 7 |MNC digit 3|MNC digit 2|
6047
 *         +--+--+--+--+--+--+--+--+
6048
 */
6049
static void
6050
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_)
6051
2
{
6052
2
    char *mcc_mnc_str;
6053
6054
2
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, false);
6055
2
    proto_item_append_text(item, "%s", mcc_mnc_str);
6056
2
}
6057
6058
/*
6059
 * 8.51 Target Identification
6060
 */
6061
6062
static const value_string gtpv2_target_type_vals[] = {
6063
    {0,  "RNC ID"},
6064
    {1,  "Macro eNodeB ID"},
6065
    {2,  "Cell Identifier"},
6066
    {3,  "Home eNodeB ID"},
6067
    {4,  "Extended Macro eNodeB ID"},
6068
    {5,  "gNodeB ID"},
6069
    {6,  "Macro ng-eNodeB ID"},
6070
    {7,  "Extended ng-eNodeB ID"},
6071
    {8,  "en-gNB ID"},
6072
    {0, NULL}
6073
};
6074
static value_string_ext gtpv2_target_type_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_target_type_vals);
6075
6076
static char*
6077
dissect_gtpv2_home_enodeb_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int *offset)
6078
1.23k
{
6079
1.23k
    char       *str = NULL;
6080
1.23k
    char       *mcc_mnc_str;
6081
1.23k
    uint32_t    home_enodeb_id;
6082
6083
1.23k
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
6084
1.23k
    *offset += 3;
6085
6086
    /* Octet 10 to 12 Home eNodeB ID
6087
        * The Home eNodeB ID consists of 28 bits. See 3GPP TS 36.413 [10].
6088
        * Bit 4 of Octet 9 is the most significant bit and bit 1 of Octet 12 is the least significant bit.
6089
        * The coding of the Home eNodeB ID is the responsibility of each administration.
6090
        * Coding using full hexadecimal representation shall be used.
6091
        */
6092
1.23k
    home_enodeb_id = tvb_get_ntohl(tvb, *offset) & 0x0fffffff;
6093
1.23k
    proto_tree_add_item(tree, hf_gtpv2_home_enodeb_id, tvb, *offset, 4 , ENC_BIG_ENDIAN);
6094
1.23k
    *offset += 4;
6095
6096
1.23k
    str = wmem_strdup_printf(pinfo->pool, "%s, Home eNodeB ID 0x%x",
6097
1.23k
        mcc_mnc_str,
6098
1.23k
        home_enodeb_id);
6099
6100
1.23k
    return str;
6101
1.23k
}
6102
6103
static char*
6104
dissect_gtpv2_gnodeb_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, int* offset)
6105
1
{
6106
1
    char* str = NULL;
6107
1
    char* mcc_mnc_str;
6108
1
    uint32_t    gnodeb_id;
6109
6110
1
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
6111
1
    *offset += 3;
6112
6113
    /* The gNodeB ID Length field, in bits 1 to 6 of octet 9,
6114
     * indicates the length of the gNodeB ID in number of bits
6115
     */
6116
6117
1
    proto_tree_add_item(tree, hf_gtpv2_gnodeb_id_len, tvb, *offset, 1, ENC_BIG_ENDIAN);
6118
1
    *offset += 1;
6119
6120
1
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_gnodeb_id, tvb, *offset, 4, ENC_BIG_ENDIAN, &gnodeb_id);
6121
1
    *offset += 4;
6122
6123
1
    str = wmem_strdup_printf(pinfo->pool, "%s, gNodeB ID 0x%x",
6124
1
        mcc_mnc_str,
6125
1
        gnodeb_id);
6126
6127
1
    return str;
6128
1
}
6129
6130
static char*
6131
dissect_gtpv2_macro_ng_enodeb_id(tvbuff_t* tvb, packet_info* pinfo, proto_tree* tree, int* offset)
6132
0
{
6133
0
    char       *str = NULL;
6134
0
    char       *mcc_mnc_str;
6135
0
    uint32_t    ng_enodeb_id;
6136
6137
0
    mcc_mnc_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, *offset, E212_NONE, true);
6138
0
    *offset += 3;
6139
6140
0
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_macro_ng_enodeb_id, tvb, *offset, 3, ENC_BIG_ENDIAN, &ng_enodeb_id);
6141
0
    *offset += 3;
6142
6143
0
    str = wmem_strdup_printf(pinfo->pool, "%s, Macro ng-eNodeB ID 0x%x",
6144
0
        mcc_mnc_str,
6145
0
        ng_enodeb_id);
6146
6147
0
    return str;
6148
0
}
6149
6150
static void
6151
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_)
6152
6
{
6153
6
    tvbuff_t *new_tvb;
6154
6
    int       offset = 0;
6155
6
    uint8_t   target_type, oct;
6156
6157
6
    proto_tree_add_item(tree, hf_gtpv2_target_type, tvb, 0, 1, ENC_BIG_ENDIAN);
6158
6
    target_type = tvb_get_uint8(tvb, offset);
6159
6
    offset += 1;
6160
6
    switch (target_type) {
6161
2
    case 0:
6162
        /* 8.51.2 RNC ID*/
6163
2
        new_tvb = tvb_new_subset_remaining(tvb, offset);
6164
2
        dissect_e212_mcc_mnc(new_tvb, pinfo, tree, 0, E212_NONE, true);
6165
2
        offset += 3;
6166
        /* LAC */
6167
2
        proto_tree_add_item(tree, hf_gtpv2_lac,    tvb, offset, 2, ENC_BIG_ENDIAN);
6168
2
        offset+=2;
6169
6170
        /* RAC (see NOTE 3) */
6171
2
        proto_tree_add_item(tree, hf_gtpv2_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
6172
2
        offset++;
6173
        /* RNC ID
6174
         * In this case the Target ID field shall be encoded as the Target
6175
         * RNC-ID part of the "Target ID" parameter in 3GPP TS 25.413 [33]. Therefore, the "Choice Target ID" that indicates
6176
         * "Target RNC-ID" (numerical value of 0x20) shall not be included (value in octet 5 specifies the target type).
6177
         */
6178
2
        proto_tree_add_item(tree, hf_gtpv2_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6179
        /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
6180
         * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
6181
         */
6182
2
        if(length == 11){
6183
0
            proto_tree_add_item(tree, hf_gtpv2_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6184
0
        }
6185
2
        return;
6186
0
    case 1:
6187
        /* Macro eNodeB ID*/
6188
0
        dissect_gtpv2_macro_enodeb_id(tvb, pinfo, tree, &offset);
6189
6190
        /* Tracking Area Code (TAC) */
6191
0
        proto_tree_add_item(tree, hf_gtpv2_tai_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6192
6193
0
        return;
6194
6195
0
    case 2:
6196
        /* Cell Identifier */
6197
        /* Target ID field shall be same as the Octets 3 to 10 of the Cell Identifier IEI
6198
         * in 3GPP TS 48.018 [34].
6199
         */
6200
0
        new_tvb = tvb_new_subset_remaining(tvb, offset);
6201
0
        de_bssgp_cell_id(new_tvb, tree, pinfo, 0, 0/* not used */, NULL, 0);
6202
0
        return;
6203
0
    case 3:
6204
        /* Home eNodeB ID */
6205
0
        dissect_gtpv2_home_enodeb_id(tvb, pinfo, tree, &offset);
6206
6207
        /* Octet 13 to 14 Tracking Area Code (TAC) */
6208
0
        proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2 , ENC_BIG_ENDIAN);
6209
0
        return;
6210
6211
0
    case 4:
6212
        /* 8.51.5 Extended Macro eNodeB ID */
6213
0
        dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, tree, &offset, hf_gtpv2_ext_macro_enodeb_id);
6214
6215
        /* Octet 12 to 13 Tracking Area Code (TAC) */
6216
0
        proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6217
0
        return;
6218
6219
1
    case 5:
6220
        /* gNodeB ID */
6221
1
        dissect_gtpv2_gnodeb_id(tvb, pinfo, tree, &offset);
6222
6223
        /* Octet 14 to 16 5GS Tracking Area Code (TAC) */
6224
1
        proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6225
1
        return;
6226
6227
0
    case 6:
6228
        /* Macro ng-eNodeB ID */
6229
0
        dissect_gtpv2_macro_ng_enodeb_id(tvb, pinfo, tree, &offset);
6230
        /* Octet 14 to 16 5GS Tracking Area Code (TAC) */
6231
0
        proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6232
0
        return;
6233
6234
1
    case 7:
6235
        /* Extended ng-eNodeB ID */
6236
1
        dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, tree, &offset, hf_gtpv2_ext_macro_ng_enodeb_id);
6237
        /* Octet 12 to 14 5GS Tracking Area Code (TAC) */
6238
1
        proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6239
1
        return;
6240
6241
0
    case 8:
6242
        /* en-gNB ID */
6243
0
        dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, offset, E212_NONE, true);
6244
0
        offset += 3;
6245
        /* Octet 9 5TAC ETAC en-gNB ID Length */
6246
0
        oct = tvb_get_uint8(tvb, offset);
6247
0
        proto_tree_add_item(tree, hf_gtpv2_5tac, tvb, offset, 1, ENC_BIG_ENDIAN);
6248
0
        proto_tree_add_item(tree, hf_gtpv2_etac, tvb, offset, 1, ENC_BIG_ENDIAN);
6249
0
        proto_tree_add_item(tree, hf_gtpv2_en_gnb_id_len, tvb, offset, 1, ENC_BIG_ENDIAN);
6250
0
        offset++;
6251
6252
        /* Octet 10 to 13 en-gNB ID */
6253
0
        proto_tree_add_item(tree, hf_gtpv2_en_gnb_id, tvb, offset, 4, ENC_BIG_ENDIAN);
6254
0
        offset += 4;
6255
6256
0
        if ((oct & 0x40) == 0x40) {
6257
            /* ETAC*/
6258
            /* p to (p+1 */
6259
0
            proto_tree_add_item(tree, hf_gtpv2_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
6260
0
            offset += 2;
6261
6262
0
        }
6263
0
        if ((oct & 0x80) == 0x80) {
6264
            /* 5 TAC*/
6265
            /* q to(q + 2) */
6266
0
            proto_tree_add_item(tree, hf_gtpv2_5gs_tac, tvb, offset, 3, ENC_BIG_ENDIAN);
6267
0
        }
6268
0
        return;
6269
6270
2
    default:
6271
2
        break;
6272
6
    }
6273
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length-offset);
6274
6275
2
}
6276
6277
/*
6278
 * 8.52 Void
6279
 */
6280
/*
6281
 * 8.53 Packet Flow ID
6282
 */
6283
static void
6284
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_)
6285
2
{
6286
2
    int offset = 0;
6287
6288
    /* Octet 5 Spare EBI */
6289
2
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
6290
2
    proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
6291
2
    offset += 1;
6292
6293
    /* Packet Flow ID */
6294
2
    proto_tree_add_item(tree, hf_gtpv2_packet_flow_id, tvb, offset, length - 1, ENC_NA);
6295
6296
2
}
6297
/*
6298
 * 8.54 RAB Context
6299
 */
6300
static void
6301
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_)
6302
3
{
6303
3
    int     offset = 0;
6304
6305
    /* 5 Spare NSAPI */
6306
3
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
6307
3
    proto_tree_add_item(tree, hf_gtpv2_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
6308
3
    offset++;
6309
6310
    /* 6 to 7 DL GTP-U Sequence Number */
6311
3
    proto_tree_add_item(tree, hf_gtpv2_dl_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6312
3
    offset += 2;
6313
6314
    /* 8 to 9 UL GTP-U Sequence Number */
6315
3
    proto_tree_add_item(tree, hf_gtpv2_ul_gtp_u_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6316
3
    offset += 2;
6317
6318
    /* 10 to 11 DL PDCP Sequence Number */
6319
3
    proto_tree_add_item(tree, hf_gtpv2_dl_pdcp_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6320
3
    offset += 2;
6321
6322
    /* 12 to 13 UL PDCP Sequence Number */
6323
3
    proto_tree_add_item(tree, hf_gtpv2_ul_pdcp_sequence_number, tvb, offset, 2, ENC_BIG_ENDIAN);
6324
6325
3
}
6326
6327
/*
6328
 * 8.55 Source RNC PDCP context info
6329
 */
6330
static void
6331
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_)
6332
4
{
6333
4
    proto_tree_add_item(tree, hf_gtpv2_rrc_container, tvb, 0, length, ENC_NA);
6334
4
}
6335
6336
/*
6337
 * 8.56 Port Number
6338
 */
6339
static void
6340
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_)
6341
5
{
6342
5
    proto_tree_add_item(tree, hf_gtpv2_port_number, tvb, 0, 2, ENC_BIG_ENDIAN);
6343
5
    proto_item_append_text(item, "%u", tvb_get_ntohs(tvb, 0));
6344
5
}
6345
/*
6346
 * 8.57 APN Restriction
6347
 */
6348
6349
/* Table 8.57-1: Valid Combinations of APN Restriction */
6350
static const value_string gtpv2_apn_restriction_vals[] = {
6351
    {0, "No Existing Contexts or Restriction"},
6352
    {1, "Public-1"},
6353
    {2, "Public-2"},
6354
    {3, "Private-1"},
6355
    {4, "Private-2"},
6356
    {0, NULL}
6357
};
6358
static value_string_ext gtpv2_apn_restriction_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_apn_restriction_vals);
6359
6360
static void
6361
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_)
6362
3
{
6363
3
    uint8_t type_value;
6364
3
    int    offset = 0;
6365
6366
    /* APN restriction value octet 5 */
6367
3
    type_value = tvb_get_uint8(tvb, offset);
6368
3
    proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, offset, 1, ENC_BIG_ENDIAN);
6369
6370
    /* Add APN restriction to ie_tree */
6371
3
    proto_item_append_text(item, "%s (%u)", val_to_str_ext_const(type_value, &gtpv2_apn_restriction_vals_ext, "Unknown"), type_value);
6372
3
    offset += 1;
6373
6374
3
    if (length > offset)
6375
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
6376
3
}
6377
6378
/*
6379
 * 8.58 Selection Mode
6380
 */
6381
static const value_string gtpv2_selec_mode_vals[] = {
6382
    {0, "MS or network provided APN, subscribed verified"},
6383
    {1, "MS provided APN, subscription not verified"},
6384
    {2, "Network provided APN, subscription not verified"},
6385
    {3, "Network provided APN, subscription not verified (Basically for Future use"},
6386
    {0, NULL}
6387
};
6388
6389
void
6390
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_)
6391
8
{
6392
8
    int    offset = 0;
6393
8
    uint8_t ss_mode;
6394
6395
8
    ss_mode = tvb_get_uint8(tvb, offset) & 0x03;
6396
8
    proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
6397
8
    proto_item_append_text(item, "%s", val_to_str_const(ss_mode, gtpv2_selec_mode_vals, "Unknown"));
6398
8
}
6399
6400
6401
/*
6402
 * 8.59 Source Identification
6403
 */
6404
#if 0
6405
static const value_string gtpv2_source_ident_types[] = {
6406
    {0, "Cell ID"},
6407
    {1, "RNC ID"},
6408
    {2, "eNodeB ID(Reserved, used in earlier v of proto.)"},
6409
    {0, NULL}
6410
};
6411
#endif
6412
static void
6413
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_)
6414
8
{
6415
8
    int         offset = 0;
6416
8
    uint8_t     source_type;
6417
6418
    /* Octet 5 to 12 Target Cell ID */
6419
8
    de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
6420
8
    offset += 8;
6421
    /* Octet 13 Source Type */
6422
8
    source_type = tvb_get_uint8(tvb, offset);
6423
8
    proto_tree_add_item(tree, hf_gtpv2_source_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6424
8
    offset += 1;
6425
    /* Octet 14 to (n+4) Source ID */
6426
8
    switch (source_type) {
6427
2
    case 0:
6428
        /* The Source Type is Cell ID for PS handover from GERAN A/Gb mode. In this case the coding of the Source ID field
6429
         * shall be same as the Octets 3 to 10 of the Cell Identifier IEI in 3GPP TS 48.018 [34].
6430
         */
6431
2
        de_cell_id(tvb, tree, pinfo, offset, 8, NULL, 0);
6432
2
        break;
6433
2
    case 1:
6434
        /* The Source Type is RNC ID for PS handover from GERAN Iu mode or for inter-RAT handover from UTRAN. In this
6435
         * case the Source ID field shall be encoded as the Source RNC-ID part of the "Source ID" parameter in 3GPP TS
6436
         * 25.413 [33].
6437
         */
6438
        /* RNC-ID M INTEGER (0..4095) */
6439
2
        break;
6440
0
    case 2:
6441
0
        break;
6442
4
    default:
6443
4
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_source_type_unknown, tvb, offset-1, 1);
6444
4
        break;
6445
8
    }
6446
6447
8
}
6448
6449
 /*
6450
  * 8.60 Bearer Control Mode
6451
  */
6452
static const value_string gtpv2_bearer_control_mode_vals[] = {
6453
    {0, "Selected Bearer Control Mode-'MS_only'"},
6454
    {1, "Selected Bearer Control Mode-'Network_only'"},
6455
    {2, "Selected Bearer Control Mode-'MS/NW'"},
6456
    {0, NULL}
6457
};
6458
6459
static const value_string gtpv2_bearer_control_mode_short_vals[] = {
6460
    {0, "MS_only"},
6461
    {1, "Network_only"},
6462
    {2, "MS/NW"},
6463
    {0, NULL}
6464
};
6465
6466
static void
6467
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_)
6468
0
{
6469
0
    uint8_t bcm;
6470
6471
0
    proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, ENC_BIG_ENDIAN);
6472
    /* Add Bearer Control Mode to tree */
6473
0
    bcm = tvb_get_uint8(tvb, 0);
6474
0
    proto_item_append_text(item, "%s", val_to_str_const(bcm, gtpv2_bearer_control_mode_short_vals, "Unknown"));
6475
6476
0
}
6477
/*
6478
 * 8.61 Change Reporting Action
6479
 */
6480
static const value_string gtpv2_cng_rep_act_vals[] = {
6481
    {0, "Stop Reporting"},
6482
    {1, "Start Reporting CGI/SAI"},
6483
    {2, "Start Reporting RAI"},
6484
    {3, "Start Reporting TAI"},
6485
    {4, "Start Reporting ECGI"},
6486
    {5, "Start Reporting CGI/SAI and RAI"},
6487
    {6, "Start Reporting TAI and ECGI"},
6488
    {0, NULL}
6489
};
6490
6491
static void
6492
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_)
6493
2
{
6494
2
    uint8_t action;
6495
6496
    /* Add Action to tree */
6497
2
    action = tvb_get_uint8(tvb, 0);
6498
2
    proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, ENC_BIG_ENDIAN);
6499
6500
2
    proto_item_append_text(item, "%s", val_to_str_const(action, gtpv2_cng_rep_act_vals, "Unknown"));
6501
2
}
6502
/*
6503
 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
6504
 */
6505
#if 0
6506
static const value_string gtpv2_fq_csid_type_vals[] = {
6507
    {0, "Global unicast IPv4 address"},
6508
    {1, "Global unicast IPv6 address"},
6509
    {2, "4 octets long field"},
6510
    {0, NULL}
6511
};
6512
#endif
6513
6514
void
6515
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_)
6516
11
{
6517
11
    int         offset = 0;
6518
11
    uint8_t     octet, node_id_type, csids;
6519
6520
    /* Octet 5 Node-ID Type Number of CSIDs= m */
6521
6522
11
    octet = tvb_get_uint8(tvb, offset);
6523
11
    node_id_type = octet >> 4;
6524
11
    csids = octet & 0x0f;
6525
11
    proto_tree_add_item(tree, hf_gtpv2_fq_csid_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6526
11
    proto_tree_add_item(tree, hf_gtpv2_fq_csid_nr, tvb, offset, 1, ENC_BIG_ENDIAN);
6527
11
    offset += 1;
6528
6529
11
    switch (node_id_type) {
6530
6
    case 0:
6531
        /* Indicates that Node-ID is a global unicast IPv4 address and p = 9 */
6532
6
        proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
6533
6
        offset += 4;
6534
6
        break;
6535
0
    case 1:
6536
        /* Indicates that Node-ID is a global unicast IPv6 address and p = 21 */
6537
0
        proto_tree_add_item(tree, hf_gtpv2_fq_csid_ipv6, tvb, offset, 16, ENC_NA);
6538
0
        offset += 16;
6539
0
        break;
6540
3
    case 2:
6541
        /* Node-ID is a 4 octets long field with a 32 bit value stored in network order, and p= 9. The coding
6542
         * of the field is specified below:
6543
         * - Most significant 20 bits are the binary encoded value of (MCC * 1000 + MNC).
6544
         * - Least significant 12 bits is a 12 bit integer assigned by an operator to an MME, SGW or PGW. Other values of
6545
         *   Node-ID Type are reserved.
6546
         */
6547
3
        proto_tree_add_item(tree, hf_gtpv2_fq_csid_node_id, tvb, offset, 4, ENC_BIG_ENDIAN);
6548
3
        proto_tree_add_item(tree, hf_gtpv2_fq_csid_mcc_mnc, tvb, offset, 4, ENC_BIG_ENDIAN);
6549
3
        offset += 4;
6550
3
        break;
6551
2
    default:
6552
2
        proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_fq_csid_type_bad, tvb, offset-1, 1,
6553
2
                                     "Wrong Node-ID Type %u, should be 0-2(Or this is a newer spec)", node_id_type);
6554
2
        return;
6555
11
    }
6556
6557
    /* First PDN Connection Set Identifier (CSID)
6558
     * Second PDN Connection Set Identifier (CSID)
6559
     *  :
6560
     * m-th PDN Connection Set Identifier (CSID)
6561
     */
6562
40
    while ( csids-- ) {
6563
31
        proto_tree_add_item(tree, hf_gtpv2_fq_csid_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6564
31
        offset += 2;
6565
31
    }
6566
6567
9
}
6568
6569
/*
6570
 * 8.63 Channel needed
6571
 */
6572
static void
6573
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_)
6574
2
{
6575
    /* The Channel needed shall be coded as depicted in Figure 8.63-1. Channel needed is coded as the IEI part and the value
6576
     * part of the Channel Needed IE defined in 3GPP TS 44.018[28]
6577
     */
6578
2
    de_rr_chnl_needed(tvb, tree, pinfo, 0, length, NULL, 0);
6579
2
}
6580
6581
/*
6582
 * 8.64 eMLPP Priority
6583
 * The eMLPP-Priority shall be coded as depicted in Figure 8.64-1. The eMLPP Priority is coded as the value part of the
6584
 * eMLPP-Priority IE defined in 3GPP TS 48.008 [29] (not including 3GPP TS 48.008 IEI and 3GPP TS 48.008 [29]
6585
 * length indicator).
6586
 */
6587
static void
6588
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_)
6589
2
{
6590
2
    be_emlpp_prio(tvb, tree, pinfo, 0, length, NULL, 0);
6591
6592
2
}
6593
6594
/*
6595
 * 8.65 Node Type
6596
 */
6597
static const value_string gtpv2_node_type_vals[] = {
6598
    {0, "MME"},
6599
    {1, "SGSN"},
6600
    {0, NULL}
6601
};
6602
6603
static void
6604
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_)
6605
1
{
6606
1
    uint8_t node_type;
6607
6608
1
    proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, ENC_BIG_ENDIAN);
6609
    /* Append Node Type to tree */
6610
1
    node_type = tvb_get_uint8(tvb, 0);
6611
1
    proto_item_append_text(item, "%s", val_to_str_const(node_type, gtpv2_node_type_vals, "Unknown"));
6612
6613
1
}
6614
6615
 /*
6616
  * 8.66 Fully Qualified Domain Name (FQDN)
6617
  */
6618
static int
6619
decode_gtpv2_fqdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item, int offset, uint16_t length)
6620
18
{
6621
18
    int           name_len;
6622
18
    const uint8_t *fqdn   = NULL;
6623
6624
    /* The FQDN field encoding shall be identical to the encoding of
6625
     * a FQDN within a DNS message of section 3.1 of IETF
6626
     * RFC 1035 [31] but excluding the trailing zero byte.
6627
     *
6628
     * XXX: is compression possible?
6629
     */
6630
18
    if (offset < length) {
6631
15
        name_len = tvb_get_uint8(tvb, offset);
6632
6633
        /* "NOTE 1: The FQDN field in the IE is not encoded as a dotted string"
6634
         * but if the first byte is large (in the letter range or higher),
6635
         * assume that it is so encoded incorrectly.
6636
         */
6637
15
        if (name_len < 0x40) {
6638
8
            proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_APN_STR, pinfo->pool, &fqdn);
6639
8
        } else {
6640
7
            proto_tree_add_item_ret_string(tree, hf_gtpv2_fqdn, tvb, offset, length, ENC_ASCII, pinfo->pool, &fqdn);
6641
7
        }
6642
15
        proto_item_append_text(item, "%s", fqdn);
6643
15
    }
6644
6645
18
    return length; //TODO return length of fqdn
6646
18
}
6647
6648
static void
6649
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_)
6650
11
{
6651
11
    int offset = 0;
6652
11
    decode_gtpv2_fqdn(tvb, pinfo, tree, item, offset, length);
6653
11
}
6654
6655
/*
6656
 * 8.67 Private Extension
6657
 */
6658
static void
6659
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_)
6660
11
{
6661
11
    int       offset = 0;
6662
11
    tvbuff_t *next_tvb;
6663
11
    uint16_t  ext_id;
6664
11
    gtpv2_priv_ext_info_t  gtpv2_inf;
6665
6666
11
    gtpv2_inf.instance = instance;
6667
11
    gtpv2_inf.item = item;
6668
6669
    /* oct 5 -7 Enterprise ID */
6670
11
    ext_id = tvb_get_ntohs(tvb, offset);
6671
11
    proto_tree_add_item(tree, hf_gtpv2_enterprise_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6672
11
    offset += 2;
6673
6674
11
    proto_item_append_text(item, "%s (%u)", enterprises_lookup(ext_id, "Unknown"), ext_id);
6675
6676
11
    next_tvb = tvb_new_subset_length(tvb, offset, length-2);
6677
11
    if (dissector_try_uint_with_data(gtpv2_priv_ext_dissector_table, ext_id, next_tvb, pinfo, tree, false, &gtpv2_inf)){
6678
0
        return;
6679
0
    }
6680
6681
11
    proto_tree_add_item(tree, hf_gtpv2_proprietary_value, tvb, offset, length-2, ENC_NA);
6682
11
}
6683
6684
/*
6685
 * 8.68 Transaction Identifier (TI)
6686
 */
6687
static void
6688
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_)
6689
2
{
6690
    /* 5 to (n+4)  Transaction Identifier */
6691
2
    proto_tree_add_item(tree, hf_gtpv2_ti, tvb, 0, length, ENC_NA);
6692
6693
2
}
6694
6695
/*
6696
 * 8.69 MBMS Session Duration
6697
 */
6698
void
6699
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_)
6700
14
{
6701
14
    int     offset     = 0;
6702
14
    int     bit_offset = 0;
6703
14
    uint8_t  days;
6704
14
    uint32_t hours;
6705
14
    uint32_t minutes;
6706
14
    uint32_t seconds;
6707
14
    uint32_t durations_seconds;
6708
14
    proto_item *day_item, *sec_item;
6709
6710
    /* From 3GPP TS 29.061 17.7.7 MBMS-Session-Duration AVP */
6711
    /* Bits: ssss ssss ssss ssss sddd dddd where s bits = seconds, d bits = days */
6712
14
    durations_seconds = tvb_get_bits32(tvb, bit_offset, 17, ENC_BIG_ENDIAN);
6713
14
    bit_offset += 17;
6714
6715
14
    days = tvb_get_bits8(tvb, bit_offset, 7);
6716
6717
    /* 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. */
6718
14
    if ((durations_seconds == 0) && (days == 0)) {
6719
5
        day_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6720
5
        sec_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
6721
5
        proto_item_append_text(item, "Indefinite (always-on)");
6722
9
    } else {
6723
9
        hours = durations_seconds / 3600;
6724
9
        minutes = (durations_seconds % 3600) / 60;
6725
9
        seconds = (durations_seconds % 3600) % 60;
6726
6727
9
        day_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6728
9
        sec_item = proto_tree_add_item(tree, hf_gtpv2_mbms_session_duration_secs, tvb, offset, 3, ENC_BIG_ENDIAN);
6729
9
        proto_item_append_text(item, "%d days %02d:%02d:%02d (DD days HH:MM:SS)", days, hours, minutes, seconds);
6730
9
    }
6731
6732
    /* Maximum allowed value for days: 18.
6733
     * Maximum allowed value for seconds: 86,400 */
6734
14
    if (days > 18) {
6735
2
        expert_add_info(pinfo, day_item, &ei_gtpv2_mbms_session_duration_days);
6736
2
    }
6737
14
    if (durations_seconds > 86400) {
6738
1
        expert_add_info(pinfo, sec_item, &ei_gtpv2_mbms_session_duration_secs);
6739
1
    }
6740
6741
14
    offset += 3;
6742
14
    if (length > 3)
6743
5
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-3, ENC_NA);
6744
14
}
6745
6746
/*
6747
 * 8.70 MBMS Service Area
6748
 */
6749
void
6750
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_)
6751
34
{
6752
34
    int         offset = 0;
6753
34
    proto_item *sai_item;
6754
34
    uint8_t     binary_nr;
6755
34
    uint16_t    real_nr;
6756
34
    uint16_t    sai;
6757
6758
34
    binary_nr = tvb_get_uint8(tvb, offset);
6759
34
    real_nr = (uint16_t)binary_nr + 1;
6760
6761
    /* 3GPP TS 29.061 17.7.6 MBMS-Service-Area AVP */
6762
34
    proto_tree_add_uint(tree, hf_gtpv2_mbms_service_area_nr, tvb, offset, 1, real_nr);
6763
34
    offset += 1;
6764
6765
    /* A consecutive list of MBMS Service Area Identities follow, each with a length of two octets. */
6766
3.50k
    while (offset < length) {
6767
        /* 3GPP TS 23.003 15.3 Structure of MBMS SAI */
6768
3.47k
        sai = tvb_get_ntohs(tvb, offset);
6769
3.47k
        sai_item = proto_tree_add_item(tree, hf_gtpv2_mbms_service_area_id, tvb, offset, 2, ENC_BIG_ENDIAN);
6770
        /* The value 0 denotes the whole of PLMN as the MBMS Service Area */
6771
3.47k
        if (sai == 0) {
6772
766
            proto_item_append_text(sai_item, " Entire PLMN");
6773
766
        }
6774
3.47k
        proto_item_append_text(item, " %u", sai);
6775
3.47k
        offset += 2;
6776
3.47k
    }
6777
34
}
6778
6779
/*
6780
 * 8.71 MBMS Session Identifier
6781
 */
6782
static void
6783
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_)
6784
9
{
6785
9
    int offset = 0;
6786
    /* One octet OctetString. */
6787
9
    proto_tree_add_item(tree, hf_gtpv2_mbms_session_id, tvb, offset, 1, ENC_NA);
6788
6789
9
    offset += 1;
6790
9
    if (length > 1)
6791
8
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
6792
9
}
6793
6794
/*
6795
 * 8.72 MBMS Flow Identifier
6796
 */
6797
static void
6798
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_)
6799
3
{
6800
3
    int offset = 0;
6801
    /* Two octets OctetString. */
6802
3
    proto_tree_add_item(tree, hf_gtpv2_mbms_flow_id, tvb, offset, 2, ENC_NA);
6803
3
    proto_item_append_text(item, " %s", tvb_bytes_to_str(pinfo->pool, tvb, offset, 2));
6804
6805
3
    offset += 2;
6806
3
    if (length > 2)
6807
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-2, ENC_NA);
6808
3
}
6809
6810
/*
6811
 * 8.73 MBMS IP Multicast Distribution
6812
 */
6813
static const value_string gtpv2_mbms_hc_indicator_vals[] = {
6814
    {0, "Uncompressed header"},
6815
    {1, "Compressed header"},
6816
    {0, NULL}
6817
};
6818
6819
static void
6820
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_)
6821
5
{
6822
5
    int offset = 0;
6823
6824
5
    proto_tree_add_item(tree, hf_gtpv2_cteid, tvb, offset, 4, ENC_BIG_ENDIAN);
6825
5
    offset += 4;
6826
6827
5
    proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6828
5
    proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
6829
    /* IP Multicast Distribution Address */
6830
5
    if ((tvb_get_uint8(tvb, offset) & 0x3f) == 4) {
6831
0
        offset += 1;
6832
0
        proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
6833
0
        proto_item_append_text(item, " IPv4 Dist %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
6834
0
        offset += 4;
6835
5
    } else if ((tvb_get_uint8(tvb, offset) & 0x3f) == 16) {
6836
0
        offset += 1;
6837
0
        proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_dist_addrv6, tvb, offset, 16, ENC_NA);
6838
0
        proto_item_append_text(item, " IPv6 Dist %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
6839
0
        offset += 16;
6840
0
    }
6841
6842
5
    proto_tree_add_item(tree, hf_gtpv2_ip_addr_type, tvb, offset, 1, ENC_BIG_ENDIAN);
6843
5
    proto_tree_add_item(tree, hf_gtpv2_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN);
6844
    /* IP Multicast Source Address */
6845
5
    if ((tvb_get_uint8(tvb, offset) & 0x3f) == 4) {
6846
0
        offset += 1;
6847
0
        proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv4, tvb, offset, 4, ENC_BIG_ENDIAN);
6848
0
        proto_item_append_text(item, " IPv4 Src %s", tvb_ip_to_str(pinfo->pool, tvb, offset));
6849
0
        offset += 4;
6850
5
    } else if ((tvb_get_uint8(tvb, offset) & 0x3f) == 16) {
6851
0
        offset += 1;
6852
0
        proto_tree_add_item(tree, hf_gtpv2_mbms_ip_mc_src_addrv6, tvb, offset, 16, ENC_NA);
6853
0
        proto_item_append_text(item, " IPv6 Src %s", tvb_ip6_to_str(pinfo->pool, tvb, offset));
6854
0
        offset += 16;
6855
0
    }
6856
6857
5
    proto_tree_add_item(tree, hf_gtpv2_mbms_hc_indicator, tvb, offset, 1, ENC_BIG_ENDIAN);
6858
6859
5
    offset += 1;
6860
5
    if (length > offset)
6861
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
6862
6863
5
}
6864
6865
/*
6866
 * 8.74 MBMS Distribution Acknowledge
6867
 */
6868
static const value_string gtpv2_mbms_dist_indication_vals[] = {
6869
    {0, "No RNCs have accepted IP multicast distribution"},
6870
    {1, "All RNCs have accepted IP multicast distribution"},
6871
    {2, "Some RNCs have accepted IP multicast distribution"},
6872
    {3, "Spare. For future use."},
6873
    {0, NULL}
6874
};
6875
6876
static void
6877
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_)
6878
2
{
6879
2
    int offset = 0;
6880
6881
2
    proto_tree_add_item(tree, hf_gtpv2_mbms_dist_indication, tvb, offset, 1, ENC_BIG_ENDIAN);
6882
6883
2
    offset += 1;
6884
2
    if (length > 1)
6885
1
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
6886
2
}
6887
6888
/*
6889
 * 8.75 User CSG Information (UCI)
6890
 */
6891
static const value_string gtpv2_uci_csg_membership_status[] = {
6892
    {0, "Non CSG membership"},
6893
    {1, "CSG membership"},
6894
    {0, NULL }
6895
};
6896
6897
static const value_string gtpv2_uci_access_mode[] = {
6898
    {0, "Closed Mode"},
6899
    {1, "Hybrid Mode"},
6900
    {2, "Reserved" },
6901
    {3, "Reserved"},
6902
    {0, NULL }
6903
};
6904
6905
static const value_string gtpv2_uci_leave_csg[] = {
6906
    {0, "Access CSG cell/Hybrid cell"},
6907
    {1, "Leaves CSG cell/Hybrid cell"},
6908
    {0, NULL }
6909
};
6910
6911
static void
6912
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_)
6913
4
{
6914
4
    int offset = 0;
6915
6916
    /* Value of MCC & MNC */
6917
4
    dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
6918
4
    offset += 3;
6919
    /* Value of CSG ID */
6920
4
    proto_tree_add_item(tree, hf_gtpv2_uci_csg_id_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
6921
4
    proto_tree_add_item(tree, hf_gtpv2_uci_csg_id, tvb, offset, 4, ENC_BIG_ENDIAN);
6922
4
    offset += 4;
6923
6924
    /* Value of access mode */
6925
4
    proto_tree_add_item(tree, hf_gtpv2_uci_access_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
6926
6927
    /* Value of LCSG */
6928
4
    proto_tree_add_item(tree, hf_gtpv2_uci_lcsg, tvb, offset, 1, ENC_BIG_ENDIAN);
6929
6930
    /* Value of CSG membership */
6931
4
    proto_tree_add_item(tree, hf_gtpv2_uci_csg_membership, tvb, offset, 1, ENC_BIG_ENDIAN);
6932
6933
4
}
6934
6935
/* 8.76 CSG Information Reporting Action */
6936
static void
6937
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_)
6938
3
{
6939
3
    int offset = 0;
6940
6941
3
    static int * const flags[] = {
6942
3
        &hf_gtpv2_csg_info_rep_action_b2,
6943
3
        &hf_gtpv2_csg_info_rep_action_b1,
6944
3
        &hf_gtpv2_csg_info_rep_action_b0,
6945
3
        NULL
6946
3
    };
6947
3
    if (length == 0) {
6948
2
        expert_add_info(pinfo, item, &ei_gtpv2_ie_len_invalid);
6949
2
        return;
6950
2
    }
6951
    /* Spare    UCIUHC    UCISHC    UCICSG */
6952
6953
1
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN);
6954
6955
1
}
6956
6957
/* 8.77 RFSP Index */
6958
static void
6959
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_)
6960
3
{
6961
3
    int offset = 0;
6962
6963
3
    if(instance == 0){
6964
1
        proto_tree_add_item(tree, hf_gtpv2_subscriber_rfsp, tvb, offset, 2, ENC_BIG_ENDIAN);
6965
2
    }else if(instance == 1){
6966
1
        proto_tree_add_item(tree, hf_gtpv2_rfsp_inuse, tvb, offset, 2, ENC_BIG_ENDIAN);
6967
1
    }
6968
3
}
6969
6970
/* 8.78 CSG ID */
6971
static void
6972
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_)
6973
4
{
6974
4
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, 0, 5, ENC_BIG_ENDIAN);
6975
4
    proto_tree_add_item(tree, hf_gtpv2_csg_id, tvb, 0, 4, ENC_BIG_ENDIAN);
6976
4
    if (length > 1) {
6977
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, 1, length-1, ENC_NA);
6978
2
    }
6979
4
}
6980
6981
/* 8.79 CSG Membership Indication (CMI) */
6982
static void
6983
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_)
6984
3
{
6985
3
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, 0, 7, ENC_BIG_ENDIAN);
6986
3
    proto_tree_add_item(tree, hf_gtpv2_cmi, tvb, 0, 1, ENC_BIG_ENDIAN);
6987
3
    if (length > 1) {
6988
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, 1, length-1, ENC_NA);
6989
2
    }
6990
3
}
6991
6992
/* 8.80 Service indicator */
6993
static const value_string gtpv2_service_indicator_vals[] = {
6994
    { 1, "CS call indicator" },
6995
    { 2, "SMS indicator" },
6996
    { 0, NULL }
6997
};
6998
6999
static void
7000
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_)
7001
2
{
7002
2
    proto_tree_add_item(tree, hf_gtpv2_service_indicator, tvb, 0, 1, ENC_BIG_ENDIAN);
7003
2
}
7004
7005
/* 8.81 Detach Type */
7006
static const value_string gtpv2_detach_type_vals[] = {
7007
    { 1, "PS Detach" },
7008
    { 2, "Combined PS/CS Detach" },
7009
    { 0, NULL }
7010
};
7011
7012
static void
7013
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_)
7014
2
{
7015
2
    proto_tree_add_item(tree, hf_gtpv2_detach_type, tvb, 0, 1, ENC_BIG_ENDIAN);
7016
2
}
7017
7018
/* 8.82 Local Distinguished Name (LDN) */
7019
static void
7020
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_)
7021
2
{
7022
2
    proto_tree_add_item(tree, hf_gtpv2_ldn, tvb, 0, length, ENC_ASCII);
7023
2
}
7024
7025
/* 8.83 Node Features */
7026
static void
7027
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_)
7028
3
{
7029
3
    int offset = 0;
7030
3
    static int * const features[] = {
7031
3
        &hf_gtpv2_node_features_psset,
7032
3
        &hf_gtpv2_node_features_mtedt,
7033
3
        &hf_gtpv2_node_features_eth,
7034
3
        &hf_gtpv2_node_features_s1un,
7035
3
        &hf_gtpv2_node_features_ciot,
7036
3
        &hf_gtpv2_node_features_ntsr,
7037
3
        &hf_gtpv2_node_features_mabr,
7038
3
        &hf_gtpv2_node_features_prn,
7039
3
        NULL
7040
3
    };
7041
7042
3
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, features, ENC_BIG_ENDIAN);
7043
3
    offset++;
7044
3
    if (length > offset)
7045
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7046
3
}
7047
7048
/* 8.84
7049
 * MBMS Time to Data Transfer
7050
 */
7051
void
7052
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_)
7053
4
{
7054
4
    int     offset = 0;
7055
4
    uint8_t binary_secs;
7056
4
    uint16_t real_secs;
7057
7058
4
    binary_secs = tvb_get_uint8(tvb, offset);
7059
4
    real_secs = (uint16_t)binary_secs + 1;
7060
7061
4
    proto_tree_add_string_format_value(tree, hf_gtpv2_time_to_data_xfer, tvb, offset, 1, "", "%d second(s)", real_secs);
7062
4
    proto_item_append_text(item, " %u second(s)", real_secs);
7063
4
    offset += 1;
7064
4
    if (length > 1)
7065
1
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7066
4
}
7067
7068
static const value_string gtpv2_throttling_delay_unit_vals[] = {
7069
    { 0, "value is incremented in multiples of 2 seconds" },
7070
    { 1, "value is incremented in multiples of 1 minute" },
7071
    { 2, "value is incremented in multiples of 10 minutes" },
7072
    { 3, "value is incremented in multiples of 1 hour" },
7073
    { 4, "value is incremented in multiples of 10 hour" },
7074
    { 7, "value indicates that the timer is deactivated" },
7075
    { 0, NULL }
7076
};
7077
7078
/* 8.85 Throttling */
7079
static void
7080
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_)
7081
5
{
7082
5
    int offset = 0;
7083
5
    uint8_t oct;
7084
7085
5
    proto_tree_add_item(tree, hf_gtpv2_throttling_delay_unit, tvb, offset, 1, ENC_BIG_ENDIAN);
7086
5
    proto_tree_add_item(tree, hf_gtpv2_throttling_delay_value, tvb, offset, 1, ENC_BIG_ENDIAN);
7087
5
    offset++;
7088
7089
5
    oct = tvb_get_uint8(tvb, offset);
7090
5
    proto_tree_add_item(tree, hf_gtpv2_throttling_factor, tvb, offset, 1, ENC_BIG_ENDIAN);
7091
5
    if (oct > 0x64)
7092
2
        proto_item_append_text(item, "Throttling factor: value beyond (0,100) is considered as 0");
7093
5
    offset++;
7094
7095
5
    if (length > 2)
7096
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length - 2, ENC_NA);
7097
7098
7099
5
}
7100
7101
/* 8.86 Allocation/Retention Priority (ARP) */
7102
void
7103
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_)
7104
3
{
7105
3
    int offset = 0;
7106
7107
3
    proto_tree_add_item(tree, hf_gtpv2_arp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
7108
3
    proto_tree_add_item(tree, hf_gtpv2_arp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
7109
3
    proto_tree_add_item(tree, hf_gtpv2_arp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
7110
7111
3
    offset += 1;
7112
3
    if (length > 1)
7113
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7114
3
}
7115
7116
/* 8.87 EPC Timer */
7117
static const value_string gtpv2_timer_unit_vals[] = {
7118
    {0, "value is incremented in multiples of 2 seconds"},
7119
    {1, "value is incremented in multiples of 1 minute"},
7120
    {2, "value is incremented in multiples of 10 minutes"},
7121
    {3, "value is incremented in multiples of 1 hour"},
7122
    {4, "value is incremented in multiples of 10 hour"},
7123
    {5, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
7124
    {6, "Other values shall be interpreted as multiples of 1 minute(version 10.7.0)"},
7125
    {7, "value indicates that the timer is infinite"},
7126
    {0, NULL}
7127
};
7128
7129
void
7130
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_)
7131
2
{
7132
2
    switch (message_type) {
7133
0
    case GTPV2_DL_DATA_NOTIF_ACK:
7134
0
        proto_item_append_text(item, "DL Buffering Duration");
7135
0
        break;
7136
2
    }
7137
    /* XXX Todo: use code from packet-gsm_a_gm.c ?  10.5.7.4a GPRS TIMER 3*/
7138
2
    proto_tree_add_item(tree, hf_gtpv2_timer_unit, tvb, 0, 1, ENC_BIG_ENDIAN);
7139
2
    proto_tree_add_item(tree, hf_gtpv2_timer_value, tvb, 0, 1, ENC_BIG_ENDIAN);
7140
7141
2
}
7142
7143
/* 8.88 Signalling Priority Indication */
7144
static void
7145
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_)
7146
2
{
7147
2
    proto_tree_add_item(tree, hf_gtpv2_lapi, tvb, 0, 1, ENC_BIG_ENDIAN);
7148
2
}
7149
7150
/* 8.89 Temporary Mobile Group Identity (TMGI) */
7151
static void
7152
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_)
7153
2
{
7154
2
    int     offset = 0;
7155
2
    uint64_t tmgi;
7156
7157
2
    tmgi = tvb_get_ntoh48(tvb, offset);
7158
7159
2
    proto_item_append_text(item, "%012" PRIx64, tmgi);
7160
7161
2
    proto_tree_add_item(tree, hf_gtpv2_mbms_service_id, tvb, offset, 3, ENC_NA);
7162
2
    offset += 3;
7163
7164
2
    dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_NONE, true);
7165
2
    offset += 3;
7166
7167
2
    if (length > offset)
7168
1
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7169
2
}
7170
7171
/*
7172
 * 8.90 Additional MM context for SRVCC
7173
 * 3GPP TS 29.274 Figure 8.90-1
7174
 */
7175
static void
7176
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_)
7177
108
{
7178
108
    int         offset = 0;
7179
108
    proto_item *ms_cm_item;
7180
108
    proto_tree *ms_cm_tree;
7181
108
    uint8_t     elm_len;
7182
7183
    /* Length of Mobile Station Classmark 2 */
7184
108
    elm_len = tvb_get_uint8(tvb, offset);
7185
108
    proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark2, tvb, offset, 1, ENC_BIG_ENDIAN);
7186
108
    offset += 1;
7187
7188
    /* For each of the Mobile Station Classmark 2, Mobile Station Classmark 3 and Supported Codec List parameters,
7189
     * if they are not available, then the associated length field shall be set to zero, and the particular
7190
     * parameter field shall not be present.
7191
     */
7192
108
    if(elm_len > 0){
7193
87
        ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark2, tvb, offset, elm_len, ENC_NA);
7194
87
        ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
7195
        /* Mobile Station Classmark 2 */
7196
87
        de_ms_cm_2(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
7197
87
        offset += elm_len;
7198
87
    }
7199
7200
    /* Length of Mobile Station Classmark 3 */
7201
108
    elm_len = tvb_get_uint8(tvb, offset);
7202
108
    proto_tree_add_item(tree, hf_gtpv2_len_ms_classmark3, tvb, offset, 1, ENC_BIG_ENDIAN);
7203
108
    offset += 1;
7204
108
    if (elm_len > 0) {
7205
83
        ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_mobile_station_classmark3, tvb, offset, elm_len, ENC_NA);
7206
83
        ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_ms_mark);
7207
        /* Mobile Station Classmark 3 */
7208
83
        de_ms_cm_3(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
7209
83
        offset += elm_len;
7210
83
    }
7211
7212
    /* Length of Supported Codec List */
7213
108
    elm_len = tvb_get_uint8(tvb, offset);
7214
108
    proto_tree_add_item(tree, hf_gtpv2_len_supp_codec_list, tvb, offset, 1, ENC_BIG_ENDIAN);
7215
108
    offset += 1;
7216
108
    if (elm_len > 0) {
7217
65
        ms_cm_item = proto_tree_add_item(tree, hf_gtpv2_supported_codec_list, tvb, offset, elm_len, ENC_NA);
7218
65
        ms_cm_tree = proto_item_add_subtree(ms_cm_item, ett_gtpv2_supp_codec_list);
7219
        /* Supported Codec List */
7220
65
        de_sup_codec_list(tvb, ms_cm_tree, pinfo, offset, elm_len, NULL, 0);
7221
65
        offset += elm_len;
7222
65
    }
7223
7224
108
    if (length > offset)
7225
10
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7226
108
}
7227
7228
/* 8.91 Additional flags for SRVCC */
7229
static void
7230
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_)
7231
3
{
7232
3
    int offset = 0;
7233
7234
3
    proto_tree_add_item(tree, hf_gtpv2_add_flags_for_srvcc_ics, tvb, offset, 1, ENC_BIG_ENDIAN);
7235
3
    proto_tree_add_item(tree, hf_gtpv2_vsrvcc_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
7236
3
    offset += 1;
7237
7238
3
    if (length > 1)
7239
3
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7240
3
}
7241
7242
/* 8.92 Max MBR/APN-AMBR (MMBR) */
7243
static void
7244
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_)
7245
6
{
7246
6
    int     offset = 0;
7247
6
    uint32_t max_ul;
7248
6
    uint32_t max_dl;
7249
7250
6
    max_ul = tvb_get_ntohl(tvb, offset);
7251
6
    proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_ul, tvb, offset, 4, max_ul, "%u %s",
7252
6
                                (max_ul) > 1000 ? max_ul/1000 : max_ul,
7253
6
                                (max_ul) > 1000 ? "Mbps" : "kbps");
7254
7255
6
    offset += 4;
7256
7257
6
    max_dl = tvb_get_ntohl(tvb, offset);
7258
6
    proto_tree_add_uint_format_value(tree, hf_gtpv2_mmbr_dl, tvb, offset, 4, max_dl, "%u %s",
7259
6
                                (max_dl) > 1000 ? max_dl/1000 : max_dl,
7260
6
                                (max_dl) > 1000 ? "Mbps" : "kbps");
7261
6
}
7262
7263
/* 8.93 MDT Configuration */
7264
static void
7265
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_)
7266
2
{
7267
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7268
2
}
7269
7270
/* 8.94 Additional Protocol Configuration Options (APCO) */
7271
static void
7272
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_)
7273
14
{
7274
14
    switch (message_type) {
7275
0
    case GTPV2_CREATE_SESSION_REQUEST:
7276
0
    case GTPV2_DELETE_SESSION_REQUEST:
7277
0
    case GTPV2_BEARER_RESOURCE_COMMAND:
7278
0
    case GTPV2_CREATE_BEARER_RESPONSE:
7279
0
    case GTPV2_UPDATE_BEARER_RESPONSE:
7280
0
    case GTPV2_DELETE_BEARER_RESPONSE:
7281
        /* PCO options as MS to network direction */
7282
0
        pinfo->link_dir = P2P_DIR_UL;
7283
0
        break;
7284
0
    case GTPV2_CREATE_SESSION_RESPONSE:
7285
0
    case GTPV2_MODIFY_BEARER_RESPONSE:
7286
0
    case GTPV2_DELETE_SESSION_RESPONSE:
7287
0
    case GTPV2_CREATE_BEARER_REQUEST:
7288
1
    case GTPV2_UPDATE_BEARER_REQUEST:
7289
1
    case GTPV2_DELETE_BEARER_REQUEST:
7290
        /* PCO options as Network to MS direction: */
7291
1
        pinfo->link_dir = P2P_DIR_DL;
7292
1
        break;
7293
13
    default:
7294
13
        break;
7295
14
    }
7296
14
    de_sm_pco(tvb, tree, pinfo, 0, length, NULL, 0);
7297
14
}
7298
7299
/* 8.95 Absolute Time of MBMS Data Transfer */
7300
static void
7301
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_)
7302
8
{
7303
8
    int          offset = 0;
7304
8
    char        *time_str;
7305
7306
8
    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);
7307
8
    proto_item_append_text(item, "%s", time_str);
7308
7309
8
    offset += 8;
7310
8
    if (length > offset)
7311
5
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7312
8
}
7313
7314
/* 8.96 H(e)NB Information Reporting */
7315
static const true_false_string gtpv2_henb_info_report_fti_vals = {
7316
    "Start reporting H(e)NB local IP address and UDP port number information change",
7317
    "Stop reporting H(e)NB local IP address and UDP port number information change",
7318
};
7319
7320
static void
7321
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_)
7322
4
{
7323
4
    int offset = 0;
7324
7325
4
    proto_tree_add_item(tree, hf_gtpv2_henb_info_report_fti, tvb, offset, 1, ENC_BIG_ENDIAN);
7326
4
    offset += 1;
7327
7328
4
    if (length > 1)
7329
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7330
4
}
7331
7332
/* 8.97 IPv4 Configuration Parameters (IP4CP) */
7333
static void
7334
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_)
7335
4
{
7336
4
    int offset = 0;
7337
7338
4
    proto_tree_add_item(tree, hf_gtpv2_ip4cp_subnet_prefix_len, tvb, offset, 1, ENC_BIG_ENDIAN);
7339
4
    offset += 1;
7340
4
    proto_tree_add_item(tree, hf_gtpv2_ip4cp_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
7341
4
    offset += 4;
7342
7343
4
    if (length > offset)
7344
2
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-offset, ENC_NA);
7345
4
}
7346
7347
/* 8.98 Change to Report Flags */
7348
static void
7349
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_)
7350
1
{
7351
1
    int offset = 0;
7352
7353
1
    proto_tree_add_item(tree, hf_gtpv2_change_report_flags_sncr, tvb, offset, 1, ENC_BIG_ENDIAN);
7354
1
    proto_tree_add_item(tree, hf_gtpv2_change_report_flags_tzcr, tvb, offset, 1, ENC_BIG_ENDIAN);
7355
1
    offset += 1;
7356
7357
1
    if (length > 1)
7358
1
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7359
1
}
7360
7361
/* 8.99 Action Indication */
7362
static const value_string gtpv2_action_indication_vals[] = {
7363
    { 0, "No Action"},
7364
    { 1, "Deactivation Indication"},
7365
    { 2, "Paging Indication"},
7366
    { 3, "Spare"},
7367
    { 4, "Spare"},
7368
    { 5, "Spare"},
7369
    { 6, "Spare"},
7370
    { 7, "Spare"},
7371
    { 0, NULL}
7372
};
7373
static value_string_ext gtpv2_action_indication_vals_ext = VALUE_STRING_EXT_INIT(gtpv2_action_indication_vals);
7374
7375
static void
7376
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_)
7377
1
{
7378
1
    int offset = 0;
7379
7380
1
    proto_tree_add_item(tree, hf_gtpv2_action_indication_val, tvb, offset, 1, ENC_BIG_ENDIAN);
7381
1
    offset += 1;
7382
7383
1
    if (length > 1)
7384
1
        proto_tree_add_item(tree, hf_gtpv2_spare_bytes, tvb, offset, length-1, ENC_NA);
7385
1
}
7386
7387
/*
7388
 * 8.100        TWAN Identifier
7389
 */
7390
static const value_string gtpv2_twan_relay_id_type_vals[] = {
7391
    { 0, "IPv4 or IPv6 Address" },
7392
    { 1, "FQDN" },
7393
    { 0, NULL }
7394
};
7395
7396
void
7397
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_)
7398
17
{
7399
17
    int offset = 0;
7400
17
    uint8_t flags=0;
7401
17
    uint32_t ssid_len, civa_len, op_name_len, relay_id_type, relay_id_len, circuit_id_id_len;
7402
17
    static int* const twan_id_flags[] = {
7403
17
        &hf_gtpv2_twan_laii,
7404
17
        &hf_gtpv2_twan_opnai,
7405
17
        &hf_gtpv2_twan_plmni,
7406
17
        &hf_gtpv2_twan_civai,
7407
17
        &hf_gtpv2_twan_bssidi,
7408
17
        NULL
7409
17
    };
7410
7411
    /* Octet 5 Spare    LAII OPNAI PLMNI CIVAI BSSIDI */
7412
17
    flags = tvb_get_uint8(tvb, offset);
7413
17
    proto_tree_add_bitmask(tree, tvb, offset, hf_gtpv2_twan_flags, ett_gtpv2_twan_flags, twan_id_flags, ENC_BIG_ENDIAN);
7414
17
    offset++;
7415
    /* Octet 6 SSID Length */
7416
17
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_ssid_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ssid_len);
7417
17
    offset += 1;
7418
    /* 7 to k SSID */
7419
17
    proto_tree_add_item(tree, hf_gtpv2_twan_ssid, tvb, offset, ssid_len, ENC_NA);
7420
17
    offset += ssid_len;
7421
    /* (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.*/
7422
17
    if (flags & 0x01) {
7423
12
        proto_tree_add_item(tree, hf_gtpv2_twan_bssid, tvb, offset, 6, ENC_NA);
7424
12
        offset += 6;
7425
12
    }
7426
    /* q Civic Address Length The CIVAI flag in octet 5 indicates whether the Civic Address Length
7427
     * and Civic Address Information in octets 'q' and 'q+1' to 'q+r' shall be present.
7428
     */
7429
17
    if (flags & 0x02) {
7430
3
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_civa_len, tvb, offset, 1, ENC_BIG_ENDIAN, &civa_len);
7431
3
        offset += 1;
7432
        /* (q+1) to (q+r) Civic Address Information
7433
         * ...it shall be encoded as defined in subclause 3.1 of IETF RFC 4776 [59] excluding the first 3 octets.
7434
         * RFC 4776:
7435
         * 3.1.  Overall Format for DHCPv4
7436
7437
         * 0                   1                   2                   3
7438
         * 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
7439
         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7440
         * | GEOCONF_CIVIC |       N       |      what     |    country    |
7441
         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7442
         * |    code       |        civic address elements                ...
7443
         * +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
7444
         */
7445
3
        proto_tree_add_item(tree, hf_gtpv2_twan_civa, tvb, offset, civa_len, ENC_NA);
7446
3
        offset += civa_len;
7447
3
    }
7448
    /* s to (s+3) TWAN PLMN-ID The PLMNI flag in octet 5 indicates whether the TWAN PLMN-ID
7449
     * in octets 's' to 's+3' shall be present
7450
     */
7451
17
    if (flags & 0x04) {
7452
3
        proto_tree_add_item(tree, hf_gtpv2_twan_plmnid, tvb, offset, 3, ENC_NA);
7453
3
        offset += 3;
7454
        /* (q+1) to (q+r) Civic Address Information
7455
        * ...it shall be encoded as defined in subclause 3.1 of IETF RFC 4776 [59] excluding the first 3 octets.
7456
        */
7457
3
    }
7458
    /* t TWAN Operator Name Length, The OPNAI flag in octet 5 indicates whether the TWAN Operator Name Length and
7459
     * TWAN Operator Name in octets 't' and 't+1' to 't+u' shall be present.
7460
     */
7461
17
    if (flags & 0x08) {
7462
4
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_op_name_len, tvb, offset, 1, ENC_BIG_ENDIAN, &op_name_len);
7463
4
        offset += 1;
7464
        /* (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  */
7465
4
        proto_tree_add_item(tree, hf_gtpv2_twan_op_name, tvb, offset, op_name_len, ENC_NA);
7466
4
        offset += op_name_len;
7467
4
    }
7468
    /* The LAII flag in octet 5 indicates whether the Logical Access ID information is present in the TWAN Identifier  */
7469
17
    if (flags & 0x10) {
7470
        /* v Relay Identity Type */
7471
11
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_relay_id_type, tvb, offset, 1, ENC_BIG_ENDIAN, &relay_id_type);
7472
11
        offset += 1;
7473
        /* (v+1) Relay Identity Length*/
7474
11
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_relay_id_len, tvb, offset, 1, ENC_BIG_ENDIAN, &relay_id_len);
7475
11
        offset += 1;
7476
        /* (v+2) to (v+w) Relay Identity */
7477
11
        switch (relay_id_type) {
7478
2
        case 0:
7479
            /* IPv4 or IPv6 Address */
7480
2
            if (relay_id_len == 4) {
7481
                /* IPv4 */
7482
0
                proto_tree_add_item(tree, hf_gtpv2_twan_relay_id_ipv4, tvb, offset, 4, ENC_BIG_ENDIAN);
7483
0
                offset += 4;
7484
2
            } else {
7485
2
                proto_tree_add_item(tree, hf_gtpv2_twan_relay_id_ipv6, tvb, offset, 16, ENC_NA);
7486
2
                offset += 16;
7487
2
            }
7488
2
            break;
7489
1
        case 1:
7490
            /* fall trough */
7491
1
            proto_tree_add_item(tree, hf_gtpv2_twan_relay_id, tvb, offset, relay_id_len, ENC_ASCII);
7492
1
            offset += relay_id_len;
7493
9
        default:
7494
9
            break;
7495
11
        }
7496
        /* X Circuit-ID Length */
7497
10
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_twan_circuit_id_len, tvb, offset, 1, ENC_BIG_ENDIAN, &circuit_id_id_len);
7498
10
        offset += 1;
7499
        /* (x+1) to (x+y) Circuit-ID */
7500
10
        proto_tree_add_item(tree, hf_gtpv2_twan_circuit_id, tvb, offset, circuit_id_id_len, ENC_NA);
7501
10
        offset += circuit_id_id_len;
7502
10
    }
7503
7504
16
    if (offset < (int)length) {
7505
3
        proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
7506
3
    }
7507
7508
16
}
7509
/*
7510
 * 8.101        ULI Timestamp
7511
 */
7512
static void
7513
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_)
7514
14
{
7515
14
    char *time_str;
7516
7517
    /* Octets 5 to 8 are encoded in the same format as the first four octets of the 64-bit timestamp
7518
     * format as defined in section 6 of IETF RFC 5905
7519
     */
7520
7521
14
    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);
7522
14
    proto_item_append_text(item, "%s", time_str);
7523
7524
14
}
7525
/*
7526
 * 8.102        MBMS Flags
7527
 */
7528
static void
7529
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_)
7530
2
{
7531
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7532
2
}
7533
/*
7534
 * 8.103        RAN/NAS Cause
7535
 */
7536
static const value_string ran_nas_prot_type_vals[] = {
7537
    { 1, "S1AP Cause" },
7538
    { 2, "EMM Cause" },
7539
    { 3, "ESM Cause" },
7540
    { 4, "Diameter Cause" },
7541
    { 5, "IKEv2 Cause" },
7542
    { 0, NULL },
7543
};
7544
7545
static void
7546
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_)
7547
4
{
7548
4
    int offset = 0;
7549
4
    uint8_t octet = tvb_get_uint8(tvb, offset);
7550
4
    uint8_t proto_type = (octet >> 4);
7551
4
    int cause_type = 0;
7552
7553
4
    proto_tree_add_item(tree, hf_gtpv2_ran_nas_protocol_type, tvb, offset, 1, ENC_BIG_ENDIAN);
7554
7555
4
    if (proto_type == 1) {
7556
0
        proto_tree_add_item(tree, hf_gtpv2_ran_nas_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
7557
0
        cause_type = octet & 0x0F;
7558
0
    }
7559
4
    offset += 1;
7560
7561
4
    switch (proto_type) {
7562
0
        case 1:
7563
0
                dissect_gtpv2_s1ap_cause(tvb, pinfo, tree, offset, cause_type);
7564
0
                break;
7565
0
        case 2:
7566
0
                proto_tree_add_item(tree, hf_gtpv2_emm_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
7567
0
                break;
7568
0
        case 3:
7569
0
                proto_tree_add_item(tree, hf_gtpv2_esm_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
7570
0
                break;
7571
1
        case 4:
7572
1
                proto_tree_add_item(tree, hf_gtpv2_diameter_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
7573
1
                break;
7574
0
        case 5:
7575
0
                proto_tree_add_item(tree, hf_gtpv2_ikev2_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
7576
0
                break;
7577
3
        default:
7578
3
                proto_tree_add_item(tree, hf_gtpv2_ran_nas_cause_value, tvb, offset, length - offset, ENC_BIG_ENDIAN);
7579
3
                break;
7580
4
    }
7581
4
}
7582
/*
7583
 * 8.104        CN Operator Selection Entity
7584
 */
7585
static void
7586
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_)
7587
2
{
7588
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7589
2
}
7590
/*
7591
 * 8.105        Trusted WLAN Mode Indication
7592
 */
7593
static void
7594
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_)
7595
2
{
7596
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
7597
2
}
7598
/*
7599
 * 8.106        Node Number
7600
 */
7601
static void
7602
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_)
7603
2
{
7604
2
    int offset = 0;
7605
2
    uint32_t len;
7606
2
    tvbuff_t* new_tvb;
7607
7608
    /* Octet 5 Length of Node Number*/
7609
2
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_node_number_len, tvb, offset, 1, ENC_BIG_ENDIAN, &len);
7610
2
    offset += 1;
7611
7612
    /* The Node number shall carry an ISDN number...
7613
     * shall be coded according to the contents of ISDN-AddressString data type
7614
     * defined in 3GPP TS 29.002
7615
     */
7616
2
    new_tvb = tvb_new_subset_length(tvb, offset, len);
7617
2
    dissect_gsm_map_msisdn(new_tvb, pinfo, tree);
7618
2
}
7619
/*
7620
 * 8.107        Node Identifier
7621
 */
7622
static void
7623
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_)
7624
4
{
7625
4
    int   offset = 0;
7626
4
    uint32_t name_len;
7627
7628
    /*
7629
    RFC 6733
7630
    DiameterIdentity
7631
7632
    The DiameterIdentity format is derived from the OctetString Basic
7633
    AVP Format....In this document, note that DiameterIdentity is
7634
      in ASCII form.
7635
7636
    TS 29.274
7637
7638
    If the Node Identifier contains a SGSN Identifier then:
7639
    - 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;
7640
    - 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;
7641
    - 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.
7642
        6.4.13  SGSN-Name
7643
        The SGSN-Name AVP is of type DiameterIdentity...see IETF RFC 6733
7644
        6.4.14    SGSN-Realm
7645
        The SGSN-Realm AVP is of type DiameterIdentity...see IETF RFC 6733
7646
7647
    If the Node Identifier contains a MME Identifier then:
7648
    - 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;
7649
    - 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;
7650
    -  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.
7651
        6.4.4    MME-Name
7652
        The MME-Name AVP is of type DiameterIdentity...see IETF RFC 6733
7653
        6.4.12 MME-Realm
7654
        The MME-Realm AVP is of type DiameterIdentity...see IETF RFC 6733
7655
7656
    If the Node Identifier contains a 3GPP AAA Server Identifier then:
7657
    - 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;
7658
        8.2.3.24    3GPP-AAA-Server-Name
7659
        The 3GPP-AAA-Server-Name AVP is of type DiameterIdentity
7660
    - 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].
7661
7662
    If the Node Identifier contains an SCEF/IWK-SCEF information, then:
7663
    - the Node Name shall be coded as the SCEF-ID as defined in subclause 8.4.5 of 3GPP TS 29.336 [69] and;
7664
        8.4.5 SCEF-ID
7665
        The SCEF- ID AVP is of type DiameterIdentity
7666
    - 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].
7667
7668
    */
7669
    /* Octet 5 Length of Node Name */
7670
4
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_length_of_node_name, tvb, offset, 1, ENC_BIG_ENDIAN, &name_len);
7671
4
    offset++;
7672
    /* Node Name */
7673
4
    proto_tree_add_item(tree, hf_gtpv2_node_name, tvb, offset, name_len, ENC_UTF_8);
7674
4
    offset = offset + name_len;
7675
    /* Length of Node Realm */
7676
4
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_length_of_node_realm, tvb, offset, 1, ENC_BIG_ENDIAN, &name_len);
7677
4
    offset++;
7678
    /* Node Realm */
7679
4
    proto_tree_add_item(tree, hf_gtpv2_node_realm, tvb, offset, name_len, ENC_UTF_8);
7680
4
    offset = offset + name_len;
7681
4
    if(offset < length){
7682
1
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length- offset);
7683
1
    }
7684
4
}
7685
/*
7686
 * 8.108        Presence Reporting Area Action
7687
 */
7688
7689
/*
7690
 * The Presence-Reporting-Area-Elements-List AVP (AVP code 2820)
7691
 * is of type Octetstring and is coded as specified in 3GPP TS 29.274 [22]
7692
 * in Presence Reporting Area Action IE, starting from octet 9.
7693
 */
7694
7695
static int
7696
dissect_diameter_3gpp_presence_reporting_area_elements_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
7697
137
{
7698
    /*diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;*/
7699
137
    proto_tree *sub_tree;
7700
137
    proto_item *item;
7701
137
    int   offset = 0, i;
7702
137
    unsigned length;
7703
137
    uint32_t no_tai, no_rai, no_mENB, no_hENB, no_ECGI, no_sai, no_cgi, no_ext_mENB;
7704
137
    char *append_str;
7705
137
    length       = tvb_reported_length(tvb);
7706
7707
    /* Octet 9  Number of TAI   Number of RAI */
7708
137
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_tai, tvb, offset, 1, ENC_BIG_ENDIAN, &no_tai);
7709
137
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_rai, tvb, offset, 1, ENC_BIG_ENDIAN, &no_rai);
7710
137
    offset++;
7711
    /* Octet 10 Spare   Number of Macro eNodeB */
7712
137
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_m_enodeb, tvb, offset, 1, ENC_BIG_ENDIAN, &no_mENB);
7713
137
    offset++;
7714
    /* Octet 11 Spare   Number of Home eNodeB */
7715
137
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_h_enodeb, tvb, offset, 1, ENC_BIG_ENDIAN, &no_hENB);
7716
137
    offset++;
7717
    /* Octet 12 Spare   Number of ECGI */
7718
137
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_ecgi, tvb, offset, 1, ENC_BIG_ENDIAN, &no_ECGI);
7719
137
    offset++;
7720
    /* Octet 13 Spare   Number of SAI */
7721
137
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_sai, tvb, offset, 1, ENC_BIG_ENDIAN, &no_sai);
7722
137
    offset++;
7723
    /* Octet 14 Spare   Number of CGI */
7724
137
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_pres_rep_area_act_no_cgi, tvb, offset, 1, ENC_BIG_ENDIAN, &no_cgi);
7725
137
    offset++;
7726
    /* Octet 15 to k    TAIs [1..15] */
7727
137
    i = 1;
7728
696
    while (no_tai > 0){
7729
559
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 5, ett_gtpv2_preaa_tais, &item, "Tracking Area Identity (TAI) Number %u",i);
7730
559
        append_str = dissect_gtpv2_tai(tvb, pinfo, sub_tree, &offset, false);
7731
559
        proto_item_append_text(item, " %s",append_str);
7732
559
        i++;
7733
559
        no_tai--;
7734
559
    }
7735
    /* Octet (k+1) to m Macro eNB IDs [1..63]
7736
     * 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.
7737
     * Octets 'k+1' to 'm' shall be absent if the field 'Number of Macro eNodeB' is set to the value '0'.
7738
     */
7739
137
    i = 1;
7740
1.07k
    while (no_mENB > 0){
7741
938
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 6, ett_gtpv2_preaa_menbs, &item, "Macro eNB ID %u",i);
7742
938
        append_str = dissect_gtpv2_macro_enodeb_id(tvb, pinfo, sub_tree, &offset);
7743
938
        proto_item_append_text(item, " %s",append_str);
7744
938
        i++;
7745
938
        no_mENB--;
7746
938
    }
7747
    /* Octet (m+1) to p Home eNB IDs [1..63]
7748
     * 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.
7749
     * Octets  'm+1' to 'p' shall be absent if the field 'Number of Home eNodeB' is set to the value '0'.
7750
     */
7751
137
    i = 1;
7752
1.36k
    while (no_hENB > 0){
7753
1.23k
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_henbs, &item, "Home eNB ID %u",i);
7754
1.23k
        append_str = dissect_gtpv2_home_enodeb_id(tvb, pinfo, sub_tree, &offset);
7755
1.23k
        proto_item_append_text(item, " %s",append_str);
7756
1.23k
        i++;
7757
1.23k
        no_hENB--;
7758
1.23k
    }
7759
    /* Octet (p+1) to q ECGIs [1..63]
7760
     * ECGIs in octets 'p+1' to 'q', if any, shall be encoded as per the ECGI field in subclause 8.21.5.
7761
     * Octets 'p+1' to 'q' shall be absent if the field 'Number of ECGI' is set to the value '0'.
7762
     */
7763
137
    i = 1;
7764
800
    while (no_ECGI > 0){
7765
663
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_ecgis, &item, "ECGI ID %u",i);
7766
663
        append_str = dissect_gtpv2_ecgi(tvb, pinfo, sub_tree, &offset);
7767
663
        proto_item_append_text(item, " %s",append_str);
7768
663
        i++;
7769
663
        no_ECGI--;
7770
663
    }
7771
    /* Octet (q+1) to r RAIs [1..15]
7772
     * RAIs in octets 'q+1' to 'r', if any, shall be encoded as per the RAI field in subclause 8.21.3.
7773
     * Octets 'q+1' to 'r' shall be absent if the field 'Number of RAI' is set to the value '0'.
7774
     */
7775
137
    i = 1;
7776
423
    while (no_rai > 0){
7777
286
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_rais, &item, "RAI ID %u",i);
7778
286
        append_str = dissect_gtpv2_rai(tvb, pinfo, sub_tree, &offset);
7779
286
        proto_item_append_text(item, " %s",append_str);
7780
286
        i++;
7781
286
        no_rai--;
7782
286
    }
7783
    /* Octet (r+1) to s SAIs [1..63]
7784
     * SAIs in octets 'r+1' to 's', if any, shall be encoded as per the SAI field in subclause 8.21.2.
7785
     * Octets 'r+1' to 's' shall be absent if the field 'Number of SAI' is set to the value '0'.
7786
     */
7787
137
    i = 1;
7788
964
    while (no_sai > 0){
7789
827
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_sais, &item, "SAI ID %u",i);
7790
827
        append_str = dissect_gtpv2_sai_common(tvb, pinfo, sub_tree, &offset);
7791
827
        proto_item_append_text(item, " %s",append_str);
7792
827
        i++;
7793
827
        no_sai--;
7794
827
    }
7795
    /* Octet (s+1) to t CGIs [1..63]
7796
     * CGIs in octets 's+1' to 't', if any, shall be encoded as per the CGI field in subclause 8.21.1.
7797
     * Octets 's+1' to 't' shall be absent if the field 'Number of CGI' is set to the value '0'.
7798
     */
7799
137
    i = 1;
7800
713
    while (no_cgi > 0){
7801
576
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 7, ett_gtpv2_preaa_cgis, &item, "CGI ID %u",i);
7802
576
        append_str = dissect_gtpv2_cgi(tvb, pinfo, sub_tree, &offset);
7803
576
        proto_item_append_text(item, " %s",append_str);
7804
576
        i++;
7805
576
        no_cgi--;
7806
576
    }
7807
137
    if (offset >= (int) length)
7808
29
        return length;
7809
    /* Octet t+1 Spare   Number of Extended Macro eNodeB */
7810
108
    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);
7811
108
    offset++;
7812
    /* Octet (t+2) to v Extended Macro eNB IDs [1..63]
7813
     * 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.
7814
     * Octets 'k+1' to 'm' shall be absent if the field 'Number of Extended Macro eNodeB' is set to the value '0'.
7815
     */
7816
108
    i = 1;
7817
311
    while (no_ext_mENB > 0){
7818
203
        sub_tree = proto_tree_add_subtree_format(tree, tvb, offset, 6, ett_gtpv2_preaa_ext_menbs, &item, "Extended Macro eNB ID %u",i);
7819
203
        append_str = dissect_gtpv2_ext_macro_enodeb_id(tvb, pinfo, sub_tree, &offset, hf_gtpv2_ext_macro_enodeb_id);
7820
203
        proto_item_append_text(item, " %s",append_str);
7821
203
        i++;
7822
203
        no_ext_mENB--;
7823
203
    }
7824
7825
108
    return length;
7826
137
}
7827
7828
static const value_string gtpv2_pres_rep_area_action_vals[] = {
7829
    { 1, "Start Reporting change"},
7830
    { 2, "Stop Reporting change"},
7831
    { 3, "Modify Presence Reporting Area elements"},
7832
    { 0, NULL}
7833
};
7834
7835
static void
7836
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_)
7837
140
{
7838
140
    int offset = 0;
7839
140
    tvbuff_t * new_tvb;
7840
7841
140
    static int * const flags[] = {
7842
140
        &hf_gtpv2_pres_rep_area_act_inapra,
7843
140
        &hf_gtpv2_pres_rep_area_action,
7844
140
        NULL
7845
140
    };
7846
7847
    /* Octet 5  Spare INAPRA Action */
7848
140
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags, ENC_BIG_ENDIAN);
7849
140
    offset++;
7850
7851
140
    if (length == 1)
7852
2
        return;
7853
    /* Octet 6 to 8     Presence Reporting Area Identifier */
7854
138
    proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_id, tvb, offset, 3, ENC_BIG_ENDIAN);
7855
138
    offset+=3;
7856
138
    if (length == 4)
7857
1
        return;
7858
7859
137
    new_tvb = tvb_new_subset_length(tvb, offset, length-4);
7860
7861
    /* Share the rest of the dissection with the AVP dissector */
7862
137
    dissect_diameter_3gpp_presence_reporting_area_elements_list(new_tvb, pinfo, tree, NULL);
7863
7864
137
}
7865
/*
7866
 * 8.109        Presence Reporting Area Information
7867
 */
7868
static void
7869
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_)
7870
26
{
7871
26
    int offset = 0;
7872
26
    uint64_t gtpv2_pres_rep_area_info_flags_val = 0;
7873
7874
    /*Octet 5 to 7      Presence Reporting Area Identifier */
7875
26
    proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_info_id, tvb, offset, 3 , ENC_BIG_ENDIAN);
7876
26
    offset+=3;
7877
7878
    /*Octet 8    Spare Spare Spare Spare INAPRA APRA OPRA IPRA */
7879
26
    static int * const gtpv2_pres_rep_area_info_flags[] = {
7880
26
        &hf_gtpv2_pres_rep_area_info_flags_b4_b7_spare,
7881
26
        &hf_gtpv2_pres_rep_area_info_flags_b3_inapra,
7882
26
        &hf_gtpv2_pres_rep_area_info_flags_b2_apra,
7883
26
        &hf_gtpv2_pres_rep_area_info_flags_b1_opra,
7884
26
        &hf_gtpv2_pres_rep_area_info_flags_b0_ipra,
7885
26
        NULL
7886
26
    };
7887
7888
26
    proto_tree_add_bitmask_with_flags_ret_uint64(tree, tvb, offset, hf_gtpv2_pres_rep_area_info_flags, ett_gtpv2_pres_rep_area_info,
7889
26
            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);
7890
26
    offset+=1;
7891
7892
    /* 3GPP TS 29.212 v14.7.0:
7893
     * If the Additional PRA (APRA) flag is set to 1, [...]
7894
     * subsequent 4 octets shall then be present
7895
     * and shall contain the identifier of the individual PRA
7896
     */
7897
26
    if(gtpv2_pres_rep_area_info_flags_val & 0x04){
7898
        /* Octets a to (a+2)        Additional PRA Identifier  */
7899
23
    proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_info_additional_id, tvb, offset, 3, ENC_BIG_ENDIAN);
7900
23
    offset+=3;
7901
7902
        /*Octet a+3          Spare Spare Spare Spare Spare APRA OPRA IPRA */
7903
23
    static int * const gtpv2_pres_rep_area_info_flags_no_inapra[] = {
7904
23
      &hf_gtpv2_pres_rep_area_info_flags_b3_b7_spare,
7905
23
      &hf_gtpv2_pres_rep_area_info_flags_b2_apra,
7906
23
      &hf_gtpv2_pres_rep_area_info_flags_b1_opra,
7907
23
      &hf_gtpv2_pres_rep_area_info_flags_b0_ipra,
7908
23
      NULL
7909
23
    };
7910
7911
1.75k
        while(offset < length){
7912
1.72k
            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,
7913
1.72k
                         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);
7914
1.72k
            offset+=1;
7915
7916
1.72k
            if(gtpv2_pres_rep_area_info_flags_val & 0x04){
7917
                /* Octets b to (b+2)     Additional PRA Identifier  */
7918
506
                proto_tree_add_item(tree, hf_gtpv2_pres_rep_area_info_additional_id, tvb, offset, 3, ENC_BIG_ENDIAN);
7919
506
                offset+=3;
7920
506
            }
7921
1.72k
        }
7922
23
    }
7923
26
}
7924
/*
7925
 * 8.110        TWAN Identifier Timestamp
7926
 */
7927
static void
7928
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_)
7929
2
{
7930
2
    char *time_str;
7931
7932
    /* TWAN Identifier Timestamp value */
7933
    /* Octets 5 to 8 are encoded in the same format as the first four octets of the 64-bit timestamp
7934
    * format as defined in section 6 of IETF RFC 5905
7935
    */
7936
7937
2
    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);
7938
2
    proto_item_append_text(item, "%s", time_str);
7939
7940
2
}
7941
/*
7942
 * 8.111        Overload Control Information
7943
 */
7944
static void
7945
7946
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_)
7947
12
{
7948
7949
12
    int         offset = 0;
7950
12
    proto_tree *grouped_tree;
7951
12
    tvbuff_t   *new_tvb;
7952
7953
12
    proto_item_append_text(item, "[Grouped IE]");
7954
12
    grouped_tree = proto_item_add_subtree(item, ett_gtpv2_overload_control_information);
7955
12
    new_tvb = tvb_new_subset_length(tvb, offset, length);
7956
7957
12
    dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_OVERLOAD_CONTROL_INF);
7958
12
}
7959
/*
7960
 * 8.112        Load Control Information
7961
 */
7962
static void
7963
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_)
7964
8
{
7965
8
    int         offset = 0;
7966
8
    tvbuff_t   *new_tvb;
7967
8
    proto_tree *grouped_tree;
7968
7969
8
    proto_item_append_text(item, "[Grouped IE]");
7970
8
    grouped_tree = proto_item_add_subtree(item, ett_gtpv2_load_control_inf);
7971
7972
8
    new_tvb = tvb_new_subset_length(tvb, offset, length);
7973
8
    dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, 0, message_type, args, GTPV2_IE_LOAD_CONTROL_INF);
7974
8
}
7975
/*
7976
 * 8.113        Metric
7977
 */
7978
static void
7979
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_)
7980
2
{
7981
2
   uint32_t oct;
7982
7983
2
   proto_tree_add_item_ret_uint(tree, hf_gtpv2_metric, tvb, 0, 1, ENC_BIG_ENDIAN, &oct);
7984
2
   if (oct > 0x64) {
7985
1
       proto_item_append_text(item, "Metric: value beyond 100 is considered as 0");
7986
1
   } else {
7987
1
       proto_item_append_text(item, "%u", oct);
7988
7989
1
   }
7990
2
}
7991
/*
7992
 * 8.114        Sequence Number
7993
 */
7994
static void
7995
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_)
7996
3
{
7997
3
    uint32_t seq;
7998
3
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_sequence_number, tvb, 0, 4, ENC_BIG_ENDIAN, &seq);
7999
3
    proto_item_append_text(item, "%u", seq);
8000
3
}
8001
/*
8002
 * 8.115        APN and Relative Capacity
8003
 */
8004
static void
8005
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_)
8006
49
{
8007
49
    int       offset = 0;
8008
49
    uint8_t oct, apn_length;
8009
49
    const uint8_t *apn    = NULL;
8010
8011
49
    oct = tvb_get_uint8(tvb, offset);
8012
49
    proto_tree_add_item(tree, hf_gtpv2_relative_capacity, tvb, offset, 1, ENC_BIG_ENDIAN);
8013
49
    if((oct > 0x64) || (oct < 0x01))
8014
43
        proto_item_append_text(item, "Relative Capacity: value beyond (1,100) is considered as 0");
8015
49
    offset += 1;
8016
49
    apn_length = tvb_get_uint8(tvb, offset);
8017
49
    proto_tree_add_item(tree, hf_gtpv2_apn_length, tvb, offset, 1, ENC_BIG_ENDIAN);
8018
49
    offset += 1;
8019
8020
49
    if (apn_length > 0) {
8021
46
        proto_item* pi;
8022
46
        pi = proto_tree_add_item_ret_string(tree, hf_gtpv2_apn, tvb, offset, apn_length, ENC_APN_STR | ENC_NA, pinfo->pool, &apn);
8023
46
        if (apn_length > 100)
8024
41
            expert_add_info(pinfo, pi, &ei_gtpv2_apn_too_long);
8025
46
    }
8026
49
}
8027
/*
8028
 * 8.117        Paging and Service Information
8029
 */
8030
static void
8031
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_)
8032
7
{
8033
7
    int offset = 0;
8034
7
    uint8_t ppi_flag;
8035
8036
    /* Spare (all bits set to 0) B8 - B5 */
8037
7
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 4, ENC_BIG_ENDIAN);
8038
    /* EPS Bearer ID (EBI) B4 - B1 */
8039
7
    proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
8040
7
    offset += 1;
8041
8042
    /* Spare B8 - B2 */
8043
7
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 7, ENC_BIG_ENDIAN);
8044
    /* Paging Policy Indication flag (PPI) */
8045
7
    ppi_flag = tvb_get_uint8(tvb, offset);
8046
7
    proto_tree_add_item(tree, hf_gtpv2_ppi_flag, tvb, offset, 1, ENC_BIG_ENDIAN);
8047
7
    offset += 1;
8048
8049
7
    if(ppi_flag & 1){
8050
        /* Spare B8 - B7 */
8051
1
        proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 2, ENC_BIG_ENDIAN);
8052
        /* Paging Policy Indication Value */
8053
1
        proto_item_append_text(tree, " (PPI Value: %s)", val_to_str_ext_const(tvb_get_uint8(tvb, offset), &dscp_vals_ext, "Unknown"));
8054
1
        proto_tree_add_item(tree, hf_gtpv2_ppi_value, tvb, offset, 1, ENC_BIG_ENDIAN);
8055
1
    }
8056
7
}
8057
/*
8058
 * 8.118        Integer Number
8059
 */
8060
static void
8061
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_)
8062
4
{
8063
4
    int offset = 0;
8064
    /* The Integer Number value shall be encoded as further described below for the following information elements:
8065
     * 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.
8066
     * DL Buffering Suggested Packet Count IE: the length shall be set to 1 or 2;
8067
     * 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].
8068
     */
8069
4
    if (length <= 4) {
8070
        /* Only handle up to 32 bits for now */
8071
1
        switch (message_type) {
8072
0
        case GTPV2_CREATE_SESSION_REQUEST:
8073
0
            proto_item_append_text(item, "Maximum Wait Time");
8074
0
            proto_tree_add_item(tree, hf_gtpv2_maximum_wait_time, tvb, offset, length, ENC_BIG_ENDIAN);
8075
0
            break;
8076
0
        case GTPV2_DL_DATA_NOTIF_ACK:
8077
0
            proto_item_append_text(item, "DL Buffering Suggested Packet Count");
8078
0
            proto_tree_add_item(tree, hf_gtpv2_dl_buf_sug_pkt_cnt, tvb, offset, length, ENC_BIG_ENDIAN);
8079
0
            break;
8080
0
        case GTPV2_FORWARD_RELOCATION_REQ:
8081
0
        case GTPV2_CONTEXT_RESPONSE:
8082
0
        case GTPV2_IDENTIFICATION_RESPONSE:
8083
0
            switch (instance) {
8084
0
            case 0:
8085
                /* 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. */
8086
0
                proto_item_append_text(item, "UE Usage Type");
8087
0
                if (length > 0) {
8088
0
                    proto_tree_add_item(tree, hf_gtpv2_ue_usage_type, tvb, offset, length, ENC_BIG_ENDIAN);
8089
0
                } else {
8090
0
                    proto_item_append_text(item, " not available in the old MME/SGSN/AMF");
8091
0
                }
8092
0
                break;
8093
0
            case 1:
8094
                /* Remaining Running Service Gap Timer */
8095
0
                proto_tree_add_item(tree, hf_gtpv2_rem_run_serv_gap_t, tvb, offset, length, ENC_BIG_ENDIAN);
8096
0
                break;
8097
0
            default:
8098
0
                proto_tree_add_item(tree, hf_gtpv2_integer_number_val, tvb, offset, length, ENC_BIG_ENDIAN);
8099
0
                break;
8100
0
            }
8101
0
            break;
8102
1
        default:
8103
1
            proto_tree_add_item(tree, hf_gtpv2_integer_number_val, tvb, offset, length, ENC_BIG_ENDIAN);
8104
1
            break;
8105
1
        }
8106
3
    } else {
8107
        /* value not handled, yet*/
8108
3
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_int_size_not_handled, tvb, offset, length);
8109
8110
3
    }
8111
8112
4
}
8113
/*
8114
 * 8.119 Millisecond Time Stamp
8115
 */
8116
8117
static void
8118
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_)
8119
2
{
8120
2
    int offset = 0;
8121
    /* Octets 5 to 10 represent a 48 bit unsigned integer in network order format and are encoded as
8122
     * the number of milliseconds since 00:00:00 January 1, 1900 00:00 UTC, i.e. as the
8123
     * rounded value of 1000 x the value of the 64-bit timestamp (Seconds  + (Fraction / (1<<32)))
8124
     * defined in section 6 of IETF RFC 5905
8125
     */
8126
2
    switch (message_type) {
8127
0
    case GTPV2_CREATE_SESSION_REQUEST:
8128
        /*proto_item_append_text(item, "Origination time stamp");*/
8129
0
        proto_tree_add_item(tree, hf_gtpv2_origination_ts, tvb, offset, length, ENC_TIME_MSEC_NTP | ENC_BIG_ENDIAN);
8130
0
        break;
8131
2
    default:
8132
2
        proto_tree_add_item(tree, hf_gtpv2_ms_ts, tvb, offset, 6, ENC_TIME_MSEC_NTP | ENC_BIG_ENDIAN);
8133
2
        break;
8134
2
    }
8135
2
}
8136
8137
/*
8138
 * 8.120        Monitoring Event Information
8139
 */
8140
static void
8141
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_)
8142
2
{
8143
2
    int offset = 0;
8144
2
    bool srie;
8145
2
    uint32_t scef_id_len;
8146
8147
    /* Octet 4 higher four bits flags SIRE, NSCF, NSUI and NSUR */
8148
2
    proto_tree_add_item_ret_boolean(tree, hf_gtpv2_mon_event_inf_srie, tvb, offset, 1, ENC_BIG_ENDIAN, &srie);
8149
2
    proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_nscf, tvb, offset, 1, ENC_BIG_ENDIAN);
8150
2
    proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_nsui, tvb, offset, 1, ENC_BIG_ENDIAN);
8151
2
    proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_nsur, tvb, offset, 1, ENC_BIG_ENDIAN);
8152
8153
    /* Octet 4 lower four bits Instance */
8154
2
    proto_tree_add_item(tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
8155
2
    offset++;
8156
8157
    /* Octet 5 to 8 SCEF Reference ID */
8158
2
    proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_scef_reference_id, tvb, offset, 4, ENC_BIG_ENDIAN);
8159
2
    offset += 4;
8160
    /* Octet 9 Length of SCEF ID */
8161
2
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_mon_event_inf_scef_id_length, tvb, offset, 1, ENC_BIG_ENDIAN, &scef_id_len);
8162
2
    offset++;
8163
    /* Octet 10 to k SCEF ID */
8164
2
    proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_scef_id, tvb, offset, scef_id_len, ENC_UTF_8);
8165
2
    offset = offset + scef_id_len;
8166
    /* Octet (k+1) to (k+2) Remaining Number of Reports */
8167
2
    proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_remaining_number_of_reports, tvb, offset, 2, ENC_BIG_ENDIAN );
8168
2
    offset += 2;
8169
8170
2
    if (srie) {
8171
1
        proto_tree_add_item(tree, hf_gtpv2_mon_event_inf_scef_reference_id_ext, tvb, offset, 8, ENC_BIG_ENDIAN);
8172
1
        offset += 8;
8173
1
    }
8174
8175
2
    if(offset < length){
8176
1
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length - offset);
8177
1
    }
8178
2
}
8179
8180
/*
8181
 * 8.125 CIoT Optimizations Support Indication
8182
 */
8183
static void
8184
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_)
8185
1
{
8186
1
   int               offset;
8187
1
   static int * const ciot_flags[] = {
8188
1
       &hf_gtpv2_ciot_support_ind_spare_bits,
8189
1
       &hf_gtpv2_ciot_support_ind_bit4,
8190
1
       &hf_gtpv2_ciot_support_ind_bit3,
8191
1
       &hf_gtpv2_ciot_support_ind_bit2,
8192
1
       &hf_gtpv2_ciot_support_ind_bit1,
8193
1
       NULL
8194
1
   };
8195
8196
1
   offset = 0;
8197
1
   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);
8198
8199
1
   offset += 1;
8200
1
   if (length - offset) {
8201
1
      proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
8202
1
   }
8203
1
}
8204
8205
/*
8206
 * 8.126 SCEF PDN Connection
8207
 */
8208
static void
8209
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)
8210
1
{
8211
1
   int         offset = 0;
8212
1
   proto_tree *grouped_tree;
8213
1
   tvbuff_t   *new_tvb;
8214
8215
1
   proto_item_append_text(item, "[Grouped IE]");
8216
1
   grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PDN_conn);
8217
1
   new_tvb = tvb_new_subset_length(tvb, offset, length);
8218
8219
1
   dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_SCEF_PDN_CONNECTION);
8220
8221
1
}
8222
8223
8224
/*
8225
 * 8.127 Header Compression Configuration
8226
 */
8227
static void
8228
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_)
8229
5
{
8230
5
    int offset = 0;
8231
8232
5
    static int * const gtpv2_rohc_profile_flags_flags[] = {
8233
5
        &hf_gtpv2_rohc_profiles_bit7,
8234
5
        &hf_gtpv2_rohc_profiles_bit6,
8235
5
        &hf_gtpv2_rohc_profiles_bit5,
8236
5
        &hf_gtpv2_rohc_profiles_bit4,
8237
5
        &hf_gtpv2_rohc_profiles_bit3,
8238
5
        &hf_gtpv2_rohc_profiles_bit2,
8239
5
        &hf_gtpv2_rohc_profiles_bit1,
8240
5
        &hf_gtpv2_rohc_profiles_bit0,
8241
5
        NULL
8242
5
    };
8243
8244
    /* Octet 5 to 6   ROHC Profiles */
8245
8246
5
    proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_gtpv2_rohc_profile_flags,
8247
5
        ett_gtpv2_rohc_profile_flags, gtpv2_rohc_profile_flags_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT);
8248
5
    offset++;
8249
5
    proto_tree_add_item(tree, hf_gtpv2_spare_w0, tvb, offset, 1, ENC_BIG_ENDIAN);
8250
5
    offset++;
8251
    /* Octet 7 to 8 MAX_CID*/
8252
5
    proto_tree_add_item(tree, hf_gtpv2_max_cid, tvb, offset, 2, ENC_BIG_ENDIAN);
8253
8254
5
}
8255
8256
/*
8257
 * 8.129 Serving PLMN Rate Control
8258
 */
8259
static void
8260
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_)
8261
1
{
8262
1
    int offset = 0;
8263
1
    proto_tree_add_item(tree, hf_gtpv2_uplink_rate_limit, tvb, offset, 2, ENC_BIG_ENDIAN);
8264
1
    offset += 2;
8265
1
    proto_tree_add_item(tree, hf_gtpv2_downlink_rate_limit, tvb, offset, 2, ENC_BIG_ENDIAN);
8266
1
}
8267
8268
/*
8269
 * 8.130 Counter
8270
 */
8271
static void
8272
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_)
8273
0
{
8274
0
    int offset = 0;
8275
8276
    /* Timestamp value */
8277
    /* Octets 5 to 8 shall be encoded in the same format as the first four octets of the 64-bit timestamp
8278
     *format as defined in section 6 of IETF RFC 5905
8279
     */
8280
8281
0
    proto_tree_add_item(tree, hf_gtpv2_timestamp_value, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8282
0
    offset += 4;
8283
0
    proto_tree_add_item(tree, hf_gtpv2_counter_value, tvb, offset, 1, ENC_BIG_ENDIAN);
8284
0
}
8285
8286
/*
8287
 * 8.131 Mapped UE Usage Type
8288
 */
8289
8290
static void
8291
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_)
8292
2
{
8293
2
    int offset = 0;
8294
8295
2
    proto_tree_add_item(tree, hf_gtpv2_mapped_ue_usage_type, tvb, offset, 2, ENC_BIG_ENDIAN);
8296
2
    offset += 2;
8297
2
    if (length > offset) {
8298
1
        proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
8299
1
    }
8300
2
}
8301
8302
/*
8303
 * 8.132 Secondary RAT Usage Data Report
8304
 */
8305
static const value_string gtpv2_secondary_rat_type_vals[] = {
8306
    { 0, "NR" },
8307
    { 1, "Unlicensed Spectrum"},
8308
    { 0, NULL }
8309
};
8310
8311
static void
8312
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_)
8313
25
{
8314
25
   tvbuff_t   *new_tvb;
8315
25
   proto_tree *sub_tree;
8316
25
   int offset = 0;
8317
25
   uint32_t srudn_len;
8318
25
   uint64_t gtpv2_secondary_rat_usage_data_report_flags_val = 0;
8319
8320
25
   static int * const secondary_rat_usage_data_report_flags[] = {
8321
25
       &hf_gtpv2_secondary_rat_usage_data_report_spare_bits,
8322
25
       &hf_gtpv2_secondary_rat_usage_data_report_bit3,
8323
25
       &hf_gtpv2_secondary_rat_usage_data_report_bit2,
8324
25
       &hf_gtpv2_secondary_rat_usage_data_report_bit1,
8325
25
       NULL
8326
25
   };
8327
8328
  /*
8329
   * The following bits within Octet 5 shall indicate:
8330
   * Bit 8 to 3 - Spare, for future use and set to zero.
8331
   * Bit 3 - SRUDN (Secondary RAT Usage Report from NG-RAN)
8332
   * Bit 2 - IRSGW (Intended Receiver SGW)
8333
   * Bit 1 - IRPGW (Intended Receiver PGW)
8334
   */
8335
25
   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,
8336
25
        secondary_rat_usage_data_report_flags, ENC_BIG_ENDIAN, BMT_NO_APPEND, &gtpv2_secondary_rat_usage_data_report_flags_val);
8337
25
   offset += 1;
8338
8339
    /* Octet 6 RAT Type */
8340
25
    proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_rat_type, tvb, offset, 1, ENC_BIG_ENDIAN);
8341
25
    offset += 1;
8342
8343
    /* Octet 7 EPS Bearer ID */
8344
    /* Spare (all bits set to 0) B8 - B5 */
8345
25
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 4, ENC_BIG_ENDIAN);
8346
    /* EPS Bearer ID (EBI) B4 - B1 */
8347
25
    proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, ENC_BIG_ENDIAN);
8348
25
    offset += 1;
8349
8350
    /*
8351
    * 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
8352
    * format as defined in section 6 of IETF RFC 5905
8353
    */
8354
8355
    /* Octets 8 to 11 Start timestamp */
8356
25
    proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_start_timestamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8357
25
    offset += 4;
8358
8359
    /* Octets 12 to 15 End timestamp */
8360
25
    proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_end_timestamp, tvb, offset, 4, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8361
25
    offset += 4;
8362
8363
    /* 16 to 23 Usage Data DL */
8364
25
    proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_usage_data_dl, tvb, offset, 8, ENC_BIG_ENDIAN);
8365
25
    offset += 8;
8366
8367
    /* 24 to 32 Usage Data UL */
8368
25
    proto_tree_add_item(tree, hf_gtpv2_secondary_rat_usage_data_report_usage_data_ul, tvb, offset, 8, ENC_BIG_ENDIAN);
8369
25
    offset += 8;
8370
8371
25
    if(gtpv2_secondary_rat_usage_data_report_flags_val & 0x04) {
8372
        /* Octet k Length of Secondary RAT Data Usage Report Transfer */
8373
21
        proto_tree_add_item_ret_uint(tree, hf_gtpv2_secondary_rat_usage_data_report_srudn_length, tvb, offset, 1, ENC_BIG_ENDIAN, &srudn_len);
8374
21
        offset++;
8375
        /* Octet (k+1) to a SRUDN */
8376
21
        sub_tree = proto_tree_add_subtree(tree, tvb, offset, srudn_len, ett_gtpv2_son_con, NULL, "SecondaryRATDataUsageReportTransfer");
8377
21
        new_tvb = tvb_new_subset_length(tvb, offset, srudn_len);
8378
21
        asn1_ctx_t asn1_ctx;
8379
21
        asn1_ctx_init(&asn1_ctx, ASN1_ENC_PER, true, pinfo);
8380
21
        dissect_ngap_SecondaryRATDataUsageReportTransfer(new_tvb, 0, &asn1_ctx, sub_tree, hf_gtpv2_secondary_rat_usage_data_report_srudn_value);
8381
21
        offset = offset + srudn_len;
8382
21
    }
8383
8384
25
   if (length - offset) {
8385
4
      proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, -1, "The rest of the IE not dissected yet");
8386
4
   }
8387
25
}
8388
8389
8390
8391
/*
8392
 * 8.133 UP Function Selection Indication Flags
8393
 */
8394
8395
static void
8396
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_)
8397
2
{
8398
2
    int offset = 0;
8399
8400
2
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset << 3, 7, ENC_BIG_ENDIAN);
8401
2
    proto_tree_add_item(tree, hf_gtpv2_dcnr, tvb, offset, 1, ENC_BIG_ENDIAN);
8402
8403
2
}
8404
8405
/* 8.134 Maximum Packet Loss Rate */
8406
static void
8407
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_)
8408
9
{
8409
9
    int offset = 0;
8410
9
    uint8_t oct;
8411
8412
9
    static int* const flags_oct1[] = {
8413
9
        &hf_gtpv2_spare_b7_b2,
8414
9
        &hf_gtpv2_max_pkt_loss_rte_dl_flg,
8415
9
        &hf_gtpv2_max_pkt_loss_rte_ul_flg,
8416
9
        NULL
8417
9
    };
8418
    /*5 Spare DL UL*/
8419
9
    oct = tvb_get_uint8(tvb, offset);
8420
9
    proto_tree_add_bitmask_list(tree, tvb, offset, 1, flags_oct1, ENC_BIG_ENDIAN);
8421
9
    offset++;
8422
8423
9
    if((oct & 0x01) == 1){
8424
        /*m to m+1 Maximum Packet Loss Rate UL*/
8425
2
        proto_tree_add_item(tree, hf_gtpv2_max_pkt_loss_rte_ul, tvb, offset, 2, ENC_BIG_ENDIAN);
8426
2
        offset += 2;
8427
2
    }
8428
9
    if ((oct & 0x02) == 2) {
8429
        /*o to o+1 Maximum Packet Loss Rate DL*/
8430
1
        proto_tree_add_item(tree, hf_gtpv2_max_pkt_loss_rte_dl, tvb, offset, 2, ENC_BIG_ENDIAN);
8431
1
    }
8432
8433
8434
9
}
8435
8436
/* 8.135 APN Rate Control Status */
8437
static void
8438
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_)
8439
3
{
8440
3
    int offset = 0;
8441
8442
    /*5 to 8 Number of Uplink packets allowed*/
8443
3
    proto_tree_add_item(tree, hf_gtpv2_nr_ul_pkts_all, tvb, offset, 4, ENC_BIG_ENDIAN);
8444
3
    offset += 4;
8445
    /*9 to 12 Number of additional exception reports*/
8446
3
    proto_tree_add_item(tree, hf_gtpv2_nr_add_exception_rpts, tvb, offset, 4, ENC_BIG_ENDIAN);
8447
3
    offset += 4;
8448
    /*13 to 16 Number of Downlink packets allowed*/
8449
3
    proto_tree_add_item(tree, hf_gtpv2_nr_dl_pkts_all, tvb, offset, 4, ENC_BIG_ENDIAN);
8450
3
    offset += 4;
8451
    /*17 to 24 APN Rate Control Status validity Time*/
8452
3
    proto_tree_add_item(tree, hf_apn_rte_cntrl_status_val_time, tvb, offset, 8, ENC_TIME_NTP | ENC_BIG_ENDIAN);
8453
8454
3
}
8455
/* 3GPP TS 32.422 V15.1.0 (2018-06) 5.5 List of interfaces (O)*/
8456
8457
static int* const ext_tra_info_list_of_if_flags_oct1[] = {
8458
    &hf_gtpv2_ext_tra_info_loi_mscs_cap,
8459
    &hf_gtpv2_ext_tra_info_loi_mscs_map_f,
8460
    &hf_gtpv2_ext_tra_info_loi_mscs_map_e,
8461
    &hf_gtpv2_ext_tra_info_loi_mscs_map_b,
8462
    &hf_gtpv2_ext_tra_info_loi_mscs_map_g,
8463
    &hf_gtpv2_ext_tra_info_loi_mscs_mc,
8464
    &hf_gtpv2_ext_tra_info_loi_mscs_iu,
8465
    &hf_gtpv2_ext_tra_info_loi_mscs_a,
8466
    NULL
8467
};
8468
8469
static int* const ext_tra_info_list_of_if_flags_oct2[] = {
8470
    &hf_gtpv2_ext_tra_info_loi_mscs_map_c,
8471
    &hf_gtpv2_ext_tra_info_loi_mscs_map_d,
8472
    NULL
8473
};
8474
8475
static int* const ext_tra_info_list_of_if_flags_oct3[] = {
8476
    &hf_gtpv2_ext_tra_info_loi_mgw_iuup,
8477
    &hf_gtpv2_ext_tra_info_loi_mgw_nbup,
8478
    &hf_gtpv2_ext_tra_info_loi_mgw_mc,
8479
    NULL
8480
};
8481
8482
static int* const ext_tra_info_list_of_if_flags_oct4[] = {
8483
    &hf_gtpv2_ext_tra_info_loi_sgsn_ge,
8484
    &hf_gtpv2_ext_tra_info_loi_sgsn_gs,
8485
    &hf_gtpv2_ext_tra_info_loi_sgsn_map_gf,
8486
    &hf_gtpv2_ext_tra_info_loi_sgsn_map_gd,
8487
    &hf_gtpv2_ext_tra_info_loi_sgsn_map_gr,
8488
    &hf_gtpv2_ext_tra_info_loi_sgsn_gn,
8489
    &hf_gtpv2_ext_tra_info_loi_sgsn_iu,
8490
    &hf_gtpv2_ext_tra_info_loi_sgsn_gb,
8491
    NULL
8492
};
8493
8494
static int* const ext_tra_info_list_of_if_flags_oct5[] = {
8495
    &hf_gtpv2_ext_tra_info_loi_sgsn_s13,
8496
    &hf_gtpv2_ext_tra_info_loi_sgsn_s3,
8497
    &hf_gtpv2_ext_tra_info_loi_sgsn_s4,
8498
    &hf_gtpv2_ext_tra_info_loi_sgsn_s6d,
8499
    NULL
8500
};
8501
8502
static int* const ext_tra_info_list_of_if_flags_oct6[] = {
8503
    &hf_gtpv2_ext_tra_info_loi_ggsn_gmb,
8504
    &hf_gtpv2_ext_tra_info_loi_ggsn_gi,
8505
    &hf_gtpv2_ext_tra_info_loi_ggsn_gn,
8506
    NULL
8507
};
8508
8509
static int* const ext_tra_info_list_of_if_flags_oct7[] = {
8510
    &hf_gtpv2_ext_tra_info_loi_rnc_uu,
8511
    &hf_gtpv2_ext_tra_info_loi_rnc_iub,
8512
    &hf_gtpv2_ext_tra_info_loi_rnc_iur,
8513
    &hf_gtpv2_ext_tra_info_loi_rnc_iu,
8514
    NULL
8515
};
8516
8517
static int* const ext_tra_info_list_of_if_flags_oct8[] = {
8518
    &hf_gtpv2_ext_tra_info_loi_bm_sc_gmb,
8519
    NULL
8520
};
8521
8522
static int* const ext_tra_info_list_of_if_flags_oct9[] = {
8523
    &hf_gtpv2_ext_tra_info_loi_mme_s13,
8524
    &hf_gtpv2_ext_tra_info_loi_mme_s11,
8525
    &hf_gtpv2_ext_tra_info_loi_mme_s10,
8526
    &hf_gtpv2_ext_tra_info_loi_mme_s6a,
8527
    &hf_gtpv2_ext_tra_info_loi_mme_s3,
8528
    &hf_gtpv2_ext_tra_info_loi_mme_s1_mme,
8529
    NULL
8530
};
8531
8532
static int* const ext_tra_info_list_of_if_flags_oct10[] = {
8533
    &hf_gtpv2_ext_tra_info_loi_sgw_gxc,
8534
    &hf_gtpv2_ext_tra_info_loi_sgw_s11,
8535
    &hf_gtpv2_ext_tra_info_loi_sgw_s8b,
8536
    &hf_gtpv2_ext_tra_info_loi_sgw_s5,
8537
    &hf_gtpv2_ext_tra_info_loi_sgw_s4,
8538
    NULL
8539
};
8540
8541
static int* const ext_tra_info_list_of_if_flags_oct11[] = {
8542
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_sgi,
8543
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_s8b,
8544
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_gx,
8545
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_s6b,
8546
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_s5,
8547
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2c,
8548
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2b,
8549
    &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2a,
8550
    NULL
8551
};
8552
8553
static int* const ext_tra_info_list_of_if_flags_oct12[] = {
8554
    &hf_gtpv2_ext_tra_info_loi_enb_uu,
8555
    &hf_gtpv2_ext_tra_info_loi_enb_x2,
8556
    &hf_gtpv2_ext_tra_info_loi_enb_s1_mme,
8557
    NULL
8558
};
8559
8560
static int* const ext_tra_info_list_of_if_flags_oct13[] = {
8561
    &hf_gtpv2_ext_tra_info_loi_hss_sh,
8562
    &hf_gtpv2_ext_tra_info_loi_hss_s6a,
8563
    &hf_gtpv2_ext_tra_info_loi_hss_s6d,
8564
    &hf_gtpv2_ext_tra_info_loi_hss_cx,
8565
    &hf_gtpv2_ext_tra_info_loi_hss_map_gr,
8566
    &hf_gtpv2_ext_tra_info_loi_hss_map_gc,
8567
    &hf_gtpv2_ext_tra_info_loi_hss_map_d,
8568
    &hf_gtpv2_ext_tra_info_loi_hss_map_c,
8569
    NULL
8570
};
8571
8572
static int* const ext_tra_info_list_of_if_flags_oct14[] = {
8573
    &hf_gtpv2_ext_tra_info_loi_eir_map_gf,
8574
    &hf_gtpv2_ext_tra_info_loi_eir_s13p,
8575
    &hf_gtpv2_ext_tra_info_loi_eir_s13,
8576
    &hf_gtpv2_ext_tra_info_loi_eir_map_f,
8577
    NULL
8578
};
8579
8580
static int* const ext_tra_info_list_of_if_flags_oct15[] = {
8581
    &hf_gtpv2_ext_tra_info_loi_amf_n20,
8582
    &hf_gtpv2_ext_tra_info_loi_amf_n15,
8583
    &hf_gtpv2_ext_tra_info_loi_amf_n14,
8584
    &hf_gtpv2_ext_tra_info_loi_amf_n12,
8585
    &hf_gtpv2_ext_tra_info_loi_amf_n11,
8586
    &hf_gtpv2_ext_tra_info_loi_amf_n8,
8587
    &hf_gtpv2_ext_tra_info_loi_amf_n2,
8588
    &hf_gtpv2_ext_tra_info_loi_amf_n1,
8589
    NULL
8590
};
8591
8592
static int* const ext_tra_info_list_of_if_flags_oct16[] = {
8593
    &hf_gtpv2_ext_tra_info_loi_amf_n22,
8594
    &hf_gtpv2_ext_tra_info_loi_amf_n26,
8595
    NULL
8596
};
8597
8598
static int* const ext_tra_info_list_of_if_flags_oct17[] = {
8599
    &hf_gtpv2_ext_tra_info_loi_pcf_n15,
8600
    &hf_gtpv2_ext_tra_info_loi_pcf_n7,
8601
    &hf_gtpv2_ext_tra_info_loi_pcf_n5,
8602
    NULL
8603
};
8604
8605
static int* const ext_tra_info_list_of_if_flags_oct18[] = {
8606
    &hf_gtpv2_ext_tra_info_loi_smf_s5_c,
8607
    &hf_gtpv2_ext_tra_info_loi_smf_n11,
8608
    &hf_gtpv2_ext_tra_info_loi_smf_n10,
8609
    &hf_gtpv2_ext_tra_info_loi_smf_n7,
8610
    &hf_gtpv2_ext_tra_info_loi_smf_n4,
8611
    NULL
8612
};
8613
8614
static int* const ext_tra_info_list_of_if_flags_oct19[] = {
8615
    &hf_gtpv2_ext_tra_info_loi_upf_n4,
8616
    NULL
8617
};
8618
8619
static int* const ext_tra_info_list_of_if_flags_oct20[] = {
8620
    &hf_gtpv2_ext_tra_info_loi_ng_ran_node_e1_c,
8621
    &hf_gtpv2_ext_tra_info_loi_ng_ran_node_f1_c,
8622
    &hf_gtpv2_ext_tra_info_loi_ng_ran_node_Uu,
8623
    &hf_gtpv2_ext_tra_info_loi_ng_ran_node_xn_c,
8624
    &hf_gtpv2_ext_tra_info_loi_ng_ran_node_ng_c,
8625
    NULL
8626
};
8627
8628
/* 8.136 Extended Trace Information */
8629
static void
8630
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_)
8631
20
{
8632
20
    proto_tree *trigg_tree, *ne_tree, *if_tree;
8633
20
    proto_item* ti;
8634
20
    int offset = 0;
8635
20
    uint32_t tid, ev_len;
8636
8637
20
    dissect_e212_mcc_mnc(tvb, pinfo, tree, 0, E212_NONE, true);
8638
20
    offset += 3;
8639
8640
    /* Append Trace ID to main tree */
8641
20
    tid = tvb_get_ntohs(tvb, offset);
8642
8643
20
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_trace_id, tvb, offset, 3, ENC_BIG_ENDIAN, &tid);
8644
20
    proto_item_append_text(item, "Trace ID: %d  ", tid);
8645
8646
20
    offset += 3;
8647
8648
    /* Triggering Events, put all into a new tree called triggering_tree */
8649
20
    trigg_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gtpv2_tra_info_trigg, &ti, "Triggering Events");
8650
    /* Octet 11 Length of Triggering Events */
8651
20
    proto_tree_add_item_ret_uint(trigg_tree, hf_gtpv2_trig_event_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8652
20
    offset++;
8653
8654
20
    proto_item_set_len(ti, ev_len + 1);
8655
20
    offset += ev_len;
8656
8657
20
    ne_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gtpv2_tra_info_trigg, &ti, "List of NE Types");
8658
    /* m + 1*/
8659
    /* Length of List of NE Types */
8660
20
    proto_tree_add_item_ret_uint(ne_tree, hf_gtpv2_ne_list_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8661
20
    offset++;
8662
20
    if (ev_len > 0) {
8663
15
        proto_tree_add_bitmask_list(ne_tree, tvb, offset, 1, trace_ne_types_flags_oct1, ENC_BIG_ENDIAN);
8664
15
    }
8665
20
    if (ev_len > 1) {
8666
13
        proto_tree_add_bitmask_list(ne_tree, tvb, offset+1, 1, trace_ne_types_flags_oct2, ENC_BIG_ENDIAN);
8667
13
    }
8668
8669
20
    proto_item_set_len(ti, ev_len + 1);
8670
20
    offset += ev_len;
8671
8672
    /* p+1 Session Trace Depth */
8673
20
    proto_tree_add_item(tree, hf_gtpv2_ses_trs_depth, tvb, offset, 1, ENC_BIG_ENDIAN);
8674
20
    offset++;
8675
8676
8677
20
    if_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_gtpv2_tra_info_trigg, &ti, "List of Interfaces");
8678
    /* p+2 Length of List of Interfaces */
8679
20
    proto_tree_add_item_ret_uint(if_tree, hf_gtpv2_list_of_if_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8680
20
    offset++;
8681
8682
20
    if (ev_len > 1) {
8683
16
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset, 2,
8684
16
            ett_gtpv2_if_mgcs, NULL, "MSC Server interfaces");
8685
16
        proto_tree_add_bitmask_list(sub_tree, tvb, offset, 1, ext_tra_info_list_of_if_flags_oct1, ENC_BIG_ENDIAN);
8686
16
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 1, 1, ext_tra_info_list_of_if_flags_oct2, ENC_BIG_ENDIAN);
8687
16
    }
8688
20
    if (ev_len > 2) {
8689
15
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 2, 1,
8690
15
            ett_gtpv2_if_mgw, NULL, "MGW interfaces");
8691
15
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 2, 1, ext_tra_info_list_of_if_flags_oct3, ENC_BIG_ENDIAN);
8692
15
    }
8693
8694
20
    if (ev_len > 4) {
8695
15
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 3, 2,
8696
15
            ett_gtpv2_if_sgsn, NULL, "SGSN interfaces");
8697
15
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 3, 1, ext_tra_info_list_of_if_flags_oct4, ENC_BIG_ENDIAN);
8698
15
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 4, 1, ext_tra_info_list_of_if_flags_oct5, ENC_BIG_ENDIAN);
8699
15
    }
8700
8701
20
    if (ev_len > 5) {
8702
15
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 5, 1,
8703
15
            ett_gtpv2_if_ggsn, NULL, "GGSN interfaces");
8704
15
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 5, 1, ext_tra_info_list_of_if_flags_oct6, ENC_BIG_ENDIAN);
8705
15
    }
8706
20
    if (ev_len > 6) {
8707
13
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 6, 1,
8708
13
            ett_gtpv2_if_rnc, NULL, "RNC interfaces");
8709
13
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 6, 1, ext_tra_info_list_of_if_flags_oct7, ENC_BIG_ENDIAN);
8710
13
    }
8711
20
    if (ev_len > 7) {
8712
13
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 7, 1,
8713
13
            ett_gtpv2_if_bm_sc, NULL, "BM-SC interfaces");
8714
13
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 7, 1, ext_tra_info_list_of_if_flags_oct8, ENC_BIG_ENDIAN);
8715
13
    }
8716
20
    if (ev_len > 8) {
8717
11
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 8, 1,
8718
11
            ett_gtpv2_if_mme, NULL, "MME interfaces");
8719
11
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 8, 1, ext_tra_info_list_of_if_flags_oct9, ENC_BIG_ENDIAN);
8720
11
    }
8721
20
    if (ev_len > 9) {
8722
10
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 9, 1,
8723
10
            ett_gtpv2_if_sgw, NULL, "SGW interfaces");
8724
10
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 9, 1, ext_tra_info_list_of_if_flags_oct10, ENC_BIG_ENDIAN);
8725
10
    }
8726
20
    if (ev_len > 10) {
8727
8
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 10, 1,
8728
8
            ett_gtpv2_if_pdn_gw, NULL, "PDN GW interfaces");
8729
8
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 10, 1, ext_tra_info_list_of_if_flags_oct11, ENC_BIG_ENDIAN);
8730
8
    }
8731
20
    if (ev_len > 11) {
8732
8
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 11, 1,
8733
8
            ett_gtpv2_if_enb, NULL, "eNB interfaces");
8734
8
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 11, 1, ext_tra_info_list_of_if_flags_oct12, ENC_BIG_ENDIAN);
8735
8
    }
8736
20
    if (ev_len > 12) {
8737
7
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 12, 1,
8738
7
            ett_gtpv2_if_hss, NULL, "HSS interfaces");
8739
7
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 11, 1, ext_tra_info_list_of_if_flags_oct13, ENC_BIG_ENDIAN);
8740
7
    }
8741
20
    if (ev_len > 13) {
8742
6
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 13, 1,
8743
6
            ett_gtpv2_if_eir, NULL, "EIR interfaces");
8744
6
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 11, 1, ext_tra_info_list_of_if_flags_oct14, ENC_BIG_ENDIAN);
8745
6
    }
8746
20
    if (ev_len > 15) {
8747
5
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 14, 2,
8748
5
            ett_gtpv2_if_amf, NULL, "AMF interfaces");
8749
5
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 14, 1, ext_tra_info_list_of_if_flags_oct15, ENC_BIG_ENDIAN);
8750
5
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 15, 1, ext_tra_info_list_of_if_flags_oct16, ENC_BIG_ENDIAN);
8751
5
    }
8752
20
    if (ev_len > 16) {
8753
5
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 16, 1,
8754
5
            ett_gtpv2_if_pcf, NULL, "PCF interfaces");
8755
5
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 16, 1, ext_tra_info_list_of_if_flags_oct17, ENC_BIG_ENDIAN);
8756
5
    }
8757
20
    if (ev_len > 17) {
8758
4
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 17, 1,
8759
4
            ett_gtpv2_if_smf, NULL, "SMF interfaces");
8760
4
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 17, 1, ext_tra_info_list_of_if_flags_oct18, ENC_BIG_ENDIAN);
8761
4
    }
8762
20
    if (ev_len > 18) {
8763
3
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 18, 1,
8764
3
            ett_gtpv2_if_upf, NULL, "UPF interfaces");
8765
3
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 18, 1, ext_tra_info_list_of_if_flags_oct19, ENC_BIG_ENDIAN);
8766
3
    }
8767
20
    if (ev_len > 19) {
8768
3
        proto_tree* sub_tree = proto_tree_add_subtree(if_tree, tvb, offset + 19, 1,
8769
3
            ett_gtpv2_if_upf, NULL, "NG-RAN node interfaces");
8770
3
        proto_tree_add_bitmask_list(sub_tree, tvb, offset + 19, 1, ext_tra_info_list_of_if_flags_oct20, ENC_BIG_ENDIAN);
8771
3
    }
8772
8773
20
    proto_item_set_len(ti, ev_len + 1);
8774
20
    offset += ev_len;
8775
8776
    /* q+1 Length of IP Address of Trace Collection Entity */
8777
20
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_trs_coll_ip_addr_len, tvb, offset, 1, ENC_BIG_ENDIAN, &ev_len);
8778
20
    offset++;
8779
    /*(q+2) to r IP Address of Trace Collection Entity */
8780
20
    if (ev_len == 4) {
8781
0
        proto_tree_add_item(tree, hf_gtpv2_trs_coll_ipv4_addr, tvb, offset, 4, ENC_BIG_ENDIAN);
8782
0
    }
8783
8784
20
    if (ev_len == 16) {
8785
1
        proto_tree_add_item(tree, hf_gtpv2_trs_coll_ipv6_addr, tvb, offset, 16, ENC_NA);
8786
1
    }
8787
20
}
8788
8789
/* 8.137 Monitoring Event Extension Information */
8790
static void
8791
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_)
8792
4
{
8793
4
    int offset = 0;
8794
4
    bool lrtp;
8795
4
    bool srie;
8796
4
    uint32_t scef_id_len;
8797
8798
    /* Octet 5  Bit 8-3 Spare Bit 2 SRIE Bit 1 LRTP */
8799
4
    proto_tree_add_bits_item(tree, hf_gtpv2_spare_bits, tvb, offset, 6, ENC_BIG_ENDIAN);
8800
4
    proto_tree_add_item_ret_boolean(tree, hf_gtpv2_mon_event_ext_inf_srie, tvb, offset, 1, ENC_BIG_ENDIAN, &srie);
8801
4
    proto_tree_add_item_ret_boolean(tree, hf_gtpv2_mon_event_ext_inf_lrtp, tvb, offset, 1, ENC_BIG_ENDIAN, &lrtp);
8802
4
    offset++;
8803
    /* Octet 6 to 9 SCEF Reference ID */
8804
4
    proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_scef_reference_id, tvb, offset, 4, ENC_BIG_ENDIAN);
8805
4
    offset += 4;
8806
    /* Octet 10 Length of SCEF ID */
8807
4
    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);
8808
4
    offset++;
8809
    /* Octet 11 to k SCEF ID */
8810
4
    proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_scef_id, tvb, offset, scef_id_len, ENC_UTF_8);
8811
4
    offset = offset + scef_id_len;
8812
4
    if (lrtp) {
8813
2
        proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_remain_min_period_loc_report_type, tvb, offset, 4, ENC_BIG_ENDIAN);
8814
2
        offset += 4;
8815
2
    }
8816
8817
4
    if (srie) {
8818
0
        proto_tree_add_item(tree, hf_gtpv2_mon_event_ext_inf_scef_reference_id_ext, tvb, offset, 8, ENC_BIG_ENDIAN);
8819
0
        offset += 8;
8820
0
    }
8821
8822
4
    if(offset < length){
8823
2
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length- offset);
8824
2
    }
8825
4
}
8826
8827
/* 207 Additional RRM Policy Index Fixed Length / 8.138 */
8828
static void
8829
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_)
8830
1
{
8831
1
    uint32_t rrm_policy_index;
8832
8833
    /*5 to 8 Additional RRM Policy Index, The ARPI is encoded as Unsigned32 binary integer values.*/
8834
1
    proto_tree_add_item_ret_uint(tree, hf_gtpv2_additional_rrm_policy_index, tvb, 0, 4, ENC_BIG_ENDIAN, &rrm_policy_index);
8835
1
    proto_item_append_text(item, "%u", rrm_policy_index);
8836
1
}
8837
8838
/* 208 V2X Context Extendable / 8.139 */
8839
static void
8840
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_)
8841
2
{
8842
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8843
2
}
8844
8845
/* 209 PC5 QoS Parameters Extendable / 8.140 */
8846
static void
8847
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_)
8848
2
{
8849
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8850
2
}
8851
8852
/* 210 Services Authorized Extendable / 8.141 */
8853
static void
8854
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_)
8855
3
{
8856
3
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8857
3
}
8858
8859
/* 211 Bit Rate Extendable / 8.142 */
8860
static void
8861
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_)
8862
2
{
8863
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8864
2
}
8865
8866
/* 212 PC5 QoS Flow Extendable / 8.143 */
8867
static void
8868
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_)
8869
2
{
8870
2
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8871
2
}
8872
8873
/* 213 SGi PtP Tunnel Address Extendable / 8.144 */
8874
static void
8875
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_)
8876
1
{
8877
1
    proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 0, length);
8878
1
}
8879
8880
/* 214 PGW Change Info Extendable / 8.145 */
8881
static void
8882
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)
8883
6
{
8884
6
    int         offset = 0;
8885
6
    proto_tree *grouped_tree;
8886
6
    tvbuff_t   *new_tvb;
8887
8888
6
    proto_item_append_text(item, "[Grouped IE]");
8889
6
    grouped_tree = proto_item_add_subtree(item, ett_gtpv2_PGW_change_info);
8890
6
    new_tvb = tvb_new_subset_length(tvb, offset, length);
8891
8892
6
    dissect_gtpv2_ie_common(new_tvb, pinfo, grouped_tree, offset, message_type, args, GTPV2_IE_PGW_CHANGE_INFO);
8893
6
}
8894
8895
/* 215 PGW FQDN Extendable / 8.146 */
8896
static void
8897
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_)
8898
7
{
8899
7
    int offset = 0;
8900
7
    offset = decode_gtpv2_fqdn(tvb, pinfo, tree, item, offset, length);
8901
8902
7
    if(offset < length){
8903
0
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, offset, length- offset);
8904
0
    }
8905
7
}
8906
8907
/* 216 Group Id / 8.147 */
8908
static void
8909
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_)
8910
2
{
8911
2
    proto_tree_add_item(tree, hf_gtpv2_group_id, tvb, 0, length, ENC_UTF_8);
8912
2
}
8913
8914
/* 217 PSCell Id / 8.148 */
8915
static void
8916
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_)
8917
4
{
8918
4
    int offset = 0;
8919
8920
4
    dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, E212_NONE, true);
8921
4
    offset += 3;
8922
4
    proto_tree_add_item(tree, hf_gtpv2_ie_pscell_id_spare, tvb, offset, 5, ENC_BIG_ENDIAN);
8923
4
    proto_tree_add_item(tree, hf_gtpv2_ie_pscell_id_nr_cgi, tvb, offset, 5, ENC_BIG_ENDIAN);
8924
8925
4
}
8926
8927
/* 218 UP Security Policy / 8.149 */
8928
static const value_string gtpv2_up_ip_policy_vals[] = {
8929
    {0, "User Plane Integrity protection with EPS is not needed"},
8930
    {1, "User Plane Integrity protection with EPS is preferred"},
8931
    {2, "User Plane Integrity protection with EPS is required"},
8932
    {3, "Spare"},
8933
    {0, NULL}
8934
};
8935
8936
static void
8937
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_)
8938
16
{
8939
16
    proto_tree_add_item(tree, hf_gtpv2_ie_up_security_policy_spare, tvb, 0, 1, ENC_BIG_ENDIAN);
8940
16
    proto_tree_add_item(tree, hf_gtpv2_ie_up_security_policy_up_ip_policy, tvb, 0, 1, ENC_BIG_ENDIAN);
8941
16
    if (length > 2) {
8942
2
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 1, length - 2);
8943
2
    }
8944
16
}
8945
8946
/* 219 Alternative IMSI / 8.150 */
8947
static void
8948
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)
8949
3
{
8950
    /*
8951
     * TS 29.274 V18.4.0 says:
8952
     * Alternative IMSI is in the form of an IMSI as defined in 3GPP TS 23.003.
8953
     */
8954
3
    dissect_gtpv2_imsi(tvb, pinfo, tree, item, length, message_type, instance, args);
8955
3
}
8956
8957
/* 220 NF Instance ID / 8.151 */
8958
static void
8959
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_)
8960
5
{
8961
    /*
8962
     *  String uniquely identifying a NF instance. The format of the NF Instance ID shall be a
8963
     *  Universally Unique Identifier (UUID) version 4, as described in IETF RFC 4122 [15]. The
8964
     *  hexadecimal letters should be formatted as lower-case characters by the sender, and they
8965
     *  shall be handled as case-insensitive by the receiver.
8966
     *
8967
     *  Example: "4ace9d34-2c69-4f99-92d5-a73a3fe8e23b"
8968
     */
8969
5
    proto_tree_add_item(tree, hf_gtpv2_nf_instance_id_nf_instance_id, tvb, 0, 36, ENC_BIG_ENDIAN);
8970
5
}
8971
8972
/* 221 Timer in Seconds / 8.152 */
8973
static void
8974
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_)
8975
2
{
8976
2
    proto_tree_add_item(tree, hf_gtpv2_nf_timer_in_seconds_timer_value, tvb, 0, 3, ENC_BIG_ENDIAN);
8977
2
    if (length > 4) {
8978
1
        proto_tree_add_expert(tree, pinfo, &ei_gtpv2_ie_data_not_dissected, tvb, 3, length - 4);
8979
1
    }
8980
2
}
8981
8982
/* Table 8.1-1: Information Element types for GTPv2 */
8983
8984
typedef struct _gtpv2_ie {
8985
    int ie_type;
8986
    void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, uint16_t, uint8_t, uint8_t, session_args_t *);
8987
} gtpv2_ie_t;
8988
8989
static const gtpv2_ie_t gtpv2_ies[] = {
8990
    {GTPV2_IE_IMSI, dissect_gtpv2_imsi},                                   /* 1, Internal Mobile Subscriber Identity (IMSI) */
8991
    {GTPV2_IE_CAUSE, dissect_gtpv2_cause},                                 /* 2, Cause (without embedded offending IE) 8.4 */
8992
    {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery},                          /* 3, Recovery (Restart Counter) 8.5 */
8993
                                                                           /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
8994
    /*Start SRVCC Messages 3GPP TS 29.280 */
8995
    {GTPV2_IE_STN_SR, dissect_gtpv2_stn_sr},                               /* 51 STN-SR */
8996
    {GTPV2_IE_SRC_TGT_TRANS_CON, dissect_gtpv2_src_tgt_trans_con},         /* 52 Source to Target Transparent Container */
8997
    {GTPV2_IE_TGT_SRC_TRANS_CON , dissect_gtpv2_tgt_src_trans_con},        /* 53 Target to Source Transparent Container */
8998
    {GTPV2_IE_MM_CON_EUTRAN_SRVCC, dissect_gtpv2_mm_con_eutran_srvcc},     /* 54 MM Context for E-UTRAN SRVCC */
8999
    {GTPV2_IE_MM_CON_UTRAN_SRVCC, dissect_gtpv2_mm_con_utran_srvcc},       /* 55 MM Context for UTRAN SRVCC */
9000
    {GTPV2_IE_SRVCC_CAUSE, dissect_gtpv2_srvcc_cause},                     /* 56 SRVCC Cause */
9001
    {GTPV2_IE_TGT_RNC_ID, dissect_gtpv2_tgt_rnc_id},                       /* 57 Target RNC ID */
9002
    {GTPV2_IE_TGT_GLOGAL_CELL_ID, dissect_gtpv2_tgt_global_cell_id},       /* 58 Target Global Cell ID */
9003
    {GTPV2_IE_TEID_C, dissect_gtpv2_teid_c},                               /* 59 TEID-C */
9004
    {GTPV2_IE_SV_FLAGS, dissect_gtpv2_sv_flags},                           /* 60 Sv Flags */
9005
    {GTPV2_IE_SAI, dissect_gtpv2_sai},                                     /* 61 Service Area Identifier */
9006
    {GTPV2_IE_MM_CTX_FOR_CS_TO_PS_SRVCC, dissect_gtpv2_mm_ctx_for_cs_to_ps_srvcc },  /* 62 Service Area Identifier */
9007
                                                                           /* 61-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
9008
    {GTPV2_APN, dissect_gtpv2_apn},                                        /* 71, Access Point Name (APN) 8.6 */
9009
    {GTPV2_AMBR, dissect_gtpv2_ambr},                                      /* 72, Aggregate Maximum Bit Rate (AMBR) */
9010
    {GTPV2_EBI, dissect_gtpv2_ebi},                                        /* 73, EPS Bearer ID (EBI)  8.8 */
9011
    {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address},                          /* 74, IP Address */
9012
    {GTPV2_MEI, dissect_gtpv2_mei},                                        /* 74, Mobile Equipment Identity */
9013
    {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn},                               /* 76, MSISDN 8.11 */
9014
    {GTPV2_INDICATION, dissect_gtpv2_ind},                                 /* 77 Indication 8.12 */
9015
    {GTPV2_PCO, dissect_gtpv2_pco},                                        /* 78 Protocol Configuration Options (PCO) 8.13 */
9016
    {GTPV2_PAA, dissect_gtpv2_paa},                                        /* 79 PDN Address Allocation (PAA) 8.14 */
9017
    {GTPV2_BEARER_QOS, dissect_gtpv2_bearer_qos},                          /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
9018
    {GTPV2_IE_FLOW_QOS, dissect_gtpv2_flow_qos},                           /* 81 Flow Quality of Service (Flow QoS) 8.16 */
9019
    {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type},                           /* 82, RAT Type  8.17 */
9020
    {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net},                           /* 83, Serving Network 8.18 */
9021
    {GTPV2_IE_BEARER_TFT, dissect_gtpv2_bearer_tft},                       /* 84, Bearer TFT 8.19 */
9022
    {GTPV2_IE_TAD, dissect_gtpv2_tad},                                     /* 85, Traffic Aggregate Description 8.20 */
9023
    {GTPV2_IE_ULI, dissect_gtpv2_uli},                                     /* 86, User Location Info (ULI) 8.22 */
9024
    {GTPV2_IE_F_TEID, dissect_gtpv2_f_teid},                               /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
9025
    {GTPV2_IE_TMSI, dissect_gtpv2_tmsi},                                   /* 88, TMSI 8.23 */
9026
    {GTPV2_IE_GLOBAL_CNID, dissect_gtpv2_g_cn_id},                         /* 89, Global CN-Id 8.25 */
9027
    {GTPV2_IE_S103PDF, dissect_gtpv2_s103pdf},                             /* 90, S103 PDN Data Forwarding Info (S103PDF) 8.25 */
9028
    {GTPV2_IE_S1UDF, dissect_gtpv2_s1udf},                                 /* 91, S1-U Data Forwarding (S1UDF) 8.26 */
9029
    {GTPV2_IE_DEL_VAL, dissect_gtpv2_delay_value},                         /* 92, Delay Value 8.29 */
9030
    {GTPV2_IE_BEARER_CTX, dissect_gtpv2_bearer_ctx},                       /* 93, Bearer Context  8.31 */
9031
    {GTPV2_IE_CHAR_ID, dissect_gtpv2_charging_id},                         /* 94, Charging Id */
9032
    {GTPV2_IE_CHAR_CHAR, dissect_gtpv2_char_char},                         /* 95 Charging Characteristic */
9033
    {GTPV2_IE_TRA_INFO, dissect_gtpv2_tra_info},                           /* 96, Trace Information 8.31 */
9034
    {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag},                        /* 97, Bearer Flag */
9035
                                                                           /* 98, Void 8.33 */
9036
    {GTPV2_IE_PDN_TYPE, dissect_gtpv2_pdn_type},                           /* 99, PDN Type */
9037
    {GTPV2_IE_PTI, dissect_gtpv2_pti},                                     /* 100, Procedure Transaction Id */
9038
    {GTPV2_IE_DRX_PARAM, dissect_gtpv2_drx_param},                         /* 101, DRX Parameter 8.36 */
9039
    {GTPV2_IE_UE_NET_CAPABILITY, dissect_gtpv2_ue_net_capability},         /* 102, UE network capability 8.37 */
9040
    {GTPV2_IE_MM_CONTEXT_GSM_T, dissect_gtpv2_mm_context_gsm_t},           /* 103, MM Context 8.38 GSM Key and Triplets */
9041
    {GTPV2_IE_MM_CONTEXT_UTMS_CQ, dissect_gtpv2_mm_context_utms_cq},       /* 104, MM Context 8.38 */
9042
    {GTPV2_IE_MM_CONTEXT_GSM_CQ, dissect_gtpv2_mm_context_gsm_cq},         /* 105, MM Context 8.38 */
9043
    {GTPV2_IE_MM_CONTEXT_UTMS_Q, dissect_gtpv2_mm_context_utms_q},         /* 106, MM Context 8.38 */
9044
    {GTPV2_IE_MM_CONTEXT_EPS_QQ, dissect_gtpv2_mm_context_eps_qq},         /* 107, MM Context 8.38 */
9045
    {GTPV2_IE_MM_CONTEXT_UTMS_QQ, dissect_gtpv2_mm_context_utms_qq},       /* 108, MM Context 8.38 */
9046
    {GTPV2_IE_PDN_CONNECTION, dissect_gtpv2_PDN_conn},                     /* 109, PDN Connection */
9047
    {GTPV2_IE_PDN_NUMBERS, dissect_gtpv2_pdn_numbers},                     /* 110, PDN Numbers 8.40 */
9048
    {GTPV2_IE_P_TMSI, dissect_gtpv2_p_tmsi},                               /* 111, P-TMSI 8.41 */
9049
    {GTPV2_IE_P_TMSI_SIG, dissect_gtpv2_p_tmsi_sig},                       /* 112, P-TMSI Signature 8.42 */
9050
    {GTPV2_IE_HOP_COUNTER, dissect_gtpv2_hop_counter},                     /* 113, Hop Counter 8.43 */
9051
    {GTPV2_IE_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone},                   /* 114, UE Time Zone */
9052
    {GTPV2_IE_TRACE_REFERENCE, dissect_gtpv2_trace_reference},             /* 115, Trace Reference 8.45 */
9053
    {GTPV2_IE_COMPLETE_REQUEST_MSG, dissect_complete_request_msg},         /* 116, Complete Request message 8.46 */
9054
    {GTPV2_IE_GUTI, dissect_gtpv2_guti},                                   /* 117, GUTI 8.47 */
9055
    {GTPV2_IE_F_CONTAINER, dissect_gtpv2_F_container},                     /* 118, Fully Qualified Container (F-Container) */
9056
    {GTPV2_IE_F_CAUSE, dissect_gtpv2_F_cause},                             /* 119, Fully Qualified Cause (F-Cause) */
9057
    {GTPV2_IE_PLMN_ID, dissect_gtpv2_plmn_id},                             /* 120, PLMN ID 8.50 */
9058
    {GTPV2_IE_TARGET_ID, dissect_gtpv2_target_id},                         /* 121, Target Identification */
9059
                                                                           /* 122, Void 8.52 */
9060
    {GTPV2_IE_PKT_FLOW_ID, dissect_gtpv2_pkt_flow_id},                     /* 123, Packet Flow ID 8.53 */
9061
    {GTPV2_IE_RAB_CONTEXT, dissect_gtpv2_rab_context},                     /* 124, RAB Context 8.54 */
9062
    {GTPV2_IE_S_RNC_PDCP_CTX_INFO, dissect_gtpv2_s_rnc_pdcp_ctx_info},     /* 125, Source RNC PDCP context info 8.55 */
9063
    {GTPV2_IE_PORT_NR, dissect_port_nr},                                   /* 126, Port Number 8.56 */
9064
    {GTPV2_IE_APN_RESTRICTION, dissect_gtpv2_apn_rest},                    /* 127, APN Restriction */
9065
    {GTPV2_IE_SEL_MODE, dissect_gtpv2_selec_mode},                         /* 128, Selection Mode */
9066
    {GTPV2_IE_SOURCE_IDENT, dissect_gtpv2_source_ident},                   /* 129, Source Identification 8.59 */
9067
    {GTPV2_IE_BEARER_CONTROL_MODE, dissect_gtpv2_bearer_control_mode},     /* 130, Bearer Control Mode */
9068
    {GTPV2_IE_CNG_REP_ACT , dissect_gtpv2_cng_rep_act},                    /* 131, Change Reporting Action 8.61 */
9069
    {GTPV2_IE_FQ_CSID, dissect_gtpv2_fq_csid},                             /* 132, Fully Qualified PDN Connection Set Identifier (FQ-CSID) 8.62 */
9070
    {GTPV2_IE_CHANNEL_NEEDED, dissect_gtpv2_channel_needed},               /* 133, Channel Needed 8.63 */
9071
    {GTPV2_IE_EMLPP_PRI, dissect_gtpv2_emlpp_pri},                         /* 134, eMLPP Priority 8.64 */
9072
    {GTPV2_IE_NODE_TYPE , dissect_gtpv2_node_type},                        /* 135, Node Type 8.65 */
9073
    {GTPV2_IE_FQDN, dissect_gtpv2_fqdn},                                   /* 136, 8.66 Fully Qualified Domain Name (FQDN) */
9074
    {GTPV2_IE_TI, dissect_gtpv2_ti},                                       /* 137, 8.68 Transaction Identifier (TI) */
9075
    {GTPV2_IE_MBMS_SESSION_DURATION, dissect_gtpv2_mbms_session_duration}, /* 138, 8.69 MBMS Session Duration */
9076
    {GTPV2_IE_MBMS_SERVICE_AREA, dissect_gtpv2_mbms_service_area},         /* 139, 8.70 MBMS Service Area */
9077
    {GTPV2_IE_MBMS_SESSION_ID, dissect_gtpv2_mbms_session_id},             /* 140, 8.71 MBMS Session Identifier */
9078
    {GTPV2_IE_MBMS_FLOW_ID, dissect_gtpv2_mbms_flow_id},                   /* 141, 8.72 MBMS Flow Identifier */
9079
    {GTPV2_IE_MBMS_IP_MC_DIST, dissect_gtpv2_mbms_ip_mc_dist},             /* 142, 8.73 MBMS IP Multicast Distribution */
9080
    {GTPV2_IE_MBMS_DIST_ACK, dissect_gtpv2_mbms_dist_ack},                 /* 143, 8.74 MBMS Distribution Acknowledge */
9081
    {GTPV2_IE_RFSP_INDEX, dissect_gtpv2_rfsp_index},                       /* 144, 8.77 RFSP Index */
9082
    {GTPV2_IE_UCI, dissect_gtpv2_uci},                                     /* 145, 8.75 User CSG Information (UCI) */
9083
    {GTPV2_IE_CSG_INFO_REP_ACTION, dissect_gtpv2_csg_info_rep_action},     /* 146, 8.76 CSG Information Reporting Action */
9084
    {GTPV2_IE_CSG_ID, dissect_gtpv2_csg_id},                               /* 147, 8.78 CSG ID */
9085
    {GTPV2_IE_CMI, dissect_gtpv2_cmi},                                     /* 148, 8.79 CSG Membership Indication (CMI) */
9086
    {GTPV2_IE_SERVICE_INDICATOR, dissect_gtpv2_service_indicator},         /* 149, 8.80 Service indicator */
9087
    {GTPV2_IE_DETACH_TYPE, dissect_gtpv2_detach_type},                     /* 150, 8.81 Detach Type */
9088
    {GTPV2_IE_LDN, dissect_gtpv2_ldn},                                     /* 151, 8.82 Local Distinguished Name (LDN) */
9089
    {GTPV2_IE_NODE_FEATURES, dissect_gtpv2_node_features},                 /* 152, 8.83 Node Features */
9090
    {GTPV2_IE_MBMS_TIME_TO_DATA_XFER, dissect_gtpv2_mbms_time_to_data_xfer}, /* 153, 8.84 MBMS Time to Data Transfer */
9091
    {GTPV2_IE_THROTTLING, dissect_gtpv2_throttling},                       /* 154, 8.85 Throttling */
9092
    {GTPV2_IE_ARP, dissect_gtpv2_arp},                                     /* 155, 8.86 Allocation/Retention Priority (ARP) */
9093
    {GTPV2_IE_EPC_TIMER, dissect_gtpv2_epc_timer},                         /* 156, 8.87 EPC Timer */
9094
    {GTPV2_IE_SIG_PRIO_IND, dissect_gtpv2_sig_prio_ind},                   /* 157, 8.88 Signalling Priority Indication */
9095
    {GTPV2_IE_TMGI, dissect_gtpv2_tmgi},                                   /* 158, 8.89 Temporary Mobile Group Identity (TMGI) */
9096
    {GTPV2_IE_ADD_MM_CONT_FOR_SRVCC, dissect_gtpv2_add_mm_cont_for_srvcc}, /* 159, 8.90 Additional MM context for SRVCC */
9097
    {GTPV2_IE_ADD_FLAGS_FOR_SRVCC, dissect_gtpv2_add_flags_for_srvcc},     /* 160, 8.91 Additional flags for SRVCC */
9098
    {GTPV2_IE_MMBR, dissect_gtpv2_mmbr},                                   /* 161, 8.92 Max MBR/APN-AMBR (MMBR) */
9099
    {GTPV2_IE_MDT_CONFIG, dissect_gtpv2_mdt_config},                       /* 162, 8.93 MDT Configuration */
9100
    {GTPV2_IE_APCO, dissect_gtpv2_apco},                                   /* 163, 8.94 Additional Protocol Configuration Options (APCO) */
9101
    {GTPV2_IE_ABS_MBMS_DATA_TF_TIME, dissect_gtpv2_abs_mbms_data_tf_time}, /* 164, 8.95 Absolute Time of MBMS Data Transfer */
9102
    {GTPV2_IE_HENB_INFO_REPORT, dissect_gtpv2_henb_info_report},           /* 165, 8.96 H(e)NB Information Reporting */
9103
    {GTPV2_IE_IP4CP, dissect_gtpv2_ip4cp},                                 /* 166, 8.97 IPv4 Configuration Parameters (IPv4CP) */
9104
    {GTPV2_IE_CHANGE_TO_REPORT_FLAGS, dissect_gtpv2_change_report_flags},  /* 167, 8.98 Change to Report Flags */
9105
    {GTPV2_IE_ACTION_INDICATION, dissect_gtpv2_action_indication},         /* 168, 8.99 Action Indication */
9106
    {GTPV2_IE_TWAN_IDENTIFIER, dissect_gtpv2_twan_identifier},             /* 169, 8.100 TWAN Identifier */
9107
    {GTPV2_IE_ULI_TIMESTAMP, dissect_gtpv2_uli_timestamp},                 /* 170, 8.101 ULI Timestamp */
9108
    {GTPV2_IE_MBMS_FLAGS, dissect_gtpv2_mbms_flags},                       /* 171, 8.102 MBMS Flags */
9109
    {GTPV2_IE_RAN_NAS_CAUSE, dissect_gtpv2_ran_nas_cause},                 /* 172, 8.103 RAN/NAS Cause */
9110
    {GTPV2_IE_CN_OP_SEL_ENT, dissect_gtpv2_cn_operator_selection_entity},  /* 173, 8.104 CN Operator Selection Entity */
9111
    {GTPV2_IE_TRUST_WLAN_MODE_IND, dissect_gtpv2_trust_wlan_mode_ind},     /* 174, 8.105 Trusted WLAN Mode Indication */
9112
    {GTPV2_IE_NODE_NUMBER, dissect_gtpv2_node_number},                     /* 175, 8.106 Node Number */
9113
    {GTPV2_IE_NODE_IDENTIFIER, dissect_gtpv2_node_identifier},             /* 176, 8.107 Node Identifier */
9114
    {GTPV2_IE_PRES_REP_AREA_ACT, dissect_gtpv2_pres_rep_area_action},      /* 177, 8.108 Presence Reporting Area Action */
9115
    {GTPV2_IE_PRES_REP_AREA_INF, dissect_gtpv2_pres_rep_area_information}, /* 178, 8.109 Presence Reporting Area Information */
9116
    {GTPV2_IE_TWAN_ID_TS, dissect_gtpv2_twan_identifier_timestamp},        /* 179, 8.110 TWAN Identifier Timestamp */
9117
    {GTPV2_IE_OVERLOAD_CONTROL_INF, dissect_gtpv2_overload_control_inf},   /* 180, 8.111 Overload Control Information */
9118
    {GTPV2_IE_LOAD_CONTROL_INF, dissect_gtpv2_load_control_inf},           /* 181, 8.112 Load Control Information */
9119
    {GTPV2_IE_METRIC, dissect_gtpv2_metric},                               /* 182, 8.113 Metric */
9120
    {GTPV2_IE_SEQ_NO, dissect_gtpv2_seq_no},                               /* 183, 8.114 Sequence Number */
9121
    {GTPV2_IE_APN_AND_REL_CAP, dissect_gtpv2_apn_and_relative_capacity},   /* 184, 8.115 APN and Relative Capacity */
9122
    {GTPV2_IE_WLAN_OFFLOADABILITY_IND,dissect_gtpv2_unknown },             /* 185, 8.116 WLAN Offloadability Indication */
9123
9124
    {GTPV2_IE_PAGING_AND_SERVICE_INF, dissect_gtpv2_paging_and_service_inf}, /* 186, 8.117 Paging and Service Information */
9125
    {GTPV2_IE_INTEGER_NUMBER, dissect_gtpv2_integer_number},                 /* 187, 8.118 Integer Number */
9126
    {GTPV2_IE_MILLISECOND_TS, dissect_gtpv2_ms_ts},                          /* 188, 8.119 Millisecond Time Stamp */
9127
    {GTPV2_IE_MON_EVENT_INF, dissect_gtpv2_mon_event_inf},                   /* 189, 8.120 Monitoring Event Information */
9128
                                                                             /* 190, 8.121 ECGI List */
9129
                                                                             /* 191, 8.122 Remote UE Context */
9130
                                                                             /* 192, 8.123 Remote User ID */
9131
                                                                             /* 193, 8.124 Remote UE IP Information */
9132
    {GTPV2_IE_CIOT_OPT_SUPPORT_IND, dissect_gtpv2_ciot_opt_support_ind},     /* 194, 8.125 CIoT Optimizations Support Indication */
9133
    {GTPV2_IE_SCEF_PDN_CONNECTION , dissect_gtpv2_scef_pdn_connection },     /* 195, 8.126 SCEF PDN Connection */
9134
    {GTPV2_IE_HEADER_COMP_CONF, dissect_gtpv2_header_comp_comf},             /* 196, 8.127 Header Compression Configuration */
9135
    {GTPV2_IE_EXTENDED_PCO, dissect_gtpv2_pco},                              /* 197, 8.128 Extended Protocol Configuration Options (ePCO) */
9136
    {GTPV2_IE_SERV_PLMN_RATE_CONTROL, dissect_gtpv2_serv_plmn_rate_control}, /* 198, 8.129 Serving PLMN Rate Control */
9137
    {GTPV2_IE_COUNTER, dissect_gtpv2_counter},                               /* 199, 8.130 Counter */
9138
    {GTPV2_IE_MAPPED_UE_USAGE_TYPE, dissect_gtpv2_mapped_ue_usage_type },    /* 199, 8.131 Mapped UE Usage Type */
9139
    {GTPV2_IE_SECONDARY_RAT_USAGE_DATA_REPORT, dissect_gtpv2_secondary_rat_usage_data_report}, /* 201, 8.132 Secondary RAT Usage Data Report */
9140
    {GTPV2_IE_UP_FUNC_SEL_INDI_FLG, dissect_gtpv2_up_func_slec_indic_flg },  /* 202, 8.133 UP Function Selection Indication Flags */
9141
    {GTPV2_IE_MAX_PKT_LOSS_RTE, dissect_gtpv2_max_pkt_loss_rte },            /* 203, 8.134 Maximum Packet Loss Rate */
9142
    {GTPV2_IE_APN_RTE_CNTRL_STATUS, dissect_gtpv2_apn_rte_cntrl_status },    /* 204, 8.135 APN Rate Control Status */
9143
    {GTPV2_IE_EXT_TRS_INF, dissect_gtpv2_ext_trs_inf },                      /* 205, 8.136 Extended Trace Information */
9144
    {GTPV2_IE_MON_EVENT_EXT_INF, dissect_gtpv2_ie_mon_event_ext_inf },       /* 206, 8.137 Monitoring Event Extension Information */
9145
    {GTPV2_IE_ADDITIONAL_RRM_POLICY_INDEX, dissect_gtpv2_ie_additional_rrm_policy_index },  /* 207 Additional RRM Policy Index Fixed Length / 8.138 */
9146
    {GTPV2_IE_V2X_CONTEXT, dissect_gtpv2_ie_v2x_context },                   /* 208 V2X Context Extendable / 8.139 */
9147
    {GTPV2_IE_PC5_QOS_PARAMETERS, dissect_gtpv2_ie_pc5_qos_parameters },     /* 209 PC5 QoS Parameters Extendable / 8.140 */
9148
    {GTPV2_IE_SERVICES_AUTHORIZED, dissect_gtpv2_ie_services_authorized },   /* 210 Services Authorized Extendable / 8.141 */
9149
    {GTPV2_IE_BIT_RATE, dissect_gtpv2_ie_bit_rate },                         /* 211 Bit Rate Extendable / 8.142 */
9150
    {GTPV2_IE_PC5_QOS_FLOW, dissect_gtpv2_ie_pc5_qos_flow },                 /* 212 PC5 QoS Flow Extendable / 8.143 */
9151
    {GTPV2_IE_SGI_PTP_TUNNEL_ADDRESS, dissect_gtpv2_ie_sgi_ptp_tunnel_address }, /* 213 SGi PtP Tunnel Address Extendable / 8.144 */
9152
    {GTPV2_IE_PGW_CHANGE_INFO, dissect_gtpv2_ie_pgw_change_info },           /* 214 PGW Change Info Extendable / 8.145 */
9153
    {GTPV2_IE_PGW_FQDN, dissect_gtpv2_ie_pgw_fqdn },                         /* 215 PGW FQDN Extendable / 8.146 */
9154
    {GTPV2_IE_GROUP_ID, dissect_gtpv2_ie_group_id },                         /* 216 Group Id Variable Length / 8.147 */
9155
    {GTPV2_IE_PSCELL_ID, dissect_gtpv2_ie_pscell_id },                       /* 217 PSCell Id Fixed Length / 8.148 */
9156
    {GTPV2_IE_UP_SECURITY_POLICY, dissect_gtpv2_ie_up_security_policy },     /* 218 UP Security Policy Extendable / 8.149 */
9157
    {GTPV2_IE_ALT_IMSI, dissect_gtpv2_ie_alternative_imsi },                 /* 219 Alternative IMSI Variable Length / 8.150 */
9158
    {GTPV2_IE_NF_INSTANCE_ID, dissect_gtpv2_ie_nf_instance_id },              /* 220 NF Instance ID*/
9159
    {GTPV2_IE_TIMER_IN_SECONDS, dissect_gtpv2_timer_in_seconds },             /* 221 Timer in Seconds*/
9160
    {GTPV2_IE_PRIVATE_EXT, dissect_gtpv2_private_ext },
9161
    {0, dissect_gtpv2_unknown}
9162
};
9163
9164
static gtpv2_msg_hash_t *
9165
gtpv2_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, unsigned seq_nr, unsigned msgtype, gtpv2_conv_info_t *gtpv2_info, uint8_t last_cause)
9166
331
{
9167
331
    gtpv2_msg_hash_t   gcr, *gcrp = NULL;
9168
331
    conversation_t *conv;
9169
331
    uint32_t session;
9170
9171
331
    gcr.seq_nr = seq_nr;
9172
331
    gcr.req_time = pinfo->abs_ts;
9173
9174
331
    switch (msgtype) {
9175
2
    case GTPV2_CREATE_SESSION_REQUEST:
9176
5
    case GTPV2_CREATE_BEARER_REQUEST:
9177
16
    case GTPV2_UPDATE_BEARER_REQUEST:
9178
17
    case GTPV2_MODIFY_BEARER_REQUEST:
9179
20
    case GTPV2_DELETE_BEARER_REQUEST:
9180
25
    case GTPV2_DELETE_SESSION_REQUEST:
9181
44
    case GTPV2_MODIFY_BEARER_COMMAND:
9182
47
    case GTPV2_DELETE_BEARER_COMMAND:
9183
50
    case GTPV2_BEARER_RESOURCE_COMMAND:
9184
51
    case GTPV2_SRVCC_PS_TO_CS_REQUEST:
9185
52
    case GTPV2_SRVCC_PS_TO_CS_COMPLETE_NOTIFICATION:
9186
53
    case GTPV2_SRVCC_PS_TO_CS_CANCEL_NOTIFICATION:
9187
55
    case GTPV2_CONTEXT_REQUEST:
9188
56
    case GTPV2_FORWARD_RELOCATION_REQ:
9189
57
    case GTPV2_RELOCATION_CANCEL_REQUEST:
9190
61
    case GTPV2_FORWARD_CTX_NOTIFICATION:
9191
62
    case GTPV2_FORWARD_RELOCATION_COMPLETE_NOTIFICATION:
9192
66
    case GTPV2_RELEASE_ACCESS_BEARERS_REQUEST:
9193
68
    case GTPV2_DL_DATA_NOTIF:
9194
68
        gcr.is_request = true;
9195
68
        gcr.req_frame = pinfo->num;
9196
68
        gcr.rep_frame = 0;
9197
9198
68
        conv = find_conversation_strat(pinfo, CONVERSATION_IP, NO_PORT_X, false);
9199
68
        gcr.conv_id = conv->conv_index;
9200
9201
68
        break;
9202
7
    case GTPV2_CREATE_SESSION_RESPONSE:
9203
9
    case GTPV2_CREATE_BEARER_RESPONSE:
9204
11
    case GTPV2_UPDATE_BEARER_RESPONSE:
9205
13
    case GTPV2_MODIFY_BEARER_RESPONSE:
9206
15
    case GTPV2_DELETE_BEARER_RESPONSE:
9207
22
    case GTPV2_DELETE_SESSION_RESPONSE:
9208
26
    case GTPV2_MODIFY_BEARER_FAILURE_INDICATION:
9209
28
    case GTPV2_DELETE_BEARER_FAILURE_INDICATION:
9210
58
    case GTPV2_BEARER_RESOURCE_FAILURE_INDICATION:
9211
61
    case GTPV2_SRVCC_PS_TO_CS_RESPONSE:
9212
63
    case GTPV2_SRVCC_PS_TO_CS_COMPLETE_ACKNOWLEDGE:
9213
63
    case GTPV2_SRVCC_PS_TO_CS_CANCEL_ACKNOWLEDGE:
9214
67
    case GTPV2_CONTEXT_RESPONSE:
9215
68
    case GTPV2_FORWARD_RELOCATION_RESP:
9216
69
    case GTPV2_RELOCATION_CANCEL_RESPONSE:
9217
88
    case GTPV2_FORWARD_CTX_ACKNOWLEDGE:
9218
90
    case GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE:
9219
90
    case GTPV2_RELEASE_ACCESS_BEARERS_RESPONSE:
9220
92
    case GTPV2_DL_DATA_NOTIF_ACK:
9221
9222
92
        gcr.is_request = false;
9223
92
        gcr.req_frame = 0;
9224
92
        gcr.rep_frame = pinfo->num;
9225
9226
92
        conv = find_conversation_strat(pinfo, CONVERSATION_IP, NO_PORT_X, false);
9227
92
        gcr.conv_id = conv->conv_index;
9228
9229
92
        break;
9230
171
    default:
9231
171
        gcr.is_request = false;
9232
171
        gcr.req_frame = 0;
9233
171
        gcr.rep_frame = 0;
9234
171
        gcr.conv_id = 0;
9235
171
        break;
9236
331
    }
9237
9238
331
    gcrp = (gtpv2_msg_hash_t *)wmem_map_lookup(gtpv2_info->matched, &gcr);
9239
9240
331
    if (gcrp) {
9241
18
        gcrp->is_request = gcr.is_request;
9242
313
    } else {
9243
        /*no match, let's try to make one*/
9244
313
        switch (msgtype) {
9245
2
        case GTPV2_CREATE_SESSION_REQUEST:
9246
5
        case GTPV2_CREATE_BEARER_REQUEST:
9247
16
        case GTPV2_UPDATE_BEARER_REQUEST:
9248
17
        case GTPV2_MODIFY_BEARER_REQUEST:
9249
20
        case GTPV2_DELETE_BEARER_REQUEST:
9250
25
        case GTPV2_DELETE_SESSION_REQUEST:
9251
44
        case GTPV2_MODIFY_BEARER_COMMAND:
9252
47
        case GTPV2_DELETE_BEARER_COMMAND:
9253
50
        case GTPV2_BEARER_RESOURCE_COMMAND:
9254
51
        case GTPV2_SRVCC_PS_TO_CS_REQUEST:
9255
52
        case GTPV2_SRVCC_PS_TO_CS_COMPLETE_NOTIFICATION:
9256
53
        case GTPV2_SRVCC_PS_TO_CS_CANCEL_NOTIFICATION:
9257
55
        case GTPV2_CONTEXT_REQUEST:
9258
56
        case GTPV2_FORWARD_RELOCATION_REQ:
9259
57
        case GTPV2_RELOCATION_CANCEL_REQUEST:
9260
61
        case GTPV2_FORWARD_CTX_NOTIFICATION:
9261
62
        case GTPV2_FORWARD_RELOCATION_COMPLETE_NOTIFICATION:
9262
66
        case GTPV2_RELEASE_ACCESS_BEARERS_REQUEST:
9263
68
        case GTPV2_DL_DATA_NOTIF:
9264
9265
68
            gcr.seq_nr = seq_nr;
9266
9267
68
            gcrp = (gtpv2_msg_hash_t *)wmem_map_lookup(gtpv2_info->unmatched, &gcr);
9268
68
            if (gcrp) {
9269
14
                wmem_map_remove(gtpv2_info->unmatched, gcrp);
9270
14
            }
9271
            /* if we can't reuse the old one, grab a new chunk */
9272
68
            if (!gcrp) {
9273
54
                gcrp = wmem_new(wmem_file_scope(), gtpv2_msg_hash_t);
9274
54
            }
9275
68
            gcrp->seq_nr = seq_nr;
9276
68
            gcrp->req_frame = pinfo->num;
9277
68
            gcrp->req_time = pinfo->abs_ts;
9278
68
            gcrp->rep_frame = 0;
9279
68
            gcrp->msgtype = msgtype;
9280
68
            gcrp->is_request = true;
9281
9282
68
            conv = find_conversation_strat(pinfo, CONVERSATION_IP, NO_PORT_X, false);
9283
68
            gcrp->conv_id = conv->conv_index;
9284
9285
68
            wmem_map_insert(gtpv2_info->unmatched, gcrp, gcrp);
9286
68
            return NULL;
9287
7
        case GTPV2_CREATE_SESSION_RESPONSE:
9288
9
        case GTPV2_CREATE_BEARER_RESPONSE:
9289
11
        case GTPV2_UPDATE_BEARER_RESPONSE:
9290
13
        case GTPV2_MODIFY_BEARER_RESPONSE:
9291
15
        case GTPV2_DELETE_BEARER_RESPONSE:
9292
22
        case GTPV2_DELETE_SESSION_RESPONSE:
9293
26
        case GTPV2_MODIFY_BEARER_FAILURE_INDICATION:
9294
28
        case GTPV2_DELETE_BEARER_FAILURE_INDICATION:
9295
58
        case GTPV2_BEARER_RESOURCE_FAILURE_INDICATION:
9296
61
        case GTPV2_SRVCC_PS_TO_CS_RESPONSE:
9297
63
        case GTPV2_SRVCC_PS_TO_CS_COMPLETE_ACKNOWLEDGE:
9298
63
        case GTPV2_SRVCC_PS_TO_CS_CANCEL_ACKNOWLEDGE:
9299
67
        case GTPV2_CONTEXT_RESPONSE:
9300
68
        case GTPV2_FORWARD_RELOCATION_RESP:
9301
69
        case GTPV2_RELOCATION_CANCEL_RESPONSE:
9302
88
        case GTPV2_FORWARD_CTX_ACKNOWLEDGE:
9303
90
        case GTPV2_FORWARD_RELOCATION_COMPLETE_ACKNOWLEDGE:
9304
90
        case GTPV2_RELEASE_ACCESS_BEARERS_RESPONSE:
9305
92
        case GTPV2_DL_DATA_NOTIF_ACK:
9306
9307
92
            gcr.seq_nr = seq_nr;
9308
92
            gcrp = (gtpv2_msg_hash_t *)wmem_map_lookup(gtpv2_info->unmatched, &gcr);
9309
9310
92
            if (gcrp) {
9311
12
                if (!gcrp->rep_frame) {
9312
12
                    wmem_map_remove(gtpv2_info->unmatched, gcrp);
9313
12
                    gcrp->rep_frame = pinfo->num;
9314
12
                    gcrp->is_request = false;
9315
9316
12
                    conv = find_conversation_strat(pinfo, CONVERSATION_IP, NO_PORT_X, false);
9317
12
                    gcrp->conv_id = conv->conv_index;
9318
9319
12
                    wmem_map_insert(gtpv2_info->matched, gcrp, gcrp);
9320
12
                }
9321
12
            }
9322
92
            break;
9323
153
        default:
9324
153
            break;
9325
313
        }
9326
313
    }
9327
9328
    /* we have found a match */
9329
263
    if (gcrp) {
9330
30
        proto_item *it;
9331
9332
30
        if (gcrp->is_request) {
9333
0
            it = proto_tree_add_uint(tree, hf_gtpv2_response_in, tvb, 0, 0, gcrp->rep_frame);
9334
0
            proto_item_set_generated(it);
9335
30
        } else {
9336
30
            nstime_t ns;
9337
9338
30
            it = proto_tree_add_uint(tree, hf_gtpv2_response_to, tvb, 0, 0, gcrp->req_frame);
9339
30
            proto_item_set_generated(it);
9340
30
            nstime_delta(&ns, &pinfo->abs_ts, &gcrp->req_time);
9341
30
            it = proto_tree_add_time(tree, hf_gtpv2_response_time, tvb, 0, 0, &ns);
9342
30
            proto_item_set_generated(it);
9343
30
            if (g_gtp_session && !PINFO_FD_VISITED(pinfo)) {
9344
                /* GTP session */
9345
                /* If it's not already in the list */
9346
0
                session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
9347
0
                if (!session) {
9348
0
                    session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(gcrp->req_frame)));
9349
0
                    if (session) {
9350
0
                        add_gtp_session(pinfo->num, session);
9351
0
                    }
9352
0
                }
9353
9354
0
                if (!is_cause_accepted(last_cause, 2)){
9355
                    /* If the cause is not accepted then we have to remove all the session information about its corresponding request */
9356
0
                    remove_frame_info(gcrp->req_frame);
9357
0
                }
9358
0
            }
9359
30
        }
9360
30
    }
9361
263
    return gcrp;
9362
331
}
9363
9364
static void
9365
track_gtpv2_session(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gtpv2_hdr_t * gtpv2_hdr, session_args_t * args)
9366
0
{
9367
0
    uint32_t session, frame_teid_cp;
9368
0
    proto_item *it;
9369
0
    char *imsi = NULL;
9370
9371
    /* GTP session */
9372
0
    if (!PINFO_FD_VISITED(pinfo)) {
9373
        /* If the message does not have any session ID */
9374
0
        session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
9375
0
        if (!session) {
9376
            /* 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 */
9377
0
            if ((gtpv2_hdr->message != GTPV2_CREATE_SESSION_RESPONSE && gtpv2_hdr->message != GTPV2_CREATE_SESSION_REQUEST && gtpv2_hdr->message != GTPV2_UPDATE_BEARER_RESPONSE
9378
0
                && gtpv2_hdr->message != GTPV2_UPDATE_BEARER_REQUEST && gtpv2_hdr->message != GTPV2_CREATE_BEARER_REQUEST && gtpv2_hdr->message != GTPV2_CREATE_BEARER_RESPONSE
9379
0
                && gtpv2_hdr->message != GTPV2_MODIFY_BEARER_REQUEST && gtpv2_hdr->message != GTPV2_MODIFY_BEARER_RESPONSE)) {
9380
                /* If the lists are not empty*/
9381
0
                if (wmem_list_count(args->teid_list) && wmem_list_count(args->ip_list)) {
9382
0
                    remove_frame_info(pinfo->num);
9383
0
                }
9384
0
            }
9385
9386
0
            if (gtpv2_hdr->message == GTPV2_CREATE_SESSION_REQUEST){
9387
                /* If CPDPCREQ and not already in the list then we create a new session*/
9388
0
                add_gtp_session(pinfo->num, gtp_session_count);
9389
9390
0
                if (args->imsi) {
9391
0
                    imsi = wmem_strdup(wmem_file_scope(), args->imsi);
9392
0
                    wmem_map_insert(session_imsi, GUINT_TO_POINTER(gtp_session_count++), imsi);
9393
0
                }
9394
0
            }
9395
0
            else if (gtpv2_hdr->message != GTPV2_CREATE_SESSION_RESPONSE) {
9396
                /* 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
9397
                the corresponding session ID */
9398
9399
                /* Handle deinterlacing case */
9400
0
                if(is_deinterlacing_supported(pinfo)) {
9401
0
                    conversation_t  *conversation;
9402
0
                    conversation = find_conversation_strat(pinfo, CONVERSATION_IP, NO_PORT_X, false);
9403
9404
0
                    if ((get_gtp_session_frame(pinfo->dst, (uint32_t)gtpv2_hdr->teid, conversation->conv_index, &frame_teid_cp, 0) == 1)) {
9405
9406
                        /* Then we have to set its session ID */
9407
0
                        session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(frame_teid_cp)));
9408
0
                        if (session) {
9409
                            /* We add the corresponding session to the list so that when a response came we can associate its session ID*/
9410
0
                            add_gtp_session(pinfo->num, session);
9411
9412
0
                            if (args->imsi) {
9413
0
                                imsi = wmem_strdup(wmem_file_scope(), args->imsi);
9414
0
                                wmem_map_insert(session_imsi, GUINT_TO_POINTER(session), imsi);
9415
0
                            }
9416
0
                        }
9417
0
                    }
9418
0
                    else if (gtpv2_hdr->message == GTPV2_MODIFY_BEARER_REQUEST) {
9419
                        /* If MBEAREQ and not already in the list then we create a new session*/
9420
0
                        add_gtp_session(pinfo->num, gtp_session_count);
9421
9422
0
                        if (args->imsi) {
9423
0
                            imsi = wmem_strdup(wmem_file_scope(), args->imsi);
9424
0
                            wmem_map_insert(session_imsi, GUINT_TO_POINTER(gtp_session_count++), imsi);
9425
0
                        } else {
9426
                            /* If handover from 5G, look up referenceid from earlier HTTP2 streams */
9427
0
                            static char to_str_back_buf[32];
9428
0
                            #define BACK_PTR (&to_str_back_buf[31]) /* pointer to NUL string terminator */
9429
9430
0
                            char* referenceid = uint_to_str_back(BACK_PTR, (uint32_t)gtpv2_hdr->teid);
9431
0
                            imsi = http2_get_imsi_from_location(referenceid);
9432
0
                            if(imsi) {
9433
0
                                wmem_map_insert(session_imsi, GUINT_TO_POINTER(gtp_session_count++), imsi);
9434
0
                            }
9435
0
                        }
9436
0
                    }
9437
0
                }
9438
9439
0
                else { // no deinterlacing supported/asked
9440
0
                    if ((get_frame(pinfo->dst, (uint32_t)gtpv2_hdr->teid, &frame_teid_cp) == 1)) {
9441
                        /* Then we have to set its session ID */
9442
0
                        session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(frame_teid_cp)));
9443
0
                        if (session) {
9444
                            /* We add the corresponding session to the list so that when a response came we can associate its session ID*/
9445
0
                            add_gtp_session(pinfo->num, session);
9446
9447
0
                            if (args->imsi) {
9448
0
                                imsi = wmem_strdup(wmem_file_scope(), args->imsi);
9449
0
                                wmem_map_insert(session_imsi, GUINT_TO_POINTER(session), imsi);
9450
0
                            }
9451
0
                        }
9452
0
                    }
9453
0
                    else if (gtpv2_hdr->message == GTPV2_MODIFY_BEARER_REQUEST) {
9454
                        /* If MBEAREQ and not already in the list then we create a new session*/
9455
0
                        add_gtp_session(pinfo->num, gtp_session_count);
9456
9457
0
                        if (args->imsi) {
9458
0
                            imsi = wmem_strdup(wmem_file_scope(), args->imsi);
9459
0
                            wmem_map_insert(session_imsi, GUINT_TO_POINTER(gtp_session_count++), imsi);
9460
0
                        } else {
9461
                            /* If handover from 5G, look up location from earlier HTTP2 streams */
9462
0
                            static char to_str_back_buf[32];
9463
0
                            #define BACK_PTR (&to_str_back_buf[31]) /* pointer to NUL string terminator */
9464
9465
0
                            char* location = uint_to_str_back(BACK_PTR, (uint32_t)gtpv2_hdr->teid);
9466
0
                            imsi = http2_get_imsi_from_location(location);
9467
0
                            if(imsi) {
9468
0
                                wmem_map_insert(session_imsi, GUINT_TO_POINTER(gtp_session_count++), imsi);
9469
0
                            }
9470
0
                        }
9471
0
                    }
9472
0
                }
9473
0
            }
9474
0
        }
9475
0
    }
9476
9477
0
    if (tree) {
9478
0
        session = GPOINTER_TO_UINT(wmem_map_lookup(session_table, GUINT_TO_POINTER(pinfo->num)));
9479
0
        if (session) {
9480
0
            it = proto_tree_add_uint(tree, hf_gtpv2_session, tvb, 0, 0, session);
9481
0
            proto_item_set_generated(it);
9482
9483
0
            imsi = wmem_map_lookup(session_imsi, GUINT_TO_POINTER(session));
9484
0
            if (imsi) {
9485
0
                add_assoc_imsi_item(tvb, tree, imsi);
9486
0
            }
9487
0
        }
9488
0
    }
9489
0
}
9490
9491
void
9492
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)
9493
1.20k
{
9494
1.20k
    proto_tree *ie_tree;
9495
1.20k
    proto_item *ti;
9496
1.20k
    tvbuff_t   *ie_tvb;
9497
1.20k
    uint8_t     type, instance;
9498
1.20k
    uint16_t    length;
9499
1.20k
    int         i, remaining_length, msg_length;
9500
1.20k
    unsigned    info_elem;
9501
    /*
9502
     * Octets   8   7   6   5       4   3   2   1
9503
     *  1       Type
9504
     *  2-3     Length = n
9505
     *  4       CR          Spare   Instance
9506
     * 5-(n+4)  IE specific data
9507
     */
9508
1.20k
    msg_length = (int)tvb_reported_length(tvb);
9509
6.11k
    while (offset < msg_length) {
9510
        /* Get the type and length */
9511
5.20k
        remaining_length = msg_length - offset;
9512
5.20k
        if (remaining_length < 3) {
9513
14
            proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, offset, remaining_length,
9514
14
                "Not enough data left for IE and length, %i bytes", remaining_length);
9515
14
            return;
9516
14
        }
9517
5.18k
        type    = tvb_get_uint8(tvb, offset);
9518
5.18k
        length  = tvb_get_ntohs(tvb, offset + 1);
9519
5.18k
        remaining_length = remaining_length -4;
9520
5.18k
        if (remaining_length < length) {
9521
277
            proto_tree_add_expert_format(tree, pinfo, &ei_gtpv2_ie_len_invalid, tvb, offset+4, remaining_length,
9522
277
                "Less data left than indicated by length %u, remaining length %i", length, remaining_length);
9523
            /* Octet 1 */
9524
277
            proto_tree_add_item(tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
9525
277
            offset += 1;
9526
9527
            /*Octet 2 - 3 */
9528
277
            proto_tree_add_item(tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
9529
277
            return;
9530
277
        }
9531
4.91k
        ie_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4 + length, ett_gtpv2_ies[type], &ti, "%s: ",
9532
4.91k
                                      val_to_str_ext_const(type, &gtpv2_element_type_vals_ext, "Unknown"));
9533
9534
        /* Octet 1 */
9535
4.91k
        proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, ENC_BIG_ENDIAN);
9536
4.91k
        offset += 1;
9537
9538
        /*Octet 2 - 3 */
9539
4.91k
        proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, ENC_BIG_ENDIAN);
9540
4.91k
        offset += 2;
9541
9542
        /* ch8.120 breaks the format described in ch8.2.1 */
9543
4.91k
        if (type == GTPV2_IE_MON_EVENT_INF) {
9544
2
            instance = tvb_get_uint8(tvb, offset) & 0x0f;
9545
4.90k
        } else {
9546
            /* CR Spare Instance Octet 4*/
9547
4.90k
            proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, ENC_BIG_ENDIAN);
9548
9549
4.90k
            instance = tvb_get_uint8(tvb, offset) & 0x0f;
9550
4.90k
            proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, ENC_BIG_ENDIAN);
9551
9552
            /* Add Info element on IE types with multiple instances in same group */
9553
4.90k
            if (tree && message_type > 0) {
9554
                /* XXX - This has 250+ entries and should really be a different
9555
                 * data structure, perhaps lazily creating a table. */
9556
1.04M
                for (info_elem = 0; info_elem < NUM_GTPV2_IE_INFO_ELEM_INSTANCES; info_elem++) {
9557
1.04M
                    if (gtpv2_information_element_instance_vals[info_elem].message_type == message_type &&
9558
9.14k
                        gtpv2_information_element_instance_vals[info_elem].parent_ie == parent_ie &&
9559
7.41k
                        gtpv2_information_element_instance_vals[info_elem].type == type &&
9560
109
                        gtpv2_information_element_instance_vals[info_elem].instance == instance)
9561
39
                    {
9562
39
                        proto_item_append_text(ie_tree, "%s: ", gtpv2_information_element_instance_vals[info_elem].info_element);
9563
39
                        break;
9564
39
                    }
9565
1.04M
                }
9566
3.93k
            }
9567
4.90k
            offset++;
9568
4.90k
        }
9569
9570
        /* TODO: call IE dissector here */
9571
4.91k
        if (type == GTPV2_IE_RESERVED) {
9572
            /* Treat IE type zero special as type zero is used to end the loop in the else branch */
9573
2.94k
            expert_add_info(pinfo, ti, &ei_gtpv2_ie);
9574
2.94k
        } else {
9575
1.96k
            i = -1;
9576
            /* Loop over the IE dissector list to se if we find an entry;
9577
               the last entry will have ie_type=0 breaking the loop */
9578
156k
            while (gtpv2_ies[++i].ie_type) {
9579
156k
                if (gtpv2_ies[i].ie_type == type)
9580
1.48k
                    break;
9581
156k
            }
9582
            /* Just give the IE dissector the IE */
9583
1.96k
            ie_tvb = tvb_new_subset_remaining(tvb, offset);
9584
1.96k
            (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, message_type, instance, args);
9585
1.96k
        }
9586
9587
        /* ch8.120 breaks the format described in ch8.2.1 */
9588
4.91k
        if (type == GTPV2_IE_MON_EVENT_INF) {
9589
0
            offset++;
9590
0
        }
9591
9592
4.91k
        offset += length;
9593
4.91k
    }
9594
1.20k
}
9595
9596
static int
9597
// NOLINTNEXTLINE(misc-no-recursion)
9598
dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void* data _U_)
9599
1.18k
{
9600
1.18k
    proto_tree *gtpv2_tree;
9601
1.18k
    proto_item *ti;
9602
1.18k
    uint8_t     message_type, t_flag, p_flag, mp_flag, cause_aux;
9603
1.18k
    int         offset = 0;
9604
1.18k
    uint16_t    msg_length;
9605
1.18k
    tvbuff_t   *msg_tvb;
9606
1.18k
    uint32_t    seq_no = 0;
9607
1.18k
    conversation_t  *conversation;
9608
1.18k
    gtpv2_conv_info_t *gtpv2_info;
9609
1.18k
    session_args_t  *args = NULL;
9610
1.18k
    gtpv2_hdr_t * gtpv2_hdr = NULL;
9611
1.18k
    gtpv2_msg_hash_t *gcrp = NULL;
9612
1.18k
    uint64_t gtpv2_hdr_flags;
9613
9614
1.18k
    static int * const gtpv2_flags[] = {
9615
1.18k
        &hf_gtpv2_version,
9616
1.18k
        &hf_gtpv2_p,
9617
1.18k
        &hf_gtpv2_t,
9618
1.18k
        &hf_gtpv2_mp,
9619
1.18k
        NULL
9620
1.18k
    };
9621
9622
1.18k
    gtpv2_hdr = wmem_new0(pinfo->pool, gtpv2_hdr_t);
9623
9624
    /* Setting the TEID to -1 to say that the TEID is not valid for this packet */
9625
1.18k
    gtpv2_hdr->teid = -1;
9626
9627
    /* Currently we get called from the GTP dissector no need to check the version */
9628
1.18k
    col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
9629
1.18k
    col_clear(pinfo->cinfo, COL_INFO);
9630
9631
    /* message type is in octet 2 */
9632
1.18k
    message_type = tvb_get_uint8(tvb, 1);
9633
1.18k
    col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(message_type, &gtpv2_message_type_vals_ext, "Unknown"));
9634
9635
9636
1.18k
    msg_length = tvb_get_ntohs(tvb, offset + 2);
9637
1.18k
    ti = proto_tree_add_item(tree, proto_gtpv2, tvb, offset, msg_length + 4, ENC_NA);
9638
1.18k
    gtpv2_tree = proto_item_add_subtree(ti, ett_gtpv2);
9639
9640
1.18k
    if (g_gtp_session) {
9641
0
        args = wmem_new0(pinfo->pool, session_args_t);
9642
0
        args->last_cause = 16;                                         /* It stores the last cause decoded. Cause accepted by default */
9643
        /* We create the auxiliary lists */
9644
0
        args->teid_list = wmem_list_new(pinfo->pool);
9645
0
        args->ip_list = wmem_list_new(pinfo->pool);
9646
0
    }
9647
9648
    /*
9649
    * Do we have a conversation for this connection?
9650
    */
9651
1.18k
    conversation = find_conversation_strat(pinfo, CONVERSATION_IP, NO_PORT_X, false);
9652
1.18k
    if(conversation == NULL) {
9653
        // XXX - very unlikely this is needed as we're carried over IP
9654
33
        conversation = conversation_new_strat(pinfo, CONVERSATION_IP, NO_PORTS);
9655
33
    }
9656
9657
    /*
9658
    * Do we already know this conversation?
9659
    */
9660
1.18k
    gtpv2_info = (gtpv2_conv_info_t *)conversation_get_proto_data(conversation, proto_gtpv2);
9661
1.18k
    if (gtpv2_info == NULL) {
9662
        /* No.  Attach that information to the conversation, and add
9663
        * it to the list of information structures.
9664
        */
9665
102
        gtpv2_info = wmem_new(wmem_file_scope(), gtpv2_conv_info_t);
9666
        /*Request/response matching tables*/
9667
102
        gtpv2_info->matched = wmem_map_new(wmem_file_scope(), gtpv2_sn_hash, gtpv2_sn_equal_matched);
9668
102
        gtpv2_info->unmatched = wmem_map_new(wmem_file_scope(), gtpv2_sn_hash, gtpv2_sn_equal_unmatched);
9669
9670
102
        conversation_add_proto_data(conversation, proto_gtpv2, gtpv2_info);
9671
102
    }
9672
9673
    /* Control Plane GTP uses a variable length header. Control Plane GTP header
9674
        * length shall be a multiple of 4 octets.
9675
        * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
9676
        * Bits       8  7  6   5       4   3       2       1
9677
        * Octets   1 Version   P       T   Spare   Spare   Spare
9678
        *          2 Message Type
9679
        *          3 Message Length (1st Octet)
9680
        *          4 Message Length (2nd Octet)
9681
        *  m-k(m+3)    If T flag is set to 1, then TEID shall be placed into octets 5-8.
9682
        *              Otherwise, TEID field is not present at all.
9683
        *  n-(n+2)   Sequence Number
9684
        * (n+3)      Spare
9685
        * Figure 5.1-1: General format of GTPv2 Header for Control Plane
9686
        */
9687
9688
    /* 5.4  EPC specific GTP-C header
9689
     * Bits          8  7  6   5       4   3       2       1
9690
     * Octets      1 Version   P       T=1 MP      Spare   Spare
9691
     *             2 Message Type
9692
     *             3 Message Length (1st Octet)
9693
     *             4 Message Length (2nd Octet)
9694
     *             5 Tunnel Endpoint Identifier (1st Octet)
9695
     *             6 Tunnel Endpoint Identifier (2nd Octet)
9696
     *             7 Tunnel Endpoint Identifier (3rd Octet)
9697
     *             8 Tunnel Endpoint Identifier (4th Octet)
9698
     *             9 Sequence Number (1st Octet)
9699
     *            10 Sequence Number (2nd Octet)
9700
     *            11 Sequence Number (3rd Octet)
9701
     *            12 Message Priority  Spare
9702
     */
9703
9704
    /* Octet 1 */
9705
1.18k
    proto_tree_add_bitmask_with_flags_ret_uint64(gtpv2_tree, tvb, offset, hf_gtpv2_flags,
9706
1.18k
        ett_gtpv2_flags, gtpv2_flags, ENC_BIG_ENDIAN, BMT_NO_FALSE | BMT_NO_INT, &gtpv2_hdr_flags);
9707
9708
1.18k
    gtpv2_hdr->flags = (uint8_t)gtpv2_hdr_flags;
9709
1.18k
    p_flag  = (gtpv2_hdr->flags & 0x10) >> 4;
9710
1.18k
    t_flag  = (gtpv2_hdr->flags & 0x08) >> 3;
9711
1.18k
    mp_flag = (gtpv2_hdr->flags & 0x04) >> 2;
9712
9713
1.18k
    offset += 1;
9714
9715
    /* Octet 2 */
9716
1.18k
    gtpv2_hdr->message = tvb_get_uint8(tvb, offset);
9717
1.18k
    proto_tree_add_uint(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, gtpv2_hdr->message);
9718
1.18k
    offset += 1;
9719
    /* Octet 3 - 4 */
9720
1.18k
    gtpv2_hdr->length = tvb_get_ntohs(tvb, offset);
9721
1.18k
    proto_tree_add_uint(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, gtpv2_hdr->length);
9722
1.18k
    offset += 2;
9723
9724
1.18k
    if (t_flag) {
9725
        /* Tunnel Endpoint Identifier 4 octets */
9726
434
        gtpv2_hdr->teid = tvb_get_ntohl(tvb, offset);
9727
434
        proto_tree_add_uint(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, (uint32_t)gtpv2_hdr->teid);
9728
434
        offset += 4;
9729
434
    }
9730
    /* Sequence Number 3 octets */
9731
1.18k
    proto_tree_add_item_ret_uint(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 3, ENC_BIG_ENDIAN, &seq_no);
9732
1.18k
    offset += 3;
9733
9734
    /* Spare 1 octet or if the "MP" flag is set to "1",
9735
     * then bits 8 to 5 of octet 12 shall indicate the message priority.
9736
     */
9737
1.18k
    if (mp_flag) {
9738
        /* Bits 8 to 5 of octet 12 shall be encoded as the binary value of the Message Priority
9739
         * and it may take any value between 0 and 15, where 0 corresponds to the highest priority
9740
         * and 15 the lowest priority.
9741
         */
9742
737
        proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
9743
737
    }else{
9744
445
        proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 1, ENC_BIG_ENDIAN);
9745
445
    }
9746
1.18k
    offset += 1;
9747
9748
1.18k
    if (p_flag) {
9749
962
        msg_tvb = tvb_new_subset_length(tvb, 0, msg_length + 4);
9750
962
        dissect_gtpv2_ie_common(msg_tvb, pinfo, gtpv2_tree, offset, message_type, args, 0);
9751
962
    } else {
9752
220
        dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset, message_type, args, 0);
9753
220
    }
9754
    /*Use sequence number to track Req/Resp pairs*/
9755
1.18k
    cause_aux = 16; /* Cause accepted by default. Only used when args is NULL */
9756
1.18k
    if (args && !PINFO_FD_VISITED(pinfo)) {
9757
        /* We insert the lists inside the table*/
9758
0
        if(is_deinterlacing_supported(pinfo)) {
9759
0
            fill_map(args->teid_list, args->ip_list, pinfo->num, conversation->conv_index, 0);
9760
0
        }
9761
0
        else {
9762
            // no deinterlacing supported/asked
9763
0
            fill_map(args->teid_list, args->ip_list, pinfo->num, 0, 1);
9764
0
        }
9765
0
        cause_aux = args->last_cause;
9766
0
    }
9767
1.18k
    gcrp = gtpv2_match_response(tvb, pinfo, gtpv2_tree, seq_no, message_type, gtpv2_info, cause_aux);
9768
1.18k
    if (gcrp) {
9769
30
        tap_queue_packet(gtpv2_tap, pinfo, gcrp);
9770
30
    }
9771
1.18k
    if (args) {
9772
0
        track_gtpv2_session(tvb, pinfo, gtpv2_tree, gtpv2_hdr, args);
9773
0
    }
9774
9775
    /* Bit 5 represents a "P" flag. If the "P" flag is set to "0",
9776
     * no piggybacked message shall be present. If the "P" flag is set to "1",
9777
     * then another GTPv2-C message with its own header and body shall be present
9778
     * at the end of the current message.
9779
     */
9780
1.18k
    if (p_flag) {
9781
166
        tvbuff_t   *new_p_tvb;
9782
        /* Octets 3 to 4 represent the Length field. This field shall indicate the
9783
         * length of the message in octets excluding the
9784
         * mandatory part of the GTP-C header (the first 4 octets).
9785
         */
9786
166
        new_p_tvb = tvb_new_subset_remaining(tvb, msg_length + 4);
9787
166
        col_append_str(pinfo->cinfo, COL_INFO, " / ");
9788
166
        col_set_fence(pinfo->cinfo, COL_INFO);
9789
166
        increment_dissection_depth(pinfo);
9790
166
        dissect_gtpv2(new_p_tvb, pinfo, tree, NULL);
9791
166
        decrement_dissection_depth(pinfo);
9792
166
    }
9793
9794
1.18k
    return tvb_captured_length(tvb);
9795
1.18k
}
9796
9797
void proto_register_gtpv2(void)
9798
14
{
9799
14
    unsigned  i, last_offset;
9800
9801
14
    static hf_register_info hf_gtpv2[] = {
9802
14
        { &hf_gtpv2_response_in,
9803
14
        { "Response In", "gtpv2.response_in",
9804
14
        FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_RESPONSE), 0x0,
9805
14
        "The response to this GTP request is in this frame", HFILL }
9806
14
        },
9807
14
        { &hf_gtpv2_response_to,
9808
14
        { "Response To", "gtpv2.response_to",
9809
14
        FT_FRAMENUM, BASE_NONE, FRAMENUM_TYPE(FT_FRAMENUM_REQUEST), 0x0,
9810
14
        "This is a response to the GTP request in this frame", HFILL }
9811
14
        },
9812
14
        { &hf_gtpv2_response_time,
9813
14
        { "Response Time", "gtpv2.response_time",
9814
14
        FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
9815
14
        "The time between the Request and the Response", HFILL }
9816
14
        },
9817
14
        { &hf_gtpv2_spare_half_octet,
9818
14
          {"Spare half octet", "gtpv2.spare_half_octet",
9819
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
9820
14
           NULL, HFILL }
9821
14
        },
9822
14
        { &hf_gtpv2_spare_bits,
9823
14
          {"Spare bit(s)", "gtpv2.spare_bits",
9824
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
9825
14
           NULL, HFILL }
9826
14
        },
9827
        //{ &hf_gtpv2_spare_b7_b1,
9828
        //  {"Spare bit(s)", "gtpv2.spare_b7_b1",
9829
        //   FT_UINT8, BASE_DEC, NULL, 0xfe,
9830
        //   NULL, HFILL }
9831
        //},
9832
14
        { &hf_gtpv2_spare_b7_b2,
9833
14
        { "Spare", "gtpv2.spare.b7_b2",
9834
14
            FT_UINT8, BASE_HEX, NULL, 0xfc,
9835
14
            NULL, HFILL }
9836
14
        },
9837
14
        { &hf_gtpv2_spare_b7_b3,
9838
14
        {"Spare bit(s)", "gtpv2.spare_b7_b3",
9839
14
            FT_UINT8, BASE_DEC, NULL, 0xf8,
9840
14
            NULL, HFILL }
9841
14
        },
9842
14
        { &hf_gtpv2_spare_b7_b4,
9843
14
        { "Spare", "gtpv2.spare.b7_b4",
9844
14
            FT_UINT8, BASE_HEX, NULL, 0xf0,
9845
14
            NULL, HFILL }
9846
14
        },
9847
14
        { &hf_gtpv2_spare_b7_b5,
9848
14
        { "Spare", "gtpv2.spare.b7_b5",
9849
14
            FT_UINT8, BASE_HEX, NULL, 0xe0,
9850
14
            NULL, HFILL }
9851
14
        },
9852
14
        {&hf_gtpv2_flags,
9853
14
         {"Flags", "gtpv2.flags",
9854
14
          FT_UINT8, BASE_HEX, NULL, 0x0,
9855
14
          NULL, HFILL}
9856
14
        },
9857
14
        {&hf_gtpv2_version,
9858
14
         {"Version", "gtpv2.version",
9859
14
          FT_UINT8, BASE_DEC, NULL, 0xe0,
9860
14
          NULL, HFILL}
9861
14
        },
9862
14
        {&hf_gtpv2_p,
9863
14
         {"Piggybacking flag (P)", "gtpv2.p",
9864
14
          FT_UINT8, BASE_DEC, NULL, 0x10,
9865
14
          "If Piggybacked message is present or not", HFILL}
9866
14
        },
9867
14
        { &hf_gtpv2_t,
9868
14
          {"TEID flag (T)", "gtpv2.t",
9869
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
9870
14
           "If TEID field is present or not", HFILL}
9871
14
        },
9872
14
        { &hf_gtpv2_mp,
9873
14
          {"Message Priority(MP)", "gtpv2.mp",
9874
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
9875
14
           "If Message Priority field is present or not", HFILL}
9876
14
        },
9877
14
        { &hf_gtpv2_message_type,
9878
14
          {"Message Type", "gtpv2.message_type",
9879
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_message_type_vals_ext, 0x0,
9880
14
           NULL, HFILL}
9881
14
        },
9882
14
        { &hf_gtpv2_msg_length,
9883
14
          {"Message Length", "gtpv2.msg_length",
9884
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
9885
14
           NULL, HFILL}
9886
14
        },
9887
14
        { &hf_gtpv2_teid,
9888
14
          {"Tunnel Endpoint Identifier", "gtpv2.teid",
9889
14
           FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
9890
14
           "TEID", HFILL}
9891
14
        },
9892
14
        { &hf_gtpv2_seq,
9893
14
          {"Sequence Number", "gtpv2.seq",
9894
14
           FT_UINT24, BASE_HEX_DEC, NULL, 0x0,
9895
14
           "SEQ", HFILL}
9896
14
        },
9897
14
        { &hf_gtpv2_msg_prio,
9898
14
          {"Message Priority", "gtpv2.mp",
9899
14
           FT_UINT8, BASE_HEX_DEC, NULL, 0xf0,
9900
14
           NULL, HFILL}
9901
14
        },
9902
14
        { &hf_gtpv2_spare,
9903
14
          {"Spare", "gtpv2.spare",
9904
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
9905
14
           NULL, HFILL}
9906
14
        },
9907
14
        { &hf_gtpv2_spare_w0,
9908
14
        { "Spare", "gtpv2.spare.w0",
9909
14
        FT_UINT8, BASE_DEC, NULL, 0x0,
9910
14
        NULL, HFILL }
9911
14
        },
9912
14
        { &hf_gtpv2_ie,
9913
14
          {"IE Type", "gtpv2.ie_type",
9914
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_element_type_vals_ext, 0x0,
9915
14
           NULL, HFILL}
9916
14
        },
9917
14
        { &hf_gtpv2_ie_len,
9918
14
          {"IE Length", "gtpv2.ie_len",
9919
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
9920
14
           "length of the information element excluding the first four octets", HFILL}
9921
14
        },
9922
14
        { &hf_gtpv2_cr,
9923
14
          {"CR flag", "gtpv2.cr",
9924
14
           FT_UINT8, BASE_DEC, NULL, 0xf0, /* SRVCC */
9925
14
           NULL, HFILL}
9926
14
        },
9927
14
        { &hf_gtpv2_instance,
9928
14
          {"Instance", "gtpv2.instance",
9929
14
           FT_UINT8, BASE_DEC, NULL, 0x0f,
9930
14
           NULL, HFILL}
9931
14
        },
9932
14
        { &hf_gtpv2_ipv4_addr,
9933
14
          {"IPv4 Address", "gtpv2.ipv4_addr",
9934
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
9935
14
           NULL, HFILL}
9936
14
        },
9937
14
        { &hf_gtpv2_cause,
9938
14
          {"Cause", "gtpv2.cause",
9939
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_cause_vals_ext, 0x0,
9940
14
           NULL, HFILL}
9941
14
        },
9942
14
        {&hf_gtpv2_cause_cs,
9943
14
         {"CS (Cause Source)", "gtpv2.cs",
9944
14
          FT_BOOLEAN, 8, TFS(&gtpv2_cause_cs), 0x01,
9945
14
          NULL, HFILL}
9946
14
        },
9947
14
        { &hf_gtpv2_cause_bce,
9948
14
          {"BCE (Bearer Context IE Error)", "gtpv2.bce",
9949
14
           FT_BOOLEAN, 8, NULL, 0x02,
9950
14
           NULL, HFILL}
9951
14
        },
9952
14
        { &hf_gtpv2_cause_pce,
9953
14
          {"PCE (PDN Connection IE Error)", "gtpv2.pce",
9954
14
           FT_BOOLEAN, 8, NULL, 0x04,
9955
14
           NULL, HFILL}
9956
14
        },
9957
14
        { &hf_gtpv2_cause_off_ie_t,
9958
14
          {"Type of the offending IE", "gtpv2.cause_off_ie_t",
9959
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_element_type_vals_ext, 0x0,
9960
14
           NULL, HFILL}
9961
14
        },
9962
14
        { &hf_gtpv2_rec,
9963
14
          {"Restart Counter", "gtpv2.rec",
9964
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
9965
14
           NULL, HFILL}
9966
14
        },
9967
/*Start SRVCC Messages*/
9968
14
        { &hf_gtpv2_stn_sr,
9969
14
          {"STN-SR", "gtpv2.stn_sr",
9970
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
9971
14
           NULL, HFILL}
9972
14
        },
9973
14
        { &hf_gtpv2_len_trans_con,
9974
14
          {"Length of the Transparent Container", "gtpv2.len_trans_con",
9975
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
9976
14
           NULL, HFILL}
9977
14
        },
9978
14
        { &hf_gtpv2_eksi,
9979
14
          {"eKSI", "gtpv2.eksi",
9980
14
           FT_UINT8, BASE_DEC, NULL, 0x07,
9981
14
           NULL, HFILL}
9982
14
        },
9983
14
        { &hf_gtpv2_ck,
9984
14
          {"CK", "gtpv2.ck",
9985
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
9986
14
           NULL, HFILL}
9987
14
        },
9988
14
        { &hf_gtpv2_ik,
9989
14
          {"IK", "gtpv2.ik",
9990
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
9991
14
           NULL, HFILL}
9992
14
        },
9993
14
        { &hf_gtpv2_len_ms_classmark2,
9994
14
          {"Length of Mobile Station Classmark2", "gtpv2.len_ms_classmark2",
9995
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
9996
14
           NULL, HFILL}
9997
14
        },
9998
14
        { &hf_gtpv2_len_ms_classmark3,
9999
14
          {"Length of Mobile Station Classmark3", "gtpv2.len_ms_classmark3",
10000
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
10001
14
           NULL, HFILL}
10002
14
        },
10003
14
        { &hf_gtpv2_len_supp_codec_list,
10004
14
          {"Length of Supported Codec List", "gtpv2.len_supp_codec_list",
10005
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
10006
14
           NULL, HFILL}
10007
14
        },
10008
14
        { &hf_gtpv2_ksi,
10009
14
          {"KSI'cs", "gtpv2.ksi",
10010
14
           FT_UINT8, BASE_DEC, NULL, 0x0F,
10011
14
           NULL, HFILL}
10012
14
        },
10013
14
        { &hf_gtpv2_cksn,
10014
14
          {"CKSN'", "gtpv2.cksn",
10015
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
10016
14
           NULL, HFILL}
10017
14
        },
10018
14
        { &hf_gtpv2_srvcc_cause,
10019
14
          {"SRVCC Cause", "gtpv2.srvcc_cause",
10020
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_srvcc_cause_vals_ext, 0x0,
10021
14
           NULL, HFILL}
10022
14
        },
10023
14
        {&hf_gtpv2_rac,
10024
14
         { "Routing Area Code (RAC)", "gtpv2.rac",
10025
14
           FT_UINT8, BASE_DEC, NULL, 0,
10026
14
           NULL, HFILL}
10027
14
        },
10028
10029
14
        { &hf_gtpv2_rnc_id,
10030
14
          {"RNC ID", "gtpv2.rnc_id",
10031
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
10032
14
           NULL, HFILL}
10033
14
        },
10034
14
        { &hf_gtpv2_ext_rnc_id,
10035
14
          {"Extended RNC-ID", "gtpv2.ext_rnc_id",
10036
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
10037
14
           NULL, HFILL}
10038
14
        },
10039
14
        { &hf_gtpv2_lac,
10040
14
          { "Location Area Code (LAC)", "gtpv2.lac",
10041
14
            FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
10042
14
            NULL, HFILL }
10043
14
        },
10044
14
        { &hf_gtpv2_sac,
10045
14
          { "Service Area Code (SAC)", "gtpv2.sac",
10046
14
            FT_UINT16, BASE_HEX_DEC, NULL, 0x00,
10047
14
            NULL, HFILL }
10048
14
        },
10049
14
        { &hf_gtpv2_tgt_g_cell_id,
10050
14
          {"Cell ID", "gtpv2.tgt_g_cell_id",
10051
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
10052
14
           NULL, HFILL}
10053
14
        },
10054
14
        {&hf_gtpv2_teid_c,
10055
14
         {"Tunnel Endpoint Identifier for Control Plane(TEID-C)", "gtpv2.teid_c",
10056
14
          FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
10057
14
          NULL, HFILL}
10058
14
        },
10059
14
        {&hf_gtpv2_sv_sti,
10060
14
         {"STI (Session Transfer Indicator)", "gtpv2.sv_sti",
10061
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10062
14
        },
10063
14
        {&hf_gtpv2_sv_ics,
10064
14
         {"ICS (IMS Centralized Service)", "gtpv2.sv_ics",
10065
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10066
14
        },
10067
14
        {&hf_gtpv2_sv_emind,
10068
14
         {"EmInd(Emergency Indicator)", "gtpv2.sv_emind",
10069
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10070
14
        },
10071
10072
/*End SRVCC Messages*/
10073
14
        {&hf_gtpv2_apn,
10074
14
         {"APN (Access Point Name)", "gtpv2.apn",
10075
14
          FT_STRING, BASE_NONE, NULL, 0x0,
10076
14
          NULL, HFILL}
10077
14
        },
10078
14
        {&hf_gtpv2_ambr_up,
10079
14
         {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
10080
14
          FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10081
14
          NULL, HFILL}
10082
14
        },
10083
14
        {&hf_gtpv2_ambr_down,
10084
14
         {"AMBR Downlink (Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
10085
14
          FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10086
14
          NULL, HFILL}
10087
14
        },
10088
14
        {&hf_gtpv2_ebi,
10089
14
         {"EPS Bearer ID (EBI)", "gtpv2.ebi",
10090
14
          FT_UINT8, BASE_DEC, NULL, 0x0f,
10091
14
          NULL, HFILL}
10092
14
        },
10093
14
        { &hf_gtpv2_ip_address_ipv4,
10094
14
          {"IP address IPv4", "gtpv2.ip_address_ipv4",
10095
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
10096
14
           NULL, HFILL}
10097
14
        },
10098
14
        { &hf_gtpv2_ip_address_ipv6,
10099
14
          {"IP address IPv6", "gtpv2.ip_address_ipv6",
10100
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
10101
14
           NULL, HFILL}
10102
14
        },
10103
14
        {&hf_gtpv2_mei,
10104
14
         {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
10105
14
          FT_STRING, BASE_NONE, NULL, 0,
10106
14
          NULL, HFILL}
10107
14
        },
10108
14
        { &hf_gtpv2_pdn_numbers_nsapi,
10109
14
          {"NSAPI", "gtpv2.pdn_numbers_nsapi",
10110
14
           FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL}
10111
14
        },
10112
14
        { &hf_gtpv2_p_tmsi,
10113
14
          {"Packet TMSI (P-TMSI)", "gtpv2.p_tmsi",
10114
14
           FT_UINT32, BASE_DEC_HEX, NULL, 0x0, NULL, HFILL}
10115
14
        },
10116
14
        { &hf_gtpv2_p_tmsi_sig,
10117
14
          {"P-TMSI Signature", "gtpv2.p_tmsi_sig",
10118
14
           FT_UINT24, BASE_HEX, NULL, 0x0, NULL, HFILL}
10119
14
        },
10120
14
        {&hf_gtpv2_daf,
10121
14
         {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
10122
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10123
14
        },
10124
14
        {&hf_gtpv2_dtf,
10125
14
         {"DTF (Direct Tunnel Flag)", "gtpv2.dtf",
10126
14
          FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10127
14
        },
10128
14
        {&hf_gtpv2_hi,
10129
14
         {"HI (Handover Indication)", "gtpv2.hi",
10130
14
          FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10131
14
        },
10132
14
        {&hf_gtpv2_dfi,
10133
14
         {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
10134
14
          FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10135
14
        },
10136
14
        {&hf_gtpv2_oi,
10137
14
         {"OI (Operation Indication)", "gtpv2.oi",
10138
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10139
14
        },
10140
14
        {&hf_gtpv2_isrsi,
10141
14
         {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
10142
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10143
14
        },
10144
14
        {&hf_gtpv2_israi,
10145
14
         {"ISRAI (Idle mode Signalling Reduction Activation Indication)",    "gtpv2.israi",
10146
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10147
14
        },
10148
14
        {&hf_gtpv2_sgwci,
10149
14
         {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
10150
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10151
14
        },
10152
14
        {&hf_gtpv2_sqci,
10153
14
         {"SQCI (Subscribed QoS Change Indication)", "gtpv2.sqci",
10154
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10155
14
        },
10156
14
        {&hf_gtpv2_uimsi,
10157
14
         {"UIMSI (Unauthenticated IMSI)", "gtpv2.uimsi",
10158
14
          FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10159
14
        },
10160
14
        {&hf_gtpv2_cfsi,
10161
14
         {"CFSI (Change F-TEID support indication)", "gtpv2.cfsi",
10162
14
          FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10163
14
        },
10164
14
        {&hf_gtpv2_crsi,
10165
14
         {"CRSI (Change Reporting support indication)", "gtpv2.crsi",
10166
14
          FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10167
14
        },
10168
14
        {&hf_gtpv2_ps,
10169
14
         {"PS (Piggybacking Supported)", "gtpv2.ps",
10170
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10171
14
        },
10172
14
        {&hf_gtpv2_pt,
10173
14
         {"PT (Protocol Type)", "gtpv2.pt",
10174
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10175
14
        },
10176
14
        {&hf_gtpv2_si,
10177
14
         {"SI (Scope Indication)", "gtpv2.si",
10178
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10179
14
        },
10180
14
        {&hf_gtpv2_msv,
10181
14
         {"MSV (MS Validated)", "gtpv2.msv",
10182
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10183
14
        },
10184
14
        {&hf_gtpv2_retloc,
10185
14
         {"RetLoc (Retrieve Location Indication Flag)", "gtpv2.retloc",
10186
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10187
14
        },
10188
14
        {&hf_gtpv2_pbic,
10189
14
         {"PBIC (Propagate BBAI Information Change)", "gtpv2.pbic",
10190
14
          FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10191
14
        },
10192
14
        {&hf_gtpv2_srni,
10193
14
         {"SRNI (SGW Restoration Needed Indication)", "gtpv2.snri",
10194
14
          FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10195
14
        },
10196
14
        {&hf_gtpv2_s6af,
10197
14
         {"S6AF (Static IPv6 Address Flag)", "gtpv2.s6af",
10198
14
          FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10199
14
        },
10200
14
        {&hf_gtpv2_s4af,
10201
14
         {"S4AF (Static IPv4 Address Flag)", "gtpv2.s4af",
10202
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10203
14
        },
10204
14
        {&hf_gtpv2_mbmdt,
10205
14
         {"MBMDT (Management Based MDT allowed flag)", "gtpv2.mbmdt",
10206
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10207
14
        },
10208
14
        {&hf_gtpv2_israu,
10209
14
         {"ISRAU (ISR is activated for the UE)", "gtpv2.israu",
10210
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10211
14
        },
10212
14
        {&hf_gtpv2_ccrsi,
10213
14
         {"CCRSI (CSG Change Reporting support indication)", "gtpv2.ccrsi",
10214
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10215
14
        },
10216
10217
14
        {&hf_gtpv2_cprai,
10218
14
         {"CPRAI (Change of Presence Reporting Area information Indication)", "gtpv2.cprai",
10219
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10220
14
        },
10221
14
        {&hf_gtpv2_arrl,
10222
14
         {"ARRL (Abnormal Release of Radio Link)", "gtpv2.arrl",
10223
14
          FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10224
14
        },
10225
14
        {&hf_gtpv2_ppof,
10226
14
         {"PPOFF (PDN Pause Off Indication)", "gtpv2.ppof",
10227
14
          FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10228
14
        },
10229
14
        {&hf_gtpv2_ppon_ppei,
10230
14
         {"PPON (PDN Pause On Indication) / PPEI (PDN Pause Enabled Indication)", "gtpv2.ppon_ppei",
10231
14
          FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10232
14
        },
10233
14
        {&hf_gtpv2_ppsi,
10234
14
         {"PPSI (PDN Pause Support Indication)", "gtpv2.ppsi",
10235
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10236
14
        },
10237
14
        {&hf_gtpv2_csfbi,
10238
14
         {"CSFBI (CSFB Indication)", "gtpv2.csfbi",
10239
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10240
14
        },
10241
14
        {&hf_gtpv2_clii,
10242
14
         {"CLII (Change of Location Information Indication)", "gtpv2.clii",
10243
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10244
14
        },
10245
14
        {&hf_gtpv2_cpsr,
10246
14
         {"CPSR (CS to PS SRVCC Indication)", "gtpv2.cpsr",
10247
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10248
14
        },
10249
14
        {&hf_gtpv2_nsi,
10250
14
         {"NSI (NBIFOM Support Indication)", "gtpv2.nsi",
10251
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10252
14
        },
10253
14
        {&hf_gtpv2_uasi,
10254
14
         {"UASI (UE Available for Signalling Indication)", "gtpv2.uasi",
10255
14
          FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10256
14
        },
10257
14
        {&hf_gtpv2_dtci,
10258
14
         {"DTCI (Delay Tolerant Connection Indication)", "gtpv2.dtci",
10259
14
          FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10260
14
        },
10261
14
        {&hf_gtpv2_bdwi,
10262
14
         {"BDWI (Buffered DL Data Waiting Indication)", "gtpv2.bdwi",
10263
14
          FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10264
14
        },
10265
14
        {&hf_gtpv2_psci,
10266
14
         {"PSCI (Pending Subscription Change Indication)", "gtpv2.psci",
10267
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10268
14
        },
10269
14
        {&hf_gtpv2_pcri,
10270
14
         {"PCRI (P-CSCF Restoration Indication)", "gtpv2.pcri",
10271
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10272
14
        },
10273
14
        {&hf_gtpv2_aosi,
10274
14
         {"AOSI (Associate OCI with SGW node's Identity)", "gtpv2.aosi",
10275
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10276
14
        },
10277
14
        {&hf_gtpv2_aopi,
10278
14
         {"AOPI (Associate OCI with PGW node's Identity)", "gtpv2.aopi",
10279
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10280
14
        },
10281
14
        {&hf_gtpv2_roaai,
10282
14
         {"ROAAI (Release Over Any Access Indication)", "gtpv2.roaai",
10283
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10284
14
        },
10285
14
        {&hf_gtpv2_epcosi,
10286
14
         {"EPCOSI (Extended PCO Support Indication)", "gtpv2.epcosi",
10287
14
          FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10288
14
        },
10289
14
        {&hf_gtpv2_cpopci,
10290
14
         {"CPOPCI (Control Plane Only PDN Connection Indication)", "gtpv2.cpopci",
10291
14
          FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10292
14
        },
10293
14
        {&hf_gtpv2_pmtsmi,
10294
14
         {"PMTSMI (Pending MT Short Message Indication)", "gtpv2.pmtsmi",
10295
14
          FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10296
14
        },
10297
14
        {&hf_gtpv2_s11tf,
10298
14
         {"S11TF (S11-U Tunnel Flag)", "gtpv2.s11tf",
10299
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10300
14
        },
10301
14
        {&hf_gtpv2_pnsi,
10302
14
         {"PNSI (Pending Network Initiated PDN Connection Signalling Indication)", "gtpv2.pnsi",
10303
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10304
14
        },
10305
14
        {&hf_gtpv2_unaccsi,
10306
14
         {"UNACCSI (UE Not Authorized Cause Code Support Indication)", "gtpv2.unaccsi",
10307
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10308
14
        },
10309
14
        {&hf_gtpv2_wpmsi,
10310
14
         {"WPMSI (WLCP PDN Connection Modification Support Indication)", "gtpv2.wpmsi",
10311
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10312
14
        },
10313
14
        {&hf_gtpv2_5gsnn26,
10314
14
        { "5GSNN26 (5GS Interworking without N26 Indication)", "gtpv2.5gsnn26",
10315
14
         FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }
10316
14
        },
10317
14
        {&hf_gtpv2_reprefi,
10318
14
        { "REPREFI (Return Preferred Indication)", "gtpv2.reprefi",
10319
14
         FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }
10320
14
        },
10321
14
        {&hf_gtpv2_5gsiwk,
10322
14
        { "5GSIWKI (5GS Interworking Indication)", "gtpv2.5gsiwk",
10323
14
         FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }
10324
14
        },
10325
14
        {&hf_gtpv2_eevrsi,
10326
14
        { "EEVRSI (Extended EBI Value Range Support Indication)", "gtpv2.eevrsi",
10327
14
         FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }
10328
14
        },
10329
14
        {&hf_gtpv2_ltemui,
10330
14
        { "LTEMUI (LTE-M UE Indication)", "gtpv2.ltemui",
10331
14
         FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }
10332
14
        },
10333
14
        {&hf_gtpv2_ltempi,
10334
14
        { "LTEMPI (LTE-M RAT Type reporting to PGW Indication)", "gtpv2.ltempi",
10335
14
         FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }
10336
14
        },
10337
14
        {&hf_gtpv2_enbcrsi,
10338
14
         {"ENBCRSI (eNB Change Reporting Support Indication)", "gtpv2.enbcrsi",
10339
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10340
14
        },
10341
14
        {&hf_gtpv2_tspcmi,
10342
14
         {"TSPCMI (Triggering SGSN Initiated PDP Context Creation/Modification Indication)", "gtpv2.tspcmi",
10343
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10344
14
        },
10345
14
        {&hf_gtpv2_csrmfi,
10346
14
         { "CSRMFI (Create Session Request Message Forwarded Indication)", "gtpv2.csrmfi",
10347
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }
10348
14
        },
10349
14
        {&hf_gtpv2_mtedtn,
10350
14
         { "MTEDTN (MT-EDT Not Applicable)", "gtpv2.mtedtn",
10351
14
          FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x40, NULL, HFILL }
10352
14
        },
10353
10354
14
        {&hf_gtpv2_mtedta,
10355
14
         { "MTEDTA (MT-EDT Applicable)", "gtpv2.mtedta",
10356
14
          FT_BOOLEAN, 8, TFS(&tfs_applicable_not_applicable), 0x20, NULL, HFILL }
10357
14
        },
10358
10359
14
        {&hf_gtpv2_n5gnmi,
10360
14
        { "N5GNMI (No 5GS N26 Mobility Indication)", "gtpv2.n5gnmi",
10361
14
         FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }
10362
14
        },
10363
14
        { &hf_gtpv2_5gcnrs,
10364
14
        { "5GCNRS (5GC Not Restricted Support)", "gtpv2.5gcnrs",
10365
14
         FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x08, NULL, HFILL }
10366
14
        },
10367
14
        { &hf_gtpv2_5gcnri,
10368
14
        { "5GCNRI (5GC Not Restricted Indication)", "gtpv2.5gcnri",
10369
14
         FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x04, NULL, HFILL }
10370
14
        },
10371
14
        { &hf_gtpv2_5srhoi,
10372
14
        { "5SRHOI (5G-SRVCC HO Indication)", "gtpv2.5srhoi",
10373
14
         FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x02, NULL, HFILL }
10374
14
        },
10375
14
        { &hf_gtpv2_ethpdn,
10376
14
         {"ETHPDN (Ethernet PDN Support Indication)", "gtpv2.ethpdn",
10377
14
          FT_BOOLEAN, 8, TFS(&tfs_supported_not_supported), 0x01, NULL, HFILL}
10378
14
        },
10379
14
        { &hf_gtpv2_nspusi,
10380
14
         {"NSPUSI (Notify Start of Pause of Charging via User plane Support Indication)", "gtpv2.nspusi",
10381
14
          FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL}
10382
14
        },
10383
14
        { &hf_gtpv2_pgwrnsi,
10384
14
         {"PGWRNSI (PGW Redirection due to mismatch with Network Slice subscribed by UE Support Indication)", "gtpv2.pgwrnsi",
10385
14
          FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL}
10386
14
        },
10387
14
        { &hf_gtpv2_rppcsi,
10388
14
         {"RPPCSI (Restoration of PDN connections after an PGW-C/SMF change Support Indication)", "gtpv2.rppcsi",
10389
14
          FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL}
10390
14
        },
10391
14
        { &hf_gtpv2_pgwchi,
10392
14
         {"PGWCHI (PGW CHange Indication)", "gtpv2.pgwchi",
10393
14
          FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL}
10394
14
        },
10395
14
        { &hf_gtpv2_sissme,
10396
14
         {"SISSME (Same IWK-SCEF Selected for Monitoring Event Indication)", "gtpv2.sissme",
10397
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10398
14
        },
10399
14
        { &hf_gtpv2_nsenbi,
10400
14
         {"NSENBI (Notify Source eNodeB Indication)", "gtpv2.nsenbi",
10401
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10402
14
        },
10403
14
        { &hf_gtpv2_idfupf,
10404
14
         {"IDFUPF (Indirect Data Forwarding with UPF Indication)", "gtpv2.idfupf",
10405
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10406
14
        },
10407
14
        { &hf_gtpv2_emci,
10408
14
         {"EMCI (Emergency PDU Session Indication)", "gtpv2.emci",
10409
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10410
14
        },
10411
14
        { &hf_gtpv2_lapcosi,
10412
14
         {"LAPCOSI (Large Additional Protocol Configuration Options Support Indication)", "gtpv2.lapcosi",
10413
14
          FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL}
10414
14
        },
10415
14
        { &hf_gtpv2_ltemsai,
10416
14
         {"LTEMSAI (LTE-M Satellite Access Indication)", "gtpv2.ltemsai",
10417
14
          FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL}
10418
14
        },
10419
14
        { &hf_gtpv2_srtpi,
10420
14
         {"SRTPI (Satellite RAT Type reporting to PGW Indication)", "gtpv2.srtpi",
10421
14
          FT_BOOLEAN, 8, NULL, 0x02, NULL, HFILL}
10422
14
        },
10423
14
        { &hf_gtpv2_upipsi,
10424
14
         {"UPIPSI (User Plane Integrity Protection Support Indication)", "gtpv2.upipsi",
10425
14
          FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL}
10426
14
        },
10427
10428
10429
14
        { &hf_gtpv2_pdn_type,
10430
14
          {"PDN Type", "gtpv2.pdn_type",
10431
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_pdn_type_vals_ext, 0x07,
10432
14
           NULL, HFILL}
10433
14
        },
10434
#if 0
10435
        { &hf_gtpv2_tra_info,
10436
          {"Trace ID", "gtpv2.tra_info",
10437
           FT_STRING, BASE_NONE, NULL, 0x0,
10438
           NULL, HFILL}
10439
        },
10440
#endif
10441
14
        { &hf_gtpv2_tra_info_msc_momt_calls,
10442
14
          {"MO and MT calls", "gtpv2.tra_info_msc_momt_calls",
10443
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10444
14
           "MSC Server", HFILL}
10445
14
        },
10446
14
        { &hf_gtpv2_tra_info_msc_momt_sms,
10447
14
          {"MO and MT SMS", "gtpv2.tra_info_msc_momt_sms",
10448
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10449
14
           "MSC Server", HFILL}
10450
14
        },
10451
14
        { &hf_gtpv2_tra_info_msc_lu_imsi_ad,
10452
14
          {"LU, IMSI attach, IMSI detach", "gtpv2.tra_info_msc_lu_imsi_ad",
10453
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10454
14
           "MSC Server", HFILL}
10455
14
        },
10456
14
        { &hf_gtpv2_tra_info_msc_handovers,
10457
14
          {"Handovers", "gtpv2.tra_info_msc_handovers",
10458
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10459
14
           "MSC Server", HFILL}
10460
14
        },
10461
14
        { &hf_gtpv2_tra_info_msc_ss,
10462
14
          {"SS", "gtpv2.tra_info_msc_ss",
10463
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10464
14
           "MSC Server", HFILL}
10465
14
        },
10466
14
        { &hf_gtpv2_tra_info_mgw_context,
10467
14
          {"Context", "gtpv2.tra_info_mgw_context",
10468
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10469
14
           "MGW", HFILL}
10470
14
        },
10471
14
        { &hf_gtpv2_tra_info_sgsn_pdp_context,
10472
14
          {"PDP context", "gtpv2.tra_info_sgsn_pdp_context",
10473
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10474
14
           "SGSN", HFILL}
10475
14
        },
10476
14
        { &hf_gtpv2_tra_info_sgsn_momt_sms,
10477
14
          {"MO and MT SMS", "gtpv2.tra_info_sgsn_momt_sms",
10478
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10479
14
           "SGSN", HFILL}
10480
14
        },
10481
14
        { &hf_gtpv2_tra_info_sgsn_rau_gprs_ad,
10482
14
          {"RAU, GPRS attach, GPRS detach", "gtpv2.tra_info_sgsn_rau_gprs_ad",
10483
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10484
14
           "SGSN", HFILL}
10485
14
        },
10486
14
        { &hf_gtpv2_tra_info_sgsn_mbms,
10487
14
          {"MBMS Context", "gtpv2.tra_info_sgsn_mbms",
10488
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10489
14
           "SGSN", HFILL}
10490
14
        },
10491
14
        { &hf_gtpv2_tra_info_sgsn_reserved,
10492
14
          {"Reserved", "gtpv2.tra_info_sgsn_reserved",
10493
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
10494
14
           "SGSN", HFILL}
10495
14
        },
10496
14
        { &hf_gtpv2_tra_info_ggsn_pdp,
10497
14
          {"PDP Context", "gtpv2.tra_info_ggsn_pdp",
10498
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10499
14
           "GGSN", HFILL}
10500
14
        },
10501
14
        { &hf_gtpv2_tra_info_ggsn_mbms,
10502
14
          {"MBMS Context", "gtpv2.tra_info_ggsn_mbms",
10503
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10504
14
           "GGSN", HFILL}
10505
14
        },
10506
14
        { &hf_gtpv2_tra_info_bm_sc,
10507
14
          {"MBMS Multicast service activation", "gtpv2.tra_info_bm_sc",
10508
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10509
14
           "BM-SC", HFILL}
10510
14
        },
10511
14
        { &hf_gtpv2_tra_info_mme_sgw_ss,
10512
14
          {"Session setup", "gtpv2.tra_info_mme_sgw_ss",
10513
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10514
14
           "MME", HFILL}
10515
14
        },
10516
14
        { &hf_gtpv2_tra_info_mme_sgw_sr,
10517
14
          {"Service Request", "gtpv2.tra_info_mme_sgw_sr",
10518
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10519
14
           "MME", HFILL}
10520
14
        },
10521
14
        { &hf_gtpv2_tra_info_mme_sgw_iataud,
10522
14
          {"Initial Attach, Tracking area update, Detach", "gtpv2.tra_info_mme_sgw_iataud",
10523
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10524
14
           "MME", HFILL}
10525
14
        },
10526
14
        { &hf_gtpv2_tra_info_mme_sgw_ue_init_pdn_disc,
10527
14
          {"UE initiated PDN disconnection", "gtpv2.tra_info_mme_sgw_ue_init_pdn_disc",
10528
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10529
14
           "MME", HFILL}
10530
14
        },
10531
14
        { &hf_gtpv2_tra_info_mme_sgw_bearer_act_mod_del,
10532
14
          {"Bearer Activation Modification Deletion", "gtpv2.tra_info_mme_sgw_bearer_act_mod_del",
10533
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10534
14
           "MME", HFILL}
10535
14
        },
10536
14
        { &hf_gtpv2_tra_info_mme_sgw_ho,
10537
14
          {"Handover", "gtpv2.tra_info_mme_sgw_ho",
10538
14
           FT_UINT8, BASE_DEC, NULL, 0x20,
10539
14
           "MME", HFILL}
10540
14
        },
10541
14
        { &hf_gtpv2_tra_info_sgw_pdn_con_creat,
10542
14
          {"PDN Connection creation", "gtpv2.tra_info_sgw_pdn_con_creat",
10543
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10544
14
           "SGW", HFILL}
10545
14
        },
10546
14
        { &hf_gtpv2_tra_info_sgw_pdn_con_term,
10547
14
          {"PDN connection termination", "gtpv2.tra_info_sgw_pdn_con_term",
10548
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10549
14
           "SGW", HFILL}
10550
14
        },
10551
14
        { &hf_gtpv2_tra_info_sgw_bearer_act_mod_del,
10552
14
          {"Bearer Activation Modification Deletion", "gtpv2.tra_info_sgw_bearer_act_mod_del",
10553
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10554
14
           "SGW", HFILL}
10555
14
        },
10556
14
        { &hf_gtpv2_tra_info_pgw_pdn_con_creat,
10557
14
          {"PDN Connection creation", "gtpv2.tra_info_pgw_pdn_con_creat",
10558
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10559
14
           "PGW", HFILL}
10560
14
        },
10561
14
        { &hf_gtpv2_tra_info_pgw_pdn_con_term,
10562
14
          {"PDN connection termination", "gtpv2.tra_info_pgw_pdn_con_term",
10563
14
           FT_UINT8, BASE_DEC, NULL, 0x20,
10564
14
           "PGW", HFILL}
10565
14
        },
10566
14
        { &hf_gtpv2_tra_info_pgw_bearer_act_mod_del,
10567
14
          {"Bearer Activation Modification Deletion", "gtpv2.tra_info_pgw_bearer_act_mod_del",
10568
14
           FT_UINT8, BASE_DEC, NULL, 0x40,
10569
14
           "PGW", HFILL}
10570
14
        },
10571
14
        { &hf_gtpv2_tra_info_lne_msc_s,
10572
14
          {"MSC-S", "gtpv2.tra_info_lne_msc_s",
10573
14
           FT_BOOLEAN, 8, NULL, 0x01,
10574
14
           NULL, HFILL}
10575
14
        },
10576
14
        { &hf_gtpv2_tra_info_lne_mgw,
10577
14
          {"MGW", "gtpv2.tra_info_lne_mgw",
10578
14
          FT_BOOLEAN, 8, NULL, 0x02,
10579
14
           NULL, HFILL}
10580
14
        },
10581
14
        { &hf_gtpv2_tra_info_lne_sgsn,
10582
14
          {"SGSN", "gtpv2.tra_info_lne_sgsn",
10583
14
           FT_BOOLEAN, 8, NULL, 0x04,
10584
14
           NULL, HFILL}
10585
14
        },
10586
14
        { &hf_gtpv2_tra_info_lne_ggsn,
10587
14
          {"GGSN", "gtpv2.tra_info_lne_ggsn",
10588
14
          FT_BOOLEAN, 8, NULL, 0x08,
10589
14
           NULL, HFILL}
10590
14
        },
10591
14
        { &hf_gtpv2_tra_info_lne_rnc,
10592
14
          {"RNC", "gtpv2.tra_info_lne_rnc",
10593
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10594
14
           NULL, HFILL}
10595
14
        },
10596
14
        { &hf_gtpv2_tra_info_lne_bm_sc,
10597
14
          {"BM-SC", "gtpv2.tra_info_lne_bm_sc",
10598
14
           FT_BOOLEAN, 8, NULL, 0x20,
10599
14
           NULL, HFILL}
10600
14
        },
10601
14
        { &hf_gtpv2_tra_info_lne_mme,
10602
14
          {"MME", "gtpv2.tra_info_lne_mme",
10603
14
           FT_BOOLEAN, 8, NULL, 0x40,
10604
14
           NULL, HFILL}
10605
14
        },
10606
14
        { &hf_gtpv2_tra_info_lne_sgw,
10607
14
          {"SGW", "gtpv2.tra_info_lne_sgw",
10608
14
          FT_BOOLEAN, 8, NULL, 0x80,
10609
14
           NULL, HFILL}
10610
14
        },
10611
14
        { &hf_gtpv2_tra_info_lne_pdn_gw,
10612
14
          {"PDN GW", "gtpv2.tra_info_lne_pdn_gw",
10613
14
           FT_BOOLEAN, 8, NULL, 0x01,
10614
14
           NULL, HFILL}
10615
14
        },
10616
14
        { &hf_gtpv2_tra_info_lne_enb,
10617
14
          {"eNB", "gtpv2.tra_info_lne_enb",
10618
14
           FT_BOOLEAN, 8, NULL, 0x02,
10619
14
           NULL, HFILL}
10620
14
        },
10621
14
        { &hf_gtpv2_tra_info_lne_amf,
10622
14
          {"AMF", "gtpv2.tra_info_lne_amf",
10623
14
           FT_BOOLEAN, 8, NULL, 0x04,
10624
14
           NULL, HFILL}
10625
14
        },
10626
14
        { &hf_gtpv2_tra_info_lne_smf,
10627
14
          {"SMF", "gtpv2.tra_info_lne_smf",
10628
14
           FT_BOOLEAN, 8, NULL, 0x08,
10629
14
           NULL, HFILL}
10630
14
        },
10631
14
        { &hf_gtpv2_tra_info_lne_pcf,
10632
14
          {"PCF", "gtpv2.tra_info_lne_pcf",
10633
14
           FT_BOOLEAN, 8, NULL, 0x10,
10634
14
           NULL, HFILL}
10635
14
        },
10636
14
        { &hf_gtpv2_tra_info_lne_upf,
10637
14
          {"UPF", "gtpv2.tra_info_lne_upf",
10638
14
           FT_BOOLEAN, 8, NULL, 0x20,
10639
14
           NULL, HFILL}
10640
14
        },
10641
14
        { &hf_gtpv2_tra_info_tra_info_ng_ran_node,
10642
14
          {"NG-RAN node", "gtpv2.tra_info_ng_ran_node",
10643
14
           FT_BOOLEAN, 8, NULL, 0x40,
10644
14
           NULL, HFILL}
10645
14
        },
10646
10647
14
        { &hf_gtpv2_tra_info_tdl,
10648
14
          {"Trace Depth Length", "gtpv2.tra_info_tdl",
10649
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
10650
14
           NULL, HFILL}
10651
14
        },
10652
14
        { &hf_gtpv2_tra_info_lmsc_a,
10653
14
          {"A", "gtpv2.tra_info_lmsc_a",
10654
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10655
14
           "MSC Server", HFILL}
10656
14
        },
10657
14
        { &hf_gtpv2_tra_info_lmsc_lu,
10658
14
          {"Iu", "gtpv2.tra_info_lmsc_lu",
10659
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10660
14
           "MSC Server", HFILL}
10661
14
        },
10662
14
        { &hf_gtpv2_tra_info_lmsc_mc,
10663
14
          {"Mc", "gtpv2.tra_info_lmsc_mc",
10664
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10665
14
           "MSC Server", HFILL}
10666
14
        },
10667
14
        { &hf_gtpv2_tra_info_lmsc_map_g,
10668
14
          {"MAP-G", "gtpv2.tra_info_lmsc_map_g",
10669
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10670
14
           "MSC Server", HFILL}
10671
14
        },
10672
14
        { &hf_gtpv2_tra_info_lmsc_map_b,
10673
14
          {"MAP-B", "gtpv2.tra_info_lmsc_map_b",
10674
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10675
14
           "MSC Server", HFILL}
10676
14
        },
10677
14
        { &hf_gtpv2_tra_info_lmsc_map_e,
10678
14
          {"MAP-E", "gtpv2.tra_info_lmsc_map_e",
10679
14
           FT_UINT8, BASE_DEC, NULL, 0x20,
10680
14
           "MSC Server", HFILL}
10681
14
        },
10682
14
        { &hf_gtpv2_tra_info_lmsc_map_f,
10683
14
          {"MAP-F", "gtpv2.tra_info_lmsc_map_f",
10684
14
           FT_UINT8, BASE_DEC, NULL, 0x40,
10685
14
           "MSC Server", HFILL}
10686
14
        },
10687
14
        { &hf_gtpv2_tra_info_lmsc_cap,
10688
14
          {"CAP", "gtpv2.tra_info_lmsc_cap",
10689
14
           FT_UINT8, BASE_DEC, NULL, 0x80,
10690
14
           "MSC Server", HFILL}
10691
14
        },
10692
14
        { &hf_gtpv2_tra_info_lmsc_map_d,
10693
14
          {"MAP-D", "gtpv2.tra_info_lmsc_map_d",
10694
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10695
14
           "MSC Server", HFILL}
10696
14
        },
10697
14
        { &hf_gtpv2_tra_info_lmsc_map_c,
10698
14
          {"MAP-C", "gtpv2.tra_info_lmsc_map_c",
10699
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10700
14
           "MSC Server", HFILL}
10701
14
        },
10702
14
        { &hf_gtpv2_tra_info_lmgw_mc,
10703
14
          {"Mc", "gtpv2.tra_info_lmgw_mc",
10704
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10705
14
           "MGW", HFILL}
10706
14
        },
10707
14
        { &hf_gtpv2_tra_info_lmgw_nb_up,
10708
14
          {"Nb-UP", "gtpv2.tra_info_lmgw_nb_up",
10709
14
           FT_UINT8, BASE_DEC, NULL, 0x2,
10710
14
           "MGW", HFILL}
10711
14
        },
10712
14
        { &hf_gtpv2_tra_info_lmgw_lu_up,
10713
14
          {"Iu-UP", "gtpv2.tra_info_lmgw_lu_up",
10714
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10715
14
           "MGW", HFILL}
10716
14
        },
10717
14
        { &hf_gtpv2_tra_info_lsgsn_gb,
10718
14
          {"Gb", "gtpv2.tra_info_lsgsn_gb",
10719
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10720
14
           "SGSN", HFILL}
10721
14
        },
10722
14
        { &hf_gtpv2_tra_info_lsgsn_lu,
10723
14
          {"Iu", "gtpv2.tra_info_lsgsn_lu",
10724
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10725
14
           "SGSN", HFILL}
10726
14
        },
10727
14
        { &hf_gtpv2_tra_info_lsgsn_gn,
10728
14
          {"Gn", "gtpv2.tra_info_lsgsn_gn",
10729
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10730
14
           "SGSN", HFILL}
10731
14
        },
10732
14
        { &hf_gtpv2_tra_info_lsgsn_map_gr,
10733
14
          {"MAP-Gr", "gtpv2.tra_info_lsgsn_map_gr",
10734
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10735
14
           "SGSN", HFILL}
10736
14
        },
10737
14
        { &hf_gtpv2_tra_info_lsgsn_map_gd,
10738
14
          {"MAP-Gd", "gtpv2.tra_info_lsgsn_map_gd",
10739
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10740
14
           "SGSN", HFILL}
10741
14
        },
10742
14
        { &hf_gtpv2_tra_info_lsgsn_map_gf,
10743
14
          {"MAP-Gf", "gtpv2.tra_info_lsgsn_map_gf",
10744
14
           FT_UINT8, BASE_DEC, NULL, 0x20,
10745
14
           "SGSN", HFILL}
10746
14
        },
10747
14
        { &hf_gtpv2_tra_info_lsgsn_gs,
10748
14
          {"Gs", "gtpv2.tra_info_lsgsn_gs",
10749
14
           FT_UINT8, BASE_DEC, NULL, 0x40,
10750
14
           "SGSN", HFILL}
10751
14
        },
10752
14
        { &hf_gtpv2_tra_info_lsgsn_ge,
10753
14
          {"Ge", "gtpv2.tra_info_lsgsn_ge",
10754
14
           FT_UINT8, BASE_DEC, NULL, 0x80,
10755
14
           "SGSN", HFILL}
10756
14
        },
10757
14
        { &hf_gtpv2_tra_info_lggsn_gn,
10758
14
          {"Gn", "gtpv2.tra_info_lggsn_gn",
10759
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10760
14
           "GGSN", HFILL}
10761
14
        },
10762
14
        { &hf_gtpv2_tra_info_lggsn_gi,
10763
14
          {"Gi", "gtpv2.tra_info_lggsn_gi",
10764
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10765
14
           "GGSN", HFILL}
10766
14
        },
10767
14
        { &hf_gtpv2_tra_info_lggsn_gmb,
10768
14
          {"Gmb", "gtpv2.tra_info_lggsn_gmb",
10769
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10770
14
           "GGSN", HFILL}
10771
14
        },
10772
14
        { &hf_gtpv2_tra_info_lrnc_lu,
10773
14
          {"Iu", "gtpv2.tra_info_lrnc_lu",
10774
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10775
14
           "RNC", HFILL}
10776
14
        },
10777
14
        { &hf_gtpv2_tra_info_lrnc_lur,
10778
14
          {"Iur", "gtpv2.tra_info_lrnc_lur",
10779
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10780
14
           "RNC", HFILL}
10781
14
        },
10782
14
        { &hf_gtpv2_tra_info_lrnc_lub,
10783
14
          {"Iub", "gtpv2.tra_info_lrnc_lub",
10784
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10785
14
           "RNC", HFILL}
10786
14
        },
10787
14
        { &hf_gtpv2_tra_info_lrnc_uu,
10788
14
          {"Uu", "gtpv2.tra_info_lrnc_uu",
10789
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10790
14
           "RNC", HFILL}
10791
14
        },
10792
14
        { &hf_gtpv2_tra_info_lbm_sc_gmb,
10793
14
          {"Gmb", "gtpv2.tra_info_lbm_sc_gmb",
10794
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10795
14
           "BM-SC", HFILL}
10796
14
        },
10797
14
        { &hf_gtpv2_tra_info_lmme_s1_mme,
10798
14
          {"S1-MME", "gtpv2.tra_info_lmme_s1_mme",
10799
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10800
14
           "MME", HFILL}
10801
14
        },
10802
14
        { &hf_gtpv2_tra_info_lmme_s3,
10803
14
          {"S3", "gtpv2.tra_info_lmme_s3",
10804
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10805
14
           "MME", HFILL}
10806
14
        },
10807
14
        { &hf_gtpv2_tra_info_lmme_s6a,
10808
14
          {"S6a", "gtpv2.tra_info_lmme_s6a",
10809
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10810
14
           "MME", HFILL}
10811
14
        },
10812
14
        { &hf_gtpv2_tra_info_lmme_s10,
10813
14
          {"S10", "gtpv2.tra_info_lmme_s10",
10814
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10815
14
           "MME", HFILL}
10816
14
        },
10817
14
        { &hf_gtpv2_tra_info_lmme_s11,
10818
14
          {"S11", "gtpv2.tra_info_lmme_s11",
10819
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10820
14
           "MME", HFILL}
10821
14
        },
10822
14
        { &hf_gtpv2_tra_info_lsgw_s4,
10823
14
          {"S4", "gtpv2.tra_info_lsgw_s4",
10824
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10825
14
           "SGW", HFILL}
10826
14
        },
10827
14
        { &hf_gtpv2_tra_info_lsgw_s5,
10828
14
          {"S5", "gtpv2.tra_info_lsgw_s5",
10829
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10830
14
           "SGW", HFILL}
10831
14
        },
10832
14
        { &hf_gtpv2_tra_info_lsgw_s8b,
10833
14
          {"S8b", "gtpv2.tra_info_lsgw_s8b",
10834
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10835
14
           "SGW", HFILL}
10836
14
        },
10837
14
        { &hf_gtpv2_tra_info_lsgw_s11,
10838
14
          {"S11", "gtpv2.tra_info_lsgw_s11",
10839
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10840
14
           "SGW", HFILL}
10841
14
        },
10842
14
        { &hf_gtpv2_tra_info_lpdn_gw_s2a,
10843
14
          {"S2a", "gtpv2.tra_info_lpdn_gw_s2a",
10844
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10845
14
           "PDN GW", HFILL}
10846
14
        },
10847
14
        { &hf_gtpv2_tra_info_lpdn_gw_s2b,
10848
14
          {"S2b", "gtpv2.tra_info_lpdn_gw_s2b",
10849
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10850
14
           "PDN GW", HFILL}
10851
14
        },
10852
14
        { &hf_gtpv2_tra_info_lpdn_gw_s2c,
10853
14
          {"S2c", "gtpv2.tra_info_lpdn_gw_s2c",
10854
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10855
14
           "PDN GW", HFILL}
10856
14
        },
10857
14
        { &hf_gtpv2_tra_info_lpdn_gw_s5,
10858
14
          {"S5", "gtpv2.tra_info_lpdn_gw_s5",
10859
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
10860
14
           "PDN GW", HFILL}
10861
14
        },
10862
14
        { &hf_gtpv2_tra_info_lpdn_gw_s6c,
10863
14
          {"S6c", "gtpv2.tra_info_lpdn_gw_s6c",
10864
14
           FT_UINT8, BASE_DEC, NULL, 0x10,
10865
14
           "PDN GW", HFILL}
10866
14
        },
10867
14
        { &hf_gtpv2_tra_info_lpdn_gw_gx,
10868
14
          {"Gx", "gtpv2.tra_info_lpdn_gw_gx",
10869
14
           FT_UINT8, BASE_DEC, NULL, 0x20,
10870
14
           "PDN GW", HFILL}
10871
14
        },
10872
14
        { &hf_gtpv2_tra_info_lpdn_gw_s8b,
10873
14
          {"S8b", "gtpv2.tra_info_lpdn_gw_s8b",
10874
14
           FT_UINT8, BASE_DEC, NULL, 0x40,
10875
14
           "PDN GW", HFILL}
10876
14
        },
10877
14
        { &hf_gtpv2_tra_info_lpdn_gw_sgi,
10878
14
          {"SGi", "gtpv2.tra_info_lpdn_gw_sgi",
10879
14
           FT_UINT8, BASE_DEC, NULL, 0x80,
10880
14
           "PDN GW", HFILL}
10881
14
        },
10882
14
        { &hf_gtpv2_tra_info_lenb_s1_mme,
10883
14
          {"S1-MME", "gtpv2.tra_info_lenb_s1_mme",
10884
14
           FT_UINT8, BASE_DEC, NULL, 0x01,
10885
14
           "eNB", HFILL}
10886
14
        },
10887
14
        { &hf_gtpv2_tra_info_lenb_x2,
10888
14
          {"X2", "gtpv2.tra_info_lenb_x2",
10889
14
           FT_UINT8, BASE_DEC, NULL, 0x02,
10890
14
           "eNB", HFILL}
10891
14
        },
10892
14
        { &hf_gtpv2_tra_info_lenb_uu,
10893
14
          {"Uu", "gtpv2.tra_info_lenb_uu",
10894
14
           FT_UINT8, BASE_DEC, NULL, 0x04,
10895
14
           "eNB", HFILL}
10896
14
        },
10897
14
        { &hf_gtpv2_pdn_ipv4,
10898
14
          {"PDN Address and Prefix(IPv4)", "gtpv2.pdn_addr_and_prefix.ipv4",
10899
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
10900
14
           NULL, HFILL}
10901
14
        },
10902
14
        { &hf_gtpv2_pdn_ipv6_len,
10903
14
          {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
10904
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
10905
14
           NULL, HFILL}
10906
14
        },
10907
14
        { &hf_gtpv2_pdn_ipv6,
10908
14
          {"PDN Address and Prefix(IPv6)", "gtpv2.pdn_addr_and_prefix.ipv6",
10909
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
10910
14
           NULL, HFILL}
10911
14
        },
10912
        /* Bit 7 - PCI (Pre-emption Capability): See 3GPP TS 29.212[29], clause 5.3.46 Pre-emption-Capability AVP.
10913
         * clause 5.3.46 Pre-emption-Capability AVP.
10914
         * 5.3.46 Pre-emption-Capability AVP
10915
         * The following values are defined:
10916
         * PRE-EMPTION_CAPABILITY_ENABLED (0)
10917
         * PRE-EMPTION_CAPABILITY_DISABLED (1)
10918
         */
10919
14
        {&hf_gtpv2_bearer_qos_pci,
10920
14
         {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
10921
14
          FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
10922
14
          NULL, HFILL}
10923
14
        },
10924
14
        {&hf_gtpv2_bearer_qos_pl,
10925
14
         {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
10926
14
          FT_UINT8, BASE_DEC, NULL, 0x3c,
10927
14
          NULL, HFILL}
10928
14
        },
10929
        /* Bit 1 - PVI (Pre-emption Vulnerability): See 3GPP TS 29.212[29],
10930
         * clause 5.3.47 Pre-emption-Vulnerability AVP.
10931
         * 5.3.47 Pre-emption-Vulnerability AVP
10932
         * The following values are defined:
10933
         * PRE-EMPTION_VULNERABILITY_ENABLED (0)
10934
         * PRE-EMPTION_VULNERABILITY_DISABLED (1)
10935
         */
10936
14
        {&hf_gtpv2_bearer_qos_pvi,
10937
14
         {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
10938
14
          FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
10939
14
          NULL, HFILL}
10940
14
        },
10941
14
        {&hf_gtpv2_bearer_qos_label_qci,
10942
14
         {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
10943
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
10944
14
          NULL, HFILL}
10945
14
        },
10946
14
        {&hf_gtpv2_bearer_qos_mbr_up,
10947
14
         {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
10948
14
          FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10949
14
          NULL, HFILL}
10950
14
        },
10951
14
        {&hf_gtpv2_bearer_qos_mbr_down,
10952
14
         {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
10953
14
          FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10954
14
          NULL, HFILL}
10955
14
        },
10956
14
        {&hf_gtpv2_bearer_qos_gbr_up,
10957
14
         {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
10958
14
          FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10959
14
          NULL, HFILL}
10960
14
        },
10961
14
        {&hf_gtpv2_bearer_qos_gbr_down,
10962
14
         {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
10963
14
          FT_UINT64, BASE_DEC|BASE_UNIT_STRING, UNS(&units_kbps), 0x0,
10964
14
          NULL, HFILL}
10965
14
        },
10966
14
        {&hf_gtpv2_flow_qos_label_qci,
10967
14
         {"Label (QCI)", "gtpv2.flow_qos_label_qci",
10968
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
10969
14
          NULL, HFILL}
10970
14
        },
10971
14
        {&hf_gtpv2_flow_qos_mbr_up,
10972
14
         {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
10973
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
10974
14
          NULL, HFILL}
10975
14
        },
10976
14
        {&hf_gtpv2_flow_qos_mbr_down,
10977
14
         {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
10978
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
10979
14
          NULL, HFILL}
10980
14
        },
10981
14
        {&hf_gtpv2_flow_qos_gbr_up,
10982
14
         {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
10983
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
10984
14
          NULL, HFILL}
10985
14
        },
10986
14
        {&hf_gtpv2_flow_qos_gbr_down,
10987
14
         {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
10988
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
10989
14
          NULL, HFILL}
10990
14
        },
10991
14
        { &hf_gtpv2_rat_type,
10992
14
          {"RAT Type", "gtpv2.rat_type",
10993
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_rat_type_vals_ext, 0x0,
10994
14
           NULL, HFILL}
10995
14
        },
10996
14
        { &hf_gtpv2_uli_ecgi_flg,
10997
14
          {"ECGI Present", "gtpv2.uli_ecgi_flg",
10998
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_ECGI_MASK,
10999
14
           NULL, HFILL}
11000
14
        },
11001
14
        { &hf_gtpv2_uli_ext_macro_enb_id_flg,
11002
14
          {"Extended Macro eNodeB ID Present", "gtpv2.uli_ext_macro_enb_id_flg",
11003
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_EXT_MACRO_eNB_ID_MASK,
11004
14
           NULL, HFILL}
11005
14
        },
11006
14
        { &hf_gtpv2_uli_macro_enb_id_flg,
11007
14
          {"Macro eNodeB ID Present", "gtpv2.uli_macro_enb_id_flg",
11008
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_MACRO_eNB_ID_MASK,
11009
14
           NULL, HFILL}
11010
14
        },
11011
14
        { &hf_gtpv2_uli_lai_flg,
11012
14
          {"LAI Present", "gtpv2.uli_lai_flg",
11013
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_LAI_MASK,
11014
14
           NULL, HFILL}
11015
14
        },
11016
14
        { &hf_gtpv2_uli_tai_flg,
11017
14
          {"TAI Present", "gtpv2.uli_tai_flg",
11018
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_TAI_MASK,
11019
14
           NULL, HFILL}
11020
14
        },
11021
14
        { &hf_gtpv2_uli_rai_flg,
11022
14
          {"RAI Present", "gtpv2.uli_rai_flg",
11023
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_RAI_MASK,
11024
14
           NULL, HFILL}
11025
14
        },
11026
14
        { &hf_gtpv2_uli_sai_flg,
11027
14
          {"SAI Present", "gtpv2.uli_sai_flg",
11028
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_SAI_MASK,
11029
14
           NULL, HFILL}
11030
14
        },
11031
14
        { &hf_gtpv2_uli_cgi_flg,
11032
14
          {"CGI Present", "gtpv2.uli_cgi_flg",
11033
14
           FT_BOOLEAN, 8, NULL, GTPv2_ULI_CGI_MASK,
11034
14
           NULL, HFILL}
11035
14
        },
11036
14
        { &hf_gtpv2_glt,
11037
14
          {"Geographic Location Type", "gtpv2.glt",
11038
14
           FT_UINT8, BASE_DEC, VALS(geographic_location_type_vals), 0x0,
11039
14
           NULL, HFILL}
11040
14
        },
11041
14
        { &hf_gtpv2_uli_cgi_lac,
11042
14
          {"Location Area Code", "gtpv2.uli_cgi_lac",
11043
14
           FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
11044
14
           NULL, HFILL}
11045
14
        },
11046
14
        { &hf_gtpv2_uli_cgi_ci,
11047
14
          {"Cell Identity", "gtpv2.uli_cgi_ci",
11048
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
11049
14
           NULL, HFILL}
11050
14
        },
11051
14
        { &hf_gtpv2_sai_lac,
11052
14
          {"Location Area Code", "gtpv2.sai_lac",
11053
14
           FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
11054
14
           NULL, HFILL}
11055
14
        },
11056
14
        { &hf_gtpv2_sai_sac,
11057
14
          {"Service Area Code", "gtpv2.sai_sac",
11058
14
           FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
11059
14
           NULL, HFILL}
11060
14
        },
11061
14
        { &hf_gtpv2_rai_lac,
11062
14
          {"Location Area Code", "gtpv2.rai_lac",
11063
14
           FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
11064
14
           NULL, HFILL}
11065
14
        },
11066
14
        { &hf_gtpv2_rai_rac,
11067
14
          {"Routing Area Code", "gtpv2.rai_rac",
11068
14
           FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
11069
14
           NULL, HFILL}
11070
14
        },
11071
14
        { &hf_gtpv2_tai_tac,
11072
14
          {"Tracking Area Code", "gtpv2.tai_tac",
11073
14
           FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
11074
14
           NULL, HFILL}
11075
14
        },
11076
14
        { &hf_gtpv2_5gs_tai_tac,
11077
14
          {"5GS Tracking Area Code", "gtpv2.5gs_tai_tac",
11078
14
           FT_UINT24, BASE_HEX_DEC, NULL, 0x0,
11079
14
           NULL, HFILL}
11080
14
        },
11081
14
        {&hf_gtpv2_ecgi_eci,
11082
14
         {"ECI (E-UTRAN Cell Identifier)", "gtpv2.ecgi_eci",
11083
14
          FT_UINT32, BASE_DEC, NULL, 0x0,
11084
14
          NULL, HFILL}
11085
14
        },
11086
14
        {&hf_gtpv2_ncgi_nrci,
11087
14
         {"NR Cell Identifier", "gtpv2.ncgi_nrci",
11088
14
          FT_UINT40, BASE_HEX, NULL, 0xfffffffff0,
11089
14
          NULL, HFILL}
11090
14
        },
11091
14
        {&hf_gtpv2_uli_lai_lac,
11092
14
         {"Location Area Code (LAC)", "gtpv2.uli_lai_lac",
11093
14
          FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
11094
14
          NULL, HFILL}
11095
14
        },
11096
14
        {&hf_gtpv2_ecgi_eci_spare,
11097
14
         {"Spare", "gtpv2.uli_ecgi_eci_spare",
11098
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
11099
14
          NULL, HFILL}
11100
14
        },
11101
14
        { &hf_gtpv2_nsapi,
11102
14
          {"NSAPI", "gtpv2.nsapi",
11103
14
           FT_UINT8, BASE_DEC, NULL, 0x0f,
11104
14
           NULL, HFILL}
11105
14
        },
11106
14
        {&hf_gtpv2_f_teid_v4,
11107
14
         {"V4", "gtpv2.f_teid_v4",
11108
14
          FT_BOOLEAN, 8, TFS(&gtpv2_f_teid_v4_vals), 0x80,
11109
14
          NULL, HFILL}
11110
14
        },
11111
14
        {&hf_gtpv2_f_teid_v6,
11112
14
         {"V6", "gtpv2.f_teid_v6",
11113
14
          FT_BOOLEAN, 8, TFS(&gtpv2_f_teid_v6_vals), 0x40,
11114
14
          NULL, HFILL}
11115
14
        },
11116
14
        {&hf_gtpv2_f_teid_interface_type,
11117
14
         {"Interface Type", "gtpv2.f_teid_interface_type",
11118
14
          FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_f_teid_interface_type_vals_ext, 0x3f,
11119
14
          NULL , HFILL}
11120
14
        },
11121
14
        {&hf_gtpv2_f_teid_gre_key,
11122
14
         {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
11123
14
          FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
11124
14
          NULL , HFILL}
11125
14
        },
11126
14
        { &hf_gtpv2_f_teid_ipv4,
11127
14
          {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
11128
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
11129
14
           NULL, HFILL}
11130
14
        },
11131
14
        { &hf_gtpv2_f_teid_ipv6,
11132
14
          {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
11133
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
11134
14
           NULL, HFILL}
11135
14
        },
11136
14
        { &hf_gtpv2_tmsi,
11137
14
          {"TMSI", "gtpv2.tmsi",
11138
14
           FT_UINT32, BASE_HEX, NULL, 0x0,
11139
14
           NULL, HFILL}
11140
14
        },
11141
14
        { &hf_gtpv2_hsgw_addr_f_len,
11142
14
          {"HSGW Address for forwarding Length", "gtpv2.hsgw_addr_f_len",
11143
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11144
14
           NULL, HFILL}
11145
14
        },
11146
14
        { &hf_gtpv2_hsgw_addr_ipv4,
11147
14
          {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv4",
11148
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
11149
14
           NULL, HFILL}
11150
14
        },
11151
14
        { &hf_gtpv2_hsgw_addr_ipv6,
11152
14
          {"HSGW Address for forwarding", "gtpv2.hsgw_addr_ipv6",
11153
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
11154
14
           NULL, HFILL}
11155
14
        },
11156
14
        { &hf_gtpv2_gre_key,
11157
14
          {"GRE Key", "gtpv2.gre_key",
11158
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
11159
14
           NULL , HFILL}
11160
14
        },
11161
14
        { &hf_gtpv2_sgw_addr_ipv4,
11162
14
          {"Serving GW Address", "gtpv2.sgw_addr_ipv4",
11163
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
11164
14
           NULL, HFILL}
11165
14
        },
11166
14
        { &hf_gtpv2_sgw_addr_ipv6,
11167
14
          {"Serving GW Address", "gtpv2.sgw_addr_ipv6",
11168
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
11169
14
           NULL, HFILL}
11170
14
        },
11171
14
        { &hf_gtpv2_sgw_s1u_teid,
11172
14
          {"Serving GW S1-U TEID", "gtpv2.sgw_s1u_teid",
11173
14
           FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
11174
14
           NULL, HFILL}
11175
14
        },
11176
14
        {&hf_gtpv2_delay_value,
11177
14
         {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
11178
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
11179
14
          NULL, HFILL}
11180
14
        },
11181
14
        {&hf_gtpv2_charging_id,
11182
14
         {"Charging id", "gtpv2.charging_id",
11183
14
          FT_UINT32, BASE_DEC, NULL, 0x0,
11184
14
          NULL, HFILL}
11185
14
        },
11186
14
        {&hf_gtpv2_charging_characteristic,
11187
14
         {"Charging Characteristic", "gtpv2.charging_characteristic",
11188
14
          FT_UINT16, BASE_HEX, NULL, 0x0,
11189
14
          NULL, HFILL}
11190
14
        },
11191
14
        {&hf_gtpv2_bearer_flag_ppc,
11192
14
         {"PPC (Prohibit Payload Compression)", "gtpv2.bearer_flag.ppc",
11193
14
          FT_BOOLEAN, 8, NULL, 0x01,
11194
14
          NULL, HFILL}
11195
14
        },
11196
14
        {&hf_gtpv2_bearer_flag_vb,
11197
14
         {"VB (Voice Bearer)", "gtpv2.bearer_flag.vb",
11198
14
          FT_BOOLEAN, 8, NULL, 0x02,
11199
14
          NULL, HFILL}
11200
14
        },
11201
14
        {&hf_gtpv2_pti,
11202
14
         {"Procedure Transaction Id", "gtpv2.pti",
11203
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
11204
14
          NULL, HFILL}
11205
14
        },
11206
        /* MM Context */
11207
14
        { &hf_gtpv2_mm_context_sm,
11208
14
          {"Security Mode", "gtpv2.mm_context_sm",
11209
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_security_mode), 0xe0,
11210
14
           NULL, HFILL}
11211
14
        },
11212
14
        { &hf_gtpv2_mm_context_nhi,
11213
14
          {"NHI(Next Hop Indicator)", "gtpv2.mm_context_nhi",
11214
14
           FT_BOOLEAN, 8, TFS(&gtpv2_nhi_vals), 0x10,
11215
14
           NULL, HFILL}
11216
14
        },
11217
14
        { &hf_gtpv2_mm_context_drxi,
11218
14
          {"DRXI", "gtpv2.mm_context_drxi",
11219
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
11220
14
           NULL, HFILL}
11221
14
        },
11222
14
        { &hf_gtpv2_mm_context_cksn,
11223
14
          {"CKSN", "gtpv2.mm_context_cksn",
11224
14
           FT_UINT8, BASE_DEC, NULL, 0x07,
11225
14
           NULL, HFILL}
11226
14
        },
11227
14
        { &hf_gtpv2_mm_context_cksn_ksi,
11228
14
          {"CKSN/KSI", "gtpv2.mm_context_cksn_ksi",
11229
14
           FT_UINT8, BASE_DEC, NULL, 0x07,
11230
14
           NULL, HFILL}
11231
14
        },
11232
14
        { &hf_gtpv2_metric,
11233
14
          {"Metric", "gtpv2.metric",
11234
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11235
14
           NULL, HFILL}
11236
14
        },
11237
14
        { &hf_gtpv2_throttling_factor,
11238
14
          {"Throttling Factor", "gtpv2.throttling_factor",
11239
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11240
14
           NULL, HFILL }
11241
14
        },
11242
14
        { &hf_gtpv2_relative_capacity,
11243
14
          {"Relative Capacity", "gtpv2.relative_capacity",
11244
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11245
14
           NULL, HFILL}
11246
14
        },
11247
14
        { &hf_gtpv2_apn_length,
11248
14
          {"APN Length", "gtpv2.apn_length",
11249
14
           FT_UINT8, BASE_HEX, NULL, 0x0,
11250
14
           NULL, HFILL}
11251
14
        },
11252
14
        { &hf_gtpv2_sequence_number,
11253
14
          {"Sequence Number", "gtpv2.sequence_number",
11254
14
           FT_UINT32, BASE_HEX, NULL, 0x0,
11255
14
           NULL, HFILL}
11256
14
        },
11257
14
        { &hf_gtpv2_mm_context_ksi_a,
11258
14
          {"KSI_asme", "gtpv2.mm_context_ksi_a",
11259
14
           FT_UINT8, BASE_DEC, NULL, 0x07,
11260
14
           NULL, HFILL}
11261
14
        },
11262
14
        { &hf_gtpv2_mm_context_nr_tri,
11263
14
          {"Number of Triplet", "gtpv2.mm_context_nr_tri",
11264
14
           FT_UINT8, BASE_DEC, NULL, 0xe0,
11265
14
           NULL, HFILL}
11266
14
        },
11267
14
        { &hf_gtpv2_mm_context_used_cipher,
11268
14
          {"Used Cipher", "gtpv2.mm_context_used_cipher",
11269
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_used_cipher_vals), 0x07,
11270
14
           NULL, HFILL}
11271
14
        },
11272
14
        { &hf_gtpv2_mm_context_unipa,
11273
14
          {"Used NAS integrity protection algorithm", "gtpv2.mm_context_unipa",
11274
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unipa_vals), 0x70,
11275
14
           NULL, HFILL}
11276
14
        },
11277
11278
14
        { &hf_gtpv2_mm_context_unc,
11279
14
          {"Used NAS Cipher", "gtpv2.mm_context_unc",
11280
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_unc_vals), 0x0f,
11281
14
           NULL, HFILL}
11282
14
        },
11283
14
        { &hf_gtpv2_mm_context_nas_dl_cnt,
11284
14
          {"NAS Downlink Count", "gtpv2.mm_context_nas_dl_cnt",
11285
14
           FT_UINT24, BASE_DEC, NULL, 0x0,
11286
14
           NULL, HFILL}
11287
14
        },
11288
14
        { &hf_gtpv2_mm_context_nas_ul_cnt,
11289
14
          {"NAS Uplink Count", "gtpv2.mm_context_nas_ul_cnt",
11290
14
           FT_UINT24, BASE_DEC, NULL, 0x0,
11291
14
           NULL, HFILL}
11292
14
        },
11293
14
        { &hf_gtpv2_mm_context_kasme,
11294
14
          {"Kasme", "gtpv2.mm_context_kasme",
11295
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11296
14
           NULL, HFILL}
11297
14
        },
11298
14
        { &hf_gtpv2_mm_context_rand,
11299
14
          {"RAND", "gtpv2.mm_context_rand",
11300
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11301
14
           NULL, HFILL}
11302
14
        },
11303
14
        {&hf_gtpv2_uci_csg_id,
11304
14
          {"CSG ID", "gtpv2.cui_csg_id",
11305
14
           FT_UINT32, BASE_DEC, NULL, 0x07FFFFFF,
11306
14
           NULL, HFILL}
11307
14
        },
11308
14
        {&hf_gtpv2_uci_csg_id_spare,
11309
14
          {"Spare", "gtpv2.cui_csg_id_spare",
11310
14
           FT_UINT8, BASE_DEC, NULL, 0xF8,
11311
14
           NULL, HFILL}
11312
14
        },
11313
14
        { &hf_gtpv2_uci_csg_membership,
11314
14
          { "CSG Membership Indication", "gtpv2.uci_csg_membership",
11315
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_uci_csg_membership_status), 0x01,
11316
14
           NULL, HFILL }
11317
14
        },
11318
14
        { &hf_gtpv2_uci_access_mode,
11319
14
          {"Access Mode", "gtpv2.uci_access_mode",
11320
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_uci_access_mode), 0xC0,
11321
14
           NULL, HFILL }
11322
14
        },
11323
14
        { &hf_gtpv2_uci_lcsg,
11324
14
          {"Leave CSG", "gtpv2.uci_leave_csg",
11325
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_uci_leave_csg), 0x02,
11326
14
           NULL, HFILL }
11327
14
        },
11328
14
        { &hf_gtpv2_mm_context_xres_len,
11329
14
          {"XRES Length", "gtpv2.mm_context_xres_len",
11330
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11331
14
           NULL, HFILL}
11332
14
        },
11333
14
        { &hf_gtpv2_mm_context_xres,
11334
14
          {"XRES", "gtpv2.mm_context_xres",
11335
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11336
14
           NULL, HFILL}
11337
14
        },
11338
14
        { &hf_gtpv2_mm_context_autn_len,
11339
14
          {"AUTN Length", "gtpv2.mm_context_autn_len",
11340
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11341
14
           NULL, HFILL}
11342
14
        },
11343
14
        { &hf_gtpv2_mm_context_autn,
11344
14
          {"AUTN", "gtpv2.mm_context_autn",
11345
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11346
14
           NULL, HFILL}
11347
14
        },
11348
14
        { &hf_gtpv2_mm_context_drx,
11349
14
          {"DRX", "gtpv2.mm_context_drx",
11350
14
           FT_UINT16, BASE_HEX, NULL, 0x0,
11351
14
           NULL, HFILL}
11352
14
        },
11353
14
        { &hf_gtpv2_vdp_length,
11354
14
          {"VDP and UE's Usage Setting length", "gtpv2.vdp_length",
11355
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11356
14
           NULL, HFILL}
11357
14
        },
11358
11359
14
        { &hf_gtpv2_mm_context_ue_net_cap_len,
11360
14
          {"Length of UE Network Capability", "gtpv2.mm_context_ue_net_cap_len",
11361
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11362
14
           NULL, HFILL}
11363
14
        },
11364
14
        { &hf_gtpv2_mm_context_ms_net_cap_len,
11365
14
          {"Length of MS Network Capability", "gtpv2.mm_context_ms_net_cap_len",
11366
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11367
14
           NULL, HFILL}
11368
14
        },
11369
14
        { &hf_gtpv2_mm_context_mei_len,
11370
14
          {"Length of Mobile Equipment Identity (MEI)", "gtpv2.mm_context_mei_len",
11371
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11372
14
           NULL, HFILL}
11373
14
        },
11374
14
        { &hf_gtpv2_mm_contex_nhi_old,
11375
14
        { "Next Hop Indicator for old EPS Security Context", "gtpv2.mm_context_nhi_old",
11376
14
            FT_UINT8, BASE_DEC, NULL, 0x80,
11377
14
            NULL, HFILL }
11378
14
        },
11379
14
        { &hf_gtpv2_mm_context_old_ksiasme,
11380
14
        { "old KSIASME", "gtpv2.old_ksiasme",
11381
14
            FT_UINT8, BASE_DEC, NULL, 0x38,
11382
14
            NULL, HFILL }
11383
14
        },
11384
14
        { &hf_gtpv2_mm_context_old_ncc,
11385
14
        { "old NCC", "gtpv2.old_ncc",
11386
14
            FT_UINT8, BASE_DEC, NULL, 0x07,
11387
14
            NULL, HFILL }
11388
14
        },
11389
14
        { &hf_gtpv2_mm_context_old_kasme,
11390
14
        { "Old Kasme", "gtpv2.mm_context_old_kasme",
11391
14
            FT_BYTES, BASE_NONE, NULL, 0x0,
11392
14
            NULL, HFILL }
11393
14
        },
11394
14
        { &hf_gtpv2_mm_context_old_nh,{ "Old NH (Old Next Hop)", "gtpv2.mm_context.old_nh", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
11395
14
        { &hf_gtpv2_mm_context_vdp_len,
11396
14
        { "Length of Voice Domain Preference and UE's Usage Setting", "gtpv2.mm_context.vdp_len",
11397
14
            FT_UINT8, BASE_DEC, NULL, 0x0,
11398
14
            NULL, HFILL }
11399
14
        },
11400
14
        { &hf_gtpv2_mm_context_paging_len,
11401
14
        { "Length of UE Radio Capability for Paging information", "gtpv2.mm_context.paging_len",
11402
14
            FT_UINT16, BASE_DEC, NULL, 0x0,
11403
14
            NULL, HFILL }
11404
14
        },
11405
14
        { &hf_gtpv2_mm_context_ex_access_res_data_len,
11406
14
        { "Length of Extended Access Restriction Data", "gtpv2.mm_context.ex_access_res_data_len",
11407
14
            FT_UINT8, BASE_DEC, NULL, 0x0,
11408
14
            NULL, HFILL }
11409
14
        },
11410
14
        { &hf_gtpv2_mm_context_ue_add_sec_cap_len,
11411
14
        { "Length of UE additional security capability", "gtpv2.mm_context.ue_add_sec_cap_len",
11412
14
            FT_UINT8, BASE_DEC, NULL, 0x0,
11413
14
            NULL, HFILL }
11414
14
        },
11415
14
        { &hf_gtpv2_mm_context_ue_nr_sec_cap_len,
11416
14
        { "Length of UE NR security capability", "gtpv2.mm_context.ue_nr_sec_cap_len",
11417
14
            FT_UINT8, BASE_DEC, NULL, 0x0,
11418
14
            NULL, HFILL }
11419
14
        },
11420
14
        { &hf_gtpv2_mm_context_apn_rte_ctrl_sts_len,
11421
14
        { "Length of APN Rate Control Statuses", "gtpv2.mm_context.apn_rte_ctrl_sts_len",
11422
14
            FT_UINT16, BASE_DEC, NULL, 0x0,
11423
14
            NULL, HFILL }
11424
14
        },
11425
14
        { &hf_gtpv2_mm_context_cnr_len,
11426
14
        { "Length of Core Network Restrictions", "gtpv2.mm_context.cnr_len",
11427
14
            FT_UINT8, BASE_DEC, NULL, 0x0,
11428
14
            NULL, HFILL }
11429
14
        },
11430
14
        { &hf_gtpv2_mm_context_ue_radio_cap_len,
11431
14
        { "Length of UE Radio Capability ID", "gtpv2.mm_context.radio_cap_len",
11432
14
            FT_UINT8, BASE_DEC, NULL, 0x0,
11433
14
            NULL, HFILL }
11434
14
        },
11435
14
        { &hf_gtpv2_una,
11436
14
          { "UTRAN", "gtpv2.mm_context.una",
11437
14
            FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x01,
11438
14
            NULL, HFILL }
11439
14
        },
11440
14
        { &hf_gtpv2_gena,
11441
14
          { "GERAN", "gtpv2.mm_context.gena",
11442
14
            FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x02,
11443
14
            NULL, HFILL }
11444
14
        },
11445
14
        { &hf_gtpv2_gana,
11446
14
          { "GAN", "gtpv2.mm_context.gana",
11447
14
            FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x04,
11448
14
            NULL, HFILL }
11449
14
        },
11450
14
        { &hf_gtpv2_ina,
11451
14
          { "I-HSPA-EVOLUTION", "gtpv2.mm_context.ina",
11452
14
            FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x08,
11453
14
            NULL, HFILL }
11454
14
        },
11455
14
        { &hf_gtpv2_ena,
11456
14
          { "E-UTRAN", "gtpv2.mm_context.ena",
11457
14
            FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x10,
11458
14
            NULL, HFILL }
11459
14
        },
11460
14
        { &hf_gtpv2_hnna,
11461
14
          { "HO-toNone3GPP-Access", "gtpv2.mm_context.hnna",
11462
14
            FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x20,
11463
14
            NULL, HFILL }
11464
14
        },
11465
14
        { &hf_gtpv2_hbna,
11466
14
        { "NB-IoT Not Allowed", "gtpv2.mm_context.hbna",
11467
14
            FT_BOOLEAN, 8, TFS(&tfs_not_allowed_allowed), 0x40,
11468
14
            NULL, HFILL }
11469
14
        },
11470
14
        { &hf_gtpv2_mm_context_ksi,
11471
14
          {"KSI", "gtpv2.mm_context_ksi",
11472
14
           FT_UINT8, BASE_DEC, NULL, 0x07,
11473
14
           NULL, HFILL}
11474
14
        },
11475
14
        { &hf_gtpv2_mm_context_nr_qui,
11476
14
          {"Number of Quintuplets", "gtpv2.mm_context_nr_qui",
11477
14
           FT_UINT8, BASE_DEC, NULL, 0xe0,
11478
14
           NULL, HFILL}
11479
14
        },
11480
11481
14
        { &hf_gtpv2_mm_context_nr_qua,
11482
14
          {"Number of Quadruplet", "gtpv2.mm_context_nr_qua",
11483
14
           FT_UINT8, BASE_DEC, NULL, 0x1c,
11484
14
           NULL, HFILL}
11485
14
        },
11486
14
        { &hf_gtpv2_mm_context_uamb_ri,
11487
14
          {"UAMB RI", "gtpv2.mm_context_uamb_ri",
11488
14
           FT_BOOLEAN, 8, NULL, 0x02,
11489
14
           NULL, HFILL}
11490
14
        },
11491
14
        { &hf_gtpv2_mm_context_osci,
11492
14
          {"OSCI", "gtpv2.mm_context_osci",
11493
14
           FT_BOOLEAN, 8, NULL, 0x01,
11494
14
           "Old Security Context Indicator", HFILL}
11495
14
        },
11496
14
        { &hf_gtpv2_mm_context_nruna,
11497
14
        { "NRUNA (NR-U in 5GS Not Allowed)", "gtpv2.mm_context.nruna",
11498
14
            FT_BOOLEAN, 8, NULL, 0x10,
11499
14
            NULL, HFILL }
11500
14
        },
11501
14
        { &hf_gtpv2_mm_context_nrusrna,
11502
14
        { "NRUSRNA (New Radio Unlicensed as Secondary RAT Not Allowed)", "gtpv2.mm_context.nrusrna",
11503
14
            FT_BOOLEAN, 8, NULL, 0x08,
11504
14
            NULL, HFILL }
11505
14
        },
11506
14
        { &hf_gtpv2_mm_context_nrna,
11507
14
        { "NRNA(NR in 5GS Not Allowed)", "gtpv2.mm_context.nrna",
11508
14
            FT_BOOLEAN, 8, NULL, 0x04,
11509
14
            NULL, HFILL }
11510
14
        },
11511
14
        { &hf_gtpv2_mm_context_ussrna,
11512
14
          {"USSRNA", "gtpv2.mm_context_ussrna",
11513
14
           FT_BOOLEAN, 8, NULL, 0x02,
11514
14
           "Unlicensed Spectrum in the form of LAA or LWA/LWIP as Secondary RAT Not Allowed", HFILL}
11515
14
        },
11516
14
        { &hf_gtpv2_mm_context_nrsrna,
11517
14
          {"NRSRNA(NR as Secondary RAT Not Allowed)", "gtpv2.mm_context_nrsrna",
11518
14
           FT_BOOLEAN, 8, NULL, 0x01,
11519
14
           NULL, HFILL}
11520
14
        },
11521
14
        { &hf_gtpv2_mm_context_ensct,
11522
14
          {"ENSCT (EPS NAS Security Context Type)", "gtpv2.mm_context_ensct",
11523
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_eps_nas_security_context_type_vals), 0x03,
11524
14
           NULL, HFILL}
11525
14
        },
11526
14
        { &hf_gtpv2_mm_context_samb_ri,
11527
14
          {"SAMB RI", "gtpv2.mm_context_samb_ri",
11528
14
           FT_BOOLEAN, BASE_NONE, NULL, 0x0,
11529
14
           NULL, HFILL}
11530
14
        },
11531
14
        { &hf_gtpv2_ue_time_zone_dst,
11532
14
          {"Daylight Saving Time", "gtpv2.ue_time_zone_dst",
11533
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals), 0x03,
11534
14
           NULL, HFILL}
11535
14
        },
11536
14
        { &hf_gtpv2_fq_csid_type,
11537
14
          {"Node-ID Type", "gtpv2.fq_csid_type",
11538
14
           FT_UINT8, BASE_DEC, NULL, 0xf0,
11539
14
           NULL, HFILL}
11540
14
        },
11541
14
        { &hf_gtpv2_fq_csid_nr,
11542
14
          {"Number of CSIDs", "gtpv2.fq_csid_nr",
11543
14
           FT_UINT8, BASE_DEC, NULL, 0x0f,
11544
14
           NULL, HFILL}
11545
14
        },
11546
14
        { &hf_gtpv2_fq_csid_ipv4,
11547
14
          {"Node-ID (IPv4)", "gtpv2.fq_csid_ipv4",
11548
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
11549
14
           NULL, HFILL}
11550
14
        },
11551
14
        { &hf_gtpv2_fq_csid_ipv6,
11552
14
          {"Node-ID (IPv6)", "gtpv2.fq_csid_ipv6",
11553
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
11554
14
           NULL, HFILL}
11555
14
        },
11556
14
        { &hf_gtpv2_fq_csid_id,
11557
14
          {"CSID", "gtpv2.fq_csid_id",
11558
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
11559
14
           NULL, HFILL}
11560
14
        },
11561
14
        { &hf_gtpv2_complete_req_msg_type,
11562
14
          {"Complete Request Message Type", "gtpv2.complete_req_msg_type",
11563
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_complete_req_msg_type_vals), 0x0,
11564
14
           NULL, HFILL}
11565
14
        },
11566
14
        {&hf_gtpv2_mme_grp_id,
11567
14
         {"MME Group ID", "gtpv2.mme_grp_id",
11568
14
          FT_UINT16, BASE_DEC, NULL, 0x0,
11569
14
          NULL, HFILL}
11570
14
        },
11571
14
        { &hf_gtpv2_mme_code,
11572
14
          {"MME Code", "gtpv2.mme_code",
11573
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11574
14
           NULL, HFILL}
11575
14
        },
11576
14
        { &hf_gtpv2_m_tmsi,
11577
14
          {"M-TMSI", "gtpv2.m_tmsi",
11578
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11579
14
           NULL, HFILL}
11580
14
        },
11581
14
        { &hf_gtpv2_container_type,
11582
14
          {"Container Type", "gtpv2.container_type",
11583
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_container_type_vals), 0x0f,
11584
14
           NULL, HFILL}
11585
14
        },
11586
14
        { &hf_gtpv2_cause_type,
11587
14
          {"Cause Type", "gtpv2.cause_type",
11588
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_cause_type_vals_ext, 0x0f,
11589
14
           NULL, HFILL}
11590
14
        },
11591
14
        { &hf_gtpv2_CauseRadioNetwork,
11592
14
          {"Radio Network Layer Cause", "gtpv2.CauseRadioNetwork",
11593
14
           FT_UINT8, BASE_DEC, VALS(s1ap_CauseRadioNetwork_vals), 0x0,
11594
14
           NULL, HFILL}
11595
14
        },
11596
14
        { &hf_gtpv2_CauseTransport,
11597
14
          {"Transport Layer Cause", "gtpv2.CauseTransport",
11598
14
           FT_UINT8, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0x0,
11599
14
           NULL, HFILL}
11600
14
        },
11601
14
        { &hf_gtpv2_CauseNas,
11602
14
          {"NAS Cause", "gtpv2.CauseNas",
11603
14
           FT_UINT8, BASE_DEC, VALS(s1ap_CauseNas_vals), 0x0,
11604
14
           NULL, HFILL}
11605
14
        },
11606
14
        { &hf_gtpv2_CauseMisc,
11607
14
          {"Miscellaneous Cause", "gtpv2.CauseMisc",
11608
14
           FT_UINT8, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0x0,
11609
14
           NULL, HFILL}
11610
14
        },
11611
14
        { &hf_gtpv2_target_type,
11612
14
          {"Target Type", "gtpv2.target_type",
11613
14
           FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_target_type_vals_ext, 0x0,
11614
14
           NULL, HFILL}
11615
14
        },
11616
14
        {&hf_gtpv2_macro_enodeb_id,
11617
14
         {"Macro eNodeB ID", "gtpv2.macro_enodeb_id",
11618
14
          FT_UINT24, BASE_HEX, NULL, 0x0fffff,
11619
14
          NULL, HFILL}
11620
14
        },
11621
14
        {&hf_gtpv2_smenb,
11622
14
         {"SMeNB", "gtpv2.smenb",
11623
14
          FT_BOOLEAN, 8, TFS(&gtpv2_smenb), 0x80,
11624
14
          NULL, HFILL}
11625
14
        },
11626
14
        {&hf_gtpv2_ext_macro_enodeb_id,
11627
14
         {"Extended Macro eNodeB ID", "gtpv2.ext_macro_enodeb_id",
11628
14
          FT_UINT24, BASE_HEX, NULL, 0x1fffff,
11629
14
          NULL, HFILL}
11630
14
        },
11631
14
        {&hf_gtpv2_ext_macro_ng_enodeb_id,
11632
14
         {"Extended Macro ng-eNodeB ID", "gtpv2.ext_macro_ng_enodeb_id",
11633
14
          FT_UINT24, BASE_HEX, NULL, 0x1fffff,
11634
14
          NULL, HFILL}
11635
14
        },
11636
14
        {&hf_gtpv2_cellid,
11637
14
         {"CellId", "gtpv2.cellid",
11638
14
          FT_UINT32, BASE_DEC, NULL, 0xFF,
11639
14
          NULL, HFILL}
11640
14
        },
11641
14
        { &hf_gtpv2_enodebid,
11642
14
         { "eNodeB Id", "gtpv2.enodebid",
11643
14
          FT_UINT32, BASE_DEC, NULL, 0x0FFFFF00,
11644
14
          NULL, HFILL }
11645
14
         },
11646
14
        { &hf_gtpv2_CauseProtocol,
11647
14
          {"Protocol Cause", "gtpv2.CauseProtocol",
11648
14
           FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0,
11649
14
           NULL, HFILL}
11650
14
        },
11651
14
        {&hf_gtpv2_apn_rest,
11652
14
         {"APN Restriction", "gtpv2.apn_rest",
11653
14
          FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_apn_restriction_vals_ext, 0x0,
11654
14
          NULL, HFILL}
11655
14
        },
11656
14
        {&hf_gtpv2_selec_mode,
11657
14
         {"Selection Mode", "gtpv2.selec_mode",
11658
14
          FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals), 0x03,
11659
14
          NULL, HFILL}
11660
14
        },
11661
14
        { &hf_gtpv2_source_type,
11662
14
          {"Source Type", "gtpv2.source_type",
11663
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11664
14
           NULL, HFILL}
11665
14
        },
11666
14
        {&hf_gtpv2_bearer_control_mode,
11667
14
         {"Bearer Control Mode", "gtpv2.bearer_control_mode",
11668
14
          FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals), 0x0,
11669
14
          NULL, HFILL}
11670
14
        },
11671
14
        { &hf_gtpv2_cng_rep_act,
11672
14
          {"Change Reporting Action", "gtpv2.cng_rep_act",
11673
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
11674
14
           NULL, HFILL}
11675
14
        },
11676
14
        { &hf_gtpv2_node_type,
11677
14
          {"Node Type", "gtpv2.node_type",
11678
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
11679
14
           NULL, HFILL}
11680
14
        },
11681
14
        {&hf_gtpv2_fqdn,
11682
14
         {"FQDN", "gtpv2.fqdn",
11683
14
          FT_STRING, BASE_NONE, NULL, 0x0,
11684
14
          NULL, HFILL}
11685
14
        },
11686
14
        { &hf_gtpv2_enterprise_id,
11687
14
          {"Enterprise ID", "gtpv2.enterprise_id",
11688
14
           FT_UINT16, BASE_ENTERPRISES, STRINGS_ENTERPRISES, 0x0,
11689
14
           NULL, HFILL}
11690
14
        },
11691
14
        { &hf_gtpv2_ti,
11692
14
          {"Transaction Identifier", "gtpv2.ti",
11693
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11694
14
           NULL, HFILL}
11695
14
        },
11696
14
        { &hf_gtpv2_bss_container_phx,
11697
14
          {"PHX", "gtpv2.bss_cont.phx",
11698
14
           FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08,
11699
14
           NULL, HFILL}
11700
14
        },
11701
14
        { &hf_gtpv2_bss_con_sapi_flg,
11702
14
          {"SAPI", "gtpv2.bss_cont.sapi_flg",
11703
14
           FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04,
11704
14
           NULL, HFILL}
11705
14
        },
11706
14
        { &hf_gtpv2_bss_con_rp_flg,
11707
14
          {"RP", "gtpv2.bss_cont.rp_flg",
11708
14
           FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
11709
14
           NULL, HFILL}
11710
14
        },
11711
14
        { &hf_gtpv2_bss_con_pfi_flg,
11712
14
          {"PFI", "gtpv2.bss_cont.pfi_flg",
11713
14
           FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
11714
14
           NULL, HFILL}
11715
14
        },
11716
14
        { &hf_gtpv2_bss_con_pfi,
11717
14
          {"Packet Flow ID(PFI)", "gtpv2.bss_cont.pfi",
11718
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11719
14
           NULL, HFILL}
11720
14
        },
11721
14
        { &hf_gtpv2_bss_con_rp,
11722
14
          {"Radio Priority(RP)", "gtpv2.bss_cont.rp",
11723
14
           FT_UINT8, BASE_DEC, NULL, 0x07,
11724
14
           NULL, HFILL}
11725
14
        },
11726
14
        { &hf_gtpv2_bss_con_sapi,
11727
14
          {"SAPI", "gtpv2.bss_cont.sapi",
11728
14
           FT_UINT8, BASE_DEC, NULL, 0xf0,
11729
14
           NULL, HFILL}
11730
14
        },
11731
14
        { &hf_gtpv2_bss_con_xid_len,
11732
14
          {"XiD parameters length", "gtpv2.bss_cont.xid_len",
11733
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11734
14
           NULL, HFILL}
11735
14
        },
11736
14
        { &hf_gtpv2_bss_con_xid,
11737
14
          {"XiD parameters", "gtpv2.bss_cont.xid",
11738
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11739
14
           NULL, HFILL}
11740
14
        },
11741
14
        { &hf_gtpv2_home_enodeb_id,
11742
14
          {"Home eNodeB ID", "gtpv2.home_enodeb_id",
11743
14
           FT_UINT32, BASE_HEX, NULL, 0x0fffffff,
11744
14
           NULL, HFILL}
11745
14
        },
11746
14
        { &hf_gtpv2_tac,
11747
14
          {"Tracking Area Code (TAC)", "gtpv2.tac",
11748
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
11749
14
           NULL, HFILL}
11750
14
        },
11751
14
        { &hf_gtpv2_mbms_service_area_nr,
11752
14
          {"Number of MBMS Service Area codes", "gtpv2.mbms_service_area_nr",
11753
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
11754
14
           NULL, HFILL}
11755
14
        },
11756
14
        { &hf_gtpv2_mbms_service_area_id,
11757
14
          {"MBMS Service Area code (Service Area Identity)", "gtpv2.mbms_service_area_id",
11758
14
           FT_UINT16, BASE_DEC, NULL, 0x0,
11759
14
           NULL, HFILL}
11760
14
        },
11761
14
        { &hf_gtpv2_mbms_session_id,
11762
14
          {"MBMS Session Identifier", "gtpv2.mbms_session_id",
11763
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11764
14
           NULL, HFILL}
11765
14
        },
11766
14
        { &hf_gtpv2_mbms_flow_id,
11767
14
          {"MBMS Flow Identifier", "gtpv2.mbms_flow_id",
11768
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11769
14
           NULL, HFILL}
11770
14
        },
11771
14
        { &hf_gtpv2_cteid,
11772
14
          {"Common Tunnel Endpoint Identifier", "gtpv2.cetid",
11773
14
           FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
11774
14
           NULL, HFILL}
11775
14
        },
11776
14
        { &hf_gtpv2_ip_addr_type,
11777
14
          {"IP Address Type", "gtpv2.ip_addr_type",
11778
14
           FT_UINT8, BASE_DEC, NULL, 0xc0,
11779
14
           NULL, HFILL}
11780
14
        },
11781
14
        { &hf_gtpv2_ip_addr_len,
11782
14
          {"IP Address Length", "gtpv2.ip_addr_len",
11783
14
           FT_UINT8, BASE_DEC, NULL, 0x3f,
11784
14
           NULL, HFILL}
11785
14
        },
11786
14
        { &hf_gtpv2_mbms_ip_mc_dist_addrv4,
11787
14
          {"MBMS IP Multicast Distribution Address (IPv4)", "gtpv2.mbms_ip_mc_dist_addrv4",
11788
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
11789
14
           NULL, HFILL}
11790
14
        },
11791
14
        { &hf_gtpv2_mbms_ip_mc_dist_addrv6,
11792
14
          {"MBMS IP Multicast Distribution Address (IPv6)", "gtpv2.mbms_ip_mc_dist_addrv6",
11793
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
11794
14
           NULL, HFILL}
11795
14
        },
11796
14
        { &hf_gtpv2_mbms_ip_mc_src_addrv4,
11797
14
          {"MBMS IP Multicast Source Address (IPv4)", "gtpv2.mbms_ip_mc_src_addrv4",
11798
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
11799
14
           NULL, HFILL}
11800
14
        },
11801
14
        { &hf_gtpv2_mbms_ip_mc_src_addrv6,
11802
14
          {"MBMS IP Multicast Source Address (IPv6)", "gtpv2.mbms_ip_mc_src_addrv6",
11803
14
           FT_IPv6, BASE_NONE, NULL, 0x0,
11804
14
           NULL, HFILL}
11805
14
        },
11806
14
        { &hf_gtpv2_mbms_hc_indicator,
11807
14
          {"MBMS HC Indicator", "gtpv2.mbms_hc_indicator",
11808
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_hc_indicator_vals), 0x0,
11809
14
           NULL, HFILL}
11810
14
        },
11811
14
        { &hf_gtpv2_mbms_dist_indication,
11812
14
          {"MBMS Distribution Indication", "gtpv2.mbms_dist_indication",
11813
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mbms_dist_indication_vals), 0x03,
11814
14
           NULL, HFILL}
11815
14
        },
11816
14
        { &hf_gtpv2_subscriber_rfsp,
11817
14
          {"Subscribed RFSP Index", "gtpv2.subscriber_rfsp",
11818
14
           FT_INT16, BASE_DEC, NULL, 0x0,
11819
14
           NULL, HFILL}
11820
14
        },
11821
14
        { &hf_gtpv2_rfsp_inuse,
11822
14
          {"RFSP Index in Use", "gtpv2.rfsp_inuse",
11823
14
           FT_INT16, BASE_DEC, NULL, 0x0,
11824
14
           NULL, HFILL}
11825
14
        },
11826
14
        { &hf_gtpv2_mbms_service_id,
11827
14
          {"MBMS Service ID", "gtpv2.mbms_service_id",
11828
14
           FT_BYTES, BASE_NONE, NULL, 0x0,
11829
14
           NULL, HFILL}
11830
14
        },
11831
14
        { &hf_gtpv2_add_flags_for_srvcc_ics,
11832
14
          {"ICS (IMS Centralized Service)", "gtpv2.add_flags_for_srvcc_ics",
11833
14
           FT_BOOLEAN, 8, NULL, 0x01,
11834
14
           NULL, HFILL}
11835
14
        },
11836
14
        { &hf_gtpv2_vsrvcc_flag,
11837
14
          {"VF (vSRVCC Flag)", "gtpv2.vsrvcc_flag",
11838
14
           FT_BOOLEAN, 8, NULL, 0x02,
11839
14
           NULL, HFILL}
11840
14
        },
11841
14
        { &hf_gtpv2_henb_info_report_fti,
11842
14
          {"FTI", "gtpv2.henb_info_report_fti",
11843
14
           FT_BOOLEAN, 8, TFS(&gtpv2_henb_info_report_fti_vals), 0x01,
11844
14
           NULL, HFILL}
11845
14
        },
11846
14
        { &hf_gtpv2_ip4cp_subnet_prefix_len,
11847
14
          {"Subnet Prefix Length", "gtpv2.ip4cp_subnet_prefix_len",
11848
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
11849
14
           NULL, HFILL}
11850
14
        },
11851
14
        { &hf_gtpv2_ip4cp_ipv4,
11852
14
          {"IPv4 Default Router Address", "gtpv2.ip4cp_ipv4",
11853
14
           FT_IPv4, BASE_NONE, NULL, 0x0,
11854
14
           NULL, HFILL}
11855
14
        },
11856
14
        { &hf_gtpv2_change_report_flags_sncr,
11857
14
          {"SNCR (Service Network Change to Report)", "gtpv2.change_report_flags_sncr",
11858
14
           FT_BOOLEAN, 8, NULL, 0x01,
11859
14
           NULL, HFILL}
11860
14
        },
11861
14
        { &hf_gtpv2_change_report_flags_tzcr,
11862
14
          {"TZCR (Time Zone Change to Report)", "gtpv2.change_report_flags_tzcr",
11863
14
           FT_BOOLEAN, 8, NULL, 0x02,
11864
14
           NULL, HFILL}
11865
14
        },
11866
14
        {&hf_gtpv2_action_indication_val,
11867
14
         {"Action Indication", "gtpv2.action_indication_val",
11868
14
          FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtpv2_action_indication_vals_ext, 0x07,
11869
14
          NULL , HFILL}
11870
14
        },
11871
14
        { &hf_gtpv2_uli_timestamp,
11872
14
        { "ULI Timestamp", "gtpv2.uli_timestamp",
11873
14
            FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0,
11874
14
        NULL, HFILL }
11875
14
        },
11876
14
        { &hf_gtpv2_abs_time_mbms_data,
11877
14
        { "Absolute Time of MBMS Data Transfer", "gtpv2.abs_time_mbms_data",
11878
14
        FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0,
11879
14
        NULL, HFILL }
11880
14
        },
11881
14
        { &hf_gtpv2_mbms_session_duration_days,
11882
14
          {"MBMS Session Duration (days)", "gtpv2.mbms_session_duration_days",
11883
14
           FT_UINT24, BASE_DEC, NULL, 0x00007F,
11884
14
           NULL, HFILL}
11885
14
        },
11886
14
        { &hf_gtpv2_mbms_session_duration_secs,
11887
14
          {"MBMS Session Duration (seconds)", "gtpv2.mbms_session_duration_secs",
11888
14
           FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
11889
14
           NULL, HFILL}
11890
14
        },
11891
14
        { &hf_gtpv2_csg_id,
11892
14
          {"CSG ID", "gtpv2.csg_id",
11893
14
           FT_UINT32, BASE_HEX, NULL, 0x07ffffff,
11894
14
           NULL, HFILL}
11895
14
        },
11896
14
        { &hf_gtpv2_cmi,
11897
14
          {"CSG Membership Indication (CMI)", "gtpv2.cmi",
11898
14
           FT_BOOLEAN, 8, TFS(&tfs_no_yes), 0x01,
11899
14
           NULL, HFILL}
11900
14
        },
11901
14
        { &hf_gtpv2_service_indicator,
11902
14
          {"Service Indicator", "gtpv2.service_indicator",
11903
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_service_indicator_vals), 0,
11904
14
           NULL, HFILL}
11905
14
        },
11906
14
        { &hf_gtpv2_detach_type,
11907
14
          {"Detach Type", "gtpv2.detach_type",
11908
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_detach_type_vals), 0,
11909
14
           NULL, HFILL}
11910
14
        },
11911
14
        { &hf_gtpv2_ldn,
11912
14
          {"Local Distinguished Name (LDN)", "gtpv2.ldn",
11913
14
           FT_STRING, BASE_NONE, NULL, 0,
11914
14
           NULL, HFILL}
11915
14
        },
11916
14
        { &hf_gtpv2_node_features_prn,
11917
14
          {"PGW Restart Notification (PRN)", "gtpv2.node_features_prn",
11918
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x01,
11919
14
           NULL, HFILL}
11920
14
        },
11921
14
        { &hf_gtpv2_node_features_mabr,
11922
14
          {"Modify Access Bearers Request (MABR)", "gtpv2.node_features_mabr",
11923
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x02,
11924
14
           NULL, HFILL}
11925
14
        },
11926
14
        { &hf_gtpv2_node_features_ntsr,
11927
14
          {"Network Triggered Service Restoration (NTSR)", "gtpv2.node_features_ntsr",
11928
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x04,
11929
14
           NULL, HFILL}
11930
14
        },
11931
14
        { &hf_gtpv2_node_features_ciot,
11932
14
          {"Cellular Internet Of Things (CIOT)", "gtpv2.node_features_ciot",
11933
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x08,
11934
14
           NULL, HFILL}
11935
14
        },
11936
14
        { &hf_gtpv2_node_features_s1un,
11937
14
          {"S1-U path failure notification feature (S1UN)", "gtpv2.node_features_s1un",
11938
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x10,
11939
14
           NULL, HFILL}
11940
14
        },
11941
14
        { &hf_gtpv2_node_features_eth,
11942
14
          {"Ethernet PDN type (ETH)", "gtpv2.node_features_eth",
11943
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x20,
11944
14
           NULL, HFILL}
11945
14
        },
11946
14
        { &hf_gtpv2_node_features_mtedt,
11947
14
          {"Support of MT-EDT (MTEDT)", "gtpv2.node_features_mtedt",
11948
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x40,
11949
14
           NULL, HFILL}
11950
14
        },
11951
14
        { &hf_gtpv2_node_features_psset,
11952
14
          {"Support of PGW-C/SMF Set (PSSET)", "gtpv2.node_features_psset",
11953
14
           FT_BOOLEAN, 8, TFS(&tfs_enabled_disabled), 0x80,
11954
14
           NULL, HFILL}
11955
14
        },
11956
14
        { &hf_gtpv2_time_to_data_xfer,
11957
14
          {"MBMS Time to Data Transfer", "gtpv2.time_to_data_xfer",
11958
14
           FT_STRING, BASE_NONE, NULL, 0,
11959
14
           NULL, HFILL}
11960
14
        },
11961
14
        { &hf_gtpv2_arp_pvi,
11962
14
          {"Pre-emption Vulnerability (PVI)", "gtpv2.arp_pvi",
11963
14
           FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
11964
14
           NULL, HFILL}
11965
14
        },
11966
14
        { &hf_gtpv2_arp_pl,
11967
14
          {"Priority Level", "gtpv2.arp_pl",
11968
14
           FT_UINT8, BASE_DEC, NULL, 0x3c,
11969
14
           NULL, HFILL}
11970
14
        },
11971
14
        { &hf_gtpv2_arp_pci,
11972
14
          {"Pre-emption Capability (PCI)", "gtpv2.arp_pci",
11973
14
           FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
11974
14
           NULL, HFILL}
11975
14
        },
11976
14
        { &hf_gtpv2_timer_unit,
11977
14
          {"Timer unit", "gtpv2.timer_unit",
11978
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_timer_unit_vals), 0xe0,
11979
14
           NULL, HFILL}
11980
14
        },
11981
14
        { &hf_gtpv2_throttling_delay_unit,
11982
14
          {"Throttling Delay unit", "gtpv2.throttling_delay_unit",
11983
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_throttling_delay_unit_vals), 0xe0,
11984
14
           NULL, HFILL }
11985
14
        },
11986
14
        { &hf_gtpv2_timer_value,
11987
14
          {"Timer value", "gtpv2.timer_value",
11988
14
           FT_UINT8, BASE_DEC, NULL, 0x1f,
11989
14
           NULL, HFILL}
11990
14
        },
11991
14
        { &hf_gtpv2_throttling_delay_value,
11992
14
          {"Throttling Delay value", "gtpv2.throttling_delay_value",
11993
14
           FT_UINT8, BASE_DEC, NULL, 0x1f,
11994
14
           NULL, HFILL }
11995
14
        },
11996
14
        { &hf_gtpv2_lapi,
11997
14
          {"LAPI (Low Access Priority Indication)", "gtpv2.lapi",
11998
14
           FT_BOOLEAN, 8, NULL, 0x01,
11999
14
           NULL, HFILL}
12000
14
        },
12001
14
        { &hf_gtpv2_mm_context_higher_br_16mb_flg_len,
12002
14
          {"Length of Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg_len",
12003
14
           FT_UINT8, BASE_DEC, NULL, 0x0,
12004
14
           NULL, HFILL}
12005
14
        },
12006
14
        { &hf_gtpv2_mm_context_higher_br_16mb_flg,
12007
14
          {"Higher bitrates than 16 Mbps flag", "gtpv2.mm_context_higher_br_16mb_flg",
12008
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_mm_context_higher_br_16mb_flg_vals), 0x0,
12009
14
           NULL, HFILL}
12010
14
        },
12011
14
        { &hf_gtpv2_mmbr_ul,
12012
14
          {"Max MBR/APN-AMBR for uplink", "gtpv2.mmbr_ul",
12013
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
12014
14
           NULL, HFILL}
12015
14
        },
12016
14
        { &hf_gtpv2_mmbr_dl,
12017
14
          {"Max MBR/APN-AMBR for downlink", "gtpv2.mmbr_dl",
12018
14
           FT_UINT32, BASE_DEC, NULL, 0x0,
12019
14
           NULL, HFILL}
12020
14
        },
12021
14
        { &hf_gtpv2_pres_rep_area_act_inapra,
12022
14
          {"INAPRA", "gtpv2.pres_rep_area_action.inapra",
12023
14
           FT_UINT8, BASE_DEC, NULL, 0x08,
12024
14
           NULL, HFILL}
12025
14
        },
12026
14
        { &hf_gtpv2_pres_rep_area_action,
12027
14
          {"Action", "gtpv2.pres_rep_area_action.action",
12028
14
           FT_UINT8, BASE_DEC, VALS(gtpv2_pres_rep_area_action_vals), 0x03,
12029
14
           NULL, HFILL}
12030
14
        },
12031
14
        { &hf_gtpv2_pres_rep_area_id,
12032
14
          {"Presence Reporting Area Identifier", "gtpv2.pres_rep_area_action.pres_rep_area_id",
12033
14
           FT_UINT24, BASE_HEX, NULL, 0x0,
12034
14
           NULL, HFILL}
12035
14
        },
12036
14
        { &hf_gtpv2_pres_rep_area_act_no_tai,
12037
14
          {"Number of TAI", "gtpv2.pres_rep_area_action.no_tai",
12038
14
           FT_UINT8, BASE_DEC, NULL, 0xf0,
12039
14
           NULL, HFILL}
12040
14
        },
12041
14
        { &hf_gtpv2_pres_rep_area_act_no_rai,
12042
14
          {"Number of RAI", "gtpv2.pres_rep_area_action.no_rai",
12043
14
           FT_UINT8, BASE_DEC, NULL, 0x0f,
12044
14
           NULL, HFILL}
12045
14
        },
12046
14
        { &hf_gtpv2_pres_rep_area_act_no_m_enodeb,
12047
14
          {"Number of Macro eNodeB", "gtpv2.pres_rep_area_action.no_m_enodeb",
12048
14
           FT_UINT8, BASE_DEC, NULL, 0x3f,
12049
14
           NULL, HFILL}
12050
14
        },
12051
14
        { &hf_gtpv2_pres_rep_area_act_no_h_enodeb,
12052
14
          {"Number of Home eNodeB", "gtpv2.pres_rep_area_action.no_h_enodeb",
12053
14
           FT_UINT8, BASE_DEC, NULL, 0x3f,
12054
14
           NULL, HFILL}
12055
14
        },
12056
14
        { &hf_gtpv2_pres_rep_area_act_no_ecgi,
12057
14
          {"Number of ECGI", "gtpv2.pres_rep_area_action.no_ecgi",
12058
14
           FT_UINT8, BASE_DEC, NULL, 0x3f,
12059
14
           NULL, HFILL}
12060
14
        },
12061
14
        { &hf_gtpv2_pres_rep_area_act_no_sai,
12062
14
          {"Number of SAI", "gtpv2.pres_rep_area_action.no_sai",
12063
14
           FT_UINT8, BASE_DEC, NULL, 0x3f,
12064
14
           NULL, HFILL}
12065
14
        },
12066
14
        { &hf_gtpv2_pres_rep_area_act_no_cgi,
12067
14
          {"Number of CGI", "gtpv2.pres_rep_area_action.no_cgi",
12068
14
           FT_UINT8, BASE_DEC, NULL, 0x3f,
12069
14
           NULL, HFILL}
12070
14
        },
12071
14
        { &hf_gtpv2_pres_rep_area_act_no_ext_m_enodeb,
12072
14
          {"Number of Extended Macro eNodeB", "gtpv2.pres_rep_area_action.no_ext_m_enodeb",
12073
14
           FT_UINT8, BASE_DEC, NULL, 0x3f,
12074
14
           NULL, HFILL}
12075
14
        },
12076
14
        { &hf_gtpv2_ksi_ps,
12077
14
            { "KSI'ps", "gtpv2.ksi_ps",
12078
14
            FT_UINT8, BASE_HEX, NULL, 0x0f,
12079
14
            NULL, HFILL }
12080
14
        },
12081
14
        { &hf_gtpv2_ck_ps,
12082
14
        { "CK'ps", "gtpv2.ck_ps",
12083
14
            FT_BYTES, BASE_NONE, NULL, 0,
12084
14
            NULL, HFILL }
12085
14
        },
12086
14
        { &hf_gtpv2_ik_ps,
12087
14
        { "IK'ps", "gtpv2.ik_ps",
12088
14
            FT_BYTES, BASE_NONE, NULL, 0,
12089
14
            NULL, HFILL }
12090
14
        },
12091
14
        { &hf_gtpv2_kc_ps,
12092
14
        { "KC'ps", "gtpv2.kc_ps",
12093
14
            FT_BYTES, BASE_NONE, NULL, 0,
12094
14
            NULL, HFILL }
12095
14
        },
12096
14
        { &hf_gtpv2_cksn_ps,
12097
14
        { "CKSN'ps", "gtpv2.cksn_ps",
12098
14
            FT_UINT8, BASE_HEX, NULL, 0x0,
12099
14
            NULL, HFILL }
12100
14
        },
12101
14
        { &hf_gtpv2_pres_rep_area_info_id,
12102
14
          {"Presence Reporting Area Identifier", "gtpv2.pres_rep_area_info_id",
12103
14
            FT_UINT24, BASE_HEX, NULL, 0x0,
12104
14
            NULL, HFILL}
12105
14
        },
12106
14
        { &hf_gtpv2_pres_rep_area_info_additional_id,
12107
14
          {"Additional Presence Reporting Area Identifier", "gtpv2.pres_rep_area_info_additional_id",
12108
14
            FT_UINT24, BASE_HEX, NULL, 0x0,
12109
14
            NULL, HFILL}
12110
14
        },
12111
14
        { &hf_gtpv2_pres_rep_area_info_flags,
12112
14
          {"Flags", "gtpv2.pres_rep_area_info_flags",
12113
14
            FT_UINT8, BASE_HEX, NULL, 0x0,
12114
14
            NULL, HFILL}
12115
14
        },
12116
14
        { &hf_gtpv2_pres_rep_area_info_flags_no_inapra,
12117
14
          {"Flags", "gtpv2.pres_rep_area_info_flags",
12118
14
            FT_UINT8, BASE_HEX, NULL, 0x0,
12119
14
            NULL, HFILL}
12120
14
        },
12121
14
        { &hf_gtpv2_pres_rep_area_info_flags_b0_ipra,
12122
14
          {"Inside Presence Reporting Area(IPRA)", "gtpv2.pres_rep_area_info_flag_ipra",
12123
14
            FT_BOOLEAN, 8, NULL, 0x01,
12124
14
            NULL, HFILL}
12125
14
        },
12126
14
        { &hf_gtpv2_pres_rep_area_info_flags_b1_opra,
12127
14
          {"Outside Presence Reporting Area(OPRA)", "gtpv2.pres_rep_area_info_flag_opra",
12128
14
            FT_BOOLEAN, 8, NULL, 0x02,
12129
14
            NULL, HFILL}
12130
14
        },
12131
14
        { &hf_gtpv2_pres_rep_area_info_flags_b2_apra,
12132
14
          {"Additional Presence Reporting Area(APRA)", "gtpv2.pres_rep_area_info_flag_apra",
12133
14
            FT_BOOLEAN, 8, NULL, 0x04,
12134
14
            NULL, HFILL}
12135
14
        },
12136
14
        { &hf_gtpv2_pres_rep_area_info_flags_b3_inapra,
12137
14
          {"Inactive Presence Reporting Area(INAPRA)", "gtpv2.pres_rep_area_info_flag_inapra",
12138
14
            FT_BOOLEAN, 8, NULL, 0x08,
12139
14
            NULL, HFILL}
12140
14
        },
12141
14
        { &hf_gtpv2_pres_rep_area_info_flags_b3_b7_spare,
12142
14
          {"Spare", "gtpv2.pres_rep_area_info_spare",
12143
14
            FT_UINT8, BASE_HEX, NULL, 0xF8,
12144
14
             NULL, HFILL}
12145
14
        },
12146
14
        { &hf_gtpv2_pres_rep_area_info_flags_b4_b7_spare,
12147
14
          {"Spare", "gtpv2.pres_rep_area_info_spare",
12148
14
            FT_UINT8, BASE_HEX, NULL, 0xF0,
12149
14
             NULL, HFILL}
12150
14
        },
12151
14
        { &hf_gtpv2_ppi_value,
12152
14
            {"Paging and Policy Information Value", "gtpv2.ppi_value",
12153
14
            FT_UINT8, BASE_DEC | BASE_EXT_STRING,
12154
14
            &dscp_vals_ext, GTPV2_PPI_VAL_MASK, NULL, HFILL}
12155
14
        },
12156
14
        { &hf_gtpv2_ppi_flag,
12157
14
            {"Paging Policy Indication", "gtpv2.ppi_flag",
12158
14
            FT_UINT8, BASE_DEC, NULL, 0x0,
12159
14
            NULL, HFILL}
12160
14
        },
12161
14
        { &hf_gtpv2_session,
12162
14
            { "Session", "gtpv2.session",
12163
14
            FT_UINT32, BASE_DEC, NULL, 0,
12164
14
            NULL, HFILL }
12165
14
        },
12166
12167
      /* Generated from convert_proto_tree_add_text.pl */
12168
14
      { &hf_gtpv2_transparent_container, { "Transparent Container", "gtpv2.transparent_container", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12169
14
      { &hf_gtpv2_cksrvcc, { "CKsrvcc", "gtpv2.cksrvcc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12170
14
      { &hf_gtpv2_iksrvcc, { "IKsrvcc", "gtpv2.iksrvcc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12171
14
      { &hf_gtpv2_mobile_station_classmark2, { "Mobile Station Classmark2", "gtpv2.mobile_station_classmark2", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12172
14
      { &hf_gtpv2_mobile_station_classmark3, { "Mobile Station Classmark3", "gtpv2.mobile_station_classmark3", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12173
14
      { &hf_gtpv2_supported_codec_list, { "Supported Codec List", "gtpv2.supported_codec_list", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12174
14
      { &hf_gtpv2_utran_srvcc_ck_cs, { "CK'cs", "gtpv2.utran_srvcc.ck_cs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12175
14
      { &hf_gtpv2_utran_srvcc_ik_cs, { "IK'cs", "gtpv2.utran_srvcc.ik_cs", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12176
14
      { &hf_gtpv2_utran_srvcc_kc, { "Kc'", "gtpv2.utran_srvcc.kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12177
14
      { &hf_gtpv2_teid_c_spare, { "Spare", "gtpv2.teid_c.spare", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12178
14
      { &hf_gtpv2_geographic_location, { "Geographic Location", "gtpv2.geographic_location", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12179
14
      { &hf_gtpv2_tmsi_bytes, { "TMSI", "gtpv2.tmsi_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12180
14
      { &hf_gtpv2_cn_id, { "CN-Id", "gtpv2.cn_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12181
14
      { &hf_gtpv2_eps_bearer_id_number, { "EPS Bearer ID Number", "gtpv2.eps_bearer_id_number", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12182
14
      { &hf_gtpv2_serving_gw_address_length, { "Serving GW Address Length", "gtpv2.serving_gw_address_length", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12183
14
      { &hf_gtpv2_charging_characteristic_remaining_octets, { "Remaining octets", "gtpv2.charging_characteristic.remaining_octets", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12184
14
      { &hf_gtpv2_trace_id, { "Trace ID", "gtpv2.trace_id", FT_UINT24, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12185
14
      { &hf_gtpv2_drx_parameter, { "DRX parameter", "gtpv2.drx_parameter", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12186
14
      { &hf_gtpv2_mm_context_sres, { "SRES'", "gtpv2.mm_context_sres", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12187
14
      { &hf_gtpv2_mm_context_kc, { "Kc'", "gtpv2.mm_context_kc", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12188
14
      { &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 }},
12189
14
      { &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 }},
12190
14
      { &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 }},
12191
14
      { &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 }},
12192
14
      { &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 }},
12193
14
      { &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 } },
12194
14
      { &hf_gtpv2_authentication_quadruplets, { "Authentication Quadruplets", "gtpv2.authentication_quadruplets", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12195
14
      { &hf_gtpv2_authentication_quintuplets, { "Authentication Quintuplets", "gtpv2.authentication_quintuplets", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12196
14
      { &hf_gtpv2_mm_context_nh, { "NH (Next Hop)", "gtpv2.mm_context_nh", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12197
14
      { &hf_gtpv2_mm_context_ncc, { "NCC (Next Hop Chaining Count)", "gtpv2.mm_context_ncc", FT_UINT8, BASE_DEC, NULL, 0x0F, NULL, HFILL }},
12198
14
      { &hf_gtpv2_nsapi08, { "NSAPI", "gtpv2.nsapi", FT_UINT8, BASE_DEC, NULL, 0x08, NULL, HFILL }},
12199
14
      { &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 }},
12200
14
      { &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 }},
12201
14
      { &hf_gtpv2_send_n_pdu_number, { "Send N-PDU Number", "gtpv2.send_n_pdu_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12202
14
      { &hf_gtpv2_receive_n_pdu_number, { "Receive N-PDU Number", "gtpv2.receive_n_pdu_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12203
14
      { &hf_gtpv2_hop_counter, { "Hop Counter", "gtpv2.hop_counter", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12204
14
      { &hf_gtpv2_packet_flow_id, { "Packet Flow ID", "gtpv2.packet_flow_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12205
14
      { &hf_gtpv2_rrc_container, { "RRC Container", "gtpv2.rrc_container", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12206
14
      { &hf_gtpv2_port_number, { "Port Number", "gtpv2.port_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12207
14
      { &hf_gtpv2_proprietary_value, { "Proprietary value", "gtpv2.proprietary_value", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12208
14
      { &hf_gtpv2_spare_bytes, { "Spare", "gtpv2.spare_bytes", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
12209
14
      { &hf_gtpv2_dl_pdcp_sequence_number, { "DL PDCP Sequence Number", "gtpv2.dl_pdcp_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12210
14
      { &hf_gtpv2_ul_pdcp_sequence_number, { "UL PDCP Sequence Number", "gtpv2.ul_pdcp_sequence_number", FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
12211
14
      { &hf_gtpv2_fq_csid_node_id, { "Node-ID", "gtpv2.fq_csid_node_id", FT_UINT32, BASE_DEC, NULL, 0x00000FFF, NULL, HFILL }},
12212
14
      { &hf_gtpv2_fq_csid_mcc_mnc, { "MCC+MNC", "gtpv2.fq_csid_mcc_mnc", FT_UINT32, BASE_DEC, NULL, 0xFFFFF000, NULL, HFILL }},
12213
12214
14
      { &hf_gtpv2_twan_id_ts, { "TWAN Identifier Timestamp", "gtpv2.twan.id_ts", FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0, NULL, HFILL } },
12215
14
      { &hf_gtpv2_twan_flags,{ "Flags", "gtpv2.twan_id.flags", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12216
14
      { &hf_gtpv2_twan_bssidi,{ "BSSIDI", "gtpv2.twan_id.bssidi", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01, NULL, HFILL } },
12217
14
      { &hf_gtpv2_twan_civai,{ "CIVAI", "gtpv2.twan_id.civai", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02, NULL, HFILL } },
12218
14
      { &hf_gtpv2_twan_plmni,{ "PLMNI", "gtpv2.twan_id.plmni", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x04, NULL, HFILL } },
12219
14
      { &hf_gtpv2_twan_opnai,{ "OPNAI", "gtpv2.twan_id.opnai", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x08, NULL, HFILL } },
12220
14
      { &hf_gtpv2_twan_laii,{ "LAII", "gtpv2.twan_id.laii", FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10, NULL, HFILL } },
12221
14
      { &hf_gtpv2_twan_ssid_len,{ "SSID Length", "gtpv2.twan_id.ssid_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12222
14
      { &hf_gtpv2_twan_ssid,{ "SSID", "gtpv2.twan_id.ssid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12223
14
      { &hf_gtpv2_twan_bssid,{ "BSSID", "gtpv2.twan_id.bssid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12224
14
      { &hf_gtpv2_twan_civa_len,{ "Civic Address Length", "gtpv2.twan_id.civa_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12225
14
      { &hf_gtpv2_twan_civa,{ "Civic Address Information", "gtpv2.twan_id.civa", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12226
14
      { &hf_gtpv2_twan_plmnid,{ "TWAN PLMN-ID", "gtpv2.twan_id.plmnid", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12227
14
      { &hf_gtpv2_twan_op_name_len,{ "TWAN Operator Name Length", "gtpv2.twan_id.op_name_len", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12228
14
      { &hf_gtpv2_twan_op_name,{ "TWAN Operator Name", "gtpv2.twan_id.op_name", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12229
14
      { &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 } },
12230
14
      { &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 } },
12231
14
      { &hf_gtpv2_twan_relay_id,{ "Relay Identity", "gtpv2.twan_id.relay_id", FT_STRING, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12232
14
      { &hf_gtpv2_twan_relay_id_ipv4,{ "Relay Identity", "gtpv2.twan_id.relay_id_ipv4", FT_IPv4, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12233
14
      { &hf_gtpv2_twan_relay_id_ipv6,{ "Relay Identity", "gtpv2.twan_id.relay_id_ipv6", FT_IPv6, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12234
14
      { &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 } },
12235
14
      { &hf_gtpv2_twan_circuit_id,{ "Circuit-ID", "gtpv2.twan_id.circuit_id", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL } },
12236
14
      { &hf_gtpv2_integer_number_val,{ "Value", "gtpv2.integer_number_val", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12237
14
      { &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 } },
12238
14
      { &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 } },
12239
14
      { &hf_gtpv2_ue_usage_type,{ "UE Usage Type", "gtpv2.ue_usage_type", FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12240
14
      { &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 } },
12241
14
      { &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} },
12242
14
      { &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} },
12243
14
      { &hf_gtpv2_ran_nas_cause_value, {"RAN/NAS Cause Value", "gtpv2.ran_nas.cause_value", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL} },
12244
14
      { &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} },
12245
14
      { &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} },
12246
14
      { &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} },
12247
14
      { &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} },
12248
14
      { &hf_gtpv2_ciot_support_ind,{ "CIoT Optimizations Support Indication", "gtpv2.ciot_support_ind", FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL } },
12249
14
      { &hf_gtpv2_ciot_support_ind_spare_bits,
12250
14
          { "Spare", "gtpv2.ciot_support_ind.spare_bits",
12251
14
          FT_UINT8, BASE_HEX, NULL, 0xF0,
12252
14
          NULL, HFILL }
12253
14
      },
12254
14
      { &hf_gtpv2_ciot_support_ind_bit4,
12255
14
          { "IHCSI (IP Header Compression Support)", "gtpv2.ciot_support_ind.ihcsi",
12256
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12257
14
          NULL, HFILL }
12258
14
      },
12259
14
      { &hf_gtpv2_ciot_support_ind_bit3,
12260
14
          { "AWOPDN (Attach without PDN Support)", "gtpv2.ciot_support_ind.awopdn",
12261
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12262
14
          NULL, HFILL }
12263
14
      },
12264
14
      { &hf_gtpv2_ciot_support_ind_bit2,
12265
14
          { "SCNIPDN (SCEF Non-IP PDN Support)", "gtpv2.ciot_support_ind.scnipdn",
12266
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12267
14
          NULL, HFILL }
12268
14
      },
12269
14
      { &hf_gtpv2_ciot_support_ind_bit1,
12270
14
          { "SGNIPDN (SGi Non-IP PDN Support)", "gtpv2.ciot_support_ind.sgnipdn",
12271
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12272
14
          NULL, HFILL }
12273
14
      },
12274
14
      { &hf_gtpv2_length_of_node_name,
12275
14
          { "Length of Node Name", "gtpv2.length_of_node_name",
12276
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
12277
14
          NULL, HFILL }
12278
14
      },
12279
14
      { &hf_gtpv2_length_of_node_realm,
12280
14
          { "Length of Node Realm", "gtpv2.length_of_node_realm",
12281
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
12282
14
          NULL, HFILL }
12283
14
      },
12284
14
      { &hf_gtpv2_node_name,
12285
14
          { "Node Name", "gtpv2.node_name",
12286
14
          FT_STRING, BASE_NONE, NULL, 0x0,
12287
14
          NULL, HFILL }
12288
14
      },
12289
14
      { &hf_gtpv2_node_realm,
12290
14
      { "Node Realm", "gtpv2.node_realm",
12291
14
          FT_STRING, BASE_NONE, NULL, 0x0,
12292
14
          NULL, HFILL }
12293
14
      },
12294
14
      { &hf_gtpv2_ms_ts,
12295
14
      { "Millisecond Time Stamp", "gtpv2.ms_ts",
12296
14
          FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
12297
14
          NULL, HFILL }
12298
14
      },
12299
14
      { &hf_gtpv2_origination_ts,
12300
14
      { "Origination Time Stamp", "gtpv2.origination_ts",
12301
14
          FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0x0,
12302
14
          NULL, HFILL }
12303
14
      },
12304
14
      { &hf_gtpv2_mon_event_inf_nsur,
12305
14
      { "NSUR (Notify SCEF when UE becomes Reachable)", "gtpv2.mon_event_inf.nsur",
12306
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x10,
12307
14
          NULL, HFILL }
12308
14
      },
12309
14
      { &hf_gtpv2_mon_event_inf_nsui,
12310
14
      { "NSUI (Notify SCEF when UE becomes Idle)", "gtpv2.mon_event_inf.nsui",
12311
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x20,
12312
14
          NULL, HFILL }
12313
14
      },
12314
14
      { &hf_gtpv2_mon_event_inf_nscf,
12315
14
      { "NSCF (Notify SCEF about Communication Failure events)", "gtpv2.mon_event_inf.nscf",
12316
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
12317
14
          NULL, HFILL }
12318
14
      },
12319
14
      { &hf_gtpv2_mon_event_inf_srie,
12320
14
      { "SRIE (SCEF Reference Id Extension)", "gtpv2.mon_event_ext_inf.srie",
12321
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
12322
14
          NULL, HFILL }
12323
14
      },
12324
14
      { &hf_gtpv2_mon_event_inf_scef_reference_id,
12325
14
          { "SCEF Reference ID", "gtpv2.mon_event_inf.scef_reference_id",
12326
14
          FT_UINT32, BASE_DEC, NULL, 0x0,
12327
14
          NULL, HFILL }
12328
14
      },
12329
14
      { &hf_gtpv2_mon_event_inf_scef_reference_id_ext,
12330
14
          { "SCEF Reference ID Ext", "gtpv2.mon_event_inf.scef_reference_id_ext",
12331
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
12332
14
          NULL, HFILL }
12333
14
      },
12334
14
      { &hf_gtpv2_mon_event_inf_scef_id_length,
12335
14
          { "SCEF ID length", "gtpv2.mon_event_inf.scef_id_length",
12336
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
12337
14
          NULL, HFILL }
12338
14
      },
12339
14
      { &hf_gtpv2_mon_event_inf_scef_id,
12340
14
          { "SCEF ID", "gtpv2.mon_event_inf.scef_id",
12341
14
          FT_STRING, BASE_NONE, NULL, 0x0,
12342
14
          NULL, HFILL }
12343
14
      },
12344
14
      { &hf_gtpv2_mon_event_inf_remaining_number_of_reports,
12345
14
          { "Remaining Number of Reports", "gtpv2.mon_event_inf.remaining_number_of_reports",
12346
14
          FT_UINT16, BASE_DEC, NULL, 0x0,
12347
14
          NULL, HFILL }
12348
14
      },
12349
14
      { &hf_gtpv2_mon_event_ext_inf_lrtp,
12350
14
      { "LRTP (Remaining Minimum Periodic Location Reporting Time Present)", "gtpv2.mon_event_ext_inf.lrtp",
12351
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
12352
14
          NULL, HFILL }
12353
14
      },
12354
14
      { &hf_gtpv2_mon_event_ext_inf_srie,
12355
14
      { "SRIE (SCEF Reference Id Extension)", "gtpv2.mon_event_ext_inf.srie",
12356
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
12357
14
          NULL, HFILL }
12358
14
      },
12359
14
      { &hf_gtpv2_mon_event_ext_inf_scef_reference_id,
12360
14
          { "SCEF Reference ID", "gtpv2.mon_event_ext_inf.scef_reference_id",
12361
14
          FT_UINT32, BASE_DEC, NULL, 0x0,
12362
14
          NULL, HFILL }
12363
14
      },
12364
14
      { &hf_gtpv2_mon_event_ext_inf_scef_id_length,
12365
14
          { "SCEF ID length", "gtpv2.mon_event_ext_inf.scef_id_length",
12366
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
12367
14
          NULL, HFILL }
12368
14
      },
12369
14
      { &hf_gtpv2_mon_event_ext_inf_scef_id,
12370
14
          { "SCEF ID", "gtpv2.mon_event_ext_inf.scef_id",
12371
14
          FT_STRING, BASE_NONE, NULL, 0x0,
12372
14
          NULL, HFILL }
12373
14
      },
12374
14
      { &hf_gtpv2_mon_event_ext_inf_remain_min_period_loc_report_type,
12375
14
          { "Remaining Minimum Periodic Location Reporting Time", "gtpv2.mon_event_ext_inf.remain_min_period_loc_report_type",
12376
14
          FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_seconds), 0x0,
12377
14
          NULL, HFILL }
12378
14
      },
12379
14
      { &hf_gtpv2_mon_event_ext_inf_scef_reference_id_ext,
12380
14
          { "SCEF Reference ID Ext", "gtpv2.mon_event_ext_inf.scef_reference_id_ext",
12381
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
12382
14
          NULL, HFILL }
12383
14
      },
12384
14
      { &hf_gtpv2_rohc_profile_flags,
12385
14
      { "ROHC Profiles flags", "gtpv2.rohc_profile_flags",
12386
14
          FT_UINT8, BASE_HEX, NULL, 0x0,
12387
14
          NULL, HFILL }
12388
14
      },
12389
14
      { &hf_gtpv2_rohc_profiles_bit0,
12390
14
      { "Profile Identifier: 0x0002, UDP/IP", "gtpv2.rohc_profiles.b0",
12391
14
          FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x01,
12392
14
          NULL, HFILL }
12393
14
      },
12394
14
      { &hf_gtpv2_rohc_profiles_bit1,
12395
14
      { "Profile Identifier: 0x0003, ESP/IP", "gtpv2.rohc_profiles.b1",
12396
14
          FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x02,
12397
14
          NULL, HFILL }
12398
14
      },
12399
14
      { &hf_gtpv2_rohc_profiles_bit2,
12400
14
      { "Profile Identifier: 0x0004, IP", "gtpv2.rohc_profiles.b2",
12401
14
          FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x04,
12402
14
          NULL, HFILL }
12403
14
      },
12404
14
      { &hf_gtpv2_rohc_profiles_bit3,
12405
14
      { "Profile Identifier: 0x0006, TCP/IP", "gtpv2.rohc_profiles.b3",
12406
14
          FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x08,
12407
14
          NULL, HFILL }
12408
14
      },
12409
14
      { &hf_gtpv2_rohc_profiles_bit4,
12410
14
      { "Profile Identifier: 0x0102, UDP/IP", "gtpv2.rohc_profiles.b4",
12411
14
          FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x10,
12412
14
          NULL, HFILL }
12413
14
      },
12414
14
      { &hf_gtpv2_rohc_profiles_bit5,
12415
14
      { "Profile Identifier: 0x0103, ESP/IP", "gtpv2.rohc_profiles.b5",
12416
14
          FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x20,
12417
14
          NULL, HFILL }
12418
14
      },
12419
14
      { &hf_gtpv2_rohc_profiles_bit6,
12420
14
      { "Profile Identifier: 0x0104, IP", "gtpv2.rohc_profiles.b6",
12421
14
          FT_BOOLEAN, 8, TFS(&tfs_allowed_not_allowed), 0x40,
12422
14
          NULL, HFILL }
12423
14
      },
12424
14
      { &hf_gtpv2_rohc_profiles_bit7,
12425
14
      { "Spare", "gtpv2.rohc_profiles.b7",
12426
14
          FT_BOOLEAN, 8, NULL, 0x80,
12427
14
          NULL, HFILL }
12428
14
      },
12429
14
      { &hf_gtpv2_max_cid,
12430
14
      { "MAX_CID", "gtpv2.max_cid",
12431
14
          FT_UINT16, BASE_DEC, NULL, 0x0,
12432
14
          NULL, HFILL }
12433
14
      },
12434
14
      { &hf_gtpv2_uplink_rate_limit,
12435
14
      { "Uplink Rate Limit", "gtpv2.uplink_rate_limit",
12436
14
          FT_UINT16, BASE_DEC, NULL, 0x0,
12437
14
          NULL, HFILL }
12438
14
      },
12439
14
      { &hf_gtpv2_downlink_rate_limit,
12440
14
      { "Downlink Rate Limit", "gtpv2.downlink_rate_limit",
12441
14
          FT_UINT16, BASE_DEC, NULL, 0x0,
12442
14
          NULL, HFILL }
12443
14
      },
12444
14
      { &hf_gtpv2_timestamp_value,
12445
14
      { "Timestamp value", "gtpv2.timestamp_value",
12446
14
          FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0x0,
12447
14
          NULL, HFILL }
12448
14
      },
12449
14
      { &hf_gtpv2_counter_value,
12450
14
      { "Counter value", "gtpv2.counter_value",
12451
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
12452
14
          NULL, HFILL }
12453
14
      },
12454
14
      { &hf_gtpv2_mapped_ue_usage_type,
12455
14
      { "Mapped UE usage type", "gtpv2.mapped_ue_usage_type",
12456
14
          FT_UINT16, BASE_DEC, NULL, 0x0,
12457
14
          NULL, HFILL }
12458
14
      },
12459
14
      { &hf_gtpv2_uli_flags,
12460
14
      { "ULI Flags", "gtpv2.uli_flags",
12461
14
          FT_UINT8, BASE_HEX, NULL, 0x0,
12462
14
          NULL, HFILL }
12463
14
      },
12464
14
      { &hf_gtpv2_dcnr,
12465
14
      { "DCNR (Dual connectivity with NR)", "gtpv2.dcnr",
12466
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12467
14
          NULL, HFILL }
12468
14
      },
12469
14
      { &hf_gtpv2_secondary_rat_usage_data_report,
12470
14
          { "Secondary RAT Usage Data Report", "gtpv2.secondary_rat_usage_data_report",
12471
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
12472
14
          NULL, HFILL }
12473
14
      },
12474
14
      { &hf_gtpv2_secondary_rat_usage_data_report_spare_bits,
12475
14
          { "Spare", "gtpv2.secondary_rat_usage_data_report.spare_bits",
12476
14
          FT_UINT8, BASE_HEX, NULL, 0xF8,
12477
14
          NULL, HFILL }
12478
14
      },
12479
14
      { &hf_gtpv2_secondary_rat_usage_data_report_bit3,
12480
14
          { "SRUDN  (Secondary RAT Usage Report from NG-RAN)", "gtpv2.secondary_rat_usage_data_report.srudn",
12481
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12482
14
          NULL, HFILL }
12483
14
      },
12484
14
      { &hf_gtpv2_secondary_rat_usage_data_report_bit2,
12485
14
          { "IRSGW  (Intended Receiver SGW)", "gtpv2.secondary_rat_usage_data_report.irsgw",
12486
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12487
14
          NULL, HFILL }
12488
14
      },
12489
14
      { &hf_gtpv2_secondary_rat_usage_data_report_bit1,
12490
14
          { "IRPGW (Intended Receiver PGW)", "gtpv2.secondary_rat_usage_data_report.irpgw",
12491
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12492
14
          NULL, HFILL }
12493
14
      },
12494
14
      { &hf_gtpv2_secondary_rat_usage_data_report_rat_type,
12495
14
          {"RAT Type", "gtpv2.secondary_rat_usage_data_report.rat_type",
12496
14
          FT_UINT8, BASE_DEC, VALS(gtpv2_secondary_rat_type_vals), 0x0,
12497
14
          NULL, HFILL}
12498
14
      },
12499
14
      { &hf_gtpv2_secondary_rat_usage_data_report_start_timestamp,
12500
14
      { "Start timestamp", "gtpv2.secondary_rat_usage_data_report.start_timestamp",
12501
14
          FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0x0,
12502
14
          NULL, HFILL }
12503
14
      },
12504
14
      { &hf_gtpv2_secondary_rat_usage_data_report_end_timestamp,
12505
14
      { "End timestamp", "gtpv2.secondary_rat_usage_data_report.end_timestamp",
12506
14
          FT_ABSOLUTE_TIME, ABSOLUTE_TIME_NTP_UTC, NULL, 0x0,
12507
14
          NULL, HFILL }
12508
14
      },
12509
14
      { &hf_gtpv2_secondary_rat_usage_data_report_usage_data_dl,
12510
14
      { "Usage Data DL", "gtpv2.secondary_rat_usage_data_report.usage_data_dl",
12511
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
12512
14
          NULL, HFILL }
12513
14
      },
12514
14
      { &hf_gtpv2_secondary_rat_usage_data_report_usage_data_ul,
12515
14
      { "Usage Data UL", "gtpv2.secondary_rat_usage_data_report.usage_data_ul",
12516
14
          FT_UINT64, BASE_DEC, NULL, 0x0,
12517
14
          NULL, HFILL }
12518
14
      },
12519
14
      { &hf_gtpv2_secondary_rat_usage_data_report_srudn_length,
12520
14
          { "SRUDN length", "gtpv2.mon_event_inf.srudn_length",
12521
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
12522
14
          NULL, HFILL }
12523
14
      },
12524
14
      { &hf_gtpv2_secondary_rat_usage_data_report_srudn_value,
12525
14
          { "SecondaryRATDataUsageReportTransfer", "gtpv2.mon_event_inf.srudn_value",
12526
14
          FT_BYTES, BASE_NONE, NULL, 0x0,
12527
14
          NULL, HFILL }
12528
14
      },
12529
14
      { &hf_gtpv2_csg_info_rep_action_b0,
12530
14
      { "UCICSG", "gtpv2.csg_info_rep_action.ucicsg",
12531
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12532
14
          NULL, HFILL }
12533
14
      },
12534
14
      { &hf_gtpv2_csg_info_rep_action_b1,
12535
14
      { "UCISHC", "gtpv2.csg_info_rep_action.ucishc",
12536
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12537
14
          NULL, HFILL }
12538
14
      },
12539
14
      { &hf_gtpv2_csg_info_rep_action_b2,
12540
14
      { "UCIUHC", "gtpv2.csg_info_rep_action.uciuhc",
12541
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12542
14
          NULL, HFILL }
12543
14
      },
12544
14
      { &hf_gtpv2_gnodeb_id_len,
12545
14
          {"gNodeB ID Length", "gtpv2.gnodeb_id_len",
12546
14
          FT_UINT8, BASE_DEC, NULL, 0x3f,
12547
14
          NULL, HFILL}
12548
14
      },
12549
14
      { &hf_gtpv2_gnodeb_id,
12550
14
      { "gNodeB ID", "gtpv2.gnodeb_id",
12551
14
          FT_UINT32, BASE_DEC, NULL, 0x0,
12552
14
          NULL, HFILL }
12553
14
      },
12554
14
      { &hf_gtpv2_macro_ng_enodeb_id,
12555
14
      { "Macro ng-eNodeB ID", "gtpv2.ng_enodeb_id",
12556
14
          FT_UINT24, BASE_DEC, NULL, 0x0fffff,
12557
14
          NULL, HFILL }
12558
14
      },
12559
14
      { &hf_gtpv2_5gs_tac,
12560
14
      { "5GS Tracking Area Code (TAC)", "gtpv2.5gs_tac",
12561
14
          FT_UINT24, BASE_DEC, NULL, 0x0,
12562
14
          NULL, HFILL }
12563
14
      },
12564
14
      { &hf_gtpv2_en_gnb_id_len,
12565
14
          {"en-gNB ID Length", "gtpv2.en_gnb_id_len",
12566
14
          FT_UINT8, BASE_DEC, NULL, 0x3f,
12567
14
          NULL, HFILL}
12568
14
      },
12569
14
      { &hf_gtpv2_5tac,
12570
14
      { "5TAC", "gtpv2.5tac",
12571
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x80,
12572
14
          NULL, HFILL }
12573
14
      },
12574
14
      { &hf_gtpv2_etac,
12575
14
      { "ETAC", "gtpv2.etac",
12576
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x40,
12577
14
          NULL, HFILL }
12578
14
      },
12579
14
      { &hf_gtpv2_en_gnb_id,
12580
14
      { "gNodeB ID", "gtpv2.en_gnb_id",
12581
14
          FT_UINT32, BASE_DEC, NULL,0x0,
12582
14
          NULL, HFILL }
12583
14
      },
12584
14
      { &hf_gtpv2_trig_event_len,
12585
14
      { "Length of Triggering Events", "gtpv2.trig_event_len",
12586
14
          FT_UINT8, BASE_DEC, NULL,0x0,
12587
14
          NULL, HFILL }
12588
14
      },
12589
14
      { &hf_gtpv2_ne_list_len,
12590
14
      { "Length of List of NE Types", "gtpv2.ne_list_len",
12591
14
          FT_UINT8, BASE_DEC, NULL,0x0,
12592
14
          NULL, HFILL }
12593
14
      },
12594
14
      { &hf_gtpv2_ses_trs_depth,
12595
14
      { "Session Trace Depth", "gtpv2.ses_trs_dept",
12596
14
          FT_UINT8, BASE_DEC, NULL,0x0,
12597
14
          NULL, HFILL }
12598
14
      },
12599
14
      { &hf_gtpv2_list_of_if_len,
12600
14
      { "Length of List of Interfaces", "gtpv2.list_of_if_len",
12601
14
          FT_UINT8, BASE_DEC, NULL,0x0,
12602
14
          NULL, HFILL }
12603
14
      },
12604
14
      { &hf_gtpv2_trs_coll_ip_addr_len,
12605
14
      { "Length of IP Address of Trace Collection Entity", "gtpv2.trs_coll_ip_addr_len",
12606
14
          FT_UINT8, BASE_DEC, NULL,0x0,
12607
14
          NULL, HFILL }
12608
14
      },
12609
14
      { &hf_gtpv2_trs_coll_ipv4_addr,
12610
14
        {"IP Address of Trace Collection Entity", "gtpv2.trs_coll_ipv4_addr",
12611
14
         FT_IPv4, BASE_NONE, NULL, 0x0,
12612
14
         NULL, HFILL}
12613
14
      },
12614
14
      { &hf_gtpv2_trs_coll_ipv6_addr,
12615
14
        {"IP Address of Trace Collection Entity", "gtpv2.trs_coll_ipv6_addr",
12616
14
         FT_IPv6, BASE_NONE, NULL, 0x0,
12617
14
         NULL, HFILL}
12618
14
      },
12619
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_cap,
12620
14
      { "CAP", "gtpv2.ext_tra_info_loi.mscs.cap",
12621
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12622
14
          NULL, HFILL }
12623
14
      },
12624
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_map_f,
12625
14
      { "MAP-F", "gtpv2.ext_tra_info_loi.mscs.map_f",
12626
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12627
14
          NULL, HFILL }
12628
14
      },
12629
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_map_e,
12630
14
      { "MAP-E", "gtpv2.ext_tra_info_loi.mscs.map_e",
12631
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12632
14
          NULL, HFILL }
12633
14
      },
12634
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_map_b,
12635
14
      { "MAP-B", "gtpv2.ext_tra_info_loi.mscs.map_b",
12636
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12637
14
          NULL, HFILL }
12638
14
      },
12639
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_map_g,
12640
14
      { "MAP-G", "gtpv2.ext_tra_info_loi.mscs.map_g",
12641
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12642
14
          NULL, HFILL }
12643
14
      },
12644
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_mc,
12645
14
      { "Mc", "gtpv2.ext_tra_info_loi.mscs.mc",
12646
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12647
14
          NULL, HFILL }
12648
14
      },
12649
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_iu,
12650
14
      { "Iu", "gtpv2.ext_tra_info_loi.mscs.iu",
12651
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12652
14
          NULL, HFILL }
12653
14
      },
12654
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_a,
12655
14
      { "A","gtpv2.ext_tra_info_loi.mscs.a",
12656
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12657
14
          NULL, HFILL }
12658
14
      },
12659
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_map_c,
12660
14
      { "MAP-C", "gtpv2.ext_tra_info_loi.mscs.map_c",
12661
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12662
14
          NULL, HFILL }
12663
14
      },
12664
14
      { &hf_gtpv2_ext_tra_info_loi_mscs_map_d,
12665
14
      { "MAP-D", "gtpv2.ext_tra_info_loi.mscs.map_d",
12666
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12667
14
          NULL, HFILL }
12668
14
      },
12669
14
      { &hf_gtpv2_ext_tra_info_loi_mgw_iuup,
12670
14
      { "Iu-UP", "gtpv2.ext_tra_info_loi.mgw.iuup",
12671
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12672
14
          NULL, HFILL }
12673
14
      },
12674
14
      { &hf_gtpv2_ext_tra_info_loi_mgw_nbup,
12675
14
      { "Nb-UP", "gtpv2.ext_tra_info_loi.mgw.nbup",
12676
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12677
14
          NULL, HFILL }
12678
14
      },
12679
14
      { &hf_gtpv2_ext_tra_info_loi_mgw_mc,
12680
14
      { "Mc", "gtpv2.ext_tra_info_loi.mgw.mc",
12681
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12682
14
          NULL, HFILL }
12683
14
      },
12684
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_ge,
12685
14
      { "Ge", "gtpv2.ext_tra_info_loi.sgsn.ge",
12686
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12687
14
          NULL, HFILL }
12688
14
      },
12689
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_gs,
12690
14
      { "Gs", "gtpv2.ext_tra_info_loi.sgsn.gs",
12691
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12692
14
          NULL, HFILL }
12693
14
      },
12694
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_map_gf,
12695
14
      { "MAP-Gf", "gtpv2.ext_tra_info_loi.sgsn.map_gf",
12696
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12697
14
          NULL, HFILL }
12698
14
      },
12699
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_map_gd,
12700
14
      { "MAP-Gd", "gtpv2.ext_tra_info_loi.sgsn.map_gd",
12701
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12702
14
          NULL, HFILL }
12703
14
      },
12704
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_map_gr,
12705
14
      { "MAP-Gr", "gtpv2.ext_tra_info_loi.sgsn.map_gr",
12706
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12707
14
          NULL, HFILL }
12708
14
      },
12709
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_gn,
12710
14
      { "Gn", "gtpv2.ext_tra_info_loi.sgsn.gn",
12711
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12712
14
          NULL, HFILL }
12713
14
      },
12714
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_iu,
12715
14
      { "Iu", "gtpv2.ext_tra_info_loi.sgsn.iu",
12716
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12717
14
          NULL, HFILL }
12718
14
      },
12719
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_gb,
12720
14
      { "Gb", "gtpv2.ext_tra_info_loi.sgsn.gb",
12721
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12722
14
          NULL, HFILL }
12723
14
      },
12724
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_s13,
12725
14
      { "S13", "gtpv2.ext_tra_info_loi.sgsn.s13",
12726
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12727
14
          NULL, HFILL }
12728
14
      },
12729
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_s3,
12730
14
      { "S3", "gtpv2.ext_tra_info_loi.sgsn.s3",
12731
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12732
14
          NULL, HFILL }
12733
14
      },
12734
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_s4,
12735
14
      { "S4", "gtpv2.ext_tra_info_loi.sgsn.s4",
12736
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12737
14
          NULL, HFILL }
12738
14
      },
12739
14
      { &hf_gtpv2_ext_tra_info_loi_sgsn_s6d,
12740
14
      { "S6d", "gtpv2.ext_tra_info_loi.sgsn.s6d",
12741
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12742
14
          NULL, HFILL }
12743
14
      },
12744
14
      { &hf_gtpv2_ext_tra_info_loi_ggsn_gmb,
12745
14
      { "Gmb", "gtpv2.ext_tra_info_loi.ggsn.gmb",
12746
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12747
14
          NULL, HFILL }
12748
14
      },
12749
14
      { &hf_gtpv2_ext_tra_info_loi_ggsn_gi,
12750
14
      { "Gi", "gtpv2.ext_tra_info_loi.ggsn.gi",
12751
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12752
14
          NULL, HFILL }
12753
14
      },
12754
14
      { &hf_gtpv2_ext_tra_info_loi_ggsn_gn,
12755
14
      { "Gn", "gtpv2.ext_tra_info_loi.ggsn.gn",
12756
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12757
14
          NULL, HFILL }
12758
14
      },
12759
14
      { &hf_gtpv2_ext_tra_info_loi_rnc_uu,
12760
14
      { "Uu", "gtpv2.ext_tra_info_loi.rrc.uu",
12761
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12762
14
          NULL, HFILL }
12763
14
      },
12764
14
      { &hf_gtpv2_ext_tra_info_loi_rnc_iub,
12765
14
      { "Iub", "gtpv2.ext_tra_info_loi.rrc.iub",
12766
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12767
14
          NULL, HFILL }
12768
14
      },
12769
14
      { &hf_gtpv2_ext_tra_info_loi_rnc_iur,
12770
14
      { "Iur", "gtpv2.ext_tra_info_loi.rrc.iur",
12771
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12772
14
          NULL, HFILL }
12773
14
      },
12774
14
      { &hf_gtpv2_ext_tra_info_loi_rnc_iu,
12775
14
      { "Iu", "gtpv2.ext_tra_info_loi.rrc.iu",
12776
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12777
14
          NULL, HFILL }
12778
14
      },
12779
14
      { &hf_gtpv2_ext_tra_info_loi_bm_sc_gmb,
12780
14
      { "Gmb", "gtpv2.ext_tra_info_loi.bm_sc.gmb",
12781
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12782
14
          NULL, HFILL }
12783
14
      },
12784
14
      { &hf_gtpv2_ext_tra_info_loi_mme_s13,
12785
14
      { "S13", "gtpv2.ext_tra_info_loi.mme.s13",
12786
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12787
14
          NULL, HFILL }
12788
14
      },
12789
14
      { &hf_gtpv2_ext_tra_info_loi_mme_s11,
12790
14
      { "S11", "gtpv2.ext_tra_info_loi.mme.s11",
12791
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12792
14
          NULL, HFILL }
12793
14
      },
12794
14
      { &hf_gtpv2_ext_tra_info_loi_mme_s10,
12795
14
      { "S10", "gtpv2.ext_tra_info_loi.mme.s10",
12796
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12797
14
          NULL, HFILL }
12798
14
      },
12799
14
      { &hf_gtpv2_ext_tra_info_loi_mme_s6a,
12800
14
      { "S6a", "gtpv2.ext_tra_info_loi.mme.s6a",
12801
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12802
14
          NULL, HFILL }
12803
14
      },
12804
14
      { &hf_gtpv2_ext_tra_info_loi_mme_s3,
12805
14
      { "S3", "gtpv2.ext_tra_info_loi.mme.s3",
12806
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12807
14
          NULL, HFILL }
12808
14
      },
12809
14
      { &hf_gtpv2_ext_tra_info_loi_mme_s1_mme,
12810
14
      { "S1-mme", "gtpv2.ext_tra_info_loi.mme.s1_mme",
12811
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12812
14
          NULL, HFILL }
12813
14
      },
12814
14
      { &hf_gtpv2_ext_tra_info_loi_sgw_gxc,
12815
14
      { "Gxc", "gtpv2.ext_tra_info_loi.sgw.gxc",
12816
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12817
14
          NULL, HFILL }
12818
14
      },
12819
14
      { &hf_gtpv2_ext_tra_info_loi_sgw_s11,
12820
14
      { "S11", "gtpv2.ext_tra_info_loi.sgw.s11",
12821
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12822
14
          NULL, HFILL }
12823
14
      },
12824
14
      { &hf_gtpv2_ext_tra_info_loi_sgw_s8b,
12825
14
      { "S8b", "gtpv2.ext_tra_info_loi.sgw.s8b",
12826
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12827
14
          NULL, HFILL }
12828
14
      },
12829
14
      { &hf_gtpv2_ext_tra_info_loi_sgw_s5,
12830
14
      { "S5", "gtpv2.ext_tra_info_loi.sgw.s5",
12831
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12832
14
          NULL, HFILL }
12833
14
      },
12834
14
      { &hf_gtpv2_ext_tra_info_loi_sgw_s4,
12835
14
      { "S4", "gtpv2.ext_tra_info_loi.sgw.s4",
12836
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12837
14
          NULL, HFILL }
12838
14
      },
12839
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_sgi,
12840
14
      { "Sgi", "gtpv2.ext_tra_info_loi.pdn_gw.sgi",
12841
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12842
14
          NULL, HFILL }
12843
14
      },
12844
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s8b,
12845
14
      { "S8b", "gtpv2.ext_tra_info_loi.pdn_gw.s8b",
12846
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12847
14
          NULL, HFILL }
12848
14
      },
12849
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_gx,
12850
14
      { "Gx", "gtpv2.ext_tra_info_loi.pdn_gw.gx",
12851
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12852
14
          NULL, HFILL }
12853
14
      },
12854
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s6b,
12855
14
      { "S6b", "gtpv2.ext_tra_info_loi.pdn_gw.s6b",
12856
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12857
14
          NULL, HFILL }
12858
14
      },
12859
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s5,
12860
14
      { "S5", "gtpv2.ext_tra_info_loi.pdn_gw.s5",
12861
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12862
14
          NULL, HFILL }
12863
14
      },
12864
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2c,
12865
14
      { "S2c", "gtpv2.ext_tra_info_loi.pdn_gw.s2c",
12866
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12867
14
          NULL, HFILL }
12868
14
      },
12869
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2b,
12870
14
      { "S2b", "gtpv2.ext_tra_info_loi.pdn_gw.s2b",
12871
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12872
14
          NULL, HFILL }
12873
14
      },
12874
14
      { &hf_gtpv2_ext_tra_info_loi_pdn_gw_s2a,
12875
14
      { "S2a", "gtpv2.ext_tra_info_loi.pdn_gw.s2a",
12876
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12877
14
          NULL, HFILL }
12878
14
      },
12879
14
      { &hf_gtpv2_ext_tra_info_loi_enb_uu,
12880
14
      { "Uu", "gtpv2.ext_tra_info_loi.enb.uu",
12881
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12882
14
          NULL, HFILL }
12883
14
      },
12884
14
      { &hf_gtpv2_ext_tra_info_loi_enb_x2,
12885
14
      { "X2", "gtpv2.ext_tra_info_loi.enb.x2",
12886
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12887
14
          NULL, HFILL }
12888
14
      },
12889
14
      { &hf_gtpv2_ext_tra_info_loi_enb_s1_mme,
12890
14
      { "S1-MME", "gtpv2.ext_tra_info_loi.enb.s1_mme",
12891
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12892
14
          NULL, HFILL }
12893
14
      },
12894
14
      { &hf_gtpv2_ext_tra_info_loi_hss_sh,
12895
14
      { "Sh", "gtpv2.ext_tra_info_loi.hss.Sh",
12896
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12897
14
          NULL, HFILL }
12898
14
      },
12899
14
      { &hf_gtpv2_ext_tra_info_loi_hss_s6a,
12900
14
      { "S6a", "gtpv2.ext_tra_info_loi.hss.S6a",
12901
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12902
14
          NULL, HFILL }
12903
14
      },
12904
14
      { &hf_gtpv2_ext_tra_info_loi_hss_s6d,
12905
14
      { "S6d", "gtpv2.ext_tra_info_loi.hss.S6d",
12906
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12907
14
          NULL, HFILL }
12908
14
      },
12909
14
      { &hf_gtpv2_ext_tra_info_loi_hss_cx,
12910
14
      { "Cx", "gtpv2.ext_tra_info_loi.hss.cx",
12911
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12912
14
          NULL, HFILL }
12913
14
      },
12914
14
      { &hf_gtpv2_ext_tra_info_loi_hss_map_gr,
12915
14
      { "MAP-Gr", "gtpv2.ext_tra_info_loi.hss.map_gr",
12916
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12917
14
          NULL, HFILL }
12918
14
      },
12919
14
      { &hf_gtpv2_ext_tra_info_loi_hss_map_gc,
12920
14
      { "MAP-Gc", "gtpv2.ext_tra_info_loi.hss.map_gc",
12921
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12922
14
          NULL, HFILL }
12923
14
      },
12924
14
      { &hf_gtpv2_ext_tra_info_loi_hss_map_d,
12925
14
      { "MAP-D", "gtpv2.ext_tra_info_loi.hss.map_d",
12926
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12927
14
          NULL, HFILL }
12928
14
      },
12929
14
      { &hf_gtpv2_ext_tra_info_loi_hss_map_c,
12930
14
      { "MAP-C", "gtpv2.ext_tra_info_loi.hss.map_c",
12931
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12932
14
          NULL, HFILL }
12933
14
      },
12934
14
      { &hf_gtpv2_ext_tra_info_loi_eir_map_gf,
12935
14
      { "MAP-Gf", "gtpv2.ext_tra_info_loi.eir.map_gf",
12936
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12937
14
          NULL, HFILL }
12938
14
      },
12939
14
      { &hf_gtpv2_ext_tra_info_loi_eir_s13p,
12940
14
      { "S13'", "gtpv2.ext_tra_info_loi.eir.s13p",
12941
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12942
14
          NULL, HFILL }
12943
14
      },
12944
14
      { &hf_gtpv2_ext_tra_info_loi_eir_s13,
12945
14
      { "S13", "gtpv2.ext_tra_info_loi.eir.s13",
12946
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12947
14
          NULL, HFILL }
12948
14
      },
12949
14
      { &hf_gtpv2_ext_tra_info_loi_eir_map_f,
12950
14
      { "MAP-F", "gtpv2.ext_tra_info_loi.eir.map_f",
12951
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12952
14
          NULL, HFILL }
12953
14
      },
12954
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n20,
12955
14
      { "N20", "gtpv2.ext_tra_info_loi.amf.n20",
12956
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80,
12957
14
          NULL, HFILL }
12958
14
      },
12959
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n15,
12960
14
      { "N15", "gtpv2.ext_tra_info_loi.amf.n15",
12961
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40,
12962
14
          NULL, HFILL }
12963
14
      },
12964
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n14,
12965
14
      { "N14", "gtpv2.ext_tra_info_loi.amf.n14",
12966
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20,
12967
14
          NULL, HFILL }
12968
14
      },
12969
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n12,
12970
14
      { "N12", "gtpv2.ext_tra_info_loi.amf.n12",
12971
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
12972
14
          NULL, HFILL }
12973
14
      },
12974
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n11,
12975
14
      { "N11", "gtpv2.ext_tra_info_loi.amf.n11",
12976
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
12977
14
          NULL, HFILL }
12978
14
      },
12979
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n8,
12980
14
      { "N8", "gtpv2.ext_tra_info_loi.amf.n8",
12981
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
12982
14
          NULL, HFILL }
12983
14
      },
12984
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n2,
12985
14
      { "N2", "gtpv2.ext_tra_info_loi.amf.n2",
12986
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12987
14
          NULL, HFILL }
12988
14
      },
12989
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n1,
12990
14
      { "N1", "gtpv2.ext_tra_info_loi.amf.n1",
12991
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
12992
14
          NULL, HFILL }
12993
14
      },
12994
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n22,
12995
14
      { "N22", "gtpv2.ext_tra_info_loi.amf.n22",
12996
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
12997
14
          NULL, HFILL }
12998
14
      },
12999
14
      { &hf_gtpv2_ext_tra_info_loi_amf_n26,
13000
14
      { "N26", "gtpv2.ext_tra_info_loi.amf.n26",
13001
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
13002
14
          NULL, HFILL }
13003
14
      },
13004
14
      { &hf_gtpv2_ext_tra_info_loi_pcf_n15,
13005
14
      { "N15", "gtpv2.ext_tra_info_loi.pcf.n15",
13006
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
13007
14
          NULL, HFILL }
13008
14
      },
13009
14
      { &hf_gtpv2_ext_tra_info_loi_pcf_n7,
13010
14
      { "N7", "gtpv2.ext_tra_info_loi.pcf.n7",
13011
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
13012
14
          NULL, HFILL }
13013
14
      },
13014
14
      { &hf_gtpv2_ext_tra_info_loi_pcf_n5,
13015
14
      { "N5", "gtpv2.ext_tra_info_loi.pcf.n5",
13016
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
13017
14
          NULL, HFILL }
13018
14
      },
13019
14
      { &hf_gtpv2_ext_tra_info_loi_smf_s5_c,
13020
14
      { "S5-C", "gtpv2.ext_tra_info_loi.smf.s5_c",
13021
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
13022
14
          NULL, HFILL }
13023
14
      },
13024
14
      { &hf_gtpv2_ext_tra_info_loi_smf_n11,
13025
14
      { "N11", "gtpv2.ext_tra_info_loi.smf.n11",
13026
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
13027
14
          NULL, HFILL }
13028
14
      },
13029
14
      { &hf_gtpv2_ext_tra_info_loi_smf_n10,
13030
14
      { "N10", "gtpv2.ext_tra_info_loi.smf.n10",
13031
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
13032
14
          NULL, HFILL }
13033
14
      },
13034
14
      { &hf_gtpv2_ext_tra_info_loi_smf_n7,
13035
14
      { "N7", "gtpv2.ext_tra_info_loi.smf.n7",
13036
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
13037
14
          NULL, HFILL }
13038
14
      },
13039
14
      { &hf_gtpv2_ext_tra_info_loi_smf_n4,
13040
14
      { "N4", "gtpv2.ext_tra_info_loi.smf.n4",
13041
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
13042
14
          NULL, HFILL }
13043
14
      },
13044
14
      { &hf_gtpv2_ext_tra_info_loi_upf_n4,
13045
14
      { "N4", "gtpv2.ext_tra_info_loi.upf.n4",
13046
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01,
13047
14
          NULL, HFILL }
13048
14
      },
13049
14
      { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_e1_c,
13050
14
      { "E1-C", "gtpv2.ext_tra_info_loi.ng_ran_node.e1_c",
13051
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10,
13052
14
          NULL, HFILL }
13053
14
      },
13054
14
      { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_f1_c,
13055
14
      { "F1-C", "gtpv2.ext_tra_info_loi.ng_ran_node.f1_c",
13056
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08,
13057
14
          NULL, HFILL }
13058
14
      },
13059
14
      { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_Uu,
13060
14
      { "Uu", "gtpv2.ext_tra_info_loi.ng_ran_node.uu",
13061
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04,
13062
14
          NULL, HFILL }
13063
14
      },
13064
14
      { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_xn_c,
13065
14
      { "Xn-C", "gtpv2.ext_tra_info_loi.ng_ran_node.xn_c",
13066
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
13067
14
          NULL, HFILL }
13068
14
      },
13069
14
      { &hf_gtpv2_ext_tra_info_loi_ng_ran_node_ng_c,
13070
14
      { "NG-C", "gtpv2.ext_tra_info_loi.ng_ran_node.ng_c",
13071
14
          FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02,
13072
14
          NULL, HFILL }
13073
14
      },
13074
14
      { &hf_gtpv2_nr_add_exception_rpts,
13075
14
      { "Number of additional exception reports", "gtpv2.r_add_exception_rpts",
13076
14
          FT_UINT32, BASE_DEC, NULL,0x0,
13077
14
          NULL, HFILL }
13078
14
      },
13079
14
      { &hf_gtpv2_nr_ul_pkts_all,
13080
14
      { "Number of Uplink packets allowed", "gtpv2.nr_ul_pkts_all",
13081
14
          FT_UINT32, BASE_DEC, NULL,0x0,
13082
14
          NULL, HFILL }
13083
14
      },
13084
14
      { &hf_gtpv2_nr_dl_pkts_all,
13085
14
      { "Number of Downlink packets allowed", "gtpv2.nr_dl_pkts_all",
13086
14
          FT_UINT32, BASE_DEC, NULL,0x0,
13087
14
          NULL, HFILL }
13088
14
      },
13089
14
      { &hf_apn_rte_cntrl_status_val_time,
13090
14
      { "APN Rate Control Status validity Time", "gtpv2.pn_rte_cntrl_status_val_time",
13091
14
          FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, NULL,0x0,
13092
14
          NULL, HFILL }
13093
14
      },
13094
14
      { &hf_gtpv2_max_pkt_loss_rte_ul_flg,
13095
14
      { "UL", "gtpv2.max_pkt_loss_rte_ul_flg",
13096
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
13097
14
          NULL, HFILL }
13098
14
      },
13099
14
      { &hf_gtpv2_max_pkt_loss_rte_dl_flg,
13100
14
      { "DL", "gtpv2.max_pkt_loss_rte_dl_flg",
13101
14
          FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x02,
13102
14
          NULL, HFILL }
13103
14
      },
13104
14
      { &hf_gtpv2_max_pkt_loss_rte_ul,
13105
14
      { "Maximum Packet Loss Rate UL", "gtpv2.max_pkt_loss_rte_ul",
13106
14
          FT_UINT16, BASE_CUSTOM, CF_FUNC(value_in_tenth_of_percent_fmt), 0x0,
13107
14
          NULL, HFILL }
13108
14
      },
13109
14
      { &hf_gtpv2_max_pkt_loss_rte_dl,
13110
14
      { "Maximum Packet Loss Rate DL", "gtpv2.max_pkt_loss_rte_dl",
13111
14
          FT_UINT16, BASE_CUSTOM, CF_FUNC(value_in_tenth_of_percent_fmt), 0x0,
13112
14
          NULL, HFILL }
13113
14
      },
13114
14
      { &hf_gtpv2_mm_context_iov_updates_counter,
13115
14
      { "IOV_updates counter", "gtpv2.mm_context.iov_updates_counter",
13116
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
13117
14
          NULL, HFILL }
13118
14
      },
13119
14
      { &hf_gtpv2_mm_context_ear_len,
13120
14
      { "Length of Extended Access Restriction Data", "gtpv2.mm_context.ear_len",
13121
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
13122
14
          NULL, HFILL }
13123
14
      },
13124
14
      { &hf_gtpv2_node_number_len,
13125
14
      { "Length", "gtpv2.node_number.len",
13126
14
          FT_UINT8, BASE_DEC, NULL, 0x0,
13127
14
          NULL, HFILL }
13128
14
      },
13129
14
      { &hf_gtpv2_additional_rrm_policy_index,
13130
14
      { "Additional RRM Policy Index", "gtpv2.additional_rrm_policy_index",
13131
14
          FT_UINT32, BASE_DEC, NULL, 0x0,
13132
14
          NULL, HFILL }
13133
14
      },
13134
14
      { &hf_gtpv2_group_id,
13135
14
      { "Group ID", "gtpv2.group_id",
13136
14
          FT_STRING, BASE_NONE, NULL, 0x0,
13137
14
          NULL, HFILL }
13138
14
      },
13139
14
      { &hf_gtpv2_ie_up_security_policy_up_ip_policy,
13140
14
          { "UP IP Policy", "gtpv2.ie_up_security_policy.up_ip_policy",
13141
14
          FT_UINT8, BASE_DEC, VALS(gtpv2_up_ip_policy_vals), 0x3,
13142
14
          NULL, HFILL }
13143
14
      },
13144
14
      { &hf_gtpv2_ie_pscell_id_spare,
13145
14
          { "Spare", "gtpv2.pscell_id.spare",
13146
14
          FT_UINT40, BASE_DEC, NULL, 0xF000000000,
13147
14
          NULL, HFILL }
13148
14
      },
13149
14
      { &hf_gtpv2_ie_pscell_id_nr_cgi,
13150
14
          { "NR CGI", "gtpv2.pscell_id.nr_cgi",
13151
14
          FT_UINT40, BASE_HEX, NULL, 0x0FFFFFFFFF,
13152
14
          NULL, HFILL }
13153
14
      },
13154
14
      { &hf_gtpv2_ie_up_security_policy_spare,
13155
14
          { "Spare", "gtpv2.up_security_policy.spare",
13156
14
          FT_UINT8, BASE_DEC, NULL, 0xFC,
13157
14
          NULL, HFILL }
13158
14
      },
13159
14
      { &hf_gtpv2_nf_instance_id_nf_instance_id,
13160
14
      { "NF Instance ID", "gtpv2.nf_instance_id_nf_instance_id",
13161
14
          FT_GUID, BASE_NONE, NULL, 0x0,
13162
14
          NULL, HFILL}
13163
14
      },
13164
14
      { &hf_gtpv2_nf_timer_in_seconds_timer_value,
13165
14
      { "Timer in Seconds", "gtpv2.timer_in_seconds_timer_value",
13166
14
          FT_UINT32, BASE_DEC, NULL, 0x0,
13167
14
          NULL, HFILL}
13168
14
      },
13169
14
    };
13170
13171
    /* Setup protocol subtree array */
13172
14
#define GTPV2_NUM_INDIVIDUAL_ELEMS    85
13173
14
    static int *ett_gtpv2_array[GTPV2_NUM_INDIVIDUAL_ELEMS + NUM_GTPV2_IES];
13174
13175
14
    ett_gtpv2_array[0] = &ett_gtpv2;
13176
14
    ett_gtpv2_array[1] = &ett_gtpv2_flags;
13177
14
    ett_gtpv2_array[2] = &ett_gtpv2_uli_flags;
13178
14
    ett_gtpv2_array[3] = &ett_gtpv2_uli_field;
13179
14
    ett_gtpv2_array[4] = &ett_gtpv2_bearer_ctx;
13180
14
    ett_gtpv2_array[5] = &ett_gtpv2_PDN_conn;
13181
14
    ett_gtpv2_array[6] = &ett_gtpv2_overload_control_information;
13182
14
    ett_gtpv2_array[7] = &ett_gtpv2_mm_context_flag;
13183
14
    ett_gtpv2_array[8] = &ett_gtpv2_pdn_numbers_nsapi;
13184
14
    ett_gtpv2_array[9] = &ett_gtpv2_tra_info_trigg;
13185
14
    ett_gtpv2_array[10] = &ett_gtpv2_tra_info_trigg_msc_server;
13186
14
    ett_gtpv2_array[11] = &ett_gtpv2_tra_info_trigg_mgw;
13187
14
    ett_gtpv2_array[12] = &ett_gtpv2_tra_info_trigg_sgsn;
13188
14
    ett_gtpv2_array[13] = &ett_gtpv2_tra_info_trigg_ggsn;
13189
14
    ett_gtpv2_array[14] = &ett_gtpv2_tra_info_trigg_bm_sc;
13190
14
    ett_gtpv2_array[15] = &ett_gtpv2_tra_info_trigg_sgw_mme;
13191
14
    ett_gtpv2_array[16] = &ett_gtpv2_tra_info_trigg_sgw;
13192
14
    ett_gtpv2_array[17] = &ett_gtpv2_tra_info_trigg_pgw;
13193
14
    ett_gtpv2_array[18] = &ett_gtpv2_tra_info_interfaces;
13194
14
    ett_gtpv2_array[19] = &ett_gtpv2_tra_info_interfaces_imsc_server;
13195
14
    ett_gtpv2_array[20] = &ett_gtpv2_tra_info_interfaces_lmgw;
13196
14
    ett_gtpv2_array[21] = &ett_gtpv2_tra_info_interfaces_lsgsn;
13197
14
    ett_gtpv2_array[22] = &ett_gtpv2_tra_info_interfaces_lggsn;
13198
14
    ett_gtpv2_array[23] = &ett_gtpv2_tra_info_interfaces_lrnc;
13199
14
    ett_gtpv2_array[24] = &ett_gtpv2_tra_info_interfaces_lbm_sc;
13200
14
    ett_gtpv2_array[25] = &ett_gtpv2_tra_info_interfaces_lmme;
13201
14
    ett_gtpv2_array[26] = &ett_gtpv2_tra_info_interfaces_lsgw;
13202
14
    ett_gtpv2_array[27] = &ett_gtpv2_tra_info_interfaces_lpdn_gw;
13203
14
    ett_gtpv2_array[28] = &ett_gtpv2_tra_info_interfaces_lpdn_lenb;
13204
14
    ett_gtpv2_array[29] = &ett_gtpv2_tra_info_ne_types;
13205
14
    ett_gtpv2_array[30] = &ett_gtpv2_rai;
13206
14
    ett_gtpv2_array[31] = &ett_gtpv2_stn_sr;
13207
14
    ett_gtpv2_array[32] = &ett_gtpv2_ms_mark;
13208
14
    ett_gtpv2_array[33] = &ett_gtpv2_supp_codec_list;
13209
14
    ett_gtpv2_array[34] = &ett_gtpv2_bss_con;
13210
14
    ett_gtpv2_array[35] = &ett_gtpv2_utran_con;
13211
14
    ett_gtpv2_array[36] = &ett_gtpv2_eutran_con;
13212
14
    ett_gtpv2_array[37] = &ett_gtpv2_son_con;
13213
14
    ett_gtpv2_array[38] = &ett_gtpv2_endc_son_con;
13214
14
    ett_gtpv2_array[39] = &ett_gtpv2_intersys_son_con;
13215
14
    ett_gtpv2_array[40] = &ett_gtpv2_mm_context_auth_qua;
13216
14
    ett_gtpv2_array[41] = &ett_gtpv2_mm_context_auth_qui;
13217
14
    ett_gtpv2_array[42] = &ett_gtpv2_mm_context_auth_tri;
13218
14
    ett_gtpv2_array[43] = &ett_gtpv2_mm_context_net_cap;
13219
14
    ett_gtpv2_array[44] = &ett_gtpv2_ms_network_capability;
13220
14
    ett_gtpv2_array[45] = &ett_gtpv2_mm_context_sc;
13221
14
    ett_gtpv2_array[46] = &ett_gtpv2_vd_pref;
13222
14
    ett_gtpv2_array[47] = &ett_gtpv2_access_rest_data;
13223
14
    ett_gtpv2_array[48] = &ett_gtpv2_qua;
13224
14
    ett_gtpv2_array[49] = &ett_gtpv2_qui;
13225
14
    ett_gtpv2_array[50] = &ett_gtpv2_preaa_tais;
13226
14
    ett_gtpv2_array[51] = &ett_gtpv2_preaa_menbs;
13227
14
    ett_gtpv2_array[52] = &ett_gtpv2_preaa_henbs;
13228
14
    ett_gtpv2_array[53] = &ett_gtpv2_preaa_ecgis;
13229
14
    ett_gtpv2_array[54] = &ett_gtpv2_preaa_rais;
13230
14
    ett_gtpv2_array[55] = &ett_gtpv2_preaa_sais;
13231
14
    ett_gtpv2_array[56] = &ett_gtpv2_preaa_cgis;
13232
14
    ett_gtpv2_array[57] = &ett_gtpv2_load_control_inf;
13233
14
    ett_gtpv2_array[58] = &ett_gtpv2_eci;
13234
14
    ett_gtpv2_array[59] = &ett_gtpv2_twan_flags;
13235
14
    ett_gtpv2_array[60] = &ett_gtpv2_ciot_support_ind;
13236
14
    ett_gtpv2_array[61] = &ett_gtpv2_rohc_profile_flags;
13237
14
    ett_gtpv2_array[62] = &ett_gtpv2_secondary_rat_usage_data_report;
13238
14
    ett_gtpv2_array[63] = &ett_gtpv2_pres_rep_area_info;
13239
14
    ett_gtpv2_array[64] = &ett_gtpv2_preaa_ext_menbs;
13240
14
    ett_gtpv2_array[65] = &ett_gtpv2_ue_nr_sec_cap_len;
13241
14
    ett_gtpv2_array[66] = &ett_gtpv2_apn_rte_ctrl_sts_len;
13242
14
    ett_gtpv2_array[67] = &ett_gtpv2_if_mgcs;
13243
14
    ett_gtpv2_array[68] = &ett_gtpv2_if_mgw;
13244
14
    ett_gtpv2_array[69] = &ett_gtpv2_if_sgsn;
13245
14
    ett_gtpv2_array[70] = &ett_gtpv2_if_ggsn;
13246
14
    ett_gtpv2_array[71] = &ett_gtpv2_if_rnc;
13247
14
    ett_gtpv2_array[72] = &ett_gtpv2_if_bm_sc;
13248
14
    ett_gtpv2_array[73] = &ett_gtpv2_if_mme;
13249
14
    ett_gtpv2_array[74] = &ett_gtpv2_if_sgw;
13250
14
    ett_gtpv2_array[75] = &ett_gtpv2_if_pdn_gw;
13251
14
    ett_gtpv2_array[76] = &ett_gtpv2_if_enb;
13252
14
    ett_gtpv2_array[77] = &ett_gtpv2_if_hss;
13253
14
    ett_gtpv2_array[78] = &ett_gtpv2_if_eir;
13254
14
    ett_gtpv2_array[79] = &ett_gtpv2_if_amf;
13255
14
    ett_gtpv2_array[80] = &ett_gtpv2_if_pcf;
13256
14
    ett_gtpv2_array[81] = &ett_gtpv2_if_smf;
13257
14
    ett_gtpv2_array[82] = &ett_gtpv2_if_upf;
13258
14
    ett_gtpv2_array[83] = &ett_gtpv2_if_ng_ran_node;
13259
14
    ett_gtpv2_array[84] = &ett_gtpv2_PGW_change_info;
13260
14
    last_offset = GTPV2_NUM_INDIVIDUAL_ELEMS;
13261
13262
3.59k
    for (i=0; i < NUM_GTPV2_IES; i++, last_offset++)
13263
3.58k
    {
13264
3.58k
        ett_gtpv2_array[last_offset] = &ett_gtpv2_ies[i];
13265
3.58k
    }
13266
13267
14
    static ei_register_info ei[] = {
13268
14
        { &ei_gtpv2_ie_data_not_dissected, { "gtpv2.ie_data_not_dissected", PI_UNDECODED, PI_NOTE, "IE data not dissected yet", EXPFILL }},
13269
14
        { &ei_gtpv2_ie_len_invalid, { "gtpv2.ie_len_invalid", PI_PROTOCOL, PI_ERROR, "Wrong length", EXPFILL }},
13270
14
        { &ei_gtpv2_source_type_unknown, { "gtpv2.source_type.unknown",  PI_PROTOCOL, PI_ERROR, "Unknown source type", EXPFILL }},
13271
14
        { &ei_gtpv2_fq_csid_type_bad, { "gtpv2.fq_csid_type.unknown", PI_PROTOCOL, PI_ERROR, "Wrong Node-ID Type", EXPFILL }},
13272
14
        { &ei_gtpv2_mbms_session_duration_days, { "gtpv2.mbms_session_duration_days.invalid", PI_PROTOCOL, PI_WARN, "Days out of allowed range", EXPFILL }},
13273
14
        { &ei_gtpv2_mbms_session_duration_secs, { "gtpv2.mbms_session_duration_secs.unknown", PI_PROTOCOL, PI_WARN, "Seconds out of allowed range", EXPFILL }},
13274
14
        { &ei_gtpv2_ie, { "gtpv2.ie_type.reserved", PI_PROTOCOL, PI_WARN, "IE type Zero is Reserved and should not be used", EXPFILL }},
13275
14
        { &ei_gtpv2_int_size_not_handled, { "gtpv2.ie_type.int_size_not_handled", PI_PROTOCOL, PI_WARN, "Integer size not handled yet", EXPFILL } },
13276
14
        { &ei_gtpv2_apn_too_long, { "gtpv2.apn_too_long", PI_PROTOCOL, PI_WARN, "APN encoding has more than 100 octets", EXPFILL } },
13277
14
    };
13278
13279
14
    expert_module_t* expert_gtpv2;
13280
14
    module_t *gtpv2_module;
13281
13282
14
    static const enum_val_t decode_srvcc_ps_to_cs_trans_cont_vals[] = {
13283
14
        {"no", "Don't decode", PREF_DECODE_SRVCC_P2C_TRANS_CONT_NO},
13284
14
        {"utran", "Assume UTRAN target", PREF_DECODE_SRVCC_P2C_TRANS_CONT_TARGET_UTRAN},
13285
14
        {NULL, NULL, -1}
13286
14
    };
13287
13288
14
    proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
13289
13290
14
    gtpv2_module = prefs_register_protocol(proto_gtpv2, NULL);
13291
14
    prefs_register_enum_preference(gtpv2_module, "decode_srvcc_p2c_trans_cont_target",
13292
14
        "Decode SRVCC PS-to-CS Transparent Containers",
13293
14
        "Use this setting to decode the Transparent Containers in the SRVCC PS-to-CS messages.\n"
13294
14
        "This is needed until there's a reliable way to determine the contents of the transparent containers.",
13295
14
        &pref_decode_srvcc_p2c_trans_cont, decode_srvcc_ps_to_cs_trans_cont_vals, false);
13296
13297
14
    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);
13298
13299
14
    proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
13300
14
    proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
13301
14
    expert_gtpv2 = expert_register_protocol(proto_gtpv2);
13302
14
    expert_register_field_array(expert_gtpv2, ei, array_length(ei));
13303
13304
14
    register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
13305
    /* Dissector table for private extensions */
13306
14
    gtpv2_priv_ext_dissector_table = register_dissector_table("gtpv2.priv_ext", "GTPv2 Private Extension", proto_gtpv2, FT_UINT16, BASE_DEC);
13307
13308
14
    gtpv2_tap = register_tap("gtpv2");
13309
13310
14
    register_srt_table(proto_gtpv2, NULL, 1, gtpv2_stat_packet, gtpv2_stat_init, NULL);
13311
14
}
13312
13313
void
13314
proto_reg_handoff_gtpv2(void)
13315
14
{
13316
    //static bool               Initialized = false;
13317
13318
14
    nas_eps_handle = find_dissector_add_dependency("nas-eps", proto_gtpv2);
13319
13320
14
    radius_register_avp_dissector(VENDOR_THE3GPP, 22, dissect_radius_user_loc);
13321
13322
    /* AVP Code: 22 3GPP-User-Location-Info */
13323
14
    dissector_add_uint("diameter.3gpp", 22, create_dissector_handle(dissect_diameter_3gpp_uli, proto_gtpv2));
13324
13325
    /* AVP Code: 2820 Presence-Reporting-Area-Elements-List */
13326
14
    dissector_add_uint("diameter.3gpp", 2820, create_dissector_handle(dissect_diameter_3gpp_presence_reporting_area_elements_list, proto_gtpv2));
13327
13328
14
}
13329
13330
/*
13331
 * Editor modelines
13332
 *
13333
 * Local Variables:
13334
 * c-basic-offset: 4
13335
 * tab-width: 8
13336
 * indent-tabs-mode: nil
13337
 * End:
13338
 *
13339
 * ex: set shiftwidth=4 tabstop=8 expandtab:
13340
 * :indentSize=4:tabSize=8:noTabs=true:
13341
 */