From 541e328689042fb855ac22903996b67b57e1f15a Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Thu, 25 Aug 2011 11:17:33 +0200 Subject: ipset: use NFPROTO_ constants ipset is actually using NFPROTO values rather than AF (xt_set passes that along). --- src/ipset.c | 10 +++++----- src/ipset_bitmap_ip.c | 2 +- src/ipset_bitmap_ipmac.c | 2 +- src/ipset_bitmap_port.c | 2 +- src/ipset_hash_ip.c | 2 +- src/ipset_hash_ipport.c | 2 +- src/ipset_hash_ipportip.c | 2 +- src/ipset_hash_ipportnet.c | 4 ++-- src/ipset_hash_net.c | 4 ++-- src/ipset_hash_netiface.c | 2 +- src/ipset_hash_netport.c | 4 ++-- src/ipset_list_set.c | 2 +- 12 files changed, 19 insertions(+), 19 deletions(-) (limited to 'src') diff --git a/src/ipset.c b/src/ipset.c index 358befe..e835f06 100644 --- a/src/ipset.c +++ b/src/ipset.c @@ -324,9 +324,9 @@ static const char * session_family(void) { switch (ipset_data_family(ipset_session_data(session))) { - case AF_INET: + case NFPROTO_IPV4: return "inet"; - case AF_INET6: + case NFPROTO_IPV6: return "inet6"; default: return "unspec"; @@ -581,10 +581,10 @@ parse_commandline(int argc, char *argv[]) type->name, type->usage); if (type->usagefn) type->usagefn(); - if (type->family == AF_UNSPEC) + if (type->family == NFPROTO_UNSPEC) printf("\nType %s is family neutral.\n", type->name); - else if (type->family == AF_INET46) + else if (type->family == NFPROTO_IPSET_IPV46) printf("\nType %s supports INET " "and INET6.\n", type->name); @@ -592,7 +592,7 @@ parse_commandline(int argc, char *argv[]) printf("\nType %s supports family " "%s only.\n", type->name, - type->family == AF_INET + type->family == NFPROTO_IPV4 ? "INET" : "INET6"); } else { printf("\nSupported set types:\n"); diff --git a/src/ipset_bitmap_ip.c b/src/ipset_bitmap_ip.c index 89f3002..8b8220d 100644 --- a/src/ipset_bitmap_ip.c +++ b/src/ipset_bitmap_ip.c @@ -60,7 +60,7 @@ struct ipset_type ipset_bitmap_ip0 = { .name = "bitmap:ip", .alias = { "ipmap", NULL }, .revision = 0, - .family = AF_INET, + .family = NFPROTO_IPV4, .dimension = IPSET_DIM_ONE, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_bitmap_ipmac.c b/src/ipset_bitmap_ipmac.c index f8f7495..d822bf6 100644 --- a/src/ipset_bitmap_ipmac.c +++ b/src/ipset_bitmap_ipmac.c @@ -57,7 +57,7 @@ struct ipset_type ipset_bitmap_ipmac0 = { .name = "bitmap:ip,mac", .alias = { "macipmap", NULL }, .revision = 0, - .family = AF_INET, + .family = NFPROTO_IPV4, .dimension = IPSET_DIM_TWO, .last_elem_optional = true, .elem = { diff --git a/src/ipset_bitmap_port.c b/src/ipset_bitmap_port.c index 9acdf23..69be809 100644 --- a/src/ipset_bitmap_port.c +++ b/src/ipset_bitmap_port.c @@ -51,7 +51,7 @@ struct ipset_type ipset_bitmap_port0 = { .name = "bitmap:port", .alias = { "portmap", NULL }, .revision = 0, - .family = AF_UNSPEC, + .family = NFPROTO_UNSPEC, .dimension = IPSET_DIM_ONE, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_hash_ip.c b/src/ipset_hash_ip.c index 7be8e19..912b991 100644 --- a/src/ipset_hash_ip.c +++ b/src/ipset_hash_ip.c @@ -83,7 +83,7 @@ struct ipset_type ipset_hash_ip0 = { .name = "hash:ip", .alias = { "iphash", NULL }, .revision = 0, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_ONE, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_hash_ipport.c b/src/ipset_hash_ipport.c index 3738aa4..748e452 100644 --- a/src/ipset_hash_ipport.c +++ b/src/ipset_hash_ipport.c @@ -89,7 +89,7 @@ struct ipset_type ipset_hash_ipport1 = { .name = "hash:ip,port", .alias = { "ipporthash", NULL }, .revision = 1, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_TWO, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_hash_ipportip.c b/src/ipset_hash_ipportip.c index 9a2c44c..7c046a3 100644 --- a/src/ipset_hash_ipportip.c +++ b/src/ipset_hash_ipportip.c @@ -89,7 +89,7 @@ struct ipset_type ipset_hash_ipportip1 = { .name = "hash:ip,port,ip", .alias = { "ipportiphash", NULL }, .revision = 1, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_THREE, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_hash_ipportnet.c b/src/ipset_hash_ipportnet.c index b7415dc..c4cf97e 100644 --- a/src/ipset_hash_ipportnet.c +++ b/src/ipset_hash_ipportnet.c @@ -90,7 +90,7 @@ struct ipset_type ipset_hash_ipportnet1 = { .name = "hash:ip,port,net", .alias = { "ipportnethash", NULL }, .revision = 1, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_THREE, .elem = { [IPSET_DIM_ONE - 1] = { @@ -180,7 +180,7 @@ struct ipset_type ipset_hash_ipportnet2 = { .name = "hash:ip,port,net", .alias = { "ipportnethash", NULL }, .revision = 2, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_THREE, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_hash_net.c b/src/ipset_hash_net.c index 587f891..76269f0 100644 --- a/src/ipset_hash_net.c +++ b/src/ipset_hash_net.c @@ -73,7 +73,7 @@ struct ipset_type ipset_hash_net0 = { .name = "hash:net", .alias = { "nethash", NULL }, .revision = 0, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_ONE, .elem = { [IPSET_DIM_ONE - 1] = { @@ -125,7 +125,7 @@ struct ipset_type ipset_hash_net1 = { .name = "hash:net", .alias = { "nethash", NULL }, .revision = 1, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_ONE, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_hash_netiface.c b/src/ipset_hash_netiface.c index d1f5f7e..51d9cad 100644 --- a/src/ipset_hash_netiface.c +++ b/src/ipset_hash_netiface.c @@ -66,7 +66,7 @@ struct ipset_type ipset_hash_netiface0 = { .name = "hash:net,iface", .alias = { "netifacehash", NULL }, .revision = 0, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_TWO, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_hash_netport.c b/src/ipset_hash_netport.c index acf4a29..af6adf1 100644 --- a/src/ipset_hash_netport.c +++ b/src/ipset_hash_netport.c @@ -67,7 +67,7 @@ struct ipset_type ipset_hash_netport1 = { .name = "hash:net,port", .alias = { "netporthash", NULL }, .revision = 1, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_TWO, .elem = { [IPSET_DIM_ONE - 1] = { @@ -141,7 +141,7 @@ struct ipset_type ipset_hash_netport2 = { .name = "hash:net,port", .alias = { "netporthash", NULL }, .revision = 2, - .family = AF_INET46, + .family = NFPROTO_IPSET_IPV46, .dimension = IPSET_DIM_TWO, .elem = { [IPSET_DIM_ONE - 1] = { diff --git a/src/ipset_list_set.c b/src/ipset_list_set.c index 68616e8..d95290b 100644 --- a/src/ipset_list_set.c +++ b/src/ipset_list_set.c @@ -50,7 +50,7 @@ struct ipset_type ipset_list_set0 = { .name = "list:set", .alias = { "setlist", NULL }, .revision = 0, - .family = AF_UNSPEC, + .family = NFPROTO_UNSPEC, .dimension = IPSET_DIM_ONE, .elem = { [IPSET_DIM_ONE - 1] = { -- cgit v1.2.3