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;
1393 while (offset<length)
1395 type = tvb_get_guint8(tvb,offset);
1396 lengths = tvb_get_ntohs(tvb, offset+1);
1397 ti = proto_tree_add_text(tree, tvb, offset, 4 + lengths, "%s : ", val_to_str(type, gtpv2_element_type_vals, "Unknown"));
1398 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
1400 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, FALSE);
1404 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, FALSE);
1406 /* CR Spare Instance Octet 4*/
1407 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, FALSE);
1409 instances = tvb_get_guint8(tvb,offset)& 0x0f;
1410 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, FALSE);
1416 proto_tree_add_item(ie_tree, hf_gtpv2_ebi, tvb, offset, 1, FALSE);
1421 proto_tree_add_item(ie_tree, hf_gtpv2_cause, tvb, offset, 1, FALSE);
1422 proto_tree_add_item(ie_tree, hf_gtpv2_cause_cs, tvb, offset+1, 1, FALSE);
1428 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_pvi, tvb, newoffset3, 1, FALSE);
1429 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_pl, tvb, newoffset3, 1, FALSE);
1430 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_pci, tvb, newoffset3, 1, FALSE);
1433 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_label_qci, tvb, newoffset3, 1, FALSE);
1436 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_mbr_up, tvb, newoffset3, 5, FALSE);
1438 newoffset3= newoffset3+5;
1439 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_mbr_down, tvb, newoffset3, 5, FALSE);
1441 newoffset3= newoffset3+5;
1442 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_gbr_up, tvb, newoffset3, 5, FALSE);
1444 newoffset3= newoffset3+5;
1445 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_qos_gbr_down, tvb, newoffset3, 5, FALSE);
1447 newoffset3= newoffset3+5;
1453 number = tvb_get_guint8(tvb,newoffset1)& 0x0f;
1454 opcode = tvb_get_guint8(tvb,newoffset1)& 0xe0;
1455 ebit = tvb_get_guint8(tvb,newoffset1)& 0x10;
1456 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_opcode, tvb, newoffset1, 1, FALSE);
1457 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_number, tvb, newoffset1, 1, FALSE);
1458 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_ebit, tvb, newoffset1, 1, FALSE);
1465 case CREATE_NEW_TFT:
1466 /* Create New TFT */
1467 case ADD_PACKET_FILTERS_TFT:
1468 /* Add packet filters to existing TFT */
1469 case REPLACE_PACKET_FILTERS_TFT:
1470 /*Replace Packet filters in existing TFT */
1474 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, newoffset1, 1, FALSE);
1475 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, newoffset1, 1, FALSE);
1477 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_eval, tvb, newoffset1, 1, FALSE);
1479 length1 =tvb_get_guint8(tvb,newoffset1);
1480 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_length, tvb, newoffset1, 1, FALSE);
1483 while (newoffset2<length1)
1485 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_comp_type, tvb, newoffset1, 1, FALSE);
1486 comptype = tvb_get_guint8(tvb,newoffset1);
1491 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4, tvb, newoffset1, 4, FALSE);
1492 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv4_mask, tvb, newoffset1, 4, FALSE);
1498 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6, tvb, newoffset1, 16, FALSE);
1499 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_ipv6_mask, tvb, newoffset1, 16, FALSE);
1505 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_prot_id, tvb, newoffset1, 1, FALSE);
1511 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_local, tvb, newoffset1, 2, FALSE);
1517 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_low, tvb, newoffset1, 2, FALSE);
1520 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_local_port_high, tvb, newoffset1, 2, FALSE);
1526 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_single_remote, tvb, newoffset1, 2, FALSE);
1532 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_low, tvb, newoffset1, 2, FALSE);
1535 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_remote_port_high, tvb, newoffset1, 2, FALSE);
1541 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_security, tvb, newoffset1, 4, FALSE);
1547 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type, tvb, newoffset1, 1, FALSE);
1548 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_service_type_mask, tvb, newoffset1, 1, FALSE);
1554 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_flow_label, tvb, offset, 3, FALSE);
1563 /* Delete Existing TFT */
1566 case DELETE_PACKET_FILTERS_TFT:
1567 /* Delete Packet filters from existing TFT */
1571 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_id, tvb, newoffset1, 1, FALSE);
1572 proto_tree_add_item(ie_tree, hf_gtpv2_b_tft_pf_direction, tvb, newoffset1, 1, FALSE);
1576 case NO_TFT_OPERATION:
1577 /* No TFT operation */
1591 v4 = tvb_get_guint8(tvb,newoffset)& 0x80;
1592 v6 = tvb_get_guint8(tvb,newoffset)& 0x40;
1594 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_v4, tvb, newoffset, 1, FALSE);
1595 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_v6, tvb, newoffset, 1, FALSE);
1596 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_interface_type, tvb, newoffset, 1, FALSE);
1598 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_gre_key, tvb, newoffset, 4, FALSE);
1599 newoffset= newoffset+4;
1602 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_ipv4, tvb, newoffset, 4, FALSE);
1603 newoffset= newoffset+4;
1607 proto_tree_add_item(ie_tree, hf_gtpv2_f_teid_ipv6, tvb, newoffset, 16, FALSE);
1608 newoffset= newoffset+16;
1614 proto_tree_add_item(ie_tree, hf_gtpv2_charging_id, tvb, offset, length, FALSE);
1619 proto_tree_add_item(ie_tree, hf_gtpv2_bearer_flag, tvb, offset, length, FALSE);
1624 proto_tree_add_text(ie_tree, tvb, 0, lengths, "IE data not dissected yet");
1628 /* Transaction Identifier */
1629 proto_tree_add_text(ie_tree, tvb, 0, lengths, "IE data not dissected yet");
1639 /* 8.29 Charging ID */
1641 dissect_gtpv2_charging_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1646 proto_tree_add_item(tree, hf_gtpv2_charging_id, tvb, offset, length, FALSE);
1652 /* 8.30 Charging Characteristics */
1655 dissect_gtpv2_charging_characteristic(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1660 proto_tree_add_item(tree, hf_gtpv2_charging_characteristic, tvb, offset, length, FALSE);
1664 /* 8.30 Bearer Flag */
1666 dissect_gtpv2_bearer_flag(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1671 proto_tree_add_item(tree, hf_gtpv2_bearer_flag, tvb, offset, length, FALSE);
1677 dissect_gtpv2_pdn_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1682 proto_tree_add_item(tree, hf_gtpv2_pdn_type, tvb, offset, length, FALSE);
1687 /* 8.31 Trace Information
1691 /* 8.35 Procedure Transaction ID (PTI) */
1693 dissect_gtpv2_pti(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1695 proto_tree_add_item(tree, hf_gtpv2_pti, tvb, 0, 1, FALSE);
1698 * 8.36 DRX Parameter
1699 * 8.37 UE Network Capability
1701 * 8.39 PDN Connection (grouped IE)
1703 * 8.41 Packet TMSI (P-TMSI)
1704 * 8.42 P-TMSI Signature
1708 /* 8.44 UE Time Zone */
1710 static const value_string gtpv2_ue_time_zone_dst_vals[] = {
1711 {0, "No Adjustments for Daylight Saving Time"},
1712 {1, "+1 Hour Adjustments for Daylight Saving Time"},
1713 {2, "+2 Hour Adjustments for Daylight Saving Time"},
1718 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_)
1722 proto_tree_add_item(tree, hf_gtpv2_ue_time_zone, tvb, offset, 1, FALSE);
1725 proto_tree_add_item(tree, hf_gtpv2_ue_time_zone_dst, tvb, offset, 1, FALSE);
1729 /* 8.45 Trace Reference
1730 * 8.56 Complete Request Message
1732 * 8.48 Fully Qualified Container (F-Container)
1733 * 8.49 Fully Qualified Cause (F-Cause)
1734 * 8.50 Selected PLMN ID
1735 * 8.51 Target Identification
1737 * 8.53 Packet Flow ID
1739 * 8.55 Source RNC PDCP context info
1740 * 8.56 UDP Source Port Number
1743 /*8.57 APN Restriction */
1745 dissect_gtpv2_apn_rest(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1747 proto_tree_add_item(tree, hf_gtpv2_apn_rest, tvb, 0, 1, FALSE);
1750 /* 8.58 Selection Mode */
1751 static const value_string gtpv2_selec_mode_vals[] = {
1752 {0, "MS or network provided APN, subscribed verified"},
1753 {1, "MS provided APN, subscription not verified"},
1754 {2, "Network provided APN, subscription not verified"},
1755 {3, "Network provided APN, subscription not verified (Basically for Future use"},
1760 dissect_gtpv2_selec_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1764 proto_tree_add_item(tree, hf_gtpv2_selec_mode, tvb, offset, 1, FALSE);
1768 /* 8.59 Source Identification */
1770 /* 8.60 Bearer Control Mode */
1771 static const value_string gtpv2_bearer_control_mode_vals[] = {
1772 {0, "Selected Bearer Control Mode-'MS_only'"},
1773 {1, "Selected Bearer Control Mode-'Network_only'"},
1774 {2, "Selected Bearer Control Mode-'MS/NW'"},
1779 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_)
1781 proto_tree_add_item(tree, hf_gtpv2_bearer_control_mode, tvb, 0, 1, FALSE);
1784 * 8.61 Change Reporting Action
1786 static const value_string gtpv2_cng_rep_act_vals[] = {
1787 {0, "Stop Reporting"},
1788 {1, "Start Reporting CGI/SAI"},
1789 {2, "Start Reporting RAI"},
1794 dissect_cng_rep_act(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1797 proto_tree_add_item(tree, hf_gtpv2_cng_rep_act, tvb, 0, 1, FALSE);
1800 * 8.62 Fully qualified PDN Connection Set Identifier (FQ-CSID)
1801 * 8.63 Channel needed
1802 * 8.64 eMLPP Priority
1806 static const value_string gtpv2_node_type_vals[] = {
1813 dissect_node_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, proto_item *item _U_, guint16 length _U_, guint8 instance _U_)
1816 proto_tree_add_item(tree, hf_gtpv2_node_type, tvb, 0, 1, FALSE);
1819 /* 8.66 Fully Qualified Domain Name (FQDN)
1820 * 8.67 Private Extension
1822 typedef struct _gtpv2_ie {
1824 void (*decode) (tvbuff_t *, packet_info *, proto_tree *, proto_item *, guint16, guint8);
1827 static const gtpv2_ie_t gtpv2_ies[] = {
1828 {GTPV2_IE_IMSI, dissect_gtpv2_imsi},
1829 {GTPV2_IE_CAUSE, dissect_gtpv2_cause}, /* 2, Cause (without embedded offending IE) 8.4 */
1830 {GTPV2_REC_REST_CNT, dissect_gtpv2_recovery}, /* 3, Recovery (Restart Counter) 8.5 */
1831 /* 4-50 Reserved for S101 interface Extendable / See 3GPP TS 29.276 [14] */
1832 /* 51-70 Reserved for Sv interface Extendable / See 3GPP TS 29.280 [15] */
1833 {GTPV2_APN, dissect_gtpv2_apn}, /* 71, Access Point Name (APN) 8.6 */
1834 {GTPV2_AMBR, dissect_gtpv2_ambr}, /* 72, Aggregate Maximum Bit Rate (AMBR) */
1835 {GTPV2_EBI, dissect_gtpv2_ebi}, /* 73, EPS Bearer ID (EBI) 8.8 */
1836 {GTPV2_IP_ADDRESS, dissect_gtpv2_ip_address}, /* 74, IP Address */
1837 {GTPV2_MEI, dissect_gtpv2_mei}, /* 74, Mobile Equipment Identity */
1838 {GTPV2_IE_MSISDN, dissect_gtpv2_msisdn}, /* 76, MSISDN 8.11 */
1839 {GTPV2_INDICATION, dissect_gtpv2_ind}, /* 77 Indication 8.12 */
1840 {GTPV2_PCO, dissect_gtpv2_pco}, /* 78 Protocol Configuration Options (PCO) 8.13 */
1841 {GTPV2_PAA, dissect_gtpv2_paa}, /* 79 PDN Address Allocation (PAA) 8.14 */
1842 {GTPV2_BEARER_QOS,dissect_gtpv2_bearer_qos}, /* 80 Bearer Level Quality of Service (Bearer QoS) 8.15 */
1843 {GTPV2_FLOW_QOS, dissect_gtpv2_flow_qos}, /* 81 Flow Quality of Service (Flow QoS) 8.16 */
1844 {GTPV2_IE_RAT_TYPE, dissect_gtpv2_rat_type}, /* 82, RAT Type 8.17 */
1845 {GTPV2_IE_SERV_NET, dissect_gtpv2_serv_net}, /* 83, Serving Network 8.18 */
1846 {GTPV2_BEARER_TFT, dissect_gtpv2_bearer_tft}, /* 84, Bearer TFT 8.19 */
1847 {GTPV2_TAD, dissect_gtpv2_tad}, /* 85, Traffic Aggregate Description 8.20 */
1848 {GTPV2_ULI, dissect_gtpv2_uli}, /* 86, User Location Info (ULI) 8.22 */
1849 {GTPV2_F_TEID, dissect_gtpv2_f_teid}, /* 87, Fully Qualified Tunnel Endpoint Identifier (F-TEID) 8.23 */
1850 {GTPV2_G_CN_ID, dissect_gtpv2_g_cn_id}, /* 89, Global CN-Id 8.25 */
1851 {GTPV2_DELAY_VALUE, dissect_gtpv2_delay_value}, /* 92, Delay Value 8.29 */
1852 {GTPV2_BEARER_CTX,dissect_gtpv2_bearer_ctx}, /* 93, Bearer Context 8.31 */
1853 {GTPV2_CHARGING_ID, dissect_gtpv2_charging_id}, /* 94, Charging Id */
1854 {GTPV2_CHARGING_CHARACTERISTIC, /* 95 Charging Characteristic */
1855 dissect_gtpv2_charging_characteristic},
1856 {GTPV2_BEARER_FLAG, dissect_gtpv2_bearer_flag}, /* 97, Bearer Flag */
1857 {GTPV2_PDN_TYPE, dissect_gtpv2_pdn_type}, /* 99, PDN Type */
1858 {GTPV2_PTI, dissect_gtpv2_pti}, /* 100 Procedure Transaction Id */
1859 {GTPV2_UE_TIME_ZONE, dissect_gtpv2_ue_time_zone}, /* 114, UE Time Zone */
1860 {GTPV2_APN_RESTRICTION, /* 127, APN Restriction */
1861 dissect_gtpv2_apn_rest},
1862 {GTPV2_SELEC_MODE,dissect_gtpv2_selec_mode}, /* 128 Selection Mode */
1863 {GTPV2_BEARER_CONTROL_MODE,
1864 dissect_gtpv2_bearer_control_mode}, /* 130 Bearer Control Mode*/
1865 {GTPV2_CNG_REP_ACT ,dissect_cng_rep_act}, /* 131 Change Reporting Action 8.61 */
1866 {GTPV2_NODE_TYPE ,dissect_node_type}, /* 135 Node Type 8.65 */
1867 /* 137-254 Spare. For future use. FFS */
1869 {0, dissect_gtpv2_unknown}
1875 dissect_gtpv2_ie_common(tvbuff_t * tvb, packet_info * pinfo _U_, proto_tree * tree, gint offset)
1877 proto_tree *ie_tree;
1880 guint8 type, instance;
1884 * Octets 8 7 6 5 4 3 2 1
1887 * 4 CR Spare Instance
1888 * 5-(n+4) IE specific data
1890 while(offset < (gint)tvb_reported_length(tvb)){
1891 /* Get the type and length */
1892 type = tvb_get_guint8(tvb,offset);
1893 length = tvb_get_ntohs(tvb, offset+1);
1894 ti = proto_tree_add_text(tree, tvb, offset, 4 + length, "%s : ", val_to_str(type, gtpv2_element_type_vals, "Unknown"));
1895 ie_tree = proto_item_add_subtree(ti, ett_gtpv2_ie);
1897 proto_tree_add_item(ie_tree, hf_gtpv2_ie, tvb, offset, 1, FALSE);
1901 proto_tree_add_item(ie_tree, hf_gtpv2_ie_len, tvb, offset, 2, FALSE);
1903 /* CR Spare Instance Octet 4*/
1904 proto_tree_add_item(ie_tree, hf_gtpv2_cr, tvb, offset, 1, FALSE);
1906 instance = tvb_get_guint8(tvb,offset)& 0x0f;
1907 proto_tree_add_item(ie_tree, hf_gtpv2_instance, tvb, offset, 1, FALSE);
1910 /* TODO: call IE dissector here */
1911 if(type==GTPV2_IE_RESERVED){
1912 /* Treat IE type zero specal as type zero is used to end the loop in the else branch */
1913 proto_tree_add_text(ie_tree, tvb, offset, length, "IE type Zero is Reserved and should not be used");
1916 /* Loop over the IE dissector list to se if we find an entry, the last entry will have ie_type=0 braking the loop */
1917 while (gtpv2_ies[++i].ie_type){
1918 if (gtpv2_ies[i].ie_type == type)
1921 /* Just give the IE dissector the IE */
1922 ie_tvb = tvb_new_subset(tvb, offset, length, length);
1923 (*gtpv2_ies[i].decode) (ie_tvb, pinfo , ie_tree, ti, length, instance);
1926 offset = offset + length;
1931 dissect_gtpv2(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree)
1933 proto_tree *gtpv2_tree, *flags_tree;
1934 proto_item *ti, *tf;
1935 guint8 message_type, t_flag;
1939 /* Currently we get called from the GTP dissector no need to check the version */
1940 if (check_col(pinfo->cinfo, COL_PROTOCOL))
1941 col_set_str(pinfo->cinfo, COL_PROTOCOL, "GTPv2");
1942 if (check_col(pinfo->cinfo, COL_INFO))
1943 col_clear(pinfo->cinfo, COL_INFO);
1945 /* message type is in octet 2 */
1946 message_type = tvb_get_guint8(tvb,1);
1947 if (check_col(pinfo->cinfo, COL_INFO))
1948 col_add_str(pinfo->cinfo, COL_INFO, val_to_str(message_type, gtpv2_message_type_vals, "Unknown"));
1951 proto_tree_add_item(tree, proto_gtpv2, tvb, offset, -1, FALSE);
1954 ti = proto_tree_add_text(tree, tvb, offset, -1, "%s", val_to_str(message_type, gtpv2_message_type_vals, "Unknown"));
1955 gtpv2_tree = proto_item_add_subtree(ti, ett_gtpv2);
1957 /* Control Plane GTP uses a variable length header. Control Plane GTP header
1958 * length shall be a multiple of 4 octets.
1959 * Figure 5.1-1 illustrates the format of the GTPv2-C Header.
1960 * Bits 8 7 6 5 4 3 2 1
1961 * Octets 1 Version Spare T Spare Spare Spare
1963 * 3 Message Length (1st Octet)
1964 * 4 Message Length (2nd Octet)
1965 * m-k(m+3) If T flag is set to 1, then TEID shall be placed into octets 5-8.
1966 * Otherwise, TEID field is not present at all.
1967 * n-(n+1) Sequence Number
1969 * Figure 5.1-1: General format of GTPv2 Header for Control Plane
1971 tf = proto_tree_add_item(gtpv2_tree, hf_gtpv2_flags, tvb, offset, 1, FALSE);
1972 flags_tree = proto_item_add_subtree(tf, ett_gtpv2_flags);
1975 t_flag = (tvb_get_guint8(tvb,offset) & 0x08)>>3;
1976 proto_tree_add_item(flags_tree, hf_gtpv2_version, tvb, offset, 1, FALSE);
1977 proto_tree_add_item(flags_tree, hf_gtpv2_t, tvb, offset, 1, FALSE);
1981 proto_tree_add_item(gtpv2_tree, hf_gtpv2_message_type, tvb, offset, 1, FALSE);
1984 proto_tree_add_item(gtpv2_tree, hf_gtpv2_msg_length, tvb, offset, 2, FALSE);
1988 /* Tunnel Endpoint Identifier 4 octets */
1989 proto_tree_add_item(gtpv2_tree, hf_gtpv2_teid, tvb, offset, 4, FALSE);
1992 /* Sequence Number 2 octets */
1993 proto_tree_add_item(gtpv2_tree, hf_gtpv2_seq, tvb, offset, 2, FALSE);
1996 /* Spare 2 octets */
1997 proto_tree_add_item(gtpv2_tree, hf_gtpv2_spare, tvb, offset, 2, FALSE);
2000 dissect_gtpv2_ie_common(tvb, pinfo, gtpv2_tree, offset);
2005 void proto_register_gtpv2(void)
2007 static hf_register_info hf_gtpv2[] = {
2009 {"Flags", "gtpv2.flags",
2010 FT_UINT8, BASE_DEC, NULL, 0x0,
2014 {"Version", "gtpv2.version",
2015 FT_UINT8, BASE_DEC, NULL, 0xe0,
2020 FT_UINT8, BASE_DEC, NULL, 0x08,
2021 "If TEID field is present or not", HFILL}
2023 { &hf_gtpv2_message_type,
2024 {"Message Type", "gtpv2.message_type",
2025 FT_UINT8, BASE_DEC, VALS(gtpv2_message_type_vals), 0x0,
2028 { &hf_gtpv2_msg_length,
2029 {"Message Length", "gtpv2.msg_lengt",
2030 FT_UINT16, BASE_DEC, NULL, 0x0,
2034 {"Tunnel Endpoint Identifier", "gtpv2.teid",
2035 FT_UINT32, BASE_DEC, NULL, 0x0,
2039 {"Sequence Number", "gtpv2.seq",
2040 FT_UINT32, BASE_DEC, NULL, 0x0,
2044 {"Spare", "gtpv2.spare",
2045 FT_UINT16, BASE_DEC, NULL, 0x0,
2049 {"IE Type", "gtpv2.ie_type",
2050 FT_UINT8, BASE_DEC, VALS(gtpv2_element_type_vals), 0x0,
2054 {"IE Length", "gtpv2.ie_len",
2055 FT_UINT16, BASE_DEC, NULL, 0x0,
2056 "length of the information element excluding the first four octets", HFILL}
2059 {"CR flag", "gtpv2.cr",
2060 FT_UINT8, BASE_DEC, NULL, 0xe0,
2063 { &hf_gtpv2_instance,
2064 {"Instance", "gtpv2.instance",
2065 FT_UINT8, BASE_DEC, NULL, 0x0f,
2069 {"IMSI(International Mobile Subscriber Identity number)", "gtpv2.imsi",
2070 FT_STRING, BASE_NONE, NULL, 0,
2074 {"Cause", "gtpv2.cause",
2075 FT_UINT8, BASE_DEC, VALS(gtpv2_cause_vals), 0x0,
2078 {&hf_gtpv2_cause_cs,
2079 {"Cause Source (CS: True-Error originated by remote node, False-Error originated by Node sending the Message)","gtpv2.cs",
2080 FT_BOOLEAN, 8, NULL, 0x01,
2084 {"Restart Counter", "gtpv2.rec",
2085 FT_UINT8, BASE_DEC, NULL, 0x0,
2089 {"APN (Access Point Name)", "gtp.apn",
2090 FT_STRING, BASE_NONE, NULL, 0x0,
2094 {"AMBR Uplink (Aggregate Maximum Bit Rate for Uplink)", "gtpv2.ambr_up",
2095 FT_UINT32, BASE_DEC, NULL, 0x0,
2098 {&hf_gtpv2_ambr_down,
2099 {"AMBR Downlink(Aggregate Maximum Bit Rate for Downlink)", "gtpv2.ambr_down",
2100 FT_UINT32, BASE_DEC, NULL, 0x0,
2104 {"EPS Bearer ID (EBI)", "gtpv2.ebi",
2105 FT_UINT8, BASE_DEC, NULL, 0x0f,
2108 { &hf_gtpv2_ip_address_ipv4,
2109 {"IP address IPv4", "gtpv2.ip_address_ipv4",
2110 FT_IPv4, BASE_NONE, NULL, 0x0,
2113 { &hf_gtpv2_ip_address_ipv6,
2114 {"IP address IPv6", "gtpv2.ip_address_ipv6",
2115 FT_IPv6, BASE_NONE, NULL, 0x0,
2119 {"MEI(Mobile Equipment Identity)", "gtpv2.mei",
2120 FT_STRING, BASE_NONE, NULL, 0,
2125 {"DAF (Dual Address Bearer Flag)", "gtpv2.daf",
2126 FT_BOOLEAN, 8, NULL, 0x80, "DAF", HFILL}
2129 {"DTF (Direct Tunnel Flag)","gtpv2.dtf",
2130 FT_BOOLEAN, 8, NULL, 0x40, "DTF", HFILL}
2133 {"HI (Handover Indication)", "gtpv2.hi",
2134 FT_BOOLEAN, 8, NULL, 0x20, "HI", HFILL}
2137 {"DFI (Direct Forwarding Indication)", "gtpv2.dfi",
2138 FT_BOOLEAN, 8, NULL, 0x10, "DFI", HFILL}
2141 {"OI (Operation Indication)","gtp.oi",
2142 FT_BOOLEAN, 8, NULL, 0x08, "OI", HFILL}
2145 {"ISRSI (Idle mode Signalling Reduction Supported Indication)", "gtpv2.isrsi",
2146 FT_BOOLEAN, 8, NULL, 0x04, "ISRSI", HFILL}
2149 {"ISRAI (Idle mode Signalling Reduction Activation Indication)", "gtpv2.israi",
2150 FT_BOOLEAN, 8, NULL, 0x02, "ISRAI", HFILL}
2153 {"SGWCI (SGW Change Indication)", "gtpv2.sgwci",
2154 FT_BOOLEAN, 8, NULL, 0x01, "SGWCI", HFILL}
2157 {"PT (Protocol Type)", "gtpv2.pt",
2158 FT_BOOLEAN, 8, NULL, 0x08, "PT", HFILL}
2161 {"TDI (Teardown Indication)", "gtpv2.tdi",
2162 FT_BOOLEAN, 8, NULL, 0x04, "TDI", HFILL}
2165 {"SI (Scope Indication)", "gtpv2.si",
2166 FT_BOOLEAN, 8, NULL, 0x02, "SI", HFILL}
2169 {"MSV (MS Validated)", "gtpv2.msv",
2170 FT_BOOLEAN, 8, NULL, 0x01, "MSV", HFILL}
2172 { &hf_gtpv2_pdn_type,
2173 {"PDN Type", "gtpv2.pdn_type",
2174 FT_UINT8, BASE_DEC, VALS(gtpv2_pdn_type_vals), 0x07,
2177 { &hf_gtpv2_pdn_ipv4,
2178 {"PDN IPv4", "gtpv2.pdn_ipv4",
2179 FT_IPv4, BASE_NONE, NULL, 0x0,
2182 { &hf_gtpv2_pdn_ipv6_len,
2183 {"IPv6 Prefix Length", "gtpv2.pdn_ipv6_len",
2184 FT_UINT8, BASE_DEC, NULL, 0x0,
2187 { &hf_gtpv2_pdn_ipv6,
2188 {"PDN IPv6", "gtpv2.pdn_ipv6",
2189 FT_IPv6, BASE_NONE, NULL, 0x0,
2192 {&hf_gtpv2_bearer_qos_pvi,
2193 {"PVI (Pre-emption Vulnerability)", "gtpv2.bearer_qos_pvi",
2194 FT_BOOLEAN, 8, NULL, 0x01,
2197 {&hf_gtpv2_bearer_qos_pl,
2198 {"PL (Priority Level)", "gtpv2.bearer_qos_pl",
2199 FT_UINT8, BASE_DEC, NULL, 0x3c,
2202 {&hf_gtpv2_bearer_qos_pci,
2203 {"PCI (Pre-emption Capability)", "gtpv2.bearer_qos_pci",
2204 FT_BOOLEAN, 8, NULL, 0x40,
2207 {&hf_gtpv2_bearer_qos_label_qci,
2208 {"Label (QCI)", "gtpv2.bearer_qos_label_qci",
2209 FT_UINT8, BASE_DEC, NULL, 0x0,
2212 {&hf_gtpv2_bearer_qos_mbr_up,
2213 {"Maximum Bit Rate For Uplink", "gtpv2.bearer_qos_mbr_up",
2214 FT_UINT64, BASE_DEC, NULL, 0x0,
2217 {&hf_gtpv2_bearer_qos_mbr_down,
2218 {"Maximum Bit Rate For Downlink", "gtpv2.bearer_qos_mbr_down",
2219 FT_UINT64, BASE_DEC, NULL, 0x0,
2222 {&hf_gtpv2_bearer_qos_gbr_up,
2223 {"Guaranteed Bit Rate For Uplink", "gtpv2.bearer_qos_gbr_up",
2224 FT_UINT64, BASE_DEC, NULL, 0x0,
2227 {&hf_gtpv2_bearer_qos_gbr_down,
2228 {"Guaranteed Bit Rate For Downlink", "gtpv2.bearer_qos_gbr_down",
2229 FT_UINT64, BASE_DEC, NULL, 0x0,
2232 {&hf_gtpv2_flow_qos_label_qci,
2233 {"Label (QCI)", "gtpv2.flow_qos_label_qci",
2234 FT_UINT8, BASE_DEC, NULL, 0x0,
2237 {&hf_gtpv2_flow_qos_mbr_up,
2238 {"Maximum Bit Rate For Uplink", "gtpv2.flow_qos_mbr_up",
2239 FT_UINT64, BASE_DEC, NULL, 0x0,
2242 {&hf_gtpv2_flow_qos_mbr_down,
2243 {"Maximum Bit Rate For Downlink", "gtpv2.flow_qos_mbr_down",
2244 FT_UINT64, BASE_DEC, NULL, 0x0,
2247 {&hf_gtpv2_flow_qos_gbr_up,
2248 {"Guaranteed Bit Rate For Uplink", "gtpv2.flow_qos_gbr_up",
2249 FT_UINT64, BASE_DEC, NULL, 0x0,
2252 {&hf_gtpv2_flow_qos_gbr_down,
2253 {"Guaranteed Bit Rate For Downlink", "gtpv2.flow_qos_gbr_down",
2254 FT_UINT64, BASE_DEC, NULL, 0x0,
2257 { &hf_gtpv2_rat_type,
2258 {"RAT Type", "gtpv2.rat_type",
2259 FT_UINT8, BASE_DEC, VALS(gtpv2_rat_type_vals), 0x0,
2262 {&hf_gtpv2_b_tft_opcode,
2263 {"Operation Code", "gtpv2.b_tft_opcode",
2264 FT_UINT8, BASE_DEC, VALS(gtpv2_opcode_vals), 0xe0,
2267 {&hf_gtpv2_b_tft_ebit,
2268 {"Ebit", "gtpv2.b_tft_ebit",
2269 FT_BOOLEAN, 8, NULL, 0x10,
2272 {&hf_gtpv2_b_tft_number,
2273 {"Number of Packet Filters", "gtpv2.b_tft_number",
2274 FT_UINT8, BASE_DEC, NULL, 0x0f,
2277 {&hf_gtpv2_b_tft_pf_id,
2278 {"Packet Filter Identifier", "gtpv2.b_tft_pf_id",
2279 FT_UINT8, BASE_DEC, NULL, 0x0f,
2282 {&hf_gtpv2_b_tft_pf_direction,
2283 {"Direction", "gtpv2.b_tft_pf_direction",
2284 FT_UINT8, BASE_DEC, VALS(gtpv2_direction_vals), 0x30,
2287 {&hf_gtpv2_b_tft_pf_eval,
2288 {"Evaluation Precedence", "gtpv2.b_tft_pf_eval",
2289 FT_UINT8, BASE_DEC, NULL, 0x0,
2292 {&hf_gtpv2_b_tft_pf_length,
2293 {"Length of Packet Filter", "gtpv2.b_tft_pf_length",
2294 FT_UINT8, BASE_DEC, NULL, 0x0,
2297 {&hf_gtpv2_b_tft_pf_comp_type,
2298 {"Component Type", "gtpv2.b_tft_pf_comp_type",
2299 FT_UINT8, BASE_DEC, VALS(gtpv2_comp_type_vals), 0x0,
2302 { &hf_gtpv2_b_tft_pf_ipv4,
2303 {"IPv4 address", "gtpv2.b_tft_pf_ipv4",
2304 FT_IPv4, BASE_NONE, NULL, 0x0,
2307 { &hf_gtpv2_b_tft_pf_ipv6,
2308 {"IPv6 address", "gtpv2.b_tft_pf_ipv6",
2309 FT_IPv6, BASE_NONE, NULL, 0x0,
2312 {&hf_gtpv2_b_tft_pf_ipv4_mask,
2313 {"IPV4 address mask field", "gtpv2.b_tft_pf_ipv4_mask",
2314 FT_UINT32, BASE_DEC, NULL, 0x0,
2317 {&hf_gtpv2_b_tft_pf_ipv6_mask,
2318 {"IPV6 address mask field", "gtpv2.b_tft_pf_ipv6_mask",
2319 FT_UINT32, BASE_DEC, NULL, 0x0,
2322 {&hf_gtpv2_b_tft_pf_prot_id,
2323 {"Protocol Identifier/Next Header type", "gtpv2.b_tft_pf_prot_id",
2324 FT_UINT8, BASE_DEC, NULL, 0x0,
2327 {&hf_gtpv2_b_tft_pf_single_local,
2328 {"Single Local port type", "gtpv2.b_tft_pf_single_local",
2329 FT_UINT16, BASE_DEC, NULL, 0x0,
2332 {&hf_gtpv2_b_tft_pf_local_port_low,
2333 {"Local port range low limit", "gtpv2.b_tft_pf_local_port_low",
2334 FT_UINT16, BASE_DEC, NULL, 0x0,
2337 {&hf_gtpv2_b_tft_pf_local_port_high,
2338 {"Local port range high limit", "gtpv2.b_tft_pf_local_port_high",
2339 FT_UINT16, BASE_DEC, NULL, 0x0,
2342 {&hf_gtpv2_b_tft_pf_single_remote,
2343 {"Single remote port type", "gtpv2.b_tft_pf_single_remote",
2344 FT_UINT16, BASE_DEC, NULL, 0x0,
2347 {&hf_gtpv2_b_tft_pf_remote_port_low,
2348 {"Remote port range low limit", "gtpv2.b_tft_pf_remote_port_low",
2349 FT_UINT16, BASE_DEC, NULL, 0x0,
2352 {&hf_gtpv2_b_tft_pf_remote_port_high,
2353 {"Remote port range high limit", "gtpv2.b_tft_pf_remote_port_high",
2354 FT_UINT16, BASE_DEC, NULL, 0x0,
2357 {&hf_gtpv2_b_tft_pf_security,
2358 {"Security Parameter Index", "gtpv2.b_tft_pf_security",
2359 FT_UINT8, BASE_DEC, NULL, 0x0,
2362 {&hf_gtpv2_b_tft_pf_service_type,
2363 {"Type of Service/Traffic Class type", "gtpv2.b_tft_pf_service_type",
2364 FT_UINT8, BASE_DEC, NULL, 0x0,
2367 {&hf_gtpv2_b_tft_pf_service_type_mask,
2368 {"Type of Service/Traffic Class mask", "gtpv2.b_tft_pf_service_type_mask",
2369 FT_UINT8, BASE_DEC, NULL, 0x0,
2372 {&hf_gtpv2_b_tft_pf_flow_label,
2373 {"Flow Label Type", "gtpv2.b_tft_pf_flow_label",
2374 FT_UINT32, BASE_DEC, NULL, 0,
2377 { &hf_gtpv2_uli_ecgi_flg,
2378 {"ECGI Present Flag)", "gtpv2.uli_ecgi_flg",
2379 FT_BOOLEAN, 8, NULL, 0x10,
2382 { &hf_gtpv2_uli_tai_flg,
2383 {"TAI Present Flag)", "gtpv2.uli_tai_flg",
2384 FT_BOOLEAN, 8, NULL, 0x08,
2387 { &hf_gtpv2_uli_rai_flg,
2388 {"RAI Present Flag)", "gtpv2.uli_rai_flg",
2389 FT_BOOLEAN, 8, NULL, 0x04,
2392 { &hf_gtpv2_uli_sai_flg,
2393 {"SAI Present Flag)", "gtpv2.uli_sai_flg",
2394 FT_BOOLEAN, 8, NULL, 0x02,
2397 { &hf_gtpv2_uli_cgi_flg,
2398 {"CGI Present Flag)", "gtpv2.uli_cgi_flg",
2399 FT_BOOLEAN, 8, NULL, 0x01,
2402 { &hf_gtpv2_uli_cgi_lac,
2403 {"Location Area Code", "gtpv2.uli_cgi_lac",
2404 FT_UINT16, BASE_DEC, NULL, 0x0,
2407 { &hf_gtpv2_uli_cgi_ci,
2408 {"Cell Identity", "gtpv2.uli_cgi_ci",
2409 FT_UINT16, BASE_DEC, NULL, 0x0,
2412 { &hf_gtpv2_uli_sai_lac,
2413 {"Location Area Code", "gtpv2.uli_sai_lac",
2414 FT_UINT16, BASE_DEC, NULL, 0x0,
2417 { &hf_gtpv2_uli_sai_sac,
2418 {"Service Area Code", "gtpv2.uli_sai_sac",
2419 FT_UINT16, BASE_DEC, NULL, 0x0,
2422 { &hf_gtpv2_uli_rai_lac,
2423 {"Location Area Code", "gtpv2.uli_rai_lac",
2424 FT_UINT16, BASE_DEC, NULL, 0x0,
2427 { &hf_gtpv2_uli_rai_rac,
2428 {"Routing Area Code", "gtpv2.uli_rai_rac",
2429 FT_UINT16, BASE_DEC, NULL, 0x0,
2432 { &hf_gtpv2_uli_tai_tac,
2433 {"Tracking Area Code", "gtpv2.uli_tai_tac",
2434 FT_UINT16, BASE_DEC, NULL, 0x0,
2437 {&hf_gtpv2_uli_ecgi_eci,
2438 {"ECI (E-UTRAN Cell Identifier)", "gtpv2.uli_ecgi_eci",
2439 FT_DOUBLE, BASE_DEC, NULL, 0,
2442 {&hf_gtpv2_f_teid_v4,
2443 {"V4 (True-IPV4 address field Exists,False-Doesn't Exist in F-TEID)", "gtpv2.f_teid_v4",
2444 FT_BOOLEAN, 8, NULL, 0x80,
2447 {&hf_gtpv2_f_teid_v6,
2448 {"V6 (True-IPV6 address field Exists,False-Doesn't Exist in F-TEID)", "gtpv2.f_teid_v6",
2449 FT_BOOLEAN, 8, NULL, 0x40,
2452 {&hf_gtpv2_f_teid_interface_type,
2453 {"Interface Type", "gtpv2.f_teid_interface_type",
2454 FT_UINT8, BASE_DEC, VALS(gtpv2_f_teid_interface_type_vals), 0x1f,
2457 {&hf_gtpv2_f_teid_gre_key,
2458 {"TEID/GRE Key", "gtpv2.f_teid_gre_key",
2459 FT_UINT32, BASE_DEC, NULL, 0x0,
2462 { &hf_gtpv2_f_teid_ipv4,
2463 {"F-TEID IPv4", "gtpv2.f_teid_ipv4",
2464 FT_IPv4, BASE_NONE, NULL, 0x0,
2467 { &hf_gtpv2_f_teid_ipv6,
2468 {"F-TEID IPv6", "gtpv2.f_teid_ipv6",
2469 FT_IPv6, BASE_NONE, NULL, 0x0,
2472 {&hf_gtpv2_delay_value,
2473 {"Delay Value (In integer multiples of 50 milliseconds or zero)", "gtpv2.delay_value",
2474 FT_UINT8, BASE_DEC, NULL, 0x0,
2477 {&hf_gtpv2_charging_id,
2478 {"Charging id", "gtpv2.charging_id",
2479 FT_UINT32, BASE_DEC, NULL, 0x0,
2482 {&hf_gtpv2_charging_characteristic,
2483 {"Charging Characteristic", "gtpv2.charging_characteristic",
2484 FT_UINT16, BASE_DEC, NULL, 0x0,
2487 {&hf_gtpv2_bearer_flag,
2488 {"Bearer Flags(PPC(Prohibit Payload Compression) True-SGSN attempts to compress the payload, False-SGSN doesn't attempt to compress the payload)",
2489 "gtpv2.bearer_flag",
2490 FT_BOOLEAN, 8, NULL, 0x01,
2494 {"Procedure Transaction Id", "gtpv2.pti",
2495 FT_UINT8, BASE_DEC, NULL, 0x0,
2498 {&hf_gtpv2_ue_time_zone,
2499 {"Time Zone","gtpv2.ue_time_zone",
2500 FT_UINT8, BASE_DEC, NULL,0x0,
2503 {&hf_gtpv2_ue_time_zone_dst,
2504 {"Daylight Saving Time","gtpv2.ue_time_zone_dst",
2505 FT_UINT8, BASE_DEC, VALS(gtpv2_ue_time_zone_dst_vals),0x03,
2508 {&hf_gtpv2_apn_rest,
2509 {"APN Restriction", "gtpv2.apn_rest",
2510 FT_UINT8, BASE_DEC, NULL, 0x0,
2513 {&hf_gtpv2_selec_mode,
2514 {"Selection Mode","gtpv2.selec_mode",
2515 FT_UINT8, BASE_DEC, VALS(gtpv2_selec_mode_vals),0x03,
2518 {&hf_gtpv2_bearer_control_mode,
2519 {"Bearer Control Mode","gtpv2.bearer_control_mode",
2520 FT_UINT8, BASE_DEC, VALS(gtpv2_bearer_control_mode_vals),0x0,
2523 { &hf_gtpv2_cng_rep_act,
2524 {"Change Reporting Action", "gtpv2.cng_rep_act",
2525 FT_UINT8, BASE_DEC, VALS(gtpv2_cng_rep_act_vals), 0x0,
2528 { &hf_gtpv2_node_type,
2529 {"Node Type", "gtpv2.node_type",
2530 FT_UINT8, BASE_DEC, VALS(gtpv2_node_type_vals), 0x0,
2536 static gint *ett_gtpv2_array[] = {
2542 proto_gtpv2 = proto_register_protocol("GPRS Tunneling Protocol V2", "GTPv2", "gtpv2");
2543 proto_register_field_array(proto_gtpv2, hf_gtpv2, array_length(hf_gtpv2));
2544 proto_register_subtree_array(ett_gtpv2_array, array_length(ett_gtpv2_array));
2546 register_dissector("gtpv2", dissect_gtpv2, proto_gtpv2);
2549 /* The registration hand-off routine */
2551 proto_reg_handoff_gtpv2(void)