Hi all, I'm using both of tshark.c and dissector "packet-camel.c". i wonder when gcc compiles tshark and Dissector, does it consider them as in the same project? Because when I try to use an extern variable for both of these files, the variable in different files are different. i think that the tshark.c call dissector to do something so that it doesn't make sense if an extern variable in tshark.c has different value when it is called in dissector "packet-camel.c". Thanks for your help. asked 02 Oct '13, 02:02 hoangsonk49 |
One Answer:
tshark.c is compiled as part of tshark, packet-camel.c is compiled as part of libwireshark which is linked to by tshark. The variable will have to be declared and exported from one part and then extern'd from the other part. I would suggest that it would be best to be declared and exported from libwireshark and then extern'd in tshark as tshark has a dependency on libwireshark and not the other way around. Note that to export symbols in a cross platform manner some hoops have to be jumped through, look at answered 02 Oct '13, 02:38 grahamb ♦ edited 02 Oct '13, 03:27 |
Problem solved. Thanks for your idea, grahamb :-)
Hint: If a supplied answer resolves your question can you please "accept" it by clicking the checkmark icon next to it. This highlights good answers for the benefit of subsequent users with the same or similar questions