summaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-rohc.c
blob: e2e327869511e0608e7b6a16b88e0487887f0cdb (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
/* packet-rohc.c
 * Routines for RObust Header Compression (ROHC) dissection.
 *
 * Copyright 2011, Anders Broman <anders.broman[at]ericsson.com>
 *                 Per Liedberg  <per.liedberg [at]ericsson.com>
 *
 * Wireshark - Network traffic analyzer
 * By Gerald Combs <gerald@wireshark.org>
 * Copyright 1998 Gerald Combs
 *
 * SPDX-License-Identifier: GPL-2.0-or-later
 *
 * Ref:
 * https://www.ietf.org/rfc/rfc3095             RObust Header Compression (ROHC): Framework and four profiles: RTP, UDP, ESP, and uncompressed
 * https://datatracker.ietf.org/doc/rfc4815/    RObust Header Compression (ROHC): Corrections and Clarifications to RFC 3095
 * https://datatracker.ietf.org/doc/rfc5225/    RObust Header Compression Version 2 (ROHCv2): Profiles for RTP, UDP, IP, ESP and UDP-Lite
 *
 * Only RTP (1) and UDP (2) are currently implemented.
 */

#include "config.h"

#include <epan/packet.h>
#include <epan/etypes.h>
#include <epan/ipproto.h>
#include <epan/addr_resolv.h>
#include <epan/rtp_pt.h>
#include <epan/expert.h>
#include <epan/proto_data.h>
#include "packet-rohc.h"

void proto_register_rohc(void);
void proto_reg_handoff_rohc(void);

static int
dissect_compressed_list(int expected_encoding_type _U_, packet_info *pinfo _U_,
                        proto_tree *tree, tvbuff_t *tvb, int offset);

/* cid -> rohc_cid_context_t* */
static GHashTable *rohc_cid_hash;

/* Initialize the protocol and registered fields */
static int proto_rohc;


static int hf_rohc_padding;
static int hf_rohc_add_cid;
static int hf_rohc_feedback;
static int hf_rohc_code;
static int hf_rohc_size;
static int hf_rohc_ir_packet;
static int hf_rohc_ir_dyn_packet;
static int hf_rohc_small_cid;
static int hf_rohc_large_cid;
static int hf_rohc_acktype;
static int hf_rohc_mode;
static int hf_rohc_sn;
static int hf_rohc_profile_spec_octet;
static int hf_rohc_fb1_sn;
static int hf_rohc_opt_type;
static int hf_rohc_opt_len;
static int hf_rohc_crc;
static int hf_rohc_opt_sn;
static int hf_rohc_ext;
static int hf_rohc_ext_sn;
static int hf_rohc_opt_clock;
static int hf_rohc_opt_jitter;
static int hf_rohc_opt_loss;
static int hf_rohc_profile;
static int hf_rohc_d_bit;
static int hf_rohc_ip_version;
static int hf_rohc_ip_version_ip_profile;
static int hf_rohc_ip_protocol;
static int hf_rohc_static_ipv4;
static int hf_rohc_ipv4_src;
static int hf_rohc_ipv4_dst;
static int hf_rohc_ipv6_flow;
static int hf_rohc_ipv6_nxt_hdr;
static int hf_rohc_ipv6_src;
static int hf_rohc_ipv6_dst;
static int hf_rohc_static_udp;
static int hf_rohc_udp_src_port;
static int hf_rohc_udp_dst_port;
static int hf_rohc_static_rtp;
static int hf_rohc_rtp_ssrc;
static int hf_rohc_dynamic_ipv4;
static int hf_rohc_dynamic_udp;
static int hf_rohc_rtp_tos;
static int hf_rohc_rtp_ttl;
static int hf_rohc_rtp_id;
static int hf_rohc_rtp_df;
static int hf_rohc_rtp_rnd;
static int hf_rohc_rtp_nbo;
static int hf_rohc_dynamic_udp_checksum;
static int hf_rohc_dynamic_rtp;
static int hf_rohc_rtp_v;
static int hf_rohc_rtp_p;
static int hf_rohc_rtp_rx;
static int hf_rohc_rtp_cc;
static int hf_rohc_rtp_m;
static int hf_rohc_rtp_pt;
static int hf_rohc_rtp_sn;
static int hf_rohc_rtp_timestamp;
static int hf_rohc_rtp_x;
static int hf_rohc_rtp_mode;
static int hf_rohc_rtp_tis;
static int hf_rohc_rtp_tss;
static int hf_rohc_rtp_ts_stride;
static int hf_rohc_rtp_time_stride;
static int hf_rohc_var_len;
static int hf_rohc_ipv6_tc;
static int hf_rohc_ipv6_hop_limit;
static int hf_rohc_ir_pkt_frame;
static int hf_rohc_ir_previous_frame;
static int hf_rohc_ir_profile;
static int hf_rohc_ir_ip_version;
static int hf_rohc_ir_mode;
static int hf_rohc_comp_sn;
static int hf_rohc_r_0_crc;
static int hf_rohc_x;
static int hf_rohc_ts;
static int hf_rohc_comp_ip_id;
static int hf_rohc_comp_ip_id2;
static int hf_rohc_t;
static int hf_rohc_ext3_flags;
static int hf_rohc_ext3_s;
static int hf_rohc_ext3_r_ts;
static int hf_rohc_ext3_tsc;
static int hf_rohc_ext3_udp_mode;
static int hf_rohc_ext3_i;
static int hf_rohc_ext3_ip;
static int hf_rohc_ext3_ip2;
static int hf_rohc_ext3_rtp;
static int hf_rohc_ext3_inner_ip_flags;
static int hf_rohc_ext3_inner_tos;
static int hf_rohc_ext3_inner_ttl;
static int hf_rohc_ext3_inner_df;
static int hf_rohc_ext3_inner_pr;
static int hf_rohc_ext3_inner_ipx;
static int hf_rohc_ext3_inner_nbo;
static int hf_rohc_ext3_inner_rnd;
static int hf_rohc_ext3_inner_ip2;
static int hf_rohc_ext3_outer_ip_flags;
static int hf_rohc_ext3_outer_tos;
static int hf_rohc_ext3_outer_ttl;
static int hf_rohc_ext3_outer_df;
static int hf_rohc_ext3_outer_pr;
static int hf_rohc_ext3_outer_ipx;
static int hf_rohc_ext3_outer_nbo;
static int hf_rohc_ext3_outer_rnd;
static int hf_rohc_ext3_outer_i2;
static int hf_rohc_ext3_rtp_flags;
static int hf_rohc_ext3_rtp_mode;
static int hf_rohc_ext3_r_pt;
static int hf_rohc_ext3_m;
static int hf_rohc_ext3_r_x;
static int hf_rohc_ext3_csrc;
static int hf_rohc_ext3_tss;
static int hf_rohc_ext3_tis;
static int hf_rohc_ext3_r_p;

static int hf_rohc_compressed_list;
static int hf_rohc_compressed_list_et;
static int hf_rohc_compressed_list_gp;
static int hf_rohc_compressed_list_ps;
static int hf_rohc_compressed_list_res;
static int hf_rohc_compressed_list_count;
static int hf_rohc_compressed_list_cc;
static int hf_rohc_compressed_list_xi_1;
static int hf_rohc_compressed_list_gen_id;
static int hf_rohc_compressed_list_ref_id;
static int hf_rohc_compressed_list_mask_size;
static int hf_rohc_compressed_list_ins_bit_mask;
static int hf_rohc_compressed_list_rem_bit_mask;
static int hf_rohc_spare_bits;
static int hf_rohc_ip_id;
static int hf_rohc_udp_checksum;
/* Generated from convert_proto_tree_add_text.pl */
static int hf_rohc_no_configuration_info;
static int hf_rohc_unknown_option_data;
static int hf_rohc_error_packet;
static int hf_rohc_configured_by_ir_packet;

static int ett_rohc;
static int ett_rohc_conf;
static int ett_rohc_fb;
static int ett_rohc_feedback;
static int ett_rohc_ir;
static int ett_rohc_ir_dyn;
static int ett_rohc_static_ipv4;
static int ett_rohc_static_udp;
static int ett_rohc_static_rtp;
static int ett_rohc_rtp_static;
static int ett_rohc_rtp_dynamic;
static int ett_rohc_dynamic_ipv4;
static int ett_rohc_dynamic_udp;
static int ett_rohc_dynamic_rtp;
static int ett_rohc_compressed_list;
static int ett_rohc_packet;
static int ett_rohc_ext;
static int ett_rohc_ext3_flags;
static int ett_rohc_ext3_inner_ip_flags;
static int ett_rohc_ext3_outer_ip_flags;
static int ett_rohc_ext3_rtp_flags;

static expert_field ei_rohc_profile_spec_octet;
static expert_field ei_rohc_rohc_opt_clock;
static expert_field ei_rohc_opt_jitter;
static expert_field ei_rohc_feedback_type_2_is_not_applicable_for_uncompressed_profile;
static expert_field ei_rohc_not_dissected_yet;
static expert_field ei_rohc_profile_specific;
static expert_field ei_rohc_profile_not_supported;
static expert_field ei_rohc_ip_version;
static expert_field ei_rohc_desegmentation_not_implemented;

static dissector_handle_t rohc_handle;

static dissector_handle_t ip_handle;
static dissector_handle_t ipv6_handle;

enum rohc_d_mode
{
  NO_CONTEXT = 1,
  STATIC_CONTEXT = 2,
  FULL_CONTEXT = 3
};

typedef struct _rohc_cid_context_t
{
    uint8_t            rohc_ip_version;
    bool               large_cid_present;
    enum rohc_mode     mode;
    enum rohc_d_mode   d_mode;                 /* Decompressor mode (not used) */
    bool               rnd;
    bool               udp_checksum_present;
    uint16_t           profile;
    int                prev_ir_frame_number;   /* The frame number of the previous IR packet seen. -1 if not set */
    int                ir_frame_number;        /* The frame number of the latest IR packet seen. -1 if not set */

} rohc_cid_context_t;

static const value_string rohc_profile_vals[] =
{
    { 0x0000,    "Uncompressed" },           /*RFC 5795*/
    { 0x0001,    "RTP" },                    /*RFC 3095*/
    { 0x0002,    "UDP" },                    /*RFC 3095*/
    { 0x0003,    "ESP" },                    /*RFC 3095*/
    { 0x0004,    "IP" },                     /*RFC 3843*/
    { 0x0005,    "LLA" },                    /*RFC 3242*/
    { 0x0105,    "LLA with R-mode" },        /*RFC 3408*/
    { 0x0006,    "TCP" },                    /*RFC 4996*/
    { 0x0007,    "RTP/UDP-Lite" },           /*RFC 4019*/
    { 0x0008,    "UDP-Lite" },               /*RFC 4019*/
    { 0x0101,    "v2 RTP" },                 /*RFC 5225*/
    { 0x0102,    "v2 UDP" },                 /*RFC 5225*/
    { 0x0103,    "v2 ESP" },                 /*RFC 5225*/
    { 0x0104,    "v2 IP" },                  /*RFC 5225*/
    { 0x0107,    "v2 RTP/UDP-Lite" },        /*RFC 5225*/
    { 0x0108,    "v2 UDP-Lite" },            /*RFC 5225*/
    { 0, NULL },
};

/* Defaults if not supplied */
static uint16_t g_profile = ROHC_PROFILE_UNKNOWN;
static uint8_t g_version = 4;

static const value_string rohc_acktype_vals[] =
{
    { 0,    "ACK" },
    { 1,    "NACK" },
    { 2,    "STATIC-NACK" },
    { 3,    "reserved (MUST NOT be used.  Otherwise unparsable.)" },
    { 0, NULL },
};

static const value_string rohc_mode_vals[] =
{
    { 0,    "Reserved" },
    { 1,    "Unidirectional" },
    { 2,    "Bidirectional Optimistic" },
    { 3,    "Bidirectional Reliable" },
    { 0, NULL },
};

static const value_string rohc_opt_type_vals[] =
{
    { 1,    "CRC" },
    { 2,    "REJECT" },
    { 3,    "SN-NOT-VALID" },
    { 4,    "SN" },
    { 5,    "CLOCK" },
    { 6,    "JITTER" },
    { 7,    "LOSS" },
    { 0, NULL },
};



static const value_string rohc_ip_version_vals[] =
{
    { 0,    "Unknown" },
    { 4,    "IPv4" },
    { 6,    "IPv6" },
    { 0, NULL },
};

static const value_string rohc_ip_version_ip_profile_vals[] =
{
    { 0x4,    "IPv4" },
    { 0x6,    "IPv6" },
    { 0xc,    "IPv4" },
    { 0xe,    "IPv6" },
    { 0, NULL },
};

static const value_string rohc_var_len_vals[] =
{
    { 0,    "One octet" },
    { 2,    "Two octets" },
    { 6,    "Three octets" },
    { 7,    "Four octets" },
    { 0, NULL },
};

static const value_string compressed_list_encoding_type_vals[] =
{
    { 0,    "Generic scheme" },
    { 1,    "Insertion only scheme" },
    { 2,    "Removal only scheme" },
    { 3,    "Remove then insert scheme" },
    { 0, NULL },
};

static const value_string compressed_list_ps_vals[] =
{
    { 0,    "4-bit XI fields" },
    { 1,    "8-bit XI fields" },
    { 0, NULL },
};

/* RTP extension 3 flags masks */
#define ROHC_RTP_EXT3_FLAGS_MASK        0x7f
#define ROHC_RTP_EXT3_S_MASK            0x20
#define ROHC_RTP_EXT3_R_TS_MASK         0x10
#define ROHC_RTP_EXT3_TSC_MASK          0x08
#define ROHC_RTP_EXT3_I_MASK            0x04
#define ROHC_RTP_EXT3_IP_MASK           0x02
#define ROHC_RTP_EXT3_RTP_MASK          0x01
/* RTP Inner IP header flags masks */
#define ROHC_RTP_EXT3_INNER_TOS_MASK    0x80
#define ROHC_RTP_EXT3_INNER_TTL_MASK    0x40
#define ROHC_RTP_EXT3_INNER_DF_MASK     0x20
#define ROHC_RTP_EXT3_INNER_PR_MASK     0x10
#define ROHC_RTP_EXT3_INNER_IPX_MASK    0x08
#define ROHC_RTP_EXT3_INNER_NBO_MASK    0x04
#define ROHC_RTP_EXT3_INNER_RND_MASK    0x02
#define ROHC_RTP_EXT3_INNER_IP2_MASK    0x01
/* RTP Outer IP header flags masks */
#define ROHC_RTP_EXT3_OUTER_TOS_MASK    0x80
#define ROHC_RTP_EXT3_OUTER_TTL_MASK    0x40
#define ROHC_RTP_EXT3_OUTER_DF_MASK     0x20
#define ROHC_RTP_EXT3_OUTER_PR_MASK     0x10
#define ROHC_RTP_EXT3_OUTER_IPX_MASK    0x08
#define ROHC_RTP_EXT3_OUTER_NBO_MASK    0x04
#define ROHC_RTP_EXT3_OUTER_RND_MASK    0x02
#define ROHC_RTP_EXT3_OUTER_I2_MASK     0x01
/* RTP header flags masks */
#define ROHC_RTP_EXT3_RTP_MODE_MASK     0xc0
#define ROHC_RTP_EXT3_R_PT_MASK         0x20
#define ROHC_RTP_EXT3_M_MASK            0x10
#define ROHC_RTP_EXT3_R_X_MASK          0x08
#define ROHC_RTP_EXT3_CSRC_MASK         0x04
#define ROHC_RTP_EXT3_TSS_MASK          0x02
#define ROHC_RTP_EXT3_TIS_MASK          0x01
/* RTP header fields masks */
#define ROHC_RTP_EXT3_R_P_MASK          0x80

/* UDP extension 3 flag masks */
#define ROHC_UDP_EXT3_UDP_MODE_MASK     0x18
#define ROHC_UDP_EXT3_IP2_MASK          0x01


/* 4.5.6.  Self-describing variable-length values */
static uint32_t
get_self_describing_var_len_val(tvbuff_t *tvb, proto_tree *tree, int offset, int hf_index, uint8_t *val_len)
{
    uint8_t oct;
    uint32_t val = 0;
    int     num_bits = 0, bit_offset = offset <<3;

    /* Get first byte */
    oct = tvb_get_uint8(tvb, offset);

    if ((oct&0x80)==0) {
        /* First bit is 0 - 1 octet */
        *val_len = 1;
        val = (oct&0x7f);
        proto_tree_add_bits_item(tree, hf_rohc_var_len, tvb, bit_offset, 1, ENC_BIG_ENDIAN);
        num_bits = 7;
        bit_offset++;
    } else if ((oct&0xc0)==0x80) {
        /* First bits are 10: 2 octets */
        *val_len = 2;
        proto_tree_add_bits_item(tree, hf_rohc_var_len, tvb, bit_offset, 2, ENC_BIG_ENDIAN);
        bit_offset+=2;
        num_bits = 14;
        val = tvb_get_ntohs(tvb, offset)&0x3fff;
    } else if ((oct&0xe0)==0xc0) {
        /* First bits are 110: 3 octets */
        *val_len = 3;
        proto_tree_add_bits_item(tree, hf_rohc_var_len, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
        bit_offset+=3;
        num_bits = 21;
        val = tvb_get_ntoh24(tvb, offset)&0x1fffff;
    } else if ((oct&0xe0)==0xe0) {
        /* First bits are 111: 4 octets */
        *val_len = 4;
        proto_tree_add_bits_item(tree, hf_rohc_var_len, tvb, bit_offset, 3, ENC_BIG_ENDIAN);
        bit_offset+=3;
        num_bits = 29;
        val = tvb_get_ntohl(tvb, offset)&0x1fffffff;
    }

    /* Add the field */
    proto_tree_add_bits_item(tree, hf_index, tvb, bit_offset, num_bits, ENC_BIG_ENDIAN);

    return val;
}

/* 5.7.1. Packet type 0: UO-0, R-0, R-0-CRC */
static int
dissect_rohc_pkt_type_0(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, uint8_t pkt_type, rohc_cid_context_t *rohc_cid_context)
{
    uint8_t val_len = 0;
    uint64_t sn;
    proto_tree *pkt_tree;

    switch (rohc_cid_context->mode) {
        case RELIABLE_BIDIRECTIONAL: /* R-mode */
            if ((pkt_type&0xc0)==0x00) {
            /*   R-0
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 0   0 |          SN           |
                *   +===+===+===+===+===+===+===+===+
                */
                if (rohc_cid_context->large_cid_present == true) {
                    /* Handle Large CID:s here */
                    get_self_describing_var_len_val(tvb, tree, offset+1, hf_rohc_large_cid, &val_len);
                }
                /* R-0 subtree */
                col_append_str(pinfo->cinfo, COL_INFO, "R-0");
                pkt_tree = proto_tree_add_subtree(tree, tvb, offset, 1+val_len, ett_rohc_packet, NULL, "R-0 packet");

                /* SN */
                sn = tvb_get_bits8(tvb,(offset<<3)+2, 6);
                proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
                offset += 1 + val_len;

                /* Show SN in info column */
                col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", (unsigned)sn);
            } else if ((pkt_type&0xc0)==0x40) {
            /*   R-0-CRC
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 0   1 |          SN           |
                *   +===+===+===+===+===+===+===+===+
                *   |SN |            CRC            |
                *   +---+---+---+---+---+---+---+---+
                */
                crumb_spec_t rohc_sn_crumbs[] = {
                    { 2, 6},
                    { 8, 1},
                    { 0, 0}
                };
                if (rohc_cid_context->large_cid_present) {
                    /* Handle Large CID:s here */
                    get_self_describing_var_len_val(tvb, tree, offset+1, hf_rohc_large_cid, &val_len);
                    rohc_sn_crumbs[1].crumb_bit_offset += val_len*8;
                }
                /* R-0-CRC subtree */
                col_append_str(pinfo->cinfo, COL_INFO, "R-0-CRC");
                pkt_tree = proto_tree_add_subtree(tree, tvb, offset, 2+val_len, ett_rohc_packet, NULL, "R-0-CRC packet");
                /* SN */
                proto_tree_add_split_bits_item_ret_val(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3),
                                                       rohc_sn_crumbs, &sn);
                offset += (1 + val_len);

                /* CRC */
                proto_tree_add_bits_item(pkt_tree, hf_rohc_r_0_crc, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
                offset++;

                /* Show SN in info column */
                col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", (unsigned)sn);
            }
            break;
        case UNIDIRECTIONAL: /* U-mode */
            /* Fall trough */
        case OPTIMISTIC_BIDIRECTIONAL: /* O-mode */
            /*   UO-0
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 0 |      SN       |    CRC    |
                *   +===+===+===+===+===+===+===+===+
                */
            if (rohc_cid_context->large_cid_present == true) {
                /* Handle Large CID:s here */
                get_self_describing_var_len_val(tvb, tree, offset+1, hf_rohc_large_cid, &val_len);
            }
            /* UO-0 subtree */
            col_append_str(pinfo->cinfo, COL_INFO, "UO-0");
            pkt_tree = proto_tree_add_subtree(tree, tvb, offset, 1+val_len, ett_rohc_packet, NULL, "UO-0 packet");

            /* SN */
            sn = tvb_get_bits8(tvb,(offset<<3)+1, 4);
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+1, 4, ENC_BIG_ENDIAN);

            /* CRC */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_r_0_crc, tvb, (offset<<3)+5, 3, ENC_BIG_ENDIAN);
            offset += 1 + val_len;

            /* Show SN in info column */
            col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", (unsigned)sn);
            break;

        default:
            col_append_str(pinfo->cinfo, COL_INFO, "Packet type 0");
            break;
    }

    return offset;
}

/* 5.7.5. Extension formats */
/* UDP profile extension variations as described in 5.11.4 */
static int
dissect_rohc_ext_format(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset,
                        uint8_t t, /* T-bit from base compressed header */
                        rohc_cid_context_t *rohc_cid_context)
{
    /* Extension subtree */
    int start_offset = offset;
    proto_item *ext_ti = proto_tree_add_string_format(tree,
                                                      hf_rohc_ext,
                                                      tvb, offset, 0,
                                                      "", "Extension");
    proto_tree *ext_tree = proto_item_add_subtree(ext_ti, ett_rohc_ext);


    uint8_t ext_type = (tvb_get_uint8(tvb, offset) & 0xc0) >> 6;

    if (ext_type != 3) {
        /* SN (common to extensions 0,1,2) */
        proto_tree_add_bits_item(ext_tree, hf_rohc_comp_sn, tvb, (offset<<3)+2, 3, ENC_BIG_ENDIAN);
    }

    if (ext_type == 0) {
        /*   Extension 0:
             RTP
            *     0   1   2   3   4   5   6   7
            *   +---+---+---+---+---+---+---+---+
            *   | 0   0 |    SN     |    +T     |
            *   +---+---+---+---+---+---+---+---+
            *
             UDP
            *
            *  +---+---+---+---+---+---+---+---+
            *  | 0   0 |    SN     |   IP-ID   |
            *  +---+---+---+---+---+---+---+---+
            *
            */
        proto_item_append_text(ext_ti, " 0");

        if ((t == 0) || (rohc_cid_context->profile == ROHC_PROFILE_UDP)) {
            /* IP-ID */
            proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+5, 3, ENC_BIG_ENDIAN);
        } else {
            /* TS */
            proto_tree_add_bits_item(ext_tree, hf_rohc_ts, tvb, (offset<<3)+5, 3, ENC_BIG_ENDIAN);
        }
        offset++;

    } else if (ext_type == 1) {
        /*   Extension 1:
             RTP
            *
            *   +---+---+---+---+---+---+---+---+
            *   | 0   1 |    SN     |    +T     |
            *   +---+---+---+---+---+---+---+---+
            *   |              -T               |
            *   +---+---+---+---+---+---+---+---+
            *
             UDP
            *   +---+---+---+---+---+---+---+---+
            *   | 0   1 |    SN     |   IP-ID   |
            *   +---+---+---+---+---+---+---+---+
            *   |             IP-ID             |
            *   +---+---+---+---+---+---+---+---+
            */
        proto_item_append_text(ext_ti, " 1");

        if (rohc_cid_context->profile == ROHC_PROFILE_UDP) {
            /* IP-ID */
            proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+5, 11, ENC_BIG_ENDIAN);
            offset++;
        } else {
            /* RTP profile */
            if (t == 0) {
                /* +T is IP-ID */
                proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+5, 3, ENC_BIG_ENDIAN);
                offset++;
                /* -T is TS */
                proto_tree_add_bits_item(ext_tree, hf_rohc_ts, tvb, (offset<<3), 8, ENC_BIG_ENDIAN);
            } else if (t == 1) {
                /* +T is TS */
                proto_tree_add_bits_item(ext_tree, hf_rohc_ts, tvb, (offset<<3)+5, 3, ENC_BIG_ENDIAN);
                offset++;
                /* -T is IP-ID */
                proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id, tvb, (offset<<3), 8, ENC_BIG_ENDIAN);
            }
            offset++;
        }

    } else if (ext_type == 2) {
        /*   Extension 2:
             RTP
            *
            *   +---+---+---+---+---+---+---+---+
            *   | 1   0 |    SN     |    +T     |
            *   +---+---+---+---+---+---+---+---+
            *   |              +T               |
            *   +---+---+---+---+---+---+---+---+
            *   |              -T               |
            *   +---+---+---+---+---+---+---+---+
            *
             UDP
            *   +---+---+---+---+---+---+---+---+
            *   | 1   0 |    SN     |   IP-ID2  |
            *   +---+---+---+---+---+---+---+---+
            *   |            IP-ID2             |
            *   +---+---+---+---+---+---+---+---+
            *   |             IP-ID             |
            *   +---+---+---+---+---+---+---+---+
            */
        proto_item_append_text(ext_ti, " 2");

        if (rohc_cid_context->profile == ROHC_PROFILE_UDP) {
            /* IP-ID2 */
            proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id2, tvb, (offset<<3)+5, 11, ENC_BIG_ENDIAN);
            offset += 2;
            /* IP ID */
            proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id, tvb, (offset<<3), 8, ENC_BIG_ENDIAN);
            offset++;
        } else {
            /* RTP Profile */
            if (t == 0) {
                /* +T is IP-ID */
                proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+5, 11, ENC_BIG_ENDIAN);
                offset += 2;
                /* -T is TS */
                proto_tree_add_bits_item(ext_tree, hf_rohc_ts, tvb, (offset<<3), 8, ENC_BIG_ENDIAN);
            } else if (t == 1) {
                /* +T is TS */
                proto_tree_add_bits_item(ext_tree, hf_rohc_ts, tvb, (offset<<3)+5, 11, ENC_BIG_ENDIAN);
                offset += 2;
                /* -T is IP-ID */
                proto_tree_add_bits_item(ext_tree, hf_rohc_comp_ip_id, tvb, (offset<<3), 8, ENC_BIG_ENDIAN);
            }
            offset++;
        }

    } else {
        if ((rohc_cid_context->profile == ROHC_PROFILE_RTP) ||
            (rohc_cid_context->profile == ROHC_PROFILE_UDP)) {
            /* Extension 3:
             *
             *    0     1     2     3     4     5     6     7
             * +-----+-----+-----+-----+-----+-----+-----+-----+
             * |  1     1  |  S  |R-TS | Tsc |  I  | ip  | rtp |            (FLAGS)
             * +-----+-----+-----+-----+-----+-----+-----+-----+
             * |            Inner IP header flags        | ip2 |  if ip = 1
             * ..... ..... ..... ..... ..... ..... ..... .....
             * |            Outer IP header flags              |  if ip2 = 1
             * ..... ..... ..... ..... ..... ..... ..... .....
             * |                      SN                       |  if S = 1
             *  ..... ..... ..... ..... ..... ..... ..... .....
             * /       TS (encoded as in section 4.5.6)        /  1-4 octets,
             *  ..... ..... ..... ..... ..... ..... ..... .....   if R-TS = 1
             * |                                               |
             * /            Inner IP header fields             /  variable,
             * |                                               |  if ip = 1
             *  ..... ..... ..... ..... ..... ..... ..... .....
             * |                     IP-ID                     |  2 octets, if I = 1
             *  ..... ..... ..... ..... ..... ..... ..... .....
             * |                                               |
             * /            Outer IP header fields             /  variable,
             * |                                               |  if ip2 = 1
             *  ..... ..... ..... ..... ..... ..... ..... .....
             * |                                               |
             * /          RTP header flags and fields          /  variable,
             * |                                               |  if rtp = 1
             *  ..... ..... ..... ..... ..... ..... ..... .....
             */
            proto_item_append_text(ext_ti, " 3");

            static int * const ext3_rtp_flags[] = {
                &hf_rohc_ext3_s,
                &hf_rohc_ext3_r_ts,
                &hf_rohc_ext3_tsc,
                &hf_rohc_ext3_i,
                &hf_rohc_ext3_ip,
                &hf_rohc_ext3_rtp,
                NULL
            };
            static int * const ext3_udp_flags[] = {
                &hf_rohc_ext3_s,
                &hf_rohc_ext3_udp_mode,
                &hf_rohc_ext3_i,
                &hf_rohc_ext3_ip,
                &hf_rohc_ext3_ip2,
                NULL
            };

            uint64_t ext3_flags_value = 0;
            uint64_t ext3_inner_ip_flags_value = 0;
            uint64_t ext3_outer_ip_flags_value = 0;

            /* FLAGS */
            proto_tree_add_bitmask_ret_uint64(ext_tree, tvb, offset, hf_rohc_ext3_flags, ett_rohc_ext3_flags,
                                              (rohc_cid_context->profile == ROHC_PROFILE_RTP) ? ext3_rtp_flags : ext3_udp_flags,
                                              ENC_BIG_ENDIAN, &ext3_flags_value);
            offset++;

            if (ext3_flags_value & ROHC_RTP_EXT3_IP_MASK) {
                static int * const inner_ip_flags[] = {
                    &hf_rohc_ext3_inner_tos,
                    &hf_rohc_ext3_inner_ttl,
                    &hf_rohc_ext3_inner_df,
                    &hf_rohc_ext3_inner_pr,
                    &hf_rohc_ext3_inner_ipx,
                    &hf_rohc_ext3_inner_nbo,
                    &hf_rohc_ext3_inner_rnd,
                    &hf_rohc_ext3_inner_ip2,
                    NULL
                };
                /* Inner IP header flags
                 *
                 * These correspond to the inner IP header if there are two, and the
                 * single IP header otherwise.
                 *
                 *    0     1     2     3     4     5     6     7
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * | TOS | TTL | DF  | PR  | IPX | NBO | RND | ip2 |  if ip = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 */
                proto_tree_add_bitmask_ret_uint64(ext_tree, tvb, offset, hf_rohc_ext3_inner_ip_flags, ett_rohc_ext3_inner_ip_flags, inner_ip_flags, ENC_BIG_ENDIAN, &ext3_inner_ip_flags_value);
                rohc_cid_context->rnd = ((ext3_inner_ip_flags_value & ROHC_RTP_EXT3_INNER_RND_MASK) != 0);
                offset++;
            }
            if (ext3_inner_ip_flags_value & ROHC_RTP_EXT3_INNER_IP2_MASK) {
                static int * const outer_ip_flags[] = {
                    &hf_rohc_ext3_outer_tos,
                    &hf_rohc_ext3_outer_ttl,
                    &hf_rohc_ext3_outer_df,
                    &hf_rohc_ext3_outer_pr,
                    &hf_rohc_ext3_outer_ipx,
                    &hf_rohc_ext3_outer_nbo,
                    &hf_rohc_ext3_outer_rnd,
                    &hf_rohc_ext3_outer_i2,
                    NULL
                };
                /* Outer IP header flags
                 *
                 * The fields in this part of the Extension 3 header refer to the
                 * outermost IP header:
                 *
                 *    0     1     2     3     4     5     6     7
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * | TOS2| TTL2| DF2 | PR2 |IPX2 |NBO2 |RND2 |  I2 |  if ip2 = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 */
                proto_tree_add_bitmask_ret_uint64(ext_tree, tvb, offset, hf_rohc_ext3_outer_ip_flags, ett_rohc_ext3_outer_ip_flags, outer_ip_flags, ENC_BIG_ENDIAN, &ext3_outer_ip_flags_value);
                /* TODO Update rnd when adding support for inner/outer behavior */
                rohc_cid_context->rnd = ((ext3_outer_ip_flags_value & ROHC_RTP_EXT3_OUTER_RND_MASK) != 0);
                offset++;
            }
            if (ext3_flags_value & ROHC_RTP_EXT3_S_MASK) {
                proto_tree_add_bits_item(ext_tree, hf_rohc_comp_sn, tvb, (offset<<3), 8, ENC_BIG_ENDIAN);
                offset++;
            }
            if (ext3_flags_value & ROHC_RTP_EXT3_R_TS_MASK) {
                uint8_t val_len = 0;
                get_self_describing_var_len_val(tvb, ext_tree, offset, hf_rohc_ts, &val_len);
                offset += val_len;
            }
            if (ext3_flags_value & ROHC_RTP_EXT3_IP_MASK) {
                /* Inner IP header fields
                 *
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * |         Type of Service/Traffic Class         |  if TOS = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * |         Time to Live/Hop Limit                |  if TTL = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * |         Protocol/Next Header                  |  if PR = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * /         IP extension headers                  /  variable,
                 *  ..... ..... ..... ..... ..... ..... ..... .....   if IPX = 1
                 */
                if (ext3_inner_ip_flags_value & ROHC_RTP_EXT3_INNER_TOS_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_rtp_tos, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                }
                if (ext3_inner_ip_flags_value & ROHC_RTP_EXT3_INNER_TTL_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_rtp_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                }
                if (ext3_inner_ip_flags_value & ROHC_RTP_EXT3_INNER_PR_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_ip_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                }
                if (ext3_inner_ip_flags_value & ROHC_RTP_EXT3_INNER_IPX_MASK) {
                    offset = dissect_compressed_list(0, pinfo, ext_tree, tvb, offset);
                }
            }
            if (ext3_flags_value & ROHC_RTP_EXT3_I_MASK) {
                proto_tree_add_item(ext_tree, hf_rohc_comp_ip_id, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset += 2;
            }
            if (ext3_inner_ip_flags_value & ROHC_RTP_EXT3_INNER_IP2_MASK) {
                /* Outer IP header fields
                 *
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * |      Type of Service/Traffic Class            |  if TOS2 = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * |         Time to Live/Hop Limit                |  if TTL2 = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * |         Protocol/Next Header                  |  if PR2 = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * /         IP extension header(s)                /  variable,
                 *  ..... ..... ..... ..... ..... ..... ..... .....    if IPX2 = 1
                 * |                  IP-ID                        |  2 octets,
                 *  ..... ..... ..... ..... ..... ..... ..... .....    if I2 = 1
                 */
                if (ext3_outer_ip_flags_value & ROHC_RTP_EXT3_OUTER_TOS_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_rtp_tos, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                }
                if (ext3_outer_ip_flags_value & ROHC_RTP_EXT3_OUTER_TTL_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_rtp_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                }
                if (ext3_outer_ip_flags_value & ROHC_RTP_EXT3_OUTER_PR_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_ip_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                }
                if (ext3_outer_ip_flags_value & ROHC_RTP_EXT3_OUTER_IPX_MASK) {
                    offset = dissect_compressed_list(0, pinfo, ext_tree, tvb, offset);
                }
                if (ext3_outer_ip_flags_value & ROHC_RTP_EXT3_OUTER_I2_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_comp_ip_id, tvb, offset, 2, ENC_BIG_ENDIAN);
                    offset += 2;
                }
            }
            if ((rohc_cid_context->profile == ROHC_PROFILE_RTP) &&
                (ext3_flags_value & ROHC_RTP_EXT3_RTP_MASK)) {

                uint64_t ext3_rtp_flags_value = 0;
                static int * const rtp_flags[] = {
                    &hf_rohc_ext3_rtp_mode,
                    &hf_rohc_ext3_r_pt,
                    &hf_rohc_ext3_m,
                    &hf_rohc_ext3_r_x,
                    &hf_rohc_ext3_csrc,
                    &hf_rohc_ext3_tss,
                    &hf_rohc_ext3_tis,
                    NULL
                };
                /* RTP header flags and fields
                 *
                 *    0     1     2     3     4     5     6     7
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * |   Mode    |R-PT |  M  | R-X |CSRC | TSS | TIS |  if rtp = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * | R-P |             RTP PT                      |  if R-PT = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * /           Compressed CSRC list                /  if CSRC = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 * /                  TS_STRIDE                    /  1-4 oct if TSS = 1
                 *  ..... ..... ..... ..... ..... ..... ..... ....
                 * /           TIME_STRIDE (milliseconds)          /  1-4 oct if TIS = 1
                 *  ..... ..... ..... ..... ..... ..... ..... .....
                 */
                proto_tree_add_bitmask_ret_uint64(ext_tree, tvb, offset, hf_rohc_ext3_rtp_flags, ett_rohc_ext3_rtp_flags, rtp_flags, ENC_BIG_ENDIAN, &ext3_rtp_flags_value);
                rohc_cid_context->mode = (enum rohc_mode)((ext3_rtp_flags_value & ROHC_RTP_EXT3_RTP_MODE_MASK)>>6);
                offset++;

                if (ext3_rtp_flags_value & ROHC_RTP_EXT3_R_PT_MASK) {
                    proto_tree_add_item(ext_tree, hf_rohc_ext3_r_p, tvb, offset, 1, ENC_BIG_ENDIAN);
                    proto_tree_add_item(ext_tree, hf_rohc_rtp_pt, tvb, offset, 1, ENC_BIG_ENDIAN);
                    offset++;
                }
                if (ext3_rtp_flags_value & ROHC_RTP_EXT3_CSRC_MASK) {
                    offset = dissect_compressed_list(0, pinfo, ext_tree, tvb, offset);
                }
                if (ext3_rtp_flags_value & ROHC_RTP_EXT3_TSS_MASK) {
                    uint8_t val_len = 0;
                    get_self_describing_var_len_val(tvb, ext_tree, offset, hf_rohc_rtp_ts_stride, &val_len);
                    offset += val_len;
                }
                if (ext3_rtp_flags_value & ROHC_RTP_EXT3_TIS_MASK) {
                    uint8_t val_len = 0;
                    get_self_describing_var_len_val(tvb, ext_tree, offset, hf_rohc_rtp_time_stride, &val_len);
                    offset += val_len;
                }
            }
        } else {
            proto_tree_add_expert_format(ext_tree, pinfo, &ei_rohc_not_dissected_yet, tvb, offset, -1,
                                         "extension 3 [Not dissected yet for profile %u]", rohc_cid_context->profile);
            if (tvb_captured_length_remaining(tvb, offset) > 0)
                offset += tvb_captured_length_remaining(tvb, offset);
        }
    }

    proto_item_set_len(ext_ti, offset-start_offset);
    return offset;
}

/* 5.7.2. Packet type 1 (R-mode): R-1, R-1-TS, R-1-ID */
static int
dissect_rohc_pkt_type_1_r_mode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, rohc_cid_context_t *rohc_cid_context)
{
    proto_item *ti;
    proto_tree *pkt_tree;
    uint8_t val_len = 0, x, sn, t = 0xff;
    int start_offset = offset;

    if (rohc_cid_context->large_cid_present == true) {
        /* Handle Large CID:s here */
        get_self_describing_var_len_val(tvb, tree, offset+1, hf_rohc_large_cid, &val_len);
    }

    if ((rohc_cid_context->rohc_ip_version != 4) ||
        (rohc_cid_context->rnd) ||
        (rohc_cid_context->profile == ROHC_PROFILE_UDP)) {
        /*   R-1 (RTP profile)
            *
            *     0   1   2   3   4   5   6   7
            *   +---+---+---+---+---+---+---+---+
            *   | 1   0 |          SN           |
            *   +===+===+===+===+===+===+===+===+
            *   | M | X |          TS           |
            *   +---+---+---+---+---+---+---+---+
            */
        /*   R-1 (UDP profile)
            *
            *     0   1   2   3   4   5   6   7
            *   +---+---+---+---+---+---+---+---+
            *   | 1   0 |          SN           |
            *   +===+===+===+===+===+===+===+===+
            *   | X |           IP-ID           |
            *   +---+---+---+---+---+---+---+---+
            */
        col_append_str(pinfo->cinfo, COL_INFO, "R-1");

        /* Create R-1 subtree */
        pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "R-1 packet");

        /* SN */
        sn = tvb_get_bits8(tvb, (offset<<3)+2, 6);
        proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
        offset += 1 + val_len;

        /* Show SN in info column */
        col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
        if (rohc_cid_context->profile == ROHC_PROFILE_UDP) {
            /* UDP Profile */

            /* X */
            x= tvb_get_bits8(tvb, (offset<<3), 1);
            proto_tree_add_bits_item(pkt_tree, hf_rohc_x, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);

            /* IP-ID */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
        } else {
            /* RTP Profile */

            /* M */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_rtp_m, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);

            /* X */
            x = tvb_get_bits8(tvb, (offset<<3)+1, 1);
            proto_tree_add_bits_item(pkt_tree, hf_rohc_x, tvb, (offset<<3)+1, 1, ENC_BIG_ENDIAN);

            /* TS */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_ts, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
        }
        offset++;
    } else {
        /* Packet type depends upon value of T bit */
        t = tvb_get_bits8(tvb, ((offset+1+val_len)<<3)+2, 1);
        if (t == 0) {
            /*   R-1-ID
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 1   0 |          SN           |
                *   +===+===+===+===+===+===+===+===+
                *   | M | X |T=0|       IP-ID       |
                *   +---+---+---+---+---+---+---+---+
                */
            col_append_str(pinfo->cinfo, COL_INFO, "R-1-ID");
            /* Create R-1-ID subtree */
            pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "R-1-ID packet");
        } else {
            /*   R-1-TS
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 1   0 |          SN           |
                *   +===+===+===+===+===+===+===+===+
                *   | M | X |T=1|        TS         |
                *   +---+---+---+---+---+---+---+---+
                */
            col_append_str(pinfo->cinfo, COL_INFO, "R-1-TS");
            /* Create R-1-TS subtree */
            pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "R-1-TS packet");
        }

        /* SN */
        sn = tvb_get_bits8(tvb, (offset<<3)+2, 6);
        proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
        offset += 1 + val_len;
        /* Show SN in info column */
        col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);

        /* M */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_rtp_m, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);

        /* X */
        x = tvb_get_bits8(tvb, (offset<<3)+1, 1);
        proto_tree_add_bits_item(pkt_tree, hf_rohc_x, tvb, (offset<<3)+1, 1, ENC_BIG_ENDIAN);

        /* T */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_t, tvb, (offset<<3)+2, 1, ENC_BIG_ENDIAN);
        if (t == 0) {
            /* IP-ID */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
        } else {
            /* TS */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_ts, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
        }
        offset++;
    }

    if (x) {
        offset = dissect_rohc_ext_format(tvb, pinfo, pkt_tree, offset, t, rohc_cid_context);
    }
    proto_item_set_len(ti, offset-start_offset);

    return offset;
}

/* 5.7.3. Packet type 1 (U/O-mode): UO-1, UO-1-ID, UO-1-TS */
static int
dissect_rohc_pkt_type_1_u_o_mode(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, rohc_cid_context_t *rohc_cid_context)
{
    proto_item *ti;
    proto_tree *pkt_tree;
    uint8_t val_len = 0, x = 0, sn, t = 0xff;
    int start_offset = offset;

    if (rohc_cid_context->large_cid_present == true) {
        /* Handle Large CID:s here */
        get_self_describing_var_len_val(tvb, tree, offset+1, hf_rohc_large_cid, &val_len);
    }

    if ((rohc_cid_context->rohc_ip_version != 4) ||
        (rohc_cid_context->rnd) ||
        (rohc_cid_context->profile == ROHC_PROFILE_UDP)) {
        /*   UO-1 (RTP profile)
            *
            *     0   1   2   3   4   5   6   7
            *   +---+---+---+---+---+---+---+---+
            *   | 1   0 |          TS           |
            *   +===+===+===+===+===+===+===+===+
            *   | M |      SN       |    CRC    |
            *   +---+---+---+---+---+---+---+---+
            */
        /*   UO-1 (UDP profile)
            *
            *     0   1   2   3   4   5   6   7
            *   +---+---+---+---+---+---+---+---+
            *   | 1   0 |         IP-ID         |
            *   +===+===+===+===+===+===+===+===+
            *   |        SN         |    CRC    |
            *   +---+---+---+---+---+---+---+---+
            */
        col_append_str(pinfo->cinfo, COL_INFO, "UO-1");

        /* Create subtree */
        pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "UO-1 packet");
        if (rohc_cid_context->profile == ROHC_PROFILE_UDP) {
            /* IP-ID */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
            offset += 1 + val_len;

            /* SN */
            sn = tvb_get_bits8(tvb, (offset<<3), 5);
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3), 5, ENC_BIG_ENDIAN);
        } else {
            /* RTP Profile */

            /* TS */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_ts, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
            offset += 1 + val_len;

            /* M */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_rtp_m, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);

            /* SN */
            sn = tvb_get_bits8(tvb, (offset<<3)+1, 4);
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+1, 4, ENC_BIG_ENDIAN);
        }
        /* Show SN in info column */
        col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);

        /* CRC (common to both) */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_crc, tvb, (offset<<3)+5, 3, ENC_BIG_ENDIAN);
        offset++;
    } else {
        /* Type depends upon t bit */
        t = tvb_get_bits8(tvb, ((offset)<<3)+2, 1);
        if (t == 0) {
            /*   UO-1-ID
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 1   0 |T=0|       IP-ID       |
                *   +===+===+===+===+===+===+===+===+
                *   | X |      SN       |    CRC    |
                *   +---+---+---+---+---+---+---+---+
                */
            col_append_str(pinfo->cinfo, COL_INFO, "UO-1-ID");

            /* UO-1-ID subtree */
            pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "UO-1-ID packet");

            /* T */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_t, tvb, (offset<<3)+2, 1, ENC_BIG_ENDIAN);

            /* IP-ID */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
            offset += 1 + val_len;

            /* X */
            x = tvb_get_bits8(tvb, (offset<<3), 1);
            proto_tree_add_bits_item(pkt_tree, hf_rohc_x, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);
        } else {
            /*   UO-1-TS
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 1   0 |T=1|        TS         |
                *   +===+===+===+===+===+===+===+===+
                *   | M |      SN       |    CRC    |
                *   +---+---+---+---+---+---+---+---+
                */
            col_append_str(pinfo->cinfo, COL_INFO, "UO-1-TS");

            /* UO-1-TS subtree */
            pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "UO-1-TS packet");

            /* T */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_t, tvb, (offset<<3)+2, 1, ENC_BIG_ENDIAN);

            /* TS */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_ts, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
            offset += 1 + val_len;

            /* M */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_rtp_m, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);
        }

        /* SN */
        sn = tvb_get_bits8(tvb, (offset<<3)+1, 4);
        proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+1, 4, ENC_BIG_ENDIAN);
        /* Show SN in info column */
        col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);

        /* CRC */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_crc, tvb, (offset<<3)+5, 3, ENC_BIG_ENDIAN);
        offset++;
    }
    if (x) {
        offset = dissect_rohc_ext_format(tvb, pinfo, pkt_tree, offset, t, rohc_cid_context);
    }
    proto_item_set_len(ti, offset-start_offset);

    return offset;
}

/* 5.7.4. Packet type 2: UOR-2 */
static int
dissect_rohc_pkt_type_2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset, rohc_cid_context_t *rohc_cid_context)
{
    proto_item *ti;
    proto_tree *pkt_tree;
    uint8_t val_len = 0, x, sn, t = 0xff;
    int start_offset = offset;

    if (rohc_cid_context->large_cid_present == true) {
        /* Handle Large CID:s here */
        get_self_describing_var_len_val(tvb, tree, offset+1, hf_rohc_large_cid, &val_len);
    }

    if ((rohc_cid_context->rohc_ip_version != 4) ||
        (rohc_cid_context->rnd) ||
        (rohc_cid_context->profile == ROHC_PROFILE_UDP)) {
        /*   UOR-2 (RTP profile)
            *
            *     0   1   2   3   4   5   6   7
            *   +---+---+---+---+---+---+---+---+
            *   | 1   1   0 |        TS         |
            *   +===+===+===+===+===+===+===+===+
            *   |TS | M |          SN           |
            *   +---+---+---+---+---+---+---+---+
            *   | X |            CRC            |
            *   +---+---+---+---+---+---+---+---+
            */
        /*   UOR-2 (UDP profile)
            *
            *     0   1   2   3   4   5   6   7
            *   +---+---+---+---+---+---+---+---+
            *   | 1   1   0 |        SN         |
            *   +===+===+===+===+===+===+===+===+
            *   | X |            CRC            |
            *   +---+---+---+---+---+---+---+---+
            */
        col_append_str(pinfo->cinfo, COL_INFO, "UOR-2");

        /* UOR-2 subtree */
        pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "UOR-2 packet");
        if (rohc_cid_context->profile == ROHC_PROFILE_UDP) {
            /* UDP profile */

            /* SN */
            sn = tvb_get_bits8(tvb, (offset<<3)+3, 5);
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
            offset += 1 + val_len;
            /* Show SN in info column */
            col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
        } else {
            /* RTP profile */

            /* TS */
            crumb_spec_t rohc_ts_crumbs[] = {
                { 2, 6},
                { 8, 1},
                { 0, 0}
            };
            rohc_ts_crumbs[1].crumb_bit_offset += val_len*8;

            proto_tree_add_split_bits_item_ret_val(pkt_tree, hf_rohc_ts, tvb, (offset<<3),
                                                   rohc_ts_crumbs, NULL);
            offset += 1 + val_len;

            /* M */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_rtp_m, tvb, (offset<<3)+1, 1, ENC_BIG_ENDIAN);
            sn = tvb_get_bits8(tvb, (offset<<3)+2, 6);

            /* SN */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
            offset++;
            /* Show SN in info column */
            col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
        }

        /* X - common to both */
        x = tvb_get_bits8(tvb, (offset<<3), 1);
        proto_tree_add_bits_item(pkt_tree, hf_rohc_x, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);

        /* CRC - common to both */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_crc, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
        offset++;
    } else {
        /* Packet type depends upon T bit */
        t = tvb_get_bits8(tvb, ((offset+1+val_len)<<3), 1);
        if (t == 0) {
            /*   UOR-2-ID
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 1   1   0 |       IP-ID       |
                *   +===+===+===+===+===+===+===+===+
                *   |T=0| M |          SN           |
                *   +---+---+---+---+---+---+---+---+
                *   | X |            CRC            |
                *   +---+---+---+---+---+---+---+---+
                */
            col_append_str(pinfo->cinfo, COL_INFO, "UOR-2-ID");

            /* UOR-2-ID subtree */
            pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "UOR-2-ID packet");

            /* IP-ID */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_ip_id, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
        } else {
            /*   UOR-2-TS
                *
                *     0   1   2   3   4   5   6   7
                *   +---+---+---+---+---+---+---+---+
                *   | 1   1   0 |        TS         |
                *   +===+===+===+===+===+===+===+===+
                *   |T=1| M |          SN           |
                *   +---+---+---+---+---+---+---+---+
                *   | X |            CRC            |
                *   +---+---+---+---+---+---+---+---+
                */
            col_append_str(pinfo->cinfo, COL_INFO, "UOR-2-TS");

            /* UOR-2-TS subtree */
            pkt_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rohc_packet, &ti, "UOR-2-TS packet");

            /* TS */
            proto_tree_add_bits_item(pkt_tree, hf_rohc_ts, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
        }
        offset += 1 + val_len;

        /* T - commonto  both */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_t, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);

        /* M - common to both */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_rtp_m, tvb, (offset<<3)+1, 1, ENC_BIG_ENDIAN);

        /* SN - common to both */
        sn = tvb_get_bits8(tvb, (offset<<3)+2, 6);
        proto_tree_add_bits_item(pkt_tree, hf_rohc_comp_sn, tvb, (offset<<3)+2, 6, ENC_BIG_ENDIAN);
        offset++;
        /* Show SN in info column */
        col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);

        /* X - common to both */
        x = tvb_get_bits8(tvb, (offset<<3), 1);
        proto_tree_add_bits_item(pkt_tree, hf_rohc_x, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);

        /* CRC - common to both */
        proto_tree_add_bits_item(pkt_tree, hf_rohc_crc, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
        offset++;
    }
    if (x) {
        offset = dissect_rohc_ext_format(tvb, pinfo, pkt_tree, offset, t, rohc_cid_context);
    }
    proto_item_set_len(ti, offset-start_offset);

    return offset;
}

static void
dissect_rohc_feedback_data(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo, int offset, int16_t feedback_data_len,
                           rohc_info *p_rohc_info, uint16_t cid, bool cid_context)
{
    proto_item         *ti;
    proto_tree         *rohc_feedback_tree;
    uint8_t             opt, opt_len, oct;
    rohc_cid_context_t *rohc_cid_context = NULL;
    int                 key = cid;
    uint32_t            sn;

    /* Look up context using cid */
    if (!PINFO_FD_VISITED(pinfo)) {
        rohc_cid_context = (rohc_cid_context_t*)g_hash_table_lookup(rohc_cid_hash, GUINT_TO_POINTER(key));
        if (rohc_cid_context) {
            p_add_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0, rohc_cid_context);
        }
    } else{
        rohc_cid_context = (rohc_cid_context_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0);
    }

    if (!rohc_cid_context) {
        if (cid_context) {
            /* Reuse info coming from private data */
            rohc_cid_context = wmem_new(pinfo->pool, rohc_cid_context_t);
            /*rohc_cid_context->d_mode;*/
            rohc_cid_context->rnd = p_rohc_info->rnd;
            rohc_cid_context->udp_checksum_present = p_rohc_info->udp_checksum_present;
            rohc_cid_context->profile = p_rohc_info->profile;
            rohc_cid_context->mode = p_rohc_info->mode;
            rohc_cid_context->rohc_ip_version = p_rohc_info->rohc_ip_version;
            rohc_cid_context->large_cid_present = p_rohc_info->large_cid_present;
            rohc_cid_context->prev_ir_frame_number = -1;
            rohc_cid_context->ir_frame_number = -1;
        } else {
            /* No context info, not much we can do */
            proto_item_append_text(p_rohc_info->last_created_item, " (type %d)", (feedback_data_len==1) ? 1 : 2);
            proto_tree_add_expert_format(tree, pinfo, &ei_rohc_profile_not_supported, tvb, offset, feedback_data_len, "profile-specific information [Profile not known]");
            return;
        }
    }

    if (feedback_data_len==1) {
        /* FEEDBACK-1 */
        proto_item_append_text(p_rohc_info->last_created_item, " (type 1)");
        oct = tvb_get_uint8(tvb, offset);
        switch (rohc_cid_context->profile) {
            case ROHC_PROFILE_UNCOMPRESSED: /* 0 */
                ti = proto_tree_add_item(tree, hf_rohc_profile_spec_octet, tvb, offset, 1, ENC_BIG_ENDIAN);
                if (oct) {
                    expert_add_info_format(pinfo, ti, &ei_rohc_profile_spec_octet, "Invalid profile-specific octet value (0x%02X)", oct);
                }
                break;
            case ROHC_PROFILE_RTP: /* 1 */
            case ROHC_PROFILE_UDP: /* 2 */
                /*
                 *     0   1   2   3   4   5   6   7
                 *   +---+---+---+---+---+---+---+---+
                 *   |              SN               |
                 *   +---+---+---+---+---+---+---+---+
                 *
                 */

                /* SN */
                proto_tree_add_item(tree, hf_rohc_fb1_sn, tvb, offset, 1, ENC_BIG_ENDIAN);
                col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", oct);
                break;
            default:
                proto_tree_add_expert(tree, pinfo, &ei_rohc_profile_specific, tvb, offset, feedback_data_len);
                break;
        }
        return;
    }
    /*  FEEDBACK-2 */
    proto_item_append_text(p_rohc_info->last_created_item, " (type 2)");
    switch (rohc_cid_context->profile) {
        case ROHC_PROFILE_UNCOMPRESSED: /* 0 */
            expert_add_info(pinfo, p_rohc_info->last_created_item, &ei_rohc_feedback_type_2_is_not_applicable_for_uncompressed_profile);
            break;
        case ROHC_PROFILE_RTP: /* 1 */
        case ROHC_PROFILE_UDP: /* 2 */
            /*      0   1   2   3   4   5   6   7
             *    +---+---+---+---+---+---+---+---+
             *   |Acktype| Mode  |      SN       |
             *   +---+---+---+---+---+---+---+---+
             *   |              SN               |
             *   +---+---+---+---+---+---+---+---+
             *   /       Feedback options        /
             *   +---+---+---+---+---+---+---+---+
             */

            /* Subtree */
            rohc_feedback_tree = proto_tree_add_subtree_format(tree, tvb, offset, feedback_data_len, ett_rohc_feedback, NULL,
                                     "%s profile-specific information",
                                     (rohc_cid_context->profile == ROHC_PROFILE_RTP) ? "RTP" : "UDP");
            /* Set mode at first pass? Do we need a new context for the following frames?
             *
             */

            /* Acktype */
            proto_tree_add_item(rohc_feedback_tree, hf_rohc_acktype, tvb, offset, 1, ENC_BIG_ENDIAN);
            /* Mode */
            rohc_cid_context->mode = (enum rohc_mode)((tvb_get_uint8(tvb,offset) & 0x30)>>4);
            proto_tree_add_item(rohc_feedback_tree, hf_rohc_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
            /* SN */
            sn = tvb_get_ntohs(tvb, offset) & 0x0fff;
            proto_tree_add_item(rohc_feedback_tree, hf_rohc_sn, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset+=2;
            feedback_data_len-=2;

            /*     0   1   2   3   4   5   6   7
             *   +---+---+---+---+---+---+---+---+
             *   |   Opt Type    |    Opt Len    |
             *   +---+---+---+---+---+---+---+---+
             *   /          option data          /  Opt Len octets
             *   +---+---+---+---+---+---+---+---+
             */
            while (feedback_data_len>0) {
                opt = opt_len = tvb_get_uint8(tvb,offset);
                opt = opt >> 4;
                opt_len = opt_len &0x0f;
                /* Opt Type */
                ti = proto_tree_add_item(rohc_feedback_tree, hf_rohc_opt_type, tvb, offset, 1, ENC_BIG_ENDIAN);
                /* Opt Len */
                proto_tree_add_item(rohc_feedback_tree, hf_rohc_opt_len, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                feedback_data_len--;

                /* optional data */
                switch (opt) {
                    case 1:
                        /* CRC */
                        proto_tree_add_item(rohc_feedback_tree, hf_rohc_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
                        oct = tvb_get_uint8(tvb, offset);
                        col_append_fstr(pinfo->cinfo, COL_INFO, "CRC=%u ", oct);
                        break;
                    case 2:
                        /* REJECT */
                        col_append_str(pinfo->cinfo, COL_INFO, "Reject ");
                        break;
                    case 3:
                        /* SN-Not-Valid */
                        col_append_str(pinfo->cinfo, COL_INFO, "SN-Not-Valid ");
                        break;
                    case 4:
                        /* SN */
                        proto_tree_add_item(rohc_feedback_tree, hf_rohc_opt_sn, tvb, offset, 1, ENC_BIG_ENDIAN);
                        sn = (sn << 8) | tvb_get_uint8(tvb, offset);
                        ti = proto_tree_add_uint(rohc_feedback_tree, hf_rohc_ext_sn, tvb, 0, 0, sn);
                        proto_item_set_generated(ti);
                        break;
                    case 5:
                        /* Clock */
                        if (rohc_cid_context->profile == ROHC_PROFILE_RTP) {
                            proto_tree_add_item(rohc_feedback_tree, hf_rohc_opt_clock, tvb, offset, 1, ENC_BIG_ENDIAN);
                            oct = tvb_get_uint8(tvb, offset);
                            col_append_fstr(pinfo->cinfo, COL_INFO, "Clock=%u ", oct);
                        } else {
                            expert_add_info(pinfo, ti, &ei_rohc_rohc_opt_clock);
                        }
                        break;
                    case 6:
                        /* Jitter */
                        if (rohc_cid_context->profile == ROHC_PROFILE_RTP) {
                            proto_tree_add_item(rohc_feedback_tree, hf_rohc_opt_jitter, tvb, offset, 1, ENC_BIG_ENDIAN);
                            oct = tvb_get_uint8(tvb, offset);
                            col_append_fstr(pinfo->cinfo, COL_INFO, "Jitter=%u ", oct);
                        } else {
                            expert_add_info(pinfo, ti, &ei_rohc_opt_jitter);
                        }
                        break;
                    case 7:
                        /* Loss */
                        proto_tree_add_item(rohc_feedback_tree, hf_rohc_opt_loss, tvb, offset, 1, ENC_BIG_ENDIAN);
                        oct = tvb_get_uint8(tvb, offset);
                        col_append_fstr(pinfo->cinfo, COL_INFO, "Loss=%u ", oct);
                        break;

                    default:
                        proto_tree_add_item(rohc_feedback_tree, hf_rohc_unknown_option_data, tvb, offset, opt_len, ENC_NA);
                        break;
                }
                feedback_data_len = feedback_data_len - opt_len;
                offset = offset + opt_len;

            }
            col_append_fstr(pinfo->cinfo, COL_INFO, " (sn=%u)", sn);
            break;

        default:
            rohc_feedback_tree = proto_tree_add_subtree(tree, tvb, offset, feedback_data_len,
                        ett_rohc_feedback, NULL, "profile-specific information[Not dissected yet]");
            proto_tree_add_item(rohc_feedback_tree, hf_rohc_acktype, tvb, offset, 1, ENC_BIG_ENDIAN);
            break;
    }
}


static const true_false_string rohc_cmp_lst_mask_size_vals = { "15-bit mask", "7-bit mask" };


/* 5.8.6.  Compressed list formats */
static int
dissect_compressed_list(int expected_encoding_type _U_, packet_info *pinfo _U_,
                        proto_tree *tree, tvbuff_t *tvb, int offset)
{
    proto_item *list_ti /* , *et_ti */;
    proto_item *list_tree;
    uint8_t     first_byte = tvb_get_uint8(tvb, offset);
    uint8_t     ET, GP , PS, CC , bit_mask_size;
    int         start_offset = offset;

    /* Compressed list root */
    list_ti = proto_tree_add_item(tree, hf_rohc_compressed_list, tvb, offset, -1, ENC_NA);
    list_tree = proto_item_add_subtree(list_ti, ett_rohc_compressed_list);

    /* Fixed fields from first byte */
    ET = (first_byte & 0xc0) >> 6;
    /* et_ti = proto_tree_add_item(list_tree, hf_rohc_compressed_list_et, tvb, offset, 1, ENC_BIG_ENDIAN); */
    proto_tree_add_item(list_tree, hf_rohc_compressed_list_et, tvb, offset, 1, ENC_BIG_ENDIAN);
    proto_item_append_text(list_ti, " (type=%d - %s)",
                           ET, val_to_str_const(ET, compressed_list_encoding_type_vals, "Unknown"));
#if 0
    if (ET != expected_encoding_type) {
        expert_add_info_format(pinfo, et_ti, PI_MALFORMED, PI_ERROR,
                               "Wrong compressed list encoding type (expected %d, got %d)",
                               expected_encoding_type, ET);
        return offset+1;
    }
#endif
    GP = (first_byte & 0x20) >> 5;
    proto_tree_add_item(list_tree, hf_rohc_compressed_list_gp, tvb, offset, 1, ENC_BIG_ENDIAN);

    switch (ET) {
        case 0:
            /* 5.8.6.1 Encoding Type 0 (generic scheme)
             *
             *    0   1   2   3   4   5   6   7
             *  +---+---+---+---+---+---+---+---+
             *  | ET=0  |GP |PS |    CC = m     |
             *  +---+---+---+---+---+---+---+---+
             *  :            gen_id             :  1 octet, if GP = 1
             *  +---+---+---+---+---+---+---+---+
             *  |        XI 1, ..., XI m        |  m octets, or m * 4 bits
             *  /                --- --- --- ---/
             *  |               :    Padding    :  if PS = 0 and m is odd
             *  +---+---+---+---+---+---+---+---+
             *  |                               |
             *  /       item 1, ..., item n     /  variable
             *  |                               |
             *  +---+---+---+---+---+---+---+---+
             *
             */
            /* PS = (first_byte & 0x10) >> 4;
             *       PS: Indicates size of XI fields:
             *       PS = 0 indicates 4-bit XI fields;
             *       PS = 1 indicates 8-bit XI fields.
             */
            PS = (first_byte & 0x10) >> 4;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_ps, tvb, offset, 1, ENC_BIG_ENDIAN);

            /* CC: CSRC counter from original RTP header. */
            CC = first_byte & 0x0f;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_cc, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;

            /* GP: Indicates presence of gen_id field. */
            if (GP) {
                proto_tree_add_item(list_tree, hf_rohc_compressed_list_gen_id, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
            }
            if (CC!=0) {
                /* TODO: calculate how many bytes to skip for items */
                /*
                 *       XI 1, ..., XI m: m XI items.  The format of an XI item is as
                 *            follows:
                 *
                 *                 +---+---+---+---+
                 *        PS = 0:  | X |   Index   |
                 *                 +---+---+---+---+
                 *
                 *                    0   1   2   3   4   5   6   7
                 *                  +---+---+---+---+---+---+---+---+
                 *         PS = 1:  | X |           Index           |
                 *                  +---+---+---+---+---+---+---+---+
                 *
                 *         X = 1 indicates that the item corresponding to the Index
                 *               is sent in the item 0, ..., item n list.
                 *         X = 0 indicates that the item corresponding to the Index is
                 *               not sent.
                 */
                if (PS) {
                    /* PS = 1 indicates 8-bit XI fields. */
                } else {
                    /* PS = 0 indicates 4-bit XI fields; */
                }
            }

            break;

        case 1:
            /*
             * 5.8.6.2.  Encoding Type 1 (insertion only scheme)
             *
             *      0   1   2   3   4   5   6   7
             *    +---+---+---+---+---+---+---+---+
             *    | ET=1  |GP |PS |     XI 1      |
             *    +---+---+---+---+---+---+---+---+
             *    :            gen_id             :  1 octet, if GP = 1
             *    +---+---+---+---+---+---+---+---+
             *    |            ref_id             |
             *    +---+---+---+---+---+---+---+---+
             *    /      insertion bit mask       /  1-2 octets
             *    +---+---+---+---+---+---+---+---+
             *    |            XI list            |  k octets, or (k - 1) * 4 bits
             *    /                --- --- --- ---/
             *    |               :    Padding    :  if PS = 0 and k is even
             *    +---+---+---+---+---+---+---+---+
             *    |                               |
             *    /       item 1, ..., item n     /  variable
             *    |                               |
             *    +---+---+---+---+---+---+---+---+
             *
             */
            PS = (first_byte & 0x10) >> 4;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
            /*      XI 1: When PS = 0, the first 4-bit XI item is placed here.
             *            When PS = 1, the field is set to zero when sending, and
             *            ignored when receiving.
             */
            if (PS==0) {
                proto_tree_add_item(list_tree, hf_rohc_compressed_list_xi_1, tvb, offset, 1, ENC_BIG_ENDIAN);
            }
            offset++;
            /* GP: Indicates presence of gen_id field. */
            if (GP) {
                proto_tree_add_item(list_tree, hf_rohc_compressed_list_gen_id, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
            }
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_ref_id, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            /*
             *      insertion bit mask: Bit mask indicating the positions where new
             *                items are to be inserted.  See Insertion Only scheme in
             *                section 5.8.3.  The bit mask can have either of the
             *                following two formats:
             *
             *
             *           0   1   2   3   4   5   6   7
             *         +---+---+---+---+---+---+---+---+
             *         | 0 |        7-bit mask         |  bit 1 is the first bit
             *         +---+---+---+---+---+---+---+---+
             *
             *         +---+---+---+---+---+---+---+---+
             *         | 1 |                           |  bit 1 is the first bit
             *         +---+      15-bit mask          +
             *         |                               |  bit 7 is the last bit
             *         +---+---+---+---+---+---+---+---+
             */
            bit_mask_size = (tvb_get_uint8(tvb,offset)&0x80)>>7;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_mask_size, tvb, offset, 1, ENC_BIG_ENDIAN);
            if (bit_mask_size) {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_ins_bit_mask, tvb, (offset<<3)+1, 15, ENC_BIG_ENDIAN);
                offset+=2;
            } else {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_ins_bit_mask, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
                offset++;
            }

            /*
             *      XI list: XI fields for items to be inserted.  When the insertion
             *         bit mask has k ones, the total number of XI fields is k.  When
             *         PS = 1, all XI fields are in the XI list.  When PS = 0, the
             *         first XI field is in the XI 1 field, and the remaining k - 1
             *         XI fields are in the XI list.
             *
             *      Padding: Present when PS = 0 and k is even.
             */
            /* TODO: */
            break;
        case 2:
            /*
             *  5.8.6.3.  Encoding Type 2 (removal only scheme)
             *
             *          0   1   2   3   4   5   6   7
             *        +---+---+---+---+---+---+---+---+
             *        | ET=2  |GP |res|     Count     |
             *        +---+---+---+---+---+---+---+---+
             *        :            gen_id             :  1 octet, if GP = 1
             *        +---+---+---+---+---+---+---+---+
             *        |            ref_id             |
             *        +---+---+---+---+---+---+---+---+
             *        /       removal bit mask        /  1-2 octets
             *        +---+---+---+---+---+---+---+---+
             *
             */
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_res, tvb, offset, 1, ENC_BIG_ENDIAN);
            /* Count: Number of elements in ref_list. */
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_count, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
            /* GP: Indicates presence of gen_id field. */
            if (GP) {
                proto_tree_add_item(list_tree, hf_rohc_compressed_list_gen_id, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
            }
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_ref_id, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;
             /*
              *  removal bit mask: Indicates the elements in ref_list to be
              *  removed in order to obtain the current list.  See section
              *  5.8.3.  The removal bit mask has the same format as the
              *  insertion bit mask of section 5.8.6.3.
              */

            bit_mask_size = (tvb_get_uint8(tvb,offset)&0x80)>>7;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_mask_size, tvb, offset, 1, ENC_BIG_ENDIAN);
            if (bit_mask_size) {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_rem_bit_mask, tvb, (offset<<3)+1, 15, ENC_BIG_ENDIAN);
                offset+=2;
            } else {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_rem_bit_mask, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
                offset++;
            }
            break;
        case 3:
            /*
             * 5.8.6.4.  Encoding Type 3 (remove then insert scheme)
             *
             *        See section 5.8.3 for a description of the Remove then insert
             *        scheme.
             *
             *          0   1   2   3   4   5   6   7
             *        +---+---+---+---+---+---+---+---+
             *        | ET=3  |GP |PS |     XI 1      |
             *        +---+---+---+---+---+---+---+---+
             *        :            gen_id             :  1 octet, if GP = 1
             *        +---+---+---+---+---+---+---+---+
             *        |            ref_id             |
             *        +---+---+---+---+---+---+---+---+
             *        /       removal bit mask        /  1-2 octets
             *        +---+---+---+---+---+---+---+---+
             *        /      insertion bit mask       /  1-2 octets
             *        +---+---+---+---+---+---+---+---+
             *        |            XI list            |  k octets, or (k - 1) * 4 bits
             *        /                --- --- --- ---/
             *        |               :    Padding    :  if PS = 0 and k is even
             *        +---+---+---+---+---+---+---+---+
             *        |                               |
             *        /       item 1, ..., item n     /  variable
             *        |                               |
             *        +---+---+---+---+---+---+---+---+
             *
             */
            PS = (first_byte & 0x10) >> 4;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_ps, tvb, offset, 1, ENC_BIG_ENDIAN);
            /*      XI 1: When PS = 0, the first 4-bit XI item is placed here.
             *            When PS = 1, the field is set to zero when sending, and
             *            ignored when receiving.
             */
            if (PS==0) {
                proto_tree_add_item(list_tree, hf_rohc_compressed_list_xi_1, tvb, offset, 1, ENC_BIG_ENDIAN);
            }
            offset++;
            /* GP: Indicates presence of gen_id field. */
            if (GP) {
                proto_tree_add_item(list_tree, hf_rohc_compressed_list_gen_id, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
            }
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_ref_id, tvb, offset, 1, ENC_BIG_ENDIAN);
            offset++;

             /*
              *  removal bit mask: Indicates the elements in ref_list to be
              *  removed in order to obtain the current list.  See section
              *  5.8.3.  The removal bit mask has the same format as the
              *  insertion bit mask of section 5.8.6.3.
              */

            bit_mask_size = (tvb_get_uint8(tvb,offset)&0x80)>>7;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_mask_size, tvb, offset, 1, ENC_BIG_ENDIAN);
            if (bit_mask_size) {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_rem_bit_mask, tvb, (offset<<3)+1, 15, ENC_BIG_ENDIAN);
                offset+=2;
            } else {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_rem_bit_mask, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
                offset++;
            }

            /*
             *      insertion bit mask: Bit mask indicating the positions where new
             *                items are to be inserted.  See Insertion Only scheme in
             *                section 5.8.3.  The bit mask can have either of the
             *                following two formats:
             *
             *
             *           0   1   2   3   4   5   6   7
             *         +---+---+---+---+---+---+---+---+
             *         | 0 |        7-bit mask         |  bit 1 is the first bit
             *         +---+---+---+---+---+---+---+---+
             *
             *         +---+---+---+---+---+---+---+---+
             *         | 1 |                           |  bit 1 is the first bit
             *         +---+      15-bit mask          +
             *         |                               |  bit 7 is the last bit
             *         +---+---+---+---+---+---+---+---+
             */
            bit_mask_size = (tvb_get_uint8(tvb,offset)&0x80)>>7;
            proto_tree_add_item(list_tree, hf_rohc_compressed_list_mask_size, tvb, offset, 1, ENC_BIG_ENDIAN);
            if (bit_mask_size) {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_ins_bit_mask, tvb, (offset<<3)+1, 15, ENC_BIG_ENDIAN);
                offset+=2;
            } else {
                proto_tree_add_bits_item(list_tree, hf_rohc_compressed_list_ins_bit_mask, tvb, (offset<<3)+1, 7, ENC_BIG_ENDIAN);
                offset++;
            }
            /* TODO: */
            offset++;
            break;
    }

    proto_item_set_len(list_ti, offset-start_offset);

    return offset;
}

static int
dissect_rohc_ir_profile_dynamic(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
                                int offset, uint8_t profile, rohc_cid_context_t *rohc_cid_context)
{
    proto_item *item, *root_ti;
    proto_tree *sub_tree = NULL, *dynamic_ipv4_tree, *dynamic_udp_tree, *dynamic_rtp_tree;
    uint8_t     oct, rx, /* cc, */ val_len = 0;
    int         start_offset, tree_start_offset;
    uint8_t     tos, ttl, nbo;
    uint16_t    id;
    /*uint8_t    contributing_csrcs;*/
    uint16_t    sequence_number;
    uint32_t    timestamp;
#if 0
    uint8_t     tis = 0, tss=0;
    uint64_t    ts_stride = 0;
#endif
    start_offset = offset;

    /* Create subtree according to profile */
    switch (profile) {
        case ROHC_PROFILE_UNCOMPRESSED:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_dynamic, &item, "Profile 0x0000 Uncompressed");
            break;

        case ROHC_PROFILE_RTP:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_dynamic, &item, "Profile 0x0001 RTP Dynamic Chain");
            break;

        case ROHC_PROFILE_UDP:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_dynamic, &item, "Profile 0x0002 UDP Dynamic Chain");
            break;

        case ROHC_PROFILE_IP:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_dynamic, &item, "Profile 0x0004 IP Dynamic Chain");
            break;

        default:
            proto_tree_add_expert(tree, pinfo, &ei_rohc_profile_not_supported, tvb, offset, 0);
            return -1;
    }

    /* IP dynamic */
    /* for all profiles except uncompressed */
    if (profile != ROHC_PROFILE_UNCOMPRESSED) {
        switch (rohc_cid_context->rohc_ip_version) {
            case 4:
                /* 5.7.7.4.  Initialization of IPv4 Header [IPv4, section 3.1].
                 * Dynamic part:
                 */
                /* Create dynamic IPv4 subtree */
                tree_start_offset = offset;
                root_ti = proto_tree_add_item(sub_tree, hf_rohc_dynamic_ipv4, tvb, offset, -1, ENC_NA);
                dynamic_ipv4_tree = proto_item_add_subtree(root_ti, ett_rohc_dynamic_ipv4);

                /* Type of Service */
                tos = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(dynamic_ipv4_tree, hf_rohc_rtp_tos, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                /* Time to Live */
                ttl = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(dynamic_ipv4_tree, hf_rohc_rtp_ttl, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                /* Identification */
                id = tvb_get_ntohs(tvb, offset);
                proto_tree_add_item(dynamic_ipv4_tree, hf_rohc_rtp_id, tvb, offset, 2, ENC_BIG_ENDIAN);
                offset+=2;
                /*    +---+---+---+---+---+---+---+---+
                 *    | DF|RND|NBO|         0         |
                 *    +---+---+---+---+---+---+---+---+
                 */
                rohc_cid_context->rnd = (tvb_get_uint8(tvb, offset) & 0x40) >> 6;
                nbo = (tvb_get_uint8(tvb, offset) & 0x20) >> 5;
                /* DF */
                proto_tree_add_item(dynamic_ipv4_tree, hf_rohc_rtp_df, tvb, offset, 1, ENC_BIG_ENDIAN);
                /* RND */
                proto_tree_add_item(dynamic_ipv4_tree, hf_rohc_rtp_rnd, tvb, offset, 1, ENC_BIG_ENDIAN);
                /* NBO */
                proto_tree_add_item(dynamic_ipv4_tree, hf_rohc_rtp_nbo, tvb, offset, 1, ENC_BIG_ENDIAN);
                /* Spare */
                proto_tree_add_bits_item(dynamic_ipv4_tree, hf_rohc_spare_bits, tvb, (offset<<3)+3, 5, ENC_BIG_ENDIAN);
                offset++;

                /*   +---+---+---+---+---+---+---+---+
                 *   / Generic extension header list /  variable length
                 *   +---+---+---+---+---+---+---+---+
                 *   Generic extension header list: Encoded according to section
                 *   5.8.6.1, with all header items present in uncompressed form.
                 */
                offset = dissect_compressed_list(0, pinfo, dynamic_ipv4_tree, tvb, offset);

                /* Set proper length for subtree */
                proto_item_set_len(root_ti, offset-tree_start_offset);

                /* Add summary to ipv4 root item */
                proto_item_append_text(root_ti, " (ToS=%u, TTL=%u, ID=%u, RND=%u, NBO=%u)",
                                       tos, ttl, id, rohc_cid_context->rnd, nbo);
                break;
            case 6:

                /* Dynamic part:
                 *    +---+---+---+---+---+---+---+---+
                 *    |         Traffic Class         |   1 octet
                 *    +---+---+---+---+---+---+---+---+
                 *    |           Hop Limit           |   1 octet
                 *    +---+---+---+---+---+---+---+---+
                 *    / Generic extension header list /   variable length
                 *    +---+---+---+---+---+---+---+---+
                 */

                /* Traffic Class */
                proto_tree_add_item(sub_tree, hf_rohc_ipv6_tc, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                /* Hop Limit */
                proto_tree_add_item(sub_tree, hf_rohc_ipv6_hop_limit, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                /* XXX TODO: use the IPv6 dissector to dissect Generic extension header list ?*/
                proto_tree_add_expert(sub_tree, pinfo, &ei_rohc_not_dissected_yet, tvb, offset, -1);
                return -1;
            default:
                break;
        }
    }

    /* UDP dynamic */
    if ( (profile == ROHC_PROFILE_UDP)  ||
         (profile == ROHC_PROFILE_RTP)      ) {
        /* 5.7.7.5.  Initialization of UDP Header
         * Dynamic part:
         *
         *      +---+---+---+---+---+---+---+---+
         *      /           Checksum            /   2 octets
         *      +---+---+---+---+---+---+---+---+
         */
        /* Create dynamic UDP subtree */
        root_ti = proto_tree_add_item(sub_tree, hf_rohc_dynamic_udp, tvb, offset, 2, ENC_NA);
        dynamic_udp_tree = proto_item_add_subtree(root_ti, ett_rohc_dynamic_udp);
        id = tvb_get_ntohs(tvb, offset);
        rohc_cid_context->udp_checksum_present = (id) ? true : false;
        /* Checksum */
        proto_tree_add_checksum(dynamic_udp_tree, tvb, offset, hf_rohc_dynamic_udp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
        offset += 2;
        if (profile == ROHC_PROFILE_UDP) {
            /* IP-ID 5.11.1 */
            proto_tree_add_item(dynamic_udp_tree, hf_rohc_comp_ip_id, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset += 2;
        }
        proto_item_set_len(item, offset - start_offset);
    }

    /* RTP  dynamic*/
    if (profile == ROHC_PROFILE_RTP) {
        /* 5.7.7.6.  Initialization of RTP Header
         * Dynamic part:
         * Checksum
         *      P, X, CC, PT, M, sequence number, timestamp, timestamp stride,
         *      CSRC identifiers.
         *
         *        0   1   2   3   4   5   6   7
         *      +---+---+---+---+---+---+---+---+
         *      |  V=2  | P | RX|      CC       |  (RX is NOT the RTP X bit)
         *      +---+---+---+---+---+---+---+---+
         *      | M |            PT             |
         *      +---+---+---+---+---+---+---+---+
         *      /      RTP Sequence Number      /  2 octets
         *      +---+---+---+---+---+---+---+---+
         *      /   RTP Timestamp (absolute)    /  4 octets
         *      +---+---+---+---+---+---+---+---+
         *      /      Generic CSRC list        /  variable length
         *      +---+---+---+---+---+---+---+---+
         *      : Reserved  | X |  Mode |TIS|TSS:  if RX = 1
         *      +---+---+---+---+---+---+---+---+
         *      :         TS_Stride             :  1-4 octets, if TSS = 1
         *      +---+---+---+---+---+---+---+---+
         *      :         Time_Stride           :  1-4 octets, if TIS = 1
         *      +---+---+---+---+---+---+---+---+
         */

        /* Create dynamic RTP subtree */
        root_ti = proto_tree_add_item(sub_tree, hf_rohc_dynamic_rtp, tvb, offset, -1, ENC_NA);
        dynamic_rtp_tree = proto_item_add_subtree(root_ti, ett_rohc_dynamic_rtp);

        tree_start_offset = offset;
        /* V */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_v, tvb, offset, 1, ENC_BIG_ENDIAN);
        /* P */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_p, tvb, offset, 1, ENC_BIG_ENDIAN);
        /* RX */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_rx, tvb, offset, 1, ENC_BIG_ENDIAN);
        /* CC */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_cc, tvb, offset, 1, ENC_BIG_ENDIAN);
        oct = tvb_get_uint8(tvb,offset);
        /* cc = oct & 0x0f; */
        rx = (oct >> 4)& 0x01;
        offset++;

        /* M */
        proto_tree_add_bits_item(dynamic_rtp_tree, hf_rohc_rtp_m, tvb, (offset<<3), 1, ENC_BIG_ENDIAN);
        /* PT */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_pt, tvb, offset, 1, ENC_BIG_ENDIAN);
        offset++;
        /* RTP Sequence Number */
        sequence_number = tvb_get_ntohs(tvb, offset);
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_sn, tvb, offset, 2, ENC_BIG_ENDIAN);
        offset+=2;
        /* RTP Timestamp (absolute) */
        timestamp = tvb_get_ntohl(tvb, offset);
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_timestamp, tvb, offset, 4, ENC_BIG_ENDIAN);
        offset+=4;
        /* RFC 4815
         * This field is always at least one octet in size, even if the
         *    list is empty (as opposed to the CSRC list in the uncompressed RTP
         *    header, which is not present when the RTP CC field is set to 0).
         * :
         * Generic CSRC list: CSRC list encoded according to section
         * 5.8.6.1, with all CSRC items present.
         * FORMAL ADDITION TO RFC 3095:
         *
         *      "The first octet in the dynamic part of the RTP header contains a
         *       CC field, as defined in Section 5.7.7.6.  A second occurrence
         *       appears in the 'Generic CSRC list', which is also in the dynamic
         *       part of the RTP header, where Encoding Type 0 is used according
         *       to the format defined in RFC 3095-5.8.6.1.
         *
         *       The compressor MUST set both occurrences of the CC field to the
         *       same value.
         *
         *       The decompressor MUST use the value of the CC field from the
         *       Encoding Type 0 within the Generic CRSC list, and it MUST thus
         *       ignore the first occurrence of the CC field."
         */

        offset = dissect_compressed_list(0, pinfo, dynamic_rtp_tree, tvb, offset);
        /* : Reserved  | X |  Mode |TIS|TSS:  if RX = 1 */
        if (rx==0) {
            return offset;
        }
        /* X */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_x, tvb, offset, 1, ENC_BIG_ENDIAN);
        /* Mode */
        rohc_cid_context->mode = (enum rohc_mode)((tvb_get_uint8(tvb,offset) &  0x0c)>>2);
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_mode, tvb, offset, 1, ENC_BIG_ENDIAN);
        /* TIS */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_tis, tvb, offset, 1, ENC_BIG_ENDIAN);
        /* TSS */
        proto_tree_add_item(dynamic_rtp_tree, hf_rohc_rtp_tss, tvb, offset, 1, ENC_BIG_ENDIAN);
        oct = tvb_get_uint8(tvb,offset);
        offset++;

        /* TS_Stride             :  1-4 octets, if TSS = 1 */
        if ((oct&0x01)== 1) {
            /* TS_Stride encoded as
             * 4.5.6.  Self-describing variable-length values
             */
            get_self_describing_var_len_val(tvb, dynamic_rtp_tree, offset, hf_rohc_rtp_ts_stride, &val_len);
            offset = offset + val_len;
        }

        /* Time_Stride           :  1-4 octets, if TIS = 1 */
        if ((oct&0x02)==2) {
            /* Time_Stride encoded as
             * 4.5.6.  Self-describing variable-length values
             */
            get_self_describing_var_len_val(tvb, dynamic_rtp_tree, offset, hf_rohc_rtp_time_stride, &val_len);
            offset = offset + val_len;
        }
        /* Set proper length for subtree */
        proto_item_set_len(root_ti, offset-tree_start_offset);

        /* Add summary to root item */
        proto_item_append_text(root_ti, " (seqnum = %u, timestamp = %u)",
                               sequence_number, timestamp);

        proto_item_set_len(item, offset - start_offset);
    }
    return offset;
}

static int
dissect_rohc_ir_rtp_udp_ip_profile_static(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo _U_, int offset, bool d, uint8_t profile, rohc_cid_context_t *rohc_cid_context)
{
    proto_item *item, *ipv4_item, *udp_item, *rtp_item, *ver_item;
    proto_tree *sub_tree = NULL, *static_ipv4_tree, *static_udp_tree, *static_rtp_tree;
    uint8_t     version, protocol;
    int         start_offset, tree_start_offset;

    start_offset = offset;

    /* Create subtree root according to profile */
    switch (profile) {

        case ROHC_PROFILE_UNCOMPRESSED:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_static, &item, "Profile 0x0000 Uncompressed");
            break;

        case ROHC_PROFILE_RTP:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_static, &item, "Profile 0x0001 RTP Static Chain");
            break;

        case ROHC_PROFILE_UDP:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_static, &item, "Profile 0x0002 UDP Static Chain");
            break;

        case ROHC_PROFILE_IP:
            sub_tree = proto_tree_add_subtree(tree, tvb, offset, 0, ett_rohc_rtp_static, &item, "Profile 0x0004 IP Static Chain");
            break;

        default:
            proto_tree_add_expert(tree, pinfo, &ei_rohc_profile_not_supported, tvb, offset, 0);
            return -1;
    }

    /* IP static*/
    /* for all profiles except uncompressed */
    if (profile != ROHC_PROFILE_UNCOMPRESSED) {
        version = tvb_get_uint8(tvb,offset)>>4;
        if (profile == ROHC_PROFILE_IP) {
            /* RFC 3843 chapter 3.1; alternate encoding can set IP version field MSB to 1 */
            version &= 0x07;
            ver_item = proto_tree_add_item(sub_tree, hf_rohc_ip_version_ip_profile, tvb, offset, 1, ENC_BIG_ENDIAN);
        } else {
            ver_item = proto_tree_add_item(sub_tree, hf_rohc_ip_version, tvb, offset, 1, ENC_BIG_ENDIAN);
        }
        rohc_cid_context->rohc_ip_version = version;

        switch (version) {
            case 4:
            {
                /* 5.7.7.4.  Initialization of IPv4 Header [IPv4, section 3.1].
                 * Static part:
                 */
                uint32_t source, dest;

                offset++;
                tree_start_offset = offset;
                /* Create static IPv4 subtree */
                ipv4_item = proto_tree_add_item(sub_tree, hf_rohc_static_ipv4, tvb, offset, -1, ENC_NA);
                static_ipv4_tree = proto_item_add_subtree(ipv4_item, ett_rohc_static_ipv4);
                /* Protocol */
                protocol = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(static_ipv4_tree, hf_rohc_ip_protocol, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
                /* Source Address */
                source = tvb_get_ipv4(tvb, offset);
                proto_tree_add_item(static_ipv4_tree, hf_rohc_ipv4_src, tvb, offset, 4, ENC_BIG_ENDIAN);
                offset+=4;
                /* Destination Address */
                dest = tvb_get_ipv4(tvb, offset);
                proto_tree_add_item(static_ipv4_tree, hf_rohc_ipv4_dst, tvb, offset, 4, ENC_BIG_ENDIAN);
                offset+=4;
                /* Set proper length for subtree */
                proto_item_set_len(ipv4_item, offset-tree_start_offset);

                /* Add summary to root item */
                proto_item_append_text(ipv4_item, " (prot=%s: %s -> %s)",
                                       val_to_str_ext_const(protocol, &ipproto_val_ext, "Unknown"),
                                       get_hostname(source),
                                       get_hostname(dest));
                break;
            }
            case 6:
                /* 5.7.7.3.  Initialization of IPv6 Header [IPv6]*/
                /*   Static part:
                 *
                 *      +---+---+---+---+---+---+---+---+
                 *      |  Version = 6  |Flow Label(msb)|   1 octet
                 *      +---+---+---+---+---+---+---+---+
                 *      /        Flow Label (lsb)       /   2 octets
                 *      +---+---+---+---+---+---+---+---+
                 *      |          Next Header          |   1 octet
                 *      +---+---+---+---+---+---+---+---+
                 *      /        Source Address         /   16 octets
                 *      +---+---+---+---+---+---+---+---+
                 *      /      Destination Address      /   16 octets
                 *      +---+---+---+---+---+---+---+---+
                 */

                /* Flow Label */
                proto_tree_add_item(sub_tree, hf_rohc_ipv6_flow, tvb, offset, 3, ENC_BIG_ENDIAN);
                offset+=3;

                /* Next Header */
                protocol = tvb_get_uint8(tvb, offset);
                proto_tree_add_item(sub_tree, hf_rohc_ipv6_nxt_hdr, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;

                /* Source Address */
                proto_tree_add_item(sub_tree, hf_rohc_ipv6_src, tvb, offset, 16, ENC_NA);
                offset+=16;

                /*  Destination Address */
                proto_tree_add_item(sub_tree, hf_rohc_ipv6_dst, tvb, offset, 16, ENC_NA);
                offset+=16;
                break;

            default:
                expert_add_info(pinfo, ver_item, &ei_rohc_ip_version);
                return -1;
        }
    } else {
        protocol = 0; /* Something other than UDP (which is checked for below) */
    }

    if (protocol == IP_PROTO_UDP) {
        /* UDP static */
        if ((profile == ROHC_PROFILE_RTP) ||
            (profile == ROHC_PROFILE_UDP)) {
            /* 5.7.7.5.  Initialization of UDP Header [RFC-768].
             * Static part
             */
            uint16_t source_port, dest_port;
            uint32_t ssrc;

            /* Create static UDP subtree */
            tree_start_offset = offset;
            udp_item = proto_tree_add_item(sub_tree, hf_rohc_static_udp, tvb, offset, -1, ENC_NA);
            static_udp_tree = proto_item_add_subtree(udp_item, ett_rohc_static_udp);
            /* Source Port */
            source_port = tvb_get_ntohs(tvb, offset);
            proto_tree_add_item(static_udp_tree, hf_rohc_udp_src_port, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset+=2;
            /* Destination Port */
            dest_port = tvb_get_ntohs(tvb, offset);
            proto_tree_add_item(static_udp_tree, hf_rohc_udp_dst_port, tvb, offset, 2, ENC_BIG_ENDIAN);
            offset+=2;
            /* Set proper length for subtree */
            proto_item_set_len(udp_item, offset-tree_start_offset);
            /* Add summary to root item */
            proto_item_append_text(udp_item, " (%u -> %u)", source_port, dest_port);

            if (profile == ROHC_PROFILE_UDP) {
                proto_item_set_len(item, offset - start_offset);
                if (d) {
                    /* UDP Dynamic */
                    offset = dissect_rohc_ir_profile_dynamic(tvb, pinfo, tree, offset, profile, rohc_cid_context);
                }
                return offset;
            }

            /* RTP static */
            /* 5.7.7.6.  Initialization of RTP Header [RTP]. */
            /* Create static RTP subtree */
            rtp_item = proto_tree_add_item(sub_tree, hf_rohc_static_rtp, tvb, offset, 4, ENC_NA);
            static_rtp_tree = proto_item_add_subtree(rtp_item, ett_rohc_static_rtp);

            /* SSRC */
            ssrc = tvb_get_ntohl(tvb, offset);
            proto_tree_add_item(static_rtp_tree, hf_rohc_rtp_ssrc, tvb, offset, 4, ENC_BIG_ENDIAN);
            offset += 4;

            /* Add summary to root item */
            proto_item_append_text(rtp_item, " (SSRC=0x%08x)", ssrc);

            proto_item_set_len(item, offset - start_offset);

            /* D:   D = 1 indicates that the dynamic chain is present. */
            if (d==true) {
                offset = dissect_rohc_ir_profile_dynamic(tvb, pinfo, tree, offset, profile, rohc_cid_context);
            }
        }
    } else if (profile == ROHC_PROFILE_IP) {
        proto_item_set_len(item, offset - start_offset);
        if (d==true) {
            offset = dissect_rohc_ir_profile_dynamic(tvb, pinfo, tree, offset, profile, rohc_cid_context);
        }
        return offset;
    } else {
        proto_tree_add_expert(sub_tree, pinfo, &ei_rohc_not_dissected_yet, tvb, offset, -1);
    }
    return offset;
}

static int
dissect_rohc_ir_packet(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
                       int offset, uint16_t cid, bool is_add_cid, rohc_info *p_rohc_info)
{
    proto_item         *ir_item, *item;
    proto_tree         *ir_tree;
    int                 ir_item_start;
    int                 x_bit_offset;
    bool                d = false;
    uint8_t             oct, profile, val_len = 0;
    int16_t             feedback_data_len = 0;
    tvbuff_t           *next_tvb;
    rohc_cid_context_t *rohc_cid_context = NULL;

    /* The cid value must have been dissected and valid
     * offset must point to the IR octet  see below ( | 1   1   1   1   1   1   0 | D |  )
     * TODO: CRC validation
     */

     /*
      0   1   2   3   4   5   6   7
     --- --- --- --- --- --- --- ---
    |         Add-CID octet         |  if for small CIDs and CID != 0
    +---+---+---+---+---+---+---+---+
    | 1   1   1   1   1   1   0 | D |
    +---+---+---+---+---+---+---+---+
    |                               |
    /    0-2 octets of CID info     /  1-2 octets if for large CIDs
    |                               |
    +---+---+---+---+---+---+---+---+
    |            Profile            |  1 octet
    +---+---+---+---+---+---+---+---+
    |              CRC              |  1 octet
    +---+---+---+---+---+---+---+---+
    |                               |
    |         Static chain          |  variable length
    |                               |
    +---+---+---+---+---+---+---+---+
    |                               |
    |         Dynamic chain         |  present if D = 1, variable length
    |                               |
     - - - - - - - - - - - - - - - -
    |                               |
    |           Payload             |  variable length
    |                               |
     - - - - - - - - - - - - - - - -

    */
    oct = tvb_get_uint8(tvb,offset);

    if (!p_rohc_info->large_cid_present && !is_add_cid) {
        item = proto_tree_add_uint(tree, hf_rohc_small_cid, tvb, 0, 0, cid);
        proto_item_set_generated(item);
    }
    ir_item = proto_tree_add_item(tree, hf_rohc_ir_packet, tvb, offset, 1, ENC_BIG_ENDIAN);
    ir_tree = proto_item_add_subtree(ir_item, ett_rohc_ir);
    ir_item_start = offset;
    d = oct & 0x01;
    x_bit_offset = offset;
    offset++;
    if (p_rohc_info->large_cid_present) {
        /* Handle Large CID:s here */
        get_self_describing_var_len_val(tvb, ir_tree, offset, hf_rohc_large_cid, &val_len);
        offset = offset + val_len;
    }

    /* Read profile */
    profile = tvb_get_uint8(tvb,offset);

    /* D (all profiles?) */
    if ((profile==ROHC_PROFILE_RTP) || (profile==ROHC_PROFILE_UDP)) {
        proto_tree_add_item(ir_tree, hf_rohc_d_bit, tvb, x_bit_offset, 1, ENC_BIG_ENDIAN);
    }

    /* Profile.
     *  In the IR packet, the profile identifier is abbreviated to the 8 least
     * significant bits.  It selects the highest-number profile in the
     * channel state parameter PROFILES that matches the 8 LSBs given. */
    proto_tree_add_item(ir_tree, hf_rohc_profile, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;

    /* CRC */
    proto_tree_add_item(ir_tree, hf_rohc_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;

    /* See if we have an entry for this CID
     * Update it if we do otherwise create it
     * and fill in the info.
     */
    if (!PINFO_FD_VISITED(pinfo)) {
        int key = cid;
        rohc_cid_context = (rohc_cid_context_t*)g_hash_table_lookup(rohc_cid_hash, GUINT_TO_POINTER(key));
        if (rohc_cid_context != NULL) {
            /* This is not the first IR packet seen*/
            int tmp_prev_ir_frame_number = rohc_cid_context->ir_frame_number;
            int tmp_prev_rohc_ip_version = rohc_cid_context->rohc_ip_version;
            int tmp_prev_mode = rohc_cid_context->mode;
            bool tmp_prev_rnd = rohc_cid_context->rnd;
            bool tmp_prev_udp_checksum_present = rohc_cid_context->udp_checksum_present;

            /*ws_warning("IR pkt found CID %u",cid);*/

            rohc_cid_context = wmem_new(wmem_file_scope(), rohc_cid_context_t);
            rohc_cid_context->profile = profile;
            rohc_cid_context->prev_ir_frame_number = tmp_prev_ir_frame_number;
            rohc_cid_context->ir_frame_number = pinfo->num;
            rohc_cid_context->rohc_ip_version = tmp_prev_rohc_ip_version;
            rohc_cid_context->mode = (enum rohc_mode)tmp_prev_mode;
            rohc_cid_context->rnd = tmp_prev_rnd;
            rohc_cid_context->udp_checksum_present = tmp_prev_udp_checksum_present;
            rohc_cid_context->large_cid_present = p_rohc_info->large_cid_present;

            g_hash_table_replace(rohc_cid_hash, GUINT_TO_POINTER(key), rohc_cid_context);
            p_add_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0, rohc_cid_context);
        } else {
            rohc_cid_context = wmem_new(wmem_file_scope(), rohc_cid_context_t);
            rohc_cid_context->large_cid_present = p_rohc_info->large_cid_present;
            rohc_cid_context->mode = 0;
            /*rohc_cid_context->d_mode;*/
            rohc_cid_context->rnd = false;
            rohc_cid_context->udp_checksum_present = false;
            rohc_cid_context->profile = profile;
            rohc_cid_context->prev_ir_frame_number = -1;
            rohc_cid_context->ir_frame_number = pinfo->num;
            rohc_cid_context->rohc_ip_version = p_rohc_info->rohc_ip_version;
            rohc_cid_context->mode = p_rohc_info->mode;

            /*ws_warning("IR pkt New CID %u",cid);*/

            g_hash_table_insert(rohc_cid_hash, GUINT_TO_POINTER(key), rohc_cid_context);
            p_add_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0, rohc_cid_context);
        }
    } else {
        /* get the stored data */
        rohc_cid_context = (rohc_cid_context_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0);
    }

    switch (profile) {
        case ROHC_PROFILE_UNCOMPRESSED:
            /* Just an ip frame */
            if (tvb_reported_length_remaining(tvb, offset) > 0) {
                oct = tvb_get_uint8(tvb, offset);
                if ((oct&0xf0) == 0x60) {
                    next_tvb = tvb_new_subset_remaining(tvb, offset);
                    call_dissector(ipv6_handle, next_tvb, pinfo, tree);
                    offset += tvb_captured_length_remaining(tvb, offset);
                }
                else if ((oct&0xf0) == 0x40) {
                    next_tvb = tvb_new_subset_remaining(tvb, offset);
                    call_dissector(ip_handle, next_tvb, pinfo, tree);
                    offset += tvb_captured_length_remaining(tvb, offset);
                }
                col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "ROHC/");
            }
            break;
        case ROHC_PROFILE_RTP:
        case ROHC_PROFILE_UDP:
        case ROHC_PROFILE_IP:
            offset = dissect_rohc_ir_rtp_udp_ip_profile_static(tvb, ir_tree, pinfo, offset, d, profile, rohc_cid_context);
            break;

        default:
            proto_tree_add_expert(ir_tree, pinfo, &ei_rohc_profile_specific, tvb, offset, feedback_data_len);
            offset = -1;
            break;
    }

    if (offset != -1) {
        /* Set length of IR header */
        proto_item_set_len(ir_item, offset-ir_item_start);
    }

    return offset;
}

static int
dissect_rohc_ir_dyn_packet(tvbuff_t *tvb, proto_tree *tree, packet_info *pinfo,
                           int offset, uint16_t cid, bool is_add_cid, rohc_info *p_rohc_info)
{
    proto_item         *ir_item, *item;
    proto_tree         *ir_tree;
    int                 ir_item_start;
    uint8_t             profile, val_len = 0;
    int16_t             feedback_data_len = 0;
    rohc_cid_context_t *rohc_cid_context;

    /* Add-CID */
    if (!p_rohc_info->large_cid_present && !is_add_cid) {
        item = proto_tree_add_uint(tree, hf_rohc_small_cid, tvb, 0, 0, cid);
        proto_item_set_generated(item);
    }

    ir_item = proto_tree_add_item(tree, hf_rohc_ir_dyn_packet, tvb, offset, 1, ENC_BIG_ENDIAN);
    ir_tree = proto_item_add_subtree(ir_item, ett_rohc_ir_dyn);
    ir_item_start = offset;
    offset++;

    if (p_rohc_info->large_cid_present) {
        /* Handle Large CID:s here */
        get_self_describing_var_len_val(tvb, ir_tree, offset, hf_rohc_large_cid, &val_len);
        offset = offset + val_len;
    }

    /* Profile */
    profile = tvb_get_uint8(tvb,offset);
    proto_tree_add_item(ir_tree, hf_rohc_profile, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;

    /* See if we have an entry for this CID
     * Update it if we do otherwise create it
     * and fill in the info.
     */
    if (!PINFO_FD_VISITED(pinfo)) {
        int key = cid;
        rohc_cid_context = (rohc_cid_context_t*)g_hash_table_lookup(rohc_cid_hash, GUINT_TO_POINTER(key));

        if (rohc_cid_context) {
            /* This is not the first IR packet seen*/
            int tmp_prev_ir_frame_number = rohc_cid_context->ir_frame_number;
            int tmp_prev_rohc_ip_version = rohc_cid_context->rohc_ip_version;
            int tmp_prev_mode = rohc_cid_context->mode;
            bool tmp_prev_rnd = rohc_cid_context->rnd;
            bool tmp_prev_udp_checksum_present = rohc_cid_context->udp_checksum_present;

            /*ws_warning("IR pkt found CID %u",cid);*/

            rohc_cid_context = wmem_new(wmem_file_scope(), rohc_cid_context_t);
            rohc_cid_context->profile = profile;
            rohc_cid_context->prev_ir_frame_number = tmp_prev_ir_frame_number;
            rohc_cid_context->ir_frame_number = pinfo->num;
            rohc_cid_context->rohc_ip_version = tmp_prev_rohc_ip_version;
            rohc_cid_context->mode = (enum rohc_mode)tmp_prev_mode;
            rohc_cid_context->rnd = tmp_prev_rnd;
            rohc_cid_context->udp_checksum_present = tmp_prev_udp_checksum_present;
            rohc_cid_context->large_cid_present = p_rohc_info->large_cid_present;

            g_hash_table_replace(rohc_cid_hash, GUINT_TO_POINTER(key), rohc_cid_context);
            p_add_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0, rohc_cid_context);
        } else {
            rohc_cid_context = wmem_new(wmem_file_scope(), rohc_cid_context_t);
            rohc_cid_context->rohc_ip_version = 0;
            rohc_cid_context->large_cid_present = p_rohc_info->large_cid_present;
            /*rohc_cid_context->d_mode;*/
            rohc_cid_context->rnd = false;
            rohc_cid_context->udp_checksum_present = false;
            rohc_cid_context->profile = profile;
            rohc_cid_context->prev_ir_frame_number = -1;
            rohc_cid_context->ir_frame_number = pinfo->num;
            rohc_cid_context->mode = p_rohc_info->mode;

            /*ws_warning("IR pkt New CID %u",cid);*/

            g_hash_table_insert(rohc_cid_hash, GUINT_TO_POINTER(key), rohc_cid_context);
            p_add_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0, rohc_cid_context);
        }
    } else {
        /* get the stored data */
        rohc_cid_context = (rohc_cid_context_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0);
    }

    /* CRC */
    proto_tree_add_item(ir_tree, hf_rohc_crc, tvb, offset, 1, ENC_BIG_ENDIAN);
    offset++;

    /* Profile specific information */
    switch (profile ) {
        case ROHC_PROFILE_RTP:
        case ROHC_PROFILE_UDP:
            offset = dissect_rohc_ir_profile_dynamic(tvb, pinfo, ir_tree, offset, profile, rohc_cid_context);
            break;

        default:
            proto_tree_add_expert(ir_tree, pinfo, &ei_rohc_profile_specific, tvb, offset, feedback_data_len);
            break;
    }

    /* Set length of IR-DYN header */
    if (offset != -1) {
        proto_item_set_len(ir_item, offset-ir_item_start);
    }

    return offset;
}

/******************************/
/* Main dissection function.  */
static int
dissect_rohc(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data /* rohc_info* */)
{
    proto_item         *ti, *item, *conf_item;
    proto_tree         *rohc_tree, *sub_tree = NULL, *conf_tree;
    int                 offset               = 0, length;
    uint8_t             oct, code, size, val_len = 0;
    int16_t             feedback_data_len, cid = 0;
    bool                is_add_cid           = false;
    rohc_info          *p_rohc_info          = NULL;
    rohc_info           g_rohc_info;
    tvbuff_t           *next_tvb=NULL, *payload_tvb;
    rohc_cid_context_t *rohc_cid_context     = NULL;

    if (data == NULL) {
        /* No rohc_info passed in, set some defaults */
        g_rohc_info.rohc_compression     = false;
        g_rohc_info.rohc_ip_version      = g_version;
        g_rohc_info.cid_inclusion_info   = false;
        g_rohc_info.large_cid_present    = false;
        g_rohc_info.mode                 = RELIABLE_BIDIRECTIONAL;
        g_rohc_info.rnd                  = false;
        g_rohc_info.udp_checksum_present = false;
        g_rohc_info.profile              = g_profile;
        g_rohc_info.last_created_item    = NULL;
        p_rohc_info = &g_rohc_info;
    } else {
        /* Use info passed in */
        p_rohc_info = (rohc_info *)data;
        /* TODO: contents not referenced again, so why do this? */
        memset(&g_rohc_info, 0, sizeof(rohc_info));
    }

    length = tvb_reported_length(tvb);

    /* If this is ROHC ethertype clear col */
    if (pinfo->src.type == AT_ETHER) {
        col_set_str(pinfo->cinfo, COL_INFO, "ROHC");
        col_clear(pinfo->cinfo, COL_INFO);
    } else {
        col_append_str(pinfo->cinfo, COL_PROTOCOL, "|ROHC");
        /* Append a space if we add stuff to existing col info */
        col_append_str(pinfo->cinfo, COL_INFO, " ");
    }

    /* Add ROHC root */
    ti = proto_tree_add_item(tree, proto_rohc, tvb, 0, -1, ENC_NA);
    rohc_tree = proto_item_add_subtree(ti, ett_rohc);

    /* Put configuration data into the tree */
    conf_tree = proto_tree_add_subtree_format(rohc_tree, tvb, offset, 0, ett_rohc_conf, &item,
                                              "Global Configuration: (%s)",
                                              p_rohc_info->large_cid_present ? "Large CID" : "Small CID");
    proto_item_set_generated(item);

    /* Look for cid context info attached to frame */
    rohc_cid_context = (rohc_cid_context_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0 /* key */);
    if (rohc_cid_context) {
        /* Do we have info from an IR frame? */
        if (rohc_cid_context->ir_frame_number>0) {
            /* Show was configured by IR Packet */
            conf_item = proto_tree_add_item(conf_tree, hf_rohc_configured_by_ir_packet, tvb, offset, 0, ENC_NA);
            proto_item_set_generated(conf_item);
            /* No. of IR setup frame */
            conf_item = proto_tree_add_uint(conf_tree, hf_rohc_ir_pkt_frame, tvb, 0, 0, rohc_cid_context->ir_frame_number);
            proto_item_set_generated(conf_item);

            /* Any previous IR frame number */
            if (rohc_cid_context->prev_ir_frame_number>0) {
                conf_item = proto_tree_add_uint(conf_tree, hf_rohc_ir_previous_frame, tvb, 0, 0, rohc_cid_context->prev_ir_frame_number);
                proto_item_set_generated(conf_item);
            }

            /* Profile */
            conf_item = proto_tree_add_uint(conf_tree, hf_rohc_ir_profile, tvb, offset, 0, rohc_cid_context->profile);
            proto_item_set_generated(conf_item);
            col_append_fstr(pinfo->cinfo, COL_INFO, "%s: ", val_to_str_const(rohc_cid_context->profile, rohc_profile_vals, "Unknown"));

            /* IP Version number */
            conf_item = proto_tree_add_uint(conf_tree, hf_rohc_ir_ip_version, tvb, offset, 0, rohc_cid_context->rohc_ip_version);
            proto_item_set_generated(conf_item);

            /* IR mode */
            if (rohc_cid_context->mode == 0) {
                conf_item = proto_tree_add_uint_format_value(conf_tree, hf_rohc_ir_mode, tvb, offset, 0, 0, "not known");
                proto_item_set_generated(conf_item);
            } else {
                conf_item = proto_tree_add_uint(conf_tree, hf_rohc_ir_mode, tvb, offset, 0, rohc_cid_context->mode);
                proto_item_set_generated(conf_item);
            }

        } else {
            /* No IR frame number stored in context */
            conf_item = proto_tree_add_item(conf_tree, hf_rohc_no_configuration_info, tvb, offset, 0, ENC_NA);
            proto_item_set_generated(conf_item);
        }
    }


start_over:
    /* N.B. These steps are the procedure described in 5.2.6.  ROHC initial decompressor processing */

    /*    1) If the first octet is a Padding Octet (11100000),
     *       strip away all initial Padding Octets and goto next step.
     */
    cid = 0;
    oct = tvb_get_uint8(tvb,offset);
    if (oct== 0xe0) {
        while (oct == 0xe0) {
            offset++;
            oct = tvb_get_uint8(tvb,offset);
        }
        proto_tree_add_item(rohc_tree, hf_rohc_padding, tvb, 0, offset, ENC_NA);
    }

    /* 2) If the first remaining octet starts with 1110, it is an Add-CID octet:
     *    remember the Add-CID octet; remove the octet.
     */
    if ((oct&0xf0) == 0xe0) {
        is_add_cid = true;
        cid = oct & 0x0f;
        proto_tree_add_item(rohc_tree, hf_rohc_add_cid, tvb, offset, 1, ENC_BIG_ENDIAN);
        proto_tree_add_uint(rohc_tree, hf_rohc_small_cid, tvb, offset, 1, cid);
        offset++;

        oct = tvb_get_uint8(tvb,offset);
    }

    /* feedback ?
     * Feedback (begins with 11110)
     */
    if ((oct&0xf8) == 0xf0) {
        /* 3) If the first remaining octet starts with 11110, and an Add-CID
         *    octet was found in step 2), an error has occurred;
         *    the header MUST be discarded without further action.
         */

        int feedback_start = offset;

        if (is_add_cid) {
            p_rohc_info->last_created_item = proto_tree_add_item(rohc_tree, hf_rohc_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
            col_append_str(pinfo->cinfo, COL_INFO, "Error packet");
            proto_tree_add_item(rohc_tree, hf_rohc_error_packet, tvb, offset, -1, ENC_NA);
            return tvb_captured_length(tvb);
        } else {
            col_append_str(pinfo->cinfo, COL_INFO, "Feedback ");
            /* 4) If the first remaining octet starts with 11110, and an Add-CID
             *    octet was not found in step 2), this is feedback:
             *        find the size of the feedback data, call it s;
             *        remove the feedback type octet;
             *        remove the Size octet if Code is 0;
             *        send feedback data of length s to the same-side associated
             *        compressor;
             *        if packet exhausted, stop; otherwise goto 2).
             */

            /* Feedback subtree */
            p_rohc_info->last_created_item = proto_tree_add_item(rohc_tree, hf_rohc_feedback, tvb, offset, 1, ENC_BIG_ENDIAN);
            sub_tree = proto_item_add_subtree(p_rohc_info->last_created_item, ett_rohc_fb);
            /* Code */
            proto_tree_add_item(sub_tree, hf_rohc_code, tvb, offset, 1, ENC_BIG_ENDIAN);
            code = oct&0x7;
            offset++;
            if (code==0) {
                /* Separate size field */
                size = tvb_get_uint8(tvb,offset);
                proto_tree_add_item(sub_tree, hf_rohc_size, tvb, offset, 1, ENC_BIG_ENDIAN);
                offset++;
            } else {
                /* Size is in code field itself. */
                size = code;
            }
            feedback_data_len = size;
            /* CID */
            if (!p_rohc_info->large_cid_present) {
                /* Check for Add-CID octet */
                oct = tvb_get_uint8(tvb,offset);
                if ((oct&0xf0) == 0xe0) {
                    cid = oct & 0x0f;
                    proto_tree_add_item(sub_tree, hf_rohc_add_cid, tvb, offset, 1, ENC_BIG_ENDIAN);
                    proto_tree_add_uint(sub_tree, hf_rohc_small_cid, tvb, offset, 1, cid);
                    offset++;
                    feedback_data_len--;
                } else {
                    item = proto_tree_add_uint(sub_tree, hf_rohc_small_cid, tvb, 0, 0, cid);
                    proto_item_set_generated(item);
                }
            } else {
                /* Read Large CID here */
                get_self_describing_var_len_val(tvb, sub_tree, offset, hf_rohc_large_cid, &val_len);
                /* feedback_data_len - "length of large CID" */
                feedback_data_len = feedback_data_len - val_len;
                offset += val_len;
            }

            /* Dissect feedback */
            dissect_rohc_feedback_data(tvb, sub_tree, pinfo, offset, feedback_data_len, p_rohc_info, cid, p_rohc_info != &g_rohc_info);
            offset += size;
            if (offset<length) {
                goto start_over;
            }

            proto_item_set_len(p_rohc_info->last_created_item, offset-feedback_start);
            return tvb_captured_length(tvb);
        }
    }/*feedback */

    /* 5) If the first remaining octet starts with 1111111, this is a segment:
     *
     */
    if ((oct&0xfe) == 0xfe) {
        col_append_str(pinfo->cinfo, COL_INFO, "Segment");
        if (!p_rohc_info->large_cid_present && !is_add_cid) {
            item = proto_tree_add_uint(rohc_tree, hf_rohc_small_cid, tvb, 0, 0, cid);
            proto_item_set_generated(item);
        }
        /* Segmentation not supported! */
        proto_tree_add_expert(rohc_tree, pinfo, &ei_rohc_desegmentation_not_implemented, tvb, offset, -1);
        return tvb_captured_length(tvb);
    }

    /* 6) Here, it is known that the rest is forward information (unless the
     *    header is damaged).
     */
    if ((oct&0xfe) == 0xfc) {
        col_append_str(pinfo->cinfo, COL_INFO, "IR");
        offset = dissect_rohc_ir_packet(tvb, rohc_tree, pinfo, offset, cid, is_add_cid, p_rohc_info);
        if (offset == -1) {
            /* Could not parse header */
            return tvb_captured_length(tvb);
        }

        payload_tvb = tvb_new_subset_remaining(tvb, offset);
        call_data_dissector(payload_tvb, pinfo, rohc_tree);
        return tvb_captured_length(tvb);
    }
    if ((oct&0xff) == 0xf8) {
        col_append_str(pinfo->cinfo, COL_INFO, "IR-DYN packet");
        offset = dissect_rohc_ir_dyn_packet(tvb, rohc_tree, pinfo, offset, cid, is_add_cid, p_rohc_info);
        if (offset == -1) {
            /* Could not parse header */
            return tvb_captured_length(tvb);
        }

        payload_tvb = tvb_new_subset_remaining(tvb, offset);
        call_data_dissector(payload_tvb, pinfo, rohc_tree);
        return tvb_captured_length(tvb);
    }

    /* First pass - look up or create CID context */
    if (!PINFO_FD_VISITED(pinfo)) {
        int key = cid;
        rohc_cid_context = (rohc_cid_context_t*)g_hash_table_lookup(rohc_cid_hash, GUINT_TO_POINTER(key));
        if (!rohc_cid_context) {
            /* Not found, so initialize new context based upon p_rohc_info */
            rohc_cid_context = wmem_new(wmem_file_scope(), rohc_cid_context_t);
            /*rohc_cid_context->d_mode;*/
            rohc_cid_context->rnd = p_rohc_info->rnd;
            rohc_cid_context->udp_checksum_present = p_rohc_info->udp_checksum_present;
            rohc_cid_context->profile = p_rohc_info->profile;
            rohc_cid_context->mode = p_rohc_info->mode;
            rohc_cid_context->rohc_ip_version = p_rohc_info->rohc_ip_version;
            rohc_cid_context->large_cid_present = p_rohc_info->large_cid_present;
            rohc_cid_context->prev_ir_frame_number = -1;
            rohc_cid_context->ir_frame_number = -1;
            /*ws_warning("Store dummy data %u",cid);*/
        }
        /* Store in pinfo */
        p_add_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0, rohc_cid_context);
    } else {
        /* Later passes - get from pinfo */
        rohc_cid_context = (rohc_cid_context_t*)p_get_proto_data(wmem_file_scope(), pinfo, proto_rohc, 0);
    }
    DISSECTOR_ASSERT(rohc_cid_context);

    /* Call IP for uncompressed profile */
    if (rohc_cid_context->profile==ROHC_PROFILE_UNCOMPRESSED) {
        if (rohc_cid_context->large_cid_present) {
            /* How long does packet say it is? */
            get_self_describing_var_len_val(tvb, rohc_tree, offset+1, hf_rohc_large_cid, &val_len);
            /* How many bytes do we actually have? */
            int len = tvb_captured_length_remaining(tvb, offset);
            if (len >= val_len) {
                len -= val_len;
                uint8_t *payload_data = (uint8_t *)wmem_alloc(pinfo->pool, len);
                tvb_memcpy(tvb, payload_data, offset, 1);
                tvb_memcpy(tvb, &payload_data[1], offset+1+val_len, len-1);
                next_tvb = tvb_new_child_real_data(tvb, payload_data, len, len);
                add_new_data_source(pinfo, next_tvb, "Payload");
            }
        }
        else {
            next_tvb = tvb_new_subset_remaining(tvb, offset);
        }

        /* Call appropriate IP dissector.
           TODO: could just call "ip" dissector instead? */
        if ((oct&0xf0)==0x40) {
            call_dissector(ip_handle, next_tvb, pinfo, tree);
        }
        else if ((oct&0xf0)==0x60) {
            call_dissector(ipv6_handle, next_tvb, pinfo, tree);
        }
        else {
            call_data_dissector(next_tvb, pinfo, tree);
        }

        col_prepend_fstr(pinfo->cinfo, COL_PROTOCOL, "ROHC/");
        return tvb_captured_length(tvb);
    }
    else if (((oct&0x80)==0x00) &&
             ((rohc_cid_context->profile==ROHC_PROFILE_RTP) || (rohc_cid_context->profile==ROHC_PROFILE_UDP))) {
        /* 5.7.1. Packet type 0: UO-0, R-0, R-0-CRC */
        offset = dissect_rohc_pkt_type_0(tvb, pinfo, rohc_tree, offset, oct, rohc_cid_context);
    } else if ((oct&0xc0)==0x80) {
        if (rohc_cid_context->mode == RELIABLE_BIDIRECTIONAL) {
            /* 5.7.2. Packet type 1 (R-mode): R-1, R-1-TS, R-1-ID */
            offset = dissect_rohc_pkt_type_1_r_mode(tvb, pinfo, rohc_tree, offset, rohc_cid_context);
        }
        else {
            /* 5.7.3. Packet type 1 (U/O-mode): UO-1, UO-1-ID, UO-1-TS */
            offset = dissect_rohc_pkt_type_1_u_o_mode(tvb, pinfo, rohc_tree, offset, rohc_cid_context);
        }
    } else if ((oct&0xe0)==0xc0) {
        /* 5.7.4. Packet type 2: UOR-2 */
        offset = dissect_rohc_pkt_type_2(tvb, pinfo, rohc_tree, offset, rohc_cid_context);
    }

    /* IP-ID */
    if (rohc_cid_context->rnd) {
        proto_tree_add_item(rohc_tree, hf_rohc_ip_id, tvb, offset, 2, ENC_BIG_ENDIAN);
        offset += 2;
    }

    /* UDP Checksum */
    if (rohc_cid_context->udp_checksum_present) {
        proto_tree_add_checksum(rohc_tree, tvb, offset, hf_rohc_udp_checksum, -1, NULL, pinfo, 0, ENC_BIG_ENDIAN, PROTO_CHECKSUM_NO_FLAGS);
        offset += 2;
    }

    /* Any remainder is undissected data / payload */
    payload_tvb = tvb_new_subset_remaining(tvb, offset);
    call_data_dissector(payload_tvb, pinfo, tree);

    return tvb_captured_length(tvb);
}

/* Set up rohc_cid_hash which holds data for a CID
 * needed to dissect subsequent packages.
 * XXXX ToDo:
 * A better Key than just the CID may have to be devised.
 *
 */


static void
rohc_init_protocol(void)
{
    rohc_cid_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
}

static void
rohc_cleanup_protocol(void)
{
    g_hash_table_destroy(rohc_cid_hash);
}

void
proto_register_rohc(void)
{

    static hf_register_info hf[] =
        {
            { &hf_rohc_padding,
              { "Padding","rohc.padding",
                FT_BYTES, BASE_NONE, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_add_cid,
              { "Add-CID","rohc.add_cid",
                FT_UINT8, BASE_HEX, NULL, 0xf0,
                NULL , HFILL
              }
            },
            { &hf_rohc_feedback,
              { "Feedback","rohc.feedback",
                FT_UINT8, BASE_HEX, NULL, 0xf8,
                NULL , HFILL
              }
            },
            { &hf_rohc_code,
              { "Code","rohc.code",
                FT_UINT8, BASE_DEC, NULL, 0x07,
                NULL , HFILL
              }
            },
            { &hf_rohc_size,
              { "Size","rohc.size",
                FT_UINT8, BASE_DEC, NULL, 0x00,
                NULL , HFILL
              }
            },
            { &hf_rohc_ir_packet,
              { "IR packet","rohc.ir_packet",
                FT_UINT8, BASE_HEX, NULL, 0xfe,
                NULL , HFILL
              }
            },
            { &hf_rohc_ir_dyn_packet,
              { "IR-DYN packet","rohc.ir_dyn_packet",
                FT_UINT8, BASE_HEX, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_small_cid,
              { "Small CID","rohc.small_cid",
                FT_UINT8, BASE_DEC, NULL, 0x0f,
                NULL , HFILL
              }
            },
            { &hf_rohc_large_cid,
              { "Large CID","rohc.large_cid",
                FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_acktype,
              { "Acktype","rohc.acktype",
                FT_UINT8, BASE_DEC, VALS(rohc_acktype_vals), 0xc0,
                NULL , HFILL
              }
            },
            { &hf_rohc_mode,
              { "Mode","rohc.mode",
                FT_UINT8, BASE_DEC, VALS(rohc_mode_vals), 0x30,
                NULL , HFILL
              }
            },
            { &hf_rohc_sn,
              { "SN LSB","rohc.sn",
                FT_UINT16, BASE_HEX_DEC, NULL, 0x0fff,
                NULL , HFILL
              }
            },
            { &hf_rohc_profile_spec_octet,
              { "Profile-specific octet","rohc.profile_spec_octet",
                FT_UINT8, BASE_HEX, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_fb1_sn,
              { "SN LSB","rohc.sn",
                FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_opt_type,
              { "Option type","rohc.opt_type",
                FT_UINT8, BASE_DEC, VALS(rohc_opt_type_vals), 0xf0,
                NULL , HFILL
              }
            },
            { &hf_rohc_opt_len,
              { "Option length","rohc.opt_length",
                FT_UINT8, BASE_DEC, NULL, 0x0f,
                NULL , HFILL
              }
            },
            { &hf_rohc_crc,
              { "CRC","rohc.crc",
                FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_opt_sn,
              { "SN additional bits","rohc.opt.sn_add_bits",
                FT_UINT8, BASE_HEX_DEC, NULL, 0x0,
                "Feedback Option SN", HFILL
              }
            },
            { &hf_rohc_ext,
              { "Extension","rohc.ext",
                FT_STRING, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext_sn,
              { "SN LSB","rohc.sn",
                FT_UINT24, BASE_HEX_DEC, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_opt_clock,
              { "Clock", "rohc.opt.clock",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                "Feedback Option Clock", HFILL
              }
            },
            { &hf_rohc_opt_jitter,
              { "Max Jitter", "rohc.opt.jitter",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                "Feedback Option Jitter", HFILL
              }
            },
            { &hf_rohc_opt_loss,
              { "Longest loss event (packets)", "rohc.opt.loss",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                "Feedback Option Loss", HFILL
              }
            },
            { &hf_rohc_profile,
              { "Profile","rohc.profile",
                FT_UINT8, BASE_DEC, VALS(rohc_profile_vals), 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_d_bit,
              { "D - Dynamic chain","rohc.d",
                FT_BOOLEAN, 8, TFS(&tfs_present_not_present), 0x01,
                NULL , HFILL
              }
            },
            { &hf_rohc_ip_version,
              { "Version","rohc.ip.version",
                FT_UINT8, BASE_DEC, VALS(rohc_ip_version_vals), 0xf0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ip_version_ip_profile,
              { "Version","rohc.ip.version",
                FT_UINT8, BASE_DEC, VALS(rohc_ip_version_ip_profile_vals), 0xf0,
                NULL , HFILL
              }
            },
            { &hf_rohc_static_ipv4,
              { "Static IPv4 chain",
                "rohc.static.ipv4", FT_NONE, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ip_protocol,
              { "Protocol","rohc.ip.protocol",
                FT_UINT8, BASE_DEC|BASE_EXT_STRING, &ipproto_val_ext, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ipv4_src,
              { "Source address","rohc.ipv4_src",
                FT_IPv4, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ipv4_dst,
              { "Destination address","rohc.ipv4_dst",
                FT_IPv4, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ipv6_flow,
              { "Flow Label","rohc.ipv6.flow",
                FT_UINT24, BASE_DEC, NULL, 0x0fffff,
                NULL , HFILL
              }
            },
            { &hf_rohc_ipv6_nxt_hdr,
              { "Next Header","rohc.ipv6.nxt_hdr",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ipv6_src,
              { "Source Address","rohc.ipv6.src",
                FT_IPv6, BASE_NONE, NULL, 0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ipv6_dst,
              { "Destination Address","rohc.ipv6.dst",
                FT_IPv6, BASE_NONE, NULL, 0,
                NULL , HFILL
              }
            },
            { &hf_rohc_static_udp,
              { "Static UDP chain", "rohc.static.udp",
                FT_NONE, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_udp_src_port,
              { "Source Port","rohc.udp_src_port",
                FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_udp_dst_port,
              { "Destination Port","rohc.udp_dst_port",
                FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_static_rtp,
              { "Static RTP chain",
                "rohc.static.rtp", FT_NONE, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_rtp_ssrc,
              { "SSRC","rohc.rtp.ssrc",
                FT_UINT32, BASE_HEX_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_dynamic_ipv4,
              { "Dynamic IPv4 chain",
                "rohc.dynamic.ipv4", FT_NONE, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_dynamic_udp,
              { "Dynamic UDP chain",
                "rohc.dynamic.udp", FT_NONE, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_rtp_tos,
              { "Type of Service","rohc.rtp.tos",
                FT_UINT8, BASE_HEX, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_ttl,
              { "Time to Live","rohc.rtp.ttl",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_id,
              { "Identification","rohc.rtp.id",
                FT_UINT16, BASE_HEX, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_df,
              { "Don't Fragment(DF)","rohc.rtp.df",
                FT_BOOLEAN, 8, NULL, 0x80,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_rnd,
              { "RND(IP-ID behaves randomly)","rohc.rtp.rnd",
                FT_BOOLEAN, 8, NULL, 0x40,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_nbo,
              { "Network Byte Order (NBO)","rohc.rtp.nbo",
                FT_BOOLEAN, 8, NULL, 0x20,
                "Whether the IP-ID is in Network Byte Order" , HFILL
              }
            },
            { &hf_rohc_dynamic_udp_checksum,
              { "UDP Checksum", "rohc.dynamic.udp.checksum",
                FT_UINT16, BASE_HEX, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_dynamic_rtp,
              { "Dynamic RTP chain",
                "rohc.dynamic.rtp", FT_NONE, BASE_NONE, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_rtp_v,
              { "Version","rohc.rtp.v",
                FT_UINT8, BASE_DEC, NULL, 0xc0,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_p,
              { "Padding(P)","rohc.rtp.p",
                FT_BOOLEAN, 8, NULL, 0x20,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_rx,
              { "RX","rohc.rtp.rx",
                FT_BOOLEAN, 8, NULL, 0x10,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_cc,
              { "CC","rohc.rtp.cc",
                FT_UINT8, BASE_DEC, NULL, 0x0f,
                "CSRC counter from original RTP header" , HFILL
              }
            },
            { &hf_rohc_rtp_m,
              { "Marker Bit (M)","rohc.rtp.m",
                FT_BOOLEAN, BASE_NONE,  TFS(&tfs_set_notset), 0x00,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_pt,
              { "Payload Type(PT)","rohc.rtp.pt",
                FT_UINT8, BASE_DEC|BASE_EXT_STRING, &rtp_payload_type_vals_ext, 0x7f,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_sn,
              { "Sequence Number(SN)","rohc.rtp.sn",
                FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_timestamp,
              { "RTP Timestamp","rohc.rtp.timestamp",
                FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_x,
              { "X","rohc.rtp.x",
                FT_BOOLEAN, 8,  TFS(&tfs_set_notset), 0x10,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_mode,
              { "Mode","rohc.rtp.mode",
                FT_UINT8, BASE_DEC, VALS(rohc_mode_vals), 0x0c,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_tis,
              { "TIS","rohc.rtp.tis",
                FT_BOOLEAN, 8,  NULL, 0x02,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_tss,
              { "TSS","rohc.rtp.tss",
                FT_BOOLEAN, 8,  NULL, 0x01,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_ts_stride,
              { "TS_Stride","rohc.rtp.ts_stride",
                FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_rtp_time_stride,
              { "Time_Stride","rohc.rtp.time_stride",
                FT_UINT32, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_var_len,
              { "Variable length","rohc.var_len",
                FT_UINT8, BASE_DEC, VALS(rohc_var_len_vals), 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ipv6_tc,
              { "Traffic class","rohc.tc",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ipv6_hop_limit,
              { "Hop limit","rohc.hop_limit",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ir_previous_frame,
              { "Previous IR frame","rohc.ir.prev.frame_num",
                FT_FRAMENUM, BASE_NONE, NULL, 0x0,
                NULL , HFILL,
              }
            },
            { &hf_rohc_ir_profile,
              { "Profile","rohc.ir_profile",
                FT_UINT16, BASE_DEC, VALS(rohc_profile_vals), 0x0,
                NULL , HFILL
              }
            },

            { &hf_rohc_ir_ip_version,
              { "IP Version","rohc.ir_ip_version",
                FT_UINT8, BASE_DEC, VALS(rohc_ip_version_vals), 0x0,
                NULL , HFILL
              }
            },

            { &hf_rohc_ir_mode,
              { "Mode","rohc.ir_mode",
                FT_UINT32, BASE_DEC, VALS(rohc_mode_vals), 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ir_pkt_frame,
              { "Setup by IR frame","rohc.ir.frame_num",
                FT_FRAMENUM, BASE_NONE, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_comp_sn,
              { "Compressed Sequence Number","rohc.comp.sn",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_r_0_crc,
              { "CRC","rohc.r_0_crc",
                FT_UINT8, BASE_HEX, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_x,
              { "Extension","rohc.x",
                FT_BOOLEAN, BASE_NONE, TFS(&tfs_present_not_present), 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_ts,
              { "Compressed RTP timestamp","rohc.tp",
                FT_UINT16, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_comp_ip_id,
              { "Compressed IP-ID","rohc.comp_ip_id",
                FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_comp_ip_id2,
              { "Compressed IP-ID2","rohc.comp_ip_id2",
                FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_t,
              { "T bit","rohc.t",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_compressed_list,
              { "Compressed List", "rohc.compressed-list",
                FT_NONE, BASE_NONE, NULL, 0x0,
                NULL , HFILL
              }
            },
            { &hf_rohc_compressed_list_et,
              { "Encoding Type", "rohc.compressed-list.et",
                FT_UINT8, BASE_DEC, VALS(compressed_list_encoding_type_vals), 0xc0,
                NULL , HFILL
              }
            },
            { &hf_rohc_compressed_list_gp,
              { "Gen-id Present", "rohc.compressed-list.gp",
                FT_UINT8, BASE_DEC, NULL, 0x20,
                NULL , HFILL
              }
            },
            { &hf_rohc_compressed_list_ps,
              { "PS", "rohc.compressed-list.ps",
                FT_UINT8, BASE_DEC, VALS(compressed_list_ps_vals), 0x10,
                "Size of xi fields", HFILL
              }
            },
            { &hf_rohc_compressed_list_res,
              { "Reserved", "rohc.compressed-list.res",
                FT_UINT8, BASE_DEC, NULL, 0x10,
                NULL, HFILL
              }
            },
            { &hf_rohc_compressed_list_count,
              { "Count", "rohc.compressed-list.count",
                FT_UINT8, BASE_DEC, NULL, 0x0f,
                NULL, HFILL
              }
            },
            { &hf_rohc_compressed_list_cc,
              { "CSRC Counter", "rohc.compressed-list.cc",
                FT_UINT8, BASE_DEC, NULL, 0x0f,
                "CSRC Counter from original RTP header", HFILL
              }
            },
            { &hf_rohc_compressed_list_xi_1,
              { "XI 1", "rohc.compressed-list.xi_1",
                FT_UINT8, BASE_DEC, NULL, 0x0f,
                NULL, HFILL
              }
            },
            { &hf_rohc_compressed_list_gen_id,
              { "gen_id", "rohc.compressed-list.gen-id",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_compressed_list_ref_id,
              { "ref_id", "rohc.compressed-list.ref-id",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_compressed_list_mask_size,
              { "Mask size","rohc.compressed-list.mask_size",
                FT_BOOLEAN, 8, TFS(&rohc_cmp_lst_mask_size_vals), 0x80,
                NULL , HFILL
              }
            },
            { &hf_rohc_compressed_list_ins_bit_mask,
              { "Insertion bit mask","rohc.compressed-list.ins_bit_mask",
                FT_UINT16, BASE_HEX, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_compressed_list_rem_bit_mask,
              { "Removal bit mask","rohc.compressed-list.rem_bit_mask",
                FT_UINT16, BASE_HEX, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_spare_bits,
              { "Spare bits(0)", "rohc.spare_bits",
                FT_UINT8, BASE_DEC, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ip_id,
              { "IP-ID", "rohc.ip-id",
                FT_UINT16, BASE_HEX_DEC, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_udp_checksum,
              { "UDP checksum", "rohc.udp_checksum",
                FT_UINT16, BASE_HEX, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_flags,
              { "Extension 3 flags","rohc.ext3_flags",
                FT_UINT8, BASE_HEX, NULL, ROHC_RTP_EXT3_FLAGS_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_s,
              { "S","rohc.ext3.s",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_S_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_r_ts,
              { "R-TS","rohc.ext3.r-ts",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_R_TS_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_tsc,
              { "Tsc","rohc.ext3.tsc",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_TSC_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_udp_mode,
              { "Mode","rohc.ext3.mode",
                FT_UINT8, BASE_DEC, VALS(rohc_mode_vals), ROHC_UDP_EXT3_UDP_MODE_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_i,
              { "I","rohc.ext3.i",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_I_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_ip,
              { "ip","rohc.ext3.ip",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_IP_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_ip2,
              { "ip2","rohc.ext3.ip2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_UDP_EXT3_IP2_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_rtp,
              { "rtp","rohc.ext3.rtp",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_RTP_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_ip_flags,
              { "Inner IP header flags","rohc.ext3.inner_ip_flags",
                FT_UINT8, BASE_HEX, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_tos,
              { "TOS","rohc.ext3.tos",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_TOS_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_ttl,
              { "TTL","rohc.ext3.ttl",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_TTL_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_df,
              { "DF","rohc.ext3.df",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_DF_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_pr,
              { "PR","rohc.ext3.pr",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_PR_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_ipx,
              { "IPX","rohc.ext3.ipx",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_IPX_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_nbo,
              { "NBO","rohc.ext3.nbo",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_NBO_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_rnd,
              { "RND","rohc.ext3.rnd",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_RND_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_inner_ip2,
              { "ip2","rohc.ext3.ip2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_INNER_IP2_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_ip_flags,
              { "Outer IP header flags","rohc.ext3.outer_ip_flags",
                FT_UINT8, BASE_HEX, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_tos,
              { "TOS2","rohc.ext3.tos2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_TOS_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_ttl,
              { "TTL2","rohc.ext3.ttl2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_TTL_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_df,
              { "DF2","rohc.ext3.df2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_DF_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_pr,
              { "PR2","rohc.ext3.pr2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_PR_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_ipx,
              { "IPX2","rohc.ext3.ipx2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_IPX_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_nbo,
              { "NBO2","rohc.ext3.nbo2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_NBO_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_rnd,
              { "RND2","rohc.ext3.rnd2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_RND_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_outer_i2,
              { "I2","rohc.ext3.i2",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_OUTER_I2_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_rtp_flags,
              { "RTP header flags","rohc.ext3.rtp_flags",
                FT_UINT8, BASE_HEX, NULL, 0x0,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_rtp_mode,
              { "Mode","rohc.ext3.mode",
                FT_UINT8, BASE_DEC, VALS(rohc_mode_vals), ROHC_RTP_EXT3_RTP_MODE_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_r_pt,
              { "R-PT","rohc.ext3.r_pt",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_R_PT_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_m,
              { "M","rohc.ext3.m",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_M_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_r_x,
              { "R-X","rohc.ext3.r_x",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_R_X_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_csrc,
              { "CSRC","rohc.ext3.csrc",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_CSRC_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_tss,
              { "TSS","rohc.ext3.tss",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_TSS_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_tis,
              { "TIS","rohc.ext3.tis",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_TIS_MASK,
                NULL, HFILL
              }
            },
            { &hf_rohc_ext3_r_p,
              { "R-P","rohc.ext3.r_p",
                FT_BOOLEAN, 8, TFS(&tfs_set_notset), ROHC_RTP_EXT3_R_P_MASK,
                NULL, HFILL
              }
            },
          /* Generated from convert_proto_tree_add_text.pl */
          { &hf_rohc_unknown_option_data, { "Unknown Option data", "rohc.unknown_option_data", FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
          { &hf_rohc_configured_by_ir_packet, { "Configured by IR packet", "rohc.configured_by_ir_packet", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
          { &hf_rohc_no_configuration_info, { "No configuration info", "rohc.no_configuration_info", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
          { &hf_rohc_error_packet, { "Error packet", "rohc.error_packet", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL }},
        };

    /* Setup protocol subtree array */
    static int *ett[] = {
        &ett_rohc,
        &ett_rohc_conf,
        &ett_rohc_fb,
        &ett_rohc_feedback,
        &ett_rohc_ir,
        &ett_rohc_ir_dyn,
        &ett_rohc_static_ipv4,
        &ett_rohc_static_udp,
        &ett_rohc_static_rtp,
        &ett_rohc_rtp_static,
        &ett_rohc_rtp_dynamic,
        &ett_rohc_dynamic_ipv4,
        &ett_rohc_dynamic_udp,
        &ett_rohc_dynamic_rtp,
        &ett_rohc_compressed_list,
        &ett_rohc_packet,
        &ett_rohc_ext,
        &ett_rohc_ext3_flags,
        &ett_rohc_ext3_inner_ip_flags,
        &ett_rohc_ext3_outer_ip_flags,
        &ett_rohc_ext3_rtp_flags
    };

    static ei_register_info ei[] = {
        { &ei_rohc_profile_spec_octet, { "rohc.profile_spec_octet.bad", PI_PROTOCOL, PI_WARN, "Invalid profile-specific octet value", EXPFILL }},
        { &ei_rohc_feedback_type_2_is_not_applicable_for_uncompressed_profile, { "rohc.feedback.type_2_is_not_applicable_for_uncompressed_profile", PI_PROTOCOL, PI_WARN, "Feedback type 2 is not applicable for uncompressed profile", EXPFILL }},
        { &ei_rohc_rohc_opt_clock, { "rohc.opt.clock.udp", PI_MALFORMED, PI_ERROR, "CLOCK option should not be used for UDP", EXPFILL }},
        { &ei_rohc_opt_jitter, { "rohc.opt.jitter.udp", PI_MALFORMED, PI_ERROR, "JITTER option should not be used for UDP", EXPFILL }},
        { &ei_rohc_not_dissected_yet, { "rohc.not_dissected_yet", PI_UNDECODED, PI_WARN, "Not dissected yet", EXPFILL }},
        { &ei_rohc_profile_specific, { "rohc.profile_specific", PI_UNDECODED, PI_WARN, "profile-specific information [Not dissected yet]", EXPFILL }},
        { &ei_rohc_profile_not_supported, { "rohc.profile_not_supported", PI_PROTOCOL, PI_WARN, "Profile not supported", EXPFILL }},
        { &ei_rohc_ip_version, { "rohc.ip.version.unknown", PI_PROTOCOL, PI_WARN, "Error unknown version, only 4 or 6 allowed", EXPFILL }},
        { &ei_rohc_desegmentation_not_implemented, { "rohc.desegmentation_not_implemented", PI_UNDECODED, PI_WARN, "Segment [Desegmentation not implemented yet]", EXPFILL }},
    };

    expert_module_t* expert_rohc;

    /* Register the protocol name and description */
    proto_rohc = proto_register_protocol("RObust Header Compression (ROHC)", "ROHC", "rohc");

    rohc_handle = register_dissector("rohc", dissect_rohc, proto_rohc);

    register_init_routine(&rohc_init_protocol);
    register_cleanup_routine(&rohc_cleanup_protocol);

    /* Required function calls to register the header fields and subtrees used */
    proto_register_field_array(proto_rohc, hf, array_length(hf));
    proto_register_subtree_array(ett, array_length(ett));
    expert_rohc = expert_register_protocol(proto_rohc);
    expert_register_field_array(expert_rohc, ei, array_length(ei));
}

void
proto_reg_handoff_rohc(void)
{
    dissector_add_uint("ethertype", ETHERTYPE_ROHC, rohc_handle);

    ip_handle   = find_dissector_add_dependency("ip", proto_rohc);
    ipv6_handle = find_dissector_add_dependency("ipv6", proto_rohc);
}

/*
 * Editor modelines  -  https://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:
 */