Commit Graph

297 Commits

Author SHA1 Message Date
Michael Mann 5e4e17ca5e Remove unnecessary tvb_ensure_bytes_exist calls.
All of the calls removed are followed by proto_tree_add_xxx calls of the same offset/length of the tvb_ensure_bytes_exist call.  The proto_tree_add_xxx calls should throw the exception, so we don't need the "double check".
There are probably more calls that can be removed, these were just obvious as first glance, spurred mostly by noticing the (ab)use in packet-wsp.c

Change-Id: I37cee347c8cf8ab0559e21562c802d3b37f4871e
Reviewed-on: https://code.wireshark.org/review/4833
Petri-Dish: Michael Mann <mmann78@netscape.net>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-10-19 15:26:43 +00:00
Bill Meier 24d50bc290 Adjust indentation to match editor modelines; Do other minor whitespace changes.
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353
Reviewed-on: https://code.wireshark.org/review/4502
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-06 17:12:33 +00:00
Bill Meier 18d72987cb Do encoding-arg changes (all benign)
For:
- FT_BYTES: Always use just ENC_NA
- integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN

Also:
- FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...)
- Change one case of incorrect '||' to '|'

Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0
Reviewed-on: https://code.wireshark.org/review/4184
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-19 01:38:08 +00:00
Bill Meier b14bf98c06 Fix spelling: cant-->can't, wont-->won't, etc
Change-Id: I4497f1b8b6eab0e576d9dd31b732965f9a6679c6
Reviewed-on: https://code.wireshark.org/review/4124
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-16 13:51:51 +00:00
Michael Mann 6691293a65 convert to proto_tree_add_subtree[_format]
Change-Id: I8d66b1bc7dbdfee3d4bf6fd3b3c21c6323b66f44
Reviewed-on: https://code.wireshark.org/review/2946
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-07-09 00:25:04 +00:00
Michael Mann 14824e6adf Revert "Fixup: tvb_* -> tvb_captured"
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html

This reverts commit 246fe2ca4c.

Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f
Reviewed-on: https://code.wireshark.org/review/2430
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19 18:25:59 +00:00
Dario Lombardo 246fe2ca4c Fixup: tvb_* -> tvb_captured
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f
Reviewed-on: https://code.wireshark.org/review/2377
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:14:58 +00:00
Dario Lombardo 971ffd683e Fixup: tvb_get_string(z) -> tvb_get_string(z)_enc
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe
Reviewed-on: https://code.wireshark.org/review/2376
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18 14:13:58 +00:00
Evan Huus f4b9ea4362 Initialize smb ioctl_function struct member
Bug:10020
Change-Id: I415a29dd36697887cb06485d6ed3a2b799a93464
Reviewed-on: https://code.wireshark.org/review/2342
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-17 21:28:29 +00:00
Evan Huus de00c49bd8 Convert a bunch of time_to_str functions to wmem
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983
Reviewed-on: https://code.wireshark.org/review/2245
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-16 17:26:25 +00:00
Michael Mann 73217d9f3f tvb_new_subset -> tvb_new_subset_length when length parameters are equal.
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is.

Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d
Reviewed-on: https://code.wireshark.org/review/1999
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-07 15:41:07 +00:00
Michael Mann b40cb1adea Apply found fix-encoding-args.pl errors in the dissector directory.
I coincidentally found a few files with errors, so I thought it might be time to run it on the whole directory again.

Change-Id: Ia32e54b3b1b94e5a418ed758ea79807c8bc7e798
Reviewed-on: https://code.wireshark.org/review/978
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06 15:11:36 +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
Stefan Metzmacher fcb0837d0c packet-smb: register a dissector on top of smb_direct
Change-Id: I316b958c6a91dc333bcdb468368f2c19fe8845d6
Old-Change-Id: I26a3088df12de9d74cf6c224b938003417b758f5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/58
Reviewed-by: Evan Huus <eapache@gmail.com>
(cherry picked from commit d0d83e5b85)
Reviewed-on: https://code.wireshark.org/review/389
2014-02-25 22:00:04 +00:00
Guy Harris 75015e4351 Can't register in a non-existent dissector table.
This will have to wait until the SMB Direct dissector is actually
committed.  There's no point in getting a bunch of "OOPS: dissector
table "smb_direct" doesn't exist" messages every time you run Wireshark
or TShark.

Change-Id: I9772eb3f119822fbeaa78876570798d49bb4cab9
Reviewed-on: https://code.wireshark.org/review/382
Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-02-25 19:55:25 +00:00
Stefan Metzmacher d0d83e5b85 packet-smb: register a dissector on top of smb_direct
Change-Id: I26a3088df12de9d74cf6c224b938003417b758f5
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/58
Reviewed-by: Evan Huus <eapache@gmail.com>
2014-02-25 17:58:34 +00:00
Alexis La Goutte 6d0f3d894d Fix indent (Use tabs)
Change-Id: I5c16950394915091a1dfb76e480ae7f2cba53e3f
Reviewed-on: https://code.wireshark.org/review/106
Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-02-04 13:03:07 +00:00
Stefan Metzmacher 505af30e01 packet-smb.c: real fix for https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5778
Change-Id: I33308c44791b487844f23db07d152897380d7cf1
Signed-off-by: Stefan Metzmacher <metze@samba.org>
Reviewed-on: https://code.wireshark.org/review/25
Reviewed-by: Evan Huus <eapache@gmail.com>
Tested-by: Evan Huus <eapache@gmail.com>
2014-01-31 16:36:25 +00:00
Guy Harris c6c1887a0b Have ip6_to_str() and tvb_ip6_to_str() return const pointers, as the
ip_to_str equivalents do.

Don't cast away constness, and don't make it necessary to do so.

svn path=/trunk/; revision=54767
2014-01-14 05:39:57 +00:00
Jakub Zawadzki deb2b236f2 Add missing includes
svn path=/trunk/; revision=54332
2013-12-21 17:23:17 +00:00
Evan Huus 2ae8edccea Rename more to_str functions to have ep_ in the name if they return ephemeral
buffers. Remove two unused functions.

svn path=/trunk/; revision=54250
2013-12-19 16:28:39 +00:00
Guy Harris 068008f04f Use proto_tree_add_item() in preference to fetching the string and
adding it with proto_tree_add_string().  Use tvb_get_string_enc() rather
than tvb_get_unicode_string() to fetch strings.

We assume a UTF-16 encoding for all "Unicode" strings.

Use tvb_strsize() and tvb_unicode_strsize() to get the lengths of
null-terminated strings.

Get rid of unused ett_nt_unicode_string variable.

svn path=/trunk/; revision=54158
2013-12-16 22:39:41 +00:00
Jakub Zawadzki 1053e722ed Fix warnings
svn path=/trunk/; revision=54089
2013-12-14 12:45:57 +00:00
Evan Huus 34b93ed41e Replace wmem_alloc with wmem_new in a few places, and wmem_new with wmem_new0 in
a few places to avoid uninitialized memory found while fuzz-testing with
valgrind.

svn path=/trunk/; revision=54066
2013-12-13 21:26:59 +00:00
Bill Meier 04cdccdb83 - Create/use several extended value_strings
(sort associated value_string arrays as needed);

- Use new VALUE_STRING_LIST mechanism/macros to
  create enums and value_string arrays for:
    WERR_errors, DOS_errors, SRV_errors, and HRD_errors;

- Declare certain global value_string arrays as static (local)
  and use global extended value_strings to reference same;
    (e.g., ms_coiuntry_codes value_string_array)

- Rename SMBE_... defs used in several different value_string arrays
  to prevent potential name collisions:
   ( e.g., for SRV_errors: SMBE_... ==> SMBE_SRV_...)
   Done for value_string arrays: DOS_errors, SRV_errors, HRD_errors;

- WERR_errors value_string array:
    Note that WERR associated defs no longer exist in the latest samba doserr.h.
    (The WERR_errors defs were originally generated from the samba doserr.h).
    For now: WERR_errors kept as is.

- ToDo: Fix PIDL-generated dcerpc dissectors to use NT_errors_ext
        and WERR_errors_ext extended value_strings.

- Add editor modelines to a few files.

- Make whitespace changes.


svn path=/trunk/; revision=53614
2013-11-27 16:30:20 +00:00
Martin Kaiser e72632c101 From Ralph Böhme
Add QUERY_FS_INFO info level SMB_QUERY_POSIX_WHOAMI

from me
remove unnecessary if(tree) checks
add one check before guint16 *bcp is decremented

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

svn path=/trunk/; revision=53598
2013-11-26 12:18:23 +00:00
Alexis La Goutte afe84fe4fd From Ralph Böhme via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9439
Add missing SMB_QUERY_CIFS_UNIX_INFO capability flags

Listed in https://git.samba.org/?p=samba.git;a=blob_plain;f=libcli/smb/smb_unix_ext.h;hb=HEAD

svn path=/trunk/; revision=53430
2013-11-19 12:26:49 +00:00
Jakub Zawadzki ae59b09443 Add missing includes in order to remove exceptions.h from proto.h (next commit).
svn path=/trunk/; revision=53230
2013-11-10 15:59:37 +00:00
Jeff Morriss d8f1af511f Mark a bunch of no-longer-used parameters as unused. Remove a couple of
unused parameters.

svn path=/trunk/; revision=52860
2013-10-26 00:41:54 +00:00
Michael Mann 1e0405a3a3 Remove SMB's use of private_data and just pass the data through all of the dissection functions
svn path=/trunk/; revision=52856
2013-10-25 23:59:30 +00:00
Bill Meier 9874da2fcb #if 0 numerous "unused const variables" (mostly value-string-arrays);
Also; fix a few "set but not used" warnings.

svn path=/trunk/; revision=52780
2013-10-23 06:29:11 +00:00
Cal Turney 4ae53bc208 Reorder all of the bitmask trees according to its endianess from highest to lowest order bit.
These consist of the following bitmask fields: 
[packet-smb.c] 'Create Flags', 'Access Mask', 'File Attributes', 'Share Access', 'Create Options',
               'Security Flags', 'Optional Support'(in TreeConnect AndX responses), and "Quota Flags"
[packet-smb2.c] 'Flags', 'Session Flags', 'Security mode', and 'Interface Capabilities'.

[packet-smb.c] Made the tfs_file_attribute_xxx true_false_string values less verbose and more compact.

[packet-smb2.c] Changed all references to "RMDA" to RDMA".

[packet_smb.c] In dissect_qfi_SMB_FILE_NETWORK_OPEN_INFO() (GetInfo response) changed "Unknown Field"
               to "Reserved" (See capture 'DMtrace2.cap' frame 20023).

svn path=/trunk/; revision=52623
2013-10-15 16:41:29 +00:00
Bill Meier 2ac134b3c5 whitespace fixes; mostly: remove trailing blanks
svn path=/trunk/; revision=52591
2013-10-13 19:56:52 +00:00
Evan Huus 137be14b3d We can't use proto_tree_add_uint_* for FT_TIME fields, use proto_tree_add_time_*
instead. Fixes another one of the issues that shows up in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9263

svn path=/trunk/; revision=52565
2013-10-12 13:14:30 +00:00
Cal Turney 943356c9f4 "Expert Info (Error/Malformed) trying to fetch an unsigned integer with length 0" errors when an attempt is made to display the File Attributes within the FID subtree of SMB requests and responses. In addition, not all the options and masks were marked with PROTO_ITEM_SET_GENERATED(item) when appropriate to do so;
Fix1: The proto_tree_add_item() was changed to proto_tree_add_uint.
Fix2: "If (len==0) PROTO_ITEM_SET_GENERATED(item);" was added to dissect_nt_create_options_bits(), dissect_nt_share_access_bits(), dissect_smb_access_mask_bits(), dissect_nt_create_bits(), and dissect_file_ext_attr_bits().

svn path=/trunk/; revision=52494
2013-10-10 15:53:45 +00:00
Pascal Quantin 102c452bcb More emem -> wmem conversion:
- tvb_get_g_stringz()/tvb_get_ephemeral_stringz()/tvb_get_seasonal_stringz() -> tvb_get_stringz()
- tvb_get_g_stringz_enc()/tvb_get_ephemeral_stringz_enc() -> tvb_get_stringz_enc()
- tvb_get_ephemeral_unicode_stringz() -> tvb_get_unicode_stringz()
- tvb_bcd_dig_to_ep_str() -> tvb_bcd_dig_to_wmem_packet_str()
- update docs accordingly

svn path=/trunk/; revision=52180
2013-09-22 20:04:35 +00:00
Pascal Quantin a0c53ffaa1 emem -> wmem conversion:
- ep_tvb_get_bits() -> wmem_packet_tvb_get_bits()
- tvb_g_memdup()/ep_tvb_memdup() -> tvb_memdup()
- tvb_fake_unicode()/tvb_get_ephemeral_faked_unicode() -> tvb_get_faked_unicode()
- tvb_get_g_string()/tvb_get_ephemeral_string()/tvb_get_seasonal_string() -> tvb_get_string()
- tvb_get_g_unicode_string()/tvb_get_ephemeral_unicode_string() -> tvb_get_unicode_string()
- tvb_get_ephemeral_string_enc() -> tvb_get_string_enc()
- update docs accordingly

svn path=/trunk/; revision=52172
2013-09-22 15:50:55 +00:00
Anders Broman b422c4892d From Dirk:
fix NTLMSSP Target Info Attribute dissection

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

svn path=/trunk/; revision=51764
2013-09-05 04:57:33 +00:00
Evan Huus 7dbc052d78 More dissectors to wmem. There are no more dissectors using se_tree now, just a
few other places.

svn path=/trunk/; revision=51622
2013-09-01 01:00:11 +00:00
Guy Harris 68f9abdc87 Move "aggregate" fields containing bit subfields before the bit
subfields.  Rename some of their hf_ variable names to match the hf_
variable names of the subfields, and rename one field to be a prefix of
its subfields.

For the 64-bit UNIX capabilities, use proto_tree_add_item() for the
flags.

Get rid of a #if 0'ed out field that is duplicated by one of the
newly-added fields.

svn path=/trunk/; revision=51400
2013-08-17 06:30:02 +00:00
Michael Mann 9e92781cdb Make more filterable items courtesy of convert_proto_tree_add_text.pl.
Also converted proto_tree_add_xxx_format into proto_tree_add_xxx_format_value so that label doesn't get out of sync with hf.

svn path=/trunk/; revision=51394
2013-08-16 20:38:21 +00:00
Jakub Zawadzki a18172147f Remove fragment_data, add fragment_head, fragment_item - for now alias it to the same structure.
This is begin of work to split fragment head and fragments items.

svn path=/trunk/; revision=50708
2013-07-17 21:12:24 +00:00
Jakub Zawadzki c766e78cfa Rewrite reassemble API to use TVBs instead of raw data.
(it seems to be working for TCP ^^)

svn path=/trunk/; revision=50580
2013-07-14 14:42:05 +00:00
Michael Mann dfa2156e30 Remove check_col() and the occasional tree.
svn path=/trunk/; revision=49923
2013-06-14 02:50:46 +00:00
Michael Mann b0090fd046 Batch of filterable expert infos
svn path=/trunk/; revision=49600
2013-05-27 23:21:11 +00:00
Guy Harris ec3d987eb9 Note that Query Server was reserved.
svn path=/trunk/; revision=48922
2013-04-19 01:37:48 +00:00
Guy Harris eb0bd03939 Add some names for reserved-but-never-implemented operations, with
references for them.

svn path=/trunk/; revision=48921
2013-04-19 01:37:24 +00:00
Anders Broman 352b96d735 From Cal Turney:
Patch 45480 introduced the following check: 

"tvb_ensure_bytes_exist(tvb, offset, neo ? neo : *bcp - ((unsigned)offset + 1));:     

When the last entry in the directory listing is processed, 'neo' the next entry offset is zero so bcp is checked. The 'bcp' variable is set to the remaining reported bytes in the tvb.  Subtracting the current offset +1 from *bcp usually produces a negative result and causes the error.

Removed "- ((unsigned)offset + 1)" and added "CHECK_BYTE_COUNT_SUBR(4);"

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

svn path=/trunk/; revision=48744
2013-04-05 05:20:41 +00:00
Guy Harris a2414d8909 Don't wire into the reassembly code the notion that reassemblies should
be done on flows from one address to another; reassembly for protocols
running atop TCP should be done on flows from one TCP endpoint to
another.

We do this by:

	adding "reassembly table" as a data structure;

	associating hash tables for both in-progress reassemblies and
	completed reassemblies with that data structure (currently, not
	all reassemblies use the latter; they might keep completed
	reassemblies in the first table);

	having functions to create and destroy keys in that table;

	offering standard routines for doing address-based and
	address-and-port-based flow processing, so that dissectors not
	needing their own specialized flow processing can just use them.

This fixes some mis-reassemblies of NIS YPSERV YPALL responses (where
the second YPALL response is processed as if it were a continuation of
a previous response between different endpoints, even though said
response is already reassembled), and also allows the DCE RPC-specific
stuff to be moved out of epan/reassembly.c into the DCE RPC dissector.

svn path=/trunk/; revision=48491
2013-03-22 23:59:54 +00:00
Anders Broman 55c498169d From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48400
2013-03-18 21:16:23 +00:00