aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-vlan.c
AgeCommit message (Collapse)AuthorFilesLines
2018-03-06VLAN: define a recursion depth limitPascal Quantin1-2/+16
Altough the dissection consumes 4 bytes each time it is called, it can trigger a stack overflow for big packets. Let's limmit the number of allowed VLAN tags for a given packet. Bug: 14469 Change-Id: Ieb6834ab3350dc7e8c301e6479577855a253897e Reviewed-on: https://code.wireshark.org/review/26270 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
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>
2017-02-07GTK: Wrap static preference labels.Gerald Combs1-1/+1
In the GTK+ prefrences dialog, enable wrapping and set a maximum width. This should keep labels from making the dialog unusably wide. Make a couple of enum preferences drop-downs instead of radio buttons. Note that we might want to make the drop-down vs radio button behavior automatic. Change-Id: Ib72a2c8d5cfb99324be86f2218b6d57a395fa22c Reviewed-on: https://code.wireshark.org/review/19980 Reviewed-by: Gerald Combs <gerald@wireshark.org> Petri-Dish: Gerald Combs <gerald@wireshark.org> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Anders Broman <a.broman58@gmail.com>
2017-01-06VLAN: Support IEEE 802.1Q-2005 and -2011 changesJohn A. Thacker1-20/+174
Supports the recommended meanings of the priority field as changed by 802.1Q-2005, and the change from the CFI to DEI in 802.1Q-2011. A preference is added to use the older (non-compatible) spec version. Note that 802.1Q-2011 is consistent with 802.1ad and ah, which got rolled up in 802.1Q, but ends up removing support for bridging Token Ring and FDDI over Ethernet. Bug: 13294 Change-Id: Ieeadb0f6dda2758750f9e6649f1390609d78c50e Reviewed-on: https://code.wireshark.org/review/19548 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-10-28Implement registration of capture dissectors by nameJoão Valverde1-3/+11
Mirror it after protocol dissector API. Change-Id: I7985bcfa9e07654c7cf005efec94efc205d7a304 Reviewed-on: https://code.wireshark.org/review/18496 Reviewed-by: Michael Mann <mmann78@netscape.net>
2016-05-16Use the new ETHERTYPE_QINQ_OLD #define.Guy Harris1-1/+1
Change-Id: Ifaf96e8482316720bddc5bab3aab3d0a677fe5fb Reviewed-on: https://code.wireshark.org/review/15464 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-03-18IEEE 802.1Q/VLAN: Resolve ID to a describing nameUli Heilmeier1-0/+15
A vlans file in the personal preference directory add an option to resolve VLAN IDs to a describing name. Format of vlan file is 123\tName of VLAN To enable the resolving the preference nameres.vlan_name must be set to TRUE. Bug: 11209 Change-Id: I3f00b4897aace89c03c57b68b6c4b6c8b7d4685a Reviewed-on: https://code.wireshark.org/review/14471 Reviewed-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com>
2016-01-21Add VLAN ID to pinfoAndersBroman1-2/+7
I have traces where IP reassembly gets confused by multiple frames from different VLANS and ends up adding fragments from differet messages togeter after IP Identification is reused. I think VLAN ID could be useful in other places too to aviliate duplicate packet detection. Making this a separate patch while testing the usage. Change-Id: Id7c23dc52f6de2e1f2e980ec8fe61d0598500d0d Reviewed-on: https://code.wireshark.org/review/13452 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-12-17Create capture dissector "info" structure (capture_packet_info_t)Michael Mann1-4/+4
While it currently only contains packet_counts, it will hopefully stabilize the capture function signature if more fields are added. Change-Id: I003552c58043c7c2d67aec458187b12b233057e2 Reviewed-on: https://code.wireshark.org/review/12690 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-12-17Capture dissectors must be registered only once at startupPascal Quantin1-1/+2
So ensure that register_capture_dissector() is not called again when changing a preference Bug: 11884 Change-Id: I18ce05e89b19f106470a8ec843062c115dae60db Reviewed-on: https://code.wireshark.org/review/12689 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com> 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>
2015-12-14Create capture dissector tables.Michael Mann1-10/+10
They are modeled after dissection dissector tables, but for the moment, don't have/need the flexibility. They are intended to be much simpler/faster than full dissection. The two most used/needed are "wtap_encap" and "ethertype", so they were the basis of starting to use and test capture dissector table API. Others may be added in the future. The "capture dissector" function signature needed a bit of tweeking to handling "claiming" of a packet. The current application of this is capture functions returning TRUE if they affected a "type" of packet count. Returning FALSE ends up considering the packet an "other" type. Change-Id: I81d06a6ccb2c03665f087258a46b9d78d513d6cd Reviewed-on: https://code.wireshark.org/review/12607 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-12-13Standardize the capture dissector function signature.Michael Mann1-4/+4
This will make it easier to mold into (capture) dissector tables. Change-Id: Iad63f2c2869782977992a3a072adb020be4b1818 Reviewed-on: https://code.wireshark.org/review/12587 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-12-13Create a way to register "capture" dissectors.Michael Mann1-1/+1
Capture dissectors could be architected like dissection dissectors, with tables and subtables and possibly using tvbs to pass there data instead of raw byte arrays. This is a first step towards that by refactoring capture_info_packet() to work off of a "capture dissector table" Registering the capture dissection functions instead of calling them directly also clears up a bunch of dissector header files who sole purpose was providing the capture dissection function definition. Change-Id: I10e9b79e061f32d2572f009823601d4f048d37aa Reviewed-on: https://code.wireshark.org/review/12581 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-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-18create_dissector_handle -> new_create_dissector_handleMichael Mann1-3/+4
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-10-26Clean up more unnecessary use of the 'volatile' key word.Jeff Morriss1-3/+3
Change-Id: I3e72fddc6ed380780d7e2e1c8df87e580138188d Reviewed-on: https://code.wireshark.org/review/11271 Petri-Dish: Jeff Morriss <jeff.morriss.ws@gmail.com> 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>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-1/+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-29Add editor modelines and adjust indentation as needed.Bill Meier1-0/+13
Change-Id: Id57d264299f2026d703c5b08bace4b24b32f184c Reviewed-on: https://code.wireshark.org/review/4371 Reviewed-by: Bill Meier <wmeier@newsguy.com>
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-05-17Introduce col_add_lstr(), use it instead of slower col_add_fstr.Jakub Zawadzki1-3/+19
We have callgrind benchmarks which shows that col_add_fstr() takes 5% of Ir count cause of formatting done in g_vsnprintf(). New col_add_lstr() can be used in few dissectors without much ugliness, and it should be a little faster. Change-Id: Ifddd951063dfd3a27c2a7da4dafce9b242c0472c Reviewed-on: https://code.wireshark.org/review/1629 Reviewed-by: Evan Huus <eapache@gmail.com> 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-11- Forward declaration of register functions.Anders Broman1-1/+1
svn path=/trunk/; revision=53930
2013-12-10- Forward declaration of register functions.Anders Broman1-0/+1
svn path=/trunk/; revision=53911
2013-11-29Rename some of pint.h macros to match common style (bits number on the end).Jakub Zawadzki1-1/+1
pntohs -> pntoh16 pntohl -> pntoh32 pletohs -> pletoh16 pletohl -> pletoh32 phtons -> phton16 phtonl -> phton32 svn path=/trunk/; revision=53652
2013-11-20Convert ethertype() function into a pure dissector. Bug 9454 ↵Michael Mann1-2/+12
(https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9454) The main driving force for this was my new Decode As functionality (https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=9450) that wants a dissector/subdissector table relationship for all dissectors wanting to use Decode As functionality. The ethertype() function provides the value to the "ethertype" subdissector table, so I think it should be matched to a dissector. Only odd side effect is the display filter of "ethertype" returns no packets because there is no "item" associated with the dissector. svn path=/trunk/; revision=53443
2013-11-09include <wsutil/pint.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53196
2013-11-08Convert: vlan, sll, rip to NEW_PROTO_TREE_APIJakub Zawadzki1-37/+57
svn path=/trunk/; revision=53175
2013-10-14Reverting as requested by Jakub, eventhoug I don't think this prticular ↵Anders Broman1-3/+0
entry is useful as it's duplicated in the tree and almost certanly never vissible. svn path=/trunk/; revision=52608
2013-10-14 Adding to col info is probably useless as next dissector will overwrite it.Anders Broman1-0/+3
svn path=/trunk/; revision=52604
2013-09-05Add filterable expert info to dissect_802_3() and clean up the shrapnel.Michael Mann1-1/+10
svn path=/trunk/; revision=51761
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 Free Software Foundation address.Jakub Zawadzki1-1/+1
(COPYING will be updated in next commit) svn path=/trunk/; revision=43536
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-06Convert 'encoding' parameter of certain proto_tree_add_item() calls in ↵Bill Meier1-3/+3
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-09-23dissector_(add|delete) ==> dissector_(add|delete)_uint: fixes checkapi error.Bill Meier1-40/+40
svn path=/trunk/; revision=39108
2011-09-23Revert Revision 34838 "Resolve bug #2254: Migrate the 802.1q VLAN dissector ↵Anders Broman1-0/+219
into the Ethernet II." as this causes a lot of problems. See https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=5680 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6305 https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6366 Original bug: https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=2254 svn path=/trunk/; revision=39100
2010-11-10Resolve bug #2254: Migrate the 802.1q VLAN dissector into the Ethernet II.Stephen Fisher1-219/+0
svn path=/trunk/; revision=34838
2010-10-11Fix an error in a comment I added last week.Jeff Morriss1-1/+1
svn path=/trunk/; revision=34480
2010-10-08Remove check_col()Jeff Morriss1-8/+4
svn path=/trunk/; revision=34426
2010-10-08Don't use a TRY/CATCH block just to ignore any exceptions thrown byJeff Morriss1-8/+5
tvb_get_ntohs(): check the remaining tvb length instead. svn path=/trunk/; revision=34421
2010-04-05From David Aggeler:Anders Broman1-1/+1
Fixed wrong declaration in packet-vlan.c https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=4186 svn path=/trunk/; revision=32379
2010-01-02Oops. Capitalize the D in 802.1D.Stephen Fisher1-2/+2
svn path=/trunk/; revision=31407
2010-01-02Add descriptions to the priority and CFI fields in 802.1q VLAN packets.Stephen Fisher1-2/+22
svn path=/trunk/; revision=31406
2009-08-23Custom columfication:Kovarththanan Rajaratnam1-3/+0
* Deprecate COL_COS_VALUE (L2 COS Value (802.1p)). Use vlan.priority svn path=/trunk/; revision=29513
2009-08-09Don't guard col_clear with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29344
2009-08-09Don't guard col_set_str (COL_PROTOCOL) with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29340
2009-03-08Indicate hexadecimal preferences.Stig Bjørlykke1-1/+1
svn path=/trunk/; revision=27650