summaryrefslogtreecommitdiffstats
path: root/extensions/libip6t_MARK.c
diff options
context:
space:
mode:
authorlaforge <laforge>2003-09-05 12:53:44 +0000
committerlaforge <laforge>2003-09-05 12:53:44 +0000
commit3b8dbd278643334bfd8acf6dbff01b0fc7f450e5 (patch)
treeca0db0cd87d91a343a36067cb13b217a2671dbd1 /extensions/libip6t_MARK.c
parent4abd12e99de97bf84a64ec790e84d990e8c8c7c2 (diff)
1- printf() simplifications, 2- indentation fixes, 3- C99 initializers. (Stephane Ouellette)
Diffstat (limited to 'extensions/libip6t_MARK.c')
-rw-r--r--extensions/libip6t_MARK.c44
1 files changed, 16 insertions, 28 deletions
diff --git a/extensions/libip6t_MARK.c b/extensions/libip6t_MARK.c
index 6062a39..292f957 100644
--- a/extensions/libip6t_MARK.c
+++ b/extensions/libip6t_MARK.c
@@ -8,11 +8,6 @@
#include <linux/netfilter_ipv6/ip6_tables.h>
#include <linux/netfilter_ipv6/ip6t_MARK.h>
-struct markinfo {
- struct ip6t_entry_target t;
- struct ip6t_mark_target_info mark;
-};
-
/* Function which prints out usage message. */
static void
help(void)
@@ -25,8 +20,8 @@ IPTABLES_VERSION);
}
static struct option opts[] = {
- { "set-mark", 1, 0, '1' },
- { 0 }
+ { .name = "set-mark", .has_arg = 1, .flag = 0, .val = '1' },
+ { .name = 0 }
};
/* Initialize the target. */
@@ -72,12 +67,6 @@ final_check(unsigned int flags)
"MARK target: Parameter --set-mark is required");
}
-static void
-print_mark(unsigned long mark, int numeric)
-{
- printf("0x%lx ", mark);
-}
-
/* Prints out the targinfo. */
static void
print(const struct ip6t_ip6 *ip,
@@ -86,8 +75,8 @@ print(const struct ip6t_ip6 *ip,
{
const struct ip6t_mark_target_info *markinfo =
(const struct ip6t_mark_target_info *)target->data;
- printf("MARK set ");
- print_mark(markinfo->mark, numeric);
+
+ printf("MARK set 0x%lx ", markinfo->mark);
}
/* Saves the union ipt_targinfo in parsable form to stdout. */
@@ -101,19 +90,18 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
}
static
-struct ip6tables_target mark
-= { NULL,
- "MARK",
- IPTABLES_VERSION,
- IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
- IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
- &help,
- &init,
- &parse,
- &final_check,
- &print,
- &save,
- opts
+struct ip6tables_target mark = {
+ .name = "MARK",
+ .version = IPTABLES_VERSION,
+ .size = IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
+ .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_mark_target_info)),
+ .help = &help,
+ .init = &init,
+ .parse = &parse,
+ .final_check = &final_check,
+ .print = &print,
+ .save = &save,
+ .extra_opts = opts
};
void _init(void)