Hi, in our company we use some Wireshark plugins. They worked fine for Wireshark 1.x. For Wireshark 2.1 they do no longer work and I am trying to migrate them to Wireshark 2.1. I managed to compile them for Windows 64 bit. The generation of c files from the .asn files didn't work with CMake but I managed to create them manually using awn2wrs. I updated some renamed functions and now Windows 64 bit works fine. What causes some headache is compiling for Linux. (Ubuntu 14.04 64bit) I found instructions in README.plugins and followed them. They are not fully complete but I managed to build some plugins that do not use asn.1 files. What I did is updating these files to include my plugins: - CMakeListsCustom.txt - configure.ac - plugins/Custom.m4 - plugins/Custom.make I also deleted my Makefile.common and Makefile.am files and created new ones based on plugins/gryphon example. Doing this for non-ASN.1 dissectors works fine but it doesn't help if ASN.1 is used. All samples and instructions I found lack some hints on how to use them with latest Wireshark version. Also the ASN.1 sample dissector does not build:
Are there any updated build instructions available to create plugins? Are there any migration instructions available? I never compiled for Wireshark before. I am not aware with which version the changes in the dissector API and in the build process were introduced with. I hope the experts here can ease my pain. ;) BR, Gerhard Edit1: When I updated the non ASN.1 plugins I had to remove the rule to create plugin.c from Makefile.am. This is what causes the error message about missing make-dissector-re.py tool. I also applied this change to the ASN.1 based plugins. But this only shifts the problem a bit further:
Now there is no file plugin.c created. I cannot apply all the other changes from the makefiles as they are rather different with regards to the autogenerated files and I cannot really figure out which part I still need or with what other rules I have to replace the content. asked 22 Jun '16, 08:06 gerhardh edited 24 Jun '16, 04:30 |
One Answer:
The "No files found" text means that tools/make-dissector-reg.py was called with an empty $REGISTER_SRC_FILES list. If you look at plugins\Makefile.common.inc, you will get this definition:
Where those lists are supposed to be defined in the Makefile.common file in your plugin folder. So ensure to have something like:
Where you replace packet-toyasn1.c by whatever file name contains your register and handoff functions. PS: given that you were able to compile with CMake on Windows, it might be easier to use CMake on Linux also rather that updating the Makefile.(am|common) files. answered 24 Jun '16, 06:21 Pascal Quantin |
Thanks a lot for your answer.
Calling tools/make-dissector-reg.py will not be possible even with proper parameters. This tool does not exist any longer. I had to remove the whole part where plugin.c was created.
I tried to apply the same changes as with the non-ASN.1 plugins and add the differences for ASN.1 on top of them. After some fiddling around I managed to get a version of the Makefiles that work for me (more or less).
The new content of Makefile.am is:
The new content of Makefile.common is:
The only drawback of these Makefiles is that packet-toyasn1.c|h are only created from packet-toyasn1-template.c|h if they do not exist. If they already exist and the template files are changed, asn2wrs tool ist not called again to update the autogenerated files. As I do not need to touch the dissector code itself a lot, this limitation is fine for me.
When using cmake for building the Windows version these C and H files were not created from the template files automatically at all. This is one of the reasons why I didn't use cmake to build the Linux version.
With this solution my problem is solved. Thanks for helping
I do not know why you say that tools/make-dissector-reg.py does not exist anymore. It does and in master branch it is called from plugins/Makefile.am.inc file (you are supposed to include it in your Makefile, see Makefile.am in plugins/gryphon folder for example).
I am sorry. I provided wrong link to ASN.1 sample plugin in the initial question. I didn't use foo.tar.gz sample file but toyasn1.tar.gz sample file from here: https://wiki.wireshark.org/ASN1_plugin
Maybe it would have worked better if I had used to foo ASN.1 example.
With toyasn1 sample code I got the error message about missing ../../tools/make-dissector-reg script that I showed in initial question. That shell script is not existing in the git repository.
What I didn't notice is the missing file extension. You were talking about make-dissector-reg.py which does exist in tools directory.
Looking a bit closer into Makefile.am it seems that it assumes that there is a script for use with Python and one without Python. But the latter is not existing in the folder, causing the error message.
Sorry for the confusion.
Indeed toyasn1 plugin is really out of date (if you check the wiki page you will see that it was last updated in 2010) and does not work out of the box with current master branch (as you unfortunately discovered).