Commit Graph

68 Commits

Author SHA1 Message Date
Stefan Metzmacher 1ec28b4a08 packet-dcerpc: let dissect_dcerpc_cn_auth() always dissect the whole auth_info
As all this information belongs together I'm moving it into a subtree.

Change-Id: I839a5a6294360976a78b4b43f219e30381b4f516
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/17878
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-23 04:27:11 +00:00
Guy Harris d7fe514fc0 Improve support for single-character fields and filter expressions.
Add an FT_CHAR type, which is like FT_UINT8 except that the value is
displayed as a C-style character constant.

Allow use of C-style character constants in filter expressions; they can
be used in comparisons with all integral types, and in "contains"
operators.

Use that type for some fields that appear (based on the way they're
displayed, or on the use of C-style character constants in their
value_string tables) to be 1-byte characters rather than 8-bit numbers.

Change-Id: I39a9f0dda0bd7f4fa02a9ca8373216206f4d7135
Reviewed-on: https://code.wireshark.org/review/17787
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-09-19 02:51:13 +00:00
Michael Mann e0e574d167 Refactor DCE/RPC dissection to include a real dissector table.
This is hopefully just the first step in getting DCE/RPC dissection to use "standard" APIs instead of homegrown ones.
For starters, it allows Decode As functionality to be less hacky (although incomplete in Qt)

Change-Id: Ia0923a3d8d514ab7acce32e26ee7e08f6e24feca
Reviewed-on: https://code.wireshark.org/review/11468
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-04 12:43:35 +00:00
Stefan Metzmacher cef1cfa81d packet-dcerpc: add dissect_ndr_ucarray_block()
Change-Id: Ibfb49738ea35d1d02220d69187a6083d5ebbae25
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/11365
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-31 00:41:34 +00:00
Stefan Metzmacher 252ac26fc2 packet-dcerpc: pass dcerpc_info to dcerpc_dissect_fnct_blk_t
Change-Id: I92711ee39850f6710eaebf5c678496e7cd9b5f59
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/11364
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-30 23:24:28 +00:00
Gerald Combs 5c80f08648 Add DCE-RPC and ONC-RPC service response time dialogs.
Add RpcServiceResponseTimeDialog, which handles DCE-RPC and ONC-RPC
service response time statistics. Try to make it as lightweight as
possible, since we might want to pull this into the RPC dissectors
similar to the other SRT statistics.

Allow program names on the command line in place of numbers or UUIDs. Make
matches case-insensitive. E.g. the following are equivalent:

    -z rpc,srt,100003,3
    -z rpc,srt,nfs,3
    -z rpc,srt,NFS,3

as are the following:

    -z dcerpc,srt,f5cc5a18-4264-101a-8c59-08002b2f8426,56
    -z dcerpc,srt,nspi,56
    -z dcerpc,srt,NSPI,56

Change-Id: Ie451c64bf6fbc776f27d81e3bc248435c5cbc9e4
Reviewed-on: https://code.wireshark.org/review/9981
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-08-12 20:17:35 +00:00
Michael Mann 6de6f7f0f8 Further refactor SRT stats.
Create "common" SRT tap data collection intended for all GUIs.   Refactor/merge functionality of existing dissectors that have SRT support (AFP, DCERPC, Diameter, FC, GTP, LDAP, NCP, RPC, SCIS, SMB, and SMB2) for both TShark and GTK.

SMB and DCERPC "tap packet filtering" were different between TShark and GTK, so I went with GTK filter logic.
CAMEL "tap packet filtering" was different between TShark and GTK, so GTK filtering logic was pushed to the dissector and the TShark tap was left alone.

Change-Id: I7d6eaad0673fe628ef337f9165d7ed94f4a5e1cc
Reviewed-on: https://code.wireshark.org/review/8894
Petri-Dish: Michael Mann <mmann78@netscape.net>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-21 03:35:13 +00:00
Michael Mann 4d74d0dccd Eliminate proto_tree_add_text from packet-dcerpc-ndr.c and packet-dcerpc-netlogon.c
Change-Id: I65eff9c8087424087a307f18b96a202f0364e371
Reviewed-on: https://code.wireshark.org/review/8714
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-05-31 21:08:59 +00:00
Micha Reiser afe07a9b09 - Mark some DCE/RPC functions as public do allow calls from plugins
- DCOM:
 	* Mark some DCOM functions as public do allow calls from plugins
	* Add Support for Additional Variant Types  Money, I8, UI8
	* Fix an uint32 overflow when dissecting nwstringz0 where the length is 0
	* Use WS_DLL_PUBLIC instead of WS_DLL_PUBLIC_DEF

Change-Id: I02861a09203c6b42326f5a7b7e652e0f7c26d369
Reviewed-on: https://code.wireshark.org/review/8222
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-04-29 12:52:10 +00:00
Guy Harris 499d95964d Eliminate e_uuid_t in favor of e_guid_t.
That eliminates a redundant and confusing data type, and avoids issues
with one piece of code using e_uuid_t but wanting to use routines
expecting an e_guid_t.

Change-Id: I95e172d46d342ab40f6254300ecbd2a0530cde60
Reviewed-on: https://code.wireshark.org/review/7506
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-03 10:55:29 +00:00
Stefan Metzmacher 749c68cb56 packet-dcerpc: change transportsalt to guint64
This will be able to hold also SMB2 file ids and maybe other stuff in future.

Change-Id: Ib55895a346b7dc6562291730693453728c99fe91
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/6708
Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-01-22 12:26:34 +00:00
Michael Mann e489df5024 Don't assert that values fit in 32 bits if the NDR64 flag is set.
For now, this just pacifies fuzz-testing.  If real world examples have this, there needs to be a drastic overhaul to support fields that could be either 32 or 64-bit values.

Bug:9329
Change-Id: I3e28808ca0291868a5f84258b0ee1e2a922703c2
Reviewed-on: https://code.wireshark.org/review/4189
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-09-19 21:54:02 +00:00
Alexis La Goutte 296591399f Remove all $Id$ from top of file
(Using sed : sed -i '/^ \* \$Id\$/,+1 d')

Fix manually some typo (in export_object_dicom.c and crc16-plain.c)

Change-Id: I4c1ae68d1c4afeace8cb195b53c715cf9e1227a8
Reviewed-on: https://code.wireshark.org/review/497
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-04 14:27:33 +00:00
Guy Harris 59dddc25ec In dissect_ndr_byte_array(), use the field index from the dcerpc_info
structure, rather than a fixed field.  Get rid of that fixed field, as
it's no longer needed.

Use dissect_ndr_byte_array() rather than dissect_ndr_char_cvstring() in
a case where we have an opaque byte array.

Have dissect_ndr_cvstring() and dissect_ndr_vstring() - and, therefore,
routines that call them, such as dissect_ndr_cstring(),
dissect_ndr_char_cvstring(), dissect_ndr_char_vstring(), and
dissect_ndr_wchar_vstring() - require that the field being used by an
FT_STRING field.  Manually fix a case where the PIDL generator makes
such a field FT_NONE rather than FT_STRING.  Also handle EBCDIC, just in
case we happen to see a packet with EBCDIC strings.

Use tvb_get_string_enc(), rather than tvb_get_unicode_string() or
tvb_get_string(), in dissect_ndr_cvstring() and dissect_ndr_vstring().

svn path=/trunk/; revision=54134
2013-12-15 19:48:15 +00:00
Michael Mann 6505190fb7 Move DCERPC data in packet_info needed for Decode As into packet scoped proto data.
svn path=/trunk/; revision=53559
2013-11-25 00:14:50 +00:00
Michael Mann e2df7c83cb Move dceprc_procedure_name from packet_info to dcerpc_info. Doesn't appear to be "used" by dissectors, just stored (for help in debugging?).
svn path=/trunk/; revision=53552
2013-11-24 20:55:55 +00:00
Gerald Combs 70709e1b35 Move common "decode as" preference code to epan.
We presumably want "decode as" behavior to be consistent across UIs so
call load_decode_as_entries() from read_prefs().

svn path=/trunk/; revision=53498
2013-11-22 00:20:23 +00:00
Michael Mann 01c8945438 Provide "Decode As" functionality through dissectors themselves instead of the GUI. Bug 9450 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450)
The basic idea behind this design is to have dissectors register with a "decode as list" with their name and dissector table.  When "Decode As" dialog is launched, any "registered" dissector found in the packet will cause a tab to be created in the dialog.  Any GUI (GTK+/Qt/tshark) can just hook into the "decode as list" to see what can be provided.

This patch includes the GUI portion of the functionality (including packet-dcerpc.[ch] because it had some GUI dependencies that are now removed).

Other notes:
1. Some "GUI text" (UTF8_LEFTWARDS_ARROW and similar) made their way into the dissector code.  Not sure how necessary it is and if reformatting the strings to avoid the macros is desired (TCP/UDP use it, SCTP doesn't).

2. I converted the SCTP functionality to have 2 tabs (instead of radio button), currently both are labeled "Transport" which could be confusing to users.  Naming suggestions welcome (as well as for naming of tabs from other dissectors).

3. BER and DCERPC have more opportunity to use Decode As now that they are selected based on dissector presense, not packet_info values.

4. Catapult DCT2000 populates pinfo->ipproto, yet under new design will not show up to do Decode As.  Should a "decode as item" be created for it?

5. BER dissector doesn't have Clear/Show Current functionality working (never did)

6. Bluetooth (in old design) could have been used "capture wide" instead of single packet (creating tabs of values not present in current packet), which goes against what I believe to be in the intent of Decode As, but I'm willing to hear counter-arguments.

svn path=/trunk/; revision=53446
2013-11-20 19:23:02 +00:00
Michael Mann 22760b2d2a Remove pinfo->private_data from DCERPC dissectors and instead have dcerpc_info* infomation be passed in as a function parameter. Bug 9387 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9387)
All "generated" source was manually modified (with the power of search/replace), but I believe the "source input" files have been adjusted (checked into revs 53098 and 53099) to reflect the necessary changes (with possible whitespace formatting differences).

The Microsoft compiler doesn't flag "unused function parameters", so I apologize in advance if I may have missed a few.  The "dcerpc_info* di" parameter is used in almost every function.

svn path=/trunk/; revision=53100
2013-11-06 14:31:29 +00:00
Michael Mann 15294a1261 Add a new api to allow dissection of the array payload as a whole. Bug 9307 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9307)
From Matthieu Patou 

svn path=/trunk/; revision=52743
2013-10-21 18:46:52 +00:00
Michael Mann 772fb97f76 We can't really have conformant strings they are always conformant and
varying but pidl insists on having a different function.  Bug 9306 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9306)

From Matthieu Patou.

svn path=/trunk/; revision=52742
2013-10-21 18:33:14 +00:00
Michael Mann ac7caf7007 Add APIs for PIDL generated code to return the value of the integer that was dissected. Bug 9305 (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9305).
From Matthieu Patou

svn path=/trunk/; revision=52741
2013-10-21 18:25:41 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Balint Reczey 1ebdb2e521 Export libwireshark symbols using WS_DLL_PUBLIC define
Also remove old WS_VAR_IMPORT define and related Makefile magic
everywhere in the project.

svn path=/trunk/; revision=47992
2013-03-01 23:53:11 +00:00
Gerald Combs 1ffc96d153 From Dirk Jagdmann: Fix a comment in the DCERPC dissector header.
svn path=/trunk/; revision=46208
2012-11-26 21:16:09 +00:00
Jakub Zawadzki bf81b42e1e Update Free Software Foundation address.
(COPYING will be updated in next commit)

svn path=/trunk/; revision=43536
2012-06-28 22:56:06 +00:00
Guy Harris c34b796445 Add a DREP_LITTLE_ENDIAN for the DCE RPC endianness bit in the data
representation.  Use it rather than a raw 0x10.

Add a DREP_ENC_INTEGER() macro that takes a pointer to the data
representation and returns either ENC_LITTLE_ENDIAN or ENC_BIG_ENDIAN;
use it for the encoding argument to proto_tree_add_item(), rather than
just the AND of drep[0] and DREP_LITTLE_ENDIAN, as it's not a boolean
any more, and for string values we'll be supporting character encodings
as well and thus won't be able to trust that the 0x10 bit will mean
"little endian".

Use ENC_NA for some other encoding values, i.e. for FT_BYTES and the
like.

Fix a couple of places in the DCOM dissector where we were passing the
byte-order bit rather than the field value to
proto_tree_add_uint_format().

Clean up white space.

svn path=/trunk/; revision=38128
2011-07-19 23:02:02 +00:00
Jaap Keuter 302d4c14df From Julien Kerihuel:
I've just finished to write a ncacn_http dissector for Wireshark which
provides the ability to dissect Outlook anywhere packets properly (as
specified by [MS-RPCH].pdf documentation.

svn path=/trunk/; revision=35259
2010-12-23 23:50:14 +00:00
Ronnie Sahlberg 9a9f7acffe From Julien Kerihuel, add support for
unaligned unmarshalling of dissectors generated by PIDL.

This will allow us to use PIDL and additional IDLs from the samba 
project since they use "noalign" for certain protocols.


This may also allow us to use PIDL to describe, and machinegenerate 
dissectors for normal, non-DCERPC, protocols.


This patch for PIDL is still under review, but the PIDL patch is l;ikely 
to be committed soonish.




svn path=/trunk/; revision=31583
2010-01-20 06:02:42 +00:00
Ronnie Sahlberg 061284dbbd merge some changes to samr from the samba idl
svn path=/trunk/; revision=30272
2009-10-04 04:14:49 +00:00
Ronnie Sahlberg e6a48cb668 rename 2or4 to a new type guint1632 and call the dissector for this
function   dissect_ndr_uint1632()


svn path=/trunk/; revision=30265
2009-10-03 05:23:48 +00:00
Ronnie Sahlberg 343b961a48 rename dissect_ndr_4or8 to dissect_ndr_uint3264 to match hte name of
the new datatype uint3264.
create a fake guint3264 type as well


svn path=/trunk/; revision=30264
2009-10-03 05:16:51 +00:00
Ronnie Sahlberg 7783d0f03e add a helper that supports decoding either a 16 or 32 bit integer based
on whether nrd or ndr64 is used.


svn path=/trunk/; revision=30263
2009-10-03 04:49:04 +00:00
Ronnie Sahlberg 0a9289108d teach the dce/rpc pointer dissector about ndr64 and make it dissect
pointers as 8 byte entities when ndr64 is negotiated


svn path=/trunk/; revision=30253
2009-10-03 00:03:48 +00:00
Ronnie Sahlberg 2ea2589afb we need to copy the information about the transport syntax, i.e. i fit
is ndr64 or not, from the bind information to the data we store for each 
individual pdu, since the trnasport syntax may change dynamically back 
and forth between "normal" and "ndr64" on the same conversation.



svn path=/trunk/; revision=30226
2009-10-01 08:55:25 +00:00
Gerald Combs 8afdf51d9f From Didier Gautheron via bug 3531:
Recent glib versions always include signal.h in gbacktrace.h

On Linux PPC signal.h defines PT_R4 which is also defined by samba and
compilation fails.

svn path=/trunk/; revision=28727
2009-06-14 20:57:57 +00:00
Ronnie Sahlberg bf27687d94 add more policy handle types for the new LSA dissector
svn path=/trunk/; revision=26319
2008-10-01 00:47:05 +00:00
Ronnie Sahlberg 4284906aba based on the novell idllib sources :
add dissection of the 16 byte header prior to the NDR data when NDR is 
transported as a blob ontop of !dcerpc
like the LOGON_INFO in the PAC in kerberos


svn path=/trunk/; revision=24289
2008-02-08 09:20:02 +00:00
Ronnie Sahlberg 8fde3b7561 rename dcerpc_smb_store_pol_name to dcerpc_store_polhnd_name
rename dcerpc_smb_fetch_pol  to dcerpc_fetch_polhnd_data and also make 
it take an additional parameter to return the "type" of the policy 
handle, if such a type was stored.

extend the pol_value structure used to track policy handles to also 
store a type to represent what created the policy handle
types could be USER/ALIAS/CONNECT/... etc handles returned from the 
SAMR interface

add a new helper function  dcerpc_store_polhnd_type()

track policy handles between request/responses for dcerpc

update the samr.cnf file to make the samr dissectors for
SetSecurity/QuerySecurity dissect the specific bits for the security 
descriptor correctly based on whether the policy handle refers to a 
CONNECT/DOMAIN/USER/ALIAS or GROUP



svn path=/trunk/; revision=22703
2007-08-28 11:45:08 +00:00
Ronnie Sahlberg d71ee1a0e5 update PIDL_dissect_cvstring so that it can be used in a future pidl to
prettify strings


svn path=/trunk/; revision=21722
2007-05-08 00:04:51 +00:00
Ronnie Sahlberg bf87640840 add PIDL friendly helper to manage unicode strings
svn path=/trunk/; revision=20941
2007-02-27 09:37:48 +00:00
Ronnie Sahlberg 66cf1f33e0 add new flag for PIDL conformance files : PIDL_SET_COL_INFO
which applies (for now only) to integer types.
when this flag is specified as PARAM_VALUE the fields name and its value will be pushed onto the info column of the summary line



svn path=/trunk/; revision=20922
2007-02-25 11:48:06 +00:00
Ronnie Sahlberg 470e92125e move the defines for PIDL_POLHND_{OPEN|CLOSE} to packet-dcerpc.h
also change their values to use the top order bits of an uint32 instead of the least significant ones



svn path=/trunk/; revision=20919
2007-02-25 01:47:43 +00:00
Ronnie Sahlberg aa3d3793b7 add new PIDL friendly helpers for dissection of integer types.
these new helpers take a parameter that can be used to decorate the tree and summary line (when this parameter is acted upon/implemented in the code inside the helpers)

WINREG was regenerated using a patched version of PIDL. Mainline version of PIDL does not yet have this patch applied.



svn path=/trunk/; revision=20918
2007-02-25 01:34:41 +00:00
Ronnie Sahlberg f6976864bf the way we pass dcerpc strings from deep down in helpers to high level dissector functions (dcv->private_data) for things such as strings and sids is a mess and very difficult to handle without a lot of memory leakage.
the biggest problem in changing this is the dcv->private_data usage.


add a dcv->se_data which can keep data around from a request to a response and use this to change the LSA/OpenPolicy2 servername passing from request to response as a test pattern of moving all users of dcv->private data over to use dcv->se_data.

once all users are migrated over we can then change the dcv->private data pointer to be of ep scope and thus not need an explicit free (which is quite difficult and it is quite difficult in the old semantics to know WHEN we need to free this pointer)

this will eventually make the usage more clean and at the same time close down quite a few memory leaks.


eventually this will make dissect_ndr_nt_SID return a pointer to ep allocated memory that need not be explicitely freed.



svn path=/trunk/; revision=19226
2006-09-13 08:30:16 +00:00
Ulf Lamping 7d04019388 some further work on the GUID/UUID resolvings
most of the relevant code moved to guid_utils
lot of corresponding code cleanup in packet-dcerpc.c
still using GHashTable
still not using a manuf like file

svn path=/trunk/; revision=18939
2006-08-17 19:09:41 +00:00
Ulf Lamping 5616d05c1f keep the (optional) Object UUID in the call value
svn path=/trunk/; revision=18613
2006-06-29 18:51:30 +00:00
Ulf Lamping 61396bca97 the drep parameter of dissect_dcerpc_uuid_t() should be guint8 * instead of char * (just like all the other dissect_dcerpc_...() functions).
This should fix some "differ in signedness" warnings (and maybe will raise new ones, which should be fixed at the calling places then)

svn path=/trunk/; revision=18605
2006-06-29 08:08:36 +00:00
Gerald Combs f7e38bd5e6 Change ETH_VAR_IMPORT to WS_VAR_IMPORT. Try to fix a duplicate variable
definition in the Catapult DCT2000 code.

svn path=/trunk/; revision=18524
2006-06-20 18:30:54 +00:00
Ronnie Sahlberg feab79e328 change a whole bunch of ethereal into wireshark
svn path=/trunk/; revision=18196
2006-05-21 04:49:01 +00:00