I have modified one of the dissectors to display additional details and works great. What I want to do next is to write the result after each packet is dissected into a DB. My first thought was to use Python embedded into the dissector to save into sqlite db. I added the Python.h header and getting the error below. Not sure which file to update to allow the include path to be searched. Can this be done, if yes, what do I need to do to correct this. Any help would be appreciated. Thank you. packet-fix.c(31) : fatal error C1083: Cannot open include file: 'Python.h': No such file or directory asked 24 Jul '14, 07:35 DennisVecchio |
One Answer:
Wouldn't you be better off just using the SQLite C API, rather than bringing python in? answered 24 Jul '14, 08:02 grahamb ♦ showing 5 of 6 show 1 more comments |
thx grahamb for responding. Yes I can, I just wanted to try embedding python into the mix. Thx.
If you really have to use Python I hope you aren't expecting to live capture at high bit rate as I suspect performance would take a dive with the C > Python > C conversions.
You haven't stated how and what platform you're building on. Depending on the config method (autofoo, CMake or nmake) you'll need to adjust the include path that's presented to the compiler.
On Windows you'll also have to make sure that you're using the same version of Visual Studio as is used by the Python dll to prevent crt mismatches.
Sorry about that, it’s on a window machine with VS 10 and Python27. Yes, I agree with you as the performance would take a hit. Thx, will check nmake files and adjust the include path. When I originally looked, I wasn't sure where/what to modify, but will look again. By trade, I am network guy and writing code when I’m free (help automate/troubleshoot network tasks/issues). If you can guide me to which files to modify, it would be very helpful. Much appreciated!
The include directory would be added to CFLAGS in
epan\dissectors\Makefile.nmake
as another /I option. You'll probably have to add the Python import library to libwireshark_LIBS inepan\Makefile.nmake
as well.Thank you much grahamb! Will work on it tonight. thx again!
Hey grahamb, In wireshark\config.nmake contains variables/flags (PYTHON_CFLAGS) for Python. There was a flag PYTHON_EMBED=1, which is the trigger to setup all of the Python variables/flags and it was commented out by default. I took the comment out and added $(PYTHON_CFLAGS) to CFLAGS in dissector\Makefile.nmake and successfully compiled. Thank you for your help!!