This is a static archive of our old Q&A Site. Please post any new questions and answers at ask.wireshark.org.

Build only one dissector lib

0

Hi everyone, I'm using tshark with Linux environment. In my case, I modified something of packet-camel.c, built and installed all project. Now, I'm going to change some values in packet-camel.c but the the system is still running and it should not be stopped.

is there any way to build only packet-camel.c into the lib file? so that we can copy-paste the new lib to replace the old one. At least, it spends just few minutes instead of an hour to build all project.

Please help if you have any idea? Thank you so much!

asked 09 Apr '15, 23:11

hoangsonk49's gravatar image

hoangsonk49
81282933
accept rate: 28%

What build method are you using, autotools or CMake?

Regardless, the build method should only rebuild that which has changed, e.g. packet-camel.o and libwireshark.

(10 Apr '15, 02:17) grahamb ♦

I follow the Development Guide with: ./autogen.sh; ./configure; make; make install, ... But I have to run this procedure every time and it takes time even only one file changes. If there is a way to build only packet-camel.c, so that I build the lib of packet-camel independently and copy-paste to replace the old one. It helps me to save time to reinstall the new tshark

(10 Apr '15, 02:33) hoangsonk49

One Answer:

0

No need to autogen or configure when you only change the dissector. make will rebuild only the required parts, make install does the actual install.

If you only need the new libwireshark then you could manually copy that after make.

Note that it will only be used by a new instance of the tshark process, existing running tshark processes won't pick up the new library.

answered 10 Apr '15, 03:49

grahamb's gravatar image

grahamb ♦
19.8k330206
accept rate: 22%

Hi Grahamb, just to clarify. I have a running server with my tshark. Now, I change something in the source code of packet-camel.c and packet-data.c and already "make all" on the Dev server. So, is there any way to apply these updates without installing a whole new wireshark on the running server? In other words, which are the lib of packet-camel.c and packet-data.c generated on Dev server so that I just copy-paste to replace the old one on the running machine? By doing that, I don't have to remove a whole wireshark and install a new one just to update a very small code of one packet, it takes time. As you mentioned, Do i also need to replace the old tshark? Thank you

(05 Nov '15, 17:48) hoangsonk49

Now, I change something in the source code of packet-camel.c and packet-data.c and already "make all" on the Dev server. So, is there any way to apply these updates without installing a whole new wireshark on the running server?

You need to install a new libwireshark on the running server. You wouldn't need to install a new version of the Wireshark or TShark executables, but, as Graham said, "it will only be used by a new instance of the tshark process, existing running tshark processes won't pick up the new library."

There is no library that contains only packet-camel.c and packet-data.c; they're just one of many components of libwireshark, so you'll have to replace libwireshark.

(05 Nov '15, 19:19) Guy Harris ♦♦

[[email protected] gatewayLog]# locate libwireshark

/usr/lib64/libwireshark.so

/usr/lib64/libwireshark.so.3

/usr/lib64/libwireshark.so.3.1.9

/usr/local/lib/libwireshark.la

/usr/local/lib/libwireshark.so

/usr/local/lib/libwireshark.so.3

/usr/local/lib/libwireshark.so.3.1.9

Hi Harris, I found these libwireshark on the running server. As I understand, in order to apply the new update, I just:

  • Replace these libwireshark on the running server with the new one

  • Replace tshark on the running server with the new tshark

Is it right?

(05 Nov '15, 19:46) hoangsonk49

You'll find that most of those entries for libwireshark are symbolic links, you'll just need to replace the targets, e.g. libwireshark.so.3.19.

I can't see a need to replace tshark. You'll just need to restart the running instance so it picks up the new libwireshark.

(06 Nov '15, 03:45) grahamb ♦