Ask Your Question

Why do I get a link error when I call proto_tree_add_format_wsp_text() in my dissector?

asked 2019-06-19 14:06:08 +0000

jlshuman gravatar image

updated 2019-06-19 23:49:41 +0000

Guy Harris gravatar image

I am trying to make a call to proto_tree_add_format_wsp_text. This method is implemented in proto.c in the epan folder. I can include the header file for it and it will compile, but it will not link because my project does not know where the object code is. When I build Wireshark, I assume that files like proto.c are compiled into a library or dll. I think I should be able to link to that. But what is the file I need to link to and where is it?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2019-06-19 14:22:58 +0000

grahamb gravatar image

That function isn't exported from the libwireshark library, so can't be used by plugins.

To fix this you can temporarily prefix the declaration in proto.h with WS_DLL_PUBLIC and rebuild.

To create a permanent change you should submit a change at the Wireshark Gerrit instance. See the wiki page on Submitting Patches for more info.

edit flag offensive delete link more


Is there public code that I can call that would replace the call to proto_tree_format_wsp_text? Something I can call that will do basically the same thing?

jlshuman gravatar imagejlshuman ( 2019-06-19 14:47:02 +0000 )edit

That depends, what do you actually want to achieve? An example of the input bytes and the output display would help.

grahamb gravatar imagegrahamb ( 2019-06-19 15:56:46 +0000 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

1 follower


Asked: 2019-06-19 14:06:08 +0000

Seen: 350 times

Last updated: Jun 19 '19