Ethereal-dev: Re: [Ethereal-dev] question regarding protocol dissector as plugin under etherea
Hi,
Yeah, I do see my plugin in the tools->plugin list. But unfortunatly I do
not see my plugged-in protocol in edit->protocols list where the list of all
registered protocols and plugins like "pcli" are present.
I went thru a few plugin codes like pcli, gryphon etc.. they all use
dissector_add("PARENT_SUBFIELD", ID_VALUE, xxx_subiss_handle); where
PARENT_SUBFIELD is usually "udp.port" or "tcp.port", ID_VALUE = i guess the
port # and then the handle..
in "void proto_reg_handoff_xxx_subiss(void) "
I did not get the use of this function.. what is it supposed to do and why
taking into account tcp, udp ports?
I have attached the code with this. Also I guess there is some problem in
the
"void proto_register_xxx_subiss(void)" routine. I'm never able to call:
static void dissect_xxx_subiss(tvbuff_t *tvb, packet_info *pinfo,
proto_tree *tree)
Any help, wut I'm doing wrong? I do not have preference menus. That's why I
did not register any prefrences. Anyway the basic problem is protocol
registration itself.
Thanks and Regards,
-Parul
----- Original Message -----
From: "Tomas Kukosa" <tomas.kukosa@xxxxxxxxxxx>
To: "Parul Singla" <parul@xxxxxxxxxxxxxx>
Cc: "Ethereal Development" <ethereal-dev@xxxxxxxxxxxx>
Sent: Sunday, October 05, 2003 10:32 PM
Subject: Re: [Ethereal-dev] question regarding protocol dissector as plugin
underethereal-0.9.15
> 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
Attachment:
packet-xxx-subiss.c
Description: Binary data