aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-hip.c
AgeCommit message (Collapse)AuthorFilesLines
2014-12-23Deleting unneccessary #includes from dissectors.Martin Mathieson1-1/+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-08-13hip: fix infinite loop in dissect_hip_tlvEvan Huus1-1/+1
We can't use tree_item == NULL to determine which branch of the previous if was hit, since proto_tree_add_item can return NULL when run without tree, which was leading to an infinite loop since we were never advancing the offset. Use the actual locator_type instead. Introduced by either g3635d7bed70 or gebff85fdbb although neither of them directly touch this code path. I'm guess that g3635d7bed70 removed an if (tree) guard in some calling function which would have prevented this, but I haven't checked. The bug would still have been there before, it just wouldn't have been hit because it's only present with a NULL tree. Somebody more familiar with the protocol should probably go over a capture or two and make sure this isn't a symptom of some other decoding gone awry in the recent changes. Change-Id: Ie1ce89b16ef667b437c0d99c25e3f3cb2504347d Reviewed-on: https://code.wireshark.org/review/3564 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-08-10Eliminate proto_tree_add_text from some dissectors.Michael Mann1-194/+214
Other minor cleanup while in the neighborhood. Change-Id: Ib76f4a9f89b5933425760af0a980c6a549031b8f Reviewed-on: https://code.wireshark.org/review/3537 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-09Clean up Internet checksum handling.Guy Harris1-13/+12
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-28convert to proto_tree_add_subtree[_format]Michael Mann1-30/+3
Change-Id: Ia7014003a3cff5181295172978d6c613c3b83b0b Reviewed-on: https://code.wireshark.org/review/2676 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-1/+1
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-1/+1
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-06-18Fixup: tvb_get_string(z) -> tvb_get_string(z)_encDario Lombardo1-2/+2
Change-Id: I63a3704effe3fcab01a193dc39b6a22e9f1cf3fe Reviewed-on: https://code.wireshark.org/review/2376 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>
2013-12-15Fix [-Wmissing-prototypes]Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=54135
2013-12-13Fix warnings + remove some v. old comment from strutil.hJakub Zawadzki1-2/+2
svn path=/trunk/; revision=54078
2013-11-22Create multiple dissection functions if packet_info->ipproto is used to ↵Michael Mann1-3/+9
distinguish behavior. svn path=/trunk/; revision=53504
2013-10-23#if 0 numerous "unused const variables" (mostly value-string-arrays);Bill Meier1-0/+2
Also; fix a few "set but not used" warnings. svn path=/trunk/; revision=52780
2013-09-22emem -> wmem conversion:Pascal Quantin1-2/+2
- 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-16Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-3/+2
hf_ field name is the first part of the formatted string. This was all manual inspection and most cases were either: 1. Case sensitivity differences between hf_ field name and formatted string. 2. Unnecessary whitespace between hf_ field name and colon in formatted string There are cases where the hf_ field name doesn't quite match the proto_tree_add_uint_format, but it's close enough that one of them should be "right", I'm just not sure which is, I just know the string in proto_tree_add_uint_format is the one displayed. svn path=/trunk/; revision=52098
2013-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-10/+10
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-03-19From beroset:Anders Broman1-2/+2
remove C++ incompatibilities https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8416 svn path=/trunk/; revision=48426
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-08-10Use val_to_str_const() where appropriate;Bill Meier1-8/+8
Also (for a few files): - create/use some extended value strings; - remove unneeded #include files; - remove unneeded variable initialization; - re-order fcns slightly so prefs_reg_handoff...() at end, etc svn path=/trunk/; revision=44438
2012-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-04-19From Francisco Vidal Meca via ↵Alexis La Goutte1-4/+4
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7136 HIP dissector: PUZZLE and SOLUTION parameters variable size According to specifications, puzzle and solution parameters carry Random #I and #J fields that has variable length depending of the Hash function. The fields are recognized with a fixed value of 8 bytes. The #I and #J fields should be determined depending of the TLV size. See http://tools.ietf.org/html/draft-ietf-hip-rfc5201-bis-08#section-5.2.5 . svn path=/trunk/; revision=42140
2012-04-18From Francisco Vidal Meca via ↵Alexis La Goutte1-2/+28
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7136 HIP dissector: HIT_SUITE_LIST parameter from HIPv2 The HIT_SUITE_LIST Parameter from HIPv2 ( http://tools.ietf.org/html/draft-ietf-hip-rfc5201-bis-08 ) is unsupported. svn path=/trunk/; revision=42132
2012-04-16Make checkhf happy (a bad copy/paste ?)Alexis La Goutte1-1/+13
Add Modelines information svn path=/trunk/; revision=42097
2012-04-16From Paco via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7111Alexis La Goutte1-1/+29
HIP dissector of the HIP_CIPHER parameter is wrong From me: Add a hf_tlv_cipher_id and use proto_tree_add_item svn path=/trunk/; revision=42096
2012-04-13Remove doubled semicolons and semicolons outside function.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=42053
2012-01-12Don't do fcn calls in arg of g_?to??(); Macro may very well eval args ↵Bill Meier1-4/+6
multiple times. svn path=/trunk/; revision=40444
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-3/+3
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-11/+11
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-56/+56
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-19/+19
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-04-18Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-4/+3
svn path=/trunk/; revision=36701
2011-02-04From Samu Varjonen:Anders Broman1-2/+2
Bug fix: Incorrect presentation of Domain Identifier type and length in HIP dissector https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5649 svn path=/trunk/; revision=35818
2011-02-03From Samu Varjonen:Jaap Keuter1-22/+41
This patch fixes four issues with the Host Identity Protocol (HIP dissector: 1. The incorrect parsing of the "type 1" locator of HIP. 2. Updates the comments to reflect the approval of RFC 5770. 3. Cosmetic change (uppercase SPI) 4. Change in the checksum dissection (when the HIP packet is UDP encapsulated 0 checksum is correct). svn path=/trunk/; revision=35777
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-2/+2
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-06-04From Samu Varjonen: Whitespace cleanupBill Meier1-1175/+1176
Tabs converted to 8 spaces and trailing whitespaces removed, etc. svn path=/trunk/; revision=33086
2010-03-25From Samu Varjonen: "New patch to the locators"Bill Meier1-343/+369
See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3378#c25 From me: Fix typo: "REALY_UDP_HIP" --> "RELAY_UDP_HIP"; Cleanup whitespace. svn path=/trunk/; revision=32276
2010-03-17Revert SVN #32222: The handling of TLVs within the "LOCATOR" TLV needs to be ↵Bill Meier1-78/+56
reworked. svn path=/trunk/; revision=32228
2010-03-17From Samu Varjonen: Locator presentation change for HIP dissector.Bill Meier1-56/+78
See: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3378 From me: use consistent (tab) indentation; replace use of C++ style comment. svn path=/trunk/; revision=32222
2010-03-17Minor changes:Bill Meier1-103/+98
- stdio/stdlib/string includes not req'd; - Use less generic names for a few enum identifiers; - Use coonsistent indentation in a few palces. svn path=/trunk/; revision=32221
2009-12-02From Samu Varjonen:Jaap Keuter1-3/+6
svn diff of the changes after draft-ietf-hip-nat-traversal-09 was approved to become an RFC. svn path=/trunk/; revision=31148
2009-09-06Don't pass ep_alloc()'ed strings to col_set_str().Kovarththanan Rajaratnam1-1/+1
Fixes https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3984 svn path=/trunk/; revision=29726
2009-08-21Sanitize epan includesKovarththanan Rajaratnam1-2/+2
svn path=/trunk/; revision=29499
2009-08-16Switch a bunch of dissectors over to using tvb_new_subset_remaining()Kovarththanan Rajaratnam1-1/+1
svn path=/trunk/; revision=29446
2009-06-28Make dissector handle unexpected data better.Jaap Keuter1-9/+9
svn path=/trunk/; revision=28875
2009-06-15Trivial warning fixes:Jörg Mayer1-3/+3
- Might be used uninitialized - not a prototype - comma at end of enum svn path=/trunk/; revision=28730
2009-06-02packet_hip: (Minor): Remove unused data_handle; move proto_register... to ↵Bill Meier1-404/+400
just before proto_reg-handoff... svn path=/trunk/; revision=28604
2009-06-02Rewrote to add IPv6 addresses correctly and rewrote some proto_item_add_bytes()Stig Bjørlykke1-25/+43
to avoid using tvb_get_ptr(). svn path=/trunk/; revision=28601
2009-06-02Removed a unused preference setting, some unused includes andStig Bjørlykke1-27/+1
some unused code. svn path=/trunk/; revision=28598
2009-06-02From Samu Varjonen via bug 3378:Stig Bjørlykke1-0/+1526
Added support for Host Identity Protocol (HIP). From me: - Adjusted location of "Checksum" and "HIP Controls", as they seems to have switched place in the bytes window - Rewrote some proto_tree_add_uint -> proto_tree_add_item (some still remain) - Rewrote to not use tvb_memcpy() - Corrected some proto_tree_add_item's as the format seems to be big-endian - Terminate ALL value_string's with { 0, NULL } - No need to zero-terminate value_string strings. - Removed call to check_col() - Removed some prototypes - Removed unused hf_hip_tlv_id, hf_hip_res and hf_hip_tlv_enc_iv (please check) - Rewrote some C++ comments svn path=/trunk/; revision=28596