3 * Routines for GTPv2 dissection
4 * Copyright 2009, Anders Broman <anders.broman [at] ericcsson.com>
8 * Wireshark - Network traffic analyzer
9 * By Gerald Combs <gerald@wireshark.org>
10 * Copyright 1998 Gerald Combs
12 * This program is free software; you can redistribute it and/or
13 * modify it under the terms of the GNU General Public License
14 * as published by the Free Software Foundation; either version 2
15 * of the License, or (at your option) any later version.
17 * This program is distributed in the hope that it will be useful,
18 * but WITHOUT ANY WARRANTY; without even the implied warranty of
19 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20 * GNU General Public License for more details.
22 * You should have received a copy of the GNU General Public License
23 * along with this program; if not, write to the Free Software
24 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
25 * Ref: 3GPP TS 29.274 version 8.1.1 Release 8 ETSI TS 129 274 V8.1.1 (2009-04)
38 #include <epan/packet.h>
39 #include <epan/asn1.h>
41 #include "packet-gsm_a_common.h"
42 #include "packet-gsm_map.h"
43 #include "packet-e212.h"
45 /*GTPv2 Message->GTP Header(SB)*/
46 static int proto_gtpv2 = -1;
47 static int hf_gtpv2_flags = -1;
48 static int hf_gtpv2_version = -1;
49 static int hf_gtpv2_t = -1;
50 static int hf_gtpv2_message_type = -1;
51 static int hf_gtpv2_msg_length = -1;
52 static int hf_gtpv2_teid = -1;
53 static int hf_gtpv2_seq = -1;
54 static int hf_gtpv2_spare = -1;
57 static int hf_gtpv2_ie = -1;
58 static int hf_gtpv2_ie_len = -1;
59 static int hf_gtpv2_cr = -1;
60 static int hf_gtpv2_instance = -1;
61 static int hf_gtpv2_cause = -1;
62 static int hf_gtpv2_cause_cs= -1;
63 static int hf_gtpv2_rec = -1;
64 static int hf_gtpv2_apn = -1;
65 static int hf_gtpv2_ebi = -1;
66 static int hf_gtpv2_daf = -1;
67 static int hf_gtpv2_dtf = -1;
68 static int hf_gtpv2_hi = -1;
69 static int hf_gtpv2_dfi = -1;
70 static int hf_gtpv2_oi = -1;
71 static int hf_gtpv2_isrsi = -1;
72 static int hf_gtpv2_israi = -1;
73 static int hf_gtpv2_sgwci = -1;
74 static int hf_gtpv2_pt = -1;
75 static int hf_gtpv2_tdi = -1;
76 static int hf_gtpv2_si = -1;
77 static int hf_gtpv2_msv = -1;
78 static int hf_gtpv2_pdn_type = -1;
79 static int hf_gtpv2_pdn_ipv4 = -1;
80 static int hf_gtpv2_pdn_ipv6_len = -1;
81 static int hf_gtpv2_pdn_ipv6 = -1;
84 static int hf_gtpv2_rat_type = -1;
85 static int hf_gtpv2_uli_ecgi_flg = -1;
86 static int hf_gtpv2_uli_tai_flg = -1;
87 static int hf_gtpv2_uli_rai_flg = -1;
88 static int hf_gtpv2_uli_sai_flg = -1;
89 static int hf_gtpv2_uli_cgi_flg = -1;
90 static int hf_gtpv2_cng_rep_act = -1;
92 static gint ett_gtpv2 = -1;
93 static gint ett_gtpv2_flags = -1;
94 static gint ett_gtpv2_ie = -1;
97 static int hf_gtpv2_selec_mode= -1;
99 static int hf_gtpv2_f_teid_v4= -1;
100 static int hf_gtpv2_f_teid_v6= -1;
101 static int hf_gtpv2_f_teid_interface_type= -1;
102 static int hf_gtpv2_f_teid_gre_key= -1;
103 static int hf_gtpv2_f_teid_ipv4= -1;
104 static int hf_gtpv2_f_teid_ipv6= -1;
105 static int hf_gtpv2_imsi= -1;
107 static int hf_gtpv2_ambr_up= -1;
108 static int hf_gtpv2_ambr_down= -1;
109 static int hf_gtpv2_ip_address_ipv4= -1;
110 static int hf_gtpv2_ip_address_ipv6= -1;
111 static int hf_gtpv2_mei= -1;
113 static int hf_gtpv2_bearer_qos_pvi= -1;
114 static int hf_gtpv2_bearer_qos_pl= -1;
115 static int hf_gtpv2_bearer_qos_pci= -1;
116 static int hf_gtpv2_bearer_qos_label_qci= -1;
117 static int hf_gtpv2_bearer_qos_mbr_up= -1;
118 static int hf_gtpv2_bearer_qos_mbr_down= -1;
119 static int hf_gtpv2_bearer_qos_gbr_up= -1;
120 static int hf_gtpv2_bearer_qos_gbr_down= -1;
121 static int hf_gtpv2_flow_qos_label_qci= -1;
122 static int hf_gtpv2_flow_qos_mbr_up= -1;
123 static int hf_gtpv2_flow_qos_mbr_down= -1;
124 static int hf_gtpv2_flow_qos_gbr_up= -1;
125 static int hf_gtpv2_flow_qos_gbr_down= -1;
127 static int hf_gtpv2_delay_value= -1;
128 static int hf_gtpv2_charging_id= -1;
129 static int hf_gtpv2_charging_characteristic= -1;
130 static int hf_gtpv2_bearer_flag= -1;
131 static int hf_gtpv2_ue_time_zone= -1;
132 static int hf_gtpv2_ue_time_zone_dst= -1;
134 static int hf_gtpv2_node_type= -1;
136 static int hf_gtpv2_b_tft_opcode= -1;
137 static int hf_gtpv2_b_tft_ebit= -1;
138 static int hf_gtpv2_b_tft_number= -1;
139 static int hf_gtpv2_b_tft_pf_id= -1;
140 static int hf_gtpv2_b_tft_pf_direction= -1;
141 static int hf_gtpv2_b_tft_pf_eval= -1;
142 static int hf_gtpv2_b_tft_pf_length= -1;
143 static int hf_gtpv2_b_tft_pf_comp_type= -1;
144 static int hf_gtpv2_b_tft_pf_ipv4= -1;
145 static int hf_gtpv2_b_tft_pf_ipv4_mask= -1;
146 static int hf_gtpv2_b_tft_pf_ipv6= -1;
147 static int hf_gtpv2_b_tft_pf_ipv6_mask= -1;
148 static int hf_gtpv2_b_tft_pf_prot_id= -1;
149 static int hf_gtpv2_b_tft_pf_single_local= -1;
150 static int hf_gtpv2_b_tft_pf_local_port_low= -1;
151 static int hf_gtpv2_b_tft_pf_local_port_high= -1;
152 static int hf_gtpv2_b_tft_pf_single_remote= -1;
153 static int hf_gtpv2_b_tft_pf_remote_port_low= -1;
154 static int hf_gtpv2_b_tft_pf_remote_port_high= -1;
155 static int hf_gtpv2_b_tft_pf_security= -1;
156 static int hf_gtpv2_b_tft_pf_service_type= -1;
157 static int hf_gtpv2_b_tft_pf_service_type_mask= -1;
158 static int hf_gtpv2_b_tft_pf_flow_label= -1;
159 static int hf_gtpv2_apn_rest= -1;
160 static int hf_gtpv2_pti= -1;
161 static int hf_gtpv2_uli_cgi_lac= -1;
162 static int hf_gtpv2_uli_cgi_ci= -1;
163 static int hf_gtpv2_uli_sai_lac= -1;
164 static int hf_gtpv2_uli_sai_sac= -1;
165 static int hf_gtpv2_uli_rai_lac= -1;
166 static int hf_gtpv2_uli_rai_rac= -1;
167 static int hf_gtpv2_uli_tai_tac= -1;
168 static int hf_gtpv2_uli_ecgi_eci= -1;
169 static int hf_gtpv2_bearer_control_mode= -1;
171 /*Message Types for GTPv2 (Refer Pg19 29.274) (SB)*/
172 static const value_string gtpv2_message_type_vals[] = {
175 {2, "Echo Response"},
176 {3, "Version Not Supported Indication"},
177 /* 4-24 Reserved for S101 interface TS 29.276 */
178 /* 25-31 Reserved for Sv interface TS 29.280 */
179 /* SGSN/MME to PGW (S4/S11, S5/S8) */
180 {32, "Create Session Request"},
181 {33, "Create Session Response"},
182 {34, "Modify Bearer Request"},
183 {35, "Modify Bearer Response"},
184 {36, "Delete Session Request"},
185 {37, "Delete Session Response"},
186 /* SGSN to PGW (S4, S5/S8) */
187 {38, "Change Notification Request"},
188 {39, "Change Notification Response"},
189 /* 40-63 For future use */
190 /* Messages without explicit response */
191 {64, "Modify Bearer Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
192 {65, "Modify Bearer Failure Indication"}, /*(PGW to MME/SGSN -S5/S8, S11/S4) */
193 {66, "Delete Bearer Command"}, /* (MME to PGW -S11, S5/S8) */
194 {67, "Delete Bearer Failure Indication"}, /* (PGW to MME -S5/S8, S11) */
195 {68, "Bearer Resource Command"}, /* (MME/SGSN to PGW -S11/S4, S5/S8) */
196 {69, "Bearer Resource Failure Indication"}, /* (PGW to MME/SGSN -S5/S8, S11/S4) */
197 {70, "Downlink Data Notification Failure Indication"}, /*(SGSN/MME to SGW -S4/S11) */
198 {71, "Trace Session Activation"},
199 {72, "Trace Session Deactivation"},
200 {73, "Stop Paging Indication"},
201 /* 74-94 For future use */
202 /* PDN-GW to SGSN/MME (S5/S8, S4/S11) */
203 {95, "Create Bearer Request"},
204 {96, "Create Bearer Response"},
205 {97, "Update Bearer Request"},
206 {98, "Update Bearer Response"},
207 {99, "Delete Bearer Request"},
208 {100, "Delete Bearer Response"},
209 /* PGW to MME, MME to PGW, SGW to PGW, SGW to MME (S5/S8, S11) */
210 {101, "Delete PDN Connection Set Request"},
211 {102, "Delete PDN Connection Set Response"},
212 /* 103-127 For future use */
213 /* MME to MME, SGSN to MME, MME to SGSN, SGSN to SGSN (S3/10/S16) */
214 {128, "Identification Request"},
215 {129, "Identification Response"},
216 {130, "Context Request"},
217 {131, "Context Response"},
218 {132, "Context Acknowledge"},
219 {133, "Forward Relocation Request"},
220 {134, "Forward Relocation Response"},
221 {135, "Forward Relocation Complete Notification"},
222 {136, "Forward Relocation Complete Acknowledge"},
223 {137, "Forward Access Context Notification"},
224 {138, "Forward Access Context Acknowledge"},
225 {139, "Relocation Cancel Request"},
226 {140, "Relocation Cancel Response"},
227 {141, "Configuration Transfer Tunnel"},
228 /* 142-148 For future use */
229 /* SGSN to MME, MME to SGSN (S3)*/
230 {149, "Detach Notification"},
231 {150, "Detach Acknowledge"},
232 {151, "CS Paging Indication"},
233 {152, "RAN Information Relay"},
234 /* 153-159 For future use */
235 /* MME to SGW (S11) */
236 {160, "Create Forwarding Tunnel Request"},
237 {161, "Create Forwarding Tunnel Response"},
238 {162, "Suspend Notification"},
239 {163, "Suspend Acknowledge"},
240 {164, "Resume Notification"},
241 {165, "Resume Acknowledge"},
242 {166, "Create Indirect Data Forwarding Tunnel Request"},
243 {167, "Create Indirect Data Forwarding Tunnel Response"},
244 {168, "Delete Indirect Data Forwarding Tunnel Request"},
245 {169, "Delete Indirect Data Forwarding Tunnel Response"},
246 {170, "Release Access Bearers Request"},
247 {171, "Release Access Bearers Response"},
248 /* 172-175 For future use */
249 /* SGW to SGSN/MME (S4/S11) */
250 {176, "Downlink Data Notification "},
251 {177, "Downlink Data Notification Acknowledgement"},
252 /* SGW to SGSN (S4) */
253 {178, "Update Bearer Complete "},
254 /* 179-191 For future use */
256 /* 192-244 For future use */
257 /* 245-255 Reserved for GTP-U TS 29.281 [13] */
261 #define GTPV2_IE_RESERVED 0
262 #define GTPV2_IE_IMSI 1
263 #define GTPV2_IE_CAUSE 2
264 #define GTPV2_REC_REST_CNT 3
266 #define GTPV2_AMBR 72
268 #define GTPV2_IP_ADDRESS 74
270 #define GTPV2_IE_MSISDN 76
271 #define GTPV2_INDICATION 77
274 #define GTPV2_BEARER_QOS 80
275 #define GTPV2_FLOW_QOS 81
276 #define GTPV2_IE_RAT_TYPE 82
277 #define GTPV2_IE_SERV_NET 83
278 #define GTPV2_BEARER_TFT 84
281 #define GTPV2_F_TEID 87
282 #define GTPV2_G_CN_ID 89
283 #define GTPV2_DELAY_VALUE 92
284 #define GTPV2_BEARER_CTX 93
285 #define GTPV2_CHARGING_ID 94
286 #define GTPV2_CHARGING_CHARACTERISTIC 95
287 #define GTPV2_BEARER_FLAG 97
288 #define GTPV2_PDN_TYPE 99
289 #define GTPV2_PTI 100
290 #define GTPV2_UE_TIME_ZONE 114
291 #define GTPV2_APN_RESTRICTION 127
292 #define GTPV2_SELEC_MODE 128
293 #define GTPV2_BEARER_CONTROL_MODE 130
294 #define GTPV2_CNG_REP_ACT 131
295 #define GTPV2_NODE_TYPE 135
298 #define CREATE_NEW_TFT 0X20
299 #define DELETE_TFT 0X40
300 #define ADD_PACKET_FILTERS_TFT 0X60
301 #define REPLACE_PACKET_FILTERS_TFT 0X80
302 #define DELETE_PACKET_FILTERS_TFT 0XA0
303 #define NO_TFT_OPERATION 0XC0
304 #define RESERVED 0XE0
307 /* Table 8.1-1: Information Element types for GTPv2 */
308 static const value_string gtpv2_element_type_vals[] = {
310 {1, "International Mobile Subscriber Identity (IMSI)"}, /* Variable Length / 8.3 */
311 {2, "Cause"}, /* Variable Length / 8.4 */
312 {3, "Recovery (Restart Counter)"}, /* Variable Length / 8.5 */
313 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
314 /* 51-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
315 {71, "Access Point Name (APN)"}, /* Variable Length / 8.6 */
316 {72, "Aggregate Maximum Bit Rate (AMBR)"}, /* Fixed Length / 8.7 */
317 {73, "EPS Bearer ID (EBI)"}, /* Extendable / 8.8 */
318 {74, "IP Address"}, /* Extendable / 8.9 */
319 {75, "Mobile Equipment Identity (MEI)"}, /* Variable Length / 8.10 */
320 {76, "MSISDN"}, /* Variable Length / 8.11 */
321 {77, "Indication"}, /* Extendable / 8.12 */
322 {78, "Protocol Configuration Options (PCO)"}, /* Variable Length / 8.13 */
323 {79, "PDN Address Allocation (PAA)"}, /* Variable Length / 8.14 */
324 {80, "Bearer Level Quality of Service (Bearer QoS)"}, /* Variable Length / 8.15 */
325 {81, "Flow Quality of Service (Flow QoS)"}, /* Extendable / 8.16 */
326 {82, "RAT Type"}, /* Extendable / 8.17 */
327 {83, "Serving Network"}, /* Extendable / 8.18 */
328 {84, "EPS Bearer Level Traffic Flow Template (Bearer TFT)"}, /* Variable Length / 8.19 */
329 {85, "Traffic Aggregation Description (TAD)"}, /* Variable Length / 8.20 */
330 {86, "User Location Info (ULI)"}, /* Variable Length / 8.21 */
331 {87, "Fully Qualified Tunnel Endpoint Identifier (F-TEID)"}, /* Extendable / 8.22 */
332 {88, "TMSI"}, /* Variable Length / 8.23 */
333 {89, "Global CN-Id"}, /* Variable Length / 8.24 */
334 {90, "S103 PDN Data Forwarding Info (S103PDF)"}, /* Variable Length / 8.25 */
335 {91, "S1-U Data Forwarding Info (S1UDF)"}, /* Variable Length/ 8.26 */
336 {92, "Delay Value"}, /* Extendable / 8.27 */
337 {93, "Bearer Context"}, /* Extendable / 8.28 */
338 {94, "Charging ID"}, /* Extendable / 8.29 */
339 {95, "Charging Characteristics"}, /* Extendable / 8.30 */
340 {96, "Trace Information"}, /* Extendable / 8.31 */
341 {97, "Bearer Flags"}, /* Extendable / 8.32 */
342 {98, "Paging Cause"}, /* Variable Length / 8.33 */
343 {99, "PDN Type"}, /* Extendable / 8.34 */
344 {100, "Procedure Transaction ID"}, /* Extendable / 8.35 */
345 {101, "DRX Parameter"}, /* Variable Length/ 8.36 */
346 {102, "UE Network Capability"}, /* Variable Length / 8.37 */
347 {103, "MM Context (GSM Key and Triplets)"}, /* Variable Length / 8.38 */
348 {104, "MM Context (UMTS Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
349 {105, "MM Context (GSM Key, Used Cipher and Quintuplets)"}, /* Variable Length / 8.38 */
350 {106, "MM Context (UMTS Key and Quintuplets)"}, /* Variable Length / 8.38 */
351 {107, "MM Context (EPS Security Context, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
352 {108, "MM Context (UMTS Key, Quadruplets and Quintuplets)"}, /* Variable Length / 8.38 */
353 {109, "PDN Connection"}, /* Extendable / 8.39 */
354 {110, "PDU Numbers"}, /* Extendable / 8.40 */
355 {111, "P-TMSI"}, /* Variable Length / 8.41 */
356 {112, "P-TMSI Signature"}, /* Variable Length / 8.42 */
357 {113, "Hop Counter"}, /* Extendable / 8.43 */
358 {114, "UE Time Zone"}, /* Variable Length / 8.44 */
359 {115, "Trace Reference"}, /* Fixed Length / 8.45 */
360 {116, "Complete Request Message"}, /* Variable Length / 8.46 */
361 {117, "GUTI"}, /* Variable Length / 8.47 */
362 {118, "F-Container"}, /* Variable Length / 8.48 */
363 {119, "F-Cause"}, /* Variable Length / 8.49 */
364 {120, "Selected PLMN ID"}, /* Variable Length / 8.50 */
365 {121, "Target Identification"}, /* Variable Length / 8.51 */
366 {122, "NSAPI"}, /* Extendable / 8.52 */
367 {123, "Packet Flow ID"}, /* Variable Length / 8.53 */
368 {124, "RAB Context"}, /* Fixed Length / 8.54 */
369 {125, "Source RNC PDCP Context Info"}, /* Variable Length / 8.55 */
370 {126, "UDP Source Port Number"}, /* Extendable / 8.56 */
371 {127, "APN Restriction"}, /* Extendable / 8.57 */
372 {128, "Selection Mode"}, /* Extendable / 8.58 */
373 {129, "Source Identification"}, /* Variable Length / 8.50 */
374 {130, "Bearer Control Mode"}, /* Extendable / 8.60 */
375 {131, "Change Reporting Action"}, /* Variable Length / 8.61 */
376 {132, "Fully Qualified PDN Connection Set Identifier (FQ-CSID)"}, /* Variable Length / 8.62 */
377 {133, "Channel needed"}, /* Extendable / 8.63 */
378 {134, "eMLPP Priority"}, /* Extendable / 8.64 */
379 {135, "Node Type"}, /* Extendable / 8.65 */
380 {136, "Fully Qualified Domain Name (FQDN)"}, /* Variable Length / 8.66 */
381 {137, "Transaction Identifier (TI)"}, /* Variable Length / 8.68 */
382 /* 138-254 "Spare."}, */ /* For future use. FFS */
383 {255, "Private"}, /* Extension Extendable / 8.71 */
387 /* Code to dissect IE's */
390 dissect_gtpv2_unknown(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
393 proto_tree_add_text(tree, tvb, 0, length, "IE data not dissected yet");
397 * 8.3 International Mobile Subscriber Identity (IMSI)
399 * IMSI is defined in 3GPP TS 23.003
400 * Editor's note: IMSI coding will be defined in 3GPP TS 24.301
401 * Editor's note: In the first release of GTPv2 spec (TS 29.274v8.0.0) n = 8.
402 * That is, the overall length of the IE is 11 octets.
406 static gchar *imsi_to_str(const guint8 * ad)
408 static gchar str[17] = " ";
411 for (i = 0; i < 8; i++)
413 if (((ad[i] >> 4) & 0x0F) <= 9)
414 str[j++] = ((ad[i] >> 4) & 0x0F) + 0x30;
415 if ((ad[i] & 0x0F) <= 9)
416 str[j++] = (ad[i] & 0x0F) + 0x30; /* Adding 0x30(48 decimal) makes it a printable digit (Eg. Ascii value 0f 9 is 57 (9+48))*/
425 dissect_gtpv2_imsi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
431 tvb_memcpy(tvb, imsi_val, offset , 8);
432 imsi_str = imsi_to_str(imsi_val);
434 proto_tree_add_string(tree, hf_gtpv2_imsi, tvb, offset, length, imsi_str);
437 /* Table 8.4-1: Cause values */
438 static const value_string gtpv2_cause_vals[] = {
443 {3, "Complete Detach"},
444 {4, "RAT changed from 3GPP to Non-3GPP"},
445 {5, "ISR is activated"},
446 /* 6-15 Spare. This value range is reserved for Cause values in a request message */
447 /* Acceptance Response */
448 {16, "Request accepted"},
449 {17, "Request accepted partially"},
450 {18, "New PDN type due to network preference"},
451 {19, "New PDN type due to single address bearer only"},
452 /* 20-63 Spare. This value range is reserved for Cause values in acceptance response message */
453 /* Rejection Response */
454 {64, "Context Not Found"},
455 {65, "Invalid Message Format"},
456 {66, "Version not supported by next peer"},
457 {67, "Invalid length"},
458 {68, "Service not supported"},
459 {69, "Mandatory IE incorrect"},
460 {70, "Mandatory IE missing"},
461 {71, "Optional IE incorrect"},
462 {72, "System failure"},
463 {73, "No resources available"},
464 {74, "Semantic error in the TFT operation"},
465 {75, "Syntactic error in the TFT operation"},
466 {76, "Semantic errors in packet filter(s)"},
467 {77, "Syntactic errors in packet filter(s)"},
468 {78, "Missing or unknown APN"},
469 {79, "Unexpected repeated IE"},
470 {80, "GRE key not found"},
471 {81, "Reallocation failure"},
472 {82, "Denied in RAT"},
473 {83, "Preferred PDN type not supported"},
474 {84, "All dynamic addresses are occupied"},
475 {85, "UE context without TFT already activated"},
476 {86, "Protocol type not supported"},
477 {87, "UE not responding"},
479 {89, "Service denied"},
480 {90, "Unable to page UE"},
481 {91, "No memory available"},
482 {92, "User authentication failed"},
483 {93, "APN access denied - no subscription"},
484 {94, "Request rejected"},
485 {95, "P-TMSI Signature mismatch"},
486 {96, "IMSI not known"},
487 {97, "Semantic error in the TAD operation"},
488 {98, "Syntactic error in the TAD operation"},
489 {99, "Reserved Message Value Received"},
490 {100, "PGW not responding"},
491 {101, "Collision with network initiated request"},
492 {102, "Unable to page UE due to Suspension"},
493 {103, "Conditional IE missing"},
494 {104, "APN Restriction type Incompatible with currently active PDN connection"},
495 /* 105-219 Spare. This value range is reserved for Cause values in rejection response message */
496 /* 220-255 Reserved for 3GPP Specific PMIPv6 Error Codes as defined in 3GPP TS 29.275 [26] */
505 dissect_gtpv2_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
508 /* Cause value octet 5 */
509 proto_tree_add_item(tree, hf_gtpv2_cause, tvb, offset, 1, FALSE);
511 proto_tree_add_item(tree, hf_gtpv2_cause_cs, tvb, offset, 1, FALSE);
515 * 8.5 Recovery (Restart Counter)
518 dissect_gtpv2_recovery(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
521 proto_tree_add_item(tree, hf_gtpv2_rec, tvb, offset, 1, FALSE);
525 * 8.6 Access Point Name (APN)
528 dissect_gtpv2_apn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
535 name_len = tvb_get_guint8(tvb, offset);
537 if (name_len < 0x20) {
538 apn = tvb_get_ephemeral_string(tvb, offset + 1, length - 1);
540 if (name_len >= length - 1)
543 name_len = name_len + apn[tmp] + 1;
547 apn = tvb_get_ephemeral_string(tvb, offset, length);
549 proto_tree_add_string(tree, hf_gtpv2_apn, tvb, offset, length, apn);
555 * 8.7 Aggregate Maximum Bit Rate (AMBR) */
558 dissect_gtpv2_ambr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
561 proto_tree_add_item(tree, hf_gtpv2_ambr_up, tvb, offset, 4, FALSE);
563 proto_tree_add_item(tree, hf_gtpv2_ambr_down, tvb, offset, 4, FALSE);
567 * 8.8 EPS Bearer ID (EBI)
570 dissect_gtpv2_ebi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
574 /* Spare (all bits set to 0) B8 - B5*/
575 /* EPS Bearer ID (EBI) B4 - B1 */
576 proto_tree_add_item(tree, hf_gtpv2_ebi, tvb, offset, 1, FALSE);
581 dissect_gtpv2_ip_address(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
586 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv4, tvb, offset, length, FALSE);
590 proto_tree_add_item(tree, hf_gtpv2_ip_address_ipv6, tvb, offset, length, FALSE);
593 /* 8.10 Mobile Equipment Identity (MEI)*/
594 static gchar *mei_to_str(const guint8 * ad)
596 static gchar str[17] = " ";
598 for (i = 0; i < 8; i++)
600 if (((ad[i] >> 4) & 0x0F) <= 9)
601 str[j++] = ((ad[i] >> 4) & 0x0F) + 0x30;
602 if ((ad[i] & 0x0F) <= 9)
603 str[j++] = (ad[i] & 0x0F) + 0x30; /* Adding 0x30(48 decimal) makes it a printable digit (Eg. Ascii value 0f 9 is 57 (9+48))*/
610 dissect_gtpv2_mei(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
615 tvb_memcpy(tvb, mei_val, offset , 8);
616 mei_str = mei_to_str(mei_val);
617 proto_tree_add_string(tree, hf_gtpv2_mei, tvb, offset, length, mei_str);
623 * MSISDN is defined in 3GPP TS 23.003
624 * Editor's note: MSISDN coding will be defined in TS 24.301.
627 dissect_gtpv2_msisdn(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
629 dissect_gsm_map_msisdn(tvb, pinfo, tree);
636 dissect_gtpv2_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
639 proto_tree_add_item(tree, hf_gtpv2_daf, tvb, offset, 1, FALSE);
640 proto_tree_add_item(tree, hf_gtpv2_dtf, tvb, offset, 1, FALSE);
641 proto_tree_add_item(tree, hf_gtpv2_hi, tvb, offset, 1, FALSE);
642 proto_tree_add_item(tree, hf_gtpv2_dfi, tvb, offset, 1, FALSE);
643 proto_tree_add_item(tree, hf_gtpv2_oi, tvb, offset, 1, FALSE);
644 proto_tree_add_item(tree, hf_gtpv2_isrsi, tvb, offset, 1, FALSE);
645 proto_tree_add_item(tree, hf_gtpv2_israi, tvb, offset, 1, FALSE);
646 proto_tree_add_item(tree, hf_gtpv2_sgwci, tvb, offset, 1, FALSE);
649 proto_tree_add_text(tree, tvb, 0, length, "Older version?, should be 2 octets in 8.0.0");
653 proto_tree_add_item(tree, hf_gtpv2_pt, tvb, offset, 1, FALSE);
654 proto_tree_add_item(tree, hf_gtpv2_tdi, tvb, offset, 1, FALSE);
655 proto_tree_add_item(tree, hf_gtpv2_si, tvb, offset, 1, FALSE);
656 proto_tree_add_item(tree, hf_gtpv2_msv, tvb, offset, 1, FALSE);
660 * 8.13 Protocol Configuration Options (PCO)
661 * Editor's note: PCO will be defined in 3GPP TS 23.003 and its coding in TS 24.301
662 * Dissected in packey-gsm_a_gm.c
665 dissect_gtpv2_pco(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
667 de_sm_pco(tvb, tree, 0, length, NULL, 0);
671 * 8.14 PDN Address Allocation (PAA)
674 static const value_string gtpv2_pdn_type_vals[] = {
682 dissect_gtpv2_paa(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
686 pdn_type = tvb_get_guint8(tvb, offset);
687 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, 1, FALSE);
693 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, FALSE);
698 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, FALSE);
700 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, FALSE);
705 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6_len, tvb, offset, 1, FALSE);
707 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv6, tvb, offset, 16, FALSE);
709 proto_tree_add_item(tree, hf_gtpv2_pdn_ipv4, tvb, offset, 4, FALSE);
717 * 8.15 Bearer Quality of Service (Bearer QoS)
721 dissect_gtpv2_bearer_qos(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
724 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pvi, tvb, offset, 1, FALSE);
725 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pl, tvb, offset, 1, FALSE);
726 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_pci, tvb, offset, 1, FALSE);
728 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_label_qci, tvb, offset, 1, FALSE);
730 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_up, tvb, offset, 5, FALSE);
732 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_mbr_down, tvb, offset, 5, FALSE);
734 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_up, tvb, offset, 5, FALSE);
736 proto_tree_add_item(tree, hf_gtpv2_bearer_qos_gbr_down, tvb, offset, 5, FALSE);
741 * 8.16 Flow Quality of Service (Flow QoS)
745 dissect_gtpv2_flow_qos(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
748 proto_tree_add_item(tree, hf_gtpv2_flow_qos_label_qci, tvb, offset, 1, FALSE);
750 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_up, tvb, offset, 5, FALSE);
752 proto_tree_add_item(tree, hf_gtpv2_flow_qos_mbr_down, tvb, offset, 5, FALSE);
754 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_up, tvb, offset, 5, FALSE);
756 proto_tree_add_item(tree, hf_gtpv2_flow_qos_gbr_down, tvb, offset, 5, FALSE);
763 static const value_string gtpv2_rat_type_vals[] = {
769 {5, "HSPA Evolution"},
775 dissect_gtpv2_rat_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
777 proto_tree_add_item(tree, hf_gtpv2_rat_type, tvb, 0, 1, FALSE);
781 * 8.18 Serving Network
784 dissect_gtpv2_serv_net(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
786 dissect_e212_mcc_mnc(tvb, tree, 0);
790 * 8.19 EPS Bearer Level Traffic Flow Template (Bearer TFT) */
792 static const value_string gtpv2_opcode_vals[] = {
794 {1, "Create New TFT"},
795 {2, "Delete Existing TFT"},
796 {3, "Add Packet filters to existing TFT"},
797 {4, "Replace Packet filters in existing TFT"},
798 {5, "Delete Packet filters from existing TFT"},
799 {6, "No TFT Operation"},
803 static const value_string gtpv2_comp_type_vals[] = {
804 {16, "IPV4 remote address type"},
805 {32, "IPV6 remote address type"},
806 {48, "Protocol Identifier"},
807 {64, "Single local port type"},
808 {65, "Local port range type"},
809 {80, "Single remote port type"},
810 {81, "Remote port range type"},
811 {96, "Security Parameter Index type"},
812 {112, "Type of Service/Traffic class type"},
813 {128, "Flow Label type"},
816 static const value_string gtpv2_direction_vals[] = {
817 {0, "Pre Rel-7 TFT filter"},
818 {1, "Downlink only"},
820 {3, "bidirectional"},
825 dissect_gtpv2_bearer_tft(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
827 int offset= 0,i=0,newoffset2;
828 guint8 number, opcode, ebit, comptype, length1;
831 number = tvb_get_guint8(tvb,offset)& 0x0f;
832 opcode = tvb_get_guint8(tvb,offset)& 0xe0;
833 ebit = tvb_get_guint8(tvb,offset)& 0x10;
834 proto_tree_add_item(tree, hf_gtpv2_b_tft_opcode, tvb, offset, 1, FALSE);
835 proto_tree_add_item(tree, hf_gtpv2_b_tft_number, tvb, offset, 1, FALSE);
836 proto_tree_add_item(tree, hf_gtpv2_b_tft_ebit, tvb, offset, 1, FALSE);
845 case ADD_PACKET_FILTERS_TFT:
846 /* Add packet filters to existing TFT */
847 case REPLACE_PACKET_FILTERS_TFT:
848 /*Replace Packet filters in existing TFT */
852 length1 =tvb_get_guint8(tvb,offset+2);
853 ti = proto_tree_add_text(tree, tvb, offset, 3+length1, "Packet Filter %d",i);
854 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
855 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE);
856 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE);
858 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, offset, 1, FALSE);
860 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, offset, 1, FALSE);
863 while (newoffset2<length1)
865 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_comp_type, tvb, offset, 1, FALSE);
866 comptype = tvb_get_guint8(tvb,offset);
871 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, offset, 4, FALSE);
872 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, offset, 4, FALSE);
878 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, offset, 16, FALSE);
879 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, offset, 16, FALSE);
885 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, offset, 1, FALSE);
891 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, offset, 2, FALSE);
897 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, offset, 2, FALSE);
900 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, offset, 2, FALSE);
906 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, offset, 2, FALSE);
912 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, offset, 2, FALSE);
915 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, offset, 2, FALSE);
921 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, offset, 4, FALSE);
927 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, offset, 1, FALSE);
928 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, offset, 1, FALSE);
934 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE);
943 /* Delete Existing TFT */
946 case DELETE_PACKET_FILTERS_TFT:
947 /* Delete Packet filters from existing TFT */
951 ti = proto_tree_add_text(tree, tvb, offset, 1, "Packet Filter %d",i);
952 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
953 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE);
954 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE);
958 case NO_TFT_OPERATION:
959 /* No TFT operation */
969 /* 8.20 Traffic Aggregate Description (TAD)
972 dissect_gtpv2_tad(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
974 int offset= 0,i=0,newoffset2;
975 guint8 number, opcode, ebit, comptype, length1;
978 number = tvb_get_guint8(tvb,offset)& 0x0f;
979 opcode = tvb_get_guint8(tvb,offset)& 0xe0;
980 ebit = tvb_get_guint8(tvb,offset)& 0x10;
981 proto_tree_add_item(tree, hf_gtpv2_b_tft_opcode, tvb, offset, 1, FALSE);
982 proto_tree_add_item(tree, hf_gtpv2_b_tft_number, tvb, offset, 1, FALSE);
983 proto_tree_add_item(tree, hf_gtpv2_b_tft_ebit, tvb, offset, 1, FALSE);
992 case REPLACE_PACKET_FILTERS_TFT:
993 /*Replace Packet filters in existing TFT */
997 length1 =tvb_get_guint8(tvb,offset+2);
998 ti = proto_tree_add_text(tree, tvb, offset, 3+length1, "Packet Filter %d",i);
999 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
1000 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE);
1001 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE);
1003 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, offset, 1, FALSE);
1005 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, offset, 1, FALSE);
1008 while (newoffset2<length1)
1010 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_comp_type, tvb, offset, 1, FALSE);
1011 comptype = tvb_get_guint8(tvb,offset);
1016 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, offset, 4, FALSE);
1017 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, offset, 4, FALSE);
1023 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, offset, 16, FALSE);
1024 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, offset, 16, FALSE);
1030 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, offset, 1, FALSE);
1036 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, offset, 2, FALSE);
1042 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, offset, 2, FALSE);
1045 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, offset, 2, FALSE);
1051 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, offset, 2, FALSE);
1057 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, offset, 2, FALSE);
1060 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, offset, 2, FALSE);
1066 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, offset, 4, FALSE);
1072 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, offset, 1, FALSE);
1073 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, offset, 1, FALSE);
1079 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE);
1087 case ADD_PACKET_FILTERS_TFT:
1088 /* Add packet filters to existing TFT */
1092 length1 =tvb_get_guint8(tvb,offset+1);
1093 ti = proto_tree_add_text(tree, tvb, offset, 2+length1, "Packet Filter %d",i);
1094 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
1095 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, offset, 1, FALSE);
1097 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, offset, 1, FALSE);
1100 while (newoffset2<length1)
1102 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_comp_type, tvb, offset, 1, FALSE);
1103 comptype = tvb_get_guint8(tvb,offset);
1108 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, offset, 4, FALSE);
1109 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, offset, 4, FALSE);
1115 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, offset, 16, FALSE);
1116 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, offset, 16, FALSE);
1122 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, offset, 1, FALSE);
1128 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, offset, 2, FALSE);
1134 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, offset, 2, FALSE);
1137 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, offset, 2, FALSE);
1143 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, offset, 2, FALSE);
1149 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, offset, 2, FALSE);
1152 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, offset, 2, FALSE);
1158 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, offset, 4, FALSE);
1164 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, offset, 1, FALSE);
1165 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, offset, 1, FALSE);
1171 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE);
1180 /* Delete Existing TFT */
1183 case DELETE_PACKET_FILTERS_TFT:
1184 /* Delete Packet filters from existing TFT */
1188 ti = proto_tree_add_text(tree, tvb, offset, 1, "Packet Filter %d",i);
1189 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
1190 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, offset, 1, FALSE);
1191 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, offset, 1, FALSE);
1195 case NO_TFT_OPERATION:
1196 /* No TFT operation */
1207 * 8.21 User Location Info (ULI)
1209 * The flags ECGI, TAI, RAI, SAI and CGI in octed 5 indicate if the corresponding
1210 * fields are present in the IE or not. If one of these flags is set to "0",
1211 * the corresponding field is not present at all. The respective identities are defined in 3GPP
1213 * Editor's Note: The definition of ECGI is missing in 3GPP TS 23.003 v8.1.0.
1214 * It can be found in 3GPP TS 36.413 v8.3.0, but it is expected that it will be moved
1215 * to 23.003 in a future version.
1219 dissect_gtpv2_uli(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1223 flags = tvb_get_guint8(tvb,offset)&0x1f;
1225 proto_tree_add_item(tree, hf_gtpv2_uli_ecgi_flg, tvb, offset, 1, FALSE);
1227 proto_tree_add_item(tree, hf_gtpv2_uli_tai_flg, tvb, offset, 1, FALSE);
1229 proto_tree_add_item(tree, hf_gtpv2_uli_rai_flg, tvb, offset, 1, FALSE);
1231 proto_tree_add_item(tree, hf_gtpv2_uli_sai_flg, tvb, offset, 1, FALSE);
1233 proto_tree_add_item(tree, hf_gtpv2_uli_cgi_flg, tvb, offset, 1, FALSE);
1236 /* 8.22.1 CGI field */
1239 dissect_e212_mcc_mnc(tvb, tree, 0);
1241 proto_tree_add_item(tree, hf_gtpv2_uli_cgi_lac, tvb, offset, 2, FALSE);
1242 proto_tree_add_item(tree, hf_gtpv2_uli_cgi_ci, tvb, offset, 2, FALSE);
1248 /* 8.22.2 SAI field */
1251 dissect_e212_mcc_mnc(tvb, tree, 0);
1253 proto_tree_add_item(tree, hf_gtpv2_uli_sai_lac, tvb, offset, 2, FALSE);
1254 proto_tree_add_item(tree, hf_gtpv2_uli_sai_sac, tvb, offset, 2, FALSE);
1259 /* 8.22.3 RAI field */
1262 dissect_e212_mcc_mnc(tvb, tree, 0);
1264 proto_tree_add_item(tree, hf_gtpv2_uli_rai_lac, tvb, offset, 2, FALSE);
1265 proto_tree_add_item(tree, hf_gtpv2_uli_rai_rac, tvb, offset, 2, FALSE);
1270 /* 8.22.4 TAI field */
1273 dissect_e212_mcc_mnc(tvb, tree, 0);
1275 proto_tree_add_item(tree, hf_gtpv2_uli_tai_tac, tvb, offset, 2, FALSE);
1280 /* 8.22.5 ECGI field */
1283 /* The bits 8 through 5, of octet e+3 (Fig 8.21.5-1 in TS 29.274 V8.2.0) are spare
1284 and hence they would not make any difference to the hex string following it, thus we directly read 4 bytes from tvb */
1286 proto_tree_add_item(tree, hf_gtpv2_uli_ecgi_eci, tvb, offset, 4, FALSE);
1293 * 8.22 Fully Qualified TEID (F-TEID)
1295 static const value_string gtpv2_f_teid_interface_type_vals[] = {
1296 {0, "S1-U eNodeB GTP-U interface"},
1297 {1, "S1-U SGW GTP-U interface"},
1298 {2, "S12 RNC GTP-U interface"},
1299 {3, "S12 SGW GTP-U interface"},
1300 {4, "S5/S8 SGW GTP-U interface"},
1301 {5, "S5/S8 PGW GTP-U interface"},
1302 {6, "S5/S8 SGW GTP-C interface"},
1303 {7, "S5/S8 PGW GTP-C interface"},
1304 {8, "S5/S8 SGW PMIPv6 interface (the 32 bit GRE key is encoded in 32 bit TEID field "
1305 "and since alternate CoA is not used the control plane and user plane addresses are the same for PMIPv6)"},
1306 {9, "S5/S8 PGW PMIPv6 interface (the 32 bit GRE key is encoded in 32 bit TEID field "
1307 "and the control plane and user plane addresses are the same for PMIPv6)"},
1308 {10, "S11 MME GTP-C interface"},
1309 {11, "S11/S4 SGW GTP-C interface"},
1310 {12, "S10 MME GTP-C interface"},
1311 {13, "S3 MME GTP-C interface"},
1312 {14, "S3 SGSN GTP-C interface"},
1313 {15, "S4 SGSN GTP-U interface"},
1314 {16, "S4 SGW GTP-U interface"},
1315 {17, "S4 SGSN GTP-C interface"},
1316 {18, "S16 SGSN GTP-C interface"},
1317 {19, "eNodeB GTP-U interface for DL data forwarding"},
1318 {20, "eNodeB GTP-U interface for UL data forwarding"},
1319 {21, "RNC GTP-U interface for data forwarding"},
1320 {22, "SGSN GTP-U interface for data forwarding"},
1321 {23, "SGW GTP-U interface for data forwarding"},
1325 dissect_gtpv2_f_teid(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1329 v4 = tvb_get_guint8(tvb,offset)& 0x80;
1330 v6 = tvb_get_guint8(tvb,offset)& 0x40;
1331 proto_tree_add_item(tree, hf_gtpv2_f_teid_v4, tvb, offset, 1, FALSE);
1332 proto_tree_add_item(tree, hf_gtpv2_f_teid_v6, tvb, offset, 1, FALSE);
1333 proto_tree_add_item(tree, hf_gtpv2_f_teid_interface_type, tvb, offset, 1, FALSE);
1336 proto_tree_add_item(tree, hf_gtpv2_f_teid_gre_key, tvb, offset, 4, FALSE);
1341 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv4, tvb, offset, 4, FALSE);
1346 proto_tree_add_item(tree, hf_gtpv2_f_teid_ipv6, tvb, offset, 16, FALSE);
1358 dissect_gtpv2_g_cn_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1360 proto_tree_add_text(tree, tvb, 0, length, "IE data not dissected yet");
1363 * 8.25 S103 PDN Data Forwarding Info (S103PDF)
1364 * 8.26 S1-U Data Forwarding (S1UDF) */
1370 dissect_gtpv2_delay_value(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1375 proto_tree_add_item(tree, hf_gtpv2_delay_value, tvb, offset, 1, FALSE);
1379 /*8.28 Bearer Context (grouped IE) */
1382 dissect_gtpv2_bearer_ctx(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1385 int newoffset, newoffset1, newoffset2, newoffset3;
1386 guint8 number, opcode, ebit, comptype, length1;
1387 guint8 type, instances;
1388 proto_tree *ie_tree;
1392 while (offset<length)
1394 type = tvb_get_guint8(tvb,offset);
1395 lengths = tvb_get_ntohs(tvb, offset+1);
1396 ti = proto_tree_add_text(tree, tvb, offset, 4 + lengths, "%s : ", val_to_str(type, gtpv2_element_type_vals, "Unknown"));
1397 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
1399 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, FALSE);
1403 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, FALSE);
1405 /* CR Spare Instance Octet 4*/
1406 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, FALSE);
1408 instances = tvb_get_guint8(tvb,offset)& 0x0f;
1409 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, FALSE);
1415 proto_tree_add_item(ie_tree, hf_gtpv2_ebi, tvb, offset, 1, FALSE);
1420 proto_tree_add_item(ie_tree, hf_gtpv2_cause, tvb, offset, 1, FALSE);
1421 proto_tree_add_item(ie_tree, hf_gtpv2_cause_cs, tvb, offset+1, 1, FALSE);
1427 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_pvi, tvb, newoffset3, 1, FALSE);
1428 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_pl, tvb, newoffset3, 1, FALSE);
1429 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_pci, tvb, newoffset3, 1, FALSE);
1432 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_label_qci, tvb, newoffset3, 1, FALSE);
1435 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_mbr_up, tvb, newoffset3, 5, FALSE);
1437 newoffset3= newoffset3+5;
1438 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_mbr_down, tvb, newoffset3, 5, FALSE);
1440 newoffset3= newoffset3+5;
1441 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_gbr_up, tvb, newoffset3, 5, FALSE);
1443 newoffset3= newoffset3+5;
1444 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_gbr_down, tvb, newoffset3, 5, FALSE);
1446 newoffset3= newoffset3+5;
1452 number = tvb_get_guint8(tvb,newoffset1)& 0x0f;
1453 opcode = tvb_get_guint8(tvb,newoffset1)& 0xe0;
1454 ebit = tvb_get_guint8(tvb,newoffset1)& 0x10;
1455 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_opcode, tvb, newoffset1, 1, FALSE);
1456 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_number, tvb, newoffset1, 1, FALSE);
1457 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_ebit, tvb, newoffset1, 1, FALSE);
1464 case CREATE_NEW_TFT:
1465 /* Create New TFT */
1466 case ADD_PACKET_FILTERS_TFT:
1467 /* Add packet filters to existing TFT */
1468 case REPLACE_PACKET_FILTERS_TFT:
1469 /*Replace Packet filters in existing TFT */
1473 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, newoffset1, 1, FALSE);
1474 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, newoffset1, 1, FALSE);
1476 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, newoffset1, 1, FALSE);
1478 length1 =tvb_get_guint8(tvb,newoffset1);
1479 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, newoffset1, 1, FALSE);
1482 while (newoffset2<length1)
1484 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_comp_type, tvb, newoffset1, 1, FALSE);
1485 comptype = tvb_get_guint8(tvb,newoffset1);
1490 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, newoffset1, 4, FALSE);
1491 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, newoffset1, 4, FALSE);
1497 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, newoffset1, 16, FALSE);
1498 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, newoffset1, 16, FALSE);
1504 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, newoffset1, 1, FALSE);
1510 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, newoffset1, 2, FALSE);
1516 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, newoffset1, 2, FALSE);
1519 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, newoffset1, 2, FALSE);
1525 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, newoffset1, 2, FALSE);
1531 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, newoffset1, 2, FALSE);
1534 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, newoffset1, 2, FALSE);
1540 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, newoffset1, 4, FALSE);
1546 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, newoffset1, 1, FALSE);
1547 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, newoffset1, 1, FALSE);
1553 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE);
1562 /* Delete Existing TFT */
1565 case DELETE_PACKET_FILTERS_TFT:
1566 /* Delete Packet filters from existing TFT */
1570 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, newoffset1, 1, FALSE);
1571 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, newoffset1, 1, FALSE);
1575 case NO_TFT_OPERATION:
1576 /* No TFT operation */
1590 v4 = tvb_get_guint8(tvb,newoffset)& 0x80;
1591 v6 = tvb_get_guint8(tvb,newoffset)& 0x40;
1593 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_v4, tvb, newoffset, 1, FALSE);
1594 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_v6, tvb, newoffset, 1, FALSE);
1595 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_interface_type, tvb, newoffset, 1, FALSE);
1597 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_gre_key, tvb, newoffset, 4, FALSE);
1598 newoffset= newoffset+4;
1601 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_ipv4, tvb, newoffset, 4, FALSE);
1602 newoffset= newoffset+4;
1606 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_ipv6, tvb, newoffset, 16, FALSE);
1607 newoffset= newoffset+16;
1613 proto_tree_add_item(ie_tree, hf_gtpv2_charging_id, tvb, offset, length, FALSE);
1618 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_flag, tvb, offset, length, FALSE);
1623 proto_tree_add_text(ie_tree, tvb, 0, lengths, "IE data not dissected yet");
1627 /* Transaction Identifier */
1628 proto_tree_add_text(ie_tree, tvb, 0, lengths, "IE data not dissected yet");
1638 /* 8.29 Charging ID */
1640 dissect_gtpv2_charging_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1645 proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, FALSE);
1651 /* 8.30 Charging Characteristics */
1654 dissect_gtpv2_charging_characteristic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1659 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, length, FALSE);
1663 /* 8.30 Bearer Flag */
1665 dissect_gtpv2_bearer_flag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1670 proto_tree_add_item(tree, hf_gtpv2_bearer_flag, tvb, offset, length, FALSE);
1676 dissect_gtpv2_pdn_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1681 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, FALSE);
1686 /* 8.31 Trace Information
1690 /* 8.35 Procedure Transaction ID (PTI) */
1692 dissect_gtpv2_pti(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1694 proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, FALSE);
1697 * 8.36 DRX Parameter
1698 * 8.37 UE Network Capability
1700 * 8.39 PDN Connection (grouped IE)
1702 * 8.41 Packet TMSI (P-TMSI)
1703 * 8.42 P-TMSI Signature
1707 /* 8.44 UE Time Zone */
1709 static const value_string gtpv2_ue_time_zone_dst_vals[] = {
1710 {0, "No Adjustments for Daylight Saving Time"},
1711 {1, "+1 Hour Adjustments for Daylight Saving Time"},
1712 {2, "+2 Hour Adjustments for Daylight Saving Time"},
1717 dissect_gtpv2_ue_time_zone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1721 proto_tree_add_item(tree, hf_gtpv2_ue_time_zone, tvb, offset, 1, FALSE);
1724 proto_tree_add_item(tree, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, FALSE);
1728 /* 8.45 Trace Reference
1729 * 8.56 Complete Request Message
1731 * 8.48 Fully Qualified Container (F-Container)
1732 * 8.49 Fully Qualified Cause (F-Cause)
1733 * 8.50 Selected PLMN ID
1734 * 8.51 Target Identification
1736 * 8.53 Packet Flow ID
1738 * 8.55 Source RNC PDCP context info
1739 * 8.56 UDP Source Port Number
1742 /*8.57 APN Restriction */
1744 dissect_gtpv2_apn_rest(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1746 proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, 0, 1, FALSE);
1749 /* 8.58 Selection Mode */
1750 static const value_string gtpv2_selec_mode_vals[] = {
1751 {0, "MS or network provided APN, subscribed verified"},
1752 {1, "MS provided APN, subscription not verified"},
1753 {2, "Network provided APN, subscription not verified"},
1754 {3, "Network provided APN, subscription not verified (Basically for Future use"},
1759 dissect_gtpv2_selec_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1763 proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, FALSE);
1767 /* 8.59 Source Identification */
1769 /* 8.60 Bearer Control Mode */
1770 static const value_string gtpv2_bearer_control_mode_vals[] = {
1771 {0, "Selected Bearer Control Mode-'MS_only'"},
1772 {1, "Selected Bearer Control Mode-'Network_only'"},
1773 {2, "Selected Bearer Control Mode-'MS/NW'"},
1778 dissect_gtpv2_bearer_control_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1780 proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, FALSE);
1783 * 8.61 Change Reporting Action
1785 static const value_string gtpv2_cng_rep_act_vals[] = {
1786 {0, "Stop Reporting"},
1787 {1, "Start Reporting CGI/SAI"},
1788 {2, "Start Reporting RAI"},
1793 dissect_cng_rep_act(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1796 proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, FALSE);
1799 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
1800 * 8.63 Channel needed
1801 * 8.64 eMLPP Priority
1805 static const value_string gtpv2_node_type_vals[] = {
1812 dissect_node_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1815 proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, FALSE);
1818 /* 8.66 Fully Qualified Domain Name (FQDN)
1819 * 8.67 Private Extension
1821 typedef struct _gtpv2_ie {
1823 void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, guint16, guint8);
1826 static const gtpv2_ie_t gtpv2_ies[] = {
1827 {GTPV2_IE_IMSI, dissect_gtpv2_imsi},
1828 {GTPV2_IE_CAUSE, dissect_gtpv2_cause}, /* 2, Cause (without embedded offending IE) 8.4 */
1829 {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery}, /* 3, Recovery (Restart Counter) 8.5 */
1830 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
1831 /* 51-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
1832 {GTPV2_APN, dissect_gtpv2_apn}, /* 71, Access Point Name (APN) 8.6 */
1833 {GTPV2_AMBR, dissect_gtpv2_ambr}, /* 72, Aggregate Maximum Bit Rate (AMBR) */
1834 {GTPV2_EBI, dissect_gtpv2_ebi}, /* 73, EPS Bearer ID (EBI) 8.8 */
1835 {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address}, /* 74, IP Address */
1836 {GTPV2_MEI, dissect_gtpv2_mei}, /* 74, Mobile Equipment Identity */
1837 {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn}, /* 76, MSISDN 8.11 */
1838 {GTPV2_INDICATION, dissect_gtpv2_ind}, /* 77 Indication 8.12 */
1839 {GTPV2_PCO, dissect_gtpv2_pco}, /* 78 Protocol Configuration Options (PCO) 8.13 */
1840 {GTPV2_PAA, dissect_gtpv2_paa}, /* 79 PDN Address Allocation (PAA) 8.14 */
1841 {GTPV2_BEARER_QOS,dissect_gtpv2_bearer_qos}, /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
1842 {GTPV2_FLOW_QOS, dissect_gtpv2_flow_qos}, /* 81 Flow Quality of Service (Flow QoS) 8.16 */
1843 {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type}, /* 82, RAT Type 8.17 */
1844 {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net}, /* 83, Serving Network 8.18 */
1845 {GTPV2_BEARER_TFT, dissect_gtpv2_bearer_tft}, /* 84, Bearer TFT 8.19 */
1846 {GTPV2_TAD, dissect_gtpv2_tad}, /* 85, Traffic Aggregate Description 8.20 */
1847 {GTPV2_ULI, dissect_gtpv2_uli}, /* 86, User Location Info (ULI) 8.22 */
1848 {GTPV2_F_TEID, dissect_gtpv2_f_teid}, /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
1849 {GTPV2_G_CN_ID, dissect_gtpv2_g_cn_id}, /* 89, Global CN-Id 8.25 */
1850 {GTPV2_DELAY_VALUE, dissect_gtpv2_delay_value}, /* 92, Delay Value 8.29 */
1851 {GTPV2_BEARER_CTX,dissect_gtpv2_bearer_ctx}, /* 93, Bearer Context 8.31 */
1852 {GTPV2_CHARGING_ID, dissect_gtpv2_charging_id}, /* 94, Charging Id */
1853 {GTPV2_CHARGING_CHARACTERISTIC, /* 95 Charging Characteristic */
1854 dissect_gtpv2_charging_characteristic},
1855 {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag}, /* 97, Bearer Flag */
1856 {GTPV2_PDN_TYPE, dissect_gtpv2_pdn_type}, /* 99, PDN Type */
1857 {GTPV2_PTI, dissect_gtpv2_pti}, /* 100 Procedure Transaction Id */
1858 {GTPV2_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone}, /* 114, UE Time Zone */
1859 {GTPV2_APN_RESTRICTION, /* 127, APN Restriction */
1860 dissect_gtpv2_apn_rest},
1861 {GTPV2_SELEC_MODE,dissect_gtpv2_selec_mode}, /* 128 Selection Mode */
1862 {GTPV2_BEARER_CONTROL_MODE,
1863 dissect_gtpv2_bearer_control_mode}, /* 130 Bearer Control Mode*/
1864 {GTPV2_CNG_REP_ACT ,dissect_cng_rep_act}, /* 131 Change Reporting Action 8.61 */
1865 {GTPV2_NODE_TYPE ,dissect_node_type}, /* 135 Node Type 8.65 */
1866 /* 137-254 Spare. For future use. FFS */
1868 {0, dissect_gtpv2_unknown}
1874 dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, gint offset)
1876 proto_tree *ie_tree;
1879 guint8 type, instance;
1883 * Octets 8 7 6 5 4 3 2 1
1886 * 4 CR Spare Instance
1887 * 5-(n+4) IE specific data
1889 while(offset < (gint)tvb_reported_length(tvb)){
1890 /* Get the type and length */
1891 type = tvb_get_guint8(tvb,offset);
1892 length = tvb_get_ntohs(tvb, offset+1);
1893 ti = proto_tree_add_text(tree, tvb, offset, 4 + length, "%s : ", val_to_str(type, gtpv2_element_type_vals, "Unknown"));
1894 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
1896 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, FALSE);
1900 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, FALSE);
1902 /* CR Spare Instance Octet 4*/
1903 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, FALSE);
1905 instance = tvb_get_guint8(tvb,offset)& 0x0f;
1906 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, FALSE);
1909 /* TODO: call IE dissector here */
1910 if(type==GTPV2_IE_RESERVED){
1911 /* Treat IE type zero specal as type zero is used to end the loop in the else branch */
1912 proto_tree_add_text(ie_tree, tvb, offset, length, "IE type Zero is Reserved and should not be used");
1915 /* Loop over the IE dissector list to se if we find an entry, the last entry will have ie_type=0 braking the loop */
1916 while (gtpv2_ies[++i].ie_type){
1917 if (gtpv2_ies[i].ie_type == type)
1920 /* Just give the IE dissector the IE */
1921 ie_tvb = tvb_new_subset(tvb, offset, length, length);
1922 (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, instance);
1925 offset = offset + length;
1930 dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
1932 proto_tree *gtpv2_tree, *flags_tree;
1933 proto_item *ti, *tf;
1934 guint8 message_type, t_flag;
1938 /* Currently we get called from the GTP dissector no need to check the version */
1939 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
1940 if (check_col(pinfo->cinfo, COL_INFO))
1941 col_clear(pinfo->cinfo, COL_INFO);
1943 /* message type is in octet 2 */
1944 message_type = tvb_get_guint8(tvb,1);
1945 if (check_col(pinfo->cinfo, COL_INFO))
1946 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(message_type, gtpv2_message_type_vals, "Unknown"));
1949 proto_tree_add_item(tree, proto_gtpv2, tvb, offset, -1, FALSE);
1952 ti = proto_tree_add_text(tree, tvb, offset, -1, "%s", val_to_str(message_type, gtpv2_message_type_vals, "Unknown"));
1953 gtpv2_tree = proto_item_add_subtree(ti, ett_gtpv2);
1955 /* Control Plane GTP uses a variable length header. Control Plane GTP header
1956 * length shall be a multiple of 4 octets.
1957 * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
1958 * Bits 8 7 6 5 4 3 2 1
1959 * Octets 1 Version Spare T Spare Spare Spare
1961 * 3 Message Length (1st Octet)
1962 * 4 Message Length (2nd Octet)
1963 * m-k(m+3) If T flag is set to 1, then TEID shall be placed into octets 5-8.
1964 * Otherwise, TEID field is not present at all.
1965 * n-(n+1) Sequence Number
1967 * Figure 5.1-1: General format of GTPv2 Header for Control Plane
1969 tf = proto_tree_add_item(gtpv2_tree, hf_gtpv2_flags, tvb, offset, 1, FALSE);
1970 flags_tree = proto_item_add_subtree(tf, ett_gtpv2_flags);
1973 t_flag = (tvb_get_guint8(tvb,offset) & 0x08)>>3;
1974 proto_tree_add_item(flags_tree, hf_gtpv2_version, tvb, offset, 1, FALSE);
1975 proto_tree_add_item(flags_tree, hf_gtpv2_t, tvb, offset, 1, FALSE);
1979 proto_tree_add_item(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, FALSE);
1982 proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, FALSE);
1986 /* Tunnel Endpoint Identifier 4 octets */
1987 proto_tree_add_item(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, FALSE);
1990 /* Sequence Number 2 octets */
1991 proto_tree_add_item(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 2, FALSE);
1994 /* Spare 2 octets */
1995 proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 2, FALSE);
1998 dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset);
2003 void proto_register_gtpv2(void)
2005 static hf_register_info hf_gtpv2[] = {
2007 {"Flags", "gtpv2.flags",
2008 FT_UINT8, BASE_DEC, NULL, 0x0,
2012 {"Version", "gtpv2.version",
2013 FT_UINT8, BASE_DEC, NULL, 0xe0,
2018 FT_UINT8, BASE_DEC, NULL, 0x08,
2019 "If TEID field is present or not", HFILL}
2021 { &hf_gtpv2_message_type,
2022 {"Message Type", "gtpv2.message_type",
2023 FT_UINT8, BASE_DEC, VALS(gtpv2_message_type_vals), 0x0,
2026 { &hf_gtpv2_msg_length,
2027 {"Message Length", "gtpv2.msg_lengt",
2028 FT_UINT16, BASE_DEC, NULL, 0x0,
2032 {"Tunnel Endpoint Identifier", "gtpv2.teid",
2033 FT_UINT32, BASE_DEC, NULL, 0x0,
2037 {"Sequence Number", "gtpv2.seq",
2038 FT_UINT32, BASE_DEC, NULL, 0x0,
2042 {"Spare", "gtpv2.spare",
2043 FT_UINT16, BASE_DEC, NULL, 0x0,
2047 {"IE Type", "gtpv2.ie_type",
2048 FT_UINT8, BASE_DEC, VALS(gtpv2_element_type_vals), 0x0,
2052 {"IE Length", "gtpv2.ie_len",
2053 FT_UINT16, BASE_DEC, NULL, 0x0,
2054 "length of the information element excluding the first four octets", HFILL}
2057 {"CR flag", "gtpv2.cr",
2058 FT_UINT8, BASE_DEC, NULL, 0xe0,
2061 { &hf_gtpv2_instance,
2062 {"Instance", "gtpv2.instance",
2063 FT_UINT8, BASE_DEC, NULL, 0x0f,
2067 {"IMSI(International Mobile Subscriber Identity number)", "gtpv2.imsi",
2068 FT_STRING, BASE_NONE, NULL, 0,
2072 {"Cause", "gtpv2.cause",
2073 FT_UINT8, BASE_DEC, VALS(gtpv2_cause_vals), 0x0,
2076 {&hf_gtpv2_cause_cs,
2077 {"Cause Source (CS: True-Error originated by remote node, False-Error originated by Node sending the Message)","gtpv2.cs",
2078 FT_BOOLEAN, 8, NULL, 0x01,
2082 {"Restart Counter", "gtpv2.rec",
2083 FT_UINT8, BASE_DEC, NULL, 0x0,
2087 {"APN (Access Point Name)", "gtp.apn",
2088 FT_STRING, BASE_NONE, NULL, 0x0,
2092 {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
2093 FT_UINT32, BASE_DEC, NULL, 0x0,
2096 {&hf_gtpv2_ambr_down,
2097 {"AMBR Downlink(Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
2098 FT_UINT32, BASE_DEC, NULL, 0x0,
2102 {"EPS Bearer ID (EBI)", "gtpv2.ebi",
2103 FT_UINT8, BASE_DEC, NULL, 0x0f,
2106 { &hf_gtpv2_ip_address_ipv4,
2107 {"IP address IPv4", "gtpv2.ip_address_ipv4",
2108 FT_IPv4, BASE_NONE, NULL, 0x0,
2111 { &hf_gtpv2_ip_address_ipv6,
2112 {"IP address IPv6", "gtpv2.ip_address_ipv6",
2113 FT_IPv6, BASE_NONE, NULL, 0x0,
2117 {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
2118 FT_STRING, BASE_NONE, NULL, 0,
2123 {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
2124 FT_BOOLEAN, 8, NULL, 0x80, "DAF", HFILL}
2127 {"DTF (Direct Tunnel Flag)","gtpv2.dtf",
2128 FT_BOOLEAN, 8, NULL, 0x40, "DTF", HFILL}
2131 {"HI (Handover Indication)", "gtpv2.hi",
2132 FT_BOOLEAN, 8, NULL, 0x20, "HI", HFILL}
2135 {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
2136 FT_BOOLEAN, 8, NULL, 0x10, "DFI", HFILL}
2139 {"OI (Operation Indication)","gtp.oi",
2140 FT_BOOLEAN, 8, NULL, 0x08, "OI", HFILL}
2143 {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
2144 FT_BOOLEAN, 8, NULL, 0x04, "ISRSI", HFILL}
2147 {"ISRAI (Idle mode Signalling Reduction Activation Indication)", "gtpv2.israi",
2148 FT_BOOLEAN, 8, NULL, 0x02, "ISRAI", HFILL}
2151 {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
2152 FT_BOOLEAN, 8, NULL, 0x01, "SGWCI", HFILL}
2155 {"PT (Protocol Type)", "gtpv2.pt",
2156 FT_BOOLEAN, 8, NULL, 0x08, "PT", HFILL}
2159 {"TDI (Teardown Indication)", "gtpv2.tdi",
2160 FT_BOOLEAN, 8, NULL, 0x04, "TDI", HFILL}
2163 {"SI (Scope Indication)", "gtpv2.si",
2164 FT_BOOLEAN, 8, NULL, 0x02, "SI", HFILL}
2167 {"MSV (MS Validated)", "gtpv2.msv",
2168 FT_BOOLEAN, 8, NULL, 0x01, "MSV", HFILL}
2170 { &hf_gtpv2_pdn_type,
2171 {"PDN Type", "gtpv2.pdn_type",
2172 FT_UINT8, BASE_DEC, VALS(gtpv2_pdn_type_vals), 0x07,
2175 { &hf_gtpv2_pdn_ipv4,
2176 {"PDN IPv4", "gtpv2.pdn_ipv4",
2177 FT_IPv4, BASE_NONE, NULL, 0x0,
2180 { &hf_gtpv2_pdn_ipv6_len,
2181 {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
2182 FT_UINT8, BASE_DEC, NULL, 0x0,
2185 { &hf_gtpv2_pdn_ipv6,
2186 {"PDN IPv6", "gtpv2.pdn_ipv6",
2187 FT_IPv6, BASE_NONE, NULL, 0x0,
2190 {&hf_gtpv2_bearer_qos_pvi,
2191 {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
2192 FT_BOOLEAN, 8, NULL, 0x01,
2195 {&hf_gtpv2_bearer_qos_pl,
2196 {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
2197 FT_UINT8, BASE_DEC, NULL, 0x3c,
2200 {&hf_gtpv2_bearer_qos_pci,
2201 {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
2202 FT_BOOLEAN, 8, NULL, 0x40,
2205 {&hf_gtpv2_bearer_qos_label_qci,
2206 {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
2207 FT_UINT8, BASE_DEC, NULL, 0x0,
2210 {&hf_gtpv2_bearer_qos_mbr_up,
2211 {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
2212 FT_UINT64, BASE_DEC, NULL, 0x0,
2215 {&hf_gtpv2_bearer_qos_mbr_down,
2216 {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
2217 FT_UINT64, BASE_DEC, NULL, 0x0,
2220 {&hf_gtpv2_bearer_qos_gbr_up,
2221 {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
2222 FT_UINT64, BASE_DEC, NULL, 0x0,
2225 {&hf_gtpv2_bearer_qos_gbr_down,
2226 {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
2227 FT_UINT64, BASE_DEC, NULL, 0x0,
2230 {&hf_gtpv2_flow_qos_label_qci,
2231 {"Label (QCI)", "gtpv2.flow_qos_label_qci",
2232 FT_UINT8, BASE_DEC, NULL, 0x0,
2235 {&hf_gtpv2_flow_qos_mbr_up,
2236 {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
2237 FT_UINT64, BASE_DEC, NULL, 0x0,
2240 {&hf_gtpv2_flow_qos_mbr_down,
2241 {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
2242 FT_UINT64, BASE_DEC, NULL, 0x0,
2245 {&hf_gtpv2_flow_qos_gbr_up,
2246 {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
2247 FT_UINT64, BASE_DEC, NULL, 0x0,
2250 {&hf_gtpv2_flow_qos_gbr_down,
2251 {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
2252 FT_UINT64, BASE_DEC, NULL, 0x0,
2255 { &hf_gtpv2_rat_type,
2256 {"RAT Type", "gtpv2.rat_type",
2257 FT_UINT8, BASE_DEC, VALS(gtpv2_rat_type_vals), 0x0,
2260 {&hf_gtpv2_b_tft_opcode,
2261 {"Operation Code", "gtpv2.b_tft_opcode",
2262 FT_UINT8, BASE_DEC, VALS(gtpv2_opcode_vals), 0xe0,
2265 {&hf_gtpv2_b_tft_ebit,
2266 {"Ebit", "gtpv2.b_tft_ebit",
2267 FT_BOOLEAN, 8, NULL, 0x10,
2270 {&hf_gtpv2_b_tft_number,
2271 {"Number of Packet Filters", "gtpv2.b_tft_number",
2272 FT_UINT8, BASE_DEC, NULL, 0x0f,
2275 {&hf_gtpv2_b_tft_pf_id,
2276 {"Packet Filter Identifier", "gtpv2.b_tft_pf_id",
2277 FT_UINT8, BASE_DEC, NULL, 0x0f,
2280 {&hf_gtpv2_b_tft_pf_direction,
2281 {"Direction", "gtpv2.b_tft_pf_direction",
2282 FT_UINT8, BASE_DEC, VALS(gtpv2_direction_vals), 0x30,
2285 {&hf_gtpv2_b_tft_pf_eval,
2286 {"Evaluation Precedence", "gtpv2.b_tft_pf_eval",
2287 FT_UINT8, BASE_DEC, NULL, 0x0,
2290 {&hf_gtpv2_b_tft_pf_length,
2291 {"Length of Packet Filter", "gtpv2.b_tft_pf_length",
2292 FT_UINT8, BASE_DEC, NULL, 0x0,
2295 {&hf_gtpv2_b_tft_pf_comp_type,
2296 {"Component Type", "gtpv2.b_tft_pf_comp_type",
2297 FT_UINT8, BASE_DEC, VALS(gtpv2_comp_type_vals), 0x0,
2300 { &hf_gtpv2_b_tft_pf_ipv4,
2301 {"IPv4 address", "gtpv2.b_tft_pf_ipv4",
2302 FT_IPv4, BASE_NONE, NULL, 0x0,
2305 { &hf_gtpv2_b_tft_pf_ipv6,
2306 {"IPv6 address", "gtpv2.b_tft_pf_ipv6",
2307 FT_IPv6, BASE_NONE, NULL, 0x0,
2310 {&hf_gtpv2_b_tft_pf_ipv4_mask,
2311 {"IPV4 address mask field", "gtpv2.b_tft_pf_ipv4_mask",
2312 FT_UINT32, BASE_DEC, NULL, 0x0,
2315 {&hf_gtpv2_b_tft_pf_ipv6_mask,
2316 {"IPV6 address mask field", "gtpv2.b_tft_pf_ipv6_mask",
2317 FT_UINT32, BASE_DEC, NULL, 0x0,
2320 {&hf_gtpv2_b_tft_pf_prot_id,
2321 {"Protocol Identifier/Next Header type", "gtpv2.b_tft_pf_prot_id",
2322 FT_UINT8, BASE_DEC, NULL, 0x0,
2325 {&hf_gtpv2_b_tft_pf_single_local,
2326 {"Single Local port type", "gtpv2.b_tft_pf_single_local",
2327 FT_UINT16, BASE_DEC, NULL, 0x0,
2330 {&hf_gtpv2_b_tft_pf_local_port_low,
2331 {"Local port range low limit", "gtpv2.b_tft_pf_local_port_low",
2332 FT_UINT16, BASE_DEC, NULL, 0x0,
2335 {&hf_gtpv2_b_tft_pf_local_port_high,
2336 {"Local port range high limit", "gtpv2.b_tft_pf_local_port_high",
2337 FT_UINT16, BASE_DEC, NULL, 0x0,
2340 {&hf_gtpv2_b_tft_pf_single_remote,
2341 {"Single remote port type", "gtpv2.b_tft_pf_single_remote",
2342 FT_UINT16, BASE_DEC, NULL, 0x0,
2345 {&hf_gtpv2_b_tft_pf_remote_port_low,
2346 {"Remote port range low limit", "gtpv2.b_tft_pf_remote_port_low",
2347 FT_UINT16, BASE_DEC, NULL, 0x0,
2350 {&hf_gtpv2_b_tft_pf_remote_port_high,
2351 {"Remote port range high limit", "gtpv2.b_tft_pf_remote_port_high",
2352 FT_UINT16, BASE_DEC, NULL, 0x0,
2355 {&hf_gtpv2_b_tft_pf_security,
2356 {"Security Parameter Index", "gtpv2.b_tft_pf_security",
2357 FT_UINT8, BASE_DEC, NULL, 0x0,
2360 {&hf_gtpv2_b_tft_pf_service_type,
2361 {"Type of Service/Traffic Class type", "gtpv2.b_tft_pf_service_type",
2362 FT_UINT8, BASE_DEC, NULL, 0x0,
2365 {&hf_gtpv2_b_tft_pf_service_type_mask,
2366 {"Type of Service/Traffic Class mask", "gtpv2.b_tft_pf_service_type_mask",
2367 FT_UINT8, BASE_DEC, NULL, 0x0,
2370 {&hf_gtpv2_b_tft_pf_flow_label,
2371 {"Flow Label Type", "gtpv2.b_tft_pf_flow_label",
2372 FT_UINT32, BASE_DEC, NULL, 0,
2375 { &hf_gtpv2_uli_ecgi_flg,
2376 {"ECGI Present Flag)", "gtpv2.uli_ecgi_flg",
2377 FT_BOOLEAN, 8, NULL, 0x10,
2380 { &hf_gtpv2_uli_tai_flg,
2381 {"TAI Present Flag)", "gtpv2.uli_tai_flg",
2382 FT_BOOLEAN, 8, NULL, 0x08,
2385 { &hf_gtpv2_uli_rai_flg,
2386 {"RAI Present Flag)", "gtpv2.uli_rai_flg",
2387 FT_BOOLEAN, 8, NULL, 0x04,
2390 { &hf_gtpv2_uli_sai_flg,
2391 {"SAI Present Flag)", "gtpv2.uli_sai_flg",
2392 FT_BOOLEAN, 8, NULL, 0x02,
2395 { &hf_gtpv2_uli_cgi_flg,
2396 {"CGI Present Flag)", "gtpv2.uli_cgi_flg",
2397 FT_BOOLEAN, 8, NULL, 0x01,
2400 { &hf_gtpv2_uli_cgi_lac,
2401 {"Location Area Code", "gtpv2.uli_cgi_lac",
2402 FT_UINT16, BASE_DEC, NULL, 0x0,
2405 { &hf_gtpv2_uli_cgi_ci,
2406 {"Cell Identity", "gtpv2.uli_cgi_ci",
2407 FT_UINT16, BASE_DEC, NULL, 0x0,
2410 { &hf_gtpv2_uli_sai_lac,
2411 {"Location Area Code", "gtpv2.uli_sai_lac",
2412 FT_UINT16, BASE_DEC, NULL, 0x0,
2415 { &hf_gtpv2_uli_sai_sac,
2416 {"Service Area Code", "gtpv2.uli_sai_sac",
2417 FT_UINT16, BASE_DEC, NULL, 0x0,
2420 { &hf_gtpv2_uli_rai_lac,
2421 {"Location Area Code", "gtpv2.uli_rai_lac",
2422 FT_UINT16, BASE_DEC, NULL, 0x0,
2425 { &hf_gtpv2_uli_rai_rac,
2426 {"Routing Area Code", "gtpv2.uli_rai_rac",
2427 FT_UINT16, BASE_DEC, NULL, 0x0,
2430 { &hf_gtpv2_uli_tai_tac,
2431 {"Tracking Area Code", "gtpv2.uli_tai_tac",
2432 FT_UINT16, BASE_DEC, NULL, 0x0,
2435 {&hf_gtpv2_uli_ecgi_eci,
2436 {"ECI (E-UTRAN Cell Identifier)", "gtpv2.uli_ecgi_eci",
2437 FT_DOUBLE, BASE_DEC, NULL, 0,
2440 {&hf_gtpv2_f_teid_v4,
2441 {"V4 (True-IPV4 address field Exists,False-Doesn't Exist in F-TEID)", "gtpv2.f_teid_v4",
2442 FT_BOOLEAN, 8, NULL, 0x80,
2445 {&hf_gtpv2_f_teid_v6,
2446 {"V6 (True-IPV6 address field Exists,False-Doesn't Exist in F-TEID)", "gtpv2.f_teid_v6",
2447 FT_BOOLEAN, 8, NULL, 0x40,
2450 {&hf_gtpv2_f_teid_interface_type,
2451 {"Interface Type", "gtpv2.f_teid_interface_type",
2452 FT_UINT8, BASE_DEC, VALS(gtpv2_f_teid_interface_type_vals), 0x1f,
2455 {&hf_gtpv2_f_teid_gre_key,
2456 {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
2457 FT_UINT32, BASE_DEC, NULL, 0x0,
2460 { &hf_gtpv2_f_teid_ipv4,
2461 {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
2462 FT_IPv4, BASE_NONE, NULL, 0x0,
2465 { &hf_gtpv2_f_teid_ipv6,
2466 {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
2467 FT_IPv6, BASE_NONE, NULL, 0x0,
2470 {&hf_gtpv2_delay_value,
2471 {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
2472 FT_UINT8, BASE_DEC, NULL, 0x0,
2475 {&hf_gtpv2_charging_id,
2476 {"Charging id", "gtpv2.charging_id",
2477 FT_UINT32, BASE_DEC, NULL, 0x0,
2480 {&hf_gtpv2_charging_characteristic,
2481 {"Charging Characteristic", "gtpv2.charging_characteristic",
2482 FT_UINT16, BASE_DEC, NULL, 0x0,
2485 {&hf_gtpv2_bearer_flag,
2486 {"Bearer Flags(PPC(Prohibit Payload Compression) True-SGSN attempts to compress the payload, False-SGSN doesn't attempt to compress the payload)",
2487 "gtpv2.bearer_flag",
2488 FT_BOOLEAN, 8, NULL, 0x01,
2492 {"Procedure Transaction Id", "gtpv2.pti",
2493 FT_UINT8, BASE_DEC, NULL, 0x0,
2496 {&hf_gtpv2_ue_time_zone,
2497 {"Time Zone","gtpv2.ue_time_zone",
2498 FT_UINT8, BASE_DEC, NULL,0x0,
2501 {&hf_gtpv2_ue_time_zone_dst,
2502 {"Daylight Saving Time","gtpv2.ue_time_zone_dst",
2503 FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals),0x03,
2506 {&hf_gtpv2_apn_rest,
2507 {"APN Restriction", "gtpv2.apn_rest",
2508 FT_UINT8, BASE_DEC, NULL, 0x0,
2511 {&hf_gtpv2_selec_mode,
2512 {"Selection Mode","gtpv2.selec_mode",
2513 FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals),0x03,
2516 {&hf_gtpv2_bearer_control_mode,
2517 {"Bearer Control Mode","gtpv2.bearer_control_mode",
2518 FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals),0x0,
2521 { &hf_gtpv2_cng_rep_act,
2522 {"Change Reporting Action", "gtpv2.cng_rep_act",
2523 FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
2526 { &hf_gtpv2_node_type,
2527 {"Node Type", "gtpv2.node_type",
2528 FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
2534 static gint *ett_gtpv2_array[] = {
2540 proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
2541 proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
2542 proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
2544 register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
2547 /* The registration hand-off routine */
2549 proto_reg_handoff_gtpv2(void)