path: root/epan/dissectors/packet-cdp.c
AgeCommit message (Collapse)AuthorFilesLines
2020-01-11Compilation fixes when CMAKE_BUILD_TYPE = MinSizeRel (-Os flag).Roman Koshelev1-1/+1
Compiler - gcc 8.3.0 These are mostly errors 'may be used uninitialized in this function' Change-Id: I6a8f7172c99024fd449570937b030e37c0ea5c3d Reviewed-on: https://code.wireshark.org/review/35746 Reviewed-by: Pascal Quantin <pascal@wireshark.org>
2020-01-10Use symbolic values for Cisco's LLC PIDsJoerg Mayer1-2/+2
Change-Id: I4cc99cef1e52fcce308608dd95befa2286787b16 Reviewed-on: https://code.wireshark.org/review/35728 Petri-Dish: Jörg Mayer <jmayer@loplof.de> Tested-by: Petri Dish Buildbot Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-08-04Use ENC_NA, not ENC_BIG_ENDIAN, for a sequence of bytes.Guy Harris1-1/+1
Change-Id: I90023c940b7a6a89f57c9394b5b21596f560c6e2 Reviewed-on: https://code.wireshark.org/review/34176 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2019-08-03CDP: Expand dissection of capabilitesOliver1-0/+24
Adds four extra capability definitions that could exist in a CDP packet. Useful for identifying phones. Change-Id: I2b542a8a079a8483d8c1ee10df60c8df0933af95 Reviewed-on: https://code.wireshark.org/review/34169 Petri-Dish: Anders Broman <a.broman58@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2019-07-26HTTPS (almost) everywhere.Guy Harris1-1/+1
Change all wireshark.org URLs to use https. Fix some broken links while we're at it. Change-Id: I161bf8eeca43b8027605acea666032da86f5ea1c Reviewed-on: https://code.wireshark.org/review/34089 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-02-12dissectors: use SPDX identifiers.Dario Lombardo1-13/+1
Change-Id: I92c94448e6641716d03158a5f332c8b53709423a Reviewed-on: https://code.wireshark.org/review/25756 Petri-Dish: Dario Lombardo <lomato@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2018-01-10Improve handling of VOIP VLAN queries and replies.Guy Harris1-33/+50
For queries, there appear to be two different versions, one with a 2-byte value of some unknown type and one with a 1-byte value that appears to be an "appliance type" code followed by a 2-byte VLAN ID. For replies, there only appears to be a version with a 1-byte "appliance type" followed by a 2-byte VLAN ID, but handle a too-short payload. Also point to http://www.rhyshaden.com/cdp.htm in some comments. Change-Id: If1b476d5e6b23c7e0ba027835c6f0c84c8b723b7 Reviewed-on: https://code.wireshark.org/review/25249 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-09Clean up dissection of "power requested" and "power available" TLVs.Guy Harris1-30/+44
Fix the addition of power values to the top-level item for the TLV so that it actually adds power values. Make the list of power values in that item display correctly, without extra commas. Fail if the length of the TLV is less than 8. (We should really add an expert info item for that.) Change-Id: Ic4229c0652306f69156b8341c9fbb67cacc8154c Reviewed-on: https://code.wireshark.org/review/25215 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2018-01-07CDP: Resolve 802.2 Protocol type protocols, show IPv6Uli Heilmeier1-0/+21
Protocols of protocol type 802.2 (PT = 2) are encoded with the "normal" ethernet type when PT length == 8. Used reference: https://docs.fd.io/vpp/17.10/d2/d71/cdp__protocol_8h_source.html Show IPv6 addresses as IPv6 and not as bytes. Change-Id: I0f192e758bcc1a562f042609fa5d0d9527551bb8 Bug: 14311 Reviewed-on: https://code.wireshark.org/review/25168 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-10-21Eliminate #include <epan/oui.h> from dissectors that don't need it.Michael Mann1-1/+0
Correct include patch for packet-lldp.c Change-Id: I5e2a267943ccd39616ef323848104fdba23c8f38 Reviewed-on: https://code.wireshark.org/review/24009 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann <mmann78@netscape.net>
2017-10-21Remove oui_vals value_string and epan/oui.cMichael Mann1-1/+1
oui.c is a very small subset of what comes from http://standards.ieee.org/regauth/oui/oui.txt, so use the "full" OUI list (and more) out of the manuf file and convert hf_ fields to just use BASE_OUI. Change-Id: Ic0c2ff618d8a6212f498e3b7475e0a7856c22b5b Reviewed-on: https://code.wireshark.org/review/24007 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-12-13Adjust proto_tree_add_uint_format_value calls to use unit stringMichael Mann1-16/+11
Several calls to proto_tree_add_uint_format_value could be better served using BASE_UNIT_STRING with a "unit string" in hf_ field. There also a few cases where proto_tree_add_uint_format_value could just be proto_tree_add_uint. Added a few more "common" unit string values to unit_strings.[ch] Change-Id: Iaedff82c515269c9c31ab9100dff19f5563c932d Reviewed-on: https://code.wireshark.org/review/19242 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-09-22CDP: Add CDP over GREAlexis La Goutte1-1/+2
http://www.cisco.com/c/en/us/td/docs/wireless/access_point/15-3-3-JB/configuration/guide/cg_book/cg-appA-protfilters.html Bug:12934 Change-Id: If6498446c86f509a44dc28d3c2e4d86cc61cd167 Reviewed-on: https://code.wireshark.org/review/17853 Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jaap Keuter <jaap.keuter@xs4all.nl> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-08-21CDP: Don't read outside payload for Port IDUli Heilmeier1-1/+2
Check if tvb remaining length is greater than expected length. Bug: 12767 Change-Id: Ia04b559432af417db519cfcfbec06e6010b496bf Reviewed-on: https://code.wireshark.org/review/17208 Petri-Dish: Jim Young <jim.young.ws@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-07-27Follow up for proto_tree_add_checksum.Michael Mann1-1/+4
Fill in the "gaps" so that all dissectors that verify checksums have both a status and expert info field. Also address comments from original proto_tree_add_checksum patch that didn't make it. Ping-Bug: 8859 Change-Id: I2e6640108fd6bb218cb959fe9e4ba98a13e43a2f Reviewed-on: https://code.wireshark.org/review/16590 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-07-21Add proto_tree_add_checksum.Michael Mann1-51/+19
This is an attempt to standardize display/handling of checksum fields for all dissectors. The main target is for dissectors that do validation, but dissectors that just report the checksum were also included just to make them easier to find in the future. Bug: 10620 Bug: 12058 Ping-Bug: 8859 Change-Id: Ia8abd86e42eaf8ed50de6b173409e914b17993bf Reviewed-on: https://code.wireshark.org/review/16380 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Jeff Morriss <jeff.morriss.ws@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-4/+1
This saves many dissectors the need to find the data dissector and store a handle to it. There were also some that were finding it, but not using it. For others this was the only reason for their handoff function, so it could be eliminated. Change-Id: I5d3f951ee1daa3d30c060d21bd12bbc881a8027b Reviewed-on: https://code.wireshark.org/review/14530 Petri-Dish: Michael Mann <mmann78@netscape.net> 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-11-16create_dissector_handle -> new_create_dissector_handleMichael Mann1-4/+5
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: Ie514f126352e7598acc4f7c38db9c61d105d5e48 Reviewed-on: https://code.wireshark.org/review/11850 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-01-07tvb_bytes_to_ep_str -> tvb_bytes_to_strMichael Mann1-1/+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-3/+2
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71 Reviewed-on: https://code.wireshark.org/review/5934 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-3/+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-12-13Use ENC_BIG_ENDIAN when fetching FT_U?INT8 fields ...Bill Meier1-10/+10
(for some dissectors which fetch all other integral fields using ENC_BIG_ENDIAN). Change-Id: Ic18e3172aad76af12b12d6732c88497be22aed56 Reviewed-on: https://code.wireshark.org/review/5748 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-30Eliminate proto_tree_add_text from packet-q933.cMichael Mann1-2/+0
Change-Id: If5b85609d3daaf66cbcc15e3127af4e7f5736e52 Reviewed-on: https://code.wireshark.org/review/4995 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-20Eliminate proto_tree_add_text from packet-cdp.cMichael Mann1-251/+245
Change-Id: I77e1f5788e0567dcaef9f75e1f45e61c63d54b4e Reviewed-on: https://code.wireshark.org/review/4849 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-09-30Add editor modelines; Adjust whitespace as needed.Bill Meier1-1/+14
Change-Id: I434da226c842298f4fb2a4335d06d51e164af2af Reviewed-on: https://code.wireshark.org/review/4394 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-15Update some URLs.Guy Harris1-6/+4
Change-Id: Iaba677670907dbfb028c1112cd11986d859329cb Reviewed-on: https://code.wireshark.org/review/3600 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-09Clean up Internet checksum handling.Guy Harris1-4/+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-25Get rid of an unused variable.Guy Harris1-1/+0
Change-Id: I8e436b7e4724c85943200087783d3cf7dd7c1535 Reviewed-on: https://code.wireshark.org/review/2639 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-24convert to proto_tree_add_subtree[_format]Michael Mann1-135/+92
Change-Id: I5f573dffabb8685a8e5a334ff2bfb24d9838daa6 Reviewed-on: https://code.wireshark.org/review/2601 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-04-26Added fields used by HP MSM access points.Lasse Luttermann Poulsen1-0/+203
Change-Id: I367c99bb351993f05161d683eb54f08e5852145f Reviewed-on: https://code.wireshark.org/review/1347 Reviewed-by: Michael Mann <mmann78@netscape.net>
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-19Rename a couple of to_str functions to have ep_ in the name. This makes itEvan Huus1-5/+5
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-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-22Revert r52730, it is unnecessary with r52695 reverted.Evan Huus1-1/+0
svn path=/trunk/; revision=52764
2013-10-21Don't go into a loop if we find a zero-length line. FixesEvan Huus1-0/+1
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9312 Anders, this may be related to your recent TVB optimizations, since I don't think it happened before that? Did you change the behaviour of tvb_find_line_end or its callees at all? svn path=/trunk/; revision=52730
2013-09-15Convert proto_tree_add_uint_format to proto_tree_add_uint_format_value if ↵Michael Mann1-4/+4
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-13Dario Lombardo <lomato@gmail.com> viaJörg Mayer1-1/+2
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9147 Migration from emem to wmem for trivial cases (ep_alloc only). svn path=/trunk/; revision=52002
2013-09-11Change the name of the Cisco HDLC dissector table from chdlctype to ↵Chris Maynard1-1/+1
chdlc.protocol and change the UI name to match. It is by far much more common to name the tables after the field than to pick another name. svn path=/trunk/; revision=51958
2013-04-22Fix some Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-1/+0
svn path=/trunk/; revision=48984
2013-03-15[-Wmissing-prototypes]Anders Broman1-1/+4
Use explicit casts. svn path=/trunk/; revision=48313
2013-02-12Fix typos in display filters caught by checkfiltername.plMichael Mann1-1/+1
svn path=/trunk/; revision=47645
2012-09-26replaced decode_boolean_bitfield calls with itemized filtersMichael Mann1-54/+85
svn path=/trunk/; revision=45152
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-2/+2
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-04-24Minor cleanup: whitespace, indentation, long-lines, style, typos, etc;Bill Meier1-921/+918
Also: remove unneeded #include <stdlib.h> in 2 cases. svn path=/trunk/; revision=42226
2011-10-21For proto_tree_add_item(..., proto_xxx, ...)use ENC_NA as the encoding arg.Bill Meier1-1/+1
Also: remove trailing whitespace for a number of files. svn path=/trunk/; revision=39503
2011-10-15Convert proto_tree_add_item() 'encoding' arg for field types FT_STRING, ↵Bill Meier1-3/+3
FT_STRINGZ, FT_UINT_STRING as follows: 1. If there's no character encoding (ENC_ASCII, ...) specified then use ENC_ASCII. 2. For all but FT_UINT_STRING, always use ENC_NA (replacing any existing True/1/FALSE/0 /ENC_BIG_ENDIAN/ENC_LITTLE_ENDIAN). svn path=/trunk/; revision=39426
2011-10-06Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-57/+57
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