Commit Graph

255 Commits

Author SHA1 Message Date
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
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 37f355caf5 Show the Capabilities field in a Session Setup and X request as a 32-bit
value.

Put in a comment noting what may be *another* bug in some versions of
Windows when constructing Session Setup and X requests.

svn path=/trunk/; revision=3871
2001-08-27 07:56:49 +00:00
Guy Harris 1e55187184 Show buffer formats symbolically as well as numerically.
svn path=/trunk/; revision=3870
2001-08-27 06:18:24 +00:00
Guy Harris 5c87d84946 Fix a number of SMB dissectors to correctly handle ASCII and Unicode
strings, based on whether the "strings are Unicode" bit is set in the
SMB header or not.

svn path=/trunk/; revision=3869
2001-08-27 05:52:06 +00:00
Guy Harris 44fb959e81 Make a routine to handle fetching strings that are Unicode or ASCII
depending on the setting of the "Strings are Unicode" bit in the SMB.

Correctly handle Unicode strings in Session Setup and X and Tree Connect
and X messages.

Always display the Word Count and Byte Count fields of a Session Setup
and X message, regardless of whether we recognize the word count value
as one we can handle or not.

Correctly handle Session Setup and X messages if extended security
exchanges are being used.

Decode the (known) bits of the Action field in an Session Setup and X
message, and the (known) bits of the optional flags field of a Tree
Connect and X message.  Show the optional flags field as a 16-bit hex
quantity.

svn path=/trunk/; revision=3868
2001-08-27 04:45:39 +00:00
Guy Harris 9afbcb1f2c Fix a typo in a comment.
svn path=/trunk/; revision=3842
2001-08-11 19:15:35 +00:00
Guy Harris 46e333674c In the Info column for transaction responses for which we don't have the
matching request, or for responses where we don't have the
pathname/transaction code of the matching request, indicate the SMB
opcode of the transaction, rather than just saying it's a response to a
generic message.

svn path=/trunk/; revision=3841
2001-08-11 18:33:22 +00:00
Guy Harris 97fd776acf If the matching request for a transaction reply wasn't found, so that we
don't know the path name, don't give up, just show the parameters and
data, as is done with transactions that aren't mailslot browser
transactions or LANMAN RAP pipe transactions.

svn path=/trunk/; revision=3840
2001-08-11 18:26:03 +00:00
Guy Harris 3f88a3a881 Display padding and data fields in transaction requests/replies as hex,
not as text; it's rarely, if ever, pure text.

svn path=/trunk/; revision=3839
2001-08-11 17:46:06 +00:00
Guy Harris 9ed0eb9882 Squelch a compiler warning.
svn path=/trunk/; revision=3838
2001-08-11 17:31:13 +00:00
Richard Sharpe 0046494f94 Change the SMB header to being a separate break-out tree ...
Next, on to tvbuffify etc the others...

svn path=/trunk/; revision=3836
2001-08-11 13:50:11 +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 95056acbba The MID in an SMB message is not a transaction ID in, say, the ONC RPC
sense; instead, it's a "multiplex ID" used when there's more than one
request *currently* in flight, to distinguish replies.

This means that the MID and PID don't uniquely identify a request in
a conversation.

Therefore, we have to use some other value to distinguish between
requests with the same MID and PID.

Add a mechanism to do so.

svn path=/trunk/; revision=3829
2001-08-06 00:59:14 +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 d271509c7e Use the #define SMB_FLAGS_DIRN, rather than its numerical value, when
testing the request/response flag.

svn path=/trunk/; revision=3823
2001-08-05 00:30:41 +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 166c1fd900 Always initialize the "last_transact_command", "last_param_descrip", and
"last_data_descrip" fields of an "smb_request_val" structure to null
when you allocate it, so that, when the hash table is cleaned out, we
don't try handing random junk to "g_free()".

svn path=/trunk/; revision=3811
2001-08-02 09:37:27 +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
Guy Harris 8b1df43d92 When looking for the request that matches a reply, match the PID as well
as the MID and the conversation index; the current CIFS spec from the SNIA
Web site says

	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.

(although, in practice, at least as I remember from working on the
NetApp CIFS server N years ago, Windows clients tend to use the same PID
in all requests, so only the MID acts as a transaction ID).

When initializing the dissector, free up all the data attached to
"smb_request_val" structures in the request hash table before destroying
the hash table and the structures in question.

svn path=/trunk/; revision=3809
2001-08-02 08:48:46 +00:00
Guy Harris f56c5b5333 Make some variables and routines not used outside "packet-smb.c" static.
Show the parameters, data, and padding in transact/transact2 SMBs as
hex, not text; it's usually binary.

"dissect_transact_params()" returns immediately if TransactName is null,
so we don't need to check whether it's null when copying it; just use
"g_strdup()" to copy it.

svn path=/trunk/; revision=3808
2001-08-02 08:08:12 +00:00
Guy Harris bbb52d060b Put in some checks to make sure we're not running past the end of the
packet; this is far from a complete set of checks - the right way to
make this dissector safe is to tvbuffify it - but it's sufficient to
eliminate most cases where my regression tests bogusly reported that the
packet was dissected differently due to different stuff being past the
end of the packet.

svn path=/trunk/; revision=3807
2001-08-02 07:16:05 +00:00
Guy Harris 2997acf2cc Parameters to Transact and Transact2 calls are usually binary, not pure
text; display them with "bytes_to_str()", not "format_text()".

svn path=/trunk/; revision=3798
2001-07-30 07:36:28 +00:00
Guy Harris eb5031e9df Handle Negotiate Protocol replies with the "extended security"
capability flag set.

svn path=/trunk/; revision=3579
2001-06-20 01:58:48 +00:00
Guy Harris 8412393197 From Joerg Mayer: explicitly fill in all members of a
"header_field_info" structure, including the ones that are later set by
the routines to register fields.

svn path=/trunk/; revision=3561
2001-06-18 02:18:27 +00:00
Guy Harris 4d99343d8b Fix a typo.
svn path=/trunk/; revision=3518
2001-06-05 23:40:34 +00:00
Guy Harris eee7f58e2d Fix up a cast so that it properly sign-extends the server time zone;
from Joerg Mayer.

svn path=/trunk/; revision=3427
2001-05-20 22:26:14 +00:00
Guy Harris 2c109432a2 Put in a note about the use of some currently-undissected fields in the
SMB header, as per a Microsoft document.

svn path=/trunk/; revision=3149
2001-03-20 04:46:37 +00:00
Guy Harris b8289288e8 Correctly handle Interim responses to TRANSACTION requests.
Move the declaration of routines exported from "packet-smb-mailslot.c"
into a "packet-smb-mailslot.h" header file, and have modules that import
those routines include "packet-smb-mailslot.h" rather than declaring the
routines themselves; do the same for routines exported from
"packet-smb-pipe.c".  Make routines not exported static, and make
routines that return a true/false return value "gboolean" rather than
"guint32".

svn path=/trunk/; revision=3146
2001-03-18 03:23:30 +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
Gilbert Ramirez 5b7f184296 Ensure that all value_string arrays end in {0, NULL}. Dissectors got away
with not terminating their arrays because they knew the limits of the
value used to look up strings in the value_string array, but the
dfilter_expr_dlg does not know these limits and must rely on the terminating
{0, NULL} record.

Also, in SNA fixed a bug in which a field should have been defined as FT_UINT8
but was defined as FT_BOOLEAN.

In WTP, fixed a value string which had duplicate keys.

svn path=/trunk/; revision=2817
2001-01-03 16:41:08 +00:00
Guy Harris 0e7c1de08a Have "proto_register_protocol()" build a list of data structures for
protocols, in addition to adding structures to the list of filterable
fields.  Give it an extra argument that specifies a "short name" for the
protocol, for use in such places as

	pinfo->current_proto;

	the dialog box for constructing filters;

	the preferences tab for the protocol;

and so on (although we're not yet using it in all those places).

Make the preference name that appears in the preferences file and the
command line for the DIAMETER protocol "diameter", not "Diameter"; the
convention is that the name in question be all-lower-case.

Make some routines and variables that aren't exported static.

Update a comment in the ICP dissector to make it clear that the
dissector won't see fragments other than the first fragment of a
fragmented datagram.

svn path=/trunk/; revision=2810
2001-01-03 06:56:03 +00:00
Richard Sharpe 8c47761ae4 Patches to prevent problems under Windows when time formats are negative.
Make sure that if _gtime is null, a bad format message returned.

Also noticed that I am going to have to do something about Unicode strings soon and the SMBopenX dissect is slightly wrong ... Oh well, it is the Xmas break soon :-) No rest for the Wicca'd (please don't interpret that as a statement of my religious affiliation, it is just a cute saying :-)

svn path=/trunk/; revision=2764
2000-12-17 03:48:44 +00:00
Richard Sharpe 07f065e61a Apply Jeroen Ruigrok van der Werven's patches ...
svn path=/trunk/; revision=2699
2000-11-22 21:19:38 +00:00
Guy Harris 252d55d80f For each column, have both a buffer into which strings for that column
can be put, and a pointer to the string for the column, which might or
might not point to that buffer.

Add a routine "col_set_str()", which sets the string for the column to
the string passed to it as an argument; it should only be handed a
static string (a string constant would be ideal).  It doesn't do any
copying, so it's faster than "col_add_str()".

Make the routines that append to columns check whether the pointer to
the string for the column points to the buffer for the column and, if
not, copy the string for the column to the buffer for the column so that
you can append to it (so you can use "col_set_str()" and then use
"col_append_str()" or "col_append_fstr()").

Convert a bunch of "col_add_str()" calls that take a string constant as
an argument to "col_set_str()" calls.

Convert some "col_add_fstr()" calls that take a string constant as the
only argument - i.e., the format string doesn't have any "%" slots into
which to put strings for subsequent arguments to "col_set_str()" calls
(those calls are just like "col_add_str()" calls).

Replace an END_OF_FRAME reference in a tvbuffified dissector with a
"tvb_length(tvb)" call.

svn path=/trunk/; revision=2670
2000-11-19 08:54:37 +00:00
Guy Harris 563f86ee5e Support for conversations with "wildcard" destination addresses, from
Jeff Foster.

svn path=/trunk/; revision=2523
2000-10-21 05:52:28 +00:00
Gilbert Ramirez 9941aabd64 Move format_text(), get_token_len(), and fine_line_end(), into strutil.c
This keeps tvbuff.c generic; it doesn't have to pull in packet.h and all
of it's included files.

svn path=/trunk/; revision=2409
2000-09-11 16:16:13 +00:00
Laurent Deniel cc36f0b931 Add the "Edit:Protocols..." feature which currently only implements
the following:

It is now possible to enable/disable a particular protocol decoding
(i.e. the protocol dissector is void or not). When a protocol
is disabled, it is displayed as Data and of course, all linked
sub-protocols are disabled as well.

Disabling a protocol could be interesting:

- in case of buggy dissectors
- in case of wrong heuristics
- for performance reasons
- to decode the data as another protocol (TODO)

Currently (if I am not wrong), all dissectors but NFS can be disabled
(and dissectors that do not register protocols :-)

I do not like the way the RPC sub-dissectors are disabled (in the
sub-dissectors) since this could be done in the RPC dissector itself,
knowing the sub-protocol hfinfo entry (this is why, I've not modified
the NFS one yet).

Two functions are added in proto.c :

gboolean proto_is_protocol_enabled(int n);
void proto_set_decoding(int n, gboolean enabled);

and two MACROs which can be used in dissectors:

OLD_CHECK_DISPLAY_AS_DATA(index, pd, offset, fd, tree)
CHECK_DISPLAY_AS_DATA(index, tvb, pinfo, tree)

See also the XXX in proto_dlg.c and proto.c around the new functions.

svn path=/trunk/; revision=2267
2000-08-13 14:09:15 +00:00
Richard Sharpe 73e093e7e7 A small set of patches to fix one small problem and start working on the
filtering in packet-smb.c ...

svn path=/trunk/; revision=2220
2000-08-07 14:49:03 +00:00
Richard Sharpe 3d80db01df A small change to SMB dissector so it lists near the other SMB-related
dissectors when you do 'ethereal -G' ...

svn path=/trunk/; revision=2180
2000-07-30 14:35:39 +00:00
Guy Harris 283ce59938 Add routines for adding items to a protocol tree that take arguments of
a particular type, rather than taking a varargs list, along the lines of
the "proto_tree_add_XXX_format()" routines.

Replace most calls to "proto_tree_add_item()" and
"proto_tree_add_item_hidden()" with calls to those routines.

Rename "proto_tree_add_item()" and "proto_tree_add_item_hidden()" to
"proto_tree_add_item_old()" and "proto_tree_add_item_hidden_old()", and
add new "proto_tree_add_item()" and "proto_tree_add_item_hidden()"
routines that don't take the item to be added as an argument - instead,
they fetch the argument from the packet whose tvbuff was handed to them,
from the offset handed to them.

svn path=/trunk/; revision=2031
2000-05-31 05:09:07 +00:00
Guy Harris f90bbf2a5a Assorted enhancements from Mark Burton.
svn path=/trunk/; revision=2000
2000-05-25 08:38:54 +00:00
Guy Harris f937a5d86f Assorted padding fixes from Mark Burton.
svn path=/trunk/; revision=1999
2000-05-25 08:32:13 +00:00
Gilbert Ramirez 292e38e2c6 Add tvbuff class.
Add exceptions routines.
Convert proto_tree_add_*() routines to require tvbuff_t* argument.
Convert all dissectors to pass NULL argument ("NullTVB" macro == NULL) as
the tvbuff_t* argument to proto_tree_add_*() routines.

dissect_packet() creates a tvbuff_t, wraps the next dissect call in
a TRY block, will print "Short Frame" on the proto_tree if a BoundsError
exception is caught.

The FDDI dissector is converted to use tvbuff's.

svn path=/trunk/; revision=1939
2000-05-11 08:18:09 +00:00
Guy Harris 9bd27d3471 Andreas Sikkema's patch to make the SMB dissector not blithely pass a
null "request_val->last_transact_command" to "col_add_fstr()".

svn path=/trunk/; revision=1738
2000-03-21 10:15:50 +00:00
Gilbert Ramirez e29f2705bf Change dfilter_init() to check for empty-string abbreviations and for
duplicate abbreviations. All mods to packet-*.c files are fixes to remove
those cases.

svn path=/trunk/; revision=1733
2000-03-20 22:52:48 +00:00
Guy Harris 8c200212c7 Fix some "proto_tree_add_text()" calls.
svn path=/trunk/; revision=1695
2000-03-06 20:04:53 +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 5b5f2271cd "tm_mon" in a "struct tm" is 0-based, not 1-based; when printing the
month number, add 1 to "tm_mon".

svn path=/trunk/; revision=1519
2000-01-22 02:00:27 +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 90293644a3 Don't take strlen of TransactName if NULL. In fact, don't do *anything*
and return if TransactName == NULL.

svn path=/trunk/; revision=1431
2000-01-07 04:27:06 +00:00
Guy Harris c8716decab Patch from Greg Kilfoyle of Redback Networks:
Don't use a global variable named "gmtime" - some versions of
	NetBSD define it in <time.h> - use "_gmtime" instead, so we can
	build on those NetBSD systems.

svn path=/trunk/; revision=1375
1999-12-23 20:47:16 +00:00
Richard Sharpe bcc9362c47 Latest patches for SMB decodes ... This fixes the bug in large NetServerEnum2
responses and adds some more stuff.


I will have to decode NTcreateAndX requests and responses soon as well
as the MSRPC stuff ...

svn path=/trunk/; revision=1356
1999-12-18 13:39:03 +00:00
Richard Sharpe f65a512676 More patches for packet-smb.c ...
Now should be decoding the names of lots more LanMan API request. These
were culled from Samba.  Would be good to go through and give names to the
fields as well.

Will soon decode the response structures returned and then will look at
ways to specify that built-in routines should be called to decode an element.

I also need some captures with UNICODE in them. Anyone got any? Someone
sent in a patch for UNICODE handling, but I did not realize what it was and
now the code has diverged so far it is hard to apply the patch ...

Send captures to rsharpe@ns.aus.com./

svn path=/trunk/; revision=1334
1999-12-14 23:16:59 +00:00
Richard Sharpe 3216e87029 Fixed up the problems with compilation warnings, as per some patched
from Guy, plus a few more of my own.

Also added in basic response decoding where we don't know what it is ...

Got more to do, as well as decoding returned data ... Thinking about that
now, and will have a data-drived approach.

I need some way to specify that an internal routine be called for some types
of data where we know what type it is, in the case of Server Types for
example ...

svn path=/trunk/; revision=1294
1999-12-12 02:19:00 +00:00
Olivier Abad a55ed83646 Fixed a typo (tee instead of tree) in dissect_transact_next
svn path=/trunk/; revision=1284
1999-12-10 12:51:01 +00:00
Richard Sharpe df0decde2f Beginning to handle LANMAN in a data-driven way, with tables etc.
Next will handle responses, and data returned ...

svn path=/trunk/; revision=1283
1999-12-10 11:53:18 +00:00
Richard Sharpe bbc7e6afbc Here I am commit'ing again in a Qantas Club lounge :-)
Fixed up some bugs to do with NetShareEnum.  There is still a persistent bug
left that looks like an alignment problem. Damn documentation does not talk
about the need to align the response structures for a NetServerEnum2 on SHORT
boundaries, but it sure looks like they should be so.

svn path=/trunk/; revision=1235
1999-12-07 06:36:12 +00:00
Richard Sharpe 7a41e5568f Some small fixes to the smb decoding of sessionsetup&X.
Will have to do some more soon.

svn path=/trunk/; revision=1216
1999-12-05 08:22:22 +00:00
Gilbert Ramirez de6c24bdb6 Check sanity of EntCount in lanman decode before going off and
marking 26 * EntCount bytes as Server entries.

svn path=/trunk/; revision=1160
1999-11-30 03:46:46 +00:00
Richard Sharpe b09955d91d Fixed the problem of crashing when a NetServerEnum2 with Level 0 is
seen.

svn path=/trunk/; revision=1122
1999-11-27 02:17:49 +00:00
Richard Sharpe 7d7b0fbdbd Fixed the problem causing a SIGSEGV, and fixed problems with
UNICODE strings in transact SMBs.

Added decode of NetShareEnum transact request.  Will have to clean that all
up and use the decode engine when I get it done.

Still more fix ups to be done, but the book is calling, and I have to write
some stuff after an interview with LinuxCare.

svn path=/trunk/; revision=1113
1999-11-26 06:27:22 +00:00
Richard Sharpe a90cb04447 Some more fixups. Decode NetServerEnum2 responses, removed those
ugly wannings, and added start of general params decode.  May all change
drastically though.

svn path=/trunk/; revision=1093
1999-11-22 10:30:22 +00:00
Laurent Deniel eb65d4fdb9 Remove debugging printf.
svn path=/trunk/; revision=1082
1999-11-21 11:17:13 +00:00
Richard Sharpe 139cfdccda Added support or NetServerEnum2 LANMAN messages.
I still have compile warnings, but I am too tired to chase them down.

Have also fixed a number of problems.

Next thing to add is a general engine that can decode Transact messages
as they can be decode from the descriptors in the Parameters area, and I
can feed in a list of names where we know what a structure looks like,
otherwise we use made up names.

svn path=/trunk/; revision=1079
1999-11-20 13:48:26 +00:00
Richard Sharpe 71fb29b83d Added decode of the Election Criteria and a few other bits of
info.

Still need someone to look at the times I have in there ... Guy?

svn path=/trunk/; revision=1055
1999-11-18 07:32:46 +00:00
Guy Harris 781acb5043 Craig Rodrigues' fixes to let it compile on AIX using IBM's compiler
(remove commas following the last member of an enum, make all bit fields
"guint32" - GCC lets you get away with that, but at least some other
compilers don't).

svn path=/trunk/; revision=1052
1999-11-18 01:45:05 +00:00
Guy Harris 4fddc1f328 Provide a general mechanism by which dissectors can register "init"
routines, which are called before a dissection pass is made over all the
packets in a capture - the "init" routine would clear out any state
information that needs to be initialized before such a dissection pass.

Make the NCP, SMB, AFS, and ONC RPC dissectors register their "init"
routines with that mechanism, have the code that reads in a capture file
call the routine that calls all registered "init" routines rather than
calling a wired-in set of "init" routines, and also have the code that
runs a filtering or colorizing pass over all the packets call that
routine, as a filtering or colorizing pass is a dissection pass.

Have the ONC RPC "init" routine zero out the table of RPC calls, so that
it completely erases any state from the previous dissection pass (so
that, for example, if you run a filtering pass, it doesn't mark any
non-duplicate packets as duplicates because it remembers them from the
previous pass).

svn path=/trunk/; revision=1050
1999-11-17 21:58:33 +00:00
Gilbert Ramirez 36eabe2100 We should be checking the value of loc_of_slash instead of index. It
might be NULL from strchr().

svn path=/trunk/; revision=1044
1999-11-16 17:03:36 +00:00
Guy Harris a7aba0a288 Replace the ETT_ "enum" members, declared in "packet.h", with
dynamically-assigned "ett_" integer values, assigned by
"proto_register_subtree_array()"; this:

	obviates the need to update "packet.h" whenever you add a new
	subtree type - you only have to add a call to
	"proto_register_subtree_array()" to a "register" routine and an
	array of pointers to "ett_", if they're not already there, and
	add a pointer to the new "ett_" variable to the array, if they
	are there;

	would allow run-time-loaded dissectors to allocate subtree types
	when they're loaded.

svn path=/trunk/; revision=1043
1999-11-16 11:44:20 +00:00
Richard Sharpe e351b687e4 I hope no one just committed something on this.
There was a core dump because of a coding oversight.  Should be fixed
now Gilbert.

Should now handle names of form \<somepipe>

Will screw up if there is no leading slash, but in a non-fatal way, I
think.

svn path=/trunk/; revision=1041
1999-11-16 07:58:12 +00:00
Richard Sharpe cfdb8fdc2c OK,
much more complete decoding of browse messages.

They are now shown in the parent tree as well.

I still have problems with:

  1. Times
  2. Election criteral

I also haven't been able to see a BecomeBackup request, nor a
GetBackupListResp with more than one browser ... Should run a Windows NT
server or another Samba on my network.

I am also not sure of there are any more message types.  Damn! Old, and
wrong MS documents!

svn path=/trunk/; revision=1025
1999-11-14 06:54:42 +00:00
Richard Sharpe baadd1b3d7 Fixed some more small problems and added support for decoding
MS Windows Browser messages.  Can decode host announcements now.

Still need to decode more.  Also need to break the new code out.


I also have the Browse tree at the wrong location.  Can I get at the
parent of the tree somewhere, or do I have to pass it in as a variable?

svn path=/trunk/; revision=1024
1999-11-14 02:42:03 +00:00
Richard Sharpe 76710fcc54 Some general fixups and some fixes for protocol decode problems
exposed by Win2000 interacting with a Samba server ...

svn path=/trunk/; revision=1010
1999-11-11 13:56:58 +00:00
Gilbert Ramirez aad98c9a66 Added #include <time.h> for AIX.
svn path=/trunk/; revision=937
1999-10-27 19:30:23 +00:00
Richard Sharpe 454a982d3b Some small fixes to get rid of compiler warnings
svn path=/trunk/; revision=929
1999-10-26 21:30:11 +00:00
Guy Harris 1d72c68bc6 Export the data structure used to represent a conversation.
Replace "add_to_conversation()" with:

	"conversation_new()", which creates a new conversation, given
	source and destination addresses and ports, and returns a
	pointer to the structure for the conversation;

	"find_conversation()", which tries to find a conversation for
	given source and destination addresses and ports, and returns a
	pointer to the structure for the conversation if found, and a
	null pointer if not found.

Add a private data pointer field to the conversation structure, and have
"conversation_new()" take an argument that specifies what to set that
pointer to; that lets clients of the conversation code hang arbitrary
data off the conversation (e.g., a hash table of protocol requests and
replies, in case the protocol is a request/reply protocol wherein the
reply doesn't say what type of request it's a reply to, and you need
that information to dissect the reply).

svn path=/trunk/; revision=920
1999-10-24 07:27:20 +00:00
Guy Harris 047b8751f3 Generalize the "ip_src" and "ip_dst" members of the "packet_info"
structure to "dl_src"/"dl_dst", "net_src"/"net_dst", and "src"/"dst"
addresses, where an address is an address type, an address length in
bytes, and a pointer to that many bytes.

"dl_{src,dst}" are the link-layer source/destination; "net_{src,dst}"
are the network-layer source/destination; "{src,dst}" are the
source/destination from the highest of those two layers that we have in
the packet.

Add a port type to "packet_info" as well, specifying whether it's a TCP
or UDP port.

Don't set the address and port columns in the dissector functions; just
set the address and port members of the "packet_info" structure.  Set
the columns in "fill_in_columns()"; this means that if we're showing
COL_{DEF,RES,UNRES}_SRC" or "COL_{DEF,RES,UNRES}_DST", we only generate
the string from "src" or "dst", we don't generate a string for the
link-layer address and then overwrite it with a string for the
network-layer address (generating those strings costs CPU).

Add support for "conversations", where a "conversation" is (at present)
a source and destination address and a source and destination port.  (In
the future, we may support "conversations" above the transport layer,
e.g. a TFTP conversation, where the first packet goes from the client to
the TFTP server port, but the reply comes back from a different port,
and all subsequent packets go between the client address/port and the
server address/new port, or an NFS conversation, which might include
lock manager, status monitor, and mount packets, as well as NFS
packets.)

Currently, all we support is a call that takes the source and
destination address/port pairs, looks them up in a hash table, and:

	if nothing is found, creates a new entry in the hash table, and
	assigns it a unique 32-bit conversation ID, and returns that
	conversation ID;

	if an entry is found, returns its conversation ID.

Use that in the SMB and AFS code to keep track of individual SMB or AFS
conversations.  We need to match up requests and replies, as, for
certain replies, the operation code for the request to which it's a
reply doesn't show up in the reply - you have to find the request with a
matching transaction ID.  Transaction IDs are per-conversation, so the
hash table for requests should include a conversation ID and transaction
ID as the key.

This allows SMB and AFS decoders to handle IPv4 or IPv6 addresses
transparently (and should allow the SMB decoder to handle NetBIOS atop
other protocols as well, if the source and destination address and port
values in the "packet_info" structure are set appropriately).

In the "Follow TCP Connection" code, check to make sure that the
addresses are IPv4 addressses; ultimately, that code should be changed
to use the conversation code instead, which will let it handle IPv6
transparently.

svn path=/trunk/; revision=909
1999-10-22 07:18:23 +00:00
Laurent Deniel 039bb4fbd8 Remove #define DEBUG_SMB_HASH
Is this file generated code ?

If not, please :

- get rid of compilation warnings
- put the # of preprocessor macros at the first column

svn path=/trunk/; revision=863
1999-10-16 20:26:37 +00:00
Richard Sharpe f646f88a5e Completed first pass of state keeping code in packet-smb.c.
Added decoder for transact SMBs.

Changed things a lot for state keeping.

Next thing is to decode transacts and transact2s more.

svn path=/trunk/; revision=860
1999-10-16 16:02:46 +00:00
Richard Sharpe 42b64a7584 Big bunch of fixes to packet-smb.c for things I need.
Also added first pass of state keeping. I am using glib's hash
functions.

Modelled after packet-ncp.c.

We will need to standardize the <proto>_init_protocol functions called in
file.c at some stage ...

I will have a couple of more goes at the state keeping before I am finished.
At the moment, the infrastructure is there but I do nothing with it.

svn path=/trunk/; revision=798
1999-10-10 11:50:45 +00:00
Guy Harris 06494664b0 "gmtime()" takes a pointer to a "time_t", not a pointer to a "guint32",
as an argument.  ("time_t" could be 64 bits - I think it is 64 bits on
some platforms, e.g.  Alpha Linux - and it's typically signed rather
than unsigned.)

svn path=/trunk/; revision=760
1999-10-03 05:01:56 +00:00
Richard Sharpe 776a369f1a A bunch of fixes for SMB decode.
1. Fix some silly errors.
  2. Dont decode beyond Word Count if errcode > 0
  3. Decode a bunch mode SMBs

Next is to keep state so we can do a better job ...

svn path=/trunk/; revision=758
1999-10-03 01:14:33 +00:00
Guy Harris 96e79ab6f8 Add a "BYTES_ARE_IN_FRAME()" macro, to test whether there are a
specified number of bytes of captured data in the frame at the specified
offset, and a "IS_DATA_IN_FRAME()" macro, to test whether there are any
bytes of captured data in the frame at the specified offset, and convert
some bounds checks to use them.

Add a dissector for the Internet Printing Protocol.

svn path=/trunk/; revision=685
1999-09-17 05:56:58 +00:00
Guy Harris f93c76fd10 Convert a bunch of uses of "fd->cap_len" to use "pi.captured_len" (or to
use END_OF_FRAME), so that they don't look at stuff in an IP datagram
past the end of the IP datagram (i.e., frame padding).

svn path=/trunk/; revision=584
1999-08-26 07:34:43 +00:00
Gilbert Ramirez cb1e32da97 Removed unnecessary #include "etypes.h" lines.
svn path=/trunk/; revision=565
1999-08-24 17:26:16 +00:00
Guy Harris ac4f87218d Declare the "packet_info" structure "pi" in "packet.h", rather than in a
bunch of source files.

Replace the "payload" field of a "packet_info" structure with "len" and
"captured_len" fields, which contain the total packet length and total
captured packet length (including all headers) at the current protocol
layer (i.e., if a given layer has a length field, and that length field
says its shorter than the length we got from the capture, reduce the
"pi.len" and "pi.captured_len" values appropriately).  Those fields can
be used in the future if we add checks to make sure a field we're
extracting from a packet doesn't go past the end of the packet, or past
the captured part of the packet.

Get rid of the additional payload argument to some dissection functions;
use "pi.captured_len - offset" instead.

Have the END_OF_FRAME macro use "pi.captured_len" rather than
"fd->cap_len", so that "dissect the rest of the frame" becomes "dissect
the rest of the packet", and doesn't dissect end-of-frame padding such
as padding added to make an Ethernet frame 60 or more octets long.  (We
might want to rename it END_OF_PACKET; if we ever want to label the
end-of-frame padding for the benefit of people curious what that extra
gunk is, we could have a separate END_OF_FRAME macro that uses
"fd->cap_len".)

svn path=/trunk/; revision=506
1999-08-18 00:57:54 +00:00
Gilbert Ramirez 7bd6c15378 Made the protocol (but not the fields) use the new proto_tree routine,
allowing users to filter on the existence of these protocols. I also
added packet-clip.c to the Nmake makefile.

svn path=/trunk/; revision=402
1999-07-29 05:47:07 +00:00
Gilbert Ramirez 02fe5e7d57 Got rid of ipv6 compiler warnings when compiling on RedHat 6.0.
Initialized AndXCommand to 0 in packet-smb.c just to get rid of compiler
warning about 'possibly used uninitialized'.

svn path=/trunk/; revision=382
1999-07-23 15:08:25 +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
Richard Sharpe 87be6de734 Some more updates. Now have open_andx decoded mostly ... Still some funnies
and some difficult things.

I should not have blown away any of Gilbert's stuff this time around ...

Hope not anyway ...

svn path=/trunk/; revision=357
1999-07-12 14:26:16 +00:00
Guy Harris d35862ac07 The previous checkins were based on versions of the file prior to
Gilbert's new protocol-tree code (and to a bunch of other changes); put
all the missing changes back in.

svn path=/trunk/; revision=354
1999-07-11 07:24:57 +00:00
Richard Sharpe 9b8cd07087 More decoding of fields. Now handle enumerated fields, but still have
problems with single bit fields when declared as an enumerated field.

It shows an unknown ... Damn ... Can't see what the problem is.

svn path=/trunk/; revision=353
1999-07-10 14:01:53 +00:00
Gilbert Ramirez 07f42b5b31 Created a new protocol tree implementation and a new display filter
mechanism that is built into ethereal. Wiretap is now used to read all
file formats. Libpcap is used only for capturing.

svn path=/trunk/; revision=342
1999-07-07 22:52:57 +00:00
Richard Sharpe 4cef485bd4 Fixed a small problem that would have prevented Ethereal from compiling.
svn path=/trunk/; revision=335
1999-07-01 04:04:38 +00:00
Richard Sharpe e10ddc676c Added some more, auto-generated decoding to packet-smb.c.
Hope it is all OK.

This is getting interesting.

svn path=/trunk/; revision=334
1999-06-28 10:57:57 +00:00
Guy Harris 9bee1b3f20 Unfortunately, as the "cap_len" field in a "frame_data" is unsigned,
"fd->cap_len - offset", i.e. END_OF_FRAME, is unsigned, so

	while (END_OF_FRAME > 0) {

doesn't keep you out of the loop if "offset" is already beyond
"fd->cap_len", so you can try processing stuff past the end of the
captured data in the packet.

svn path=/trunk/; revision=298
1999-06-01 20:39:20 +00:00
Richard Sharpe 38802ac432 Removing some includes of tftp.h from places it should not be
in.

Would like to remove it from packet-tftp.c as well to remove our
dependence on that file as well.

svn path=/trunk/; revision=285
1999-05-13 01:05:11 +00:00
Guy Harris e638eb378f Turn "arpaddr_to_str()" into "bytes_to_str()", and make it public, so it
can be used by dissectors other than ARP to display byte arrays as
strings of hex digits.

Add a routine to extract a null-terminated Unicode string and turn it
into an ISO 8859-1 string for display.  (Ultimately, we should determine
what character sets the X server or printer or whatever can handle, and
turn it into the appropriate character set.)

Display the challenge in "core-to-LANMAN-2.1" Negotiate Protocol
responses as a string of hex digits - but only if the length is
non-zero.  (It's a counted array, not a null-terminated string.)

Display some additional security mode bits in an NT LM 0.12 Negotiate
Protocol response.

Display some additional bits in the "capabilities" field of the
Negotiate Protocol response.

Display the challenge in an NT LM 0.12 Negotiate Protocol response as a
string of hex digits (it's a counted array, not a null-terminated
string).

Display the domain name as Unicode in an NT LM 0.12 Negotiate Protocol
response if the capabilities field has the "supports Unicode" bit set
(no, not the "Unicode" bit in the "flags2" field - NT doesn't set that
in the response, even though it sends the domain name over in Unicode!).

Display some additional bits in the "flags2" field of an SMB.

svn path=/trunk/; revision=275
1999-05-11 08:21:39 +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
Guy Harris c3a9aef919 Add decoding of DOS-format dates and times (one of the N different
date/time formats used in SMB...).

svn path=/trunk/; revision=273
1999-05-11 01:18:30 +00:00
Guy Harris 3cc7edbb32 Some of my fixes did get lost - put 'em back.
Fix the "proto_tree_add_item()" used when the server didn't support any
of the dialects the client offered not to print the dialect index.

In the "Core to LANMAN 2.1" "negotiate protocol" decode, show the time
zone as minutes from UTC, just as is done for the "post-LANMAN 2.1"
decode.

svn path=/trunk/; revision=272
1999-05-11 00:28:18 +00:00
Richard Sharpe 1fe8627014 Some clean-ups. I hope I have not disturbed any of Guy's
fixes, as I had to manually apply his fixes. It is a long story,
but my development environment is, umm, interesting.

Thanks to Guy for spotting the problems in my Core Proto to LanMan 2.0
decode probs.

I did not spot them and I do not have any such traces to check
against.

svn path=/trunk/; revision=271
1999-05-11 00:00:40 +00:00