compilation error
I tried to add a field in the cfile.h in _capture_file.
typedef struct _capture_file {
gboolean option_enabled;
...
In packet-gsm_sms.c i've added
#include "globals.h"
extern capture_file cfile;
And in one of the function code
if(cfile.option_enabled)
....
And use the new field option_enabled in ../epan/dissectors/packet-gsm_sms.c as it is used in tshark.c .
I got the following error
/bin/ld: run/tshark: hidden symbol `cfile' in CMakeFiles/tshark.dir/tshark.c.o is referenced by DSO
I compile the following way
git clone
mkdir build
cd build
cmake3 -G'Unix Makefiles' -DCMAKE_INSTALL_PREFIX=. ..
make -j8 tshark
Did it compile before you changed cfile.h?
yes, it compiled before,
i just saw that the problem is not cause by tshark.c file but by the use of cfile in ../epan/dissectors/packet-gsm_sms.c
It still doesn't compile
So where is
cfile
used in epan/dissectors/packet-gsm_sms.c?I added cfile use in packet-gsm_sms.c but it doesn't compile. It wasn't before my change, i do it to pass information from tshark.c to packet-gsm_sms.c file.
It doesn't compile because you changed it to refer to
cfile
.Don't do that; the way Wireshark and TShark are constructed, it's not supported, and we don't even guarantee that there will always be a
cfile
in future releases.What sort of information are you trying to pass from tshark.c?
I need to add a new option that will be in use in multiple dissectors.
I wanted to do it through the preference, but didn't find a way to set a preference without setting the dissector name in the preference.
I opened a question at https://ask.wireshark.org/question/16...