aboutsummaryrefslogtreecommitdiffstats
path: root/packet-scsi.c
AgeCommit message (Collapse)AuthorFilesLines
2003-12-17removed some more MSVC warnings (type casting)Ulf Lamping1-2/+2
svn path=/trunk/; revision=9332
2003-10-28"%.*" expects an "int" argument giving the precision.Guy Harris1-2/+3
svn path=/trunk/; revision=8801
2003-10-28From Dinesh Dutt:Guy Harris1-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. svn path=/trunk/; revision=8795
2003-09-03Don't include <epan/conversation.h> if you don't need it.Guy Harris1-2/+2
svn path=/trunk/; revision=8361
2003-07-09Replace "hf_scsi_log_pc" with separate "hf_scsi_logsel_pc" andGuy Harris1-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. svn path=/trunk/; revision=7995
2003-05-26Strings in SCSI replies are blank-padded or possibly null-padded;Guy Harris1-8/+12
they're not null-terminated. svn path=/trunk/; revision=7745
2003-05-19More tvb_get_nstringz0() fixes. Timo Sirainen pointed out that BadGerald Combs1-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. svn path=/trunk/; revision=7688
2003-04-30Modify tvb_get_nstringz*() to behave more like snprintf(). Make changesGerald Combs1-6/+5
where necessary to reflect the new behavior. svn path=/trunk/; revision=7607
2003-04-16When processing the device identification page of vital product data,Guy Harris1-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. svn path=/trunk/; revision=7473
2003-03-10Use SCSI_DEV_BITS for the bits in the peripheral qualifier/peripheralGuy Harris1-2/+2
device type byte used for the device type. svn path=/trunk/; revision=7332
2003-03-08Treat the Peripheral Qualifier field the same way we treat theGuy Harris1-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. svn path=/trunk/; revision=7322
2003-03-05Make various variables containing unsigned quantities unsigned.Guy Harris1-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. svn path=/trunk/; revision=7290
2003-03-05From Dinesh Dutt:Guy Harris1-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. svn path=/trunk/; revision=7283
2003-01-31Get rid of BASE_BIN - it's just the same as BASE_DEC, but people seemedGuy Harris1-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. svn path=/trunk/; revision=7053
2002-12-02Don't cast away constness, and fix variable and structure memberGuy Harris1-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. svn path=/trunk/; revision=6726
2002-10-08From Senthil Kumar Nagappan: fix a "proto_tree_add_uint()" call that wasGuy Harris1-2/+2
supposed to be a "proto_tree_add_item()" call. svn path=/trunk/; revision=6382
2002-08-28Removed trailing whitespaces from .h and .c files using theJörg Mayer1-84/+84
winapi_cleanup tool written by Patrik Stridvall for the wine project. svn path=/trunk/; revision=6117
2002-08-21Put the volume identification in quotes, so it doesn't look stupid whenGuy Harris1-2/+2
it's empty. svn path=/trunk/; revision=6046
2002-08-21Display volume tags as per SMC-2.Guy Harris1-7/+28
svn path=/trunk/; revision=6045
2002-08-21Handle Read Block Position replies.Guy Harris1-25/+191
Display the additional sense code+qualifier in an element in Read Element Status symbolically. svn path=/trunk/; revision=6043
2002-08-21Handle mode pages differently depending on the type of device (some modeGuy Harris1-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. svn path=/trunk/; revision=6042
2002-08-20Have "dissect_scsi_cdb()" take an argument that's a SCSI device type,Guy Harris1-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. svn path=/trunk/; revision=6035
2002-08-20Regularize the format of the "(size)" tags - the SCSI specs appear notGuy Harris1-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. svn path=/trunk/; revision=6032
2002-08-19Fix the reporting of the "PS" bit in SCSI mode pages.Guy Harris1-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. svn path=/trunk/; revision=6019
2002-08-18From Bill Studenmund: fix handling of SCSI mode sense.Guy Harris1-4/+7
Fix Yasuhiro Shirasaki's e-mail address, and [AT]ify Vassilii Khachaturov's address. svn path=/trunk/; revision=6014
2002-08-02Replace the types from sys/types.h and netinet/in.h by their glib.hJörg Mayer1-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. svn path=/trunk/; revision=5932
2002-06-13From Peter Hawkins: make the maximum length argument toGuy Harris1-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'). svn path=/trunk/; revision=5665
2002-04-14From Joerg Mayer:Guy Harris1-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. svn path=/trunk/; revision=5162
2002-03-31From Dinesh Dutt: get rid of unused variables, and fix a bug in the wayGuy Harris1-90/+90
the device type is determined (create the hash entry regardless of whether a protocol tree is being built). svn path=/trunk/; revision=5048
2002-03-13Give the "prevent/allow medium removal" command the right name (it'sGuy Harris1-2/+2
"prevent/allow", not "prevent allow"). svn path=/trunk/; revision=4933
2002-03-12From Dinesh Dutt: initial dissection of a variable-length CDB.Guy Harris1-1/+32
svn path=/trunk/; revision=4932
2002-02-13Have the private data for the SCSI dissection routines be a pointer to aGuy Harris1-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. svn path=/trunk/; revision=4726
2002-02-12Move all the stuff in "packet-scsi.h" that's solely for the use ofGuy Harris1-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". svn path=/trunk/; revision=4724
2002-01-21Include files from the "epan" directory and subdirectories thereof withGuy Harris1-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/"). svn path=/trunk/; revision=4586
2002-01-16From Mark Burton: reinstate data segment digest handling, and stop theGuy Harris1-4/+4
SCSI dissector from treating data digests as payload. svn path=/trunk/; revision=4552
2002-01-10SCSI dissector, and changes to make the iSCSI dissector use it, fromGuy Harris1-0/+2485
Dinesh Dutt. svn path=/trunk/; revision=4508