]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fixes warning on compilation, part 2
authorYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Tue, 24 Jul 2007 06:06:59 +0000 (06:06 +0000)
committerYasuyuki KOZAKAI <yasuyuki@netfilter.org>
Tue, 24 Jul 2007 06:06:59 +0000 (06:06 +0000)
This changes the type of arguments as follows in multiport, DNAT, SNAT,
MASQUERADE, and REDIRECT

- ip[6]t_ip[6] * -> void *
- ip[6]t_entry * -> void *

and adds lines to cast these pointer with intended type.

extensions/libip6t_multiport.c
extensions/libipt_DNAT.c
extensions/libipt_MASQUERADE.c
extensions/libipt_REDIRECT.c
extensions/libipt_SNAT.c
extensions/libipt_multiport.c

index bb55f23e4da59210ddcb4518bf8a7d9d27cd1617..2ff77fe6eb6d5d7e265dc76b7cf45fbc3c5f67fa 100644 (file)
@@ -135,8 +135,9 @@ init(struct xt_entry_match *m, unsigned int *nfcache)
 }
 
 static const char *
-check_proto(const struct ip6t_entry *entry)
+check_proto(const void *e)
 {
+       const struct ip6t_entry *entry = e;
        char *proto;
 
        if ((proto = proto_to_name(entry->ipv6.proto)) != NULL)
@@ -153,10 +154,11 @@ check_proto(const struct ip6t_entry *entry)
    ate an option */
 static int
 parse(int c, char **argv, int invert, unsigned int *flags,
-      const struct ip6t_entry *entry,
+      const void *e,
       unsigned int *nfcache,
       struct xt_entry_match **match)
 {
+       const struct ip6t_entry *entry = e;
        const char *proto;
        struct ip6t_multiport *multiinfo
                = (struct ip6t_multiport *)(*match)->data;
@@ -203,10 +205,11 @@ parse(int c, char **argv, int invert, unsigned int *flags,
 
 static int
 parse_v1(int c, char **argv, int invert, unsigned int *flags,
-        const struct ip6t_entry *entry,
+        const void *e,
         unsigned int *nfcache,
-        struct ip6t_entry_match **match)
+        struct xt_entry_match **match)
 {
+       const struct ip6t_entry *entry = e;
        const char *proto;
        struct ip6t_multiport_v1 *multiinfo
                = (struct ip6t_multiport_v1 *)(*match)->data;
@@ -279,10 +282,11 @@ print_port(u_int16_t port, u_int8_t protocol, int numeric)
 
 /* Prints out the matchinfo. */
 static void
-print(const struct ip6t_ip6 *ip,
+print(const void *ip_void,
       const struct xt_entry_match *match,
       int numeric)
 {
+       const struct ip6t_ip6 *ip = ip_void;
        const struct ip6t_multiport *multiinfo
                = (const struct ip6t_multiport *)match->data;
        unsigned int i;
@@ -315,10 +319,11 @@ print(const struct ip6t_ip6 *ip,
 }
 
 static void
-print_v1(const struct ip6t_ip6 *ip,
-        const struct ip6t_entry_match *match,
+print_v1(const void *ip_void,
+        const struct xt_entry_match *match,
         int numeric)
 {
+       const struct ip6t_ip6 *ip = ip_void;
        const struct ip6t_multiport_v1 *multiinfo
                = (const struct ip6t_multiport_v1 *)match->data;
        unsigned int i;
@@ -358,8 +363,9 @@ print_v1(const struct ip6t_ip6 *ip,
 }
 
 /* Saves the union ip6t_matchinfo in parsable form to stdout. */
-static void save(const struct ip6t_ip6 *ip, const struct xt_entry_match *match)
+static void save(const void *ip_void, const struct xt_entry_match *match)
 {
+       const struct ip6t_ip6 *ip = ip_void;
        const struct ip6t_multiport *multiinfo
                = (const struct ip6t_multiport *)match->data;
        unsigned int i;
@@ -385,9 +391,9 @@ static void save(const struct ip6t_ip6 *ip, const struct xt_entry_match *match)
        printf(" ");
 }
 
-static void save_v1(const struct ip6t_ip6 *ip, 
-                   const struct ip6t_entry_match *match)
+static void save_v1(const void *ip_void, const struct xt_entry_match *match)
 {
+       const struct ip6t_ip6 *ip = ip_void;
        const struct ip6t_multiport_v1 *multiinfo
                = (const struct ip6t_multiport_v1 *)match->data;
        unsigned int i;
index 7dce2d459fe773b722b05e2ed056d6d3e65f4b73..21b79ad8613d5695e5ce165b44df930b80194b8c 100644 (file)
@@ -141,9 +141,10 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
    ate an option */
 static int
 parse(int c, char **argv, int invert, unsigned int *flags,
-      const struct ipt_entry *entry,
+      const void *e,
       struct xt_entry_target **target)
 {
+       const struct ipt_entry *entry = e;
        struct ipt_natinfo *info = (void *)*target;
        int portok;
 
@@ -215,7 +216,7 @@ static void print_range(const struct ip_nat_range *r)
 
 /* Prints out the targinfo. */
 static void
-print(const struct ipt_ip *ip,
+print(const void *ip,
       const struct xt_entry_target *target,
       int numeric)
 {
@@ -233,7 +234,7 @@ print(const struct ipt_ip *ip,
 
 /* Saves the union ipt_targinfo in parsable form to stdout. */
 static void
-save(const struct ipt_ip *ip, const struct xt_entry_target *target)
+save(const void *ip, const struct xt_entry_target *target)
 {
        struct ipt_natinfo *info = (void *)target;
        unsigned int i = 0;
index 8db6bdd38ddaa0094fe180b1acb6e696ddd419df..0a94939123fd0dee311c55669d8e99f9d45912e3 100644 (file)
@@ -78,9 +78,10 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
    ate an option */
 static int
 parse(int c, char **argv, int invert, unsigned int *flags,
-      const struct ipt_entry *entry,
+      const void *e,
       struct xt_entry_target **target)
 {
+       const struct ipt_entry *entry = e;
        int portok;
        struct ip_nat_multi_range *mr
                = (struct ip_nat_multi_range *)(*target)->data;
@@ -121,7 +122,7 @@ static void final_check(unsigned int flags)
 
 /* Prints out the targinfo. */
 static void
-print(const struct ipt_ip *ip,
+print(const void *ip,
       const struct xt_entry_target *target,
       int numeric)
 {
@@ -143,7 +144,7 @@ print(const struct ipt_ip *ip,
 
 /* Saves the union ipt_targinfo in parsable form to stdout. */
 static void
-save(const struct ipt_ip *ip, const struct xt_entry_target *target)
+save(const void *ip, const struct xt_entry_target *target)
 {
        struct ip_nat_multi_range *mr
                = (struct ip_nat_multi_range *)target->data;
index 3810b997841c0bea876f7caa4d844ab2b872a941..ee42eb7e1dedb81643e32ae97d09841ff4106acc 100644 (file)
@@ -80,9 +80,10 @@ parse_ports(const char *arg, struct ip_nat_multi_range *mr)
    ate an option */
 static int
 parse(int c, char **argv, int invert, unsigned int *flags,
-      const struct ipt_entry *entry,
+      const void *e,
       struct xt_entry_target **target)
 {
+       const struct ipt_entry *entry = e;
        struct ip_nat_multi_range *mr
                = (struct ip_nat_multi_range *)(*target)->data;
        int portok;
@@ -130,7 +131,7 @@ static void final_check(unsigned int flags)
 
 /* Prints out the targinfo. */
 static void
-print(const struct ipt_ip *ip,
+print(const void *ip,
       const struct xt_entry_target *target,
       int numeric)
 {
@@ -151,7 +152,7 @@ print(const struct ipt_ip *ip,
 
 /* Saves the union ipt_targinfo in parsable form to stdout. */
 static void
-save(const struct ipt_ip *ip, const struct xt_entry_target *target)
+save(const void *ip, const struct xt_entry_target *target)
 {
        struct ip_nat_multi_range *mr
                = (struct ip_nat_multi_range *)target->data;
index bdf9429ac72e90407cd947d01cf37d7d01ba6cf6..ead5ab80cd7f58231263f60777a1b24fbd992918 100644 (file)
@@ -141,9 +141,10 @@ parse_to(char *arg, int portok, struct ipt_natinfo *info)
    ate an option */
 static int
 parse(int c, char **argv, int invert, unsigned int *flags,
-      const struct ipt_entry *entry,
+      const void *e,
       struct xt_entry_target **target)
 {
+       const struct ipt_entry *entry = e;
        struct ipt_natinfo *info = (void *)*target;
        int portok;
 
@@ -217,7 +218,7 @@ static void print_range(const struct ip_nat_range *r)
 
 /* Prints out the targinfo. */
 static void
-print(const struct ipt_ip *ip,
+print(const void *ip,
       const struct xt_entry_target *target,
       int numeric)
 {
@@ -235,7 +236,7 @@ print(const struct ipt_ip *ip,
 
 /* Saves the union ipt_targinfo in parsable form to stdout. */
 static void
-save(const struct ipt_ip *ip, const struct xt_entry_target *target)
+save(const void *ip, const struct xt_entry_target *target)
 {
        struct ipt_natinfo *info = (void *)target;
        unsigned int i = 0;
index 889e439936ead43eb21de718c98f8fed66990d75..6de25c3b27d88a9e25daaadad4bfdc4da8c26916 100644 (file)
@@ -137,8 +137,9 @@ init(struct xt_entry_match *m, unsigned int *nfcache)
 }
 
 static const char *
-check_proto(const struct ipt_entry *entry)
+check_proto(const void *e)
 {
+       const struct ipt_entry *entry = e;
        char *proto;
 
        if (entry->ip.invflags & IPT_INV_PROTO)
@@ -160,10 +161,11 @@ check_proto(const struct ipt_entry *entry)
    ate an option */
 static int
 parse(int c, char **argv, int invert, unsigned int *flags,
-      const struct ipt_entry *entry,
+      const void *e,
       unsigned int *nfcache,
       struct xt_entry_match **match)
 {
+       const struct ipt_entry *entry = e;
        const char *proto;
        struct ipt_multiport *multiinfo
                = (struct ipt_multiport *)(*match)->data;
@@ -210,10 +212,11 @@ parse(int c, char **argv, int invert, unsigned int *flags,
 
 static int
 parse_v1(int c, char **argv, int invert, unsigned int *flags,
-        const struct ipt_entry *entry,
+        const void *e,
         unsigned int *nfcache,
         struct xt_entry_match **match)
 {
+       const struct ipt_entry *entry = e;
        const char *proto;
        struct ipt_multiport_v1 *multiinfo
                = (struct ipt_multiport_v1 *)(*match)->data;
@@ -286,10 +289,11 @@ print_port(u_int16_t port, u_int8_t protocol, int numeric)
 
 /* Prints out the matchinfo. */
 static void
-print(const struct ipt_ip *ip,
+print(const void *ip_void,
       const struct xt_entry_match *match,
       int numeric)
 {
+       const struct ipt_ip *ip = ip_void;
        const struct ipt_multiport *multiinfo
                = (const struct ipt_multiport *)match->data;
        unsigned int i;
@@ -322,10 +326,11 @@ print(const struct ipt_ip *ip,
 }
 
 static void
-print_v1(const struct ipt_ip *ip,
+print_v1(const void *ip_void,
         const struct xt_entry_match *match,
         int numeric)
 {
+       const struct ipt_ip *ip = ip_void;
        const struct ipt_multiport_v1 *multiinfo
                = (const struct ipt_multiport_v1 *)match->data;
        unsigned int i;
@@ -365,8 +370,9 @@ print_v1(const struct ipt_ip *ip,
 }
 
 /* Saves the union ipt_matchinfo in parsable form to stdout. */
-static void save(const struct ipt_ip *ip, const struct xt_entry_match *match)
+static void save(const void *ip_void, const struct xt_entry_match *match)
 {
+       const struct ipt_ip *ip = ip_void;
        const struct ipt_multiport *multiinfo
                = (const struct ipt_multiport *)match->data;
        unsigned int i;
@@ -392,9 +398,10 @@ static void save(const struct ipt_ip *ip, const struct xt_entry_match *match)
        printf(" ");
 }
 
-static void save_v1(const struct ipt_ip *ip, 
+static void save_v1(const void *ip_void,
                    const struct xt_entry_match *match)
 {
+       const struct ipt_ip *ip = ip_void;
        const struct ipt_multiport_v1 *multiinfo
                = (const struct ipt_multiport_v1 *)match->data;
        unsigned int i;