Commit Graph

67 Commits

Author SHA1 Message Date
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 0d2dd00564 Fix -Wabsolute-value in ICMP dissector (found by Clang 3.5)
packet-icmp.c:1245:7: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
packet-icmp.c:1245:7: note: remove the call to 'abs' since unsigned values cannot be negative
packet-icmp.c:1245:30: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
packet-icmp.c:1245:30: note: remove the call to 'abs' since unsigned values cannot be negative
packet-icmp.c:1254:6: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
packet-icmp.c:1254:6: note: remove the call to 'abs' since unsigned values cannot be negative
packet-icmp.c:1254:29: error: taking the absolute value of unsigned type 'unsigned int' has no effect [-Werror,-Wabsolute-value]
packet-icmp.c:1254:29: note: remove the call to 'abs' since unsigned values cannot be negative
packet-icmp.c:1623:7: error: taking the absolute value of unsigned type 'guint32' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value]
packet-icmp.c:1623:7: note: remove the call to 'abs' since unsigned values cannot be negative
packet-icmp.c:1629:7: error: taking the absolute value of unsigned type 'guint32' (aka 'unsigned int') has no effect [-Werror,-Wabsolute-value]
packet-icmp.c:1629:7: note: remove the call to 'abs' since unsigned values cannot be negative

Change-Id: I6b344d01b8239fb93aedf95d954ef1243ba45a6b
Reviewed-on: https://code.wireshark.org/review/673
Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-03-15 11:38:21 +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
Bill Meier 93fe4d53e2 Remove trailing whitespace.
Change-Id: Ia03a1cd4590aceda30ead4aa93ad413d90c6aea6
Reviewed-on: https://code.wireshark.org/review/372
Reviewed-by: Bill Meier <wmeier@newsguy.com>
Tested-by: Bill Meier <wmeier@newsguy.com>
2014-02-25 16:36:38 +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
Jakub Zawadzki 1053e722ed Fix warnings
svn path=/trunk/; revision=54089
2013-12-14 12:45:57 +00:00
Jakub Zawadzki 65db82872c When including <epan/prefs.h> don't force inclusion of <epan/uat.h>
svn path=/trunk/; revision=53769
2013-12-03 22:16:49 +00:00
Martin Mathieson aac0ba6508 When there is no ICMP reply, add a filterable field and expert info warning
svn path=/trunk/; revision=53588
2013-11-25 23:01:37 +00:00
Michael Mann 55c6869980 Remove ip_ttl from packet_info structure.
Part of the fix includes having the IPv6 dissector populate as much of a ws_ip structure as possible to pass to subdissectors of the "ip.proto" table, so the ttl value can be picked up.

svn path=/trunk/; revision=53522
2013-11-23 19:16:05 +00:00
Evan Huus 389423aaaa Replace pinfo->layer_names as a string with pinfo->layers as a wmem_list of
protocol IDs. This is substantially more efficient, which means we can build it
all the time rather than only if tree (in my benchmarks the extra time taken is
not large enough to be statistically significant even over tens of thousands of
packets).

This fixes what was probably a bug in btobex that relied on layer_names for
non-tree dissection. It also enables a much simpler fix for
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9303

svn path=/trunk/; revision=53089
2013-11-05 17:48:48 +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
Evan Huus 83a7fedb55 A few more dissectors to wmem.
svn path=/trunk/; revision=51616
2013-08-31 15:47:04 +00:00
Chris Maynard 67ffb10e64 Add checksum_bad, set to FALSE to the tree when the checksum is correct. Use PROTO_ITEM_SET_HIDDEN instead of PROTO_ITEM_SET_GENERATED so ICMP and ICMPv6 are consistent.
See: http://ask.wireshark.org/questions/19844/icmp-display-filter-checksum_bad-ignored

#BACKPORT(1.6, 1.8)

svn path=/trunk/; revision=48563
2013-03-26 18:08:05 +00:00
Anders Broman a10b98284c From beroset:
remove C++ incompatibilities 
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416

svn path=/trunk/; revision=48412
2013-03-19 04:54:30 +00:00
Guy Harris 8ed7a73e22 Fix a bunch of warnings.
Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
sizeof.

Cast away some implicit 64-bit-to-32-bit conversion errors due to use of
strtol() and strtoul().

Change some data types to avoid those implicit conversion warnings.

When assigning a constant to a float, make sure the constant isn't a
double, by appending "f" to the constant.

Constify a bunch of variables, parameters, and return values to
eliminate warnings due to strings being given const qualifiers.  Cast
away those warnings in some cases where an API we don't control forces
us to do so.

Enable a bunch of additional warnings by default.  Note why at least
some of the other warnings aren't enabled.

randpkt.c and text2pcap.c are used to build programs, so they don't need
to be in EXTRA_DIST.

If the user specifies --enable-warnings-as-errors, add -Werror *even if
the user specified --enable-extra-gcc-flags; assume they know what
they're doing and are willing to have the compile fail due to the extra
GCC warnings being treated as errors.

svn path=/trunk/; revision=46748
2012-12-26 05:57:06 +00:00
Guy Harris 7ac57a8411 The Interface Name field of the Interface Name sub-object of the
Interface Information object for ICMP is *NOT* null-terminated.  Use
tvb_format_text() for now, to properly null-terminate the display string
and to cope with non-ASCII data.  (It should ultimately be a named field
with an encoding of UTF-8.)

svn path=/trunk/; revision=45525
2012-10-13 22:20:34 +00:00
Ronnie Sahlberg cde73df2e7 ICMP: Icmp was a mad mix of different indentation styles.
indent -kr -i8   for now to make it use a consistent style
No code changes, only formatting in this patch


svn path=/trunk/; revision=45346
2012-10-06 15:53:01 +00:00
Ronnie Sahlberg 1693627478 ICMP request/response matching fixes
Change icmp request/response matching to be more aligned to other matching
strategies and use two tables. One table for first time we visit a packet
and a second table to track all confirmed matches.


svn path=/trunk/; revision=45343
2012-10-06 15:06:00 +00:00
Gerald Combs dec2d034b0 Try to describe icmp.resp_in and icmp.resp_to more clearly.
svn path=/trunk/; revision=45332
2012-10-05 16:04:04 +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 86db174948 Fix request/response tracking with checksum corner case.
svn path=/trunk/; revision=45007
2012-09-19 17:57:54 +00:00
Jörg Mayer 15ee8b256a Extend a comment.
svn path=/trunk/; revision=44675
2012-08-26 03:17:53 +00:00
Chris Maynard 5e12ba51e6 If there's not enough data left for a timestamp, be sure there's at least some data to pass off to the generic data dissector.
svn path=/trunk/; revision=43705
2012-07-13 21:58:58 +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
Pascal Quantin 472f036552 Do not use same name for filters with incompatible types
svn path=/trunk/; revision=43448
2012-06-23 14:36:21 +00:00
Chris Maynard 2eeb504807 From Klaus Heckelmann via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7221: Avoid wireshark crash on platforms where an 8 byte alignment is required by changing the resp_time field in the icmp_transaction_t from a double to an nstime_t.
svn path=/trunk/; revision=42393
2012-05-03 01:48:59 +00:00
Alexis La Goutte f296d389b2 Fix some Dead Store (Dead assignement/Dead increment) Warning found by Clang
svn path=/trunk/; revision=40988
2012-02-12 17:46:57 +00:00
Chris Maynard 3db18f185e Fix some typos.
svn path=/trunk/; revision=40787
2012-02-01 02:05:19 +00:00
Jörg Mayer c2e213202b Fix several warnings turned error of type:
variable ‘mtu_flag’ set but not used [-Werror=unused-but-set-variable]


svn path=/trunk/; revision=40380
2012-01-04 23:15:50 +00:00
Stig Bjørlykke 5adae76d68 Fixed a typo: btyes -> bytes
svn path=/trunk/; revision=40323
2011-12-29 11:44:22 +00:00
Chris Maynard e7e36de7dd Add missing break; Fixes Coverity CID 1343.
svn path=/trunk/; revision=40314
2011-12-28 16:59:17 +00:00
Anders Broman eb722fa0c1 Initialise variables.
svn path=/trunk/; revision=40299
2011-12-27 11:08:52 +00:00
Anders Broman 1cab431dc9 From Gaurav Tungatkar:
support extended ICMP for multi-part messages as specified by
RFC 4884. Additionally, it adds support for the Interface Information Object
extension to ICMP as specified by RFC 5837.
1. RFC 4884 - This redefines certain ICMP messages to support multi-part
messages with extensions. It adds a length field to the ICMP header and defines
an extension structure to define extension objects that can be appended to the
selected ICMP messages. It retains backward compatibility with messages that do
not support the extensions defined by this RFC. 
2. RFC 5837 - This defines an extension object to identify the interface and
next-hop information to selected ICMP messages.

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

svn path=/trunk/; revision=40298
2011-12-27 10:48:04 +00:00
Chris Maynard 647c5c0b27 packet_info's in_error_pkt is now a bitfield like in_gre_pkt.
svn path=/trunk/; revision=39764
2011-11-08 18:39:11 +00:00
Chris Maynard d55d8781b8 Improve ICMP conversation tracking, especially when capturing on multiple interfaces and one of them is a GRE tunnel. Resolves bug 5770, which was reopened.
svn path=/trunk/; revision=39757
2011-11-08 17:25:22 +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 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
Chris Maynard 0693606010 Avoid potential midday problems by narrowing the midnight rollover test.
svn path=/trunk/; revision=38171
2011-07-23 00:30:24 +00:00
Chris Maynard 0506627c30 Apply some endian heuristics when dissecting ICMP originate, receive and transmit timestamps. Fixes bug 6114.
Ref: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6114

svn path=/trunk/; revision=38129
2011-07-20 00:22:31 +00:00
Sake Blok 950646b751 * If first 8 bytes in icmp data do not look like a timestamp in BE, try LE representation.
* Change field title to not confuse people when the clocks of the pinging system and the capturing system are not in sync.


svn path=/trunk/; revision=38041
2011-07-15 08:57:59 +00:00
Chris Maynard 78d9816855 Fix "comparison between signed and unsigned" warning.
svn path=/trunk/; revision=38039
2011-07-15 04:40:03 +00:00
Chris Maynard 0ffe6deac1 Be sure there's enough bytes in the ICMP payload before trying to access it in
order to try to determine if it contains a timestamp.  Added some FIXME notes.

svn path=/trunk/; revision=38038
2011-07-15 02:39:53 +00:00
Sake Blok 0eacf5ab26 Make windows buildbot happy (hopefully!)
svn path=/trunk/; revision=38030
2011-07-14 22:03:13 +00:00
Sake Blok 43116e9a0b If the first 8 bytes of the icmp echo/echo-reply data look like a timestamp, dissect it as a timestmap and calculate the time since the icmp packet was created.
svn path=/trunk/; revision=38028
2011-07-14 21:27:17 +00:00
Chris Maynard 595e5e1c1d Add ICMP tap support, and add a tshark tap to measure such things as:
* Number of ICMP echo requests, replies, lost replies and percent loss.
  * Min, Max, Average SRT (Service Response Time), and standard deviation.
(This is my first tap, so hopefully I didn't miss something, but we'll see ...)
TODO: Add a Wireshark tap.


svn path=/trunk/; revision=36480
2011-04-05 20:21:59 +00:00
Stephen Fisher df50d409fb Only display the 3 digits of precision after the decimal that we have
from the ICMP conversation response time tracking. 


svn path=/trunk/; revision=36316
2011-03-24 21:22:07 +00:00
Chris Maynard 9493ebe8e9 Display the value of the ICMP echo request/reply response time in milliseconds.
svn path=/trunk/; revision=36313
2011-03-24 18:05:10 +00:00