1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
2492
2493
2494
2495
2496
2497
2498
2499
2500
2501
2502
2503
2504
2505
2506
2507
2508
2509
2510
2511
2512
2513
2514
2515
2516
2517
2518
2519
2520
2521
2522
2523
2524
2525
2526
2527
2528
2529
2530
2531
2532
2533
2534
2535
2536
2537
2538
2539
2540
2541
2542
2543
2544
2545
2546
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
2611
2612
2613
2614
2615
2616
2617
2618
2619
2620
2621
2622
2623
2624
2625
2626
2627
2628
2629
2630
2631
2632
2633
2634
2635
2636
2637
2638
2639
2640
2641
2642
2643
2644
2645
2646
2647
2648
2649
2650
2651
2652
2653
2654
2655
2656
2657
2658
2659
2660
2661
2662
2663
2664
2665
2666
2667
2668
2669
2670
2671
2672
2673
2674
2675
2676
2677
2678
2679
2680
2681
2682
2683
2684
2685
2686
2687
2688
2689
2690
2691
2692
2693
2694
2695
2696
2697
2698
2699
2700
2701
2702
2703
2704
2705
2706
2707
2708
2709
2710
2711
2712
2713
2714
2715
2716
2717
2718
2719
2720
2721
2722
2723
2724
2725
2726
2727
2728
2729
2730
2731
2732
2733
2734
2735
2736
2737
2738
2739
2740
2741
2742
2743
2744
2745
2746
2747
2748
2749
2750
2751
2752
2753
2754
2755
2756
2757
2758
2759
2760
2761
2762
2763
2764
2765
2766
2767
2768
2769
2770
2771
2772
2773
2774
2775
2776
2777
2778
2779
2780
2781
2782
2783
2784
2785
2786
2787
2788
2789
2790
2791
2792
2793
2794
2795
2796
2797
2798
2799
2800
2801
2802
2803
2804
2805
2806
2807
2808
2809
2810
2811
2812
2813
2814
2815
2816
2817
2818
2819
2820
2821
2822
2823
2824
2825
2826
2827
2828
2829
2830
2831
2832
2833
2834
2835
2836
2837
2838
2839
2840
2841
2842
2843
2844
2845
2846
2847
2848
2849
2850
2851
2852
2853
2854
2855
2856
2857
2858
2859
2860
2861
2862
2863
2864
2865
2866
2867
2868
2869
2870
2871
2872
2873
2874
2875
2876
2877
2878
2879
2880
2881
2882
2883
2884
2885
2886
2887
2888
2889
2890
2891
2892
2893
2894
2895
2896
2897
2898
2899
2900
2901
2902
2903
2904
2905
2906
2907
2908
2909
2910
2911
2912
2913
2914
2915
2916
2917
2918
2919
2920
2921
2922
2923
2924
2925
2926
2927
2928
2929
2930
2931
2932
2933
2934
2935
2936
2937
2938
2939
2940
2941
2942
2943
2944
2945
2946
2947
2948
2949
2950
2951
2952
2953
2954
2955
2956
2957
2958
2959
2960
2961
2962
2963
2964
2965
2966
2967
2968
2969
2970
2971
2972
2973
2974
2975
2976
2977
2978
2979
2980
2981
2982
2983
2984
2985
2986
2987
2988
2989
2990
2991
2992
2993
2994
2995
2996
2997
2998
2999
3000
3001
3002
3003
3004
3005
3006
3007
3008
3009
3010
3011
3012
3013
3014
3015
3016
3017
3018
3019
3020
3021
3022
3023
3024
3025
3026
3027
3028
3029
3030
3031
3032
3033
3034
3035
3036
3037
3038
3039
3040
3041
3042
3043
3044
3045
3046
3047
3048
3049
3050
3051
3052
3053
3054
3055
3056
3057
3058
3059
3060
3061
3062
3063
3064
3065
3066
3067
3068
3069
3070
3071
3072
3073
3074
3075
3076
3077
3078
3079
3080
3081
3082
3083
3084
3085
3086
3087
3088
3089
3090
3091
3092
3093
3094
3095
3096
3097
3098
3099
3100
3101
3102
3103
3104
3105
3106
3107
3108
3109
3110
3111
3112
3113
3114
3115
3116
3117
3118
3119
3120
3121
3122
3123
3124
3125
3126
3127
3128
3129
3130
3131
3132
3133
3134
3135
3136
3137
3138
3139
3140
3141
3142
3143
3144
3145
3146
3147
3148
3149
3150
3151
3152
3153
3154
3155
3156
3157
3158
3159
3160
3161
3162
3163
3164
3165
3166
3167
3168
3169
3170
3171
3172
3173
3174
3175
3176
3177
3178
3179
3180
3181
3182
3183
3184
3185
3186
3187
3188
3189
3190
3191
3192
3193
3194
3195
3196
3197
3198
3199
3200
3201
3202
3203
3204
3205
3206
3207
3208
3209
3210
3211
3212
3213
3214
3215
3216
3217
3218
3219
3220
3221
3222
3223
3224
3225
3226
3227
3228
3229
3230
3231
3232
3233
3234
3235
3236
3237
3238
3239
3240
3241
3242
3243
3244
3245
3246
3247
3248
3249
3250
3251
3252
3253
3254
3255
3256
3257
3258
3259
3260
3261
3262
3263
3264
3265
3266
3267
3268
3269
3270
3271
3272
3273
3274
3275
3276
3277
3278
3279
3280
3281
3282
3283
3284
3285
3286
3287
3288
3289
3290
3291
3292
3293
3294
3295
3296
3297
3298
3299
3300
3301
3302
3303
3304
3305
3306
3307
3308
3309
3310
3311
3312
3313
3314
3315
3316
3317
3318
3319
3320
3321
3322
3323
3324
3325
3326
3327
3328
3329
3330
3331
3332
3333
3334
3335
3336
3337
3338
3339
3340
3341
3342
3343
3344
3345
3346
3347
3348
3349
3350
3351
3352
3353
3354
3355
3356
3357
3358
3359
3360
3361
3362
3363
3364
3365
3366
3367
3368
3369
3370
3371
3372
3373
3374
3375
3376
3377
3378
3379
3380
3381
3382
3383
3384
3385
3386
3387
3388
3389
3390
3391
3392
3393
3394
3395
3396
3397
3398
3399
3400
3401
3402
3403
3404
3405
3406
3407
3408
3409
3410
3411
3412
3413
3414
3415
3416
3417
3418
3419
3420
3421
3422
3423
3424
3425
3426
3427
3428
3429
3430
3431
3432
3433
3434
3435
3436
3437
3438
3439
3440
3441
3442
3443
3444
3445
3446
3447
3448
3449
3450
3451
3452
3453
3454
3455
3456
3457
3458
3459
3460
3461
3462
3463
3464
3465
3466
3467
3468
3469
3470
3471
3472
3473
3474
3475
3476
3477
3478
3479
3480
3481
3482
3483
3484
3485
3486
3487
3488
3489
3490
3491
3492
3493
3494
3495
3496
3497
3498
3499
3500
3501
3502
3503
3504
3505
3506
3507
3508
3509
3510
3511
3512
3513
3514
3515
3516
3517
3518
3519
3520
3521
3522
3523
3524
3525
3526
3527
3528
3529
3530
3531
3532
3533
3534
3535
3536
3537
3538
3539
3540
3541
3542
3543
3544
3545
3546
3547
3548
3549
3550
3551
3552
3553
3554
3555
3556
3557
3558
3559
3560
3561
3562
3563
3564
3565
3566
3567
3568
3569
3570
3571
3572
3573
3574
3575
3576
3577
3578
3579
3580
3581
3582
3583
3584
3585
3586
3587
3588
3589
3590
3591
3592
3593
3594
3595
3596
3597
3598
3599
3600
3601
3602
3603
3604
3605
3606
3607
3608
3609
3610
3611
3612
3613
3614
3615
3616
3617
3618
3619
3620
3621
3622
3623
3624
3625
3626
3627
3628
3629
3630
3631
3632
3633
3634
3635
3636
3637
3638
3639
3640
3641
3642
3643
3644
3645
3646
3647
3648
3649
3650
3651
3652
3653
3654
3655
3656
3657
3658
3659
3660
3661
3662
3663
3664
3665
3666
3667
3668
3669
3670
3671
3672
3673
3674
3675
3676
3677
3678
3679
3680
3681
3682
3683
3684
3685
3686
3687
3688
3689
3690
3691
3692
3693
3694
3695
3696
3697
3698
3699
3700
3701
3702
|
/* packet-afs.c
* Routines for AFS packet dissection
* Copyright 1999, Nathan Neulinger <nneul@umr.edu>
* Based on routines from tcpdump patches by
* Ken Hornstein <kenh@cmf.nrl.navy.mil>
* Portions based on information retrieved from the RX definitions
* in Arla, the free AFS client at http://www.stacken.kth.se/project/arla/
* Portions based on information/specs retrieved from the OpenAFS sources at
* www.openafs.org, Copyright IBM.
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* Copied from packet-tftp.c
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <stdio.h> /* for sscanf() */
#include <epan/packet.h>
#include <epan/conversation.h>
#include <epan/reassemble.h>
#include <epan/ptvcursor.h>
#include "packet-rx.h"
/* Forward declarations */
void proto_register_afs(void);
/* Defragment (reassemble) fragmented AFS traffic */
static bool afs_defragment;
#define AFS_PORT_FS 7000
#define AFS_PORT_CB 7001
#define AFS_PORT_PROT 7002
#define AFS_PORT_VLDB 7003
#define AFS_PORT_KAUTH 7004
#define AFS_PORT_VOL 7005
#define AFS_PORT_ERROR 7006 /* Doesn't seem to be used */
#define AFS_PORT_BOS 7007
#define AFS_PORT_UPDATE 7008
#define AFS_PORT_RMTSYS 7009
#define AFS_PORT_BACKUP 7021
#define AFS_PORT_BUTC 7025 /* and up */
#ifndef AFSNAMEMAX
#define AFSNAMEMAX 256
#endif
#ifndef AFSOPAQUEMAX
#define AFSOPAQUEMAX 1024
#endif
#define PRNAMEMAX 64
#define VLNAMEMAX 65
#define KANAMEMAX 64
#define BOSNAMEMAX 256
#define PRSFS_READ 1 /* Read files */
#define PRSFS_WRITE 2 /* Write files */
#define PRSFS_INSERT 4 /* Insert files into a directory */
#define PRSFS_LOOKUP 8 /* Lookup files into a directory */
#define PRSFS_DELETE 16 /* Delete files */
#define PRSFS_LOCK 32 /* Lock files */
#define PRSFS_ADMINISTER 64 /* Change ACL's */
#define CB_TYPE_EXCLUSIVE 1
#define CB_TYPE_SHARED 2
#define CB_TYPE_DROPPED 3
#define OPCODE_LOW 0
#define OPCODE_HIGH 66000 /* arbitrary, is just a fuzzy check for encrypted traffic */
#define VOTE_LOW 10000
#define VOTE_HIGH 10007
#define DISK_LOW 20000
#define DISK_HIGH 20013
#define FILE_TYPE_FILE 1
#define FILE_TYPE_DIR 2
#define FILE_TYPE_LINK 3
struct afs_header {
uint32_t opcode;
};
struct afs_volsync {
uint32_t spare1;
uint32_t spare2;
uint32_t spare3;
uint32_t spare4;
uint32_t spare5;
uint32_t spare6;
};
struct afs_status {
uint32_t InterfaceVersion;
uint32_t FileType;
uint32_t LinkCount;
uint32_t Length;
uint32_t DataVersion;
uint32_t Author;
uint32_t Owner;
uint32_t CallerAccess;
uint32_t AnonymousAccess;
uint32_t UnixModeBits;
uint32_t ParentVnode;
uint32_t ParentUnique;
uint32_t SegSize;
uint32_t ClientModTime;
uint32_t ServerModTime;
uint32_t Group;
uint32_t SyncCount;
uint32_t spare1;
uint32_t spare2;
uint32_t spare3;
uint32_t spare4;
};
struct afs_volumeinfo {
uint32_t Vid;
uint32_t Type;
uint32_t Type0;
uint32_t Type1;
uint32_t Type2;
uint32_t Type3;
uint32_t Type4;
uint32_t ServerCount;
uint32_t Server0;
uint32_t Server1;
uint32_t Server2;
uint32_t Server3;
uint32_t Server4;
uint32_t Server5;
uint32_t Server6;
uint32_t Server7;
uint16_t Part0;
uint16_t Part1;
uint16_t Part2;
uint16_t Part3;
uint16_t Part4;
uint16_t Part5;
uint16_t Part6;
uint16_t Part7;
};
static int proto_afs;
static int hf_afs_fs;
static int hf_afs_cb;
static int hf_afs_prot;
static int hf_afs_vldb;
static int hf_afs_kauth;
static int hf_afs_vol;
static int hf_afs_error;
static int hf_afs_bos;
static int hf_afs_update;
static int hf_afs_rmtsys;
static int hf_afs_ubik;
static int hf_afs_backup;
static int hf_afs_butc;
static int hf_afs_service;
static int hf_afs_fs_opcode;
static int hf_afs_cb_opcode;
static int hf_afs_prot_opcode;
static int hf_afs_vldb_opcode;
static int hf_afs_kauth_opcode;
static int hf_afs_vol_opcode;
static int hf_afs_error_opcode;
static int hf_afs_bos_opcode;
static int hf_afs_update_opcode;
static int hf_afs_rmtsys_opcode;
static int hf_afs_ubik_opcode;
static int hf_afs_backup_opcode;
static int hf_afs_butc_opcode;
static int hf_afs_fs_fid_volume;
static int hf_afs_fs_fid_vnode;
static int hf_afs_fs_fid_uniqifier;
static int hf_afs_fs_offset;
static int hf_afs_fs_length;
static int hf_afs_fs_flength;
static int hf_afs_fs_offset64;
static int hf_afs_fs_length64;
static int hf_afs_fs_flength64;
static int hf_afs_fs_errcode;
static int hf_afs_fs_data;
static int hf_afs_fs_name;
static int hf_afs_fs_oldname;
static int hf_afs_fs_newname;
static int hf_afs_fs_symlink_name;
static int hf_afs_fs_symlink_content;
static int hf_afs_fs_volid;
static int hf_afs_fs_volname;
static int hf_afs_fs_timestamp;
static int hf_afs_fs_offlinemsg;
static int hf_afs_fs_motd;
static int hf_afs_fs_xstats_version;
static int hf_afs_fs_xstats_timestamp;
static int hf_afs_fs_xstats_clientversion;
static int hf_afs_fs_xstats_collnumber;
static int hf_afs_fs_cps_spare1;
static int hf_afs_fs_cps_spare2;
static int hf_afs_fs_cps_spare3;
static int hf_afs_fs_vicelocktype;
static int hf_afs_fs_viceid;
static int hf_afs_fs_ipaddr;
static int hf_afs_fs_token;
static int hf_afs_fs_status_anonymousaccess;
static int hf_afs_fs_status_author;
static int hf_afs_fs_status_calleraccess;
static int hf_afs_fs_status_clientmodtime;
static int hf_afs_fs_status_dataversion;
static int hf_afs_fs_status_dataversionhigh;
static int hf_afs_fs_status_filetype;
static int hf_afs_fs_status_group;
static int hf_afs_fs_status_interfaceversion;
static int hf_afs_fs_status_length;
static int hf_afs_fs_status_linkcount;
static int hf_afs_fs_status_mask;
static int hf_afs_fs_status_mask_fsync;
static int hf_afs_fs_status_mask_setgroup;
static int hf_afs_fs_status_mask_setmode;
static int hf_afs_fs_status_mask_setmodtime;
static int hf_afs_fs_status_mask_setowner;
static int hf_afs_fs_status_mask_setsegsize;
static int hf_afs_fs_status_mode;
static int hf_afs_fs_status_owner;
static int hf_afs_fs_status_parentunique;
static int hf_afs_fs_status_parentvnode;
static int hf_afs_fs_status_segsize;
static int hf_afs_fs_status_servermodtime;
static int hf_afs_fs_status_spare2;
static int hf_afs_fs_status_spare3;
static int hf_afs_fs_status_spare4;
static int hf_afs_fs_status_synccounter;
static int hf_afs_fs_volsync_spare1;
static int hf_afs_fs_volsync_spare2;
static int hf_afs_fs_volsync_spare3;
static int hf_afs_fs_volsync_spare4;
static int hf_afs_fs_volsync_spare5;
static int hf_afs_fs_volsync_spare6;
static int hf_afs_fs_acl_datasize;
static int hf_afs_fs_acl_count_negative;
static int hf_afs_fs_acl_count_positive;
static int hf_afs_fs_acl_entity;
static int hf_afs_fs_acl_r;
static int hf_afs_fs_acl_l;
static int hf_afs_fs_acl_i;
static int hf_afs_fs_acl_d;
static int hf_afs_fs_acl_w;
static int hf_afs_fs_acl_k;
static int hf_afs_fs_acl_a;
static int hf_afs_fs_callback_version;
static int hf_afs_fs_callback_expires;
static int hf_afs_fs_callback_type;
static int hf_afs_bos_errcode;
static int hf_afs_bos_type;
static int hf_afs_bos_instance;
static int hf_afs_bos_status;
static int hf_afs_bos_statusdesc;
static int hf_afs_bos_num;
static int hf_afs_bos_size;
static int hf_afs_bos_flags;
static int hf_afs_bos_date;
static int hf_afs_bos_content;
static int hf_afs_bos_user;
static int hf_afs_bos_key;
static int hf_afs_bos_path;
static int hf_afs_bos_file;
static int hf_afs_bos_cmd;
static int hf_afs_bos_error;
static int hf_afs_bos_spare1;
static int hf_afs_bos_spare2;
static int hf_afs_bos_spare3;
static int hf_afs_bos_parm;
static int hf_afs_bos_kvno;
static int hf_afs_bos_cell;
static int hf_afs_bos_host;
static int hf_afs_bos_newtime;
static int hf_afs_bos_baktime;
static int hf_afs_bos_oldtime;
static int hf_afs_bos_data;
static int hf_afs_bos_keymodtime;
static int hf_afs_bos_keychecksum;
static int hf_afs_bos_keyspare2;
static int hf_afs_vldb_errcode;
static int hf_afs_vldb_name;
static int hf_afs_vldb_name_uint_string;
static int hf_afs_vldb_id;
static int hf_afs_vldb_type;
static int hf_afs_vldb_bump;
static int hf_afs_vldb_index;
static int hf_afs_vldb_nextindex;
static int hf_afs_vldb_count;
static int hf_afs_vldb_numservers;
static int hf_afs_vldb_server;
static int hf_afs_vldb_serveruuid;
static int hf_afs_vldb_serveruniq;
static int hf_afs_vldb_serverflags;
static int hf_afs_vldb_serverip;
static int hf_afs_vldb_partition;
static int hf_afs_vldb_rovol;
static int hf_afs_vldb_rwvol;
static int hf_afs_vldb_bkvol;
static int hf_afs_vldb_clonevol;
static int hf_afs_vldb_flags;
static int hf_afs_vldb_flags_rwexists;
static int hf_afs_vldb_flags_roexists;
static int hf_afs_vldb_flags_bkexists;
static int hf_afs_vldb_flags_dfsfileset;
static int hf_afs_vldb_spare1;
static int hf_afs_vldb_spare2;
static int hf_afs_vldb_spare3;
static int hf_afs_vldb_spare4;
static int hf_afs_vldb_spare5;
static int hf_afs_vldb_spare6;
static int hf_afs_vldb_spare7;
static int hf_afs_vldb_spare8;
static int hf_afs_vldb_spare9;
static int hf_afs_kauth_errcode;
static int hf_afs_kauth_princ;
static int hf_afs_kauth_realm;
static int hf_afs_kauth_domain;
static int hf_afs_kauth_kvno;
static int hf_afs_kauth_name;
static int hf_afs_kauth_data;
static int hf_afs_vol_errcode;
static int hf_afs_vol_count;
static int hf_afs_vol_id;
static int hf_afs_vol_name;
static int hf_afs_cb_errcode;
static int hf_afs_cb_callback_version;
static int hf_afs_cb_callback_type;
static int hf_afs_cb_callback_expires;
static int hf_afs_cb_fid_volume;
static int hf_afs_cb_fid_vnode;
static int hf_afs_cb_fid_uniqifier;
static int hf_afs_cm_uuid;
static int hf_afs_cm_numint;
static int hf_afs_cm_ipaddr;
static int hf_afs_cm_netmask;
static int hf_afs_cm_mtu;
static int hf_afs_cm_numcap;
static int hf_afs_cm_capabilities;
static int hf_afs_cm_cap_errortrans;
static int hf_afs_prot_errcode;
static int hf_afs_prot_name;
static int hf_afs_prot_name_uint_string;
static int hf_afs_prot_id;
static int hf_afs_prot_count;
static int hf_afs_prot_oldid;
static int hf_afs_prot_newid;
static int hf_afs_prot_pos;
static int hf_afs_prot_flag;
static int hf_afs_prot_uid;
static int hf_afs_prot_gid;
static int hf_afs_prot_maxuid;
static int hf_afs_prot_maxgid;
static int hf_afs_backup_errcode;
static int hf_afs_butc_errcode;
/* static int hf_afs_ubik_errcode; */
static int hf_afs_ubik_version_epoch;
static int hf_afs_ubik_version_counter;
static int hf_afs_ubik_votestart;
static int hf_afs_ubik_state;
static int hf_afs_ubik_site;
static int hf_afs_ubik_interface;
static int hf_afs_ubik_null_addresses;
static int hf_afs_ubik_file;
static int hf_afs_ubik_pos;
static int hf_afs_ubik_length;
static int hf_afs_ubik_locktype;
/* static int hf_afs_ubik_voteend; */
/* static int hf_afs_ubik_votetype; */
static int hf_afs_ubik_now;
static int hf_afs_ubik_lastyestime;
static int hf_afs_ubik_lastyeshost;
static int hf_afs_ubik_lastyesstate;
static int hf_afs_ubik_lastyesclaim;
static int hf_afs_ubik_lowesthost;
static int hf_afs_ubik_lowesttime;
static int hf_afs_ubik_synchost;
static int hf_afs_ubik_synctime;
static int hf_afs_ubik_amsyncsite;
static int hf_afs_ubik_syncsiteuntil;
static int hf_afs_ubik_nservers;
static int hf_afs_ubik_lockedpages;
static int hf_afs_ubik_writelockedpages;
static int hf_afs_ubik_activewrite;
static int hf_afs_ubik_tidcounter;
static int hf_afs_ubik_anyreadlocks;
static int hf_afs_ubik_anywritelocks;
static int hf_afs_ubik_recoverystate;
static int hf_afs_ubik_currenttrans;
static int hf_afs_ubik_writetrans;
static int hf_afs_ubik_epochtime;
static int hf_afs_ubik_isclone;
static int hf_afs_ubik_addr;
static int hf_afs_ubik_lastvotetime;
static int hf_afs_ubik_lastbeaconsent;
static int hf_afs_ubik_lastvote;
static int hf_afs_ubik_currentdb;
static int hf_afs_ubik_beaconsincedown;
static int hf_afs_ubik_up;
static int hf_afs_repframe;
static int hf_afs_reqframe;
static int hf_afs_time;
static int hf_afs_fragments;
static int hf_afs_fragment;
static int hf_afs_fragment_overlap;
static int hf_afs_fragment_overlap_conflicts;
static int hf_afs_fragment_multiple_tails;
static int hf_afs_fragment_too_long_fragment;
static int hf_afs_fragment_error;
static int hf_afs_fragment_count;
static int hf_afs_reassembled_in;
static int hf_afs_reassembled_length;
static int ett_afs;
static int ett_afs_op;
static int ett_afs_acl;
static int ett_afs_fid;
static int ett_afs_callback;
static int ett_afs_ubikver;
static int ett_afs_status;
static int ett_afs_status_mask;
static int ett_afs_volsync;
static int ett_afs_volumeinfo;
static int ett_afs_vicestat;
static int ett_afs_vldb_flags;
static int ett_afs_fragment;
static int ett_afs_fragments;
static int ett_afs_cm_interfaces;
static int ett_afs_cm_capabilities;
static const fragment_items afs_frag_items = {
/* Fragment subtrees */
&ett_afs_fragment,
&ett_afs_fragments,
/* Fragment fields */
&hf_afs_fragments,
&hf_afs_fragment,
&hf_afs_fragment_overlap,
&hf_afs_fragment_overlap_conflicts,
&hf_afs_fragment_multiple_tails,
&hf_afs_fragment_too_long_fragment,
&hf_afs_fragment_error,
&hf_afs_fragment_count,
/* Reassembled in field */
&hf_afs_reassembled_in,
/* Reassembled length field */
&hf_afs_reassembled_length,
/* Reassembled data field */
NULL,
/* Tag */
"RX fragments"
};
/*
* Macros for helper dissection routines
*
* The macros are here to save on coding. They assume that
* the current offset is in 'offset', and that the offset
* should be incremented after performing the macro's operation.
*/
/* Output a simple rx array */
static void OUT_RXArray8(ptvcursor_t *cursor, int field, int field_size, int encoding)
{
unsigned int i,
size = tvb_get_uint8(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_advance(cursor, 1);
for (i=0; i<size; i++) {
ptvcursor_add(cursor, field, field_size, encoding);
}
}
/* Output a simple rx array */
#define OUT_RXArray32(func) \
{ \
unsigned int j,i; \
j = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)); \
ptvcursor_advance(cursor, 4); \
for (i=0; i<j; i++) { \
func; \
} \
}
/* Output a UNIX seconds/microseconds timestamp, after converting to an
nstime_t */
static void OUT_TIMESTAMP(ptvcursor_t *cursor, int field)
{
proto_tree_add_item(ptvcursor_tree(cursor), field, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), 8, ENC_TIME_SECS_USECS|ENC_BIG_ENDIAN);
ptvcursor_advance(cursor, 8);
}
/* Output a seconds-only time value, after converting to an nstime_t;
this can be an absolute time as a UNIX time-since-epoch, or a
relative time in seconds */
static void OUT_TIMESECS(ptvcursor_t *cursor, int field)
{
proto_tree_add_item(ptvcursor_tree(cursor), field, ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), 4, ENC_TIME_SECS|ENC_BIG_ENDIAN);
ptvcursor_advance(cursor, 4);
}
/* Output a rx style string, up to a maximum length first
4 bytes - length, then char data */
static void OUT_RXString(ptvcursor_t *cursor, int field)
{
int offset = ptvcursor_current_offset(cursor),
new_offset;
ptvcursor_add(cursor, field, 4, ENC_BIG_ENDIAN);
new_offset = ptvcursor_current_offset(cursor);
/* strings are padded to 32-bit boundary */
if ((new_offset-offset)&3)
ptvcursor_advance(cursor, 4-((new_offset-offset)&3));
}
/* Output a fixed length vectorized string (each char is a 32 bit int) */
static void OUT_RXStringV(ptvcursor_t *cursor, int field, uint32_t length)
{
tvbuff_t* tvb = ptvcursor_tvbuff(cursor);
wmem_strbuf_t *strbuf = wmem_strbuf_new_sized(wmem_packet_scope(), length+1);
int offset = ptvcursor_current_offset(cursor),
start_offset = offset;
uint32_t idx;
for (idx = 0; idx<length; idx++)
{
wmem_strbuf_append_c(strbuf, (char)tvb_get_ntohl(tvb, offset));
offset += 4;
}
/* XXX: There's no indication what encoding this string has.
* Treat it as UTF-8 for now.
*/
if (!wmem_strbuf_utf8_validate(strbuf, NULL)) {
wmem_strbuf_utf8_make_valid(strbuf);
}
proto_tree_add_string(ptvcursor_tree(cursor), field, tvb, start_offset, length*4, wmem_strbuf_finalize(strbuf));
ptvcursor_advance(cursor, length*4);
}
/* Output a callback */
static void OUT_FS_AFSCallBack(ptvcursor_t *cursor)
{
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_afs_callback, "Callback");
ptvcursor_add(cursor, hf_afs_fs_callback_version, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_fs_callback_expires);
ptvcursor_add(cursor, hf_afs_fs_callback_type, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output cache manager interfaces */
static void OUT_CM_INTERFACES(ptvcursor_t *cursor)
{
unsigned int i;
unsigned int maxint = 32,
numint = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_afs_cm_interfaces, "Interfaces");
ptvcursor_add(cursor, hf_afs_cm_numint, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_cm_uuid, 4*11, ENC_NA);
for ( i=0; i<numint; i++ ) {
ptvcursor_add(cursor, hf_afs_cm_ipaddr, 4, ENC_BIG_ENDIAN);
}
ptvcursor_advance(cursor, 4*(maxint-numint));
for ( i=0; i<numint; i++ ) {
ptvcursor_add(cursor, hf_afs_cm_netmask, 4, ENC_BIG_ENDIAN);
}
ptvcursor_advance(cursor, 4*(maxint-numint));
for ( i=0; i<numint; i++ ) {
ptvcursor_add(cursor, hf_afs_cm_mtu, 4, ENC_BIG_ENDIAN);
}
ptvcursor_advance(cursor, 4*(maxint-numint));
ptvcursor_pop_subtree(cursor);
}
/* Output CM capabilities */
static void OUT_CM_CAPABILITIES(ptvcursor_t *cursor)
{
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH, ett_afs_cm_capabilities, "Capabilities");
ptvcursor_add(cursor, hf_afs_cm_numcap, 4, ENC_BIG_ENDIAN);
ptvcursor_add_no_advance(cursor, hf_afs_cm_capabilities, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_cm_cap_errortrans, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output a callback */
static void OUT_CB_AFSCallBack(ptvcursor_t *cursor)
{
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
ett_afs_callback, "Callback");
ptvcursor_add(cursor, hf_afs_cb_callback_version, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_cb_callback_expires);
ptvcursor_add(cursor, hf_afs_cb_callback_type, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output a File ID */
static void OUT_FS_AFSFid(ptvcursor_t *cursor, const char* label)
{
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
ett_afs_fid, "FileID (%s)", label);
ptvcursor_add(cursor, hf_afs_fs_fid_volume, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_fid_vnode, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_fid_uniqifier, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output a File ID */
static void OUT_CB_AFSFid(ptvcursor_t *cursor, const char* label)
{
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
ett_afs_fid, "FileID (%s)", label);
ptvcursor_add(cursor, hf_afs_cb_fid_volume, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_cb_fid_vnode, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_cb_fid_uniqifier, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output a StoreStatus */
static void OUT_FS_AFSStoreStatus(ptvcursor_t *cursor, const char* label)
{
static int * const status_mask_flags[] = {
&hf_afs_fs_status_mask_setmodtime,
&hf_afs_fs_status_mask_setowner,
&hf_afs_fs_status_mask_setgroup,
&hf_afs_fs_status_mask_setmode,
&hf_afs_fs_status_mask_setsegsize,
&hf_afs_fs_status_mask_fsync,
NULL
};
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
ett_afs_status, "%s", label);
proto_tree_add_bitmask(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor),
hf_afs_fs_status_mask, ett_afs_status_mask, status_mask_flags, ENC_BIG_ENDIAN);
ptvcursor_advance(cursor, 4);
OUT_TIMESECS(cursor, hf_afs_fs_status_clientmodtime);
ptvcursor_add(cursor, hf_afs_fs_status_owner, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_group, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_mode, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_segsize, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output a FetchStatus */
static void OUT_FS_AFSFetchStatus(ptvcursor_t *cursor, const char* label)
{
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
ett_afs_status, "%s", label);
ptvcursor_add(cursor, hf_afs_fs_status_interfaceversion, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_filetype, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_linkcount, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_length, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_dataversion, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_author, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_owner, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_calleraccess, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_anonymousaccess, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_mode, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_parentvnode, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_parentunique, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_segsize, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_fs_status_clientmodtime);
OUT_TIMESECS(cursor, hf_afs_fs_status_servermodtime);
ptvcursor_add(cursor, hf_afs_fs_status_group, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_synccounter, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_dataversionhigh, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_spare2, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_spare3, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_status_spare4, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output a VolSync */
static void OUT_FS_AFSVolSync(ptvcursor_t *cursor)
{
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
ett_afs_status, "VolSync");
OUT_TIMESECS(cursor, hf_afs_fs_volsync_spare1);
ptvcursor_add(cursor, hf_afs_fs_volsync_spare2, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_volsync_spare3, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_volsync_spare4, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_volsync_spare5, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_volsync_spare6, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
/* Output a AFS acl */
#define ACLOUT(who, positive, acl, bytes) \
{ proto_tree *save; \
int tmpoffset; \
int acllen; \
char tmp[10]; \
tmp[0] = 0; \
if ( acl & PRSFS_READ ) (void) g_strlcat(tmp, "r", 10); \
if ( acl & PRSFS_LOOKUP ) (void) g_strlcat(tmp, "l", 10); \
if ( acl & PRSFS_INSERT ) (void) g_strlcat(tmp, "i", 10); \
if ( acl & PRSFS_DELETE ) (void) g_strlcat(tmp, "d", 10); \
if ( acl & PRSFS_WRITE ) (void) g_strlcat(tmp, "w", 10); \
if ( acl & PRSFS_LOCK ) (void) g_strlcat(tmp, "k", 10); \
if ( acl & PRSFS_ADMINISTER ) (void) g_strlcat(tmp, "a", 10); \
save = tree; \
tree = proto_tree_add_subtree_format(tree, tvb, offset, bytes, \
ett_afs_acl, NULL, "ACL: %s %s%s", \
who, tmp, positive ? "" : " (negative)"); \
proto_tree_add_string(tree,hf_afs_fs_acl_entity, tvb,offset,(int)strlen(who), who);\
tmpoffset = offset + (int)strlen(who) + 1; \
acllen = bytes - (int)strlen(who) - 1; \
proto_tree_add_boolean(tree,hf_afs_fs_acl_r, tvb,tmpoffset,acllen,acl);\
proto_tree_add_boolean(tree,hf_afs_fs_acl_l, tvb,tmpoffset,acllen,acl);\
proto_tree_add_boolean(tree,hf_afs_fs_acl_i, tvb,tmpoffset,acllen,acl);\
proto_tree_add_boolean(tree,hf_afs_fs_acl_d, tvb,tmpoffset,acllen,acl);\
proto_tree_add_boolean(tree,hf_afs_fs_acl_w, tvb,tmpoffset,acllen,acl);\
proto_tree_add_boolean(tree,hf_afs_fs_acl_k, tvb,tmpoffset,acllen,acl);\
proto_tree_add_boolean(tree,hf_afs_fs_acl_a, tvb,tmpoffset,acllen,acl);\
tree = save; \
}
/* output a bozo_key */
static void OUT_BOS_KEYINFO(ptvcursor_t *cursor)
{
OUT_TIMESTAMP(cursor, hf_afs_bos_keymodtime);
ptvcursor_add(cursor, hf_afs_bos_keychecksum, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_bos_keyspare2, 4, ENC_BIG_ENDIAN);
}
/* output a ubik interface addr array */
static void OUT_UBIK_InterfaceAddrs(ptvcursor_t *cursor)
{
unsigned int i,j,seen_null=0;
for (i=0; i<255; i++) {
j = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
if ( j != 0 ) {
ptvcursor_add(cursor, hf_afs_ubik_interface, 4, ENC_BIG_ENDIAN);
seen_null = 0;
} else {
if ( ! seen_null ) {
ptvcursor_add_no_advance(cursor, hf_afs_ubik_null_addresses, -1, ENC_NA);
seen_null = 1;
}
ptvcursor_advance(cursor, 4);
}
}
}
/* Output a UBIK version code */
static void OUT_UBIKVERSION(ptvcursor_t *cursor, const char* label)
{
unsigned int epoch,counter;
nstime_t ts;
epoch = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
counter = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor)+4);
ts.secs = epoch;
ts.nsecs = 0;
ptvcursor_add_text_with_subtree(cursor, SUBTREE_UNDEFINED_LENGTH,
ett_afs_ubikver, "UBIK Version (%s): %u.%u", label, epoch, counter);
if ( epoch != 0 )
proto_tree_add_time(ptvcursor_tree(cursor), hf_afs_ubik_version_epoch, ptvcursor_tvbuff(cursor),
ptvcursor_current_offset(cursor), 4, &ts);
else
proto_tree_add_time_format_value(ptvcursor_tree(cursor), hf_afs_ubik_version_epoch, ptvcursor_tvbuff(cursor),
ptvcursor_current_offset(cursor), 4, &ts, "0");
ptvcursor_advance(cursor, 4);
ptvcursor_add(cursor, hf_afs_ubik_version_counter, 4, ENC_BIG_ENDIAN);
ptvcursor_pop_subtree(cursor);
}
static void OUT_UBIK_DebugOld(ptvcursor_t *cursor)
{
OUT_TIMESECS(cursor, hf_afs_ubik_now);
OUT_TIMESECS(cursor, hf_afs_ubik_lastyestime);
ptvcursor_add(cursor, hf_afs_ubik_lastyeshost, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_lastyesstate, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_ubik_lastyesclaim);
ptvcursor_add(cursor, hf_afs_ubik_lowesthost, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_ubik_lowesttime);
ptvcursor_add(cursor, hf_afs_ubik_synchost, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_ubik_synctime);
OUT_UBIKVERSION(cursor, "Sync Version");
OUT_UBIKVERSION(cursor, "Sync TID");
ptvcursor_add(cursor, hf_afs_ubik_amsyncsite, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_ubik_syncsiteuntil);
ptvcursor_add(cursor, hf_afs_ubik_nservers, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_lockedpages, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_writelockedpages, 4, ENC_BIG_ENDIAN);
OUT_UBIKVERSION(cursor, "Local Version");
ptvcursor_add(cursor, hf_afs_ubik_activewrite, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_tidcounter, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_anyreadlocks, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_anywritelocks, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_recoverystate, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_currenttrans, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_writetrans, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_ubik_epochtime);
}
static void OUT_UBIK_SDebugOld(ptvcursor_t *cursor)
{
ptvcursor_add(cursor, hf_afs_ubik_addr, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_ubik_lastvotetime);
OUT_TIMESECS(cursor, hf_afs_ubik_lastbeaconsent);
ptvcursor_add(cursor, hf_afs_ubik_lastvote, 4, ENC_BIG_ENDIAN);
OUT_UBIKVERSION(cursor, "Remote Version");
ptvcursor_add(cursor, hf_afs_ubik_currentdb, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_beaconsincedown, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_up, 4, ENC_BIG_ENDIAN);
}
/* Output a kauth getticket request */
static void OUT_KAUTH_GetTicket(ptvcursor_t *cursor)
{
int len;
ptvcursor_add(cursor, hf_afs_kauth_kvno, 4, ENC_BIG_ENDIAN);
OUT_RXString(cursor, hf_afs_kauth_domain);
len = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_advance(cursor, 4);
ptvcursor_add(cursor, hf_afs_kauth_data, len, ENC_NA);
OUT_RXString(cursor, hf_afs_kauth_princ);
OUT_RXString(cursor, hf_afs_kauth_realm);
}
#define VALID_OPCODE(opcode) ((opcode >= OPCODE_LOW && opcode <= OPCODE_HIGH) || \
(opcode >= VOTE_LOW && opcode <= VOTE_HIGH) || \
(opcode >= DISK_LOW && opcode <= DISK_HIGH))
static const value_string fs_req[] = {
{ 130, "fetch-data" },
{ 131, "fetch-acl" },
{ 132, "fetch-status" },
{ 133, "store-data" },
{ 134, "store-acl" },
{ 135, "store-status" },
{ 136, "remove-file" },
{ 137, "create-file" },
{ 138, "rename" },
{ 139, "symlink" },
{ 140, "link" },
{ 141, "makedir" },
{ 142, "rmdir" },
{ 143, "old-set-lock" },
{ 144, "old-extend-lock" },
{ 145, "old-release-lock" },
{ 146, "get-stats" },
{ 147, "give-up-callbacks" },
{ 148, "get-volume-info" },
{ 149, "get-volume-status" },
{ 150, "set-volume-status" },
{ 151, "get-root-volume" },
{ 152, "check-token" },
{ 153, "get-time" },
{ 154, "nget-volume-info" },
{ 155, "bulk-status" },
{ 156, "set-lock" },
{ 157, "extend-lock" },
{ 158, "release-lock" },
{ 159, "xstats-version" },
{ 160, "get-xstats" },
{ 161, "dfs-lookup" },
{ 162, "dfs-flushcps" },
{ 163, "dfs-symlink" },
/* 164-219 are reserved legacy space */
{ 220, "residency" },
/* 221-65535 are reserved legacy space */
{ 65536, "inline-bulk-status" },
{ 65537, "fetch-data-64" },
{ 65538, "store-data-64" },
{ 65539, "give-up-all-callbacks" },
{ 65540, "get-capabilities" },
{ 65541, "call-back-rxconn-addr" },
{ 65542, "get-statistics-64" },
{ 0, NULL },
};
static value_string_ext fs_req_ext = VALUE_STRING_EXT_INIT(fs_req);
static const value_string cb_req[] = {
{ 204, "callback" },
{ 205, "init-callback-state" },
{ 206, "probe" },
{ 207, "get-lock" },
{ 208, "get-ce" },
{ 209, "xstats-version" },
{ 210, "get-xstats" },
{ 211, "init-callback-state2" },
{ 212, "who-are-you" },
{ 213, "init-callback-state3" },
{ 214, "probeuuid" },
{ 215, "get-server-prefs" },
{ 216, "get-cellservdb" },
{ 217, "get-local-cell" },
{ 218, "get-cache-config" },
/* 219-65535 reserved legacy space */
{ 65536, "get-ce-64" },
{ 65537, "get-cell-by-num" },
{ 65538, "get-capabilities" },
{ 0, NULL },
};
static value_string_ext cb_req_ext = VALUE_STRING_EXT_INIT(cb_req);
static const value_string prot_req[] = {
{ 500, "new-user" },
{ 501, "where-is-it" },
{ 502, "dump-entry" },
{ 503, "add-to-group" },
{ 504, "name-to-id" },
{ 505, "id-to-name" },
{ 506, "delete" },
{ 507, "remove-from-group" },
{ 508, "get-cps" },
{ 509, "new-entry" },
{ 510, "list-max" },
{ 511, "set-max" },
{ 512, "list-entry" },
{ 513, "change-entry" },
{ 514, "list-elements" },
{ 515, "is-member-of" },
{ 516, "set-fld-sentry" },
{ 517, "list-owned" },
{ 518, "get-cps2" },
{ 519, "get-host-cps" },
{ 520, "update-entry" },
{ 521, "list-entries" },
/* 522-529 are reserved legacy space */
{ 530, "list-supergroups" },
{ 0, NULL },
};
static value_string_ext prot_req_ext = VALUE_STRING_EXT_INIT(prot_req);
static const value_string vldb_req[] = {
{ 501, "create-entry" },
{ 502, "delete-entry" },
{ 503, "get-entry-by-id" },
{ 504, "get-entry-by-name" },
{ 505, "get-new-volume-id" },
{ 506, "replace-entry" },
{ 507, "update-entry" },
{ 508, "set-lock" },
{ 509, "release-lock" },
{ 510, "list-entry" },
{ 511, "list-attributes" },
{ 512, "linked-list" },
{ 513, "get-stats" },
{ 514, "probe" },
{ 515, "get-addrs" },
{ 516, "change-addr" },
{ 517, "create-entry-n" },
{ 518, "get-entry-by-id-n" },
{ 519, "get-entry-by-name-n" },
{ 520, "replace-entry-n" },
{ 521, "list-entry-n" },
{ 522, "list-attrib-n" },
{ 523, "linked-list-n" },
{ 524, "update-entry-by-name" },
{ 525, "create-entry-u" },
{ 526, "get-entry-by-id-u" },
{ 527, "get-entry-by-name-u" },
{ 528, "replace-entry-u" },
{ 529, "list-entry-u" },
{ 530, "list-attrib-u" },
{ 531, "linked-list-u" },
{ 532, "regaddr" },
{ 533, "get-addrs-u" },
{ 534, "list-attrib-n2" },
{ 0, NULL },
};
static value_string_ext vldb_req_ext = VALUE_STRING_EXT_INIT(vldb_req);
static const value_string kauth_req[] = {
{ 1, "auth-old" },
{ 2, "change-pw" },
{ 3, "get-ticket-old" },
{ 4, "set-pw" },
{ 5, "set-fields" },
{ 6, "create-user" },
{ 7, "delete-user" },
{ 8, "get-entry" },
{ 9, "list-entry" },
{ 10, "get-stats" },
{ 11, "debug" },
{ 12, "get-pw" },
{ 13, "get-random-key" },
{ 14, "unlock" },
{ 15, "lock-status" },
{ 21, "authenticate" },
{ 22, "authenticate-v2" },
{ 23, "get-ticket" },
{ 0, NULL },
};
static value_string_ext kauth_req_ext = VALUE_STRING_EXT_INIT(kauth_req);
static const value_string vol_req[] = {
{ 100, "create-volume" },
{ 101, "delete-volume" },
{ 102, "restore" },
{ 103, "forward" },
{ 104, "end-trans" },
{ 105, "clone" },
{ 106, "set-flags" },
{ 107, "get-flags" },
{ 108, "trans-create" },
{ 109, "dump" },
{ 110, "get-nth-volume" },
{ 111, "set-forwarding" },
{ 112, "get-name" },
{ 113, "get-status" },
{ 114, "sig-restore" },
{ 115, "list-partitions" },
{ 116, "list-volumes" },
{ 117, "set-id-types" },
{ 118, "monitor" },
{ 119, "partition-info" },
{ 120, "reclone" },
{ 121, "list-one-volume" },
{ 122, "nuke" },
{ 123, "set-date" },
{ 124, "x-list-volumes" },
{ 125, "x-list-one-volume" },
{ 126, "set-info" },
{ 127, "x-list-partitions" },
{ 128, "forward-multiple" },
{ 65536, "convert-ro" },
{ 65537, "getsize" },
{ 65538, "dump-v2" },
{ 65539, "partition-info-64" },
{ 0, NULL },
};
static value_string_ext vol_req_ext = VALUE_STRING_EXT_INIT(vol_req);
static const value_string bos_req[] = {
{ 80, "create-bnode" },
{ 81, "delete-bnode" },
{ 82, "set-status" },
{ 83, "get-status" },
{ 84, "enumerate-instance" },
{ 85, "get-instance-info" },
{ 86, "get-instance-parm" },
{ 87, "add-superuser" },
{ 88, "delete-superuser" },
{ 89, "list-superusers" },
{ 90, "list-keys" },
{ 91, "add-key" },
{ 92, "delete-key" },
{ 93, "set-cell-name" },
{ 94, "get-cell-name" },
{ 95, "get-cell-host" },
{ 96, "add-cell-host" },
{ 97, "delete-cell-host" },
{ 98, "set-t-status" },
{ 99, "shutdown-all" },
{ 100, "restart-all" },
{ 101, "startup-all" },
{ 102, "set-noauth-flag" },
{ 103, "re-bozo" },
{ 104, "restart" },
{ 105, "install" },
{ 106, "uninstall" },
{ 107, "get-dates" },
{ 108, "exec" },
{ 109, "prune" },
{ 110, "set-restart-time" },
{ 111, "get-restart-time" },
{ 112, "get-log" },
{ 113, "wait-all" },
{ 114, "get-instance-strings" },
{ 115, "get-restricted" },
{ 116, "set restricted" },
{ 0, NULL },
};
static value_string_ext bos_req_ext = VALUE_STRING_EXT_INIT(bos_req);
static const value_string update_req[] = {
{ 1, "fetch-file" },
{ 2, "fetch-info" },
{ 0, NULL },
};
static value_string_ext update_req_ext = VALUE_STRING_EXT_INIT(update_req);
static const value_string rmtsys_req[] = {
{ 1, "setpag" },
{ 2, "pioctl" },
{ 0, NULL },
};
static value_string_ext rmtsys_req_ext = VALUE_STRING_EXT_INIT(rmtsys_req);
static const value_string backup_req[] = {
{ 0, "add-volume" },
{ 1, "create-dump" },
{ 2, "delete-dump" },
{ 3, "delete-tape" },
{ 4, "delete-vdp" },
{ 5, "find-clone" },
{ 6, "find-dump" },
{ 7, "find-latest-dump" },
{ 8, "make-dump-appended" },
{ 9, "find-last-tape" },
{ 10, "finish-dump" },
{ 11, "finish-tape" },
{ 12, "get-dumps" },
{ 13, "get-tapes" },
{ 14, "get-volumes" },
{ 15, "use-tape" },
{ 16, "get-text" },
{ 17, "get-text-version" },
{ 18, "save-text" },
{ 19, "free-all-locks" },
{ 20, "free-lock" },
{ 21, "get-instance-id" },
{ 22, "get-lock" },
{ 23, "db-verify" },
{ 24, "dump-db" },
{ 25, "restore-db-header" },
{ 26, "t-get-version" },
{ 27, "t-dump-hash-table" },
{ 28, "t-dump-database" },
{ 29, "add-volumes" },
{ 30, "list-dumps" },
{ 0, NULL },
};
static value_string_ext backup_req_ext = VALUE_STRING_EXT_INIT(backup_req);
static const value_string butc_req[] = {
{ 100, "perform-dump" },
{ 101, "perform-restore" },
{ 102, "check-dump" },
{ 103, "abort-dump" },
{ 104, "wait-for-dump" },
{ 105, "end-dump" },
{ 106, "get-tm-info" },
{ 107, "label-tape" },
{ 108, "scan-nodes" },
{ 109, "read-label" },
{ 110, "scan-dumps" },
{ 111, "get-tc-info" },
{ 112, "save-database" },
{ 113, "restore-database" },
{ 114, "get-status" },
{ 115, "request-abort" },
{ 116, "end-status" },
{ 117, "scan-status" },
{ 118, "delete-dump" },
{ 0, NULL },
};
static value_string_ext butc_req_ext = VALUE_STRING_EXT_INIT(butc_req);
static const value_string ubik_req[] = {
{ 10000, "vote-beacon" },
{ 10001, "vote-debug-old" },
{ 10002, "vote-sdebug-old" },
{ 10003, "vote-getsyncsite" },
{ 10004, "vote-debug" },
{ 10005, "vote-sdebug" },
{ 10006, "vote-xdebug" },
{ 10007, "vote-xsdebug" },
{ 20000, "disk-begin" },
{ 20001, "disk-commit" },
{ 20002, "disk-lock" },
{ 20003, "disk-write" },
{ 20004, "disk-getversion" },
{ 20005, "disk-getfile" },
{ 20006, "disk-sendfile" },
{ 20007, "disk-abort" },
{ 20008, "disk-releaselocks" },
{ 20009, "disk-truncate" },
{ 20010, "disk-probe" },
{ 20011, "disk-writev" },
{ 20012, "disk-interfaceaddr" },
{ 20013, "disk-setversion" },
{ 0, NULL },
};
static value_string_ext ubik_req_ext = VALUE_STRING_EXT_INIT(ubik_req);
static const value_string cb_types[] = {
{ CB_TYPE_EXCLUSIVE, "exclusive" },
{ CB_TYPE_SHARED, "shared" },
{ CB_TYPE_DROPPED, "dropped" },
{ 0, NULL },
};
static const value_string afs_errors[] = {
/* KAUTH Errors */
{ 180480, "Database Inconsistent"},
{ 180481, "Exists"},
{ 180482, "IO"},
{ 180483, "Create Failed"},
{ 180484, "noent"},
{ 180485, "Empty"},
{ 180486, "Bad Name"},
{ 180487, "Bad Index"},
{ 180488, "No auth"},
{ 180489, "Answer too long"},
{ 180490, "Bad Request"},
{ 180491, "Old Interface"},
{ 180492, "Bad Argument"},
{ 180493, "Bad Command"},
{ 180494, "No keys"},
{ 180495, "Read PW"},
{ 180496, "Bad key"},
{ 180497, "Ubik Init"},
{ 180498, "Ubik Call"},
{ 180499, "Bad Protocol"},
{ 180500, "No cells"},
{ 180501, "No cell"},
{ 180502, "Too many ubiks"},
{ 180503, "Too many keys"},
{ 180504, "Bad ticket"},
{ 180505, "Unknown Key"},
{ 180506, "Key Cache Invalid"},
{ 180507, "Bad Server"},
{ 180508, "Bad User"},
{ 180509, "Bad CPW"},
{ 180510, "Bad Create"},
{ 180511, "No ticket"},
{ 180512, "Assoc user"},
{ 180513, "Not special"},
{ 180514, "Clock skew too great"},
{ 180515, "No recursion"},
{ 180516, "RX failed"},
{ 180517, "Null password"},
{ 180518, "Internal error"},
{ 180519, "Password expired"},
{ 180520, "Reused"},
{ 180521, "Too soon"},
{ 180522, "Locked"},
/* PT Errors */
{ 267264, "Exists"},
{ 267265, "ID Exists"},
{ 267266, "No IDs"},
{ 267267, "DB Failed"},
{ 267268, "No such entry"},
{ 267269, "Permission denied"},
{ 267270, "Not group"},
{ 267271, "Not user"},
{ 267272, "Bad name"},
{ 267273, "Bad argument"},
{ 267274, "No more"},
{ 267275, "Bad DB"},
{ 267276, "Group empty"},
{ 267277, "Inconsistent"},
{ 267278, "DB Address"},
{ 267279, "Too many"},
{ 267280, "No memory"},
/* VOL Errors */
{ 363520, "ID Exists"},
{ 363521, "IO Error"},
{ 363522, "Name Exists"},
{ 363523, "Create Failed"},
{ 363524, "Entry Not Found"},
{ 363525, "Empty"},
{ 363526, "Entry Deleted"},
{ 363527, "Bad Name"},
{ 363528, "Bad Index"},
{ 363529, "Bad Volume Type"},
{ 363530, "Bad Partition"},
{ 363531, "Bad Server"},
{ 363532, "Bad Replicate Server"},
{ 363533, "No Replicate Server"},
{ 363534, "Duplicate Replicate Server"},
{ 363535, "ReadWrite Volume Not Found"},
{ 363536, "Bad Reference Count"},
{ 363537, "Size Exceeded"},
{ 363538, "Bad Entry"},
{ 363539, "Bad Volume ID Bump"},
{ 363540, "Already has edit"},
{ 363541, "Entry Locked"},
{ 363542, "Bad Volume Operation"},
{ 363543, "Bad Rel Lock Type"},
{ 363544, "Rerelease"},
{ 363545, "Bad Server"},
{ 363546, "Permission Denied"},
{ 363547, "Out of Memory"},
/* Volume server errors */
{ 1492325120, "Release error"},
{ 1492325121, "No op"},
{ 1492325122, "Read dump error"},
{ 1492325123, "Dump error"},
{ 1492325124, "Attach error"},
{ 1492325125, "Illegal partition"},
{ 1492325126, "Detach error"},
{ 1492325127, "Bad access"},
{ 1492325128, "VLDB error"},
{ 1492325129, "Bad Name"},
{ 1492325130, "Volume moved"},
{ 1492325131, "Bad operation"},
{ 1492325132, "Bad release"},
{ 1492325133, "Volume busy"},
{ 1492325134, "No memory"},
{ 1492325135, "No volume"},
{ 1492325136, "Multiple RW volumes"},
{ 1492325137, "Failed operation"},
/* add more of these errors to decode the errcode responses */
{ 0, NULL },
};
static value_string_ext afs_errors_ext = VALUE_STRING_EXT_INIT(afs_errors);
static const value_string port_types[] = {
{ AFS_PORT_FS, "File Server" },
{ AFS_PORT_CB, "Callback Server" },
{ AFS_PORT_PROT, "Protection Server" },
{ AFS_PORT_VLDB, "Volume Location Database Server" },
{ AFS_PORT_KAUTH, "Kerberos Authentication Server" },
{ AFS_PORT_VOL, "Volume Server" },
{ AFS_PORT_ERROR, "Error Server" },
{ AFS_PORT_BOS, "BOS Server" },
{ AFS_PORT_UPDATE, "Update? Server" },
{ AFS_PORT_RMTSYS, "Rmtsys? Server" },
{ AFS_PORT_BACKUP, "Backup Server" },
{ AFS_PORT_BUTC, "Backup Tape Controller" },
{ 0, NULL }
};
static value_string_ext port_types_ext = VALUE_STRING_EXT_INIT(port_types);
static const value_string port_types_short[] = {
{ AFS_PORT_FS, "FS" },
{ AFS_PORT_CB, "CB" },
{ AFS_PORT_PROT, "PROT" },
{ AFS_PORT_VLDB, "VLDB" },
{ AFS_PORT_KAUTH, "KAUTH" },
{ AFS_PORT_VOL, "VOL" },
{ AFS_PORT_ERROR, "ERR" },
{ AFS_PORT_BOS, "BOS" },
{ AFS_PORT_UPDATE, "UPD" },
{ AFS_PORT_RMTSYS, "RMT" },
{ AFS_PORT_BACKUP, "BKUP" },
{ AFS_PORT_BUTC, "BUTC" },
{ 0, NULL }
};
static value_string_ext port_types_short_ext = VALUE_STRING_EXT_INIT(port_types_short);
static const value_string ubik_lock_types[] = {
{ 1, "read" },
{ 2, "write" },
{ 3, "wait" },
{ 0, NULL },
};
static const value_string xstat_collections[] = {
{ 0, "call counting & info" },
{ 1, "performance info" },
{ 2, "full performance info" },
{ 0, NULL },
};
static const value_string vice_lock_types[] = {
{ 0, "read" },
{ 1, "write" },
{ 2, "extend" },
{ 3, "release" },
{ 0, NULL },
};
static const value_string volume_types[] = {
{ 0, "read-write" },
{ 1, "read-only" },
{ 2, "backup" },
{ 0xffffffff, "any" },
{ 0, NULL },
};
struct afs_request_key {
uint32_t conversation, epoch, cid, callnumber;
uint16_t service;
};
struct afs_request_val {
uint32_t opcode;
unsigned req_num;
unsigned rep_num;
nstime_t req_time;
};
static wmem_map_t *afs_request_hash;
static reassembly_table afs_reassembly_table;
/*
* Hash Functions
*/
static int
afs_equal(const void *v, const void *w)
{
const struct afs_request_key *v1 = (const struct afs_request_key *)v;
const struct afs_request_key *v2 = (const struct afs_request_key *)w;
if (v1 -> conversation == v2 -> conversation &&
v1 -> epoch == v2 -> epoch &&
v1 -> cid == v2 -> cid &&
v1 -> callnumber == v2 -> callnumber ) {
return 1;
}
return 0;
}
static unsigned
afs_hash (const void *v)
{
const struct afs_request_key *key = (const struct afs_request_key *)v;
unsigned val;
val = key -> conversation + key -> epoch + key -> cid + key -> callnumber;
return val;
}
/*
* Here is a helper routine for adding an AFS acl to the proto tree
* This is to be used with FS packets only
*
* An AFS ACL is a string that has the following format:
*
* <positive> <negative>
* <uid1> <aclbits1>
* ....
*
* "positive" and "negative" are integers which contain the number of
* positive and negative ACL's in the string. The uid/aclbits pair are
* ASCII strings containing the UID/PTS record and a ascii number
* representing a logical OR of all the ACL permission bits
*/
/*
* XXX - FIXME:
*
* sscanf is probably quite dangerous if we run outside the packet.
*
* Should this just scan the string itself, rather than using "sscanf()"?
*/
#define GETSTR (tvb_format_text(wmem_packet_scope(),tvb,ptvcursor_current_offset(cursor),tvb_captured_length_remaining(tvb,ptvcursor_current_offset(cursor))))
static void
dissect_acl(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_)
{
int old_offset = ptvcursor_current_offset(cursor), offset;
int32_t bytes;
int i, n, pos, neg, acl;
proto_tree* tree = ptvcursor_tree(cursor);
tvbuff_t* tvb = ptvcursor_tvbuff(cursor);
char user[128] = "[Unknown]"; /* Be sure to adjust sscanf()s below if length is changed... */
bytes = tvb_get_ntohl(tvb, ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_fs_acl_datasize, 4, ENC_BIG_ENDIAN);
if (sscanf(GETSTR, "%d %n", &pos, &n) != 1) {
/* does not matter what we return, if this fails,
* we can't dissect anything else in the packet either.
*/
return;
}
proto_tree_add_uint(tree, hf_afs_fs_acl_count_positive, tvb,
ptvcursor_current_offset(cursor), n, pos);
ptvcursor_advance(cursor, n);
if (sscanf(GETSTR, "%d %n", &neg, &n) != 1) {
return;
}
proto_tree_add_uint(tree, hf_afs_fs_acl_count_negative, tvb,
ptvcursor_current_offset(cursor), n, neg);
ptvcursor_advance(cursor, n);
/*
* This wacky order preserves the order used by the "fs" command
*/
offset = ptvcursor_current_offset(cursor);
for (i = 0; i < pos; i++) {
if (sscanf(GETSTR, "%127s %d %n", user, &acl, &n) != 2) {
return;
}
ACLOUT(user,1,acl,n);
offset += n;
}
for (i = 0; i < neg; i++) {
if (sscanf(GETSTR, "%127s %d %n", user, &acl, &n) != 2) {
return;
}
ACLOUT(user,0,acl,n);
offset += n;
if (offset >= old_offset+bytes ) {
return;
}
}
}
/*
* Here are the helper dissection routines
*/
static void
dissect_fs_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
{
switch ( opcode )
{
case 130: /* fetch data */
OUT_FS_AFSFetchStatus(cursor, "Status");
OUT_FS_AFSCallBack(cursor);
OUT_FS_AFSVolSync(cursor);
ptvcursor_add(cursor, hf_afs_fs_data, -1, ENC_NA);
break;
case 131: /* fetch acl */
dissect_acl(cursor, rxinfo);
OUT_FS_AFSFetchStatus(cursor, "Status");
OUT_FS_AFSVolSync(cursor);
break;
case 132: /* Fetch status */
OUT_FS_AFSFetchStatus(cursor, "Status");
OUT_FS_AFSCallBack(cursor);
OUT_FS_AFSVolSync(cursor);
break;
case 133: /* Store data */
case 134: /* Store ACL */
case 135: /* Store status */
case 136: /* Remove file */
OUT_FS_AFSFetchStatus(cursor, "Status");
OUT_FS_AFSVolSync(cursor);
break;
case 137: /* create file */
case 141: /* make dir */
case 161: /* lookup */
case 163: /* dfs symlink */
OUT_FS_AFSFid(cursor, (opcode == 137)? "New File" : ((opcode == 141)? "New Directory" : "File"));
OUT_FS_AFSFetchStatus(cursor, "File Status");
OUT_FS_AFSFetchStatus(cursor, "Directory Status");
OUT_FS_AFSCallBack(cursor);
OUT_FS_AFSVolSync(cursor);
break;
case 138: /* rename */
OUT_FS_AFSFetchStatus(cursor, "Old Directory Status");
OUT_FS_AFSFetchStatus(cursor, "New Directory Status");
OUT_FS_AFSVolSync(cursor);
break;
case 139: /* symlink */
OUT_FS_AFSFid(cursor, "Symlink");
break;
case 140: /* link */
OUT_FS_AFSFetchStatus(cursor, "Link Status");
break;
case 142: /* rmdir */
OUT_FS_AFSFetchStatus(cursor, "Directory Status");
OUT_FS_AFSVolSync(cursor);
break;
case 143: /* old set lock */
case 144: /* old extend lock */
case 145: /* old release lock */
case 147: /* give up callbacks */
case 150: /* set volume status */
case 152: /* check token */
/* nothing returned */
break;
case 146: /* get statistics */
/* OUT_FS_ViceStatistics(); */
break;
case 148: /* get volume info */
case 154: /* n-get-volume-info */
/* OUT_FS_VolumeInfo(); */
break;
case 149: /* get volume status */
/* OUT_FS_AFSFetchVolumeStatus(); */
OUT_RXString(cursor, hf_afs_fs_volname);
OUT_RXString(cursor, hf_afs_fs_offlinemsg);
OUT_RXString(cursor, hf_afs_fs_motd);
break;
case 151: /* root volume */
OUT_RXString(cursor, hf_afs_fs_volname);
break;
case 153: /* get time */
OUT_TIMESTAMP(cursor, hf_afs_fs_timestamp);
break;
case 155: /* bulk status */
OUT_RXArray32(OUT_FS_AFSFetchStatus(cursor, "Status"));
ptvcursor_advance(cursor, 4); /* skip */
OUT_RXArray32(OUT_FS_AFSCallBack(cursor));
OUT_FS_AFSVolSync(cursor);
break;
case 156: /* set lock */
case 157: /* extend lock */
case 158: /* release lock */
OUT_FS_AFSVolSync(cursor);
break;
case 159: /* x-stats-version */
ptvcursor_add(cursor, hf_afs_fs_xstats_version, 4, ENC_BIG_ENDIAN);
break;
case 160: /* get xstats */
ptvcursor_add(cursor, hf_afs_fs_xstats_version, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_fs_xstats_timestamp);
/* OUT_FS_AFS_CollData(); */
break;
case 162: /* flush cps */
ptvcursor_add(cursor, hf_afs_fs_cps_spare2, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_cps_spare3, 4, ENC_BIG_ENDIAN);
break;
case 65536: /* inline bulk status */
OUT_RXArray32(OUT_FS_AFSFetchStatus(cursor, "Status"));
OUT_RXArray32(OUT_FS_AFSCallBack(cursor));
OUT_FS_AFSVolSync(cursor);
break;
}
}
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_fs_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_fs_request(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 130: /* Fetch data */
OUT_FS_AFSFid(cursor, "Source");
ptvcursor_add(cursor, hf_afs_fs_offset, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_length, 4, ENC_BIG_ENDIAN);
break;
case 131: /* Fetch ACL */
OUT_FS_AFSFid(cursor, "Target");
break;
case 132: /* Fetch Status */
OUT_FS_AFSFid(cursor, "Target");
break;
case 133: /* Store Data */
OUT_FS_AFSFid(cursor, "Destination");
OUT_FS_AFSStoreStatus(cursor, "Status");
ptvcursor_add(cursor, hf_afs_fs_offset, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_length, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_flength, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_data, -1, ENC_NA);
break;
case 134: /* Store ACL */
OUT_FS_AFSFid(cursor, "Target");
dissect_acl(cursor, rxinfo);
break;
case 135: /* Store Status */
OUT_FS_AFSFid(cursor, "Target");
OUT_FS_AFSStoreStatus(cursor, "Status");
break;
case 136: /* Remove File */
OUT_FS_AFSFid(cursor, "Remove File");
OUT_RXString(cursor, hf_afs_fs_name);
break;
case 137: /* Create File */
OUT_FS_AFSFid(cursor, "Target");
OUT_RXString(cursor, hf_afs_fs_name);
OUT_FS_AFSStoreStatus(cursor, "Status");
break;
case 138: /* Rename file */
OUT_FS_AFSFid(cursor, "Old");
OUT_RXString(cursor, hf_afs_fs_oldname);
OUT_FS_AFSFid(cursor, "New");
OUT_RXString(cursor, hf_afs_fs_newname);
break;
case 139: /* Symlink */
OUT_FS_AFSFid(cursor, "File");
OUT_RXString(cursor, hf_afs_fs_symlink_name);
OUT_RXString(cursor, hf_afs_fs_symlink_content);
OUT_FS_AFSStoreStatus(cursor, "Status");
break;
case 140: /* Link */
OUT_FS_AFSFid(cursor, "Link To (New File)");
OUT_RXString(cursor, hf_afs_fs_name);
OUT_FS_AFSFid(cursor, "Link From (Old File)");
break;
case 141: /* Make dir */
OUT_FS_AFSFid(cursor, "Target");
OUT_RXString(cursor, hf_afs_fs_name);
OUT_FS_AFSStoreStatus(cursor, "Status");
break;
case 142: /* Remove dir */
OUT_FS_AFSFid(cursor, "Target");
OUT_RXString(cursor, hf_afs_fs_name);
break;
case 143: /* Old Set Lock */
OUT_FS_AFSFid(cursor, "Target");
ptvcursor_add(cursor, hf_afs_fs_vicelocktype, 4, ENC_BIG_ENDIAN);
OUT_FS_AFSVolSync(cursor);
break;
case 144: /* Old Extend Lock */
OUT_FS_AFSFid(cursor, "Target");
OUT_FS_AFSVolSync(cursor);
break;
case 145: /* Old Release Lock */
OUT_FS_AFSFid(cursor, "Target");
OUT_FS_AFSVolSync(cursor);
break;
case 146: /* Get statistics */
/* no params */
break;
case 147: /* Give up callbacks */
OUT_RXArray32(OUT_FS_AFSFid(cursor, "Target"));
OUT_RXArray32(OUT_FS_AFSCallBack(cursor));
break;
case 148: /* Get vol info */
OUT_RXString(cursor, hf_afs_fs_volname);
break;
case 149: /* Get vol stats */
ptvcursor_add(cursor, hf_afs_fs_volid, 4, ENC_BIG_ENDIAN);
break;
case 150: /* Set vol stats */
ptvcursor_add(cursor, hf_afs_fs_volid, 4, ENC_BIG_ENDIAN);
/* OUT_FS_AFSStoreVolumeStatus(); */
OUT_RXString(cursor, hf_afs_fs_volname);
OUT_RXString(cursor, hf_afs_fs_offlinemsg);
OUT_RXString(cursor, hf_afs_fs_motd);
break;
case 151: /* get root volume */
/* no params */
break;
case 152: /* check token */
ptvcursor_add(cursor, hf_afs_fs_viceid, 4, ENC_BIG_ENDIAN);
/* Output an AFS Token - might just be bytes though */
OUT_RXStringV(cursor, hf_afs_fs_token, 1024);
break;
case 153: /* get time */
/* no params */
break;
case 154: /* new get vol info */
OUT_RXString(cursor, hf_afs_fs_volname);
break;
case 155: /* bulk stat */
OUT_RXArray32(OUT_FS_AFSFid(cursor, "Target"));
break;
case 156: /* Set Lock */
OUT_FS_AFSFid(cursor, "Target");
ptvcursor_add(cursor, hf_afs_fs_vicelocktype, 4, ENC_BIG_ENDIAN);
break;
case 157: /* Extend Lock */
OUT_FS_AFSFid(cursor, "Target");
break;
case 158: /* Release Lock */
OUT_FS_AFSFid(cursor, "Target");
break;
case 159: /* xstats version */
/* no params */
break;
case 160: /* get xstats */
ptvcursor_add(cursor, hf_afs_fs_xstats_clientversion, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_xstats_collnumber, 4, ENC_BIG_ENDIAN);
break;
case 161: /* lookup */
OUT_FS_AFSFid(cursor, "Target");
OUT_RXString(cursor, hf_afs_fs_name);
break;
case 162: /* flush cps */
OUT_RXArray8(cursor, hf_afs_fs_viceid, 4, ENC_BIG_ENDIAN);
OUT_RXArray8(cursor, hf_afs_fs_ipaddr, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_cps_spare1, 4, ENC_BIG_ENDIAN);
break;
case 163: /* dfs symlink */
OUT_FS_AFSFid(cursor, "Target");
OUT_RXString(cursor, hf_afs_fs_symlink_name);
OUT_RXString(cursor, hf_afs_fs_symlink_content);
OUT_FS_AFSStoreStatus(cursor, "Symlink Status");
break;
case 220: /* residencycmd */
OUT_FS_AFSFid(cursor, "Target");
/* need residency inputs here */
break;
case 65536: /* inline bulk status */
OUT_RXArray32(OUT_FS_AFSFid(cursor, "Target"));
break;
case 65537: /* fetch-data-64 */
OUT_FS_AFSFid(cursor, "Target");
ptvcursor_add(cursor, hf_afs_fs_offset64, 8, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_length64, 8, ENC_BIG_ENDIAN);
/* need more here */
break;
case 65538: /* store-data-64 */
OUT_FS_AFSFid(cursor, "Target");
OUT_FS_AFSStoreStatus(cursor, "Status");
ptvcursor_add(cursor, hf_afs_fs_offset64, 8, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_length64, 8, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_fs_flength64, 8, ENC_BIG_ENDIAN);
/* need residency inputs here */
break;
case 65539: /* give up all cbs */
break;
case 65540: /* get capabilities */
break;
}
}
/*
* BOS Helpers
*/
static void
dissect_bos_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
{
switch ( opcode )
{
case 80: /* create bnode */
/* no output */
break;
case 81: /* delete bnode */
/* no output */
break;
case 82: /* set status */
/* no output */
break;
case 83: /* get status */
ptvcursor_add(cursor, hf_afs_bos_status, 4, ENC_BIG_ENDIAN);
OUT_RXString(cursor, hf_afs_bos_statusdesc);
break;
case 84: /* enumerate instance */
OUT_RXString(cursor, hf_afs_bos_instance);
break;
case 85: /* get instance info */
OUT_RXString(cursor, hf_afs_bos_type);
ptvcursor_advance(cursor, 4*10);
break;
case 86: /* get instance parm */
OUT_RXString(cursor, hf_afs_bos_parm);
break;
case 87: /* add siperuser */
/* no output */
break;
case 88: /* delete superuser */
/* no output */
break;
case 89: /* list superusers */
OUT_RXString(cursor, hf_afs_bos_user);
break;
case 90: /* list keys */
ptvcursor_add(cursor, hf_afs_bos_kvno, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_bos_key, 8, ENC_NA);
OUT_BOS_KEYINFO(cursor);
break;
case 91: /* add key */
/* no output */
break;
case 92: /* delete key */
/* no output */
break;
case 93: /* set cell name */
/* no output */
break;
case 94: /* get cell name */
OUT_RXString(cursor, hf_afs_bos_cell);
break;
case 95: /* get cell host */
OUT_RXString(cursor, hf_afs_bos_host);
break;
case 96: /* add cell host */
/* no output */
break;
case 97: /* delete cell host */
/* no output */
break;
case 98: /* set tstatus */
/* no output */
break;
case 99: /* shutdown all */
/* no output */
break;
case 100: /* restart all */
/* no output */
break;
case 101: /* startup all */
/* no output */
break;
case 102: /* set noauth flag */
/* no output */
break;
case 103: /* rebozo */
/* no output */
break;
case 104: /* restart */
/* no output */
break;
case 105: /* install */
/* no output */
break;
case 106: /* uninstall */
/* no output */
break;
case 107: /* get dates */
OUT_TIMESECS(cursor, hf_afs_bos_newtime);
OUT_TIMESECS(cursor, hf_afs_bos_baktime);
OUT_TIMESECS(cursor, hf_afs_bos_oldtime);
break;
case 108: /* exec */
/* no output */
break;
case 109: /* prune */
/* no output */
break;
case 110: /* set restart time */
/* no output */
break;
case 111: /* get restart time */
ptvcursor_advance(cursor, 12);
break;
case 112: /* get log */
/* need to make this dump a big string somehow */
ptvcursor_add(cursor, hf_afs_bos_data, -1, ENC_NA);
break;
case 113: /* wait all */
/* no output */
break;
case 114: /* get instance strings */
OUT_RXString(cursor, hf_afs_bos_error);
OUT_RXString(cursor, hf_afs_bos_spare1);
OUT_RXString(cursor, hf_afs_bos_spare2);
OUT_RXString(cursor, hf_afs_bos_spare3);
break;
}
}
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_bos_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_bos_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 80: /* create b node */
OUT_RXString(cursor, hf_afs_bos_type);
OUT_RXString(cursor, hf_afs_bos_instance);
OUT_RXString(cursor, hf_afs_bos_parm);
OUT_RXString(cursor, hf_afs_bos_parm);
OUT_RXString(cursor, hf_afs_bos_parm);
OUT_RXString(cursor, hf_afs_bos_parm);
OUT_RXString(cursor, hf_afs_bos_parm);
OUT_RXString(cursor, hf_afs_bos_parm);
break;
case 81: /* delete b node */
OUT_RXString(cursor, hf_afs_bos_instance);
break;
case 82: /* set status */
OUT_RXString(cursor, hf_afs_bos_instance);
ptvcursor_add(cursor, hf_afs_bos_status, 4, ENC_BIG_ENDIAN);
break;
case 83: /* get status */
OUT_RXString(cursor, hf_afs_bos_instance);
break;
case 84: /* enumerate instance */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
break;
case 85: /* get instance info */
OUT_RXString(cursor, hf_afs_bos_instance);
break;
case 86: /* get instance parm */
OUT_RXString(cursor, hf_afs_bos_instance);
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
break;
case 87: /* add super user */
OUT_RXString(cursor, hf_afs_bos_user);
break;
case 88: /* delete super user */
OUT_RXString(cursor, hf_afs_bos_user);
break;
case 89: /* list super users */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
break;
case 90: /* list keys */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
break;
case 91: /* add key */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_bos_key, 8, ENC_NA);
break;
case 92: /* delete key */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
break;
case 93: /* set cell name */
OUT_RXString(cursor, hf_afs_bos_content);
break;
case 95: /* set cell host */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
break;
case 96: /* add cell host */
OUT_RXString(cursor, hf_afs_bos_content);
break;
case 97: /* delete cell host */
OUT_RXString(cursor, hf_afs_bos_content);
break;
case 98: /* set t status */
OUT_RXString(cursor, hf_afs_bos_content);
ptvcursor_add(cursor, hf_afs_bos_status, 4, ENC_BIG_ENDIAN);
break;
case 99: /* shutdown all */
/* no params */
break;
case 100: /* restart all */
/* no params */
break;
case 101: /* startup all */
/* no params */
break;
case 102: /* set no-auth flag */
ptvcursor_add(cursor, hf_afs_bos_flags, 4, ENC_BIG_ENDIAN);
break;
case 103: /* re-bozo? */
/* no params */
break;
case 104: /* restart */
OUT_RXString(cursor, hf_afs_bos_instance);
break;
case 105: /* install */
OUT_RXString(cursor, hf_afs_bos_path);
ptvcursor_add(cursor, hf_afs_bos_size, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_bos_flags, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_bos_date, 4, ENC_BIG_ENDIAN);
break;
case 106: /* uninstall */
OUT_RXString(cursor, hf_afs_bos_path);
break;
case 107: /* get dates */
OUT_RXString(cursor, hf_afs_bos_path);
break;
case 108: /* exec */
OUT_RXString(cursor, hf_afs_bos_cmd);
break;
case 109: /* prune */
ptvcursor_add(cursor, hf_afs_bos_flags, 4, ENC_BIG_ENDIAN);
break;
case 110: /* set restart time */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
ptvcursor_advance(cursor, 12);
break;
case 111: /* get restart time */
ptvcursor_add(cursor, hf_afs_bos_num, 4, ENC_BIG_ENDIAN);
break;
case 112: /* get log */
OUT_RXString(cursor, hf_afs_bos_file);
break;
case 113: /* wait all */
/* no params */
break;
case 114: /* get instance strings */
OUT_RXString(cursor, hf_afs_bos_content);
break;
}
}
/*
* VOL Helpers
*/
static void
dissect_vol_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
{
switch ( opcode )
{
case 121:
/* should loop here maybe */
ptvcursor_add(cursor, hf_afs_vol_count, 4, ENC_BIG_ENDIAN);
OUT_RXStringV(cursor, hf_afs_vol_name, 32); /* not sure on */
break;
}
}
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_vol_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_vol_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 121: /* list one vol */
ptvcursor_add(cursor, hf_afs_vol_count, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vol_id, 4, ENC_BIG_ENDIAN);
break;
}
}
/*
* KAUTH Helpers
*/
static void
dissect_kauth_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
{
switch ( opcode )
{
}
}
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_kauth_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_kauth_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 1: /* authenticate old */
case 21: /* authenticate */
case 22: /* authenticate v2 */
case 2: /* change pw */
case 5: /* set fields */
case 6: /* create user */
case 7: /* delete user */
case 8: /* get entry */
case 14: /* unlock */
case 15: /* lock status */
OUT_RXString(cursor, hf_afs_kauth_princ);
OUT_RXString(cursor, hf_afs_kauth_realm);
ptvcursor_add(cursor, hf_afs_kauth_data, -1, ENC_NA);
break;
case 3: /* getticket-old */
case 23: /* getticket */
OUT_KAUTH_GetTicket(cursor);
break;
case 4: /* set pass */
OUT_RXString(cursor, hf_afs_kauth_princ);
OUT_RXString(cursor, hf_afs_kauth_realm);
ptvcursor_add(cursor, hf_afs_kauth_kvno, 4, ENC_BIG_ENDIAN);
break;
case 12: /* get pass */
OUT_RXString(cursor, hf_afs_kauth_name);
break;
}
}
/*
* CB Helpers
*/
static void
dissect_cb_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
{
switch ( opcode ) {
case 65538: /* get-capabilites */
OUT_CM_INTERFACES(cursor);
OUT_CM_CAPABILITIES(cursor);
break;
}
}
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_cb_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_cb_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 204: /* callback */
OUT_RXArray32(OUT_CB_AFSFid(cursor, "Target"));
OUT_RXArray32(OUT_CB_AFSCallBack(cursor));
break;
}
}
/*
* PROT Helpers
*/
static void
dissect_prot_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
{
switch ( opcode )
{
case 504: /* name to id */
{
unsigned int i, size;
size = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_prot_count, 4, ENC_BIG_ENDIAN);
for (i=0; i<size; i++)
{
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
}
}
break;
case 505: /* id to name */
{
unsigned int i, size;
size = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_prot_count, 4, ENC_BIG_ENDIAN);
for (i=0; i<size; i++)
{
OUT_RXStringV(cursor, hf_afs_prot_name, PRNAMEMAX);
}
}
break;
case 508: /* get cps */
case 514: /* list elements */
case 517: /* list owned */
case 518: /* get cps2 */
case 519: /* get host cps */
{
unsigned int i, size;
size = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_prot_count, 4, ENC_BIG_ENDIAN);
for (i=0; i<size; i++)
{
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
}
}
break;
case 510: /* list max */
ptvcursor_add(cursor, hf_afs_prot_maxuid, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_prot_maxgid, 4, ENC_BIG_ENDIAN);
break;
}
}
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_prot_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_prot_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 500: /* new user */
OUT_RXString(cursor, hf_afs_prot_name_uint_string);
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_prot_oldid, 4, ENC_BIG_ENDIAN);
break;
case 501: /* where is it */
case 506: /* delete */
case 508: /* get cps */
case 512: /* list entry */
case 514: /* list elements */
case 517: /* list owned */
case 519: /* get host cps */
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
break;
case 502: /* dump entry */
ptvcursor_add(cursor, hf_afs_prot_pos, 4, ENC_BIG_ENDIAN);
break;
case 503: /* add to group */
case 507: /* remove from group */
case 515: /* is a member of? */
ptvcursor_add(cursor, hf_afs_prot_uid, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_prot_gid, 4, ENC_BIG_ENDIAN);
break;
case 504: /* name to id */
{
unsigned int i, size;
size = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_prot_count, 4, ENC_BIG_ENDIAN);
for (i=0; i<size; i++)
{
OUT_RXStringV(cursor, hf_afs_prot_name,PRNAMEMAX);
}
}
break;
case 505: /* id to name */
{
unsigned int i, size;
size = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_prot_count, 4, ENC_BIG_ENDIAN);
for (i=0; i<size; i++)
{
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
}
}
break;
case 509: /* new entry */
OUT_RXString(cursor, hf_afs_prot_name_uint_string);
ptvcursor_add(cursor, hf_afs_prot_flag, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_prot_oldid, 4, ENC_BIG_ENDIAN);
break;
case 511: /* set max */
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_prot_flag, 4, ENC_BIG_ENDIAN);
break;
case 513: /* change entry */
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
OUT_RXString(cursor, hf_afs_prot_name_uint_string);
ptvcursor_add(cursor, hf_afs_prot_oldid, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_prot_newid, 4, ENC_BIG_ENDIAN);
break;
case 520: /* update entry */
ptvcursor_add(cursor, hf_afs_prot_id, 4, ENC_BIG_ENDIAN);
OUT_RXString(cursor, hf_afs_prot_name_uint_string);
break;
}
}
/*
* VLDB Helpers
*/
static void
dissect_vldb_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode)
{
static int * const vldb_flags[] = {
&hf_afs_vldb_flags_rwexists,
&hf_afs_vldb_flags_roexists,
&hf_afs_vldb_flags_bkexists,
&hf_afs_vldb_flags_dfsfileset,
NULL
};
if ( rxinfo->type == RX_PACKET_TYPE_DATA )
{
switch ( opcode )
{
case 510: /* list entry */
ptvcursor_add(cursor, hf_afs_vldb_count, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_nextindex, 4, ENC_BIG_ENDIAN);
break;
case 503: /* get entry by id */
case 504: /* get entry by name */
{
int nservers,i;
unsigned int j;
OUT_RXStringV(cursor, hf_afs_vldb_name, VLNAMEMAX);
ptvcursor_advance(cursor, 4);
nservers = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_vldb_numservers, 4, ENC_BIG_ENDIAN);
for (i=0; i<8; i++)
{
if ( i<nservers )
{
ptvcursor_add(cursor, hf_afs_vldb_server, 4, ENC_BIG_ENDIAN);
}
else
{
ptvcursor_advance(cursor, 4);
}
}
for (i=0; i<8; i++)
{
char *part = wmem_strdup(wmem_packet_scope(), "/vicepa");
j = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
if ( i<nservers && j<=25 )
{
part[6] = 'a' + (char) j;
proto_tree_add_string(ptvcursor_tree(cursor), hf_afs_vldb_partition, ptvcursor_tvbuff(cursor),
ptvcursor_current_offset(cursor), 4, part);
}
ptvcursor_advance(cursor, 4);
}
ptvcursor_advance(cursor, 8*4);
ptvcursor_add(cursor, hf_afs_vldb_rwvol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_rovol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_bkvol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_clonevol, 4, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(ptvcursor_tree(cursor), ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor), hf_afs_vldb_flags,
ett_afs_vldb_flags, vldb_flags, ENC_BIG_ENDIAN);
ptvcursor_advance(cursor, 4);
}
break;
case 505: /* get new volume id */
ptvcursor_add(cursor, hf_afs_vldb_id, 4, ENC_BIG_ENDIAN);
break;
case 521: /* list entry */
case 529: /* list entry U */
ptvcursor_add(cursor, hf_afs_vldb_count, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_nextindex, 4, ENC_BIG_ENDIAN);
break;
case 518: /* get entry by id n */
case 519: /* get entry by name N */
{
int nservers,i;
unsigned int j;
OUT_RXStringV(cursor, hf_afs_vldb_name, VLNAMEMAX);
nservers = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_vldb_numservers, 4, ENC_BIG_ENDIAN);
for (i=0; i<13; i++)
{
if ( i<nservers )
{
ptvcursor_add(cursor, hf_afs_vldb_server, 4, ENC_BIG_ENDIAN);
}
else
{
ptvcursor_advance(cursor, 4);
}
}
for (i=0; i<13; i++)
{
char *part = wmem_strdup(wmem_packet_scope(), "/vicepa");
j = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
if ( i<nservers && j<=25 )
{
part[6] = 'a' + (char) j;
proto_tree_add_string(ptvcursor_tree(cursor), hf_afs_vldb_partition, ptvcursor_tvbuff(cursor),
ptvcursor_current_offset(cursor), 4, part);
}
ptvcursor_advance(cursor, 4);
}
ptvcursor_advance(cursor, 13*4);
ptvcursor_add(cursor, hf_afs_vldb_rwvol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_rovol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_bkvol, 4, ENC_BIG_ENDIAN);
}
break;
case 526: /* get entry by id u */
case 527: /* get entry by name u */
{
int nservers,i;
unsigned int j;
OUT_RXStringV(cursor, hf_afs_vldb_name, VLNAMEMAX);
nservers = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
ptvcursor_add(cursor, hf_afs_vldb_numservers, 4, ENC_BIG_ENDIAN);
for (i=0; i<13; i++)
{
if ( i<nservers )
{
ptvcursor_add(cursor, hf_afs_vldb_serveruuid, 4*11, ENC_NA);
}
else
{
ptvcursor_advance(cursor, 4*11);
}
}
for (i=0; i<13; i++)
{
if ( i<nservers )
{
ptvcursor_add(cursor, hf_afs_vldb_serveruniq, 4, ENC_BIG_ENDIAN);
}
else
{
ptvcursor_advance(cursor, 4);
}
}
for (i=0; i<13; i++)
{
char *part = wmem_strdup(wmem_packet_scope(), "/vicepa");
j = tvb_get_ntohl(ptvcursor_tvbuff(cursor), ptvcursor_current_offset(cursor));
if ( i<nservers && j<=25 )
{
part[6] = 'a' + (char) j;
proto_tree_add_string(ptvcursor_tree(cursor), hf_afs_vldb_partition, ptvcursor_tvbuff(cursor),
ptvcursor_current_offset(cursor), 4, part);
}
ptvcursor_advance(cursor, 4);
}
for (i=0; i<13; i++)
{
if ( i<nservers )
{
ptvcursor_add(cursor, hf_afs_vldb_serverflags, 4, ENC_BIG_ENDIAN);
}
else
{
ptvcursor_advance(cursor, 4);
}
}
ptvcursor_add(cursor, hf_afs_vldb_rwvol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_rovol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_bkvol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_clonevol, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_flags, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare1, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare2, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare3, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare4, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare5, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare6, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare7, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare8, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_spare9, 4, ENC_BIG_ENDIAN);
}
break;
}
}
else if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_vldb_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_vldb_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 501: /* create new volume */
case 517: /* create entry N */
OUT_RXStringV(cursor, hf_afs_vldb_name, VLNAMEMAX);
break;
case 502: /* delete entry */
case 503: /* get entry by id */
case 507: /* update entry */
case 508: /* set lock */
case 509: /* release lock */
case 518: /* get entry by id */
ptvcursor_add(cursor, hf_afs_vldb_id, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_type, 4, ENC_BIG_ENDIAN);
break;
case 504: /* get entry by name */
case 519: /* get entry by name N */
case 524: /* update entry by name */
case 527: /* get entry by name U */
OUT_RXString(cursor, hf_afs_vldb_name_uint_string);
break;
case 505: /* get new vol id */
ptvcursor_add(cursor, hf_afs_vldb_bump, 4, ENC_BIG_ENDIAN);
break;
case 506: /* replace entry */
case 520: /* replace entry N */
ptvcursor_add(cursor, hf_afs_vldb_id, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_vldb_type, 4, ENC_BIG_ENDIAN);
OUT_RXStringV(cursor, hf_afs_vldb_name, VLNAMEMAX);
break;
case 510: /* list entry */
case 521: /* list entry N */
ptvcursor_add(cursor, hf_afs_vldb_index, 4, ENC_BIG_ENDIAN);
break;
case 532: /* regaddr */
ptvcursor_add(cursor, hf_afs_vldb_serveruuid, 4*11, ENC_NA);
ptvcursor_add(cursor, hf_afs_vldb_spare1, 4, ENC_BIG_ENDIAN);
OUT_RXArray32(ptvcursor_add(cursor, hf_afs_vldb_serverip, 4, ENC_BIG_ENDIAN));
break;
}
}
/*
* UBIK Helpers
*/
static void
dissect_ubik_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
switch ( opcode )
{
case 10000: /* vote-beacon */
break;
case 10001: /* vote-debug-old */
OUT_UBIK_DebugOld(cursor);
break;
case 10002: /* vote-sdebug-old */
OUT_UBIK_SDebugOld(cursor);
break;
case 10003: /* vote-get syncsite */
break;
case 10004: /* vote-debug */
OUT_UBIK_DebugOld(cursor);
OUT_UBIK_InterfaceAddrs(cursor);
break;
case 10005: /* vote-sdebug */
OUT_UBIK_SDebugOld(cursor);
OUT_UBIK_InterfaceAddrs(cursor);
break;
case 10006: /* vote-xdebug */
OUT_UBIK_DebugOld(cursor);
OUT_UBIK_InterfaceAddrs(cursor);
ptvcursor_add(cursor, hf_afs_ubik_isclone, 4, ENC_BIG_ENDIAN);
break;
case 10007: /* vote-xsdebug */
OUT_UBIK_SDebugOld(cursor);
OUT_UBIK_InterfaceAddrs(cursor);
ptvcursor_add(cursor, hf_afs_ubik_isclone, 4, ENC_BIG_ENDIAN);
break;
case 20000: /* disk-begin */
break;
case 20004: /* get version */
OUT_UBIKVERSION(cursor, "DB Version");
break;
case 20010: /* disk-probe */
break;
case 20012: /* disk-interfaceaddr */
OUT_UBIK_InterfaceAddrs(cursor);
break;
}
}
static void
dissect_ubik_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
switch ( opcode )
{
case 10000: /* vote-beacon */
ptvcursor_add(cursor, hf_afs_ubik_state, 4, ENC_BIG_ENDIAN);
OUT_TIMESECS(cursor, hf_afs_ubik_votestart);
OUT_UBIKVERSION(cursor, "DB Version");
OUT_UBIKVERSION(cursor, "TID");
break;
case 10001: /* vote-debug-old */
break;
case 10002: /* vote-sdebug-old */
ptvcursor_add(cursor, hf_afs_ubik_site, 4, ENC_BIG_ENDIAN);
break;
case 10003: /* vote-get sync site */
ptvcursor_add(cursor, hf_afs_ubik_site, 4, ENC_BIG_ENDIAN);
break;
case 10004: /* vote-debug */
case 10005: /* vote-sdebug */
ptvcursor_add(cursor, hf_afs_ubik_site, 4, ENC_BIG_ENDIAN);
break;
case 20000: /* disk-begin */
OUT_UBIKVERSION(cursor, "TID");
break;
case 20001: /* disk-commit */
OUT_UBIKVERSION(cursor, "TID");
break;
case 20002: /* disk-lock */
OUT_UBIKVERSION(cursor, "TID");
ptvcursor_add(cursor, hf_afs_ubik_file, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_pos, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_length, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_locktype, 4, ENC_BIG_ENDIAN);
break;
case 20003: /* disk-write */
OUT_UBIKVERSION(cursor, "TID");
ptvcursor_add(cursor, hf_afs_ubik_file, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_pos, 4, ENC_BIG_ENDIAN);
break;
case 20004: /* disk-get version */
break;
case 20005: /* disk-get file */
ptvcursor_add(cursor, hf_afs_ubik_file, 4, ENC_BIG_ENDIAN);
break;
case 20006: /* disk-send file */
ptvcursor_add(cursor, hf_afs_ubik_file, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_length, 4, ENC_BIG_ENDIAN);
OUT_UBIKVERSION(cursor, "DB Version");
break;
case 20007: /* disk-abort */
case 20008: /* disk-release locks */
case 20010: /* disk-probe */
break;
case 20009: /* disk-truncate */
OUT_UBIKVERSION(cursor, "TID");
ptvcursor_add(cursor, hf_afs_ubik_file, 4, ENC_BIG_ENDIAN);
ptvcursor_add(cursor, hf_afs_ubik_length, 4, ENC_BIG_ENDIAN);
break;
case 20011: /* disk-writev */
OUT_UBIKVERSION(cursor, "TID");
break;
case 20012: /* disk-interfaceaddr */
OUT_UBIK_InterfaceAddrs(cursor);
break;
case 20013: /* disk-set version */
OUT_UBIKVERSION(cursor, "TID");
OUT_UBIKVERSION(cursor, "Old DB Version");
OUT_UBIKVERSION(cursor, "New DB Version");
break;
}
}
/*
* BACKUP Helpers
*/
static void
dissect_backup_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode _U_)
{
if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_backup_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_backup_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode _U_)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
}
static void
dissect_butc_reply(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode _U_)
{
if ( rxinfo->type == RX_PACKET_TYPE_ABORT )
{
ptvcursor_add(cursor, hf_afs_butc_errcode, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_butc_request(ptvcursor_t *cursor, struct rxinfo *rxinfo _U_, int opcode _U_)
{
ptvcursor_advance(cursor, 4); /* skip the opcode */
}
/*
* Dissection routines
*/
static int
dissect_afs(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data)
{
struct rxinfo *rxinfo = (struct rxinfo *)data;
int reply = 0;
conversation_t *conversation;
struct afs_request_key request_key, *new_request_key;
struct afs_request_val *request_val=NULL;
proto_tree *afs_tree, *afs_op_tree, *ti;
proto_item *hidden_item;
int port, node, typenode, opcode;
value_string_ext *vals_ext;
int offset = 0;
nstime_t delta_ts;
uint8_t save_fragmented;
int reassembled = 0;
ptvcursor_t *cursor;
void (*dissector)(ptvcursor_t *cursor, struct rxinfo *rxinfo, int opcode);
/* Reject the packet if data is NULL */
if (data == NULL)
return 0;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "AFS (RX)");
col_clear(pinfo->cinfo, COL_INFO);
reply = (rxinfo->flags & RX_CLIENT_INITIATED) == 0;
port = ((reply == 0) ? pinfo->destport : pinfo->srcport );
/*
* Find out what conversation this packet is part of.
* XXX - this should really be done by the transport-layer protocol,
* although for connectionless transports, we may not want to do that
* unless we know some higher-level protocol will want it - or we
* may want to do it, so you can say e.g. "show only the packets in
* this UDP 'connection'".
*
* Note that we don't have to worry about the direction this packet
* was going - the conversation code handles that for us, treating
* packets from A:X to B:Y as being part of the same conversation as
* packets from B:Y to A:X.
*/
conversation = find_or_create_conversation(pinfo);
request_key.conversation = conversation->conv_index;
request_key.service = rxinfo->serviceid;
request_key.epoch = rxinfo->epoch;
request_key.cid = rxinfo->cid;
request_key.callnumber = rxinfo->callnumber;
request_val = (struct afs_request_val *) wmem_map_lookup(
afs_request_hash, &request_key);
/* only allocate a new hash element when it's a request */
opcode = 0;
if(!pinfo->fd->visited){
if ( !request_val && !reply) {
new_request_key = wmem_new(wmem_file_scope(), struct afs_request_key);
*new_request_key = request_key;
request_val = wmem_new(wmem_file_scope(), struct afs_request_val);
request_val -> opcode = tvb_get_ntohl(tvb, offset);
request_val -> req_num = pinfo->num;
request_val -> rep_num = 0;
request_val -> req_time = pinfo->abs_ts;
wmem_map_insert(afs_request_hash, new_request_key,
request_val);
}
if( request_val && reply ) {
request_val -> rep_num = pinfo->num;
}
}
if ( request_val ) {
opcode = request_val->opcode;
}
node = 0;
typenode = 0;
vals_ext = NULL;
dissector = NULL;
switch (port) {
case AFS_PORT_FS:
typenode = hf_afs_fs;
node = hf_afs_fs_opcode;
vals_ext = &fs_req_ext;
dissector = reply ? dissect_fs_reply : dissect_fs_request;
break;
case AFS_PORT_CB:
typenode = hf_afs_cb;
node = hf_afs_cb_opcode;
vals_ext = &cb_req_ext;
dissector = reply ? dissect_cb_reply : dissect_cb_request;
break;
case AFS_PORT_PROT:
typenode = hf_afs_prot;
node = hf_afs_prot_opcode;
vals_ext = &prot_req_ext;
dissector = reply ? dissect_prot_reply : dissect_prot_request;
break;
case AFS_PORT_VLDB:
typenode = hf_afs_vldb;
node = hf_afs_vldb_opcode;
vals_ext = &vldb_req_ext;
dissector = reply ? dissect_vldb_reply : dissect_vldb_request;
break;
case AFS_PORT_KAUTH:
typenode = hf_afs_kauth;
node = hf_afs_kauth_opcode;
vals_ext = &kauth_req_ext;
dissector = reply ? dissect_kauth_reply : dissect_kauth_request;
break;
case AFS_PORT_VOL:
typenode = hf_afs_vol;
node = hf_afs_vol_opcode;
vals_ext = &vol_req_ext;
dissector = reply ? dissect_vol_reply : dissect_vol_request;
break;
case AFS_PORT_ERROR:
typenode = hf_afs_error;
node = hf_afs_error_opcode;
/* dissector = reply ? dissect_error_reply : dissect_error_request; */
break;
case AFS_PORT_BOS:
typenode = hf_afs_bos;
node = hf_afs_bos_opcode;
vals_ext = &bos_req_ext;
dissector = reply ? dissect_bos_reply : dissect_bos_request;
break;
case AFS_PORT_UPDATE:
typenode = hf_afs_update;
node = hf_afs_update_opcode;
vals_ext = &update_req_ext;
/* dissector = reply ? dissect_update_reply : dissect_update_request; */
break;
case AFS_PORT_RMTSYS:
typenode = hf_afs_rmtsys;
node = hf_afs_rmtsys_opcode;
vals_ext = &rmtsys_req_ext;
/* dissector = reply ? dissect_rmtsys_reply : dissect_rmtsys_request; */
break;
case AFS_PORT_BACKUP:
typenode = hf_afs_backup;
node = hf_afs_backup_opcode;
vals_ext = &backup_req_ext;
dissector = reply ? dissect_backup_reply : dissect_backup_request;
break;
default:
if (port >= AFS_PORT_BUTC) {
typenode = hf_afs_butc;
node = hf_afs_butc_opcode;
vals_ext = &butc_req_ext;
dissector = reply ? dissect_butc_reply : dissect_butc_request;
}
break;
}
if ( (opcode >= VOTE_LOW && opcode <= VOTE_HIGH) ||
(opcode >= DISK_LOW && opcode <= DISK_HIGH) ) {
typenode = hf_afs_ubik;
node = hf_afs_ubik_opcode;
vals_ext = &ubik_req_ext;
dissector = reply ? dissect_ubik_reply : dissect_ubik_request;
}
if ( VALID_OPCODE(opcode) ) {
if ( vals_ext ) {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s %s: %s (%d)",
typenode == hf_afs_ubik ? "UBIK-" : "",
val_to_str_ext(port, &port_types_short_ext, "Unknown(%d)"),
reply ? "Reply" : "Request",
val_to_str_ext(opcode, vals_ext, "Unknown(%d)"), opcode);
} else {
col_add_fstr(pinfo->cinfo, COL_INFO, "%s%s %s: Unknown(%d)",
typenode == hf_afs_ubik ? "UBIK-" : "",
val_to_str_ext(port, &port_types_short_ext, "Unknown(%d)"),
reply ? "Reply" : "Request",
opcode);
}
} else {
col_add_fstr(pinfo->cinfo, COL_INFO, "Encrypted %s %s",
val_to_str_ext(port, &port_types_short_ext, "Unknown(%d)"),
reply ? "Reply" : "Request"
);
}
ti = proto_tree_add_item(tree, proto_afs, tvb, offset,
tvb_reported_length_remaining(tvb, offset),
ENC_NA);
afs_tree = proto_item_add_subtree(ti, ett_afs);
save_fragmented = pinfo->fragmented;
if( (afs_defragment && (!(rxinfo->flags & RX_LAST_PACKET) || rxinfo->seq > 1 ))) { /* Fragmented */
tvbuff_t * new_tvb = NULL;
fragment_head * frag_msg = NULL;
uint32_t afs_seqid = rxinfo->callnumber ^ rxinfo->cid;
pinfo->fragmented = true;
frag_msg = fragment_add_seq_check(&afs_reassembly_table,
tvb, offset, pinfo, afs_seqid, NULL,
rxinfo->seq-1, tvb_captured_length_remaining(tvb, offset),
! ( rxinfo->flags & RX_LAST_PACKET ) );
new_tvb = process_reassembled_data( tvb, offset, pinfo, "Reassembled RX", frag_msg,
&afs_frag_items, NULL, afs_tree );
if (new_tvb) {
tvb = new_tvb;
reassembled = 1;
col_append_str(pinfo->cinfo, COL_INFO, " [AFS reassembled]");
} else {
col_set_str(pinfo->cinfo, COL_INFO, "[AFS segment of a reassembled PDU]");
return tvb_captured_length(tvb);
}
}
pinfo->fragmented = save_fragmented;
if (tree) {
proto_tree_add_uint_format_value(afs_tree, hf_afs_service, tvb, 0, 0,
opcode, "%s%s%s %s",
VALID_OPCODE(opcode) ? "" : "Encrypted ",
typenode == hf_afs_ubik ? "UBIK - " : "",
val_to_str_ext(port, &port_types_ext, "Unknown(%d)"),
reply ? "Reply" : "Request");
if( request_val && !reply && request_val->rep_num) {
proto_tree_add_uint_format(afs_tree, hf_afs_repframe,
tvb, 0, 0, request_val->rep_num,
"The reply to this request is in frame %u",
request_val->rep_num);
}
if( request_val && reply && request_val->rep_num) {
proto_tree_add_uint_format(afs_tree, hf_afs_reqframe,
tvb, 0, 0, request_val->req_num,
"This is a reply to a request in frame %u",
request_val->req_num);
nstime_delta(&delta_ts, &pinfo->abs_ts, &request_val->req_time);
proto_tree_add_time(afs_tree, hf_afs_time, tvb, offset, 0,
&delta_ts);
}
if ( VALID_OPCODE(opcode) ) {
/* until we do cache, can't handle replies */
ti = NULL;
if ( !reply && node != 0 ) {
if ( rxinfo->seq == 1 || reassembled )
{
ti = proto_tree_add_uint(afs_tree,
node, tvb, offset, 4, opcode);
} else {
ti = proto_tree_add_uint(afs_tree,
node, tvb, 0, 0, opcode);
}
afs_op_tree = proto_item_add_subtree(ti, ett_afs_op);
} else if ( reply && node != 0 ) {
/* the opcode isn't in this packet */
ti = proto_tree_add_uint(afs_tree,
node, tvb, 0, 0, opcode);
afs_op_tree = proto_item_add_subtree(ti, ett_afs_op);
} else {
afs_op_tree = proto_tree_add_subtree(afs_tree, tvb, 0, 0, ett_afs_op, &ti, "Operation: Unknown");
}
if ( typenode != 0 ) {
/* indicate the type of request */
hidden_item = proto_tree_add_boolean(afs_tree, typenode, tvb, offset, 0, 1);
proto_item_set_hidden(hidden_item);
}
/* Process the packet according to what service it is */
/* Only for first packet in an rx data stream or the full reassembled stream */
if ( dissector && ( rxinfo->seq == 1 || reassembled ) ) {
cursor = ptvcursor_new(pinfo->pool, afs_op_tree, tvb, offset);
(*dissector)(cursor, rxinfo, opcode);
}
}
}
/* if it's the last packet, and it's a reply, remove opcode
from hash */
/* ignoring for now, I'm not sure how the chunk deallocation works */
if ( rxinfo->flags & RX_LAST_PACKET && reply ){
}
return tvb_captured_length(tvb);
}
/*
* Registration code for registering the protocol and fields
*/
void
proto_register_afs(void)
{
static hf_register_info hf[] = {
{ &hf_afs_fs, { "File Server", "afs.fs",
FT_BOOLEAN, BASE_NONE, 0, 0x0, NULL, HFILL }},
{ &hf_afs_cb, { "Callback", "afs.cb",
FT_BOOLEAN, BASE_NONE, 0, 0x0, NULL, HFILL }},
{ &hf_afs_prot, { "Protection", "afs.prot",
FT_BOOLEAN, BASE_NONE, 0, 0x0, "Protection Server", HFILL }},
{ &hf_afs_vldb, { "VLDB", "afs.vldb",
FT_BOOLEAN, BASE_NONE, 0, 0x0, "Volume Location Database Server", HFILL }},
{ &hf_afs_kauth, { "KAuth", "afs.kauth",
FT_BOOLEAN, BASE_NONE, 0, 0x0, "Kerberos Auth Server", HFILL }},
{ &hf_afs_vol, { "Volume Server", "afs.vol",
FT_BOOLEAN, BASE_NONE, 0, 0x0, NULL, HFILL }},
{ &hf_afs_error, { "Error", "afs.error",
FT_BOOLEAN, BASE_NONE, 0, 0x0, NULL, HFILL }},
{ &hf_afs_bos, { "BOS", "afs.bos",
FT_BOOLEAN, BASE_NONE, 0, 0x0, "Basic Oversee Server", HFILL }},
{ &hf_afs_update, { "Update", "afs.update",
FT_BOOLEAN, BASE_NONE, 0, 0x0, "Update Server", HFILL }},
{ &hf_afs_rmtsys, { "Rmtsys", "afs.rmtsys",
FT_BOOLEAN, BASE_NONE, 0, 0x0, NULL, HFILL }},
{ &hf_afs_ubik, { "Ubik", "afs.ubik",
FT_BOOLEAN, BASE_NONE, 0, 0x0, NULL, HFILL }},
{ &hf_afs_backup, { "Backup", "afs.backup",
FT_BOOLEAN, BASE_NONE, 0, 0x0, "Backup Server", HFILL }},
{ &hf_afs_butc, { "BackupTC", "afs.butc",
FT_BOOLEAN, BASE_NONE, 0, 0x0, "Backup Tape Controller", HFILL }},
{ &hf_afs_service, { "Service", "afs.service",
FT_UINT32, BASE_DEC, NULL, 0, NULL, HFILL }},
{ &hf_afs_fs_opcode, { "Operation", "afs.fs.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&fs_req_ext, 0, NULL, HFILL }},
{ &hf_afs_cb_opcode, { "Operation", "afs.cb.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&cb_req_ext, 0, NULL, HFILL }},
{ &hf_afs_prot_opcode, { "Operation", "afs.prot.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&prot_req_ext, 0, NULL, HFILL }},
{ &hf_afs_vldb_opcode, { "Operation", "afs.vldb.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&vldb_req_ext, 0, NULL, HFILL }},
{ &hf_afs_kauth_opcode, { "Operation", "afs.kauth.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&kauth_req_ext, 0, NULL, HFILL }},
{ &hf_afs_vol_opcode, { "Operation", "afs.vol.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&vol_req_ext, 0, NULL, HFILL }},
{ &hf_afs_bos_opcode, { "Operation", "afs.bos.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&bos_req_ext, 0, NULL, HFILL }},
{ &hf_afs_update_opcode, { "Operation", "afs.update.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&update_req_ext, 0, NULL, HFILL }},
{ &hf_afs_rmtsys_opcode, { "Operation", "afs.rmtsys.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&rmtsys_req_ext, 0, NULL, HFILL }},
{ &hf_afs_error_opcode, { "Operation", "afs.error.opcode",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_backup_opcode, { "Operation", "afs.backup.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&backup_req_ext, 0, NULL, HFILL }},
{ &hf_afs_butc_opcode, { "Operation", "afs.butc.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&butc_req_ext, 0, NULL, HFILL }},
{ &hf_afs_ubik_opcode, { "Operation", "afs.ubik.opcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING,
&ubik_req_ext, 0, NULL, HFILL }},
/* File Server Fields */
{ &hf_afs_fs_fid_volume, { "FileID (Volume)", "afs.fs.fid.volume",
FT_UINT32, BASE_DEC, 0, 0, "File ID (Volume)", HFILL }},
{ &hf_afs_fs_fid_vnode, { "FileID (VNode)", "afs.fs.fid.vnode",
FT_UINT32, BASE_DEC, 0, 0, "File ID (VNode)", HFILL }},
{ &hf_afs_fs_fid_uniqifier, { "FileID (Uniqifier)", "afs.fs.fid.uniq",
FT_UINT32, BASE_DEC, 0, 0, "File ID (Uniqifier)", HFILL }},
{ &hf_afs_fs_offset, { "Offset", "afs.fs.offset",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_length, { "Length", "afs.fs.length",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_flength, { "FLength", "afs.fs.flength",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_offset64, { "Offset64", "afs.fs.offset64",
FT_UINT64, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_length64, { "Length64", "afs.fs.length64",
FT_UINT64, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_flength64, { "FLength64", "afs.fs.flength64",
FT_UINT64, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_errcode, { "Error Code", "afs.fs.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_fs_data, { "Data", "afs.fs.data",
FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_token, { "Token", "afs.fs.token",
FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_oldname, { "Old Name", "afs.fs.oldname",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_newname, { "New Name", "afs.fs.newname",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_name, { "Name", "afs.fs.name",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_symlink_name, { "Symlink Name", "afs.fs.symlink.name",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_symlink_content, { "Symlink Content", "afs.fs.symlink.content",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volid, { "Volume ID", "afs.fs.volid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volname, { "Volume Name", "afs.fs.volname",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_timestamp, { "Timestamp", "afs.fs.timestamp",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_offlinemsg, { "Offline Message", "afs.fs.offlinemsg",
FT_UINT_STRING, BASE_NONE, 0, 0, "Volume Name", HFILL }},
{ &hf_afs_fs_motd, { "Message of the Day", "afs.fs.motd",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_xstats_version, { "XStats Version", "afs.fs.xstats.version",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_xstats_clientversion, { "Client Version", "afs.fs.xstats.clientversion",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_xstats_collnumber, { "Collection Number", "afs.fs.xstats.collnumber",
FT_UINT32, BASE_DEC, VALS(xstat_collections), 0, NULL, HFILL }},
{ &hf_afs_fs_xstats_timestamp, { "XStats Timestamp", "afs.fs.xstats.timestamp",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_cps_spare1, { "CPS Spare1", "afs.fs.cps.spare1",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_cps_spare2, { "CPS Spare2", "afs.fs.cps.spare2",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_cps_spare3, { "CPS Spare3", "afs.fs.cps.spare3",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_vicelocktype, { "Vice Lock Type", "afs.fs.vicelocktype",
FT_UINT32, BASE_DEC, VALS(vice_lock_types), 0, NULL, HFILL }},
/* XXX - is this an IP address? */
{ &hf_afs_fs_viceid, { "Vice ID", "afs.fs.viceid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_ipaddr, { "IP Addr", "afs.fs.ipaddr",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_mask, { "Mask", "afs.fs.status.mask",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_mask_setmodtime, { "Set Modification Time", "afs.fs.status.mask.setmodtime",
FT_BOOLEAN, 32, 0, 0x00000001, NULL, HFILL }},
{ &hf_afs_fs_status_mask_setowner, { "Set Owner", "afs.fs.status.mask.setowner",
FT_BOOLEAN, 32, 0, 0x00000002, NULL, HFILL }},
{ &hf_afs_fs_status_mask_setgroup, { "Set Group", "afs.fs.status.mask.setgroup",
FT_BOOLEAN, 32, 0, 0x00000004, NULL, HFILL }},
{ &hf_afs_fs_status_mask_setmode, { "Set Mode", "afs.fs.status.mask.setmode",
FT_BOOLEAN, 32, 0, 0x00000008, NULL, HFILL }},
{ &hf_afs_fs_status_mask_setsegsize, { "Set Segment Size", "afs.fs.status.mask.setsegsize",
FT_BOOLEAN, 32, 0, 0x00000010, NULL, HFILL }},
{ &hf_afs_fs_status_mask_fsync, { "FSync", "afs.fs.status.mask.fsync",
FT_BOOLEAN, 32, 0, 0x00000400, NULL, HFILL }},
{ &hf_afs_fs_status_clientmodtime, { "Client Modification Time", "afs.fs.status.clientmodtime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_servermodtime, { "Server Modification Time", "afs.fs.status.servermodtime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_owner, { "Owner", "afs.fs.status.owner",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_group, { "Group", "afs.fs.status.group",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_mode, { "Unix Mode", "afs.fs.status.mode",
FT_UINT32, BASE_OCT, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_segsize, { "Segment Size", "afs.fs.status.segsize",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_interfaceversion, { "Interface Version", "afs.fs.status.interfaceversion",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_filetype, { "File Type", "afs.fs.status.filetype",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_author, { "Author", "afs.fs.status.author",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_calleraccess, { "Caller Access", "afs.fs.status.calleraccess",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_anonymousaccess, { "Anonymous Access", "afs.fs.status.anonymousaccess",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_parentvnode, { "Parent VNode", "afs.fs.status.parentvnode",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_parentunique, { "Parent Unique", "afs.fs.status.parentunique",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_dataversion, { "Data Version", "afs.fs.status.dataversion",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_dataversionhigh, { "Data Version (High)", "afs.fs.status.dataversionhigh",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_linkcount, { "Link Count", "afs.fs.status.linkcount",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_spare2, { "Spare 2", "afs.fs.status.spare2",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_spare3, { "Spare 3", "afs.fs.status.spare3",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_spare4, { "Spare 4", "afs.fs.status.spare4",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_synccounter, { "Sync Counter", "afs.fs.status.synccounter",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_status_length, { "Length", "afs.fs.status.length",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volsync_spare1, { "Volume Creation Timestamp", "afs.fs.volsync.spare1",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volsync_spare2, { "Spare 2", "afs.fs.volsync.spare2",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volsync_spare3, { "Spare 3", "afs.fs.volsync.spare3",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volsync_spare4, { "Spare 4", "afs.fs.volsync.spare4",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volsync_spare5, { "Spare 5", "afs.fs.volsync.spare5",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_volsync_spare6, { "Spare 6", "afs.fs.volsync.spare6",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_acl_count_positive, {
"ACL Count (Positive)", "afs.fs.acl.count.positive",
FT_UINT32, BASE_DEC, 0, 0, "Number of Positive ACLs", HFILL }},
{ &hf_afs_fs_acl_count_negative, {
"ACL Count (Negative)", "afs.fs.acl.count.negative",
FT_UINT32, BASE_DEC, 0, 0, "Number of Negative ACLs", HFILL }},
{ &hf_afs_fs_acl_datasize, {
"ACL Size", "afs.fs.acl.datasize",
FT_UINT32, BASE_DEC, 0, 0, "ACL Data Size", HFILL }},
{ &hf_afs_fs_acl_entity, {
"Entity (User/Group)", "afs.fs.acl.entity",
FT_STRING, BASE_NONE, 0, 0, "ACL Entity (User/Group)", HFILL }},
{ &hf_afs_fs_acl_r, {
"_R_ead", "afs.fs.acl.r",
FT_BOOLEAN, 8, 0, PRSFS_READ, "Read", HFILL }},
{ &hf_afs_fs_acl_l, {
"_L_ookup", "afs.fs.acl.l",
FT_BOOLEAN, 8, 0, PRSFS_LOOKUP, "Lookup", HFILL }},
{ &hf_afs_fs_acl_i, {
"_I_nsert", "afs.fs.acl.i",
FT_BOOLEAN, 8, 0, PRSFS_INSERT, "Insert", HFILL }},
{ &hf_afs_fs_acl_d, { "_D_elete", "afs.fs.acl.d",
FT_BOOLEAN, 8, 0, PRSFS_DELETE, "Delete", HFILL }},
{ &hf_afs_fs_acl_w, { "_W_rite", "afs.fs.acl.w",
FT_BOOLEAN, 8, 0, PRSFS_WRITE, "Write", HFILL }},
{ &hf_afs_fs_acl_k, { "_L_ock", "afs.fs.acl.k",
FT_BOOLEAN, 8, 0, PRSFS_LOCK, "Lock", HFILL }},
{ &hf_afs_fs_acl_a, { "_A_dminister", "afs.fs.acl.a",
FT_BOOLEAN, 8, 0, PRSFS_ADMINISTER, "Administer", HFILL }},
{ &hf_afs_fs_callback_version, { "Version", "afs.fs.callback.version",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_callback_expires, { "Expires", "afs.fs.callback.expires",
FT_RELATIVE_TIME, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_fs_callback_type, { "Type", "afs.fs.callback.type",
FT_UINT32, BASE_DEC, VALS(cb_types), 0, NULL, HFILL }},
/* BOS Server Fields */
{ &hf_afs_bos_errcode, { "Error Code", "afs.bos.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_bos_type, { "Type", "afs.bos.type",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_content, { "Content", "afs.bos.content",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_data, { "Data", "afs.bos.data",
FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_path, { "Path", "afs.bos.path",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_parm, { "Parm", "afs.bos.parm",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_error, { "Error", "afs.bos.error",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_spare1, { "Spare1", "afs.bos.spare1",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_spare2, { "Spare2", "afs.bos.spare2",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_spare3, { "Spare3", "afs.bos.spare3",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_file, { "File", "afs.bos.file",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_cmd, { "Command", "afs.bos.cmd",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_key, { "Key", "afs.bos.key",
FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_user, { "User", "afs.bos.user",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_instance, { "Instance", "afs.bos.instance",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_status, { "Status", "afs.bos.status",
FT_INT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_statusdesc, { "Status Description", "afs.bos.statusdesc",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_num, { "Number", "afs.bos.number",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_size, { "Size", "afs.bos.size",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_flags, { "Flags", "afs.bos.flags",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_date, { "Date", "afs.bos.date",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_kvno, { "Key Version Number", "afs.bos.kvno",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_cell, { "Cell", "afs.bos.cell",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_host, { "Host", "afs.bos.host",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_newtime, { "New Time", "afs.bos.newtime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_baktime, { "Backup Time", "afs.bos.baktime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_oldtime, { "Old Time", "afs.bos.oldtime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_keymodtime, { "Key Modification Time", "afs.bos.keymodtime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_keychecksum, { "Key Checksum", "afs.bos.keychecksum",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_bos_keyspare2, { "Key Spare 2", "afs.bos.keyspare2",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
/* KAUTH Server Fields */
{ &hf_afs_kauth_errcode, { "Error Code", "afs.kauth.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_kauth_princ, { "Principal", "afs.kauth.princ",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_kauth_realm, { "Realm", "afs.kauth.realm",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_kauth_domain, { "Domain", "afs.kauth.domain",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_kauth_name, { "Name", "afs.kauth.name",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_kauth_data, { "Data", "afs.kauth.data",
FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_kauth_kvno, { "Key Version Number", "afs.kauth.kvno",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
/* VOL Server Fields */
{ &hf_afs_vol_errcode, { "Error Code", "afs.vol.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_vol_id, { "Volume ID", "afs.vol.id",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vol_count, { "Volume Count", "afs.vol.count",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vol_name, { "Volume Name", "afs.vol.name",
FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
/* VLDB Server Fields */
{ &hf_afs_vldb_errcode, { "Error Code", "afs.vldb.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_vldb_type, { "Volume Type", "afs.vldb.type",
FT_UINT32, BASE_HEX, VALS(volume_types), 0, NULL, HFILL }},
{ &hf_afs_vldb_id, { "Volume ID", "afs.vldb.id",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_bump, { "Bumped Volume ID", "afs.vldb.bump",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_index, { "Volume Index", "afs.vldb.index",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_count, { "Volume Count", "afs.vldb.count",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_numservers, { "Number of Servers", "afs.vldb.numservers",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_nextindex, { "Next Volume Index", "afs.vldb.nextindex",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_rovol, { "Read-Only Volume ID", "afs.vldb.rovol",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_rwvol, { "Read-Write Volume ID", "afs.vldb.rwvol",
FT_UINT32, BASE_DEC, 0, 0, "Read-Only Volume ID", HFILL }},
{ &hf_afs_vldb_bkvol, { "Backup Volume ID", "afs.vldb.bkvol",
FT_UINT32, BASE_DEC, 0, 0, "Read-Only Volume ID", HFILL }},
{ &hf_afs_vldb_clonevol, { "Clone Volume ID", "afs.vldb.clonevol",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_name, { "Volume Name", "afs.vldb.name",
FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_name_uint_string, { "Volume Name", "afs.vldb.name",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_partition, { "Partition", "afs.vldb.partition",
FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_server, { "Server", "afs.vldb.server",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_serveruuid, { "Server UUID", "afs.vldb.serveruuid",
FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_serveruniq, { "Server Unique Address", "afs.vldb.serveruniq",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_serverflags, { "Server Flags", "afs.vldb.serverflags",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_serverip, { "Server IP", "afs.vldb.serverip",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_flags, { "Flags", "afs.vldb.flags",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_flags_rwexists, { "Read/Write Exists", "afs.vldb.flags.rwexists",
FT_BOOLEAN, 32, 0, 0x00001000, NULL, HFILL }},
{ &hf_afs_vldb_flags_roexists, { "Read-Only Exists", "afs.vldb.flags.roexists",
FT_BOOLEAN, 32, 0, 0x00002000, NULL, HFILL }},
{ &hf_afs_vldb_flags_bkexists, { "Backup Exists", "afs.vldb.flags.bkexists",
FT_BOOLEAN, 32, 0, 0x00004000, NULL, HFILL }},
{ &hf_afs_vldb_flags_dfsfileset, { "DFS Fileset", "afs.vldb.flags.dfsfileset",
FT_BOOLEAN, 32, 0, 0x00008000, NULL, HFILL }},
{ &hf_afs_vldb_spare1, { "Spare 1", "afs.vldb.spare1",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare2, { "Spare 2", "afs.vldb.spare2",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare3, { "Spare 3", "afs.vldb.spare3",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare4, { "Spare 4", "afs.vldb.spare4",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare5, { "Spare 5", "afs.vldb.spare5",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare6, { "Spare 6", "afs.vldb.spare6",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare7, { "Spare 7", "afs.vldb.spare7",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare8, { "Spare 8", "afs.vldb.spare8",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_vldb_spare9, { "Spare 9", "afs.vldb.spare9",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
/* BACKUP Server Fields */
{ &hf_afs_backup_errcode, { "Error Code", "afs.backup.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_butc_errcode, { "Error Code", "afs.butc.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
/* CB Server Fields */
{ &hf_afs_cb_errcode, { "Error Code", "afs.cb.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_cb_callback_version, { "Version", "afs.cb.callback.version",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_cb_callback_expires, { "Expires", "afs.cb.callback.expires",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_cb_callback_type, { "Type", "afs.cb.callback.type",
FT_UINT32, BASE_DEC, VALS(cb_types), 0, NULL, HFILL }},
{ &hf_afs_cb_fid_volume, { "FileID (Volume)", "afs.cb.fid.volume",
FT_UINT32, BASE_DEC, 0, 0, "File ID (Volume)", HFILL }},
{ &hf_afs_cb_fid_vnode, { "FileID (VNode)", "afs.cb.fid.vnode",
FT_UINT32, BASE_DEC, 0, 0, "File ID (VNode)", HFILL }},
{ &hf_afs_cb_fid_uniqifier, { "FileID (Uniqifier)", "afs.cb.fid.uniq",
FT_UINT32, BASE_DEC, 0, 0, "File ID (Uniqifier)", HFILL }},
/* CM Fields */
{ &hf_afs_cm_uuid, { "UUID", "afs.cm.uuid",
FT_BYTES, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_cm_numint, { "Number of Interfaces", "afs.cm.numint",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_cm_ipaddr, { "IP Address", "afs.cm.ipaddr",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_cm_netmask, { "Netmask", "afs.cm.netmask",
FT_IPv4, BASE_NETMASK, 0, 0, NULL, HFILL }},
{ &hf_afs_cm_mtu, { "MTU", "afs.cm.mtu",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_cm_numcap, { "Number of Capability Words", "afs.cm.numcap",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_cm_capabilities, { "Capabilities", "afs.cm.capabilities",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_cm_cap_errortrans, { "ERRORTRANS", "afs.cm.capabilities.errortrans",
FT_BOOLEAN, 32, 0, 0x00000001, NULL, HFILL }},
/* PROT Server Fields */
{ &hf_afs_prot_errcode, { "Error Code", "afs.prot.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
{ &hf_afs_prot_name, { "Name", "afs.prot.name",
FT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_name_uint_string, { "Name", "afs.prot.name",
FT_UINT_STRING, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_id, { "ID", "afs.prot.id",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_oldid, { "Old ID", "afs.prot.oldid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_newid, { "New ID", "afs.prot.newid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_gid, { "Group ID", "afs.prot.gid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_uid, { "User ID", "afs.prot.uid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_count, { "Count", "afs.prot.count",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_maxgid, { "Maximum Group ID", "afs.prot.maxgid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_maxuid, { "Maximum User ID", "afs.prot.maxuid",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_pos, { "Position", "afs.prot.pos",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_prot_flag, { "Flag", "afs.prot.flag",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
/* UBIK Fields */
#if 0
{ &hf_afs_ubik_errcode, { "Error Code", "afs.ubik.errcode",
FT_UINT32, BASE_DEC|BASE_EXT_STRING, &afs_errors_ext, 0, NULL, HFILL }},
#endif
{ &hf_afs_ubik_state, { "State", "afs.ubik.state",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_version_epoch, { "Epoch", "afs.ubik.version.epoch",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_version_counter, { "Counter", "afs.ubik.version.counter",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_votestart, { "Vote Started", "afs.ubik.votestart",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
#if 0
{ &hf_afs_ubik_voteend, { "Vote Ends", "afs.ubik.voteend",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
#endif
{ &hf_afs_ubik_file, { "File", "afs.ubik.file",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_pos, { "Position", "afs.ubik.position",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_length, { "Length", "afs.ubik.length",
FT_UINT32, BASE_DEC, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_locktype, { "Lock Type", "afs.ubik.locktype",
FT_UINT32, BASE_DEC, VALS(ubik_lock_types), 0, NULL, HFILL }},
#if 0
{ &hf_afs_ubik_votetype, { "Vote Type", "afs.ubik.votetype",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
#endif
{ &hf_afs_ubik_site, { "Site", "afs.ubik.site",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_interface, { "Interface Address", "afs.ubik.interface",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_null_addresses, { "Null Interface Addresses", "afs.ubik.null_addresses",
FT_NONE, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_now, { "Now", "afs.ubik.now",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lastyestime, { "Last Yes Time", "afs.ubik.lastyesttime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lastyeshost, { "Last Yes Host", "afs.ubik.lastyeshost",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lastyesstate, { "Last Yes State", "afs.ubik.lastyesstate",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lastyesclaim, { "Last Yes Claim", "afs.ubik.lastyesclaim",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lowesthost, { "Lowest Host", "afs.ubik.lowesthost",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lowesttime, { "Lowest Time", "afs.ubik.lowesttime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_synchost, { "Sync Host", "afs.ubik.synchost",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_addr, { "Address", "afs.ubik.addr",
FT_IPv4, BASE_NONE, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_synctime, { "Sync Time", "afs.ubik.synctime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lastvotetime, { "Last Vote Time", "afs.ubik.lastvotetime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lastbeaconsent, { "Last Beacon Sent", "afs.ubik.lastbeaconsent",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lastvote, { "Last Vote", "afs.ubik.lastvote",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_currentdb, { "Current DB", "afs.ubik.currentdb",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_up, { "Up", "afs.ubik.up",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_beaconsincedown, { "Beacon Since Down", "afs.ubik.beaconsincedown",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_amsyncsite, { "Am Sync Site", "afs.ubik.amsyncsite",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_syncsiteuntil, { "Sync Site Until", "afs.ubik.syncsiteuntil",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_nservers, { "Number of Servers", "afs.ubik.nservers",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_lockedpages, { "Locked Pages", "afs.ubik.lockedpages",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_writelockedpages, { "Write Locked Pages", "afs.ubik.writelockedpages",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_activewrite, { "Active Write", "afs.ubik.activewrite",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_tidcounter, { "TID Counter", "afs.ubik.tidcounter",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_anyreadlocks, { "Any Read Locks", "afs.ubik.anyreadlocks",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_anywritelocks, { "Any Write Locks", "afs.ubik.anywritelocks",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_recoverystate, { "Recovery State", "afs.ubik.recoverystate",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_currenttrans, { "Current Transaction", "afs.ubik.currenttran",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_writetrans, { "Write Transaction", "afs.ubik.writetran",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_epochtime, { "Epoch Time", "afs.ubik.epochtime",
FT_ABSOLUTE_TIME, ABSOLUTE_TIME_LOCAL, 0, 0, NULL, HFILL }},
{ &hf_afs_ubik_isclone, { "Is Clone", "afs.ubik.isclone",
FT_UINT32, BASE_HEX, 0, 0, NULL, HFILL }},
{ &hf_afs_reqframe, { "Request Frame", "afs.reqframe",
FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_afs_repframe, { "Reply Frame", "afs.repframe",
FT_FRAMENUM, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_afs_time, { "Time from request", "afs.time",
FT_RELATIVE_TIME, BASE_NONE, NULL, 0, "Time between Request and Reply for AFS calls", HFILL }},
{&hf_afs_fragments, {"Message fragments", "afs.fragments",
FT_NONE, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_fragment, {"Message fragment", "afs.fragment",
FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_fragment_overlap, {"Message fragment overlap", "afs.fragment.overlap",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_fragment_overlap_conflicts, {"Message fragment overlapping with conflicting data", "afs.fragment.overlap.conflicts",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_fragment_multiple_tails, {"Message has multiple tail fragments", "afs.fragment.multiple_tails",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_fragment_too_long_fragment, {"Message fragment too long", "afs.fragment.too_long_fragment",
FT_BOOLEAN, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_fragment_error, {"Message defragmentation error", "afs.fragment.error",
FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_fragment_count, {"Message fragment count", "afs.fragment.count",
FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
{&hf_afs_reassembled_in, {"Reassembled in", "afs.reassembled.in",
FT_FRAMENUM, BASE_NONE, NULL, 0x00, NULL, HFILL } },
{&hf_afs_reassembled_length, {"Reassembled length", "afs.reassembled.length",
FT_UINT32, BASE_DEC, NULL, 0x00, NULL, HFILL } },
};
static int *ett[] = {
&ett_afs,
&ett_afs_op,
&ett_afs_acl,
&ett_afs_fid,
&ett_afs_callback,
&ett_afs_ubikver,
&ett_afs_status,
&ett_afs_status_mask,
&ett_afs_volsync,
&ett_afs_volumeinfo,
&ett_afs_vicestat,
&ett_afs_vldb_flags,
&ett_afs_fragment,
&ett_afs_fragments,
&ett_afs_cm_interfaces,
&ett_afs_cm_capabilities,
};
module_t *afs_module;
proto_afs = proto_register_protocol("Andrew File System (AFS)",
"AFS (RX)", "afs");
proto_register_field_array(proto_afs, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
reassembly_table_register(&afs_reassembly_table,
&addresses_reassembly_table_functions);
afs_request_hash = wmem_map_new_autoreset(wmem_epan_scope(), wmem_file_scope(), afs_hash, afs_equal);
afs_module = prefs_register_protocol(proto_afs, NULL);
prefs_register_bool_preference(afs_module, "defragment",
"Reassemble fragmented AFS PDUs",
"Whether fragmented AFS PDUs should be reassembled", &afs_defragment);
register_dissector("afs", dissect_afs, proto_afs);
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 8
* tab-width: 8
* indent-tabs-mode: t
* End:
*
* vi: set shiftwidth=8 tabstop=8 noexpandtab:
* :indentSize=8:tabSize=8:noTabs=false:
*/
|