summaryrefslogtreecommitdiffstats
path: root/extensions/libxt_iprange.c
diff options
context:
space:
mode:
Diffstat (limited to 'extensions/libxt_iprange.c')
-rw-r--r--extensions/libxt_iprange.c80
1 files changed, 40 insertions, 40 deletions
diff --git a/extensions/libxt_iprange.c b/extensions/libxt_iprange.c
index 09e9fb7f..df6be14f 100644
--- a/extensions/libxt_iprange.c
+++ b/extensions/libxt_iprange.c
@@ -40,14 +40,14 @@ parse_iprange(char *arg, struct ipt_iprange *range)
if (dash != NULL)
*dash = '\0';
- ip = numeric_to_ipaddr(arg);
+ ip = xtables_numeric_to_ipaddr(arg);
if (!ip)
exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n",
arg);
range->min_ip = ip->s_addr;
if (dash != NULL) {
- ip = numeric_to_ipaddr(dash+1);
+ ip = xtables_numeric_to_ipaddr(dash+1);
if (!ip)
exit_error(PARAMETER_PROBLEM, "iprange match: Bad IP address `%s'\n",
dash+1);
@@ -70,7 +70,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
*flags |= IPRANGE_SRC;
info->flags |= IPRANGE_SRC;
- check_inverse(optarg, &invert, &optind, 0);
+ xtables_check_inverse(optarg, &invert, &optind, 0);
if (invert)
info->flags |= IPRANGE_SRC_INV;
parse_iprange(optarg, &info->src);
@@ -84,7 +84,7 @@ static int iprange_parse(int c, char **argv, int invert, unsigned int *flags,
*flags |= IPRANGE_DST;
info->flags |= IPRANGE_DST;
- check_inverse(optarg, &invert, &optind, 0);
+ xtables_check_inverse(optarg, &invert, &optind, 0);
if (invert)
info->flags |= IPRANGE_DST_INV;
@@ -110,15 +110,15 @@ iprange_mt4_parse(int c, char **argv, int invert, unsigned int *flags,
case '1': /* --src-range */
end = strchr(optarg, '-');
if (end == NULL)
- param_act(P_BAD_VALUE, "iprange", "--src-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--src-range", optarg);
*end = '\0';
- ia = numeric_to_ipaddr(optarg);
+ ia = xtables_numeric_to_ipaddr(optarg);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--src-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--src-range", optarg);
memcpy(&info->src_min.in, ia, sizeof(*ia));
- ia = numeric_to_ipaddr(end+1);
+ ia = xtables_numeric_to_ipaddr(end+1);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--src-range", end + 1);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--src-range", end + 1);
memcpy(&info->src_max.in, ia, sizeof(*ia));
info->flags |= IPRANGE_SRC;
if (invert)
@@ -129,15 +129,15 @@ iprange_mt4_parse(int c, char **argv, int invert, unsigned int *flags,
case '2': /* --dst-range */
end = strchr(optarg, '-');
if (end == NULL)
- param_act(P_BAD_VALUE, "iprange", "--dst-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--dst-range", optarg);
*end = '\0';
- ia = numeric_to_ipaddr(optarg);
+ ia = xtables_numeric_to_ipaddr(optarg);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--dst-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--dst-range", optarg);
memcpy(&info->dst_min.in, ia, sizeof(*ia));
- ia = numeric_to_ipaddr(end + 1);
+ ia = xtables_numeric_to_ipaddr(end + 1);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--dst-range", end + 1);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--dst-range", end + 1);
memcpy(&info->dst_max.in, ia, sizeof(*ia));
info->flags |= IPRANGE_DST;
if (invert)
@@ -160,15 +160,15 @@ iprange_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
case '1': /* --src-range */
end = strchr(optarg, '-');
if (end == NULL)
- param_act(P_BAD_VALUE, "iprange", "--src-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--src-range", optarg);
*end = '\0';
- ia = numeric_to_ip6addr(optarg);
+ ia = xtables_numeric_to_ip6addr(optarg);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--src-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--src-range", optarg);
memcpy(&info->src_min.in, ia, sizeof(*ia));
- ia = numeric_to_ip6addr(end+1);
+ ia = xtables_numeric_to_ip6addr(end+1);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--src-range", end + 1);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--src-range", end + 1);
memcpy(&info->src_max.in, ia, sizeof(*ia));
info->flags |= IPRANGE_SRC;
if (invert)
@@ -179,15 +179,15 @@ iprange_mt6_parse(int c, char **argv, int invert, unsigned int *flags,
case '2': /* --dst-range */
end = strchr(optarg, '-');
if (end == NULL)
- param_act(P_BAD_VALUE, "iprange", "--dst-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--dst-range", optarg);
*end = '\0';
- ia = numeric_to_ip6addr(optarg);
+ ia = xtables_numeric_to_ip6addr(optarg);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--dst-range", optarg);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--dst-range", optarg);
memcpy(&info->dst_min.in, ia, sizeof(*ia));
- ia = numeric_to_ip6addr(end + 1);
+ ia = xtables_numeric_to_ip6addr(end + 1);
if (ia == NULL)
- param_act(P_BAD_VALUE, "iprange", "--dst-range", end + 1);
+ xtables_param_act(XTF_BAD_VALUE, "iprange", "--dst-range", end + 1);
memcpy(&info->dst_max.in, ia, sizeof(*ia));
info->flags |= IPRANGE_DST;
if (invert)
@@ -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));
}
}