Commit Graph

44 Commits

Author SHA1 Message Date
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
Tim Potter 55b95e9716 Added some NT access mask constants.
svn path=/trunk/; revision=6055
2002-08-21 21:31:54 +00:00
Tim Potter 7dfb105011 Added DOS error 259 - no more items.
svn path=/trunk/; revision=5962
2002-08-07 00:48:53 +00:00
Guy Harris ca637b4413 From Prabhakar Krishnan: add item to SMB protocol tree for time between
request and response.

svn path=/trunk/; revision=5895
2002-07-20 23:14:39 +00:00
Guy Harris 83dde747ff Put in some additional information from:
Microsoft Networks SMB File Sharing Protocol Extensions Version
	2.0, Document Version 3.3, November 7, 1988;

	Microsoft Networks SMB File Sharing Protocol Extensions Version
	3.0, Document Version 1.11, July 19, 1990.

svn path=/trunk/; revision=5566
2002-05-26 01:30:05 +00:00
Tim Potter b4248be92d Added constant and value_string for invalid security descriptor owner
error.

svn path=/trunk/; revision=5415
2002-05-08 05:15:11 +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
Tim Potter c08c275702 Added 'invalid security descriptor' error to list of dos errors.
svn path=/trunk/; revision=5234
2002-04-24 06:18:51 +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
Tim Potter d3c236be5e Added error messages for invalid name and invalid form size.
svn path=/trunk/; revision=4946
2002-03-15 04:46:43 +00:00
Guy Harris ac4cd62ed8 From Ronnie Sahlberg: add the actual SMB command to the structure that
remembers SMBs for request/response matching, and make sure the request
and the response have the same type (or that the response has a
different type but is a valid response to the request).

svn path=/trunk/; revision=4763
2002-02-20 21:46:42 +00:00
Guy Harris 4e08507d23 Match requests and responses using both the MID and the PID; the SNIA
CIFS draft spec speaks of both being used:

	The multiplex ID (Mid) is used along with the Pid to allow
	multiplexing the single client and server connection among the
	client's multiple processes, threads, and requests per thread.
	Clients may have many outstanding requests (up to the negotiated
	number, MaxMpxCount) at one time.  Servers MAY respond to
	requests in any order, but a response message MUST always
	contain the same Mid and Pid values as the corresponding request
	message.  The client MUST NOT have multiple outstanding requests
	to a server with the same Mid and Pid.

and I have seen a capture where more than one PID is used on a given
connection and where the same MID is used with two different PIDs.

Get rid of the "mid" field in the "smb_info_t" structure - the MID is
not used outside "dissect_smb()".

svn path=/trunk/; revision=4495
2002-01-08 05:52:05 +00:00
Guy Harris 98b2ecb304 SPOOLSS RPC dissector, from Tim Potter. This includes adding additional
DOS error codes to the table of them, and exporting that table to other
dissectors for protocols using DOS error codes.

svn path=/trunk/; revision=4470
2002-01-03 20:42:41 +00:00
Guy Harris 787a331ae6 From Todd Sabin:
add "dissect_ndr_ctx_hnd()" for dissecting context handles, and
	use it in various DCERPC dissectors;

	beef up the MS Security Account Manager dissector.

Also, export "NT_errors[]" for use by that dissector.

svn path=/trunk/; revision=4350
2001-12-06 23:30:36 +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 a17c23a7a2 From Tim Potter: add the DOS error for "file already exists" on a
rename.

svn path=/trunk/; revision=4333
2001-12-05 00:49:32 +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 99e2d7e626 Discard stuff in "smb.h" not used by the dissectors, and replace the
#defines for SMB commands with ones that use the names from the SNIA
CIFS spec.

Use those #define values rather than hardcoded values in various places
that check for specific commands.

svn path=/trunk/; revision=4244
2001-11-21 06:25:58 +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 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 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 3412303bf6 NT Transact dissection, from Ronnie Sahlberg.
svn path=/trunk/; revision=4178
2001-11-08 08:21:13 +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 b39d788d91 Squelch some compiler warnings.
svn path=/trunk/; revision=3874
2001-08-27 20:04:21 +00:00
Guy Harris e18fdae9b6 Use the descriptor strings when dissecting remote APIs; this lets us
handle null pointer entries, and lets us make the dissection of those
APIs more table-driven.

svn path=/trunk/; revision=3873
2001-08-27 09:09:36 +00:00
Guy Harris a739061860 Keep track of transaction replies that have continuations, and associate
continuations with the message to which they're a continuation.

svn path=/trunk/; revision=3834
2001-08-11 07:26:25 +00:00
Guy Harris 30296fc745 Tvbuffified SMB mailslot protocol dissector, from Ronnie Sahlberg.
svn path=/trunk/; revision=3832
2001-08-07 08:39:57 +00:00
Guy Harris d2b01e812b Remote API protocol (that seems to be what it's called in a number of
places) dissector tvbuffified, from Ronnie Sahlberg and me.

Additional "are we past the end of the buffer" checks added, so that we
don't hand random junk to the transaction and transact2 dissectors.

svn path=/trunk/; revision=3824
2001-08-05 01:15:27 +00:00
Guy Harris 749f27dd0e Add a request/response flag to the "struct smb_info" structure, and use
that rather than passing another copy of that flag to dissectors of
particular messages.

Pass that structure to the pipe subdissector by making "pi.private"
point to it, rather than by passing it as an explicit argument.

Change more of the

	if (dirn == 1) {
		...
	}
	if (dirn == 0) {
		...
	}

stuff to

	if (dirn == 1) {
		...
	} else {
		...
	}

and then, as per the first paragraph, check the "request" flag in the
"smb_info" structure rather than checking a "dirn" flag.

Set "last_transact2_command" to -1 in the "smb_request_val" structures
for TRANSACTION requests, as it doesn't apply to those requests.

As "dissect_transact_params()" doesn't do any work if the "TransactName"
argument is null, don't bother calling it for a reply if we don't have an
"smb_request_val" for the corresponding request, as that means we can't
find out the value to pass as the "TransactName" argument.

svn path=/trunk/; revision=3822
2001-08-05 00:16:36 +00:00
Guy Harris 358e1944db Use "val_to_str()" to convert TRANSACT2 transaction codes to strings.
(This fixes an incorrect string for TRANS2_GET_DFS_REFERRAL, which has
the code 0x10 according to the current SNIA CIFS draft spec; I've seen
those in packet captures.)

Create entries in the transaction hash tables only for requests, not for
replies; this means a reply might not have an entry in the table, if the
request didn't appear in the capture, so handle that case.

Make the "last_transact2_command" field of a "smb_request_val" structure
an "int", so it can be given the value -1, which is different from all
the valid 16-bit unsigned values, to indicate that we couldn't get the
transaction code from the request (e.g., because it's too short).

Show the first Setup word in a TRANSACT2 request as the transaction
code, as that's what it is.

"dirn" is a Boolean, so

	if (dirn == 1) {
		...
	}
	if (dirn == 0) {
		...
	}

is equivalent to

	if (dirn == 1) {
		...
	} else {
		...
	}

and the latter is a bit clearer, so use it.

Distinguish between a TRANSACTION or TRANSACT2 reply where we didn't see
the request and one where we saw the request but didn't see the request
path for TRANSACTION or the request code for TRANSACT2.

Use "g_strdup()" rather than "g_malloc()" followed by "strcpy()".

svn path=/trunk/; revision=3819
2001-08-04 10:17:24 +00:00
Guy Harris 840f9b11b6 The "mid" field of the "smb_request_val" structure isn't used; eliminate
it.

svn path=/trunk/; revision=3810
2001-08-02 09:30:09 +00:00
Richard Sharpe 82d18e3d1a Added a new error code I just found ... no such share.
svn path=/trunk/; revision=2956
2001-01-29 08:14:42 +00:00
Guy Harris 12df8af4e3 Jeff Foster's SMB Mailslot and Netlogin dissectors; he split
"packet-smb.c" up into several files.

svn path=/trunk/; revision=1629
2000-02-14 04:02:21 +00:00
Guy Harris 7a943b7810 Fix Gerald's e-mail address.
svn path=/trunk/; revision=1437
2000-01-07 22:05:43 +00:00
Gilbert Ramirez 601c52f0fb Added support for compiling on win32 with Visual C and 'nmake'. It compiles,
but does not link. Perhaps someone who understands the MS tools can help
out. I made it link a few months ago, but with different version of glib/gtk+.
I can't remember how I made it link.

Most of the compatibility issues were resolved with adding
#ifdef HAVE_UNISTD_H the the source code. Please be sure to add this to all
future code.

svn path=/trunk/; revision=359
1999-07-13 02:53:26 +00:00
Guy Harris 45394e744e Add some SMB codes and error codes from the
"draft-leach-cifs-v1-spec-01.txt" CIFS Internet draft.

svn path=/trunk/; revision=274
1999-05-11 07:22:31 +00:00
Richard Sharpe 54e5da8bac Added new files for SMB decode: packet-smb.c, alignment.h, smb.h
svn path=/trunk/; revision=259
1999-05-09 04:20:59 +00:00