I wrote a plugin for wireshark 1.7.1 which was working fine then. When i tried same source with 1.9.0 , it gives me following error while make install.

packet-extl2.c: In function 'proto_reg_handoff_extl2':
packet-extl2.c:265: error: passing argument 1 of 'new_create_dissector_handle' from incompatible pointer type
packet-extl2.c:266: error: implicit declaration of function 'dissector_add'
make[3]: [packet-extl2.lo] Error 1
make[3]: Leaving directory /root/wireshark/wireshark-1.9.0/plugins/extl2' make[2]: *** [install-recursive] Error 1 make[2]: Leaving directory/root/wireshark/wireshark-1.9.0/plugins'
make[1]:
[install-recursive] Error 1
make[1]: Leaving directory `/root/wireshark/wireshark-1.9.0'
make: *** [install] Error 2
[dissector@ wireshark-1.9.0]$

Here is my function which is creating problems:

void
proto_reg_handoff_extl2(void)
{
dissector_handle_t extl2_handle;
ip_handle = find_dissector("ip");
extl2_handle = new_create_dissector_handle(dissect_extl2,proto_extl2);
dissector_add("ethertype", 0x0800,extl2_handle);
dissector_add("ethertype",0x86DD,extl2_handle);
}

I am not sure what's wrong. dissect_extl2 returns "tvb_length" and has return type of static int. And also what header i am missing to get "implicit declaration of dissector_add" . Any help appreciated.

Thanks for your time.

asked 28 Feb '13, 06:00

yogeshg's gravatar image

yogeshg
41222326
accept rate: 0%

edited 28 Feb '13, 06:11


I think the problem you're experiencing is that the prototype for the dissectors' top-level dissection routine has changed. Here's how I get around it with my (private) dissector (which I compile on into Wireshark versions before and after this change):

static int
#if defined(VERSION_MAJOR) && (VERSION_MAJOR > 1 || (VERSION_MAJOR == 1 && VERSION_MINOR > 8))
dissect_XXX(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *data _U_)
#else
dissect_XXX(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree)
#endif
link

answered 28 Feb '13, 06:40

JeffMorriss's gravatar image

JeffMorriss ♦
3.3k448
accept rate: 26%

at least error is not coming now , thank you.

(28 Feb '13, 07:34) yogeshg

Try changing dissector_add() to dissector_add_uint().

link

answered 28 Feb '13, 06:33

Anders's gravatar image

Anders ♦
3.3k341
accept rate: 17%

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

Tags:

×778
×334

Asked: 28 Feb '13, 06:00

Seen: 844 times

Last updated: 28 Feb '13, 07:34

powered by OSQA