1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
3703
3704
3705
3706
3707
3708
3709
3710
3711
3712
3713
3714
3715
3716
3717
3718
3719
3720
3721
3722
3723
3724
3725
3726
3727
3728
3729
3730
3731
3732
3733
3734
3735
3736
3737
3738
3739
3740
3741
3742
3743
3744
3745
3746
3747
3748
3749
3750
3751
3752
3753
3754
3755
3756
3757
3758
3759
3760
3761
3762
3763
3764
3765
3766
3767
3768
3769
3770
3771
3772
3773
3774
3775
3776
3777
3778
3779
3780
3781
3782
3783
3784
3785
3786
3787
3788
3789
3790
3791
3792
3793
3794
3795
3796
3797
3798
3799
3800
3801
3802
3803
3804
3805
3806
3807
3808
3809
3810
3811
3812
3813
3814
3815
3816
3817
3818
3819
3820
3821
3822
3823
3824
3825
3826
3827
3828
3829
3830
3831
3832
3833
3834
3835
3836
3837
3838
3839
3840
3841
3842
3843
3844
3845
3846
3847
3848
3849
3850
3851
3852
3853
3854
3855
3856
3857
3858
3859
3860
3861
3862
3863
3864
3865
3866
3867
3868
3869
3870
3871
3872
3873
3874
3875
3876
3877
3878
3879
3880
3881
3882
3883
3884
3885
3886
3887
3888
3889
3890
3891
3892
3893
3894
3895
3896
3897
3898
3899
3900
3901
3902
3903
3904
3905
3906
3907
3908
3909
3910
3911
3912
3913
3914
3915
3916
3917
3918
3919
3920
3921
3922
3923
3924
3925
3926
3927
3928
3929
3930
3931
3932
3933
3934
3935
3936
3937
3938
3939
3940
3941
3942
3943
3944
3945
3946
3947
3948
3949
3950
3951
3952
3953
3954
3955
3956
3957
3958
3959
3960
3961
3962
3963
3964
3965
3966
3967
3968
3969
3970
3971
3972
3973
3974
3975
3976
3977
3978
3979
3980
3981
3982
3983
3984
3985
3986
3987
3988
3989
3990
3991
3992
3993
3994
3995
3996
3997
3998
3999
4000
4001
4002
4003
4004
4005
4006
4007
4008
4009
4010
4011
4012
4013
4014
4015
4016
4017
4018
4019
4020
4021
4022
4023
4024
4025
4026
4027
4028
4029
4030
4031
4032
4033
4034
4035
4036
4037
4038
4039
4040
4041
4042
4043
4044
4045
4046
4047
4048
4049
4050
4051
4052
4053
4054
4055
4056
4057
4058
4059
4060
4061
4062
4063
4064
4065
4066
4067
4068
4069
4070
4071
4072
4073
4074
4075
4076
4077
4078
4079
4080
4081
4082
4083
4084
4085
4086
4087
4088
4089
4090
4091
4092
4093
4094
4095
4096
4097
4098
4099
4100
4101
4102
4103
4104
4105
4106
4107
4108
4109
4110
4111
4112
4113
4114
4115
4116
4117
4118
4119
4120
4121
4122
4123
4124
4125
4126
4127
4128
4129
4130
4131
4132
4133
4134
4135
4136
4137
4138
4139
4140
4141
4142
4143
4144
4145
4146
4147
4148
4149
4150
4151
4152
4153
4154
4155
4156
4157
4158
4159
4160
4161
4162
4163
4164
4165
4166
4167
4168
4169
4170
4171
4172
4173
4174
4175
4176
4177
4178
4179
4180
4181
4182
4183
4184
4185
4186
4187
4188
4189
4190
4191
4192
4193
4194
4195
4196
4197
4198
4199
4200
4201
4202
4203
4204
4205
4206
4207
4208
4209
4210
4211
4212
4213
4214
4215
4216
4217
4218
4219
4220
4221
4222
4223
4224
4225
4226
4227
4228
4229
4230
4231
4232
4233
4234
4235
4236
4237
4238
4239
4240
4241
4242
4243
4244
4245
4246
4247
4248
4249
4250
4251
4252
4253
4254
4255
4256
4257
4258
4259
4260
4261
4262
4263
4264
4265
4266
4267
4268
4269
4270
4271
4272
4273
4274
4275
4276
4277
4278
4279
4280
4281
4282
4283
4284
4285
4286
4287
4288
4289
4290
4291
4292
4293
4294
4295
4296
4297
4298
4299
4300
4301
4302
4303
4304
4305
4306
4307
4308
4309
4310
4311
4312
4313
4314
4315
4316
4317
4318
4319
4320
4321
4322
4323
4324
4325
4326
4327
4328
4329
4330
4331
4332
4333
4334
4335
4336
4337
4338
4339
4340
4341
4342
4343
4344
4345
4346
4347
4348
4349
4350
4351
4352
4353
4354
4355
4356
4357
4358
4359
4360
4361
4362
4363
4364
4365
4366
4367
4368
4369
4370
4371
4372
4373
4374
4375
4376
4377
4378
4379
4380
4381
4382
4383
4384
4385
4386
4387
4388
4389
4390
4391
4392
4393
4394
4395
4396
4397
4398
4399
4400
4401
4402
4403
4404
4405
4406
4407
4408
4409
4410
4411
4412
4413
4414
4415
4416
4417
4418
4419
4420
4421
4422
4423
4424
4425
4426
4427
4428
4429
4430
4431
4432
4433
4434
4435
4436
4437
4438
4439
4440
4441
4442
4443
4444
4445
4446
4447
4448
4449
4450
4451
4452
4453
4454
4455
4456
4457
4458
4459
4460
4461
4462
4463
4464
4465
4466
4467
4468
4469
4470
4471
4472
4473
4474
4475
4476
4477
4478
4479
4480
4481
4482
4483
4484
4485
4486
4487
4488
4489
4490
4491
4492
4493
4494
4495
4496
4497
4498
4499
4500
4501
4502
4503
4504
4505
4506
4507
4508
4509
4510
4511
4512
4513
4514
4515
4516
4517
4518
4519
4520
4521
4522
4523
4524
4525
4526
4527
4528
4529
4530
4531
4532
4533
4534
4535
4536
4537
4538
4539
4540
4541
4542
4543
4544
4545
4546
4547
4548
4549
4550
4551
4552
4553
4554
4555
4556
4557
4558
4559
4560
4561
4562
4563
4564
4565
4566
4567
4568
4569
4570
4571
4572
4573
4574
4575
4576
4577
4578
4579
4580
4581
4582
4583
4584
4585
4586
4587
4588
4589
4590
4591
4592
4593
4594
4595
4596
4597
4598
4599
4600
4601
4602
4603
4604
4605
4606
4607
4608
4609
4610
4611
4612
4613
4614
4615
4616
4617
4618
4619
4620
4621
4622
4623
4624
4625
4626
4627
4628
4629
4630
4631
4632
4633
4634
4635
4636
4637
4638
4639
4640
4641
4642
4643
4644
4645
4646
4647
4648
4649
4650
4651
4652
4653
4654
4655
4656
4657
4658
4659
4660
4661
4662
4663
4664
4665
4666
4667
4668
4669
4670
4671
4672
4673
4674
4675
4676
4677
4678
4679
4680
4681
4682
4683
4684
4685
4686
4687
4688
4689
4690
4691
4692
4693
4694
4695
4696
4697
4698
4699
4700
4701
4702
4703
4704
4705
4706
4707
4708
4709
4710
4711
4712
4713
4714
4715
4716
4717
4718
4719
4720
4721
4722
4723
4724
4725
4726
4727
4728
4729
4730
4731
4732
4733
4734
4735
4736
4737
4738
4739
4740
4741
4742
4743
4744
4745
4746
4747
4748
4749
4750
4751
4752
4753
4754
4755
4756
4757
4758
4759
4760
4761
4762
4763
4764
4765
4766
4767
4768
4769
4770
4771
4772
4773
4774
4775
4776
4777
4778
4779
4780
4781
4782
4783
4784
4785
4786
4787
4788
4789
4790
4791
4792
4793
4794
4795
4796
4797
4798
4799
4800
4801
4802
4803
4804
4805
4806
4807
4808
4809
4810
4811
4812
4813
4814
4815
4816
4817
4818
4819
4820
4821
4822
4823
4824
4825
4826
4827
4828
4829
4830
4831
4832
4833
4834
4835
4836
4837
4838
4839
4840
4841
4842
4843
4844
4845
4846
4847
4848
4849
4850
4851
4852
4853
4854
4855
4856
4857
4858
4859
4860
4861
4862
4863
4864
4865
4866
4867
4868
4869
4870
4871
4872
4873
4874
4875
4876
4877
4878
4879
4880
4881
4882
4883
4884
4885
4886
4887
4888
4889
4890
4891
4892
4893
4894
4895
4896
4897
4898
4899
4900
4901
4902
4903
4904
4905
4906
4907
4908
4909
4910
4911
4912
4913
4914
4915
4916
4917
4918
4919
4920
4921
4922
4923
4924
4925
4926
4927
4928
4929
4930
4931
4932
4933
4934
4935
4936
4937
4938
4939
4940
4941
4942
4943
4944
4945
4946
4947
4948
4949
4950
4951
4952
4953
4954
4955
4956
4957
4958
4959
4960
4961
4962
4963
4964
4965
4966
4967
4968
4969
4970
4971
4972
4973
4974
4975
4976
4977
4978
4979
4980
4981
4982
4983
4984
4985
4986
4987
4988
4989
4990
4991
4992
4993
4994
4995
4996
4997
4998
4999
5000
5001
5002
5003
5004
5005
5006
5007
5008
5009
5010
5011
5012
5013
5014
5015
5016
5017
5018
5019
5020
5021
5022
5023
5024
5025
5026
5027
5028
5029
5030
5031
5032
5033
5034
5035
5036
5037
5038
5039
5040
5041
5042
5043
5044
5045
5046
5047
5048
5049
5050
5051
5052
5053
5054
5055
5056
5057
5058
5059
5060
5061
5062
5063
5064
5065
5066
5067
5068
5069
5070
5071
5072
5073
5074
5075
5076
5077
5078
5079
5080
5081
5082
5083
5084
5085
5086
5087
5088
5089
5090
5091
5092
5093
5094
5095
5096
5097
5098
5099
5100
5101
5102
5103
5104
5105
5106
5107
5108
5109
5110
5111
5112
5113
5114
5115
5116
5117
5118
5119
5120
5121
5122
5123
5124
5125
5126
5127
5128
5129
5130
5131
5132
5133
5134
5135
5136
5137
5138
5139
5140
5141
5142
5143
5144
5145
5146
5147
5148
5149
5150
5151
5152
5153
5154
5155
5156
5157
5158
5159
5160
5161
5162
5163
5164
5165
5166
5167
5168
5169
5170
5171
5172
5173
5174
5175
5176
5177
5178
5179
5180
5181
5182
5183
5184
5185
5186
5187
5188
5189
5190
5191
5192
5193
5194
5195
5196
5197
5198
5199
5200
5201
5202
5203
5204
5205
5206
5207
5208
5209
5210
5211
5212
5213
5214
5215
5216
5217
5218
5219
5220
5221
5222
5223
5224
5225
5226
5227
5228
5229
5230
5231
5232
5233
5234
5235
5236
5237
5238
5239
5240
5241
5242
5243
5244
5245
5246
5247
5248
5249
5250
5251
5252
5253
5254
5255
5256
5257
5258
5259
5260
5261
5262
5263
5264
5265
5266
5267
5268
5269
5270
5271
5272
5273
5274
5275
5276
5277
5278
5279
5280
5281
5282
5283
5284
5285
5286
5287
5288
5289
5290
5291
5292
5293
5294
5295
5296
5297
5298
5299
5300
5301
5302
5303
5304
5305
5306
5307
5308
5309
5310
5311
5312
5313
5314
5315
5316
5317
5318
5319
5320
5321
5322
5323
5324
5325
5326
5327
5328
5329
5330
5331
5332
5333
5334
5335
5336
5337
5338
5339
5340
5341
5342
5343
5344
5345
5346
5347
5348
5349
5350
5351
5352
5353
5354
5355
5356
5357
5358
5359
5360
5361
5362
5363
5364
5365
5366
5367
5368
5369
5370
5371
5372
5373
5374
5375
5376
5377
5378
5379
5380
5381
5382
5383
5384
5385
5386
5387
5388
5389
5390
5391
5392
5393
5394
5395
5396
5397
5398
5399
5400
5401
5402
5403
5404
5405
5406
5407
5408
5409
5410
5411
5412
5413
5414
5415
5416
5417
5418
5419
5420
5421
5422
5423
5424
5425
5426
5427
5428
5429
5430
5431
5432
5433
5434
5435
5436
5437
5438
5439
5440
5441
5442
5443
5444
5445
5446
5447
5448
5449
5450
5451
5452
5453
5454
5455
5456
5457
5458
5459
5460
5461
5462
5463
5464
5465
5466
5467
5468
5469
5470
5471
5472
5473
5474
5475
5476
5477
5478
5479
5480
5481
5482
5483
5484
5485
5486
5487
5488
5489
5490
5491
5492
5493
5494
5495
5496
5497
5498
5499
5500
5501
5502
5503
5504
5505
5506
5507
5508
5509
5510
5511
5512
5513
5514
5515
5516
5517
5518
5519
5520
5521
5522
5523
5524
5525
5526
5527
5528
5529
5530
5531
5532
5533
5534
5535
5536
5537
5538
5539
5540
5541
5542
5543
5544
5545
5546
5547
5548
5549
5550
5551
5552
5553
5554
5555
5556
5557
5558
5559
5560
5561
5562
5563
5564
5565
5566
5567
5568
5569
5570
5571
5572
5573
5574
5575
5576
5577
5578
5579
5580
5581
5582
5583
5584
5585
5586
5587
5588
5589
5590
5591
5592
5593
5594
5595
5596
5597
5598
5599
5600
5601
5602
5603
5604
5605
5606
5607
5608
5609
5610
5611
5612
5613
5614
5615
5616
5617
5618
5619
5620
5621
5622
5623
5624
5625
5626
5627
5628
5629
5630
5631
5632
5633
5634
5635
5636
5637
5638
5639
5640
5641
5642
5643
5644
5645
5646
5647
5648
5649
5650
5651
5652
5653
5654
5655
5656
5657
5658
5659
5660
5661
5662
5663
5664
5665
5666
5667
5668
5669
5670
5671
5672
5673
5674
5675
5676
5677
5678
5679
5680
5681
5682
5683
5684
5685
5686
5687
5688
5689
5690
5691
5692
5693
5694
5695
5696
5697
5698
5699
5700
5701
5702
5703
5704
5705
5706
5707
5708
5709
5710
5711
5712
5713
5714
5715
5716
5717
5718
5719
5720
5721
5722
5723
5724
5725
5726
5727
5728
5729
5730
5731
5732
5733
5734
5735
5736
5737
5738
5739
5740
5741
5742
5743
5744
5745
5746
5747
5748
5749
5750
5751
5752
5753
5754
5755
5756
5757
5758
5759
5760
5761
5762
5763
5764
5765
5766
5767
5768
5769
5770
5771
5772
5773
5774
5775
5776
5777
5778
5779
5780
5781
5782
5783
5784
5785
5786
5787
5788
5789
5790
5791
5792
5793
5794
5795
5796
5797
5798
5799
5800
5801
5802
5803
5804
5805
5806
5807
5808
5809
5810
5811
5812
5813
5814
5815
5816
5817
5818
5819
5820
5821
5822
5823
5824
5825
5826
5827
5828
5829
5830
5831
5832
5833
5834
5835
5836
5837
5838
5839
5840
5841
5842
5843
5844
5845
5846
5847
5848
5849
5850
5851
5852
5853
5854
5855
5856
5857
5858
5859
5860
5861
5862
5863
5864
5865
5866
5867
5868
5869
5870
5871
5872
5873
5874
5875
5876
5877
5878
5879
5880
5881
5882
5883
5884
5885
5886
5887
5888
5889
5890
5891
5892
5893
5894
5895
5896
5897
5898
5899
5900
5901
5902
5903
5904
5905
5906
5907
5908
5909
5910
5911
5912
5913
5914
5915
5916
5917
5918
5919
5920
5921
5922
5923
5924
5925
5926
5927
5928
5929
5930
5931
5932
5933
5934
5935
5936
5937
5938
5939
5940
5941
5942
5943
5944
5945
5946
5947
5948
5949
5950
5951
5952
5953
5954
5955
5956
5957
5958
5959
5960
5961
5962
5963
5964
5965
5966
5967
5968
5969
5970
5971
5972
5973
5974
5975
5976
5977
5978
5979
5980
5981
5982
5983
5984
5985
5986
5987
5988
5989
5990
5991
5992
5993
5994
5995
5996
5997
5998
5999
6000
6001
6002
6003
6004
6005
6006
6007
6008
6009
6010
6011
6012
6013
6014
6015
6016
6017
6018
6019
6020
6021
6022
6023
6024
6025
6026
6027
6028
6029
6030
6031
6032
6033
6034
6035
6036
6037
6038
6039
6040
6041
6042
6043
6044
6045
6046
6047
6048
6049
6050
6051
6052
6053
6054
6055
6056
6057
6058
6059
6060
6061
6062
6063
6064
6065
6066
6067
6068
6069
6070
6071
6072
6073
6074
6075
6076
6077
6078
6079
6080
6081
6082
6083
6084
6085
6086
6087
6088
6089
6090
6091
6092
6093
6094
6095
6096
6097
6098
6099
6100
6101
6102
6103
6104
6105
6106
6107
6108
6109
6110
6111
6112
6113
6114
6115
6116
6117
6118
6119
6120
6121
6122
6123
6124
6125
6126
6127
6128
6129
6130
6131
6132
6133
6134
6135
6136
6137
6138
6139
6140
6141
6142
6143
6144
6145
6146
6147
6148
6149
6150
6151
6152
6153
6154
6155
6156
6157
6158
6159
6160
6161
6162
6163
6164
6165
6166
6167
6168
6169
6170
6171
6172
6173
6174
6175
6176
6177
6178
6179
6180
6181
6182
6183
6184
6185
6186
6187
6188
6189
6190
6191
6192
6193
6194
6195
6196
6197
6198
6199
6200
6201
6202
6203
6204
6205
6206
6207
6208
6209
6210
6211
6212
6213
6214
6215
6216
6217
6218
6219
6220
6221
6222
6223
6224
6225
6226
6227
6228
6229
6230
6231
6232
6233
6234
6235
6236
6237
6238
6239
6240
6241
6242
6243
6244
6245
6246
6247
6248
6249
6250
6251
6252
6253
6254
6255
6256
6257
6258
6259
6260
6261
6262
6263
6264
6265
6266
6267
6268
6269
6270
6271
6272
6273
6274
6275
6276
6277
6278
6279
6280
6281
6282
6283
6284
6285
6286
6287
6288
6289
6290
6291
6292
6293
6294
6295
6296
6297
6298
6299
6300
6301
6302
6303
6304
6305
6306
6307
6308
6309
6310
6311
6312
6313
6314
6315
6316
6317
6318
6319
6320
6321
6322
6323
6324
6325
6326
6327
6328
6329
6330
6331
6332
6333
6334
6335
6336
6337
6338
6339
6340
6341
6342
6343
6344
6345
6346
6347
6348
6349
6350
6351
6352
6353
6354
6355
6356
6357
6358
6359
6360
6361
6362
6363
6364
6365
6366
6367
6368
6369
6370
6371
6372
6373
6374
6375
6376
6377
6378
6379
6380
6381
6382
6383
6384
6385
6386
6387
6388
6389
6390
6391
6392
6393
6394
6395
6396
6397
6398
6399
6400
6401
6402
6403
6404
6405
6406
6407
6408
6409
6410
6411
6412
6413
6414
6415
6416
6417
6418
6419
6420
6421
6422
6423
6424
6425
6426
6427
6428
6429
6430
6431
6432
6433
6434
6435
6436
6437
6438
6439
6440
6441
6442
6443
6444
6445
6446
6447
6448
6449
6450
6451
6452
6453
6454
6455
6456
6457
6458
6459
6460
6461
6462
6463
6464
6465
6466
6467
6468
6469
6470
6471
6472
6473
6474
6475
6476
6477
6478
6479
6480
6481
6482
6483
6484
6485
6486
6487
6488
6489
6490
6491
6492
6493
6494
6495
6496
6497
6498
6499
6500
6501
6502
6503
6504
6505
6506
6507
6508
6509
6510
6511
6512
6513
6514
6515
6516
6517
6518
6519
6520
6521
6522
6523
6524
6525
6526
6527
6528
6529
6530
6531
6532
6533
6534
6535
6536
6537
6538
6539
6540
6541
6542
6543
6544
6545
6546
6547
6548
6549
6550
6551
6552
6553
6554
6555
6556
6557
6558
6559
6560
6561
6562
6563
6564
6565
6566
6567
6568
6569
6570
6571
6572
6573
6574
6575
6576
6577
6578
6579
6580
6581
6582
6583
6584
6585
6586
6587
6588
6589
6590
6591
6592
6593
6594
6595
6596
6597
6598
6599
6600
6601
6602
6603
6604
6605
6606
6607
6608
6609
6610
6611
6612
6613
6614
6615
6616
6617
6618
6619
6620
6621
6622
6623
6624
6625
6626
6627
6628
6629
6630
6631
6632
6633
6634
6635
6636
6637
6638
6639
6640
6641
6642
6643
6644
6645
6646
6647
6648
6649
6650
6651
6652
6653
6654
6655
6656
6657
6658
6659
6660
6661
6662
6663
6664
6665
6666
6667
6668
6669
6670
6671
6672
6673
6674
6675
6676
6677
6678
6679
6680
6681
6682
6683
6684
6685
6686
6687
6688
6689
6690
6691
6692
6693
6694
6695
6696
6697
6698
6699
6700
6701
6702
6703
6704
6705
6706
6707
6708
6709
6710
6711
6712
6713
6714
6715
6716
6717
6718
6719
6720
6721
6722
6723
6724
6725
6726
6727
6728
6729
6730
6731
6732
6733
6734
6735
6736
6737
6738
6739
6740
6741
6742
6743
6744
6745
6746
6747
6748
6749
6750
6751
6752
6753
6754
6755
6756
6757
6758
6759
6760
6761
6762
6763
6764
6765
6766
6767
6768
6769
6770
6771
6772
6773
6774
6775
6776
6777
6778
6779
6780
6781
6782
6783
6784
6785
6786
6787
6788
6789
6790
6791
6792
6793
6794
6795
6796
6797
6798
6799
6800
6801
6802
6803
6804
6805
6806
6807
6808
6809
6810
6811
6812
6813
6814
6815
6816
6817
6818
6819
6820
6821
6822
6823
6824
6825
6826
6827
6828
6829
6830
6831
6832
6833
6834
6835
6836
6837
6838
6839
6840
6841
6842
6843
6844
6845
6846
6847
6848
6849
6850
6851
6852
6853
6854
6855
6856
6857
6858
6859
6860
6861
6862
6863
6864
6865
6866
6867
6868
6869
6870
6871
6872
6873
6874
6875
6876
6877
6878
6879
6880
6881
6882
6883
6884
6885
6886
6887
6888
6889
6890
6891
6892
6893
6894
6895
6896
6897
6898
6899
6900
6901
6902
6903
6904
6905
6906
6907
6908
6909
6910
6911
6912
6913
6914
6915
6916
6917
6918
6919
6920
6921
6922
6923
6924
6925
6926
6927
6928
6929
6930
6931
6932
6933
6934
6935
6936
6937
6938
6939
6940
6941
6942
6943
6944
6945
6946
6947
6948
6949
6950
6951
6952
6953
6954
6955
6956
6957
6958
6959
6960
6961
6962
6963
6964
6965
6966
6967
6968
6969
6970
6971
6972
6973
6974
6975
6976
6977
6978
6979
6980
6981
6982
6983
6984
6985
6986
6987
6988
6989
6990
6991
6992
6993
6994
6995
6996
6997
6998
6999
7000
7001
7002
7003
7004
7005
7006
7007
7008
7009
7010
7011
7012
7013
7014
7015
7016
7017
7018
7019
7020
7021
7022
7023
7024
7025
7026
7027
7028
7029
7030
7031
7032
7033
7034
7035
7036
7037
7038
7039
7040
7041
7042
7043
7044
7045
7046
7047
7048
7049
7050
7051
7052
7053
7054
7055
7056
7057
7058
7059
7060
7061
7062
7063
7064
7065
7066
7067
7068
7069
7070
7071
7072
7073
7074
7075
7076
7077
7078
7079
7080
7081
7082
7083
7084
7085
7086
7087
7088
7089
7090
7091
7092
7093
7094
7095
7096
7097
7098
7099
7100
7101
7102
7103
7104
7105
7106
7107
7108
7109
7110
7111
7112
7113
7114
7115
7116
7117
7118
7119
7120
7121
7122
7123
7124
7125
7126
7127
7128
7129
7130
7131
7132
7133
7134
7135
7136
7137
7138
7139
7140
7141
7142
7143
7144
7145
7146
7147
7148
7149
7150
7151
7152
7153
7154
7155
7156
7157
7158
7159
7160
7161
7162
7163
7164
7165
7166
7167
7168
7169
7170
7171
7172
7173
7174
7175
7176
7177
7178
7179
7180
7181
7182
7183
7184
7185
7186
7187
7188
7189
7190
7191
7192
7193
7194
7195
7196
7197
7198
7199
7200
7201
7202
7203
7204
7205
7206
7207
7208
7209
7210
7211
7212
7213
7214
7215
7216
7217
7218
7219
7220
7221
7222
7223
7224
7225
7226
7227
7228
7229
7230
7231
7232
7233
7234
7235
7236
7237
7238
7239
7240
7241
7242
7243
7244
7245
7246
7247
7248
7249
7250
7251
7252
7253
7254
7255
7256
7257
7258
7259
7260
7261
7262
7263
7264
7265
7266
7267
7268
7269
7270
7271
7272
7273
7274
7275
7276
7277
7278
7279
7280
7281
7282
7283
7284
7285
7286
7287
7288
7289
7290
7291
7292
7293
7294
7295
7296
7297
7298
7299
7300
7301
7302
7303
7304
7305
7306
7307
7308
7309
7310
7311
7312
7313
7314
7315
7316
7317
7318
7319
7320
7321
7322
7323
7324
7325
7326
7327
7328
7329
7330
7331
7332
7333
7334
7335
7336
7337
7338
7339
7340
7341
7342
7343
7344
7345
7346
7347
7348
7349
7350
7351
7352
7353
7354
7355
7356
7357
7358
7359
7360
7361
7362
7363
7364
7365
7366
7367
7368
7369
7370
7371
7372
7373
7374
7375
7376
7377
7378
7379
7380
7381
7382
7383
7384
7385
7386
7387
7388
7389
7390
7391
7392
7393
7394
7395
7396
7397
7398
7399
7400
7401
7402
7403
7404
7405
7406
7407
7408
7409
7410
7411
7412
7413
7414
7415
7416
7417
7418
7419
7420
7421
7422
7423
7424
7425
7426
7427
7428
7429
7430
7431
7432
7433
7434
7435
7436
7437
7438
7439
7440
7441
7442
7443
7444
7445
7446
7447
7448
7449
7450
7451
7452
7453
7454
7455
7456
7457
7458
7459
7460
7461
7462
7463
7464
7465
7466
7467
7468
7469
7470
7471
7472
7473
7474
7475
7476
7477
7478
7479
7480
7481
7482
7483
7484
7485
7486
7487
7488
7489
7490
7491
7492
7493
7494
7495
7496
7497
7498
7499
7500
7501
7502
7503
7504
7505
7506
7507
7508
7509
7510
7511
7512
7513
7514
7515
7516
7517
7518
7519
7520
7521
7522
7523
7524
7525
7526
7527
7528
7529
7530
7531
7532
7533
7534
7535
7536
7537
7538
7539
7540
7541
7542
7543
7544
7545
7546
7547
7548
7549
7550
7551
7552
7553
7554
7555
7556
7557
7558
7559
7560
7561
7562
7563
7564
7565
7566
7567
7568
7569
7570
7571
7572
7573
7574
7575
7576
7577
7578
7579
7580
7581
7582
7583
7584
7585
7586
7587
7588
7589
7590
7591
7592
7593
7594
7595
7596
7597
7598
7599
7600
7601
7602
7603
7604
7605
7606
7607
7608
7609
7610
7611
7612
7613
7614
7615
7616
7617
7618
7619
7620
7621
7622
7623
7624
7625
7626
7627
7628
7629
7630
7631
7632
7633
7634
7635
7636
7637
7638
7639
7640
7641
7642
7643
7644
7645
7646
7647
7648
7649
7650
7651
7652
7653
7654
7655
7656
7657
7658
7659
7660
7661
7662
7663
7664
7665
7666
7667
7668
7669
7670
7671
7672
7673
7674
7675
7676
7677
7678
7679
7680
7681
7682
7683
7684
7685
7686
7687
7688
7689
7690
7691
7692
7693
7694
7695
7696
7697
7698
7699
7700
7701
7702
7703
7704
7705
7706
7707
7708
7709
7710
7711
7712
7713
7714
7715
7716
7717
7718
7719
7720
7721
7722
7723
7724
7725
7726
7727
7728
7729
7730
7731
7732
7733
7734
7735
7736
7737
7738
7739
7740
7741
7742
7743
7744
7745
7746
7747
7748
7749
7750
7751
7752
7753
7754
7755
7756
7757
7758
7759
7760
7761
7762
7763
7764
7765
7766
7767
7768
7769
7770
7771
7772
7773
7774
7775
7776
7777
7778
7779
7780
7781
7782
7783
7784
7785
7786
7787
7788
7789
7790
7791
7792
7793
7794
7795
7796
7797
7798
7799
7800
7801
7802
7803
7804
7805
7806
7807
7808
7809
7810
7811
7812
7813
7814
7815
7816
7817
7818
7819
7820
7821
7822
7823
7824
7825
7826
7827
7828
7829
7830
7831
7832
7833
7834
7835
7836
7837
7838
7839
7840
7841
7842
7843
7844
7845
7846
7847
7848
7849
7850
7851
7852
7853
7854
7855
7856
7857
7858
7859
7860
7861
7862
7863
7864
7865
7866
7867
7868
7869
7870
7871
7872
7873
7874
7875
7876
7877
7878
7879
7880
7881
7882
7883
7884
7885
7886
7887
7888
7889
7890
7891
7892
7893
7894
7895
7896
7897
7898
7899
7900
7901
7902
7903
7904
7905
7906
7907
7908
7909
7910
7911
7912
7913
7914
7915
7916
7917
7918
7919
7920
7921
7922
7923
7924
7925
7926
7927
7928
7929
7930
7931
7932
7933
7934
7935
7936
7937
7938
7939
7940
7941
7942
7943
7944
7945
7946
7947
7948
7949
7950
7951
7952
7953
7954
7955
7956
7957
7958
7959
7960
7961
7962
7963
7964
7965
7966
7967
7968
7969
7970
7971
7972
7973
7974
7975
7976
7977
7978
7979
7980
7981
7982
7983
7984
7985
7986
7987
7988
7989
7990
7991
7992
7993
7994
7995
7996
7997
7998
7999
8000
8001
8002
8003
8004
8005
8006
8007
8008
8009
8010
8011
8012
8013
8014
8015
8016
8017
8018
8019
8020
8021
8022
8023
8024
8025
8026
8027
8028
8029
8030
8031
8032
8033
8034
8035
8036
8037
8038
8039
8040
8041
8042
8043
8044
8045
8046
8047
8048
8049
8050
8051
8052
8053
8054
8055
8056
8057
8058
8059
8060
8061
8062
8063
8064
8065
8066
8067
8068
8069
8070
8071
8072
8073
8074
8075
8076
8077
8078
8079
8080
8081
8082
8083
8084
8085
8086
8087
8088
8089
8090
8091
8092
8093
8094
8095
8096
8097
8098
8099
8100
8101
8102
8103
8104
8105
8106
8107
8108
8109
8110
8111
8112
8113
8114
8115
8116
8117
8118
8119
8120
8121
8122
8123
8124
8125
8126
8127
8128
8129
8130
8131
8132
8133
8134
8135
8136
8137
8138
8139
8140
8141
8142
8143
8144
8145
8146
8147
8148
8149
8150
8151
8152
8153
8154
8155
8156
8157
8158
8159
8160
8161
8162
8163
8164
8165
8166
8167
8168
8169
8170
8171
8172
8173
8174
8175
8176
8177
8178
8179
8180
8181
8182
8183
8184
8185
8186
8187
8188
8189
8190
8191
8192
8193
8194
8195
8196
8197
8198
8199
8200
8201
8202
8203
8204
8205
8206
8207
8208
8209
8210
8211
8212
8213
8214
8215
8216
8217
8218
8219
8220
8221
8222
8223
8224
8225
8226
8227
8228
8229
8230
8231
8232
8233
8234
8235
8236
8237
8238
8239
8240
8241
8242
8243
8244
8245
8246
8247
8248
8249
8250
8251
8252
8253
8254
8255
8256
8257
8258
8259
8260
8261
8262
8263
8264
8265
8266
8267
8268
8269
8270
8271
8272
8273
8274
8275
8276
8277
8278
8279
8280
8281
8282
8283
8284
8285
8286
8287
8288
8289
8290
8291
8292
8293
8294
8295
8296
8297
8298
8299
8300
8301
8302
8303
8304
8305
8306
8307
8308
8309
8310
8311
8312
8313
8314
8315
8316
8317
8318
8319
8320
8321
8322
8323
8324
8325
8326
8327
8328
8329
8330
8331
8332
8333
8334
8335
8336
8337
8338
8339
8340
8341
8342
8343
8344
8345
8346
8347
8348
8349
8350
8351
8352
8353
8354
8355
8356
8357
8358
8359
8360
8361
8362
8363
8364
8365
8366
8367
8368
8369
8370
8371
8372
8373
8374
8375
8376
8377
8378
8379
8380
8381
8382
8383
8384
8385
8386
8387
8388
8389
8390
8391
8392
8393
8394
8395
8396
8397
8398
8399
8400
8401
8402
8403
8404
8405
8406
8407
8408
8409
8410
8411
8412
8413
8414
8415
8416
8417
8418
8419
8420
8421
8422
8423
8424
8425
8426
8427
8428
8429
8430
8431
8432
8433
8434
8435
8436
8437
8438
8439
8440
8441
8442
8443
8444
8445
8446
8447
8448
8449
8450
8451
8452
8453
8454
8455
8456
8457
8458
8459
8460
8461
8462
8463
8464
8465
8466
8467
8468
8469
8470
8471
8472
8473
8474
8475
8476
8477
8478
8479
8480
8481
8482
8483
8484
8485
8486
8487
8488
8489
8490
8491
8492
8493
8494
8495
8496
8497
8498
8499
8500
8501
8502
8503
8504
8505
8506
8507
8508
8509
8510
8511
8512
8513
8514
8515
8516
8517
8518
8519
8520
8521
8522
8523
8524
8525
8526
8527
8528
8529
8530
8531
8532
8533
8534
8535
8536
8537
8538
8539
8540
8541
8542
8543
8544
8545
8546
8547
8548
8549
8550
8551
8552
8553
8554
8555
8556
8557
8558
8559
8560
8561
8562
8563
8564
8565
8566
8567
8568
8569
8570
8571
8572
8573
8574
8575
8576
8577
8578
8579
8580
8581
8582
8583
8584
8585
8586
8587
8588
8589
8590
8591
8592
8593
8594
8595
8596
8597
8598
8599
8600
8601
8602
8603
8604
8605
8606
8607
8608
8609
8610
8611
8612
8613
8614
8615
8616
8617
8618
8619
8620
8621
8622
8623
8624
8625
8626
8627
8628
8629
8630
8631
8632
8633
8634
8635
8636
8637
8638
8639
8640
8641
8642
8643
8644
8645
8646
8647
8648
8649
8650
8651
8652
8653
8654
8655
8656
8657
8658
8659
8660
8661
8662
8663
8664
8665
8666
8667
8668
8669
8670
8671
8672
8673
8674
8675
8676
8677
8678
8679
8680
8681
8682
8683
8684
8685
8686
8687
8688
8689
8690
8691
8692
8693
8694
8695
8696
8697
8698
8699
8700
8701
8702
8703
8704
8705
8706
8707
8708
8709
8710
8711
8712
8713
8714
8715
8716
8717
8718
8719
8720
8721
8722
8723
8724
8725
8726
8727
8728
8729
8730
8731
8732
8733
8734
8735
8736
8737
8738
8739
8740
8741
8742
8743
8744
8745
8746
8747
8748
8749
8750
8751
8752
8753
8754
8755
8756
8757
8758
8759
8760
8761
8762
8763
8764
8765
8766
8767
8768
8769
8770
8771
8772
8773
8774
8775
8776
8777
8778
8779
8780
8781
8782
8783
8784
8785
8786
8787
8788
8789
8790
8791
8792
8793
8794
8795
8796
8797
8798
8799
8800
8801
8802
8803
8804
8805
8806
8807
8808
8809
8810
8811
8812
8813
8814
8815
8816
8817
8818
8819
8820
8821
8822
8823
8824
8825
8826
8827
8828
8829
8830
8831
8832
8833
8834
8835
8836
8837
8838
8839
8840
8841
8842
8843
8844
8845
8846
8847
8848
8849
8850
8851
8852
8853
8854
8855
8856
8857
8858
8859
8860
8861
8862
8863
8864
8865
8866
8867
8868
8869
8870
8871
8872
8873
8874
8875
8876
8877
8878
8879
8880
8881
8882
8883
8884
8885
8886
8887
8888
8889
8890
8891
8892
8893
8894
8895
8896
8897
8898
8899
8900
8901
8902
8903
8904
8905
8906
8907
8908
8909
8910
8911
8912
8913
8914
8915
8916
8917
8918
8919
8920
8921
8922
8923
8924
8925
8926
8927
8928
8929
8930
8931
8932
8933
8934
8935
8936
8937
8938
8939
8940
8941
8942
8943
8944
8945
8946
8947
8948
8949
8950
8951
8952
8953
8954
8955
8956
8957
8958
8959
8960
8961
8962
8963
8964
8965
8966
8967
8968
8969
8970
8971
8972
8973
8974
8975
8976
8977
8978
8979
8980
8981
8982
8983
8984
8985
8986
8987
8988
8989
8990
8991
8992
8993
8994
8995
8996
8997
8998
8999
9000
9001
9002
9003
9004
9005
9006
9007
9008
9009
9010
9011
9012
9013
9014
9015
9016
9017
9018
9019
9020
9021
9022
9023
9024
9025
9026
9027
9028
9029
9030
9031
9032
9033
9034
9035
9036
9037
9038
9039
9040
9041
9042
9043
9044
9045
9046
9047
9048
9049
9050
9051
9052
9053
9054
9055
9056
9057
9058
9059
9060
9061
9062
9063
9064
9065
9066
9067
9068
9069
9070
9071
9072
9073
9074
9075
9076
9077
9078
9079
9080
9081
9082
9083
9084
9085
9086
9087
9088
9089
9090
9091
9092
9093
9094
9095
9096
9097
9098
9099
9100
9101
9102
9103
9104
9105
9106
9107
9108
9109
9110
9111
9112
9113
9114
9115
9116
9117
9118
9119
9120
9121
9122
9123
9124
9125
9126
9127
9128
9129
9130
9131
9132
9133
9134
9135
9136
9137
9138
9139
9140
9141
9142
9143
9144
9145
9146
9147
9148
9149
9150
9151
9152
9153
9154
9155
9156
9157
9158
9159
9160
9161
9162
9163
9164
9165
9166
9167
9168
9169
9170
9171
9172
9173
9174
9175
9176
9177
9178
9179
9180
9181
9182
9183
9184
9185
9186
9187
9188
9189
9190
9191
9192
9193
9194
9195
9196
9197
9198
9199
9200
9201
9202
9203
9204
9205
9206
9207
9208
9209
9210
9211
9212
9213
9214
9215
9216
9217
9218
9219
9220
9221
9222
9223
9224
9225
9226
9227
9228
9229
9230
9231
9232
9233
9234
9235
9236
9237
9238
9239
9240
9241
9242
9243
9244
9245
9246
9247
9248
9249
9250
9251
9252
9253
9254
9255
9256
9257
9258
9259
9260
9261
9262
9263
9264
9265
9266
9267
9268
9269
9270
9271
9272
9273
9274
9275
9276
9277
9278
9279
9280
9281
9282
9283
9284
9285
9286
9287
9288
9289
9290
9291
9292
9293
9294
9295
9296
9297
9298
9299
9300
9301
9302
9303
9304
9305
9306
9307
9308
9309
9310
9311
9312
9313
9314
9315
9316
9317
9318
9319
9320
9321
9322
9323
9324
9325
9326
9327
9328
9329
9330
9331
9332
9333
9334
9335
9336
9337
9338
9339
9340
9341
9342
9343
9344
9345
9346
9347
9348
9349
9350
9351
9352
9353
9354
9355
9356
9357
9358
9359
9360
9361
9362
9363
9364
9365
9366
9367
9368
9369
9370
9371
9372
9373
9374
9375
9376
9377
9378
9379
9380
9381
9382
9383
9384
9385
9386
9387
9388
9389
9390
9391
9392
9393
9394
9395
9396
9397
9398
9399
9400
9401
9402
9403
9404
9405
9406
9407
9408
9409
9410
9411
9412
9413
9414
9415
9416
9417
9418
9419
9420
9421
9422
9423
9424
9425
9426
9427
9428
9429
9430
9431
9432
9433
9434
9435
9436
9437
9438
9439
9440
9441
9442
9443
9444
9445
9446
9447
9448
9449
9450
9451
9452
9453
9454
9455
9456
9457
9458
9459
9460
9461
9462
9463
9464
9465
9466
9467
9468
9469
9470
9471
9472
9473
9474
9475
9476
9477
9478
9479
9480
9481
9482
9483
9484
9485
9486
9487
9488
9489
9490
9491
9492
9493
9494
9495
9496
9497
9498
9499
9500
9501
9502
9503
9504
9505
9506
9507
9508
9509
9510
9511
9512
9513
9514
9515
9516
9517
9518
9519
9520
9521
9522
9523
9524
9525
9526
9527
9528
9529
9530
9531
9532
9533
9534
9535
9536
9537
9538
9539
9540
9541
9542
9543
9544
9545
9546
9547
9548
9549
9550
9551
9552
9553
9554
9555
9556
9557
9558
9559
9560
9561
9562
9563
9564
9565
9566
9567
9568
9569
9570
9571
9572
9573
9574
9575
9576
9577
9578
9579
9580
9581
9582
9583
9584
9585
9586
9587
9588
9589
9590
9591
9592
9593
9594
9595
9596
9597
9598
9599
9600
9601
9602
9603
9604
9605
9606
9607
9608
9609
9610
9611
9612
9613
9614
9615
9616
9617
9618
9619
9620
9621
9622
9623
9624
9625
9626
9627
9628
9629
9630
9631
9632
9633
9634
9635
9636
9637
9638
9639
9640
9641
9642
9643
9644
9645
9646
9647
9648
9649
9650
9651
9652
9653
9654
9655
9656
9657
9658
9659
9660
9661
9662
9663
9664
9665
9666
9667
9668
9669
9670
9671
9672
9673
9674
9675
9676
9677
9678
9679
9680
9681
9682
9683
9684
9685
9686
9687
9688
9689
9690
9691
9692
9693
9694
9695
9696
9697
9698
9699
9700
9701
9702
9703
9704
9705
9706
9707
9708
9709
9710
9711
9712
9713
9714
9715
9716
9717
9718
9719
9720
9721
9722
9723
9724
9725
9726
9727
9728
9729
9730
9731
9732
9733
9734
9735
9736
9737
9738
9739
9740
9741
9742
9743
9744
9745
9746
9747
9748
9749
9750
9751
9752
9753
9754
9755
9756
9757
9758
9759
9760
9761
9762
9763
9764
9765
9766
9767
9768
9769
9770
9771
9772
9773
9774
9775
9776
9777
9778
9779
9780
9781
9782
9783
9784
9785
9786
9787
9788
9789
9790
9791
9792
9793
9794
9795
9796
9797
9798
9799
9800
9801
9802
9803
9804
9805
9806
9807
9808
9809
9810
9811
9812
9813
9814
9815
9816
9817
9818
9819
9820
9821
9822
9823
9824
9825
9826
9827
9828
9829
9830
9831
9832
9833
9834
9835
9836
9837
9838
9839
9840
9841
9842
9843
9844
9845
9846
9847
9848
9849
9850
9851
9852
9853
9854
9855
9856
9857
9858
9859
9860
9861
9862
9863
9864
9865
9866
9867
9868
9869
9870
9871
9872
9873
9874
9875
9876
9877
9878
9879
9880
9881
9882
9883
9884
9885
9886
9887
9888
9889
9890
9891
9892
9893
9894
9895
9896
9897
9898
9899
9900
9901
9902
9903
9904
9905
9906
9907
9908
9909
9910
9911
9912
9913
9914
9915
9916
9917
9918
9919
9920
9921
9922
9923
9924
9925
9926
9927
9928
9929
9930
9931
9932
9933
9934
9935
9936
9937
9938
9939
9940
9941
9942
9943
9944
9945
9946
9947
9948
9949
9950
9951
9952
9953
9954
9955
9956
9957
9958
9959
9960
9961
9962
9963
9964
9965
9966
9967
9968
9969
9970
9971
9972
9973
9974
9975
9976
9977
9978
9979
9980
9981
9982
9983
9984
9985
9986
9987
9988
9989
9990
9991
9992
9993
9994
9995
9996
9997
9998
9999
10000
10001
10002
10003
10004
10005
10006
10007
10008
10009
10010
10011
10012
10013
10014
10015
10016
10017
10018
10019
10020
10021
10022
10023
10024
10025
10026
10027
10028
10029
10030
10031
10032
10033
10034
10035
10036
10037
10038
10039
10040
10041
10042
10043
10044
10045
10046
10047
10048
10049
10050
10051
10052
10053
10054
10055
10056
10057
10058
10059
10060
10061
10062
10063
10064
10065
10066
10067
10068
10069
10070
10071
10072
10073
10074
10075
10076
10077
10078
10079
10080
10081
10082
10083
10084
10085
10086
10087
10088
10089
10090
10091
10092
10093
10094
10095
10096
10097
10098
10099
10100
10101
10102
10103
10104
10105
10106
10107
10108
10109
10110
10111
10112
10113
10114
10115
10116
10117
10118
10119
10120
10121
10122
10123
10124
10125
10126
10127
10128
10129
10130
10131
10132
10133
10134
10135
10136
10137
10138
10139
10140
10141
10142
10143
10144
10145
10146
10147
10148
10149
10150
10151
10152
10153
10154
10155
10156
10157
10158
10159
10160
10161
10162
10163
10164
10165
10166
10167
10168
10169
10170
10171
10172
10173
10174
10175
10176
10177
10178
10179
10180
10181
10182
10183
10184
10185
10186
10187
10188
10189
10190
10191
10192
10193
10194
10195
10196
10197
10198
10199
10200
10201
10202
10203
10204
10205
10206
10207
10208
10209
10210
10211
10212
10213
10214
10215
10216
10217
10218
10219
10220
10221
10222
10223
10224
10225
10226
10227
10228
10229
10230
10231
10232
10233
10234
10235
10236
10237
10238
10239
10240
10241
10242
10243
10244
10245
10246
10247
10248
10249
10250
10251
10252
10253
10254
10255
10256
10257
10258
10259
10260
10261
10262
10263
10264
10265
10266
10267
10268
10269
10270
10271
10272
10273
10274
10275
10276
10277
10278
10279
10280
10281
10282
10283
10284
10285
10286
10287
10288
10289
10290
10291
10292
10293
10294
10295
10296
10297
10298
10299
10300
10301
10302
10303
10304
10305
10306
10307
10308
10309
10310
10311
10312
10313
10314
10315
10316
10317
10318
10319
10320
10321
10322
10323
10324
10325
10326
10327
10328
10329
10330
10331
10332
10333
10334
10335
10336
10337
10338
10339
10340
10341
10342
10343
10344
10345
10346
10347
10348
10349
10350
10351
10352
10353
10354
10355
10356
10357
10358
10359
10360
10361
10362
10363
10364
10365
10366
10367
10368
10369
10370
10371
10372
10373
10374
10375
10376
10377
10378
10379
10380
10381
10382
10383
10384
10385
10386
10387
10388
10389
10390
10391
10392
10393
10394
10395
10396
10397
10398
10399
10400
10401
10402
10403
10404
10405
10406
10407
10408
10409
10410
10411
10412
10413
10414
10415
10416
10417
10418
10419
10420
10421
10422
10423
10424
10425
10426
10427
10428
10429
10430
10431
10432
10433
10434
10435
10436
10437
10438
10439
10440
10441
10442
10443
10444
10445
10446
10447
10448
10449
10450
10451
10452
10453
10454
10455
10456
10457
10458
10459
10460
10461
10462
10463
10464
10465
10466
10467
10468
10469
10470
10471
10472
10473
10474
10475
10476
10477
10478
10479
10480
10481
10482
10483
10484
10485
10486
10487
10488
10489
10490
10491
10492
10493
10494
10495
10496
10497
10498
10499
10500
10501
10502
10503
10504
10505
10506
10507
10508
10509
10510
10511
10512
10513
10514
10515
10516
10517
10518
10519
10520
10521
10522
10523
10524
10525
10526
10527
10528
10529
10530
10531
10532
10533
10534
10535
10536
10537
10538
10539
10540
10541
10542
10543
10544
10545
10546
10547
10548
10549
10550
10551
10552
10553
10554
10555
10556
10557
10558
10559
10560
10561
10562
10563
10564
10565
10566
10567
10568
10569
10570
10571
10572
10573
10574
10575
10576
10577
10578
10579
10580
10581
10582
10583
10584
10585
10586
10587
10588
10589
10590
10591
10592
10593
10594
10595
10596
10597
10598
10599
10600
10601
10602
10603
10604
10605
10606
10607
10608
10609
10610
10611
10612
10613
10614
10615
10616
10617
10618
10619
10620
10621
10622
10623
10624
10625
10626
10627
10628
10629
10630
10631
10632
10633
10634
10635
10636
10637
10638
10639
10640
10641
10642
10643
10644
10645
10646
10647
10648
10649
10650
10651
10652
10653
10654
10655
10656
10657
10658
10659
10660
10661
10662
10663
10664
10665
10666
10667
10668
10669
10670
10671
10672
10673
10674
10675
10676
10677
10678
10679
10680
10681
10682
10683
10684
10685
10686
10687
10688
10689
10690
10691
10692
10693
10694
10695
10696
10697
10698
10699
10700
10701
10702
10703
10704
10705
10706
10707
10708
10709
10710
10711
10712
10713
10714
10715
10716
10717
10718
10719
10720
10721
10722
10723
10724
10725
10726
10727
10728
10729
10730
10731
10732
10733
10734
10735
10736
10737
10738
10739
10740
10741
10742
10743
10744
10745
10746
10747
10748
10749
10750
10751
10752
10753
10754
10755
10756
10757
10758
10759
10760
10761
10762
10763
10764
10765
10766
10767
10768
10769
10770
10771
10772
10773
10774
10775
10776
10777
10778
10779
10780
10781
10782
10783
10784
10785
10786
10787
10788
10789
10790
10791
10792
10793
10794
10795
10796
10797
10798
10799
10800
10801
10802
10803
10804
10805
10806
10807
10808
10809
10810
10811
10812
10813
10814
10815
10816
10817
10818
10819
10820
10821
10822
10823
10824
10825
10826
10827
10828
10829
10830
10831
10832
10833
10834
10835
10836
10837
10838
10839
10840
10841
10842
10843
10844
10845
10846
10847
10848
10849
10850
10851
10852
10853
10854
10855
10856
10857
10858
10859
10860
10861
10862
10863
10864
10865
10866
10867
10868
10869
10870
10871
10872
10873
10874
10875
10876
10877
10878
10879
10880
10881
10882
10883
10884
10885
10886
10887
10888
10889
10890
10891
10892
10893
10894
10895
10896
10897
10898
10899
10900
10901
10902
10903
10904
10905
10906
10907
10908
10909
10910
10911
10912
10913
10914
10915
10916
10917
10918
10919
10920
10921
10922
10923
10924
10925
10926
10927
10928
10929
10930
10931
10932
10933
10934
10935
10936
10937
10938
10939
10940
10941
10942
10943
10944
10945
10946
10947
10948
10949
10950
10951
10952
10953
10954
10955
10956
10957
10958
10959
10960
10961
10962
10963
10964
10965
10966
10967
10968
10969
10970
10971
10972
10973
10974
10975
10976
10977
10978
10979
10980
10981
10982
10983
10984
10985
10986
10987
10988
10989
10990
10991
10992
10993
10994
10995
10996
10997
10998
10999
11000
11001
11002
11003
11004
11005
11006
11007
11008
11009
11010
11011
11012
11013
11014
11015
11016
11017
11018
11019
11020
11021
11022
11023
11024
11025
11026
11027
11028
11029
11030
11031
11032
11033
11034
11035
11036
11037
11038
11039
11040
11041
11042
11043
11044
11045
11046
11047
11048
11049
11050
11051
11052
11053
11054
11055
11056
11057
11058
11059
11060
11061
11062
11063
11064
11065
11066
11067
11068
11069
11070
11071
11072
11073
11074
11075
11076
11077
11078
11079
11080
11081
11082
11083
11084
11085
11086
11087
11088
11089
11090
11091
11092
11093
11094
11095
11096
11097
11098
11099
11100
11101
11102
11103
11104
11105
11106
11107
11108
11109
11110
11111
11112
11113
11114
11115
11116
11117
11118
11119
11120
11121
11122
11123
11124
11125
11126
11127
11128
11129
11130
11131
11132
11133
11134
11135
11136
11137
11138
11139
11140
11141
11142
11143
11144
11145
11146
11147
11148
11149
11150
11151
11152
11153
11154
11155
11156
11157
11158
11159
11160
11161
11162
11163
11164
11165
11166
11167
11168
11169
11170
11171
11172
11173
11174
11175
11176
11177
11178
11179
11180
11181
11182
11183
11184
11185
11186
11187
11188
11189
11190
11191
11192
11193
11194
11195
11196
11197
11198
11199
11200
11201
11202
11203
11204
11205
11206
11207
11208
11209
11210
11211
11212
11213
11214
11215
11216
11217
11218
11219
11220
11221
11222
11223
11224
11225
11226
11227
11228
11229
11230
11231
11232
11233
11234
11235
11236
11237
11238
11239
11240
11241
11242
11243
11244
11245
11246
11247
11248
11249
11250
11251
11252
11253
11254
11255
11256
11257
11258
11259
11260
11261
11262
11263
11264
11265
11266
11267
11268
11269
11270
11271
11272
11273
11274
11275
11276
11277
11278
11279
11280
11281
11282
11283
11284
11285
11286
11287
11288
11289
11290
11291
11292
11293
11294
11295
11296
11297
11298
11299
11300
11301
11302
11303
11304
11305
11306
11307
11308
11309
11310
11311
11312
11313
11314
11315
11316
11317
11318
11319
11320
11321
11322
11323
11324
11325
11326
11327
11328
11329
11330
11331
11332
11333
11334
11335
11336
11337
11338
11339
11340
11341
11342
11343
11344
11345
11346
11347
11348
11349
11350
11351
11352
11353
11354
11355
11356
11357
11358
11359
11360
11361
11362
11363
11364
11365
11366
11367
11368
11369
11370
11371
11372
11373
11374
11375
11376
11377
11378
11379
11380
11381
11382
11383
11384
11385
11386
11387
11388
11389
11390
11391
11392
11393
11394
11395
11396
11397
11398
11399
11400
11401
11402
11403
11404
11405
11406
11407
11408
11409
11410
11411
11412
11413
11414
11415
11416
11417
11418
11419
11420
11421
11422
11423
11424
11425
11426
11427
11428
11429
11430
11431
11432
11433
11434
11435
11436
11437
11438
11439
11440
11441
11442
11443
11444
11445
11446
11447
11448
11449
11450
11451
11452
11453
11454
11455
11456
11457
11458
11459
11460
11461
11462
11463
11464
11465
11466
11467
11468
11469
11470
11471
11472
11473
11474
11475
11476
11477
11478
11479
11480
11481
11482
11483
11484
11485
11486
11487
11488
11489
11490
11491
11492
11493
11494
11495
11496
11497
11498
11499
11500
11501
11502
11503
11504
11505
11506
11507
11508
11509
11510
11511
11512
11513
11514
11515
11516
11517
11518
11519
11520
11521
11522
11523
11524
11525
11526
11527
11528
11529
11530
11531
11532
11533
11534
11535
11536
11537
11538
11539
11540
11541
11542
11543
11544
11545
11546
11547
11548
11549
11550
11551
11552
11553
11554
11555
11556
11557
11558
11559
11560
11561
11562
11563
11564
11565
11566
11567
11568
11569
11570
11571
11572
11573
11574
11575
11576
11577
11578
11579
11580
11581
11582
11583
11584
11585
11586
11587
11588
11589
11590
11591
11592
11593
11594
11595
11596
11597
11598
11599
11600
11601
11602
11603
11604
11605
11606
11607
11608
11609
11610
11611
11612
11613
11614
11615
11616
11617
11618
11619
11620
11621
11622
11623
11624
11625
11626
11627
11628
11629
11630
11631
11632
11633
11634
11635
11636
11637
11638
11639
11640
11641
11642
11643
11644
11645
11646
11647
11648
11649
11650
11651
11652
11653
11654
11655
11656
11657
11658
11659
11660
11661
11662
11663
11664
11665
11666
11667
11668
11669
11670
11671
11672
11673
11674
11675
11676
11677
11678
11679
11680
11681
11682
11683
11684
11685
11686
11687
11688
11689
11690
11691
11692
11693
11694
11695
11696
11697
11698
11699
11700
11701
11702
11703
11704
11705
11706
11707
11708
11709
11710
11711
11712
11713
11714
11715
11716
11717
11718
11719
11720
11721
11722
11723
11724
11725
11726
11727
11728
11729
11730
11731
11732
11733
11734
11735
11736
11737
11738
11739
11740
11741
11742
11743
11744
11745
11746
11747
11748
11749
11750
11751
11752
11753
11754
11755
11756
11757
11758
11759
11760
11761
11762
11763
11764
11765
11766
11767
11768
11769
11770
11771
11772
11773
11774
11775
11776
11777
11778
11779
11780
11781
11782
11783
11784
11785
11786
11787
11788
11789
11790
11791
11792
11793
11794
11795
11796
11797
11798
11799
11800
11801
11802
11803
11804
11805
11806
11807
11808
11809
11810
11811
11812
11813
11814
11815
11816
11817
11818
11819
11820
11821
11822
11823
11824
11825
11826
11827
11828
11829
11830
11831
11832
11833
11834
11835
11836
11837
11838
11839
11840
11841
11842
11843
11844
11845
11846
11847
11848
11849
11850
11851
11852
11853
11854
11855
11856
11857
11858
11859
11860
11861
11862
11863
11864
11865
11866
11867
11868
11869
11870
11871
11872
11873
11874
11875
11876
11877
11878
11879
11880
11881
11882
11883
11884
11885
11886
11887
11888
11889
11890
11891
11892
11893
11894
11895
11896
11897
11898
11899
11900
11901
11902
11903
11904
11905
11906
11907
11908
11909
11910
11911
11912
11913
11914
11915
11916
11917
11918
11919
11920
11921
11922
11923
11924
11925
11926
11927
11928
11929
11930
11931
11932
11933
11934
11935
11936
11937
11938
11939
11940
11941
11942
11943
11944
11945
11946
11947
11948
11949
11950
11951
11952
11953
11954
11955
11956
11957
11958
11959
11960
11961
11962
11963
11964
11965
11966
11967
11968
11969
11970
11971
11972
11973
11974
11975
11976
11977
11978
11979
11980
11981
11982
11983
11984
11985
11986
11987
11988
11989
11990
11991
11992
11993
11994
11995
11996
11997
11998
11999
12000
12001
12002
12003
12004
12005
12006
12007
12008
12009
12010
12011
12012
12013
12014
12015
12016
12017
12018
12019
12020
12021
12022
12023
12024
12025
12026
12027
12028
12029
12030
12031
12032
12033
12034
12035
12036
12037
12038
12039
12040
12041
12042
12043
12044
12045
12046
12047
12048
12049
12050
12051
12052
12053
12054
12055
12056
12057
12058
12059
12060
12061
12062
12063
12064
12065
12066
12067
12068
12069
12070
12071
12072
12073
12074
12075
12076
12077
12078
12079
12080
12081
12082
12083
12084
12085
12086
12087
12088
12089
12090
12091
12092
12093
12094
12095
12096
12097
12098
12099
12100
12101
12102
12103
12104
12105
12106
12107
12108
12109
12110
12111
12112
12113
12114
12115
12116
12117
12118
12119
12120
12121
12122
12123
12124
12125
12126
12127
12128
12129
12130
12131
12132
12133
12134
12135
12136
12137
12138
12139
12140
12141
12142
12143
12144
12145
12146
12147
12148
12149
12150
12151
12152
12153
12154
12155
12156
12157
12158
12159
12160
12161
12162
12163
12164
12165
12166
12167
12168
12169
12170
12171
12172
12173
12174
12175
12176
12177
12178
12179
12180
12181
12182
12183
12184
12185
12186
12187
12188
12189
12190
12191
12192
12193
12194
12195
12196
12197
12198
12199
12200
12201
12202
12203
12204
12205
12206
12207
12208
12209
12210
12211
12212
12213
12214
12215
12216
12217
12218
12219
12220
12221
12222
12223
12224
12225
12226
12227
12228
12229
12230
12231
12232
12233
12234
12235
12236
12237
12238
12239
12240
12241
12242
12243
12244
12245
12246
12247
12248
12249
12250
12251
12252
12253
12254
12255
12256
12257
12258
12259
12260
12261
12262
12263
12264
12265
12266
12267
12268
12269
12270
12271
12272
12273
12274
12275
12276
12277
12278
12279
12280
12281
12282
12283
12284
12285
12286
12287
12288
12289
12290
12291
12292
12293
12294
12295
12296
12297
12298
12299
12300
12301
12302
12303
12304
12305
12306
12307
12308
12309
12310
12311
12312
12313
12314
12315
12316
12317
12318
12319
12320
12321
12322
12323
12324
12325
12326
12327
12328
12329
12330
12331
12332
12333
12334
12335
12336
12337
12338
12339
12340
12341
12342
12343
12344
12345
12346
12347
12348
12349
12350
12351
12352
12353
12354
12355
12356
12357
12358
12359
12360
12361
12362
12363
12364
12365
12366
12367
12368
12369
12370
12371
12372
12373
12374
12375
12376
12377
12378
12379
12380
12381
12382
12383
12384
12385
12386
12387
12388
12389
12390
12391
12392
12393
12394
12395
12396
12397
12398
12399
12400
12401
12402
12403
12404
12405
12406
12407
12408
12409
12410
12411
12412
12413
12414
12415
12416
12417
12418
12419
12420
12421
12422
12423
12424
12425
12426
12427
12428
12429
12430
12431
12432
12433
12434
12435
12436
12437
12438
12439
12440
12441
12442
12443
12444
12445
12446
12447
12448
12449
12450
12451
12452
12453
12454
12455
12456
12457
12458
12459
12460
12461
12462
12463
12464
12465
12466
12467
12468
12469
12470
12471
12472
12473
12474
12475
12476
12477
12478
12479
12480
12481
12482
12483
12484
12485
12486
12487
12488
12489
12490
12491
12492
12493
12494
12495
12496
12497
12498
12499
12500
12501
12502
12503
12504
12505
12506
12507
12508
12509
12510
12511
12512
12513
12514
12515
12516
12517
12518
12519
12520
12521
12522
12523
12524
12525
12526
12527
12528
12529
12530
12531
12532
12533
12534
12535
12536
12537
12538
12539
12540
12541
12542
12543
12544
12545
12546
12547
12548
12549
12550
12551
12552
12553
12554
12555
12556
12557
12558
12559
12560
12561
12562
12563
12564
12565
12566
12567
12568
12569
12570
12571
12572
12573
12574
12575
12576
12577
12578
12579
12580
12581
12582
12583
12584
12585
12586
12587
12588
12589
12590
12591
12592
12593
12594
12595
12596
12597
12598
12599
12600
12601
12602
12603
12604
12605
12606
12607
12608
12609
12610
12611
12612
12613
12614
12615
12616
12617
12618
12619
12620
12621
12622
12623
12624
12625
12626
12627
12628
12629
12630
12631
12632
12633
12634
12635
12636
12637
12638
12639
12640
12641
12642
12643
12644
12645
12646
12647
12648
12649
12650
12651
12652
12653
12654
12655
12656
12657
12658
12659
12660
12661
12662
12663
12664
12665
12666
12667
12668
12669
12670
12671
12672
12673
12674
12675
12676
12677
12678
12679
12680
12681
12682
12683
12684
12685
12686
12687
12688
12689
12690
12691
12692
12693
12694
12695
12696
12697
12698
12699
12700
12701
12702
12703
12704
12705
12706
12707
12708
12709
12710
12711
12712
12713
12714
12715
12716
12717
12718
12719
12720
12721
12722
12723
12724
12725
12726
12727
12728
12729
12730
12731
12732
12733
12734
12735
12736
12737
12738
12739
12740
12741
12742
12743
12744
12745
12746
12747
12748
12749
12750
12751
12752
12753
12754
12755
12756
12757
12758
12759
12760
12761
12762
12763
12764
12765
12766
12767
12768
12769
12770
12771
12772
12773
12774
12775
12776
12777
12778
12779
12780
12781
12782
12783
12784
12785
12786
12787
12788
12789
12790
12791
12792
12793
12794
12795
12796
12797
12798
12799
12800
12801
12802
12803
12804
12805
12806
12807
12808
12809
12810
12811
12812
12813
12814
12815
12816
12817
12818
12819
12820
12821
12822
12823
12824
12825
12826
12827
12828
12829
12830
12831
12832
12833
12834
12835
12836
12837
12838
12839
12840
12841
12842
12843
12844
12845
12846
12847
12848
12849
12850
12851
12852
12853
12854
12855
12856
12857
12858
12859
12860
12861
12862
12863
12864
12865
12866
12867
12868
12869
12870
12871
12872
12873
12874
12875
12876
12877
12878
12879
12880
12881
12882
12883
12884
12885
12886
12887
12888
12889
12890
12891
12892
12893
12894
12895
12896
12897
12898
12899
12900
12901
12902
12903
12904
12905
12906
12907
12908
12909
12910
12911
12912
12913
12914
12915
12916
12917
12918
12919
12920
12921
12922
12923
12924
12925
12926
12927
12928
12929
12930
12931
12932
12933
12934
12935
12936
12937
12938
12939
12940
12941
12942
12943
12944
12945
12946
12947
12948
12949
12950
12951
12952
12953
12954
12955
12956
12957
12958
12959
12960
12961
12962
12963
12964
12965
12966
12967
12968
12969
12970
12971
12972
12973
12974
12975
12976
12977
12978
12979
12980
12981
12982
12983
12984
12985
12986
12987
12988
12989
12990
12991
12992
12993
12994
12995
12996
12997
12998
12999
13000
13001
13002
13003
13004
13005
13006
13007
13008
13009
13010
13011
13012
13013
13014
13015
13016
13017
13018
13019
13020
13021
13022
13023
13024
13025
13026
13027
13028
13029
13030
13031
13032
13033
13034
13035
13036
13037
13038
13039
13040
13041
13042
13043
13044
13045
13046
13047
13048
13049
13050
13051
13052
13053
13054
13055
13056
13057
13058
13059
13060
13061
13062
13063
13064
13065
13066
13067
13068
13069
13070
13071
13072
13073
13074
13075
13076
13077
13078
13079
13080
13081
13082
13083
13084
13085
13086
13087
13088
13089
13090
13091
13092
13093
13094
13095
13096
13097
13098
13099
13100
13101
13102
13103
13104
13105
13106
13107
13108
13109
13110
13111
13112
13113
13114
13115
13116
13117
13118
13119
13120
13121
13122
13123
13124
13125
13126
13127
13128
13129
13130
13131
13132
13133
13134
13135
13136
13137
13138
13139
13140
13141
13142
13143
13144
13145
13146
13147
13148
13149
13150
13151
13152
13153
13154
13155
13156
13157
13158
13159
13160
13161
13162
13163
13164
13165
13166
13167
13168
13169
13170
13171
13172
13173
13174
13175
13176
13177
13178
13179
13180
13181
13182
13183
13184
13185
13186
13187
13188
13189
13190
13191
13192
13193
13194
13195
13196
13197
13198
13199
13200
13201
13202
13203
13204
13205
13206
13207
13208
13209
13210
13211
13212
13213
13214
13215
13216
13217
13218
13219
13220
13221
13222
13223
13224
13225
13226
13227
13228
13229
13230
13231
13232
13233
13234
13235
13236
13237
13238
13239
13240
13241
13242
13243
13244
13245
13246
13247
13248
13249
13250
13251
13252
13253
13254
13255
13256
13257
13258
13259
13260
13261
13262
13263
13264
13265
13266
13267
13268
13269
13270
13271
13272
13273
13274
13275
13276
13277
13278
13279
13280
13281
13282
13283
13284
13285
13286
13287
13288
13289
13290
13291
13292
13293
13294
13295
13296
13297
13298
13299
13300
13301
13302
13303
13304
13305
13306
13307
13308
13309
13310
13311
13312
13313
13314
13315
13316
13317
13318
13319
13320
13321
13322
13323
13324
13325
13326
13327
13328
13329
13330
13331
13332
13333
13334
13335
13336
13337
13338
13339
13340
13341
13342
13343
13344
13345
13346
13347
13348
13349
13350
13351
13352
13353
13354
13355
13356
13357
13358
13359
13360
13361
13362
13363
13364
13365
13366
13367
13368
13369
13370
13371
13372
13373
13374
13375
13376
13377
13378
13379
13380
13381
13382
13383
13384
13385
13386
13387
13388
13389
13390
13391
13392
13393
13394
13395
13396
13397
13398
13399
13400
13401
13402
13403
13404
13405
13406
13407
13408
13409
13410
13411
13412
13413
13414
13415
13416
13417
13418
13419
13420
13421
13422
13423
13424
13425
13426
13427
13428
13429
13430
13431
13432
13433
13434
13435
13436
13437
13438
13439
13440
13441
13442
13443
13444
13445
13446
13447
13448
13449
13450
13451
13452
13453
13454
13455
13456
13457
13458
13459
13460
13461
13462
13463
13464
13465
13466
13467
13468
13469
13470
13471
13472
13473
13474
13475
13476
13477
13478
13479
13480
13481
13482
13483
13484
13485
13486
13487
13488
13489
13490
13491
13492
13493
13494
13495
13496
13497
13498
13499
13500
13501
13502
13503
13504
13505
13506
13507
13508
13509
13510
13511
13512
13513
13514
13515
13516
13517
13518
13519
13520
13521
13522
13523
13524
13525
13526
13527
13528
13529
13530
13531
13532
13533
13534
13535
13536
13537
13538
13539
13540
13541
13542
13543
13544
13545
13546
13547
13548
13549
13550
13551
13552
13553
13554
13555
13556
13557
13558
13559
13560
13561
13562
13563
13564
13565
13566
13567
13568
13569
13570
13571
13572
13573
13574
13575
13576
13577
13578
13579
13580
13581
13582
13583
13584
13585
13586
13587
13588
13589
13590
13591
13592
13593
13594
13595
13596
13597
13598
13599
13600
13601
13602
13603
13604
13605
13606
13607
13608
13609
13610
13611
13612
13613
13614
13615
13616
13617
13618
13619
13620
13621
13622
13623
13624
13625
13626
13627
13628
13629
13630
13631
13632
13633
13634
13635
13636
13637
13638
13639
13640
13641
13642
13643
13644
13645
13646
13647
13648
13649
13650
13651
13652
13653
13654
13655
13656
13657
13658
13659
13660
13661
13662
13663
13664
13665
13666
13667
13668
13669
13670
13671
13672
13673
13674
13675
13676
13677
13678
13679
13680
13681
13682
13683
13684
13685
13686
13687
13688
13689
13690
13691
13692
13693
13694
13695
13696
13697
13698
13699
13700
13701
13702
13703
13704
13705
13706
13707
13708
13709
13710
13711
13712
13713
13714
13715
13716
13717
13718
13719
13720
13721
13722
13723
13724
13725
13726
13727
13728
13729
13730
13731
13732
13733
13734
13735
13736
13737
13738
13739
13740
13741
13742
13743
13744
13745
13746
13747
13748
13749
13750
13751
13752
13753
13754
13755
13756
13757
13758
13759
13760
13761
13762
13763
13764
13765
13766
13767
13768
13769
13770
13771
13772
13773
13774
13775
13776
13777
13778
13779
13780
13781
13782
13783
13784
13785
13786
13787
13788
13789
13790
13791
13792
13793
13794
13795
13796
13797
13798
13799
13800
13801
13802
13803
13804
13805
13806
13807
13808
13809
13810
13811
13812
13813
13814
13815
13816
13817
13818
13819
13820
13821
13822
13823
13824
13825
13826
13827
13828
13829
13830
13831
13832
13833
13834
13835
13836
13837
13838
13839
13840
13841
13842
13843
13844
13845
13846
13847
13848
13849
13850
13851
13852
13853
13854
13855
13856
13857
13858
13859
13860
13861
13862
13863
13864
13865
13866
13867
13868
13869
13870
13871
13872
13873
13874
13875
13876
13877
13878
13879
13880
13881
13882
13883
13884
13885
13886
13887
13888
13889
13890
13891
13892
13893
13894
13895
13896
13897
13898
13899
13900
13901
13902
13903
13904
13905
13906
13907
13908
13909
13910
13911
13912
13913
13914
13915
13916
13917
13918
13919
13920
13921
13922
13923
13924
13925
13926
13927
13928
13929
13930
13931
13932
13933
13934
13935
13936
13937
13938
13939
13940
13941
13942
13943
13944
13945
13946
13947
13948
13949
13950
13951
13952
13953
13954
13955
13956
13957
13958
13959
13960
13961
13962
13963
13964
13965
13966
13967
13968
13969
13970
13971
13972
13973
13974
13975
13976
13977
13978
13979
13980
13981
13982
13983
13984
13985
13986
13987
13988
13989
13990
13991
13992
13993
13994
13995
13996
13997
13998
13999
14000
14001
14002
14003
14004
14005
14006
14007
14008
14009
14010
14011
14012
14013
14014
14015
14016
14017
14018
14019
14020
14021
14022
14023
14024
14025
14026
14027
14028
14029
14030
14031
14032
14033
14034
14035
14036
14037
14038
14039
14040
14041
14042
14043
14044
14045
14046
14047
14048
14049
14050
14051
14052
14053
14054
14055
14056
14057
14058
14059
14060
14061
14062
14063
14064
14065
14066
14067
14068
14069
14070
14071
14072
14073
14074
14075
14076
14077
14078
14079
14080
14081
14082
14083
14084
14085
14086
14087
14088
14089
14090
14091
14092
14093
14094
14095
14096
14097
14098
14099
14100
14101
14102
14103
14104
14105
14106
14107
14108
14109
14110
14111
14112
14113
14114
14115
14116
14117
14118
14119
14120
14121
14122
14123
14124
14125
14126
14127
14128
14129
14130
14131
14132
14133
14134
14135
14136
14137
14138
14139
14140
14141
14142
14143
14144
14145
14146
14147
14148
14149
14150
14151
14152
14153
14154
14155
14156
14157
14158
14159
14160
14161
14162
14163
14164
14165
14166
14167
14168
14169
14170
14171
14172
14173
14174
14175
14176
14177
14178
14179
14180
14181
14182
14183
14184
14185
14186
14187
14188
14189
14190
14191
14192
14193
14194
14195
14196
14197
14198
14199
14200
14201
14202
14203
14204
14205
14206
14207
14208
14209
14210
14211
14212
14213
14214
14215
14216
14217
14218
14219
14220
14221
14222
14223
14224
14225
14226
14227
14228
14229
14230
14231
14232
14233
14234
14235
14236
14237
14238
14239
14240
14241
14242
14243
14244
14245
14246
14247
14248
14249
14250
14251
14252
14253
14254
14255
14256
14257
14258
14259
14260
14261
14262
14263
14264
14265
14266
14267
14268
14269
14270
14271
14272
14273
14274
14275
14276
14277
14278
14279
14280
14281
14282
14283
14284
14285
14286
14287
14288
14289
14290
14291
14292
14293
14294
14295
14296
14297
14298
14299
14300
14301
14302
14303
14304
14305
14306
14307
14308
14309
14310
14311
14312
14313
14314
14315
14316
14317
14318
14319
14320
14321
14322
14323
14324
14325
14326
14327
14328
14329
14330
14331
14332
14333
14334
14335
14336
14337
14338
14339
14340
14341
14342
14343
14344
14345
14346
14347
14348
14349
14350
14351
14352
14353
14354
14355
14356
14357
14358
14359
14360
14361
14362
14363
14364
14365
14366
14367
14368
14369
14370
14371
14372
14373
14374
14375
14376
14377
14378
14379
14380
14381
14382
14383
14384
14385
14386
14387
14388
14389
14390
14391
14392
14393
14394
14395
14396
14397
14398
14399
14400
14401
14402
14403
14404
14405
14406
14407
14408
14409
14410
14411
14412
14413
14414
14415
14416
14417
14418
14419
14420
14421
14422
14423
14424
14425
14426
14427
14428
14429
14430
14431
14432
14433
14434
14435
14436
14437
14438
14439
14440
14441
14442
14443
14444
14445
14446
14447
14448
14449
14450
14451
14452
14453
14454
14455
14456
14457
14458
14459
14460
14461
14462
14463
14464
14465
14466
14467
14468
14469
14470
14471
14472
14473
14474
14475
14476
14477
14478
14479
14480
14481
14482
14483
14484
14485
14486
14487
14488
14489
14490
14491
14492
14493
14494
14495
14496
14497
14498
14499
14500
14501
14502
14503
14504
14505
14506
14507
14508
14509
14510
14511
14512
14513
14514
14515
14516
14517
14518
14519
14520
14521
14522
14523
14524
14525
14526
14527
14528
14529
14530
14531
14532
14533
14534
14535
14536
14537
14538
14539
14540
14541
14542
14543
14544
14545
14546
14547
14548
14549
14550
14551
14552
14553
14554
14555
14556
14557
14558
14559
14560
14561
14562
14563
14564
14565
14566
14567
14568
14569
14570
14571
14572
14573
14574
14575
14576
14577
14578
14579
14580
14581
14582
14583
14584
14585
14586
14587
14588
14589
14590
14591
14592
14593
14594
14595
14596
14597
14598
14599
14600
14601
14602
14603
14604
14605
14606
14607
14608
14609
14610
14611
14612
14613
14614
14615
14616
14617
14618
14619
14620
14621
14622
14623
14624
14625
14626
14627
14628
14629
14630
14631
14632
14633
14634
14635
14636
14637
14638
14639
14640
14641
14642
14643
14644
14645
14646
14647
14648
14649
14650
14651
14652
14653
14654
14655
14656
14657
14658
14659
14660
14661
14662
14663
14664
14665
14666
14667
14668
14669
14670
14671
14672
14673
14674
14675
14676
14677
14678
14679
14680
14681
14682
14683
14684
14685
14686
14687
14688
14689
14690
14691
14692
14693
14694
14695
14696
14697
14698
14699
14700
14701
14702
14703
14704
14705
14706
14707
14708
14709
14710
14711
14712
14713
14714
14715
14716
14717
14718
14719
14720
14721
14722
14723
14724
14725
14726
14727
14728
14729
14730
14731
14732
14733
14734
14735
14736
14737
14738
14739
14740
14741
14742
14743
14744
14745
14746
14747
14748
14749
14750
14751
14752
14753
14754
14755
14756
14757
14758
14759
14760
14761
14762
14763
14764
14765
14766
14767
14768
14769
14770
14771
14772
14773
14774
14775
14776
14777
14778
14779
14780
14781
14782
14783
14784
14785
14786
14787
14788
14789
14790
14791
14792
14793
14794
14795
14796
14797
14798
14799
14800
14801
14802
14803
14804
14805
14806
14807
14808
14809
14810
14811
14812
14813
14814
14815
14816
14817
14818
14819
14820
14821
14822
14823
14824
14825
14826
14827
14828
14829
14830
14831
14832
14833
14834
14835
14836
14837
14838
14839
14840
14841
14842
14843
14844
14845
14846
14847
14848
14849
14850
14851
14852
14853
14854
14855
14856
14857
14858
14859
14860
14861
14862
14863
14864
14865
14866
14867
14868
14869
14870
14871
14872
14873
14874
14875
14876
14877
14878
14879
14880
14881
14882
14883
14884
14885
14886
14887
14888
14889
14890
14891
14892
14893
14894
14895
14896
14897
14898
14899
14900
14901
14902
14903
14904
14905
14906
14907
14908
14909
14910
14911
14912
14913
14914
14915
14916
14917
14918
14919
14920
14921
14922
14923
14924
14925
14926
14927
14928
14929
14930
14931
14932
14933
14934
14935
14936
14937
14938
14939
14940
14941
14942
14943
14944
14945
14946
14947
14948
14949
14950
14951
14952
14953
14954
14955
14956
14957
14958
14959
14960
14961
14962
14963
14964
14965
14966
14967
14968
14969
14970
14971
14972
14973
14974
14975
14976
14977
14978
14979
14980
14981
14982
14983
14984
14985
14986
14987
14988
14989
14990
14991
14992
14993
14994
14995
14996
14997
14998
14999
15000
15001
15002
15003
15004
15005
15006
15007
15008
15009
15010
15011
15012
15013
15014
15015
15016
15017
15018
15019
15020
15021
15022
15023
15024
15025
15026
15027
15028
15029
15030
15031
15032
15033
15034
15035
15036
15037
15038
15039
15040
15041
15042
15043
15044
15045
15046
15047
15048
15049
15050
15051
15052
15053
15054
15055
15056
15057
15058
15059
15060
15061
15062
15063
15064
15065
15066
15067
15068
15069
15070
15071
15072
15073
15074
15075
15076
15077
15078
15079
15080
15081
15082
15083
15084
15085
15086
15087
15088
15089
15090
15091
15092
15093
15094
15095
15096
15097
15098
15099
15100
15101
15102
15103
15104
15105
15106
15107
15108
15109
15110
15111
15112
15113
15114
15115
15116
15117
15118
15119
15120
15121
15122
15123
15124
15125
15126
15127
15128
15129
15130
15131
15132
15133
15134
15135
15136
15137
15138
15139
15140
15141
15142
15143
15144
15145
15146
15147
15148
15149
15150
15151
15152
15153
15154
15155
15156
15157
15158
15159
15160
15161
15162
15163
15164
15165
15166
15167
15168
15169
15170
15171
15172
15173
15174
15175
15176
15177
15178
15179
15180
15181
15182
15183
15184
15185
15186
15187
15188
15189
15190
15191
15192
15193
15194
15195
15196
15197
15198
15199
15200
15201
15202
15203
15204
15205
15206
15207
15208
15209
15210
15211
15212
15213
15214
15215
15216
15217
15218
15219
15220
15221
15222
15223
15224
15225
15226
15227
15228
15229
15230
15231
15232
15233
15234
15235
15236
15237
15238
15239
15240
15241
15242
15243
15244
15245
15246
15247
15248
15249
15250
15251
15252
15253
15254
15255
15256
15257
15258
15259
15260
15261
15262
15263
15264
15265
15266
15267
15268
15269
15270
15271
15272
15273
15274
15275
15276
15277
15278
15279
15280
15281
15282
15283
15284
15285
15286
15287
15288
15289
15290
15291
15292
15293
15294
15295
15296
15297
15298
15299
15300
15301
15302
15303
15304
15305
15306
15307
15308
15309
15310
15311
15312
15313
15314
15315
15316
15317
15318
15319
15320
15321
15322
15323
15324
15325
15326
15327
15328
15329
15330
15331
15332
15333
15334
15335
15336
15337
15338
15339
15340
15341
15342
15343
15344
15345
15346
15347
15348
15349
15350
15351
15352
15353
15354
15355
15356
15357
15358
15359
15360
15361
15362
15363
15364
15365
15366
15367
15368
15369
15370
15371
15372
15373
15374
15375
15376
15377
15378
15379
15380
15381
15382
15383
15384
15385
15386
15387
15388
15389
15390
15391
15392
15393
15394
15395
15396
15397
15398
15399
15400
15401
15402
15403
15404
15405
15406
15407
15408
15409
15410
15411
15412
15413
15414
15415
15416
15417
15418
15419
15420
15421
15422
15423
15424
15425
15426
15427
15428
15429
15430
15431
15432
15433
15434
15435
15436
15437
15438
15439
15440
15441
15442
15443
15444
15445
15446
15447
15448
15449
15450
15451
15452
15453
15454
15455
15456
15457
15458
15459
15460
15461
15462
15463
15464
15465
15466
15467
15468
15469
15470
15471
15472
15473
15474
15475
15476
15477
15478
15479
15480
15481
15482
15483
15484
15485
15486
15487
15488
15489
15490
15491
15492
15493
15494
15495
15496
15497
15498
15499
15500
15501
15502
15503
15504
15505
15506
15507
15508
15509
15510
15511
15512
15513
15514
15515
15516
15517
15518
15519
15520
15521
15522
15523
15524
15525
15526
15527
15528
15529
15530
15531
15532
15533
15534
15535
15536
15537
15538
15539
15540
15541
15542
15543
15544
15545
15546
15547
15548
15549
15550
15551
15552
15553
15554
15555
15556
15557
15558
15559
15560
15561
15562
15563
15564
15565
15566
15567
15568
15569
15570
15571
15572
15573
15574
15575
15576
15577
15578
15579
15580
15581
15582
15583
15584
15585
15586
15587
15588
15589
15590
15591
15592
15593
15594
15595
15596
15597
15598
15599
15600
15601
15602
15603
15604
15605
15606
15607
15608
15609
15610
15611
15612
15613
15614
15615
15616
15617
15618
15619
15620
15621
15622
15623
15624
15625
15626
15627
15628
15629
15630
15631
15632
15633
15634
15635
15636
15637
15638
15639
15640
15641
15642
15643
15644
15645
15646
15647
15648
15649
15650
15651
15652
15653
15654
15655
15656
15657
15658
15659
15660
15661
15662
15663
15664
15665
15666
15667
15668
15669
15670
15671
15672
15673
15674
15675
15676
15677
15678
15679
15680
15681
15682
15683
15684
15685
15686
15687
15688
15689
15690
15691
15692
15693
15694
15695
15696
15697
15698
15699
15700
15701
15702
15703
15704
15705
15706
15707
15708
15709
15710
15711
15712
15713
15714
15715
15716
15717
15718
15719
15720
15721
15722
15723
15724
15725
15726
15727
15728
15729
15730
15731
15732
15733
15734
15735
15736
15737
15738
15739
15740
15741
15742
15743
15744
15745
15746
15747
15748
15749
15750
15751
15752
15753
15754
15755
15756
15757
15758
15759
15760
15761
15762
15763
15764
15765
15766
15767
15768
15769
15770
15771
15772
15773
15774
15775
15776
15777
15778
15779
15780
15781
15782
15783
15784
15785
15786
15787
15788
15789
15790
15791
15792
15793
15794
15795
15796
15797
15798
15799
15800
15801
15802
15803
15804
15805
15806
15807
15808
15809
15810
15811
15812
15813
15814
15815
15816
15817
15818
15819
15820
15821
15822
15823
15824
15825
15826
15827
15828
15829
15830
15831
15832
15833
15834
15835
15836
15837
15838
15839
15840
15841
15842
15843
15844
15845
15846
15847
15848
15849
15850
15851
15852
15853
15854
15855
15856
15857
15858
15859
15860
15861
15862
15863
15864
15865
15866
15867
15868
15869
15870
15871
15872
15873
15874
15875
15876
15877
15878
15879
15880
15881
15882
15883
15884
15885
15886
15887
15888
15889
15890
15891
15892
15893
15894
15895
15896
15897
15898
15899
15900
15901
15902
15903
15904
15905
15906
15907
15908
15909
15910
15911
15912
15913
15914
15915
15916
15917
15918
15919
15920
15921
15922
15923
15924
15925
15926
15927
15928
15929
15930
15931
15932
15933
15934
15935
15936
15937
15938
15939
15940
15941
15942
15943
15944
15945
15946
15947
15948
15949
15950
15951
15952
15953
15954
15955
15956
15957
15958
15959
15960
15961
15962
15963
15964
15965
15966
15967
15968
15969
15970
15971
15972
15973
15974
15975
15976
15977
15978
15979
15980
15981
15982
15983
15984
15985
15986
15987
15988
15989
15990
15991
15992
15993
15994
15995
15996
15997
15998
15999
16000
16001
16002
16003
16004
16005
16006
16007
16008
16009
16010
16011
16012
16013
16014
16015
16016
16017
16018
16019
16020
16021
16022
16023
16024
16025
16026
16027
16028
16029
16030
16031
16032
16033
16034
16035
16036
16037
16038
16039
16040
16041
16042
16043
16044
16045
16046
16047
16048
16049
16050
16051
16052
16053
16054
16055
16056
16057
16058
16059
16060
16061
16062
16063
16064
16065
16066
16067
16068
16069
16070
16071
16072
16073
16074
16075
16076
16077
16078
16079
16080
16081
16082
16083
16084
16085
16086
16087
16088
16089
16090
16091
16092
16093
16094
16095
16096
16097
16098
16099
16100
16101
16102
16103
16104
16105
16106
16107
16108
16109
16110
16111
16112
16113
16114
16115
16116
16117
16118
16119
16120
16121
16122
16123
16124
16125
16126
16127
16128
16129
16130
16131
16132
16133
16134
16135
16136
16137
16138
16139
16140
16141
16142
16143
16144
16145
16146
16147
16148
16149
16150
16151
16152
16153
16154
16155
16156
16157
16158
16159
16160
16161
16162
16163
16164
16165
16166
16167
16168
16169
16170
16171
16172
16173
16174
16175
16176
16177
16178
16179
16180
16181
16182
16183
16184
16185
16186
16187
16188
16189
16190
16191
16192
16193
16194
16195
16196
16197
16198
16199
16200
16201
16202
16203
16204
16205
16206
16207
16208
16209
16210
16211
16212
16213
16214
16215
16216
16217
16218
16219
16220
16221
16222
16223
16224
16225
16226
16227
16228
16229
16230
16231
16232
16233
16234
16235
16236
16237
16238
16239
16240
16241
16242
16243
16244
16245
16246
16247
16248
16249
16250
16251
16252
16253
16254
16255
16256
16257
16258
16259
16260
16261
16262
16263
16264
16265
16266
16267
16268
16269
16270
16271
16272
16273
16274
16275
16276
16277
16278
16279
16280
16281
16282
16283
16284
16285
16286
16287
16288
16289
16290
16291
16292
16293
16294
16295
16296
16297
16298
16299
16300
16301
16302
16303
16304
16305
16306
16307
16308
16309
16310
16311
16312
16313
16314
16315
16316
16317
16318
16319
16320
16321
16322
16323
16324
16325
16326
16327
16328
16329
16330
16331
16332
16333
16334
16335
16336
16337
16338
16339
16340
16341
16342
16343
16344
16345
16346
16347
16348
16349
16350
16351
16352
16353
16354
16355
16356
16357
16358
16359
16360
16361
16362
16363
16364
16365
16366
16367
16368
16369
16370
16371
16372
16373
16374
16375
16376
16377
16378
16379
16380
16381
16382
16383
16384
16385
16386
16387
16388
16389
16390
16391
16392
16393
16394
16395
16396
16397
16398
16399
16400
16401
16402
16403
16404
16405
16406
16407
16408
16409
16410
16411
16412
16413
16414
16415
16416
16417
16418
16419
16420
16421
16422
16423
16424
16425
16426
16427
16428
16429
16430
16431
16432
16433
16434
16435
16436
16437
16438
16439
16440
16441
16442
16443
16444
16445
16446
16447
16448
16449
16450
16451
16452
16453
16454
16455
16456
16457
16458
16459
16460
16461
16462
16463
16464
16465
16466
16467
16468
16469
16470
16471
16472
16473
16474
16475
16476
16477
16478
16479
16480
16481
16482
16483
16484
16485
16486
16487
16488
16489
16490
16491
16492
16493
16494
16495
16496
16497
16498
16499
16500
16501
16502
16503
16504
16505
16506
16507
16508
16509
16510
16511
16512
16513
16514
16515
16516
16517
16518
16519
16520
16521
16522
16523
16524
16525
16526
16527
16528
16529
16530
16531
16532
16533
16534
16535
16536
16537
16538
16539
16540
16541
16542
16543
16544
16545
16546
16547
16548
16549
16550
16551
16552
16553
16554
16555
16556
16557
16558
16559
16560
16561
16562
16563
16564
16565
16566
16567
16568
16569
16570
16571
16572
16573
16574
16575
16576
16577
16578
16579
16580
16581
16582
16583
16584
16585
16586
16587
16588
16589
16590
16591
16592
16593
16594
16595
16596
16597
16598
16599
16600
16601
16602
16603
16604
16605
16606
16607
16608
16609
16610
16611
16612
16613
16614
16615
16616
16617
16618
16619
16620
16621
16622
16623
16624
16625
16626
16627
16628
16629
16630
16631
16632
16633
16634
16635
16636
16637
16638
16639
16640
16641
16642
16643
16644
16645
16646
16647
16648
16649
16650
16651
16652
16653
16654
16655
16656
16657
16658
16659
16660
16661
16662
16663
16664
16665
16666
16667
16668
16669
16670
16671
16672
16673
16674
16675
16676
16677
16678
16679
16680
16681
16682
16683
16684
16685
16686
16687
16688
16689
16690
16691
16692
16693
16694
16695
16696
16697
16698
16699
16700
16701
16702
16703
16704
16705
16706
16707
16708
16709
16710
16711
16712
16713
16714
16715
16716
16717
16718
16719
16720
16721
16722
16723
16724
16725
16726
16727
16728
16729
16730
16731
16732
16733
16734
16735
16736
16737
16738
16739
16740
16741
16742
16743
16744
16745
16746
16747
16748
16749
16750
16751
16752
16753
16754
16755
16756
16757
16758
16759
16760
16761
16762
16763
16764
16765
16766
16767
16768
16769
16770
16771
16772
16773
16774
16775
16776
16777
16778
16779
16780
16781
16782
16783
16784
16785
16786
16787
16788
16789
16790
16791
16792
16793
16794
16795
16796
16797
16798
16799
16800
16801
16802
16803
16804
16805
16806
16807
16808
16809
16810
16811
16812
16813
16814
16815
16816
16817
16818
16819
16820
16821
16822
16823
16824
16825
16826
16827
16828
16829
16830
16831
16832
16833
16834
16835
16836
16837
16838
16839
16840
16841
16842
16843
16844
16845
16846
16847
16848
16849
16850
16851
16852
16853
16854
16855
16856
16857
16858
16859
16860
16861
16862
16863
16864
16865
16866
16867
16868
16869
16870
16871
16872
16873
16874
16875
16876
16877
16878
16879
16880
16881
16882
16883
16884
16885
16886
16887
16888
16889
16890
16891
16892
16893
16894
16895
16896
16897
16898
16899
16900
16901
16902
16903
16904
16905
16906
16907
16908
16909
16910
16911
16912
16913
16914
16915
16916
16917
16918
16919
16920
16921
16922
16923
16924
16925
16926
16927
16928
16929
16930
16931
16932
16933
16934
16935
16936
16937
16938
16939
16940
16941
16942
16943
16944
16945
16946
16947
16948
16949
16950
16951
16952
16953
16954
16955
16956
16957
16958
16959
16960
16961
16962
16963
16964
16965
16966
16967
16968
16969
16970
16971
16972
16973
16974
16975
16976
16977
16978
16979
16980
16981
16982
16983
16984
16985
16986
16987
16988
16989
16990
16991
16992
16993
16994
16995
16996
16997
16998
16999
17000
17001
17002
17003
17004
17005
17006
17007
17008
17009
17010
17011
17012
17013
17014
17015
17016
17017
17018
17019
17020
17021
17022
17023
17024
17025
17026
17027
17028
17029
17030
17031
17032
17033
17034
17035
17036
17037
17038
17039
17040
17041
17042
17043
17044
17045
17046
17047
17048
17049
17050
17051
17052
17053
17054
17055
17056
17057
17058
17059
17060
17061
17062
17063
17064
17065
17066
17067
17068
17069
17070
17071
17072
17073
17074
17075
17076
17077
17078
17079
17080
17081
17082
17083
17084
17085
17086
17087
17088
17089
17090
17091
17092
17093
17094
17095
17096
17097
17098
17099
17100
17101
17102
17103
17104
17105
17106
17107
17108
17109
17110
17111
17112
17113
17114
17115
17116
17117
17118
17119
17120
17121
17122
17123
17124
17125
17126
17127
17128
17129
17130
17131
17132
17133
17134
17135
17136
17137
17138
17139
17140
17141
17142
17143
17144
17145
17146
17147
17148
17149
17150
17151
17152
17153
17154
17155
17156
17157
17158
17159
17160
17161
17162
17163
17164
17165
17166
17167
17168
17169
17170
17171
17172
17173
17174
17175
17176
17177
17178
17179
17180
17181
17182
17183
17184
17185
17186
17187
17188
17189
17190
17191
17192
17193
17194
17195
17196
17197
17198
17199
17200
17201
17202
17203
17204
17205
17206
17207
17208
17209
17210
17211
17212
17213
17214
17215
17216
17217
17218
17219
17220
17221
17222
17223
17224
17225
17226
17227
17228
17229
17230
17231
17232
17233
17234
17235
17236
17237
17238
17239
17240
17241
17242
17243
17244
17245
17246
17247
17248
17249
17250
17251
17252
17253
17254
17255
17256
17257
17258
17259
17260
17261
17262
17263
17264
17265
17266
17267
17268
17269
17270
17271
17272
17273
17274
17275
17276
17277
17278
17279
17280
17281
17282
17283
17284
17285
17286
17287
17288
17289
17290
17291
17292
17293
17294
17295
17296
17297
17298
17299
17300
17301
17302
17303
17304
17305
17306
17307
17308
17309
17310
17311
17312
17313
17314
17315
17316
17317
17318
17319
17320
17321
17322
17323
17324
17325
17326
17327
17328
17329
17330
17331
17332
17333
17334
17335
17336
17337
17338
17339
17340
17341
17342
17343
17344
17345
17346
17347
17348
17349
17350
17351
17352
17353
17354
17355
17356
17357
17358
17359
17360
17361
17362
17363
17364
17365
17366
17367
17368
17369
17370
17371
17372
17373
17374
17375
17376
17377
17378
17379
17380
17381
17382
17383
17384
17385
17386
17387
17388
17389
17390
17391
17392
17393
17394
17395
17396
17397
17398
17399
17400
17401
17402
17403
17404
17405
17406
17407
17408
17409
17410
17411
17412
17413
17414
17415
17416
17417
17418
17419
17420
17421
17422
17423
17424
17425
17426
17427
17428
17429
17430
17431
17432
17433
17434
17435
17436
17437
17438
17439
17440
17441
17442
17443
17444
17445
17446
17447
17448
17449
17450
17451
17452
17453
17454
17455
17456
17457
17458
17459
17460
17461
17462
17463
17464
17465
17466
17467
17468
17469
17470
17471
17472
17473
17474
17475
17476
17477
17478
17479
17480
17481
17482
17483
17484
17485
17486
17487
17488
17489
17490
17491
17492
17493
17494
17495
17496
17497
17498
17499
17500
17501
17502
17503
17504
17505
17506
17507
17508
17509
17510
17511
17512
17513
17514
17515
17516
17517
17518
17519
17520
17521
17522
17523
17524
17525
17526
17527
17528
17529
17530
17531
17532
17533
17534
17535
17536
17537
17538
17539
17540
17541
17542
17543
17544
17545
17546
17547
17548
17549
17550
17551
17552
17553
17554
17555
17556
17557
17558
17559
17560
17561
17562
17563
17564
17565
17566
17567
17568
17569
17570
17571
17572
17573
17574
17575
17576
17577
17578
17579
17580
17581
17582
17583
17584
17585
17586
17587
17588
17589
17590
17591
17592
17593
17594
17595
17596
17597
17598
17599
17600
17601
17602
17603
17604
17605
17606
17607
17608
17609
17610
17611
17612
17613
17614
17615
17616
17617
17618
17619
17620
17621
17622
17623
17624
17625
17626
17627
17628
17629
17630
17631
17632
17633
17634
17635
17636
17637
17638
17639
17640
17641
17642
17643
17644
17645
17646
17647
17648
17649
17650
17651
17652
17653
17654
17655
17656
17657
17658
17659
17660
17661
17662
17663
17664
17665
17666
17667
17668
17669
17670
17671
17672
17673
17674
17675
17676
17677
17678
17679
17680
17681
17682
17683
17684
17685
17686
17687
17688
17689
17690
17691
17692
17693
17694
17695
17696
17697
17698
17699
17700
17701
17702
17703
17704
17705
17706
17707
17708
17709
17710
17711
17712
17713
17714
17715
17716
17717
17718
17719
17720
17721
17722
17723
17724
17725
17726
17727
17728
17729
17730
17731
17732
17733
17734
17735
17736
17737
17738
17739
17740
17741
17742
17743
17744
17745
17746
17747
17748
17749
17750
17751
17752
17753
17754
17755
17756
17757
17758
17759
17760
17761
17762
17763
17764
17765
17766
17767
17768
17769
17770
17771
17772
17773
17774
17775
17776
17777
17778
17779
17780
17781
17782
17783
17784
17785
17786
17787
17788
17789
17790
17791
17792
17793
17794
17795
17796
17797
17798
17799
17800
17801
17802
17803
17804
17805
17806
17807
17808
17809
17810
17811
17812
17813
17814
17815
17816
17817
17818
17819
17820
17821
17822
17823
17824
17825
17826
17827
17828
17829
17830
17831
17832
17833
17834
17835
17836
17837
17838
17839
17840
17841
17842
17843
17844
17845
17846
17847
17848
17849
17850
17851
17852
17853
17854
17855
17856
17857
17858
17859
17860
17861
17862
17863
17864
17865
17866
17867
17868
17869
17870
17871
17872
17873
17874
17875
17876
17877
17878
17879
17880
17881
17882
17883
17884
17885
17886
17887
17888
17889
17890
17891
17892
17893
17894
17895
17896
17897
17898
17899
17900
17901
17902
17903
17904
17905
17906
17907
17908
17909
17910
17911
17912
17913
17914
17915
17916
17917
17918
17919
17920
17921
17922
17923
17924
17925
17926
17927
17928
17929
17930
17931
17932
17933
17934
17935
17936
17937
17938
17939
17940
17941
17942
17943
17944
17945
17946
17947
17948
17949
17950
17951
17952
17953
17954
17955
17956
17957
17958
17959
17960
17961
17962
17963
17964
17965
17966
17967
17968
17969
17970
17971
17972
17973
17974
17975
17976
17977
17978
17979
17980
17981
17982
17983
17984
17985
17986
17987
17988
17989
17990
17991
17992
17993
17994
17995
17996
17997
17998
17999
18000
18001
18002
18003
18004
18005
18006
18007
18008
18009
18010
18011
18012
18013
18014
18015
18016
18017
18018
18019
18020
18021
18022
18023
18024
18025
18026
18027
18028
18029
18030
18031
18032
18033
18034
18035
18036
18037
18038
18039
18040
18041
18042
18043
18044
18045
18046
18047
18048
18049
18050
18051
18052
18053
18054
18055
18056
18057
18058
18059
18060
18061
18062
18063
18064
18065
18066
18067
18068
18069
18070
18071
18072
18073
18074
18075
18076
18077
18078
18079
18080
18081
18082
18083
18084
18085
18086
18087
18088
18089
18090
18091
18092
18093
18094
18095
18096
18097
18098
18099
18100
18101
18102
18103
18104
18105
18106
18107
18108
18109
18110
18111
18112
18113
18114
18115
18116
18117
18118
18119
18120
18121
18122
18123
18124
18125
18126
18127
18128
18129
18130
18131
18132
18133
18134
18135
18136
18137
18138
18139
18140
18141
18142
18143
18144
18145
18146
18147
18148
18149
18150
18151
18152
18153
18154
18155
18156
18157
18158
18159
18160
18161
18162
18163
18164
18165
18166
18167
18168
18169
18170
18171
18172
18173
18174
18175
18176
18177
18178
18179
18180
18181
18182
18183
18184
18185
18186
18187
18188
18189
18190
18191
18192
18193
18194
18195
18196
18197
18198
18199
18200
18201
18202
18203
18204
18205
18206
18207
18208
18209
18210
18211
18212
18213
18214
18215
18216
18217
18218
18219
18220
18221
18222
18223
18224
18225
18226
18227
18228
18229
18230
18231
18232
18233
18234
18235
18236
18237
18238
18239
18240
18241
18242
18243
18244
18245
18246
18247
18248
18249
18250
18251
18252
18253
18254
18255
18256
18257
18258
18259
18260
18261
18262
18263
18264
18265
18266
18267
18268
18269
18270
18271
18272
18273
18274
18275
18276
18277
18278
18279
18280
18281
18282
18283
18284
18285
18286
18287
18288
18289
18290
18291
18292
18293
18294
18295
18296
18297
18298
18299
18300
18301
18302
18303
18304
18305
18306
18307
18308
18309
18310
18311
18312
18313
18314
18315
18316
18317
18318
18319
18320
18321
18322
18323
18324
18325
18326
18327
18328
18329
18330
18331
18332
18333
18334
18335
18336
18337
18338
18339
18340
18341
18342
18343
18344
18345
18346
18347
18348
18349
18350
18351
18352
18353
18354
18355
18356
18357
18358
18359
18360
18361
18362
18363
18364
18365
18366
18367
18368
18369
18370
18371
18372
18373
18374
18375
18376
18377
18378
18379
18380
18381
18382
18383
18384
18385
18386
18387
18388
18389
18390
18391
18392
18393
18394
18395
18396
18397
18398
18399
18400
18401
18402
18403
18404
18405
18406
18407
18408
18409
18410
18411
18412
18413
18414
18415
18416
18417
18418
18419
18420
18421
18422
18423
18424
18425
18426
18427
18428
18429
18430
18431
18432
18433
18434
18435
18436
18437
18438
18439
18440
18441
18442
18443
18444
18445
18446
18447
18448
18449
18450
18451
18452
18453
18454
18455
18456
18457
18458
18459
18460
18461
18462
18463
18464
18465
18466
18467
18468
18469
18470
18471
18472
18473
18474
18475
18476
18477
18478
18479
18480
18481
18482
18483
18484
18485
18486
18487
18488
18489
18490
18491
18492
18493
18494
18495
18496
18497
18498
18499
18500
18501
18502
18503
18504
18505
18506
18507
18508
18509
18510
18511
18512
18513
18514
18515
18516
18517
18518
18519
18520
18521
18522
18523
18524
18525
18526
18527
18528
18529
18530
18531
18532
18533
18534
18535
18536
18537
18538
18539
18540
18541
18542
18543
18544
18545
18546
18547
18548
18549
18550
18551
18552
18553
18554
18555
18556
18557
18558
18559
18560
18561
18562
18563
18564
18565
18566
18567
18568
18569
18570
18571
18572
18573
18574
18575
18576
18577
18578
18579
18580
18581
18582
18583
18584
18585
18586
18587
18588
18589
18590
18591
18592
18593
18594
18595
18596
18597
18598
18599
18600
18601
18602
18603
18604
18605
18606
18607
18608
18609
18610
18611
18612
18613
18614
18615
18616
18617
18618
18619
18620
18621
18622
18623
18624
18625
18626
18627
18628
18629
18630
18631
18632
18633
18634
18635
18636
18637
18638
18639
18640
18641
18642
18643
18644
18645
18646
18647
18648
18649
18650
18651
18652
18653
18654
18655
18656
18657
18658
18659
18660
18661
18662
18663
18664
18665
18666
18667
18668
18669
18670
18671
18672
18673
18674
18675
18676
18677
18678
18679
18680
18681
18682
18683
18684
18685
18686
18687
18688
18689
18690
18691
18692
18693
18694
18695
18696
18697
18698
18699
18700
18701
18702
18703
18704
18705
18706
18707
18708
18709
18710
18711
18712
18713
18714
18715
18716
18717
18718
18719
18720
18721
18722
18723
18724
18725
18726
18727
18728
18729
18730
18731
18732
18733
18734
18735
18736
18737
18738
18739
18740
18741
18742
18743
18744
18745
18746
18747
18748
18749
18750
|
/* packet-rtps.c
* ~~~~~~~~~~~~~
*
* Routines for Real-Time Publish-Subscribe Protocol (RTPS) dissection
*
* (c) 2005-2014 Copyright, Real-Time Innovations, Inc.
* Real-Time Innovations, Inc.
* 232 East Java Drive
* Sunnyvale, CA 94089
*
* Copyright 2003, LUKAS POKORNY <maskis@seznam.cz>
* PETR SMOLIK <petr.smolik@wo.cz>
* ZDENEK SEBEK <sebek@fel.cvut.cz>
*
* Czech Technical University in Prague
* Faculty of Electrical Engineering <www.fel.cvut.cz>
* Department of Control Engineering <dce.felk.cvut.cz>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* -------------------------------------
*
* The following file is part of the RTPS packet dissector for Wireshark.
*
* RTPS protocol was developed by Real-Time Innovations, Inc. as wire
* protocol for Data Distribution System.
* Additional information at:
*
* OMG DDS standards: http://portals.omg.org/dds/omg-dds-standard/
*
* Older OMG DDS specification:
* http://www.omg.org/cgi-bin/doc?ptc/2003-07-07
*
* NDDS and RTPS information: http://www.rti.com/resources.html
*
* Vendor ID listing can be found at:
* https://www.dds-foundation.org/dds-rtps-vendor-and-product-ids/
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/prefs.h>
#include "packet-rtps.h"
#include <epan/addr_resolv.h>
#include <epan/exceptions.h>
#include <epan/proto_data.h>
#include <epan/reassemble.h>
#include <epan/tfs.h>
#include <epan/unit_strings.h>
#include <wsutil/array.h>
#if defined(HAVE_ZLIB) && !defined(HAVE_ZLIBNG)
#define ZLIB_CONST
#define ZLIB_PREFIX(x) x
#include <zlib.h>
typedef z_stream zlib_stream;
#endif /* HAVE_ZLIB */
#ifdef HAVE_ZLIBNG
#define ZLIB_PREFIX(x) zng_ ## x
#include <zlib-ng.h>
typedef zng_stream zlib_stream;
#endif /* HAVE_ZLIBNG */
#include <epan/crc32-tvb.h>
#include <wsutil/crc32.h>
#include <wsutil/str_util.h>
#include <gcrypt.h>
#include <uat.h>
void proto_register_rtps(void);
void proto_reg_handoff_rtps(void);
#define MAX_GUID_PREFIX_SIZE (128)
#define MAX_GUID_SIZE (160)
#define GUID_SIZE (16)
#define MAX_VENDOR_ID_SIZE (128)
#define MAX_PARAM_SIZE (256)
#define MAX_TIMESTAMP_SIZE (128)
#define LONG_ALIGN(x) (x = (x+3)&0xfffffffc)
#define SHORT_ALIGN(x) (x = (x+1)&0xfffffffe)
#define MAX_ARRAY_DIMENSION 10
#define ALIGN_ME(offset, alignment) \
offset = (((offset) + ((alignment) - 1)) & ~((alignment) - 1))
#define ALIGN_ZERO(offset, alignment, zero) (offset -= zero, ALIGN_ME(offset, alignment), offset += zero)
#define KEY_COMMENT (" //@key")
#define LONG_ALIGN_ZERO(x,zero) (x -= zero, LONG_ALIGN(x), x += zero)
#define SHORT_ALIGN_ZERO(x,zero) (x -= zero, SHORT_ALIGN(x), x += zero)
#define DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE (100)
#define DISSECTION_INFO_ARRAY_MAX_ELEMENTS_DEFAULT_VALUE (100)
#define DISSECTION_INFO_REMAINING_ELEMENTS_STR_d "... %d items(s) remaining. The number of items shown is configurable through RTPS properties under Preferences/Protocols."
#define MAX_MEMBER_NAME (256)
#define HASHMAP_DISCRIMINATOR_CONSTANT (-2)
#define UUID_SIZE (9)
#define LONG_ADDRESS_SIZE (16)
#define INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS 7
#define SEQUENCE_100_IINSTANCE_TRANSITION_DATA_BOUND 100
#define INSTANCE_TRANSITION_DATA_NUM_ELEMENTS 4
#define GUID_T_NUM_ELEMENTS 1
#define VALUE_NUM_ELEMENTS 16
#define KEY_HAS_VALUE_NUM_ELEMENTS 16
#define NTPTIME_T_NUM_ELEMENTS 2
#define SEQUENCE_NUMBER_T_NUM_ELEMENTS 2
#define SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH 16 /* bytes. */
typedef struct _union_member_mapping {
uint64_t union_type_id;
uint64_t member_type_id;
int32_t discriminator;
char member_name[MAX_MEMBER_NAME];
} union_member_mapping;
typedef struct _mutable_member_mapping {
int64_t key;
uint64_t struct_type_id;
uint64_t member_type_id;
uint32_t member_id;
char member_name[MAX_MEMBER_NAME];
} mutable_member_mapping;
typedef struct _dissection_element {
uint64_t type_id;
uint16_t flags;
uint32_t member_id;
char member_name[MAX_MEMBER_NAME];
} dissection_element;
typedef enum {
EXTENSIBILITY_INVALID = 1,
EXTENSIBILITY_FINAL,
EXTENSIBILITY_EXTENSIBLE,
EXTENSIBILITY_MUTABLE
} RTICdrTypeObjectExtensibility;
typedef struct _dissection_info {
uint64_t type_id;
int member_kind;
uint64_t base_type_id;
uint32_t member_length;
char member_name[MAX_MEMBER_NAME];
RTICdrTypeObjectExtensibility extensibility;
int32_t bound;
uint32_t num_elements;
dissection_element* elements;
} dissection_info;
typedef struct _submessage_col_info {
const char* status_info;
const char* topic_name;
const char* data_session_kind;
} submessage_col_info;
typedef enum {
RTI_CDR_TK_NULL = 0,
RTI_CDR_TK_SHORT,
RTI_CDR_TK_LONG,
RTI_CDR_TK_USHORT,
RTI_CDR_TK_ULONG,
RTI_CDR_TK_FLOAT,
RTI_CDR_TK_DOUBLE,
RTI_CDR_TK_BOOLEAN,
RTI_CDR_TK_CHAR,
RTI_CDR_TK_OCTET,
RTI_CDR_TK_STRUCT,
RTI_CDR_TK_UNION,
RTI_CDR_TK_ENUM,
RTI_CDR_TK_STRING,
RTI_CDR_TK_SEQUENCE,
RTI_CDR_TK_ARRAY,
RTI_CDR_TK_ALIAS,
RTI_CDR_TK_LONGLONG,
RTI_CDR_TK_ULONGLONG,
RTI_CDR_TK_LONGDOUBLE,
RTI_CDR_TK_WCHAR,
RTI_CDR_TK_WSTRING,
RTI_CDR_TK_VALUE,
RTI_CDR_TK_VALUE_PARAM
} RTICdrTCKind;
typedef enum {
RTI_CDR_TYPE_OBJECT_TYPE_KIND_NO_TYPE=0,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE=1,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE=2,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE=3,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE=4,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE=5,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE=6,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE=7,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE=8,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE=9,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE=10,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE=11,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE=12,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_32_TYPE=13,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE=14,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_BITSET_TYPE=15,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE=16,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE=17,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE=18,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE=19,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_MAP_TYPE=20,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE=21,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE=22,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_ANNOTATION_TYPE=23,
RTI_CDR_TYPE_OBJECT_TYPE_KIND_MODULE=24
} RTICdrTypeObjectTypeKind;
typedef struct _rtps_dissector_data {
uint16_t encapsulation_id;
/* Represents the position of a sample within a batch. Since the
position can be 0, we use -1 as not valid (not a batch) */
int position_in_batch;
} rtps_dissector_data;
typedef struct _rtps_tvb_field {
tvbuff_t *tvb;
int tvb_offset;
int tvb_len;
} rtps_tvb_field;
static const value_string type_object_kind [] = {
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_NO_TYPE, "NO_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE, "BOOLEAN_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE, "BYTE_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE, "INT_16_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE, "UINT_16_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE, "INT_32_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE, "UINT_32_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE, "INT_64_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE, "UINT_64_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE, "FLOAT_32_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE, "FLOAT_64_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE, "FLOAT_128_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE, "CHAR_8_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_32_TYPE, "CHAR_32_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE, "ENUMERATION_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_BITSET_TYPE, "BITSET_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE, "ALIAS_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE, "ARRAY_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE, "SEQUENCE_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE, "STRING_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_MAP_TYPE, "MAP_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE, "UNION_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE, "STRUCTURE_TYPE" },
{ RTI_CDR_TYPE_OBJECT_TYPE_KIND_ANNOTATION_TYPE, "ANNOTATION_TYPE" },
{ 0, NULL }
};
static wmem_map_t * dissection_infos;
static wmem_map_t * builtin_dissection_infos;
static wmem_map_t * union_member_mappings;
static wmem_map_t * mutable_member_mappings;
/***************************************************************************/
/* Preferences */
/***************************************************************************/
static unsigned rtps_max_batch_samples_dissected = 16;
static unsigned rtps_max_data_type_elements = DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE;
static unsigned rtps_max_array_data_type_elements = DISSECTION_INFO_ARRAY_MAX_ELEMENTS_DEFAULT_VALUE;
static bool enable_topic_info = true;
static bool enable_rtps_reassembly = false;
static bool enable_user_data_dissection = false;
static bool enable_max_array_data_type_elements = true;
static bool enable_max_data_type_elements = true;
static bool enable_rtps_crc_check = false;
static bool enable_rtps_psk_decryption = false;
static dissector_table_t rtps_type_name_table;
/***************************************************************************/
/* Variable definitions */
/***************************************************************************/
#define RTPS_MAGIC_NUMBER 0x52545053 /* RTPS */
#define RTPX_MAGIC_NUMBER 0x52545058 /* RTPX */
#define RTPS_SEQUENCENUMBER_UNKNOWN 0xffffffff00000000 /* {-1,0} as uint64 */
#define RTPS_TOPIC_QUERY_SELECTION_KIND_HISTORY_SNAPSHOT 0
#define RTPS_TOPIC_QUERY_SELECTION_KIND_CONTINUOUS 1
/* Traffic type */
#define PORT_BASE (7400)
#define DOMAIN_GAIN (250)
#define PORT_METATRAFFIC_UNICAST (0)
#define PORT_USERTRAFFIC_MULTICAST (1)
#define PORT_METATRAFFIC_MULTICAST (2)
#define PORT_USERTRAFFIC_UNICAST (3)
/* Flags defined in the 'flag' bitmask of a submessage */
#define FLAG_E (0x01) /* Common to all the submessages */
#define FLAG_DATA_D (0x02)
#define FLAG_DATA_D_v2 (0x04)
#define FLAG_DATA_A (0x04)
#define FLAG_DATA_H (0x08)
#define FLAG_DATA_Q (0x10)
#define FLAG_DATA_Q_v2 (0x02)
#define FLAG_DATA_FRAG_Q (0x02)
#define FLAG_DATA_FRAG_H (0x04)
#define FLAG_DATA_I (0x10)
#define FLAG_DATA_U (0x20)
#define FLAG_NOKEY_DATA_Q (0x02)
#define FLAG_NOKEY_DATA_D (0x04)
#define FLAG_ACKNACK_F (0x02)
#define FLAG_HEARTBEAT_F (0x02)
#define FLAG_GAP_F (0x02)
#define FLAG_INFO_TS_T (0x02)
#define FLAG_INFO_REPLY_IP4_M (0x02)
#define FLAG_INFO_REPLY_M (0x02)
#define FLAG_RTPS_DATA_Q (0x02)
#define FLAG_RTPS_DATA_D (0x04)
#define FLAG_RTPS_DATA_K (0x08)
#define FLAG_RTPS_DATA_FRAG_Q (0x02)
#define FLAG_RTPS_DATA_FRAG_K (0x04)
#define FLAG_RTPS_DATA_BATCH_Q (0x02)
#define FLAG_SAMPLE_INFO_T (0x01)
#define FLAG_SAMPLE_INFO_Q (0x02)
#define FLAG_SAMPLE_INFO_O (0x04)
#define FLAG_SAMPLE_INFO_D (0x08)
#define FLAG_SAMPLE_INFO_I (0x10)
#define FLAG_SAMPLE_INFO_K (0x20)
#define FLAG_VIRTUAL_HEARTBEAT_V (0x02)
#define FLAG_VIRTUAL_HEARTBEAT_W (0x04)
#define FLAG_VIRTUAL_HEARTBEAT_N (0x08)
/* UDPv4 WAN Transport locator flags */
#define FLAG_UDPV4_WAN_LOCATOR_U (0x01)
#define FLAG_UDPV4_WAN_LOCATOR_P (0x02)
#define FLAG_UDPV4_WAN_LOCATOR_B (0x04)
#define FLAG_UDPV4_WAN_LOCATOR_R (0x08)
/* UDP WAN BINDING_PING submessage flags */
#define FLAG_UDPV4_WAN_BINDING_PING_FLAG_E (0x01)
#define FLAG_UDPV4_WAN_BINDING_PING_FLAG_L (0x02)
#define FLAG_UDPV4_WAN_BINDING_PING_FLAG_B (0x04)
/* The following PIDs are defined since RTPS 1.0 */
#define PID_PAD (0x00)
#define PID_SENTINEL (0x01)
#define PID_PARTICIPANT_LEASE_DURATION (0x02)
#define PID_TIME_BASED_FILTER (0x04)
#define PID_TOPIC_NAME (0x05)
#define PID_OWNERSHIP_STRENGTH (0x06)
#define PID_TYPE_NAME (0x07)
#define PID_METATRAFFIC_MULTICAST_IPADDRESS (0x0b)
#define PID_DEFAULT_UNICAST_IPADDRESS (0x0c)
#define PID_METATRAFFIC_UNICAST_PORT (0x0d)
#define PID_DEFAULT_UNICAST_PORT (0x0e)
#define PID_MULTICAST_IPADDRESS (0x11)
#define PID_PROTOCOL_VERSION (0x15)
#define PID_VENDOR_ID (0x16)
#define PID_RELIABILITY (0x1a)
#define PID_LIVELINESS (0x1b)
#define PID_DURABILITY (0x1d)
#define PID_DURABILITY_SERVICE (0x1e)
#define PID_OWNERSHIP (0x1f)
#define PID_PRESENTATION (0x21)
#define PID_DEADLINE (0x23)
#define PID_DESTINATION_ORDER (0x25)
#define PID_LATENCY_BUDGET (0x27)
#define PID_PARTITION (0x29)
#define PID_LIFESPAN (0x2b)
#define PID_USER_DATA (0x2c)
#define PID_GROUP_DATA (0x2d)
#define PID_TOPIC_DATA (0x2e)
#define PID_UNICAST_LOCATOR (0x2f)
#define PID_MULTICAST_LOCATOR (0x30)
#define PID_DEFAULT_UNICAST_LOCATOR (0x31)
#define PID_METATRAFFIC_UNICAST_LOCATOR (0x32)
#define PID_METATRAFFIC_MULTICAST_LOCATOR (0x33)
#define PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT (0x34)
#define PID_CONTENT_FILTER_PROPERTY (0x35)
#define PID_PROPERTY_LIST_OLD (0x36) /* For compatibility between 4.2d and 4.2e */
#define PID_HISTORY (0x40)
#define PID_RESOURCE_LIMIT (0x41)
#define PID_EXPECTS_INLINE_QOS (0x43)
#define PID_PARTICIPANT_BUILTIN_ENDPOINTS (0x44)
#define PID_METATRAFFIC_UNICAST_IPADDRESS (0x45)
#define PID_METATRAFFIC_MULTICAST_PORT (0x46)
#define PID_TYPECODE (0x47)
#define PID_PARTICIPANT_GUID (0x50)
#define PID_PARTICIPANT_ENTITY_ID (0x51)
#define PID_GROUP_GUID (0x52)
#define PID_GROUP_ENTITY_ID (0x53)
#define PID_FILTER_SIGNATURE (0x55)
#define PID_COHERENT_SET (0x56)
#define PID_GROUP_COHERENT_SET (0x0063)
#define PID_END_COHERENT_SET (0x8022)
#define PID_END_GROUP_COHERENT_SET (0x8023)
#define MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT (0x8024)
/* The following QoS are deprecated */
#define PID_PERSISTENCE (0x03)
#define PID_TYPE_CHECKSUM (0x08)
#define PID_TYPE2_NAME (0x09)
#define PID_TYPE2_CHECKSUM (0x0a)
#define PID_EXPECTS_ACK (0x10)
#define PID_MANAGER_KEY (0x12)
#define PID_SEND_QUEUE_SIZE (0x13)
#define PID_RELIABILITY_ENABLED (0x14)
#define PID_RECV_QUEUE_SIZE (0x18)
#define PID_VARGAPPS_SEQUENCE_NUMBER_LAST (0x17)
#define PID_RELIABILITY_OFFERED (0x19)
#define PID_LIVELINESS_OFFERED (0x1c)
#define PID_OWNERSHIP_OFFERED (0x20)
#define PID_PRESENTATION_OFFERED (0x22)
#define PID_DEADLINE_OFFERED (0x24)
#define PID_DESTINATION_ORDER_OFFERED (0x26)
#define PID_LATENCY_BUDGET_OFFERED (0x28)
#define PID_PARTITION_OFFERED (0x2a)
/* The following PIDs are defined since RTPS 2.0 */
#define PID_DEFAULT_MULTICAST_LOCATOR (0x0048)
#define PID_TRANSPORT_PRIORITY (0x0049)
#define PID_CONTENT_FILTER_INFO (0x0055)
#define PID_DIRECTED_WRITE (0x0057)
#define PID_BUILTIN_ENDPOINT_SET (0x0058)
#define PID_PROPERTY_LIST (0x0059) /* RTI DDS 4.2e and newer */
#define PID_ENDPOINT_GUID (0x005a)
#define PID_TYPE_MAX_SIZE_SERIALIZED (0x0060)
#define PID_ORIGINAL_WRITER_INFO (0x0061)
#define PID_ENTITY_NAME (0x0062)
#define PID_KEY_HASH (0x0070)
#define PID_STATUS_INFO (0x0071)
#define PID_TYPE_OBJECT (0x0072)
#define PID_DATA_REPRESENTATION (0x0073)
#define PID_TYPE_CONSISTENCY (0x0074)
#define PID_EQUIVALENT_TYPE_NAME (0x0075)
#define PID_BASE_TYPE_NAME (0x0076)
#define PID_BUILTIN_ENDPOINT_QOS (0x0077)
#define PID_ENABLE_AUTHENTICATION (0x0078)
#define PID_RELATED_ENTITY_GUID (0x0081)
#define PID_RELATED_ORIGINAL_WRITER_INFO (0x0083)/* inline QoS */
#define PID_DOMAIN_ID (0x000f)
#define PID_DOMAIN_TAG (0x4014)
/* Vendor-specific: RTI */
#define PID_PRODUCT_VERSION (0x8000)
#define PID_PLUGIN_PROMISCUITY_KIND (0x8001)
#define PID_ENTITY_VIRTUAL_GUID (0x8002)
#define PID_SERVICE_KIND (0x8003)
#define PID_TYPECODE_RTPS2 (0x8004) /* Was: 0x47 in RTPS 1.2 */
#define PID_DISABLE_POSITIVE_ACKS (0x8005)
#define PID_LOCATOR_FILTER_LIST (0x8006)
#define PID_EXPECTS_VIRTUAL_HB (0x8009)
#define PID_ROLE_NAME (0x800a)
#define PID_ACK_KIND (0x800b)
#define PID_PEER_HOST_EPOCH (0x800e)
#define PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY (0x800f)/* inline QoS */
#define PID_RTI_DOMAIN_ID (0x800f)
#define PID_RELATED_READER_GUID (0x8010)/* inline QoS */
#define PID_TRANSPORT_INFO_LIST (0x8010)
#define PID_SOURCE_GUID (0x8011)/* inline QoS */
#define PID_DIRECT_COMMUNICATION (0x8011)
#define PID_RELATED_SOURCE_GUID (0x8012)/* inline QoS */
#define PID_TOPIC_QUERY_GUID (0x8013)/* inline QoS */
#define PID_TOPIC_QUERY_PUBLICATION (0x8014)
#define PID_ENDPOINT_PROPERTY_CHANGE_EPOCH (0x8015)
#define PID_REACHABILITY_LEASE_DURATION (0x8016)
#define PID_VENDOR_BUILTIN_ENDPOINT_SET (0x8017)
#define PID_ENDPOINT_SECURITY_ATTRIBUTES (0x8018)
#define PID_SAMPLE_SIGNATURE (0x8019)/* inline QoS */
#define PID_EXTENDED (0x3f01)
#define PID_LIST_END (0x3f02)
#define PID_UNICAST_LOCATOR_EX (0x8007)
#define PID_IDENTITY_TOKEN (0x1001)
#define PID_PERMISSIONS_TOKEN (0x1002)
#define PID_DATA_TAGS (0x1003)
#define PID_ENDPOINT_SECURITY_INFO (0x1004)
#define PID_PARTICIPANT_SECURITY_INFO (0x1005)
#define PID_IDENTITY_STATUS_TOKEN (0x1006)
#define PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO (0x1010)
#define PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO (0x1011)
#define PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO (0x1012)
#define PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO (0x1013)
#define PID_TYPE_OBJECT_LB (0x8021)
/* Vendor-specific: ADLink */
#define PID_ADLINK_WRITER_INFO (0x8001)
#define PID_ADLINK_READER_DATA_LIFECYCLE (0x8002)
#define PID_ADLINK_WRITER_DATA_LIFECYCLE (0x8003)
#define PID_ADLINK_ENDPOINT_GUID (0x8004)
#define PID_ADLINK_SYNCHRONOUS_ENDPOINT (0x8005)
#define PID_ADLINK_RELAXED_QOS_MATCHING (0x8006)
#define PID_ADLINK_PARTICIPANT_VERSION_INFO (0x8007)
#define PID_ADLINK_NODE_NAME (0x8008)
#define PID_ADLINK_EXEC_NAME (0x8009)
#define PID_ADLINK_PROCESS_ID (0x800a)
#define PID_ADLINK_SERVICE_TYPE (0x800b)
#define PID_ADLINK_ENTITY_FACTORY (0x800c)
#define PID_ADLINK_WATCHDOG_SCHEDULING (0x800d)
#define PID_ADLINK_LISTENER_SCHEDULING (0x800e)
#define PID_ADLINK_SUBSCRIPTION_KEYS (0x800f)
#define PID_ADLINK_READER_LIFESPAN (0x8010)
#define PID_ADLINK_SHARE (0x8011)
#define PID_ADLINK_TYPE_DESCRIPTION (0x8012)
#define PID_ADLINK_LAN_ID (0x8013)
#define PID_ADLINK_ENDPOINT_GID (0x8014)
#define PID_ADLINK_GROUP_GID (0x8015)
#define PID_ADLINK_EOTINFO (0x8016)
#define PID_ADLINK_PART_CERT_NAME (0x8017)
#define PID_ADLINK_LAN_CERT_NAME (0x8018)
/* appId.appKind possible values */
#define APPKIND_UNKNOWN (0x00)
#define APPKIND_MANAGED_APPLICATION (0x01)
#define APPKIND_MANAGER (0x02)
#define RTI_SERVICE_REQUEST_ID_UNKNOWN 0
#define RTI_SERVICE_REQUEST_ID_TOPIC_QUERY 1
#define RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY 2
#define RTI_SERVICE_REQUEST_ID_INSTANCE_STATE 3
/* Predefined EntityId */
#define ENTITYID_UNKNOWN (0x00000000)
#define ENTITYID_PARTICIPANT (0x000001c1)
#define ENTITYID_BUILTIN_TOPIC_WRITER (0x000002c2)
#define ENTITYID_BUILTIN_TOPIC_READER (0x000002c7)
#define ENTITYID_BUILTIN_PUBLICATIONS_WRITER (0x000003c2)
#define ENTITYID_BUILTIN_PUBLICATIONS_READER (0x000003c7)
#define ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER (0x000004c2)
#define ENTITYID_BUILTIN_SUBSCRIPTIONS_READER (0x000004c7)
#define ENTITYID_BUILTIN_PARTICIPANT_WRITER (0x000100c2)
#define ENTITYID_BUILTIN_PARTICIPANT_READER (0x000100c7)
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER (0x000200c2)
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER (0x000200c7)
#define ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER (0x00010082)
#define ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER (0x00010087)
#define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER (0x00010182)
#define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER (0x00010187)
#define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER (0xff010182)
#define ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER (0xff010187)
#define ENTITYID_RESERVED_META_CST_GROUP_WRITER (0xcb)
#define ENTITYID_RESERVED_META_GROUP_WRITER (0xcc)
#define ENTITYID_RESERVED_META_GROUP_READER (0xcd)
#define ENTITYID_RESERVED_META_CST_GROUP_READER (0xce)
#define ENTITYID_OBJECT_NORMAL_META_WRITER_GROUP (0x88)
#define ENTITYID_OBJECT_NORMAL_META_READER_GROUP (0x89)
#define ENTITYID_OBJECT_NORMAL_META_TOPIC (0x8a)
#define ENTITYID_NORMAL_META_CST_GROUP_WRITER (0x8b)
#define ENTITYID_NORMAL_META_GROUP_WRITER (0x8c)
#define ENTITYID_NORMAL_META_GROUP_READER (0x8d)
#define ENTITYID_NORMAL_META_CST_GROUP_READER (0x8e)
#define ENTITYID_RESERVED_USER_CST_GROUP_WRITER (0x4b)
#define ENTITYID_RESERVED_USER_GROUP_WRITER (0x4c)
#define ENTITYID_RESERVED_USER_GROUP_READER (0x4d)
#define ENTITYID_RESERVED_USER_CST_GROUP_READER (0x4e)
#define ENTITYID_NORMAL_USER_CST_GROUP_WRITER (0x0b)
#define ENTITYID_NORMAL_USER_GROUP_WRITER (0x0c)
#define ENTITYID_NORMAL_USER_GROUP_READER (0x0d)
#define ENTITYID_NORMAL_USER_CST_GROUP_READER (0x0e)
/* Secure DDS */
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER (0x000201c3)
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER (0x000201c4)
#define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER (0xff0003c2)
#define ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER (0xff0003c7)
#define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER (0xff0004c2)
#define ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER (0xff0004c7)
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER (0xff0200c2)
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER (0xff0200c7)
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER (0xff0202c3)
#define ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER (0xff0202c4)
#define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER (0xff0101c2)
#define ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER (0xff0101c7)
/* Vendor-specific: RTI */
#define ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER (0x00020082)
#define ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER (0x00020087)
#define ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER (0x00020182)
#define ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER (0x00020187)
/* Deprecated EntityId */
#define ENTITYID_APPLICATIONS_WRITER (0x000001c2)
#define ENTITYID_APPLICATIONS_READER (0x000001c7)
#define ENTITYID_CLIENTS_WRITER (0x000005c2)
#define ENTITYID_CLIENTS_READER (0x000005c7)
#define ENTITYID_SERVICES_WRITER (0x000006c2)
#define ENTITYID_SERVICES_READER (0x000006c7)
#define ENTITYID_MANAGERS_WRITER (0x000007c2)
#define ENTITYID_MANAGERS_READER (0x000007c7)
#define ENTITYID_APPLICATION_SELF (0x000008c1)
#define ENTITYID_APPLICATION_SELF_WRITER (0x000008c2)
#define ENTITYID_APPLICATION_SELF_READER (0x000008c7)
/* Predefined Entity Kind */
#define ENTITYKIND_APPDEF_UNKNOWN (0x00)
#define ENTITYKIND_APPDEF_PARTICIPANT (0x01)
#define ENTITYKIND_APPDEF_WRITER_WITH_KEY (0x02)
#define ENTITYKIND_APPDEF_WRITER_NO_KEY (0x03)
#define ENTITYKIND_APPDEF_READER_NO_KEY (0x04)
#define ENTITYKIND_APPDEF_READER_WITH_KEY (0x07)
#define ENTITYKIND_BUILTIN_PARTICIPANT (0xc1)
#define ENTITYKIND_BUILTIN_WRITER_WITH_KEY (0xc2)
#define ENTITYKIND_BUILTIN_WRITER_NO_KEY (0xc3)
#define ENTITYKIND_BUILTIN_READER_NO_KEY (0xc4)
#define ENTITYKIND_BUILTIN_READER_WITH_KEY (0xc7)
/* vendor specific RTI */
#define ENTITYKIND_RTI_BUILTIN_WRITER_WITH_KEY (0x82)
#define ENTITYKIND_RTI_BUILTIN_WRITER_NO_KEY (0x83)
#define ENTITYKIND_RTI_BUILTIN_READER_NO_KEY (0x84)
#define ENTITYKIND_RTI_BUILTIN_READER_WITH_KEY (0x87)
/* Submessage Type */
#define SUBMESSAGE_HEADER_EXTENSION (0x0)
#define SUBMESSAGE_PAD (0x01)
#define SUBMESSAGE_DATA (0x02)
#define SUBMESSAGE_NOKEY_DATA (0x03)
#define SUBMESSAGE_ACKNACK (0x06)
#define SUBMESSAGE_HEARTBEAT (0x07)
#define SUBMESSAGE_GAP (0x08)
#define SUBMESSAGE_INFO_TS (0x09)
#define SUBMESSAGE_INFO_SRC (0x0c)
#define SUBMESSAGE_INFO_REPLY_IP4 (0x0d)
#define SUBMESSAGE_INFO_DST (0x0e)
#define SUBMESSAGE_INFO_REPLY (0x0f)
#define SUBMESSAGE_DATA_FRAG (0x10) /* RTPS 2.0 Only */
#define SUBMESSAGE_NOKEY_DATA_FRAG (0x11) /* RTPS 2.0 Only */
#define SUBMESSAGE_NACK_FRAG (0x12) /* RTPS 2.0 Only */
#define SUBMESSAGE_HEARTBEAT_FRAG (0x13) /* RTPS 2.0 Only */
#define SUBMESSAGE_RTPS_DATA_SESSION (0x14) /* RTPS 2.1 only */
#define SUBMESSAGE_RTPS_DATA (0x15) /* RTPS 2.1 only */
#define SUBMESSAGE_RTPS_DATA_FRAG (0x16) /* RTPS 2.1 only */
#define SUBMESSAGE_ACKNACK_BATCH (0x17) /* RTPS 2.1 only */
#define SUBMESSAGE_RTPS_DATA_BATCH (0x18) /* RTPS 2.1 Only */
#define SUBMESSAGE_HEARTBEAT_BATCH (0x19) /* RTPS 2.1 only */
#define SUBMESSAGE_ACKNACK_SESSION (0x1a) /* RTPS 2.1 only */
#define SUBMESSAGE_HEARTBEAT_SESSION (0x1b) /* RTPS 2.1 only */
#define SUBMESSAGE_APP_ACK (0x1c)
#define SUBMESSAGE_APP_ACK_CONF (0x1d)
#define SUBMESSAGE_HEARTBEAT_VIRTUAL (0x1e)
#define SUBMESSAGE_SEC_BODY (0x30)
#define SUBMESSAGE_SEC_PREFIX (0x31)
#define SUBMESSAGE_SEC_POSTFIX (0x32)
#define SUBMESSAGE_SRTPS_PREFIX (0x33)
#define SUBMESSAGE_SRTPS_POSTFIX (0x34)
#define SUBMESSAGE_RTI_CRC (0x80)
#define SUBMESSAGE_RTI_DATA_FRAG_SESSION (0x81) /* Vendor Specific */
#define SUBMESSAGE_RTI_UDP_WAN_BINDING_PING (0x82)
/* An invalid IP Address:
* Make sure the _STRING macro is bigger than a normal IP
*/
#define IPADDRESS_INVALID (0)
#define IPADDRESS_INVALID_STRING "ADDRESS_INVALID"
/* Identifies the value of an invalid port number:
* Make sure the _STRING macro is bigger than a normal port
*/
#define PORT_INVALID (0)
#define PORT_INVALID_STRING "PORT_INVALID"
/* Protocol Vendor Information (uint16_t) as per July 2020 */
#define RTPS_VENDOR_UNKNOWN (0x0000)
#define RTPS_VENDOR_UNKNOWN_STRING "VENDOR_ID_UNKNOWN (0x0000)"
#define RTPS_VENDOR_RTI_DDS (0x0101)
#define RTPS_VENDOR_RTI_DDS_STRING "Real-Time Innovations, Inc. - Connext DDS"
#define RTPS_VENDOR_ADL_DDS (0x0102)
#define RTPS_VENDOR_ADL_DDS_STRING "ADLink Ltd. - OpenSplice DDS"
#define RTPS_VENDOR_OCI (0x0103)
#define RTPS_VENDOR_OCI_STRING "Object Computing, Inc. (OCI) - OpenDDS"
#define RTPS_VENDOR_MILSOFT (0x0104)
#define RTPS_VENDOR_MILSOFT_STRING "MilSoft"
#define RTPS_VENDOR_KONGSBERG (0x0105)
#define RTPS_VENDOR_KONGSBERG_STRING "Kongsberg - InterCOM DDS"
#define RTPS_VENDOR_TOC (0x0106)
#define RTPS_VENDOR_TOC_STRING "TwinOaks Computing, Inc. - CoreDX DDS"
#define RTPS_VENDOR_LAKOTA_TSI (0x0107)
#define RTPS_VENDOR_LAKOTA_TSI_STRING "Lakota Technical Solutions, Inc."
#define RTPS_VENDOR_ICOUP (0x0108)
#define RTPS_VENDOR_ICOUP_STRING "ICOUP Consulting"
#define RTPS_VENDOR_ETRI (0x0109)
#define RTPS_VENDOR_ETRI_STRING "Electronics and Telecommunication Research Institute (ETRI) - Diamond DDS"
#define RTPS_VENDOR_RTI_DDS_MICRO (0x010A)
#define RTPS_VENDOR_RTI_DDS_MICRO_STRING "Real-Time Innovations, Inc. (RTI) - Connext DDS Micro"
#define RTPS_VENDOR_ADL_CAFE (0x010B)
#define RTPS_VENDOR_ADL_CAFE_STRING "ADLink Ltd. - Vortex Cafe"
#define RTPS_VENDOR_PT (0x010C)
#define RTPS_VENDOR_PT_STRING "PrismTech"
#define RTPS_VENDOR_ADL_LITE (0x010D)
#define RTPS_VENDOR_ADL_LITE_STRING "ADLink Ltd. - Vortex Lite"
#define RTPS_VENDOR_TECHNICOLOR (0x010E)
#define RTPS_VENDOR_TECHNICOLOR_STRING "Technicolor Inc. - Qeo"
#define RTPS_VENDOR_EPROSIMA (0x010F)
#define RTPS_VENDOR_EPROSIMA_STRING "eProsima - Fast-RTPS"
#define RTPS_VENDOR_ECLIPSE (0x0110)
#define RTPS_VENDOR_ECLIPSE_STRING "Eclipse Foundation - Cyclone DDS"
#define RTPS_VENDOR_GURUM (0x0111)
#define RTPS_VENDOR_GURUM_STRING "GurumNetworks Ltd. - GurumDDS"
#define RTPS_VENDOR_RUST (0x0112)
#define RTPS_VENDOR_RUST_STRING "Atostek - RustDDS"
#define RTPS_VENDOR_ZRDDS (0x0113)
#define RTPS_VENDOR_ZRDDS_STRING "Nanjing Zhenrong Software Technology Co. - ZRDDS"
#define RTPS_VENDOR_DUST (0x0114)
#define RTPS_VENDOR_DUST_STRING "S2E Software Systems B.V. - Dust DDS"
/* Data encapsulation */
#define ENCAPSULATION_CDR_BE (0x0000)
#define ENCAPSULATION_CDR_LE (0x0001)
#define ENCAPSULATION_PL_CDR_BE (0x0002)
#define ENCAPSULATION_PL_CDR_LE (0x0003)
#define ENCAPSULATION_CDR2_BE (0x0006)
#define ENCAPSULATION_CDR2_LE (0x0007)
#define ENCAPSULATION_D_CDR2_BE (0x0008)
#define ENCAPSULATION_D_CDR2_LE (0x0009)
#define ENCAPSULATION_PL_CDR2_BE (0x000a)
#define ENCAPSULATION_PL_CDR2_LE (0x000b)
#define ENCAPSULATION_SHMEM_REF_PLAIN (0xC000)
#define ENCAPSULATION_SHMEM_REF_FLAT_DATA (0xC001)
/* Data encapsulation options */
#define ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK (0x1C)
#define GET_ENCAPSULATION_COMPRESSION_OPTIONS(encapsulation_options_in, compression_options_out) \
(compression_options_out = (((encapsulation_options_in) & (ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK)) >> 2))
#define ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK
#define ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK (0x3)
/* Parameter Liveliness */
#define LIVELINESS_AUTOMATIC (0)
#define LIVELINESS_BY_PARTICIPANT (1)
#define LIVELINESS_BY_TOPIC (2)
/* Parameter Durability */
#define DURABILITY_VOLATILE (0)
#define DURABILITY_TRANSIENT_LOCAL (1)
#define DURABILITY_TRANSIENT (2)
#define DURABILITY_PERSISTENT (3)
/* Parameter Ownership */
#define OWNERSHIP_SHARED (0)
#define OWNERSHIP_EXCLUSIVE (1)
/* Parameter Presentation */
#define PRESENTATION_INSTANCE (0)
#define PRESENTATION_TOPIC (1)
#define PRESENTATION_GROUP (2)
#define LOCATOR_KIND_INVALID (-1)
#define LOCATOR_KIND_RESERVED (0)
#define LOCATOR_KIND_UDPV4 (1)
#define LOCATOR_KIND_UDPV6 (2)
/* Vendor specific - rti */
#define LOCATOR_KIND_DTLS (6)
#define LOCATOR_KIND_TCPV4_LAN (8)
#define LOCATOR_KIND_TCPV4_WAN (9)
#define LOCATOR_KIND_TLSV4_LAN (10)
#define LOCATOR_KIND_TLSV4_WAN (11)
#define LOCATOR_KIND_SHMEM (0x01000000)
#define LOCATOR_KIND_TUDPV4 (0x01001001)
#define LOCATOR_KIND_UDPV4_WAN (0x01000001)
/* History Kind */
#define HISTORY_KIND_KEEP_LAST (0)
#define HISTORY_KIND_KEEP_ALL (1)
/* Reliability Values */
#define RELIABILITY_BEST_EFFORT (1)
#define RELIABILITY_RELIABLE (2)
/* Destination Order */
#define BY_RECEPTION_TIMESTAMP (0)
#define BY_SOURCE_TIMESTAMP (1)
/* Member flags */
#define MEMBER_IS_KEY (1)
#define MEMBER_OPTIONAL (2)
#define MEMBER_SHAREABLE (4)
#define MEMBER_UNION_DEFAULT (8)
/* Participant message data kind */
#define PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN (0x00000000)
#define PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE (0x00000001)
#define PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE (0x00000002)
/* Type Consistency Kinds */
#define DISALLOW_TYPE_COERCION (0)
#define ALLOW_TYPE_COERCION (1)
/* Ack kind */
#define PROTOCOL_ACKNOWLEDGMENT (0)
#define APPLICATION_AUTO_ACKNOWLEDGMENT (1)
#define APPLICATION_ORDERED_ACKNOWLEDGMENT (2)
#define APPLICATION_EXPLICIT_ACKNOWLEDGMENT (3)
#define CRYPTO_TRANSFORMATION_KIND_NONE (0)
#define CRYPTO_TRANSFORMATION_KIND_AES128_GMAC (1)
#define CRYPTO_TRANSFORMATION_KIND_AES128_GCM (2)
#define CRYPTO_TRANSFORMATION_KIND_AES256_GMAC (3)
#define CRYPTO_TRANSFORMATION_KIND_AES256_GCM (4)
#define SECURITY_SYMMETRIC_CIPHER_BIT_AES128_GCM 0x00000001
#define SECURITY_SYMMETRIC_CIPHER_BIT_AES256_GCM 0x00000002
#define SECURITY_SYMMETRIC_CIPHER_BIT_CUSTOM_ALGORITHM 0x40000000
#define SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPSSMGF1SHA256_2048_SHA256 0x00000001
#define SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPKCS1V15_2048_SHA256 0x00000002
#define SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P256_SHA256 0x00000004
#define SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P384_SHA384 0x00000008
#define SECURITY_DIGITAL_SIGNATURE_BIT_CUSTOM_ALGORITHM 0x40000000
#define SECURITY_KEY_ESTABLISHMENT_BIT_DHE_MODP2048256 0x00000001
#define SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P256 0x00000002
#define SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P384 0x00000004
#define SECURITY_KEY_ESTABLISHMENT_BIT_CUSTOM_ALGORITHM 0x40000000
#define SECURITY_ALGORITHM_BIT_COMPATIBILITY_MODE 0x80000000
#define TOPIC_INFO_ADD_GUID (0x01)
#define TOPIC_INFO_ADD_TYPE_NAME (0x02)
#define TOPIC_INFO_ADD_TOPIC_NAME (0x04)
#define TOPIC_INFO_ALL_SET (0x07)
#define NOT_A_FRAGMENT (-1)
/* */
#define RTI_OSAPI_COMPRESSION_CLASS_ID_NONE (0)
#define RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB (1)
#define RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2 (2)
#define RTI_OSAPI_COMPRESSION_CLASS_ID_LZ4 (4)
#define RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO (UINT32_MAX)
/* VENDOR_BUILTIN_ENDPOINT_SET FLAGS */
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_WRITER (0x00000001U << 7)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_READER (0x00000001U << 8)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_WRITER (0x00000001U << 9)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_READER (0x00000001U << 10)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_WRITER (0x00000001U << 11)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_READER (0x00000001U << 12)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_WRITER (0x00000001U << 13)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_READER (0x00000001U << 14)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_WRITER (0x00000001U << 15)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_READER (0x00000001U << 16)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_WRITER (0x00000001U << 17)
#define VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_READER (0x00000001U << 18)
static int hf_rtps_dissection_boolean;
static int hf_rtps_dissection_byte;
static int hf_rtps_dissection_int16;
static int hf_rtps_dissection_uint16;
static int hf_rtps_dissection_int32;
static int hf_rtps_dissection_uint32;
static int hf_rtps_dissection_int64;
static int hf_rtps_dissection_uint64;
static int hf_rtps_dissection_float;
static int hf_rtps_dissection_double;
static int hf_rtps_dissection_int128;
static int hf_rtps_dissection_string;
static const char *const SM_EXTRA_RPLUS = "(r+)";
static const char *const SM_EXTRA_RMINUS = "(r-)";
static const char *const SM_EXTRA_WPLUS = "(w+)";
static const char *const SM_EXTRA_WMINUS = "(w-)";
static const char *const SM_EXTRA_PPLUS = "(p+)";
static const char *const SM_EXTRA_PMINUS = "(p-)";
static const char *const SM_EXTRA_TPLUS = "(t+)";
static const char *const SM_EXTRA_TMINUS = "(t-)";
/***************************************************************************/
/* Protocol Fields Identifiers */
static int proto_rtps;
static int hf_rtps_magic;
static int hf_rtps_ping;
static int hf_rtps_protocol_version;
static int hf_rtps_protocol_version_major;
static int hf_rtps_protocol_version_minor;
static int hf_rtps_vendor_id;
static int hf_rtps_domain_id;
static int hf_rtps_domain_tag;
static int hf_rtps_participant_idx;
static int hf_rtps_nature_type;
static int hf_rtps_guid_prefix_v1;
static int hf_rtps_guid_prefix;
static int hf_rtps_guid_prefix_src;
static int hf_rtps_guid_prefix_dst;
static int hf_rtps_host_id;
static int hf_rtps_app_id;
static int hf_rtps_app_id_instance_id;
static int hf_rtps_app_id_app_kind;
static int hf_rtps_sm_id;
static int hf_rtps_sm_idv2;
static int hf_rtps_sm_flags;
static int hf_rtps_sm_flags2;
static int hf_rtps_sm_octets_to_next_header;
static int hf_rtps_sm_guid_prefix_v1;
static int hf_rtps_sm_guid_prefix;
static int hf_rtps_sm_host_id;
static int hf_rtps_sm_app_id;
static int hf_rtps_sm_instance_id_v1;
static int hf_rtps_sm_app_kind;
static int hf_rtps_sm_instance_id;
static int hf_rtps_sm_entity_id;
static int hf_rtps_sm_entity_id_key;
static int hf_rtps_sm_entity_id_kind;
static int hf_rtps_sm_rdentity_id;
static int hf_rtps_sm_rdentity_id_key;
static int hf_rtps_sm_rdentity_id_kind;
static int hf_rtps_sm_wrentity_id;
static int hf_rtps_sm_wrentity_id_key;
static int hf_rtps_sm_wrentity_id_kind;
static int hf_rtps_sm_seq_number;
static int hf_rtps_info_src_ip;
static int hf_rtps_info_src_unused;
static int hf_rtps_parameter_id;
static int hf_rtps_parameter_id_v2;
static int hf_rtps_parameter_id_inline_rti;
static int hf_rtps_parameter_id_toc;
static int hf_rtps_parameter_id_rti;
static int hf_rtps_parameter_id_adl;
static int hf_rtps_parameter_length;
static int hf_rtps_string_length;
static int hf_rtps_coherent_set_start;
static int hf_rtps_coherent_set_end;
static int hf_rtps_param_topic_name;
static int hf_rtps_param_strength;
static int hf_rtps_param_type_name;
static int hf_rtps_param_user_data;
static int hf_rtps_param_group_data;
static int hf_rtps_param_topic_data;
static int hf_rtps_param_content_filter_topic_name;
static int hf_rtps_param_related_topic_name;
static int hf_rtps_param_filter_class_name;
static int hf_rtps_issue_data;
static int hf_rtps_durability_service_cleanup_delay;
static int hf_rtps_liveliness_lease_duration;
static int hf_rtps_participant_lease_duration;
static int hf_rtps_time_based_filter_minimum_separation;
static int hf_rtps_reliability_max_blocking_time;
static int hf_rtps_deadline_period;
static int hf_rtps_latency_budget_duration;
static int hf_rtps_lifespan_duration;
static int hf_rtps_persistence;
static int hf_rtps_info_ts_timestamp;
static int hf_rtps_timestamp;
static int hf_rtps_locator_kind;
static int hf_rtps_locator_port;
/* static int hf_rtps_logical_port; */
static int hf_rtps_locator_public_address_port;
static int hf_rtps_locator_ipv4;
static int hf_rtps_locator_ipv6;
static int hf_rtps_participant_builtin_endpoints;
static int hf_rtps_participant_manual_liveliness_count;
static int hf_rtps_history_depth;
static int hf_rtps_resource_limit_max_samples;
static int hf_rtps_resource_limit_max_instances;
static int hf_rtps_resource_limit_max_samples_per_instances;
static int hf_rtps_filter_bitmap;
static int hf_rtps_type_checksum;
static int hf_rtps_queue_size;
static int hf_rtps_acknack_count;
static int hf_rtps_durability_service_history_kind;
static int hf_rtps_durability_service_history_depth;
static int hf_rtps_durability_service_max_samples;
static int hf_rtps_durability_service_max_instances;
static int hf_rtps_durability_service_max_samples_per_instances;
static int hf_rtps_liveliness_kind;
static int hf_rtps_manager_key;
static int hf_rtps_locator_udp_v4;
static int hf_rtps_locator_udp_v4_port;
static int hf_param_ip_address;
static int hf_rtps_param_port;
static int hf_rtps_expects_inline_qos;
static int hf_rtps_presentation_coherent_access;
static int hf_rtps_presentation_ordered_access;
static int hf_rtps_expects_ack;
static int hf_rtps_reliability_kind;
static int hf_rtps_durability;
static int hf_rtps_ownership;
static int hf_rtps_presentation_access_scope;
static int hf_rtps_destination_order;
static int hf_rtps_history_kind;
static int hf_rtps_data_status_info;
static int hf_rtps_param_serialize_encap_kind;
static int hf_rtps_param_serialize_encap_len;
static int hf_rtps_param_transport_priority;
static int hf_rtps_param_type_max_size_serialized;
static int hf_rtps_param_entity_name;
static int hf_rtps_param_role_name;
static int hf_rtps_disable_positive_ack;
static int hf_rtps_participant_guid_v1;
static int hf_rtps_participant_guid;
static int hf_rtps_group_guid_v1;
static int hf_rtps_group_guid;
static int hf_rtps_endpoint_guid;
static int hf_rtps_param_host_id;
static int hf_rtps_param_app_id;
static int hf_rtps_param_instance_id;
static int hf_rtps_param_instance_id_v1;
static int hf_rtps_param_app_kind;
static int hf_rtps_param_entity;
static int hf_rtps_param_entity_key;
static int hf_rtps_param_entity_kind;
static int hf_rtps_data_frag_number;
static int hf_rtps_data_frag_num_fragments;
static int hf_rtps_data_frag_size;
static int hf_rtps_data_frag_sample_size;
static int hf_rtps_nokey_data_frag_number;
static int hf_rtps_nokey_data_frag_num_fragments;
static int hf_rtps_nokey_data_frag_size;
static int hf_rtps_nack_frag_count;
static int hf_rtps_heartbeat_frag_number;
static int hf_rtps_heartbeat_frag_count;
static int hf_rtps_heartbeat_batch_count;
static int hf_rtps_data_serialize_data;
static int hf_rtps_data_batch_timestamp;
static int hf_rtps_data_batch_offset_to_last_sample_sn;
static int hf_rtps_data_batch_sample_count;
static int hf_rtps_data_batch_offset_sn;
static int hf_rtps_data_batch_octets_to_sl_encap_id;
static int hf_rtps_data_batch_serialized_data_length;
static int hf_rtps_data_batch_octets_to_inline_qos;
static int hf_rtps_fragment_number_base64;
static int hf_rtps_fragment_number_base;
static int hf_rtps_fragment_number_num_bits;
static int hf_rtps_bitmap_num_bits;
static int hf_rtps_param_partition_num;
static int hf_rtps_param_partition;
static int hf_rtps_param_filter_expression;
static int hf_rtps_param_expression_parameters_num;
static int hf_rtps_param_expression_parameters;
static int hf_rtps_locator_filter_list_num_channels;
static int hf_rtps_locator_filter_list_filter_name;
static int hf_rtps_locator_filter_list_filter_exp;
static int hf_rtps_extra_flags;
static int hf_rtps_param_builtin_endpoint_set_flags;
static int hf_rtps_param_vendor_builtin_endpoint_set_flags;
static int hf_rtps_param_endpoint_security_attributes;
static int hf_rtps_param_plugin_promiscuity_kind;
static int hf_rtps_param_service_kind;
static int hf_rtps_param_sample_signature_epoch;
static int hf_rtps_param_sample_signature_nonce;
static int hf_rtps_param_sample_signature_length;
static int hf_rtps_param_sample_signature_signature;
static int hf_rtps_secure_secure_data_length;
static int hf_rtps_secure_secure_data;
static int hf_rtps_param_enable_authentication;
static int hf_rtps_param_builtin_endpoint_qos;
static int hf_rtps_secure_dataheader_transformation_kind;
static int hf_rtps_secure_dataheader_transformation_key_revision_id;
static int hf_rtps_secure_dataheader_transformation_key_id;
static int hf_rtps_secure_dataheader_passphrase_id;
static int hf_rtps_secure_dataheader_passphrase_key_id;
static int hf_rtps_secure_dataheader_init_vector_suffix;
static int hf_rtps_secure_dataheader_session_id;
static int hf_rtps_secure_datatag_plugin_sec_tag;
static int hf_rtps_secure_datatag_plugin_sec_tag_key;
static int hf_rtps_secure_datatag_plugin_sec_tag_common_mac;
static int hf_rtps_secure_datatag_plugin_specific_macs_len;
static int hf_rtps_pgm;
static int hf_rtps_pgm_dst_participant_guid;
static int hf_rtps_pgm_dst_endpoint_guid;
static int hf_rtps_pgm_src_endpoint_guid;
static int hf_rtps_source_participant_guid;
static int hf_rtps_message_identity_source_guid;
static int hf_rtps_pgm_message_class_id;
static int hf_rtps_pgm_data_holder_class_id;
static int hf_rtps_secure_session_key;
/* static int hf_rtps_pgm_data_holder_stringseq_size; */
/* static int hf_rtps_pgm_data_holder_stringseq_name; */
/* static int hf_rtps_pgm_data_holder_long_long; */
static int hf_rtps_param_timestamp_sec;
static int hf_rtps_param_timestamp_fraction;
static int hf_rtps_transportInfo_classId;
static int hf_rtps_transportInfo_messageSizeMax;
static int hf_rtps_param_app_ack_count;
static int hf_rtps_param_app_ack_virtual_writer_count;
static int hf_rtps_param_app_ack_conf_virtual_writer_count;
static int hf_rtps_param_app_ack_conf_count;
static int hf_rtps_param_app_ack_interval_payload_length;
static int hf_rtps_param_app_ack_interval_flags;
static int hf_rtps_param_app_ack_interval_count;
static int hf_rtps_param_app_ack_octets_to_next_virtual_writer;
static int hf_rtps_expects_virtual_heartbeat;
static int hf_rtps_direct_communication;
static int hf_rtps_param_peer_host_epoch;
static int hf_rtps_param_endpoint_property_change_epoch;
static int hf_rtps_virtual_heartbeat_count;
static int hf_rtps_virtual_heartbeat_num_virtual_guids;
static int hf_rtps_virtual_heartbeat_num_writers;
static int hf_rtps_param_extended_parameter;
static int hf_rtps_param_extended_pid_length;
static int hf_rtps_param_type_consistency_kind;
static int hf_rtps_param_data_representation;
static int hf_rtps_param_ignore_sequence_bounds;
static int hf_rtps_param_ignore_string_bounds;
static int hf_rtps_param_ignore_member_names;
static int hf_rtps_param_prevent_type_widening;
static int hf_rtps_param_force_type_validation;
static int hf_rtps_param_ignore_enum_literal_names;
static int hf_rtps_parameter_data;
static int hf_rtps_param_product_version_major;
static int hf_rtps_param_product_version_minor;
static int hf_rtps_param_product_version_release;
static int hf_rtps_param_product_version_release_as_char;
static int hf_rtps_param_product_version_revision;
static int hf_rtps_param_acknowledgment_kind;
static int hf_rtps_param_topic_query_publication_enable;
static int hf_rtps_param_topic_query_publication_sessions;
static int hf_rtps_srm;
static int hf_rtps_srm_service_id;
static int hf_rtps_srm_request_body;
static int hf_rtps_srm_instance_id;
static int hf_rtps_topic_query_selection_filter_class_name;
static int hf_rtps_topic_query_selection_filter_expression;
static int hf_rtps_topic_query_selection_num_parameters;
static int hf_rtps_topic_query_selection_filter_parameter;
static int hf_rtps_topic_query_topic_name;
static int hf_rtps_topic_query_original_related_reader_guid;
static int hf_rtps_encapsulation_id;
static int hf_rtps_encapsulation_kind;
static int hf_rtps_octets_to_inline_qos;
static int hf_rtps_filter_signature;
static int hf_rtps_bitmap;
static int hf_rtps_acknack_analysis;
static int hf_rtps_property_name;
static int hf_rtps_property_value;
static int hf_rtps_union;
static int hf_rtps_union_case;
static int hf_rtps_struct;
static int hf_rtps_member_name;
static int hf_rtps_sequence;
static int hf_rtps_array;
static int hf_rtps_bitfield;
static int hf_rtps_datatype;
static int hf_rtps_sequence_size;
static int hf_rtps_guid;
static int hf_rtps_heartbeat_count;
static int hf_rtps_encapsulation_options;
static int hf_rtps_serialized_key;
static int hf_rtps_serialized_data;
static int hf_rtps_type_object_type_id_disc;
static int hf_rtps_type_object_type_id;
static int hf_rtps_type_object_primitive_type_id;
static int hf_rtps_type_object_base_type;
static int hf_rtps_type_object_base_primitive_type_id;
static int hf_rtps_type_object_element_raw;
static int hf_rtps_type_object_type_property_name;
static int hf_rtps_type_object_flags;
static int hf_rtps_type_object_member_id;
static int hf_rtps_type_object_annotation_value_d;
static int hf_rtps_type_object_annotation_value_16;
static int hf_rtps_type_object_union_label;
static int hf_rtps_type_object_bound;
static int hf_rtps_type_object_enum_constant_name;
static int hf_rtps_type_object_enum_constant_value;
static int hf_rtps_type_object_element_shared;
static int hf_rtps_type_object_name;
static int hf_rtps_type_object_element_module_name;
static int hf_rtps_uncompressed_serialized_length;
static int hf_rtps_compression_plugin_class_id;
static int hf_rtps_compressed_serialized_type_object;
static int hf_rtps_pl_cdr_member;
static int hf_rtps_pl_cdr_member_id;
static int hf_rtps_pl_cdr_member_length;
static int hf_rtps_pl_cdr_member_id_ext;
static int hf_rtps_pl_cdr_member_length_ext;
static int hf_rtps_dcps_publication_data_frame_number;
static int hf_rtps_udpv4_wan_locator_flags;
static int hf_rtps_uuid;
static int hf_rtps_udpv4_wan_locator_public_ip;
static int hf_rtps_udpv4_wan_locator_public_port;
static int hf_rtps_udpv4_wan_locator_local_ip;
static int hf_rtps_udpv4_wan_locator_local_port;
static int hf_rtps_udpv4_wan_binding_ping_port;
static int hf_rtps_udpv4_wan_binding_ping_flags;
static int hf_rtps_long_address;
static int hf_rtps_param_group_coherent_set;
static int hf_rtps_param_end_group_coherent_set;
static int hf_rtps_param_mig_end_coherent_set_sample_count;
static int hf_rtps_encapsulation_options_compression_plugin_class_id;
static int hf_rtps_padding_bytes;
static int hf_rtps_topic_query_selection_kind;
static int hf_rtps_data_session_intermediate;
/* Flag bits */
static int hf_rtps_flag_reserved80;
static int hf_rtps_flag_reserved40;
static int hf_rtps_flag_reserved20;
static int hf_rtps_flag_reserved10;
static int hf_rtps_flag_reserved08;
static int hf_rtps_flag_reserved04;
static int hf_rtps_flag_reserved02;
static int hf_rtps_flag_reserved8000;
static int hf_rtps_flag_reserved4000;
static int hf_rtps_flag_reserved2000;
static int hf_rtps_flag_reserved1000;
static int hf_rtps_flag_reserved0800;
static int hf_rtps_flag_reserved0400;
static int hf_rtps_flag_reserved0200;
static int hf_rtps_flag_reserved0100;
static int hf_rtps_flag_reserved0080;
static int hf_rtps_flag_reserved0040;
static int hf_rtps_flag_builtin_endpoint_set_reserved;
static int hf_rtps_flag_unregister;
static int hf_rtps_flag_inline_qos_v1;
static int hf_rtps_flag_hash_key;
static int hf_rtps_flag_alive;
static int hf_rtps_flag_data_present_v1;
static int hf_rtps_flag_multisubmessage;
static int hf_rtps_flag_endianness;
static int hf_rtps_flag_additional_authenticated_data;
static int hf_rtps_flag_protected_with_psk;
static int hf_rtps_flag_vendor_specific_content;
static int hf_rtps_flag_status_info;
static int hf_rtps_flag_data_present_v2;
static int hf_rtps_flag_inline_qos_v2;
static int hf_rtps_flag_final;
static int hf_rtps_flag_hash_key_rti;
static int hf_rtps_flag_liveliness;
static int hf_rtps_flag_multicast;
static int hf_rtps_flag_data_serialized_key;
static int hf_rtps_flag_data_frag_serialized_key;
static int hf_rtps_flag_timestamp;
static int hf_rtps_flag_no_virtual_guids;
static int hf_rtps_flag_multiple_writers;
static int hf_rtps_flag_multiple_virtual_guids;
static int hf_rtps_flag_serialize_key16;
static int hf_rtps_flag_invalid_sample;
static int hf_rtps_flag_data_present16;
static int hf_rtps_flag_offsetsn_present;
static int hf_rtps_flag_inline_qos16_v2;
static int hf_rtps_flag_timestamp_present;
static int hf_rtps_flag_unregistered;
static int hf_rtps_flag_disposed;
static int hf_rtps_param_status_info_flags;
static int hf_rtps_flag_participant_announcer;
static int hf_rtps_flag_participant_detector;
static int hf_rtps_flag_publication_announcer;
static int hf_rtps_flag_publication_detector;
static int hf_rtps_flag_subscription_announcer;
static int hf_rtps_flag_subscription_detector;
static int hf_rtps_flag_participant_proxy_announcer;
static int hf_rtps_flag_participant_proxy_detector;
static int hf_rtps_flag_participant_state_announcer;
static int hf_rtps_flag_participant_state_detector;
static int hf_rtps_flag_participant_message_datawriter;
static int hf_rtps_flag_participant_message_datareader;
static int hf_rtps_flag_secure_publication_writer;
static int hf_rtps_flag_secure_publication_reader;
static int hf_rtps_flag_secure_subscription_writer;
static int hf_rtps_flag_secure_subscription_reader;
static int hf_rtps_flag_secure_participant_message_writer;
static int hf_rtps_flag_secure_participant_message_reader;
static int hf_rtps_flag_participant_stateless_message_writer;
static int hf_rtps_flag_participant_stateless_message_reader;
static int hf_rtps_flag_secure_participant_volatile_message_writer;
static int hf_rtps_flag_secure_participant_volatile_message_reader;
static int hf_rtps_flag_participant_secure_writer;
static int hf_rtps_flag_participant_secure_reader;
static int hf_rtps_flag_typeflag_final;
static int hf_rtps_flag_typeflag_mutable;
static int hf_rtps_flag_typeflag_nested;
static int hf_rtps_flag_memberflag_key;
static int hf_rtps_flag_memberflag_optional;
static int hf_rtps_flag_memberflag_shareable;
static int hf_rtps_flag_memberflag_union_default;
static int hf_rtps_flag_service_request_writer;
static int hf_rtps_flag_service_request_reader;
static int hf_rtps_flag_locator_ping_writer;
static int hf_rtps_flag_locator_ping_reader;
static int hf_rtps_flag_secure_service_request_writer;
static int hf_rtps_flag_cloud_discovery_service_announcer;
static int hf_rtps_flag_participant_config_writer;
static int hf_rtps_flag_participant_config_reader;
static int hf_rtps_flag_participant_config_secure_writer;
static int hf_rtps_flag_participant_config_secure_reader;
static int hf_rtps_flag_participant_bootstrap_writer;
static int hf_rtps_flag_participant_bootstrap_reader;
static int hf_rtps_flag_monitoring_periodic_writer;
static int hf_rtps_flag_monitoring_periodic_reader;
static int hf_rtps_flag_monitoring_event_writer;
static int hf_rtps_flag_monitoring_event_reader;
static int hf_rtps_flag_monitoring_logging_writer;
static int hf_rtps_flag_monitoring_logging_reader;
static int hf_rtps_flag_secure_service_request_reader;
static int hf_rtps_flag_security_access_protected;
static int hf_rtps_flag_security_discovery_protected;
static int hf_rtps_flag_security_submessage_protected;
static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask;
static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit;
static int hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask;
static int hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm;
static int hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm;
static int hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm;
static int hf_rtps_param_compression_id_mask;
static int hf_rtps_flag_compression_id_zlib;
static int hf_rtps_flag_compression_id_bzip2;
static int hf_rtps_flag_compression_id_lz4;
static int hf_rtps_param_crypto_algorithm_requirements_trust_chain;
static int hf_rtps_param_crypto_algorithm_requirements_message_auth;
static int hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256;
static int hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256;
static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256;
static int hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384;
static int hf_rtps_flag_security_digital_signature_mask_custom_algorithm;
static int hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256;
static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256;
static int hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384;
static int hf_rtps_flag_security_key_establishment_mask_custom_algorithm;
static int hf_rtps_flag_security_algorithm_compatibility_mode;
static int hf_rtps_flag_security_payload_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected;
static int hf_rtps_flag_endpoint_security_attribute_flag_is_valid;
static int hf_rtps_param_endpoint_security_attributes_mask;
static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted;
static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted;
static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted;
static int hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid;
static int hf_rtps_param_plugin_endpoint_security_attributes_mask;
static int hf_rtps_flag_participant_security_attribute_flag_key_psk_protected;
static int hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected;
static int hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected;
static int hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected;
static int hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled;
static int hf_rtps_flag_participant_security_attribute_flag_is_valid;
static int hf_rtps_param_participant_security_attributes_mask;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted;
static int hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid;
static int hf_rtps_param_plugin_participant_security_attributes_mask;
static int hf_rtps_sm_rti_crc_number;
static int hf_rtps_sm_rti_crc_result;
static int hf_rtps_data_tag_name;
static int hf_rtps_data_tag_value;
static int hf_rtps_flag_udpv4_wan_locator_u;
static int hf_rtps_flag_udpv4_wan_locator_p;
static int hf_rtps_flag_udpv4_wan_locator_b;
static int hf_rtps_flag_udpv4_wan_locator_r;
static int hf_rtps_flag_udpv4_wan_binding_ping_e;
static int hf_rtps_flag_udpv4_wan_binding_ping_l;
static int hf_rtps_flag_udpv4_wan_binding_ping_b;
static int hf_rtps_header_extension_flags;
static int hf_rtps_flag_header_extension_message_length;
static int hf_rtps_flag_header_extension_uextension;
static int hf_rtps_flag_header_extension_wextension;
static int hf_rtps_flag_header_extension_checksum1;
static int hf_rtps_flag_header_extension_checksum2;
static int hf_rtps_flag_header_extension_parameters;
static int hf_rtps_flag_header_extension_timestamp;
static int hf_rtps_fragments;
static int hf_rtps_fragment;
static int hf_rtps_fragment_overlap;
static int hf_rtps_fragment_overlap_conflict;
static int hf_rtps_fragment_multiple_tails;
static int hf_rtps_fragment_too_long_fragment;
static int hf_rtps_fragment_error;
static int hf_rtps_fragment_count;
static int hf_rtps_reassembled_in;
static int hf_rtps_reassembled_length;
static int hf_rtps_reassembled_data;
static int hf_rtps_encapsulation_extended_compression_options;
static int hf_rtps_message_length;
static int hf_rtps_header_extension_checksum_crc32c;
static int hf_rtps_header_extension_checksum_crc64;
static int hf_rtps_header_extension_checksum_md5;
static int hf_rtps_uextension;
static int hf_rtps_wextension;
static int hf_rtps_writer_group_oid;
static int hf_rtps_reader_group_oid;
static int hf_rtps_writer_session_id;
/* Subtree identifiers */
static int ett_rtps_dissection_tree;
static int ett_rtps;
static int ett_rtps_default_mapping;
static int ett_rtps_proto_version;
static int ett_rtps_submessage;
static int ett_rtps_parameter_sequence;
static int ett_rtps_parameter;
static int ett_rtps_flags;
static int ett_rtps_entity;
static int ett_rtps_generic_guid;
static int ett_rtps_rdentity;
static int ett_rtps_wrentity;
static int ett_rtps_guid_prefix;
static int ett_rtps_app_id;
static int ett_rtps_locator_udp_v4;
static int ett_rtps_locator;
static int ett_rtps_locator_list;
static int ett_rtps_timestamp;
static int ett_rtps_bitmap;
static int ett_rtps_seq_string;
static int ett_rtps_seq_ulong;
static int ett_rtps_resource_limit;
static int ett_rtps_durability_service;
static int ett_rtps_liveliness;
static int ett_rtps_manager_key;
static int ett_rtps_serialized_data;
static int ett_rtps_locator_filter_channel;
static int ett_rtps_part_message_data;
static int ett_rtps_sample_info_list;
static int ett_rtps_sample_info;
static int ett_rtps_sample_batch_list;
static int ett_rtps_locator_filter_locator;
static int ett_rtps_writer_heartbeat_virtual_list;
static int ett_rtps_writer_heartbeat_virtual;
static int ett_rtps_virtual_guid_heartbeat_virtual_list;
static int ett_rtps_virtual_guid_heartbeat_virtual;
static int ett_rtps_app_ack_virtual_writer_interval_list;
static int ett_rtps_app_ack_virtual_writer_interval;
static int ett_rtps_transport_info;
static int ett_rtps_app_ack_virtual_writer_list;
static int ett_rtps_app_ack_virtual_writer;
static int ett_rtps_product_version;
static int ett_rtps_property_list;
static int ett_rtps_property;
static int ett_rtps_topic_info;
static int ett_rtps_topic_info_dw_qos;
static int ett_rtps_type_object;
static int ett_rtps_type_library;
static int ett_rtps_type_element;
static int ett_rtps_type_annotation_usage_list;
static int ett_rtps_type_enum_constant;
static int ett_rtps_type_bound_list;
static int ett_rtps_secure_payload_tree;
static int ett_rtps_secure_dataheader_tree;
static int ett_rtps_secure_transformation_kind;
static int ett_rtps_pgm_data;
static int ett_rtps_message_identity;
static int ett_rtps_related_message_identity;
static int ett_rtps_data_holder_seq;
static int ett_rtps_data_holder;
static int ett_rtps_data_holder_properties;
static int ett_rtps_property_tree;
static int ett_rtps_param_header_tree;
static int ett_rtps_service_request_tree;
static int ett_rtps_locator_ping_tree;
static int ett_rtps_locator_reachability_tree;
static int ett_rtps_custom_dissection_info;
static int ett_rtps_locator_list_tree;
static int ett_rtps_topic_query_tree;
static int ett_rtps_topic_query_selection_tree;
static int ett_rtps_topic_query_filter_params_tree;
static int ett_rtps_data_member;
static int ett_rtps_data_tag_seq;
static int ett_rtps_data_tag_item;
static int ett_rtps_fragment;
static int ett_rtps_fragments;
static int ett_rtps_data_representation;
static int ett_rtps_decompressed_type_object;
static int ett_rtps_info_remaining_items;
static int ett_rtps_data_encapsulation_options;
static int ett_rtps_decompressed_serialized_data;
static int ett_rtps_instance_transition_data;
static int ett_rtps_crypto_algorithm_requirements;
static int ett_rtps_decrypted_payload;
static int ett_rtps_secure_postfix_tag_list_item;
static expert_field ei_rtps_sm_octets_to_next_header_error;
static expert_field ei_rtps_checksum_check_error;
static expert_field ei_rtps_port_invalid;
static expert_field ei_rtps_ip_invalid;
static expert_field ei_rtps_parameter_value_invalid;
static expert_field ei_rtps_extra_bytes;
static expert_field ei_rtps_missing_bytes;
static expert_field ei_rtps_locator_port;
static expert_field ei_rtps_more_samples_available;
static expert_field ei_rtps_parameter_not_decoded;
static expert_field ei_rtps_sm_octets_to_next_header_not_zero;
static expert_field ei_rtps_pid_type_csonsistency_invalid_size;
static expert_field ei_rtps_uncompression_error;
static expert_field ei_rtps_value_too_large;
static expert_field ei_rtps_invalid_psk;
/***************************************************************************/
/* Value-to-String Tables */
static const value_string vendor_vals[] = {
{ RTPS_VENDOR_UNKNOWN, RTPS_VENDOR_UNKNOWN_STRING},
{ RTPS_VENDOR_RTI_DDS, RTPS_VENDOR_RTI_DDS_STRING},
{ RTPS_VENDOR_ADL_DDS, RTPS_VENDOR_ADL_DDS_STRING},
{ RTPS_VENDOR_OCI, RTPS_VENDOR_OCI_STRING},
{ RTPS_VENDOR_MILSOFT, RTPS_VENDOR_MILSOFT_STRING},
{ RTPS_VENDOR_KONGSBERG, RTPS_VENDOR_KONGSBERG_STRING},
{ RTPS_VENDOR_TOC, RTPS_VENDOR_TOC_STRING},
{ RTPS_VENDOR_LAKOTA_TSI, RTPS_VENDOR_LAKOTA_TSI_STRING},
{ RTPS_VENDOR_ICOUP, RTPS_VENDOR_ICOUP_STRING},
{ RTPS_VENDOR_ETRI, RTPS_VENDOR_ETRI_STRING},
{ RTPS_VENDOR_RTI_DDS_MICRO, RTPS_VENDOR_RTI_DDS_MICRO_STRING},
{ RTPS_VENDOR_ADL_CAFE, RTPS_VENDOR_ADL_CAFE_STRING},
{ RTPS_VENDOR_PT, RTPS_VENDOR_PT_STRING},
{ RTPS_VENDOR_ADL_LITE, RTPS_VENDOR_ADL_LITE_STRING},
{ RTPS_VENDOR_TECHNICOLOR, RTPS_VENDOR_TECHNICOLOR_STRING},
{ RTPS_VENDOR_EPROSIMA, RTPS_VENDOR_EPROSIMA_STRING},
{ RTPS_VENDOR_ECLIPSE, RTPS_VENDOR_ECLIPSE_STRING},
{ RTPS_VENDOR_GURUM, RTPS_VENDOR_GURUM_STRING},
{ RTPS_VENDOR_RUST, RTPS_VENDOR_RUST_STRING},
{ RTPS_VENDOR_ZRDDS, RTPS_VENDOR_ZRDDS_STRING},
{ RTPS_VENDOR_DUST, RTPS_VENDOR_DUST_STRING},
{ 0, NULL }
};
static const value_string entity_id_vals[] = {
{ ENTITYID_UNKNOWN, "ENTITYID_UNKNOWN" },
{ ENTITYID_PARTICIPANT, "ENTITYID_PARTICIPANT" },
{ ENTITYID_BUILTIN_TOPIC_WRITER, "ENTITYID_BUILTIN_TOPIC_WRITER" },
{ ENTITYID_BUILTIN_TOPIC_READER, "ENTITYID_BUILTIN_TOPIC_READER" },
{ ENTITYID_BUILTIN_PUBLICATIONS_WRITER, "ENTITYID_BUILTIN_PUBLICATIONS_WRITER" },
{ ENTITYID_BUILTIN_PUBLICATIONS_READER, "ENTITYID_BUILTIN_PUBLICATIONS_READER" },
{ ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER, "ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER" },
{ ENTITYID_BUILTIN_SUBSCRIPTIONS_READER, "ENTITYID_BUILTIN_SUBSCRIPTIONS_READER" },
{ ENTITYID_BUILTIN_PARTICIPANT_WRITER, "ENTITYID_BUILTIN_PARTICIPANT_WRITER" },
{ ENTITYID_BUILTIN_PARTICIPANT_READER, "ENTITYID_BUILTIN_PARTICIPANT_READER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_READER" },
{ ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER, "ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER" },
{ ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER, "ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_READER" },
{ ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER, "ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER" },
{ ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER, "ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_READER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_READER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_READER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER" },
{ ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER, "ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_READER" },
{ ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER, "ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER"},
{ ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER, "ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_READER"},
/* vendor specific - RTI */
{ ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER, "ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER" },
{ ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER, "ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER" },
{ ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER, "ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER" },
{ ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER, "ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER" },
{ ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER" },
{ ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER" },
{ ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER" },
{ ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER" },
{ ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER"},
{ ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER, "ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER"},
/* Deprecated Items */
{ ENTITYID_APPLICATIONS_WRITER, "writerApplications [DEPRECATED]" },
{ ENTITYID_APPLICATIONS_READER, "readerApplications [DEPRECATED]" },
{ ENTITYID_CLIENTS_WRITER, "writerClients [DEPRECATED]" },
{ ENTITYID_CLIENTS_READER, "readerClients [DEPRECATED]" },
{ ENTITYID_SERVICES_WRITER, "writerServices [DEPRECATED]" },
{ ENTITYID_SERVICES_READER, "readerServices [DEPRECATED]" },
{ ENTITYID_MANAGERS_WRITER, "writerManagers [DEPRECATED]" },
{ ENTITYID_MANAGERS_READER, "readerManagers [DEPRECATED]" },
{ ENTITYID_APPLICATION_SELF, "applicationSelf [DEPRECATED]" },
{ ENTITYID_APPLICATION_SELF_WRITER, "writerApplicationSelf [DEPRECATED]" },
{ ENTITYID_APPLICATION_SELF_READER, "readerApplicationSelf [DEPRECATED]" },
{ 0, NULL }
};
static const value_string entity_kind_vals [] = {
{ ENTITYKIND_APPDEF_UNKNOWN, "Application-defined unknown kind" },
{ ENTITYKIND_APPDEF_PARTICIPANT, "Application-defined participant" },
{ ENTITYKIND_APPDEF_WRITER_WITH_KEY, "Application-defined writer (with key)" },
{ ENTITYKIND_APPDEF_WRITER_NO_KEY, "Application-defined writer (no key)" },
{ ENTITYKIND_APPDEF_READER_WITH_KEY, "Application-defined reader (with key)" },
{ ENTITYKIND_APPDEF_READER_NO_KEY, "Application-defined reader (no key)" },
{ ENTITYKIND_BUILTIN_PARTICIPANT, "Built-in participant" },
{ ENTITYKIND_BUILTIN_WRITER_WITH_KEY, "Built-in writer (with key)" },
{ ENTITYKIND_BUILTIN_WRITER_NO_KEY, "Built-in writer (no key)" },
{ ENTITYKIND_BUILTIN_READER_WITH_KEY, "Built-in reader (with key)" },
{ ENTITYKIND_BUILTIN_READER_NO_KEY, "Built-in reader (no key)" },
{ ENTITYKIND_RTI_BUILTIN_WRITER_WITH_KEY, "RTI Built-in writer (with key)" },
{ ENTITYKIND_RTI_BUILTIN_WRITER_NO_KEY, "RTI Built-in writer (no key)" },
{ ENTITYKIND_RTI_BUILTIN_READER_WITH_KEY, "RTI Built-in reader (with key)" },
{ ENTITYKIND_RTI_BUILTIN_READER_NO_KEY, "RTI Built-in reader (no key)" },
{ ENTITYID_OBJECT_NORMAL_META_WRITER_GROUP, "Object normal meta writer group" },
{ ENTITYID_OBJECT_NORMAL_META_READER_GROUP, "Object normal meta reader group" },
{ ENTITYID_OBJECT_NORMAL_META_TOPIC, "Object normal meta topic" },
{ ENTITYID_RESERVED_META_CST_GROUP_WRITER, "Reserved meta CST group writer" },
{ ENTITYID_RESERVED_META_GROUP_WRITER, "Reserved meta group writer" },
{ ENTITYID_RESERVED_META_GROUP_READER, "Reserved meta group reader" },
{ ENTITYID_RESERVED_META_CST_GROUP_READER, "Reserved meta CST group reader" },
{ ENTITYID_NORMAL_META_CST_GROUP_WRITER, "Normal meta CST group writer" },
{ ENTITYID_NORMAL_META_GROUP_WRITER, "Normal meta group writer" },
{ ENTITYID_NORMAL_META_GROUP_READER, "Normal meta group reader" },
{ ENTITYID_NORMAL_META_CST_GROUP_READER, "Normal meta CST group reader" },
{ ENTITYID_RESERVED_USER_CST_GROUP_WRITER, "Reserved user CST group writer" },
{ ENTITYID_RESERVED_USER_GROUP_WRITER, "Reserved user group writer" },
{ ENTITYID_RESERVED_USER_GROUP_READER, "Reserved user group reader" },
{ ENTITYID_RESERVED_USER_CST_GROUP_READER, "Reserved user CST group reader" },
{ ENTITYID_NORMAL_USER_CST_GROUP_WRITER, "Normal user CST group writer" },
{ ENTITYID_NORMAL_USER_GROUP_WRITER, "Normal user writer" },
{ ENTITYID_NORMAL_USER_GROUP_READER, "Normal user reader" },
{ ENTITYID_NORMAL_USER_CST_GROUP_READER, "Normal user CST group reader" },
{ 0, NULL }
};
static const value_string nature_type_vals[] = {
{ PORT_METATRAFFIC_UNICAST, "UNICAST_METATRAFFIC"},
{ PORT_METATRAFFIC_MULTICAST, "MULTICAST_METATRAFFIC"},
{ PORT_USERTRAFFIC_UNICAST, "UNICAST_USERTRAFFIC"},
{ PORT_USERTRAFFIC_MULTICAST, "MULTICAST_USERTRAFFIC"},
{ 0, NULL }
};
static const value_string app_kind_vals[] = {
{ APPKIND_UNKNOWN, "APPKIND_UNKNOWN" },
{ APPKIND_MANAGED_APPLICATION, "ManagedApplication" },
{ APPKIND_MANAGER, "Manager" },
{ 0, NULL }
};
static const value_string rtps_locator_kind_vals[] = {
{ LOCATOR_KIND_UDPV4, "LOCATOR_KIND_UDPV4" },
{ LOCATOR_KIND_UDPV6, "LOCATOR_KIND_UDPV6" },
{ LOCATOR_KIND_INVALID, "LOCATOR_KIND_INVALID" },
{ LOCATOR_KIND_DTLS, "LOCATOR_KIND_DTLS" },
{ LOCATOR_KIND_TCPV4_LAN, "LOCATOR_KIND_TCPV4_LAN" },
{ LOCATOR_KIND_TCPV4_WAN, "LOCATOR_KIND_TCPV4_WAN" },
{ LOCATOR_KIND_TLSV4_LAN, "LOCATOR_KIND_TLSV4_LAN" },
{ LOCATOR_KIND_TLSV4_WAN, "LOCATOR_KIND_TLSV4_WAN" },
{ LOCATOR_KIND_SHMEM, "LOCATOR_KIND_SHMEM" },
{ LOCATOR_KIND_TUDPV4, "LOCATOR_KIND_TUDPV4" },
{ LOCATOR_KIND_RESERVED, "LOCATOR_KIND_RESERVED" },
{ LOCATOR_KIND_UDPV4_WAN, "LOCATOR_KIND_UDPV4_WAN" },
{ 0, NULL }
};
static const value_string submessage_id_vals[] = {
{ SUBMESSAGE_PAD, "PAD" },
{ SUBMESSAGE_DATA, "DATA" },
{ SUBMESSAGE_NOKEY_DATA, "NOKEY_DATA" },
{ SUBMESSAGE_ACKNACK, "ACKNACK" },
{ SUBMESSAGE_HEARTBEAT, "HEARTBEAT" },
{ SUBMESSAGE_GAP, "GAP" },
{ SUBMESSAGE_INFO_TS, "INFO_TS" },
{ SUBMESSAGE_INFO_SRC, "INFO_SRC" },
{ SUBMESSAGE_INFO_REPLY_IP4, "INFO_REPLY_IP4" },
{ SUBMESSAGE_INFO_DST, "INFO_DST" },
{ SUBMESSAGE_INFO_REPLY, "INFO_REPLY" },
{ 0, NULL }
};
static const value_string submessage_id_valsv2[] = {
{ SUBMESSAGE_HEADER_EXTENSION, "HEADER_EXTENSION" },
{ SUBMESSAGE_PAD, "PAD" },
{ SUBMESSAGE_RTPS_DATA, "DATA" },
{ SUBMESSAGE_RTPS_DATA_FRAG, "DATA_FRAG" },
{ SUBMESSAGE_RTI_DATA_FRAG_SESSION, "DATA_FRAG_SESSION" },
{ SUBMESSAGE_RTPS_DATA_BATCH, "DATA_BATCH" },
{ SUBMESSAGE_ACKNACK, "ACKNACK" },
{ SUBMESSAGE_HEARTBEAT, "HEARTBEAT" },
{ SUBMESSAGE_GAP, "GAP" },
{ SUBMESSAGE_INFO_TS, "INFO_TS" },
{ SUBMESSAGE_INFO_SRC, "INFO_SRC" },
{ SUBMESSAGE_INFO_REPLY_IP4, "INFO_REPLY_IP4" },
{ SUBMESSAGE_INFO_DST, "INFO_DST" },
{ SUBMESSAGE_INFO_REPLY, "INFO_REPLY" },
{ SUBMESSAGE_NACK_FRAG, "NACK_FRAG" },
{ SUBMESSAGE_HEARTBEAT_FRAG, "HEARTBEAT_FRAG" },
{ SUBMESSAGE_ACKNACK_BATCH, "ACKNACK_BATCH" },
{ SUBMESSAGE_HEARTBEAT_BATCH, "HEARTBEAT_BATCH" },
{ SUBMESSAGE_ACKNACK_SESSION, "ACKNACK_SESSION" },
{ SUBMESSAGE_HEARTBEAT_SESSION, "HEARTBEAT_SESSION" },
{ SUBMESSAGE_RTPS_DATA_SESSION, "DATA_SESSION" },
{ SUBMESSAGE_APP_ACK, "APP_ACK" },
{ SUBMESSAGE_APP_ACK_CONF, "APP_ACK_CONF" },
{ SUBMESSAGE_HEARTBEAT_VIRTUAL, "HEARTBEAT_VIRTUAL" },
{ SUBMESSAGE_SEC_BODY, "SEC_BODY" },
{ SUBMESSAGE_SEC_PREFIX, "SEC_PREFIX" },
{ SUBMESSAGE_SEC_POSTFIX, "SEC_POSTFIX" },
{ SUBMESSAGE_SRTPS_PREFIX, "SRTPS_PREFIX" },
{ SUBMESSAGE_SRTPS_POSTFIX, "SRTPS_POSTFIX" },
/* Deprecated submessages */
{ SUBMESSAGE_DATA, "DATA_deprecated" },
{ SUBMESSAGE_NOKEY_DATA, "NOKEY_DATA_deprecated" },
{ SUBMESSAGE_DATA_FRAG, "DATA_FRAG_deprecated" },
{ SUBMESSAGE_NOKEY_DATA_FRAG, "NOKEY_DATA_FRAG_deprecated" },
{ 0, NULL }
};
static const value_string submessage_id_rti[] = {
{ SUBMESSAGE_RTI_CRC, "RTI_CRC" },
{ SUBMESSAGE_RTI_UDP_WAN_BINDING_PING, "RTI_BINDING_PING" },
{ SUBMESSAGE_RTI_DATA_FRAG_SESSION, "DATA_FRAG_SESSION" },
{ 0, NULL }
};
#if 0
static const value_string typecode_kind_vals[] = {
{ RTI_CDR_TK_NULL, "(unknown)" },
{ RTI_CDR_TK_SHORT, "short" },
{ RTI_CDR_TK_LONG, "long" },
{ RTI_CDR_TK_USHORT, "unsigned short" },
{ RTI_CDR_TK_ULONG, "unsigned long" },
{ RTI_CDR_TK_FLOAT, "float" },
{ RTI_CDR_TK_DOUBLE, "double" },
{ RTI_CDR_TK_BOOLEAN, "boolean" },
{ RTI_CDR_TK_CHAR, "char" },
{ RTI_CDR_TK_OCTET, "octet" },
{ RTI_CDR_TK_STRUCT, "struct" },
{ RTI_CDR_TK_UNION, "union" },
{ RTI_CDR_TK_ENUM, "enum" },
{ RTI_CDR_TK_STRING, "string" },
{ RTI_CDR_TK_SEQUENCE, "sequence" },
{ RTI_CDR_TK_ARRAY, "array" },
{ RTI_CDR_TK_ALIAS, "alias" },
{ RTI_CDR_TK_LONGLONG, "long long" },
{ RTI_CDR_TK_ULONGLONG, "unsigned long long" },
{ RTI_CDR_TK_LONGDOUBLE, "long double" },
{ RTI_CDR_TK_WCHAR, "wchar" },
{ RTI_CDR_TK_WSTRING, "wstring" },
{ 0, NULL }
};
#endif
static const value_string parameter_id_vals[] = {
{ PID_PAD, "PID_PAD" },
{ PID_SENTINEL, "PID_SENTINEL" },
{ PID_USER_DATA, "PID_USER_DATA" },
{ PID_TOPIC_NAME, "PID_TOPIC_NAME" },
{ PID_TYPE_NAME, "PID_TYPE_NAME" },
{ PID_GROUP_DATA, "PID_GROUP_DATA" },
{ PID_DEADLINE, "PID_DEADLINE" },
{ PID_DEADLINE_OFFERED, "PID_DEADLINE_OFFERED [deprecated]" },
{ PID_PARTICIPANT_LEASE_DURATION, "PID_PARTICIPANT_LEASE_DURATION" },
{ PID_PERSISTENCE, "PID_PERSISTENCE" },
{ PID_TIME_BASED_FILTER, "PID_TIME_BASED_FILTER" },
{ PID_OWNERSHIP_STRENGTH, "PID_OWNERSHIP_STRENGTH" },
{ PID_TYPE_CHECKSUM, "PID_TYPE_CHECKSUM [deprecated]" },
{ PID_TYPE2_NAME, "PID_TYPE2_NAME [deprecated]" },
{ PID_TYPE2_CHECKSUM, "PID_TYPE2_CHECKSUM [deprecated]" },
{ PID_METATRAFFIC_MULTICAST_IPADDRESS,"PID_METATRAFFIC_MULTICAST_IPADDRESS"},
{ PID_DEFAULT_UNICAST_IPADDRESS, "PID_DEFAULT_UNICAST_IPADDRESS" },
{ PID_METATRAFFIC_UNICAST_PORT, "PID_METATRAFFIC_UNICAST_PORT" },
{ PID_DEFAULT_UNICAST_PORT, "PID_DEFAULT_UNICAST_PORT" },
{ PID_EXPECTS_ACK, "PID_EXPECTS_ACK" },
{ PID_MULTICAST_IPADDRESS, "PID_MULTICAST_IPADDRESS" },
{ PID_MANAGER_KEY, "PID_MANAGER_KEY [deprecated]" },
{ PID_SEND_QUEUE_SIZE, "PID_SEND_QUEUE_SIZE" },
{ PID_RELIABILITY_ENABLED, "PID_RELIABILITY_ENABLED" },
{ PID_PROTOCOL_VERSION, "PID_PROTOCOL_VERSION" },
{ PID_VENDOR_ID, "PID_VENDOR_ID" },
{ PID_VARGAPPS_SEQUENCE_NUMBER_LAST, "PID_VARGAPPS_SEQUENCE_NUMBER_LAST [deprecated]" },
{ PID_RECV_QUEUE_SIZE, "PID_RECV_QUEUE_SIZE [deprecated]" },
{ PID_RELIABILITY_OFFERED, "PID_RELIABILITY_OFFERED [deprecated]" },
{ PID_RELIABILITY, "PID_RELIABILITY" },
{ PID_LIVELINESS, "PID_LIVELINESS" },
{ PID_LIVELINESS_OFFERED, "PID_LIVELINESS_OFFERED [deprecated]" },
{ PID_DURABILITY, "PID_DURABILITY" },
{ PID_DURABILITY_SERVICE, "PID_DURABILITY_SERVICE" },
{ PID_PRESENTATION_OFFERED, "PID_PRESENTATION_OFFERED [deprecated]" },
{ PID_OWNERSHIP, "PID_OWNERSHIP" },
{ PID_OWNERSHIP_OFFERED, "PID_OWNERSHIP_OFFERED [deprecated]" },
{ PID_PRESENTATION, "PID_PRESENTATION" },
{ PID_DESTINATION_ORDER, "PID_DESTINATION_ORDER" },
{ PID_DESTINATION_ORDER_OFFERED, "PID_DESTINATION_ORDER_OFFERED [deprecated]" },
{ PID_LATENCY_BUDGET, "PID_LATENCY_BUDGET" },
{ PID_LATENCY_BUDGET_OFFERED, "PID_LATENCY_BUDGET_OFFERED [deprecated]" },
{ PID_PARTITION, "PID_PARTITION" },
{ PID_PARTITION_OFFERED, "PID_PARTITION_OFFERED [deprecated]" },
{ PID_LIFESPAN, "PID_LIFESPAN" },
{ PID_TOPIC_DATA, "PID_TOPIC_DATA" },
{ PID_UNICAST_LOCATOR, "PID_UNICAST_LOCATOR" },
{ PID_MULTICAST_LOCATOR, "PID_MULTICAST_LOCATOR" },
{ PID_DEFAULT_UNICAST_LOCATOR, "PID_DEFAULT_UNICAST_LOCATOR" },
{ PID_METATRAFFIC_UNICAST_LOCATOR, "PID_METATRAFFIC_UNICAST_LOCATOR" },
{ PID_METATRAFFIC_MULTICAST_LOCATOR, "PID_METATRAFFIC_MULTICAST_LOCATOR" },
{ PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT, "PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT" },
{ PID_HISTORY, "PID_HISTORY" },
{ PID_RESOURCE_LIMIT, "PID_RESOURCE_LIMIT" },
{ PID_METATRAFFIC_MULTICAST_PORT, "PID_METATRAFFIC_MULTICAST_PORT" },
{ PID_EXPECTS_INLINE_QOS, "PID_EXPECTS_INLINE_QOS" },
{ PID_METATRAFFIC_UNICAST_IPADDRESS, "PID_METATRAFFIC_UNICAST_IPADDRESS" },
{ PID_PARTICIPANT_BUILTIN_ENDPOINTS, "PID_PARTICIPANT_BUILTIN_ENDPOINTS" },
{ PID_CONTENT_FILTER_PROPERTY, "PID_CONTENT_FILTER_PROPERTY" },
{ PID_PROPERTY_LIST_OLD, "PID_PROPERTY_LIST" },
{ PID_FILTER_SIGNATURE, "PID_FILTER_SIGNATURE" },
{ PID_COHERENT_SET, "PID_COHERENT_SET" },
{ PID_TYPECODE, "PID_TYPECODE" },
{ PID_PARTICIPANT_GUID, "PID_PARTICIPANT_GUID" },
{ PID_PARTICIPANT_ENTITY_ID, "PID_PARTICIPANT_ENTITY_ID" },
{ PID_GROUP_GUID, "PID_GROUP_GUID" },
{ PID_GROUP_ENTITY_ID, "PID_GROUP_ENTITY_ID" },
{ 0, NULL }
};
static const value_string parameter_id_inline_qos_rti[] = {
{ PID_RELATED_ORIGINAL_WRITER_INFO, "PID_RELATED_ORIGINAL_WRITER_INFO" },
{ PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY, "PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY" },
{ PID_RELATED_SOURCE_GUID, "PID_RELATED_SOURCE_GUID" },
{ PID_RELATED_READER_GUID, "PID_RELATED_READER_GUID" },
{ PID_SOURCE_GUID, "PID_SOURCE_GUID" },
{ PID_TOPIC_QUERY_GUID, "PID_TOPIC_QUERY_GUID" },
{ PID_SAMPLE_SIGNATURE, "PID_SAMPLE_SIGNATURE" },
{ 0, NULL }
};
static const value_string parameter_id_v2_vals[] = {
{ PID_PAD, "PID_PAD" },
{ PID_SENTINEL, "PID_SENTINEL" },
{ PID_PARTICIPANT_LEASE_DURATION, "PID_PARTICIPANT_LEASE_DURATION" },
{ PID_TIME_BASED_FILTER, "PID_TIME_BASED_FILTER" },
{ PID_TOPIC_NAME, "PID_TOPIC_NAME" },
{ PID_OWNERSHIP_STRENGTH, "PID_OWNERSHIP_STRENGTH" },
{ PID_TYPE_NAME, "PID_TYPE_NAME" },
{ PID_METATRAFFIC_MULTICAST_IPADDRESS,"PID_METATRAFFIC_MULTICAST_IPADDRESS"},
{ PID_DEFAULT_UNICAST_IPADDRESS, "PID_DEFAULT_UNICAST_IPADDRESS" },
{ PID_METATRAFFIC_UNICAST_PORT, "PID_METATRAFFIC_UNICAST_PORT" },
{ PID_DEFAULT_UNICAST_PORT, "PID_DEFAULT_UNICAST_PORT" },
{ PID_MULTICAST_IPADDRESS, "PID_MULTICAST_IPADDRESS" },
{ PID_PROTOCOL_VERSION, "PID_PROTOCOL_VERSION" },
{ PID_VENDOR_ID, "PID_VENDOR_ID" },
{ PID_RELIABILITY, "PID_RELIABILITY" },
{ PID_LIVELINESS, "PID_LIVELINESS" },
{ PID_DURABILITY, "PID_DURABILITY" },
{ PID_DURABILITY_SERVICE, "PID_DURABILITY_SERVICE" },
{ PID_OWNERSHIP, "PID_OWNERSHIP" },
{ PID_PRESENTATION, "PID_PRESENTATION" },
{ PID_DEADLINE, "PID_DEADLINE" },
{ PID_DESTINATION_ORDER, "PID_DESTINATION_ORDER" },
{ PID_LATENCY_BUDGET, "PID_LATENCY_BUDGET" },
{ PID_PARTITION, "PID_PARTITION" },
{ PID_LIFESPAN, "PID_LIFESPAN" },
{ PID_USER_DATA, "PID_USER_DATA" },
{ PID_GROUP_DATA, "PID_GROUP_DATA" },
{ PID_TOPIC_DATA, "PID_TOPIC_DATA" },
{ PID_UNICAST_LOCATOR, "PID_UNICAST_LOCATOR" },
{ PID_MULTICAST_LOCATOR, "PID_MULTICAST_LOCATOR" },
{ PID_DEFAULT_UNICAST_LOCATOR, "PID_DEFAULT_UNICAST_LOCATOR" },
{ PID_METATRAFFIC_UNICAST_LOCATOR, "PID_METATRAFFIC_UNICAST_LOCATOR" },
{ PID_METATRAFFIC_MULTICAST_LOCATOR, "PID_METATRAFFIC_MULTICAST_LOCATOR" },
{ PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT, "PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT" },
{ PID_CONTENT_FILTER_PROPERTY, "PID_CONTENT_FILTER_PROPERTY" },
{ PID_PROPERTY_LIST, "PID_PROPERTY_LIST" },
{ PID_HISTORY, "PID_HISTORY" },
{ PID_RESOURCE_LIMIT, "PID_RESOURCE_LIMIT" },
{ PID_EXPECTS_INLINE_QOS, "PID_EXPECTS_INLINE_QOS" },
{ PID_PARTICIPANT_BUILTIN_ENDPOINTS, "PID_PARTICIPANT_BUILTIN_ENDPOINTS" },
{ PID_METATRAFFIC_UNICAST_IPADDRESS, "PID_METATRAFFIC_UNICAST_IPADDRESS" },
{ PID_METATRAFFIC_MULTICAST_PORT, "PID_METATRAFFIC_MULTICAST_PORT" },
{ PID_DEFAULT_MULTICAST_LOCATOR, "PID_DEFAULT_MULTICAST_LOCATOR" },
{ PID_TRANSPORT_PRIORITY, "PID_TRANSPORT_PRIORITY" },
{ PID_PARTICIPANT_GUID, "PID_PARTICIPANT_GUID" },
{ PID_PARTICIPANT_ENTITY_ID, "PID_PARTICIPANT_ENTITY_ID" },
{ PID_GROUP_GUID, "PID_GROUP_GUID" },
{ PID_GROUP_ENTITY_ID, "PID_GROUP_ENTITY_ID" },
{ PID_CONTENT_FILTER_INFO, "PID_CONTENT_FILTER_INFO" },
{ PID_COHERENT_SET, "PID_COHERENT_SET" },
{ PID_DIRECTED_WRITE, "PID_DIRECTED_WRITE" },
{ PID_BUILTIN_ENDPOINT_SET, "PID_BUILTIN_ENDPOINT_SET" },
{ PID_PROPERTY_LIST_OLD, "PID_PROPERTY_LIST" },
{ PID_ENDPOINT_GUID, "PID_ENDPOINT_GUID" },
{ PID_TYPE_MAX_SIZE_SERIALIZED, "PID_TYPE_MAX_SIZE_SERIALIZED" },
{ PID_ORIGINAL_WRITER_INFO, "PID_ORIGINAL_WRITER_INFO" },
{ PID_ENTITY_NAME, "PID_ENTITY_NAME" },
{ PID_KEY_HASH, "PID_KEY_HASH" },
{ PID_STATUS_INFO, "PID_STATUS_INFO" },
{ PID_DATA_REPRESENTATION, "PID_DATA_REPRESENTATION" },
{ PID_TYPE_CONSISTENCY, "PID_TYPE_CONSISTENCY" },
{ PID_BUILTIN_ENDPOINT_QOS, "PID_BUILTIN_ENDPOINT_QOS" },
{ PID_ENABLE_AUTHENTICATION, "PID_ENABLE_AUTHENTICATION" },
{ PID_RELATED_ENTITY_GUID, "PID_RELATED_ENTITY_GUID" },
{ PID_IDENTITY_TOKEN, "PID_IDENTITY_TOKEN" },
{ PID_PERMISSIONS_TOKEN, "PID_PERMISSIONS_TOKEN" },
{ PID_DATA_TAGS, "PID_DATA_TAGS" },
{ PID_ENDPOINT_SECURITY_INFO, "PID_ENDPOINT_SECURITY_INFO" },
{ PID_PARTICIPANT_SECURITY_INFO, "PID_PARTICIPANT_SECURITY_INFO" },
{ PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO, "PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO" },
{ PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO, "PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO" },
{ PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO, "PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO" },
{ PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO, "PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO" },
{ PID_IDENTITY_STATUS_TOKEN, "PID_IDENTITY_STATUS_TOKEN"},
{ PID_DOMAIN_ID, "PID_DOMAIN_ID" },
{ PID_DOMAIN_TAG, "PID_DOMAIN_TAG" },
{ PID_GROUP_COHERENT_SET, "PID_GROUP_COHERENT_SET" },
{ PID_END_COHERENT_SET, "PID_END_COHERENT_SET" },
{ PID_END_GROUP_COHERENT_SET, "PID_END_GROUP_COHERENT_SET" },
{ MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT, "MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT" },
/* The following PID are deprecated */
{ PID_DEADLINE_OFFERED, "PID_DEADLINE_OFFERED [deprecated]" },
{ PID_PERSISTENCE, "PID_PERSISTENCE [deprecated]" },
{ PID_TYPE_CHECKSUM, "PID_TYPE_CHECKSUM [deprecated]" },
{ PID_TYPE2_NAME, "PID_TYPE2_NAME [deprecated]" },
{ PID_TYPE2_CHECKSUM, "PID_TYPE2_CHECKSUM [deprecated]" },
{ PID_EXPECTS_ACK, "PID_EXPECTS_ACK [deprecated]" },
{ PID_MANAGER_KEY, "PID_MANAGER_KEY [deprecated]" },
{ PID_SEND_QUEUE_SIZE, "PID_SEND_QUEUE_SIZE [deprecated]" },
{ PID_RELIABILITY_ENABLED, "PID_RELIABILITY_ENABLED [deprecated]" },
{ PID_VARGAPPS_SEQUENCE_NUMBER_LAST, "PID_VARGAPPS_SEQUENCE_NUMBER_LAST [deprecated]" },
{ PID_RECV_QUEUE_SIZE, "PID_RECV_QUEUE_SIZE [deprecated]" },
{ PID_RELIABILITY_OFFERED, "PID_RELIABILITY_OFFERED [deprecated]" },
{ PID_LIVELINESS_OFFERED, "PID_LIVELINESS_OFFERED [deprecated]" },
{ PID_PRESENTATION_OFFERED, "PID_PRESENTATION_OFFERED [deprecated]" },
{ PID_OWNERSHIP_OFFERED, "PID_OWNERSHIP_OFFERED [deprecated]" },
{ PID_DESTINATION_ORDER_OFFERED, "PID_DESTINATION_ORDER_OFFERED [deprecated]" },
{ PID_LATENCY_BUDGET_OFFERED, "PID_LATENCY_BUDGET_OFFERED [deprecated]" },
{ PID_PARTITION_OFFERED, "PID_PARTITION_OFFERED [deprecated]" },
{ PID_EXTENDED, "PID_EXTENDED" },
{ 0, NULL }
};
static const value_string parameter_id_rti_vals[] = {
/* Vendor specific: RTI */
{ PID_PRODUCT_VERSION, "PID_PRODUCT_VERSION" },
{ PID_PLUGIN_PROMISCUITY_KIND, "PID_PLUGIN_PROMISCUITY_KIND" },
{ PID_ENTITY_VIRTUAL_GUID, "PID_ENTITY_VIRTUAL_GUID" },
{ PID_SERVICE_KIND, "PID_SERVICE_KIND" },
{ PID_TYPECODE_RTPS2, "PID_TYPECODE" },
{ PID_DISABLE_POSITIVE_ACKS, "PID_DISABLE_POSITIVE_ACKS" },
{ PID_LOCATOR_FILTER_LIST, "PID_LOCATOR_FILTER_LIST" },
{ PID_ROLE_NAME, "PID_ROLE_NAME"},
{ PID_ACK_KIND, "PID_ACK_KIND" },
{ PID_PEER_HOST_EPOCH, "PID_PEER_HOST_EPOCH" },
{ PID_TRANSPORT_INFO_LIST, "PID_TRANSPORT_INFO_LIST" },
{ PID_DIRECT_COMMUNICATION, "PID_DIRECT_COMMUNICATION" },
{ PID_TYPE_OBJECT, "PID_TYPE_OBJECT" },
{ PID_EXPECTS_VIRTUAL_HB, "PID_EXPECTS_VIRTUAL_HB" },
{ PID_RTI_DOMAIN_ID, "PID_RTI_DOMAIN_ID" },
{ PID_TOPIC_QUERY_PUBLICATION, "PID_TOPIC_QUERY_PUBLICATION" },
{ PID_ENDPOINT_PROPERTY_CHANGE_EPOCH, "PID_ENDPOINT_PROPERTY_CHANGE_EPOCH" },
{ PID_REACHABILITY_LEASE_DURATION, "PID_REACHABILITY_LEASE_DURATION" },
{ PID_VENDOR_BUILTIN_ENDPOINT_SET, "PID_VENDOR_BUILTIN_ENDPOINT_SET" },
{ PID_ENDPOINT_SECURITY_ATTRIBUTES, "PID_ENDPOINT_SECURITY_ATTRIBUTES" },
{ PID_TYPE_OBJECT_LB, "PID_TYPE_OBJECT_LB" },
{ PID_UNICAST_LOCATOR_EX, "PID_UNICAST_LOCATOR_EX"},
{ 0, NULL }
};
static const value_string parameter_id_toc_vals[] = {
/* Vendor specific: Twin Oaks Computing */
{ PID_TYPECODE_RTPS2, "PID_TYPECODE_RTPS2" },
{ 0, NULL }
};
static const value_string parameter_id_adl_vals[] = {
/* Vendor specific: ADLink Ltd. */
{ PID_ADLINK_WRITER_INFO, "PID_ADLINK_WRITER_INFO" },
{ PID_ADLINK_READER_DATA_LIFECYCLE, "PID_ADLINK_READER_DATA_LIFECYCLE" },
{ PID_ADLINK_WRITER_DATA_LIFECYCLE, "PID_ADLINK_WRITER_DATA_LIFECYCLE" },
{ PID_ADLINK_ENDPOINT_GUID, "PID_ADLINK_ENDPOINT_GUID" },
{ PID_ADLINK_SYNCHRONOUS_ENDPOINT, "PID_ADLINK_SYNCHRONOUS_ENDPOINT" },
{ PID_ADLINK_RELAXED_QOS_MATCHING, "PID_ADLINK_RELAXED_QOS_MATCHING" },
{ PID_ADLINK_PARTICIPANT_VERSION_INFO, "PID_ADLINK_PARTICIPANT_VERSION_INFO" },
{ PID_ADLINK_NODE_NAME, "PID_ADLINK_NODE_NAME" },
{ PID_ADLINK_EXEC_NAME, "PID_ADLINK_EXEC_NAME" },
{ PID_ADLINK_PROCESS_ID, "PID_ADLINK_PROCESS_ID" },
{ PID_ADLINK_SERVICE_TYPE, "PID_ADLINK_SERVICE_TYPE" },
{ PID_ADLINK_ENTITY_FACTORY, "PID_ADLINK_ENTITY_FACTORY" },
{ PID_ADLINK_WATCHDOG_SCHEDULING, "PID_ADLINK_WATCHDOG_SCHEDULING" },
{ PID_ADLINK_LISTENER_SCHEDULING, "PID_ADLINK_LISTENER_SCHEDULING" },
{ PID_ADLINK_SUBSCRIPTION_KEYS, "PID_ADLINK_SUBSCRIPTION_KEYS" },
{ PID_ADLINK_READER_LIFESPAN, "PID_ADLINK_READER_LIFESPAN" },
{ PID_ADLINK_SHARE, "PID_ADLINK_SHARE" },
{ PID_ADLINK_TYPE_DESCRIPTION, "PID_ADLINK_TYPE_DESCRIPTION" },
{ PID_ADLINK_LAN_ID, "PID_ADLINK_LAN_ID" },
{ PID_ADLINK_ENDPOINT_GID, "PID_ADLINK_ENDPOINT_GID" },
{ PID_ADLINK_GROUP_GID, "PID_ADLINK_GROUP_GID" },
{ PID_ADLINK_EOTINFO, "PID_ADLINK_EOTINFO" },
{ PID_ADLINK_PART_CERT_NAME, "PID_ADLINK_PART_CERT_NAME" },
{ PID_ADLINK_LAN_CERT_NAME, "PID_ADLINK_LAN_CERT_NAME" },
{ 0, NULL }
};
static const value_string liveliness_qos_vals[] = {
{ LIVELINESS_AUTOMATIC, "AUTOMATIC_LIVELINESS_QOS" },
{ LIVELINESS_BY_PARTICIPANT, "MANUAL_BY_PARTICIPANT_LIVELINESS_QOS" },
{ LIVELINESS_BY_TOPIC, "MANUAL_BY_TOPIC_LIVELINESS_QOS" },
{ 0, NULL }
};
static const value_string durability_qos_vals[] = {
{ DURABILITY_VOLATILE, "VOLATILE_DURABILITY_QOS" },
{ DURABILITY_TRANSIENT_LOCAL, "TRANSIENT_LOCAL_DURABILITY_QOS" },
{ DURABILITY_TRANSIENT, "TRANSIENT_DURABILITY_QOS" },
{ DURABILITY_PERSISTENT, "PERSISTENT_DURABILITY_QOS" },
{ 0, NULL }
};
static const value_string ownership_qos_vals[] = {
{ OWNERSHIP_SHARED, "SHARED_OWNERSHIP_QOS" },
{ OWNERSHIP_EXCLUSIVE, "EXCLUSIVE_OWNERSHIP_QOS" },
{ 0, NULL }
};
static const value_string presentation_qos_vals[] = {
{ PRESENTATION_INSTANCE, "INSTANCE_PRESENTATION_QOS" },
{ PRESENTATION_TOPIC, "TOPIC_PRESENTATION_QOS" },
{ PRESENTATION_GROUP, "GROUP_PRESENTATION_QOS" },
{ 0, NULL }
};
static const value_string history_qos_vals[] = {
{ HISTORY_KIND_KEEP_LAST, "KEEP_LAST_HISTORY_QOS" },
{ HISTORY_KIND_KEEP_ALL, "KEEP_ALL_HISTORY_QOS" },
{ 0, NULL }
};
static const value_string reliability_qos_vals[] = {
{ RELIABILITY_BEST_EFFORT, "BEST_EFFORT_RELIABILITY_QOS" },
{ RELIABILITY_RELIABLE, "RELIABLE_RELIABILITY_QOS" },
{ 0, NULL }
};
static const value_string destination_order_qos_vals[] = {
{ BY_RECEPTION_TIMESTAMP, "BY_RECEPTION_TIMESTAMP_DESTINATIONORDER_QOS" },
{ BY_SOURCE_TIMESTAMP, "BY_SOURCE_TIMESTAMP_DESTINATIONORDER_QOS" },
{ 0, NULL }
};
static const value_string encapsulation_id_vals[] = {
{ ENCAPSULATION_CDR_BE, "CDR_BE" },
{ ENCAPSULATION_CDR_LE, "CDR_LE" },
{ ENCAPSULATION_PL_CDR_BE, "PL_CDR_BE" },
{ ENCAPSULATION_PL_CDR_LE, "PL_CDR_LE" },
{ ENCAPSULATION_CDR2_BE, "CDR2_BE" },
{ ENCAPSULATION_CDR2_LE, "CDR2_LE" },
{ ENCAPSULATION_D_CDR2_BE, "D_CDR2_BE" },
{ ENCAPSULATION_D_CDR2_LE, "D_CDR2_LE" },
{ ENCAPSULATION_PL_CDR2_BE, "PL_CDR2_BE" },
{ ENCAPSULATION_PL_CDR2_LE, "PL_CDR2_LE" },
{ ENCAPSULATION_SHMEM_REF_PLAIN, "SHMEM_REF_PLAIN" },
{ ENCAPSULATION_SHMEM_REF_FLAT_DATA, "SHMEM_REF_PLAIN" },
{ 0, NULL }
};
static const value_string data_representation_kind_vals[] = {
{ 0, "XCDR_DATA_REPRESENTATION" },
{ 1, "XML_DATA_REPRESENTATION" },
{ 2, "XCDR2_DATA_REPRESENTATION" },
{ 0, NULL }
};
static const value_string plugin_promiscuity_kind_vals[] = {
{ 0x0001, "MATCHING_REMOTE_ENTITIES_PROMISCUITY" },
{ 0xffff, "ALL_REMOTE_ENTITIES_PROMISCUITY" },
{ 0, NULL }
};
static const value_string service_kind_vals[] = {
{ 0x00000000, "NO_SERVICE_QOS" },
{ 0x00000001, "PERSISTENCE_SERVICE_QOS" },
{ 0, NULL }
};
static const value_string secure_transformation_kind[] = {
{ CRYPTO_TRANSFORMATION_KIND_NONE, "NONE" },
{ CRYPTO_TRANSFORMATION_KIND_AES128_GMAC, "AES128_GMAC" },
{ CRYPTO_TRANSFORMATION_KIND_AES128_GCM, "AES128_GCM" },
{ CRYPTO_TRANSFORMATION_KIND_AES256_GMAC, "AES256_GMAC" },
{ CRYPTO_TRANSFORMATION_KIND_AES256_GCM, "AES256_GCM" },
{ 0, NULL }
};
static const value_string participant_message_data_kind [] = {
{ PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN, "PARTICIPANT_MESSAGE_DATA_KIND_UNKNOWN" },
{ PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE, "PARTICIPANT_MESSAGE_DATA_KIND_AUTOMATIC_LIVELINESS_UPDATE" },
{ PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE, "PARTICIPANT_MESSAGE_DATA_KIND_MANUAL_LIVELINESS_UPDATE" },
{ 0, NULL }
};
/* Vendor specific: RTI */
static const value_string type_consistency_kind_vals[] = {
{ DISALLOW_TYPE_COERCION, "DISALLOW_TYPE_COERCION" },
{ ALLOW_TYPE_COERCION, "ALLOW_TYPE_COERCION" },
{ 0, NULL }
};
static const value_string service_request_kind[] = {
{ RTI_SERVICE_REQUEST_ID_UNKNOWN, "RTI_SERVICE_REQUEST_ID_UNKNOWN" },
{ RTI_SERVICE_REQUEST_ID_TOPIC_QUERY, "RTI_SERVICE_REQUEST_ID_TOPIC_QUERY" },
{ RTI_SERVICE_REQUEST_ID_INSTANCE_STATE, "RTI_SERVICE_REQUEST_ID_INSTANCE_STATE" },
{ 0, NULL }
};
/* Vendor specific: RTI */
static const value_string acknowledgement_kind_vals[] = {
{ PROTOCOL_ACKNOWLEDGMENT, "PROTOCOL_ACKNOWLEDGMENT" },
{ APPLICATION_AUTO_ACKNOWLEDGMENT, "APPLICATION_AUTO_ACKNOWLEDGMENT" },
{ APPLICATION_ORDERED_ACKNOWLEDGMENT, "APPLICATION_ORDERED_ACKNOWLEDGMENT" },
{ APPLICATION_EXPLICIT_ACKNOWLEDGMENT, "APPLICATION_EXPLICIT_ACKNOWLEDGMENT" },
{ 0, NULL }
};
static int* const TYPE_FLAG_FLAGS[] = {
&hf_rtps_flag_typeflag_nested, /* Bit 2 */
&hf_rtps_flag_typeflag_mutable, /* Bit 1 */
&hf_rtps_flag_typeflag_final, /* Bit 0 */
NULL
};
static int* const MEMBER_FLAGS[] = {
&hf_rtps_flag_memberflag_union_default, /* Bit 3 */
&hf_rtps_flag_memberflag_shareable, /* Bit 2 */
&hf_rtps_flag_memberflag_optional, /* Bit 1 */
&hf_rtps_flag_memberflag_key, /* Bit 0 */
NULL
};
static int* const UDPV4_WAN_LOCATOR_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_udpv4_wan_locator_r, /* Bit 3 */
&hf_rtps_flag_udpv4_wan_locator_b, /* Bit 2 */
&hf_rtps_flag_udpv4_wan_locator_p, /* Bit 1 */
&hf_rtps_flag_udpv4_wan_locator_u, /* Bit 0 */
NULL
};
static int* const UDPV4_WAN_BINDING_PING_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_udpv4_wan_binding_ping_b, /* Bit 2 */
&hf_rtps_flag_udpv4_wan_binding_ping_l, /* Bit 1 */
&hf_rtps_flag_udpv4_wan_binding_ping_e, /* Bit 0 */
NULL
};
/* Vendor specific: RTI */
static const value_string ndds_transport_class_id_vals[] = {
{ NDDS_TRANSPORT_CLASSID_ANY, "ANY" },
{ NDDS_TRANSPORT_CLASSID_UDPv4, "UDPv4" },
{ NDDS_TRANSPORT_CLASSID_SHMEM, "SHMEM" },
{ NDDS_TRANSPORT_CLASSID_INTRA, "INTRA" },
{ NDDS_TRANSPORT_CLASSID_UDPv6, "UDPv6" },
{ NDDS_TRANSPORT_CLASSID_DTLS, "DTLS" },
{ NDDS_TRANSPORT_CLASSID_WAN, "WAN" },
{ NDDS_TRANSPORT_CLASSID_TCPV4_LAN, "TCPv4_LAN" },
{ NDDS_TRANSPORT_CLASSID_TCPV4_WAN, "TCPv4_WAN" },
{ NDDS_TRANSPORT_CLASSID_TLSV4_LAN, "TLSv4_LAN" },
{ NDDS_TRANSPORT_CLASSID_TLSV4_WAN, "TLSv4_WAN" },
{ NDDS_TRANSPORT_CLASSID_PCIE, "PCIE" },
{ NDDS_TRANSPORT_CLASSID_ITP, "ITP" },
{ NDDS_TRANSPORT_CLASSID_UDPv4_WAN, "UDPv4_WAN" },
{ 0, NULL }
};
static const value_string class_id_enum_names[] = {
{ RTI_OSAPI_COMPRESSION_CLASS_ID_NONE, "NONE" },
{ RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB, "ZLIB" },
{ RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2, "BZIP2" },
{ RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO, "AUTO"},
{ 0, NULL}
};
static const value_string topic_query_selection_kind[] = {
{ RTPS_TOPIC_QUERY_SELECTION_KIND_HISTORY_SNAPSHOT, "HISTORY_SNAPSHOT" },
{ RTPS_TOPIC_QUERY_SELECTION_KIND_CONTINUOUS, "CONTINUOUS" },
{ 0, NULL}
};
static int* const PAD_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const DATA_FLAGSv1[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_unregister, /* Bit 5 */
&hf_rtps_flag_inline_qos_v1, /* Bit 4 */
&hf_rtps_flag_hash_key, /* Bit 3 */
&hf_rtps_flag_alive, /* Bit 2 */
&hf_rtps_flag_data_present_v1, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const DATA_FLAGSv2[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_status_info, /* Bit 4 */
&hf_rtps_flag_hash_key, /* Bit 3 */
&hf_rtps_flag_data_present_v2, /* Bit 2 */
&hf_rtps_flag_inline_qos_v2, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const NOKEY_DATA_FRAG_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_inline_qos_v2, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const NOKEY_DATA_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_inline_qos_v2, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const ACKNACK_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_final, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const NACK_FRAG_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const GAP_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const HEARTBEAT_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_liveliness, /* Bit 2 */
&hf_rtps_flag_final, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const HEARTBEAT_BATCH_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_liveliness, /* Bit 2 */
&hf_rtps_flag_final, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const HEARTBEAT_FRAG_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const RTPS_DATA_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_data_serialized_key, /* Bit 3 */
&hf_rtps_flag_data_present_v2, /* Bit 2 */
&hf_rtps_flag_inline_qos_v2, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const RTPS_DATA_FRAG_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_data_frag_serialized_key, /* Bit 2 */
&hf_rtps_flag_inline_qos_v2, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const RTPS_DATA_BATCH_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_inline_qos_v2, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const RTPS_SAMPLE_INFO_FLAGS16[] = {
&hf_rtps_flag_reserved8000, /* Bit 15 */
&hf_rtps_flag_reserved4000, /* Bit 14 */
&hf_rtps_flag_reserved2000, /* Bit 13 */
&hf_rtps_flag_reserved1000, /* Bit 12 */
&hf_rtps_flag_reserved0800, /* Bit 11 */
&hf_rtps_flag_reserved0400, /* Bit 10 */
&hf_rtps_flag_reserved0200, /* Bit 9 */
&hf_rtps_flag_reserved0100, /* Bit 8 */
&hf_rtps_flag_reserved0080, /* Bit 7 */
&hf_rtps_flag_reserved0040, /* Bit 6 */
&hf_rtps_flag_serialize_key16, /* Bit 5 */
&hf_rtps_flag_invalid_sample, /* Bit 4 */
&hf_rtps_flag_data_present16, /* Bit 3 */
&hf_rtps_flag_offsetsn_present, /* Bit 2 */
&hf_rtps_flag_inline_qos16_v2, /* Bit 1 */
&hf_rtps_flag_timestamp_present, /* Bit 0 */
NULL
};
static int* const INFO_TS_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_timestamp, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const INFO_SRC_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const INFO_REPLY_IP4_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_multicast, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const INFO_DST_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const INFO_REPLY_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_multicast, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const RTI_CRC_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
/* It is a 4 bytes field but with these 8 bits is enough */
static int* const STATUS_INFO_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_unregistered, /* Bit 1 */
&hf_rtps_flag_disposed, /* Bit 0 */
NULL
};
static int* const BUILTIN_ENDPOINT_FLAGS[] = {
&hf_rtps_flag_participant_secure_reader, /* Bit 27 */
&hf_rtps_flag_participant_secure_writer, /* Bit 26 */
&hf_rtps_flag_secure_participant_volatile_message_reader, /* Bit 25 */
&hf_rtps_flag_secure_participant_volatile_message_writer, /* Bit 24 */
&hf_rtps_flag_participant_stateless_message_reader, /* Bit 23 */
&hf_rtps_flag_participant_stateless_message_writer, /* Bit 22 */
&hf_rtps_flag_secure_participant_message_reader, /* Bit 21 */
&hf_rtps_flag_secure_participant_message_writer, /* Bit 20 */
&hf_rtps_flag_secure_subscription_reader, /* Bit 19 */
&hf_rtps_flag_secure_subscription_writer, /* Bit 18 */
&hf_rtps_flag_secure_publication_reader, /* Bit 17 */
&hf_rtps_flag_secure_publication_writer, /* Bit 16 */
&hf_rtps_flag_builtin_endpoint_set_reserved, /* Bit 12-15 */
&hf_rtps_flag_participant_message_datareader, /* Bit 11 */
&hf_rtps_flag_participant_message_datawriter, /* Bit 10 */
&hf_rtps_flag_participant_state_detector, /* Bit 9 */
&hf_rtps_flag_participant_state_announcer, /* Bit 8 */
&hf_rtps_flag_participant_proxy_detector, /* Bit 7 */
&hf_rtps_flag_participant_proxy_announcer, /* Bit 6 */
&hf_rtps_flag_subscription_detector, /* Bit 5 */
&hf_rtps_flag_subscription_announcer, /* Bit 4 */
&hf_rtps_flag_publication_detector, /* Bit 3 */
&hf_rtps_flag_publication_announcer, /* Bit 2 */
&hf_rtps_flag_participant_detector, /* Bit 1 */
&hf_rtps_flag_participant_announcer, /* Bit 0 */
NULL
};
static int* const SECURE_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_multisubmessage, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const SECURE_PREFIX_FLAGS[] = {
&hf_rtps_flag_vendor_specific_content, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_protected_with_psk, /* Bit 2 */
&hf_rtps_flag_additional_authenticated_data, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const SECURE_POSTFIX_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
static int* const ENDPOINT_SECURITY_INFO_FLAGS[] = {
&hf_rtps_flag_endpoint_security_attribute_flag_is_valid, /* Bit 31 */
&hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected, /* Bit 6 */
&hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected, /* Bit 5 */
&hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected, /* Bit 4 */
&hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected, /* Bit 3 */
&hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected, /* Bit 2 */
&hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected, /* Bit 1 */
&hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected, /* Bit 0 */
NULL
};
static int* const PLUGIN_ENDPOINT_SECURITY_INFO_FLAGS[] = {
&hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid, /* Bit 31 */
&hf_rtps_flag_participant_security_attribute_flag_key_psk_protected, /* Bit 4 */
&hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted, /* Bit 2 */
&hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted, /* Bit 1 */
&hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted, /* Bit 0 */
NULL
};
static int* const PARTICIPANT_SECURITY_INFO_FLAGS[] = {
&hf_rtps_flag_participant_security_attribute_flag_is_valid, /* Bit 31 */
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted, /* Bit 6 */
&hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled, /* Bit 3 */
&hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected, /* Bit 2 */
&hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected, /* Bit 1 */
&hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected, /* Bit 0 */
NULL
};
static int* const PLUGIN_PARTICIPANT_SECURITY_INFO_FLAGS[] = {
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid, /* Bit 31 */
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted, /* Bit 5 */
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted, /* Bit 4 */
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted, /* Bit 3 */
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted, /* Bit 2 */
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted, /* Bit 1 */
&hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted, /* Bit 0 */
NULL
};
/* Vendor specific: RTI */
static int* const APP_ACK_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
/* Vendor specific: RTI */
static int* const APP_ACK_CONF_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_reserved02, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
/* Vendor specific: RTI */
static int* const HEARTBEAT_VIRTUAL_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_no_virtual_guids, /* Bit 3 */
&hf_rtps_flag_multiple_writers, /* Bit 2 */
&hf_rtps_flag_multiple_virtual_guids, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
/* Vendor specific: RTI */
static int* const DATA_FRAG_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_hash_key_rti, /* Bit 2 */
&hf_rtps_flag_inline_qos_v2, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
#if 0
/* Vendor specific: RTI */
static int* const NACK_FLAGS[] = {
&hf_rtps_flag_reserved80, /* Bit 7 */
&hf_rtps_flag_reserved40, /* Bit 6 */
&hf_rtps_flag_reserved20, /* Bit 5 */
&hf_rtps_flag_reserved10, /* Bit 4 */
&hf_rtps_flag_reserved08, /* Bit 3 */
&hf_rtps_flag_reserved04, /* Bit 2 */
&hf_rtps_flag_final, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
#endif
static int* const VENDOR_BUILTIN_ENDPOINT_FLAGS[] = {
&hf_rtps_flag_participant_bootstrap_reader, /* Bit 18 */
&hf_rtps_flag_participant_bootstrap_writer, /* Bit 17 */
&hf_rtps_flag_monitoring_logging_reader, /* Bit 16 */
&hf_rtps_flag_monitoring_logging_writer, /* Bit 15 */
&hf_rtps_flag_monitoring_event_reader, /* Bit 14 */
&hf_rtps_flag_monitoring_event_writer, /* Bit 13 */
&hf_rtps_flag_monitoring_periodic_reader, /* Bit 12 */
&hf_rtps_flag_monitoring_periodic_writer, /* Bit 11 */
&hf_rtps_flag_participant_config_secure_reader, /* Bit 10 */
&hf_rtps_flag_participant_config_secure_writer, /* Bit 9 */
&hf_rtps_flag_participant_config_reader, /* Bit 8 */
&hf_rtps_flag_participant_config_writer, /* Bit 7 */
&hf_rtps_flag_cloud_discovery_service_announcer, /* Bit 6 */
&hf_rtps_flag_secure_service_request_reader, /* Bit 5 */
&hf_rtps_flag_secure_service_request_writer, /* Bit 4 */
&hf_rtps_flag_locator_ping_reader, /* Bit 3 */
&hf_rtps_flag_locator_ping_writer, /* Bit 2 */
&hf_rtps_flag_service_request_reader, /* Bit 1 */
&hf_rtps_flag_service_request_writer, /* Bit 0 */
NULL
};
static int* const ENDPOINT_SECURITY_ATTRIBUTES[] = {
&hf_rtps_flag_security_payload_protected, /* Bit 3 */
&hf_rtps_flag_security_submessage_protected, /* Bit 2 */
&hf_rtps_flag_security_discovery_protected, /* Bit 1 */
&hf_rtps_flag_security_access_protected, /* Bit 0 */
NULL
};
static int* const SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS[] = {
&hf_rtps_flag_security_algorithm_compatibility_mode,
&hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm,
&hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm,
&hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm,
NULL
};
static int* const COMPRESSION_ID_MASK_FLAGS[] = {
&hf_rtps_flag_compression_id_lz4,
&hf_rtps_flag_compression_id_bzip2,
&hf_rtps_flag_compression_id_zlib,
NULL
};
static int* const SECURITY_KEY_ESTABLISHMENT_MASK_FLAGS[] = {
&hf_rtps_flag_security_algorithm_compatibility_mode,
&hf_rtps_flag_security_key_establishment_mask_custom_algorithm,
&hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384,
&hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256,
&hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256,
NULL
};
static int* const SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS[] = {
&hf_rtps_flag_security_algorithm_compatibility_mode,
&hf_rtps_flag_security_digital_signature_mask_custom_algorithm,
&hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384,
&hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256,
&hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256,
&hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256,
NULL
};
static int* const HEADER_EXTENSION_MASK_FLAGS[] = {
&hf_rtps_flag_header_extension_parameters, /* Bit 7 */
&hf_rtps_flag_header_extension_checksum1, /* Bit 6 */
&hf_rtps_flag_header_extension_checksum2, /* Bit 5 */
&hf_rtps_flag_header_extension_wextension, /* Bit 4 */
&hf_rtps_flag_header_extension_uextension, /* Bit 3 */
&hf_rtps_flag_header_extension_timestamp, /* Bit 2 */
&hf_rtps_flag_header_extension_message_length, /* Bit 1 */
&hf_rtps_flag_endianness, /* Bit 0 */
NULL
};
/**TCP get DomainId feature constants**/
#define RTPS_UNKNOWN_DOMAIN_ID_VAL -1
#define RTPS_UNKNOWN_DOMAIN_ID_STR "Unknown"
#define RTPS_UNKNOWN_DOMAIN_ID_STR_LEN sizeof(RTPS_UNKNOWN_DOMAIN_ID_STR)
#define RTPS_TCPMAP_DOMAIN_ID_KEY_STR "ParticipantGuid"
#define RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY 0
/* Keys for mapping stuff in pinfo */
#define RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY 1
#define RTPS_DATA_SESSION_FINAL_PROTODATA_KEY 2
#define RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY 3
#define RTPS_ROOT_MESSAGE_KEY 4
#define RTPS_DECRYPTION_INFO_KEY 5
#define RTPS_CHECKSUM_MAX_LEN 16
/* End of TCP get DomainId feature constants */
typedef struct _participant_info {
int domainId;
} participant_info;
typedef struct _datawriter_qos {
uint32_t reliability_kind;
uint32_t durability_kind;
uint32_t ownership_kind;
} datawriter_qos;
#define MAX_TOPIC_AND_TYPE_LENGTH 256
typedef struct _type_mapping {
endpoint_guid guid;
char type_name[MAX_TOPIC_AND_TYPE_LENGTH];
char topic_name[MAX_TOPIC_AND_TYPE_LENGTH];
int fields_visited;
datawriter_qos dw_qos;
uint32_t dcps_publication_frame_number;
uint64_t type_id;
} type_mapping;
/* Links a coherent set with an specific writer. Useful to detect if an empty packet is the end of a coherent set */
typedef struct _coherent_set_entity_info {
endpoint_guid guid;
uint64_t writer_seq_number;
uint64_t coherent_set_seq_number;
uint64_t expected_coherent_set_end_writers_seq_number;
} coherent_set_entity_info;
typedef struct _coherent_set_key {
endpoint_guid guid;
uint64_t coherent_set_seq_number;
} coherent_set_key;
/* Holds information about the coherent set */
typedef struct _coherent_set_info {
coherent_set_key *key;
uint64_t writer_seq_number;
bool is_set;
} coherent_set_info;
/* Links a writer_seq_number with a coherent set. Useful when coherent set ends with parameter empty packet*/
typedef struct _coherent_set_end {
uint64_t writer_seq_number;
coherent_set_key coherent_set_id;
} coherent_set_end;
typedef struct _coherent_set_track {
wmem_map_t *entities_using_map;
wmem_map_t *coherent_set_registry_map;
} coherent_set_track;
static coherent_set_track coherent_set_tracking;
static wmem_map_t * registry;
static reassembly_table rtps_reassembly_table;
static wmem_map_t *discovered_participants_domain_ids;
typedef struct {
type_mapping instance_state_data_response_type_mapping;
} builtin_types_type_mappings;
typedef struct {
dissection_info instance_state_data_response_dissection_info;
dissection_info alive_instances_dissection_info;
dissection_info disposed_instances_dissection_info;
dissection_info unregistered_instances_dissection_info;
dissection_info guid_t_dissection_info;
dissection_info value_dissection_info;
dissection_info instance_transition_data_dissection_info;
dissection_info key_hash_value_dissection_info;
dissection_info array_16_byte_dissection_info;
dissection_info ntptime_t_dissection_info;
dissection_info sequence_number_t_dissection_info;
dissection_info serialized_key_dissection_info;
dissection_info payload_dissection_info;
} builtin_types_dissection_infos;
/* Dissection info of types that are sent as user data but doesn't publish discovery data */
typedef struct {
builtin_types_type_mappings type_mappings;
builtin_types_dissection_infos dissection_infos;
} builtin_types_dissection_data_t;
static builtin_types_dissection_data_t builtin_types_dissection_data;
/*
static type_mapping instance_state_data_response_type_mapping;
static dissection_info instance_state_data_response_dissection_info;
static dissection_info alive_instances_dissection_info;
static dissection_info disposed_instances_dissection_info;
static dissection_info unregistered_instances_dissection_info;
static dissection_info writer_guid_dissection_info;
static dissection_info reader_guid_dissection_info;
static dissection_info value_dissection_info;
*/
static const fragment_items rtps_frag_items = {
&ett_rtps_fragment,
&ett_rtps_fragments,
&hf_rtps_fragments,
&hf_rtps_fragment,
&hf_rtps_fragment_overlap,
&hf_rtps_fragment_overlap_conflict,
&hf_rtps_fragment_multiple_tails,
&hf_rtps_fragment_too_long_fragment,
&hf_rtps_fragment_error,
&hf_rtps_fragment_count,
&hf_rtps_reassembled_in,
&hf_rtps_reassembled_length,
&hf_rtps_reassembled_data,
"RTPS fragments"
};
/******************************************************************************/
/* PRE-SHARED KEY DECODING FUNCTIONALITY */
/******************************************************************************/
#define RTPS_HMAC_256_BUFFER_SIZE_BYTES 32
typedef struct {
uint32_t host_id;
uint32_t app_id;
uint32_t instance_id;
} rtps_guid_prefix_t;
typedef enum {
CRYPTO_ALGORITHM_NONE = CRYPTO_TRANSFORMATION_KIND_NONE,
CRYPTO_ALGORITHM_AES128_GMAC = CRYPTO_TRANSFORMATION_KIND_AES128_GMAC,
CRYPTO_ALGORITHM_AES128_GCM = CRYPTO_TRANSFORMATION_KIND_AES128_GCM,
CRYPTO_ALGORITHM_AES256_GMAC = CRYPTO_TRANSFORMATION_KIND_AES256_GMAC,
CRYPTO_ALGORITHM_AES256_GCM = CRYPTO_TRANSFORMATION_KIND_AES256_GCM
} rtps_encryption_algorithm_t;
#define RTPS_SECURITY_INIT_VECTOR_LEN 12
typedef struct {
rtps_guid_prefix_t guid_prefix;
bool try_psk_decryption;
uint32_t session_id;
uint32_t transformation_key;
rtps_encryption_algorithm_t algorithm;
uint8_t init_vector[RTPS_SECURITY_INIT_VECTOR_LEN];
uint32_t psk_index;
} rtps_current_packet_decryption_info_t;
typedef struct {
uint32_t value;
bool ignore;
} rtps_psk_options_entry_uint32_string_t;
typedef struct {
char *passphrase_secret;
char *passphrase_id_in;
rtps_psk_options_entry_uint32_string_t passphrase_id;
char *host_id_in;
rtps_psk_options_entry_uint32_string_t host_id;
char *app_id_in;
rtps_psk_options_entry_uint32_string_t app_id;
char *instance_id_in;
rtps_psk_options_entry_uint32_string_t instance_id;
} rtps_psk_options_entry_t;
/* PSK table options in RTPS protocol options */
typedef struct {
rtps_psk_options_entry_t *entries;
unsigned size;
} rtps_psk_options_t;
static rtps_psk_options_t rtps_psk_options = { NULL, 0 };
/*
* The table presented to the user has five columns: psk_index_str, psk,
* host_id, app_id, and instance_id. Decoding of the RTPS message using the
* pre-shared key will only take place if there is a match in the host_id,
* app_id, instance_id, and psk_index. These fields do not require a match if
* the user leaves them empty or containing only the '*' wildcard character
* (note that the the psk secret passphrase must always match). Ignoring all the
* previuos fields will result in an attempt to decode the RTPS message
* regardless of the GUID or the PSK index.
*/
UAT_CSTRING_CB_DEF(
rtps_psk_table_entry_field, passphrase_id_in,
rtps_psk_options_entry_t)
UAT_CSTRING_CB_DEF(
rtps_psk_table_entry_field, passphrase_secret,
rtps_psk_options_entry_t)
UAT_CSTRING_CB_DEF(
rtps_psk_table_entry_field, host_id_in,
rtps_psk_options_entry_t)
UAT_CSTRING_CB_DEF(
rtps_psk_table_entry_field, app_id_in,
rtps_psk_options_entry_t)
UAT_CSTRING_CB_DEF(
rtps_psk_table_entry_field, instance_id_in,
rtps_psk_options_entry_t)
static uat_field_t rtps_psk_table_field_array[] = {
UAT_FLD_CSTRING(
rtps_psk_table_entry_field, passphrase_id_in,
"Passphrase Id",
"Integer identifying the secret. "
"Use the '*' character to match any Id."),
UAT_FLD_CSTRING(
rtps_psk_table_entry_field, passphrase_secret,
"Passphrase Secret",
"Seed used to derive the pre-shared secret key"),
UAT_FLD_CSTRING(
rtps_psk_table_entry_field, host_id_in,
"Host ID (Hex)",
"Limit the decoding to RTPS messages coming from the specified GUID."
"Leave the field empty or use the '*' character to match any GUID."),
UAT_FLD_CSTRING(
rtps_psk_table_entry_field, app_id_in,
"App ID (Hex)",
"Limit the decoding to RTPS messages coming from the specified GUID."
"Leave the field empty or use the '*' character to match any GUID."),
UAT_FLD_CSTRING(
rtps_psk_table_entry_field, instance_id_in,
"Instance ID (Hex)",
"Limit the decoding to RTPS messages coming from the specified GUID."
"Leave the field empty or use the '*' character to match any GUID."),
UAT_END_FIELDS
};
static void *rtps_psk_options_copy_entry(
void *destination,
const void *source,
size_t length _U_)
{
const rtps_psk_options_entry_t *src = source;
rtps_psk_options_entry_t *dest = destination;
dest->passphrase_secret = g_strdup(src->passphrase_secret);
dest->passphrase_id = src->passphrase_id;
dest->passphrase_id_in = g_strdup(src->passphrase_id_in);
dest->host_id = src->host_id;
dest->host_id_in = g_strdup(src->host_id_in);
dest->app_id = src->app_id;
dest->app_id_in = g_strdup(src->app_id_in);
dest->instance_id = src->instance_id;
dest->instance_id_in = g_strdup(src->instance_id_in);
return dest;
}
static void rtps_psk_options_free_entry(void *record)
{
rtps_psk_options_entry_t *entry = record;
g_free(entry->passphrase_secret);
entry->passphrase_secret = NULL;
g_free(entry->passphrase_id_in);
entry->passphrase_id_in = NULL;
g_free(entry->host_id_in);
entry->host_id_in = NULL;
g_free(entry->app_id_in);
entry->app_id_in = NULL;
g_free(entry->instance_id_in);
entry->instance_id_in = NULL;
return;
}
static bool rtps_psk_options_entry_uint32_string_validate(
char **error_string,
rtps_psk_options_entry_uint32_string_t *out,
char *in,
const char *field_name)
{
if (in == NULL || strlen(in) == 0 || in[0] == '*') {
out->ignore = true;
} else {
if (!ws_strtou32(in, NULL, &out->value)) {
*error_string = g_strdup_printf(
"The '%s' field must be either the '*' wildcard character, or a "
"valid integer.",
field_name);
return false;
}
}
return true;
}
static bool rtps_psk_options_update_entry(void *record, char **error_string)
{
size_t PASSPHRASE_MAX_LENGTH = 512; /* fixed by specification. */
rtps_psk_options_entry_t *entry = record;
size_t passphrase_length = 0;
/* Validation of the Passphrase Id. */
if (!rtps_psk_options_entry_uint32_string_validate(
error_string,
&entry->passphrase_id,
entry->passphrase_id_in,
"Passphrase Id")) {
return false;
}
/* Validation of the Passphrase Secret. */
if (entry->passphrase_secret == NULL) {
*error_string = g_strdup("The 'Passphrase Secret' field can't be empty");
return false;
}
g_strstrip(entry->passphrase_secret);
passphrase_length = strlen(entry->passphrase_secret);
if (passphrase_length == 0) {
*error_string = g_strdup("The 'Passphrase Secret' field can't be empty");
return false;
}
if (passphrase_length > (PASSPHRASE_MAX_LENGTH - 1)) {
*error_string = g_strdup_printf(
"The 'Passphrase Secret' field has %zu characters length. "
"It cannot be larger than %zu characters.",
passphrase_length,
PASSPHRASE_MAX_LENGTH - 1); /* last byte is for null character. */
return false;
}
/* Validation of the Host Id. */
if (!rtps_psk_options_entry_uint32_string_validate(
error_string,
&entry->host_id,
entry->host_id_in,
"Host Id")) {
return false;
}
/* Validation of the App Id. */
if (!rtps_psk_options_entry_uint32_string_validate(
error_string,
&entry->app_id,
entry->app_id_in,
"App Id")) {
return false;
}
/* Validation of the Instance Id. */
if (!rtps_psk_options_entry_uint32_string_validate(
error_string,
&entry->instance_id,
entry->instance_id_in,
"Instance Id")) {
return false;
}
return true;
}
/* End of PSK table options */
static void rtps_current_packet_decryption_info_reset(
rtps_current_packet_decryption_info_t *info)
{
rtps_guid_prefix_t guid_prefix_zero = {0, 0, 0};
info->guid_prefix = guid_prefix_zero;
info->try_psk_decryption = false;
info->session_id = 0;
info->transformation_key = 0;
info->algorithm = CRYPTO_ALGORITHM_NONE;
memset(info->init_vector, 0, RTPS_SECURITY_INIT_VECTOR_LEN);
info->psk_index = 0;
return;
}
/* ----------------------- PSK Session Key Generation ---------------------- */
/*
* The session key is calculated as follows:
* HMAC-SHA256(
* master_sender_key,
* "SessionKey" | master_sender_salt | session_id)
*
* This is implemented in rtps_psk_generate_session_key.
*
* Each component of the above formula can be obtained as follows:
*
* - master_sender_key and master_sender_salt 32 bytes element computed from:
* HMAC-SHA256(prk_key, <derivation_suffix> | 0x01)
*
* - prk_key: Implemented in rtps_psk_generate_prk_key.
* HMAC-SHA256(public_salt_for_master_key, preshared_secret_key)
*
* - public_salt_for_master_key (256 bits): Implemented in
* rtps_generate_public_salt.
* concatenate(
* <prk_prefix> (64 bits),
* <sender_key_id> (32 bits),
* RTPS header (160 bits))
* - preshared_secret_key: Secret key given by the user in the
* dialog.
*
* Where <derivation_suffix> is equal to "master sender key derivation" for
* the master_sender_key and "master salt derivation" for the
* master_sender_salt.
*
* Where <prk_prefix> is equal to "PSK-SKEY" for the master_sender_key and
* "PSK-SALT" for the master_sender_salt.
*
* Where <sender_key_id> is sent in the transformation_key_id field of the
* crypto header (only when the message is encoded using PSK).
*
* This is implemented in rtps_psk_generate_master_sender.
*
* - session_id: We can read the session_id from the crypto header of the
* SRTPS_PREFIX submessage.
* Note: The session_id is a counter starting at zero and increased by one
* every time we have encoded a specific number of messages.
*/
static bool rtps_psk_generate_master_sender(
uint8_t *output,
bool is_salt,
const char* preshared_secret_key,
uint32_t sender_key_id,
tvbuff_t *rtps_header_tvb,
int rtps_header_tvb_offset);
static gcry_error_t rtps_util_generate_hmac_sha256(
void *output,
const void *key,
const void *data,
size_t datalen);
/**
* @brief Generate the session key that will be used to decrypt PSK-encoded RTPS
* messages. It requires the pre-shared secret key known and given by the user,
* the RTPS header, and two fields (sender key id and session id) sent on the
* wire.
*/
static bool rtps_psk_generate_session_key(
packet_info *pinfo,
const char *preshared_secret_key,
uint32_t sender_key_id,
uint32_t session_id,
uint8_t *buffer)
{
const char *sessionKeyString = "SessionKey";
rtps_tvb_field* rtps_root = NULL;
uint8_t sender_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
/*
* Must be big enough to fit the sessionKeyString, the master sender key and
* the session id.
*/
uint8_t input[50];
size_t offset = 0;
rtps_root = (rtps_tvb_field*) p_get_proto_data(
pinfo->pool,
pinfo,
proto_rtps,
RTPS_ROOT_MESSAGE_KEY);
if (rtps_root == NULL || buffer == NULL) {
return false;
}
memcpy(input, sessionKeyString, strlen(sessionKeyString));
offset += strlen(sessionKeyString);
if (!rtps_psk_generate_master_sender(
input + offset,
true, /* is_salt. */
preshared_secret_key,
sender_key_id,
rtps_root->tvb,
rtps_root->tvb_offset)) {
return false;
}
offset += RTPS_HMAC_256_BUFFER_SIZE_BYTES;
memcpy(
input + offset,
&session_id,
sizeof(uint32_t));
offset += sizeof(uint32_t);
if (!rtps_psk_generate_master_sender(
sender_key,
false, /* is_salt. */
preshared_secret_key,
sender_key_id,
rtps_root->tvb,
rtps_root->tvb_offset)) {
return false;
}
return rtps_util_generate_hmac_sha256(
buffer,
sender_key,
input,
offset) == GPG_ERR_NO_ERROR;
}
static bool rtps_psk_generate_prk_key(
uint8_t *output,
const char *prefix,
const char *preshared_secret_key,
uint32_t sender_key_id,
tvbuff_t *rtps_header_tvb,
int rtps_header_tvb_offset);
/**
* @brief Generate the master sender key or master sender salt (depending on the
* is_salt parameter) that will be used to derive the session key.
*/
static bool rtps_psk_generate_master_sender(
uint8_t *output,
bool is_salt,
const char* preshared_secret_key,
uint32_t sender_key_id,
tvbuff_t *rtps_header_tvb,
int rtps_header_tvb_offset)
{
const char *prk_prefix = is_salt ? "PSK-SALT" : "PSK-SKEY";
const char *suffix = is_salt ?
"master salt derivation" :
"master sender key derivation";
uint8_t prk_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
/* Must be big enough to fit the largest suffix and the 0x1 constant byte. */
uint8_t input[50];
if (!rtps_psk_generate_prk_key(
prk_key,
prk_prefix,
preshared_secret_key,
sender_key_id,
rtps_header_tvb,
rtps_header_tvb_offset)) {
return false;
}
memcpy(input, suffix, strlen(suffix));
input[strlen(suffix)] = 0x1; /* Fixed value. */
return rtps_util_generate_hmac_sha256(
output,
prk_key,
input,
strlen(suffix) + 1) == GPG_ERR_NO_ERROR;
}
static void rtps_generate_public_salt(
uint8_t *output,
const char *prefix,
uint32_t sender_key_id,
tvbuff_t *rtps_header_tvb,
int rtps_header_tvb_offset);
/**
* @brief Compute the Pseudo-Random Key; an intermediate step to get the
* master sender. This function computes:
* HMAC-SHA256(
* concatenate(prefix, sender_key_id. rtps_header),
* preshared_secret_key)
*/
static bool rtps_psk_generate_prk_key(
uint8_t *output,
const char *prefix,
const char *preshared_secret_key,
uint32_t sender_key_id,
tvbuff_t *rtps_header_tvb,
int rtps_header_tvb_offset)
{
gcry_error_t error = GPG_ERR_NO_ERROR;
uint8_t public_salt[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
rtps_generate_public_salt(
public_salt,
prefix,
sender_key_id,
rtps_header_tvb,
rtps_header_tvb_offset);
error = rtps_util_generate_hmac_sha256(
output,
public_salt,
preshared_secret_key,
strlen(preshared_secret_key));
return error == GPG_ERR_NO_ERROR;
}
/**
* @brief Generates the public salt that can be used to derive the prk_key
* and prk_salt Pseudo-Random Keys.
*
* It does the concatenation of:
* concatenate(
* <8-byte prefix>,
* <4-byte sender's key id>,
* <20-byte RTPS header>)
* So output must be a 32-byte buffer (i.e. RTPS_HMAC_256_BUFFER_SIZE_BYTES).
*/
static void rtps_generate_public_salt(
uint8_t *output,
const char *prefix,
uint32_t sender_key_id,
tvbuff_t *rtps_header_tvb,
int rtps_header_tvb_offset)
{
size_t offset = 0;
/* Copy the 8-byte prefix. */
memcpy(output, prefix, strlen(prefix));
offset += strlen(prefix);
/* Copy the 4-byte sender's key id. */
memcpy(output + offset, &sender_key_id, sizeof(uint32_t));
offset += sizeof(uint32_t);
/* Copy the 20-byte RTPS header. */
tvb_memcpy(
rtps_header_tvb,
output + offset,
rtps_header_tvb_offset,
20); /* RTPS HEADER SIZE. */
return;
}
/**
* @brief Compute the HMAC-SHA256 of the data using the key.
* This function is required to derive the PSK session key.
*/
static gcry_error_t rtps_util_generate_hmac_sha256(
void *output,
const void *key,
const void *data,
size_t datalen)
{
gcry_mac_hd_t hmac;
gcry_error_t error = GPG_ERR_NO_ERROR;
size_t OUTPUT_SIZE = RTPS_HMAC_256_BUFFER_SIZE_BYTES;
error = gcry_mac_open(&hmac, GCRY_MAC_HMAC_SHA256, 0, NULL);
if (error != GPG_ERR_NO_ERROR) {
gcry_mac_close(hmac);
return error;
}
error = gcry_mac_setkey(hmac, key, RTPS_HMAC_256_BUFFER_SIZE_BYTES);
if (error != GPG_ERR_NO_ERROR) {
gcry_mac_close(hmac);
return error;
}
error = gcry_mac_write(hmac, data, datalen);
if (error != GPG_ERR_NO_ERROR) {
gcry_mac_close(hmac);
return error;
}
error = gcry_mac_read(hmac, output, &OUTPUT_SIZE);
if (error != GPG_ERR_NO_ERROR) {
gcry_mac_close(hmac);
fprintf (stderr, "Failure: %s/%s\n",
gcry_strsource (error),
gcry_strerror (error));
return error;
}
gcry_mac_close(hmac);
return error;
}
/* ------------------------------------------------------------------------- */
/**
* @brief Translate between the RTPS and gcrypt types.
*/
static int rtps_encryption_algorithm_to_gcry_enum(
rtps_encryption_algorithm_t rtps_enum_in,
int *gcry_cipher_mode_out)
{
if (gcry_cipher_mode_out == NULL) {
return -1;
}
switch(rtps_enum_in) {
case CRYPTO_ALGORITHM_AES128_GMAC:
*gcry_cipher_mode_out = GCRY_CIPHER_MODE_CCM;
return GCRY_CIPHER_AES128;
case CRYPTO_ALGORITHM_AES128_GCM:
*gcry_cipher_mode_out = GCRY_CIPHER_MODE_GCM;
return GCRY_CIPHER_AES128;
case CRYPTO_ALGORITHM_AES256_GMAC:
*gcry_cipher_mode_out = GCRY_CIPHER_MODE_CCM;
return GCRY_CIPHER_AES256;
case CRYPTO_ALGORITHM_AES256_GCM:
*gcry_cipher_mode_out = GCRY_CIPHER_MODE_GCM;
return GCRY_CIPHER_AES256;
case CRYPTO_ALGORITHM_NONE:
default:
*gcry_cipher_mode_out = GCRY_CIPHER_MODE_NONE;
return GCRY_CIPHER_NONE;
}
}
static gcry_error_t rtps_util_decrypt_data(
uint8_t *encrypted_data,
size_t encrypted_data_size,
uint8_t *key,
uint8_t *init_vector,
uint8_t *tag,
rtps_encryption_algorithm_t algorithm)
{
gcry_error_t err = GPG_ERR_NO_ERROR;
gcry_cipher_hd_t cipher_hd;
int encription_algo;
int encription_mode = 0;
encription_algo = rtps_encryption_algorithm_to_gcry_enum(
algorithm,
&encription_mode);
err = gcry_cipher_open(
&cipher_hd,
encription_algo,
encription_mode,
0);
if (err != GPG_ERR_NO_ERROR) {
ws_warning(
"GCRY: cipher open %s/%s\n",
gcry_strsource(err),
gcry_strerror(err));
return err;
}
err = gcry_cipher_setkey(cipher_hd, key, RTPS_HMAC_256_BUFFER_SIZE_BYTES);
if (err != GPG_ERR_NO_ERROR) {
ws_warning(
"GCRY: setkey %s/%s\n",
gcry_strsource(err),
gcry_strerror(err));
gcry_cipher_close(cipher_hd);
return err;
}
if (init_vector != NULL) {
err = gcry_cipher_setiv(
cipher_hd,
init_vector,
RTPS_SECURITY_INIT_VECTOR_LEN);
if (err != GPG_ERR_NO_ERROR) {
ws_warning(
"GCRY: setiv %s/%s\n",
gcry_strsource(err),
gcry_strerror(err));
gcry_cipher_close(cipher_hd);
return err;
}
}
err = gcry_cipher_decrypt(
cipher_hd,
encrypted_data,
encrypted_data_size,
NULL,
0);
if (err != GPG_ERR_NO_ERROR) {
ws_warning(
"GCRY: encrypt %s/%s\n",
gcry_strsource(err),
gcry_strerror(err));
gcry_cipher_close(cipher_hd);
return err;
}
if (tag != NULL) {
err = gcry_cipher_checktag(cipher_hd, tag, SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH);
if (err != GPG_ERR_NO_ERROR) {
ws_warning(
"GCRY: Decryption (checktag) failed: %s/%s\n",
gcry_strsource(err),
gcry_strerror(err));
}
}
gcry_cipher_close(cipher_hd);
return err;
}
/**
* @brief Generates the session key and uses it to decrypt the secure payload.
* The decripted payload is stored in an allocated buffer using the allocator
* passed as parameter.
*/
static uint8_t *rtps_decrypt_secure_payload(
tvbuff_t *tvb,
packet_info *pinfo,
int offset,
size_t secure_payload_len,
uint8_t *preshared_secret_key,
uint8_t *init_vector,
rtps_encryption_algorithm_t algorithm,
uint32_t transformation_key,
uint32_t session_id,
uint8_t *tag,
uint8_t *session_key_output,
gcry_error_t* error,
wmem_allocator_t *allocator)
{
uint8_t *secure_body_ptr;
if (!rtps_psk_generate_session_key(
pinfo,
preshared_secret_key,
transformation_key,
session_id,
session_key_output)) {
return NULL;
}
secure_body_ptr = wmem_alloc0(allocator, secure_payload_len);
if (secure_body_ptr == NULL) {
return NULL;
}
tvb_memcpy(tvb, secure_body_ptr, offset, secure_payload_len);
*error = rtps_util_decrypt_data(
secure_body_ptr,
secure_payload_len,
session_key_output,
init_vector,
tag,
algorithm);
/*
* Free the allocated memory if the decryption goes wrong or if the content is
* not healthy.
*/
if (*error != GPG_ERR_NO_ERROR) {
wmem_free(allocator, secure_body_ptr);
secure_body_ptr = NULL;
}
return secure_body_ptr;
}
/******************************************************************************/
static const true_false_string tfs_little_big_endianness = { "Little-Endian", "Big-Endian" };
/* #19359 - ensure strings we copy aren't truncated halfway through a Unicode codepoint */
static void rtps_strlcpy(char *dest, const char *src, size_t dest_size)
{
/* Reserving the last character in case ws_utf8_truncate overwrites it */
(void) g_strlcpy(dest, src, dest_size);
ws_utf8_truncate(dest, strlen(dest));
}
static int check_offset_addition(int offset, uint32_t value, proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb)
{
int new_offset = offset + (int)value;
if (new_offset < offset) {
proto_tree_add_expert_format(tree, pinfo, &ei_rtps_value_too_large, tvb, 0, 0, "Offset value too large: %u", value);
THROW(ReportedBoundsError);
}
return new_offset;
}
static void rtps_util_dissect_parameter_header(tvbuff_t * tvb, int * offset,
const unsigned encoding, uint32_t * member_id, uint32_t * member_length) {
*member_id = tvb_get_uint16(tvb, *offset, encoding);
*offset += 2;
*member_length = tvb_get_uint16(tvb, *offset, encoding);
*offset += 2;
if ((*member_id & PID_EXTENDED) == PID_EXTENDED) {
/* get extended member id and length */
*member_id = tvb_get_uint32(tvb, *offset, encoding);
*offset += 4;
*member_length = tvb_get_uint32(tvb, *offset, encoding);
*offset += 4;
}
}
static int dissect_crypto_algorithm_requirements(proto_tree *tree , tvbuff_t* tvb,
int offset, int encoding, int* const *flags) {
proto_tree_add_bitmask(
tree,
tvb,
offset,
hf_rtps_param_crypto_algorithm_requirements_trust_chain,
ett_rtps_flags, flags,
encoding);
offset += 4;
proto_tree_add_bitmask(
tree,
tvb,
offset,
hf_rtps_param_crypto_algorithm_requirements_message_auth,
ett_rtps_flags, flags,
encoding);
offset += 4;
return offset;
}
static int dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version,
dissection_info * info, bool * is_end, bool show);
static int get_native_type_cdr_length(uint64_t member_kind) {
unsigned length = 0;
switch (member_kind) {
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: {
length = 1;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE:
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: {
length = 1;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: {
length = 2;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: {
length = 2;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE:
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: {
length = 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: {
length = 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: {
length = 8;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: {
length = 8;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: {
length = 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: {
length = 8;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: {
length = 16;
break;
}
default: {
/* XXX We should probably add expert info, but make sure our offset advances for now. */
length = 1;
break;
}
}
return length;
}
static int get_native_type_cdr_alignment(uint64_t member_kind, int encapsulation_version) {
unsigned align = 0;
switch (member_kind) {
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: {
align = 1;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE:
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: {
align = 1;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: {
align = 2;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: {
align = 2;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE:
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: {
align = 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: {
align = 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: {
align = (encapsulation_version == 1) ? 8 : 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: {
align = (encapsulation_version == 1) ? 8 : 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: {
align = 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: {
align = (encapsulation_version == 1) ? 8 : 4;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: {
align = (encapsulation_version == 1) ? 8 : 4;
break;
}
default: {
align = 1;
break;
}
}
return align;
}
static int get_encapsulation_endianness(int encapsulation_id)
{
return (encapsulation_id == ENCAPSULATION_CDR_LE ||
encapsulation_id == ENCAPSULATION_PL_CDR_LE ||
encapsulation_id == ENCAPSULATION_CDR2_LE ||
encapsulation_id == ENCAPSULATION_D_CDR2_LE ||
encapsulation_id == ENCAPSULATION_PL_CDR2_LE) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN;
}
static int get_encapsulation_version(int encapsulation_id)
{
return (encapsulation_id == ENCAPSULATION_CDR2_LE ||
encapsulation_id == ENCAPSULATION_D_CDR2_LE ||
encapsulation_id == ENCAPSULATION_PL_CDR2_LE) ? 2 : 1;
}
static dissection_info* lookup_dissection_info_in_custom_and_builtin_types(uint64_t type_id) {
dissection_info* info = NULL;
if (dissection_infos != NULL) {
info = (dissection_info*)wmem_map_lookup(dissection_infos, &(type_id));
if (info == NULL && builtin_dissection_infos != NULL) {
info = (dissection_info*)wmem_map_lookup(builtin_dissection_infos, &(type_id));
}
}
return info;
}
/* this is a recursive function. _info may or may not be NULL depending on the use iteration */
// NOLINTNEXTLINE(misc-no-recursion)
static int dissect_user_defined(proto_tree *tree, tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version,
dissection_info * _info, uint64_t type_id, char * name,
RTICdrTypeObjectExtensibility extensibility, int offset_zero,
uint16_t flags, uint32_t element_member_id, bool show) {
uint64_t member_kind;
dissection_info * info = NULL;
uint32_t member_id;
uint32_t member_length = 0;
if (_info) { /* first call enters here */
info = _info;
member_kind = info->member_kind;
} else {
info = lookup_dissection_info_in_custom_and_builtin_types(type_id);
if (info != NULL) {
member_kind = info->member_kind;
} else {
member_kind = type_id;
}
}
if ((flags & MEMBER_OPTIONAL) != 0) {
int offset_before = offset;
/* Parameter header is at minimum 4 bytes */
ALIGN_ZERO(
offset,
get_native_type_cdr_alignment(RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE, encoding_version),
offset_zero);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
if (info
&& (flags & MEMBER_OPTIONAL) == MEMBER_OPTIONAL
&& element_member_id != 0
&& member_id != element_member_id) {
offset = offset_before;
return offset;
}
if (member_length == 0) {
return offset;
}
}
if (extensibility == EXTENSIBILITY_MUTABLE) {
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_zero = offset;
if ((member_id & PID_LIST_END) == PID_LIST_END){
/* If this is the end of the list, don't add a tree.
* If we add more logic here in the future, take into account that
* offset is incremented by 4 */
offset += 0;
return offset;
}
if (member_length == 0){
return offset;
}
}
//proto_item_append_text(tree, "(Before Switch 0x%016" PRIx64 ")", type_id);
increment_dissection_depth(pinfo);
switch (member_kind) {
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
int16_t value = tvb_get_int8(tvb, offset);
proto_tree_add_boolean_format(tree, hf_rtps_dissection_boolean, tvb, offset, length, value,
"%s: %d", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_CHAR_8_TYPE:
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
int16_t value = tvb_get_int8(tvb, offset);
proto_tree_add_uint_format(tree, hf_rtps_dissection_byte, tvb, offset, length, value,
"%s: %d", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_16_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
int16_t value = tvb_get_int16(tvb, offset, encoding);
proto_tree_add_int_format(tree, hf_rtps_dissection_int16, tvb, offset, length, value,
"%s: %d", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_16_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
uint16_t value = tvb_get_uint16(tvb, offset, encoding);
proto_tree_add_uint_format(tree, hf_rtps_dissection_uint16, tvb, offset, length, value,
"%s: %u", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE:
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
int value = tvb_get_int32(tvb, offset, encoding);
proto_tree_add_int_format(tree, hf_rtps_dissection_int32, tvb, offset, length, value,
"%s: %d", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
unsigned value = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_uint_format(tree, hf_rtps_dissection_uint32, tvb, offset, length, value,
"%s: %u", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_64_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
int64_t value = tvb_get_int64(tvb, offset, encoding);
proto_tree_add_int64_format(tree, hf_rtps_dissection_int64, tvb, offset, length, value,
"%s: %"PRId64, name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_64_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
uint64_t value = tvb_get_uint64(tvb, offset, encoding);
proto_tree_add_uint64_format(tree, hf_rtps_dissection_uint64, tvb, offset, length, value,
"%s: %"PRIu64, name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_32_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
float value = tvb_get_ieee_float(tvb, offset, encoding);
proto_tree_add_float_format(tree, hf_rtps_dissection_float, tvb, offset, length, value,
"%s: %.6f", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_64_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
double value = tvb_get_ieee_double(tvb, offset, encoding);
proto_tree_add_double_format(tree, hf_rtps_dissection_double, tvb, offset, length, value,
"%s: %.6f", name, value);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_FLOAT_128_TYPE: {
int length = get_native_type_cdr_length(member_kind);
if (show) {
ALIGN_ZERO(offset, get_native_type_cdr_alignment(member_kind, encoding_version), offset_zero);
proto_tree_add_item(tree, hf_rtps_dissection_int128, tvb, offset, length, encoding);
}
offset += length;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE: {
unsigned i;
unsigned num_elements;
proto_tree * aux_tree = NULL;
int base_offset = offset;
bool show_current_element = true;
int array_kind_length = 0;
unsigned bound = 0;
int first_skipped_element_offset = 0;
if (info != NULL) {
bound = (unsigned)info->bound;
/* In case this array is not shown and is a native type. We get the sze length for calculating
* the whole array length */
array_kind_length = get_native_type_cdr_length(info->base_type_id);
}
/* Do not add any information to the tree if it is not shown */
if (show) {
aux_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_dissection_tree,
NULL, name);
} else if (array_kind_length != -1) {
/* Total length of the array. Nothing else to do here. */
offset += bound * array_kind_length;
break;
}
/* Get the maximum number of elements to be shown */
num_elements = (enable_max_array_data_type_elements)
? MIN(bound, rtps_max_array_data_type_elements)
: bound;
for (i = 0; i < bound; i++) {
char temp_buff[MAX_MEMBER_NAME];
if (show && i < num_elements) {
/* No need to copy if it will not be shown */
snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i);
show_current_element = true;
} else {
if (show_current_element) {
show_current_element = false;
/* Updated only once */
first_skipped_element_offset = offset;
}
/* If this array has elements that won't be shown and is an array of native type
* we can calculate the total offset and break the loop */
if (array_kind_length != -1) {
offset += (bound - i) * array_kind_length;
break;
}
}
offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
info->base_type_id, temp_buff, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show_current_element);
}
/* If reached the limit and there are remaining elements we need to show the message and
* assign the length of the ramining elements to this */
if (enable_max_array_data_type_elements && show && !show_current_element) {
proto_tree_add_subtree_format(
aux_tree,
tvb,
/* Start at the first item not shown */
first_skipped_element_offset,
offset - first_skipped_element_offset,
ett_rtps_info_remaining_items,
NULL,
DISSECTION_INFO_REMAINING_ELEMENTS_STR_d,
bound - num_elements);
}
proto_item_set_len(aux_tree, offset - base_offset);
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE: {
unsigned i;
unsigned num_elements;
proto_tree * aux_tree = NULL;
int base_offset = offset;
bool show_current_element = true;
int length = 4;
int sequence_kind_length = 0;
int first_skipped_element_offset = 0;
ALIGN_ZERO(offset, length, offset_zero);
unsigned seq_size = tvb_get_uint32(tvb, offset, encoding);
/* In case this sequence is not shown and is a native type. We get the sze length for calculating
* the whole seuqnece length */
if (info != NULL) {
sequence_kind_length = get_native_type_cdr_length(info->base_type_id);
}
if (show) {
aux_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1, ett_rtps_dissection_tree,
NULL, "%s (%u elements)", name, seq_size);
/* If it is a native type we can calculate the sequence length and finish. */
} else if (sequence_kind_length != -1) {
/* Number of elements integer size + number of elements * size of the native type */
offset += 4 + seq_size * sequence_kind_length;
break;
}
offset += 4;
num_elements = (enable_max_array_data_type_elements)
? MIN(seq_size, rtps_max_array_data_type_elements)
: seq_size;
for (i = 0; i < seq_size; i++) {
char temp_buff[MAX_MEMBER_NAME];
if (show && i < num_elements) {
/* No need to copy if it will not be shown */
snprintf(temp_buff, MAX_MEMBER_NAME, "%s[%u]", name, i);
show_current_element = true;
} else {
if (show_current_element) {
show_current_element = false;
/* Updated only once */
first_skipped_element_offset = offset;
}
/* If this array has elements that won't be shown and is an array of native type
* we can calculate the total offset and break the loop */
if (sequence_kind_length != -1) {
offset += (seq_size - i) * sequence_kind_length;
break;
}
}
if (info != NULL && info->base_type_id > 0)
offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
info->base_type_id, temp_buff, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show_current_element);
}
/* If reached the limit and there are remaining elements we need to show the message and
* assign the length of the ramining elements to this */
if (enable_max_array_data_type_elements && show && !show_current_element) {
proto_tree_add_subtree_format(
aux_tree,
tvb,
/* Start at the first item not shown */
first_skipped_element_offset,
offset - first_skipped_element_offset,
ett_rtps_info_remaining_items,
NULL,
DISSECTION_INFO_REMAINING_ELEMENTS_STR_d,
seq_size - num_elements);
}
proto_item_set_len(aux_tree, offset - base_offset);
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE: {
char * string_value = NULL;
int length = 4;
ALIGN_ZERO(offset, length, offset_zero);
unsigned string_size = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
//proto_item_append_text(tree, "(String length: %u)", string_size);
if (show) {
string_value = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, string_size, ENC_ASCII);
proto_tree_add_string_format(tree, hf_rtps_dissection_string, tvb, offset, string_size,
string_value, "%s: %s", name, string_value);
}
offset += string_size;
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE: {
uint64_t base_type_id = 0;
if (info != NULL) {
base_type_id = info->base_type_id;
}
offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
base_type_id, name, EXTENSIBILITY_INVALID, offset_zero, 0, 0, show);
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE: {
uint64_t key = type_id - 1;
union_member_mapping * result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key));
if (result != NULL) {
int value = tvb_get_int32(tvb, offset, encoding);
offset += 4;
key = type_id + value;
result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key));
if (result != NULL) {
if (show) {
proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")",
value, result->member_type_id);
}
offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
result->member_type_id, result->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show);
} else {
/* the hashmap uses the type_id to index the objects. subtracting -2 here to lookup the discriminator
related to the type_id that identifies an union */
key = type_id + HASHMAP_DISCRIMINATOR_CONSTANT;
result = (union_member_mapping *)wmem_map_lookup(union_member_mappings, &(key));
if (result != NULL) {
if (show) {
proto_item_append_text(tree, " (discriminator = %d, type_id = 0x%016" PRIx64 ")",
value, result->member_type_id);
}
offset = dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
result->member_type_id, result->member_name, EXTENSIBILITY_INVALID, offset, 0, 0, show);
}
}
} else {
if (show) {
proto_item_append_text(tree, "(NULL 0x%016" PRIx64 ")", type_id);
}
}
break;
}
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE: {
unsigned i;
proto_tree * aux_tree = NULL;
unsigned shown_elements = 0;
bool show_current_element = true;
unsigned num_elements = 0;
int first_skipped_element_offset = 0;
if (info != NULL) {
if (show) {
aux_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_dissection_tree,
NULL, name);
}
if (info->extensibility == EXTENSIBILITY_MUTABLE) {
bool is_end = false;
/* Don't know beforehand the number of elements. Need to count them */
while (!is_end) {
if (!(show && shown_elements < rtps_max_data_type_elements) && show_current_element) {
show_current_element = false;
/* Updated only once */
first_skipped_element_offset = offset;
}
offset = dissect_mutable_member(aux_tree, tvb, pinfo, offset, encoding, encoding_version, info, &is_end, show_current_element);
++num_elements;
if (show_current_element) {
++shown_elements;
}
}
}
else {
if (info->base_type_id > 0) {
if (show) {
proto_item_append_text(tree, "(BaseId: 0x%016" PRIx64 ")", info->base_type_id);
}
offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
info->base_type_id, info->member_name, EXTENSIBILITY_INVALID,
offset, 0, 0, show);
}
/* Get the maximum number of elements to be shown depending if enable_max_data_type_elements is enabled */
shown_elements = (enable_max_data_type_elements)
? MIN(info->num_elements, rtps_max_data_type_elements)
: info->num_elements;
for (i = 0; i < info->num_elements; i++) {
if (info->elements[i].type_id > 0) {
/* A member is shown if the parent cluster is shown and the position is in the
* range of maximum number of elements shown */
if (!(show && i < shown_elements) && show_current_element) {
show_current_element = false;
/* Updated only once */
first_skipped_element_offset = offset;
}
/* If a member is not shown all it children will inherit the "show_current_element" value */
offset = dissect_user_defined(aux_tree, tvb, pinfo, offset, encoding, encoding_version, NULL,
info->elements[i].type_id, info->elements[i].member_name, info->extensibility,
offset_zero, info->elements[i].flags, info->elements[i].member_id, show_current_element);
}
}
num_elements = info->num_elements;
}
/* If reached the limit and there are remaining elements we need to show the message and
* assign the length of the ramining elements to this */
if (enable_max_array_data_type_elements && show && !show_current_element) {
proto_tree_add_subtree_format(
aux_tree,
tvb,
first_skipped_element_offset,
offset - first_skipped_element_offset,
ett_rtps_info_remaining_items,
NULL,
DISSECTION_INFO_REMAINING_ELEMENTS_STR_d,
num_elements - shown_elements);
}
}
break;
}
default:{
/* undefined behavior. this should not happen. the following line helps to debug if it happened */
if (show) {
proto_item_append_text(tree, "(unknown 0x%016" PRIx64 ")", member_kind);
}
break;
}
}
decrement_dissection_depth(pinfo);
if (extensibility == EXTENSIBILITY_MUTABLE) {
offset_zero += member_length;
return offset_zero;
} else {
return offset;
}
}
// NOLINTNEXTLINE(misc-no-recursion)
static int dissect_mutable_member(proto_tree *tree , tvbuff_t * tvb, packet_info *pinfo, int offset, unsigned encoding, unsigned encoding_version,
dissection_info * info, bool * is_end, bool show) {
proto_tree * member;
uint32_t member_id, member_length;
mutable_member_mapping * mapping;
int64_t key;
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
if ((member_id & PID_LIST_END) == PID_LIST_END){
/* If this is the end of the list, don't add a tree.
* If we add more logic here in the future, take into account that
* offset is incremented by 4 */
offset += 0;
*is_end = true;
return offset;
}
if (member_length == 0){
return offset;
}
member = proto_tree_add_subtree_format(tree, tvb, offset, member_length, ett_rtps_dissection_tree,
NULL, "ID: %d, Length: %d", member_id, member_length);
{
if (info->base_type_id > 0) {
key = (info->base_type_id + info->base_type_id * member_id);
mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key));
if (mapping) { /* the library knows how to dissect this */
proto_item_append_text(member, "(base found 0x%016" PRIx64 ")", key);
dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, mapping->member_type_id,
mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show);
proto_item_set_hidden(member);
return check_offset_addition(offset, member_length, tree, NULL, tvb);
} else
proto_item_append_text(member, "(base not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")",
key, info->base_type_id);
}
}
key = (info->type_id + info->type_id * member_id);
mapping = (mutable_member_mapping *) wmem_map_lookup(mutable_member_mappings, &(key));
if (mapping) { /* the library knows how to dissect this */
proto_item_append_text(member, "(found 0x%016" PRIx64 ")", key);
dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, NULL, mapping->member_type_id,
mapping->member_name, EXTENSIBILITY_INVALID, offset, 0, mapping->member_id, show);
} else
proto_item_append_text(member, "(not found 0x%016" PRIx64 " from 0x%016" PRIx64 ")",
key, info->type_id);
proto_item_set_hidden(member);
return check_offset_addition(offset, member_length, tree, NULL, tvb);
}
/* *********************************************************************** */
/* Appends extra formatting for those submessages that have a status info
*/
static void generate_status_info(packet_info *pinfo,
uint32_t writer_id,
uint32_t status_info) {
/* Defines the extra information associated to the writer involved in
* this communication
*
* Format: [?Ptwrpm]\(u?d?\)
*
* First letter table:
*
* writerEntityId value | Letter
* ----------------------------------------------------------+--------
* ENTITYID_UNKNOWN | ?
* ENTITYID_PARTICIPANT | P
* ENTITYID_SEDP_BUILTIN_TOPIC_WRITER | t
* ENTITYID_SEDP_BUILTIN_PUBLICATIONS_WRITER | w
* ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_WRITER | r
* ENTITYID_SPDP_BUILTIN_PARTICIPANT_WRITER | p
* ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER | m
* ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER | s
* ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER | V
* ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER | M
* ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER | W
* ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER | R
* ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER | Pc
* ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER | Pc
* ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER | Pb
* ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER | Pb
* ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER | sPc
* ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER | sPc
* The letter is followed by:
* status_info &1 | status_info & 2 | Text
* ---------------+-----------------------+--------------
* status_info not defined in inlineQos | [?]
* 0 | 0 | [__]
* 0 | 1 | [u_]
* 1 | 0 | [_d]
* 1 | 1 | [ud]
*/
/* 0123456 */
char * writerId = NULL;
char * disposeFlag = NULL;
char * unregisterFlag = NULL;
wmem_strbuf_t *buffer = wmem_strbuf_create(wmem_packet_scope());
submessage_col_info* current_submessage_col_info = NULL;
current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
switch(writer_id) {
case ENTITYID_PARTICIPANT:
case ENTITYID_SPDP_RELIABLE_BUILTIN_PARTICIPANT_SECURE_WRITER:
writerId = "P";
break;
case ENTITYID_BUILTIN_TOPIC_WRITER:
writerId = "t";
break;
case ENTITYID_BUILTIN_PUBLICATIONS_WRITER:
writerId = "w";
break;
case ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER:
writerId = "r";
break;
case ENTITYID_BUILTIN_PARTICIPANT_WRITER:
writerId = "p";
break;
case ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER:
writerId = "m";
break;
case ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER:
writerId = "s";
break;
case ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER:
writerId = "V";
break;
case ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_SECURE_WRITER:
writerId = "M";
break;
case ENTITYID_SEDP_BUILTIN_PUBLICATIONS_SECURE_WRITER:
writerId = "W";
break;
case ENTITYID_SEDP_BUILTIN_SUBSCRIPTIONS_SECURE_WRITER:
writerId = "R";
break;
case ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER:
case ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_READER:
writerId = "Pb";
break;
case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER:
case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_READER:
writerId = "Pc";
break;
case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER:
case ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER:
writerId = "sPc";
break;
case ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER:
case ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER: {
/* This is added to proto_rtps in rtps_util_add_rti_service_request* */
uint32_t* service_id = (uint32_t*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY);
if (service_id != NULL && *service_id == RTI_SERVICE_REQUEST_ID_TOPIC_QUERY) {
writerId = "tq";
}
break;
}
default:
/* Unknown writer ID, don't format anything */
break;
}
switch(status_info) {
case 0: unregisterFlag = "_"; disposeFlag = "_"; break;
case 1: unregisterFlag = "_"; disposeFlag = "D"; break;
case 2: unregisterFlag = "U"; disposeFlag = "_"; break;
case 3: unregisterFlag = "U"; disposeFlag = "D"; break;
default: /* Unknown status info, omit it */
break;
}
if (writerId != NULL || unregisterFlag != NULL ||
disposeFlag != NULL ) {
wmem_strbuf_append(buffer, "(");
if (writerId != NULL) {
wmem_strbuf_append(buffer, writerId);
}
if (unregisterFlag != NULL || disposeFlag != NULL) {
wmem_strbuf_append(buffer, "[");
wmem_strbuf_append(buffer, unregisterFlag);
wmem_strbuf_append(buffer, disposeFlag);
wmem_strbuf_append(buffer, "]");
}
wmem_strbuf_append(buffer, ")");
current_submessage_col_info->status_info = wmem_strbuf_get_str(buffer);
}
}
/* *********************************************************************** */
/*
* Coherent set starts if seqNumber == writerSeqNumber
*
* Coherent sets end in three different ways:
* - A new coherence set starts with the consecutive writerSeqNumber of the last coherent set packet.
* -seqNumber == RTPS_SEQUENCENUMBER_UNKNOWN
* - A DATA packet sent with the consecutive writerSeqNumber of the last coherent set packet.
* - PID_END_COHERENT_SET received. That condition is not handled here. Check PID_END_COHERENT_SET dissection.
* Empty Data condition is not handled here. rtps_util_detect_coherent_set_end_empty_data_case called at the end of dissect_RTPS_DATA and dissect_RTPS_DATA_FRAG_kind
*/
static void rtps_util_add_coherent_set_general_cases_case(
proto_tree *tree,
tvbuff_t *tvb,
uint64_t coherent_seq_number,
coherent_set_entity_info *coherent_set_entity_info_object) {
coherent_set_entity_info *register_entry;
proto_tree *marked_item_tree;
coherent_set_info *coherent_set_info_entry;
coherent_set_key coherent_set_info_key;
coherent_set_entity_info_object->coherent_set_seq_number = coherent_seq_number;
register_entry = (coherent_set_entity_info*)wmem_map_lookup(coherent_set_tracking.entities_using_map,
&coherent_set_entity_info_object->guid);
if (!register_entry) {
register_entry = (coherent_set_entity_info*)wmem_memdup(wmem_file_scope(), coherent_set_entity_info_object, sizeof(coherent_set_entity_info));
wmem_map_insert(
coherent_set_tracking.entities_using_map,
®ister_entry->guid,
register_entry);
}
/* The hash and compare functions treat the key as a sequence of bytes */
memset(&coherent_set_info_key, 0, sizeof(coherent_set_info_key));
coherent_set_info_key.guid = coherent_set_entity_info_object->guid;
coherent_set_info_key.coherent_set_seq_number = coherent_seq_number;
coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map,
&coherent_set_info_key);
if (!coherent_set_info_entry) {
coherent_set_info_entry = wmem_new0(wmem_file_scope(), coherent_set_info);
coherent_set_info_entry->key = (coherent_set_key*)wmem_memdup(wmem_file_scope(), &coherent_set_info_key, sizeof(coherent_set_key));
coherent_set_info_entry->is_set = false;
wmem_map_insert(
coherent_set_tracking.coherent_set_registry_map,
coherent_set_info_entry->key,
coherent_set_info_entry);
}
if (coherent_set_info_entry->writer_seq_number < coherent_set_entity_info_object->writer_seq_number) {
coherent_set_info_entry->writer_seq_number = coherent_set_entity_info_object->writer_seq_number;
}
/* Start */
if (coherent_set_entity_info_object->coherent_set_seq_number == coherent_set_entity_info_object->writer_seq_number) {
marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_start,
tvb, 0, 0, coherent_seq_number);
proto_item_set_generated(marked_item_tree);
/* End case: Start of a new coherent set */
if (coherent_set_entity_info_object->coherent_set_seq_number > register_entry->coherent_set_seq_number &&
coherent_set_entity_info_object->writer_seq_number - 1 == register_entry->writer_seq_number) {
coherent_set_info *previous_entry;
marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end,
tvb, 0, 0, register_entry->coherent_set_seq_number);
proto_item_set_generated(marked_item_tree);
coherent_set_info_key.coherent_set_seq_number = register_entry->writer_seq_number;
coherent_set_info_key.guid = register_entry->guid;
previous_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map, &coherent_set_info_key);
if (previous_entry) {
previous_entry->is_set = true;
}
}
}
if (!coherent_set_info_entry->is_set) {
coherent_set_info_key.coherent_set_seq_number = coherent_seq_number - 1;
/* End case: Sequence unknown received */
if (coherent_set_entity_info_object->coherent_set_seq_number == RTPS_SEQUENCENUMBER_UNKNOWN) {
register_entry->coherent_set_seq_number = coherent_set_entity_info_object->coherent_set_seq_number;
marked_item_tree = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end,
tvb, 0, 0, coherent_set_info_entry->key->coherent_set_seq_number);
proto_item_set_generated(marked_item_tree);
coherent_set_info_entry->is_set = true;
}
} else if (coherent_set_info_entry->writer_seq_number == coherent_set_entity_info_object->writer_seq_number) {
proto_tree *ti;
ti = proto_tree_add_uint64(tree, hf_rtps_coherent_set_end,
tvb, 0, 0, coherent_set_info_entry->key->coherent_set_seq_number);
proto_item_set_generated(ti);
}
/* Update the entity */
coherent_set_entity_info_object->expected_coherent_set_end_writers_seq_number = coherent_set_entity_info_object->writer_seq_number + 1;
*register_entry = *coherent_set_entity_info_object;
}
/*
* Handles the coherent set termination case where the coherent set finishes by sending a DATA or DATA_FRAG with no parameters.
* For the other cases, check rtps_util_add_coherent_set_general_cases_case.
* this function must be called at the end of dissect_RTPS_DATA and dissect_RTPS_DATA_FRAG_kind
*/
static void rtps_util_detect_coherent_set_end_empty_data_case(
coherent_set_entity_info *coherent_set_entity_info_object) {
coherent_set_entity_info *coherent_set_entry = NULL;
coherent_set_entry = (coherent_set_entity_info*) wmem_map_lookup(coherent_set_tracking.entities_using_map, &coherent_set_entity_info_object->guid);
if (coherent_set_entry) {
coherent_set_info *coherent_set_info_entry;
coherent_set_key key;
/* The hash and compare functions treat the key as a sequence of bytes. */
memset(&key, 0, sizeof(key));
key.guid = coherent_set_entity_info_object->guid;
key.coherent_set_seq_number = coherent_set_entry->coherent_set_seq_number;
coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(coherent_set_tracking.coherent_set_registry_map, &key);
if (coherent_set_info_entry
&& (coherent_set_entry->expected_coherent_set_end_writers_seq_number == coherent_set_entity_info_object->writer_seq_number)
&& !coherent_set_info_entry->is_set) {
coherent_set_info_entry->is_set = true;
coherent_set_info_entry->writer_seq_number = coherent_set_entry->expected_coherent_set_end_writers_seq_number - 1;
}
}
}
static uint16_t rtps_util_add_protocol_version(proto_tree *tree, /* Can NOT be NULL */
tvbuff_t *tvb,
int offset) {
proto_item *ti;
proto_tree *version_tree;
uint16_t version;
version = tvb_get_ntohs(tvb, offset);
ti = proto_tree_add_uint_format(tree, hf_rtps_protocol_version, tvb, offset, 2,
version, "Protocol version: %d.%d",
tvb_get_uint8(tvb, offset), tvb_get_uint8(tvb, offset+1));
version_tree = proto_item_add_subtree(ti, ett_rtps_proto_version);
proto_tree_add_item(version_tree, hf_rtps_protocol_version_major, tvb, offset, 1, ENC_NA);
proto_tree_add_item(version_tree, hf_rtps_protocol_version_minor, tvb, offset+1, 1, ENC_NA);
return version;
}
/* ------------------------------------------------------------------------- */
/* Interpret the next bytes as vendor ID. If proto_tree and field ID is
* provided, it can also set.
*/
static uint16_t rtps_util_add_vendor_id(proto_tree *tree,
tvbuff_t *tvb,
int offset) {
uint8_t major, minor;
uint16_t vendor_id;
major = tvb_get_uint8(tvb, offset);
minor = tvb_get_uint8(tvb, offset+1);
vendor_id = tvb_get_ntohs(tvb, offset);
proto_tree_add_uint_format_value(tree, hf_rtps_vendor_id, tvb, offset, 2, vendor_id,
"%02d.%02d (%s)", major, minor,
val_to_str_const(vendor_id, vendor_vals, "Unknown"));
return vendor_id;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 8 bytes interpreted as Locator_t
*
* Locator_t is a struct defined as:
* struct {
* long kind; // kind of locator
* unsigned long port;
* octet[16] address;
* } Locator_t;
*/
static int rtps_util_add_locator_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
const unsigned encoding, const char *label) {
proto_tree *ti;
proto_tree *locator_tree;
uint32_t kind;
uint32_t port;
const int parameter_size = 24;
locator_tree = proto_tree_add_subtree(tree, tvb, offset, parameter_size, ett_rtps_locator,
NULL, label);
proto_tree_add_item_ret_uint(locator_tree, hf_rtps_locator_kind, tvb, offset, 4, encoding, &kind);
switch (kind) {
case LOCATOR_KIND_UDPV4:
case LOCATOR_KIND_TUDPV4: {
ti = proto_tree_add_item_ret_uint(
locator_tree,
hf_rtps_locator_port,
tvb,
offset + 4,
4,
encoding,
&port);
if (port == 0)
expert_add_info(pinfo, ti, &ei_rtps_locator_port);
proto_item_append_text(tree, " (%s, %s:%u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
tvb_ip_to_str(pinfo->pool, tvb, offset + 20), port);
proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset + 20, 4, ENC_BIG_ENDIAN);
break;
}
case LOCATOR_KIND_TCPV4_LAN:
case LOCATOR_KIND_TCPV4_WAN:
case LOCATOR_KIND_TLSV4_LAN:
case LOCATOR_KIND_TLSV4_WAN: {
uint16_t ip_kind;
ti = proto_tree_add_item_ret_uint(
locator_tree,
hf_rtps_locator_port,
tvb,
offset + 4,
4,
encoding,
&port);
if (port == 0)
expert_add_info(pinfo, ti, &ei_rtps_locator_port);
ip_kind = tvb_get_uint16(tvb, offset+16, encoding);
if (ip_kind == 0xFFFF) { /* IPv4 format */
uint16_t public_address_port = tvb_get_uint16(tvb, offset + 18, ENC_BIG_ENDIAN);
proto_tree_add_item(locator_tree, hf_rtps_locator_public_address_port,
tvb, offset+18, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(locator_tree, hf_rtps_locator_ipv4, tvb, offset+20,
4, ENC_BIG_ENDIAN);
proto_item_append_text(tree, " (%s, %s:%d, Logical Port = %u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
tvb_ip_to_str(pinfo->pool, tvb, offset + 20), public_address_port, port);
} else { /* IPv6 format */
proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8,
16, ENC_NA);
proto_item_append_text(tree, " (%s, %s, Logical Port = %u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port);
}
break;
}
case LOCATOR_KIND_SHMEM: {
uint32_t hostId;
ti = proto_tree_add_item_ret_uint(
locator_tree,
hf_rtps_locator_port,
tvb,
offset + 4,
4,
encoding,
&port);
proto_tree_add_item_ret_uint(locator_tree, hf_rtps_param_host_id, tvb, offset+10, 4, ENC_BIG_ENDIAN, &hostId);
if (port == 0)
expert_add_info(pinfo, ti, &ei_rtps_locator_port);
proto_item_append_text(tree, " (%s, HostId = 0x%08x, Port = %u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
hostId, port);
break;
}
case LOCATOR_KIND_UDPV6: {
ti = proto_tree_add_item_ret_uint(
locator_tree,
hf_rtps_locator_port,
tvb,
offset + 4,
4,
encoding,
&port);
if (port == 0)
expert_add_info(pinfo, ti, &ei_rtps_locator_port);
proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA);
proto_item_append_text(tree, " (%s, %s:%u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port);
break;
}
case LOCATOR_KIND_DTLS: {
proto_tree_add_item_ret_uint(
locator_tree,
hf_rtps_locator_port,
tvb,
offset + 4,
4,
encoding,
&port);
proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset+8, 16, ENC_NA);
proto_item_append_text(tree, " (%s, %s:%u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
tvb_ip6_to_str(pinfo->pool, tvb, offset + 8), port);
break;
}
/*
* +-------+-------+-------+-------+
* | Flags | |
* +-------+ +
* | DDS_Octet UUID[9] |
* + +-------+-------+
* | | public_port |
* +-------+-------+-------+-------+
* | DDS_Octet public_ip_address[4]|
* +-------+-------+-------+-------+
*/
case LOCATOR_KIND_UDPV4_WAN: {
uint8_t flags = 0;
ws_in4_addr locator_ip = 0;
const uint32_t uuid_size = 9;
const uint32_t locator_port_size = 4;
const uint32_t locator_port_offset = offset + 4;
const uint32_t flags_offset = locator_port_offset + locator_port_size;
const uint32_t uuid_offset = flags_offset + 1;
const uint32_t port_offset = uuid_offset + uuid_size;
const uint32_t ip_offset = port_offset + 2;
int hf_port = 0;
int hf_ip = 0;
char* ip_str = NULL;
uint32_t public_port = 0;
bool is_public = false;
ti = proto_tree_add_item_ret_uint(
locator_tree,
hf_rtps_locator_port,
tvb,
locator_port_offset,
locator_port_size,
encoding,
&port);
flags = tvb_get_int8(tvb, flags_offset);
proto_tree_add_bitmask_value(
locator_tree,
tvb,
flags_offset,
hf_rtps_udpv4_wan_locator_flags,
ett_rtps_flags,
UDPV4_WAN_LOCATOR_FLAGS,
(uint64_t)flags);
/* UUID */
proto_tree_add_item(locator_tree, hf_rtps_uuid, tvb, uuid_offset, UUID_SIZE, encoding);
/*
* The P flag indicates that the locator contains a globally public IP address
* and public port where a transport instance can be reached. public_ip_address
* contains the public IP address and public_port contains the public UDP port.
* Locators with the P flag set are called PUBLIC locators.
*/
is_public = ((flags & FLAG_UDPV4_WAN_LOCATOR_P) != 0);
if (is_public) {
hf_ip = hf_rtps_udpv4_wan_locator_public_ip;
hf_port = hf_rtps_udpv4_wan_locator_public_port;
} else {
hf_ip = hf_rtps_udpv4_wan_locator_local_ip;
hf_port = hf_rtps_udpv4_wan_locator_local_port;
}
/* Port & IP */
ip_str = tvb_ip_to_str(pinfo->pool, tvb, ip_offset);
locator_ip = tvb_get_ipv4(tvb, ip_offset);
if (locator_ip != 0) {
proto_tree_add_item_ret_uint(
locator_tree,
hf_port,
tvb,
port_offset,
2,
ENC_NA,
&public_port);
proto_tree_add_ipv4(
locator_tree,
hf_ip,
tvb,
ip_offset,
4,
locator_ip);
}
if (port == 0)
expert_add_info(pinfo, ti, &ei_rtps_locator_port);
if (ip_str != NULL && locator_ip != 0) {
if (is_public) {
proto_item_append_text(tree, " (%s, public: %s:%u, rtps port:%u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
ip_str, public_port, port);
} else {
proto_item_append_text(tree, " (%s, local: %s:%u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
ip_str, port);
}
}
}
/* Default case, we already have the locator kind so don't do anything */
default:
break;
}
return offset + parameter_size;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as Sequence of
* unsigned shorts.
* The formatted buffer is: val1, val2, val3, ...
* Returns the new updated offset
*/
static int rtps_util_add_seq_short(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item,
const unsigned encoding, int param_length _U_, const char *label) {
uint32_t num_elem;
uint32_t i;
proto_tree *string_tree;
num_elem = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* Create the string node with an empty string, the replace it later */
string_tree = proto_tree_add_subtree_format(tree, tvb, offset, num_elem * 4,
ett_rtps_seq_ulong, NULL, "%s (%d elements)", label, num_elem);
for (i = 0; i < num_elem; ++i) {
proto_tree_add_item(string_tree, hf_item, tvb, offset, 2, encoding);
offset += 2;
}
return offset;
}
static int rtps_util_add_locator_ex_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
const unsigned encoding, int param_length) {
int locator_offset = 0;
locator_offset = rtps_util_add_locator_t(tree, pinfo, tvb,
offset, encoding, "locator");
offset += rtps_util_add_seq_short(tree, tvb, locator_offset, hf_rtps_encapsulation_id,
encoding, param_length - (locator_offset - offset), "encapsulations");
return offset;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as a list of
* Locators:
* - unsigned long numLocators
* - locator 1
* - locator 2
* - ...
* - locator n
* Returns the new offset after parsing the locator list
*/
static int rtps_util_add_locator_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, const uint8_t *label, const unsigned encoding) {
proto_tree *locator_tree;
uint32_t num_locators;
num_locators = tvb_get_uint32(tvb, offset, encoding);
locator_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
ett_rtps_locator_udp_v4, NULL, "%s: %d Locators", label, num_locators);
offset += 4;
if (num_locators > 0) {
uint32_t i;
char temp_buff[20];
for (i = 0; i < num_locators; ++i) {
snprintf(temp_buff, 20, "Locator[%d]", i);
rtps_util_add_locator_t(locator_tree, pinfo, tvb, offset,
encoding, temp_buff);
offset += 24;
}
}
return offset;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as a list of
* multichannel Locators:
* - unsigned long numLocators
* - locator 1
* - locator 2
* - ...
* - locator n
* Returns the new offset after parsing the locator list
*/
static int rtps_util_add_multichannel_locator_list(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, const uint8_t *label, const unsigned encoding) {
proto_tree *locator_tree;
uint32_t num_locators;
num_locators = tvb_get_uint32(tvb, offset, encoding);
locator_tree = proto_tree_add_subtree_format(tree, tvb, offset, 4,
ett_rtps_locator_udp_v4, NULL, "%s: %d Locators", label, num_locators);
offset += 4;
if (num_locators > 0) {
uint32_t i;
for (i = 0; i < num_locators; ++i) {
proto_tree *ti, *locator_item_tree;
uint32_t kind;
uint32_t port;
char *channel_address;
locator_item_tree = proto_tree_add_subtree(locator_tree, tvb, offset, 24, ett_rtps_locator,
NULL, label);
proto_tree_add_item_ret_uint(locator_item_tree, hf_rtps_locator_kind, tvb, offset, 4, encoding, &kind);
switch (kind) {
case LOCATOR_KIND_UDPV4:
case LOCATOR_KIND_TUDPV4: {
proto_tree_add_item(locator_item_tree, hf_rtps_locator_ipv4, tvb, offset + 16, 4,
ENC_BIG_ENDIAN);
channel_address = tvb_ip_to_str(pinfo->pool, tvb, offset + 16);
break;
}
case LOCATOR_KIND_UDPV6: {
proto_tree_add_item(locator_tree, hf_rtps_locator_ipv6, tvb, offset + 4, 16, ENC_NA);
channel_address = tvb_ip6_to_str(pinfo->pool, tvb, offset + 4);
proto_item_append_text(tree, " (%s, %s)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
tvb_ip6_to_str(pinfo->pool, tvb, offset + 4));
break;
}
/* Default case, Multichannel locators only should be present in UDPv4 and UDPv6 transports
* Unknown address format.
* */
default:
offset += 24;
continue;
break;
}
ti = proto_tree_add_item_ret_uint(locator_item_tree, hf_rtps_locator_port, tvb, offset + 20, 4, encoding, &port);
if (port == 0)
expert_add_info(pinfo, ti, &ei_rtps_locator_port);
proto_item_append_text(tree, " (%s, %s:%u)",
val_to_str(kind, rtps_locator_kind_vals, "%02x"),
channel_address, port);
offset += 24;
}
}
return offset;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 4 bytes interpreted as IPV4Address_t
*/
static void rtps_util_add_ipv4_address_t(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
const unsigned encoding, int hf_item) {
proto_item *ti;
ti = proto_tree_add_item(tree, hf_item, tvb, offset, 4, encoding);
if (tvb_get_ntohl(tvb, offset) == IPADDRESS_INVALID)
expert_add_info(pinfo, ti, &ei_rtps_ip_invalid);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 8 bytes interpreted as LocatorUDPv4
*
* LocatorUDPv4 is a struct defined as:
* struct {
* unsigned long address;
* unsigned long port;
* } LocatorUDPv4_t;
*
*/
static void rtps_util_add_locator_udp_v4(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, const uint8_t *label, const unsigned encoding) {
proto_item *ti;
proto_tree *locator_tree;
uint32_t port;
locator_tree = proto_tree_add_subtree(tree, tvb, offset, 8, ett_rtps_locator_udp_v4, NULL, label);
rtps_util_add_ipv4_address_t(locator_tree, pinfo, tvb, offset,
encoding, hf_rtps_locator_udp_v4);
ti = proto_tree_add_item_ret_uint(locator_tree, hf_rtps_locator_udp_v4_port, tvb, offset, 4, encoding, &port);
if (port == PORT_INVALID)
expert_add_info(pinfo, ti, &ei_rtps_port_invalid);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 8 bytes interpreted as GuidPrefix
* If tree is specified, it fills up the protocol tree item:
* - hf_rtps_guid_prefix
* - hf_rtps_host_id
* - hf_rtps_app_id
* - hf_rtps_app_id_instance_id
* - hf_rtps_app_id_app_kind
*/
static void rtps_util_add_guid_prefix_v1(proto_tree *tree, tvbuff_t *tvb, int offset,
int hf_prefix, int hf_host_id, int hf_app_id, int hf_app_id_instance_id,
int hf_app_id_app_kind, const uint8_t *label) {
uint64_t prefix;
uint32_t host_id, app_id, instance_id;
uint8_t app_kind;
proto_item *ti;
proto_tree *guid_tree, *appid_tree;
const uint8_t *safe_label = (label == NULL) ? (const uint8_t *)"guidPrefix" : label;
/* Read values from TVB */
prefix = tvb_get_ntoh64(tvb, offset);
host_id = tvb_get_ntohl(tvb, offset);
app_id = tvb_get_ntohl(tvb, offset + 4);
instance_id = (app_id >> 8);
app_kind = (app_id & 0xff);
if (tree != NULL) {
ti = proto_tree_add_uint64_format(tree, hf_prefix, tvb, offset, 8, prefix,
"%s=%08x %08x { hostId=%08x, appId=%08x (%s: %06x) }",
safe_label, host_id, app_id, host_id, app_id,
val_to_str(app_kind, app_kind_vals, "%02x"),
instance_id);
guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix);
/* Host Id */
proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
/* AppId (root of the app_id sub-tree) */
ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id);
/* InstanceId */
proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN);
/* AppKind */
proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN);
}
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 12 bytes interpreted as GuidPrefix
* If tree is specified, it fills up the protocol tree item:
* - hf_rtps_guid_prefix
* - hf_rtps_host_id
* - hf_rtps_app_id
* - hf_rtps_counter
*/
static void rtps_util_add_guid_prefix_v2(proto_tree *tree, tvbuff_t *tvb, int offset,
int hf_prefix, int hf_host_id, int hf_app_id,
int hf_instance_id, int hf_prefix_extra) {
if (tree) {
proto_item *ti;
proto_tree *guid_tree;
/* The text node (root of the guid prefix sub-tree) */
ti = proto_tree_add_item(tree, hf_prefix, tvb, offset, 12, ENC_NA);
guid_tree = proto_item_add_subtree(ti, ett_rtps_guid_prefix);
/* Optional filter that can be guidPrefix.src or guidPrefix.dst */
if (hf_prefix_extra != 0) {
ti = proto_tree_add_item(tree, hf_prefix_extra, tvb, offset, 12, ENC_NA);
proto_item_set_hidden(ti);
}
/* Host Id */
proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
/* App Id */
proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
/* Counter */
proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN);
}
}
/* ------------------------------------------------------------------------- */
/* Insert the entityId from the next 4 bytes. Since there are more than
* one entityId, we need to specify also the IDs of the entityId (and its
* sub-components), as well as the label identifying it.
* Returns true if the entityKind is one of the NDDS built-in entities.
*/
static bool rtps_util_add_entity_id(proto_tree *tree, tvbuff_t *tvb, int offset,
int hf_item, int hf_item_entity_key, int hf_item_entity_kind,
int subtree_entity_id, const char *label, uint32_t *entity_id_out) {
uint32_t entity_id = tvb_get_ntohl(tvb, offset);
uint32_t entity_key = (entity_id >> 8);
uint8_t entity_kind = (entity_id & 0xff);
const char *str_predef = try_val_to_str(entity_id, entity_id_vals);
if (entity_id_out != NULL) {
*entity_id_out = entity_id;
}
if (tree != NULL) {
proto_tree *entity_tree;
proto_item *ti;
if (str_predef == NULL) {
/* entityId is not a predefined value, format it */
ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id,
"%s: 0x%08x (%s: 0x%06x)",
label, entity_id,
val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"),
entity_key);
} else {
/* entityId is a predefined value */
ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id,
"%s: %s (0x%08x)", label, str_predef, entity_id);
}
entity_tree = proto_item_add_subtree(ti, subtree_entity_id);
proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN);
}
/* is a built-in entity if the bit M and R (5 and 6) of the entityKind are set */
/* return ((entity_kind & 0xc0) == 0xc0); */
return ( ((entity_kind & 0xc0) == 0xc0) ||
entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER ||
entity_id == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_READER ||
entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER ||
entity_id == ENTITYID_RTI_BUILTIN_LOCATOR_PING_READER);
}
/* ------------------------------------------------------------------------- */
/* Insert the entityId from the next 4 bytes as a generic one (not connected
* to any protocol field). It simply insert the content as a simple text entry
* and returns in the passed buffer only the value (without the label).
*/
static void rtps_util_add_generic_entity_id(proto_tree *tree, tvbuff_t *tvb, int offset, const char *label,
int hf_item, int hf_item_entity_key, int hf_item_entity_kind,
int subtree_entity_id) {
uint32_t entity_id = tvb_get_ntohl(tvb, offset);
uint32_t entity_key = (entity_id >> 8);
uint8_t entity_kind = (entity_id & 0xff);
const char *str_predef = try_val_to_str(entity_id, entity_id_vals);
proto_item *ti;
proto_tree *entity_tree;
if (str_predef == NULL) {
/* entityId is not a predefined value, format it */
ti = proto_tree_add_uint_format(tree, hf_item, tvb, offset, 4, entity_id,
"%s: 0x%08x (%s: 0x%06x)", label, entity_id,
val_to_str(entity_kind, entity_kind_vals, "unknown kind (%02x)"),
entity_key);
} else {
/* entityId is a predefined value */
ti = proto_tree_add_uint_format_value(tree, hf_item, tvb, offset, 4, entity_id,
"%s: %s (0x%08x)", label, str_predef, entity_id);
}
entity_tree = proto_item_add_subtree(ti, subtree_entity_id);
proto_tree_add_item(entity_tree, hf_item_entity_key, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(entity_tree, hf_item_entity_kind, tvb, offset+3, 1, ENC_BIG_ENDIAN);
}
/* ------------------------------------------------------------------------- */
/* Interpret the next 12 octets as a generic GUID and insert it in the protocol
* tree as simple text (no reference fields are set).
* It is mostly used in situation where is not required to perform search for
* this kind of GUID (i.e. like in some DATA parameter lists).
*/
static void rtps_util_add_generic_guid_v1(proto_tree *tree, tvbuff_t *tvb, int offset,
int hf_guid, int hf_host_id, int hf_app_id, int hf_app_id_instance_id,
int hf_app_id_app_kind, int hf_entity, int hf_entity_key,
int hf_entity_kind) {
uint64_t prefix;
uint32_t host_id, app_id, entity_id;
proto_item *ti;
proto_tree *guid_tree, *appid_tree, *entity_tree;
/* Read typed data */
prefix = tvb_get_ntoh64(tvb, offset);
host_id = tvb_get_ntohl(tvb, offset);
app_id = tvb_get_ntohl(tvb, offset + 4);
entity_id = tvb_get_ntohl(tvb, offset + 8);
ti = proto_tree_add_uint64_format_value(tree, hf_guid, tvb, offset, 8, prefix, "%08x %08x %08x",
host_id, app_id, entity_id);
guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
/* Host Id */
proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
/* AppId (root of the app_id sub-tree) */
ti = proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
appid_tree = proto_item_add_subtree(ti, ett_rtps_app_id);
/* InstanceId */
proto_tree_add_item(appid_tree, hf_app_id_instance_id, tvb, offset+4, 3, ENC_BIG_ENDIAN);
/* AppKind */
proto_tree_add_item(appid_tree, hf_app_id_app_kind, tvb, offset+7, 1, ENC_BIG_ENDIAN);
/* Entity (root of the app_id sub-tree) */
ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+8, 4, ENC_BIG_ENDIAN);
entity_tree = proto_item_add_subtree(ti, ett_rtps_entity);
proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+8, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+11, 1, ENC_BIG_ENDIAN);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next data interpreted as a String
* Returns the new offset (after reading the string)
* XXX - should check that string length field makes sense, possibly by
* comparing to a passed-in container length (cf. #19359)
*/
static int rtps_util_add_string(proto_tree *tree, tvbuff_t *tvb, int offset,
int hf_item, const unsigned encoding) {
uint32_t size;
proto_tree_add_item_ret_uint(tree, hf_rtps_string_length, tvb, offset, 4, encoding, &size);
proto_tree_add_item(tree, hf_item, tvb, offset+4, size, ENC_ASCII);
/* NDDS align strings at 4-bytes word. So:
* string_length: 4 -> buffer_length = 4;
* string_length: 5 -> buffer_length = 8;
* string_length: 6 -> buffer_length = 8;
* string_length: 7 -> buffer_length = 8;
* string_length: 8 -> buffer_length = 8;
* ...
*/
return offset + 4 + ((size + 3) & 0xfffffffc);
}
static int rtps_util_add_data_tags(proto_tree *rtps_parameter_tree, tvbuff_t *tvb,
int offset, const unsigned encoding, int param_length) {
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Sequence Size |
* +ITEM 0---------+---------------+---------------+---------------+
* | Name String Bytes |
* +---------------+---------------+---------------+---------------+
* | Value String Bytes |
* +---------------+---------------+---------------+---------------+
* ....
* +ITEM N---------+---------------+---------------+---------------+
* | Name String Bytes |
* +---------------+---------------+---------------+---------------+
* | Value String Bytes |
* +---------------+---------------+---------------+---------------+
*/
proto_tree *tags_seq_tree = NULL;
proto_tree *tag_tree = NULL;
uint32_t seq_sum_elements, i;
seq_sum_elements = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
tags_seq_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, offset - 4, param_length,
ett_rtps_data_tag_seq, NULL, "Tags (size = %u)", seq_sum_elements);
for (i = 0; i < seq_sum_elements; ++i) {
uint32_t initial_offset = offset;
tag_tree = proto_tree_add_subtree_format(tags_seq_tree, tvb, offset, -1, ett_rtps_data_tag_item,
NULL, "Tag [%u]", i);
offset = rtps_util_add_string(tag_tree, tvb, offset, hf_rtps_data_tag_name, encoding);
offset = rtps_util_add_string(tag_tree, tvb, offset, hf_rtps_data_tag_value, encoding);
proto_item_set_len(tag_tree, offset - initial_offset);
}
return offset;
}
/* ------------------------------------------------------------------------- */
/* Interpret the next 16 octets as a generic GUID and insert it in the protocol
* tree as simple text (no reference fields are set).
* It is mostly used in situation where is not required to perform search for
* this kind of GUID (i.e. like in some DATA parameter lists).
*/
static void rtps_util_add_generic_guid_v2(proto_tree *tree, tvbuff_t *tvb, int offset,
int hf_guid, int hf_host_id, int hf_app_id, int hf_instance_id,
int hf_entity, int hf_entity_key, int hf_entity_kind, proto_tree *print_tree) {
uint32_t host_id, app_id, entity_id, instance_id;
proto_item *ti;
proto_tree *guid_tree, *entity_tree;
/* Read typed data */
host_id = tvb_get_ntohl(tvb, offset);
app_id = tvb_get_ntohl(tvb, offset + 4);
instance_id = tvb_get_ntohl(tvb, offset + 8);
entity_id = tvb_get_ntohl(tvb, offset + 12);
ti = proto_tree_add_bytes_format_value(tree, hf_guid, tvb, offset, 16, NULL, "%08x %08x %08x %08x",
host_id, app_id, instance_id, entity_id);
/* If the method is called with a valid print_tree pointer, we add the info to the tree.
* This improves usability a lot since the user doesn't have to click a lot to debug. */
proto_item_append_text(print_tree, "%08x %08x %08x %08x",
host_id, app_id, instance_id, entity_id);
guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
/* Host Id */
proto_tree_add_item(guid_tree, hf_host_id, tvb, offset, 4, ENC_BIG_ENDIAN);
/* App Id */
proto_tree_add_item(guid_tree, hf_app_id, tvb, offset+4, 4, ENC_BIG_ENDIAN);
/* Instance Id */
proto_tree_add_item(guid_tree, hf_instance_id, tvb, offset+8, 4, ENC_BIG_ENDIAN);
/* Entity (root of the app_id sub-tree) */
ti = proto_tree_add_item(guid_tree, hf_entity, tvb, offset+12, 4, ENC_BIG_ENDIAN);
entity_tree = proto_item_add_subtree(ti, ett_rtps_entity);
proto_tree_add_item(entity_tree, hf_entity_key, tvb, offset+12, 3, ENC_BIG_ENDIAN);
proto_tree_add_item(entity_tree, hf_entity_kind, tvb, offset+15, 1, ENC_BIG_ENDIAN);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 8 bytes interpreted as sequence
* number.
*/
static uint64_t rtps_util_add_seq_number(proto_tree *tree,
tvbuff_t *tvb,
int offset,
const unsigned encoding,
const char *label) {
uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset+4, encoding);
uint64_t all = (hi << 32) | lo;
proto_tree_add_int64_format(tree, hf_rtps_sm_seq_number, tvb, offset, 8,
all, "%s: %" PRIu64, label, all);
return all;
}
/* ------------------------------------------------------------------------- */
/* Vendor specific: RTI
* Insert in the protocol tree the next 8 bytes interpreted as TransportInfo
*/
static void rtps_util_add_transport_info(proto_tree *tree,
tvbuff_t *tvb,
int offset,
const unsigned encoding,
int transport_index)
{
int32_t classId = tvb_get_uint32(tvb, offset, encoding);
if (tree) {
proto_tree *xport_info_tree;
xport_info_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8, ett_rtps_transport_info, NULL,
"transportInfo %d: %s", transport_index, val_to_str_const(classId, ndds_transport_class_id_vals, "unknown"));
proto_tree_add_item(xport_info_tree, hf_rtps_transportInfo_classId, tvb,
offset, 4, encoding);
proto_tree_add_item(xport_info_tree, hf_rtps_transportInfo_messageSizeMax, tvb,
offset+4, 4, encoding);
}
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 8 bytes interpreted as an RTPS time_t,
* which is like an NTP time stamp, except that it uses the UNIX epoch,
* rather than the NTP epoch, as the time base. Doesn't check for TIME_ZERO,
* TIME_INVALID, or TIME_INFINITE, and doesn't show the seconds and
* fraction field separately.
*/
static void rtps_util_add_timestamp(proto_tree *tree,
tvbuff_t *tvb,
int offset,
const unsigned encoding,
int hf_time) {
proto_tree_add_item(tree, hf_time, tvb, offset, 8,
ENC_TIME_RTPS|encoding);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next 8 bytes interpreted as an RTPS time_t.
* Checks for special values except for TIME_INVALID, and shows the
* seconds and fraction as separate fields.
*/
static void rtps_util_add_timestamp_sec_and_fraction(proto_tree *tree,
tvbuff_t *tvb,
int offset,
const unsigned encoding,
int hf_time _U_) {
char tempBuffer[MAX_TIMESTAMP_SIZE];
double absolute;
int32_t sec;
uint32_t frac;
if (tree) {
proto_tree *time_tree;
sec = tvb_get_uint32(tvb, offset, encoding);
frac = tvb_get_uint32(tvb, offset+4, encoding);
if ((sec == 0x7fffffff) && (frac == 0xffffffff)) {
(void) g_strlcpy(tempBuffer, "INFINITE", MAX_TIMESTAMP_SIZE);
} else if ((sec == 0) && (frac == 0)) {
(void) g_strlcpy(tempBuffer, "0 sec", MAX_TIMESTAMP_SIZE);
} else {
absolute = (double)sec + (double)frac / ((double)(0x80000000) * 2.0);
snprintf(tempBuffer, MAX_TIMESTAMP_SIZE,
"%f sec (%ds + 0x%08x)", absolute, sec, frac);
}
time_tree = proto_tree_add_subtree_format(tree, tvb, offset, 8,
ett_rtps_timestamp, NULL, "%s: %s", "lease_duration", tempBuffer);
proto_tree_add_item(time_tree, hf_rtps_param_timestamp_sec, tvb, offset, 4, encoding);
proto_tree_add_item(time_tree, hf_rtps_param_timestamp_fraction, tvb, offset+4, 4, encoding);
}
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next data interpreted as a port (unsigned
* 32-bit integer)
*/
static void rtps_util_add_port(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, const unsigned encoding, int hf_item) {
proto_item *ti;
uint32_t port;
ti = proto_tree_add_item_ret_uint(tree, hf_item, tvb, offset, 4, encoding, &port);
if (port == PORT_INVALID)
expert_add_info(pinfo, ti, &ei_rtps_port_invalid);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as
* DurabilityServiceQosPolicy
*/
static void rtps_util_add_durability_service_qos(proto_tree *tree,
tvbuff_t *tvb,
int offset,
const unsigned encoding) {
proto_tree *subtree;
subtree = proto_tree_add_subtree(tree, tvb, offset, 28, ett_rtps_durability_service, NULL, "PID_DURABILITY_SERVICE");
rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset, encoding, hf_rtps_durability_service_cleanup_delay);
proto_tree_add_item(subtree, hf_rtps_durability_service_history_kind, tvb, offset+8, 4, encoding);
proto_tree_add_item(subtree, hf_rtps_durability_service_history_depth, tvb, offset+12, 4, encoding);
proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples, tvb, offset+16, 4, encoding);
proto_tree_add_item(subtree, hf_rtps_durability_service_max_instances, tvb, offset+20, 4, encoding);
proto_tree_add_item(subtree, hf_rtps_durability_service_max_samples_per_instances, tvb, offset+24, 4, encoding);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as Liveliness
* QoS Policy structure.
*/
static void rtps_util_add_liveliness_qos(proto_tree *tree, tvbuff_t *tvb, int offset, const unsigned encoding) {
proto_tree *subtree;
subtree = proto_tree_add_subtree(tree, tvb, offset, 12, ett_rtps_liveliness, NULL, "PID_LIVELINESS");
proto_tree_add_item(subtree, hf_rtps_liveliness_kind, tvb, offset, 4, encoding);
rtps_util_add_timestamp_sec_and_fraction(subtree, tvb, offset+4, encoding, hf_rtps_liveliness_lease_duration);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as Liveliness
* QoS Policy structure.
*/
static void rtps_util_add_product_version(proto_tree *tree, tvbuff_t *tvb, int offset, int vendor_id) {
proto_tree *subtree;
uint8_t major, minor, release, revision;
int release_offset;
int revision_offset;
release_offset = 2;
revision_offset = 3;
major = tvb_get_uint8(tvb, offset);
minor = tvb_get_uint8(tvb, offset+1);
release = tvb_get_uint8(tvb, offset+2);
revision = tvb_get_uint8(tvb, offset+3);
if (vendor_id == RTPS_VENDOR_RTI_DDS) {
if (major < 5 && revision == 0) {
subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
"Product version: %d.%d%s", major, minor, format_char(wmem_packet_scope(), release));
} else if (major < 5 && revision > 0) {
subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
"Product version: %d.%d%s rev%d", major, minor, format_char(wmem_packet_scope(), release), revision);
} else {
subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
"Product version: %d.%d.%d.%d", major, minor, release, revision);
}
} else if (vendor_id == RTPS_VENDOR_RTI_DDS_MICRO) {
/* In Micro < 3.0.0 release and revision numbers are switched */
if (major < 3) {
revision = revision ^ release;
release = revision ^ release;
revision = revision ^ release;
revision_offset = revision_offset ^ release_offset;
release_offset = revision_offset ^ release_offset;
revision_offset = revision_offset ^ release_offset;
}
if (revision != 0) {
subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
"Product version: %d.%d.%d.%d", major, minor, release, revision);
} else {
subtree = proto_tree_add_subtree_format(tree, tvb, offset, 4, ett_rtps_product_version, NULL,
"Product version: %d.%d.%d", major, minor, release);
}
} else {
return;
}
proto_tree_add_item(subtree, hf_rtps_param_product_version_major,
tvb, offset, 1, ENC_NA);
proto_tree_add_item(subtree, hf_rtps_param_product_version_minor,
tvb, offset+1, 1, ENC_NA);
/* If major revision is smaller than 5, release interpreted as char */
if (vendor_id == RTPS_VENDOR_RTI_DDS && major < 5) {
proto_tree_add_item(subtree, hf_rtps_param_product_version_release_as_char,
tvb, offset + release_offset, 1, ENC_ASCII);
} else {
proto_tree_add_item(subtree, hf_rtps_param_product_version_release,
tvb, offset + release_offset, 1, ENC_NA);
}
proto_tree_add_item(subtree, hf_rtps_param_product_version_revision,
tvb, offset + revision_offset, 1, ENC_NA);
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as Sequence of
* Strings.
* The formatted buffer is: "string1", "string2", "string3", ...
* Returns the new updated offset
*/
static int rtps_util_add_seq_string(proto_tree *tree, tvbuff_t *tvb, int offset,
const unsigned encoding, int hf_numstring,
int hf_string, const char *label) {
uint32_t size;
int32_t i, num_strings;
const char *retVal;
proto_tree *string_tree;
int start;
proto_tree_add_item_ret_int(tree, hf_numstring, tvb, offset, 4, encoding, &num_strings);
offset += 4;
if (num_strings == 0) {
return offset;
}
start = offset;
/* Create the string node with a fake string, the replace it later */
string_tree = proto_tree_add_subtree(tree, tvb, offset, -1, ett_rtps_seq_string, NULL, label);
for (i = 0; i < num_strings; ++i) {
size = tvb_get_uint32(tvb, offset, encoding);
retVal = (const char* )tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, size, ENC_ASCII);
proto_tree_add_string_format(string_tree, hf_string, tvb, offset, size+4, retVal,
"%s[%d]: %s", label, i, retVal);
offset += (4 + ((size + 3) & 0xfffffffc));
}
proto_item_set_len(string_tree, offset - start);
return offset;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as Sequence of
* longs.
* The formatted buffer is: val1, val2, val3, ...
* Returns the new updated offset
*/
static int rtps_util_add_seq_ulong(proto_tree *tree, tvbuff_t *tvb, int offset, int hf_item,
const unsigned encoding, int param_length _U_, const char *label) {
uint32_t num_elem;
uint32_t i;
proto_tree *string_tree;
num_elem = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* Create the string node with an empty string, the replace it later */
string_tree = proto_tree_add_subtree_format(tree, tvb, offset, num_elem*4,
ett_rtps_seq_ulong, NULL, "%s (%d elements)", label, num_elem);
for (i = 0; i < num_elem; ++i) {
proto_tree_add_item(string_tree, hf_item, tvb, offset, 4, encoding);
offset += 4;
}
return offset;
}
/* ------------------------------------------------------------------------- */
static const char *rtps_util_typecode_id_to_string(uint32_t typecode_id) {
switch(typecode_id) {
case RTI_CDR_TK_ENUM: return "enum";
case RTI_CDR_TK_UNION: return "union";
case RTI_CDR_TK_STRUCT: return "struct";
case RTI_CDR_TK_LONG: return "long";
case RTI_CDR_TK_SHORT: return "short";
case RTI_CDR_TK_USHORT: return "unsigned short";
case RTI_CDR_TK_ULONG: return "unsigned long";
case RTI_CDR_TK_FLOAT: return "float";
case RTI_CDR_TK_DOUBLE: return "double";
case RTI_CDR_TK_BOOLEAN: return "boolean";
case RTI_CDR_TK_CHAR: return "char";
case RTI_CDR_TK_OCTET: return "octet";
case RTI_CDR_TK_LONGLONG: return "longlong";
case RTI_CDR_TK_ULONGLONG: return "unsigned long long";
case RTI_CDR_TK_LONGDOUBLE: return "long double";
case RTI_CDR_TK_WCHAR: return "wchar";
case RTI_CDR_TK_WSTRING: return "wstring";
case RTI_CDR_TK_STRING: return "string";
case RTI_CDR_TK_SEQUENCE: return "sequence";
case RTI_CDR_TK_ARRAY: return "array";
case RTI_CDR_TK_ALIAS: return "alias";
case RTI_CDR_TK_VALUE: return "valuetype";
case RTI_CDR_TK_NULL:
default:
return "<unknown type>";
}
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as typecode info
* Returns the number of bytes parsed
*/
// NOLINTNEXTLINE(misc-no-recursion)
static int rtps_util_add_typecode(proto_tree *tree, tvbuff_t *tvb, packet_info *pinfo, int offset, const unsigned encoding,
int indent_level, int is_pointer, uint16_t bitfield, int is_key, const int offset_begin,
char *name,
int seq_max_len, /* -1 = not a sequence field */
uint32_t *arr_dimension, /* if !NULL: array of 10 int */
int ndds_40_hack) {
const int original_offset = offset;
uint32_t tk_id;
uint16_t tk_size;
unsigned int i;
char *indent_string;
int retVal;
char type_name[40];
/* Structure of the typecode data:
* Offset | Size | Field | Notes
* ----------|-------|------------------------------|---------------------
* ? | ? | pad? |
* 0 | 4 | RTI_CDR_TK_XXXXX | 4 bytes aligned
* 4 | 2 | length the struct |
*/
/* Calc indent string */
indent_string = (char *)wmem_alloc(wmem_epan_scope(), (indent_level*2)+1);
memset(indent_string, ' ', (indent_level*2)+1);
indent_string[indent_level*2] = '\0';
/* Gets TK ID */
LONG_ALIGN(offset);
tk_id = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* Gets TK size */
tk_size = tvb_get_uint16(tvb, offset, encoding);
offset += 2;
retVal = tk_size + 6; /* 6 = 4 (typecode ID) + 2 (size) */
/* The first bit of typecode is set to 1, clear it */
tk_id &= 0x7fffffff;
/* HACK: NDDS 4.0 and NDDS 4.1 has different typecode ID list.
* The ID listed in the RTI_CDR_TK_XXXXX are the one from NDDS 4.1
* In order to correctly dissect NDDS 4.0 packets containing typecode
* information, we check if the ID of the element at level zero is a
* struct or union. If not, it means we are dissecting a ndds 4.0 packet
* (and we can decrement the ID to match the correct values).
*/
if (indent_level == 0) {
if (tk_id == RTI_CDR_TK_OCTET) {
ndds_40_hack = 1;
}
}
if (ndds_40_hack) {
++tk_id;
}
(void) g_strlcpy(type_name, rtps_util_typecode_id_to_string(tk_id), sizeof(type_name));
/* Structure of the typecode data:
*
* <type_code_header> ::=
* <kind>
* <type_code_length>
*
* <kind> ::= long (0=TK_NULL, 1=TK_SHORT...)
* <type_code_length> ::= unsugned short
*
*/
switch(tk_id) {
/* Structure of the typecode data:
*
* <union_type_code> ::=
* <type_code_header>
* <name>
* <default_index>
* <discriminator_type_code>
* <member_count>
* <union_member>+
* <union_member> ::= <member_length><name><union_member_detail>
* <member_length> ::= unsigned short
* <name> ::= <string>
* <string> ::= <length>char+<eol>
* <length> ::= unsigned long
* <eol> ::= (char)0
*
* <union_member_detail> ::= <is_pointer>
* <labels_count>
* <label>+
* <type_code>
* <labels_count> ::= unsigned long
* <label> ::= long
*
*/
case RTI_CDR_TK_UNION: {
uint32_t struct_name_len;
uint8_t *struct_name;
const char *discriminator_name; /* for unions */
char *discriminator_enum_name = NULL; /* for unions with enum discriminator */
/*uint32_t defaultIdx;*/ /* Currently is ignored */
uint32_t disc_id; /* Used temporarily to populate 'discriminator_name' */
uint16_t disc_size; /* Currently is ignored */
uint32_t disc_offset_begin, num_members, member_name_len;
uint16_t member_length;
uint8_t *member_name = NULL;
uint32_t next_offset, field_offset_begin, member_label_count, discriminator_enum_name_length;
int32_t member_label;
unsigned j;
/* - - - - - - - Union name - - - - - - - */
/* Pad-align */
LONG_ALIGN(offset);
/* Get structure name length */
struct_name_len = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
struct_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, struct_name_len, ENC_ASCII);
offset = check_offset_addition(offset, struct_name_len, tree, NULL, tvb);
/* - - - - - - - Default index - - - - - - - */
LONG_ALIGN(offset);
/*defaultIdx = NEXT_uint32(tvb, offset, encoding);*/
offset += 4;
/* - - - - - - - Discriminator type code - - - - - - - */
/* We don't recursively dissect everything, instead we just read the type */
disc_id = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
disc_size = tvb_get_uint16(tvb, offset, encoding);
offset += 2;
disc_offset_begin = offset;
disc_id &= 0x7fffffff;
discriminator_name = rtps_util_typecode_id_to_string(disc_id);
if (disc_id == RTI_CDR_TK_ENUM) {
/* Enums has also a name that we should print */
LONG_ALIGN(offset);
discriminator_enum_name_length = tvb_get_uint32(tvb, offset, encoding);
discriminator_enum_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, discriminator_enum_name_length, ENC_ASCII);
}
offset = disc_offset_begin + disc_size;
#if 0
field_offset_begin = offset;
increment_dissection_depth(pinfo);
offset += rtps_util_add_typecode(
tree,
tvb,
pinfo,
offset,
encoding,
indent_level+1,
0,
0,
0,
field_offset_begin,
member_name,
-1,
NULL,
ndds_40_hack);
decrement_dissection_depth(pinfo);
#endif
/* Add the entry of the union in the tree */
proto_tree_add_string_format(tree, hf_rtps_union, tvb, original_offset, retVal, struct_name, "%sunion %s (%s%s%s) {",
indent_string, struct_name, discriminator_name,
(discriminator_enum_name ? " " : ""),
(discriminator_enum_name ? discriminator_enum_name : ""));
if (seq_max_len != -1) {
/* We're dissecting a sequence of struct, bypass the seq definition */
snprintf(type_name, 40, "%s", struct_name);
break;
}
/* - - - - - - - Number of members - - - - - - - */
LONG_ALIGN(offset);
num_members = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* - - - - - - - <union_member>+ - - - - - - - */
next_offset = offset;
for (i = 0; i < num_members; ++i) {
uint8_t member_is_pointer;
/* Safety: this theoretically should be the same already */
field_offset_begin = offset = next_offset;
SHORT_ALIGN(offset);
/* member's length */
member_length = tvb_get_uint16(tvb, offset, encoding);
offset += 2;
next_offset = offset + member_length;
/* Name length */
LONG_ALIGN(offset);
member_name_len = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* Name */
member_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, member_name_len, ENC_ASCII);
offset = check_offset_addition(offset, member_name_len, tree, NULL, tvb);
/* is Pointer ? */
member_is_pointer = tvb_get_uint8(tvb, offset);
offset++;
/* Label count */
LONG_ALIGN(offset);
member_label_count = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
for (j = 0; j < member_label_count; ++j) {
proto_item* case_item;
/* Label count */
LONG_ALIGN(offset);
member_label = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* Add the entry of the union in the tree */
case_item = proto_tree_add_uint_format(tree, hf_rtps_union_case, tvb, field_offset_begin, 1, member_label,
"%s case %d:", indent_string, member_label);
proto_item_set_len(case_item, retVal);
}
increment_dissection_depth(pinfo);
offset += rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding,
indent_level+2, member_is_pointer, 0, 0, field_offset_begin,
member_name, -1, NULL, ndds_40_hack);
decrement_dissection_depth(pinfo);
}
/* Finally prints the name of the struct (if provided) */
(void) g_strlcpy(type_name, "}", sizeof(type_name));
break;
} /* end of case UNION */
case RTI_CDR_TK_ENUM:
case RTI_CDR_TK_STRUCT: {
/* Structure of the typecode data:
*
* <union_type_code> ::=
* <type_code_header>
* <name>
* <default_index>
* <discriminator_type_code>
* <member_count>
* <member>+
*
* <struct_type_code> ::=
* <type_code_header>
* <name>
* <member_count>
* <member>+
*
* <name> ::= <string>
* <string> ::= <length>char+<eol>
* <length> ::= unsigned long
* <eol> ::= (char)0
* <member_count> ::= unsigned long
*
* STRUCT / UNION:
* Foreach member {
* - A2: 2: member length
* - A4: 4: member name length
* - n: member name
* - 1: isPointer?
* - A2 2: bitfield bits (-1=none)
* - 1: isKey?
* - A4 4: Typecode ID
* - A2 2: length
* }
*
* ENUM:
* Foreach member {
* - A2: 2: member length
* - A4: 4: member name length
* - n: member name
* - A4: 4: ordinal number
*
* -> ----------------------------------------------------- <-
* -> The alignment pad bytes belong to the FOLLOWING field <-
* -> A4 = 4 bytes alignment, A2 = 2 bytes alignment <-
* -> ----------------------------------------------------- <-
*/
int8_t *struct_name;
uint32_t struct_name_len, num_members;
uint32_t next_offset;
const char *typecode_name;
/* Pad-align */
LONG_ALIGN(offset);
/* Get structure name length */
struct_name_len = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* struct name */
struct_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, struct_name_len, ENC_ASCII);
offset = check_offset_addition(offset, struct_name_len, tree, NULL, tvb);
if (tk_id == RTI_CDR_TK_ENUM) {
typecode_name = "enum";
} else if (tk_id == RTI_CDR_TK_VALUE_PARAM) {
/* uint16_t type_modifier; */
/* uint32_t baseTypeCodeKind; */
uint32_t baseTypeCodeLength;
/* Need to read the type modifier and the base type code */
typecode_name = "<sparse type>";
SHORT_ALIGN(offset);
/* type_modifier = */ tvb_get_uint16(tvb, offset, encoding);
offset += 2;
LONG_ALIGN(offset);
/* baseTypeCodeKind = */ tvb_get_uint32(tvb, offset, encoding);
offset += 4;
baseTypeCodeLength = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
offset = check_offset_addition(offset, baseTypeCodeLength, tree, NULL, tvb);
} else {
typecode_name = "struct";
}
if (seq_max_len != -1) {
/* We're dissecting a sequence of struct, bypass the seq definition */
snprintf(type_name, 40, "%s", struct_name);
break;
}
/* Prints it */
proto_tree_add_string_format(tree, hf_rtps_struct, tvb, original_offset, retVal, struct_name,
"%s%s %s {", indent_string, typecode_name, struct_name);
/* PAD align */
LONG_ALIGN(offset);
/* number of members */
num_members = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
next_offset = offset;
for (i = 0; i < num_members; ++i) {
uint8_t *member_name;
uint32_t member_name_len;
uint16_t member_length;
uint32_t field_offset_begin;
/* Safety: this theoretically should be the same already */
field_offset_begin = offset = next_offset;
SHORT_ALIGN(offset);
/* member's length */
member_length = tvb_get_uint16(tvb, offset, encoding);
offset += 2;
next_offset = offset + member_length;
/* Name length */
LONG_ALIGN(offset);
member_name_len = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* Name */
member_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, member_name_len, ENC_ASCII);
offset += member_name_len;
if (tk_id == RTI_CDR_TK_ENUM) {
/* ordinal number */
uint32_t ordinal_number;
LONG_ALIGN(offset);
ordinal_number = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
proto_tree_add_string_format(tree, hf_rtps_member_name, tvb, field_offset_begin, (offset-field_offset_begin), member_name,
"%s %s = %d;", indent_string, member_name, ordinal_number);
} else {
/* Structs */
uint16_t member_bitfield;
uint8_t member_is_pointer;
uint8_t member_is_key;
/* is Pointer ? */
member_is_pointer = tvb_get_uint8(tvb, offset);
offset++;
/* Bitfield */
SHORT_ALIGN(offset);
member_bitfield = tvb_get_uint16(tvb, offset, encoding);
offset += 2; /* pad will be added by typecode dissector */
/* is Key ? */
member_is_key = tvb_get_uint8(tvb, offset);
offset++;
increment_dissection_depth(pinfo);
offset += rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding,
indent_level+1, member_is_pointer, member_bitfield, member_is_key,
field_offset_begin, member_name, -1, NULL, ndds_40_hack);
decrement_dissection_depth(pinfo);
}
}
/* Finally prints the name of the struct (if provided) */
(void) g_strlcpy(type_name, "}", sizeof(type_name));
break;
}
case RTI_CDR_TK_WSTRING:
case RTI_CDR_TK_STRING: {
/* Structure of the typecode data:
* Offset | Size | Field | Notes
* ----------|-------|------------------------------|---------------------
* 6 | 2 | pad |
* 8 | 4 | String length | 4-bytes aligned
*/
uint32_t string_length;
LONG_ALIGN(offset);
string_length = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
snprintf(type_name, 40, "%s<%d>",
(tk_id == RTI_CDR_TK_STRING) ? "string" : "wstring",
string_length);
break;
}
case RTI_CDR_TK_SEQUENCE: {
/* Structure of the typecode data:
*
* - A4: 4: Sequence max length
* - the sequence typecode
*/
uint32_t seq_max_len2;
LONG_ALIGN(offset);
seq_max_len2 = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* Recursive decode seq typecode */
/*offset += */rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding, indent_level,
is_pointer, bitfield, is_key, offset_begin, name,
seq_max_len2, NULL, ndds_40_hack);
/* Differently from the other typecodes, the line has been already printed */
return retVal;
}
case RTI_CDR_TK_ARRAY: {
/* Structure of the typecode data:
*
* - A4: 4: number of dimensions
* - A4: 4: dim1
* - <A4: 4: dim2>
* - ...
* - the array typecode
*/
uint32_t size[MAX_ARRAY_DIMENSION]; /* Max dimensions */
uint32_t dim_max;
LONG_ALIGN(offset);
dim_max = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
if (dim_max > MAX_ARRAY_DIMENSION) {
/* We don't have a tree item to add expert info to... */
dim_max = MAX_ARRAY_DIMENSION;
}
for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) size[i] = 0;
for (i = 0; i < dim_max; ++i) {
size[i] = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
}
/* Recursive decode seq typecode */
increment_dissection_depth(pinfo);
/*offset += */rtps_util_add_typecode(tree, tvb, pinfo, offset, encoding,
indent_level, is_pointer, bitfield, is_key, offset_begin,
name, -1, size, ndds_40_hack);
decrement_dissection_depth(pinfo);
/* Differently from the other typecodes, the line has been already printed */
return retVal;
}
case RTI_CDR_TK_ALIAS: {
/* Structure of the typecode data:
*
* - A4: 4: alias name size
* - A4: 4: alias name
* - A4: 4: the alias typecode
*/
uint32_t alias_name_length;
uint8_t *alias_name;
LONG_ALIGN(offset);
alias_name_length = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
alias_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, alias_name_length, ENC_ASCII);
offset = check_offset_addition(offset, alias_name_length, tree, NULL, tvb);
(void) g_strlcpy(type_name, alias_name, sizeof(type_name));
break;
}
/*
* VALUETYPES:
* - A4: 4: name length
* - n: name
* - A2: type modifier
* - A4: base type code
* - A4: number of members
* Foreach member: (it's just like a struct)
*
*/
case RTI_CDR_TK_VALUE_PARAM:
case RTI_CDR_TK_VALUE: {
/* Not fully dissected for now */
/* Pad-align */
uint32_t value_name_len;
int8_t *value_name;
const char *type_id_name = "valuetype";
LONG_ALIGN(offset);
/* Get structure name length */
value_name_len = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
/* value name */
value_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset, value_name_len, ENC_ASCII);
offset = check_offset_addition(offset, value_name_len, tree, NULL, tvb);
if (tk_id == RTI_CDR_TK_VALUE_PARAM) {
type_id_name = "valueparam";
}
snprintf(type_name, sizeof(type_name), "%s '%s'", type_id_name, value_name);
break;
}
} /* switch(tk_id) */
/* Sequence print */
if (seq_max_len != -1) {
proto_tree_add_string_format(tree, hf_rtps_sequence, tvb, offset_begin, (offset-offset_begin), type_name,
"%ssequence<%s, %d> %s%s;%s", indent_string, type_name, seq_max_len,
is_pointer ? "*" : "",
name ? name : "",
is_key ? KEY_COMMENT : "");
return retVal;
}
/* Array print */
if (arr_dimension != NULL) {
/* Printing an array */
wmem_strbuf_t *dim_str = wmem_strbuf_create(wmem_packet_scope());
for (i = 0; i < MAX_ARRAY_DIMENSION; ++i) {
if (arr_dimension[i] != 0) {
wmem_strbuf_append_printf(dim_str, "[%d]", arr_dimension[i]);
} else {
break;
}
}
proto_tree_add_string_format(tree, hf_rtps_array, tvb, offset_begin, (offset-offset_begin), type_name,
"%s%s %s%s;%s", indent_string, type_name, name ? name : "",
wmem_strbuf_get_str(dim_str), is_key ? KEY_COMMENT : "");
return retVal;
}
/* Bitfield print */
if (bitfield != 0xffff && name != NULL && is_pointer == 0) {
proto_tree_add_string_format(tree, hf_rtps_bitfield, tvb, offset_begin, (offset-offset_begin), type_name,
"%s%s %s:%d;%s", indent_string, type_name, name,
bitfield, is_key ? KEY_COMMENT : "");
return retVal;
}
/* Everything else */
proto_tree_add_string_format(tree, hf_rtps_datatype, tvb, offset_begin, (offset-offset_begin), type_name,
"%s%s%s%s%s;%s", indent_string, type_name,
name ? " " : "",
is_pointer ? "*" : "",
name ? name : "",
is_key ? KEY_COMMENT : "");
return retVal;
}
static int rtps_util_add_type_id(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding,
int zero, int hf_base, proto_item * append_info_item,
uint64_t * type_id) {
proto_item * ti;
uint16_t short_number;
uint64_t longlong_number;
int hf_type;
short_number = tvb_get_uint16(tvb, offset, encoding);
ti = proto_tree_add_item(tree, hf_rtps_type_object_type_id_disc, tvb, offset, 2, encoding);
proto_item_set_hidden(ti);
/* Here we choose the proper hf item to use */
if (hf_base != -1) {
if (short_number <= 13)
hf_type = hf_rtps_type_object_base_primitive_type_id;
else
hf_type = hf_rtps_type_object_base_type;
} else {
if (short_number <= 13)
hf_type = hf_rtps_type_object_primitive_type_id;
else
hf_type = hf_rtps_type_object_type_id;
}
offset += 2;
if (short_number <= 13) {
proto_tree_add_item(tree, hf_type, tvb, offset, 2, encoding);
if (append_info_item) {
proto_item_append_text(append_info_item, "(%s)",
val_to_str(short_number, type_object_kind, "(0x%016x)"));
}
offset += 2;
} else {
ALIGN_ZERO(offset, 8, zero);
longlong_number = tvb_get_uint64(tvb, offset, encoding);
proto_tree_add_item(tree, hf_type, tvb, offset, 8, encoding);
if (append_info_item) {
proto_item_append_text(append_info_item, "(0x%016" PRIx64 ")", longlong_number);
}
offset += 8;
}
if (short_number <= 13) {
if (type_id) {
*type_id = short_number;
}
} else {
if (type_id) {
*type_id = longlong_number;
}
}
return offset;
}
static int rtps_util_add_type_annotation_usage(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, int zero) {
uint32_t long_number, i;
uint16_t short_number;
offset = rtps_util_add_type_id(tree, tvb, offset, encoding, zero, -1, NULL, NULL);
long_number = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
for (i = 0; i < long_number; i++) {
proto_tree_add_item(tree, hf_rtps_type_object_member_id, tvb, offset, 4, encoding);
offset += 4;
short_number = tvb_get_uint16(tvb, offset, encoding);
proto_tree_add_item(tree, hf_rtps_type_object_annotation_value_d, tvb, offset, 2, encoding);
offset += 2;
/* There may be more additions in the future */
switch (short_number) {
case 4: /* UINT_16 */
proto_tree_add_item(tree, hf_rtps_type_object_annotation_value_16, tvb, offset, 2, encoding);
offset += 2;
break;
default:
break;
}
}
return offset;
}
static int rtps_util_add_type_library_type(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info *info) {
proto_tree * annotation_tree;
uint32_t member_id = 0, member_length = 0, long_number, i;
int offset_tmp;
uint16_t short_number;
char * name = NULL;
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
/* dissect property */
short_number = tvb_get_uint16(tvb, offset_tmp, encoding);
proto_tree_add_bitmask_value(tree, tvb, offset_tmp, hf_rtps_type_object_flags,
ett_rtps_flags, TYPE_FLAG_FLAGS, short_number);
if (info) {
if (short_number & 0x02)
info->extensibility = EXTENSIBILITY_MUTABLE;
else if (short_number & 0x01)
info->extensibility = EXTENSIBILITY_FINAL;
else
info->extensibility = EXTENSIBILITY_EXTENSIBLE;
}
offset_tmp += 2;
if (info)
offset_tmp = rtps_util_add_type_id(tree, tvb, offset_tmp, encoding, offset, -1, tree, &(info->type_id));
else
offset_tmp = rtps_util_add_type_id(tree, tvb, offset_tmp, encoding, offset, -1, tree, NULL);
rtps_util_add_string(tree, tvb, offset_tmp, hf_rtps_type_object_type_property_name,
encoding);
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp+4, long_number, ENC_ASCII);
if (info)
(void) g_strlcpy(info->member_name, name, sizeof(info->member_name));
proto_item_append_text(tree, " %s", name);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
/* dissect annotation_seq */
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
annotation_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
ett_rtps_type_annotation_usage_list, NULL, "Annotation Usage Member List (%d elements)",
long_number);
offset_tmp += 4;
for (i = 0; i < long_number ; i++) {
offset_tmp = rtps_util_add_type_annotation_usage(annotation_tree, tvb, offset_tmp,
encoding, offset);
}
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
return offset;
}
static void rtps_util_add_type_element_enumeration(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
proto_tree * enumerated_constant;
uint32_t member_id = 0, member_length = 0;
uint32_t long_number, i;
int enum_size, offset_tmp;
offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
/* dissect Bound */
proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
/* dissect constant seq */
offset_tmp = offset;
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
offset_tmp += 4;
for (i = 0; i < long_number; i++) {
char * name = NULL;
uint32_t size, value;
enum_size = offset_tmp;
size = tvb_get_uint32(tvb, offset_tmp + 4, encoding);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp + 8, size, ENC_ASCII);
value = tvb_get_uint32(tvb, offset_tmp, encoding);
enumerated_constant = proto_tree_add_subtree_format(tree, tvb, offset_tmp, 0,
ett_rtps_type_enum_constant, NULL, "%s (%u)", name, value);
proto_tree_add_item(enumerated_constant, hf_rtps_type_object_enum_constant_value, tvb, offset_tmp, 4, encoding);
offset_tmp += 4;
offset_tmp = rtps_util_add_string(enumerated_constant, tvb, offset_tmp, hf_rtps_type_object_enum_constant_name, encoding);
proto_item_set_len(enumerated_constant, offset_tmp - enum_size);
}
info->num_elements = 0;
}
static void rtps_util_add_type_element_sequence(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
uint32_t member_id = 0, member_length = 0;
int zero_alignment;
offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
zero_alignment = offset;
rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1 , NULL, &(info->base_type_id));
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
/* dissect Bound */
proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding);
if (info)
info->bound = tvb_get_int32(tvb, offset, encoding);
}
static void rtps_util_add_type_element_string(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info _U_) {
uint32_t member_id = 0, member_length = 0;
int zero_alignment;
offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
zero_alignment = offset;
rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1, NULL, NULL);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
/* dissect Bound */
proto_tree_add_item(tree, hf_rtps_type_object_bound, tvb, offset, 4, encoding);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
}
static void rtps_util_add_type_element_array(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info _U_) {
proto_tree * bound_tree;
uint32_t member_id = 0, member_length = 0;
uint32_t long_number, i;
int zero_alignment, offset_tmp;
offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
/* Dissect Collection Type */
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
zero_alignment = offset;
rtps_util_add_type_id(tree, tvb, offset, encoding, zero_alignment, -1, NULL, &(info->base_type_id));
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
proto_tree_add_item(tree, hf_rtps_type_object_element_shared, tvb, offset, 1, encoding);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
/* dissect Bound sequence */
offset_tmp = offset;
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
bound_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
ett_rtps_type_bound_list, NULL, "Bounds (%d elements)",
long_number);
offset_tmp += 4;
for (i = 0; i < long_number ; i++) {
proto_tree_add_item(bound_tree, hf_rtps_type_object_bound, tvb, offset_tmp, 4, encoding);
if (info) info->bound = tvb_get_int32(tvb, offset_tmp, encoding);
if (info) info->num_elements = tvb_get_int32(tvb, offset_tmp, encoding);
offset_tmp += 4;
}
}
static void rtps_util_add_type_element_alias(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
uint32_t member_id = 0, member_length = 0;
offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
/* dissect base_type */
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
rtps_util_add_type_id(tree, tvb, offset, encoding, offset, hf_rtps_type_object_base_type, NULL, &(info->base_type_id));
}
static int rtps_util_add_type_member(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding,
dissection_info * info, dissection_element * member_object) {
proto_tree * member_property, *annotation_tree;
uint32_t member_id = 0, member_length = 0;
uint32_t long_number, i;
uint16_t short_number;
uint64_t member_type_id;
int offset_tmp;
char * name = NULL;
member_property = proto_tree_add_subtree(tree, tvb, offset, 0,
ett_rtps_type_element, NULL, "Member Property");
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
short_number = tvb_get_uint16(tvb, offset_tmp, encoding);
proto_tree_add_bitmask_value(member_property, tvb, offset_tmp, hf_rtps_type_object_flags,
ett_rtps_flags, MEMBER_FLAGS, short_number);
if (member_object) member_object->flags = short_number;
offset_tmp += 2;
ALIGN_ZERO(offset_tmp, 4, offset);
proto_tree_add_item(member_property, hf_rtps_type_object_member_id, tvb, offset_tmp, 4, encoding);
member_id = tvb_get_uint32(tvb, offset_tmp, encoding);
offset_tmp += 4;
offset_tmp = rtps_util_add_type_id(member_property, tvb, offset_tmp, encoding,
offset, -1, tree, &member_type_id);
rtps_util_add_string(member_property, tvb, offset_tmp, hf_rtps_type_object_name, encoding);
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset_tmp+4, long_number, ENC_ASCII);
proto_item_append_text(tree, " %s (ID: %d)", name, member_id);
if (member_object) {
member_object->member_id = member_id;
(void) g_strlcpy(member_object->member_name, name, sizeof(member_object->member_name));
member_object->type_id = member_type_id;
}
if (info && info->extensibility == EXTENSIBILITY_MUTABLE) {
mutable_member_mapping * mutable_mapping = NULL;
mutable_mapping = wmem_new(wmem_file_scope(), mutable_member_mapping);
(void) g_strlcpy(mutable_mapping->member_name, name, sizeof(mutable_mapping->member_name));
mutable_mapping->struct_type_id = info->type_id;
mutable_mapping->member_type_id = member_type_id;
mutable_mapping->member_id = member_id;
mutable_mapping->key = (mutable_mapping->struct_type_id + mutable_mapping->struct_type_id * mutable_mapping->member_id);
proto_item_append_text(tree, "(Inserted 0x%016" PRIx64 " from 0x%016" PRIx64 ")", mutable_mapping->key, mutable_mapping->struct_type_id);
wmem_map_insert(mutable_member_mappings, &(mutable_mapping->key), (void *) mutable_mapping);
}
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
annotation_tree = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
ett_rtps_type_annotation_usage_list, NULL, "Annotation Usage Member List (%d elements)",
long_number);
offset_tmp += 4;
for (i = 0; i < long_number ; i++) {
offset_tmp = rtps_util_add_type_annotation_usage(annotation_tree, tvb, offset_tmp,
encoding, offset);
}
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
long_number = tvb_get_uint32(tvb, offset, encoding);
if ((long_number & PID_LIST_END) == PID_LIST_END) {
offset += 4;
}
return offset;
}
static int rtps_util_add_type_union_member(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, uint64_t union_type_id,
bool is_discriminator, dissection_info * info _U_) {
proto_tree * labels;
int long_number, i;
int offset_tmp;
uint32_t member_id = 0, member_length = 0;
dissection_element object;
offset = rtps_util_add_type_member(tree, tvb, offset, encoding, NULL, &object); //&(info->elements[i])
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
labels = proto_tree_add_subtree_format(tree, tvb, offset_tmp, member_length,
ett_rtps_type_enum_constant, NULL, "Labels (%u elements)", long_number);
offset_tmp += 4;
if ((object.flags & 8) == 8) {
union_member_mapping * mapping = NULL;
mapping = wmem_new(wmem_file_scope(), union_member_mapping);
(void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name));
mapping->member_type_id = object.type_id;
mapping->discriminator = HASHMAP_DISCRIMINATOR_CONSTANT;
mapping->union_type_id = union_type_id + mapping->discriminator;
wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping);
proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s",
mapping->union_type_id, mapping->member_name);
}
if (is_discriminator) {
union_member_mapping * mapping = NULL;
mapping = wmem_new(wmem_file_scope(), union_member_mapping);
(void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name));
mapping->member_type_id = object.type_id;
mapping->discriminator = -1;
mapping->union_type_id = union_type_id + mapping->discriminator;
wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping);
proto_item_append_text(labels, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s",
mapping->union_type_id, mapping->member_name);
}
for (i = 0; i < long_number; i++) {
proto_item * ti;
union_member_mapping * mapping = NULL;
uint32_t discriminator_case;
mapping = wmem_new(wmem_file_scope(), union_member_mapping);
discriminator_case = tvb_get_uint32(tvb, offset_tmp, encoding);
ti = proto_tree_add_item(labels, hf_rtps_type_object_union_label, tvb, offset_tmp, 4, encoding);
offset_tmp += 4;
(void) g_strlcpy(mapping->member_name, object.member_name, sizeof(mapping->member_name));
mapping->member_type_id = object.type_id;
mapping->discriminator = discriminator_case;
mapping->union_type_id = union_type_id + discriminator_case;
wmem_map_insert(union_member_mappings, &(mapping->union_type_id), (void *) mapping);
proto_item_append_text(ti, " Added mapping for discriminator (0x%016" PRIx64 ") name = %s",
mapping->union_type_id, mapping->member_name);
}
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
if ((long_number & PID_LIST_END) == PID_LIST_END) {
offset += 4;
}
return offset;
}
static void rtps_util_add_type_element_union(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
proto_tree * members;
uint32_t member_id = 0, member_length = 0;
uint32_t long_number, i;
int offset_tmp;
offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
members = proto_tree_add_subtree(tree, tvb, offset_tmp, -1,
ett_rtps_type_enum_constant, NULL, "Members");
offset_tmp += 4;
for (i = 0; i < long_number; i++) {
proto_tree * member = NULL;
int offset_member = offset_tmp;
member = proto_tree_add_subtree(members, tvb, offset_tmp, 0,
ett_rtps_type_enum_constant, NULL, "Member");
offset_tmp = rtps_util_add_type_union_member(member, tvb, offset_tmp, encoding,
info->type_id, (i == 0), info);
proto_item_set_len(member, offset_tmp - offset_member);
}
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
if ((long_number & PID_LIST_END) == PID_LIST_END) {
offset_tmp += 4;
}
proto_item_set_len(members, offset_tmp - offset);
}
static void rtps_util_add_type_element_struct(proto_tree *tree,
tvbuff_t * tvb, int offset, const unsigned encoding, dissection_info * info) {
proto_tree * member;
uint32_t member_id = 0, member_length = 0;
uint32_t long_number, i;
int offset_tmp, member_size;
wmem_array_t *elements = NULL;
dissection_element zero_element = {0};
offset = rtps_util_add_type_library_type(tree, tvb, offset, encoding, info);
/* dissect base_type */
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset = rtps_util_add_type_id(tree, tvb, offset, encoding, offset, hf_rtps_type_object_base_type, NULL, &(info->base_type_id));
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
/* dissect seq_member*/
offset_tmp = offset;
long_number = tvb_get_uint32(tvb, offset_tmp, encoding);
offset_tmp += 4;
if (info) {
elements = wmem_array_sized_new(wmem_file_scope(), sizeof(dissection_element), MIN(long_number, DISSECTION_INFO_MAX_ELEMENTS_DEFAULT_VALUE));
}
for (i = 0; i < long_number; i++) {
member_size = offset_tmp;
member = proto_tree_add_subtree(tree, tvb, offset_tmp, 0,
ett_rtps_type_enum_constant, NULL, "");
if (info && elements) {
wmem_array_append_one(elements, zero_element);
offset_tmp = rtps_util_add_type_member(member, tvb, offset_tmp, encoding, info, wmem_array_index(elements, i));
} else {
offset_tmp = rtps_util_add_type_member(member, tvb, offset_tmp, encoding, NULL, NULL);
}
proto_item_set_len(member, offset_tmp - member_size);
}
if (info) {
info->num_elements = wmem_array_get_count(elements);
info->elements = wmem_array_finalize(elements);
}
}
static void rtps_util_add_type_library(proto_tree *tree, packet_info * pinfo,
tvbuff_t * tvb, int offset, const unsigned encoding, uint32_t size);
// NOLINTNEXTLINE(misc-no-recursion)
static void rtps_util_add_type_element_module(proto_tree *tree, packet_info * pinfo,
tvbuff_t * tvb, int offset, const unsigned encoding) {
uint32_t long_number;
char * name = NULL;
long_number = tvb_get_uint32(tvb, offset, encoding);
name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, long_number, ENC_ASCII);
proto_item_set_text(tree, "module %s", name);
offset = rtps_util_add_string(tree, tvb, offset, hf_rtps_type_object_element_module_name, encoding);
rtps_util_add_type_library(tree, pinfo, tvb, offset, encoding, -1);
}
// NOLINTNEXTLINE(misc-no-recursion)
static int rtps_util_add_type_library_element(proto_tree *tree, packet_info * pinfo,
tvbuff_t * tvb, int offset, const unsigned encoding) {
proto_tree * element_tree;
uint32_t long_number;
uint32_t member_id = 0, member_length = 0;
int initial_offset = offset;
dissection_info * info;
bool add_info = true;
info = wmem_new(wmem_file_scope(), dissection_info);
info->elements = NULL;
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
long_number = tvb_get_uint32(tvb, offset, encoding);
info->member_kind = long_number;
element_tree = proto_tree_add_subtree(tree, tvb, offset, 0,
ett_rtps_type_element, NULL, "");
offset = check_offset_addition(offset, member_length, tree, pinfo, tvb);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
proto_item_set_len(element_tree, member_length + offset - initial_offset);
switch (long_number) {
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ENUMERATION_TYPE: /*ENUMERATION */
rtps_util_add_type_element_enumeration(element_tree, tvb, offset, encoding, info);
break;
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ALIAS_TYPE: /* ALIAS */
rtps_util_add_type_element_alias(element_tree, tvb, offset, encoding, info);
break;
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE: /* ARRAY */
rtps_util_add_type_element_array(element_tree, tvb, offset, encoding, info);
break;
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE: /* SEQUENCE */
rtps_util_add_type_element_sequence(element_tree, tvb, offset, encoding, info);
break;
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRING_TYPE: /* STRING : COLLECTION */
rtps_util_add_type_element_string(element_tree, tvb, offset, encoding, info);
break;
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_UNION_TYPE:
rtps_util_add_type_element_union(element_tree, tvb, offset, encoding, info);
break;
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE: /* STRUCT */
rtps_util_add_type_element_struct(element_tree, tvb, offset, encoding, info);
break;
case RTI_CDR_TYPE_OBJECT_TYPE_KIND_MODULE:
/* This does *not* fill in the info structure, so do *not* add it. */
add_info = false;
rtps_util_add_type_element_module(element_tree, pinfo, tvb, offset, encoding);
break;
default:
/* We have *not* filled in the info structure, so do *not* add it. */
add_info = false;
proto_item_append_text(element_tree, "Kind: %u", long_number);
proto_tree_add_item(element_tree, hf_rtps_type_object_element_raw, tvb, offset,
member_length, encoding);
break;
}
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
LONG_ALIGN(offset);
long_number = tvb_get_uint32(tvb, offset, encoding);
if ((long_number & PID_LIST_END) != PID_LIST_END) {
expert_add_info_format(pinfo, element_tree, &ei_rtps_parameter_value_invalid,
"Now it should be PID_LIST_END and it is not"); \
}
offset += 4;
proto_item_set_len(element_tree, offset - initial_offset);
if (add_info) {
wmem_map_insert(dissection_infos, &(info->type_id), (void *) info);
}
return offset;
}
// NOLINTNEXTLINE(misc-no-recursion)
static void rtps_util_add_type_library(proto_tree *tree, packet_info * pinfo,
tvbuff_t * tvb, int offset, const unsigned encoding, uint32_t size) {
proto_tree * library_tree;
uint32_t long_number, i;
long_number = tvb_get_uint32(tvb, offset, encoding);
library_tree = proto_tree_add_subtree_format(tree, tvb, offset, size,
ett_rtps_type_library, NULL, "Type Library (%d elements)", long_number);
offset += 4;
increment_dissection_depth(pinfo);
for (i = 0; i < long_number; i++) {
offset = rtps_util_add_type_library_element(library_tree, pinfo, tvb,
offset, encoding);
}
decrement_dissection_depth(pinfo);
}
static void rtps_util_add_typeobject(proto_tree *tree, packet_info * pinfo,
tvbuff_t * tvb, int offset, const unsigned encoding, uint32_t size,
type_mapping * type_mapping_object ) {
proto_tree * typeobject_tree;
int offset_tmp = 0;
uint32_t member_id = 0, member_length = 0;
uint32_t long_number;
uint64_t type_id;
typeobject_tree = proto_tree_add_subtree(tree, tvb, offset, size,
ett_rtps_type_object, NULL, "Type Object");
/* --- This is the standard parameterized serialization --- */
/* TypeLibrary */
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
/* Dissect the member */
rtps_util_add_type_library(typeobject_tree, pinfo, tvb, offset_tmp, encoding, member_length);
offset = check_offset_addition(offset, member_length, tree, pinfo, tvb);
/* End TypeLibrary */
/* _TypeId */
rtps_util_dissect_parameter_header(tvb, &offset, encoding, &member_id, &member_length);
offset_tmp = offset;
/* Dissect the member. In this case, the typeid is an union with a short
* as a discriminator*/
rtps_util_add_type_id(typeobject_tree, tvb, offset_tmp, encoding, offset, -1, NULL, &type_id);
if (type_mapping_object) type_mapping_object->type_id = type_id;
offset = check_offset_addition(offset, member_length, tree, pinfo, tvb);
/* End _TypeId */
long_number = tvb_get_uint32(tvb, offset, encoding);
if ((long_number & PID_LIST_END) != PID_LIST_END) {
expert_add_info_format(pinfo, typeobject_tree, &ei_rtps_parameter_value_invalid,
"This should be PID_LIST_END and it is not"); \
}
}
#if defined (HAVE_ZLIB) || defined (HAVE_ZLIBNG)
static void rtps_add_zlib_compressed_typeobject(proto_tree *tree, packet_info * pinfo,
tvbuff_t * tvb, int offset, const unsigned encoding, unsigned compressed_size,
unsigned decompressed_size, type_mapping * type_mapping_object) {
tvbuff_t *decompressed_data_child_tvb;
tvbuff_t *compressed_type_object_subset;
proto_tree *decompressed_type_object_subtree;
compressed_type_object_subset = tvb_new_subset_length(tvb, offset, decompressed_size);
decompressed_data_child_tvb = tvb_child_uncompress_zlib(tvb, compressed_type_object_subset, 0, compressed_size);
if (decompressed_data_child_tvb) {
decompressed_type_object_subtree = proto_tree_add_subtree(tree, decompressed_data_child_tvb,
0, 0, ett_rtps_decompressed_type_object, NULL, "[Uncompressed type object]");
rtps_util_add_typeobject(decompressed_type_object_subtree, pinfo,
decompressed_data_child_tvb, 0, encoding, decompressed_size, type_mapping_object);
}
else {
proto_tree_add_subtree(tree, compressed_type_object_subset,
0, 0, ett_rtps_decompressed_type_object, NULL, "[Failed to decompress type object]");
}
}
#else
static void rtps_add_zlib_compressed_typeobject(proto_tree *tree _U_, packet_info * pinfo _U_,
tvbuff_t * tvb _U_, int offset _U_, const unsigned encoding _U_, unsigned compressed_size _U_,
unsigned decompressed_size _U_, type_mapping * type_mapping_object _U_)
{
}
#endif
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as Sequence of
* Octets.
* The formatted buffer is: [ 0x01, 0x02, 0x03, 0x04, ...]
* The maximum number of elements displayed is 10, after that a '...' is
* inserted.
*/
static int rtps_util_add_seq_octets(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, const unsigned encoding, int param_length, int hf_id) {
uint32_t seq_length;
proto_item *ti;
ti = proto_tree_add_item_ret_uint(tree, hf_rtps_sequence_size, tvb, offset, 4, encoding, &seq_length);
offset += 4;
/* param length -1 means not specified */
if (param_length != -1 && param_length < 4 + (int)seq_length) {
expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "ERROR: Parameter value too small");
return offset + seq_length;
}
if (seq_length) {
proto_tree_add_item(tree, hf_id, tvb, offset, seq_length, ENC_NA);
}
return offset + seq_length;
}
static int rtps_util_add_data_holder(proto_tree *tree, tvbuff_t * tvb, packet_info * pinfo,
int offset, const unsigned encoding, int seq_index, int alignment_zero) {
proto_tree * data_holder_tree, * properties_tree, * property_tree;
proto_item * tii, * ti, * data_holder;
uint32_t seq_size, i;
int offset_tmp, data_holder_begin;
data_holder_tree = proto_tree_add_subtree_format(tree, tvb, offset,
-1, ett_rtps_data_holder, &data_holder, "Data Holder [%d]", seq_index);
data_holder_begin = offset;
offset = rtps_util_add_string(data_holder_tree, tvb, offset,
hf_rtps_pgm_data_holder_class_id, encoding);
LONG_ALIGN_ZERO(offset, alignment_zero);
offset_tmp = offset;
properties_tree = proto_tree_add_subtree_format(data_holder_tree, tvb, offset,
-1, ett_rtps_data_holder_properties, &tii, "String Properties");
seq_size = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
for(i = 0; i < seq_size; i++) {
int local_offset = offset;
property_tree = proto_tree_add_subtree_format(properties_tree, tvb, offset,
-1, ett_rtps_property_tree, &ti, "Property [%d]", i);
offset = rtps_util_add_string(property_tree, tvb, offset,
hf_rtps_property_name, encoding);
offset = rtps_util_add_string(property_tree, tvb, offset,
hf_rtps_property_value, encoding);
proto_item_set_len(ti, offset - local_offset);
}
proto_item_set_len(tii, offset - offset_tmp);
offset_tmp = offset;
properties_tree = proto_tree_add_subtree_format(data_holder_tree, tvb, offset,
-1, ett_rtps_data_holder_properties, &tii, "Binary Properties");
seq_size = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
for(i = 0; i < seq_size; i++) {
int local_offset = offset;
LONG_ALIGN(offset);
property_tree = proto_tree_add_subtree_format(properties_tree, tvb, offset,
-1, ett_rtps_property_tree, &ti, "Property [%d]", i);
offset = rtps_util_add_string(property_tree, tvb, offset,
hf_rtps_property_name, encoding);
offset = rtps_util_add_seq_octets(property_tree, pinfo, tvb, offset,
encoding, -1, hf_rtps_param_user_data);
proto_item_set_len(ti, offset - local_offset);
}
proto_item_set_len(tii, offset - offset_tmp);
proto_item_set_len(data_holder, offset - offset_tmp);
proto_item_set_len(data_holder, offset - data_holder_begin);
return offset;
}
static int rtps_util_add_data_holder_seq(proto_tree *tree, tvbuff_t * tvb,
packet_info * pinfo, int offset, const unsigned encoding, int alignment_zero) {
proto_tree * data_holder_seq_tree;
proto_item * ti;
uint32_t seq_length;
uint32_t i;
data_holder_seq_tree = proto_tree_add_subtree(tree, tvb, offset,
-1, ett_rtps_data_holder_seq, &ti, "Data Holder Sequence");
seq_length = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
for(i = 0; i < seq_length; i++) {
offset = rtps_util_add_data_holder(data_holder_seq_tree, tvb, pinfo, offset,
encoding, i, alignment_zero);
}
return offset;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as a Bitmap
* struct {
* SequenceNumber_t bitmapBase;
* sequence<long, 8> bitmap;
* } SequenceNumberSet;
*
* Returns the new offset after reading the bitmap.
*/
static int rtps_util_add_bitmap(proto_tree *tree,
tvbuff_t *tvb,
int offset,
const unsigned encoding,
const char *label,
bool show_analysis) {
int32_t num_bits;
uint32_t data;
wmem_strbuf_t *temp_buff = wmem_strbuf_create(wmem_packet_scope());
wmem_strbuf_t *analysis_buff = wmem_strbuf_create(wmem_packet_scope());
int i, j, idx;
char *last_one;
proto_item *ti = NULL, *ti_tree = NULL;
proto_tree *bitmap_tree;
const int original_offset = offset;
uint32_t datamask;
uint64_t first_seq_number;
bool first_nack = true;
bitmap_tree = proto_tree_add_subtree(tree, tvb, original_offset, offset-original_offset,
ett_rtps_bitmap, &ti_tree, label);
/* Bitmap base sequence number */
first_seq_number = rtps_util_add_seq_number(bitmap_tree, tvb, offset, encoding, "bitmapBase");
offset += 8;
/* Reads the bitmap size */
proto_tree_add_item_ret_uint(bitmap_tree, hf_rtps_bitmap_num_bits, tvb, offset, 4, encoding, &num_bits);
offset += 4;
/* bitmap base 0 means that this is a preemptive ACKNACK */
if (first_seq_number == 0 && show_analysis) {
ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0,
1, "Acknack Analysis: Preemptive ACKNACK");
proto_item_set_generated(ti);
}
if (first_seq_number > 0 && num_bits == 0 && show_analysis) {
ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0,
2, "Acknack Analysis: Expecting sample %" PRIu64, first_seq_number);
proto_item_set_generated(ti);
}
if (num_bits > 0 && show_analysis) {
ti = proto_tree_add_uint_format(bitmap_tree, hf_rtps_acknack_analysis, tvb, 0, 0,
3, "Acknack Analysis: Lost samples");
proto_item_set_generated(ti);
}
/* Reads the bits (and format the print buffer) */
idx = 0;
for (i = 0; i < num_bits; i += 32) {
data = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
for (j = 0; j < 32; ++j) {
datamask = (1U << (31-j));
wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0');
if ((data & datamask) == datamask) {
proto_item_append_text(ti,
first_nack ? " %" PRIu64 : ", %" PRIu64,
first_seq_number + idx);
first_nack = false;
}
++idx;
if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) {
break;
}
}
}
/* removes all the ending '0' */
last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1');
if (last_one) {
wmem_strbuf_truncate(temp_buff, (size_t) (last_one - wmem_strbuf_get_str(temp_buff)) + 1);
}
if (wmem_strbuf_get_len(temp_buff) > 0) {
proto_tree_add_bytes_format_value(bitmap_tree, hf_rtps_bitmap, tvb,
original_offset + 12, offset - original_offset - 12,
NULL, "%s", wmem_strbuf_get_str(temp_buff));
}
proto_item_set_len(ti_tree, offset-original_offset);
/* Add analysis of the information */
if (num_bits > 0 && show_analysis) {
proto_item_append_text(ti, "%s in range [%" PRIu64 ",%" PRIu64 "]",
wmem_strbuf_get_str(analysis_buff), first_seq_number, first_seq_number + num_bits - 1);
}
return offset;
}
/* ------------------------------------------------------------------------- */
/* Insert in the protocol tree the next bytes interpreted as a FragmentNumberSet
* typedef unsigned long FragmentNumber_t;
* struct {
* FragmentNumber_t bitmapBase;
* sequence<FragmentNumber_t> bitmap;
* } FragmentNumberSet;
*
* Returns the new offset after reading the bitmap.
*/
static int rtps_util_add_fragment_number_set(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, const unsigned encoding, const char *label, int section_size) {
uint64_t base;
int32_t num_bits;
uint32_t data;
wmem_strbuf_t *temp_buff = wmem_strbuf_create(wmem_packet_scope());
char *last_one;
int i, j, idx;
proto_item *ti;
proto_tree *bitmap_tree;
const int original_offset = offset;
uint32_t datamask;
int expected_size;
int base_size;
bitmap_tree = proto_tree_add_subtree(tree, tvb, original_offset, offset-original_offset, ett_rtps_bitmap, &ti, label);
/* RTI DDS 4.2d was sending the FragmentNumber_t as a 64-bit long integer
* instead of 32-bit long.
* Attempt to decode this section as 32-bit, then check if the size of the
* message match what is here. If not re-decode it as 64-bit.
*/
num_bits = tvb_get_uint32(tvb, offset+4, encoding);
expected_size = ((num_bits + 31) / 32) * 4 + 8;
if (expected_size == section_size) {
base = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
base_size = 4;
offset += 8;
} else {
/* Attempt to use 64-bit for base */
num_bits = tvb_get_uint32(tvb, offset+8, encoding);
/* num_bits/8 must be aligned to the 4-byte word */
expected_size = (((num_bits / 8) + 3) / 4) * 4 + 12;
if (expected_size == section_size) {
uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset+4, encoding);
base = (hi << 32) | lo;
base_size = 8;
offset += 12;
} else {
/* size don't match, packet error */
expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Illegal size for fragment number set");
return -1;
}
}
/* Reads the bits (and format the print buffer) */
idx = 0;
for (i = 0; i < num_bits; i += 32) {
data = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
for (j = 0; j < 32; ++j) {
datamask = (1U << (31-j));
wmem_strbuf_append_c(temp_buff, ((data & datamask) == datamask) ? '1':'0');
++idx;
if ((idx >= num_bits) || (wmem_strbuf_get_len(temp_buff) >= (ITEM_LABEL_LENGTH - 1))) {
break;
}
}
}
/* removes all the ending '0' */
last_one = strrchr(wmem_strbuf_get_str(temp_buff), '1');
if (last_one) {
wmem_strbuf_truncate(temp_buff, (size_t) (last_one - wmem_strbuf_get_str(temp_buff)));
}
if (base_size == 8) {
proto_tree_add_uint64(bitmap_tree, hf_rtps_fragment_number_base64, tvb, original_offset, 8,
base);
} else {
proto_tree_add_item(bitmap_tree, hf_rtps_fragment_number_base, tvb, original_offset, base_size, encoding);
}
proto_tree_add_uint(bitmap_tree, hf_rtps_fragment_number_num_bits, tvb, original_offset + base_size, 4, num_bits);
if (wmem_strbuf_get_len(temp_buff) > 0) {
proto_tree_add_bytes_format_value(bitmap_tree, hf_rtps_bitmap, tvb, original_offset + base_size + 4, offset - original_offset - base_size - 4,
NULL, "%s", wmem_strbuf_get_str(temp_buff));
}
proto_item_set_len(ti, offset-original_offset);
return offset;
}
static void rtps_util_insert_type_mapping_in_registry(packet_info *pinfo, type_mapping *type_mapping_object) {
if (type_mapping_object) {
if ((type_mapping_object->fields_visited & TOPIC_INFO_ALL_SET) == TOPIC_INFO_ALL_SET &&
type_mapping_object->guid.fields_present == GUID_HAS_ALL &&
!wmem_map_lookup(registry, &(type_mapping_object->guid))) {
if (((type_mapping_object->guid.entity_id & 0x02) == 0x02) || ((type_mapping_object->guid.entity_id & 0x04) == 0x04)){
/* If it is an application defined writer matches 0x02. Matches 0x04 if it is an application defined reader */
type_mapping_object->dcps_publication_frame_number = pinfo->num;
wmem_map_insert(registry, &(type_mapping_object->guid), type_mapping_object);
}
}
}
}
static void rtps_util_store_type_mapping(packet_info *pinfo _U_, tvbuff_t *tvb, int offset,
type_mapping * type_mapping_object, const char * value,
int topic_info_add_id) {
if (enable_topic_info && type_mapping_object) {
switch (topic_info_add_id) {
case TOPIC_INFO_ADD_GUID: {
type_mapping_object->guid.host_id = tvb_get_ntohl(tvb, offset);
type_mapping_object->guid.app_id = tvb_get_ntohl(tvb, offset+4);
type_mapping_object->guid.instance_id = tvb_get_ntohl(tvb, offset+8);
type_mapping_object->guid.entity_id = tvb_get_ntohl(tvb, offset+12);
type_mapping_object->guid.fields_present |=
GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID|GUID_HAS_ENTITY_ID;
type_mapping_object->fields_visited =
type_mapping_object->fields_visited | TOPIC_INFO_ADD_GUID;
break;
}
case TOPIC_INFO_ADD_TOPIC_NAME: {
rtps_strlcpy(type_mapping_object->topic_name, value, MAX_TOPIC_AND_TYPE_LENGTH);
type_mapping_object->fields_visited =
type_mapping_object->fields_visited | TOPIC_INFO_ADD_TOPIC_NAME;
break;
}
case TOPIC_INFO_ADD_TYPE_NAME: {
rtps_strlcpy(type_mapping_object->type_name, value, MAX_TOPIC_AND_TYPE_LENGTH);
type_mapping_object->fields_visited =
type_mapping_object->fields_visited | TOPIC_INFO_ADD_TYPE_NAME;
break;
}
default:
break;
}
}
}
static unsigned hash_by_participant_guid(const void *key) {
const endpoint_guid* guid = (const endpoint_guid*)key;
int vals[] = { guid->host_id, guid->app_id, guid->instance_id };
GBytes* gbytes = g_bytes_new(vals, sizeof(vals));
unsigned hash = g_bytes_hash(gbytes);
g_bytes_unref(gbytes);
return hash;
}
static unsigned hash_by_guid(const void *key) {
const endpoint_guid * guid = (const endpoint_guid *) key;
DISSECTOR_ASSERT(guid->fields_present & GUID_HAS_APP_ID);
return g_int_hash(&(guid->app_id));
}
static gboolean compare_by_guid(const void *guid_a, const void *guid_b) {
return memcmp(guid_a, guid_b, sizeof(endpoint_guid)) == 0;
}
static gboolean compare_by_participant_guid(const void *guid_a, const void *guid_b) {
const endpoint_guid* a = (const endpoint_guid*)guid_a;
const endpoint_guid* b = (const endpoint_guid*)guid_b;
return ((a->host_id == b->host_id) && (a->app_id == b->app_id) && (a->instance_id == b->instance_id));
}
static unsigned get_domain_id_from_tcp_discovered_participants(wmem_map_t *map, endpoint_guid* key) {
participant_info *p_info = (participant_info*)wmem_map_lookup(map, (void*)key);
return (p_info != NULL) ? p_info->domainId: RTPS_UNKNOWN_DOMAIN_ID_VAL;
}
static unsigned coherent_set_key_hash_by_key(const void *key) {
return wmem_strong_hash((const uint8_t *)key, sizeof(coherent_set_key));
}
static gboolean compare_by_coherent_set_key(const void *key_a, const void *key_b) {
return memcmp(key_a, key_b, sizeof(coherent_set_key)) == 0;
}
static type_mapping * rtps_util_get_topic_info(endpoint_guid * guid) {
/* At this point, we know the boolean enable_topic_info is true */
type_mapping * result = NULL;
if (guid) {
unsigned entity_id_low = 0xFF & guid->entity_id;
/* If the entity guid low is ENTITYID_NORMAL_META_GROUP_READER or ENTITYID_NORMAL_META_GROUP_WRITER then
* is a builtin endpoint that uses the type InstaneStateResponseData. The type_mapping for this type is not
* available through discovery. It is defined by code in
* initialize_instance_state_data_response_dissection_info function.
*/
if (entity_id_low == ENTITYID_NORMAL_META_GROUP_READER || entity_id_low == ENTITYID_NORMAL_META_GROUP_WRITER) {
result = &builtin_types_dissection_data.type_mappings.instance_state_data_response_type_mapping;
}
else if (guid->fields_present == GUID_HAS_ALL)
result = (type_mapping *)wmem_map_lookup(registry, guid);
}
return result;
}
static void rtps_util_format_typename(char * type_name, char ** output) {
char ** tokens;
char * result_caps;
/* The standard specifies that the max size of a type name
can be 255 bytes */
tokens = wmem_strsplit(wmem_packet_scope(), type_name, "::", 255);
result_caps = wmem_strjoinv(wmem_packet_scope(), "_", tokens);
*output = wmem_ascii_strdown(wmem_packet_scope(), result_caps, -1);
}
/* Adds the topic topic information to the tree and the topic name to the info column.
* Topic name will be added to the info column only if the topic information is stored
* in the "registry map".
* This is used when the packet doesn't contain the topic information (PID_TOPIC_INFORMATION)
*/
static const char* rtps_util_add_topic_info(proto_tree *tree, packet_info* pinfo, tvbuff_t *tvb,
int offset, endpoint_guid * guid) {
const char* topic_name = NULL;
if (enable_topic_info) {
proto_tree * topic_info_tree;
proto_item * ti;
bool is_builtin_type = false;
type_mapping * type_mapping_object = rtps_util_get_topic_info(guid);
/* If it is a builtin type mapping then the information is not taken from discovery data */
is_builtin_type = (type_mapping_object == &builtin_types_dissection_data.type_mappings.instance_state_data_response_type_mapping);
if (type_mapping_object != NULL) {
const char* topic_information_text = (!is_builtin_type) ?
"[Topic Information (from Discovery)]" :
"[Topic Information (BuiltIn type)]";
topic_name = type_mapping_object->topic_name;
if (topic_name != NULL) {
submessage_col_info* current_submessage_col_info = NULL;
topic_info_tree = proto_tree_add_subtree(tree, tvb, offset, 0,
ett_rtps_topic_info, NULL, topic_information_text);
ti = proto_tree_add_string(topic_info_tree, hf_rtps_param_type_name, tvb, offset, 0,
type_mapping_object->type_name);
proto_item_set_generated(ti);
if (!is_builtin_type) {
ti = proto_tree_add_string(topic_info_tree, hf_rtps_param_topic_name, tvb, offset, 0,
topic_name);
proto_item_set_generated(ti);
ti = proto_tree_add_uint(topic_info_tree, hf_rtps_dcps_publication_data_frame_number,
tvb, 0, 0, type_mapping_object->dcps_publication_frame_number);
}
proto_item_set_generated(ti);
current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) {
current_submessage_col_info->topic_name = wmem_strdup(pinfo->pool, topic_name);
}
}
}
}
return topic_name;
}
/* Uncompress data and returns it uncompressed on a new tvb.
*
* @param[in] tree a chunk of data in the tvb and return a new tvb with the uncompressed data
* @param[in] tvb
* @param[in] offset offset at the beginning of the compressed data.
* @param[in] size in bytes from the initial offset to the end of the serialized data
* @param[in] compressed_size size in bytes of the compressed chunk in the tvb.
* @param[out] True if it tries to uncompress the data. In environment where Zlib is not available this will be false. This is used for
* distinguis when the data is not decompressed because Zlib is not available (not warning) and cases where it is but fails (warning).
*
* @return The uncompressed data on a new TVB if everything goes fine. Otherwise NULL
*/
static
tvbuff_t *rtps_util_get_uncompressed_tvb_zlib(
tvbuff_t *tvb _U_,
const int offset _U_,
const unsigned compressed_size _U_,
bool *tried_to_decompress) {
tvbuff_t *uncompressed_tvb = NULL;
#if defined(HAVE_ZLIB) || defined(HAVE_ZLIBNG)
/* If ZLIB is available always try to decompress. */
*tried_to_decompress = true;
uncompressed_tvb = tvb_new_subset_length_caplen(tvb, offset, compressed_size, -1);
uncompressed_tvb = tvb_child_uncompress_zlib(uncompressed_tvb, uncompressed_tvb, 0, compressed_size);
#else
*tried_to_decompress = false;
#endif
return uncompressed_tvb;
}
/*
* 0...2...........8...............16
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | X X X X X X X X X X X | C C C P P |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* X = Unused options bits
* C = Compression bits
* P = Padding bits
* C = 0b111 would be extended compression options which would come in as an
* additional header before the payload.
* C = 0b000 to indicate no compression
*/
/* Dissects the encapsultaion options
*
* @param[in] tree
* @param[in] packet info.
* @param[in] tvb
* @param[in] offset at the beginning of the encapsulation options.
* @param[out] encapsulation_options_out If not null it will contain the encapsulation options
* @param[out] compression_option_out If not null it will contain the compression option
* @param[out] padding_bytes_out If not null it will contain the padding bytes
* @param[out] extended_header_bits_out If not null it will contain the extended header bits
* @return the offset after the encapsulation options
* @note All output parameters are optional.
*/
static
int rtps_util_dissect_encapsulation_options(
proto_tree *tree,
tvbuff_t *tvb,
int offset,
int16_t *encapsulation_options_out,
uint8_t *compression_options_out,
uint8_t *padding_bytes_out,
uint8_t *extended_header_bits_out) {
uint8_t compression_options = 0;
proto_tree *compression_options_subtree = NULL;
int16_t encapsulation_options = 0;
uint8_t padding_bytes = 0;
uint8_t extended_header_bits = 0;
/* Encapsulation length (or option). Always big endian. */
encapsulation_options = tvb_get_int16(tvb, offset, ENC_BIG_ENDIAN);
if (encapsulation_options != 0) {
compression_options_subtree = proto_tree_add_subtree_format(
tree,
tvb,
offset,
2,
ett_rtps_data_encapsulation_options,
NULL,
"Encapsulation options (0x%02x)",
encapsulation_options);
/* If compression options ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE bits are set, the
header contains an extra field */
extended_header_bits = (encapsulation_options
& ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE);
GET_ENCAPSULATION_COMPRESSION_OPTIONS(encapsulation_options, compression_options);
padding_bytes = (encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK);
proto_tree_add_int(
compression_options_subtree,
hf_rtps_encapsulation_options_compression_plugin_class_id,
tvb,
offset + 1,
1,
compression_options);
proto_tree_add_int(
compression_options_subtree,
hf_rtps_padding_bytes,
tvb,
offset + 1,
1,
padding_bytes);
offset += 2;
padding_bytes = encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_PADDING_BYTES_MASK;
} else {
/* Encapsulation length (or option). Always big endian. */
proto_tree_add_item(
tree,
hf_rtps_param_serialize_encap_len,
tvb,
offset,
2,
ENC_BIG_ENDIAN);
offset += 2;
}
/* Set the optional outputs */
if (encapsulation_options_out != NULL) {
*encapsulation_options_out = encapsulation_options;
}
if (compression_options_out != NULL) {
*compression_options_out = compression_options;
}
if (padding_bytes_out != NULL) {
*padding_bytes_out = padding_bytes;
}
if (extended_header_bits_out != NULL) {
*extended_header_bits_out = extended_header_bits;
}
return offset;
}
static bool rtps_util_try_dissector(proto_tree *tree,
packet_info *pinfo, tvbuff_t *tvb, int offset, endpoint_guid * guid,
rtps_dissector_data * data, unsigned encoding, unsigned encoding_version, bool try_dissection_from_type_object) {
if (enable_topic_info) {
type_mapping * type_mapping_object = rtps_util_get_topic_info(guid);
if (type_mapping_object != NULL) {
char * dissector_name = NULL;
tvbuff_t *next_tvb;
dissection_info* info = NULL;
if (try_dissection_from_type_object && enable_user_data_dissection) {
info = lookup_dissection_info_in_custom_and_builtin_types(type_mapping_object->type_id);
if (info != NULL) {
proto_item_append_text(tree, " (TypeId: 0x%016" PRIx64 ")", info->type_id);
return dissect_user_defined(tree, tvb, pinfo, offset, encoding, encoding_version, info,
info->type_id, info->member_name, EXTENSIBILITY_INVALID, offset,
0 /* flags */, 0 /* member_id */, true);
}
}
/* This part tries to dissect the content using a dissector */
next_tvb = tvb_new_subset_remaining(tvb, offset);
rtps_util_format_typename(type_mapping_object->type_name, &dissector_name);
return dissector_try_string(rtps_type_name_table, dissector_name,
next_tvb, pinfo, tree, data);
}
}
/* Return false so the content is dissected by the codepath following this one */
return false;
}
static int rtps_util_add_rti_topic_query_service_request(proto_tree * tree, packet_info *pinfo,
tvbuff_t * tvb, int offset, unsigned encoding) {
/*
struct TopicQuerySelection {
string filter_class_name; //@Optional 0
string filter_expression; // 1
sequence<string> filter_parameters;
}; //@top-level false
//@Extensibility MUTABLE_EXTENSIBILITY
struct TopicQueryData {
TopicQuerySelection topic_query_selection;
SequenceNumber_t sync_sequence_number;
string topic_name;
GUID_t original_related_reader_guid;
}; //@top-level false
//@Extensibility MUTABLE_EXTENSIBILITY
*/
proto_tree * topic_query_tree, * topic_query_selection_tree, *topic_query_filter_params_tree;
proto_item * ti;
uint16_t encapsulation_id, encapsulation_opt;
uint32_t param_id, param_length, param_length_2, num_filter_params;
int alignment_zero, tmp_offset;
uint32_t i;
char* topic_name = NULL;
int topic_name_len = 0;
topic_query_tree = proto_tree_add_subtree(tree, tvb, offset,
0 /* To be defined */, ett_rtps_topic_query_tree, &ti, "Topic Query Data");
/* Encapsulation Id */
encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */
proto_tree_add_uint(topic_query_tree, hf_rtps_encapsulation_id,
tvb, offset, 2, encapsulation_id);
offset += 2;
encoding = get_encapsulation_endianness(encapsulation_id);
/* Encapsulation length (or option) */
encapsulation_opt = tvb_get_ntohs(tvb, offset); /* Always big endian */
proto_tree_add_uint(topic_query_tree, hf_rtps_encapsulation_options, tvb,
offset, 2, encapsulation_opt);
offset += 2;
alignment_zero = offset;
rtps_util_dissect_parameter_header(tvb, &offset, encoding, ¶m_id, ¶m_length);
tmp_offset = offset;
{
/* TopicQuerySelection */
topic_query_selection_tree = proto_tree_add_subtree(topic_query_tree, tvb, tmp_offset,
0 /* To be defined */, ett_rtps_topic_query_selection_tree, &ti, "Topic Query Selection");
SHORT_ALIGN_ZERO(tmp_offset,alignment_zero);
rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, ¶m_id, ¶m_length_2);
if (param_id == 0) { /* Optional string filter_class_name */
LONG_ALIGN_ZERO(tmp_offset, alignment_zero);
rtps_util_add_string(topic_query_selection_tree, tvb, tmp_offset,
hf_rtps_topic_query_selection_filter_class_name, encoding);
}
tmp_offset += param_length_2;
SHORT_ALIGN_ZERO(tmp_offset,alignment_zero);
rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, ¶m_id, ¶m_length_2);
LONG_ALIGN_ZERO(tmp_offset, alignment_zero);
tmp_offset = rtps_util_add_string(topic_query_selection_tree, tvb, tmp_offset,
hf_rtps_topic_query_selection_filter_expression, encoding);
SHORT_ALIGN_ZERO(tmp_offset,alignment_zero);
rtps_util_dissect_parameter_header(tvb, &tmp_offset, encoding, ¶m_id, ¶m_length_2);
num_filter_params = tvb_get_uint32(tvb, tmp_offset, encoding);
proto_tree_add_item(topic_query_selection_tree, hf_rtps_topic_query_selection_num_parameters,
tvb, tmp_offset, 4, encoding);
topic_query_filter_params_tree = proto_tree_add_subtree_format(topic_query_selection_tree, tvb,
tmp_offset + 4, 0 /* To be defined */, ett_rtps_topic_query_filter_params_tree, &ti,
"Filter Parameters (size = %u)", num_filter_params);
tmp_offset += 4;
for (i = 0; i < num_filter_params; ++i) {
uint32_t string_size;
char * retVal;
LONG_ALIGN_ZERO(tmp_offset, alignment_zero);
string_size = tvb_get_uint32(tvb, tmp_offset, encoding);
retVal = tvb_get_string_enc(wmem_packet_scope(), tvb, tmp_offset+4, string_size, ENC_ASCII);
proto_tree_add_string_format(topic_query_filter_params_tree,
hf_rtps_topic_query_selection_filter_parameter, tvb,
tmp_offset, string_size+4, retVal, "%s[%d]: %s", "Filter Parameter", i, retVal);
tmp_offset += (4 + string_size);
}
SHORT_ALIGN_ZERO(tmp_offset, alignment_zero);
tmp_offset += 4;
proto_tree_add_item(topic_query_selection_tree, hf_rtps_topic_query_selection_kind,
tvb, tmp_offset, 4, encoding);
}
offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
SHORT_ALIGN_ZERO(offset,alignment_zero);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, ¶m_id, ¶m_length);
rtps_util_add_seq_number(topic_query_tree, tvb, offset, encoding, "Sync Sequence Number");
offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
SHORT_ALIGN_ZERO(offset,alignment_zero);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, ¶m_id, ¶m_length);
LONG_ALIGN_ZERO(offset, alignment_zero);
topic_name_len = tvb_get_uint32(tvb, offset, encoding);
topic_name = tvb_get_string_enc(wmem_packet_scope(), tvb, offset + 4, topic_name_len, ENC_ASCII);
proto_tree_add_string(topic_query_tree, hf_rtps_topic_query_topic_name, tvb, offset, topic_name_len + 4, topic_name);
if (topic_name != NULL) {
submessage_col_info* current_submessage_col_info = NULL;
current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) {
current_submessage_col_info->topic_name = wmem_strdup(pinfo->pool, topic_name);
}
}
offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
SHORT_ALIGN_ZERO(offset,alignment_zero);
rtps_util_dissect_parameter_header(tvb, &offset, encoding, ¶m_id, ¶m_length);
rtps_util_add_generic_guid_v2(topic_query_tree, tvb, offset,
hf_rtps_topic_query_original_related_reader_guid,
hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id,
hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind,
NULL);
offset = check_offset_addition(offset, param_length, tree, NULL, tvb);
return offset;
}
static int rtps_util_add_rti_locator_reachability_service_request(proto_tree * tree,
packet_info *pinfo, tvbuff_t * tvb, int offset, unsigned encoding) {
proto_tree * locator_reachability_tree, * locator_seq_tree;
proto_item * ti;
uint16_t encapsulation_id, encapsulation_opt;
uint32_t param_id, param_length, seq_length, i;
locator_reachability_tree = proto_tree_add_subtree(tree, tvb, offset,
0 /* To be defined */, ett_rtps_locator_reachability_tree, &ti, "Locator Reachability Data");
/* Encapsulation Id */
encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */
proto_tree_add_uint(locator_reachability_tree, hf_rtps_encapsulation_id,
tvb, offset, 2, encapsulation_id);
offset += 2;
encoding = get_encapsulation_endianness(encapsulation_id);
/* Encapsulation length (or option) */
encapsulation_opt = tvb_get_ntohs(tvb, offset); /* Always big endian */
proto_tree_add_uint(locator_reachability_tree, hf_rtps_encapsulation_options, tvb,
offset, 2, encapsulation_opt);
offset += 2;
rtps_util_dissect_parameter_header(tvb, &offset, encoding, ¶m_id, ¶m_length);
seq_length = tvb_get_uint32(tvb, offset, encoding);
locator_seq_tree = proto_tree_add_subtree_format(locator_reachability_tree, tvb, offset,
param_length, ett_rtps_locator_list_tree, &ti, "Locator List [Size = %u]", seq_length);
offset += 4;
for(i = 0; i < seq_length; i++) {
rtps_util_add_locator_t(locator_seq_tree, pinfo, tvb, offset, encoding, "Locator");
offset += 24;
}
return offset;
}
static int rtps_util_add_instance_state_request_data(proto_tree* tree, tvbuff_t* tvb,
int offset, const unsigned encoding) {
proto_tree* instance_state_request_tree = NULL;
proto_item* ti = NULL;
/* The sum of all fields */
const unsigned instance_state_request_data_len = 8 + GUID_SIZE + (4 * 3);
instance_state_request_tree = proto_tree_add_subtree(
tree,
tvb,
offset,
instance_state_request_data_len,
ett_rtps_instance_transition_data,
&ti,
"Instance State Request Data");
rtps_util_add_seq_number(instance_state_request_tree, tvb, offset, encoding, "seqNumber");
offset += 8;
rtps_util_add_generic_guid_v2(instance_state_request_tree, tvb, offset, hf_rtps_pgm_dst_endpoint_guid,
hf_rtps_param_host_id, hf_rtps_param_app_id, hf_rtps_param_instance_id,
hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind,
NULL);
offset += GUID_SIZE;
proto_tree_add_item(instance_state_request_tree, hf_rtps_writer_group_oid, tvb, offset, 4, encoding);
offset += 4;
proto_tree_add_item(instance_state_request_tree, hf_rtps_reader_group_oid, tvb, offset, 4, encoding);
offset += 4;
proto_tree_add_item(instance_state_request_tree, hf_rtps_writer_session_id, tvb, offset, 4, encoding);
offset += 4;
return offset;
}
static int rtps_util_add_rti_service_request(proto_tree * tree, packet_info *pinfo, tvbuff_t * tvb,
int offset, const unsigned encoding, uint32_t service_id) {
uint32_t *service_id_copy = wmem_alloc(pinfo->pool, sizeof(uint32_t));
*service_id_copy = service_id;
/* This is used in append_status_info for adding the column info */
p_add_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_SERVICE_REQUEST_ID_PROTODATA_KEY, (void *)service_id_copy);
switch (service_id) {
case RTI_SERVICE_REQUEST_ID_TOPIC_QUERY:
offset = rtps_util_add_rti_topic_query_service_request(tree, pinfo, tvb, offset + 4,
encoding);
break;
case RTI_SERVICE_REQUEST_ID_LOCATOR_REACHABILITY:
offset = rtps_util_add_rti_locator_reachability_service_request(tree, pinfo, tvb, offset + 4,
encoding);
break;
case RTI_SERVICE_REQUEST_ID_UNKNOWN: {
uint32_t seq_length;
seq_length = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_item(tree, hf_rtps_srm_request_body,
tvb, offset + 4, seq_length, ENC_NA);
offset = check_offset_addition(offset, seq_length, tree, NULL, tvb);
offset = check_offset_addition(offset, 4, tree, NULL, tvb);
break;
}
case RTI_SERVICE_REQUEST_ID_INSTANCE_STATE: {
/* First four after the sequence size are not needed */
offset += 8;
offset = rtps_util_add_instance_state_request_data(tree, tvb, offset, encoding);
break;
}
}
return offset;
}
/* *********************************************************************** */
/* * Parameter Sequence dissector * */
/* *********************************************************************** */
/*
* It returns the new offset representing the point where the parameter
* sequence terminates.
* In case of protocol error, it returns 0 (cannot determine the end of
* the sequence, the caller should be responsible to find the end of the
* section if possible or pass the error back and abort dissecting the
* current packet).
* If no error occurred, the returned value is ALWAYS > than the offset passed.
*/
#define ENSURE_LENGTH(size) \
if (param_length < size) { \
expert_add_info_format(pinfo, param_len_item, &ei_rtps_parameter_value_invalid, "ERROR: parameter value too small (must be at least %d octets)", size); \
break; \
}
static bool dissect_parameter_sequence_rti_dds(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb,
proto_item *parameter_item, proto_item * param_len_item, int offset,
const unsigned encoding, int param_length, uint16_t parameter, type_mapping * type_mapping_object,
bool is_inline_qos, unsigned vendor_id) {
switch(parameter) {
case PID_DATA_TAGS:
ENSURE_LENGTH(4);
rtps_util_add_data_tags(rtps_parameter_tree, tvb, offset, encoding, param_length);
break;
case PID_SAMPLE_SIGNATURE:
ENSURE_LENGTH(16);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_epoch, tvb,
offset, 8, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_nonce, tvb,
offset+8, 4, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_length, tvb,
offset+12, 4, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_sample_signature_signature, tvb,
offset+16, param_length-16, ENC_NA);
break;
case PID_ENABLE_AUTHENTICATION:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_enable_authentication, tvb,
offset, 4, ENC_NA);
break;
case PID_RELATED_ENTITY_GUID:
ENSURE_LENGTH(16);
rtps_util_add_guid_prefix_v2(
rtps_parameter_tree,
tvb,
offset,
hf_rtps_sm_guid_prefix,
hf_rtps_sm_host_id,
hf_rtps_sm_app_id,
hf_rtps_sm_instance_id,
0);
rtps_util_add_entity_id(
rtps_parameter_tree,
tvb,
offset + 12,
hf_rtps_sm_entity_id,
hf_rtps_sm_entity_id_key,
hf_rtps_sm_entity_id_kind,
ett_rtps_entity,
"Related entity instance id",
NULL);
break;
case PID_BUILTIN_ENDPOINT_QOS:
ENSURE_LENGTH(1);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_builtin_endpoint_qos, tvb,
offset, 1, ENC_NA);
break;
case PID_ENDPOINT_SECURITY_INFO: {
uint32_t flags;
ENSURE_LENGTH(8);
flags = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
hf_rtps_param_endpoint_security_attributes_mask, ett_rtps_flags,
ENDPOINT_SECURITY_INFO_FLAGS, flags);
flags = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
hf_rtps_param_plugin_endpoint_security_attributes_mask, ett_rtps_flags,
PLUGIN_ENDPOINT_SECURITY_INFO_FLAGS, flags);
break;
}
case PID_PARTICIPANT_SECURITY_INFO: {
uint32_t flags;
ENSURE_LENGTH(8);
flags = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
hf_rtps_param_participant_security_attributes_mask, ett_rtps_flags,
PARTICIPANT_SECURITY_INFO_FLAGS, flags);
offset += 4;
flags = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
hf_rtps_param_plugin_participant_security_attributes_mask, ett_rtps_flags,
PLUGIN_PARTICIPANT_SECURITY_INFO_FLAGS, flags);
break;
}
case PID_VENDOR_BUILTIN_ENDPOINT_SET: {
uint32_t flags;
ENSURE_LENGTH(4);
flags = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
hf_rtps_param_vendor_builtin_endpoint_set_flags, ett_rtps_flags,
VENDOR_BUILTIN_ENDPOINT_FLAGS, flags);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | Unsigned long classId |
* +---------------+---------------+---------------+---------------+
* | Unsigned long uncompressedSerializedLength |
* +---------------+---------------+---------------+---------------+
* | byteSeq compressedSerializedTypeObject |
* +---------------+---------------+---------------+---------------+
* classId:
* value(0) RTI_OSAPI_COMPRESSION_CLASS_ID_NONE
* value(1) RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB
* value(2) RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2
* value(-1) RTI_OSAPI_COMPRESSION_CLASS_ID_AUTO
*/
case PID_TYPE_OBJECT_LB: {
unsigned compressed_size;
unsigned decompressed_size;
unsigned compression_plugin_class;
tvbuff_t *compressed_type_object_subset;
ENSURE_LENGTH(8);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_compression_plugin_class_id, tvb, offset, 4, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_uncompressed_serialized_length, tvb, offset + 4, 4, encoding);
compression_plugin_class = tvb_get_uint32(tvb, offset, encoding);
decompressed_size = tvb_get_uint32(tvb, offset + 4, encoding);
/* Get the number of bytes (elements) in the sequence */
compressed_size = tvb_get_uint32(tvb, offset + 8, encoding);
switch(compression_plugin_class) {
case RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB: {
/* + 12 Because First 4 bytes of the sequence are the number of elements in the sequence */
proto_tree_add_item(rtps_parameter_tree, hf_rtps_compressed_serialized_type_object, tvb, offset + 12, param_length - 8, encoding);
compressed_type_object_subset = tvb_new_subset_length(tvb, offset + 12, decompressed_size);
rtps_add_zlib_compressed_typeobject(rtps_parameter_tree, pinfo, compressed_type_object_subset,
0, encoding, compressed_size, decompressed_size, type_mapping_object);
break;
}
case RTI_OSAPI_COMPRESSION_CLASS_ID_NONE: {
compressed_type_object_subset = tvb_new_subset_length(tvb, offset + 12, decompressed_size);
rtps_util_add_typeobject(rtps_parameter_tree, pinfo,
compressed_type_object_subset, 0, encoding, decompressed_size, type_mapping_object);
break;
}
default: {
/* + 12 Because First 4 bytes of the sequence are the number of elements in the sequence */
proto_tree_add_item(rtps_parameter_tree, hf_rtps_compressed_serialized_type_object, tvb, offset + 12, param_length - 8, encoding);
}
}
break;
}
case PID_ENDPOINT_SECURITY_ATTRIBUTES: {
uint32_t flags;
ENSURE_LENGTH(4);
flags = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
hf_rtps_param_endpoint_security_attributes, ett_rtps_flags,
ENDPOINT_SECURITY_ATTRIBUTES, flags);
break;
}
case PID_TOPIC_QUERY_PUBLICATION: {
ENSURE_LENGTH(8);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_topic_query_publication_enable,
tvb, offset, 1, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_topic_query_publication_sessions,
tvb, offset+4, 4, encoding);
break;
}
case PID_ENDPOINT_PROPERTY_CHANGE_EPOCH: {
ENSURE_LENGTH(8);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_endpoint_property_change_epoch,
tvb, offset, 8, encoding);
break;
}
case PID_TOPIC_QUERY_GUID:
if (is_inline_qos) {
ENSURE_LENGTH(16);
rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
}
break;
case PID_REACHABILITY_LEASE_DURATION:
ENSURE_LENGTH(8);
rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
hf_rtps_participant_lease_duration);
break;
case PID_RELATED_SOURCE_GUID: {
ENSURE_LENGTH(16);
/* PID_RELATED_SOURCE_GUID */
rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TRANSPORT_INFO_LIST | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long Seq.Length |
* +---------------+---------------+---------------+---------------+
* | ... |
* | TransportInfo 1 |
* | ... |
* +---------------+---------------+---------------+---------------+
* | ... |
* | TransportInfo 2 |
* | ... |
* +---------------+---------------+---------------+---------------+
* | ... |
* | TransportInfo n |
* | ... |
* +---------------+---------------+---------------+---------------+
*
* IDL:
* struct TRANSPORT_INFO {
* long classid;
* long messageSizeMax;
* };
*
* struct TRANSPORT_INFO_LIST {
* Sequence<TRANSPORT_INFO> TransportInfoList;
* };
*
*/
/* PID_RELATED_READER_GUID and PID_TRANSPORT_INFO_LIST have the same value */
case PID_TRANSPORT_INFO_LIST: {
if (is_inline_qos) {
ENSURE_LENGTH(16);
/* PID_RELATED_READER_GUID */
rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
} else {
ENSURE_LENGTH(4);
{
int i;
uint32_t temp_offset;
uint32_t seq_size = tvb_get_uint32(tvb, offset, encoding);
if (seq_size > 0) {
temp_offset = offset+4; /* move to first transportInfo */
i = 1;
while(seq_size-- > 0) {
rtps_util_add_transport_info(rtps_parameter_tree, tvb, temp_offset, encoding, i);
temp_offset += 8;
++i;
}
}
}
}
break;
}
/* PID_DIRECT_COMMUNICATION and PID_SOURCE_GUID have the same value */
case PID_DIRECT_COMMUNICATION: {
if (is_inline_qos) {
ENSURE_LENGTH(16);
/* PID_SOURCE_GUID */
rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
} else {
proto_tree_add_item(rtps_parameter_tree, hf_rtps_direct_communication, tvb, offset, 1, ENC_NA );
}
break;
}
/* Product Version Version 5.3.1 and earlier
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TYPE_CONSISTENCY_KIND | length |
* +---------------+---------------+---------------+---------------+
* | unsigned short value Kind | = = u n u s e d = = = = = = |
* +---------------+---------------+---------------+---------------+
*
* Product Version 5.3.3 and later
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TYPE_CONSISTENCY_KIND | length |
* +---------------+---------------+---------------+---------------+
* | unsigned short value Kind | Boolean ISeqB | Boolean IStrB |
* +---------------+---------------+---------------+---------------+
* | Boolean IMemN | Boolean PTypW | Boolean FtypV | Boolean IEnLN |
* +---------------+---------------+---------------+---------------+
* ISeqB = Ignore Sequence Names
* IStrB = Ignore String names
* IMemN = Ignore Member Names
* PTypW = Prevent Type Widening
* FtypV = Force Type Validation
* IEnLN = Ignore Enum Literal Names
*/
case PID_TYPE_CONSISTENCY: {
if (param_length !=4 && param_length !=8) {
expert_add_info_format(pinfo, rtps_parameter_tree,
&ei_rtps_pid_type_csonsistency_invalid_size,
"PID_TYPE_CONSISTENCY invalid size. It has a size of %d bytes. Expected %d or %d bytes.",
param_length, 4, 8);
break;
}
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_type_consistency_kind, tvb, offset, 2, encoding);
/* Parameter size can be used as a discriminator between product versions. */
if (param_length == 8) {
offset += 2;
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_sequence_bounds,
tvb, offset, 1, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_string_bounds,
tvb, offset + 1, 1, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_member_names,
tvb, offset + 2, 1, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_prevent_type_widening,
tvb, offset + 3, 1, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_force_type_validation,
tvb, offset + 4, 1, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_ignore_enum_literal_names,
tvb, offset + 5, 1, encoding);
}
break;
}
/* ==================================================================
* Here are all the deprecated items.
*/
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PRODUCT_VERSION | length |
* +---------------+---------------+---------------+---------------+
* | uint8 major | uint8 minor | uint8 release |uint8 revision |
* +---------------+---------------+---------------+---------------+
*/
case PID_PRODUCT_VERSION: {
ENSURE_LENGTH(4);
rtps_util_add_product_version(rtps_parameter_tree, tvb, offset, vendor_id);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PLUGIN_PROMISCUITY_KIND | length |
* +---------------+---------------+---------------+---------------+
* | short value | |
* +---------------+---------------+---------------+---------------+
*/
case PID_PLUGIN_PROMISCUITY_KIND: {
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_plugin_promiscuity_kind, tvb, offset, 4, encoding);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_ENTITY_VIRTUAL_GUID | length |
* +---------------+---------------+---------------+---------------+
* | |
* +- -+
* | octet[12] guidPrefix |
* +- -+
* | |
* +---------------+---------------+---------------+---------------+
* | octet[4] entityId |
* +---------------+---------------+---------------+---------------+
*/
case PID_ENTITY_VIRTUAL_GUID: {
ENSURE_LENGTH(16);
rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
hf_rtps_sm_instance_id, 0);
rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12,
hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind,
ett_rtps_entity, "virtualGUIDSuffix", NULL);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_SERVICE_KIND | length |
* +---------------+---------------+---------------+---------------+
* | long value |
* +---------------+---------------+---------------+---------------+
*/
case PID_SERVICE_KIND: {
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_service_kind, tvb, offset, 4, encoding);
break;
}
case PID_ROLE_NAME: {
rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_role_name, encoding);
break;
}
case PID_ACK_KIND: {
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_acknowledgment_kind, tvb, offset, 4, encoding);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PEER_HOST_EPOCH | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long epoch |
* +---------------+---------------+---------------+---------------+
*/
case PID_PEER_HOST_EPOCH: {
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_peer_host_epoch, tvb, offset, 4, encoding);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DOMAIN_ID|PID_RTI_DOMAIN_ID| length |
* +---------------+---------------+---------------+---------------+
* | long domain_id |
* +---------------+---------------+---------------+---------------+
*/
case PID_RTI_DOMAIN_ID:
case PID_DOMAIN_ID: {
if (is_inline_qos) { /* PID_RELATED_ORIGINAL_WRITER_INFO_LEGACY */
ENSURE_LENGTH(16);
rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix,
hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id,
hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity,
"virtualGUIDSuffix", NULL);
/* Sequence number */
rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset+16,
encoding, "virtualSeqNumber");
} else {
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_domain_id, tvb, offset, 4, encoding);
/* Each packet stores its participant guid in the private table. This is done in dissect_rtps */
endpoint_guid *participant_guid = (endpoint_guid*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY);
if (participant_guid != NULL) {
/* Since this information is fixed there is no need to update in a second pass */
if (!wmem_map_contains(discovered_participants_domain_ids, participant_guid)) {
int domainId = tvb_get_int32(tvb, offset, encoding);
participant_info *p_info = (participant_info*)wmem_new(wmem_file_scope(), participant_info);
p_info->domainId = domainId;
endpoint_guid *participant_guid_copy = (endpoint_guid*)wmem_memdup(wmem_file_scope(),
participant_guid, sizeof(endpoint_guid));
wmem_map_insert(discovered_participants_domain_ids,
(const void*)participant_guid_copy, (void*)p_info);
}
}
}
break;
}
case PID_RELATED_ORIGINAL_WRITER_INFO: {
if (is_inline_qos) { /* PID_RELATED_ORIGINAL_WRITER_INFO */
ENSURE_LENGTH(16);
rtps_util_add_guid_prefix_v2(
rtps_parameter_tree,
tvb,
offset,
hf_rtps_sm_guid_prefix,
hf_rtps_sm_host_id,
hf_rtps_sm_app_id,
hf_rtps_sm_instance_id,
0);
rtps_util_add_entity_id(
rtps_parameter_tree,
tvb,
offset + 12,
hf_rtps_sm_entity_id,
hf_rtps_sm_entity_id_key,
hf_rtps_sm_entity_id_kind,
ett_rtps_entity,
"virtualGUIDSuffix",
NULL);
/* Sequence number */
rtps_util_add_seq_number(
rtps_parameter_tree,
tvb,
offset + 16,
encoding,
"virtualSeqNumber");
}
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DOMAIN_TAG | length |
* +---------------+---------------+---------------+---------------+
* | long domain_tag.Length |
* +---------------+---------------+---------------+---------------+
* | string domain_tag |
* | ... |
* +---------------+---------------+---------------+---------------+
*/
case PID_DOMAIN_TAG: {
ENSURE_LENGTH(4);
rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_domain_tag, encoding);
break;
}
case PID_EXTENDED: {
ENSURE_LENGTH(8);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_extended_parameter, tvb, offset, 4, encoding);
offset += 4;
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_extended_pid_length, tvb, offset, 4, encoding);
break;
}
case PID_TYPE_OBJECT: {
rtps_util_add_typeobject(rtps_parameter_tree, pinfo, tvb,
offset, encoding, param_length, type_mapping_object);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TYPECODE_RTPS2 | length |
* +---------------+---------------+---------------+---------------+
* | |
* + Type code description +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_TYPECODE:
case PID_TYPECODE_RTPS2: {
rtps_util_add_typecode(rtps_parameter_tree,
tvb,
pinfo,
offset,
encoding,
0, /* indent level */
0, /* isPointer */
-1, /* bitfield */
0, /* isKey */
offset,
NULL, /* name */
-1, /* not a seq field */
NULL, /* not an array */
0); /* ndds 4.0 hack: init to false */
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DISABLE_POSITIVE_ACKS | length |
* +---------------+---------------+---------------+---------------+
* | boolean value | = = = = = = = = u n u s e d = = = = = = = = |
* +---------------+---------------+---------------+---------------+
*/
case PID_DISABLE_POSITIVE_ACKS: {
ENSURE_LENGTH(1);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_disable_positive_ack, tvb, offset, 1, ENC_NA );
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_EXPECTS_VIRTUAL_HB | length |
* +---------------+---------------+---------------+---------------+
* | boolean value | = = = = = = = = u n u s e d = = = = = = = = |
* +---------------+---------------+---------------+---------------+
*/
case PID_EXPECTS_VIRTUAL_HB: {
ENSURE_LENGTH(1);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_virtual_heartbeat, tvb, offset, 1, ENC_NA );
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_LOCATOR_FILTER_LIST | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long number_of_channels |
* +---------------+---------------+---------------+---------------+
* | |
* ~ String filter_name ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ LocatorList ~ <----------+
* | | Repeat |
* +---------------+---------------+---------------+---------------+ For each|
* | | Channel |
* ~ String filter_expression ~ |
* | | |
* +---------------+---------------+---------------+---------------+ <----------+
*/
case PID_LOCATOR_FILTER_LIST: {
int32_t number_of_channels, ch;
proto_tree *channel_tree;
proto_item *ti_channel;
char temp_buff[20];
int old_offset;
uint32_t off = offset;
ENSURE_LENGTH(4);
proto_tree_add_item_ret_int(rtps_parameter_tree, hf_rtps_locator_filter_list_num_channels, tvb, off, 4, encoding, &number_of_channels );
proto_item_append_text(parameter_item, " (%d channels)", number_of_channels );
off += 4;
if (number_of_channels == 0) {
/* Do not dissect the rest */
break;
}
/* filter name */
off = rtps_util_add_string(rtps_parameter_tree, tvb, off, hf_rtps_locator_filter_list_filter_name, encoding);
/* Foreach channel... */
for (ch = 0; ch < number_of_channels; ++ch) {
snprintf(temp_buff, 20, "Channel[%u]", ch);
old_offset = off;
channel_tree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, off, 0, ett_rtps_locator_filter_channel, &ti_channel, "Channel[%u]", ch);
off = rtps_util_add_multichannel_locator_list(channel_tree, pinfo, tvb, off, temp_buff, encoding);
/* Filter expression */
off = rtps_util_add_string(rtps_parameter_tree, tvb, off, hf_rtps_locator_filter_list_filter_exp, encoding);
/* Now we know the length of the channel data, set the length */
proto_item_set_len(ti_channel, (off - old_offset));
} /* End of for each channel */
break;
}/* End of case PID_LOCATOR_FILTER_LIST */
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_UNICAST_LOCATOR_EX | 0x8007 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
* +---------------+---------------+---------------+---------------+
* | Locator Sequence Length |
* +---------------+---------------+---------------+---------------+
* | Locator 1 | Locator 2 |
* +---------------+---------------+---------------+---------------+
*/
case PID_UNICAST_LOCATOR_EX: {
ENSURE_LENGTH(28);
rtps_util_add_locator_ex_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, param_length);
break;
}
case PID_ENDPOINT_SECURITY_SYMMETRIC_CIPHER_ALGO: {
ENSURE_LENGTH(4);
proto_tree_add_bitmask(
rtps_parameter_tree,
tvb,
offset,
hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask,
ett_rtps_flags,
SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
encoding);
break;
}
case PID_PARTICIPANT_SECURITY_SYMMETRIC_CIPHER_ALGO: {
ENSURE_LENGTH(12);
proto_tree_add_bitmask(
rtps_parameter_tree,
tvb,
offset,
hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask,
ett_rtps_flags,
SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
encoding);
offset += 4;
proto_tree_add_bitmask(
rtps_parameter_tree,
tvb,
offset,
hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask,
ett_rtps_flags,
SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
encoding);
offset += 4;
proto_tree_add_bitmask(
rtps_parameter_tree,
tvb,
offset,
hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit,
ett_rtps_flags,
SECURITY_SIMMETRIC_CIPHER_MASK_FLAGS,
encoding);
break;
}
case PID_PARTICIPANT_SECURITY_KEY_ESTABLISHMENT_ALGO: {
ENSURE_LENGTH(8);
proto_tree *sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4,
ett_rtps_crypto_algorithm_requirements, NULL, "Shared Secret");
dissect_crypto_algorithm_requirements(sub_tree, tvb, offset,
encoding, SECURITY_KEY_ESTABLISHMENT_MASK_FLAGS);
break;
}
case PID_PARTICIPANT_SECURITY_DIGITAL_SIGNATURE_ALGO: {
ENSURE_LENGTH(16);
proto_tree *sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4,
ett_rtps_crypto_algorithm_requirements, NULL, "Trust Chain");
offset = dissect_crypto_algorithm_requirements(sub_tree, tvb, offset,
encoding, SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS);
sub_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 4,
ett_rtps_crypto_algorithm_requirements, NULL, "Message Authentication");
dissect_crypto_algorithm_requirements(sub_tree, tvb, offset,
encoding, SECURITY_DIGITAL_SIGNATURE_MASK_FLAGS);
break;
}
default: {
return false;
}
}/* End of switch for parameters for vendor RTI */
return true;
}
static bool dissect_parameter_sequence_toc(proto_tree *rtps_parameter_tree, packet_info *pinfo _U_,
tvbuff_t *tvb, proto_item *parameter_item _U_, proto_item *param_len_item _U_, int offset,
const unsigned encoding, int param_length _U_,
uint16_t parameter) {
switch(parameter) {
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TYPECODE_RTPS2 | length |
* +---------------+---------------+---------------+---------------+
* | |
* + Type code description +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_TYPECODE_RTPS2: {
rtps_util_add_typecode(rtps_parameter_tree,
tvb,
pinfo,
offset,
encoding,
0, /* indent level */
0, /* isPointer */
-1, /* bitfield */
0, /* isKey */
offset,
NULL, /* name */
0, /* not a seq field */
NULL, /* not an array */
0); /* ndds 4.0 hack: init to false */
break;
}
default:
return false;
}
return true;
}
static bool dissect_parameter_sequence_adl(proto_tree *rtps_parameter_tree _U_, packet_info *pinfo _U_,
tvbuff_t *tvb _U_, proto_item *parameter_item _U_, proto_item *param_len_item _U_, int offset _U_,
const unsigned encoding _U_, int param_length _U_,
uint16_t parameter) {
switch(parameter) {
case PID_ADLINK_WRITER_INFO: {
break;
}
case PID_ADLINK_READER_DATA_LIFECYCLE: {
break;
}
case PID_ADLINK_WRITER_DATA_LIFECYCLE: {
break;
}
case PID_ADLINK_ENDPOINT_GUID: {
break;
}
case PID_ADLINK_SYNCHRONOUS_ENDPOINT: {
break;
}
case PID_ADLINK_RELAXED_QOS_MATCHING: {
break;
}
case PID_ADLINK_PARTICIPANT_VERSION_INFO: {
break;
}
case PID_ADLINK_NODE_NAME: {
break;
}
case PID_ADLINK_EXEC_NAME: {
break;
}
case PID_ADLINK_PROCESS_ID: {
break;
}
case PID_ADLINK_SERVICE_TYPE: {
break;
}
case PID_ADLINK_ENTITY_FACTORY: {
break;
}
case PID_ADLINK_WATCHDOG_SCHEDULING: {
break;
}
case PID_ADLINK_LISTENER_SCHEDULING: {
break;
}
case PID_ADLINK_SUBSCRIPTION_KEYS: {
break;
}
case PID_ADLINK_READER_LIFESPAN: {
break;
}
case PID_ADLINK_SHARE: {
break;
}
case PID_ADLINK_TYPE_DESCRIPTION: {
break;
}
case PID_ADLINK_LAN_ID: {
break;
}
case PID_ADLINK_ENDPOINT_GID: {
break;
}
case PID_ADLINK_GROUP_GID: {
break;
}
case PID_ADLINK_EOTINFO: {
break;
}
case PID_ADLINK_PART_CERT_NAME: {
break;
}
case PID_ADLINK_LAN_CERT_NAME: {
break;
}
default:
return false;
}
return true;
}
static bool dissect_parameter_sequence_v1(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb,
proto_item *parameter_item, proto_item * param_len_item, int offset,
const unsigned encoding, int size, int param_length,
uint16_t parameter, uint16_t version, type_mapping * type_mapping_object,
coherent_set_entity_info *coherent_set_entity_info_object) {
proto_tree *subtree;
switch(parameter) {
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PARTICIPANT_LEASE_DURATION| 0x0008 |
* +---------------+---------------+---------------+---------------+
* | long NtpTime.seconds |
* +---------------+---------------+---------------+---------------+
* | unsigned long NtpTime.fraction |
* +---------------+---------------+---------------+---------------+
*/
case PID_PARTICIPANT_LEASE_DURATION:
ENSURE_LENGTH(8);
rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
hf_rtps_participant_lease_duration);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TIME_BASED_FILTER | 0x0008 |
* +---------------+---------------+---------------+---------------+
* | long NtpTime.seconds |
* +---------------+---------------+---------------+---------------+
* | unsigned long NtpTime.fraction |
* +---------------+---------------+---------------+---------------+
*/
case PID_TIME_BASED_FILTER:
ENSURE_LENGTH(8);
rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
hf_rtps_time_based_filter_minimum_separation);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TOPIC_NAME | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long String.length |
* +---------------+---------------+---------------+---------------+
* | str[0] | str[1] | str[2] | str[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*/
case PID_TOPIC_NAME: {
const char * retVal = NULL;
uint32_t str_size = tvb_get_uint32(tvb, offset, encoding);
retVal = (char*)tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, str_size, ENC_ASCII);
rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_topic_name, encoding);
/* If topic information is enabled we have to store the topic name for showing after the DATA(r|w)
* in the infor column. This information is used in append_status_info function.
*/
if (retVal != NULL && enable_topic_info) {
submessage_col_info* current_submessage_col_info = NULL;
rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object, retVal, TOPIC_INFO_ADD_TOPIC_NAME);
/* retVal has packet scope lifetime, enough for adding to the DATA(r|w) column information */
current_submessage_col_info = (submessage_col_info*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY);
if (current_submessage_col_info != NULL && current_submessage_col_info->topic_name == NULL) {
current_submessage_col_info->topic_name = retVal;
}
}
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_OWNERSHIP_STRENGTH | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | long strength |
* +---------------+---------------+---------------+---------------+
*/
case PID_OWNERSHIP_STRENGTH:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_strength, tvb, offset, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TYPE_NAME | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long String.length |
* +---------------+---------------+---------------+---------------+
* | str[0] | str[1] | str[2] | str[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*/
case PID_TYPE_NAME: {
const char * retVal = NULL;
uint32_t str_size = tvb_get_uint32(tvb, offset, encoding);
retVal = (char*) tvb_get_string_enc(wmem_packet_scope(), tvb, offset+4, str_size, ENC_ASCII);
rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object,
retVal, TOPIC_INFO_ADD_TYPE_NAME);
rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_type_name, encoding);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_XXXXXXXXXXX | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
*/
case PID_METATRAFFIC_MULTICAST_PORT:
case PID_METATRAFFIC_UNICAST_PORT:
case PID_DEFAULT_UNICAST_PORT:
ENSURE_LENGTH(4);
rtps_util_add_port(rtps_parameter_tree, pinfo, tvb, offset, encoding, hf_rtps_param_port);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_EXPECTS_INLINE_QOS | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | boolean | N O T U S E D |
* +---------------+---------------+---------------+---------------+
*/
case PID_EXPECTS_INLINE_QOS:
ENSURE_LENGTH(1);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_inline_qos, tvb, offset, 1, ENC_NA );
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_XXXXXXXXXXX | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long ip_address |
* +---------------+---------------+---------------+---------------+
*/
case PID_METATRAFFIC_MULTICAST_IPADDRESS:
case PID_DEFAULT_UNICAST_IPADDRESS:
case PID_MULTICAST_IPADDRESS:
case PID_METATRAFFIC_UNICAST_IPADDRESS:
rtps_util_add_ipv4_address_t(rtps_parameter_tree, pinfo, tvb, offset,
encoding, hf_param_ip_address);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PROTOCOL_VERSION | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | uint8 major | uint8 minor | N O T U S E D |
* +---------------+---------------+---------------+---------------+
*/
case PID_PROTOCOL_VERSION:
ENSURE_LENGTH(2);
rtps_util_add_protocol_version(rtps_parameter_tree, tvb, offset);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_VENDOR_ID | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | uint8 major | uint8 minor | N O T U S E D |
* +---------------+---------------+---------------+---------------+
*/
case PID_VENDOR_ID:
ENSURE_LENGTH(2);
rtps_util_add_vendor_id(rtps_parameter_tree, tvb, offset);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_RELIABILITY | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | unsigned long kind |
* +---------------+---------------+---------------+---------------+
*/
case PID_RELIABILITY_OFFERED: /* Deprecated */
case PID_RELIABILITY:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_reliability_kind, tvb, offset, 4, encoding);
/* Older version of the protocol (and for PID_RELIABILITY_OFFERED)
* this parameter was carrying also a NtpTime called
* 'maxBlockingTime'.
*/
if (size == 12) {
rtps_util_add_timestamp(rtps_parameter_tree, tvb, offset + 4,
encoding, hf_rtps_reliability_max_blocking_time);
}
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_LIVELINESS | 0x000c |
* +---------------+---------------+---------------+---------------+
* | unsigned long kind |
* +---------------+---------------+---------------+---------------+
* | long NtpTime.seconds |
* +---------------+---------------+---------------+---------------+
* | unsigned long NtpTime.fraction |
* +---------------+---------------+---------------+---------------+
* NDDS 3.1 sends only 'kind' on the wire.
*
*/
case PID_LIVELINESS_OFFERED: /* Deprecated */
case PID_LIVELINESS:
ENSURE_LENGTH(12);
rtps_util_add_liveliness_qos(rtps_parameter_tree, tvb, offset, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DURABILITY | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | unsigned long kind |
* +---------------+---------------+---------------+---------------+
*/
case PID_DURABILITY:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_durability, tvb, offset, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DURABILITY_SERVICE | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | long NtpTime.seconds |
* +---------------+---------------+---------------+---------------+
* | unsigned long NtpTime.fraction |
* +---------------+---------------+---------------+---------------+
* | unsigned long kind |
* +---------------+---------------+---------------+---------------+
* | long history_depth |
* +---------------+---------------+---------------+---------------+
* | long max_samples |
* +---------------+---------------+---------------+---------------+
* | long max_instances |
* +---------------+---------------+---------------+---------------+
* | long max_samples_per_instance |
* +---------------+---------------+---------------+---------------+
*/
case PID_DURABILITY_SERVICE:
ENSURE_LENGTH(28);
rtps_util_add_durability_service_qos(rtps_parameter_tree, tvb, offset, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_OWNERSHIP | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | unsigned long kind |
* +---------------+---------------+---------------+---------------+
*/
case PID_OWNERSHIP_OFFERED: /* Deprecated */
case PID_OWNERSHIP:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_ownership, tvb, offset, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PRESENTATION | 0x0008 |
* +---------------+---------------+---------------+---------------+
* | unsigned long kind |
* +---------------+---------------+---------------+---------------+
* | boolean | boolean | N O T U S E D |
* +---------------+---------------+---------------+---------------+
*/
case PID_PRESENTATION_OFFERED: /* Deprecated */
case PID_PRESENTATION:
ENSURE_LENGTH(6);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_access_scope, tvb, offset, 4, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_coherent_access, tvb, offset+4, 1, ENC_NA );
proto_tree_add_item(rtps_parameter_tree, hf_rtps_presentation_ordered_access, tvb, offset+5, 1, ENC_NA );
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DEADLINE | 0x0008 |
* +---------------+---------------+---------------+---------------+
* | long NtpTime.seconds |
* +---------------+---------------+---------------+---------------+
* | unsigned long NtpTime.fraction |
* +---------------+---------------+---------------+---------------+
*/
case PID_DEADLINE_OFFERED: /* Deprecated */
case PID_DEADLINE:
ENSURE_LENGTH(8);
rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding, hf_rtps_deadline_period);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DESTINATION_ORDER | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | unsigned long kind |
* +---------------+---------------+---------------+---------------+
*/
case PID_DESTINATION_ORDER_OFFERED: /* Deprecated */
case PID_DESTINATION_ORDER:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_destination_order, tvb, offset, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_LATENCY_BUDGET | 0x0008 |
* +---------------+---------------+---------------+---------------+
* | long NtpTime.seconds |
* +---------------+---------------+---------------+---------------+
* | unsigned long NtpTime.fraction |
* +---------------+---------------+---------------+---------------+
*/
case PID_LATENCY_BUDGET_OFFERED:
case PID_LATENCY_BUDGET:
ENSURE_LENGTH(8);
rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset,
encoding, hf_rtps_latency_budget_duration);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PARTITION | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long sequence_size |
* +---------------+---------------+---------------+---------------+
* | unsigned long string[0].size |
* +---------------+---------------+---------------+---------------+
* | string[0][0] | string[0][1] | string[0][2] | string[0][3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
* The value is a sequence of strings.
*/
case PID_PARTITION_OFFERED: /* Deprecated */
case PID_PARTITION:
ENSURE_LENGTH(4);
rtps_util_add_seq_string(rtps_parameter_tree, tvb, offset, encoding,
hf_rtps_param_partition_num, hf_rtps_param_partition, "name");
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_LIFESPAN | 0x0008 |
* +---------------+---------------+---------------+---------------+
* | long NtpTime.seconds |
* +---------------+---------------+---------------+---------------+
* | unsigned long NtpTime.fraction |
* +---------------+---------------+---------------+---------------+
*/
case PID_LIFESPAN:
ENSURE_LENGTH(8);
rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
hf_rtps_lifespan_duration);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_USER_DATA | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long sequence_size |
* +---------------+---------------+---------------+---------------+
* | octet[0] | octet[1] | octet[2] | octet[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*/
case PID_USER_DATA:
ENSURE_LENGTH(4);
rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset,
encoding, param_length, hf_rtps_param_user_data);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_GROUP_DATA | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long sequence_size |
* +---------------+---------------+---------------+---------------+
* | octet[0] | octet[1] | octet[2 ] | octet[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*/
case PID_GROUP_DATA:
ENSURE_LENGTH(4);
rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset,
encoding, param_length, hf_rtps_param_group_data);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TOPIC_DATA | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long sequence_size |
* +---------------+---------------+---------------+---------------+
* | octet[0] | octet[1] | octet[2] | octet[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*/
case PID_TOPIC_DATA:
ENSURE_LENGTH(4);
rtps_util_add_seq_octets(rtps_parameter_tree, pinfo, tvb, offset,
encoding, param_length, hf_rtps_param_topic_data);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_UNICAST_LOCATOR | 0x0018 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
* +---------------+---------------+---------------+---------------+
*/
case PID_UNICAST_LOCATOR:
ENSURE_LENGTH(24);
rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb,
offset, encoding, "locator");
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_MULTICAST_LOCATOR | 0x0018 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
* +---------------+---------------+---------------+---------------+
*/
case PID_MULTICAST_LOCATOR:
ENSURE_LENGTH(24);
rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb,
offset, encoding, "locator");
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DEFAULT_UNICAST_LOCATOR | 0x0018 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
* +---------------+---------------+---------------+---------------+
*/
case PID_DEFAULT_UNICAST_LOCATOR:
ENSURE_LENGTH(24);
rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset,
encoding, "locator");
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_METATRAFFIC_UNICAST_LOC...| 0x0018 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
* +---------------+---------------+---------------+---------------+
*/
case PID_METATRAFFIC_UNICAST_LOCATOR:
ENSURE_LENGTH(24);
rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset,
encoding, "locator");
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_METATRAFFIC_MULTICAST_L...| 0x0018 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
* +---------------+---------------+---------------+---------------+
*/
case PID_METATRAFFIC_MULTICAST_LOCATOR:
ENSURE_LENGTH(24);
rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb,
offset, encoding, "locator");
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PARTICIPANT_MANUAL_LIVE...| 0x0004 |
* +---------------+---------------+---------------+---------------+
* | long livelinessEpoch |
* +---------------+---------------+---------------+---------------+
*/
case PID_PARTICIPANT_BUILTIN_ENDPOINTS:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_participant_builtin_endpoints, tvb, offset, 4, encoding);
break;
case PID_PARTICIPANT_MANUAL_LIVELINESS_COUNT:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_participant_manual_liveliness_count, tvb, offset, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_HISTORY | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long depth |
* +---------------+---------------+---------------+---------------+
*/
case PID_HISTORY:
ENSURE_LENGTH(8);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_history_kind, tvb, offset, 4, encoding);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_history_depth, tvb, offset+4, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_RESOURCE_LIMIT | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | long max_samples |
* +---------------+---------------+---------------+---------------+
* | long max_instances |
* +---------------+---------------+---------------+---------------+
* | long max_samples_per_instances |
* +---------------+---------------+---------------+---------------+
*/
case PID_RESOURCE_LIMIT:
ENSURE_LENGTH(12);
subtree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, 12, ett_rtps_resource_limit, NULL, "Resource Limit");
proto_tree_add_item(subtree, hf_rtps_resource_limit_max_samples, tvb, offset, 4, encoding);
proto_tree_add_item(subtree, hf_rtps_resource_limit_max_instances, tvb, offset+4, 4, encoding);
proto_tree_add_item(subtree, hf_rtps_resource_limit_max_samples_per_instances, tvb, offset+8, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_CONTENT_FILTER_PROPERTY | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long String1.length |
* +---------------+---------------+---------------+---------------+
* | str1[0] | str1[1] | str1[2] | str1[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
* | unsigned long String2.length |
* +---------------+---------------+---------------+---------------+
* | str2[0] | str2[1] | str2[2] | str2[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
* | unsigned long String3.length |
* +---------------+---------------+---------------+---------------+
* | str3[0] | str3[1] | str3[2] | str3[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
* | unsigned long String4.length |
* +---------------+---------------+---------------+---------------+
* | str4[0] | str4[1] | str4[2] | str4[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
* | ... |
* | Filter Parameters |
* | ... |
* +---------------+---------------+---------------+---------------+
*
* String1: ContentFilterTopicName
* String2: RelatedTopicName
* String3: FilterClassName
* String4: FilterExpression
* ExpressionParameters: sequence of Strings
*
* Note: those strings starts all to a word-aligned (4 bytes) offset
*/
case PID_CONTENT_FILTER_PROPERTY: {
uint32_t temp_offset = offset;
ENSURE_LENGTH(20);
temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
hf_rtps_param_content_filter_topic_name, encoding);
temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
hf_rtps_param_related_topic_name, encoding);
temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
hf_rtps_param_filter_class_name, encoding);
temp_offset = rtps_util_add_string(rtps_parameter_tree, tvb, temp_offset,
hf_rtps_param_filter_expression, encoding);
/*temp_offset = */rtps_util_add_seq_string(rtps_parameter_tree, tvb, temp_offset,
encoding, hf_rtps_param_expression_parameters_num,
hf_rtps_param_expression_parameters, "expressionParameters");
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PROPERTY_LIST | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long Seq.Length |
* +---------------+---------------+---------------+---------------+
* | ... |
* | Property 1 |
* | ... |
* +---------------+---------------+---------------+---------------+
* | ... |
* | Property 2 |
* | ... |
* +---------------+---------------+---------------+---------------+
* | ... |
* | Property n |
* | ... |
* +---------------+---------------+---------------+---------------+
*
* IDL:
* struct PROPERTY {
* String Name;
* String Value;
* };
*
* struct PROPERTY_LIST {
* Sequence<PROPERTY> PropertyList;
* };
*
*/
case PID_PROPERTY_LIST:
case PID_PROPERTY_LIST_OLD:
ENSURE_LENGTH(4);
{
uint32_t temp_offset, prop_size;
const uint8_t *propName, *propValue;
proto_item *list_item, *item;
proto_tree *property_list_tree, *property_tree;
uint32_t seq_size = tvb_get_uint32(tvb, offset, encoding);
int start_offset = offset, str_length;
proto_item_append_text( parameter_item, " (%d properties)", seq_size );
if (seq_size > 0) {
property_list_tree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, -1, ett_rtps_property_list, &list_item, "Property List");
temp_offset = offset+4;
while(seq_size-- > 0) {
prop_size = tvb_get_uint32(tvb, temp_offset, encoding);
propName = tvb_get_string_enc(wmem_packet_scope(), tvb, temp_offset+4, prop_size, ENC_ASCII);
/* NDDS align strings at 4-bytes word. */
str_length = (4 + ((prop_size + 3) & 0xfffffffc));
item = proto_tree_add_string(property_list_tree, hf_rtps_property_name, tvb, temp_offset, str_length, propName);
property_tree = proto_item_add_subtree(item, ett_rtps_property);
temp_offset += str_length;
prop_size = tvb_get_uint32(tvb, temp_offset, encoding);
propValue = tvb_get_string_enc(wmem_packet_scope(), tvb, temp_offset+4, prop_size, ENC_ASCII);
/* NDDS align strings at 4-bytes word. */
str_length = (4 + ((prop_size + 3) & 0xfffffffc));
proto_tree_add_string(property_tree, hf_rtps_property_value, tvb, temp_offset, str_length, propValue);
temp_offset += str_length;
}
proto_item_set_len(list_item, temp_offset-start_offset);
}
}
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_FILTER_SIGNATURE | length |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*
* IDL:
* struct CONTENT_FILTER_SIGNATURE {
* sequence<long> filterBitmap;
* sequence<FILTER_SIGNATURE, 4> filterSignature;
* }
*
* where:
* struct FILTER_SIGNATURE {
* long filterSignature[4];
* }
*/
case PID_FILTER_SIGNATURE: {
uint32_t temp_offset;
uint32_t prev_offset;
uint32_t fs_elem;
uint32_t fs[4];
ENSURE_LENGTH(8);
/* Dissect filter bitmap */
temp_offset = rtps_util_add_seq_ulong(rtps_parameter_tree, tvb, offset,
hf_rtps_filter_bitmap, encoding, param_length, "filterBitmap");
/* Dissect sequence of FILTER_SIGNATURE */
fs_elem = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
while (fs_elem-- > 0) {
prev_offset = temp_offset;
/* Dissect the next FILTER_SIGNATURE object */
fs[0] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
fs[1] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
fs[2] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
fs[3] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
proto_tree_add_bytes_format_value(rtps_parameter_tree, hf_rtps_filter_signature, tvb, prev_offset, temp_offset - prev_offset, NULL, "%08x %08x %08x %08x",
fs[0], fs[1], fs[2], fs[3]);
}
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_COHERENT_SET | length |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber seqNumber +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_COHERENT_SET: {
uint64_t coherent_seq_number;
ENSURE_LENGTH(8);
coherent_seq_number = rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset,
encoding, "sequenceNumber");
if (coherent_set_entity_info_object && rtps_parameter_tree) {
rtps_util_add_coherent_set_general_cases_case(rtps_parameter_tree,
tvb, coherent_seq_number, coherent_set_entity_info_object);
}
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TYPECODE | length |
* +---------------+---------------+---------------+---------------+
* | |
* + Type code description +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_TYPECODE:
rtps_util_add_typecode(rtps_parameter_tree, tvb, pinfo, offset, encoding,
0, /* indent level */
0, /* isPointer */
-1, /* bitfield */
0, /* isKey */
offset,
NULL, /* name */
-1, /* not a seq field */
NULL, /* not an array */
0); /* ndds 4.0 hack: init to false */
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PARTICIPANT_GUID | 0x000c |
* +---------------+---------------+---------------+---------------+
* | guid[0] | guid[1] | guid[2] | guid[3] |
* +---------------+---------------+---------------+---------------+
* | guid[4] | guid[5] | guid[6] | guid[7] |
* +---------------+---------------+---------------+---------------+
* | guid[8] | guid[9] | guid[10] | guid[11] |
* +---------------+---------------+---------------+---------------+
*/
case PID_PARTICIPANT_GUID:
if (version < 0x0200) {
ENSURE_LENGTH(12);
rtps_util_add_generic_guid_v1(rtps_parameter_tree, tvb, offset,
hf_rtps_participant_guid_v1, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id_v1, hf_rtps_param_app_kind,
hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind);
} else {
ENSURE_LENGTH(16);
rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
}
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_PARTICIPANT_ENTITY_ID | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | entity[0] | entity[1] | entity[2] | entity[3] |
* +---------------+---------------+---------------+---------------+
*/
case PID_PARTICIPANT_ENTITY_ID:
ENSURE_LENGTH(4);
rtps_util_add_generic_entity_id(rtps_parameter_tree, tvb, offset, "Participant entity ID",
hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, ett_rtps_entity);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_GROUP_GUID | 0x000c |
* +---------------+---------------+---------------+---------------+
* | guid[0] | guid[1] | guid[2] | guid[3] |
* +---------------+---------------+---------------+---------------+
* | guid[4] | guid[5] | guid[6] | guid[7] |
* +---------------+---------------+---------------+---------------+
* | guid[8] | guid[9] | guid[10] | guid[11] |
* +---------------+---------------+---------------+---------------+
*/
case PID_GROUP_GUID:
if (version < 0x0200) {
ENSURE_LENGTH(12);
rtps_util_add_generic_guid_v1(rtps_parameter_tree, tvb, offset,
hf_rtps_group_guid_v1, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id_v1, hf_rtps_param_app_kind,
hf_rtps_param_entity, hf_rtps_param_entity_key, hf_rtps_param_entity_kind);
} else {
ENSURE_LENGTH(16);
rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_group_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
}
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_GROUP_ENTITY_ID | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | entity[0] | entity[1] | entity[2] | entity[3] |
* +---------------+---------------+---------------+---------------+
*/
case PID_GROUP_ENTITY_ID:
ENSURE_LENGTH(4);
rtps_util_add_generic_entity_id(rtps_parameter_tree, tvb, offset, "Group entity ID",
hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, ett_rtps_entity);
break;
/* ==================================================================
* Here are all the deprecated items.
*/
case PID_PERSISTENCE:
ENSURE_LENGTH(8);
rtps_util_add_timestamp_sec_and_fraction(rtps_parameter_tree, tvb, offset, encoding,
hf_rtps_persistence);
break;
case PID_TYPE_CHECKSUM:
ENSURE_LENGTH(4);
proto_tree_add_checksum(rtps_parameter_tree, tvb, offset, hf_rtps_type_checksum, -1, NULL, pinfo, 0, encoding, PROTO_CHECKSUM_NO_FLAGS);
break;
case PID_EXPECTS_ACK:
ENSURE_LENGTH(1);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_expects_ack, tvb, offset, 1, ENC_NA );
break;
case PID_MANAGER_KEY: {
int i = 0;
uint32_t manager_key;
subtree = proto_tree_add_subtree(rtps_parameter_tree, tvb, offset, param_length, ett_rtps_manager_key, NULL, "Manager Keys");
while (param_length >= 4) {
manager_key = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_uint_format(subtree, hf_rtps_manager_key, tvb, offset, 4,
manager_key, "Key[%d]: 0x%X", i, manager_key);
++i;
offset +=4;
param_length -= 4; /* decrement count */
}
break;
}
case PID_RECV_QUEUE_SIZE:
case PID_SEND_QUEUE_SIZE:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_queue_size, tvb, offset, 4, encoding);
break;
case PID_VARGAPPS_SEQUENCE_NUMBER_LAST:
ENSURE_LENGTH(4);
rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset, encoding, "sequenceNumberLast");
break;
case PID_SENTINEL:
/* PID_SENTINEL should ignore any value of parameter length */
break;
/* This is the default branch when we don't have enough information
* on how to decode the parameter. It can be used also for known
* parameters.
*/
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | <pid_id> | 0x0000 |
* +---------------+---------------+---------------+---------------+
*/
case PID_TYPE2_NAME:
case PID_TYPE2_CHECKSUM:
case PID_RELIABILITY_ENABLED:
expert_add_info(pinfo, parameter_item, &ei_rtps_parameter_not_decoded);
/* Fall Through */
case PID_PAD:
if (param_length > 0) {
proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_data, tvb,
offset, param_length, ENC_NA);
}
break;
default:
return false;
}
return true;
}
static bool dissect_parameter_sequence_v2(proto_tree *rtps_parameter_tree, packet_info *pinfo, tvbuff_t *tvb,
proto_item *parameter_item _U_, proto_item *param_len_item,
int offset, const unsigned encoding, int param_length,
uint16_t parameter, uint32_t *pStatusInfo, uint16_t vendor_id _U_,
type_mapping * type_mapping_object,
coherent_set_entity_info *coherent_set_entity_info_object _U_) {
proto_item *ti;
switch(parameter) {
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_STATUS_INFO | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | long statusInfo |
* +---------------+---------------+---------------+---------------+
*/
case PID_STATUS_INFO: {
bool* is_data_session_intermediate = NULL;
ENSURE_LENGTH(4);
/* PID_STATUS_INFO is always coded in network byte order (big endian) */
proto_tree_add_bitmask(rtps_parameter_tree, tvb, offset,
hf_rtps_param_status_info_flags, ett_rtps_flags,
STATUS_INFO_FLAGS, ENC_BIG_ENDIAN);
if (pStatusInfo != NULL) {
*pStatusInfo = tvb_get_ntohl(tvb, offset);
}
is_data_session_intermediate = (bool*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY);
if (is_data_session_intermediate != NULL) {
*is_data_session_intermediate = true;
}
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DIRECTED_WRITE | 0x0010 |
* +---------------+---------------+---------------+---------------+
* | |
* +- -+
* | octet[12] guidPrefix |
* +- -+
* | |
* +---------------+---------------+---------------+---------------+
* | octet[4] entityId |
* +---------------+---------------+---------------+---------------+
*/
case PID_DIRECTED_WRITE: {
ENSURE_LENGTH(16);
rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix,
hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id,
hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity,
"guidSuffix", NULL);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_KEY_HASH | xxxx |
* +---------------+---------------+---------------+---------------+
* | |
* +- -+
* | octet[xxxx] guid |
* +- -+
* | |
* +---------------+---------------+---------------+---------------+
* Differently from the other GUID, the KEY_HASH parameter may have
* variable length in the future.
* As consequence, no interpretation is performed here (and no check
* for size).
*/
case PID_KEY_HASH: {
uint8_t guidPart;
int i;
ti = proto_tree_add_bytes_format(rtps_parameter_tree, hf_rtps_guid, tvb, offset, param_length, NULL, "guid: ");
for (i = 0; i < param_length; ++i) {
guidPart = tvb_get_uint8(tvb, offset+i);
proto_item_append_text(ti, "%02x", guidPart);
if (( ((i+1) % 4) == 0 ) && (i != param_length-1) )
proto_item_append_text(ti, ":");
}
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TRANSPORT_PRIORITY | 0x0004 |
* +---------------+---------------+---------------+---------------+
* | unsigned long value |
* +---------------+---------------+---------------+---------------+
*/
case PID_TRANSPORT_PRIORITY:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_transport_priority, tvb, offset, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_CONTENT_FILTER_INFO | length |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*
* IDL:
* struct CONTENT_FILTER_SIGNATURE {
* sequence<long> filterBitmap;
* sequence<FILTER_SIGNATURE, 4> filterSignature;
* }
*
* where:
* struct FILTER_SIGNATURE {
* long filterSignature[4];
* }
*/
case PID_CONTENT_FILTER_INFO: {
uint32_t temp_offset;
uint32_t prev_offset;
uint32_t fs_elem;
uint32_t fs[4];
ENSURE_LENGTH(8);
/* Dissect filter bitmap */
temp_offset = rtps_util_add_seq_ulong(rtps_parameter_tree, tvb, offset,
hf_rtps_filter_bitmap, encoding, param_length, "filterBitmap");
/* Dissect sequence of FILTER_SIGNATURE */
fs_elem = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
while (fs_elem-- > 0) {
prev_offset = temp_offset;
/* Dissect the next FILTER_SIGNATURE object */
fs[0] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
fs[1] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
fs[2] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
fs[3] = tvb_get_uint32(tvb, temp_offset, encoding);
temp_offset += 4;
proto_tree_add_bytes_format_value(rtps_parameter_tree, hf_rtps_filter_signature, tvb, prev_offset, temp_offset - prev_offset, NULL, "%08x %08x %08x %08x",
fs[0], fs[1], fs[2], fs[3]);
}
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_BUILTIN_ENDPOINT_SET | length |
* +---------------+---------------+---------------+---------------+
* | long value |
* +---------------+---------------+---------------+---------------+
*/
case PID_BUILTIN_ENDPOINT_SET: {
uint32_t flags;
ENSURE_LENGTH(4);
flags = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_bitmask_value(rtps_parameter_tree, tvb, offset,
hf_rtps_param_builtin_endpoint_set_flags, ett_rtps_flags,
BUILTIN_ENDPOINT_FLAGS, flags);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_TYPE_MAX_SIZE_SERIALIZED | length |
* +---------------+---------------+---------------+---------------+
* | long value |
* +---------------+---------------+---------------+---------------+
*/
case PID_TYPE_MAX_SIZE_SERIALIZED:
ENSURE_LENGTH(4);
proto_tree_add_item(rtps_parameter_tree, hf_rtps_param_type_max_size_serialized, tvb, offset, 4, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_ORIGINAL_WRITER_INFO | length |
* +---------------+---------------+---------------+---------------+
* | |
* +- -+
* | octet[12] guidPrefix |
* +- -+
* | |
* +---------------+---------------+---------------+---------------+
* | octet[4] entityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_ORIGINAL_WRITER_INFO:
ENSURE_LENGTH(16);
rtps_util_add_guid_prefix_v2(rtps_parameter_tree, tvb, offset, hf_rtps_sm_guid_prefix,
hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
rtps_util_add_entity_id(rtps_parameter_tree, tvb, offset+12, hf_rtps_sm_entity_id,
hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind, ett_rtps_entity,
"virtualGUIDSuffix", NULL);
/* Sequence number */
rtps_util_add_seq_number(rtps_parameter_tree, tvb, offset+16,
encoding, "virtualSeqNumber");
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_ENTITY_NAME | length |
* +---------------+---------------+---------------+---------------+
* | unsigned long String.length |
* +---------------+---------------+---------------+---------------+
* | str[0] | str[1] | str[2] | str[3] |
* +---------------+---------------+---------------+---------------+
* | ... |
* +---------------+---------------+---------------+---------------+
*/
case PID_ENTITY_NAME:
rtps_util_add_string(rtps_parameter_tree, tvb, offset, hf_rtps_param_entity_name, encoding);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_ENDPOINT_GUID | 0x0010 |
* +---------------+---------------+---------------+---------------+
* | guid[0] | guid[1] | guid[2] | guid[3] |
* +---------------+---------------+---------------+---------------+
* | guid[4] | guid[5] | guid[6] | guid[7] |
* +---------------+---------------+---------------+---------------+
* | guid[8] | guid[9] | guid[10] | guid[11] |
* +---------------+---------------+---------------+---------------+
* | guid[12] | guid[13] | guid[14] | guid[15] |
* +---------------+---------------+---------------+---------------+
*/
case PID_ENDPOINT_GUID:
ENSURE_LENGTH(16);
rtps_util_store_type_mapping(pinfo, tvb, offset, type_mapping_object,
NULL, TOPIC_INFO_ADD_GUID);
rtps_util_add_generic_guid_v2(rtps_parameter_tree, tvb, offset,
hf_rtps_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
break;
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DATA_REPRESENTATION | length |
* +---------------+---------------+---------------+---------------+
* | uint32 SequenceSize |
* +---------------+---------------+---------------+---------------+
* | int16 DataRepresentationId[0] | int16 DataRepresentationId[1] |
* +---------------+-------------------------------+---------------+
* | ... | int16 DataRepresentationId[N] |
* +---------------+---------------+---------------+---------------+
* | uint32_t Compression_id (Optional) |
* +---------------+---------------+---------------+---------------+
* compression_iD flags:
* ZLIB: 0001b
* BZIP: 0010b
* LZ4: 0100b
*/
case PID_DATA_REPRESENTATION: {
proto_tree *data_representation_seq_subtree;
proto_item *item;
unsigned value;
unsigned item_offset;
unsigned seq_size;
unsigned counter = 0;
unsigned initial_offset = offset;
unsigned compression_id_offset = 0;
seq_size = tvb_get_uint32(tvb, offset, encoding);
data_representation_seq_subtree = proto_tree_add_subtree_format(rtps_parameter_tree, tvb, offset,
param_length, ett_rtps_data_representation, &item, "Data Representation Sequence[%d]", seq_size);
item_offset = offset + 4;
for (; counter < seq_size; ++counter) {
value = tvb_get_uint16(tvb, item_offset, encoding);
proto_tree_add_uint_format(data_representation_seq_subtree, hf_rtps_param_data_representation,
tvb, item_offset, 2, value, "[%d]: %s (0x%X)", counter,
val_to_str(value, data_representation_kind_vals, "Unknown data representation value: %u"),
value);
item_offset += 2;
}
compression_id_offset = item_offset;
ALIGN_ME(compression_id_offset, 4);
if (compression_id_offset - initial_offset >= 4) {
proto_tree_add_bitmask(
rtps_parameter_tree,
tvb,
compression_id_offset,
hf_rtps_param_compression_id_mask,
ett_rtps_flags,
COMPRESSION_ID_MASK_FLAGS,
encoding);
}
break;
}
/* This parameter PID serializes a sequence number like the existing PID_COHERENT_SET */
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_GROUP_COHERENT_SET | length |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber seqNumber +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_GROUP_COHERENT_SET: {
uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset + 4, encoding);
uint64_t all = (hi << 32) | lo;
proto_tree_add_uint64(
rtps_parameter_tree,
hf_rtps_param_group_coherent_set,
tvb, offset,
sizeof(uint64_t),
all);
break;
}
/* This parameter serializes a sequence number like the existing PID_COHERENT_SET
* and only applies to an end coherent set sample.
*/
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_END_GROUP_COHERENT_SET | length |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber seqNumber +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_END_GROUP_COHERENT_SET: {
uint64_t hi = (uint64_t)tvb_get_uint32(tvb, offset, encoding);
uint64_t lo = (uint64_t)tvb_get_uint32(tvb, offset + 4, encoding);
uint64_t all = (hi << 32) | lo;
proto_tree_add_uint64(
rtps_parameter_tree,
hf_rtps_param_end_group_coherent_set,
tvb, offset,
sizeof(uint64_t),
all);
break;
}
/* This parameter serializes a SN like the existing PID_COHERENT_SET and
* only applies to an end coherent set sample.
* Since there are different ways to finish a coherent set it is necessary
* to store information about the available coherent sets. this PID requires
* set the corrresponding coherence set as "is_set".
*/
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_END_COHERENT_SET | length |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber seqNumber +
* | |
* +---------------+---------------+---------------+---------------+
*/
case PID_END_COHERENT_SET: {
coherent_set_key coherent_set_info_key;
uint64_t coherent_seq_number = 0;
coherent_set_entity_info *register_entry = NULL;
coherent_set_info *coherent_set_info_entry;
coherent_seq_number = rtps_util_add_seq_number(
rtps_parameter_tree,
tvb,
offset,
encoding,
"coherenceSetSequenceNumber");
ti = proto_tree_add_uint64(
rtps_parameter_tree,
hf_rtps_coherent_set_end,
tvb,
0,
0,
coherent_seq_number);
proto_item_set_generated(ti);
/* Need to finish the stored coherence set */
if (coherent_set_entity_info_object != NULL) {
register_entry = (coherent_set_entity_info*)wmem_map_lookup(
coherent_set_tracking.entities_using_map,
&coherent_set_entity_info_object->guid);
if (register_entry) {
register_entry->coherent_set_seq_number = coherent_seq_number;
memset(&coherent_set_info_key, 0, sizeof(coherent_set_info_key));
coherent_set_info_key.guid = register_entry->guid;
coherent_set_info_key.coherent_set_seq_number = register_entry->coherent_set_seq_number;
coherent_set_info_entry = (coherent_set_info*)wmem_map_lookup(
coherent_set_tracking.coherent_set_registry_map,
&coherent_set_info_key);
if (coherent_set_info_entry) {
/* The coherence set is completely set up */
coherent_set_info_entry->is_set = true;
/* Updating by last time the writer_seq_number */
coherent_set_info_entry->writer_seq_number = coherent_set_entity_info_object->writer_seq_number;
}
}
}
break;
}
/* This parameter serializes a long (4-byte integer) and only applies to an end coherent set sample */
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | MIG..._SET_SAMPLE_COUNT | length |
* +---------------+---------------+---------------+---------------+
* + sampleCount +
* +---------------+---------------+---------------+---------------+
*/
case MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT: {
uint32_t sample_count = tvb_get_uint32(tvb, offset, encoding);
proto_tree_add_uint(
rtps_parameter_tree,
hf_rtps_param_mig_end_coherent_set_sample_count,
tvb, offset,
sizeof(uint32_t),
sample_count);
break;
}
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PID_DEFAULT_MULTICAST_LOCATOR | 0x0018 |
* +---------------+---------------+---------------+---------------+
* | long kind |
* +---------------+---------------+---------------+---------------+
* | long port |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[0] | ipv6addr[1] | ipv6addr[2] | ipv6addr[3] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[4] | ipv6addr[5] | ipv6addr[6] | ipv6addr[7] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[8] | ipv6addr[9] | ipv6addr[10] | ipv6addr[11] |
* +---------------+---------------+---------------+---------------+
* | ipv6addr[12] | ipv6addr[13] | ipv6addr[14] | ipv6addr[15] |
* +---------------+---------------+---------------+---------------+
*/
case PID_DEFAULT_MULTICAST_LOCATOR: {
ENSURE_LENGTH(24);
rtps_util_add_locator_t(rtps_parameter_tree, pinfo, tvb, offset, encoding, "locator");
break;
}
default:
return false;
} /* End of switch(parameter) */
return true;
}
#undef ENSURE_LENGTH
static int dissect_parameter_sequence(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb,
int offset, const unsigned encoding, unsigned size, const char *label,
uint16_t version, uint32_t *pStatusInfo, uint16_t vendor_id,
bool is_inline_qos, coherent_set_entity_info *coherent_set_entity_info_object) {
proto_item *ti, *param_item, *param_len_item = NULL;
proto_tree *rtps_parameter_sequence_tree, *rtps_parameter_tree;
uint32_t parameter, param_length, param_length_length = 2;
int original_offset = offset, initial_offset = offset;
type_mapping * type_mapping_object = NULL;
const char * param_name = NULL;
if (!pinfo->fd->visited) {
/*
* At minimum, type_mapping_object->fields_visited must be
* initialized to 0, because we haven't visited any fields
* yet. The routines that visit fields just set individual
* bits in type_mapping_object->fields_visited; they don't
* initialize it.
*/
type_mapping_object = wmem_new(wmem_file_scope(), type_mapping);
type_mapping_object->fields_visited = 0;
type_mapping_object->guid.fields_present = 0;
}
rtps_parameter_sequence_tree = proto_tree_add_subtree_format(tree, tvb, offset, size,
ett_rtps_parameter_sequence, &ti, "%s:", label);
/* Loop through all the parameters defined until PID_SENTINEL is found */
for (;;) {
size -= offset - original_offset;
if (size < 4) {
expert_add_info_format(pinfo, (param_len_item == NULL) ? ti : param_len_item,
&ei_rtps_parameter_value_invalid, "ERROR: not enough bytes to read the next parameter");
return offset + size;
}
original_offset = offset;
/* Reads parameter and create the sub tree. At this point we don't know
* the final string that will identify the node or its length. It will
* be set later...
*/
parameter = tvb_get_uint16(tvb, offset, encoding);
param_length = tvb_get_uint16(tvb, offset+2, encoding);
if ((parameter & PID_EXTENDED) == PID_EXTENDED) {
offset += 4;
/* get extended member id and length */
parameter = tvb_get_uint32(tvb, offset, encoding);
param_length = tvb_get_uint32(tvb, offset+4, encoding);
param_length_length = 4;
}
if (version < 0x0200) {
rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
ett_rtps_parameter, ¶m_item, val_to_str(parameter, parameter_id_vals, "Unknown (0x%04x)"));
proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id, tvb, offset, 2, parameter);
} else {
bool goto_default = true;
switch(vendor_id) {
case RTPS_VENDOR_RTI_DDS:
case RTPS_VENDOR_RTI_DDS_MICRO: {
if (is_inline_qos) {
param_name = try_val_to_str(parameter, parameter_id_inline_qos_rti);
if (param_name != NULL) {
rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
ett_rtps_parameter, ¶m_item, val_to_str(parameter, parameter_id_inline_qos_rti, "Unknown (0x%04x)"));
proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_inline_rti, tvb, offset,
param_length_length, parameter);
goto_default = false;
}
} else {
param_name = try_val_to_str(parameter, parameter_id_rti_vals);
if (param_name != NULL) {
rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
ett_rtps_parameter, ¶m_item, val_to_str(parameter, parameter_id_rti_vals, "Unknown (0x%04x)"));
proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_rti, tvb, offset,
param_length_length, parameter);
goto_default = false;
}
}
break;
}
case RTPS_VENDOR_TOC: {
param_name = try_val_to_str(parameter, parameter_id_toc_vals);
if (param_name != NULL) {
rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
ett_rtps_parameter, ¶m_item, val_to_str(parameter, parameter_id_toc_vals, "Unknown (0x%04x)"));
proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_toc, tvb, offset,
param_length_length, parameter);
goto_default = false;
}
break;
}
case RTPS_VENDOR_ADL_DDS: {
param_name = try_val_to_str(parameter, parameter_id_adl_vals);
if (param_name != NULL) {
rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
ett_rtps_parameter, ¶m_item, val_to_str(parameter, parameter_id_adl_vals, "Unknown (0x%04x)"));
proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_adl, tvb, offset,
param_length_length, parameter);
goto_default = false;
}
break;
}
}
if (goto_default) {
rtps_parameter_tree = proto_tree_add_subtree(rtps_parameter_sequence_tree, tvb, offset, -1,
ett_rtps_parameter, ¶m_item, val_to_str(parameter, parameter_id_v2_vals, "Unknown (0x%04x)"));
proto_tree_add_uint(rtps_parameter_tree, hf_rtps_parameter_id_v2, tvb, offset,
param_length_length, parameter);
}
}
/* after param_id */
offset += param_length_length;
if (parameter == PID_SENTINEL) {
/* PID_SENTINEL closes the parameter list, (length is ignored) */
proto_item_set_len(param_item, 4);
offset += 2;
proto_item_set_len(rtps_parameter_sequence_tree, offset - initial_offset);
return offset;
}
/* parameter length */
param_len_item = proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_length,
tvb, offset, param_length_length, encoding);
offset += param_length_length;
/* Make sure we have enough bytes for the param value */
if ((size-4 < param_length) &&
(parameter != PID_SENTINEL)) {
expert_add_info_format(pinfo, param_len_item, &ei_rtps_parameter_value_invalid, "Not enough bytes to read the parameter value");
return offset + size;
}
/* Sets the end of this item (now we know it!) */
proto_item_set_len(param_item, param_length+2*param_length_length);
/* This way, we can include vendor specific dissections without modifying the main ones */
if (!dissect_parameter_sequence_v1(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item,
offset, encoding, size, param_length, parameter, version, type_mapping_object, coherent_set_entity_info_object)) {
if ((version < 0x0200) ||
!dissect_parameter_sequence_v2(rtps_parameter_tree, pinfo, tvb, param_item, param_len_item,
offset, encoding, param_length, parameter,
pStatusInfo, vendor_id, type_mapping_object, coherent_set_entity_info_object)) {
if (param_length > 0) {
proto_tree_add_item(rtps_parameter_tree, hf_rtps_parameter_data, tvb,
offset, param_length, ENC_NA);
}
}
}
switch (vendor_id) {
case RTPS_VENDOR_RTI_DDS:
case RTPS_VENDOR_RTI_DDS_MICRO: {
dissect_parameter_sequence_rti_dds(rtps_parameter_tree, pinfo, tvb,
param_item, param_len_item, offset, encoding, param_length, parameter, type_mapping_object, is_inline_qos, vendor_id);
break;
}
case RTPS_VENDOR_TOC: {
dissect_parameter_sequence_toc(rtps_parameter_tree, pinfo, tvb,
param_item, param_len_item, offset, encoding, param_length, parameter);
break;
}
case RTPS_VENDOR_ADL_DDS: {
dissect_parameter_sequence_adl(rtps_parameter_tree, pinfo, tvb,
param_item, param_len_item, offset, encoding, param_length, parameter);
break;
}
default:
break;
}
rtps_util_insert_type_mapping_in_registry(pinfo, type_mapping_object);
offset += param_length;
}
return offset;
}
static bool rtps_is_ping(tvbuff_t *tvb, packet_info *pinfo, int offset)
{
bool is_ping = false;
if (!tvb_strneql(tvb, offset, "NDDSPING", 8))
is_ping = true;
if (is_ping)
col_set_str(pinfo->cinfo, COL_INFO, "PING");
return is_ping;
}
/* *********************************************************************** */
/* * A P P_ A C K_ C O N F * */
/* *********************************************************************** */
static void dissect_APP_ACK_CONF(tvbuff_t *tvb,
packet_info *pinfo _U_,
int offset,
uint8_t flags,
const unsigned encoding,
int octets_to_next_header,
proto_tree *tree,
proto_item *item,
endpoint_guid * guid)
{
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | APP_ACK_CONF |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* + unsigned long virtualWriterCount +
* +---------------+---------------+---------------+---------------+
* | GuidPrefix virtualWriterGuidPrefix |
* +---------------+---------------+---------------+---------------+
* EntityId virtualWriterObjectId
*
* (after last interval) unsigned long virtualWriterEpoch
*
*/
int original_offset; /* Offset to the readerEntityId */
int32_t virtual_writer_count;
uint32_t wid;
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, APP_ACK_CONF_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding);
offset += 4;
original_offset = offset;
if (octets_to_next_header < 20) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 20);
return;
}
/* readerEntityId */
rtps_util_add_entity_id(tree,
tvb,
offset,
hf_rtps_sm_rdentity_id,
hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind,
ett_rtps_rdentity,
"readerEntityId",
NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree,
tvb,
offset,
hf_rtps_sm_wrentity_id,
hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind,
ett_rtps_wrentity,
"writerEntityId",
&wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* virtualWriterCount */
proto_tree_add_item_ret_uint(tree, hf_rtps_param_app_ack_conf_virtual_writer_count, tvb, offset, 4,
encoding, &virtual_writer_count);
offset += 4;
{
/* Deserialize Virtual Writers */
proto_tree *sil_tree_writer_list;
proto_tree *sil_tree_writer;
int32_t current_writer_index = 0;
/** Writer list **/
sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
ett_rtps_app_ack_virtual_writer_list, NULL, "Virtual Writer List");
current_writer_index = 0;
while (current_writer_index < virtual_writer_count) {
sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1,
ett_rtps_app_ack_virtual_writer, NULL, "virtualWriter[%d]", current_writer_index);
/* Virtual Writer Guid */
rtps_util_add_guid_prefix_v2(sil_tree_writer, tvb, offset,
hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
hf_rtps_sm_instance_id, 0);
rtps_util_add_entity_id(sil_tree_writer, tvb, offset+12,
hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key, hf_rtps_sm_entity_id_kind,
ett_rtps_entity, "virtualGUIDSuffix", NULL);
offset += 16;
/* Counter */
proto_tree_add_item(tree, hf_rtps_param_app_ack_conf_count, tvb, offset, 4, encoding);
offset += 4;
current_writer_index++;
} /* virtual_writer_count */
}
if (offset < original_offset + octets_to_next_header)
{
/* In this case there must be something wrong in the bitmap: there
* are some extra bytes that we don't know how to decode
*/
expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset);
}
else if (offset > original_offset + octets_to_next_header)
{
/* Decoding the bitmap went over the end of this submessage.
* Enter an item in the protocol tree that spans over the entire
* submessage.
*/
expert_add_info(pinfo, item, &ei_rtps_missing_bytes);
}
}
static void dissect_parameterized_serialized_data(proto_tree *tree, tvbuff_t *tvb,
int offset_input, int size, const unsigned encoding)
{
uint32_t member_id, member_length;
proto_item * ti;
proto_tree * data_tree, * member_tree;
int offset = offset_input;
int deserialized_size = 0;
data_tree = proto_tree_add_subtree_format(tree, tvb, offset, -1,
ett_rtps_serialized_data, &ti, "serializedData");
while (deserialized_size < size) {
ALIGN_ZERO(offset, 2, offset_input);
member_id = tvb_get_uint16(tvb, offset, encoding);
member_length = tvb_get_uint16(tvb, offset+2, encoding);
if ((member_id & PID_EXTENDED) == PID_EXTENDED) {
member_id = tvb_get_uint32(tvb, offset+4, encoding);
member_length = tvb_get_uint32(tvb, offset+8, encoding);
member_tree = proto_tree_add_subtree_format(data_tree, tvb, offset, member_length + 12,
ett_rtps_data_member, NULL, "Member (id = %u, len = %u)", member_id, member_length);
proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_id_ext, tvb, offset+4, 4, encoding);
proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_length_ext, tvb, offset+8, 4, encoding);
offset += 12;
deserialized_size += 12;
} else if ((member_id & PID_LIST_END) == PID_LIST_END){
/* If this is the end of the list, don't add a tree.
* If we add more logic here in the future, take into account that
* offset is incremented by 4 */
deserialized_size += 4;
break;
} else {
member_tree = proto_tree_add_subtree_format(data_tree, tvb, offset, member_length + 4,
ett_rtps_data_member, NULL, "Member (id = %u, len = %u)", member_id, member_length);
proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_id, tvb, offset, 2, encoding);
proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member_length, tvb, offset+2, 2, encoding);
offset += 4;
deserialized_size += 4;
}
proto_tree_add_item(member_tree, hf_rtps_pl_cdr_member, tvb, offset,
member_length, encoding);
offset = check_offset_addition(offset, member_length, tree, NULL, tvb);
deserialized_size += member_length;
}
proto_item_set_len(ti, deserialized_size);
}
/************************************************************************ */
/* Encapsulated data * */
/* ********************************************************************** */
/*
* Note: the encapsulation header is ALWAYS big endian, then the encapsulation
* type specified the type of endianness of the payload.
* 0...2...........8...............16..............24..............32
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*| representation_identifier | X X X X X X X X X X X | C C C P P |
*+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*~ ~
* ~... Bytes of data representation using a format that ... ~
* ~... depends on the RepresentationIdentifier and options ... ~
* ~ ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* X = Unused options bits
* C = Compression bits
* P = Padding bits
*
* If compressed:
* 0...2...........8...............16..............24..............32
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | representation_identifier | X X X X X X X X X X X | C C C P P |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Uncompressed Length ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ *Extended Compression Options ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Compressed User Data ... ~
* ~ ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* C = 0b111 would be extended compression options which would come in as an
* additional header before the payload.
* C = 0b000 to indicate no compression
*
* This options field would be used for future enhancements.For example,
* could be used to define a custom compressor plugin for matching purposes.
*/
/* Dissects the encapsultaion header and uncompress the serialized
* data if is is compressed and it is compressed in using Zlib.
*
* @param[in] tree
* @param[in] packet info.
* @param[in] tvb
* @param[in] offset offset at the beginning of the encapsulation id.
* @param[in] size in bytes from the initial offset to the end of the serialized data
* @param[in] uncompress_if_compressed true for uncompressing if the data should be uncompressed.
* @param[out] encapsulation_id_out If not null it will contain the encapsultaion_id
* @param[out] compression_option_out If not null it will contain the compression option
* @param[out] padding_bytes_out If not null it will contain the padding bytes
* @param[out] extended_compression_options_out If not null it will contain the extended compression options
* @param[out] extended_header_bits_out If not null it will contain the extended header bits
* @param[out] is_compressed_out If not null it will indicate if the serielized data is compressed
* @param[out] uncompressed_ok_out If not null it will indicate if the serizlized data has been successfully uncompressed
* @param[out] uncompressed_tvb_out If not null it will contain the uncompressed tvb pointer. If the seriaized data is not uncompressed it will return NULL.
* @param[out] compressed_data_tree_out If not null it will contain the subtree of the uncompressed data.
*
* @return the offset after the at the beginining of the serialized data
* @note All output parameters are optional.
*/
static
int rtps_prepare_encapsulated_data(
proto_tree *tree,
packet_info *pinfo,
tvbuff_t *tvb,
int offset,
int size,
bool uncompress_if_compressed,
uint16_t *encapsulation_id_out,
uint8_t *compression_option_out,
uint8_t *padding_bytes_out,
uint32_t *extended_compression_options_out,
uint8_t *extended_header_bits_out,
bool *is_compressed_out,
bool *uncompressed_ok_out,
tvbuff_t **uncompressed_tvb_out,
proto_tree **compressed_data_tree_out) {
int initial_offset = offset;
int16_t encapsulation_options = 0;
uint32_t compressed_size = 0;
uint32_t uncompressed_size = 0;
uint16_t encapsulation_id = 0;
uint8_t compression_option = 0;
uint8_t padding_bytes = 0;
uint32_t extended_compression_options = 0;
uint8_t extended_header_bits = 0;
bool is_compressed = 0;
bool uncompressed_ok = 0;
tvbuff_t *uncompressed_tvb = NULL;
/* This logic applies to data that is not a fragment (-1) or is the first fragment */
/* Encapsulation ID */
encapsulation_id = tvb_get_ntohs(tvb, offset); /* Always big endian */
proto_tree_add_uint(tree,
hf_rtps_param_serialize_encap_kind, tvb, offset, 2, encapsulation_id);
offset += 2;
offset = rtps_util_dissect_encapsulation_options(
tree,
tvb,
offset,
&encapsulation_options,
&compression_option,
&padding_bytes,
&extended_header_bits);
/* If compressed on a supported format we have to uncompress it on a new tvb
* and reset the offset */
is_compressed = (encapsulation_options & ENCAPSULATION_OPTIONS_COMPRESSION_BYTES_MASK) != 0;
if (is_compressed) {
uncompressed_size = tvb_get_int32(tvb, offset, ENC_BIG_ENDIAN);
proto_tree_add_item(
tree,
hf_rtps_uncompressed_serialized_length,
tvb,
offset,
4,
ENC_BIG_ENDIAN);
offset += 4;
/* Get the compression extended options if required */
if (extended_header_bits == ENCAPSULATION_OPTIONS_COMPRESSION_EXTENDED_HEADER_VALUE) {
extended_compression_options = tvb_get_int32(tvb, offset, ENC_BIG_ENDIAN);
proto_tree_add_item(
tree,
hf_rtps_encapsulation_extended_compression_options,
tvb,
offset,
4,
ENC_BIG_ENDIAN);
offset += 4;
}
/* Get the compressed size. Padding bytes are the padding at the end of the compressed data */
compressed_size = size - (offset - initial_offset) - padding_bytes;
}
/* Only decompress if it is compressed with ZLIB */
if (uncompress_if_compressed && (compression_option == RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB)) {
bool tried_to_uncompress = false;
proto_item *uncompressed_data_item = NULL;
/* Try to uncompress the data */
uncompressed_tvb = rtps_util_get_uncompressed_tvb_zlib(
tvb,
offset,
compressed_size,
&tried_to_uncompress);
/* The uncompressed data size must be the same as it is in the "Uncompressed Length" field */
uncompressed_ok = (uncompressed_tvb != NULL
&& (uncompressed_size == (uint32_t)tvb_reported_length(uncompressed_tvb)));
/* If uncompression went well we have a new tvb that holds the uncompressed data */
if (tried_to_uncompress) {
tvbuff_t *child_tvb = NULL;
int child_size = 0;
int child_offset = 0;
/* If the tvb is not uncompressed we add use the ovb, offset and size
* of the original tvb */
if (uncompressed_tvb != NULL) {
child_tvb = uncompressed_tvb;
child_size = -1;
child_offset = 0;
} else {
child_tvb = tvb;
child_size = compressed_size;
child_offset = offset;
}
/* Uncompressed sample hangs from a different subtree */
*compressed_data_tree_out = proto_tree_add_subtree(
tree,
child_tvb,
child_offset,
child_size,
ett_rtps_decompressed_serialized_data,
&uncompressed_data_item,
"[Decompressed data]");
/* If we tried to decompress we need to add hf_rtps_uncompression_ok set to true or false*/
if (!(uncompressed_ok)) {
expert_add_info_format(
pinfo,
uncompressed_data_item,
&ei_rtps_uncompression_error,
"Error: unable to uncompress payload");
}
}
}
/* Set the optional output parameters */
if (encapsulation_id_out != NULL) {
*encapsulation_id_out = encapsulation_id;
}
if (compression_option_out != NULL) {
*compression_option_out = compression_option;
}
if (padding_bytes_out != NULL) {
*padding_bytes_out = padding_bytes;
}
if (extended_compression_options_out != NULL) {
*extended_compression_options_out = extended_compression_options;
}
if (extended_header_bits_out != NULL) {
*extended_header_bits_out = extended_header_bits;
}
if (is_compressed_out != NULL) {
*is_compressed_out = is_compressed;
}
if (uncompressed_ok_out != NULL) {
*uncompressed_ok_out = uncompressed_ok;
}
if (uncompressed_tvb_out != NULL) {
*uncompressed_tvb_out = uncompressed_tvb;
}
return offset;
}
/* *********************************************************************** */
/* * Serialized data dissector * */
/* *********************************************************************** */
/* Note: the encapsulation header is ALWAYS big endian, then the encapsulation
* type specified the type of endianness of the payload.
*
* Fragmentation : Options only appear on first fragment
* Serieaized data might be compressed or uncompressed. Depending on that the
* header contains more elements. This is indicated in the encapsulation
* options where:
*
* X = Unused options bits
* C = Compression bits
* P = Padding bits
*
* 0...2...........8...............16..............24..............32
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | representation_identifier |X X X X X X X X X X X|C C C P P|
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ ~
* ~ ... Bytes of data representation using a format that ... ~
* ~ ... depends on the RepresentationIdentifier and options ... ~
* ~ ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* If compressed:
*
* 0...2...........8...............16..............24..............32
* + -+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | representation_identifier | X X X X X X X X X X X | C C C P P |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Uncompressed Length ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ *Extended Compression Options ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* ~ Compressed User Data ... ~
* ~ ~
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
* C = 0b111 would be extended compression options which would come in as an
* additional header before the payload.
* C = 0b000 to indicate no compression
*
* *This options field would be used for future enhancements.For example,
* could be used to define a custom compressor plugin for matching purposes.
*
*/
static void dissect_serialized_data(proto_tree *tree, packet_info *pinfo, tvbuff_t *tvb, int offset,
int size, const char *label, uint16_t vendor_id, bool is_discovery_data,
endpoint_guid * guid, int32_t frag_number /* -1 if no fragmentation */) {
proto_item *ti;
proto_tree *rtps_parameter_sequence_tree;
uint16_t encapsulation_id;
bool try_dissection_from_type_object = false;
unsigned encapsulation_encoding = ENC_BIG_ENDIAN;
rtps_dissector_data * data = wmem_new(wmem_packet_scope(), rtps_dissector_data);
tvbuff_t *data_holder_tvb = tvb;
tvbuff_t *compressed_tvb = NULL;
proto_tree *dissected_data_holder_tree = NULL;
bool is_compressed = false;
bool uncompressed_ok = false;
proto_tree *compressed_subtree = NULL;
data->encapsulation_id = 0;
data->position_in_batch = -1;
/* Creates the sub-tree */
rtps_parameter_sequence_tree = proto_tree_add_subtree(tree, tvb, offset, size,
ett_rtps_serialized_data, &ti, label);
/* We store thisa value for using later */
dissected_data_holder_tree = rtps_parameter_sequence_tree;
if (frag_number > 1) {
/* if the data is a fragment and not the first fragment, simply dissect the
content as raw bytes */
proto_tree_add_item(rtps_parameter_sequence_tree, hf_rtps_issue_data, tvb,
offset, size, ENC_NA);
} else {
/* Dissects the encapsulation header options and uncompress the tvb if it is
* compressed and can be uncompressed */
offset = rtps_prepare_encapsulated_data(
rtps_parameter_sequence_tree,
pinfo,
tvb,
offset,
size,
true,
&encapsulation_id,
NULL,
NULL,
NULL,
NULL,
&is_compressed,
&uncompressed_ok,
&compressed_tvb,
&compressed_subtree);
data->encapsulation_id = encapsulation_id;
if (is_compressed && uncompressed_ok) {
data_holder_tvb = compressed_tvb;
offset = 0;
dissected_data_holder_tree = compressed_subtree;
}
/* Sets the correct values for encapsulation_encoding */
encapsulation_encoding = get_encapsulation_endianness(encapsulation_id);
if (encapsulation_id == ENCAPSULATION_CDR_LE ||
encapsulation_id == ENCAPSULATION_CDR_BE ||
encapsulation_id == ENCAPSULATION_CDR2_LE ||
encapsulation_id == ENCAPSULATION_CDR2_BE ||
encapsulation_id == ENCAPSULATION_PL_CDR_LE ||
encapsulation_id == ENCAPSULATION_PL_CDR_BE) {
try_dissection_from_type_object = true;
}
/* In case it is compressed only try to dissect the type object if it is correctly uncompressed */
try_dissection_from_type_object = try_dissection_from_type_object
&& ((is_compressed == uncompressed_ok));
/* At this point:
* - uncompressed_tvb contains the uncompressed tvb or the packet tvb
* - compressed_data_tree points to the tree of the uncompressed data
* or the rtps_parameter_sequence_tree.
* - offset points to 0 of the uncompressed tvb or the offseet of the packet
* tvb if it is not decompressed.
* Only try to dissect the user data if it is not compressed or it is compressed and correctly uncompressed */
if (is_compressed == uncompressed_ok) {
if (rtps_util_try_dissector(dissected_data_holder_tree,
pinfo, data_holder_tvb, offset, guid, data, encapsulation_encoding,
get_encapsulation_version(encapsulation_id), try_dissection_from_type_object)) {
return;
}
/* The payload */
size -= 4;
switch (encapsulation_id) {
/* CDR_LE and CDR_BE data should be dissected like this if it is a fragment or
if it is not */
case ENCAPSULATION_CDR_LE:
case ENCAPSULATION_CDR_BE:
proto_tree_add_item(dissected_data_holder_tree, hf_rtps_issue_data, data_holder_tvb,
offset, size, ENC_NA);
break;
case ENCAPSULATION_PL_CDR_LE:
case ENCAPSULATION_PL_CDR_BE:
if (is_discovery_data) {
dissect_parameter_sequence(dissected_data_holder_tree, pinfo, data_holder_tvb, offset,
encapsulation_encoding, size, "serializedData", 0x0200, NULL, vendor_id, false, NULL);
}
else if (frag_number != NOT_A_FRAGMENT) {
/* fragments should be dissected as raw bytes (not parameterized) */
proto_tree_add_item(dissected_data_holder_tree, hf_rtps_issue_data, data_holder_tvb,
offset, size, ENC_NA);
break;
}
else {
/* Instead of showing a warning like before, we now dissect the data as
* (id - length - value) members */
dissect_parameterized_serialized_data(dissected_data_holder_tree,
data_holder_tvb, offset, size, encapsulation_encoding);
}
break;
default:
proto_tree_add_item(dissected_data_holder_tree, hf_rtps_data_serialize_data, tvb,
offset, size, ENC_NA);
}
}
}
}
/* *********************************************************************** */
/* * A P P_ A C K * */
/* *********************************************************************** */
static void dissect_APP_ACK(tvbuff_t *tvb,
packet_info *pinfo,
int offset,
uint8_t flags,
const unsigned encoding,
int octets_to_next_header,
proto_tree *tree,
proto_item *item,
endpoint_guid * guid)
{
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | APP_ACK |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* + unsigned long virtualWriterCount +
* +---------------+---------------+---------------+---------------+
* | GuidPrefix virtualWriterGuidPrefix |
* +---------------+---------------+---------------+---------------+
* EntityId virtualWriterObjectId
* unsigned short intervalCount | unsigned short bytesToNextVirtualWriter
*
* SequenceNumber intervalFirstSn
* SequenceNumber intervalLastSn
* unsigned short intervalFlags | unsigned short payloadLength
*
* (after last interval) unsigned long virtualWriterEpoch
*
*/
int original_offset; /* Offset to the readerEntityId */
int32_t virtual_writer_count;
uint32_t wid; /* Writer EntityID */
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, APP_ACK_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (octets_to_next_header < 56) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 56);
return;
}
offset += 4;
original_offset = offset;
/* readerEntityId */
rtps_util_add_entity_id(tree,
tvb,
offset,
hf_rtps_sm_rdentity_id,
hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind,
ett_rtps_rdentity,
"readerEntityId",
&wid);
offset += 4;
guid->entity_id = wid;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* writerEntityId */
rtps_util_add_entity_id(tree,
tvb,
offset,
hf_rtps_sm_wrentity_id,
hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind,
ett_rtps_wrentity,
"writerEntityId",
&wid);
offset += 4;
/* virtualWriterCount */
proto_tree_add_item_ret_int(tree, hf_rtps_param_app_ack_virtual_writer_count, tvb, offset, 4, encoding, &virtual_writer_count);
offset += 4;
{
/* Deserialize Virtual Writers */
proto_tree *sil_tree_writer_list;
int32_t current_writer_index;
int32_t current_interval_count;
/* uint16_t interval_flags = 0; */
/* uint32_t current_virtual_guid_index = 0;*/
/** Writer list **/
sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
ett_rtps_app_ack_virtual_writer_list, NULL, "Virtual Writer List");
current_writer_index = 0;
while (current_writer_index < virtual_writer_count) {
proto_tree *sil_tree_writer;
proto_tree *sil_tree_interval_list;
int32_t interval_count;
sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1,
ett_rtps_app_ack_virtual_writer, NULL, "virtualWriter[%d]", current_writer_index);
/* Virtual Writer Guid */
#if 0
rtps_util_add_generic_guid(sil_tree_writer,
tvb,
offset,
"virtualGUID",
buffer,
MAX_GUID_SIZE);
#endif
offset += 16;
/* Interval count */
proto_tree_add_item_ret_int(sil_tree_writer, hf_rtps_param_app_ack_interval_count,
tvb, offset, 2, encoding, &interval_count);
offset += 2;
/* bytes to next virtual writer */
proto_tree_add_item(sil_tree_writer, hf_rtps_param_app_ack_octets_to_next_virtual_writer,
tvb, offset, 2, encoding);
offset += 2;
/* Interval list */
sil_tree_interval_list = proto_tree_add_subtree_format(sil_tree_writer, tvb, offset, -1,
ett_rtps_app_ack_virtual_writer_interval_list, NULL, "Interval List");
current_interval_count = 0;
while (current_interval_count < interval_count) {
proto_tree *sil_tree_interval;
int32_t interval_payload_length;
sil_tree_interval = proto_tree_add_subtree_format(sil_tree_interval_list, tvb, offset, -1,
ett_rtps_app_ack_virtual_writer_interval, NULL, "Interval[%d]", current_interval_count);
/* firstVirtualSN */
rtps_util_add_seq_number(sil_tree_interval,
tvb,
offset,
encoding,
"firstVirtualSN");
offset += 8;
/* lastVirtualSN */
rtps_util_add_seq_number(sil_tree_interval,
tvb,
offset,
encoding,
"lastVirtualSN");
offset += 8;
/* interval flags */
proto_tree_add_item(sil_tree_interval, hf_rtps_param_app_ack_interval_flags,
tvb, offset, 2, encoding);
offset += 2;
/* interval payload length */
proto_tree_add_item_ret_int(sil_tree_interval, hf_rtps_param_app_ack_interval_payload_length,
tvb, offset, 2, encoding, &interval_payload_length);
offset += 2;
if (interval_payload_length > 0) {
proto_tree_add_item(sil_tree_interval, hf_rtps_serialized_data, tvb, offset,
interval_payload_length, ENC_NA);
offset += ((interval_payload_length + 3) & 0xfffffffc);
}
++current_interval_count;
} /* interval list */
/* Count */
proto_tree_add_item(tree, hf_rtps_param_app_ack_count, tvb, offset, 4, encoding);
offset += 4;
current_writer_index++;
} /* virtual_writer_count */
}
if (offset < original_offset + octets_to_next_header)
{
/* In this case there must be something wrong in the bitmap: there
* are some extra bytes that we don't know how to decode
*/
expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset);
}
else if (offset > original_offset + octets_to_next_header)
{
/* Decoding the bitmap went over the end of this submessage.
* Enter an item in the protocol tree that spans over the entire
* submessage.
*/
expert_add_info(pinfo, item, &ei_rtps_missing_bytes);
}
}
/* *********************************************************************** */
/* * P A D * */
/* *********************************************************************** */
static void dissect_PAD(tvbuff_t *tvb,
packet_info *pinfo,
int offset,
uint8_t flags,
const unsigned encoding,
int octets_to_next_header,
proto_tree *tree) {
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | PAD |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
*/
proto_item *item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, PAD_FLAGS, flags);
item = proto_tree_add_item(tree,
hf_rtps_sm_octets_to_next_header,
tvb,
offset + 2,
2,
encoding);
if (octets_to_next_header != 0) {
expert_add_info(pinfo, item, &ei_rtps_sm_octets_to_next_header_not_zero);
}
}
/* *********************************************************************** */
/* * D A T A * */
/* *********************************************************************** */
static void dissect_DATA_v1(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | DATA |X|X|X|U|H|A|P|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | ObjectId readerObjectId |
* +---------------+---------------+---------------+---------------+
* | ObjectId writerObjectId |
* +---------------+---------------+---------------+---------------+
* | HostId hostId (iff H==1) |
* +---------------+---------------+---------------+---------------+
* | AppId appId (iff H==1) |
* +---------------+---------------+---------------+---------------+
* | ObjectId objectId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterSequence parameters [only if P==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* Note: on RTPS 1.0, flag U is not present
*
* RTPS 1.2:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | DATA |X|X|U|Q|H|A|D|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + KeyHashPrefix keyHashPrefix [only if H==1] +
* | |
* +---------------+---------------+---------------+---------------+
* | KeyHashSuffix keyHashSuffix |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData [only if D==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* Notes:
* - inlineQos is NEW
* - serializedData is equivalent to the old 'parameters'
*/
int min_len;
bool is_builtin_entity = false; /* true=entityId.entityKind = built-in */
int old_offset = offset;
uint32_t wid; /* Writer EntityID */
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FLAGSv1, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage */
min_len = 20;
if ((flags & FLAG_DATA_H) != 0) min_len += 8;
if ((flags & FLAG_DATA_Q) != 0) min_len += 4;
if ((flags & FLAG_DATA_D) != 0) min_len += 4;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* readerEntityId */
is_builtin_entity |= rtps_util_add_entity_id(tree, tvb, offset,
hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind,
ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
is_builtin_entity |= rtps_util_add_entity_id(tree, tvb, offset,
hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind,
ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
/* Checks for predefined declarations
*
* writerEntityId value | A flag | Extra
* -------------------------------------------|--------|-------------
* ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER | 1 | r+
* ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER | 0 | r-
* ENTITYID_BUILTIN_PUBLICATIONS_WRITER | 1 | w+
* ENTITYID_BUILTIN_PUBLICATIONS_WRITER | 0 | w-
* ENTITYID_BUILTIN_PARTICIPANT_WRITER | 1 | p+
* ENTITYID_BUILTIN_PARTICIPANT_WRITER | 0 | p- (*)
* ENTITYID_BUILTIN_TOPIC_WRITER | 1 | t+ (*)
* ENTITYID_BUILTIN_TOPIC_WRITER | 0 | t- (*)
*
* Note (*): Currently NDDS does not publish those values
*/
if (wid == ENTITYID_BUILTIN_PUBLICATIONS_WRITER && (flags & FLAG_DATA_A) != 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_WPLUS);
} else if (wid == ENTITYID_BUILTIN_PUBLICATIONS_WRITER && (flags & FLAG_DATA_A) == 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_WMINUS);
} else if (wid == ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER && (flags & FLAG_DATA_A) != 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_RPLUS);
} else if (wid == ENTITYID_BUILTIN_SUBSCRIPTIONS_WRITER && (flags & FLAG_DATA_A) == 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_RMINUS);
} else if (wid == ENTITYID_BUILTIN_PARTICIPANT_WRITER && (flags & FLAG_DATA_A) != 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_PPLUS);
} else if (wid == ENTITYID_BUILTIN_PARTICIPANT_WRITER && (flags & FLAG_DATA_A) == 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_PMINUS);
} else if (wid == ENTITYID_BUILTIN_TOPIC_WRITER && (flags & FLAG_DATA_A) != 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_TPLUS);
} else if (wid == ENTITYID_BUILTIN_TOPIC_WRITER && (flags & FLAG_DATA_A) == 0) {
col_append_str(pinfo->cinfo, COL_INFO, SM_EXTRA_TMINUS);
}
/* If flag H is defined, read the HostId and AppId fields */
if ((flags & FLAG_DATA_H) != 0) {
rtps_util_add_guid_prefix_v1(tree, tvb, offset,
hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind,
"keyHashPrefix");
offset += 8;
} else {
/* Flag H not set, use hostId, appId from the packet header */
}
/* Complete the GUID by reading the Object ID */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key,
hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL);
offset += 4;
/* Sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
offset += 8;
/* InlineQos */
if ((flags & FLAG_DATA_Q) != 0) {
bool is_inline_qos = true;
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset,
encoding, octets_to_next_header, "inlineQos",
0x0102, NULL, 0, is_inline_qos, NULL);
}
/* SerializedData */
if ((flags & FLAG_DATA_D) != 0) {
if (is_builtin_entity) {
dissect_parameter_sequence(tree, pinfo, tvb, offset,
encoding, octets_to_next_header, "serializedData",
0x0102, NULL, 0, false, NULL);
} else {
proto_tree_add_item(tree, hf_rtps_issue_data, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
ENC_NA);
}
}
}
static void dissect_DATA_v2(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t vendor_id, endpoint_guid *guid) {
/*
*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | DATA |X|X|X|I|H|D|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + +
* | KeyHashPrefix keyHashPrefix [only if H==1] |
* + +
* | |
* +---------------+---------------+---------------+---------------+
* | KeyHashSuffix keyHashSuffix |
* +---------------+---------------+---------------+---------------+
* | StatusInfo statusInfo [only if I==1] |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData [only if D==1] ~
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
int old_offset = offset;
uint32_t wid; /* Writer EntityID */
uint32_t status_info = 0xffffffff;
proto_item *octet_item;
bool from_builtin_writer;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FLAGSv2, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage */
min_len = 20;
if ((flags & FLAG_DATA_Q_v2) != 0) min_len += 4;
if ((flags & FLAG_DATA_D_v2) != 0) min_len += 4;
if ((flags & FLAG_DATA_H) != 0) min_len += 12;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* Sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
offset += 8;
/* If flag H is defined, read the GUID Prefix */
if ((flags & FLAG_DATA_H) != 0) {
rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id,
hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
offset += 12;
} else {
/* Flag H not set, use hostId, appId from the packet header */
}
/* Complete the GUID by reading the Object ID */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key,
hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL);
offset += 4;
if ((flags & FLAG_DATA_I) != 0) {
proto_tree_add_item(tree, hf_rtps_data_status_info, tvb, offset, 4, encoding);
offset += 4;
}
/* InlineQos */
if ((flags & FLAG_DATA_Q_v2) != 0) {
bool is_inline_qos = true;
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4,
"inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL);
}
/* SerializedData */
if ((flags & FLAG_DATA_D_v2) != 0) {
from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
|| ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
dissect_serialized_data(tree, pinfo, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
"serializedData", vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT);
}
generate_status_info(pinfo, wid, status_info);
}
static void dissect_HEADER_EXTENSION(tvbuff_t* tvb, packet_info* pinfo, int offset, uint8_t flags,
const unsigned encoding, proto_tree* tree, int octets_to_next_header, uint16_t vendor_id) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | DATA_HE |P|C|C|W|U|T|L|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | MessageLength messageLength (Only if L == 1 ) |
* +---------------+---------------+---------------+---------------+
* | |
* + TimeStamp rtpsSendTimestamp (Only if T == 1 ) +
* | |
* +---------------+---------------+---------------+---------------+
* | UExtension4 uExtension (Only if U == 1 ) |
* +---------------+---------------+---------------+---------------+
* | |
* + WExtension8 wExtension8 (Only if W == 1 ) +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + Checksum messageChecksum (Only if CC != 00 ) +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + ParameterList parameters (Only if P != 0 ) +
* | |
* +---------------+---------------+---------------+---------------+
* C1,C2 == 01 -> 4 bytes checksum
* C1,C2 == 10 -> 8 bytes checksum
* C1,C2 == 11 -> 16 bytes checksum
*/
#define RTPS_HE_ENDIANESS_FLAG (0x01)
#define RTPS_HE_MESSAGE_LENGTH_FLAG (0x02)
#define RTPS_HE_TIMESTAMP_FLAG (0x04)
#define RTPS_HE_UEXTENSION_FLAG (0x08)
#define RTPS_HE_WEXTENSION_FLAG (0x10)
#define RTPS_HE_CHECKSUM_2_FLAG (0x20)
#define RTPS_HE_CHECKSUM_1_FLAG (0x40)
#define RTPS_HE_PARAMETERS_FLAG (0x80)
#define RTPS_HE_CHECKSUM_CRC32 RTPS_HE_CHECKSUM_2_FLAG
#define RTPS_HE_CHECKSUM_CRC64 RTPS_HE_CHECKSUM_1_FLAG
#define RTPS_HE_CHECKSUM_MD5 (RTPS_HE_CHECKSUM_1_FLAG | RTPS_HE_CHECKSUM_2_FLAG)
uint8_t checksum_type = 0;
int initial_offset = offset;
unsigned checksum_flags = PROTO_CHECKSUM_NO_FLAGS;
bool is_crc_supported = true;
/*Checksum can be CRC32, CRC64 and MD5 */
union _calculated_checksum {
uint8_t md5[RTPS_CHECKSUM_MAX_LEN];
uint32_t crc32c;
uint64_t crc64;
} calculated_checksum = {0}, he_checksum = {0};
++offset;
proto_tree_add_bitmask_value(
tree,
tvb,
offset,
hf_rtps_header_extension_flags,
ett_rtps_flags,
HEADER_EXTENSION_MASK_FLAGS,
flags);
++offset;
proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset, 2, encoding);
offset += 2;
if ((flags & RTPS_HE_MESSAGE_LENGTH_FLAG) == RTPS_HE_MESSAGE_LENGTH_FLAG) {
proto_tree_add_item(tree, hf_rtps_message_length, tvb, offset, 4, encoding);
offset += 4;
}
if ((flags & RTPS_HE_TIMESTAMP_FLAG) == RTPS_HE_TIMESTAMP_FLAG) {
rtps_util_add_timestamp(tree,
tvb, offset,
encoding,
hf_rtps_timestamp);
offset += 8;
}
if ((flags & RTPS_HE_UEXTENSION_FLAG) == RTPS_HE_UEXTENSION_FLAG) {
proto_tree_add_item(tree, hf_rtps_uextension, tvb, offset, 4, encoding);
offset += 4;
}
if ((flags & RTPS_HE_WEXTENSION_FLAG) == RTPS_HE_WEXTENSION_FLAG) {
proto_tree_add_item(tree, hf_rtps_wextension, tvb, offset, 8, encoding);
offset += 8;
}
checksum_type = (flags & (RTPS_HE_CHECKSUM_2_FLAG | RTPS_HE_CHECKSUM_1_FLAG));
if (checksum_type != 0) {
int checksum_len = 0;
/* Adds the CRC of the RTPS message */
switch (checksum_type) {
/* 32-bit checksum */
case RTPS_HE_CHECKSUM_CRC32:
checksum_len = 4;
break;
/* 64-bit checksum */
case RTPS_HE_CHECKSUM_CRC64:
checksum_len = 8;
is_crc_supported = false;
break;
/* 128-bit checksum */
case RTPS_HE_CHECKSUM_MD5:
checksum_len = 16;
break;
default:
break;
}
/* If the check CRC feature is enabled */
if (enable_rtps_crc_check && is_crc_supported) {
char* tvb_zero_checksum = NULL;
rtps_tvb_field *rtps_root = NULL;
checksum_flags = PROTO_CHECKSUM_VERIFY;
rtps_root = (rtps_tvb_field*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_ROOT_MESSAGE_KEY);
if (rtps_root != NULL) {
/* The checksum in the wire is the checksum of the RTPS message with the
* checksum field set to 0. To calculate the checksum of the RTPS message
* we need to set those bytes to 0 in a separate buffer.
*/
tvb_zero_checksum = wmem_alloc0_array(wmem_packet_scope(), char, rtps_root->tvb_len);
tvb_memcpy(
rtps_root->tvb,
tvb_zero_checksum,
rtps_root->tvb_offset,
rtps_root->tvb_len);
/* Set checksum bytes to 0 */
memset(tvb_zero_checksum + offset, 0, checksum_len);
switch (checksum_type) {
case RTPS_HE_CHECKSUM_CRC32:
/* Checksum is always big endian */
he_checksum.crc32c = tvb_get_uint32(tvb, offset, ENC_BIG_ENDIAN);
calculated_checksum.crc32c = crc32c_calculate_no_swap(
tvb_zero_checksum,
rtps_root->tvb_len,
CRC32C_PRELOAD);
calculated_checksum.crc32c ^= CRC32C_PRELOAD;
break;
case RTPS_HE_CHECKSUM_CRC64:
/* CRC64 is not supported yet */
break;
case RTPS_HE_CHECKSUM_MD5:
tvb_memcpy(
tvb,
&he_checksum.md5,
offset,
checksum_len);
gcry_md_hash_buffer(
GCRY_MD_MD5,
calculated_checksum.md5,
tvb_zero_checksum,
rtps_root->tvb_len);
break;
default:
break;
}
}
}
switch (checksum_type) {
case RTPS_HE_CHECKSUM_CRC32:
proto_tree_add_checksum(
tree,
tvb,
offset,
hf_rtps_header_extension_checksum_crc32c,
-1,
&ei_rtps_checksum_check_error,
pinfo,
calculated_checksum.crc32c,
ENC_BIG_ENDIAN,
checksum_flags);
break;
case RTPS_HE_CHECKSUM_MD5:
proto_tree_add_checksum_bytes(
tree,
tvb,
offset,
hf_rtps_header_extension_checksum_md5,
-1,
&ei_rtps_checksum_check_error,
pinfo,
calculated_checksum.md5,
checksum_len,
checksum_flags);
break;
case RTPS_HE_CHECKSUM_CRC64:
default:
break;
}
offset += checksum_len;
}
if ((flags & RTPS_HE_PARAMETERS_FLAG) == RTPS_HE_PARAMETERS_FLAG) {
unsigned parameter_endianess = ((flags & RTPS_HE_ENDIANESS_FLAG) == RTPS_HE_ENDIANESS_FLAG)
? ENC_LITTLE_ENDIAN
: ENC_BIG_ENDIAN;
dissect_parameter_sequence(tree, pinfo, tvb, offset, parameter_endianess,
octets_to_next_header - (offset - initial_offset),
"Parameters", 0x0200, NULL, vendor_id, false, NULL);
}
}
static void dissect_DATA_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t vendor_id, endpoint_guid *guid) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | DATA_FRAG |X|X|X|X|X|H|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + +
* | KeyHashPrefix keyHashPrefix [only if H==1] |
* + +
* | |
* +---------------+---------------+---------------+---------------+
* | KeyHashSuffix keyHashSuffix |
* +---------------+---------------+---------------+---------------+
* | FragmentNumber fragmentStartingNum |
* +---------------+---------------+---------------+---------------+
* | ushort fragmentsInSubmessage | ushort fragmentSize |
* +---------------+---------------+---------------+---------------+
* | unsigned long sampleSize |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData ~
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
int old_offset = offset;
uint32_t frag_number = 0;
proto_item *octet_item;
uint32_t wid;
bool from_builtin_writer;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, DATA_FRAG_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage */
min_len = 32;
if ((flags & FLAG_DATA_FRAG_Q) != 0) min_len += 4;
if ((flags & FLAG_DATA_FRAG_H) != 0) min_len += 12;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* Sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
offset += 8;
/* If flag H is defined, read the GUID Prefix */
if ((flags & FLAG_DATA_H) != 0) {
rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_sm_guid_prefix,
hf_rtps_sm_host_id, hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
offset += 12;
} else {
/* Flag H not set, use hostId, appId from the packet header */
}
/* Complete the GUID by reading the Object ID */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_entity_id, hf_rtps_sm_entity_id_key,
hf_rtps_sm_entity_id_kind, ett_rtps_entity, "keyHashSuffix", NULL);
offset += 4;
/* Fragment number */
proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_number, tvb, offset, 4, encoding, &frag_number);
offset += 4;
/* Fragments in submessage */
proto_tree_add_item(tree, hf_rtps_data_frag_num_fragments, tvb, offset, 2, encoding);
offset += 2;
/* Fragment size */
proto_tree_add_item(tree, hf_rtps_data_frag_size, tvb, offset, 2, encoding);
offset += 2;
/* sampleSize */
proto_tree_add_item(tree, hf_rtps_data_frag_sample_size, tvb, offset, 4, encoding);
offset += 4;
/* InlineQos */
if ((flags & FLAG_DATA_Q_v2) != 0) {
bool is_inline_qos = true;
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4,
"inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL);
}
/* SerializedData */
if ((flags & FLAG_DATA_D_v2) != 0) {
from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
|| ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
dissect_serialized_data(tree, pinfo, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
"serializedData", vendor_id, from_builtin_writer, NULL, (int32_t)frag_number);
}
}
/* *********************************************************************** */
/* * N O K E Y _ D A T A * */
/* *********************************************************************** */
static void dissect_NOKEY_DATA(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t version, uint16_t vendor_id) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | ISSUE |X|X|X|X|X|X|P|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | ObjectId readerObjectId |
* +---------------+---------------+---------------+---------------+
* | ObjectId writerObjectId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterSequence parameters [only if P==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ UserData issueData ~
* | |
* +---------------+---------------+---------------+---------------+
*
* RTPS 1.2:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData [only if D==0] ~
* | |
* +---------------+---------------+---------------+---------------+
*
* RTPS 2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | NOKEY_DATA |X|X|X|X|X|D|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData [only if D==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* Notes:
* - inlineQos is equivalent to the old 'parameters'
* - serializedData is equivalent to the old 'issueData'
*/
int min_len;
uint32_t wid; /* Writer EntityID */
bool from_builtin_writer;
int old_offset = offset;
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NOKEY_DATA_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage */
min_len = 16;
if ((flags & FLAG_NOKEY_DATA_Q) != 0) min_len += 4;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
/* Sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
offset += 8;
/* Parameters */
if ((flags & FLAG_NOKEY_DATA_Q) != 0) {
bool is_inline_qos = true;
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset,
encoding, octets_to_next_header, "inlineQos",
version, NULL, vendor_id, is_inline_qos, NULL);
}
/* Issue Data */
if ((version < 0x0200) && (flags & FLAG_NOKEY_DATA_D) == 0) {
proto_tree_add_item(tree, hf_rtps_issue_data, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
ENC_NA);
}
if ((version >= 0x0200) && (flags & FLAG_DATA_D_v2) != 0) {
from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
|| ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
dissect_serialized_data(tree, pinfo, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
"serializedData", vendor_id, from_builtin_writer, NULL, NOT_A_FRAGMENT);
}
}
/* *********************************************************************** */
/* * N O K E Y _ D A T A _ F R A G * */
/* *********************************************************************** */
static void dissect_NOKEY_DATA_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset,
uint8_t flags, const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t vendor_id) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |NOKEY_DATA_FRAG|X|X|X|X|X|X|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | FragmentNumber fragmentStartingNum |
* +---------------+---------------+---------------+---------------+
* | ushort fragmentsInSubmessage | ushort fragmentSize |
* +---------------+---------------+---------------+---------------+
* | unsigned long sampleSize |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData ~
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
uint32_t wid; /* Writer EntityID */
bool from_builtin_writer;
int old_offset = offset;
uint32_t frag_number = 0;
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NOKEY_DATA_FRAG_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage */
min_len = 28;
if ((flags & FLAG_NOKEY_DATA_Q) != 0) min_len += 4;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
/* Sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
offset += 8;
/* Fragment number */
proto_tree_add_item_ret_uint(tree, hf_rtps_nokey_data_frag_number, tvb,
offset, 4, encoding, &frag_number);
offset += 4;
/* Fragments in submessage */
proto_tree_add_item(tree, hf_rtps_nokey_data_frag_num_fragments, tvb,
offset, 2, encoding);
offset += 2;
/* Fragment size */
proto_tree_add_item(tree, hf_rtps_nokey_data_frag_size, tvb,
offset, 2, encoding);
offset += 2;
/* InlineQos */
if ((flags & FLAG_DATA_Q_v2) != 0) {
bool is_inline_qos = true;
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4,
"inlineQos", 0x0200, NULL, vendor_id, is_inline_qos, NULL);
}
/* SerializedData */
if ((flags & FLAG_DATA_D_v2) != 0) {
from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
|| ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
dissect_serialized_data(tree, pinfo, tvb,offset,
octets_to_next_header - (offset - old_offset) + 4,
"serializedData", vendor_id, from_builtin_writer, NULL, (int32_t)frag_number);
}
}
static void dissect_PING(tvbuff_t* tvb, int offset, const unsigned encoding, int octets_to_next_header, proto_tree* tree) {
proto_tree_add_item(tree, hf_rtps_ping,tvb, offset, octets_to_next_header, encoding);
}
/* *********************************************************************** */
/* * A C K N A C K * */
/* *********************************************************************** */
static void dissect_ACKNACK(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree,
proto_item *item, endpoint_guid *guid) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | ACK |X|X|X|X|X|X|F|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | ObjectId readerObjectId |
* +---------------+---------------+---------------+---------------+
* | ObjectId writerObjectId |
* +---------------+---------------+---------------+---------------+
* | |
* + Bitmap bitmap +
* | |
* +---------------+---------------+---------------+---------------+
* | Counter count |
* +---------------+---------------+---------------+---------------+
*
* RTPS 1.2/2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | ACKNACK |X|X|X|X|X|X|F|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumberSet readerSNState +
* | |
* +---------------+---------------+---------------+---------------+
* | Counter count |
* +---------------+---------------+---------------+---------------+
*/
int original_offset; /* Offset to the readerEntityId */
proto_item *octet_item;
uint32_t wid;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, ACKNACK_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2, 2, encoding);
if (octets_to_next_header < 20) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 20)");
return;
}
offset += 4;
original_offset = offset;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* Bitmap */
offset = rtps_util_add_bitmap(tree, tvb, offset, encoding, "readerSNState", true);
/* RTPS 1.0 didn't have count: make sure we don't decode it wrong
* in this case
*/
if (offset + 4 == original_offset + octets_to_next_header) {
/* Count is present */
proto_tree_add_item(tree, hf_rtps_acknack_count, tvb, offset, 4, encoding);
} else if (offset < original_offset + octets_to_next_header) {
/* In this case there must be something wrong in the bitmap: there
* are some extra bytes that we don't know how to decode
*/
expert_add_info_format(pinfo, item, &ei_rtps_extra_bytes, "Don't know how to decode those extra bytes: %d", octets_to_next_header - offset);
} else if (offset > original_offset + octets_to_next_header) {
/* Decoding the bitmap went over the end of this submessage.
* Enter an item in the protocol tree that spans over the entire
* submessage.
*/
expert_add_info(pinfo, item, &ei_rtps_missing_bytes);
}
}
/* *********************************************************************** */
/* * N A C K _ F R A G * */
/* *********************************************************************** */
static void dissect_NACK_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | NACK_FRAG |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumberSet writerSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ FragmentNumberSet fragmentNumberState +
* | |
* +---------------+---------------+---------------+---------------+
* | Counter count |
* +---------------+---------------+---------------+---------------+
*/
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, NACK_FRAG_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (octets_to_next_header < 24) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", NULL);
offset += 4;
/* Writer sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSN");
offset += 8;
/* FragmentNumberSet */
offset = rtps_util_add_fragment_number_set(tree, pinfo, tvb, offset, encoding,
"fragmentNumberState", octets_to_next_header - 20);
if (offset == -1) {
return;
}
/* Count */
proto_tree_add_item(tree, hf_rtps_nack_frag_count, tvb, offset, 4, encoding);
}
/* *********************************************************************** */
/* * H E A R T B E A T * */
/* *********************************************************************** */
static void dissect_HEARTBEAT(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t version, endpoint_guid *guid) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | HEARTBEAT |X|X|X|X|X|L|F|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | ObjectId readerObjectId |
* +---------------+---------------+---------------+---------------+
* | ObjectId writerObjectId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstAvailableSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber lastSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | long counter |
* +---------------+---------------+---------------+---------------+
*
* Notes:
* - on RTPS 1.0, counter is not present
* - on RTPS 1.0, L flag is not present
*
* RTPS 1.2/2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | HEARTBEAT |X|X|X|X|X|X|F|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstAvailableSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber lastSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | Counter count |
* +---------------+---------------+---------------+---------------+
*/
proto_item *octet_item;
uint32_t wid;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_FLAGS, flags);
octet_item = proto_tree_add_item(tree,
hf_rtps_sm_octets_to_next_header,
tvb,
offset + 2,
2,
encoding);
if ((octets_to_next_header < 24) && (version <= 0x0101)) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
return;
}
else if (octets_to_next_header < 28) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 28)");
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* First available Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstAvailableSeqNumber");
offset += 8;
/* Last Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastSeqNumber");
offset += 8;
/* Counter: it was not present in RTPS 1.0 */
if (version >= 0x0101) {
proto_tree_add_item(tree, hf_rtps_heartbeat_count, tvb, offset, 4, encoding);
}
}
/* *********************************************************************** */
/* * H E A R T B E A T _ B A T C H * */
/* *********************************************************************** */
static void dissect_HEARTBEAT_BATCH(tvbuff_t *tvb, packet_info *pinfo, int offset,
uint8_t flags, const unsigned encoding, int octets_to_next_header,
proto_tree *tree, endpoint_guid *guid) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |HEARTBEAT_BATCH|X|X|X|X|X|L|F|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstBatchSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber lastBatchSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber lastSN +
* | |
* +---------------+---------------+---------------+---------------+
* | Count count |
* +---------------+---------------+---------------+---------------+
*/
proto_item *octet_item;
uint32_t wid;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_BATCH_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (octets_to_next_header < 36) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 36)");
return;
}
/* Skip decoding the entire packet if (tree == NULL) */
if (tree == NULL) {
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* First available Batch Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstBatchSN");
offset += 8;
/* Last Batch Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastBatchSN");
offset += 8;
/* First available Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstSeqNumber");
offset += 8;
/* Last Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "lastSeqNumber");
offset += 8;
/* Counter */
proto_tree_add_item(tree, hf_rtps_heartbeat_batch_count, tvb, offset, 4, encoding);
}
/* *********************************************************************** */
/* * H E A R T B E A T _ V I R T U A L * */
/* *********************************************************************** */
static void dissect_HEARTBEAT_VIRTUAL(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
uint8_t flags, const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t vendor_id _U_, endpoint_guid *guid) {
/*
* VIRTUAL_HB:
*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | VIRTUAL_HB |X|X|X|X|N|W|V|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerId |
* +---------------+---------------+---------------+---------------+
* | Guid_t virtualGUID (V=0 & N=0) |
* + +
* | |
* + +
* | |
* + +
* | |
* +---------------+---------------+---------------+---------------+
* | unsigned long numWriters (W=1) |
* +---------------+---------------+---------------+---------------+
* | |
* ~ WriterVirtualHBList writerVirtualHBList ~
* | |
* +---------------+---------------+---------------+---------------+
* | unsigned long count |
* +---------------+---------------+---------------+---------------+
* WRITER_VIRTUAL_HB:
*
* 0...2...........7...............15.............23...............31
* +---------------+---------------+---------------+---------------+
* | EntityId writerId (W=1) |
* +---------------+---------------+---------------+---------------+
* | unsigned long numVirtualGUIDs (N=0) |
* +---------------+---------------+---------------+---------------+
* | |
* ~ VirtualGUIDHBList virtualGUIDHBList ~
* | |
* +---------------+---------------+---------------+---------------+
*
* VIRTUAL_GUID_HB:
*
* 0...2...........7...............15.............23...............31
* +---------------+---------------+---------------+---------------+
* | Guid_t virtualGUID (V=1) |
* + +
* | |
* + +
* | |
* + +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstVirtualSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber lastVirtualSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstRTPSSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber lastRTPSSN +
* | |
* +---------------+---------------+---------------+---------------+
*/
uint32_t num_writers, num_virtual_guids, wid;
int writer_id_offset, virtual_guid_offset = 0, old_offset;
proto_item *octet_item, *ti;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_VIRTUAL_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (octets_to_next_header < 12) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", 12);
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree,
tvb,
offset,
hf_rtps_sm_rdentity_id,
hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind,
ett_rtps_rdentity,
"readerEntityId",
NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree,
tvb,
offset,
hf_rtps_sm_wrentity_id,
hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind,
ett_rtps_wrentity,
"writerEntityId",
&wid);
writer_id_offset = offset;
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* virtualGUID */
if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V) && !(flags & FLAG_VIRTUAL_HEARTBEAT_N)) {
/*rtps_util_add_generic_guid(tree,
tvb,
offset,
"virtualGUID",
buffer,
MAX_GUID_SIZE);*/
virtual_guid_offset = offset;
offset += 16;
}
/* num_writers */
ti = proto_tree_add_item(tree, hf_rtps_virtual_heartbeat_num_writers, tvb,
offset, 4, encoding);
if (flags & FLAG_VIRTUAL_HEARTBEAT_W) {
num_writers = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
} else {
proto_item_set_text(ti, "numWriters: 1");
num_writers = 1;
}
{
/* Deserialize Writers */
proto_tree *sil_tree_writer_list;
uint32_t current_writer_index;
/** Writer list **/
sil_tree_writer_list = proto_tree_add_subtree_format(tree, tvb, offset, -1,
ett_rtps_writer_heartbeat_virtual_list, NULL, "Writer List");
current_writer_index = 0;
while (current_writer_index < num_writers) {
proto_tree *sil_tree_writer;
sil_tree_writer = proto_tree_add_subtree_format(sil_tree_writer_list, tvb, offset, -1,
ett_rtps_writer_heartbeat_virtual, NULL, "writer[%d]", current_writer_index);
if (num_writers == 1) {
old_offset = offset;
offset = writer_id_offset;
}
rtps_util_add_entity_id(sil_tree_writer,
tvb,
offset,
hf_rtps_sm_wrentity_id,
hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind,
ett_rtps_wrentity,
"writerEntityId",
NULL);
if (num_writers == 1) {
offset = old_offset;
} else {
offset += 4;
}
if (!(flags & FLAG_VIRTUAL_HEARTBEAT_N)) {
proto_tree_add_item(sil_tree_writer, hf_rtps_virtual_heartbeat_num_virtual_guids, tvb,
offset, 4, encoding);
num_virtual_guids = tvb_get_uint32(tvb, offset, encoding);
offset += 4;
} else {
num_virtual_guids = 0;
}
/** Virtual GUID list **/
if (num_virtual_guids != 0) {
proto_tree *sil_tree_virtual_guid_list;
uint32_t current_virtual_guid_index;
sil_tree_virtual_guid_list = proto_tree_add_subtree_format(sil_tree_writer, tvb, offset, -1,
ett_rtps_virtual_guid_heartbeat_virtual_list, NULL, "Virtual GUID List");
current_virtual_guid_index = 0;
while (current_virtual_guid_index < num_virtual_guids) {
proto_tree *sil_tree_virtual_guid;
sil_tree_virtual_guid = proto_tree_add_subtree_format(sil_tree_virtual_guid_list, tvb, offset, -1,
ett_rtps_virtual_guid_heartbeat_virtual, NULL, "virtualGUID[%d]", current_virtual_guid_index);
if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V)) {
old_offset = offset;
offset = virtual_guid_offset;
}
/*rtps_util_add_generic_guid_v2(sil_tree_virtual_guid,
tvb,
offset,
"virtualGUID",
buffer,
MAX_GUID_SIZE);*/
if (!(flags & FLAG_VIRTUAL_HEARTBEAT_V)) {
offset = old_offset;
} else {
offset += 16;
}
/* firstVirtualSN */
rtps_util_add_seq_number(sil_tree_virtual_guid,
tvb,
offset,
encoding,
"firstVirtualSN");
offset += 8;
/* lastVirtualSN */
rtps_util_add_seq_number(sil_tree_virtual_guid,
tvb,
offset,
encoding,
"lastVirtualSN");
offset += 8;
/* firstRTPSSN */
rtps_util_add_seq_number(sil_tree_virtual_guid,
tvb,
offset,
encoding,
"firstRTPSSN");
offset += 8;
/* lastRTPSSN */
rtps_util_add_seq_number(sil_tree_virtual_guid,
tvb,
offset,
encoding,
"lastRTPSSN");
offset += 8;
current_virtual_guid_index++;
}
}
current_writer_index++;
}
}
/* Count */
proto_tree_add_item(tree, hf_rtps_virtual_heartbeat_count, tvb, offset, 4, encoding);
}
/* *********************************************************************** */
/* * H E A R T B E A T _ F R A G * */
/* *********************************************************************** */
static void dissect_HEARTBEAT_FRAG(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree, endpoint_guid *guid) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |HEARTBEAT_FRAG |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | FragmentNumber lastFragmentNum |
* +---------------+---------------+---------------+---------------+
* | Counter count |
* +---------------+---------------+---------------+---------------+
*/
proto_item *octet_item;
uint32_t wid;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, HEARTBEAT_FRAG_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (octets_to_next_header < 24) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
return;
}
/* Skip decoding the entire packet if (tree == NULL) */
if (tree == NULL) {
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* First available Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSeqNumber");
offset += 8;
/* Fragment number */
proto_tree_add_item(tree, hf_rtps_heartbeat_frag_number, tvb, offset, 4, encoding);
offset += 4;
/* Counter */
proto_tree_add_item(tree, hf_rtps_heartbeat_frag_count, tvb, offset, 4, encoding);
}
/* *********************************************************************** */
/* * R T P S _ D A T A * */
/* * A N D * */
/* * R T P S _ D A T A _ S E S S I O N * */
/* *********************************************************************** */
static void dissect_RTPS_DATA(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t vendor_id, bool is_session, endpoint_guid *guid) {
/*
*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | RTPS_DATA |X|X|X|X|K|D|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | Flags extraFlags | octetsToInlineQos |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData [only if D==1 || K==1] ~
* | |
* +---------------+---------------+---------------+---------------+
*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |RTPS_DATA_SESSI|X|X|X|X|K|D|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | Flags extraFlags | octetsToInlineQos |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSessionSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerVirtualSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData [only if D==1 || K==1] ~
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
int old_offset = offset;
uint32_t writer_wid; /* Writer EntityID */
uint32_t reader_wid = 0;
uint32_t status_info = 0xffffffff;
bool from_builtin_writer;
proto_item *octet_item;
coherent_set_entity_info coherent_set_entity_info_object = {0};
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage */
min_len = 20;
if (is_session) {
min_len += 8;
bool* is_data_session_final = wmem_alloc(pinfo->pool, sizeof(bool));
*is_data_session_final = false;
p_add_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY, is_data_session_final);
}
if ((flags & FLAG_RTPS_DATA_Q) != 0) min_len += 4;
if ((flags & FLAG_RTPS_DATA_D) != 0) min_len += 4;
if ((flags & FLAG_RTPS_DATA_K) != 0) min_len += 4;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* extraFlags */
proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* octetsToInlineQos */
proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding);
offset += 2;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", &reader_wid);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &writer_wid);
offset += 4;
guid->entity_id = writer_wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* Sequence number */
if (is_session) {
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerSessionSeqNumber");
offset += 8;
rtps_util_add_seq_number(tree, tvb, offset, encoding, "writerVirtualSeqNumber");
offset += 8;
} else {
coherent_set_entity_info_object.writer_seq_number = rtps_util_add_seq_number(tree, tvb, offset,
encoding, "writerSeqNumber");
coherent_set_entity_info_object.guid = *guid;
offset += 8;
}
/* InlineQos */
if ((flags & FLAG_RTPS_DATA_Q) != 0) {
bool is_inline_qos = true;
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4,
"inlineQos", 0x0200, &status_info, vendor_id, is_inline_qos, &coherent_set_entity_info_object);
}
/* SerializedData */
if (((flags & FLAG_RTPS_DATA_D) != 0) || ((flags & FLAG_RTPS_DATA_K) != 0)) {
if (writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_MESSAGE_WRITER) {
/* Dissect the serialized data as ParticipantMessageData:
* struct ParticipantMessageData {
* KeyHashPrefix_t participantGuidPrefix;
* KeyHashSuffix_t kind;
* sequence<octet> data;
* }
*/
proto_tree *rtps_pm_tree;
proto_tree *guid_tree;
uint32_t kind;
uint32_t encapsulation_id, encapsulation_len;
proto_item *ti;
rtps_pm_tree = proto_tree_add_subtree(tree, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
ett_rtps_part_message_data, &ti, "ParticipantMessageData");
/* Encapsulation ID */
proto_tree_add_item_ret_uint(rtps_pm_tree, hf_rtps_param_serialize_encap_kind, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
offset += 2;
encoding = get_encapsulation_endianness(encapsulation_id);
/* Encapsulation length (or option) */
proto_tree_add_item_ret_uint(rtps_pm_tree, hf_rtps_param_serialize_encap_len, tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_len);
offset += 2;
guid_tree = proto_item_add_subtree(ti, ett_rtps_part_message_data);
rtps_util_add_guid_prefix_v2(guid_tree, tvb, offset, hf_rtps_sm_guid_prefix, hf_rtps_sm_host_id,
hf_rtps_sm_app_id, hf_rtps_sm_instance_id, 0);
offset += 12;
/* Kind */
proto_tree_add_item_ret_uint(guid_tree, hf_rtps_encapsulation_kind, tvb, offset, 4, ENC_BIG_ENDIAN, &kind);
offset += 4;
rtps_util_add_seq_octets(rtps_pm_tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4, hf_rtps_data_serialize_data);
} else if (writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_STATELESS_WRITER || writer_wid == ENTITYID_P2P_BUILTIN_PARTICIPANT_VOLATILE_SECURE_WRITER) {
/* PGM stands for Participant Generic Message */
proto_tree * rtps_pgm_tree, * guid_tree, * message_identity_tree;
proto_item *ti;
uint32_t encapsulation_id, encapsulation_opt;
int32_t alignment_zero;
uint64_t sequence_number;
ti = proto_tree_add_boolean_format(tree, hf_rtps_pgm, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4, true, "Participant Generic Message");
rtps_pgm_tree = proto_item_add_subtree(ti, ett_rtps_pgm_data);
proto_tree_add_item_ret_uint(rtps_pgm_tree, hf_rtps_param_serialize_encap_kind,
tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
encoding = get_encapsulation_endianness(encapsulation_id);
offset += 2;
proto_tree_add_item_ret_uint(rtps_pgm_tree, hf_rtps_param_serialize_encap_len,
tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt);
offset += 2;
alignment_zero = offset;
/* Message Identity */
message_identity_tree = proto_tree_add_subtree(rtps_pgm_tree, tvb, offset,
24 , ett_rtps_message_identity, &ti, "Message Identity");
guid_tree = proto_item_add_subtree(ti, ett_rtps_message_identity);
proto_item_append_text(guid_tree, " (");
rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
hf_rtps_message_identity_source_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, guid_tree);
offset += 16;
proto_tree_add_item(message_identity_tree, hf_rtps_sm_seq_number, tvb, offset, 8, encoding);
/* This snippet shows the sequence number in the parent tree */
sequence_number = tvb_get_uint64(tvb, offset, encoding);
proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")",
sequence_number);
offset += 8;
/* Related Message Identity */
message_identity_tree = proto_tree_add_subtree(rtps_pgm_tree, tvb, offset,
24 , ett_rtps_related_message_identity, &ti, "Related Message Identity");
guid_tree = proto_item_add_subtree(ti, ett_rtps_related_message_identity);
proto_item_append_text(guid_tree, " (");
rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
hf_rtps_message_identity_source_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, guid_tree);
offset += 16;
proto_tree_add_item(message_identity_tree, hf_rtps_sm_seq_number, tvb,
offset, 8, encoding);
/* This snippet shows the sequence number in the parent tree */
sequence_number = tvb_get_uint64(tvb, offset, encoding);
proto_item_append_text(guid_tree, ", sn: %" PRIu64 ")",
sequence_number);
offset += 8;
guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data);
rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
hf_rtps_pgm_dst_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
offset += 16;
guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data);
rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
hf_rtps_pgm_dst_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
offset += 16;
guid_tree = proto_item_add_subtree(rtps_pgm_tree, ett_rtps_pgm_data);
rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
hf_rtps_pgm_src_endpoint_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
offset += 16;
offset = rtps_util_add_string(rtps_pgm_tree, tvb, offset, hf_rtps_pgm_message_class_id, encoding);
rtps_util_add_data_holder_seq(rtps_pgm_tree, tvb, pinfo, offset,
encoding, alignment_zero);
} else if (writer_wid == ENTITYID_RTI_BUILTIN_LOCATOR_PING_WRITER) {
proto_tree * locator_ping_tree, *guid_tree;
proto_item *ti;
uint32_t encapsulation_id, encapsulation_opt;
locator_ping_tree = proto_tree_add_subtree(tree, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
ett_rtps_locator_ping_tree, &ti, "Locator Ping Message");
/* Encapsulation Id */
proto_tree_add_item_ret_uint(locator_ping_tree, hf_rtps_encapsulation_id,
tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
offset += 2;
encoding = get_encapsulation_endianness(encapsulation_id);
/* Encapsulation length (or option) */
proto_tree_add_item_ret_uint(locator_ping_tree, hf_rtps_encapsulation_options,
tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt);
offset += 2;
guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
hf_rtps_source_participant_guid, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
offset += 16;
rtps_util_add_locator_t(locator_ping_tree, pinfo, tvb, offset, encoding,
"Destination Locator");
} else if (writer_wid == ENTITYID_RTI_BUILTIN_SERVICE_REQUEST_WRITER) {
/*
struct ServiceRequest {
long service_id; //@key
GUID_t instance_id; //@key
sequence<octet> request_body;
}; //@Extensibility EXTENSIBLE_EXTENSIBILITY
*/
proto_tree * service_request_tree, * guid_tree;
proto_item *ti;
uint32_t encapsulation_id, encapsulation_opt;
int32_t service_id;
ti = proto_tree_add_boolean_format(tree, hf_rtps_srm, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
true, "Service Request Message");
service_request_tree = proto_item_add_subtree(ti, ett_rtps_service_request_tree);
/* Encapsulation Id */
proto_tree_add_item_ret_uint(service_request_tree, hf_rtps_encapsulation_id,
tvb, offset, 2, ENC_BIG_ENDIAN, &encapsulation_id);
offset += 2;
encoding = get_encapsulation_endianness(encapsulation_id);
/* Encapsulation length (or option) */
proto_tree_add_item_ret_uint(service_request_tree, hf_rtps_encapsulation_options, tvb,
offset, 2, ENC_BIG_ENDIAN, &encapsulation_opt);
offset += 2;
proto_tree_add_item_ret_int(service_request_tree, hf_rtps_srm_service_id, tvb,
offset, 4, encoding, &service_id);
offset += 4;
guid_tree = proto_item_add_subtree(ti, ett_rtps_generic_guid);
rtps_util_add_generic_guid_v2(guid_tree, tvb, offset,
hf_rtps_srm_instance_id, hf_rtps_param_host_id, hf_rtps_param_app_id,
hf_rtps_param_instance_id, hf_rtps_param_entity, hf_rtps_param_entity_key,
hf_rtps_param_entity_kind, NULL);
offset += 16;
rtps_util_add_rti_service_request(service_request_tree, pinfo, tvb, offset,
encoding, service_id);
} else {
const char *label;
if (((flags & FLAG_RTPS_DATA_D) != 0) || ((flags & FLAG_RTPS_DATA_K) == 0)) {
label = "serializedData";
} else if (((flags & FLAG_RTPS_DATA_D) == 0) || ((flags & FLAG_RTPS_DATA_K) != 0)) {
label = "serializedKey";
} else {
/* D==1 && K==1 */
label = "<invalid or unknown data type>";
}
from_builtin_writer = (((writer_wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
|| ((writer_wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
|| (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
|| (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
|| (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
|| (writer_wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
/* At the end still dissect the rest of the bytes as raw data */
dissect_serialized_data(tree, pinfo, tvb, offset,
octets_to_next_header - (offset - old_offset) + 4,
label, vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT);
}
}
rtps_util_detect_coherent_set_end_empty_data_case(&coherent_set_entity_info_object);
generate_status_info(pinfo, writer_wid, status_info);
}
static void dissect_RTPS_DATA_SESSION(tvbuff_t* tvb, packet_info* pinfo, int offset, uint8_t flags,
unsigned encoding, int octets_to_next_header, proto_tree* tree,
uint16_t vendor_id, endpoint_guid* guid) {
bool is_data_session_intermediate = false;
proto_item* ti = NULL;
p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY, &is_data_session_intermediate);
dissect_RTPS_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
tree, vendor_id, true, guid);
ti = proto_tree_add_boolean(tree, hf_rtps_data_session_intermediate, tvb, offset, 0, is_data_session_intermediate);
proto_item_set_generated(ti);
}
/* *********************************************************************** */
/* * R T P S _ D A T A _ F R A G _ [SESSION] * */
/* *********************************************************************** */
static void dissect_RTPS_DATA_FRAG_kind(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t vendor_id, bool is_session, endpoint_guid *guid) {
/*
* There are two kinds of DATA_FRAG, RTPS_DATA_FRAG and RTPS_DATA_FRAG_SESSION
* the only difference is that RTPS_DATA_FRAG_SESSION has an extra sequence number after
* writerSeqNum.
*
* RTPS_DATA_FRAG:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |RTPS_DATA_FRAG |X|X|X|X|X|K|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | Flags extraFlags | octetsToInlineQos |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | FragmentNumber fragmentStartingNum |
* +---------------+---------------+---------------+---------------+
* | ushort fragmentsInSubmessage | ushort fragmentSize |
* +---------------+---------------+---------------+---------------+
* | unsigned long sampleSize |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData ~
* | |
* +---------------+---------------+---------------+---------------+
*
*
* RTPS_DATA_FRAG_SESSION:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |RTPS.._SESSION |X|X|X|X|X|K|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | Flags extraFlags | octetsToInlineQos |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber writerSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber virtualSeqNum +
* | |
* +---------------+---------------+---------------+---------------+
* | FragmentNumber fragmentStartingNum |
* +---------------+---------------+---------------+---------------+
* | ushort fragmentsInSubmessage | ushort fragmentSize |
* +---------------+---------------+---------------+---------------+
* | unsigned long sampleSize |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList inlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData ~
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
int old_offset = offset;
uint64_t sample_seq_number = 0;
uint32_t frag_number = 0, frag_size = 0, sample_size = 0, num_frags = 0;
uint32_t wid; /* Writer EntityID */
bool from_builtin_writer;
uint32_t status_info = 0xffffffff;
proto_item *octet_item;
coherent_set_entity_info coherent_set_entity_info_object = {0};
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_FRAG_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage
* RTPS_DATA_FRAG_SESSION len = RTPS_DATA_FRAG len + 8 (extra virtualSequenceNum field).
*/
min_len = (is_session)
? 44
: 36;
if ((flags & FLAG_RTPS_DATA_FRAG_Q) != 0) min_len += 4;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* extraFlags */
proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* octetsToInlineQos */
proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding);
offset += 2;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* Sequence number */
coherent_set_entity_info_object.writer_seq_number = rtps_util_add_seq_number(tree, tvb, offset,
encoding, "writerSeqNumber");
coherent_set_entity_info_object.guid = *guid;
offset += 8;
/* virtual Sequence Number (Only in RTPS_DATA_FRAG_SESSION)*/
if (is_session) {
rtps_util_add_seq_number(tree, tvb, offset, encoding, "virtualSeqNumber");
offset += 8;
}
/* Fragment number */
proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_number, tvb, offset, 4, encoding, &frag_number);
offset += 4;
/* Fragments in submessage */
proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_num_fragments, tvb, offset, 2, encoding, &num_frags);
offset += 2;
/* Fragment size */
proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_size, tvb, offset, 2, encoding, &frag_size);
offset += 2;
/* sampleSize */
proto_tree_add_item_ret_uint(tree, hf_rtps_data_frag_sample_size, tvb, offset, 4, encoding, &sample_size);
offset += 4;
/* InlineQos */
if ((flags & FLAG_RTPS_DATA_FRAG_Q) != 0) {
bool is_inline_qos = true;
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4,
"inlineQos", 0x0200, &status_info, vendor_id, is_inline_qos, &coherent_set_entity_info_object);
}
/* SerializedData */
{
char label[20];
snprintf(label, 9, "fragment");
if ((flags & FLAG_RTPS_DATA_FRAG_K) != 0) {
snprintf(label, 14, "serializedKey");
}
from_builtin_writer = (((wid & ENTITYKIND_BUILTIN_WRITER_WITH_KEY) == ENTITYKIND_BUILTIN_WRITER_WITH_KEY)
|| ((wid & ENTITYKIND_BUILTIN_WRITER_NO_KEY) == ENTITYKIND_BUILTIN_WRITER_NO_KEY)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_BOOTSTRAP_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_WRITER))
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_WRITER)
|| (wid == ENTITYID_RTI_BUILTIN_PARTICIPANT_CONFIG_SECURE_READER) ? true : false;
uint32_t frag_index_in_submessage = 0, this_frag_number = 0, this_frag_size = 0, fragment_offset = 0;
bool more_fragments = false;
if (enable_rtps_reassembly) {
tvbuff_t* new_tvb = NULL;
fragment_head *frag_msg = NULL;
while(frag_index_in_submessage < num_frags) {
this_frag_number = frag_number + frag_index_in_submessage;
more_fragments = (this_frag_number * frag_size < sample_size);
this_frag_size = more_fragments ? frag_size : (sample_size - ((this_frag_number - 1) * frag_size));
fragment_offset = this_frag_number == 1 ? 0 : (((this_frag_number - 1) * frag_size));
pinfo->fragmented = true;
frag_msg = fragment_add_check(&rtps_reassembly_table,
tvb, offset, pinfo,
(uint32_t)sample_seq_number, /* ID for fragments belonging together */
(void *)guid, /* make sure only fragments from the same writer are considered for reassembly */
fragment_offset, /* fragment offset */
this_frag_size, /* fragment length */
more_fragments); /* More fragments? */
new_tvb = process_reassembled_data(tvb, offset + (frag_index_in_submessage * frag_size), pinfo,
"Reassembled sample", frag_msg, &rtps_frag_items,
NULL, tree);
if (frag_index_in_submessage == 0) {
generate_status_info(pinfo, wid, status_info);
if (frag_msg) { /* Reassembled */
col_append_str(pinfo->cinfo, COL_INFO, " [Reassembled]");
} else { /* Not last packet of reassembled Short Message */
col_append_str(pinfo->cinfo, COL_INFO," [RTPS fragment]");
}
}
if (new_tvb) {
snprintf(label, 19, "reassembled sample");
dissect_serialized_data(tree, pinfo, new_tvb, 0,
sample_size, label, vendor_id, from_builtin_writer, guid, NOT_A_FRAGMENT);
break;
} else {
snprintf(label, 15, "fragment [%d]", frag_index_in_submessage);
dissect_serialized_data(tree, pinfo, tvb, offset + (frag_index_in_submessage * frag_size),
this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number);
}
frag_index_in_submessage++;
}
} else {
while (frag_index_in_submessage < num_frags) {
this_frag_number = frag_number + frag_index_in_submessage;
more_fragments = (this_frag_number * frag_size < sample_size);
this_frag_size = more_fragments ? frag_size : (sample_size - ((this_frag_number - 1) * frag_size));
fragment_offset = frag_index_in_submessage * frag_size;
snprintf(label, 20, "fragment [%d]", frag_index_in_submessage);
dissect_serialized_data(tree, pinfo, tvb, offset + fragment_offset,
this_frag_size, label, vendor_id, from_builtin_writer, NULL, this_frag_number);
frag_index_in_submessage++;
}
generate_status_info(pinfo, wid, status_info);
}
}
rtps_util_detect_coherent_set_end_empty_data_case(&coherent_set_entity_info_object);
}
/* *********************************************************************** */
/* * R T P S _ D A T A _ B A T C H * */
/* *********************************************************************** */
static void dissect_RTPS_DATA_BATCH(tvbuff_t *tvb, packet_info *pinfo, int offset,
uint8_t flags, const unsigned encoding, int octets_to_next_header,
proto_tree *tree, uint16_t vendor_id, endpoint_guid *guid) {
/*
*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |RTPS_DATA_BATCH|X|X|X|X|X|X|Q|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | Flags extraFlags | octetsToInlineQos |
* +---------------+---------------+---------------+---------------+
* | EntityId readerId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber batchSN +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstSampleSN +
* | |
* +---------------+---------------+---------------+---------------+
* | SequenceNumberOffset offsetToLastSampleSN |
* +---------------+---------------+---------------+---------------+
* | unsigned long batchSampleCount |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList batchInlineQos [only if Q==1] ~
* | |
* +---------------+---------------+---------------+---------------+
* | unsigned long octetsToSLEncapsulationId |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SampleInfoList sampleInfoList ~
* | |
* +---------------+---------------+---------------+---------------+
* | SampleListEncapsulationId | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SampleList sampleList ~
* | |
* +---------------+---------------+---------------+---------------+
*
*
* SampleInfo:
* 0...............8..............16..............24..............32
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |X|X|X|X|X|X|X|X|X|X|K|I|D|O|Q|T| octetsToInlineQoS |
* +---------------+---------------+---------------+---------------+
* | unsigned long serializedDataLength |
* +---------------+---------------+---------------+---------------+
* | |
* + Timestamp timestamp [only if T==1] +
* | |
* +---------------+---------------+---------------+---------------+
* | SequenceNumberOffset offsetSN [only if O==1] |
* +---------------+---------------+---------------+---------------+
* | |
* ~ ParameterList sampleInlineQos [only if Q==1] ~
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*
*
* Sample:
* 0...............8..............16..............24..............32
* +---------------+---------------+---------------+---------------+
* | |
* ~ SerializedData serializedData [sampleInfo D==1 || K==1] ~
* | |
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
*/
int min_len;
int old_offset = offset;
uint32_t wid; /* Writer EntityID */
uint32_t status_info = 0xffffffff;
int32_t octetsToSLEncapsulationId;
int32_t sampleListOffset;
uint16_t encapsulation_id;
bool try_dissection_from_type_object = false;
uint16_t *sample_info_flags = NULL;
uint32_t *sample_info_length = NULL;
int32_t sample_info_count = 0,
sample_info_max = rtps_max_batch_samples_dissected;
proto_item *octet_item;
rtps_dissector_data * data = NULL;
bool is_compressed = false;
bool uncompressed_ok = false;
proto_tree *compressed_subtree = NULL;
tvbuff_t *data_holder_tvb = tvb;
tvbuff_t *compressed_tvb = NULL;
proto_tree *dissected_data_holder_tree = tree;
data = wmem_new(wmem_packet_scope(), rtps_dissector_data);
data->encapsulation_id = 0;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTPS_DATA_BATCH_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
/* Calculates the minimum length for this submessage */
min_len = 44;
if ((flags & FLAG_RTPS_DATA_BATCH_Q) != 0) min_len += 4;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* extraFlags */
proto_tree_add_item(tree, hf_rtps_extra_flags, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/* octetsToInlineQos */
proto_tree_add_item(tree, hf_rtps_octets_to_inline_qos, tvb, offset, 2, encoding);
offset += 2;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key,
hf_rtps_sm_rdentity_id_kind, ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset, hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key,
hf_rtps_sm_wrentity_id_kind, ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* Batch sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "batchSeqNumber");
offset += 8;
/* First sample sequence number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "firstSampleSeqNumber");
offset += 8;
/* offsetToLastSampleSN */
proto_tree_add_item(tree, hf_rtps_data_batch_offset_to_last_sample_sn, tvb, offset, 4, encoding);
offset += 4;
/* batchSampleCount */
proto_tree_add_item(tree, hf_rtps_data_batch_sample_count, tvb, offset, 4, encoding);
offset += 4;
/* Parameter list (if Q==1) */
/* InlineQos */
if ((flags & FLAG_RTPS_DATA_BATCH_Q) != 0) {
offset = dissect_parameter_sequence(tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4,
"batchInlineQos", 0x0200, &status_info, vendor_id, false, NULL);
}
/* octetsToSLEncapsulationId */
proto_tree_add_item_ret_uint(tree, hf_rtps_data_batch_octets_to_sl_encap_id, tvb,
offset, 4, encoding, &octetsToSLEncapsulationId);
offset += 4;
sampleListOffset = offset + octetsToSLEncapsulationId;
/* Sample info list */
{
proto_item *ti, *list_item;
proto_tree *sil_tree;
sample_info_count = 0;
sil_tree = proto_tree_add_subtree(tree, tvb, offset, octetsToSLEncapsulationId,
ett_rtps_sample_info_list, &list_item, "Sample Info List");
/* Allocate sample_info_flags and sample_info_length
* to store a copy of the flags for each sample info */
if (rtps_max_batch_samples_dissected == 0) {
sample_info_max = 1024; /* Max size of sampleInfo shown */
}
sample_info_flags = (uint16_t *)wmem_alloc(wmem_packet_scope(), sizeof(uint16_t) *sample_info_max);
sample_info_length = (uint32_t *)wmem_alloc(wmem_packet_scope(), sizeof(uint32_t) *sample_info_max);
/* Sample Info List: start decoding the sample info list until the offset
* is greater or equal than 'sampleListOffset' */
while (offset < sampleListOffset) {
uint16_t flags2;
/*uint16_t octetsToInlineQos;*/
int min_length;
proto_tree *si_tree;
int offset_begin_sampleinfo = offset;
if (rtps_max_batch_samples_dissected > 0 && (unsigned)sample_info_count >= rtps_max_batch_samples_dissected) {
expert_add_info(pinfo, list_item, &ei_rtps_more_samples_available);
offset = sampleListOffset;
break;
}
si_tree = proto_tree_add_subtree_format(sil_tree, tvb, offset, -1, ett_rtps_sample_info, &ti, "sampleInfo[%d]", sample_info_count);
flags2 = tvb_get_ntohs(tvb, offset); /* Flags are always big endian */
sample_info_flags[sample_info_count] = flags2;
proto_tree_add_bitmask_value(si_tree, tvb, offset, hf_rtps_sm_flags2, ett_rtps_flags, RTPS_SAMPLE_INFO_FLAGS16, flags2);
offset += 2;
proto_tree_add_item(si_tree, hf_rtps_data_batch_octets_to_inline_qos, tvb,
offset, 2, encoding);
offset += 2;
min_length = 4;
if ((flags2 & FLAG_SAMPLE_INFO_T) != 0) min_len += 8;
if ((flags2 & FLAG_SAMPLE_INFO_Q) != 0) min_len += 4;
if ((flags2 & FLAG_SAMPLE_INFO_O) != 0) min_len += 4;
/* Ensure there are enough bytes to decode */
if (sampleListOffset - offset < min_length) {
expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Error: not enough bytes to dissect sample info");
return;
}
/* Serialized data length */
proto_tree_add_item_ret_uint(si_tree, hf_rtps_data_batch_serialized_data_length, tvb,
offset, 4, encoding, &sample_info_length[sample_info_count]);
offset += 4;
/* Timestamp [only if T==1] */
if ((flags2 & FLAG_SAMPLE_INFO_T) != 0) {
rtps_util_add_timestamp(si_tree, tvb, offset, encoding, hf_rtps_data_batch_timestamp);
offset += 8;
}
/* Offset SN [only if O==1] */
if ((flags2 & FLAG_SAMPLE_INFO_O) != 0) {
proto_tree_add_item(si_tree, hf_rtps_data_batch_offset_sn, tvb, offset, 4, encoding);
offset += 4;
}
/* Parameter list [only if Q==1] */
if ((flags2 & FLAG_SAMPLE_INFO_Q) != 0) {
offset = dissect_parameter_sequence(si_tree, pinfo, tvb, offset, encoding,
octets_to_next_header - (offset - old_offset) + 4,
"sampleInlineQos", 0x0200, &status_info, vendor_id, false, NULL);
}
proto_item_set_len(ti, offset - offset_begin_sampleinfo);
sample_info_count++;
} /* while (offset < sampleListOffset) */
}
/* Dissects the encapsulated data heder and uncompress the tvb if it is compressed and
it can be uncompressed */
offset = rtps_prepare_encapsulated_data(
tree,
pinfo,
tvb,
offset,
tvb_reported_length(tvb) - offset,
true,
&encapsulation_id,
NULL,
NULL,
NULL,
NULL,
&is_compressed,
&uncompressed_ok,
&compressed_tvb,
&compressed_subtree);
data->encapsulation_id = encapsulation_id;
if (is_compressed && uncompressed_ok) {
data_holder_tvb = compressed_tvb;
offset = 0;
dissected_data_holder_tree = compressed_subtree;
octets_to_next_header = tvb_reported_length(data_holder_tvb);
old_offset = 0;
}
/* If it is compressed but not uncompressed don't try to dissect */
if (is_compressed == uncompressed_ok) {
/* Now the list of serialized data:
* Serialized data is allocated one after another one.
* We need to use the data previously stored in the sampleInfo to detect the
* kind and size.
* - sample_info_flags -> Array of uint16_t holding the flags for this sample info
* - sample_info_length -> Array of uint32_t with the size of this sample info
* - sample_info_count -> size of the above arrays
* This section will NEVER dissect more than 'sample_info_count'.
* Note, if there are not enough bytes in the buffer, don't dissect it (this
* can happen for example when a DISPOSE message is sent, there are sample
* info records, but the payload size is zero for all of them)
*/
if ((octets_to_next_header - (offset - old_offset) > 0)) {
proto_item *ti;
proto_tree *sil_tree;
int count = 0;
sil_tree = proto_tree_add_subtree(
dissected_data_holder_tree,
data_holder_tvb,
offset,
-1,
ett_rtps_sample_batch_list,
&ti,
"Serialized Sample List");
for (count = 0; count < sample_info_count; ++count) {
/* Ensure there are enough bytes in the buffer to dissect the next sample */
if (octets_to_next_header - (offset - old_offset) + 4 < (int)sample_info_length[count]) {
expert_add_info_format(pinfo, ti, &ei_rtps_parameter_value_invalid, "Error: not enough bytes to dissect sample");
return;
}
/* We have enough bytes to dissect the next sample, so we update the rtps_dissector_data
* "position in the batch" value and dissect the sample
*/
data->position_in_batch = count;
if (encapsulation_id == ENCAPSULATION_CDR_LE ||
encapsulation_id == ENCAPSULATION_CDR_BE ||
encapsulation_id == ENCAPSULATION_CDR2_LE ||
encapsulation_id == ENCAPSULATION_CDR2_BE ||
encapsulation_id == ENCAPSULATION_PL_CDR_LE ||
encapsulation_id == ENCAPSULATION_PL_CDR_BE) {
try_dissection_from_type_object = true;
}
if ((sample_info_flags[count] & FLAG_SAMPLE_INFO_K) != 0) {
proto_tree_add_bytes_format(sil_tree, hf_rtps_serialized_key,
data_holder_tvb, offset, sample_info_length[count], NULL, "serializedKey[%d]", count);
} else {
if (!rtps_util_try_dissector(
sil_tree, pinfo, data_holder_tvb, offset, guid, data, get_encapsulation_endianness(encapsulation_id), get_encapsulation_version(encapsulation_id), try_dissection_from_type_object)) {
proto_tree_add_bytes_format(sil_tree, hf_rtps_serialized_data,
data_holder_tvb, offset, sample_info_length[count], NULL, "serializedData[%d]", count);
}
}
offset += sample_info_length[count];
}
}
}
generate_status_info(pinfo, wid, status_info);
}
/* *********************************************************************** */
/* * G A P * */
/* *********************************************************************** */
static void dissect_GAP(tvbuff_t *tvb, packet_info *pinfo, int offset,
uint8_t flags, const unsigned encoding, int octets_to_next_header,
proto_tree *tree, endpoint_guid *guid) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | GAP |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | ObjectId readerObjectId |
* +---------------+---------------+---------------+---------------+
* | ObjectId writerObjectId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber firstSeqNumber +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + Bitmap bitmap +
* | |
* +---------------+---------------+---------------+---------------+
*
* RTPS 1.2/2.0
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | GAP |X|X|X|X|X|X|F|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | EntityId readerEntityId |
* +---------------+---------------+---------------+---------------+
* | EntityId writerEntityId |
* +---------------+---------------+---------------+---------------+
* | |
* + SequenceNumber gapStart +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ SequenceNumberSet gapList ~
* | |
* +---------------+---------------+---------------+---------------+
*/
proto_item *octet_item;
uint32_t wid;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, GAP_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (octets_to_next_header < 24) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= 24)");
return;
}
offset += 4;
/* readerEntityId */
rtps_util_add_entity_id(tree, tvb, offset,
hf_rtps_sm_rdentity_id, hf_rtps_sm_rdentity_id_key, hf_rtps_sm_rdentity_id_kind,
ett_rtps_rdentity, "readerEntityId", NULL);
offset += 4;
/* writerEntityId */
rtps_util_add_entity_id(tree, tvb, offset,
hf_rtps_sm_wrentity_id, hf_rtps_sm_wrentity_id_key, hf_rtps_sm_wrentity_id_kind,
ett_rtps_wrentity, "writerEntityId", &wid);
offset += 4;
guid->entity_id = wid;
guid->fields_present |= GUID_HAS_ENTITY_ID;
rtps_util_add_topic_info(tree, pinfo, tvb, offset, guid);
/* First Sequence Number */
rtps_util_add_seq_number(tree, tvb, offset, encoding, "gapStart");
offset += 8;
/* Bitmap */
rtps_util_add_bitmap(tree, tvb, offset, encoding, "gapList", false);
}
/* *********************************************************************** */
/* * I N F O _ T S * */
/* *********************************************************************** */
static void dissect_INFO_TS(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_TS |X|X|X|X|X|X|I|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | |
* + NtpTime ntpTimestamp [only if I==0] +
* | |
* +---------------+---------------+---------------+---------------+
*
* RTPS 1.2/2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_TS |X|X|X|X|X|X|T|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | |
* + Timestamp timestamp [only if T==1] +
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_TS_FLAGS, flags);
octet_item = proto_tree_add_item(tree,
hf_rtps_sm_octets_to_next_header,
tvb,
offset + 2,
2,
encoding);
min_len = 0;
if ((flags & FLAG_INFO_TS_T) == 0) min_len += 8;
if (octets_to_next_header != min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == %u)", min_len);
return;
}
offset += 4;
if ((flags & FLAG_INFO_TS_T) == 0) {
rtps_util_add_timestamp(tree,
tvb,
offset,
encoding,
hf_rtps_info_ts_timestamp);
}
}
/* *********************************************************************** */
/* * I N F O _ S R C * */
/* *********************************************************************** */
static void dissect_INFO_SRC(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree, uint16_t rtps_version) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | IPAddress appIpAddress |
* +---------------+---------------+---------------+---------------+
* | ProtocolVersion version | VendorId vendor |
* +---------------+---------------+---------------+---------------+
* | HostId hostId |
* +---------------+---------------+---------------+---------------+
* | AppId appId |
* +---------------+---------------+---------------+---------------+
*
* RTPS 1.2/2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_SRC |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | long unused |
* +---------------+---------------+---------------+---------------+
* | ProtocolVersion version | VendorId vendor |
* +---------------+---------------+---------------+---------------+
* | |
* + GuidPrefix guidPrefix +
* | |
* +---------------+---------------+---------------+---------------+
*/
proto_item *octet_item;
uint16_t version;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_SRC_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (rtps_version < 0x0200) {
if (octets_to_next_header != 16) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 16)");
return;
}
} else {
if (octets_to_next_header != 20) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 20)");
return;
}
}
offset += 4;
/* Use version field to determine what to display */
version = tvb_get_ntohs(tvb, offset+4);
if (version < 0x102) {
proto_tree_add_item(tree, hf_rtps_info_src_ip, tvb, offset, 4, encoding);
} else {
proto_tree_add_item(tree, hf_rtps_info_src_unused, tvb, offset, 4, encoding);
}
offset += 4;
rtps_util_add_protocol_version(tree, tvb, offset);
offset += 2;
/* Vendor ID */
rtps_util_add_vendor_id(tree, tvb, offset);
offset += 2;
if (rtps_version < 0x0200) {
rtps_util_add_guid_prefix_v1(tree, tvb, offset,
hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind,
NULL); /* Use default 'guidPrefix' */
} else {
rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_guid_prefix_src,
hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix);
}
}
/* *********************************************************************** */
/* * I N F O _ R E P L Y _ I P 4 * */
/* *********************************************************************** */
static void dissect_INFO_REPLY_IP4(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | IPAddress unicastReplyIpAddress |
* +---------------+---------------+---------------+---------------+
* | Port unicastReplyPort |
* +---------------+---------------+---------------+---------------+
* | IPAddress multicastReplyIpAddress [ only if M==1 ] |
* +---------------+---------------+---------------+---------------+
* | Port multicastReplyPort [ only if M==1 ] |
* +---------------+---------------+---------------+---------------+
*
* RTPS 1.2/2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* |INFO_REPLY_IP4 |X|X|X|X|X|X|M|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | |
* + LocatorUDPv4 unicastReplyLocator +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + LocatorUDPv4 multicastReplyLocator [only if M==1] +
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_REPLY_IP4_FLAGS, flags);
octet_item = proto_tree_add_item(tree,
hf_rtps_sm_octets_to_next_header,
tvb,
offset + 2,
2,
encoding);
min_len = 8;
if ((flags & FLAG_INFO_REPLY_IP4_M) != 0) min_len += 8;
if (octets_to_next_header != min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == %u)", min_len);
return;
}
offset += 4;
/* unicastReplyLocator */
rtps_util_add_locator_udp_v4(tree, pinfo, tvb, offset,
"unicastReplyLocator", encoding);
offset += 8;
/* multicastReplyLocator */
if ((flags & FLAG_INFO_REPLY_IP4_M) != 0) {
rtps_util_add_locator_udp_v4(tree, pinfo, tvb, offset,
"multicastReplyLocator", encoding);
/*offset += 8;*/
}
}
/* *********************************************************************** */
/* * I N F O _ D S T * */
/* *********************************************************************** */
static void dissect_INFO_DST(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree,
uint16_t version, endpoint_guid *dst_guid) {
/* RTPS 1.0/1.1:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | HostId hostId |
* +---------------+---------------+---------------+---------------+
* | AppId appId |
* +---------------+---------------+---------------+---------------+
*
* RTPS 1.2/2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_DST |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | |
* + GuidPrefix guidPrefix +
* | |
* +---------------+---------------+---------------+---------------+
*/
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_DST_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (version < 0x0200) {
if (octets_to_next_header != 8) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 8)");
return;
}
} else {
if (octets_to_next_header != 12) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 12)");
return;
}
}
offset += 4;
if (version < 0x0200) {
rtps_util_add_guid_prefix_v1(tree, tvb, offset,
hf_rtps_sm_guid_prefix_v1, hf_rtps_sm_host_id, hf_rtps_sm_app_id,
hf_rtps_sm_instance_id_v1, hf_rtps_sm_app_kind,
NULL);
} else {
rtps_util_add_guid_prefix_v2(tree, tvb, offset, hf_rtps_guid_prefix_dst,
hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix);
dst_guid->host_id = tvb_get_ntohl(tvb, offset);
dst_guid->app_id = tvb_get_ntohl(tvb, offset + 4);
dst_guid->instance_id = tvb_get_ntohl(tvb, offset + 8);
dst_guid->fields_present |= GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID;
}
}
/* *********************************************************************** */
/* * I N F O _ R E P L Y * */
/* *********************************************************************** */
static void dissect_INFO_REPLY(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header, proto_tree *tree) {
/* RTPS 1.0/1.1:
* INFO_REPLY is *NOT* the same thing as the old INFO_REPLY.
*
* RTPS 1.2/2.0:
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | INFO_REPLY |X|X|X|X|X|X|M|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | |
* ~ LocatorList unicastReplyLocatorList ~
* | |
* +---------------+---------------+---------------+---------------+
* | |
* ~ LocatorList multicastReplyLocatorList [only if M==1] ~
* | |
* +---------------+---------------+---------------+---------------+
*/
int min_len;
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, INFO_REPLY_FLAGS, flags);
octet_item = proto_tree_add_item(tree,
hf_rtps_sm_octets_to_next_header,
tvb,
offset + 2,
2,
encoding);
min_len = 4;
if ((flags & FLAG_INFO_REPLY_M) != 0) min_len += 4;
if (octets_to_next_header < min_len) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be >= %u)", min_len);
return;
}
offset += 4;
/* unicastReplyLocatorList */
offset = rtps_util_add_locator_list(tree, pinfo, tvb, offset, "unicastReplyLocatorList", encoding);
/* multicastReplyLocatorList */
if ((flags & FLAG_INFO_REPLY_M) != 0) {
/*offset = */rtps_util_add_locator_list(tree, pinfo, tvb, offset, "multicastReplyLocatorList", encoding);
}
}
/* *********************************************************************** */
/* * RTI CRC * */
/* *********************************************************************** */
static void dissect_RTI_CRC(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags,
const unsigned encoding, int octets_to_next_header,proto_tree *tree) {
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | RTI_CRC |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | RTPS Message length (without the 20 bytes header) |
* +---------------+---------------+---------------+---------------+
* | CRC32 |
* +---------------+---------------+---------------+---------------+
Total 12 bytes */
proto_item *octet_item;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags, ett_rtps_flags, RTI_CRC_FLAGS, flags);
octet_item = proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb,
offset + 2, 2, encoding);
if (octets_to_next_header != 8) {
expert_add_info_format(pinfo, octet_item, &ei_rtps_sm_octets_to_next_header_error, "(Error: should be == 8)");
return;
}
offset += 4;
proto_tree_add_item(tree, hf_rtps_sm_rti_crc_number, tvb, offset, 4, encoding);
offset += 4;
proto_tree_add_item(tree, hf_rtps_sm_rti_crc_result, tvb, offset, 4, ENC_BIG_ENDIAN);
}
/**
* @brief Do a forward search for the begining of the tags section in the
* SRTPS POSTFIX/SEC POSTFIX submessage.
*/
static int rtps_util_look_for_secure_tag(
tvbuff_t *tvb,
int offset)
{
int submessage_offset = offset;
uint8_t submessage_id = 0;
int tvb_remaining_len = tvb_reported_length_remaining(tvb, offset);
int submessage_len = 0;
while (tvb_remaining_len > 4) {
submessage_id = tvb_get_uint8(tvb, submessage_offset);
submessage_len = tvb_get_uint16(
tvb,
submessage_offset + 2,
ENC_LITTLE_ENDIAN);
tvb_remaining_len -= submessage_len;
if (submessage_id == SUBMESSAGE_SRTPS_POSTFIX
|| submessage_id == SUBMESSAGE_SEC_POSTFIX) {
return submessage_offset + 4;
}
submessage_offset += submessage_len;
tvb_remaining_len -= submessage_len;
}
return -1;
}
// NOLINTNEXTLINE(misc-no-recursion)
static void dissect_SECURE(
tvbuff_t *tvb,
packet_info *pinfo _U_,
int offset,
uint8_t flags,
const unsigned encoding _U_,
int octets_to_next_header,
proto_tree *tree,
uint16_t vendor_id _U_,
endpoint_guid *guid,
bool dissecting_encrypted_submessage)
{
/* *********************************************************************** */
/* * SECURE SUBMESSAGE * */
/* *********************************************************************** */
/* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | SECURE SUBMSG |X|X|X|X|X|X|S|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | long transformationKind |
* +---------------+---------------+---------------+---------------+
* | |
* + octet transformationId[8] +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + octet secure_data[] +
* | |
* +---------------+---------------+---------------+---------------+
*/
proto_tree * payload_tree;
unsigned local_encoding;
int secure_body_len = 0;
rtps_current_packet_decryption_info_t *decryption_info;
int initial_offset = offset;
proto_tree_add_bitmask_value(
tree,
tvb,
offset + 1,
hf_rtps_sm_flags,
ett_rtps_flags,
SECURE_FLAGS,
flags);
local_encoding = ((flags & FLAG_E) != 0) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN;
proto_tree_add_item(
tree,
hf_rtps_sm_octets_to_next_header,
tvb,
offset + 2,
2,
local_encoding);
offset += 4;
payload_tree = proto_tree_add_subtree_format(
tree,
tvb,
offset,
octets_to_next_header,
ett_rtps_secure_payload_tree,
NULL,
"Secured payload");
proto_tree_add_item(
payload_tree,
hf_rtps_secure_secure_data_length,
tvb,
offset,
4,
ENC_BIG_ENDIAN);
offset += 4;
secure_body_len = octets_to_next_header - 4;
proto_tree_add_item(
payload_tree,
hf_rtps_secure_secure_data,
tvb,
offset,
octets_to_next_header - 4,
local_encoding);
decryption_info = (rtps_current_packet_decryption_info_t *)
p_get_proto_data(
pinfo->pool,
pinfo,
proto_rtps,
RTPS_DECRYPTION_INFO_KEY);
if (!enable_rtps_psk_decryption
|| decryption_info == NULL
|| !decryption_info->try_psk_decryption) {
return;
}
if (dissecting_encrypted_submessage) {
/*
* This should never happen.
* If an RTPS message is encrypted with a pre-shared key, then the dissector
* will use this function to decrypt the SEC_BODY submessage and attempt to
* dissect it by calling dissect_rtps_submessages. The
* dissecting_encrypted_submessage parameter makes sure that the recursion
* is not infinite. However, this is not really possible because pre-shared
* key encryption takes only place at the RTPS message level; there
* shouldn't be another pre-shared key encoded SEC_BODY submessage at this
* point. Clang complains about the recursion because it doesn't have the
* information about the RTPS protocol. We ignore the warning with the
* NOLINTNEXTLINE suppression (misc-no-recursion argument) above each
* affected function.
*/
return;
}
for (unsigned entry_idx = 0; entry_idx < rtps_psk_options.size; entry_idx++) {
uint8_t *decrypted_data = NULL;
uint8_t session_key[RTPS_HMAC_256_BUFFER_SIZE_BYTES];
uint8_t *tag = NULL;
int tag_offset = 0;
gcry_error_t error = GPG_ERR_NO_ERROR;
/* Iterate all entries in the PSK table of the RTPS protocol options */
rtps_psk_options_entry_t *entry = &rtps_psk_options.entries[entry_idx];
/* Check if each field is equal or the ignore options are enabled */
bool host_id_mismatch = !entry->host_id.ignore
&& entry->host_id.value != decryption_info->guid_prefix.host_id;
bool host_app_mismatch = !entry->app_id.ignore
&& entry->app_id.value != decryption_info->guid_prefix.app_id;
bool host_instance_mismatch = !entry->instance_id.ignore
&& entry->instance_id.value != decryption_info->guid_prefix.instance_id;
bool psk_index_mismatch = !entry->passphrase_id.ignore
&& entry->passphrase_id.value != decryption_info->psk_index;
/*
* We proceed to decryption only if host, app and instance ids are equals
* (or ignored).
*/
if (host_id_mismatch
|| host_app_mismatch
|| host_instance_mismatch
|| psk_index_mismatch) {
continue;
}
/*
* When decrypting with PSKs there is only one tag in the SRTPS POSTFIX/SEC
* POSTFIX submessage. The offset is the one until the next submessage.
* The 4 constant is the sum of submessage_id(1 byte)
* + flags (1 byte) + octects to the next submessage(2 bytes)
*/
tag_offset = rtps_util_look_for_secure_tag(
tvb,
initial_offset + octets_to_next_header + 4);
if (tag_offset > 0) {
tag = tvb_memdup(
wmem_packet_scope(),
tvb,
tag_offset,
SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH);
}
/* Decrypt the payload */
decrypted_data = rtps_decrypt_secure_payload(
tvb,
pinfo,
offset,
(size_t) secure_body_len,
entry->passphrase_secret,
decryption_info->init_vector,
decryption_info->algorithm,
decryption_info->transformation_key,
decryption_info->session_id,
tag,
session_key,
&error,
wmem_packet_scope());
error = gpg_err_code(error);
if (error == GPG_ERR_NO_ERROR) {
tvbuff_t *decrypted_tvb = NULL;
/*
* Each byte becomes two hexadecimal characters.
* We also add one for the NUL terminator, which we will add manually
* because bytes_to_hexstr does not add it.
*/
char session_key_hexadecimal_representation[
RTPS_HMAC_256_BUFFER_SIZE_BYTES * 2 + 1];
char *session_key_nul_terminator_ptr = NULL;
rtps_guid_prefix_t guid_backup = decryption_info->guid_prefix;
/* Add the decrypted payload as a generated tvb */
decrypted_tvb = tvb_new_real_data(
decrypted_data,
(unsigned) secure_body_len,
secure_body_len);
tvb_set_child_real_data_tvbuff(tvb, decrypted_tvb);
session_key_nul_terminator_ptr = bytes_to_hexstr(
session_key_hexadecimal_representation,
session_key,
RTPS_HMAC_256_BUFFER_SIZE_BYTES);
*session_key_nul_terminator_ptr = '\0';
proto_tree* decrypted_subtree = NULL;
decrypted_subtree = proto_tree_add_subtree_format(
payload_tree,
decrypted_tvb,
offset,
secure_body_len,
ett_rtps_decrypted_payload,
NULL,
"Decrypted Payload (Passphrase Secret: \"%s\", "
"Passphrase ID: %d Session Key: %s)",
entry->passphrase_secret,
entry->passphrase_id.value,
session_key_hexadecimal_representation);
add_new_data_source(pinfo, decrypted_tvb, "Decrypted Data");
proto_item_set_generated(decrypted_subtree);
/*
* Reset the content of the decryption info except the guid. This way we
* avoid interefering in possible decription inside the secure payload.
*/
rtps_current_packet_decryption_info_reset(decryption_info);
decryption_info->guid_prefix = guid_backup;
dissect_rtps_submessages(
decrypted_tvb,
0,
pinfo,
decrypted_subtree,
0x0200,
vendor_id,
guid,
true /* dissecting_encrypted_submessage. */);
break;
} else if (error == GPG_ERR_CHECKSUM) {
/* Wrong PSK */
proto_tree_add_expert_format(
payload_tree,
pinfo,
&ei_rtps_invalid_psk,
tvb,
offset,
octets_to_next_header,
"Bad %s tag check. " \
"Possibly wrong passphrase secret (\"%s\") or malformed packet",
val_to_str(
decryption_info->algorithm,
secure_transformation_kind,
"Unknown algorithm"),
entry->passphrase_secret);
break;
} else {
/* General error. Displaying GCRY error output */
proto_tree_add_expert_format(
payload_tree,
pinfo,
&ei_rtps_invalid_psk,
tvb,
offset,
octets_to_next_header,
"Unable to decrypt content with passphrase secret (\"%s\"). %s: %s",
entry->passphrase_secret,
gcry_strsource(error),
gcry_strerror(error));
break;
}
}
}
static void dissect_SECURE_PREFIX(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
uint8_t flags, const unsigned encoding, int octets_to_next_header,
proto_tree *tree, uint16_t vendor_id _U_) {
/*
* MIG_RTPS_SECURE_RTPS_PREFIX and MIG_RTPS_SECURE_PREFIX share same serialization:
* 0...2...........8...............16.............24...............32
* +---------------+---------------+---------------+---------------+
* | 0x33 / 0x31 |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | |
* + SecureDataHeader sec_data_header +
* | |
* +---------------+---------------+---------------+---------------+
*
* where SecureDataHeader is:
*
* SecureDataHeader: TransformationIdentifier (kind + key) + plugin_sec_header
* 0...2...........8...............16.............24...............32
* +---------------+---------------+---------------+---------------+
* | Revision_id |tran...on_kind |
* +---------------+---------------+---------------+---------------+
* | |
* + octet transformation_key_id[4] +
* | |
* +---------------+---------------+---------------+---------------+
* | sesion_id |
* +---------------+---------------+---------------+---------------+
* | init_vector_suffix[8] |
* +---------------+---------------+---------------+---------------+
*/
proto_tree * sec_data_header_tree;
int flags_offset = offset + 1;
int session_id_offset = 0;
int transformation_key_offset = 0;
int algorithm_offset = 0;
int init_vector_offset = 0;
int psk_index_offset_three_bytes = 0;
int psk_index_offset_fourth_byte = 0;
uint32_t psk_index = 0;
proto_item *passphrase_id_item = NULL;
unsigned flags_byte = 0;
bool is_psk_protected = false;
proto_item *transformation_kind_item = NULL;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags,
ett_rtps_flags, SECURE_PREFIX_FLAGS, flags);
flags_byte = tvb_get_uint8(tvb, flags_offset);
is_psk_protected = (flags_byte & 0x04) != 0;
proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset + 2,
2, encoding);
offset += 4;
sec_data_header_tree = proto_tree_add_subtree_format(tree, tvb, offset, octets_to_next_header,
ett_rtps_secure_dataheader_tree, NULL, "Secure Data Header");
/* Transformation Kind field used to be 4 bytes. Now it is splitted:
* - 3 bytes: Transformation Key Revision
* - 1 byte: Transformation Kind
* A single byte is enough for Transformation Kind since it only has five possible values (0-4).
*/
psk_index_offset_three_bytes = offset;
proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_key_revision_id, tvb,
offset, 3, ENC_BIG_ENDIAN);
offset += 3;
algorithm_offset = offset;
proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_kind, tvb,
offset, 1, ENC_BIG_ENDIAN);
offset += 1;
transformation_key_offset = offset;
proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_transformation_key_id, tvb,
offset, 4, ENC_NA);
offset += 3;
if (is_psk_protected) {
proto_tree *transformation_kind_tree;
/* PSK index is the last byte of the transformation kind */
psk_index_offset_fourth_byte = offset;
transformation_kind_tree = proto_item_add_subtree(
transformation_kind_item,
ett_rtps_secure_transformation_kind);
proto_tree_add_item(
transformation_kind_tree,
hf_rtps_secure_dataheader_passphrase_key_id,
tvb,
psk_index_offset_fourth_byte,
1,
ENC_NA);
}
offset += 1;
session_id_offset = offset;
proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_session_id, tvb,
offset, 4, ENC_BIG_ENDIAN);
offset += 4;
init_vector_offset = session_id_offset;
proto_tree_add_item(sec_data_header_tree, hf_rtps_secure_dataheader_init_vector_suffix, tvb,
offset, octets_to_next_header-12, ENC_NA);
if (is_psk_protected) {
uint8_t *psk_index_bytes = (uint8_t*) &psk_index;
tvb_memcpy(tvb, &psk_index_bytes[1], psk_index_offset_three_bytes, 3);
tvb_memcpy(tvb, psk_index_bytes, psk_index_offset_fourth_byte, 1);
passphrase_id_item = proto_tree_add_uint(
sec_data_header_tree,
hf_rtps_secure_dataheader_passphrase_id,
tvb,
0,
0,
psk_index);
proto_item_set_generated(passphrase_id_item);
}
/*
* If PSK decryption is enabled, then store the session id, init vector and
* transformation key for using them later during the session key generation.
*/
if (is_psk_protected && enable_rtps_psk_decryption) {
rtps_current_packet_decryption_info_t *decryption_info =
(rtps_current_packet_decryption_info_t *) p_get_proto_data(
pinfo->pool,
pinfo,
proto_rtps,
RTPS_DECRYPTION_INFO_KEY);
if (decryption_info == NULL) {
return;
}
decryption_info->try_psk_decryption = true;
decryption_info->algorithm = tvb_get_uint8(tvb, algorithm_offset);
/* Copy the bytes as they are. Without considering the endianness */
tvb_memcpy(
tvb,
&decryption_info->session_id,
session_id_offset,
sizeof(uint32_t));
tvb_memcpy(
tvb,
&decryption_info->init_vector,
init_vector_offset,
RTPS_SECURITY_INIT_VECTOR_LEN);
tvb_memcpy(
tvb,
&decryption_info->transformation_key,
transformation_key_offset,
sizeof(uint32_t));
/*
* PSK index is the composition of the three bytes of the transformation key
* revision Id and the byte of the transformation id.
*/
decryption_info->psk_index = psk_index;
}
}
static void dissect_SECURE_POSTFIX(
tvbuff_t *tvb,
packet_info *pinfo _U_,
int offset,
uint8_t flags,
const unsigned encoding,
int octets_to_next_header,
proto_tree *tree,
uint16_t vendor_id _U_)
{
/*
* MIG_RTPS_SECURE_RTPS_POSTFIX and MIG_RTPS_SECURE_POSTFIX share the same
* serialization:
* 0...2...........8...............16.............24...............32
* +---------------+---------------+---------------+---------------+
* | 0x34 / 0x32 |X|X|X|X|X|X|X|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | |
* + SecureDataTag sec_data_tag +
* | |
* +---------------+---------------+---------------+---------------+
*
* where SecureDataTag is:
* 0...2...........8...............16.............24...............32
* +---------------+---------------+---------------+---------------+
* | |
* ~ octet plugin_sec_tag[] ~
* | |
* +---------------+---------------+---------------+---------------+
*
* and plugin_sec_tag is:
* 0...2...........8...............16.............24...............32
* +---------------+---------------+---------------+---------------+
* ~ octet[16] plugin_sec_tag.common_mac ~
* +---------------+---------------+---------------+---------------+
* + plugin_sec_tag.receiver_specific_macs: |
* | long plugin_sec_tag.receiver_specific_macs.length = N |
* +---------------+---------------+---------------+---------------+
* | octet[4] receiver_specific_macs[0].receiver_mac_key_id |
* | octet[16] receiver_specific_macs[0].receiver_mac |
* +---------------+---------------+---------------+---------------+
* | . . . |
* +---------------+---------------+---------------+---------------+
* | octet[4] receiver_specific_macs[N-1].receiver_mac_key_id |
* | octet[16] receiver_specific_macs[N-1].receiver_mac |
* +---------------+---------------+---------------+---------------+
*/
int specific_macs_num = 0;
++offset;
proto_tree_add_bitmask_value(tree, tvb, offset + 1, hf_rtps_sm_flags,
ett_rtps_flags, SECURE_POSTFIX_FLAGS, flags);
++offset;
proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, offset,
2, encoding);
offset += 2;
proto_tree_add_item(
tree,
hf_rtps_secure_datatag_plugin_sec_tag_common_mac,
tvb,
offset,
SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH,
encoding);
offset += SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH;
/*
* The receiver-specific mac length is encoded in big endian (regardless of
* the submessage flags), as per the Security specification.
*/
proto_tree_add_item(
tree,
hf_rtps_secure_datatag_plugin_specific_macs_len,
tvb,
offset,
4,
ENC_BIG_ENDIAN);
specific_macs_num = tvb_get_int32(tvb, offset, ENC_BIG_ENDIAN);
offset += 4;
/* Dissect specific macs */
if (specific_macs_num > 0) {
int RECEIVER_SPECIFIC_MAC_KEY_LENGTH = 4; /* bytes. */
int secure_tags_list_member_size =
RECEIVER_SPECIFIC_MAC_KEY_LENGTH + SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH;
proto_tree *sec_data_tag_tree = NULL;
sec_data_tag_tree = proto_tree_add_subtree_format(
tree,
tvb,
offset,
octets_to_next_header,
ett_rtps_secure_dataheader_tree,
NULL,
"Receiver Specific Macs");
for (int tag_counter = 0; tag_counter < specific_macs_num; tag_counter++) {
proto_tree *tag_tree = NULL;
int tag_offset = tag_counter * secure_tags_list_member_size;
tag_tree = proto_tree_add_subtree_format(
sec_data_tag_tree,
tvb,
offset + tag_offset,
secure_tags_list_member_size,
ett_rtps_secure_postfix_tag_list_item,
NULL,
"Receiver Specific Mac[%d]",
tag_counter);
proto_tree_add_item(
tag_tree,
hf_rtps_secure_datatag_plugin_sec_tag,
tvb,
offset + tag_offset,
SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH,
encoding);
proto_tree_add_item(
tag_tree,
hf_rtps_secure_datatag_plugin_sec_tag_key,
tvb,
offset + tag_offset + SECURE_TAG_COMMON_AND_SPECIFIC_MAC_LENGTH,
RECEIVER_SPECIFIC_MAC_KEY_LENGTH,
encoding);
}
}
}
/*
* 0...2...........7...............15.............23...............31
* +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
* | BINDING_PING |X|X|X|X|X|B|L|E| octetsToNextHeader |
* +---------------+---------------+---------------+---------------+
* | DDS_UnsignedLong rtps_port |
* +---------------+---------------+---------------+---------------+
* | |
* + DDS_Octet address[12][If L = 0] +
* | |
* + +
* | |
* +---------------+---------------+---------------+---------------+
* | |
* + DDS_Octet address[16][If L = 1] +
* | |
* + +
* | |
* + +
* | |
* +---------------+---------------+---------------+---------------+
*
*/
static void dissect_UDP_WAN_BINDING_PING(tvbuff_t *tvb, packet_info *pinfo _U_, int offset,
uint8_t flags, const unsigned encoding, int octets_to_next_header _U_,
proto_tree *tree, uint16_t vendor_id _U_) {
const unsigned flags_offset = offset + 1;
const unsigned next_header_offset = flags_offset + 1;
const unsigned port_offset = next_header_offset + 2;
const unsigned address_offset = port_offset + 4;
proto_tree_add_bitmask_value(tree, tvb, flags_offset, hf_rtps_udpv4_wan_binding_ping_flags,
ett_rtps_flags, UDPV4_WAN_BINDING_PING_FLAGS, flags);
proto_tree_add_item(tree, hf_rtps_sm_octets_to_next_header, tvb, next_header_offset,
2, encoding);
proto_tree_add_item(tree, hf_rtps_udpv4_wan_binding_ping_port, tvb, port_offset,
4, encoding);
/*
* Address[12] [If L=0] is the only one we currently support, and it maps to:
* DDS_Octet UUID[9] + 3 bytes of padding.
*/
if (flags & FLAG_UDPV4_WAN_BINDING_PING_FLAG_L) {
proto_tree_add_item(
tree,
hf_rtps_long_address,
tvb,
address_offset,
LONG_ADDRESS_SIZE,
encoding);
} else {
proto_tree_add_item(
tree,
hf_rtps_uuid,
tvb,
address_offset,
UUID_SIZE,
encoding);
}
}
// NOLINTNEXTLINE(misc-no-recursion)
static bool dissect_rtps_submessage_v2(
tvbuff_t *tvb,
packet_info *pinfo,
int offset,
uint8_t flags,
const unsigned encoding,
uint8_t submessageId,
uint16_t vendor_id,
int octets_to_next_header,
proto_tree *rtps_submessage_tree,
proto_item *submessage_item,
endpoint_guid *guid,
endpoint_guid *dst_guid,
bool dissecting_encrypted_submessage)
{
switch (submessageId)
{
case SUBMESSAGE_HEADER_EXTENSION:
dissect_HEADER_EXTENSION(tvb, pinfo, offset, flags, encoding, rtps_submessage_tree, octets_to_next_header, vendor_id);
break;
case SUBMESSAGE_DATA_FRAG:
dissect_DATA_FRAG(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, vendor_id, guid);
break;
case SUBMESSAGE_NOKEY_DATA_FRAG:
dissect_NOKEY_DATA_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, vendor_id);
break;
case SUBMESSAGE_NACK_FRAG:
dissect_NACK_FRAG(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
break;
case SUBMESSAGE_ACKNACK_SESSION:
case SUBMESSAGE_ACKNACK_BATCH:
dissect_ACKNACK(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, submessage_item, dst_guid);
break;
case SUBMESSAGE_APP_ACK:
dissect_APP_ACK(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, guid);
break;
case SUBMESSAGE_APP_ACK_CONF:
dissect_APP_ACK_CONF(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, submessage_item, guid);
break;
case SUBMESSAGE_HEARTBEAT_SESSION:
case SUBMESSAGE_HEARTBEAT_BATCH:
dissect_HEARTBEAT_BATCH(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, guid);
break;
case SUBMESSAGE_HEARTBEAT_FRAG:
dissect_HEARTBEAT_FRAG(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, guid);
break;
case SUBMESSAGE_HEARTBEAT_VIRTUAL:
dissect_HEARTBEAT_VIRTUAL(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, vendor_id, guid);
break;
case SUBMESSAGE_RTPS_DATA_SESSION: {
dissect_RTPS_DATA_SESSION(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree, vendor_id, guid);
break;
}
case SUBMESSAGE_RTPS_DATA:
dissect_RTPS_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree, vendor_id, false, guid);
break;
case SUBMESSAGE_RTI_DATA_FRAG_SESSION:
case SUBMESSAGE_RTPS_DATA_FRAG:
dissect_RTPS_DATA_FRAG_kind(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree, vendor_id, (submessageId == SUBMESSAGE_RTI_DATA_FRAG_SESSION), guid);
break;
case SUBMESSAGE_RTPS_DATA_BATCH:
dissect_RTPS_DATA_BATCH(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree, vendor_id, guid);
break;
case SUBMESSAGE_RTI_CRC:
if (vendor_id == RTPS_VENDOR_RTI_DDS) {
dissect_RTI_CRC(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree);
}
break;
case SUBMESSAGE_SEC_BODY:
dissect_SECURE(
tvb,
pinfo,
offset,
flags,
encoding,
octets_to_next_header,
rtps_submessage_tree,
vendor_id,
guid,
dissecting_encrypted_submessage);
break;
case SUBMESSAGE_SEC_PREFIX:
case SUBMESSAGE_SRTPS_PREFIX:
dissect_SECURE_PREFIX(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree, vendor_id);
break;
case SUBMESSAGE_SEC_POSTFIX:
case SUBMESSAGE_SRTPS_POSTFIX:
dissect_SECURE_POSTFIX(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree, vendor_id);
break;
case SUBMESSAGE_RTI_UDP_WAN_BINDING_PING:
dissect_UDP_WAN_BINDING_PING(tvb, pinfo, offset, flags, encoding, octets_to_next_header,
rtps_submessage_tree, vendor_id);
break;
default:
return false;
}
return true;
}
static bool dissect_rtps_submessage_v1(tvbuff_t *tvb, packet_info *pinfo, int offset, uint8_t flags, const unsigned encoding,
uint8_t submessageId, uint16_t version, uint16_t vendor_id, int octets_to_next_header,
proto_tree *rtps_submessage_tree, proto_item *submessage_item,
endpoint_guid * guid, endpoint_guid * dst_guid)
{
switch (submessageId)
{
case SUBMESSAGE_PAD:
dissect_PAD(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
break;
case SUBMESSAGE_DATA:
if (version < 0x0200) {
dissect_DATA_v1(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree);
} else {
dissect_DATA_v2(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, vendor_id, guid);
}
break;
case SUBMESSAGE_NOKEY_DATA:
dissect_NOKEY_DATA(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree,
version, vendor_id);
break;
case SUBMESSAGE_ACKNACK:
dissect_ACKNACK(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, submessage_item, dst_guid);
break;
case SUBMESSAGE_HEARTBEAT:
dissect_HEARTBEAT(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, version, guid);
break;
case SUBMESSAGE_GAP:
dissect_GAP(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, guid);
break;
case SUBMESSAGE_INFO_TS:
dissect_INFO_TS(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
break;
case SUBMESSAGE_INFO_SRC:
dissect_INFO_SRC(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree, version);
break;
case SUBMESSAGE_INFO_REPLY_IP4:
dissect_INFO_REPLY_IP4(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
break;
case SUBMESSAGE_INFO_DST:
dissect_INFO_DST(tvb, pinfo, offset, flags, encoding,
octets_to_next_header, rtps_submessage_tree, version, dst_guid);
break;
case SUBMESSAGE_INFO_REPLY:
dissect_INFO_REPLY(tvb, pinfo, offset, flags, encoding, octets_to_next_header, rtps_submessage_tree);
break;
default:
return false;
}
return true;
}
/***************************************************************************/
/* The main packet dissector function
*/
static bool dissect_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, int offset)
{
proto_item *ti;
proto_tree *rtps_tree;
uint8_t majorRev;
uint16_t version, vendor_id;
bool is_ping;
endpoint_guid guid = {0};
endpoint_guid *guid_copy;
uint32_t magic_number;
char domain_id_str[RTPS_UNKNOWN_DOMAIN_ID_STR_LEN] = RTPS_UNKNOWN_DOMAIN_ID_STR;
bool is_domain_id_calculated = false;
const char* not_accuracy_str = "";
int length_remaining = 0;
rtps_tvb_field rtps_root;
/* Check 'RTPS' signature:
* A header is invalid if it has less than 16 octets
*/
length_remaining = tvb_reported_length_remaining(tvb, offset);
if (length_remaining < 16)
return false;
magic_number = tvb_get_ntohl(tvb, offset);
if (magic_number != RTPX_MAGIC_NUMBER &&
magic_number != RTPS_MAGIC_NUMBER) {
return false;
}
/* Distinguish between RTPS 1.x and 2.x here */
majorRev = tvb_get_uint8(tvb,offset+4);
if ((majorRev != 1) && (majorRev != 2))
return false;
/* Save the beginning of the RTPS message */
rtps_root.tvb = tvb;
rtps_root.tvb_offset = offset;
rtps_root.tvb_len = tvb_reported_length_remaining(tvb, offset);
p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_ROOT_MESSAGE_KEY, (void **)&rtps_root);
col_set_str(pinfo->cinfo, COL_PROTOCOL, "RTPS");
col_clear(pinfo->cinfo, COL_INFO);
/* create display subtree for the protocol */
ti = proto_tree_add_item(tree, proto_rtps, tvb, 0, -1, ENC_NA);
rtps_tree = proto_item_add_subtree(ti, ett_rtps);
/* magic */
proto_tree_add_item(rtps_tree, hf_rtps_magic, tvb, 0, 4, ENC_NA | ENC_ASCII);
/* Protocol Version */
version = rtps_util_add_protocol_version(rtps_tree, tvb, offset+4);
/* Vendor Id */
vendor_id = rtps_util_add_vendor_id(rtps_tree, tvb, offset+6);
is_ping = rtps_is_ping(tvb, pinfo, offset+8);
if (is_ping) {
dissect_PING(tvb, offset + 8, ENC_BIG_ENDIAN, length_remaining - 8, rtps_tree);
} else {
if (version < 0x0200)
rtps_util_add_guid_prefix_v1(rtps_tree, tvb, offset+8,
hf_rtps_guid_prefix_v1, hf_rtps_host_id, hf_rtps_app_id,
hf_rtps_app_id_instance_id, hf_rtps_app_id_app_kind, NULL);
else
rtps_util_add_guid_prefix_v2(rtps_tree, tvb, offset+8, hf_rtps_guid_prefix_src,
hf_rtps_host_id, hf_rtps_app_id, hf_rtps_sm_instance_id, hf_rtps_guid_prefix);
guid.host_id = tvb_get_ntohl(tvb, offset+8);
guid.app_id = tvb_get_ntohl(tvb, offset+12);
guid.instance_id = tvb_get_ntohl(tvb, offset+16);
/*
* If decription is enabled, store the guid prefix to be used later in the
* dissect_SECURE and dissect_SECURE_PREFIX functions.
*/
if (enable_rtps_psk_decryption) {
rtps_current_packet_decryption_info_t *decryption_info = wmem_alloc(
wmem_packet_scope(),
sizeof(rtps_current_packet_decryption_info_t));
if (decryption_info == NULL) {
return false;
}
rtps_current_packet_decryption_info_reset(decryption_info);
decryption_info->guid_prefix.host_id = guid.host_id;
decryption_info->guid_prefix.app_id = guid.app_id;
decryption_info->guid_prefix.instance_id = guid.instance_id;
p_set_proto_data(
pinfo->pool,
pinfo,
proto_rtps,
RTPS_DECRYPTION_INFO_KEY,
(void **) decryption_info);
}
guid.fields_present = GUID_HAS_HOST_ID|GUID_HAS_APP_ID|GUID_HAS_INSTANCE_ID;
/* If the packet uses TCP we need top store the participant GUID to get the domainId later
* For that operation the member fields_present is not required and is not affected by
* its changes.
*/
guid_copy = (endpoint_guid*)wmem_memdup(pinfo->pool,
(const void*)&guid, sizeof(endpoint_guid));
p_add_proto_data(pinfo->pool, pinfo, proto_rtps,
RTPS_TCPMAP_DOMAIN_ID_PROTODATA_KEY, (void *)guid_copy);
#ifdef RTI_BUILD
pinfo->guid_prefix_host = tvb_get_ntohl(tvb, offset + 8);
pinfo->guid_prefix_app = tvb_get_ntohl(tvb, offset + 12);
pinfo->guid_prefix_count = tvb_get_ntohl(tvb, offset + 16);
pinfo->guid_rtps2 = 1;
#endif
}
/* Extract the domain id and participant index */
{
int domain_id, doffset, participant_idx = 0, nature;
proto_tree *mapping_tree;
/* For a complete description of these rules, see RTPS documentation
RTPS 1.2 mapping:
domain_id = ((pinfo->destport - PORT_BASE)/10) % 100;
participant_idx = (pinfo->destport - PORT_BASE) / 1000;
nature = (pinfo->destport % 10);
For Unicast, the port mapping formula is:
metatraffic_unicast_port = port_base +
(domain_id_gain * domain_id) +
(participant_id_gain * participant_id) +
builtin_unicast_port_offset
For Multicast, the port mapping is:
metatraffic_multicast_port = port_base +
(domain_id_gain * domain_id) +
builtin_multicast_port_offset
Where the constants are:
port_base = 7400
domain_id_gain = 250
participant_id_gain = 2
builtin_multicast_port_offset = 0
builtin_unicast_port_offset = 10
user_multicast_port_offset = 1
user_unicast_port_offset = 11
To obtain the individual components from the port number, the reverse formulas are:
domain_id = (port - port_base) / 250 (valid both multicast / unicast)
Doffset = (port - port_Base - (domain_id * 250));
participant_idx = (Doffset - 10) / 2;
*/
if (version < 0x0200) {
/* If using TCP domainId cannot deduced from the port. It must be taken from the participant
* discovery packets or Unknown.
*/
domain_id = get_domain_id_from_tcp_discovered_participants(discovered_participants_domain_ids, &guid);
if (pinfo->ptype != PT_TCP && domain_id == RTPS_UNKNOWN_DOMAIN_ID_VAL) {
domain_id = ((pinfo->destport - PORT_BASE) / 10) % 100;
is_domain_id_calculated = true;
}
participant_idx = (pinfo->destport - PORT_BASE) / 1000;
nature = (pinfo->destport % 10);
} else {
domain_id = get_domain_id_from_tcp_discovered_participants(discovered_participants_domain_ids, &guid);
if (pinfo->ptype != PT_TCP && pinfo->destport > PORT_BASE && domain_id == RTPS_UNKNOWN_DOMAIN_ID_VAL) {
domain_id = (pinfo->destport - PORT_BASE) / DOMAIN_GAIN;
is_domain_id_calculated = true;
}
doffset = (pinfo->destport - PORT_BASE - domain_id * DOMAIN_GAIN);
if (doffset == 0) {
nature = PORT_METATRAFFIC_MULTICAST;
}
else if (doffset == 1) {
nature = PORT_USERTRAFFIC_MULTICAST;
}
else {
participant_idx = (doffset - 10) / 2;
if ((doffset - 10) % 2 == 0) {
nature = PORT_METATRAFFIC_UNICAST;
}
else {
nature = PORT_USERTRAFFIC_UNICAST;
}
}
if (domain_id > 232 || domain_id < 0) {
domain_id = RTPS_UNKNOWN_DOMAIN_ID_VAL;
}
}
/* Used string for the domain participant to show Unknown if the domainId is not known when using TCP*/
if (domain_id != RTPS_UNKNOWN_DOMAIN_ID_VAL) {
snprintf(domain_id_str, RTPS_UNKNOWN_DOMAIN_ID_STR_LEN,
"%"PRId32, domain_id);
if (is_domain_id_calculated) {
not_accuracy_str = " (Based on calculated domainId. Might not be accurate)";
}
}
if ((nature == PORT_METATRAFFIC_UNICAST) || (nature == PORT_USERTRAFFIC_UNICAST) ||
(version < 0x0200)) {
mapping_tree = proto_tree_add_subtree_format(rtps_tree, tvb, 0, 0,
ett_rtps_default_mapping, NULL, "Default port mapping%s: domainId=%s, "
"participantIdx=%d, nature=%s",
not_accuracy_str,
domain_id_str,
participant_idx,
val_to_str(nature, nature_type_vals, "%02x"));
} else {
mapping_tree = proto_tree_add_subtree_format(rtps_tree, tvb, 0, 0,
ett_rtps_default_mapping, NULL, "Default port mapping%s: %s, domainId=%s",
not_accuracy_str,
val_to_str(nature, nature_type_vals, "%02x"),
domain_id_str);
}
ti = proto_tree_add_uint(mapping_tree, hf_rtps_domain_id, tvb, 0, 0, domain_id);
proto_item_set_generated(ti);
if ((nature == PORT_METATRAFFIC_UNICAST) || (nature == PORT_USERTRAFFIC_UNICAST) ||
(version < 0x0200)) {
ti = proto_tree_add_uint(mapping_tree, hf_rtps_participant_idx, tvb, 0, 0, participant_idx);
proto_item_set_generated(ti);
}
ti = proto_tree_add_uint(mapping_tree, hf_rtps_nature_type, tvb, 0, 0, nature);
proto_item_set_generated(ti);
}
/* offset behind RTPS's Header (need to be set in case tree=NULL)*/
offset += ((version < 0x0200) ? 16 : 20);
dissect_rtps_submessages(
tvb,
offset,
pinfo,
rtps_tree,
version,
vendor_id,
&guid,
false /* dissecting_encrypted_submessage. */);
/* If TCP there's an extra OOB byte at the end of the message */
/* TODO: What to do with it? */
return true;
} /* dissect_rtps(...) */
static
void append_submessage_col_info(packet_info* pinfo, submessage_col_info* current_submessage_col_info) {
bool* is_data_session_intermediate = NULL;
/* Status info column: (r),(p[U])...*/
if (current_submessage_col_info->status_info != NULL) {
col_append_str(pinfo->cinfo, COL_INFO, current_submessage_col_info->status_info);
}
/* DATA_SESSION last package */
is_data_session_intermediate = (bool*)p_get_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_DATA_SESSION_FINAL_PROTODATA_KEY);
if (is_data_session_intermediate != NULL && !*is_data_session_intermediate) {
current_submessage_col_info->data_session_kind = "(Last)";
col_append_str(pinfo->cinfo, COL_INFO, current_submessage_col_info->data_session_kind);
}
/* Topic name */
if (current_submessage_col_info->topic_name != NULL) {
col_append_sep_str(pinfo->cinfo, COL_INFO, " -> ", current_submessage_col_info->topic_name);
}
}
// NOLINTNEXTLINE(misc-no-recursion)
void dissect_rtps_submessages(
tvbuff_t *tvb,
int offset,
packet_info *pinfo,
proto_tree *rtps_tree,
uint16_t version,
uint16_t vendor_id,
endpoint_guid *guid,
bool dissecting_encrypted_submessage)
{
uint8_t submessageId, flags;
int sub_hf;
const value_string *sub_vals;
proto_item *ti;
proto_tree *rtps_submessage_tree;
unsigned encoding;
int next_submsg, octets_to_next_header;
endpoint_guid dst_guid;
submessage_col_info current_submessage_col_info = {NULL, NULL, NULL};
/* No fields have been set in GUID yet. */
dst_guid.fields_present = 0;
while (tvb_reported_length_remaining(tvb, offset) > 0) {
submessageId = tvb_get_uint8(tvb, offset);
if (version < 0x0200) {
sub_hf = hf_rtps_sm_id;
sub_vals = submessage_id_vals;
} else {
if ((submessageId & 0x80) && (vendor_id == RTPS_VENDOR_RTI_DDS)) {
sub_hf = hf_rtps_sm_idv2;
sub_vals = submessage_id_rti;
} else {
sub_hf = hf_rtps_sm_idv2;
sub_vals = submessage_id_valsv2;
}
}
col_append_sep_str(pinfo->cinfo, COL_INFO, ", ", val_to_str(submessageId, sub_vals, "Unknown[%02x]"));
/* Creates the subtree 'Submessage: XXXX' */
if (submessageId & 0x80) {
if (vendor_id == RTPS_VENDOR_RTI_DDS) {
ti = proto_tree_add_uint_format_value(rtps_tree, sub_hf, tvb, offset, 1, submessageId, "%s",
val_to_str(submessageId, submessage_id_rti, "Vendor-specific (0x%02x)"));
} else {
ti = proto_tree_add_uint_format_value(rtps_tree, sub_hf, tvb, offset, 1,
submessageId, "Vendor-specific (0x%02x)", submessageId);
}
} else {
ti = proto_tree_add_uint(rtps_tree, sub_hf, tvb, offset, 1, submessageId);
}
rtps_submessage_tree = proto_item_add_subtree(ti, ett_rtps_submessage);
/* Gets the flags */
flags = tvb_get_uint8(tvb, offset + 1);
/* Gets the E (Little endian) flag */
encoding = ((flags & FLAG_E) != 0) ? ENC_LITTLE_ENDIAN : ENC_BIG_ENDIAN;
/* Octets-to-next-header */
octets_to_next_header = tvb_get_uint16(tvb, offset + 2, encoding);
if ((octets_to_next_header == 0) && (version >= 0x0200)
&& (submessageId != SUBMESSAGE_PAD) && (submessageId != SUBMESSAGE_INFO_TS)) {
octets_to_next_header = tvb_reported_length_remaining(tvb, offset + 4);
}
next_submsg = offset + octets_to_next_header + 4;
/* Set length of this item */
proto_item_set_len(ti, octets_to_next_header + 4);
/* Now decode each single submessage
* The offset passed to the dissectors points to the start of the
* submessage (at the ID byte).
*/
p_set_proto_data(pinfo->pool, pinfo, proto_rtps, RTPS_CURRENT_SUBMESSAGE_COL_DATA_KEY, (void **)¤t_submessage_col_info);
if (!dissect_rtps_submessage_v1(tvb, pinfo, offset, flags, encoding,
submessageId, version, vendor_id,
octets_to_next_header, rtps_submessage_tree,
ti, guid, &dst_guid)) {
if ((version < 0x0200) ||
!dissect_rtps_submessage_v2(
tvb,
pinfo,
offset,
flags,
encoding,
submessageId,
vendor_id,
octets_to_next_header,
rtps_submessage_tree,
ti,
guid,
&dst_guid,
dissecting_encrypted_submessage)) {
proto_tree_add_uint(rtps_submessage_tree, hf_rtps_sm_flags,
tvb, offset + 1, 1, flags);
proto_tree_add_uint(rtps_submessage_tree,
hf_rtps_sm_octets_to_next_header,
tvb, offset + 2, 2, octets_to_next_header);
}
}
append_submessage_col_info(pinfo, ¤t_submessage_col_info);
/* Reset the col info for the next submessage */
current_submessage_col_info.data_session_kind = NULL;
current_submessage_col_info.status_info = NULL;
current_submessage_col_info.topic_name = NULL;
/* next submessage's offset */
offset = next_submsg;
}
}
static bool dissect_rtps_udp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
int offset = 0;
return dissect_rtps(tvb, pinfo, tree, offset);
}
static bool dissect_rtps_tcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
/* In RTPS over TCP the first 4 bytes are the packet length
* as 32-bit unsigned int coded as BIG ENDIAN
* uint32_t tcp_len = tvb_get_ntohl(tvb, offset);
*/
int offset = 4;
return dissect_rtps(tvb, pinfo, tree, offset);
}
static bool dissect_rtps_rtitcp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
int offset = 0;
return dissect_rtps(tvb, pinfo, tree, offset);
}
static int dissect_simple_rtps(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
{
int offset = 0;
if (dissect_rtps(tvb, pinfo, tree, offset) == false)
return 0;
return tvb_captured_length(tvb);
}
/*
* Type InstanceStateDataresponse is sent as user user data but there is no discovery data for it.
* So it is necessary to add it manually so Wireshark can dissect it
*/
static void initialize_instance_state_data_response_dissection_info(builtin_types_dissection_data_t *_builtin_types_dissection_data) {
uint32_t element = 0;
const uint64_t InstanceStateDataResponse_type_id = 0x9d6d4c879b0e6aa9;
const uint64_t sequence_100_InstanceTransitionData_type_id = 0x2dac07d5577caaf6;
const uint64_t guid_t_type_id = 0x36d940c4ed806097;
const uint64_t value_type_id = 0x974064b1120169ed;
const uint64_t instancetransitiondata_type_id = 0xceb6f5e405f4bde7;
const uint64_t KeyHashValue_type_id = 0x48725f37453310ed;
const uint64_t SerializedKey_type_id = 0x3fd77a8ff43c7e55;
const uint64_t payload_type_id = 0x0d0ecc8d34a5c3ab;
const uint64_t ntptime_t_type_id = 0x842c59af7e962a4c;
const uint64_t sequencenumber_t_type_id = 0xb933efe30d85453b;
/*
* @appendable @nested
* struct GUID_t {
* octet value[16];
* };
* @appendable @nested
* struct SequenceNumber_t {
* long high;
* unsigned long low;
* };
*
* @final @nested
* struct NtpTime_t {
* int32 sec;
* uint32 frac;
* };
* @final @nested
* struct SerializedKey {
* sequence<octet> payload;
* };
* typedef octet KeyHashValue[16];
*
* struct InstanceTransitionData {
* @optional KeyHashValue key_hash;
* @optional SerializedKey serialized_key;
* NtpTime_t last_update_timestamp;
* SequenceNumber_t transition_sequence_number;
* };
*/
/* All dissection_infos are added to the "dissection_infos" map */
/* value */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.value_dissection_info.member_name, "value", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.value_dissection_info.num_elements = VALUE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.value_dissection_info.bound = VALUE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.value_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE;
_builtin_types_dissection_data->dissection_infos.value_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE;
_builtin_types_dissection_data->dissection_infos.value_dissection_info.type_id = value_type_id;
_builtin_types_dissection_data->dissection_infos.value_dissection_info.bound = VALUE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.value_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.value_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.value_dissection_info));
/* GUID_t */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.member_name, "GUID_t", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.num_elements = GUID_T_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.type_id = guid_t_type_id;
_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
/* octet value[16] */
_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].flags = 0;
_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].member_id = 0;
_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].type_id = value_type_id;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.elements[0].member_name, "value", MAX_TOPIC_AND_TYPE_LENGTH);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.guid_t_dissection_info));
/* Payload */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.payload_dissection_info.member_name, "payload", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.payload_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE;
_builtin_types_dissection_data->dissection_infos.payload_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE;
_builtin_types_dissection_data->dissection_infos.payload_dissection_info.type_id = payload_type_id;
_builtin_types_dissection_data->dissection_infos.payload_dissection_info.bound = -1;
_builtin_types_dissection_data->dissection_infos.payload_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.payload_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.payload_dissection_info));
/* KeyHashValue */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.member_name, "KeyHashValue", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.num_elements = KEY_HAS_VALUE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.bound = KEY_HAS_VALUE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_ARRAY_TYPE;
_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.base_type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BYTE_TYPE;
_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.type_id = KeyHashValue_type_id;
_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.bound = KEY_HAS_VALUE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.key_hash_value_dissection_info));
/* SerializedKey */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.member_name, "SerializedKey", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.num_elements = GUID_T_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.type_id = SerializedKey_type_id;
_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, GUID_T_NUM_ELEMENTS);
/* sequence<octet> payload */
_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].flags = 0;
_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].member_id = 0;
_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].type_id = payload_type_id;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.elements[0].member_name, "payload", MAX_TOPIC_AND_TYPE_LENGTH);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.serialized_key_dissection_info));
/* NtpTime_t */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.member_name, "NtpTime_t", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.num_elements = NTPTIME_T_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.type_id = ntptime_t_type_id;
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, NTPTIME_T_NUM_ELEMENTS);
/* int32 sec */
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].flags = 0;
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].member_id = 0;
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[0].member_name, "sec", MAX_TOPIC_AND_TYPE_LENGTH);
/* uint32 frac */
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].flags = 0;
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].member_id = 1;
_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.elements[1].member_name, "frac", MAX_TOPIC_AND_TYPE_LENGTH);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.ntptime_t_dissection_info));
/* SequenceNumber_t */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.member_name, "SequenceNumber_t", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.num_elements = SEQUENCE_NUMBER_T_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.type_id = sequencenumber_t_type_id;
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, SEQUENCE_NUMBER_T_NUM_ELEMENTS);
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].flags = 0;
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].member_id = 0;
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_INT_32_TYPE;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[0].member_name, "high", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].flags = 0;
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].member_id = 1;
_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.elements[1].member_name, "low", MAX_TOPIC_AND_TYPE_LENGTH);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.sequence_number_t_dissection_info));
/* Instance transition Data */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.member_name, "InstanceTransitionData", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.num_elements = INSTANCE_TRANSITION_DATA_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.type_id = instancetransitiondata_type_id;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, INSTANCE_TRANSITION_DATA_NUM_ELEMENTS);
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info));
for (element = 0; element < _builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.num_elements; ++element) {
switch (element) {
case 0:
/* @optional KeyHashValue key_hash */
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = KeyHashValue_type_id;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "key_hash", MAX_TOPIC_AND_TYPE_LENGTH);
break;
case 1:
/* @optional SerializedKey serialized_key */
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = SerializedKey_type_id;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "serialized_key", MAX_TOPIC_AND_TYPE_LENGTH);
break;
case 2:
/* NtpTime_t last_update_timestamp */
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = 0;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = ntptime_t_type_id;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "last_update_timestamp", MAX_TOPIC_AND_TYPE_LENGTH);
break;
case 3:
/* SequenceNumber_t transition_sequence_number */
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].flags = 0;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_id = element;
_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].type_id = sequencenumber_t_type_id;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_transition_data_dissection_info.elements[element].member_name, "transition_sequence_number", MAX_TOPIC_AND_TYPE_LENGTH);
break;
}
}
/* InstanceStateDataResponse
* struct InstanceStateDataResponse {
* @optional sequence<InstanceTransitionData> alive_instances;
* @optional sequence<InstanceTransitionData> disposed_instances;
* @optional sequence<InstanceTransitionData> unregistered_instances;
* GUID_t writer_guid;
* GUID_t reader_guid;
* uint32 reader_group_oid;
* boolean complete_snapshot;
* };
*/
/* This type mapping is not available in the "registry" map. It is used in the function
* rtps_util_get_topic_info when the endopint GUID determines that the type is InstanceStateDataResponse
*/
_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.type_id = InstanceStateDataResponse_type_id;
_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.guid.entity_id = ENTITYID_NORMAL_META_GROUP_READER;
_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.guid.fields_present = GUID_HAS_ALL;
_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.fields_visited = TOPIC_INFO_ALL_SET;
g_strlcpy(_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.topic_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH);
g_strlcpy(_builtin_types_dissection_data->type_mappings.instance_state_data_response_type_mapping.type_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH);
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.member_name, "InstanceStateDataResponse", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.num_elements = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.bound = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_STRUCTURE_TYPE;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements = wmem_alloc_array(wmem_epan_scope(), dissection_element, INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.base_type_id = 0;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.type_id = InstanceStateDataResponse_type_id;
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info));
/* sequence_100_InstanceTransitionData */
g_strlcpy(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.member_name, "sequence_100_InstanceTransitionData", MAX_TOPIC_AND_TYPE_LENGTH);
_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.num_elements = INSTANCE_STATE_DATA_RESPONSE_NUM_ELEMENTS;
_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.bound = SEQUENCE_100_IINSTANCE_TRANSITION_DATA_BOUND;
_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.member_kind = RTI_CDR_TYPE_OBJECT_TYPE_KIND_SEQUENCE_TYPE;
_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.base_type_id = instancetransitiondata_type_id;
_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.type_id = sequence_100_InstanceTransitionData_type_id;
wmem_map_insert(
builtin_dissection_infos,
&(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info.type_id),
(void*)&(_builtin_types_dissection_data->dissection_infos.alive_instances_dissection_info));
/* @optional sequence<InstanceTransitionData> alive_instances */
for (element = 0; element < _builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.num_elements; ++element) {
switch (element) {
case 0:
/* @optional sequence<InstanceTransitionData> alive_instances */
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "alive_instances", MAX_MEMBER_NAME);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
break;
case 1:
/* @optional sequence<InstanceTransitionData> disposed_instances */
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "disposed_instances", MAX_MEMBER_NAME);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
break;
case 2:
/* @optional sequence<InstanceTransitionData> unregistered_instances */
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = MEMBER_OPTIONAL;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "unregistered_instances", MAX_MEMBER_NAME);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = sequence_100_InstanceTransitionData_type_id;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
break;
case 3:
/* GUID_t writer_guid */
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "writer_gid", MAX_MEMBER_NAME);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = guid_t_type_id;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
break;
case 4:
/* GUID_t reader_guid */
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "reader_gid", MAX_MEMBER_NAME);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = guid_t_type_id;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
break;
case 5:
/* uint32 reader_group_oid */
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "reader_group_oid", MAX_MEMBER_NAME);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_UINT_32_TYPE;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
break;
case 6:
/* boolean complete_snapshot */
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].flags = 0;
g_strlcpy(_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_name, "complete_snapshot", MAX_MEMBER_NAME);
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].type_id = RTI_CDR_TYPE_OBJECT_TYPE_KIND_BOOLEAN_TYPE;
_builtin_types_dissection_data->dissection_infos.instance_state_data_response_dissection_info.elements[element].member_id = element;
break;
}
}
}
void proto_register_rtps(void) {
static hf_register_info hf[] = {
{ &hf_rtps_ping, {
"Ping String",
"rtps.ping_str",
FT_STRING,
BASE_NONE,
NULL,
0,
"RTPS Ping String",
HFILL }
},
{ &hf_rtps_magic, {
"Magic",
"rtps.magic",
FT_STRING,
BASE_NONE,
NULL,
0,
"RTPS magic",
HFILL }
},
/* Protocol Version (composed as major.minor) -------------------------- */
{ &hf_rtps_protocol_version, {
"version",
"rtps.version",
FT_UINT16,
BASE_HEX,
NULL,
0,
"RTPS protocol version number",
HFILL }
},
{ &hf_rtps_protocol_version_major, {
"major",
"rtps.version.major",
FT_INT8,
BASE_DEC,
NULL,
0,
"RTPS major protocol version number",
HFILL }
},
{ &hf_rtps_protocol_version_minor, {
"minor",
"rtps.version.minor",
FT_INT8,
BASE_DEC,
NULL,
0,
"RTPS minor protocol version number",
HFILL }
},
/* Domain Participant and Participant Index ---------------------------- */
{ &hf_rtps_domain_id, {
"domain_id",
"rtps.domain_id",
FT_UINT32,
BASE_DEC,
NULL,
0,
"Domain ID",
HFILL }
},
{ &hf_rtps_domain_tag, {
"domain_tag",
"rtps.domain_tag",
FT_STRINGZ,
BASE_NONE,
NULL,
0,
"Domain Tag ID",
HFILL }
},
{ &hf_rtps_participant_idx, {
"participant_idx",
"rtps.participant_idx",
FT_UINT32,
BASE_DEC,
NULL,
0,
"Participant index",
HFILL }
},
{ &hf_rtps_nature_type, {
"traffic_nature",
"rtps.traffic_nature",
FT_UINT32,
BASE_DEC,
VALS(nature_type_vals),
0,
"Nature of the traffic (meta/user-traffic uni/multi-cast)",
HFILL }
},
/* Vendor ID ----------------------------------------------------------- */
{ &hf_rtps_vendor_id, {
"vendorId",
"rtps.vendorId",
FT_UINT16,
BASE_HEX,
NULL,
0,
"Unique identifier of the DDS vendor that generated this packet",
HFILL }
},
/* Guid Prefix for the Packet ------------------------------------------ */
{ &hf_rtps_guid_prefix_v1,
{ "guidPrefix", "rtps.guidPrefix_v1",
FT_UINT64, BASE_HEX, NULL, 0,
"GuidPrefix of the RTPS packet", HFILL }
},
{ &hf_rtps_guid_prefix,
{ "guidPrefix", "rtps.guidPrefix",
FT_BYTES, BASE_NONE, NULL, 0,
"a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)", HFILL }
},
{ &hf_rtps_guid_prefix_src,
{ "guidPrefix", "rtps.guidPrefix.src",
FT_BYTES, BASE_NONE, NULL, 0,
"the guidPrefix of the entity sending the sample", HFILL }
},
{ &hf_rtps_guid_prefix_dst,
{ "guidPrefix", "rtps.guidPrefix.dst",
FT_BYTES, BASE_NONE, NULL, 0,
"the guidPrefix of the entity receiving the sample", HFILL }
},
/* Host ID ------------------------------------------------------------- */
{ &hf_rtps_host_id, { /* HIDDEN */
"hostId",
"rtps.hostId",
FT_UINT32,
BASE_HEX,
NULL,
0,
"Sub-component 'hostId' of the GuidPrefix of the RTPS packet",
HFILL }
},
/* AppID (composed as instanceId, appKind) ----------------------------- */
{ &hf_rtps_app_id, {
"appId",
"rtps.appId",
FT_UINT32,
BASE_HEX,
NULL,
0,
"Sub-component 'appId' of the GuidPrefix of the RTPS packet",
HFILL }
},
{ &hf_rtps_app_id_instance_id, {
"appId.instanceId",
"rtps.appId.instanceId",
FT_UINT24,
BASE_HEX,
NULL,
0,
"'instanceId' field of the 'AppId' structure",
HFILL }
},
{ &hf_rtps_app_id_app_kind, {
"appid.appKind",
"rtps.appId.appKind",
FT_UINT8,
BASE_HEX,
VALS(app_kind_vals),
0,
"'appKind' field of the 'AppId' structure",
HFILL }
},
/* Submessage ID ------------------------------------------------------- */
{ &hf_rtps_sm_id, {
"submessageId",
"rtps.sm.id",
FT_UINT8,
BASE_HEX,
VALS(submessage_id_vals),
0,
"defines the type of submessage",
HFILL }
},
{ &hf_rtps_sm_idv2, {
"submessageId",
"rtps.sm.id",
FT_UINT8,
BASE_HEX,
VALS(submessage_id_valsv2),
0,
"defines the type of submessage",
HFILL }
},
/* Submessage flags ---------------------------------------------------- */
{ &hf_rtps_sm_flags, {
"Flags",
"rtps.sm.flags",
FT_UINT8,
BASE_HEX,
NULL,
0,
"bitmask representing the flags associated with a submessage",
HFILL }
},
{ &hf_rtps_sm_flags2, {
"Flags",
"rtps.sm.flags",
FT_UINT16,
BASE_HEX,
NULL,
0,
"bitmask representing the flags associated with a submessage",
HFILL }
},
/* octets to next header ---------------------------------------------- */
{ &hf_rtps_sm_octets_to_next_header, {
"octetsToNextHeader",
"rtps.sm.octetsToNextHeader",
FT_UINT16,
BASE_DEC,
NULL,
0,
"Size of the submessage payload",
HFILL }
},
/* GUID as {GuidPrefix, EntityId} ------------------------------------ */
{ &hf_rtps_sm_guid_prefix_v1, {
"guidPrefix",
"rtps.sm.guidPrefix_v1",
FT_UINT64,
BASE_HEX,
NULL,
0,
"a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)",
HFILL }
},
{ &hf_rtps_sm_guid_prefix, {
"guidPrefix",
"rtps.sm.guidPrefix",
FT_BYTES,
BASE_NONE,
NULL,
0,
"a generic guidPrefix that is transmitted inside the submessage (this is NOT the guidPrefix described in the packet header)",
HFILL }
},
{ &hf_rtps_sm_host_id, {
"host_id",
"rtps.sm.guidPrefix.hostId",
FT_UINT32,
BASE_HEX,
NULL,
0,
"The hostId component of the rtps.sm.guidPrefix",
HFILL }
},
{ &hf_rtps_sm_app_id, {
"appId",
"rtps.sm.guidPrefix.appId",
FT_UINT32,
BASE_HEX,
NULL,
0,
"AppId component of the rtps.sm.guidPrefix",
HFILL }
},
{ &hf_rtps_sm_instance_id_v1, {
"instanceId",
"rtps.sm.guidPrefix.appId.instanceId",
FT_UINT24,
BASE_HEX,
NULL,
0,
"instanceId component of the AppId of the rtps.sm.guidPrefix",
HFILL }
},
{ &hf_rtps_sm_app_kind, {
"appKind",
"rtps.sm.guidPrefix.appId.appKind",
FT_UINT8,
BASE_HEX,
NULL,
0,
"appKind component of the AppId of the rtps.sm.guidPrefix",
HFILL }
},
{ &hf_rtps_sm_instance_id, {
"instanceId",
"rtps.sm.guidPrefix.instanceId",
FT_UINT32,
BASE_HEX,
NULL,
0,
"instanceId component of the rtps.sm.guidPrefix",
HFILL }
},
/* Entity ID (composed as entityKey, entityKind) ----------------------- */
{ &hf_rtps_sm_entity_id, {
"entityId",
"rtps.sm.entityId",
FT_UINT32,
BASE_HEX,
VALS(entity_id_vals),
0,
"Object entity ID as it appears in a DATA submessage (keyHashSuffix)",
HFILL }
},
{ &hf_rtps_sm_entity_id_key, {
"entityKey",
"rtps.sm.entityId.entityKey",
FT_UINT24,
BASE_HEX,
NULL,
0,
"'entityKey' field of the object entity ID",
HFILL }
},
{ &hf_rtps_sm_entity_id_kind, {
"entityKind",
"rtps.sm.entityId.entityKind",
FT_UINT8,
BASE_HEX,
VALS(entity_kind_vals),
0,
"'entityKind' field of the object entity ID",
HFILL }
},
{ &hf_rtps_sm_rdentity_id, {
"readerEntityId",
"rtps.sm.rdEntityId",
FT_UINT32,
BASE_HEX,
VALS(entity_id_vals),
0,
"Reader entity ID as it appears in a submessage",
HFILL }
},
{ &hf_rtps_sm_rdentity_id_key, {
"readerEntityKey",
"rtps.sm.rdEntityId.entityKey",
FT_UINT24,
BASE_HEX,
NULL,
0,
"'entityKey' field of the reader entity ID",
HFILL }
},
{ &hf_rtps_sm_rdentity_id_kind, {
"readerEntityKind",
"rtps.sm.rdEntityId.entityKind",
FT_UINT8,
BASE_HEX,
VALS(entity_kind_vals),
0,
"'entityKind' field of the reader entity ID",
HFILL }
},
{ &hf_rtps_sm_wrentity_id, {
"writerEntityId",
"rtps.sm.wrEntityId",
FT_UINT32,
BASE_HEX,
VALS(entity_id_vals),
0,
"Writer entity ID as it appears in a submessage",
HFILL }
},
{ &hf_rtps_sm_wrentity_id_key, {
"writerEntityKey",
"rtps.sm.wrEntityId.entityKey",
FT_UINT24,
BASE_HEX,
NULL,
0,
"'entityKey' field of the writer entity ID",
HFILL }
},
{ &hf_rtps_sm_wrentity_id_kind, {
"writerEntityKind",
"rtps.sm.wrEntityId.entityKind",
FT_UINT8,
BASE_HEX,
VALS(entity_kind_vals),
0,
"'entityKind' field of the writer entity ID",
HFILL }
},
/* Sequence number ----------------------------------------------------- */
{ &hf_rtps_sm_seq_number, {
"writerSeqNumber",
"rtps.sm.seqNumber",
FT_INT64,
BASE_DEC,
NULL,
0,
"Writer sequence number",
HFILL }
},
{ &hf_rtps_info_src_ip, {
"appIpAddress",
"rtps.info_src.ip",
FT_IPv4,
BASE_NONE,
NULL,
0,
NULL,
HFILL }
},
{ &hf_rtps_info_src_unused, {
"Unused",
"rtps.info_src.unused",
FT_UINT32,
BASE_HEX,
NULL,
0,
NULL,
HFILL }
},
/* Parameter Id -------------------------------------------------------- */
{ &hf_rtps_parameter_id, {
"parameterId",
"rtps.param.id",
FT_UINT16,
BASE_HEX,
VALS(parameter_id_vals),
0,
"Parameter Id",
HFILL }
},
{ &hf_rtps_parameter_id_v2, {
"parameterId",
"rtps.param.id",
FT_UINT16,
BASE_HEX,
VALS(parameter_id_v2_vals),
0,
"Parameter Id",
HFILL }
},
{ &hf_rtps_parameter_id_inline_rti, {
"Parameter Id", "rtps.param.id", FT_UINT16,
BASE_HEX, VALS(parameter_id_inline_qos_rti), 0, NULL, HFILL }
},
{ &hf_rtps_parameter_id_toc, {
"parameterId",
"rtps.param.id",
FT_UINT16,
BASE_HEX,
VALS(parameter_id_toc_vals),
0,
"Parameter Id",
HFILL }
},
{ &hf_rtps_parameter_id_rti, {
"parameterId",
"rtps.param.id",
FT_UINT16,
BASE_HEX,
VALS(parameter_id_rti_vals),
0,
"Parameter Id",
HFILL }
},
{ &hf_rtps_parameter_id_adl, {
"parameterId",
"rtps.param.id",
FT_UINT16,
BASE_HEX,
VALS(parameter_id_adl_vals),
0,
"Parameter Id",
HFILL }
},
/* Parameter Length ---------------------------------------------------- */
{ &hf_rtps_parameter_length, {
"parameterLength",
"rtps.param.length",
FT_UINT16,
BASE_DEC,
NULL,
0,
"Parameter Length",
HFILL }
},
/* String Length ---------------------------------------------------- */
{ &hf_rtps_string_length, {
"String length",
"rtps.param.string.length",
FT_UINT32,
BASE_DEC,
NULL,
0,
NULL,
HFILL }
},
/* Parameter / Topic --------------------------------------------------- */
{ &hf_rtps_param_topic_name, {
"topic",
"rtps.param.topicName",
FT_STRINGZ,
BASE_NONE,
NULL,
0,
"String representing the value value of a PID_TOPIC parameter",
HFILL }
},
/* Parameter / Strength ------------------------------------------------ */
{ &hf_rtps_param_strength, {
"strength",
"rtps.param.strength",
FT_INT32,
BASE_DEC,
NULL,
0,
"Decimal value representing the value of a PID_OWNERSHIP_STRENGTH parameter",
HFILL }
},
/* Parameter / Type Name ----------------------------------------------- */
{ &hf_rtps_param_type_name, {
"typeName",
"rtps.param.typeName",
FT_STRINGZ,
BASE_NONE,
NULL,
0,
"String representing the value of a PID_TYPE_NAME parameter",
HFILL }
},
/* Parameter / User Data ----------------------------------------------- */
{ &hf_rtps_param_user_data, {
"userData",
"rtps.param.userData",
FT_BYTES,
BASE_NONE,
NULL,
0,
"The user data sent in a PID_USER_DATA parameter",
HFILL }
},
/* Parameter / Group Data ---------------------------------------------- */
{ &hf_rtps_param_group_data, {
"groupData",
"rtps.param.groupData",
FT_BYTES,
BASE_NONE,
NULL,
0,
"The user data sent in a PID_GROUP_DATA parameter",
HFILL }
},
{ &hf_rtps_transportInfo_classId, {
"classID",
"rtps.transportInfo.classID",
FT_INT32,
BASE_DEC,
NULL,
0,
"Class ID of transport",
HFILL }
},
{ &hf_rtps_transportInfo_messageSizeMax, {
"messageSizeMax",
"rtps.transportInfo.messageSizeMax",
FT_INT32,
BASE_DEC,
NULL,
0,
"Maximum message size of transport",
HFILL }
},
{ &hf_rtps_coherent_set_start, {
"Coherent set start",
"rtps.coherent_set.start",
FT_UINT64,
BASE_DEC,
NULL,
0,
"Start of a coherent set",
HFILL }
},
{ &hf_rtps_coherent_set_end, {
"End of coherent set sequence",
"rtps.coherent_set.end",
FT_UINT64,
BASE_DEC,
NULL,
0,
"End of a coherent set",
HFILL }
},
/* Parameter / Topic Data ---------------------------------------------- */
{ &hf_rtps_param_topic_data, {
"topicData",
"rtps.param.topicData",
FT_BYTES,
BASE_NONE,
NULL,
0,
"The user data sent in a PID_TOPIC_DATA parameter",
HFILL }
},
/* Parameter / Content Filter Name ------------------------------------- */
{ &hf_rtps_param_content_filter_topic_name, {
"contentFilterTopicName",
"rtps.param.contentFilterTopicName",
FT_STRINGZ,
BASE_NONE,
NULL,
0,
"Value of the content filter topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter",
HFILL }
},
{ &hf_rtps_param_related_topic_name, {
"relatedTopicName",
"rtps.param.relatedTopicName",
FT_STRINGZ,
BASE_NONE,
NULL,
0,
"Value of the related topic name as sent in a PID_CONTENT_FILTER_PROPERTY parameter",
HFILL }
},
{ &hf_rtps_param_filter_class_name, {
"filterClassName",
"rtps.param.filterClassName",
FT_STRINGZ,
BASE_NONE,
NULL,
0,
"Value of the filter class name as sent in a PID_CONTENT_FILTER_PROPERTY parameter",
HFILL }
},
{ &hf_rtps_durability_service_cleanup_delay,
{ "Service Cleanup Delay", "rtps.durability.service_cleanup_delay",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_liveliness_lease_duration,
{ "Lease Duration", "rtps.liveliness.lease_duration",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_participant_lease_duration,
{ "Duration", "rtps.participant_lease_duration",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_time_based_filter_minimum_separation,
{ "Minimum Separation", "rtps.time_based_filter.minimum_separation",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_reliability_max_blocking_time,
{ "Max Blocking Time", "rtps.reliability.max_blocking_time",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_deadline_period,
{ "Period", "rtps.deadline_period",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_latency_budget_duration,
{ "Duration", "rtps.latency_budget.duration",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_lifespan_duration,
{ "Duration", "rtps.lifespan",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_persistence,
{ "Persistence", "rtps.persistence",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_info_ts_timestamp,
{ "Timestamp", "rtps.info_ts.timestamp",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_timestamp,
{ "Timestamp", "rtps.timestamp",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_locator_kind,
{ "Kind", "rtps.locator.kind",
FT_UINT32, BASE_HEX, VALS(rtps_locator_kind_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_locator_port,
{ "Port", "rtps.locator.port",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
#if 0
{ &hf_rtps_logical_port,
{ "RTPS Logical Port", "rtps.locator.port",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
#endif
{ &hf_rtps_locator_public_address_port,
{ "Public Address Port", "rtps.locator.public_address_port",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_locator_ipv4,
{ "Address", "rtps.locator.ipv4",
FT_IPv4, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_locator_ipv6,
{ "Address", "rtps.locator.ipv6",
FT_IPv6, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_participant_builtin_endpoints,
{ "BuiltIn Endpoint", "rtps.participant_builtin_endpoints",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_participant_manual_liveliness_count,
{ "Manual Liveliness Count", "rtps.participant_manual_liveliness_count",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_history_depth,
{ "Depth", "rtps.history_depth",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_resource_limit_max_samples,
{ "Max Samples", "rtps.resource_limit.max_samples",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_resource_limit_max_instances,
{ "Max Instances", "rtps.resource_limit.max_instances",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_resource_limit_max_samples_per_instances,
{ "Max Samples Per Instance", "rtps.resource_limit.max_samples_per_instance",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_filter_bitmap,
{ "Filter Bitmap", "rtps.filter_bitmap",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_type_checksum,
{ "Checksum", "rtps.type_checksum",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_queue_size,
{ "queueSize", "rtps.queue_size",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_acknack_count,
{ "Count", "rtps.acknack.count",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_virtual_writer_count,
{ "virtualWriterCount", "rtps.app_ack.virtual_writer_count",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_count,
{ "count", "rtps.app_ack.count",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_conf_virtual_writer_count,
{ "virtualWriterCount", "rtps.app_ack_conf.virtual_writer_count",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_conf_count,
{ "count", "rtps.app_ack_conf.count",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_interval_payload_length,
{ "intervalPayloadLength", "rtps.app_ack.interval_payload_length",
FT_INT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_interval_flags,
{ "intervalFlags", "rtps.app_ack.interval_flags",
FT_INT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_interval_count,
{ "intervalCount", "rtps.app_ack.interval_count",
FT_INT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_ack_octets_to_next_virtual_writer,
{ "octetsToNextVirtualWriter", "rtps.app_ack.octets_to_next_virtual_writer",
FT_INT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_durability_service_history_kind,
{ "History Kind", "rtps.durability_service.history_kind",
FT_UINT32, BASE_HEX, VALS(history_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_durability_service_history_depth,
{ "History Depth", "rtps.durability_service.history_depth",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_durability_service_max_samples,
{ "Max Samples", "rtps.durability_service.max_samples",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_durability_service_max_instances,
{ "Max Instances", "rtps.durability_service.max_instances",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_durability_service_max_samples_per_instances,
{ "Max Samples Per Instance", "rtps.durability_service.max_samples_per_instance",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_liveliness_kind,
{ "Kind", "rtps.liveliness.kind",
FT_UINT32, BASE_HEX, VALS(liveliness_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_manager_key,
{ "Key", "rtps.manager_key",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_locator_udp_v4,
{ "Address", "rtps.locator_udp_v4.ip",
FT_IPv4, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_locator_udp_v4_port,
{ "Port", "rtps.locator_udp_v4.port",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_param_ip_address,
{ "Address", "rtps.param.ip_address",
FT_IPv4, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_port,
{ "Port", "rtps.param.port",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_expects_inline_qos,
{ "Inline QoS", "rtps.expects_inline_qos",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_presentation_coherent_access,
{ "Coherent Access", "rtps.presentation.coherent_access",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_presentation_ordered_access,
{ "Ordered Access", "rtps.presentation.ordered_access",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_direct_communication,
{ "Direct Communication", "rtps.direct_communication",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_expects_ack,
{ "expectsAck", "rtps.expects_ack",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_expects_virtual_heartbeat,
{ "expectsVirtualHB", "rtps.expects_virtual_heartbeat",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_reliability_kind,
{ "Kind", "rtps.reliability_kind",
FT_UINT32, BASE_HEX, VALS(reliability_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_durability,
{ "Durability", "rtps.durability",
FT_UINT32, BASE_HEX, VALS(durability_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_ownership,
{ "Kind", "rtps.ownership",
FT_UINT32, BASE_HEX, VALS(ownership_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_presentation_access_scope,
{ "Access Scope", "rtps.presentation.access_scope",
FT_UINT32, BASE_HEX, VALS(presentation_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_destination_order,
{ "Kind", "rtps.destination_order",
FT_UINT32, BASE_HEX, VALS(destination_order_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_history_kind,
{ "Kind", "rtps.history.kind",
FT_UINT32, BASE_HEX, VALS(history_qos_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_data_status_info,
{ "statusInfo", "rtps.data.status_info",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_serialize_encap_kind,
{ "encapsulation kind", "rtps.param.serialize.encap_kind",
FT_UINT16, BASE_HEX, VALS(encapsulation_id_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_param_serialize_encap_len,
{ "encapsulation options", "rtps.param.serialize.encap_len",
FT_UINT16, BASE_HEX, NULL, 0,
NULL, HFILL }
},
/* Parameter / NtpTime ------------------------------------------------- */
{ &hf_rtps_param_timestamp_sec, {
"seconds", "rtps.param.ntpTime.sec",
FT_INT32, BASE_DEC, NULL, 0,
"The 'second' component of an RTPS time_t",
HFILL }
},
{ &hf_rtps_param_timestamp_fraction, {
"fraction", "rtps.param.ntpTime.fraction",
FT_UINT32, BASE_DEC, NULL, 0,
"The 'fraction' component of an RTPS time_t",
HFILL }
},
{ &hf_rtps_param_transport_priority,
{ "Value", "rtps.param.transport_priority",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_type_max_size_serialized,
{ "Value", "rtps.param.type_max_size_serialized",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_peer_host_epoch,
{ "Peer Host Epoch", "rtps.param.peer_host_epoch",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_endpoint_property_change_epoch,
{ "Endpoint Property Change Epoch", "rtps.param.endpoint_property_change_epoch",
FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_entity_name,
{ "entityName", "rtps.param.entityName",
FT_STRINGZ, BASE_NONE, NULL, 0,
"String representing the name of the entity addressed by the submessage",
HFILL }
},
{ &hf_rtps_param_role_name,
{ "roleName", "rtps.param.roleName",
FT_STRINGZ, BASE_NONE, NULL, 0,
"String representing the role name of the entity addressed by the submessage",
HFILL }
},
{ &hf_rtps_disable_positive_ack,
{ "disablePositiveAcks", "rtps.disable_positive_ack",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_participant_guid_v1,
{ "Participant GUID", "rtps.param.participant_guid_v1",
FT_UINT64, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_participant_guid,
{ "Participant GUID", "rtps.param.participant_guid",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_group_guid_v1,
{ "Group GUID", "rtps.param.group_guid_v1",
FT_UINT64, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_group_guid,
{ "Group GUID", "rtps.param.group_guid",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_endpoint_guid,
{ "Endpoint GUID", "rtps.param.endpoint_guid",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_host_id,
{ "hostId", "rtps.param.guid.hostId",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_id,
{ "appId", "rtps.param.guid.appId",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_instance_id_v1,
{ "instanceId", "rtps.param.guid.instanceId",
FT_UINT24, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_instance_id,
{ "instanceId", "rtps.param.guid.instanceId",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_app_kind,
{ "instanceId", "rtps.param.guid.appKind",
FT_UINT8, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_entity,
{ "entityId", "rtps.param.guid.entityId",
FT_UINT32, BASE_HEX, VALS(entity_id_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_param_entity_key,
{ "entityKey", "rtps.param.guid.entityKey",
FT_UINT24, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_entity_kind,
{ "entityKind", "rtps.param.guid.entityKind",
FT_UINT8, BASE_HEX, VALS(entity_kind_vals), 0,
NULL, HFILL }
},
{ &hf_rtps_param_extended_pid_length,
{ "Extended Length", "rtps.param.extended_pid_length",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_extended_parameter,
{ "Extended Parameter", "rtps.param.extended_parameter",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_frag_number,
{ "fragmentStartingNum", "rtps.data_frag.number",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_frag_sample_size,
{ "sampleSize", "rtps.data_frag.sample_size",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_frag_num_fragments,
{ "fragmentsInSubmessage", "rtps.data_frag.num_fragments",
FT_UINT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_frag_size,
{ "fragmentSize", "rtps.data_frag.size",
FT_UINT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_nokey_data_frag_number,
{ "fragmentStartingNum", "rtps.nokey_data_frag.number",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_nokey_data_frag_num_fragments,
{ "fragmentsInSubmessage", "rtps.nokey_data_frag.num_fragments",
FT_UINT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_nokey_data_frag_size,
{ "fragmentSize", "rtps.nokey_data_frag.size",
FT_UINT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_nack_frag_count,
{ "Count", "rtps.nack_frag.count",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_heartbeat_frag_number,
{ "lastFragmentNum", "rtps.heartbeat_frag.number",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_heartbeat_frag_count,
{ "Count", "rtps.heartbeat_frag.count",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_heartbeat_batch_count,
{ "Count", "rtps.heartbeat_batch.count",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_virtual_heartbeat_count,
{ "Count", "rtps.virtual_heartbeat.count",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_virtual_heartbeat_num_virtual_guids,
{ "numVirtualGUIDs", "rtps.virtual_heartbeat.num_virtual_guids",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_virtual_heartbeat_num_writers,
{ "numWriters", "rtps.virtual_heartbeat.num_writers",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_serialize_data, {
"serializedData", "rtps.data.serialize_data",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_parameter_data, {
"parameterData", "rtps.parameter_data",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_batch_timestamp,
{ "Timestamp", "rtps.data_batch.timestamp",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_UTC, NULL, 0,
"Time using the RTPS time_t standard format", HFILL }
},
{ &hf_rtps_data_batch_offset_to_last_sample_sn,
{ "offsetToLastSampleSN", "rtps.data_batch.offset_to_last_sample_sn",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_batch_sample_count,
{ "batchSampleCount", "rtps.data_batch.sample_count",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_batch_offset_sn,
{ "offsetSN", "rtps.data_batch.offset_sn",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_batch_octets_to_sl_encap_id,
{ "octetsToSLEncapsulationId", "rtps.data_batch.octets_to_sl_encap_id",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_batch_serialized_data_length,
{ "serializedDataLength", "rtps.data_batch.serialized_data_length",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_data_batch_octets_to_inline_qos,
{ "octetsToInlineQos", "rtps.data_batch.octets_to_inline_qos",
FT_UINT16, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_fragment_number_base64,
{ "bitmapBase", "rtps.fragment_number.base64",
FT_UINT64, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_fragment_number_base,
{ "bitmapBase", "rtps.fragment_number.base32",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_fragment_number_num_bits,
{ "numBits", "rtps.fragment_number.num_bits",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_bitmap_num_bits,
{ "numBits", "rtps.bitmap.num_bits",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_acknack_analysis,
{ "Acknack Analysis", "rtps.sm.acknack_analysis",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_partition_num,
{ "Number of partition names", "rtps.param.partition_num",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_expression_parameters_num,
{ "Number of expression params", "rtps.param.expression_parameters_num",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_partition,
{ "name", "rtps.param.partition",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_filter_expression,
{ "filterExpression", "rtps.param.filter_expression",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_param_expression_parameters,
{ "expressionParameters", "rtps.param.expression_parameters",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_locator_filter_list_num_channels,
{ "numberOfChannels", "rtps.param.locator_filter_list.num_channels",
FT_INT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_locator_filter_list_filter_name,
{ "filterName", "rtps.param.locator_filter_list.filter_name",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_locator_filter_list_filter_exp,
{ "filterExpression", "rtps.param.locator_filter_list.filter_exp",
FT_STRING, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_extra_flags,
{ "Extra flags", "rtps.extra_flags",
FT_UINT16, BASE_HEX, NULL, 0xFFFF,
NULL, HFILL }
},
{ &hf_rtps_param_builtin_endpoint_set_flags,
{ "Flags", "rtps.param.builtin_endpoint_set",
FT_UINT32, BASE_HEX, NULL, 0,
"bitmask representing the flags in PID_BUILTIN_ENDPOINT_SET",
HFILL }
},
{ &hf_rtps_param_vendor_builtin_endpoint_set_flags,
{ "Flags", "rtps.param.vendor_builtin_endpoint_set",
FT_UINT32, BASE_HEX, NULL, 0,
"bitmask representing the flags in PID_VENDOR_BUILTIN_ENDPOINT_SET",
HFILL }
},
{ &hf_rtps_param_endpoint_security_attributes,
{ "Flags", "rtps.param.endpoint_security_attributes",
FT_UINT32, BASE_HEX, NULL, 0,
"bitmask representing the flags in PID_ENDPOINT_SECURITY_ATTRIBUTES",
HFILL }
},
{ &hf_rtps_param_plugin_promiscuity_kind, {
"promiscuityKind", "rtps.param.plugin_promiscuity_kind",
FT_UINT32, BASE_HEX, VALS(plugin_promiscuity_kind_vals), 0, NULL, HFILL }
},
{ &hf_rtps_param_service_kind, {
"serviceKind", "rtps.param.service_kind",
FT_UINT32, BASE_HEX, VALS(service_kind_vals), 0, NULL, HFILL }
},
{ &hf_rtps_param_data_representation,{
"Data Representation Kind", "rtps.param.data_representation",
FT_UINT16, BASE_DEC, VALS(data_representation_kind_vals), 0, NULL, HFILL }
},
{ &hf_rtps_param_type_consistency_kind, {
"Type Consistency Kind", "rtps.param.type_consistency_kind",
FT_UINT16, BASE_HEX, VALS(type_consistency_kind_vals), 0, NULL, HFILL }
},
{ &hf_rtps_param_ignore_sequence_bounds, {
"Ignore Sequence Bounds", "rtps.param.ignore_sequence_bounds",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_ignore_string_bounds, {
"Ignore String Bounds", "rtps.param.ignore_string_bounds",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_ignore_member_names, {
"Ignore Member Names", "rtps.param.ignore_member_names",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_prevent_type_widening, {
"Prevent Type Widening", "rtps.param.prevent_type_widening",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_force_type_validation, {
"Force Type Validation", "rtps.param.force_type_validation",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_ignore_enum_literal_names, {
"Ignore Enum Literal Names", "rtps.param.ignore_enum_literal_names",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_acknowledgment_kind, {
"Acknowledgment Kind", "rtps.param.acknowledgment_kind",
FT_UINT32, BASE_HEX, VALS(acknowledgement_kind_vals), 0, NULL, HFILL }
},
/* Finally the raw issue data ------------------------------------------ */
{ &hf_rtps_issue_data, {
"serializedData", "rtps.issueData",
FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a ISSUE submessage", HFILL }
},
{ &hf_rtps_param_product_version_major, {
"Major", "rtps.param.product_version.major",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_product_version_minor, {
"Minor", "rtps.param.product_version.minor",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_product_version_release, {
"Release", "rtps.param.product_version.release",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_product_version_release_as_char, {
"Release", "rtps.param.product_version.release_string",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_product_version_revision, {
"Revision", "rtps.param.product_version.revision",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_encapsulation_id, {
"encapsulation id", "rtps.encapsulation_id",
FT_UINT16, BASE_HEX, VALS(encapsulation_id_vals), 0, NULL, HFILL }
},
{ &hf_rtps_encapsulation_kind, {
"kind", "rtps.encapsulation_kind",
FT_UINT32, BASE_HEX, VALS(participant_message_data_kind), 0, NULL, HFILL }
},
{ &hf_rtps_octets_to_inline_qos, {
"Octets to inline QoS", "rtps.octets_to_inline_qos",
FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_filter_signature, {
"filterSignature", "rtps.filter_signature",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_bitmap, {
"bitmap", "rtps.bitmap",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_property_name, {
"Property Name", "rtps.property_name",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_property_value, {
"Value", "rtps.property_value",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_union, {
"union", "rtps.union",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_union_case, {
"case", "rtps.union_case",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_struct, {
"struct", "rtps.struct",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_member_name, {
"member_name", "rtps.member_name",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_sequence, {
"sequence", "rtps.sequence",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_array, {
"array", "rtps.array",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_bitfield, {
"bitfield", "rtps.bitfield",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_datatype, {
"datatype", "rtps.datatype",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_sequence_size, {
"sequenceSize", "rtps.sequence_size",
FT_UINT32, BASE_DEC|BASE_UNIT_STRING, UNS(&units_octet_octets), 0, NULL, HFILL }
},
{ &hf_rtps_guid, {
"guid", "rtps.guid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_heartbeat_count, {
"count", "rtps.heartbeat_count",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_encapsulation_options, {
"Encapsulation options", "rtps.encapsulation_options",
FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_serialized_key, {
"serializedKey", "rtps.serialized_key",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_serialized_data, {
"serializedData", "rtps.serialized_data",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_sm_rti_crc_number, {
"RTPS Message Length", "rtps.sm.rti_crc.message_length",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_sm_rti_crc_result, {
"CRC", "rtps.sm.rti_crc",
FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_message_length, {
"RTPS Message Length", "rtps.message_length",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
/* Flag bits */
{ &hf_rtps_flag_reserved80, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }
},
{ &hf_rtps_flag_reserved40, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x40, NULL, HFILL }
},
{ &hf_rtps_flag_reserved20, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20, NULL, HFILL }
},
{ &hf_rtps_flag_reserved10, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL }
},
{ &hf_rtps_flag_reserved08, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
},
{ &hf_rtps_flag_reserved04, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_reserved02, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_reserved8000, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x8000, NULL, HFILL }
},
{ &hf_rtps_flag_reserved4000, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x4000, NULL, HFILL }
},
{ &hf_rtps_flag_reserved2000, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x2000, NULL, HFILL }
},
{ &hf_rtps_flag_reserved1000, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x1000, NULL, HFILL }
},
{ &hf_rtps_flag_reserved0800, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0800, NULL, HFILL }
},
{ &hf_rtps_flag_reserved0400, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0400, NULL, HFILL }
},
{ &hf_rtps_flag_reserved0200, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0200, NULL, HFILL }
},
{ &hf_rtps_flag_reserved0100, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0100, NULL, HFILL }
},
{ &hf_rtps_flag_reserved0080, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0080, NULL, HFILL }
},
{ &hf_rtps_flag_reserved0040, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0040, NULL, HFILL }
},
{ &hf_rtps_flag_builtin_endpoint_set_reserved, {
"Reserved", "rtps.flag.reserved",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x0000F000, NULL, HFILL }
},
{ &hf_rtps_flag_unregister, {
"Unregister flag", "rtps.flag.unregister",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x20, NULL, HFILL }
},
{ &hf_rtps_flag_inline_qos_v1, {
"Inline QoS", "rtps.flag.inline_qos",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL }
},
{ &hf_rtps_flag_hash_key, {
"Hash key flag", "rtps.flag.hash_key",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
},
{ &hf_rtps_flag_hash_key_rti, {
"Hash key flag", "rtps.flag.hash_key",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_alive, {
"Alive flag", "rtps.flag.alive",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_data_present_v1, {
"Data present", "rtps.flag.data_present",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_multisubmessage, {
"Multi-submessage", "rtps.flag.multisubmessage",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_endianness, {
"Endianness", "rtps.flag.endianness",
FT_BOOLEAN, 8, TFS(&tfs_little_big_endianness), 0x01, NULL, HFILL }
},
{ &hf_rtps_flag_additional_authenticated_data, {
"Additional Authenticated Data", "rtps.flag.additional_authenticated_data",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_protected_with_psk, {
"Message protected with PSK", "rtps.flag.message_protected_with_psk",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_vendor_specific_content, {
"Vendor-Specific Content", "rtps.flag.vendor_specific_content",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x80, NULL, HFILL }
},
{ &hf_rtps_flag_inline_qos_v2, {
"Inline QoS", "rtps.flag.inline_qos",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_data_present_v2, {
"Data present", "rtps.flag.data_present",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_status_info, {
"Status info flag", "rtps.flag.status_info",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x10, NULL, HFILL }
},
{ &hf_rtps_flag_final, {
"Final flag", "rtps.flag.final",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_liveliness, {
"Liveliness flag", "rtps.flag.liveliness",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_multicast, {
"Multicast flag", "rtps.flag.multicast",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_data_serialized_key, {
"Serialized Key", "rtps.flag.data.serialized_key",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
},
{ &hf_rtps_flag_data_frag_serialized_key, {
"Serialized Key", "rtps.flag.data_frag.serialized_key",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_timestamp, {
"Timestamp flag", "rtps.flag.timestamp",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_no_virtual_guids, {
"No virtual GUIDs flag", "rtps.flag.no_virtual_guids",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
},
{ &hf_rtps_flag_multiple_writers, {
"Multiple writers flag", "rtps.flag.multiple_writers",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_multiple_virtual_guids, {
"Multiple virtual GUIDs flag", "rtps.flag.multiple_virtual_guids",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_serialize_key16, {
"Serialized Key", "rtps.flag.serialize_key",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0020, NULL, HFILL }
},
{ &hf_rtps_flag_invalid_sample, {
"Invalid sample", "rtps.flag.invalid_sample",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0010, NULL, HFILL }
},
{ &hf_rtps_flag_data_present16, {
"Data present", "rtps.flag.data_present",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0008, NULL, HFILL }
},
{ &hf_rtps_flag_offsetsn_present, {
"OffsetSN present", "rtps.flag.offsetsn_present",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL }
},
{ &hf_rtps_flag_inline_qos16_v2, {
"Inline QoS", "rtps.flag.inline_qos",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL }
},
{ &hf_rtps_flag_timestamp_present, {
"Timestamp present", "rtps.flag.timestamp_present",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL }
},
{ &hf_rtps_param_status_info_flags,
{ "Flags", "rtps.param.status_info",
FT_UINT32, BASE_HEX, NULL, 0, "bitmask representing the flags in PID_STATUS_INFO", HFILL }
},
{ &hf_rtps_header_extension_flags,
{ "Flags", "rtps.header_extension_flags",
FT_UINT8, BASE_HEX, NULL, 0, "bitmask representing header extension flags", HFILL }
},
{ &hf_rtps_flag_header_extension_parameters, {
"Header Extension Parameter List Present", "rtps.flag.header_extension.parameter_list",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_PARAMETERS_FLAG, NULL, HFILL }
},
{ &hf_rtps_flag_header_extension_checksum2, {
"Header Extension Message Checksum 2", "rtps.flag.header_extension.message_checksum2",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_CHECKSUM_2_FLAG, NULL, HFILL }
},
{ &hf_rtps_flag_header_extension_checksum1, {
"Header Extension Message Checksum 1", "rtps.flag.header_extension.message_checksum1",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_CHECKSUM_1_FLAG, NULL, HFILL }
},
{ &hf_rtps_flag_header_extension_wextension, {
"Header Extension W Extension Present", "rtps.flag.header_extension.wextension",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_WEXTENSION_FLAG, NULL, HFILL }
},
{ &hf_rtps_flag_header_extension_uextension, {
"Header Extension U Extension Present", "rtps.flag.header_extension.uextension",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_UEXTENSION_FLAG, NULL, HFILL }
},
{ &hf_rtps_flag_header_extension_timestamp, {
"Header Extension Timestamp Present", "rtps.flag.header_extension.timestamp",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_TIMESTAMP_FLAG, NULL, HFILL }
},
{ &hf_rtps_flag_header_extension_message_length, {
"Header Extension Message Length", "rtps.flag.header_extension.message_length",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), RTPS_HE_MESSAGE_LENGTH_FLAG, NULL, HFILL }
},
{ &hf_rtps_header_extension_checksum_crc32c, {
"Header Extension Checksum CRC-32C", "rtps.header_extension.checksum_crc32c",
FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_header_extension_checksum_crc64, {
"Header Extension Checksum CRC64", "rtps.header_extension.checksum_crc64",
FT_UINT64, BASE_HEX, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_header_extension_checksum_md5, {
"Header Extension Checksum MD5", "rtps.header_extension.checksum_md5",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_uextension, {
"Header Extension uExtension", "rtps.uextension",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_wextension, {
"Header Extension wExtension", "rtps.wextension",
FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_flag_unregistered, {
"Unregistered", "rtps.flag.unregistered",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_disposed, {
"Disposed", "rtps.flag.undisposed",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL }
},
{ &hf_rtps_flag_participant_announcer, {
"Participant Announcer", "rtps.flag.participant_announcer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
},
{ &hf_rtps_flag_participant_detector, {
"Participant Detector", "rtps.flag.participant_detector",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
},
{ &hf_rtps_flag_publication_announcer, {
"Publication Announcer", "rtps.flag.publication_announcer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
},
{ &hf_rtps_flag_publication_detector, {
"Publication Detector", "rtps.flag.publication_detector",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
},
{ &hf_rtps_flag_subscription_announcer, {
"Subscription Announcer", "rtps.flag.subscription_announcer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
},
{ &hf_rtps_flag_subscription_detector, {
"Subscription Detector", "rtps.flag.subscription_detector",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
},
{ &hf_rtps_flag_participant_proxy_announcer, {
"Participant Proxy Announcer", "rtps.flag.participant_proxy_announcer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
},
{ &hf_rtps_flag_participant_proxy_detector, {
"Participant Proxy Detector", "rtps.flag.participant_proxy_detector",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000080, NULL, HFILL }
},
{ &hf_rtps_flag_participant_state_announcer, {
"Participant State Announcer", "rtps.flag.participant_state_announcer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000100, NULL, HFILL }
},
{ &hf_rtps_flag_participant_state_detector, {
"Participant State Detector", "rtps.flag.participant_state_detector",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000200, NULL, HFILL }
},
{ &hf_rtps_flag_participant_message_datawriter, {
"Participant Message DataWriter", "rtps.flag.participant_message_datawriter",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000400, NULL, HFILL }
},
{ &hf_rtps_flag_participant_message_datareader, {
"Participant Message DataReader", "rtps.flag.participant_message_datareader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000800, NULL, HFILL }
},
{ &hf_rtps_flag_secure_publication_writer, {
"Secure Publication Writer", "rtps.flag.secure_publication_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00010000, NULL, HFILL }
},
{ &hf_rtps_flag_secure_publication_reader, {
"Secure Publication Reader", "rtps.flag.secure_publication_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00020000, NULL, HFILL }
},
{ &hf_rtps_flag_secure_subscription_writer, {
"Secure Subscription Writer", "rtps.flag.secure_subscription_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00040000, NULL, HFILL }
},
{ &hf_rtps_flag_secure_subscription_reader, {
"Secure Subscription Reader", "rtps.flag.secure_subscription_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00080000, NULL, HFILL }
},
{ &hf_rtps_flag_secure_participant_message_writer, {
"Secure Participant Message Writer", "rtps.flag.secure_participant_message_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00100000, NULL, HFILL }
},
{ &hf_rtps_flag_secure_participant_message_reader, {
"Secure Participant Message Reader", "rtps.flag.secure_participant_message_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00200000, NULL, HFILL }
},
{ &hf_rtps_flag_participant_stateless_message_writer, {
"Participant Stateless Message Writer", "rtps.flag.participant_stateless_message_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00400000, NULL, HFILL }
},
{ &hf_rtps_flag_participant_stateless_message_reader, {
"Participant Stateless Message Reader", "rtps.flag.participant_stateless_message_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00800000, NULL, HFILL }
},
{ &hf_rtps_flag_secure_participant_volatile_message_writer,{
"Secure Participant Volatile Message Writer", "rtps.flag.secure_participant_volatile_message_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x01000000, NULL, HFILL }
},
{ &hf_rtps_flag_secure_participant_volatile_message_reader,{
"Secure Participant Volatile Message Reader", "rtps.flag.secure_participant_volatile_message_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x02000000, NULL, HFILL }
},
{ &hf_rtps_flag_participant_secure_writer,{
"Participant Secure Writer", "rtps.flag.participant_secure_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x04000000, NULL, HFILL }
},
{ &hf_rtps_flag_participant_secure_reader,{
"Participant Secure Reader", "rtps.flag.participant_secure_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x08000000, NULL, HFILL }
},
{ &hf_rtps_type_object_type_id_disc,
{ "TypeId (_d)", "rtps.type_object.type_id.discr",
FT_INT16, BASE_DEC, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_primitive_type_id,
{ "Type Id", "rtps.type_object.primitive_type_id",
FT_UINT16, BASE_HEX, VALS(type_object_kind), 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_base_primitive_type_id,
{ "Base Id", "rtps.type_object.base_primitive_type_id",
FT_UINT16, BASE_HEX, VALS(type_object_kind), 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_type_id,
{ "Type Id", "rtps.type_object.type_id",
FT_UINT64, BASE_HEX, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_base_type,
{ "Base Type Id", "rtps.type_object.base_type_id",
FT_UINT64, BASE_HEX, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_element_raw, {
"Type Element Content", "rtps.type_object.element",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_type_property_name,
{ "Name", "rtps.type_object.property.name",
FT_STRING, BASE_NONE, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_member_id,
{ "Member Id", "rtps.type_object.annotation.member_id",
FT_UINT32, BASE_DEC, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_name,
{ "Name", "rtps.type_object.member.name",
FT_STRING, BASE_NONE, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_annotation_value_d,
{ "Annotation Member (_d)", "rtps.type_object.annotation.value_d",
FT_UINT16, BASE_DEC, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_annotation_value_16,
{ "16 bits type", "rtps.type_object.annotation.value",
FT_UINT16, BASE_DEC, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_union_label,
{ "Label", "rtps.type_object.union.label",
FT_UINT32, BASE_DEC, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_bound,
{ "Bound", "rtps.type_object.bound",
FT_UINT32, BASE_DEC, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_enum_constant_name,
{ "Enum name", "rtps.type_object.enum.name",
FT_STRING, BASE_NONE, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_enum_constant_value,
{ "Enum value", "rtps.type_object.enum.value",
FT_INT32, BASE_DEC, 0x0, 0,
NULL, HFILL }
},
{ &hf_rtps_type_object_element_shared,
{ "Element shared", "rtps.type_object.shared",
FT_BOOLEAN, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_flag_typeflag_final, {
"FINAL", "rtps.flag.typeflags.final",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL }
},
{ &hf_rtps_flag_typeflag_mutable, {
"MUTABLE", "rtps.flag.typeflags.mutable",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL }
},
{ &hf_rtps_flag_typeflag_nested, {
"NESTED", "rtps.flag.typeflags.nested",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL }
},
{ &hf_rtps_type_object_flags, {
"Flags", "rtps.flag.typeflags",
FT_UINT16, BASE_HEX, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_flag_memberflag_key, {
"Key", "rtps.flag.typeflags.key",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0001, NULL, HFILL }
},
{ &hf_rtps_flag_memberflag_optional, {
"Optional", "rtps.flag.typeflags.optional",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0002, NULL, HFILL }
},
{ &hf_rtps_flag_memberflag_shareable, {
"Shareable", "rtps.flag.typeflags.shareable",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0004, NULL, HFILL }
},
{ &hf_rtps_flag_memberflag_union_default, {
"Union default", "rtps.flag.typeflags.union_default",
FT_BOOLEAN, 16, TFS(&tfs_set_notset), 0x0008, NULL, HFILL }
},
{ &hf_rtps_type_object_element_module_name,
{ "Module name", "rtps.type_object.module_name",
FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_flag_service_request_writer, {
"Service Request Writer", "rtps.flag.service_request_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
},
{ &hf_rtps_flag_service_request_reader, {
"Service Request Reader", "rtps.flag.service_request_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
},
{ &hf_rtps_flag_locator_ping_writer, {
"Locator Ping Writer", "rtps.flag.locator_ping_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
},
{ &hf_rtps_flag_locator_ping_reader, {
"Locator Ping Reader", "rtps.flag.locator_ping_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
},
{ &hf_rtps_flag_secure_service_request_writer, {
"Secure Service Request Writer", "rtps.flag.secure_service_request_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
},
{ &hf_rtps_flag_secure_service_request_reader, {
"Secure Service Request Reader", "rtps.flag.secure_service_request_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
},
{ &hf_rtps_flag_security_access_protected, {
"Access Protected", "rtps.flag.security.access_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
},
{ &hf_rtps_flag_security_discovery_protected, {
"Discovery Protected", "rtps.flag.security.discovery_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
},
{ &hf_rtps_flag_security_submessage_protected, {
"Submessage Protected", "rtps.flag.security.submessage_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
},
{ &hf_rtps_flag_security_payload_protected, {
"Payload Protected", "rtps.flag.security.payload_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_read_protected,{
"Read Protected", "rtps.flag.security.info.read_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_write_protected,{
"Write Protected", "rtps.flag.security.info.write_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_discovery_protected,{
"Discovery Protected", "rtps.flag.security.info.discovery_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_submessage_protected,{
"Submessage Protected", "rtps.flag.security.info.submessage_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_payload_protected,{
"Payload Protected", "rtps.flag.security.info.payload_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_key_protected,{
"Key Protected", "rtps.flag.security.info.key_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_liveliness_protected,{
"Liveliness Protected", "rtps.flag.security.info.liveliness_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
},
{ &hf_rtps_flag_endpoint_security_attribute_flag_is_valid,{
"Mask Valid", "rtps.flag.security.info.valid",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
},
{ &hf_rtps_param_endpoint_security_attributes_mask,{
"EndpointSecurityAttributesMask", "rtps.param.endpoint_security_attributes",
FT_UINT32, BASE_HEX, NULL, 0,
"Bitmask representing the EndpointSecurityAttributes flags in PID_ENDPOINT_SECURITY_INFO",
HFILL }
},
{ &hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_required_mask, {
"Builtin Endpoints Required Mask", "rtps.param.participant_security_symmetric_cipher_algorithms.builtin_endpoints_used_bit",
FT_UINT32, BASE_HEX, NULL, 0,
"Bitmask representing the Symmetric Cipher algorithm the builtin endpoints use",
HFILL }
},
{ &hf_rtps_param_participant_security_symmetric_cipher_algorithms_builtin_endpoints_key_exchange_used_bit, {
"Key Exchange Builtin Endpoints Required Mask", "rtps.param.participant_security_symmetric_cipher_algorithms.builtin_endpoints_key_exchange_required_mask",
FT_UINT32, BASE_HEX, NULL, 0,
"Bitmask representing the Symmetric Cipher algorithm the key exchange builtin endpoints require",
HFILL }
},
{ &hf_rtps_param_participant_security_symmetric_cipher_algorithms_supported_mask, {
"Supported Mask", "rtps.param.security_symmetric_cipher_algorithms.supported_mask",
FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing supported Symmetric Cipher algorithms",
HFILL }
},
{ &hf_rtps_param_compression_id_mask, {
"Compression Id Mask", "rtps.param.compression_id_mask",
FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing compression id.", HFILL }
},
{ &hf_rtps_flag_compression_id_zlib, {
"ZLIB", "rtps.flag.compression_id_zlib",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_ZLIB, NULL, HFILL }
},
{ &hf_rtps_flag_compression_id_bzip2, {
"BZIP2", "rtps.flag.compression_id_bzip2",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_BZIP2, NULL, HFILL }
},
{ &hf_rtps_flag_compression_id_lz4, {
"LZ4", "rtps.flag.compression_id_lz4",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), RTI_OSAPI_COMPRESSION_CLASS_ID_LZ4, NULL, HFILL }
},
{ &hf_rtps_flag_security_symmetric_cipher_mask_aes128_gcm, {
"AES128 GCM", "rtps.flag.security_symmetric_cipher_mask.aes128_gcm",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_AES128_GCM, NULL, HFILL }
},
{ &hf_rtps_flag_security_symmetric_cipher_mask_aes256_gcm, {
"AES256 GCM", "rtps.flag.security_symmetric_cipher_mask.aes256_gcm",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_AES256_GCM, NULL, HFILL }
},
{ &hf_rtps_flag_security_symmetric_cipher_mask_custom_algorithm, {
"Custom Algorithm", "rtps.flag.security_symmetric_cipher_mask.custom_algorithm",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_SYMMETRIC_CIPHER_BIT_CUSTOM_ALGORITHM, NULL, HFILL }
},
{ &hf_rtps_flag_security_key_establishment_mask_dhe_modp2048256, {
"DHE_MODP2048256", "rtps.flag.security_key_establishment_mask.dhe_modp2048256",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_DHE_MODP2048256, NULL, HFILL }
},
{ &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p256, {
"ECDHECEUM_P256", "rtps.flag.security_key_establishment_mask.ecdheceum_p256",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P256, NULL, HFILL }
},
{ &hf_rtps_flag_security_key_establishment_mask_ecdheceum_p384, {
"ECDHECEUM_P384", "rtps.flag.security_key_establishment_mask.ecdheceum_p384",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_ECDHECEUM_P384, NULL, HFILL }
},
{ &hf_rtps_flag_security_key_establishment_mask_custom_algorithm, {
"Custom Algorithm", "rtps.flag.security_key_establishment_mask.custom_algorithm",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_KEY_ESTABLISHMENT_BIT_CUSTOM_ALGORITHM, NULL, HFILL }
},
{ &hf_rtps_flag_security_algorithm_compatibility_mode, {
"Compatibility Mode", "rtps.flag.security_algorithm_compatibility_mode",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_ALGORITHM_BIT_COMPATIBILITY_MODE, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_payload_encrypted, {
"Submessage Encrypted", "rtps.flag.security.info.plugin_submessage_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
},
{ &hf_rtps_param_crypto_algorithm_requirements_trust_chain, {
"Supported", "rtps.param.crypto_algorithm_requirements.supported",
FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing the trust chain", HFILL }
},
{ &hf_rtps_param_crypto_algorithm_requirements_message_auth, {
"Required", "rtps.param.crypto_algorithm_requirements.required",
FT_UINT32, BASE_HEX, 0, 0, "Bitmask representing the message authentication", HFILL }
},
{ &hf_rtps_flag_security_digital_signature_mask_rsassapssmgf1sha256_2048_sha256, {
"RSASSAPSSMGF1SHA256_2048_SHA256", "rtps.flag.security_digital_signature_mask.rsassapssmgf1sha256_2048_sha256",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPSSMGF1SHA256_2048_SHA256, NULL, HFILL }
},
{ &hf_rtps_flag_security_digital_signature_mask_rsassapkcs1v15_2048_sha256, {
"RSASSAPKCS1V15_2048_SHA256", "rtps.flag.security_digital_signature_mask.rsassapkcs1v15_2048_sha256",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_RSASSAPKCS1V15_2048_SHA256, NULL, HFILL }
},
{ &hf_rtps_flag_security_digital_signature_mask_ecdsa_p256_sha256, {
"ECDSA_P256_SHA256", "rtps.flag.security_digital_signature_mask.ecdsa_p256_sha256",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P256_SHA256, NULL, HFILL }
},
{ &hf_rtps_flag_security_digital_signature_mask_ecdsa_p384_sha384, {
"ECDSA_P384_SHA384", "rtps.flag.security_digital_signature_mask.ecdsa_p384_sha384",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_ECDSA_P384_SHA384, NULL, HFILL }
},
{ &hf_rtps_flag_security_digital_signature_mask_custom_algorithm, {
"Custom Algorithm", "rtps.flag.security_digital_signature_mask.custom_algorithm",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), SECURITY_DIGITAL_SIGNATURE_BIT_CUSTOM_ALGORITHM, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_key_encrypted,{
"Payload Encrypted", "rtps.flag.security.info.plugin_payload_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_liveliness_encrypted,{
"Submessage Origin Encrypted", "rtps.flag.security.info.plugin_liveliness_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_endpoint_security_attribute_flag_is_valid,{
"Mask Valid", "rtps.flag.security.info.plugin_valid",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
},
{ &hf_rtps_param_plugin_endpoint_security_attributes_mask,{
"PluginEndpointSecurityAttributesMask (valid dissection if using the Specification Builtin Plugins)",
"rtps.param.plugin_endpoint_security_attributes",
FT_UINT32, BASE_HEX, NULL, 0,
"bitmask representing the PluginEndpointSecurityAttributes flags in PID_ENDPOINT_SECURITY_INFO",
HFILL }
},
{ &hf_rtps_flag_participant_security_attribute_flag_is_rtps_protected,{
"RTPS Protected", "rtps.flag.security.info.participant_rtps_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
},
{ &hf_rtps_flag_participant_security_attribute_flag_is_discovery_protected,{
"Discovery Protected", "rtps.flag.security.info.participant_discovery_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
},
{ &hf_rtps_flag_participant_security_attribute_flag_is_liveliness_protected,{
"Liveliness Protected", "rtps.flag.security.info.participant_liveliness_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
},
{ &hf_rtps_flag_participant_security_attribute_flag_key_revisions_enabled,{
"Key Revisions Enabled", "rtps.flag.security.info.key_revisions_enabled",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
},
{ &hf_rtps_flag_participant_security_attribute_flag_key_psk_protected,{
"RTPS Pre-Shared Key Protected", "rtps.flag.security.info.participant_psk_protected",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
},
{ &hf_rtps_flag_participant_security_attribute_flag_is_valid,{
"Mask Valid", "rtps.flag.security.info.participant_mask_valid",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
},
{ &hf_rtps_param_participant_security_attributes_mask,{
"ParticipantSecurityAttributesMask",
"rtps.param.participant_security_attributes",
FT_UINT32, BASE_HEX, NULL, 0,
"bitmask representing the ParticipantSecurityAttributes flags in PID_PARTICIPANT_SECURITY_INFO",
HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_encrypted,{
"RTPS Encrypted", "rtps.flag.security.info.plugin_participant_rtps_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000001, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_encrypted,{
"Discovery Encrypted", "rtps.flag.security.info.plugin_participant_discovery_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000002, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_encrypted,{
"Liveliness Encrypted", "rtps.flag.security.info.plugin_participant_liveliness_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000004, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_rtps_origin_encrypted,{
"RTPS Origin Encrypted", "rtps.flag.security.info.plugin_participant_rtps_origin_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000008, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_discovery_origin_encrypted,{
"Discovery Origin Encrypted", "rtps.flag.security.info.plugin_participant_discovery_origin_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000010, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_liveliness_origin_encrypted,{
"Liveliness Origin Encrypted", "rtps.flag.security.info.plugin_participant_liveliness_origin_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000020, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_psk_encrypted,{
"RTPS Pre-Shared Key Encrypted", "rtps.flag.security.info.plugin_participant_psk_encrypted",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
},
{ &hf_rtps_flag_plugin_participant_security_attribute_flag_is_valid,{
"Mask Valid", "rtps.flag.security.info.plugin_participant_mask_valid",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x80000000, NULL, HFILL }
},
{ &hf_rtps_param_plugin_participant_security_attributes_mask,{
"PluginParticipantSecurityAttributesMask (valid dissection if using the Specification Builtin Plugins)",
"rtps.param.plugin_participant_security_attributes",
FT_UINT32, BASE_HEX, NULL, 0,
"bitmask representing the PluginParticipantSecurityAttributes flags in PID_PARTICIPANT_SECURITY_INFO",
HFILL }
},
{ &hf_rtps_param_enable_authentication,
{ "Authentication enabled", "rtps.secure.enable_authentication",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_builtin_endpoint_qos,
{ "Built-in Endpoint QoS", "rtps.param.builtin_endpoint_qos",
FT_UINT32, BASE_HEX, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_sample_signature_epoch,
{ "Epoch", "rtps.sample_signature.epoch",
FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_sample_signature_nonce,
{ "Nonce", "rtps.sample_signature.nonce",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_sample_signature_length,
{"Signature Length", "rtps.sample_signature.signature_length",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_sample_signature_signature,
{ "Signature", "rtps.sample_signature.signature",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_secure_dataheader_transformation_kind, {
"Transformation Kind", "rtps.secure.data_header.transformation_kind",
FT_INT8, BASE_DEC, VALS(secure_transformation_kind), 0,
NULL, HFILL }
},
{ &hf_rtps_secure_dataheader_transformation_key_revision_id, {
"Transformation Key Revision Id", "rtps.secure.data_header.transformation_key_revision_id",
FT_INT24, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_dataheader_transformation_key_id, {
"Transformation Key Id", "rtps.secure.data_header.transformation_key",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_dataheader_passphrase_id, {
"Passphrase Id", "rtps.secure.data_header.passphrase_id",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_dataheader_passphrase_key_id, {
"Passphrase Key Id", "rtps.secure.data_header.passphrase_key_id",
FT_UINT8, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_dataheader_init_vector_suffix, {
"Plugin Secure Header", "rtps.secure.data_header.init_vector_suffix",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_dataheader_session_id, {
"Session Id", "rtps.secure.data_header.session_id",
FT_UINT32, BASE_HEX, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_datatag_plugin_sec_tag, {
"Receiver-Specific Mac",
"rtps.secure.data_tag.receiver_specific_mac",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_datatag_plugin_sec_tag_key, {
"Receiver-Specific Mac Key Id",
"rtps.secure.data_tag.receiver_specific_macs_key_id",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_datatag_plugin_sec_tag_common_mac, {
"Plugin Secure Tag Common Mac", "rtps.secure.data_tag.common_mac",
FT_BYTES, BASE_NONE, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_secure_datatag_plugin_specific_macs_len, {
"Plugin Secure Tag Receiver-Specific Macs Length", "rtps.secure.data_tag.specific_macs_len",
FT_UINT32, BASE_DEC, NULL, 0,
NULL, HFILL }
},
{ &hf_rtps_srm_service_id,
{ "Service Id", "rtps.srm.service_id",
FT_INT32, BASE_DEC, VALS(service_request_kind), 0, NULL, HFILL }
},
{ &hf_rtps_srm_request_body, {
"Request Body", "rtps.srm.request_body",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_srm_instance_id, {
"Instance Id", "rtps.srm.instance_id",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_topic_query_selection_filter_class_name,
{ "Class Name", "rtps.srm.topic_query.class_name",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_topic_query_selection_filter_expression,
{ "Filter Expression", "rtps.srm.topic_query.filter_expression",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_topic_query_selection_filter_parameter,
{ "Filter Parameter", "rtps.srm.topic_query.filter_parameter",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_topic_query_selection_num_parameters,
{ "Number of Filter Parameters", "rtps.srm.topic_query.num_filter_parameters",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_topic_query_topic_name,
{ "Topic Name", "rtps.srm.topic_query.topic_name",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_topic_query_original_related_reader_guid,
{ "Original Related Reader GUID", "rtps.srm.topic_query.original_related_reader_guid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_topic_query_selection_kind,
{ "Topic Query Selection Kind", "rtps.srm.topic_query.kind",
FT_UINT32, BASE_DEC, VALS(topic_query_selection_kind), 0, NULL, HFILL }
},
{ &hf_rtps_data_session_intermediate,
{ "Data Session Intermediate Packet", "rtps.data_session.intermediate",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_secure_secure_data_length,
{ "Secure Data Length", "rtps.secure.secure_data_length",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_secure_secure_data,
{ "Secure Data", "rtps.secure.secure_data",
FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a secure payload", HFILL }
},
{ &hf_rtps_secure_session_key,
{ "[Session Key]", "rtps.secure.session_key",
FT_BYTES, BASE_NONE, NULL, 0, "The user data transferred in a secure payload", HFILL }
},
{ &hf_rtps_pgm, {
"Participant Generic Message", "rtps.pgm",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }
},
{ &hf_rtps_srm, {
"Service Request Message", "rtps.srm",
FT_BOOLEAN, BASE_NONE, TFS(&tfs_set_notset), 0x0, NULL, HFILL }
},
{ &hf_rtps_pgm_dst_participant_guid,
{ "Destination Participant GUID", "rtps.pgm.dst_participant_guid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_source_participant_guid,
{ "Source Participant GUID", "rtps.pgm.source_participant_guid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pgm_dst_endpoint_guid,
{ "Destination Endpoint GUID", "rtps.pgm.dst_endpoint_guid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pgm_src_endpoint_guid,
{ "Source Endpoint GUID", "rtps.pgm.src_endpoint_guid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_message_identity_source_guid,
{ "Source GUID", "rtps.pgm.message_identity.source_guid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pgm_message_class_id,
{ "Message class id", "rtps.pgm.data_holder.message_class_id",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pgm_data_holder_class_id,
{ "Class Id", "rtps.pgm.data_holder.class_id",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
#if 0
{ &hf_rtps_pgm_data_holder_stringseq_size,
{ "Size", "rtps.pgm.data_holder.string_seq_size",
FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pgm_data_holder_stringseq_name,
{ "Name", "rtps.pgm.data_holder.string_seq_name",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pgm_data_holder_long_long,
{ "Long long", "rtps.pgm.data_holder.long_long",
FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }
},
#endif
{ &hf_rtps_param_topic_query_publication_enable,
{ "Enable", "rtps.param.topic_query_publication_enable",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_topic_query_publication_sessions,
{ "Number of sessions", "rtps.param.topic_query_publication_sessions",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pl_cdr_member,
{ "Member value", "rtps.data.value",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pl_cdr_member_id,
{ "Member ID", "rtps.data.member_id",
FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pl_cdr_member_length,
{ "Member length", "rtps.data.member_length",
FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pl_cdr_member_id_ext,
{ "Member ID", "rtps.data.member_id",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_pl_cdr_member_length_ext,
{ "Member length", "rtps.data.member_length",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dcps_publication_data_frame_number,{
"DCPSPublicationData In", "rtps.dcps_publication_data_frame_number",
FT_FRAMENUM, BASE_NONE, NULL, 0x0,
"This is a submessage sent by the DataWriter described in the DCPSPublicationData found in this frame", HFILL }
},
{ &hf_rtps_data_tag_name,
{ "Name", "rtps.param.data_tag.name",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_data_tag_value,
{ "Value", "rtps.param.data_tag.value",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_fragments,
{ "Message fragments", "rtps.fragments",
FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_fragment,
{ "Message fragment", "rtps.fragment",
FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_fragment_overlap,
{ "Message fragment overlap", "rtps.fragment.overlap",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_fragment_overlap_conflict,
{ "Message fragment overlapping with conflicting data", "rtps.fragment.overlap.conflicts",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_fragment_multiple_tails,
{ "Message has multiple tail fragments", "rtps.fragment.multiple_tails",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_fragment_too_long_fragment,
{ "Message fragment too long", "rtps.fragment.too_long_fragment",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_fragment_error,
{ "Message defragmentation error", "rtps.fragment.error",
FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_fragment_count,
{ "Message fragment count", "rtps.fragment.count",
FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_reassembled_in,
{ "Reassembled in", "rtps.reassembled.in",
FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_reassembled_length,
{ "Reassembled length", "rtps.reassembled.length",
FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL }
},
{ &hf_rtps_reassembled_data,
{ "Reassembled RTPS data", "rtps.reassembled.data", FT_BYTES, BASE_NONE,
NULL, 0x0, "The reassembled payload", HFILL }
},
{ &hf_rtps_compression_plugin_class_id,
{ "Compression class Id", "rtps.param.compression_class_id", FT_UINT32, BASE_DEC,
VALS(class_id_enum_names), 0x0, NULL, HFILL }
},
{ &hf_rtps_encapsulation_options_compression_plugin_class_id,
{ "Compression class Id", "rtps.param.plugin.compression_class_id", FT_INT8, BASE_DEC,
VALS(class_id_enum_names), 0x0, NULL, HFILL }
},
{ &hf_rtps_padding_bytes,
{ "Padding bytes", "rtps.padding_bytes", FT_INT8, BASE_DEC,
NULL, 0x0, NULL, HFILL }
},
{ &hf_rtps_uncompressed_serialized_length,
{ "Uncompressed serialized length", "rtps.param.uncompressed_serialized_length", FT_UINT32, BASE_DEC,
NULL, 0x0, "The reassembled payload", HFILL }
},
{ &hf_rtps_encapsulation_extended_compression_options,
{ "Uncompressed serialized length", "rtps.extended_compression_options", FT_UINT32, BASE_DEC,
NULL, 0x0, "Extended compression options", HFILL }
},
{ &hf_rtps_compressed_serialized_type_object,
{ "Compressed serialized type object", "rtps.param.compressed_serialized_typeobject", FT_BYTES, BASE_NONE,
NULL, 0x0, "The reassembled payload", HFILL }
},
{ &hf_rtps_dissection_boolean,
{"BOOLEAN", "rtps.dissection.boolean",
FT_BOOLEAN, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_byte,
{"BYTE", "rtps.dissection.byte",
FT_UINT8, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_int16,
{"INT16", "rtps.dissection.int16",
FT_INT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_uint16,
{"UINT16", "rtps.dissection.uint16",
FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_int32,
{"INT32", "rtps.dissection.int32",
FT_INT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_uint32,
{"UINT32", "rtps.dissection.uint32",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_int64,
{"INT64", "rtps.dissection.int64",
FT_INT64, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_uint64,
{"UINT64", "rtps.dissection.uint64",
FT_UINT64, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_float,
{"FLOAT", "rtps.dissection.float",
FT_FLOAT, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_double,
{"DOUBLE", "rtps.dissection.double",
FT_DOUBLE, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_int128,
{"INT128", "rtps.dissection.int128",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_dissection_string,
{ "STRING", "rtps.dissection.string",
FT_STRINGZ, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_flag_udpv4_wan_locator_u, {
"UUID Locator", "rtps.flag.udpv4_wan_locator.u",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL }
},
{ &hf_rtps_flag_udpv4_wan_locator_p, {
"Public Locator", "rtps.flag.udpv4_wan_locator.p",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_udpv4_wan_locator_b, {
"Bidirectional Locator", "rtps.flag.udpv4_wan_locator.b",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_flag_udpv4_wan_locator_r, {
"Relay Locator", "rtps.flag.udpv4_wan_locator.r",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x08, NULL, HFILL }
},
{ &hf_rtps_udpv4_wan_locator_flags, {
"Flags", "rtps.flag.udpv4_wan_locator",
FT_UINT8, BASE_HEX, NULL, 0, "Bitmask representing the flags UDPv4 WAN locator", HFILL }
},
{ &hf_rtps_uuid,{
"UUID", "rtps.uuid",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_udpv4_wan_locator_public_ip, {
"Public IP", "rtps.udpv4_wan_locator.public_ip",
FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_udpv4_wan_locator_public_port, {
"Public port", "rtps.udpv4_wan_locator.public_port",
FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_udpv4_wan_locator_local_ip,{
"Local IP", "rtps.udpv4_wan_locator.local_ip",
FT_IPv4, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_udpv4_wan_locator_local_port,{
"Local port", "rtps.udpv4_wan_locator.local_port",
FT_UINT16, BASE_DEC, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_flag_udpv4_wan_binding_ping_e, {
"Endianness", "rtps.flag.udpv4_wan_binding_ping.e",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x01, NULL, HFILL }
},
{ &hf_rtps_flag_udpv4_wan_binding_ping_l, {
"Long address", "rtps.flag.udpv4_wan_binding_ping.l",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x02, NULL, HFILL }
},
{ &hf_rtps_flag_udpv4_wan_binding_ping_b,{
"Bidirectional", "rtps.flag.udpv4_wan_binding_ping.b",
FT_BOOLEAN, 8, TFS(&tfs_set_notset), 0x04, NULL, HFILL }
},
{ &hf_rtps_udpv4_wan_binding_ping_flags, {
"Flags", "rtps.flag.udpv4_wan_binding_ping",
FT_UINT8, BASE_HEX, NULL, 0, "Bitmask representing the flags UDPv4 WAN binding ping", HFILL }
},
{ &hf_rtps_udpv4_wan_binding_ping_port, {
"RTPS port", "rtps.flag.udpv4_wan_binding_rtps_port",
FT_UINT32, BASE_DEC, NULL, 0, "UDPv4 WAN binding ping RTPS port", HFILL }
},
{ &hf_rtps_long_address, {
"Long address", "rtps.long_address", FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }
},
{ &hf_rtps_param_group_coherent_set, {
"Group coherent set sequence number", "rtps.param.group_coherent_set",
FT_UINT64, BASE_DEC, NULL, 0, "Decimal value representing the value of PID_GROUP_COHERENT_SET parameter", HFILL }
},
{ &hf_rtps_param_end_group_coherent_set, {
"End group coherent set sequence number", "rtps.param.end_group_coherent_set",
FT_UINT64, BASE_DEC, NULL, 0, "Decimal value representing the value of PID_END_GROUP_COHERENT_SET parameter", HFILL }
},
{ &hf_rtps_param_mig_end_coherent_set_sample_count, {
"Ended coherent set sample count", "rtps.param.mig_end_coherent_set_sample_count",
FT_UINT32, BASE_DEC, NULL, 0, "Decimal value representing the value of MIG_RTPS_PID_END_COHERENT_SET_SAMPLE_COUNT parameter", HFILL }
},
{ &hf_rtps_flag_cloud_discovery_service_announcer,{
"Cloud Discovery Service Announcer", "rtps.flag.cloud_discovery_service_announcer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), 0x00000040, NULL, HFILL }
},
{ &hf_rtps_writer_group_oid, {
"Writer Group OID", "rtps.writer_group_oid",
FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the writer group OID", HFILL }
},
{ &hf_rtps_reader_group_oid, {
"Reader Group OID", "rtps.reader_group_oid",
FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the reader group OID", HFILL }
},
{ &hf_rtps_writer_session_id,{
"Writer Session ID", "rtps.writer_session_id",
FT_UINT32, BASE_DEC, NULL, 0, "Decimal representing the writer session ID", HFILL }
},
{ &hf_rtps_flag_participant_config_writer,{
"Participant Config Writer", "rtps.flag.participant_config_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_WRITER, NULL, HFILL }
},
{ &hf_rtps_flag_participant_config_reader,{
"Participant Config Reader", "rtps.flag.participant_config_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_READER, NULL, HFILL }
},
{ &hf_rtps_flag_participant_config_secure_writer,{
"Participant Config Secure Writer", "rtps.flag.participant_config_secure_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_WRITER, NULL, HFILL }
},
{ &hf_rtps_flag_participant_config_secure_reader,{
"Participant Config Secure Reader", "rtps.flag.participant_config_secure_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_CONFIG_SECURE_READER, NULL, HFILL }
},
{ &hf_rtps_flag_participant_bootstrap_writer,{
"Participant Bootstrap Writer", "rtps.flag.participant_bootstrap_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_WRITER, NULL, HFILL }
},
{ &hf_rtps_flag_participant_bootstrap_reader,{
"Participant Bootstrap Reader", "rtps.flag.participant_bootstrap_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_PARTICIPANT_BOOTSTRAP_READER, NULL, HFILL }
},
{ &hf_rtps_flag_monitoring_periodic_writer,{
"Monitoring Periodic Writer", "rtps.flag.monitoring_periodic_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_WRITER, NULL, HFILL }
},
{ &hf_rtps_flag_monitoring_periodic_reader,{
"Monitoring Periodic Reader", "rtps.flag.monitoring_periodic_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_PERIODIC_READER, NULL, HFILL }
},
{ &hf_rtps_flag_monitoring_event_writer,{
"Monitoring Event Writer", "rtps.flag.monitoring_event_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_WRITER, NULL, HFILL }
},
{ &hf_rtps_flag_monitoring_event_reader,{
"Monitoring Event Reader", "rtps.flag.monitoring_event_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_EVENT_READER, NULL, HFILL }
},
{ &hf_rtps_flag_monitoring_logging_writer,{
"Monitoring Logging Writer", "rtps.flag.monitoring_logging_writer",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_WRITER, NULL, HFILL }
},
{ &hf_rtps_flag_monitoring_logging_reader,{
"Monitoring Logging Reader", "rtps.flag.monitoring_logging_reader",
FT_BOOLEAN, 32, TFS(&tfs_set_notset), VENDOR_BUILTIN_ENDPOINT_SET_FLAG_MONITORING_LOGGING_READER, NULL, HFILL }
}
};
static int *ett[] = {
&ett_rtps,
&ett_rtps_default_mapping,
&ett_rtps_proto_version,
&ett_rtps_product_version,
&ett_rtps_submessage,
&ett_rtps_parameter_sequence,
&ett_rtps_parameter,
&ett_rtps_flags,
&ett_rtps_entity,
&ett_rtps_generic_guid,
&ett_rtps_rdentity,
&ett_rtps_wrentity,
&ett_rtps_guid_prefix,
&ett_rtps_app_id,
&ett_rtps_locator_udp_v4,
&ett_rtps_locator,
&ett_rtps_locator_list,
&ett_rtps_timestamp,
&ett_rtps_bitmap,
&ett_rtps_seq_string,
&ett_rtps_seq_ulong,
&ett_rtps_resource_limit,
&ett_rtps_durability_service,
&ett_rtps_liveliness,
&ett_rtps_manager_key,
&ett_rtps_serialized_data,
&ett_rtps_locator_filter_channel,
&ett_rtps_part_message_data,
&ett_rtps_sample_info_list,
&ett_rtps_sample_info,
&ett_rtps_sample_batch_list,
&ett_rtps_locator_filter_locator,
&ett_rtps_writer_heartbeat_virtual_list,
&ett_rtps_writer_heartbeat_virtual,
&ett_rtps_virtual_guid_heartbeat_virtual_list,
&ett_rtps_virtual_guid_heartbeat_virtual,
&ett_rtps_app_ack_virtual_writer_list,
&ett_rtps_app_ack_virtual_writer,
&ett_rtps_app_ack_virtual_writer_interval_list,
&ett_rtps_app_ack_virtual_writer_interval,
&ett_rtps_transport_info,
&ett_rtps_property_list,
&ett_rtps_property,
&ett_rtps_topic_info,
&ett_rtps_topic_info_dw_qos,
&ett_rtps_type_object,
&ett_rtps_type_library,
&ett_rtps_type_element,
&ett_rtps_type_annotation_usage_list,
&ett_rtps_type_enum_constant,
&ett_rtps_type_bound_list,
&ett_rtps_secure_payload_tree,
&ett_rtps_secure_dataheader_tree,
&ett_rtps_secure_transformation_kind,
&ett_rtps_pgm_data,
&ett_rtps_message_identity,
&ett_rtps_related_message_identity,
&ett_rtps_data_holder_seq,
&ett_rtps_data_holder,
&ett_rtps_data_holder_properties,
&ett_rtps_property_tree,
&ett_rtps_param_header_tree,
&ett_rtps_custom_dissection_info,
&ett_rtps_service_request_tree,
&ett_rtps_locator_ping_tree,
&ett_rtps_locator_reachability_tree,
&ett_rtps_locator_list_tree,
&ett_rtps_topic_query_tree,
&ett_rtps_topic_query_selection_tree,
&ett_rtps_topic_query_filter_params_tree,
&ett_rtps_data_member,
&ett_rtps_data_tag_seq,
&ett_rtps_data_tag_item,
&ett_rtps_fragment,
&ett_rtps_fragments,
&ett_rtps_data_representation,
&ett_rtps_decompressed_type_object,
&ett_rtps_dissection_tree,
&ett_rtps_info_remaining_items,
&ett_rtps_data_encapsulation_options,
&ett_rtps_decompressed_serialized_data,
&ett_rtps_instance_transition_data,
&ett_rtps_crypto_algorithm_requirements,
&ett_rtps_decrypted_payload,
&ett_rtps_secure_postfix_tag_list_item
};
static ei_register_info ei[] = {
{ &ei_rtps_sm_octets_to_next_header_error, { "rtps.sm.octetsToNextHeader.error", PI_PROTOCOL, PI_WARN, "(Error: bad length)", EXPFILL }},
{ &ei_rtps_locator_port, { "rtps.locator.port.invalid", PI_PROTOCOL, PI_WARN, "Invalid Port", EXPFILL }},
{ &ei_rtps_ip_invalid, { "rtps.ip_invalid", PI_PROTOCOL, PI_WARN, "IPADDRESS_INVALID_STRING", EXPFILL }},
{ &ei_rtps_port_invalid, { "rtps.port_invalid", PI_PROTOCOL, PI_WARN, "PORT_INVALID_STRING", EXPFILL }},
{ &ei_rtps_parameter_value_invalid, { "rtps.parameter_value_too_small", PI_PROTOCOL, PI_WARN, "ERROR: Parameter value too small", EXPFILL }},
{ &ei_rtps_parameter_not_decoded, { "rtps.parameter_not_decoded", PI_PROTOCOL, PI_WARN, "[DEPRECATED] - Parameter not decoded", EXPFILL }},
{ &ei_rtps_sm_octets_to_next_header_not_zero, { "rtps.sm.octetsToNextHeader.not_zero", PI_PROTOCOL, PI_WARN, "Should be ZERO", EXPFILL }},
{ &ei_rtps_extra_bytes, { "rtps.extra_bytes", PI_MALFORMED, PI_ERROR, "Don't know how to decode those extra bytes: %d", EXPFILL }},
{ &ei_rtps_missing_bytes, { "rtps.missing_bytes", PI_MALFORMED, PI_ERROR, "Not enough bytes to decode", EXPFILL }},
{ &ei_rtps_more_samples_available, { "rtps.more_samples_available", PI_PROTOCOL, PI_NOTE, "More samples available. Configure this limit from preferences dialog", EXPFILL }},
{ &ei_rtps_pid_type_csonsistency_invalid_size, { "rtps.pid_type_consistency_invalid_size", PI_MALFORMED, PI_ERROR, "PID_TYPE_CONSISTENCY invalid size. Has a size of %d bytes. Expected %d or %d bytes.", EXPFILL }},
{ &ei_rtps_uncompression_error, { "rtps.uncompression_error", PI_PROTOCOL, PI_WARN, "Unable to uncompress the compressed payload.", EXPFILL }},
{ &ei_rtps_value_too_large, { "rtps.value_too_large", PI_MALFORMED, PI_ERROR, "Length value goes past the end of the packet", EXPFILL }},
{ &ei_rtps_checksum_check_error, { "rtps.checksum_error", PI_CHECKSUM, PI_ERROR, "Error: Unexpected checksum", EXPFILL }},
{ &ei_rtps_invalid_psk, { "rtps.psk_decryption_error", PI_UNDECODED, PI_ERROR, "Unable to decrypt content using PSK", EXPFILL }}
};
module_t *rtps_module;
expert_module_t *expert_rtps;
uat_t * rtps_psk_uat;
proto_rtps = proto_register_protocol("Real-Time Publish-Subscribe Wire Protocol", "RTPS", "rtps");
proto_register_field_array(proto_rtps, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_rtps = expert_register_protocol(proto_rtps);
expert_register_field_array(expert_rtps, ei, array_length(ei));
/* Registers the control in the preference panel */
rtps_module = prefs_register_protocol(proto_rtps, NULL);
prefs_register_uint_preference(
rtps_module,
"max_batch_samples_dissected",
"Max samples dissected for DATA_BATCH",
"Specifies the maximum number of samples dissected in a DATA_BATCH "
"submessage. Increasing this value may affect performance if the "
"trace has a lot of big batched samples.",
10,
&rtps_max_batch_samples_dissected);
prefs_register_bool_preference(
rtps_module,
"enable_max_dissection_info_elements",
"Limit the number of elements dissected in structs",
"Enabling this option may affect performance if the trace has messages "
"with large Data Types.",
&enable_max_data_type_elements);
prefs_register_uint_preference(
rtps_module,
"max_dissection_info_elements",
"Max Dissection info elements shown in structs",
"Specifies the maximum number of Data Type elements dissected. "
"Increasing this value may affect performance if the trace has "
"messages with large Data Types.",
10,
&rtps_max_data_type_elements);
prefs_register_bool_preference(
rtps_module,
"enable_max_dissection_array_elements",
"Limit the number of elements dissected in arrays or sequences",
"Disabling this option may affect performance if the trace has messages "
"with large arrays or sequences.",
&enable_max_array_data_type_elements);
prefs_register_uint_preference(
rtps_module,
"max_dissection_array_elements",
"Max Dissection elements shown in arrays or sequences",
"Specifies the maximum number of Data Type elements dissected in arrays or sequences. "
"Increasing this value may affect "
"performance if the trace has messages with large Data Types.",
10,
&rtps_max_array_data_type_elements);
prefs_register_bool_preference(
rtps_module,
"enable_topic_info",
"Enable Topic Information",
"Shows the Topic Name and Type Name of the samples. "
"Note: this can considerably increase the dissection time.",
&enable_topic_info);
prefs_register_bool_preference(
rtps_module,
"enable_user_data_dissection",
"Enable User Data Dissection (based on Type Object)",
"Dissects the user data if the Type Object is propagated in Discovery.",
&enable_user_data_dissection);
prefs_register_bool_preference(
rtps_module,
"enable_rtps_reassembly",
"Enable RTPS Reassembly",
"Enables the reassembly of DATA_FRAG submessages.",
&enable_rtps_reassembly);
prefs_register_bool_preference(
rtps_module,
"enable_rtps_checksum_check",
"Enable RTPS Checksum check (Only CRC-32C and MD5 supported)",
"Detects the RTPS packets with invalid checksums (Only CRC-32C and MD5 "
"supported)",
&enable_rtps_crc_check);
prefs_register_bool_preference(
rtps_module,
"enable_rtps_psk_decryption",
"Enable RTPS PSK decryption",
"Decode RTPS messages protected with a pre-shared key",
&enable_rtps_psk_decryption);
rtps_psk_uat = uat_new(
"RTPS GUID-PSK",
sizeof(rtps_psk_options_entry_t),
"RTPS PSK Keys",
true,
&rtps_psk_options.entries,
&rtps_psk_options.size,
0x00000001,
NULL,
rtps_psk_options_copy_entry,
rtps_psk_options_update_entry,
rtps_psk_options_free_entry,
NULL,
NULL,
rtps_psk_table_field_array);
prefs_register_uat_preference(
rtps_module,
"psk_keys",
"Pre-shared keys",
"List of pre-shared keys that will be used to decode RTPS messages if"
" the previous option is enabled",
rtps_psk_uat);
rtps_type_name_table = register_dissector_table("rtps.type_name", "RTPS Type Name",
proto_rtps, FT_STRING, STRING_CASE_SENSITIVE);
registry = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid);
dissection_infos = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal);
union_member_mappings = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal);
mutable_member_mappings = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), g_int64_hash, g_int64_equal);
coherent_set_tracking.entities_using_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid);
coherent_set_tracking.coherent_set_registry_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), coherent_set_key_hash_by_key, compare_by_coherent_set_key);
builtin_dissection_infos = wmem_map_new_autoreset(wmem_epan_scope(), wmem_epan_scope(), g_int64_hash, g_int64_equal);
coherent_set_tracking.entities_using_map = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_guid, compare_by_guid);
discovered_participants_domain_ids = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), hash_by_participant_guid, compare_by_participant_guid);
/* In order to get this dissector from other dissectors */
register_dissector("rtps", dissect_simple_rtps, proto_rtps);
initialize_instance_state_data_response_dissection_info(&builtin_types_dissection_data);
reassembly_table_register(&rtps_reassembly_table,
&addresses_reassembly_table_functions);
}
void proto_reg_handoff_rtps(void) {
heur_dissector_add("rtitcp", dissect_rtps_rtitcp, "RTPS over RTITCP", "rtps_rtitcp", proto_rtps, HEURISTIC_ENABLE);
heur_dissector_add("udp", dissect_rtps_udp, "RTPS over UDP", "rtps_udp", proto_rtps, HEURISTIC_ENABLE);
heur_dissector_add("tcp", dissect_rtps_tcp, "RTPS over TCP", "rtps_tcp", proto_rtps, HEURISTIC_ENABLE);
}
/*
* Editor modelines
*
* Local Variables:
* c-basic-offset: 2
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* ex: set shiftwidth=2 tabstop=8 expandtab:
* :indentSize=2:tabSize=8:noTabs=true:
*/
|