From fa7502460ef19efe28337f74e4c60990daf418df Mon Sep 17 00:00:00 2001 From: "/C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org" Date: Sun, 7 Aug 2005 14:54:58 +0000 Subject: sync with all 'upstream' changes in libnfnetlink_log --- _queue/src/libipq_compat.c | 27 ++++++++++++++------------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to '_queue/src/libipq_compat.c') diff --git a/_queue/src/libipq_compat.c b/_queue/src/libipq_compat.c index 9e99674..d263aed 100644 --- a/_queue/src/libipq_compat.c +++ b/_queue/src/libipq_compat.c @@ -27,8 +27,8 @@ #include #include -#include "libnfnetlink_queue.h" -#include "libipq.h" +#include +#include /**************************************************************************** * @@ -216,16 +216,16 @@ struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol) memset(h, 0, sizeof(struct ipq_handle)); - status = nfqnl_open(&h->nfqnlh); - if (status < 0) { + h->nfqnlh = nfqnl_open(); + if (!h->nfqnlh) { ipq_errno = IPQ_ERR_SOCKET; goto err_free; } if (protocol == PF_INET) - status = nfqnl_bind_pf(&h->nfqnlh, PF_INET); + status = nfqnl_bind_pf(h->nfqnlh, PF_INET); else if (protocol == PF_INET6) - status = nfqnl_bind_pf(&h->nfqnlh, PF_INET6); + status = nfqnl_bind_pf(h->nfqnlh, PF_INET6); else { ipq_errno = IPQ_ERR_PROTOCOL; goto err_close; @@ -236,8 +236,8 @@ struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol) goto err_close; } - status = nfqnl_create_queue(&h->nfqnlh, &h->qh, 0); - if (status < 0) { + h->qh = nfqnl_create_queue(h->nfqnlh, 0, NULL, NULL); + if (!h->qh) { ipq_errno = IPQ_ERR_BIND; goto err_close; } @@ -245,7 +245,7 @@ struct ipq_handle *ipq_create_handle(u_int32_t flags, u_int32_t protocol) return h; err_close: - nfqnl_close(&h->nfqnlh); + nfqnl_close(h->nfqnlh); err_free: free(h); return NULL; @@ -258,7 +258,7 @@ err_free: int ipq_destroy_handle(struct ipq_handle *h) { if (h) { - nfqnl_close(&h->nfqnlh); + nfqnl_close(h->nfqnlh); free(h); } return 0; @@ -267,7 +267,7 @@ int ipq_destroy_handle(struct ipq_handle *h) int ipq_set_mode(const struct ipq_handle *h, u_int8_t mode, size_t range) { - return nfqnl_set_mode(&h->qh, mode, range); + return nfqnl_set_mode(h->qh, mode, range); } /* @@ -288,7 +288,7 @@ ssize_t ipq_read(const struct ipq_handle *h, * in order to build a data structure that is compatible to * the old ipq interface... */ - nfa = nfnl_parse_hdr(&h->nfqnlh.nfnlh, nlh, &msg); + nfa = nfnl_parse_hdr(nfqnl_nfnlh(h->nfqnlh), nlh, &msg); if (!msg || !nfa) return 0; @@ -298,6 +298,7 @@ ssize_t ipq_read(const struct ipq_handle *h, nfnl_parse_attr(tb, NFQA_MAX, nfa, 0xffff); + return 0; } int ipq_message_type(const unsigned char *buf) @@ -323,7 +324,7 @@ int ipq_set_verdict(const struct ipq_handle *h, size_t data_len, unsigned char *buf) { - return nfqnl_set_verdict(&h->qh, id, verdict, data_len, buf); + return nfqnl_set_verdict(h->qh, id, verdict, data_len, buf); } /* Not implemented yet */ -- cgit v1.2.3