aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-diameter_3gpp.c
blob: 7c80417f67dc34f01e282b7f765ef6311f664f70 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
/* packet-diameter_3gpp.c
 * Routines for dissecting 3GPP OctetSting AVP:s
 * Copyright 2008, Anders Broman <anders.broman[at]ericsson.com>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation; either version 2
 * of the License, or (at your option) any later version.
 *
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 *
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 */

 /* This dissector registers a dissector table for 3GPP Vendor specific
  * AVP:s which will be called from the Diameter dissector to dissect
  * the content of AVP:s of the OctetString type(or similar).
  */

#include "config.h"

#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/asn1.h>

#include "packet-diameter.h"
#include "packet-diameter_3gpp.h"
#include "packet-gsm_a_common.h"
#include "packet-gtpv2.h"
#include "packet-e164.h"
#include "packet-e212.h"
#include "packet-ntp.h"
#include "packet-s1ap.h"
#include "packet-sip.h"
#include "packet-lcsap.h"

void proto_register_diameter_3gpp(void);
void proto_reg_handoff_diameter_3gpp(void);

static expert_field ei_diameter_3gpp_plmn_id_wrong_len = EI_INIT;

/* Initialize the protocol and registered fields */
static int proto_diameter_3gpp          = -1;

static int hf_diameter_3gpp_timezone                = -1;
static int hf_diameter_3gpp_timezone_adjustment     = -1;
static int hf_diameter_3gpp_rat_type                = -1;
static int hf_diameter_3gpp_visited_nw_id           = -1;
static int hf_diameter_3gpp_path                    = -1;
static int hf_diameter_3gpp_contact                 = -1;
/* static int hf_diameter_3gpp_user_data               = -1; */
static int hf_diameter_3gpp_ipaddr                  = -1;
static int hf_diameter_3gpp_mbms_required_qos_prio  = -1;
static int hf_diameter_3gpp_tmgi                    = -1;
static int hf_diameter_3gpp_service_ind             = -1;
static int hf_diameter_mbms_service_id              = -1;
static int hf_diameter_3gpp_spare_bits = -1;
static int hf_diameter_3gpp_uar_flags_flags = -1;
static int hf_diameter_3gpp_uar_flags_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list_flags = -1;
static int hf_diameter_3gpp_cx_feature_list_flags = -1;
static int hf_diameter_3gpp_cx_feature_list_1_flags_bit0 = -1;
static int hf_diameter_3gpp_cx_feature_list_1_flags_bit1 = -1;
static int hf_diameter_3gpp_cx_feature_list_1_flags_bit2 = -1;
static int hf_diameter_3gpp_cx_feature_list_1_flags_bit3 = -1;
static int hf_diameter_3gpp_cx_feature_list_1_flags_spare_bits = -1;
static int hf_diameter_3gpp_feature_list1_sh_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list1_sh_flags_bit1 = -1;
static int hf_diameter_3gpp_feature_list1_sh_flags_bit2 = -1;
static int hf_diameter_3gpp_feature_list1_sh_flags_bit3 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit1 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit2 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit3 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit4 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit5 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit6 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit7 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit8 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit9 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit10 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit11 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit12 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit13 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit14 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit15 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit16 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit17 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit18 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit19 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit20 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit21 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit22 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit23 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit24 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit25 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit26 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit27 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit28 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit29 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit30 = -1;
static int hf_diameter_3gpp_feature_list1_s6a_flags_bit31 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit1 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit2 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit3 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit4 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit5 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit6 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit7 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit8 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit9 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit10 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit11 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit12 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit13 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit14 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit15 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit16 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit17 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit18 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit19 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit20 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit21 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit22 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit23 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit24 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit25 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit26 = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_bit27 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit1 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit2 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit3 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit4 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit5 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit6 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit7 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit8 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit9 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit10 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit11 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit12 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit13 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit14 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit15 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit16 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit17 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit18 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit19 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit20 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit21 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit22 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit23 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit24 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit25 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit26 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit27 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit28 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit29 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit30 = -1;
static int hf_diameter_3gpp_feature_list_gx_flags_bit31 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit1 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit2 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit3 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit4 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit5 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit6 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit7 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit8 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit9 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_bit10 = -1;
static int hf_diameter_3gpp_feature_list_sd_flags_spare_bits = -1;
static int hf_diameter_3gpp_cms_no_gyn_session_serv_not_allowed = -1;
static int hf_diameter_3gpp_cms_no_gyn_session_serv_allowed = -1;
static int hf_diameter_3gpp_cms_rating_failed = -1;
static int hf_diameter_3gpp_cms_user_unknown = -1;
static int hf_diameter_3gpp_cms_auth_rej = -1;
static int hf_diameter_3gpp_cms_credit_ctrl_not_applicable = -1;
static int hf_diameter_3gpp_cms_end_user_serv_status = -1;
static int hf_diameter_3gpp_qos_subscribed = -1;
static int hf_diameter_3gpp_qos_reliability_cls = -1;
static int hf_diameter_3gpp_qos_prec_class = -1;
static int hf_diameter_3gpp_qos_delay_cls = -1;
static int hf_diameter_3gpp_qos_peak_thr = -1;
static int hf_diameter_3gpp_qos_mean_thr = -1;
static int hf_diameter_3gpp_qos_al_ret_priority = -1;
static int hf_diameter_3gpp_qos_del_of_err_sdu = -1;
static int hf_diameter_3gpp_qos_del_order = -1;
static int hf_diameter_3gpp_qos_traffic_cls = -1;
static int hf_diameter_3gpp_qos_maximum_sdu_size = -1;
static int hf_diameter_3gpp_qos_max_bitrate_upl = -1;
static int hf_diameter_3gpp_qos_max_bitrate_downl = -1;
static int hf_diameter_3gpp_qos_sdu_err_rat = -1;
static int hf_diameter_3gpp_qos_ber = -1;
static int hf_diameter_3gpp_qos_traff_hdl_pri = -1;
static int hf_diameter_3gpp_qos_trans_delay = -1;
static int hf_diameter_3gpp_qos_guar_bitrate_upl = -1;
static int hf_diameter_3gpp_qos_guar_bitrate_downl = -1;
static int hf_diameter_3gpp_qos_source_stat_desc = -1;
static int hf_diameter_3gpp_qos_signalling_ind  = -1;
static int hf_diameter_3gpp_qos_max_bitrate_downl_ext = -1;
static int hf_diameter_3gpp_qos_guar_bitrate_downl_ext = -1;
static int hf_diameter_3gpp_qos_max_bitrate_upl_ext = -1;
static int hf_diameter_3gpp_qos_guar_bitrate_upl_ext = -1;
static int hf_diameter_3gpp_qos_pre_emption_vulnerability = -1;
static int hf_diameter_3gpp_qos_priority_level = -1;
static int hf_diameter_3gpp_qos_pre_emption_capability = -1;
static int hf_diameter_3gpp_ulr_flags = -1;
static int hf_diameter_3gpp_ulr_flags_bit0 = -1;
static int hf_diameter_3gpp_ulr_flags_bit1 = -1;
static int hf_diameter_3gpp_ulr_flags_bit2 = -1;
static int hf_diameter_3gpp_ulr_flags_bit3 = -1;
static int hf_diameter_3gpp_ulr_flags_bit4 = -1;
static int hf_diameter_3gpp_ulr_flags_bit5 = -1;
static int hf_diameter_3gpp_ulr_flags_bit6 = -1;
static int hf_diameter_3gpp_ulr_flags_bit7 = -1;
static int hf_diameter_3gpp_ula_flags = -1;
static int hf_diameter_3gpp_ula_flags_bit0 = -1;
static int hf_diameter_3gpp_ula_flags_bit1 = -1;
static int hf_diameter_3gpp_dsr_flags = -1;
static int hf_diameter_3gpp_dsr_flags_bit0 = -1;
static int hf_diameter_3gpp_dsr_flags_bit1 = -1;
static int hf_diameter_3gpp_dsr_flags_bit2 = -1;
static int hf_diameter_3gpp_dsr_flags_bit3 = -1;
static int hf_diameter_3gpp_dsr_flags_bit4 = -1;
static int hf_diameter_3gpp_dsr_flags_bit5 = -1;
static int hf_diameter_3gpp_dsr_flags_bit6 = -1;
static int hf_diameter_3gpp_dsr_flags_bit7 = -1;
static int hf_diameter_3gpp_dsr_flags_bit8 = -1;
static int hf_diameter_3gpp_dsr_flags_bit9 = -1;
static int hf_diameter_3gpp_dsr_flags_bit10 = -1;
static int hf_diameter_3gpp_dsr_flags_bit11 = -1;
static int hf_diameter_3gpp_dsr_flags_bit12 = -1;
static int hf_diameter_3gpp_dsr_flags_bit13 = -1;
static int hf_diameter_3gpp_dsr_flags_bit14 = -1;
static int hf_diameter_3gpp_dsr_flags_bit15 = -1;
static int hf_diameter_3gpp_dsr_flags_bit16 = -1;
static int hf_diameter_3gpp_dsr_flags_bit17 = -1;
static int hf_diameter_3gpp_dsr_flags_bit18 = -1;
static int hf_diameter_3gpp_dsr_flags_bit19 = -1;
static int hf_diameter_3gpp_dsr_flags_bit20 = -1;
static int hf_diameter_3gpp_dsr_flags_bit21 = -1;
static int hf_diameter_3gpp_dsr_flags_bit22 = -1;
static int hf_diameter_3gpp_dsr_flags_bit23 = -1;
static int hf_diameter_3gpp_dsr_flags_bit24 = -1;
static int hf_diameter_3gpp_dsr_flags_bit25 = -1;
static int hf_diameter_3gpp_dsr_flags_bit26 = -1;
static int hf_diameter_3gpp_dsa_flags = -1;
static int hf_diameter_3gpp_dsa_flags_bit0 = -1;
static int hf_diameter_3gpp_ida_flags = -1;
static int hf_diameter_3gpp_ida_flags_bit0 = -1;
static int hf_diameter_3gpp_pua_flags = -1;
static int hf_diameter_3gpp_pua_flags_bit0 = -1;
static int hf_diameter_3gpp_pua_flags_bit1 = -1;
static int hf_diameter_3gpp_nor_flags = -1;
static int hf_diameter_3gpp_nor_flags_bit0 = -1;
static int hf_diameter_3gpp_nor_flags_bit1 = -1;
static int hf_diameter_3gpp_nor_flags_bit2 = -1;
static int hf_diameter_3gpp_nor_flags_bit3 = -1;
static int hf_diameter_3gpp_nor_flags_bit4 = -1;
static int hf_diameter_3gpp_nor_flags_bit5 = -1;
static int hf_diameter_3gpp_nor_flags_bit6 = -1;
static int hf_diameter_3gpp_nor_flags_bit7 = -1;
static int hf_diameter_3gpp_nor_flags_bit8 = -1;
static int hf_diameter_3gpp_nor_flags_bit9 = -1;
static int hf_diameter_3gpp_idr_flags = -1;
static int hf_diameter_3gpp_idr_flags_bit0 = -1;
static int hf_diameter_3gpp_idr_flags_bit1 = -1;
static int hf_diameter_3gpp_idr_flags_bit2 = -1;
static int hf_diameter_3gpp_idr_flags_bit3 = -1;
static int hf_diameter_3gpp_idr_flags_bit4 = -1;
static int hf_diameter_3gpp_idr_flags_bit5 = -1;
static int hf_diameter_3gpp_idr_flags_bit6 = -1;
static int hf_diameter_3gpp_idr_flags_bit7 = -1;
static int hf_diameter_3gpp_idr_flags_bit8 = -1;
static int hf_diameter_3gpp_ppr_flags = -1;
static int hf_diameter_3gpp_ppr_flags_bit0 = -1;
static int hf_diameter_3gpp_ppr_flags_bit1 = -1;
static int hf_diameter_3gpp_ppr_flags_bit2 = -1;
static int hf_diameter_3gpp_ppr_flags_bit3 = -1;
static int hf_diameter_3gpp_aaa_fail_flags = -1;
static int hf_diameter_3gpp_aaa_fail_flags_bit0 = -1;
static int hf_diameter_3gpp_der_flags = -1;
static int hf_diameter_3gpp_der_flags_bit0 = -1;
static int hf_diameter_3gpp_der_flags_bit1 = -1;
static int hf_diameter_3gpp_dea_flags = -1;
static int hf_diameter_3gpp_dea_flags_bit0 = -1;
static int hf_diameter_3gpp_dea_flags_bit1 = -1;
static int hf_diameter_3gpp_rar_flags = -1;
static int hf_diameter_3gpp_rar_flags_bit0 = -1;
static int hf_diameter_3gpp_rar_flags_bit1 = -1;
static int hf_diameter_3gpp_der_s6b_flags = -1;
static int hf_diameter_3gpp_der_s6b_flags_bit0 = -1;
static int hf_diameter_3gpp_ipv6addr = -1;
static int hf_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer = -1;
static int hf_diameter_3gpp_udp_port = -1;
static int hf_diameter_3gpp_imeisv = -1;
static int hf_diameter_3gpp_af_charging_identifier = -1;
static int hf_diameter_3gpp_af_application_identifier = -1;
static int hf_diameter_3gpp_charging_rule_name = -1;
static int hf_diameter_3gpp_monitoring_key = -1;
static int hf_diameter_3gpp_mbms_bearer_event = -1;
static int hf_diameter_3gpp_mbms_bearer_event_bit0 = -1;
static int hf_diameter_3gpp_mbms_bearer_result = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit0 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit1 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit2 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit3 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit4 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit5 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit6 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit7 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit8 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit9 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit10 = -1;
static int hf_diameter_3gpp_mbms_bearer_result_bit11 = -1;
static int hf_diameter_3gpp_tmgi_allocation_result = -1;
static int hf_diameter_3gpp_tmgi_allocation_result_bit0 = -1;
static int hf_diameter_3gpp_tmgi_allocation_result_bit1 = -1;
static int hf_diameter_3gpp_tmgi_allocation_result_bit2 = -1;
static int hf_diameter_3gpp_tmgi_allocation_result_bit3 = -1;
static int hf_diameter_3gpp_tmgi_allocation_result_bit4 = -1;
static int hf_diameter_3gpp_tmgi_deallocation_result = -1;
static int hf_diameter_3gpp_tmgi_deallocation_result_bit0 = -1;
static int hf_diameter_3gpp_tmgi_deallocation_result_bit1 = -1;
static int hf_diameter_3gpp_tmgi_deallocation_result_bit2 = -1;
static int hf_diameter_3gpp_sar_flags = -1;
static int hf_diameter_3gpp_sar_flags_flags_bit0 = -1;
static int hf_diameter_3gpp_emergency_services_flags = -1;
static int hf_diameter_3gpp_emergency_services_flags_bit0 = -1;
static int hf_diameter_3gpp_pur_flags = -1;
static int hf_diameter_3gpp_pur_flags_spare_bits = -1;
static int hf_diameter_3gpp_pur_flags_bit1 = -1;
static int hf_diameter_3gpp_pur_flags_bit0 = -1;
static int hf_diameter_3gpp_clr_flags = -1;
static int hf_diameter_3gpp_clr_flags_spare_bits = -1;
static int hf_diameter_3gpp_clr_flags_bit1 = -1;
static int hf_diameter_3gpp_clr_flags_bit0 = -1;
static int hf_diameter_3gpp_uvr_flags = -1;
static int hf_diameter_3gpp_uvr_flags_spare_bits = -1;
static int hf_diameter_3gpp_uvr_flags_bit0 = -1;
static int hf_diameter_3gpp_uva_flags = -1;
static int hf_diameter_3gpp_uva_flags_spare_bits = -1;
static int hf_diameter_3gpp_uva_flags_bit0 = -1;
static int hf_diameter_3gpp_subscription_data_flags = -1;
static int hf_diameter_3gpp_subscription_data_flags_spare_bits = -1;
static int hf_diameter_3gpp_subscription_data_flags_bit3 = -1;
static int hf_diameter_3gpp_subscription_data_flags_bit2 = -1;
static int hf_diameter_3gpp_subscription_data_flags_bit1 = -1;
static int hf_diameter_3gpp_subscription_data_flags_bit0 = -1;
static int hf_diameter_3gpp_wlan_offloadability_eutran = -1;
static int hf_diameter_3gpp_wlan_offloadability_eutran_spare_bits = -1;
static int hf_diameter_3gpp_wlan_offloadability_eutran_bit0 = -1;
static int hf_diameter_3gpp_wlan_offloadability_utran = -1;
static int hf_diameter_3gpp_wlan_offloadability_utran_spare_bits = -1;
static int hf_diameter_3gpp_wlan_offloadability_utran_bit0 = -1;
static int hf_diameter_3gpp_air_flags = -1;
static int hf_diameter_3gpp_air_flags_spare_bits = -1;
static int hf_diameter_3gpp_air_flags_bit0 = -1;
static int hf_diameter_3gpp_preferred_data_mode = -1;
static int hf_diameter_3gpp_preferred_data_mode_spare_bits = -1;
static int hf_diameter_3gpp_preferred_data_mode_bit1 = -1;
static int hf_diameter_3gpp_preferred_data_mode_bit0 = -1;
static int hf_diameter_3gpp_v2x_permission = -1;
static int hf_diameter_3gpp_v2x_permission_spare_bits = -1;
static int hf_diameter_3gpp_v2x_permission_bit1 = -1;
static int hf_diameter_3gpp_v2x_permission_bit0 = -1;
static int hf_diameter_3gpp_uar_flags_flags_spare_bits = -1;
static int hf_diameter_3gpp_feature_list1_sh_flags_spare_bits = -1;
static int hf_diameter_3gpp_feature_list2_s6a_flags_spare_bits = -1;
static int hf_diameter_3gpp_cms_spare_bits = -1;
static int hf_diameter_3gpp_ulr_flags_spare_bits = -1;
static int hf_diameter_3gpp_ula_flags_spare_bits = -1;
static int hf_diameter_3gpp_dsr_flags_spare_bits = -1;
static int hf_diameter_3gpp_dsa_flags_spare_bits = -1;
static int hf_diameter_3gpp_acc_res_dat_flags = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit0 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit1 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit2 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit3 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit4 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit5 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit6 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_bit7 = -1;
static int hf_diameter_3gpp_acc_res_dat_flags_spare_bits = -1;
static int hf_diameter_3gpp_ida_flags_spare_bits = -1;
static int hf_diameter_3gpp_pua_flags_spare_bits = -1;
static int hf_diameter_3gpp_nor_flags_spare_bits = -1;
static int hf_diameter_3gpp_idr_flags_spare_bits = -1;
static int hf_diameter_3gpp_ppr_flags_spare_bits = -1;
static int hf_diameter_3gpp_aaa_fail_flags_spare_bits = -1;
static int hf_diameter_3gpp_der_flags_spare_bits = -1;
static int hf_diameter_3gpp_dea_flags_spare_bits = -1;
static int hf_diameter_3gpp_rar_flags_spare_bits = -1;
static int hf_diameter_3gpp_der_s6b_flags_spare_bits = -1;
static int hf_diameter_3gpp_mbms_bearer_event_spare_bits = -1;
static int hf_diameter_3gpp_mbms_bearer_result_spare_bits = -1;
static int hf_diameter_3gpp_tmgi_allocation_result_spare_bits = -1;
static int hf_diameter_3gpp_tmgi_deallocation_result_spare_bits = -1;
static int hf_diameter_3gpp_emergency_services_flags_spare_bits = -1;

static gint diameter_3gpp_path_ett = -1;
static gint diameter_3gpp_feature_list_ett = -1;
static gint diameter_3gpp_uar_flags_ett = -1;
static gint diameter_3gpp_tmgi_ett  = -1;
static gint diameter_3gpp_cms_ett = -1;
static gint diameter_3gpp_qos_subscribed_ett = -1;
static gint diameter_3gpp_ulr_flags_ett = -1;
static gint diameter_3gpp_ula_flags_ett = -1;
static gint diameter_3gpp_dsr_flags_ett = -1;
static gint diameter_3gpp_dsa_flags_ett = -1;
static gint diameter_3gpp_ida_flags_ett = -1;
static gint diameter_3gpp_pua_flags_ett = -1;
static gint diameter_3gpp_nor_flags_ett = -1;
static gint diameter_3gpp_idr_flags_ett = -1;
static gint diameter_3gpp_ppr_flags_ett = -1;
static gint diameter_3gpp_aaa_fail_flags_ett = -1;
static gint diameter_3gpp_der_flags_ett = -1;
static gint diameter_3gpp_dea_flags_ett = -1;
static gint diameter_3gpp_rar_flags_ett = -1;
static gint diameter_3gpp_der_s6b_flags_ett = -1;
static gint diameter_3gpp_mbms_bearer_event_ett = -1;
static gint diameter_3gpp_mbms_bearer_result_ett = -1;
static gint diameter_3gpp_tmgi_allocation_result_ett = -1;
static gint diameter_3gpp_tmgi_deallocation_result_ett = -1;
static gint diameter_3gpp_sar_flags_ett = -1;
static gint diameter_3gpp_emergency_services_flags_ett = -1;
static gint diameter_3gpp_pur_flags_ett = -1;
static gint diameter_3gpp_clr_flags_ett = -1;
static gint diameter_3gpp_uvr_flags_ett = -1;
static gint diameter_3gpp_uva_flags_ett = -1;
static gint diameter_3gpp_subscription_data_flags_ett = -1;
static gint diameter_3gpp_wlan_offloadability_eutran_ett = -1;
static gint diameter_3gpp_wlan_offloadability_utran_ett = -1;
static gint diameter_3gpp_air_flags_ett = -1;
static gint diameter_3gpp_preferred_data_mode_ett = -1;
static gint diameter_3gpp_v2x_permission_ett = -1;

static int hf_diameter_3gpp_feature_list1_rx_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit1 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit2 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit3 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit4 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit5 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit6 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit7 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit8 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit9 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit10 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit11 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit12 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit13 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit14 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit15 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit16 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit17 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_bit18 = -1;
static int hf_diameter_3gpp_feature_list1_rx_flags_spare_bits = -1;

static int hf_diameter_3gpp_feature_list2_rx_flags_bit0 = -1;
static int hf_diameter_3gpp_feature_list2_rx_flags_spare_bits = -1;

static int hf_diameter_3gpp_ran_nas_protocol_type = -1;
static int hf_diameter_3gpp_ran_nas_cause_type = -1;
static int hf_diameter_3gpp_ran_nas_cause_value = -1;
static int hf_diameter_3gpp_s1ap_radio_network = -1;
static int hf_diameter_3gpp_s1ap_transport = -1;
static int hf_diameter_3gpp_s1ap_nas = -1;
static int hf_diameter_3gpp_s1ap_protocol = -1;
static int hf_diameter_3gpp_s1ap_misc = -1;
static int hf_diameter_3gpp_emm_cause = -1;
static int hf_diameter_3gpp_esm_cause = -1;
static int hf_diameter_3gpp_diameter_cause = -1;
static int hf_diameter_3gpp_ikev2_cause = -1;

/* Dissector handles */
static dissector_handle_t xml_handle;

/* Forward declarations */
static int dissect_diameter_3gpp_ipv6addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_);

/*
 *  AVP Code: 8 IMSI-MNC-MCC
 */
static int
dissect_diameter_3gpp_imsi_mnc_mcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    guint32 str_len;

    str_len = tvb_reported_length(tvb);
    dissect_e212_mcc_mnc_in_utf8_address(tvb, pinfo, tree, 0);

    return str_len;
}

/* AVP Code: 15 3GPP-SGSN-IPv6-Address */
static int
dissect_diameter_3gpp_sgsn_ipv6_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
    /* 3GPP AVP code 15 has a conflict between imscxdx.xml (where the AVP
    * contains an Unsigned32 enum) and TGPPGmb.xml (where the AVP contains
    * an OctetString IPv6 address).  This function decodes the latter; we
    * (silently) abort dissection if the length is 4 on the assumption that
    * the old IMS AVP is what we're decoding.
    */
    if (tvb_reported_length(tvb) == 4)
        return 4;

    return dissect_diameter_3gpp_ipv6addr(tvb, pinfo, tree, data);

}

/*
 *  AVP Code: 18 SGSN-MNC-MCC
 */
static int
dissect_diameter_3gpp_sgsn_mnc_mcc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    guint32 str_len;

    str_len = tvb_reported_length(tvb);
    dissect_e212_mcc_mnc_in_utf8_address(tvb, pinfo, tree, 0);

    return str_len;
}

/* AVP Code: 20 3GPP-IMEISV
* 3GPP TS 29.061
*/

static int
dissect_diameter_3gpp_imeisv(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
    proto_item *item;
    int offset = 0, i;
    int length = tvb_reported_length(tvb);
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;

    if (tree){
        for (i = 0; i < length; i++)
            if (!g_ascii_isprint(tvb_get_guint8(tvb, i)))
                return length;

        item = proto_tree_add_item_ret_string(tree, hf_diameter_3gpp_imeisv, tvb, offset, length,
                                              ENC_UTF_8 | ENC_NA, wmem_packet_scope(), (const guint8**)&diam_sub_dis->avp_str);
        PROTO_ITEM_SET_GENERATED(item);
    }

    return length;
}

/* AVP Code: 21 3GPP-RAT-Type
* 3GPP TS 29.061, 29.274
*/
static const value_string diameter_3gpp_rat_type_vals[] = {
    { 0, "Reserved" },
    { 1, "UTRAN" },
    { 2, "GERAN" },
    { 3, "WLAN" },
    { 4, "GAN" },
    { 5, "HSPA Evolution" },
    { 6, "EUTRAN (WB-E-UTRAN)" },
    { 7, "Virtual" },
    { 8, "EUTRAN-NB-IoT" },
    { 101, "IEEE 802.16e" },
    { 102, "3GPP2 eHRPD" },
    { 103, "3GPP2 HRPD" },
    { 104, "3GPP2 1xRTT" },
    { 105, "3GPP2 UMB" },
    { 0, NULL }
};

static int
dissect_diameter_3gpp_rat_type(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int offset = 0;
    int length = tvb_reported_length(tvb);

    proto_tree_add_item(tree, hf_diameter_3gpp_rat_type, tvb, offset, 1, ENC_BIG_ENDIAN);

    return length;
}

/* AVP Code: 23 3GPP-MS-TimeZone
 * 3GPP TS 29.061
 */
static const value_string daylight_saving_time_vals[] = {
    {0, "No adjustment"},
    {1, "+1 hour adjustment for Daylight Saving Time"},
    {2, "+2 hours adjustment for Daylight Saving Time"},
    {3, "Reserved"},
    {0, NULL}
};

static int
dissect_diameter_3gpp_ms_timezone(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
    int offset = 0;
    guint8      oct, hours, minutes;
    char        sign;
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;

    /* 3GPP TS 23.040 version 6.6.0 Release 6
     * 9.2.3.11 TP-Service-Centre-Time-Stamp (TP-SCTS)
     * :
     * The Time Zone indicates the difference, expressed in quarters of an hour,
     * between the local time and GMT. In the first of the two semi-octets,
     * the first bit (bit 3 of the seventh octet of the TP-Service-Centre-Time-Stamp field)
     * represents the algebraic sign of this difference (0: positive, 1: negative).
     */

    oct = tvb_get_guint8(tvb, offset);
    sign = (oct & 0x08) ? '-' : '+';
    oct = (oct >> 4) + (oct & 0x07) * 10;
    hours =  oct / 4;
    minutes = oct % 4 * 15;

    proto_tree_add_uint_format_value(tree, hf_diameter_3gpp_timezone, tvb, offset, 1, oct, "GMT %c %d hours %d minutes", sign, hours, minutes);
    offset++;

    oct = tvb_get_guint8(tvb, offset) & 0x3;
    proto_tree_add_item(tree, hf_diameter_3gpp_timezone_adjustment, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;

    diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "Timezone: GMT %c %d hours %d minutes %s",
        sign,
        hours,
        minutes,
        val_to_str_const(oct, daylight_saving_time_vals, "Unknown"));

    return offset;
}
/* AVP Code: 29 3GPP-TWAN-Identifier
 * 3GPP TS 29.061 V14.2.0 (2016-12)
*/
static int
dissect_diameter_3gpp_twan_identifier(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    int length = tvb_reported_length(tvb);

    dissect_gtpv2_twan_identifier(tvb, pinfo, tree, NULL, length, 0, 0, NULL);

    return length;
}

/*
* AVP Code: 504 AF-Application-Identifier
*/

static int
dissect_diameter_3gpp_af_application_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
    proto_item *item;
    int offset = 0, i;
    int length = tvb_reported_length(tvb);
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;

    if (tree){
        for (i = 0; i < length; i++)
            if (!g_ascii_isprint(tvb_get_guint8(tvb, i)))
                return length;

        item = proto_tree_add_item_ret_string(tree, hf_diameter_3gpp_af_application_identifier, tvb, offset, length,
                                                ENC_UTF_8 | ENC_NA, wmem_packet_scope(), (const guint8**)&diam_sub_dis->avp_str);
        PROTO_ITEM_SET_GENERATED(item);
    }

    return length;
}

/*
* AVP Code: 505 AF-Charging-Identifier
*/

static int
dissect_diameter_3gpp_af_charging_identifier(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
    proto_item *item;
    int offset = 0, i;
    int length = tvb_reported_length(tvb);
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;

    if (tree){
        for (i = 0; i < length; i++)
            if (!g_ascii_isprint(tvb_get_guint8(tvb, i)))
                return length;

        item = proto_tree_add_item_ret_string(tree, hf_diameter_3gpp_af_charging_identifier, tvb, offset, length,
                                              ENC_UTF_8 | ENC_NA, wmem_packet_scope(), (const guint8**)&diam_sub_dis->avp_str);
        PROTO_ITEM_SET_GENERATED(item);
    }

    return length;
}

/* AVP Code: 600 Visited-Network-Identifier
 * imscxdx.xml
 * 6.3.1 Visited-Network-Identifier AVP
 * The Visited-Network-Identifier AVP is of type OctetString. This AVP contains an identifier that helps the home
 * network to identify the visited network (e.g. the visited network domain name).
 */

static int
dissect_diameter_3gpp_visited_nw_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    proto_item *item;
    int offset = 0, i;
    int length = tvb_reported_length(tvb);

    for(i = 0; i < length; i++)
        if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
            return length;

    item = proto_tree_add_item(tree, hf_diameter_3gpp_visited_nw_id, tvb, offset, length, ENC_ASCII|ENC_NA);
    PROTO_ITEM_SET_GENERATED(item);


    return length;
}

/* AVP Code: 601 Public-Identity
 * TGPP.xml
 * 6.3.2 Public-Identity AVP
 * The Public-Identity AVP is of type UTF8String. This AVP contains the public identity of a user in the IMS. The syntax
 * of this AVP corresponds either to a SIP URL (with the format defined in IETF RFC 3261 [3] and IETF RFC 2396 [4])
 * or a TEL URL (with the format defined in IETF RFC 3966 [8]). Both SIP URL and TEL URL shall be in canonical
 * form, as described in 3GPP TS 23.003 [13].
 */
static int
dissect_diameter_3gpp_public_identity(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int length = tvb_reported_length(tvb);

    dfilter_store_sip_from_addr(tvb, tree, 0, length);

    return length;

}

/* AVP Code: 629 Feature-List-id
 * Feature list Id is neede to dissect Feature list in S6a/S6d application
 * Ref 3GPP TS 29.272
 */

static int
dissect_diameter_3gpp_feature_list_id(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void *data)
{
    diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data;

    if(diam_sub_dis_inf) {
        diam_sub_dis_inf->feature_list_id = tvb_get_ntohl(tvb,0);
    }

    return 4;
}

/* AVP Code: 637 UAR-Flags
 * imscxdx.xml
 * IMS Cx Dx AVPS 3GPP TS 29.229
 */

static int
dissect_diameter_3gpp_uar_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    const int *flags[] = {
        &hf_diameter_3gpp_uar_flags_flags_spare_bits,
        &hf_diameter_3gpp_uar_flags_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_uar_flags_flags, diameter_3gpp_uar_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 630 Feature-List
 * Interpretation depends on Application Id
 * imscxdx.xml
 * IMS Cx Dx AVPS 3GPP TS 29.229
 */
static const int *diameter_3gpp_cx_feature_list_1_fields[] = {
    &hf_diameter_3gpp_cx_feature_list_1_flags_spare_bits,
    &hf_diameter_3gpp_cx_feature_list_1_flags_bit3,
    &hf_diameter_3gpp_cx_feature_list_1_flags_bit2,
    &hf_diameter_3gpp_cx_feature_list_1_flags_bit1,
    &hf_diameter_3gpp_cx_feature_list_1_flags_bit0,
    NULL
};

/* TS 129 212 V14.0.0 (2016-09) */
static const int *diameter_3gpp_gx_feature_list_1_fields[] = {
    &hf_diameter_3gpp_feature_list_gx_flags_bit31,
    &hf_diameter_3gpp_feature_list_gx_flags_bit30,
    &hf_diameter_3gpp_feature_list_gx_flags_bit29,
    &hf_diameter_3gpp_feature_list_gx_flags_bit28,
    &hf_diameter_3gpp_feature_list_gx_flags_bit27,
    &hf_diameter_3gpp_feature_list_gx_flags_bit26,
    &hf_diameter_3gpp_feature_list_gx_flags_bit25,
    &hf_diameter_3gpp_feature_list_gx_flags_bit24,
    &hf_diameter_3gpp_feature_list_gx_flags_bit23,
    &hf_diameter_3gpp_feature_list_gx_flags_bit22,
    &hf_diameter_3gpp_feature_list_gx_flags_bit21,
    &hf_diameter_3gpp_feature_list_gx_flags_bit20,
    &hf_diameter_3gpp_feature_list_gx_flags_bit19,
    &hf_diameter_3gpp_feature_list_gx_flags_bit18,
    &hf_diameter_3gpp_feature_list_gx_flags_bit17,
    &hf_diameter_3gpp_feature_list_gx_flags_bit16,
    &hf_diameter_3gpp_feature_list_gx_flags_bit15,
    &hf_diameter_3gpp_feature_list_gx_flags_bit14,
    &hf_diameter_3gpp_feature_list_gx_flags_bit13,
    &hf_diameter_3gpp_feature_list_gx_flags_bit12,
    &hf_diameter_3gpp_feature_list_gx_flags_bit11,
    &hf_diameter_3gpp_feature_list_gx_flags_bit10,
    &hf_diameter_3gpp_feature_list_gx_flags_bit9,
    &hf_diameter_3gpp_feature_list_gx_flags_bit8,
    &hf_diameter_3gpp_feature_list_gx_flags_bit7,
    &hf_diameter_3gpp_feature_list_gx_flags_bit6,
    &hf_diameter_3gpp_feature_list_gx_flags_bit5,
    &hf_diameter_3gpp_feature_list_gx_flags_bit4,
    &hf_diameter_3gpp_feature_list_gx_flags_bit3,
    &hf_diameter_3gpp_feature_list_gx_flags_bit2,
    &hf_diameter_3gpp_feature_list_gx_flags_bit1,
    &hf_diameter_3gpp_feature_list_gx_flags_bit0,
    NULL
};

/* 3GPP TS 29.212 V14.0.0 (2016-09) */
static const int *diameter_3gpp_sd_feature_list_fields[] = {
    &hf_diameter_3gpp_feature_list_sd_flags_spare_bits,
    &hf_diameter_3gpp_feature_list_sd_flags_bit10,
    &hf_diameter_3gpp_feature_list_sd_flags_bit9,
    &hf_diameter_3gpp_feature_list_sd_flags_bit8,
    &hf_diameter_3gpp_feature_list_sd_flags_bit7,
    &hf_diameter_3gpp_feature_list_sd_flags_bit6,
    &hf_diameter_3gpp_feature_list_sd_flags_bit5,
    &hf_diameter_3gpp_feature_list_sd_flags_bit4,
    &hf_diameter_3gpp_feature_list_sd_flags_bit3,
    &hf_diameter_3gpp_feature_list_sd_flags_bit2,
    &hf_diameter_3gpp_feature_list_sd_flags_bit1,
    &hf_diameter_3gpp_feature_list_sd_flags_bit0,
    NULL
};

static int
dissect_diameter_3gpp_feature_list(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
    int offset = 0;
    guint32 application_id = 0, feature_list_id = 0;
    diam_sub_dis_t *diam_sub_dis_inf = (diam_sub_dis_t*)data;

    if(diam_sub_dis_inf) {
        application_id = diam_sub_dis_inf->application_id;
        feature_list_id = diam_sub_dis_inf->feature_list_id;
    }

    switch (application_id) {
    case DIAM_APPID_3GPP_CX:
        proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_diameter_3gpp_cx_feature_list_flags,
            diameter_3gpp_feature_list_ett, diameter_3gpp_cx_feature_list_1_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        break;
    case DIAM_APPID_3GPP_RX:
    {
        if (feature_list_id == 1) {
            /* 3GPP TS 129 214 Table 5.4.1.1: Features of Feature-List-ID 1 used in Rx */
            const int *flags[] = {
                &hf_diameter_3gpp_feature_list1_rx_flags_spare_bits,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit18,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit17,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit16,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit15,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit14,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit13,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit12,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit11,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit10,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit9,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit8,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit7,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit6,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit5,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit4,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit3,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit2,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit1,
                &hf_diameter_3gpp_feature_list1_rx_flags_bit0,
                NULL
            };

            proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_diameter_3gpp_feature_list_flags, diameter_3gpp_feature_list_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        }
        else if (feature_list_id == 2) {
            const int *flags[] = {
                &hf_diameter_3gpp_feature_list2_rx_flags_spare_bits,
                &hf_diameter_3gpp_feature_list2_rx_flags_bit0,
                NULL
            };

            proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_diameter_3gpp_feature_list_flags, diameter_3gpp_feature_list_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        }
    }
        break;
    case DIAM_APPID_3GPP_SH:
        {
        const int *flags[] = {
            &hf_diameter_3gpp_feature_list1_sh_flags_spare_bits,
            &hf_diameter_3gpp_feature_list1_sh_flags_bit3,
            &hf_diameter_3gpp_feature_list1_sh_flags_bit2,
            &hf_diameter_3gpp_feature_list1_sh_flags_bit1,
            &hf_diameter_3gpp_feature_list1_sh_flags_bit0,
            NULL
        };

        proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_diameter_3gpp_feature_list_flags, diameter_3gpp_feature_list_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        }
        break;
    case DIAM_APPID_3GPP_S6A_S6D:
        if (feature_list_id == 1) {
            /* 3GPP TS 29.272 Table 7.3.10/1: Features of Feature-List-ID 1 used in S6a/S6d */
            const int *flags[] = {
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit31,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit30,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit29,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit28,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit27,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit26,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit25,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit24,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit23,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit22,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit21,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit20,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit19,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit18,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit17,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit16,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit15,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit14,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit13,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit12,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit11,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit10,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit9,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit8,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit7,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit6,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit5,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit4,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit3,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit2,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit1,
                &hf_diameter_3gpp_feature_list1_s6a_flags_bit0,
                NULL
            };

            proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_diameter_3gpp_feature_list_flags, diameter_3gpp_feature_list_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        }
        else if (feature_list_id == 2) {
            /* 3GPP TS 29.272 Table 7.3.10/2: Features of Feature-List-ID 2 used in S6a/S6d */
            const int *flags[] = {
                &hf_diameter_3gpp_feature_list2_s6a_flags_spare_bits,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit27,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit26,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit25,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit24,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit23,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit22,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit21,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit20,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit19,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit18,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit17,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit16,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit15,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit14,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit13,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit12,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit11,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit10,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit9,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit8,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit7,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit6,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit5,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit4,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit3,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit2,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit1,
                &hf_diameter_3gpp_feature_list2_s6a_flags_bit0,
                NULL
            };

            proto_tree_add_bitmask_with_flags(tree, tvb, offset, hf_diameter_3gpp_feature_list_flags, diameter_3gpp_feature_list_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        }
        break;
    case DIAM_APPID_3GPP_GX: /* TS 129 212 V12.9.0 (2015-07) */
        proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_feature_list_gx_flags,
            diameter_3gpp_feature_list_ett, diameter_3gpp_gx_feature_list_1_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND);

        break;
    case DIAM_APPID_3GPP_SD: /* 3GPP TS 29.212 V14.0.0 (2016-09) */
        proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_feature_list_sd_flags,
            diameter_3gpp_feature_list_ett, diameter_3gpp_sd_feature_list_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND);
        break;
    default:
        break;
    }

    return 4;

}

/* AVP Code: 640 Path
 * imscxdx.xml
 * IMS Cx Dx AVPS 3GPP TS 29.229
 * 6.3.47 Path AVP
 * The Path AVP is of type OctetString and it contains a comma separated list of SIP proxies in the Path header as defined
 * in IETF RFC 3327 [17].
 */
static int
dissect_diameter_3gpp_path(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    proto_tree *sub_tree;
    int offset = 0, comma_offset;
    int end_offset = tvb_reported_length(tvb) - 1;

    sub_tree = proto_tree_add_subtree(tree, tvb, offset, -1, diameter_3gpp_path_ett, NULL, "Paths");

    while (offset < end_offset) {
        comma_offset = tvb_find_guint8(tvb, offset, -1, ',');
        if(comma_offset == -1) {
            proto_tree_add_item(sub_tree, hf_diameter_3gpp_path, tvb, offset, comma_offset, ENC_ASCII|ENC_NA);
            return end_offset;
        }
        proto_tree_add_item(sub_tree, hf_diameter_3gpp_path, tvb, offset, comma_offset, ENC_ASCII|ENC_NA);
        offset = comma_offset+1;
    }


    return tvb_reported_length(tvb);
}

/* AVP Code: 641 Contact
 * imscxdx.xml
 * IMS Cx Dx AVPS 3GPP TS 29.229
 * 6.3.48 Contact AVP
 * The Contact AVP is of type OctetString and it contains the Contact Addresses and Parameters in the Contact header as
 * defined in IETF RFC 3261.
 */
static int
dissect_diameter_3gpp_contact(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    proto_item *item;
    int offset = 0;

    item = proto_tree_add_item(tree, hf_diameter_3gpp_contact, tvb, offset, -1, ENC_ASCII|ENC_NA);
    PROTO_ITEM_SET_GENERATED(item);

    return tvb_reported_length(tvb);
}

/* AVP Code: 701 MSISDN */
static int
dissect_diameter_3gpp_msisdn(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int offset = 0;
    int length = tvb_reported_length(tvb);

    dissect_e164_msisdn(tvb, tree, offset, length, E164_ENC_BCD);

    return length;
}

/* AVP Code: 655 SAR-Flags
* TGPP.xml
* IMS Cx Dx AVPS 3GPP TS 29.229
*/

static const int *diameter_3gpp_sar_fields[] = {
    &hf_diameter_3gpp_sar_flags_flags_bit0,
    NULL
};

static int
dissect_diameter_3gpp_sar_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_sar_flags,
        diameter_3gpp_sar_flags_ett, diameter_3gpp_sar_fields, ENC_BIG_ENDIAN, BMT_NO_APPEND);

    return 4;
}

/* AVP Code: 702 User-Data
 * TGPPSh.xml
 * The AVP codes from 709 to799 are reserved for TS 29.329
 */
/* AVP Code: 606 User-Data
 * imscxdx.xml
 * IMS Cx Dx AVPS 3GPP TS 29.229
 */
static int
dissect_diameter_3gpp_user_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    int length = tvb_reported_length(tvb);

    /* If there is less than 38 characters this is not XML
     * <?xml version="1.0" encoding="UTF-8"?>
     */
    if(length < 38)
        return length;

    if (tvb_strncaseeql(tvb, 0, "<?xml", 5) == 0 && xml_handle) {
        call_dissector(xml_handle, tvb, pinfo, tree);
    }

    return length;

}

/*
 * AVP Code: 704 Service-Indication
 */
static int
dissect_diameter_3gpp_service_ind(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    proto_item *item;
    int offset = 0, i;
    int length = tvb_reported_length(tvb);

    for(i = 0; i < length; i++)
        if(!g_ascii_isprint(tvb_get_guint8(tvb, i)))
            return length;

    item = proto_tree_add_item(tree, hf_diameter_3gpp_service_ind, tvb, offset, length, ENC_ASCII|ENC_NA);
    PROTO_ITEM_SET_GENERATED(item);

    return length;
}

/* AVP Code: 900 TMGI */
static int
dissect_diameter_3gpp_tmgi(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    proto_item *item;
    proto_tree *sub_tree;
    int offset = 0;

    item = proto_tree_add_item(tree, hf_diameter_3gpp_tmgi, tvb, offset, 6, ENC_NA);
    sub_tree = proto_item_add_subtree(item,diameter_3gpp_tmgi_ett);

    /* MBMS Service ID consisting of three octets. MBMS Service ID consists of a 6-digit
     * fixed-length hexadecimal number between 000000 and FFFFFF.
     * MBMS Service ID uniquely identifies an MBMS bearer service within a PLMN.
     */

    proto_tree_add_item(sub_tree, hf_diameter_mbms_service_id, tvb, offset, 3, ENC_BIG_ENDIAN);
    offset = offset+3;
    offset = dissect_e212_mcc_mnc(tvb, pinfo, sub_tree, offset, E212_NONE, TRUE);

    return offset;

}

/* AVP Code: 903 MBMS-Service-Area */

/* AVP Code: 917 MBMS-GGSN-IPv6-Address */
static int
dissect_diameter_3gpp_ipv6addr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int offset = 0;

    proto_tree_add_item(tree, hf_diameter_3gpp_ipv6addr, tvb, offset, 16, ENC_NA);

    offset += 16;

    return offset;
}


/* AVP Code: 918 MBMS-BMSC-SSM-IP-Address */
static int
dissect_diameter_3gpp_ipaddr(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int offset = 0;

    proto_tree_add_item(tree, hf_diameter_3gpp_ipaddr, tvb, offset, 4, ENC_BIG_ENDIAN);
    offset += 4;

    return offset;

}

/* AVP Code: 909 RAI AVP
 * 17.7.12 RAI AVP
 * The RAI AVP (AVP Code 909) is of type UTF8String, and contains the Routing Area Identity of the SGSN where the
 * UE is registered. RAI use and structure is specified in 3GPP TS 23.003 [40].
 * 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
 * three digits) octets as follows:
 * - The MCC shall be encoded first using three UTF-8 characters on three octets, each character representing a
 * decimal digit starting with the first MCC digit.
 * - Then, the MNC shall be encoded as either two or three UTF-8 characters on two or three octets, each character
 * representing a decimal digit starting with the first MNC digit.
 * - The Location Area Code (LAC) is encoded next using four UTF-8 characters on four octets, each character
 * representing a hexadecimal digit of the LAC which is two binary octets long.
 * - The Routing Area Code (RAC) is encoded last using two UTF-8 characters on two octets, each character
 * representing a hexadecimal digit of the RAC which is one binary octet long.
 * NOTE: As an example, a RAI with the following information: MCC=123, MNC=45, LAC=41655(0xA2C1) and
 * RAC=10(0x0A) is encoded within the RAI AVP as a UTF-8 string of "12345A2C10A".
 */

static int
dissect_diameter_3gpp_rai(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree _U_, void *data)
{
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;
    guint length;

    length = tvb_reported_length(tvb);

    if(length==12) {
        diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %s, MNC %s, LAC 0x%s, RAC 0x%s",
            tvb_get_string_enc(wmem_packet_scope(), tvb,  0, 3, ENC_UTF_8|ENC_NA), /* MCC 3 digits */
            tvb_get_string_enc(wmem_packet_scope(), tvb,  3, 3, ENC_UTF_8|ENC_NA), /* MNC 3 digits */
            tvb_get_string_enc(wmem_packet_scope(), tvb,  6, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */
            tvb_get_string_enc(wmem_packet_scope(), tvb, 10, 2, ENC_UTF_8|ENC_NA)  /* RAC 2 digits */
            );
    } else {
        diam_sub_dis->avp_str = wmem_strdup_printf(wmem_packet_scope(), "MCC %s, MNC %s, LAC 0x%s, RAC 0x%s",
            tvb_get_string_enc(wmem_packet_scope(), tvb,  0, 3, ENC_UTF_8|ENC_NA), /* MCC 3 digits */
            tvb_get_string_enc(wmem_packet_scope(), tvb,  3, 2, ENC_UTF_8|ENC_NA), /* MNC 2 digits */
            tvb_get_string_enc(wmem_packet_scope(), tvb,  5, 4, ENC_UTF_8|ENC_NA), /* LCC 4 digits */
            tvb_get_string_enc(wmem_packet_scope(), tvb,  9, 2, ENC_UTF_8|ENC_NA)  /* RAC 2 digits */
            );
    }

    return length;

}
/* AVP Code: 913 MBMS-Required-QoS */
static int
dissect_diameter_3gpp_mbms_required_qos(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    int offset = 0;
    guint length;

    /* Octet
     * 1        Allocation/Retention Priority as specified in 3GPP TS 23.107.
     *          This octet encodes each priority level defined in 3GPP TS 23.107
     *          as the binary value of the priority level. It specifies the relative
     *          importance of the actual MBMS bearer service compared to other MBMS
     *          and non-MBMS bearer services for allocation and retention of the
     *          MBMS bearer service.
     * 2-N      QoS Profile as specified by the Quality-of-Service information element,
     *          from octet 3 onwards, in 3GPP TS 24.008
     */
    proto_tree_add_item(tree, hf_diameter_3gpp_mbms_required_qos_prio, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;
    length = tvb_reported_length(tvb) - 1;
    de_sm_qos(tvb, tree,  pinfo, offset,length, NULL, 0);
    return offset+length;

}

/* AVP Code: 926 MBMS-BMSC-SSM-UDP-Port */
/* AVP Code: 927 MBMS-GW-UDP-Port */
static int
dissect_diameter_3gpp_udp_port(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int offset = 0;

    proto_tree_add_item(tree, hf_diameter_3gpp_udp_port, tvb, offset, 1, ENC_BIG_ENDIAN);

    offset += 1;

    return offset;
}

/* AVP Code: 929 MBMS-Data-Transfer-Start */
/* AVP Code: 930 MBMS-Data-Transfer-Stop */
static int
dissect_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int offset = 0;
    const gchar *time_str;

    time_str = tvb_ntp_fmt_ts(tvb, offset);
    proto_tree_add_string(tree, hf_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer, tvb, offset, 8, time_str);
    offset+=8;

    return offset;
}

/*
 * AVP Code: 1005 Charging-Rule-Name
 */
static int
dissect_diameter_3gpp_charging_rule_name(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
    proto_item *item;
    int offset = 0, i;
    int length = tvb_reported_length(tvb);
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;

    if (tree){
        for (i = 0; i < length; i++)
            if (!g_ascii_isprint(tvb_get_guint8(tvb, i)))
                return length;

        item = proto_tree_add_item_ret_string(tree, hf_diameter_3gpp_charging_rule_name, tvb, offset, length,
                                              ENC_UTF_8 | ENC_NA, wmem_packet_scope(), (const guint8**)&diam_sub_dis->avp_str);
        PROTO_ITEM_SET_GENERATED(item);
    }

    return length;
}

/*
 * AVP Code: 1066 Monitoring-key
 */
static int
dissect_diameter_3gpp_monitoring_key(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data)
{
    proto_item *item;
    int offset = 0, i;
    int length = tvb_reported_length(tvb);
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;

    if (tree){
        for (i = 0; i < length; i++)
            if (!g_ascii_isprint(tvb_get_guint8(tvb, i)))
                return length;

        item = proto_tree_add_item_ret_string(tree, hf_diameter_3gpp_monitoring_key, tvb, offset, length,
                                              ENC_UTF_8 | ENC_NA, wmem_packet_scope(), (const guint8**)&diam_sub_dis->avp_str);
        PROTO_ITEM_SET_GENERATED(item);
    }

    return length;
}

/* AVP Code: 1082 Credit-Management-Status */
static int
dissect_diameter_3gpp_credit_management_status(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_cms_spare_bits,
        &hf_diameter_3gpp_cms_no_gyn_session_serv_not_allowed,
        &hf_diameter_3gpp_cms_no_gyn_session_serv_allowed,
        &hf_diameter_3gpp_cms_rating_failed,
        &hf_diameter_3gpp_cms_user_unknown,
        &hf_diameter_3gpp_cms_auth_rej,
        &hf_diameter_3gpp_cms_credit_ctrl_not_applicable,
        &hf_diameter_3gpp_cms_end_user_serv_status,
        NULL
    };


    proto_tree *subtree = proto_tree_add_subtree(tree, tvb, 0, 4, diameter_3gpp_cms_ett, NULL, "Credit-Management-Status bit mask");
    proto_tree_add_bitmask_list(subtree, tvb, 0, 4, flags, ENC_BIG_ENDIAN);
    return 4;
}

/* AVP Code: 1242 location estimate */
static int
dissect_diameter_3gpp_location_estimate(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    dissect_geographical_description(tvb, pinfo, tree);

    return tvb_reported_length(tvb);
}

/* Helper function returning the main bitrates in kbps */
static guint32
qos_calc_bitrate(guint8 oct)
{
    if (oct <= 0x3f)
        return oct;
    if (oct <= 0x7f)
        return 64 + (oct - 0x40) * 8;

    return 576 + (oct - 0x80) * 64;
}

/* Helper function returning the extended bitrates in kbps */
static guint32
qos_calc_ext_bitrate(guint8 oct)
{
    if (oct <= 0x4a)
        return 8600 + oct * 100;
    if (oct <= 0xba)
        return 16000 + (oct - 0x4a) * 1000;

    return 128000 + (oct - 0xba) * 2000;
}


/* 3GPP TS 29.272
 * 7.3.77 QoS-Subscribed
 * AVP Code: 1404 QoS-Subscribed
 *
 * The QoS-Subscribed AVP is of type OctetString. Octets are coded according to 3GPP TS 29.002
 * (octets of QoS-Subscribed, Ext-QoS-Subscribed, Ext2-QoS-Subscribed, Ext3-QoS-Subscribed and
 * Ext4-QoS-Subscribed values are concatenated).
 *
 */
static int
dissect_diameter_3ggp_qos_susbscribed(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    guint offset = 0;
    guint length = tvb_reported_length(tvb);
    proto_tree *subtree;
    proto_item *item;
    guchar oct, tmp_oct;
    const gchar *str;
    guint32 tmp32;

    item = proto_tree_add_item(tree, hf_diameter_3gpp_qos_subscribed, tvb, offset, length, ENC_NA);
    subtree = proto_item_add_subtree(item, diameter_3gpp_qos_subscribed_ett);

    /* QoS-Subscribed:: SIZE(3)
    * 1-3   Octets are coded according to TS 3GPP TS 24.008 Quality of Service Octets 3-5
    */
    if (length >= 3) {
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_reliability_cls, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_delay_cls, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bits_item(subtree, hf_diameter_3gpp_spare_bits, tvb, offset << 3, 2, ENC_BIG_ENDIAN);
        offset += 1;

        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_prec_class, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bits_item(subtree, hf_diameter_3gpp_spare_bits, tvb, (offset << 3) + 4, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_peak_thr, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;

        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_mean_thr, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bits_item(subtree, hf_diameter_3gpp_spare_bits, tvb, (offset << 3), 3, ENC_BIG_ENDIAN);
        offset += 1;
    }

    /* Ext-QoS-Subscribed:: SIZE(1..9)
    *   1   Allocation / Retention Priority (This octet encodes each priority level defined in
    *           23.107 as the binary value of the priority level, declaration in 29.060).
    * 2-9   Octets are coded according to 3GPP TS 24.008 Quality of Service Octets 6-13
    */
    if (length >= 4) {
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_al_ret_priority, tvb, offset, 1, ENC_NA);
        offset += 1;
    }

    if (length >= 5) {
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_del_of_err_sdu, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_del_order, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_traffic_cls, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;
    }

    if (length >= 6) {
        oct = tvb_get_guint8(tvb, offset);
        switch (oct) {
            case 0x00: str = "Subscribed maximum SDU size (MS to net); Reserved (net to MS)"; break;
            case 0x97: str = "1502 octets"; break;
            case 0x98: str = "1510 octets"; break;
            case 0x99: str = "1520 octets"; break;
            case 0xff: str = "Reserved"; break;
            default:   str = "Unspecified/Reserved";
        }

        if ((oct >= 1) && (oct <= 0x96))
            proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_maximum_sdu_size, tvb, offset, 1, oct, "%u octets (%u)", oct * 10, oct);
        else
            proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_maximum_sdu_size, tvb, offset, 1, oct, "%s (%u)", str, oct);

        offset += 1;
    }

    if (length >= 7) {
        oct = tvb_get_guint8(tvb, offset);

        switch (oct) {
            case 0x00: str = "Subscribed maximum bit rate for uplink (MS to net); Reserved (net to MS)"; break;
            case 0xfe: str = "8640 kbps; Check extended"; break;
            case 0xff: str = "0 kbps"; break;
            default:   str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
        }

        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_upl, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    if (length >= 8) {
        oct = tvb_get_guint8(tvb, offset);

        switch (oct) {
            case 0x00: str = "Subscribed maximum bit rate for downlink (MS to net); Reserved (net to MS)"; break;
            case 0xfe: str = "8640 kbps; Check extended"; break;
            case 0xff: str = "0 kbps"; break;
            default:   str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
        }

        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_downl, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    if (length >= 9) {
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_sdu_err_rat, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_ber, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset += 1;
    }

    if (length >= 10) {
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_traff_hdl_pri, tvb, offset, 1, ENC_BIG_ENDIAN);

        oct = tvb_get_guint8(tvb, offset);
        tmp_oct = oct >> 2;
        switch (tmp_oct) {
            case 0x00: str = "Subscribed transfer delay (MS to net); Reserved (net to MS)"; break;
            case 0x3f: str = "Reserved"; break;
            default:
                if (oct <= 0x0f)
                    tmp32 = tmp_oct * 10;
                else if (oct <= 0x1f)
                    tmp32 = (tmp_oct - 0x10) * 50 + 200;
                else
                    tmp32 = (tmp_oct - 0x20) * 100 + 1000;
                str = wmem_strdup_printf(wmem_packet_scope(), "%u ms", tmp32);
        }
        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_trans_delay, tvb, offset, 1, oct, "%s (%u)", str, tmp_oct);
        offset += 1;
    }

    if (length >= 11) {
        oct = tvb_get_guint8(tvb, offset);

        switch (oct) {
        case 0x00: str = "Subscribed guaranteed bit rate for uplink (MS to net); Reserved (net to MS)"; break;
        case 0xfe: str = "8640 kbps; Check extended"; break;
        case 0xff: str = "0 kbps"; break;
        default:   str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
        }

        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_upl, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    if (length >= 12) {
        oct = tvb_get_guint8(tvb, offset);

        switch (oct) {
        case 0x00: str = "Subscribed guaranteed bit rate for downlink (MS to net); Reserved (net to MS)"; break;
        case 0xfe: str = "8640 kbps; Check extended"; break;
        case 0xff: str = "0 kbps"; break;
        default:   str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", qos_calc_bitrate(oct));
        }

        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_downl, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    /* Ext2-QoS-Subscribed:: SIZE(1..3)
    * 1-3   Octets are coded according to 3GPP TS 24.008 Quality of Service Octets 14-16
    */
    if (length >= 13) {
        oct = tvb_get_guint8(tvb, offset);
        tmp_oct = oct & 0x0f;
        if (tmp_oct == 0x01)
            str = "speech (MS to net); spare bits (net to MS)";
        else
            str = "unknown (MS to net); spare bits (net to MS)";

        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_source_stat_desc, tvb, offset, 1, oct, "%s (%u)", str, tmp_oct);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_signalling_ind, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bits_item(subtree, hf_diameter_3gpp_spare_bits, tvb, (offset << 3), 3, ENC_BIG_ENDIAN);
        offset += 1;
    }

    if (length >= 14) {
        oct = tvb_get_guint8(tvb, offset);

        if (oct == 0x00)
            str = "Use the value indicated by the Maximum bit rate for downlink";
        else if (oct > 0xfa)  /* shouldn't go past 256 MBps */
            str = "undefined";
        else if (oct == 0xfa)
            str = "256 Mbps; Check extended 2";
        else {
            tmp32 = qos_calc_ext_bitrate(oct);
            if (oct >= 0x4a)
                str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000);
            else
                str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32);
        }
        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_downl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    if (length >= 15) {
        oct = tvb_get_guint8(tvb, offset);

        if (oct == 0x00)
            str = "Use the value indicated by the Guaranteed bit rate for downlink";
        else if (oct > 0xfa)  /* shouldn't go past 256 MBps */
            str = "undefined";
        else if (oct == 0xfa)
            str = "256 Mbps; Check extended 2";
        else {
            tmp32 = qos_calc_ext_bitrate(oct);
            if (oct >= 0x4a)
                str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000);
            else
                str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32);
        }
        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_downl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    /* Ext3-QoS-Susbcribed:: SIZE(1..2)
    * 1-2   Octets are coded according to 3GPP TS 24.008 Quality of Service Octets 17-18
    */
    if (length >= 16) {
        oct = tvb_get_guint8(tvb, offset);

        if (oct == 0x00)
            str = "Use the value indicated by the Maximum bit rate for uplink";
        else if (oct > 0xfa)  /* shouldn't go past 256 MBps */
            str = "undefined";
        else if (oct == 0xfa)
            str = "256 Mbps; Check extended 2";
        else {
            tmp32 = qos_calc_ext_bitrate(oct);
            if (oct >= 0x4a)
                str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000);
            else
                str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32);
        }
        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_max_bitrate_upl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    if (length >= 17) {
        oct = tvb_get_guint8(tvb, offset);

        if (oct == 0x00)
            str = "Use the value indicated by the Guaranteed bit rate for uplink";
        else if (oct > 0xfa)  /* shouldn't go past 256 MBps */
            str = "undefined";
        else if (oct == 0xfa)
            str = "256 Mbps; Check extended 2";
        else {
            tmp32 = qos_calc_ext_bitrate(oct);
            if (oct >= 0x4a)
                str = wmem_strdup_printf(wmem_packet_scope(), "%u Mbps", tmp32 / 1000);
            else
                str = wmem_strdup_printf(wmem_packet_scope(), "%u kbps", tmp32);
        }
        proto_tree_add_uint_format_value(subtree, hf_diameter_3gpp_qos_guar_bitrate_upl_ext, tvb, offset, 1, oct, "%s (%u)", str, oct);
        offset += 1;
    }

    /* Ext4-QoS-Subscribed:: SIZE(1)
    *   1   Evolved Allocation / Retention Priority.  This octet encodes the Priority Level (PL),
    *       the Preemption Capability (PCI) and Preemption Vulnerability (PVI) values, as described
    *       in 3GPP TS 29.060.
    */

    if (length >= 18) {
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_pre_emption_vulnerability, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bits_item(subtree, hf_diameter_3gpp_spare_bits, tvb, (offset << 3) + 6 , 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_priority_level, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_item(subtree, hf_diameter_3gpp_qos_pre_emption_capability, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_bits_item(subtree, hf_diameter_3gpp_spare_bits, tvb, (offset << 3), 1, ENC_BIG_ENDIAN);
        /*offset += 1;*/
    }

    return length;
}

/* 3GPP TS 29.272
 * 7.3.7 ULR-Flags
 * AVP Code: 1405 ULR-Flags
 */
static int
dissect_diameter_3gpp_ulr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_ulr_flags_spare_bits,
        &hf_diameter_3gpp_ulr_flags_bit7,
        &hf_diameter_3gpp_ulr_flags_bit6,
        &hf_diameter_3gpp_ulr_flags_bit5,
        &hf_diameter_3gpp_ulr_flags_bit4,
        &hf_diameter_3gpp_ulr_flags_bit3,
        &hf_diameter_3gpp_ulr_flags_bit2,
        &hf_diameter_3gpp_ulr_flags_bit1,
        &hf_diameter_3gpp_ulr_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_ulr_flags, diameter_3gpp_ulr_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1406 ULA-Flags */
static int
dissect_diameter_3gpp_ula_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_ula_flags_spare_bits,
        &hf_diameter_3gpp_ula_flags_bit1,
        &hf_diameter_3gpp_ula_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_ula_flags, diameter_3gpp_ula_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1407 Visited-PLMN-Id */
static int
dissect_diameter_3gpp_visited_plmn_id(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
    int length = tvb_reported_length(tvb);
    diam_sub_dis_t *diam_sub_dis = (diam_sub_dis_t*)data;

    if (length == 3) {
        diam_sub_dis->avp_str = dissect_e212_mcc_mnc_wmem_packet_str(tvb, pinfo, tree, 0, E212_NONE, TRUE);
    } else {
        proto_tree_add_expert(tree, pinfo, &ei_diameter_3gpp_plmn_id_wrong_len, tvb, 0, length);
    }

    return length;
}
/*
 * 3GPP TS 29.272
 * 7.3.25 DSR-Flags
 * AVP Code: 1421 DSR-Flags
 */
static int
dissect_diameter_3gpp_dsr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_dsr_flags_spare_bits,
        &hf_diameter_3gpp_dsr_flags_bit26,
        &hf_diameter_3gpp_dsr_flags_bit25,
        &hf_diameter_3gpp_dsr_flags_bit24,
        &hf_diameter_3gpp_dsr_flags_bit23,
        &hf_diameter_3gpp_dsr_flags_bit22,
        &hf_diameter_3gpp_dsr_flags_bit21,
        &hf_diameter_3gpp_dsr_flags_bit20,
        &hf_diameter_3gpp_dsr_flags_bit19,
        &hf_diameter_3gpp_dsr_flags_bit18,
        &hf_diameter_3gpp_dsr_flags_bit17,
        &hf_diameter_3gpp_dsr_flags_bit16,
        &hf_diameter_3gpp_dsr_flags_bit15,
        &hf_diameter_3gpp_dsr_flags_bit14,
        &hf_diameter_3gpp_dsr_flags_bit13,
        &hf_diameter_3gpp_dsr_flags_bit12,
        &hf_diameter_3gpp_dsr_flags_bit11,
        &hf_diameter_3gpp_dsr_flags_bit10,
        &hf_diameter_3gpp_dsr_flags_bit9,
        &hf_diameter_3gpp_dsr_flags_bit8,
        &hf_diameter_3gpp_dsr_flags_bit7,
        &hf_diameter_3gpp_dsr_flags_bit6,
        &hf_diameter_3gpp_dsr_flags_bit5,
        &hf_diameter_3gpp_dsr_flags_bit4,
        &hf_diameter_3gpp_dsr_flags_bit3,
        &hf_diameter_3gpp_dsr_flags_bit2,
        &hf_diameter_3gpp_dsr_flags_bit1,
        &hf_diameter_3gpp_dsr_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_dsr_flags, diameter_3gpp_dsr_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1422 DSA-Flags */
static int
dissect_diameter_3gpp_dsa_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_dsa_flags_spare_bits,
        &hf_diameter_3gpp_dsa_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_dsa_flags, diameter_3gpp_dsa_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1426 Access-Restriction-Data */
static int
dissect_diameter_3gpp_acc_res_data(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_acc_res_dat_flags_spare_bits,
        &hf_diameter_3gpp_acc_res_dat_flags_bit7,
        &hf_diameter_3gpp_acc_res_dat_flags_bit6,
        &hf_diameter_3gpp_acc_res_dat_flags_bit5,
        &hf_diameter_3gpp_acc_res_dat_flags_bit4,
        &hf_diameter_3gpp_acc_res_dat_flags_bit3,
        &hf_diameter_3gpp_acc_res_dat_flags_bit2,
        &hf_diameter_3gpp_acc_res_dat_flags_bit1,
        &hf_diameter_3gpp_acc_res_dat_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_acc_res_dat_flags, diameter_3gpp_dsa_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}


/* AVP Code: 1441 IDA-Flags */
static int
dissect_diameter_3gpp_ida_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_ida_flags_spare_bits,
        &hf_diameter_3gpp_ida_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_ida_flags, diameter_3gpp_ida_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1442 PUA-Flags */
static int
dissect_diameter_3gpp_pua_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_pua_flags_spare_bits,
        &hf_diameter_3gpp_pua_flags_bit1,
        &hf_diameter_3gpp_pua_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_pua_flags, diameter_3gpp_pua_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1443 NOR-Flags */
static int
dissect_diameter_3gpp_nor_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_nor_flags_spare_bits,
        &hf_diameter_3gpp_nor_flags_bit9,
        &hf_diameter_3gpp_nor_flags_bit8,
        &hf_diameter_3gpp_nor_flags_bit7,
        &hf_diameter_3gpp_nor_flags_bit6,
        &hf_diameter_3gpp_nor_flags_bit5,
        &hf_diameter_3gpp_nor_flags_bit4,
        &hf_diameter_3gpp_nor_flags_bit3,
        &hf_diameter_3gpp_nor_flags_bit2,
        &hf_diameter_3gpp_nor_flags_bit1,
        &hf_diameter_3gpp_nor_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_nor_flags, diameter_3gpp_nor_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1490 IDR-Flags */
static int
dissect_diameter_3gpp_idr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_idr_flags_spare_bits,
        &hf_diameter_3gpp_idr_flags_bit8,
        &hf_diameter_3gpp_idr_flags_bit7,
        &hf_diameter_3gpp_idr_flags_bit6,
        &hf_diameter_3gpp_idr_flags_bit5,
        &hf_diameter_3gpp_idr_flags_bit4,
        &hf_diameter_3gpp_idr_flags_bit3,
        &hf_diameter_3gpp_idr_flags_bit2,
        &hf_diameter_3gpp_idr_flags_bit1,
        &hf_diameter_3gpp_idr_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_idr_flags, diameter_3gpp_idr_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1508 PPR-Flags */
static int
dissect_diameter_3gpp_ppr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_ppr_flags_spare_bits,
        &hf_diameter_3gpp_ppr_flags_bit3,
        &hf_diameter_3gpp_ppr_flags_bit2,
        &hf_diameter_3gpp_ppr_flags_bit1,
        &hf_diameter_3gpp_ppr_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_ppr_flags, diameter_3gpp_ppr_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1518 AAA-Failure-Indication */
/* TGPP TS 29.273, v14.0.0 */
static int
dissect_diameter_3gpp_aaa_fail_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_aaa_fail_flags_spare_bits,
        &hf_diameter_3gpp_aaa_fail_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_aaa_fail_flags, diameter_3gpp_aaa_fail_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;

}

/* AVP Code: 1520 DER-Flags */
static int
dissect_diameter_3gpp_der_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_der_flags_spare_bits,
        &hf_diameter_3gpp_der_flags_bit1,
        &hf_diameter_3gpp_der_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_der_flags, diameter_3gpp_der_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1521 DEA-Flags */
static int
dissect_diameter_3gpp_dea_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_dea_flags_spare_bits,
        &hf_diameter_3gpp_dea_flags_bit1,
        &hf_diameter_3gpp_dea_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_dea_flags, diameter_3gpp_dea_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1522 RAR-Flags */
static int
dissect_diameter_3gpp_rar_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_rar_flags_spare_bits,
        &hf_diameter_3gpp_rar_flags_bit1,
        &hf_diameter_3gpp_rar_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_rar_flags, diameter_3gpp_rar_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1523 DER-S6b-Flags */
static int
dissect_diameter_3gpp_der_s6b_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_der_s6b_flags_spare_bits,
        &hf_diameter_3gpp_der_s6b_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_der_s6b_flags, diameter_3gpp_der_s6b_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 1538 Emergency-Services */
static int
dissect_diameter_3gpp_emergency_services(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_emergency_services_flags_spare_bits,
        &hf_diameter_3gpp_emergency_services_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_emergency_services_flags, diameter_3gpp_emergency_services_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;

}

/* 3GPP TS 29.272
* 7.3.149 PUR-Flags
* AVP Code: 1635 PUR-Flags
*/
static int
dissect_diameter_3gpp_pur_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_pur_flags_spare_bits,
        &hf_diameter_3gpp_pur_flags_bit1,
        &hf_diameter_3gpp_pur_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_pur_flags, diameter_3gpp_pur_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.152 CLR-Flag
* AVP Code: 1638 CLR-Flag
*/
static int
dissect_diameter_3gpp_clr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_clr_flags_spare_bits,
        &hf_diameter_3gpp_clr_flags_bit1,
        &hf_diameter_3gpp_clr_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_clr_flags, diameter_3gpp_clr_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.153 UVR-Flags
* AVP Code: 1639 UVR-Flags
*/
static int
dissect_diameter_3gpp_uvr_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_uvr_flags_spare_bits,
        &hf_diameter_3gpp_uvr_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_uvr_flags, diameter_3gpp_uvr_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.154 UVA-Flags
* AVP Code: 1640 UVA-Flags
*/
static int
dissect_diameter_3gpp_uva_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_uva_flags_spare_bits,
        &hf_diameter_3gpp_uva_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_uva_flags, diameter_3gpp_uva_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.165 Subscription-Data-Flags
* AVP Code: 1654 Subscription-Data-Flags
*/
static int
dissect_diameter_3gpp_subscription_data_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_subscription_data_flags_spare_bits,
        &hf_diameter_3gpp_subscription_data_flags_bit3,
        &hf_diameter_3gpp_subscription_data_flags_bit2,
        &hf_diameter_3gpp_subscription_data_flags_bit1,
        &hf_diameter_3gpp_subscription_data_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_subscription_data_flags, diameter_3gpp_subscription_data_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.182 WLAN-offloadability-EUTRAN
* AVP Code: 1668 WLAN-offloadability-EUTRAN
*/
static int
dissect_diameter_3gpp_wlan_offloadability_eutran(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_wlan_offloadability_eutran_spare_bits,
        &hf_diameter_3gpp_wlan_offloadability_eutran_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_wlan_offloadability_eutran, diameter_3gpp_wlan_offloadability_eutran_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.183 WLAN-offloadability-EUTRAN
* AVP Code: 1669 WLAN-offloadability-EUTRAN
*/
static int
dissect_diameter_3gpp_wlan_offloadability_utran(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_wlan_offloadability_utran_spare_bits,
        &hf_diameter_3gpp_wlan_offloadability_utran_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_wlan_offloadability_utran, diameter_3gpp_wlan_offloadability_utran_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.201 AIR-Flags
* AVP Code: 1679 AIR-Flags
*/
static int
dissect_diameter_3gpp_air_flags(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_air_flags_spare_bits,
        &hf_diameter_3gpp_air_flags_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_air_flags, diameter_3gpp_air_flags_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.209 Preferred-Data-Mode
* AVP Code: 1686 Preferred-Data-Mode
*/
static int
dissect_diameter_3gpp_preferred_data_mode(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_preferred_data_mode_spare_bits,
        &hf_diameter_3gpp_preferred_data_mode_bit1,
        &hf_diameter_3gpp_preferred_data_mode_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_preferred_data_mode, diameter_3gpp_preferred_data_mode_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* 3GPP TS 29.272
* 7.3.212 V2X-Permission
* AVP Code: 1689 V2X-Permission
*/
static int
dissect_diameter_3gpp_v2x_permission(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_v2x_permission_spare_bits,
        &hf_diameter_3gpp_v2x_permission_bit1,
        &hf_diameter_3gpp_v2x_permission_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_v2x_permission, diameter_3gpp_v2x_permission_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 2516 EUTRAN-Positioning-Data */
static int
dissect_diameter_3gpp_eutran_positioning_data(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    return dissect_lcsap_Positioning_Data_PDU(tvb, pinfo, tree, NULL);
}

/* AVP Code: 2556 Civic-Address */
static int
dissect_diameter_3gpp_civic_address(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
    int length = tvb_reported_length(tvb);

    /* If there is less than 38 characters this is not XML
     * <?xml version="1.0" encoding="UTF-8"?>
     */
    if(length < 38)
        return length;

    if (tvb_strncaseeql(tvb, 0, "<?xml", 5) == 0 && xml_handle) {
        call_dissector(xml_handle, tvb, pinfo, tree);
    }

    return length;
}

/* AVP Code: 2819 RAN-NAS-Release-Cause*/

static const value_string ran_nas_prot_type_vals[] = {
    { 1, "S1AP Cause" },
    { 2, "EMM Cause" },
    { 3, "ESM Cause" },
    { 4, "Diameter Cause" },
    { 5, "IKEv2 Cause" },
    { 0, NULL}
};

static int
dissect_diameter_3gpp_ran_nas_release_cause(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    int offset = 0;
    int length = tvb_reported_length(tvb);
    guint8 octet = tvb_get_guint8(tvb, offset);
    guint8 proto_type = (octet >> 4);
    int cause_type = 0;

    proto_tree_add_item(tree, hf_diameter_3gpp_ran_nas_protocol_type, tvb, offset, 1, ENC_BIG_ENDIAN);

    if (proto_type == 1) {
        proto_tree_add_item(tree, hf_diameter_3gpp_ran_nas_cause_type, tvb, offset, 1, ENC_BIG_ENDIAN);
        cause_type = octet & 0x0F;
    }
    offset += 1;

    switch (proto_type) {
        case 1:
                switch (cause_type) {
                        case 0:
                                proto_tree_add_item(tree, hf_diameter_3gpp_s1ap_radio_network, tvb, offset, 1, ENC_BIG_ENDIAN);
                                break;
                        case 1:
                                proto_tree_add_item(tree, hf_diameter_3gpp_s1ap_transport, tvb, offset, 1, ENC_BIG_ENDIAN);
                                break;
                        case 2:
                                proto_tree_add_item(tree, hf_diameter_3gpp_s1ap_nas, tvb, offset, 1, ENC_BIG_ENDIAN);
                                break;
                        case 3:
                                proto_tree_add_item(tree, hf_diameter_3gpp_s1ap_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
                                break;
                        case 4:
                                proto_tree_add_item(tree, hf_diameter_3gpp_s1ap_misc, tvb, offset, 1, ENC_BIG_ENDIAN);
                                break;
                        default:
                                proto_tree_add_item(tree, hf_diameter_3gpp_ran_nas_cause_value, tvb, offset, 1, ENC_BIG_ENDIAN);
                }
                offset += 1;
                break;
        case 2:
                proto_tree_add_item(tree, hf_diameter_3gpp_emm_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset += 1;
                break;
        case 3:
                proto_tree_add_item(tree, hf_diameter_3gpp_esm_cause, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset += 1;
                break;
        case 4:
                proto_tree_add_item(tree, hf_diameter_3gpp_diameter_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset += 2;
                break;
        case 5:
                proto_tree_add_item(tree, hf_diameter_3gpp_ikev2_cause, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset += 2;
                break;
        default:
                proto_tree_add_item(tree, hf_diameter_3gpp_ran_nas_cause_value, tvb, offset, length - offset, ENC_BIG_ENDIAN);
                offset += (length - offset);
                break;
    }

    return offset;
}

/* AVP Code: 3502 MBMS-Bearer-Event */
static int
dissect_diameter_3gpp_mbms_bearer_event(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_mbms_bearer_event_spare_bits,
        &hf_diameter_3gpp_mbms_bearer_event_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_mbms_bearer_event, diameter_3gpp_mbms_bearer_event_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 3506 MBMS-Bearer-Result */
static int
dissect_diameter_3gpp_mbms_bearer_result(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_mbms_bearer_result_spare_bits,
        &hf_diameter_3gpp_mbms_bearer_result_bit11,
        &hf_diameter_3gpp_mbms_bearer_result_bit10,
        &hf_diameter_3gpp_mbms_bearer_result_bit9,
        &hf_diameter_3gpp_mbms_bearer_result_bit8,
        &hf_diameter_3gpp_mbms_bearer_result_bit7,
        &hf_diameter_3gpp_mbms_bearer_result_bit6,
        &hf_diameter_3gpp_mbms_bearer_result_bit5,
        &hf_diameter_3gpp_mbms_bearer_result_bit4,
        &hf_diameter_3gpp_mbms_bearer_result_bit3,
        &hf_diameter_3gpp_mbms_bearer_result_bit2,
        &hf_diameter_3gpp_mbms_bearer_result_bit1,
        &hf_diameter_3gpp_mbms_bearer_result_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_mbms_bearer_result, diameter_3gpp_mbms_bearer_result_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 3511 TMGI-Allocation-Result */
static int
dissect_diameter_3gpp_tmgi_allocation_result(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_tmgi_allocation_result_spare_bits,
        &hf_diameter_3gpp_tmgi_allocation_result_bit4,
        &hf_diameter_3gpp_tmgi_allocation_result_bit3,
        &hf_diameter_3gpp_tmgi_allocation_result_bit2,
        &hf_diameter_3gpp_tmgi_allocation_result_bit1,
        &hf_diameter_3gpp_tmgi_allocation_result_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_tmgi_allocation_result, diameter_3gpp_tmgi_allocation_result_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}

/* AVP Code: 3514 TMGI-Deallocation-Result */
static int
dissect_diameter_3gpp_tmgi_deallocation_result(tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree, void *data _U_)
{
    static const int *flags[] = {
        &hf_diameter_3gpp_tmgi_deallocation_result_spare_bits,
        &hf_diameter_3gpp_tmgi_deallocation_result_bit2,
        &hf_diameter_3gpp_tmgi_deallocation_result_bit1,
        &hf_diameter_3gpp_tmgi_deallocation_result_bit0,
        NULL
    };

    proto_tree_add_bitmask_with_flags(tree, tvb, 0, hf_diameter_3gpp_tmgi_deallocation_result, diameter_3gpp_tmgi_deallocation_result_ett, flags, ENC_BIG_ENDIAN, BMT_NO_APPEND);
    return 4;
}


void
proto_reg_handoff_diameter_3gpp(void)
{

    /* AVP Code: 5 3GPP-GPRS Negotiated QoS profile */
    /* Registered by packet-gtp.c */

    /* AVP Code: 8 3GPP-IMSI-MNC-MCC */
    dissector_add_uint("diameter.3gpp", 8, create_dissector_handle(dissect_diameter_3gpp_imsi_mnc_mcc, proto_diameter_3gpp));

    /* AVP Code: 15 3GPP-SGSN-IPv6-Address */
    dissector_add_uint("diameter.3gpp", 15, create_dissector_handle(dissect_diameter_3gpp_sgsn_ipv6_address, proto_diameter_3gpp));

    /* AVP Code: 18 3GPP-SGSN-MNC-MCC */
    dissector_add_uint("diameter.3gpp", 18, create_dissector_handle(dissect_diameter_3gpp_sgsn_mnc_mcc, proto_diameter_3gpp));

    /* AVP Code: 20 3GPP-IMEISV */
    dissector_add_uint("diameter.3gpp", 20, create_dissector_handle(dissect_diameter_3gpp_imeisv, proto_diameter_3gpp));

    /* AVP Code: 21 3GPP-RAT-Access-Type */
    dissector_add_uint("diameter.3gpp", 21, create_dissector_handle(dissect_diameter_3gpp_rat_type, proto_diameter_3gpp));


    /* AVP Code: 22 3GPP-User-Location-Info
     * Registered by packet-gtpv2.c
     */

    /* AVP Code: 23 3GPP-MS-TimeZone */
    dissector_add_uint("diameter.3gpp", 23, create_dissector_handle(dissect_diameter_3gpp_ms_timezone, proto_diameter_3gpp));

    /* AVP Code: 29 3GPP-TWAN-Identifier */
    dissector_add_uint("diameter.3gpp", 29, create_dissector_handle(dissect_diameter_3gpp_twan_identifier, proto_diameter_3gpp));

    /* AVP Code: 504 AF-Application-Identifier */
    dissector_add_uint("diameter.3gpp", 504, create_dissector_handle(dissect_diameter_3gpp_af_application_identifier, proto_diameter_3gpp));

    /* AVP Code: 505 AF-Charging-Identifier */
    dissector_add_uint("diameter.3gpp", 505, create_dissector_handle(dissect_diameter_3gpp_af_charging_identifier, proto_diameter_3gpp));

    /* AVP Code: 600 Visited-Network-Identifier */
    dissector_add_uint("diameter.3gpp", 600, create_dissector_handle(dissect_diameter_3gpp_visited_nw_id, proto_diameter_3gpp));

    /* AVP Code: 601 Public-Identity */
    dissector_add_uint("diameter.3gpp", 601, create_dissector_handle(dissect_diameter_3gpp_public_identity, proto_diameter_3gpp));

    /* AVP Code: 606 User-Data */
    dissector_add_uint("diameter.3gpp", 606, create_dissector_handle(dissect_diameter_3gpp_user_data, proto_diameter_3gpp));

    /* AVP Code: 629 Feature-List */
    dissector_add_uint("diameter.3gpp", 629, create_dissector_handle(dissect_diameter_3gpp_feature_list_id, proto_diameter_3gpp));

    /* AVP Code: 630 Feature-List */
    dissector_add_uint("diameter.3gpp", 630, create_dissector_handle(dissect_diameter_3gpp_feature_list, proto_diameter_3gpp));

    /* AVP Code: 637 UAR-Flags */
    dissector_add_uint("diameter.3gpp", 637, create_dissector_handle(dissect_diameter_3gpp_uar_flags, proto_diameter_3gpp));

    /* AVP Code: 640 Path */
    dissector_add_uint("diameter.3gpp", 640, create_dissector_handle(dissect_diameter_3gpp_path, proto_diameter_3gpp));

    /* AVP Code: 641 Contact */
    dissector_add_uint("diameter.3gpp", 641, create_dissector_handle(dissect_diameter_3gpp_contact, proto_diameter_3gpp));

    /* AVP Code: 655 SAR-Flags */
    dissector_add_uint("diameter.3gpp", 655, create_dissector_handle(dissect_diameter_3gpp_sar_flags, proto_diameter_3gpp));

    /* AVP Code: 701 MSISDN */
    dissector_add_uint("diameter.3gpp", 701, create_dissector_handle(dissect_diameter_3gpp_msisdn, proto_diameter_3gpp));

    /* AVP Code: 702 User-Data */
    dissector_add_uint("diameter.3gpp", 702, create_dissector_handle(dissect_diameter_3gpp_user_data, proto_diameter_3gpp));

    /* AVP Code: 704 Service-Indication  */
    dissector_add_uint("diameter.3gpp", 704, create_dissector_handle(dissect_diameter_3gpp_service_ind, proto_diameter_3gpp));

    /* AVP Code: 900 TMGI */
    dissector_add_uint("diameter.3gpp", 900, create_dissector_handle(dissect_diameter_3gpp_tmgi, proto_diameter_3gpp));

    /* AVP Code: 904 MBMS-Session-Duration  Registered by packet-gtp.c */
    /* AVP Code: 903 MBMS-Service-Area Registered by packet-gtp.c */

    /* AVP Code: 909 RAI */
    dissector_add_uint("diameter.3gpp", 909, create_dissector_handle(dissect_diameter_3gpp_rai, proto_diameter_3gpp));

    /* AVP Code: 911 MBMS-Time-To-Data-Transfer  Registered by packet-gtp.c */
    /* Registered by packet-gtp.c */

    /* AVP Code: 913 MBMS-Required-QoS */
    dissector_add_uint("diameter.3gpp", 913, create_dissector_handle(dissect_diameter_3gpp_mbms_required_qos, proto_diameter_3gpp));

    /* AVP Code: 917 MBMS-GGSN-IPv6-Address */
    dissector_add_uint("diameter.3gpp", 917, create_dissector_handle(dissect_diameter_3gpp_ipv6addr, proto_diameter_3gpp));

    /* AVP Code: 918 MBMS-BMSC-SSM-IP-Address */
    dissector_add_uint("diameter.3gpp", 918, create_dissector_handle(dissect_diameter_3gpp_ipaddr, proto_diameter_3gpp));

    /* AVP Code: 926 MBMS-BMSC-SSM-UDP-Port */
    /* AVP Code: 927 MBMS-GW-UDP-Port */
    dissector_add_uint("diameter.3gpp", 926, create_dissector_handle(dissect_diameter_3gpp_udp_port, proto_diameter_3gpp));
    dissector_add_uint("diameter.3gpp", 927, create_dissector_handle(dissect_diameter_3gpp_udp_port, proto_diameter_3gpp));

    /* AVP Code: 929 MBMS-Data-Transfer-Start */
    dissector_add_uint("diameter.3gpp", 929, create_dissector_handle(dissect_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer, proto_diameter_3gpp));

    /* AVP Code: 930 MBMS-Data-Transfer-Stop */
    dissector_add_uint("diameter.3gpp", 930, create_dissector_handle(dissect_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer, proto_diameter_3gpp));

    /* AVP Code: 1005 Charging-Rule-Name */
    dissector_add_uint("diameter.3gpp", 1005, create_dissector_handle(dissect_diameter_3gpp_charging_rule_name, proto_diameter_3gpp));

    /* AVP Code: 1066 Monitoring-Key */
    dissector_add_uint("diameter.3gpp", 1066, create_dissector_handle(dissect_diameter_3gpp_monitoring_key, proto_diameter_3gpp));

    /* AVP Code: 1082 Credit-Management-Status */
    dissector_add_uint("diameter.3gpp", 1082, create_dissector_handle(dissect_diameter_3gpp_credit_management_status, proto_diameter_3gpp));

    /* AVP Code: 1242 location estimate */
    dissector_add_uint("diameter.3gpp", 1242, create_dissector_handle(dissect_diameter_3gpp_location_estimate, proto_diameter_3gpp));

    /* AVP Code: 1404 QoS-Subscribed */
    dissector_add_uint("diameter.3gpp", 1404, create_dissector_handle(dissect_diameter_3ggp_qos_susbscribed, proto_diameter_3gpp));

    /* AVP Code: 1405 ULR-Flags */
    dissector_add_uint("diameter.3gpp", 1405, create_dissector_handle(dissect_diameter_3gpp_ulr_flags, proto_diameter_3gpp));

    /* AVP Code: 1406 ULA-Flags */
    dissector_add_uint("diameter.3gpp", 1406, create_dissector_handle(dissect_diameter_3gpp_ula_flags, proto_diameter_3gpp));

    /*AVP Code: 1407 Visited-PLMN-Id */
    dissector_add_uint("diameter.3gpp", 1407, create_dissector_handle(dissect_diameter_3gpp_visited_plmn_id, proto_diameter_3gpp));

    /* AVP Code: 1421 DSR-Flags */
    dissector_add_uint("diameter.3gpp", 1421, create_dissector_handle(dissect_diameter_3gpp_dsr_flags, proto_diameter_3gpp));

    /* AVP Code: 1422 DSA-Flags */
    dissector_add_uint("diameter.3gpp", 1422, create_dissector_handle(dissect_diameter_3gpp_dsa_flags, proto_diameter_3gpp));

    /* AVP Code: 1426 Access-Restriction-Data */
    dissector_add_uint("diameter.3gpp", 1426, create_dissector_handle(dissect_diameter_3gpp_acc_res_data, proto_diameter_3gpp));

    /* AVP Code: 1441 IDA-Flags */
    dissector_add_uint("diameter.3gpp", 1441, create_dissector_handle(dissect_diameter_3gpp_ida_flags, proto_diameter_3gpp));

    /* AVP Code: 1442 PUA-Flags */
    dissector_add_uint("diameter.3gpp", 1442, create_dissector_handle(dissect_diameter_3gpp_pua_flags, proto_diameter_3gpp));

    /* AVP Code: 1443 NOR-Flags */
    dissector_add_uint("diameter.3gpp", 1443, create_dissector_handle(dissect_diameter_3gpp_nor_flags, proto_diameter_3gpp));

    /* AVP Code: 1490 IDR-Flags */
    dissector_add_uint("diameter.3gpp", 1490, create_dissector_handle(dissect_diameter_3gpp_idr_flags, proto_diameter_3gpp));

    /* AVP Code: 1508 PPR-Flags */
    dissector_add_uint("diameter.3gpp", 1508, create_dissector_handle(dissect_diameter_3gpp_ppr_flags, proto_diameter_3gpp));

    /* AVP Code: 1518 AAA-Failure-Indication */
    dissector_add_uint("diameter.3gpp", 1518, create_dissector_handle(dissect_diameter_3gpp_aaa_fail_flags, proto_diameter_3gpp));

    /* AVP Code: 1520 DER-Flags */
    dissector_add_uint("diameter.3gpp", 1520, create_dissector_handle(dissect_diameter_3gpp_der_flags, proto_diameter_3gpp));

    /* AVP Code: 1521 DEA-Flags */
    dissector_add_uint("diameter.3gpp", 1521, create_dissector_handle(dissect_diameter_3gpp_dea_flags, proto_diameter_3gpp));

    /* AVP Code: 1522 RAR-Flags */
    dissector_add_uint("diameter.3gpp", 1522, create_dissector_handle(dissect_diameter_3gpp_rar_flags, proto_diameter_3gpp));

    /* AVP Code: 1523 DER-S6b-Flags */
    dissector_add_uint("diameter.3gpp", 1523, create_dissector_handle(dissect_diameter_3gpp_der_s6b_flags, proto_diameter_3gpp));

    /* AVP Code: 1538 Emergency-Services */
    dissector_add_uint("diameter.3gpp", 1538, create_dissector_handle(dissect_diameter_3gpp_emergency_services, proto_diameter_3gpp));

    /* AVP Code: 1635 PUR-Flags */
    dissector_add_uint("diameter.3gpp", 1635, create_dissector_handle(dissect_diameter_3gpp_pur_flags, proto_diameter_3gpp));

    /* AVP Code: 1638 CLR-Flags */
    dissector_add_uint("diameter.3gpp", 1638, create_dissector_handle(dissect_diameter_3gpp_clr_flags, proto_diameter_3gpp));

    /* AVP Code: 1639 UVR-Flags */
    dissector_add_uint("diameter.3gpp", 1639, create_dissector_handle(dissect_diameter_3gpp_uvr_flags, proto_diameter_3gpp));

    /* AVP Code: 1640 UVA-Flags */
    dissector_add_uint("diameter.3gpp", 1640, create_dissector_handle(dissect_diameter_3gpp_uva_flags, proto_diameter_3gpp));

    /* AVP Code: 1654 Subscription-Data-Flags */
    dissector_add_uint("diameter.3gpp", 1654, create_dissector_handle(dissect_diameter_3gpp_subscription_data_flags, proto_diameter_3gpp));

    /* AVP Code: 1668 WLAN-offloadability-EUTRAN */
    dissector_add_uint("diameter.3gpp", 1668, create_dissector_handle(dissect_diameter_3gpp_wlan_offloadability_eutran, proto_diameter_3gpp));

    /* AVP Code: 1669 WLAN-offloadability-UTRAN */
    dissector_add_uint("diameter.3gpp", 1669, create_dissector_handle(dissect_diameter_3gpp_wlan_offloadability_utran, proto_diameter_3gpp));

    /* AVP Code: 1679 AIR-Flags */
    dissector_add_uint("diameter.3gpp", 1679, create_dissector_handle(dissect_diameter_3gpp_air_flags, proto_diameter_3gpp));

    /* AVP Code: 1686 Preferred-Data-Mode */
    dissector_add_uint("diameter.3gpp", 1686, create_dissector_handle(dissect_diameter_3gpp_preferred_data_mode, proto_diameter_3gpp));

    /* AVP Code: 1689 V2X-Permission */
    dissector_add_uint("diameter.3gpp", 1689, create_dissector_handle(dissect_diameter_3gpp_v2x_permission, proto_diameter_3gpp));

    /* AVP Code: 2516 EUTRAN-Positioning-Data */
    dissector_add_uint("diameter.3gpp", 2516, create_dissector_handle(dissect_diameter_3gpp_eutran_positioning_data, proto_diameter_3gpp));

    /* AVP Code: 2556 Civic-Address */
    dissector_add_uint("diameter.3gpp", 2556, create_dissector_handle(dissect_diameter_3gpp_civic_address, proto_diameter_3gpp));

    /* AVP Code: 2819 RAN-NAS-Release-Cause */
    dissector_add_uint("diameter.3gpp", 2819, create_dissector_handle(dissect_diameter_3gpp_ran_nas_release_cause, proto_diameter_3gpp));

    /* AVP Code: 3502 MBMS-Bearer-Event */
    dissector_add_uint("diameter.3gpp", 3502, create_dissector_handle(dissect_diameter_3gpp_mbms_bearer_event, proto_diameter_3gpp));

    /* AVP Code: 3506 MBMS-Bearer-Result */
    dissector_add_uint("diameter.3gpp", 3506, create_dissector_handle(dissect_diameter_3gpp_mbms_bearer_result, proto_diameter_3gpp));

    /* AVP Code: 3511 TMGI-Allocation-Result */
    dissector_add_uint("diameter.3gpp", 3511, create_dissector_handle(dissect_diameter_3gpp_tmgi_allocation_result, proto_diameter_3gpp));

    /* AVP Code: 3514 TMGI-Deallocation-Result */
    dissector_add_uint("diameter.3gpp", 3514, create_dissector_handle(dissect_diameter_3gpp_tmgi_deallocation_result, proto_diameter_3gpp));

    xml_handle = find_dissector_add_dependency("xml", proto_diameter_3gpp);
}

/*
 *  3GPP TS 24.008 Quality of service
 */
static const value_string diameter_3gpp_qos_reliability_vals[] = {
    { 0x00, "Subscribed reliability class (in MS to net); Reserved (in net to MS)" },
    { 0x01, "Unused. Interpreted as Unacknowledged GTP, Ack LLC/RLC, Protected data." },
    { 0x02, "Unacknowledged GTP, Ack LLC/RLC, Protected data" },
    { 0x03, "Unacknowledged GTP/LLC, Ack RLC, Protected data" },
    { 0x04, "Unacknowledged GTP/LLC/RLC, Protected data" },
    { 0x05, "Unacknowledged GTP/LLC/RLC, Unprotected data" },
    { 0x06, "Interpreted as Unacknowledged GTP/LLC, Ack RLC, Protected data" }, /* other value */
    { 0x07, "Reserved" },
    { 0, NULL }
};

const range_string diameter_3gpp_qos_delay_cls_vals[] = {
    { 0x00, 0x00, "Subscribed delay class (in MS to net); Reserved (in net to MS)" },
    { 0x01, 0x01, "Delay class 1" },
    { 0x02, 0x02, "Delay class 2" },
    { 0x03, 0x03, "Delay class 3" },
    { 0x04, 0x04, "Delay class 4 (best effort)" },
    { 0x05, 0x06, "Interpreted as Delay class 4 (best effort)" },
    { 0x07, 0x00, "Reserved" },
    { 0, 0, NULL }
};

const range_string diameter_3gpp_qos_prec_class_vals[] = {
    { 0x00, 0x00, "Subscribed precedence (MS to net); Reserved (net to MS)" },
    { 0x01, 0x01, "High priority" },
    { 0x02, 0x02, "Normal priority" },
    { 0x03, 0x03, "Low priority" },
    { 0x04, 0x06, "Interpreted as Normal priority" },
    { 0x07, 0x07, "Reserved" },
    { 0, 0, NULL }
};

const range_string diameter_3gpp_qos_peak_thr_vals[] = {
    { 0x00, 0x00, "Subscribed peak throughput (MS to net); Reserved (net to MS)" },
    { 0x01, 0x01, "Up to 1 000 octet/s" },
    { 0x02, 0x02, "Up to 2 000 octet/s" },
    { 0x03, 0x03, "Up to 4 000 octet/s" },
    { 0x04, 0x04, "Up to 8 000 octet/s" },
    { 0x05, 0x05, "Up to 16 000 octet/s" },
    { 0x06, 0x06, "Up to 32 000 octet/s" },
    { 0x07, 0x07, "Up to 64 000 octet/s" },
    { 0x08, 0x08, "Up to 128 000 octet/s" },
    { 0x09, 0x09, "Up to 256 000 octet/s" },
    { 0x0a, 0x0e, "Interpreted as Up to 1 000 octet/s" },
    { 0x0f, 0x0f, "Reserved" },
    { 0, 0, NULL }
};

const range_string diameter_3gpp_qos_mean_thr_vals[] = {
    { 0x00, 0x00, "Subscribed peak throughput (MS to net); Reserved (net to MS)" },
    { 0x01, 0x01, "100 octet/h" },
    { 0x02, 0x02, "200 octet/h" },
    { 0x03, 0x03, "500 octet/h" },
    { 0x04, 0x04, "1 000 octet/h" },
    { 0x05, 0x05, "2 000 octet/h" },
    { 0x06, 0x06, "5 000 octet/h" },
    { 0x07, 0x07, "10 000 octet/h" },
    { 0x08, 0x08, "20 000 octet/h" },
    { 0x09, 0x09, "50 000 octet/h" },
    { 0x0a, 0x0a, "100 000 octet/h" },
    { 0x0b, 0x0b, "200 000 octet/h" },
    { 0x0c, 0x0c, "500 000 octet/h" },
    { 0x0d, 0x0d, "1 000 000 octet/h" },
    { 0x0e, 0x0e, "2 000 000 octet/h" },
    { 0x0f, 0x0f, "5 000 000 octet/h" },
    { 0x10, 0x10, "10 000 000 octet/h" },
    { 0x11, 0x11, "20 000 000 octet/h" },
    { 0x12, 0x12, "50 000 000 octet/h" },
    { 0x13, 0x1d, "Interpreted as Best effort" },
    { 0x1e, 0x1e, "Reserved" },
    { 0x1f, 0x1f, "Best effort" },
    { 0, 0, NULL }
};

const value_string diameter_3gpp_qos_del_of_err_sdu_vals[] = {
    { 0x00, "Subscribed delivery of erroneous SDUs (MS to net); Reserved (net to MS)" },
    { 0x01, "No detect ('-')" },
    { 0x02, "Erroneous SDUs are delivered ('yes')" },
    { 0x03, "Erroneous SDUs are not delivered ('no')" },
    { 0x07, "Reserved" },
    { 0, NULL }
};

const value_string diameter_3gpp_qos_del_order_vals[] = {
    { 0x00, "Subscribed delivery order (MS to net); Reserved (net to MS)" },
    { 0x01, "With delivery order ('yes')" },
    { 0x02, "Without delivery order ('no')" },
    { 0x03, "Reserved" },
    { 0, NULL }
};

const value_string diameter_3gpp_qos_traffic_cls_vals[] = {
    { 0x00, "Subscribed traffic class (MS to net); Reserved (net to MS)" },
    { 0x01, "Conversational class" },
    { 0x02, "Streaming class" },
    { 0x03, "Interactive class" },
    { 0x04, "Background class" },
    { 0x07, "Reserved" },
    { 0, NULL }
};

const value_string diameter_3gpp_qos_sdu_err_rat_vals[] = {
    { 0x00, "Subscribed SDU error ratio (MS to net); Reserved (net to MS)" },
    { 0x01, "1E-2" },
    { 0x02, "7E-3" },
    { 0x03, "1E-3" },
    { 0x04, "1E-4" },
    { 0x05, "1E-5" },
    { 0x06, "1E-6" },
    { 0x07, "1E-1" },
    { 0x15, "Reserved" },
    { 0, NULL }
};

const value_string diameter_3gpp_qos_ber_vals[] = {
    { 0x00, "Subscribed residual BER (MS to net); Reserved (net to MS)" },
    { 0x01, "5E-2" },
    { 0x02, "1E-2" },
    { 0x03, "5E-3" },
    { 0x04, "4E-3" },
    { 0x05, "1E-3" },
    { 0x06, "1E-4" },
    { 0x07, "1E-5" },
    { 0x08, "1E-6" },
    { 0x09, "6E-8" },
    { 0x15, "Reserved" },
    { 0, NULL }
};

const value_string diameter_3gpp_qos_traff_hdl_pri_vals[] = {
    { 0x00, "Subscribed traffic handling priority (MS to net); Reserved (net to MS)" },
    { 0x01, "Priority level 1" },
    { 0x02, "Priority level 2" },
    { 0x03, "Priority level 3" },
    { 0, NULL }
};

const true_false_string diameter_3gpp_qos_signalling_ind_value = {
    "Optimised for signalling traffic",
    "Not optimised for signalling traffic"
};

void
proto_register_diameter_3gpp(void)
{

    /* Setup list of header fields  See Section 1.6.1 for details*/
    static hf_register_info hf[] = {
        { &hf_diameter_3gpp_timezone,
            { "Timezone",           "diameter.3gpp.3gpp_timezone",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_timezone_adjustment,
            { "Adjustment",           "diameter.3gpp.timezone_adjustment",
            FT_UINT8, BASE_DEC, VALS(daylight_saving_time_vals), 0x03,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_rat_type,
            { "RAT Type",            "diameter.3gpp.rat-type",
            FT_UINT8, BASE_DEC, VALS(diameter_3gpp_rat_type_vals), 0x00,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_path,
            { "Path",           "diameter.3gpp.path",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_contact,
            { "Contact",           "diameter.3gpp.contact",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_visited_nw_id,
            { "Visited-Network-Identifier",           "diameter.3gpp.visited_nw_id",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
#if 0
        { &hf_diameter_3gpp_user_data,
            { "User data",           "diameter.3gpp.user_data",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
#endif
        { &hf_diameter_3gpp_ipaddr,
            { "IPv4 Address",           "diameter.3gpp.ipaddr",
            FT_IPv4, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_required_qos_prio,
            { "Allocation/Retention Priority",           "diameter.3gpp.mbms_required_qos_prio",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi,
            { "TMGI",           "diameter.3gpp.tmgi",
            FT_BYTES, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_service_ind,
            { "Service-Indication",           "diameter.3gpp.service_ind",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_mbms_service_id,
            { "MBMS Service ID",           "diameter.3gpp.mbms_service_id",
            FT_UINT24, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_spare_bits,
            { "Spare bit(s)", "diameter.3gpp.spare_bits",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_uar_flags_flags,
            { "Flags", "diameter.3gpp.uar_flags_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_uar_flags_flags_spare_bits,
            { "Spare", "diameter.3gpp.uar_flags_flags_spare_bits",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_uar_flags_flags_bit0,
            { "Emergency registration", "diameter.3gpp.uar_flags_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_flags,
            { "Feature-List Flags", "diameter.3gpp.feature_list_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cx_feature_list_flags,
            { "CX Feature-List Flags", "diameter.3gpp.cx_feature_list_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cx_feature_list_1_flags_bit0,
            { "Shared IFC Sets", "diameter.3gpp.cx_feature_list_1_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cx_feature_list_1_flags_bit1,
            { "Alias Indication", "diameter.3gpp.cx_feature_list_1_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cx_feature_list_1_flags_bit2,
            { "IMS Restoration Indication", "diameter.3gpp.cx_feature_list_1_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cx_feature_list_1_flags_bit3,
            { "P-CSCF Restoration mechanism", "diameter.3gpp.cx_feature_list_1_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cx_feature_list_1_flags_spare_bits,
        { "Spare", "diameter.3gpp.cx_feature_list_1_flags_spare",
        FT_UINT32, BASE_HEX, NULL, 0xfffffff0,
        NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_sh_flags_bit0,
        { "Notif-Eff", "diameter.3gpp.feature_list1_sh_flags_bit0",
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
        NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_sh_flags_bit1,
        { "Update-Eff", "diameter.3gpp.feature_list1_sh_flags_bit1",
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
        NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_sh_flags_bit2,
        { "Update-Eff-Enhance", "diameter.3gpp.feature_list1_sh_flags_bit2",
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
        NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_sh_flags_bit3,
        { "Additional-MSISDN", "diameter.3gpp.feature_list1_sh_flags_bit3",
        FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
        NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_sh_flags_spare_bits,
        { "Spare", "diameter.3gpp.feature_list1_sh_flags_spare",
        FT_UINT32, BASE_HEX, NULL, 0xfffffff0,
        NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit0,
            { "Operator Determined Barring of all Packet Oriented Services", "diameter.3gpp.feature_list1_s6a_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit1,
            { "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",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit2,
            { "Operator Determined Barring of Packet Oriented Services from access points that are within the roamed to VPLMN", "diameter.3gpp.feature_list1_s6a_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit3,
            { "Operator Determined Barring of all outgoing calls", "diameter.3gpp.feature_list1_s6a_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit4,
            { "Operator Determined Barring of all outgoing international calls", "diameter.3gpp.feature_list1_s6a_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit5,
            { "Operator Determined Barring of all outgoing international calls except those directed to the home PLMN country", "diameter.3gpp.feature_list1_s6a_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit6,
            { "Operator Determined Barring of all outgoing inter-zonal calls", "diameter.3gpp.feature_list1_s6a_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit7,
            { "Operator Determined Barring of all outgoing inter-zonal calls except those directed to the home PLMN country", "diameter.3gpp.feature_list1_s6a_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit8,
            { "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",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit9,
            { "Regional Subscription", "diameter.3gpp.feature_list1_s6a_flags_bit9",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
            NULL, HFILL }
        },

        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit10,
            { "Trace Function", "diameter.3gpp.feature_list1_s6a_flags_bit10",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit11,
            { "All LCS Privacy Exception Classes", "diameter.3gpp.feature_list1_s6a_flags_bit11",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit12,
            { "Allow location by any LCS client", "diameter.3gpp.feature_list1_s6a_flags_bit12",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit13,
            { "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",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit14,
            { "Allow location by designated external value added LCS clients", "diameter.3gpp.feature_list1_s6a_flags_bit14",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit15,
            { "Allow location by designated PLMN operator LCS clients", "diameter.3gpp.feature_list1_s6a_flags_bit15",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit16,
            { "Allow location by LCS clients of a designated LCS service type", "diameter.3gpp.feature_list1_s6a_flags_bit16",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit17,
            { "All Mobile Originating Location Request Classes", "diameter.3gpp.feature_list1_s6a_flags_bit17",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit18,
            { "Allow an MS to request its own location", "diameter.3gpp.feature_list1_s6a_flags_bit18",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit19,
            { "Allow an MS to perform self location without interaction with the PLMN", "diameter.3gpp.feature_list1_s6a_flags_bit19",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit20,
            { "Allow an MS to request transfer of its location to another LCS client", "diameter.3gpp.feature_list1_s6a_flags_bit20",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit21,
            { "Short Message MO-PP", "diameter.3gpp.feature_list1_s6a_flags_bit21",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit22,
            { "Barring of Outgoing Calls", "diameter.3gpp.feature_list1_s6a_flags_bit22",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit23,
            { "Barring of all outgoing calls", "diameter.3gpp.feature_list1_s6a_flags_bit23",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00800000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit24,
            { "Barring of outgoing international calls", "diameter.3gpp.feature_list1_s6a_flags_bit24",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x01000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit25,
            { "Barring of outgoing international calls except those directed to the home PLMN Country", "diameter.3gpp.feature_list1_s6a_flags_bit25",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x02000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit26,
            { "UE Reachability Notification", "diameter.3gpp.feature_list1_s6a_flags_bit26",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x04000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit27,
            { "Terminating Access Domain Selection Data Retrieval", "diameter.3gpp.feature_list1_s6a_flags_bit27",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x08000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit28,
            { "State/Location Information Retrieval", "diameter.3gpp.feature_list1_s6a_flags_bit28",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x10000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit29,
            { "Partial Purge from a Combined MME/SGSN", "diameter.3gpp.feature_list1_s6a_flags_bit29",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x20000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit30,
            { "UE Time Zone Retrieval", "diameter.3gpp.feature_list1_s6a_flags1_bit30",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x40000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_s6a_flags_bit31,
            { "Additional MSISDN", "diameter.3gpp.feature_list1_s6a_flags_bit31",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x80000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit0,
            { "SMS in MME", "diameter.3gpp.feature_list2_s6a_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit1,
            { "SMS in SGSN", "diameter.3gpp.feature_list2_s6a_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit2,
            { "Dia-LCS-all-PrivExcep", "diameter.3gpp.feature_list2_s6a_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit3,
            { "Dia-LCS-Universal", "diameter.3gpp.feature_list2_s6a_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit4,
            { "Dia-LCS-CallSessionRelated", "diameter.3gpp.feature_list2_s6a_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit5,
            { "Dia-LCS-CallSessionUnrelated", "diameter.3gpp.feature_list2_s6a_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit6,
            { "Dia-LCS-PLMNOperator", "diameter.3gpp.feature_list2_s6a_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit7,
            { "Dia-LCS-ServiceType", "diameter.3gpp.feature_list2_s6a_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit8,
            { "Dia-LCS-all-MOLR-SS", "diameter.3gpp.feature_list2_s6a_flags_bit8",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit9,
            { "Dia-LCS-BasicSelfLocation", "diameter.3gpp.feature_list2_s6a_flags_bit9",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit10,
            { "Dia-LCS-AutonomousSelfLocation", "diameter.3gpp.feature_list2_s6a_flags_bit10",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit11,
            { "Dia-LCS-TransferToThirdParty", "diameter.3gpp.feature_list2_s6a_flags_bit11",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit12,
            { "Gdd-in-SGSN", "diameter.3gpp.feature_list2_s6a_flags_bit12",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit13,
            { "Optimized-LCS-Proc-Support", "diameter.3gpp.feature_list2_s6a_flags_bit13",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit14,
            { "SGSN CAMEL Capability", "diameter.3gpp.feature_list2_s6a_flags_bit14",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit15,
            { "ProSe Capability", "diameter.3gpp.feature_list2_s6a_flags_bit15",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit16,
            { "P-CSCF Restoration", "diameter.3gpp.feature_list2_s6a_flags_bit16",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit17,
            { "Reset-IDs", "diameter.3gpp.feature_list2_s6a_flags_bit17",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit18,
            { "Communication-Pattern", "diameter.3gpp.feature_list2_s6a_flags_bit18",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit19,
            { "Monitoring-Event", "diameter.3gpp.feature_list2_s6a_flags_bit19",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit20,
            { "Dedicated Core Networks", "diameter.3gpp.feature_list2_s6a_flags_bit20",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00100000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit21,
            { "Non-IP PDN Type APNs", "diameter.3gpp.feature_list2_s6a_flags_bit21",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit22,
            { "Non-IP PDP Type APNs", "diameter.3gpp.feature_list2_s6a_flags_bit22",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit23,
            { "Removal of MSISDN", "diameter.3gpp.feature_list2_s6a_flags_bit23",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00800000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit24,
            { "Emergency Service Continuity", "diameter.3gpp.feature_list2_s6a_flags_bit24",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x01000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit25,
            { "V2X Capability", "diameter.3gpp.feature_list2_s6a_flags_bit25",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x02000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit26,
            { "External-Identifier", "diameter.3gpp.feature_list2_s6a_flags_bit26",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x04000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_bit27,
            { "NR as Secondary RAT", "diameter.3gpp.feature_list2_s6a_flags_bit27",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x08000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_s6a_flags_spare_bits,
        { "Spare", "diameter.3gpp.feature_list2_s6a_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xF0000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags,
        { "GX Feature-List Flags", "diameter.3gpp.gx_feature_list_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit0,
            { "Rel-8 Gx", "diameter.3gpp.feature_list_gx_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit1,
            { "Rel-9 Gx", "diameter.3gpp.feature_list_gx_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit2,
            { "Provisioning AF Signaling IP Flow Information",
              "diameter.3gpp.feature_list_gx_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),  0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit3,
            { "Rel-10 Gx", "diameter.3gpp.feature_list_gx_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit4,
            { "Sponsored Data Connectivity",
              "diameter.3gpp.feature_list_gx_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit5,
            { "IP Flow Mobility", "diameter.3gpp.feature_list_gx_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),  0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit6,
            { "ADC", "diameter.3gpp.feature_list_gx_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),  0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit7,
            { "vSRVCC", "diameter.3gpp.feature_list_gx_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),  0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit8,
            { "EPC-routed", "diameter.3gpp.feature_list_gx_flags_bit8",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit9,
            { "rSRVCC", "diameter.3gpp.feature_list_gx_flags_bit9",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit10,
            { "NetLoc", "diameter.3gpp.feature_list_gx_flags_bit10",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),0x00000400,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit11,
            { "Usage Monitoring Congestion Handling",
              "diameter.3gpp.feature_list_gx_flags_bit11",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),0x00000800,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit12,
            { "Extended Filter", "diameter.3gpp.feature_list_gx_flags_bit12",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit13,
            { "Trusted WLAN Access", "diameter.3gpp.feature_list_gx_flags_bit13",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit14,
            { "SGW Restoration procedures", "diameter.3gpp.feature_list_gx_flags_bit14",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit15,
            { "Time based Usage Monitoring Control", "diameter.3gpp.feature_list_gx_flags_bit15",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit16,
            { "Pending Transaction", "diameter.3gpp.feature_list_gx_flags_bit16",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit17,
            { "Application Based Charging", "diameter.3gpp.feature_list_gx_flags_bit17",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit18,
        { "Spare", "diameter.3gpp.feature_list_gx_flags_bit18",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit19,
            { "NetLoc Trusted WLAN", "diameter.3gpp.feature_list_gx_flags_bit19",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00080000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit20,
            { "Fixed Broadband Access Convergence", "diameter.3gpp.feature_list_gx_flags_bit20",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported),0x00100000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit21,
            { "Conditional APN Policy Info", "diameter.3gpp.feature_list_gx_flags_bit21",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00200000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit22,
            { "RAN and/or NAS release cause", "diameter.3gpp.feature_list_gx_flags_bit22",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00400000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit23,
            { "Presence Reporting Area Information reporting", "diameter.3gpp.feature_list_gx_flags_bit23",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00800000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit24,
            { "P-CSCF Restoration Enhancement", "diameter.3gpp.feature_list_gx_flags_bit24",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x01000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit25,
            { "Mission Critical QCIs", "diameter.3gpp.feature_list_gx_flags_bit25",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x02000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit26,
            { "ResShare", "diameter.3gpp.feature_list_gx_flags_bit26",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x04000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit27,
            { "ExUsage", "diameter.3gpp.feature_list_gx_flags_bit27",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x08000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit28,
        { "NBIFOM", "diameter.3gpp.feature_list_gx_flags_bit28",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x10000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit29,
        { "TSC", "diameter.3gpp.feature_list_gx_flags_bit29",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x20000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit30,
        { "NetLoc-Untrusted-WLAN", "diameter.3gpp.feature_list_gx_flags_bit30",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x40000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_gx_flags_bit31,
        { "CondPolicyInfo", "diameter.3gpp.feature_list_gx_flags_bit31",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x80000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_spare_bits,
            { "Spare", "diameter.3gpp.cms.spare",
            FT_UINT32, BASE_HEX, NULL, 0x01FFFFFF,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_no_gyn_session_serv_not_allowed,
            { "No Gyn Session, service not allowed", "diameter.3gpp.cms.no_gyn_session_serv_not_allowed",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x02000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_no_gyn_session_serv_allowed,
            { "No Gyn Session, service allowed", "diameter.3gpp.cms.no_gyn_session_serv_allowed",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x04000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_rating_failed,
            { "Rating Failed", "diameter.3gpp.cms.rating_failed",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x08000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_user_unknown,
            { "User Unknown", "diameter.3gpp.cms.user_unknown",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x10000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_auth_rej,
            { "Authorization Rejected", "diameter.3gpp.cms.auth_rej",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x20000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_credit_ctrl_not_applicable,
            { "Credit Control Not Applicable", "diameter.3gpp.cms.credit_ctrl_not_applicable",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x40000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_cms_end_user_serv_status,
            { "End User Service Denied", "diameter.3gpp.cms.end_user_serv_status",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_subscribed,
            { "QoS-Subscribed", "diameter.3gpp.qos_subscribed",
            FT_BYTES, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_reliability_cls,
            { "Reliability class", "diameter.3gpp.qos.reliability_cls",
            FT_UINT8, BASE_DEC, VALS(diameter_3gpp_qos_reliability_vals), 0x07,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_delay_cls,
            { "Quality of Service Delay class", "diameter.3gpp.qos.delay_cls",
            FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(diameter_3gpp_qos_delay_cls_vals), 0x38,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_prec_class,
            { "Precedence class", "diameter.3gpp.qos.prec_class",
            FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(diameter_3gpp_qos_prec_class_vals), 0x07,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_peak_thr,
            { "Peak throughput", "diameter.3gpp.qos.qos.peak_throughput",
            FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(diameter_3gpp_qos_peak_thr_vals), 0xf0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_mean_thr,
            { "Mean throughput", "diameter.3gpp.qos.mean_throughput",
            FT_UINT8, BASE_DEC | BASE_RANGE_STRING, RVALS(diameter_3gpp_qos_mean_thr_vals), 0x1f,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_al_ret_priority,
            { "Allocation/Retention priority", "diameter.3gpp.qos.al_ret_priority",
            FT_UINT8, BASE_DEC, NULL, 0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_del_of_err_sdu,
            { "Delivery of erroneous SDUs", "diameter.3gpp.qos.del_of_err_sdu",
            FT_UINT8, BASE_DEC, VALS(diameter_3gpp_qos_del_of_err_sdu_vals), 0x07,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_del_order,
            { "Delivery order", "diameter.3gpp.qos.del_order",
            FT_UINT8, BASE_DEC, VALS(diameter_3gpp_qos_del_order_vals), 0x18,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_traffic_cls,
            { "Traffic class", "diameter.3gpp.qos.traffic_cls",
            FT_UINT8, BASE_DEC, VALS(diameter_3gpp_qos_traffic_cls_vals), 0xe0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_maximum_sdu_size,
            { "Maximum SDU size", "diameter.3gpp.qos.qos.maximum_sdu_size",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_max_bitrate_upl,
            { "Maximum bitrate for uplink", "diameter.3gpp.qos.max_bitrate_upl",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_max_bitrate_downl,
            { "Maximum bitrate for downlink", "diameter.3gpp.qos.max_bitrate_downl",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_sdu_err_rat,
            { "SDU error ratio", "diameter.3gpp.qos.sdu_err_rat",
            FT_UINT8, BASE_DEC, VALS(diameter_3gpp_qos_sdu_err_rat_vals), 0x0f,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_ber,
            { "Residual Bit Error Rate (BER)", "diameter.3gpp.qos.ber",
            FT_UINT8, BASE_DEC, VALS(diameter_3gpp_qos_ber_vals), 0xf0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_traff_hdl_pri,
            { "Traffic handling priority", "diameter.3gpp.qos.traff_hdl_pri",
            FT_UINT8, BASE_DEC, VALS(gsm_a_sm_qos_traff_hdl_pri_vals), 0x03,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_trans_delay,
            { "Transfer delay", "diameter.3gpp.qos.trans_delay",
            FT_UINT8, BASE_DEC, NULL, 0xfc,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_guar_bitrate_upl,
            { "Guaranteed bitrate for uplink", "diameter.3gpp.qos.guar_bitrate_upl",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_guar_bitrate_downl,
            { "Guaranteed bitrate for downlink", "diameter.3gpp.qos.guar_bitrate_downl",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },

        { &hf_diameter_3gpp_qos_source_stat_desc,
            { "Source statistics description", "diameter.3gpp.qos.source_stat_desc",
            FT_UINT8, BASE_DEC, NULL, 0x0f,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_signalling_ind,
            { "Signalling indication", "diameter.3gpp.qos.signalling_ind",
            FT_BOOLEAN, SEP_DOT, TFS(&diameter_3gpp_qos_signalling_ind_value), 0x10,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_max_bitrate_downl_ext,
            { "Maximum bitrate for downlink (extended)", "diameter.3gpp.qos.max_bitrate_downl_ext",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_guar_bitrate_downl_ext,
            { "Guaranteed bitrate for downlink (extended)", "diameter.3gpp.qos.guar_bitrate_downl_ext",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_max_bitrate_upl_ext,
            { "Maximum bitrate for uplink (extended)", "diameter.3gpp.qos.max_bitrate_upl_ext",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_guar_bitrate_upl_ext,
            { "Guaranteed bitrate for uplink (extended)", "diameter.3gpp.qos.guar_bitrate_upl_ext",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_pre_emption_vulnerability,
            { "Pre-emption vulnerability", "diameter.3gpp.qos.pre_emption_vulnerability",
            FT_BOOLEAN, SEP_DOT, TFS(&tfs_set_notset), 0x01,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_priority_level,
            { "Priority level", "diameter.3gpp.qos.priority_level",
            FT_UINT8, BASE_DEC, NULL, 0x3c,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_qos_pre_emption_capability,
            { "Pre-emption capability", "diameter.3gpp.qos.pre_emption_capability",
            FT_BOOLEAN, SEP_DOT, TFS(&tfs_set_notset), 0x40,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags,
            { "ULR Flags", "diameter.3gpp.ulr_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit0,
            { "Single-Registration-Indication", "diameter.3gpp.ulr_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit1,
            { "S6a/S6d-Indicator", "diameter.3gpp.ulr_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit2,
            { "Skip-Subscriber-Data", "diameter.3gpp.ulr_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit3,
            { "GPRS-Subscription-Data-Indicator", "diameter.3gpp.ulr_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit4,
            { "Node-Type-Indicator", "diameter.3gpp.ulr_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit5,
            { "Initial-Attach-Indicator", "diameter.3gpp.ulr_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit6,
            { "PS-LCS-Not-Supported-By-UE", "diameter.3gpp.ulr_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_bit7,
            { "SMS-Only-Indication", "diameter.3gpp.ulr_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ulr_flags_spare_bits,
            { "Spare", "diameter.3gpp.ulr_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFF00,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ula_flags,
            { "ULA Flags", "diameter.3gpp.ula_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ula_flags_bit0,
            { "Separation Indication", "diameter.3gpp.ula_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ula_flags_bit1,
            { "MME Registered for SMS", "diameter.3gpp.ula_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ula_flags_spare_bits,
            { "Spare", "diameter.3gpp.ula_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags,
            { "DSR Flags", "diameter.3gpp.dsr_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit0,
            { "Regional Subscription Withdrawal", "diameter.3gpp.dsr_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit1,
            { "Complete APN Configuration Profile Withdrawal", "diameter.3gpp.dsr_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit2,
            { "Subscribed Charging Characteristics Withdrawal", "diameter.3gpp.dsr_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit3,
            { "PDN subscription contexts Withdrawal", "diameter.3gpp.dsr_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit4,
            { "STN-SR", "diameter.3gpp.dsr_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit5,
            { "Complete PDP context list Withdrawal", "diameter.3gpp.dsr_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit6,
            { "PDP contexts Withdrawal", "diameter.3gpp.dsr_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit7,
            { "Roaming Restricted due to unsupported feature", "diameter.3gpp.dsr_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit8,
            { "Trace Data Withdrawal", "diameter.3gpp.dsr_flags_bit8",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit9,
            { "CSG Deleted", "diameter.3gpp.dsr_flags_bit9",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000200,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit10,
            { "APN-OI-Replacement", "diameter.3gpp.dsr_flags_bit10",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000400,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit11,
            { "GMLC List Withdrawal", "diameter.3gpp.dsr_flags_bit11",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000800,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit12,
            { "LCS Withdrawal", "diameter.3gpp.dsr_flags_bit12",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00001000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit13,
            { "SMS Withdrawal", "diameter.3gpp.dsr_flags_bit13",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00002000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit14,
            { "Subscribed periodic RAU-TAU Timer Withdrawal", "diameter.3gpp.dsr_flags_bit14",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00004000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit15,
            { "Subscribed VSRVCC Withdrawal", "diameter.3gpp.dsr_flags_bit15",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00008000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit16,
            { "A-MSISDN Withdrawal", "diameter.3gpp.dsr_flags_bit16",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00010000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit17,
            { "ProSe Withdrawal", "diameter.3gpp.dsr_flags_bit17",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00020000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit18,
            { "Reset-IDs", "diameter.3gpp.dsr_flags_bit18",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00040000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit19,
            { "DL-Buffering-Suggested-Packet-Count Withdrawal", "diameter.3gpp.dsr_flags_bit19",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00080000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit20,
            { "Subscribed IMSI-Group-Id Withdrawal", "diameter.3gpp.dsr_flags_bit20",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00100000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit21,
            { "Delete monitoring events", "diameter.3gpp.dsr_flags_bit21",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00200000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit22,
            { "User Plane Integrity Protection Withdrawal", "diameter.3gpp.dsr_flags_bit22",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00400000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit23,
            { "MSISDN Withdrawal", "diameter.3gpp.dsr_flags_bit23",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00800000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit24,
            { "UE Usage Type Withdrawal", "diameter.3gpp.dsr_flags_bit24",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x01000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit25,
            { "V2X Withdrawal", "diameter.3gpp.dsr_flags_bit25",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x02000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_bit26,
            { "External-Identifier-Withdrawal", "diameter.3gpp.dsr_flags_bit26",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x04000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsr_flags_spare_bits,
            { "Spare", "diameter.3gpp.dsr_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xF8000000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsa_flags,
            { "DSA Flags", "diameter.3gpp.dsa_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsa_flags_bit0,
            { "Network Node area restricted", "diameter.3gpp.dsa_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dsa_flags_spare_bits,
            { "Spare", "diameter.3gpp.dsa_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags,
        { "Access-Restriction-Data Flags", "diameter.3gpp.acc_res_dat_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit0,
        { "UTRAN Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit1,
        { "GERAN Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit2,
        { "GAN Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit3,
        { "I-HSPA-Evolution Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit4,
        { "WB-E-UTRAN Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit5,
        { "HO-To-Non-3GPP-Access Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit6,
        { "NB-IoT Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_acc_res_dat_flags_bit7,
            { "Enhanced Coverage Not Allowed", "diameter.3gpp.acc_res_dat_flags_bit7",
                FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080,
                NULL, HFILL }
            },
            { &hf_diameter_3gpp_acc_res_dat_flags_spare_bits,
        { "Spare", "diameter.3gpp.acc_res_dat_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFF00,
            NULL, HFILL }
        },

        { &hf_diameter_3gpp_ida_flags,
            { "IDA Flags", "diameter.3gpp.ida_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ida_flags_bit0,
            { "Network Node area restricted", "diameter.3gpp.ida_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ida_flags_spare_bits,
            { "Spare", "diameter.3gpp.ida_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_pua_flags,
            { "PUA Flags", "diameter.3gpp.pua_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_pua_flags_bit0,
            { "Freeze M-TMSI", "diameter.3gpp.pua_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_pua_flags_bit1,
            { "Freeze P-TMSI", "diameter.3gpp.pua_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_pua_flags_spare_bits,
            { "Spare", "diameter.3gpp.pua_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags,
            { "NOR Flags", "diameter.3gpp.nor_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit0,
            { "Single-Registration-Indication", "diameter.3gpp.nor_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit1,
            { "SGSN area restricted", "diameter.3gpp.nor_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit2,
            { "Ready for SM", "diameter.3gpp.nor_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit3,
            { "UE Reachable", "diameter.3gpp.nor_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit4,
            { "Delete all APN and PDN GW identity pairs", "diameter.3gpp.nor_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit5,
            { "UE Reachable from SGSN", "diameter.3gpp.nor_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit6,
            { "Ready for SM from MME", "diameter.3gpp.nor_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit7,
            { "Homogeneous Support of IMS Voice Over PS Sessions", "diameter.3gpp.nor_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit8,
            { "S6a/S6d-Indicator", "diameter.3gpp.nor_flags_bit8",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_bit9,
            { "Removal of MME Registration for SMS", "diameter.3gpp.nor_flags_bit9",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000200,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_nor_flags_spare_bits,
            { "Spare", "diameter.3gpp.nor_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFC00,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags,
            { "IDR Flags", "diameter.3gpp.idr_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit0,
            { "UE Reachability Request", "diameter.3gpp.idr_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit1,
            { "T-ADS Data Request", "diameter.3gpp.idr_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit2,
            { "EPS User State Request", "diameter.3gpp.idr_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit3,
            { "EPS Location Information Request", "diameter.3gpp.idr_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit4,
            { "Current Location Request", "diameter.3gpp.idr_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit5,
            { "Local Time Zone Request", "diameter.3gpp.idr_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit6,
            { "Remove SMS Registration", "diameter.3gpp.idr_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit7,
            { "RAT-Type Requested", "diameter.3gpp.idr_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_bit8,
            { "P-CSCF Restoration Request", "diameter.3gpp.idr_flags_bit8",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_idr_flags_spare_bits,
            { "Spare", "diameter.3gpp.idr_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFE00,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ppr_flags,
            { "PPR Flags", "diameter.3gpp.ppr_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ppr_flags_bit0,
            { "Reset-Indication", "diameter.3gpp.ppr_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ppr_flags_bit1,
            { "Access-Network-Info-Request", "diameter.3gpp.ppr_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ppr_flags_bit2,
            { "UE-Local-Time-Zone-Request", "diameter.3gpp.ppr_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ppr_flags_bit3,
            { "P-CSCF Restoration Request", "diameter.3gpp.ppr_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ppr_flags_spare_bits,
            { "Spare", "diameter.3gpp.ppr_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_aaa_fail_flags,
            { "AAA Failure Indication", "diameter.3gpp.aaa_fail_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_aaa_fail_flags_bit0,
            { "AAA Failure", "diameter.3gpp.aaa_fail_flags_bit0",
              FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
              NULL, HFILL }
        },
        { &hf_diameter_3gpp_aaa_fail_flags_spare_bits,
            { "Spare", "diameter.3gpp.aaa_fail_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_der_flags,
            { "DER Flags", "diameter.3gpp.der_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_der_flags_bit0,
            { "NSWO-Capability-Indication", "diameter.3gpp.der_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_der_flags_bit1,
            { "TWAN-S2a-Connectivity-Indicator", "diameter.3gpp.der_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_der_flags_spare_bits,
            { "Spare", "diameter.3gpp.der_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dea_flags,
            { "DEA Flags", "diameter.3gpp.dea_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dea_flags_bit0,
            { "NSWO-Authorization", "diameter.3gpp.dea_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dea_flags_bit1,
            { "TWAN-S2a-Connectivity-Indicator", "diameter.3gpp.dea_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_dea_flags_spare_bits,
            { "Spare", "diameter.3gpp.dea_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_rar_flags,
            { "RAR Flags", "diameter.3gpp.rar_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_rar_flags_bit0,
            { "Trust-Relationship-Update-indication", "diameter.3gpp.rar_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_rar_flags_bit1,
            { "P-CSCF Restoration Request", "diameter.3gpp.rar_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_rar_flags_spare_bits,
            { "Spare", "diameter.3gpp.rar_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_der_s6b_flags,
            { "RAR Flags", "diameter.3gpp.rar_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_der_s6b_flags_bit0,
            { "Initial-Attach-Indicator", "diameter.3gpp.rar_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_der_s6b_flags_spare_bits,
            { "Spare", "diameter.3gpp.rar_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_ipv6addr,
            { "IPv6 Address", "diameter.3gpp.ipv6addr",
            FT_IPv6, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_abs_time_ofmbms_data_tfer,
            { "Absolute Time of MBMS Data Transfer", "diameter.3gpp.mbms_abs_time_ofmbms_data_tfer",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_udp_port ,
            { "UDP Port", "diameter.3gpp.udp_port",
            FT_UINT8, BASE_DEC, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_imeisv,
            { "IMEISV", "diameter.3gpp.imeisv",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_af_charging_identifier,
            { "AF-Charging-Identifier", "diameter.3gpp.af_charging_identifier",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_af_application_identifier,
            { "AF-Application-Identifier", "diameter.3gpp.af_application_identifier",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_charging_rule_name,
            { "Charging-Rule-Name", "diameter.3gpp.charging_rule_name",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_monitoring_key,
            { "Monitoring-Key", "diameter.3gpp.monitoring_key",
            FT_STRING, BASE_NONE, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_event,
            { "MBMS-Bearer-Event", "diameter.3gpp.mbms_bearer_event",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_event_bit0,
            { "Bearer Terminated", "diameter.3gpp.mbms_bearer_event_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_event_spare_bits,
            { "Spare", "diameter.3gpp.mbms_bearer_event_spare",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result,
            { "MBMS-Bearer-Result", "diameter.3gpp.mbms_bearer_result",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit0,
            { "Success", "diameter.3gpp.mbms_bearer_result_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit1,
            { "Authorization rejected", "diameter.3gpp.mbms_bearer_result_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit2,
            { "Resources exceeded", "diameter.3gpp.mbms_bearer_result_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit3,
            { "Unknown TMGI", "diameter.3gpp.mbms_bearer_result_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit4,
            { "TMGI not in use", "diameter.3gpp.mbms_bearer_result_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit5,
            { "Overlapping MBMS-Service-Area", "diameter.3gpp.mbms_bearer_result_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit6,
            { "Unknown Flow Identifier", "diameter.3gpp.mbms_bearer_result_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit7,
            { "QoS Authorization Rejected", "diameter.3gpp.mbms_bearer_result_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit8,
            { "Unknown MBMS-Service-Area", "diameter.3gpp.mbms_bearer_result_bit8",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit9,
            { "MBMS-Service-Area Authorization Rejected", "diameter.3gpp.mbms_bearer_result_bit9",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000200,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit10,
            { "MBMS-Start-Time", "diameter.3gpp.mbms_bearer_result_bit10",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000400,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_bit11,
            { "Invalid AVP combination", "diameter.3gpp.mbms_bearer_result_bit11",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000800,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_mbms_bearer_result_spare_bits,
            { "Spare", "diameter.3gpp.mbms_bearer_result_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFF000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_allocation_result,
            { "TMGI-Allocation-Result", "diameter.3gpp.tmgi_allocation_result",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_allocation_result_bit0,
            { "Success", "diameter.3gpp.tmgi_allocation_result_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_allocation_result_bit1,
            { "Authorization rejected", "diameter.3gpp.tmgi_allocation_result_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_allocation_result_bit2,
            { "Resources exceeded", "diameter.3gpp.tmgi_allocation_result_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_allocation_result_bit3,
            { "Unknown TMGI", "diameter.3gpp.tmgi_allocation_result_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_allocation_result_bit4,
            { "Too many TMGIs requested", "diameter.3gpp.tmgi_allocation_result_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_allocation_result_spare_bits,
            { "Spare", "diameter.3gpp.tmgi_allocation_result_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFE0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_deallocation_result,
            { "TMGI-Deallocation-Result", "diameter.3gpp.tmgi_deallocation_result",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_deallocation_result_bit0,
            { "Success", "diameter.3gpp.tmgi_deallocation_result_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_deallocation_result_bit1,
            { "Authorization rejected", "diameter.3gpp.tmgi_deallocation_result_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_deallocation_result_bit2,
            { "Unknown TMGI", "diameter.3gpp.tmgi_deallocation_result_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_tmgi_deallocation_result_spare_bits,
            { "Spare", "diameter.3gpp.tmgi_deallocation_result_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF8,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_sar_flags,
        { "SAR Flags", "diameter.3gpp.sar_flags",
            FT_UINT32, BASE_HEX, NULL, 0x0,
            NULL, HFILL }
        },

        { &hf_diameter_3gpp_sar_flags_flags_bit0,
        { "P-CSCF Restoration Indication", "diameter.3gpp.sar_flags_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit0,
        { "Rel8", "diameter.3gpp.feature_list1_rx_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit1,
        { "Rel9", "diameter.3gpp.feature_list1_rx_flags_bit1",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit2,
        { "ProvAFsignalFlow", "diameter.3gpp.feature_list1_rx_flags_bit2",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit3,
        { "SponsoredConnectivity", "diameter.3gpp.feature_list1_rx_flags_bit3",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit4,
        { "Rel10", "diameter.3gpp.feature_list1_rx_flags_bit4",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit5,
        { "NetLoc", "diameter.3gpp.feature_list1_rx_flags_bit5",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit6,
        { "ExtendedFilter", "diameter.3gpp.feature_list1_rx_flags_bit6",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit7,
        { "SCTimeBasedUM", "diameter.3gpp.feature_list1_rx_flags_bit7",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit8,
        { "Netloc-Trusted-WLAN", "diameter.3gpp.feature_list1_rx_flags_bit8",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit9,
        { "RAN-NAS-Cause", "diameter.3gpp.feature_list1_rx_flags_bit9",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
            NULL, HFILL }
        },

        { &hf_diameter_3gpp_feature_list1_rx_flags_bit10,
        { "GroupComService", "diameter.3gpp.feature_list1_rx_flags_bit10",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit11,
        { "ResShare", "diameter.3gpp.feature_list1_rx_flags_bit11",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000800,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit12,
        { "DeferredService", "diameter.3gpp.feature_list1_rx_flags_bit12",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00001000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit13,
        { "DSCP", "diameter.3gpp.feature_list1_rx_flags_bit13",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00002000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit14,
        { "SponsorChange", "diameter.3gpp.feature_list1_rx_flags_bit14",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00004000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit15,
        { "E2EQOSMTSI", "diameter.3gpp.feature_list1_rx_flags_bit15",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00008000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit16,
        { "NetLoc-Untrusted-WLAN", "diameter.3gpp.feature_list1_rx_flags_bit16",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00010000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit17,
        { "MCPTT", "diameter.3gpp.feature_list1_rx_flags_bit17",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00020000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_bit18,
        { "PrioritySharing", "diameter.3gpp.feature_list1_rx_flags_bit18",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00040000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list1_rx_flags_spare_bits,
        { "Spare", "diameter.3gpp.feature_list2_s6a_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFF80000,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_rx_flags_bit0,
        { "PCSCF-Restoration-Enhancement", "diameter.3gpp.feature_list2_rx_flags_bit0",
            FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list2_rx_flags_spare_bits,
        { "Spare", "diameter.3gpp.feature_list2_s6a_flags_spare",
            FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
            NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_sd_flags,
        { "SD Feature-List Flags", "diameter.3gpp.sd_feature_list_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit0,
        { "UMCH", "diameter.3gpp.feature_list_sd_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000001,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit1,
        { "Trusted-WLAN", "diameter.3gpp.feature_list_sd_flags_bit1",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000002,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit2,
        { "TimeBasedUM", "diameter.3gpp.feature_list_sd_flags_bit2",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000004,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit3,
        { "PendingTransaction", "diameter.3gpp.feature_list_sd_flags_bit3",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000008,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit4,
        { "ABC", "diameter.3gpp.feature_list_sd_flags_bit4",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000010,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit5,
        { "CNO-ULI", "diameter.3gpp.feature_list_sd_flags_bit5",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000020,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit6,
        { "ExUsage", "diameter.3gpp.feature_list_sd_flags_bit6",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000040,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit7,
        { "DLDSCPMarking", "diameter.3gpp.feature_list_sd_flags_bit7",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000080,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit8,
        { "TSC", "diameter.3gpp.feature_list_sd_flags_bit8",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000100,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit9,
        { "ENB-Change", "diameter.3gpp.feature_list_sd_flags_bit9",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000200,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_bit10,
        { "SponsoredConnectivity-Sd", "diameter.3gpp.feature_list_sd_flags_bit10",
          FT_BOOLEAN, 32, TFS(&tfs_supported_not_supported), 0x00000400,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_feature_list_sd_flags_spare_bits,
        { "Spare", "diameter.3gpp.feature_list_sd_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFF800,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_ran_nas_protocol_type,
        { "Protocol Type", "diameter.3gpp.ran_nas.protocol_type",
          FT_UINT8, BASE_DEC, VALS(ran_nas_prot_type_vals), 0xF0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_ran_nas_cause_type,
        { "S1AP Cause Type", "diameter.3gpp.ran_nas.s1ap_type",
          FT_UINT8, BASE_DEC, VALS(s1ap_Cause_vals), 0x0F,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_ran_nas_cause_value,
        { "Cause Value", "diameter.3gpp.ran_nas.cause_value",
          FT_UINT32, BASE_DEC, NULL, 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_s1ap_radio_network,
        { "S1AP Radio Network Cause Value", "diameter.3gpp.ran_nas.radio_cause",
          FT_UINT8, BASE_DEC, VALS(s1ap_CauseRadioNetwork_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_s1ap_transport,
        { "S1AP Transport Cause Value", "diameter.3gpp.ran_nas.transport_cause",
          FT_UINT8, BASE_DEC, VALS(s1ap_CauseTransport_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_s1ap_nas,
        { "S1AP NAS Cause Value", "diameter.3gpp.ran_nas.nas_cause",
          FT_UINT8, BASE_DEC, VALS(s1ap_CauseNas_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_s1ap_protocol,
        { "S1AP Protocol Cause Value", "diameter.3gpp.ran_nas.protocol_cause",
          FT_UINT8, BASE_DEC, VALS(s1ap_CauseProtocol_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_s1ap_misc,
        { "S1AP Misc. Cause Value", "diameter.3gpp.ran_nas.misc_cause",
          FT_UINT8, BASE_DEC, VALS(s1ap_CauseMisc_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_emm_cause,
        { "EMM Cause Value", "diameter.3gpp.ran_nas.emm_cause",
          FT_UINT8, BASE_DEC, VALS(nas_eps_emm_cause_values), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_esm_cause,
        { "ESM Cause Value", "diameter.3gpp.ran_nas.esm_cause",
          FT_UINT8, BASE_DEC, VALS(nas_eps_esm_cause_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_diameter_cause,
        { "Diameter Cause Value", "diameter.3gpp.ran_nas.diameter_cause",
          FT_UINT16, BASE_DEC, VALS(diameter_3gpp_termination_cause_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_ikev2_cause,
        { "IKEv2 Cause Value", "diameter.3gpp.ran_nas.ikev2_cause",
          FT_UINT16, BASE_DEC, VALS(diameter_3gpp_IKEv2_error_type_vals), 0x0,
          NULL, HFILL}
        },
        { &hf_diameter_3gpp_emergency_services_flags,
        { "Emergency-Services Flags", "diameter.3gpp.emergency_ind_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_emergency_services_flags_bit0,
        { "Emergency-Indication", "diameter.3gpp.emergency_ind_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_emergency_services_flags_spare_bits,
        { "Spare", "diameter.3gpp.emergency_ind_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_pur_flags,
        { "PUR Flags", "diameter.3gpp.pur_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_pur_flags_spare_bits,
        { "Spare", "diameter.3gpp.pur_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_pur_flags_bit1,
        { "UE Purged in SGSN", "diameter.3gpp.pur_flags_bit1",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_pur_flags_bit0,
        { "UE Purged in MME", "diameter.3gpp.pur_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_clr_flags,
        { "CLR Flags", "diameter.3gpp.clr_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_clr_flags_spare_bits,
        { "Spare", "diameter.3gpp.clr_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_clr_flags_bit1,
        { "Reattach-Required", "diameter.3gpp.clr_flags_bit1",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_clr_flags_bit0,
        { "S6a/S6d-Indicator", "diameter.3gpp.clr_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_uvr_flags,
        { "UVR Flags", "diameter.3gpp.uvr_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_uvr_flags_spare_bits,
        { "Spare", "diameter.3gpp.uvr_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_uvr_flags_bit0,
        { "Skip Subscriber Data", "diameter.3gpp.uvr_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_uva_flags,
        { "UVA Flags", "diameter.3gpp.uva_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_uva_flags_spare_bits,
        { "Spare", "diameter.3gpp.uva_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_uva_flags_bit0,
        { "Temporary Empty VPLMN CSG Subscription Data", "diameter.3gpp.uva_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_subscription_data_flags,
        { "Subscription Data Flags", "diameter.3gpp.subscription_data_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_subscription_data_flags_spare_bits,
        { "Spare", "diameter.3gpp.subscription_data_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFF0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_subscription_data_flags_bit3,
        { "PDN-Connection-Restricted", "diameter.3gpp.subscription_data_flags_bit3",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_subscription_data_flags_bit2,
        { "User Plane Integrity Protection", "diameter.3gpp.subscription_data_flags_bit2",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_subscription_data_flags_bit1,
        { "SMS-In-SGSN-Allowed-Indication", "diameter.3gpp.subscription_data_flags_bit1",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_subscription_data_flags_bit0,
        { "PS-And-SMS-Only-Service-Provision-Indication", "diameter.3gpp.subscription_data_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_wlan_offloadability_eutran,
        { "WLAN-offloadability-EUTRAN", "diameter.3gpp.wlan_offloadability_eutran",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_wlan_offloadability_eutran_spare_bits,
        { "Spare", "diameter.3gpp.wlan_offloadability_eutran_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_wlan_offloadability_eutran_bit0,
        { "PWLAN offloadability for E-UTRAN", "diameter.3gpp.wlan_offloadability_eutran_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_wlan_offloadability_utran,
        { "WLAN-offloadability-UTRAN", "diameter.3gpp.wlan_offloadability_utran",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_wlan_offloadability_utran_spare_bits,
        { "Spare", "diameter.3gpp.wlan_offloadability_utran_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_wlan_offloadability_utran_bit0,
        { "PWLAN offloadability for UTRAN", "diameter.3gpp.wlan_offloadability_utran_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_air_flags,
        { "AIR Flags", "diameter.3gpp.air_flags",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_air_flags_spare_bits,
        { "Spare", "diameter.3gpp.air_flags_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFE,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_air_flags_bit0,
        { "Send UE Usage Type", "diameter.3gpp.air_flags_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_preferred_data_mode,
        { "Preferred Data Mode", "diameter.3gpp.preferred_data_mode",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_preferred_data_mode_spare_bits,
        { "Spare", "diameter.3gpp.preferred_data_mode_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_preferred_data_mode_bit1,
        { "Data over Control Plane Preferred", "diameter.3gpp.preferred_data_mode_bit1",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_preferred_data_mode_bit0,
        { "Data over User Plane Preferred", "diameter.3gpp.preferred_data_mode_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_v2x_permission,
        { "V2X Permission", "diameter.3gpp.v2x_permission",
          FT_UINT32, BASE_HEX, NULL, 0x0,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_v2x_permission_spare_bits,
        { "Spare", "diameter.3gpp.v2x_permission_spare",
          FT_UINT32, BASE_HEX, NULL, 0xFFFFFFFC,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_v2x_permission_bit1,
        { "Allow V2X communication over PC5 as Pedestrian UE", "diameter.3gpp.v2x_permission_bit1",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002,
          NULL, HFILL }
        },
        { &hf_diameter_3gpp_v2x_permission_bit0,
        { "Allow V2X communication over PC5 as Vehicle UE", "diameter.3gpp.v2x_permission_bit0",
          FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001,
          NULL, HFILL }
        },
};


    /* Setup protocol subtree array */
    static gint *ett[] = {
        &diameter_3gpp_path_ett,
        &diameter_3gpp_uar_flags_ett,
        &diameter_3gpp_feature_list_ett,
        &diameter_3gpp_tmgi_ett,
        &diameter_3gpp_cms_ett,
        &diameter_3gpp_qos_subscribed_ett,
        &diameter_3gpp_ulr_flags_ett,
        &diameter_3gpp_ula_flags_ett,
        &diameter_3gpp_dsr_flags_ett,
        &diameter_3gpp_dsa_flags_ett,
        &diameter_3gpp_ida_flags_ett,
        &diameter_3gpp_pua_flags_ett,
        &diameter_3gpp_nor_flags_ett,
        &diameter_3gpp_idr_flags_ett,
        &diameter_3gpp_ppr_flags_ett,
        &diameter_3gpp_aaa_fail_flags_ett,
        &diameter_3gpp_der_flags_ett,
        &diameter_3gpp_dea_flags_ett,
        &diameter_3gpp_rar_flags_ett,
        &diameter_3gpp_der_s6b_flags_ett,
        &diameter_3gpp_mbms_bearer_event_ett,
        &diameter_3gpp_mbms_bearer_result_ett,
        &diameter_3gpp_tmgi_allocation_result_ett,
        &diameter_3gpp_tmgi_deallocation_result_ett,
        &diameter_3gpp_sar_flags_ett,
        &diameter_3gpp_emergency_services_flags_ett,
        &diameter_3gpp_pur_flags_ett,
        &diameter_3gpp_clr_flags_ett,
        &diameter_3gpp_uvr_flags_ett,
        &diameter_3gpp_uva_flags_ett,
        &diameter_3gpp_subscription_data_flags_ett,
        &diameter_3gpp_wlan_offloadability_eutran_ett,
        &diameter_3gpp_wlan_offloadability_utran_ett,
        &diameter_3gpp_air_flags_ett,
        &diameter_3gpp_preferred_data_mode_ett,
        &diameter_3gpp_v2x_permission_ett
    };

    expert_module_t *expert_diameter_3gpp;

    static ei_register_info ei[] = {
        { &ei_diameter_3gpp_plmn_id_wrong_len,
        { "diameter_3gpp.plmn_id_wrong_len", PI_PROTOCOL, PI_ERROR, "PLMN Id should be 3 octets", EXPFILL } },
    };

    /* Required function calls to register the header fields and subtrees used */
    proto_diameter_3gpp = proto_register_protocol("Diameter 3GPP","Diameter3GPP", "diameter.3gpp");
    proto_register_field_array(proto_diameter_3gpp, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));

    expert_diameter_3gpp = expert_register_protocol(proto_diameter_3gpp);
    expert_register_field_array(expert_diameter_3gpp, ei, array_length(ei));

}

/*
 * Editor modelines  -  http://www.wireshark.org/tools/modelines.html
 *
 * Local variables:
 * c-basic-offset: 4
 * tab-width: 8
 * indent-tabs-mode: nil
 * End:
 *
 * vi: set shiftwidth=4 tabstop=8 expandtab:
 * :indentSize=4:tabSize=8:noTabs=true:
 */