Commit Graph

36 Commits

Author SHA1 Message Date
Ulf Lamping bdcf77c036 removed some more MSVC warnings (type casting)
svn path=/trunk/; revision=9332
2003-12-17 23:35:29 +00:00
Guy Harris fa3680223b "%.*" expects an "int" argument giving the precision.
svn path=/trunk/; revision=8801
2003-10-28 17:27:56 +00:00
Guy Harris 0c389cc678 From Dinesh Dutt:
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-10-28 03:57:49 +00:00
Guy Harris afd3103ba2 Don't include <epan/conversation.h> if you don't need it.
svn path=/trunk/; revision=8361
2003-09-03 20:58:09 +00:00
Guy Harris eabf70db65 Replace "hf_scsi_log_pc" with separate "hf_scsi_logsel_pc" and
"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-07-09 03:42:55 +00:00
Guy Harris 52046f475d Strings in SCSI replies are blank-padded or possibly null-padded;
they're not null-terminated.

svn path=/trunk/; revision=7745
2003-05-26 22:36:49 +00:00
Gerald Combs 7a132e5b48 More tvb_get_nstringz0() fixes. Timo Sirainen pointed out that Bad
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-05-19 03:23:12 +00:00
Gerald Combs 0b9bbbbdb6 Modify tvb_get_nstringz*() to behave more like snprintf(). Make changes
where necessary to reflect the new behavior.

svn path=/trunk/; revision=7607
2003-04-30 02:35:28 +00:00
Guy Harris f57545cca6 When processing the device identification page of vital product data,
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-04-16 19:43:11 +00:00
Guy Harris cdd02dca54 Use SCSI_DEV_BITS for the bits in the peripheral qualifier/peripheral
device type byte used for the device type.

svn path=/trunk/; revision=7332
2003-03-10 02:18:19 +00:00
Guy Harris c6f038a787 Treat the Peripheral Qualifier field the same way we treat the
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-08 08:02:20 +00:00
Guy Harris 169be53c11 Make various variables containing unsigned quantities unsigned.
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-05 20:25:59 +00:00
Guy Harris 6e797c5b9d From Dinesh Dutt:
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-03-05 07:41:24 +00:00
Guy Harris ab552d3746 Get rid of BASE_BIN - it's just the same as BASE_DEC, but people seemed
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
2003-01-31 03:17:56 +00:00
Guy Harris 59932f2722 Don't cast away constness, and fix variable and structure member
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-12-02 23:43:30 +00:00
Guy Harris c7d181b565 From Senthil Kumar Nagappan: fix a "proto_tree_add_uint()" call that was
supposed to be a "proto_tree_add_item()" call.

svn path=/trunk/; revision=6382
2002-10-08 19:35:10 +00:00
Jörg Mayer 7c4176d868 Removed trailing whitespaces from .h and .c files using the
winapi_cleanup tool written by Patrik Stridvall for the wine
project.

svn path=/trunk/; revision=6117
2002-08-28 21:04:11 +00:00
Guy Harris 42d61a85a3 Put the volume identification in quotes, so it doesn't look stupid when
it's empty.

svn path=/trunk/; revision=6046
2002-08-21 10:40:09 +00:00
Guy Harris f81fd11c19 Display volume tags as per SMC-2.
svn path=/trunk/; revision=6045
2002-08-21 10:35:35 +00:00
Guy Harris 88565d531b Handle Read Block Position replies.
Display the additional sense code+qualifier in an element in Read Element
Status symbolically.

svn path=/trunk/; revision=6043
2002-08-21 07:55:05 +00:00
Guy Harris 2dc25cef93 Handle mode pages differently depending on the type of device (some mode
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-21 07:15:00 +00:00
Guy Harris 71bfe6806c Have "dissect_scsi_cdb()" take an argument that's a SCSI device type,
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-20 22:33:17 +00:00
Guy Harris c881048c59 Regularize the format of the "(size)" tags - the SCSI specs appear not
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-20 03:21:42 +00:00
Guy Harris c1c4eef87d Fix the reporting of the "PS" bit in SCSI mode pages.
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-19 13:06:43 +00:00
Guy Harris 0f3a02c956 From Bill Studenmund: fix handling of SCSI mode sense.
Fix Yasuhiro Shirasaki's e-mail address, and [AT]ify Vassilii
Khachaturov's address.

svn path=/trunk/; revision=6014
2002-08-18 19:59:40 +00:00
Jörg Mayer 173fe5aef4 Replace the types from sys/types.h and netinet/in.h by their glib.h
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-08-02 23:36:07 +00:00
Guy Harris b412b99609 From Peter Hawkins: make the maximum length argument to
"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-06-13 07:36:52 +00:00
Guy Harris db31932941 From Joerg Mayer:
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-04-14 23:04:04 +00:00
Guy Harris e321fcbaf5 From Dinesh Dutt: get rid of unused variables, and fix a bug in the way
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-31 20:28:41 +00:00
Guy Harris 7e6d288db3 Give the "prevent/allow medium removal" command the right name (it's
"prevent/allow", not "prevent allow").

svn path=/trunk/; revision=4933
2002-03-13 02:52:21 +00:00
Guy Harris a5e2062503 From Dinesh Dutt: initial dissection of a variable-length CDB.
svn path=/trunk/; revision=4932
2002-03-12 11:30:45 +00:00
Guy Harris a006c4fcca Have the private data for the SCSI dissection routines be a pointer to a
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-13 01:17:58 +00:00
Guy Harris 869e4d94f6 Move all the stuff in "packet-scsi.h" that's solely for the use of
"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-02-12 23:52:34 +00:00
Guy Harris ee5ca25d31 Include files from the "epan" directory and subdirectories thereof with
"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-21 07:37:49 +00:00
Guy Harris 704493f4e2 From Mark Burton: reinstate data segment digest handling, and stop the
SCSI dissector from treating data digests as payload.

svn path=/trunk/; revision=4552
2002-01-16 20:25:07 +00:00
Guy Harris aa36cec9df SCSI dissector, and changes to make the iSCSI dissector use it, from
Dinesh Dutt.

svn path=/trunk/; revision=4508
2002-01-10 01:28:45 +00:00