]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
remove unused variable and move to c99 initializers (Stephane Ouellette)
authorStephane Ouellette <ouellettes@videotron.ca>
Mon, 11 Aug 2003 19:58:56 +0000 (19:58 +0000)
committerHarald Welte <laforge@gnumonks.org>
Mon, 11 Aug 2003 19:58:56 +0000 (19:58 +0000)
extensions/libip6t_LOG.c
extensions/libipt_LOG.c

index 4a87946f513a1c26ea3ba877f7f074d5720a6d14..997e4393c59b30eb51a51f1c391ac5f3aa405666 100644 (file)
@@ -26,12 +26,12 @@ IPTABLES_VERSION);
 }
 
 static struct option opts[] = {
-       { "log-level", 1, 0, '!' },
-       { "log-prefix", 1, 0, '#' },
-       { "log-tcp-sequence", 0, 0, '1' },
-       { "log-tcp-options", 0, 0, '2' },
-       { "log-ip-options", 0, 0, '3' },
-       { 0 }
+       { .name = "log-level",        .has_arg = 1, .flag = 0, .val = '!' },
+       { .name = "log-prefix",       .has_arg = 1, .flag = 0, .val = '#' },
+       { .name = "log-tcp-sequence", .has_arg = 0, .flag = 0, .val = '1' },
+       { .name = "log-tcp-options",  .has_arg = 0, .flag = 0, .val = '2' },
+       { .name = "log-ip-options",   .has_arg = 0, .flag = 0, .val = '3' },
+       { .name = 0 }
 };
 
 /* Initialize the target. */
@@ -52,15 +52,15 @@ struct ip6t_log_names {
 };
 
 static struct ip6t_log_names ip6t_log_names[]
-= { { "alert", LOG_ALERT },
-    { "crit", LOG_CRIT },
-    { "debug", LOG_DEBUG },
-    { "emerg", LOG_EMERG },
-    { "error", LOG_ERR },              /* DEPRECATED */
-    { "info", LOG_INFO },
-    { "notice", LOG_NOTICE },
-    { "panic", LOG_EMERG },            /* DEPRECATED */
-    { "warning", LOG_WARNING }
+= { { .name = "alert",   .level = LOG_ALERT },
+    { .name = "crit",    .level = LOG_CRIT },
+    { .name = "debug",   .level = LOG_DEBUG },
+    { .name = "emerg",   .level = LOG_EMERG },
+    { .name = "error",   .level = LOG_ERR },           /* DEPRECATED */
+    { .name = "info",    .level = LOG_INFO },
+    { .name = "notice",  .level = LOG_NOTICE },
+    { .name = "panic",   .level = LOG_EMERG },         /* DEPRECATED */
+    { .name = "warning", .level = LOG_WARNING }
 };
 
 static u_int8_t
@@ -225,7 +225,6 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
 {
        const struct ip6t_log_info *loginfo
                = (const struct ip6t_log_info *)target->data;
-       unsigned int i = 0;
 
        if (strcmp(loginfo->prefix, "") != 0)
                printf("--log-prefix \"%s\" ", loginfo->prefix);
@@ -243,18 +242,18 @@ save(const struct ip6t_ip6 *ip, const struct ip6t_entry_target *target)
 
 static
 struct ip6tables_target log
-= { NULL,
-    "LOG",
-    IPTABLES_VERSION,
-    IP6T_ALIGN(sizeof(struct ip6t_log_info)),
-    IP6T_ALIGN(sizeof(struct ip6t_log_info)),
-    &help,
-    &init,
-    &parse,
-    &final_check,
-    &print,
-    &save,
-    opts
+= {
+    .name          = "LOG",
+    .version       = IPTABLES_VERSION,
+    .size          = IP6T_ALIGN(sizeof(struct ip6t_log_info)),
+    .userspacesize = IP6T_ALIGN(sizeof(struct ip6t_log_info)),
+    .help          = &help,
+    .init          = &init,
+    .parse         = &parse,
+    .final_check   = &final_check,
+    .print         = &print,
+    .save          = &save,
+    .extra_opts    = opts
 };
 
 void _init(void)
index 27995dcf7f22e7cf6af6198f22f81da5af333ec2..f8c8e4bd33f37ab09ec065d0430a15d3b3254ca0 100644 (file)
@@ -26,12 +26,12 @@ IPTABLES_VERSION);
 }
 
 static struct option opts[] = {
-       { "log-level", 1, 0, '!' },
-       { "log-prefix", 1, 0, '#' },
-       { "log-tcp-sequence", 0, 0, '1' },
-       { "log-tcp-options", 0, 0, '2' },
-       { "log-ip-options", 0, 0, '3' },
-       { 0 }
+       { .name = "log-level",        .has_arg = 1, .flag = 0, .val = '!' },
+       { .name = "log-prefix",       .has_arg = 1, .flag = 0, .val = '#' },
+       { .name = "log-tcp-sequence", .has_arg = 0, .flag = 0, .val = '1' },
+       { .name = "log-tcp-options",  .has_arg = 0, .flag = 0, .val = '2' },
+       { .name = "log-ip-options",   .has_arg = 0, .flag = 0, .val = '3' },
+       { .name = 0 }
 };
 
 /* Initialize the target. */
@@ -52,15 +52,15 @@ struct ipt_log_names {
 };
 
 static struct ipt_log_names ipt_log_names[]
-= { { "alert", LOG_ALERT },
-    { "crit", LOG_CRIT },
-    { "debug", LOG_DEBUG },
-    { "emerg", LOG_EMERG },
-    { "error", LOG_ERR },              /* DEPRECATED */
-    { "info", LOG_INFO },
-    { "notice", LOG_NOTICE },
-    { "panic", LOG_EMERG },            /* DEPRECATED */
-    { "warning", LOG_WARNING }
+= { { .name = "alert",   .level = LOG_ALERT },
+    { .name = "crit",    .level = LOG_CRIT },
+    { .name = "debug",   .level = LOG_DEBUG },
+    { .name = "emerg",   .level = LOG_EMERG },
+    { .name = "error",   .level = LOG_ERR },           /* DEPRECATED */
+    { .name = "info",    .level = LOG_INFO },
+    { .name = "notice",  .level = LOG_NOTICE },
+    { .name = "panic",   .level = LOG_EMERG },         /* DEPRECATED */
+    { .name = "warning", .level = LOG_WARNING }
 };
 
 static u_int8_t
@@ -225,7 +225,6 @@ save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
 {
        const struct ipt_log_info *loginfo
                = (const struct ipt_log_info *)target->data;
-       unsigned int i = 0;
 
        if (strcmp(loginfo->prefix, "") != 0)
                printf("--log-prefix \"%s\" ", loginfo->prefix);
@@ -243,18 +242,18 @@ save(const struct ipt_ip *ip, const struct ipt_entry_target *target)
 
 static
 struct iptables_target log
-= { NULL,
-    "LOG",
-    IPTABLES_VERSION,
-    IPT_ALIGN(sizeof(struct ipt_log_info)),
-    IPT_ALIGN(sizeof(struct ipt_log_info)),
-    &help,
-    &init,
-    &parse,
-    &final_check,
-    &print,
-    &save,
-    opts
+= {
+    .name          = "LOG",
+    .version       = IPTABLES_VERSION,
+    .size          = IPT_ALIGN(sizeof(struct ipt_log_info)),
+    .userspacesize = IPT_ALIGN(sizeof(struct ipt_log_info)),
+    .help          = &help,
+    .init          = &init,
+    .parse         = &parse,
+    .final_check   = &final_check,
+    .print         = &print,
+    .save          = &save,
+    .extra_opts    = opts
 };
 
 void _init(void)