utils/nfulnl_test.c uses these functions Signed-off-by: Duncan Roe <duncan_roe@xxxxxxxxxxxxxxx> --- src/libnetfilter_log.c | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) diff --git a/src/libnetfilter_log.c b/src/libnetfilter_log.c index 66669af..27a6a2d 100644 --- a/src/libnetfilter_log.c +++ b/src/libnetfilter_log.c @@ -323,6 +323,20 @@ struct nflog_handle *nflog_open(void) * @} */ +/** + * \addtogroup Log + * @{ + */ + +/** + * nflog_callback_register - register function to process packets + * + * \param gh Netfilter log group handle obtained by call to nflog_bind_group() + * \param cb callback function to call for each logged packet + * \param data custom data to pass to the callback function + \return 0 + */ + int nflog_callback_register(struct nflog_g_handle *gh, nflog_callback *cb, void *data) { @@ -332,11 +346,29 @@ int nflog_callback_register(struct nflog_g_handle *gh, nflog_callback *cb, return 0; } +/** + * nflog_handle_packet - handle a packet received from the nflog subsystem + * \param h Netfilter log handle obtained via call to nflog_open() + * \param buf nflog data received from the kernel + * \param len length of packet data in buffer + * + * Triggers an associated callback for each packet contained in \b buf. + * Data can be read from the queue using nflog_fd() and \b recv(). + * See example code in the Detailed Description. + * \return 0 on success, -1 if either the callback returned -ve or \b buf + * contains corrupt data. \b errno is not reliably set: + * caller should zeroise first if interested. + */ + int nflog_handle_packet(struct nflog_handle *h, char *buf, int len) { return nfnl_handle_packet(h->nfnlh, buf, len); } +/** + * @} + */ + /** * \addtogroup LibrarySetup * -- 2.17.5