Code cleaning, SCTP support, NFLOG logic fix
Status from this message: I've applied all patches to Netfilter's ulogd2 git tree.
Get series with b4
b4 am [email protected]Versions newest first
Patches in v1 Applied
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/18 | add ukey_* function for key assignationfilter/ filter/ filter/ +15 more | +449 | 0 replies | |
| 2/18 | Modify usage of nflog_bind_pf function.input/ | +32 | 0 replies | |
| 3/18 | Get rid of addressfamily variable in NFLOG input plugininput/ | +29 | 0 replies | |
| 4/18 | Document group 0 usage and suppress address_familyulogd.conf.in | +20 | 0 replies | |
| 5/18 | Add SCTP support to BASE plugin.filter/ | +53 | 0 replies | |
| 6/18 | SCTP support for PRINTPKT.include/ util/ | +18 | 0 replies | |
| 7/18 | Add SCTP support to MySQL and PGSQL output.doc/ doc/ | +79 | 0 replies | |
| 8/18 | Treat nice function return.src/ | +7 | 0 replies | |
| 9/18 | Fix stop function of NFCT plugin.input/ src/ | +5 | 0 replies | |
| 10/18 | Don't free pluginstance when leavinginput/ input/ | +0 | 0 replies | |
| 11/18 | Fix minor memory leak in NFLOG plugin.input/ | +2 | 0 replies | |
| 12/18 | Call pluginstance stop function when exitingsrc/ | +25 | 0 replies | |
| 13/18 | Add SIGINT to list of terminal signal.src/ | +2 | 0 replies | |
| 14/18 | Unload plugins when quitting.include/ src/ | +28 | 0 replies | |
| 15/18 | Introduce config_stop() functioninclude/ src/ src/ | +9 | 0 replies | |
| 16/18 | Free stacks when exiting.src/ | +12 | 0 replies | |
| 17/18 | Fix memory leak in destructor_nfct().input/ | +10 | 0 replies | |
| 18/18 | Add valgrind compilation option.src/ | +4 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [ULOGD2 PATCH 0/18] Code cleaning, SCTP support, NFLOG logic fix
Hi,
This patchset is made of four parts.
First part is Pablo's work that I have completed. It cleans up the current key assignation by introducing a new set of functions:
* add ukey_* function for key assignation
Second part fixes a logic problem in NFLOG input plugin. System logging (for instance invalid conntrack message) are done on group 0 queue for all protocols. Thus a protocol dependant NFLOG plugin is stupid. Furthermore, the nfnetlink message contains the protocol information. This set of patch suppresses the addressfamily variable and modify NFLOG to only bind as system logging if group is 0:
* Modify usage of nflog_bind_pf function.
* Get rid of addressfamily variable in NFLOG input plugin
* Document group 0 usage and suppress address_family
Third part adds support for SCTP in ulogd2. It contains a basic packet parser and a support in all OUTPUT plugin:
* Add SCTP support to BASE plugin.
* SCTP support for PRINTPKT.
* Add SCTP support to MySQL and PGSQL output.
Last part is code cleaning. It fixes some memory leak fixes and cleaning of ulogd exit code.F or example, fini function were defined for each module but were never called:
* Treat nice function return.
* Fix stop function of NFCT plugin.
* Don't free pluginstance when leaving
* Fix minor memory leak in NFLOG plugin.
* Call pluginstance stop function when exiting
* Add SIGINT to list of terminal signal.
* Unload plugins when quitting.
* Introduce config_stop() function
* Free stacks when exiting.
* Fix memory leak in destructor_nfct().
* Add valgrind compilation option.
This patch is build upon Pierre's last patchset.
Patchset statistics:
doc/mysql-ulogd2.sql | 43 ++++- doc/pgsql-ulogd2.sql | 41 ++++- filter/raw2packet/ulogd_raw2packet_BASE.c | 270 +++++++++++++-------------- filter/raw2packet/ulogd_raw2packet_LOCAL.c | 7 +- filter/ulogd_filter_HWHDR.c | 76 ++++---- filter/ulogd_filter_IFINDEX.c | 30 ++-- filter/ulogd_filter_IP2BIN.c | 9 +- filter/ulogd_filter_IP2STR.c | 15 +- filter/ulogd_filter_MARK.c | 4 +- filter/ulogd_filter_PRINTFLOW.c | 3 +- filter/ulogd_filter_PRINTPKT.c | 3 +- filter/ulogd_filter_PWSNIFF.c | 27 ++-- include/ulogd/conffile.h | 3 + include/ulogd/printpkt.h | 2 + include/ulogd/ulogd.h | 68 +++++++- input/flow/ulogd_inpflow_NFCT.c | 171 +++++++----------- input/packet/ulogd_inppkt_NFLOG.c | 186 +++++++++----------- input/packet/ulogd_inppkt_ULOG.c | 46 ++---- output/pcap/ulogd_output_PCAP.c | 11 +- output/ulogd_output_NACCT.c | 34 ++-- src/conffile.c | 4 + src/hash.c | 6 +- src/ulogd.c | 76 ++++++++- ulogd.conf.in | 37 ++-- util/printflow.c | 52 +++--- util/printpkt.c | 163 +++++++++-------- 26 files changed, 768 insertions(+), 619 deletions(-)
BR,
--
Eric Leblond <[email protected]>