aboutsummaryrefslogtreecommitdiffstats
path: root/packet-scsi.c
AgeCommit message (Collapse)AuthorFilesLines
2004-06-11fix the presentation of readcapacity to show the real number of MB or GB ↵sahlberg1-5/+13
instead of just a random fake value. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@11137 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-24Have two strings in an enum_val_t - one that's a short string that isguy1-4/+4
convenient to put into a command line (no capital letters, no spaces to require quotes), and one that's a detailed description for use in the UI. Allow either of them in the preferences file or "-o" option; use the detailed description in the UI, and also use it when writing the preferences out, so that the preference will be readable by older versions of Ethereal (assuming the preference existed in that version). Update "README.developer" to give more detail about an enum_val_t (and to put the _t in), and to give a more detailed description of the "radio_buttons" argument to "prefs_register_enum_preference()". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10982 f5534014-38df-0310-8fa8-9805f1628bb7
2004-05-13From Dinesh Dutt: Mode Sense (10) and Mode Select (10) bugfixes.gerald1-5/+5
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@10880 f5534014-38df-0310-8fa8-9805f1628bb7
2003-12-17removed some more MSVC warnings (type casting)ulfl1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@9332 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-28"%.*" expects an "int" argument giving the precision.guy1-2/+3
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8801 f5534014-38df-0310-8fa8-9805f1628bb7
2003-10-28From Dinesh Dutt:guy1-6/+191
Add dissection code for the following additional SCSI commands: - Start/Stop Unit - Write Buffer - Send Diagnostics Don't copy the product serial number to a buffer before printing it. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8795 f5534014-38df-0310-8fa8-9805f1628bb7
2003-09-03Don't include <epan/conversation.h> if you don't need it.guy1-2/+2
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@8361 f5534014-38df-0310-8fa8-9805f1628bb7
2003-07-09Replace "hf_scsi_log_pc" with separate "hf_scsi_logsel_pc" andguy1-39/+73
"hf_scsi_logsns_pc" fields, with the latter using "scsi_logsns_pc_val[]" as its value_string table (the names are different). Rename "scsi_modesense_medtype_val[]" to "scsi_modesense_medtype_sbc_val[]", as it's specific to block devices; add in additional information from a SCSI-3 Block Commands draft, and have "dissect_scsi_modeselect6()" and "dissect_scsi_modeselect10()" use it if the device is a block device. Get rid of "scsi_inq_evpd_val[]", as it's not used and is redundant (we already have "scsi_evpd_pagecode_val[]". Add the Implemented operating definition page to the latter table. Fix up a "val_to_str()" call to include a format string in the "if unknown" format, so the value is shown. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7995 f5534014-38df-0310-8fa8-9805f1628bb7
2003-05-26Strings in SCSI replies are blank-padded or possibly null-padded;guy1-8/+12
they're not null-terminated. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7745 f5534014-38df-0310-8fa8-9805f1628bb7
2003-05-19More tvb_get_nstringz0() fixes. Timo Sirainen pointed out that Badgerald1-3/+5
Things can happen if we pass a zero buffer length to tvb_get_nstringz0(). Throw an exception if this happens. In various dissectors make sure the tvb_get_nstringz0()'s buffer length is greater than zero. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7688 f5534014-38df-0310-8fa8-9805f1628bb7
2003-04-30Modify tvb_get_nstringz*() to behave more like snprintf(). Make changesgerald1-6/+5
where necessary to reflect the new behavior. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7607 f5534014-38df-0310-8fa8-9805f1628bb7
2003-04-16When processing the device identification page of vital product data,guy1-23/+64
check, for each item, when it's past the end of the page before putting it into the protocol tree, and advance the offset through the page as we do so. If the identifier codeset is ASCII, display the item as text rather than as binary data. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7473 f5534014-38df-0310-8fa8-9805f1628bb7
2003-03-10Use SCSI_DEV_BITS for the bits in the peripheral qualifier/peripheralguy1-2/+2
device type byte used for the device type. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7332 f5534014-38df-0310-8fa8-9805f1628bb7
2003-03-08Treat the Peripheral Qualifier field the same way we treat theguy1-19/+30
Peripheral Device Type field, i.e. as a registered field that's a bitfield with a value_string table. Give it the correct bitmask. Fix up some device type names, and add some additional ones from the 25 July 2002 SPC-3 draft. Correctly adjust the length of the LUN list in the Report LUNs response (subtract 8 from the payload length before comparing, don't subtract 8 from the resulting length after comparing and adjusting), and rename the variable to reflect the fact that it's a length in bytes, not a number of LUNs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7322 f5534014-38df-0310-8fa8-9805f1628bb7
2003-03-05Make various variables containing unsigned quantities unsigned.guy1-5/+11
Check whether a device identifier in a vital product data page (not a vital data product page, although I guess most SCSI devices could be considered data products) is bigger than the page before displaying it. Don't bother to check whether the full identifier is in the packet - if it's not, an exception will be thrown and an error indication put into the protocol tree, which is the correct thing to do. Do, however, check whether the identifier length is 0 before putting a protocol tree entry in. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7290 f5534014-38df-0310-8fa8-9805f1628bb7
2003-03-05From Dinesh Dutt:guy1-14/+35
fix the Fibre Channel reassembly code; fix handling of addresses in FC frames encapsulated inside various internal Cisco protocols; display link state records & descriptors better so as to improve readability & reduce the need to expand tree to find useful information; handle older versions of SW_RSCN; fix saving of device type from Inquiry command; add another Ethertype used internally in Cisco switches. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7283 f5534014-38df-0310-8fa8-9805f1628bb7
2003-01-31Get rid of BASE_BIN - it's just the same as BASE_DEC, but people seemedguy1-15/+15
to be using it for stuff that should be hex, and for stuff that should be Boolean. Use BASE_DEC if it should be decimal, BASE_HEX if it should be hex, and make it Boolean if it should be Boolean. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@7053 f5534014-38df-0310-8fa8-9805f1628bb7
2002-12-02Don't cast away constness, and fix variable and structure memberguy1-7/+7
qualifiers as necessary to ensure that we don't have to. "strcmp()", "strcasecmp()", and "memcmp()" don't return booleans; don't test their results as if they did. Use "guint8", not "guchar", for a pointer to (one or more) 8-bit bytes. Update Michael Tuexen's e-mail address. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6726 f5534014-38df-0310-8fa8-9805f1628bb7
2002-10-08From Senthil Kumar Nagappan: fix a "proto_tree_add_uint()" call that wasguy1-2/+2
supposed to be a "proto_tree_add_item()" call. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6382 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-28Removed trailing whitespaces from .h and .c files using thejmayer1-84/+84
winapi_cleanup tool written by Patrik Stridvall for the wine project. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6117 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-21Put the volume identification in quotes, so it doesn't look stupid whenguy1-2/+2
it's empty. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6046 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-21Display volume tags as per SMC-2.guy1-7/+28
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6045 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-21Handle Read Block Position replies.guy1-25/+191
Display the additional sense code+qualifier in an element in Read Element Status symbolically. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6043 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-21Handle mode pages differently depending on the type of device (some modeguy1-180/+1187
page codes are used in different ways in different devices, e.g. 0x10). Handle commands and mode pages for media changer devices (and move some commands from the "sequential device" category to the "media changer" category, where SSC-2 and SMC-2 put them). Add some missing SPC commands (not present in SPC-2). Handle some additional SSC-2 commands. Fix some other bugs. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6042 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-20Have "dissect_scsi_cdb()" take an argument that's a SCSI device type,guy1-47/+74
for the benefit of dissectors such as the NDMP dissector that can at least supply a reasonable guess for the device type; more than one type of device can be opened on the same host over NDMP, so the scheme currently used by the SCSI dissector to remember device types in INQUIRY replies won't work. Have the iSCSI dissector supply SCSI_DEV_UNKNOWN, and have the NDMP dissector supply SCSI_DEV_SMC for NDMP_SCSI_EXECUTE_CDB (under the assumption that it's operating on a media changer) and supply SCSI_DEV_SSC for NDMP_TAPE_EXECUTE_CDB (under the assumption that it's operating on a tape device). Fix memory leaks in the SCSI dissector. Fix the dissectors for the SSC READ(6) and WRITE(6) CDBs to dissect the transfer length as a 24-bit quantity. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6035 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-20Regularize the format of the "(size)" tags - the SCSI specs appear notguy1-219/+411
to put a space between the command name and the tag, and we weren't doing that for all tags, so let's just get rid of the space. Keep track of the device type and command type separately for commands. Remember device types when we see an INQUIRY *response*, not a request, and save the device type bits, rather than saving some random bit from the INQUIRY *request* as the device type. This means we have to dissect the INQUIRY response payload even if we're not building a protocol tree; do so. Put in a comment noting that the source and destination address are not sufficient as a key to use for the device type, as a given network-layer entity may have more than one SCSI device (and connections aren't good enough, either). Put the code to dissect MODE SELECT and MODE SENSE block descriptors into a common routine. Have that routine dissect more than one block descriptor. Have it take the device type and the "long LBA" flag as arguments, so that it can correctly dissect the block descriptors. Handle READ(6) and WRITE(6) on sequential devices. Get rid of "dissect_scsi()" - it's not used. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6032 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-19Fix the reporting of the "PS" bit in SCSI mode pages.guy1-90/+259
For unknown mode pages, make the "Unknown Page" tree item not include the page code and length, as those were put into the tree already - have it just include the contents of the page. For MODE SELECT, use the supplied payload length rather than the mode data length, as the mode data length is reserved in MODE SELECT (it's implied by the total data length; in MODE SENSE, the CDB contains the buffer size, but the target can return fewer bytes than that, so the mode data length is meaningful). Add additional checks of the remaining data length when parsing MODE SELECT and MODE SENSE, and fix up the checks that were there already. The density code comes *before* the number of blocks in a block descriptor, and the number of blocks and block length are 3 bytes long for both the 6-byte and 10-byte versions of MODE SELECT and MODE SENSE. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6019 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-18From Bill Studenmund: fix handling of SCSI mode sense.guy1-4/+7
Fix Yasuhiro Shirasaki's e-mail address, and [AT]ify Vassilii Khachaturov's address. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@6014 f5534014-38df-0310-8fa8-9805f1628bb7
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hjmayer1-5/+1
equivalents for the toplevel directory. The removal of winsock2.h will hopefully not cause any problems under MSVC++, as those files using struct timeval still include wtap.h, which still includes winsock2.h. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-06-13From Peter Hawkins: make the maximum length argument toguy1-3/+3
"tvb_get_nstringz0()" no larger than the space in "str" (not counting the space for the trailing '\0'). Make "str" big enough to hold a maximum-length serial number string (the length is 1 byte, hence the maximum length is 256 bytes plus 1 byte of terminating '\0'). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5665 f5534014-38df-0310-8fa8-9805f1628bb7
2002-04-14From Joerg Mayer:guy1-2/+2
Declares some variables static. Creates a new include file packet-rsvp.h, and make use of it (change some extern decls to #inlcude). Move the file packet-pgm.h into packet-pgm.c as it is not used by anything outside packet-pgm.c. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5162 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-31From Dinesh Dutt: get rid of unused variables, and fix a bug in the wayguy1-90/+90
the device type is determined (create the hash entry regardless of whether a protocol tree is being built). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@5048 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-13Give the "prevent/allow medium removal" command the right name (it'sguy1-2/+2
"prevent/allow", not "prevent allow"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4933 f5534014-38df-0310-8fa8-9805f1628bb7
2002-03-12From Dinesh Dutt: initial dissection of a variable-length CDB.guy1-1/+32
git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4932 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-13Have the private data for the SCSI dissection routines be a pointer to aguy1-24/+27
structure containing a 32-bit conversation ID (which uniquely identifies conversations between a SCSI initiator and target) and a 32-bit task ID (which uniquely identifies a task within that conversation). Have the NDMP dissector create conversations when it sees an "execute CDB" request, and use the conversation index as the conversation ID and the sequence number for requests and reply sequence for replies as the task ID. Have it use "dissect_scsi_payload()" to dissect the payload of "execute CDB" requests and replies. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4726 f5534014-38df-0310-8fa8-9805f1628bb7
2002-02-12Move all the stuff in "packet-scsi.h" that's solely for the use ofguy1-1/+926
"packet-scsi.c" into "packet-scsi.c"; the iSCSI dissector doesn't need its own versions of a pile of static data structures used only by "packet-scsi.c", nor does it need a pile of typedefs and #defines used only by "packet-scsi.c". The iSCSI dissector *does* use "scsi_status_val", so make that non-static, and export it from "packet-scsi.h". git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4724 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-21Include files from the "epan" directory and subdirectories thereof withguy1-3/+3
"epan/..." pathnames, so as to avoid collisions with header files in any of the directories in which we look (e.g., "proto.h", as some other package has its own "proto.h" file which it installs in the top-level include directory). Don't add "-I" flags to search "epan", as that's no longer necessary (and we want includes of "epan" headers to fail if the "epan/" is left out, so that we don't re-introduce includes lacking "epan/"). git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4586 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-16From Mark Burton: reinstate data segment digest handling, and stop theguy1-4/+4
SCSI dissector from treating data digests as payload. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4552 f5534014-38df-0310-8fa8-9805f1628bb7
2002-01-10SCSI dissector, and changes to make the iSCSI dissector use it, fromguy1-0/+2485
Dinesh Dutt. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@4508 f5534014-38df-0310-8fa8-9805f1628bb7