From 56aa05227f6bc18211d9ddec669af77ba5cd78e9 Mon Sep 17 00:00:00 2001 From: Michael Mann Date: Sat, 12 Dec 2015 23:38:21 -0500 Subject: 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 Tested-by: Petri Dish Buildbot Reviewed-by: Michael Mann --- epan/dissectors/packet-ax25.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'epan/dissectors/packet-ax25.c') diff --git a/epan/dissectors/packet-ax25.c b/epan/dissectors/packet-ax25.c index d29203dcfb..cb6512dc55 100644 --- a/epan/dissectors/packet-ax25.c +++ b/epan/dissectors/packet-ax25.c @@ -45,6 +45,7 @@ #include "config.h" #include +#include #include #include #include @@ -254,7 +255,7 @@ dissect_ax25( tvbuff_t *tvb, packet_info *pinfo, proto_tree *parent_tree, void* } void -capture_ax25( const guchar *pd, int offset, int len, packet_counts *ld) +capture_ax25( const guchar *pd, int offset, int len, packet_counts *ld, const union wtap_pseudo_header *pseudo_header _U_) { guint8 control; guint8 pid; @@ -426,6 +427,8 @@ proto_register_ax25(void) proto_register_field_array( proto_ax25, hf, array_length(hf ) ); proto_register_subtree_array(ett, array_length(ett ) ); + register_capture_dissector(WTAP_ENCAP_AX25, capture_ax25, proto_ax25); + /* Register dissector table for protocol IDs */ ax25_dissector_table = register_dissector_table("ax25.pid", "AX.25 protocol ID", FT_UINT8, BASE_HEX, DISSECTOR_TABLE_NOT_ALLOW_DUPLICATE); } -- cgit v1.2.3