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
|
/* packet-sna.c
* Routines for SNA
* Gilbert Ramirez <gram@alumni.rice.edu>
* Jochen Friedrich <jochen@scram.de>
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 1998 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/llcsaps.h>
#include <epan/ppptypes.h>
#include <epan/address_types.h>
#include <epan/prefs.h>
#include <epan/reassemble.h>
#include <epan/to_str.h>
#include "wsutil/pint.h"
/*
* See:
*
* http://web.archive.org/web/20020206033700/http://www.wanresources.com/snacell.html
*
* http://web.archive.org/web/20150522015710/http://www.protocols.com/pbook/sna.htm
*
* Systems Network Architecture Formats, GA27-3136-20:
* https://publibz.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/D50A5007/CCONTENTS
*
* Systems Network Architecture Management Services Formats, GC31-8302-03:
* https://publibfp.boulder.ibm.com/cgi-bin/bookmgr/BOOKS/d50x4002/CCONTENTS
*/
void proto_register_sna(void);
void proto_reg_handoff_sna(void);
static int proto_sna = -1;
static int proto_sna_xid = -1;
static int hf_sna_th = -1;
static int hf_sna_th_0 = -1;
static int hf_sna_th_fid = -1;
static int hf_sna_th_mpf = -1;
static int hf_sna_th_odai = -1;
static int hf_sna_th_efi = -1;
static int hf_sna_th_daf = -1;
static int hf_sna_th_oaf = -1;
static int hf_sna_th_snf = -1;
static int hf_sna_th_dcf = -1;
static int hf_sna_th_lsid = -1;
static int hf_sna_th_tg_sweep = -1;
static int hf_sna_th_er_vr_supp_ind = -1;
static int hf_sna_th_vr_pac_cnt_ind = -1;
static int hf_sna_th_ntwk_prty = -1;
static int hf_sna_th_tgsf = -1;
static int hf_sna_th_mft = -1;
static int hf_sna_th_piubf = -1;
static int hf_sna_th_iern = -1;
static int hf_sna_th_nlpoi = -1;
static int hf_sna_th_nlp_cp = -1;
static int hf_sna_th_ern = -1;
static int hf_sna_th_vrn = -1;
static int hf_sna_th_tpf = -1;
static int hf_sna_th_vr_cwi = -1;
static int hf_sna_th_tg_nonfifo_ind = -1;
static int hf_sna_th_vr_sqti = -1;
static int hf_sna_th_tg_snf = -1;
static int hf_sna_th_vrprq = -1;
static int hf_sna_th_vrprs = -1;
static int hf_sna_th_vr_cwri = -1;
static int hf_sna_th_vr_rwi = -1;
static int hf_sna_th_vr_snf_send = -1;
static int hf_sna_th_dsaf = -1;
static int hf_sna_th_osaf = -1;
static int hf_sna_th_snai = -1;
static int hf_sna_th_def = -1;
static int hf_sna_th_oef = -1;
static int hf_sna_th_sa = -1;
static int hf_sna_th_cmd_fmt = -1;
static int hf_sna_th_cmd_type = -1;
static int hf_sna_th_cmd_sn = -1;
static int hf_sna_th_byte1 = -1;
static int hf_sna_th_byte2 = -1;
static int hf_sna_th_byte3 = -1;
static int hf_sna_th_byte4 = -1;
static int hf_sna_th_byte6 = -1;
static int hf_sna_th_byte16 = -1;
static int hf_sna_nlp_nhdr = -1;
static int hf_sna_nlp_nhdr_0 = -1;
static int hf_sna_nlp_sm = -1;
static int hf_sna_nlp_tpf = -1;
static int hf_sna_nlp_nhdr_1 = -1;
static int hf_sna_nlp_ft = -1;
static int hf_sna_nlp_tspi = -1;
static int hf_sna_nlp_slowdn1 = -1;
static int hf_sna_nlp_slowdn2 = -1;
static int hf_sna_nlp_fra = -1;
static int hf_sna_nlp_anr = -1;
static int hf_sna_nlp_frh = -1;
static int hf_sna_nlp_thdr = -1;
static int hf_sna_nlp_tcid = -1;
static int hf_sna_nlp_thdr_8 = -1;
static int hf_sna_nlp_setupi = -1;
static int hf_sna_nlp_somi = -1;
static int hf_sna_nlp_eomi = -1;
static int hf_sna_nlp_sri = -1;
static int hf_sna_nlp_rasapi = -1;
static int hf_sna_nlp_retryi = -1;
static int hf_sna_nlp_thdr_9 = -1;
static int hf_sna_nlp_lmi = -1;
static int hf_sna_nlp_cqfi = -1;
static int hf_sna_nlp_osi = -1;
static int hf_sna_nlp_offset = -1;
static int hf_sna_nlp_dlf = -1;
static int hf_sna_nlp_bsn = -1;
static int hf_sna_nlp_opti_len = -1;
static int hf_sna_nlp_opti_type = -1;
static int hf_sna_nlp_opti_0d_version = -1;
static int hf_sna_nlp_opti_0d_4 = -1;
static int hf_sna_nlp_opti_0d_target = -1;
static int hf_sna_nlp_opti_0d_arb = -1;
static int hf_sna_nlp_opti_0d_reliable = -1;
static int hf_sna_nlp_opti_0d_dedicated = -1;
static int hf_sna_nlp_opti_0e_stat = -1;
static int hf_sna_nlp_opti_0e_gap = -1;
static int hf_sna_nlp_opti_0e_idle = -1;
static int hf_sna_nlp_opti_0e_nabsp = -1;
static int hf_sna_nlp_opti_0e_sync = -1;
static int hf_sna_nlp_opti_0e_echo = -1;
static int hf_sna_nlp_opti_0e_rseq = -1;
/* static int hf_sna_nlp_opti_0e_abspbeg = -1; */
/* static int hf_sna_nlp_opti_0e_abspend = -1; */
static int hf_sna_nlp_opti_0f_bits = -1;
static int hf_sna_nlp_opti_10_tcid = -1;
static int hf_sna_nlp_opti_12_sense = -1;
static int hf_sna_nlp_opti_14_si_len = -1;
static int hf_sna_nlp_opti_14_si_key = -1;
static int hf_sna_nlp_opti_14_si_2 = -1;
static int hf_sna_nlp_opti_14_si_refifo = -1;
static int hf_sna_nlp_opti_14_si_mobility = -1;
static int hf_sna_nlp_opti_14_si_dirsearch = -1;
static int hf_sna_nlp_opti_14_si_limitres = -1;
static int hf_sna_nlp_opti_14_si_ncescope = -1;
static int hf_sna_nlp_opti_14_si_mnpsrscv = -1;
static int hf_sna_nlp_opti_14_si_maxpsize = -1;
static int hf_sna_nlp_opti_14_si_switch = -1;
static int hf_sna_nlp_opti_14_si_alive = -1;
static int hf_sna_nlp_opti_14_rr_len = -1;
static int hf_sna_nlp_opti_14_rr_key = -1;
static int hf_sna_nlp_opti_14_rr_2 = -1;
static int hf_sna_nlp_opti_14_rr_bfe = -1;
static int hf_sna_nlp_opti_14_rr_num = -1;
static int hf_sna_nlp_opti_22_2 = -1;
static int hf_sna_nlp_opti_22_type = -1;
static int hf_sna_nlp_opti_22_raa = -1;
static int hf_sna_nlp_opti_22_parity = -1;
static int hf_sna_nlp_opti_22_arb = -1;
static int hf_sna_nlp_opti_22_3 = -1;
static int hf_sna_nlp_opti_22_ratereq = -1;
static int hf_sna_nlp_opti_22_raterep = -1;
static int hf_sna_nlp_opti_22_field1 = -1;
static int hf_sna_nlp_opti_22_field2 = -1;
static int hf_sna_nlp_opti_22_field3 = -1;
static int hf_sna_nlp_opti_22_field4 = -1;
static int hf_sna_rh = -1;
static int hf_sna_rh_0 = -1;
static int hf_sna_rh_1 = -1;
static int hf_sna_rh_2 = -1;
static int hf_sna_rh_rri = -1;
static int hf_sna_rh_ru_category = -1;
static int hf_sna_rh_fi = -1;
static int hf_sna_rh_sdi = -1;
static int hf_sna_rh_bci = -1;
static int hf_sna_rh_eci = -1;
static int hf_sna_rh_dr1 = -1;
static int hf_sna_rh_lcci = -1;
static int hf_sna_rh_dr2 = -1;
static int hf_sna_rh_eri = -1;
static int hf_sna_rh_rti = -1;
static int hf_sna_rh_rlwi = -1;
static int hf_sna_rh_qri = -1;
static int hf_sna_rh_pi = -1;
static int hf_sna_rh_bbi = -1;
static int hf_sna_rh_ebi = -1;
static int hf_sna_rh_cdi = -1;
static int hf_sna_rh_csi = -1;
static int hf_sna_rh_edi = -1;
static int hf_sna_rh_pdi = -1;
static int hf_sna_rh_cebi = -1;
/*static int hf_sna_ru = -1;*/
static int hf_sna_gds = -1;
static int hf_sna_gds_len = -1;
static int hf_sna_gds_type = -1;
static int hf_sna_gds_cont = -1;
static int hf_sna_gds_info = -1;
/* static int hf_sna_xid = -1; */
static int hf_sna_xid_0 = -1;
static int hf_sna_xid_id = -1;
static int hf_sna_xid_format = -1;
static int hf_sna_xid_type = -1;
static int hf_sna_xid_len = -1;
static int hf_sna_xid_idblock = -1;
static int hf_sna_xid_idnum = -1;
static int hf_sna_xid_3_8 = -1;
static int hf_sna_xid_3_init_self = -1;
static int hf_sna_xid_3_stand_bind = -1;
static int hf_sna_xid_3_gener_bind = -1;
static int hf_sna_xid_3_recve_bind = -1;
static int hf_sna_xid_3_actpu = -1;
static int hf_sna_xid_3_nwnode = -1;
static int hf_sna_xid_3_cp = -1;
static int hf_sna_xid_3_cpcp = -1;
static int hf_sna_xid_3_state = -1;
static int hf_sna_xid_3_nonact = -1;
static int hf_sna_xid_3_cpchange = -1;
static int hf_sna_xid_3_10 = -1;
static int hf_sna_xid_3_asend_bind = -1;
static int hf_sna_xid_3_arecv_bind = -1;
static int hf_sna_xid_3_quiesce = -1;
static int hf_sna_xid_3_pucap = -1;
static int hf_sna_xid_3_pbn = -1;
static int hf_sna_xid_3_pacing = -1;
static int hf_sna_xid_3_11 = -1;
static int hf_sna_xid_3_tgshare = -1;
static int hf_sna_xid_3_dedsvc = -1;
static int hf_sna_xid_3_12 = -1;
static int hf_sna_xid_3_negcsup = -1;
static int hf_sna_xid_3_negcomp = -1;
static int hf_sna_xid_3_15 = -1;
static int hf_sna_xid_3_partg = -1;
static int hf_sna_xid_3_dlur = -1;
static int hf_sna_xid_3_dlus = -1;
static int hf_sna_xid_3_exbn = -1;
static int hf_sna_xid_3_genodai = -1;
static int hf_sna_xid_3_branch = -1;
static int hf_sna_xid_3_brnn = -1;
static int hf_sna_xid_3_tg = -1;
static int hf_sna_xid_3_dlc = -1;
static int hf_sna_xid_3_dlen = -1;
static int hf_sna_control_len = -1;
static int hf_sna_control_key = -1;
static int hf_sna_control_hprkey = -1;
static int hf_sna_control_05_delay = -1;
static int hf_sna_control_05_type = -1;
static int hf_sna_control_05_ptp = -1;
static int hf_sna_control_0e_type = -1;
static int hf_sna_control_0e_value = -1;
static int hf_sna_padding = -1;
static int hf_sna_reserved = -1;
static int hf_sna_biu_segment_data = -1;
static gint ett_sna = -1;
static gint ett_sna_th = -1;
static gint ett_sna_th_fid = -1;
static gint ett_sna_nlp_nhdr = -1;
static gint ett_sna_nlp_nhdr_0 = -1;
static gint ett_sna_nlp_nhdr_1 = -1;
static gint ett_sna_nlp_thdr = -1;
static gint ett_sna_nlp_thdr_8 = -1;
static gint ett_sna_nlp_thdr_9 = -1;
static gint ett_sna_nlp_opti_un = -1;
static gint ett_sna_nlp_opti_0d = -1;
static gint ett_sna_nlp_opti_0d_4 = -1;
static gint ett_sna_nlp_opti_0e = -1;
static gint ett_sna_nlp_opti_0e_stat = -1;
static gint ett_sna_nlp_opti_0e_absp = -1;
static gint ett_sna_nlp_opti_0f = -1;
static gint ett_sna_nlp_opti_10 = -1;
static gint ett_sna_nlp_opti_12 = -1;
static gint ett_sna_nlp_opti_14 = -1;
static gint ett_sna_nlp_opti_14_si = -1;
static gint ett_sna_nlp_opti_14_si_2 = -1;
static gint ett_sna_nlp_opti_14_rr = -1;
static gint ett_sna_nlp_opti_14_rr_2 = -1;
static gint ett_sna_nlp_opti_22 = -1;
static gint ett_sna_nlp_opti_22_2 = -1;
static gint ett_sna_nlp_opti_22_3 = -1;
static gint ett_sna_rh = -1;
static gint ett_sna_rh_0 = -1;
static gint ett_sna_rh_1 = -1;
static gint ett_sna_rh_2 = -1;
static gint ett_sna_gds = -1;
static gint ett_sna_xid_0 = -1;
static gint ett_sna_xid_id = -1;
static gint ett_sna_xid_3_8 = -1;
static gint ett_sna_xid_3_10 = -1;
static gint ett_sna_xid_3_11 = -1;
static gint ett_sna_xid_3_12 = -1;
static gint ett_sna_xid_3_15 = -1;
static gint ett_sna_control_un = -1;
static gint ett_sna_control_05 = -1;
static gint ett_sna_control_05hpr = -1;
static gint ett_sna_control_05hpr_type = -1;
static gint ett_sna_control_0e = -1;
static dissector_handle_t sna_handle;
static dissector_handle_t sna_xid_handle;
static int sna_address_type = -1;
/* Defragment fragmented SNA BIUs*/
static gboolean sna_defragment = TRUE;
static reassembly_table sna_reassembly_table;
/* Format Identifier */
static const value_string sna_th_fid_vals[] = {
{ 0x0, "SNA device <--> Non-SNA Device" },
{ 0x1, "Subarea Nodes, without ER or VR" },
{ 0x2, "Subarea Node <--> PU2" },
{ 0x3, "Subarea Node or SNA host <--> Subarea Node" },
{ 0x4, "Subarea Nodes, supporting ER and VR" },
{ 0x5, "HPR RTP endpoint nodes" },
{ 0xa, "HPR NLP Frame Routing" },
{ 0xb, "HPR NLP Frame Routing" },
{ 0xc, "HPR NLP Automatic Network Routing" },
{ 0xd, "HPR NLP Automatic Network Routing" },
{ 0xf, "Adjacent Subarea Nodes, supporting ER and VR" },
{ 0x0, NULL }
};
/* Mapping Field */
#define MPF_MIDDLE_SEGMENT 0
#define MPF_LAST_SEGMENT 1
#define MPF_FIRST_SEGMENT 2
#define MPF_WHOLE_BIU 3
static const value_string sna_th_mpf_vals[] = {
{ MPF_MIDDLE_SEGMENT, "Middle segment of a BIU" },
{ MPF_LAST_SEGMENT, "Last segment of a BIU" },
{ MPF_FIRST_SEGMENT, "First segment of a BIU" },
{ MPF_WHOLE_BIU, "Whole BIU" },
{ 0, NULL }
};
/* Expedited Flow Indicator */
static const value_string sna_th_efi_vals[] = {
{ 0, "Normal Flow" },
{ 1, "Expedited Flow" },
{ 0x0, NULL }
};
/* Request/Response Indicator */
static const value_string sna_rh_rri_vals[] = {
{ 0, "Request" },
{ 1, "Response" },
{ 0x0, NULL }
};
/* Request/Response Unit Category */
static const value_string sna_rh_ru_category_vals[] = {
{ 0, "Function Management Data (FMD)" },
{ 1, "Network Control (NC)" },
{ 2, "Data Flow Control (DFC)" },
{ 3, "Session Control (SC)" },
{ 0x0, NULL }
};
/* Format Indicator */
static const true_false_string sna_rh_fi_truth =
{ "FM Header", "No FM Header" };
/* Begin Chain Indicator */
static const true_false_string sna_rh_bci_truth =
{ "First in Chain", "Not First in Chain" };
/* End Chain Indicator */
static const true_false_string sna_rh_eci_truth =
{ "Last in Chain", "Not Last in Chain" };
/* Lengith-Checked Compression Indicator */
static const true_false_string sna_rh_lcci_truth =
{ "Compressed", "Not Compressed" };
/* Response Type Indicator */
static const true_false_string sna_rh_rti_truth =
{ "Negative", "Positive" };
/* Queued Response Indicator */
static const true_false_string sna_rh_qri_truth =
{ "Enqueue response in TC queues", "Response bypasses TC queues" };
/* Code Selection Indicator */
static const value_string sna_rh_csi_vals[] = {
{ 0, "EBCDIC" },
{ 1, "ASCII" },
{ 0x0, NULL }
};
/* TG Sweep */
static const value_string sna_th_tg_sweep_vals[] = {
{ 0, "This PIU may overtake any PU ahead of it." },
{ 1, "This PIU does not overtake any PIU ahead of it." },
{ 0x0, NULL }
};
/* ER_VR_SUPP_IND */
static const value_string sna_th_er_vr_supp_ind_vals[] = {
{ 0, "Each node supports ER and VR protocols" },
{ 1, "Includes at least one node that does not support ER and VR"
" protocols" },
{ 0x0, NULL }
};
/* VR_PAC_CNT_IND */
static const value_string sna_th_vr_pac_cnt_ind_vals[] = {
{ 0, "Pacing count on the VR has not reached 0" },
{ 1, "Pacing count on the VR has reached 0" },
{ 0x0, NULL }
};
/* NTWK_PRTY */
static const value_string sna_th_ntwk_prty_vals[] = {
{ 0, "PIU flows at a lower priority" },
{ 1, "PIU flows at network priority (highest transmission priority)" },
{ 0x0, NULL }
};
/* TGSF */
static const value_string sna_th_tgsf_vals[] = {
{ 0, "Not segmented" },
{ 1, "Last segment" },
{ 2, "First segment" },
{ 3, "Middle segment" },
{ 0x0, NULL }
};
/* PIUBF */
static const value_string sna_th_piubf_vals[] = {
{ 0, "Single PIU frame" },
{ 1, "Last PIU of a multiple PIU frame" },
{ 2, "First PIU of a multiple PIU frame" },
{ 3, "Middle PIU of a multiple PIU frame" },
{ 0x0, NULL }
};
/* NLPOI */
static const value_string sna_th_nlpoi_vals[] = {
{ 0, "NLP starts within this FID4 TH" },
{ 1, "NLP byte 0 starts after RH byte 0 following NLP C/P pad" },
{ 0x0, NULL }
};
/* TPF */
static const value_string sna_th_tpf_vals[] = {
{ 0, "Low Priority" },
{ 1, "Medium Priority" },
{ 2, "High Priority" },
{ 3, "Network Priority" },
{ 0x0, NULL }
};
/* VR_CWI */
static const value_string sna_th_vr_cwi_vals[] = {
{ 0, "Increment window size" },
{ 1, "Decrement window size" },
{ 0x0, NULL }
};
/* TG_NONFIFO_IND */
static const true_false_string sna_th_tg_nonfifo_ind_truth =
{ "TG FIFO is not required", "TG FIFO is required" };
/* VR_SQTI */
static const value_string sna_th_vr_sqti_vals[] = {
{ 0, "Non-sequenced, Non-supervisory" },
{ 1, "Non-sequenced, Supervisory" },
{ 2, "Singly-sequenced" },
{ 0x0, NULL }
};
/* VRPRQ */
static const true_false_string sna_th_vrprq_truth = {
"VR pacing request is sent asking for a VR pacing response",
"No VR pacing response is requested",
};
/* VRPRS */
static const true_false_string sna_th_vrprs_truth = {
"VR pacing response is sent in response to a VRPRQ bit set",
"No pacing response sent",
};
/* VR_CWRI */
static const value_string sna_th_vr_cwri_vals[] = {
{ 0, "Increment window size by 1" },
{ 1, "Decrement window size by 1" },
{ 0x0, NULL }
};
/* VR_RWI */
static const true_false_string sna_th_vr_rwi_truth = {
"Reset window size to the minimum specified in NC_ACTVR",
"Do not reset window size",
};
/* Switching Mode */
static const value_string sna_nlp_sm_vals[] = {
{ 5, "Function routing" },
{ 6, "Automatic network routing" },
{ 0x0, NULL }
};
static const true_false_string sna_nlp_tspi_truth =
{ "Time sensitive", "Not time sensitive" };
static const true_false_string sna_nlp_slowdn1_truth =
{ "Minor congestion", "No minor congestion" };
static const true_false_string sna_nlp_slowdn2_truth =
{ "Major congestion", "No major congestion" };
/* Function Type */
static const value_string sna_nlp_ft_vals[] = {
{ 0x10, "LDLC" },
{ 0x0, NULL }
};
static const value_string sna_nlp_frh_vals[] = {
{ 0x03, "XID complete request" },
{ 0x04, "XID complete response" },
{ 0x0, NULL }
};
static const true_false_string sna_nlp_setupi_truth =
{ "Connection setup segment present", "Connection setup segment not"
" present" };
static const true_false_string sna_nlp_somi_truth =
{ "Start of message", "Not start of message" };
static const true_false_string sna_nlp_eomi_truth =
{ "End of message", "Not end of message" };
static const true_false_string sna_nlp_sri_truth =
{ "Status requested", "No status requested" };
static const true_false_string sna_nlp_rasapi_truth =
{ "Reply as soon as possible", "No need to reply as soon as possible" };
static const true_false_string sna_nlp_retryi_truth =
{ "Undefined", "Sender will retransmit" };
static const true_false_string sna_nlp_lmi_truth =
{ "Last message", "Not last message" };
static const true_false_string sna_nlp_cqfi_truth =
{ "CQFI included", "CQFI not included" };
static const true_false_string sna_nlp_osi_truth =
{ "Optional segments present", "No optional segments present" };
static const value_string sna_xid_3_state_vals[] = {
{ 0x00, "Exchange state indicators not supported" },
{ 0x01, "Negotiation-proceeding exchange" },
{ 0x02, "Prenegotiation exchange" },
{ 0x03, "Nonactivation exchange" },
{ 0x0, NULL }
};
static const value_string sna_xid_3_branch_vals[] = {
{ 0x00, "Sender does not support branch extender" },
{ 0x01, "TG is branch uplink" },
{ 0x02, "TG is branch downlink" },
{ 0x03, "TG is neither uplink nor downlink" },
{ 0x0, NULL }
};
static const value_string sna_xid_type_vals[] = {
{ 0x01, "T1 node" },
{ 0x02, "T2.0 or T2.1 node" },
{ 0x03, "Reserved" },
{ 0x04, "T4 or T5 node" },
{ 0x0, NULL }
};
static const value_string sna_nlp_opti_vals[] = {
{ 0x0d, "Connection Setup Segment" },
{ 0x0e, "Status Segment" },
{ 0x0f, "Client Out Of Band Bits Segment" },
{ 0x10, "Connection Identifier Exchange Segment" },
{ 0x12, "Connection Fault Segment" },
{ 0x14, "Switching Information Segment" },
{ 0x22, "Adaptive Rate-Based Segment" },
{ 0x0, NULL }
};
static const value_string sna_nlp_opti_0d_version_vals[] = {
{ 0x0101, "Version 1.1" },
{ 0x0, NULL }
};
static const value_string sna_nlp_opti_0f_bits_vals[] = {
{ 0x0001, "Request Deactivation" },
{ 0x8000, "Reply - OK" },
{ 0x8004, "Reply - Reject" },
{ 0x0, NULL }
};
static const value_string sna_nlp_opti_22_type_vals[] = {
{ 0x00, "Setup" },
{ 0x01, "Rate Reply" },
{ 0x02, "Rate Request" },
{ 0x03, "Rate Request/Rate Reply" },
{ 0x0, NULL }
};
static const value_string sna_nlp_opti_22_raa_vals[] = {
{ 0x00, "Normal" },
{ 0x01, "Restraint" },
{ 0x02, "Slowdown1" },
{ 0x03, "Slowdown2" },
{ 0x04, "Critical" },
{ 0x0, NULL }
};
static const value_string sna_nlp_opti_22_arb_vals[] = {
{ 0x00, "Base Mode ARB" },
{ 0x01, "Responsive Mode ARB" },
{ 0x0, NULL }
};
/* GDS Variable Type */
static const value_string sna_gds_var_vals[] = {
{ 0x1210, "Change Number Of Sessions" },
{ 0x1211, "Exchange Log Name" },
{ 0x1212, "Control Point Management Services Unit" },
{ 0x1213, "Compare States" },
{ 0x1214, "LU Names Position" },
{ 0x1215, "LU Name" },
{ 0x1217, "Do Know" },
{ 0x1218, "Partner Restart" },
{ 0x1219, "Don't Know" },
{ 0x1220, "Sign-Off" },
{ 0x1221, "Sign-On" },
{ 0x1222, "SNMP-over-SNA" },
{ 0x1223, "Node Address Service" },
{ 0x12C1, "CP Capabilities" },
{ 0x12C2, "Topology Database Update" },
{ 0x12C3, "Register Resource" },
{ 0x12C4, "Locate" },
{ 0x12C5, "Cross-Domain Initiate" },
{ 0x12C9, "Delete Resource" },
{ 0x12CA, "Find Resource" },
{ 0x12CB, "Found Resource" },
{ 0x12CC, "Notify" },
{ 0x12CD, "Initiate-Other Cross-Domain" },
{ 0x12CE, "Route Setup" },
{ 0x12E1, "Error Log" },
{ 0x12F1, "Null Data" },
{ 0x12F2, "User Control Date" },
{ 0x12F3, "Map Name" },
{ 0x12F4, "Error Data" },
{ 0x12F6, "Authentication Token Data" },
{ 0x12F8, "Service Flow Authentication Token Data" },
{ 0x12FF, "Application Data" },
{ 0x1310, "MDS Message Unit" },
{ 0x1311, "MDS Routing Information" },
{ 0x1500, "FID2 Encapsulation" },
{ 0x0, NULL }
};
/* Control Vector Type */
static const value_string sna_control_vals[] = {
{ 0x00, "SSCP-LU Session Capabilities Control Vector" },
{ 0x01, "Date-Time Control Vector" },
{ 0x02, "Subarea Routing Control Vector" },
{ 0x03, "SDLC Secondary Station Control Vector" },
{ 0x04, "LU Control Vector" },
{ 0x05, "Channel Control Vector" },
{ 0x06, "Cross-Domain Resource Manager (CDRM) Control Vector" },
{ 0x07, "PU FMD-RU-Usage Control Vector" },
{ 0x08, "Intensive Mode Control Vector" },
{ 0x09, "Activation Request / Response Sequence Identifier Control"
" Vector" },
{ 0x0a, "User Request Correlator Control Vector" },
{ 0x0b, "SSCP-PU Session Capabilities Control Vector" },
{ 0x0c, "LU-LU Session Capabilities Control Vector" },
{ 0x0d, "Mode / Class-of-Service / Virtual-Route-Identifier List"
" Control Vector" },
{ 0x0e, "Network Name Control Vector" },
{ 0x0f, "Link Capabilities and Status Control Vector" },
{ 0x10, "Product Set ID Control Vector" },
{ 0x11, "Load Module Correlation Control Vector" },
{ 0x12, "Network Identifier Control Vector" },
{ 0x13, "Gateway Support Capabilities Control Vector" },
{ 0x14, "Session Initiation Control Vector" },
{ 0x15, "Network-Qualified Address Pair Control Vector" },
{ 0x16, "Names Substitution Control Vector" },
{ 0x17, "SSCP Identifier Control Vector" },
{ 0x18, "SSCP Name Control Vector" },
{ 0x19, "Resource Identifier Control Vector" },
{ 0x1a, "NAU Address Control Vector" },
{ 0x1b, "VRID List Control Vector" },
{ 0x1c, "Network-Qualified Name Pair Control Vector" },
{ 0x1e, "VR-ER Mapping Data Control Vector" },
{ 0x1f, "ER Configuration Control Vector" },
{ 0x23, "Local-Form Session Identifier Control Vector" },
{ 0x24, "IPL Load Module Request Control Vector" },
{ 0x25, "Security ID Control Control Vector" },
{ 0x26, "Network Connection Endpoint Identifier Control Vector" },
{ 0x27, "XRF Session Activation Control Vector" },
{ 0x28, "Related Session Identifier Control Vector" },
{ 0x29, "Session State Data Control Vector" },
{ 0x2a, "Session Information Control Vector" },
{ 0x2b, "Route Selection Control Vector" },
{ 0x2c, "COS/TPF Control Vector" },
{ 0x2d, "Mode Control Vector" },
{ 0x2f, "LU Definition Control Vector" },
{ 0x30, "Assign LU Characteristics Control Vector" },
{ 0x31, "BIND Image Control Vector" },
{ 0x32, "Short-Hold Mode Control Vector" },
{ 0x33, "ENCP Search Control Control Vector" },
{ 0x34, "LU Definition Override Control Vector" },
{ 0x35, "Extended Sense Data Control Vector" },
{ 0x36, "Directory Error Control Vector" },
{ 0x37, "Directory Entry Correlator Control Vector" },
{ 0x38, "Short-Hold Mode Emulation Control Vector" },
{ 0x39, "Network Connection Endpoint (NCE) Instance Identifier"
" Control Vector" },
{ 0x3a, "Route Status Data Control Vector" },
{ 0x3b, "VR Congestion Data Control Vector" },
{ 0x3c, "Associated Resource Entry Control Vector" },
{ 0x3d, "Directory Entry Control Vector" },
{ 0x3e, "Directory Entry Characteristic Control Vector" },
{ 0x3f, "SSCP (SLU) Capabilities Control Vector" },
{ 0x40, "Real Associated Resource Control Vector" },
{ 0x41, "Station Parameters Control Vector" },
{ 0x42, "Dynamic Path Update Data Control Vector" },
{ 0x43, "Extended SDLC Station Control Vector" },
{ 0x44, "Node Descriptor Control Vector" },
{ 0x45, "Node Characteristics Control Vector" },
{ 0x46, "TG Descriptor Control Vector" },
{ 0x47, "TG Characteristics Control Vector" },
{ 0x48, "Topology Resource Descriptor Control Vector" },
{ 0x49, "Multinode Persistent Sessions (MNPS) LU Names Control"
" Vector" },
{ 0x4a, "Real Owning Control Point Control Vector" },
{ 0x4b, "RTP Transport Connection Identifier Control Vector" },
{ 0x51, "DLUR/S Capabilities Control Vector" },
{ 0x52, "Primary Send Pacing Window Size Control Vector" },
{ 0x56, "Call Security Verification Control Vector" },
{ 0x57, "DLC Connection Data Control Vector" },
{ 0x59, "Installation-Defined CDINIT Data Control Vector" },
{ 0x5a, "Session Services Extension Support Control Vector" },
{ 0x5b, "Interchange Node Support Control Vector" },
{ 0x5c, "APPN Message Transport Control Vector" },
{ 0x5d, "Subarea Message Transport Control Vector" },
{ 0x5e, "Related Request Control Vector" },
{ 0x5f, "Extended Fully Qualified PCID Control Vector" },
{ 0x60, "Fully Qualified PCID Control Vector" },
{ 0x61, "HPR Capabilities Control Vector" },
{ 0x62, "Session Address Control Vector" },
{ 0x63, "Cryptographic Key Distribution Control Vector" },
{ 0x64, "TCP/IP Information Control Vector" },
{ 0x65, "Device Characteristics Control Vector" },
{ 0x66, "Length-Checked Compression Control Vector" },
{ 0x67, "Automatic Network Routing (ANR) Path Control Vector" },
{ 0x68, "XRF/Session Cryptography Control Vector" },
{ 0x69, "Switched Parameters Control Vector" },
{ 0x6a, "ER Congestion Data Control Vector" },
{ 0x71, "Triple DES Cryptography Key Continuation Control Vector" },
{ 0xfe, "Control Vector Keys Not Recognized" },
{ 0x0, NULL }
};
static const value_string sna_control_hpr_vals[] = {
{ 0x00, "Node Identifier Control Vector" },
{ 0x03, "Network ID Control Vector" },
{ 0x05, "Network Address Control Vector" },
{ 0x0, NULL }
};
static const value_string sna_control_0e_type_vals[] = {
{ 0xF1, "PU Name" },
{ 0xF3, "LU Name" },
{ 0xF4, "CP Name" },
{ 0xF5, "SSCP Name" },
{ 0xF6, "NNCP Name" },
{ 0xF7, "Link Station Name" },
{ 0xF8, "CP Name of CP(PLU)" },
{ 0xF9, "CP Name of CP(SLU)" },
{ 0xFA, "Generic Name" },
{ 0x0, NULL }
};
/* Values to direct the top-most dissector what to dissect
* after the TH. */
enum next_dissection_enum {
stop_here,
rh_only,
everything
};
enum parse {
LT,
KL
};
/*
* Structure used to represent an FID Type 4 address; gives the layout of the
* data pointed to by an AT_SNA "address" structure if the size is
* SNA_FID_TYPE_4_ADDR_LEN.
*/
#define SNA_FID_TYPE_4_ADDR_LEN 6
struct sna_fid_type_4_addr {
guint32 saf;
guint16 ef;
};
typedef enum next_dissection_enum next_dissection_t;
static void dissect_xid (tvbuff_t*, packet_info*, proto_tree*, proto_tree*);
static void dissect_fid (tvbuff_t*, packet_info*, proto_tree*, proto_tree*);
static void dissect_nlp (tvbuff_t*, packet_info*, proto_tree*, proto_tree*);
static void dissect_gds (tvbuff_t*, packet_info*, proto_tree*, proto_tree*);
static void dissect_rh (tvbuff_t*, int, proto_tree*);
static void dissect_sna_control(tvbuff_t* parent_tvb, int offset, int control_len, proto_tree* tree, int hpr, enum parse parse);
static int sna_fid_to_str_buf(const address *addr, gchar *buf, int buf_len _U_)
{
const guint8 *addrdata;
struct sna_fid_type_4_addr sna_fid_type_4_addr;
gchar *bufp = buf;
switch (addr->len) {
case 1:
addrdata = (const guint8 *)addr->data;
word_to_hex(buf, addrdata[0]);
buf[4] = '\0';
break;
case 2:
addrdata = (const guint8 *)addr->data;
word_to_hex(buf, pntoh16(&addrdata[0]));
buf[4] = '\0';
break;
case SNA_FID_TYPE_4_ADDR_LEN:
/* FID Type 4 */
memcpy(&sna_fid_type_4_addr, addr->data, SNA_FID_TYPE_4_ADDR_LEN);
bufp = dword_to_hex(bufp, sna_fid_type_4_addr.saf);
*bufp++ = '.';
bufp = word_to_hex(bufp, sna_fid_type_4_addr.ef);
*bufp++ = '\0'; /* NULL terminate */
break;
default:
buf[0] = '\0';
return 1;
}
return (int)strlen(buf)+1;
}
static int sna_address_str_len(const address* addr _U_)
{
/* We could do this based on address length, but 14 bytes isn't THAT much space */
return 14;
}
/* --------------------------------------------------------------------
* Chapter 2 High-Performance Routing (HPR) Headers
* --------------------------------------------------------------------
*/
static void
dissect_optional_0d(tvbuff_t *tvb, proto_tree *tree)
{
int offset, len, pad;
static int * const fields[] = {
&hf_sna_nlp_opti_0d_target,
&hf_sna_nlp_opti_0d_arb,
&hf_sna_nlp_opti_0d_reliable,
&hf_sna_nlp_opti_0d_dedicated,
NULL
};
if (!tree)
return;
proto_tree_add_item(tree, hf_sna_nlp_opti_0d_version, tvb, 2, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, 4, hf_sna_nlp_opti_0d_4,
ett_sna_nlp_opti_0d_4, fields, ENC_NA);
proto_tree_add_item(tree, hf_sna_reserved, tvb, 5, 3, ENC_NA);
offset = 8;
while (tvb_offset_exists(tvb, offset)) {
len = tvb_get_guint8(tvb, offset+0);
if (len) {
dissect_sna_control(tvb, offset, len, tree, 1, LT);
pad = (len+3) & 0xfffc;
if (pad > len)
proto_tree_add_item(tree, hf_sna_padding, tvb, offset+len, pad-len, ENC_NA);
offset += pad;
} else {
/* Avoid endless loop */
return;
}
}
}
static void
dissect_optional_0e(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int bits, offset;
static int * const fields[] = {
&hf_sna_nlp_opti_0e_gap,
&hf_sna_nlp_opti_0e_idle,
NULL
};
bits = tvb_get_guint8(tvb, 2);
offset = 20;
proto_tree_add_bitmask(tree, tvb, 2, hf_sna_nlp_opti_0e_stat,
ett_sna_nlp_opti_0e_stat, fields, ENC_NA);
proto_tree_add_item(tree, hf_sna_nlp_opti_0e_nabsp,
tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_nlp_opti_0e_sync,
tvb, 4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_nlp_opti_0e_echo,
tvb, 6, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_nlp_opti_0e_rseq,
tvb, 8, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_reserved, tvb, 12, 8, ENC_NA);
if (tvb_offset_exists(tvb, offset))
call_data_dissector(tvb_new_subset_remaining(tvb, 4), pinfo, tree);
if (bits & 0x40) {
col_set_str(pinfo->cinfo, COL_INFO, "HPR Idle Message");
} else {
col_set_str(pinfo->cinfo, COL_INFO, "HPR Status Message");
}
}
static void
dissect_optional_0f(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_item(tree, hf_sna_nlp_opti_0f_bits, tvb, 2, 2, ENC_BIG_ENDIAN);
if (tvb_offset_exists(tvb, 4))
call_data_dissector(tvb_new_subset_remaining(tvb, 4), pinfo, tree);
}
static void
dissect_optional_10(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree_add_item(tree, hf_sna_reserved, tvb, 2, 2, ENC_NA);
proto_tree_add_item(tree, hf_sna_nlp_opti_10_tcid, tvb, 4, 8, ENC_NA);
if (tvb_offset_exists(tvb, 12))
call_data_dissector(tvb_new_subset_remaining(tvb, 12), pinfo, tree);
}
static void
dissect_optional_12(tvbuff_t *tvb, proto_tree *tree)
{
proto_tree_add_item(tree, hf_sna_reserved, tvb, 2, 2, ENC_NA);
proto_tree_add_item(tree, hf_sna_nlp_opti_12_sense, tvb, 4, -1, ENC_NA);
}
static void
dissect_optional_14(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *sub_tree;
int len, pad, type, offset, num, sublen;
static int * const opti_14_si_fields[] = {
&hf_sna_nlp_opti_14_si_refifo,
&hf_sna_nlp_opti_14_si_mobility,
&hf_sna_nlp_opti_14_si_dirsearch,
&hf_sna_nlp_opti_14_si_limitres,
&hf_sna_nlp_opti_14_si_ncescope,
&hf_sna_nlp_opti_14_si_mnpsrscv,
NULL
};
static int * const opti_14_rr_fields[] = {
&hf_sna_nlp_opti_14_rr_bfe,
NULL
};
proto_tree_add_item(tree, hf_sna_reserved, tvb, 2, 2, ENC_NA);
offset = 4;
len = tvb_get_guint8(tvb, offset);
type = tvb_get_guint8(tvb, offset+1);
if ((type != 0x83) || (len <= 16)) {
/* Invalid */
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
sub_tree = proto_tree_add_subtree(tree, tvb, offset, len,
ett_sna_nlp_opti_14_si, NULL, "Switching Information Control Vector");
proto_tree_add_uint(sub_tree, hf_sna_nlp_opti_14_si_len,
tvb, offset, 1, len);
proto_tree_add_uint(sub_tree, hf_sna_nlp_opti_14_si_key,
tvb, offset+1, 1, type);
proto_tree_add_bitmask(tree, tvb, offset+2, hf_sna_nlp_opti_14_si_2,
ett_sna_nlp_opti_14_si_2, opti_14_si_fields, ENC_NA);
proto_tree_add_item(sub_tree, hf_sna_reserved, tvb, offset+3, 1, ENC_NA);
proto_tree_add_item(sub_tree, hf_sna_nlp_opti_14_si_maxpsize,
tvb, offset+4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_sna_nlp_opti_14_si_switch,
tvb, offset+8, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(sub_tree, hf_sna_nlp_opti_14_si_alive,
tvb, offset+12, 4, ENC_BIG_ENDIAN);
dissect_sna_control(tvb, offset+16, len-16, sub_tree, 1, LT);
pad = (len+3) & 0xfffc;
if (pad > len)
proto_tree_add_item(sub_tree, hf_sna_padding, tvb, offset+len, pad-len, ENC_NA);
offset += pad;
len = tvb_get_guint8(tvb, offset);
type = tvb_get_guint8(tvb, offset+1);
if ((type != 0x85) || ( len < 4)) {
/* Invalid */
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
sub_tree = proto_tree_add_subtree(tree, tvb, offset, len,
ett_sna_nlp_opti_14_rr, NULL, "Return Route TG Descriptor Control Vector");
proto_tree_add_uint(sub_tree, hf_sna_nlp_opti_14_rr_len,
tvb, offset, 1, len);
proto_tree_add_uint(sub_tree, hf_sna_nlp_opti_14_rr_key,
tvb, offset+1, 1, type);
proto_tree_add_bitmask(tree, tvb, offset+2, hf_sna_nlp_opti_14_rr_2,
ett_sna_nlp_opti_14_rr_2, opti_14_rr_fields, ENC_NA);
num = tvb_get_guint8(tvb, offset+3);
proto_tree_add_uint(sub_tree, hf_sna_nlp_opti_14_rr_num,
tvb, offset+3, 1, num);
offset += 4;
while (num) {
sublen = tvb_get_guint8(tvb, offset);
if (sublen) {
dissect_sna_control(tvb, offset, sublen, sub_tree, 1, LT);
} else {
/* Invalid */
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
/* No padding here */
offset += sublen;
num--;
}
}
static void
dissect_optional_22(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int bits, type;
static int * const opti_22_2_fields[] = {
&hf_sna_nlp_opti_22_type,
&hf_sna_nlp_opti_22_raa,
&hf_sna_nlp_opti_22_parity,
&hf_sna_nlp_opti_22_arb,
NULL
};
static int * const opti_22_3_fields[] = {
&hf_sna_nlp_opti_22_ratereq,
&hf_sna_nlp_opti_22_raterep,
NULL
};
bits = tvb_get_guint8(tvb, 2);
type = (bits & 0xc0) >> 6;
proto_tree_add_bitmask(tree, tvb, 2, hf_sna_nlp_opti_22_2,
ett_sna_nlp_opti_22_2, opti_22_2_fields, ENC_NA);
proto_tree_add_bitmask(tree, tvb, 3, hf_sna_nlp_opti_22_3,
ett_sna_nlp_opti_22_3, opti_22_3_fields, ENC_NA);
proto_tree_add_item(tree, hf_sna_nlp_opti_22_field1,
tvb, 4, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_nlp_opti_22_field2,
tvb, 8, 4, ENC_BIG_ENDIAN);
if (type == 0) {
proto_tree_add_item(tree, hf_sna_nlp_opti_22_field3,
tvb, 12, 4, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_nlp_opti_22_field4,
tvb, 16, 4, ENC_BIG_ENDIAN);
if (tvb_offset_exists(tvb, 20))
call_data_dissector(tvb_new_subset_remaining(tvb, 20), pinfo, tree);
} else {
if (tvb_offset_exists(tvb, 12))
call_data_dissector(tvb_new_subset_remaining(tvb, 12), pinfo, tree);
}
}
static void
dissect_optional(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *sub_tree;
int offset, type, len;
gint ett;
sub_tree = NULL;
offset = 0;
while (tvb_offset_exists(tvb, offset)) {
len = tvb_get_guint8(tvb, offset);
type = tvb_get_guint8(tvb, offset+1);
/* Prevent loop for invalid crap in packet */
if (len == 0) {
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, tree);
return;
}
ett = ett_sna_nlp_opti_un;
if(type == 0x0d) ett = ett_sna_nlp_opti_0d;
if(type == 0x0e) ett = ett_sna_nlp_opti_0e;
if(type == 0x0f) ett = ett_sna_nlp_opti_0f;
if(type == 0x10) ett = ett_sna_nlp_opti_10;
if(type == 0x12) ett = ett_sna_nlp_opti_12;
if(type == 0x14) ett = ett_sna_nlp_opti_14;
if(type == 0x22) ett = ett_sna_nlp_opti_22;
if (tree) {
sub_tree = proto_tree_add_subtree(tree, tvb,
offset, len << 2, ett, NULL,
val_to_str(type, sna_nlp_opti_vals,
"Unknown Segment Type"));
proto_tree_add_uint(sub_tree, hf_sna_nlp_opti_len,
tvb, offset, 1, len);
proto_tree_add_uint(sub_tree, hf_sna_nlp_opti_type,
tvb, offset+1, 1, type);
}
switch(type) {
case 0x0d:
dissect_optional_0d(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), sub_tree);
break;
case 0x0e:
dissect_optional_0e(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), pinfo, sub_tree);
break;
case 0x0f:
dissect_optional_0f(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), pinfo, sub_tree);
break;
case 0x10:
dissect_optional_10(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), pinfo, sub_tree);
break;
case 0x12:
dissect_optional_12(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), sub_tree);
break;
case 0x14:
dissect_optional_14(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), pinfo, sub_tree);
break;
case 0x22:
dissect_optional_22(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), pinfo, sub_tree);
break;
default:
call_data_dissector(tvb_new_subset_length_caplen(tvb, offset,
len << 2, -1), pinfo, sub_tree);
}
offset += (len << 2);
}
}
static void
dissect_nlp(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree *parent_tree)
{
proto_tree *nlp_tree;
proto_item *nlp_item;
guint8 nhdr_0, nhdr_1, nhdr_x, thdr_8, thdr_9, fid;
guint32 thdr_len, thdr_dlf;
guint16 subindx;
static int * const nlp_nhdr_0_fields[] = {
&hf_sna_nlp_sm,
&hf_sna_nlp_tpf,
NULL
};
static int * const nlp_nhdr_1_fields[] = {
&hf_sna_nlp_ft,
&hf_sna_nlp_tspi,
&hf_sna_nlp_slowdn1,
&hf_sna_nlp_slowdn2,
NULL
};
static int * const nlp_nhdr_8_fields[] = {
&hf_sna_nlp_setupi,
&hf_sna_nlp_somi,
&hf_sna_nlp_eomi,
&hf_sna_nlp_sri,
&hf_sna_nlp_rasapi,
&hf_sna_nlp_retryi,
NULL
};
static int * const nlp_nhdr_9_fields[] = {
&hf_sna_nlp_lmi,
&hf_sna_nlp_cqfi,
&hf_sna_nlp_osi,
NULL
};
int indx = 0, counter = 0;
nlp_tree = NULL;
nlp_item = NULL;
nhdr_0 = tvb_get_guint8(tvb, indx);
nhdr_1 = tvb_get_guint8(tvb, indx+1);
col_set_str(pinfo->cinfo, COL_INFO, "HPR NLP Packet");
if (tree) {
/* Don't bother setting length. We'll set it later after we
* find the lengths of NHDR */
nlp_item = proto_tree_add_item(tree, hf_sna_nlp_nhdr, tvb,
indx, -1, ENC_NA);
nlp_tree = proto_item_add_subtree(nlp_item, ett_sna_nlp_nhdr);
proto_tree_add_bitmask(nlp_tree, tvb, indx, hf_sna_nlp_nhdr_0,
ett_sna_nlp_nhdr_0, nlp_nhdr_0_fields, ENC_NA);
proto_tree_add_bitmask(nlp_tree, tvb, indx+1, hf_sna_nlp_nhdr_1,
ett_sna_nlp_nhdr_1, nlp_nhdr_1_fields, ENC_NA);
}
/* ANR or FR lists */
indx += 2;
counter = 0;
if ((nhdr_0 & 0xe0) == 0xa0) {
do {
nhdr_x = tvb_get_guint8(tvb, indx + counter);
counter ++;
} while (nhdr_x != 0xff);
proto_tree_add_item(nlp_tree,
hf_sna_nlp_fra, tvb, indx, counter, ENC_NA);
indx += counter;
proto_tree_add_item(nlp_tree, hf_sna_reserved, tvb, indx, 1, ENC_NA);
indx++;
if (tree)
proto_item_set_len(nlp_item, indx);
if ((nhdr_1 & 0xf0) == 0x10) {
proto_tree_add_item(tree, hf_sna_nlp_frh,
tvb, indx, 1, ENC_BIG_ENDIAN);
indx ++;
if (tvb_offset_exists(tvb, indx))
call_data_dissector(tvb_new_subset_remaining(tvb, indx),
pinfo, parent_tree);
return;
}
}
if ((nhdr_0 & 0xe0) == 0xc0) {
do {
nhdr_x = tvb_get_guint8(tvb, indx + counter);
counter ++;
} while (nhdr_x != 0xff);
proto_tree_add_item(nlp_tree, hf_sna_nlp_anr,
tvb, indx, counter, ENC_NA);
indx += counter;
proto_tree_add_item(nlp_tree, hf_sna_reserved, tvb, indx, 1, ENC_NA);
indx++;
if (tree)
proto_item_set_len(nlp_item, indx);
}
thdr_8 = tvb_get_guint8(tvb, indx+8);
thdr_9 = tvb_get_guint8(tvb, indx+9);
thdr_len = tvb_get_ntohs(tvb, indx+10);
thdr_dlf = tvb_get_ntohl(tvb, indx+12);
if (tree) {
nlp_item = proto_tree_add_item(tree, hf_sna_nlp_thdr, tvb,
indx, thdr_len << 2, ENC_NA);
nlp_tree = proto_item_add_subtree(nlp_item, ett_sna_nlp_thdr);
proto_tree_add_item(nlp_tree, hf_sna_nlp_tcid, tvb,
indx, 8, ENC_NA);
proto_tree_add_bitmask(nlp_tree, tvb, indx+8, hf_sna_nlp_thdr_8,
ett_sna_nlp_thdr_8, nlp_nhdr_8_fields, ENC_NA);
proto_tree_add_bitmask(nlp_tree, tvb, indx+9, hf_sna_nlp_thdr_9,
ett_sna_nlp_thdr_9, nlp_nhdr_9_fields, ENC_NA);
proto_tree_add_uint(nlp_tree, hf_sna_nlp_offset, tvb, indx+10,
2, thdr_len);
proto_tree_add_uint(nlp_tree, hf_sna_nlp_dlf, tvb, indx+12,
4, thdr_dlf);
proto_tree_add_item(nlp_tree, hf_sna_nlp_bsn, tvb, indx+16,
4, ENC_BIG_ENDIAN);
}
subindx = 20;
if (((thdr_9 & 0x18) == 0x08) && ((thdr_len << 2) > subindx)) {
counter = tvb_get_guint8(tvb, indx + subindx);
if (tvb_get_guint8(tvb, indx+subindx+1) == 5)
dissect_sna_control(tvb, indx + subindx, counter+2, nlp_tree, 1, LT);
else
call_data_dissector(tvb_new_subset_length_caplen(tvb, indx + subindx, counter+2,
-1), pinfo, nlp_tree);
subindx += (counter+2);
}
if ((thdr_9 & 0x04) && ((thdr_len << 2) > subindx))
dissect_optional(
tvb_new_subset_length_caplen(tvb, indx + subindx,
(thdr_len << 2) - subindx, -1),
pinfo, nlp_tree);
indx += (thdr_len << 2);
if (((thdr_8 & 0x20) == 0) && thdr_dlf) {
col_set_str(pinfo->cinfo, COL_INFO, "HPR Fragment");
if (tvb_offset_exists(tvb, indx)) {
call_data_dissector(tvb_new_subset_remaining(tvb, indx), pinfo,
parent_tree);
}
return;
}
if (tvb_offset_exists(tvb, indx)) {
/* Transmission Header Format Identifier */
fid = hi_nibble(tvb_get_guint8(tvb, indx));
if (fid == 5) /* Only FID5 allowed for HPR */
dissect_fid(tvb_new_subset_remaining(tvb, indx), pinfo,
tree, parent_tree);
else {
if (tvb_get_ntohs(tvb, indx+2) == 0x12ce) {
/* Route Setup */
col_set_str(pinfo->cinfo, COL_INFO, "HPR Route Setup");
dissect_gds(tvb_new_subset_remaining(tvb, indx),
pinfo, tree, parent_tree);
} else
call_data_dissector(tvb_new_subset_remaining(tvb, indx),
pinfo, parent_tree);
}
}
}
/* --------------------------------------------------------------------
* Chapter 3 Exchange Identification (XID) Information Fields
* --------------------------------------------------------------------
*/
static void
dissect_xid1(tvbuff_t *tvb, proto_tree *tree)
{
proto_tree_add_item(tree, hf_sna_reserved, tvb, 0, 2, ENC_NA);
}
static void
dissect_xid2(tvbuff_t *tvb, proto_tree *tree)
{
guint dlen, offset;
if (!tree)
return;
dlen = tvb_get_guint8(tvb, 0);
offset = dlen;
while (tvb_offset_exists(tvb, offset)) {
dlen = tvb_get_guint8(tvb, offset+1);
dissect_sna_control(tvb, offset, dlen+2, tree, 0, KL);
offset += (dlen + 2);
}
}
static void
dissect_xid3(tvbuff_t *tvb, proto_tree *tree)
{
guint dlen, offset;
static int * const sna_xid_3_fields[] = {
&hf_sna_xid_3_init_self,
&hf_sna_xid_3_stand_bind,
&hf_sna_xid_3_gener_bind,
&hf_sna_xid_3_recve_bind,
&hf_sna_xid_3_actpu,
&hf_sna_xid_3_nwnode,
&hf_sna_xid_3_cp,
&hf_sna_xid_3_cpcp,
&hf_sna_xid_3_state,
&hf_sna_xid_3_nonact,
&hf_sna_xid_3_cpchange,
NULL
};
static int * const sna_xid_10_fields[] = {
&hf_sna_xid_3_asend_bind,
&hf_sna_xid_3_arecv_bind,
&hf_sna_xid_3_quiesce,
&hf_sna_xid_3_pucap,
&hf_sna_xid_3_pbn,
&hf_sna_xid_3_pacing,
NULL
};
static int * const sna_xid_11_fields[] = {
&hf_sna_xid_3_tgshare,
&hf_sna_xid_3_dedsvc,
NULL
};
static int * const sna_xid_12_fields[] = {
&hf_sna_xid_3_negcsup,
&hf_sna_xid_3_negcomp,
NULL
};
static int * const sna_xid_15_fields[] = {
&hf_sna_xid_3_partg,
&hf_sna_xid_3_dlur,
&hf_sna_xid_3_dlus,
&hf_sna_xid_3_exbn,
&hf_sna_xid_3_genodai,
&hf_sna_xid_3_branch,
&hf_sna_xid_3_brnn,
NULL
};
if (!tree)
return;
proto_tree_add_item(tree, hf_sna_reserved, tvb, 0, 2, ENC_NA);
proto_tree_add_bitmask(tree, tvb, 2, hf_sna_xid_3_8,
ett_sna_xid_3_8, sna_xid_3_fields, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, 4, hf_sna_xid_3_10,
ett_sna_xid_3_10, sna_xid_10_fields, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, 5, hf_sna_xid_3_11,
ett_sna_xid_3_11, sna_xid_11_fields, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, 6, hf_sna_xid_3_12,
ett_sna_xid_3_12, sna_xid_12_fields, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_reserved, tvb, 7, 2, ENC_NA);
proto_tree_add_bitmask(tree, tvb, 9, hf_sna_xid_3_15,
ett_sna_xid_3_15, sna_xid_15_fields, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_xid_3_tg, tvb, 10, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_xid_3_dlc, tvb, 11, 1, ENC_BIG_ENDIAN);
dlen = tvb_get_guint8(tvb, 12);
proto_tree_add_uint(tree, hf_sna_xid_3_dlen, tvb, 12, 1, dlen);
/* FIXME: DLC Dependent Data Go Here */
offset = 12 + dlen;
while (tvb_offset_exists(tvb, offset)) {
dlen = tvb_get_guint8(tvb, offset+1);
dissect_sna_control(tvb, offset, dlen+2, tree, 0, KL);
offset += (dlen+2);
}
}
static void
dissect_xid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree *parent_tree)
{
proto_tree *sub_tree;
proto_item *sub_ti = NULL;
int format, type, len;
guint32 id;
len = tvb_get_guint8(tvb, 1);
type = tvb_get_guint8(tvb, 0);
id = tvb_get_ntohl(tvb, 2);
format = hi_nibble(type);
/* Summary information */
col_add_fstr(pinfo->cinfo, COL_INFO,
"SNA XID Format:%d Type:%s", format,
val_to_str_const(lo_nibble(type), sna_xid_type_vals,
"Unknown Type"));
if (tree) {
sub_ti = proto_tree_add_item(tree, hf_sna_xid_0, tvb,
0, 1, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_ti, ett_sna_xid_0);
proto_tree_add_uint(sub_tree, hf_sna_xid_format, tvb, 0, 1,
type);
proto_tree_add_uint(sub_tree, hf_sna_xid_type, tvb, 0, 1,
type);
proto_tree_add_uint(tree, hf_sna_xid_len, tvb, 1, 1, len);
sub_ti = proto_tree_add_item(tree, hf_sna_xid_id, tvb,
2, 4, ENC_BIG_ENDIAN);
sub_tree = proto_item_add_subtree(sub_ti, ett_sna_xid_id);
proto_tree_add_uint(sub_tree, hf_sna_xid_idblock, tvb, 2, 4,
id);
proto_tree_add_uint(sub_tree, hf_sna_xid_idnum, tvb, 2, 4,
id);
switch(format) {
case 0:
break;
case 1:
dissect_xid1(tvb_new_subset_length_caplen(tvb, 6, len-6, -1),
tree);
break;
case 2:
dissect_xid2(tvb_new_subset_length_caplen(tvb, 6, len-6, -1),
tree);
break;
case 3:
dissect_xid3(tvb_new_subset_length_caplen(tvb, 6, len-6, -1),
tree);
break;
default:
/* external standards organizations */
call_data_dissector(tvb_new_subset_length_caplen(tvb, 6, len-6, -1),
pinfo, tree);
}
}
if (format == 0)
len = 6;
if (tvb_offset_exists(tvb, len))
call_data_dissector(tvb_new_subset_remaining(tvb, len), pinfo, parent_tree);
}
/* --------------------------------------------------------------------
* Chapter 4 Transmission Headers (THs)
* --------------------------------------------------------------------
*/
#define RH_LEN 3
static unsigned int
mpf_value(guint8 th_byte)
{
return (th_byte & 0x0c) >> 2;
}
#define FIRST_FRAG_NUMBER 0
#define MIDDLE_FRAG_NUMBER 1
#define LAST_FRAG_NUMBER 2
/* FID2 is defragged by sequence. The weird thing is that we have neither
* absolute sequence numbers, nor byte offets. Other FIDs have byte offsets
* (the DCF field), but not FID2. The only thing we have to go with is "FIRST",
* "MIDDLE", or "LAST". If the BIU is split into 3 frames, then everything is
* fine, * "FIRST", "MIDDLE", and "LAST" map nicely onto frag-number 0, 1,
* and 2. However, if the BIU is split into 2 frames, then we only have
* "FIRST" and "LAST", and the mapping *should* be frag-number 0 and 1,
* *NOT* 0 and 2.
*
* The SNA docs say "FID2 PIUs cannot be blocked because there is no DCF in the
* TH format for deblocking" (note on Figure 4-2 in the IBM SNA documention,
* see the FTP URL in the comment near the top of this file). I *think*
* this means that the fragmented frames cannot arrive out of order.
* Well, I *want* it to mean this, because w/o this limitation, if you
* get a "FIRST" frame and a "LAST" frame, how long should you wait to
* see if a "MIDDLE" frame every arrives????? Thus, if frames *have* to
* arrive in order, then we're saved.
*
* The problem then boils down to figuring out if "LAST" means frag-number 1
* (in the case of a BIU split into 2 frames) or frag-number 2
* (in the case of a BIU split into 3 frames).
*
* Assuming fragmented FID2 BIU frames *do* arrive in order, the obvious
* way to handle the mapping of "LAST" to either frag-number 1 or
* frag-number 2 is to keep a hash which tracks the frames seen, etc.
* This consumes resources. A trickier way, but a way which works, is to
* always map the "LAST" BIU segment to frag-number 2. Here's the trickery:
* if we add frag-number 2, which we know to be the "LAST" BIU segment,
* and the reassembly code tells us that the the BIU is still not reassmebled,
* then, owing to the, ahem, /fact/, that fragmented BIU segments arrive
* in order :), we know that 1) "FIRST" did come, and 2) there's no "MIDDLE",
* because this BIU was fragmented into 2 frames, not 3. So, we'll be
* tricky and add a zero-length "MIDDLE" BIU frame (i.e, frag-number 1)
* to complete the reassembly.
*/
static tvbuff_t*
defragment_by_sequence(packet_info *pinfo, tvbuff_t *tvb, int offset, int mpf,
int id)
{
fragment_head *fd_head;
int frag_number = -1;
int more_frags = TRUE;
tvbuff_t *rh_tvb = NULL;
gint frag_len;
/* Determine frag_number and more_frags */
switch(mpf) {
case MPF_WHOLE_BIU:
/* nothing */
break;
case MPF_FIRST_SEGMENT:
frag_number = FIRST_FRAG_NUMBER;
break;
case MPF_MIDDLE_SEGMENT:
frag_number = MIDDLE_FRAG_NUMBER;
break;
case MPF_LAST_SEGMENT:
frag_number = LAST_FRAG_NUMBER;
more_frags = FALSE;
break;
default:
DISSECTOR_ASSERT_NOT_REACHED();
}
/* If sna_defragment is on, and this is a fragment.. */
if (frag_number > -1) {
/* XXX - check length ??? */
frag_len = tvb_reported_length_remaining(tvb, offset);
if (tvb_bytes_exist(tvb, offset, frag_len)) {
fd_head = fragment_add_seq(&sna_reassembly_table,
tvb, offset, pinfo, id, NULL,
frag_number, frag_len, more_frags, 0);
/* We added the LAST segment and reassembly didn't
* complete. Insert a zero-length MIDDLE segment to
* turn a 2-frame BIU-fragmentation into a 3-frame
* BIU-fragmentation (empty middle frag).
* See above long comment about this trickery. */
if (mpf == MPF_LAST_SEGMENT && !fd_head) {
fd_head = fragment_add_seq(&sna_reassembly_table,
tvb, offset, pinfo, id, NULL,
MIDDLE_FRAG_NUMBER, 0, TRUE, 0);
}
if (fd_head != NULL) {
/* We have the complete reassembled payload. */
rh_tvb = tvb_new_chain(tvb, fd_head->tvb_data);
/* Add the defragmented data to the data
* source list. */
add_new_data_source(pinfo, rh_tvb,
"Reassembled SNA BIU");
}
}
}
return rh_tvb;
}
#define SNA_FID01_ADDR_LEN 2
/* FID Types 0 and 1 */
static int
dissect_fid0_1(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
proto_tree *bf_tree;
proto_item *bf_item;
guint8 th_0;
const int bytes_in_header = 10;
if (tree) {
/* Byte 0 */
th_0 = tvb_get_guint8(tvb, 0);
bf_item = proto_tree_add_uint(tree, hf_sna_th_0, tvb, 0, 1,
th_0);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_uint(bf_tree, hf_sna_th_fid, tvb, 0, 1, th_0);
proto_tree_add_uint(bf_tree, hf_sna_th_mpf, tvb, 0, 1, th_0);
proto_tree_add_uint(bf_tree, hf_sna_th_efi, tvb, 0, 1, th_0);
/* Byte 1 */
proto_tree_add_item(tree, hf_sna_reserved, tvb, 1, 1, ENC_NA);
/* Bytes 2-3 */
proto_tree_add_item(tree, hf_sna_th_daf, tvb, 2, 2, ENC_BIG_ENDIAN);
}
/* Set DST addr */
set_address_tvb(&pinfo->net_dst, sna_address_type, SNA_FID01_ADDR_LEN, tvb, 2);
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
proto_tree_add_item(tree, hf_sna_th_oaf, tvb, 4, 2, ENC_BIG_ENDIAN);
/* Set SRC addr */
set_address_tvb(&pinfo->net_src, sna_address_type, SNA_FID01_ADDR_LEN, tvb, 4);
copy_address_shallow(&pinfo->src, &pinfo->net_src);
proto_tree_add_item(tree, hf_sna_th_snf, tvb, 6, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_th_dcf, tvb, 8, 2, ENC_BIG_ENDIAN);
return bytes_in_header;
}
#define SNA_FID2_ADDR_LEN 1
/* FID Type 2 */
static int
dissect_fid2(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
tvbuff_t **rh_tvb_ptr, next_dissection_t *continue_dissecting)
{
proto_tree *bf_tree;
proto_item *bf_item;
guint8 th_0;
unsigned int mpf, id;
const int bytes_in_header = 6;
th_0 = tvb_get_guint8(tvb, 0);
mpf = mpf_value(th_0);
if (tree) {
/* Byte 0 */
bf_item = proto_tree_add_item(tree, hf_sna_th_0, tvb, 0, 1, ENC_BIG_ENDIAN);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_item(bf_tree, hf_sna_th_fid, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(bf_tree, hf_sna_th_mpf, tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(bf_tree, hf_sna_th_odai,tvb, 0, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(bf_tree, hf_sna_th_efi, tvb, 0, 1, ENC_BIG_ENDIAN);
/* Byte 1 */
proto_tree_add_item(tree, hf_sna_reserved, tvb, 1, 1, ENC_NA);
/* Byte 2 */
proto_tree_add_item(tree, hf_sna_th_daf, tvb, 2, 1, ENC_BIG_ENDIAN);
}
/* Set DST addr */
set_address_tvb(&pinfo->net_dst, sna_address_type, SNA_FID2_ADDR_LEN, tvb, 2);
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
/* Byte 3 */
proto_tree_add_item(tree, hf_sna_th_oaf, tvb, 3, 1, ENC_BIG_ENDIAN);
/* Set SRC addr */
set_address_tvb(&pinfo->net_src, sna_address_type, SNA_FID2_ADDR_LEN, tvb, 3);
copy_address_shallow(&pinfo->src, &pinfo->net_src);
id = tvb_get_ntohs(tvb, 4);
proto_tree_add_item(tree, hf_sna_th_snf, tvb, 4, 2, ENC_BIG_ENDIAN);
if (mpf != MPF_WHOLE_BIU && !sna_defragment) {
if (mpf == MPF_FIRST_SEGMENT) {
*continue_dissecting = rh_only;
} else {
*continue_dissecting = stop_here;
}
}
else if (sna_defragment) {
*rh_tvb_ptr = defragment_by_sequence(pinfo, tvb,
bytes_in_header, mpf, id);
}
return bytes_in_header;
}
/* FID Type 3 */
static int
dissect_fid3(tvbuff_t *tvb, proto_tree *tree)
{
proto_tree *bf_tree;
proto_item *bf_item;
guint8 th_0;
const int bytes_in_header = 2;
/* If we're not filling a proto_tree, return now */
if (!tree)
return bytes_in_header;
th_0 = tvb_get_guint8(tvb, 0);
/* Create the bitfield tree */
bf_item = proto_tree_add_uint(tree, hf_sna_th_0, tvb, 0, 1, th_0);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_uint(bf_tree, hf_sna_th_fid, tvb, 0, 1, th_0);
proto_tree_add_uint(bf_tree, hf_sna_th_mpf, tvb, 0, 1, th_0);
proto_tree_add_uint(bf_tree, hf_sna_th_efi, tvb, 0, 1, th_0);
proto_tree_add_item(tree, hf_sna_th_lsid, tvb, 1, 1, ENC_BIG_ENDIAN);
return bytes_in_header;
}
static int
dissect_fid4(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
{
int offset = 0;
guint8 th_byte, mft;
guint16 def, oef;
guint32 dsaf, osaf;
static int * const byte0_fields[] = {
&hf_sna_th_fid,
&hf_sna_th_tg_sweep,
&hf_sna_th_er_vr_supp_ind,
&hf_sna_th_vr_pac_cnt_ind,
&hf_sna_th_ntwk_prty,
NULL
};
static int * const byte1_fields[] = {
&hf_sna_th_tgsf,
&hf_sna_th_mft,
&hf_sna_th_piubf,
NULL
};
static int * const byte2_mft_fields[] = {
&hf_sna_th_nlpoi,
&hf_sna_th_nlp_cp,
&hf_sna_th_ern,
NULL
};
static int * const byte2_fields[] = {
&hf_sna_th_iern,
&hf_sna_th_ern,
NULL
};
static int * const byte3_fields[] = {
&hf_sna_th_vrn,
&hf_sna_th_tpf,
NULL
};
static int * const byte4_fields[] = {
&hf_sna_th_vr_cwi,
&hf_sna_th_tg_nonfifo_ind,
&hf_sna_th_vr_sqti,
/* I'm not sure about byte-order on this one... */
&hf_sna_th_tg_snf,
NULL
};
static int * const byte6_fields[] = {
&hf_sna_th_vrprq,
&hf_sna_th_vrprs,
&hf_sna_th_vr_cwri,
&hf_sna_th_vr_rwi,
/* I'm not sure about byte-order on this one... */
&hf_sna_th_vr_snf_send,
NULL
};
static int * const byte16_fields[] = {
&hf_sna_th_snai,
/* We luck out here because in their infinite wisdom the SNA
* architects placed the MPF and EFI fields in the same bitfield
* locations, even though for FID4 they're not in byte 0.
* Thank you IBM! */
&hf_sna_th_mpf,
&hf_sna_th_efi,
NULL
};
struct sna_fid_type_4_addr *src, *dst;
const int bytes_in_header = 26;
/* If we're not filling a proto_tree, return now */
if (!tree)
return bytes_in_header;
/* Byte 0 */
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_0,
ett_sna_th_fid, byte0_fields, ENC_NA);
offset += 1;
th_byte = tvb_get_guint8(tvb, offset);
/* Byte 1 */
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_byte1,
ett_sna_th_fid, byte1_fields, ENC_NA);
mft = th_byte & 0x04;
offset += 1;
/* Byte 2 */
if (mft) {
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_byte2,
ett_sna_th_fid, byte2_mft_fields, ENC_NA);
} else {
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_byte2,
ett_sna_th_fid, byte2_fields, ENC_NA);
}
offset += 1;
/* Byte 3 */
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_byte3,
ett_sna_th_fid, byte3_fields, ENC_NA);
offset += 1;
/* Bytes 4-5 */
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_byte4,
ett_sna_th_fid, byte4_fields, ENC_BIG_ENDIAN);
offset += 2;
/* Create the bitfield tree */
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_byte6,
ett_sna_th_fid, byte6_fields, ENC_BIG_ENDIAN);
offset += 2;
dsaf = tvb_get_ntohl(tvb, 8);
/* Bytes 8-11 */
proto_tree_add_uint(tree, hf_sna_th_dsaf, tvb, offset, 4, dsaf);
offset += 4;
osaf = tvb_get_ntohl(tvb, 12);
/* Bytes 12-15 */
proto_tree_add_uint(tree, hf_sna_th_osaf, tvb, offset, 4, osaf);
offset += 4;
/* Byte 16 */
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_th_byte16,
ett_sna_th_fid, byte16_fields, ENC_NA);
/* 1 for byte 16, 1 for byte 17 which is reserved */
offset += 2;
def = tvb_get_ntohs(tvb, 18);
/* Bytes 18-25 */
proto_tree_add_uint(tree, hf_sna_th_def, tvb, offset, 2, def);
/* Addresses in FID 4 are discontiguous, sigh */
dst = wmem_new0(pinfo->pool, struct sna_fid_type_4_addr);
dst->saf = dsaf;
dst->ef = def;
set_address(&pinfo->net_dst, sna_address_type, SNA_FID_TYPE_4_ADDR_LEN, dst);
copy_address_shallow(&pinfo->dst, &pinfo->net_dst);
oef = tvb_get_ntohs(tvb, 20);
proto_tree_add_uint(tree, hf_sna_th_oef, tvb, offset+2, 2, oef);
/* Addresses in FID 4 are discontiguous, sigh */
src = wmem_new0(pinfo->pool, struct sna_fid_type_4_addr);
src->saf = osaf;
src->ef = oef;
set_address(&pinfo->net_src, sna_address_type, SNA_FID_TYPE_4_ADDR_LEN, src);
copy_address_shallow(&pinfo->src, &pinfo->net_src);
proto_tree_add_item(tree, hf_sna_th_snf, tvb, offset+4, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_th_dcf, tvb, offset+6, 2, ENC_BIG_ENDIAN);
return bytes_in_header;
}
/* FID Type 5 */
static int
dissect_fid5(tvbuff_t *tvb, proto_tree *tree)
{
proto_tree *bf_tree;
proto_item *bf_item;
guint8 th_0;
const int bytes_in_header = 12;
/* If we're not filling a proto_tree, return now */
if (!tree)
return bytes_in_header;
th_0 = tvb_get_guint8(tvb, 0);
/* Create the bitfield tree */
bf_item = proto_tree_add_uint(tree, hf_sna_th_0, tvb, 0, 1, th_0);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_uint(bf_tree, hf_sna_th_fid, tvb, 0, 1, th_0);
proto_tree_add_uint(bf_tree, hf_sna_th_mpf, tvb, 0, 1, th_0);
proto_tree_add_uint(bf_tree, hf_sna_th_efi, tvb, 0, 1, th_0);
proto_tree_add_item(tree, hf_sna_reserved, tvb, 1, 1, ENC_NA);
proto_tree_add_item(tree, hf_sna_th_snf, tvb, 2, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_th_sa, tvb, 4, 8, ENC_NA);
return bytes_in_header;
}
/* FID Type f */
static int
dissect_fidf(tvbuff_t *tvb, proto_tree *tree)
{
proto_tree *bf_tree;
proto_item *bf_item;
guint8 th_0;
const int bytes_in_header = 26;
/* If we're not filling a proto_tree, return now */
if (!tree)
return bytes_in_header;
th_0 = tvb_get_guint8(tvb, 0);
/* Create the bitfield tree */
bf_item = proto_tree_add_uint(tree, hf_sna_th_0, tvb, 0, 1, th_0);
bf_tree = proto_item_add_subtree(bf_item, ett_sna_th_fid);
proto_tree_add_uint(bf_tree, hf_sna_th_fid, tvb, 0, 1, th_0);
proto_tree_add_item(tree, hf_sna_reserved, tvb, 1, 1, ENC_NA);
proto_tree_add_item(tree, hf_sna_th_cmd_fmt, tvb, 2, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_th_cmd_type, tvb, 3, 1, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_th_cmd_sn, tvb, 4, 2, ENC_BIG_ENDIAN);
/* Yup, bytes 6-23 are reserved! */
proto_tree_add_item(tree, hf_sna_reserved, tvb, 6, 18, ENC_NA);
proto_tree_add_item(tree, hf_sna_th_dcf, tvb, 24, 2, ENC_BIG_ENDIAN);
return bytes_in_header;
}
static void
dissect_fid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree *parent_tree)
{
proto_tree *th_tree = NULL, *rh_tree = NULL;
proto_item *th_ti = NULL, *rh_ti = NULL;
guint8 th_fid;
int th_header_len = 0;
int offset, rh_offset;
tvbuff_t *rh_tvb = NULL;
next_dissection_t continue_dissecting = everything;
/* Transmission Header Format Identifier */
th_fid = hi_nibble(tvb_get_guint8(tvb, 0));
/* Summary information */
col_add_str(pinfo->cinfo, COL_INFO,
val_to_str(th_fid, sna_th_fid_vals, "Unknown FID: %01x"));
if (tree) {
/* --- TH --- */
/* Don't bother setting length. We'll set it later after we
* find the length of TH */
th_ti = proto_tree_add_item(tree, hf_sna_th, tvb, 0, -1,
ENC_NA);
th_tree = proto_item_add_subtree(th_ti, ett_sna_th);
}
/* Get size of TH */
switch(th_fid) {
case 0x0:
case 0x1:
th_header_len = dissect_fid0_1(tvb, pinfo, th_tree);
break;
case 0x2:
th_header_len = dissect_fid2(tvb, pinfo, th_tree,
&rh_tvb, &continue_dissecting);
break;
case 0x3:
th_header_len = dissect_fid3(tvb, th_tree);
break;
case 0x4:
th_header_len = dissect_fid4(tvb, pinfo, th_tree);
break;
case 0x5:
th_header_len = dissect_fid5(tvb, th_tree);
break;
case 0xf:
th_header_len = dissect_fidf(tvb, th_tree);
break;
default:
call_data_dissector(tvb_new_subset_remaining(tvb, 1), pinfo, parent_tree);
return;
}
offset = th_header_len;
/* Short-circuit ? */
if (continue_dissecting == stop_here) {
proto_tree_add_item(tree, hf_sna_biu_segment_data, tvb, offset, -1, ENC_NA);
return;
}
/* If the FID dissector function didn't create an rh_tvb, then we just
* use the rest of our tvbuff as the rh_tvb. */
if (!rh_tvb)
rh_tvb = tvb_new_subset_remaining(tvb, offset);
rh_offset = 0;
/* Process the rest of the SNA packet, starting with RH */
if (tree) {
proto_item_set_len(th_ti, th_header_len);
/* --- RH --- */
rh_ti = proto_tree_add_item(tree, hf_sna_rh, rh_tvb, rh_offset,
RH_LEN, ENC_NA);
rh_tree = proto_item_add_subtree(rh_ti, ett_sna_rh);
dissect_rh(rh_tvb, rh_offset, rh_tree);
}
rh_offset += RH_LEN;
if (tvb_offset_exists(rh_tvb, rh_offset)) {
/* Short-circuit ? */
if (continue_dissecting == rh_only) {
proto_tree_add_item(tree, hf_sna_biu_segment_data, rh_tvb, rh_offset, -1, ENC_NA);
return;
}
call_data_dissector(tvb_new_subset_remaining(rh_tvb, rh_offset),
pinfo, parent_tree);
}
}
/* --------------------------------------------------------------------
* Chapter 5 Request/Response Headers (RHs)
* --------------------------------------------------------------------
*/
static void
dissect_rh(tvbuff_t *tvb, int offset, proto_tree *tree)
{
gboolean is_response;
guint8 rh_0;
static int * const sna_rh_fields[] = {
&hf_sna_rh_rri,
&hf_sna_rh_ru_category,
&hf_sna_rh_fi,
&hf_sna_rh_sdi,
&hf_sna_rh_bci,
&hf_sna_rh_eci,
NULL
};
static int * const sna_rh_1_req_fields[] = {
&hf_sna_rh_dr1,
&hf_sna_rh_lcci,
&hf_sna_rh_dr2,
&hf_sna_rh_eri,
&hf_sna_rh_rlwi,
&hf_sna_rh_qri,
&hf_sna_rh_pi,
NULL
};
static int * const sna_rh_1_rsp_fields[] = {
&hf_sna_rh_dr1,
&hf_sna_rh_dr2,
&hf_sna_rh_rti,
&hf_sna_rh_qri,
&hf_sna_rh_pi,
NULL
};
static int * const sna_rh_2_req_fields[] = {
&hf_sna_rh_bbi,
&hf_sna_rh_ebi,
&hf_sna_rh_cdi,
&hf_sna_rh_csi,
&hf_sna_rh_edi,
&hf_sna_rh_pdi,
&hf_sna_rh_cebi,
NULL
};
if (!tree)
return;
/* Create the bitfield tree for byte 0*/
rh_0 = tvb_get_guint8(tvb, offset);
is_response = (rh_0 & 0x80);
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_rh_0,
ett_sna_rh_0, sna_rh_fields, ENC_BIG_ENDIAN);
offset += 1;
/* Create the bitfield tree for byte 1*/
if (is_response) {
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_rh_1,
ett_sna_rh_1, sna_rh_1_rsp_fields, ENC_BIG_ENDIAN);
} else {
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_rh_1,
ett_sna_rh_1, sna_rh_1_req_fields, ENC_BIG_ENDIAN);
}
offset += 1;
/* Create the bitfield tree for byte 2*/
if (!is_response) {
proto_tree_add_bitmask(tree, tvb, offset, hf_sna_rh_2,
ett_sna_rh_2, sna_rh_2_req_fields, ENC_BIG_ENDIAN);
} else {
proto_tree_add_item(tree, hf_sna_rh_2, tvb, offset, 1, ENC_BIG_ENDIAN);
}
/* XXX - check for sdi. If TRUE, the next 4 bytes will be sense data */
}
/* --------------------------------------------------------------------
* Chapter 6 Request/Response Units (RUs)
* --------------------------------------------------------------------
*/
/* --------------------------------------------------------------------
* Chapter 9 Common Fields
* --------------------------------------------------------------------
*/
static void
dissect_control_05hpr(tvbuff_t *tvb, proto_tree *tree, int hpr,
enum parse parse)
{
guint16 offset, len, pad;
static int * const sna_control_05hpr_fields[] = {
&hf_sna_control_05_ptp,
NULL
};
if (!tree)
return;
proto_tree_add_bitmask(tree, tvb, 2, hf_sna_control_05_type,
ett_sna_control_05hpr_type, sna_control_05hpr_fields, ENC_BIG_ENDIAN);
proto_tree_add_item(tree, hf_sna_reserved, tvb, 3, 1, ENC_NA);
offset = 4;
while (tvb_offset_exists(tvb, offset)) {
if (parse == LT) {
len = tvb_get_guint8(tvb, offset+0);
} else {
len = tvb_get_guint8(tvb, offset+1);
}
if (len) {
dissect_sna_control(tvb, offset, len, tree, hpr, parse);
pad = (len+3) & 0xfffc;
if (pad > len) {
proto_tree_add_item(tree, hf_sna_padding, tvb, offset+len, pad-len, ENC_NA);
}
offset += pad;
} else {
return;
}
}
}
static void
dissect_control_05(tvbuff_t *tvb, proto_tree *tree)
{
if(!tree)
return;
proto_tree_add_item(tree, hf_sna_control_05_delay, tvb, 2, 2, ENC_BIG_ENDIAN);
}
static void
dissect_control_0e(tvbuff_t *tvb, proto_tree *tree)
{
gint len;
if (!tree)
return;
proto_tree_add_item(tree, hf_sna_control_0e_type, tvb, 2, 1, ENC_BIG_ENDIAN);
len = tvb_reported_length_remaining(tvb, 3);
if (len <= 0)
return;
proto_tree_add_item(tree, hf_sna_control_0e_value, tvb, 3, len, ENC_EBCDIC|ENC_NA);
}
static void
dissect_sna_control(tvbuff_t *parent_tvb, int offset, int control_len,
proto_tree *tree, int hpr, enum parse parse)
{
tvbuff_t *tvb;
gint length, reported_length;
proto_tree *sub_tree;
int len, key;
gint ett;
length = tvb_captured_length_remaining(parent_tvb, offset);
reported_length = tvb_reported_length_remaining(parent_tvb, offset);
if (control_len < length)
length = control_len;
if (control_len < reported_length)
reported_length = control_len;
tvb = tvb_new_subset_length_caplen(parent_tvb, offset, length, reported_length);
sub_tree = NULL;
if (parse == LT) {
len = tvb_get_guint8(tvb, 0);
key = tvb_get_guint8(tvb, 1);
} else {
key = tvb_get_guint8(tvb, 0);
len = tvb_get_guint8(tvb, 1);
}
ett = ett_sna_control_un;
if (tree) {
if (key == 5) {
if (hpr) ett = ett_sna_control_05hpr;
else ett = ett_sna_control_05;
}
if (key == 0x0e) ett = ett_sna_control_0e;
if (((key == 0) || (key == 3) || (key == 5)) && hpr)
sub_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett, NULL,
val_to_str_const(key, sna_control_hpr_vals,
"Unknown Control Vector"));
else
sub_tree = proto_tree_add_subtree(tree, tvb, 0, -1, ett, NULL,
val_to_str_const(key, sna_control_vals,
"Unknown Control Vector"));
if (parse == LT) {
proto_tree_add_uint(sub_tree, hf_sna_control_len,
tvb, 0, 1, len);
if (((key == 0) || (key == 3) || (key == 5)) && hpr)
proto_tree_add_uint(sub_tree,
hf_sna_control_hprkey, tvb, 1, 1, key);
else
proto_tree_add_uint(sub_tree,
hf_sna_control_key, tvb, 1, 1, key);
} else {
if (((key == 0) || (key == 3) || (key == 5)) && hpr)
proto_tree_add_uint(sub_tree,
hf_sna_control_hprkey, tvb, 0, 1, key);
else
proto_tree_add_uint(sub_tree,
hf_sna_control_key, tvb, 0, 1, key);
proto_tree_add_uint(sub_tree, hf_sna_control_len,
tvb, 1, 1, len);
}
}
switch(key) {
case 0x05:
if (hpr)
dissect_control_05hpr(tvb, sub_tree, hpr,
parse);
else
dissect_control_05(tvb, sub_tree);
break;
case 0x0e:
dissect_control_0e(tvb, sub_tree);
break;
}
}
/* --------------------------------------------------------------------
* Chapter 11 Function Management (FM) Headers
* --------------------------------------------------------------------
*/
/* --------------------------------------------------------------------
* Chapter 12 Presentation Services (PS) Headers
* --------------------------------------------------------------------
*/
/* --------------------------------------------------------------------
* Chapter 13 GDS Variables
* --------------------------------------------------------------------
*/
static void
dissect_gds(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree,
proto_tree *parent_tree)
{
guint16 length;
int cont;
int offset = 0;
proto_item *pi;
proto_tree *subtree;
gboolean first_ll = TRUE;
do {
length = tvb_get_ntohs(tvb, offset) & 0x7fff;
cont = (tvb_get_ntohs(tvb, offset) & 0x8000) ? 1 : 0;
pi = proto_tree_add_item(tree, hf_sna_gds, tvb, offset, -1, ENC_NA);
subtree = proto_item_add_subtree(pi, ett_sna_gds);
proto_tree_add_item(subtree, hf_sna_gds_len, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item(subtree, hf_sna_gds_cont, tvb, offset, 2, ENC_BIG_ENDIAN);
if (length < 2 ) /* escape sequence */
return;
offset += 2;
length -= 2;
if (first_ll) {
proto_tree_add_item(subtree, hf_sna_gds_type, tvb, offset, 2, ENC_BIG_ENDIAN);
offset += 2;
length -= 2;
first_ll = FALSE;
}
if (length > 0) {
proto_tree_add_item(subtree, hf_sna_gds_info, tvb, offset, length, ENC_NA);
offset += length;
}
} while(cont);
proto_item_set_len(pi, offset);
if (tvb_offset_exists(tvb, offset))
call_data_dissector(tvb_new_subset_remaining(tvb, offset), pinfo, parent_tree);
}
/* --------------------------------------------------------------------
* General stuff
* --------------------------------------------------------------------
*/
static int
dissect_sna(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
guint8 fid;
proto_tree *sna_tree = NULL;
proto_item *sna_ti = NULL;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SNA");
col_clear(pinfo->cinfo, COL_INFO);
/* SNA data should be printed in EBCDIC, not ASCII */
pinfo->fd->encoding = PACKET_CHAR_ENC_CHAR_EBCDIC;
if (tree) {
/* Don't bother setting length. We'll set it later after we find
* the lengths of TH/RH/RU */
sna_ti = proto_tree_add_item(tree, proto_sna, tvb, 0, -1,
ENC_NA);
sna_tree = proto_item_add_subtree(sna_ti, ett_sna);
}
/* Transmission Header Format Identifier */
fid = hi_nibble(tvb_get_guint8(tvb, 0));
switch(fid) {
case 0xa: /* HPR Network Layer Packet */
case 0xb:
case 0xc:
case 0xd:
dissect_nlp(tvb, pinfo, sna_tree, tree);
break;
default:
dissect_fid(tvb, pinfo, sna_tree, tree);
}
return tvb_captured_length(tvb);
}
static int
dissect_sna_xid(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void* data _U_)
{
proto_tree *sna_tree = NULL;
proto_item *sna_ti = NULL;
col_set_str(pinfo->cinfo, COL_PROTOCOL, "SNA");
col_clear(pinfo->cinfo, COL_INFO);
/* SNA data should be printed in EBCDIC, not ASCII */
pinfo->fd->encoding = PACKET_CHAR_ENC_CHAR_EBCDIC;
if (tree) {
/* Don't bother setting length. We'll set it later after we find
* the lengths of XID */
sna_ti = proto_tree_add_item(tree, proto_sna_xid, tvb, 0, -1,
ENC_NA);
sna_tree = proto_item_add_subtree(sna_ti, ett_sna);
}
dissect_xid(tvb, pinfo, sna_tree, tree);
return tvb_captured_length(tvb);
}
void
proto_register_sna(void)
{
static hf_register_info hf[] = {
{ &hf_sna_th,
{ "Transmission Header", "sna.th", FT_NONE, BASE_NONE,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_0,
{ "Transmission Header Byte 0", "sna.th.0", FT_UINT8, BASE_HEX,
NULL, 0x0,
"TH Byte 0", HFILL }},
{ &hf_sna_th_fid,
{ "Format Identifier", "sna.th.fid", FT_UINT8, BASE_HEX,
VALS(sna_th_fid_vals), 0xf0, NULL, HFILL }},
{ &hf_sna_th_mpf,
{ "Mapping Field", "sna.th.mpf", FT_UINT8,
BASE_DEC, VALS(sna_th_mpf_vals), 0x0c, NULL, HFILL }},
{ &hf_sna_th_odai,
{ "ODAI Assignment Indicator", "sna.th.odai", FT_UINT8,
BASE_DEC, NULL, 0x02, NULL, HFILL }},
{ &hf_sna_th_efi,
{ "Expedited Flow Indicator", "sna.th.efi", FT_UINT8,
BASE_DEC, VALS(sna_th_efi_vals), 0x01, NULL, HFILL }},
{ &hf_sna_th_daf,
{ "Destination Address Field", "sna.th.daf", FT_UINT16,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_oaf,
{ "Origin Address Field", "sna.th.oaf", FT_UINT16, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_snf,
{ "Sequence Number Field", "sna.th.snf", FT_UINT16, BASE_DEC,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_dcf,
{ "Data Count Field", "sna.th.dcf", FT_UINT16, BASE_DEC,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_lsid,
{ "Local Session Identification", "sna.th.lsid", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_tg_sweep,
{ "Transmission Group Sweep", "sna.th.tg_sweep", FT_UINT8,
BASE_DEC, VALS(sna_th_tg_sweep_vals), 0x08, NULL, HFILL }},
{ &hf_sna_th_er_vr_supp_ind,
{ "ER and VR Support Indicator", "sna.th.er_vr_supp_ind",
FT_UINT8, BASE_DEC, VALS(sna_th_er_vr_supp_ind_vals),
0x04, NULL, HFILL }},
{ &hf_sna_th_vr_pac_cnt_ind,
{ "Virtual Route Pacing Count Indicator",
"sna.th.vr_pac_cnt_ind", FT_UINT8, BASE_DEC,
VALS(sna_th_vr_pac_cnt_ind_vals), 0x02, NULL, HFILL }},
{ &hf_sna_th_ntwk_prty,
{ "Network Priority", "sna.th.ntwk_prty", FT_UINT8, BASE_DEC,
VALS(sna_th_ntwk_prty_vals), 0x01, NULL, HFILL }},
{ &hf_sna_th_tgsf,
{ "Transmission Group Segmenting Field", "sna.th.tgsf",
FT_UINT8, BASE_HEX, VALS(sna_th_tgsf_vals), 0xc0,
NULL, HFILL }},
{ &hf_sna_th_mft,
{ "MPR FID4 Type", "sna.th.mft", FT_BOOLEAN, 8,
NULL, 0x04, NULL, HFILL }},
{ &hf_sna_th_piubf,
{ "PIU Blocking Field", "sna.th.piubf", FT_UINT8, BASE_HEX,
VALS(sna_th_piubf_vals), 0x03, NULL, HFILL }},
{ &hf_sna_th_iern,
{ "Initial Explicit Route Number", "sna.th.iern", FT_UINT8,
BASE_DEC, NULL, 0xf0, NULL, HFILL }},
{ &hf_sna_th_nlpoi,
{ "NLP Offset Indicator", "sna.th.nlpoi", FT_UINT8, BASE_DEC,
VALS(sna_th_nlpoi_vals), 0x80, NULL, HFILL }},
{ &hf_sna_th_nlp_cp,
{ "NLP Count or Padding", "sna.th.nlp_cp", FT_UINT8, BASE_DEC,
NULL, 0x70, NULL, HFILL }},
{ &hf_sna_th_ern,
{ "Explicit Route Number", "sna.th.ern", FT_UINT8, BASE_DEC,
NULL, 0x0f, NULL, HFILL }},
{ &hf_sna_th_vrn,
{ "Virtual Route Number", "sna.th.vrn", FT_UINT8, BASE_DEC,
NULL, 0xf0, NULL, HFILL }},
{ &hf_sna_th_tpf,
{ "Transmission Priority Field", "sna.th.tpf", FT_UINT8,
BASE_HEX, VALS(sna_th_tpf_vals), 0x03, NULL, HFILL }},
{ &hf_sna_th_vr_cwi,
{ "Virtual Route Change Window Indicator", "sna.th.vr_cwi",
FT_UINT16, BASE_DEC, VALS(sna_th_vr_cwi_vals), 0x8000,
"Change Window Indicator", HFILL }},
{ &hf_sna_th_tg_nonfifo_ind,
{ "Transmission Group Non-FIFO Indicator",
"sna.th.tg_nonfifo_ind", FT_BOOLEAN, 16,
TFS(&sna_th_tg_nonfifo_ind_truth), 0x4000, NULL, HFILL }},
{ &hf_sna_th_vr_sqti,
{ "Virtual Route Sequence and Type Indicator", "sna.th.vr_sqti",
FT_UINT16, BASE_HEX, VALS(sna_th_vr_sqti_vals), 0x3000,
"Route Sequence and Type", HFILL }},
{ &hf_sna_th_tg_snf,
{ "Transmission Group Sequence Number Field", "sna.th.tg_snf",
FT_UINT16, BASE_DEC, NULL, 0x0fff, NULL, HFILL }},
{ &hf_sna_th_vrprq,
{ "Virtual Route Pacing Request", "sna.th.vrprq", FT_BOOLEAN,
16, TFS(&sna_th_vrprq_truth), 0x8000, NULL, HFILL }},
{ &hf_sna_th_vrprs,
{ "Virtual Route Pacing Response", "sna.th.vrprs", FT_BOOLEAN,
16, TFS(&sna_th_vrprs_truth), 0x4000, NULL, HFILL }},
{ &hf_sna_th_vr_cwri,
{ "Virtual Route Change Window Reply Indicator",
"sna.th.vr_cwri", FT_UINT16, BASE_DEC,
VALS(sna_th_vr_cwri_vals), 0x2000, NULL, HFILL }},
{ &hf_sna_th_vr_rwi,
{ "Virtual Route Reset Window Indicator", "sna.th.vr_rwi",
FT_BOOLEAN, 16, TFS(&sna_th_vr_rwi_truth), 0x1000,
NULL, HFILL }},
{ &hf_sna_th_vr_snf_send,
{ "Virtual Route Send Sequence Number Field",
"sna.th.vr_snf_send", FT_UINT16, BASE_DEC, NULL, 0x0fff,
"Send Sequence Number Field", HFILL }},
{ &hf_sna_th_dsaf,
{ "Destination Subarea Address Field", "sna.th.dsaf",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_osaf,
{ "Origin Subarea Address Field", "sna.th.osaf", FT_UINT32,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_snai,
{ "SNA Indicator", "sna.th.snai", FT_BOOLEAN, 8, NULL, 0x10,
"Used to identify whether the PIU originated or is destined for an SNA or non-SNA device.", HFILL }},
{ &hf_sna_th_def,
{ "Destination Element Field", "sna.th.def", FT_UINT16,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_oef,
{ "Origin Element Field", "sna.th.oef", FT_UINT16, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_sa,
{ "Session Address", "sna.th.sa", FT_BYTES, BASE_NONE,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_cmd_fmt,
{ "Command Format", "sna.th.cmd_fmt", FT_UINT8, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_cmd_type,
{ "Command Type", "sna.th.cmd_type", FT_UINT8, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_cmd_sn,
{ "Command Sequence Number", "sna.th.cmd_sn", FT_UINT16,
BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_byte1,
{ "Transmission Header Bytes 1", "sna.th.byte1", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_byte2,
{ "Transmission Header Bytes 2", "sna.th.byte2", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_byte3,
{ "Transmission Header Bytes 3", "sna.th.byte3", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_byte4,
{ "Transmission Header Bytes 4-5", "sna.th.byte4", FT_UINT16,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_byte6,
{ "Transmission Header Bytes 6-7", "sna.th.byte6", FT_UINT16,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_th_byte16,
{ "Transmission Header Bytes 16", "sna.th.byte16", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_nhdr,
{ "Network Layer Packet Header", "sna.nlp.nhdr", FT_NONE,
BASE_NONE, NULL, 0x0, "NHDR", HFILL }},
{ &hf_sna_nlp_nhdr_0,
{ "Network Layer Packet Header Byte 0", "sna.nlp.nhdr.0",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_nhdr_1,
{ "Network Layer Packet Header Byte 1", "sna.nlp.nhdr.1",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_sm,
{ "Switching Mode Field", "sna.nlp.nhdr.sm", FT_UINT8,
BASE_HEX, VALS(sna_nlp_sm_vals), 0xe0, NULL, HFILL }},
{ &hf_sna_nlp_tpf,
{ "Transmission Priority Field", "sna.nlp.nhdr.tpf", FT_UINT8,
BASE_HEX, VALS(sna_th_tpf_vals), 0x06, NULL, HFILL }},
{ &hf_sna_nlp_ft,
{ "Function Type", "sna.nlp.nhdr.ft", FT_UINT8, BASE_HEX,
VALS(sna_nlp_ft_vals), 0xF0, NULL, HFILL }},
{ &hf_sna_nlp_tspi,
{ "Time Sensitive Packet Indicator", "sna.nlp.nhdr.tspi",
FT_BOOLEAN, 8, TFS(&sna_nlp_tspi_truth), 0x08, NULL, HFILL }},
{ &hf_sna_nlp_slowdn1,
{ "Slowdown 1", "sna.nlp.nhdr.slowdn1", FT_BOOLEAN, 8,
TFS(&sna_nlp_slowdn1_truth), 0x04, NULL, HFILL }},
{ &hf_sna_nlp_slowdn2,
{ "Slowdown 2", "sna.nlp.nhdr.slowdn2", FT_BOOLEAN, 8,
TFS(&sna_nlp_slowdn2_truth), 0x02, NULL, HFILL }},
{ &hf_sna_nlp_fra,
{ "Function Routing Address Entry", "sna.nlp.nhdr.fra",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_sna_nlp_anr,
{ "Automatic Network Routing Entry", "sna.nlp.nhdr.anr",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_sna_nlp_frh,
{ "Transmission Priority Field", "sna.nlp.frh", FT_UINT8,
BASE_HEX, VALS(sna_nlp_frh_vals), 0, NULL, HFILL }},
{ &hf_sna_nlp_thdr,
{ "RTP Transport Header", "sna.nlp.thdr", FT_NONE, BASE_NONE,
NULL, 0x0, "THDR", HFILL }},
{ &hf_sna_nlp_tcid,
{ "Transport Connection Identifier", "sna.nlp.thdr.tcid",
FT_BYTES, BASE_NONE, NULL, 0x0, "TCID", HFILL }},
{ &hf_sna_nlp_thdr_8,
{ "RTP Transport Packet Header Byte 8", "sna.nlp.thdr.8",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_setupi,
{ "Setup Indicator", "sna.nlp.thdr.setupi", FT_BOOLEAN, 8,
TFS(&sna_nlp_setupi_truth), 0x40, NULL, HFILL }},
{ &hf_sna_nlp_somi,
{ "Start Of Message Indicator", "sna.nlp.thdr.somi",
FT_BOOLEAN, 8, TFS(&sna_nlp_somi_truth), 0x20, NULL, HFILL }},
{ &hf_sna_nlp_eomi,
{ "End Of Message Indicator", "sna.nlp.thdr.eomi", FT_BOOLEAN,
8, TFS(&sna_nlp_eomi_truth), 0x10, NULL, HFILL }},
{ &hf_sna_nlp_sri,
{ "Session Request Indicator", "sna.nlp.thdr.sri", FT_BOOLEAN,
8, TFS(&sna_nlp_sri_truth), 0x08, NULL, HFILL }},
{ &hf_sna_nlp_rasapi,
{ "Reply ASAP Indicator", "sna.nlp.thdr.rasapi", FT_BOOLEAN,
8, TFS(&sna_nlp_rasapi_truth), 0x04, NULL, HFILL }},
{ &hf_sna_nlp_retryi,
{ "Retry Indicator", "sna.nlp.thdr.retryi", FT_BOOLEAN,
8, TFS(&sna_nlp_retryi_truth), 0x02, NULL, HFILL }},
{ &hf_sna_nlp_thdr_9,
{ "RTP Transport Packet Header Byte 9", "sna.nlp.thdr.9",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_lmi,
{ "Last Message Indicator", "sna.nlp.thdr.lmi", FT_BOOLEAN,
8, TFS(&sna_nlp_lmi_truth), 0x80, NULL, HFILL }},
{ &hf_sna_nlp_cqfi,
{ "Connection Qualifier Field Indicator", "sna.nlp.thdr.cqfi",
FT_BOOLEAN, 8, TFS(&sna_nlp_cqfi_truth), 0x08, NULL, HFILL }},
{ &hf_sna_nlp_osi,
{ "Optional Segments Present Indicator", "sna.nlp.thdr.osi",
FT_BOOLEAN, 8, TFS(&sna_nlp_osi_truth), 0x04, NULL, HFILL }},
{ &hf_sna_nlp_offset,
{ "Data Offset/4", "sna.nlp.thdr.offset", FT_UINT16, BASE_HEX,
NULL, 0x0, "Data Offset in Words", HFILL }},
{ &hf_sna_nlp_dlf,
{ "Data Length Field", "sna.nlp.thdr.dlf", FT_UINT32, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_bsn,
{ "Byte Sequence Number", "sna.nlp.thdr.bsn", FT_UINT32,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_len,
{ "Optional Segment Length/4", "sna.nlp.thdr.optional.len",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_type,
{ "Optional Segment Type", "sna.nlp.thdr.optional.type",
FT_UINT8, BASE_HEX, VALS(sna_nlp_opti_vals), 0x0, NULL,
HFILL }},
{ &hf_sna_nlp_opti_0d_version,
{ "Version", "sna.nlp.thdr.optional.0d.version",
FT_UINT16, BASE_HEX, VALS(sna_nlp_opti_0d_version_vals),
0, NULL, HFILL }},
{ &hf_sna_nlp_opti_0d_4,
{ "Connection Setup Byte 4", "sna.nlp.thdr.optional.0e.4",
FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
{ &hf_sna_nlp_opti_0d_target,
{ "Target Resource ID Present",
"sna.nlp.thdr.optional.0d.target",
FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
{ &hf_sna_nlp_opti_0d_arb,
{ "ARB Flow Control", "sna.nlp.thdr.optional.0d.arb",
FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
{ &hf_sna_nlp_opti_0d_reliable,
{ "Reliable Connection", "sna.nlp.thdr.optional.0d.reliable",
FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
{ &hf_sna_nlp_opti_0d_dedicated,
{ "Dedicated RTP Connection",
"sna.nlp.thdr.optional.0d.dedicated",
FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
{ &hf_sna_nlp_opti_0e_stat,
{ "Status", "sna.nlp.thdr.optional.0e.stat",
FT_UINT8, BASE_HEX, NULL, 0, NULL, HFILL }},
{ &hf_sna_nlp_opti_0e_gap,
{ "Gap Detected", "sna.nlp.thdr.optional.0e.gap",
FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
{ &hf_sna_nlp_opti_0e_idle,
{ "RTP Idle Packet", "sna.nlp.thdr.optional.0e.idle",
FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
{ &hf_sna_nlp_opti_0e_nabsp,
{ "Number Of ABSP", "sna.nlp.thdr.optional.0e.nabsp",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_0e_sync,
{ "Status Report Number", "sna.nlp.thdr.optional.0e.sync",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_0e_echo,
{ "Status Acknowledge Number", "sna.nlp.thdr.optional.0e.echo",
FT_UINT16, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_0e_rseq,
{ "Received Sequence Number", "sna.nlp.thdr.optional.0e.rseq",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
#if 0
{ &hf_sna_nlp_opti_0e_abspbeg,
{ "ABSP Begin", "sna.nlp.thdr.optional.0e.abspbeg",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
#endif
#if 0
{ &hf_sna_nlp_opti_0e_abspend,
{ "ABSP End", "sna.nlp.thdr.optional.0e.abspend",
FT_UINT32, BASE_HEX, NULL, 0x0, NULL, HFILL }},
#endif
{ &hf_sna_nlp_opti_0f_bits,
{ "Client Bits", "sna.nlp.thdr.optional.0f.bits",
FT_UINT8, BASE_HEX, VALS(sna_nlp_opti_0f_bits_vals),
0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_10_tcid,
{ "Transport Connection Identifier",
"sna.nlp.thdr.optional.10.tcid",
FT_BYTES, BASE_NONE, NULL, 0x0, "TCID", HFILL }},
{ &hf_sna_nlp_opti_12_sense,
{ "Sense Data", "sna.nlp.thdr.optional.12.sense",
FT_BYTES, BASE_NONE, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_len,
{ "Length", "sna.nlp.thdr.optional.14.si.len",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_key,
{ "Key", "sna.nlp.thdr.optional.14.si.key",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_2,
{ "Switching Information Byte 2",
"sna.nlp.thdr.optional.14.si.2",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_refifo,
{ "Resequencing (REFIFO) Indicator",
"sna.nlp.thdr.optional.14.si.refifo",
FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_mobility,
{ "Mobility Indicator",
"sna.nlp.thdr.optional.14.si.mobility",
FT_BOOLEAN, 8, NULL, 0x40, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_dirsearch,
{ "Directory Search Required on Path Switch Indicator",
"sna.nlp.thdr.optional.14.si.dirsearch",
FT_BOOLEAN, 8, NULL, 0x20, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_limitres,
{ "Limited Resource Link Indicator",
"sna.nlp.thdr.optional.14.si.limitres",
FT_BOOLEAN, 8, NULL, 0x10, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_ncescope,
{ "NCE Scope Indicator",
"sna.nlp.thdr.optional.14.si.ncescope",
FT_BOOLEAN, 8, NULL, 0x08, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_mnpsrscv,
{ "MNPS RSCV Retention Indicator",
"sna.nlp.thdr.optional.14.si.mnpsrscv",
FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_maxpsize,
{ "Maximum Packet Size On Return Path",
"sna.nlp.thdr.optional.14.si.maxpsize",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_switch,
{ "Path Switch Time", "sna.nlp.thdr.optional.14.si.switch",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_si_alive,
{ "RTP Alive Timer", "sna.nlp.thdr.optional.14.si.alive",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_rr_len,
{ "Length", "sna.nlp.thdr.optional.14.rr.len",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_rr_key,
{ "Key", "sna.nlp.thdr.optional.14.rr.key",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_rr_2,
{ "Return Route TG Descriptor Byte 2",
"sna.nlp.thdr.optional.14.rr.2",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_rr_bfe,
{ "BF Entry Indicator",
"sna.nlp.thdr.optional.14.rr.bfe",
FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
{ &hf_sna_nlp_opti_14_rr_num,
{ "Number Of TG Control Vectors",
"sna.nlp.thdr.optional.14.rr.num",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_2,
{ "Adaptive Rate Based Segment Byte 2",
"sna.nlp.thdr.optional.22.2",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_type,
{ "Message Type",
"sna.nlp.thdr.optional.22.type",
FT_UINT8, BASE_HEX,
VALS(sna_nlp_opti_22_type_vals), 0xc0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_raa,
{ "Rate Adjustment Action",
"sna.nlp.thdr.optional.22.raa",
FT_UINT8, BASE_HEX,
VALS(sna_nlp_opti_22_raa_vals), 0x38, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_parity,
{ "Parity Indicator",
"sna.nlp.thdr.optional.22.parity",
FT_BOOLEAN, 8, NULL, 0x04, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_arb,
{ "ARB Mode",
"sna.nlp.thdr.optional.22.arb",
FT_UINT8, BASE_HEX,
VALS(sna_nlp_opti_22_arb_vals), 0x03, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_3,
{ "Adaptive Rate Based Segment Byte 3",
"sna.nlp.thdr.optional.22.3",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_ratereq,
{ "Rate Request Correlator",
"sna.nlp.thdr.optional.22.ratereq",
FT_UINT8, BASE_DEC, NULL, 0xf0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_raterep,
{ "Rate Reply Correlator",
"sna.nlp.thdr.optional.22.raterep",
FT_UINT8, BASE_DEC, NULL, 0x0f, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_field1,
{ "Field 1", "sna.nlp.thdr.optional.22.field1",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_field2,
{ "Field 2", "sna.nlp.thdr.optional.22.field2",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_field3,
{ "Field 3", "sna.nlp.thdr.optional.22.field3",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_nlp_opti_22_field4,
{ "Field 4", "sna.nlp.thdr.optional.22.field4",
FT_UINT32, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_rh,
{ "Request/Response Header", "sna.rh", FT_NONE, BASE_NONE,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_rh_0,
{ "Request/Response Header Byte 0", "sna.rh.0", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_rh_1,
{ "Request/Response Header Byte 1", "sna.rh.1", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_rh_2,
{ "Request/Response Header Byte 2", "sna.rh.2", FT_UINT8,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_rh_rri,
{ "Request/Response Indicator", "sna.rh.rri", FT_UINT8,
BASE_DEC, VALS(sna_rh_rri_vals), 0x80, NULL, HFILL }},
{ &hf_sna_rh_ru_category,
{ "Request/Response Unit Category", "sna.rh.ru_category",
FT_UINT8, BASE_HEX, VALS(sna_rh_ru_category_vals), 0x60,
NULL, HFILL }},
{ &hf_sna_rh_fi,
{ "Format Indicator", "sna.rh.fi", FT_BOOLEAN, 8,
TFS(&sna_rh_fi_truth), 0x08, NULL, HFILL }},
{ &hf_sna_rh_sdi,
{ "Sense Data Included", "sna.rh.sdi", FT_BOOLEAN, 8,
TFS(&tfs_included_not_included), 0x04, NULL, HFILL }},
{ &hf_sna_rh_bci,
{ "Begin Chain Indicator", "sna.rh.bci", FT_BOOLEAN, 8,
TFS(&sna_rh_bci_truth), 0x02, NULL, HFILL }},
{ &hf_sna_rh_eci,
{ "End Chain Indicator", "sna.rh.eci", FT_BOOLEAN, 8,
TFS(&sna_rh_eci_truth), 0x01, NULL, HFILL }},
{ &hf_sna_rh_dr1,
{ "Definite Response 1 Indicator", "sna.rh.dr1", FT_BOOLEAN,
8, NULL, 0x80, NULL, HFILL }},
{ &hf_sna_rh_lcci,
{ "Length-Checked Compression Indicator", "sna.rh.lcci",
FT_BOOLEAN, 8, TFS(&sna_rh_lcci_truth), 0x40, NULL, HFILL }},
{ &hf_sna_rh_dr2,
{ "Definite Response 2 Indicator", "sna.rh.dr2", FT_BOOLEAN,
8, NULL, 0x20, NULL, HFILL }},
{ &hf_sna_rh_eri,
{ "Exception Response Indicator", "sna.rh.eri", FT_BOOLEAN,
8, NULL, 0x10, NULL, HFILL }},
{ &hf_sna_rh_rti,
{ "Response Type Indicator", "sna.rh.rti", FT_BOOLEAN,
8, TFS(&sna_rh_rti_truth), 0x10, NULL, HFILL }},
{ &hf_sna_rh_rlwi,
{ "Request Larger Window Indicator", "sna.rh.rlwi", FT_BOOLEAN,
8, NULL, 0x04, NULL, HFILL }},
{ &hf_sna_rh_qri,
{ "Queued Response Indicator", "sna.rh.qri", FT_BOOLEAN,
8, TFS(&sna_rh_qri_truth), 0x02, NULL, HFILL }},
{ &hf_sna_rh_pi,
{ "Pacing Indicator", "sna.rh.pi", FT_BOOLEAN,
8, NULL, 0x01, NULL, HFILL }},
{ &hf_sna_rh_bbi,
{ "Begin Bracket Indicator", "sna.rh.bbi", FT_BOOLEAN,
8, NULL, 0x80, NULL, HFILL }},
{ &hf_sna_rh_ebi,
{ "End Bracket Indicator", "sna.rh.ebi", FT_BOOLEAN,
8, NULL, 0x40, NULL, HFILL }},
{ &hf_sna_rh_cdi,
{ "Change Direction Indicator", "sna.rh.cdi", FT_BOOLEAN,
8, NULL, 0x20, NULL, HFILL }},
{ &hf_sna_rh_csi,
{ "Code Selection Indicator", "sna.rh.csi", FT_UINT8, BASE_DEC,
VALS(sna_rh_csi_vals), 0x08, NULL, HFILL }},
{ &hf_sna_rh_edi,
{ "Enciphered Data Indicator", "sna.rh.edi", FT_BOOLEAN, 8,
NULL, 0x04, NULL, HFILL }},
{ &hf_sna_rh_pdi,
{ "Padded Data Indicator", "sna.rh.pdi", FT_BOOLEAN, 8, NULL,
0x02, NULL, HFILL }},
{ &hf_sna_rh_cebi,
{ "Conditional End Bracket Indicator", "sna.rh.cebi",
FT_BOOLEAN, 8, NULL, 0x01, NULL, HFILL }},
/* { &hf_sna_ru,
{ "Request/Response Unit", "sna.ru", FT_NONE, BASE_NONE,
NULL, 0x0, NULL, HFILL }},*/
{ &hf_sna_gds,
{ "GDS Variable", "sna.gds", FT_NONE, BASE_NONE, NULL, 0x0,
NULL, HFILL }},
{ &hf_sna_gds_len,
{ "GDS Variable Length", "sna.gds.len", FT_UINT16, BASE_DEC,
NULL, 0x7fff, NULL, HFILL }},
{ &hf_sna_gds_cont,
{ "Continuation Flag", "sna.gds.cont", FT_BOOLEAN, 16, NULL,
0x8000, NULL, HFILL }},
{ &hf_sna_gds_type,
{ "Type of Variable", "sna.gds.type", FT_UINT16, BASE_HEX,
VALS(sna_gds_var_vals), 0x0, NULL, HFILL }},
{ &hf_sna_gds_info,
{ "Information", "sna.gds.info", FT_BYTES, BASE_NONE,
NULL, 0x0, NULL, HFILL }},
#if 0
{ &hf_sna_xid,
{ "XID", "sna.xid", FT_NONE, BASE_NONE, NULL, 0x0,
"XID Frame", HFILL }},
#endif
{ &hf_sna_xid_0,
{ "XID Byte 0", "sna.xid.0", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
{ &hf_sna_xid_format,
{ "XID Format", "sna.xid.format", FT_UINT8, BASE_DEC, NULL,
0xf0, NULL, HFILL }},
{ &hf_sna_xid_type,
{ "XID Type", "sna.xid.type", FT_UINT8, BASE_DEC,
VALS(sna_xid_type_vals), 0x0f, NULL, HFILL }},
{ &hf_sna_xid_len,
{ "XID Length", "sna.xid.len", FT_UINT8, BASE_DEC, NULL, 0x0,
NULL, HFILL }},
{ &hf_sna_xid_id,
{ "Node Identification", "sna.xid.id", FT_UINT32, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_xid_idblock,
{ "ID Block", "sna.xid.idblock", FT_UINT32, BASE_HEX, NULL,
0xfff00000, NULL, HFILL }},
{ &hf_sna_xid_idnum,
{ "ID Number", "sna.xid.idnum", FT_UINT32, BASE_HEX, NULL,
0x0fffff, NULL, HFILL }},
{ &hf_sna_xid_3_8,
{ "Characteristics of XID sender", "sna.xid.type3.8", FT_UINT16,
BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_xid_3_init_self,
{ "INIT-SELF support", "sna.xid.type3.initself",
FT_BOOLEAN, 16, NULL, 0x8000, NULL, HFILL }},
{ &hf_sna_xid_3_stand_bind,
{ "Stand-Alone BIND Support", "sna.xid.type3.stand_bind",
FT_BOOLEAN, 16, NULL, 0x4000, NULL, HFILL }},
{ &hf_sna_xid_3_gener_bind,
{ "Whole BIND PIU generated indicator",
"sna.xid.type3.gener_bind", FT_BOOLEAN, 16, NULL, 0x2000,
"Whole BIND PIU generated", HFILL }},
{ &hf_sna_xid_3_recve_bind,
{ "Whole BIND PIU required indicator",
"sna.xid.type3.recve_bind", FT_BOOLEAN, 16, NULL, 0x1000,
"Whole BIND PIU required", HFILL }},
{ &hf_sna_xid_3_actpu,
{ "ACTPU suppression indicator", "sna.xid.type3.actpu",
FT_BOOLEAN, 16, NULL, 0x0080, NULL, HFILL }},
{ &hf_sna_xid_3_nwnode,
{ "Sender is network node", "sna.xid.type3.nwnode",
FT_BOOLEAN, 16, NULL, 0x0040, NULL, HFILL }},
{ &hf_sna_xid_3_cp,
{ "Control Point Services", "sna.xid.type3.cp",
FT_BOOLEAN, 16, NULL, 0x0020, NULL, HFILL }},
{ &hf_sna_xid_3_cpcp,
{ "CP-CP session support", "sna.xid.type3.cpcp",
FT_BOOLEAN, 16, NULL, 0x0010, NULL, HFILL }},
{ &hf_sna_xid_3_state,
{ "XID exchange state indicator", "sna.xid.type3.state",
FT_UINT16, BASE_HEX, VALS(sna_xid_3_state_vals),
0x000c, NULL, HFILL }},
{ &hf_sna_xid_3_nonact,
{ "Nonactivation Exchange", "sna.xid.type3.nonact",
FT_BOOLEAN, 16, NULL, 0x0002, NULL, HFILL }},
{ &hf_sna_xid_3_cpchange,
{ "CP name change support", "sna.xid.type3.cpchange",
FT_BOOLEAN, 16, NULL, 0x0001, NULL, HFILL }},
{ &hf_sna_xid_3_10,
{ "XID Type 3 Byte 10", "sna.xid.type3.10", FT_UINT8, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_xid_3_asend_bind,
{ "Adaptive BIND pacing support as sender",
"sna.xid.type3.asend_bind", FT_BOOLEAN, 8, NULL, 0x80,
"Pacing support as sender", HFILL }},
{ &hf_sna_xid_3_arecv_bind,
{ "Adaptive BIND pacing support as receiver",
"sna.xid.type3.asend_recv", FT_BOOLEAN, 8, NULL, 0x40,
"Pacing support as receive", HFILL }},
{ &hf_sna_xid_3_quiesce,
{ "Quiesce TG Request",
"sna.xid.type3.quiesce", FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }},
{ &hf_sna_xid_3_pucap,
{ "PU Capabilities",
"sna.xid.type3.pucap", FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }},
{ &hf_sna_xid_3_pbn,
{ "Peripheral Border Node",
"sna.xid.type3.pbn", FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }},
{ &hf_sna_xid_3_pacing,
{ "Qualifier for adaptive BIND pacing support",
"sna.xid.type3.pacing", FT_UINT8, BASE_HEX, NULL, 0x03,
NULL, HFILL }},
{ &hf_sna_xid_3_11,
{ "XID Type 3 Byte 11", "sna.xid.type3.11", FT_UINT8, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_xid_3_tgshare,
{ "TG Sharing Prohibited Indicator",
"sna.xid.type3.tgshare", FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }},
{ &hf_sna_xid_3_dedsvc,
{ "Dedicated SVC Indicator",
"sna.xid.type3.dedsvc", FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }},
{ &hf_sna_xid_3_12,
{ "XID Type 3 Byte 12", "sna.xid.type3.12", FT_UINT8, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_xid_3_negcsup,
{ "Negotiation Complete Supported",
"sna.xid.type3.negcsup", FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }},
{ &hf_sna_xid_3_negcomp,
{ "Negotiation Complete",
"sna.xid.type3.negcomp", FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }},
{ &hf_sna_xid_3_15,
{ "XID Type 3 Byte 15", "sna.xid.type3.15", FT_UINT8, BASE_HEX,
NULL, 0x0, NULL, HFILL }},
{ &hf_sna_xid_3_partg,
{ "Parallel TG Support",
"sna.xid.type3.partg", FT_BOOLEAN, 8, NULL, 0x80,
NULL, HFILL }},
{ &hf_sna_xid_3_dlur,
{ "Dependent LU Requester Indicator",
"sna.xid.type3.dlur", FT_BOOLEAN, 8, NULL, 0x40,
NULL, HFILL }},
{ &hf_sna_xid_3_dlus,
{ "DLUS Served LU Registration Indicator",
"sna.xid.type3.dlus", FT_BOOLEAN, 8, NULL, 0x20,
NULL, HFILL }},
{ &hf_sna_xid_3_exbn,
{ "Extended HPR Border Node",
"sna.xid.type3.exbn", FT_BOOLEAN, 8, NULL, 0x10,
NULL, HFILL }},
{ &hf_sna_xid_3_genodai,
{ "Generalized ODAI Usage Option",
"sna.xid.type3.genodai", FT_BOOLEAN, 8, NULL, 0x08,
NULL, HFILL }},
{ &hf_sna_xid_3_branch,
{ "Branch Indicator", "sna.xid.type3.branch",
FT_UINT8, BASE_HEX, VALS(sna_xid_3_branch_vals),
0x06, NULL, HFILL }},
{ &hf_sna_xid_3_brnn,
{ "Option Set 1123 Indicator",
"sna.xid.type3.brnn", FT_BOOLEAN, 8, NULL, 0x01,
NULL, HFILL }},
{ &hf_sna_xid_3_tg,
{ "XID TG", "sna.xid.type3.tg", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
{ &hf_sna_xid_3_dlc,
{ "XID DLC", "sna.xid.type3.dlc", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL }},
{ &hf_sna_xid_3_dlen,
{ "DLC Dependent Section Length", "sna.xid.type3.dlen",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_control_len,
{ "Control Vector Length", "sna.control.len",
FT_UINT8, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_control_key,
{ "Control Vector Key", "sna.control.key",
FT_UINT8, BASE_HEX, VALS(sna_control_vals), 0x0, NULL,
HFILL }},
{ &hf_sna_control_hprkey,
{ "Control Vector HPR Key", "sna.control.hprkey",
FT_UINT8, BASE_HEX, VALS(sna_control_hpr_vals), 0x0, NULL,
HFILL }},
{ &hf_sna_control_05_delay,
{ "Channel Delay", "sna.control.05.delay",
FT_UINT16, BASE_DEC, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_control_05_type,
{ "Network Address Type", "sna.control.05.type",
FT_UINT8, BASE_HEX, NULL, 0x0, NULL, HFILL }},
{ &hf_sna_control_05_ptp,
{ "Point-to-point", "sna.control.05.ptp",
FT_BOOLEAN, 8, NULL, 0x80, NULL, HFILL }},
{ &hf_sna_control_0e_type,
{ "Type", "sna.control.0e.type",
FT_UINT8, BASE_HEX, VALS(sna_control_0e_type_vals),
0, NULL, HFILL }},
{ &hf_sna_control_0e_value,
{ "Value", "sna.control.0e.value",
FT_STRING, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_sna_padding,
{ "Padding", "sna.padding",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_sna_reserved,
{ "Reserved", "sna.reserved",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
{ &hf_sna_biu_segment_data,
{ "BIU segment data", "sna.biu_segment_data",
FT_BYTES, BASE_NONE, NULL, 0, NULL, HFILL }},
};
static gint *ett[] = {
&ett_sna,
&ett_sna_th,
&ett_sna_th_fid,
&ett_sna_nlp_nhdr,
&ett_sna_nlp_nhdr_0,
&ett_sna_nlp_nhdr_1,
&ett_sna_nlp_thdr,
&ett_sna_nlp_thdr_8,
&ett_sna_nlp_thdr_9,
&ett_sna_nlp_opti_un,
&ett_sna_nlp_opti_0d,
&ett_sna_nlp_opti_0d_4,
&ett_sna_nlp_opti_0e,
&ett_sna_nlp_opti_0e_stat,
&ett_sna_nlp_opti_0e_absp,
&ett_sna_nlp_opti_0f,
&ett_sna_nlp_opti_10,
&ett_sna_nlp_opti_12,
&ett_sna_nlp_opti_14,
&ett_sna_nlp_opti_14_si,
&ett_sna_nlp_opti_14_si_2,
&ett_sna_nlp_opti_14_rr,
&ett_sna_nlp_opti_14_rr_2,
&ett_sna_nlp_opti_22,
&ett_sna_nlp_opti_22_2,
&ett_sna_nlp_opti_22_3,
&ett_sna_rh,
&ett_sna_rh_0,
&ett_sna_rh_1,
&ett_sna_rh_2,
&ett_sna_gds,
&ett_sna_xid_0,
&ett_sna_xid_id,
&ett_sna_xid_3_8,
&ett_sna_xid_3_10,
&ett_sna_xid_3_11,
&ett_sna_xid_3_12,
&ett_sna_xid_3_15,
&ett_sna_control_un,
&ett_sna_control_05,
&ett_sna_control_05hpr,
&ett_sna_control_05hpr_type,
&ett_sna_control_0e,
};
module_t *sna_module;
proto_sna = proto_register_protocol("Systems Network Architecture",
"SNA", "sna");
proto_register_field_array(proto_sna, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
sna_handle = register_dissector("sna", dissect_sna, proto_sna);
proto_sna_xid = proto_register_protocol(
"Systems Network Architecture XID", "SNA XID", "sna_xid");
sna_xid_handle = register_dissector("sna_xid", dissect_sna_xid, proto_sna_xid);
sna_address_type = address_type_dissector_register("AT_SNA", "SNA Address", sna_fid_to_str_buf, sna_address_str_len, NULL, NULL, NULL, NULL, NULL);
/* Register configuration options */
sna_module = prefs_register_protocol(proto_sna, NULL);
prefs_register_bool_preference(sna_module, "defragment",
"Reassemble fragmented BIUs",
"Whether fragmented BIUs should be reassembled",
&sna_defragment);
reassembly_table_register(&sna_reassembly_table,
&addresses_reassembly_table_functions);
}
void
proto_reg_handoff_sna(void)
{
dissector_add_uint("llc.dsap", SAP_SNA_PATHCTRL, sna_handle);
dissector_add_uint("llc.dsap", SAP_SNA1, sna_handle);
dissector_add_uint("llc.dsap", SAP_SNA2, sna_handle);
dissector_add_uint("llc.dsap", SAP_SNA3, sna_handle);
dissector_add_uint("llc.dsap", SAP_SNA4, sna_handle);
dissector_add_uint("llc.xid_dsap", SAP_SNA_PATHCTRL, sna_xid_handle);
dissector_add_uint("llc.xid_dsap", SAP_SNA1, sna_xid_handle);
dissector_add_uint("llc.xid_dsap", SAP_SNA2, sna_xid_handle);
dissector_add_uint("llc.xid_dsap", SAP_SNA3, sna_xid_handle);
/* RFC 2043 */
dissector_add_uint("ppp.protocol", PPP_SNA, sna_handle);
}
/*
* 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:
*/
|