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

problems adding a built-in dissector

0

I'm having difficulty adding a built-in dissector - get fatal errors doing "nmake all" (Windows 7)

I have a dissector that works OK as a plug-in. The document README.dissector suggests on page 29, section 1.8 that you need to do four things:

  1. add your dissector source file (packet-ecmp.c) to folder c:/wireshark/epan/dissectors
  2. add the name of the source file (packet-ecmp) to the DISSECTOR_SRC macro in the file c:/wireshark/epan/dissectors/Makefile.common
  3. Add the header file (which I don't have) to DISSECTOR_INCLUDES macro in the file c:/wireshark/epan/dissectors/Makefile.common
  4. add the name of the source file (packet-ecmp) to the DISSECTOR_SRC section in the file c:/wireshark/epan/CMakeLists.txt

When I run the command: nmake -f Makefile.nmake all I get the following early failure:

packet-ipmi-transport.c

packet-ipmi-pps.c

packet-ipmi-update.c

packet-dcerpc-nt.c

usb.c

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\cl.EXE"' : return code '0x2' Stop.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2' Stop.

NMAKE : fatal error U1077: '"C:\Program Files (x86)\Microsoft Visual Studio 10.0\VC\BIN\nmake.exe"' : return code '0x2' Stop.

C:\wireshark>

Am I missing a step in the procedure? The error message doesn't seem to indicate what is wrong?

asked 16 Mar '14, 12:26

lynchzilla's gravatar image

lynchzilla
26447
accept rate: 0%


2 Answers:

1

I would like to thank Bill Meier, Pascal Quantin, and Anders for their helpful responses.

I had this structure at the top of my dissector (from the plug-in version):

ifdef HAVE_CONFIG_H

include "config.h"

endif

Taking Ander's advice, I removed the #ifdef structure and this made Wireshark build properly with our dissector installed as a built-in.

Cheers everybody!

answered 17 Mar '14, 20:09

lynchzilla's gravatar image

lynchzilla
26447
accept rate: 0%

0

You should have the errors above in the shell. Just scroll in the window to see them.

answered 16 Mar '14, 14:33

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

--> (Converted to a comment as per the way ask.wireshark.org works; --> Please see the FAQ).

I did direct the command window output to a text file and it does reveal the errors that are causing the "fatal error".

The painful thing is that this is in a file I made NO changes to (c:/wireshark/epan/proto.h).

packet-eapol.c

packet-echo.c

packet-ecmp.c

packet-ecp-oui.c

packet-edonkey.c

c:\wireshark\epan\proto.h(115) : error C2054: expected '(' to follow 'WS_MSVC_NORETURN'

c:\wireshark\epan\proto.h(115) : error C2085: 'proto_report_dissector_bug' : not in formal parameter list

c:\wireshark\epan\proto.h(346) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(347) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(348) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(349) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(350) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(351) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(352) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(358) : error C2057: expected constant expression

c:\wireshark\epan\proto.h(358) : error C2085: 'field_display_e' : not in formal parameter list

c:\wireshark\epan\proto.h(376) : error C2085: 'hf_ref_type' : not in formal parameter list

c:\wireshark\epan\proto.h(379) : error C2085: 'header_field_info' : not in formal parameter list

c:\wireshark\epan\proto.h(398) : error C2061: syntax error : identifier 'hf_ref_type'

c:\wireshark\epan\proto.h(400) : error C2143: syntax error : missing '{' before '*'

c:\wireshark\epan\proto.h(401) : error C2059: syntax error : '}'

c:\wireshark\epan\proto.h(420) : error C2061: syntax error : identifier 'header_field_info'

c:\wireshark\epan\proto.h(421) : error C2059: syntax error : '}'

c:\wireshark\epan\proto.h(434) : error C2016: C requires that a struct or union has at least one member

c:\wireshark\epan\proto.h(434) : error C2061: syntax error : identifier 'header_field_info'

c:\wireshark\epan\proto.h(444) : error C2059: syntax error : '}'

     :

..... similar errors ......

     :

c:\wireshark\epan\proto.h(746) : error C2143: syntax error : missing '{' before '*'

c:\wireshark\epan\proto.h(746) : fatal error C1003: error count exceeds 100; stopping compilation

packet-egd.c

packet-ehdlc.c

There must be some environment setting that I have missed?

(16 Mar '14, 18:54) lynchzilla

Obviously something isn't right.

(I'm assuming that you can build Wireshark cleanly w/o any of your changes. If not, yo u'll need to address that first).

Since the errors occur shortly after the display of "packet-ecmp" (your dissector) in the output, I expect that the error is in packet-ecmp.c. (The Windows build is set up to do compiles in parallel so it can be a little unclear as to the top-level source file causing the errors.

Given that it appears that other dissectors built OK (using the same include file), my first guess would be that there's something funny before the #include <proto.h> in your main packet-ecmp.c source file. That's where I would start. Extra character ? etc etc etc.

(16 Mar '14, 20:55) Bill Meier ♦♦

Just to be sure, you do include config.h before any other include file, right?

(16 Mar '14, 23:06) Pascal Quantin

And if building against trunk, no #ifdef around it.

(17 Mar '14, 00:05) Anders ♦