Commit Graph

80 Commits

Author SHA1 Message Date
Tim Potter 1703faf299 Remove hf argument to common routines for dissecting domain sids. Most
of the callers passed -1 for this parameter anyway.

svn path=/trunk/; revision=10919
2004-05-19 04:52:31 +00:00
Tim Potter 7e7d7ab15a Move common routines from packet-dcerpc-samr.c to packet-dcerpc-nt.c
svn path=/trunk/; revision=10903
2004-05-15 10:05:09 +00:00
Jörg Mayer 3e2633a0f4 char *drep -> guint8 *drep
svn path=/trunk/; revision=9735
2004-01-19 20:10:37 +00:00
Guy Harris 57d229babe Make "cb_str_postprocess()" work like "cb_wstr_postprocess()" by using
"tvb_get_string()" rather than "tvb_format_text()".  (This fixes a
problem wherein we freed the return value of "tvb_format_text()", which
we should not do as "tvb_format_text()" doesn't dynamically allocate the
buffer it returns, but means that we don't handle non-printable
characters - but that's a problem with "cb_wstr_postprocess()" as well,
as "tvb_fake_unicode()" also doesn't handle non-printable characters
specially; we should fix the problem in *both* routines.)

svn path=/trunk/; revision=7955
2003-07-01 00:59:43 +00:00
Tim Potter 24d1d3a828 Remove silly dcerpc_smb_check_long_frame() function and all calls to it.
A much better place to do this is after the subdissector function has
been called in dcercp_try_handoff().

svn path=/trunk/; revision=7895
2003-06-17 05:29:46 +00:00
Guy Harris ef77cb578a In the policy handle hashing, handle more than one policy handle having
the same value, as an open might return handle XXX, handle XXX might
then be closed, and a subsequent handle might return handle XXX, and we
want to keep the two handles distinct to avoid, for example, displaying
handles closed before they're opened.

In policy handle open replies, store the handle name only if the
operation succeeded.  We can now do that without parsing the packet
twice.

Have "dissect_nt_policy_hnd()" optionally return, through a pointer, the
protocol tree item for the handle, so that its caller can decorate the
item with the name of the handle - that's done on opens, where we do
that only if the operation succeeds.

svn path=/trunk/; revision=7787
2003-06-05 04:22:04 +00:00
Guy Harris 084b87c9c2 Move the value_string of platform ID values to "packet-dcerpc-nt.c", and
declare it in "packet-dcerpc-nt.h", as it's used both by the srvsvc and
wkssvc dissectors.

svn path=/trunk/; revision=7672
2003-05-15 05:24:19 +00:00
Tim Potter 737936eef4 Add a dissect_ndr_counted_byte_array_cb function which can take a callback
to call when dissecting the array data.

svn path=/trunk/; revision=7656
2003-05-09 01:43:59 +00:00
Guy Harris b27230342d Use "tvb_format_text()" to format the string in "cb_str_postprocess()",
to avoid problems with non-printable characters.

svn path=/trunk/; revision=7585
2003-04-27 21:48:46 +00:00
Ronnie Sahlberg bca3332efd Not all strings in MS interfaces are unicode.
Rename cb_str_postprocess which handles unicode strings to cb_wstr_postprocess.

Add cb_str_postprocess which handles ASCII strings

svn path=/trunk/; revision=7572
2003-04-27 00:49:14 +00:00
Guy Harris db6c77bf48 Fix a typo.
svn path=/trunk/; revision=7570
2003-04-27 00:34:27 +00:00
Tim Potter 96c217f2dc Don't append text in cb_str_postprocess() if text is the empty string.
svn path=/trunk/; revision=7194
2003-02-25 02:04:56 +00:00
Guy Harris e345e5640e Rename "fake_unicode()" to "tvb_fake_unicode()" as it works on a tvbuff,
give it a byte-order argument, and move it to "epan/tvbuff.c".

Use it to handle UCS-2 strings in version 1 of the Service Location
Protocol.  In SRVLOC V1, use registered fields that are already there
for SRVLOC V2, and add some as needed.  Fix some field names.

svn path=/trunk/; revision=7186
2003-02-24 01:22:30 +00:00
Guy Harris 64991e3fa1 Have "dissect_ndr_counted_string()" add 2, not 1, to its argument, as it
adds 2 levels to the tree.  Fix calls to it not to add 1 for that level.

The NT and LM challenges in a NETWORK_INFO structure are opaque arrays
of bytes, not Unicode strings; dissect them as such, adding a new
routine "dissect_ndr_counted_byte_array()" for that purpose.

Get rid of some extra colons in names - the colon is put there if a
string is appended, so putting a colon in there explicitly gives double
colons.

Decorate some higher-level tree nodes with strings.

svn path=/trunk/; revision=7107
2003-02-08 09:41:44 +00:00
Guy Harris e9f0f4b74f Rename "dissect_ndr_char_string()" and "dissect_ndr_wchar_string()" to
"dissect_ndr_char_cvstring()" and "dissect_ndr_wchar_cvstring()", to
indicate that they're for conformant varying strings.

Rename "dissect_ndr_character_array()" to "dissect_ndr_cvstring()", to
indicate that it's for conformant varying strings.

svn path=/trunk/; revision=7096
2003-02-07 22:44:54 +00:00
Guy Harris 9a348d5736 Rename "dissect_ndr_char_array" and "disect_ndr_wchar_array" to
"dissect_ndr_char_string" and "dissect_ndr_wchar_string", to make it
clearer what it does.

svn path=/trunk/; revision=7095
2003-02-07 22:31:32 +00:00
Guy Harris 579d05d1f3 Fix a typo in the multiple-include protection in "packet-dcerpc-nt.h".
Rename "dissect_ndr_element_array()" to "dissect_ndr_character_array()",
move it out of "packet-dcerpc-nt.c" to "packet-dcerpc.c", and have it
use the standard DCE RPC array max count/offset/count fields rather than
their own private versions of those fields.  Give it an option to create
a subtree, and an argument to specify the field to use for the actual
data buffer, and export it.

Move the routines for handling arrays of "char" and "wchar" as strings
out of "packet-dcerpc-nt.c" to "packet-dcerpc.c".

Add a routine to handle an array of "char" as an opaque blob of bytes.

Use "dissect_ndr_character_array()" to dissect character strings in MAPI
(the strings in question are ASCII, not Unicode), and use the routine to
handle an array of "char" as an opaque blob of bytes to dissect
encrypted data (again, it's bytes, not 16-bit quantities).  Show them as
encrypted data, not unknown data.

Use "dissect_ndr_character_array()" to dissect a form name in
"dissect_form_name()" in the SPOOLSS dissector.

svn path=/trunk/; revision=7091
2003-02-07 08:56:12 +00:00
Tim Potter 45d316639a Move dissect_nt_access_mask() from packet-dcerpc-nt.c to packet-smb.c
Give dissect_nt_sec_desc() and dissect_nt_access_mask() a specific rights
function parameter for dissecting specific access rights.

Fix callers in packet-smb.c to use the new interface.

svn path=/trunk/; revision=7086
2003-02-07 06:01:49 +00:00
Tim Potter 91c6b0c70b Replace the confusing collection of Windows DCERPC string handling
functions with something a little less confusing.

We now have two sets of functions to dissect strings:

 - dissect_ndr_wchar_array() which dissects NDR arrays of wide characters
   (uint32, uint32, uint32, buffer)

 - dissect_ndr_counted_string() which dissects a "counted string"
   (uint16, uint16, pointer to array of wchar)

There are three contexts for dissecting counted strings:

 1. "in-line" using dissect_ndr_counted_string()
 2. as a callback to dissect_ndr_pointer()
 3. as a callback to dissect_ndr_pointer_cb()

Context 2 is used when you have a pointer to a counted string.
Context 3 is when you wish to perform some special processing with the
returned string.

svn path=/trunk/; revision=7068
2003-02-03 02:00:54 +00:00
Guy Harris 00f68c6f2a If "dissect_ndr_nt_STRING()" is being used to dissect a byte string
rather than a character string, don't decorate anything above that item
in the tree with the "string".

svn path=/trunk/; revision=7058
2003-01-31 06:47:55 +00:00
Tim Potter 3405e80d33 Don't append string to upper-level proto_items if item == NULL.
svn path=/trunk/; revision=7050
2003-01-30 22:42:57 +00:00
Guy Harris 5dc66497b7 Generalize "cb_str_postprocess()" to allow the string to be appended to
items N levels up from the item being processed, and use that to
decorate the tree as it was decorated before.

svn path=/trunk/; revision=7043
2003-01-30 08:19:39 +00:00
Guy Harris fc025eb3b8 NDR strings begin with a uint32, so they start on a 4-byte boundary.
svn path=/trunk/; revision=7041
2003-01-30 06:08:10 +00:00
Tim Potter 081f25299f Removed some out of date comments.
svn path=/trunk/; revision=7029
2003-01-28 23:26:11 +00:00
Tim Potter 6114714a5c Defined a useful callback function for dissect_ndr_pointer() which can
be used to help out in most DCERPC strings.  The cb_str_postprocess()
function reads the callback_args and either appends the value of the
string to the COL_INFO field, appends it to the NDR pointer item, or
saves the string to dcv->private_data.  Calling cb_str_postprocess()
with CB_STR_ITEM is the same as calling dissect_ndr_pointer() with
levels = 0.

Renamed some of the pointer dissection functions with a suffix of _cb
and created helpers of the original which call the _cb function with
NULL args.  This should help minimise the amount of code changes in
the bulk of the DCERPC dissectors.

svn path=/trunk/; revision=7016
2003-01-28 06:27:01 +00:00
Tim Potter 2213ef6aaa Perform the initialisation for the NT specific DCERPC dissectors as part
of the DCERPC dissector instead of creating a dummy protocol to hang
the ett and hf values off.

Make the open and close frame values in NT policy handles FT_FRAMENUM's
so the "Go to Corresponding Frame" menu item can be used on them.

svn path=/trunk/; revision=6995
2003-01-24 05:32:54 +00:00
Tim Potter 2146871345 Clean up some unused variables in dissect_ndr_nt_UNICODE_STRING_str()
Undo change to dissect_doserror() and dissect_ntstatus() made in
revision 1.42 as it breaks the display of rpc errors in COL_INFO.

svn path=/trunk/; revision=6934
2003-01-16 22:40:48 +00:00
Guy Harris 6e57154948 Put Unicode strings into the protocol tree with the appropriate protocol
tree item, not with hf_nt_str.  Get rid of hf_nt_str, as it's no longer
used.

Put ASCII strings into the protocol tree only once.

svn path=/trunk/; revision=6910
2003-01-11 08:22:39 +00:00
Guy Harris 84d0997526 "hf_nt_str" is of type FT_STRING, so it should be set to an ASCII
string; set it to the result of the "fake_unicode()" call, not to the
raw Unicode string.  (Yes, we should have support for strings that don't
have 8-bit characters - and somehow handle strings in packets in
multiple character sets, e.g. ISO 8859/x and other EUC codes, the
Macintosh extended character set, various DOS/Windows code pages, and
Unicode - but we don't have it now.)

svn path=/trunk/; revision=6909
2003-01-11 07:52:34 +00:00
Tim Potter 9f4148decf Delete all prs_* functions. Huzzah!
svn path=/trunk/; revision=6900
2003-01-11 04:42:16 +00:00
Guy Harris a55fa6743a Get rid of some no-longer-used routines; there are other routines that
have taken their places.

svn path=/trunk/; revision=6723
2002-12-02 21:20:26 +00:00
Guy Harris f6998aaa23 Get rid of a no-longer-used variable.
svn path=/trunk/; revision=6717
2002-12-02 20:01:55 +00:00
Guy Harris 0e050b1107 Get rid of the "pdata" argument to "dissect_dcerpc_uint16s()" and
"dissect_ndr_uint16s()"; "dissect_ndr_uint16s()" is always passed a null
pointer, "dissect_dcerpc_uint16s()" is only called by
"dissect_ndr_uint16s()", and the pointer returned through "pdata" is
*NOT* guaranteed to be aligned on a 16-bit boundary so we don't want to
tempt people to blithely dereference that pointer.

svn path=/trunk/; revision=6699
2002-11-28 21:03:36 +00:00
Guy Harris a56c79201d Arguments to hash routines are gconstpointer's; assign them to const
pointers.

The first argument to "sscanf()" is a "const char *"; don't cast const
pointers to "char *" when passing them to "sscanf()".

Assign the result of "tvb_get_ptr()" to const pointers, not non-const
pointers.

Make the "pdata" argument to various DCE routines a const pointer.

svn path=/trunk/; revision=6688
2002-11-28 03:57:50 +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 cc6c8214eb Put the top-level item for an NT access mask into the protocol tree with
"proto_tree_add_uint()" and the hfindex passed to us, rather than as a
text item.  That means it has the name our caller gave to it, and that
it's a filterable field.

svn path=/trunk/; revision=6062
2002-08-22 18:24:06 +00:00
Tim Potter 50b37822a0 Some cleanups and fixes from Guy:
- combine proto_tree_add_text() and proto_tree_append_text() calls in the
   access mask dissector

 - make the specific access bits dissector functions return void instead of
   an offset

I think Samba has the create user reply wrong.  There is perhaps a uint32
marked as unknown that shouldn't be there.  Removing this parses all the
captures I have.

svn path=/trunk/; revision=6057
2002-08-22 01:13:13 +00:00
Tim Potter de6ea27535 Added a NT access mask dissector. The breaks the permission bits up into
generic, standard and specific mode bits.  A protocol dissector can pass in
it's own function for dissecting the specific mode bits, if known.

svn path=/trunk/; revision=6053
2002-08-21 21:29:22 +00:00
Tim Potter 142ef6e2ab In dissect_doserror and dissect_ntstatus, don't add anything to the
COL_INFO field if the proto_tree parameter is NULL.  This prevents
duplicate error messages when we just want to peek at the value of the
error.

svn path=/trunk/; revision=5963
2002-08-07 00:54:32 +00:00
Tim Potter 973c1a447d Removed unused variable.
svn path=/trunk/; revision=5775
2002-06-28 07:17:34 +00:00
Tim Potter d24a5fd6c9 Cleaned up NT policy handle hashing a bit. Split the store function
into two - one that stores request/reply frame numbers and another
that associates a text name with a policy handle.

Removed all calls to prs_policy_hnd() and converted to calls to
dissect_nt_policy_hnd().

svn path=/trunk/; revision=5772
2002-06-28 01:23:26 +00:00
Tim Potter c5bc4a8a58 Same for a NT status code.
svn path=/trunk/; revision=5762
2002-06-25 02:58:11 +00:00
Tim Potter 39c2537cd7 Display the error code for a dos error that doesn't have a value string defined.
svn path=/trunk/; revision=5761
2002-06-25 02:57:39 +00:00
Tim Potter 134404b92a Added dissect_ndr_uint16s() utility function for dissecting a buffer
of uint16 values.

svn path=/trunk/; revision=5624
2002-06-05 04:17:47 +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
Tim Potter d72677d9b6 Set the length field correctly for proto_tree_add_text() when marking the
undissected part of a long frame.

svn path=/trunk/; revision=5470
2002-05-15 03:28:43 +00:00
Guy Harris 3479848f3f Mark unused arguments as such.
svn path=/trunk/; revision=5450
2002-05-11 22:53:58 +00:00
Guy Harris 6a79ad7e91 In "dissect_nt_policy_hnd()":
add arguments to specify whether the policy handle is being
	opened or closed, and don't set the "open frame" for the handle
	unless it's being opened and don't set the "close frame" for the
	handle unless it's being closed;

	store the policy handle before fetching it, so that an open or
	close is marked appropriately in the protocol tree on the first
	pass;

	if the policy handle has a name associated with it, put that
	name into the top-level item for the policy handle.

In "packet-dcerpc-spoolss.c":

	get rid of aun unused variable;

	make "setjob_commands[]" static, as it's not used outside
	"packet-dcerpc-spoolss.c";

	put a "VALS()" call around the reference to "setjob_commands",
	to squelch compiler warnings;

	give the SPOOLSS return code field the appropriate
	"value_string" array.

svn path=/trunk/; revision=5448
2002-05-11 22:29:43 +00:00
Tim Potter e932bc78a9 Added a routine to dissect a DOS error code. These are used in the spoolss
(also registry and srvsvc?) pipe dissectors.

Also added some helper routines for decoding a range of uint8s.  These map
nicely to the dissect_{dcerpc,ndr}_foo() format with the addition of a
length parameter, but aren't really part of the NDR specification and are
probably only going to be used in the NT dcerpc dissectors.

svn path=/trunk/; revision=5421
2002-05-09 02:44:22 +00:00
Tim Potter ea89f9f772 Fix up item lengths for policy handle subtree and subitems under it.
svn path=/trunk/; revision=5410
2002-05-07 00:35:14 +00:00