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
|
/* This dissector is based on the SBC2 specification.
* TODO
* parts of opcodes
* 0x7f
* 0xa3
* 0xa4
* 0x9e
* are still missing.
* Some DATA IN/OUT PDUs are missing as well.
*/
/* packet-scsi-sbc.c
* Dissector for the SCSI SBC commandset
* Extracted from packet-scsi.c
*
* Dinesh G Dutt (ddutt@cisco.com)
* Ronnie sahlberg 2006
*
* Wireshark - Network traffic analyzer
* By Gerald Combs <gerald@wireshark.org>
* Copyright 2002 Gerald Combs
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#include "config.h"
#include <epan/packet.h>
#include <epan/conversation.h>
#include "packet-scsi.h"
#include "packet-scsi-sbc.h"
void proto_register_scsi_sbc(void);
static int proto_scsi_sbc = -1;
int hf_scsi_sbc_opcode= -1;
static int hf_scsi_sbc_service_action= -1;
static int hf_scsi_sbc_formatunit_flags= -1;
static int hf_scsi_sbc_defect_list_format= -1;
static int hf_scsi_sbc_formatunit_vendor= -1;
static int hf_scsi_sbc_formatunit_interleave= -1;
static int hf_scsi_sbc_rdwr6_lba= -1;
static int hf_scsi_sbc_rdwr6_xferlen= -1;
static int hf_scsi_sbc_rdwr10_lba= -1;
static int hf_scsi_sbc_rdwr10_xferlen= -1;
static int hf_scsi_sbc_rdwr12_xferlen= -1;
static int hf_scsi_sbc_rdwr16_lba= -1;
static int hf_scsi_sbc_ssu_immed_flags= -1;
static int hf_scsi_sbc_ssu_immed= -1;
static int hf_scsi_sbc_ssu_pwr_flags= -1;
static int hf_scsi_sbc_ssu_pwr_cond= -1;
static int hf_scsi_sbc_ssu_loej= -1;
static int hf_scsi_sbc_ssu_start= -1;
static int hf_scsi_sbc_bytchk= -1;
/* static int hf_scsi_sbc_verify_reladdr= -1; */
static int hf_scsi_sbc_verify_lba= -1;
static int hf_scsi_sbc_verify_lba64= -1;
static int hf_scsi_sbc_verify_vlen= -1;
static int hf_scsi_sbc_verify_vlen32= -1;
static int hf_scsi_sbc_wrverify_lba= -1;
static int hf_scsi_sbc_wrverify_xferlen= -1;
static int hf_scsi_sbc_wrverify_lba64= -1;
static int hf_scsi_sbc_wrverify_xferlen32= -1;
/* static int hf_scsi_sbc_readcapacity_flags= -1; */
static int hf_scsi_sbc_readdefdata_flags= -1;
static int hf_scsi_sbc_reassignblks_flags= -1;
static int hf_scsi_sbc_read_flags= -1;
static int hf_scsi_sbc_alloclen32= -1;
static int hf_scsi_sbc_alloclen16= -1;
static int hf_scsi_sbc_lba64_address= -1;
static int hf_scsi_sbc_fuflags_fmtpinfo= -1;
static int hf_scsi_sbc_fuflags_rto_req= -1;
static int hf_scsi_sbc_fuflags_longlist= -1;
static int hf_scsi_sbc_fuflags_fmtdata= -1;
static int hf_scsi_sbc_fuflags_cmplist= -1;
static int hf_scsi_sbc_prefetch_flags= -1;
static int hf_scsi_sbc_prefetch_immed= -1;
static int hf_scsi_sbc_group= -1;
static int hf_scsi_sbc_rdprotect= -1;
static int hf_scsi_sbc_dpo= -1;
static int hf_scsi_sbc_fua= -1;
static int hf_scsi_sbc_fua_nv= -1;
static int hf_scsi_sbc_blocksize= -1;
static int hf_scsi_sbc_returned_lba= -1;
static int hf_scsi_sbc_req_plist= -1;
static int hf_scsi_sbc_req_glist= -1;
static int hf_scsi_sbc_corrct_flags= -1;
static int hf_scsi_sbc_corrct= -1;
static int hf_scsi_sbc_reassignblocks_longlba= -1;
static int hf_scsi_sbc_reassignblocks_longlist= -1;
static int hf_scsi_sbc_synccache_flags= -1;
static int hf_scsi_sbc_synccache_immed= -1;
static int hf_scsi_sbc_synccache_sync_nv= -1;
static int hf_scsi_sbc_vrprotect= -1;
static int hf_scsi_sbc_verify_flags= -1;
static int hf_scsi_sbc_wrprotect= -1;
static int hf_scsi_sbc_wrverify_flags= -1;
static int hf_scsi_sbc_writesame_flags= -1;
static int hf_scsi_sbc_anchor= -1;
static int hf_scsi_sbc_unmap= -1;
static int hf_scsi_sbc_pbdata= -1;
static int hf_scsi_sbc_lbdata= -1;
static int hf_scsi_sbc_xdread_flags= -1;
static int hf_scsi_sbc_xorpinfo= -1;
static int hf_scsi_sbc_disable_write= -1;
static int hf_scsi_sbc_xdwrite_flags= -1;
static int hf_scsi_sbc_xdwriteread_flags= -1;
static int hf_scsi_sbc_xpwrite_flags= -1;
static int hf_scsi_sbc_unmap_flags= -1;
static int hf_scsi_sbc_unmap_anchor= -1;
static int hf_scsi_sbc_unmap_data_length= -1;
static int hf_scsi_sbc_unmap_block_descriptor_data_length= -1;
static int hf_scsi_sbc_unmap_lba= -1;
static int hf_scsi_sbc_unmap_num_blocks= -1;
static int hf_scsi_sbc_ptype= -1;
static int hf_scsi_sbc_prot_en= -1;
static int hf_scsi_sbc_p_i_exponent= -1;
static int hf_scsi_sbc_lbppbe= -1;
static int hf_scsi_sbc_lbpme= -1;
static int hf_scsi_sbc_lbprz= -1;
static int hf_scsi_sbc_lalba= -1;
static int hf_scsi_sbc_get_lba_status_lba= -1;
static int hf_scsi_sbc_get_lba_status_data_length= -1;
static int hf_scsi_sbc_get_lba_status_num_blocks= -1;
static int hf_scsi_sbc_get_lba_status_provisioning_status= -1;
static int hf_scsi_sbc_sanitize_flags= -1;
static int hf_scsi_sbc_sanitize_immed= -1;
static int hf_scsi_sbc_sanitize_ause= -1;
static int hf_scsi_sbc_sanitize_sa= -1;
static int hf_scsi_sbc_sanitize_overwrite_flags= -1;
static int hf_scsi_sbc_sanitize_invert= -1;
static int hf_scsi_sbc_sanitize_test= -1;
static int hf_scsi_sbc_sanitize_owcount= -1;
static int hf_scsi_sbc_sanitize_pattern_length= -1;
static int hf_scsi_sbc_sanitize_pattern= -1;
static gint ett_scsi_format_unit= -1;
static gint ett_scsi_prefetch= -1;
static gint ett_scsi_rdwr= -1;
static gint ett_scsi_xdread= -1;
static gint ett_scsi_xdwrite= -1;
static gint ett_scsi_xdwriteread= -1;
static gint ett_scsi_xpwrite= -1;
static gint ett_scsi_defectdata= -1;
static gint ett_scsi_corrct= -1;
static gint ett_scsi_reassign_blocks= -1;
static gint ett_scsi_ssu_immed= -1;
static gint ett_scsi_ssu_pwr= -1;
static gint ett_scsi_synccache= -1;
static gint ett_scsi_verify= -1;
static gint ett_scsi_wrverify= -1;
static gint ett_scsi_writesame= -1;
static gint ett_scsi_unmap= -1;
static gint ett_scsi_unmap_block_descriptor= -1;
static gint ett_scsi_lba_status_descriptor= -1;
static gint ett_scsi_sanitize= -1;
static gint ett_scsi_sanitize_overwrite= -1;
static const true_false_string dpo_tfs = {
"Disable Page Out (don't cache this data)",
"Disable page out is DISABLED (cache this data)"
};
static const true_false_string fua_tfs = {
"Read from the medium, not cache",
"Read from cache if possible"
};
static const true_false_string fua_nv_tfs = {
"Read from volatile cache is NOT permitted",
"Read from volatile or non-volatile cache permitted"
};
#if 0
static const true_false_string pmi_tfs = {
"PMI is SET",
"Pmi is CLEAR"
};
#endif
static void
dissect_sbc_formatunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const fuflags_fields[] = {
&hf_scsi_sbc_fuflags_fmtpinfo,
&hf_scsi_sbc_fuflags_rto_req,
&hf_scsi_sbc_fuflags_longlist,
&hf_scsi_sbc_fuflags_fmtdata,
&hf_scsi_sbc_fuflags_cmplist,
&hf_scsi_sbc_defect_list_format,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_formatunit_flags,
ett_scsi_format_unit, fuflags_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_formatunit_vendor, tvb, offset+1, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_formatunit_interleave, tvb, offset+2, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
/* TODO : add dissection of DATA */
}
static void
dissect_sbc_read6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
tvb_get_ntoh24 (tvb, offset),
tvb_get_guint8 (tvb, offset+3));
}
if (tree && isreq && iscdb) {
proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_lba, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_xferlen, tvb, offset+3, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_write6 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%06x, Len: %u)",
tvb_get_ntoh24 (tvb, offset),
tvb_get_guint8 (tvb, offset+3));
}
if (tree && isreq && iscdb) {
proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_lba, tvb, offset, 3, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr6_xferlen, tvb, offset+3, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_prefetch10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const prefetch_fields[] = {
&hf_scsi_sbc_prefetch_immed,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_prefetch_flags,
ett_scsi_prefetch, prefetch_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_synchronizecache10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const sync_fields[] = {
&hf_scsi_sbc_synccache_sync_nv,
&hf_scsi_sbc_synccache_immed,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_synccache_flags,
ett_scsi_synccache, sync_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_synchronizecache16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const sync_fields[] = {
&hf_scsi_sbc_synccache_sync_nv,
&hf_scsi_sbc_synccache_immed,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_synccache_flags,
ett_scsi_synccache, sync_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_prefetch16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const prefetch_fields[] = {
&hf_scsi_sbc_prefetch_immed,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_prefetch_flags,
ett_scsi_prefetch, prefetch_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
void
dissect_sbc_read10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr10_fields[] = {
&hf_scsi_sbc_rdprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_xdread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const xdread10_fields[] = {
&hf_scsi_sbc_xorpinfo,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdread_flags,
ett_scsi_xdread, xdread10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_xdwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const xdwrite10_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_disable_write,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdwrite_flags,
ett_scsi_xdwrite, xdwrite10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_xdwriteread10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const xdwriteread10_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_disable_write,
&hf_scsi_sbc_fua_nv,
&hf_scsi_sbc_xorpinfo,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xdwriteread_flags,
ett_scsi_xdwriteread, xdwriteread10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_xpwrite10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const xpwrite10_fields[] = {
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
&hf_scsi_sbc_xorpinfo,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_xpwrite_flags,
ett_scsi_xpwrite, xpwrite10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
void
dissect_sbc_write10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr10_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
void
dissect_sbc_read12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr12_fields[] = {
&hf_scsi_sbc_rdprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr12_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+5, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
void
dissect_sbc_write12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr12_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr12_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+5, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_read16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr16_fields[] = {
&hf_scsi_sbc_rdprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_write16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr16_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_writeatomic16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr16_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohs (tvb, offset+11));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+11, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_orwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr16_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_comparenwrite (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const rdwr16_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_fua,
&hf_scsi_sbc_fua_nv,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_read_flags,
ett_scsi_rdwr, rdwr16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+12, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static const value_string scsi_ssu_pwrcnd_val[] = {
{0x0, "No Change"},
{0x1, "Place Device In Active Condition"},
{0x2, "Place device into Idle condition"},
{0x3, "Place device into Standby condition"},
{0x4, "Reserved"},
{0x5, "Place device into Sleep condition"},
{0x6, "Reserved"},
{0x7, "Transfer control of power conditions to block device"},
{0x8, "Reserved"},
{0x9, "Reserved"},
{0xA, "Force Idle Condition Timer to zero"},
{0xB, "Force Standby Condition Timer to zero"},
{0, NULL},
};
static const value_string scsi_ptype_val[] = {
{0x0, "Type 1 protection" },
{0x1, "Type 2 protection" },
{0x2, "Type 3 protection" },
{0, NULL},
};
static const value_string scsi_provisioning_type_val[] = {
{0x0, "The LBA is MAPPED" },
{0x1, "The LBA is DEALLOCATED" },
{0x2, "The LBA is ANCHORED" },
{0, NULL},
};
void
dissect_sbc_startstopunit (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq _U_, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const ssu_fields[] = {
&hf_scsi_sbc_ssu_immed,
NULL
};
static int * const pwr_fields[] = {
&hf_scsi_sbc_ssu_pwr_cond,
&hf_scsi_sbc_ssu_loej,
&hf_scsi_sbc_ssu_start,
NULL
};
if (!tree || !iscdb)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_ssu_immed_flags,
ett_scsi_ssu_immed, ssu_fields, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+3, hf_scsi_sbc_ssu_pwr_flags,
ett_scsi_ssu_pwr, pwr_fields, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_verify10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const verify10_fields[] = {
&hf_scsi_sbc_vrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_bytchk,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags,
ett_scsi_verify, verify10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_verify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_verify12 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const verify12_fields[] = {
&hf_scsi_sbc_vrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_bytchk,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags,
ett_scsi_verify, verify12_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_verify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen32, tvb, offset+5, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_verify16 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const verify16_fields[] = {
&hf_scsi_sbc_vrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_bytchk,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_verify_flags,
ett_scsi_verify, verify16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_verify_lba64, tvb, offset+1, 8, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_verify_vlen32, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_wrverify10 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb, guint payload_len _U_,
scsi_task_data_t *cdata _U_)
{
static int * const wrverify10_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_bytchk,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohs (tvb, offset+6));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags,
ett_scsi_wrverify, wrverify10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_wrverify12 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb, guint payload_len _U_,
scsi_task_data_t *cdata _U_)
{
static int * const wrverify12_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_bytchk,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: 0x%08x, Len: %u)",
tvb_get_ntohl (tvb, offset+1),
tvb_get_ntohl (tvb, offset+5));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags,
ett_scsi_wrverify, wrverify12_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen32, tvb, offset+5, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+9, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_wrverify16 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb, guint payload_len _U_,
scsi_task_data_t *cdata _U_)
{
static int * const wrverify16_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_dpo,
&hf_scsi_sbc_bytchk,
NULL
};
if (isreq && iscdb) {
col_append_fstr (pinfo->cinfo, COL_INFO, "(LBA: %" PRIu64 ", Len: %u)",
tvb_get_ntoh64 (tvb, offset+1),
tvb_get_ntohl (tvb, offset+9));
}
if (tree && isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_wrverify_flags,
ett_scsi_wrverify, wrverify16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_wrverify_lba64, tvb, offset+1, 8, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_wrverify_xferlen32, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
void
dissect_sbc_readcapacity10 (tvbuff_t *tvb, packet_info *pinfo _U_, proto_tree *tree,
guint offset, gboolean isreq, gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
guint32 len, block_len, tot_len;
const char *un;
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
else if (!iscdb) {
len = tvb_get_ntohl (tvb, offset);
block_len = tvb_get_ntohl (tvb, offset+4);
tot_len=((len/1024)*block_len)/1024; /*MB*/
un="MB";
if(tot_len>20000){
tot_len/=1024;
un="GB";
}
proto_tree_add_uint_format (tree, hf_scsi_sbc_returned_lba, tvb, offset, 4, len, "LBA: %u (%u %s)", len, tot_len, un);
proto_tree_add_item (tree, hf_scsi_sbc_blocksize, tvb, offset+4, 4, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_readdefectdata10 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const defect_fields[] = {
&hf_scsi_sbc_defect_list_format,
&hf_scsi_sbc_req_plist,
&hf_scsi_sbc_req_glist,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset+1, hf_scsi_sbc_readdefdata_flags,
ett_scsi_defectdata, defect_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
/* TODO : add dissection of DATA */
}
static void
dissect_sbc_readlong10 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const corrct_fields[] = {
&hf_scsi_sbc_corrct,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_corrct_flags,
ett_scsi_corrct, corrct_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_writelong10 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_writesame10 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const writesame10_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_anchor,
&hf_scsi_sbc_unmap,
&hf_scsi_sbc_pbdata,
&hf_scsi_sbc_lbdata,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_writesame_flags,
ett_scsi_writesame, writesame10_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr10_lba, tvb, offset+1, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_writesame16 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const writesame16_fields[] = {
&hf_scsi_sbc_wrprotect,
&hf_scsi_sbc_anchor,
&hf_scsi_sbc_unmap,
&hf_scsi_sbc_pbdata,
&hf_scsi_sbc_lbdata,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_writesame_flags,
ett_scsi_writesame, writesame16_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr16_lba, tvb, offset+1, 8, ENC_NA);
proto_tree_add_item (tree, hf_scsi_sbc_rdwr12_xferlen, tvb, offset+9, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+14, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
}
static void
dissect_sbc_unmap (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const unmap_fields[] = {
&hf_scsi_sbc_unmap_anchor,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_unmap_flags,
ett_scsi_unmap, unmap_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_group, tvb, offset+5, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
} else if (isreq) {
proto_tree_add_item (tree, hf_scsi_sbc_unmap_data_length, tvb, offset, 2, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_unmap_block_descriptor_data_length, tvb, offset+2, 2, ENC_BIG_ENDIAN);
offset += 8;
while (tvb_reported_length_remaining(tvb, offset) >=16) {
proto_tree *tr;
proto_item *it;
gint64 lba;
gint32 num_blocks;
tr = proto_tree_add_subtree(tree, tvb, offset, 16, ett_scsi_unmap_block_descriptor, &it, "UNMAP Block Descriptor: LBA ");
proto_tree_add_item (tr, hf_scsi_sbc_unmap_lba, tvb, offset, 8, ENC_BIG_ENDIAN);
lba = tvb_get_ntoh64 (tvb, offset);
proto_tree_add_item (tr, hf_scsi_sbc_unmap_num_blocks, tvb, offset+8, 4, ENC_BIG_ENDIAN);
num_blocks = tvb_get_ntohl(tvb, offset+8);
if (num_blocks > 1) {
proto_item_append_text (it, "%" PRIu64 "-%" PRIu64 " ", lba, lba+num_blocks-1);
} else {
proto_item_append_text (it, "%" PRIu64 " ", lba);
}
offset += 16;
}
}
}
static const value_string sanitize_val[] = {
{0x01, "OVERWRITE"},
{0x02, "BLOCK ERASE"},
{0x03, "CRYPTO ERASE"},
{0x1f, "EXIT FAILURE MODE"},
{0, NULL},
};
static void
dissect_sbc_sanitize (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const sanitize_fields[] = {
&hf_scsi_sbc_sanitize_immed,
&hf_scsi_sbc_sanitize_ause,
&hf_scsi_sbc_sanitize_sa,
NULL
};
static int * const sanitize_overwrite_fields[] = {
&hf_scsi_sbc_sanitize_invert,
&hf_scsi_sbc_sanitize_test,
&hf_scsi_sbc_sanitize_owcount,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
guint8 service_action;
service_action = tvb_get_guint8 (tvb, offset) & 0x1F;
col_append_str(pinfo->cinfo, COL_INFO,
val_to_str(service_action, sanitize_val, "Unknown (0x%02x)"));
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_sanitize_flags,
ett_scsi_sanitize, sanitize_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset+6, 2,
ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+8, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
} else if (isreq) {
proto_tree_add_bitmask(tree, tvb, offset,
hf_scsi_sbc_sanitize_overwrite_flags,
ett_scsi_sanitize_overwrite,
sanitize_overwrite_fields,
ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_sanitize_pattern_length,
tvb, offset+2, 2,
ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_sanitize_pattern,
tvb, offset+4, -1,
ENC_NA);
}
}
static void
dissect_sbc_readdefectdata12 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const defect_fields[] = {
&hf_scsi_sbc_defect_list_format,
&hf_scsi_sbc_req_plist,
&hf_scsi_sbc_req_glist,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_readdefdata_flags,
ett_scsi_defectdata, defect_fields, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset+5, 4, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+10, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
/* TODO : add dissection of DATA */
}
static void
dissect_sbc_reassignblocks (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
static int * const reassign_fields[] = {
&hf_scsi_sbc_reassignblocks_longlba,
&hf_scsi_sbc_reassignblocks_longlist,
NULL
};
if (!tree)
return;
if (isreq && iscdb) {
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_sbc_reassignblks_flags,
ett_scsi_reassign_blocks, reassign_fields, ENC_BIG_ENDIAN);
proto_tree_add_bitmask(tree, tvb, offset+4, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
}
/* TODO : add dissection of DATA */
}
const value_string service_action_vals[] = {
{SHORT_FORM_BLOCK_ID, "Short Form - Block ID"},
{SHORT_FORM_VENDOR_SPECIFIC, "Short Form - Vendor-Specific"},
{LONG_FORM, "Long Form"},
{EXTENDED_FORM, "Extended Form"},
{SERVICE_READ_CAPACITY16, "Read Capacity(16)"},
{SERVICE_READ_LONG16, "Read Long(16)"},
{SERVICE_GET_LBA_STATUS, "Get LBA Status"},
{SERVICE_REPORT_REFERRALS, "Report Referrals"},
{0, NULL}
};
/* this is either readcapacity16 or readlong16 depending of what service
action is set to.
*/
static void
dissect_sbc_serviceactionin16 (tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
guint8 service_action;
guint32 block_len;
guint64 len, tot_len;
const char *un;
proto_item *it = NULL;
if (isreq && iscdb) {
service_action = tvb_get_guint8 (tvb, offset) & 0x1F;
if(cdata && cdata->itlq){
cdata->itlq->flags=service_action;
}
switch(service_action){
case SERVICE_READ_CAPACITY16:
col_append_str(pinfo->cinfo, COL_INFO, " READCAPACITY16");
if (!tree)
return;
proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN);
offset += 9;
proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 5;
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
offset++;
break;
case SERVICE_READ_LONG16:
col_append_str(pinfo->cinfo, COL_INFO, " READ_LONG16");
if (!tree)
return;
proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item (tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN);
offset+=8;
/* two reserved bytes */
offset+=2;
proto_tree_add_item (tree, hf_scsi_sbc_alloclen16, tvb, offset, 2, ENC_BIG_ENDIAN);
offset+=2;
/* CORRCT bit */
offset++;
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
offset++;
break;
case SERVICE_GET_LBA_STATUS:
col_append_str(pinfo->cinfo, COL_INFO, " GET_LBA_STATUS");
if (!tree)
return;
proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item (tree, hf_scsi_sbc_get_lba_status_lba, tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* reserved */
offset++;
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
offset++;
break;
case SERVICE_REPORT_REFERRALS:
col_append_str(pinfo->cinfo, COL_INFO, " REPORT_REFERRALS");
if (!tree)
return;
proto_tree_add_item (tree, hf_scsi_sbc_service_action, tvb, offset, 1, ENC_BIG_ENDIAN);
offset++;
proto_tree_add_item (tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN);
offset += 8;
proto_tree_add_item (tree, hf_scsi_sbc_alloclen32, tvb, offset, 4, ENC_BIG_ENDIAN);
offset +=4;
/* reserved */
offset++;
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
offset++;
break;
default:
col_append_str(pinfo->cinfo, COL_INFO, " RESERVED");
if (!tree)
return;
proto_tree_add_uint_format_value(tree, hf_scsi_sbc_service_action, tvb, offset, 1, service_action, "Reserved (0x%x)", service_action);
break;
};
} else if (!iscdb) {
if (!tree)
return;
if(cdata && cdata->itlq){
switch(cdata->itlq->flags){
case SERVICE_READ_CAPACITY16:
len = tvb_get_ntoh64 (tvb, offset);
block_len = tvb_get_ntohl (tvb, offset+8);
tot_len=((len/1024)*block_len)/1024; /*MB*/
un="MB";
if(tot_len>20000){
tot_len/=1024;
un="GB";
}
it = proto_tree_add_item (tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN);
proto_item_append_text (it, " (%" PRIu64 " %s)", tot_len, un);
proto_tree_add_item (tree, hf_scsi_sbc_blocksize, tvb, offset+8, 4, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_prot_en, tvb, offset+12, 1, ENC_BIG_ENDIAN);
if (tvb_get_guint8(tvb, offset+12) & 0x01) {
/* only decode the protection type if protection is enabled */
proto_tree_add_item (tree, hf_scsi_sbc_ptype, tvb, offset+12, 1, ENC_BIG_ENDIAN);
}
proto_tree_add_item (tree, hf_scsi_sbc_p_i_exponent, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_lbppbe, tvb, offset+13, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_lbpme, tvb, offset+14, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_lbprz, tvb, offset+14, 1, ENC_BIG_ENDIAN);
proto_tree_add_item (tree, hf_scsi_sbc_lalba, tvb, offset+14, 2, ENC_BIG_ENDIAN);
break;
case SERVICE_GET_LBA_STATUS:
proto_tree_add_item (tree, hf_scsi_sbc_get_lba_status_data_length, tvb, offset, 4, ENC_BIG_ENDIAN);
offset += 4;
/* reserved */
offset += 4;
while (tvb_captured_length_remaining(tvb, offset) >= 16) {
proto_tree *tr;
guint64 lba;
guint32 num_blocks;
guint8 type;
tr = proto_tree_add_subtree(tree, tvb, offset, 16, ett_scsi_lba_status_descriptor, &it, "LBA Status Descriptor: ");
proto_tree_add_item (tr, hf_scsi_sbc_get_lba_status_lba, tvb, offset, 8, ENC_BIG_ENDIAN);
lba = tvb_get_ntoh64(tvb, offset);
offset += 8;
proto_tree_add_item (tr, hf_scsi_sbc_get_lba_status_num_blocks, tvb, offset, 4, ENC_BIG_ENDIAN);
num_blocks = tvb_get_ntohl(tvb, offset);
offset += 4;
proto_tree_add_item (tr, hf_scsi_sbc_get_lba_status_provisioning_status, tvb, offset, 1, ENC_BIG_ENDIAN);
type = tvb_get_guint8(tvb, offset) & 0x07;
offset++;
/* reserved */
offset += 3;
proto_item_append_text (it, "%" PRIu64 "-%" PRIu64 " %s",
lba,
lba + num_blocks - 1,
val_to_str(type, scsi_provisioning_type_val, "Unknown (0x%02x)")
);
}
break;
}
}
}
}
static void
dissect_sbc_serviceactionout16(tvbuff_t *tvb, packet_info *pinfo _U_,
proto_tree *tree, guint offset, gboolean isreq,
gboolean iscdb,
guint payload_len _U_, scsi_task_data_t *cdata _U_)
{
guint8 service_action;
if (isreq && iscdb) {
service_action = tvb_get_guint8 (tvb, offset) & 0x1F;
if(cdata && cdata->itlq){
cdata->itlq->flags=service_action;
}
switch(service_action){
case SERVICE_WRITE_LONG16:
col_append_str(pinfo->cinfo, COL_INFO, " WRITE_LONG16");
if (!tree)
return;
/* Read Long (16) & Write Long (16) share the same service action code, we're looking for Write Long (16) here
We can't lookup from service_action_vals[] as we'll always get Read Long (16) instead */
proto_tree_add_uint_format_value(tree, hf_scsi_sbc_service_action, tvb, offset, 1, service_action, "Write Long (16) (0x%x)", service_action);
offset++;
proto_tree_add_item(tree, hf_scsi_sbc_lba64_address, tvb, offset, 8, ENC_BIG_ENDIAN);
offset+=8;
/* two reserved bytes */
offset+=2;
proto_tree_add_item(tree, hf_scsi_sbc_alloclen16, tvb, offset, 2, ENC_BIG_ENDIAN);
offset+=2;
/* Reserved byte */
offset++;
proto_tree_add_bitmask(tree, tvb, offset, hf_scsi_control,
ett_scsi_control, cdb_control_fields, ENC_BIG_ENDIAN);
offset++;
break;
default:
col_append_str(pinfo->cinfo, COL_INFO, " RESERVED");
if (!tree)
return;
proto_tree_add_uint_format_value(tree, hf_scsi_sbc_service_action, tvb, offset, 1, service_action, "Reserved (0x%x)", service_action);
break;
};
}
}
/* SBC Commands */
static const value_string scsi_sbc_vals[] = {
/* 0x00 */ {SCSI_SPC_TESTUNITRDY , "Test Unit Ready"},
/* 0x03 */ {SCSI_SPC_REQSENSE , "Request Sense"},
/* 0x04 */ {SCSI_SBC_FORMATUNIT , "Format Unit"},
/* 0x07 */ {SCSI_SBC_REASSIGNBLKS , "Reassign Blocks"},
/* 0x08 */ {SCSI_SBC_READ6 , "Read(6)"},
/* 0x0A */ {SCSI_SBC_WRITE6 , "Write(6)"},
/* 0x12 */ {SCSI_SPC_INQUIRY , "Inquiry"},
/* 0x15 */ {SCSI_SPC_MODESELECT6 , "Mode Select(6)"},
/* 0x16 */ {SCSI_SPC_RESERVE6 , "Reserve(6)"}, /* obsolete in SBC2 and later */
/* 0x17 */ {SCSI_SPC_RELEASE6 , "Release(6)"}, /* obsolete in SBC2 and later */
/* 0x1A */ {SCSI_SPC_MODESENSE6 , "Mode Sense(6)"},
/* 0x1B */ {SCSI_SBC_STARTSTOPUNIT , "Start Stop Unit"},
/* 0x1D */ {SCSI_SPC_SENDDIAG , "Send Diagnostic"},
/* 0x1E */ {SCSI_SPC_PREVMEDREMOVAL , "Prevent/Allow Medium Removal"},
/* 0x25 */ {SCSI_SBC_READCAPACITY10 , "Read Capacity(10)"},
/* 0x28 */ {SCSI_SBC_READ10 , "Read(10)"},
/* 0x2A */ {SCSI_SBC_WRITE10 , "Write(10)"},
/* 0x2B */ {SCSI_SBC_SEEK10 , "Seek(10)"},
/* 0x2E */ {SCSI_SBC_WRITENVERIFY10 , "Write & Verify(10)"},
/* 0x2F */ {SCSI_SBC_VERIFY10 , "Verify(10)"},
/* 0x33 */ {SCSI_SBC_SETLIMITS10 , "Set Limits(10)"},
/* 0x34 */ {SCSI_SBC_PREFETCH10 , "Pre-Fetch(10)"},
/* 0x35 */ {SCSI_SBC_SYNCCACHE10 , "Synchronize Cache(10)"},
/* 0x36 */ {SCSI_SBC_LOCKUNLKCACHE10 , "Lock Unlock Cache(10)"},
/* 0x37 */ {SCSI_SBC_READDEFDATA10 , "Read Defect Data(10)"},
/* 0x3B */ {SCSI_SPC_WRITEBUFFER , "Write Buffer"},
/* 0x3E */ {SCSI_SBC_READLONG , "Read Long(10)"},
/* 0x3F */ {SCSI_SBC_WRITELONG , "Write Long"},
/* 0x41 */ {SCSI_SBC_WRITESAME10 , "Write Same(10)"},
/* 0x42 */ {SCSI_SBC_UNMAP , "Unmap"},
/* 0x48 */ {SCSI_SBC_SANITIZE , "Sanitize"},
/* 0x4C */ {SCSI_SPC_LOGSELECT , "Log Select"},
/* 0x4D */ {SCSI_SPC_LOGSENSE , "Log Sense"},
/* 0x50 */ {SCSI_SBC_XDWRITE10 , "XdWrite(10)"},
/* 0x51 */ {SCSI_SBC_XPWRITE10 , "XpWrite(10)"},
/* 0x52 */ {SCSI_SBC_XDREAD10 , "XdRead(10)"},
/* 0x53 */ {SCSI_SBC_XDWRITEREAD10 , "XdWriteRead(10)"},
/* 0x55 */ {SCSI_SPC_MODESELECT10 , "Mode Select(10)"},
/* 0x56 */ {SCSI_SPC_RESERVE10 , "Reserve(10)"},/* obsolete in SBC2 and later */
/* 0x57 */ {SCSI_SPC_RELEASE10 , "Release(10)"},/* obsolete in SBC2 and later */
/* 0x5A */ {SCSI_SPC_MODESENSE10 , "Mode Sense(10)"},
/* 0x5E */ {SCSI_SPC_PERSRESVIN , "Persistent Reserve In"},
/* 0x5F */ {SCSI_SPC_PERSRESVOUT , "Persistent Reserve Out"},
/* 0x7F */ {SCSI_SBC_REBUILD32 , "Rebuild(32)"},
#if 0 /* dups which would never have been found (in the previous unsorted version of this array) */
/* 0x7F */ {SCSI_SBC_REGENERATE32 , "Regenerate(32)"},
/* 0x7F */ {SCSI_SBC_XDREAD32 , "XdRead(32)"},
/* 0x7F */ {SCSI_SBC_XDWRITE32 , "XdWrite(32)"},
/* 0x7F */ {SCSI_SBC_XDWRITEEXTD32 , "XdWrite Extended(32)"},
/* 0x7F */ {SCSI_SBC_XDWRITEREAD32 , "XdWriteRead(32)"},
/* 0x7F */ {SCSI_SBC_XPWRITE32 , "XpWrite(32)"},
#endif
/* 0x80 */ {SCSI_SBC_XDWRITEEXTD16 , "XdWrite Extended(16)"},
/* 0x81 */ {SCSI_SBC_REBUILD16 , "Rebuild(16)"},
/* 0x82 */ {SCSI_SBC_REGENERATE16 , "Regenerate(16)"},
/* 0x83 */ {SCSI_SPC_EXTCOPY , "Extended Copy"},
/* 0x84 */ {SCSI_SPC_RECVCOPY , "Receive Copy"},
/* 0x88 */ {SCSI_SBC_READ16 , "Read(16)"},
/* 0x89 */ {SCSI_SBC_COMPARENWRITE , "Compare & Write(16)"},
/* 0x8A */ {SCSI_SBC_WRITE16 , "Write(16)"},
/* 0x8B */ {SCSI_SBC_ORWRITE , "OrWrite(16)"},
/* 0x8E */ {SCSI_SBC_WRITENVERIFY16 , "Write & Verify(16)"},
/* 0x8F */ {SCSI_SBC_VERIFY16 , "Verify(16)"},
/* 0x90 */ {SCSI_SBC_PREFETCH16 , "Pre-Fetch(16)"},
/* 0x91 */ {SCSI_SBC_SYNCCACHE16 , "Synchronize Cache(16)"},
/* 0x92 */ {SCSI_SBC_LOCKUNLKCACHE16 , "Lock Unlock Cache(16)"},
/* 0x93 */ {SCSI_SBC_WRITESAME16 , "Write Same(16)"},
/* 0x9C */ {SCSI_SBC_WRITEATOMIC16 , "Write Atomic(16)"},
/* 0x9E */ {SCSI_SBC_SERVICEACTIONIN16 , "Service Action In(16)"},
/* 0x9F */ {SCSI_SBC_SERVICEACTIONOUT16, "Service Action Out(16)"},
/* 0xA0 */ {SCSI_SPC_REPORTLUNS , "Report LUNs"},
/* 0xA3 */ {SCSI_SPC_MGMT_PROTOCOL_IN , "Mgmt Protocol In"},
/* 0xA8 */ {SCSI_SBC_READ12 , "Read(12)"},
/* 0xAA */ {SCSI_SBC_WRITE12 , "Write(12)"},
/* 0xAE */ {SCSI_SBC_WRITENVERIFY12 , "Write & Verify(12)"},
/* 0xAF */ {SCSI_SBC_VERIFY12 , "Verify(12)"},
/* 0xB3 */ {SCSI_SBC_SETLIMITS12 , "Set Limits(12)"},
/* 0xB7 */ {SCSI_SBC_READDEFDATA12 , "Read Defect Data(12)"},
{0, NULL}
};
value_string_ext scsi_sbc_vals_ext = VALUE_STRING_EXT_INIT(scsi_sbc_vals);
scsi_cdb_table_t scsi_sbc_table[256] = {
/*SPC 0x00*/{dissect_spc_testunitready},
/*SBC 0x01*/{NULL},
/*SBC 0x02*/{NULL},
/*SPC 0x03*/{dissect_spc_requestsense},
/*SBC 0x04*/{dissect_sbc_formatunit},
/*SBC 0x05*/{NULL},
/*SBC 0x06*/{NULL},
/*SBC 0x07*/{dissect_sbc_reassignblocks},
/*SBC 0x08*/{dissect_sbc_read6},
/*SBC 0x09*/{NULL},
/*SBC 0x0a*/{dissect_sbc_write6},
/*SBC 0x0b*/{NULL},
/*SBC 0x0c*/{NULL},
/*SBC 0x0d*/{NULL},
/*SBC 0x0e*/{NULL},
/*SBC 0x0f*/{NULL},
/*SBC 0x10*/{NULL},
/*SBC 0x11*/{NULL},
/*SPC 0x12*/{dissect_spc_inquiry},
/*SBC 0x13*/{NULL},
/*SBC 0x14*/{NULL},
/*SPC 0x15*/{dissect_spc_modeselect6},
/*SBC 0x16*/{dissect_spc_reserve6}, /* obsolete in SBC2 and later */
/*SBC 0x17*/{dissect_spc_release6}, /* obsolete in SBC2 and later */
/*SBC 0x18*/{NULL},
/*SBC 0x19*/{NULL},
/*SPC 0x1a*/{dissect_spc_modesense6},
/*SBC 0x1b*/{dissect_sbc_startstopunit},
/*SBC 0x1c*/{NULL},
/*SPC 0x1d*/{dissect_spc_senddiagnostic},
/*SBC 0x1e*/{dissect_spc_preventallowmediaremoval},
/*SBC 0x1f*/{NULL},
/*SBC 0x20*/{NULL},
/*SBC 0x21*/{NULL},
/*SBC 0x22*/{NULL},
/*SBC 0x23*/{NULL},
/*SBC 0x24*/{NULL},
/*SBC 0x25*/{dissect_sbc_readcapacity10},
/*SBC 0x26*/{NULL},
/*SBC 0x27*/{NULL},
/*SBC 0x28*/{dissect_sbc_read10},
/*SBC 0x29*/{NULL},
/*SBC 0x2a*/{dissect_sbc_write10},
/*SBC 0x2b*/{NULL},
/*SBC 0x2c*/{NULL},
/*SBC 0x2d*/{NULL},
/*SBC 0x2e*/{dissect_sbc_wrverify10},
/*SBC 0x2f*/{dissect_sbc_verify10},
/*SBC 0x30*/{NULL},
/*SBC 0x31*/{NULL},
/*SBC 0x32*/{NULL},
/*SBC 0x33*/{NULL},
/*SBC 0x34*/{dissect_sbc_prefetch10},
/*SBC 0x35*/{dissect_sbc_synchronizecache10},
/*SBC 0x36*/{NULL},
/*SBC 0x37*/{dissect_sbc_readdefectdata10},
/*SBC 0x38*/{NULL},
/*SBC 0x39*/{NULL},
/*SBC 0x3a*/{NULL},
/*SPC 0x3b*/{dissect_spc_writebuffer},
/*SBC 0x3c*/{NULL},
/*SBC 0x3d*/{NULL},
/*SBC 0x3e*/{dissect_sbc_readlong10},
/*SBC 0x3f*/{dissect_sbc_writelong10},
/*SBC 0x40*/{NULL},
/*SBC 0x41*/{dissect_sbc_writesame10},
/*SBC 0x42*/{dissect_sbc_unmap},
/*SBC 0x43*/{NULL},
/*SBC 0x44*/{NULL},
/*SBC 0x45*/{NULL},
/*SBC 0x46*/{NULL},
/*SBC 0x47*/{NULL},
/*SBC 0x48*/{dissect_sbc_sanitize},
/*SBC 0x49*/{NULL},
/*SBC 0x4a*/{NULL},
/*SBC 0x4b*/{NULL},
/*SPC 0x4c*/{dissect_spc_logselect},
/*SPC 0x4d*/{dissect_spc_logsense},
/*SBC 0x4e*/{NULL},
/*SBC 0x4f*/{NULL},
/*SBC 0x50*/{dissect_sbc_xdwrite10},
/*SBC 0x51*/{dissect_sbc_xpwrite10},
/*SBC 0x52*/{dissect_sbc_xdread10},
/*SBC 0x53*/{dissect_sbc_xdwriteread10},
/*SBC 0x54*/{NULL},
/*SPC 0x55*/{dissect_spc_modeselect10},
/*SPC 0x56*/{dissect_spc_reserve10},/* obsolete in SBC2 and later */
/*SPC 0x57*/{dissect_spc_release10},/* obsolete in SBC2 and later */
/*SBC 0x58*/{NULL},
/*SBC 0x59*/{NULL},
/*SPC 0x5a*/{dissect_spc_modesense10},
/*SBC 0x5b*/{NULL},
/*SBC 0x5c*/{NULL},
/*SBC 0x5d*/{NULL},
/*SPC 0x5e*/{dissect_spc_persistentreservein},
/*SPC 0x5f*/{dissect_spc_persistentreserveout},
/*SBC 0x60*/{NULL},
/*SBC 0x61*/{NULL},
/*SBC 0x62*/{NULL},
/*SBC 0x63*/{NULL},
/*SBC 0x64*/{NULL},
/*SBC 0x65*/{NULL},
/*SBC 0x66*/{NULL},
/*SBC 0x67*/{NULL},
/*SBC 0x68*/{NULL},
/*SBC 0x69*/{NULL},
/*SBC 0x6a*/{NULL},
/*SBC 0x6b*/{NULL},
/*SBC 0x6c*/{NULL},
/*SBC 0x6d*/{NULL},
/*SBC 0x6e*/{NULL},
/*SBC 0x6f*/{NULL},
/*SBC 0x70*/{NULL},
/*SBC 0x71*/{NULL},
/*SBC 0x72*/{NULL},
/*SBC 0x73*/{NULL},
/*SBC 0x74*/{NULL},
/*SBC 0x75*/{NULL},
/*SBC 0x76*/{NULL},
/*SBC 0x77*/{NULL},
/*SBC 0x78*/{NULL},
/*SBC 0x79*/{NULL},
/*SBC 0x7a*/{NULL},
/*SBC 0x7b*/{NULL},
/*SBC 0x7c*/{NULL},
/*SBC 0x7d*/{NULL},
/*SBC 0x7e*/{NULL},
/*SBC 0x7f*/{NULL},
/*SBC 0x80*/{NULL},
/*SBC 0x81*/{NULL},
/*SBC 0x82*/{NULL},
/*SPC 0x83*/{dissect_spc_extcopy},
/*SBC 0x84*/{dissect_spc_recvcopy},
/*SBC 0x85*/{NULL},
/*SBC 0x86*/{NULL},
/*SBC 0x87*/{NULL},
/*SBC 0x88*/{dissect_sbc_read16},
/*SBC 0x89*/{dissect_sbc_comparenwrite},
/*SBC 0x8a*/{dissect_sbc_write16},
/*SBC 0x8b*/{dissect_sbc_orwrite},
/*SBC 0x8c*/{NULL},
/*SBC 0x8d*/{NULL},
/*SBC 0x8e*/{dissect_sbc_wrverify16},
/*SBC 0x8f*/{dissect_sbc_verify16},
/*SBC 0x90*/{dissect_sbc_prefetch16},
/*SBC 0x91*/{dissect_sbc_synchronizecache16},
/*SBC 0x92*/{NULL},
/*SBC 0x93*/{dissect_sbc_writesame16},
/*SBC 0x94*/{NULL},
/*SBC 0x95*/{NULL},
/*SBC 0x96*/{NULL},
/*SBC 0x97*/{NULL},
/*SBC 0x98*/{NULL},
/*SBC 0x99*/{NULL},
/*SBC 0x9a*/{NULL},
/*SBC 0x9b*/{NULL},
/*SBC 0x9c*/{dissect_sbc_writeatomic16},
/*SBC 0x9d*/{NULL},
/*SBC 0x9e*/{dissect_sbc_serviceactionin16},
/*SBC 0x9f*/{dissect_sbc_serviceactionout16},
/*SPC 0xa0*/{dissect_spc_reportluns},
/*SBC 0xa1*/{NULL},
/*SBC 0xa2*/{NULL},
/*SPC 0xa3*/{dissect_spc_mgmt_protocol_in},
/*SBC 0xa4*/{NULL},
/*SBC 0xa5*/{NULL},
/*SBC 0xa6*/{NULL},
/*SBC 0xa7*/{NULL},
/*SBC 0xa8*/{dissect_sbc_read12},
/*SBC 0xa9*/{NULL},
/*SBC 0xaa*/{dissect_sbc_write12},
/*SBC 0xab*/{NULL},
/*SBC 0xac*/{NULL},
/*SBC 0xad*/{NULL},
/*SBC 0xae*/{dissect_sbc_wrverify12},
/*SBC 0xaf*/{dissect_sbc_verify12},
/*SBC 0xb0*/{NULL},
/*SBC 0xb1*/{NULL},
/*SBC 0xb2*/{NULL},
/*SBC 0xb3*/{NULL},
/*SBC 0xb4*/{NULL},
/*SBC 0xb5*/{NULL},
/*SBC 0xb6*/{NULL},
/*SBC 0xb7*/{dissect_sbc_readdefectdata12},
/*SBC 0xb8*/{NULL},
/*SBC 0xb9*/{NULL},
/*SBC 0xba*/{NULL},
/*SBC 0xbb*/{NULL},
/*SBC 0xbc*/{NULL},
/*SBC 0xbd*/{NULL},
/*SBC 0xbe*/{NULL},
/*SBC 0xbf*/{NULL},
/*SBC 0xc0*/{NULL},
/*SBC 0xc1*/{NULL},
/*SBC 0xc2*/{NULL},
/*SBC 0xc3*/{NULL},
/*SBC 0xc4*/{NULL},
/*SBC 0xc5*/{NULL},
/*SBC 0xc6*/{NULL},
/*SBC 0xc7*/{NULL},
/*SBC 0xc8*/{NULL},
/*SBC 0xc9*/{NULL},
/*SBC 0xca*/{NULL},
/*SBC 0xcb*/{NULL},
/*SBC 0xcc*/{NULL},
/*SBC 0xcd*/{NULL},
/*SBC 0xce*/{NULL},
/*SBC 0xcf*/{NULL},
/*SBC 0xd0*/{NULL},
/*SBC 0xd1*/{NULL},
/*SBC 0xd2*/{NULL},
/*SBC 0xd3*/{NULL},
/*SBC 0xd4*/{NULL},
/*SBC 0xd5*/{NULL},
/*SBC 0xd6*/{NULL},
/*SBC 0xd7*/{NULL},
/*SBC 0xd8*/{NULL},
/*SBC 0xd9*/{NULL},
/*SBC 0xda*/{NULL},
/*SBC 0xdb*/{NULL},
/*SBC 0xdc*/{NULL},
/*SBC 0xdd*/{NULL},
/*SBC 0xde*/{NULL},
/*SBC 0xdf*/{NULL},
/*SBC 0xe0*/{NULL},
/*SBC 0xe1*/{NULL},
/*SBC 0xe2*/{NULL},
/*SBC 0xe3*/{NULL},
/*SBC 0xe4*/{NULL},
/*SBC 0xe5*/{NULL},
/*SBC 0xe6*/{NULL},
/*SBC 0xe7*/{NULL},
/*SBC 0xe8*/{NULL},
/*SBC 0xe9*/{NULL},
/*SBC 0xea*/{NULL},
/*SBC 0xeb*/{NULL},
/*SBC 0xec*/{NULL},
/*SBC 0xed*/{NULL},
/*SBC 0xee*/{NULL},
/*SBC 0xef*/{NULL},
/*SBC 0xf0*/{NULL},
/*SBC 0xf1*/{NULL},
/*SBC 0xf2*/{NULL},
/*SBC 0xf3*/{NULL},
/*SBC 0xf4*/{NULL},
/*SBC 0xf5*/{NULL},
/*SBC 0xf6*/{NULL},
/*SBC 0xf7*/{NULL},
/*SBC 0xf8*/{NULL},
/*SBC 0xf9*/{NULL},
/*SBC 0xfa*/{NULL},
/*SBC 0xfb*/{NULL},
/*SBC 0xfc*/{NULL},
/*SBC 0xfd*/{NULL},
/*SBC 0xfe*/{NULL},
/*SBC 0xff*/{NULL}
};
void
proto_register_scsi_sbc(void)
{
static hf_register_info hf[] = {
{ &hf_scsi_sbc_opcode,
{"SBC Opcode", "scsi_sbc.opcode", FT_UINT8, BASE_HEX | BASE_EXT_STRING,
&scsi_sbc_vals_ext, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_service_action,
{"Service Action", "scsi_sbc.sa", FT_UINT8, BASE_HEX,
VALS(service_action_vals), 0x1F, "Unknown", HFILL}},
{ &hf_scsi_sbc_formatunit_flags,
{"Flags", "scsi_sbc.formatunit.flags", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL}},
// TODO: need multiple fields, as appears in different positions in fields lists!
{ &hf_scsi_sbc_defect_list_format,
{"Defect List Format", "scsi_sbc.defect_list_format", FT_UINT8, BASE_DEC,
NULL, 0x07, NULL, HFILL}},
{ &hf_scsi_sbc_formatunit_vendor,
{"Vendor Unique", "scsi_sbc.formatunit.vendor", FT_UINT8, BASE_HEX, NULL,
0x0, NULL, HFILL}},
{ &hf_scsi_sbc_formatunit_interleave,
{"Interleave", "scsi_sbc.formatunit.interleave", FT_UINT16, BASE_HEX,
NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_rdwr6_lba,
{"Logical Block Address (LBA)", "scsi_sbc.rdwr6.lba", FT_UINT24, BASE_DEC,
NULL, 0x0FFFFF, NULL, HFILL}},
{ &hf_scsi_sbc_rdwr6_xferlen,
{"Transfer Length", "scsi_sbc.rdwr6.xferlen", FT_UINT24, BASE_DEC, NULL, 0x0,
NULL, HFILL}},
{ &hf_scsi_sbc_rdwr10_lba,
{"Logical Block Address (LBA)", "scsi_sbc.rdwr10.lba", FT_UINT32, BASE_DEC,
NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_rdwr10_xferlen,
{"Transfer Length", "scsi_sbc.rdwr10.xferlen", FT_UINT16, BASE_DEC, NULL,
0x0, NULL, HFILL}},
{ &hf_scsi_sbc_rdwr12_xferlen,
{"Transfer Length", "scsi_sbc.rdwr12.xferlen", FT_UINT32, BASE_DEC, NULL,
0x0, NULL, HFILL}},
{ &hf_scsi_sbc_rdwr16_lba,
{"Logical Block Address (LBA)", "scsi_sbc.rdwr16.lba", FT_BYTES, BASE_NONE,
NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_ssu_immed,
{"Immediate", "scsi_sbc.ssu.immediate", FT_BOOLEAN, 8, NULL,
0x01, NULL, HFILL}},
{ &hf_scsi_sbc_ssu_pwr_cond,
{"Power Conditions", "scsi_sbc.ssu.pwr", FT_UINT8, BASE_HEX,
VALS (scsi_ssu_pwrcnd_val), 0xF0, NULL, HFILL}},
{ &hf_scsi_sbc_ssu_loej,
{"LOEJ", "scsi_sbc.ssu.loej", FT_BOOLEAN, 8, NULL, 0x2, NULL,
HFILL}},
{ &hf_scsi_sbc_ssu_start,
{"Start", "scsi_sbc.ssu.start", FT_BOOLEAN, 8, NULL, 0x1,
NULL, HFILL}},
{ &hf_scsi_sbc_bytchk,
{"BYTCHK", "scsi_sbc.bytchk", FT_BOOLEAN, 8,
NULL, 0x02, NULL, HFILL}},
#if 0
{ &hf_scsi_sbc_verify_reladdr,
{"RELADDR", "scsi_sbc.verify.reladdr", FT_BOOLEAN, 8, NULL,
0x1, NULL, HFILL}},
#endif
{ &hf_scsi_sbc_verify_lba,
{"LBA", "scsi_sbc.verify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_verify_lba64,
{"LBA", "scsi_sbc.verify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_verify_vlen,
{"Verification Length", "scsi_sbc.verify.vlen", FT_UINT16,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_verify_vlen32,
{"Verification Length", "scsi_sbc.verify.vlen32", FT_UINT32,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_wrverify_lba,
{"LBA", "scsi_sbc.wrverify.lba", FT_UINT32, BASE_DEC, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_wrverify_xferlen,
{"Transfer Length", "scsi_sbc.wrverify.xferlen", FT_UINT16, BASE_DEC,
NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_wrverify_lba64,
{"LBA", "scsi_sbc.wrverify.lba64", FT_UINT64, BASE_DEC, NULL, 0x0,
NULL, HFILL}},
{ &hf_scsi_sbc_wrverify_xferlen32,
{"Transfer Length", "scsi_sbc.wrverify.xferlen32", FT_UINT32,
BASE_DEC, NULL, 0x0, NULL, HFILL}},
#if 0
{ &hf_scsi_sbc_readcapacity_flags,
{"Flags", "scsi_sbc.readcapacity.flags", FT_UINT8, BASE_HEX, NULL, 0x0,
NULL, HFILL}},
#endif
{ &hf_scsi_sbc_readdefdata_flags,
{"Flags", "scsi_sbc.readdefdata.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_reassignblks_flags,
{"Flags", "scsi_sbc.reassignblks.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_read_flags,
{"Flags", "scsi_sbc.read.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_alloclen32,
{"Allocation Length", "scsi_sbc.alloclen32", FT_UINT32, BASE_DEC,
NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_alloclen16,
{"Allocation Length", "scsi_sbc.alloclen16", FT_UINT16, BASE_DEC,
NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_lba64_address,
{"Logical Block Address", "scsi_sbc.lba64_add", FT_UINT64, BASE_DEC,
NULL, 0x0, NULL, HFILL}},
{ &hf_scsi_sbc_fuflags_fmtpinfo,
{"FMTPINFO", "scsi_sbc.format_unit.fmtpinfo", FT_BOOLEAN, 8,
NULL, 0x80, NULL, HFILL}},
{ &hf_scsi_sbc_fuflags_rto_req,
{"RTO_REQ", "scsi_sbc.format_unit.rto_req", FT_BOOLEAN, 8,
NULL, 0x40, NULL, HFILL}},
{ &hf_scsi_sbc_fuflags_longlist,
{"LONGLIST", "scsi_sbc.format_unit.longlist", FT_BOOLEAN, 8,
NULL, 0x20, NULL, HFILL}},
{ &hf_scsi_sbc_fuflags_fmtdata,
{"FMTDATA", "scsi_sbc.format_unit.fmtdata", FT_BOOLEAN, 8,
NULL, 0x10, NULL, HFILL}},
{ &hf_scsi_sbc_fuflags_cmplist,
{"CMPLIST", "scsi_sbc.format_unit.cmplist", FT_BOOLEAN, 8,
NULL, 0x08, NULL, HFILL}},
{ &hf_scsi_sbc_prefetch_flags,
{"Flags", "scsi_sbc.prefetch.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_prefetch_immed,
{"Immediate", "scsi_sbc.prefetch.immediate", FT_BOOLEAN, 8, NULL,
0x2, NULL, HFILL}},
{ &hf_scsi_sbc_group,
{"Group", "scsi_sbc.group", FT_UINT8, BASE_HEX, NULL,
0x1f, NULL, HFILL}},
{ &hf_scsi_sbc_rdprotect,
{"RDPROTECT", "scsi_sbc.rdprotect", FT_UINT8, BASE_HEX,
NULL, 0xe0, NULL, HFILL}},
{ &hf_scsi_sbc_dpo,
{"DPO", "scsi_sbc.dpo", FT_BOOLEAN, 8,
TFS(&dpo_tfs), 0x10, "DisablePageOut: Whether the device should cache the data or not", HFILL}},
{ &hf_scsi_sbc_fua,
{"FUA", "scsi_sbc.fua", FT_BOOLEAN, 8,
TFS(&fua_tfs), 0x08, "ForceUnitAccess: Whether to allow reading from the cache or not", HFILL}},
{ &hf_scsi_sbc_fua_nv,
{"FUA_NV", "scsi_sbc.fua_nv", FT_BOOLEAN, 8,
TFS(&fua_nv_tfs), 0x02, "ForceUnitAccess_NonVolatile: Whether to allow reading from non-volatile cache or not", HFILL}},
{ &hf_scsi_sbc_blocksize,
{"Block size in bytes", "scsi_sbc.blocksize", FT_UINT32, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_returned_lba,
{"Returned LBA", "scsi_sbc.returned_lba", FT_UINT32, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_req_plist,
{"REQ_PLIST", "scsi_sbc.req_plist", FT_BOOLEAN, 8,
NULL, 0x10, NULL, HFILL}},
{ &hf_scsi_sbc_req_glist,
{"REQ_GLIST", "scsi_sbc.req_glist", FT_BOOLEAN, 8,
NULL, 0x08, NULL, HFILL}},
{ &hf_scsi_sbc_corrct,
{"CORRCT", "scsi_sbc.corrct", FT_BOOLEAN, 8,
NULL, 0x02, NULL, HFILL}},
{ &hf_scsi_sbc_corrct_flags,
{"Flags", "scsi_sbc.corrct_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_reassignblocks_longlba,
{"LongLBA", "scsi_sbc.reassignblocks.longlba", FT_BOOLEAN, 8,
NULL, 0x02, NULL, HFILL}},
{ &hf_scsi_sbc_reassignblocks_longlist,
{"LongList", "scsi_sbc.reassignblocks.longlist", FT_BOOLEAN, 8,
NULL, 0x01, NULL, HFILL}},
{ &hf_scsi_sbc_ssu_immed_flags,
{"Immed flags", "scsi_sbc.ssu.immed_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_ssu_pwr_flags,
{"Pwr flags", "scsi_sbc.ssu.pwr_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_synccache_flags,
{"Flags", "scsi_sbc.synccache.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_synccache_immed,
{"Immediate", "scsi_sbc.synccache.immediate", FT_BOOLEAN, 8, NULL,
0x02, NULL, HFILL}},
{ &hf_scsi_sbc_synccache_sync_nv,
{"SYNC_NV", "scsi_sbc.synccache.sync_nv", FT_BOOLEAN, 8, NULL,
0x04, NULL, HFILL}},
{ &hf_scsi_sbc_vrprotect,
{"VRPROTECT", "scsi_sbc.vrprotect", FT_UINT8, BASE_HEX,
NULL, 0xe0, NULL, HFILL}},
{ &hf_scsi_sbc_verify_flags,
{"Flags", "scsi_sbc.verify_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_wrprotect,
{"WRPROTECT", "scsi_sbc.wrprotect", FT_UINT8, BASE_HEX,
NULL, 0xe0, NULL, HFILL}},
{ &hf_scsi_sbc_wrverify_flags,
{"Flags", "scsi_sbc.wrverify_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_writesame_flags,
{"Flags", "scsi_sbc.writesame_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_anchor,
{"ANCHOR", "scsi_sbc.anchor", FT_BOOLEAN, 8, NULL,
0x10, NULL, HFILL}},
{ &hf_scsi_sbc_unmap,
{"UNMAP", "scsi_sbc.unmap", FT_BOOLEAN, 8, NULL,
0x08, NULL, HFILL}},
{ &hf_scsi_sbc_pbdata,
{"PBDATA", "scsi_sbc.pbdata", FT_BOOLEAN, 8, NULL,
0x04, NULL, HFILL}},
{ &hf_scsi_sbc_lbdata,
{"LBDATA", "scsi_sbc.lbdata", FT_BOOLEAN, 8, NULL,
0x02, NULL, HFILL}},
{ &hf_scsi_sbc_xdread_flags,
{"Flags", "scsi_sbc.xdread.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_xorpinfo,
{"XORPINFO", "scsi_sbc.xorpinfo", FT_BOOLEAN, 8, NULL,
0x01, NULL, HFILL}},
{ &hf_scsi_sbc_disable_write,
{"DISABLE_WRITE", "scsi_sbc.disable_write", FT_BOOLEAN, 8, NULL,
0x04, NULL, HFILL}},
{ &hf_scsi_sbc_xdwrite_flags,
{"Flags", "scsi_sbc.xdwrite.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_xdwriteread_flags,
{"Flags", "scsi_sbc.xdwriteread.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_xpwrite_flags,
{"Flags", "scsi_sbc.xpwrite.flags", FT_UINT8, BASE_HEX, NULL, 0x0, NULL,
HFILL}},
{ &hf_scsi_sbc_unmap_anchor,
{"ANCHOR", "scsi_sbc.unmap.anchor", FT_BOOLEAN, 8, NULL,
0x01, NULL, HFILL}},
{ &hf_scsi_sbc_unmap_flags,
{"Flags", "scsi_sbc.unmap_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_unmap_data_length,
{"Data Length", "scsi_sbc.unmap.data_length", FT_UINT16, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_unmap_block_descriptor_data_length,
{"Block Descriptor Data Length", "scsi_sbc.unmap.block_descriptor_data_length", FT_UINT16, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_unmap_lba,
{"LBA", "scsi_sbc.unmap.lba", FT_UINT64, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_unmap_num_blocks,
{"Num Blocks", "scsi_sbc.unmap.num_blocks", FT_UINT32, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_ptype,
{"PTYPE", "scsi_sbc.ptype", FT_UINT8, BASE_DEC,
VALS(scsi_ptype_val), 0x0e, NULL, HFILL}},
{ &hf_scsi_sbc_prot_en,
{"PROT_EN", "scsi_sbc.prot_en", FT_BOOLEAN, 8,
NULL, 0x01, NULL, HFILL}},
{ &hf_scsi_sbc_p_i_exponent,
{"P_I_EXPONENT", "scsi_sbc.p_i_exponent", FT_UINT8, BASE_DEC,
NULL, 0xf0, NULL, HFILL}},
{ &hf_scsi_sbc_lbppbe,
{"LOGICAL_BLOCKS_PER_PHYSICAL_BLOCK_EXPONENT", "scsi_sbc.lbppbe", FT_UINT8, BASE_DEC,
NULL, 0x0f, NULL, HFILL}},
{ &hf_scsi_sbc_lbpme,
{"LBPME (logical block provisioning management enabled) / TPE", "scsi_sbc.lbpme", FT_BOOLEAN, 8,
NULL, 0x80, NULL, HFILL}},
{ &hf_scsi_sbc_lbprz,
{"LBPRZ (logical block provisioning read zeros) / TPRZ", "scsi_sbc.lbprz", FT_BOOLEAN, 8,
NULL, 0x40, NULL, HFILL}},
{ &hf_scsi_sbc_lalba,
{"LOWEST_ALIGNED_LBA", "scsi_sbc.lalba", FT_UINT16, BASE_DEC,
NULL, 0x3fff, NULL, HFILL}},
{ &hf_scsi_sbc_get_lba_status_lba,
{"LBA", "scsi_sbc.get_lba_status.start_lba", FT_UINT64, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_get_lba_status_data_length,
{"Data Length", "scsi_sbc.get_lba_status.data_length", FT_UINT32, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_get_lba_status_num_blocks,
{"Num Blocks", "scsi_sbc.get_lba_status.num_blocks", FT_UINT32, BASE_DEC,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_get_lba_status_provisioning_status,
{"Provisioning Type", "scsi_sbc.get_lba_status.provisioning_type", FT_UINT8, BASE_DEC,
VALS(scsi_provisioning_type_val), 0x07, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_sa,
{"Service Action", "scsi_sbc.sanitize.sa", FT_UINT8, BASE_HEX,
VALS(sanitize_val), 0x1f, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_ause,
{"AUSE", "scsi_sbc.sanitize.ause", FT_BOOLEAN, 8, NULL,
0x20, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_immed,
{"IMMED", "scsi_sbc.sanitize.immed", FT_BOOLEAN, 8, NULL,
0x80, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_flags,
{"Flags", "scsi_sbc.sanitize_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_overwrite_flags,
{"Flags", "scsi_sbc.sanitize_overwrite_flags", FT_UINT8, BASE_HEX,
NULL, 0, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_invert,
{"INVERT", "scsi_sbc.sanitize.invert", FT_BOOLEAN, 8, NULL,
0x80, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_test,
{"TEST", "scsi_sbc.sanitize.test", FT_UINT8, BASE_HEX, NULL,
0x60, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_owcount,
{"Overwrite Count", "scsi_sbc.sanitize.overwrite_count", FT_UINT8, BASE_DEC_HEX, NULL,
0x1f, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_pattern_length,
{"Initialization Pattern Length", "scsi_sbc.sanitize.pattern_length", FT_UINT16, BASE_DEC, NULL,
0, NULL, HFILL}},
{ &hf_scsi_sbc_sanitize_pattern,
{"Initialization Pattern", "scsi_sbc.sanitize.pattern", FT_BYTES, BASE_NONE, NULL,
0, NULL, HFILL}},
};
/* Setup protocol subtree array */
static gint *ett[] = {
&ett_scsi_format_unit,
&ett_scsi_prefetch,
&ett_scsi_rdwr,
&ett_scsi_xdread,
&ett_scsi_xdwrite,
&ett_scsi_xdwriteread,
&ett_scsi_xpwrite,
&ett_scsi_defectdata,
&ett_scsi_corrct,
&ett_scsi_reassign_blocks,
&ett_scsi_ssu_immed,
&ett_scsi_ssu_pwr,
&ett_scsi_synccache,
&ett_scsi_verify,
&ett_scsi_wrverify,
&ett_scsi_writesame,
&ett_scsi_unmap,
&ett_scsi_unmap_block_descriptor,
&ett_scsi_lba_status_descriptor,
&ett_scsi_sanitize,
&ett_scsi_sanitize_overwrite
};
/* Register the protocol name and description */
proto_scsi_sbc = proto_register_protocol("SCSI_SBC", "SCSI_SBC", "scsi_sbc");
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_scsi_sbc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
}
/*
* Editor modelines - https://www.wireshark.org/tools/modelines.html
*
* Local variables:
* c-basic-offset: 4
* tab-width: 8
* indent-tabs-mode: nil
* End:
*
* vi: set shiftwidth=4 tabstop=8 expandtab:
* :indentSize=4:tabSize=8:noTabs=true:
*/
|