Commit Graph

46 Commits

Author SHA1 Message Date
Ronnie Sahlberg 57105d45c4 Rewritten the Command/DataIn/DataOut/Response matching in iSCSI
so that it is reliable.
Put FT_FRAMENUMs for request-in, datain-in, data-out-in, response-in and time-from-request in the tree pane
and make all the responses have "iscsi.time" which is the time from the command.

By later passing this data down to the scsi dissectors we should be able to create taps and generate scsi service response time statistics.

...
the iscsi dissector should be cleaned up and use switch()case and subroutines instead of one gigantic if()else if() ...

svn path=/trunk/; revision=7910
2003-06-21 10:16:18 +00:00
Ronnie Sahlberg 698c0c9d4d update iSCSI so that DecodeAs... can be used to specify a TCP session being iSCSI
svn path=/trunk/; revision=7889
2003-06-15 02:02:59 +00:00
Ronnie Sahlberg 6204eee840 Let iSCSI/TCP keep track of where PDU bundaries are in the TCP stream.
This will reduce the chance of false-positives in detecting iscsi headers
inside a large data transfer.  the dissector needs to become a bit more
stateful first.

NOP-Out commands will have a TransferTag of either -1   or a valid value if
a response is requested.
Assume opcode==NOP-Out (0) and TransferTag==0   is a non-iscsi header.

svn path=/trunk/; revision=7887
2003-06-15 00:16:06 +00:00
Guy Harris 231f28ce08 Panic if a preference starts with the name of the module to which it
belongs, as that's redundant.

Fix a bunch of cases where that was done, and map the old name to the
new name.

Instead of marking "mtp3.mtp3_standard" as obsolete, map it to
"mtp3.standard".

svn path=/trunk/; revision=7030
2003-01-28 23:56:40 +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 e079796e86 From Andrew Esh: typo fix in iSCSI dissector.
svn path=/trunk/; revision=6631
2002-11-14 19:08:17 +00:00
Ronnie Sahlberg 5579f4d9a3 From Mark Burton: iSCSI updates
svn path=/trunk/; revision=6340
2002-09-26 08:20:22 +00:00
Guy Harris 19216e7292 From Mark Burton: fix the byte order in the CRC calculation.
svn path=/trunk/; revision=6130
2002-08-29 19:33:00 +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 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
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 77fa06b899 From Joerg Mayer:
dftest.c:
	     Remove #if-0-ed includes

	packet-ieee80211.c, packet-wtls.c, packet-afp.c, packet-wsp.c,
        packet-wtp.c, ethereal_gen.py:
	     Remove redundant include varargs (already in snprintf.h,
	     and required only for snprintf.h)

	Remove unused include of snprintf.h from files not using
	"snprintf()".

svn path=/trunk/; revision=5889
2002-07-17 00:43:03 +00:00
Guy Harris a4e814b66b From Mark Burton: add Draft 13 support, making that draft the default.
svn path=/trunk/; revision=5755
2002-06-24 07:57:50 +00:00
Guy Harris 1e85fff54b Fix from Mark Burton.
svn path=/trunk/; revision=5490
2002-05-16 10:03:31 +00:00
Guy Harris 39d0d82775 iSCSI draft 12 support, from Mark Burton.
svn path=/trunk/; revision=5476
2002-05-15 19:32:22 +00:00
Guy Harris 49f3f13d19 From Mark Burton: make the iSCSI protocol level a settable preference
rather than something chosen at compile time, and get rid of an
unused-but-#ifdeffed-out variable.

svn path=/trunk/; revision=5469
2002-05-14 21:35:17 +00:00
Guy Harris 9a80f0a521 Removal (or, at least, #ifdeffing out) of unused variables and
functions, from David Frascone.

svn path=/trunk/; revision=5288
2002-04-29 08:20:18 +00:00
Guy Harris f7dbfdd274 From Mark Burton: add an ett_iscsi ett_ value for the top-level tree
item.

svn path=/trunk/; revision=5100
2002-04-04 23:24:09 +00:00
Guy Harris 9f8e93226c Compile fix from Mark Burton.
svn path=/trunk/; revision=5097
2002-04-04 10:20:24 +00:00
Guy Harris 8cf3c7bd6b Update to draft 11, from Mark Burton.
svn path=/trunk/; revision=4995
2002-03-20 21:28:14 +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 f8359e84a9 Updates from Mark Burton.
svn path=/trunk/; revision=4675
2002-02-02 03:27:54 +00:00
Guy Harris 6a969169e0 Minor updates, from Mark Burton:
More draft 09 compatibility changes.

 Default port number now 3260.

 Now prints extra info to COL_INFO for SCSI command and login
 responses.

svn path=/trunk/; revision=4641
2002-01-31 00:44:36 +00:00
Guy Harris 9ff877d8fb From Mark Burton:
- Upgrade to version draft-09 of the iSCSI protocol (compatibility
	    to draft-08 can be selected at compile time)

	- Bug fix so that now the the 16 bit length that prefixes sense data
	    is taken into account.

svn path=/trunk/; revision=4591
2002-01-21 22:23:38 +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 92915713d3 Allow a length of -1 to be specified when adding FT_NONE and FT_PROTOCOL
items to the protocol tree; it's interpreted as "the rest of the data in
the tvbuff".  This can be used if

	1) the item covers the entire packet or the remaining payload in
	   the packet

or

	2) the item's length won't be known until it's dissected, and
	   will be then set with "proto_item_set_len()" - if an
	   exception is thrown in the dissection, it means the item ran
	   *past* the end of the tvbuff, so saying it runs to the end of
	   the tvbuff is reasonable.

Convert a number of "proto_tree_add_XXX()" calls using
"tvb_length_remaining()", values derived from the result of
"tvb_length()", or 0 (in the case of items whose length is unknown) to
use -1 instead (using 0 means that if an exception is thrown, selecting
the item highlights nothing; using -1 means it highlights all the data
for that item that's available).

In some places where "tvb_length()" or "tvb_length_remaining()" was used
to determine how large a packet is, use "tvb_reported_length()" or
"tvb_reported_length_remaining()", instead - the first two calls
indicate how much captured data was in the packet, the latter two calls
indicate how large the packet actually was (and the fact that using the
latter could cause BoundsError exceptions to be thrown is a feature - if
such an exception is thrown, the frame really *was* short, and it should
be tagged as such).

Replace some "proto_tree_add_XXX()" calls with equivalent
"proto_tree_add_item()" calls.

Fix some indentation.

svn path=/trunk/; revision=4578
2002-01-20 22:12:39 +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
Guy Harris 23319ff023 Move the pointer to the "column_info" structure in the "frame_data"
structure to the "packet_info" structure; only stuff that's permanently
stored with each frame should be in the "frame_data" structure, and the
"column_info" structure is not guaranteed to hold the column values for
that frame at all times - it was only in the "frame_data" structure so
that it could be passed to dissectors, and, as all dissectors are now
passed a pointer to a "packet_info" structure, it could just as well be
put in the "packet_info" structure.

That saves memory, by shrinking the "frame_data" structure (there's one
of those per frame), and also lets us clean up the code a bit.

svn path=/trunk/; revision=4370
2001-12-10 00:26:21 +00:00
Guy Harris cc7347ebf6 Allow a dissector to register preferences that it no longer supports as
obsolete; we silently ignore attempts to set those in a preferences
file, so that we don't spam the user with error messages caused by them
having saved preferences in an earlier release that contained those
preferences.

Make the Diameter and iSCSI dissectors register obsolete preferences.

Crash if some code tries to register a preferences module with a name
that contains something other than lower-case ASCII letters, numbers, or
underscores, or that has already been registered, or if some code tries
to register a preference with a name that contains something other than
lower-case ASCII letters, numbers, underscores, or periods, or that has
already been registered, so that we don't put code like that in a
release and have to shovel code into "prefs.c" to fix it up later.  (The
problem with multiple modules or preferences with the same name should
be obvious; the problem with names with blanks, or upper-case letters,
or punctuation, is that they're a pain to type on the command line.)

svn path=/trunk/; revision=4148
2001-11-04 02:50:21 +00:00
Guy Harris 52bf3d770f Updates from Mark Burton.
svn path=/trunk/; revision=4147
2001-11-04 00:58:23 +00:00
Guy Harris 6f54015711 When putting protocols into the list of protocols, do a case-insensitive
sort.

Give iSCSI the short name "iSCSI" rather than "ISCSI".

svn path=/trunk/; revision=4067
2001-10-23 05:40:36 +00:00
Guy Harris c21a5d83f7 Give the "iscsi_desegment" and "iscsi_port" the right types, matching
the declarations of the functions to which a pointer to them is passed;
this also fixes it so it compiles with MSVC++, as there's no "uint" type
declared by MSVC++ by default.

svn path=/trunk/; revision=4054
2001-10-21 19:04:20 +00:00
Guy Harris e4dbc04bf0 Updates from Mark Burton:
The enclosed code contains the following improvements:

	1 - Compatible with 08 version of the protocol

	2 - Handles both header and data digests

	3 - Supports desegmentation

	4 - Dissects multiple PDUs per packet

	5 - Stronger heuristics to avoid dissecting non-iSCSI packets

	6 - General rationalisation and de-crufting!

	The old code that attempted to automatically detect the presence
	of a header digest has been removed.  You now have to specify in
	the iSCSI preferences whether digests are enabled and if they
	are, whether they are CRC32 or not.  If not CRC32, you also need
	to specify the size of the digests (in bytes).

	Another new option specifies the iSCSI port number.  This is
	used in the heuristics to filter out packets with silly port
	numbers, set to 0 to disable the port filter.

	One problem that I haven't been able to track down is that if
	desegmentation is enabled and you turn digests on or off
	ethereal throws a SEGV.

svn path=/trunk/; revision=4051
2001-10-21 17:20:10 +00:00
Guy Harris 24c930c708 FT_UINTn values must always have a base, even if they're bitfields - the
width of the item containing the bitfield is "n", so you don't have to
specify it explicitly, as you have to do with FT_BOOLEAN bitfields.

svn path=/trunk/; revision=4047
2001-10-20 18:30:50 +00:00
Guy Harris 7204834327 From Mark Burton: update to the -08 draft.
svn path=/trunk/; revision=4043
2001-10-19 20:53:14 +00:00
Guy Harris 946ec3a865 Update from Mark Burton.
svn path=/trunk/; revision=3771
2001-07-22 20:02:23 +00:00
Guy Harris f338bd3ffc Get the length of a null-terminated string with "tvb_strnlen()", not by
getting a pointer to the first byte of the string with "tvb_get_ptr()"
and then assuming you can safely do a "strlen()" with that pointer
(it's not guaranteed that you can, as the terminating null byte might
not be in the tvbuff).

Add the resulting string with "proto_tree_add_item()".

svn path=/trunk/; revision=3728
2001-07-16 06:06:06 +00:00
Guy Harris 3c91e2e203 Convert a bunch of "proto_tree_add_bytes(tree, hf, tvb, offset, length,
tvb_get_ptr(tvb, offset, length))" calls to "proto_tree_add_item()"
calls.

Do the same, in "packet-iscsi.c" and "packet-mrdisc.c", for
"proto_tree_add_uint()" and "proto_tree_add_boolean()" calls.

svn path=/trunk/; revision=3726
2001-07-16 05:16:58 +00:00
Guy Harris 0ffd5686d1 Updates from Mark Burton.
svn path=/trunk/; revision=3618
2001-06-28 08:05:26 +00:00
Guy Harris 8412393197 From Joerg Mayer: explicitly fill in all members of a
"header_field_info" structure, including the ones that are later set by
the routines to register fields.

svn path=/trunk/; revision=3561
2001-06-18 02:18:27 +00:00
Guy Harris 8ee0584e8d Updates from Mark Burton.
svn path=/trunk/; revision=3508
2001-06-04 05:32:52 +00:00
Guy Harris 3831d06992 On Windows, "min" apparently gets defined or declared in such a fashion
that declaring our own static function "min()" doesn't work; rename it
"iscsi_min()" to get rid of the problem.

svn path=/trunk/; revision=3504
2001-06-02 08:13:04 +00:00
Guy Harris c3db6052cb Updates from Mark Burton.
svn path=/trunk/; revision=3492
2001-05-31 19:20:41 +00:00
Guy Harris ffb3b28de6 Don'tcramallthewordsinapreference'snametogether;
underscores_are_permitted_in_those_names.

svn path=/trunk/; revision=3491
2001-05-31 08:54:17 +00:00
Guy Harris 714c10a91c iSCSI support, from Mark Burton.
svn path=/trunk/; revision=3482
2001-05-30 18:52:38 +00:00