path: root/include
diff options
author/C=EU/ST=EU/CN=Pablo Neira Ayuso/ </C=EU/ST=EU/CN=Pablo Neira Ayuso/>2008-01-13 17:58:42 +0000
committer/C=EU/ST=EU/CN=Pablo Neira Ayuso/ </C=EU/ST=EU/CN=Pablo Neira Ayuso/>2008-01-13 17:58:42 +0000
commit800c6646e0f748bad3c52ac7f20e38a1583d8bdb (patch)
tree504e1fca37fa0a73c8da98321a33e82eae5e29e4 /include
parent318961c76bf2d7c5ab715d8fee4aa005bdcde5e0 (diff)
Introduce nfnl_set_rcv_buffer_size to set the receive buffer size used by
nfnl_catch. This revision changes the behaviour of nfnl_catch which does not perform a peek-and-resize if the buffer size used by nfnl_recv is too small. The only known client which may be affected by this change is libnetfilter_conntrack. However, this library uses nfnl_catch to get conntrack events which are always much smaller than 4096 bytes (default receive buffer size). This change boosts up performance in the receive path since we do only one recv instead of two.
Diffstat (limited to 'include')
1 files changed, 3 insertions, 0 deletions
diff --git a/include/libnfnetlink/libnfnetlink.h b/include/libnfnetlink/libnfnetlink.h
index de77caa..b6b3e96 100644
--- a/include/libnfnetlink/libnfnetlink.h
+++ b/include/libnfnetlink/libnfnetlink.h
@@ -56,6 +56,9 @@ extern struct nfnl_subsys_handle *nfnl_subsys_open(struct nfnl_handle *,
unsigned int);
extern void nfnl_subsys_close(struct nfnl_subsys_handle *);
+/* set receive buffer size (for nfnl_catch) */
+extern void nfnl_set_rcv_buffer_size(struct nfnl_handle *h, unsigned int size);
/* sending of data */
extern int nfnl_send(struct nfnl_handle *, struct nlmsghdr *);
extern int nfnl_sendmsg(const struct nfnl_handle *, const struct msghdr *msg,