aboutsummaryrefslogtreecommitdiffstats
path: root/epan/dissectors/packet-ieee80211-prism.c
diff options
context:
space:
mode:
authorJoão Valverde <joao.valverde@tecnico.ulisboa.pt>2016-10-26 17:07:47 +0100
committerMichael Mann <mmann78@netscape.net>2016-10-28 17:39:04 +0000
commitd47551982b343664cafa3ddfa3b3bb960ed9f34a (patch)
tree8c88e54355d399d3b43a57098c3ad76276cd5112 /epan/dissectors/packet-ieee80211-prism.c
parent01147f8369e76927d7a90cfa0b592457a1878839 (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-ieee80211-prism.c')
-rw-r--r--epan/dissectors/packet-ieee80211-prism.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/epan/dissectors/packet-ieee80211-prism.c b/epan/dissectors/packet-ieee80211-prism.c
index 0cc9f01f17..cd42e877d7 100644
--- a/epan/dissectors/packet-ieee80211-prism.c
+++ b/epan/dissectors/packet-ieee80211-prism.c
@@ -39,6 +39,9 @@ static dissector_handle_t wlancap_handle;
static dissector_handle_t ieee80211_handle;
static dissector_handle_t ieee80211_radio_handle;
+static capture_dissector_handle_t ieee80211_cap_handle;
+static capture_dissector_handle_t wlancap_cap_handle;
+
static int proto_prism = -1;
/* Prism radio header */
@@ -251,7 +254,7 @@ capture_prism(const guchar *pd, int offset, int len, capture_packet_info_t *cpin
cookie = pntoh32(pd);
if ((cookie == WLANCAP_MAGIC_COOKIE_V1) ||
(cookie == WLANCAP_MAGIC_COOKIE_V2)) {
- return capture_wlancap(pd, offset, len, cpinfo, pseudo_header);
+ return call_capture_dissector(wlancap_cap_handle, pd, offset, len, cpinfo, pseudo_header);
}
/* Prism header */
@@ -261,7 +264,7 @@ capture_prism(const guchar *pd, int offset, int len, capture_packet_info_t *cpin
offset += PRISM_HEADER_LENGTH;
/* 802.11 header follows */
- return capture_ieee80211(pd, offset, len, cpinfo, pseudo_header);
+ return call_capture_dissector(ieee80211_cap_handle, pd, offset, len, cpinfo, pseudo_header);
}
static int
@@ -561,12 +564,18 @@ void proto_register_ieee80211_prism(void)
void proto_reg_handoff_ieee80211_prism(void)
{
+ capture_dissector_handle_t ieee80211_prism_cap_handle;
+
dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_PRISM, prism_handle);
ieee80211_handle = find_dissector_add_dependency("wlan", proto_prism);
ieee80211_radio_handle = find_dissector_add_dependency("wlan_radio", proto_prism);
wlancap_handle = find_dissector_add_dependency("wlancap", proto_prism);
- register_capture_dissector("wtap_encap", WTAP_ENCAP_IEEE_802_11_PRISM, capture_prism, proto_prism);
+ ieee80211_prism_cap_handle = create_capture_dissector_handle(capture_prism, proto_prism);
+ capture_dissector_add_uint("wtap_encap", WTAP_ENCAP_IEEE_802_11_PRISM, ieee80211_prism_cap_handle);
+
+ ieee80211_cap_handle = find_capture_dissector("ieee80211");
+ wlancap_cap_handle = find_capture_dissector("wlancap");
}
/*