aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-atm.c
diff options
context:
space:
mode:
authorMichael Mann <mmann78@netscape.net>2015-12-12 23:38:21 -0500
committerMichael Mann <mmann78@netscape.net>2015-12-13 14:34:13 +0000
commit56aa05227f6bc18211d9ddec669af77ba5cd78e9 (patch)
treefa21cc83f52889681b3461e1f511521a6d43275d /epan/dissectors/packet-atm.c
parent23379ae3624df82c170f48e5bb3250a97ec61c13 (diff)
Create a way to register "capture" dissectors.
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>
Diffstat (limited to 'epan/dissectors/packet-atm.c')
-rw-r--r--epan/dissectors/packet-atm.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/epan/dissectors/packet-atm.c b/epan/dissectors/packet-atm.c
index d7793244b2..195c71a83e 100644
--- a/epan/dissectors/packet-atm.c
+++ b/epan/dissectors/packet-atm.c
@@ -23,6 +23,7 @@
#include "config.h"
#include <epan/packet.h>
+#include <epan/capture_dissectors.h>
#include <wsutil/pint.h>
#include <epan/oui.h>
#include <epan/addr_resolv.h>
@@ -672,13 +673,13 @@ capture_lane(const union wtap_pseudo_header *pseudo_header, const guchar *pd,
case TRAF_ST_LANE_802_3:
case TRAF_ST_LANE_802_3_MC:
/* Dissect as Ethernet */
- capture_eth(pd, 2, len, ld);
+ capture_eth(pd, 2, len, ld, pseudo_header);
break;
case TRAF_ST_LANE_802_5:
case TRAF_ST_LANE_802_5_MC:
/* Dissect as Token-Ring */
- capture_tr(pd, 2, len, ld);
+ capture_tr(pd, 2, len, ld, pseudo_header);
break;
default:
@@ -804,9 +805,9 @@ static const value_string ipsilon_type_vals[] = {
{ 0, NULL }
};
-void
-capture_atm(const union wtap_pseudo_header *pseudo_header, const guchar *pd,
- int len, packet_counts *ld)
+static void
+capture_atm(const guchar *pd, int offset _U_,
+ int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header)
{
if (pseudo_header->atm.aal == AAL_5) {
switch (pseudo_header->atm.type) {
@@ -815,7 +816,7 @@ capture_atm(const union wtap_pseudo_header *pseudo_header, const guchar *pd,
/* Dissect as WTAP_ENCAP_ATM_RFC1483 */
/* The ATM iptrace capture that we have shows LLC at this point,
* so that's what I'm calling */
- capture_llc(pd, 0, len, ld);
+ capture_llc(pd, 0, len, ld, pseudo_header);
break;
case TRAF_LANE:
@@ -2007,6 +2008,8 @@ proto_register_atm(void)
register_dissector("atm_oam_cell", dissect_atm_oam_cell, proto_oamaal);
register_dissector("atm_pw_oam_cell", dissect_atm_pw_oam_cell, proto_oamaal);
+ register_capture_dissector(WTAP_ENCAP_ATM_PDUS, capture_atm, proto_atm);
+
atm_module = prefs_register_protocol ( proto_atm, NULL );
prefs_register_bool_preference(atm_module, "dissect_lane_as_sscop", "Dissect LANE as SSCOP",
"Autodection between LANE and SSCOP is hard. As default LANE is preferred",