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-arp.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-arp.c')
-rw-r--r-- | epan/dissectors/packet-arp.c | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/epan/dissectors/packet-arp.c b/epan/dissectors/packet-arp.c index 15ab85bc67..9d352939d9 100644 --- a/epan/dissectors/packet-arp.c +++ b/epan/dissectors/packet-arp.c @@ -105,6 +105,8 @@ static dissector_handle_t arp_handle; static dissector_handle_t atmarp_handle; static dissector_handle_t ax25arp_handle; +static capture_dissector_handle_t arp_cap_handle; + /* Used for determining if frequency of ARP requests constitute a storm */ #define STORM 1 #define NO_STORM 2 @@ -2023,6 +2025,8 @@ proto_register_arp(void) register_init_routine(&arp_init_protocol); register_cleanup_routine(&arp_cleanup_protocol); + + arp_cap_handle = register_capture_dissector("arp", capture_arp, proto_arp); } void @@ -2035,8 +2039,8 @@ proto_reg_handoff_arp(void) dissector_add_uint("arcnet.protocol_id", ARCNET_PROTO_RARP_1201, arp_handle); dissector_add_uint("ax25.pid", AX25_P_ARP, arp_handle); dissector_add_uint("gre.proto", ETHERTYPE_ARP, arp_handle); - register_capture_dissector("ethertype", ETHERTYPE_ARP, capture_arp, proto_arp); - register_capture_dissector("ax25.pid", AX25_P_ARP, capture_arp, proto_arp); + capture_dissector_add_uint("ethertype", ETHERTYPE_ARP, arp_cap_handle); + capture_dissector_add_uint("ax25.pid", AX25_P_ARP, arp_cap_handle); } /* |