Commit Graph

83 Commits

Author SHA1 Message Date
Guy Harris 07d0032f1c Add a "fragment_add_seq_next()" to reassemble fragments that don't have
sequence numbers or offsets and are thus assumed to be received in order
with no duplicates or dropped fragments (e.g., for NetBIOS Frame, where
802.2 LLC guarantees in-order delivery to NetBIOS with no duplicates or
dropped fragments).

"show_fragment_tree()' and "show_fragment_seq_tree()" don't modify the
"fragment_items" to which the "fit" argument points, so make that
argument a "const fragment_items *".

Make all the "fragment_items" tables "static" (as they're not used
outside the modules defining them) and "const" (as they're not
modified).

Add support for reassembly of NetBIOS fragmented requests and responses.

Get rid of an unnecessary include of "packet-tr.c" in the NetBIOS
dissector, and make its table of dissection function pointers static.

Fix some typos in the AppleTalk and NetBIOS dissectors.

svn path=/trunk/; revision=6491
2002-10-24 06:17:36 +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
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 ce8f908f40 From Devin Heitmueller: treat the "send buffer length" in SMB RAP
messages as being present in the packet.

svn path=/trunk/; revision=5816
2002-07-03 18:17:30 +00:00
Guy Harris 4f9508837a Add "show_fragment_seq_tree()", which is like "show_fragment_tree()",
but for stuff reassembled with "fragment_add_seq()" or
"fragment_add_seq_check()".

Add a "fragment tag" string to the "fragment_items", so that packets
with fragmentation errors can be properly flagged as having "Illegal
fragments" or "Illegal segments" depending on the term used with the
protocol in question.

Make all the dissectors that can use "show_fragment_tree()" or
"show_fragment_seq_tree()", and don't already use them, do so.

svn path=/trunk/; revision=5644
2002-06-07 10:11:41 +00:00
Guy Harris 392a7dfc04 Get rid of the "data_src" member of the "frame_data" structure; put it
in the "packet_info" structure instead, as we don't need a pointer for
every single frame in the capture file, just for each frame for which we
currently have an open "epan_dissect_t".

svn path=/trunk/; revision=5614
2002-06-04 07:03:57 +00:00
Guy Harris 500c93ee8e Move the value_string table for the share type values to
"packet-smb-common.c", and use it in "packet-dcerpc-srvsvc".

svn path=/trunk/; revision=5545
2002-05-24 10:57:38 +00:00
Guy Harris da74615c79 Get rid of some unused arguments, and mark some others as unused.
Remove the declaration of "dissect_nt_sid()" from
"packet-dcerpc-samr.c"; get it by including "packet-smb-common.h",
instead.

svn path=/trunk/; revision=5313
2002-04-30 11:03:08 +00:00
Guy Harris 1a2bc5ad11 Additional RAP error code for password changes sent to a BDC, from Devin
Heitmueller.

svn path=/trunk/; revision=5296
2002-04-29 22:43:23 +00:00
Guy Harris d773807f4f Get rid of an unused variable.
svn path=/trunk/; revision=5293
2002-04-29 10:06:01 +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 588c50944d In the protocol tree entries for lists of fragments/segments, make the
top-level item correspond to the reassembled data, and make the item for
each fragment/segment correspond to the part of that reassembled data
that came from that fragment/segment.

svn path=/trunk/; revision=5025
2002-03-27 04:27:05 +00:00
Ronnie Sahlberg 17392c995b A new type of DCERPC over SMB transport.
I have captures with w2k speaking DCERPC without using the normal
Transaction named pipes SMBs.
Instead DCERPC is just implemented ontop of ordinary read/write calls.

The smb dissector now examines TreeConnectAndX and stores the conversation/tid/type-of-share in a table for later access.
All SMB requests examine that hash table to find out if TID in the header refers
to a normal share or an IPC$ share.

Initial support in read/write SMB calls to detect if the operations are for an
 IPC share and thus it assumes it must be DCERPC commands in the payload.
Desegmentation/Reassembly of these types of calls are not implemented yet.

svn path=/trunk/; revision=4952
2002-03-16 04:39:29 +00:00
Ronnie Sahlberg ad861e7827 Moved the value_string for MS country codes from packet-dcerpc-nt.c to
packet-smb.c so that packet-smb-pipe.c can reference this struct as well.

svn path=/trunk/; revision=4947
2002-03-15 08:59:53 +00:00
Guy Harris 6a21dc7e44 Don't give tvbuffs names; instead, give data sources names, where a
"data source" has a name and a top-level tvbuff, and frames can have a
list of data sources associated with them.

Use the tvbuff pointer to determine which data source is the data source
for a given field; this means we don't have to worry about multiple data
sources with the same name - the only thing the name does is label the
notebook tab for the display of the data source, and label the hex dump
of the data source in print/Tethereal output.

Clean up a bunch of things discovered in the process of doing the above.

svn path=/trunk/; revision=4749
2002-02-18 01:08:44 +00:00
Guy Harris eb0f5ed538 Not all pointers in RAP packets point to null-terminated strings; add
support for the "b" descriptor item in data, for pointers that point to
arrays of bytes - the descriptor item includes a byte count giving the
number of bytes in the array.

Handle the "logon hours" bitmask in that fashion.

Sometimes it appears that -1 means "unknown", and sometimes it appears
that 0 means "unknown", for the last logoff date/time; interpret both of
them as "unknown" (or "never").

svn path=/trunk/; revision=4612
2002-01-27 22:25:48 +00:00
Guy Harris a765213629 Fix "add_byte_param()" not to report multi-byte parameters as having the
wrong type.

Don't have routines that create subtrees for the data in a RAP reply -
just have a string for the name to give the subtree.  Create the subtree
iff the reply has an entry count; if there's no name, use "Entries", and
if there's no ett_ value for it, use a generic one.

If there's no routine to create a subtreee for an entry in a RAP reply,
don't create the subtree - some entries have only one member, so there's
no point in creating a subtree for them.  Provide an ett_ value to use
if we don't know what the entry looks like.

Properly terminate "lm_null_list[]".

Fix the tables for the NetUserGetInfo API.

Add tables for the NetUserGetGroups API.

Add #defines and names for all the APIs in the SNIA CIFS spec (but fix
up some of the names to reflect what the actual API names appear to be).

Display the RAP API number in decimal, not hex, for unknown APIs.

Use the right hf_ value when displaying the auxiliary data descriptor.

svn path=/trunk/; revision=4611
2002-01-27 03:04:30 +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 fb1e26fe6a Use the "fragmented" field of the "packet_info" structure in
"dissect_frame()" to indicate whether a ReportedBoundsError was due to
the packet being malformed (i.e., the packet was shorter than it's
supposed to be, so the dissector went past the end trying to extract
fields that were supposed to be there) or due to it not being
reassembled (i.e., the packet was fragmented, and we didn't reassemble
it, but just treated the first fragment as the entire packet, so the
dissector went past the end trying to extract fields that were partially
or completely in fragments after that).  Mark the latter as being
unreasembled rather than malformed.

Properly initialize, save, and restore that field, and properly set it,
so that works.

svn path=/trunk/; revision=4555
2002-01-17 06:29:20 +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 8d3bd64e6c More MSRPC->DCERPC, from Tim Potter.
svn path=/trunk/; revision=4406
2001-12-16 20:08:22 +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 446e7ed7ed "msrpc" -> "dcerpc", and comment cleanups, from Tim Potter.
svn path=/trunk/; revision=4365
2001-12-09 00:07:37 +00:00
Guy Harris 6b253331f0 Support for reassembly of DCERPC over SMB, from Ronnie Sahlberg.
svn path=/trunk/; revision=4335
2001-12-05 08:20:30 +00:00
Guy Harris 390d5bbb55 If a request has already been processed, and we fail to find its
"smb_saved_info_t" in the table of requests whose replies have been
found, don't look it up in the table of requests whose replies have not
been found - if the request in question has no reply in the capture,
that may find some later frame in the same conversation with the same
MID, and we don't need that information anyway - the only reason we
*need* that structure is to save information in it for use when
processing its reply, and we already did that the first time we
processed the request.  (The information for the later frame may be bad,
e.g. having a null "extra_info" pointer, or having one that points to
information for another request.)

Arrange that we don't use the pointer to the "smb_saved_info_t" when
processing a request except to save information if the request hasn't
already been processed, as that pointer may not be valid if the request
has already been processed, as per the above.

svn path=/trunk/; revision=4292
2001-11-28 11:33:55 +00:00
Guy Harris ce66d97e35 Updates to transaction reassembly, from Ronnie Sahlberg.
Add some checks for null tvbuff arguments.

When dissecting transaction setup, parameters, and data when we couldn't
dissect it as a pipe or mailslot transaction, use the reported length of
the supplied tvbuff, not the actual length, as the amount of data
present.

svn path=/trunk/; revision=4291
2001-11-28 09:44:27 +00:00
Guy Harris f78a1f548b Rename the heuristic dissector table "msrpc" to "smb_transact", to
indicate that it's to be used for SMB transactions; a different table,
using different dissectors, would be needed for, say, reads and writes
over a named pipe, as those are byte streams and SMB transactions are
packets, so the dissectors for the first one need to worry about
multiple PDUs per segment and desegmentation, while the dissectors for
the second one don't - and, in fact, can't do desegmentation stuff.

svn path=/trunk/; revision=4286
2001-11-27 09:37:18 +00:00
Ed Warnicke fcd5b352af Moved from using dissect_data() to using call_dissector()
svn path=/trunk/; revision=4269
2001-11-26 04:52:51 +00:00
Guy Harris d08dbcc357 Clean up the stuff that creates the pipe protocol subtree; it shouldn't
fetch the length of "sp_tvb" if "sp_tvb" is null.

Fix some comments.

svn path=/trunk/; revision=4267
2001-11-26 01:22:11 +00:00
Guy Harris cbf6148b22 From Ronnie Sahlberg: fix a check for a null tvbuff pointer to check the
correct pointer.

svn path=/trunk/; revision=4265
2001-11-25 23:23:34 +00:00
Guy Harris 60fe401dc7 Get rid of some unused variables.
svn path=/trunk/; revision=4241
2001-11-21 02:01:06 +00:00
Guy Harris 8550cfcc6f Allow the tvbuff pointer to various "proto_tree_add" routines to be null
if (and only if) the length of the item being added is 0 (so that it has
no data backing it).

This means the data stream name pointer for the item in question is
null; make sure we handle that.

Use that for some "uses the value from the matching request" fields in
the SMB Pipe protocol.

svn path=/trunk/; revision=4231
2001-11-20 09:07:34 +00:00
Guy Harris f7496cc674 Dissect the rest of the named pipe protocol. Export from "packet-smb.c"
routines used for that.

Rename some named pipe functions as per the SNIA CIFS spec.

Label the "number of files moved" field of the reply to a Move SMB as
such, rather than as an unspecified "Count".

svn path=/trunk/; revision=4229
2001-11-20 07:47:42 +00:00
Guy Harris 7cd2bc5659 Save the function code and FID for pipe requests, and use it for the
matching responses.

svn path=/trunk/; revision=4228
2001-11-20 06:24:20 +00:00
Guy Harris 568a3af48b If we know the pipe function code, put the function into the Info
column.

svn path=/trunk/; revision=4224
2001-11-19 12:34:51 +00:00
Guy Harris b31b47e066 Dissect the setup words in pipe transactions that have them; that
obviates the need to have a protocol tree item for "MSRPC-over-SMB", as
the setup words for it are just standard TransactNmPipe setup words
(0x26 is the TransactNmPipe function code, and the next setup word is
the FID for the pipe in question.)

Pass to the pipe dissector tvbuffs for setup-words-plus-pipe (which is
the data for the pipe protocol) and parameters-plus-data (which is the
data for the protocol running atop the pipe protocol); use the former
for the top-level protocol tree item for the pipe protocol, and the
latter for the top-level protocol tree item for the LANMAN protocol.

svn path=/trunk/; revision=4223
2001-11-19 11:41:51 +00:00
Guy Harris 5b36683d39 Make the register routines for the mailslot, pipe, browser, and
mailslot-based logon protocols just be regular register routines,
detected by the script that generates the "register.c" file, rather than
special stuff known to the SMB dissector.

svn path=/trunk/; revision=4222
2001-11-19 10:23:39 +00:00
Guy Harris 853aa01c6e Pass, as the first tvbuff argument to "dissect_mailslot_smb()" and
"dissect_pipe_smb()", a tvbuff containing the setup words and the
pipe/mailslot pathname, as those are arguably the part of the packet
that contains the "mailslot protocol" and the "pipe protocol", as
opposed to the protocol running atop mailslots or pipes.

Pass a setup tvbuff to "dissect_pipe_smb()" for it to pass on to the
MSRPC-over-named-pipe dissector, and have the setup tvbuff passed to it
and "dissect_mailslot_smb()" contain *only* the setup words; don't
extract anything other than the setup words from it.

Declare "register_proto_smb_mailslot()" in "packet-smb-mailslot.h"
rather than "packet-smb.c", and declare "register_proto_smb_pipe()" in
"packet-smb-pipe.h" rather than "packet-smb.c".

Add a protocol for MSRPC-over-named-pipes.

Move the stuff to handle the FID in the setup words of
MSRPC-over-named-pipe transactions out of the SMB Transaction dissector
into the MSRPC dissector.  Add a routine to "packet-smb.c", callable
from outside "packet-smb.c", to put an "smb.fid" field into the protocol
tree, and to add ", FID: XXXX" to the Info column, for use by the
MSRPC-over-named-pipe dissector; use it in the SMB dissector as well, in
all the places where we put a FID into the protocol tree.

Move the stuff to check whether the LANMAN protocol is enabled, and to
set "pinfo->current_proto" to "LANMAN" if it is, into the LANMAN
API-over-named-pipe dissector out of the named pipe protocol dissector.

If we didn't dissect a Transaction request or reply as a named pipe or
mailslot message, put any setup words, parameters, and data it has into
the protocol tree as separate items.

Don't put a "Response in" item into the protocol tree for an NT Cancel
request, as there are no responses to NT Cancel requests.

svn path=/trunk/; revision=4221
2001-11-19 10:06:42 +00:00
Guy Harris 8c358fd83e From Tim Potter: use the FID, for DCE RPC-over-SMB, as part of the
conversation matching.

svn path=/trunk/; revision=4220
2001-11-18 22:44:08 +00:00
Guy Harris bdd9eb3cf4 Pass in the "smb_info" structure a pointer to the "smb_saved_info_t"
structure, so that it can be updated by subdissectors; this way the
updates affect the structure immediately, and don't get lost if the
subdissector later throws an exception.

Use "tvb_reported_length()" to check for an interim mailslot reply;
"tvb_length()" could give the wrong answer if a short snapshot length
was given in the capture.

svn path=/trunk/; revision=4218
2001-11-18 02:51:20 +00:00
Guy Harris c211cb9da9 Have only the request and response frame numbers, and a "void *", in an
"smb_saved_info_t".  Put all the information needed to dissect NT
Transaction replies, Transaction2 replies, or Transaction replies into
separate data structures, allocated separately, and put a pointer to
that data structure in the "void *" in question.

Use the return value of "dissect_pipe_smb()" and
"dissect_mailslot_smb()" to control whether to display as data the stuff
those routines were asked to dissect.

If we've seen a request before, but its "smb_saved_info_t" isn't in the
"matched" hash table, look in the "unmatched" hash table - perhaps we
haven't seen the reply yet.

svn path=/trunk/; revision=4216
2001-11-18 01:46:51 +00:00
Guy Harris 6f2633ba61 Cleanup of request/response matching, from Ronnie Sahlberg.
Get rid of "Response to" stuff in the LANMAN dissector, as that's now
done in the SMB dissector.

Add a routine for dissecting unknown SMBs (gets the word and byte
counts, and just adds text entries for the word and byte parameters, if
any), and replace null pointers in the dissector table with pointers to
that routine.  Get rid of the check for a null dissector pointer.

svn path=/trunk/; revision=4212
2001-11-16 07:56:28 +00:00
Guy Harris dc1ac349f9 Tvbuffification of Transaction requests, from Ronnie Sahlberg.
"Send buffer pointer" and "send buffer length" items appear not to be
sent over the wire.

Add support for Write And X.

svn path=/trunk/; revision=4204
2001-11-15 10:41:53 +00:00
Guy Harris 6ff9b3366e Support for DCE RPC atop SMB, and support for several Microsoft DCE RPC
services used with SMB, from Tim Potter.

svn path=/trunk/; revision=4194
2001-11-12 08:58:45 +00:00
Guy Harris 0c13da5c70 Rename the "private" member of the "packet_info" structure to
"private_data", to keep C++ compilers from getting heartburn.

svn path=/trunk/; revision=4130
2001-11-03 00:58:52 +00:00
Guy Harris d79c0698c8 In "get_pointer_value()", don't include the terminating '\0' when
formatting the string as text.

In "add_pointer_param()", make the offset in the text item for the
string the offset in the string area, not the offset of the pointer
itself.

Fix some items in item lists to have "lm_null" rather than a null
pointer, so that if we don't find an entry for the detail level, we
don't blow up dereferencing a null pointer, we just dissect all the
items based on the type in the descriptor string.

If we don't have a data descriptor for response data, just put in an
entry for the data; that may happen if we only dissected part of the
request to which the stuff we're dissecting is a reply, e.g. because the
snapshot length didn't let us capture all of the request.

svn path=/trunk/; revision=4085
2001-10-26 10:14:43 +00:00
Jeff Foster 0945259b59 fixed bug in packet-smb-pipe.c dissect_transact_data routine. If the
aux_count_p value was NULL the program would SIGSEGV when *aux_count_p
was initially set to 0. Added NULL pointer test.

svn path=/trunk/; revision=4036
2001-10-17 21:24:28 +00:00
Guy Harris 1d42c94b05 Make the resolution for time values be nanoseconds rather than
microseconds.

Fix some "signed vs. unsigned" comparison warnings.

svn path=/trunk/; revision=3934
2001-09-14 07:10:13 +00:00
Guy Harris b39d788d91 Squelch some compiler warnings.
svn path=/trunk/; revision=3874
2001-08-27 20:04:21 +00:00