Huge thanks to our Platinum Members Endace and LiveAction,
and our Silver Member Veeam, for supporting the Wireshark Foundation and project.

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

From: DbdM Tbt <spin.x2k@xxxxxxxxx>
Date: Tue, 13 Aug 2013 11:07:38 +0800
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