Commit Graph

218 Commits

Author SHA1 Message Date
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 ecda579229 Clean up the display of the top-level item for the NT ACE Flags, so that
there's a space after the colon, and so that there's no extra comma at the
end and only one space between the items.

Fix a typo.

svn path=/trunk/; revision=4940
2002-03-14 05:45:16 +00:00
Ronnie Sahlberg 024f90f4fe Absolute and Relative times were swapped. Also add comment that there seems
to be an unknown special time constant : 0x40000000 00000000 that we dont know
yet what it means.

svn path=/trunk/; revision=4915
2002-03-10 23:13:04 +00:00
Guy Harris eb62c04d71 No need to put ", N byte{s} at offset O" into the Info column twice;
once is enough.

svn path=/trunk/; revision=4901
2002-03-09 02:12:47 +00:00
Tim Potter 6bb9d7eaf8 Display a different message in the COL_INFO field for anonymous session
setup packets.

svn path=/trunk/; revision=4818
2002-02-27 02:42:19 +00:00
Tim Potter c2e21d860b Fixed up value_string for SMBE_unknownlevel error.
svn path=/trunk/; revision=4785
2002-02-22 21:29:02 +00:00
Guy Harris 2f70b4df02 Initial quota support, from Ronnie Sahlberg.
svn path=/trunk/; revision=4771
2002-02-22 00:05:02 +00:00
Guy Harris e80b68372c Use the right format (one with a numerical format item rather than a
string format item) as the third argument to "val_to_str()".

svn path=/trunk/; revision=4770
2002-02-21 23:54:03 +00:00
Tim Potter 15c2a5a651 Export dissect_nt_sec_desc() so it can be used by other dissectors.
A NT security descriptor can be either revision 1 or 2 and seem to be the
same format on the wire.

svn path=/trunk/; revision=4768
2002-02-21 18:39:49 +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 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 879e1160e4 From Tim Potter:
- For selected read and write SMBs, display the byte count and offset
    in the info column.  This makes browsing file read/writes easier to
    understand.

  - In dissect_nt_sids() sometimes the version number is 3 but the rest
    of the sid format remains the same.  This is purely by observation -
    I have no documentation to confirm this.

  - Use a GString instead of a fixed buffer in dissect_nt_sids().

svn path=/trunk/; revision=4733
2002-02-14 05:53:59 +00:00
Guy Harris e7737953d0 From Ronnie Sahlberg: display FILETIME values of 0x8000000000000000 as
"Infinity (absolute time)", and values of 0x7fffffffffffffff as
"Infinity (relative time)".

svn path=/trunk/; revision=4727
2002-02-13 04:11:37 +00:00
Guy Harris f094e1c292 From Tim Potter: for all the SMBs that have a FID in the request, put
the FID in the Info column.

svn path=/trunk/; revision=4663
2002-02-01 07:22:51 +00:00
Gilbert Ramirez 4c4edd93fb Remove extra white-space from text added to proto_tree.
Thanks to Tim Potter <tpot@samba.org>

svn path=/trunk/; revision=4657
2002-02-01 04:42:24 +00:00
Guy Harris 3c1fb071eb Redo the previous change in a slightly cleaner fashion (don't convert
the result of "g_hash_table_lookup()" to an integer until you've
determined that it's not a null pointer, i.e. that the lookup
succeeded).

svn path=/trunk/; revision=4623
2002-01-29 21:49:43 +00:00
Guy Harris e08be416ff "NULL" is a pointer.
Objects of type "guint32" are integers.

Don't compare the former with the latter.

svn path=/trunk/; revision=4622
2002-01-29 21:37:58 +00:00
Guy Harris b3bc97d7f5 Add support for dissecting NT FILETIME time stamp values.
Get rid of a level of hierarchy in some SMB field names.

svn path=/trunk/; revision=4613
2002-01-28 00:58:46 +00:00
Guy Harris 42a38685cd In the "Announce change to UAS or SAM" NETLOGON message, dissect the
"Large Serial Number" as a 64-bit little-endian integer, and dissect the
"NT Date/Time" as a FILETIME by calling "dissect_smb_64bit_time()".

Export "dissect_smb_64bit_time()" so that we can do so.

svn path=/trunk/; revision=4609
2002-01-25 09:42:21 +00:00
Guy Harris 7f0ef5ec87 From Tim Potter: NT SID dissection.
Don't label the SID in an ACE as an "NT SID SID", label it as an "NT ACE
SID".

svn path=/trunk/; revision=4607
2002-01-25 08:02:01 +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 c8f8db531f When checking whether to do DCERPC-over-SMB reassembly on a Read and X
response, don't assume that we saw the request and therefore that
"si->sip" is non-null - we might well not have seen the request and thus
might not have set "si->sip".

svn path=/trunk/; revision=4542
2002-01-15 09:42:26 +00:00
Guy Harris c78cb46c0e Use "proto_tree_add_item()", not "proto_tree_add_bytes()", to add an
item for extra data at the end of the Transaction2 request parameters.

svn path=/trunk/; revision=4499
2002-01-08 20:11:57 +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 4e013a44de Reassembly of fragmented NT Transaction responses, from Ronnie Sahlberg.
svn path=/trunk/; revision=4421
2001-12-18 08:55:49 +00:00
Guy Harris f370747531 From Ronnie Sahlberg: dissect security descriptor flags.
Clean up the display of the access control list entry flags.

Treat the access control list entry mask bits as NT permission bits (as
that's what they are).

svn path=/trunk/; revision=4420
2001-12-18 08:27:06 +00:00
Guy Harris 0ff9471830 NT ACL structure dissection, from Ronnie Sahlberg.
svn path=/trunk/; revision=4405
2001-12-15 23:59:23 +00:00
Guy Harris 3ccae74e5e NT security descriptor dissection, from Ronnie Sahlberg.
svn path=/trunk/; revision=4396
2001-12-15 04:35:50 +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 6b0b77c5f1 More NT error codes, from Todd Sabin.
svn path=/trunk/; revision=4352
2001-12-07 05:52:23 +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 ef626a48ce From Ronnie Sahlberg: reassemble DCERPC-over-SMB requests as well as
responses.

svn path=/trunk/; revision=4348
2001-12-06 09:24:02 +00:00
Guy Harris 10b79123ef In the SMB dissector, keep a list of all the conversation structures
and, when we're re-initializing the dissector, free up all the hash
tables attached to those structures.

svn path=/trunk/; revision=4345
2001-12-06 07:04:02 +00:00
Guy Harris fc6a4d9b6f There can be more than one SMB request or response in a frame when
you're doing NetBIOS-over-TCP (yes, I've seen that, with one response
being a Transaction and the other being a Read and X), so the frame
number is insufficient as a key in the hash table of matched
request/response pairs; use the frame number and the MID.

svn path=/trunk/; revision=4344
2001-12-06 06:35:31 +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 a9c0c1ebbb Don't fetch "t2i->info_level" if "t2i" is null.
svn path=/trunk/; revision=4332
2001-12-05 00:25:44 +00:00
Guy Harris 3396fb2777 Update from Ronnie Sahlberg:
1.  Changes how can_desegment works so that can_desegment is
	    only != 0 for whichever dissector is running immediately on
	    top of whoever offers the can_desegment service.

	    Thus DCERPC needs no special handling to see if it can trust
	    can_desegment (which is currently only available ontop of TCP
	    and not ontop of tcp->nbss->smb).

	2.  Changes fragment reassembly of transaction smb to only show
	    the defragmented packet for the transaction smb holding the
	    first fragment.

	    To see why, test it with a transaction SMB containing a ~60kb
	    PDU or larger.  The old behaviour had approximately quadratic
	    behaviour regarding runtime for dissecting such PDUs.

	    (example: NetShareEnum is a command which can grow really really
	    large if the number of shares and comments are large)

svn path=/trunk/; revision=4296
2001-11-29 09:05:25 +00:00
Guy Harris ec19562f1a When processing a response, check whether "si->sip" is null before using
it; it'll be null if the matching request hasn't been seen.

svn path=/trunk/; revision=4295
2001-11-29 08:36:56 +00:00
Guy Harris 3be79df937 From Ronnie Sahlberg: track FID values between requesta and responses
for ReadAndX and WriteAndX.

svn path=/trunk/; revision=4293
2001-11-28 11:47:27 +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 fd456eaf0b Remove an extra blank from a data source name.
Added comments, from Ronnie Sahlberg.

svn path=/trunk/; revision=4280
2001-11-27 05:16:29 +00:00
Guy Harris ddfdbad4bd In "smb_trans_defragment()", quit if "si->sip" is null, as it means we
don't have the frame number of the request, which we use as the ID of
the transaction being reassembled.  (If we're reassembling a reply,
should we not use the frame number of the reply instead?  We used to
have a hash table to keep track of that, so we might just be able to
bring it back....)

svn path=/trunk/; revision=4274
2001-11-26 10:24:59 +00:00
Guy Harris d2197e36df Add some comments.
svn path=/trunk/; revision=4273
2001-11-26 10:05:27 +00:00