From 0c5e5fb15205d1be968d84058d0b91f5c727c454 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 --- include/libnfnetlink_queue/libipq.h | 4 +- include/libnfnetlink_queue/libnfnetlink_queue.h | 53 +++++++++++-------------- 2 files changed, 26 insertions(+), 31 deletions(-) (limited to 'include') diff --git a/include/libnfnetlink_queue/libipq.h b/include/libnfnetlink_queue/libipq.h index 483a514..06c10c1 100644 --- a/include/libnfnetlink_queue/libipq.h +++ b/include/libnfnetlink_queue/libipq.h @@ -52,8 +52,8 @@ typedef unsigned long ipq_id_t; struct ipq_handle { - struct nfqnl_handle nfqnlh; - struct nfqnl_q_handle qh; + struct nfqnl_handle *nfqnlh; + struct nfqnl_q_handle *qh; u_int8_t family; u_int8_t blocking; }; diff --git a/include/libnfnetlink_queue/libnfnetlink_queue.h b/include/libnfnetlink_queue/libnfnetlink_queue.h index b3aad73..b4d6f81 100644 --- a/include/libnfnetlink_queue/libnfnetlink_queue.h +++ b/include/libnfnetlink_queue/libnfnetlink_queue.h @@ -13,39 +13,32 @@ #include #include +struct nfqnl_handle; +struct nfqnl_q_handle; -#define NFQN -struct nfqnl_handle -{ - struct nfnl_handle nfnlh; -}; - -struct nfqnl_q_handle -{ - struct nfqnl_handle *h; - u_int16_t id; -}; - -struct ctnl_msg_handler { - int type; - int (*handler)(struct sockaddr_nl *, struct nlmsghdr *, void *arg); -}; - -struct ctnl_handle { - struct nfnl_handle nfnlh; - struct ctnl_msg_handler *handler[NFQNL_MSG_MAX]; -}; - -extern int nfqnl_open(struct nfqnl_handle *h); +extern int nfqnl_errno; + +extern struct nfnl_handle *nfqnl_nfnlh(struct nfqnl_handle *h); +extern int nfqnl_fd(struct nfqnl_handle *h); + +typedef nfqnl_callback(struct nfqnl_q_handle *gh, struct nfgenmsg *nfmsg, + struct nfattr *nfa[], void *data); + + +extern struct nfqnl_handle *nfqnl_open(void); extern int nfqnl_close(struct nfqnl_handle *h); extern int nfqnl_bind_pf(struct nfqnl_handle *h, u_int16_t pf); extern int nfqnl_unbind_pf(struct nfqnl_handle *h, u_int16_t pf); -extern int nfqnl_create_queue(struct nfqnl_handle *h, - struct nfqnl_q_handle *qh, u_int16_t num); +extern struct nfqnl_q_handle *nfqnl_create_queue(struct nfqnl_handle *h, + u_int16_t num, + nfqnl_callback *cb, + void *data); extern int nfqnl_destroy_queue(struct nfqnl_q_handle *qh); +extern int nfqnl_handle_packet(struct nfqnl_handle *h, char *buf, int len); + extern int nfqnl_set_mode(struct nfqnl_q_handle *qh, u_int8_t mode, unsigned int len); @@ -54,8 +47,10 @@ extern int nfqnl_set_verdict(struct nfqnl_q_handle *qh, u_int32_t verdict, u_int32_t data_len, unsigned char *buf); - -extern int nfqnl_set_verdict_mark(struct nfqnl_q_handle *qh, u_int32_t id, - u_int32_t verdict, u_int32_t mark, - u_int32_t datalen, unsigned char *buf); +extern int nfqnl_set_verdict_mark(struct nfqnl_q_handle *qh, + u_int32_t id, + u_int32_t verdict, + u_int32_t mark, + u_int32_t datalen, + unsigned char *buf); #endif /* __LIBNFQNETLINK_H */ -- cgit v1.2.3