Wireshark-dev: Re: [Wireshark-dev] etype_vals[] compile error when adding newEthernetdissector
From: "Anders Broman" <anders.broman@xxxxxxxxxxxx>
Date: Wed, 25 Feb 2009 10:14:17 +0100
Hi,
I think there is a problem using imported value_strings in plugins...
Regards
Anders


From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of Maynard, Chris
Sent: den 25 februari 2009 07:19
To: Developer support list for Wireshark
Subject: Re: [Wireshark-dev] etype_vals[] compile error when adding newEthernetdissector

etype_vals is of type value_string.  Try including “epan/value_string.h” or “epan/packet.h” before including etypes.h.

 

- Chris

 

 

From: wireshark-dev-bounces@xxxxxxxxxxxxx [mailto:wireshark-dev-bounces@xxxxxxxxxxxxx] On Behalf Of patrick_horgan@xxxxxxxxxxx
Sent: Wednesday, February 25, 2009 12:24 AM
To: wireshark-dev@xxxxxxxxxxxxx
Subject: [Wireshark-dev] etype_vals[] compile error when adding new Ethernetdissector

 

Hi,

 

I’m developing a new Ethernet dissector (as a plugin), but I’m stuck with a compiler error when I #include <epan/etypes.h>:

 

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C2061: syntax error : identifier 'etype_vals'

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C2059: syntax error : ';'

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C3409: empty attribute block is not allowed

C:\wireshark\wireshark-1.0.5\epan/etypes.h(410) : error C2059: syntax error : ';'

 

Interestingly, this problem is predicted in the developer README:

“Don't use forward declarations of static arrays without a specified size … as some compilers will reject the first of those statements.”

 

I need etypes.h for my new Ethertype, and to call the ethertype() function for handing off to the next dissector. I’m reluctant to change established code in etypes.h and packet-ethertype.c because changes would surely affect other dissectors.

 

Has anyone else experienced this error, or can anyone think of a solution to this compilation problem?

 

Kind regards,
Pat

 

-----------------------------------------

Patrick Horgan,

Software Developer,

Agilent DNPL Melbourne

-----------------------------------------

 

CONFIDENTIALITY NOTICE: The contents of this email are confidential
and for the exclusive use of the intended recipient. If you receive this
email in error, please delete it from your system immediately and 
notify us either by email, telephone or fax. You should not copy,
forward, or otherwise disclose the content of the email.