aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ax25.c
AgeCommit message (Collapse)AuthorFilesLines
2016-11-12fix no previous prototype for ‘capture_*’ [-Wmissing-prototypes]Alexis La Goutte1-1/+1
Change-Id: Ie5bfe4d366a679ebcb561716f23d174e7b9bf487 Reviewed-on: https://code.wireshark.org/review/18754 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-10-28Implement registration of capture dissectors by nameJoão Valverde1-2/+5
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-03-28Fix some warnings/errors of typeJoerg Mayer1-1/+1
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-6/+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-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>
2015-12-20flags_set_truth -> tfs_set_notsetMichael Mann1-9/+2
Change-Id: I127f55f4ed26a99facea4d1ecc29786ab4898a75 Reviewed-on: https://code.wireshark.org/review/12735 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-12-17Create capture dissector "info" structure (capture_packet_info_t)Michael Mann1-2/+2
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-12/+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-17/+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/+12
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/+4
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_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-11-13register_dissector -> new_register_dissectorMichael Mann1-3/+5
Picking off "easy" dissectors that only have one or two exit points at most. Change-Id: I3d5e576b796556ef070bb36d8b55da0b175dcba8 Reviewed-on: https://code.wireshark.org/review/11805 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-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-01-09Remove proto_tree_add_ax25Michael Mann1-11/+5
There isn't a legitimate use for the API, all cases can be covered with proto_tree_add_item. As a bonus, a few more tvb_get_ptr calls can be removed. Change-Id: I3bb86ba8f05ef3363407bcfe9b059ee27ebc135d Reviewed-on: https://code.wireshark.org/review/6429 Reviewed-by: Michael Mann <mmann78@netscape.net>
2015-01-07SET_ADDRESS -> TVB_SET_ADDRESS to "hide" some of the tvb_get_ptr use.Michael Mann1-5/+5
Not all changes were able to remove their corresponding tvb_get_ptr, because there are other API dependent on the (tvb_get)pointer, but future iterations optimizing those other APIs will then be able to remove it. Change-Id: Id7cefd440b81834de1d1aace7cd0789b1c871a22 Reviewed-on: https://code.wireshark.org/review/6358 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-21Replace ax25_to_str and get_ax25_name with address_to_str.Michael Mann1-6/+3
Change-Id: I74ddb6fc629ef32b217dede7a3ba652cbbf5ab12 Reviewed-on: https://code.wireshark.org/review/5932 Reviewed-by: Alexis La Goutte <alexis.lagoutte@gmail.com> Petri-Dish: Alexis La Goutte <alexis.lagoutte@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-12-21Cleanup use of #includes in non-generated epan/dissector/*.cBill Meier1-5/+1
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-30Add editor modelines; Adjust whitespace; Remove boilerplate commentsBill Meier1-0/+12
Change-Id: I1f5f83ed441f6009125cf2cbe5023af04986898a Reviewed-on: https://code.wireshark.org/review/4392 Reviewed-by: Bill Meier <wmeier@newsguy.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-11-29Avoid including <wiretap/wtap.h> in dissectors.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53655
2013-11-09Include <epan/to_str.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53189
2013-10-27Have X.25 dissector pass boolean q_bit_set value through dissector data ↵Michael Mann1-5/+0
rather than pinfo->private_data. Other "related" dissectors weren't manipulating pinfo->private_data, so it doesn't make sense for them to bother saving/restore it (now that q_bit_set isn't being used) svn path=/trunk/; revision=52894
2013-09-12Convert a few dissectors from emem to wmem APIPascal Quantin1-2/+2
svn path=/trunk/; revision=51983
2013-08-05Keep result of [new_]register_dissector in some dissectors.Jakub Zawadzki1-6/+5
svn path=/trunk/; revision=51156
2013-03-13- [-Wmissing-prototypes]Anders Broman1-1/+4
- explicit casts. svn path=/trunk/; revision=48282
2013-01-29Remove some unneeded parens in hf[] entries;Bill Meier1-8/+8
svn path=/trunk/; revision=47340
2012-12-21Constify some character pointer variables to avoid warnings aboutGuy Harris1-1/+1
strings being assigned to them. svn path=/trunk/; revision=46653
2012-10-22Cleanup:Bill Meier1-86/+70
- Ethereal --> Wireshark; - gerald@ethereal.com --> gerald@wireshark.org; - update FSF address; - remove unneeded #includes; - Fix ENC args for proto_tree_add_item() & etc; - simplify/remove proto_reg_handoff...() as appropriate; - remove some boilerplate comments; - move proto_register...() and proto_reg_handoff...() to the end of the file as per convention; - remove some unneeded initializers. - simplify some code; - replace "" in hf[] blurb by NULL. svn path=/trunk/; revision=45728
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-09-04Use libwireshark's xDLC handling functions and macros to process theGuy Harris1-62/+44
control field. This means processing the AX.25 header data in one pass. The field after the control field is the "protocol identifier" field, not the "packet identifier" field. svn path=/trunk/; revision=44772
2012-08-03Newer version of the AX.25 spec.Guy Harris1-0/+3
svn path=/trunk/; revision=44236
2012-08-03Move the list of AX.25 protocol IDs to epan/ax25_pids.h. Use it inGuy Harris1-80/+21
packet-ax25.c and packet-arp.c. Add an "ax25.pid" dissector table for those protocol IDs, use it in the AX.25 dissector, and have dissectors register in that table with their protocol IDs. Get rid of some unneeded includes. Clean up some "AX25"s in user-visible strings - say "AX.25" instead. Clean up some indentation. svn path=/trunk/; revision=44235
2012-08-03Make the protocol ID field an integral field with a value_string table;Guy Harris1-124/+70
use that table for setting the column as well. dissect_xdlc_control() sets the Info column; don't set it ourselves (dissect_xdlc_control() will overwrite it if called). That means we should always call dissect_xdlc_control(), regardless of whether we're building a protocol tree or not. Just get rid of the test for that. Append the protocol ID, if present, to the column. svn path=/trunk/; revision=44234
2012-08-02From Richard Stearn: AX.25 "No layer 3" support.Guy Harris1-1/+1
Also, [at]ify his e-mail address, and list packet-ax25.c before the packet-ax25-XXX.c dissectors in the file lists. svn path=/trunk/; revision=44228
2012-08-02From Richard Stearn: Rose (X.25 Packet Layer Protocol atop AX.25'sGuy Harris1-3/+3
link-layer protocol) support. Rename rose_handle to x25_handle, as it's not a handle for a protocol named "Rose" or "ROSE", it's a handle for X.25's Packet Layer Protocol (which we just call "x.25"). svn path=/trunk/; revision=44226
2012-08-02Clean up indentation.Guy Harris1-36/+24
Get rid of capture_XXX routines that just bump ld->other. *Do* bump ld->arp for AX.25 ARP packets. Note that, as there's IP-over-NetROM, capture_netrom() should check for it. svn path=/trunk/; revision=44225
2012-08-02From Richard Stearn: Flexnet support.Guy Harris1-20/+3
Also, get rid of check_col() calls and unused preferences, and use col_add_fstr() where appropriate. Fix up some indentation. svn path=/trunk/; revision=44222
2012-08-02Don't use dissector_add(): it's long since deprecated.Jeff Morriss1-2/+2
svn path=/trunk/; revision=44220
2012-08-02From Richard Stearn: AX.25 NetROM support.Guy Harris1-2/+3
Also add packet-ax25.c to the CMake list. svn path=/trunk/; revision=44217
2012-08-02Fix:Jörg Mayer1-40/+40
/home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-ax25.c:164:7: error: variable ‘v2cmdresp’ set but not used [-Werror=unused-but-set-variable] /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-ax25.c: In function ‘proto_register_ax25’: /home/jmayer/work/wireshark/svn/trunk/epan/dissectors/packet-ax25.c:398:12: error: variable ‘ax25_module’ set but not used [-Werror=unused-but-set-variable] svn path=/trunk/; revision=44214
2012-08-02From Richard Stearn: IP-over-AX.25 and AX.25 ARP.Guy Harris1-3/+3
svn path=/trunk/; revision=44212
2012-08-02From Richard Stearn: support for AX.25, including support forGuy Harris1-0/+630
LINKTYPE_AX25. svn path=/trunk/; revision=44211