Wireshark-dev: Re: [Wireshark-dev] Dissectors
From: "Nandakumar Muthuraj" <nandam@xxxxxxxxxx>
Date: Fri, 25 May 2007 11:27:45 -0400
Jaap,

Yeah the handle coould be used some where else

void
proto_reg_handoff_atm(void)
{
        dissector_handle_t atm_handle, atm_untruncated_handle;

        /*
         * Get handles for the Ethernet, Token Ring, Frame Relay, LLC,
         * SSCOP, LANE, and ILMI dissectors.
         */
        eth_withoutfcs_handle = find_dissector("eth_withoutfcs");
        tr_handle = find_dissector("tr");
        fr_handle = find_dissector("fr");
        llc_handle = find_dissector("llc");
        sscop_handle = find_dissector("sscop");
        lane_handle = find_dissector("lane");
        ilmi_handle = find_dissector("ilmi");
        data_handle = find_dissector("data");
        fp_handle = find_dissector("fp");

        atm_handle = create_dissector_handle(dissect_atm, proto_atm);
        dissector_add("wtap_encap", WTAP_ENCAP_ATM_PDUS, atm_handle);

        atm_untruncated_handle =
create_dissector_handle(dissect_atm_untruncated,
            proto_atm);
        dissector_add("wtap_encap", WTAP_ENCAP_ATM_PDUS_UNTRUNCATED,
            atm_untruncated_handle);
}

But lets say if I don't use those dissector handle right away, I need
not find them immediately .
For instance 'fr_handle'in the atm reg . I believe it is just for the
future use and not MANDATORY this point of code.Am I right.
You see I am in the process of registering my first dissector,hnce the
stumble :)


Thanks for pointing, made a silly mistake, I've removed and changed the
password :)

Nanda.

 

-----Original Message-----
From: wireshark-dev-bounces@xxxxxxxxxxxxx
[mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Jaap Keuter
Sent: Friday, May 25, 2007 11:06 AM
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] Dissectors

Hi,

For one the eth_handle is most likely a module global variable, so used
elsewhere. Could you name the dissector you saw this in?

The other thing to notice is that it is not very smart to quote your
registration info, including password, in a public mailing list.....
Better change is REAL SOON NOW.

Thanx,
Jaap

On Fri, 25 May 2007, Nandakumar Muthuraj wrote:

>
> Team,
>
> I am a newbie to the wireshark development.
>
> The code snippets for the registering a handoff for a protocol say XXX
>
> I see the following lines
>
>    void proto_reg_handoff_XXX(void)
> {
>  find_dissector("data");
>  find_dissector("ip");
>  eth_handle = find_dissector("eth");
> /* I don't see the eth _handle used anywhere here */
>
> }
>
> Why is the find_dissectors called witout using the hadles further in 
> the code.
> This is similar code in may hand-off reg functions.
> Am I Missing some thing obvious or is there a catch in way 
> find_dissectors work ?
>
>
> Regards,
> Nanda.
>
>