Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
[metze/wireshark/wip.git] / epan / dissectors / packet-diameter_3gpp.c
1 /* packet-diameter_3gpp.c
2  * Routines for dissecting 3GPP OctetSting AVP:s
3  * Copyright 2008, Anders Broman <anders.broman[at]ericsson.com>
4  *
5  * Wireshark - Network traffic analyzer
6  * By Gerald Combs <gerald@wireshark.org>
7  * Copyright 1998 Gerald Combs
8  *
9  * This program is free software; you can redistribute it and/or
10  * modify it under the terms of the GNU General Public License
11  * as published by the Free Software Foundation; either version 2
12  * of the License, or (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU General Public License for more details.
18  *
19  * You should have received a copy of the GNU General Public License
20  * along with this program; if not, write to the Free Software
21  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22  */
23
24  /* This dissector registers a dissector table for 3GPP Vendor specific
25   * AVP:s which will be called from the Diameter dissector to dissect
26   * the content of AVP:s of the OctetString type(or similar).
27   */
28
29 #include "config.h"
30
31 #include <glib.h>
32
33 #include <epan/packet.h>
34 #include <epan/asn1.h>
35
36 #include "packet-diameter.h"
37 #include "packet-gsm_map.h"
38 #include "packet-gsm_a_common.h"
39 #include "packet-e164.h"
40 #include "packet-e212.h"
41 #include "packet-ntp.h"
42
43 void proto_register_diameter_3gpp(void);
44 void proto_reg_handoff_diameter_3gpp(void);
45
46 /* Initialize the protocol and registered fields */
47 static int proto_diameter_3gpp          = -1;
48
49 static int hf_diameter_3gpp_visited_nw_id           = -1;
50 static int hf_diameter_3gpp_msisdn                  = -1;
51 static int hf_diameter_3gpp_path                    = -1;
52 static int hf_diameter_3gpp_contact                 = -1;
53 /* static int hf_diameter_3gpp_user_data               = -1; */
54 static int hf_diameter_3gpp_ipaddr                  = -1;
55 static int hf_diameter_3gpp_mbms_required_qos_prio  = -1;
56 static int hf_diameter_3gpp_tmgi                    = -1;
57 static int hf_diameter_3gpp_service_ind             = -1;
58 static int hf_diameter_mbms_service_id              = -1;
59 static int hf_diameter_address_digits = -1;
60 static int hf_diameter_3gpp_spare_bits = -1;
61 static int hf_diameter_3gpp_uar_flags_flags = -1;
62 static int hf_diameter_3gpp_uar_flags_flags_bit0 = -1;
63 static int hf_diameter_3gpp_feature_list_flags = -1;
64 static int hf_diameter_3gpp_feature_list_flags_bit0 = -1;
65 static int hf_diameter_3gpp_feature_list_flags_bit1 = -1;
66 static int hf_diameter_3gpp_feature_list_flags_bit2 = -1;
67 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit0 = -1;
68 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit1 = -1;
69 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit2 = -1;
70 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit3 = -1;
71 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit4 = -1;
72 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit5 = -1;
73 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit6 = -1;
74 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit7 = -1;
75 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit8 = -1;
76 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit9 = -1;
77 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit10 = -1;
78 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit11 = -1;
79 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit12 = -1;
80 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit13 = -1;
81 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit14 = -1;
82 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit15 = -1;
83 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit16 = -1;
84 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit17 = -1;
85 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit18 = -1;
86 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit19 = -1;
87 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit20 = -1;
88 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit21 = -1;
89 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit22 = -1;
90 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit23 = -1;
91 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit24 = -1;
92 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit25 = -1;
93 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit26 = -1;
94 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit27 = -1;
95 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit28 = -1;
96 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit29 = -1;
97 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit30 = -1;
98 static int hf_diameter_3gpp_feature_list1_s6a_flags_bit31 = -1;
99 static int hf_diameter_3gpp_feature_list2_s6a_flags_bit0 = -1;
100 static int hf_diameter_3gpp_feature_list2_s6a_flags_bit1 = -1;
101 static int hf_diameter_3gpp_feature_list_gx_flags_bit0 = -1;
102 static int hf_diameter_3gpp_feature_list_gx_flags_bit1 = -1;
103 static int hf_diameter_3gpp_feature_list_gx_flags_bit2 = -1;
104 static int hf_diameter_3gpp_feature_list_gx_flags_bit3 = -1;
105 static int hf_diameter_3gpp_feature_list_gx_flags_bit4 = -1;
106 static int hf_diameter_3gpp_feature_list_gx_flags_bit5 = -1;
107 static int hf_diameter_3gpp_feature_list_gx_flags_bit6 = -1;
108 static int hf_diameter_3gpp_feature_list_gx_flags_bit7 = -1;
109 static int hf_diameter_3gpp_feature_list_gx_flags_bit8 = -1;
110 static int hf_diameter_3gpp_feature_list_gx_flags_bit9 = -1;
111 static int hf_diameter_3gpp_feature_list_gx_flags_bit10 = -1;
112 static int hf_diameter_3gpp_feature_list_gx_flags_bit11 = -1;
113 static int hf_diameter_3gpp_feature_list_gx_flags_bit12 = -1;
114 static int hf_diameter_3gpp_ulr_flags = -1;
115 static int hf_diameter_3gpp_ulr_flags_bit0 = -1;
116 static int hf_diameter_3gpp_ulr_flags_bit1 = -1;
117 static int hf_diameter_3gpp_ulr_flags_bit2 = -1;
118 static int hf_diameter_3gpp_ulr_flags_bit3 = -1;
119 static int hf_diameter_3gpp_ulr_flags_bit4 = -1;
120 static int hf_diameter_3gpp_ulr_flags_bit5 = -1;
121 static int hf_diameter_3gpp_ulr_flags_bit6 = -1;
122 static int hf_diameter_3gpp_ulr_flags_bit7 = -1;
123 static int hf_diameter_3gpp_ula_flags = -1;
124 static int hf_diameter_3gpp_ula_flags_bit0 = -1;
125 static int hf_diameter_3gpp_dsr_flags = -1;
126 static int hf_diameter_3gpp_dsr_flags_bit0 = -1;
127 static int hf_diameter_3gpp_dsr_flags_bit1 = -1;
128 static int hf_diameter_3gpp_dsr_flags_bit2 = -1;
129 static int hf_diameter_3gpp_dsr_flags_bit3 = -1;
130 static int hf_diameter_3gpp_dsr_flags_bit4 = -1;
131 static int hf_diameter_3gpp_dsr_flags_bit5 = -1;
132 static int hf_diameter_3gpp_dsr_flags_bit6 = -1;
133 static int hf_diameter_3gpp_dsr_flags_bit7 = -1;
134 static int hf_diameter_3gpp_dsr_flags_bit8 = -1;
135 static int hf_diameter_3gpp_dsr_flags_bit9 = -1;
136 static int hf_diameter_3gpp_dsr_flags_bit10 = -1;
137 static int hf_diameter_3gpp_dsr_flags_bit11 = -1;
138 static int hf_diameter_3gpp_dsr_flags_bit12 = -1;
139 static int hf_diameter_3gpp_dsr_flags_bit13 = -1;
140 static int hf_diameter_3gpp_dsr_flags_bit14 = -1;
141 static int hf_diameter_3gpp_dsr_flags_bit15 = -1;
142 static int hf_diameter_3gpp_dsr_flags_bit16 = -1;
143 static int hf_diameter_3gpp_dsa_flags = -1;
144 static int hf_diameter_3gpp_dsa_flags_bit0 = -1;
145 static int hf_diameter_3gpp_ida_flags = -1;
146 static int hf_diameter_3gpp_ida_flags_bit0 = -1;
147 static int hf_diameter_3gpp_pua_flags = -1;
148 static int hf_diameter_3gpp_pua_flags_bit0 = -1;
149 static int hf_diameter_3gpp_pua_flags_bit1 = -1;
150 static int hf_diameter_3gpp_nor_flags = -1;
151 static int hf_diameter_3gpp_nor_flags_bit0 = -1;
152 static int hf_diameter_3gpp_nor_flags_bit1 = -1;
153 static int hf_diameter_3gpp_nor_flags_bit2 = -1;
154 static int hf_diameter_3gpp_nor_flags_bit3 = -1;
155 static int hf_diameter_3gpp_nor_flags_bit4 = -1;
156 static int hf_diameter_3gpp_nor_flags_bit5 = -1;
157 static int hf_diameter_3gpp_nor_flags_bit6 = -1;
158 static int hf_diameter_3gpp_idr_flags = -1;
159 static int hf_diameter_3gpp_idr_flags_bit0 = -1;
160 static int hf_diameter_3gpp_idr_flags_bit1 = -1;
161 static int hf_diameter_3gpp_idr_flags_bit2 = -1;
162 static int hf_diameter_3gpp_idr_flags_bit3 = -1;
163 static int hf_diameter_3gpp_idr_flags_bit4 = -1;
164 static int hf_diameter_3gpp_idr_flags_bit5 = -1;
165 static int hf_diameter_3gpp_idr_flags_bit6 = -1;
166 static int hf_diameter_3gpp_ipv6addr = -1;
167 static int hf_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer = -1;
168 static int hf_diameter_3gpp_udp_port = -1;
169 static gint diameter_3gpp_path_ett = -1;
170 static gint diameter_3gpp_msisdn_ett = -1;
171 static gint diameter_3gpp_feature_list_ett = -1;
172 static gint diameter_3gpp_uar_flags_ett = -1;
173 static gint diameter_3gpp_tmgi_ett  = -1;
174 static gint diameter_3gpp_ulr_flags_ett = -1;
175 static gint diameter_3gpp_ula_flags_ett = -1;
176 static gint diameter_3gpp_dsr_flags_ett = -1;
177 static gint diameter_3gpp_dsa_flags_ett = -1;
178 static gint diameter_3gpp_ida_flags_ett = -1;
179 static gint diameter_3gpp_pua_flags_ett = -1;
180 static gint diameter_3gpp_nor_flags_ett = -1;
181 static gint diameter_3gpp_idr_flags_ett = -1;
182
183 /* Dissector handles */
184 static dissector_handle_t xml_handle;
185
186 /* AVP Code: 23 3GPP-MS-TimeZone
187  * 3GPP TS 29.061
188  */
189 static const value_string daylight_saving_time_vals[] = {
190     {0, "No adjustment"},
191     {1, "+1 hour adjustment for Daylight Saving Time"},
192     {2, "+2 hours adjustment for Daylight Saving Time"},
193     {3, "Reserved"},
194     {0, NULL}
195 };
196
197 static int
198 dissect_diameter_3gpp_ms_timezone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
199 {
200     int offset = 0;
201     guint8      oct, hours, minutes;
202     char        sign;
203     diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
204
205     /* 3GPP TS 23.040 version 6.6.0 Release 6
206      * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
207      * :
208      * The Time Zone indicates the difference, expressed in quarters of an hour,
209      * between the local time and GMT. In the first of the two semi-octets,
210      * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
211      * represents the algebraic sign of this difference (0: positive, 1: negative).
212      */
213
214     oct = tvb_get_guint8(tvb, offset);
215     sign = (oct & 0x08) ? '-' : '+';
216     oct = (oct >> 4) + (oct & 0x07) * 10;
217         hours =  oct / 4;
218         minutes = oct % 4 * 15;
219
220     proto_tree_add_text(tree, tvb, offset, 1, "Timezone: GMT %c %d hours %d minutes", sign, hours, minutes);
221     offset++;
222
223     oct = tvb_get_guint8(tvb, offset) & 0x3;
224     proto_tree_add_text(tree, tvb, offset, 1, "%s", val_to_str_const(oct, daylight_saving_time_vals, "Unknown"));
225     offset++;
226
227     diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "Timezone: GMT %c %d hours %d minutes %s", 
228         sign, 
229         hours, 
230         minutes,
231         val_to_str_const(oct, daylight_saving_time_vals, "Unknown"));
232
233     return offset;
234 }
235
236 /* AVP Code: 917 MBMS-GGSN-IPv6-Address */
237 static int
238 dissect_diameter_3gpp_ipv6addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
239 {
240     int offset = 0;
241
242     proto_tree_add_item(tree, hf_diameter_3gpp_ipv6addr, tvb, offset, 16, ENC_NA);
243
244     offset += 16;
245
246     return offset;
247 }
248
249 /* AVP Code: 15 3GPP-SGSN-IPv6-Address */
250 static int
251 dissect_diameter_3gpp_sgsn_ipv6_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
252 {
253     /* 3GPP AVP code 15 has a conflict between imscxdx.xml (where the AVP
254      * contains an Unsigned32 enum) and TGPPGmb.xml (where the AVP contains
255      * an OctetString IPv6 address).  This function decodes the latter; we
256      * (silently) abort dissection if the length is 4 on the assumption that
257      * the old IMS AVP is what we're decoding.
258      */
259     if (tvb_reported_length(tvb) == 4)
260         return 4;
261
262     return dissect_diameter_3gpp_ipv6addr(tvb, pinfo, tree, data);
263
264 }
265
266 /* AVP Code: 600 Visited-Network-Identifier
267  * imscxdx.xml
268  * 6.3.1 Visited-Network-Identifier AVP
269  * The Visited-Network-Identifier AVP is of type OctetString. This AVP contains an identifier that helps the home
270  * network to identify the visited network (e.g. the visited network domain name).
271  */
272
273 static int
274 dissect_diameter_3gpp_visited_nw_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
275
276     proto_item* item;
277     int offset = 0, i;
278     int length = tvb_length(tvb);
279
280     for(i = 0; i < length; i++)
281         if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
282             return length;
283
284     item = proto_tree_add_item(tree, hf_diameter_3gpp_visited_nw_id, tvb, offset, length, ENC_ASCII|ENC_NA);
285     PROTO_ITEM_SET_GENERATED(item);
286
287
288     return length;
289 }
290
291 /* AVP Code: 629 Feature-List-id
292  * Feature list Id is neede to dissect Feature list in S6a/S6d application
293  * Ref 3GPP TS 29.272
294  */
295
296 static int
297 dissect_diameter_3gpp_feature_list_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void *data)
298 {
299     diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data;
300
301     if(diam_sub_dis_inf){
302         diam_sub_dis_inf->feature_list_id = tvb_get_ntohl(tvb,0);
303     }
304
305         return 4;
306 }
307
308 /* AVP Code: 637 UAR-Flags
309  * imscxdx.xml
310  * IMS Cx Dx AVPS 3GPP TS 29.229
311  */
312
313 static int
314 dissect_diameter_3gpp_uar_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
315
316     proto_item* item;
317     proto_tree *sub_tree;
318     int offset = 0;
319     guint32 bit_offset;
320
321     item       = proto_tree_add_item(tree, hf_diameter_3gpp_uar_flags_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
322     sub_tree   = proto_item_add_subtree(item, diameter_3gpp_uar_flags_ett);
323
324     bit_offset = 0;
325     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 31, ENC_BIG_ENDIAN);
326     bit_offset+=31;
327     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_uar_flags_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
328     bit_offset++;
329
330     offset = bit_offset>>3;
331
332     return offset;
333 }
334
335 /* AVP Code: 630 Feature-List
336  * Interpretation depends on Application Id
337  * imscxdx.xml
338  * IMS Cx Dx AVPS 3GPP TS 29.229
339  */
340
341 static int
342 dissect_diameter_3gpp_feature_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data) {
343
344     proto_item* item;
345     proto_tree *sub_tree;
346     int offset = 0;
347     guint32 bit_offset, application_id = 0, feature_list_id = 0;
348     diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data;
349
350     item       = proto_tree_add_item(tree, hf_diameter_3gpp_feature_list_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
351     sub_tree   = proto_item_add_subtree(item, diameter_3gpp_feature_list_ett);
352
353     if(diam_sub_dis_inf){
354         application_id = diam_sub_dis_inf->application_id;
355         feature_list_id = diam_sub_dis_inf->feature_list_id;
356     }
357     bit_offset = 0;
358     if(application_id == 16777216){
359         /* ApplicationId: 3GPP Cx (16777216) */
360         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 29, ENC_BIG_ENDIAN);
361         bit_offset+=29;
362         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_flags_bit2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
363         bit_offset++;
364         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
365         bit_offset++;
366         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
367         bit_offset++;
368
369         /*offset = bit_offset>>3;*/
370     }else if(application_id == 16777251){
371         /* ApplicationId: 3GPP S6a/S6d */
372         if(feature_list_id == 1){
373             /* 3GPP TS 29.272 Table 7.3.10/1: Features of Feature-List-ID 1 used in S6a/S6d */
374             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit31, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
375             bit_offset++;
376             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit30, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
377             bit_offset++;
378             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit29, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
379             bit_offset++;
380             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit28, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
381             bit_offset++;
382             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit27, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
383             bit_offset++;
384             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit26, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
385             bit_offset++;
386             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit25, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
387             bit_offset++;
388             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit24, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
389             bit_offset++;
390             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit23, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
391             bit_offset++;
392             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit22, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
393             bit_offset++;
394             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit21, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
395             bit_offset++;
396             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit20, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
397             bit_offset++;
398             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit19, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
399             bit_offset++;
400             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit18, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
401             bit_offset++;
402             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit17, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
403             bit_offset++;
404             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit16, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
405             bit_offset++;
406             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit15, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
407             bit_offset++;
408             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit14, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
409             bit_offset++;
410             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit13, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
411             bit_offset++;
412             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit12, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
413             bit_offset++;
414             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit11, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
415             bit_offset++;
416             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit10, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
417             bit_offset++;
418             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit9, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
419             bit_offset++;
420             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit8, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
421             bit_offset++;
422             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit7, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
423             bit_offset++;
424             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit6, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
425             bit_offset++;
426             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit5, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
427             bit_offset++;
428             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit4, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
429             bit_offset++;
430             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit3, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
431             bit_offset++;
432             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
433             bit_offset++;
434             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
435             bit_offset++;
436             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list1_s6a_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
437         }else if(feature_list_id == 2){
438             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 30, ENC_BIG_ENDIAN);
439             bit_offset+=30;
440             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list2_s6a_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
441             bit_offset++;
442             proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list2_s6a_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
443         }
444     }else if(application_id == 16777238){
445         /* ApplicationId: 3GPP Gx */
446         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 19, ENC_BIG_ENDIAN);
447         bit_offset+=19;
448         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit12, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
449         bit_offset++;
450         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit11, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
451         bit_offset++;
452         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit10, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
453         bit_offset++;
454         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit9, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
455         bit_offset++;
456         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit8, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
457         bit_offset++;
458         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit7, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
459         bit_offset++;
460         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit6, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
461         bit_offset++;
462         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit5, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
463         bit_offset++;
464         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit4, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
465         bit_offset++;
466         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit3, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
467         bit_offset++;
468         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
469         bit_offset++;
470         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
471         bit_offset++;
472         proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_feature_list_gx_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
473         bit_offset++;
474     }
475     return 4;
476
477 }
478
479 /* AVP Code: 640 Path
480  * imscxdx.xml
481  * IMS Cx Dx AVPS 3GPP TS 29.229
482  * 6.3.47 Path AVP
483  * The Path AVP is of type OctetString and it contains a comma separated list of SIP proxies in the Path header as defined
484  * in IETF RFC 3327 [17].
485  */
486 static int
487 dissect_diameter_3gpp_path(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
488
489     proto_item* item;
490     proto_tree *sub_tree;
491     int offset = 0, comma_offset;
492     int end_offset = tvb_length(tvb) - 1;
493
494     item = proto_tree_add_text(tree, tvb, offset, -1,"Paths");
495     sub_tree = proto_item_add_subtree(item,diameter_3gpp_path_ett);
496
497     while (offset < end_offset){
498         comma_offset = tvb_find_guint8(tvb, offset, -1, ',');
499         if(comma_offset == -1){
500             proto_tree_add_item(sub_tree, hf_diameter_3gpp_path, tvb, offset, comma_offset, ENC_ASCII|ENC_NA);
501             return end_offset;
502         }
503         proto_tree_add_item(sub_tree, hf_diameter_3gpp_path, tvb, offset, comma_offset, ENC_ASCII|ENC_NA);
504         offset = comma_offset+1;
505     }
506
507
508     return tvb_length(tvb);
509 }
510
511 /* AVP Code: 641 Contact
512  * imscxdx.xml
513  * IMS Cx Dx AVPS 3GPP TS 29.229
514  * 6.3.48 Contact AVP
515  * The Contact AVP is of type OctetString and it contains the Contact Addresses and Parameters in the Contact header as
516  * defined in IETF RFC 3261.
517  */
518 static int
519 dissect_diameter_3gpp_contact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
520
521     proto_item* item;
522     int offset = 0;
523
524     item = proto_tree_add_item(tree, hf_diameter_3gpp_contact, tvb, offset, -1, ENC_ASCII|ENC_NA);
525     PROTO_ITEM_SET_GENERATED(item);
526
527     return tvb_length(tvb);
528 }
529
530 /* AVP Code: 701 MSISDN */
531 static int
532 dissect_diameter_3gpp_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
533
534     proto_item* item;
535     proto_tree *sub_tree;
536     int offset = 0;
537     const char     *digit_str;
538     int length = tvb_length(tvb);
539
540     item = proto_tree_add_item(tree, hf_diameter_3gpp_msisdn, tvb, offset, length, ENC_NA);
541     sub_tree = proto_item_add_subtree(item,diameter_3gpp_msisdn_ett);
542
543     dissect_e164_cc(tvb, sub_tree, offset, TRUE);
544
545     digit_str = unpack_digits(tvb, 1);
546     proto_tree_add_string(sub_tree, hf_diameter_address_digits, tvb, 1, -1, digit_str);
547
548     return tvb_length(tvb);
549
550 }
551
552 /* AVP Code: 702 User-Data
553  * TGPPSh.xml
554  * The AVP codes from 709 to799 are reserved for TS 29.329
555  */
556 /* AVP Code: 606 User-Data
557  * imscxdx.xml
558  * IMS Cx Dx AVPS 3GPP TS 29.229
559  */
560 static int
561 dissect_diameter_3gpp_user_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
562
563     int length = tvb_length(tvb);
564
565     /* If there is less than 38 characters this is not XML
566      * <?xml version="1.0" encoding="UTF-8"?>
567      */
568     if(length < 38)
569         return length;
570
571     if (tvb_strncaseeql(tvb, 0, "<?xml", 5) == 0){
572         call_dissector(xml_handle, tvb, pinfo, tree);
573     }
574
575     return length;
576
577 }
578
579 /*
580  * AVP Code: 704 Service-Indication
581  */
582 static int
583 dissect_diameter_3gpp_service_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
584
585     proto_item* item;
586     int offset = 0, i;
587     int length = tvb_length(tvb);
588
589     for(i = 0; i < length; i++)
590         if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
591             return length;
592
593     item = proto_tree_add_item(tree, hf_diameter_3gpp_service_ind, tvb, offset, length, ENC_ASCII|ENC_NA);
594     PROTO_ITEM_SET_GENERATED(item);
595
596     return length;
597 }
598
599 /* AVP Code: 900 TMGI */
600 static int
601 dissect_diameter_3gpp_tmgi(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
602
603     proto_item* item;
604     proto_tree *sub_tree;
605     int offset = 0;
606
607     item = proto_tree_add_item(tree, hf_diameter_3gpp_tmgi, tvb, offset, 6, ENC_NA);
608     sub_tree = proto_item_add_subtree(item,diameter_3gpp_tmgi_ett);
609
610     /* MBMS Service ID consisting of three octets. MBMS Service ID consists of a 6-digit
611      * fixed-length hexadecimal number between 000000 and FFFFFF.
612      * MBMS Service ID uniquely identifies an MBMS bearer service within a PLMN.
613      */
614
615     proto_tree_add_item(sub_tree, hf_diameter_mbms_service_id, tvb, offset, 3, ENC_BIG_ENDIAN);
616     offset = offset+3;
617     offset = dissect_e212_mcc_mnc(tvb, pinfo, sub_tree, offset, TRUE);
618
619     return offset;
620
621 }
622
623 /* AVP Code: 903 MBMS-Service-Area */
624
625 /* AVP Code: 918 MBMS-BMSC-SSM-IP-Address */
626 static int
627 dissect_diameter_3gpp_ipaddr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
628
629     int offset = 0;
630
631     proto_tree_add_item(tree, hf_diameter_3gpp_ipaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
632     offset += 4;
633
634     return offset;
635
636 }
637
638 /* AVP Code: 903 RAI AVP 
639  * 17.7.12 RAI AVP
640  * The RAI AVP (AVP Code 909) is of type UTF8String, and contains the Routing Area Identity of the SGSN where the
641  * UE is registered. RAI use and structure is specified in 3GPP TS 23.003 [40].
642  * Its value shall be encoded as a UTF-8 string on either 11 (if the MNC contains two digits) or 12 (if the MNC contains
643  * three digits) octets as follows:
644  * - The MCC shall be encoded first using three UTF-8 characters on three octets, each character representing a
645  * decimal digit starting with the first MCC digit.
646  * - Then, the MNC shall be encoded as either two or three UTF-8 characters on two or three octets, each character
647  * representing a decimal digit starting with the first MNC digit.
648  * - The Location Area Code (LAC) is encoded next using four UTF-8 characters on four octets, each character
649  * representing a hexadecimal digit of the LAC which is two binary octets long.
650  * - The Routing Area Code (RAC) is encoded last using two UTF-8 characters on two octets, each character
651  * representing a hexadecimal digit of the RAC which is one binary octet long.
652  * NOTE: As an example, a RAI with the following information: MCC=123, MNC=45, LAC=41655(0xA2C1) and
653  * RAC=10(0x0A) is encoded within the RAI AVP as a UTF-8 string of "12345A2C10A".
654  */
655
656 static int
657 dissect_diameter_3gpp_rai(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void *data) {
658
659     diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
660     int offset = 0;
661     guint length;
662
663     length = tvb_length(tvb);
664
665     if(length==12){
666         diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "MNC %s, MCC %s, LAC 0x%s, RAC 0x%s",
667             tvb_get_string_enc(wmem_packet_scope(), tvb,  0, 3, ENC_UTF_8|ENC_NA), /* MNC 3 digits */
668             tvb_get_string_enc(wmem_packet_scope(), tvb,  3, 3, ENC_UTF_8|ENC_NA), /* MCC 3 digits */
669             tvb_get_string_enc(wmem_packet_scope(), tvb,  6, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */
670             tvb_get_string_enc(wmem_packet_scope(), tvb, 10, 2, ENC_UTF_8|ENC_NA)  /* RAC 2 digits */
671                         );
672     }else{
673         diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "MNC %s, MCC %s, LAC 0x%s, RAC 0x%s",
674             tvb_get_string_enc(wmem_packet_scope(), tvb,  0, 3, ENC_UTF_8|ENC_NA), /* MNC 3 digits */
675             tvb_get_string_enc(wmem_packet_scope(), tvb,  3, 2, ENC_UTF_8|ENC_NA), /* MCC 2 digits */
676             tvb_get_string_enc(wmem_packet_scope(), tvb,  5, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */
677             tvb_get_string_enc(wmem_packet_scope(), tvb,  9, 2, ENC_UTF_8|ENC_NA)  /* RAC 2 digits */
678                         );
679     }
680
681     return offset;
682
683 }
684 /* AVP Code: 913 MBMS-Required-QoS */
685 static int
686 dissect_diameter_3gpp_mbms_required_qos(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_) {
687
688     int offset = 0;
689     guint length;
690
691     /* Octet
692      * 1        Allocation/Retention Priority as specified in 3GPP TS 23.107.
693      *          This octet encodes each priority level defined in 3GPP TS 23.107
694      *          as the binary value of the priority level. It specifies the relative
695      *          importance of the actual MBMS bearer service compared to other MBMS
696      *          and non-MBMS bearer services for allocation and retention of the
697      *          MBMS bearer service.
698      * 2-N      QoS Profile as specified by the Quality-of-Service information element,
699      *          from octet 3 onwards, in 3GPP TS 24.008
700      */
701     proto_tree_add_item(tree, hf_diameter_3gpp_mbms_required_qos_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
702     offset++;
703     length = tvb_length(tvb) - 1;
704     de_sm_qos(tvb, tree,  pinfo, offset,length, NULL, 0);
705     return offset+length;
706
707 }
708
709 /* AVP Code: 926 MBMS-BMSC-SSM-UDP-Port */
710 /* AVP Code: 927 MBMS-GW-UDP-Port */
711 static int
712 dissect_diameter_3gpp_udp_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
713 {
714     int offset = 0;
715
716     proto_tree_add_item(tree, hf_diameter_3gpp_udp_port, tvb, offset, 1, ENC_BIG_ENDIAN);
717
718     offset += 1;
719
720     return offset;
721 }
722
723 /* AVP Code: 929 MBMS-Data-Transfer-Start */
724 /* AVP Code: 930 MBMS-Data-Transfer-Stop */
725 static int
726 dissect_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
727 {
728     int offset = 0;
729     const gchar *time_str;
730
731     time_str = tvb_ntp_fmt_ts(tvb, offset);
732     proto_tree_add_string(tree, hf_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer, tvb, offset, 8, time_str);
733     offset+=8;
734
735     return offset;
736 }
737
738 /* 3GPP TS 29.272
739  * 7.3.7 ULR-Flags
740  * AVP Code: 1405 ULR-Flags
741  */
742 static int
743 dissect_diameter_3gpp_ulr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
744
745     proto_item* item;
746     proto_tree *sub_tree;
747     int offset = 0;
748     guint32 bit_offset;
749
750     item = proto_tree_add_item(tree, hf_diameter_3gpp_ulr_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
751     sub_tree = proto_item_add_subtree(item, diameter_3gpp_ulr_flags_ett);
752     bit_offset = 0;
753     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 24, ENC_BIG_ENDIAN);
754     bit_offset+=24;
755     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit7, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
756     bit_offset++;
757     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit6, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
758     bit_offset++;
759     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit5, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
760     bit_offset++;
761     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit4, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
762     bit_offset++;
763     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit3, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
764     bit_offset++;
765     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
766     bit_offset++;
767     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
768     bit_offset++;
769     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ulr_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
770     bit_offset++;
771
772     offset = bit_offset>>3;
773     return offset;
774
775 }
776
777 /* AVP Code: 1406 ULA-Flags */
778 static int
779 dissect_diameter_3gpp_ula_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
780
781     proto_item* item;
782     proto_tree *sub_tree;
783     int offset = 0;
784     guint32 bit_offset;
785
786     item = proto_tree_add_item(tree, hf_diameter_3gpp_ula_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
787     sub_tree = proto_item_add_subtree(item, diameter_3gpp_ula_flags_ett);
788     bit_offset = 0;
789     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 31, ENC_BIG_ENDIAN);
790     bit_offset+=31;
791     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ula_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
792     bit_offset++;
793
794     offset = bit_offset>>3;
795     return offset;
796
797 }
798
799 /*
800  * 3GPP TS 29.272
801  * 7.3.25 DSR-Flags
802  * AVP Code: 1421 DSR-Flags
803  */
804 static int
805 dissect_diameter_3gpp_dsr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
806
807     proto_item* item;
808     proto_tree *sub_tree;
809     int offset = 0;
810     guint32 bit_offset;
811
812     item = proto_tree_add_item(tree, hf_diameter_3gpp_dsr_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
813     sub_tree = proto_item_add_subtree(item, diameter_3gpp_dsr_flags_ett);
814     bit_offset = 0;
815     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 15, ENC_BIG_ENDIAN);
816     bit_offset+=15;
817     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit16, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
818     bit_offset++;
819     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit15, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
820     bit_offset++;
821     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit14, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
822     bit_offset++;
823     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit13, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
824     bit_offset++;
825     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit12, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
826     bit_offset++;
827     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit11, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
828     bit_offset++;
829     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit10, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
830     bit_offset++;
831     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit9, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
832     bit_offset++;
833     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit8, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
834     bit_offset++;
835     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit7, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
836     bit_offset++;
837     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit6, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
838     bit_offset++;
839     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit5, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
840     bit_offset++;
841     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit4, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
842     bit_offset++;
843     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit3, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
844     bit_offset++;
845     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
846     bit_offset++;
847     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
848     bit_offset++;
849     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsr_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
850     bit_offset++;
851
852     offset = bit_offset>>3;
853     return offset;
854
855 }
856
857 /* AVP Code: 1422 DSA-Flags */
858 static int
859 dissect_diameter_3gpp_dsa_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
860
861     proto_item* item;
862     proto_tree *sub_tree;
863     int offset = 0;
864     guint32 bit_offset;
865
866     item = proto_tree_add_item(tree, hf_diameter_3gpp_dsa_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
867     sub_tree = proto_item_add_subtree(item, diameter_3gpp_dsa_flags_ett);
868     bit_offset = 0;
869     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 31, ENC_BIG_ENDIAN);
870     bit_offset+=31;
871     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_dsa_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
872     bit_offset++;
873
874     offset = bit_offset>>3;
875     return offset;
876
877 }
878
879 /* AVP Code: 1441 IDA-Flags */
880 static int
881 dissect_diameter_3gpp_ida_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
882
883     proto_item* item;
884     proto_tree *sub_tree;
885     int offset = 0;
886     guint32 bit_offset;
887
888     item = proto_tree_add_item(tree, hf_diameter_3gpp_ida_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
889     sub_tree = proto_item_add_subtree(item, diameter_3gpp_ida_flags_ett);
890     bit_offset = 0;
891     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 31, ENC_BIG_ENDIAN);
892     bit_offset+=31;
893     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_ida_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
894     bit_offset++;
895
896     offset = bit_offset>>3;
897     return offset;
898
899 }
900
901 /* AVP Code: 1442 PUA-Flags */
902 static int
903 dissect_diameter_3gpp_pua_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
904
905     proto_item* item;
906     proto_tree *sub_tree;
907     int offset = 0;
908     guint32 bit_offset;
909
910     item = proto_tree_add_item(tree, hf_diameter_3gpp_pua_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
911     sub_tree = proto_item_add_subtree(item, diameter_3gpp_pua_flags_ett);
912     bit_offset = 0;
913     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 30, ENC_BIG_ENDIAN);
914     bit_offset+=30;
915     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_pua_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
916     bit_offset++;
917     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_pua_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
918     bit_offset++;
919
920     offset = bit_offset>>3;
921     return offset;
922
923
924 }
925
926 /* AVP Code: 1443 NOR-Flags */
927 static int
928 dissect_diameter_3gpp_nor_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
929
930     proto_item* item;
931     proto_tree *sub_tree;
932     int offset = 0;
933     guint32 bit_offset;
934
935     item = proto_tree_add_item(tree, hf_diameter_3gpp_nor_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
936     sub_tree = proto_item_add_subtree(item, diameter_3gpp_nor_flags_ett);
937     bit_offset = 0;
938     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 25, ENC_BIG_ENDIAN);
939     bit_offset+=25;
940     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_nor_flags_bit6, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
941     bit_offset++;
942     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_nor_flags_bit5, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
943     bit_offset++;
944     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_nor_flags_bit4, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
945     bit_offset++;
946     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_nor_flags_bit3, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
947     bit_offset++;
948     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_nor_flags_bit2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
949     bit_offset++;
950     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_nor_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
951     bit_offset++;
952     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_nor_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
953     bit_offset++;
954
955     offset = bit_offset>>3;
956     return offset;
957
958 }
959
960 /* AVP Code: 1490 IDR-Flags */
961 static int
962 dissect_diameter_3gpp_idr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_) {
963
964     proto_item* item;
965     proto_tree *sub_tree;
966     int offset = 0;
967     guint32 bit_offset;
968
969     item = proto_tree_add_item(tree, hf_diameter_3gpp_idr_flags, tvb, offset, 4, ENC_BIG_ENDIAN);
970     sub_tree = proto_item_add_subtree(item, diameter_3gpp_idr_flags_ett);
971     bit_offset = 0;
972     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_spare_bits, tvb, bit_offset, 25, ENC_BIG_ENDIAN);
973     bit_offset+=25;
974     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_idr_flags_bit6, tvb,  bit_offset, 1, ENC_BIG_ENDIAN);
975     bit_offset++;
976     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_idr_flags_bit5, tvb,  bit_offset, 1, ENC_BIG_ENDIAN);
977     bit_offset++;
978     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_idr_flags_bit4, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
979     bit_offset++;
980     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_idr_flags_bit3, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
981     bit_offset++;
982     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_idr_flags_bit2, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
983     bit_offset++;
984     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_idr_flags_bit1, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
985     bit_offset++;
986     proto_tree_add_bits_item(sub_tree, hf_diameter_3gpp_idr_flags_bit0, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
987     bit_offset++;
988
989     offset = bit_offset>>3;
990     return offset;
991
992 }
993
994 void
995 proto_reg_handoff_diameter_3gpp(void)
996 {
997
998     /* AVP Code: 5 3GPP-GPRS Negotiated QoS profile */
999     /* Registered by packet-gtp.c */
1000
1001     /* AVP Code: 15 3GPP-SGSN-IPv6-Address */
1002     dissector_add_uint("diameter.3gpp", 15, new_create_dissector_handle(dissect_diameter_3gpp_sgsn_ipv6_address, proto_diameter_3gpp));
1003
1004     /* AVP Code: 22 3GPP-User-Location-Info
1005      * Registered by packet-gtpv2.c
1006      */
1007
1008     /* AVP Code: 23 3GPP-MS-TimeZone */
1009     dissector_add_uint("diameter.3gpp", 23, new_create_dissector_handle(dissect_diameter_3gpp_ms_timezone, proto_diameter_3gpp));
1010
1011         /* AVP Code: 600 Visited-Network-Identifier */
1012     dissector_add_uint("diameter.3gpp", 600, new_create_dissector_handle(dissect_diameter_3gpp_visited_nw_id, proto_diameter_3gpp));
1013
1014     /* AVP Code: 606 User-Data */
1015     dissector_add_uint("diameter.3gpp", 606, new_create_dissector_handle(dissect_diameter_3gpp_user_data, proto_diameter_3gpp));
1016
1017     /* AVP Code: 629 Feature-List */
1018     dissector_add_uint("diameter.3gpp", 629, new_create_dissector_handle(dissect_diameter_3gpp_feature_list_id, proto_diameter_3gpp));
1019
1020     /* AVP Code: 630 Feature-List */
1021     dissector_add_uint("diameter.3gpp", 630, new_create_dissector_handle(dissect_diameter_3gpp_feature_list, proto_diameter_3gpp));
1022
1023     /* AVP Code: 637 UAR-Flags */
1024     dissector_add_uint("diameter.3gpp", 637, new_create_dissector_handle(dissect_diameter_3gpp_uar_flags, proto_diameter_3gpp));
1025
1026     /* AVP Code: 640 Path */
1027     dissector_add_uint("diameter.3gpp", 640, new_create_dissector_handle(dissect_diameter_3gpp_path, proto_diameter_3gpp));
1028
1029     /* AVP Code: 641 Contact */
1030     dissector_add_uint("diameter.3gpp", 641, new_create_dissector_handle(dissect_diameter_3gpp_contact, proto_diameter_3gpp));
1031
1032     /* AVP Code: 701 MSISDN */
1033     dissector_add_uint("diameter.3gpp", 701, new_create_dissector_handle(dissect_diameter_3gpp_msisdn, proto_diameter_3gpp));
1034
1035     /* AVP Code: 702 User-Data */
1036     dissector_add_uint("diameter.3gpp", 702, new_create_dissector_handle(dissect_diameter_3gpp_user_data, proto_diameter_3gpp));
1037
1038     /* AVP Code: 704 Service-Indication  */
1039     dissector_add_uint("diameter.3gpp", 704, new_create_dissector_handle(dissect_diameter_3gpp_service_ind, proto_diameter_3gpp));
1040
1041     /* AVP Code: 900 TMGI */
1042     dissector_add_uint("diameter.3gpp", 900, new_create_dissector_handle(dissect_diameter_3gpp_tmgi, proto_diameter_3gpp));
1043
1044     /* AVP Code: 904 MBMS-Session-Duration  Registered by packet-gtp.c */
1045     /* AVP Code: 903 MBMS-Service-Area Registered by packet-gtp.c */
1046
1047     /* AVP Code: 909 RAI */
1048     dissector_add_uint("diameter.3gpp", 909, new_create_dissector_handle(dissect_diameter_3gpp_rai, proto_diameter_3gpp));
1049
1050     /* AVP Code: 911 MBMS-Time-To-Data-Transfer  Registered by packet-gtp.c */
1051     /* Registered by packet-gtp.c */
1052
1053     /* AVP Code: 913 MBMS-Required-QoS */
1054     dissector_add_uint("diameter.3gpp", 913, new_create_dissector_handle(dissect_diameter_3gpp_mbms_required_qos, proto_diameter_3gpp));
1055
1056     /* AVP Code: 917 MBMS-GGSN-IPv6-Address */
1057     dissector_add_uint("diameter.3gpp", 917, new_create_dissector_handle(dissect_diameter_3gpp_ipv6addr, proto_diameter_3gpp));
1058
1059     /* AVP Code: 918 MBMS-BMSC-SSM-IP-Address */
1060     dissector_add_uint("diameter.3gpp", 918, new_create_dissector_handle(dissect_diameter_3gpp_ipaddr, proto_diameter_3gpp));
1061
1062     /* AVP Code: 926 MBMS-BMSC-SSM-UDP-Port */
1063     /* AVP Code: 927 MBMS-GW-UDP-Port */
1064     dissector_add_uint("diameter.3gpp", 926, new_create_dissector_handle(dissect_diameter_3gpp_udp_port, proto_diameter_3gpp));
1065     dissector_add_uint("diameter.3gpp", 927, new_create_dissector_handle(dissect_diameter_3gpp_udp_port, proto_diameter_3gpp));
1066
1067     /* AVP Code: 929 MBMS-Data-Transfer-Start */
1068     dissector_add_uint("diameter.3gpp", 929, new_create_dissector_handle(dissect_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer, proto_diameter_3gpp));
1069
1070     /* AVP Code: 930 MBMS-Data-Transfer-Stop */
1071     dissector_add_uint("diameter.3gpp", 930, new_create_dissector_handle(dissect_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer, proto_diameter_3gpp));
1072
1073     /* AVP Code: 1405 ULR-Flags */
1074     dissector_add_uint("diameter.3gpp", 1405, new_create_dissector_handle(dissect_diameter_3gpp_ulr_flags, proto_diameter_3gpp));
1075
1076     /* AVP Code: 1406 ULA-Flags */
1077     dissector_add_uint("diameter.3gpp", 1406, new_create_dissector_handle(dissect_diameter_3gpp_ula_flags, proto_diameter_3gpp));
1078
1079     /* AVP Code: 1421 DSR-Flags */
1080     dissector_add_uint("diameter.3gpp", 1421, new_create_dissector_handle(dissect_diameter_3gpp_dsr_flags, proto_diameter_3gpp));
1081
1082     /* AVP Code: 1422 DSA-Flags */
1083     dissector_add_uint("diameter.3gpp", 1422, new_create_dissector_handle(dissect_diameter_3gpp_dsa_flags, proto_diameter_3gpp));
1084
1085     /* AVP Code: 1441 IDA-Flags */
1086     dissector_add_uint("diameter.3gpp", 1441, new_create_dissector_handle(dissect_diameter_3gpp_ida_flags, proto_diameter_3gpp));
1087
1088     /* AVP Code: 1442 PUA-Flags */
1089     dissector_add_uint("diameter.3gpp", 1442, new_create_dissector_handle(dissect_diameter_3gpp_pua_flags, proto_diameter_3gpp));
1090
1091     /* AVP Code: 1443 NOR-Flags */
1092     dissector_add_uint("diameter.3gpp", 1443, new_create_dissector_handle(dissect_diameter_3gpp_nor_flags, proto_diameter_3gpp));
1093
1094     /* AVP Code: 1490 IDR-Flags */
1095     dissector_add_uint("diameter.3gpp", 1490, new_create_dissector_handle(dissect_diameter_3gpp_idr_flags, proto_diameter_3gpp));
1096
1097     xml_handle = find_dissector("xml");
1098 }
1099
1100 void
1101 proto_register_diameter_3gpp(void)
1102 {
1103
1104 /* Setup list of header fields  See Section 1.6.1 for details*/
1105     static hf_register_info hf[] = {
1106         { &hf_diameter_3gpp_path,
1107             { "Path",           "diameter.3gpp.path",
1108             FT_STRING, BASE_NONE, NULL, 0x0,
1109             NULL, HFILL }
1110         },
1111         { &hf_diameter_3gpp_contact,
1112             { "Contact",           "diameter.3gpp.contact",
1113             FT_STRING, BASE_NONE, NULL, 0x0,
1114             NULL, HFILL }
1115         },
1116         { &hf_diameter_3gpp_visited_nw_id,
1117             { "Visited-Network-Identifier",           "diameter.3gpp.visited_nw_id",
1118             FT_STRING, BASE_NONE, NULL, 0x0,
1119             NULL, HFILL }
1120         },
1121         { &hf_diameter_3gpp_msisdn,
1122             { "MSISDN",           "diameter.3gpp.msisdn",
1123             FT_BYTES, BASE_NONE, NULL, 0x0,
1124             NULL, HFILL }
1125         },
1126 #if 0
1127         { &hf_diameter_3gpp_user_data,
1128             { "User data",           "diameter.3gpp.user_data",
1129             FT_STRING, BASE_NONE, NULL, 0x0,
1130             NULL, HFILL }
1131         },
1132 #endif
1133         { &hf_diameter_3gpp_ipaddr,
1134             { "IPv4 Address",           "diameter.3gpp.ipaddr",
1135             FT_IPv4, BASE_NONE, NULL, 0x0,
1136             NULL, HFILL }
1137         },
1138         { &hf_diameter_3gpp_mbms_required_qos_prio,
1139             { "Allocation/Retention Priority",           "diameter.3gpp.mbms_required_qos_prio",
1140             FT_UINT8, BASE_DEC, NULL, 0x0,
1141             NULL, HFILL }
1142         },
1143         { &hf_diameter_3gpp_tmgi,
1144             { "TMGI",           "diameter.3gpp.tmgi",
1145             FT_BYTES, BASE_NONE, NULL, 0x0,
1146             NULL, HFILL }
1147         },
1148         { &hf_diameter_3gpp_service_ind,
1149             { "Service-Indication",           "diameter.3gpp.service_ind",
1150             FT_STRING, BASE_NONE, NULL, 0x0,
1151             NULL, HFILL }
1152         },
1153         { &hf_diameter_mbms_service_id,
1154             { "MBMS Service ID",           "diameter.3gpp.mbms_service_id",
1155             FT_UINT24, BASE_HEX, NULL, 0x0,
1156             NULL, HFILL }
1157         },
1158         { &hf_diameter_address_digits,
1159             { "Address digits", "diameter.3gpp.address_digits",
1160             FT_STRING, BASE_NONE, NULL, 0x0,
1161             NULL, HFILL }
1162         },
1163         { &hf_diameter_3gpp_spare_bits,
1164             { "Spare bit(s)", "diameter.3gpp.spare_bits",
1165             FT_UINT32, BASE_HEX, NULL, 0x0,
1166             NULL, HFILL }
1167         },
1168         { &hf_diameter_3gpp_uar_flags_flags,
1169             { "Flags", "diameter.3gpp.uar_flags_flags",
1170             FT_UINT32, BASE_HEX, NULL, 0x0,
1171             NULL, HFILL }
1172         },
1173         { &hf_diameter_3gpp_uar_flags_flags_bit0,
1174             { "Emergency registration", "diameter.3gpp.uar_flags_flags_bit0",
1175             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1176             NULL, HFILL }
1177         },
1178         { &hf_diameter_3gpp_feature_list_flags,
1179             { "Feature-List Flags", "diameter.3gpp.feature_list_flags",
1180             FT_UINT32, BASE_HEX, NULL, 0x0,
1181             NULL, HFILL }
1182         },
1183         { &hf_diameter_3gpp_feature_list_flags_bit0,
1184             { "Shared IFC Sets", "diameter.3gpp.feature_list_flags_bit0",
1185             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1186             NULL, HFILL }
1187         },
1188         { &hf_diameter_3gpp_feature_list_flags_bit1,
1189             { "Alias Indication", "diameter.3gpp.feature_list_flags_bit1",
1190             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1191             NULL, HFILL }
1192         },
1193         { &hf_diameter_3gpp_feature_list_flags_bit2,
1194             { "IMS Restoration Indication", "diameter.3gpp.feature_list_flags_bit2",
1195             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1196             NULL, HFILL }
1197         },
1198         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit0,
1199             { "Operator Determined Barring of all Packet Oriented Services", "diameter.3gpp.feature_list1_s6a_flags_bit0",
1200             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1201             NULL, HFILL }
1202         },
1203         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit1,
1204             { "Operator Determined Barring of Packet Oriented Services from access points that are within the HPLMN whilst the subscriber is roaming in a VPLMN", "diameter.3gpp.feature_list1_s6a_flags_bit1",
1205             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1206             NULL, HFILL }
1207         },
1208         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit2,
1209             { "Operator Determined Barring of Packet Oriented Services from access points that are within the roamed to VPLMN", "diameter.3gpp.feature_list1_s6a_flags_bit2",
1210             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1211             NULL, HFILL }
1212         },
1213         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit3,
1214             { "Operator Determined Barring of all outgoing calls", "diameter.3gpp.feature_list1_s6a_flags_bit3",
1215             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1216             NULL, HFILL }
1217         },
1218         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit4,
1219             { "Operator Determined Barring of all outgoing international calls", "diameter.3gpp.feature_list1_s6a_flags_bit4",
1220             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1221             NULL, HFILL }
1222         },
1223         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit5,
1224             { "Operator Determined Barring of all outgoing international calls except those directed to the home PLMN country", "diameter.3gpp.feature_list1_s6a_flags_bit5",
1225             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1226             NULL, HFILL }
1227         },
1228         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit6,
1229             { "Operator Determined Barring of all outgoing inter-zonal calls", "diameter.3gpp.feature_list1_s6a_flags_bit6",
1230             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1231             NULL, HFILL }
1232         },
1233         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit7,
1234             { "Operator Determined Barring of all outgoing inter-zonal calls except those directed to the home PLMN country", "diameter.3gpp.feature_list1_s6a_flags_bit7",
1235             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1236             NULL, HFILL }
1237         },
1238         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit8,
1239             { "Operator Determined Barring of all outgoing international calls except those directed to the home PLMN country and Barring of all outgoing inter-zonal calls", "diameter.3gpp.feature_list1_s6a_flags_bit8",
1240             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1241             NULL, HFILL }
1242         },
1243                 { &hf_diameter_3gpp_feature_list1_s6a_flags_bit9,
1244             { "Regional Subscription", "diameter.3gpp.feature_list1_s6a_flags_bit9",
1245             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1246             NULL, HFILL }
1247         },
1248
1249         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit10,
1250             { "Trace Function", "diameter.3gpp.feature_list1_s6a_flags_bit10",
1251             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1252             NULL, HFILL }
1253         },
1254         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit11,
1255             { "All LCS Privacy Exception Classes", "diameter.3gpp.feature_list1_s6a_flags_bit11",
1256             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1257             NULL, HFILL }
1258         },
1259         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit12,
1260             { "Allow location by any LCS client", "diameter.3gpp.feature_list1_s6a_flags_bit12",
1261             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1262             NULL, HFILL }
1263         },
1264         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit13,
1265             { "Allow location by any value added LCS client to which a call/session is established from the target UE", "diameter.3gpp.feature_list1_s6a_flags_bit13",
1266             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1267             NULL, HFILL }
1268         },
1269         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit14,
1270             { "Allow location by designated external value added LCS clients", "diameter.3gpp.feature_list1_s6a_flags_bit14",
1271             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1272             NULL, HFILL }
1273         },
1274         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit15,
1275             { "Allow location by designated PLMN operator LCS clients", "diameter.3gpp.feature_list1_s6a_flags_bit15",
1276             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1277             NULL, HFILL }
1278         },
1279         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit16,
1280             { "Allow location by LCS clients of a designated LCS service type", "diameter.3gpp.feature_list1_s6a_flags_bit16",
1281             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1282             NULL, HFILL }
1283         },
1284         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit17,
1285             { "All Mobile Originating Location Request Classes", "diameter.3gpp.feature_list1_s6a_flags_bit17",
1286             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1287             NULL, HFILL }
1288         },
1289         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit18,
1290             { "Allow an MS to request its own location", "diameter.3gpp.feature_list1_s6a_flags_bit18",
1291             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1292             NULL, HFILL }
1293         },
1294                 { &hf_diameter_3gpp_feature_list1_s6a_flags_bit19,
1295             { "Allow an MS to perform self location without interaction with the PLMN", "diameter.3gpp.feature_list1_s6a_flags_bit19",
1296             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1297             NULL, HFILL }
1298         },
1299         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit20,
1300             { "Allow an MS to request transfer of its location to another LCS client", "diameter.3gpp.feature_list1_s6a_flags_bit20",
1301             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1302             NULL, HFILL }
1303         },
1304         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit21,
1305             { "Short Message MO-PP", "diameter.3gpp.feature_list1_s6a_flags_bit21",
1306             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1307             NULL, HFILL }
1308         },
1309         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit22,
1310             { "Barring of Outgoing Calls", "diameter.3gpp.feature_list1_s6a_flags_bit22",
1311             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1312             NULL, HFILL }
1313         },
1314         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit23,
1315             { "Barring of all outgoing calls", "diameter.3gpp.feature_list1_s6a_flags_bit23",
1316             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1317             NULL, HFILL }
1318         },
1319         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit24,
1320             { "Barring of outgoing international calls", "diameter.3gpp.feature_list1_s6a_flags_bit24",
1321             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1322             NULL, HFILL }
1323         },
1324         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit25,
1325             { "Barring of outgoing international calls except those directed to the home PLMN Country", "diameter.3gpp.feature_list1_s6a_flags_bit25",
1326             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1327             NULL, HFILL }
1328         },
1329         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit26,
1330             { "UE Reachability Notifcation", "diameter.3gpp.feature_list1_s6a_flags_bit26",
1331             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1332             NULL, HFILL }
1333         },
1334         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit27,
1335             { "Terminating Access Domain Selection Data Retrieval", "diameter.3gpp.feature_list1_s6a_flags_bit27",
1336             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1337             NULL, HFILL }
1338         },
1339         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit28,
1340             { "State/Location Information Retrieval", "diameter.3gpp.feature_list1_s6a_flags_bit28",
1341             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1342             NULL, HFILL }
1343         },
1344         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit29,
1345             { "Partial Purge from a Combined MME/SGSN", "diameter.3gpp.feature_list1_s6a_flags_bit29",
1346             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1347             NULL, HFILL }
1348         },
1349         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit30,
1350             { "UE Time Zone Retrieval", "diameter.3gpp.feature_list1_s6a_flags1_bit30",
1351             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1352             NULL, HFILL }
1353         },
1354         { &hf_diameter_3gpp_feature_list1_s6a_flags_bit31,
1355             { "Additional MSISDN", "diameter.3gpp.feature_list1_s6a_flags_bit31",
1356             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1357             NULL, HFILL }
1358         },
1359         { &hf_diameter_3gpp_feature_list2_s6a_flags_bit0,
1360             { "SMS in MME", "diameter.3gpp.feature_list2_s6a_flags_bit0",
1361             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1362             NULL, HFILL }
1363         },
1364         { &hf_diameter_3gpp_feature_list2_s6a_flags_bit1,
1365             { "SMS in SGSN", "diameter.3gpp.feature_list2_s6a_flags_bit1",
1366             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1367             NULL, HFILL }
1368         },
1369         { &hf_diameter_3gpp_feature_list_gx_flags_bit0,
1370             { "Rel-8 Gx", "diameter.3gpp.feature_list_gx_flags_bit0",
1371             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1372             NULL, HFILL }
1373         },
1374         { &hf_diameter_3gpp_feature_list_gx_flags_bit1,
1375             { "Rel-9 Gx", "diameter.3gpp.feature_list_gx_flags_bit1",
1376             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1377             NULL, HFILL }
1378         },
1379         { &hf_diameter_3gpp_feature_list_gx_flags_bit2,
1380             { "Provisioning AF Signaling IP Flow Information",
1381               "diameter.3gpp.feature_list_gx_flags_bit2",
1382             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1383             NULL, HFILL }
1384         },
1385         { &hf_diameter_3gpp_feature_list_gx_flags_bit3,
1386             { "Rel-10 Gx", "diameter.3gpp.feature_list_gx_flags_bit3",
1387             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1388             NULL, HFILL }
1389         },
1390         { &hf_diameter_3gpp_feature_list_gx_flags_bit4,
1391             { "Sponsored Data Connectivity",
1392               "diameter.3gpp.feature_list_gx_flags_bit4",
1393             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1394             NULL, HFILL }
1395         },
1396         { &hf_diameter_3gpp_feature_list_gx_flags_bit5,
1397             { "IP Flow Mobility", "diameter.3gpp.feature_list_gx_flags_bit5",
1398             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1399             NULL, HFILL }
1400         },
1401         { &hf_diameter_3gpp_feature_list_gx_flags_bit6,
1402             { "ADC", "diameter.3gpp.feature_list_gx_flags_bit6",
1403             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1404             NULL, HFILL }
1405         },
1406         { &hf_diameter_3gpp_feature_list_gx_flags_bit7,
1407             { "vSRVCC", "diameter.3gpp.feature_list_gx_flags_bit7",
1408             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1409             NULL, HFILL }
1410         },
1411         { &hf_diameter_3gpp_feature_list_gx_flags_bit8,
1412             { "EPC-routed", "diameter.3gpp.feature_list_gx_flags_bit8",
1413             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1414             NULL, HFILL }
1415         },
1416         { &hf_diameter_3gpp_feature_list_gx_flags_bit9,
1417             { "rSRVCC", "diameter.3gpp.feature_list_gx_flags_bit9",
1418             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1419             NULL, HFILL }
1420         },
1421         { &hf_diameter_3gpp_feature_list_gx_flags_bit10,
1422             { "NetLoc", "diameter.3gpp.feature_list_gx_flags_bit10",
1423             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1424             NULL, HFILL }
1425         },
1426         { &hf_diameter_3gpp_feature_list_gx_flags_bit11,
1427             { "Usage Monitoring Congestion Handling",
1428               "diameter.3gpp.feature_list_gx_flags_bit11",
1429             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1430             NULL, HFILL }
1431         },
1432         { &hf_diameter_3gpp_feature_list_gx_flags_bit12,
1433             { "Extended Filter", "diameter.3gpp.feature_list_gx_flags_bit12",
1434             FT_BOOLEAN, BASE_NONE, TFS(&tfs_supported_not_supported), 0x0,
1435             NULL, HFILL }
1436         },
1437         { &hf_diameter_3gpp_ulr_flags,
1438             { "ULR Flags", "diameter.3gpp.ulr_flags",
1439             FT_UINT32, BASE_HEX, NULL, 0x0,
1440             NULL, HFILL }
1441         },
1442         { &hf_diameter_3gpp_ulr_flags_bit0,
1443             { "Single-Registration-Indication", "diameter.3gpp.ulr_flags_bit0",
1444             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1445             NULL, HFILL }
1446         },
1447         { &hf_diameter_3gpp_ulr_flags_bit1,
1448             { "S6a/S6d-Indicator", "diameter.3gpp.ulr_flags_bit1",
1449             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1450             NULL, HFILL }
1451         },
1452         { &hf_diameter_3gpp_ulr_flags_bit2,
1453             { "Skip-Subscriber-Data", "diameter.3gpp.ulr_flags_bit2",
1454             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1455             NULL, HFILL }
1456         },
1457         { &hf_diameter_3gpp_ulr_flags_bit3,
1458             { "GPRS-Subscription-Data-Indicator", "diameter.3gpp.ulr_flags_bit3",
1459             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1460             NULL, HFILL }
1461         },
1462         { &hf_diameter_3gpp_ulr_flags_bit4,
1463             { "Node-Type-Indicator", "diameter.3gpp.ulr_flags_bit4",
1464             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1465             NULL, HFILL }
1466         },
1467         { &hf_diameter_3gpp_ulr_flags_bit5,
1468             { "Initial-Attach-Indicator", "diameter.3gpp.ulr_flags_bit5",
1469             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1470             NULL, HFILL }
1471         },
1472         { &hf_diameter_3gpp_ulr_flags_bit6,
1473             { "PS-LCS-Not-Supported-By-UE", "diameter.3gpp.ulr_flags_bit6",
1474             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1475             NULL, HFILL }
1476         },
1477         { &hf_diameter_3gpp_ulr_flags_bit7,
1478             { "SMS-Only-Indication", "diameter.3gpp.ulr_flags_bit7",
1479             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1480             NULL, HFILL }
1481         },
1482         { &hf_diameter_3gpp_ula_flags,
1483             { "ULA Flags", "diameter.3gpp.ula_flags",
1484             FT_UINT32, BASE_HEX, NULL, 0x0,
1485             NULL, HFILL }
1486         },
1487         { &hf_diameter_3gpp_ula_flags_bit0,
1488             { "Separation Indication", "diameter.3gpp.ula_flags_bit0",
1489             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1490             NULL, HFILL }
1491         },
1492         { &hf_diameter_3gpp_dsr_flags,
1493             { "DSR Flags", "diameter.3gpp.dsr_flags",
1494             FT_UINT32, BASE_HEX, NULL, 0x0,
1495             NULL, HFILL }
1496         },
1497         { &hf_diameter_3gpp_dsr_flags_bit0,
1498             { "Regional Subscription Withdrawal", "diameter.3gpp.dsr_flags_bit0",
1499             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1500             NULL, HFILL }
1501         },
1502         { &hf_diameter_3gpp_dsr_flags_bit1,
1503             { "Complete APN Configuration Profile Withdrawal", "diameter.3gpp.dsr_flags_bit1",
1504             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1505             NULL, HFILL }
1506         },
1507         { &hf_diameter_3gpp_dsr_flags_bit2,
1508             { "Subscribed Charging Characteristics Withdrawal", "diameter.3gpp.dsr_flags_bit2",
1509             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1510             NULL, HFILL }
1511         },
1512         { &hf_diameter_3gpp_dsr_flags_bit3,
1513             { "PDN subscription contexts Withdrawal", "diameter.3gpp.dsr_flags_bit3",
1514             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1515             NULL, HFILL }
1516         },
1517         { &hf_diameter_3gpp_dsr_flags_bit4,
1518             { "STN-SR", "diameter.3gpp.dsr_flags_bit4",
1519             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1520             NULL, HFILL }
1521         },
1522         { &hf_diameter_3gpp_dsr_flags_bit5,
1523             { "Complete PDP context list Withdrawal", "diameter.3gpp.dsr_flags_bit5",
1524             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1525             NULL, HFILL }
1526         },
1527         { &hf_diameter_3gpp_dsr_flags_bit6,
1528             { "PDP contexts Withdrawal", "diameter.3gpp.dsr_flags_bit6",
1529             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1530             NULL, HFILL }
1531         },
1532         { &hf_diameter_3gpp_dsr_flags_bit7,
1533             { "Roaming Restricted due to unsupported feature", "diameter.3gpp.dsr_flags_bit7",
1534             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1535             NULL, HFILL }
1536         },
1537         { &hf_diameter_3gpp_dsr_flags_bit8,
1538             { "Trace Data Withdrawal", "diameter.3gpp.dsr_flags_bit8",
1539             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1540             NULL, HFILL }
1541         },
1542         { &hf_diameter_3gpp_dsr_flags_bit9,
1543             { "CSG Deleted", "diameter.3gpp.dsr_flags_bit9",
1544             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1545             NULL, HFILL }
1546         },
1547         { &hf_diameter_3gpp_dsr_flags_bit10,
1548             { "APN-OI-Replacement", "diameter.3gpp.dsr_flags_bit10",
1549             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1550             NULL, HFILL }
1551         },
1552         { &hf_diameter_3gpp_dsr_flags_bit11,
1553             { "GMLC List Withdrawal", "diameter.3gpp.dsr_flags_bit11",
1554             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1555             NULL, HFILL }
1556         },
1557         { &hf_diameter_3gpp_dsr_flags_bit12,
1558             { "LCS Withdrawal", "diameter.3gpp.dsr_flags_bit12",
1559             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1560             NULL, HFILL }
1561         },
1562         { &hf_diameter_3gpp_dsr_flags_bit13,
1563             { "SMS Withdrawal", "diameter.3gpp.dsr_flags_bit13",
1564             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1565             NULL, HFILL }
1566         },
1567         { &hf_diameter_3gpp_dsr_flags_bit14,
1568             { "Subscribed periodic RAU-TAU Timer Withdrawal", "diameter.3gpp.dsr_flags_bit14",
1569             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1570             NULL, HFILL }
1571         },
1572         { &hf_diameter_3gpp_dsr_flags_bit15,
1573             { "Subscribed VSRVCC Withdrawal", "diameter.3gpp.dsr_flags_bit15",
1574             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1575             NULL, HFILL }
1576         },
1577         { &hf_diameter_3gpp_dsr_flags_bit16,
1578             { "A-MSISDN Withdrawal", "diameter.3gpp.dsr_flags_bit16",
1579             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1580             NULL, HFILL }
1581         },
1582         { &hf_diameter_3gpp_dsa_flags,
1583             { "DSA Flags", "diameter.3gpp.dsa_flags",
1584             FT_UINT32, BASE_HEX, NULL, 0x0,
1585             NULL, HFILL }
1586         },
1587         { &hf_diameter_3gpp_dsa_flags_bit0,
1588             { "Network Node area restricted", "diameter.3gpp.dsa_flags_bit0",
1589             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1590             NULL, HFILL }
1591         },
1592         { &hf_diameter_3gpp_ida_flags,
1593             { "IDA Flags", "diameter.3gpp.ida_flags",
1594             FT_UINT32, BASE_HEX, NULL, 0x0,
1595             NULL, HFILL }
1596         },
1597         { &hf_diameter_3gpp_ida_flags_bit0,
1598             { "Network Node area restricted", "diameter.3gpp.ida_flags_bit0",
1599             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1600             NULL, HFILL }
1601         },
1602         { &hf_diameter_3gpp_pua_flags,
1603             { "PUA Flags", "diameter.3gpp.pua_flags",
1604             FT_UINT32, BASE_HEX, NULL, 0x0,
1605             NULL, HFILL }
1606         },
1607         { &hf_diameter_3gpp_pua_flags_bit0,
1608             { "Freeze M-TMSI", "diameter.3gpp.pua_flags_bit0",
1609             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1610             NULL, HFILL }
1611         },
1612         { &hf_diameter_3gpp_pua_flags_bit1,
1613             { "Freeze P-TMSI", "diameter.3gpp.pua_flags_bit1",
1614             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1615             NULL, HFILL }
1616         },
1617         { &hf_diameter_3gpp_nor_flags,
1618             { "NOR Flags", "diameter.3gpp.nor_flags",
1619             FT_UINT32, BASE_HEX, NULL, 0x0,
1620             NULL, HFILL }
1621         },
1622         { &hf_diameter_3gpp_nor_flags_bit0,
1623             { "Single-Registration-Indication", "diameter.3gpp.nor_flags_bit0",
1624             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1625             NULL, HFILL }
1626         },
1627         { &hf_diameter_3gpp_nor_flags_bit1,
1628             { "SGSN area restricted", "diameter.3gpp.nor_flags_bit1",
1629             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1630             NULL, HFILL }
1631         },
1632         { &hf_diameter_3gpp_nor_flags_bit2,
1633             { "Ready for SM", "diameter.3gpp.nor_flags_bit2",
1634             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1635             NULL, HFILL }
1636         },
1637         { &hf_diameter_3gpp_nor_flags_bit3,
1638             { "UE Reachable", "diameter.3gpp.nor_flags_bit3",
1639             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1640             NULL, HFILL }
1641         },
1642         { &hf_diameter_3gpp_nor_flags_bit4,
1643             { "Delete all APN and PDN GW identity pairs", "diameter.3gpp.nor_flags_bit4",
1644             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1645             NULL, HFILL }
1646         },
1647         { &hf_diameter_3gpp_nor_flags_bit5,
1648             { "UE Reachable from SGSN", "diameter.3gpp.nor_flags_bit5",
1649             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1650             NULL, HFILL }
1651         },
1652         { &hf_diameter_3gpp_nor_flags_bit6,
1653             { "Ready for SM from MME", "diameter.3gpp.nor_flags_bit6",
1654             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1655             NULL, HFILL }
1656         },
1657         { &hf_diameter_3gpp_idr_flags,
1658             { "IDR Flags", "diameter.3gpp.idr_flags",
1659             FT_UINT32, BASE_HEX, NULL, 0x0,
1660             NULL, HFILL }
1661         },
1662         { &hf_diameter_3gpp_idr_flags_bit0,
1663             { "UE Reachability Request", "diameter.3gpp.idr_flags_bit0",
1664             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1665             NULL, HFILL }
1666         },
1667         { &hf_diameter_3gpp_idr_flags_bit1,
1668             { "T-ADS Data Request", "diameter.3gpp.idr_flags_bit1",
1669             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1670             NULL, HFILL }
1671         },
1672         { &hf_diameter_3gpp_idr_flags_bit2,
1673             { "EPS User State Request", "diameter.3gpp.idr_flags_bit2",
1674             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1675             NULL, HFILL }
1676         },
1677         { &hf_diameter_3gpp_idr_flags_bit3,
1678             { "EPS Location Information Request", "diameter.3gpp.idr_flags_bit3",
1679             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1680             NULL, HFILL }
1681         },
1682         { &hf_diameter_3gpp_idr_flags_bit4,
1683             { "Current Location Request", "diameter.3gpp.idr_flags_bit4",
1684             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1685             NULL, HFILL }
1686         },
1687         { &hf_diameter_3gpp_idr_flags_bit5,
1688             { "Local Time Zone Request", "diameter.3gpp.idr_flags_bit5",
1689             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1690             NULL, HFILL }
1691         },
1692         { &hf_diameter_3gpp_idr_flags_bit6,
1693             { "Remove SMS Registration", "diameter.3gpp.idr_flags_bit6",
1694             FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0,
1695             NULL, HFILL }
1696         },
1697         { &hf_diameter_3gpp_ipv6addr,
1698             { "IPv6 Address", "diameter.3gpp.ipv6addr",
1699             FT_IPv6, BASE_NONE, NULL, 0x0,
1700             NULL, HFILL }
1701         },
1702         { &hf_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer,
1703             { "Absolute Time of MBMS Data Transfer", "diameter.3gpp.mbms_abs_time_ofmbms_data_tfer",
1704             FT_STRING, BASE_NONE, NULL, 0x0,
1705             NULL, HFILL }
1706         },
1707         { &hf_diameter_3gpp_udp_port ,
1708             { "UDP Port", "diameter.3gpp.udp_port",
1709             FT_UINT8, BASE_DEC, NULL, 0x0,
1710             NULL, HFILL }
1711         },
1712     };
1713
1714     /* Setup protocol subtree array */
1715     static gint *ett[] = {
1716         &diameter_3gpp_path_ett,
1717         &diameter_3gpp_msisdn_ett,
1718         &diameter_3gpp_uar_flags_ett,
1719         &diameter_3gpp_feature_list_ett,
1720         &diameter_3gpp_tmgi_ett,
1721         &diameter_3gpp_ulr_flags_ett,
1722         &diameter_3gpp_ula_flags_ett,
1723         &diameter_3gpp_dsr_flags_ett,
1724         &diameter_3gpp_dsa_flags_ett,
1725         &diameter_3gpp_ida_flags_ett,
1726         &diameter_3gpp_pua_flags_ett,
1727         &diameter_3gpp_nor_flags_ett,
1728         &diameter_3gpp_idr_flags_ett,
1729     };
1730
1731     /* Required function calls to register the header fields and subtrees used */
1732     proto_diameter_3gpp = proto_register_protocol("Diameter 3GPP","Diameter3GPP", "diameter.3gpp");
1733     proto_register_field_array(proto_diameter_3gpp, hf, array_length(hf));
1734     proto_register_subtree_array(ett, array_length(ett));
1735 }