summaryrefslogtreecommitdiff
path: root/epan/dissectors/packet-arcnet.c
AgeCommit message (Collapse)AuthorFilesLines
2016-10-28Implement registration of capture dissectors by nameJoão Valverde1-5/+14
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-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-06-22Add address_to_bytes API.Michael Mann1-1/+1
This will copy an address's "byte format" into a buffer. The original intended design is for export_pdu functionality, which tries to do this "manually" for many address types (and creates undesired dependencies) The default functionality if a "byte format function" isn't provided (currently the case for all address types) is a memcpy of the address data. Providing "address to byte" functions to aid export PDU functionality will be provided later. Change-Id: I3703f9e617a8cef09165ad53a0f98c6372676b9b Reviewed-on: https://code.wireshark.org/review/16070 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-28Fix some warnings/errors of typeJoerg Mayer1-3/+3
git/epan/dissectors/packet-a21.c:478:25: error: 'item' was marked unused but was used [-Werror,-Wused-but-marked-unused] proto_item_append_text(item, "%s", val_to_str_const(event_id, a21_event_vals, "Unknown")); ^ Added manual change id because file-jpeg.c forced the use of commit -n Change-Id: Iffff53d6253758c8454d9583f0a11f317c8390cb Fix warnings/errors of type: git/epan/dissectors/packet-ax25-kiss.c:205:52: error: 'pseudo_header' was marked unused but was used [-Werror,-Wused-but-marked-unused] return capture_ax25( pd, l_offset, len, cpinfo, pseudo_header ); Fix checkhf warnings: Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_address_netswitch Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_address_subswitch Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_poll_reply_trailer Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_rdm_universe Unused entry: epan/dissectors/packet-artnet.c, hf_artnet_tod_data_universe Change-Id: Id1fa12afb97a8e9cd4ed0ea25351c3b2639c930e Reviewed-on: https://code.wireshark.org/review/14667 Reviewed-by: Jörg Mayer <jmayer@loplof.de>
2016-03-20Create call_data_dissector() to call data dissector.Michael Mann1-3/+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>
2016-03-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-4/+3
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>
2015-12-22Don't limit capture packet counts to a fixed set of protocols.Michael Mann1-1/+6
Kept backwards compatibility with GTK+ capture info dialog by keeping the protocols tracked hardcoded, but Qt should have more freedom. Change-Id: I497be71ec761d53f312e14858daa7152d01b8c72 Reviewed-on: https://code.wireshark.org/review/12724 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-12-17Create capture dissector "info" structure (capture_packet_info_t)Michael Mann1-11/+10
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-14Create some more capture dissector tables.Michael Mann1-1/+2
These were created from capture dissector functions that had switch statements determine "next" protocol/dissector. The registration decreases the need for function declarations in header files. Added new capture dissection tables for IP, IPv6, TCP and UDP as that seems like the next logical place to expand Change-Id: I1ec0cd54eecda4f400669ee5b026bf6e2b46545a Reviewed-on: https://code.wireshark.org/review/12634 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-14Create capture dissector tables.Michael Mann1-20/+16
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-2/+2
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-6/+18
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-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-16create_dissector_handle -> new_create_dissector_handleMichael Mann1-6/+8
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-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-11-03Remaining ADDRESS macro to address function conversionsJoão Valverde1-2/+2
Change-Id: I8bc9af431e70243b05f4f0ce8c2b8ee451383788 Reviewed-on: https://code.wireshark.org/review/11463 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-10-22Use address functions instead of ADDRESS macros in asn1 and epanGerald Combs1-2/+2
Replace CMP_ADDRESS, COPY_ADDRESS, et al with their lower-case equivalents in the asn1 and epan directories. Change-Id: I4043b0931d4353d60cffbd829e30269eb8d08cf4 Reviewed-on: https://code.wireshark.org/review/11200 Petri-Dish: Michal Labedzki <michal.labedzki@tieto.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-10-19If it's used by dissectors, it belongs in to_str.h, not to_str-int.h.Guy Harris1-1/+1
Assuming *any* of the routines that generate printable strings should be thought of as "for internal use by libwireshark routines only, not by dissectors", the ones that *are* used by dissectors obviously shouldn't be. The ability for dissectors to register address types certainly expands the list of routines they would use. Move everything used by dissectors from to_str-int.h into to_str.h, and have dissectors not include to_str-int.h. (Perhaps we should just get rid of to_str-int.h altogether.) Change-Id: I3c583351f038233c9bcd8f9216188f82630267fa Reviewed-on: https://code.wireshark.org/review/11149 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-03-01Use COPY_ADDRESS_SHALLOW instead of duplicating TVB_SET_ADDRESS and ↵Michael Mann1-2/+2
SET_ADDRESS calls for the same address. Change-Id: I0c9cc5d574fdd73ecf1f8b32dbbf0ddb2b885116 Reviewed-on: https://code.wireshark.org/review/7437 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-02-19Add name resolution support to address type.Michael Mann1-8/+8
Add address_with_resolution_to_str API that returns address string + name resolution in the format %s (%s), first string is resolved name (if available) and second string is raw address string. Convert AT_FCWWN to using proper name resolution format First use of address_with_resolution_to_str with field types in proto.c Change-Id: I2ae77c29a4ffc30bb919fbec00f06629830898c2 Reviewed-on: https://code.wireshark.org/review/7196 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-02-09Add fixed length function for address types.Michael Mann1-1/+6
This allows for even more cleanup with respect to how address types are handled, including removing address_to_str.c. Most of the functionality was folded into address_types.c, but the remainder was just dispersed because it didn't make sense to keep the file. Change-Id: Id4e9391f0c3c26eff8c27b362e4f7a1970d718b4 Reviewed-on: https://code.wireshark.org/review/7038 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-02-09Add "column filter string" support to address types.Michael Mann1-4/+33
Information about dissector (filter) fields should be kept in a dissector as much as possible. Supporting "column filter string" also allows other dissectors to create their own "address types" with different column filters (because AT_ETHER isn't always an "Ethernet" address). This feature also allowed a few "dissector specific" address types to be moved to their own dissector. Change-Id: Ie9024af4db62bc2ee4f8c9d28a1d807f706f45bf Ping-Bug:7728 Reviewed-on: https://code.wireshark.org/review/7029 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-20Remove some dead initializersBill Meier1-2/+2
Change-Id: I0478fa5c476a1914ae0c18feafc7720dd3111d84 Reviewed-on: https://code.wireshark.org/review/6690 Reviewed-by: Bill Meier <wmeier@newsguy.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-09-29Add editor modelines; fix indentation as needed.Bill Meier1-0/+13
Change-Id: I1ad94654343e5a018a0b3159481d45ffb3a91263 Reviewed-on: https://code.wireshark.org/review/4363 Reviewed-by: Bill Meier <wmeier@newsguy.com>
2014-08-03Eliminate proto_tree_add_text from some dissectors.Michael Mann1-1/+7
Change-Id: Ib6024307e85d6c23decf40e9759f549c19ffe136 Reviewed-on: https://code.wireshark.org/review/3318 Petri-Dish: Michael Mann <mmann78@netscape.net> Petri-Dish: Evan Huus <eapache@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> 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-11-29Avoid including <wiretap/wtap.h> in dissectors.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53655
2013-03-12- [-Wmissing-prototypes]Anders Broman1-0/+3
- explicit casts. svn path=/trunk/; revision=48274
2012-12-02Introduce, and start using, TVB_SET_ADDRESS() and TVB_SET_ADDRESS_HF(). TheyJeff Morriss1-4/+4
are like the non-TVB versions except that they take a TVB and an offset instead of (frequently) a pointer into the TVB. Calling tvb_get_ptr() before modifying the rest of the fields should help fix https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=7960 (though I can't reproduce that problem). Replace a bunch of calls like: SET_ADDRESS(..., AT_XXX, length, tvb_get_ptr(tvb, offset, length)); with: TVB_SET_ADDRESS(..., AT_XXX, tvb, offset, length); svn path=/trunk/; revision=46324
2012-10-18Minor cleanup:Bill Meier1-1/+1
- revert incorrect replacement of FALSE by ENC_BIG_ENDIAN done a while back; [The incorrect use of ENC_BIG_ENDIAN was benign since ENC_BIG_ENDIAN is currently defined as 0x0000000]; svn path=/trunk/; revision=45651
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-2/+0
In a few cases: do some whitespace, indentation cleanup & reformatting. svn path=/trunk/; revision=42632
2012-04-23Do indentation cleanup (e.g., 4-space tabs => spaces)Bill Meier1-15/+15
Reformat a few long lines. svn path=/trunk/; revision=42213
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-04Use ENC_NA as encoding for proto_tree_add_item() calls which directly ↵Bill Meier1-1/+1
reference an hf item (in hf[] with types: FT_NONE FT_BYTES FT_IPV6 FT_IPXNET FT_OID Note: Encoding field set to ENC_NA only if the field was previously TRUE|FALSE|ENC_LITTLE_ENDIAN|ENC_BIG_ENDIAN svn path=/trunk/; revision=39260
2011-09-26Get rid of check_col() and use ENC_BIG_ENDIAN.Anders Broman1-8/+5
svn path=/trunk/; revision=39144
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-09-23Replace blurbs that match the name (case insensitive) with NULL.Jeff Morriss1-2/+2
svn path=/trunk/; revision=34227
2010-05-10Indentation & whitespace cleanup (including: "4 space tabs" ==> spaces)Bill Meier1-8/+8
svn path=/trunk/; revision=32735
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-11-09Put tree elements in the arcnet subtree.Stig Bjørlykke1-27/+13
Some code cleanup. svn path=/trunk/; revision=30890
2009-08-16Switch a bunch of dissectors over to using tvb_new_subset_remaining()Kovarththanan Rajaratnam1-1/+1
svn path=/trunk/; revision=29446
2009-08-09Don't guard col_set_str (COL_INFO) with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29342
2009-08-09Don't guard col_set_str (COL_PROTOCOL) with col_checkKovarththanan Rajaratnam1-2/+1
svn path=/trunk/; revision=29340
2009-06-18From Kovarththanan Rajaratnam via bug 3548:Stig Bjørlykke1-1/+1
(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
2006-05-21change a whole bunch of ethereal into wiresharkRonnie Sahlberg1-2/+2
svn path=/trunk/; revision=18196
2005-09-17Move a pile of protocol-related headers from the top-level sourceGuy Harris1-1/+1
directory to the epan directory. Some of them should perhaps ultimately be moved to epan/dissectors, if they pertain only to stuff exported by a particular dissector. Fix Gerald's e-mail address in files we're moving. svn path=/trunk/; revision=15844