This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Updating custom dissector from 1.6 wireshark to 2.2 wireshark

0

Hi, I'll be honest, I'm completely lost here. I was asked to update an existing dissector built with VS2008 using nmake (wireshark v.1.6.10). I want to rebuild it using VS2013. I've followed the developers guide and verified that my build environment works by building wireshark 2.2 using cmake. But when I try to build using msbuild, I get the following output...

 ) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(525): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(526): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(527): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(528): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(531): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(534): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(535): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(536): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(538): error C2057: expected constant expression (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(538): error C2085: 'field_display_e' : not in formal parameter list (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(562): error C2085: 'hf_ref_type': not in formal parameter list (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(565): error C2085: 'header_field_info' : not in formal parameter list (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(584): error C2061: syntax error: identifier 'hf_ref_type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(586): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(587): error C2059: syntax error: '}' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(606): error C2061: syntax error: identifier 'header_field_info' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(607): error C2059: syntax error: '}' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(620): error C2016: C requires that a struct or union has at least one member (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(620): error C2061: syntax error: identifier 'header_field_info' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(630): error C2059: syntax error: '}' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(708): error C2061: syntax error: identifier 'field_info' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(710): error C2059: syntax error: '}' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(713): error C2061: syntax error: identifier 'proto_tree' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(713): error C2059: syntax error: ';' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(715): error C2061: syntax error: identifier 'proto_item' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(715): error C2059: syntax error: ';' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(810): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(810): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(810): error C2059: syntax error: ',' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(810): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(811): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(811): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(811): error C2059: syntax error: ',' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(811): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(813): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(813): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(814): error C2146: syntax error: missing ';' before identifier 'func' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(814): error C2059: syntax error: 'type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(814): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(816): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(816): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(817): error C2146: syntax error: missing ';' before identifier 'func' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(817): error C2059: syntax error: 'type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(817): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(862): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(862): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(862): error C2059: syntax error: 'type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(862): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(868): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(868): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(868): error C2370: 'gint' : redefinition; different storage class (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(868): error C2146: syntax error: missing ';' before identifier 'idx' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(868): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(873): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(873): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(873): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(878): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(878): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(878): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(884): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(884): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(884): error C2059: syntax error: 'type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(884): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(890): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(890): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(890): error C2059: syntax error: 'type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(890): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(897): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(897): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(897): error C2059: syntax error: 'type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(897): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(904): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(904): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(904): error C2059: syntax error: 'type' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(904): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(910): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(910): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(910): error C2370: 'gint' : redefinition; different storage class (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(910): error C2146: syntax error: missing ';' before identifier 'length' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(910): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(922): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(922): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(922): error C2371: 'tvbuff_t' :redefinition; different basic types (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(922): error C2143: syntax error: missing ';' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(922): error C2370: 'gint' : redefinition; different storage class (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(922): error C2146: syntax error: missing ';' before identifier 'end' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(922): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(928): error C2143: syntax error: missing ')' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(928): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(928): error C2059: syntax error: ')' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(934): error C2143: syntax error: missing '{' before '*' (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]
c:\development\wireshark\epan\proto.h(934): fatal error C1003: error count exceeds 100; stopping compilation (C:\Development\wireshark\plugins\incjet\packet-incjet.c) [C:\Development\wsbuild32\plugins\incjet\incjet.vcxproj]

2 Warning(s) 103 Error(s)

Time Elapsed 00:02:23.55

Any ideas what’s going on? I can provide my dissector code if needed.

Thanks,

Ahmed Awale

asked 25 Jan ‘17, 13:32

aawale15's gravatar image

aawale15
6114
accept rate: 0%

edited 31 Mar ‘17, 09:54

1

Have you made code changes to the old dissector code to make it compatible with the wireshark fucntions of v2.2?

(26 Jan ‘17, 22:50) koundi
1

One changes is that

#include "config.h"

Should be unconditionally included, see other plugins.

(27 Jan ‘17, 01:18) Anders ♦

Yes, I’ve included config.h in my plugin source. And I have made code chagnes…I used the gyrphon source as a reference and my plugin follows the same format. I’ve looked through README.plugins as well, and followed the “Update old style plugins” section.

Could I send over my code to either of you via email, git, etc…Anders or koundi? I’m really lost and my predecessor didn’t leave much behind to help.

Thanks for your help in advance!

  • Ahmed Awale
(27 Jan '17, 08:36) aawale15

Is there a document available that highlights differences in API between each wireshark release (or when a change was made)?

(01 Feb '17, 15:06) aawale15
1

No not really. You could try to find the commit that introduced or removed the API and see what changes were done.

(01 Feb '17, 21:01) Anders ♦
1

@aawale Is your code not proprietary. In general, when I hear a custom plugin I think of it as some kind of proprietary dissector. If that is not the case I don't mind helping you.

But as Anders already said, the best thing you can start rectifying the compiler errors for Wireshark functions one by one, you can check other dissectors in 1.6 that use the same API and compare it to the same dissector in 2.2 . That should give you some idea where to start!

(01 Feb '17, 22:55) koundi

That's a great point koundi...the plugin does dissector our protocol which I know is proprietary. I will run that by the VP of our company.

Do you think it's easier to take an existing dissector in 2.2 and try to modify that dissector with our protocol. or should I stick with the approach of updating our 1.6 dissector to build with 2.2???

(02 Feb '17, 07:52) aawale15

@aawale I think you misunderstood what I said. I meant if your proprietary dissector uses some function call in 1.6 that isn't supported in 2.2 then you should see other protocol dissectors that use the same function and compare that dissector with its 2.2 version which will give you some idea what changes are to be made.

Ofcourse that will just give you a place to start ideally, you should be looking for all the code changes in the commit that changed the function in the dissector code.

(03 Feb '17, 00:27) koundi

Can you show us the first lines of your plugin, the include section?

One way of finding out what is wrong would be to just compile a stub dissector eg reduce your dissectr to the pare minimum and make that compile and then add back the code piece by piece until the first breacage and then figure out what is wrong with that piece. BTW what is at line 525 in your version of proto.h?

(03 Feb '17, 07:02) Anders ♦

I was able to make some progress guys. Now I am seeing no errors but 1 warning...

warning C4133: 'function' : incompatible types - from 'void (__cdecl *)(tvbuff_t *,packet_info *,proto_tree *,gboolean)' to 'dissector_t'

Any ideas?

(13 Feb '17, 07:58) aawale15

This is the typedef in 1.6:

typedef void (dissector_t)(tvbuff_t , packet_info , proto_tree );

while this is the one in 2.2:

typedef int (dissector_t)(tvbuff_t , packet_info , proto_tree , void *);
So I think this has to do with dissector registration.
(13 Feb '17, 08:15) Jaap ♦

Hey, guys.I wanted to pick up where I left off. I should have compiled Wireshark and verified that it runs before hacking the Wireshark sources for my project. I am now seeing the following errors after following Wireshark's Win32/64: Step-by-Step Guide. Any ideas? (see comment below)

(29 Mar '17, 08:44) aawale15

Build FAILED. "C:\Development\wsbuild32\Wireshark.sln" (default target) (1) -> "C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj.metaproj" ( default target) (19) -> "C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj" (default target) (92) -> (ClCompile target) -> C:\Development\wireshark\epan\dissectors\packet-ipv6.c(2093): error C2 275: 'guint16' : illegal use of this type as an expression [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-ipv6.c(2093): error C2 146: syntax error : missing ';' before identifier 'mapped_port' [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-ipv6.c(2093): error C2 065: 'mapped_port' : undeclared identifier [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-ipv6.c(2104): error C2065: 'mapped_port' : undeclared identifier [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-usb-i1d3.c(434): error C2275: 'guint32' : illegal use of this type as an expression [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-usb-i1d3.c(434): errorC2146: syntax error : missing ';' before identifier 'response_code' [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-usb-i1d3.c(434): errorC2065: 'response_code' : undeclared identifier [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-usb-i1d3.c(436): errorC2065: 'response_code' : undeclared identifier [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-usb-i1d3.c(438): errorC2065: 'response_code' : undeclared identifier [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-usb-i1d3.c(439): errorC2065: 'response_code' : undeclared identifier [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj] C:\Development\wireshark\epan\dissectors\packet-usb-i1d3.c(442): errorC2065: 'response_code' : undeclared identifier [C:\Development\wsbuild32\epan\dissectors\dissectors.vcxproj]

0 Warning(s)
11 Error(s)

Time Elapsed 00:05:55.48

(29 Mar '17, 08:44) aawale15

This is a better approach, first get a functioning build system, then modify that.

Can you post the output of your CMake generation step please, e.g.

cmake ... > cmake.txt

I want to see the contents of cmake.txt

(29 Mar '17, 09:14) grahamb ♦

My CMakeOutput.txt?? located in C:\Development\wsbuild32\CMakeFiles

That file is well over 2500 characters...can't fit in a comment.

(29 Mar '17, 11:31) aawale15

Add it as an "answer" and I'll convert it to a comment.

(29 Mar '17, 11:38) grahamb ♦

cmake.txt: https://drive.google.com/open?id=0B-_XzBvJXAX3S3RfTUdOMl9SRTQ

Take a look at link above grahamb. That should be what you're looking for. Thanks!

(29 Mar '17, 12:51) aawale15
showing 5 of 17 show 12 more comments

One Answer:

0

You're missing the Qt install:

-- The following OPTIONAL packages have not been found:
...    
 * Qt5Core
 * Qt5LinguistTools
 * Qt5Multimedia
 * Qt5PrintSupport
 * Qt5Svg
 * Qt5Widgets
 * Qt5WinExtras

Not sure why that isn't a CMake error. Anyway, install Qt as per the Developers Guide sect 2.2.4. As you've missed at least one step, please thoroughly recheck all the other steps.

answered 29 Mar '17, 15:21

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

I've thoroughly rechecked all step, and Qt was installed as well. I installed Qt5.8 w/ VS2013.

Take a look at this link: https://bugreports.qt.io/browse/QTBUG-58345

There may be issues using cmake w/ Qt5.8?? I followed a comment on that webpage from someone who was seeing a similar problem and seemed to fix my cmake Qt error.

Here's an updated cmake.txt: https://docs.google.com/document/d/1wP2WuvQ1mtUW5xgyBCsTGjkwJEMV9F-TRQXYRzFzG90/edit?usp=sharing

And here's my msbuild log: https://drive.google.com/file/d/0B-_XzBvJXAX3bWk1ZmdmR05NbUE/view?usp=sharing

Still seeing the same 11 errors? Any ideas?

(30 Mar '17, 10:52) aawale15

The 2.2.x builds use Qt 5.6, unfortunately this isn't currently spelt out in the Developers Guide, you can download the 5.6 version from here. Attempting to build with Qt 5.8 is not recommended.

You current issues seem to be the code missing some definitions which is very odd. We'll see what happens when you switch to Qt 5.6. Remember to delete CMakeCache.txt or your entire build directory when you've installed the newer version and adjusted QT5_BASE_DIR to suit.

(31 Mar '17, 02:28) grahamb ♦

For general info, you can also see the cmake generation and build step outputs for 2.2 on our buildbots here to compare the output.

(31 Mar '17, 02:45) grahamb ♦

Thanks for continuing to help @grahamb

I uninstalled Qt5.8, wiped my build directory, installed Qt5.6 and adjusted my Qt variable and ran cmake and msbuild again. I'm still seeing the same output...can't seem to find those definitions in glibconfig.h

I followed the development guide step by step very closely, not sure where to go from here. Might hack the code to include that header file where needed.

(31 Mar '17, 09:50) aawale15

The header file that defines guint16 is C:\Development\wireshark-win32-libs\gtk2\lib\glib-2.0\include\glibconfig.h.

Looking at your msbuild output, the directory containing that file is in the include search path /I"C:\Development\wireshark-win32-libs\gtk2\lib\glib-2.0\include", so do you have that file?

Try opening the solution in Visual Studio, opening the file packet-ipv6.c, going to line 2093 then right click on guint16 and select "Peek Definition". That should show the definition in glibconfig.h. If this works, try to build in Visual Studio from the menu Build -> Rebuild Solution.

(01 Apr '17, 04:00) grahamb ♦

glibconfig.h is in the path you specified, and when peeking guint16 definition in packet-ipv6.c, visual studio does open glibconfig.h and highlight where guint16 was defined. I tried this last week, but haven't figured out why I still get this error.

I'm also seeing 100s of errors when rebuilding in VS2013 compared to only 11 when building using msbuild.

(03 Apr '17, 07:45) aawale15

I can only think there's something odd about your build environment and unfortunately I can't figure it out.

I can't offer much more here than to suggest that you create a Wireshark build VM using the VM technology of your choice, I use VirtualBox. This allows me to control my build environment and only install the items needed for Wireshark work and keeps all the other stuff on my desktop away from interfering with the Wireshark build.

(03 Apr '17, 08:17) grahamb ♦

I'm working through a VM also...using VMWare (company paid for it, I would have went with VirtualBox too) running Windows 7. Would you take a look at my build environment yourself, or is that too much to ask?

Either way, thank you for your help grahamb. I really appreciate it, and I will continue to troubleshoot until I find a solution. May even start over if I don't get anywhere today.

(03 Apr '17, 08:24) aawale15

If you have a build VM, then the path should be relatively clean. Can you post the contents of your PATH variable?

echo %PATH% > path.txt
(03 Apr '17, 08:37) grahamb ♦
(03 Apr '17, 09:13) aawale15
1

The path looks fine.

Unfortunately I'm stuck now, I can't see why this isn't working for you.

The msbuild output shows the correct include directory and the correct file is in there and Visual Studio can find the definition.

Note that to build with VS you must start it from the command prompt you run msbuild from so that it picks up the same environment variables. I do this by simply typing wireshark.sln.

(04 Apr '17, 14:56) grahamb ♦

@grahamb, I rebuilt my VM and was able to build and launch wireshark no problem...not sure what was going on w/ my last VM. I then added my dissector and worked through all errors and warnings to rebuild Wireshark.

Now, this dissector was built w/ Wireshark 1.6, so I had to update our source to meet 2.2 API changes. Once I was able to compile w/ no errors, I attempted to launch the Wireshark executable again. The app crashes when registering plugins with a Runtime error...

If I remove my plugin dll, Wireshark runs fine so I clearly missed something in my plugin source.

I'm working on debugging now...any idea as to where I should start? I know this is a very general bug, but any help is good help. Maybe helping me point to where Wireshark starts to register plugins then I can throw a breakpoint in and investigate.

(06 Apr '17, 14:36) aawale15

Run Wireshark under a debugger and look at the call stack when it breaks. You can use WinDbg or Visual Studio. For the latter, open the solution in VS, set Wireshark.exe as the "start-up" project, and then hit "F5".

(07 Apr '17, 03:56) grahamb ♦

@grahamb, may I ask what your Debug configuration settings are in Visual Studio? Back to working on figuring out why I'm seeing a "Runtime" error when Wireshark attempts to register my plugin on startup.

(14 Apr '17, 14:34) aawale15

Pretty much out off the box, I do set a directory for a symbol cache though to stop the downloaded MS symbols being shotgunned over the filesystem.

(15 Apr '17, 02:42) grahamb ♦
showing 5 of 15 show 10 more comments