libnfnetlink new API #3
Pablo Neira Ayuso
maintainerRFC 1/1 libnfnetlink new API #3
Hi,
This patch follows from:
http://patchwork.netfilter.org/netfilter-devel/patch.pl?id=3695
Now we do sequence tracking for queries, I assume that sequence number 0 is only used by events.
Wait for your comments,
Pablo
Signature · 1 line
The dawn of the fourth age of Linux firewalling is coming; a time of great struggle and heroic deeds -- J.Kadlecsik got inspired by J.Morris
libnfnetlink/libnfnetlink.h +29 -0
@@ -98,6 +98,35 @@const unsigned char *buf, size_t len); +/* join a certain netlink multicast group */ +extern int nfnl_join (const struct nfnl_handle *nfnlh,unsigned int group); + +/* process a netlink message */ +extern int nfnl_process (struct nfnl_handle *h, +const unsigned char *buf, +size_t len); + +/* iterator API */ + +extern struct nfnl_iterator * +nfnl_iterator_create (const struct nfnl_handle *h, +const char *buf, +size_t len); + +extern void nfnl_iterator_destroy (struct nfnl_iterator *it); + +extern int nfnl_iterator_process (struct nfnl_handle *h, +struct nfnl_iterator *it); + +extern int nfnl_iterator_next (const struct nfnl_handle *h, +struct nfnl_iterator *it); + +/* replacement for nfnl_listen */ +extern int nfnl_catch (struct nfnl_handle *h); + +/* replacement for nfnl_talk */ +extern int nfnl_query (struct nfnl_handle *h,struct nlmsghdr *nlh); +#define nfnl_attr_present (tb, attr) \ (tb[attr-1])
libnfnetlink.c +598 -61
971 lines not on this page · raw message