diff options
author | João Valverde <joao.valverde@tecnico.ulisboa.pt> | 2016-10-26 17:07:47 +0100 |
---|---|---|
committer | Michael Mann <mmann78@netscape.net> | 2016-10-28 17:39:04 +0000 |
commit | d47551982b343664cafa3ddfa3b3bb960ed9f34a (patch) | |
tree | 8c88e54355d399d3b43a57098c3ad76276cd5112 /epan/dissectors/packet-isl.c | |
parent | 01147f8369e76927d7a90cfa0b592457a1878839 (diff) |
Implement registration of capture dissectors by name
Mirror it after protocol dissector API.
Change-Id: I7985bcfa9e07654c7cf005efec94efc205d7a304
Reviewed-on: https://code.wireshark.org/review/18496
Reviewed-by: Michael Mann <mmann78@netscape.net>
Diffstat (limited to 'epan/dissectors/packet-isl.c')
-rw-r--r-- | epan/dissectors/packet-isl.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/epan/dissectors/packet-isl.c b/epan/dissectors/packet-isl.c index ecddd03cb0..068bc45e5d 100644 --- a/epan/dissectors/packet-isl.c +++ b/epan/dissectors/packet-isl.c @@ -25,6 +25,7 @@ #include <epan/packet.h> #include <epan/exceptions.h> #include <epan/show_exception.h> +#include <epan/capture_dissectors.h> #include "packet-isl.h" #include "packet-eth.h" @@ -87,6 +88,9 @@ static gint ett_isl_dst = -1; static dissector_handle_t eth_withfcs_handle; static dissector_handle_t tr_handle; +static capture_dissector_handle_t eth_cap_handle; +static capture_dissector_handle_t tr_cap_handle; + gboolean capture_isl(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo, const union wtap_pseudo_header *pseudo_header _U_) { @@ -101,11 +105,11 @@ capture_isl(const guchar *pd, int offset, int len, capture_packet_info_t *cpinfo case TYPE_ETHER: offset += 14+12; /* skip the header */ - return capture_eth(pd, offset, len, cpinfo, pseudo_header); + return call_capture_dissector(eth_cap_handle, pd, offset, len, cpinfo, pseudo_header); case TYPE_TR: offset += 14+17; /* skip the header */ - return capture_tr(pd, offset, len, cpinfo, pseudo_header); + return call_capture_dissector(tr_cap_handle, pd, offset, len, cpinfo, pseudo_header); break; } @@ -400,6 +404,8 @@ proto_register_isl(void) proto_isl = proto_register_protocol("Cisco ISL", "ISL", "isl"); proto_register_field_array(proto_isl, hf, array_length(hf)); proto_register_subtree_array(ett, array_length(ett)); + + register_capture_dissector("isl", capture_isl, proto_isl); } void @@ -410,6 +416,9 @@ proto_reg_handoff_isl(void) */ eth_withfcs_handle = find_dissector_add_dependency("eth_withfcs", proto_isl); tr_handle = find_dissector_add_dependency("tr", proto_isl); + + eth_cap_handle = find_capture_dissector("eth"); + tr_cap_handle = find_capture_dissector("tr"); } /* |