Commit Graph

218 Commits

Author SHA1 Message Date
Bill Meier 9c8a91f259 Use consistent indentation.
svn path=/trunk/; revision=40185
2011-12-13 21:03:57 +00:00
Bill Meier 4a976f1be7 Use tvb_new_child_real_data() instead of tvb_new_real_data() + tvb_set_child_real_data_tvbuff().
svn path=/trunk/; revision=40173
2011-12-13 04:01:33 +00:00
Bill Meier 54b72021bb Fix encoding arg for various fcn calls:
- proto_tree_add_bits_item
 - proto_tree_add_bits_ret_val
 - proto_tree_add_bitmask
 - tvb_get_bits
 - tvb_get_bits16
 - tvb_get_bits24
 - tvb_get_bits32
 - tvb_get_bits64


svn path=/trunk/; revision=39539
2011-10-24 19:57:53 +00:00
Bill Meier 794757ae8f For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.
Also: remove trailing whitespace for a number of files.

svn path=/trunk/; revision=39503
2011-10-21 02:10:19 +00:00
Bill Meier 126aa85393 Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, FT_STRINGZ, FT_UINT_STRING as follows:
1. If there's no character encoding (ENC_ASCII, ...) specified
    then use ENC_ASCII.
 2. For all but FT_UINT_STRING, always use ENC_NA
    (replacing any existing True/1/FALSE/0
    /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN).



svn path=/trunk/; revision=39426
2011-10-15 18:46:26 +00:00
Bill Meier 94f36ca4ff Use ENC_NA as encoding for proto_tree_add_item() calls which directly reference an hf item (in hf[] with types:
FT_NONE
   FT_BYTES
   FT_IPV6
   FT_IPXNET
   FT_OID

Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN

svn path=/trunk/; revision=39260
2011-10-04 22:44:31 +00:00
Anders Broman 5d342b64ae Set encoding.
Should 
hf_smb_server_guid
hf_smb_dfs_referral_server_guid
be FT_GUIDS?

svn path=/trunk/; revision=39209
2011-10-01 08:11:06 +00:00
Bill Meier c4b4394936 From Stefan Metzmacher: Support for SMB 2.22 features;
"Patches to add most things for SMB 2.22"

https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6394

svn path=/trunk/; revision=39205
2011-10-01 01:57:38 +00:00
Bill Meier 7e1977c4d5 From Stefan Metzmacher: Fix flags in packet-smb
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6320

svn path=/trunk/; revision=38940
2011-09-08 16:19:35 +00:00
Stig Bjørlykke 6c6c045e3a Initialize trunc.
Fix CID 1229.

svn path=/trunk/; revision=38572
2011-08-16 19:25:29 +00:00
Jeff Morriss 7ad71a2d78 Treat TVBs as opaque: use the accessor functions instead of accessing the fields
directly.

svn path=/trunk/; revision=37420
2011-05-27 01:57:33 +00:00
Jeff Morriss 11ac49f225 Use tvb_get_ephemeral_string() instead of tvb_get_ptr().
svn path=/trunk/; revision=37322
2011-05-20 03:20:20 +00:00
Guy Harris 375b1bf4b4 Give some routines used for info levels that appear both in set and get
names beginning with dissect_qspi_, and give some of them names with the
info level structure in them rather than the SNIA CIFS specification
section number.

Have separate routines for SMB_INFO_STANDARD and SMB_INFO_QUERY_EA_SIZE;
SMB_INFO_STANDARD is specified differently in the SNIA CIFS
specification and the MS-CIFS specification, and some captures have the
SNIA CIFS version, with the EA length and some have the MS-CIFS version
without it.  The dissector for SMB_INFO_STANDARD will dissect it if it's
there and not say "this structure is truncated" if it's not there.

Rename dissect_qfi_SMB_FILE_ALTERNATE_NAME_INFO() to
dissect_qfi_SMB_FILE_NAME_INFO(), as it also dissects
SMB_QUERY_FILE_NAME_INFO.

Merge the dissectors for SMB_FILE_ALLOCATION_INFO and
SMB_SET_FILE_ALLOCATION_INFO, and for SMB_FILE_END_OF_FILE_INFO and
SMB_SET_FILE_END_OF_FILE_INFO, as the structures are the same.

Dissect some presumed "passthrough info levels" the same way the
corresponding official SMB infos are dissected.

Expand some comments for info level dissectors to give the MS-CIFS
section number and to give some other details.
 
If an info level is truncated, put in an expert info error.

If we don't know about a given info level, just dissect the body as
"Information level unknown", rather than having it dissected as an
"unknown information" trailer.

svn path=/trunk/; revision=37297
2011-05-19 16:22:21 +00:00
Guy Harris 0f41b64142 The routines declared in packet-smb.h are defined in packet-smb.c;
include packet-smb.h in packet-smb.c so that we check the declarations
against the definitions.

In query ops, info level 2 is Query EA Size, not Query EAs From List. 
In set ops, info level 2 is Set EAs, not Query EA Size.

Expand the constants for the Trans2 subcodes to 16 bits.

The tvb argument to dissect_find_file_unix_info2() is used.

svn path=/trunk/; revision=37286
2011-05-19 09:47:03 +00:00
Guy Harris 092b0120ae Don't leave the truncation flag unset in any of the info level
dissectors.

svn path=/trunk/; revision=37209
2011-05-17 20:04:22 +00:00
Guy Harris 9927d1ff31 Give the UNIX-extension routines used for info levels that appear both
in set and get names beginning with dissect_qspi_.

svn path=/trunk/; revision=37192
2011-05-16 22:55:22 +00:00
Guy Harris 88fe523c48 Fix some comments.
Get rid of null-pointer tests for t2i in the "not null" branch of an
earlier test whether it's null, as those tests are redundant.

Use a switch statement to check the subcommand for Trans2.

If t2i->info_level is -1, it means we don't know the info level, for
whatever reason (e.g., the request was cut short by the snapshot length
before the info level).  Report it as such.

svn path=/trunk/; revision=37183
2011-05-16 18:32:35 +00:00
Guy Harris 2a1e380545 Remove the qpi_ from info level dissectors used for set info calls as
well.

svn path=/trunk/; revision=37139
2011-05-14 02:52:04 +00:00
Guy Harris 03cd4f2cfd For Find File Unix and Unix Info2, spell it "Unix", to match Query File
and Set File.

Add Query and Set File Unix Info2; use common code to dissect the Unix
Info2 structure.  Use common code for Unix Basic, while we're at it.

svn path=/trunk/; revision=37138
2011-05-14 01:28:49 +00:00
Jeff Morriss 009156289f Fix the test.sh failures based on Guy's suggestion in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5445#c15 :
Add a new tap flag to indicate that a tap listener is just a "dissector helper",
that is, a tap which is used by a dissector to help it do its dissection but
does not, itself, require dissection.

Use this new flag in the dissectors which register taps.

Remove the (now-unused) have_tap_listeners() function.

svn path=/trunk/; revision=37069
2011-05-12 03:18:34 +00:00
Guy Harris 37adc5c880 Support SMB_FIND_FILE_UNIX_INFO2.
Don't use "link destination" for file names in SMB_FIND_FILE_UNIX.

Link to the page for Microsoft's public protocol specifications and to
the Samba Wiki page for the UNIX extensions.

Fix a typo in a variable name.

svn path=/trunk/; revision=37023
2011-05-09 02:55:31 +00:00
Guy Harris f5b20ecc33 Count padding bytes against the transaction data byte count.
svn path=/trunk/; revision=37022
2011-05-09 02:42:58 +00:00
Alexis La Goutte 45b060dd13 Fix Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=36872
2011-04-26 14:43:00 +00:00
Gerald Combs 0ea5ded80c Add NULL checks. Fixes Coverity CIDs 509 and 510.
svn path=/trunk/; revision=36670
2011-04-16 21:25:34 +00:00
Bill Meier 8c4a4c09b9 Comment out code to create a subtree since it's (currently ?) unused: Coverity 1039;
Don't assign to a proto_item * if the value won't be used: Coverity 1040 & 1041.
Remove some unneede #includes;
Do some minor indentation & whitespace cleanup.

svn path=/trunk/; revision=36630
2011-04-13 21:00:44 +00:00
Stig Bjørlykke e43c9a35e4 Added a FALLTHRU comment to avoid a "missing break" warning.
Coverity 472.

svn path=/trunk/; revision=36366
2011-03-27 14:11:40 +00:00
Jeff Morriss 50e1634f4c Modify proto_tree_add_bytes_format() and proto_tree_add_bytes_format_value()
so that if the start_ptr is NULL the bytes are extracted from the given TVB
using the given offset and length.

Replace a bunch of:

proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, tvb_get_ptr(tvb, offset, length), [...])

with:

proto_tree_add_bytes_format*(tree, hf, tvb, offset, length, NULL, [...])

svn path=/trunk/; revision=35896
2011-02-10 16:31:00 +00:00
Stig Bjørlykke 84bc28bd6a Introduce "Fragment count" filter element for all protocols doing reassembly.
svn path=/trunk/; revision=35705
2011-01-30 21:01:07 +00:00
Jeff Morriss 8d32d2066a There's no need to pass the result of tvb_get_ptr() as the 'value' in
proto_tree_add_*(): just use proto_tree_add_item().

Replace some tvb_get_ptr()s with tvb_get_ephemeral_string() or
tvb_get_const_stringz().

Use tvb_memeql() & tvb_memcmp().

svn path=/trunk/; revision=35558
2011-01-16 20:51:21 +00:00
Stephen Fisher 3bd641004b Proof of concept for using new tvb_get_ephemeral_unicode_stringz(), which was
just introduced in SVN revision 35253.  This new function has many more uses
in the SMB (and other) dissectors. 


svn path=/trunk/; revision=35254
2010-12-23 18:01:28 +00:00
Guy Harris a8bc4a0d13 Rename the routines that handle dissector tables with unsigned integer
keys to have _uint in their names, to match the routines that handle
dissector tables with string keys.  (Using _port can confuse people into
thinking they're intended solely for use with TCP/UDP/etc. ports when,
in fact, they work better for things such as Ethernet types, where the
binding of particular values to particular protocols are a lot
stronger.)

svn path=/trunk/; revision=35224
2010-12-20 05:35:29 +00:00
Bill Meier 03b57df5a0 Fix various typos and spelling errors.
svn path=/trunk/; revision=35126
2010-12-06 01:34:58 +00:00
Bill Meier e2123574dc Fix a crash I introduced in SVN #34692: A value_string ext referenced smb_cmd_vals rather than smb_cmd_vals_ext.
svn path=/trunk/; revision=34853
2010-11-12 17:28:01 +00:00
Bill Meier f543357d14 Use value_string_ext fcns to access certain value_string arrays.
svn path=/trunk/; revision=34692
2010-10-29 20:22:02 +00:00
Jeff Morriss 505fbf012a Fix the disssector assertion reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3877 :
The rest of the code assumes that sip can be NULL, so don't assert when it's
not.

Also make fid_cmp() static since it's only used in this module.

svn path=/trunk/; revision=34663
2010-10-27 21:08:49 +00:00
Anders Broman 58be4653b4 packet-smb.c:890: warning: data definition has no type or storage class
svn path=/trunk/; revision=34615
2010-10-22 05:47:01 +00:00
Anders Broman 9c9db7d4d4 From CaL Turney:
Add support for well-known SIDs/RIDs and option to display in hex.
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5286

svn path=/trunk/; revision=34613
2010-10-22 05:15:25 +00:00
Jeff Morriss cca3ba3ce2 (Refining the regexp...) Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34230
2010-09-24 02:51:40 +00:00
Jeff Morriss 0ff5638f37 Replace blurbs that match the name (case insensitive) with NULL.
svn path=/trunk/; revision=34227
2010-09-23 21:46:31 +00:00
Guy Harris 9a45206220 Dissect SMB_FILE_ATTRIBUTES, when used as file attributes rather than
search attributes, as a 16-bit quantity, with only the bits specified by
section 2.2.1.2.4 of [MS-CIFS].  Use dissect_file_ext_attr() in all
cases where we're dissecting SMB_EXT_FILE_ATTR, as specified by section
2.2.1.2.3 of [MS-CIFS].

svn path=/trunk/; revision=33753
2010-08-10 07:04:20 +00:00
Jaap Keuter 4853835a36 From Tan Kean Siong:
Dissect the SMB Tree_Connect_Andx Request and Response properly with
extension request and response which are documented in [MS-SMB] — v20100711

svn path=/trunk/; revision=33726
2010-08-06 17:46:27 +00:00
Jaap Keuter f33d886525 Fix for bug 4993:
Mac support flags are little endian too.

svn path=/trunk/; revision=33483
2010-07-10 09:47:20 +00:00
Guy Harris 6aba7f7109 OK, I checked the Microsoft spec; give some information on that.
svn path=/trunk/; revision=33249
2010-06-18 03:25:33 +00:00
Guy Harris 76dbfe68c5 Expand some comments.
svn path=/trunk/; revision=33248
2010-06-17 21:41:03 +00:00
Guy Harris 02ef0696ed Handle 64-bit file offsets in ReadAndX and WriteAndX.
svn path=/trunk/; revision=33240
2010-06-16 20:00:22 +00:00
Stig Bjørlykke 560424e4b8 Remove #include <inttypes.h>.
svn path=/trunk/; revision=33228
2010-06-15 15:32:19 +00:00
Stig Bjørlykke e915e93532 From David Perez & Jose Pico from Taddong S.L. via bug 4451:
This functionality keeps track of all SMB objects contained in a capture,
and is able to export to a file a full or partial captured file that has
been transfered through the SMB protocol. In a partial capture, the holes
produced by the non-captured information are filled out with zeros.
It includes the needed modifications of the SMB dissector in the way it keeps
track of the opened SMB files and also to feed the eo_smb tap listener.

svn path=/trunk/; revision=33227
2010-06-15 14:03:49 +00:00
Jeff Morriss 729de1a635 As suggested in http://www.wireshark.org/lists/wireshark-dev/200809/msg00075.html
(as referenced in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2907 ) and
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3411 :

Write a new convenience routine for finding a conversation and, if it is not
found, create it.  The frame number and addresses are taken from pinfo (as is
the common case).

Use this function in a bunch of dissectors.

svn path=/trunk/; revision=32790
2010-05-13 18:28:34 +00:00
Jeff Morriss 619ba9e3ce Fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4734 :
Don't crash on a malformed SMB packet.  According to svn blame, this code
has been here since rev 21713 though maybe something else changed to make the
crash apparent.

svn path=/trunk/; revision=32650
2010-05-03 19:33:23 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00