diff options
author | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-07-18 19:08:02 +0200 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2013-07-18 19:08:02 +0200 |
commit | 268532705150893cef4bdb4cb74f1c883c481652 (patch) | |
tree | 7b2410f447edfbb7fff046e95f1067bdbdc5770d /examples/nft-rule-del.c | |
parent | 44f28bc3b65b94b41aa58190ae7fe4c8dd1016e0 (diff) |
examples: add arp support
While at it, convert all examples to use NFPROTO_*.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples/nft-rule-del.c')
-rw-r--r-- | examples/nft-rule-del.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/examples/nft-rule-del.c b/examples/nft-rule-del.c index 5ddfd50..c2b1a70 100644 --- a/examples/nft-rule-del.c +++ b/examples/nft-rule-del.c @@ -15,6 +15,7 @@ #include <stddef.h> /* for offsetof */ #include <netinet/in.h> +#include <linux/netfilter.h> #include <linux/netfilter/nf_tables.h> #include <libmnl/libmnl.h> @@ -42,13 +43,15 @@ int main(int argc, char *argv[]) } if (strcmp(argv[1], "ip") == 0) - family = AF_INET; + family = NFPROTO_IPV4; else if (strcmp(argv[1], "ip6") == 0) - family = AF_INET6; + family = NFPROTO_IPV6; else if (strcmp(argv[1], "bridge") == 0) - family = AF_BRIDGE; + family = NFPROTO_BRIDGE; + else if (strcmp(argv[1], "arp") == 0) + family = NFPROTO_ARP; else { - fprintf(stderr, "Unknown family: ip, ip6, bridge\n"); + fprintf(stderr, "Unknown family: ip, ip6, bridge, arp\n"); exit(EXIT_FAILURE); } |