aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ipfc.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-ipfc.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-ipfc.c')
-rw-r--r--epan/dissectors/packet-ipfc.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/epan/dissectors/packet-ipfc.c b/epan/dissectors/packet-ipfc.c
index 5c885e61a5..b7b4f16c6d 100644
--- a/epan/dissectors/packet-ipfc.c
+++ b/epan/dissectors/packet-ipfc.c
@@ -27,10 +27,10 @@
#include "config.h"
#include <epan/packet.h>
+#include <epan/capture_dissectors.h>
#include <wiretap/wtap.h>
#include <epan/to_str.h>
-#include "packet-ipfc.h"
#include "packet-llc.h"
void proto_register_ipfc(void);
@@ -45,15 +45,15 @@ static int hf_ipfc_network_sa = -1;
static gint ett_ipfc = -1;
static dissector_handle_t llc_handle;
-void
-capture_ipfc (const guchar *pd, int len, packet_counts *ld)
+static void
+capture_ipfc (const guchar *pd, int offset _U_, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_)
{
if (!BYTES_ARE_IN_FRAME(0, len, 16)) {
ld->other++;
return;
}
- capture_llc(pd, 16, len, ld);
+ capture_llc(pd, 16, len, ld, pseudo_header);
}
static int
@@ -114,6 +114,8 @@ proto_register_ipfc (void)
/* Required function calls to register the header fields and subtrees used */
proto_register_field_array(proto_ipfc, hf, array_length(hf));
proto_register_subtree_array(ett, array_length(ett));
+
+ register_capture_dissector(WTAP_ENCAP_IP_OVER_FC, capture_ipfc, proto_ipfc);
}
/* If this dissector uses sub-dissector registration add a registration routine.