Commit Graph

159 Commits

Author SHA1 Message Date
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 dbec2dc1e8 From Tim Potter:
display the returned FID in the Info column for NT Create And X
	replies;

	display the setup words, and treat the second word as a FID in
	Transaction requests presumed to contain DCE RPC-over-SMB.

Add the FID to the Info column for other open/create replies while we're
at it.

svn path=/trunk/; revision=4219
2001-11-18 22:12:46 +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 a2993889aa Add some bits in the Write AndX write mode as per "Microsoft Networks
SMB FILE SHARING PROTOCOL EXTENSIONS, SMB File Sharing Protocol
Extensions Version 2.0, Document Version 3.3".

Fix the test for the "connectionless mode" to test the correct bit.

svn path=/trunk/; revision=4215
2001-11-16 10:19:35 +00:00
Guy Harris c3ffa85819 Never put an entry into the hash table for an NT Cancel request, even if
we didn't find the request it's cancelling.

svn path=/trunk/; revision=4214
2001-11-16 09:52:29 +00:00
Guy Harris a7e7c07d02 Don't save a full "smb_info" structure in the hash tables for requests
and replies, just save a structure holding that information that can't
be derived from the contents of one of the SMBs.

Don't save anything at all for NT Cancel requests - they have the same
TID/PID/MID/UID as the SMB being cancelled, and you want the information
for that request used when dissecting the NT Cancel (so it gets the
number of the frame containing the request being cancelled) and when
dissecting the reply to the request being cancelled.

Get rid of an unused routine.

svn path=/trunk/; revision=4213
2001-11-16 09:27:03 +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 7b9cf0f511 Responses to queries for stream information can return more than one
piece of information in the reply, as a file can have more than one
stream; show all of them.

Don't use the "File Name" field for stream names.

svn path=/trunk/; revision=4211
2001-11-16 02:53:11 +00:00
Guy Harris 239c730bce Use "hf_smb_t2_stream_size", not "hf_smb_t2_stream_name_length", when
adding the stream size.

svn path=/trunk/; revision=4210
2001-11-16 01:52:27 +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 20bfe42945 Squelch an MSVC++ complaint.
svn path=/trunk/; revision=4198
2001-11-13 06:17:07 +00:00
Guy Harris 7141a2aa78 Include the sync I/O alert and nonalert bits.
Put in comments about some of the other bits.

svn path=/trunk/; revision=4196
2001-11-12 21:43:49 +00:00
Guy Harris 0b0116e207 Transaction2 tvbuffified, and support added for many Transaction2 SMBs,
from Ronnie Sahlberg.

Various other bug fixes, cleanups, and other improvements.

svn path=/trunk/; revision=4193
2001-11-12 08:46:14 +00:00
Guy Harris 45cc752b95 Dissect the NT create option bits. (Well, some of them, anyway.)
svn path=/trunk/; revision=4192
2001-11-11 02:27:06 +00:00
Guy Harris c62c2256e3 Change from Tim Potter to show the error status in the Info column for
SMBs that got errors.

Add some additional access mask bits, and the URL of another spec.

svn path=/trunk/; revision=4191
2001-11-10 22:23:11 +00:00
Guy Harris c08a612a4c Microsoft calls it "Dfs", not "DFS", perhaps to avoid confusion with the
OSF's DCE DFS (which is completely unrelated to Dfs).

svn path=/trunk/; revision=4190
2001-11-09 22:58:10 +00:00
Guy Harris dbe1718c7e NT Create and X support, from Ronnie Sahlberg.
"#if 0" out an unused routine, pending determination of whether there's
any place that would use it.

Fix some typos.

Display the NT create options in hex, as they appear to be a bitmask.

svn path=/trunk/; revision=4189
2001-11-09 22:45:22 +00:00
Guy Harris e6b12dd801 Tvbuffification of SMB print commands, from Ronnie Sahlberg.
Fix up some SMBs I missed when adding the byte-count checks.

svn path=/trunk/; revision=4183
2001-11-09 06:43:38 +00:00
Guy Harris 0ec155cfaf Print the create flags with 8 hex digits.
Add some checks of the return value of
"get_unicode_or_ascii_string_tvb()" - if a null terminator is missing,
it might well run past the end of the byte parameters - and add some
code to keep the byte count updated so that the right byte count is
passed to "get_unicode_or_ascii_string_tvb()".

svn path=/trunk/; revision=4180
2001-11-08 10:57:09 +00:00
Guy Harris f4a46388f2 Put the stuff to handle file data in read and write requests into a
common subroutine.

Label the "total data length" field in Write Raw and Write Multiplexed
requests as such.

Dissect the IPC State/Device State field of Open and X requests and NT
Create and X requests ass per the stuff on page 67 of

	ftp://ftp.microsoft.com/developr/drg/CIFS/dosextp.txt

Make a variable that doesn't need to be static not static.

svn path=/trunk/; revision=4179
2001-11-08 10:34:11 +00:00
Guy Harris 3412303bf6 NT Transact dissection, from Ronnie Sahlberg.
svn path=/trunk/; revision=4178
2001-11-08 08:21:13 +00:00
Guy Harris d607582d65 "dissect_open_print_file_smb()" was defined but not used; put it into
the appropriate entry in the "dissect[]" table.

svn path=/trunk/; revision=4176
2001-11-07 20:30:43 +00:00
Guy Harris 588cd16184 Further tvbuffication from Ronnie Sahlberg.
Get rid of a bunch of stuff for which said tvbuffication removes the
need.

When dissecting byte parameters, make sure you don't consume more bytes
than the byte count, and handle captures where the last string in the
byte parameters area isn't properly null-terminated (I think I've seen
that in packets from various versions of Windows NT).

Make various bitfields given as decimal in SMB specs decimal.

svn path=/trunk/; revision=4172
2001-11-07 08:05:04 +00:00
Guy Harris d5727068bb Fix the previous change to handle SMBs with tvbuffified dissectors.
svn path=/trunk/; revision=4161
2001-11-05 07:58:33 +00:00
Guy Harris eff04e8bae Put andX commands at the same level as the first command.
svn path=/trunk/; revision=4160
2001-11-05 07:46:01 +00:00
Guy Harris 39b35fd837 Put in some references.
svn path=/trunk/; revision=4159
2001-11-05 05:39:31 +00:00
Guy Harris ff8cc11795 Further tvbuffication, from Ronnie Sahlberg.
Convert a bunch of "proto_tree_add_XXX" calls to "proto_tree_add_item"
calls.

svn path=/trunk/; revision=4158
2001-11-05 05:24:17 +00:00
Guy Harris 9449d55a91 Futher tvbuffification from Ronnie Sahlberg.
Do more sanity checking on DOS dates and times.

Convert a bunch of "proto_tree_add_XXX" calls to "proto_tree_add_item"
calls.

Put the word and byte data for untvbuffified SMBs under a subtree just
as is done for tvbuffified SMBs.

Get rid of some no-longer-used routines.

Fix some displays in untvbuffified SMBs to resemble the way those fields
are displayed for tvbuffified SMBs.

Display timesouts as seconds and milliseconds when they're in units of
milliseconds.

svn path=/trunk/; revision=4157
2001-11-05 01:44:17 +00:00
Guy Harris 35078ebac9 Further tvbuffication, from Ronnie Sahlberg.
Make it possible for a non-tvbuffied dissector for an andX SMB to call a
tvbuffified dissector for the andX command, and fix the non-tvbuffified
dissectors in question to do so.

svn path=/trunk/; revision=4154
2001-11-04 12:44:02 +00:00
Guy Harris 303bb72023 More tvbuffication, from Ronnie Sahlberg.
When converting DOS-date years to "struct tm" years, add 1980 and
subtract 1900, to make it clearer what the conversion involves (DOS-date
years are (year - 1980); "struct tm" years are (year - 1900)).

svn path=/trunk/; revision=4146
2001-11-04 00:53:46 +00:00
Guy Harris d6a16d417a Check for a zero word count in LogoffandX requests and replies.
svn path=/trunk/; revision=4145
2001-11-03 23:53:48 +00:00
Guy Harris 8a7bb75f0d Clean up the display of the Flags and Flags2 fields, and add a missing
bit to Flags2.

svn path=/trunk/; revision=4140
2001-11-03 12:10:34 +00:00
Guy Harris f2676ba1c9 Tvbuffification of Negotiate Protocol, from Ronnie Sahlberg.
Fix up Info column to put "Request" or "Response" *after* the name of
the request.

Give the Negotiate Protocol request its full name.

svn path=/trunk/; revision=4139
2001-11-03 11:42:50 +00:00
Guy Harris 80d72f8cf3 First tvbuffication change, from Ronnie Sahlberg. Also changes SMB
command names to match later SMB specs.

svn path=/trunk/; revision=4138
2001-11-03 06:56:56 +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 106740a5f5 Properly handle the andX command in a LockingAndX message.
Fix up some closing braces.

svn path=/trunk/; revision=4049
2001-10-20 19:29:21 +00:00
Guy Harris 3869ff8bfb Make several of the fields in the SMB header filterable.
Get rid of the "unknown-0xXX" entries in the "value_string" table for
SMB command codes - they make it much more painful to select one of them
in the filter-editing dialog box.

svn path=/trunk/; revision=3985
2001-09-30 23:36:46 +00:00
Guy Harris a6c48da6a3 Use tvbuff routines to extract data from the SMB header.
svn path=/trunk/; revision=3974
2001-09-29 01:44:09 +00:00
Guy Harris 0102e0c783 Start the process of tvbuffifying the SMB dissector - give it a
tvbuffified heuristic-dissector interface, but have it immediately turn
its arguments into an old-style buffer pointer and offset.

Register the SMB dissector as a heuristic NetBIOS dissector, and have
"dissect_netbios_payload()" just try the heuristics, as it no longer has
to call the SMB dissector explicitly.

svn path=/trunk/; revision=3973
2001-09-29 01:19:01 +00:00
Guy Harris 44e672ab42 From Todd Sabin: dissect the auth info in connection oriented dcerpc
packets.

Make a "dissect_netbios_payload()" routine, called from the
NetBIOS-over-802.2 (NBF), NetBIOS-over-IPX, and NetBIOS-over-TCP
dissectors.  Take Todd Sabin's changes to add a heuristic dissector list
to the NBSS dissector, and apply them to "dissect_netbios_payload()"
instead.  Make the SMB dissector heuristic, returning FALSE if it
doesn't see 0xFF S M B at the beginning of the packet, and have
"dissect_netbios_payload()" first try the heuristic dissector list, then
try the SMB dissector if no other heuristic dissector claims the packet,
then just dissect the payload as data.

From Todd Sabin: have the DCE/RPC dissector register as a heuristic
dissector for NetBIOS.

svn path=/trunk/; revision=3969
2001-09-28 22:43:57 +00:00
Guy Harris 5a16a295ad WordCount is unsigned, so test for "WordCount != 0" rather than
"WordCount > 0".

Always put the byte count field into the protocol tree, regardless of
whether WordCount is 0 - it's not one of the word parameters counted by
WordCount, so it's present even if WordCount is 0.

Fix a "val_to_str()" call.

svn path=/trunk/; revision=3966
2001-09-28 08:39:59 +00:00
Guy Harris 31328f1ac4 Base decisions on whether to dump the word parameters on the word count
value being non-zero, not on whether the error code is zero.  Don't
bother passing the error code to dissectors for particular SMBs, as they
don't need to use it.

In "get_unicode_or_ascii_string()", when aligning to an even boundary,
align to an even boundary in the SMB message, not in the packet as a
whole - there's no guarantee that there are an even number of bytes in
the frame before the SMB message.

In the Info column, mark the packet as a request or response based on
the request/response bit in the Flags field, not on the matched port -
for NBIPX, the source and destination ports (IPX sockets) may be the
same, so you may not be able to determine whether it's a request or a
response based on that.

svn path=/trunk/; revision=3965
2001-09-28 08:01:22 +00:00
Guy Harris ad0e1385e3 Add support for NT error codes.
svn path=/trunk/; revision=3962
2001-09-27 22:48:46 +00:00
Guy Harris f0a15c306b Handle interim Transact2 responses correctly.
Mark interim responses as such in the Info column.

svn path=/trunk/; revision=3961
2001-09-27 22:33:44 +00:00
Guy Harris 65ac4971d2 The byte count field in an SMB Write request counts not only the data
being written, but the 2 bytes of data length and one byte of buffer
type preceding that data; use the data length (which doesn't count
itself or the buffer type byte), rather than the byte count, to
determine how much data is being written.

svn path=/trunk/; revision=3917
2001-09-11 05:31:45 +00:00
Guy Harris 3388bde488 Instead of having a single datum attached to a conversation, have a list
of protocol-id-plus-datum pairs, so that multiple protocols can attach
information to the same conversation.

Dissectors that attach information to a conversation should not assume
that if they find a conversation it has one of its data attached to it;
the conversation might've been created by another dissector.

svn path=/trunk/; revision=3901
2001-09-03 10:33:12 +00:00
Guy Harris 9cef3b28ad Put in a comment noting that the "Service" string in a Tree Connect and
X reply is always in ASCII.

svn path=/trunk/; revision=3877
2001-08-27 23:17:30 +00:00
Guy Harris a7f16a41d9 Handle the "Native File System" string in a TconX response as ASCII or
Unicode based on whether strings in the SMB are ASCII or Unicode.

svn path=/trunk/; revision=3876
2001-08-27 20:15:30 +00:00