]> git.ipfire.org Git - thirdparty/iptables.git/commitdiff
Fix all remaining warnings (missing declarations, missing prototypes)
authorJan Engelhardt <jengelh@medozas.de>
Sun, 10 Feb 2008 23:54:00 +0000 (00:54 +0100)
committerPatrick McHardy <kaber@trash.net>
Sun, 13 Apr 2008 05:17:58 +0000 (07:17 +0200)
21 files changed:
configure.ac
extensions/GNUmakefile.in
extensions/libip6t_policy.c
extensions/libipt_ULOG.c
include/iptables.h
include/libiptc/libip6tc.h
include/libiptc/libiptc.h
include/xtables.h
include/xtables/internal.h [new file with mode: 0644]
ip6tables-multi.h [new file with mode: 0644]
ip6tables-restore.c
ip6tables-save.c
ip6tables-standalone.c
ip6tables.c
iptables-multi.h [new file with mode: 0644]
iptables-restore.c
iptables-save.c
iptables-standalone.c
iptables-xml.c
iptables.c
libiptc/libiptc.c

index 87fca6cf41ed505aac81f72f588bbe3dda606d0e..c816b2e16c667887e1497dc350e5a4c14e13cb4a 100644 (file)
@@ -41,13 +41,9 @@ regular_CFLAGS="-D_LARGEFILE_SOURCE=1 -D_LARGE_FILES -D_FILE_OFFSET_BITS=64 \
        -Wmissing-prototypes -Wredundant-decls -Wshadow -Wstrict-prototypes \
        -Winline -pipe -DIPTABLES_VERSION=\\\"$PACKAGE_VERSION\\\" \
        -DIPT_LIB_DIR=\\\"\${iptdir}\\\" -DIP6T_LIB_DIR=\\\"\${iptdir}\\\"";
+regular_CFLAGS="$regular_CFLAGS -DXTABLES_INTERNAL"
 kinclude_CFLAGS="-I\"$kbuilddir/include\" -I\"$ksourcedir/include\"";
 
-# Remove workarounds soon
-regular_CFLAGS="$regular_CFLAGS -Wno-aggregate-return \
-       -Wno-missing-declarations -Wno-missing-prototypes \
-        -Wno-unused-parameter"
-
 AC_SUBST([regular_CFLAGS kinclude_CFLAGS])
 AC_SUBST([kbuilddir])
 AC_SUBST([ksourcedir])
index 489240912944eb3bd6c41c89778dfd061d055997..cf094f2f461c34a39fc44393057f8001aafd20d9 100644 (file)
@@ -143,6 +143,7 @@ initext4.c: .initext4.dd
        for i in ${initext_func}; do \
                echo "extern void lib$${i}_init(void);" >>$@; \
        done; \
+       echo -en "void init_extensions(void);\n" >>$@; \
        echo -en "void init_extensions(void)\n""{\n" >>$@; \
        for i in ${initext_func}; do \
                echo -e "\t""lib$${i}_init();" >>$@; \
@@ -157,6 +158,7 @@ initext6.c: .initext6.dd
        for i in ${initext6_func}; do \
                echo "extern void lib$${i}_init(void);" >>$@; \
        done; \
+       echo -en "void init_extensions(void);\n" >>$@; \
        echo -en "void init_extensions(void)\n""{\n" >>$@; \
        for i in ${initext6_func}; do \
                echo -e "\t""lib$${i}_init();" >>$@; \
index f706f98692c6b80f9a5b9deae47d88b7a445ed9e..41e5c324406d32ec74ad14438746c678b7d40f7d 100644 (file)
@@ -126,11 +126,6 @@ mask_to_numeric(const struct in6_addr *addrp)
        return buf;
 }
 
-/* These should be in include/ip6tables.h... */
-extern u_int16_t parse_protocol(const char *s);
-
-/* End duplicated code from ip6tables.c */
-
 static int parse_direction(char *s)
 {
        if (strcmp(s, "in") == 0)
index 6fb2c6680e79e972978d82922bf044bbb3ad6e35..31990a6141fdd2866255b40092327450b3d95e0b 100644 (file)
@@ -21,7 +21,7 @@
 #include "../include/linux/netfilter_ipv4/ipt_ULOG.h"
 
 
-void print_groups(unsigned int gmask)
+static void print_groups(unsigned int gmask)
 {
        int b;
        unsigned int test;
index f39410c02baa5b5ea44c92168d61fd77a5b3fb10..7ce9080175278e407baad312c5a18e65ab4f2c37 100644 (file)
@@ -24,8 +24,6 @@ extern int line;
 extern void register_match(struct iptables_match *me);
 extern void register_target(struct iptables_target *me);
 
-extern u_int16_t parse_protocol(const char *s);
-
 extern int do_command(int argc, char *argv[], char **table,
                      iptc_handle_t *handle);
 extern int delete_chain(const ipt_chainlabel chain, int verbose,
index 50696898b50fdb2c72f5f98f533f38575800c315..6e8a565798829e9b79b082900ead35c4e9bebbed 100644 (file)
@@ -152,4 +152,6 @@ const char *ip6tc_strerror(int err);
 /* Return prefix length, or -1 if not contiguous */
 int ipv6_prefix_length(const struct in6_addr *a);
 
+extern void dump_entries6(const ip6tc_handle_t);
+
 #endif /* _LIBIP6TC_H */
index 30f5b7d132236717e33ee9735c4b1d244a07f3f2..1f6f95d879715c47132cba288c033515df19089e 100644 (file)
@@ -159,6 +159,8 @@ int iptc_get_raw_socket(void);
 /* Translates errno numbers into more human-readable form than strerror. */
 const char *iptc_strerror(int err);
 
+extern void dump_entries(const iptc_handle_t);
+
 #ifdef __cplusplus
 }
 #endif
index 4b75e2ca4da94d5f59a59f1057decfe08861f652..157f355c7743c513cb224ac1f5f078c6fd836fac 100644 (file)
@@ -267,4 +267,11 @@ extern void save_string(const char *value);
 #      define _init __attribute__((constructor)) _INIT
 #endif
 
+/* Present in both iptables.c and ip6tables.c */
+extern u_int16_t parse_protocol(const char *s);
+
+#ifdef XTABLES_INTERNAL
+#      include <xtables/internal.h>
+#endif
+
 #endif /* _XTABLES_H */
diff --git a/include/xtables/internal.h b/include/xtables/internal.h
new file mode 100644 (file)
index 0000000..3be72e3
--- /dev/null
@@ -0,0 +1,6 @@
+#ifndef _XTABLES_INTERNAL_H
+#define _XTABLES_INTERNAL_H 1
+
+extern void _init(void);
+
+#endif /* _XTABLES_INTERNAL_H */
diff --git a/ip6tables-multi.h b/ip6tables-multi.h
new file mode 100644 (file)
index 0000000..551029a
--- /dev/null
@@ -0,0 +1,8 @@
+#ifndef _IP6TABLES_MULTI_H
+#define _IP6TABLES_MULTI_H 1
+
+extern int ip6tables_main(int, char **);
+extern int ip6tables_save_main(int, char **);
+extern int ip6tables_restore_main(int, char **);
+
+#endif /* _IP6TABLES_MULTI_H */
index 570bd51523240cf23306a9bc691120a668fa7c83..e9cc0ff8985f9f2422936e527d2e768013324e55 100644 (file)
@@ -18,6 +18,7 @@
 #include "ip6tables.h"
 #include "xtables.h"
 #include "libiptc/libip6tc.h"
+#include "ip6tables-multi.h"
 
 #ifdef DEBUG
 #define DEBUGP(x, args...) fprintf(stderr, x, ## args)
@@ -55,7 +56,8 @@ static void print_usage(const char *name, const char *version)
        exit(1);
 }
 
-ip6tc_handle_t create_handle(const char *tablename, const char* modprobe)
+static ip6tc_handle_t create_handle(const char *tablename,
+                                    const char *modprobe)
 {
        ip6tc_handle_t handle;
 
index c73d354d8debdcdff2550356e2b0b0b703ad9178..e7eade17df65f63c4e14645aec1685cd773bfb49 100644 (file)
@@ -16,6 +16,7 @@
 #include <arpa/inet.h>
 #include "libiptc/libip6tc.h"
 #include "ip6tables.h"
+#include "ip6tables-multi.h"
 
 #ifndef NO_SHARED_LIBS
 #include <dlfcn.h>
index b7dfd179b42da8672293518091f64dcf036d153a..4029c1f60de1fd47c79dfbbcb56a29e6978308ac 100644 (file)
@@ -35,6 +35,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <ip6tables.h>
+#include "ip6tables-multi.h"
 
 #ifdef IPTABLES_MULTI
 int
index 4b517e572d7abd04e2bb7f9122b87c78cdc1131e..e5602f7e8cd430edf1089d338ba91ba45607a5a2 100644 (file)
@@ -41,6 +41,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/socket.h>
+#include "ip6tables-multi.h"
 
 #ifndef TRUE
 #define TRUE 1
@@ -186,9 +187,6 @@ static int inverse_for_options[NUMBER_OF_OPT] =
 const char *program_version;
 const char *program_name;
 
-/* Extra debugging from libiptc */
-extern void dump_entries6(const ip6tc_handle_t handle);
-
 /* A few hardcoded protocols for 'all' and in case the user has no
    /etc/protocols */
 struct pprot {
@@ -1140,7 +1138,7 @@ generate_entry(const struct ip6t_entry *fw,
        return e;
 }
 
-void clear_rule_matches(struct ip6tables_rule_match **matches)
+static void clear_rule_matches(struct ip6tables_rule_match **matches)
 {
        struct ip6tables_rule_match *matchp, *tmp;
 
diff --git a/iptables-multi.h b/iptables-multi.h
new file mode 100644 (file)
index 0000000..a9912b0
--- /dev/null
@@ -0,0 +1,9 @@
+#ifndef _IPTABLES_MULTI_H
+#define _IPTABLES_MULTI_H 1
+
+extern int iptables_main(int, char **);
+extern int iptables_save_main(int, char **);
+extern int iptables_restore_main(int, char **);
+extern int iptables_xml_main(int, char **);
+
+#endif /* _IPTABLES_MULTI_H */
index 44263ceefa0079c0ccc443db73f7dd34c6abae33..b751d2c88958b2ca12ed58725d510856f1a6cc1f 100644 (file)
@@ -15,6 +15,7 @@
 #include "iptables.h"
 #include "xtables.h"
 #include "libiptc/libiptc.h"
+#include "iptables-multi.h"
 
 #ifdef DEBUG
 #define DEBUGP(x, args...) fprintf(stderr, x, ## args)
@@ -54,7 +55,7 @@ static void print_usage(const char *name, const char *version)
        exit(1);
 }
 
-iptc_handle_t create_handle(const char *tablename, const char* modprobe )
+static iptc_handle_t create_handle(const char *tablename, const char *modprobe)
 {
        iptc_handle_t handle;
 
index f82c8a77a5a81b0524d9190901e342a52a60cac9..c0c37eda1b74a3fd12bc973d1e43248c20fb53dc 100644 (file)
@@ -15,6 +15,7 @@
 #include <netdb.h>
 #include "libiptc/libiptc.h"
 #include "iptables.h"
+#include "iptables-multi.h"
 
 #ifndef NO_SHARED_LIBS
 #include <dlfcn.h>
index e5c7841d9ff786fb4d06246e1cb40593adf87041..55c7ce980850e9838bfa66b7cf1a1c8fe2589182 100644 (file)
@@ -36,6 +36,7 @@
 #include <errno.h>
 #include <string.h>
 #include <iptables.h>
+#include "iptables-multi.h"
 
 #ifdef IPTABLES_MULTI
 int
index 94f2e39cd23288946310be8471d9569f1139c289..d922efe90e3c306e4267cda738dcde57eaf2e91d 100644 (file)
@@ -16,6 +16,7 @@
 #include <stdarg.h>
 #include "iptables.h"
 #include "libiptc/libiptc.h"
+#include "iptables-multi.h"
 
 #ifdef DEBUG
 #define DEBUGP(x, args...) fprintf(stderr, x, ## args)
index 0363aba665776264465b06edf1c10a70a9c194a0..b2a4b5378c0799faeb58e841cd843f02de81f4be 100644 (file)
@@ -190,8 +190,6 @@ const char *program_name;
 
 int kernel_version;
 
-extern void dump_entries(const iptc_handle_t handle);
-
 /* A few hardcoded protocols for 'all' and in case the user has no
    /etc/protocols */
 struct pprot {
@@ -1143,7 +1141,7 @@ generate_entry(const struct ipt_entry *fw,
        return e;
 }
 
-void clear_rule_matches(struct iptables_rule_match **matches)
+static void clear_rule_matches(struct iptables_rule_match **matches)
 {
        struct iptables_rule_match *matchp, *tmp;
 
index fe6b09b18f2b9395d5ba0d311813ae86f081d879..de8dc60ede89de41d3c2322621b9f4b4de0a6128 100644 (file)
@@ -1474,7 +1474,7 @@ TC_NEXT_RULE(const STRUCT_ENTRY *prev, TC_HANDLE_T *handle)
 }
 
 /* How many rules in this chain? */
-unsigned int
+static unsigned int
 TC_NUM_RULES(const char *chain, TC_HANDLE_T *handle)
 {
        struct chain_head *c;
@@ -1490,9 +1490,8 @@ TC_NUM_RULES(const char *chain, TC_HANDLE_T *handle)
        return c->num_rules;
 }
 
-const STRUCT_ENTRY *TC_GET_RULE(const char *chain,
-                               unsigned int n,
-                               TC_HANDLE_T *handle)
+static const STRUCT_ENTRY *
+TC_GET_RULE(const char *chain, unsigned int n, TC_HANDLE_T *handle)
 {
        struct chain_head *c;
        struct rule_head *r;
@@ -1514,7 +1513,7 @@ const STRUCT_ENTRY *TC_GET_RULE(const char *chain,
 }
 
 /* Returns a pointer to the target name of this position. */
-const char *standard_target_map(int verdict)
+static const char *standard_target_map(int verdict)
 {
        switch (verdict) {
                case RETURN: