Commit Graph

65 Commits

Author SHA1 Message Date
Bill Meier 71c5ac03e2 packet-assa_r3.c: Use editor modelines from http://www.wireshark.org/tools/modelines.html
Change-Id: I2d9accd2336448ced30dca1878a3e27cdba29566
Reviewed-on: https://code.wireshark.org/review/4687
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-14 20:07:51 +00:00
Bill Meier 9ed99d5c4e Strip some trailing whitespace; Fix some indentation; Add editor-modelines as needed.
Change-Id: I943153e28f468070d86535abad7be032e1386118
Reviewed-on: https://code.wireshark.org/review/2994
Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-07-11 03:20:54 +00:00
Michael Mann 188aa9a80e convert to proto_tree_add_subtree[_format]
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df
Reviewed-on: https://code.wireshark.org/review/2560
Tested-by: Michael Mann <mmann78@netscape.net>
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-22 21:07:16 +00:00
Michael Mann 4560881070 Cleanup display filters reported by checkfiltername.pl
Also ensured some files have their correct names at the top so they are more easily grepped

Change-Id: Ib0f5ddf14eb1616a93dee496107dc0eb09048825
Reviewed-on: https://code.wireshark.org/review/2452
Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-20 04:09:31 +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
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
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 8376b41cc0 Use tvb_get_string_enc() rather than tvb_get_string().
svn path=/trunk/; revision=54926
2014-01-23 02:46:56 +00:00
Bill Meier ebaeed5a1f (Trivial)
- Fix indentation to match editor modelines (tabs-->spaces);
 - Rework/add some whitespace;

svn path=/trunk/; revision=53978
2013-12-12 20:16:30 +00:00
Gerald Combs 7f3dd7b499 Fix unused and shadow variable errors.
svn path=/trunk/; revision=53200
2013-11-09 18:17:00 +00:00
Michael Mann 8081cf1d90 Add data parameter to tcp_dissect_pdus() as well as convert it to using "new" style dissectors.
Now that "bytes consumed" can be determined, should tcp_dissect_pdus() take advantage of that?

Should tcp_dissect_pdus return length (bytes consumed)?  There are many dissectors that just call tcp_dissect_pdus() then return tvb_length(tvb).  Seems like that could all be rolled into one.

svn path=/trunk/; revision=53198
2013-11-09 17:46:28 +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
Michael Mann b38ee917b1 Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if hf_ field name is the first part of the formatted string. This was done with a perl script on the dissectors directory (packet-*.c), followed by manual inspection of the output. The manual inspection yielded a few cases that really should have been proto_tree_add_uint or proto_tree_add_item, so I updated them accordingly.
The script didn't catch as many as I would have liked, but it's a start.

The most common (ab)use of proto_tree_add_uint_format was for appending strings to CRC/checksum values to note good or bad CRC/checksum.

svn path=/trunk/; revision=52045
2013-09-15 01:48:30 +00:00
Michael Mann 9e3f9b449f expert_add_info_format_text -> expert_add_info_format
svn path=/trunk/; revision=51852
2013-09-09 00:44:09 +00:00
Michael Mann e597acdc48 Batch of filterable expert info.
svn path=/trunk/; revision=51625
2013-09-01 13:05:27 +00:00
Martin Kaiser 07ee14d5c1 fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9020
make sure that the loop counter is always incremented

svn path=/trunk/; revision=51196
2013-08-07 21:17:53 +00:00
Bill Meier 8d5bbb4146 Define certain 'const char *...' arrays as static.
Reduces code memory usage and execution time.
(See SVN #50271)


svn path=/trunk/; revision=50292
2013-07-01 13:03:23 +00:00
Jeff Morriss 779d28d390 Fix the fuzz failure reported (by me) in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8764 :
Apply the fix from bug 8539 (r48796) to another function (dissect_r3_upstreamcommand_queryconfig()):

Bail out of the item length we get (which we use to increment the offset) is 0.
Otherwise the offset does not advance and we loop forever.

While we're in there: get the item length just once (there's no need to call
tvb_get_guint8() a half dozen times when one will do).

svn path=/trunk/; revision=49744
2013-06-04 02:01:53 +00:00
Jeff Morriss cfd03173b4 Fix the fuzz failure reported in https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8539 :
Bail out of the item length we get (which we use to increment the offset) is 0.
Otherwise the offset does not advance and we loop forever.

While we're in there: get the item length just once (there's no need to call
tvb_get_guint8() a half dozen times when one will do).

svn path=/trunk/; revision=48796
2013-04-09 02:05:39 +00:00
Evan Huus 37600a157b Rename value string (and similar) functions to use a consistent pattern. This
was done using textual search+replace, not anything syntax-aware, so presumably
it got most comments as well (except where there were typos).

Use a consistent coding style, and make proper use of the WS_DLL_* defines.

Group the functions appropriately in the header.

I ended up getting rid of most of the explanatory comments since many of them
duplicated what was in the value_string.c file (and were out of sync with the
recent updates I made to those in r48633). Presumably most of the comments
should be in the .h file not the .c file, but there's enough churn ahead that
it's not worth fixing yet.

Part of https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8467

svn path=/trunk/; revision=48634
2013-03-29 00:26:23 +00:00
Anders Broman 6bde918078 From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48426
2013-03-19 20:00:52 +00:00
Anders Broman 04766017df - [-Wmissing-prototypes]
- explicit casts.

svn path=/trunk/; revision=48282
2013-03-13 21:14:20 +00:00
Bill Meier 96a24cc79f Fix spelling/typos found using a list of commonly misspelled words.
The misspellings were mostly in comments but some were
in text strings visible to the user.


svn path=/trunk/; revision=47899
2013-02-26 04:42:26 +00:00
Bill Meier 1823aa007c it's ==> its & its ==> it's as needed.
svn path=/trunk/; revision=47891
2013-02-26 01:06:19 +00:00
Jeff Morriss 70eecf2392 Move ett and hf arrays into proto_register routine.
Reindent some.

svn path=/trunk/; revision=46495
2012-12-11 02:26:44 +00:00
Jeff Morriss 97bbd2fc0a Fix inifite loop in the R3 dissector reported in
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8040 :

If the alarm length is 0, raise an expert_info and break out of the loop.

svn path=/trunk/; revision=46415
2012-12-06 01:43:37 +00:00
Jeff Morriss 2552c750e5 We always HAVE_CONFIG_H so don't bother checking whether we have it or not.
svn path=/trunk/; revision=45017
2012-09-20 02:03:38 +00:00
Chris Maynard 590cec6962 tvb_length_remaining() can return -1, so be sure to deal with it if it does. Should fix a bunch of Coverity CID's.
svn path=/trunk/; revision=43715
2012-07-14 19:28:40 +00:00
Bill Meier 59e9b969e9 Fix [-Werror=sign-compare] compiler warning
svn path=/trunk/; revision=43666
2012-07-11 18:43:30 +00:00
Bill Meier 85504b052f Simplify code ....
svn path=/trunk/; revision=43665
2012-07-11 18:32:20 +00:00
Bill Meier 3b7e75852a Remove "comment to myself".
svn path=/trunk/; revision=43664
2012-07-11 16:24:01 +00:00
Bill Meier 0bace7313c General cleanup:
- Fix potential array overflow;
- Calls to expert...() should not be under 'if (tree)';
- Don't use DISSECTOR_ASSERT for bad data; use expert...();
- Add some XXX comments about enum item values different than
   specified in the comments associated with the enum items;
- Init global 'mfgCommandFlag' as appropriate before use;
- Add missing hf[] entries;
- #if 0 various unused #defines and enums;
- Reduce (somewhat) repeated fetches of the same tvb data;
- Remove unneeded initializers;
- Don't use 'l' as a variable name;
- Reformat long lines, hf[] array entries and other;;
- Fix some indentation;

svn path=/trunk/; revision=43663
2012-07-11 15:28:31 +00:00
Bill Meier 3be39a23aa From Evan Huus: Struct cleanup in packet-assa_r3.c
Cleanup and simplify structures and arrays in packet-assa_r3.c as described in
my email to the -dev list [1].

[1] http://www.wireshark.org/lists/wireshark-dev/201207/msg00050.html


From me:
 Do the same as above for the commandDissectorParser_t struct mentioned in the EMail
 (but not fixed in the patch).


svn path=/trunk/; revision=43623
2012-07-09 03:00:03 +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
Bill Meier 2ed4baea4f all:
Merge .h files into .c files since .h files unused elsewhere;
     Do whitespace, indentation & formatting cleanup.
packet-acn.c:
     Fix 2 minor bugs wherein subtree not displayed in packet-details
     because tree variable used in proto_tree_add_text() always NULL.

svn path=/trunk/; revision=42647
2012-05-16 01:41:03 +00:00
Guy Harris 761ce3c75b Get rid of remaining Booleans-as-encoding-arguments in
proto_tree_add_item() calls; for the items that don't actually have hf_
entries (which is a bug in the dissector!), assume the short
fixed-length ones are integral and the "to the end of the packet" ones
are byte arrays (hence ENC_NA).

svn path=/trunk/; revision=42475
2012-05-07 18:00:13 +00:00
Anders Broman e6b7af69b5 From Evan Huus: There were two cases where we could underflow an unsigned subtraction, leading to huge values and near-infinite loops. Catch them and add an expert_info warning that the packet is bad. Also fix some other expert_info messages to hang off of the right dissection tree. https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7125
svn path=/trunk/; revision=42122
2012-04-18 05:29:02 +00:00
Bill Meier 4f8e416fdc Fix benign issue: For FT_BOOLEAN fields with a zero bitmask, use BASE_NONE for 'display'
svn path=/trunk/; revision=41385
2012-03-06 22:12:42 +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 63e83b1303 Fix a proto_tree_add_item() encoding arg.
svn path=/trunk/; revision=39527
2011-10-23 20:50:48 +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 e81572eaa9 Comment out some unused hf[] entries;
Add notes about missing hf[] entries.

svn path=/trunk/; revision=39344
2011-10-10 20:57:56 +00:00
Bill Meier a78fdcfddc Convert proto_tree_add_item() 'encoding' parameter as appropriate.
svn path=/trunk/; revision=39343
2011-10-10 20:12:57 +00:00
Bill Meier 67ee5049d4 Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
  the encoding parameter for proto_tree_add_item() calls which directly reference
  an item in hf[] which has a type of:
     FT_BOOLEAN
     FT_IPv4
     FT_EUI64
     FT_GUID
     FT_UINT_STRING

Also: For type FT_ITv6 use ENC_NA. (This was missed in SVN #39260)

svn path=/trunk/; revision=39328
2011-10-10 00:39:31 +00:00
Bill Meier 4e57694d4a Convert 'encoding' parameter of certain proto_tree_add_item() calls in non-autogenerated epan/dissectors:
Specifically:  Replace FALSE|0 and TRUE|1 by ENC_BIG_ENDIAN|ENC_LITTLE_ENDIAN as
 the encoding parameter for proto_tree_add_item() calls which directly reference
 an item in hf[] which has a type of:
    FT_UINT8
    FT_UINT16
    FT_UINT24
    FT_UINT32
    FT_UINT64
    FT_INT8
    FT_INT16
    FT_INT24
    FT_INT32
    FT_INT64
    FT_FLOAT
    FT_DOUBLE


svn path=/trunk/; revision=39288
2011-10-06 03:35:44 +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
Stig Bjørlykke 5359494b1f Second try to move crc routines to libwsutil.
This time keep the tvb routines in epan.

Now we can use common crc routines outside epan.

svn path=/trunk/; revision=38810
2011-08-31 09:00:54 +00:00
Stig Bjørlykke 71f903b956 Revert r38800, as the crc routines contains some tvb functions.
svn path=/trunk/; revision=38803
2011-08-30 14:17:40 +00:00