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

I'm trying to build an old dissector with the new wireshark source and I'm facing this compilation problem and am not able to resolve it.

More log: packet-xxx.cpp:467:7: error: invalid use of incomplete type 'tvbuff_t {aka struct tvbuff}' In file included from ../../epan/proto.h:51:0, from ../../epan/packet.h:29, from packet-xxx.cpp:51: ../../epan/tvbuff.h:64:8: error: forward declaration of 'tvbuff_t {aka struct tvbuff}' make: *** [packet-xxx.lo] Error 1

asked 26 Nov '13, 02:05

pysudhir's gravatar image

pysudhir
1324
accept rate: 0%

Are you building a C++ dissector? Not sure that will work.

(26 Nov '13, 04:01) Anders ♦

That is exactly the problem. Could you point me out to the changes in the configure.ac file that are needed to compile a c++ dissecotr?

(26 Nov '13, 22:36) pysudhir

Why not go with the flow and write it in C? That also makes it possible to contribute the code.

(27 Nov '13, 00:24) Anders ♦

@pysudhir

As suggested by @Anders comment, there aren't any C++ dissectors in the mainline Wireshark source code.

External additions to the project (plugins) have used C++, WSGD comes to mind, so maybe look at that.

(27 Nov '13, 01:51) grahamb ♦

The problem is that the tvbuff_t structure has been made opaque. That means you cannot do anything with the structure other than store pointers to it and pass them around. That means you can't access, for example, tvb->length. Rather, you must use accessor functions (e.g., tvb_length()).

(The reason the structure is opaque is exactly to ensure that it is only accessed via the accessor functions.)

permanent link

answered 26 Nov '13, 06:26

JeffMorriss's gravatar image

JeffMorriss ♦
6.2k572
accept rate: 27%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Question tags:

×173
×110
×18
×7

question asked: 26 Nov '13, 02:05

question was seen: 2,373 times

last updated: 27 Nov '13, 01:51

p​o​w​e​r​e​d by O​S​Q​A