Wireshark-dev: [Wireshark-dev] How to connect dissector to wiretap plugin
From: Giedrius Zavadskis <giedrzav@xxxxxxxxx>
Date: Thu, 5 Nov 2009 13:32:33 -0600

Hello everyone,

I have tried to create Wiretap plugin as outlined in wireshark wiki (http://wiki.wireshark.org/wiretap%20plugin). The plugin seems to load file into Wireshark properly, however i cannot figure out how to forward data further to dissector.

Wireshark wiki give example as how to handoff wtap to dissector:
void proto_reg_handoff_myDissector(void)
{
gboolean init = FALSE;

if (init == FALSE)
{
dissector_handle_t myDissector_handle;

myDissector_handle = find_dissector("myDissector");

dissector_add("wtap_encap", encap_myFileType, myDissector_handle);

init = TRUE;
}
}
It is unclear to me on how to get encap_myFileType value within dissector that has been registered in wiretap plugin with a function wtap_register_encap_type() ?

Thanks for the help,
Giedrius Zavadskis