summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--extensions/libipt_addrtype.c46
1 files changed, 23 insertions, 23 deletions
diff --git a/extensions/libipt_addrtype.c b/extensions/libipt_addrtype.c
index 2036ed9b..aefc6d6d 100644
--- a/extensions/libipt_addrtype.c
+++ b/extensions/libipt_addrtype.c
@@ -28,7 +28,7 @@ static const char *const rtn_names[] = {
NULL
};
-static void help_types(void)
+static void addrtype_help_types(void)
{
int i;
@@ -36,7 +36,7 @@ static void help_types(void)
printf(" %s\n", rtn_names[i]);
}
-static void help(void)
+static void addrtype_help(void)
{
printf(
"Address type match v%s options:\n"
@@ -45,11 +45,11 @@ static void help(void)
"\n"
"Valid types: \n"
, IPTABLES_VERSION);
- help_types();
+ addrtype_help_types();
}
static int
-parse_type(const char *name, size_t strlen, u_int16_t *mask)
+addrtype_parse_type(const char *name, size_t strlen, u_int16_t *mask)
{
int i;
@@ -63,25 +63,25 @@ parse_type(const char *name, size_t strlen, u_int16_t *mask)
return 0;
}
-static void parse_types(const char *arg, u_int16_t *mask)
+static void addrtype_parse_types(const char *arg, u_int16_t *mask)
{
const char *comma;
while ((comma = strchr(arg, ',')) != NULL) {
- if (comma == arg || !parse_type(arg, comma-arg, mask))
+ if (comma == arg || !addrtype_parse_type(arg, comma-arg, mask))
exit_error(PARAMETER_PROBLEM,
"addrtype: bad type `%s'", arg);
arg = comma + 1;
}
- if (strlen(arg) == 0 || !parse_type(arg, strlen(arg), mask))
+ if (strlen(arg) == 0 || !addrtype_parse_type(arg, strlen(arg), mask))
exit_error(PARAMETER_PROBLEM, "addrtype: bad type `%s'", arg);
}
#define IPT_ADDRTYPE_OPT_SRCTYPE 0x1
#define IPT_ADDRTYPE_OPT_DSTTYPE 0x2
-static int parse(int c, char **argv, int invert, unsigned int *flags,
+static int addrtype_parse(int c, char **argv, int invert, unsigned int *flags,
const void *entry,
struct xt_entry_match **match)
{
@@ -94,7 +94,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
exit_error(PARAMETER_PROBLEM,
"addrtype: can't specify src-type twice");
check_inverse(optarg, &invert, &optind, 0);
- parse_types(argv[optind-1], &info->source);
+ addrtype_parse_types(argv[optind-1], &info->source);
if (invert)
info->invert_source = 1;
*flags |= IPT_ADDRTYPE_OPT_SRCTYPE;
@@ -104,7 +104,7 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
exit_error(PARAMETER_PROBLEM,
"addrtype: can't specify dst-type twice");
check_inverse(optarg, &invert, &optind, 0);
- parse_types(argv[optind-1], &info->dest);
+ addrtype_parse_types(argv[optind-1], &info->dest);
if (invert)
info->invert_dest = 1;
*flags |= IPT_ADDRTYPE_OPT_DSTTYPE;
@@ -116,14 +116,14 @@ static int parse(int c, char **argv, int invert, unsigned int *flags,
return 1;
}
-static void final_check(unsigned int flags)
+static void addrtype_final_check(unsigned int flags)
{
if (!(flags & (IPT_ADDRTYPE_OPT_SRCTYPE|IPT_ADDRTYPE_OPT_DSTTYPE)))
exit_error(PARAMETER_PROBLEM,
"addrtype: you must specify --src-type or --dst-type");
}
-static void print_types(u_int16_t mask)
+static void addrtype_print_types(u_int16_t mask)
{
const char *sep = "";
int i;
@@ -137,7 +137,7 @@ static void print_types(u_int16_t mask)
printf(" ");
}
-static void print(const void *ip,
+static void addrtype_print(const void *ip,
const struct xt_entry_match *match,
int numeric)
{
@@ -149,17 +149,17 @@ static void print(const void *ip,
printf("src-type ");
if (info->invert_source)
printf("!");
- print_types(info->source);
+ addrtype_print_types(info->source);
}
if (info->dest) {
printf("dst-type ");
if (info->invert_dest)
printf("!");
- print_types(info->dest);
+ addrtype_print_types(info->dest);
}
}
-static void save(const void *ip,
+static void addrtype_save(const void *ip,
const struct xt_entry_match *match)
{
const struct ipt_addrtype_info *info =
@@ -169,13 +169,13 @@ static void save(const void *ip,
printf("--src-type ");
if (info->invert_source)
printf("! ");
- print_types(info->source);
+ addrtype_print_types(info->source);
}
if (info->dest) {
printf("--dst-type ");
if (info->invert_dest)
printf("! ");
- print_types(info->dest);
+ addrtype_print_types(info->dest);
}
}
@@ -191,11 +191,11 @@ struct iptables_match addrtype = {
.version = IPTABLES_VERSION,
.size = IPT_ALIGN(sizeof(struct ipt_addrtype_info)),
.userspacesize = IPT_ALIGN(sizeof(struct ipt_addrtype_info)),
- .help = &help,
- .parse = &parse,
- .final_check = &final_check,
- .print = &print,
- .save = &save,
+ .help = &addrtype_help,
+ .parse = &addrtype_parse,
+ .final_check = &addrtype_final_check,
+ .print = &addrtype_print,
+ .save = &addrtype_save,
.extra_opts = opts
};