aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-wccp.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-26wccp: fix spelling typo found by lintianAlexis La Goutte1-1/+1
Change-Id: I9ce35505d4b35e2c2bcacd13eca075005e05c307 Reviewed-on: https://code.wireshark.org/review/18488 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-13Convert most UDP dissectors to use "auto" preferences.Michael Mann1-1/+1
Similar to the "tcp.port" changes in I99604f95d426ad345f4b494598d94178b886eb67, convert dissectors that use "udp.port". More cleanup done on dissectors that use both TCP and UDP dissector tables, so that less preference callbacks exist. Change-Id: If07be9b9e850c244336a7069599cd554ce312dd3 Reviewed-on: https://code.wireshark.org/review/18120 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-09wccp: fix bitwise operations (CID 1312144 & 1312145).Dario Lombardo1-4/+4
Change-Id: I62cdb1eb7c62ab09bd43d0e0760bdedb4b1725c8 Reviewed-on: https://code.wireshark.org/review/16976 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-06-06Move ip6_to_str_buf() to to_str.c and make it take the buffer length.João Valverde1-1/+1
Also make it use ws_inet_ntop6() (rather than implementing the string conversion ourselves). Remove ip6_to_str_buf_len(). Change-Id: I1eff3a8941e00987c2ff0c4dcfda13476af86191 Reviewed-on: https://code.wireshark.org/review/15692 Reviewed-by: João Valverde <j@v6e.pt> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-06-05Fix expert_info errors found by new and improved checkhfs.pl.Michael Mann1-1/+3
Change-Id: I30f1b92ee438361c3bd58743f7d1ae8d5ffc96f0 Reviewed-on: https://code.wireshark.org/review/15718 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-01-08Fix a lot of typos and misspellingsmoshekaplan1-2/+2
Change-Id: I8512cfa1d424f82a873a0e0e1d22c7b075fdd7f3 Reviewed-on: https://code.wireshark.org/review/13069 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-09new_create_dissector_handle -> create_dissector_handle for dissector directory.Michael Mann1-1/+1
Some of the ASN.1 dissectors still generate a new_create_dissector_handle from the tool itself, so leave those for now. Change-Id: Ic6e5803b1444d7ac24070949f5fd557909a5641f Reviewed-on: https://code.wireshark.org/review/12484 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-10-14Change proto_tree_add_ipv6() to take a struct e_in6_addr pointerJoão Valverde1-2/+2
tvb_get_ipv6() takes a struct e_in6_addr *, use that here too. Change-Id: Id8b368daa05c151a61d4bc01dc88c00da13e9c88 Reviewed-on: https://code.wireshark.org/review/10953 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Balint Reczey <balint@balintreczey.hu> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2015-07-22WCCP: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+1
Dead Store include on g38c05061b Change-Id: Ib29edea664ac6563c0eb9dc21dae168a8cfe6cd6 Reviewed-on: https://code.wireshark.org/review/9748 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17WCCP - remove global variable used to store address information for ↵Michael Mann1-668/+867
computation later. Change-Id: I06841ec77cf9f34914b9dfe10b8cd35824b32b71 Reviewed-on: https://code.wireshark.org/review/9647 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-17WCCP - Only populate address table once and presume first address table type ↵Michael Mann1-4/+8
is the one that should populate it. Ping-Bug: 11358 Change-Id: Ieed093b4aa263026772450f95dd5fa18280f9b76 Reviewed-on: https://code.wireshark.org/review/9648 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-09VXLAN: Add Group Based Policy dissectorAmine Kherbouche1-1/+1
According to some advices from my last commit,i made some changes, and i use proto_tree_add_bitmask for bits field. Editing VXLAN dissector for supporting GBP extension described in the following draft link : https://tools.ietf.org/html/draft-smith-vxlan-group-policy-00 This pach works fine with "old" version of VXLAN (no GBP support) The flags are now extended to 16 bits to support GBP extension, Group Policy Id is on 16 bits, VNI always on 24 bits and remaining bits are reserved. The following bits are defined in addition to the existing VXLAN fields: bit 0 : "G" Group Based Policy Extension bit bit 9 : "D" Don't Learn bit bit 12 : "A" Policy Applied bit the remaining bits are reserved Bug: 11348 Change-Id: I425ed63cf76f134eb3d1680a1753ed31f252dfa8 Signed-off-by: Amine Kherbouche <amine.kherbouche@6wind.com> Reviewed-on: https://code.wireshark.org/review/9537 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-21Remove deprecated tvb_length from a bunch of dissectorsEvan Huus1-1/+1
Change-Id: I5c777806cb1403062a9d85261149d722df57b239 Reviewed-on: https://code.wireshark.org/review/9005 Reviewed-by: Evan Huus <eapache@gmail.com> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-08Eliminate proto_tree_add_text from some dissectors.Michael Mann1-86/+99
"file" dissectors are now rid of proto_tree_add_text. Change-Id: I4e0f7248135e6ce194fcafde47e538db84b964aa Reviewed-on: https://code.wireshark.org/review/8828 Reviewed-by: Michael Mann <mmann78@netscape.net> Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-06-04WCCP: Fix up storing and decoding of IP addresses.Jeff Morriss1-69/+60
Try to decode as many IP addresses as we can, even if they don't fit in the table we store them in. Only add IP addresses in the table once. We could theoretically reallocate the table but the original code seems to assume the addresses should (in non-fuzzed captures) only show up once per PDU. This part of the change fixes the fuzz failure. Bug: 11153 Change-Id: I56b9854ac1342080c9f32699a3f97750fa335696 Reviewed-on: https://code.wireshark.org/review/8748 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-03-18Eliminate decode_bitfield_value from dissectors.Michael Mann1-49/+38
Change-Id: I37f5dbd5e88fd4dd8f736b014d36aae926082d1f Reviewed-on: https://code.wireshark.org/review/7735 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-18Add a CF_FUNC macro for casting BASE_CUSTOM functions.Gerald Combs1-21/+20
Add a CF_FUNC macro to match VALS, TFS, etc. This should help us to avoid the following warning: warning: ISO C forbids initialization between function pointer and 'void *' [-Wpedantic] We could start adding DIAG_OFF+DIAG_ON everywhere but this seems to be more consistent with the other macros in proto.h. Update each instance of BASE_CUSTOM to use CF_FUNC. Adjust a dummy variable name generated by asn2wrs.py that was triggering an invalid error in checkhf.pl. Fix an encoding arguement in packet-elasticsearch.c found by fix-encoding-args.pl. Change-Id: Id0e75076c2d71736639d486f47b87bab84e07d22 Reviewed-on: https://code.wireshark.org/review/7150 Reviewed-by: Gerald Combs <gerald@wireshark.org>
2015-01-07tvb_bytes_to_ep_str -> tvb_bytes_to_strMichael Mann1-2/+1
Change-Id: I79c613cbdd8dc939dd4c29ebc477fb6eefd5bfc4 Reviewed-on: https://code.wireshark.org/review/6371 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-12-26Replace ip_to_str with [ep_]address_to_str and tvb_ip_to_str.Michael Mann1-1/+1
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71 Reviewed-on: https://code.wireshark.org/review/5934 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-26WCCP: initialize address table to 0Pascal Quantin1-2/+2
It prevents an uninitialized access later on if an exception is triggered before filling the table Bug: 10806 Change-Id: I8f75fb18cd8d033013c34093f9d6c8762f23452b Reviewed-on: https://code.wireshark.org/review/6056 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-12-25Deleting unnecessary #includes from dissectors.Martin Mathieson1-2/+0
Fifth batch (packet-rtp.c -> end). Will look at cleaning up and committing script afterwards. Change-Id: I8ed61dc941d98d3f7259a9d1f74e214eb7b4bfa2 Reviewed-on: https://code.wireshark.org/review/6052 Reviewed-by: Martin Mathieson <martin.r.mathieson@googlemail.com>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-2/+0
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-11-26WCCP: Remove uneeded check (pinfo & info_tree)Alexis La Goutte1-18/+10
Remove also some false positive Dereference of null pointer Change-Id: I09687993531827c6e4f5178f3414ddd9a2702038 Reviewed-on: https://code.wireshark.org/review/5506 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-11-26wccp: use pinfo-scope memory for addressesEvan Huus1-4/+4
They may be accessed during the print phase, at which point packet-scope memory has already been freed. Bug: 10720 Change-Id: Ia2b160fd9de4ccaa3a4b8d9cb70fb9b32d4e08a0 Reviewed-on: https://code.wireshark.org/review/5496 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-11-10WCCP: fix parsing of extended assignment data elementVictor Voronkov1-4/+8
Bug: 10641 Change-Id: I51322757c5aa7877fa8ff7915330ff24e7a8cbe2 Reviewed-on: https://code.wireshark.org/review/5221 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-08-20Various dissection improvements.Guy Harris1-115/+119
In WCCP V2, check whether the length field runs past the end of the packet (actual packet data, not captured data) and, if so, report an error with expert info, otherwise use the length field to set the length of the tvbuff. That allows the dissector to just use the tvbuff checks to do length checks, so eliminate manual length checks. In find_wccp_address_table(), stop if we run past the reported length or packet length; if we fail to find an address table because we run past the captured length, we should probably note that if we're trying to dissect addresses. Don't do any other checks against the captured length, just throw the BoundsError assertion, to report that the packet was cut short during the capture process. When creating a protocol subtree for an item, give it a "to the end" initial length", and only set the length when we're finished dissecting the item, based on the amount of data dissected. Don't speak of dissectors in expert info - the user needn't know what a dissector is; what matters is what the protocol specifies. Properly report "item is too short" errors - those are indicated by item dissectors returning a negative value, so show the negative of that value. Make the top level item for a capability element be a separate item from the element type; use hf_capability_element_type for the type rather than the entire element, and put the type and length into the protocol tree in that order, as that's the order in which they appear in the packet. Don't do capability element length checks in the capability element dissector, do it in the dissector for the particular capability element, and don't fail with a dissector bug report, fail with an expert info. Sort the ett[] array to match the list of ett_ definitions, to make it easier to check that they're all registered. Change-Id: I6545e000b6caf9824f89234602635668fa1d38d6 Reviewed-on: https://code.wireshark.org/review/3754 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-07-06convert to proto_tree_add_subtree[_format]Michael Mann1-59/+33
Change-Id: I3efa2a81ab2685cde6eae0a00b24520478a545ce Reviewed-on: https://code.wireshark.org/review/2900 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-03-07(Benign) Don't use "address-of" operator on arg of VALS() (not that it makes ↵Bill Meier1-1/+1
any actual difference).. Change-Id: I0766d0f130648aaa5a58d9f4062fa24e898cbdc3 Reviewed-on: https://code.wireshark.org/review/545 Reviewed-by: Bill Meier <wmeier@newsguy.com> Tested-by: Bill Meier <wmeier@newsguy.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-01-14Don't cast away constness.Guy Harris1-7/+7
svn path=/trunk/; revision=54773
2013-12-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-1/+1
obvious that the returned string is ephemeral, and opens up the original names in the API for versions that take a wmem pool (and thus can work in any scope). svn path=/trunk/; revision=54249
2013-12-14Fix some trivial warnings.Jakub Zawadzki1-0/+3
svn path=/trunk/; revision=54085
2013-11-09Don't include <epan/strutil.h> when not needed.Jakub Zawadzki1-1/+0
svn path=/trunk/; revision=53194
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53189
2013-10-29From didier gautheron: remove redundant or use faster col_xxx functionsBill Meier1-2/+0
- when the text parameter is constant col_add_str() and col_set_str() are equivalent but col_set_str() is faster. - same for replace col_append_fstr and col_append_str - remove col_clear() when it's redundant: + before a col_set/col_add if the dissector can't throw an exception. - replace col_append() after a col_clear() with faster col_add... or col_set https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9344 svn path=/trunk/; revision=52948
2013-10-13whitespace fixes; mostly: remove trailing blanksBill Meier1-1/+1
svn path=/trunk/; revision=52591
2013-10-09From Peter Van Eynde via ↵Pascal Quantin1-6/+6
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9252 : Fix WCCP fix hash buckets assignment info decoding svn path=/trunk/; revision=52464
2013-09-30Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=52287
2013-09-28From Peter Van Eynde viaEvan Huus1-6/+7
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9187 Fix some minor length calculation mistakes in the WCCP decoder. svn path=/trunk/; revision=52260
2013-09-12emem -> wmemJörg Mayer1-9/+9
"tshark -v" tested svn path=/trunk/; revision=51988
2013-09-09expert_add_info_format_text -> expert_add_info_formatMichael Mann1-16/+16
svn path=/trunk/; revision=51852
2013-07-01Make expert items filterable and a little cleanup.Michael Mann1-184/+142
Remove NULL tree check at start of dissection to ensure expert info is populated. Overall I think the logic could be a little cleaner (length checking and its tie to expert info seems excessive), but I'm not familiar enough to be comfortable making the changes. This dissector appears to be vulnerable to DOS attacks through its unsigned 16-bit length fields (just from static inspection). Having the length be a signed 32-bit value even if the length in the protocol field is an unsigned 16-bit value could simplify some of the logic. svn path=/trunk/; revision=50310
2013-06-28From Dirk via https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8850 :Jeff Morriss1-4/+4
The attached patch fixes the integer type of the WCCP identity mask value. This is a bitmask which should be printed as hex, it doesn't make sense to print it as an IPv4 address. See http://tools.ietf.org/id/draft-wilson-wrec-wccp-v2-01.txt section 5.7.7 and the attached capture file as an example. The current draft http://tools.ietf.org/html/draft-mclaggan-wccp-v2rev1-00#section-6.15 doesn't mention "mask" in the names of the field any more, but the description still describes them as mask values. svn path=/trunk/; revision=50211
2013-06-14Remove check_col() and the occasional tree.Michael Mann1-3/+1
svn path=/trunk/; revision=49923
2013-06-06Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-5/+4
svn path=/trunk/; revision=49806
2013-06-06Fix typo (double include epan/ipproto.h)Alexis La Goutte1-1/+0
svn path=/trunk/; revision=49805
2013-06-05From Peter Van Eynde via ↵Chris Maynard1-619/+617
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8635: Fix bugs found by Coverity: CID's 1026572-1026574 and 1026572. From me: Dissector was a mix of tabs and spaces. Replace tabs with spaces and set modelines to match. svn path=/trunk/; revision=49785
2013-06-05wccp_version_val is not an extended value string; don't use BASE_EXT_STRING. ↵Jeff Morriss1-1/+1
Fixes a crash I got during fuzz testing. svn path=/trunk/; revision=49783