aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-pw-eth.c
AgeCommit message (Collapse)AuthorFilesLines
2017-01-28Revert "MPLS: relax pw_eth_heuristic and improve 1st nibble logic"Anders Broman1-11/+6
This reverts commit 01ddd93a7296b54a2048de74691984a7e78e4cb9. Change-Id: I90f19fec52d3f1edc63fd00e614173a0154503d4 Reviewed-on: https://code.wireshark.org/review/19820 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-28MPLS: relax pw_eth_heuristic and improve 1st nibble logicFrancesco Fondelli1-6/+11
relax pw_eth_heuristic and, at the same time, improve the 1st nibble logic in dissect_mpls in order to disambiguate between Ethernet pseudo-wire without a control word, with the MAC address's first nibble being 4/6 and IPv4/6 packet. Bug: 13301 Change-Id: If4697c2e40271d84e2db11a9f64ee60a8657e164 Signed-off-by: Francesco Fondelli <francesco.fondelli@gmail.com> Reviewed-on: https://code.wireshark.org/review/19599 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: Anders Broman <a.broman58@gmail.com>
2017-01-08Restore some MPLS registered dissectors.Michael Mann1-3/+2
Per https://ask.wireshark.org/questions/58532/missing-dissector-pw_eth_cw it appears some MPLS dissectors are still referenced by name and not just for the dissector table created in I1e0c3ae784b71c0145b1f1730a97feae8e9f488f. Change-Id: I27be132f56c879be16f78f76ac0e9688673a47c1 Reviewed-on: https://code.wireshark.org/review/19582 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-12-31Dissectors don't need a journey of self discovery.Michael Mann1-4/+2
They already know who they are when they register themselves. Saving the handle then to avoid finding it later. Not sure if this will increase unnecessary register_dissector functions (instead of using create_dissector_handle in proto_reg_handoff function) when other dissectors copy/paste, but it should make startup time a few microseconds better. Change-Id: I3839be791b32b84887ac51a6a65fb5733e9f1f43 Reviewed-on: https://code.wireshark.org/review/19481 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-03-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-1/+1
Started by grepping call_dissector_with_data, call_dissector_only and call_dissector and traced the handles passed into them to a find_dissector within the dissector. Then replaced find_dissector with find_dissector_add_dependency and added the protocol id from the dissector. "data" dissector was not considered to be a dependency. Change-Id: I15d0d77301306587ef8e7af5876e74231816890d Reviewed-on: https://code.wireshark.org/review/14509 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-01-12Fix indentation.Guy Harris1-1/+1
Change-Id: I7bce164bcaa6a5b38fe2614d5340396cff37ba70 Reviewed-on: https://code.wireshark.org/review/13199 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-12-09new_register_dissector -> register_dissector for dissector directory.Michael Mann1-1/+1
Change-Id: Ie39ef054a4a942687bd079f3a4d8c2cc55d5f22c Reviewed-on: https://code.wireshark.org/review/12485 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-2/+2
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-18create_dissector_handle -> new_create_dissector_handleMichael Mann1-6/+6
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I9c7d1c092bbae896ec0c2832617891346927f2e1 Reviewed-on: https://code.wireshark.org/review/11932 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>
2015-11-14register_dissector -> new_register_dissectorMichael Mann1-3/+4
Picking off "easy" dissectors that only have one or two exit points at most. This concludes a "first pass" over the dissector directory. Change-Id: If5ce5484214be50fe541cba478da1de62e354297 Reviewed-on: https://code.wireshark.org/review/11830 Petri-Dish: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-06-13MPLS: always display payload when no 'Decode As' preference is setPascal Quantin1-1/+3
Based on the heuristic suggested by Jasper, check whether ethertype matches IPv4, ARP, RARP, VLAN or IPv6 and decode payload as Ethernet PW (CW heuristic) by default. Otherwise display payload as data by default. This can be overridden by the 'Decode As' configuration. Follow up of g7ca0472 Bug: 11271 Change-Id: Idb2ce1f8b967813a8f4a5e29e6005d5442729395 Reviewed-on: https://code.wireshark.org/review/8912 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-08Remove MPLS preference that doubled for Decode As.Michael Mann1-8/+3
Just use Decode As directly. Also replace "registered" dissectors which just the creation of a handle since the dissectors really don't need to be "found" outside of themselves. Change-Id: I1e0c3ae784b71c0145b1f1730a97feae8e9f488f Reviewed-on: https://code.wireshark.org/review/7899 Reviewed-by: Michael Mann <mmann78@netscape.net>
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-09-06Eliminate proto_tree_add_text from some of the dissectors.Michael Mann1-8/+7
Other minor cleanups while in the area. Change-Id: I8ea59205cfe6fab643d8fe01b75ce91532004fd9 Reviewed-on: https://code.wireshark.org/review/4004 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: Alexis La Goutte <alexis.lagoutte@gmail.com>
2014-06-20Rename dissector_add_handle() to dissector_add_for_decode_as().Guy Harris1-3/+3
Hopefully that name makes it clear what the routiner's purpose is, and will encourage people to use it rather than using dissector_add_uint() with a bogus integer value. Change-Id: Ic5be456d0ad40b176aab01712ab7b13aed5de2a8 Reviewed-on: https://code.wireshark.org/review/2483 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-06-19To make a dissector available for Decode As, just use dissector_add_handle().Guy Harris1-3/+3
No need to use dissector_add_uint() with a bogus value. Change-Id: Ia5e51d199487ba14cd671c7df44231a0d407c50b Reviewed-on: https://code.wireshark.org/review/2431 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-12- Forward declaration of register functions.Anders Broman1-0/+3
svn path=/trunk/; revision=53971
2013-11-21Remove ethertype, mpls_label and ppids from packet_info structure.Michael Mann1-18/+0
The information was converted to "proto" data within their respective dissectors strictly for use in "Decode As". svn path=/trunk/; revision=53489
2012-12-06Fix "MPLS payload starting with valid-looking ethernet address dissected twice".Bill Meier1-4/+2
Fixes Bug #8043 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=8043 svn path=/trunk/; revision=46420
2012-09-28Cleanup:Bill Meier1-14/+12
packet-mpls.c: - refactor dissect_pw_ach(); - create/uer value_string_ext as appropriate; - use call_dissector() rather than direct dissector call in one cse; all: - use 'LABEL' prefix for a set of rather generic enum identifiers; - fix some cases of calling expert...() or sub-dissectors under 'if(tree)'; - reformat some hf[] entries; - do some whitespace changes. svn path=/trunk/; revision=45195
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-06-28Update FSF address - part II.Jakub Zawadzki1-1/+1
svn path=/trunk/; revision=43538
2012-05-15Remove unneeded #includes (stdlib, stdio, ctypes, time);Bill Meier1-1/+1
In a few cases: do some whitespace, indentation cleanup & reformatting. svn path=/trunk/; revision=42632
2012-04-17From Francesco Fondelli: fixes up issue 1) and 3) described in the bug ↵Anders Broman1-139/+162
report https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7089 svn path=/trunk/; revision=42112
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-05-20Use proto_tree_add_item() instead of proto_tree_add_xxx() with a pointer intoJeff Morriss1-31/+31
the TVB. Introduce and start using tvb_get_manuf_name() and tvb_get_manuf_name_if_known() which do the same as the non-tvb versions but take a tvb and an offset instead of (commonly) a pointer into a TVB. svn path=/trunk/; revision=37317
2010-12-20Rename the routines that handle dissector tables with unsigned integerGuy Harris1-3/+3
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-04-06#include <string.h> not needed.Bill Meier1-1/+0
svn path=/trunk/; revision=32410
2010-04-03Remove unneeded #include <stdio.h>Bill Meier1-1/+0
svn path=/trunk/; revision=32367
2009-08-16Switch a bunch of dissectors over to using tvb_new_subset_remaining()Kovarththanan Rajaratnam1-2/+2
svn path=/trunk/; revision=29446
2009-07-11From Artem Tamazov:Anders Broman1-6/+28
Analyze->Decode as... menu item becomes unavailable in some situations.(Ethernet-PW) https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3642 svn path=/trunk/; revision=29063
2009-06-18From Kovarththanan Rajaratnam via bug 3548:Stig Bjørlykke1-2/+2
(1) Trailing/leading spaces are removed from 'name's/'blurb's (2) Duplicate 'blurb's are replaced with NULL (3) Empty ("") 'blurb's are replaced with NULL (4) BASE_NONE, NULL, 0x0 are used for 'display', 'strings' and 'bitmask' fields for FT_NONE, FT_BYTES, FT_IPv4, FT_IPv6, FT_ABSOLUTE_TIME, FT_RELATIVE_TIME, FT_PROTOCOL, FT_STRING and FT_STRINGZ field types (5) Only allow non-zero value for 'display' if 'bitmask' is non-zero svn path=/trunk/; revision=28770
2009-04-04From Francesco Fondelli:Anders Broman1-114/+121
New ATM PW (with/without CW) dissector, RFC 4717 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3375 svn path=/trunk/; revision=27955
2009-03-03Artem Tamazov:Anders Broman1-16/+64
MPLS payload dissection: +menu for default, ~pw-eth, ~pw-generic https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=3294 svn path=/trunk/; revision=27590
2008-09-30Minor proto_reg_handoff cleanup: use find_dissector when appropriate.Bill Meier1-3/+2
svn path=/trunk/; revision=26308
2008-08-25#include <prefs.h> not req'dBill Meier1-1/+0
svn path=/trunk/; revision=26089
2008-07-13From Francesco Fondelli:Jaap Keuter1-0/+159
Attached is a patch for: - PW Associated Channel Header dissection as per RFC 4385 - PW MPLS Control Word dissection as per RFC 4385 - mpls subdissector table indexed by label value - enhanced "what's past last mpls label?" heuristic - Ethernet PW (w/o CW) support as per RFC 4448 svn path=/trunk/; revision=25730