Commit Graph

35 Commits

Author SHA1 Message Date
Guy Harris 1d42c94b05 Make the resolution for time values be nanoseconds rather than
microseconds.

Fix some "signed vs. unsigned" comparison warnings.

svn path=/trunk/; revision=3934
2001-09-14 07:10:13 +00:00
Guy Harris b39d788d91 Squelch some compiler warnings.
svn path=/trunk/; revision=3874
2001-08-27 20:04:21 +00:00
Guy Harris e18fdae9b6 Use the descriptor strings when dissecting remote APIs; this lets us
handle null pointer entries, and lets us make the dissection of those
APIs more table-driven.

svn path=/trunk/; revision=3873
2001-08-27 09:09:36 +00:00
Guy Harris dee3661ce3 Label the protocol as the "Microsoft Windows Lanman Remote API
Protocol", not just the "Microsoft Windows Lanman Protocol"; LAN Manager
had a number of protocols layered atop SMB, and this is the one used for
remote execution of various APIs.

svn path=/trunk/; revision=3872
2001-08-27 08:42:26 +00:00
Guy Harris 91cdcfbaa3 Put the continuation data into the protocol tree for a reply
continuation regardless of whether we have the frame number of the frame
from which we're continuing.

svn path=/trunk/; revision=3837
2001-08-11 17:17:42 +00:00
Guy Harris a5047906f1 Put into the protocol tree for transaction continuations an item for the
data in the continuation.

svn path=/trunk/; revision=3835
2001-08-11 07:31:14 +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 cf69e4c354 Fix up the check for an unlimited amount of storage.
Fix up the code to add the "milliseconds since some point in the past"
field in a NETREMOTETOD response to the tree.

svn path=/trunk/; revision=3830
2001-08-06 08:49:17 +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 763b607aa4 Save the parameter and result descriptors if the frame *hasn't* already
been visited, not if it *has*.

svn path=/trunk/; revision=3828
2001-08-05 20:35:41 +00:00
Guy Harris d2b01e812b Remote API protocol (that seems to be what it's called in a number of
places) dissector tvbuffified, from Ronnie Sahlberg and me.

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

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

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

Change more of the

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

stuff to

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

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

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

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

svn path=/trunk/; revision=3822
2001-08-05 00:16:36 +00:00
Guy Harris c12f72ebdc "dissect_pipe_lanman()" is no longer used outside "packet-smb-pipe.c";
make it static to "packet-smb-pipe.c".

svn path=/trunk/; revision=3804
2001-08-01 03:51:16 +00:00
Guy Harris 11f72f73b8 When constructing the tree for a LANMAN transaction continuation, use
the parameter offset, not the data offset, as the starting offset.

svn path=/trunk/; revision=3155
2001-03-22 00:50:44 +00:00
Guy Harris 6b3c6ad891 When dissecting LANMAN pipe transaction replies, store with each reply
frame per-frame data indicating

	1) what type of transaction it's a reply to

and

	2) whether it's the first reply or a continuation reply

as the information supplied by the SMB dissector can only be trusted on
the first pass through the capture.

(If you have two different transactions in the *same* conversation with
the *same* MID, but different transaction types, only on the first pass
will the transaction type in the data structure pointed to by
"si.request_val" reflect the previous request - it reflects the last
request seen which, when the user is clicking on frames in the capture,
needn't be the request corresponding to the reply that they've just
clicked on.

If you have a reply that consists of multiple SMBs,
"si.request_val->trans_response_seen" will be set to 1 as soon as the
first reply is seen, and will *remain* 1 until the request is seen
again; if the user clicks on one of the SMBs in the reply, even if it's
the first SMB in the reply, without having first clicked on the request,
"si.request_val->trans_response_seen" will be 1, and the SMB will be
misdissected as a continuation.)

Use common code to handle the beginning of LANMAN replies, rather than
duplicating it in the code to handle each reply.

svn path=/trunk/; revision=3154
2001-03-22 00:28:35 +00:00
Guy Harris aaa428976e Use common code to handle the beginning of LANMAN requests, rather than
duplicating it in the code to handle each request.

svn path=/trunk/; revision=3153
2001-03-21 23:30:54 +00:00
Guy Harris 5e41f83080 Whitespace cleanup.
Use "loc_offset" even for the function code in a response (it probably
shouldn't matter, as the function code isn't actually *in* the
response), and set "loc_offset" to SMB_offset in an interim reply.

svn path=/trunk/; revision=3151
2001-03-21 23:13:49 +00:00
Guy Harris 91693ad8a7 Show a minimal tree for interim responses, showing only the type of the
request to which it's a response.

Compute the offset of the LANMAN data before putting *any* entries into
the tree, rather than using 0 as the offset for the top-level item for a
response.

svn path=/trunk/; revision=3150
2001-03-21 22:57:26 +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
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 6c75aa83f9 Fix a damn stupid mistake that stopped us seeing all the bits in the flags on a NetServerEnum2 request.
svn path=/trunk/; revision=2809
2001-01-03 04:37:07 +00:00
Richard Sharpe d2f2cc6bf6 A small fix to ensure that all servers/workgroups show up ... Last one
was not being picked up ...

Will have to add proper state keeping code soon ...

svn path=/trunk/; revision=2804
2001-01-01 01:44:46 +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
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
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 d83e4cb58c Add a comment giving the URL of the CIFS Remote Administration Protocol
spec (which covers some of what this file dissects).

Dissect the share type in NetShareEnum replies as a type value (using
values from said spec), not just as a number.

svn path=/trunk/; revision=1958
2000-05-14 20:50:03 +00:00
Guy Harris e9cc5fa70c Put in some checks to make sure we don't go past the end of the frame
when fetching strings in NetShareEnum and NetServEnum2 replies.

svn path=/trunk/; revision=1956
2000-05-14 04:00:48 +00:00
Guy Harris 37315afd37 In a NetServEnum, there's only one byte of padding after the share name.
(See, for example

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

.)

svn path=/trunk/; revision=1955
2000-05-14 03:17:26 +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 8c200212c7 Fix some "proto_tree_add_text()" calls.
svn path=/trunk/; revision=1695
2000-03-06 20:04:53 +00:00
Richard Sharpe cc56d8283a Small fix to the LanMan stuff ...
svn path=/trunk/; revision=1650
2000-02-19 12:13:52 +00:00
Guy Harris 9f8ef2ecb4 Protocol abbreviations should be all lower case, as they're used in
filter expressions, and names in those expressions are currently
case-sensitive, and obliging people to type "Lanman" to filter for
Lanman packets is overkill.

Get rid of the comment saying that the routines for mailslot and pipe
dissecting should perhaps be migrated to another file, as this and
"packet-smb-mailslot.c" are the other files to which they were migrated.

svn path=/trunk/; revision=1632
2000-02-14 04:18:57 +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