aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-tr.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-tr.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-tr.c')
-rw-r--r--epan/dissectors/packet-tr.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/epan/dissectors/packet-tr.c b/epan/dissectors/packet-tr.c
index 3264304212..bebdfdfc3a 100644
--- a/epan/dissectors/packet-tr.c
+++ b/epan/dissectors/packet-tr.c
@@ -24,6 +24,7 @@
#include "config.h"
#include <epan/packet.h>
+#include <epan/capture_dissectors.h>
#include <epan/expert.h>
#include <epan/exceptions.h>
#include <epan/conversation_table.h>
@@ -246,7 +247,7 @@ static void
add_ring_bridge_pairs(int rcf_len, tvbuff_t*, proto_tree *tree);
void
-capture_tr(const guchar *pd, int offset, int len, packet_counts *ld) {
+capture_tr(const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) {
int source_routed = 0;
int frame_type;
@@ -365,7 +366,7 @@ capture_tr(const guchar *pd, int offset, int len, packet_counts *ld) {
ld->other++;
break;
case 1:
- capture_llc(pd, offset, len, ld);
+ capture_llc(pd, offset, len, ld, pseudo_header);
break;
default:
/* non-MAC, non-LLC, i.e., "Reserved" */
@@ -800,6 +801,7 @@ proto_register_tr(void)
&fix_linux_botches);
register_dissector("tr", dissect_tr, proto_tr);
+ register_capture_dissector(WTAP_ENCAP_TOKEN_RING, capture_tr, proto_tr);
tr_tap=register_tap("tr");
register_conversation_table(proto_tr, TRUE, tr_conversation_packet, tr_hostlist_packet);