summaryrefslogtreecommitdiffstats
path: root/extensions
diff options
context:
space:
mode:
authorJan Engelhardt <jengelh@medozas.de>2009-01-30 03:55:09 +0100
committerJan Engelhardt <jengelh@medozas.de>2009-01-30 03:55:09 +0100
commite44ea7faa17c10c68f14f5338a7cc6e3291a0ce7 (patch)
tree4240b28def0ad4f7f2e2cdcae935636d26ac8ea7 /extensions
parenta41545ca7cde43e0ba53260ba74bd9bf74025a68 (diff)
libxtables: prefix/order - ipaddr/ipmask to ascii output
Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Diffstat (limited to 'extensions')
-rw-r--r--extensions/libipt_DNAT.c4
-rw-r--r--extensions/libipt_NETMAP.c4
-rw-r--r--extensions/libipt_SAME.c8
-rw-r--r--extensions/libipt_SNAT.c4
-rw-r--r--extensions/libipt_policy.c8
-rw-r--r--extensions/libxt_TPROXY.c4
-rw-r--r--extensions/libxt_conntrack.c14
-rw-r--r--extensions/libxt_iprange.c32
8 files changed, 39 insertions, 39 deletions
diff --git a/extensions/libipt_DNAT.c b/extensions/libipt_DNAT.c
index e884b03e..42695bb4 100644
--- a/extensions/libipt_DNAT.c
+++ b/extensions/libipt_DNAT.c
@@ -195,10 +195,10 @@ static void print_range(const struct ip_nat_range *r)
struct in_addr a;
a.s_addr = r->min_ip;
- printf("%s", ipaddr_to_numeric(&a));
+ printf("%s", xtables_ipaddr_to_numeric(&a));
if (r->max_ip != r->min_ip) {
a.s_addr = r->max_ip;
- printf("-%s", ipaddr_to_numeric(&a));
+ printf("-%s", xtables_ipaddr_to_numeric(&a));
}
}
if (r->flags & IP_NAT_RANGE_PROTO_SPECIFIED) {
diff --git a/extensions/libipt_NETMAP.c b/extensions/libipt_NETMAP.c
index d8f34ccd..33f48c93 100644
--- a/extensions/libipt_NETMAP.c
+++ b/extensions/libipt_NETMAP.c
@@ -148,11 +148,11 @@ static void NETMAP_print(const void *ip, const struct xt_entry_target *target,
int bits;
a.s_addr = r->min_ip;
- printf("%s", ipaddr_to_numeric(&a));
+ printf("%s", xtables_ipaddr_to_numeric(&a));
a.s_addr = ~(r->min_ip ^ r->max_ip);
bits = netmask2bits(a.s_addr);
if (bits < 0)
- printf("/%s", ipaddr_to_numeric(&a));
+ printf("/%s", xtables_ipaddr_to_numeric(&a));
else
printf("/%d", bits);
}
diff --git a/extensions/libipt_SAME.c b/extensions/libipt_SAME.c
index 6cb09afc..1ca38ff8 100644
--- a/extensions/libipt_SAME.c
+++ b/extensions/libipt_SAME.c
@@ -151,13 +151,13 @@ static void SAME_print(const void *ip, const struct xt_entry_target *target,
a.s_addr = r->min_ip;
- printf("%s", ipaddr_to_numeric(&a));
+ printf("%s", xtables_ipaddr_to_numeric(&a));
a.s_addr = r->max_ip;
if (r->min_ip == r->max_ip)
printf(" ");
else
- printf("-%s ", ipaddr_to_numeric(&a));
+ printf("-%s ", xtables_ipaddr_to_numeric(&a));
if (r->flags & IP_NAT_RANGE_PROTO_RANDOM)
random_selection = 1;
}
@@ -181,13 +181,13 @@ static void SAME_save(const void *ip, const struct xt_entry_target *target)
struct in_addr a;
a.s_addr = r->min_ip;
- printf("--to %s", ipaddr_to_numeric(&a));
+ printf("--to %s", xtables_ipaddr_to_numeric(&a));
a.s_addr = r->max_ip;
if (r->min_ip == r->max_ip)
printf(" ");
else
- printf("-%s ", ipaddr_to_numeric(&a));
+ printf("-%s ", xtables_ipaddr_to_numeric(&a));
if (r->flags & IP_NAT_RANGE_PROTO_RANDOM)
random_selection = 1;
}
diff --git a/extensions/libipt_SNAT.c b/extensions/libipt_SNAT.c
index 8c28c0ee..2afcbb1e 100644
--- a/extensions/libipt_SNAT.c
+++ b/extensions/libipt_SNAT.c
@@ -196,10 +196,10 @@ static void print_range(const struct ip_nat_range *r)
struct in_addr a;
a.s_addr = r->min_ip;
- printf("%s", ipaddr_to_numeric(&a));
+ printf("%s", xtables_ipaddr_to_numeric(&a));
if (r->max_ip != r->min_ip) {
a.s_addr = r->max_ip;
- printf("-%s", ipaddr_to_numeric(&a));
+ printf("-%s", xtables_ipaddr_to_numeric(&a));
}
}
if (r->flags & IP_NAT_RANGE_PROTO_SPECIFIED) {
diff --git a/extensions/libipt_policy.c b/extensions/libipt_policy.c
index 9c701820..6b044d87 100644
--- a/extensions/libipt_policy.c
+++ b/extensions/libipt_policy.c
@@ -352,14 +352,14 @@ static void print_entry(char *prefix, const struct ipt_policy_elem *e,
if (e->match.daddr) {
PRINT_INVERT(e->invert.daddr);
printf("%stunnel-dst %s%s ", prefix,
- ipaddr_to_numeric((const void *)&e->daddr),
- ipmask_to_numeric((const void *)&e->dmask));
+ xtables_ipaddr_to_numeric((const void *)&e->daddr),
+ xtables_ipmask_to_numeric((const void *)&e->dmask));
}
if (e->match.saddr) {
PRINT_INVERT(e->invert.saddr);
printf("%stunnel-src %s%s ", prefix,
- ipaddr_to_numeric((const void *)&e->saddr),
- ipmask_to_numeric((const void *)&e->smask));
+ xtables_ipaddr_to_numeric((const void *)&e->saddr),
+ xtables_ipmask_to_numeric((const void *)&e->smask));
}
}
diff --git a/extensions/libxt_TPROXY.c b/extensions/libxt_TPROXY.c
index d0933aef..2398c849 100644
--- a/extensions/libxt_TPROXY.c
+++ b/extensions/libxt_TPROXY.c
@@ -114,7 +114,7 @@ static void tproxy_tg_print(const void *ip, const struct xt_entry_target *target
{
const struct xt_tproxy_target_info *info = (const void *)target->data;
printf("TPROXY redirect %s:%u mark 0x%x/0x%x",
- ipaddr_to_numeric((const struct in_addr *)&info->laddr),
+ xtables_ipaddr_to_numeric((const struct in_addr *)&info->laddr),
ntohs(info->lport), (unsigned int)info->mark_value,
(unsigned int)info->mark_mask);
}
@@ -125,7 +125,7 @@ static void tproxy_tg_save(const void *ip, const struct xt_entry_target *target)
printf("--on-port %u ", ntohs(info->lport));
printf("--on-ip %s ",
- ipaddr_to_numeric((const struct in_addr *)&info->laddr));
+ xtables_ipaddr_to_numeric((const struct in_addr *)&info->laddr));
printf("--tproxy-mark 0x%x/0x%x ",
(unsigned int)info->mark_value, (unsigned int)info->mark_mask);
}
diff --git a/extensions/libxt_conntrack.c b/extensions/libxt_conntrack.c
index facd0fc2..ffa279ca 100644
--- a/extensions/libxt_conntrack.c
+++ b/extensions/libxt_conntrack.c
@@ -761,9 +761,9 @@ conntrack_dump_addr(const union nf_inet_addr *addr,
return;
}
if (numeric)
- printf("%s ", ipaddr_to_numeric(&addr->in));
+ printf("%s ", xtables_ipaddr_to_numeric(&addr->in));
else
- printf("%s ", ipaddr_to_anyname(&addr->in));
+ printf("%s ", xtables_ipaddr_to_anyname(&addr->in));
} else if (family == NFPROTO_IPV6) {
if (!numeric && addr->ip6[0] == 0 && addr->ip6[1] == 0 &&
addr->ip6[2] == 0 && addr->ip6[3] == 0) {
@@ -771,9 +771,9 @@ conntrack_dump_addr(const union nf_inet_addr *addr,
return;
}
if (numeric)
- printf("%s ", ip6addr_to_numeric(&addr->in6));
+ printf("%s ", xtables_ip6addr_to_numeric(&addr->in6));
else
- printf("%s ", ip6addr_to_anyname(&addr->in6));
+ printf("%s ", xtables_ip6addr_to_anyname(&addr->in6));
}
}
@@ -789,10 +789,10 @@ print_addr(struct in_addr *addr, struct in_addr *mask, int inv, int numeric)
printf("%s ", "anywhere");
else {
if (numeric)
- sprintf(buf, "%s", ipaddr_to_numeric(addr));
+ strcpy(buf, xtables_ipaddr_to_numeric(addr));
else
- sprintf(buf, "%s", ipaddr_to_anyname(addr));
- strcat(buf, ipmask_to_numeric(mask));
+ strcpy(buf, xtables_ipaddr_to_anyname(addr));
+ strcat(buf, xtables_ipmask_to_numeric(mask));
printf("%s ", buf);
}
}
diff --git a/extensions/libxt_iprange.c b/extensions/libxt_iprange.c
index 0fe2b4f0..9fdc70a6 100644
--- a/extensions/libxt_iprange.c
+++ b/extensions/libxt_iprange.c
@@ -250,15 +250,15 @@ iprange_mt4_print(const void *ip, const struct xt_entry_match *match,
* ipaddr_to_numeric() uses a static buffer, so cannot
* combine the printf() calls.
*/
- printf("%s", ipaddr_to_numeric(&info->src_min.in));
- printf("-%s ", ipaddr_to_numeric(&info->src_max.in));
+ printf("%s", xtables_ipaddr_to_numeric(&info->src_min.in));
+ printf("-%s ", xtables_ipaddr_to_numeric(&info->src_max.in));
}
if (info->flags & IPRANGE_DST) {
printf("destination IP range ");
if (info->flags & IPRANGE_DST_INV)
printf("! ");
- printf("%s", ipaddr_to_numeric(&info->dst_min.in));
- printf("-%s ", ipaddr_to_numeric(&info->dst_max.in));
+ printf("%s", xtables_ipaddr_to_numeric(&info->dst_min.in));
+ printf("-%s ", xtables_ipaddr_to_numeric(&info->dst_max.in));
}
}
@@ -276,15 +276,15 @@ iprange_mt6_print(const void *ip, const struct xt_entry_match *match,
* ipaddr_to_numeric() uses a static buffer, so cannot
* combine the printf() calls.
*/
- printf("%s", ip6addr_to_numeric(&info->src_min.in6));
- printf("-%s ", ip6addr_to_numeric(&info->src_max.in6));
+ printf("%s", xtables_ip6addr_to_numeric(&info->src_min.in6));
+ printf("-%s ", xtables_ip6addr_to_numeric(&info->src_max.in6));
}
if (info->flags & IPRANGE_DST) {
printf("destination IP range ");
if (info->flags & IPRANGE_DST_INV)
printf("! ");
- printf("%s", ip6addr_to_numeric(&info->dst_min.in6));
- printf("-%s ", ip6addr_to_numeric(&info->dst_max.in6));
+ printf("%s", xtables_ip6addr_to_numeric(&info->dst_min.in6));
+ printf("-%s ", xtables_ip6addr_to_numeric(&info->dst_max.in6));
}
}
@@ -315,14 +315,14 @@ static void iprange_mt4_save(const void *ip, const struct xt_entry_match *match)
if (info->flags & IPRANGE_SRC) {
if (info->flags & IPRANGE_SRC_INV)
printf("! ");
- printf("--src-range %s", ipaddr_to_numeric(&info->src_min.in));
- printf("-%s ", ipaddr_to_numeric(&info->src_max.in));
+ printf("--src-range %s", xtables_ipaddr_to_numeric(&info->src_min.in));
+ printf("-%s ", xtables_ipaddr_to_numeric(&info->src_max.in));
}
if (info->flags & IPRANGE_DST) {
if (info->flags & IPRANGE_DST_INV)
printf("! ");
- printf("--dst-range %s", ipaddr_to_numeric(&info->dst_min.in));
- printf("-%s ", ipaddr_to_numeric(&info->dst_max.in));
+ printf("--dst-range %s", xtables_ipaddr_to_numeric(&info->dst_min.in));
+ printf("-%s ", xtables_ipaddr_to_numeric(&info->dst_max.in));
}
}
@@ -333,14 +333,14 @@ static void iprange_mt6_save(const void *ip, const struct xt_entry_match *match)
if (info->flags & IPRANGE_SRC) {
if (info->flags & IPRANGE_SRC_INV)
printf("! ");
- printf("--src-range %s", ip6addr_to_numeric(&info->src_min.in6));
- printf("-%s ", ip6addr_to_numeric(&info->src_max.in6));
+ printf("--src-range %s", xtables_ip6addr_to_numeric(&info->src_min.in6));
+ printf("-%s ", xtables_ip6addr_to_numeric(&info->src_max.in6));
}
if (info->flags & IPRANGE_DST) {
if (info->flags & IPRANGE_DST_INV)
printf("! ");
- printf("--dst-range %s", ip6addr_to_numeric(&info->dst_min.in6));
- printf("-%s ", ip6addr_to_numeric(&info->dst_max.in6));
+ printf("--dst-range %s", xtables_ip6addr_to_numeric(&info->dst_min.in6));
+ printf("-%s ", xtables_ip6addr_to_numeric(&info->dst_max.in6));
}
}