Commit Graph

391 Commits

Author SHA1 Message Date
Richard Sharpe 2d8152c072 Further fixes. Properly account for the length of headers. Still some headers
that we do not account for properly, like Octet Strings.

svn path=/trunk/; revision=6152
2002-08-31 07:26:10 +00:00
Richard Sharpe 7dd034e9bf Properly handle raw ntlmssp ...
svn path=/trunk/; revision=6151
2002-08-31 05:31:42 +00:00
Richard Sharpe 284d6547e2 Handle the lack of a security blob in negprot response when raw NTLMSSP is
being used properly.

svn path=/trunk/; revision=6149
2002-08-31 00:12:14 +00:00
Richard Sharpe f44c41f4ed Add support for raw NTLMSSP blobs when talking to XP etc ...
More to do yet though ...

svn path=/trunk/; revision=6148
2002-08-30 23:49:22 +00:00
Guy Harris 3f4397bbb0 From Ulf Lamping: change some #define names to avoid name collisions on
Windows that cause compiler warnings.

svn path=/trunk/; revision=6129
2002-08-29 19:05:41 +00:00
Richard Sharpe 0934975cc1 Guided by Guy and an examination of RFC2078 and RFC2478, I have added some
comments about what we need to do to get SPNEGO properly implemented.

More work to do.

svn path=/trunk/; revision=6121
2002-08-29 05:26:45 +00:00
Richard Sharpe e0523f9acb Fix up dissect_file_attributes
svn path=/trunk/; revision=6119
2002-08-29 00:35:55 +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 9aaf4916af Expand on a note in a comment.
svn path=/trunk/; revision=6085
2002-08-25 22:57:26 +00:00
Tim Potter 66bc3e597f These guys got lost in a merge. Actually call the gssapi dissector from
the relevant parts of the SMB and DCERPC dissectors.

svn path=/trunk/; revision=6066
2002-08-22 20:04:55 +00:00
Richard Sharpe 4b66eaac73 First part of support for Thursby's Mac extenstions from CIFS2002.
svn path=/trunk/; revision=6058
2002-08-22 06:47:08 +00:00
Guy Harris 1ae796de00 Limit the parameter and data tvbuffs to the actual number of bytes of
parameter and data, so the LANMAN RAP pipe dissector, for example,
doesn't get confused and think there is an auxiliary data descriptor in
the parameters when there isn't.

Note that in at least one Negotiate Protocol reply it looks as if a
Unicode domain name might've been aligned.

svn path=/trunk/; revision=6017
2002-08-19 10:53:21 +00:00
Ronnie Sahlberg 159e4ff083 Added server name to negprot reply and fixed a pointer deferral problem.
svn path=/trunk/; revision=5980
2002-08-13 02:14:39 +00:00
Guy Harris 2cfb231081 From Devin Heitmueller: dissect NTLMSSP authentication messages, and handle
the flags field in NTLMSSP messages as a 32-bit field.

Make "get_unicode_or_ascii_string()" take a "Unicode or not" flag rather
than a "packet_info *" as an argument, make it not static, and move it
to "packet-smb-common.c", so that it can be used by the SMB dissector
and the NTLMSSP dissector.  Also get rid of some _U_'s that are applied
to arguments that are, in fact, used.

svn path=/trunk/; revision=5976
2002-08-10 21:15:37 +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 6653e18eb2 Typo fix.
svn path=/trunk/; revision=5959
2002-08-06 19:02:24 +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 af6da1a420 Changed the SMB dissector to put ALL command PDUs in one SMB in the summary
line, separated by ;

It only prints "Request"/"Response" for the first command to save space

svn path=/trunk/; revision=5907
2002-07-27 05:03:53 +00:00
Ronnie Sahlberg 0fa3c02231 If conversations have already been created in lower layers, say TCP before
SMB sees the PDU, then SMB would forget to create the proper state variables and crash.

SMB is changed to split the operation into
1, only create a conversation if it needs to. (as before)
2, detect if it needs to create the si.ct state variables independant of
whether smb also created a conversation or not.

Without this patch and with changes to say TCP to create conversations ethereal would crash at the first packet the SMB dissector would see.

svn path=/trunk/; revision=5906
2002-07-27 03:18:29 +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
Tim Potter 784204a500 Fixed up some warnings.
svn path=/trunk/; revision=5862
2002-07-13 04:32:14 +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
Ronnie Sahlberg 31823cb851 Added show_fragment_tree() to reassemble. This function will do the common
task of creating a fregment tree for the fragmented packets.
Having this identical code to create this tree in every dissector that does
PDU reassembly is a huge waste and duplication of code.

Updated IP, SMB and DCERPC to use the new function.

svn path=/trunk/; revision=5626
2002-06-05 11:21:49 +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
Ronnie Sahlberg c9f2880cff Another small DCERPC interface from the winsows world implemented. TAPI.
svn path=/trunk/; revision=5608
2002-06-02 12:32:10 +00:00
Guy Harris 1504346601 SMB 0x31 is "Close And Tree Disconnect", not "Close And Tree Discover",
and it looks like "Close" (it's a close that also disconnects the tree
used for the SMB).

svn path=/trunk/; revision=5603
2002-05-30 11:29:38 +00:00
Guy Harris 2a8dfde425 Display unsigned quantities with "%u".
svn path=/trunk/; revision=5592
2002-05-29 19:55:55 +00:00
Guy Harris 37c5eef9cb Put back the stuff to dissect the last 2 bytes of
TRANS2_SET_FILE_INFORMATION parameters as reserved.

Change/add comments to reflect information from Microsoft Networks SMB
File Sharing Protocol Extensions Version 3.0, Document Version 1.11,
July 19, 1990.

svn path=/trunk/; revision=5568
2002-05-26 09:47:47 +00:00
Guy Harris 130b2e755a Fix "dissect_unknown()" to properly step through the word and byte
parameters.

svn path=/trunk/; revision=5567
2002-05-26 01:42:48 +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
Guy Harris e2a33ae644 Add messaging SMBs.
Fix a typo.

svn path=/trunk/; revision=5563
2002-05-25 12:33:59 +00:00
Ronnie Sahlberg c33e33fb7e Additions to the MAPI dissector. Function 02 for MAPI.
The function request/call are dissected but the main body of the function
in/out parameters consists of a unidimensional conformant and varying array of bytes which content is encrypted/obfuscated.
Whoever can tell me how to decrypt/unobfuscate these bytes will get
a case of VB next time in Sydney.

svn path=/trunk/; revision=5532
2002-05-23 12:23:29 +00:00
Guy Harris 529e38321f From Andrew Esh: support for additional interest levels in
TRANS2_QUERY_FS_INFORMATION, and fix handling of level 1022 to treat the
file name as always being in Unicode.

svn path=/trunk/; revision=5494
2002-05-16 23:36:43 +00:00
Guy Harris 870c706685 From Andrew Esh: support for interest level 1003 and 1007 in
TRANS2_QUERY_FS_INFORMATION.

svn path=/trunk/; revision=5477
2002-05-15 19:37:26 +00:00
Guy Harris 42c395b0e2 Update the URL and comment for the SNIA CIFS spec, now that it's final.
svn path=/trunk/; revision=5440
2002-05-10 22:09:24 +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 a06dd1c724 From Joerg Mayer: get rid of unused "pinfo" argument to
"dissect_nt_sec_desc()".

Also, get rid of code to handle lengths of -1 in "dissect_nt_sec_desc()"
- we never pass it a length of -1, as security descriptors aren't sent
over the wire with NDR syntax.

svn path=/trunk/; revision=5317
2002-04-30 23:48:15 +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 d61cb7942d There's no need to allocate and fill in an array of sub-authorities and
then later construct the sub-authority string from that array; we can
just construct the string as we fetch the sub-authorities.

Given that we're doing that, use the cleanup handler to free the string,
so that we don't leak memory if we throw an exception when fetching the
RID, for example.

svn path=/trunk/; revision=5294
2002-04-29 10:23:04 +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 8c5b9c06e8 Put in a note about the "primary domain" in the Negotiate Protocol
response if the negotiated dialect is Windows for Workgroups 3.1a.

svn path=/trunk/; revision=5264
2002-04-28 01:19:27 +00:00
Guy Harris d9d5677510 Fix the test in "dissect_smb_datetime()" for "no date/time specified"
values.

Note that in a Negotiate Protocol response, the primary domain won't be
present if the negotiated dialect isn't "DOS LANMAN 2.1" or "LANMAN2.1".

At least for Info Standard replies for Transaction2 Find First2
requests, if the request had the "return resume keys" flag set, the
reply will have a resume key at the beginning of each entry.  We assume
that to be the case for Info Query EA Size and Info QUery EAs From List;
it does *not* appear to be the case for Find File Directory Info, Find
File Full Directory Info, or Find File Both Directory Info (they don't
have it even if the flag is set, at least in the captures I've seen).

The length of the name string in Find First2 entries doesn't include the
terminating '\0'; count that as well.

svn path=/trunk/; revision=5259
2002-04-27 21:23:48 +00:00
Tim Potter 0aaf9da3fe Sometimes there is some junk at the end of an ACE so use the size field
within the ACE to work out where the end is.

svn path=/trunk/; revision=5235
2002-04-24 07:19:25 +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
Guy Harris 80078ecbf4 Clean up the descriptions of reassembly preferences.
svn path=/trunk/; revision=5230
2002-04-23 19:19:57 +00:00
Guy Harris d8110d00ad Support for NT Rename SMB, from Steven French.
svn path=/trunk/; revision=5217
2002-04-22 06:26:08 +00:00
Guy Harris 14caf2a9a5 Fix the return value of "dissect_nt_sec_desc()".
svn path=/trunk/; revision=5213
2002-04-22 01:54:51 +00:00
Guy Harris 677ad9ee25 Correctly dissect LSA security descriptors, at least as they appear
inside a Netlogon security descriptor.

Correctly dissect NT security descriptors as they appear inside an LSA
security descriptor (at least as those appear inside a Netlogon security
descriptor) - they get sent over the wire, apparently, as an opaque blob
from the point of view of DCE RPC, at least from one capture I've seen,
they do *not* get sent over the wire in DCE RPC NDR syntax.

svn path=/trunk/; revision=5212
2002-04-22 01:07:19 +00:00
Ronnie Sahlberg 1e24ac236f Bugfixes for LSA dissector and a small change to the security_descriptor dissector in packet-smb.c so we can call it from DCERPC NDR encoded services.
svn path=/trunk/; revision=5194
2002-04-17 15:11:30 +00:00
Guy Harris 827426c4d1 Do the standard "next entry offset" stuff in NT NOTIFY replies, so as to
1) handle inter-entry padding;

	2) quit when the "next entry offset" is 0 (that being the signal
	   for the last entry).

svn path=/trunk/; revision=5171
2002-04-16 02:42:24 +00:00
Tim Potter 86a0e134e0 Fixed two instances where si->sip was being not checked for NULL before
being dereferenced.

svn path=/trunk/; revision=5137
2002-04-09 23:56:57 +00:00
Gilbert Ramirez 5c10ad55a8 More static-ization.
svn path=/trunk/; revision=5131
2002-04-08 20:30:56 +00:00
Ronnie Sahlberg 25972db6bb copylen should be unsigned when we check the range since tvb_memcpy will be upset if a negative value is passed as len
svn path=/trunk/; revision=5044
2002-03-29 21:55:05 +00:00
Guy Harris bacadc18cd The Unicode Consortium's country code table has been updated to
incorporate the fixes I sent them, so it now matches what we have.

svn path=/trunk/; revision=5032
2002-03-27 20:58:43 +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
Guy Harris 807bf4ead2 The Unicode Consortium's table has some errors in it; fix those errors
in our table.

svn path=/trunk/; revision=5023
2002-03-26 08:23:58 +00:00
Guy Harris f4bbdc9bc3 The Cygwin "winnls.h" header, and the Microsoft "winnls.h" headers, says
that a country code of 0 is for the "default", presumably meaning "don't
override the setting on the desktop machine" or something such as that.

svn path=/trunk/; revision=5015
2002-03-25 20:01:13 +00:00
Guy Harris b25cfdba75 When dissecting an SID with more than 4 authorities, increment the
offset to go past the last authority (the RID).

svn path=/trunk/; revision=4991
2002-03-20 07:55:51 +00:00
Guy Harris 4d52bb3267 Handle Read operations on IPC trees as DCE RPC.
svn path=/trunk/; revision=4989
2002-03-20 06:51:14 +00:00
Richard Sharpe e2f5d92cb8 Express the RID separately of more than 4 sub-authorities. It is always the
last sub-authority.

svn path=/trunk/; revision=4988
2002-03-19 23:14:39 +00:00
Guy Harris 031c4ec27f Treat WriteAndX operations on IPC trees as containing DCERPC call
information, just as is done for Write.

Squelch a compiler warning.

svn path=/trunk/; revision=4987
2002-03-19 22:12:03 +00:00
Ronnie Sahlberg 84806766db Tiny quota updates
svn path=/trunk/; revision=4980
2002-03-19 10:16:40 +00:00
Ronnie Sahlberg 0c7d8b3b30 Quota updates. GetUserQuota implemented and support for list of userquota structures
svn path=/trunk/; revision=4970
2002-03-18 09:45:27 +00:00
Ronnie Sahlberg fd54563f5b Add dissection of one more bit in Quota FS Flags bitmask
svn path=/trunk/; revision=4969
2002-03-18 08:34:18 +00:00
Ronnie Sahlberg 7f50e21a7e quota update partial NTGetUserQuota support
svn path=/trunk/; revision=4964
2002-03-17 12:16:11 +00:00
Ronnie Sahlberg 7fa1fcaaba Partial dissection of NT Set User Quota data block
svn path=/trunk/; revision=4963
2002-03-17 11:59:36 +00:00
Ronnie Sahlberg e9bd31fdbd SMB Quota updates
svn path=/trunk/; revision=4962
2002-03-17 11:24:16 +00:00
Ronnie Sahlberg 6ac7d7f7ac Updates for NT QUOTA in packet-smb.c
svn path=/trunk/; revision=4961
2002-03-17 10:59:35 +00:00
Guy Harris fcf8cd8807 The service is just called "IPC"; the pipe is what's called "IPC$".
svn path=/trunk/; revision=4957
2002-03-16 22:39:45 +00:00
Guy Harris 949b2d4131 Whether the data returned from a read or sent in a write is DCERPC
traffic or not, that data doesn't include the padding; handle padding
if you're dissecting it as DCERPC traffic.

Don't treat the traffic as DCERPC traffic unless it's to the IPC$ share.

svn path=/trunk/; revision=4956
2002-03-16 22:35:51 +00:00
Guy Harris 0b60f086ef There is no guarantee that, when processing an SMB response, "si->sip"
is non-null, as there's no guarantee that the corresponding SMB request
is in the capture.  Check whether it's null before using it.

svn path=/trunk/; revision=4954
2002-03-16 22:01:27 +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
Richard Sharpe 9693b93085 Pretty up the SID dissector ...
svn path=/trunk/; revision=4948
2002-03-15 19:47:03 +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 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
Guy Harris a8e949c74d From Ronnie Sahlberg: reassemble transaction data if transaction
continuations are seen.

svn path=/trunk/; revision=4272
2001-11-26 09:58:38 +00:00
Guy Harris ac16b7463b Assorted changes from Ronnie Sahlberg:
Add a few small functions to reassemble.c to cope with protocols
	where the total length of defragmented PDUs are specified in the
	first fragment (all previous uses of reassembly has been for
	PDUs where the last fragment is signalled by a flag in the
	header for the last fragment).

	Add a few small functions to reassemble.c to abort-and-delete
	defragmentation of PDUs and also detect IF a PDU is currently
	being defragmented.  (Useful for PDUs where the "unique"
	identifier is rather ununique, or may be reused often enough so
	it can be a problem for Ethereal.)

	Change where NT Cancel presents its Cancelation-to output, and
	makes the three trans secondary requests also output similar
	information.

svn path=/trunk/; revision=4255
2001-11-24 09:36:40 +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 daef7e962d Support for Transaction Secondary and Transaction2 Secondary, from
Ronnie Sahlberg.

svn path=/trunk/; revision=4243
2001-11-21 06:04:39 +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 3c11e4ff6d From Ronnie Sahlberg: handle transaction continuations the way we handle
NT Cancel, as transaction continuations don't get a response, either.

svn path=/trunk/; revision=4230
2001-11-20 08:18:01 +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 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 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