Commit Graph

52 Commits

Author SHA1 Message Date
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
Chris Maynard 276e9cced3 Add ICMP echo request/reply conversation tracking. Closes bug 5770.
svn path=/trunk/; revision=36298
2011-03-23 20:20:40 +00:00
Stephen Fisher 1fc46d7c4d Don't verify the checksum of an ICMP packet when it the payload of an
error packet (pinfo->in_error_pkt), such as an ICMP destination
unreachable, because we probably don't have the whole original packet.


svn path=/trunk/; revision=36193
2011-03-14 19:58:02 +00:00
Jeff Morriss 6cfdeed280 Replace ip_to_str((tvb_get_ptr(...)) with tvb_ip_to_str().
Replace ip6_to_str((tvb_get_ptr(...)) with tvb_ip6_to_str().

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()s.

Replace some memcpy()+tvb_get_ptr() with tvb_memcpy().

svn path=/trunk/; revision=35529
2011-01-14 03:44:58 +00:00
Guy Harris b711e23baa Don't use g_warning() - either you have a dissector bug, and should use
one of the macros to report that, or you have a problem with the packet,
in which case you should note that in the protocol tree, or you have
something you don't understand, in which case you should dissect
whatever of it you do understand and put something appropriate, if
possible, into the protocol tree for the rest.

(And, if the length isn't right, there's not much you can do about it -
you have to trust the length, and manage to fail somewhere else.)

svn path=/trunk/; revision=35408
2011-01-06 22:52:40 +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
Jaap Keuter b7920c07c5 From Alexis La Goutte:
Replace all *_min()/*_max() by MIN() and MAX().

svn path=/trunk/; revision=34767
2010-11-04 06:36:33 +00:00
Stephen Fisher 034f2739d2 Add "(BE)" to the big endian representations of the ICMP identifier and
sequence number fields to match the "(LE)" ones.


svn path=/trunk/; revision=34136
2010-09-16 18:22:45 +00:00
Stephen Fisher 0583c64d8f Clean up the icmp info column per discussion in bug #4014.
Change to using new ENC_[BIG|LITTLE]_ENDIAN instead of FALSE and TRUE
in the proto_tree_add_item() calls for the identifier and sequence numbers.


svn path=/trunk/; revision=34119
2010-09-14 21:38:54 +00:00
Stephen Fisher 139d2e3af2 Clarify that the "Sequence number" is given in big endian representation and the "Sequence number (LE)" is little endian.
svn path=/trunk/; revision=33822
2010-08-16 22:28:23 +00:00
Gerald Combs 1bac7c2610 From Chris Maynard via bug 4014:
This trivial patch merely displays the ICMP ID and sequence # in the Info
column.

svn path=/trunk/; revision=33056
2010-06-02 18:13:00 +00:00
Bill Meier 055dd62063 #include <string.h> not needed.
svn path=/trunk/; revision=32410
2010-04-06 21:14:01 +00:00
Bill Meier 09764dd969 Remove unneeded #include <stdio.h>
svn path=/trunk/; revision=32367
2010-04-03 21:55:23 +00:00
Kovarththanan Rajaratnam 82778b3f86 Use val_to_str_const() since we intend on passing the string to col_set_str (which expects a constant string)
svn path=/trunk/; revision=30112
2009-09-24 13:36:02 +00:00
Stig Bjørlykke 99fbe23445 Cleanup code for type and code, do not show empty "()" when code is unused.
Use hex values for bitmasks in header_field_info.

svn path=/trunk/; revision=29790
2009-09-08 13:44:34 +00:00
Kovarththanan Rajaratnam 8b515e9340 Switch a bunch of dissectors over to using tvb_new_subset_remaining()
svn path=/trunk/; revision=29446
2009-08-16 12:36:22 +00:00