[netfilter-cvslog] r7468 - in trunk/iptables: . extensions include include/libiptc include/xtables libiptc

kaber at trash.net kaber at trash.net
Sun Apr 13 07:17:59 CEST 2008


Author: kaber at trash.net
Date: 2008-04-13 07:17:58 +0200 (Sun, 13 Apr 2008)
New Revision: 7468

Added:
   trunk/iptables/include/xtables/
   trunk/iptables/include/xtables/internal.h
   trunk/iptables/ip6tables-multi.h
   trunk/iptables/iptables-multi.h
Modified:
   trunk/iptables/configure.ac
   trunk/iptables/extensions/GNUmakefile.in
   trunk/iptables/extensions/libip6t_policy.c
   trunk/iptables/extensions/libipt_ULOG.c
   trunk/iptables/include/iptables.h
   trunk/iptables/include/libiptc/libip6tc.h
   trunk/iptables/include/libiptc/libiptc.h
   trunk/iptables/include/xtables.h
   trunk/iptables/ip6tables-restore.c
   trunk/iptables/ip6tables-save.c
   trunk/iptables/ip6tables-standalone.c
   trunk/iptables/ip6tables.c
   trunk/iptables/iptables-restore.c
   trunk/iptables/iptables-save.c
   trunk/iptables/iptables-standalone.c
   trunk/iptables/iptables-xml.c
   trunk/iptables/iptables.c
   trunk/iptables/libiptc/libiptc.c
Log:
[PATCH 02/13] Fix all remaining warnings (missing declarations, missing prototypes)


Modified: trunk/iptables/configure.ac
===================================================================
--- trunk/iptables/configure.ac	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/configure.ac	2008-04-13 05:17:58 UTC (rev 7468)
@@ -41,13 +41,9 @@
 	-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])

Modified: trunk/iptables/extensions/GNUmakefile.in
===================================================================
--- trunk/iptables/extensions/GNUmakefile.in	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/extensions/GNUmakefile.in	2008-04-13 05:17:58 UTC (rev 7468)
@@ -143,6 +143,7 @@
 	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 @@
 	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();" >>$@; \

Modified: trunk/iptables/extensions/libip6t_policy.c
===================================================================
--- trunk/iptables/extensions/libip6t_policy.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/extensions/libip6t_policy.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -126,11 +126,6 @@
 	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)

Modified: trunk/iptables/extensions/libipt_ULOG.c
===================================================================
--- trunk/iptables/extensions/libipt_ULOG.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/extensions/libipt_ULOG.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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;

Modified: trunk/iptables/include/iptables.h
===================================================================
--- trunk/iptables/include/iptables.h	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/include/iptables.h	2008-04-13 05:17:58 UTC (rev 7468)
@@ -24,8 +24,6 @@
 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,

Modified: trunk/iptables/include/libiptc/libip6tc.h
===================================================================
--- trunk/iptables/include/libiptc/libip6tc.h	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/include/libiptc/libip6tc.h	2008-04-13 05:17:58 UTC (rev 7468)
@@ -152,4 +152,6 @@
 /* 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 */

Modified: trunk/iptables/include/libiptc/libiptc.h
===================================================================
--- trunk/iptables/include/libiptc/libiptc.h	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/include/libiptc/libiptc.h	2008-04-13 05:17:58 UTC (rev 7468)
@@ -159,6 +159,8 @@
 /* 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

Added: trunk/iptables/include/xtables/internal.h
===================================================================
--- trunk/iptables/include/xtables/internal.h	                        (rev 0)
+++ trunk/iptables/include/xtables/internal.h	2008-04-13 05:17:58 UTC (rev 7468)
@@ -0,0 +1,6 @@
+#ifndef _XTABLES_INTERNAL_H
+#define _XTABLES_INTERNAL_H 1
+
+extern void _init(void);
+
+#endif /* _XTABLES_INTERNAL_H */

Modified: trunk/iptables/include/xtables.h
===================================================================
--- trunk/iptables/include/xtables.h	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/include/xtables.h	2008-04-13 05:17:58 UTC (rev 7468)
@@ -267,4 +267,11 @@
 #	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 */

Added: trunk/iptables/ip6tables-multi.h
===================================================================
--- trunk/iptables/ip6tables-multi.h	                        (rev 0)
+++ trunk/iptables/ip6tables-multi.h	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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 */

Modified: trunk/iptables/ip6tables-restore.c
===================================================================
--- trunk/iptables/ip6tables-restore.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/ip6tables-restore.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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 @@
 	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;
 

Modified: trunk/iptables/ip6tables-save.c
===================================================================
--- trunk/iptables/ip6tables-save.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/ip6tables-save.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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>

Modified: trunk/iptables/ip6tables-standalone.c
===================================================================
--- trunk/iptables/ip6tables-standalone.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/ip6tables-standalone.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -35,6 +35,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <ip6tables.h>
+#include "ip6tables-multi.h"
 
 #ifdef IPTABLES_MULTI
 int

Modified: trunk/iptables/ip6tables.c
===================================================================
--- trunk/iptables/ip6tables.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/ip6tables.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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 @@
 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 @@
 	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;
 

Added: trunk/iptables/iptables-multi.h
===================================================================
--- trunk/iptables/iptables-multi.h	                        (rev 0)
+++ trunk/iptables/iptables-multi.h	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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 */

Modified: trunk/iptables/iptables-restore.c
===================================================================
--- trunk/iptables/iptables-restore.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/iptables-restore.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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 @@
 	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;
 

Modified: trunk/iptables/iptables-save.c
===================================================================
--- trunk/iptables/iptables-save.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/iptables-save.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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>

Modified: trunk/iptables/iptables-standalone.c
===================================================================
--- trunk/iptables/iptables-standalone.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/iptables-standalone.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -36,6 +36,7 @@
 #include <errno.h>
 #include <string.h>
 #include <iptables.h>
+#include "iptables-multi.h"
 
 #ifdef IPTABLES_MULTI
 int

Modified: trunk/iptables/iptables-xml.c
===================================================================
--- trunk/iptables/iptables-xml.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/iptables-xml.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -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)

Modified: trunk/iptables/iptables.c
===================================================================
--- trunk/iptables/iptables.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/iptables.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -190,8 +190,6 @@
 
 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 @@
 	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;
 

Modified: trunk/iptables/libiptc/libiptc.c
===================================================================
--- trunk/iptables/libiptc/libiptc.c	2008-04-13 02:52:40 UTC (rev 7467)
+++ trunk/iptables/libiptc/libiptc.c	2008-04-13 05:17:58 UTC (rev 7468)
@@ -1474,7 +1474,7 @@
 }
 
 /* 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 @@
 	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 @@
 }
 
 /* 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:




More information about the netfilter-cvslog mailing list