summaryrefslogtreecommitdiffstats
path: root/utils
diff options
context:
space:
mode:
Diffstat (limited to 'utils')
-rw-r--r--utils/nfulnl_test.c40
1 files changed, 20 insertions, 20 deletions
diff --git a/utils/nfulnl_test.c b/utils/nfulnl_test.c
index d0d4414..a41d7a6 100644
--- a/utils/nfulnl_test.c
+++ b/utils/nfulnl_test.c
@@ -51,7 +51,7 @@ static int print_pkt(struct nfattr *tb[])
return 0;
}
-static int cb(struct nfulnl_g_handle *gh, struct nfgenmsg *nfmsg,
+static int cb(struct nflog_g_handle *gh, struct nfgenmsg *nfmsg,
struct nfattr *nfa[], void *data)
{
print_pkt(nfa);
@@ -60,55 +60,55 @@ static int cb(struct nfulnl_g_handle *gh, struct nfgenmsg *nfmsg,
int main(int argc, char **argv)
{
- struct nfulnl_handle *h;
- struct nfulnl_g_handle *qh;
- struct nfulnl_g_handle *qh100;
+ struct nflog_handle *h;
+ struct nflog_g_handle *qh;
+ struct nflog_g_handle *qh100;
struct nfnl_handle *nh;
int rv, fd;
char buf[4096];
- h = nfulnl_open();
+ h = nflog_open();
if (!h) {
- fprintf(stderr, "error during nfulnl_open()\n");
+ fprintf(stderr, "error during nflog_open()\n");
exit(1);
}
printf("unbinding existing nf_log handler for AF_INET (if any)\n");
- if (nfulnl_unbind_pf(h, AF_INET) < 0) {
- fprintf(stderr, "error nfulnl_unbind_pf()\n");
+ if (nflog_unbind_pf(h, AF_INET) < 0) {
+ fprintf(stderr, "error nflog_unbind_pf()\n");
exit(1);
}
printf("binding nfnetlink_log to AF_INET\n");
- if (nfulnl_bind_pf(h, AF_INET) < 0) {
- fprintf(stderr, "error during nfulnl_bind_pf()\n");
+ if (nflog_bind_pf(h, AF_INET) < 0) {
+ fprintf(stderr, "error during nflog_bind_pf()\n");
exit(1);
}
printf("binding this socket to group 0\n");
- qh = nfulnl_bind_group(h, 0);
+ qh = nflog_bind_group(h, 0);
if (!qh) {
fprintf(stderr, "no handle for grup 0\n");
exit(1);
}
printf("binding this socket to group 100\n");
- qh100 = nfulnl_bind_group(h, 100);
+ qh100 = nflog_bind_group(h, 100);
if (!qh100) {
fprintf(stderr, "no handle for group 100\n");
exit(1);
}
printf("setting copy_packet mode\n");
- if (nfulnl_set_mode(qh, NFULNL_COPY_PACKET, 0xffff) < 0) {
+ if (nflog_set_mode(qh, NFULNL_COPY_PACKET, 0xffff) < 0) {
fprintf(stderr, "can't set packet copy mode\n");
exit(1);
}
- nh = nfulnl_nfnlh(h);
+ nh = nflog_nfnlh(h);
fd = nfnl_fd(nh);
printf("registering callback for group 0\n");
- nfulnl_callback_register(qh, &cb, NULL);
+ nflog_callback_register(qh, &cb, NULL);
printf("going into main loop\n");
while ((rv = recv(fd, buf, sizeof(buf), 0)) && rv >= 0) {
@@ -132,24 +132,24 @@ int main(int argc, char **argv)
}
#else
/* handle messages in just-received packet */
- nfulnl_handle_packet(h, buf, rv);
+ nflog_handle_packet(h, buf, rv);
#endif
}
printf("unbinding from group 100\n");
- nfulnl_unbind_group(qh100);
+ nflog_unbind_group(qh100);
printf("unbinding from group 0\n");
- nfulnl_unbind_group(qh);
+ nflog_unbind_group(qh);
#ifdef INSANE
/* norally, applications SHOULD NOT issue this command,
* since it detaches other programs/sockets from AF_INET, too ! */
printf("unbinding from AF_INET\n");
- nfulnl_unbind_pf(h, AF_INET);
+ nflog_unbind_pf(h, AF_INET);
#endif
printf("closing handle\n");
- nfulnl_close(h);
+ nflog_close(h);
exit(0);
}