Commit Graph

64 Commits

Author SHA1 Message Date
Guy Harris 9f405c5703 Put the code to reassemble fragmented connection-oriented and
connectionless DCE RPC PDUs into common routines, and call those
routines when dissecting DCE RPC requests and responses.

Get rid of arguments to "dcerpc_try_handoff()" whose values are also in
the "dcerpc_info" structure pointed to by its "info" argument.

svn path=/trunk/; revision=5757
2002-06-24 09:23:39 +00:00
Tim Potter 6d6dce305d Change each DCERPC dissector to pass in a hf value on initialisation
for a value_string that corresponds to that dissectors opnums.  Pass
in -1 if no such table is available.

svn path=/trunk/; revision=5749
2002-06-24 00:03:18 +00:00
Guy Harris 5f8f311188 From Jaime Fournier: handle DCE RPC connectionless CANCEL PDUs with no
body.

svn path=/trunk/; revision=5730
2002-06-22 01:30:54 +00:00
Guy Harris 5c29a6c760 Don't hand off the stub body of a Fault PDU to the subdissector for the
protocol.

svn path=/trunk/; revision=5704
2002-06-19 10:06:02 +00:00
Guy Harris 309f192e02 Dissect the bodies of some additional PDU types.
Show presentation context negotiation results and rejection reasons, PDU
rejection reasons, and rejection status codes symbolically.  Show the
presentation context negotiation rejection reason only if there was a
rejection, and, if so, show it in the Info column as well as the
protocol tree.

Show more fields in the Info column.

Show the packet type in decimal in the protocol tree - it's shown as
decimal in the Info column and the values are shown as decimal in the
DCE RPC 1.1 spec.

Show the sequence number for connectionless PDUs as decimal in the
protcool tree - it's snown as decimal in the Info column, and the call
ID for connection-oriented PDUs is shown as decimal in the protocol
tree.

svn path=/trunk/; revision=5701
2002-06-19 08:34:38 +00:00
Guy Harris dbbeac5f68 There's no more need for separate request and response reassembly hash
tables for connectionless PDUs than for connection-oriented PDUs; just
have one connectionless PDU reassembly hash table.

Get rid of unnecessary tests of "dcerpc_reassemble" - the code to handle
requests and responses was

	if (!dcerpc_reassemble || packet not fragmented || frame is short)
		don't reassemble;
	else if (dcerpc_reassemble)
		reassemble

but if we go into the "else" clause we know that all three conditions in
the "if" are false, including "!dcerpc_reassemble", so we know
"dcerpc_reassemble" is true.

Set "pinfo->fragmented" based on whether the PDU being dissected is an
unreassembled first fragment or not.

Put a "Fragment data" item into the protocol tree for all fragments.

Properly maintain the offset when dissecting the header of a
connectionless PDU, even if we aren't building a protocol tree.

"fd_head->datalen" is bogus for sequence-number-based reassembly; use
"fd_head->len" instead.

svn path=/trunk/; revision=5695
2002-06-18 06:11:42 +00:00
Guy Harris b0dce85799 The offset of the authentication information in a connectionless PDU is
the fragment length *plus the offset of the beginning of the fragment
data*, not just the fragment length.

svn path=/trunk/; revision=5694
2002-06-18 05:06:44 +00:00
Guy Harris 5cb1f7c75c Add support for reassembly of fragmented connectionless PDUs.
Don't try to add a fragment to a reassembly operation if we don't have
all of the stub data (because the frame is short, or because it's part
of a packet fragmented at a layer below RPC and not reassembled).

Put an entry into the protocol tree for the fragment data of the last
fragment.

svn path=/trunk/; revision=5688
2002-06-17 01:11:00 +00:00
Guy Harris 879107efe1 Add #defines for the bits in the flag fields, and a macro to test
whether a connection-oriented PDU is fragmented or not.

Clean up the handling of fragmented connection-oriented PDUs (the code
to handle fragmented PDUs can assume that it is not the case that both
PFC_FIRST_FRAG and PFC_LAST_FRAG are set, as that's an unfragmented
PDU).  Put an entry into the protocol tree for the fragment data in
fragmented PDUs.

For fragmented connectionless PDUs, don't hand the payload of any
fragment other than the first fragment to the subdissector.

svn path=/trunk/; revision=5687
2002-06-17 00:04:49 +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 259903dc66 Changed toplevel REF pointer dissection to create a subtree. Not creating a subtree was a design mistake which caused ugliness in the unicode string str dissector and in other places.
Dissectors will temporarily have less pretty output for topleve ref pointers until their output is retuned.

svn path=/trunk/; revision=5573
2002-05-27 09:50:58 +00:00
Ronnie Sahlberg 1f5cebd9fd Fix a bug for dcerpc. If we do not have reassembly of fragments enabled, only call the subdissector for the first fragment.
svn path=/trunk/; revision=5556
2002-05-25 08:37:44 +00:00
Ronnie Sahlberg 2031280796 Reassembly of fragmented DCE/RPC (only for connection oriented DCE/RPC).
svn path=/trunk/; revision=5548
2002-05-24 11:51:14 +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
Ronnie Sahlberg 04158638ae Added extra check in the function that parses NDR pointers.
When the representation for a pointer type gets dissected, the dissector
is actually called twice. Once with conformant_run==1 and once ==0.
The idea is that when conformant_run is ==1, the ONLY bytes that will be
dissected and would be the array structure preceeding the actual data.
And the normal data and content will be dissected when conformant_run ==0.
This is to handle the case properly when conformant arrays are embedded inside
aggregated types, in which case there will be other data inserted between
these array control data, and the array content.

The check that is added will assert that no other data is actually eaten
for conformant_run==1 than just this data.
This will help debugging dcerpc dissectors.

svn path=/trunk/; revision=5412
2002-05-07 10:07:55 +00:00
Guy Harris f7724391aa From Joerg Mayer: get rid of some unused variables and arguments, and
mark other unused arguments as such.

svn path=/trunk/; revision=5366
2002-05-02 21:47:47 +00:00
Tim Potter 72942ecf6f Changed COL_INFO string from 'rqst FOO(...)' to 'FOO request' as per
discussion on dev list.

svn path=/trunk/; revision=5299
2002-04-30 01:43:12 +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 ab96c5694e Frame numbers are unsigned, and 0 is not a valid frame number; make the
frame number arguments, and elements in data structures, unsigned,
display them with "%u" rather than "%d", and use 0, rather than -1, as
"not known".

svn path=/trunk/; revision=5223
2002-04-22 09:43:03 +00:00
Guy Harris 29607a5107 For DCE RPC requests and replies, put an item into the protocol tree for
the sub-protocol containing the actual operation number (which isn't
necessarily the operation number in a connectionless reply's PDU;
sometimes the operation number in a connectionless reply appears to be
garbage, and it's not what we use to dissect the reply in any case), and
also giving the name of the operation, if we know it.

Show the authentication data in connectionless PDUs, if present, as an
item in the protocol tree.

svn path=/trunk/; revision=5002
2002-03-22 09:44:58 +00:00
Guy Harris 030cea2057 From Todd Sabin: set the tvbuff length of the stub data for
connectionless calls to the fragment length.

Add value_string tables for authentication protocol and level values.

Show the authentication protocol in decimal in connectionless PDUs, just
as we do in connection-oriented PDUs.

Get the authentication level from connection-oriented request and reply
PDUs and, if it's DCE_C_AUTHN_LEVEL_PKT_PRIVACY, don't hand the stub
data to subdissectors, just show it as encrypted stub data.

svn path=/trunk/; revision=4998
2002-03-21 09:35:52 +00:00
Guy Harris 09acc1c074 Secondary addresses are NUL-terminated strings; treat them as such.
svn path=/trunk/; revision=4981
2002-03-19 11:10:40 +00:00
Guy Harris 0ab2b8b50f Don't show a secondary address if the secondary address length is 0.
svn path=/trunk/; revision=4968
2002-03-18 07:56:06 +00:00
Guy Harris f911953894 Put an item into the protocol tree for the secondary address in a bind
ack PDU.

svn path=/trunk/; revision=4958
2002-03-16 22:54:20 +00:00
Guy Harris 2223587585 Catch another "(NULL pointer)%s" we didn't catch with the previous
checkin.

svn path=/trunk/; revision=4911
2002-03-10 03:11:10 +00:00
Guy Harris b27f1ac14d Put a space between "(NULL pointer)" and the name of the item being
dissected, just as is done with "(duplicate PTR)".

svn path=/trunk/; revision=4910
2002-03-10 03:09:48 +00:00
Ronnie Sahlberg 68a7d05463 Fixed bug in dissect_ndr_pointer(). Top level Unique and Full pointers are
not encoded in the same way in the NDR representation.

svn path=/trunk/; revision=4887
2002-03-06 08:28:57 +00:00
Guy Harris e594878f52 From Ronnie Sahlberg: display the opnum also for reply packets.
svn path=/trunk/; revision=4728
2002-02-13 04:12:42 +00:00
Guy Harris 3b47ff0df8 Display the fragment length, and fragment ordinal number, in decimal.
svn path=/trunk/; revision=4722
2002-02-12 07:55:23 +00:00
Guy Harris a8fc99ae5a From Ronnie Sahlberg:
SAMR updates;

	a bugfix in dissect_ndr_pointer() (should not check referent id
	for aliases for unique pointers);

	enhancement to dissect_ndr_pointer() to make it possible to
	hand a generic int value to the dissector for the pointer object
	in a similar way as hf_index values are passed through the
	pointer layer.

svn path=/trunk/; revision=4721
2002-02-12 07:35:21 +00:00
Guy Harris 04228a94a3 From Ronnie Sahlberg:
fix to LookupRids to match what the IDL file says;

	fix to "dissect_ndr_uint64()" to specify the right length to
	"proto_tree_add_item()";

	give the protocol tree items for array header counts and offsets
	the correct offsets in the packet.

svn path=/trunk/; revision=4719
2002-02-11 08:19:09 +00:00
Guy Harris 1726d487a5 From Todd Sabin:
dissect dcerpc UDP replies correctly - use the opnum from the
	request, ont the reply (the opnum from the request is frequently
	wrong in Microsoft's DCE RPC implementation);

	don't crash if the packet isn't found in the hash tables;

	dissect SamrLookupDomain requests properly.

svn path=/trunk/; revision=4718
2002-02-10 23:51:44 +00:00
Guy Harris 2f3a001d65 Fixes from Ronnie Sahlberg.
svn path=/trunk/; revision=4710
2002-02-08 11:02:03 +00:00
Guy Harris 8bc19844ca From Ronnie Sahlberg:
the count fields in SAMR replies aren't array max_count values,
	so don't display them as such;

	Put conformant and conformant varying array length/offset/etc.
	values into the protocol tree.

svn path=/trunk/; revision=4701
2002-02-06 06:27:15 +00:00
Guy Harris d5df557923 DCE RPC enhancements, and SAMR improvements, from Ronnie Sahlberg.
svn path=/trunk/; revision=4618
2002-01-29 09:13:28 +00:00
Guy Harris 55bed21e45 From Ronnie Sahlberg:
NDR pointer handling in DCE RPC
	SAMR updates

svn path=/trunk/; revision=4608
2002-01-25 08:35:59 +00:00
Guy Harris eb2d6593dc Replace a bunch of "tvb_length()" and "tvb_length_remaining()" calls in
arguments to "proto_tree_add_text()", and to "proto_tree_add_XXX()" calls
that add FT_NONE or FT_PROTO items to the protocol tree, with -1.

Replace some calls to "tvb_length()" or "tvb_length_remaining()" with
calls to "tvb_reported_length()" and "tvb_reported_length_remaining()",
as those give the actual length of the data in the packet, not just the
data that happened to be captured.

svn path=/trunk/; revision=4605
2002-01-24 09:20:54 +00:00
Guy Harris 20d4266049 From Ronnie Sahlberg: add support for finding the response that matches
a request.

svn path=/trunk/; revision=4600
2002-01-23 05:38:32 +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 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 4eb3462238 Check whether the protocol for a DCERPC subdissector is enabled, and
don't call the subdissector (or even create a subtree for the protocol)
if it's not enabled.

Save the current protocol string, and set it to the string for the
subdissector's protocol, before calling the subdissector, and restore it
after the subdissector returns.

svn path=/trunk/; revision=4418
2001-12-17 23:08:51 +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 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 a4bc234f2d Add { 0, NULL } terminators to some "value_string" arrays lacking them.
Make some static that don't need to be exported.

svn path=/trunk/; revision=4288
2001-11-27 22:37:20 +00:00
Guy Harris 5613c7d37a When returning the length of the DCE RPC PDU, add 4 if the packet was
preceded by 4 bytes of zero padding.

svn path=/trunk/; revision=4287
2001-11-27 11:01:35 +00:00
Guy Harris f78a1f548b Rename the heuristic dissector table "msrpc" to "smb_transact", to
indicate that it's to be used for SMB transactions; a different table,
using different dissectors, would be needed for, say, reads and writes
over a named pipe, as those are byte streams and SMB transactions are
packets, so the dissectors for the first one need to worry about
multiple PDUs per segment and desegmentation, while the dissectors for
the second one don't - and, in fact, can't do desegmentation stuff.

svn path=/trunk/; revision=4286
2001-11-27 09:37:18 +00:00
Guy Harris 5ebf118bf3 From Todd Sabin:
o Modifies the dcerpc handoff to subdissectors slightly.  It
	  also needs to pass the data representation to the
	  subdissector.  Also, if no subdissector is found, it puts a
	  "Stub data" entry in the tree.

	o Adds optional TCP desegmentation to the dcerpc layer.  Note
	  that dcerpc has it's own ability to fragment PDUs.  This isn't
	  for dealing with that, but with the case of a single PDU being
	  broken over more than one TCP segment.

	o Adds a little bit of dissection to packet-dcerpc-epm.c.
	  Mainly just proof of concept for the dcerpc handoff stuff.
	  (Writing this is how I realized the need for the drep.)

	o Adds packet-dcerpc-ndr.c, which will contain NDR dissection
	  routines for use by subdissectors.

Also, support added for multiple PDUs per segment for DCERPC-over-TCP
(and, potentially, other byte-stream transports).

svn path=/trunk/; revision=4285
2001-11-27 09:27:29 +00:00
Guy Harris 8c358fd83e From Tim Potter: use the FID, for DCE RPC-over-SMB, as part of the
conversation matching.

svn path=/trunk/; revision=4220
2001-11-18 22:44:08 +00:00