From 630ef48037f3602333addfdb53789c9c6a4bb4c8 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 27 Jan 2009 14:58:41 +0100 Subject: libxtables: prefix/order - fw_xalloc It is good practice to prefix names in a library some way so that it does not clash with external programs' variable names right on the first try. This change: rename fw_[cm]alloc to xtables_[cm]alloc and move the definition from internal.h to xtables.h to avoid potential compiler warnings. Signed-off-by: Jan Engelhardt --- include/xtables/internal.h | 3 --- 1 file changed, 3 deletions(-) (limited to 'include/xtables/internal.h') diff --git a/include/xtables/internal.h b/include/xtables/internal.h index 24a5078b..6b78d3a8 100644 --- a/include/xtables/internal.h +++ b/include/xtables/internal.h @@ -43,9 +43,6 @@ struct xtables_rule_match { extern char *lib_dir; -extern void *fw_calloc(size_t count, size_t size); -extern void *fw_malloc(size_t size); - extern const char *modprobe_program; extern int xtables_insmod(const char *modname, const char *modprobe, int quiet); extern int load_xtables_ko(const char *modprobe, int quiet); -- cgit v1.2.3 From c021c3ce7b1583eb5dd71b10ac3d8ab3cd36beaa Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 27 Jan 2009 15:10:05 +0100 Subject: libxtables: prefix/order - modprobe and xtables.ko loading This change affects: load_xtables_ko -> xtables_load_ko modprobe_program -> xtables_modprobe_program Now uses bool for the "quiet" flag. Signed-off-by: Jan Engelhardt --- include/xtables/internal.h | 4 ---- 1 file changed, 4 deletions(-) (limited to 'include/xtables/internal.h') diff --git a/include/xtables/internal.h b/include/xtables/internal.h index 6b78d3a8..62fe2edb 100644 --- a/include/xtables/internal.h +++ b/include/xtables/internal.h @@ -43,10 +43,6 @@ struct xtables_rule_match { extern char *lib_dir; -extern const char *modprobe_program; -extern int xtables_insmod(const char *modname, const char *modprobe, int quiet); -extern int load_xtables_ko(const char *modprobe, int quiet); - /* This is decleared in ip[6]tables.c */ extern struct afinfo afinfo; -- cgit v1.2.3 From 2338efd8f799d8373dc196c797bda9690283b698 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 27 Jan 2009 15:23:01 +0100 Subject: libxtables: prefix/order - match/target loading This change affects: find_{match,target} -> xtables_find_{match,target} enum xt_tryload -> enum xtables_tryload loose flags like DONT_LOAD -> XTF_DONT_LOAD Signed-off-by: Jan Engelhardt --- include/xtables/internal.h | 23 ----------------------- 1 file changed, 23 deletions(-) (limited to 'include/xtables/internal.h') diff --git a/include/xtables/internal.h b/include/xtables/internal.h index 62fe2edb..60375cd1 100644 --- a/include/xtables/internal.h +++ b/include/xtables/internal.h @@ -26,34 +26,11 @@ struct afinfo { int so_rev_target; }; -enum xt_tryload { - DONT_LOAD, - DURING_LOAD, - TRY_LOAD, - LOAD_MUST_SUCCEED -}; - -struct xtables_rule_match { - struct xtables_rule_match *next; - struct xtables_match *match; - /* Multiple matches of the same type: the ones before - the current one are completed from parsing point of view */ - unsigned int completed; -}; - extern char *lib_dir; /* This is decleared in ip[6]tables.c */ extern struct afinfo afinfo; -/* Keeping track of external matches and targets: linked lists. */ -extern struct xtables_match *xtables_matches; -extern struct xtables_target *xtables_targets; - -extern struct xtables_match *find_match(const char *name, enum xt_tryload, - struct xtables_rule_match **match); -extern struct xtables_target *find_target(const char *name, enum xt_tryload); - extern void _init(void); #endif /* _XTABLES_INTERNAL_H */ -- cgit v1.2.3 From 39bf9c8214d3073a496a8a1eff91046a8d6fbbdf Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 27 Jan 2009 15:59:06 +0100 Subject: libxtables: prefix/order - libdir Consolidate the libdir variable initialization code into xtables.c. Signed-off-by: Jan Engelhardt --- include/xtables/internal.h | 2 -- 1 file changed, 2 deletions(-) (limited to 'include/xtables/internal.h') diff --git a/include/xtables/internal.h b/include/xtables/internal.h index 60375cd1..21c4401f 100644 --- a/include/xtables/internal.h +++ b/include/xtables/internal.h @@ -26,8 +26,6 @@ struct afinfo { int so_rev_target; }; -extern char *lib_dir; - /* This is decleared in ip[6]tables.c */ extern struct afinfo afinfo; -- cgit v1.2.3 From dacafa55379fd98212031d8c559096c91d7ce93b Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 27 Jan 2009 20:56:23 +0100 Subject: libxtables: prefix/order - program_name Split XTABLES_VERSION into xtables and iptables, and encode the xtables soversion into the extensions instead. This makes it possible to upgrade iptables without having to recompile 3rd-party extensions (if the libxtables version matches, of course). Signed-off-by: Jan Engelhardt --- include/xtables/internal.h | 34 ---------------------------------- 1 file changed, 34 deletions(-) delete mode 100644 include/xtables/internal.h (limited to 'include/xtables/internal.h') diff --git a/include/xtables/internal.h b/include/xtables/internal.h deleted file mode 100644 index 21c4401f..00000000 --- a/include/xtables/internal.h +++ /dev/null @@ -1,34 +0,0 @@ -#ifndef _XTABLES_INTERNAL_H -#define _XTABLES_INTERNAL_H 1 - -#ifndef XT_LIB_DIR -# define XT_LIB_DIR "/usr/local/lib/iptables" -#endif - -/* protocol family dependent informations */ -struct afinfo { - /* protocol family */ - int family; - - /* prefix of library name (ex "libipt_" */ - char *libprefix; - - /* used by setsockopt (ex IPPROTO_IP */ - int ipproto; - - /* kernel module (ex "ip_tables" */ - char *kmod; - - /* optname to check revision support of match */ - int so_rev_match; - - /* optname to check revision support of match */ - int so_rev_target; -}; - -/* This is decleared in ip[6]tables.c */ -extern struct afinfo afinfo; - -extern void _init(void); - -#endif /* _XTABLES_INTERNAL_H */ -- cgit v1.2.3