summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-lldp.c
AgeCommit message (Collapse)AuthorFilesLines
2016-12-16Improve some unit strings with unicode charactersJoão Valverde1-2/+2
Change-Id: Ic6812fd266832743962e020cfc8f0af2d4742fdf Reviewed-on: https://code.wireshark.org/review/19308 Petri-Dish: João Valverde <j@v6e.pt> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: João Valverde <j@v6e.pt>
2016-12-16Fix typo in unit_name_string units_decibels name.Stig Bjørlykke1-2/+2
Change-Id: Ib17ca3a613648667d0f99fa7412d074a205840a9 Reviewed-on: https://code.wireshark.org/review/19300 Petri-Dish: Stig Bjørlykke <stig@bjorlykke.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
2016-12-16Remove proto_item_append_text calls in favor of BASE_UNIT_STRING.Michael Mann1-29/+24
Many proto_item_append_text calls were just adding a unit string to a field. There's a better way to do that now. Change-Id: Id18d5ac1ea4d8ecdc4cbe7ebaec07fbd2eab6e78 Reviewed-on: https://code.wireshark.org/review/19289 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-10-04LLDP: fix indent (use tab)Alexis La Goutte1-11/+11
Change-Id: Ic9923d93d74a40da2a4009f8b27d8a5ae9803833 Reviewed-on: https://code.wireshark.org/review/18064 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>
2016-09-30Revert "LLDP: fix indent (use tab)"Anders Broman1-7/+7
This reverts commit f97372bfccf34c012b4a4a6f720ca54dae8ea5d8. Change-Id: I750b232fa710e64815875671e713533bb0f42e24 Reviewed-on: https://code.wireshark.org/review/17995 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-30LLDP: fix indent (use tab)Alexis La Goutte1-7/+7
Change-Id: I7f9aa2733401fc99a10d5d5a83a175e923562f50 Reviewed-on: https://code.wireshark.org/review/17991 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-09-30LLDP: Update column info according to PROFINET requirementsBirol Capa1-26/+154
Column information of LLDP frames should be updated according to PROFINET requirements without changing the default behavior of column information. Therefore, a new protocol setting is added. This setting is used to display PROFINET specialized column information: Edit-> Preferences -> Protocols -> Select LLDP Bug: 12937 Change-Id: I48b78d0a3f6b3425f6f9c1d4be20dc24b143346d Reviewed-on: https://code.wireshark.org/review/17081 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-31Don't do any Decode As stuff for dissector tables not used with Decode As.Guy Harris1-1/+1
Have all dissector tables have a "supports Decode As" flag, which defaults to FALSE, and which is set to TRUE if a register_decode_as() refers to it. When adding a dissector to a dissector table with a given key, only add it for Decode As if the dissector table supports it. For non-FT_STRING dissector tables, always check for multiple entries for the same protocol with different dissectors, and report an error if we found them. This means there's no need for the creator of a dissector table to specify whether duplicates of that sort should be allowed - we always do the check when registering something for "Decode As" (in a non-FT_STRING dissector table), and just don't bother registering anything for "Decode As" if the dissector table doesn't support "Decode As", so there's no check done for those dissector tables. Change-Id: I4a1fdea3bddc2af27a65cfbca23edc99b26c0eed Reviewed-on: https://code.wireshark.org/review/17402 Petri-Dish: Guy Harris <guy@alum.mit.edu> Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-08-15LLDP: Fix Dead Store (Dead assignement/Dead increment) Warning found by ClangAlexis La Goutte1-5/+0
Change-Id: I1d98c3ae79e98349f7d759cce4b93e6a94144743 Reviewed-on: https://code.wireshark.org/review/17064 Reviewed-by: Uli Heilmeier <openid@heilmeier.eu> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-08-13LLDP: Add Avaya IP Phone OUI SubtypesUli Heilmeier1-0/+142
Used https://downloads.avaya.com/elmodocs2/one-X_Deskphone_Edition/R1.5/output/16_300698_4/admn0711.html as reference for the subtypes. Bug: 12740 Change-Id: Ia9084bca3ab07e484c1d074a2cdf6072b8a3dfa0 Reviewed-on: https://code.wireshark.org/review/17039 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-06-10Remove superfluous length check (CID-1158783)Jaap Keuter1-6/+0
When entering a loop with check for minimum length, don't stick to the pattern of checking length first thing. Change-Id: I28c414108efa5499dbacd8527b2c3e654e49e808 Reviewed-on: https://code.wireshark.org/review/15795 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-1/+1
This will make it easier to determine protocol dependencies. Some LLC OUI dissector tables didn't have an associated protocol, so they were left without one (-1 used) Change-Id: I6339f16476510ef3f393d6fb5d8946419bfb4b7d Reviewed-on: https://code.wireshark.org/review/14446 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-02-28LLDP: Add 802.3 TLV Energy Efficient Ethernet (Subtype 5)Alexis La Goutte1-0/+49
Bug:12165 Change-Id: I341d4387227a41af826a2867b48a53eff7e1e62a Reviewed-on: https://code.wireshark.org/review/14200 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-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-11-25create_dissector_handle -> new_create_dissector_handleMichael Mann1-9/+7
This finalizes the transformation for dissectors. Change-Id: Ie5986b72bb69a6e8779ca3f5e20a80357c9e6fea Reviewed-on: https://code.wireshark.org/review/12122 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-11-19Lldp: Lldp Dissector Column Info is updated for ProfinetBirol Capa1-3/+21
Current Lldp dissector column information just shows the "System Description" information. In Profinet applications, Chassis Id and Port Id gives much more information for the application. Therefore, Lldp Dissector Column Info is updated for frames that contains Profinet tlvs. Change-Id: I30856d4471fd38ed07f3b9a6a25ef49b2d04f047 Reviewed-on: https://code.wireshark.org/review/11940 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-11-04Don't allow multiple registrations of a protocol in dissector tables.Michael Mann1-1/+1
The target here is the Decode As dialog where protocols have multiple registrations into a dissector table and that shows up as multiple entries in the Decode As dialog list with the same name so users are unsure which "dissector" they are choosing. The "default" behavior (done in this commit) is to not allow duplicates for a dissector table, whether its part of Decode As or not. It's just ENFORCED for Decode As. Bug: 3949 Change-Id: Ibe14fa61aaeca0881f9cc39b78799e314b5e8127 Reviewed-on: https://code.wireshark.org/review/11405 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-07-02LLDP: fix dissection of Power Class fieldPascal Quantin1-1/+11
Bug: 11330 Change-Id: I865fe694706606c091a32f58a35658800a9dacc6 Reviewed-on: https://code.wireshark.org/review/9473 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-02-22Fix handling of longitude and latitude values.Guy Harris1-3/+3
The formatting routine is getting passed the 5-byte value, not some 8-byte value that includes the 3 bytes after it, so shifting it produces the wrong value. Make the longitude and latitude FT_UINT40, as they're only 5 bytes long. Change-Id: I35aa05887bcfdfc1107fef2ac5069f1fe96fda3a Reviewed-on: https://code.wireshark.org/review/7321 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-22Clean up display of raw hex latitude/longitude values.Guy Harris1-1/+1
1) It's only 40 bits long, so show only 10 hex digits. 2) If you're putting "0x" before the number, blank-padding on the left looks weird; use zero-padding. 3) Fix unbalanced parentheses. Change-Id: I76aedb1fb82f699ee08102b97b0d72e09d8c5917 Reviewed-on: https://code.wireshark.org/review/7320 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-22Put back address family field.Guy Harris1-0/+1
Change-Id: I89d60f78a0c834663c426f5ec50c6033ba9f99e1 Reviewed-on: https://code.wireshark.org/review/7318 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-02-18Add a CF_FUNC macro for casting BASE_CUSTOM functions.Gerald Combs1-5/+5
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-4/+4
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-28Replace ip6_to_str and ip6_guint8_to_str with address_to_str and tvb_ip_to_str.Michael Mann1-8/+4
Change-Id: I1d258923a7a63539ec8456d3e306bca5016a1e4b Reviewed-on: https://code.wireshark.org/review/6060 Petri-Dish: Michael Mann <mmann78@netscape.net> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> 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-8/+4
Change-Id: I40d0c8253743183aecef252040b7dd6742ae5c71 Reviewed-on: https://code.wireshark.org/review/5934 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-23Deleting unnecessary #includes from dissectors.Martin Mathieson1-1/+0
Third batch (packet-icmpv6.c -> packet-mac-lte.c). Will look at cleaning up and committing script afterwards. Change-Id: Ib91e36ad200db01c3000605f6a7a21125b96a640 Reviewed-on: https://code.wireshark.org/review/6018 Petri-Dish: Martin Mathieson <martin.r.mathieson@googlemail.com> 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-12-12Change ENC_NA to ENC_BIG_ENDIAN for all fetches of integral type fields.Bill Meier1-10/+10
Change-Id: Ia4f5735c61eedcbe8354eabd5da05d02e167f25e Reviewed-on: https://code.wireshark.org/review/5734 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-11-17LLDP: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-2/+2
Change-Id: I8c750ed9ad775b9be9d12050d200d7f1b4ddb86e Reviewed-on: https://code.wireshark.org/review/5365 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-11-150.0 is a double, 0.0f is a float.Guy Harris1-1/+1
Change-Id: I882bbda2c579cfd7a1b96ce190541262193405e0 Reviewed-on: https://code.wireshark.org/review/5320 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-11-15LLDP: Dissector for Hytec specific extensions addedGregor Miernik1-1/+587
It provides dissection of objects with additional neighbor and link information defined by Hytec (pcap example available on wiki.wireshark.org/HYTEC). Also OUI of "Hytec Geraetebau GmbH" added. Change-Id: I92119e46fd5f4c4b385ac3df3170a4766fe056b7 Reviewed-on: https://code.wireshark.org/review/5107 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-06Adjust indentation to match editor modelines; Do other minor whitespace changes.Bill Meier1-3/+3
Change-Id: Ic020b2c92db5d14a2be9dc4d35aef4514b8b0353 Reviewed-on: https://code.wireshark.org/review/4502 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-10-04LLDP: Fix Dead Store (Dead assignement/Dead increment) warning found by ClangAlexis La Goutte1-2/+0
Change-Id: I616e57c84c5721213ee12a41b63595547ab15f72 Reviewed-on: https://code.wireshark.org/review/4465 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-10-01LLDP: TIA Network Policy Unknown Policy Flag Decode is not correctAlexis La Goutte1-18/+8
Wrong length for field... Bug:10512 Change-Id: I416a34d5f50cc0e842612a084c95d885eea68ef1 Reviewed-on: https://code.wireshark.org/review/4377 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: Anders Broman <a.broman58@gmail.com>
2014-09-19Do encoding-arg changes (all benign)Bill Meier1-2/+2
For: - FT_BYTES: Always use just ENC_NA - integral/floating (other than FT_[U]INT8): Do ENC_NA --> ENC_BIG_ENDIAN Also: - FT_UINT... --> FT_UINT8 in a few cases (to match proto_tree_add_item...) - Change one case of incorrect '||' to '|' Change-Id: I427e0e61618ff8faf55691c8a695930f67d455b0 Reviewed-on: https://code.wireshark.org/review/4184 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-18Fix warning: no previous prototype for ... [-Wmissing-prototypes]Alexis La Goutte1-1/+1
Add static before function Change-Id: Ia34e4786d6181c7849094dd0c27445b29dd89f10 Reviewed-on: https://code.wireshark.org/review/3695 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2014-08-14Eliminate proto_tree_add_text from some dissectors.Michael Mann1-15/+22
Other minor cleanup while in the neighborhood. Change-Id: If73a029f564219782c313d4154c24c7ce7458b52 Reviewed-on: https://code.wireshark.org/review/3574 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: Anders Broman <a.broman58@gmail.com>
2014-06-29proto_tree_add_subtree[_format]Michael Mann1-49/+32
Change-Id: Id00f456479415adf0a219af6c9a2108d4b3642d0 Reviewed-on: https://code.wireshark.org/review/2702 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Use the same offset += rtnValue logic for all TLV types, instead of a ↵Anish Bhatt1-6/+16
special case for chassis, port & ttl. I've avoided using any mathematical checks even though tlv type vals increase linearly just in case they change in the future. Change-Id: I0ec7021df5b91543e12edf9ba8d9c4ac44ecb11c Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2193 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-11Rename temp variables to a more human readable formAnish Bhatt1-117/+117
Change-Id: Idafe97df6be71d885203e2e3426fdb6a133862c4 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2140 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-11Use offset instead of tempOffset, return offset instead of calculating (len ↵Anish Bhatt1-507/+539
+ n) where possible Change-Id: I91ef4ec59698903cb2a7be00e7e0ece478fc26a8 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2139 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-11Use expert info for Invalid length/type where possible, other minor fixesAnish Bhatt1-105/+70
Change-Id: I4a0421bf918439261f31f4bfc2cb5519b38f1711 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2118 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-11Fix bug in dissect_lldp_port_id, support all port id subtypesAnish Bhatt1-12/+78
Change-Id: I8b44e0d55701ba5d583e3e734e19d4d2aa024b25 Reviewed-on: https://code.wireshark.org/review/2049 Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-09Add modelinesAnish Bhatt1-0/+13
Change-Id: Ib8e157e2744198eaa1a5a69732bd8e977b146026 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2089 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-09remove all checks for if (tree)Anish Bhatt1-655/+514
Change-Id: I82617c0a396fdf42735ba39a5ed266a3f5240854 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2048 Tested-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-07tvb_new_subset -> tvb_new_subset_length when length parameters are equal.Michael Mann1-1/+1
tvb_new_subset -> tvb_new_subset_remaining it appears that's what the intention is. Change-Id: I2334bbf3f10475b3c22391392fc8b6864454de2d Reviewed-on: https://code.wireshark.org/review/1999 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2014-06-06Misc lldp cleanup.Anish Bhatt1-32/+39
I'm cheating a bit here, hf_media_loc_long & hf_media_loc_lat need a 5byte bitmask, but the bitmask field in hf is restricted to guint32 Change-Id: I7e044fc680bb947973e437fc66057488a8deee67 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/2012 Reviewed-by: Evan Huus <eapache@gmail.com>
2014-06-06LLDP-MED CleanupAnish Bhatt1-116/+258
Co-ordinate based LCI is untested, as the sample capture does not have this, could not find one anywhere. Change-Id: Id0b52c234d6a36ee430ab9a7265bcd84f151c80c Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/1929 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-03LLDP : Fix bug in mdi_power_source hf.Anish Bhatt1-8/+10
While it compiles fine, hits an assert in add_string : failed assertion "hfinfo->type == FT_STRING || hfinfo->type == FT_STRINGZ || hfinfo->type == FT_STRINGZPAD" Fix takes care of this issue, but seems like we're losing the bitmask info here, is there a better way to do this ? Change-Id: I7156d734f4b058113730d5dfbf6498e801c36770 Signed-off-by: Anish Bhatt <anish@chelsio.com> Reviewed-on: https://code.wireshark.org/review/1915 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>