Wireshark-dev: Re: [Wireshark-dev] [msvc] 'etype_vals' : unknown size

From: DbdM Tbt <spin.x2k@xxxxxxxxx>
Date: Tue, 13 Aug 2013 13:49:15 +0800
Hello Mr. Anders,
Thank you for the reply.
I just realized something and I would like to ask. Is this the right forum/list to ask such questions?
Because the dissector I am currently making is for 'internal use' so it is not meant to be included into the standard wireshark.
I was just hoping someone might have an idea how to work around the error etype_vals error without modifying core wireshark sources.
Thank you again,
David



On Tue, Aug 13, 2013 at 1:38 PM, Anders Broman <a.broman@xxxxxxxxxxxx> wrote:
DbdM Tbt skrev 2013-08-13 07:11:

Hi,
From below I take it your dissector is written in C++, we are not prepared to accept dissectors in C++ currently
so your dissector will not make it into the standard Wireshark.
Regards
Anders
Hello all,
I made a lousy mistake earlier and I should have realized it sooner. So sorry.
The modification #define I posted earlier is wrong. _WIN32 affects everything and based on my looking around the makefile, I found a /TP compile option.
I think this is a more 'correct' (?) mod so that it will be a 1-time/step compile:
#if !defined(__cplusplus)
WS_DLL_PUBLIC const value_string etype_vals[];
#else
WS_DLL_PUBLIC const value_string *etype_vals;
#endif

But still I am modifying epan/etypes.h.

To Mr. Anders,
Thank you for the link.
I will check on how to use it to my current development but let's just say that I don't have the 'authority' to abandon the dissector I have right now.

Thank you,
David




On Tue, Aug 13, 2013 at 12:17 PM, Anders Broman <a.broman@xxxxxxxxxxxx> wrote:
Hi,
Nothing to do with your problem but there is also a openflow dissector being developed in trunk
http://anonsvn.wireshark.org/viewvc/trunk/epan/dissectors/packet-openflow.c?revision=50623&view=markup
written in C. It would be better to pool resources and work on that one.
Regards
Anders

DbdM Tbt skrev 2013-08-13 06:10:
Hello again,
I forgot to add that this 'hack' requires wireshark to be compiled in two steps (if ever compilation is done from scratch or after distclean).
The first step is to 'make all' without the modification to etype_vals and without the openflow plugin.
Then the second step is to plug in the openflow dissector and modify etype_vals and make again.
Clearly something is not right with this picture.
Hopefully this additional info clears some things.
Thanks.


On Tue, Aug 13, 2013 at 11:07 AM, DbdM Tbt <spin.x2k@xxxxxxxxx> wrote:
Hello and good day.
My name is David and this is my first post in the list.
I am currently studying how to develop a dissector and currently building on top of an existing one.
The base I am using is an openflow dissector found here:
http://www.openflow.org/wp/downloads/#dissector
Created by Mr. David Underhill.

Before proceeding, I would like to say that where possible, I try to strictly follow the developers guide:
www.wireshark.org/docs/wsdg_html_chunked/ChSetupWin32.html
I think the only difference in my case is that I am using MS Visual Studio 2010 instead of the Express edition.

My environment is now this:
[OS] WindowsXP Professional SP3 32bit
[Compiler] Microsoft (R) 32-bit C/C++ Optimizing Compiler Version 16.00.40219.01 for 80x86
   Copyright (C) Microsoft Corporation.  All rights reserved.
[Wireshark Base] ver: 1.10.1
   url: http://www.wireshark.org/download/src/wireshark-1.10.1.tar.bz2

Setup and compilation is ok with the wireshark sources as is.

But when I include the openflow dissector, I get this error (among others):
C:\wireshark-1.10.1\epan/etypes.h(541) : error C2133: 'etype_vals' : unknown size

I tried to work around this error by modifying epan/etypes.h like this:
+ #ifdef _WIN32
+ WS_DLL_PUBLIC const value_string *etype_vals;
+ #else
  WS_DLL_PUBLIC const value_string etype_vals[];
+ #endif

After modifying this and working around other compile errors (not part of the topic), I have successfully built the plugin and wireshark.

I am a beginner in developing for windows as my experience is mostly in linux environments (GNU).

So I would like to ask for the opinions on the developers in this list if what I did was safe.
Is there a more 'correct' modification?
Is there a way around this error without modifying any wireshark codes?

Thank you very much,
David




___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe



___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe


___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev@xxxxxxxxxxxxx>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request@xxxxxxxxxxxxx?subject=unsubscribe