* Addrtype match: renaming functions
@ 2007-10-03 15:49 Laszlo Attila Toth
2007-10-04 5:00 ` Patrick McHardy
0 siblings, 1 reply; 4+ messages in thread
From: Laszlo Attila Toth @ 2007-10-03 15:49 UTC (permalink / raw)
To: netfilter-devel
Hello,
The function names in libipt_addrtype.c makes debugging hard, also I renamed them
prefixed by 'addrtype_'.
Regards,
Laszlo attila toth
Index: extensions/libipt_addrtype.c
===================================================================
--- extensions/libipt_addrtype.c (revision 7051)
+++ extensions/libipt_addrtype.c (working copy)
@@ -28,7 +28,7 @@
NULL
};
-static void help_types(void)
+static void addrtype_help_types(void)
{
int i;
@@ -36,7 +36,7 @@
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 @@
"\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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
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 @@
.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
};
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Addrtype match: renaming functions
2007-10-03 15:49 Addrtype match: renaming functions Laszlo Attila Toth
@ 2007-10-04 5:00 ` Patrick McHardy
2007-10-04 6:05 ` Jan Engelhardt
0 siblings, 1 reply; 4+ messages in thread
From: Patrick McHardy @ 2007-10-04 5:00 UTC (permalink / raw)
To: Laszlo Attila Toth; +Cc: netfilter-devel
Laszlo Attila Toth wrote:
> Hello,
>
> The function names in libipt_addrtype.c makes debugging hard, also I renamed them
> prefixed by 'addrtype_'.
Applied, thanks Laszlo.
> @@ -191,11 +191,11 @@
> .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,
Just a hint for future patches: the & is not required, I personally
prefer to omit them. Not worth sending another patch though.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Addrtype match: renaming functions
2007-10-04 5:00 ` Patrick McHardy
@ 2007-10-04 6:05 ` Jan Engelhardt
2007-10-04 8:22 ` Laszlo Attila Toth
0 siblings, 1 reply; 4+ messages in thread
From: Jan Engelhardt @ 2007-10-04 6:05 UTC (permalink / raw)
To: Patrick McHardy; +Cc: Laszlo Attila Toth, netfilter-devel
On Oct 4 2007 07:00, Patrick McHardy wrote:
>Laszlo Attila Toth wrote:
>> Hello,
>>
>> The function names in libipt_addrtype.c makes debugging hard, also I renamed them
>> prefixed by 'addrtype_'.
>
>Applied, thanks Laszlo.
I went through changing all modules in this regard, patches coming later today
when I finally woke up.
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: Addrtype match: renaming functions
2007-10-04 6:05 ` Jan Engelhardt
@ 2007-10-04 8:22 ` Laszlo Attila Toth
0 siblings, 0 replies; 4+ messages in thread
From: Laszlo Attila Toth @ 2007-10-04 8:22 UTC (permalink / raw)
To: Jan Engelhardt; +Cc: netfilter-devel
Jan Engelhardt írta:
> On Oct 4 2007 07:00, Patrick McHardy wrote:
>> Laszlo Attila Toth wrote:
>>> Hello,
>>>
>>> The function names in libipt_addrtype.c makes debugging hard, also I renamed them
>>> prefixed by 'addrtype_'.
>> Applied, thanks Laszlo.
>
> I went through changing all modules in this regard, patches coming later today
> when I finally woke up.
>
Hm, I wanted to do the same :) Could you remove the & chars too? Now it
exists in some modules and doesn't in others.
--
Attila
-
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2007-10-04 8:22 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-03 15:49 Addrtype match: renaming functions Laszlo Attila Toth
2007-10-04 5:00 ` Patrick McHardy
2007-10-04 6:05 ` Jan Engelhardt
2007-10-04 8:22 ` Laszlo Attila Toth
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).