First time here? Check out the FAQ!
THIS IS A TEST INSTANCE. Feel free to ask and answer questions, but take care to avoid triggering too many notifications.
0

tvb_format_stringzpad reported as undefined

Compiling my custom plugin on Apple silicon that calls tvb_format_stringzpad(), I get a linker error saying: Undefined symbols for architecture arm64: "_tvb_format_stringzpad", referenced from: my_dissector_function in packet-my_proto.o ld: symbol(s) not found for architecture arm64

The symbol seems to be available in: % lipo -archs libwireshark.15.0.7.dylib arm64

% nm -arch arm64 wireshark/build/run/Debug/libwireshark.15.0.7.dylib | grep 'tvb_format_stringzpad$' 00000000000c6c18 t _tvb_format_stringzpad

This being compiled against wireshark-3.6.7: % git rev-parse --short HEAD 4a304d7ec2

Any pointers on how to proceed would be appreciated.

Alexander Kapshuk's avatar
1
Alexander Kapshuk
asked 2022-08-28 15:53:09 +0000
Guy Harris's avatar
19.9k
Guy Harris
updated 2022-08-28 20:41:38 +0000
edit flag offensive 0 remove flag close merge delete

Comments

I think I got the answer. tvb_format_stringzpad is not an exported function and seems to be restricted for use within libwireshark itself by not being declared as WS_DLL_PUBLIC, is that correct?

Alexander Kapshuk's avatar Alexander Kapshuk (2022-08-28 16:51:27 +0000) edit

There is a Closed issue (585: Export tvb_format_stringzpad() functions) that discusses "best practice".

Chuckc's avatar Chuckc (2022-08-28 18:48:35 +0000) edit

Thanks. I'll look into that.

Alexander Kapshuk's avatar Alexander Kapshuk (2022-08-29 07:45:41 +0000) edit
add a comment see more comments

1 Answer

0

tvb_format_stringzpad is not an exported function and seems to be restricted for use within libwireshark itself by not being declared as WS_DLL_PUBLIC, is that correct?

Correct.

Guy Harris's avatar
19.9k
Guy Harris
answered 2022-08-29 07:16:51 +0000
edit flag offensive 0 remove flag delete link

Comments

Thanks for confirming that.

Alexander Kapshuk's avatar Alexander Kapshuk (2022-08-29 07:45:53 +0000) edit
add a comment see more comments

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss.

Add Answer