aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-atm.c
AgeCommit message (Collapse)AuthorFilesLines
2017-05-29Fix up dissector tables' UI names.Jeff Morriss1-2/+2
This was inspired by using the Decode-As UI to decode Field "SSL TCP Dissector" Value (port) XXX as YYY. "SSL Port" makes more sense as the UI name. Change-Id: Id6398a5dc79e32bddc4f1bfcf0a468ae1364808f Reviewed-on: https://code.wireshark.org/review/19573 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-2/+7
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-2/+2
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-05-17Replace tvb_get_ptr with tvb_memdup.Michael Mann1-1/+1
The number of bytes allocated is small enough not to matter. Change-Id: I44c2103a87bd41f21e61d0f27648266fdc2be557 Reviewed-on: https://code.wireshark.org/review/15470 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-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-5/+3
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-20Manually add protocol dependencies derived from find_dissector.Michael Mann1-8/+8
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-17Associate dissector tables and heuristic subdissector lists with a protocol.Michael Mann1-2/+2
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-01-20Separate "Ethernet in capture file" and "Ethernet maybe with FCS" dissectors.Guy Harris1-6/+3
Have a dissector that is passed a "struct eth_phdr" pointer, indicating whether there is an FCS, there is no FCS, or there's maybe an FCS, and an "eth_maybefcs" dissector, to be called from other dissectors. The latter takes no data argument. That obviates the need for callers of the latter to fill in an "eth_phdr" structure. Note in a comment that setting the "assume an FCS" preference overrides a file format handler in Wiretap saying "we have no FCS". I seem to remember that this might be intentional. Ping-Bug: 9933 Change-Id: I600e1351d468ab31d48369edb96832d6da3e480c Reviewed-on: https://code.wireshark.org/review/13432 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-18Have the "maybe an FCS" version of the Ethernet dissector take a data argument.Guy Harris1-1/+4
It's called from some places other than packet-frame.c, at least one of which currently can't call anything else (the ATM dissector, for VC-multiplexed bridged frames, where you don't know whether the frames include the FCS or not), so the frame's pseudo-data doesn't necessarily have the appropriate "FCS length" value. Have it explicitly check the data argument, and explicitly pass the appropriate value to it. Ping-Bug: 9933 Change-Id: I0c75f921d25d1e2b75e476c15ff9625205036b25 Reviewed-on: https://code.wireshark.org/review/13382 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-15Not passing a struct atm_phdr to an ATM dissector is a bug.Guy Harris1-12/+4
Check for it with DISSECTOR_ASSERT(). Change-Id: I71ba81107f7a4aff21b0f0dbecb5158dc4ff6238 Reviewed-on: https://code.wireshark.org/review/13318 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-15ATM: do not try to dissect if pseudo header is not presentPascal Quantin1-0/+16
Bug: 12013 Change-Id: If753fcdbb01d646fc4db43485549e8c6f668eced Reviewed-on: https://code.wireshark.org/review/13311 Petri-Dish: Pascal Quantin <pascal.quantin@gmail.com> Reviewed-by: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org> Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2016-01-14Expand a comment.Guy Harris1-1/+10
Change-Id: I9d749c43727291768a36adc0c1956f73a5374f91 Reviewed-on: https://code.wireshark.org/review/13283 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-14Get rid of unused dissector handles.Guy Harris1-4/+0
Change-Id: Id439256b4a6705fed4ded69884bc371a8d6ce47b Reviewed-on: https://code.wireshark.org/review/13280 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-14Clean up indentation.Guy Harris1-4/+4
Change-Id: I140a6c7ac2f9380335ce9756824319b4d4a5b323 Reviewed-on: https://code.wireshark.org/review/13272 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2016-01-14Have various ATM dissectors use the data arguments for pseudo-headers.Guy Harris1-70/+70
Don't use the pseudo-header pointed to by pinfo->pseudo_header; have the argument either point to a struct atm_phdr or to a pwatm_private_data_t. Don't *overwrite* the pseudo-header pointed to by pinfo->pseudo_header if you need to construct an ATM pseudo-header for a dissector; have your own struct atm_phdr structure, fill it in, and pass a pointer to *that* to the sub-dissector. Cleans things up a bit. Change-Id: I4464924def4de41c625002b2d273592bd529e46e Reviewed-on: https://code.wireshark.org/review/13270 Reviewed-by: Guy Harris <guy@alum.mit.edu>
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-14Create some more capture dissector tables.Michael Mann1-25/+6
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-22/+11
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-3/+3
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/+9
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-6/+6
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-16create_dissector_handle -> new_create_dissector_handleMichael Mann1-7/+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-2/+2
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-06-14Clean up the ATM dissection a bit.Guy Harris1-136/+160
Have separate dissectors for ATM MPLS pseudo-wire traffic and regular traffic. That way, we can handle the regular traffic dissectors being handed private data, e.g. an ATM pseudo-header from libwiretap. Change-Id: I11e5abfdb1c3a5acc070ddaba8ef53813bc85e1a Reviewed-on: https://code.wireshark.org/review/8921 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-26ATM: Add reserved fieldAlexis La Goutte1-11/+17
Always display reserved field Change-Id: Ic9d7ea269bd31fc25bc9ef0430a49f37fa66a937 Reviewed-on: https://code.wireshark.org/review/8652 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-26ATM: fix indent (use spaces)Alexis La Goutte1-1/+1
Change-Id: I6d8bae2124a5472448e2f2629340a20f5a899076 Reviewed-on: https://code.wireshark.org/review/8651 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-05-03Fix inconsistent indentation.Guy Harris1-49/+49
Change-Id: If757fb60023f2bf733ed3f51b6d6a18756283b42 Reviewed-on: https://code.wireshark.org/review/8285 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-05-03Don't dissect otherwise-undissected data twice.Guy Harris1-10/+6
Also, set decoded to TRUE after we return from a dissector; that makes it a bit clearer when we're setting it. Change-Id: Ief3e999c72954e08d4608b15b49921da294807c1 Reviewed-on: https://code.wireshark.org/review/8284 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2015-04-15Replcae deprecated API tvb_length with tvb_reported_length or tvb_capturedAndersBroman1-6/+6
length. Change-Id: Id42f3409a32e202528d350f7afde7376e411fc51 Reviewed-on: https://code.wireshark.org/review/8076 Reviewed-by: Anders Broman <a.broman58@gmail.com>
2015-04-07ATM: add a cast to pacify the OSX 10.5 x86 buildbotPascal Quantin1-1/+1
Change-Id: I2bff621b46b4811cf60ebaff8fca7429bed3a91e Reviewed-on: https://code.wireshark.org/review/7973 Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
2015-04-07Add proper "Decode As" mechanism for AAL2 instead of preference.Michael Mann1-72/+39
Also create dissector table for AAL5 subdissectors. This isn't identified as a "Decode As" need, but now the conversion should be easier if that becomes needed. Change-Id: Ie70318991874de9ef8d95a2853dfceb3c0b94a00 Reviewed-on: https://code.wireshark.org/review/7894 Reviewed-by: Evan Huus <eapache@gmail.com> Reviewed-by: Michael Mann <mmann78@netscape.net>
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; 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-08The "MPEG-2" CRC-32 is also the ATM CRC-32.Guy Harris1-126/+2
Use it in the ATM dissector, and use a tvbuff version, so that we don't do tvb_get_ptr() ourselves. Change-Id: I0bd3594bc739e0cca447ac06f34a471441cf2e70 Reviewed-on: https://code.wireshark.org/review/3513 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-08Clean up the CRC-10 code.Guy Harris1-63/+3
Have the wsutil routine just accumulate the stuff from the buffer handed to us. Have the IUUP dissector deal with the extra stuff. Add a update_crc10_by_bytes_tvb() routine, which is passed a tvbuff, offset, and length, and use that rather than using tvb_get_ptr() in dissectors. Change-Id: Iadd0823c764080e60d1339abb94d2e19150eabfe Reviewed-on: https://code.wireshark.org/review/3509 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2014-08-03Eliminate proto_tree_add_text from some dissectors.Michael Mann1-5/+12
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-06-22convert to proto_tree_add_subtree[_format]Michael Mann1-8/+5
Change-Id: Ib60ca75b7da8cfa21cfe2999c9b9448a02c332df Reviewed-on: https://code.wireshark.org/review/2560 Tested-by: Michael Mann <mmann78@netscape.net> Reviewed-by: Michael Mann <mmann78@netscape.net>
2014-06-19Revert "Fixup: tvb_* -> tvb_captured"Michael Mann1-6/+6
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-6/+6
Change-Id: I9209c1271967405c34c1b6fa43e1726a4d3a5a3f Reviewed-on: https://code.wireshark.org/review/2377 Reviewed-by: Anders Broman <a.broman58@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-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>
2014-02-27Sherman, set the Wayback Machine for 1997.Guy Harris1-1/+1
The URLs for the CRC-10 code are dead; use Wayback Machine URLs. Change-Id: I3924e9cabb3b49b0e1abb31fbffa9b89f95cd0ce Reviewed-on: https://code.wireshark.org/review/419 Reviewed-by: Guy Harris <guy@alum.mit.edu>
2013-12-30Add an "ATM reassembly failed" flag for capture file readers to provide,Guy Harris1-58/+92
and set it in NetXRay/Windows Sniffer files if the putative "ATM reassembly failed" flag is set and, if reassembly failed, don't attempt to dissect the packet. svn path=/trunk/; revision=54503
2013-11-29Rename some of pint.h macros to match common style (bits number on the end).Jakub Zawadzki1-2/+2
pntohs -> pntoh16 pntohl -> pntoh32 pletohs -> pletoh16 pletohl -> pletoh32 phtons -> phton16 phtonl -> phton32 svn path=/trunk/; revision=53652
2013-11-09include <wsutil/pint.h> only when needed.Jakub Zawadzki1-0/+1
svn path=/trunk/; revision=53196
2013-10-26Don't use private_data for pwatm_private_data_t and instead pass it into the ↵Michael Mann1-32/+36
dissectors. svn path=/trunk/; revision=52877
2013-08-05Keep result of [new_]register_dissector in some dissectors. [2 of x]Jakub Zawadzki1-7/+5
(don't create new dissector handle if we can use already existing one) svn path=/trunk/; revision=51159
2013-06-19Fix display of "(correct)"/"(incorrect)" indication for the CRC.Guy Harris1-3/+3
svn path=/trunk/; revision=50058