Commit Graph

37 Commits

Author SHA1 Message Date
Tim Potter c15486768a Fixed another bug in RRPCN.
Some more updates for printer notification data types as I figure out
how it all hangs together.

svn path=/trunk/; revision=5641
2002-06-07 06:10:53 +00:00
Tim Potter 7c8ae51531 A printer port name is a notification string, not a two word value.
A RFNPCNEX request contains a NOTIFY_OPTIONS_ARRAY_CTR instead of a
NOTIFY_OPTIONS_ARRAY.

svn path=/trunk/; revision=5639
2002-06-07 03:42:02 +00:00
Tim Potter 7db4c88dcd Dissect spoolss FCPN. Not sure what it stands for.
svn path=/trunk/; revision=5632
2002-06-06 05:46:55 +00:00
Tim Potter fb78dde09e Implemented ReplyClosePrinter().
Fixed calls to dissect_nt_policy_hnd() as ReplyOpenPrinter() opens a
handle and ReplyClosePrinter() closes one.

svn path=/trunk/; revision=5631
2002-06-06 03:18:14 +00:00
Tim Potter 230ac0da7a Implemented RRPCN (RemotePrinterChangeNotification).
Use the di->levels field to pass info to notify options rather than
mucking about with the private_data fields which mysteriously doesn't
work.

Fixed some display bugs in notify data.

svn path=/trunk/; revision=5625
2002-06-05 07:15:47 +00:00
Tim Potter 4616797423 Converted all reply functions to use dissect_doserror() instead of
prs_werror().

Converted RFFPCNEX (FindFirstPrintChangeNotification) to Ronnie's NDR
routines.

Implemented RFNPCNEX (FindNextPrintChangeNotification).  Print
notification data is dissected in a length/buffer format instead of
dissecting as the underlying type (string secdesc, devmode etc).

svn path=/trunk/; revision=5623
2002-06-05 04:15:30 +00:00
Tim Potter 8b8f0130a3 Implemented getprinterdriver2, levels 1 and 3.
svn path=/trunk/; revision=5513
2002-05-20 06:53:31 +00:00
Tim Potter 6519b11bcb Some miscellaneous updates:
- implemented WritePrinter, DeletePrinterData

 - fixed dissection of various printerdata routines to use a more
   consistent field naming scheme and convert to ndr functions

svn path=/trunk/; revision=5509
2002-05-20 00:36:04 +00:00
Tim Potter 70a045e948 Added subdissectors for StartDocPrinter and EndDocPrinter RPCs.
svn path=/trunk/; revision=5454
2002-05-13 01:27:07 +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 0a84144f2d Add printer name to COL_INFO for ClosePrinter request.
Converted enumjobs command to Ronnie's NDR dissection routines.

Implemented getjob, setjob, startpageprinter, endpageprinter commands using
NDR routines.

svn path=/trunk/; revision=5435
2002-05-10 02:41:48 +00:00
Guy Harris 16d52f4f29 From Joerg Mayer: mark unused arguments as such.
svn path=/trunk/; revision=5380
2002-05-04 09:05:44 +00:00
Guy Harris 17714f9c4e Add a "remove an argument" change, from Joerg Mayer, that I'd missed.
Put in a comment noting a problem in the code.

svn path=/trunk/; revision=5341
2002-05-01 21:22:06 +00:00
Tim Potter f7965cfaab Start of support for setprinter calls. Currently on setprinter level 3 is
decoded properly.

Add printer name to COL_INFO field in ClosePrinter request.

svn path=/trunk/; revision=5322
2002-05-01 05:28:56 +00:00
Guy Harris a06dd1c724 From Joerg Mayer: get rid of unused "pinfo" argument to
"dissect_nt_sec_desc()".

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

svn path=/trunk/; revision=5317
2002-04-30 23:48:15 +00:00
Tim Potter 63aaa78222 Use the string in the DCERPC sub-dissector array instead of providing
another one in the COL_INFO field.

svn path=/trunk/; revision=5300
2002-04-30 01:44:35 +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
Tim Potter 14395ccd3a Pass the correct len field to dissect_nt_sec_desc() when dissecting
PRINTER_INFO_2 and PRINTER_INFO_3 structures.

Added dissector for EnumJobs rpc - not quite finished yet.

svn path=/trunk/; revision=5231
2002-04-24 03:08:49 +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 677ad9ee25 Correctly dissect LSA security descriptors, at least as they appear
inside a Netlogon security descriptor.

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

svn path=/trunk/; revision=5212
2002-04-22 01:07:19 +00:00
Guy Harris 92e27e03c1 Add a "proto_register_dcerpc_smb()" which registers ett_ values for
"packet-dcerpc-nt.c", and registers "dcerpc_smb_init()" as an
initialization routine.  Take the ett_ registration out of the latter
routine, and also take out the "do this only once" stuff.

Get rid of the initialization routines for netlogon, samr, and spoolss;
they just call "dcerpc_smb_init()", which is now an initialization
routine of its own.

The policy hash initialization should be done before every capture, so
it should be done in an initialization routine, and should not do any
"do this only once" stuff.  It should also be called only once before
every capture, rather than 3 times.

The ett_ initialization should, however, be done at the same time all
other ett_ initialization is done - at protocol registration time - so
it should be done in a "proto_register_" routine.

This fixes a bug I saw wherein

	1) the tree for Unicode strings was open by default

and

	2) if you closed one and then exited, Ethereal would crash.

The problem is that "proto_register_subtree_array()" doesn't expand the
array, it just bumps the number of registered ett_ values; the array is
allocated in "proto_init()".  As such, if you register ett_ values with
"proto_register_subtree_array()" *after* "proto_init()" is called - and,
even for the first capture, initialization routines are called after
"proto_init()" is called - you will get ett_ numbers that go past the
number of elements in the array.

Move the declaration of "ett_nt_unicode_string" to "packet-dcerpc-nt.h",
as it's exported from "packet-dcerpc-nt.c".

Get rid of the declaration of "dcerpc_smb_init()" in
"packet-dcerpc-nt.h", and make it static, as it's no longer called from
outside "packet-dcerpc-nt.c".

svn path=/trunk/; revision=5196
2002-04-18 00:29:17 +00:00
Tim Potter 37de9c398d Decode FORM_1 and FORM_REL flag values as value_strings.
svn path=/trunk/; revision=5132
2002-04-09 04:41:40 +00:00
Tim Potter 3123dde48e A devicemode contains a uint32 at the start which represents the size of
the structure.

Fixed an off by one but in displaying the device mode in a PRINTER_INFO_2
structure.

The devicemode in a devicemode container is not a deferred pointer but
rather occurs immediately after the pointer if it is non-NULL.

svn path=/trunk/; revision=5114
2002-04-08 00:27:36 +00:00
Tim Potter 3c2ed458ba Decode some bits of the PRINTER_INFO_2 structure that we were missing
before.

Display which info level a getprinter response contains in COL_INFO.

Fixed some bugs in dissecting devicemodes - the device name and form name
live in a 64-byte buffer instead of a NULL terminated unicode string.

svn path=/trunk/; revision=5102
2002-04-05 03:07:28 +00:00
Guy Harris 892df728ad Include "packet-smb-common.h" to get the declaration of
"dissect_nt_sec_desc()".

svn path=/trunk/; revision=5093
2002-04-04 00:56:06 +00:00
Tim Potter 94f9089c89 Decode PRINTER_INFO_1 and PRINTER_INFO_3 structures.
svn path=/trunk/; revision=5092
2002-04-03 23:32:23 +00:00
Tim Potter b958e865ca Use dcerpc_call_value structure to fetch request/response frame numbers
and storage of private data.

Fix memory leaks in form dissectors.

svn path=/trunk/; revision=5020
2002-03-26 05:20:51 +00:00
Tim Potter 78fd37d27c Added dissectors for get/set/delete form.
Fixed enumforms dissector.

svn path=/trunk/; revision=5019
2002-03-26 04:29:17 +00:00
Tim Potter c9360c715f Some refactoring of the spoolss dissector:
- rewrote request/response hashing code and moved it into
   packet-dcerpc-nt.c for use by other dcerpc/smb dissectors

 - rewrote policy handle hashing code as above, with nifty improvements

 - moved check for unparsed data and end of frame into a function

 - fixed matching of printername to handle in addprinterex

svn path=/trunk/; revision=5014
2002-03-25 05:42:02 +00:00
Tim Potter eaa3bc3095 Added a generic reply handler for unimplemented spoolss dissectors. This
just parses the error code at the end of the packet and updates COL_INFO
if necessary.

svn path=/trunk/; revision=5012
2002-03-25 01:09:01 +00:00
Guy Harris f970451d95 Add a cleanup function to close a potential memory leak.
Get rid of an assigned-to-but-not-used variable.

From Steven French: add names for some additional calls.

svn path=/trunk/; revision=5003
2002-03-22 10:03:36 +00:00
Guy Harris b38e3f4e99 The length argument to "fake_unicode()" is in characters, not bytes.
svn path=/trunk/; revision=4992
2002-03-20 09:09:07 +00:00
Guy Harris ad8b000445 There is no guarantee that a buffer obtained using "tvb_get_ptr()" is
neatly aligned on a 2-byte or a 4-byte boundary, and there is no
guarantee that a misaligned pointer can be dereferenced without getting
a fault.

Furthermore, there is no guarantee that, even if you *can* dereference a
pointer to a 2-byte or 4-byte quantity in a packet, the resulting number
you get back is in the right byte order; the data in the packet might
have a different byte order from the machine on which you're running.

Therefore, we change "prs_uint8s()", "prs_uint16s()", and
"prs_uint32s()" to return the starting offset, in the tvbuff, of the
collection of 8-bit, 16-bit, or 32-bit integral values, rather than a
pointer to the raw packet data, and change their callers to fetch the
data using "tvb_get_guint8()", "tvb_get_letohs()", and
"tvb_get_letohl()" (the stuff in all the NT protocols is presumed to be
little-endian here).  We also change "fake_unicode()" to take a tvbuff
and an offset, rather than a data pointer, as arguments, and to use
"tvb_get_letohs()" to fetch the Unicode characters (again, we assume
little-endian Unicode).

This requires "fake_unicode()" to establish a cleanup handler, so we
don't leak memory if it throws an exception.

We also make "fake_unicode()" use "g_malloc()" to allocate its buffer
(we weren't checking for allocation failures in any case; with
"g_malloc()", we'll abort on an allocation failure - if we can come up
with a cleverer way of handling them, fine), and the matching frees to
use "g_free()".  (We also insert some missing frees....)

Fix some formats to print unsigned quantities with "%u", not "%d".

Don't append text to items in the tree for non-string values in
"dissect_ndr_nt_STRING_string()".

svn path=/trunk/; revision=4986
2002-03-19 22:09:23 +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 f13c5b2154 Updates from Tim Potter.
svn path=/trunk/; revision=4493
2002-01-07 19:55:48 +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 81d7ded14e Rename the "packet-msrpc-XXX.[ch]" files to "packet-dcerpc-XXX.[ch]", as
per Todd Sabin's suggestion.

svn path=/trunk/; revision=4242
2001-11-21 02:08:57 +00:00