aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-icmp.c
AgeCommit message (Collapse)AuthorFilesLines
2014-12-23Deleting unneccessary #includes from dissectors.Martin Mathieson1-2/+0
Second batch (packet-eth.c -> packet-icmpv6.d). Will look at cleaning up and committing script afterwards. Change-Id: I14295758b81a59115d8c88899f166cc3d5d17594 Reviewed-on: https://code.wireshark.org/review/6013 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-6/+3
Specifically: - Set packet.h to be the first wireshark #include after config.h and "system" #includes. packet.h added as an #include in some cases when missing. - Remove some #includes included (directly/indirectly) in packet.h. E.g., glib.h. (Done only for those files including packet.h). - As needed, move "system" #includes to be after config.h and before wireshark #includes. - Rework various #include file specifications for consistency. - Misc. Change-Id: Ifaa1a14b50b69fbad38ea4838a49dfe595c54c95 Reviewed-on: https://code.wireshark.org/review/5923 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-12-01Use proto_tree_add_bitmask for groups of proto_tree_add_boolean.Michael Mann1-33/+15
Part 2 of many Change-Id: I50815e7738b011382392f3078a7107d3d9eec4ec Reviewed-on: https://code.wireshark.org/review/5542 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-10-02Add editor modelines & adjust indentation/whitespace as needed.Bill Meier1-68/+80
Change-Id: Ice2d93632cd42dfcef3bfbf0e15f2a8a147278fc Reviewed-on: https://code.wireshark.org/review/4433 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-09-10Make expert info text less verbose for missing ICMP response - no point in ↵Martin Mathieson1-2/+1
including frame number Change-Id: I47ca8159c0716cb49da7ff77b1087cf37babe97e Reviewed-on: https://code.wireshark.org/review/4059 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-08-09Clean up Internet checksum handling.Guy Harris1-6/+2
Add macros to set entries of a vec_t, one for use when you have a pointer to private data, and one for use when you have data in a tvbuff. The latter wraps the use of tvb_get_ptr(), so that you're not directly calling it in a dissector. Move ip_checksum() to epan/in_cksum.c, and add an ip_checksum_tvb() that wraps the use of tvb_get_ptr(). In the CARP dissector, give the length variable an unsigned type - there's no benefit to it being signed, and that requires some casts to be thrown around. In the DCCP dissector, check only against the coverage length to see if we have enough data, combine the "should we check the checksum?" check with the "*can* we check the checksum?" check in a single if, and throw a dissector assertion if the source network address type isn't IPv4 or IPv6. Get rid of inclues of <epan/in_cksum.h> in dissectors that don't use any of the Internet checksum routines. In the HIP dissector, make sure we have the data to calculate the checksum before doing so. Change-Id: I2f9674775dbb54c533d33082632809f7d32ec8ae Reviewed-on: https://code.wireshark.org/review/3517 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-29proto_tree_add_subtree[_format]Michael Mann1-74/+28
Change-Id: I7e016f10fcfdc0523bf2fe8c11295c0334f7c332 Reviewed-on: https://code.wireshark.org/review/2694 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-4/+4
https://www.wireshark.org/lists/wireshark-dev/201406/msg00131.html This reverts commit 246fe2ca4c67d8c98caa84e2f57694f6322e2f96. Change-Id: Ib24bae0198c13a84bd7f731bf4af921212109a8f Reviewed-on: https://code.wireshark.org/review/2430 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-18Fixup: tvb_* -> tvb_capturedDario Lombardo1-4/+4
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-16Convert a bunch of time_to_str functions to wmemEvan Huus1-6/+6
Change-Id: I24fe3cc4a3589dadc4528a77fe7ff13d06b1a983 Reviewed-on: https://code.wireshark.org/review/2245 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-06Apply found fix-encoding-args.pl errors in the dissector directory.Michael Mann1-1/+1
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-03-15Fix -Wabsolute-value in ICMP dissector (found by Clang 3.5)Alexis La Goutte1-4/+4
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-04Remove all $Id$ from top of fileAlexis La Goutte1-2/+0
(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-02-25Remove trailing whitespace.Bill Meier1-2/+2
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>
2013-12-21Add missing includesJakub Zawadzki1-0/+1
svn path=/trunk/; revision=54332
2013-12-19Rename more to_str functions to have ep_ in the name if they return ephemeralEvan Huus1-4/+4
buffers. Remove two unused functions. svn path=/trunk/; revision=54250
2013-12-14Fix warningsJakub Zawadzki1-0/+3
svn path=/trunk/; revision=54089
2013-12-03When including <epan/prefs.h> don't force inclusion of <epan/uat.h>Jakub Zawadzki1-0/+2
svn path=/trunk/; revision=53769
2013-11-25When there is no ICMP reply, add a filterable field and expert info warningMartin Mathieson1-0/+33
svn path=/trunk/; revision=53588
2013-11-23Remove ip_ttl from packet_info structure.Michael Mann1-4/+7
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-05Replace pinfo->layer_names as a string with pinfo->layers as a wmem_list ofEvan Huus1-1/+1
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-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-14/+11
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-08-31A few more dissectors to wmem.Evan Huus1-19/+15
svn path=/trunk/; revision=51616
2013-03-26Add checksum_bad, set to FALSE to the tree when the checksum is correct. ↵Chris Maynard1-7/+15
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-19From beroset:Anders Broman1-7/+7
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48412
2012-12-26Fix a bunch of warnings.Guy Harris1-2/+2
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-10-13The Interface Name field of the Interface Name sub-object of theGuy Harris1-3/+1
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-06ICMP: Icmp was a mad mix of different indentation styles.Ronnie Sahlberg1-1479/+1732
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-06ICMP request/response matching fixesRonnie Sahlberg1-39/+91
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-05Try to describe icmp.resp_in and icmp.resp_to more clearly.Gerald Combs1-5/+5
svn path=/trunk/; revision=45332
2012-09-20We always HAVE_CONFIG_H so don't bother checking whether we have it or not.Jeff Morriss1-3/+1
svn path=/trunk/; revision=45017
2012-09-19Fix request/response tracking with checksum corner case.Chris Maynard1-0/+2
svn path=/trunk/; revision=45007
2012-08-26Extend a comment.Jörg Mayer1-1/+2
svn path=/trunk/; revision=44675
2012-07-13If there's not enough data left for a timestamp, be sure there's at least ↵Chris Maynard1-7/+9
some data to pass off to the generic data dissector. svn path=/trunk/; revision=43705
2012-06-28Update Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
2012-06-23Do not use same name for filters with incompatible typesPascal Quantin1-2/+2
svn path=/trunk/; revision=43448
2012-05-03From Klaus Heckelmann via ↵Chris Maynard1-3/+5
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-02-12Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-3/+0
svn path=/trunk/; revision=40988
2012-02-01Fix some typos.Chris Maynard1-4/+4
svn path=/trunk/; revision=40787
2012-01-04Fix several warnings turned error of type:Jörg Mayer1-6/+0
variable ‘mtu_flag’ set but not used [-Werror=unused-but-set-variable] svn path=/trunk/; revision=40380
2011-12-29Fixed a typo: btyes -> bytesStig Bjørlykke1-2/+2
svn path=/trunk/; revision=40323
2011-12-28Add missing break; Fixes Coverity CID 1343.Chris Maynard1-15/+17
svn path=/trunk/; revision=40314
2011-12-27Initialise variables.Anders Broman1-2/+2
svn path=/trunk/; revision=40299
2011-12-27From Gaurav Tungatkar:Anders Broman1-178/+499
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-11-08packet_info's in_error_pkt is now a bitfield like in_gre_pkt.Chris Maynard1-6/+6
svn path=/trunk/; revision=39764
2011-11-08Improve ICMP conversation tracking, especially when capturing on multiple ↵Chris Maynard1-0/+4
interfaces and one of them is a GRE tunnel. Resolves bug 5770, which was reopened. svn path=/trunk/; revision=39757
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-6/+6
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-10-10 Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-2/+2
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-06Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-16/+16
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-04Use ENC_NA as encoding for proto_tree_add_item() calls which directly ↵Bill Meier1-1/+1
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