diff options
author | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org> | 2005-08-07 14:54:58 +0000 |
---|---|---|
committer | /C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org </C=DE/ST=Berlin/L=Berlin/O=Netfilter Project/OU=Development/CN=laforge/emailAddress=laforge@netfilter.org> | 2005-08-07 14:54:58 +0000 |
commit | 0c5e5fb15205d1be968d84058d0b91f5c727c454 (patch) | |
tree | 3bed0b091438e72ad48d8d085780664412e6b108 /src/libipq_compat.c | |
parent | 8ac018a680c0324eeca141c6bdf14919b7f33686 (diff) |
sync with all 'upstream' changes in libnfnetlink_log
Diffstat (limited to 'src/libipq_compat.c')
-rw-r--r-- | src/libipq_compat.c | 27 |
1 files changed, 14 insertions, 13 deletions
diff --git a/src/libipq_compat.c b/src/libipq_compat.c index 9e99674..d263aed 100644 --- a/src/libipq_compat.c +++ b/src/libipq_compat.c @@ -27,8 +27,8 @@ #include <sys/time.h> #include <sys/types.h> -#include "libnfnetlink_queue.h" -#include "libipq.h" +#include <libnfnetlink_queue/libnfnetlink_queue.h> +#include <libnfnetlink_queue/libipq.h> /**************************************************************************** * @@ -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 */ |