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
|
/* packet-lbmsrs.c
* Routines for SRS Packet dissection
*
* Copyright (c) 2005-2014 Informatica Corporation. All Rights Reserved.
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* Special thanks to the team at https://github.com/rsocket/rsocket-wireshark
* for getting us started on the right path for this Ultra Messaging rsocket dissector.
* Rsocket Protocol Description: https://rsocket.io/docs/Protocol.html
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/expert.h>
#include <epan/to_str.h>
#include "packet-lbm.h"
#include <epan/proto.h>
#include <epan/prefs.h>
#include <epan/uat.h>
#include <wsutil/pint.h>
#include "packet-tcp.h"
static gint proto_lbmsrs = -1;
void proto_register_lbmsrs(void);
void proto_reg_handoff_lbmsrs(void);
/****************************************LBMSRS Packet definitions**************************************************/
/*******************************************************************************************************************/
#define LBM_SRS_PROTOCOL_VERSION 1
#define L_LBM_SRS_MESSAGE_ID 2
/* LBMSRS Registration Request
typedef struct lbm_srs_registration_request_info_t_stct {
lbm_uint8_t app_type;
lbm_uint32_t client_addr;
lbm_uint16_t client_port;
lbm_uint32_t session_id;
lbm_uint32_t host_id;
lbm_uint8_t protocol_version;
lbm_uint8_t interest_mode;
lbm_uint32_t local_domain_id;
} lbm_srs_registration_request_info_t;
*/
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_APP_TYPE 1
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_ADDR 4
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_PORT 2
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_SESSION_ID 4
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_HOST_ID 4
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_PROTOCOL_VERSION 1
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE 1
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_LOCAL_DOMAIN_ID 4
#define L_LBM_SRS_REGISTRATION_REQUEST_INFO_T 21 /*padding is giving length as 24 above*/
#define LBM_SRS_INTEREST_MODE_FLOOD 0
#define LBM_SRS_INTEREST_MODE_FILTER 1
#define LBM_SRS_INTEREST_MODE_FLOOD_FORWARD_INTEREST 2
#define LBM_SRS_INTEREST_MODE_FILTER_FORWARD_INTEREST 3
#define LBM_SRS_APP_TYPE_APPLICATION 0
#define LBM_SRS_APP_TYPE_TNWGD 1
#define LBM_SRS_APP_TYPE_STORE 2
/* LBMSRS Registration Response
typedef struct lbm_srs_registration_response_info_t_stct {
lbm_uint64_t client_id;
lbm_uint32_t local_domain_id;
lbm_uint8_t protocol_version;
} lbm_srs_registration_response_info_t;
*/
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_CLIENT_ID 8
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_PROTOCOL_VERSION 4
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_LOCAL_DOMAIN_ID 1
#define L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T 13
/* LBMSRS Stream Request
typedef struct lbm_srs_stream_request_info_t_stct {
lbm_uint8_t unused;
} lbm_srs_stream_request_info_t;
*/
#define L_LBM_SRS_STREAM_REQUEST_INFO_T_UNUSED 1
#define L_LBM_SRS_STREAM_REQUEST_INFO_T 1
/* LBMSRS Source Info
typedef struct lbm_srs_src_info_info_t_stct {
char * otid;
lbm_uint8_t topic_len;
char * topic;
lbm_uint8_t source_len;
char * source;
lbm_uint32_t host_id;
lbm_uint32_t topic_idx;
lbm_uint32_t functionality_flags;
lbm_uint32_t request_ip;
lbm_uint16_t request_port;
lbm_uint32_t domain_id;
lbm_uint8_t encryption;
lbm_uint8_t compression;
lbm_uint32_t ulb_src_id;
lbm_uint32_t ulb_queue_id;
lbm_uint64_t ulb_reg_id;
char* context_instance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint16_t ttl;
lbm_uint32_t cost;
} lbm_srs_src_info_info_t;
*/
#define L_LBM_SRS_SRC_INFO_INFO_T_OTID 32 //fixed length
#define L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN 1
#define L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN 1
#define L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID 4
#define L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX 4
#define L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS 4
#define L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP 4
#define L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT 2
#define L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID 4
#define L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION 1
#define L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION 1
#define L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID 4
#define L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID 4
#define L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID 8
#define L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_SRC_INFO_INFO_T_VERSION 4
#define L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_SRC_INFO_INFO_T_TTL 2
#define L_LBM_SRS_SRC_INFO_INFO_T_COST 4
/* LBMSRS Source Delete Info
typedef struct lbm_srs_src_delete_info_t_stct {
char * otid;
lbm_uint8_t topic_len;
char * topic;
} lbm_srs_src_delete_info_t;
*/
#define L_LBM_SRS_SRC_DELETE_INFO_T_OTID 32
#define L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN 1
/* LBMSRS Receiver Info
typedef struct lbm_srs_rcv_info_info_t_stct {
lbm_uint8_t topic_len;
char * topic;
lbm_uint32_t domain_id;
char* context_instance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint32_t reserved;
} lbm_srs_rcv_info_info_t;
*/
#define L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN 1
#define L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID 4
#define L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_RCV_INFO_INFO_T_VERSION 4
#define L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_RCV_INFO_INFO_T_RESERVED 4
/* LBMSRS Receiver Delete Info
typedef struct lbm_srs_rcv_delete_info_t_stct {
lbm_uint8_t topic_len;
char * topic;
lbm_uint32_t domain_id;
char* context_instance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint32_t reserved;
} lbm_srs_rcv_delete_info_t;
*/
#define L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN 1
#define L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID 4
#define L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_RCV_DELETE_INFO_T_VERSION 4
#define L_LBM_SRS_RCV_DELETE_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED 4
/* LBMSRS Receiver End info
typedef struct lbm_srs_rcv_end_info_t_stct {
lbm_uint8_t topic_len;
char * topic;
lbm_uint32_t domain_id;
char* context_iinstance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint32_t reserved;
} lbm_srs_rcv_end_info_t;
*/
#define L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN 1
#define L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID 4
#define L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_RCV_END_INFO_T_VERSION 4
#define L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_RCV_END_INFO_T_RESERVED 4
/* LBMSRS Wildcard Receiver Info
typedef struct lbm_srs_wrcv_info_info_t_stct {
lbm_uint8_t pattern_len;
char * pattern;
lbm_uint32_t domain_id;
char* context_instance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint32_t reserved;
} lbm_srs_wrcv_info_info_t;
*/
#define L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN 1
#define L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID 4
#define L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_WRCV_INFO_INFO_T_VERSION 4
#define L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED 4
/* LBMSRS Wildcard Receive Delete Info
typedef struct lbm_srs_wrcv_delete_info_t_stct {
lbm_uint8_t pattern_len;
char * pattern;
lbm_uint32_t domain_id;
char* context_instance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint32_t reserved;
} lbm_srs_wrcv_delete_info_t;
*/
#define L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN 1
#define L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID 4
#define L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION 4
#define L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED 4
/* LBMSRS Wildcard Receive End Info
typedef struct lbm_srs_wrcv_end_info_t_stct {
lbm_uint8_t pattern_len;
char * pattern;
lbm_uint32_t domain_id;
char* context_instance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint32_t reserved;
} lbm_srs_wrcv_end_info_t;
*/
#define L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN 1
#define L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID 4
#define L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_WRCV_END_INFO_T_VERSION 4
#define L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_WRCV_END_INFO_T_RESERVED 4
/* LBMSRS Source Leave Info
typedef struct lbm_srs_src_leave_info_t_stct {
char * otid;
lbm_uint8_t topic_len;
char * topic;
lbm_uint8_t source_len;
char * source;
char* context_instance;
lbm_uint8_t context_type;
lbm_uint32_t version;
lbm_uint32_t version_flags;
lbm_uint32_t reserved;
}lbm_srs_src_leave_info_t;
*/
#define L_LBM_SRS_SRC_LEAVE_INFO_T_OTID 32 //fixed length
#define L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN 1
#define L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN 1
#define L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE 8
#define L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE 1
#define L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION 4
#define L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS 4
#define L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED 4
/*SRS Message IDs*/
#define MSG_ID_REGISTRATION_REQUEST 1
#define MSG_ID_REGISTRATION_RESPONSE 2
#define MSG_ID_STREAM_REQUEST 3
#define MSG_ID_SOURCE_INFO 4
#define MSG_ID_SOURCE_DELETE 5
#define MSG_ID_RCV_INFO 6
#define MSG_ID_RCV_DELETE 7
#define MSG_ID_RCV_END 8
#define MSG_ID_WRCV_INFO 9
#define MSG_ID_WRCV_DELETE 10
#define MSG_ID_WRCV_END 11
#define MSG_ID_SRC_LEAVE 12
/*SRS Tag definitions*/
typedef struct
{
char * name;
char * ip_address;
guint32 ip_address_val_h;
guint32 tcp_port;
} lbmsrs_tag_entry_t;
static lbmsrs_tag_entry_t* lbmsrs_tag_entry;
static guint lbmsrs_tag_count = 0;
UAT_CSTRING_CB_DEF(lbmsrs_tag, name, lbmsrs_tag_entry_t)
UAT_IPV4_CB_DEF(lbmsrs_tag, ip_address, lbmsrs_tag_entry_t)
UAT_DEC_CB_DEF(lbmsrs_tag, tcp_port, lbmsrs_tag_entry_t)
static uat_field_t lbmsrs_tag_array[] =
{
UAT_FLD_CSTRING(lbmsrs_tag, name, "Tag name", "Tag name"),
UAT_FLD_IPV4(lbmsrs_tag, ip_address, "LBMSRS IP Address", "LBMSRS IP Address"),
UAT_FLD_DEC(lbmsrs_tag, tcp_port, "LBMSRS TCP port", "LBMSRS TCP port"),
UAT_END_FIELDS
};
static const value_string lbmsrsMessageId[] =
{
{ MSG_ID_REGISTRATION_REQUEST, "SRS_REGISTRATION_REQUEST" },
{ MSG_ID_REGISTRATION_RESPONSE, "SRS_REGISTRATION_RESPONSE" },
{ MSG_ID_STREAM_REQUEST, "SRS_STREAM_REQUEST" },
{ MSG_ID_SOURCE_INFO, "SRS_SRC_INFO" },
{ MSG_ID_SOURCE_DELETE, "SRS_SRC_DELETE" },
{ MSG_ID_RCV_INFO, "SRS_RCV_INFO" },
{ MSG_ID_RCV_DELETE, "SRS_RCV_DELETE" },
{ MSG_ID_RCV_END, "SRS_RCV_END" },
{ MSG_ID_WRCV_INFO, "SRS_WRCV_INFO" },
{ MSG_ID_WRCV_DELETE, "SRS_WRCV_DELETE" },
{ MSG_ID_WRCV_END, "SRS_WRCV_END" },
{ MSG_ID_SRC_LEAVE, "SRS_LEAVE_INFO" },
{ 0,NULL}
};
static const value_string lbmsrsInterestMode[]=
{
{ LBM_SRS_INTEREST_MODE_FLOOD, "INTEREST_MODE_FLOOD"},
{ LBM_SRS_INTEREST_MODE_FILTER, "INTEREST_MODE_FILTER" },
{ LBM_SRS_INTEREST_MODE_FLOOD_FORWARD_INTEREST, "INTEREST_MODE_FLOOD_FORWARD_INTEREST" },
{ LBM_SRS_INTEREST_MODE_FILTER_FORWARD_INTEREST, "INTEREST_MODE_FILTER_FORWARD_INTEREST" },
{ 0,NULL}
};
static const value_string lbmsrsApplicationType[] =
{
{ LBM_SRS_APP_TYPE_APPLICATION, "APP_TYPE_APPLICATION" },
{ LBM_SRS_APP_TYPE_TNWGD, "APP_TYPE_TNWGD" },
{ LBM_SRS_APP_TYPE_STORE, "APP_TYPE_STORE" },
{ 0,NULL}
};
/* Dissector field handles */
static gint hf_lbmsrs_message_id = -1;
/*handles for registration request*/
static gint hf_lbmsrs_app_type = -1;
static gint hf_lbmsrs_client_addr = -1;
static gint hf_lbmsrs_client_port = -1;
static gint hf_lbmsrs_session_id = -1;
static gint hf_lbmsrs_host_id = -1;
static gint hf_lbmsrs_protocol_version = -1;
static gint hf_lbmsrs_interest_mode = -1;
static gint hf_lbmsrs_req_local_domain_id = -1;
/*handles for registration respose*/
static gint hf_lbmsrs_client_id = -1;
static gint hf_lbmsrs_resp_local_domain_id = -1;
static gint hf_lbmsrs_reg_resp_protocol_version = -1;
/*handles for stream request*/
static gint hf_lbmsrs_stream_req_unused = -1;
/*handles for source info*/
static gint hf_lbmsrs_sir = -1;
static gint hf_lbmsrs_sir_otid = -1;
static gint hf_lbmsrs_sir_topic_len = -1;
static gint hf_lbmsrs_sir_topic = -1;
static gint hf_lbmsrs_sir_source_len = -1;
static gint hf_lbmsrs_sir_source = -1;
static gint hf_lbmsrs_sir_host_id = -1;
static gint hf_lbmsrs_sir_topic_idx = -1;
static gint hf_lbmsrs_sir_functionality_flags = -1;
static gint hf_lbmsrs_sir_request_ip = -1;
static gint hf_lbmsrs_sir_request_port = -1;
static gint hf_lbmsrs_sir_domain_id = -1;
static gint hf_lbmsrs_sir_encryption = -1;
static gint hf_lbmsrs_sir_compression = -1;
static gint hf_lbmsrs_sir_ulb_src_id = -1;
static gint hf_lbmsrs_sir_ulb_queue_id = -1;
static gint hf_lbmsrs_sir_ulb_reg_id = -1;
static gint hf_lbmsrs_sir_context_instance = -1;
static gint hf_lbmsrs_sir_context_type = -1;
static gint hf_lbmsrs_sir_version = -1;
static gint hf_lbmsrs_sir_version_flags = -1;
static gint hf_lbmsrs_sir_ttl = -1;
static gint hf_lbmsrs_sir_cost = -1;
/*handles for source delete*/
static gint hf_lbmsrs_sdr = -1;
static gint hf_lbmsrs_sdr_otid = -1;
static gint hf_lbmsrs_sdr_topic_len = -1;
static gint hf_lbmsrs_sdr_topic = -1;
/*handles for receiver info*/
static gint hf_lbmsrs_rir = -1;
static gint hf_lbmsrs_rir_topic_len = -1;
static gint hf_lbmsrs_rir_topic = -1;
static gint hf_lbmsrs_rir_domain_id = -1;
static gint hf_lbmsrs_rir_context_instance = -1;
static gint hf_lbmsrs_rir_context_type = -1;
static gint hf_lbmsrs_rir_version = -1;
static gint hf_lbmsrs_rir_version_flags = -1;
static gint hf_lbmsrs_rir_reserved = -1;
/*handles for receiver delete*/
static gint hf_lbmsrs_rdr = -1;
static gint hf_lbmsrs_rdr_topic_len = -1;
static gint hf_lbmsrs_rdr_topic = -1;
static gint hf_lbmsrs_rdr_domain_id = -1;
static gint hf_lbmsrs_rdr_context_instance = -1;
static gint hf_lbmsrs_rdr_context_type = -1;
static gint hf_lbmsrs_rdr_version = -1;
static gint hf_lbmsrs_rdr_version_flags = -1;
static gint hf_lbmsrs_rdr_reserved = -1;
/*handles for receiver end*/
static gint hf_lbmsrs_rer = -1;
static gint hf_lbmsrs_rer_topic_len = -1;
static gint hf_lbmsrs_rer_topic = -1;
static gint hf_lbmsrs_rer_domain_id = -1;
static gint hf_lbmsrs_rer_context_instance = -1;
static gint hf_lbmsrs_rer_context_type = -1;
static gint hf_lbmsrs_rer_version = -1;
static gint hf_lbmsrs_rer_version_flags = -1;
static gint hf_lbmsrs_rer_reserved = -1;
/*handles for wildcard receiver info*/
static gint hf_lbmsrs_wir = -1;
static gint hf_lbmsrs_wir_pattern_len = -1;
static gint hf_lbmsrs_wir_pattern = -1;
static gint hf_lbmsrs_wir_domain_id = -1;
static gint hf_lbmsrs_wir_context_instance = -1;
static gint hf_lbmsrs_wir_context_type = -1;
static gint hf_lbmsrs_wir_version = -1;
static gint hf_lbmsrs_wir_version_flags = -1;
static gint hf_lbmsrs_wir_reserved = -1;
/*handles for wildcard receiver delete*/
static gint hf_lbmsrs_wdr = -1;
static gint hf_lbmsrs_wdr_pattern_len = -1;
static gint hf_lbmsrs_wdr_pattern = -1;
static gint hf_lbmsrs_wdr_domain_id = -1;
static gint hf_lbmsrs_wdr_context_instance = -1;
static gint hf_lbmsrs_wdr_context_type = -1;
static gint hf_lbmsrs_wdr_version = -1;
static gint hf_lbmsrs_wdr_version_flags = -1;
static gint hf_lbmsrs_wdr_reserved = -1;
/*handles for wildcard receiver end*/
static gint hf_lbmsrs_wer = -1;
static gint hf_lbmsrs_wer_pattern_len = -1;
static gint hf_lbmsrs_wer_pattern = -1;
static gint hf_lbmsrs_wer_domain_id = -1;
static gint hf_lbmsrs_wer_context_instance = -1;
static gint hf_lbmsrs_wer_context_type = -1;
static gint hf_lbmsrs_wer_version = -1;
static gint hf_lbmsrs_wer_version_flags = -1;
static gint hf_lbmsrs_wer_reserved = -1;
/*handles for src leave info*/
static gint hf_lbmsrs_sli = -1;
static gint hf_lbmsrs_sli_otid = -1;
static gint hf_lbmsrs_sli_topic_len = -1;
static gint hf_lbmsrs_sli_topic = -1;
static gint hf_lbmsrs_sli_source_len = -1;
static gint hf_lbmsrs_sli_source = -1;
static gint hf_lbmsrs_sli_context_instance = -1;
static gint hf_lbmsrs_sli_context_type = -1;
static gint hf_lbmsrs_sli_version = -1;
static gint hf_lbmsrs_sli_version_flags = -1;
static gint hf_lbmsrs_sli_reserved = -1;
/*rsocket dissector field handles*/
static gint hf_lbmsrs_rsocket_frame_len = -1;
static gint hf_lbmsrs_rsocket_stream_id = -1;
static gint hf_lbmsrs_rsocket_frame_type = -1;
static gint hf_lbmsrs_rsocket_mdata_len = -1;
static gint hf_lbmsrs_rsocket_mdata = -1;
static gint hf_lbmsrs_rsocket_major_version = -1;
static gint hf_lbmsrs_rsocket_minor_version = -1;
static gint hf_lbmsrs_rsocket_keepalive_interval = -1;
static gint hf_lbmsrs_rsocket_max_lifetime = -1;
static gint hf_lbmsrs_rsocket_mdata_mime_length = -1;
static gint hf_lbmsrs_rsocket_mdata_mime_type = -1;
static gint hf_lbmsrs_rsocket_data_mime_length = -1;
static gint hf_lbmsrs_rsocket_data_mime_type = -1;
static gint hf_lbmsrs_rsocket_req_n = -1;
static gint hf_lbmsrs_rsocket_error_code = -1;
static gint hf_lbmsrs_rsocket_keepalive_last_rcvd_pos = -1;
static gint hf_lbmsrs_rsocket_resume_token_len = -1;
static gint hf_lbmsrs_rsocket_resume_token = -1;
// other flags
static gint hf_lbmsrs_rsocket_ignore_flag = -1;
static gint hf_lbmsrs_rsocket_metadata_flag = -1;
static gint hf_lbmsrs_rsocket_resume_flag = -1;
static gint hf_lbmsrs_rsocket_lease_flag = -1;
static gint hf_lbmsrs_rsocket_follows_flag = -1;
static gint hf_lbmsrs_rsocket_complete_flag = -1;
static gint hf_lbmsrs_rsocket_next_flag = -1;
static gint hf_lbmsrs_rsocket_respond_flag = -1;
/*dissector tree handles*/
static gint ett_lbmsrs = -1;
static gint ett_lbmsrs_data = -1;
static gint ett_lbmsrs_details = -1;
static gint ett_lbmsrs_sir = -1;
static gint ett_lbmsrs_sdr = -1;
static gint ett_lbmsrs_ser = -1;
static gint ett_lbmsrs_rir = -1;
static gint ett_lbmsrs_rdr = -1;
static gint ett_lbmsrs_rer = -1;
static gint ett_lbmsrs_wir = -1;
static gint ett_lbmsrs_wdr = -1;
static gint ett_lbmsrs_wer = -1;
static gint ett_lbmsrs_sli = -1;
static gint ett_lbmsrs_rsocket_frame = -1;
/*Expert analysis fields*/
static expert_field ei_lbmsrs_analysis_invalid_msg_id = EI_INIT;
/* Dissector handle */
static dissector_handle_t lbmsrs_dissector_handle;
static const guint rsocket_frame_len_field_size = 3;
static const guint rsocket_stream_id_field_size = 4;
/* SRS default definitions*/
#define LBMSRS_DEFAULT_SOURCE_PORT 0
#define LBMSRS_DEFAULT_SOURCE_IP "127.0.0.1"
static guint32 lbmsrs_source_ip_address;
static const char* global_lbmsrs_source_ip_address = LBMSRS_DEFAULT_SOURCE_IP;
static guint32 global_lbmsrs_source_port = LBMSRS_DEFAULT_SOURCE_PORT;
static gboolean global_lbmsrs_use_tag = FALSE;
static guint32 lbmsrs_source_port = LBMSRS_DEFAULT_SOURCE_PORT;
static gboolean lbmsrs_use_tag = FALSE;
#define RSOCKET_FRAME_RESERVED 0x00
#define RSOCKET_FRAME_SETUP 0x01
#define RSOCKET_FRAME_LEASE 0x02
#define RSOCKET_FRAME_KEEPALIVE 0x03
#define RSOCKET_FRAME_REQUEST_RESPONSE 0x04
#define RSOCKET_FRAME_REQUEST_FNF 0x05
#define RSOCKET_FRAME_REQUEST_STREAM 0x06
#define RSOCKET_FRAME_REQUEST_CHANNEL 0x07
#define RSOCKET_FRAME_REQUEST_N 0x08
#define RSOCKET_FRAME_CANCEL 0x09
#define RSOCKET_FRAME_PAYLOAD 0x0A
#define RSOCKET_FRAME_ERROR 0x0B
#define RSOCKET_FRAME_METADATA_PUSH 0x0C
#define RSOCKET_FRAME_RESUME 0x0D
#define RSOCKET_FRAME_RESUME_OK 0x0E
#define RSOCKET_FRAME_EXT 0x3F
#define RSOCKET_FRAME_SETUP_MIN_SIZE 14
#define RSOCKET_FRAME_KEEPALIVE_SIZE 10
#define RSOCKET_FRAME_REQUEST_RESPONSE_SIZE 2
#define RSOCKET_FRAME_REQUEST_FNF_SIZE 2
#define RSOCKET_FRAME_REQUEST_STREAM_SIZE 6
#define RSOCKET_FRAME_REQUEST_CHANNEL_SIZE 6
#define RSOCKET_FRAME_REQUEST_N_SIZE 6
#define RSOCKET_FRAME_CANCEL_SIZE 2
#define RSOCKET_FRAME_PAYLOAD_SIZE 2
static const value_string rSocketFrameTypeNames[] = {
{ RSOCKET_FRAME_RESERVED, "RESERVED" },
{ RSOCKET_FRAME_SETUP, "SETUP" },
{ RSOCKET_FRAME_LEASE, "LEASE" },
{ RSOCKET_FRAME_KEEPALIVE, "KEEPALIVE" },
{ RSOCKET_FRAME_REQUEST_RESPONSE, "REQUEST_RESPONSE" },
{ RSOCKET_FRAME_REQUEST_FNF, "REQUEST_FNF" },
{ RSOCKET_FRAME_REQUEST_STREAM, "REQUEST_STREAM" },
{ RSOCKET_FRAME_REQUEST_CHANNEL, "REQUEST_CHANNEL" },
{ RSOCKET_FRAME_REQUEST_N, "REQUEST_N" },
{ RSOCKET_FRAME_CANCEL, "CANCEL" },
{ RSOCKET_FRAME_PAYLOAD, "PAYLOAD" },
{ RSOCKET_FRAME_ERROR, "ERROR" },
{ RSOCKET_FRAME_METADATA_PUSH, "METADATA_PUSH" },
{ RSOCKET_FRAME_RESUME, "RESUME" },
{ RSOCKET_FRAME_RESUME_OK, "RESUME_OK" },
{ RSOCKET_FRAME_EXT, "EXT" },
{ 0,NULL} };
static const value_string rSocketErrorCodeNames[] =
{
{ 0x00000000, "RESERVED" },
{ 0x00000001, "INVALID_SETUP" },
{ 0x00000002, "UNSUPPORTED_SETUP" },
{ 0x00000003, "REJECTED_SETUP" },
{ 0x00000004, "REJECTED_RESUME" },
{ 0x00000101, "CONNECTION_ERROR" },
{ 0x00000102, "CONNECTION_CLOSE" },
{ 0x00000201, "APPLICATION_ERROR" },
{ 0x00000202, "REJECTED" },
{ 0x00000203, "CANCELED" },
{ 0x00000204, "INVALID" },
{ 0xFFFFFFFF, "REJECTED" },
{ 0,NULL}
};
/*----------------------------------------------------------------------------*/
/* UAT callback functions. */
/*----------------------------------------------------------------------------*/
static bool lbmsrs_tag_update_cb(void * record, char * * error_string)
{
lbmsrs_tag_entry_t * tag = (lbmsrs_tag_entry_t *)record;
if (tag->name == NULL)
{
*error_string = g_strdup("Tag name can't be empty");
return FALSE;
}
else
{
g_strstrip(tag->name);
if (tag->name[0] == 0)
{
*error_string = g_strdup("Tag name can't be empty");
return FALSE;
}
}
return TRUE;
}
static void * lbmsrs_tag_copy_cb(void * destination, const void * source, size_t length _U_)
{
const lbmsrs_tag_entry_t * src = (const lbmsrs_tag_entry_t *)source;
lbmsrs_tag_entry_t * dest = (lbmsrs_tag_entry_t *)destination;
dest->name = g_strdup(src->name);
dest->ip_address = g_strdup(src->ip_address);
dest->ip_address_val_h = src->ip_address_val_h;
dest->tcp_port = src->tcp_port;
return (dest);
}
static void lbmsrs_tag_free_cb(void * record)
{
lbmsrs_tag_entry_t * tag = (lbmsrs_tag_entry_t *)record;
if (tag->name != NULL)
{
g_free(tag->name);
tag->name = NULL;
}
if (tag->ip_address != NULL)
{
g_free(tag->ip_address);
tag->ip_address = NULL;
}
}
/*Tag helper functions*/
static gboolean lbmsrs_match_packet(packet_info * pinfo, const lbmsrs_tag_entry_t * entry)
{
if ((pinfo->dst.type != AT_IPv4) || (pinfo->dst.len != 4) ||
(pinfo->src.type != AT_IPv4) || (pinfo->src.len != 4))
return (FALSE);
guint32 dest_addr_h = pntoh32(pinfo->dst.data);
guint32 src_addr_h = pntoh32(pinfo->src.data);
guint32 ip_address_val_h = 0;
if (NULL != entry->ip_address)
{
ip_address_val_h = entry->ip_address_val_h;
}
/*if only port number is specified*/
if ((entry->tcp_port > 0) && (ip_address_val_h == 0))
{
if ((entry->tcp_port == pinfo->destport) || (entry->tcp_port == pinfo->srcport))
{
return (TRUE);
}
}
/*if only IP is specified*/
else if ((entry->tcp_port == 0) && (ip_address_val_h > 0))
{
if ((ip_address_val_h == dest_addr_h) || (ip_address_val_h == src_addr_h))
{
return (TRUE);
}
}
/*if both IP and port is specified*/
else
{
if (((ip_address_val_h == dest_addr_h) && (entry->tcp_port == pinfo->destport))
|| ((ip_address_val_h == src_addr_h) && (entry->tcp_port == pinfo->srcport)))
{
return (TRUE);
}
}
return (FALSE);
}
static char * lbmsrs_tag_find(packet_info * pinfo)
{
guint idx;
lbmsrs_tag_entry_t * tag = NULL;
if (!lbmsrs_use_tag)
{
return (NULL);
}
for (idx = 0; idx < lbmsrs_tag_count; ++idx)
{
tag = &(lbmsrs_tag_entry[idx]);
if (lbmsrs_match_packet(pinfo, tag))
{
return tag->name;
}
}
return (NULL);
}
/*Utility functions*/
static const gchar *getFrameTypeName(const guint64 frame_type) {
for (size_t i = 0; i < sizeof(rSocketFrameTypeNames) / sizeof(value_string);
i++) {
if (rSocketFrameTypeNames[i].value == frame_type) {
return rSocketFrameTypeNames[i].strptr;
}
}
return NULL;
}
static gboolean check_lbmsrs_packet(tvbuff_t *tvb, guint offset)
{
/*check if valid rsocket packet*/
guint start_offset = offset;
offset += rsocket_frame_len_field_size;
/*check the length*/
/*rsocket data maybe split accross multiple packets*/
guint32 tvb_length = tvb_captured_length(tvb);
if (tvb_length < (offset - start_offset + rsocket_stream_id_field_size))
{
return FALSE;
}
/*get the stream-id*/
guint32 rsocket_stream_id = tvb_get_guint32(tvb, offset, ENC_BIG_ENDIAN);
/*move the offset past the stream id field*/
offset += rsocket_stream_id_field_size;
if (tvb_length < (offset - start_offset + 1))
{
return FALSE;
}
/*get the rsocket frame type*/
guint64 rsocket_frame_type = tvb_get_bits64(tvb, offset * 8, 6, ENC_BIG_ENDIAN);
/*read the rsocket metadata flag*/
guint8 rsocket_metadata_flag = tvb_get_bits8(tvb, (offset * 8) + 6, 2);
/*check if valid rsocket frame type*/
/*update the offset according to the frame type*/
switch (rsocket_frame_type)
{
case RSOCKET_FRAME_SETUP:
case RSOCKET_FRAME_KEEPALIVE:
case RSOCKET_FRAME_METADATA_PUSH:
case RSOCKET_FRAME_RESUME:
case RSOCKET_FRAME_RESUME_OK:
{
/*for these frame types stream id must be 0 */
if (rsocket_stream_id != 0)
{
return FALSE;
}
return TRUE;
}
case RSOCKET_FRAME_EXT:
{
return TRUE;
}
case RSOCKET_FRAME_REQUEST_RESPONSE:
case RSOCKET_FRAME_REQUEST_FNF:
case RSOCKET_FRAME_CANCEL:
case RSOCKET_FRAME_PAYLOAD:
{
offset += 2;
break;
}
case RSOCKET_FRAME_REQUEST_STREAM:
case RSOCKET_FRAME_REQUEST_CHANNEL:
case RSOCKET_FRAME_REQUEST_N:
case RSOCKET_FRAME_ERROR:
{
offset += 6;
break;
}
default:
return FALSE;
}
/*if rsocket metadata is available get the metadata length*/
if (rsocket_metadata_flag)
{
if (tvb_length < (offset - start_offset + 3))
{
return FALSE;
}
/*add the rsocket metadata length field*/
guint32 rsocket_metadata_len = tvb_get_guint24(tvb, offset, ENC_BIG_ENDIAN);;
offset += 3;
/*move the offset by the metadata length*/
offset += rsocket_metadata_len;
if (tvb_length < (offset - start_offset + 6))
{
return FALSE;
}
}
/*check the SRS message id*/
guint32 rsocket_payload_len = tvb_length - offset;
/*if payload is available start processing for SRS*/
if (rsocket_payload_len > 2)
{
guint16 message_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN);
switch (message_id)
{
case MSG_ID_REGISTRATION_REQUEST:
case MSG_ID_REGISTRATION_RESPONSE:
case MSG_ID_STREAM_REQUEST:
case MSG_ID_SOURCE_INFO:
case MSG_ID_SOURCE_DELETE:
case MSG_ID_RCV_INFO:
case MSG_ID_RCV_DELETE:
case MSG_ID_RCV_END:
case MSG_ID_WRCV_INFO:
case MSG_ID_WRCV_DELETE:
case MSG_ID_WRCV_END:
case MSG_ID_SRC_LEAVE:
{
return TRUE;
}
default:
return FALSE;
}
}
return FALSE;
}
static guint get_rsocket_frame_len(packet_info *pinfo _U_, tvbuff_t *tvb, int offset, void *data _U_)
{
/*get the rsocket frame length (3-byte long field)*/
/*offset argument points to the begining of the Rsocket PDU*/
guint32 rsocket_frame_len = tvb_get_guint24(tvb, offset, ENC_BIG_ENDIAN);
/*return total RSocket PDU size*/
return (rsocket_frame_len + rsocket_frame_len_field_size);
}
/*----------------Main Dissection Functions----------------------*/
/*Rsocket dissector function*/
static guint dissect_rsocket_frame(guint64 rsocket_frame_type,proto_tree* rsocket_frame_tree, tvbuff_t * tvb,guint offset, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint remaining_payload_len = total_payload_len - offset;
guint start_offset = offset;
switch (rsocket_frame_type)
{
case RSOCKET_FRAME_SETUP:/*SETUP Frame*/
{
if (remaining_payload_len < RSOCKET_FRAME_SETUP_MIN_SIZE)
{
*can_dissect_further = FALSE;
break;
}
gint8 resume_flag = tvb_get_bits8(tvb, (offset + 1) * 8, 1);
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_resume_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_lease_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_major_version, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_minor_version, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_keepalive_interval, tvb, offset, 4,ENC_BIG_ENDIAN);
offset += 4;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_max_lifetime, tvb, offset, 4,ENC_BIG_ENDIAN);
offset += 4;
if (resume_flag) {
if ((total_payload_len - offset) < 2)
{
*can_dissect_further = FALSE;
break;
}
guint resume_token_len;
proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_resume_token_len, tvb, offset,2, ENC_BIG_ENDIAN, &resume_token_len);
offset += 2;
if ((total_payload_len - offset) < resume_token_len)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_resume_token, tvb, offset,resume_token_len, ENC_STRING);
offset += resume_token_len;
}
if ((total_payload_len - offset) < 1)
{
*can_dissect_further = FALSE;
break;
}
guint mdata_mime_length;
proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata_mime_length, tvb, offset,1, ENC_BIG_ENDIAN, &mdata_mime_length);
offset += 1;
if ((total_payload_len - offset) < mdata_mime_length)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata_mime_type, tvb, offset,mdata_mime_length, ENC_ASCII | ENC_NA);
offset += mdata_mime_length;
if ((total_payload_len - offset) < 1)
{
*can_dissect_further = FALSE;
break;
}
guint data_mime_length;
proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_data_mime_length, tvb, offset,1, ENC_BIG_ENDIAN, &data_mime_length);
offset += 1;
if ((total_payload_len - offset) < data_mime_length)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_data_mime_type, tvb, offset,data_mime_length, ENC_ASCII | ENC_NA);
offset += data_mime_length;
break;
}
case RSOCKET_FRAME_KEEPALIVE:/*KEEPALIVE FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_KEEPALIVE_SIZE)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_respond_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_keepalive_last_rcvd_pos, tvb, offset, 8,ENC_BIG_ENDIAN);
offset += 8;
break;
}
case RSOCKET_FRAME_REQUEST_RESPONSE:/*REQUEST_RESPONSE FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_REQUEST_RESPONSE_SIZE)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
break;
}
case RSOCKET_FRAME_REQUEST_FNF:/*FNF FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_REQUEST_FNF_SIZE)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
break;
}
case RSOCKET_FRAME_REQUEST_STREAM:/*REQ_STREAM FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_REQUEST_STREAM_SIZE)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_req_n, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
break;
}
case RSOCKET_FRAME_REQUEST_CHANNEL:/*REQ_CHANNEL FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_REQUEST_CHANNEL_SIZE)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_complete_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_req_n, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
break;
}
case RSOCKET_FRAME_REQUEST_N:/*REQ_N FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_REQUEST_N_SIZE)
{
*can_dissect_further = FALSE;
break;
}
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_req_n, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
break;
}
case RSOCKET_FRAME_CANCEL:/*CANCEL FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_CANCEL_SIZE)
{
*can_dissect_further = FALSE;
break;
}
offset += 2;
break;
}
case RSOCKET_FRAME_PAYLOAD:/*PAYLOAD FRAME*/
{
if (remaining_payload_len < RSOCKET_FRAME_PAYLOAD_SIZE)
{
*can_dissect_further = FALSE;
break;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_follows_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_complete_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_next_flag, tvb, offset, 2,ENC_BIG_ENDIAN);
offset += 2;
break;
}
case RSOCKET_FRAME_ERROR:
{
if (remaining_payload_len < 6)
{
*can_dissect_further = FALSE;
break;
}
offset += 2;
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_error_code, tvb, offset, 4,ENC_BIG_ENDIAN);
offset += 4;
break;
}
default:
{
*can_dissect_further = FALSE;
}
}
return (offset - start_offset);
}
static guint dissect_lbmsrs_sir_ser(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_sir, guint *cnt_ser, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first filed is OTID, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_OTID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
proto_item *batch_item = NULL;
batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_sir, tvb, offset, -1, "SIR");
proto_tree *sir_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_sir);
proto_tree_add_item(sir_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_otid, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_OTID, ENC_NA);
offset += L_LBM_SRS_SRC_INFO_INFO_T_OTID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 topic_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_topic_len, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_LEN;
if ((total_payload_len - offset) < topic_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_topic, tvb, offset, topic_len, ENC_ASCII | ENC_NA);
offset += topic_len;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 source_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_source_len, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_SOURCE_LEN;
if ((total_payload_len - offset) < source_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_source, tvb, offset, source_len, ENC_ASCII | ENC_NA);
offset += source_len;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_host_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_HOST_ID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_topic_idx, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_TOPIC_IDX;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_functionality_flags, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_FUNCTIONALITY_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_request_ip, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_IP;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_request_port, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_REQUEST_PORT;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_domain_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_DOMAIN_ID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_encryption, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_ENCRYPTION;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_compression, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_COMPRESSION;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ulb_src_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_ULB_SRC_ID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ulb_queue_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_ULB_QUEUE_ID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ulb_reg_id, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_ULB_REG_ID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_context_instance, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_context_type, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_version, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_version_flags, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_TTL)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sir_tree, hf_lbmsrs_sir_ttl, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_TTL, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_INFO_INFO_T_TTL;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_COST)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint32 cost;
proto_tree_add_item_ret_int(sir_tree, hf_lbmsrs_sir_cost, tvb, offset, L_LBM_SRS_SRC_INFO_INFO_T_COST, ENC_BIG_ENDIAN, &cost);
offset += L_LBM_SRS_SRC_INFO_INFO_T_COST;
if (-1 == cost)
{
proto_item_set_text(batch_item, "SER:Topic:%s", name);
(*cnt_ser)++;
}
else
{
proto_item_set_text(batch_item, "SIR:Topic:%s", name);
(*cnt_sir)++;
}
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_sdr(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_sdr,gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first filed is OTID, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_OTID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
/*add a sub-tree for SDR */
proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_sdr, tvb, offset, -1, "SDR");
proto_tree *sdr_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_sdr);
proto_tree_add_item(sdr_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/*first filed is OTID, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_SRC_INFO_INFO_T_OTID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sdr_tree, hf_lbmsrs_sdr_otid, tvb, offset, L_LBM_SRS_SRC_DELETE_INFO_T_OTID, ENC_NA);
offset += L_LBM_SRS_SRC_DELETE_INFO_T_OTID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 topic_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(sdr_tree, hf_lbmsrs_sdr_topic_len, tvb, offset, L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_DELETE_INFO_T_TOPIC_LEN;
if ((total_payload_len - offset) < topic_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(sdr_tree, hf_lbmsrs_sdr_topic, tvb, offset, topic_len, ENC_ASCII | ENC_NA);
offset += topic_len;
proto_item_set_text(batch_item, "SDR:Topic:%s", name);
(*cnt_sdr)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_rir(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_rir, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
/*add a sub-tree for RIR */
proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rir, tvb, offset, -1, "RIR");
proto_tree *rir_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rir);
proto_tree_add_item(rir_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 topic_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_topic_len, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_INFO_INFO_T_TOPIC_LEN;
if ((total_payload_len - offset) < topic_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_topic, tvb, offset, topic_len, ENC_ASCII | ENC_NA);
offset += topic_len;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_domain_id, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_INFO_INFO_T_DOMAIN_ID;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_context_instance, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_context_type, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_INFO_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_version, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_INFO_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_version_flags, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_INFO_INFO_T_RESERVED)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rir_tree, hf_lbmsrs_rir_reserved, tvb, offset, L_LBM_SRS_RCV_INFO_INFO_T_RESERVED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_INFO_INFO_T_RESERVED;
proto_item_set_text(batch_item, "RIR:Topic:%s", name);
(*cnt_rir)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_rer(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_rer, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
/*add a sub-tree for RIR */
proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rer, tvb, offset, -1, "RER");
proto_tree *rer_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rer);
proto_tree_add_item(rer_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 topic_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_topic_len, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_END_INFO_T_TOPIC_LEN;
if ((total_payload_len - offset) < topic_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_topic, tvb, offset, topic_len, ENC_ASCII | ENC_NA);
offset += topic_len;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_domain_id, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_END_INFO_T_DOMAIN_ID;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_context_instance, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_RCV_END_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_context_type, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_END_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_version, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_END_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_version_flags, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_END_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_END_INFO_T_RESERVED)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rer_tree, hf_lbmsrs_rer_reserved, tvb, offset, L_LBM_SRS_RCV_END_INFO_T_RESERVED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_END_INFO_T_RESERVED;
proto_item_set_text(batch_item, "RER:Topic:%s", name);
(*cnt_rer)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_rdr(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_rdr, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
/*add a sub-tree for RIR */
proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_rdr, tvb, offset, -1, "RDR");
proto_tree *rdr_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_rdr);
proto_tree_add_item(rdr_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 topic_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_topic_len, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_DELETE_INFO_T_TOPIC_LEN;
if ((total_payload_len - offset) < topic_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_topic, tvb, offset, topic_len, ENC_ASCII | ENC_NA);
offset += topic_len;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_domain_id, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_DELETE_INFO_T_DOMAIN_ID;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_context_instance, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_context_type, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_DELETE_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_version, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_DELETE_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_version_flags, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_INFO_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(rdr_tree, hf_lbmsrs_rdr_reserved, tvb, offset, L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_RCV_DELETE_INFO_T_RESERVED;
proto_item_set_text(batch_item, "RDR:Topic:%s", name);
(*cnt_rdr)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_wir(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_wir, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
/*add a sub-tree for RIR */
proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_wir, tvb, offset, -1, "WIR");
proto_tree *wir_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_wir);
proto_tree_add_item(wir_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 pattern_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_pattern_len, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_INFO_INFO_T_PATTERN_LEN;
if ((total_payload_len - offset) < pattern_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_pattern, tvb, offset, pattern_len, ENC_ASCII | ENC_NA);
offset += pattern_len;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_domain_id, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_INFO_INFO_T_DOMAIN_ID;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_context_instance, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_context_type, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_INFO_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_version, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_INFO_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_version_flags, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_INFO_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wir_tree, hf_lbmsrs_wir_reserved, tvb, offset, L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_INFO_INFO_T_RESERVED;
proto_item_set_text(batch_item, "WIR:Topic:%s", name);
(*cnt_wir)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_wdr(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_wdr, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
/*add a sub-tree for RIR */
proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_wdr, tvb, offset, -1, "WDR");
proto_tree *wdr_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_wdr);
proto_tree_add_item(wdr_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 pattern_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_pattern_len, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_DELETE_INFO_T_PATTERN_LEN;
if ((total_payload_len - offset) < pattern_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_pattern, tvb, offset, pattern_len, ENC_ASCII | ENC_NA);
offset += pattern_len;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_domain_id, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_DELETE_INFO_T_DOMAIN_ID;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_context_instance, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_context_type, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_DELETE_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_version, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_version_flags, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_DELETE_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wdr_tree, hf_lbmsrs_wdr_reserved, tvb, offset, L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_DELETE_INFO_T_RESERVED;
proto_item_set_text(batch_item, "WDR:Topic:%s", name);
(*cnt_wdr)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_wer(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_wer, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
gint start_offset = offset;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
/*add a sub-tree for WER */
proto_item * batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_wer, tvb, offset, -1, "WER");
proto_tree *wer_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_wer);
proto_tree_add_item(wer_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
/*first field is Topic length, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 pattern_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_pattern_len, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_END_INFO_T_PATTERN_LEN;
if ((total_payload_len - offset) < pattern_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_pattern, tvb, offset, pattern_len, ENC_ASCII | ENC_NA);
offset += pattern_len;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_domain_id, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_END_INFO_T_DOMAIN_ID;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_context_instance, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_context_type, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_END_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_version, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_END_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_version_flags, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_END_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_WRCV_END_INFO_T_RESERVED)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(wer_tree, hf_lbmsrs_wer_reserved, tvb, offset, L_LBM_SRS_WRCV_END_INFO_T_RESERVED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_WRCV_END_INFO_T_RESERVED;
proto_item_set_text(batch_item, "WER:Topic:%s", name);
(*cnt_wer)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_sli(tvbuff_t * tvb, proto_tree * tree, guint offset, guint *cnt_sli, gboolean *can_dissect_further)
{
guint total_payload_len = tvb_captured_length(tvb);
guint start_offset = offset;
/*first filed is OTID, check if that many bytes are left to process*/
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_OTID)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return 0;
}
proto_item *batch_item = NULL;
batch_item = proto_tree_add_none_format(tree, hf_lbmsrs_sli, tvb, offset, -1, "SLI");
proto_tree *sli_tree = proto_item_add_subtree(batch_item, ett_lbmsrs_sli);
proto_tree_add_item(sli_tree, hf_lbmsrs_message_id, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_otid, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_OTID, ENC_NA);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_OTID;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 topic_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_topic_len, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_TOPIC_LEN;
if ((total_payload_len - offset) < topic_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
gint len;
char* name = tvb_get_stringz_enc(wmem_packet_scope(), tvb, offset, &len, ENC_ASCII);
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_topic, tvb, offset, topic_len, ENC_ASCII | ENC_NA);
offset += topic_len;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
guint8 source_len = tvb_get_guint8(tvb, offset);
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_source_len, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_SOURCE_LEN;
if ((total_payload_len - offset) < source_len)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_source, tvb, offset, source_len, ENC_ASCII | ENC_NA);
offset += source_len;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_context_instance, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE, ENC_NA);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_INSTANCE;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_context_type, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_CONTEXT_TYPE;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_version, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_version_flags, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_VERSION_FLAGS;
if ((total_payload_len - offset) < L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED)
{
/*stop processing in case not available*/
*can_dissect_further = FALSE;
return (offset - start_offset);
}
proto_tree_add_item(sli_tree, hf_lbmsrs_sli_reserved, tvb, offset, L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_SRC_LEAVE_INFO_T_RESERVED;
proto_item_set_text(batch_item, "SLI:Topic:%s", name);
(*cnt_sli)++;
proto_item_set_len(batch_item, (offset - start_offset));
return (offset - start_offset);
}
/*Function to dissect SRS SIR/SER/SDR*/
static guint dissect_lbmsrs_batch(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, guint offset, guint32 rsocket_payload_len)
{
guint start_offset = offset;
guint total_payload_len = tvb_captured_length(tvb);
guint cnt_sir = 0, cnt_ser = 0, cnt_sdr = 0;
guint cnt_rir = 0, cnt_rer = 0, cnt_rdr = 0;
guint cnt_wir = 0, cnt_wer = 0, cnt_wdr = 0;
guint cnt_sli = 0;
col_append_fstr(pinfo->cinfo, COL_INFO, "[");
/*add a sub-tree for the batch */
proto_item *srs_batch;
proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &srs_batch, "SRS SIR/SER/SDR/RIR/RDR/RER/WIR/WDR/WER");
/*this is a start of the batch which will contain SIR,SDR,SER*/
while (offset < total_payload_len)
{
/*at least two bytes required to check the message id*/
if ((total_payload_len - offset) < L_LBM_SRS_MESSAGE_ID)
{
col_append_fstr(pinfo->cinfo, COL_INFO, "SIR:%u SER:%u SDR:%u RIR:%u RER:%u RDR:%u WIR:%u WER:%u WDR:%u SLI:%u]",
cnt_sir, cnt_ser, cnt_sdr, cnt_rir, cnt_rer, cnt_rdr, cnt_wir, cnt_wer, cnt_wdr, cnt_sli);
proto_item_set_text(srs_batch, "SRS:[SIR:%u SER:%u SDR:%u RIR:%u RER:%u RDR:%u WIR:%u WER:%u WDR:%u SLI:%u]",
cnt_sir, cnt_ser, cnt_sdr, cnt_rir, cnt_rer, cnt_rdr, cnt_wir, cnt_wer, cnt_wdr, cnt_sli);
proto_item_set_len(srs_batch, (offset - start_offset));
return (offset - start_offset);
}
guint16 message_id = tvb_get_guint16(tvb, offset, ENC_BIG_ENDIAN);
/*process the SIR/SDR/SER*/
guint len_dissected = 0;
gboolean can_dissect_further = TRUE;
switch (message_id)
{
case MSG_ID_SOURCE_INFO:
{
len_dissected = dissect_lbmsrs_sir_ser(tvb,tree, offset, &cnt_sir, &cnt_ser,&can_dissect_further);
break;
}
case MSG_ID_SOURCE_DELETE:
{
len_dissected = dissect_lbmsrs_sdr(tvb, tree, offset, &cnt_sdr, &can_dissect_further);
break;
}
case MSG_ID_RCV_INFO:
{
len_dissected = dissect_lbmsrs_rir(tvb, tree, offset, &cnt_rir, &can_dissect_further);
break;
}
case MSG_ID_RCV_DELETE:
{
len_dissected = dissect_lbmsrs_rdr(tvb, tree, offset, &cnt_rdr, &can_dissect_further);
break;
}
case MSG_ID_RCV_END:
{
len_dissected = dissect_lbmsrs_rer(tvb, tree, offset, &cnt_rer, &can_dissect_further);
break;
}
case MSG_ID_WRCV_INFO:
{
len_dissected = dissect_lbmsrs_wir(tvb, tree, offset, &cnt_wir, &can_dissect_further);
break;
}
case MSG_ID_WRCV_DELETE:
{
len_dissected = dissect_lbmsrs_wdr(tvb, tree, offset, &cnt_wdr, &can_dissect_further);
break;
}
case MSG_ID_WRCV_END:
{
len_dissected = dissect_lbmsrs_wer(tvb, tree, offset, &cnt_wer, &can_dissect_further);
break;
}
case MSG_ID_SRC_LEAVE:
{
len_dissected = dissect_lbmsrs_sli(tvb, tree, offset, &cnt_sli, &can_dissect_further);
break;
}
default:
break;
}
/*if nothing is dissected then return the current offset*/
if (FALSE == can_dissect_further || len_dissected < 1)
{
col_append_fstr(pinfo->cinfo, COL_INFO, "SIR:%u SER:%u SDR:%u RIR:%u RER:%u RDR:%u WIR:%u WER:%u WDR:%u SLI:%u]",
cnt_sir, cnt_ser, cnt_sdr, cnt_rir, cnt_rer, cnt_rdr, cnt_wir, cnt_wer, cnt_wdr, cnt_sli);
proto_item_set_text(srs_batch, "SRS:[SIR:%u SER:%u SDR:%u RIR:%u RER:%u RDR:%u WIR:%u WER:%u WDR:%u SLI:%u]",
cnt_sir, cnt_ser, cnt_sdr, cnt_rir, cnt_rer, cnt_rdr, cnt_wir, cnt_wer, cnt_wdr, cnt_sli);
proto_item_set_len(srs_batch, (offset - start_offset));
return (offset - start_offset);
}
offset += len_dissected;
}
col_append_fstr(pinfo->cinfo, COL_INFO, "SIR:%u SER:%u SDR:%u RIR:%u RER:%u RDR:%u WIR:%u WER:%u WDR:%u SLI:%u]",
cnt_sir, cnt_ser, cnt_sdr, cnt_rir, cnt_rer, cnt_rdr, cnt_wir, cnt_wer, cnt_wdr, cnt_sli);
proto_item_set_text(srs_batch, "SRS:[SIR:%u SER:%u SDR:%u RIR:%u RER:%u RDR:%u WIR:%u WER:%u WDR:%u SLI:%u]",
cnt_sir, cnt_ser, cnt_sdr, cnt_rir, cnt_rer, cnt_rdr, cnt_wir, cnt_wer, cnt_wdr, cnt_sli);
proto_item_set_len(srs_batch, (offset - start_offset));
return (offset - start_offset);
}
static guint dissect_lbmsrs_registration_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, guint offset, guint32 rsocket_payload_len)
{
guint start_offset = offset;
proto_tree_add_item(tree, hf_lbmsrs_message_id, tvb, offset, L_LBM_SRS_MESSAGE_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_MESSAGE_ID;
/*reduce by message id field length*/
rsocket_payload_len -= L_LBM_SRS_MESSAGE_ID;
if (L_LBM_SRS_REGISTRATION_REQUEST_INFO_T != rsocket_payload_len)
{
return (offset - start_offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "[SRS REGISTRATION REQUEST]");
/*add a sub-tree for SRS */
proto_item *lbmsrs_details;
proto_tree *lbmsrs_details_tree = proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &lbmsrs_details, "SRS Registration Request");
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_app_type, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_APP_TYPE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_APP_TYPE;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_client_addr, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_ADDR, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_ADDR;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_client_port, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_PORT, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_CLIENT_PORT;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_session_id, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_SESSION_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_SESSION_ID;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_host_id, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_HOST_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_HOST_ID;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_protocol_version, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_PROTOCOL_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_PROTOCOL_VERSION;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_interest_mode, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_INTEREST_MODE;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_req_local_domain_id, tvb, offset, L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_LOCAL_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_REQUEST_INFO_T_LOCAL_DOMAIN_ID;
return (offset - start_offset); //return the total length dissected
}
static guint dissect_lbmsrs_registration_response(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, guint offset, guint32 rsocket_payload_len)
{
guint start_offset = offset;
proto_tree_add_item(tree, hf_lbmsrs_message_id, tvb, offset, L_LBM_SRS_MESSAGE_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_MESSAGE_ID;
/*reduce by message id field length*/
rsocket_payload_len -= L_LBM_SRS_MESSAGE_ID;
if (L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T != rsocket_payload_len)
{
return (offset - start_offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "[SRS REGISTRATION RESPONSE]");
/*add a sub-tree for SRS */
proto_item *lbmsrs_details;
proto_tree *lbmsrs_details_tree = proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &lbmsrs_details, "SRS Registration Response");
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_client_id, tvb, offset, L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_CLIENT_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_CLIENT_ID;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_resp_local_domain_id, tvb, offset, L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_LOCAL_DOMAIN_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_LOCAL_DOMAIN_ID;
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_reg_resp_protocol_version, tvb, offset, L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_PROTOCOL_VERSION, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_REGISTRATION_RESPONSE_INFO_T_PROTOCOL_VERSION;
return (offset - start_offset);
}
static guint dissect_lbmsrs_stream_request(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, guint offset, guint32 rsocket_payload_len)
{
guint start_offset = offset;
proto_tree_add_item(tree, hf_lbmsrs_message_id, tvb, offset, L_LBM_SRS_MESSAGE_ID, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_MESSAGE_ID;
/*reduce by message id field length*/
rsocket_payload_len -= L_LBM_SRS_MESSAGE_ID;
if (L_LBM_SRS_STREAM_REQUEST_INFO_T != rsocket_payload_len)
{
return (offset - start_offset);
}
col_append_fstr(pinfo->cinfo, COL_INFO, "[SRS STREAM REQUEST]");
/*add a sub-tree for SRS */
proto_item *lbmsrs_details;
proto_tree *lbmsrs_details_tree = proto_tree_add_subtree(tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_details, &lbmsrs_details, "SRS Stream Request");
proto_tree_add_item(lbmsrs_details_tree, hf_lbmsrs_stream_req_unused, tvb, offset, L_LBM_SRS_STREAM_REQUEST_INFO_T_UNUSED, ENC_BIG_ENDIAN);
offset += L_LBM_SRS_STREAM_REQUEST_INFO_T_UNUSED;
return (offset - start_offset);
}
/*Function to dissect SRS as part of Rsocket payload/metadata*/
static guint dissect_lbmsrs_data(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, guint offset, guint32 rsocket_payload_len)
{
guint total_payload_len = tvb_captured_length(tvb);
guint len_dissected = 0;
if ((total_payload_len - offset) < L_LBM_SRS_MESSAGE_ID)
{
return 0;
}
/*add and get the SRS message id*/
guint16 message_id = tvb_get_guint16(tvb,offset, ENC_BIG_ENDIAN);
switch (message_id)
{
case MSG_ID_REGISTRATION_REQUEST:
{
len_dissected = dissect_lbmsrs_registration_request(tvb,pinfo,tree,offset,rsocket_payload_len);
break;
}
case MSG_ID_REGISTRATION_RESPONSE:
{
len_dissected = dissect_lbmsrs_registration_response(tvb, pinfo, tree, offset, rsocket_payload_len);
break;
}
case MSG_ID_STREAM_REQUEST:
{
len_dissected = dissect_lbmsrs_stream_request(tvb, pinfo, tree, offset, rsocket_payload_len);
break;
}
case MSG_ID_SOURCE_INFO:
case MSG_ID_SOURCE_DELETE:
case MSG_ID_RCV_INFO:
case MSG_ID_RCV_DELETE:
case MSG_ID_RCV_END:
case MSG_ID_WRCV_INFO:
case MSG_ID_WRCV_DELETE:
case MSG_ID_WRCV_END:
case MSG_ID_SRC_LEAVE:
{
len_dissected = dissect_lbmsrs_batch(tvb, pinfo, tree, offset, rsocket_payload_len);
break;
}
default:
{
expert_add_info_format(pinfo, tree, &ei_lbmsrs_analysis_invalid_msg_id,
"Invalid LBMSRS Message Id :%" PRIu16, message_id);
}
}
return len_dissected;
}
/* This is the main dissector function
Return 0 - If the data does not belong to the protocol
Return > 0 - If the data is dissected properly, return the actual length dissected
Return < 0 - If need more data for dissection, return the negative of the length required*/
static int dissect_lbmsrs_pdus(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * user_data _U_)
{
guint offset = 0;
guint tvb_length = tvb_captured_length(tvb);
if (tvb_length < rsocket_frame_len_field_size)
{
return 0;
}
/*get the rsocket frame length*/
guint32 rsocket_frame_len = tvb_get_guint24(tvb, offset, ENC_BIG_ENDIAN);
/*adjust the rscoket tree size correctly so as to accomodate
only the available data, its always possible that the rsocket length reported
in the rsocket PDU is more than the data captured in this packet or vice-versa*/
guint32 rsocket_tree_length = rsocket_frame_len;
if (tvb_length < (rsocket_frame_len + rsocket_frame_len_field_size))
{
rsocket_tree_length = tvb_length - rsocket_frame_len_field_size;
}
/*check if nothing is available to dissect*/
if (rsocket_tree_length <= 0)
{
return 0;
}
/*add the srs subtree, this will allow to use the "srs" filter*/
proto_item *ti = proto_tree_add_item(tree, proto_lbmsrs, tvb, offset, -1, ENC_NA);
proto_tree *srs_tree = proto_item_add_subtree(ti, ett_lbmsrs);
/*add the rsocket frame length field*/
proto_tree_add_item(srs_tree, hf_lbmsrs_rsocket_frame_len, tvb, offset,
rsocket_frame_len_field_size, ENC_BIG_ENDIAN);
offset += rsocket_frame_len_field_size;
/*add the rsocket frame subtree*/
proto_item *rsocket_frame;
proto_tree *rsocket_frame_tree = proto_tree_add_subtree(
srs_tree, tvb, offset, rsocket_tree_length, ett_lbmsrs_rsocket_frame, &rsocket_frame, "RSocket Frame");
/*add the rocket stream id*/
if ((tvb_length - offset) < rsocket_stream_id_field_size)
{
return offset;
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_stream_id, tvb, offset, 4,
ENC_BIG_ENDIAN);
offset += rsocket_stream_id_field_size;
/*read and add the rsocket frame type*/
if ((tvb_length - offset) < 1)
{
return offset;
}
guint64 rsocket_frame_type;
proto_tree_add_bits_ret_val(rsocket_frame_tree, hf_lbmsrs_rsocket_frame_type, tvb,
offset * 8, 6, &rsocket_frame_type, ENC_BIG_ENDIAN);
const gchar *frameName = getFrameTypeName(rsocket_frame_type);
if (frameName) {
col_add_str(pinfo->cinfo, COL_INFO, frameName);
}
else {
col_add_str(pinfo->cinfo, COL_INFO, "UNDEFINED");
}
/*add the rsocket ignore flag*/
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_ignore_flag, tvb, offset, 2,
ENC_BIG_ENDIAN);
/*read the rsocket metadata flag*/
guint8 rsocket_metadata_flag = tvb_get_bits8(tvb, (offset * 8) + 6, 2);
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_metadata_flag, tvb, offset, 2,
ENC_BIG_ENDIAN);
/*dissect rsocket frame based on type */
gboolean can_dissect_further = TRUE;
int rsocket_dissected_len = dissect_rsocket_frame(rsocket_frame_type, rsocket_frame_tree, tvb, offset,&can_dissect_further);
offset += rsocket_dissected_len;
if (FALSE == can_dissect_further)
{
return (offset - rsocket_frame_len);
}
/*if rsocket metadata is available add it to the tree*/
if (rsocket_metadata_flag)
{
/*add the rsocket metadata length field*/
if ((tvb_length - offset) < 3)
{
return (offset - rsocket_frame_len);
}
guint32 rsocket_metadata_len;
proto_tree_add_item_ret_uint(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata_len, tvb, offset,3, ENC_BIG_ENDIAN, &rsocket_metadata_len);
offset += 3;
/*add the rsocket metadata*/
if ((tvb_length - offset) < rsocket_metadata_len)
{
return (offset - rsocket_frame_len);
}
proto_tree_add_item(rsocket_frame_tree, hf_lbmsrs_rsocket_mdata, tvb, offset, rsocket_metadata_len,ENC_ASCII | ENC_NA);
offset += rsocket_metadata_len;
}
/*get the remaining payload length*/
guint32 rsocket_payload_len = tvb_length - offset;
/*if payload is available start processing for SRS*/
if (rsocket_payload_len > 0) {
proto_item *lbmsrs_data;
proto_tree *lbmsrs_data_tree = proto_tree_add_subtree(rsocket_frame_tree, tvb, offset, rsocket_payload_len, ett_lbmsrs_data, &lbmsrs_data, "LBMSRS Data");
offset += dissect_lbmsrs_data(tvb, pinfo, lbmsrs_data_tree, offset, rsocket_payload_len);
}
return (offset - rsocket_frame_len);
}
/*common dissection function for LBMSRS*/
static guint dissect_lbmsrs_real(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * data _U_)
{
char* tag_name = NULL;
if (lbmsrs_use_tag)
{
tag_name = lbmsrs_tag_find(pinfo);
}
col_clear(pinfo->cinfo, COL_INFO);
if (tag_name != NULL)
{
col_add_fstr(pinfo->cinfo, COL_INFO, "[Tag: %s]", tag_name);
}
col_set_str(pinfo->cinfo, COL_PROTOCOL, "LBMSRS");
col_set_fence(pinfo->cinfo, COL_INFO);
tcp_dissect_pdus(tvb, pinfo, tree, TRUE, 3, get_rsocket_frame_len, dissect_lbmsrs_pdus, data);
return tvb_captured_length(tvb);
}
/*normal dissection function*/
static int dissect_lbmsrs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data)
{
if (!check_lbmsrs_packet(tvb, 0))
{
return 0;
}
return dissect_lbmsrs_real(tvb,pinfo,tree,data);
}
/*heuristic dissection function*/
static gboolean test_lbmsrs_packet(tvbuff_t * tvb, packet_info * pinfo, proto_tree * tree, void * user_data _U_)
{
gboolean valid_packet = FALSE;
lbmsrs_tag_entry_t entry;
/* Must be a TCP packet. */
if (pinfo->ptype != PT_TCP)
{
return (FALSE);
}
if (lbmsrs_use_tag)
{
if (lbmsrs_tag_find(pinfo) != NULL)
{
valid_packet = TRUE;
}
}
else
{
entry.name = NULL;
entry.ip_address = LBMSRS_DEFAULT_SOURCE_IP;
if (*global_lbmsrs_source_ip_address == '\0')
{
entry.ip_address = NULL;
}
entry.ip_address_val_h = lbmsrs_source_ip_address;
entry.tcp_port = lbmsrs_source_port;
valid_packet = lbmsrs_match_packet(pinfo, &entry);
}
if (!check_lbmsrs_packet(tvb, 0))
{
return FALSE;
}
if (valid_packet)
{
dissect_lbmsrs_real(tvb, pinfo, tree, user_data);
return (TRUE);
}
return (FALSE);
}
void proto_register_lbmsrs(void)
{
static hf_register_info hf[] = {
{ &hf_lbmsrs_message_id,
{ "Message ID", "lbmsrs.message_id", FT_UINT16, BASE_DEC, VALS(lbmsrsMessageId), 0x0, NULL, HFILL } },
/*rsocket related items start*/
{ &hf_lbmsrs_rsocket_frame_len,
{ "Frame Length", "lbmsrs.rsocket.frame_len", FT_UINT24, BASE_DEC, NULL, 0x0,NULL, HFILL } },
{ &hf_lbmsrs_rsocket_stream_id,
{ "Stream ID", "lbmsrs.rsocket.stream_id", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_frame_type,
{ "Frame Type", "lbmsrs.rsocket.frame_type", FT_UINT8, BASE_DEC,VALS(rSocketFrameTypeNames), 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_mdata_len,
{ "Metadata Length", "lbmsrs.rsocket.metadata_len", FT_UINT24, BASE_DEC, NULL,0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_mdata,
{ "Metadata", "lbmsrs.rsocket.metadata", FT_STRING, BASE_NONE, NULL, 0x0, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_ignore_flag,
{ "Ignore", "lbmsrs.rsocket.flags.ignore", FT_BOOLEAN, 16, NULL, 0x0200, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_metadata_flag,
{ "Metadata", "lbmsrs.rsocket.flags.metadata", FT_BOOLEAN, 16, NULL, 0x0100,NULL, HFILL } },
{ &hf_lbmsrs_rsocket_resume_flag,
{ "Resume", "lbmsrs.rsocket.flags.resume", FT_BOOLEAN, 16, NULL, 0x0080, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_lease_flag,
{ "Lease", "lbmsrs.rsocket.flags.lease", FT_BOOLEAN, 16, NULL, 0x0040, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_follows_flag,
{ "Follows", "lbmsrs.rsocket.flags.follows", FT_BOOLEAN, 16, NULL, 0x0080, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_complete_flag,
{ "Complete", "lbmsrs.rsocket.flags.complete", FT_BOOLEAN, 16, NULL, 0x0040,NULL, HFILL } },
{ &hf_lbmsrs_rsocket_next_flag,
{ "Next", "lbmsrs.rsocket.flags.next", FT_BOOLEAN, 16, NULL, 0x0020, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_respond_flag,
{ "Respond", "lbmsrs.rsocket.flags.respond", FT_BOOLEAN, 16, NULL, 0x0080, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_major_version,
{ "Major Version", "lbmsrs.rsocket.version.major", FT_UINT16, BASE_DEC, NULL,0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_minor_version,
{ "Minor Version", "lbmsrs.rsocket.version.minor", FT_UINT16, BASE_DEC, NULL,0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_keepalive_interval,
{ "Keepalive Interval", "lbmsrs.rsocket.keepalive.interval", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_max_lifetime,
{ "Max Lifetime", "lbmsrs.rsocket.max_lifetime", FT_UINT32, BASE_DEC, NULL, 0x0,NULL, HFILL } },
{ &hf_lbmsrs_rsocket_mdata_mime_length,
{ "Metadata MIME Length", "lbmsrs.rsocket.mdata_mime_length", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_mdata_mime_type,
{ "Metadata MIME Type", "lbmsrs.rsocket.mdata_mime_type", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_data_mime_length,
{ "Data MIME Length", "lbmsrs.rsocket.data_mime_length", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_data_mime_type,
{ "Data MIME Type", "lbmsrs.rsocket.data_mime_type", FT_STRING, BASE_NONE, NULL,0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_req_n,
{ "Request N", "lbmsrs.rsocket.request_n", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,HFILL } },
{ &hf_lbmsrs_rsocket_error_code,
{ "Error Code", "lbmsrs.rsocket.error_code", FT_UINT32, BASE_DEC,VALS(rSocketErrorCodeNames), 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_keepalive_last_rcvd_pos,
{ "Keepalive Last Received Position","lbmsrs.rsocket.keepalive_last_received_position", FT_UINT64, BASE_DEC, NULL,0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_resume_token_len,
{ "Resume Token Length", "lbmsrs.rsocket.resume.token.len", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rsocket_resume_token,
{ "Resume Token", "lbmsrs.rsocket.resume.token", FT_STRING, BASE_NONE, NULL, 0x0,NULL, HFILL } },
/*rsocket related items end*/
/*SRS Registration Request items start*/
{ &hf_lbmsrs_app_type,
{ "Application Type", "lbmsrs.registration_request.app_type", FT_UINT8, BASE_DEC,VALS(lbmsrsApplicationType), 0x0, NULL, HFILL } },
{ &hf_lbmsrs_client_addr,
{ "Client Address", "lbmsrs.registration_request.client_addr", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_client_port,
{ "Client Port", "lbmsrs.registration_request.client_port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_session_id,
{ "Session ID", "lbmsrs.registration_request.session_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_host_id,
{ "Host ID", "lbmsrs.registration_request.host_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_protocol_version,
{ "Protocol Version", "lbmsrs.registration_request.protocol_version", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_interest_mode,
{ "Interest Mode", "lbmsrs.registration_request.interest_mode", FT_UINT8, BASE_DEC,VALS(lbmsrsInterestMode), 0x0, NULL, HFILL } },
{ &hf_lbmsrs_req_local_domain_id,
{ "Local Domain ID", "lbmsrs.registration_request.local_domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Registration Request items end*/
/*SRS Registration Response items start*/
{ &hf_lbmsrs_client_id,
{ "Client ID", "lbmsrs.registration_response.client_id", FT_UINT64, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_resp_local_domain_id,
{ "Local Domain ID", "lbmsrs.registration_response.local_domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_reg_resp_protocol_version,
{ "Protocol Version", "lbmsrs.registration_response.protocol_version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Registration Response items end*/
/*SRS Stream Request items start*/
{ &hf_lbmsrs_stream_req_unused,
{ "Unused", "lbmsrs.stream_req.unused", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Stream Request items end*/
/*SRS Source Info items start*/
{ &hf_lbmsrs_sir,
{ "SIR", "lbmsrs.sir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_otid,
{ "OTID", "lbmsrs.sir.otid", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_topic_len,
{ "Topic Length", "lbmsrs.sir.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_topic,
{ "Topic", "lbmsrs.sir.topic", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_source_len,
{ "Source Length", "lbmsrs.sir.source_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_source,
{ "Source", "lbmsrs.sir.source", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_host_id,
{ "Host ID", "lbmsrs.sir.host_id", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_topic_idx,
{ "Topic Index", "lbmsrs.sir.topic_idx", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_functionality_flags,
{ "Functionality Flags", "lbmsrs.sir.functionality_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_request_ip,
{ "Request IP", "lbmsrs.sir.request_ip", FT_IPv4, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_request_port,
{ "Request Port", "lbmsrs.sir.request_port", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_domain_id,
{ "Domain ID", "lbmsrs.sir.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_encryption,
{ "Encryption", "lbmsrs.sir.encryption", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_compression,
{ "Compression", "lbmsrs.sir.compression", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_ulb_src_id,
{ "ULB Source ID", "lbmsrs.sir.ulb_src_id", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_ulb_queue_id,
{ "ULB Queue ID", "lbmsrs.sir.ulb_queue_id", FT_UINT32, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_ulb_reg_id,
{ "ULB Registration ID", "lbmsrs.sir.ulb_reg_id", FT_UINT64, BASE_DEC_HEX,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_context_instance,
{ "Context Instance", "lbmsrs.sir.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_context_type,
{ "Context Type", "lbmsrs.sir.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_version,
{ "Version", "lbmsrs.sir.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_version_flags,
{ "Version Flags", "lbmsrs.sir.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_ttl,
{ "TTL", "lbmsrs.sir.ttl", FT_UINT16, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sir_cost,
{ "Cost", "lbmsrs.sir.cost", FT_INT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Source Info items end*/
/*SRS Source Delete items start*/
{ &hf_lbmsrs_sdr,
{ "SDR", "lbmsrs.sdr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sdr_otid,
{ "OTID", "lbmsrs.sdr.otid", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sdr_topic_len,
{ "Topic Length", "lbmsrs.sdr.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sdr_topic,
{ "Topic", "lbmsrs.sdr.topic", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
/*SRS Source Delete items end*/
/*SRS Receiver Info items start*/
{ &hf_lbmsrs_rir,
{ "RIR", "lbmsrs.rir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_topic_len,
{ "Topic Length", "lbmsrs.rir.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_topic,
{ "Topic", "lbmsrs.rir.topic", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_domain_id,
{ "Domain ID", "lbmsrs.rir.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_context_instance,
{ "Context Instance", "lbmsrs.rir.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_context_type,
{ "Context Type", "lbmsrs.rir.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_version,
{ "Version", "lbmsrs.rir.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_version_flags,
{ "Version Flags", "lbmsrs.rir.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rir_reserved,
{ "Reserved", "lbmsrs.rir.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Receiver Info items end*/
/*SRS Receiver Delete Info items start*/
{ &hf_lbmsrs_rdr,
{ "RDR", "lbmsrs.rdr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_topic_len,
{ "Topic Length", "lbmsrs.rdr.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_topic,
{ "Topic", "lbmsrs.rdr.topic", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_domain_id,
{ "Domain ID", "lbmsrs.rdr.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_context_instance,
{ "Context Instance", "lbmsrs.rdr.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_context_type,
{ "Context Type", "lbmsrs.rdr.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_version,
{ "Version", "lbmsrs.rdr.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_version_flags,
{ "Version Flags", "lbmsrs.rdr.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rdr_reserved,
{ "Reserved", "lbmsrs.rdr.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Receiver Delete items end*/
/*SRS Receiver End Info items start*/
{ &hf_lbmsrs_rer,
{ "RER", "lbmsrs.rer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_topic_len,
{ "Topic Length", "lbmsrs.rer.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_topic,
{ "Topic", "lbmsrs.rer.topic", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_domain_id,
{ "Domain ID", "lbmsrs.rer.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_context_instance,
{ "Context Instance", "lbmsrs.rer.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_context_type,
{ "Context Type", "lbmsrs.rer.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_version,
{ "Version", "lbmsrs.rer.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_version_flags,
{ "Version Flags", "lbmsrs.rer.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_rer_reserved,
{ "Reserved", "lbmsrs.rer.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Receiver End items end*/
/*SRS Wildcard Receiver Info items start*/
{ &hf_lbmsrs_wir,
{ "WIR", "lbmsrs.wir", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_pattern_len,
{ "Topic Length", "lbmsrs.wir.pattern_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_pattern,
{ "Topic", "lbmsrs.wir.pattern", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_domain_id,
{ "Domain ID", "lbmsrs.wir.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_context_instance,
{ "Context Instance", "lbmsrs.wir.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_context_type,
{ "Context Type", "lbmsrs.wir.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_version,
{ "Version", "lbmsrs.wir.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_version_flags,
{ "Version Flags", "lbmsrs.wir.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wir_reserved,
{ "Reserved", "lbmsrs.wir.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Wildcard Receiver Info items end*/
/*SRS Wildcard Receiver Delete Info items start*/
{ &hf_lbmsrs_wdr,
{ "WDR", "lbmsrs.wdr", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_pattern_len,
{ "Topic Length", "lbmsrs.wdr.pattern_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_pattern,
{ "Topic", "lbmsrs.wdr.pattern", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_domain_id,
{ "Domain ID", "lbmsrs.wdr.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_context_instance,
{ "Context Instance", "lbmsrs.wdr.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_context_type,
{ "Context Type", "lbmsrs.wdr.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_version,
{ "Version", "lbmsrs.wdr.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_version_flags,
{ "Version Flags", "lbmsrs.wdr.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wdr_reserved,
{ "Reserved", "lbmsrs.wdr.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Wildcard Receiver Delete items end*/
/*SRS Wildcard Receiver End Info items start*/
{ &hf_lbmsrs_wer,
{ "WER", "lbmsrs.wer", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_pattern_len,
{ "Topic Length", "lbmsrs.wer.pattern_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_pattern,
{ "Topic", "lbmsrs.wer.pattern", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_domain_id,
{ "Domain ID", "lbmsrs.wer.domain_id", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_context_instance,
{ "Context Instance", "lbmsrs.wer.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_context_type,
{ "Context Type", "lbmsrs.wer.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_version,
{ "Version", "lbmsrs.wer.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_version_flags,
{ "Version Flags", "lbmsrs.wer.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_wer_reserved,
{ "Reserved", "lbmsrs.wer.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
/*SRS Wildcard Receiver End items end*/
/*SRS Source Leave Info items start*/
{ &hf_lbmsrs_sli,
{ "SLI", "lbmsrs.sli", FT_NONE, BASE_NONE, NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_otid,
{ "OTID", "lbmsrs.sli.otid", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_topic_len,
{ "Topic Length", "lbmsrs.sli.topic_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_topic,
{ "Topic", "lbmsrs.sli.topic", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_source_len,
{ "Source Length", "lbmsrs.sli.source_len", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_source,
{ "Source", "lbmsrs.sli.source", FT_STRING, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_context_instance,
{ "Context Instance", "lbmsrs.sli.context_instance", FT_BYTES, BASE_NONE,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_context_type,
{ "Context Type", "lbmsrs.sli.context_type", FT_UINT8, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_version,
{ "Version", "lbmsrs.sli.version", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_version_flags,
{ "Version Flags", "lbmsrs.sli.version_flags", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } },
{ &hf_lbmsrs_sli_reserved,
{ "Reserved", "lbmsrs.sli.reserved", FT_UINT32, BASE_DEC,NULL, 0x0, NULL, HFILL } }
/*SRS Source Leave Info items end*/
};
static gint *ett[] =
{
&ett_lbmsrs,
&ett_lbmsrs_rsocket_frame,
&ett_lbmsrs_data,
&ett_lbmsrs_details,
&ett_lbmsrs_sir,
&ett_lbmsrs_sdr,
&ett_lbmsrs_ser,
&ett_lbmsrs_rir,
&ett_lbmsrs_rdr,
&ett_lbmsrs_rer,
&ett_lbmsrs_wir,
&ett_lbmsrs_wdr,
&ett_lbmsrs_wer,
&ett_lbmsrs_sli
};
static ei_register_info ei[] =
{
{ &ei_lbmsrs_analysis_invalid_msg_id, { "lbmsrs.analysis.invalid_msg_id", PI_MALFORMED, PI_ERROR, "Invalid LBMSRS Message Id", EXPFILL } }
};
proto_lbmsrs = proto_register_protocol("LBM Stateful Resolution Service Protocol", "LBMSRS", "lbmsrs");
proto_register_field_array(proto_lbmsrs, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
expert_module_t *expert_lbmsrs = expert_register_protocol(proto_lbmsrs);
expert_register_field_array(expert_lbmsrs, ei, array_length(ei));
lbmsrs_dissector_handle = register_dissector("lbmsrs", dissect_lbmsrs, proto_lbmsrs);
/*Set the preference menu items*/
module_t* lbmsrs_module = prefs_register_protocol_subtree("29West", proto_lbmsrs, proto_reg_handoff_lbmsrs);
guint32 addr;
ws_inet_pton4(LBMSRS_DEFAULT_SOURCE_IP, &addr);
lbmsrs_source_ip_address = g_ntohl(addr);
prefs_register_string_preference(lbmsrs_module,
"source_ip_address",
"Source IP address (default " LBMSRS_DEFAULT_SOURCE_IP ")",
"Set the LBMSRS IP Address",
&global_lbmsrs_source_ip_address);
prefs_register_uint_preference(lbmsrs_module,
"source_port",
"Source port (default " MAKESTRING(LBMSRS_DEFAULT_SOURCE_PORT)")",
"Set the source TCP port",
10,
&global_lbmsrs_source_port);
prefs_register_bool_preference(lbmsrs_module,
"use_lbmsrs_domain",
"Use LBMSRS tag table",
"Use table of LBMSRS tags to decode the packet instead of above values",
&global_lbmsrs_use_tag);
uat_t *tag_uat = uat_new("LBMSRS tag definitions",
sizeof(lbmsrs_tag_entry_t),
"lbmsrs_domains",
TRUE,
(void * *)&lbmsrs_tag_entry,
&lbmsrs_tag_count,
UAT_AFFECTS_DISSECTION,
NULL,
lbmsrs_tag_copy_cb,
lbmsrs_tag_update_cb,
lbmsrs_tag_free_cb,
NULL,
NULL,
lbmsrs_tag_array);
/*add the tag edit table*/
prefs_register_uat_preference(lbmsrs_module,
"tnw_lbmsrs_tags",
"LBMSRS Tags",
"A table to define LBMSRS tags",
tag_uat);
}
void proto_reg_handoff_lbmsrs(void)
{
static gboolean already_registered = FALSE;
guint32 addr;
if (!already_registered)
{
dissector_add_for_decode_as_with_preference("tcp.port", lbmsrs_dissector_handle);
heur_dissector_add("tcp", test_lbmsrs_packet, "LBM Stateful Resolution Service over RSocket", "lbmsrs_tcp", proto_lbmsrs, HEURISTIC_ENABLE);
}
ws_inet_pton4(global_lbmsrs_source_ip_address, &addr);
lbmsrs_source_ip_address = g_ntohl(addr);
lbmsrs_source_port = global_lbmsrs_source_port;
lbmsrs_use_tag = global_lbmsrs_use_tag;
already_registered = TRUE;
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|