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

I am using development version 2.3.0 and release version 2.2.5 of Wireshark in development of a C dissector (on the same system). Referring back to https://ask.wireshark.org/questions/60224/difference-between-proto_tree_add_item-and-proto_tree_add_uint , I currently have a warning for using the wrong FT_UINT for a field.

The code in question:

#define PROTO_MEMORY_WRITE_ADDRESS_LEN 8

    proto_tree_add_item(proto_tree, hf_proto_memory_write_address, tvb, offset, PROTO_MEMORY_WRITE_ADDRESS_LEN, ENC_LITTLE_ENDIAN);
    offset += PROTO_MEMORY_WRITE_ADDRESS_LEN;

    {&hf_proto_memory_write_address,
        {"Memory Write Address", "proto.memory_write_address", FT_UINT64, BASE_DEC, NULL, 0,
            NULL, HFILL }

In the development version the memory write address displays with no errors. In the release version (copied generated .dll to plugins folder) the error is "Trying to fetch a signed integer with length 8." I have a similar issue in a nearly identical field - 8 bytes - with the same errors. I tried switching to FT_UINT32 and the results switched. No error in the release version but the dev version obviously said that the FT_UINT was wrong.

asked 21 Apr '17, 06:13

brownfox's gravatar image

brownfox
21338
accept rate: 0%

edited 21 Apr '17, 06:14


Wireshark APIs are not guaranteed to (and are often never) backward compatible between major releases. So you cannot compile your plugin with Wireshark 2.3.0 source code and expect it to work with 2.2.5 without recompilation. If you want your plugin to be compatible with various major versions (here 2.2.X vs 2.3.0), you have to compile the library twice.

permanent link

answered 21 Apr '17, 07:09

Pascal%20Quantin's gravatar image

Pascal Quantin
5.5k1060
accept rate: 30%

Thanks, that makes sense. I'll switch my development source code.

(21 Apr '17, 07:25) brownfox
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:

×637
×158
×16
×10

question asked: 21 Apr '17, 06:13

question was seen: 661 times

last updated: 21 Apr '17, 07:25

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