Commit Graph

104 Commits

Author SHA1 Message Date
Tim Potter 4ccbfa3edc Guy suggested that the dcerpc opnum value_string code could be simplified
somewhat.  Now the dynamic initialisation of the value_string is contained
in the value_string_from_subdissectors() function instead of being
distributed amongst the dcerpc dissectors.

svn path=/trunk/; revision=8123
2003-08-04 02:49:04 +00:00
Tim Potter 860d64e038 Fix misdissection of spoolss enumprinterdataex replies:
- skip dissection of value if value length is zero
 - add placeholder for REG_MULTI_SZ value proto item
 - rename local variable start to start_offset for consistency

svn path=/trunk/; revision=8019
2003-07-14 04:46:48 +00:00
Tim Potter 623f5b865d Dynamically create DCERPC opnum value_strings from the subdissector
list rather than duplicating this information in the dissector.  Some
of the opnum strings were starting to get out of date as developers
forgot to update the information in both places.

svn path=/trunk/; revision=7936
2003-06-26 04:30:31 +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 64a8d94d5f Get rid of a debugging message.
svn path=/trunk/; revision=7749
2003-05-27 07:18:47 +00:00
Tim Potter 180e410bd4 More work on dissecting generic and standard mappings for NT access masks.
Also, it turns out that there are three types of specific access permissions
for printing - printer, print server and job specific bits.

svn path=/trunk/; revision=7669
2003-05-15 02:15:13 +00:00
Tim Potter e3dabb27e2 Move the specific rights dissection function and name into a structure
instead of passing them around as separate parameters.  This is a
prelude to adding generic and standard mapping to the access mask
dissection.

svn path=/trunk/; revision=7591
2003-04-28 04:44:54 +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 79ac2b53bd When dissecting a SYSTEM_TIME, include the milliseconds in the top-level
summary item.

svn path=/trunk/; revision=7461
2003-04-15 08:11:33 +00:00
Tim Potter 8d78af7453 Some COL_INFO goodies for SpoolssWritePrinter.
svn path=/trunk/; revision=7435
2003-04-10 05:38:43 +00:00
Tim Potter 795926735d When dissecting specific rights, pass a name string down so the
proto item says "foo specific rights" instead of just "specific
rights".

svn path=/trunk/; revision=7401
2003-04-03 05:43:59 +00:00
Tim Potter 40f0abad4b Don't append text in cb_notify_str_postprocess() if text is the empty string.
Cleaned up some all caps proto items to more friendly looking text.

Append number of notifies within a notify option structure to the proto_item.

svn path=/trunk/; revision=7195
2003-02-25 02:08:05 +00:00
Tim Potter ce00b6057c Change SPOOLSS policy handle string names to be consistent with
the SAMR ones.

svn path=/trunk/; revision=7188
2003-02-24 04:39:21 +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
Tim Potter 2ef4720071 More cleanups - nearly done!
svn path=/trunk/; revision=7150
2003-02-14 06:23:45 +00:00
Tim Potter be1760bfb9 More cleanups.
Added name parameter and add_subtree boolean to dissect_SYSTEM_TIME()

Decorate COL_INFO with changeid and notify information for print
notify RPCs.

svn path=/trunk/; revision=7121
2003-02-11 03:22:59 +00:00
Tim Potter c4c96e0e5e Deleted dissect_unistr2() function - call dissect_ndr_cvstring() instead.
Hooray - I think that's the last of the spoolss specific string routines
cleaned up.

Cleanup of print notify dissections:

 - rename hf variable names
 - added 'job total bytes' and 'job bytes printed' filter fields
 - fixed bug dissecting job notify data introduced when converting to NDR
   routines
 - add hidden values for notify data so that filtering on (say) printer
   name brings up notify data that references it
 - decorate some higher level print notify proto_items to make things look
   pretty

Add printer name to ReplyOpenPrinter policy handle name.

svn path=/trunk/; revision=7113
2003-02-10 06:21:57 +00:00
Tim Potter ec194a0766 Cleanup of printer forms dissection:
- display more data in COL_INFO

 - replaced per-RPC level fields with generic spoolss.form.level one

 - put the form type value string into the hf initialisation instead
   of displaying it by hand using proto_tree_add_text

 - added hidden field for all forms RPCs (filter on spoolss.form to get
   all form related RPCs)

 - removed useless dissect_form_name() function

svn path=/trunk/; revision=7111
2003-02-10 02:11:36 +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 e15193fa72 Fix callers to dissect_nt_sec_desc() to use new function interface.
Dissection of security descriptors in SPOOLSS RPC calls now display
the correct meaning of the specific access mask bits.

svn path=/trunk/; revision=7087
2003-02-07 06:04:28 +00:00
Tim Potter 09995a2127 Cleaned up print job filterable fields.
Set item len for devicemode dissector.

Fixed dissection of relative strings so that the actual value of
the string is assigned to the hf item instead of the empty string.

Dissect JOB_INFO_2 structure.

svn path=/trunk/; revision=7078
2003-02-05 06:55:56 +00:00
Tim Potter 7a19ab5323 Deleted RPC request/response proto items from the spoolss dissector as
it's done better in the dcerpc dissector.

svn path=/trunk/; revision=7075
2003-02-05 01:36:54 +00:00
Tim Potter 74d71933ec Fixed bug in dissect_printerdata_data()
Display something useful in COL_INFO when dissecting REG_BINARY
printerdata.

Display the value needed field in value subtree.

svn path=/trunk/; revision=7073
2003-02-05 00:36:35 +00:00
Tim Potter 6b8a47a691 Convert to new DCERPC string handling functions. There are still some
cosmetic bugs to work out though.

svn path=/trunk/; revision=7069
2003-02-03 02:14:01 +00:00
Tim Potter 1c898c8a11 Fixed memory leak in dissect_unistr2().
Fixed double free bug in GetPrinterData occuring when applying a filter.

Cleaned up same bit of code in OpenPrinterEx.

svn path=/trunk/; revision=7051
2003-01-30 23:41:28 +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
Tim Potter 448023934d Clean up the handling of null buffers in getprinter, getform,
getjob and getprinterdriver2.

svn path=/trunk/; revision=7037
2003-01-30 05:11:33 +00:00
Tim Potter b846a41c05 Cleanup of filterable fields for printer data and devicemodes.
Added a stack of value_strings for devicemode fields that didn't
have them already.

svn path=/trunk/; revision=7027
2003-01-28 22:51:54 +00:00
Tim Potter 8af5b67b4e Convert dissector to callback based version of dissect_ndr_pointer().
This fixes a bunch of neat stuff that was broken after the conversion
to the dissect_ndr_* functions like printer handle tracking by name
and many COL_INFO things.

svn path=/trunk/; revision=7018
2003-01-28 06:42:20 +00:00
Tim Potter 23a6b3819c Change name of proto item for UINT16UNI.
Use dissect_ndr_uint32 instead of dissect_doserror() to peek at the
RPC error in SpoolssOpenPrinterEx_r.

svn path=/trunk/; revision=6935
2003-01-16 22:44:05 +00:00
Tim Potter 5039537845 Finish converting remaining RPCs to ndr routines.
Deleted all the old crufy ndr pointer dissection. Hooray!

Next on the hit list is some refactoring of the ndr string
routines...

svn path=/trunk/; revision=6899
2003-01-11 04:40:21 +00:00
Tim Potter 855f004140 Converted some more RPCs to ndr routines.
svn path=/trunk/; revision=6897
2003-01-11 00:42:12 +00:00
Tim Potter 08d2e5e8b7 Converted enumprinters and enumprinterkey rpc to ndr routines.
svn path=/trunk/; revision=6892
2003-01-10 05:41:29 +00:00
Tim Potter 6abd907e29 Convert enumprinterdataex rpc to ndr format calls.
svn path=/trunk/; revision=6891
2003-01-10 05:01:48 +00:00
Tim Potter 2e5169d5aa More conversions to NDR routines. This commit does most of the printerdata
routines except for the enumprinterdata values.  Note the display of
strings inside the protocol tree is broken due to lack of a unicode
string frametype.

svn path=/trunk/; revision=6784
2002-12-13 06:07:04 +00:00
Tim Potter e7eeefc8ff Guy has pointed out that this dissection looks wrong. In the ethereal
output for a USER_LEVEL_1 it looks like the info level and container
pointer are transposed.  I'm not even sure this structure is a
container

svn path=/trunk/; revision=6783
2002-12-13 04:58:56 +00:00
Guy Harris cf54ab47b7 When dissecting a buffer, use the tvbuff for the buffer, as the offset
we're using is relative to the beginning of that tvbuff, not relative to
the beginning of the containing tvbuff; that also lets us use -1 when in
"proto_tree_add_text()" calls when we mean "to the end of the buffer.

Fix the comment for one field.

svn path=/trunk/; revision=6781
2002-12-12 08:05:31 +00:00
Tim Potter 31754bcb7c Decode getprinter level 7.
svn path=/trunk/; revision=6742
2002-12-04 05:41:47 +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 f1d905c917 Make the pointer passed by reference as the last argument of
"dissect_ndr_uint8s()" a const pointer, as that's what
"dissect_ndr_uint8s()" expects.

svn path=/trunk/; revision=6690
2002-11-28 04:56:43 +00:00
Guy Harris 94b5a36fe1 Make "dissect_spoolss_uint16uni()" take an extra argument giving the
name of the field being dissected, and, if it's not null, use it instead
of "UINT16UNI".  Pass the appropriate argument in some calls.

In "SpoolssOpenPrinterEx_q()", put in some #if 0'ed out code to note
what should be done with the printer name when we can get it.

svn path=/trunk/; revision=6670
2002-11-23 08:57:15 +00:00
Tim Potter 2ca021395a Some more spoolss ndr conversions. OpenPrinterEx now decodes it's
arguments correctly.  There's a string datatype, a devicemode
container with a possibly null devicemode, and a "user level"
structure, whatever that is.

svn path=/trunk/; revision=6659
2002-11-19 05:25:04 +00:00
Tim Potter bf87f85692 Fix dissection of printer info levels 0-3 which has been broken for a
while.  Also convert to dissect_ndr_* functions instead of old-style
prs_* functions.

Converted devicemode dissection to ndr functions as well.  There are
still a bunch of value_strings that can be written to decode some of
the constants here.

svn path=/trunk/; revision=6658
2002-11-19 03:01:18 +00:00
Tim Potter 4518450b28 Convert getprinter info 0, 1, 2, 3 to dissect_ndr routines. Hooray!
The old prs_DEVMODE function is still used by something else for the
moment.

svn path=/trunk/; revision=6607
2002-11-11 05:39:51 +00:00
Guy Harris acf6949830 Eliminate a compiler warning, and handle overflows.
svn path=/trunk/; revision=6589
2002-11-08 19:58:09 +00:00
Richard Sharpe aac18f73d4 More patches from Jim McDonough
svn path=/trunk/; revision=6587
2002-11-08 19:29:39 +00:00
Richard Sharpe d15a388ded Another patch from Jim McDonough.
svn path=/trunk/; revision=6586
2002-11-08 19:25:42 +00:00