From 61a5ea46c92ecc1533240e3fd1aa2f51b25dc81f 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: Sat, 5 Nov 2005 10:00:43 +0000 Subject: use nflog_fd() instead of netlink based function --- utils/nfulnl_test.c | 21 +-------------------- 1 file changed, 1 insertion(+), 20 deletions(-) diff --git a/utils/nfulnl_test.c b/utils/nfulnl_test.c index a41d7a6..69245df 100644 --- a/utils/nfulnl_test.c +++ b/utils/nfulnl_test.c @@ -63,7 +63,6 @@ int main(int argc, char **argv) struct nflog_handle *h; struct nflog_g_handle *qh; struct nflog_g_handle *qh100; - struct nfnl_handle *nh; int rv, fd; char buf[4096]; @@ -104,8 +103,7 @@ int main(int argc, char **argv) exit(1); } - nh = nflog_nfnlh(h); - fd = nfnl_fd(nh); + fd = nflog_fd(h); printf("registering callback for group 0\n"); nflog_callback_register(qh, &cb, NULL); @@ -115,25 +113,8 @@ int main(int argc, char **argv) struct nlmsghdr *nlh; printf("pkt received (len=%u)\n", rv); -#if 0 - for (nlh = nfnl_get_msg_first(nh, buf, rv); - nlh; nlh = nfnl_get_msg_next(nh, buf, rv)) { - struct nfattr *tb[NFULA_MAX]; - struct nfgenmsg *nfmsg; - - printf("msg received: "); - nfnl_parse_hdr(nh, nlh, &nfmsg); - rv = nfnl_parse_attr(tb, NFULA_MAX, NFM_NFA(NLMSG_DATA(nlh)), nlh->nlmsg_len-NLMSG_ALIGN(sizeof(struct nfgenmsg))); - if (rv < 0) { - printf("error during parse: %d\n", rv); - break; - } - print_pkt(tb); - } -#else /* handle messages in just-received packet */ nflog_handle_packet(h, buf, rv); -#endif } printf("unbinding from group 100\n"); -- cgit v1.2.3