Commit Graph

27 Commits

Author SHA1 Message Date
Ronnie Sahlberg 3e922525d5 make NDMP start distinguishing between different versions.
Between v2 and v3 some structures changed their definition.

I arbirtrarily made the preference set V2 as the default.
I have no idea what the most common ndmp version is  maybe someone that knows
which is the most popular iversion in the wild will change it to default to that.

svn path=/trunk/; revision=10362
2004-03-11 09:54:00 +00:00
Ronnie Sahlberg e72747325c update to ndmp if there is an error, put the error string in the packet summary
svn path=/trunk/; revision=9910
2004-01-30 10:51:07 +00:00
Guy Harris 821fd8405b Don't create a protocol tree entry for the body of an NDMP request or
reply if there isn't a body, just a header, so that we don't throw an
exception and mark the frame as malformed if the request or reply isn't
supposed to have a body.

svn path=/trunk/; revision=9454
2003-12-27 04:01:17 +00:00
Guy Harris 5c1d9182ec Make "first_pdu" an argument rather than a global in the ONC RPC
dissector - including the ONC RPC-over-TCP record marking code, which is
also used by NDMP.

That means that the NDMP dissector can, like the ONC RPC dissector, put
into the Info column items for all the NDMP messages dissected for a
frame; make it do so.

svn path=/trunk/; revision=7516
2003-04-21 08:13:18 +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
Ronnie Sahlberg 1e043ca82a Updated NDMP and ONC RPC services to use the new function to display
fregment trees.

svn path=/trunk/; revision=5627
2002-06-05 11:32:14 +00:00
Guy Harris 28703b8698 Mark unused arguments as such.
svn path=/trunk/; revision=5329
2002-05-01 07:50:38 +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
Uwe Girlich 2ca7ff7848 Removed many senseless pinfo parameters in RPC dissection and the layers above.
svn path=/trunk/; revision=5090
2002-04-03 13:24:13 +00:00
Guy Harris b505843920 Add support for reassembling RPC-over-TCP fragments, and do that in both
RPC and NDMP.

Show the RPC-over-TCP fragment header as a tree with bitfields below it.

Add a routine to show a reported bounds error as an "Unreassembled
Packet" or a "Malformed Packet" depending on whether "pinfo->fragmented"
is set, and have NBNS and RPC use that.

Add "ett_ndmp_file_stats" to the list of ett_ values to be initialized
(it wasn't in that list, and wasn't getting initialized).

When freeing up various hash tables and memory chunks in the RPC
dissector, zero out the pointers to them, just to make sure we don't try
to free them again.

Always destroy the TCP segment key and address memory chunks in
"tcp_desegment_init()", regardless of whether TCP desegmentation is
enabled - we don't *allocate* them if TCP desegmentation isn't enabled,
but we should free them even if it's not enabled.  Also, when we free
them, set the pointers to them to null, so we don't double-free them.

Supply to subdissectors called from the TCP dissector the sequence
number of the first byte handed to the sub dissector.

svn path=/trunk/; revision=4753
2002-02-18 23:51:55 +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 2c62907ff6 Dissect "execute CDB" requests and replies.
Get rid of extra trailing white space in some protocol tree items.

svn path=/trunk/; revision=4725
2002-02-12 23:56:37 +00:00
Guy Harris ff8a6e55a3 Catch ReportedBoundsError exceptions when dissecting NDMP messages, and
report the error but don't re-throw the exception; that way, we can
continue to dissect additional NDMP messages in the frame or reassembled
chunk of data, even if one of them happens to be too short for what's in
it.

svn path=/trunk/; revision=4692
2002-02-03 21:44:01 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.

Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.

svn path=/trunk/; revision=4605
2002-01-24 09:20:54 +00:00
Guy Harris 961e0cdfa2 Convert some "col_add_str()" calls to "col_set_str()".
svn path=/trunk/; revision=4592
2002-01-21 23:35:32 +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 13fe7dd35c Put one NDMP top-level protocol tree item in for every NDMP PDU (which
means *no* top-level tree item if we don't find any NDMP PDUs).

Check for desegmentation before checking anything else, so that we don't
fail to desegment merely because we have, for example, only the record
marker in the first TCP segment (I've seen a capture where the first TCP
segment of an NDMP message has only the record marker).

svn path=/trunk/; revision=4572
2002-01-18 22:37:56 +00:00
Guy Harris 8e18ef8bbc Make the default for NDMP desegmentation TRUE, as is the case for most
other protocols running atop TCP (and which should be the case for *all*
of them, if it isn't so already; there's already a flag to control
desegmentation in TCP, and it should, by default, be possible to turn
that on and get desegmentation of all protocols).

svn path=/trunk/; revision=4568
2002-01-18 21:16:39 +00:00
Guy Harris 86d348aed1 Fix some preferences to eliminate the extra copy of the protocol name at
the beginning, and to use underscores rather than periods where the
preference's name really isn't part of a hierarchical namespace.

Use "%u" rather than "%d" to print unsigned quantities.

svn path=/trunk/; revision=4543
2002-01-15 10:01:21 +00:00
Guy Harris 8289dd46d2 From Ronnie Sahlberg: use size from encapsulation instead of how many
bytes were dissected since there can be padding bytes after the ndmp pdu
and to the end of what size said it would be, and some other cleanups.

svn path=/trunk/; revision=4486
2002-01-05 20:08:47 +00:00
Guy Harris ba74898e8c Additional sanity checks, from Ronnie Sahlberg.
svn path=/trunk/; revision=4485
2002-01-05 20:05:53 +00:00
Guy Harris 3ed03cadf6 Further updates from Ronnie Sahlberg.
svn path=/trunk/; revision=4483
2002-01-04 23:53:40 +00:00
Guy Harris 5b288fc0da Most of NDMP, from Ronnie Sahlberg.
svn path=/trunk/; revision=4479
2002-01-04 19:55:03 +00:00
Guy Harris 6f0d79c0d7 From Ronnie Sahlberg: initial NDMPv3 support, and an update to his
e-mail address.

svn path=/trunk/; revision=4444
2001-12-23 21:36:58 +00:00