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.in | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 include/xtables/internal.h.in (limited to 'include/xtables/internal.h.in') diff --git a/include/xtables/internal.h.in b/include/xtables/internal.h.in new file mode 100644 index 00000000..21438290 --- /dev/null +++ b/include/xtables/internal.h.in @@ -0,0 +1,41 @@ +#ifndef _XTABLES_INTERNAL_H +#define _XTABLES_INTERNAL_H 1 + +#define IPTABLES_VERSION "@PACKAGE_VERSION@" + +#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; + +/** + * Program's own name and version. + */ +extern const char *program_name, *program_version; + +extern void _init(void); + +#endif /* _XTABLES_INTERNAL_H */ -- cgit v1.2.3 From 77f48c2f1ef21fa43aa68c25a1457db319ca2526 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Sat, 7 Feb 2009 19:59:53 +0100 Subject: libxtables: move afinfo around libxtables should not rely on the program executable providing the magic constants for using [gs]etsockopt. Signed-off-by: Jan Engelhardt --- include/xtables/internal.h.in | 24 ------------------------ 1 file changed, 24 deletions(-) (limited to 'include/xtables/internal.h.in') diff --git a/include/xtables/internal.h.in b/include/xtables/internal.h.in index 21438290..81ddb48a 100644 --- a/include/xtables/internal.h.in +++ b/include/xtables/internal.h.in @@ -7,30 +7,6 @@ # 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; - /** * Program's own name and version. */ -- cgit v1.2.3