nfdump
nfdump copied to clipboard
request/intent for PR: using nfdump as a library
Thanks for a great tool!
What is the recommended method of using nfdump as an external library for reading nfcapd data?
I'm in the process of making nfdump and moloch play together (read: piping nfcapd flows via moloch-capture pipeline as "dataless sessions" to be viewed and queried in moloch UI).
Integration is currently based on nfreader.c sample and it "seems to work OK, on my machine".
What I've done this far works with some hand-crafted code to please compiler and make things link, but for simple "--with-nfdump=/prefix" kind of inclusion some adjustments to the headers and build machinery should be done, IMHO.
Is there something missing from my radar, something planned in this field, or something where PR-s would be welcome?
Using nfreader is indeed the preferred way to craft an interface of your choice. The nfreader code coming with nfdump is guaranteed to work. However, you can code your own reader. Everything you need is nffile.h with it's definitions. There might be a GO interface one day to read nfdump files with Apps written with Golang. Hope, this helps
I'd like to re-open this, as it was not just a notice but to be followed with a PR.
To make things work for moloch-nfdump (nfdump data importer for moloch, see https://github.com/martinpaljak/moloch/wiki) manual fuss is needed to make nfdump header layout work from an external project. Namely:
- conflict of "config.h"
- clearer separation of internal and external headers.
Right now this makes it compile semi-cleanly:
https://github.com/martinpaljak/moloch/commit/5aa6408e3bf9c0aa29148565f208a6740c846611#diff-05e4d1c315718a1c74a8a45b096525a3R29-R60
https://github.com/martinpaljak/moloch/blob/nfdump/configure.ac#L356-L357
I can reopen this, but changes won't be ready soon.
As go-nfdump
can read nfdump binary files, a custom importer written in Go would be most efficient, I guess.