FIXUP: WIP: verification_trailer
[wireshark-wip.git] / epan / dissectors / packet-gtp.c
blob23a31e553f78d1f4ff012b85209b2fe4022eae61
1 /* packet-gtp.c
3 * $Id$
5 * Routines for GTP dissection
6 * Copyright 2001, Michal Melerowicz <michal.melerowicz@nokia.com>
7 * Nicolas Balkota <balkota@mac.com>
9 * Updates and corrections:
10 * Copyright 2006 - 2009, Anders Broman <anders.broman@ericsson.com>
12 * Added Bearer control mode dissection:
13 * Copyright 2011, Grzegorz Szczytowski <grzegorz.szczytowski@gmail.com>
15 * Updates and corrections:
16 * Copyright 2011-2013, Anders Broman <anders.broman@ericsson.com>
18 * PDCP PDU number extension header support added by Martin Isaksson <martin.isaksson@ericsson.com>
20 * Control Plane Request-Response tracking code Largely based on similar routines in
21 * packet-ldap.c by Ronnie Sahlberg
22 * Added by Kari Tiirikainen <kari.tiirikainen@nsn.com>
24 * Wireshark - Network traffic analyzer
25 * By Gerald Combs <gerald@wireshark.org>
26 * Copyright 1998 Gerald Combs
28 * This program is free software; you can redistribute it and/or
29 * modify it under the terms of the GNU General Public License
30 * as published by the Free Software Foundation; either version 2
31 * of the License, or (at your option) any later version.
33 * This program is distributed in the hope that it will be useful,
34 * but WITHOUT ANY WARRANTY; without even the implied warranty of
35 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
36 * GNU General Public License for more details.
38 * You should have received a copy of the GNU General Public License
39 * along with this program; if not, write to the Free Software
40 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
42 * GTP v0: 3GPP TS 09.60
44 * http://www.3gpp.org/ftp/Specs/html-info/0960.htm
46 * GTP v1: 3GPP TS 29.060
48 * http://www.3gpp.org/ftp/Specs/html-info/29060.htm
50 * GTP': 3GPP TS 32.295
52 * http://www.3gpp.org/ftp/Specs/html-info/32295.htm
55 #include "config.h"
57 #include <epan/conversation.h>
58 #include <epan/packet.h>
59 #include <epan/wmem/wmem.h>
60 #include <epan/prefs.h>
61 #include <epan/expert.h>
62 #include <epan/sminmpec.h>
63 #include <epan/asn1.h>
64 #include <epan/tap.h>
65 #include "packet-ppp.h"
66 #include "packet-radius.h"
67 #include "packet-bssap.h"
68 #include "packet-gsm_a_common.h"
69 #include "packet-gsm_map.h"
70 #include "packet-gprscdr.h"
71 #include "packet-per.h"
72 #include "packet-ranap.h"
73 #include "packet-bssgp.h"
74 #include "packet-e212.h"
75 #include "packet-gtp.h"
77 static dissector_table_t ppp_subdissector_table;
78 static dissector_table_t gtp_priv_ext_dissector_table;
79 static dissector_table_t gtp_cdr_fmt_dissector_table;
81 #define GTPv0_PORT 3386
82 #define GTPv1C_PORT 2123 /* 3G Control PDU */
83 #define GTPv1U_PORT 2152 /* 3G T-PDU */
85 #define GTPv0_HDR_LENGTH 20
86 #define GTPv1_HDR_LENGTH 12
87 #define GTP_PRIME_HDR_LENGTH 6
89 /* to check compliance with ETSI */
90 #define GTP_MANDATORY 1
91 #define GTP_OPTIONAL 2
92 #define GTP_CONDITIONAL 4
94 #define GTP_TPDU_AS_NONE -1
95 #define GTP_TPDU_AS_TPDU 0
96 #define GTP_TPDU_AS_SYNC 2
98 static gboolean g_gtp_over_tcp = TRUE;
100 static guint g_gtpv0_port = GTPv0_PORT;
101 static guint g_gtpv1c_port = GTPv1C_PORT;
102 static guint g_gtpv1u_port = GTPv1U_PORT;
104 void proto_reg_handoff_gtp(void);
106 static int proto_gtp = -1;
108 /*KTi*/
109 static int hf_gtp_ie_id = -1;
110 static int hf_gtp_response_in = -1;
111 static int hf_gtp_response_to = -1;
112 static int hf_gtp_time = -1;
113 static int hf_gtp_apn = -1;
114 static int hf_gtp_cause = -1;
115 static int hf_gtp_chrg_char = -1;
116 static int hf_gtp_chrg_char_s = -1;
117 static int hf_gtp_chrg_char_n = -1;
118 static int hf_gtp_chrg_char_p = -1;
119 static int hf_gtp_chrg_char_f = -1;
120 static int hf_gtp_chrg_char_h = -1;
121 static int hf_gtp_chrg_char_r = -1;
122 static int hf_gtp_chrg_id = -1;
123 static int hf_gtp_chrg_ipv4 = -1;
124 static int hf_gtp_chrg_ipv6 = -1;
125 static int hf_gtp_ext_flow_label = -1;
126 static int hf_gtp_ext_id = -1;
127 static int hf_gtp_ext_val = -1;
128 static int hf_gtp_ext_hdr = -1;
129 static int hf_gtp_ext_hdr_next = -1;
130 static int hf_gtp_ext_hdr_length = -1;
131 static int hf_gtp_ext_hdr_pdcpsn = -1;
132 static int hf_gtp_ext_hdr_udp_port = -1;
133 static int hf_gtp_flags = -1;
134 static int hf_gtp_flags_ver = -1;
135 static int hf_gtp_prime_flags_ver = -1;
136 static int hf_gtp_flags_pt = -1;
137 static int hf_gtp_flags_spare1 = -1;
138 static int hf_gtp_flags_hdr_length = -1;
139 static int hf_gtp_flags_snn = -1;
140 static int hf_gtp_flags_spare2 = -1;
141 static int hf_gtp_flags_e = -1;
142 static int hf_gtp_flags_s = -1;
143 static int hf_gtp_flags_pn = -1;
144 static int hf_gtp_flow_ii = -1;
145 static int hf_gtp_flow_label = -1;
146 static int hf_gtp_flow_sig = -1;
147 static int hf_gtp_gsn_addr_len = -1;
148 static int hf_gtp_gsn_addr_type = -1;
149 static int hf_gtp_gsn_ipv4 = -1;
150 static int hf_gtp_gsn_ipv6 = -1;
151 static int hf_gtp_imsi = -1;
152 static int hf_gtp_length = -1;
153 static int hf_gtp_map_cause = -1;
154 static int hf_gtp_message_type = -1;
155 static int hf_gtp_ms_reason = -1;
156 static int hf_gtp_ms_valid = -1;
157 static int hf_gtp_npdu_number = -1;
158 static int hf_gtp_node_ipv4 = -1;
159 static int hf_gtp_node_ipv6 = -1;
160 static int hf_gtp_nsapi = -1;
161 static int hf_gtp_ptmsi = -1;
162 static int hf_gtp_ptmsi_sig = -1;
163 static int hf_gtp_qos_version = -1;
164 static int hf_gtp_qos_spare1 = -1;
165 static int hf_gtp_qos_delay = -1;
166 static int hf_gtp_qos_mean = -1;
167 static int hf_gtp_qos_peak = -1;
168 static int hf_gtp_qos_spare2 = -1;
169 static int hf_gtp_qos_precedence = -1;
170 static int hf_gtp_qos_spare3 = -1;
171 static int hf_gtp_qos_reliability = -1;
172 static int hf_gtp_qos_al_ret_priority = -1;
173 static int hf_gtp_qos_traf_class = -1;
174 static int hf_gtp_qos_del_order = -1;
175 static int hf_gtp_qos_del_err_sdu = -1;
176 static int hf_gtp_qos_max_sdu_size = -1;
177 static int hf_gtp_qos_max_ul = -1;
178 static int hf_gtp_qos_max_dl = -1;
179 static int hf_gtp_qos_res_ber = -1;
180 static int hf_gtp_qos_sdu_err_ratio = -1;
181 static int hf_gtp_qos_trans_delay = -1;
182 static int hf_gtp_qos_traf_handl_prio = -1;
183 static int hf_gtp_qos_guar_ul = -1;
184 static int hf_gtp_qos_guar_dl = -1;
185 static int hf_gtp_qos_src_stat_desc = -1;
186 static int hf_gtp_qos_sig_ind = -1;
187 static int hf_gtp_qos_arp_pvi = -1;
188 static int hf_gtp_qos_arp_pl = -1;
189 static int hf_gtp_qos_arp_pci = -1;
190 static int hf_gtp_qos_qci = -1;
191 static int hf_gtp_qos_ul_mbr = -1;
192 static int hf_gtp_qos_dl_mbr = -1;
193 static int hf_gtp_qos_ul_gbr = -1;
194 static int hf_gtp_qos_dl_gbr = -1;
195 static int hf_gtp_qos_ul_apn_ambr = -1;
196 static int hf_gtp_qos_dl_apn_ambr = -1;
197 static int hf_gtp_pkt_flow_id = -1;
198 static int hf_gtp_rab_gtpu_dn = -1;
199 static int hf_gtp_rab_gtpu_up = -1;
200 static int hf_gtp_rab_pdu_dn = -1;
201 static int hf_gtp_rab_pdu_up = -1;
202 static int hf_gtp_rai_rac = -1;
203 static int hf_gtp_rai_lac = -1;
204 static int hf_gtp_tac = -1;
205 static int hf_gtp_eci = -1;
206 static int hf_gtp_ranap_cause = -1;
207 static int hf_gtp_recovery = -1;
208 static int hf_gtp_reorder = -1;
209 static int hf_gtp_rnc_ipv4 = -1;
210 static int hf_gtp_rnc_ipv6 = -1;
211 static int hf_gtp_rp = -1;
212 static int hf_gtp_rp_nsapi = -1;
213 static int hf_gtp_rp_sms = -1;
214 static int hf_gtp_rp_spare = -1;
215 static int hf_gtp_sel_mode = -1;
216 static int hf_gtp_seq_number = -1;
217 static int hf_gtp_sndcp_number = -1;
218 static int hf_gtp_tear_ind = -1;
219 static int hf_gtp_teid = -1;
220 static int hf_gtp_teid_cp = -1;
221 static int hf_gtp_ulink_teid_cp = -1;
222 static int hf_gtp_teid_data = -1;
223 static int hf_gtp_ulink_teid_data = -1;
224 static int hf_gtp_teid_ii = -1;
225 static int hf_gtp_tft_code = -1;
226 static int hf_gtp_tft_spare = -1;
227 static int hf_gtp_tft_number = -1;
228 static int hf_gtp_tft_eval = -1;
229 static int hf_gtp_tid = -1;
230 static int hf_gtp_tlli = -1;
231 static int hf_gtp_tr_comm = -1;
232 static int hf_gtp_trace_ref = -1;
233 static int hf_gtp_trace_type = -1;
234 static int hf_gtp_user_addr_pdp_org = -1;
235 static int hf_gtp_user_addr_pdp_type = -1;
236 static int hf_gtp_user_ipv4 = -1;
237 static int hf_gtp_user_ipv6 = -1;
238 static int hf_gtp_security_mode = -1;
239 static int hf_gtp_no_of_vectors = -1;
240 static int hf_gtp_cipher_algorithm = -1;
241 static int hf_gtp_cksn_ksi = -1;
242 static int hf_gtp_cksn = -1;
243 static int hf_gtp_ksi = -1;
244 static int hf_gtp_ext_length = -1;
245 static int hf_gtp_utran_field = -1;
246 static int hf_gtp_ext_apn_res = -1;
247 static int hf_gtp_ext_rat_type = -1;
248 static int hf_gtp_ext_geo_loc_type = -1;
249 static int hf_gtp_ext_sac = -1;
250 static int hf_gtp_ext_imeisv = -1;
251 static int hf_gtp_target_rnc_id = -1;
252 static int hf_gtp_target_ext_rnc_id = -1;
253 static int hf_gtp_bssgp_cause = -1;
254 static int hf_gtp_bssgp_ra_discriminator = -1;
255 static int hf_gtp_sapi = -1;
256 static int hf_gtp_xid_par_len = -1;
257 static int hf_gtp_earp_pvi = -1;
258 static int hf_gtp_earp_pl = -1;
259 static int hf_gtp_earp_pci = -1;
260 static int hf_gtp_cdr_app = -1;
261 static int hf_gtp_cdr_rel = -1;
262 static int hf_gtp_cdr_ver = -1;
263 static int hf_gtp_cmn_flg_ppc = -1;
264 static int hf_gtp_cmn_flg_mbs_srv_type = -1;
265 static int hf_gtp_cmn_flg_mbs_ran_pcd_rdy = -1;
266 static int hf_gtp_cmn_flg_mbs_cnt_inf = -1;
267 static int hf_gtp_cmn_flg_nrsn = -1;
268 static int hf_gtp_cmn_flg_no_qos_neg = -1;
269 static int hf_gtp_cmn_flg_upgrd_qos_sup = -1;
270 static int hf_gtp_cmn_flg_dual_addr_bearer_flg = -1;
271 static int hf_gtp_tmgi = -1;
272 static int hf_gtp_mbms_ses_dur_days = -1;
273 static int hf_gtp_mbms_ses_dur_s = -1;
274 static int hf_gtp_no_of_mbms_sa_codes = -1;
275 static int hf_gtp_mbms_sa_code = -1;
276 static int hf_gtp_mbs_2g_3g_ind = -1;
277 static int hf_gtp_time_2_dta_tr = -1;
278 static int hf_gtp_ext_ei = -1;
279 static int hf_gtp_ext_gcsi = -1;
280 static int hf_gtp_ext_dti = -1;
281 static int hf_gtp_ra_prio_lcs = -1;
282 static int hf_gtp_bcm = -1;
283 static int hf_gtp_fqdn = -1;
284 static int hf_gtp_rim_routing_addr = -1;
285 static int hf_gtp_mbms_flow_id = -1;
286 static int hf_gtp_mbms_dist_indic = -1;
287 static int hf_gtp_ext_apn_ambr_ul = -1;
288 static int hf_gtp_ext_apn_ambr_dl = -1;
289 static int hf_gtp_ext_sub_ue_ambr_ul = -1;
290 static int hf_gtp_ext_sub_ue_ambr_dl = -1;
291 static int hf_gtp_ext_auth_ue_ambr_ul = -1;
292 static int hf_gtp_ext_auth_ue_ambr_dl = -1;
293 static int hf_gtp_ext_auth_apn_ambr_ul = -1;
294 static int hf_gtp_ext_auth_apn_ambr_dl = -1;
295 static int hf_gtp_ext_ggsn_back_off_time_units = -1;
296 static int hf_gtp_ext_ggsn_back_off_timer = -1;
297 static int hf_gtp_higher_br_16mb_flg = -1;
298 static int hf_gtp_max_mbr_apn_ambr_ul = -1;
299 static int hf_gtp_max_mbr_apn_ambr_dl = -1;
301 /* Initialize the subtree pointers */
302 static gint ett_gtp = -1;
303 static gint ett_gtp_flags = -1;
304 static gint ett_gtp_ext = -1;
305 static gint ett_gtp_ext_hdr = -1;
306 static gint ett_gtp_qos = -1;
307 static gint ett_gtp_qos_arp = -1;
308 static gint ett_gtp_flow_ii = -1;
309 static gint ett_gtp_rp = -1;
310 static gint ett_gtp_pkt_flow_id = -1;
311 static gint ett_gtp_trip = -1;
312 static gint ett_gtp_quint = -1;
313 static gint ett_gtp_proto = -1;
314 static gint ett_gtp_gsn_addr = -1;
315 static gint ett_gtp_tft = -1;
316 static gint ett_gtp_tft_pf = -1;
317 static gint ett_gtp_tft_flags = -1;
318 static gint ett_gtp_rab_setup = -1;
319 static gint ett_gtp_hdr_list = -1;
320 static gint ett_gtp_node_addr = -1;
321 static gint ett_gtp_rel_pack = -1;
322 static gint ett_gtp_can_pack = -1;
323 static gint ett_gtp_data_resp = -1;
324 static gint ett_gtp_drx = -1;
325 static gint ett_gtp_net_cap = -1;
326 static gint ett_gtp_tmgi = -1;
327 static gint ett_gtp_cdr_ver = -1;
328 static gint ett_gtp_cdr_dr = -1;
329 static gint ett_gtp_uli_rai = -1;
331 static expert_field ei_gtp_ext_hdr_pdcpsn = EI_INIT;
332 static expert_field ei_gtp_ext_length_mal = EI_INIT;
333 static expert_field ei_gtp_ext_length_warn = EI_INIT;
335 static gboolean g_gtp_etsi_order = FALSE;
337 static gint dissect_tpdu_as = GTP_TPDU_AS_TPDU;
338 static const enum_val_t gtp_decode_tpdu_as[] = {
339 {"none", "None", GTP_TPDU_AS_NONE},
340 {"tpdu", "TPDU", GTP_TPDU_AS_TPDU},
341 {"sync", "SYNC", GTP_TPDU_AS_SYNC},
342 {NULL, NULL, 0}
346 static int gtp_tap = -1;
347 static int gtpv1_tap = -1;
349 /* Definition of flags masks */
350 #define GTP_VER_MASK 0xE0
352 static const true_false_string gtp_hdr_length_vals = {
353 "6-Octet Header",
354 "20-Octet Header"
357 static const value_string ver_types[] = {
358 {0, "GTP release 97/98 version"},
359 {1, "GTP release 99 version"},
360 {2, "GTPv2-C"},
361 {3, "None"},
362 {4, "None"},
363 {5, "None"},
364 {6, "None"},
365 {7, "None"},
366 {0, NULL}
369 static const value_string pt_types[] = {
370 {0, "GTP'"},
371 {1, "GTP"},
372 {0, NULL}
375 #define GTP_PT_MASK 0x10
376 #define GTP_SPARE1_MASK 0x0E
377 #define GTP_SPARE2_MASK 0x08
378 #define GTP_E_MASK 0x04
379 #define GTP_S_MASK 0x02
380 #define GTP_SNN_MASK 0x01
381 #define GTP_PN_MASK 0x01
383 #define GTP_EXT_HDR_NO_MORE_EXT_HDRS 0x00
384 #define GTP_EXT_HDR_MBMS_SUPPORT_IND 0x01
385 #define GTP_EXT_HDR_MS_INFO_CHG_REP_SUPP_IND 0x02
386 #define GTP_EXT_HDR_UDP_PORT 0x40
387 #define GTP_EXT_HDR_PDCP_SN 0xC0
388 #define GTP_EXT_HDR_SUSPEND_REQ 0xC1
389 #define GTP_EXT_HDR_SUSPEND_RESP 0xC2
391 static const value_string next_extension_header_fieldvals[] = {
392 {GTP_EXT_HDR_NO_MORE_EXT_HDRS, "No more extension headers"},
393 {GTP_EXT_HDR_MBMS_SUPPORT_IND, "MBMS support indication"},
394 {GTP_EXT_HDR_MS_INFO_CHG_REP_SUPP_IND, "MS Info Change Reporting support indication"},
395 {GTP_EXT_HDR_UDP_PORT, "UDP Port number"},
396 {GTP_EXT_HDR_PDCP_SN, "PDCP PDU number"},
397 {GTP_EXT_HDR_SUSPEND_REQ, "Suspend Request"},
398 {GTP_EXT_HDR_SUSPEND_RESP, "Suspend Response"},
399 {0, NULL}
402 /* Definition of 3G charging characteristics masks */
403 #define GTP_MASK_CHRG_CHAR_S 0xF000
404 #define GTP_MASK_CHRG_CHAR_N 0x0800
405 #define GTP_MASK_CHRG_CHAR_P 0x0400
406 #define GTP_MASK_CHRG_CHAR_F 0x0200
407 #define GTP_MASK_CHRG_CHAR_H 0x0100
408 #define GTP_MASK_CHRG_CHAR_R 0x00FF
410 /* Traffic Flow Templates mask */
411 #define GTPv1_TFT_CODE_MASK 0xE0
412 #define GTPv1_TFT_SPARE_MASK 0x10
413 #define GTPv1_TFT_NUMBER_MASK 0x0F
415 /* Definition of GSN Address masks */
416 #define GTP_EXT_GSN_ADDR_TYPE_MASK 0xC0
417 #define GTP_EXT_GSN_ADDR_LEN_MASK 0x3F
419 /* Definition of QoS masks */
420 #define GTP_EXT_QOS_SPARE1_MASK 0xC0
421 #define GTP_EXT_QOS_DELAY_MASK 0x38
422 #define GTP_EXT_QOS_RELIABILITY_MASK 0x07
423 #define GTP_EXT_QOS_PEAK_MASK 0xF0
424 #define GTP_EXT_QOS_SPARE2_MASK 0x08
425 #define GTP_EXT_QOS_PRECEDENCE_MASK 0x07
426 #define GTP_EXT_QOS_SPARE3_MASK 0xE0
427 #define GTP_EXT_QOS_MEAN_MASK 0x1F
428 #define GTP_EXT_QOS_TRAF_CLASS_MASK 0xE0
429 #define GTP_EXT_QOS_DEL_ORDER_MASK 0x18
430 #define GTP_EXT_QOS_DEL_ERR_SDU_MASK 0x07
431 #define GTP_EXT_QOS_RES_BER_MASK 0xF0
432 #define GTP_EXT_QOS_SDU_ERR_RATIO_MASK 0x0F
433 #define GTP_EXT_QOS_TRANS_DELAY_MASK 0xFC
434 #define GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK 0x03
435 #define GTP_EXT_QOS_SRC_STAT_DESC_MASK 0x0F
436 #define GTP_EXT_QOS_SIG_IND_MASK 0x10
438 /* Definition of Radio Priority's masks */
439 #define GTPv1_EXT_RP_NSAPI_MASK 0xF0
440 #define GTPv1_EXT_RP_SPARE_MASK 0x08
441 #define GTPv1_EXT_RP_MASK 0x07
443 static const value_string gtp_message_type[] = {
444 {GTP_MSG_UNKNOWN, "For future use"},
445 {GTP_MSG_ECHO_REQ, "Echo request"},
446 {GTP_MSG_ECHO_RESP, "Echo response"},
447 {GTP_MSG_VER_NOT_SUPP, "Version not supported"},
448 {GTP_MSG_NODE_ALIVE_REQ, "Node alive request"},
449 {GTP_MSG_NODE_ALIVE_RESP, "Node alive response"},
450 {GTP_MSG_REDIR_REQ, "Redirection request"},
451 {GTP_MSG_REDIR_RESP, "Redirection response"},
453 * 8-15 For future use. Shall not be sent. If received,
454 * shall be treated as an Unknown message.
456 #if 0
457 { 8, "Unknown message(For future use)"},
458 { 9, "Unknown message(For future use)"},
459 { 10, "Unknown message(For future use)"},
460 { 11, "Unknown message(For future use)"},
461 { 12, "Unknown message(For future use)"},
462 { 13, "Unknown message(For future use)"},
463 { 14, "Unknown message(For future use)"},
464 { 15, "Unknown message(For future use)"},
465 #endif
466 {GTP_MSG_CREATE_PDP_REQ, "Create PDP context request"},
467 {GTP_MSG_CREATE_PDP_RESP, "Create PDP context response"},
468 {GTP_MSG_UPDATE_PDP_REQ, "Update PDP context request"},
469 {GTP_MSG_UPDATE_PDP_RESP, "Update PDP context response"},
470 {GTP_MSG_DELETE_PDP_REQ, "Delete PDP context request"},
471 {GTP_MSG_DELETE_PDP_RESP, "Delete PDP context response"},
472 {GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ, "Initiate PDP Context Activation Request"},
473 {GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP, "Initiate PDP Context Activation Response"},
475 * 24-25 For future use. Shall not be sent. If received,
476 * shall be treated as an Unknown message.
478 {GTP_MSG_DELETE_AA_PDP_REQ, "Delete AA PDP Context Request"},
479 {GTP_MSG_DELETE_AA_PDP_RESP, "Delete AA PDP Context Response"},
480 {GTP_MSG_ERR_IND, "Error indication"},
481 {GTP_MSG_PDU_NOTIFY_REQ, "PDU notification request"},
482 {GTP_MSG_PDU_NOTIFY_RESP, "PDU notification response"},
483 {GTP_MSG_PDU_NOTIFY_REJ_REQ, "PDU notification reject request"},
484 {GTP_MSG_PDU_NOTIFY_REJ_RESP, "PDU notification reject response"},
485 {GTP_MSG_SUPP_EXT_HDR, "Supported extension header notification"},
486 {GTP_MSG_SEND_ROUT_INFO_REQ, "Send routing information for GPRS request"},
487 {GTP_MSG_SEND_ROUT_INFO_RESP, "Send routing information for GPRS response"},
488 {GTP_MSG_FAIL_REP_REQ, "Failure report request"},
489 {GTP_MSG_FAIL_REP_RESP, "Failure report response"},
490 {GTP_MSG_MS_PRESENT_REQ, "Note MS GPRS present request"},
491 {GTP_MSG_MS_PRESENT_RESP, "Note MS GPRS present response"},
492 /* 38-47 For future use. Shall not be sent. If received,
493 * shall be treated as an Unknown message.
495 #if 0
496 { 38, "Unknown message(For future use)"},
497 { 39, "Unknown message(For future use)"},
498 { 40, "Unknown message(For future use)"},
499 { 41, "Unknown message(For future use)"},
500 { 42, "Unknown message(For future use)"},
501 { 43, "Unknown message(For future use)"},
502 { 44, "Unknown message(For future use)"},
503 { 45, "Unknown message(For future use)"},
504 { 46, "Unknown message(For future use)"},
505 { 47, "Unknown message(For future use)"},
506 #endif
507 {GTP_MSG_IDENT_REQ, "Identification request"},
508 {GTP_MSG_IDENT_RESP, "Identification response"},
509 {GTP_MSG_SGSN_CNTXT_REQ, "SGSN context request"},
510 {GTP_MSG_SGSN_CNTXT_RESP, "SGSN context response"},
511 {GTP_MSG_SGSN_CNTXT_ACK, "SGSN context acknowledgement"},
512 {GTP_MSG_FORW_RELOC_REQ, "Forward relocation request"},
513 {GTP_MSG_FORW_RELOC_RESP, "Forward relocation response"},
514 {GTP_MSG_FORW_RELOC_COMP, "Forward relocation complete"},
515 {GTP_MSG_RELOC_CANCEL_REQ, "Relocation cancel request"},
516 {GTP_MSG_RELOC_CANCEL_RESP, "Relocation cancel response"},
517 {GTP_MSG_FORW_SRNS_CNTXT, "Forward SRNS context"},
518 {GTP_MSG_FORW_RELOC_ACK, "Forward relocation complete acknowledge"},
519 {GTP_MSG_FORW_SRNS_CNTXT_ACK, "Forward SRNS context acknowledge"},
520 /* 61-69 For future use. Shall not be sent. If received,
521 * shall be treated as an Unknown message.
523 #if 0
524 { 61, "Unknown message(For future use)"},
525 { 62, "Unknown message(For future use)"},
526 { 63, "Unknown message(For future use)"},
527 { 64, "Unknown message(For future use)"},
528 { 65, "Unknown message(For future use)"},
529 { 66, "Unknown message(For future use)"},
530 { 67, "Unknown message(For future use)"},
531 { 68, "Unknown message(For future use)"},
532 { 69, "Unknown message(For future use)"},
533 #endif
534 {GTP_MSG_RAN_INFO_RELAY, "RAN Information Relay"},
535 /* 71-95 For future use. Shall not be sent. If received,
536 * shall be treated as an Unknown message.
538 #if 0
539 { 71, "Unknown message(For future use)"},
540 { 72, "Unknown message(For future use)"},
541 { 73, "Unknown message(For future use)"},
542 { 74, "Unknown message(For future use)"},
543 { 75, "Unknown message(For future use)"},
544 { 76, "Unknown message(For future use)"},
545 { 77, "Unknown message(For future use)"},
546 { 78, "Unknown message(For future use)"},
547 { 79, "Unknown message(For future use)"},
548 { 80, "Unknown message(For future use)"},
549 { 81, "Unknown message(For future use)"},
550 { 82, "Unknown message(For future use)"},
551 { 83, "Unknown message(For future use)"},
552 { 84, "Unknown message(For future use)"},
553 { 85, "Unknown message(For future use)"},
554 { 86, "Unknown message(For future use)"},
555 { 87, "Unknown message(For future use)"},
556 { 88, "Unknown message(For future use)"},
557 { 89, "Unknown message(For future use)"},
558 { 90, "Unknown message(For future use)"},
559 { 91, "Unknown message(For future use)"},
560 { 92, "Unknown message(For future use)"},
561 { 93, "Unknown message(For future use)"},
562 { 94, "Unknown message(For future use)"},
563 { 95, "Unknown message(For future use)"},
564 #endif
565 {GTP_MBMS_NOTIFY_REQ, "MBMS Notification Request"},
566 {GTP_MBMS_NOTIFY_RES, "MBMS Notification Response"},
567 {GTP_MBMS_NOTIFY_REJ_REQ, "MBMS Notification Reject Request"},
568 {GTP_MBMS_NOTIFY_REJ_RES, "MBMS Notification Reject Response"},
569 {GTP_CREATE_MBMS_CNTXT_REQ, "Create MBMS Context Request"},
570 {GTP_CREATE_MBMS_CNTXT_RES, "Create MBMS Context Response"},
571 {GTP_UPD_MBMS_CNTXT_REQ, "Update MBMS Context Request"},
572 {GTP_UPD_MBMS_CNTXT_RES, "Update MBMS Context Response"},
573 {GTP_DEL_MBMS_CNTXT_REQ, "Delete MBMS Context Request"},
574 {GTP_DEL_MBMS_CNTXT_RES, "Delete MBMS Context Response"},
575 /* 106 - 111 For future use. Shall not be sent. If received,
576 * shall be treated as an Unknown message.
578 #if 0
579 { 106, "Unknown message(For future use)"},
580 { 107, "Unknown message(For future use)"},
581 { 108, "Unknown message(For future use)"},
582 { 109, "Unknown message(For future use)"},
583 { 110, "Unknown message(For future use)"},
584 { 111, "Unknown message(For future use)"},
585 #endif
586 {GTP_MBMS_REG_REQ, "MBMS Registration Request"},
587 {GTP_MBMS_REG_RES, "MBMS Registration Response"},
588 {GTP_MBMS_DE_REG_REQ, "MBMS De-Registration Request"},
589 {GTP_MBMS_DE_REG_RES, "MBMS De-Registration Response"},
590 {GTP_MBMS_SES_START_REQ, "MBMS Session Start Request"},
591 {GTP_MBMS_SES_START_RES, "MBMS Session Start Response"},
592 {GTP_MBMS_SES_STOP_REQ, "MBMS Session Stop Request"},
593 {GTP_MBMS_SES_STOP_RES, "MBMS Session Stop Response"},
594 {GTP_MBMS_SES_UPD_REQ, "MBMS Session Update Request"},
595 {GTP_MBMS_SES_UPD_RES, "MBMS Session Update Response"},
596 /* 122-127 For future use. Shall not be sent.
597 * If received, shall be treated as an Unknown message.
599 #if 0
600 { 122, "Unknown message(For future use)"},
601 { 123, "Unknown message(For future use)"},
602 { 124, "Unknown message(For future use)"},
603 { 125, "Unknown message(For future use)"},
604 { 126, "Unknown message(For future use)"},
605 { 127, "Unknown message(For future use)"},
606 #endif
607 {GTP_MS_INFO_CNG_NOT_REQ, "MS Info Change Notification Request"},
608 {GTP_MS_INFO_CNG_NOT_RES, "MS Info Change Notification Response"},
609 /* 130-239 For future use. Shall not be sent. If received,
610 * shall be treated as an Unknown message.
612 #if 0
613 { 130, "Unknown message(For future use)"},
614 { 131, "Unknown message(For future use)"},
615 { 132, "Unknown message(For future use)"},
616 { 133, "Unknown message(For future use)"},
617 { 134, "Unknown message(For future use)"},
618 { 135, "Unknown message(For future use)"},
619 { 136, "Unknown message(For future use)"},
620 { 137, "Unknown message(For future use)"},
621 { 138, "Unknown message(For future use)"},
622 { 139, "Unknown message(For future use)"},
623 { 140, "Unknown message(For future use)"},
624 { 141, "Unknown message(For future use)"},
625 { 142, "Unknown message(For future use)"},
626 { 143, "Unknown message(For future use)"},
627 { 144, "Unknown message(For future use)"},
628 { 145, "Unknown message(For future use)"},
629 { 146, "Unknown message(For future use)"},
630 { 147, "Unknown message(For future use)"},
631 { 148, "Unknown message(For future use)"},
632 { 149, "Unknown message(For future use)"},
633 { 150, "Unknown message(For future use)"},
634 { 151, "Unknown message(For future use)"},
635 { 152, "Unknown message(For future use)"},
636 { 153, "Unknown message(For future use)"},
637 { 154, "Unknown message(For future use)"},
638 { 155, "Unknown message(For future use)"},
639 { 156, "Unknown message(For future use)"},
640 { 157, "Unknown message(For future use)"},
641 { 158, "Unknown message(For future use)"},
642 { 159, "Unknown message(For future use)"},
643 #endif
644 {GTP_MSG_DATA_TRANSF_REQ, "Data record transfer request"},
645 {GTP_MSG_DATA_TRANSF_RESP, "Data record transfer response"},
646 /* 242-253 For future use. Shall not be sent. If received,
647 * shall be treated as an Unknown message.
649 #if 0
650 { 242, "Unknown message(For future use)"},
651 { 243, "Unknown message(For future use)"},
652 { 244, "Unknown message(For future use)"},
653 { 245, "Unknown message(For future use)"},
654 { 246, "Unknown message(For future use)"},
655 { 247, "Unknown message(For future use)"},
656 { 248, "Unknown message(For future use)"},
657 { 249, "Unknown message(For future use)"},
658 { 250, "Unknown message(For future use)"},
659 { 251, "Unknown message(For future use)"},
660 { 252, "Unknown message(For future use)"},
661 { 253, "Unknown message(For future use)"},
662 #endif
663 {GTP_MSG_END_MARKER, "End Marker"},
664 {GTP_MSG_TPDU, "T-PDU"},
665 {0, NULL}
667 static value_string_ext gtp_message_type_ext = VALUE_STRING_EXT_INIT(gtp_message_type);
669 /* definitions of fields in extension header */
670 #define GTP_EXT_CAUSE 0x01
671 #define GTP_EXT_IMSI 0x02
672 #define GTP_EXT_RAI 0x03
673 #define GTP_EXT_TLLI 0x04
674 #define GTP_EXT_PTMSI 0x05
675 #define GTP_EXT_QOS_GPRS 0x06
676 #define GTP_EXT_REORDER 0x08
677 #define GTP_EXT_AUTH_TRI 0x09
678 #define GTP_EXT_MAP_CAUSE 0x0B
679 #define GTP_EXT_PTMSI_SIG 0x0C
680 #define GTP_EXT_MS_VALID 0x0D
681 #define GTP_EXT_RECOVER 0x0E
682 #define GTP_EXT_SEL_MODE 0x0F
684 #define GTP_EXT_16 0x10
685 #define GTP_EXT_FLOW_LABEL 0x10
686 #define GTP_EXT_TEID 0x10 /* 0xFF10 3G */
688 #define GTP_EXT_17 0x11
689 #define GTP_EXT_FLOW_SIG 0x11
690 #define GTP_EXT_TEID_CP 0x11 /* 0xFF11 3G */
692 #define GTP_EXT_18 0x12
693 #define GTP_EXT_FLOW_II 0x12
694 #define GTP_EXT_TEID_II 0x12 /* 0xFF12 3G */
696 #define GTP_EXT_19 0x13 /* 19 TV Teardown Ind 7.7.16 */
697 #define GTP_EXT_MS_REASON 0x13 /* same as 0x1D GTPv1_EXT_MS_REASON */
698 #define GTP_EXT_TEAR_IND 0x13 /* 0xFF13 3G */
700 #define GTP_EXT_NSAPI 0x14 /* 3G */
701 #define GTP_EXT_RANAP_CAUSE 0x15 /* 3G */
702 #define GTP_EXT_RAB_CNTXT 0x16 /* 3G */
703 #define GTP_EXT_RP_SMS 0x17 /* 3G */
704 #define GTP_EXT_RP 0x18 /* 3G */
705 #define GTP_EXT_PKT_FLOW_ID 0x19 /* 3G */
706 #define GTP_EXT_CHRG_CHAR 0x1A /* 3G */
707 #define GTP_EXT_TRACE_REF 0x1B /* 3G */
708 #define GTP_EXT_TRACE_TYPE 0x1C /* 3G */
709 #define GTPv1_EXT_MS_REASON 0x1D /* 3G 29 TV MS Not Reachable Reason 7.7.25A */
710 /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
711 #define GTP_EXT_TR_COMM 0x7E /* charging */
712 #define GTP_EXT_CHRG_ID 0x7F /* 127 TV Charging ID 7.7.26 */
713 #define GTP_EXT_USER_ADDR 0x80
714 #define GTP_EXT_MM_CNTXT 0x81
715 #define GTP_EXT_PDP_CNTXT 0x82
716 #define GTP_EXT_APN 0x83
717 #define GTP_EXT_PROTO_CONF 0x84
718 #define GTP_EXT_GSN_ADDR 0x85
719 #define GTP_EXT_MSISDN 0x86
720 #define GTP_EXT_QOS_UMTS 0x87 /* 3G */
721 #define GTP_EXT_AUTH_QUI 0x88 /* 3G */
722 #define GTP_EXT_TFT 0x89 /* 3G */
723 #define GTP_EXT_TARGET_ID 0x8A /* 3G */
724 #define GTP_EXT_UTRAN_CONT 0x8B /* 3G */
725 #define GTP_EXT_RAB_SETUP 0x8C /* 3G */
726 #define GTP_EXT_HDR_LIST 0x8D /* 3G */
727 #define GTP_EXT_TRIGGER_ID 0x8E /* 3G 142 7.7.41 */
728 #define GTP_EXT_OMC_ID 0x8F /* 3G 143 TLV OMC Identity 7.7.42 */
729 #define GTP_EXT_RAN_TR_CONT 0x90 /* 3G 144 TLV RAN Transparent Container 7.7.43 */
730 #define GTP_EXT_PDP_CONT_PRIO 0x91 /* 3G 145 TLV PDP Context Prioritization 7.7.45 */
731 #define GTP_EXT_ADD_RAB_SETUP_INF 0x92 /* 3G 146 TLV Additional RAB Setup Information 7.7.45A */
732 #define GTP_EXT_SSGN_NO 0x93 /* 3G 147 TLV SGSN Number 7.7.47 */
733 #define GTP_EXT_COMMON_FLGS 0x94 /* 3G 148 TLV Common Flags 7.7.48 */
734 #define GTP_EXT_APN_RES 0x95 /* 3G 149 */
735 #define GTP_EXT_RA_PRIO_LCS 0x96 /* 3G 150 TLV Radio Priority LCS 7.7.25B */
736 #define GTP_EXT_RAT_TYPE 0x97 /* 3G 151 TLV RAT Type 7.7.50 */
737 #define GTP_EXT_USR_LOC_INF 0x98 /* 3G 152 TLV User Location Information 7.7.51 */
738 #define GTP_EXT_MS_TIME_ZONE 0x99 /* 3G 153 TLV MS Time Zone 7.7.52 */
739 #define GTP_EXT_IMEISV 0x9A /* 3G 154 TLV IMEI(SV) 7.7.53 */
740 #define GTP_EXT_CAMEL_CHG_INF_CON 0x9B /* 3G 155 TLV CAMEL Charging Information Container 7.7.54 */
741 #define GTP_EXT_MBMS_UE_CTX 0x9C /* 3G 156 TLV MBMS UE Context 7.7.55 */
742 #define GTP_EXT_TMGI 0x9D /* 3G 157 TLV Temporary Mobile Group Identity (TMGI) 7.7.56 */
743 #define GTP_EXT_RIM_RA 0x9E /* 3G 158 TLV RIM Routing Address 7.7.57 */
744 #define GTP_EXT_MBMS_PROT_CONF_OPT 0x9F /* 3G 159 TLV MBMS Protocol Configuration Options 7.7.58 */
745 #define GTP_EXT_MBMS_SA 0xA0 /* 3G 160 TLV MBMS Service Area 7.7.60 */
746 #define GTP_EXT_SRC_RNC_PDP_CTX_INF 0xA1 /* 3G 161 TLV Source RNC PDCP context info 7.7.61 */
747 #define GTP_EXT_ADD_TRS_INF 0xA2 /* 3G 162 TLV Additional Trace Info 7.7.62 */
748 #define GTP_EXT_HOP_COUNT 0xA3 /* 3G 163 TLV Hop Counter 7.7.63 */
749 #define GTP_EXT_SEL_PLMN_ID 0xA4 /* 3G 164 TLV Selected PLMN ID 7.7.64 */
750 #define GTP_EXT_MBMS_SES_ID 0xA5 /* 3G 165 TLV MBMS Session Identifier 7.7.65 */
751 #define GTP_EXT_MBMS_2G_3G_IND 0xA6 /* 3G 166 TLV MBMS 2G/3G Indicator 7.7.66 */
752 #define GTP_EXT_ENH_NSAPI 0xA7 /* 3G 167 TLV Enhanced NSAPI 7.7.67 */
753 #define GTP_EXT_MBMS_SES_DUR 0xA8 /* 3G 168 TLV MBMS Session Duration 7.7.59 */
754 #define GTP_EXT_ADD_MBMS_TRS_INF 0xA9 /* 3G 169 TLV Additional MBMS Trace Info 7.7.68 */
755 #define GTP_EXT_MBMS_SES_ID_REP_NO 0xAA /* 3G 170 TLV MBMS Session Identity Repetition Number 7.7.69 */
756 #define GTP_EXT_MBMS_TIME_TO_DATA_TR 0xAB /* 3G 171 TLV MBMS Time To Data Transfer 7.7.70 */
757 #define GTP_EXT_PS_HO_REQ_CTX 0xAC /* 3G 172 TLV PS Handover Request Context 7.7.71 */
758 #define GTP_EXT_BSS_CONT 0xAD /* 3G 173 TLV BSS Container 7.7.72 */
759 #define GTP_EXT_CELL_ID 0xAE /* 3G 174 TLV Cell Identification 7.7.73 */
760 #define GTP_EXT_PDU_NO 0xAF /* 3G 175 TLV PDU Numbers 7.7.74 */
761 #define GTP_EXT_BSSGP_CAUSE 0xB0 /* 3G 176 TLV BSSGP Cause 7.7.75 */
762 #define GTP_EXT_REQ_MBMS_BEARER_CAP 0xB1 /* 3G 177 TLV Required MBMS bearer capabilities 7.7.76 */
763 #define GTP_EXT_RIM_ROUTING_ADDR_DISC 0xB2 /* 3G 178 TLV RIM Routing Address Discriminator 7.7.77 */
764 #define GTP_EXT_LIST_OF_SETUP_PFCS 0xB3 /* 3G 179 TLV List of set-up PFCs 7.7.78 */
765 #define GTP_EXT_PS_HANDOVER_XIP_PAR 0xB4 /* 3G 180 TLV PS Handover XID Parameters 7.7.79 */
766 #define GTP_EXT_MS_INF_CHG_REP_ACT 0xB5 /* 3G 181 TLV MS Info Change Reporting Action 7.7.80 */
767 #define GTP_EXT_DIRECT_TUNNEL_FLGS 0xB6 /* 3G 182 TLV Direct Tunnel Flags 7.7.81 */
768 #define GTP_EXT_CORRELATION_ID 0xB7 /* 3G 183 TLV Correlation-ID 7.7.82 */
769 #define GTP_EXT_BEARER_CONTROL_MODE 0xB8 /* 3G 184 TLV Bearer Control Mode 7.7.83 */
770 #define GTP_EXT_MBMS_FLOW_ID 0xB9 /* 3G 185 TLV MBMS Flow Identifier 7.7.84 */
771 #define GTP_EXT_MBMS_IP_MCAST_DIST 0xBA /* 3G 186 TLV MBMS IP Multicast Distribution 7.7.85 */
772 #define GTP_EXT_MBMS_DIST_ACK 0xBB /* 3G 187 TLV MBMS Distribution Acknowledgement 7.7.86 */
773 #define GTP_EXT_RELIABLE_IRAT_HO_INF 0xBC /* 3G 188 TLV Reliable INTER RAT HANDOVER INFO 7.7.87 */
774 #define GTP_EXT_RFSP_INDEX 0xBD /* 3G 189 TLV RFSP Index 7.7.88 */
775 #define GTP_EXT_FQDN 0xBE /* 3G 190 TLV Fully Qualified Domain Name (FQDN) 7.7.90 */
776 #define GTP_EXT_EVO_ALLO_RETE_P1 0xBF /* 3G 191 TLV Evolved Allocation/Retention Priority I 7.7.91 */
777 #define GTP_EXT_EVO_ALLO_RETE_P2 0xC0 /* 3G 192 TLV Evolved Allocation/Retention Priority II 7.7.92 */
778 #define GTP_EXT_EXTENDED_COMMON_FLGS 0xC1 /* 3G 193 TLV Extended Common Flags 7.7.93 */
779 #define GTP_EXT_UCI 0xC2 /* 3G 194 TLV User CSG Information (UCI) 7.7.94 */
780 #define GTP_EXT_CSG_INF_REP_ACT 0xC3 /* 3G 195 TLV CSG Information Reporting Action 7.7.95 */
781 #define GTP_EXT_CSG_ID 0xC4 /* 3G 196 TLV CSG ID 7.7.96 */
782 #define GTP_EXT_CMI 0xC5 /* 3G 197 TLV CSG Membership Indication (CMI) 7.7.97 */
783 #define GTP_EXT_AMBR 0xC6 /* 3G 198 TLV Aggregate Maximum Bit Rate (AMBR) 7.7.98 */
784 #define GTP_EXT_UE_NETWORK_CAP 0xC7 /* 3G 199 TLV UE Network Capability 7.7.99 */
785 #define GTP_EXT_UE_AMBR 0xC8 /* 3G 200 TLV UE-AMBR 7.7.100 */
786 #define GTP_EXT_APN_AMBR_WITH_NSAPI 0xC9 /* 3G 201 TLV APN-AMBR with NSAPI 7.7.101 */
787 #define GTP_EXT_GGSN_BACK_OFF_TIME 0xCA /* 3G 202 TLV GGSN Back-Off Time 7.7.102 */
788 #define GTP_EXT_SIG_PRI_IND 0xCB /* 3G 203 TLV Signalling Priority Indication 7.7.103 */
789 #define GTP_EXT_SIG_PRI_IND_W_NSAPI 0xCC /* 3G 204 TLV Signalling Priority Indication with NSAPI 7.7.104 */
790 #define GTP_EXT_HIGHER_BR_16MB_FLG 0xCD /* 3G 205 TLV Higher bitrates than 16 Mbps flag 7.7.105 */
791 #define GTP_EXT_MAX_MBR_APN_AMBR 0xCE /* 3G 206 TLV Max MBR/APN-AMBR 7.7.106 */
792 #define GTP_EXT_ADD_MM_CTX_SRVCC 0xCF /* 3G 207 TLV Additional MM context for SRVCC 7.7.107 */
793 #define GTP_EXT_ADD_FLGS_SRVCC 0xD0 /* 3G 208 TLV Additional flags for SRVCC 7.7.108 */
794 #define GTP_EXT_STN_SR 0xD1 /* 3G 209 TLV STN-SR 7.7.109 */
795 #define GTP_EXT_C_MSISDN 0xD2 /* 3G 210 TLV C-MSISDN 7.7.110 */
796 #define GTP_EXT_EXT_RANAP_CAUSE 0xD3 /* 3G 211 TLV Extended RANAP Cause 7.7.111 */
797 /* 212-238 TLV Spare. For future use. */
799 /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33])*/
801 #define GTP_EXT_C1 0xC1
802 #define GTP_EXT_C2 0xC2
803 #define GTP_EXT_REL_PACK 0xF9 /* charging */
804 #define GTP_EXT_CAN_PACK 0xFA /* charging */
805 #define GTP_EXT_CHRG_ADDR 0xFB /* 3G 251 TLV Charging Gateway Address 7.7.44 */
806 /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33])*/
807 #define GTP_EXT_DATA_REQ 0xFC /* charging */
808 #define GTP_EXT_DATA_RESP 0xFD /* charging */
809 #define GTP_EXT_NODE_ADDR 0xFE /* charging */
810 #define GTP_EXT_PRIV_EXT 0xFF
812 static const value_string gtp_val[] = {
813 {GTP_EXT_CAUSE, "Cause of operation"},
814 {GTP_EXT_IMSI, "IMSI"},
815 {GTP_EXT_RAI, "Routing Area Identity"},
816 {GTP_EXT_TLLI, "Temporary Logical Link Identity"},
817 {GTP_EXT_PTMSI, "Packet TMSI"},
818 /* 6 */ {GTP_EXT_QOS_GPRS, "Quality of Service"},
819 /* 6-7 Spare */
820 /* 8 */ {GTP_EXT_REORDER, "Reorder required"},
821 /* 9 */ {GTP_EXT_AUTH_TRI, "Authentication triplets"},
822 /* 10 Spare */
823 /* 11 */ {GTP_EXT_MAP_CAUSE, "MAP cause"},
824 /* 12 */ {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
825 /* 13 */ {GTP_EXT_MS_VALID, "MS validated"},
826 /* 14 */ {GTP_EXT_RECOVER, "Recovery"},
827 /* 15 */ {GTP_EXT_SEL_MODE, "Selection mode"},
829 /* 16 */ {GTP_EXT_16, "Flow label data I"},
830 /* 16 */ /* ??? {GTP_EXT_FLOW_LABEL, "Flow label data I"}, */
831 /* 16 */ /* ??? {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"}, */ /* 3G */
833 {GTP_EXT_17, "Flow label signalling"},
834 /* ??? {GTP_EXT_FLOW_SIG, "Flow label signalling"}, */
835 /* ??? {GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane"}, */ /* 3G */
837 {GTP_EXT_18, "Flow label data II"},
838 /* ??? {GTP_EXT_FLOW_II, "Flow label data II"}, */
839 /* ??? {GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II"}, */ /* 3G */
841 {GTP_EXT_19, "MS not reachable reason"},
842 /* ??? {GTP_EXT_MS_REASON, "MS not reachable reason"}, */
843 /* ??? {GTP_EXT_TEAR_IND, "Teardown ID"}, */ /* 3G */
845 {GTP_EXT_NSAPI, "NSAPI"}, /* 3G */
846 {GTP_EXT_RANAP_CAUSE, "RANAP cause"}, /* 3G */
847 {GTP_EXT_RAB_CNTXT, "RAB context"}, /* 3G */
848 {GTP_EXT_RP_SMS, "Radio Priority for MO SMS"}, /* 3G */
849 {GTP_EXT_RP, "Radio Priority"}, /* 3G */
850 {GTP_EXT_PKT_FLOW_ID, "Packet Flow ID"}, /* 3G */
851 {GTP_EXT_CHRG_CHAR, "Charging characteristics"}, /* 3G */
852 {GTP_EXT_TRACE_REF, "Trace references"}, /* 3G */
853 {GTP_EXT_TRACE_TYPE, "Trace type"}, /* 3G */
854 /* 29 */ {GTPv1_EXT_MS_REASON, "MS not reachable reason"}, /* 3G */
855 /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
856 /* 126 */ {GTP_EXT_TR_COMM, "Packet transfer command"}, /* charging */
857 /* 127 */ {GTP_EXT_CHRG_ID, "Charging ID"},
858 {GTP_EXT_USER_ADDR, "End user address"},
859 {GTP_EXT_MM_CNTXT, "MM context"},
860 {GTP_EXT_PDP_CNTXT, "PDP context"},
861 {GTP_EXT_APN, "Access Point Name"},
862 {GTP_EXT_PROTO_CONF, "Protocol configuration options"},
863 {GTP_EXT_GSN_ADDR, "GSN address"},
864 {GTP_EXT_MSISDN, "MS international PSTN/ISDN number"},
865 {GTP_EXT_QOS_UMTS, "Quality of service (UMTS)"}, /* 3G */
866 {GTP_EXT_AUTH_QUI, "Authentication quintuplets"}, /* 3G */
867 {GTP_EXT_TFT, "Traffic Flow Template (TFT)"}, /* 3G */
868 {GTP_EXT_TARGET_ID, "Target (RNC) identification"}, /* 3G */
869 {GTP_EXT_UTRAN_CONT, "UTRAN transparent field"}, /* 3G */
870 {GTP_EXT_RAB_SETUP, "RAB setup information"}, /* 3G */
871 {GTP_EXT_HDR_LIST, "Extension Header Types List"}, /* 3G */
872 {GTP_EXT_TRIGGER_ID, "Trigger Id"}, /* 3G */
873 {GTP_EXT_OMC_ID, "OMC Identity"}, /* 3G */
875 {GTP_EXT_RAN_TR_CONT, "RAN Transparent Container"}, /* 7.7.43 */
876 {GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization"}, /* 7.7.45 */
877 {GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information"}, /* 7.7.45A */
878 {GTP_EXT_SSGN_NO, "SGSN Number"}, /* 7.7.47 */
879 {GTP_EXT_COMMON_FLGS, "Common Flags"}, /* 7.7.48 */
880 {GTP_EXT_APN_RES, "APN Restriction"}, /* 3G */
881 {GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS"}, /* 7.7.25B */
882 {GTP_EXT_RAT_TYPE, "RAT Type"}, /* 3G */
883 {GTP_EXT_USR_LOC_INF, "User Location Information"}, /* 7.7.51 */
884 {GTP_EXT_MS_TIME_ZONE, "MS Time Zone"}, /* 7.7.52 */
886 {GTP_EXT_IMEISV, "IMEI(SV)"}, /* 3G */
887 {GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container"}, /* 7.7.54 */
888 {GTP_EXT_MBMS_UE_CTX, "MBMS UE Context"}, /* 7.7.55 */
889 {GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)"}, /* 7.7.56 */
890 {GTP_EXT_RIM_RA, "RIM Routing Address"}, /* 7.7.57 */
891 {GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options"}, /* 7.7.58 */
892 {GTP_EXT_MBMS_SA, "MBMS Service Area"}, /* 7.7.60 */
893 {GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info"}, /* 7.7.61 */
894 {GTP_EXT_ADD_TRS_INF, "Additional Trace Info"}, /* 7.7.62 */
895 {GTP_EXT_HOP_COUNT, "Hop Counter"}, /* 7.7.63 */
896 {GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID"}, /* 7.7.64 */
897 {GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier"}, /* 7.7.65 */
898 {GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator"}, /* 7.7.66 */
899 {GTP_EXT_ENH_NSAPI, "Enhanced NSAPI"}, /* 7.7.67 */
900 {GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration"}, /* 7.7.59 */
901 {GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info"}, /* 7.7.68 */
902 {GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number"}, /* 7.7.69 */
903 {GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer"}, /* 7.7.70 */
904 {GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context"}, /* 7.7.71 */
905 {GTP_EXT_BSS_CONT, "BSS Container"}, /* 7.7.72 */
906 {GTP_EXT_CELL_ID, "Cell Identification"}, /* 7.7.73 */
907 {GTP_EXT_PDU_NO, "PDU Numbers"}, /* 7.7.74 */
908 {GTP_EXT_BSSGP_CAUSE, "BSSGP Cause"}, /* 7.7.75 */
909 {GTP_EXT_REQ_MBMS_BEARER_CAP, "Required MBMS bearer capabilities"}, /* 7.7.76 */
910 {GTP_EXT_RIM_ROUTING_ADDR_DISC, "RIM Routing Address Discriminator"}, /* 7.7.77 */
911 {GTP_EXT_LIST_OF_SETUP_PFCS, "List of set-up PFCs"}, /* 7.7.78 */
912 /* 180 */ {GTP_EXT_PS_HANDOVER_XIP_PAR, " PS Handover XID Parameters"}, /* 7.7.79 */
913 /* 181 */ {GTP_EXT_MS_INF_CHG_REP_ACT, "MS Info Change Reporting Action"}, /* 7.7.80 */
914 /* 182 */ {GTP_EXT_DIRECT_TUNNEL_FLGS, "Direct Tunnel Flags"}, /* 7.7.81 */
915 /* 183 */ {GTP_EXT_CORRELATION_ID, "Correlation-ID"}, /* 7.7.82 */
916 /* 184 */ {GTP_EXT_BEARER_CONTROL_MODE, "Bearer Control Mode"}, /* 7.7.83 */
917 /* 185 */ {GTP_EXT_MBMS_FLOW_ID, "MBMS Flow Identifier"}, /* 7.7.84 */
918 /* 186 */ {GTP_EXT_MBMS_IP_MCAST_DIST, "MBMS IP Multicast Distribution"}, /* 7.7.85 */
919 /* 187 */ {GTP_EXT_MBMS_DIST_ACK, "MBMS Distribution Acknowledgement"}, /* 7.7.86 */
920 /* 188 */ {GTP_EXT_RELIABLE_IRAT_HO_INF, "Reliable INTER RAT HANDOVER INFO"}, /* 7.7.87 */
921 /* 189 */ {GTP_EXT_RFSP_INDEX, "RFSP Index"}, /* 7.7.88 */
922 /* 190 */ {GTP_EXT_FQDN, "Fully Qualified Domain Name (FQDN)"}, /* 7.7.90 */
923 /* 191 */ {GTP_EXT_EVO_ALLO_RETE_P1, "Evolved Allocation/Retention Priority I"}, /* 7.7.91 */
924 /* 192 */ {GTP_EXT_EVO_ALLO_RETE_P2, "Evolved Allocation/Retention Priority II"}, /* 7.7.92 */
925 /* 193 */ {GTP_EXT_EXTENDED_COMMON_FLGS, "Extended Common Flags"}, /* 7.7.93 */
926 /* 194 */ {GTP_EXT_UCI, "User CSG Information (UCI)"}, /* 7.7.94 */
927 /* 195 */ {GTP_EXT_CSG_INF_REP_ACT, "CSG Information Reporting Action"}, /* 7.7.95 */
928 /* 196 */ {GTP_EXT_CSG_ID, "CSG ID"}, /* 7.7.96 */
929 /* 197 */ {GTP_EXT_CMI, "CSG Membership Indication (CMI)"}, /* 7.7.97 */
930 /* 198 */ {GTP_EXT_AMBR, "Aggregate Maximum Bit Rate (AMBR)"}, /* 7.7.98 */
931 /* 199 */ {GTP_EXT_UE_NETWORK_CAP, "UE Network Capability"}, /* 7.7.99 */
932 /* 200 */ {GTP_EXT_UE_AMBR, "UE-AMBR"}, /* 7.7.100 */
933 /* 201 */ {GTP_EXT_APN_AMBR_WITH_NSAPI, "APN-AMBR with NSAPI"}, /* 7.7.101 */
934 /* 202 */ {GTP_EXT_GGSN_BACK_OFF_TIME, "GGSN Back-Off Time"}, /* 7.7.102 */
935 /* 203 */ {GTP_EXT_SIG_PRI_IND, "Signalling Priority Indication"}, /* 7.7.103 */
936 /* 204 */ {GTP_EXT_SIG_PRI_IND_W_NSAPI, "Signalling Priority Indication with NSAPI"}, /* 7.7.104 */
937 /* 205 */ {GTP_EXT_HIGHER_BR_16MB_FLG, "Higher bitrates than 16 Mbps flag"}, /* 7.7.105 */
938 /* 206 */ {GTP_EXT_MAX_MBR_APN_AMBR, "Max MBR/APN-AMBR"}, /* 7.7.106 */
939 /* 207 */ {GTP_EXT_ADD_MM_CTX_SRVCC, "Additional MM context for SRVCC"}, /* 7.7.107 */
940 /* 208 */ {GTP_EXT_ADD_FLGS_SRVCC, "Additional flags for SRVCC"}, /* 7.7.108 */
941 /* 209 */ {GTP_EXT_STN_SR, "STN-SR"}, /* 7.7.109 */
942 /* 210 */ {GTP_EXT_C_MSISDN, "C-MSISDN"}, /* 7.7.110 */
943 /* 211 */ {GTP_EXT_EXT_RANAP_CAUSE, "Extended RANAP Cause"}, /* 7.7.111 */
944 /* 212-238 TLV Spare. For future use. */
945 /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
946 /* 249 */ {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"}, /* charging */
947 /* 250 */ {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"}, /* charging */
948 /* 251 */ {GTP_EXT_CHRG_ADDR, "Charging Gateway address"}, /* 7.7.44 */
949 /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
950 /* 252 */ {GTP_EXT_DATA_REQ, "Data record packet"}, /* charging */
951 /* 253 */ {GTP_EXT_DATA_RESP, "Requests responded"}, /* charging */
952 /* 254 */ {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
953 /* 255 */ {GTP_EXT_PRIV_EXT, "Private Extension"},
954 {0, NULL}
956 static value_string_ext gtp_val_ext = VALUE_STRING_EXT_INIT(gtp_val);
958 /* It seems like some IE's are renamed in gtpv1 at least reading
959 * 3GPP TS 29.060 version 6.11.0 Release 6
961 static const value_string gtpv1_val[] = {
962 /* 1 */ {GTP_EXT_CAUSE, "Cause of operation"},
963 /* 2 */ {GTP_EXT_IMSI, "IMSI"},
964 /* 3 */ {GTP_EXT_RAI, "Routing Area Identity"},
965 /* 4 */ {GTP_EXT_TLLI, "Temporary Logical Link Identity"},
966 /* 5 */ {GTP_EXT_PTMSI, "Packet TMSI"},
967 /* 6 */ {GTP_EXT_QOS_GPRS, "Quality of Service"},
968 /* 6-7 Spare */
969 /* 7 */ {7, "Spare"},
970 /* 8 */ {GTP_EXT_REORDER, "Reorder required"},
971 /* 9 */ {GTP_EXT_AUTH_TRI, "Authentication triplets"},
972 /* 10 Spare */
973 /* 10 */ {10, "Spare"},
974 /* 11 */ {GTP_EXT_MAP_CAUSE, "MAP cause"},
975 /* 12 */ {GTP_EXT_PTMSI_SIG, "P-TMSI signature"},
976 /* 13 */ {GTP_EXT_MS_VALID, "MS validated"},
977 /* 14 */ {GTP_EXT_RECOVER, "Recovery"},
978 /* 15 */ {GTP_EXT_SEL_MODE, "Selection mode"},
979 /* 16 */ {GTP_EXT_TEID, "Tunnel Endpoint Identifier Data I"}, /* 3G */
980 /* 17 */ {GTP_EXT_TEID_CP, "Tunnel Endpoint Identifier Data Control Plane"}, /* 3G */
981 /* 18 */ {GTP_EXT_TEID_II, "Tunnel Endpoint Identifier Data II"}, /* 3G */
982 /* 19 */ {GTP_EXT_TEAR_IND, "Teardown ID"}, /* 3G */
984 /* 20 */ {GTP_EXT_NSAPI, "NSAPI"}, /* 3G */
985 /* 21 */ {GTP_EXT_RANAP_CAUSE, "RANAP cause"}, /* 3G */
986 /* 22 */ {GTP_EXT_RAB_CNTXT, "RAB context"}, /* 3G */
987 /* 23 */ {GTP_EXT_RP_SMS, "Radio Priority for MO SMS"}, /* 3G */
988 /* 24 */ {GTP_EXT_RP, "Radio Priority"}, /* 3G */
989 /* 25 */ {GTP_EXT_PKT_FLOW_ID, "Packet Flow ID"}, /* 3G */
990 /* 26 */ {GTP_EXT_CHRG_CHAR, "Charging characteristics"}, /* 3G */
991 /* 27 */ {GTP_EXT_TRACE_REF, "Trace references"}, /* 3G */
992 /* 28 */ {GTP_EXT_TRACE_TYPE, "Trace type"}, /* 3G */
993 /* 29 */ {GTPv1_EXT_MS_REASON, "MS not reachable reason"}, /* 3G */
994 /* 117-126 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
995 /* 126 */ {GTP_EXT_TR_COMM, "Packet transfer command"}, /* charging */
996 /* 127 */ {GTP_EXT_CHRG_ID, "Charging ID"},
998 /* 128 */ {GTP_EXT_USER_ADDR, "End user address"},
999 /* 129 */ {GTP_EXT_MM_CNTXT, "MM context"},
1000 /* 130 */ {GTP_EXT_PDP_CNTXT, "PDP context"},
1001 /* 131 */ {GTP_EXT_APN, "Access Point Name"},
1002 /* 132 */ {GTP_EXT_PROTO_CONF, "Protocol configuration options"},
1003 /* 133 */ {GTP_EXT_GSN_ADDR, "GSN address"},
1004 /* 134 */ {GTP_EXT_MSISDN, "MS international PSTN/ISDN number"},
1005 /* 135 */ {GTP_EXT_QOS_UMTS, "Quality of service (UMTS)"}, /* 3G */
1006 /* 136 */ {GTP_EXT_AUTH_QUI, "Authentication quintuplets"}, /* 3G */
1007 /* 137 */ {GTP_EXT_TFT, "Traffic Flow Template (TFT)"}, /* 3G */
1008 /* 138 */ {GTP_EXT_TARGET_ID, "Target (RNC) identification"}, /* 3G */
1009 /* 139 */ {GTP_EXT_UTRAN_CONT, "UTRAN transparent field"}, /* 3G */
1010 /* 140 */ {GTP_EXT_RAB_SETUP, "RAB setup information"}, /* 3G */
1011 /* 141 */ {GTP_EXT_HDR_LIST, "Extension Header Types List"}, /* 3G */
1012 /* 142 */ {GTP_EXT_TRIGGER_ID, "Trigger Id"}, /* 3G */
1013 /* 143 */ {GTP_EXT_OMC_ID, "OMC Identity"}, /* 3G */
1014 /* 144 */ {GTP_EXT_RAN_TR_CONT, "RAN Transparent Container"}, /* 7.7.43 */
1015 /* 145 */ {GTP_EXT_PDP_CONT_PRIO, "PDP Context Prioritization"}, /* 7.7.45 */
1016 /* 146 */ {GTP_EXT_ADD_RAB_SETUP_INF, "Additional RAB Setup Information"}, /* 7.7.45A */
1017 /* 147 */ {GTP_EXT_SSGN_NO, "SGSN Number"}, /* 7.7.47 */
1018 /* 148 */ {GTP_EXT_COMMON_FLGS, "Common Flags"}, /* 7.7.48 */
1019 /* 149 */ {GTP_EXT_APN_RES, "APN Restriction"}, /* 3G */
1020 /* 150 */ {GTP_EXT_RA_PRIO_LCS, "Radio Priority LCS"}, /* 7.7.25B */
1021 /* 151 */ {GTP_EXT_RAT_TYPE, "RAT Type"}, /* 3G */
1022 /* 152 */ {GTP_EXT_USR_LOC_INF, "User Location Information"}, /* 7.7.51 */
1023 /* 153 */ {GTP_EXT_MS_TIME_ZONE, "MS Time Zone"}, /* 7.7.52 */
1025 /* 154 */ {GTP_EXT_IMEISV, "IMEI(SV)"}, /* 3G */
1026 /* 155 */ {GTP_EXT_CAMEL_CHG_INF_CON, "CAMEL Charging Information Container"}, /* 7.7.54 */
1027 /* 156 */ {GTP_EXT_MBMS_UE_CTX, "MBMS UE Context"}, /* 7.7.55 */
1028 /* 157 */ {GTP_EXT_TMGI, "Temporary Mobile Group Identity (TMGI)"}, /* 7.7.56 */
1029 /* 158 */ {GTP_EXT_RIM_RA, "RIM Routing Address"}, /* 7.7.57 */
1030 /* 159 */ {GTP_EXT_MBMS_PROT_CONF_OPT, "MBMS Protocol Configuration Options"}, /* 7.7.58 */
1031 /* 160 */ {GTP_EXT_MBMS_SA, "MBMS Service Area"}, /* 7.7.60 */
1032 /* 161 */ {GTP_EXT_SRC_RNC_PDP_CTX_INF, "Source RNC PDCP context info"}, /* 7.7.61 */
1033 /* 162 */ {GTP_EXT_ADD_TRS_INF, "Additional Trace Info"}, /* 7.7.62 */
1034 /* 163 */ {GTP_EXT_HOP_COUNT, "Hop Counter"}, /* 7.7.63 */
1035 /* 164 */ {GTP_EXT_SEL_PLMN_ID, "Selected PLMN ID"}, /* 7.7.64 */
1036 /* 165 */ {GTP_EXT_MBMS_SES_ID, "MBMS Session Identifier"}, /* 7.7.65 */
1037 /* 166 */ {GTP_EXT_MBMS_2G_3G_IND, "MBMS 2G/3G Indicator"}, /* 7.7.66 */
1038 /* 167 */ {GTP_EXT_ENH_NSAPI, "Enhanced NSAPI"}, /* 7.7.67 */
1039 /* 168 */ {GTP_EXT_MBMS_SES_DUR, "MBMS Session Duration"}, /* 7.7.59 */
1040 /* 169 */ {GTP_EXT_ADD_MBMS_TRS_INF, "Additional MBMS Trace Info"}, /* 7.7.68 */
1041 /* 170 */ {GTP_EXT_MBMS_SES_ID_REP_NO, "MBMS Session Identity Repetition Number"}, /* 7.7.69 */
1042 /* 171 */ {GTP_EXT_MBMS_TIME_TO_DATA_TR, "MBMS Time To Data Transfer"}, /* 7.7.70 */
1043 /* 172 */ {GTP_EXT_PS_HO_REQ_CTX, "PS Handover Request Context"}, /* 7.7.71 */
1044 /* 173 */ {GTP_EXT_BSS_CONT, "BSS Container"}, /* 7.7.72 */
1045 /* 174 */ {GTP_EXT_CELL_ID, "Cell Identification"}, /* 7.7.73 */
1046 /* 175 */ {GTP_EXT_PDU_NO, "PDU Numbers"}, /* 7.7.74 */
1047 /* 176 */ {GTP_EXT_BSSGP_CAUSE, "BSSGP Cause"}, /* 7.7.75 */
1049 /* 177 */ {GTP_EXT_REQ_MBMS_BEARER_CAP, "Required MBMS bearer capabilities"}, /* 7.7.76 */
1050 /* 178 */ {GTP_EXT_RIM_ROUTING_ADDR_DISC, "RIM Routing Address Discriminator"}, /* 7.7.77 */
1051 /* 179 */ {GTP_EXT_LIST_OF_SETUP_PFCS, "List of set-up PFCs"}, /* 7.7.78 */
1052 /* 180 */ {GTP_EXT_PS_HANDOVER_XIP_PAR, "PS Handover XID Parameters"}, /* 7.7.79 */
1053 /* 181 */ {GTP_EXT_MS_INF_CHG_REP_ACT, "MS Info Change Reporting Action"}, /* 7.7.80 */
1054 /* 182 */ {GTP_EXT_DIRECT_TUNNEL_FLGS, "Direct Tunnel Flags"}, /* 7.7.81 */
1055 /* 183 */ {GTP_EXT_CORRELATION_ID, "Correlation-ID"}, /* 7.7.82 */
1056 /* 184 */ {GTP_EXT_BEARER_CONTROL_MODE, "Bearer Control Mode"}, /* 7.7.83 */
1057 /* 185 */ {GTP_EXT_MBMS_FLOW_ID, "MBMS Flow Identifier"}, /* 7.7.84 */
1058 /* 186 */ {GTP_EXT_MBMS_IP_MCAST_DIST, "MBMS IP Multicast Distribution"}, /* 7.7.85 */
1059 /* 187 */ {GTP_EXT_MBMS_DIST_ACK, "MBMS Distribution Acknowledgement"}, /* 7.7.86 */
1060 /* 188 */ {GTP_EXT_RELIABLE_IRAT_HO_INF, "Reliable INTER RAT HANDOVER INFO"}, /* 7.7.87 */
1061 /* 190 */ {GTP_EXT_RFSP_INDEX, "RFSP Index"}, /* 7.7.88 */
1062 /* 190 */ {GTP_EXT_FQDN, "Fully Qualified Domain Name (FQDN)"}, /* 7.7.90 */
1063 /* 191 */ {GTP_EXT_EVO_ALLO_RETE_P1, "Evolved Allocation/Retention Priority I"}, /* 7.7.91 */
1064 /* 192 */ {GTP_EXT_EVO_ALLO_RETE_P2, "Evolved Allocation/Retention Priority II"}, /* 7.7.92 */
1065 /* 193 */ {GTP_EXT_EXTENDED_COMMON_FLGS, "Extended Common Flags"}, /* 7.7.93 */
1066 /* 194 */ {GTP_EXT_UCI, "User CSG Information (UCI)"}, /* 7.7.94 */
1067 /* 195 */ {GTP_EXT_CSG_INF_REP_ACT, "CSG Information Reporting Action"}, /* 7.7.95 */
1068 /* 196 */ {GTP_EXT_CSG_ID, "CSG ID"}, /* 7.7.96 */
1069 /* 197 */ {GTP_EXT_CMI, "CSG Membership Indication (CMI)"}, /* 7.7.97 */
1070 /* 198 */ {198, "Aggregate Maximum Bit Rate (AMBR)"}, /* 7.7.98 */
1071 /* 199 */ {199, "UE Network Capability"}, /* 7.7.99 */
1072 /* 200 */ {200, "UE-AMBR"}, /* 7.7.100 */
1073 /* 201 */ {201, "APN-AMBR with NSAPI"}, /* 7.7.101 */
1074 /* 202 */ {202, "GGSN Back-Off Time"}, /* 7.7.102 */
1075 /* 203 */ {203, "Signalling Priority Indication"}, /* 7.7.103 */
1076 /* 204 */ {204, "Signalling Priority Indication with NSAPI"}, /* 7.7.104 */
1077 /* 205 */ {205, "Higher bitrates than 16 Mbps flag"}, /* 7.7.105 */
1078 /* 206 */ {206, "Max MBR/APN-AMBR"}, /* 7.7.106 */
1079 /* 207 */ {207, "Additional MM context for SRVCC"}, /* 7.7.107 */
1080 /* 208 */ {208, "Additional flags for SRVCC"}, /* 7.7.108 */
1081 /* 209 */ {209, "STN-SR"}, /* 7.7.109 */
1082 /* 210 */ {210, "C-MSISDN"}, /* 7.7.110 */
1083 /* 211 */ {211, "Extended RANAP Cause"}, /* 7.7.111 */
1084 /* 212-238 TLV Spare. For future use. */
1085 /* 239-250 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
1086 /* 249 */ {GTP_EXT_REL_PACK, "Sequence numbers of released packets IE"}, /* charging */
1087 /* 250 */ {GTP_EXT_CAN_PACK, "Sequence numbers of canceled packets IE"}, /* charging */
1088 /* 251 */ {GTP_EXT_CHRG_ADDR, "Charging Gateway address"}, /* 7.7.44 */
1089 /* 252-254 Reserved for the GPRS charging protocol (see GTP' in 3GPP TS 32.295 [33]) */
1090 /* 252 */ {GTP_EXT_DATA_REQ, "Data record packet"}, /* charging */
1091 /* 253 */ {GTP_EXT_DATA_RESP, "Requests responded"}, /* charging */
1092 /* 254 */ {GTP_EXT_NODE_ADDR, "Address of recommended node"}, /* charging */
1093 /* 255 */ {GTP_EXT_PRIV_EXT, "Private Extension"},
1095 {0, NULL}
1097 static value_string_ext gtpv1_val_ext = VALUE_STRING_EXT_INIT(gtpv1_val);
1099 /* GPRS: 9.60 v7.6.0, page 37
1100 * UMTS: 29.060 v4.0, page 45
1101 * ETSI TS 129 060 V9.4.0 (2010-10) Ch 7.7.1
1103 static const value_string cause_type[] = {
1104 { 0, "Request IMSI"},
1105 { 1, "Request IMEI"},
1106 { 2, "Request IMSI and IMEI"},
1107 { 3, "No identity needed"},
1108 { 4, "MS refuses"},
1109 { 5, "MS is not GPRS responding"},
1110 { 6, "Reactivation Requested"},
1111 { 7, "PDP address inactivity timer expires"},
1112 /* For future use 8-48 */
1113 /* Cause values reserved for GPRS charging
1114 * protocol use (see GTP' in 3GPP TS 32.295 [33])
1115 * 49-63
1117 { 59, "System failure"}, /* charging */
1118 { 60, "The transmit buffers are becoming full"}, /* charging */
1119 { 61, "The receive buffers are becoming full"}, /* charging */
1120 { 62, "Another node is about to go down"}, /* charging */
1121 { 63, "This node is about to go down"}, /* charging */
1122 /* For future use 64-127 */
1123 {128, "Request accepted"},
1124 {129, "New PDP type due to network preference"},
1125 {130, "New PDP type due to single address bearer only"},
1126 /* For future use 131-176 */
1127 /* Cause values reserved for GPRS charging
1128 * protocol use (see GTP' in 3GPP TS 32.295 [33])
1129 * 177-191
1131 {177, "CDR decoding error"},
1133 {192, "Non-existent"},
1134 {193, "Invalid message format"},
1135 {194, "IMSI not known"},
1136 {195, "MS is GPRS detached"},
1137 {196, "MS is not GPRS responding"},
1138 {197, "MS refuses"},
1139 {198, "Version not supported"},
1140 {199, "No resource available"},
1141 {200, "Service not supported"},
1142 {201, "Mandatory IE incorrect"},
1143 {202, "Mandatory IE missing"},
1144 {203, "Optional IE incorrect"},
1145 {204, "System failure"},
1146 {205, "Roaming restriction"},
1147 {206, "P-TMSI signature mismatch"},
1148 {207, "GPRS connection suspended"},
1149 {208, "Authentication failure"},
1150 {209, "User authentication failed"},
1151 {210, "Context not found"},
1152 {211, "All PDP dynamic addresses are occupied"},
1153 {212, "No memory is available"},
1154 {213, "Relocation failure"},
1155 {214, "Unknown mandatory extension header"},
1156 {215, "Semantic error in the TFT operation"},
1157 {216, "Syntactic error in the TFT operation"},
1158 {217, "Semantic errors in packet filter(s)"},
1159 {218, "Syntactic errors in packet filter(s)"},
1160 {219, "Missing or unknown APN"},
1161 {220, "Unknown PDP address or PDP type"},
1162 {221, "PDP context without TFT already activated"},
1163 {222, "APN access denied - no subscription"},
1164 {223, "APN Restriction type incompatibility with currently active PDP Contexts"},
1165 {224, "MS MBMS Capabilities Insufficient"},
1166 {225, "Invalid Correlation-ID"},
1167 {226, "MBMS Bearer Context Superseded"},
1168 {227, "Bearer Control Mode violation"},
1169 {228, "Collision with network initiated request"},
1170 {229, "APN Congestion"},
1171 {230, "Bearer handling not supported"},
1172 /* For future use 231-240 */
1173 /* Cause values reserved for GPRS charging
1174 * protocol use (see GTP' in 3GPP TS 32.295 [33])
1175 * 241-255
1177 {252, "Request related to possibly duplicated packets already fulfilled"}, /* charging */
1178 {253, "Request already fulfilled"}, /* charging */
1179 {254, "Sequence numbers of released/cancelled packets IE incorrect"}, /* charging */
1180 {255, "Request not fulfilled"}, /* charging */
1181 {0, NULL}
1183 value_string_ext cause_type_ext = VALUE_STRING_EXT_INIT(cause_type);
1185 /* GPRS: 9.02 v7.7.0
1186 * UMTS: 29.002 v4.2.1, chapter 17.5, page 268
1187 * Imported gsm_old_GSMMAPLocalErrorcode_vals from gsm_map from gsm_map
1190 static const value_string gsn_addr_type[] = {
1191 {0x00, "IPv4"},
1192 {0x01, "IPv6"},
1193 {0, NULL}
1196 static const value_string pdp_type[] = {
1197 {0x00, "X.25"},
1198 {0x01, "PPP"},
1199 {0x02, "OSP:IHOSS"},
1200 {0x21, "IPv4"},
1201 {0x57, "IPv6"},
1202 {0x8d, "IPv4v6"},
1203 {0, NULL}
1206 static const value_string pdp_org_type[] = {
1207 {0, "ETSI"},
1208 {1, "IETF"},
1209 {0, NULL}
1212 static const value_string qos_delay_type[] = {
1213 {0x00, "Subscribed delay class (in MS to network direction)"},
1214 {0x01, "Delay class 1"},
1215 {0x02, "Delay class 2"},
1216 {0x03, "Delay class 3"},
1217 {0x04, "Delay class 4 (best effort)"},
1218 {0x07, "Reserved"},
1219 {0, NULL}
1222 static const value_string qos_reliability_type[] = {
1223 {0x00, "Subscribed reliability class (in MS to network direction)"},
1224 {0x01, "Acknowledged GTP, LLC, and RLC; Protected data"},
1225 {0x02, "Unacknowledged GTP, Ack LLC/RLC, Protected data"},
1226 {0x03, "Unacknowledged GTP/LLC, Ack RLC, Protected data"},
1227 {0x04, "Unacknowledged GTP/LLC/RLC, Protected data"},
1228 {0x05, "Unacknowledged GTP/LLC/RLC, Unprotected data"},
1229 {0x07, "Reserved"},
1230 {0, NULL}
1233 static const value_string qos_peak_type[] = {
1234 {0x00, "Subscribed peak throughput (in MS to network direction)"},
1235 {0x01, "Up to 1 000 oct/s"},
1236 {0x02, "Up to 2 000 oct/s"},
1237 {0x03, "Up to 4 000 oct/s"},
1238 {0x04, "Up to 8 000 oct/s"},
1239 {0x05, "Up to 16 000 oct/s"},
1240 {0x06, "Up to 32 000 oct/s"},
1241 {0x07, "Up to 64 000 oct/s"},
1242 {0x08, "Up to 128 000 oct/s"},
1243 {0x09, "Up to 256 000 oct/s"},
1244 /* QoS Peak throughput classes from 0x0A to 0x0F (from 10 to 15) are subscribed */
1245 {0x0A, "Reserved"},
1246 {0x0B, "Reserved"},
1247 {0x0C, "Reserved"},
1248 {0x0D, "Reserved"},
1249 {0x0E, "Reserved"},
1250 {0x0F, "Reserved"},
1251 {0, NULL}
1254 static const value_string qos_precedence_type[] = {
1255 {0x00, "Subscribed precedence (in MS to network direction)"},
1256 {0x01, "High priority"},
1257 {0x02, "Normal priority"},
1258 {0x03, "Low priority"},
1259 {0x07, "Reserved"},
1260 {0, NULL}
1263 static const value_string qos_mean_type[] = {
1264 {0x00, "Subscribed mean throughput (in MS to network direction)"},
1265 {0x01, "100 oct/h"}, /* Class 2 */
1266 {0x02, "200 oct/h"}, /* Class 3 */
1267 {0x03, "500 oct/h"}, /* Class 4 */
1268 {0x04, "1 000 oct/h"}, /* Class 5 */
1269 {0x05, "2 000 oct/h"}, /* Class 6 */
1270 {0x06, "5 000 oct/h"}, /* Class 7 */
1271 {0x07, "10 000 oct/h"}, /* Class 8 */
1272 {0x08, "20 000 oct/h"}, /* Class 9 */
1273 {0x09, "50 000 oct/h"}, /* Class 10 */
1274 {0x0A, "100 000 oct/h"}, /* Class 11 */
1275 {0x0B, "200 000 oct/h"}, /* Class 12 */
1276 {0x0C, "500 000 oct/h"}, /* Class 13 */
1277 {0x0D, "1 000 000 oct/h"}, /* Class 14 */
1278 {0x0E, "2 000 000 oct/h"}, /* Class 15 */
1279 {0x0F, "5 000 000 oct/h"}, /* Class 16 */
1280 {0x10, "10 000 000 oct/h"}, /* Class 17 */
1281 {0x11, "20 000 000 oct/h"}, /* Class 18 */
1282 {0x12, "50 000 000 oct/h"}, /* Class 19 */
1283 /* QoS Mean throughput classes from 0x13 to 0x1E (from 19 to 30) are subscribed */
1284 {0x13, "Reserved"},
1285 {0x14, "Reserved"},
1286 {0x15, "Reserved"},
1287 {0x16, "Reserved"},
1288 {0x17, "Reserved"},
1289 {0x18, "Reserved"},
1290 {0x19, "Reserved"},
1291 {0x1A, "Reserved"},
1292 {0x1B, "Reserved"},
1293 {0x1C, "Reserved"},
1294 {0x1D, "Reserved"},
1295 {0x1E, "Reserved"},
1296 {0x1F, "Best effort"}, /* Class 1 */
1297 {0, NULL}
1299 static value_string_ext qos_mean_type_ext = VALUE_STRING_EXT_INIT(qos_mean_type);
1301 static const value_string qos_del_err_sdu[] = {
1302 {0x00, "Subscribed delivery of erroneous SDUs (in MS to network direction)"},
1303 {0x01, "No detect ('-')"},
1304 {0x02, "Erroneous SDUs are delivered ('yes')"},
1305 {0x03, "Erroneous SDUs are not delivered ('no')"},
1306 {0x07, "Reserved"}, /* All other values are reserved */
1307 {0, NULL}
1310 static const value_string qos_del_order[] = {
1311 {0x00, "Subscribed delivery order (in MS to network direction)"},
1312 {0x01, "With delivery order ('yes')"},
1313 {0x02, "Without delivery order ('no')"},
1314 {0x03, "Reserved"}, /* All other values are reserved */
1315 {0, NULL}
1318 static const value_string qos_traf_class[] = {
1319 {0x00, "Subscribed traffic class (in MS to network direction)"},
1320 {0x01, "Conversational class"},
1321 {0x02, "Streaming class"},
1322 {0x03, "Interactive class"},
1323 {0x04, "Background class"},
1324 {0x07, "Reserved"}, /* All other values are reserved */
1325 {0, NULL}
1328 static const value_string qos_max_sdu_size[] = {
1329 {0x00, "Subscribed maximum SDU size (in MS to network direction"},
1330 /* For values from 0x01 to 0x96 (from 1 to 150), use a granularity of 10 octets */
1331 {0x97, "1502 octets"},
1332 {0x98, "1510 octets"},
1333 {0x99, "1520 octets"},
1334 {0, NULL} /* All other values are reserved */
1337 static const value_string qos_max_ul[] = {
1338 {0x00, "Subscribed maximum bit rate for uplink (in MS to network direction)"},
1339 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1340 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1341 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1342 {0xFF, "0 kbps"},
1343 {0, NULL}
1346 static const value_string qos_max_dl[] = {
1347 {0x00, "Subscribed maximum bit rate for downlink (in MS to network direction)"},
1348 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1349 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1350 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1351 {0xFF, "0 kbps"},
1352 {0, NULL}
1355 static const value_string qos_res_ber[] = {
1356 {0x00, "Subscribed residual BER (in MS to network direction)"},
1357 {0x01, "1/20 = 5x10^-2"},
1358 {0x02, "1/100 = 1x10^-2"},
1359 {0x03, "1/200 = 5x10^-3"},
1360 {0x04, "1/250 = 4x10^-3"},
1361 {0x05, "1/1 000 = 1x10^-3"},
1362 {0x06, "1/10 000 = 1x10^-4"},
1363 {0x07, "1/100 000 = 1x10^-5"},
1364 {0x08, "1/1 000 000 = 1x10^-6"},
1365 {0x09, "3/50 000 000 = 6x10^-8"},
1366 {0x0F, "Reserved"}, /* All other values are reserved */
1367 {0, NULL}
1370 static const value_string qos_sdu_err_ratio[] = {
1371 {0x00, "Subscribed SDU error ratio (in MS to network direction)"},
1372 {0x01, "1/100 = 1x10^-2"},
1373 {0x02, "7/1000 = 7x10^-3"},
1374 {0x03, "1/1 000 = 1x10^-3"},
1375 {0x04, "1/10 000 = 1x10^-4"},
1376 {0x05, "1/100 000 = 1x10^-5"},
1377 {0x06, "1/1 000 000 = 1x10^-6"},
1378 {0x07, "1/10 = 1x10^-1"},
1379 {0x0F, "Reserved"}, /* All other values are reserved */
1380 {0, NULL}
1383 static const value_string qos_traf_handl_prio[] = {
1384 {0x00, "Subscribed traffic handling priority (in MS to network direction)"},
1385 {0x01, "Priority level 1"},
1386 {0x02, "Priority level 2"},
1387 {0x03, "Priority level 3"},
1388 {0, NULL}
1391 static const value_string qos_trans_delay[] = {
1392 {0x00, "Subscribed Transfer Delay (in MS to network direction)"},
1393 {0x01, "10 ms"}, /* Using a granularity of 10 ms */
1394 {0x02, "20 ms"},
1395 {0x03, "30 ms"},
1396 {0x04, "40 ms"},
1397 {0x05, "50 ms"},
1398 {0x06, "60 ms"},
1399 {0x07, "70 ms"},
1400 {0x08, "80 ms"},
1401 {0x09, "90 ms"},
1402 {0x0A, "100 ms"},
1403 {0x0B, "110 ms"},
1404 {0x0C, "120 ms"},
1405 {0x0D, "130 ms"},
1406 {0x0E, "140 ms"},
1407 {0x0F, "150 ms"},
1408 {0x10, "200 ms"}, /* (For values from 0x10 to 0x1F, value = 200 ms + (value - 0x10) * 50 ms */
1409 {0x11, "250 ms"},
1410 {0x12, "300 ms"},
1411 {0x13, "350 ms"},
1412 {0x14, "400 ms"},
1413 {0x15, "450 ms"},
1414 {0x16, "500 ms"},
1415 {0x17, "550 ms"},
1416 {0x18, "600 ms"},
1417 {0x19, "650 ms"},
1418 {0x1A, "700 ms"},
1419 {0x1B, "750 ms"},
1420 {0x1C, "800 ms"},
1421 {0x1D, "850 ms"},
1422 {0x1E, "900 ms"},
1423 {0x1F, "950 ms"},
1424 {0x20, "1000 ms"}, /* For values from 0x20 to 0x3E, value = 1000 ms + (value - 0x20) * 100 ms */
1425 {0x21, "1100 ms"},
1426 {0x22, "1200 ms"},
1427 {0x23, "1300 ms"},
1428 {0x24, "1400 ms"},
1429 {0x25, "1500 ms"},
1430 {0x26, "1600 ms"},
1431 {0x27, "1700 ms"},
1432 {0x28, "1800 ms"},
1433 {0x29, "1900 ms"},
1434 {0x2A, "2000 ms"},
1435 {0x2B, "2100 ms"},
1436 {0x2C, "2200 ms"},
1437 {0x2D, "2300 ms"},
1438 {0x2E, "2400 ms"},
1439 {0x2F, "2500 ms"},
1440 {0x30, "2600 ms"},
1441 {0x31, "2700 ms"},
1442 {0x32, "2800 ms"},
1443 {0x33, "2900 ms"},
1444 {0x34, "3000 ms"},
1445 {0x35, "3100 ms"},
1446 {0x36, "3200 ms"},
1447 {0x37, "3300 ms"},
1448 {0x38, "3400 ms"},
1449 {0x39, "3500 ms"},
1450 {0x3A, "3600 ms"},
1451 {0x3B, "3700 ms"},
1452 {0x3C, "3800 ms"},
1453 {0x3D, "3900 ms"},
1454 {0x3E, "4000 ms"},
1455 {0x3F, "Reserved"},
1456 {0, NULL}
1458 static value_string_ext qos_trans_delay_ext = VALUE_STRING_EXT_INIT(qos_trans_delay);
1460 static const value_string qos_guar_ul[] = {
1461 {0x00, "Subscribed guaranteed bit rate for uplink (in MS to network direction)"},
1462 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1463 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1464 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1465 {0xFF, "0 kbps"},
1466 {0, NULL}
1469 static const value_string src_stat_desc_vals[] = {
1470 {0x00, "unknown"},
1471 {0x01, "speech"},
1472 {0, NULL}
1476 static const true_false_string gtp_sig_ind = {
1477 "Optimised for signalling traffic",
1478 "Not optimised for signalling traffic"
1481 static const value_string qos_guar_dl[] = {
1482 {0x00, "Subscribed guaranteed bit rate for downlink (in MS to network direction)"},
1483 /* For values from 0x01 to 0x3F (from 1 to 63), use a granularity of 1 kbps */
1484 /* For values from 0x40 to 0x7F, value = 64 kbps + (value - 0x40) * 8 kbps */
1485 /* For values from 0x80 to 0xFE, value = 576 kbps + (value - 0x80) * 64 kbps */
1486 {0xFF, "0 kbps"},
1487 {0, NULL}
1490 static const value_string sel_mode_type[] = {
1491 {0, "MS or network provided APN, subscribed verified"},
1492 {1, "MS provided APN, subscription not verified"},
1493 {2, "Network provided APN, subscription not verified"},
1494 {3, "For future use (Network provided APN, subscription not verified"}, /* Shall not be sent. If received, shall be sent as value 2 */
1495 {0, NULL}
1498 static const value_string tr_comm_type[] = {
1499 {1, "Send data record packet"},
1500 {2, "Send possibly duplicated data record packet"},
1501 {3, "Cancel data record packet"},
1502 {4, "Release data record packet"},
1503 {0, NULL}
1506 /* TODO: CHeck if all ms_reasons are included */
1507 static const value_string ms_not_reachable_type[] = {
1508 { 0, "No paging response via the MSC"},
1509 { 1, "IMSI detached"},
1510 { 2, "Roaming restriction"},
1511 { 3, "Deregistered in the HLR for non GPRS"},
1512 { 4, "MS purge for non GPRS"},
1513 { 5, "No paging response via the SGSN"},
1514 { 6, "GPRS detached"},
1515 { 7, "Deregistered in the HLR for non GPRS"},
1516 { 8, "MS purged for GPRS"},
1517 { 9, "Unidentified subscriber via the MSC"},
1518 {10, "Unidentified subscriber via the SGSN"},
1519 {11, "Deregistered in the HSS/HLR for IMS"},
1520 {12, "No response via the IP-SM-GW"},
1521 {0, NULL}
1524 /* UMTS: 25.413 v3.4.0, chapter 9.2.1.4, page 80
1526 static const value_string ranap_cause_type[] = {
1527 /* Radio Network Layer Cause (1-->64) */
1528 { 1, "RAB preempted"},
1529 { 2, "Trelocoverall Expiry"},
1530 { 3, "Trelocprep Expiry"},
1531 { 4, "Treloccomplete Expiry"},
1532 { 5, "Tqueuing Expiry"},
1533 { 6, "Relocation Triggered"},
1534 { 7, "TRELOCalloc Expiry"},
1535 { 8, "Unable to Establish During Relocation"},
1536 { 9, "Unknown Target RNC"},
1537 { 10, "Relocation Cancelled"},
1538 { 11, "Successful Relocation"},
1539 { 12, "Requested Ciphering and/or Integrity Protection Algorithms not Supported"},
1540 { 13, "Change of Ciphering and/or Integrity Protection is not supported"},
1541 { 14, "Failure in the Radio Interface Procedure"},
1542 { 15, "Release due to UTRAN Generated Reason"},
1543 { 16, "User Inactivity"},
1544 { 17, "Time Critical Relocation"},
1545 { 18, "Requested Traffic Class not Available"},
1546 { 19, "Invalid RAB Parameters Value"},
1547 { 20, "Requested Maximum Bit Rate not Available"},
1548 { 21, "Requested Guaranteed Bit Rate not Available"},
1549 { 22, "Requested Transfer Delay not Achievable"},
1550 { 23, "Invalid RAB Parameters Combination"},
1551 { 24, "Condition Violation for SDU Parameters"},
1552 { 25, "Condition Violation for Traffic Handling Priority"},
1553 { 26, "Condition Violation for Guaranteed Bit Rate"},
1554 { 27, "User Plane Versions not Supported"},
1555 { 28, "Iu UP Failure"},
1556 { 29, "Relocation Failure in Target CN/RNC or Target System"},
1557 { 30, "Invalid RAB ID"},
1558 { 31, "No Remaining RAB"},
1559 { 32, "Interaction with other procedure"},
1560 { 33, "Requested Maximum Bit Rate for DL not Available"},
1561 { 34, "Requested Maximum Bit Rate for UL not Available"},
1562 { 35, "Requested Guaranteed Bit Rate for DL not Available"},
1563 { 36, "Requested Guaranteed Bit Rate for UL not Available"},
1564 { 37, "Repeated Integrity Checking Failure"},
1565 { 38, "Requested Report Type not supported"},
1566 { 39, "Request superseded"},
1567 { 40, "Release due to UE generated signalling connection release"},
1568 { 41, "Resource Optimisation Relocation"},
1569 { 42, "Requested Information Not Available"},
1570 { 43, "Relocation desirable for radio reasons"},
1571 { 44, "Relocation not supported in Target RNC or Target System"},
1572 { 45, "Directed Retry"},
1573 { 46, "Radio Connection With UE Lost"},
1574 { 47, "rNC-unable-to-establish-all-RFCs"},
1575 { 48, "deciphering-keys-not-available"},
1576 { 49, "dedicated-assistance-data-not-available"},
1577 { 50, "relocation-target-not-allowed"},
1578 { 51, "location-reporting-congestion"},
1579 { 52, "reduce-load-in-serving-cell"},
1580 { 53, "no-radio-resources-available-in-target-cell"},
1581 { 54, "gERAN-Iumode-failure"},
1582 { 55, "access-restricted-due-to-shared-networks"},
1583 { 56, "incoming-relocation-not-supported-due-to-PUESBINE-feature"},
1584 { 57, "traffic-load-in-the-target-cell-higher-than-in-the-source-cell"},
1585 { 58, "mBMS-no-multicast-service-for-this-UE"},
1586 { 59, "mBMS-unknown-UE-ID"},
1587 { 60, "successful-MBMS-session-start-no-data-bearer-necessary"},
1588 { 61, "mBMS-superseded-due-to-NNSF"},
1589 { 62, "mBMS-UE-linking-already-done"},
1590 { 63, "mBMS-UE-de-linking-failure-no-existing-UE-linking"},
1591 { 64, "tMGI-unknown"},
1592 /* Transport Layer Cause (65-->80) */
1593 { 65, "Signalling Transport Resource Failure"},
1594 { 66, "Iu Transport Connection Failed to Establish"},
1595 /* NAS Cause (81-->96) */
1596 { 81, "User Restriction Start Indication"},
1597 { 82, "User Restriction End Indication"},
1598 { 83, "Normal Release"},
1599 /* Protocol Cause (97-->112) */
1600 { 97, "Transfer Syntax Error"},
1601 { 98, "Semantic Error"},
1602 { 99, "Message not compatible with receiver state"},
1603 { 100, "Abstract Syntax Error (Reject)"},
1604 { 101, "Abstract Syntax Error (Ignore and Notify)"},
1605 { 102, "Abstract Syntax Error (Falsely Constructed Message"},
1606 /* Miscellaneous Cause (113-->128) */
1607 { 113, "O & M Intervention"},
1608 { 114, "No Resource Available"},
1609 { 115, "Unspecified Failure"},
1610 { 116, "Network Optimisation"},
1611 /* Non-standard Cause (129-->255) */
1613 /* ranap_CauseRadioNetworkExtension ??
1614 { 257, "iP-multicast-address-and-APN-not-valid" },
1615 { 258, "mBMS-de-registration-rejected-due-to-implicit-registration" },
1616 { 259, "mBMS-request-superseded" },
1617 { 260, "mBMS-de-registration-during-session-not-allowed" },
1618 { 261, "mBMS-no-data-bearer-necessary" },
1621 {0, NULL}
1623 static value_string_ext ranap_cause_type_ext = VALUE_STRING_EXT_INIT(ranap_cause_type);
1625 static const value_string mm_sec_modep[] = {
1626 {0, "Used cipher value, UMTS keys and Quintuplets"},
1627 {1, "GSM key and triplets"},
1628 {2, "UMTS key and quintuplets"},
1629 {3, "GSM key and quintuplets"},
1630 {0, NULL}
1633 static const value_string gtp_cipher_algorithm[] = {
1634 {0, "No ciphering"},
1635 {1, "GEA/1"},
1636 {2, "GEA/2"},
1637 {3, "GEA/3"},
1638 {4, "GEA/4"},
1639 {5, "GEA/5"},
1640 {6, "GEA/6"},
1641 {7, "GEA/7"},
1642 {0, NULL}
1644 static const value_string gtp_ext_rat_type_vals[] = {
1645 {0, "Reserved"},
1646 {1, "UTRAN"},
1647 {2, "GERAN"},
1648 {3, "WLAN"},
1649 {4, "GAN"},
1650 {5, "HSPA Evolution"},
1651 {0, NULL}
1654 #define MM_PROTO_GROUP_CALL_CONTROL 0x00
1655 #define MM_PROTO_BROADCAST_CALL_CONTROL 0x01
1656 #define MM_PROTO_PDSS1 0x02
1657 #define MM_PROTO_CALL_CONTROL 0x03
1658 #define MM_PROTO_PDSS2 0x04
1659 #define MM_PROTO_MM_NON_GPRS 0x05
1660 #define MM_PROTO_RR_MGMT 0x06
1661 #define MM_PROTO_MM_GPRS 0x08
1662 #define MM_PROTO_SMS 0x09
1663 #define MM_PROTO_SESSION_MGMT 0x0A
1664 #define MM_PROTO_NON_CALL_RELATED 0x0B
1666 static const value_string tft_code_type[] = {
1667 {0, "Spare"},
1668 {1, "Create new TFT"},
1669 {2, "Delete existing TFT"},
1670 {3, "Add packet filters to existing TFT"},
1671 {4, "Replace packet filters in existing TFT"},
1672 {5, "Delete packet filters from existing TFT"},
1673 {6, "Reserved"},
1674 {7, "Reserved"},
1675 {0, NULL}
1679 static dissector_handle_t ip_handle;
1680 static dissector_handle_t ipv6_handle;
1681 static dissector_handle_t ppp_handle;
1682 static dissector_handle_t sync_handle;
1683 static dissector_handle_t gtpcdr_handle;
1684 static dissector_handle_t sndcpxid_handle;
1685 static dissector_handle_t gtpv2_handle;
1686 static dissector_handle_t bssgp_handle;
1687 static dissector_table_t bssap_pdu_type_table;
1689 static int decode_gtp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1690 static int decode_gtp_imsi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1691 static int decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1692 static int decode_gtp_tlli(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1693 static int decode_gtp_ptmsi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1694 static int decode_gtp_qos_gprs(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1695 static int decode_gtp_reorder(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1696 static int decode_gtp_auth_tri(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1697 static int decode_gtp_map_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1698 static int decode_gtp_ptmsi_sig(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1699 static int decode_gtp_ms_valid(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1700 static int decode_gtp_recovery(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1701 static int decode_gtp_sel_mode(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1702 static int decode_gtp_16(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1703 static int decode_gtp_17(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1704 static int decode_gtp_18(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1705 static int decode_gtp_19(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1706 static int decode_gtp_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1707 static int decode_gtp_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1708 static int decode_gtp_rab_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1709 static int decode_gtp_rp_sms(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1710 static int decode_gtp_rp(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1711 static int decode_gtp_pkt_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1712 static int decode_gtp_chrg_char(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1713 static int decode_gtp_trace_ref(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1714 static int decode_gtp_trace_type(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1715 static int decode_gtp_ms_reason(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1716 static int decode_gtp_tr_comm(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1717 static int decode_gtp_chrg_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1718 static int decode_gtp_user_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1719 static int decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1720 static int decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1721 static int decode_gtp_apn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1722 static int decode_gtp_gsn_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1723 static int decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1724 static int decode_gtp_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1725 static int decode_gtp_qos_umts(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1726 static int decode_gtp_auth_qui(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1727 static int decode_gtp_tft(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1728 static int decode_gtp_target_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1729 static int decode_gtp_utran_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1730 static int decode_gtp_rab_setup(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1731 static int decode_gtp_hdr_list(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1732 static int decode_gtp_trigger_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1733 static int decode_gtp_omc_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1735 static int decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1736 static int decode_gtp_pdp_cont_prio(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1737 static int decode_gtp_add_rab_setup_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1738 static int decode_gtp_ssgn_no(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1739 static int decode_gtp_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1740 static int decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1741 static int decode_gtp_ra_prio_lcs(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1742 static int decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1743 static int decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1744 static int decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1745 static int decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1746 static int decode_gtp_camel_chg_inf_con(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1747 static int decode_gtp_mbms_ue_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1748 static int decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1749 static int decode_gtp_rim_ra(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1750 static int decode_gtp_mbms_prot_conf_opt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1751 static int decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1752 static int decode_gtp_src_rnc_pdp_ctx_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1753 static int decode_gtp_add_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1754 static int decode_gtp_hop_count(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1755 static int decode_gtp_sel_plmn_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1756 static int decode_gtp_mbms_ses_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1757 static int decode_gtp_mbms_2g_3g_ind(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1758 static int decode_gtp_enh_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1759 static int decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1760 static int decode_gtp_add_mbms_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1761 static int decode_gtp_mbms_ses_id_rep_no(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1762 static int decode_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1763 static int decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1764 static int decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1765 static int decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1766 static int decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1767 static int decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1768 static int decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1769 static int decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1770 static int decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1771 static int decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1772 static int decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1773 static int decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1774 static int decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1775 static int decode_gtp_fqdn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1776 static int decode_gtp_evolved_allc_rtn_p1(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1777 static int decode_gtp_evolved_allc_rtn_p2(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1778 static int decode_gtp_extended_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1779 static int decode_gtp_uci(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1780 static int decode_gtp_csg_inf_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1781 static int decode_gtp_csg_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1782 static int decode_gtp_cmi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1783 static int decode_gtp_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1784 static int decode_gtp_ue_network_cap(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1785 static int decode_gtp_ue_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1786 static int decode_gtp_apn_ambr_with_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1787 static int decode_gtp_ggsn_back_off_time(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1788 static int decode_gtp_sig_pri_ind(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1789 static int decode_gtp_sig_pri_ind_w_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1790 static int decode_gtp_higher_br_16mb_flg(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1791 static int decode_gtp_max_mbr_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1792 static int decode_gtp_add_mm_ctx_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1793 static int decode_gtp_add_flgs_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1794 static int decode_gtp_stn_sr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1795 static int decode_gtp_c_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1796 static int decode_gtp_ext_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1797 static int decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1798 static int decode_gtp_mbms_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1799 static int decode_gtp_mbms_ip_mcast_dist(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1800 static int decode_gtp_mbms_dist_ack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1801 static int decode_gtp_reliable_irat_ho_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1802 static int decode_gtp_rfsp_index(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree);
1804 static int decode_gtp_chrg_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1805 static int decode_gtp_rel_pack(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1806 static int decode_gtp_can_pack(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1807 static int decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1808 static int decode_gtp_data_resp(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1809 static int decode_gtp_node_addr(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1810 static int decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1811 static int decode_gtp_unknown(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree);
1813 typedef struct _gtp_opt {
1814 int optcode;
1815 int (*decode) (tvbuff_t *, int, packet_info *, proto_tree *);
1816 } gtp_opt_t;
1818 static const gtp_opt_t gtpopt[] = {
1819 /* 0x01 */ {GTP_EXT_CAUSE, decode_gtp_cause},
1820 /* 0x02 */ {GTP_EXT_IMSI, decode_gtp_imsi},
1821 /* 0x03 */ {GTP_EXT_RAI, decode_gtp_rai},
1822 /* 0x04 */ {GTP_EXT_TLLI, decode_gtp_tlli},
1823 /* 0x05 */ {GTP_EXT_PTMSI, decode_gtp_ptmsi},
1824 /* 0x06 */ {GTP_EXT_QOS_GPRS, decode_gtp_qos_gprs},
1825 /* 0x07 */
1826 /* 0x08 */ {GTP_EXT_REORDER, decode_gtp_reorder},
1827 /* 0x09 */ {GTP_EXT_AUTH_TRI, decode_gtp_auth_tri},
1828 /* 0x0a */
1829 /* 0x0b */ {GTP_EXT_MAP_CAUSE, decode_gtp_map_cause},
1830 /* 0x0c */ {GTP_EXT_PTMSI_SIG, decode_gtp_ptmsi_sig},
1831 /* 0x0d */ {GTP_EXT_MS_VALID, decode_gtp_ms_valid},
1832 /* 0x0e */ {GTP_EXT_RECOVER, decode_gtp_recovery},
1833 /* 0x0f */ {GTP_EXT_SEL_MODE, decode_gtp_sel_mode},
1834 /* 0x10 */ {GTP_EXT_16, decode_gtp_16},
1835 /* 0x11 */ {GTP_EXT_17, decode_gtp_17},
1836 /* 0x12 */ {GTP_EXT_18, decode_gtp_18},
1837 /* 0x13 */ {GTP_EXT_19, decode_gtp_19},
1838 /* 0x14 */ {GTP_EXT_NSAPI, decode_gtp_nsapi},
1839 /* 0x15 */ {GTP_EXT_RANAP_CAUSE, decode_gtp_ranap_cause},
1840 /* 0x16 */ {GTP_EXT_RAB_CNTXT, decode_gtp_rab_cntxt},
1841 /* 0x17 */ {GTP_EXT_RP_SMS, decode_gtp_rp_sms},
1842 /* 0x18 */ {GTP_EXT_RP, decode_gtp_rp},
1843 /* 0x19 */ {GTP_EXT_PKT_FLOW_ID, decode_gtp_pkt_flow_id},
1844 /* 0x1a */ {GTP_EXT_CHRG_CHAR, decode_gtp_chrg_char},
1845 /* 0x1b */ {GTP_EXT_TRACE_REF, decode_gtp_trace_ref},
1846 /* 0x1c */ {GTP_EXT_TRACE_TYPE, decode_gtp_trace_type},
1847 /* 0x1d */ {GTPv1_EXT_MS_REASON, decode_gtp_ms_reason},
1849 /* 0x7e */ {GTP_EXT_TR_COMM, decode_gtp_tr_comm},
1850 /* 0x7f */ {GTP_EXT_CHRG_ID, decode_gtp_chrg_id},
1851 /* 0x80 */ {GTP_EXT_USER_ADDR, decode_gtp_user_addr},
1852 /* 0x81 */ {GTP_EXT_MM_CNTXT, decode_gtp_mm_cntxt},
1853 /* 0x82 */ {GTP_EXT_PDP_CNTXT, decode_gtp_pdp_cntxt},
1854 /* 0x83 */ {GTP_EXT_APN, decode_gtp_apn},
1855 /* 0x84 */ {GTP_EXT_PROTO_CONF, decode_gtp_proto_conf},
1856 /* 0x85 */ {GTP_EXT_GSN_ADDR, decode_gtp_gsn_addr},
1857 /* 0x86 */ {GTP_EXT_MSISDN, decode_gtp_msisdn},
1858 /* 0x87 */ {GTP_EXT_QOS_UMTS, decode_gtp_qos_umts}, /* 3G */
1859 /* 0x88 */ {GTP_EXT_AUTH_QUI, decode_gtp_auth_qui}, /* 3G */
1860 /* 0x89 */ {GTP_EXT_TFT, decode_gtp_tft}, /* 3G */
1861 /* 0x8a */ {GTP_EXT_TARGET_ID, decode_gtp_target_id}, /* 3G */
1862 /* 0x8b */ {GTP_EXT_UTRAN_CONT, decode_gtp_utran_cont}, /* 3G */
1863 /* 0x8c */ {GTP_EXT_RAB_SETUP, decode_gtp_rab_setup}, /* 3G */
1864 /* 0x8d */ {GTP_EXT_HDR_LIST, decode_gtp_hdr_list}, /* 3G */
1865 /* 0x8e */ {GTP_EXT_TRIGGER_ID, decode_gtp_trigger_id}, /* 3G */
1866 /* 0x8f */ {GTP_EXT_OMC_ID, decode_gtp_omc_id}, /* 3G */
1867 /* TS 29 060 V6.11.0 */
1868 /* 0x90 */ {GTP_EXT_RAN_TR_CONT, decode_gtp_ran_tr_cont}, /* 7.7.43 */
1869 /* 0x91 */ {GTP_EXT_PDP_CONT_PRIO, decode_gtp_pdp_cont_prio}, /* 7.7.45 */
1870 /* 0x92 */ {GTP_EXT_ADD_RAB_SETUP_INF, decode_gtp_add_rab_setup_inf}, /* 7.7.45A */
1871 /* 0x93 */ {GTP_EXT_SSGN_NO, decode_gtp_ssgn_no}, /* 7.7.47 */
1872 /* 0x94 */ {GTP_EXT_COMMON_FLGS, decode_gtp_common_flgs}, /* 7.7.48 */
1873 /* 0x95 */ {GTP_EXT_APN_RES, decode_gtp_apn_res}, /* 3G */
1874 /* 0x96 */ {GTP_EXT_RA_PRIO_LCS, decode_gtp_ra_prio_lcs}, /* 7.7.25B */
1875 /* 0x97 */ {GTP_EXT_RAT_TYPE, decode_gtp_rat_type}, /* 3G */
1876 /* 0x98 */ {GTP_EXT_USR_LOC_INF, decode_gtp_usr_loc_inf}, /* 7.7.51 */
1877 /* 0x99 */ {GTP_EXT_MS_TIME_ZONE, decode_gtp_ms_time_zone}, /* 7.7.52 */
1878 /* 0x9a */ {GTP_EXT_IMEISV, decode_gtp_imeisv}, /* 3G 7.7.53 */
1879 /* 0x9b */ {GTP_EXT_CAMEL_CHG_INF_CON, decode_gtp_camel_chg_inf_con}, /* 7.7.54 */
1880 /* 0x9c */ {GTP_EXT_MBMS_UE_CTX, decode_gtp_mbms_ue_ctx}, /* 7.7.55 */
1881 /* 0x9d */ {GTP_EXT_TMGI, decode_gtp_tmgi}, /* 7.7.56 */
1882 /* 0x9e */ {GTP_EXT_RIM_RA, decode_gtp_rim_ra}, /* 7.7.57 */
1883 /* 0x9f */ {GTP_EXT_MBMS_PROT_CONF_OPT, decode_gtp_mbms_prot_conf_opt}, /* 7.7.58 */
1884 /* 0xa0 */ {GTP_EXT_MBMS_SA, decode_gtp_mbms_sa}, /* 7.7.60 */
1885 /* 0xa1 */ {GTP_EXT_SRC_RNC_PDP_CTX_INF, decode_gtp_src_rnc_pdp_ctx_inf}, /* 7.7.61 */
1886 /* 0xa2 */ {GTP_EXT_ADD_TRS_INF, decode_gtp_add_trs_inf}, /* 7.7.62 */
1887 /* 0xa3 */ {GTP_EXT_HOP_COUNT, decode_gtp_hop_count}, /* 7.7.63 */
1888 /* 0xa4 */ {GTP_EXT_SEL_PLMN_ID, decode_gtp_sel_plmn_id}, /* 7.7.64 */
1889 /* 0xa5 */ {GTP_EXT_MBMS_SES_ID, decode_gtp_mbms_ses_id}, /* 7.7.65 */
1890 /* 0xa6 */ {GTP_EXT_MBMS_2G_3G_IND, decode_gtp_mbms_2g_3g_ind}, /* 7.7.66 */
1891 /* 0xa7 */ {GTP_EXT_ENH_NSAPI, decode_gtp_enh_nsapi}, /* 7.7.67 */
1892 /* 0xa8 */ {GTP_EXT_MBMS_SES_DUR, decode_gtp_mbms_ses_dur}, /* 7.7.59 */
1893 /* 0xa9 */ {GTP_EXT_ADD_MBMS_TRS_INF, decode_gtp_add_mbms_trs_inf}, /* 7.7.68 */
1894 /* 0xaa */ {GTP_EXT_MBMS_SES_ID_REP_NO, decode_gtp_mbms_ses_id_rep_no}, /* 7.7.69 */
1895 /* 0xab */ {GTP_EXT_MBMS_TIME_TO_DATA_TR, decode_gtp_mbms_time_to_data_tr}, /* 7.7.70 */
1896 /* 0xac */ {GTP_EXT_PS_HO_REQ_CTX, decode_gtp_ps_ho_req_ctx}, /* 7.7.71 */
1897 /* 0xad */ {GTP_EXT_BSS_CONT, decode_gtp_bss_cont}, /* 7.7.72 */
1898 /* 0xae */ {GTP_EXT_CELL_ID, decode_gtp_cell_id}, /* 7.7.73 */
1899 /* 0xaf */ {GTP_EXT_PDU_NO, decode_gtp_pdu_no}, /* 7.7.74 */
1900 /* 0xb0 */ {GTP_EXT_BSSGP_CAUSE, decode_gtp_bssgp_cause}, /* 7.7.75 */
1901 /* 0xb1 */ {GTP_EXT_REQ_MBMS_BEARER_CAP, decode_gtp_mbms_bearer_cap}, /* 7.7.76 */
1902 /* 0xb2 */ {GTP_EXT_RIM_ROUTING_ADDR_DISC, decode_gtp_rim_ra_disc}, /* 7.7.77 */
1903 /* 0xb3 */ {GTP_EXT_LIST_OF_SETUP_PFCS, decode_gtp_lst_set_up_pfc}, /* 7.7.78 */
1904 /* 0xb4 */ {GTP_EXT_PS_HANDOVER_XIP_PAR, decode_gtp_ps_handover_xid}, /* 7.7.79 */
1905 /* 0xb5 */ {GTP_EXT_MS_INF_CHG_REP_ACT, decode_gtp_ms_inf_chg_rep_act}, /* 7.7.80 */
1906 /* 0xb6 */ {GTP_EXT_DIRECT_TUNNEL_FLGS, decode_gtp_direct_tnl_flg}, /* 7.7.81 */
1907 /* 0xb7 */ {GTP_EXT_CORRELATION_ID, decode_gtp_corrl_id}, /* 7.7.82 */
1908 /* 0xb8 */ {GTP_EXT_BEARER_CONTROL_MODE, decode_gtp_bearer_cntrl_mod}, /* 7.7.83 */
1909 /* 0xb9 */ {GTP_EXT_MBMS_FLOW_ID, decode_gtp_mbms_flow_id}, /* 7.7.84 */
1910 /* 0xba */ {GTP_EXT_MBMS_IP_MCAST_DIST, decode_gtp_mbms_ip_mcast_dist}, /* 7.7.85 */
1911 /* 0xba */ {GTP_EXT_MBMS_DIST_ACK, decode_gtp_mbms_dist_ack}, /* 7.7.86 */
1912 /* 0xbc */ {GTP_EXT_RELIABLE_IRAT_HO_INF, decode_gtp_reliable_irat_ho_inf}, /* 7.7.87 */
1913 /* 0xbd */ {GTP_EXT_RFSP_INDEX, decode_gtp_rfsp_index}, /* 7.7.87 */
1915 /* 0xbe */ {GTP_EXT_FQDN, decode_gtp_fqdn}, /* 7.7.90 */
1916 /* 0xbf */ {GTP_EXT_EVO_ALLO_RETE_P1, decode_gtp_evolved_allc_rtn_p1}, /* 7.7.91 */
1917 /* 0xc0 */ {GTP_EXT_EVO_ALLO_RETE_P2, decode_gtp_evolved_allc_rtn_p2}, /* 7.7.92 */
1918 /* 0xc1 */ {GTP_EXT_EXTENDED_COMMON_FLGS, decode_gtp_extended_common_flgs}, /* 7.7.93 */
1919 /* 0xc2 */ {GTP_EXT_UCI, decode_gtp_uci}, /* 7.7.94 */
1920 /* 0xc3 */ {GTP_EXT_CSG_INF_REP_ACT, decode_gtp_csg_inf_rep_act}, /* 7.7.95 */
1921 /* 0xc4 */ {GTP_EXT_CSG_ID, decode_gtp_csg_id}, /* 7.7.96 */
1922 /* 0xc5 */ {GTP_EXT_CMI, decode_gtp_cmi}, /* 7.7.97 */
1923 /* 0xc6 */ {GTP_EXT_AMBR, decode_gtp_apn_ambr}, /* 7.7.98 */
1924 /* 0xc7 */ {GTP_EXT_UE_NETWORK_CAP, decode_gtp_ue_network_cap}, /* 7.7.99 */
1925 /* 0xc8 */ {GTP_EXT_UE_AMBR, decode_gtp_ue_ambr}, /* 7.7.100 */
1926 /* 0xc9 */ {GTP_EXT_APN_AMBR_WITH_NSAPI, decode_gtp_apn_ambr_with_nsapi}, /* 7.7.101 */
1927 /* 0xCA */ {GTP_EXT_GGSN_BACK_OFF_TIME, decode_gtp_ggsn_back_off_time}, /* 7.7.102 */
1928 /* 0xCB */ {GTP_EXT_SIG_PRI_IND, decode_gtp_sig_pri_ind}, /* 7.7.103 */
1929 /* 0xCC */ {GTP_EXT_SIG_PRI_IND_W_NSAPI, decode_gtp_sig_pri_ind_w_nsapi}, /* 7.7.104 */
1930 /* 0xCD */ {GTP_EXT_HIGHER_BR_16MB_FLG, decode_gtp_higher_br_16mb_flg}, /* 7.7.105 */
1931 /* 0xCE */ {GTP_EXT_MAX_MBR_APN_AMBR, decode_gtp_max_mbr_apn_ambr}, /* 7.7.106 */
1932 /* 0xCF */ {GTP_EXT_ADD_MM_CTX_SRVCC, decode_gtp_add_mm_ctx_srvcc}, /* 7.7.107 */
1933 /* 0xD0 */ {GTP_EXT_ADD_FLGS_SRVCC, decode_gtp_add_flgs_srvcc}, /* 7.7.108 */
1934 /* 0xD1 */ {GTP_EXT_STN_SR, decode_gtp_stn_sr}, /* 7.7.109 */
1935 /* 0xD2 */ {GTP_EXT_C_MSISDN, decode_gtp_c_msisdn}, /* 7.7.110 */
1936 /* 0xD3 */ {GTP_EXT_EXT_RANAP_CAUSE, decode_gtp_ext_ranap_cause}, /* 7.7.111 */
1938 /* 0xf9 */ {GTP_EXT_REL_PACK, decode_gtp_rel_pack}, /* charging */
1939 /* 0xfa */ {GTP_EXT_CAN_PACK, decode_gtp_can_pack}, /* charging */
1940 /* 0xfb */ {GTP_EXT_CHRG_ADDR, decode_gtp_chrg_addr},
1942 /* 0xfc */ {GTP_EXT_DATA_REQ, decode_gtp_data_req}, /* charging */
1943 /* 0xfd */ {GTP_EXT_DATA_RESP, decode_gtp_data_resp}, /* charging */
1944 /* 0xfe */ {GTP_EXT_NODE_ADDR, decode_gtp_node_addr},
1945 /* 0xff */ {GTP_EXT_PRIV_EXT, decode_gtp_priv_ext},
1946 {0, decode_gtp_unknown}
1949 #define NUM_GTP_IES 255
1950 static gint ett_gtp_ies[NUM_GTP_IES];
1952 /*struct _gtp_hdr {
1953 guint8 flags;
1954 guint8 message;
1955 guint16 length;
1956 };*/
1958 static guint8 gtp_version = 0;
1959 static const char *yesno[] = { "no", "yes" };
1961 #define BCD2CHAR(d) ((d) | 0x30)
1963 static gchar *
1964 id_to_str(tvbuff_t *tvb, gint offset)
1966 static gchar str[17] = " ";
1967 guint8 bits8to5, bits4to1;
1968 int i, j;
1969 guint8 ad;
1971 for (i = j = 0; i < 8; i++) {
1972 ad = tvb_get_guint8(tvb, offset + i);
1973 bits8to5 = hi_nibble(ad);
1974 bits4to1 = lo_nibble(ad);
1975 if (bits4to1 <= 9)
1976 str[j++] = BCD2CHAR(bits4to1);
1977 else
1978 str[j++] = ' ';
1979 if (bits8to5 <= 9)
1980 str[j++] = BCD2CHAR(bits8to5);
1981 else
1982 str[j++] = ' ';
1984 str[j] = '\0';
1985 return str;
1989 /* Next definitions and function check_field_presence checks if given field
1990 * in GTP packet is compliant with ETSI
1992 typedef struct _header {
1993 guint8 code;
1994 guint8 presence;
1995 } ext_header;
1997 typedef struct _message {
1998 guint8 code;
1999 ext_header fields[32];
2000 } _gtp_mess_items;
2002 /* ---------------------
2003 * GPRS messages
2004 * ---------------------*/
2005 static _gtp_mess_items gprs_mess_items[] = {
2008 GTP_MSG_ECHO_REQ, {
2009 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2010 {0, 0}
2014 GTP_MSG_ECHO_RESP, {
2015 {GTP_EXT_RECOVER, GTP_MANDATORY},
2016 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2017 {0, 0}
2021 GTP_MSG_VER_NOT_SUPP, {
2022 {0, 0}
2026 GTP_MSG_NODE_ALIVE_REQ, {
2027 {GTP_EXT_NODE_ADDR, GTP_MANDATORY},
2028 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2029 {0, 0}
2033 GTP_MSG_NODE_ALIVE_RESP, {
2034 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2035 {0, 0}
2039 GTP_MSG_REDIR_REQ, {
2040 {GTP_EXT_CAUSE, GTP_MANDATORY},
2041 {GTP_EXT_NODE_ADDR, GTP_OPTIONAL},
2042 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2043 {0, 0}
2047 GTP_MSG_REDIR_RESP, {
2048 {GTP_EXT_CAUSE, GTP_MANDATORY},
2049 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2050 {0, 0}
2054 GTP_MSG_CREATE_PDP_REQ, {
2055 {GTP_EXT_QOS_GPRS, GTP_MANDATORY},
2056 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2057 {GTP_EXT_SEL_MODE, GTP_MANDATORY},
2058 {GTP_EXT_FLOW_LABEL, GTP_MANDATORY},
2059 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2060 {GTP_EXT_MSISDN, GTP_MANDATORY},
2061 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2062 {GTP_EXT_APN, GTP_MANDATORY},
2063 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2064 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2065 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2066 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2067 {0, 0}
2071 GTP_MSG_CREATE_PDP_RESP, {
2072 {GTP_EXT_CAUSE, GTP_MANDATORY},
2073 {GTP_EXT_QOS_GPRS, GTP_CONDITIONAL},
2074 {GTP_EXT_REORDER, GTP_CONDITIONAL},
2075 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2076 {GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL},
2077 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2078 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2079 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2080 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2081 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2082 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2083 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2084 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2085 {0, 0}
2089 GTP_MSG_UPDATE_PDP_REQ, {
2090 {GTP_EXT_QOS_GPRS, GTP_MANDATORY},
2091 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2092 {GTP_EXT_FLOW_LABEL, GTP_MANDATORY},
2093 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2094 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2095 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2096 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2097 {0, 0},
2101 GTP_MSG_UPDATE_PDP_RESP, {
2102 {GTP_EXT_CAUSE, GTP_MANDATORY},
2103 {GTP_EXT_QOS_GPRS, GTP_CONDITIONAL},
2104 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2105 {GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL},
2106 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2107 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2108 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2109 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2110 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2111 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2112 {0, 0}
2116 GTP_MSG_DELETE_PDP_REQ, {
2117 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2118 {0, 0}
2122 GTP_MSG_DELETE_PDP_RESP, {
2123 {GTP_EXT_CAUSE, GTP_MANDATORY},
2124 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2125 {0, 0},
2129 GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ, {
2130 {GTP_EXT_QOS_GPRS, GTP_MANDATORY},
2131 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2132 {GTP_EXT_SEL_MODE, GTP_MANDATORY},
2133 {GTP_EXT_FLOW_LABEL, GTP_MANDATORY},
2134 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2135 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2136 {GTP_EXT_APN, GTP_MANDATORY},
2137 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2138 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2139 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2140 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2141 {0, 0}
2145 GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP, {
2146 {GTP_EXT_CAUSE, GTP_MANDATORY},
2147 {GTP_EXT_QOS_GPRS, GTP_CONDITIONAL},
2148 {GTP_EXT_REORDER, GTP_CONDITIONAL},
2149 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2150 {GTP_EXT_FLOW_LABEL, GTP_CONDITIONAL},
2151 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2152 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2153 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2154 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2155 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2156 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2157 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2158 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2159 {0, 0}
2163 GTP_MSG_DELETE_AA_PDP_REQ, {
2164 {GTP_EXT_CAUSE, GTP_MANDATORY},
2165 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2166 {0, 0}
2170 GTP_MSG_DELETE_AA_PDP_RESP, {
2171 {GTP_EXT_CAUSE, GTP_MANDATORY},
2172 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2173 {0, 0}
2177 GTP_MSG_ERR_IND, {
2178 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2179 {0, 0}
2183 GTP_MSG_PDU_NOTIFY_REQ, {
2184 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2185 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2186 {0, 0}
2190 GTP_MSG_PDU_NOTIFY_RESP, {
2191 {GTP_EXT_CAUSE, GTP_MANDATORY},
2192 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2193 {0, 0}
2197 GTP_MSG_PDU_NOTIFY_REJ_REQ, {
2198 {GTP_EXT_CAUSE, GTP_MANDATORY},
2199 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2200 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2201 {0, 0}
2205 GTP_MSG_PDU_NOTIFY_REJ_RESP, {
2206 {GTP_EXT_CAUSE, GTP_MANDATORY},
2207 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2208 {0, 0}
2212 GTP_MSG_SEND_ROUT_INFO_REQ, {
2213 {GTP_EXT_IMSI, GTP_MANDATORY},
2214 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2215 {0, 0}
2219 GTP_MSG_SEND_ROUT_INFO_RESP, {
2220 {GTP_EXT_CAUSE, GTP_MANDATORY},
2221 {GTP_EXT_IMSI, GTP_MANDATORY},
2222 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2223 {GTP_EXT_MS_REASON, GTP_OPTIONAL},
2224 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL},
2225 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2226 {0, 0}
2230 GTP_MSG_FAIL_REP_REQ, {
2231 {GTP_EXT_IMSI, GTP_MANDATORY},
2232 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2233 {0, 0}
2237 GTP_MSG_FAIL_REP_RESP, {
2238 {GTP_EXT_CAUSE, GTP_MANDATORY},
2239 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2240 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2241 {0, 0}
2245 GTP_MSG_MS_PRESENT_REQ, {
2246 {GTP_EXT_IMSI, GTP_MANDATORY},
2247 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2248 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2249 {0, 0}
2253 GTP_MSG_MS_PRESENT_RESP, {
2254 {GTP_EXT_CAUSE, GTP_MANDATORY},
2255 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2256 {0, 0}
2260 GTP_MSG_IDENT_REQ, {
2261 {GTP_EXT_RAI, GTP_MANDATORY},
2262 {GTP_EXT_PTMSI, GTP_MANDATORY},
2263 {GTP_EXT_PTMSI_SIG, GTP_OPTIONAL},
2264 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2265 {0, 0}
2269 GTP_MSG_IDENT_RESP, {
2270 {GTP_EXT_CAUSE, GTP_MANDATORY},
2271 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2272 {GTP_EXT_AUTH_TRI, GTP_OPTIONAL},
2273 {GTP_EXT_AUTH_QUI, GTP_OPTIONAL},
2274 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2275 {0, 0}
2279 GTP_MSG_SGSN_CNTXT_REQ, {
2280 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2281 {GTP_EXT_RAI, GTP_MANDATORY},
2282 {GTP_EXT_TLLI, GTP_MANDATORY},
2283 {GTP_EXT_PTMSI_SIG, GTP_OPTIONAL},
2284 {GTP_EXT_MS_VALID, GTP_OPTIONAL},
2285 {GTP_EXT_FLOW_SIG, GTP_MANDATORY},
2286 {0, 0}
2290 GTP_MSG_SGSN_CNTXT_RESP, {
2291 {GTP_EXT_CAUSE, GTP_MANDATORY},
2292 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2293 {GTP_EXT_FLOW_SIG, GTP_CONDITIONAL},
2294 {GTP_EXT_MM_CNTXT, GTP_CONDITIONAL},
2295 {GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL},
2296 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2297 {0, 0}
2301 GTP_MSG_SGSN_CNTXT_ACK, {
2302 {GTP_EXT_CAUSE, GTP_MANDATORY},
2303 {GTP_EXT_FLOW_II, GTP_CONDITIONAL},
2304 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2305 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2306 {0, 0}
2310 GTP_MSG_DATA_TRANSF_REQ, {
2311 {GTP_EXT_TR_COMM, GTP_MANDATORY},
2312 {GTP_EXT_DATA_REQ, GTP_CONDITIONAL},
2313 {GTP_EXT_REL_PACK, GTP_CONDITIONAL},
2314 {GTP_EXT_CAN_PACK, GTP_CONDITIONAL},
2315 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2316 {0, 0}
2320 GTP_MSG_DATA_TRANSF_RESP, {
2321 {GTP_EXT_CAUSE, GTP_MANDATORY},
2322 {GTP_EXT_DATA_RESP, GTP_MANDATORY},
2323 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2324 {0, 0}
2328 0, {
2329 {0, 0}
2334 /* -----------------------------
2335 * UMTS messages
2336 * -----------------------------*/
2337 static _gtp_mess_items umts_mess_items[] = {
2338 /* 7.2 Path Management Messages */
2340 GTP_MSG_ECHO_REQ, {
2341 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2342 {0, 0}
2346 GTP_MSG_ECHO_RESP, {
2347 {GTP_EXT_RECOVER, GTP_MANDATORY},
2348 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2349 {0, 0}
2353 GTP_MSG_VER_NOT_SUPP, {
2354 {0, 0}
2358 GTP_MSG_SUPP_EXT_HDR, {
2359 {GTP_EXT_HDR_LIST, GTP_MANDATORY},
2360 {0, 0}
2363 /* ??? */
2365 GTP_MSG_NODE_ALIVE_REQ, {
2366 {GTP_EXT_NODE_ADDR, GTP_MANDATORY},
2367 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2368 {0, 0}
2372 GTP_MSG_NODE_ALIVE_RESP, {
2373 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2374 {0, 0}
2378 GTP_MSG_REDIR_REQ, {
2379 {GTP_EXT_CAUSE, GTP_MANDATORY},
2380 {GTP_EXT_NODE_ADDR, GTP_OPTIONAL},
2381 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2382 {0, 0}
2386 GTP_MSG_REDIR_REQ, {
2387 {0, 0}
2390 /* 7.3 Tunnel Management Messages */
2392 GTP_MSG_CREATE_PDP_REQ, {
2393 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2394 /* RAI is in TS 29.060 V6.11.0 */
2395 {GTP_EXT_RAI, GTP_OPTIONAL}, /* Routeing Area Identity (RAI) Optional 7.7.3 */
2396 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2397 {GTP_EXT_SEL_MODE, GTP_CONDITIONAL},
2398 {GTP_EXT_TEID, GTP_MANDATORY},
2399 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2400 {GTP_EXT_NSAPI, GTP_MANDATORY},
2401 {GTP_EXT_NSAPI, GTP_CONDITIONAL},
2402 {GTP_EXT_CHRG_CHAR, GTP_OPTIONAL},
2403 {GTP_EXT_TRACE_REF, GTP_OPTIONAL},
2404 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL},
2405 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2406 {GTP_EXT_APN, GTP_CONDITIONAL},
2407 {GTP_EXT_PROTO_CONF, GTP_CONDITIONAL},
2408 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2409 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2410 {GTP_EXT_MSISDN, GTP_CONDITIONAL},
2411 {GTP_EXT_QOS_UMTS, GTP_MANDATORY},
2412 {GTP_EXT_TFT, GTP_CONDITIONAL},
2413 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL},
2414 {GTP_EXT_OMC_ID, GTP_OPTIONAL},
2415 /* TS 29.060 V6.11.0 */
2416 {GTP_EXT_APN_RES, GTP_OPTIONAL},
2417 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL},
2418 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL},
2419 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL},
2420 {GTP_EXT_IMEISV, GTP_OPTIONAL},
2421 {GTP_EXT_CAMEL_CHG_INF_CON, GTP_OPTIONAL},
2422 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL},
2423 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2424 {0, 0}
2428 GTP_MSG_CREATE_PDP_RESP, {
2429 {GTP_EXT_CAUSE, GTP_MANDATORY},
2430 {GTP_EXT_REORDER, GTP_CONDITIONAL},
2431 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2432 {GTP_EXT_TEID, GTP_CONDITIONAL},
2433 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2434 {GTP_EXT_NSAPI, GTP_CONDITIONAL},
2435 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2436 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL},
2437 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL},
2438 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2439 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2440 {GTP_EXT_QOS_UMTS, GTP_CONDITIONAL},
2441 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2442 /* TS 29.060 V6.11.0 */
2443 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
2444 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Optional 7.7.48 */
2445 {GTP_EXT_APN_RES, GTP_OPTIONAL}, /* APN Restriction Optional 7.7.49 */
2446 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2447 {0, 0}
2450 { /* checked, SGSN -> GGSN */
2451 GTP_MSG_UPDATE_PDP_REQ, {
2452 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2453 {GTP_EXT_RAI, GTP_OPTIONAL}, /* Routeing Area Identity (RAI) Optional 7.7.3 */
2454 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2455 {GTP_EXT_TEID, GTP_MANDATORY},
2456 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2457 {GTP_EXT_NSAPI, GTP_MANDATORY},
2458 {GTP_EXT_TRACE_REF, GTP_OPTIONAL},
2459 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL},
2460 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2461 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for Control Plane Mandatory GSN Address 7.7.32 */
2462 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for User Traffic Mandatory GSN Address 7.7.32 */
2463 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2464 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for User Traffic Conditional GSN Address 7.7.32 */
2465 {GTP_EXT_QOS_UMTS, GTP_MANDATORY},
2466 {GTP_EXT_TFT, GTP_OPTIONAL},
2467 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL},
2468 {GTP_EXT_OMC_ID, GTP_OPTIONAL},
2469 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Optional 7.7.48 */
2470 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL}, /* RAT Type Optional 7.7.50 */
2471 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL}, /* User Location Information Optional 7.7.51 */
2472 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL}, /* MS Time Zone Optional 7.7.52 */
2473 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL}, /* Additonal Trace Info Optional 7.7.62 */
2474 {GTP_EXT_DIRECT_TUNNEL_FLGS, GTP_OPTIONAL}, /* Direct Tunnel Flags 7.7.81 */
2475 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2476 {0, 0}
2479 { /* checked, GGSN -> SGSN */
2480 GTP_MSG_UPDATE_PDP_RESP, {
2481 {GTP_EXT_CAUSE, GTP_MANDATORY},
2482 {GTP_EXT_RECOVER, GTP_OPTIONAL},
2483 {GTP_EXT_TEID, GTP_CONDITIONAL},
2484 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2485 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL},
2486 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2487 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2488 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2489 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2490 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for User Traffic Conditional GSN Address 7.7.32 */
2491 {GTP_EXT_QOS_UMTS, GTP_CONDITIONAL},
2492 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL},
2493 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
2494 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2495 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Optional 7.7.48 */
2496 {GTP_EXT_APN_RES, GTP_OPTIONAL}, /* APN Restriction Optional 7.7.49 */
2497 {0, 0}
2501 GTP_MSG_DELETE_PDP_REQ, {
2502 {GTP_EXT_TEAR_IND, GTP_CONDITIONAL},
2503 {GTP_EXT_NSAPI, GTP_MANDATORY},
2504 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2505 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2506 {0, 0}
2510 GTP_MSG_DELETE_PDP_RESP, {
2511 {GTP_EXT_CAUSE, GTP_MANDATORY},
2512 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2513 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2514 {0, 0}
2518 GTP_MSG_ERR_IND, {
2519 {GTP_EXT_TEID, GTP_MANDATORY},
2520 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* GSN Address Mandatory 7.7.32 */
2521 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2522 {0, 0}
2526 GTP_MSG_PDU_NOTIFY_REQ, {
2527 {GTP_EXT_IMSI, GTP_MANDATORY},
2528 {GTP_EXT_TEID_CP, GTP_MANDATORY},
2529 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2530 {GTP_EXT_APN, GTP_MANDATORY},
2531 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2532 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2533 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2534 {0, 0}
2538 GTP_MSG_PDU_NOTIFY_RESP, {
2539 {GTP_EXT_CAUSE, GTP_MANDATORY},
2540 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2541 {0, 0}
2545 GTP_MSG_PDU_NOTIFY_REJ_REQ, {
2546 {GTP_EXT_CAUSE, GTP_MANDATORY},
2547 {GTP_EXT_TEID_CP, GTP_MANDATORY},
2548 {GTP_EXT_USER_ADDR, GTP_MANDATORY},
2549 {GTP_EXT_APN, GTP_MANDATORY},
2550 {GTP_EXT_PROTO_CONF, GTP_OPTIONAL}, /* Protocol Configuration Options Optional 7.7.31 */
2551 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2552 {0, 0}
2556 GTP_MSG_PDU_NOTIFY_REJ_RESP, {
2557 {GTP_EXT_CAUSE, GTP_MANDATORY},
2558 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2559 {0, 0}
2562 /* 7.4 Location Management Messages */
2564 GTP_MSG_SEND_ROUT_INFO_REQ, {
2565 {GTP_EXT_IMSI, GTP_MANDATORY},
2566 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2567 {0, 0}
2571 GTP_MSG_SEND_ROUT_INFO_RESP, {
2572 {GTP_EXT_CAUSE, GTP_MANDATORY},
2573 {GTP_EXT_IMSI, GTP_MANDATORY},
2574 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2575 {GTPv1_EXT_MS_REASON, GTP_OPTIONAL},
2576 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL},
2577 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2578 {0, 0}
2582 GTP_MSG_FAIL_REP_REQ, {
2583 {GTP_EXT_IMSI, GTP_MANDATORY},
2584 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2585 {0, 0}
2589 GTP_MSG_FAIL_REP_RESP, {
2590 {GTP_EXT_CAUSE, GTP_MANDATORY},
2591 {GTP_EXT_MAP_CAUSE, GTP_OPTIONAL},
2592 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2593 {0, 0}
2597 GTP_MSG_MS_PRESENT_REQ, {
2598 {GTP_EXT_IMSI, GTP_MANDATORY},
2599 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2600 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2601 {0, 0}
2605 GTP_MSG_MS_PRESENT_RESP, {
2606 {GTP_EXT_CAUSE, GTP_MANDATORY},
2607 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2608 {0, 0}
2611 /* 7.5 Mobility Management Messages */
2613 GTP_MSG_IDENT_REQ, {
2614 {GTP_EXT_RAI, GTP_MANDATORY},
2615 {GTP_EXT_PTMSI, GTP_MANDATORY},
2616 {GTP_EXT_PTMSI_SIG, GTP_CONDITIONAL},
2617 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* SGSN Address for Control Plane Optional 7.7.32 */
2618 {GTP_EXT_HOP_COUNT, GTP_OPTIONAL}, /* Hop Counter Optional 7.7.63 */
2619 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2620 {0, 0}
2624 GTP_MSG_IDENT_RESP, {
2625 {GTP_EXT_CAUSE, GTP_MANDATORY},
2626 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2627 {GTP_EXT_AUTH_TRI, GTP_CONDITIONAL},
2628 {GTP_EXT_AUTH_QUI, GTP_CONDITIONAL},
2629 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2630 {0, 0}
2634 GTP_MSG_SGSN_CNTXT_REQ, {
2635 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2636 {GTP_EXT_RAI, GTP_MANDATORY},
2637 {GTP_EXT_TLLI, GTP_CONDITIONAL},
2638 {GTP_EXT_PTMSI, GTP_CONDITIONAL},
2639 {GTP_EXT_PTMSI_SIG, GTP_CONDITIONAL},
2640 {GTP_EXT_MS_VALID, GTP_OPTIONAL},
2641 {GTP_EXT_TEID_CP, GTP_MANDATORY},
2642 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2643 {GTP_EXT_GSN_ADDR, GTP_OPTIONAL}, /* Alternative SGSN Address for Control Plane Optional 7.7.32 */
2644 {GTP_EXT_SSGN_NO, GTP_OPTIONAL}, /* SGSN Number Optional 7.7.47 */
2645 {GTP_EXT_HOP_COUNT, GTP_OPTIONAL}, /* Hop Counter Optional 7.7.63 */
2646 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2647 {0, 0}
2651 GTP_MSG_SGSN_CNTXT_RESP, {
2652 {GTP_EXT_CAUSE, GTP_MANDATORY},
2653 {GTP_EXT_IMSI, GTP_CONDITIONAL},
2654 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2655 {GTP_EXT_RAB_CNTXT, GTP_CONDITIONAL}, /* RAB Context Conditional 7.7.19 */
2656 {GTP_EXT_RP_SMS, GTP_OPTIONAL},
2657 {GTP_EXT_RP, GTP_OPTIONAL},
2658 {GTP_EXT_PKT_FLOW_ID, GTP_OPTIONAL},
2659 {GTP_EXT_CHRG_CHAR, GTP_OPTIONAL}, /* CharingCharacteristics Optional 7.7.23 */
2660 {GTP_EXT_RA_PRIO_LCS, GTP_OPTIONAL}, /* Radio Priority LCS Optional 7.7.25B */
2661 {GTP_EXT_MM_CNTXT, GTP_CONDITIONAL},
2662 {GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL},
2663 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2664 {GTP_EXT_PDP_CONT_PRIO, GTP_OPTIONAL}, /* PDP Context Prioritization Optional 7.7.45 */
2665 {GTP_EXT_MBMS_UE_CTX, GTP_OPTIONAL}, /* MBMS UE Context Optional 7.7.55 */
2666 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2667 {0, 0}
2671 GTP_MSG_SGSN_CNTXT_ACK, {
2672 {GTP_EXT_CAUSE, GTP_MANDATORY},
2673 {GTP_EXT_TEID_II, GTP_CONDITIONAL},
2674 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2675 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2676 {0, 0}
2680 GTP_MSG_FORW_RELOC_REQ, {
2681 {GTP_EXT_IMSI, GTP_MANDATORY},
2682 {GTP_EXT_TEID_CP, GTP_MANDATORY},
2683 {GTP_EXT_RANAP_CAUSE, GTP_MANDATORY},
2684 {GTP_EXT_CHRG_CHAR, GTP_OPTIONAL}, /* CharingCharacteristics Optional 7.7.23 */
2685 {GTP_EXT_MM_CNTXT, GTP_MANDATORY},
2686 {GTP_EXT_PDP_CNTXT, GTP_CONDITIONAL},
2687 {GTP_EXT_GSN_ADDR, GTP_MANDATORY},
2688 {GTP_EXT_TARGET_ID, GTP_MANDATORY},
2689 {GTP_EXT_UTRAN_CONT, GTP_MANDATORY},
2690 {GTP_EXT_PDP_CONT_PRIO, GTP_OPTIONAL}, /* PDP Context Prioritization Optional 7.7.45 */
2691 {GTP_EXT_MBMS_UE_CTX, GTP_OPTIONAL}, /* MBMS UE Context Optional 7.7.55 */
2692 {GTP_EXT_SEL_PLMN_ID, GTP_OPTIONAL}, /* Selected PLMN ID Optional 7.7.64 */
2693 {GTP_EXT_PS_HO_REQ_CTX, GTP_OPTIONAL}, /* PS Handover Request Context Optional 7.7.71 */
2694 {GTP_EXT_BSS_CONT, GTP_OPTIONAL}, /* BSS Container Optional 7.7.72 */
2695 {GTP_EXT_CELL_ID, GTP_OPTIONAL}, /* Cell Identification Optional 7.7.73 */
2696 {GTP_EXT_BSSGP_CAUSE, GTP_OPTIONAL}, /* BSSGP Cause Optional 7.7.75 */
2697 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2698 {GTP_EXT_SSGN_NO, GTP_OPTIONAL},
2699 {0, 0}
2703 GTP_MSG_FORW_RELOC_RESP, {
2704 {GTP_EXT_CAUSE, GTP_MANDATORY},
2705 {GTP_EXT_TEID_CP, GTP_CONDITIONAL},
2706 {GTP_EXT_TEID_II, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Data II Optional 7.7.15 */
2707 {GTP_EXT_RANAP_CAUSE, GTP_CONDITIONAL},
2708 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL},
2709 {GTP_EXT_UTRAN_CONT, GTP_OPTIONAL},
2710 {GTP_EXT_RAB_SETUP, GTP_CONDITIONAL},
2711 {GTP_EXT_ADD_RAB_SETUP_INF, GTP_CONDITIONAL}, /* Additional RAB Setup Information Conditional 7.7.45A */
2712 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2713 {0, 0}
2717 GTP_MSG_FORW_RELOC_COMP, {
2718 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2719 {0, 0}
2723 GTP_MSG_RELOC_CANCEL_REQ, {
2724 {GTP_EXT_IMSI, GTP_MANDATORY},
2725 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2726 {0, 0}
2730 GTP_MSG_RELOC_CANCEL_RESP, {
2731 {GTP_EXT_CAUSE, GTP_MANDATORY},
2732 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2733 {0, 0}
2737 GTP_MSG_FORW_RELOC_ACK, {
2738 {GTP_EXT_CAUSE, GTP_MANDATORY},
2739 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2740 {0, 0}
2744 GTP_MSG_FORW_SRNS_CNTXT_ACK, {
2745 {GTP_EXT_CAUSE, GTP_MANDATORY},
2746 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2747 {0, 0}
2751 GTP_MSG_FORW_SRNS_CNTXT, {
2752 {GTP_EXT_RAB_CNTXT, GTP_MANDATORY},
2753 {GTP_EXT_SRC_RNC_PDP_CTX_INF, GTP_OPTIONAL}, /* Source RNC PDCP context info Optional 7.7.61 */
2754 {GTP_EXT_PDU_NO, GTP_OPTIONAL}, /* PDU Numbers Optional 7.7.74 */
2755 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2756 {0, 0}
2760 /* 7.5.14 RAN Information Management Messages */
2762 GTP_MSG_RAN_INFO_RELAY, {
2763 {GTP_EXT_RAN_TR_CONT, GTP_MANDATORY}, /* RAN Transparent Container Mandatory 7.7.43 */
2764 {GTP_EXT_RIM_RA, GTP_OPTIONAL}, /* RIM Routing Address Optional 7.7.57 */
2765 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2766 {0, 0}
2769 /* 7.5A MBMS Messages
2770 * 7.5A.1 UE Specific MBMS Messages
2773 GTP_MBMS_NOTIFY_REQ, {
2774 {GTP_EXT_IMSI, GTP_MANDATORY}, /* IMSI Mandatory 7.7.2 */
2775 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Mandatory 7.7.14 */
2776 {GTP_EXT_NSAPI, GTP_MANDATORY}, /* NSAPI Mandatory 7.7.17 */
2777 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
2778 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
2779 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* GGSN Address for Control Plane Mandatory 7.7.32 */
2780 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2781 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2782 {0, 0}
2786 GTP_MBMS_NOTIFY_RES, {
2787 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2788 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2789 {0, 0}
2793 GTP_MBMS_NOTIFY_REJ_REQ, {
2794 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2795 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Mandatory 7.7.14 */
2796 {GTP_EXT_NSAPI, GTP_MANDATORY}, /* NSAPI Mandatory 7.7.17 */
2797 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
2798 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
2799 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2800 {0, 0}
2804 GTP_MBMS_NOTIFY_REJ_RES, {
2805 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2806 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2807 {0, 0}
2811 GTP_CREATE_MBMS_CNTXT_REQ, {
2812 {GTP_EXT_IMSI, GTP_CONDITIONAL}, /* IMSI Conditional 7.7.2 */
2813 {GTP_EXT_RAI, GTP_MANDATORY}, /* Routeing Area Identity (RAI) Mandatory 7.7.3 */
2814 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
2815 {GTP_EXT_SEL_MODE, GTP_CONDITIONAL}, /* Selection mode Conditional 7.7.12 */
2816 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2817 {GTP_EXT_TRACE_REF, GTP_OPTIONAL}, /* Trace Reference Optional 7.7.24 */
2818 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL}, /* Trace Type Optional 7.7.25 */
2819 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
2820 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
2821 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for signalling Mandatory GSN Address 7.7.32 */
2822 {GTP_EXT_MSISDN, GTP_CONDITIONAL}, /* MSISDN Conditional 7.7.33 */
2823 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL}, /* Trigger Id Optional 7.7.41 */
2824 {GTP_EXT_OMC_ID, GTP_OPTIONAL}, /* OMC Identity Optional 7.7.42 */
2825 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL}, /* RAT Type Optional 7.7.50 */
2826 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL}, /* User Location Information Optional 7.7.51 */
2827 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL}, /* MS Time Zone Optional 7.7.52 */
2828 {GTP_EXT_IMEISV, GTP_OPTIONAL}, /* IMEI(SV) Optional 7.7.53 */
2829 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2830 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL}, /* Additonal Trace Info Optional 7.7.62 */
2831 {GTP_EXT_ENH_NSAPI, GTP_MANDATORY}, /* Enhanced NSAPI Mandatory 7.7.67 */
2832 {GTP_EXT_ADD_MBMS_TRS_INF, GTP_OPTIONAL}, /* Additional MBMS Trace Info Optional 7.7.68 */
2833 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2834 {0, 0}
2838 GTP_CREATE_MBMS_CNTXT_RES, {
2839 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2840 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
2841 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2842 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL}, /* Charging ID Conditional 7.7.26 */
2843 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2844 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* Alternative GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2845 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Charging Gateway Address Optional 7.7.44 */
2846 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
2847 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2848 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2849 {0, 0}
2853 GTP_UPD_MBMS_CNTXT_REQ, {
2854 {GTP_EXT_IMSI, GTP_CONDITIONAL}, /* IMSI Conditional 7.7.2 */
2855 {GTP_EXT_RAI, GTP_MANDATORY}, /* Routeing Area Identity (RAI) Mandatory 7.7.3 */
2856 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
2857 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2858 {GTP_EXT_TRACE_REF, GTP_OPTIONAL}, /* Trace Reference Optional 7.7.24 */
2859 {GTP_EXT_TRACE_TYPE, GTP_OPTIONAL}, /* Trace Type Optional 7.7.25 */
2860 {GTP_EXT_GSN_ADDR, GTP_MANDATORY}, /* SGSN Address for Control Plane Mandatory GSN Address 7.7.32 */
2861 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* Alternative SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2862 {GTP_EXT_TRIGGER_ID, GTP_OPTIONAL}, /* Trigger Id Optional 7.7.41 */
2863 {GTP_EXT_OMC_ID, GTP_OPTIONAL}, /* OMC Identity Optional 7.7.42 */
2864 {GTP_EXT_RAT_TYPE, GTP_OPTIONAL}, /* RAT Type Optional 7.7.50 */
2865 {GTP_EXT_USR_LOC_INF, GTP_OPTIONAL}, /* User Location Information Optional 7.7.51 */
2866 {GTP_EXT_MS_TIME_ZONE, GTP_OPTIONAL}, /* MS Time Zone Optional 7.7.52 */
2867 {GTP_EXT_ADD_TRS_INF, GTP_OPTIONAL}, /* Additional Trace Info Optional 7.7.62 */
2868 {GTP_EXT_ENH_NSAPI, GTP_MANDATORY}, /* Enhanced NSAPI Mandatory 7.7.67 */
2869 {GTP_EXT_ADD_MBMS_TRS_INF, GTP_OPTIONAL}, /* Additional MBMS Trace Info Optional 7.7.68 */
2870 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2871 {0, 0}
2875 GTP_UPD_MBMS_CNTXT_RES, {
2876 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2877 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
2878 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2879 {GTP_EXT_CHRG_ID, GTP_CONDITIONAL}, /* Charging ID Conditional 7.7.26 */
2880 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2881 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* Alternative GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2882 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Charging Gateway Address Optional 7.7.44 */
2883 {GTP_EXT_CHRG_ADDR, GTP_OPTIONAL}, /* Alternative Charging Gateway Address Optional 7.7.44 */
2884 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2885 {0, 0}
2889 GTP_DEL_MBMS_CNTXT_REQ, {
2890 {GTP_EXT_IMSI, GTP_CONDITIONAL}, /* IMSI Conditional 7.7.2 */
2891 {GTP_EXT_TEID_CP, GTP_MANDATORY}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2892 {GTP_EXT_USER_ADDR, GTP_CONDITIONAL}, /* End User Address Conditional 7.7.27 */
2893 {GTP_EXT_APN, GTP_CONDITIONAL}, /* Access Point Name Conditional 7.7.30 */
2894 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2895 {GTP_EXT_ENH_NSAPI, GTP_MANDATORY}, /* Enhanced NSAPI Conditional 7.7.67 */
2896 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2897 {0, 0}
2901 GTP_DEL_MBMS_CNTXT_RES, {
2902 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2903 {GTP_EXT_MBMS_PROT_CONF_OPT, GTP_OPTIONAL}, /* MBMS Protocol Configuration Options Optional 7.7.58 */
2904 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL},
2905 {0, 0}
2909 GTP_MBMS_REG_REQ, {
2910 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
2911 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
2912 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2913 {0, 0}
2917 GTP_MBMS_REG_RES, {
2918 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2919 {GTP_EXT_TMGI, GTP_MANDATORY}, /* Temporary Mobile Group Identity (TMGI) Conditional 7.7.56 */
2920 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2921 {0, 0}
2925 GTP_MBMS_DE_REG_REQ, {
2926 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
2927 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
2928 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2929 {0, 0}
2933 GTP_MBMS_DE_REG_RES, {
2934 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2935 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2936 {0, 0}
2940 GTP_MBMS_SES_START_REQ, {
2941 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
2942 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2943 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
2944 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
2945 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* GGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2946 {GTP_EXT_QOS_UMTS, GTP_MANDATORY}, /* Quality of Service Profile Mandatory 7.7.34 */
2947 {GTP_EXT_COMMON_FLGS, GTP_OPTIONAL}, /* Common Flags Mandatory 7.7.48 */
2948 {GTP_EXT_TMGI, GTP_MANDATORY}, /* Temporary Mobile Group Identity (TMGI) Mandatory 7.7.56 */
2949 {GTP_EXT_MBMS_SES_DUR, GTP_MANDATORY}, /* MBMS Session Duration Mandatory 7.7.59 */
2950 {GTP_EXT_MBMS_SA, GTP_MANDATORY}, /* MBMS Service Area Mandatory 7.7.60 */
2951 {GTP_EXT_MBMS_SES_ID, GTP_OPTIONAL}, /* MBMS Session Identifier Optional 7.7.65 */
2952 {GTP_EXT_MBMS_2G_3G_IND, GTP_MANDATORY}, /* MBMS 2G/3G Indicator Mandatory 7.7.66 */
2953 {GTP_EXT_MBMS_SES_ID_REP_NO, GTP_OPTIONAL}, /* MBMS Session Identity Repetition Number Optional 7.7.69 */
2954 {GTP_EXT_MBMS_TIME_TO_DATA_TR, GTP_MANDATORY}, /* MBMS Time To Data Transfer Mandatory 7.7.70 */
2955 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2956 {0, 0}
2960 GTP_MBMS_SES_START_RES, {
2961 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2962 {GTP_EXT_RECOVER, GTP_OPTIONAL}, /* Recovery Optional 7.7.11 */
2963 {GTP_EXT_TEID, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Data I Conditional 7.7.13 */
2964 {GTP_EXT_TEID_CP, GTP_CONDITIONAL}, /* Tunnel Endpoint Identifier Control Plane Conditional 7.7.14 */
2965 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* SGSN Address for Control Plane Conditional GSN Address 7.7.32 */
2966 {GTP_EXT_GSN_ADDR, GTP_CONDITIONAL}, /* SGSN Address for user traffic Conditional GSN Address 7.7.32 */
2967 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2968 {0, 0}
2972 GTP_MBMS_SES_STOP_REQ, {
2973 {GTP_EXT_USER_ADDR, GTP_MANDATORY}, /* End User Address Mandatory 7.7.27 */
2974 {GTP_EXT_APN, GTP_MANDATORY}, /* Access Point Name Mandatory 7.7.30 */
2975 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2976 {0, 0}
2980 GTP_MBMS_SES_STOP_RES, {
2981 {GTP_EXT_CAUSE, GTP_MANDATORY}, /* Cause Mandatory 7.7.1 */
2982 {GTP_EXT_PRIV_EXT, GTP_OPTIONAL}, /* Private Extension Optional 7.7.46 */
2983 {0, 0}
2987 0, {
2988 {0, 0}
2993 /* Data structure attached to a conversation,
2994 to keep track of request/response-pairs
2996 typedef struct gtp_conv_info_t {
2997 struct gtp_conv_info_t *next;
2998 GHashTable *unmatched;
2999 GHashTable *matched;
3000 } gtp_conv_info_t;
3002 static gtp_conv_info_t *gtp_info_items = NULL;
3004 static guint
3005 gtp_sn_hash(gconstpointer k)
3007 const gtp_msg_hash_t *key = (const gtp_msg_hash_t *)k;
3009 return key->seq_nr;
3012 static gint
3013 gtp_sn_equal_matched(gconstpointer k1, gconstpointer k2)
3015 const gtp_msg_hash_t *key1 = (const gtp_msg_hash_t *)k1;
3016 const gtp_msg_hash_t *key2 = (const gtp_msg_hash_t *)k2;
3018 if ( key1->req_frame && key2->req_frame && (key1->req_frame != key2->req_frame) ) {
3019 return 0;
3022 if ( key1->rep_frame && key2->rep_frame && (key1->rep_frame != key2->rep_frame) ) {
3023 return 0;
3026 return key1->seq_nr == key2->seq_nr;
3029 static gint
3030 gtp_sn_equal_unmatched(gconstpointer k1, gconstpointer k2)
3032 const gtp_msg_hash_t *key1 = (const gtp_msg_hash_t *)k1;
3033 const gtp_msg_hash_t *key2 = (const gtp_msg_hash_t *)k2;
3035 return key1->seq_nr == key2->seq_nr;
3038 static gtp_msg_hash_t *
3039 gtp_match_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, gint seq_nr, guint msgtype, gtp_conv_info_t *gtp_info)
3041 gtp_msg_hash_t gcr, *gcrp = NULL;
3042 gcr.seq_nr=seq_nr;
3044 switch (msgtype) {
3045 case GTP_MSG_ECHO_REQ:
3046 case GTP_MSG_CREATE_PDP_REQ:
3047 case GTP_MSG_UPDATE_PDP_REQ:
3048 case GTP_MSG_DELETE_PDP_REQ:
3049 gcr.is_request=TRUE;
3050 gcr.req_frame=pinfo->fd->num;
3051 gcr.rep_frame=0;
3052 break;
3053 case GTP_MSG_ECHO_RESP:
3054 case GTP_MSG_CREATE_PDP_RESP:
3055 case GTP_MSG_UPDATE_PDP_RESP:
3056 case GTP_MSG_DELETE_PDP_RESP:
3057 gcr.is_request=FALSE;
3058 gcr.req_frame=0;
3059 gcr.rep_frame=pinfo->fd->num;
3060 break;
3061 default:
3062 gcr.is_request=FALSE;
3063 gcr.req_frame=0;
3064 gcr.rep_frame=0;
3065 break;
3068 gcrp = (gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->matched, &gcr);
3070 if (gcrp) {
3072 gcrp->is_request=gcr.is_request;
3074 } else {
3076 /*no match, let's try to make one*/
3077 switch (msgtype) {
3078 case GTP_MSG_ECHO_REQ:
3079 case GTP_MSG_CREATE_PDP_REQ:
3080 case GTP_MSG_UPDATE_PDP_REQ:
3081 case GTP_MSG_DELETE_PDP_REQ:
3082 gcr.seq_nr=seq_nr;
3084 gcrp=(gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->unmatched, &gcr);
3085 if (gcrp) {
3086 g_hash_table_remove(gtp_info->unmatched, gcrp);
3088 /* if we cant reuse the old one, grab a new chunk */
3089 if (!gcrp) {
3090 gcrp = wmem_new(wmem_file_scope(), gtp_msg_hash_t);
3092 gcrp->seq_nr=seq_nr;
3093 gcrp->req_frame = pinfo->fd->num;
3094 gcrp->req_time = pinfo->fd->abs_ts;
3095 gcrp->rep_frame = 0;
3096 gcrp->msgtype = msgtype;
3097 gcrp->is_request = TRUE;
3098 g_hash_table_insert(gtp_info->unmatched, gcrp, gcrp);
3099 return NULL;
3100 break;
3101 case GTP_MSG_ECHO_RESP:
3102 case GTP_MSG_CREATE_PDP_RESP:
3103 case GTP_MSG_UPDATE_PDP_RESP:
3104 case GTP_MSG_DELETE_PDP_RESP:
3105 gcr.seq_nr=seq_nr;
3106 gcrp=(gtp_msg_hash_t *)g_hash_table_lookup(gtp_info->unmatched, &gcr);
3108 if (gcrp) {
3109 if (!gcrp->rep_frame) {
3110 g_hash_table_remove(gtp_info->unmatched, gcrp);
3111 gcrp->rep_frame=pinfo->fd->num;
3112 gcrp->is_request=FALSE;
3113 g_hash_table_insert(gtp_info->matched, gcrp, gcrp);
3116 break;
3117 default:
3118 break;
3122 /* we have found a match */
3123 if (gcrp) {
3124 proto_item *it;
3127 if (gcrp->is_request) {
3128 it = proto_tree_add_uint(tree, hf_gtp_response_in, tvb, 0, 0, gcrp->rep_frame);
3129 PROTO_ITEM_SET_GENERATED(it);
3130 } else {
3131 nstime_t ns;
3133 it = proto_tree_add_uint(tree, hf_gtp_response_to, tvb, 0, 0, gcrp->req_frame);
3134 PROTO_ITEM_SET_GENERATED(it);
3135 nstime_delta(&ns, &pinfo->fd->abs_ts, &gcrp->req_time);
3136 it = proto_tree_add_time(tree, hf_gtp_time, tvb, 0, 0, &ns);
3137 PROTO_ITEM_SET_GENERATED(it);
3140 return gcrp;
3144 static int
3145 check_field_presence(guint8 message, guint8 field, int *position)
3148 guint i = 0;
3149 _gtp_mess_items *mess_items;
3151 switch (gtp_version) {
3152 case 0:
3153 mess_items = gprs_mess_items;
3154 break;
3155 case 1:
3156 mess_items = umts_mess_items;
3157 break;
3158 default:
3159 return -2;
3162 while (mess_items[i].code) {
3163 if (mess_items[i].code == message) {
3165 while (mess_items[i].fields[*position].code) {
3166 if (mess_items[i].fields[*position].code == field) {
3167 (*position)++;
3168 return 0;
3169 } else {
3170 if (mess_items[i].fields[*position].presence == GTP_MANDATORY) {
3171 return mess_items[i].fields[(*position)++].code;
3172 } else {
3173 (*position)++;
3177 return -1;
3179 i++;
3182 return -2;
3185 /* Decoders of fields in extension headers, each function returns no of bytes from field */
3187 /* GPRS: 9.60 v7.6.0, chapter
3188 * UMTS: 29.060 v4.0, chapter
3189 * 7.7.1 Cause
3191 static int
3192 decode_gtp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3195 guint8 cause;
3197 cause = tvb_get_guint8(tvb, offset + 1);
3199 proto_tree_add_uint(tree, hf_gtp_cause, tvb, offset, 2, cause);
3201 return 2;
3204 /* GPRS: 9.60 v7.6.0, chapter 7.9.2
3205 * UMTS: 29.060 v4.0, chapter 7.7.2
3207 static int
3208 decode_gtp_imsi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3210 const gchar *imsi_str;
3212 /* Octets 2 - 9 IMSI */
3213 imsi_str = tvb_bcd_dig_to_wmem_packet_str( tvb, offset+1, 8, NULL, FALSE);
3215 proto_tree_add_string(tree, hf_gtp_imsi, tvb, offset+1, 8, imsi_str);
3217 return 9;
3220 /* GPRS: 9.60 v7.6.0, chapter 7.9.3
3221 * UMTS: 29.060 v4.0, chapter 7.7.3 Routeing Area Identity (RAI)
3223 static int
3224 decode_gtp_rai(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3227 proto_tree *ext_tree_rai;
3228 proto_item *te;
3230 te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_RAI, &gtp_val_ext, "Unknown message"));
3231 ext_tree_rai = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RAI]);
3233 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree_rai, offset+1, TRUE);
3234 proto_tree_add_item(ext_tree_rai, hf_gtp_rai_lac, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
3235 proto_tree_add_item(ext_tree_rai, hf_gtp_rai_rac, tvb, offset + 6, 1, ENC_BIG_ENDIAN);
3237 return 7;
3240 /* GPRS: 9.60 v7.6.0, chapter 7.9.4, page 39
3241 * UMTS: 29.060 v4.0, chapter 7.7.4 Temporary Logical Link Identity (TLLI)
3243 static int
3244 decode_gtp_tlli(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3247 guint32 tlli;
3249 tlli = tvb_get_ntohl(tvb, offset + 1);
3250 proto_tree_add_uint(tree, hf_gtp_tlli, tvb, offset, 5, tlli);
3252 return 5;
3255 /* GPRS: 9.60 v7.6.0, chapter 7.9.5, page 39
3256 * UMTS: 29.060 v4.0, chapter 7.7.5 Packet TMSI (P-TMSI)
3258 static int
3259 decode_gtp_ptmsi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3262 guint32 ptmsi;
3264 ptmsi = tvb_get_ntohl(tvb, offset + 1);
3265 proto_tree_add_uint(tree, hf_gtp_ptmsi, tvb, offset, 5, ptmsi);
3267 return 5;
3271 * adjust - how many bytes before offset should be highlighted
3273 static int
3274 decode_qos_gprs(tvbuff_t * tvb, int offset, proto_tree * tree, const gchar * qos_str, guint8 adjust)
3277 guint8 spare1, delay, reliability, peak, spare2, precedence, spare3, mean;
3278 proto_tree *ext_tree_qos;
3279 proto_item *te;
3281 spare1 = tvb_get_guint8(tvb, offset) & GTP_EXT_QOS_SPARE1_MASK;
3282 delay = tvb_get_guint8(tvb, offset) & GTP_EXT_QOS_DELAY_MASK;
3283 reliability = tvb_get_guint8(tvb, offset) & GTP_EXT_QOS_RELIABILITY_MASK;
3284 peak = tvb_get_guint8(tvb, offset + 1) & GTP_EXT_QOS_PEAK_MASK;
3285 spare2 = tvb_get_guint8(tvb, offset + 1) & GTP_EXT_QOS_SPARE2_MASK;
3286 precedence = tvb_get_guint8(tvb, offset + 1) & GTP_EXT_QOS_PRECEDENCE_MASK;
3287 spare3 = tvb_get_guint8(tvb, offset + 2) & GTP_EXT_QOS_SPARE3_MASK;
3288 mean = tvb_get_guint8(tvb, offset + 2) & GTP_EXT_QOS_MEAN_MASK;
3290 te = proto_tree_add_text(tree, tvb, offset - adjust, 3 + adjust, "%s: delay: %u, reliability: %u, peak: %u, precedence: %u, mean: %u",
3291 qos_str, (delay >> 3) & 0x07, reliability, (peak >> 4) & 0x0F, precedence, mean);
3292 ext_tree_qos = proto_item_add_subtree(te, ett_gtp_qos);
3294 if (adjust != 0) {
3295 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare1, tvb, offset, 1, spare1);
3296 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_delay, tvb, offset, 1, delay);
3297 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_reliability, tvb, offset, 1, reliability);
3298 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_peak, tvb, offset + 1, 1, peak);
3299 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare2, tvb, offset + 1, 1, spare2);
3300 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_precedence, tvb, offset + 1, 1, precedence);
3301 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare3, tvb, offset + 2, 1, spare3);
3302 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_mean, tvb, offset + 2, 1, mean);
3305 return 3;
3308 /* GPRS: 9.60 v7.6.0, chapter 7.9.6, page 39
3309 * 4.08
3310 * 3.60
3311 * UMTS: not present
3312 * TODO: check if length is included: ETSI 4.08 vs 9.60
3314 static int
3315 decode_gtp_qos_gprs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3318 return (1 + decode_qos_gprs(tvb, offset + 1, tree, "Quality of Service", 1));
3322 /* GPRS: 9.60 v7.6.0, chapter 7.9.7, page 39
3323 * UMTS: 29.060 v4.0, chapter 7.7.6 Reordering Required
3325 static int
3326 decode_gtp_reorder(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3329 guint8 reorder;
3331 reorder = tvb_get_guint8(tvb, offset + 1) & 0x01;
3332 proto_tree_add_boolean(tree, hf_gtp_reorder, tvb, offset, 2, reorder);
3334 return 2;
3337 /* GPRS: 9.60 v7.6.0, chapter 7.9.8, page 40
3338 * 4.08 v7.1.2, chapter 10.5.3.1+
3339 * UMTS: 29.060 v4.0, chapter 7.7.7
3340 * TODO: Add blurb support by registering items in the protocol registration
3342 static int
3343 decode_gtp_auth_tri(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3346 proto_tree *ext_tree_auth_tri;
3347 proto_item *te;
3349 te = proto_tree_add_text(tree, tvb, offset, 29, "%s", val_to_str_ext_const(GTP_EXT_AUTH_TRI, &gtp_val_ext, "Unknown message"));
3350 ext_tree_auth_tri = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_AUTH_TRI]);
3352 proto_tree_add_text(ext_tree_auth_tri, tvb, offset + 1, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset + 1, 16));
3353 proto_tree_add_text(ext_tree_auth_tri, tvb, offset + 17, 4, "SRES: %s", tvb_bytes_to_str(tvb, offset + 17, 4));
3354 proto_tree_add_text(ext_tree_auth_tri, tvb, offset + 21, 8, "Kc: %s", tvb_bytes_to_str(tvb, offset + 21, 8));
3356 return 1 + 16 + 4 + 8;
3359 /* GPRS: 9.60 v7.6.0, chapter 7.9.9, page 40
3360 * 9.02 v7.7.0, page 1090
3361 * UMTS: 29.060 v4.0, chapter 7.7.8, page 48
3362 * 29.002 v4.2.1, chapter 17.5, page 268
3364 static int
3365 decode_gtp_map_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3368 guint8 map_cause;
3370 map_cause = tvb_get_guint8(tvb, offset + 1);
3371 proto_tree_add_uint(tree, hf_gtp_map_cause, tvb, offset, 2, map_cause);
3373 return 2;
3376 /* GPRS: 9.60 v7.6.0, chapter 7.9.10, page 41
3377 * UMTS: 29.060 v4.0, chapter 7.7.9, page 48
3379 static int
3380 decode_gtp_ptmsi_sig(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3383 guint32 ptmsi_sig;
3385 ptmsi_sig = tvb_get_ntoh24(tvb, offset + 1);
3386 proto_tree_add_uint(tree, hf_gtp_ptmsi_sig, tvb, offset, 4, ptmsi_sig);
3388 return 4;
3391 /* GPRS: 9.60 v7.6.0, chapter 7.9.11, page 41
3392 * UMTS: 29.060 v4.0, chapter 7.7.10, page 49
3394 static int
3395 decode_gtp_ms_valid(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3398 guint8 ms_valid;
3400 ms_valid = tvb_get_guint8(tvb, offset + 1) & 0x01;
3401 proto_tree_add_boolean(tree, hf_gtp_ms_valid, tvb, offset, 2, ms_valid);
3403 return 2;
3406 /* GPRS: 9.60 v7.6.0, chapter 7.9.12, page 41
3407 * UMTS: 29.060 v4.0, chapter 7.7.11 Recovery
3409 static int
3410 decode_gtp_recovery(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3413 guint8 recovery;
3415 recovery = tvb_get_guint8(tvb, offset + 1);
3416 proto_tree_add_uint(tree, hf_gtp_recovery, tvb, offset, 2, recovery);
3418 return 2;
3421 /* GPRS: 9.60 v7.6.0, chapter 7.9.13, page 42
3422 * UMTS: 29.060 v4.0, chapter 7.7.12 Selection Mode
3426 static const gchar *
3427 dissect_radius_selection_mode(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo _U_)
3429 guint8 sel_mode;
3431 /* Value in ASCII(UTF-8) */
3432 sel_mode = tvb_get_guint8(tvb, 0) - 0x30;
3433 proto_tree_add_uint(tree, hf_gtp_sel_mode, tvb, 0, 1, sel_mode);
3435 return val_to_str_const(sel_mode, sel_mode_type, "Unknown");
3438 static int
3439 decode_gtp_sel_mode(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3442 proto_tree_add_item(tree, hf_gtp_sel_mode, tvb, offset, 2, ENC_BIG_ENDIAN);
3443 return 2;
3446 /* GPRS: 9.60 v7.6.0, chapter 7.9.14, page 42
3447 * UMTS: 29.060 v4.0, chapter 7.7.13, page 50
3449 static int
3450 decode_gtp_16(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3453 guint16 ext_flow_label;
3454 guint32 teid_data;
3456 switch (gtp_version) {
3457 case 0:
3458 ext_flow_label = tvb_get_ntohs(tvb, offset + 1);
3459 proto_tree_add_uint(tree, hf_gtp_ext_flow_label, tvb, offset, 3, ext_flow_label);
3461 return 3;
3462 case 1:
3463 teid_data = tvb_get_ntohl(tvb, offset + 1);
3464 proto_tree_add_uint(tree, hf_gtp_teid_data, tvb, offset, 5, teid_data);
3466 return 5;
3467 default:
3468 proto_tree_add_text(tree, tvb, offset, 1, "Flow label/TEID Data I : GTP version not supported");
3470 return 3;
3474 /* GPRS: 9.60 v7.6.0, chapter 7.9.15, page 42
3475 * UMTS: 29.060 v4.0, chapter 7.7.14, page 42
3477 static int
3478 decode_gtp_17(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3481 guint16 flow_sig;
3482 guint32 teid_cp;
3484 switch (gtp_version) {
3485 case 0:
3486 flow_sig = tvb_get_ntohs(tvb, offset + 1);
3487 proto_tree_add_uint(tree, hf_gtp_flow_sig, tvb, offset, 3, flow_sig);
3488 return 3;
3489 case 1:
3490 teid_cp = tvb_get_ntohl(tvb, offset + 1);
3491 proto_tree_add_uint(tree, hf_gtp_teid_cp, tvb, offset, 5, teid_cp);
3492 return 5;
3493 default:
3494 proto_tree_add_text(tree, tvb, offset, 1, "Flow label signalling/TEID control plane : GTP version not supported");
3495 return 3;
3499 /* GPRS: 9.60 v7.6.0, chapter 7.9.16, page 42
3500 * UMTS: 29.060 v4.0, chapter 7.7.15, page 51
3502 static int
3503 decode_gtp_18(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3506 guint16 flow_ii;
3507 guint32 teid_ii;
3508 proto_tree *ext_tree_flow_ii;
3509 proto_item *te;
3511 switch (gtp_version) {
3512 case 0:
3513 te = proto_tree_add_text(tree, tvb, offset, 4, "%s", val_to_str_ext_const(GTP_EXT_FLOW_II, &gtp_val_ext, "Unknown message"));
3514 ext_tree_flow_ii = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_FLOW_II]);
3516 proto_tree_add_item(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3518 flow_ii = tvb_get_ntohs(tvb, offset + 2);
3519 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_flow_ii, tvb, offset + 2, 2, flow_ii);
3521 return 4;
3522 case 1:
3523 te = proto_tree_add_text(tree, tvb, offset, 6, "%s", val_to_str_ext_const(GTP_EXT_TEID_II, &gtpv1_val_ext, "Unknown message"));
3524 ext_tree_flow_ii = proto_item_add_subtree(te, ett_gtp_flow_ii);
3526 proto_tree_add_item(ext_tree_flow_ii, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3528 teid_ii = tvb_get_ntohl(tvb, offset + 2);
3529 proto_tree_add_uint(ext_tree_flow_ii, hf_gtp_teid_ii, tvb, offset + 2, 4, teid_ii);
3531 return 6;
3532 default:
3533 proto_tree_add_text(tree, tvb, offset, 1, "Flow data II/TEID Data II : GTP Version not supported");
3535 return 4;
3539 /* GPRS: 9.60 v7.6.0, chapter 7.9.16A, page 43
3540 * UMTS: 29.060 v4.0, chapter 7.7.16, page 51
3541 * Check if all ms_reason types are included
3543 static int
3544 decode_gtp_19(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3547 guint8 field19;
3549 field19 = tvb_get_guint8(tvb, offset + 1);
3551 switch (gtp_version) {
3552 case 0:
3553 proto_tree_add_uint(tree, hf_gtp_ms_reason, tvb, offset, 2, field19);
3554 break;
3555 case 1:
3556 proto_tree_add_boolean(tree, hf_gtp_tear_ind, tvb, offset, 2, field19 & 0x01);
3557 break;
3558 default:
3559 proto_tree_add_text(tree, tvb, offset, 1, "Information Element Type = 19 : GTP Version not supported");
3560 break;
3563 return 2;
3566 /* GPRS: not present
3567 * UMTS: 29.060 v4.0, chapter 7.7.17, page 51
3569 static int
3570 decode_gtp_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3572 guint8 nsapi;
3573 proto_tree *ext_tree;
3574 proto_item *te;
3576 te = proto_tree_add_text(tree, tvb, offset, 10, "%s", val_to_str_ext_const(GTP_EXT_NSAPI, &gtp_val_ext, "Unknown message"));
3577 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_NSAPI]);
3579 nsapi = tvb_get_guint8(tvb, offset + 1) & 0x0F;
3580 proto_tree_add_item(ext_tree, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3581 proto_item_append_text(te, ": %u",nsapi);
3583 return 2;
3586 /* GPRS: not present
3587 * UMTS: 29.060 v4.0, chapter 7.7.18, page 52
3589 static int
3590 decode_gtp_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3593 guint8 ranap;
3595 ranap = tvb_get_guint8(tvb, offset + 1);
3597 if ((ranap > 0) && (ranap <= 64))
3598 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
3599 ranap, "%s (Radio Network Layer Cause) : %s (%u)",
3600 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, &gtp_val_ext, "Unknown"),
3601 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
3603 if ((ranap > 64) && (ranap <= 80))
3604 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
3605 ranap, "%s (Transport Layer Cause) : %s (%u)",
3606 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, &gtp_val_ext, "Unknown"),
3607 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
3609 if ((ranap > 80) && (ranap <= 96))
3610 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2,
3611 ranap, "%s (NAS Cause) : %s (%u)",
3612 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, &gtp_val_ext, "Unknown"),
3613 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
3615 if ((ranap > 96) && (ranap <= 112))
3616 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
3617 "%s (Protocol Cause) : %s (%u)",
3618 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, &gtp_val_ext, "Unknown"),
3619 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
3621 if ((ranap > 112) && (ranap <= 128))
3622 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
3623 "%s (Miscellaneous Cause) : %s (%u)",
3624 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, &gtp_val_ext, "Unknown"),
3625 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
3627 if ((ranap > 128) /* && (ranap <= 255) */ )
3628 proto_tree_add_uint_format(tree, hf_gtp_ranap_cause, tvb, offset, 2, ranap,
3629 "%s (Non-standard Cause) : %s (%u)",
3630 val_to_str_ext_const(GTP_EXT_RANAP_CAUSE, &gtp_val_ext, "Unknown"),
3631 val_to_str_ext_const(ranap, &ranap_cause_type_ext, "Unknown RANAP Cause"), ranap);
3633 return 2;
3636 /* GPRS: not present
3637 * UMTS: 29.060 v4.0, chapter 7.7.19, page 52
3639 static int
3640 decode_gtp_rab_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3642 proto_tree *ext_tree_rab_cntxt;
3643 proto_item *te;
3645 te = proto_tree_add_text(tree, tvb, offset, 10, "%s", val_to_str_ext_const(GTP_EXT_RAB_CNTXT, &gtp_val_ext, "Unknown message"));
3646 ext_tree_rab_cntxt = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RAB_CNTXT]);
3648 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3649 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_dn, tvb, offset + 2, 2, ENC_BIG_ENDIAN);
3650 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_gtpu_up, tvb, offset + 4, 2, ENC_BIG_ENDIAN);
3651 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_dn, tvb, offset + 6, 2, ENC_BIG_ENDIAN);
3652 proto_tree_add_item(ext_tree_rab_cntxt, hf_gtp_rab_pdu_up, tvb, offset + 8, 2, ENC_BIG_ENDIAN);
3654 return 10;
3658 /* GPRS: not present
3659 * UMTS: 29.060 v4.0, chapter 7.7.20, page 53
3661 static int
3662 decode_gtp_rp_sms(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3665 guint8 rp_sms;
3667 rp_sms = tvb_get_guint8(tvb, offset + 1) & 0x07;
3668 proto_tree_add_uint(tree, hf_gtp_rp_sms, tvb, offset, 2, rp_sms);
3670 return 2;
3673 /* GPRS: not present
3674 * UMTS: 29.060 v4.0, chapter 7.7.21, page 53
3676 static int
3677 decode_gtp_rp(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3680 proto_tree *ext_tree_rp;
3681 proto_item *te;
3682 guint8 nsapi, rp, spare;
3684 nsapi = tvb_get_guint8(tvb, offset + 1) & 0xF0;
3685 spare = tvb_get_guint8(tvb, offset + 1) & 0x08;
3686 rp = tvb_get_guint8(tvb, offset + 1) & 0x07;
3688 te = proto_tree_add_uint_format(tree, hf_gtp_rp, tvb, offset, 2, rp, "Radio Priority for NSAPI(%u) : %u", nsapi, rp);
3689 ext_tree_rp = proto_item_add_subtree(te, ett_gtp_rp);
3691 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_nsapi, tvb, offset + 1, 1, nsapi);
3692 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp_spare, tvb, offset + 1, 1, spare);
3693 proto_tree_add_uint(ext_tree_rp, hf_gtp_rp, tvb, offset + 1, 1, rp);
3695 return 2;
3698 /* GPRS: not present
3699 * UMTS: 29.060 v4.0, chapter 7.7.22, page 53
3701 static int
3702 decode_gtp_pkt_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3705 proto_tree *ext_tree_pkt_flow_id;
3706 proto_item *te;
3707 guint8 nsapi, pkt_flow_id;
3709 nsapi = tvb_get_guint8(tvb, offset + 1) & 0x0F;
3710 pkt_flow_id = tvb_get_guint8(tvb, offset + 2);
3712 te = proto_tree_add_uint_format(tree, hf_gtp_pkt_flow_id, tvb, offset, 3, pkt_flow_id, "Packet Flow ID for NSAPI(%u) : %u", nsapi, pkt_flow_id);
3713 ext_tree_pkt_flow_id = proto_item_add_subtree(te, ett_gtp_pkt_flow_id);
3715 proto_tree_add_item(ext_tree_pkt_flow_id, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
3716 proto_tree_add_uint_format(ext_tree_pkt_flow_id, hf_gtp_pkt_flow_id, tvb,
3717 offset + 2, 1, pkt_flow_id, "%s : %u", val_to_str_ext_const(GTP_EXT_PKT_FLOW_ID, &gtp_val_ext, "Unknown message"), pkt_flow_id);
3719 return 3;
3722 /* GPRS: not present
3723 * UMTS: 29.060 v4.0, chapter 7.7.23, page 53
3724 * TODO: Differenciate these uints?
3726 static int
3727 decode_gtp_chrg_char(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3730 guint16 chrg_char;
3731 proto_item *te;
3732 proto_tree *ext_tree_chrg_char;
3734 chrg_char = tvb_get_ntohs(tvb, offset + 1);
3736 te = proto_tree_add_uint(tree, hf_gtp_chrg_char, tvb, offset, 3, chrg_char);
3737 /*"%s: %x", val_to_str_ext_const (GTP_EXT_CHRG_CHAR, &gtp_val_ext, "Unknown message"), chrg_char); */
3738 ext_tree_chrg_char = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CHRG_CHAR]);
3740 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_s, tvb, offset + 1, 2, chrg_char);
3741 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_n, tvb, offset + 1, 2, chrg_char);
3742 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_p, tvb, offset + 1, 2, chrg_char);
3743 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_f, tvb, offset + 1, 2, chrg_char);
3744 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_h, tvb, offset + 1, 2, chrg_char);
3745 proto_tree_add_uint(ext_tree_chrg_char, hf_gtp_chrg_char_r, tvb, offset + 1, 2, chrg_char);
3747 return 3;
3750 /* GPRS: not present
3751 * UMTS: 29.060 v4.0, chapter 7.7.24, page
3753 static int
3754 decode_gtp_trace_ref(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3757 guint16 trace_ref;
3759 trace_ref = tvb_get_ntohs(tvb, offset + 1);
3761 proto_tree_add_uint(tree, hf_gtp_trace_ref, tvb, offset, 3, trace_ref);
3763 return 3;
3766 /* GPRS: not present
3767 * UMTS: 29.060 v4.0, chapter 7.7.25, page
3769 static int
3770 decode_gtp_trace_type(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3773 guint16 trace_type;
3775 trace_type = tvb_get_ntohs(tvb, offset + 1);
3777 proto_tree_add_uint(tree, hf_gtp_trace_type, tvb, offset, 3, trace_type);
3779 return 3;
3782 /* GPRS: 9.60 v7.6.0, chapter 7.9.16A
3783 * UMTS: 29.060 v4.0, chapter 7.7.25A, page
3785 static int
3786 decode_gtp_ms_reason(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3789 guint8 reason;
3791 reason = tvb_get_guint8(tvb, offset + 1);
3793 /* Reason for Absence is defined in 3GPP TS 23.040 */
3794 proto_tree_add_uint(tree, hf_gtp_ms_reason, tvb, offset, 2, reason);
3796 return 2;
3799 /* GPRS: ?
3800 * UMTS: 29.060 v6.11.0, chapter 7.7.25B
3801 * Radio Priority LCS
3803 static int
3804 decode_gtp_ra_prio_lcs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3807 guint16 length;
3808 proto_tree *ext_tree;
3809 proto_item *te;
3811 length = tvb_get_ntohs(tvb, offset + 1);
3812 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_RA_PRIO_LCS, &gtp_val_ext, "Unknown"));
3813 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RA_PRIO_LCS]);
3815 offset++;
3816 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
3817 offset = offset + 2;
3819 proto_tree_add_item(ext_tree, hf_gtp_ra_prio_lcs, tvb, offset, 1, ENC_BIG_ENDIAN);
3821 return 3 + length;
3825 /* GPRS: 12.15 v7.6.0, chapter 7.3.3, page 45
3826 * UMTS: 33.015
3828 static int
3829 decode_gtp_tr_comm(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3832 guint8 tr_command;
3834 tr_command = tvb_get_guint8(tvb, offset + 1);
3836 proto_tree_add_uint(tree, hf_gtp_tr_comm, tvb, offset, 2, tr_command);
3838 return 2;
3841 /* GPRS: 9.60 v7.6.0, chapter 7.9.17, page 43
3842 * UMTS: 29.060 v4.0, chapter 7.7.26, page 55
3844 static int
3845 decode_gtp_chrg_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3848 guint32 chrg_id;
3850 chrg_id = tvb_get_ntohl(tvb, offset + 1);
3851 proto_tree_add_uint(tree, hf_gtp_chrg_id, tvb, offset, 5, chrg_id);
3853 return 5;
3856 /* GPRS: 9.60 v7.6.0, chapter 7.9.18, page 43
3857 * UMTS: 29.060 v4.0, chapter 7.7.27, page 55
3859 static int
3860 decode_gtp_user_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
3863 guint16 length;
3864 guint8 pdp_typ, pdp_org;
3865 guint32 addr_ipv4;
3866 struct e_in6_addr addr_ipv6;
3867 proto_tree *ext_tree_user;
3868 proto_item *te;
3871 length = tvb_get_ntohs(tvb, offset + 1);
3872 pdp_org = tvb_get_guint8(tvb, offset + 3) & 0x0F;
3873 pdp_typ = tvb_get_guint8(tvb, offset + 4);
3875 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s (%s/%s)",
3876 val_to_str_ext_const(GTP_EXT_USER_ADDR, &gtp_val_ext, "Unknown message"),
3877 val_to_str_const(pdp_org, pdp_org_type, "Unknown PDP Organization"),
3878 val_to_str_const(pdp_typ, pdp_type, "Unknown PDP Type"));
3879 ext_tree_user = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_USER_ADDR]);
3881 proto_tree_add_text(ext_tree_user, tvb, offset + 1, 2, "Length : %u", length);
3882 proto_tree_add_uint(ext_tree_user, hf_gtp_user_addr_pdp_org, tvb, offset + 3, 1, pdp_org);
3883 proto_tree_add_uint(ext_tree_user, hf_gtp_user_addr_pdp_type, tvb, offset + 4, 1, pdp_typ);
3885 if (length == 2) {
3886 if ((pdp_org == 0) && (pdp_typ == 1))
3887 proto_item_append_text(te, " (Point to Point Protocol)");
3888 else if (pdp_typ == 2)
3889 proto_item_append_text(te, " (Octet Stream Protocol)");
3890 } else if (length > 2) {
3891 switch (pdp_typ) {
3892 case 0x21:
3893 addr_ipv4 = tvb_get_ipv4(tvb, offset + 5);
3894 proto_tree_add_ipv4(ext_tree_user, hf_gtp_user_ipv4, tvb, offset + 5, 4, addr_ipv4);
3895 proto_item_append_text(te, " : %s", ip_to_str((guint8 *) & addr_ipv4));
3896 break;
3897 case 0x57:
3898 tvb_get_ipv6(tvb, offset + 5, &addr_ipv6);
3899 proto_tree_add_ipv6(ext_tree_user, hf_gtp_user_ipv6, tvb, offset + 5, 16, (guint8 *) & addr_ipv6);
3900 proto_item_append_text(te, " : %s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
3901 break;
3902 case 0x8d:
3903 addr_ipv4 = tvb_get_ipv4(tvb, offset + 5);
3904 proto_tree_add_ipv4(ext_tree_user, hf_gtp_user_ipv4, tvb, offset + 5, 4, addr_ipv4);
3905 tvb_get_ipv6(tvb, offset + 9, &addr_ipv6);
3906 proto_tree_add_ipv6(ext_tree_user, hf_gtp_user_ipv6, tvb, offset + 9, 16, (guint8 *) & addr_ipv6);
3907 proto_item_append_text(te, " : %s / %s", ip_to_str((guint8 *) & addr_ipv4),
3908 ip6_to_str((struct e_in6_addr *) &addr_ipv6));
3909 break;
3911 } else
3912 proto_item_append_text(te, " : empty PDP Address");
3914 return 3 + length;
3917 static int
3918 decode_triplet(tvbuff_t * tvb, int offset, proto_tree * tree, guint16 count)
3921 proto_tree *ext_tree_trip;
3922 proto_item *te_trip;
3923 guint16 i;
3925 for (i = 0; i < count; i++) {
3926 te_trip = proto_tree_add_text(tree, tvb, offset + i * 28, 28, "Triplet no%x", i);
3927 ext_tree_trip = proto_item_add_subtree(te_trip, ett_gtp_trip);
3929 proto_tree_add_text(ext_tree_trip, tvb, offset + i * 28, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset + i * 28, 16));
3930 proto_tree_add_text(ext_tree_trip, tvb, offset + i * 28 + 16, 4, "SRES: %s", tvb_bytes_to_str(tvb, offset + i * 28 + 16, 4));
3931 proto_tree_add_text(ext_tree_trip, tvb, offset + i * 28 + 20, 8, "Kc: %s", tvb_bytes_to_str(tvb, offset + i * 28 + 20, 8));
3934 return count * 28;
3937 /* adjust - how many bytes before quintuplet should be highlighted
3939 static int
3940 decode_quintuplet(tvbuff_t * tvb, int offset, proto_tree * tree, guint16 count)
3943 proto_tree *ext_tree_quint;
3944 proto_item *te_quint;
3945 guint16 q_offset, i;
3946 guint8 xres_len, auth_len;
3948 q_offset = 0;
3950 for (i = 0; i < count; i++) {
3952 te_quint = proto_tree_add_text(tree, tvb, offset, -1, "Quintuplet #%x", i + 1);
3953 ext_tree_quint = proto_item_add_subtree(te_quint, ett_gtp_quint);
3956 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset, 16));
3957 q_offset = q_offset + 16;
3958 xres_len = tvb_get_guint8(tvb, offset + q_offset);
3959 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 1, "XRES length: %u", xres_len);
3960 q_offset++;
3961 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, xres_len, "XRES: %s", tvb_bytes_to_str(tvb, offset + q_offset, xres_len));
3962 q_offset = q_offset + xres_len;
3963 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 16, "Quintuplet Ciphering Key: %s", tvb_bytes_to_str(tvb, offset + q_offset, 16));
3964 q_offset = q_offset + 16;
3965 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 16, "Quintuplet Integrity Key: %s", tvb_bytes_to_str(tvb, offset + q_offset, 16));
3966 q_offset = q_offset + 16;
3967 auth_len = tvb_get_guint8(tvb, offset + q_offset);
3968 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, 1, "Authentication length: %u", auth_len);
3969 q_offset++;
3970 proto_tree_add_text(ext_tree_quint, tvb, offset + q_offset, auth_len, "AUTH: %s", tvb_bytes_to_str(tvb, offset + q_offset, auth_len));
3972 q_offset = q_offset + auth_len;
3973 proto_item_set_end(te_quint, tvb, offset + q_offset);
3977 return q_offset;
3980 /* GPRS: 9.60 v7.6.0, chapter 7.9.19 page
3981 * UMTS: 29.060 v4.0, chapter 7.7.28 page 57
3982 * TODO: - check if for quintuplets first 2 bytes are length, according to AuthQuint
3983 * - finish displaying last 3 parameters
3985 static int
3986 decode_gtp_mm_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
3989 guint16 length, quint_len, con_len;
3990 guint8 count, sec_mode, len, iei;
3991 proto_tree *ext_tree_mm;
3992 proto_item *te;
3993 proto_item *tf = NULL;
3994 proto_tree *tf_tree = NULL;
3996 te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_MM_CNTXT, &gtp_val_ext, "Unknown message"));
3997 ext_tree_mm = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MM_CNTXT]);
3999 /* Octet 2 - 3 */
4000 length = tvb_get_ntohs(tvb, offset + 1);
4001 if (length < 1)
4002 return 3;
4004 /* Octet 4 (cksn)*/
4006 /* Octet 5 */
4007 sec_mode = (tvb_get_guint8(tvb, offset + 4) >> 6) & 0x03;
4008 count = (tvb_get_guint8(tvb, offset + 4) >> 3) & 0x07;
4010 proto_tree_add_text(ext_tree_mm, tvb, offset + 1, 2, "Length: %x", length);
4011 if (gtp_version == 0)
4012 sec_mode = 1;
4015 switch (sec_mode) {
4016 case 0: /* Used cipher value, UMTS keys and Quintuplets */
4017 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn_ksi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4018 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4019 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4020 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4021 proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 16, "Ciphering key CK: %s", tvb_bytes_to_str(tvb, offset + 5, 16));
4022 proto_tree_add_text(ext_tree_mm, tvb, offset + 21, 16, "Integrity key IK: %s", tvb_bytes_to_str(tvb, offset + 21, 16));
4023 quint_len = tvb_get_ntohs(tvb, offset + 37);
4024 proto_tree_add_text(ext_tree_mm, tvb, offset + 37, 2, "Quintuplets length: 0x%x (%u)", quint_len, quint_len);
4026 offset = offset + decode_quintuplet(tvb, offset + 39, ext_tree_mm, count) + 39;
4029 break;
4030 case 1: /* GSM key and triplets */
4031 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4032 if (gtp_version != 0)
4033 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4035 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4036 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4037 proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 8, "Ciphering key Kc: %s", tvb_bytes_to_str(tvb, offset + 5, 8));
4039 offset = offset + decode_triplet(tvb, offset + 13, ext_tree_mm, count) + 13;
4041 break;
4042 case 2: /* UMTS key and quintuplets */
4043 proto_tree_add_item(ext_tree_mm, hf_gtp_ksi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4044 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4045 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4046 proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 16, "Ciphering key CK: %s", tvb_bytes_to_str(tvb, offset + 5, 16));
4047 proto_tree_add_text(ext_tree_mm, tvb, offset + 21, 16, "Integrity key IK: %s", tvb_bytes_to_str(tvb, offset + 21, 16));
4048 quint_len = tvb_get_ntohs(tvb, offset + 37);
4049 proto_tree_add_text(ext_tree_mm, tvb, offset + 37, 2, "Quintuplets length: 0x%x (%u)", quint_len, quint_len);
4051 offset = offset + decode_quintuplet(tvb, offset + 39, ext_tree_mm, count) + 39;
4053 break;
4054 case 3: /* GSM key and quintuplets */
4055 proto_tree_add_item(ext_tree_mm, hf_gtp_cksn, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
4056 proto_tree_add_item(ext_tree_mm, hf_gtp_security_mode, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4057 proto_tree_add_item(ext_tree_mm, hf_gtp_no_of_vectors, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4058 proto_tree_add_item(ext_tree_mm, hf_gtp_cipher_algorithm, tvb, offset + 4, 1, ENC_BIG_ENDIAN);
4059 proto_tree_add_text(ext_tree_mm, tvb, offset + 5, 8,
4060 "Ciphering key Kc: %s", tvb_bytes_to_str(tvb, offset + 5, 8));
4061 quint_len = tvb_get_ntohs(tvb, offset + 13);
4062 proto_tree_add_text(ext_tree_mm, tvb, offset + 13, 2, "Quintuplets length: 0x%x (%u)", quint_len, quint_len);
4064 offset = offset + decode_quintuplet(tvb, offset + 15, ext_tree_mm, count) + 15;
4066 break;
4067 default:
4068 break;
4072 * 3GPP TS 24.008 10.5.5.6 ( see packet-gsm_a.c )
4074 tf = proto_tree_add_text(ext_tree_mm, tvb, offset, 2, "DRX Parameter");
4075 tf_tree = proto_item_add_subtree(tf, ett_gtp_drx);
4076 de_gmm_drx_param(tvb, tf_tree, pinfo, offset, 2, NULL, 0);
4077 offset = offset + 2;
4079 len = tvb_get_guint8(tvb, offset);
4080 tf = proto_tree_add_text(ext_tree_mm, tvb, offset, len + 1, "MS Network Capability");
4082 tf_tree = proto_item_add_subtree(tf, ett_gtp_net_cap);
4084 proto_tree_add_text(tf_tree, tvb, offset, 1, "Length of MS network capability contents: %u", len);
4086 offset++;
4088 * GPP TS 24.008 10.5.5.12 ( see packet-gsm_a.c )
4090 de_gmm_ms_net_cap(tvb, tf_tree, pinfo, offset, len, NULL, 0);
4091 offset = offset + len;
4093 /* 3GPP TS 29.060 version 9.4.0 Release 9
4094 * The two octets Container Length holds the length of the Container, excluding the Container Length octets.
4095 * Container contains one or several optional information elements as described in the clause "Overview", from the clause
4096 * "General message format and information elements coding" in 3GPP TS 24.008 [5]. For the definition of the IEI see
4097 * table 47a, "IEIs for information elements used in the container". The IMEISV shall, if available, be included in the
4098 * Container. The IMEISV is included in the Mobile identity IE. If Container is not included, its Length field value shall
4099 * be set to 0. If the MS is emergency attached and the MS is UICCless or the IMSI is unauthenticated, the International
4100 * Mobile Equipment Identity (IMEI) shall be used as the MS identity.
4102 * Table 47A: IEIs for information elements used in the container
4103 * IEI Information element
4104 * 0x23 Mobile identity
4106 * NOTE: In 3GPP TS 24.008 [5] the IEI definition is
4107 * message dependent. The table is added to
4108 * have a unique definition in the present
4109 * document for the used IEI in the MMcontext.
4112 con_len = tvb_get_ntohs(tvb, offset);
4113 proto_tree_add_text(ext_tree_mm, tvb, offset, 2, "Container length: %u", con_len);
4114 offset = offset + 2;
4116 if (con_len > 0) {
4117 proto_tree_add_text(ext_tree_mm, tvb, offset, con_len, "Container");
4119 iei = tvb_get_guint8(tvb,offset);
4120 if (iei == 0x23) {
4121 proto_tree_add_text(ext_tree_mm, tvb, offset, 1, "Mobile identity IEI %u",iei);
4122 offset++;
4123 len = tvb_get_guint8(tvb,offset);
4124 proto_tree_add_text(ext_tree_mm, tvb, offset, 1, "Length %u",len);
4125 offset++;
4126 de_mid(tvb, ext_tree_mm, pinfo, offset, len, NULL, 0);
4127 } else {
4128 proto_tree_add_text(ext_tree_mm, tvb, offset, 1, "Unknown IEI %u - Later spec than TS 29.060 9.4.0 used?",iei);
4132 return 3 + length;
4135 /* Function to extract the value of an hexadecimal octet. Only the lower
4136 * nybble will be non-zero in the output.
4137 * */
4138 static guint8
4139 hex2dec(guint8 x)
4141 if ((x >= 'a') && (x <= 'f'))
4142 x = x - 'a' + 10;
4143 else if ((x >= 'A') && (x <= 'F'))
4144 x = x - 'A' + 10;
4145 else if ((x >= '0') && (x <= '9'))
4146 x = x - '0';
4147 else
4148 x = 0;
4149 return x;
4152 /* Wrapper function to add UTF-8 decoding for QoS attributes in
4153 * RADIUS messages.
4154 * */
4155 static guint8
4156 wrapped_tvb_get_guint8(tvbuff_t * tvb, int offset, int type)
4158 if (type == 2)
4159 return (hex2dec(tvb_get_guint8(tvb, offset)) << 4 | hex2dec(tvb_get_guint8(tvb, offset + 1)));
4160 else
4161 return tvb_get_guint8(tvb, offset);
4164 /* WARNING : actually length is coded on 2 octets for QoS profile but on 1 octet for PDP Context!
4165 * so type means length of length :-)
4167 * WARNING :) type does not mean length of length any more... see below for
4168 * type = 3!
4170 static int
4171 decode_qos_umts(tvbuff_t * tvb, int offset, proto_tree * tree, const gchar * qos_str, guint8 type)
4174 guint length;
4175 guint8 al_ret_priority;
4176 guint8 delay, reliability, peak, precedence, mean, spare1, spare2, spare3;
4177 guint8 traf_class, del_order, del_err_sdu;
4178 guint8 max_sdu_size, max_ul, max_dl, max_ul_ext, max_dl_ext;
4179 guint8 res_ber, sdu_err_ratio;
4180 guint8 trans_delay, traf_handl_prio;
4181 guint8 guar_ul, guar_dl, guar_ul_ext, guar_dl_ext;
4182 guint8 src_stat_desc, sig_ind;
4183 proto_tree *ext_tree_qos, *ext_tree_qos_arp;
4184 proto_item *te;
4185 int mss, mu, md, gu, gd;
4186 guint8 arp, qci;
4187 guint32 apn_ambr;
4188 guint64 br;
4190 /* Will keep if the input is UTF-8 encoded (as in RADIUS messages).
4191 * If 1, input is *not* UTF-8 encoded (i.e. each input octet corresponds
4192 * to one byte to be dissected).
4193 * If 2, input is UTF-8 encoded (i.e. each *couple* of input octets
4194 * corresponds to one byte to be dissected)
4195 * */
4196 guint8 utf8_type = 1;
4198 /* Will keep the release indicator as indicated in the RADIUS message */
4199 guint8 rel_ind = 0;
4201 /* In RADIUS messages the QoS has a version field of two octets prepended.
4202 * As of 29.061 v.3.a.0, there is an hyphen between "Release Indicator" and
4203 * <release specific QoS IE UTF-8 encoding>. Even if it sounds rather
4204 * inconsistent and unuseful, I will check hyphen presence here and
4205 * will signal its presence.
4206 * */
4207 guint8 hyphen;
4209 /* Will keep the value that will be returned
4210 * */
4211 int retval = 0;
4213 switch (type) {
4214 case 1:
4215 length = tvb_get_guint8(tvb, offset);
4216 te = proto_tree_add_text(tree, tvb, offset, length + 1, "%s", qos_str);
4217 ext_tree_qos = proto_item_add_subtree(te, ett_gtp_qos);
4218 proto_tree_add_text(ext_tree_qos, tvb, offset, 1, "Length: %u", length);
4219 offset++;
4220 retval = length + 1;
4221 break;
4222 case 2:
4223 length = tvb_get_ntohs(tvb, offset + 1);
4224 te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", qos_str);
4225 ext_tree_qos = proto_item_add_subtree(te, ett_gtp_qos);
4226 proto_tree_add_text(ext_tree_qos, tvb, offset + 1, 2, "Length: %u", length);
4227 offset += 3; /* +1 because of first 0x86 byte for UMTS QoS */
4228 retval = length + 3;
4229 break;
4230 case 3:
4231 /* For QoS inside RADIUS Client messages from GGSN/P-GW */
4232 utf8_type = 2;
4234 /* The field in the RADIUS message is the length of the tvb we were given */
4235 length = tvb_length(tvb);
4236 te = proto_tree_add_text(tree, tvb, offset, length, "%s", qos_str);
4238 ext_tree_qos = proto_item_add_subtree(te, ett_gtp_qos);
4240 rel_ind = wrapped_tvb_get_guint8(tvb, offset, 2);
4241 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_version, tvb, offset, 2, rel_ind);
4243 /* Hyphen handling */
4244 hyphen = tvb_get_guint8(tvb, offset + 2);
4245 if (hyphen == ((guint8) '-')) {
4246 /* Hyphen is present, put in protocol tree */
4247 proto_tree_add_text(ext_tree_qos, tvb, offset + 2, 1, "Hyphen separator: -");
4248 offset++; /* "Get rid" of hyphen */
4251 /* Now, we modify offset here and in order to use type later
4252 * effectively.*/
4253 offset++;
4255 length -= offset;
4256 length /= 2;
4258 retval = length + 2; /* Actually, will be ignored. */
4259 break;
4260 default:
4261 /* XXX - what should we do with the length here? */
4262 length = 0;
4263 retval = 0;
4264 ext_tree_qos = NULL;
4265 break;
4268 if ((type == 3) && (rel_ind == 8)) {
4269 /* Release 8 or higher P-GW QoS profile */
4270 offset++;
4271 arp = wrapped_tvb_get_guint8(tvb, offset, 2);
4272 te = proto_tree_add_text(ext_tree_qos, tvb, offset, 2, "Allocation/Retention Priority");
4273 ext_tree_qos_arp = proto_item_add_subtree(te, ett_gtp_qos_arp);
4274 proto_tree_add_boolean(ext_tree_qos_arp, hf_gtp_qos_arp_pci, tvb, offset, 2, arp);
4275 proto_tree_add_uint(ext_tree_qos_arp, hf_gtp_qos_arp_pl, tvb, offset, 2, arp);
4276 proto_tree_add_boolean(ext_tree_qos_arp, hf_gtp_qos_arp_pvi, tvb, offset, 2, arp);
4277 offset += 2;
4278 qci = wrapped_tvb_get_guint8(tvb, offset, 2);
4279 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_qci, tvb, offset, 2, qci);
4280 offset += 2;
4281 if (qci <= 4) {
4282 /* GBR QCI */
4283 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4284 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4285 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4286 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4287 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4288 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_ul_mbr, tvb, offset, 10, br);
4289 offset += 10;
4290 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4291 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4292 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4293 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4294 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4295 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_dl_mbr, tvb, offset, 10, br);
4296 offset += 10;
4297 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4298 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4299 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4300 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4301 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4302 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_ul_gbr, tvb, offset, 10, br);
4303 offset += 10;
4304 br = ((guint64)wrapped_tvb_get_guint8(tvb, offset , 2) << 32) |
4305 ((guint64)wrapped_tvb_get_guint8(tvb, offset+2, 2) << 24) |
4306 ((guint64)wrapped_tvb_get_guint8(tvb, offset+4, 2) << 16) |
4307 ((guint64)wrapped_tvb_get_guint8(tvb, offset+6, 2) << 8) |
4308 (guint64)wrapped_tvb_get_guint8(tvb, offset+8, 2);
4309 proto_tree_add_uint64(ext_tree_qos, hf_gtp_qos_dl_gbr, tvb, offset, 10, br);
4310 } else {
4311 /* non GBR QCI */
4312 apn_ambr = (wrapped_tvb_get_guint8(tvb, offset , 2) << 24) |
4313 (wrapped_tvb_get_guint8(tvb, offset+2, 2) << 16) |
4314 (wrapped_tvb_get_guint8(tvb, offset+4, 2) << 8) |
4315 wrapped_tvb_get_guint8(tvb, offset+6, 2);
4316 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_ul_apn_ambr, tvb, offset, 8, apn_ambr);
4317 offset += 8;
4318 apn_ambr = (wrapped_tvb_get_guint8(tvb, offset , 2) << 24) |
4319 (wrapped_tvb_get_guint8(tvb, offset+2, 2) << 16) |
4320 (wrapped_tvb_get_guint8(tvb, offset+4, 2) << 8) |
4321 wrapped_tvb_get_guint8(tvb, offset+6, 2);
4322 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_dl_apn_ambr, tvb, offset, 8, apn_ambr);
4324 return retval;
4327 /* In RADIUS messages there is no allocation-retention priority
4328 * so I don't need to wrap the following call to tvb_get_guint8
4329 * */
4330 al_ret_priority = tvb_get_guint8(tvb, offset);
4332 /* All calls are wrapped to take into account the possibility that the
4333 * input is UTF-8 encoded. If utf8_type is equal to 1, the final value
4334 * of the offset will be the same as in the previous version of this
4335 * dissector, and the wrapped function will serve as a dumb wrapper;
4336 * otherwise, if utf_8_type is 2, the offset is correctly shifted by
4337 * two bytes for needed shift, and the wrapped function will unencode
4338 * two values from the input.
4339 * */
4340 spare1 = wrapped_tvb_get_guint8(tvb, offset + (1 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SPARE1_MASK;
4341 delay = wrapped_tvb_get_guint8(tvb, offset + (1 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_DELAY_MASK;
4342 reliability = wrapped_tvb_get_guint8(tvb, offset + (1 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_RELIABILITY_MASK;
4343 peak = wrapped_tvb_get_guint8(tvb, offset + (2 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_PEAK_MASK;
4344 spare2 = wrapped_tvb_get_guint8(tvb, offset + (2 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SPARE2_MASK;
4345 precedence = wrapped_tvb_get_guint8(tvb, offset + (2 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_PRECEDENCE_MASK;
4346 spare3 = wrapped_tvb_get_guint8(tvb, offset + (3 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SPARE3_MASK;
4347 mean = wrapped_tvb_get_guint8(tvb, offset + (3 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_MEAN_MASK;
4349 /* In RADIUS messages there is no allocation-retention priority */
4350 if (type != 3)
4351 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_al_ret_priority, tvb, offset, 1, al_ret_priority);
4353 /* All additions must take care of the fact that QoS fields in RADIUS
4354 * messages are UTF-8 encoded, so we have to use the same trick as above.
4355 * */
4356 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare1, tvb, offset + (1 - 1) * utf8_type + 1, utf8_type, spare1);
4357 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_delay, tvb, offset + (1 - 1) * utf8_type + 1, utf8_type, delay);
4358 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_reliability, tvb, offset + (1 - 1) * utf8_type + 1, utf8_type, reliability);
4359 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_peak, tvb, offset + (2 - 1) * utf8_type + 1, utf8_type, peak);
4360 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare2, tvb, offset + (2 - 1) * utf8_type + 1, utf8_type, spare2);
4361 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_precedence, tvb, offset + (2 - 1) * utf8_type + 1, utf8_type, precedence);
4362 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_spare3, tvb, offset + (3 - 1) * utf8_type + 1, utf8_type, spare3);
4363 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_mean, tvb, offset + (3 - 1) * utf8_type + 1, utf8_type, mean);
4365 /* TS 24.008 V 7.8.0
4366 * The quality of service is a type 4 information element with a minimum length of 14 octets and a maximum length of 18
4367 * octets. The QoS requested by the MS shall be encoded both in the QoS attributes specified in octets 3-5 and in the QoS
4368 * attributes specified in octets 6-14.
4369 * In the MS to network direction and in the network to MS direction the following applies:
4370 * - Octets 15-18 are optional. If octet 15 is included, then octet 16 shall also be included, and octets 17 and 18 may
4371 * be included.
4372 * - If octet 17 is included, then octet 18 shall also be included.
4373 * - A QoS IE received without octets 6-18, without octets 14-18, without octets 15-18, or without octets 17-18 shall
4374 * be accepted by the receiving entity.
4377 if (length > 4) {
4379 /* See above for the need of wrapping
4382 /* Octet 6 */
4383 traf_class = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_TRAF_CLASS_MASK;
4384 del_order = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_DEL_ORDER_MASK;
4385 del_err_sdu = wrapped_tvb_get_guint8(tvb, offset + (4 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_DEL_ERR_SDU_MASK;
4386 max_sdu_size = wrapped_tvb_get_guint8(tvb, offset + (5 - 1) * utf8_type + 1, utf8_type);
4387 max_ul = wrapped_tvb_get_guint8(tvb, offset + (6 - 1) * utf8_type + 1, utf8_type);
4388 max_dl = wrapped_tvb_get_guint8(tvb, offset + (7 - 1) * utf8_type + 1, utf8_type);
4389 res_ber = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_RES_BER_MASK;
4390 sdu_err_ratio = wrapped_tvb_get_guint8(tvb, offset + (8 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SDU_ERR_RATIO_MASK;
4391 trans_delay = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_TRANS_DELAY_MASK;
4392 traf_handl_prio = wrapped_tvb_get_guint8(tvb, offset + (9 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK;
4393 guar_ul = wrapped_tvb_get_guint8(tvb, offset + (10 - 1) * utf8_type + 1, utf8_type);
4394 /* Octet 13 */
4395 guar_dl = wrapped_tvb_get_guint8(tvb, offset + (11 - 1) * utf8_type + 1, utf8_type);
4397 src_stat_desc = 0;
4398 sig_ind = 0;
4399 max_dl_ext = 0;
4400 guar_dl_ext = 0;
4401 max_ul_ext = 0;
4402 guar_ul_ext = 0;
4404 if (length > 13 ||((type == 2) && (length == 13))) {
4405 src_stat_desc = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SRC_STAT_DESC_MASK;
4406 sig_ind = wrapped_tvb_get_guint8(tvb, offset + (12 - 1) * utf8_type + 1, utf8_type) & GTP_EXT_QOS_SIG_IND_MASK;
4408 if (length > 14) {
4409 max_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (13 - 1) * utf8_type + 1, utf8_type);
4410 guar_dl_ext = wrapped_tvb_get_guint8(tvb, offset + (14 - 1) * utf8_type + 1, utf8_type);
4412 if (length > 16) {
4413 max_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (15 - 1) * utf8_type + 1, utf8_type);
4414 guar_ul_ext = wrapped_tvb_get_guint8(tvb, offset + (16 - 1) * utf8_type + 1, utf8_type);
4418 * See above comments for the changes
4420 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_class, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, traf_class);
4421 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_order, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, del_order);
4422 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_del_err_sdu, tvb, offset + (4 - 1) * utf8_type + 1, utf8_type, del_err_sdu);
4423 if (max_sdu_size == 0 || max_sdu_size > 150)
4424 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, max_sdu_size);
4425 if ((max_sdu_size > 0) && (max_sdu_size <= 150)) {
4426 mss = max_sdu_size * 10;
4427 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_sdu_size, tvb, offset + (5 - 1) * utf8_type + 1, utf8_type, mss,
4428 "%u octets", mss);
4431 if (max_ul == 0 || max_ul == 255)
4432 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul);
4433 if ((max_ul > 0) && (max_ul <= 63))
4434 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, max_ul,
4435 "%u kbps", max_ul);
4436 if ((max_ul > 63) && (max_ul <= 127)) {
4437 mu = 64 + (max_ul - 64) * 8;
4438 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
4439 "%u kbps", mu);
4442 if ((max_ul > 127) && (max_ul <= 254)) {
4443 mu = 576 + (max_ul - 128) * 64;
4444 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (6 - 1) * utf8_type + 1, utf8_type, mu,
4445 "%u kbps", mu);
4448 if (max_dl == 0 || max_dl == 255)
4449 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl);
4450 if ((max_dl > 0) && (max_dl <= 63))
4451 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, max_dl,
4452 "%u kbps", max_dl);
4453 if ((max_dl > 63) && (max_dl <= 127)) {
4454 md = 64 + (max_dl - 64) * 8;
4455 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
4456 "%u kbps", md);
4458 if ((max_dl > 127) && (max_dl <= 254)) {
4459 md = 576 + (max_dl - 128) * 64;
4460 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (7 - 1) * utf8_type + 1, utf8_type, md,
4461 "%u kbps", md);
4464 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_res_ber, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, res_ber);
4465 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_sdu_err_ratio, tvb, offset + (8 - 1) * utf8_type + 1, utf8_type, sdu_err_ratio);
4466 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_trans_delay, tvb, offset + (9 - 1) * utf8_type + 1, utf8_type, trans_delay);
4467 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_traf_handl_prio, tvb, offset + (9 - 1) * utf8_type + 1, utf8_type, traf_handl_prio);
4469 if (guar_ul == 0 || guar_ul == 255)
4470 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul);
4471 if ((guar_ul > 0) && (guar_ul <= 63))
4472 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, guar_ul,
4473 "%u kbps", guar_ul);
4474 if ((guar_ul > 63) && (guar_ul <= 127)) {
4475 gu = 64 + (guar_ul - 64) * 8;
4476 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
4477 "%u kbps", gu);
4479 if ((guar_ul > 127) && (guar_ul <= 254)) {
4480 gu = 576 + (guar_ul - 128) * 64;
4481 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (10 - 1) * utf8_type + 1, utf8_type, gu,
4482 "%u kbps", gu);
4485 /* Octet 13 */
4486 if (guar_dl == 0 || guar_dl == 255)
4487 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl);
4488 if ((guar_dl > 0) && (guar_dl <= 63))
4489 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, guar_dl,
4490 "%u kbps", guar_dl);
4491 if ((guar_dl > 63) && (guar_dl <= 127)) {
4492 gd = 64 + (guar_dl - 64) * 8;
4493 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
4494 "%u kbps", gd);
4496 if ((guar_dl > 127) && (guar_dl <= 254)) {
4497 gd = 576 + (guar_dl - 128) * 64;
4498 proto_tree_add_uint_format_value(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (11 - 1) * utf8_type + 1, utf8_type, gd,
4499 "%u kbps", gd);
4502 if(length > 13 ||((type == 2) && (length == 13))) {
4503 proto_tree_add_uint(ext_tree_qos, hf_gtp_qos_src_stat_desc, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, src_stat_desc);
4504 proto_tree_add_boolean(ext_tree_qos, hf_gtp_qos_sig_ind, tvb, offset + (12 - 1) * utf8_type + 1, utf8_type, sig_ind);
4508 if(length > 14) {
4509 /* Octet 15 */
4510 if ((max_dl_ext > 0) && (max_dl_ext <= 0x4a)) {
4511 md = 8600 + max_dl_ext * 100;
4512 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
4513 "Ext Maximum bit rate for downlink: %u kbps", md);
4515 if ((max_dl_ext > 0x4a) && (max_dl_ext <= 0xba)) {
4516 md = 16 + (max_dl_ext-0x4a);
4517 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
4518 "Ext Maximum bit rate for downlink: %u Mbps", md);
4520 if ((max_dl_ext > 0xba) && (max_dl_ext <= 0xfa)) {
4521 md = 128 + (max_dl_ext-0xba)*2;
4522 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_dl, tvb, offset + (13 - 1) * utf8_type + 1, utf8_type, md,
4523 "Ext Maximum bit rate for downlink: %u Mbps", md);
4525 /* Octet 16 */
4526 if(guar_dl_ext == 0)
4527 proto_tree_add_text(ext_tree_qos, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, "Use the value indicated by the Guaranteed bit rate for downlink in octet 13");
4528 if ((guar_dl_ext > 0) && (guar_dl_ext <= 0x4a)) {
4529 gd = 8600 + guar_dl_ext * 100;
4530 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
4531 "Ext Guaranteed bit rate for downlink: %u kbps", gd);
4533 if ((guar_dl_ext > 0x4a) && (max_dl_ext <= 0xba)) {
4534 gd = 16 + (guar_dl_ext-0x4a);
4535 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
4536 "Ext Guaranteed bit rate for downlink: %u Mbps", gd);
4538 if ((guar_dl_ext > 0xba) && (max_dl_ext <= 0xfa)) {
4539 gd = 128 + (guar_dl_ext-0xba)*2;
4540 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_dl, tvb, offset + (14 - 1) * utf8_type + 1, utf8_type, gd,
4541 "Ext Guaranteed bit rate for downlink: %u Mbps", gd);
4545 if(length > 16) {
4546 /* Octet 17
4547 * This field is an extension of the Maximum bit rate for uplink in octet 8. The coding is identical to that of the Maximum bit
4548 * rate for downlink (extended).
4550 if ((max_ul_ext > 0) && (max_ul_ext <= 0x4a)) {
4551 md = 8600 + max_ul_ext * 100;
4552 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
4553 "Ext Maximum bit rate for uplink: %u kbps", md);
4555 if ((max_ul_ext > 0x4a) && (max_ul_ext <= 0xba)) {
4556 md = 16 + (max_ul_ext-0x4a);
4557 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
4558 "Ext Maximum bit rate for uplink: %u Mbps", md);
4560 if ((max_ul_ext > 0xba) && (max_ul_ext <= 0xfa)) {
4561 md = 128 + (max_ul_ext-0xba)*2;
4562 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_max_ul, tvb, offset + (15 - 1) * utf8_type + 1, utf8_type, md,
4563 "Ext Maximum bit rate for uplink: %u Mbps", md);
4565 /* Octet 18 */
4566 if (guar_ul_ext == 0)
4567 proto_tree_add_text(ext_tree_qos, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, "Use the value indicated by the Guaranteed bit rate for uplink in octet 12");
4568 if ((guar_ul_ext > 0) && (guar_ul_ext <= 0x4a)) {
4569 gd = 8600 + guar_ul_ext * 100;
4570 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
4571 "Ext Guaranteed bit rate for uplink: %u kbps", gd);
4573 if ((guar_ul_ext > 0x4a) && (max_ul_ext <= 0xba)) {
4574 gd = 16 + (guar_ul_ext-0x4a);
4575 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
4576 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
4578 if ((guar_ul_ext > 0xba) && (max_ul_ext <= 0xfa)) {
4579 gd = 128 + (guar_ul_ext-0xba)*2;
4580 proto_tree_add_uint_format(ext_tree_qos, hf_gtp_qos_guar_ul, tvb, offset + (16 - 1) * utf8_type + 1, utf8_type, gd,
4581 "Ext Guaranteed bit rate for uplink: %u Mbps", gd);
4587 return retval;
4590 /* Diameter 3GPP AVP Code: 5 3GPP-GPRS Negotiated QoS profile */
4591 static int
4592 dissect_diameter_3gpp_qosprofile(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
4594 decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3);
4595 return tvb_length(tvb);
4598 static const gchar *
4599 dissect_radius_qos_umts(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo _U_)
4601 decode_qos_umts(tvb, 0, tree, "UMTS GTP QoS Profile", 3);
4602 return tvb_get_string(wmem_packet_scope(), tvb, 0, tvb_length(tvb));
4605 #define MAX_APN_LENGTH 100
4607 static void
4608 decode_apn(tvbuff_t * tvb, int offset, guint16 length, proto_tree * tree, proto_item *item)
4610 guint8 str[MAX_APN_LENGTH+1];
4611 guint curr_len;
4613 /* init buffer and copy it */
4614 memset(str, 0, MAX_APN_LENGTH);
4615 tvb_memcpy(tvb, str, offset, length<MAX_APN_LENGTH?length:MAX_APN_LENGTH);
4617 curr_len = 0;
4618 while ((curr_len < length) && (curr_len < MAX_APN_LENGTH))
4620 guint step = str[curr_len];
4621 str[curr_len] = '.';
4622 curr_len += step+1;
4625 /* High light bytes including the first lenght byte */
4626 proto_tree_add_string(tree, hf_gtp_apn, tvb, offset, length, str+1);
4627 if(item){
4628 proto_item_append_text(item, ": %s", str+1);
4633 static void
4634 decode_fqdn(tvbuff_t * tvb, int offset, guint16 length, proto_tree * tree)
4636 guint8 *fqdn = NULL;
4637 int name_len, tmp;
4639 if (length > 0) {
4640 name_len = tvb_get_guint8(tvb, offset);
4642 if (name_len < 0x20) {
4643 fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset + 1, length - 1);
4644 for (;;) {
4645 if (name_len >= length - 1)
4646 break;
4647 tmp = name_len;
4648 name_len = name_len + fqdn[tmp] + 1;
4649 fqdn[tmp] = '.';
4651 } else
4652 fqdn = tvb_get_string(wmem_packet_scope(), tvb, offset, length);
4654 proto_tree_add_string(tree, hf_gtp_fqdn, tvb, offset, length, fqdn);
4659 * GPRS: 9.60 v7.6.0, chapter 7.9.20
4660 * UMTS: 29.060 v4.0, chapter 7.7.29 PDP Context
4661 * TODO: unify addr functions
4663 static int
4664 decode_gtp_pdp_cntxt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4667 guint8 ggsn_addr_len, apn_len, trans_id, vaa, asi, order;
4668 guint8 nsapi, sapi, pdu_send_no, pdu_rec_no;
4669 guint8 pdp_cntxt_id, pdp_type_org, pdp_type_num, pdp_addr_len;
4670 guint16 length, sn_down, sn_up, up_flow;
4671 guint32 addr_ipv4;
4672 struct e_in6_addr addr_ipv6;
4673 proto_tree *ext_tree_pdp;
4674 proto_item *te;
4676 length = tvb_get_ntohs(tvb, offset + 1);
4678 te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_PDP_CNTXT, &gtp_val_ext, "Unknown message"));
4679 ext_tree_pdp = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_PDP_CNTXT]);
4681 vaa = (tvb_get_guint8(tvb, offset + 3) >> 6) & 0x01;
4682 asi = (tvb_get_guint8(tvb, offset + 3) >> 5) & 0x01;
4683 order = (tvb_get_guint8(tvb, offset + 3) >> 4) & 0x01;
4684 nsapi = tvb_get_guint8(tvb, offset + 3) & 0x0F;
4685 sapi = tvb_get_guint8(tvb, offset + 4) & 0x0F;
4687 proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "VPLMN address allowed: %s", yesno[vaa]);
4688 proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "Activity Status Indicator: %s", yesno[asi]);
4689 proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "Reordering required: %s", yesno[order]);
4690 proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 1, "NSAPI: %u", nsapi);
4691 proto_tree_add_text(ext_tree_pdp, tvb, offset + 4, 1, "SAPI: %u", sapi);
4693 switch (gtp_version) {
4694 case 0:
4695 decode_qos_gprs(tvb, offset + 5, ext_tree_pdp, "QoS subscribed", 0);
4696 decode_qos_gprs(tvb, offset + 8, ext_tree_pdp, "QoS requested", 0);
4697 decode_qos_gprs(tvb, offset + 11, ext_tree_pdp, "QoS negotiated", 0);
4698 offset = offset + 14;
4699 break;
4700 case 1:
4701 offset = offset + 5;
4702 offset = offset + decode_qos_umts(tvb, offset, ext_tree_pdp, "QoS subscribed", 1);
4703 offset = offset + decode_qos_umts(tvb, offset, ext_tree_pdp, "QoS requested", 1);
4704 offset = offset + decode_qos_umts(tvb, offset, ext_tree_pdp, "QoS negotiated", 1);
4705 break;
4706 default:
4707 break;
4710 sn_down = tvb_get_ntohs(tvb, offset);
4711 sn_up = tvb_get_ntohs(tvb, offset + 2);
4712 pdu_send_no = tvb_get_guint8(tvb, offset + 4);
4713 pdu_rec_no = tvb_get_guint8(tvb, offset + 5);
4715 proto_tree_add_text(ext_tree_pdp, tvb, offset, 2, "Sequence number down: %u", sn_down);
4716 proto_tree_add_text(ext_tree_pdp, tvb, offset + 2, 2, "Sequence number up: %u", sn_up);
4717 proto_tree_add_text(ext_tree_pdp, tvb, offset + 4, 1, "Send N-PDU number: %u", pdu_send_no);
4718 proto_tree_add_text(ext_tree_pdp, tvb, offset + 5, 1, "Receive N-PDU number: %u", pdu_rec_no);
4720 switch (gtp_version) {
4721 case 0:
4722 up_flow = tvb_get_ntohs(tvb, offset + 6);
4723 proto_tree_add_text(ext_tree_pdp, tvb, offset + 6, 2, "Uplink flow label signalling: %u", up_flow);
4724 offset = offset + 8;
4725 break;
4726 case 1:
4727 pdp_cntxt_id = tvb_get_guint8(tvb, offset + 14);
4728 proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_cp, tvb, offset + 6, 4, ENC_BIG_ENDIAN);
4729 proto_tree_add_item(ext_tree_pdp, hf_gtp_ulink_teid_data, tvb, offset + 10, 4, ENC_BIG_ENDIAN);
4730 proto_tree_add_text(ext_tree_pdp, tvb, offset + 14, 1, "PDP context identifier: %u", pdp_cntxt_id);
4731 offset = offset + 15;
4732 break;
4733 default:
4734 break;
4737 pdp_type_org = tvb_get_guint8(tvb, offset) & 0x0F;
4738 pdp_type_num = tvb_get_guint8(tvb, offset + 1);
4739 pdp_addr_len = tvb_get_guint8(tvb, offset + 2);
4741 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "PDP organization: %s", val_to_str_const(pdp_type_org, pdp_type, "Unknown PDP org"));
4742 proto_tree_add_text(ext_tree_pdp, tvb, offset + 1, 1, "PDP type: %s", val_to_str_const(pdp_type_num, pdp_type, "Unknown PDP type"));
4743 proto_tree_add_text(ext_tree_pdp, tvb, offset + 2, 1, "PDP address length: %u", pdp_addr_len);
4745 if (pdp_addr_len > 0) {
4746 switch (pdp_type_num) {
4747 case 0x21:
4748 addr_ipv4 = tvb_get_ipv4(tvb, offset + 3);
4749 proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 4, "PDP address: %s", ip_to_str((guint8 *) & addr_ipv4));
4750 break;
4751 case 0x57:
4752 tvb_get_ipv6(tvb, offset + 3, &addr_ipv6);
4753 proto_tree_add_text(ext_tree_pdp, tvb, offset + 3, 16, "PDP address: %s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
4754 break;
4755 default:
4756 break;
4760 offset = offset + 3 + pdp_addr_len;
4762 ggsn_addr_len = tvb_get_guint8(tvb, offset);
4763 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "GGSN address length: %u", ggsn_addr_len);
4765 switch (ggsn_addr_len) {
4766 case 4:
4767 addr_ipv4 = tvb_get_ipv4(tvb, offset + 1);
4768 proto_tree_add_text(ext_tree_pdp, tvb, offset + 1, 4, "GGSN Address for control plane: %s", ip_to_str((guint8 *) & addr_ipv4));
4769 break;
4770 case 16:
4771 tvb_get_ipv6(tvb, offset + 1, &addr_ipv6);
4772 proto_tree_add_text(ext_tree_pdp, tvb, offset + 1, 16, "GGSN Address for User Traffic: %s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
4773 break;
4774 default:
4775 break;
4778 offset = offset + 1 + ggsn_addr_len;
4780 if (gtp_version == 1) {
4782 ggsn_addr_len = tvb_get_guint8(tvb, offset);
4783 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "GGSN 2 address length: %u", ggsn_addr_len);
4785 switch (ggsn_addr_len) {
4786 case 4:
4787 addr_ipv4 = tvb_get_ipv4(tvb, offset + 1);
4788 proto_tree_add_text(ext_tree_pdp, tvb, offset + 1, 4, "GGSN 2 address: %s", ip_to_str((guint8 *) & addr_ipv4));
4789 break;
4790 case 16:
4791 tvb_get_ipv6(tvb, offset + 1, &addr_ipv6);
4792 proto_tree_add_text(ext_tree_pdp, tvb, offset + 1, 16, "GGSN 2 address: %s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
4793 break;
4794 default:
4795 break;
4797 offset = offset + 1 + ggsn_addr_len;
4801 apn_len = tvb_get_guint8(tvb, offset);
4802 proto_tree_add_text(ext_tree_pdp, tvb, offset, 1, "APN length: %u", apn_len);
4803 decode_apn(tvb, offset + 1, apn_len, ext_tree_pdp, NULL);
4805 offset = offset + 1 + apn_len;
4807 * The Transaction Identifier is the 4 or 12 bit Transaction Identifier used in the 3GPP TS 24.008 [5] Session Management
4808 * messages which control this PDP Context. If the length of the Transaction Identifier is 4 bit, the second octet shall be
4809 * set to all zeros. The encoding is defined in 3GPP TS 24.007 [3]. The latest Transaction Identifier sent from SGSN to
4810 * MS is stored in the PDP context IE.
4811 * NOTE: Bit 5-8 of the first octet in the encoding defined in 3GPP TS 24.007 [3] is mapped into bit 1-4 of the first
4812 * octet in this field.
4814 trans_id = tvb_get_guint8(tvb, offset);
4815 proto_tree_add_text(ext_tree_pdp, tvb, offset, 2, "Transaction identifier: %u", trans_id);
4817 return 3 + length;
4820 /* GPRS: 9.60, v7.6.0, chapter 7.9.21
4821 * UMTS: 29.060, v4.0, chapter 7.7.30
4823 static int
4824 decode_gtp_apn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4827 guint16 length;
4828 proto_tree *ext_tree_apn;
4829 proto_item *te;
4831 length = tvb_get_ntohs(tvb, offset + 1);
4833 te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_APN, &gtp_val_ext, "Unknown field"));
4834 ext_tree_apn = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_APN]);
4836 proto_tree_add_text(ext_tree_apn, tvb, offset + 1, 2, "APN length : %u", length);
4837 decode_apn(tvb, offset + 3, length, ext_tree_apn, te);
4839 return 3 + length;
4842 /* GPRS: 9.60 v7.6.0, chapter 7.9.22
4843 * 4.08 v. 7.1.2, chapter 10.5.6.3 (p.580)
4844 * UMTS: 29.060 v4.0, chapter 7.7.31 Protocol Configuration Options
4845 * 24.008, v4.2, chapter 10.5.6.3
4848 decode_gtp_proto_conf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4851 guint16 length;
4852 tvbuff_t *next_tvb;
4853 proto_tree *ext_tree_proto;
4854 proto_item *te;
4856 length = tvb_get_ntohs(tvb, offset + 1);
4858 te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_PROTO_CONF, &gtp_val_ext, "Unknown message"));
4859 ext_tree_proto = proto_item_add_subtree(te, ett_gtp_proto);
4861 proto_tree_add_text(ext_tree_proto, tvb, offset + 1, 2, "Length: %u", length);
4863 if (length < 1)
4864 return 3;
4866 /* The Protocol Configuration Options contains external network protocol options that may be necessary to transfer
4867 * between the GGSN and the MS. The content and the coding of the Protocol Configuration are defined in octet 3-z of the
4868 * Protocol Configuration Options in3GPP TS 24.008 [5].
4870 next_tvb = tvb_new_subset(tvb, offset + 3, length, length);
4871 de_sm_pco(next_tvb, ext_tree_proto, pinfo, 0, length, NULL, 0);
4873 return 3 + length;
4876 /* GPRS: 9.60 v7.6.0, chapter 7.9.23
4877 * UMTS: 29.060 v4.0, chapter 7.7.32
4879 static int
4880 decode_gtp_gsn_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4883 guint8 addr_type, addr_len;
4884 guint16 length;
4885 guint32 addr_ipv4;
4886 struct e_in6_addr addr_ipv6;
4887 proto_tree *ext_tree_gsn_addr;
4888 proto_item *te;
4890 length = tvb_get_ntohs(tvb, offset + 1);
4892 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "GSN address : ");
4893 ext_tree_gsn_addr = proto_item_add_subtree(te, ett_gtp_gsn_addr);
4895 switch (length) {
4896 case 4:
4897 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset + 1, 2, "GSN address length : %u", length);
4898 addr_ipv4 = tvb_get_ipv4(tvb, offset + 3);
4899 proto_item_append_text(te, "%s", ip_to_str((guint8 *) & addr_ipv4));
4900 proto_tree_add_ipv4(ext_tree_gsn_addr, hf_gtp_gsn_ipv4, tvb, offset + 3, 4, addr_ipv4);
4901 break;
4902 case 5:
4903 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset + 1, 2, "GSN address Information Element length : %u", length);
4904 addr_type = tvb_get_guint8(tvb, offset + 3) & 0xC0;
4905 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_type, tvb, offset + 3, 1, addr_type);
4906 addr_len = tvb_get_guint8(tvb, offset + 3) & 0x3F;
4907 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_len, tvb, offset + 3, 1, addr_len);
4908 addr_ipv4 = tvb_get_ipv4(tvb, offset + 4);
4909 proto_item_append_text(te, "%s", ip_to_str((guint8 *) & addr_ipv4));
4910 proto_tree_add_ipv4(ext_tree_gsn_addr, hf_gtp_gsn_ipv4, tvb, offset + 4, 4, addr_ipv4);
4911 break;
4912 case 16:
4913 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset + 1, 2, "GSN address length : %u", length);
4914 tvb_get_ipv6(tvb, offset + 3, &addr_ipv6);
4915 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
4916 proto_tree_add_ipv6(ext_tree_gsn_addr, hf_gtp_gsn_ipv6, tvb, offset + 3, 16, (guint8 *) & addr_ipv6);
4917 break;
4918 case 17:
4919 proto_tree_add_text(ext_tree_gsn_addr, tvb, offset + 1, 2, "GSN address Information Element length : %u", length);
4920 addr_type = tvb_get_guint8(tvb, offset + 3) & 0xC0;
4921 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_type, tvb, offset + 3, 1, addr_type);
4922 addr_len = tvb_get_guint8(tvb, offset + 3) & 0x3F;
4923 proto_tree_add_uint(ext_tree_gsn_addr, hf_gtp_gsn_addr_len, tvb, offset + 3, 1, addr_len);
4924 tvb_get_ipv6(tvb, offset + 4, &addr_ipv6);
4925 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
4926 proto_tree_add_ipv6(ext_tree_gsn_addr, hf_gtp_gsn_ipv6, tvb, offset + 4, 16, (guint8 *) & addr_ipv6);
4927 break;
4928 default:
4929 proto_item_append_text(te, "unknown type or wrong length");
4930 break;
4933 return 3 + length;
4936 /* GPRS: 9.60 v7.6.0, chapter 7.9.24
4937 * UMTS: 29.060 v4.0, chapter 7.7.33
4939 static int
4940 decode_gtp_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
4942 guint16 length;
4943 tvbuff_t *next_tvb;
4944 proto_tree *ext_tree_proto;
4945 proto_item *te;
4947 length = tvb_get_ntohs(tvb, offset + 1);
4949 te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_MSISDN, &gtp_val_ext, "Unknown message"));
4950 ext_tree_proto = proto_item_add_subtree(te, ett_gtp_proto);
4952 proto_tree_add_text(ext_tree_proto, tvb, offset + 1, 2, "Length: %u", length);
4954 length = tvb_get_ntohs(tvb, offset + 1);
4956 if (length < 1)
4957 return 3;
4959 next_tvb = tvb_new_subset(tvb, offset+3, length, length);
4960 dissect_gsm_map_msisdn(next_tvb, pinfo, ext_tree_proto);
4962 return 3 + length;
4965 /* GPRS: not present
4966 * UMTS: 29.060 v4.0, chapter 7.7.34
4967 * 24.008 v4.2, chapter 10.5.6.5
4969 static int
4970 decode_gtp_qos_umts(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4973 return decode_qos_umts(tvb, offset, tree, "Quality of Service", 2);
4976 /* GPRS: not present
4977 * UMTS: 29.060 v4.0, chapter 7.7.35
4979 static int
4980 decode_gtp_auth_qui(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
4983 proto_tree *ext_tree;
4984 proto_item *te_quint;
4985 guint16 length;
4986 guint8 xres_len, auth_len;
4989 length = tvb_get_ntohs(tvb, offset + 1);
4991 te_quint = proto_tree_add_text(tree, tvb, offset, length + 1, "Quintuplet");
4992 ext_tree = proto_item_add_subtree(te_quint, ett_gtp_quint);
4993 offset++;
4995 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
4996 offset = offset + 2;
4998 proto_tree_add_text(ext_tree, tvb, offset, 16, "RAND: %s", tvb_bytes_to_str(tvb, offset, 16));
4999 offset = offset + 16;
5000 xres_len = tvb_get_guint8(tvb, offset);
5001 proto_tree_add_text(ext_tree, tvb, offset, 1, "XRES length: %u", xres_len);
5002 offset++;
5003 proto_tree_add_text(ext_tree, tvb, offset, xres_len, "XRES: %s", tvb_bytes_to_str(tvb, offset, xres_len));
5004 offset = offset + xres_len;
5005 proto_tree_add_text(ext_tree, tvb, offset, 16, "Quintuplet Ciphering Key: %s", tvb_bytes_to_str(tvb, offset, 16));
5006 offset = offset + 16;
5007 proto_tree_add_text(ext_tree, tvb, offset, 16, "Quintuplet Integrity Key: %s", tvb_bytes_to_str(tvb, offset, 16));
5008 offset = offset + 16;
5009 auth_len = tvb_get_guint8(tvb, offset);
5010 proto_tree_add_text(ext_tree, tvb, offset, 1, "Authentication length: %u", auth_len);
5011 offset++;
5012 proto_tree_add_text(ext_tree, tvb, offset, auth_len, "AUTH: %s", tvb_bytes_to_str(tvb, offset, auth_len));
5014 return (3 + length);
5018 /* GPRS: not present
5019 * UMTS: 29.060 v4.0, chapter 7.7.36
5020 * 24.008 v4.2, chapter 10.5.6.12
5022 static int
5023 decode_gtp_tft(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5026 guint16 length, port1, port2, tos;
5027 guint8 tft_flags, tft_code, no_packet_filters, i, pf_id, pf_eval, pf_len, pf_content_id, proto;
5028 guint pf_offset;
5029 guint32 mask_ipv4, addr_ipv4, ipsec_id, label;
5030 struct e_in6_addr addr_ipv6, mask_ipv6;
5031 proto_tree *ext_tree_tft, *ext_tree_tft_pf, *ext_tree_tft_flags;
5032 proto_item *te, *tee, *tef;
5034 length = tvb_get_ntohs(tvb, offset + 1);
5036 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Traffic flow template");
5037 ext_tree_tft = proto_item_add_subtree(te, ett_gtp_tft);
5039 tft_flags = tvb_get_guint8(tvb, offset + 3);
5040 tft_code = (tft_flags >> 5) & 0x07;
5041 no_packet_filters = tft_flags & 0x0F;
5043 proto_tree_add_text(ext_tree_tft, tvb, offset + 1, 2, "TFT length: %u", length);
5045 tef = proto_tree_add_text(ext_tree_tft, tvb, offset + 3, 1, "TFT flags");
5046 ext_tree_tft_flags = proto_item_add_subtree(tef, ett_gtp_tft_flags);
5047 proto_tree_add_uint(ext_tree_tft_flags, hf_gtp_tft_code, tvb, offset + 3, 1, tft_flags);
5048 proto_tree_add_uint(ext_tree_tft_flags, hf_gtp_tft_spare, tvb, offset + 3, 1, tft_flags);
5049 proto_tree_add_uint(ext_tree_tft_flags, hf_gtp_tft_number, tvb, offset + 3, 1, tft_flags);
5051 offset = offset + 4;
5053 for (i = 0; i < no_packet_filters; i++) {
5055 pf_id = tvb_get_guint8(tvb, offset);
5057 tee = proto_tree_add_text(ext_tree_tft, tvb, offset, 1, "Packet filter id: %u", pf_id);
5058 ext_tree_tft_pf = proto_item_add_subtree(tee, ett_gtp_tft_pf);
5059 offset++;
5061 if (tft_code != 2) {
5063 pf_eval = tvb_get_guint8(tvb, offset);
5064 pf_len = tvb_get_guint8(tvb, offset + 1);
5066 proto_tree_add_uint(ext_tree_tft_pf, hf_gtp_tft_eval, tvb, offset, 1, pf_eval);
5067 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + 1, 1, "Content length: %u", pf_len);
5069 offset = offset + 2;
5070 pf_offset = 0;
5072 while (pf_offset < pf_len) {
5074 pf_content_id = tvb_get_guint8(tvb, offset + pf_offset);
5076 switch (pf_content_id) {
5077 /* address IPv4 and mask = 8 bytes */
5078 case 0x10:
5079 addr_ipv4 = tvb_get_ipv4(tvb, offset + pf_offset + 1);
5080 mask_ipv4 = tvb_get_ipv4(tvb, offset + pf_offset + 5);
5081 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 9, "ID 0x10: IPv4/mask: %s/%s", ip_to_str((guint8 *) & addr_ipv4),
5082 ip_to_str((guint8 *) & mask_ipv4));
5083 pf_offset = pf_offset + 9;
5084 break;
5085 /* address IPv6 and mask = 32 bytes */
5086 case 0x20:
5087 tvb_get_ipv6(tvb, offset + pf_offset + 1, &addr_ipv6);
5088 tvb_get_ipv6(tvb, offset + pf_offset + 17, &mask_ipv6);
5089 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 33, "ID 0x20: IPv6/mask: %s/%s",
5090 ip6_to_str((struct e_in6_addr *) &addr_ipv6), ip6_to_str((struct e_in6_addr *) &mask_ipv6));
5091 pf_offset = pf_offset + 33;
5092 break;
5093 /* protocol identifier/next header type = 1 byte */
5094 case 0x30:
5095 proto = tvb_get_guint8(tvb, offset + pf_offset + 1);
5096 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 2, "ID 0x30: IPv4 protocol identifier/IPv6 next header: %u (%x)",
5097 proto, proto);
5098 pf_offset = pf_offset + 2;
5099 break;
5100 /* single destination port type = 2 bytes */
5101 case 0x40:
5102 port1 = tvb_get_ntohs(tvb, offset + pf_offset + 1);
5103 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 3, "ID 0x40: destination port: %u", port1);
5104 pf_offset = pf_offset + 3;
5105 break;
5106 /* destination port range type = 4 bytes */
5107 case 0x41:
5108 port1 = tvb_get_ntohs(tvb, offset + pf_offset + 1);
5109 port2 = tvb_get_ntohs(tvb, offset + pf_offset + 3);
5110 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 5, "ID 0x41: destination port range: %u - %u", port1, port2);
5111 pf_offset = pf_offset + 5;
5112 break;
5113 /* single source port type = 2 bytes */
5114 case 0x50:
5115 port1 = tvb_get_ntohs(tvb, offset + pf_offset + 1);
5116 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 3, "ID 0x50: source port: %u", port1);
5117 pf_offset = pf_offset + 3;
5118 break;
5119 /* source port range type = 4 bytes */
5120 case 0x51:
5121 port1 = tvb_get_ntohs(tvb, offset + pf_offset + 1);
5122 port2 = tvb_get_ntohs(tvb, offset + pf_offset + 3);
5123 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 5, "ID 0x51: source port range: %u - %u", port1, port2);
5124 pf_offset = pf_offset + 5;
5125 break;
5126 /* security parameter index type = 4 bytes */
5127 case 0x60:
5128 ipsec_id = tvb_get_ntohl(tvb, offset + pf_offset + 1);
5129 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 5, "ID 0x60: security parameter index: %x", ipsec_id);
5130 pf_offset = pf_offset + 5;
5131 break;
5132 /* type of service/traffic class type = 2 bytes */
5133 case 0x70:
5134 tos = tvb_get_ntohs(tvb, offset + pf_offset + 1);
5135 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 2, "ID 0x70: Type of Service/Traffic Class: %u (%x)", tos, tos);
5136 pf_offset = pf_offset + 3;
5137 break;
5138 /* flow label type = 3 bytes */
5139 case 0x80:
5140 label = tvb_get_ntoh24(tvb, offset + pf_offset + 1) & 0x0FFFFF;
5141 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 4, "ID 0x80: Flow Label: %u (%x)", label, label);
5142 pf_offset = pf_offset + 4;
5143 break;
5145 default:
5146 proto_tree_add_text(ext_tree_tft_pf, tvb, offset + pf_offset, 1, "Unknown value: %x ", pf_content_id);
5147 pf_offset++; /* to avoid infinite loop */
5148 break;
5152 offset = offset + pf_offset;
5156 return 3 + length;
5159 /* GPRS: not present
5160 * UMTS: 3GPP TS 29.060 version 10.4.0 Release 10, chapter 7.7.37
5161 * Type = 138 (Decimal)
5162 * 25.413(RANAP) TargetID
5163 * There are several CRs to to this IE make sure to check with a recent spec if dissection is questioned.
5165 static int
5166 decode_gtp_target_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5169 guint16 length;
5170 proto_item *te;
5171 proto_tree *ext_tree;
5173 length = tvb_get_ntohs(tvb, offset + 1);
5175 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Target Identification");
5176 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_TARGET_ID]);
5177 offset = offset + 1;
5178 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5179 offset = offset + 2;
5180 /* Quote from specification:
5181 * The Target Identification information element contains the identification of a target RNC. Octets 4-n shall contain a
5182 * non-transparent copy of the corresponding IEs (see subclause 7.7.2) and be encoded as specified in Figure 51 below.
5183 * The "Target RNC-ID" part of the "Target ID" parameter is specified in 3GPP TS 25.413 [7].
5184 * NOTE 1: The ASN.1 parameter "Target ID" is forwarded non-transparently in order to maintain backward compatibility.
5185 * NOTE 2: The preamble of the "Target RNC-ID" (numerical value of e.g. 0x20) however shall not be included in
5186 * octets 4-n. Also the optional "iE-Extensions" parameter shall not be included into the GTP IE.
5188 /* Octet 4-6 MCC + MNC */
5189 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree, offset, TRUE);
5190 offset+=3;
5191 /* Octet 7-8 LAC */
5192 proto_tree_add_item(ext_tree, hf_gtp_rai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
5193 offset+=2;
5194 /* Octet 9 RAC */
5195 proto_tree_add_item(ext_tree, hf_gtp_rai_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
5196 offset++;
5197 /* Octet 10-11 RNC-ID*/
5198 proto_tree_add_item(ext_tree, hf_gtp_target_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5199 /* If the optional Extended RNC-ID is not included, then the length variable 'n' = 8 and the overall length of the IE is 11
5200 * octets. Otherwise, 'n' = 10 and the overall length of the IE is 13 octets
5202 if(length == 10){
5203 proto_tree_add_item(ext_tree, hf_gtp_target_ext_rnc_id, tvb, offset, 2, ENC_BIG_ENDIAN);
5206 return 3 + length;
5210 /* GPRS: not present
5211 * UMTS: 29.060 v4.0, chapter 7.7.38
5213 static int
5214 decode_gtp_utran_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5217 guint16 length;
5218 proto_item *te;
5219 proto_tree *ext_tree;
5221 length = tvb_get_ntohs(tvb, offset + 1);
5223 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "UTRAN transparent Container");
5224 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_UTRAN_CONT]);
5225 offset = offset + 1;
5226 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5227 offset = offset + 2;
5228 proto_tree_add_item(ext_tree, hf_gtp_utran_field, tvb, offset, length, ENC_NA);
5230 return 3 + length;
5235 /* GPRS: not present
5236 * UMTS: 29.060 v4.0, chapter 7.7.39
5238 static int
5239 decode_gtp_rab_setup(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5242 guint32 teid, addr_ipv4;
5243 guint16 length;
5244 struct e_in6_addr addr_ipv6;
5245 proto_tree *ext_tree_rab_setup;
5246 proto_item *te;
5248 length = tvb_get_ntohs(tvb, offset + 1);
5250 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Radio Access Bearer Setup Information");
5251 ext_tree_rab_setup = proto_item_add_subtree(te, ett_gtp_rab_setup);
5253 proto_tree_add_text(ext_tree_rab_setup, tvb, offset + 1, 2, "RAB setup length : %u", length);
5254 proto_tree_add_item(ext_tree_rab_setup, hf_gtp_nsapi, tvb, offset + 3, 1, ENC_BIG_ENDIAN);
5256 if (length > 1) {
5258 teid = tvb_get_ntohl(tvb, offset + 4);
5260 proto_tree_add_uint(ext_tree_rab_setup, hf_gtp_teid_data, tvb, offset + 4, 4, teid);
5262 switch (length) {
5263 case 12:
5264 addr_ipv4 = tvb_get_ipv4(tvb, offset + 8);
5265 proto_tree_add_ipv4(ext_tree_rab_setup, hf_gtp_rnc_ipv4, tvb, offset + 8, 4, addr_ipv4);
5266 break;
5267 case 24:
5268 tvb_get_ipv6(tvb, offset + 8, &addr_ipv6);
5269 proto_tree_add_ipv6(ext_tree_rab_setup, hf_gtp_rnc_ipv6, tvb, offset + 8, 16, (guint8 *) & addr_ipv6);
5270 break;
5271 default:
5272 break;
5276 return 3 + length;
5280 /* GPRS: not present
5281 * UMTS: 29.060 v4.0, chapter 7.7.40
5283 static int
5284 decode_gtp_hdr_list(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5287 int i;
5288 guint8 length, hdr;
5289 proto_tree *ext_tree_hdr_list;
5290 proto_item *te;
5292 length = tvb_get_guint8(tvb, offset + 1);
5294 te = proto_tree_add_text(tree, tvb, offset, 2 + length, "%s", val_to_str_ext_const(GTP_EXT_HDR_LIST, &gtp_val_ext, "Unknown"));
5295 ext_tree_hdr_list = proto_item_add_subtree(te, ett_gtp_hdr_list);
5297 proto_tree_add_text(ext_tree_hdr_list, tvb, offset + 1, 1, "Number of Extension Header Types in list (i.e., length) : %u", length);
5299 for (i = 0; i < length; i++) {
5300 hdr = tvb_get_guint8(tvb, offset + 2 + i);
5302 proto_tree_add_text(ext_tree_hdr_list, tvb, offset + 2 + i, 1, "No. %u --> Extension Header Type value : %s (0x%02x)", i + 1,
5303 val_to_str_const(hdr, next_extension_header_fieldvals, "Unknown Extension Header Type"), hdr);
5306 return 2 + length;
5309 /* GPRS: not present
5310 * UMTS: 29.060 v4.0, chapter 7.7.41
5311 * TODO: find TriggerID description
5313 static int
5314 decode_gtp_trigger_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5317 guint16 length;
5319 length = tvb_get_ntohs(tvb, offset + 1);
5321 proto_tree_add_text(tree, tvb, offset, 3 + length, "%s length : %u", val_to_str_ext_const(GTP_EXT_TRIGGER_ID, &gtp_val_ext, "Unknown"), length);
5323 return 3 + length;
5327 /* GPRS: not present
5328 * UMTS: 29.060 v4.0, chapter 7.7.42
5329 * TODO: find OMC-ID description
5331 static int
5332 decode_gtp_omc_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5335 guint16 length;
5337 length = tvb_get_ntohs(tvb, offset + 1);
5339 proto_tree_add_text(tree, tvb, offset, 3 + length, "%s length : %u", val_to_str_ext_const(GTP_EXT_OMC_ID, &gtp_val_ext, "Unknown"), length);
5341 return 3 + length;
5345 /* GPRS: 9.60 v7.6.0, chapter 7.9.25
5346 * UMTS: 29.060 v6.11.0, chapter 7.7.44 Charging Gateway Address
5348 static int
5349 decode_gtp_chrg_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5352 guint16 length;
5353 guint32 addr_ipv4;
5354 struct e_in6_addr addr_ipv6;
5355 proto_tree *ext_tree_chrg_addr;
5356 proto_item *te;
5358 length = tvb_get_ntohs(tvb, offset + 1);
5360 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_CHRG_ADDR, &gtp_val_ext, "Unknown"));
5361 ext_tree_chrg_addr = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CHRG_ADDR]);
5363 proto_tree_add_text(ext_tree_chrg_addr, tvb, offset + 1, 2, "%s length : %u", val_to_str_ext_const(GTP_EXT_CHRG_ADDR, &gtp_val_ext, "Unknown"), length);
5365 switch (length) {
5366 case 4:
5367 addr_ipv4 = tvb_get_ipv4(tvb, offset + 3);
5368 proto_item_append_text(te, "%s", ip_to_str((guint8 *) & addr_ipv4));
5369 proto_tree_add_ipv4(ext_tree_chrg_addr, hf_gtp_chrg_ipv4, tvb, offset + 3, 4, addr_ipv4);
5370 break;
5371 case 16:
5372 tvb_get_ipv6(tvb, offset + 3, &addr_ipv6);
5373 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
5374 proto_tree_add_ipv6(ext_tree_chrg_addr, hf_gtp_chrg_ipv6, tvb, offset + 3, 16, (guint8 *) & addr_ipv6);
5375 break;
5376 default:
5377 proto_item_append_text(te, "unknown type or wrong length");
5378 break;
5381 return 3 + length;
5384 /* GPRS: ?
5385 * UMTS: 29.060 V9.4.0, chapter 7.7.43 RAN Transparent Container
5386 * The information in the value part of the RAN Transparent Container IE contains all information elements (starting with
5387 * and including the BSSGP "PDU Type") in either of the RAN INFORMATION, RAN INFORMATION REQUEST,
5388 * RAN INFORMATION ACK or RAN INFORMATION ERROR messages respectively as specified in 3GPP TS 48.018
5390 static int
5391 decode_gtp_ran_tr_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5394 guint16 length;
5395 proto_tree *ext_tree;
5396 proto_item *te;
5397 tvbuff_t *next_tvb;
5399 length = tvb_get_ntohs(tvb, offset + 1);
5400 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_RAN_TR_CONT, &gtp_val_ext, "Unknown"));
5401 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RAN_TR_CONT]);
5403 offset++;
5404 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5405 offset = offset + 2;
5407 next_tvb = tvb_new_subset(tvb, offset, length, length);
5408 if (bssgp_handle) {
5409 col_set_fence(pinfo->cinfo, COL_INFO);
5410 call_dissector(bssgp_handle, next_tvb, pinfo, ext_tree);
5413 return 3 + length;
5417 /* GPRS: ?
5418 * UMTS: 29.060 v6.11.0, chapter 7.7.45 PDP Context Prioritization
5420 static int
5421 decode_gtp_pdp_cont_prio(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5424 guint16 length;
5425 proto_tree *ext_tree;
5426 proto_item *te;
5428 length = tvb_get_ntohs(tvb, offset + 1);
5429 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_PDP_CONT_PRIO, &gtp_val_ext, "Unknown"));
5430 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_PDP_CONT_PRIO]);
5432 offset++;
5433 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5434 offset = offset + 2;
5435 /* TODO add decoding of data */
5436 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5438 return 3 + length;
5442 /* GPRS: ?
5443 * UMTS: 29.060 v6.11.0, chapter 7.7.45A Additional RAB Setup Information
5445 static int
5446 decode_gtp_add_rab_setup_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5449 guint16 length;
5450 proto_tree *ext_tree;
5451 proto_item *te;
5453 length = tvb_get_ntohs(tvb, offset + 1);
5454 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_ADD_RAB_SETUP_INF, &gtp_val_ext, "Unknown"));
5455 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_ADD_RAB_SETUP_INF]);
5457 offset++;
5458 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5459 offset = offset + 2;
5460 /* TODO add decoding of data */
5461 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5463 return 3 + length;
5468 /* GPRS: ?
5469 * UMTS: 29.060 v6.11.0, chapter 7.7.47 SGSN Number
5471 static int
5472 decode_gtp_ssgn_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5475 guint16 length;
5476 proto_tree *ext_tree;
5477 proto_item *te;
5479 length = tvb_get_ntohs(tvb, offset + 1);
5480 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_SSGN_NO, &gtp_val_ext, "Unknown"));
5481 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_SSGN_NO]);
5483 offset++;
5484 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5485 offset = offset + 2;
5486 /* TODO add decoding of data */
5487 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5489 return 3 + length;
5493 /* GPRS: ?
5494 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.48 Common Flags
5496 static int
5497 decode_gtp_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5500 guint16 length;
5501 proto_tree *ext_tree;
5502 proto_item *te;
5504 length = tvb_get_ntohs(tvb, offset + 1);
5505 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_COMMON_FLGS, &gtp_val_ext, "Unknown"));
5506 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_COMMON_FLGS]);
5508 offset++;
5509 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5510 offset = offset + 2;
5511 /* Dual Address Bearer Flag */
5512 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_dual_addr_bearer_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
5513 /* Upgrade QoS Supported */
5514 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_upgrd_qos_sup, tvb, offset, 1, ENC_BIG_ENDIAN);
5515 /* NRSN bit field */
5516 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_nrsn, tvb, offset, 1, ENC_BIG_ENDIAN);
5517 /* No QoS negotiation */
5518 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_no_qos_neg, tvb, offset, 1, ENC_BIG_ENDIAN);
5519 /* MBMS Counting Information bi */
5520 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_cnt_inf, tvb, offset, 1, ENC_BIG_ENDIAN);
5521 /* RAN Procedures Ready */
5522 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_ran_pcd_rdy, tvb, offset, 1, ENC_BIG_ENDIAN);
5523 /* MBMS Service Type */
5524 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_mbs_srv_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5525 /* Prohibit Payload Compression */
5526 proto_tree_add_item(ext_tree, hf_gtp_cmn_flg_ppc, tvb, offset, 1, ENC_BIG_ENDIAN);
5528 return 3 + length;
5532 /* GPRS: ?
5533 * UMTS: 29.060 v6.11.0, chapter 7.7.49
5535 static int
5536 decode_gtp_apn_res(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5539 guint16 length;
5540 proto_tree *ext_tree_apn_res;
5541 proto_item *te;
5543 length = tvb_get_ntohs(tvb, offset + 1);
5544 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s : ", val_to_str_ext_const(GTP_EXT_APN_RES, &gtp_val_ext, "Unknown"));
5545 ext_tree_apn_res = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_APN_RES]);
5547 offset++;
5548 proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5549 offset = offset + 2;
5551 /* Restriction Type value */
5552 if (length != 1) {
5553 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_ext_length_mal, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length);
5554 return 3 + length;
5557 proto_tree_add_item(ext_tree_apn_res, hf_gtp_ext_apn_res, tvb, offset, length, ENC_BIG_ENDIAN);
5558 return 3 + length;
5561 /* GPRS: ?
5562 * UMTS: 29.060 v6.11.0, chapter 7.7.50 RAT Type
5563 * RAT Type
5564 * Type = 151 (Decimal)
5567 static int
5568 decode_gtp_rat_type(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5571 guint16 length;
5572 proto_tree *ext_tree_rat_type;
5573 proto_item *te;
5575 length = tvb_get_ntohs(tvb, offset + 1);
5576 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RAT_TYPE, &gtp_val_ext, "Unknown"));
5577 ext_tree_rat_type = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RAT_TYPE]);
5579 offset++;
5580 proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5581 offset = offset + 2;
5583 /* RAT Type value */
5584 if (length != 1) {
5585 proto_tree_add_expert_format(tree, pinfo, &ei_gtp_ext_length_mal, tvb, 0, length, "Wrong length indicated. Expected 1, got %u", length);
5586 return 3 + length;
5589 proto_tree_add_item(ext_tree_rat_type, hf_gtp_ext_rat_type, tvb, offset, length, ENC_BIG_ENDIAN);
5590 proto_item_append_text(te, ": %s", val_to_str_const(tvb_get_guint8(tvb,offset), gtp_ext_rat_type_vals, "Unknown"));
5592 return 3 + length;
5595 /* GPRS: ?
5596 * UMTS: 29.060 v6.11.0, chapter 7.7.51
5597 * User Location Information
5598 * Type = 152 (Decimal)
5601 static const
5602 gchar *dissect_radius_user_loc(proto_tree * tree, tvbuff_t * tvb, packet_info* pinfo)
5605 int offset = 0;
5606 guint8 geo_loc_type;
5607 guint16 length = tvb_length(tvb);
5609 /* Geographic Location Type */
5610 proto_tree_add_item(tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5611 geo_loc_type = tvb_get_guint8(tvb, offset);
5612 offset++;
5614 switch(geo_loc_type) {
5615 case 0:
5616 /* Geographic Location field included and it holds the Cell Global
5617 * Identification (CGI) of where the user currently is registered.
5618 * CGI is defined in sub-clause 4.3.1 of 3GPP TS 23.003 [2].
5620 /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 0) */
5621 be_cell_id_aux(tvb, tree, pinfo, offset, length - 1, NULL, 0, 0);
5622 break;
5623 case 1:
5624 /* Geographic Location field included and it holds the Service
5625 * Area Identity (SAI) of where the user currently is registered.
5626 * SAI is defined in sub-clause 9.2.3.9 of 3GPP TS 25.413 [7].
5628 /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
5629 be_cell_id_aux(tvb, tree, pinfo, offset, length - 1, NULL, 0, 4);
5630 offset = offset + 5;
5631 proto_tree_add_item(tree, hf_gtp_ext_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
5632 break;
5633 case 2:
5634 /* Geographic Location field included and it holds the Routing
5635 * Area Identification (RAI) of where the user currently is
5636 * registered. RAI is defined in sub-clause 4.2 of 3GPP TS 23.003
5637 * [2].
5639 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
5640 offset+=3;
5641 proto_tree_add_item(tree, hf_gtp_rai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
5642 offset+=2;
5643 proto_tree_add_item(tree, hf_gtp_rai_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
5644 break;
5645 case 128:
5646 /* Geographic Location field included and it holds the Tracking
5647 * Area Identity (TAI) of where the user currently is registered.
5648 * TAI is defined in sub-clause 8.21.4 of 3GPP TS 29.274.
5650 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
5651 offset+=3;
5652 proto_tree_add_item(tree, hf_gtp_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
5653 break;
5654 case 129:
5655 /* Geographic Location field included and it holds the E-UTRAN Cell
5656 * Global Identifier (ECGI) of where the user currently is registered.
5657 * ECGI is defined in sub-clause 8.21.5 of 3GPP TS 29.274.
5659 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
5660 offset+=3;
5661 proto_tree_add_item(tree, hf_gtp_eci, tvb, offset, 4, ENC_BIG_ENDIAN);
5662 break;
5663 case 130:
5664 /* Geographic Location field included and it holds the Tracking
5665 * Area Identity (TAI) and E-UTRAN CellGlobal Identifier (ECGI)
5666 * of where the user currently is registered.
5667 * TAI is defined in sub-clause 8.21.4 of 3GPP TS 29.274.
5668 * ECGI is defined in sub-clause 8.21.5 of 3GPP TS 29.274.
5670 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
5671 offset+=3;
5672 proto_tree_add_item(tree, hf_gtp_tac, tvb, offset, 2, ENC_BIG_ENDIAN);
5673 offset += 2;
5674 dissect_e212_mcc_mnc(tvb, pinfo, tree, offset, TRUE);
5675 offset+=3;
5676 proto_tree_add_item(tree, hf_gtp_eci, tvb, offset, 4, ENC_BIG_ENDIAN);
5677 break;
5678 default:
5679 proto_tree_add_text(tree, tvb, offset, length - 1, "Unknown Location type data");
5680 break;
5683 return tvb_bytes_to_str(tvb, 0, length);
5687 * 7.7.51 User Location Information
5690 static int
5691 decode_gtp_usr_loc_inf(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
5694 guint16 length;
5695 proto_tree *ext_tree, *rai_tree;
5696 proto_item *te, *fi;
5697 guint8 geo_loc_type;
5699 length = tvb_get_ntohs(tvb, offset + 1);
5700 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_USR_LOC_INF, &gtp_val_ext, "Unknown"));
5701 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_USR_LOC_INF]);
5703 offset++;
5704 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5705 offset = offset + 2;
5706 /* TODO add decoding of data */
5707 /* Geographic Location Type */
5708 proto_tree_add_item(ext_tree, hf_gtp_ext_geo_loc_type, tvb, offset, 1, ENC_BIG_ENDIAN);
5709 geo_loc_type = tvb_get_guint8(tvb, offset);
5710 offset++;
5712 switch(geo_loc_type) {
5713 case 0:
5714 /* Geographic Location field included and it holds the Cell Global
5715 * Identification (CGI) of where the user currently is registered.
5716 * CGI is defined in sub-clause 4.3.1 of 3GPP TS 23.003 [2].
5718 /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 0) */
5719 be_cell_id_aux(tvb, ext_tree, pinfo, offset, length - 1, NULL, 0, 0);
5720 break;
5721 case 1:
5722 /* Geographic Location field included and it holds the Service
5723 * Area Identity (SAI) of where the user currently is registered.
5724 * SAI is defined in sub-clause 9.2.3.9 of 3GPP TS 25.413 [7].
5726 /* Use gsm_a's function to dissect Geographic Location by faking disc ( last 4) */
5727 be_cell_id_aux(tvb, ext_tree, pinfo, offset, length - 1, NULL, 0, 4);
5728 offset = offset + 5;
5729 proto_tree_add_item(ext_tree, hf_gtp_ext_sac, tvb, offset, 2, ENC_BIG_ENDIAN);
5730 break;
5731 case 2:
5732 /* Geographic Location field included and it holds the Routing
5733 * Area Identification (RAI) of where the user currently is
5734 * registered. RAI is defined in sub-clause 4.2 of 3GPP TS 23.003
5735 * [2].
5737 fi = proto_tree_add_text(ext_tree, tvb, offset + 1, 7, "Routeing Area Identity (RAI)");
5738 rai_tree = proto_item_add_subtree(fi, ett_gtp_uli_rai);
5740 dissect_e212_mcc_mnc(tvb, pinfo, rai_tree, offset, TRUE);
5741 offset+=3;
5742 proto_tree_add_item(rai_tree, hf_gtp_rai_lac, tvb, offset, 2, ENC_BIG_ENDIAN);
5743 offset+=2;
5744 proto_tree_add_item(rai_tree, hf_gtp_rai_rac, tvb, offset, 1, ENC_BIG_ENDIAN);
5745 break;
5746 default:
5747 proto_tree_add_text(tree, tvb, offset, length - 1, "Unknown Location type data");
5748 break;
5751 return 3 + length;
5755 static const value_string daylight_saving_time_vals[] = {
5756 {0, "No adjustment"},
5757 {1, "+1 hour adjustment for Daylight Saving Time"},
5758 {2, "+2 hours adjustment for Daylight Saving Time"},
5759 {3, "Reserved"},
5760 {0, NULL}
5763 /* GPRS: ?
5764 * UMTS: 29.060 v6.11.0, chapter 7.7.52
5765 * MS Time Zone
5766 * Type = 153 (Decimal)
5767 * The ' MS Time Zone' IE is used to indicate the offset between universal time and local time
5768 * in steps of 15 minutes of where the MS currently resides. The 'Time Zone' field uses the same
5769 * format as the 'Time Zone' IE in 3GPP TS 24.008 (10.5.3.8)
5770 * its value shall be set as defined in 3GPP TS 22.042
5772 static int
5773 decode_gtp_ms_time_zone(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5776 guint16 length;
5777 proto_tree *ext_tree;
5778 proto_item *te;
5779 guint8 data;
5780 char sign;
5782 length = tvb_get_ntohs(tvb, offset + 1);
5783 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s: ", val_to_str_ext_const(GTP_EXT_MS_TIME_ZONE, &gtp_val_ext, "Unknown"));
5784 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MS_TIME_ZONE]);
5786 offset++;
5787 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5788 offset = offset + 2;
5790 /* 3GPP TS 23.040 version 6.6.0 Release 6
5791 * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
5793 * The Time Zone indicates the difference, expressed in quarters of an hour,
5794 * between the local time and GMT. In the first of the two semi-octets,
5795 * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
5796 * represents the algebraic sign of this difference (0: positive, 1: negative).
5799 data = tvb_get_guint8(tvb, offset);
5800 sign = (data & 0x08) ? '-' : '+';
5801 data = (data >> 4) + (data & 0x07) * 10;
5803 proto_tree_add_text(ext_tree, tvb, offset, 1, "Timezone: GMT %c %d hours %d minutes", sign, data / 4, data % 4 * 15);
5804 proto_item_append_text(te, "GMT %c %d hours %d minutes", sign, data / 4, data % 4 * 15);
5805 offset++;
5807 data = tvb_get_guint8(tvb, offset) & 0x3;
5808 proto_tree_add_text(ext_tree, tvb, offset, 1, "%s", val_to_str_const(data, daylight_saving_time_vals, "Unknown"));
5810 return 3 + length;
5814 /* GPRS: ?
5815 * UMTS: 29.060 v6.11.0, chapter 7.7.53
5816 * International Mobile Equipment Identity (and Software Version) (IMEI(SV))
5817 * Type = 154 (Decimal)
5819 static int
5820 decode_gtp_imeisv(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5823 guint16 length;
5824 proto_tree *ext_imeisv;
5825 proto_item *te;
5826 tvbuff_t *next_tvb;
5827 const char *digit_str;
5829 length = tvb_get_ntohs(tvb, offset + 1);
5830 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_IMEISV, &gtp_val_ext, "Unknown"));
5831 ext_imeisv = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_IMEISV]);
5833 offset++;
5834 proto_tree_add_item(ext_imeisv, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5835 offset = offset + 2;
5837 /* IMEI(SV)
5838 * The structure of the IMEI and IMEISV are defined in sub-clause 6.2 of 3GPP TS 23.003 [2].
5839 * The 'IMEI(SV)' field shall contain the IMEISV if it is available. If only the IMEI is available,
5840 * then the IMEI shall be placed in the IMEI(SV) field and the last semi-octet of octet 11 shall be
5841 * set to '1111'. Both IMEI and IMEISV are BCD encoded.
5843 next_tvb = tvb_new_subset(tvb, offset, length, length);
5844 digit_str = unpack_digits(next_tvb, 0);
5845 proto_tree_add_string(ext_imeisv, hf_gtp_ext_imeisv, next_tvb, 0, -1, digit_str);
5846 proto_item_append_text(te, ": %s", digit_str);
5848 return 3 + length;
5851 /* GPRS: ?
5852 * UMTS: 29.060 v6.11.0, chapter 7.7.54
5853 * CAMEL Charging Information Container
5854 * Type = 155 (Decimal)
5856 static int
5857 decode_gtp_camel_chg_inf_con(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5860 guint16 length;
5861 proto_tree *ext_tree;
5862 proto_item *te;
5864 length = tvb_get_ntohs(tvb, offset + 1);
5865 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CAMEL_CHG_INF_CON, &gtp_val_ext, "Unknown"));
5866 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CAMEL_CHG_INF_CON]);
5868 offset++;
5869 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5870 offset = offset + 2;
5871 /* TODO add decoding of data */
5872 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5874 return 3 + length;
5878 /* GPRS: ?
5879 * UMTS: 29.060 v6.11.0, chapter 7.7.55
5880 * MBMS UE Context
5882 static int
5883 decode_gtp_mbms_ue_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5886 guint16 length;
5887 proto_tree *ext_tree;
5888 proto_item *te;
5890 length = tvb_get_ntohs(tvb, offset + 1);
5891 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_UE_CTX, &gtp_val_ext, "Unknown"));
5892 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_UE_CTX]);
5894 offset++;
5895 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5896 offset = offset + 2;
5897 /* TODO add decoding of data */
5898 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5900 return 3 + length;
5904 /* GPRS: ?
5905 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.56
5906 * Temporary Mobile Group Identity (TMGI)
5907 * The Temporary Mobile Group Identity (TMGI) information element contains
5908 * a TMGI allocated by the BM-SC. It is coded as in the value part defined
5909 * in 3GPP T S 24.008 [5] (i.e. the IEI and octet length indicator are not included).
5912 static int
5913 decode_gtp_tmgi(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
5916 guint16 length;
5917 proto_tree *ext_tree, *tmgi_tree;
5918 proto_item *te, *ti;
5919 tvbuff_t *next_tvb;
5921 length = tvb_get_ntohs(tvb, offset + 1);
5922 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_TMGI, &gtp_val_ext, "Unknown"));
5923 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_TMGI]);
5925 offset++;
5926 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5927 offset = offset + 2;
5929 ti = proto_tree_add_item(ext_tree, hf_gtp_tmgi, tvb, offset, length, ENC_NA);
5931 tmgi_tree = proto_item_add_subtree(ti, ett_gtp_tmgi);
5932 next_tvb = tvb_new_subset(tvb, offset, length, length);
5933 de_mid(next_tvb, tmgi_tree, pinfo, 0, length, NULL, 0);
5934 return 3 + length;
5938 /* GPRS: ?
5939 * UMTS: 29.060 v6.11.0, chapter 7.7.57
5940 * RIM Routing Address
5942 static int
5943 decode_gtp_rim_ra(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5946 guint16 length;
5947 proto_tree *ext_tree;
5948 proto_item *te;
5950 length = tvb_get_ntohs(tvb, offset + 1);
5951 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RIM_RA, &gtp_val_ext, "Unknown"));
5952 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RIM_RA]);
5954 offset++;
5955 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5956 offset = offset + 2;
5957 /* To dissect the Address the Routing Address discriminator must be known */
5959 * Octets 4-n are coded according to 3GPP TS 48.018 [20] 11.3.77 RIM Routing Information IE octets 4-n.
5961 proto_tree_add_item(ext_tree, hf_gtp_rim_routing_addr, tvb, offset, length, ENC_NA);
5963 return 3 + length;
5967 /* GPRS: ?
5968 * UMTS: 29.060 v6.11.0, chapter 7.7.58
5969 * MBMS Protocol Configuration Options
5971 static int
5972 decode_gtp_mbms_prot_conf_opt(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
5975 guint16 length;
5976 proto_tree *ext_tree;
5977 proto_item *te;
5979 length = tvb_get_ntohs(tvb, offset + 1);
5980 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_PROT_CONF_OPT, &gtp_val_ext, "Unknown"));
5981 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_PROT_CONF_OPT]);
5983 offset++;
5984 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
5985 offset = offset + 2;
5986 /* TODO add decoding of data */
5987 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
5989 return 3 + length;
5993 /* GPRS: ?
5994 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.59
5995 * MBMS Session Duration
5997 /* Used for Diameter */
5998 static int
5999 dissect_gtp_mbms_ses_dur(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, void *data _U_)
6002 int offset = 0;
6004 proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6005 proto_tree_add_item(tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, ENC_BIG_ENDIAN);
6007 return 3;
6011 static int
6012 decode_gtp_mbms_ses_dur(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6015 guint16 length;
6016 proto_tree *ext_tree;
6017 proto_item *te;
6019 length = tvb_get_ntohs(tvb, offset + 1);
6020 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_DUR, &gtp_val_ext, "Unknown"));
6021 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_SES_DUR]);
6023 offset++;
6024 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6025 offset = offset + 2;
6026 /* The MBMS Session Duration is defined in 3GPP TS 23.246 [26].
6027 * The MBMS Session Duration information element indicates the estimated
6028 * session duration of the MBMS service data transmission if available.
6029 * The payload shall be encoded as per the MBMS-Session-Duration AVP defined
6030 * in 3GPP TS 29.061 [27], excluding the AVP Header fields
6031 * (as defined in IETF RFC 3588 [36], section 4.1).
6033 /* The MBMS-Session-Duration AVP (AVP code 904) is of type OctetString
6034 * with a length of three octets and indicates the estimated session duration
6035 * (MBMS Service data transmission). Bits 0 to 16 (17 bits) express seconds, for which the
6036 * maximum allowed value is 86400 seconds. Bits 17 to 23 (7 bits) express days,
6037 * for which the maximum allowed value is 18 days. For the whole session duration the seconds
6038 * and days are added together and the maximum session duration is 19 days.
6040 proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_days, tvb, offset, 3, ENC_BIG_ENDIAN);
6041 proto_tree_add_item(ext_tree, hf_gtp_mbms_ses_dur_s, tvb, offset, 3, ENC_BIG_ENDIAN);
6043 return 3 + length;
6047 /* GPRS: ?
6048 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7, chapter 7.7.60
6049 * MBMS Service Area
6051 static int
6052 dissect_gtp_3gpp_mbms_service_area(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
6054 int offset = 0;
6055 guint8 no_of_mbms_sa_codes;
6056 int i;
6058 /* The MBMS Service Area is defined in 3GPP TS 23.246 [26].
6059 * The MBMS Service Area information element indicates the area over
6060 * which the Multimedia Broadcast/Multicast Service is to be distributed.
6061 * The payload shall be encoded as per the MBMS-Service-Area AVP defined
6062 * in 3GPP TS 29.061 [27], excluding the AVP Header fields (as defined in
6063 * IETF RFC 3588 [36], section 4.1).
6065 /* Number N of MBMS service area codes coded as:
6066 * 1 binary value is '00000000'
6067 * ... ...
6068 * 256 binary value is '11111111'
6070 no_of_mbms_sa_codes = tvb_get_guint8(tvb, offset) + 1;
6071 proto_tree_add_uint(tree, hf_gtp_no_of_mbms_sa_codes, tvb, offset, 1, no_of_mbms_sa_codes);
6072 offset++;
6073 /* A consecutive list of N MBMS service area codes
6074 * The MBMS Service Area Identity and its semantics are defined in 3GPP TS 23.003
6075 * The length of an MBMS service area code is 2 octets.
6077 for (i = 0; i < no_of_mbms_sa_codes; i++) {
6078 proto_tree_add_item(tree, hf_gtp_mbms_sa_code, tvb, offset, 2, ENC_BIG_ENDIAN);
6079 offset = offset + 2;
6082 return offset;
6085 static int
6086 decode_gtp_mbms_sa(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6089 tvbuff_t *next_tvb;
6090 guint16 length;
6091 proto_tree *ext_tree;
6092 proto_item *te;
6094 length = tvb_get_ntohs(tvb, offset + 1);
6095 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SA, &gtp_val_ext, "Unknown"));
6096 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_SA]);
6098 offset++;
6099 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6100 offset = offset + 2;
6101 next_tvb = tvb_new_subset(tvb, offset, length-3, length-3);
6102 dissect_gtp_3gpp_mbms_service_area(next_tvb, pinfo, ext_tree, NULL);
6104 return 3 + length;
6108 /* GPRS: ?
6109 * UMTS: 29.060 v6.11.0, chapter 7.7.61
6110 * Source RNC PDCP context info
6112 static int
6113 decode_gtp_src_rnc_pdp_ctx_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6116 guint16 length;
6117 proto_tree *ext_tree;
6118 proto_item *te;
6120 length = tvb_get_ntohs(tvb, offset + 1);
6121 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_SRC_RNC_PDP_CTX_INF, &gtp_val_ext, "Unknown"));
6122 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_SRC_RNC_PDP_CTX_INF]);
6124 offset++;
6125 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6126 offset = offset + 2;
6127 /* TODO add decoding of data */
6128 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6130 return 3 + length;
6134 /* GPRS: ?
6135 * UMTS: 29.060 v6.11.0, chapter 7.7.62
6136 * Additional Trace Info
6138 static int
6139 decode_gtp_add_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6142 guint16 length;
6143 proto_tree *ext_tree;
6144 proto_item *te;
6146 length = tvb_get_ntohs(tvb, offset + 1);
6147 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_TRS_INF, &gtp_val_ext, "Unknown"));
6148 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_ADD_TRS_INF]);
6150 offset++;
6151 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6152 offset = offset + 2;
6153 /* TODO add decoding of data */
6154 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6156 return 3 + length;
6160 /* GPRS: ?
6161 * UMTS: 29.060 v6.11.0, chapter 7.7.63
6162 * Hop Counter
6164 static int
6165 decode_gtp_hop_count(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6168 guint16 length;
6169 proto_tree *ext_tree;
6170 proto_item *te;
6172 length = tvb_get_ntohs(tvb, offset + 1);
6173 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_HOP_COUNT, &gtp_val_ext, "Unknown"));
6174 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_HOP_COUNT]);
6176 offset++;
6177 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6178 offset = offset + 2;
6179 /* TODO add decoding of data */
6180 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6182 return 3 + length;
6186 /* GPRS: ?
6187 * UMTS: 29.060 v6.11.0, chapter 7.7.64
6188 * Selected PLMN ID
6190 static int
6191 decode_gtp_sel_plmn_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6194 guint16 length;
6195 proto_tree *ext_tree;
6196 proto_item *te;
6198 length = tvb_get_ntohs(tvb, offset + 1);
6199 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_SEL_PLMN_ID, &gtp_val_ext, "Unknown"));
6200 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_SES_ID]);
6202 offset++;
6203 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6204 offset = offset + 2;
6206 dissect_e212_mcc_mnc(tvb, pinfo, ext_tree, offset, FALSE);
6207 return 3 + length;
6211 /* GPRS: ?
6212 * UMTS: 29.060 v6.11.0, chapter 7.7.65
6213 * MBMS Session Identifier
6215 static int
6216 decode_gtp_mbms_ses_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6219 guint16 length;
6220 proto_tree *ext_tree;
6221 proto_item *te;
6223 length = tvb_get_ntohs(tvb, offset + 1);
6224 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_ID, &gtp_val_ext, "Unknown"));
6225 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_SES_ID]);
6227 offset++;
6228 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6229 offset = offset + 2;
6230 /* TODO add decoding of data */
6231 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6233 return 3 + length;
6237 /* GPRS: ?
6238 * UMTS: 29.060 v6.11.0, chapter 7.7.66
6239 * MBMS 2G/3G Indicator
6241 static const value_string gtp_mbs_2g_3g_ind_vals[] = {
6242 {0, "2G only"},
6243 {1, "3G only"},
6244 {2, "Both 2G and 3G"},
6245 {0, NULL}
6248 static int
6249 decode_gtp_mbms_2g_3g_ind(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6252 guint16 length;
6253 proto_tree *ext_tree;
6254 proto_item *te;
6256 length = tvb_get_ntohs(tvb, offset + 1);
6257 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_2G_3G_IND, &gtp_val_ext, "Unknown"));
6258 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_2G_3G_IND]);
6260 offset++;
6261 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6262 offset = offset + 2;
6263 /* MBMS 2G/3G Indicator */
6264 proto_tree_add_item(ext_tree, hf_gtp_mbs_2g_3g_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
6266 return 3 + length;
6270 /* GPRS: ?
6271 * UMTS: 29.060 v6.11.0, chapter 7.7.67
6272 * Enhanced NSAPI
6274 static int
6275 decode_gtp_enh_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6278 guint16 length;
6279 proto_tree *ext_tree;
6280 proto_item *te;
6282 length = tvb_get_ntohs(tvb, offset + 1);
6283 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ENH_NSAPI, &gtpv1_val_ext, "Unknown"));
6284 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_ENH_NSAPI]);
6286 offset++;
6287 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6288 offset = offset + 2;
6289 /* TODO add decoding of data */
6290 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6292 return 3 + length;
6296 /* GPRS: ?
6297 * UMTS: 29.060 v6.11.0, chapter 7.7.68
6298 * Additional MBMS Trace Info
6300 static int
6301 decode_gtp_add_mbms_trs_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6304 guint16 length;
6305 proto_tree *ext_tree;
6306 proto_item *te;
6308 length = tvb_get_ntohs(tvb, offset + 1);
6309 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_MBMS_TRS_INF, &gtpv1_val_ext, "Unknown"));
6310 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_ADD_MBMS_TRS_INF]);
6312 offset++;
6313 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6314 offset = offset + 2;
6315 /* TODO add decoding of data */
6316 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6318 return 3 + length;
6322 /* GPRS: ?
6323 * UMTS: 29.060 v6.11.0, chapter 7.7.69
6324 * MBMS Session Identity Repetition Number
6326 static int
6327 decode_gtp_mbms_ses_id_rep_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6330 guint16 length;
6331 proto_tree *ext_tree;
6332 proto_item *te;
6334 length = tvb_get_ntohs(tvb, offset + 1);
6335 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_SES_ID_REP_NO, &gtpv1_val_ext, "Unknown"));
6336 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_SES_ID_REP_NO]);
6338 offset++;
6339 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6340 offset = offset + 2;
6341 /* TODO add decoding of data */
6342 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6344 return 3 + length;
6348 /* GPRS: ?
6349 * UMTS: 3GPP TS 29.060 version 7.8.0 Release 7
6350 * MBMS Time To Data Transfer
6352 /* Used for Diameter */
6353 static int
6354 dissect_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, void *data _U_)
6357 int offset = 0;
6358 guint8 time_2_dta_tr;
6360 time_2_dta_tr = tvb_get_guint8(tvb, offset) + 1;
6361 proto_tree_add_uint(tree, hf_gtp_time_2_dta_tr, tvb, offset, 1, time_2_dta_tr);
6363 return 3;
6367 static int
6368 decode_gtp_mbms_time_to_data_tr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6371 guint16 length;
6372 proto_tree *ext_tree;
6373 proto_item *te;
6374 guint8 time_2_dta_tr;
6376 length = tvb_get_ntohs(tvb, offset + 1);
6377 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_TIME_TO_DATA_TR, &gtpv1_val_ext, "Unknown"));
6378 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_TIME_TO_DATA_TR]);
6380 offset++;
6381 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6382 offset = offset + 2;
6383 /* TODO add decoding of data
6384 * The MBMS Time To Data Transfer is defined in 3GPP TS 23.246 [26].
6385 * The MBMS Time To Data Transfer information element contains a
6386 * MBMS Time To Data Transfer allocated by the BM-SC.
6387 * The payload shall be encoded as per the MBMS-Time-To-Data-Transfer AVP
6388 * defined in 3GPP TS 29.061 [27], excluding the AVP Header fields
6389 * (as defined in IETF RFC 3588 [36], section 4.1).
6391 /* The coding is specified as per the Time to MBMS Data Transfer Value Part Coding
6392 * of the Time to MBMS Data Transfer IE in 3GPP TS 48.018
6393 * Bits
6394 * 8 7 6 5 4 3 2 1
6395 * 0 0 0 0 0 0 0 0 1s
6396 * 0 0 0 0 0 0 0 1 2s
6397 * 0 0 0 0 0 0 1 0 3s
6399 * 1 1 1 1 1 1 1 1 256s
6401 time_2_dta_tr = tvb_get_guint8(tvb, offset) + 1;
6402 proto_tree_add_uint(ext_tree, hf_gtp_time_2_dta_tr, tvb, offset, 1, time_2_dta_tr);
6404 return 3 + length;
6408 /* GPRS: ?
6409 * UMTS: 29.060 v6.11.0, chapter 7.7.71
6410 * PS Handover Request Context
6412 static int
6413 decode_gtp_ps_ho_req_ctx(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6416 guint16 length;
6417 proto_tree *ext_tree;
6418 proto_item *te;
6420 length = tvb_get_ntohs(tvb, offset + 1);
6421 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HO_REQ_CTX, &gtpv1_val_ext, "Unknown"));
6422 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_PS_HO_REQ_CTX]);
6424 offset++;
6425 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6426 offset = offset + 2;
6427 /* TODO add decoding of data */
6428 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6430 return 3 + length;
6434 /* GPRS: ?
6435 * UMTS: 29.060 v6.11.0, chapter 7.7.72
6436 * BSS Container
6438 static int
6439 decode_gtp_bss_cont(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6442 guint16 length;
6443 proto_tree *ext_tree;
6444 proto_item *te;
6446 length = tvb_get_ntohs(tvb, offset + 1);
6447 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSS_CONT, &gtpv1_val_ext, "Unknown"));
6448 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_BSS_CONT]);
6450 offset++;
6451 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6452 offset = offset + 2;
6453 /* TODO add decoding of data */
6454 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6456 * The content of this container is defined in 3GPP TS 48.018
6459 return 3 + length;
6463 /* GPRS: ?
6464 * UMTS: 29.060 v6.11.0, chapter 7.7.73
6465 * Cell Identification
6467 static int
6468 decode_gtp_cell_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6471 guint16 length;
6472 proto_tree *ext_tree;
6473 proto_item *te;
6475 length = tvb_get_ntohs(tvb, offset + 1);
6476 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CELL_ID, &gtpv1_val_ext, "Unknown"));
6477 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CELL_ID]);
6479 offset++;
6480 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6481 offset = offset + 2;
6482 /* TODO add decoding of data */
6483 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6485 * for PS handover from A/Gb mode, the identification of a target cell (Cell ID 1) and the identification of the
6486 * source cell (Cell ID 2) as defined in 3GPP TS 48.018 [20].
6488 * for PS handover from Iu mode, the identification of a target cell (Cell ID 1)) and the identification of the
6489 * source RNC (RNC-ID) as defined in 3GPP TS 48.018
6492 return 3 + length;
6496 /* GPRS: ?
6497 * UMTS: 29.060 v6.11.0, chapter 7.7.74
6498 * PDU Numbers
6500 static int
6501 decode_gtp_pdu_no(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6504 guint16 length;
6505 proto_tree *ext_tree;
6506 proto_item *te;
6508 length = tvb_get_ntohs(tvb, offset + 1);
6509 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PDU_NO, &gtpv1_val_ext, "Unknown"));
6510 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_PDU_NO]);
6512 offset++;
6513 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6514 offset = offset + 2;
6515 /* TODO add decoding of data */
6516 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6518 return 3 + length;
6522 /* GPRS: ?
6523 * UMTS: 29.060 v6.11.0, chapter 7.7.75
6524 * BSSGP Cause
6526 static int
6527 decode_gtp_bssgp_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6530 guint16 length;
6531 proto_tree *ext_tree;
6532 proto_item *te;
6534 length = tvb_get_ntohs(tvb, offset + 1);
6535 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BSSGP_CAUSE, &gtpv1_val_ext, "Unknown"));
6536 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_BSSGP_CAUSE]);
6538 offset++;
6539 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6540 offset = offset + 2;
6543 * The BSSGP Cause information element contains the cause as defined in 3GPP TS 48.018
6545 proto_tree_add_item(ext_tree, hf_gtp_bssgp_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
6547 return 3 + length;
6552 * Required MBMS bearer capabilities 7.7.76
6554 static int
6555 decode_gtp_mbms_bearer_cap(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6557 guint16 length;
6558 proto_tree *ext_tree;
6559 proto_item *te;
6561 length = tvb_get_ntohs(tvb, offset + 1);
6562 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_REQ_MBMS_BEARER_CAP, &gtpv1_val_ext, "Unknown"));
6563 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_REQ_MBMS_BEARER_CAP]);
6565 offset++;
6566 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6567 #if 0 /* Fix Dead Store Warning */
6568 offset = offset + 2;
6569 #endif
6570 /* The payload shall be encoded as per the
6571 * Required-MBMS-Bearer-Capabilities AVP defined in 3GPP TS 29.061 [27],
6572 * excluding the AVP Header fields (as defined in IETF RFC 3588 [36], section 4.1).
6574 /* TODO Add decoding (call Diameter dissector???) */
6575 return 3 + length;
6579 * RIM Routing Address Discriminator 7.7.77
6582 static const value_string gtp_bssgp_ra_discriminator_vals[] = {
6583 { 0, "A Cell Identifier is used to identify a GERAN cell" },
6584 { 1, "A Global RNC-ID is used to identify a UTRAN RNC" },
6585 { 2, "An eNB identifier is used to identify an E-UTRAN eNodeB or HeNB" },
6586 { 0, NULL }
6589 static int
6590 decode_gtp_rim_ra_disc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6593 guint16 length;
6594 proto_tree *ext_tree;
6595 proto_item *te;
6597 length = tvb_get_ntohs(tvb, offset + 1);
6598 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RIM_ROUTING_ADDR_DISC, &gtpv1_val_ext, "Unknown"));
6599 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RIM_ROUTING_ADDR_DISC]);
6601 offset++;
6602 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6603 offset = offset + 2;
6604 /* Octet 4 bits 4 - 1 is coded according to 3GPP TS 48.018 [20]
6605 * RIM Routing Information IE octet 3 bits 4 - 1.
6606 * Bits 8 - 5 are coded "0000".
6608 proto_tree_add_item(ext_tree, hf_gtp_bssgp_ra_discriminator, tvb, offset, 1, ENC_BIG_ENDIAN);
6610 return 3 + length;
6614 * List of set-up PFCs 7.7.78
6616 static int
6617 decode_gtp_lst_set_up_pfc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6620 guint16 length;
6621 proto_tree *ext_tree;
6622 proto_item *te;
6624 length = tvb_get_ntohs(tvb, offset + 1);
6625 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_LIST_OF_SETUP_PFCS, &gtpv1_val_ext, "Unknown"));
6626 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_LIST_OF_SETUP_PFCS]);
6628 offset++;
6629 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6630 offset = offset + 2;
6631 /* TODO add decoding of data */
6632 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6634 return 3 + length;
6638 * PS Handover XID Parameters 7.7.79
6640 static int
6641 decode_gtp_ps_handover_xid(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6644 guint16 length;
6645 proto_tree *ext_tree;
6646 proto_item *te;
6647 tvbuff_t *next_tvb;
6648 guint8 sapi;
6649 guint8 xid_par_len;
6651 length = tvb_get_ntohs(tvb, offset + 1);
6652 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_PS_HANDOVER_XIP_PAR, &gtpv1_val_ext, "Unknown"));
6653 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_PS_HANDOVER_XIP_PAR]);
6655 offset++;
6656 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6657 offset = offset + 2;
6659 sapi = tvb_get_guint8(tvb, offset) & 0x0F;
6660 proto_tree_add_uint(ext_tree, hf_gtp_sapi, tvb, offset, 1, sapi);
6661 offset++;
6663 xid_par_len = tvb_get_guint8(tvb, offset);
6664 proto_tree_add_uint(ext_tree, hf_gtp_xid_par_len, tvb, offset, 1, xid_par_len);
6665 offset++;
6667 if (sndcpxid_handle) {
6668 next_tvb = tvb_new_subset_remaining(tvb, offset);
6669 call_dissector(sndcpxid_handle, next_tvb, pinfo, tree);
6670 } else
6671 proto_tree_add_text(tree, tvb, offset, 0, "Data");
6673 return 4 + length;
6678 * MS Info Change Reporting Action 7.7.80
6680 static int
6681 decode_gtp_ms_inf_chg_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6684 guint16 length;
6685 proto_tree *ext_tree;
6686 proto_item *te;
6688 length = tvb_get_ntohs(tvb, offset + 1);
6689 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MS_INF_CHG_REP_ACT, &gtpv1_val_ext, "Unknown"));
6690 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MS_INF_CHG_REP_ACT]);
6692 offset++;
6693 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6694 offset = offset + 2;
6695 /* TODO add decoding of data */
6696 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6698 return 3 + length;
6702 * Direct Tunnel Flags 7.7.81
6704 static int
6705 decode_gtp_direct_tnl_flg(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6708 guint16 length;
6709 proto_tree *ext_tree;
6710 proto_item *te;
6712 length = tvb_get_ntohs(tvb, offset + 1);
6713 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_DIRECT_TUNNEL_FLGS, &gtpv1_val_ext, "Unknown"));
6714 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_DIRECT_TUNNEL_FLGS]);
6716 offset++;
6717 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6718 offset = offset + 2;
6719 /* TODO add decoding of data */
6720 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6721 proto_tree_add_item(ext_tree, hf_gtp_ext_ei, tvb, offset, 1, ENC_BIG_ENDIAN);
6722 proto_tree_add_item(ext_tree, hf_gtp_ext_gcsi, tvb, offset, 1, ENC_BIG_ENDIAN);
6723 proto_tree_add_item(ext_tree, hf_gtp_ext_dti, tvb, offset, 1, ENC_BIG_ENDIAN);
6724 #if 0 /* Fix Dead Store Warning */
6725 offset++;
6726 #endif
6727 return 3 + length;
6731 * Correlation-ID 7.7.82
6733 static int
6734 decode_gtp_corrl_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6737 guint16 length;
6738 proto_tree *ext_tree;
6739 proto_item *te;
6741 length = tvb_get_ntohs(tvb, offset + 1);
6742 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CORRELATION_ID, &gtpv1_val_ext, "Unknown"));
6743 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CORRELATION_ID]);
6745 offset++;
6746 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6747 offset = offset + 2;
6748 /* TODO add decoding of data */
6749 proto_tree_add_text(ext_tree, tvb, offset, length, "Data not decoded yet");
6751 return 3 + length;
6755 * Bearer Control Mode 7.7.83
6756 * version 10.0.0
6758 static const value_string gtp_pdp_bcm_type_vals[] = {
6759 {0, "MS_only"},
6760 {1, "MS/NW"},
6761 {0, NULL}
6764 static int
6765 decode_gtp_bearer_cntrl_mod(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6768 guint16 length;
6769 proto_tree *ext_tree;
6770 proto_item *te;
6772 length = tvb_get_ntohs(tvb, offset + 1);
6773 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_BEARER_CONTROL_MODE, &gtpv1_val_ext, "Unknown"));
6774 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_BEARER_CONTROL_MODE]);
6775 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6777 offset++;
6778 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6779 offset = offset + 2;
6781 proto_tree_add_item(ext_tree, hf_gtp_bcm, tvb, offset, 1, ENC_BIG_ENDIAN);
6783 return 3 + length;
6788 * 7.7.84 MBMS Flow Identifier
6790 static int
6791 decode_gtp_mbms_flow_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6793 guint16 length;
6794 proto_tree *ext_tree;
6795 proto_item *te;
6797 length = tvb_get_ntohs(tvb, offset + 1);
6798 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_FLOW_ID, &gtpv1_val_ext, "Unknown"));
6799 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_FLOW_ID]);
6800 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6802 offset++;
6803 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6804 offset = offset + 2;
6806 /* 4-n MBMS Flow Identifier */
6807 proto_tree_add_item(ext_tree, hf_gtp_mbms_flow_id, tvb, offset, length, ENC_NA);
6810 return 3 + length;
6814 * 7.7.85 MBMS IP Multicast Distribution
6817 static int
6818 decode_gtp_mbms_ip_mcast_dist(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6820 guint16 length;
6821 proto_tree *ext_tree;
6822 proto_item *te;
6824 length = tvb_get_ntohs(tvb, offset + 1);
6825 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_IP_MCAST_DIST, &gtpv1_val_ext, "Unknown"));
6826 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_IP_MCAST_DIST]);
6827 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6829 offset++;
6830 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6831 offset = offset + 2;
6833 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
6835 return 3 + length;
6839 * 7.7.86 MBMS Distribution Acknowledgement
6841 /* Table 7.7.86.1: Distribution Indication values */
6842 static const value_string gtp_mbms_dist_indic_vals[] = {
6843 {0, "No RNCs have accepted IP multicast distribution"},
6844 {1, "All RNCs have accepted IP multicast distribution"},
6845 {2, "Some RNCs have accepted IP multicast distribution"},
6846 {3, "Spare. For future use."},
6847 {0, NULL}
6849 static int
6850 decode_gtp_mbms_dist_ack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6852 guint16 length;
6853 proto_tree *ext_tree;
6854 proto_item *te;
6856 length = tvb_get_ntohs(tvb, offset + 1);
6857 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MBMS_DIST_ACK, &gtpv1_val_ext, "Unknown"));
6858 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MBMS_DIST_ACK]);
6859 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6861 offset++;
6862 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6863 offset = offset + 2;
6865 /* Distribution Indication values */
6866 proto_tree_add_item(ext_tree, hf_gtp_mbms_dist_indic, tvb, offset, 1, ENC_BIG_ENDIAN);
6868 return 3 + length;
6872 * 7.7.87 Reliable INTER RAT HANDOVER INFO
6874 static int
6875 decode_gtp_reliable_irat_ho_inf(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6877 guint16 length;
6878 proto_tree *ext_tree;
6879 proto_item *te;
6881 length = tvb_get_ntohs(tvb, offset + 1);
6882 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RELIABLE_IRAT_HO_INF, &gtpv1_val_ext, "Unknown"));
6883 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RELIABLE_IRAT_HO_INF]);
6884 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6886 offset++;
6887 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6888 offset = offset + 2;
6890 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
6892 return 3 + length;
6896 * 7.7.88 RFSP Index
6898 static int
6899 decode_gtp_rfsp_index(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6901 guint16 length, rfsp;
6902 proto_tree *ext_tree;
6903 proto_item *te;
6905 length = tvb_get_ntohs(tvb, offset + 1);
6906 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_RFSP_INDEX, &gtpv1_val_ext, "Unknown"));
6907 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RFSP_INDEX]);
6908 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6910 offset++;
6911 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6912 offset = offset + 2;
6914 rfsp = tvb_get_ntohs(tvb, offset);
6915 proto_tree_add_text(ext_tree, tvb, offset, length, "RFSP Index: %u", rfsp+1);
6917 return 3 + length;
6920 * 7.7.89 PDP Type
6923 * 7.7.90 Fully Qualified Domain Name (FQDN)
6925 static int
6926 decode_gtp_fqdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6929 guint16 length;
6930 proto_tree *ext_tree;
6931 proto_item *te;
6933 length = tvb_get_ntohs(tvb, offset + 1);
6935 te = proto_tree_add_text(tree, tvb, offset, length + 3, "%s", val_to_str_ext_const(GTP_EXT_FQDN, &gtp_val_ext, "Unknown field"));
6936 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_FQDN]);
6937 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6939 proto_tree_add_text(ext_tree, tvb, offset + 1, 2, "FQDN length : %u", length);
6940 decode_fqdn(tvb, offset + 3, length, ext_tree);
6942 return 3 + length;
6946 * 7.7.91 Evolved Allocation/Retention Priority I
6948 static int
6949 decode_gtp_evolved_allc_rtn_p1(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6952 guint16 length;
6953 proto_tree *ext_tree;
6954 proto_item *te;
6956 length = tvb_get_ntohs(tvb, offset + 1);
6957 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_EVO_ALLO_RETE_P1, &gtpv1_val_ext, "Unknown"));
6958 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_EVO_ALLO_RETE_P1]);
6959 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6961 offset++;
6962 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6963 offset = offset + 2;
6965 proto_tree_add_item(ext_tree, hf_gtp_earp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
6966 proto_tree_add_item(ext_tree, hf_gtp_earp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
6967 proto_tree_add_item(ext_tree, hf_gtp_earp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
6969 return 3 + length;
6975 * 7.7.92 Evolved Allocation/Retention Priority II
6977 static int
6978 decode_gtp_evolved_allc_rtn_p2(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
6981 guint16 length;
6982 proto_tree *ext_tree;
6983 proto_item *te;
6985 length = tvb_get_ntohs(tvb, offset + 1);
6986 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_EVO_ALLO_RETE_P2, &gtpv1_val_ext, "Unknown"));
6987 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_EVO_ALLO_RETE_P2]);
6988 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
6990 offset++;
6991 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
6992 offset = offset + 2;
6994 proto_tree_add_item(ext_tree, hf_gtp_nsapi, tvb, offset, 1, ENC_BIG_ENDIAN);
6995 offset++;
6997 proto_tree_add_item(ext_tree, hf_gtp_earp_pvi, tvb, offset, 1, ENC_BIG_ENDIAN);
6998 proto_tree_add_item(ext_tree, hf_gtp_earp_pl, tvb, offset, 1, ENC_BIG_ENDIAN);
6999 proto_tree_add_item(ext_tree, hf_gtp_earp_pci, tvb, offset, 1, ENC_BIG_ENDIAN);
7001 return 3 + length;
7007 * 7.7.93 Extended Common Flags
7009 static int
7010 decode_gtp_extended_common_flgs(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7012 guint16 length;
7013 proto_tree *ext_tree;
7014 proto_item *te;
7016 length = tvb_get_ntohs(tvb, offset + 1);
7017 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_EXTENDED_COMMON_FLGS, &gtpv1_val_ext, "Unknown"));
7018 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_EXTENDED_COMMON_FLGS]);
7019 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7021 offset++;
7022 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7023 offset = offset + 2;
7025 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7027 return 3 + length;
7031 * 7.7.94 User CSG Information (UCI)
7033 static int
7034 decode_gtp_uci(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7036 guint16 length;
7037 proto_tree *ext_tree;
7038 proto_item *te;
7040 length = tvb_get_ntohs(tvb, offset + 1);
7041 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_UCI, &gtpv1_val_ext, "Unknown"));
7042 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_UCI]);
7043 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7045 offset++;
7046 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7047 offset = offset + 2;
7049 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7051 return 3 + length;
7055 * 7.7.95 CSG Information Reporting Action
7058 static int
7059 decode_gtp_csg_inf_rep_act(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7061 guint16 length;
7062 proto_tree *ext_tree;
7063 proto_item *te;
7065 length = tvb_get_ntohs(tvb, offset + 1);
7066 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CSG_INF_REP_ACT, &gtpv1_val_ext, "Unknown"));
7067 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CSG_INF_REP_ACT]);
7068 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7070 offset++;
7071 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7072 offset = offset + 2;
7074 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7076 return 3 + length;
7079 * 7.7.96 CSG ID
7082 static int
7083 decode_gtp_csg_id(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7085 guint16 length;
7086 proto_tree *ext_tree;
7087 proto_item *te;
7089 length = tvb_get_ntohs(tvb, offset + 1);
7090 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CSG_ID, &gtpv1_val_ext, "Unknown"));
7091 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CSG_ID]);
7092 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7094 offset++;
7095 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7096 offset = offset + 2;
7098 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7100 return 3 + length;
7103 * 7.7.97 CSG Membership Indication (CMI)
7105 static int
7106 decode_gtp_cmi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7108 guint16 length;
7109 proto_tree *ext_tree;
7110 proto_item *te;
7112 length = tvb_get_ntohs(tvb, offset + 1);
7113 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_CMI, &gtpv1_val_ext, "Unknown"));
7114 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_CMI]);
7115 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7117 offset++;
7118 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7119 offset = offset + 2;
7121 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7123 return 3 + length;
7126 * 7.7.98 APN Aggregate Maximum Bit Rate (APN-AMBR)
7128 static int
7129 decode_gtp_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7131 guint16 length;
7132 proto_tree *ext_tree;
7133 proto_item *te;
7135 length = tvb_get_ntohs(tvb, offset + 1);
7136 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_AMBR, &gtpv1_val_ext, "Unknown"));
7137 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_RELIABLE_IRAT_HO_INF]);
7138 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7140 offset++;
7141 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7142 offset = offset + 2;
7144 /* APN Aggregate Maximum Bit Rate (APN-AMBR) is defined in clause 9.9.4.2 of 3GPP TS 24.301 [42], but shall be
7145 * formatted as shown in Figure 7.7.98-1 as Unsigned32 binary integer values in kbps (1000 bits per second).
7147 /* 4 to 7 APN-AMBR for Uplink */
7148 te = proto_tree_add_item(ext_tree, hf_gtp_ext_apn_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7149 proto_item_append_text(te, " kbps");
7150 offset+=4;
7151 /* 8 to 11 APN-AMBR for Downlink */
7152 te = proto_tree_add_item(ext_tree, hf_gtp_ext_apn_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7153 proto_item_append_text(te, " kbps");
7156 return 3 + length;
7159 * 7.7.99 UE Network Capability
7161 static int
7162 decode_gtp_ue_network_cap(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
7164 guint16 length;
7165 proto_tree *ext_tree;
7166 proto_item *te;
7168 length = tvb_get_ntohs(tvb, offset + 1);
7169 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_UE_NETWORK_CAP, &gtpv1_val_ext, "Unknown"));
7170 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_UE_NETWORK_CAP]);
7172 offset++;
7173 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7174 offset = offset + 2;
7176 de_emm_ue_net_cap(tvb, ext_tree, pinfo, offset, length, NULL, 0);
7178 return 3 + length;
7181 * 7.7.100 UE-AMBR
7184 static int
7185 decode_gtp_ue_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7187 guint16 length;
7188 proto_tree *ext_tree;
7189 proto_item *te;
7191 length = tvb_get_ntohs(tvb, offset + 1);
7192 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_APN_AMBR_WITH_NSAPI, &gtpv1_val_ext, "Unknown"));
7193 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_APN_AMBR_WITH_NSAPI]);
7194 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7196 offset++;
7197 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7198 offset = offset + 2;
7200 /* 4 to 7 Subscribed UE-AMBR for Uplink */
7201 te = proto_tree_add_item(ext_tree, hf_gtp_ext_sub_ue_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7202 proto_item_append_text(te, " kbps");
7203 offset+=4;
7204 /* 8 to 11 Subscribed UE-AMBR for Downlink */
7205 te = proto_tree_add_item(ext_tree, hf_gtp_ext_sub_ue_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7206 proto_item_append_text(te, " kbps");
7207 offset+=4;
7209 /* Authorized UE-AMBR for Uplink and Downlink fields are present in the IE only if the sender has their valid values
7210 * available. Otherwise, the fields from m to (n+3) shall not be present.
7212 if(offset >= length)
7213 return 3 + length;
7215 /* m to (m+3) Authorized UE-AMBR for Uplink */
7216 te = proto_tree_add_item(ext_tree, hf_gtp_ext_auth_ue_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7217 proto_item_append_text(te, " kbps");
7218 offset+=4;
7220 /* (m+4) to (n+3) Authorized UE-AMBR for Downlink */
7221 te = proto_tree_add_item(ext_tree, hf_gtp_ext_auth_ue_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7222 proto_item_append_text(te, " kbps");
7224 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7226 return 3 + length;
7230 * 7.7.101 APN-AMBR with NSAPI
7232 static int
7233 decode_gtp_apn_ambr_with_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7235 guint16 length;
7236 proto_tree *ext_tree;
7237 proto_item *te;
7239 length = tvb_get_ntohs(tvb, offset + 1);
7240 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_UE_AMBR, &gtpv1_val_ext, "Unknown"));
7241 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_UE_AMBR]);
7242 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7244 offset++;
7245 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7246 offset = offset + 2;
7248 proto_tree_add_item(ext_tree, hf_gtp_nsapi, tvb, offset + 1, 1, ENC_BIG_ENDIAN);
7249 offset++;
7251 /* 5 to 8 Authorized APN-AMBR for Uplink */
7252 te = proto_tree_add_item(ext_tree, hf_gtp_ext_auth_apn_ambr_ul, tvb, offset, 4, ENC_BIG_ENDIAN);
7253 proto_item_append_text(te, " kbps");
7254 offset+=4;
7256 /* 9 to12 Authorized APN-AMBR for Downlink */
7257 te = proto_tree_add_item(ext_tree, hf_gtp_ext_auth_apn_ambr_dl, tvb, offset, 4, ENC_BIG_ENDIAN);
7258 proto_item_append_text(te, " kbps");
7260 return 3 + length;
7263 * 7.7.102 GGSN Back-Off Time
7265 /* Table 7.7.102.1: GGSN Back-Off Time information element */
7266 static const value_string gtp_ggsn_back_off_time_units_vals[] = {
7267 {0, "value is incremented in multiples of 2 seconds"},
7268 {1, "value is incremented in multiples of 1 minute"},
7269 {2, "value is incremented in multiples of 10 minutes"},
7270 {3, "value is incremented in multiples of 1 hour"},
7271 {4, "value is incremented in multiples of 10 hours"},
7272 {5, "value indicates that the timer is infinite"},
7273 {0, NULL}
7275 static int
7276 decode_gtp_ggsn_back_off_time(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7278 guint16 length;
7279 proto_tree *ext_tree;
7280 proto_item *te;
7282 length = tvb_get_ntohs(tvb, offset + 1);
7283 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_GGSN_BACK_OFF_TIME, &gtpv1_val_ext, "Unknown"));
7284 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_GGSN_BACK_OFF_TIME]);
7285 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7287 offset++;
7288 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7289 offset = offset + 2;
7291 /* 4 Timer unit Timer value */
7292 proto_tree_add_item(ext_tree, hf_gtp_ext_ggsn_back_off_time_units, tvb, offset, 2, ENC_BIG_ENDIAN);
7293 proto_tree_add_item(ext_tree, hf_gtp_ext_ggsn_back_off_timer, tvb, offset, 2, ENC_BIG_ENDIAN);
7295 return 3 + length;
7299 * 7.7.103 Signalling Priority Indication
7302 static int
7303 decode_gtp_sig_pri_ind(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7305 guint16 length;
7306 proto_tree *ext_tree;
7307 proto_item *te;
7309 length = tvb_get_ntohs(tvb, offset + 1);
7310 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_SIG_PRI_IND, &gtpv1_val_ext, "Unknown"));
7311 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_SIG_PRI_IND]);
7312 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7314 offset++;
7315 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7316 offset = offset + 2;
7318 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7320 return 3 + length;
7323 * 7.7.104 Signalling Priority Indication with NSAPI
7326 static int
7327 decode_gtp_sig_pri_ind_w_nsapi(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7329 guint16 length;
7330 proto_tree *ext_tree;
7331 proto_item *te;
7333 length = tvb_get_ntohs(tvb, offset + 1);
7334 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_SIG_PRI_IND_W_NSAPI, &gtpv1_val_ext, "Unknown"));
7335 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_SIG_PRI_IND_W_NSAPI]);
7336 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7338 offset++;
7339 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7340 offset = offset + 2;
7342 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7344 return 3 + length;
7347 * 7.7.105 Higher bitrates than 16 Mbps flag
7349 static const value_string gtp_higher_br_16mb_flg_vals[] = {
7350 {0, "Not allowed"},
7351 {1, "Allowed"},
7352 {0, NULL}
7355 static int
7356 decode_gtp_higher_br_16mb_flg(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7358 guint16 length;
7359 proto_tree *ext_tree;
7360 proto_item *te;
7362 length = tvb_get_ntohs(tvb, offset + 1);
7363 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_HIGHER_BR_16MB_FLG, &gtpv1_val_ext, "Unknown"));
7364 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_HIGHER_BR_16MB_FLG]);
7365 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7367 offset++;
7368 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7369 offset = offset + 2;
7371 /* Higher bitrates than 16 Mbps flag */
7372 proto_tree_add_item(ext_tree, hf_gtp_higher_br_16mb_flg, tvb, offset, 1, ENC_BIG_ENDIAN);
7374 return 3 + length;
7377 * 7.7.106 Max MBR/APN-AMBR
7380 static int
7381 decode_gtp_max_mbr_apn_ambr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7383 guint16 length;
7384 proto_tree *ext_tree;
7385 proto_item *te;
7386 guint32 max_ul;
7387 guint32 max_dl;
7389 length = tvb_get_ntohs(tvb, offset + 1);
7390 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_MAX_MBR_APN_AMBR, &gtpv1_val_ext, "Unknown"));
7391 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_MAX_MBR_APN_AMBR]);
7392 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7394 offset++;
7395 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7396 offset = offset + 2;
7398 /* Max MBR/APN-AMBR for uplink */
7399 max_ul = tvb_get_ntohl(tvb, offset);
7400 proto_tree_add_uint_format(ext_tree, hf_gtp_max_mbr_apn_ambr_ul, tvb, offset, 4, max_ul, "Max MBR/APN-AMBR for uplink : %u %s",
7401 (max_ul) > 1000 ? max_ul/1000 : max_ul,
7402 (max_ul) > 1000 ? "Mbps" : "kbps");
7404 offset += 4;
7406 /* Max MBR/APN-AMBR for downlink */
7407 max_dl = tvb_get_ntohl(tvb, offset);
7408 proto_tree_add_uint_format(ext_tree, hf_gtp_max_mbr_apn_ambr_dl, tvb, offset, 4, max_dl, "Max MBR/APN-AMBR for downlink : %u %s",
7409 (max_dl) > 1000 ? max_dl/1000 : max_dl,
7410 (max_dl) > 1000 ? "Mbps" : "kbps");
7412 return 3 + length;
7415 * 7.7.107 Additional MM context for SRVCC
7418 static int
7419 decode_gtp_add_mm_ctx_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7421 guint16 length;
7422 proto_tree *ext_tree;
7423 proto_item *te;
7425 length = tvb_get_ntohs(tvb, offset + 1);
7426 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_MM_CTX_SRVCC, &gtpv1_val_ext, "Unknown"));
7427 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_ADD_MM_CTX_SRVCC]);
7428 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7430 offset++;
7431 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7432 offset = offset + 2;
7434 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7436 return 3 + length;
7440 * 7.7.108 Additional flags for SRVCC
7443 static int
7444 decode_gtp_add_flgs_srvcc(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7446 guint16 length;
7447 proto_tree *ext_tree;
7448 proto_item *te;
7450 length = tvb_get_ntohs(tvb, offset + 1);
7451 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_ADD_FLGS_SRVCC, &gtpv1_val_ext, "Unknown"));
7452 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_ADD_FLGS_SRVCC]);
7453 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7455 offset++;
7456 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7457 offset = offset + 2;
7459 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7461 return 3 + length;
7464 * 7.7.109 STN-SR
7466 static int
7467 decode_gtp_stn_sr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7469 guint16 length;
7470 proto_tree *ext_tree;
7471 proto_item *te;
7473 length = tvb_get_ntohs(tvb, offset + 1);
7474 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_STN_SR, &gtpv1_val_ext, "Unknown"));
7475 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_STN_SR]);
7476 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7478 offset++;
7479 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7480 offset = offset + 2;
7482 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7484 return 3 + length;
7488 * 7.7.110 C-MSISDN
7491 static int
7492 decode_gtp_c_msisdn(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7494 guint16 length;
7495 proto_tree *ext_tree;
7496 proto_item *te;
7498 length = tvb_get_ntohs(tvb, offset + 1);
7499 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_C_MSISDN, &gtpv1_val_ext, "Unknown"));
7500 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_C_MSISDN]);
7501 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7503 offset++;
7504 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7505 offset = offset + 2;
7507 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7509 return 3 + length;
7512 * 7.7.111 Extended RANAP Cause
7514 static int
7515 decode_gtp_ext_ranap_cause(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7517 guint16 length;
7518 proto_tree *ext_tree;
7519 proto_item *te;
7521 length = tvb_get_ntohs(tvb, offset + 1);
7522 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "%s", val_to_str_ext_const(GTP_EXT_EXT_RANAP_CAUSE, &gtpv1_val_ext, "Unknown"));
7523 ext_tree = proto_item_add_subtree(te, ett_gtp_ies[GTP_EXT_EXT_RANAP_CAUSE]);
7524 proto_tree_add_item(ext_tree, hf_gtp_ie_id, tvb, offset, 1, ENC_BIG_ENDIAN);
7526 offset++;
7527 proto_tree_add_item(ext_tree, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7528 offset = offset + 2;
7530 proto_tree_add_text(ext_tree, tvb, offset, length, "The rest of the data is not dissected yet");
7532 return 3 + length;
7535 /* GPRS: 12.15
7536 * UMTS: 33.015
7538 static int
7539 decode_gtp_rel_pack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7542 guint16 length, n, number;
7543 proto_tree *ext_tree_rel_pack;
7544 proto_item *te;
7546 length = tvb_get_ntohs(tvb, offset + 1);
7548 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Sequence numbers of released packets IE");
7549 ext_tree_rel_pack = proto_item_add_subtree(te, ett_gtp_rel_pack);
7551 n = 0;
7553 while (n < length) {
7555 number = tvb_get_ntohs(tvb, offset + 3 + n);
7556 proto_tree_add_text(ext_tree_rel_pack, tvb, offset + 3 + n, 2, "%u", number);
7557 n = n + 2;
7561 return 3 + length;
7564 /* GPRS: 12.15
7565 * UMTS: 33.015
7567 static int
7568 decode_gtp_can_pack(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7571 guint16 length, n, number;
7572 proto_tree *ext_tree_can_pack;
7573 proto_item *te;
7575 length = tvb_get_ntohs(tvb, offset + 1);
7577 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Sequence numbers of cancelled packets IE");
7578 ext_tree_can_pack = proto_item_add_subtree(te, ett_gtp_can_pack);
7580 n = 0;
7582 while (n < length) {
7584 number = tvb_get_ntohs(tvb, offset + 3 + n);
7585 proto_tree_add_text(ext_tree_can_pack, tvb, offset + 3 + n, 2, "%u", number);
7586 n = n + 2;
7589 return 3 + length;
7592 /* CDRs dissector
7593 * 3GPP TS 32.295 version 9.0.0 Release 9
7597 static const value_string gtp_cdr_fmt_vals[] = {
7598 {1, "Basic Encoding Rules (BER)"},
7599 {2, "Unaligned basic Packed Encoding Rules (PER)"},
7600 {3, "Aligned basic Packed Encoding Rules (PER)"},
7601 {0, NULL}
7603 static int
7604 decode_gtp_data_req(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7607 guint16 length, cdr_length;
7608 guint8 no, format, app_id, rel_id, ver_id, i;
7609 proto_tree *ext_tree, *ver_tree, *cdr_dr_tree;
7610 proto_item *te, *fmt_item, *ver_item;
7611 tvbuff_t *next_tvb;
7613 te = proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_ext_const(GTP_EXT_DATA_REQ, &gtp_val_ext, "Unknown message"));
7614 ext_tree = proto_item_add_subtree(te, ett_gtp_ext);
7615 offset++;
7617 length = tvb_get_ntohs(tvb, offset);
7618 proto_tree_add_text(ext_tree, tvb, offset, 2, "Length: %u", length);
7619 offset+=2;
7621 /* Octet 4 Number of Data Records */
7622 no = tvb_get_guint8(tvb, offset);
7623 proto_tree_add_text(ext_tree, tvb, offset, 1, "Number of data records: %u", no);
7624 offset++;
7626 /* Octet 5 Data Record Format */
7627 format = tvb_get_guint8(tvb, offset);
7628 fmt_item = proto_tree_add_text(ext_tree, tvb, offset, 1, "Data record format: %u", format);
7629 offset++;
7630 /* The value range is 1-255 in decimal. The value '0' should not be used.
7631 * Only the values 1-10 and 51-255 can be used for standards purposes.
7632 * Values in the range of 11-50 are to be configured only by operators, and are not subject to standardization.
7634 if(format < 4) {
7635 proto_item_append_text(fmt_item, " %s", val_to_str_const(format, gtp_cdr_fmt_vals, "Unknown"));
7636 /* Octet 6 -7 Data Record Format Version
7637 * 8 7 6 5 4 3 2 1
7638 * 6 Application Identifier Release Identifier
7639 * 7 Version Identifier
7641 app_id = tvb_get_guint8(tvb,offset);
7642 rel_id = app_id & 0x0f;
7643 app_id = app_id >>4;
7644 ver_id =tvb_get_guint8(tvb,offset+1);
7645 /* The second octet (#7 in Data Record Packet IE) identifies the version of the TS used to encode the CDR,
7646 * i.e. its value corresponds to the second digit of the version number of the document [51]
7647 * (as shown on the cover sheet), plus '1'.
7648 * E.g. for version 3.4.0, the Version Identifier would be "5".
7649 * In circumstances where the second digit is an alphabetical character, (e.g. 3.b.0), the corresponding ASCII value shall
7650 * be taken, e.g. the Version Identifier would be "66" (ASCII(b)).
7652 if(ver_id < 0x65)
7653 ver_id = ver_id -1;
7654 /* XXX We don't handle ASCCI version */
7656 ver_item = proto_tree_add_text(ext_tree, tvb, offset, 2, "Data record format version: AppId %u Rel %u.%u.0", app_id,rel_id,ver_id);
7657 ver_tree = proto_item_add_subtree(ver_item, ett_gtp_cdr_ver);
7658 proto_tree_add_item(ver_tree, hf_gtp_cdr_app, tvb, offset, 1, ENC_BIG_ENDIAN);
7659 proto_tree_add_item(ver_tree, hf_gtp_cdr_rel, tvb, offset, 1, ENC_BIG_ENDIAN);
7660 offset++;
7661 proto_tree_add_item(ver_tree, hf_gtp_cdr_ver, tvb, offset, 1, ENC_BIG_ENDIAN);
7662 offset++;
7663 for(i = 0; i < no; ++i) {
7664 cdr_length = tvb_get_ntohs(tvb, offset);
7665 te = proto_tree_add_text(ext_tree, tvb, offset, cdr_length+2, "Data record %d", i + 1);
7666 cdr_dr_tree = proto_item_add_subtree(te, ett_gtp_cdr_dr);
7667 proto_tree_add_text(cdr_dr_tree, tvb, offset, 2, "Length: %u", cdr_length);
7668 offset+=2;
7669 proto_tree_add_text(cdr_dr_tree, tvb, offset, cdr_length, "Content");
7670 next_tvb = tvb_new_subset_remaining(tvb, offset);
7672 /* XXX this is for release 6, may not work for higher releases */
7673 if(format==1) {
7674 if(rel_id == 6){
7675 dissect_gprscdr_GPRSCallEventRecord_PDU(next_tvb, pinfo, cdr_dr_tree, NULL);
7676 }else if((rel_id == 8)||(rel_id == 9)){
7677 dissect_gprscdr_GPRSRecord_PDU(next_tvb, pinfo, cdr_dr_tree, NULL);
7679 } else {
7680 /* Do we have a dissector regestering for this data format? */
7681 dissector_try_uint(gtp_cdr_fmt_dissector_table, format, next_tvb, pinfo, cdr_dr_tree);
7684 offset = offset + cdr_length;
7687 } else {
7688 /* Proprietary CDR format */
7689 proto_item_append_text(fmt_item, " Proprietary or un documented format");
7692 if (gtpcdr_handle) {
7693 next_tvb = tvb_new_subset_remaining(tvb, offset);
7694 call_dissector(gtpcdr_handle, next_tvb, pinfo, tree);
7697 return 3 + length;
7700 /* GPRS: 12.15
7701 * UMTS: 33.015
7703 static int
7704 decode_gtp_data_resp(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7707 guint16 length, n, number;
7708 proto_tree *ext_tree_data_resp;
7709 proto_item *te;
7711 length = tvb_get_ntohs(tvb, offset + 1);
7713 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Requests responded");
7714 ext_tree_data_resp = proto_item_add_subtree(te, ett_gtp_data_resp);
7716 n = 0;
7718 while (n < length) {
7720 number = tvb_get_ntohs(tvb, offset + 3 + n);
7721 proto_tree_add_text(ext_tree_data_resp, tvb, offset + 3 + n, 2, "%u", number);
7722 n = n + 2;
7726 return 3 + length;
7730 /* GPRS: 12.15
7731 * UMTS: 33.015
7733 static int
7734 decode_gtp_node_addr(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7737 guint16 length;
7738 guint32 addr_ipv4;
7739 struct e_in6_addr addr_ipv6;
7740 proto_tree *ext_tree_node_addr;
7741 proto_item *te;
7743 length = tvb_get_ntohs(tvb, offset + 1);
7745 te = proto_tree_add_text(tree, tvb, offset, 3 + length, "Node address: ");
7746 ext_tree_node_addr = proto_item_add_subtree(te, ett_gtp_node_addr);
7748 proto_tree_add_text(ext_tree_node_addr, tvb, offset + 1, 2, "Node address length: %u", length);
7750 switch (length) {
7751 case 4:
7752 addr_ipv4 = tvb_get_ipv4(tvb, offset + 3);
7753 proto_item_append_text(te, "%s", ip_to_str((guint8 *) & addr_ipv4));
7754 proto_tree_add_ipv4(ext_tree_node_addr, hf_gtp_node_ipv4, tvb, offset + 3, 4, addr_ipv4);
7755 break;
7756 case 16:
7757 tvb_get_ipv6(tvb, offset + 3, &addr_ipv6);
7758 proto_item_append_text(te, "%s", ip6_to_str((struct e_in6_addr *) &addr_ipv6));
7759 proto_tree_add_ipv6(ext_tree_node_addr, hf_gtp_node_ipv6, tvb, offset + 3, 16, (guint8 *) & addr_ipv6);
7760 break;
7761 default:
7762 proto_item_append_text(te, "unknown type or wrong length");
7763 break;
7766 return 3 + length;
7770 /* GPRS: 9.60 v7.6.0, chapter 7.9.26
7771 * UMTS: 29.060 v4.0, chapter 7.7.46 Private Extension
7775 static int
7776 decode_gtp_priv_ext(tvbuff_t * tvb, int offset, packet_info * pinfo, proto_tree * tree)
7779 guint16 length, ext_id;
7780 proto_tree *ext_tree_priv_ext;
7781 proto_item *te;
7782 tvbuff_t *next_tvb;
7784 te = proto_tree_add_text(tree, tvb, offset, 1, "%s : ", val_to_str_ext_const(GTP_EXT_PRIV_EXT, &gtp_val_ext, "Unknown message"));
7785 ext_tree_priv_ext = proto_item_add_subtree(te, ett_gtp_ext);
7787 offset++;
7788 length = tvb_get_ntohs(tvb, offset);
7789 proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_length, tvb, offset, 2, ENC_BIG_ENDIAN);
7790 offset = offset + 2;
7791 if (length >= 2) {
7792 ext_id = tvb_get_ntohs(tvb, offset);
7793 proto_tree_add_uint(ext_tree_priv_ext, hf_gtp_ext_id, tvb, offset, 2, ext_id);
7794 proto_item_append_text(te, "%s (%u)", val_to_str_ext_const(ext_id, &sminmpec_values_ext, "Unknown"), ext_id);
7795 offset = offset + 2;
7797 if (length > 2) {
7798 next_tvb = tvb_new_subset(tvb, offset, length-2, length-2);
7799 if(!dissector_try_uint(gtp_priv_ext_dissector_table, ext_id, next_tvb, pinfo, ext_tree_priv_ext)){
7800 proto_tree_add_item(ext_tree_priv_ext, hf_gtp_ext_val, tvb, offset, length - 2, ENC_NA);
7805 return 3 + length;
7808 static int
7809 decode_gtp_unknown(tvbuff_t * tvb, int offset, packet_info * pinfo _U_, proto_tree * tree)
7812 proto_tree_add_text(tree, tvb, offset, 1, "Unknown extension header");
7814 return tvb_length_remaining(tvb, offset);
7817 static int
7818 dissect_gtp_common(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
7820 guint8 octet;
7821 gtp_hdr_t *gtp_hdr = NULL;
7822 proto_tree *gtp_tree = NULL, *ext_tree;
7823 proto_item *ti = NULL, *tf, *ext_hdr_len_item;
7824 int i, offset = 0, checked_field, mandatory;
7825 gboolean gtp_prime;
7826 int seq_no = 0;
7827 int flow_label = 0;
7828 guint8 pdu_no, next_hdr = 0;
7829 guint8 ext_hdr_val;
7830 guint ext_hdr_length;
7831 guint16 ext_hdr_pdcpsn;
7832 gchar *tid_str;
7833 tvbuff_t *next_tvb;
7834 guint8 sub_proto;
7835 guint8 acfield_len = 0;
7836 guint8 control_field;
7837 gtp_msg_hash_t *gcrp = NULL;
7838 conversation_t *conversation;
7839 gtp_conv_info_t *gtp_info;
7841 /* Do we have enough bytes for the version and message type? */
7842 if (!tvb_bytes_exist(tvb, 0, 2)) {
7843 /* No - reject the packet. */
7844 return 0;
7846 octet = tvb_get_guint8(tvb, 0);
7847 if (((octet >> 5) & 0x07) > 2) {
7848 /* Version > 2; reject the packet */
7849 return 0;
7851 octet = tvb_get_guint8(tvb, 1);
7852 if (octet == GTP_MSG_UNKNOWN || try_val_to_str(octet, gtp_message_type) == NULL) {
7853 /* Unknown message type; reject the packet */
7854 return 0;
7857 /* Setting everything to 0, so that the TEID is 0 for GTP version 0
7858 * The magic number should perhaps be replaced.
7860 gtp_hdr = wmem_new0(wmem_packet_scope(), gtp_hdr_t);
7862 /* Setting the TEID to -1 to say that the TEID is not valid for this packet */
7863 gtp_hdr->teid = -1;
7865 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTP");
7866 col_clear(pinfo->cinfo, COL_INFO);
7869 * Do we have a conversation for this connection?
7871 conversation = find_or_create_conversation(pinfo);
7874 * Do we already know this conversation?
7876 gtp_info = (gtp_conv_info_t *)conversation_get_proto_data(conversation, proto_gtp);
7877 if (gtp_info == NULL) {
7878 /* No. Attach that information to the conversation, and add
7879 * it to the list of information structures.
7881 gtp_info = (gtp_conv_info_t *)g_malloc(sizeof(gtp_conv_info_t));
7882 /*Request/response matching tables*/
7883 gtp_info->matched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_matched);
7884 gtp_info->unmatched = g_hash_table_new(gtp_sn_hash, gtp_sn_equal_unmatched);
7886 conversation_add_proto_data(conversation, proto_gtp, gtp_info);
7888 gtp_info->next = gtp_info_items;
7889 gtp_info_items = gtp_info;
7892 gtp_hdr->flags = tvb_get_guint8(tvb, offset);
7894 if (!(gtp_hdr->flags & 0x10)){
7895 gtp_prime = TRUE;
7896 }else{
7897 gtp_prime = FALSE;
7900 switch ((gtp_hdr->flags >> 5) & 0x07) {
7901 case 0:
7902 gtp_version = 0;
7903 break;
7904 case 1:
7905 gtp_version = 1;
7906 break;
7907 default:
7908 gtp_version = 1;
7909 break;
7911 if (tree) {
7912 proto_tree *flags_tree;
7913 ti = proto_tree_add_item(tree, proto_gtp, tvb, 0, -1, ENC_NA);
7914 gtp_tree = proto_item_add_subtree(ti, ett_gtp);
7916 tf = proto_tree_add_uint(gtp_tree, hf_gtp_flags, tvb, offset, 1, gtp_hdr->flags);
7917 flags_tree = proto_item_add_subtree(tf, ett_gtp_flags);
7918 if(gtp_prime) {
7919 /* Octet 8 7 6 5 4 3 2 1
7920 * 1 Version | PT| Spare '1 1 1 '| ' 0/1 '
7922 proto_tree_add_uint(flags_tree, hf_gtp_prime_flags_ver, tvb, offset, 1, gtp_hdr->flags);
7923 proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, offset, 1, gtp_hdr->flags);
7924 proto_tree_add_uint(flags_tree, hf_gtp_flags_spare1, tvb, offset, 1, gtp_hdr->flags);
7925 /* Bit 1 of octet 1 is not used in GTP' (except in v0), and it is marked '0'
7926 * in the GTP' header. It is in use in GTP' v0 and distinguishes the used header-length.
7927 * In the case of GTP' v0, this bit being marked one (1) indicates the usage of the 6
7928 * octets header. If the bit is set to '0' (usually the case) the 20-octet header is used.
7929 * For all other versions of GTP', this bit is not used and is set to '0'. However,
7930 * this does not suggest the use of the 20-octet header, rather a shorter 6-octet header.
7932 if(gtp_version == 0) {
7933 proto_tree_add_item(flags_tree, hf_gtp_flags_hdr_length, tvb, offset, 1, ENC_BIG_ENDIAN);
7935 } else {
7936 proto_tree_add_uint(flags_tree, hf_gtp_flags_ver, tvb, offset, 1, gtp_hdr->flags);
7937 proto_tree_add_uint(flags_tree, hf_gtp_flags_pt, tvb, offset, 1, gtp_hdr->flags);
7938 if(gtp_version == 0) {
7939 proto_tree_add_uint(flags_tree, hf_gtp_flags_spare1, tvb, offset, 1, gtp_hdr->flags);
7940 proto_tree_add_boolean(flags_tree, hf_gtp_flags_snn, tvb, offset, 1, gtp_hdr->flags);
7941 } else {
7942 proto_tree_add_uint(flags_tree, hf_gtp_flags_spare2, tvb, offset, 1, gtp_hdr->flags);
7943 proto_tree_add_boolean(flags_tree, hf_gtp_flags_e, tvb, offset, 1, gtp_hdr->flags);
7944 proto_tree_add_boolean(flags_tree, hf_gtp_flags_s, tvb, offset, 1, gtp_hdr->flags);
7945 proto_tree_add_boolean(flags_tree, hf_gtp_flags_pn, tvb, offset, 1, gtp_hdr->flags);
7949 offset++;
7951 gtp_hdr->message = tvb_get_guint8(tvb, offset);
7952 /* Link direction is needed to properly dissect PCO */
7953 switch(gtp_hdr->message){
7954 case GTP_MSG_DELETE_PDP_REQ:
7955 case GTP_MSG_UPDATE_PDP_REQ:
7956 case GTP_MSG_CREATE_PDP_REQ:
7957 case GTP_MSG_INIT_PDP_CONTEXT_ACT_REQ:
7958 case GTP_MSG_PDU_NOTIFY_REQ:
7959 case GTP_MSG_PDU_NOTIFY_REJ_REQ:
7960 pinfo->link_dir = P2P_DIR_UL;
7961 break;
7962 case GTP_MSG_DELETE_PDP_RESP:
7963 case GTP_MSG_UPDATE_PDP_RESP:
7964 case GTP_MSG_CREATE_PDP_RESP:
7965 case GTP_MSG_INIT_PDP_CONTEXT_ACT_RESP:
7966 pinfo->link_dir = P2P_DIR_DL;
7967 break;
7968 default:
7969 break;
7971 col_set_str(pinfo->cinfo, COL_INFO, val_to_str_ext_const(gtp_hdr->message, &gtp_message_type_ext, "Unknown"));
7972 if (tree) {
7973 proto_tree_add_uint(gtp_tree, hf_gtp_message_type, tvb, offset, 1, gtp_hdr->message);
7975 offset++;
7977 gtp_hdr->length = tvb_get_ntohs(tvb, offset);
7978 if (tree) {
7979 proto_tree_add_uint(gtp_tree, hf_gtp_length, tvb, 2, 2, gtp_hdr->length);
7981 offset += 2;
7983 if (gtp_prime) {
7984 seq_no = tvb_get_ntohs(tvb, offset);
7985 proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
7986 offset += 2;
7987 /* If GTP' version is 0 and bit 1 is 0 20 bytes header is used, dissect it */
7988 if( (gtp_version == 0) && ((gtp_hdr->flags & 0x01) == 0) ) {
7989 /* XXX - is this just like GTPv0? */
7990 flow_label = tvb_get_ntohs(tvb, offset);
7991 proto_tree_add_uint(gtp_tree, hf_gtp_flow_label, tvb, offset, 2, flow_label);
7992 offset += 2;
7994 pdu_no = tvb_get_guint8(tvb, offset);
7995 proto_tree_add_uint(gtp_tree, hf_gtp_sndcp_number, tvb, offset, 1, pdu_no);
7996 offset += 4;
7998 tid_str = id_to_str(tvb, offset);
7999 proto_tree_add_string(gtp_tree, hf_gtp_tid, tvb, offset, 8, tid_str);
8000 offset += 8;
8003 set_actual_length(tvb, offset + gtp_hdr->length);
8004 } else {
8005 switch (gtp_version) {
8006 case 0:
8007 seq_no = tvb_get_ntohs(tvb, offset);
8008 proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
8009 offset += 2;
8011 flow_label = tvb_get_ntohs(tvb, offset);
8012 proto_tree_add_uint(gtp_tree, hf_gtp_flow_label, tvb, offset, 2, flow_label);
8013 offset += 2;
8015 pdu_no = tvb_get_guint8(tvb, offset);
8016 proto_tree_add_uint(gtp_tree, hf_gtp_sndcp_number, tvb, offset, 1, pdu_no);
8017 offset += 4;
8019 tid_str = id_to_str(tvb, offset);
8020 proto_tree_add_string(gtp_tree, hf_gtp_tid, tvb, offset, 8, tid_str);
8021 offset += 8;
8023 set_actual_length(tvb, offset + gtp_hdr->length);
8025 break;
8026 case 1:
8027 gtp_hdr->teid = tvb_get_ntohl(tvb, offset);
8028 proto_tree_add_item(gtp_tree, hf_gtp_teid, tvb, offset, 4, ENC_BIG_ENDIAN);
8029 offset += 4;
8031 set_actual_length(tvb, offset + gtp_hdr->length);
8033 /* Are sequence number/N-PDU Number/extension header present?
8034 See NOTE 5 of Figure 2 of 3GPP TS 29.060 version 4.3.0
8035 Release 4 - the Sequence Number, N-PDU Number, and
8036 Next Extension Header fields are present if any of
8037 GTP_E_MASK, GTP_S_MASK, or GTP_PN_MASK are set. */
8038 if (gtp_hdr->flags & (GTP_E_MASK|GTP_S_MASK|GTP_PN_MASK)) {
8039 /* Those fields are only *interpreted* if the
8040 particular flag for the field is set. */
8041 if (gtp_hdr->flags & GTP_S_MASK) {
8042 seq_no = tvb_get_ntohs(tvb, offset);
8043 proto_tree_add_uint(gtp_tree, hf_gtp_seq_number, tvb, offset, 2, seq_no);
8045 offset += 2;
8047 if (gtp_hdr->flags & GTP_PN_MASK) {
8048 pdu_no = tvb_get_guint8(tvb, offset);
8049 proto_tree_add_uint(gtp_tree, hf_gtp_npdu_number, tvb, offset, 1, pdu_no);
8051 offset++;
8053 if (gtp_hdr->flags & GTP_E_MASK) {
8054 next_hdr = tvb_get_guint8(tvb, offset);
8055 proto_tree_add_uint(gtp_tree, hf_gtp_ext_hdr_next, tvb, offset, 1, next_hdr);
8056 offset++;
8057 while (next_hdr != 0) {
8058 ext_hdr_length = tvb_get_guint8(tvb, offset);
8059 tf = proto_tree_add_item(gtp_tree, hf_gtp_ext_hdr, tvb, offset, ext_hdr_length*4, ENC_NA);
8060 ext_tree = proto_item_add_subtree(tf, ett_gtp_ext_hdr);
8061 ext_hdr_len_item = proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_length, tvb, offset,1, ENC_BIG_ENDIAN);
8062 if (ext_hdr_length == 0) {
8063 expert_add_info_format(pinfo, ext_hdr_len_item, &ei_gtp_ext_length_mal,
8064 "Extension header length is zero");
8065 return tvb_length(tvb);
8067 offset++;
8069 switch (next_hdr) {
8071 case GTP_EXT_HDR_PDCP_SN:
8072 /* PDCP PDU
8073 * 3GPP 29.281 v9.0.0, 5.2.2.2 PDCP PDU Number
8075 * "This extension header is transmitted, for
8076 * example in UTRAN, at SRNS relocation time,
8077 * to provide the PDCP sequence number of not
8078 * yet acknowledged N-PDUs. It is 4 octets long,
8079 * and therefore the Length field has value 1.
8081 * When used between two eNBs at the X2 interface
8082 * in E-UTRAN, bits 5-8 of octet 2 are spare.
8083 * The meaning of the spare bits shall be set
8084 * to zero.
8086 * Wireshark Note: TS 29.060 does not define bit
8087 * 5-6 as spare, so no check is possible unless
8088 * a preference is used.
8090 /* First byte is length (should be 1) */
8091 if (ext_hdr_length == 1) {
8092 proto_item* ext_item;
8094 ext_hdr_pdcpsn = tvb_get_ntohs(tvb, offset);
8095 ext_item = proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_pdcpsn, tvb, offset, 2, ENC_BIG_ENDIAN);
8096 if (ext_hdr_pdcpsn & 0x700) {
8097 expert_add_info(pinfo, ext_item, &ei_gtp_ext_hdr_pdcpsn);
8099 } else {
8100 expert_add_info_format(pinfo, ext_tree, &ei_gtp_ext_length_warn, "The length field for the PDCP SN Extension header should be 1.");
8102 break;
8104 case GTP_EXT_HDR_UDP_PORT:
8105 /* UDP Port
8106 * 3GPP 29.281 v9.0.0, 5.2.2.1 UDP Port
8107 * "This extension header may be transmitted in
8108 * Error Indication messages to provide the UDP
8109 * Source Port of the G-PDU that triggered the
8110 * Error Indication. It is 4 octets long, and
8111 * therefore the Length field has value 1"
8113 if (ext_hdr_length == 1) {
8114 /* UDP Port of source */
8115 proto_tree_add_item(ext_tree, hf_gtp_ext_hdr_udp_port, tvb, offset, 2, ENC_BIG_ENDIAN);
8116 } else {
8117 /* Bad length */
8118 expert_add_info_format(pinfo, ext_tree, &ei_gtp_ext_length_warn, "The length field for the UDP Port Extension header should be 1.");
8120 break;
8122 case GTP_EXT_HDR_SUSPEND_REQ:
8123 /* Suspend Request */
8124 break;
8126 case GTP_EXT_HDR_SUSPEND_RESP:
8127 /* Suspend Response */
8128 break;
8130 default:
8131 break;
8133 offset += ext_hdr_length*4 - 2;
8135 next_hdr = tvb_get_guint8(tvb, offset);
8136 proto_tree_add_uint(ext_tree, hf_gtp_ext_hdr_next, tvb, offset, 1, next_hdr);
8137 offset++;
8139 } else
8140 offset++;
8142 break;
8143 default:
8144 break;
8148 if (gtp_hdr->message != GTP_MSG_TPDU) {
8149 /* Dissect IEs */
8150 mandatory = 0; /* check order of GTP fields against ETSI */
8151 while (tvb_reported_length_remaining(tvb, offset) > 0) {
8152 ext_hdr_val = tvb_get_guint8(tvb, offset);
8153 if (g_gtp_etsi_order) {
8154 checked_field = check_field_presence(gtp_hdr->message, ext_hdr_val, &mandatory);
8155 switch (checked_field) {
8156 case -2:
8157 proto_tree_add_text(gtp_tree, tvb, 0, 0, "[WARNING] message not found");
8158 break;
8159 case -1:
8160 proto_tree_add_text(gtp_tree, tvb, 0, 0, "[WARNING] field not present");
8161 break;
8162 case 0:
8163 break;
8164 default:
8165 proto_tree_add_text(gtp_tree, tvb, offset, 1, "[WARNING] wrong next field, should be: %s",
8166 val_to_str_ext_const(checked_field, &gtp_val_ext, "Unknown extension field"));
8167 break;
8171 i = -1;
8172 while (gtpopt[++i].optcode)
8173 if (gtpopt[i].optcode == ext_hdr_val)
8174 break;
8175 offset = offset + (*gtpopt[i].decode) (tvb, offset, pinfo, gtp_tree);
8178 /*Use sequence number to track Req/Resp pairs*/
8179 if (seq_no) {
8180 gcrp = gtp_match_response(tvb, pinfo, gtp_tree, seq_no, gtp_hdr->message, gtp_info);
8181 /*pass packet to tap for response time reporting*/
8182 if (gcrp) {
8183 tap_queue_packet(gtp_tap,pinfo,gcrp);
8187 proto_item_set_end (ti, tvb, offset);
8189 if ((gtp_hdr->message == GTP_MSG_TPDU) && dissect_tpdu_as == GTP_TPDU_AS_TPDU) {
8190 if(tvb_reported_length_remaining(tvb, offset) > 0){
8191 proto_tree_add_text(tree, tvb, offset, -1, "T-PDU Data %u bytes", tvb_reported_length_remaining(tvb, offset));
8193 sub_proto = tvb_get_guint8(tvb, offset);
8195 if ((sub_proto >= 0x45) && (sub_proto <= 0x4e)) {
8196 /* this is most likely an IPv4 packet
8197 * we can exclude 0x40 - 0x44 because the minimum header size is 20 octets
8198 * 0x4f is excluded because PPP protocol type "IPv6 header compression"
8199 * with protocol field compression is more likely than a plain IPv4 packet with 60 octet header size */
8201 next_tvb = tvb_new_subset_remaining(tvb, offset);
8202 call_dissector(ip_handle, next_tvb, pinfo, tree);
8204 } else if ((sub_proto & 0xf0) == 0x60) {
8205 /* this is most likely an IPv6 packet */
8206 next_tvb = tvb_new_subset_remaining(tvb, offset);
8207 call_dissector(ipv6_handle, next_tvb, pinfo, tree);
8208 } else {
8209 /* this seems to be a PPP packet */
8211 if (sub_proto == 0xff) {
8212 /* this might be an address field, even it shouldn't be here */
8213 control_field = tvb_get_guint8(tvb, offset + 1);
8214 if (control_field == 0x03)
8215 /* now we are pretty sure that address and control field are mistakenly inserted -> ignore it for PPP dissection */
8216 acfield_len = 2;
8219 next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
8220 call_dissector(ppp_handle, next_tvb, pinfo, tree);
8224 col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <");
8225 col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
8227 else if ((gtp_hdr->message == GTP_MSG_TPDU) && dissect_tpdu_as == GTP_TPDU_AS_SYNC) {
8228 next_tvb = tvb_new_subset_remaining(tvb, offset + acfield_len);
8229 call_dissector(sync_handle, next_tvb, pinfo, tree);
8230 col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "GTP <");
8231 col_append_str(pinfo->cinfo, COL_PROTOCOL, ">");
8234 tap_queue_packet(gtpv1_tap,pinfo, gtp_hdr);
8236 return tvb_length(tvb);
8239 static int
8240 dissect_gtpprim(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
8241 void *private_data _U_)
8243 return dissect_gtp_common(tvb, pinfo, tree);
8246 static int
8247 dissect_gtp(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree,
8248 void *private_data _U_)
8250 guint8 version;
8253 * Do we have enough data to check the first byte?
8255 if (!tvb_bytes_exist(tvb, 0, 1)) {
8256 /* No. */
8257 return 0;
8261 * If this is GTPv2-C call the gtpv2 dissector if present
8262 * Should this be moved to after the conversation stuff to retain that functionality for GTPv2 ???
8264 version = tvb_get_guint8(tvb,0)>>5;
8265 if (version > 2) {
8266 /* Unknown version - reject the packet */
8267 return 0;
8269 if (version == 2) {
8270 /* GTPv2-C 3GPP TS 29.274 */
8271 if (gtpv2_handle) {
8272 call_dissector(gtpv2_handle, tvb, pinfo, tree);
8273 return tvb_length(tvb);
8277 return dissect_gtp_common(tvb, pinfo, tree);
8280 static void
8281 gtp_reinit(void)
8283 gtp_conv_info_t *gtp_info;
8285 /* Free up state attached to the gtp_info structures */
8286 for (gtp_info = gtp_info_items; gtp_info != NULL; ) {
8287 gtp_conv_info_t *next;
8289 g_hash_table_destroy(gtp_info->matched);
8290 gtp_info->matched=NULL;
8291 g_hash_table_destroy(gtp_info->unmatched);
8292 gtp_info->unmatched=NULL;
8294 next = gtp_info->next;
8295 g_free(gtp_info);
8296 gtp_info = next;
8299 gtp_info_items = NULL;
8302 void
8303 proto_register_gtp(void)
8305 module_t *gtp_module;
8306 expert_module_t* expert_gtp;
8307 guint i;
8308 guint last_offset;
8310 static hf_register_info hf_gtp[] = {
8312 {&hf_gtp_ie_id,
8313 { "IE Id", "gtp.ie_id",
8314 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &gtp_val_ext, 0x0,
8315 NULL, HFILL}
8317 {&hf_gtp_response_in,
8318 { "Response In", "gtp.response_in",
8319 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
8320 "The response to this GTP request is in this frame", HFILL}
8322 {&hf_gtp_response_to,
8323 { "Response To", "gtp.response_to",
8324 FT_FRAMENUM, BASE_NONE, NULL, 0x0,
8325 "This is a response to the GTP request in this frame", HFILL}
8327 {&hf_gtp_time,
8328 { "Time", "gtp.time",
8329 FT_RELATIVE_TIME, BASE_NONE, NULL, 0x0,
8330 "The time between the Request and the Response", HFILL}
8332 {&hf_gtp_apn,
8333 { "APN", "gtp.apn",
8334 FT_STRING, BASE_NONE, NULL, 0,
8335 "Access Point Name", HFILL}
8337 {&hf_gtp_cause,
8338 { "Cause", "gtp.cause",
8339 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &cause_type_ext, 0,
8340 "Cause of operation", HFILL}
8342 {&hf_gtp_chrg_char,
8343 { "Charging characteristics", "gtp.chrg_char",
8344 FT_UINT16, BASE_DEC, NULL, 0,
8345 NULL, HFILL}
8347 {&hf_gtp_chrg_char_s,
8348 { "Spare", "gtp.chrg_char_s",
8349 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_S,
8350 NULL, HFILL}
8352 {&hf_gtp_chrg_char_n,
8353 { "Normal charging", "gtp.chrg_char_n",
8354 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_N,
8355 NULL, HFILL}
8357 {&hf_gtp_chrg_char_p,
8358 { "Prepaid charging", "gtp.chrg_char_p",
8359 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_P,
8360 NULL, HFILL}
8362 {&hf_gtp_chrg_char_f,
8363 { "Flat rate charging", "gtp.chrg_char_f",
8364 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_F,
8365 NULL, HFILL}
8367 {&hf_gtp_chrg_char_h,
8368 { "Hot billing charging", "gtp.chrg_char_h",
8369 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_H,
8370 NULL, HFILL}
8372 {&hf_gtp_chrg_char_r,
8373 { "Reserved", "gtp.chrg_char_r",
8374 FT_UINT16, BASE_DEC, NULL, GTP_MASK_CHRG_CHAR_R,
8375 NULL, HFILL}
8377 {&hf_gtp_chrg_id,
8378 { "Charging ID", "gtp.chrg_id",
8379 FT_UINT32, BASE_HEX, NULL, 0,
8380 NULL, HFILL}
8382 {&hf_gtp_chrg_ipv4,
8383 { "CG address IPv4", "gtp.chrg_ipv4",
8384 FT_IPv4, BASE_NONE, NULL, 0,
8385 "Charging Gateway address IPv4", HFILL}
8387 {&hf_gtp_chrg_ipv6,
8388 { "CG address IPv6", "gtp.chrg_ipv6",
8389 FT_IPv6, BASE_NONE, NULL, 0,
8390 "Charging Gateway address IPv6", HFILL}
8392 {&hf_gtp_ext_flow_label,
8393 { "Flow Label Data I", "gtp.ext_flow_label",
8394 FT_UINT16, BASE_HEX, NULL, 0,
8395 "Flow label data", HFILL}
8397 {&hf_gtp_ext_id,
8398 { "Extension identifier", "gtp.ext_id",
8399 FT_UINT16, BASE_DEC|BASE_EXT_STRING, &sminmpec_values_ext, 0,
8400 "Private Enterprise number", HFILL}
8402 {&hf_gtp_ext_val,
8403 { "Extension value", "gtp.ext_val",
8404 FT_BYTES, BASE_NONE, NULL, 0,
8405 NULL, HFILL}
8407 {&hf_gtp_flags,
8408 { "Flags", "gtp.flags",
8409 FT_UINT8, BASE_HEX, NULL, 0,
8410 "Ver/PT/Spare...", HFILL}
8412 {&hf_gtp_ext_hdr,
8413 { "Extension header", "gtp.ext_hdr",
8414 FT_NONE, BASE_NONE, NULL, 0,
8415 NULL, HFILL}
8417 {&hf_gtp_ext_hdr_next,
8418 { "Next extension header type", "gtp.ext_hdr.next",
8419 FT_UINT8, BASE_HEX, VALS(next_extension_header_fieldvals), 0,
8420 NULL, HFILL}
8422 {&hf_gtp_ext_hdr_pdcpsn,
8423 { "PDCP Sequence Number", "gtp.ext_hdr.pdcp_sn",
8424 FT_UINT16, BASE_DEC, NULL, 0,
8425 NULL, HFILL}
8427 {&hf_gtp_ext_hdr_udp_port,
8428 { "UDP Port", "gtp.ext_hdr.udp_port",
8429 FT_UINT16, BASE_DEC, NULL, 0,
8430 NULL, HFILL}
8432 {&hf_gtp_ext_hdr_length,
8433 { "Extension Header Length", "gtp.ext_hdr.length",
8434 FT_UINT8, BASE_DEC, NULL, 0,
8435 NULL, HFILL}
8437 {&hf_gtp_flags_ver,
8438 { "Version", "gtp.flags.version",
8439 FT_UINT8, BASE_DEC, VALS(ver_types), GTP_VER_MASK,
8440 "GTP Version", HFILL}
8442 {&hf_gtp_prime_flags_ver,
8443 { "Version", "gtp.prim.flags.version",
8444 FT_UINT8, BASE_DEC,NULL, GTP_VER_MASK,
8445 "GTP' Version", HFILL}
8447 {&hf_gtp_flags_pt,
8448 { "Protocol type", "gtp.flags.payload",
8449 FT_UINT8, BASE_DEC, VALS(pt_types), GTP_PT_MASK,
8450 NULL, HFILL}
8452 {&hf_gtp_flags_spare1,
8453 { "Reserved", "gtp.flags.reserved",
8454 FT_UINT8, BASE_DEC, NULL, GTP_SPARE1_MASK,
8455 "Reserved (shall be sent as '111' )", HFILL}
8457 {&hf_gtp_flags_hdr_length,
8458 { "Header length", "gtp.flags.hdr_length",
8459 FT_BOOLEAN, 8, TFS(&gtp_hdr_length_vals), 0x01,
8460 NULL, HFILL}
8462 {&hf_gtp_flags_snn,
8463 { "Is SNDCP N-PDU included?", "gtp.flags.snn",
8464 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_SNN_MASK,
8465 "Is SNDCP N-PDU LLC Number included? (1 = yes, 0 = no)", HFILL}
8467 {&hf_gtp_flags_spare2,
8468 { "Reserved", "gtp.flags.reserved",
8469 FT_UINT8, BASE_DEC, NULL, GTP_SPARE2_MASK,
8470 "Reserved (shall be sent as '1' )", HFILL}
8472 {&hf_gtp_flags_e,
8473 { "Is Next Extension Header present?", "gtp.flags.e",
8474 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_E_MASK,
8475 "Is Next Extension Header present? (1 = yes, 0 = no)", HFILL}
8477 {&hf_gtp_flags_s,
8478 { "Is Sequence Number present?", "gtp.flags.s",
8479 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_S_MASK,
8480 "Is Sequence Number present? (1 = yes, 0 = no)", HFILL}
8482 {&hf_gtp_flags_pn,
8483 { "Is N-PDU number present?", "gtp.flags.pn",
8484 FT_BOOLEAN, 8, TFS(&tfs_yes_no), GTP_PN_MASK,
8485 "Is N-PDU number present? (1 = yes, 0 = no)", HFILL}
8487 {&hf_gtp_flow_ii,
8488 { "Flow Label Data II", "gtp.flow_ii",
8489 FT_UINT16, BASE_DEC, NULL, 0,
8490 "Downlink flow label data", HFILL}
8492 {&hf_gtp_flow_label,
8493 { "Flow label", "gtp.flow_label",
8494 FT_UINT16, BASE_HEX, NULL, 0,
8495 NULL, HFILL}
8497 {&hf_gtp_flow_sig,
8498 { "Flow label Signalling", "gtp.flow_sig",
8499 FT_UINT16, BASE_HEX, NULL, 0,
8500 NULL, HFILL}
8502 {&hf_gtp_gsn_addr_len,
8503 { "GSN Address Length", "gtp.gsn_addr_len",
8504 FT_UINT8, BASE_DEC, NULL, GTP_EXT_GSN_ADDR_LEN_MASK,
8505 NULL, HFILL}
8507 {&hf_gtp_gsn_addr_type,
8508 { "GSN Address Type", "gtp.gsn_addr_type",
8509 FT_UINT8, BASE_DEC, VALS(gsn_addr_type), GTP_EXT_GSN_ADDR_TYPE_MASK,
8510 NULL, HFILL}
8512 {&hf_gtp_gsn_ipv4,
8513 { "GSN address IPv4", "gtp.gsn_ipv4",
8514 FT_IPv4, BASE_NONE, NULL, 0,
8515 NULL, HFILL}
8517 {&hf_gtp_gsn_ipv6,
8518 { "GSN address IPv6", "gtp.gsn_ipv6",
8519 FT_IPv6, BASE_NONE, NULL, 0,
8520 NULL, HFILL}
8522 {&hf_gtp_imsi,
8523 { "IMSI", "gtp.imsi",
8524 FT_STRING, BASE_NONE, NULL, 0,
8525 "International Mobile Subscriber Identity number", HFILL}
8527 {&hf_gtp_length,
8528 { "Length", "gtp.length",
8529 FT_UINT16, BASE_DEC, NULL, 0,
8530 "Length (i.e. number of octets after TID or TEID)", HFILL}
8532 {&hf_gtp_map_cause,
8533 { "MAP cause", "gtp.map_cause",
8534 FT_UINT8, BASE_DEC, VALS(gsm_old_GSMMAPLocalErrorcode_vals), 0,
8535 NULL, HFILL}
8537 {&hf_gtp_message_type,
8538 { "Message Type", "gtp.message",
8539 FT_UINT8, BASE_HEX|BASE_EXT_STRING, &gtp_message_type_ext, 0x0,
8540 "GTP Message Type", HFILL}
8542 {&hf_gtp_ms_reason,
8543 { "MS not reachable reason", "gtp.ms_reason",
8544 FT_UINT8, BASE_DEC, VALS(ms_not_reachable_type), 0,
8545 NULL, HFILL}
8547 {&hf_gtp_ms_valid,
8548 { "MS validated", "gtp.ms_valid",
8549 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
8550 NULL, HFILL}
8552 {&hf_gtp_node_ipv4,
8553 { "Node address IPv4", "gtp.node_ipv4",
8554 FT_IPv4, BASE_NONE, NULL, 0,
8555 "Recommended node address IPv4", HFILL}
8557 {&hf_gtp_node_ipv6,
8558 { "Node address IPv6", "gtp.node_ipv6",
8559 FT_IPv6, BASE_NONE, NULL, 0,
8560 "Recommended node address IPv6", HFILL}
8562 {&hf_gtp_npdu_number,
8563 { "N-PDU Number", "gtp.npdu_number",
8564 FT_UINT8, BASE_HEX, NULL, 0,
8565 NULL, HFILL}
8567 {&hf_gtp_nsapi,
8568 { "NSAPI", "gtp.nsapi",
8569 FT_UINT8, BASE_DEC, NULL, 0x0f,
8570 "Network layer Service Access Point Identifier", HFILL}
8572 {&hf_gtp_qos_version,
8573 { "Version", "gtp.qos_version",
8574 FT_UINT8, BASE_HEX, NULL, 0,
8575 "Version of the QoS Profile", HFILL}
8577 {&hf_gtp_qos_spare1,
8578 { "Spare", "gtp.qos_spare1",
8579 FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE1_MASK,
8580 "Spare (shall be sent as '00' )", HFILL}
8582 {&hf_gtp_qos_delay,
8583 { "QoS delay", "gtp.qos_delay",
8584 FT_UINT8, BASE_DEC, VALS(qos_delay_type), GTP_EXT_QOS_DELAY_MASK,
8585 "Quality of Service Delay Class", HFILL}
8587 {&hf_gtp_qos_reliability,
8588 { "QoS reliability", "gtp.qos_reliability",
8589 FT_UINT8, BASE_DEC, VALS(qos_reliability_type), GTP_EXT_QOS_RELIABILITY_MASK,
8590 "Quality of Service Reliability Class", HFILL}
8592 {&hf_gtp_qos_peak,
8593 { "QoS peak", "gtp.qos_peak",
8594 FT_UINT8, BASE_DEC, VALS(qos_peak_type), GTP_EXT_QOS_PEAK_MASK,
8595 "Quality of Service Peak Throughput", HFILL}
8597 {&hf_gtp_qos_spare2,
8598 { "Spare", "gtp.qos_spare2",
8599 FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE2_MASK,
8600 "Spare (shall be sent as 0)", HFILL}
8602 {&hf_gtp_qos_precedence,
8603 { "QoS precedence", "gtp.qos_precedence",
8604 FT_UINT8, BASE_DEC, VALS(qos_precedence_type), GTP_EXT_QOS_PRECEDENCE_MASK,
8605 "Quality of Service Precedence Class", HFILL}
8607 {&hf_gtp_qos_spare3,
8608 { "Spare", "gtp.qos_spare3",
8609 FT_UINT8, BASE_DEC, NULL, GTP_EXT_QOS_SPARE3_MASK,
8610 "Spare (shall be sent as '000' )", HFILL}
8612 {&hf_gtp_qos_mean,
8613 { "QoS mean", "gtp.qos_mean",
8614 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &qos_mean_type_ext, GTP_EXT_QOS_MEAN_MASK,
8615 "Quality of Service Mean Throughput", HFILL}
8617 {&hf_gtp_qos_al_ret_priority,
8618 { "Allocation/Retention priority", "gtp.qos_al_ret_priority",
8619 FT_UINT8, BASE_DEC, NULL, 0,
8620 NULL, HFILL}
8622 {&hf_gtp_qos_traf_class,
8623 { "Traffic class", "gtp.qos_traf_class",
8624 FT_UINT8, BASE_DEC, VALS(qos_traf_class), GTP_EXT_QOS_TRAF_CLASS_MASK,
8625 NULL, HFILL}
8627 {&hf_gtp_qos_del_order,
8628 { "Delivery order", "gtp.qos_del_order",
8629 FT_UINT8, BASE_DEC, VALS(qos_del_order), GTP_EXT_QOS_DEL_ORDER_MASK,
8630 NULL, HFILL}
8632 {&hf_gtp_qos_del_err_sdu,
8633 { "Delivery of erroneous SDU", "gtp.qos_del_err_sdu",
8634 FT_UINT8, BASE_DEC, VALS(qos_del_err_sdu), GTP_EXT_QOS_DEL_ERR_SDU_MASK,
8635 NULL, HFILL}
8637 {&hf_gtp_qos_max_sdu_size,
8638 { "Maximum SDU size", "gtp.qos_max_sdu_size",
8639 FT_UINT8, BASE_DEC, VALS(qos_max_sdu_size), 0,
8640 NULL, HFILL}
8642 {&hf_gtp_qos_max_ul,
8643 { "Maximum bit rate for uplink", "gtp.qos_max_ul",
8644 FT_UINT8, BASE_DEC, VALS(qos_max_ul), 0,
8645 NULL, HFILL}
8647 {&hf_gtp_qos_max_dl,
8648 { "Maximum bit rate for downlink", "gtp.qos_max_dl",
8649 FT_UINT8, BASE_DEC, VALS(qos_max_dl), 0,
8650 NULL, HFILL}
8652 {&hf_gtp_qos_res_ber,
8653 { "Residual BER", "gtp.qos_res_ber",
8654 FT_UINT8, BASE_DEC, VALS(qos_res_ber), GTP_EXT_QOS_RES_BER_MASK,
8655 "Residual Bit Error Rate", HFILL}
8657 {&hf_gtp_qos_sdu_err_ratio,
8658 { "SDU Error ratio", "gtp.qos_sdu_err_ratio",
8659 FT_UINT8, BASE_DEC, VALS(qos_sdu_err_ratio), GTP_EXT_QOS_SDU_ERR_RATIO_MASK,
8660 NULL,
8661 HFILL}
8663 {&hf_gtp_qos_trans_delay,
8664 { "Transfer delay", "gtp.qos_trans_delay",
8665 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &qos_trans_delay_ext, GTP_EXT_QOS_TRANS_DELAY_MASK,
8666 NULL, HFILL}
8668 {&hf_gtp_qos_traf_handl_prio,
8669 { "Traffic handling priority", "gtp.qos_traf_handl_prio",
8670 FT_UINT8, BASE_DEC, VALS(qos_traf_handl_prio), GTP_EXT_QOS_TRAF_HANDL_PRIORITY_MASK,
8671 NULL, HFILL}
8673 {&hf_gtp_qos_guar_ul,
8674 { "Guaranteed bit rate for uplink", "gtp.qos_guar_ul",
8675 FT_UINT8, BASE_DEC, VALS(qos_guar_ul), 0,
8676 NULL, HFILL}
8678 {&hf_gtp_qos_guar_dl,
8679 { "Guaranteed bit rate for downlink", "gtp.qos_guar_dl",
8680 FT_UINT8, BASE_DEC, VALS(qos_guar_dl), 0,
8681 NULL, HFILL}
8683 {&hf_gtp_qos_src_stat_desc,
8684 { "Source Statistics Descriptor", "gtp.src_stat_desc",
8685 FT_UINT8, BASE_DEC, VALS(src_stat_desc_vals), GTP_EXT_QOS_SRC_STAT_DESC_MASK,
8686 NULL, HFILL}
8688 {&hf_gtp_qos_sig_ind,
8689 { "Signalling Indication", "gtp.sig_ind",
8690 FT_BOOLEAN, 8, TFS(&gtp_sig_ind), GTP_EXT_QOS_SIG_IND_MASK,
8691 NULL, HFILL}
8693 { &hf_gtp_qos_arp_pci,
8694 {"Pre-emption Capability (PCI)", "gtp.qos_arp_pci",
8695 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
8696 NULL, HFILL}
8698 { &hf_gtp_qos_arp_pl,
8699 {"Priority Level", "gtp.qos_arp_pl",
8700 FT_UINT8, BASE_DEC, NULL, 0x3c,
8701 NULL, HFILL}
8703 { &hf_gtp_qos_arp_pvi,
8704 {"Pre-emption Vulnerability (PVI)", "gtp.qos_arp_pvi",
8705 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
8706 NULL, HFILL}
8708 {&hf_gtp_qos_qci,
8709 {"QCI", "gtp.qos_qci",
8710 FT_UINT8, BASE_DEC, NULL, 0x0,
8711 NULL, HFILL}
8713 {&hf_gtp_qos_ul_mbr,
8714 {"Uplink Maximum Bit Rate", "gtp.qos_ul_mbr",
8715 FT_UINT64, BASE_DEC, NULL, 0x0,
8716 NULL, HFILL}
8718 {&hf_gtp_qos_dl_mbr,
8719 {"Downlink Maximum Bit Rate", "gtp.qos_dl_mbr",
8720 FT_UINT64, BASE_DEC, NULL, 0x0,
8721 NULL, HFILL}
8723 {&hf_gtp_qos_ul_gbr,
8724 {"Uplink Guaranteed Bit Rate", "gtp.qos_ul_gbr",
8725 FT_UINT64, BASE_DEC, NULL, 0x0,
8726 NULL, HFILL}
8728 {&hf_gtp_qos_dl_gbr,
8729 {"Downlink Guaranteed Bit Rate", "gtp.qos_dl_gbr",
8730 FT_UINT64, BASE_DEC, NULL, 0x0,
8731 NULL, HFILL}
8733 {&hf_gtp_qos_ul_apn_ambr,
8734 {"Uplink APN Aggregate Maximum Bit Rate", "gtp.qos_ul_apn_ambr",
8735 FT_UINT32, BASE_DEC, NULL, 0x0,
8736 NULL, HFILL}
8738 {&hf_gtp_qos_dl_apn_ambr,
8739 {"Downlink APN Aggregate Maximum Bit Rate", "gtp.qos_dl_apn_ambr",
8740 FT_UINT32, BASE_DEC, NULL, 0x0,
8741 NULL, HFILL}
8743 {&hf_gtp_pkt_flow_id,
8744 { "Packet Flow ID", "gtp.pkt_flow_id",
8745 FT_UINT8, BASE_DEC, NULL, 0,
8746 NULL, HFILL}
8748 {&hf_gtp_ptmsi,
8749 { "P-TMSI", "gtp.ptmsi",
8750 FT_UINT32, BASE_HEX, NULL, 0,
8751 "Packet-Temporary Mobile Subscriber Identity", HFILL}
8753 {&hf_gtp_ptmsi_sig,
8754 { "P-TMSI Signature", "gtp.ptmsi_sig",
8755 FT_UINT24, BASE_HEX, NULL, 0,
8756 NULL, HFILL}
8758 {&hf_gtp_rab_gtpu_dn,
8759 { "Downlink GTP-U seq number", "gtp.rab_gtp_dn",
8760 FT_UINT16, BASE_DEC, NULL, 0,
8761 "Downlink GTP-U sequence number", HFILL}
8763 {&hf_gtp_rab_gtpu_up,
8764 { "Uplink GTP-U seq number", "gtp.rab_gtp_up",
8765 FT_UINT16, BASE_DEC, NULL, 0,
8766 "Uplink GTP-U sequence number", HFILL}
8768 {&hf_gtp_rab_pdu_dn,
8769 { "Downlink next PDCP-PDU seq number", "gtp.rab_pdu_dn",
8770 FT_UINT16, BASE_DEC, NULL, 0,
8771 "Downlink next PDCP-PDU sequence number", HFILL}
8773 {&hf_gtp_rab_pdu_up,
8774 { "Uplink next PDCP-PDU seq number", "gtp.rab_pdu_up",
8775 FT_UINT16, BASE_DEC, NULL, 0,
8776 "Uplink next PDCP-PDU sequence number", HFILL}
8778 {&hf_gtp_rai_rac,
8779 { "RAC", "gtp.rac",
8780 FT_UINT8, BASE_DEC, NULL, 0,
8781 "Routing Area Code", HFILL}
8783 {&hf_gtp_rai_lac,
8784 { "LAC", "gtp.lac",
8785 FT_UINT16, BASE_DEC, NULL, 0,
8786 "Location Area Code", HFILL}
8788 { &hf_gtp_tac,
8789 {"TAC", "gtp.tac",
8790 FT_UINT16, BASE_DEC, NULL, 0,
8791 "Tracking Area Code", HFILL}
8793 { &hf_gtp_eci,
8794 {"ECI", "gtp.eci",
8795 FT_UINT32, BASE_DEC, NULL, 0x0FFFFFFF,
8796 "E-UTRAN Cell Identifier", HFILL}
8798 {&hf_gtp_ranap_cause,
8799 { "RANAP cause", "gtp.ranap_cause",
8800 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ranap_cause_type_ext, 0,
8801 NULL, HFILL}
8803 {&hf_gtp_recovery,
8804 { "Recovery", "gtp.recovery",
8805 FT_UINT8, BASE_DEC, NULL, 0,
8806 "Restart counter", HFILL}
8808 {&hf_gtp_reorder,
8809 { "Reordering required", "gtp.reorder",
8810 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
8811 NULL, HFILL}
8813 {&hf_gtp_rnc_ipv4,
8814 { "RNC address IPv4", "gtp.rnc_ipv4",
8815 FT_IPv4, BASE_NONE, NULL, 0,
8816 "Radio Network Controller address IPv4", HFILL}
8818 {&hf_gtp_rnc_ipv6,
8819 { "RNC address IPv6", "gtp.rnc_ipv6",
8820 FT_IPv6, BASE_NONE, NULL, 0,
8821 "Radio Network Controller address IPv6", HFILL}
8823 {&hf_gtp_rp,
8824 { "Radio Priority", "gtp.rp",
8825 FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_MASK,
8826 "Radio Priority for uplink tx", HFILL}
8828 {&hf_gtp_rp_nsapi,
8829 { "NSAPI in Radio Priority", "gtp.rp_nsapi",
8830 FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_NSAPI_MASK,
8831 "Network layer Service Access Point Identifier in Radio Priority", HFILL}
8833 {&hf_gtp_rp_sms,
8834 { "Radio Priority SMS", "gtp.rp_sms",
8835 FT_UINT8, BASE_DEC, NULL, 0,
8836 "Radio Priority for MO SMS", HFILL}
8838 {&hf_gtp_rp_spare,
8839 { "Reserved", "gtp.rp_spare",
8840 FT_UINT8, BASE_DEC, NULL, GTPv1_EXT_RP_SPARE_MASK,
8841 "Spare bit", HFILL}
8843 {&hf_gtp_sel_mode,
8844 { "Selection mode", "gtp.sel_mode",
8845 FT_UINT8, BASE_DEC, VALS(sel_mode_type), 0x03,
8846 NULL, HFILL}
8848 {&hf_gtp_seq_number,
8849 { "Sequence number", "gtp.seq_number",
8850 FT_UINT16, BASE_HEX, NULL, 0,
8851 NULL, HFILL}
8853 {&hf_gtp_sndcp_number,
8854 { "SNDCP N-PDU LLC Number", "gtp.sndcp_number",
8855 FT_UINT8, BASE_HEX, NULL, 0,
8856 NULL, HFILL}
8858 {&hf_gtp_tear_ind,
8859 { "Teardown Indicator", "gtp.tear_ind",
8860 FT_BOOLEAN, BASE_NONE, NULL, 0x0,
8861 NULL, HFILL}
8863 {&hf_gtp_teid,
8864 { "TEID", "gtp.teid",
8865 FT_UINT32, BASE_HEX, NULL, 0,
8866 "Tunnel Endpoint Identifier", HFILL}
8868 {&hf_gtp_teid_cp,
8869 { "TEID Control Plane", "gtp.teid_cp",
8870 FT_UINT32, BASE_HEX, NULL, 0,
8871 "Tunnel Endpoint Identifier Control Plane", HFILL}
8873 {&hf_gtp_ulink_teid_cp,
8874 { "Uplink TEID Control Plane", "gtp.ulink_teid_cp",
8875 FT_UINT32, BASE_HEX, NULL, 0,
8876 "Uplink Tunnel Endpoint Identifier Control Plane", HFILL}
8878 {&hf_gtp_teid_data,
8879 { "TEID Data I", "gtp.teid_data",
8880 FT_UINT32, BASE_HEX, NULL, 0,
8881 "Tunnel Endpoint Identifier Data I", HFILL}
8883 {&hf_gtp_ulink_teid_data,
8884 { "Uplink TEID Data I", "gtp.ulink_teid_data",
8885 FT_UINT32, BASE_HEX, NULL, 0,
8886 "UplinkTunnel Endpoint Identifier Data I", HFILL}
8888 {&hf_gtp_teid_ii,
8889 { "TEID Data II", "gtp.teid_ii",
8890 FT_UINT32, BASE_HEX, NULL, 0,
8891 "Tunnel Endpoint Identifier Data II", HFILL}
8893 {&hf_gtp_tft_code,
8894 { "TFT operation code", "gtp.tft_code",
8895 FT_UINT8, BASE_DEC, VALS(tft_code_type), GTPv1_TFT_CODE_MASK,
8896 NULL, HFILL}
8898 {&hf_gtp_tft_spare,
8899 { "TFT spare bit", "gtp.tft_spare",
8900 FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_SPARE_MASK,
8901 NULL, HFILL}
8903 {&hf_gtp_tft_number,
8904 { "Number of packet filters", "gtp.tft_number",
8905 FT_UINT8, BASE_DEC, NULL, GTPv1_TFT_NUMBER_MASK,
8906 NULL, HFILL}
8908 {&hf_gtp_tft_eval,
8909 { "Evaluation precedence", "gtp.tft_eval",
8910 FT_UINT8, BASE_DEC, NULL, 0,
8911 NULL, HFILL}
8913 {&hf_gtp_tid,
8914 { "TID", "gtp.tid",
8915 FT_STRING, BASE_NONE, NULL, 0,
8916 "Tunnel Identifier", HFILL}
8918 {&hf_gtp_tlli,
8919 { "TLLI", "gtp.tlli",
8920 FT_UINT32, BASE_HEX, NULL, 0,
8921 "Temporary Logical Link Identity", HFILL}
8923 {&hf_gtp_tr_comm,
8924 { "Packet transfer command", "gtp.tr_comm",
8925 FT_UINT8, BASE_DEC, VALS(tr_comm_type), 0,
8926 NULL, HFILL}
8928 {&hf_gtp_trace_ref,
8929 { "Trace reference", "gtp.trace_ref",
8930 FT_UINT16, BASE_HEX, NULL, 0,
8931 NULL, HFILL}
8933 {&hf_gtp_trace_type,
8934 { "Trace type", "gtp.trace_type",
8935 FT_UINT16, BASE_HEX, NULL, 0,
8936 NULL, HFILL}
8938 {&hf_gtp_user_addr_pdp_org,
8939 { "PDP type organization", "gtp.user_addr_pdp_org",
8940 FT_UINT8, BASE_DEC, VALS(pdp_org_type), 0,
8941 NULL, HFILL}
8943 {&hf_gtp_user_addr_pdp_type,
8944 { "PDP type number", "gtp.user_addr_pdp_type",
8945 FT_UINT8, BASE_HEX, VALS(pdp_type), 0,
8946 NULL, HFILL}
8948 {&hf_gtp_user_ipv4,
8949 { "End user address IPv4", "gtp.user_ipv4",
8950 FT_IPv4, BASE_NONE, NULL, 0,
8951 NULL, HFILL}
8953 {&hf_gtp_user_ipv6,
8954 { "End user address IPv6", "gtp.user_ipv6",
8955 FT_IPv6, BASE_NONE, NULL, 0,
8956 NULL, HFILL}
8958 {&hf_gtp_security_mode,
8959 { "Security Mode", "gtp.security_mode",
8960 FT_UINT8, BASE_DEC, VALS(mm_sec_modep), 0xc0,
8961 NULL, HFILL}
8963 {&hf_gtp_no_of_vectors,
8964 { "No of Vectors", "gtp.no_of_vectors",
8965 FT_UINT8, BASE_DEC, NULL, 0x38,
8966 NULL, HFILL}
8968 {&hf_gtp_cipher_algorithm,
8969 { "Cipher Algorithm", "gtp.cipher_algorithm",
8970 FT_UINT8, BASE_DEC, VALS(gtp_cipher_algorithm), 0x07,
8971 NULL, HFILL}
8973 {&hf_gtp_cksn_ksi,
8974 { "Ciphering Key Sequence Number (CKSN)/Key Set Identifier (KSI)", "gtp.cksn_ksi",
8975 FT_UINT8, BASE_DEC, NULL, 0x07,
8976 "CKSN/KSI", HFILL}
8978 {&hf_gtp_cksn,
8979 { "Ciphering Key Sequence Number (CKSN)", "gtp.cksn",
8980 FT_UINT8, BASE_DEC, NULL, 0x07,
8981 "CKSN", HFILL}
8983 {&hf_gtp_ksi,
8984 { "Key Set Identifier (KSI)", "gtp.ksi",
8985 FT_UINT8, BASE_DEC, NULL, 0x07,
8986 "KSI", HFILL}
8988 {&hf_gtp_ext_length,
8989 { "Length", "gtp.ext_length",
8990 FT_UINT16, BASE_DEC, NULL, 0x0,
8991 "IE Length", HFILL}
8993 {&hf_gtp_utran_field,
8994 { "UTRAN Transparent Field", "gtp.utran_field",
8995 FT_BYTES, BASE_NONE, NULL, 0x0,
8996 NULL, HFILL}
8998 {&hf_gtp_ext_apn_res,
8999 { "Restriction Type", "gtp.ext_apn_res",
9000 FT_UINT8, BASE_DEC, NULL, 0x0,
9001 NULL, HFILL}
9003 {&hf_gtp_ext_rat_type,
9004 { "RAT Type", "gtp.ext_rat_type",
9005 FT_UINT8, BASE_DEC, VALS(gtp_ext_rat_type_vals), 0x0,
9006 NULL, HFILL}
9008 {&hf_gtp_ext_geo_loc_type,
9009 { "Geographic Location Type", "gtp.ext_geo_loc_type",
9010 FT_UINT8, BASE_DEC, NULL, 0x0,
9011 NULL, HFILL}
9013 {&hf_gtp_ext_sac,
9014 { "SAC", "gtp.ext_sac",
9015 FT_UINT16, BASE_HEX, NULL, 0x0,
9016 NULL, HFILL}
9018 {&hf_gtp_ext_imeisv,
9019 { "IMEI(SV)", "gtp.ext_imeisv",
9020 FT_STRING, BASE_NONE, NULL, 0x0,
9021 NULL, HFILL}
9023 { &hf_gtp_target_rnc_id,
9024 { "targetRNC-ID", "gtp.targetRNC_ID",
9025 FT_UINT16, BASE_HEX, NULL, 0x0fff,
9026 NULL, HFILL }
9028 { &hf_gtp_target_ext_rnc_id,
9029 { "Extended RNC-ID", "gtp.target_ext_RNC_ID",
9030 FT_UINT16, BASE_HEX, NULL, 0,
9031 NULL, HFILL }
9033 {&hf_gtp_bssgp_cause,
9034 { "BSSGP Cause", "gtp.bssgp_cause",
9035 FT_UINT8, BASE_DEC|BASE_EXT_STRING, &bssgp_cause_vals_ext, 0,
9036 NULL, HFILL}
9038 { &hf_gtp_bssgp_ra_discriminator,
9039 { "Routing Address Discriminator", "gtp.bssgp.rad",
9040 FT_UINT8, BASE_DEC, VALS(gtp_bssgp_ra_discriminator_vals), 0x0f,
9041 NULL, HFILL }
9043 {&hf_gtp_sapi,
9044 { "PS Handover XID SAPI", "gtp.ps_handover_xid_sapi",
9045 FT_UINT8, BASE_DEC, NULL, 0x0F,
9046 "SAPI", HFILL}
9048 {&hf_gtp_xid_par_len,
9049 { "PS Handover XID parameter length", "gtp.ps_handover_xid_par_len",
9050 FT_UINT8, BASE_DEC, NULL, 0xFF,
9051 "XID parameter length", HFILL}
9053 {&hf_gtp_earp_pvi,
9054 { "PVI Pre-emption Vulnerability", "gtp.EARP_pre_emption_par_vulnerability",
9055 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x01,
9056 NULL, HFILL}
9058 {&hf_gtp_earp_pl,
9059 { "PL Priority Level", "gtp.EARP_priority_level",
9060 FT_UINT8, BASE_DEC, NULL, 0x3C,
9061 NULL, HFILL}
9063 {&hf_gtp_earp_pci,
9064 { "PCI Pre-emption Capability", "gtp.EARP_pre_emption_Capability",
9065 FT_BOOLEAN, 8, TFS(&tfs_disabled_enabled), 0x40,
9066 NULL, HFILL}
9068 {&hf_gtp_cdr_app,
9069 { "Application Identifier", "gtp.cdr_app",
9070 FT_UINT8, BASE_DEC, NULL, 0xf0,
9071 NULL, HFILL}
9073 { &hf_gtp_cdr_rel,
9074 { "Release Identifier", "gtp.cdr_rel",
9075 FT_UINT8, BASE_DEC, NULL, 0x0f,
9076 NULL, HFILL}
9078 { &hf_gtp_cdr_ver,
9079 { "Version Identifier", "gtp.cdr_ver",
9080 FT_UINT8, BASE_DEC, NULL, 0x0,
9081 NULL, HFILL}
9083 {&hf_gtp_cmn_flg_ppc,
9084 { "Prohibit Payload Compression", "gtp.cmn_flg.ppc",
9085 FT_BOOLEAN, 8, NULL, 0x01,
9086 NULL, HFILL}
9088 {&hf_gtp_cmn_flg_mbs_srv_type,
9089 { "MBMS Service Type", "gtp.cmn_flg.mbs_srv_type",
9090 FT_BOOLEAN, 8, NULL, 0x02,
9091 NULL, HFILL}
9093 {&hf_gtp_cmn_flg_mbs_ran_pcd_rdy,
9094 { "RAN Procedures Ready", "gtp.cmn_flg.mbs_ran_pcd_rdy",
9095 FT_BOOLEAN, 8, NULL, 0x04,
9096 NULL, HFILL}
9098 {&hf_gtp_cmn_flg_mbs_cnt_inf,
9099 { "MBMS Counting Information", "gtp.cmn_flg.mbs_cnt_inf",
9100 FT_BOOLEAN, 8, NULL, 0x08,
9101 NULL, HFILL}
9103 {&hf_gtp_cmn_flg_no_qos_neg,
9104 { "No QoS negotiation", "gtp.cmn_flg.no_qos_neg",
9105 FT_BOOLEAN, 8, NULL, 0x10,
9106 NULL, HFILL}
9108 {&hf_gtp_cmn_flg_nrsn,
9109 { "NRSN bit field", "gtp.cmn_flg.nrsn",
9110 FT_BOOLEAN, 8, NULL, 0x20,
9111 NULL, HFILL}
9113 {&hf_gtp_cmn_flg_upgrd_qos_sup,
9114 { "Upgrade QoS Supported", "gtp.cmn_flg.upgrd_qos_sup",
9115 FT_BOOLEAN, 8, NULL, 0x40,
9116 NULL, HFILL}
9118 {&hf_gtp_cmn_flg_dual_addr_bearer_flg,
9119 { "Dual Address Bearer Flag", "gtp.cmn_flg.dual_addr_bearer_flg",
9120 FT_BOOLEAN, 8, NULL, 0x80,
9121 NULL, HFILL}
9123 {&hf_gtp_tmgi,
9124 { "Temporary Mobile Group Identity (TMGI)", "gtp.tmgi",
9125 FT_BYTES, BASE_NONE, NULL, 0x0,
9126 NULL, HFILL}
9128 {&hf_gtp_no_of_mbms_sa_codes,
9129 { "Number of MBMS service area codes", "gtp.no_of_mbms_sa_codes",
9130 FT_UINT8, BASE_DEC, NULL, 0x0,
9131 "Number N of MBMS service area codes", HFILL}
9134 {&hf_gtp_mbms_ses_dur_days,
9135 { "Estimated session duration days", "gtp.mbms_ses_dur_days",
9136 FT_UINT24, BASE_DEC, NULL, 0x00007F,
9137 NULL, HFILL}
9139 {&hf_gtp_mbms_ses_dur_s,
9140 { "Estimated session duration seconds", "gtp.mbms_ses_dur_s",
9141 FT_UINT24, BASE_DEC, NULL, 0xFFFF80,
9142 NULL, HFILL}
9144 {&hf_gtp_mbms_sa_code,
9145 { "MBMS service area code", "gtp.mbms_sa_code",
9146 FT_UINT16, BASE_DEC, NULL, 0x0,
9147 NULL, HFILL}
9149 {&hf_gtp_mbs_2g_3g_ind,
9150 { "MBMS 2G/3G Indicator", "gtp.mbs_2g_3g_ind",
9151 FT_UINT8, BASE_DEC, VALS(gtp_mbs_2g_3g_ind_vals), 0x0,
9152 NULL, HFILL}
9154 {&hf_gtp_time_2_dta_tr,
9155 { "Time to MBMS Data Transfer", "gtp.time_2_dta_tr",
9156 FT_UINT8, BASE_DEC, NULL, 0x0,
9157 NULL, HFILL}
9159 { &hf_gtp_ext_ei,
9160 { "Error Indication (EI)", "gtp.ei",
9161 FT_UINT8, BASE_DEC, NULL, 0x04,
9162 NULL, HFILL}
9164 {&hf_gtp_ext_gcsi,
9165 { "GPRS-CSI (GCSI)", "gtp.gcsi",
9166 FT_UINT8, BASE_DEC, NULL, 0x02,
9167 NULL, HFILL}
9169 { &hf_gtp_ext_dti,
9170 { "Direct Tunnel Indicator (DTI)", "gtp.dti",
9171 FT_UINT8, BASE_DEC, NULL, 0x01,
9172 NULL, HFILL}
9174 { &hf_gtp_ra_prio_lcs,
9175 { "Radio Priority LCS", "gtp.raplcs",
9176 FT_UINT8, BASE_DEC, NULL, 0x07,
9177 NULL, HFILL}
9179 { &hf_gtp_bcm,
9180 { "Bearer Control Mode", "gtp.bcm",
9181 FT_UINT8, BASE_DEC, VALS(gtp_pdp_bcm_type_vals), 0,
9182 NULL, HFILL}
9184 { &hf_gtp_fqdn,
9185 { "FQDN", "gtp.fqdn",
9186 FT_STRING, BASE_NONE, NULL, 0,
9187 "Fully Qualified Domain Name", HFILL}
9189 { &hf_gtp_rim_routing_addr,
9190 { "RIM Routing Address value", "gtp.rim_routing_addr_val",
9191 FT_BYTES, BASE_NONE, NULL, 0,
9192 NULL, HFILL}
9194 { &hf_gtp_mbms_flow_id,
9195 { "MBMS Flow Identifier", "gtp.mbms_flow_id",
9196 FT_BYTES, BASE_NONE, NULL, 0,
9197 NULL, HFILL}
9199 { &hf_gtp_mbms_dist_indic,
9200 { "Distribution Indication", "gtp.mbms_dist_indic",
9201 FT_UINT8, BASE_DEC, VALS(gtp_mbms_dist_indic_vals), 0x03,
9202 NULL, HFILL}
9204 { &hf_gtp_ext_apn_ambr_ul,
9205 { "APN-AMBR for Uplink", "gtp.apn_ambr_ul",
9206 FT_INT32, BASE_DEC, NULL, 0x0,
9207 NULL, HFILL}
9209 { &hf_gtp_ext_apn_ambr_dl,
9210 { "APN-AMBR for Downlink", "gtp.apn_ambr_dl",
9211 FT_INT32, BASE_DEC, NULL, 0x0,
9212 NULL, HFILL}
9214 { &hf_gtp_ext_sub_ue_ambr_ul,
9215 { "Subscribed UE-AMBR for Uplink", "gtp.sub_ue_ambr_ul",
9216 FT_INT32, BASE_DEC, NULL, 0x0,
9217 NULL, HFILL}
9219 { &hf_gtp_ext_sub_ue_ambr_dl,
9220 { "Subscribed UE-AMBR for Downlink", "gtp.sub_ue_ambr_dl",
9221 FT_INT32, BASE_DEC, NULL, 0x0,
9222 NULL, HFILL}
9224 { &hf_gtp_ext_auth_ue_ambr_ul,
9225 { "Authorized UE-AMBR for Uplink", "gtp.auth_ue_ambr_ul",
9226 FT_INT32, BASE_DEC, NULL, 0x0,
9227 NULL, HFILL}
9229 { &hf_gtp_ext_auth_ue_ambr_dl,
9230 { "Authorized UE-AMBR for Downlink", "gtp.auth_ue_ambr_dl",
9231 FT_INT32, BASE_DEC, NULL, 0x0,
9232 NULL, HFILL}
9234 { &hf_gtp_ext_auth_apn_ambr_ul,
9235 { "Authorized APN-AMBR for Uplink", "gtp.auth_apn_ambr_ul",
9236 FT_INT32, BASE_DEC, NULL, 0x0,
9237 NULL, HFILL}
9239 { &hf_gtp_ext_auth_apn_ambr_dl,
9240 { "Authorized APN-AMBR for Downlink", "gtp.auth_apn_ambr_dl",
9241 FT_INT32, BASE_DEC, NULL, 0x0,
9242 NULL, HFILL}
9244 { &hf_gtp_ext_ggsn_back_off_time_units,
9245 { "Timer unit", "gtp.ggsn_back_off_time_units",
9246 FT_UINT8, BASE_DEC, VALS(gtp_ggsn_back_off_time_units_vals), 0xe0,
9247 NULL, HFILL}
9249 { &hf_gtp_ext_ggsn_back_off_timer,
9250 { "Timer value", "gtp.ggsn_back_off_timer",
9251 FT_UINT8, BASE_DEC, NULL, 0x1f,
9252 NULL, HFILL}
9254 { &hf_gtp_higher_br_16mb_flg,
9255 { "Higher bitrates than 16 Mbps flag", "gtp.higher_br_16mb_flg",
9256 FT_UINT8, BASE_DEC, VALS(gtp_higher_br_16mb_flg_vals), 0x0,
9257 NULL, HFILL}
9259 { &hf_gtp_max_mbr_apn_ambr_ul,
9260 { "Max MBR/APN-AMBR for uplink", "gtp.max_mbr_apn_ambr_ul",
9261 FT_UINT32, BASE_DEC, NULL, 0x0,
9262 NULL, HFILL}
9264 { &hf_gtp_max_mbr_apn_ambr_dl,
9265 { "Max MBR/APN-AMBR for downlink", "gtp.max_mbr_apn_ambr_dl",
9266 FT_UINT32, BASE_DEC, NULL, 0x0,
9267 NULL, HFILL}
9271 static ei_register_info ei[] = {
9272 { &ei_gtp_ext_length_mal, { "gtp.ext_length.invalid", PI_MALFORMED, PI_ERROR, "Malformed length", EXPFILL }},
9273 { &ei_gtp_ext_hdr_pdcpsn, { "gtp.ext_hdr.pdcp_sn.non_zero", PI_PROTOCOL, PI_NOTE, "3GPP TS 29.281 v9.0.0: When used between two eNBs at the X2 interface in E-UTRAN, bits 5-8 of octet 2 are spare. The meaning of the spare bits shall be set to zero.", EXPFILL }},
9274 { &ei_gtp_ext_length_warn, { "gtp.ext_length.invalid", PI_PROTOCOL, PI_WARN, "Length warning", EXPFILL }},
9277 /* Setup protocol subtree array */
9278 #define GTP_NUM_INDIVIDUAL_ELEMS 28
9279 static gint *ett_gtp_array[GTP_NUM_INDIVIDUAL_ELEMS + NUM_GTP_IES];
9281 ett_gtp_array[0] = &ett_gtp;
9282 ett_gtp_array[1] = &ett_gtp_flags;
9283 ett_gtp_array[2] = &ett_gtp_ext;
9284 ett_gtp_array[3] = &ett_gtp_cdr_dr;
9285 ett_gtp_array[4] = &ett_gtp_qos;
9286 ett_gtp_array[5] = &ett_gtp_qos_arp;
9287 ett_gtp_array[6] = &ett_gtp_uli_rai;
9288 ett_gtp_array[7] = &ett_gtp_flow_ii;
9289 ett_gtp_array[8] = &ett_gtp_ext_hdr;
9290 ett_gtp_array[9] = &ett_gtp_rp;
9291 ett_gtp_array[10] = &ett_gtp_pkt_flow_id;
9292 ett_gtp_array[11] = &ett_gtp_data_resp;
9293 ett_gtp_array[12] = &ett_gtp_cdr_ver;
9294 ett_gtp_array[13] = &ett_gtp_tmgi;
9295 ett_gtp_array[14] = &ett_gtp_trip;
9296 ett_gtp_array[15] = &ett_gtp_quint;
9297 ett_gtp_array[16] = &ett_gtp_drx;
9298 ett_gtp_array[17] = &ett_gtp_net_cap;
9299 ett_gtp_array[18] = &ett_gtp_can_pack;
9300 ett_gtp_array[19] = &ett_gtp_proto;
9301 ett_gtp_array[20] = &ett_gtp_gsn_addr;
9302 ett_gtp_array[21] = &ett_gtp_tft;
9303 ett_gtp_array[22] = &ett_gtp_tft_pf;
9304 ett_gtp_array[23] = &ett_gtp_tft_flags;
9305 ett_gtp_array[24] = &ett_gtp_rab_setup;
9306 ett_gtp_array[25] = &ett_gtp_hdr_list;
9307 ett_gtp_array[26] = &ett_gtp_rel_pack;
9308 ett_gtp_array[27] = &ett_gtp_node_addr;
9310 last_offset = GTP_NUM_INDIVIDUAL_ELEMS;
9312 for (i=0; i < NUM_GTP_IES; i++, last_offset++)
9314 ett_gtp_ies[i] = -1;
9315 ett_gtp_array[last_offset] = &ett_gtp_ies[i];
9320 proto_gtp = proto_register_protocol("GPRS Tunneling Protocol", "GTP", "gtp");
9321 proto_register_field_array(proto_gtp, hf_gtp, array_length(hf_gtp));
9322 proto_register_subtree_array(ett_gtp_array, array_length(ett_gtp_array));
9323 expert_gtp = expert_register_protocol(proto_gtp);
9324 expert_register_field_array(expert_gtp, ei, array_length(ei));
9326 gtp_module = prefs_register_protocol(proto_gtp, proto_reg_handoff_gtp);
9328 prefs_register_uint_preference(gtp_module, "v0_port", "GTPv0 and GTP' port", "GTPv0 and GTP' port (default 3386)", 10, &g_gtpv0_port);
9329 prefs_register_uint_preference(gtp_module, "v1c_port", "GTPv1 or GTPv2 control plane (GTP-C, GTPv2-C) port", "GTPv1 and GTPv2 control plane port (default 2123)", 10,
9330 &g_gtpv1c_port);
9331 prefs_register_uint_preference(gtp_module, "v1u_port", "GTPv1 user plane (GTP-U) port", "GTPv1 user plane port (default 2152)", 10,
9332 &g_gtpv1u_port);
9333 prefs_register_enum_preference(gtp_module, "dissect_tpdu_as",
9334 "Dissect T-PDU as",
9335 "Dissect T-PDU as",
9336 &dissect_tpdu_as,
9337 gtp_decode_tpdu_as,
9338 FALSE);
9340 prefs_register_obsolete_preference(gtp_module, "v0_dissect_cdr_as");
9341 prefs_register_obsolete_preference(gtp_module, "v0_check_etsi");
9342 prefs_register_obsolete_preference(gtp_module, "v1_check_etsi");
9343 prefs_register_bool_preference(gtp_module, "check_etsi", "Compare GTP order with ETSI", "GTP ETSI order", &g_gtp_etsi_order);
9344 prefs_register_obsolete_preference(gtp_module, "ppp_reorder");
9345 prefs_register_obsolete_preference(gtp_module, "dissect_tpdu");
9347 /* This preference can be used to disable the dissection of GTP over TCP. Most of the Wireless operators uses GTP over UDP.
9348 * The preference is set to TRUE by default forbackward compatibility
9350 prefs_register_bool_preference(gtp_module, "dissect_gtp_over_tcp", "Dissect GTP over TCP", "Dissect GTP over TCP", &g_gtp_over_tcp);
9352 new_register_dissector("gtp", dissect_gtp, proto_gtp);
9353 new_register_dissector("gtpprim", dissect_gtpprim, proto_gtp);
9355 gtp_priv_ext_dissector_table = register_dissector_table("gtp.priv_ext", "GTP PRIVATE EXT", FT_UINT16, BASE_DEC);
9356 gtp_cdr_fmt_dissector_table = register_dissector_table("gtp.cdr_fmt", "GTP DATA RECORD TYPE", FT_UINT16, BASE_DEC);
9358 register_init_routine(gtp_reinit);
9359 gtp_tap = register_tap("gtp");
9360 gtpv1_tap = register_tap("gtpv1");
9362 /* TS 132 295 V9.0.0 (2010-02)
9363 * 5.1.3 Port usage
9364 * - The UDP Destination Port may be the server port number 3386 which has been reserved for GTP'.
9365 * Alternatively another port can be used, which has been configured by O&M, except Port Number 2123
9366 * which is used by GTPv2-C.
9368 * The TCP Destination Port may be the server port number 3386, which has been reserved for G-PDUs. Alternatively,
9369 * another port may be used as configured by O&M. Extra implementation-specific destination ports are possible but
9370 * all CGFs shall support the server port number.
9373 void
9374 proto_reg_handoff_gtp(void)
9376 static gboolean Initialized = FALSE;
9377 static dissector_handle_t gtp_handle, gtp_prim_handle;
9378 static gboolean gtp_over_tcp;
9379 static guint gtpv0_port;
9380 static guint gtpv1c_port;
9381 static guint gtpv1u_port;
9383 if (!Initialized) {
9384 gtp_handle = find_dissector("gtp");
9385 gtp_prim_handle = find_dissector("gtpprim");
9386 ppp_subdissector_table = find_dissector_table("ppp.protocol");
9388 radius_register_avp_dissector(VENDOR_THE3GPP, 5, dissect_radius_qos_umts);
9389 radius_register_avp_dissector(VENDOR_THE3GPP, 12, dissect_radius_selection_mode);
9390 radius_register_avp_dissector(VENDOR_THE3GPP, 22, dissect_radius_user_loc);
9394 ip_handle = find_dissector("ip");
9395 ipv6_handle = find_dissector("ipv6");
9396 ppp_handle = find_dissector("ppp");
9397 sync_handle = find_dissector("sync");
9398 gtpcdr_handle = find_dissector("gtpcdr");
9399 sndcpxid_handle = find_dissector("sndcpxid");
9400 gtpv2_handle = find_dissector("gtpv2");
9401 bssgp_handle = find_dissector("bssgp");
9402 bssap_pdu_type_table = find_dissector_table("bssap.pdu_type");
9403 /* AVP Code: 5 3GPP-GPRS Negotiated QoS profile */
9404 dissector_add_uint("diameter.3gpp", 5, new_create_dissector_handle(dissect_diameter_3gpp_qosprofile, proto_gtp));
9405 /* AVP Code: 903 MBMS-Service-Area */
9406 dissector_add_uint("diameter.3gpp", 903, new_create_dissector_handle(dissect_gtp_3gpp_mbms_service_area, proto_gtp));
9407 /* AVP Code: 904 MBMS-Session-Duration */
9408 dissector_add_uint("diameter.3gpp", 904, new_create_dissector_handle(dissect_gtp_mbms_ses_dur, proto_gtp));
9409 /* AVP Code: 911 MBMS-Time-To-Data-Transfer */
9410 dissector_add_uint("diameter.3gpp", 911, new_create_dissector_handle(dissect_gtp_mbms_time_to_data_tr, proto_gtp));
9412 Initialized = TRUE;
9413 } else {
9414 dissector_delete_uint("udp.port", gtpv0_port, gtp_prim_handle);
9415 dissector_delete_uint("udp.port", gtpv1c_port, gtp_handle);
9416 dissector_delete_uint("udp.port", gtpv1u_port, gtp_handle);
9418 if (gtp_over_tcp) {
9419 dissector_delete_uint("tcp.port", gtpv0_port, gtp_prim_handle);
9420 dissector_delete_uint("tcp.port", gtpv1c_port, gtp_handle);
9421 dissector_delete_uint("tcp.port", gtpv1u_port, gtp_handle);
9425 gtp_over_tcp = g_gtp_over_tcp;
9426 gtpv0_port = g_gtpv0_port;
9427 gtpv1c_port = g_gtpv1c_port;
9428 gtpv1u_port = g_gtpv1u_port;
9430 dissector_add_uint("udp.port", g_gtpv0_port, gtp_prim_handle);
9431 dissector_add_uint("udp.port", g_gtpv1c_port, gtp_handle);
9432 dissector_add_uint("udp.port", g_gtpv1u_port, gtp_handle);
9434 if (g_gtp_over_tcp) {
9435 dissector_add_uint("tcp.port", g_gtpv0_port, gtp_prim_handle);
9436 dissector_add_uint("tcp.port", g_gtpv1c_port, gtp_handle);
9437 dissector_add_uint("tcp.port", g_gtpv1u_port, gtp_handle);
9442 * Editor modelines - http://www.wireshark.org/tools/modelines.html
9444 * Local variables:
9445 * c-basic-offset: 4
9446 * tab-width: 8
9447 * indent-tabs-mode: nil
9448 * End:
9450 * vi: set shiftwidth=4 tabstop=8 expandtab:
9451 * :indentSize=4:tabSize=8:noTabs=true: