Ethereal-dev: Re: [Ethereal-dev] question regarding protocol dissector as plugin underetherea

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: Tomas Kukosa <tomas.kukosa@xxxxxxxxxxx>
Date: Mon, 06 Oct 2003 07:32:55 +0200
Parul Singla wrote:
> 
> Hi guys,
>  I'm writing a plugin to dissect a frame. One frame consists of:
>     our proprietary frame, followed by 802.11 frame
> 
> The plugin is for dissection of the proprietary frame.
> 
> 1. I wrote proto_register_xxx() routine. It does not have any header, field
> registration as of now. So this function just calls
> proto_register_protocol(.....). The problem is when I run ethereal after
> compilation and make, I do not see my protocol under Edit->protocols menu
> where the list of all registered protocols are present, including the
> plugin's like "pcli".

First check if you can see your plugin in the Tools->Plugins... list.

> Readme.developer says that the file containing a dissector's "register"
> routine must be added to "DISSECTOR_SOURCES" in Makefile.am" , but this is
> true if its not a plugin. I have the file containing "register" routine
> defined under "plugin_src" in ethereal-0.9.15/Makefile.am, since mine is a
> plugin.

Yes. You are right.

> 
> 2. How do I call 802.11 frame dissector routines after dissection of our
> proprietary frame?

Try:

static dissector_handle_t ieee80211_handle; 

static void 
dissect_yourproto(...){
...
  next_tvb = tvb_new_subset(tvb, offset, len, rep_len);
  call_dissector(ieee80211_handle, next_tvb, pinfo, tree); 
...
}

void proto_reg_handoff_yourproto(void) { 
...
  ieee80211_handle = find_dissector("wlan");
  /* look into packet-ieee80211.c which dissector you need ("wlan",
"wlan_fixed", "wlan_bsfc")*/
}

> Any help is appreciated.
> 
> Thanks and Regards,
> -Parul

 Regards,
  Tom