diff options
15 files changed, 12624 insertions, 128 deletions
diff --git a/metadata/md5-cache/net-firewall/iptables-snmp-0.1 b/metadata/md5-cache/net-firewall/iptables-snmp-0.1 index bccf927a..0e742629 100644 --- a/metadata/md5-cache/net-firewall/iptables-snmp-0.1 +++ b/metadata/md5-cache/net-firewall/iptables-snmp-0.1 @@ -1,4 +1,4 @@ -DEFINED_PHASES=install postinst prepare +DEFINED_PHASES=compile install postinst prepare DEPEND=net-firewall/iptables net-analyzer/net-snmp DESCRIPTION=SNMP agent for linux iptables EAPI=5 @@ -10,4 +10,4 @@ REQUIRED_USE=kernel_linux SLOT=0 SRC_URI=http://www.nobiscuit.com/iptables-snmp/iptables-snmp-0.1.tar.gz _eclasses_=eutils a82a329b538368791f5a6113c60e557e multilib 892e597faee02a5b94eb02ab512e7622 toolchain-funcs 51e6c948e72c43bcc8edc7544411c953 user d0a4d0735a6c0183d707ca919bd72f28 -_md5_=6dcdfc071beb26c0d19c3ccd65e7cb11 +_md5_=804b839d8f6b3f94e73d1701e93c7528 diff --git a/net-firewall/iptables-snmp/ChangeLog b/net-firewall/iptables-snmp/ChangeLog index 23224b7c..2ca07603 100644 --- a/net-firewall/iptables-snmp/ChangeLog +++ b/net-firewall/iptables-snmp/ChangeLog @@ -1,3 +1,17 @@ + 12 Dec 2013; Bertrand Jacquin <beber@meleeweb.net> + +files/0001-Patch-from-https-dev.openwrt.org-browser-packages-ne.patch, + +files/0002-Patch-from-https-dev.openwrt.org-ticket-11045.patch, + +files/0003-Patch-from-https-dev.openwrt.org-ticket-11045.patch, + +files/0004-MINOR-Remove-unused-source-directories.patch, + +files/0005-MINOR-Ignore-generated-files.patch, + +files/0006-MINOR-Strip-spaces.patch, + +files/0007-MINOR-Remove-dead-code.patch, + +files/0008-MINOR-Remove-unused-parameters.patch, + +files/0009-MAJOR-Replace-autotools-with-simple-Makefile.patch, + -files/001-use_libiptc.patch, -files/002-use_libiptc.patch, + -files/003-libdir.patch, iptables-snmp-0.1.ebuild: + net-firewall/iptables-snmp: Cleanup + 12 Dec 2013; Bertrand Jacquin <beber@meleeweb.net> +files/003-libdir.patch, iptables-snmp-0.1.ebuild: net-firewall/iptables-snmp: Install in correct libdir, add some instruction diff --git a/net-firewall/iptables-snmp/Manifest b/net-firewall/iptables-snmp/Manifest index a40f9e86..ce054164 100644 --- a/net-firewall/iptables-snmp/Manifest +++ b/net-firewall/iptables-snmp/Manifest @@ -1,7 +1,13 @@ -AUX 001-use_libiptc.patch 998 SHA256 dd4992d39cb3f159e3a06787da9b691f317b633ed0857796329f6d7be90cdc03 WHIRLPOOL b4cd419eb70070ae612a5c65f11cb5162aaa8ee1b2762b5164fe748705af75a9005de0a0225a7bc7486d41f136b788969fcd6a3af3bf7fd2d21b55c0176cd896 -AUX 002-use_libiptc.patch 16809 SHA256 d98ffdfe2aebf1c861c1bad9926a11f85429e73adcec7e774b68d498348c4eea WHIRLPOOL 5e53707bf5496bbfb0f2faf15e5600277e918139cc47c3425e46b0244bccfa3a3d5a9fd3671a5acf92694a01f1aabdc9363fb078dd03b49a3236f8dc65af6c5d -AUX 003-libdir.patch 299 SHA256 9e699a76150e886f90aa5d4681c9749e2ce35bb4c4ae02eab2e47d550f9b0bfc WHIRLPOOL 5be0f9c396c6de7fde1b4988e1fdbab17989c8bccb7eb262758f8cfd9635aa5028ac0023133cb036ca5d458f38986bb8159b4c14f2ba141a731938cece2dd69b +AUX 0001-Patch-from-https-dev.openwrt.org-browser-packages-ne.patch 1186 SHA256 35025d6d0aaf883451efd0f9fd2317914b658d3497920149c1d1214e0e8b837d WHIRLPOOL f2ddf958532cfe60719e2e4493107c331bb82252edccd808c11a6eeb81590348b301845317a85f919eabbea55d5fc2b7c70a7c18aea2e43831c9787cc2037aa6 +AUX 0002-Patch-from-https-dev.openwrt.org-ticket-11045.patch 17578 SHA256 990d063a4ff4de0ab6f940d805f9d8b89df907b647e42517f08350f9ec7aa6ec WHIRLPOOL f54b1b37d247ed72b35983c08fd89642e5e0fb8a9b257f3f2c5906f17d30c9b62766c5a3643fe09f5590090be69f29f83d69629571a916ff6d8ee7581b3dc60f +AUX 0003-Patch-from-https-dev.openwrt.org-ticket-11045.patch 14724 SHA256 c9f6a8733809bc874f96ffaf461f170359bcc7ecccb2077b0cbe018f341033f8 WHIRLPOOL 6050a6b8c167fe6123cbbe34275c6f2d83555b6cd7964a6aa6442f03a3c4a2f13dc6c0e09ddfe3db1cb7f73a0edb54a27f621e8f33f7cbed9c18ea0c30513cb9 +AUX 0004-MINOR-Remove-unused-source-directories.patch 125878 SHA256 fe4f98c6f116280ae07c75ec2af877db403eb5ac7a22928e22ce5f1fd1a79c03 WHIRLPOOL 5729b114c66481046c7e426d211b2183f26c8f606022e2dedcc913fddbea6b1c0fc0d03c057cc028b8ecde21b23bab9dcdadc9cad4ea45d2dedc8cbedcac5be8 +AUX 0005-MINOR-Ignore-generated-files.patch 585 SHA256 746b8e6b7ac19bc0cde153f27183d65f00ab35efccd4738c4fe5d60670dffb0d WHIRLPOOL 592e0eb6fc3eb3cd8519a86156481616bf2e3575c5f194e56b60b83f4ae054b23f5e0b5c5dbe1f93880d4ddac45d74594a1ea1825c9150d9edaf9a22399ec020 +AUX 0006-MINOR-Strip-spaces.patch 26022 SHA256 6cbc3747e7293fc1e85ae749d4c940369ee085cbc04dbfd4d3585c851858b742 WHIRLPOOL 4bae42cb874a3b7134d7baf03c94d976df1a39619cb0a7e7f76a195ff07ccd0eea92485497ece8021fc9a02ecbc6a8df7607c9f4bc4ab7b8ca0219c7426855c3 +AUX 0007-MINOR-Remove-dead-code.patch 6420 SHA256 27c9d019d706074a37d326b0f5fd73c673726bd8d230de10117b4be6e99fed9b WHIRLPOOL 9af896f227d55a8cd392c7aa3aa3779c862a938147aee01e367350a982125def4f946831f017a7d44bae54713002d180f05b7f678a2dd9773255a717d1c6f95c +AUX 0008-MINOR-Remove-unused-parameters.patch 9303 SHA256 d2f583e5b17fb8f4e85f9a4e969bca2c8030ac6bb912212f91a07f170557727b WHIRLPOOL 93ec23519c6476e823b6d4121b9f995bbedca28d5763ece80f26d04fd5fc6d82bdbab61b2ebfb0e0092e493d4d334abe6ba31d39ad4d61a792d9587e72cd15ae +AUX 0009-MAJOR-Replace-autotools-with-simple-Makefile.patch 189922 SHA256 cddf395b85dcb73064c0dd12322eae21ce6f62ab231aed6750b4d0a88892c354 WHIRLPOOL ea4a69aa7226aa8768631fc283c1efda00385104ec5ec90cbb70635ef39bb1e446b2a10126f663090a0b9021aa07d972e6bcf02376425cbf8cabae8a44ff71d4 DIST iptables-snmp-0.1.tar.gz 80215 SHA256 3275bb3820809a311b9f92ea32f071888b9a92f60c831417490e811f46ec4d54 WHIRLPOOL bac93d4a4b59916ae45a7e318b75d3d067003fedfcf247624b9396b60e1f1cad4aec0e2d1d50e3a48e382d7c259ded1165f1a802b9583280ef4cbd06a53a7335 -EBUILD iptables-snmp-0.1.ebuild 961 SHA256 ea7da53a10919608e46b4e5be49e53178e0b4d94e20da552c602841553bf2baa WHIRLPOOL 0928f9cfcfbc4b471c638065d66e58c868f08b50e643d48cb49236229e7349f831a6574c663196debbaff87050c0264047d5939dfa6e255942cd323552bc6d52 -MISC ChangeLog 467 SHA256 6b5557755804729616c2063bcc2a3aeaf60e87e25254d985acd56cd884de8aa7 WHIRLPOOL a9bb561eaac32af7b5e356d359aeb0b8b374f51f586903e630aac9b903663efc235f34ad81014e40d0967a9c8aa4ca4e1dc1bbad0f45e57afa50990f2df6abef +EBUILD iptables-snmp-0.1.ebuild 959 SHA256 11065775825e46eafc33c8987ca308db749acb2a4a04e973380d4305d670f87b WHIRLPOOL 4f55ccc55094d542c01ec422afdb4ae878f2258ba9e7922b8146062e75f5a2ed22837b1f2d70aa5ae1edc573e40223fe643ee880d323abed46288f772d68cada +MISC ChangeLog 1194 SHA256 db6dcd1be01d93c89c084120b9ffe81bc92365920137b6f3b107de2de89a9733 WHIRLPOOL 7f523f615eb29aff648692142aab9dc5da373d5571842e663d65d5bb5069610fbed34f9b5c8a953be5ba8465a5b529de28a814239fbda71dde62bc34b1f5b7bb MISC metadata.xml 254 SHA256 c56bc3d6780712c960298c70bb86867aeb6661e97a317cc624516b0e16b72fcc WHIRLPOOL 2ebbfaa14ef0c1847284fe64a79f052cd7e73b25a724fba728c084aaaf2dd0692e068eedcf42ccef7e205077f00c35780ded7ec69118dc01ddb988b4802e46ae diff --git a/net-firewall/iptables-snmp/files/0001-Patch-from-https-dev.openwrt.org-browser-packages-ne.patch b/net-firewall/iptables-snmp/files/0001-Patch-from-https-dev.openwrt.org-browser-packages-ne.patch new file mode 100644 index 00000000..cbae1661 --- /dev/null +++ b/net-firewall/iptables-snmp/files/0001-Patch-from-https-dev.openwrt.org-browser-packages-ne.patch @@ -0,0 +1,42 @@ +From 1394f5bc558b5a55d1ceabaff7b4b3b7f813867e Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 22:56:05 +0100 +Subject: [PATCH 1/9] Patch from + https://dev.openwrt.org/browser/packages/net/iptables-snmp/patches/001-use_libiptc.patch + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + Makefile.in | 2 +- + iptables-snmp.c | 3 +++ + 2 files changed, 4 insertions(+), 1 deletion(-) + +diff --git Makefile.in Makefile.in +index 781ccca..1f41908 100644 +--- Makefile.in ++++ Makefile.in +@@ -67,7 +67,7 @@ OTHER = -Iinclude -DIPTABLES_VERSION=$(NETFILTER) -DUSE_ENTERPRISE_OID=$(STAMFE + + all: iptables-snmp.so + +-iptables-snmp.so: $(OBJS) libiptc.a Makefile ++iptables-snmp.so: $(OBJS) Makefile + $(CC) $(CFLAGS) $(OTHER) $(DFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) + + libiptc.a: $(LIBIPTC_OBJS) Makefile +diff --git iptables-snmp.c iptables-snmp.c +index 84db747..ca43892 100644 +--- iptables-snmp.c ++++ iptables-snmp.c +@@ -37,6 +37,9 @@ + + #include "libiptc/libiptc.h" + ++/* For backward compatibility */ ++typedef struct iptc_handle *iptc_handle_t; ++ + static oid agent_version_oid[] = { + BASE_OID, 1, 0, AGENT_VERSION_INDEX + }; +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/002-use_libiptc.patch b/net-firewall/iptables-snmp/files/0002-Patch-from-https-dev.openwrt.org-ticket-11045.patch index f74670de..21b279e6 100644 --- a/net-firewall/iptables-snmp/files/002-use_libiptc.patch +++ b/net-firewall/iptables-snmp/files/0002-Patch-from-https-dev.openwrt.org-ticket-11045.patch @@ -1,9 +1,52 @@ -From: https://dev.openwrt.org/ticket/11045 - 002-use_libiptc.patch +From a17336fdf00b49a958a6f9680abc2e5b3f690f4c Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:01:42 +0100 +Subject: [PATCH 2/9] Patch from https://dev.openwrt.org/ticket/11045 + 002-use_libiptc.patch -diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp.c ---- iptables-snmp-0.1.orig/iptables-snmp.c 2012-02-21 08:53:39.000000000 -0500 -+++ iptables-snmp-0.1/iptables-snmp.c 2012-02-26 09:33:19.000000000 -0500 +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + Makefile.in | 7 +++--- + iptables-snmp.c | 70 ++++++++++++++++++++++++---------------------------- + iptables-snmp.h | 73 +++++++++++++++++++++++++++++++++++++++++++++++++++++++ + mibs/IPTABLES.MIB | 72 ++++++++++++++++++++++++++++++++++++++---------------- + mibs/STAMFEST.MIB | 29 ++++++++++++++-------- + 5 files changed, 179 insertions(+), 72 deletions(-) + create mode 100644 iptables-snmp.h + +diff --git Makefile.in Makefile.in +index 1f41908..80d47c5 100644 +--- Makefile.in ++++ Makefile.in +@@ -53,7 +53,8 @@ STAMFEST_OID = 1,3,6,1,4,1,12806 + + SRCS = iptables-snmp.c + OBJS = $(SRCS:.c=.o) +-LDFLAGS = -L. -liptc ++L_SNMP_FLAGS = -lnetsnmp -lnetsnmphelpers -lnetsnmpagent -lnetsnmpmibs ++L_LDFLAGS = -lip4tc $(L_SNMP_FLAGS) + + NETFILTER = \"$(IPTABLES)\" + +@@ -63,12 +64,12 @@ LIBIPTC_OBJS = $(LIBIPTC_SRCS:.c=.o) + + DFLAGS = -fPIC + +-OTHER = -Iinclude -DIPTABLES_VERSION=$(NETFILTER) -DUSE_ENTERPRISE_OID=$(STAMFEST_OID) -DAGENT_VERSION=\"$(AGENT_VERSION)\" ++OTHER = -DIPTABLES_VERSION=$(NETFILTER) -DUSE_ENTERPRISE_OID=$(STAMFEST_OID) -DAGENT_VERSION=\"$(AGENT_VERSION)\" + + all: iptables-snmp.so + + iptables-snmp.so: $(OBJS) Makefile +- $(CC) $(CFLAGS) $(OTHER) $(DFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) ++ $(CC) $(DFLAGS) -shared -o $@ $(OBJS) $(L_LDFLAGS) $(LDFLAGS) + + libiptc.a: $(LIBIPTC_OBJS) Makefile + $(AR) rc $@ $(LIBIPTC_OBJS) +diff --git iptables-snmp.c iptables-snmp.c +index ca43892..10d7374 100644 +--- iptables-snmp.c ++++ iptables-snmp.c @@ -35,7 +35,7 @@ #include <net-snmp/agent/net-snmp-agent-includes.h> #include "iptables-snmp.h" @@ -13,7 +56,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp /* For backward compatibility */ typedef struct iptc_handle *iptc_handle_t; -@@ -83,7 +83,7 @@ +@@ -83,7 +83,7 @@ static void free_data(iptables_data *data) { free(data->tables[i]); if (data->t[i] != NULL) { @@ -22,7 +65,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp } } free(data->tables); -@@ -379,10 +379,10 @@ +@@ -379,10 +379,10 @@ store_chains(void **my_loop_context, c->table++; if (c->ctx->tables[c->table] == NULL) return NULL; @@ -35,7 +78,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp c->chain++; } } while (c->chainname == NULL); -@@ -523,8 +523,8 @@ +@@ -523,8 +523,8 @@ iptables_chains_handler(netsnmp_mib_handler *handler, const char *cn; int i; @@ -46,7 +89,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp if (i == chain) { if (table_info->colnum == C_CHAIN_NAME) { snmp_set_var_typed_value(var, ASN_OCTET_STR, -@@ -535,8 +535,8 @@ +@@ -535,8 +535,8 @@ iptables_chains_handler(netsnmp_mib_handler *handler, struct ipt_counters cnt; unsigned int isbuiltin = 1; @@ -57,7 +100,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp if (!pol) { isbuiltin = 0; -@@ -544,40 +544,33 @@ +@@ -544,40 +544,33 @@ iptables_chains_handler(netsnmp_mib_handler *handler, switch (table_info->colnum) { case C_CHAIN_POLICY: @@ -111,7 +154,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp } } break; -@@ -655,18 +648,18 @@ +@@ -655,18 +648,18 @@ store_rules(void **my_loop_context, c->table++; if (c->ctx->tables[c->table] == NULL) return NULL; @@ -134,7 +177,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp c->rule++; } } while (c->e == NULL); -@@ -868,8 +861,8 @@ +@@ -868,8 +861,8 @@ iptables_rules_handler(netsnmp_mib_handler *handler, case R_CHAIN_NAME_INDEX: { const char *cn; int i; @@ -145,7 +188,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp if (i == chain) { snmp_set_var_typed_value(var, ASN_OCTET_STR, (unsigned char *) cn, -@@ -890,12 +883,12 @@ +@@ -890,12 +883,12 @@ iptables_rules_handler(netsnmp_mib_handler *handler, const char *cn; int i; @@ -161,7 +204,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp struct counter64 c64; -@@ -950,7 +943,7 @@ +@@ -950,7 +943,7 @@ iptables_rules_handler(netsnmp_mib_handler *handler, n -= i; /* Print target name */ @@ -170,7 +213,7 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp if (target_name && *target_name) { i = snprintf(buf + sizeof(buf) - n, n, -@@ -1159,6 +1152,7 @@ +@@ -1159,6 +1152,7 @@ init_iptables(void) table_info->min_column = 1; table_info->max_column = 7; @@ -178,9 +221,11 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.c iptables-snmp-0.1/iptables-snmp iinfo->get_first_data_point = chains_get_first_names; iinfo->get_next_data_point = chains_get_next_names; iinfo->free_loop_context_at_end = chains_free_loop_context_at_end; -diff -urN iptables-snmp-0.1.orig/iptables-snmp.h iptables-snmp-0.1/iptables-snmp.h ---- iptables-snmp-0.1.orig/iptables-snmp.h 1969-12-31 19:00:00.000000000 -0500 -+++ iptables-snmp-0.1/iptables-snmp.h 2003-03-19 05:33:11.000000000 -0500 +diff --git iptables-snmp.h iptables-snmp.h +new file mode 100644 +index 0000000..2b23a2f +--- /dev/null ++++ iptables-snmp.h @@ -0,0 +1,73 @@ +/* + * $Id$ @@ -255,49 +300,11 @@ diff -urN iptables-snmp-0.1.orig/iptables-snmp.h iptables-snmp-0.1/iptables-snmp +#define R_MAX 12 + +#endif /* IPTABLES_SNMP_H_INCLUDED */ -diff -urN iptables-snmp-0.1.orig/Makefile.in iptables-snmp-0.1/Makefile.in ---- iptables-snmp-0.1.orig/Makefile.in 2012-02-21 08:53:39.000000000 -0500 -+++ iptables-snmp-0.1/Makefile.in 2012-02-25 10:35:46.000000000 -0500 -@@ -45,15 +45,17 @@ - INSTALL_PREFIX = - - NAME = iptables-snmp --AGENT_VERSION = 0.1 -+AGENT_VERSION = 0.1-002 - --IPTABLES = 1.3.3 -+# How could this be mechanically determined from iptables -+IPTABLES = 1.4.10 - - STAMFEST_OID = 1,3,6,1,4,1,12806 - - SRCS = iptables-snmp.c - OBJS = $(SRCS:.c=.o) --LDFLAGS = -L. -liptc -+L_SNMP_FLAGS = -lnetsnmp -lnetsnmphelpers -lnetsnmpagent -lnetsnmpmibs -+L_LDFLAGS = -lip4tc $(L_SNMP_FLAGS) - - NETFILTER = \"$(IPTABLES)\" - -@@ -63,12 +65,12 @@ - - DFLAGS = -fPIC - --OTHER = -Iinclude -DIPTABLES_VERSION=$(NETFILTER) -DUSE_ENTERPRISE_OID=$(STAMFEST_OID) -DAGENT_VERSION=\"$(AGENT_VERSION)\" -+OTHER = -DIPTABLES_VERSION=$(NETFILTER) -DUSE_ENTERPRISE_OID=$(STAMFEST_OID) -DAGENT_VERSION=\"$(AGENT_VERSION)\" - - all: iptables-snmp.so - - iptables-snmp.so: $(OBJS) Makefile -- $(CC) $(CFLAGS) $(OTHER) $(DFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) -+ $(CC) $(DFLAGS) -shared -o $@ $(OBJS) $(L_LDFLAGS) $(LDFLAGS) - - libiptc.a: $(LIBIPTC_OBJS) Makefile - $(AR) rc $@ $(LIBIPTC_OBJS) -diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABLES.MIB ---- iptables-snmp-0.1.orig/mibs/IPTABLES.MIB 2003-03-19 03:02:17.000000000 -0500 -+++ iptables-snmp-0.1/mibs/IPTABLES.MIB 2012-02-23 09:48:02.000000000 -0500 -@@ -38,15 +38,25 @@ +diff --git mibs/IPTABLES.MIB mibs/IPTABLES.MIB +index 12aee69..105e4dc 100644 +--- mibs/IPTABLES.MIB ++++ mibs/IPTABLES.MIB +@@ -38,15 +38,25 @@ IPTABLES-MIB DEFINITIONS ::= BEGIN IMPORTS MODULE-IDENTITY, OBJECT-TYPE, @@ -324,7 +331,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL ::= { stamfestMIB 1 } iptablesMIBObjects OBJECT IDENTIFIER ::= { iptablesMIB 1 } -@@ -77,7 +87,8 @@ +@@ -77,7 +87,8 @@ iptablesVersion OBJECT-TYPE ---------------------------------------------------------------------- iptableNamesTable OBJECT-TYPE @@ -334,7 +341,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS not-accessible STATUS current DESCRIPTION -@@ -100,7 +111,8 @@ +@@ -100,7 +111,8 @@ IptableNamesEntry ::= } tableIndex OBJECT-TYPE @@ -344,7 +351,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS read-only STATUS current DESCRIPTION -@@ -123,7 +135,8 @@ +@@ -123,7 +135,8 @@ tableName OBJECT-TYPE ---------------------------------------------------------------------- iptableChains OBJECT-TYPE @@ -354,7 +361,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS not-accessible STATUS current DESCRIPTION -@@ -131,12 +144,14 @@ +@@ -131,12 +144,14 @@ iptableChains OBJECT-TYPE ::= { iptablesMIBObjects 2 } iptableChainsEntry OBJECT-TYPE @@ -371,7 +378,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL ::= { iptableChains 1 } IptableChainsEntry ::= -@@ -144,13 +159,19 @@ +@@ -144,13 +159,19 @@ IptableChainsEntry ::= chainIndex Integer32, tableIndexC Integer32, chainName DisplayString, @@ -395,7 +402,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS read-only STATUS current DESCRIPTION -@@ -190,7 +211,8 @@ +@@ -190,7 +211,8 @@ chainPolicy OBJECT-TYPE ::= { iptableChainsEntry 5 } chainOctets OBJECT-TYPE @@ -405,7 +412,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS read-only STATUS current DESCRIPTION -@@ -198,7 +220,8 @@ +@@ -198,7 +220,8 @@ chainOctets OBJECT-TYPE ::= { iptableChainsEntry 6 } chainPackets OBJECT-TYPE @@ -415,7 +422,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS read-only STATUS current DESCRIPTION -@@ -212,7 +235,8 @@ +@@ -212,7 +235,8 @@ chainPackets OBJECT-TYPE ---------------------------------------------------------------------- iptableRules OBJECT-TYPE @@ -425,7 +432,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS not-accessible STATUS current DESCRIPTION -@@ -225,7 +249,8 @@ +@@ -225,7 +249,8 @@ iptableRulesEntry OBJECT-TYPE STATUS current DESCRIPTION "An entry containing and mapping of table and chain names." @@ -435,7 +442,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL ::= { iptableRules 1 } IptableRulesEntry ::= -@@ -235,9 +260,11 @@ +@@ -235,9 +260,11 @@ IptableRulesEntry ::= tableIndexR Integer32, chainNameR DisplayString, chainTableNameR DisplayString, @@ -450,7 +457,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL sourceIP IpAddress, sourceMask IpAddress, destinationIP IpAddress, -@@ -261,7 +288,8 @@ +@@ -261,7 +288,8 @@ chainIndexR OBJECT-TYPE ::= { iptableRulesEntry 2 } tableIndexR OBJECT-TYPE @@ -460,7 +467,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS read-only STATUS current DESCRIPTION -@@ -285,7 +313,8 @@ +@@ -285,7 +313,8 @@ chainTableNameR OBJECT-TYPE ::= { iptableRulesEntry 5 } ruleOctets OBJECT-TYPE @@ -470,7 +477,7 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS read-only STATUS current DESCRIPTION -@@ -293,7 +322,8 @@ +@@ -293,7 +322,8 @@ ruleOctets OBJECT-TYPE ::= { iptableRulesEntry 6 } rulePackets OBJECT-TYPE @@ -480,17 +487,18 @@ diff -urN iptables-snmp-0.1.orig/mibs/IPTABLES.MIB iptables-snmp-0.1/mibs/IPTABL MAX-ACCESS read-only STATUS current DESCRIPTION -@@ -350,4 +380,4 @@ +@@ -350,4 +380,4 @@ destinationMask OBJECT-TYPE ip6tablesMIBObjects OBJECT IDENTIFIER ::= { iptablesMIB 2 } -END \ No newline at end of file +END -diff -urN iptables-snmp-0.1.orig/mibs/STAMFEST.MIB iptables-snmp-0.1/mibs/STAMFEST.MIB ---- iptables-snmp-0.1.orig/mibs/STAMFEST.MIB 2003-03-19 03:02:56.000000000 -0500 -+++ iptables-snmp-0.1/mibs/STAMFEST.MIB 2012-02-23 08:55:26.000000000 -0500 -@@ -29,27 +29,36 @@ +diff --git mibs/STAMFEST.MIB mibs/STAMFEST.MIB +index 7d05030..05182c5 100644 +--- mibs/STAMFEST.MIB ++++ mibs/STAMFEST.MIB +@@ -29,27 +29,36 @@ STAMFEST-MIB DEFINITIONS ::= BEGIN ---------------------------------------------------------------------- IMPORTS @@ -537,3 +545,6 @@ diff -urN iptables-snmp-0.1.orig/mibs/STAMFEST.MIB iptables-snmp-0.1/mibs/STAMFE END +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/0003-Patch-from-https-dev.openwrt.org-ticket-11045.patch b/net-firewall/iptables-snmp/files/0003-Patch-from-https-dev.openwrt.org-ticket-11045.patch new file mode 100644 index 00000000..f0c940ba --- /dev/null +++ b/net-firewall/iptables-snmp/files/0003-Patch-from-https-dev.openwrt.org-ticket-11045.patch @@ -0,0 +1,487 @@ +From 1619d1d1ea325b691eb859b0c1bed45cbf887fcd Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:03:26 +0100 +Subject: [PATCH 3/9] Patch from https://dev.openwrt.org/ticket/11045 + 003-simplified-mibs.patch + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + include/iptables-snmp.h | 40 +++++----- + iptables-snmp.c | 4 + + iptables-snmp.h | 40 +++++----- + mibs/IPTABLES.MIB | 190 ++++++++++++++++++++++++------------------------ + 4 files changed, 138 insertions(+), 136 deletions(-) + +diff --git include/iptables-snmp.h include/iptables-snmp.h +index 2b23a2f..4746ff2 100644 +--- include/iptables-snmp.h ++++ include/iptables-snmp.h +@@ -45,29 +45,29 @@ void init_iptables(void); + + /* the chains table */ + +-#define C_CHAIN_INDEX 1 +-#define C_TABLE_INDEX 2 +-#define C_CHAIN_NAME 3 +-#define C_TABLE_NAME 4 +-#define C_CHAIN_POLICY 5 +-#define C_CHAIN_OCTETS 6 +-#define C_CHAIN_PACKETS 7 ++/* #define C_CHAIN_INDEX 1 */ ++/* #define C_TABLE_INDEX 2 */ ++#define C_TABLE_NAME 1 ++#define C_CHAIN_NAME 2 ++#define C_CHAIN_POLICY 3 ++#define C_CHAIN_OCTETS 4 ++#define C_CHAIN_PACKETS 5 + + /* the rules table */ + +-#define R_RULE_INDEX 1 +-#define R_CHAIN_INDEX 2 +-#define R_TABLE_INDEX 3 +-#define R_CHAIN_NAME_INDEX 4 +-#define R_TABLE_NAME_INDEX 5 +-#define R_OCTETS_INDEX 6 +-#define R_PACKETS_INDEX 7 +-#define R_RULE_SHORT_INDEX 8 +-#define R_SRC_IPADDR_INDEX 9 +-#define R_SRC_MASK_INDEX 10 +-#define R_DST_IPADDR_INDEX 11 +-#define R_DST_MASK_INDEX 12 ++/* #define R_RULE_INDEX 1 */ ++/* #define R_CHAIN_INDEX 2 */ ++/* #define R_TABLE_INDEX 3 */ ++#define R_TABLE_NAME_INDEX 1 ++#define R_CHAIN_NAME_INDEX 2 ++#define R_SRC_IPADDR_INDEX 3 ++#define R_SRC_MASK_INDEX 4 ++#define R_DST_IPADDR_INDEX 5 ++#define R_DST_MASK_INDEX 6 ++#define R_RULE_SHORT_INDEX 7 ++#define R_OCTETS_INDEX 8 ++#define R_PACKETS_INDEX 9 + +-#define R_MAX 12 ++#define R_MAX 9 + + #endif /* IPTABLES_SNMP_H_INCLUDED */ +diff --git iptables-snmp.c iptables-snmp.c +index 10d7374..f1dd72c 100644 +--- iptables-snmp.c ++++ iptables-snmp.c +@@ -506,6 +506,7 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + switch (reqinfo->mode) { + case MODE_GET: + switch (table_info->colnum) { ++/* + case C_CHAIN_INDEX: { + snmp_set_var_typed_value(var, ASN_INTEGER, + (void*) &chain, sizeof(chain)); +@@ -516,6 +517,7 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + (void*) &table, sizeof(table)); + break; + } ++*/ + case C_CHAIN_NAME: + case C_CHAIN_POLICY: + case C_CHAIN_OCTETS: +@@ -843,6 +845,7 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + switch (reqinfo->mode) { + case MODE_GET: + switch (table_info->colnum) { ++/* + case R_RULE_INDEX: { + snmp_set_var_typed_value(var, ASN_INTEGER, + (void*) &rule, sizeof(rule)); +@@ -858,6 +861,7 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + (void*) &table, sizeof(table)); + break; + } ++*/ + case R_CHAIN_NAME_INDEX: { + const char *cn; + int i; +diff --git iptables-snmp.h iptables-snmp.h +index 2b23a2f..4746ff2 100644 +--- iptables-snmp.h ++++ iptables-snmp.h +@@ -45,29 +45,29 @@ void init_iptables(void); + + /* the chains table */ + +-#define C_CHAIN_INDEX 1 +-#define C_TABLE_INDEX 2 +-#define C_CHAIN_NAME 3 +-#define C_TABLE_NAME 4 +-#define C_CHAIN_POLICY 5 +-#define C_CHAIN_OCTETS 6 +-#define C_CHAIN_PACKETS 7 ++/* #define C_CHAIN_INDEX 1 */ ++/* #define C_TABLE_INDEX 2 */ ++#define C_TABLE_NAME 1 ++#define C_CHAIN_NAME 2 ++#define C_CHAIN_POLICY 3 ++#define C_CHAIN_OCTETS 4 ++#define C_CHAIN_PACKETS 5 + + /* the rules table */ + +-#define R_RULE_INDEX 1 +-#define R_CHAIN_INDEX 2 +-#define R_TABLE_INDEX 3 +-#define R_CHAIN_NAME_INDEX 4 +-#define R_TABLE_NAME_INDEX 5 +-#define R_OCTETS_INDEX 6 +-#define R_PACKETS_INDEX 7 +-#define R_RULE_SHORT_INDEX 8 +-#define R_SRC_IPADDR_INDEX 9 +-#define R_SRC_MASK_INDEX 10 +-#define R_DST_IPADDR_INDEX 11 +-#define R_DST_MASK_INDEX 12 ++/* #define R_RULE_INDEX 1 */ ++/* #define R_CHAIN_INDEX 2 */ ++/* #define R_TABLE_INDEX 3 */ ++#define R_TABLE_NAME_INDEX 1 ++#define R_CHAIN_NAME_INDEX 2 ++#define R_SRC_IPADDR_INDEX 3 ++#define R_SRC_MASK_INDEX 4 ++#define R_DST_IPADDR_INDEX 5 ++#define R_DST_MASK_INDEX 6 ++#define R_RULE_SHORT_INDEX 7 ++#define R_OCTETS_INDEX 8 ++#define R_PACKETS_INDEX 9 + +-#define R_MAX 12 ++#define R_MAX 9 + + #endif /* IPTABLES_SNMP_H_INCLUDED */ +diff --git mibs/IPTABLES.MIB mibs/IPTABLES.MIB +index 105e4dc..faaabd9 100644 +--- mibs/IPTABLES.MIB ++++ mibs/IPTABLES.MIB +@@ -47,13 +47,13 @@ IMPORTS + stamfestMIB FROM STAMFEST-MIB; + + iptablesMIB MODULE-IDENTITY +- LAST-UPDATED "201202231600Z" ++ LAST-UPDATED "201202261600Z" + -- LAST-UPDATED "200303190800Z" + ORGANIZATION "Peter Stamfest - Unix, Networking and Computing Consultant" + CONTACT-INFO "peter@stamfest.at" + DESCRIPTION + "A MIB module describing linux iptables" +- REVISION "201202231600Z" ++ REVISION "201202261600Z" + DESCRIPTION + "Modified by AG to adhere to standards and + to reflect the latest version of libiptc." +@@ -86,7 +86,7 @@ iptablesVersion OBJECT-TYPE + -- + ---------------------------------------------------------------------- + +-iptableNamesTable OBJECT-TYPE ++iptableTables OBJECT-TYPE + -- next changed to SEQUENCE name by AG + SYNTAX SEQUENCE OF IptableNamesEntry + MAX-ACCESS not-accessible +@@ -102,7 +102,7 @@ iptableNamesEntry OBJECT-TYPE + DESCRIPTION + "An entry containing and mapping the name of a iptables table name." + INDEX { tableIndex } +- ::= { iptableNamesTable 1 } ++ ::= { iptableTables 1 } + + IptableNamesEntry ::= + SEQUENCE { +@@ -156,11 +156,11 @@ iptableChainsEntry OBJECT-TYPE + + IptableChainsEntry ::= + SEQUENCE { +- chainIndex Integer32, +- tableIndexC Integer32, +- chainName DisplayString, ++-- chainIndex Integer32, ++-- tableIndexC Integer32, + -- next added by AG + chainTableNameC DisplayString, ++ chainName DisplayString, + -- next comma added by AG + chainPolicy DisplayString, + -- next 2 changed to Counter64 by AG +@@ -169,22 +169,30 @@ IptableChainsEntry ::= + + } + +-chainIndex OBJECT-TYPE ++--chainIndex OBJECT-TYPE + -- next range added by AG +- SYNTAX Integer32 (0..65535) +- MAX-ACCESS read-only +- STATUS current +- DESCRIPTION +- "The index of the corresponding iptables chain within the table" +- ::= { iptableChainsEntry 1 } ++-- SYNTAX Integer32 (0..65535) ++-- MAX-ACCESS read-only ++-- STATUS current ++-- DESCRIPTION ++-- "The index of the corresponding iptables chain within the table" ++-- ::= { iptableChainsEntry 1 } ++ ++--tableIndexC OBJECT-TYPE ++-- SYNTAX Integer32 ++-- MAX-ACCESS read-only ++-- STATUS current ++-- DESCRIPTION ++-- "The index of the corresponding iptables table the chain belongs to." ++-- ::= { iptableChainsEntry 2 } + +-tableIndexC OBJECT-TYPE +- SYNTAX Integer32 ++chainTableNameC OBJECT-TYPE ++ SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The index of the corresponding iptables table the chain belongs to." +- ::= { iptableChainsEntry 2 } ++ "The name of the corresponding iptables table of the chain" ++ ::= { iptableChainsEntry 1 } + + chainName OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) +@@ -192,15 +200,7 @@ chainName OBJECT-TYPE + STATUS current + DESCRIPTION + "The name of the corresponding iptables chain" +- ::= { iptableChainsEntry 3 } +- +-chainTableNameC OBJECT-TYPE +- SYNTAX DisplayString (SIZE (0..255)) +- MAX-ACCESS read-only +- STATUS current +- DESCRIPTION +- "The name of the corresponding iptables table of the chain" +- ::= { iptableChainsEntry 4 } ++ ::= { iptableChainsEntry 2 } + + chainPolicy OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) +@@ -208,7 +208,7 @@ chainPolicy OBJECT-TYPE + STATUS current + DESCRIPTION + "The chain policy" +- ::= { iptableChainsEntry 5 } ++ ::= { iptableChainsEntry 3 } + + chainOctets OBJECT-TYPE + -- next changed to Counter64 by AG +@@ -217,7 +217,7 @@ chainOctets OBJECT-TYPE + STATUS current + DESCRIPTION + "The number of octets matched by this chain" +- ::= { iptableChainsEntry 6 } ++ ::= { iptableChainsEntry 4 } + + chainPackets OBJECT-TYPE + -- next changed to Counter64 by AG +@@ -226,7 +226,7 @@ chainPackets OBJECT-TYPE + STATUS current + DESCRIPTION + "The number of packets matched by this chain" +- ::= { iptableChainsEntry 7 } ++ ::= { iptableChainsEntry 5 } + + ---------------------------------------------------------------------- + -- +@@ -255,122 +255,120 @@ iptableRulesEntry OBJECT-TYPE + + IptableRulesEntry ::= + SEQUENCE { +- ruleIndex Integer32, +- chainIndexR Integer32, +- tableIndexR Integer32, +- chainNameR DisplayString, ++-- ruleIndex Integer32, ++-- chainIndexR Integer32, ++-- tableIndexR Integer32, + chainTableNameR DisplayString, +- -- next 2 changed to Counter64 by AG +- ruleOctets Counter64, +- rulePackets Counter64, +- -- next comma added by AG +- chainRule DisplayString, ++ chainNameR DisplayString, + sourceIP IpAddress, + sourceMask IpAddress, + destinationIP IpAddress, +- destinationMask IpAddress ++ destinationMask IpAddress, ++ -- next comma added by AG ++ chainRule DisplayString, ++ -- next 2 changed to Counter64 by AG ++ ruleOctets Counter64, ++ rulePackets Counter64 + } + +-ruleIndex OBJECT-TYPE +- SYNTAX Integer32 ++--ruleIndex OBJECT-TYPE ++-- SYNTAX Integer32 ++-- MAX-ACCESS read-only ++-- STATUS current ++-- DESCRIPTION ++-- "The index of the corresponding iptables rule within the chain within the table" ++-- ::= { iptableRulesEntry 1 } ++ ++--chainIndexR OBJECT-TYPE ++-- SYNTAX Integer32 ++-- MAX-ACCESS read-only ++-- STATUS current ++-- DESCRIPTION ++-- "The index of the corresponding iptables chain within the table" ++-- ::= { iptableRulesEntry 2 } ++ ++--tableIndexR OBJECT-TYPE ++ -- next range added by AG ++-- SYNTAX Integer32 (0..65535) ++-- MAX-ACCESS read-only ++-- STATUS current ++-- DESCRIPTION ++-- "The index of the corresponding iptables chain" ++-- ::= { iptableRulesEntry 3 } ++ ++chainTableNameR OBJECT-TYPE ++ SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The index of the corresponding iptables rule within the chain within the table" ++ "The name of the table of the corresponding iptables chain" + ::= { iptableRulesEntry 1 } + +-chainIndexR OBJECT-TYPE +- SYNTAX Integer32 ++chainNameR OBJECT-TYPE ++ SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The index of the corresponding iptables chain within the table" ++ "The name of the corresponding iptables chain" + ::= { iptableRulesEntry 2 } + +-tableIndexR OBJECT-TYPE +- -- next range added by AG +- SYNTAX Integer32 (0..65535) ++sourceIP OBJECT-TYPE ++ SYNTAX IpAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The index of the corresponding iptables chain" ++ "The source ip address the rule matches" + ::= { iptableRulesEntry 3 } + +-chainNameR OBJECT-TYPE +- SYNTAX DisplayString (SIZE (0..255)) ++sourceMask OBJECT-TYPE ++ SYNTAX IpAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The name of the corresponding iptables chain" ++ "The source ip netmask the rule matches" + ::= { iptableRulesEntry 4 } + +-chainTableNameR OBJECT-TYPE +- SYNTAX DisplayString (SIZE (0..255)) ++destinationIP OBJECT-TYPE ++ SYNTAX IpAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The name of the table of the corresponding iptables chain" ++ "The destination ip address the rule matches" + ::= { iptableRulesEntry 5 } + +-ruleOctets OBJECT-TYPE +- -- next changed to Counter64 by AG +- SYNTAX Counter64 ++destinationMask OBJECT-TYPE ++ SYNTAX IpAddress + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The number of octets matched by this rule" ++ "The destination ip netmask the rule matches" + ::= { iptableRulesEntry 6 } + +-rulePackets OBJECT-TYPE +- -- next changed to Counter64 by AG +- SYNTAX Counter64 +- MAX-ACCESS read-only +- STATUS current +- DESCRIPTION +- "The number of packets matched by this rule" +- ::= { iptableRulesEntry 7 } +- +- +- + chainRule OBJECT-TYPE + SYNTAX DisplayString (SIZE (0..255)) + MAX-ACCESS read-only + STATUS current + DESCRIPTION + "The name of the table of the corresponding iptables chain" +- ::= { iptableRulesEntry 8 } +- +-sourceIP OBJECT-TYPE +- SYNTAX IpAddress +- MAX-ACCESS read-only +- STATUS current +- DESCRIPTION +- "The source ip address the rule matches" +- ::= { iptableRulesEntry 9 } +- +-sourceMask OBJECT-TYPE +- SYNTAX IpAddress +- MAX-ACCESS read-only +- STATUS current +- DESCRIPTION +- "The source ip netmask the rule matches" +- ::= { iptableRulesEntry 10 } ++ ::= { iptableRulesEntry 7 } + +-destinationIP OBJECT-TYPE +- SYNTAX IpAddress ++ruleOctets OBJECT-TYPE ++ -- next changed to Counter64 by AG ++ SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The destination ip address the rule matches" +- ::= { iptableRulesEntry 11 } ++ "The number of octets matched by this rule" ++ ::= { iptableRulesEntry 8 } + +-destinationMask OBJECT-TYPE +- SYNTAX IpAddress ++rulePackets OBJECT-TYPE ++ -- next changed to Counter64 by AG ++ SYNTAX Counter64 + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The destination ip netmask the rule matches" +- ::= { iptableRulesEntry 12 } ++ "The number of packets matched by this rule" ++ ::= { iptableRulesEntry 9 } + + ---------------------------------------------------------------------------- + -- +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/0004-MINOR-Remove-unused-source-directories.patch b/net-firewall/iptables-snmp/files/0004-MINOR-Remove-unused-source-directories.patch new file mode 100644 index 00000000..e53b7615 --- /dev/null +++ b/net-firewall/iptables-snmp/files/0004-MINOR-Remove-unused-source-directories.patch @@ -0,0 +1,4524 @@ +From 98256a203028c5076f7ebca07b90d614277f9b5f Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:05:44 +0100 +Subject: [PATCH 4/9] MINOR: Remove unused source directories + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + Makefile.in | 2 +- + include/iptables-snmp.h | 73 -- + include/libiptc/ipt_kernel_headers.h | 27 - + include/libiptc/libip6tc.h | 154 --- + include/libiptc/libiptc.h | 166 --- + include/libiptc/linux_stddef.h | 39 - + include/linux_list.h | 723 ----------- + libiptc/Makefile | 23 - + libiptc/libip4tc.c | 500 -------- + libiptc/libip6tc.c | 439 ------- + libiptc/libiptc.c | 2274 ---------------------------------- + 11 files changed, 1 insertion(+), 4419 deletions(-) + delete mode 100644 include/iptables-snmp.h + delete mode 100644 include/libiptc/ipt_kernel_headers.h + delete mode 100644 include/libiptc/libip6tc.h + delete mode 100644 include/libiptc/libiptc.h + delete mode 100644 include/libiptc/linux_stddef.h + delete mode 100644 include/linux_list.h + delete mode 100644 libiptc/Makefile + delete mode 100644 libiptc/libip4tc.c + delete mode 100644 libiptc/libip6tc.c + delete mode 100644 libiptc/libiptc.c + +diff --git Makefile.in Makefile.in +index 80d47c5..8b2e0a3 100644 +--- Makefile.in ++++ Makefile.in +@@ -79,7 +79,7 @@ $(LIBIPTC_OBJS): libiptc/libiptc.c + .c.o: + $(CC) $(CFLAGS) $(OTHER) $(DFLAGS) -c -o $@ $< + +-iptables-snmp.o: include/iptables-snmp.h ++iptables-snmp.o: iptables-snmp.h + + clean: local-clean + +diff --git include/iptables-snmp.h include/iptables-snmp.h +deleted file mode 100644 +index 4746ff2..0000000 +--- include/iptables-snmp.h ++++ /dev/null +@@ -1,73 +0,0 @@ +-/* +- * $Id$ +- * +- * This file is part of iptables-snmp - using SNMP to read data from linux +- * iptables +- * +- * iptables-snmp is copyrighted software: +- * (c) 2003 by Peter Stamfest <peter@stamfest.at> +- * +- * iptables-snmp is free software; you can redistribute it and/or modify +- * it under the terms of the GNU General Public License as published by +- * the Free Software Foundation; either version 2 of the License, or +- * (at your option) any later version. +- * +- * iptables-snmp is distributed in the hope that it will be useful, +- * but WITHOUT ANY WARRANTY; without even the implied warranty of +- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +- * GNU General Public License for more details. +- * +- * You should have received a copy of the GNU General Public License +- * along with iptables-snmp; if not, write to the Free Software +- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +- * +- * Note: See the file COPYING for the GNU General Public License and some +- * extensions to it designed to protect the OID space of Peter Stamfest from +- * becoming polluted. +- */ +-#ifndef IPTABLES_SNMP_H_INCLUDED +-#define IPTABLES_SNMP_H_INCLUDED +- +-/* init function */ +-void init_iptables(void); +- +-#define STAMFEST_OID 1,3,6,1,4,1,12806 +- +-/* USE_ENTERPRISE_OID may get passed on the commandline (-D) */ +-#ifndef USE_ENTERPRISE_OID +-# define USE_ENTERPRISE_OID STAMFEST_OID +-#endif +- +-#define BASE_OID USE_ENTERPRISE_OID,6,1 +- +-#define AGENT_VERSION_INDEX 1 +-#define IPTABLES_VERSION_INDEX 2 +- +-/* the chains table */ +- +-/* #define C_CHAIN_INDEX 1 */ +-/* #define C_TABLE_INDEX 2 */ +-#define C_TABLE_NAME 1 +-#define C_CHAIN_NAME 2 +-#define C_CHAIN_POLICY 3 +-#define C_CHAIN_OCTETS 4 +-#define C_CHAIN_PACKETS 5 +- +-/* the rules table */ +- +-/* #define R_RULE_INDEX 1 */ +-/* #define R_CHAIN_INDEX 2 */ +-/* #define R_TABLE_INDEX 3 */ +-#define R_TABLE_NAME_INDEX 1 +-#define R_CHAIN_NAME_INDEX 2 +-#define R_SRC_IPADDR_INDEX 3 +-#define R_SRC_MASK_INDEX 4 +-#define R_DST_IPADDR_INDEX 5 +-#define R_DST_MASK_INDEX 6 +-#define R_RULE_SHORT_INDEX 7 +-#define R_OCTETS_INDEX 8 +-#define R_PACKETS_INDEX 9 +- +-#define R_MAX 9 +- +-#endif /* IPTABLES_SNMP_H_INCLUDED */ +diff --git include/libiptc/ipt_kernel_headers.h include/libiptc/ipt_kernel_headers.h +deleted file mode 100644 +index 18861fe..0000000 +--- include/libiptc/ipt_kernel_headers.h ++++ /dev/null +@@ -1,27 +0,0 @@ +-/* This is the userspace/kernel interface for Generic IP Chains, +- required for libc6. */ +-#ifndef _FWCHAINS_KERNEL_HEADERS_H +-#define _FWCHAINS_KERNEL_HEADERS_H +- +-#include <limits.h> +- +-#if defined(__GLIBC__) && __GLIBC__ == 2 +-#include <netinet/ip.h> +-#include <netinet/in.h> +-#include <netinet/ip_icmp.h> +-#include <netinet/tcp.h> +-#include <netinet/udp.h> +-#include <net/if.h> +-#include <sys/types.h> +-#else /* libc5 */ +-#include <sys/socket.h> +-#include <linux/ip.h> +-#include <linux/in.h> +-#include <linux/if.h> +-#include <linux/icmp.h> +-#include <linux/tcp.h> +-#include <linux/udp.h> +-#include <linux/types.h> +-#include <linux/in6.h> +-#endif +-#endif +diff --git include/libiptc/libip6tc.h include/libiptc/libip6tc.h +deleted file mode 100644 +index 7a247c4..0000000 +--- include/libiptc/libip6tc.h ++++ /dev/null +@@ -1,154 +0,0 @@ +-#ifndef _LIBIP6TC_H +-#define _LIBIP6TC_H +-/* Library which manipulates firewall rules. Version 0.2. */ +- +-#include <libiptc/ipt_kernel_headers.h> +-#include <linux/netfilter_ipv6/ip6_tables.h> +- +-#ifndef IP6T_MIN_ALIGN +-#define IP6T_MIN_ALIGN (__alignof__(struct ip6t_entry)) +-#endif +-#define IP6T_ALIGN(s) (((s) + (IP6T_MIN_ALIGN-1)) & ~(IP6T_MIN_ALIGN-1)) +- +-typedef char ip6t_chainlabel[32]; +- +-#define IP6TC_LABEL_ACCEPT "ACCEPT" +-#define IP6TC_LABEL_DROP "DROP" +-#define IP6TC_LABEL_QUEUE "QUEUE" +-#define IP6TC_LABEL_RETURN "RETURN" +- +-/* Transparent handle type. */ +-typedef struct ip6tc_handle *ip6tc_handle_t; +- +-/* Does this chain exist? */ +-int ip6tc_is_chain(const char *chain, const ip6tc_handle_t handle); +- +-/* Take a snapshot of the rules. Returns NULL on error. */ +-ip6tc_handle_t ip6tc_init(const char *tablename); +- +-/* Cleanup after ip6tc_init(). */ +-void ip6tc_free(ip6tc_handle_t *h); +- +-/* Iterator functions to run through the chains. Returns NULL at end. */ +-const char *ip6tc_first_chain(ip6tc_handle_t *handle); +-const char *ip6tc_next_chain(ip6tc_handle_t *handle); +- +-/* Get first rule in the given chain: NULL for empty chain. */ +-const struct ip6t_entry *ip6tc_first_rule(const char *chain, +- ip6tc_handle_t *handle); +- +-/* Returns NULL when rules run out. */ +-const struct ip6t_entry *ip6tc_next_rule(const struct ip6t_entry *prev, +- ip6tc_handle_t *handle); +- +-/* Returns a pointer to the target name of this position. */ +-const char *ip6tc_get_target(const struct ip6t_entry *e, +- ip6tc_handle_t *handle); +- +-/* Is this a built-in chain? */ +-int ip6tc_builtin(const char *chain, const ip6tc_handle_t handle); +- +-/* Get the policy of a given built-in chain */ +-const char *ip6tc_get_policy(const char *chain, +- struct ip6t_counters *counters, +- ip6tc_handle_t *handle); +- +-/* These functions return TRUE for OK or 0 and set errno. If errno == +- 0, it means there was a version error (ie. upgrade libiptc). */ +-/* Rule numbers start at 1 for the first rule. */ +- +-/* Insert the entry `fw' in chain `chain' into position `rulenum'. */ +-int ip6tc_insert_entry(const ip6t_chainlabel chain, +- const struct ip6t_entry *e, +- unsigned int rulenum, +- ip6tc_handle_t *handle); +- +-/* Atomically replace rule `rulenum' in `chain' with `fw'. */ +-int ip6tc_replace_entry(const ip6t_chainlabel chain, +- const struct ip6t_entry *e, +- unsigned int rulenum, +- ip6tc_handle_t *handle); +- +-/* Append entry `fw' to chain `chain'. Equivalent to insert with +- rulenum = length of chain. */ +-int ip6tc_append_entry(const ip6t_chainlabel chain, +- const struct ip6t_entry *e, +- ip6tc_handle_t *handle); +- +-/* Delete the first rule in `chain' which matches `fw'. */ +-int ip6tc_delete_entry(const ip6t_chainlabel chain, +- const struct ip6t_entry *origfw, +- unsigned char *matchmask, +- ip6tc_handle_t *handle); +- +-/* Delete the rule in position `rulenum' in `chain'. */ +-int ip6tc_delete_num_entry(const ip6t_chainlabel chain, +- unsigned int rulenum, +- ip6tc_handle_t *handle); +- +-/* Check the packet `fw' on chain `chain'. Returns the verdict, or +- NULL and sets errno. */ +-const char *ip6tc_check_packet(const ip6t_chainlabel chain, +- struct ip6t_entry *, +- ip6tc_handle_t *handle); +- +-/* Flushes the entries in the given chain (ie. empties chain). */ +-int ip6tc_flush_entries(const ip6t_chainlabel chain, +- ip6tc_handle_t *handle); +- +-/* Zeroes the counters in a chain. */ +-int ip6tc_zero_entries(const ip6t_chainlabel chain, +- ip6tc_handle_t *handle); +- +-/* Creates a new chain. */ +-int ip6tc_create_chain(const ip6t_chainlabel chain, +- ip6tc_handle_t *handle); +- +-/* Deletes a chain. */ +-int ip6tc_delete_chain(const ip6t_chainlabel chain, +- ip6tc_handle_t *handle); +- +-/* Renames a chain. */ +-int ip6tc_rename_chain(const ip6t_chainlabel oldname, +- const ip6t_chainlabel newname, +- ip6tc_handle_t *handle); +- +-/* Sets the policy on a built-in chain. */ +-int ip6tc_set_policy(const ip6t_chainlabel chain, +- const ip6t_chainlabel policy, +- struct ip6t_counters *counters, +- ip6tc_handle_t *handle); +- +-/* Get the number of references to this chain */ +-int ip6tc_get_references(unsigned int *ref, const ip6t_chainlabel chain, +- ip6tc_handle_t *handle); +- +-/* read packet and byte counters for a specific rule */ +-struct ip6t_counters *ip6tc_read_counter(const ip6t_chainlabel chain, +- unsigned int rulenum, +- ip6tc_handle_t *handle); +- +-/* zero packet and byte counters for a specific rule */ +-int ip6tc_zero_counter(const ip6t_chainlabel chain, +- unsigned int rulenum, +- ip6tc_handle_t *handle); +- +-/* set packet and byte counters for a specific rule */ +-int ip6tc_set_counter(const ip6t_chainlabel chain, +- unsigned int rulenum, +- struct ip6t_counters *counters, +- ip6tc_handle_t *handle); +- +-/* Makes the actual changes. */ +-int ip6tc_commit(ip6tc_handle_t *handle); +- +-/* Get raw socket. */ +-int ip6tc_get_raw_socket(); +- +-/* Translates errno numbers into more human-readable form than strerror. */ +-const char *ip6tc_strerror(int err); +- +-/* Return prefix length, or -1 if not contiguous */ +-int ipv6_prefix_length(const struct in6_addr *a); +- +-#endif /* _LIBIP6TC_H */ +diff --git include/libiptc/libiptc.h include/libiptc/libiptc.h +deleted file mode 100644 +index 50765d9..0000000 +--- include/libiptc/libiptc.h ++++ /dev/null +@@ -1,166 +0,0 @@ +-#ifndef _LIBIPTC_H +-#define _LIBIPTC_H +-/* Library which manipulates filtering rules. */ +- +-#include <libiptc/ipt_kernel_headers.h> +-#include <linux/netfilter_ipv4/ip_tables.h> +- +-#ifdef __cplusplus +-extern "C" { +-#endif +- +-#ifndef IPT_MIN_ALIGN +-/* ipt_entry has pointers and u_int64_t's in it, so if you align to +- it, you'll also align to any crazy matches and targets someone +- might write */ +-#define IPT_MIN_ALIGN (__alignof__(struct ipt_entry)) +-#endif +- +-#define IPT_ALIGN(s) (((s) + ((IPT_MIN_ALIGN)-1)) & ~((IPT_MIN_ALIGN)-1)) +- +-typedef char ipt_chainlabel[32]; +- +-#define IPTC_LABEL_ACCEPT "ACCEPT" +-#define IPTC_LABEL_DROP "DROP" +-#define IPTC_LABEL_QUEUE "QUEUE" +-#define IPTC_LABEL_RETURN "RETURN" +- +-/* Transparent handle type. */ +-typedef struct iptc_handle *iptc_handle_t; +- +-/* Does this chain exist? */ +-int iptc_is_chain(const char *chain, const iptc_handle_t handle); +- +-/* Take a snapshot of the rules. Returns NULL on error. */ +-iptc_handle_t iptc_init(const char *tablename); +- +-/* Cleanup after iptc_init(). */ +-void iptc_free(iptc_handle_t *h); +- +-/* Iterator functions to run through the chains. Returns NULL at end. */ +-const char *iptc_first_chain(iptc_handle_t *handle); +-const char *iptc_next_chain(iptc_handle_t *handle); +- +-/* Get first rule in the given chain: NULL for empty chain. */ +-const struct ipt_entry *iptc_first_rule(const char *chain, +- iptc_handle_t *handle); +- +-/* Returns NULL when rules run out. */ +-const struct ipt_entry *iptc_next_rule(const struct ipt_entry *prev, +- iptc_handle_t *handle); +- +-/* Returns a pointer to the target name of this entry. */ +-const char *iptc_get_target(const struct ipt_entry *e, +- iptc_handle_t *handle); +- +-/* Is this a built-in chain? */ +-int iptc_builtin(const char *chain, const iptc_handle_t handle); +- +-/* Get the policy of a given built-in chain */ +-const char *iptc_get_policy(const char *chain, +- struct ipt_counters *counter, +- iptc_handle_t *handle); +- +-/* These functions return TRUE for OK or 0 and set errno. If errno == +- 0, it means there was a version error (ie. upgrade libiptc). */ +-/* Rule numbers start at 1 for the first rule. */ +- +-/* Insert the entry `e' in chain `chain' into position `rulenum'. */ +-int iptc_insert_entry(const ipt_chainlabel chain, +- const struct ipt_entry *e, +- unsigned int rulenum, +- iptc_handle_t *handle); +- +-/* Atomically replace rule `rulenum' in `chain' with `e'. */ +-int iptc_replace_entry(const ipt_chainlabel chain, +- const struct ipt_entry *e, +- unsigned int rulenum, +- iptc_handle_t *handle); +- +-/* Append entry `e' to chain `chain'. Equivalent to insert with +- rulenum = length of chain. */ +-int iptc_append_entry(const ipt_chainlabel chain, +- const struct ipt_entry *e, +- iptc_handle_t *handle); +- +-/* Delete the first rule in `chain' which matches `e', subject to +- matchmask (array of length == origfw) */ +-int iptc_delete_entry(const ipt_chainlabel chain, +- const struct ipt_entry *origfw, +- unsigned char *matchmask, +- iptc_handle_t *handle); +- +-/* Delete the rule in position `rulenum' in `chain'. */ +-int iptc_delete_num_entry(const ipt_chainlabel chain, +- unsigned int rulenum, +- iptc_handle_t *handle); +- +-/* Check the packet `e' on chain `chain'. Returns the verdict, or +- NULL and sets errno. */ +-const char *iptc_check_packet(const ipt_chainlabel chain, +- struct ipt_entry *entry, +- iptc_handle_t *handle); +- +-/* Flushes the entries in the given chain (ie. empties chain). */ +-int iptc_flush_entries(const ipt_chainlabel chain, +- iptc_handle_t *handle); +- +-/* Zeroes the counters in a chain. */ +-int iptc_zero_entries(const ipt_chainlabel chain, +- iptc_handle_t *handle); +- +-/* Creates a new chain. */ +-int iptc_create_chain(const ipt_chainlabel chain, +- iptc_handle_t *handle); +- +-/* Deletes a chain. */ +-int iptc_delete_chain(const ipt_chainlabel chain, +- iptc_handle_t *handle); +- +-/* Renames a chain. */ +-int iptc_rename_chain(const ipt_chainlabel oldname, +- const ipt_chainlabel newname, +- iptc_handle_t *handle); +- +-/* Sets the policy on a built-in chain. */ +-int iptc_set_policy(const ipt_chainlabel chain, +- const ipt_chainlabel policy, +- struct ipt_counters *counters, +- iptc_handle_t *handle); +- +-/* Get the number of references to this chain */ +-int iptc_get_references(unsigned int *ref, +- const ipt_chainlabel chain, +- iptc_handle_t *handle); +- +-/* read packet and byte counters for a specific rule */ +-struct ipt_counters *iptc_read_counter(const ipt_chainlabel chain, +- unsigned int rulenum, +- iptc_handle_t *handle); +- +-/* zero packet and byte counters for a specific rule */ +-int iptc_zero_counter(const ipt_chainlabel chain, +- unsigned int rulenum, +- iptc_handle_t *handle); +- +-/* set packet and byte counters for a specific rule */ +-int iptc_set_counter(const ipt_chainlabel chain, +- unsigned int rulenum, +- struct ipt_counters *counters, +- iptc_handle_t *handle); +- +-/* Makes the actual changes. */ +-int iptc_commit(iptc_handle_t *handle); +- +-/* Get raw socket. */ +-int iptc_get_raw_socket(); +- +-/* Translates errno numbers into more human-readable form than strerror. */ +-const char *iptc_strerror(int err); +- +-#ifdef __cplusplus +-} +-#endif +- +- +-#endif /* _LIBIPTC_H */ +diff --git include/libiptc/linux_stddef.h include/libiptc/linux_stddef.h +deleted file mode 100644 +index 56416f1..0000000 +--- include/libiptc/linux_stddef.h ++++ /dev/null +@@ -1,39 +0,0 @@ +-#ifndef _LINUX_STDDEF_H +-#define _LINUX_STDDEF_H +- +-#undef NULL +-#if defined(__cplusplus) +-#define NULL 0 +-#else +-#define NULL ((void *)0) +-#endif +- +-#undef offsetof +-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +- +- +-/** +- * container_of - cast a member of a structure out to the containing structure +- * +- * @ptr: the pointer to the member. +- * @type: the type of the container struct this is embedded in. +- * @member: the name of the member within the struct. +- * +- */ +-#define container_of(ptr, type, member) ({ \ +- const typeof( ((type *)0)->member ) *__mptr = (ptr); \ +- (type *)( (char *)__mptr - offsetof(type,member) );}) +- +-/* +- * Check at compile time that something is of a particular type. +- * Always evaluates to 1 so you may use it easily in comparisons. +- */ +-#define typecheck(type,x) \ +-({ type __dummy; \ +- typeof(x) __dummy2; \ +- (void)(&__dummy == &__dummy2); \ +- 1; \ +-}) +- +- +-#endif +diff --git include/linux_list.h include/linux_list.h +deleted file mode 100644 +index abdcf88..0000000 +--- include/linux_list.h ++++ /dev/null +@@ -1,723 +0,0 @@ +-#ifndef _LINUX_LIST_H +-#define _LINUX_LIST_H +- +-#undef offsetof +-#define offsetof(TYPE, MEMBER) ((size_t) &((TYPE *)0)->MEMBER) +- +-/** +- * container_of - cast a member of a structure out to the containing structure +- * +- * @ptr: the pointer to the member. +- * @type: the type of the container struct this is embedded in. +- * @member: the name of the member within the struct. +- * +- */ +-#define container_of(ptr, type, member) ({ \ +- const typeof( ((type *)0)->member ) *__mptr = (ptr); \ +- (type *)( (char *)__mptr - offsetof(type,member) );}) +- +-/* +- * Check at compile time that something is of a particular type. +- * Always evaluates to 1 so you may use it easily in comparisons. +- */ +-#define typecheck(type,x) \ +-({ type __dummy; \ +- typeof(x) __dummy2; \ +- (void)(&__dummy == &__dummy2); \ +- 1; \ +-}) +- +-#define prefetch(x) 1 +- +-/* empty define to make this work in userspace -HW */ +-#define smp_wmb() +- +-/* +- * These are non-NULL pointers that will result in page faults +- * under normal circumstances, used to verify that nobody uses +- * non-initialized list entries. +- */ +-#define LIST_POISON1 ((void *) 0x00100100) +-#define LIST_POISON2 ((void *) 0x00200200) +- +-/* +- * Simple doubly linked list implementation. +- * +- * Some of the internal functions ("__xxx") are useful when +- * manipulating whole lists rather than single entries, as +- * sometimes we already know the next/prev entries and we can +- * generate better code by using them directly rather than +- * using the generic single-entry routines. +- */ +- +-struct list_head { +- struct list_head *next, *prev; +-}; +- +-#define LIST_HEAD_INIT(name) { &(name), &(name) } +- +-#define LIST_HEAD(name) \ +- struct list_head name = LIST_HEAD_INIT(name) +- +-#define INIT_LIST_HEAD(ptr) do { \ +- (ptr)->next = (ptr); (ptr)->prev = (ptr); \ +-} while (0) +- +-/* +- * Insert a new entry between two known consecutive entries. +- * +- * This is only for internal list manipulation where we know +- * the prev/next entries already! +- */ +-static inline void __list_add(struct list_head *new, +- struct list_head *prev, +- struct list_head *next) +-{ +- next->prev = new; +- new->next = next; +- new->prev = prev; +- prev->next = new; +-} +- +-/** +- * list_add - add a new entry +- * @new: new entry to be added +- * @head: list head to add it after +- * +- * Insert a new entry after the specified head. +- * This is good for implementing stacks. +- */ +-static inline void list_add(struct list_head *new, struct list_head *head) +-{ +- __list_add(new, head, head->next); +-} +- +-/** +- * list_add_tail - add a new entry +- * @new: new entry to be added +- * @head: list head to add it before +- * +- * Insert a new entry before the specified head. +- * This is useful for implementing queues. +- */ +-static inline void list_add_tail(struct list_head *new, struct list_head *head) +-{ +- __list_add(new, head->prev, head); +-} +- +-/* +- * Insert a new entry between two known consecutive entries. +- * +- * This is only for internal list manipulation where we know +- * the prev/next entries already! +- */ +-static inline void __list_add_rcu(struct list_head * new, +- struct list_head * prev, struct list_head * next) +-{ +- new->next = next; +- new->prev = prev; +- smp_wmb(); +- next->prev = new; +- prev->next = new; +-} +- +-/** +- * list_add_rcu - add a new entry to rcu-protected list +- * @new: new entry to be added +- * @head: list head to add it after +- * +- * Insert a new entry after the specified head. +- * This is good for implementing stacks. +- * +- * The caller must take whatever precautions are necessary +- * (such as holding appropriate locks) to avoid racing +- * with another list-mutation primitive, such as list_add_rcu() +- * or list_del_rcu(), running on this same list. +- * However, it is perfectly legal to run concurrently with +- * the _rcu list-traversal primitives, such as +- * list_for_each_entry_rcu(). +- */ +-static inline void list_add_rcu(struct list_head *new, struct list_head *head) +-{ +- __list_add_rcu(new, head, head->next); +-} +- +-/** +- * list_add_tail_rcu - add a new entry to rcu-protected list +- * @new: new entry to be added +- * @head: list head to add it before +- * +- * Insert a new entry before the specified head. +- * This is useful for implementing queues. +- * +- * The caller must take whatever precautions are necessary +- * (such as holding appropriate locks) to avoid racing +- * with another list-mutation primitive, such as list_add_tail_rcu() +- * or list_del_rcu(), running on this same list. +- * However, it is perfectly legal to run concurrently with +- * the _rcu list-traversal primitives, such as +- * list_for_each_entry_rcu(). +- */ +-static inline void list_add_tail_rcu(struct list_head *new, +- struct list_head *head) +-{ +- __list_add_rcu(new, head->prev, head); +-} +- +-/* +- * Delete a list entry by making the prev/next entries +- * point to each other. +- * +- * This is only for internal list manipulation where we know +- * the prev/next entries already! +- */ +-static inline void __list_del(struct list_head * prev, struct list_head * next) +-{ +- next->prev = prev; +- prev->next = next; +-} +- +-/** +- * list_del - deletes entry from list. +- * @entry: the element to delete from the list. +- * Note: list_empty on entry does not return true after this, the entry is +- * in an undefined state. +- */ +-static inline void list_del(struct list_head *entry) +-{ +- __list_del(entry->prev, entry->next); +- entry->next = LIST_POISON1; +- entry->prev = LIST_POISON2; +-} +- +-/** +- * list_del_rcu - deletes entry from list without re-initialization +- * @entry: the element to delete from the list. +- * +- * Note: list_empty on entry does not return true after this, +- * the entry is in an undefined state. It is useful for RCU based +- * lockfree traversal. +- * +- * In particular, it means that we can not poison the forward +- * pointers that may still be used for walking the list. +- * +- * The caller must take whatever precautions are necessary +- * (such as holding appropriate locks) to avoid racing +- * with another list-mutation primitive, such as list_del_rcu() +- * or list_add_rcu(), running on this same list. +- * However, it is perfectly legal to run concurrently with +- * the _rcu list-traversal primitives, such as +- * list_for_each_entry_rcu(). +- * +- * Note that the caller is not permitted to immediately free +- * the newly deleted entry. Instead, either synchronize_kernel() +- * or call_rcu() must be used to defer freeing until an RCU +- * grace period has elapsed. +- */ +-static inline void list_del_rcu(struct list_head *entry) +-{ +- __list_del(entry->prev, entry->next); +- entry->prev = LIST_POISON2; +-} +- +-/** +- * list_del_init - deletes entry from list and reinitialize it. +- * @entry: the element to delete from the list. +- */ +-static inline void list_del_init(struct list_head *entry) +-{ +- __list_del(entry->prev, entry->next); +- INIT_LIST_HEAD(entry); +-} +- +-/** +- * list_move - delete from one list and add as another's head +- * @list: the entry to move +- * @head: the head that will precede our entry +- */ +-static inline void list_move(struct list_head *list, struct list_head *head) +-{ +- __list_del(list->prev, list->next); +- list_add(list, head); +-} +- +-/** +- * list_move_tail - delete from one list and add as another's tail +- * @list: the entry to move +- * @head: the head that will follow our entry +- */ +-static inline void list_move_tail(struct list_head *list, +- struct list_head *head) +-{ +- __list_del(list->prev, list->next); +- list_add_tail(list, head); +-} +- +-/** +- * list_empty - tests whether a list is empty +- * @head: the list to test. +- */ +-static inline int list_empty(const struct list_head *head) +-{ +- return head->next == head; +-} +- +-/** +- * list_empty_careful - tests whether a list is +- * empty _and_ checks that no other CPU might be +- * in the process of still modifying either member +- * +- * NOTE: using list_empty_careful() without synchronization +- * can only be safe if the only activity that can happen +- * to the list entry is list_del_init(). Eg. it cannot be used +- * if another CPU could re-list_add() it. +- * +- * @head: the list to test. +- */ +-static inline int list_empty_careful(const struct list_head *head) +-{ +- struct list_head *next = head->next; +- return (next == head) && (next == head->prev); +-} +- +-static inline void __list_splice(struct list_head *list, +- struct list_head *head) +-{ +- struct list_head *first = list->next; +- struct list_head *last = list->prev; +- struct list_head *at = head->next; +- +- first->prev = head; +- head->next = first; +- +- last->next = at; +- at->prev = last; +-} +- +-/** +- * list_splice - join two lists +- * @list: the new list to add. +- * @head: the place to add it in the first list. +- */ +-static inline void list_splice(struct list_head *list, struct list_head *head) +-{ +- if (!list_empty(list)) +- __list_splice(list, head); +-} +- +-/** +- * list_splice_init - join two lists and reinitialise the emptied list. +- * @list: the new list to add. +- * @head: the place to add it in the first list. +- * +- * The list at @list is reinitialised +- */ +-static inline void list_splice_init(struct list_head *list, +- struct list_head *head) +-{ +- if (!list_empty(list)) { +- __list_splice(list, head); +- INIT_LIST_HEAD(list); +- } +-} +- +-/** +- * list_entry - get the struct for this entry +- * @ptr: the &struct list_head pointer. +- * @type: the type of the struct this is embedded in. +- * @member: the name of the list_struct within the struct. +- */ +-#define list_entry(ptr, type, member) \ +- container_of(ptr, type, member) +- +-/** +- * list_for_each - iterate over a list +- * @pos: the &struct list_head to use as a loop counter. +- * @head: the head for your list. +- */ +-#define list_for_each(pos, head) \ +- for (pos = (head)->next, prefetch(pos->next); pos != (head); \ +- pos = pos->next, prefetch(pos->next)) +- +-/** +- * __list_for_each - iterate over a list +- * @pos: the &struct list_head to use as a loop counter. +- * @head: the head for your list. +- * +- * This variant differs from list_for_each() in that it's the +- * simplest possible list iteration code, no prefetching is done. +- * Use this for code that knows the list to be very short (empty +- * or 1 entry) most of the time. +- */ +-#define __list_for_each(pos, head) \ +- for (pos = (head)->next; pos != (head); pos = pos->next) +- +-/** +- * list_for_each_prev - iterate over a list backwards +- * @pos: the &struct list_head to use as a loop counter. +- * @head: the head for your list. +- */ +-#define list_for_each_prev(pos, head) \ +- for (pos = (head)->prev, prefetch(pos->prev); pos != (head); \ +- pos = pos->prev, prefetch(pos->prev)) +- +-/** +- * list_for_each_safe - iterate over a list safe against removal of list entry +- * @pos: the &struct list_head to use as a loop counter. +- * @n: another &struct list_head to use as temporary storage +- * @head: the head for your list. +- */ +-#define list_for_each_safe(pos, n, head) \ +- for (pos = (head)->next, n = pos->next; pos != (head); \ +- pos = n, n = pos->next) +- +-/** +- * list_for_each_entry - iterate over list of given type +- * @pos: the type * to use as a loop counter. +- * @head: the head for your list. +- * @member: the name of the list_struct within the struct. +- */ +-#define list_for_each_entry(pos, head, member) \ +- for (pos = list_entry((head)->next, typeof(*pos), member), \ +- prefetch(pos->member.next); \ +- &pos->member != (head); \ +- pos = list_entry(pos->member.next, typeof(*pos), member), \ +- prefetch(pos->member.next)) +- +-/** +- * list_for_each_entry_reverse - iterate backwards over list of given type. +- * @pos: the type * to use as a loop counter. +- * @head: the head for your list. +- * @member: the name of the list_struct within the struct. +- */ +-#define list_for_each_entry_reverse(pos, head, member) \ +- for (pos = list_entry((head)->prev, typeof(*pos), member), \ +- prefetch(pos->member.prev); \ +- &pos->member != (head); \ +- pos = list_entry(pos->member.prev, typeof(*pos), member), \ +- prefetch(pos->member.prev)) +- +-/** +- * list_prepare_entry - prepare a pos entry for use as a start point in +- * list_for_each_entry_continue +- * @pos: the type * to use as a start point +- * @head: the head of the list +- * @member: the name of the list_struct within the struct. +- */ +-#define list_prepare_entry(pos, head, member) \ +- ((pos) ? : list_entry(head, typeof(*pos), member)) +- +-/** +- * list_for_each_entry_continue - iterate over list of given type +- * continuing after existing point +- * @pos: the type * to use as a loop counter. +- * @head: the head for your list. +- * @member: the name of the list_struct within the struct. +- */ +-#define list_for_each_entry_continue(pos, head, member) \ +- for (pos = list_entry(pos->member.next, typeof(*pos), member), \ +- prefetch(pos->member.next); \ +- &pos->member != (head); \ +- pos = list_entry(pos->member.next, typeof(*pos), member), \ +- prefetch(pos->member.next)) +- +-/** +- * list_for_each_entry_safe - iterate over list of given type safe against removal of list entry +- * @pos: the type * to use as a loop counter. +- * @n: another type * to use as temporary storage +- * @head: the head for your list. +- * @member: the name of the list_struct within the struct. +- */ +-#define list_for_each_entry_safe(pos, n, head, member) \ +- for (pos = list_entry((head)->next, typeof(*pos), member), \ +- n = list_entry(pos->member.next, typeof(*pos), member); \ +- &pos->member != (head); \ +- pos = n, n = list_entry(n->member.next, typeof(*n), member)) +- +-/** +- * list_for_each_rcu - iterate over an rcu-protected list +- * @pos: the &struct list_head to use as a loop counter. +- * @head: the head for your list. +- * +- * This list-traversal primitive may safely run concurrently with +- * the _rcu list-mutation primitives such as list_add_rcu() +- * as long as the traversal is guarded by rcu_read_lock(). +- */ +-#define list_for_each_rcu(pos, head) \ +- for (pos = (head)->next, prefetch(pos->next); pos != (head); \ +- pos = pos->next, ({ smp_read_barrier_depends(); 0;}), prefetch(pos->next)) +- +-#define __list_for_each_rcu(pos, head) \ +- for (pos = (head)->next; pos != (head); \ +- pos = pos->next, ({ smp_read_barrier_depends(); 0;})) +- +-/** +- * list_for_each_safe_rcu - iterate over an rcu-protected list safe +- * against removal of list entry +- * @pos: the &struct list_head to use as a loop counter. +- * @n: another &struct list_head to use as temporary storage +- * @head: the head for your list. +- * +- * This list-traversal primitive may safely run concurrently with +- * the _rcu list-mutation primitives such as list_add_rcu() +- * as long as the traversal is guarded by rcu_read_lock(). +- */ +-#define list_for_each_safe_rcu(pos, n, head) \ +- for (pos = (head)->next, n = pos->next; pos != (head); \ +- pos = n, ({ smp_read_barrier_depends(); 0;}), n = pos->next) +- +-/** +- * list_for_each_entry_rcu - iterate over rcu list of given type +- * @pos: the type * to use as a loop counter. +- * @head: the head for your list. +- * @member: the name of the list_struct within the struct. +- * +- * This list-traversal primitive may safely run concurrently with +- * the _rcu list-mutation primitives such as list_add_rcu() +- * as long as the traversal is guarded by rcu_read_lock(). +- */ +-#define list_for_each_entry_rcu(pos, head, member) \ +- for (pos = list_entry((head)->next, typeof(*pos), member), \ +- prefetch(pos->member.next); \ +- &pos->member != (head); \ +- pos = list_entry(pos->member.next, typeof(*pos), member), \ +- ({ smp_read_barrier_depends(); 0;}), \ +- prefetch(pos->member.next)) +- +- +-/** +- * list_for_each_continue_rcu - iterate over an rcu-protected list +- * continuing after existing point. +- * @pos: the &struct list_head to use as a loop counter. +- * @head: the head for your list. +- * +- * This list-traversal primitive may safely run concurrently with +- * the _rcu list-mutation primitives such as list_add_rcu() +- * as long as the traversal is guarded by rcu_read_lock(). +- */ +-#define list_for_each_continue_rcu(pos, head) \ +- for ((pos) = (pos)->next, prefetch((pos)->next); (pos) != (head); \ +- (pos) = (pos)->next, ({ smp_read_barrier_depends(); 0;}), prefetch((pos)->next)) +- +-/* +- * Double linked lists with a single pointer list head. +- * Mostly useful for hash tables where the two pointer list head is +- * too wasteful. +- * You lose the ability to access the tail in O(1). +- */ +- +-struct hlist_head { +- struct hlist_node *first; +-}; +- +-struct hlist_node { +- struct hlist_node *next, **pprev; +-}; +- +-#define HLIST_HEAD_INIT { .first = NULL } +-#define HLIST_HEAD(name) struct hlist_head name = { .first = NULL } +-#define INIT_HLIST_HEAD(ptr) ((ptr)->first = NULL) +-#define INIT_HLIST_NODE(ptr) ((ptr)->next = NULL, (ptr)->pprev = NULL) +- +-static inline int hlist_unhashed(const struct hlist_node *h) +-{ +- return !h->pprev; +-} +- +-static inline int hlist_empty(const struct hlist_head *h) +-{ +- return !h->first; +-} +- +-static inline void __hlist_del(struct hlist_node *n) +-{ +- struct hlist_node *next = n->next; +- struct hlist_node **pprev = n->pprev; +- *pprev = next; +- if (next) +- next->pprev = pprev; +-} +- +-static inline void hlist_del(struct hlist_node *n) +-{ +- __hlist_del(n); +- n->next = LIST_POISON1; +- n->pprev = LIST_POISON2; +-} +- +-/** +- * hlist_del_rcu - deletes entry from hash list without re-initialization +- * @n: the element to delete from the hash list. +- * +- * Note: list_unhashed() on entry does not return true after this, +- * the entry is in an undefined state. It is useful for RCU based +- * lockfree traversal. +- * +- * In particular, it means that we can not poison the forward +- * pointers that may still be used for walking the hash list. +- * +- * The caller must take whatever precautions are necessary +- * (such as holding appropriate locks) to avoid racing +- * with another list-mutation primitive, such as hlist_add_head_rcu() +- * or hlist_del_rcu(), running on this same list. +- * However, it is perfectly legal to run concurrently with +- * the _rcu list-traversal primitives, such as +- * hlist_for_each_entry(). +- */ +-static inline void hlist_del_rcu(struct hlist_node *n) +-{ +- __hlist_del(n); +- n->pprev = LIST_POISON2; +-} +- +-static inline void hlist_del_init(struct hlist_node *n) +-{ +- if (n->pprev) { +- __hlist_del(n); +- INIT_HLIST_NODE(n); +- } +-} +- +-#define hlist_del_rcu_init hlist_del_init +- +-static inline void hlist_add_head(struct hlist_node *n, struct hlist_head *h) +-{ +- struct hlist_node *first = h->first; +- n->next = first; +- if (first) +- first->pprev = &n->next; +- h->first = n; +- n->pprev = &h->first; +-} +- +- +-/** +- * hlist_add_head_rcu - adds the specified element to the specified hlist, +- * while permitting racing traversals. +- * @n: the element to add to the hash list. +- * @h: the list to add to. +- * +- * The caller must take whatever precautions are necessary +- * (such as holding appropriate locks) to avoid racing +- * with another list-mutation primitive, such as hlist_add_head_rcu() +- * or hlist_del_rcu(), running on this same list. +- * However, it is perfectly legal to run concurrently with +- * the _rcu list-traversal primitives, such as +- * hlist_for_each_entry(), but only if smp_read_barrier_depends() +- * is used to prevent memory-consistency problems on Alpha CPUs. +- * Regardless of the type of CPU, the list-traversal primitive +- * must be guarded by rcu_read_lock(). +- * +- * OK, so why don't we have an hlist_for_each_entry_rcu()??? +- */ +-static inline void hlist_add_head_rcu(struct hlist_node *n, +- struct hlist_head *h) +-{ +- struct hlist_node *first = h->first; +- n->next = first; +- n->pprev = &h->first; +- smp_wmb(); +- if (first) +- first->pprev = &n->next; +- h->first = n; +-} +- +-/* next must be != NULL */ +-static inline void hlist_add_before(struct hlist_node *n, +- struct hlist_node *next) +-{ +- n->pprev = next->pprev; +- n->next = next; +- next->pprev = &n->next; +- *(n->pprev) = n; +-} +- +-static inline void hlist_add_after(struct hlist_node *n, +- struct hlist_node *next) +-{ +- next->next = n->next; +- n->next = next; +- next->pprev = &n->next; +- +- if(next->next) +- next->next->pprev = &next->next; +-} +- +-#define hlist_entry(ptr, type, member) container_of(ptr,type,member) +- +-#define hlist_for_each(pos, head) \ +- for (pos = (head)->first; pos && ({ prefetch(pos->next); 1; }); \ +- pos = pos->next) +- +-#define hlist_for_each_safe(pos, n, head) \ +- for (pos = (head)->first; pos && ({ n = pos->next; 1; }); \ +- pos = n) +- +-/** +- * hlist_for_each_entry - iterate over list of given type +- * @tpos: the type * to use as a loop counter. +- * @pos: the &struct hlist_node to use as a loop counter. +- * @head: the head for your list. +- * @member: the name of the hlist_node within the struct. +- */ +-#define hlist_for_each_entry(tpos, pos, head, member) \ +- for (pos = (head)->first; \ +- pos && ({ prefetch(pos->next); 1;}) && \ +- ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ +- pos = pos->next) +- +-/** +- * hlist_for_each_entry_continue - iterate over a hlist continuing after existing point +- * @tpos: the type * to use as a loop counter. +- * @pos: the &struct hlist_node to use as a loop counter. +- * @member: the name of the hlist_node within the struct. +- */ +-#define hlist_for_each_entry_continue(tpos, pos, member) \ +- for (pos = (pos)->next; \ +- pos && ({ prefetch(pos->next); 1;}) && \ +- ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ +- pos = pos->next) +- +-/** +- * hlist_for_each_entry_from - iterate over a hlist continuing from existing point +- * @tpos: the type * to use as a loop counter. +- * @pos: the &struct hlist_node to use as a loop counter. +- * @member: the name of the hlist_node within the struct. +- */ +-#define hlist_for_each_entry_from(tpos, pos, member) \ +- for (; pos && ({ prefetch(pos->next); 1;}) && \ +- ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ +- pos = pos->next) +- +-/** +- * hlist_for_each_entry_safe - iterate over list of given type safe against removal of list entry +- * @tpos: the type * to use as a loop counter. +- * @pos: the &struct hlist_node to use as a loop counter. +- * @n: another &struct hlist_node to use as temporary storage +- * @head: the head for your list. +- * @member: the name of the hlist_node within the struct. +- */ +-#define hlist_for_each_entry_safe(tpos, pos, n, head, member) \ +- for (pos = (head)->first; \ +- pos && ({ n = pos->next; 1; }) && \ +- ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ +- pos = n) +- +-/** +- * hlist_for_each_entry_rcu - iterate over rcu list of given type +- * @pos: the type * to use as a loop counter. +- * @pos: the &struct hlist_node to use as a loop counter. +- * @head: the head for your list. +- * @member: the name of the hlist_node within the struct. +- * +- * This list-traversal primitive may safely run concurrently with +- * the _rcu list-mutation primitives such as hlist_add_rcu() +- * as long as the traversal is guarded by rcu_read_lock(). +- */ +-#define hlist_for_each_entry_rcu(tpos, pos, head, member) \ +- for (pos = (head)->first; \ +- pos && ({ prefetch(pos->next); 1;}) && \ +- ({ tpos = hlist_entry(pos, typeof(*tpos), member); 1;}); \ +- pos = pos->next, ({ smp_read_barrier_depends(); 0; }) ) +- +-#endif +diff --git libiptc/Makefile libiptc/Makefile +deleted file mode 100644 +index 1fbebef..0000000 +--- libiptc/Makefile ++++ /dev/null +@@ -1,23 +0,0 @@ +-#! /usr/bin/make +- +-EXTRAS+=libiptc/libiptc.a +- +-DEVEL_LIBS+=libiptc/libiptc.a +- +-ifndef TOPLEVEL_INCLUDED +-local: +- cd .. && $(MAKE) $(KERN_TARGETS) $(SHARED_LIBS) $(EXTRAS) +- +-else +-EXTRA_DEPENDS+=libiptc/libip4tc.d +- +-libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip4tc.o) +- +-ifeq ($(DO_IPV6), 1) +-EXTRA_DEPENDS+= libiptc/libip6tc.d +-libiptc/libiptc.a: libiptc/libiptc.a(libiptc/libip6tc.o) +-endif +- +-libiptc/libip4tc.d libiptc/libip6tc.d: %.d: %.c +- @-$(CC) -M -MG $(CFLAGS) $< | sed -e 's@^.*\.o:@$*.d libiptc/libiptc.a($*.o):@' > $@ +-endif +diff --git libiptc/libip4tc.c libiptc/libip4tc.c +deleted file mode 100644 +index 2e8647c..0000000 +--- libiptc/libip4tc.c ++++ /dev/null +@@ -1,500 +0,0 @@ +-/* Library which manipulates firewall rules. Version 0.1. */ +- +-/* Architecture of firewall rules is as follows: +- * +- * Chains go INPUT, FORWARD, OUTPUT then user chains. +- * Each user chain starts with an ERROR node. +- * Every chain ends with an unconditional jump: a RETURN for user chains, +- * and a POLICY for built-ins. +- */ +- +-/* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See +- COPYING for details). */ +- +-#include <assert.h> +-#include <string.h> +-#include <errno.h> +-#include <stdlib.h> +-#include <stdio.h> +-#include <unistd.h> +- +-#ifdef DEBUG_CONNTRACK +-#define inline +-#endif +- +-#if !defined(__GLIBC__) || (__GLIBC__ < 2) +-typedef unsigned int socklen_t; +-#endif +- +-#include "libiptc/libiptc.h" +- +-#define IP_VERSION 4 +-#define IP_OFFSET 0x1FFF +- +-#define HOOK_PRE_ROUTING NF_IP_PRE_ROUTING +-#define HOOK_LOCAL_IN NF_IP_LOCAL_IN +-#define HOOK_FORWARD NF_IP_FORWARD +-#define HOOK_LOCAL_OUT NF_IP_LOCAL_OUT +-#define HOOK_POST_ROUTING NF_IP_POST_ROUTING +-#ifdef NF_IP_DROPPING +-#define HOOK_DROPPING NF_IP_DROPPING +-#endif +- +-#define STRUCT_ENTRY_TARGET struct ipt_entry_target +-#define STRUCT_ENTRY struct ipt_entry +-#define STRUCT_ENTRY_MATCH struct ipt_entry_match +-#define STRUCT_GETINFO struct ipt_getinfo +-#define STRUCT_GET_ENTRIES struct ipt_get_entries +-#define STRUCT_COUNTERS struct ipt_counters +-#define STRUCT_COUNTERS_INFO struct ipt_counters_info +-#define STRUCT_STANDARD_TARGET struct ipt_standard_target +-#define STRUCT_REPLACE struct ipt_replace +- +-#define STRUCT_TC_HANDLE struct iptc_handle +-#define TC_HANDLE_T iptc_handle_t +- +-#define ENTRY_ITERATE IPT_ENTRY_ITERATE +-#define TABLE_MAXNAMELEN IPT_TABLE_MAXNAMELEN +-#define FUNCTION_MAXNAMELEN IPT_FUNCTION_MAXNAMELEN +- +-#define GET_TARGET ipt_get_target +- +-#define ERROR_TARGET IPT_ERROR_TARGET +-#define NUMHOOKS NF_IP_NUMHOOKS +- +-#define IPT_CHAINLABEL ipt_chainlabel +- +-#define TC_DUMP_ENTRIES dump_entries +-#define TC_IS_CHAIN iptc_is_chain +-#define TC_FIRST_CHAIN iptc_first_chain +-#define TC_NEXT_CHAIN iptc_next_chain +-#define TC_FIRST_RULE iptc_first_rule +-#define TC_NEXT_RULE iptc_next_rule +-#define TC_GET_TARGET iptc_get_target +-#define TC_BUILTIN iptc_builtin +-#define TC_GET_POLICY iptc_get_policy +-#define TC_INSERT_ENTRY iptc_insert_entry +-#define TC_REPLACE_ENTRY iptc_replace_entry +-#define TC_APPEND_ENTRY iptc_append_entry +-#define TC_DELETE_ENTRY iptc_delete_entry +-#define TC_DELETE_NUM_ENTRY iptc_delete_num_entry +-#define TC_CHECK_PACKET iptc_check_packet +-#define TC_FLUSH_ENTRIES iptc_flush_entries +-#define TC_ZERO_ENTRIES iptc_zero_entries +-#define TC_READ_COUNTER iptc_read_counter +-#define TC_ZERO_COUNTER iptc_zero_counter +-#define TC_SET_COUNTER iptc_set_counter +-#define TC_CREATE_CHAIN iptc_create_chain +-#define TC_GET_REFERENCES iptc_get_references +-#define TC_DELETE_CHAIN iptc_delete_chain +-#define TC_RENAME_CHAIN iptc_rename_chain +-#define TC_SET_POLICY iptc_set_policy +-#define TC_GET_RAW_SOCKET iptc_get_raw_socket +-#define TC_INIT iptc_init +-#define TC_FREE iptc_free +-#define TC_COMMIT iptc_commit +-#define TC_STRERROR iptc_strerror +- +-#define TC_AF AF_INET +-#define TC_IPPROTO IPPROTO_IP +- +-#define SO_SET_REPLACE IPT_SO_SET_REPLACE +-#define SO_SET_ADD_COUNTERS IPT_SO_SET_ADD_COUNTERS +-#define SO_GET_INFO IPT_SO_GET_INFO +-#define SO_GET_ENTRIES IPT_SO_GET_ENTRIES +-#define SO_GET_VERSION IPT_SO_GET_VERSION +- +-#define STANDARD_TARGET IPT_STANDARD_TARGET +-#define LABEL_RETURN IPTC_LABEL_RETURN +-#define LABEL_ACCEPT IPTC_LABEL_ACCEPT +-#define LABEL_DROP IPTC_LABEL_DROP +-#define LABEL_QUEUE IPTC_LABEL_QUEUE +- +-#define ALIGN IPT_ALIGN +-#define RETURN IPT_RETURN +- +-#include "libiptc.c" +- +-#define IP_PARTS_NATIVE(n) \ +-(unsigned int)((n)>>24)&0xFF, \ +-(unsigned int)((n)>>16)&0xFF, \ +-(unsigned int)((n)>>8)&0xFF, \ +-(unsigned int)((n)&0xFF) +- +-#define IP_PARTS(n) IP_PARTS_NATIVE(ntohl(n)) +- +-int +-dump_entry(STRUCT_ENTRY *e, const TC_HANDLE_T handle) +-{ +- size_t i; +- STRUCT_ENTRY_TARGET *t; +- +- printf("Entry %u (%lu):\n", iptcb_entry2index(handle, e), +- iptcb_entry2offset(handle, e)); +- printf("SRC IP: %u.%u.%u.%u/%u.%u.%u.%u\n", +- IP_PARTS(e->ip.src.s_addr),IP_PARTS(e->ip.smsk.s_addr)); +- printf("DST IP: %u.%u.%u.%u/%u.%u.%u.%u\n", +- IP_PARTS(e->ip.dst.s_addr),IP_PARTS(e->ip.dmsk.s_addr)); +- printf("Interface: `%s'/", e->ip.iniface); +- for (i = 0; i < IFNAMSIZ; i++) +- printf("%c", e->ip.iniface_mask[i] ? 'X' : '.'); +- printf("to `%s'/", e->ip.outiface); +- for (i = 0; i < IFNAMSIZ; i++) +- printf("%c", e->ip.outiface_mask[i] ? 'X' : '.'); +- printf("\nProtocol: %u\n", e->ip.proto); +- printf("Flags: %02X\n", e->ip.flags); +- printf("Invflags: %02X\n", e->ip.invflags); +- printf("Counters: %llu packets, %llu bytes\n", +- (unsigned long long)e->counters.pcnt, (unsigned long long)e->counters.bcnt); +- printf("Cache: %08X ", e->nfcache); +- if (e->nfcache & NFC_ALTERED) printf("ALTERED "); +- if (e->nfcache & NFC_UNKNOWN) printf("UNKNOWN "); +- printf("\n"); +- +- IPT_MATCH_ITERATE(e, print_match); +- +- t = GET_TARGET(e); +- printf("Target name: `%s' [%u]\n", t->u.user.name, t->u.target_size); +- if (strcmp(t->u.user.name, STANDARD_TARGET) == 0) { +- int pos = *(int *)t->data; +- if (pos < 0) +- printf("verdict=%s\n", +- pos == -NF_ACCEPT-1 ? "NF_ACCEPT" +- : pos == -NF_DROP-1 ? "NF_DROP" +- : pos == -NF_QUEUE-1 ? "NF_QUEUE" +- : pos == RETURN ? "RETURN" +- : "UNKNOWN"); +- else +- printf("verdict=%u\n", pos); +- } else if (strcmp(t->u.user.name, IPT_ERROR_TARGET) == 0) +- printf("error=`%s'\n", t->data); +- +- printf("\n"); +- return 0; +-} +- +-static unsigned char * +-is_same(const STRUCT_ENTRY *a, const STRUCT_ENTRY *b, unsigned char *matchmask) +-{ +- unsigned int i; +- unsigned char *mptr; +- +- /* Always compare head structures: ignore mask here. */ +- if (a->ip.src.s_addr != b->ip.src.s_addr +- || a->ip.dst.s_addr != b->ip.dst.s_addr +- || a->ip.smsk.s_addr != b->ip.smsk.s_addr +- || a->ip.dmsk.s_addr != b->ip.dmsk.s_addr +- || a->ip.proto != b->ip.proto +- || a->ip.flags != b->ip.flags +- || a->ip.invflags != b->ip.invflags) +- return NULL; +- +- for (i = 0; i < IFNAMSIZ; i++) { +- if (a->ip.iniface_mask[i] != b->ip.iniface_mask[i]) +- return NULL; +- if ((a->ip.iniface[i] & a->ip.iniface_mask[i]) +- != (b->ip.iniface[i] & b->ip.iniface_mask[i])) +- return NULL; +- if (a->ip.outiface_mask[i] != b->ip.outiface_mask[i]) +- return NULL; +- if ((a->ip.outiface[i] & a->ip.outiface_mask[i]) +- != (b->ip.outiface[i] & b->ip.outiface_mask[i])) +- return NULL; +- } +- +- if (a->nfcache != b->nfcache +- || a->target_offset != b->target_offset +- || a->next_offset != b->next_offset) +- return NULL; +- +- mptr = matchmask + sizeof(STRUCT_ENTRY); +- if (IPT_MATCH_ITERATE(a, match_different, a->elems, b->elems, &mptr)) +- return NULL; +- mptr += IPT_ALIGN(sizeof(struct ipt_entry_target)); +- +- return mptr; +-} +- +-#if 0 +-/***************************** DEBUGGING ********************************/ +-static inline int +-unconditional(const struct ipt_ip *ip) +-{ +- unsigned int i; +- +- for (i = 0; i < sizeof(*ip)/sizeof(u_int32_t); i++) +- if (((u_int32_t *)ip)[i]) +- return 0; +- +- return 1; +-} +- +-static inline int +-check_match(const STRUCT_ENTRY_MATCH *m, unsigned int *off) +-{ +- assert(m->u.match_size >= sizeof(STRUCT_ENTRY_MATCH)); +- assert(ALIGN(m->u.match_size) == m->u.match_size); +- +- (*off) += m->u.match_size; +- return 0; +-} +- +-static inline int +-check_entry(const STRUCT_ENTRY *e, unsigned int *i, unsigned int *off, +- unsigned int user_offset, int *was_return, +- TC_HANDLE_T h) +-{ +- unsigned int toff; +- STRUCT_STANDARD_TARGET *t; +- +- assert(e->target_offset >= sizeof(STRUCT_ENTRY)); +- assert(e->next_offset >= e->target_offset +- + sizeof(STRUCT_ENTRY_TARGET)); +- toff = sizeof(STRUCT_ENTRY); +- IPT_MATCH_ITERATE(e, check_match, &toff); +- +- assert(toff == e->target_offset); +- +- t = (STRUCT_STANDARD_TARGET *) +- GET_TARGET((STRUCT_ENTRY *)e); +- /* next_offset will have to be multiple of entry alignment. */ +- assert(e->next_offset == ALIGN(e->next_offset)); +- assert(e->target_offset == ALIGN(e->target_offset)); +- assert(t->target.u.target_size == ALIGN(t->target.u.target_size)); +- assert(!TC_IS_CHAIN(t->target.u.user.name, h)); +- +- if (strcmp(t->target.u.user.name, STANDARD_TARGET) == 0) { +- assert(t->target.u.target_size +- == ALIGN(sizeof(STRUCT_STANDARD_TARGET))); +- +- assert(t->verdict == -NF_DROP-1 +- || t->verdict == -NF_ACCEPT-1 +- || t->verdict == RETURN +- || t->verdict < (int)h->entries->size); +- +- if (t->verdict >= 0) { +- STRUCT_ENTRY *te = get_entry(h, t->verdict); +- int idx; +- +- idx = iptcb_entry2index(h, te); +- assert(strcmp(GET_TARGET(te)->u.user.name, +- IPT_ERROR_TARGET) +- != 0); +- assert(te != e); +- +- /* Prior node must be error node, or this node. */ +- assert(t->verdict == iptcb_entry2offset(h, e)+e->next_offset +- || strcmp(GET_TARGET(index2entry(h, idx-1)) +- ->u.user.name, IPT_ERROR_TARGET) +- == 0); +- } +- +- if (t->verdict == RETURN +- && unconditional(&e->ip) +- && e->target_offset == sizeof(*e)) +- *was_return = 1; +- else +- *was_return = 0; +- } else if (strcmp(t->target.u.user.name, IPT_ERROR_TARGET) == 0) { +- assert(t->target.u.target_size +- == ALIGN(sizeof(struct ipt_error_target))); +- +- /* If this is in user area, previous must have been return */ +- if (*off > user_offset) +- assert(*was_return); +- +- *was_return = 0; +- } +- else *was_return = 0; +- +- if (*off == user_offset) +- assert(strcmp(t->target.u.user.name, IPT_ERROR_TARGET) == 0); +- +- (*off) += e->next_offset; +- (*i)++; +- return 0; +-} +- +-#ifdef IPTC_DEBUG +-/* Do every conceivable sanity check on the handle */ +-static void +-do_check(TC_HANDLE_T h, unsigned int line) +-{ +- unsigned int i, n; +- unsigned int user_offset; /* Offset of first user chain */ +- int was_return; +- +- assert(h->changed == 0 || h->changed == 1); +- if (strcmp(h->info.name, "filter") == 0) { +- assert(h->info.valid_hooks +- == (1 << NF_IP_LOCAL_IN +- | 1 << NF_IP_FORWARD +- | 1 << NF_IP_LOCAL_OUT)); +- +- /* Hooks should be first three */ +- assert(h->info.hook_entry[NF_IP_LOCAL_IN] == 0); +- +- n = get_chain_end(h, 0); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_FORWARD] == n); +- +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_LOCAL_OUT] == n); +- +- user_offset = h->info.hook_entry[NF_IP_LOCAL_OUT]; +- } else if (strcmp(h->info.name, "nat") == 0) { +- assert((h->info.valid_hooks +- == (1 << NF_IP_PRE_ROUTING +- | 1 << NF_IP_POST_ROUTING +- | 1 << NF_IP_LOCAL_OUT)) || +- (h->info.valid_hooks +- == (1 << NF_IP_PRE_ROUTING +- | 1 << NF_IP_LOCAL_IN +- | 1 << NF_IP_POST_ROUTING +- | 1 << NF_IP_LOCAL_OUT))); +- +- assert(h->info.hook_entry[NF_IP_PRE_ROUTING] == 0); +- +- n = get_chain_end(h, 0); +- +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_POST_ROUTING] == n); +- n = get_chain_end(h, n); +- +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_LOCAL_OUT] == n); +- user_offset = h->info.hook_entry[NF_IP_LOCAL_OUT]; +- +- if (h->info.valid_hooks & (1 << NF_IP_LOCAL_IN)) { +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_LOCAL_IN] == n); +- user_offset = h->info.hook_entry[NF_IP_LOCAL_IN]; +- } +- +- } else if (strcmp(h->info.name, "mangle") == 0) { +- /* This code is getting ugly because linux < 2.4.18-pre6 had +- * two mangle hooks, linux >= 2.4.18-pre6 has five mangle hooks +- * */ +- assert((h->info.valid_hooks +- == (1 << NF_IP_PRE_ROUTING +- | 1 << NF_IP_LOCAL_OUT)) || +- (h->info.valid_hooks +- == (1 << NF_IP_PRE_ROUTING +- | 1 << NF_IP_LOCAL_IN +- | 1 << NF_IP_FORWARD +- | 1 << NF_IP_LOCAL_OUT +- | 1 << NF_IP_POST_ROUTING))); +- +- /* Hooks should be first five */ +- assert(h->info.hook_entry[NF_IP_PRE_ROUTING] == 0); +- +- n = get_chain_end(h, 0); +- +- if (h->info.valid_hooks & (1 << NF_IP_LOCAL_IN)) { +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_LOCAL_IN] == n); +- n = get_chain_end(h, n); +- } +- +- if (h->info.valid_hooks & (1 << NF_IP_FORWARD)) { +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_FORWARD] == n); +- n = get_chain_end(h, n); +- } +- +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_LOCAL_OUT] == n); +- user_offset = h->info.hook_entry[NF_IP_LOCAL_OUT]; +- +- if (h->info.valid_hooks & (1 << NF_IP_POST_ROUTING)) { +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_POST_ROUTING] == n); +- user_offset = h->info.hook_entry[NF_IP_POST_ROUTING]; +- } +- } else if (strcmp(h->info.name, "raw") == 0) { +- assert(h->info.valid_hooks +- == (1 << NF_IP_PRE_ROUTING +- | 1 << NF_IP_LOCAL_OUT)); +- +- /* Hooks should be first three */ +- assert(h->info.hook_entry[NF_IP_PRE_ROUTING] == 0); +- +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP_LOCAL_OUT] == n); +- +- user_offset = h->info.hook_entry[NF_IP_LOCAL_OUT]; +- +-#ifdef NF_IP_DROPPING +- } else if (strcmp(h->info.name, "drop") == 0) { +- assert(h->info.valid_hooks == (1 << NF_IP_DROPPING)); +- +- /* Hook should be first */ +- assert(h->info.hook_entry[NF_IP_DROPPING] == 0); +- user_offset = 0; +-#endif +- } else { +- fprintf(stderr, "Unknown table `%s'\n", h->info.name); +- abort(); +- } +- +- /* User chain == end of last builtin + policy entry */ +- user_offset = get_chain_end(h, user_offset); +- user_offset += get_entry(h, user_offset)->next_offset; +- +- /* Overflows should be end of entry chains, and unconditional +- policy nodes. */ +- for (i = 0; i < NUMHOOKS; i++) { +- STRUCT_ENTRY *e; +- STRUCT_STANDARD_TARGET *t; +- +- if (!(h->info.valid_hooks & (1 << i))) +- continue; +- assert(h->info.underflow[i] +- == get_chain_end(h, h->info.hook_entry[i])); +- +- e = get_entry(h, get_chain_end(h, h->info.hook_entry[i])); +- assert(unconditional(&e->ip)); +- assert(e->target_offset == sizeof(*e)); +- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e); +- assert(t->target.u.target_size == ALIGN(sizeof(*t))); +- assert(e->next_offset == sizeof(*e) + ALIGN(sizeof(*t))); +- +- assert(strcmp(t->target.u.user.name, STANDARD_TARGET)==0); +- assert(t->verdict == -NF_DROP-1 || t->verdict == -NF_ACCEPT-1); +- +- /* Hooks and underflows must be valid entries */ +- entry2index(h, get_entry(h, h->info.hook_entry[i])); +- entry2index(h, get_entry(h, h->info.underflow[i])); +- } +- +- assert(h->info.size +- >= h->info.num_entries * (sizeof(STRUCT_ENTRY) +- +sizeof(STRUCT_STANDARD_TARGET))); +- +- assert(h->entries.size +- >= (h->new_number +- * (sizeof(STRUCT_ENTRY) +- + sizeof(STRUCT_STANDARD_TARGET)))); +- assert(strcmp(h->info.name, h->entries.name) == 0); +- +- i = 0; n = 0; +- was_return = 0; +- /* Check all the entries. */ +- ENTRY_ITERATE(h->entries.entrytable, h->entries.size, +- check_entry, &i, &n, user_offset, &was_return, h); +- +- assert(i == h->new_number); +- assert(n == h->entries.size); +- +- /* Final entry must be error node */ +- assert(strcmp(GET_TARGET(index2entry(h, h->new_number-1)) +- ->u.user.name, +- ERROR_TARGET) == 0); +-} +-#endif /*IPTC_DEBUG*/ +- +-#endif +diff --git libiptc/libip6tc.c libiptc/libip6tc.c +deleted file mode 100644 +index 8ca5ea6..0000000 +--- libiptc/libip6tc.c ++++ /dev/null +@@ -1,439 +0,0 @@ +-/* Library which manipulates firewall rules. Version 0.1. */ +- +-/* Architecture of firewall rules is as follows: +- * +- * Chains go INPUT, FORWARD, OUTPUT then user chains. +- * Each user chain starts with an ERROR node. +- * Every chain ends with an unconditional jump: a RETURN for user chains, +- * and a POLICY for built-ins. +- */ +- +-/* (C)1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See +- COPYING for details). */ +- +-#include <assert.h> +-#include <string.h> +-#include <errno.h> +-#include <stdlib.h> +-#include <stdio.h> +-#include <unistd.h> +-#include <arpa/inet.h> +- +-#ifdef DEBUG_CONNTRACK +-#define inline +-#endif +- +-#if !defined(__GLIBC__) || (__GLIBC__ < 2) +-typedef unsigned int socklen_t; +-#endif +- +-#include "libiptc/libip6tc.h" +- +-#define HOOK_PRE_ROUTING NF_IP6_PRE_ROUTING +-#define HOOK_LOCAL_IN NF_IP6_LOCAL_IN +-#define HOOK_FORWARD NF_IP6_FORWARD +-#define HOOK_LOCAL_OUT NF_IP6_LOCAL_OUT +-#define HOOK_POST_ROUTING NF_IP6_POST_ROUTING +- +-#define STRUCT_ENTRY_TARGET struct ip6t_entry_target +-#define STRUCT_ENTRY struct ip6t_entry +-#define STRUCT_ENTRY_MATCH struct ip6t_entry_match +-#define STRUCT_GETINFO struct ip6t_getinfo +-#define STRUCT_GET_ENTRIES struct ip6t_get_entries +-#define STRUCT_COUNTERS struct ip6t_counters +-#define STRUCT_COUNTERS_INFO struct ip6t_counters_info +-#define STRUCT_STANDARD_TARGET struct ip6t_standard_target +-#define STRUCT_REPLACE struct ip6t_replace +- +-#define STRUCT_TC_HANDLE struct ip6tc_handle +-#define TC_HANDLE_T ip6tc_handle_t +- +-#define ENTRY_ITERATE IP6T_ENTRY_ITERATE +-#define TABLE_MAXNAMELEN IP6T_TABLE_MAXNAMELEN +-#define FUNCTION_MAXNAMELEN IP6T_FUNCTION_MAXNAMELEN +- +-#define GET_TARGET ip6t_get_target +- +-#define ERROR_TARGET IP6T_ERROR_TARGET +-#define NUMHOOKS NF_IP6_NUMHOOKS +- +-#define IPT_CHAINLABEL ip6t_chainlabel +- +-#define TC_DUMP_ENTRIES dump_entries6 +-#define TC_IS_CHAIN ip6tc_is_chain +-#define TC_FIRST_CHAIN ip6tc_first_chain +-#define TC_NEXT_CHAIN ip6tc_next_chain +-#define TC_FIRST_RULE ip6tc_first_rule +-#define TC_NEXT_RULE ip6tc_next_rule +-#define TC_GET_TARGET ip6tc_get_target +-#define TC_BUILTIN ip6tc_builtin +-#define TC_GET_POLICY ip6tc_get_policy +-#define TC_INSERT_ENTRY ip6tc_insert_entry +-#define TC_REPLACE_ENTRY ip6tc_replace_entry +-#define TC_APPEND_ENTRY ip6tc_append_entry +-#define TC_DELETE_ENTRY ip6tc_delete_entry +-#define TC_DELETE_NUM_ENTRY ip6tc_delete_num_entry +-#define TC_CHECK_PACKET ip6tc_check_packet +-#define TC_FLUSH_ENTRIES ip6tc_flush_entries +-#define TC_ZERO_ENTRIES ip6tc_zero_entries +-#define TC_ZERO_COUNTER ip6tc_zero_counter +-#define TC_READ_COUNTER ip6tc_read_counter +-#define TC_SET_COUNTER ip6tc_set_counter +-#define TC_CREATE_CHAIN ip6tc_create_chain +-#define TC_GET_REFERENCES ip6tc_get_references +-#define TC_DELETE_CHAIN ip6tc_delete_chain +-#define TC_RENAME_CHAIN ip6tc_rename_chain +-#define TC_SET_POLICY ip6tc_set_policy +-#define TC_GET_RAW_SOCKET ip6tc_get_raw_socket +-#define TC_INIT ip6tc_init +-#define TC_FREE ip6tc_free +-#define TC_COMMIT ip6tc_commit +-#define TC_STRERROR ip6tc_strerror +- +-#define TC_AF AF_INET6 +-#define TC_IPPROTO IPPROTO_IPV6 +- +-#define SO_SET_REPLACE IP6T_SO_SET_REPLACE +-#define SO_SET_ADD_COUNTERS IP6T_SO_SET_ADD_COUNTERS +-#define SO_GET_INFO IP6T_SO_GET_INFO +-#define SO_GET_ENTRIES IP6T_SO_GET_ENTRIES +-#define SO_GET_VERSION IP6T_SO_GET_VERSION +- +-#define STANDARD_TARGET IP6T_STANDARD_TARGET +-#define LABEL_RETURN IP6TC_LABEL_RETURN +-#define LABEL_ACCEPT IP6TC_LABEL_ACCEPT +-#define LABEL_DROP IP6TC_LABEL_DROP +-#define LABEL_QUEUE IP6TC_LABEL_QUEUE +- +-#define ALIGN IP6T_ALIGN +-#define RETURN IP6T_RETURN +- +-#include "libiptc.c" +- +-#define BIT6(a, l) \ +- ((ntohl(a->in6_u.u6_addr32[(l) / 32]) >> (31 - ((l) & 31))) & 1) +- +-int +-ipv6_prefix_length(const struct in6_addr *a) +-{ +- int l, i; +- for (l = 0; l < 128; l++) { +- if (BIT6(a, l) == 0) +- break; +- } +- for (i = l + 1; i < 128; i++) { +- if (BIT6(a, i) == 1) +- return -1; +- } +- return l; +-} +- +-static int +-dump_entry(struct ip6t_entry *e, const ip6tc_handle_t handle) +-{ +- size_t i; +- char buf[40]; +- int len; +- struct ip6t_entry_target *t; +- +- printf("Entry %u (%lu):\n", iptcb_entry2index(handle, e), +- iptcb_entry2offset(handle, e)); +- puts("SRC IP: "); +- inet_ntop(AF_INET6, &e->ipv6.src, buf, sizeof buf); +- puts(buf); +- putchar('/'); +- len = ipv6_prefix_length(&e->ipv6.smsk); +- if (len != -1) +- printf("%d", len); +- else { +- inet_ntop(AF_INET6, &e->ipv6.smsk, buf, sizeof buf); +- puts(buf); +- } +- putchar('\n'); +- +- puts("DST IP: "); +- inet_ntop(AF_INET6, &e->ipv6.dst, buf, sizeof buf); +- puts(buf); +- putchar('/'); +- len = ipv6_prefix_length(&e->ipv6.dmsk); +- if (len != -1) +- printf("%d", len); +- else { +- inet_ntop(AF_INET6, &e->ipv6.dmsk, buf, sizeof buf); +- puts(buf); +- } +- putchar('\n'); +- +- printf("Interface: `%s'/", e->ipv6.iniface); +- for (i = 0; i < IFNAMSIZ; i++) +- printf("%c", e->ipv6.iniface_mask[i] ? 'X' : '.'); +- printf("to `%s'/", e->ipv6.outiface); +- for (i = 0; i < IFNAMSIZ; i++) +- printf("%c", e->ipv6.outiface_mask[i] ? 'X' : '.'); +- printf("\nProtocol: %u\n", e->ipv6.proto); +- if (e->ipv6.flags & IP6T_F_TOS) +- printf("TOS: %u\n", e->ipv6.tos); +- printf("Flags: %02X\n", e->ipv6.flags); +- printf("Invflags: %02X\n", e->ipv6.invflags); +- printf("Counters: %llu packets, %llu bytes\n", +- (unsigned long long)e->counters.pcnt, (unsigned long long)e->counters.bcnt); +- printf("Cache: %08X ", e->nfcache); +- if (e->nfcache & NFC_ALTERED) printf("ALTERED "); +- if (e->nfcache & NFC_UNKNOWN) printf("UNKNOWN "); +- printf("\n"); +- +- IP6T_MATCH_ITERATE(e, print_match); +- +- t = ip6t_get_target(e); +- printf("Target name: `%s' [%u]\n", t->u.user.name, t->u.target_size); +- if (strcmp(t->u.user.name, IP6T_STANDARD_TARGET) == 0) { +- int pos = *(int *)t->data; +- if (pos < 0) +- printf("verdict=%s\n", +- pos == -NF_ACCEPT-1 ? "NF_ACCEPT" +- : pos == -NF_DROP-1 ? "NF_DROP" +- : pos == IP6T_RETURN ? "RETURN" +- : "UNKNOWN"); +- else +- printf("verdict=%u\n", pos); +- } else if (strcmp(t->u.user.name, IP6T_ERROR_TARGET) == 0) +- printf("error=`%s'\n", t->data); +- +- printf("\n"); +- return 0; +-} +- +-static unsigned char * +-is_same(const STRUCT_ENTRY *a, const STRUCT_ENTRY *b, +- unsigned char *matchmask) +-{ +- unsigned int i; +- unsigned char *mptr; +- +- /* Always compare head structures: ignore mask here. */ +- if (memcmp(&a->ipv6.src, &b->ipv6.src, sizeof(struct in6_addr)) +- || memcmp(&a->ipv6.dst, &b->ipv6.dst, sizeof(struct in6_addr)) +- || memcmp(&a->ipv6.smsk, &b->ipv6.smsk, sizeof(struct in6_addr)) +- || memcmp(&a->ipv6.dmsk, &b->ipv6.dmsk, sizeof(struct in6_addr)) +- || a->ipv6.proto != b->ipv6.proto +- || a->ipv6.tos != b->ipv6.tos +- || a->ipv6.flags != b->ipv6.flags +- || a->ipv6.invflags != b->ipv6.invflags) +- return NULL; +- +- for (i = 0; i < IFNAMSIZ; i++) { +- if (a->ipv6.iniface_mask[i] != b->ipv6.iniface_mask[i]) +- return NULL; +- if ((a->ipv6.iniface[i] & a->ipv6.iniface_mask[i]) +- != (b->ipv6.iniface[i] & b->ipv6.iniface_mask[i])) +- return NULL; +- if (a->ipv6.outiface_mask[i] != b->ipv6.outiface_mask[i]) +- return NULL; +- if ((a->ipv6.outiface[i] & a->ipv6.outiface_mask[i]) +- != (b->ipv6.outiface[i] & b->ipv6.outiface_mask[i])) +- return NULL; +- } +- +- if (a->nfcache != b->nfcache +- || a->target_offset != b->target_offset +- || a->next_offset != b->next_offset) +- return NULL; +- +- mptr = matchmask + sizeof(STRUCT_ENTRY); +- if (IP6T_MATCH_ITERATE(a, match_different, a->elems, b->elems, &mptr)) +- return NULL; +- mptr += IP6T_ALIGN(sizeof(struct ip6t_entry_target)); +- +- return mptr; +-} +- +-/* All zeroes == unconditional rule. */ +-static inline int +-unconditional(const struct ip6t_ip6 *ipv6) +-{ +- unsigned int i; +- +- for (i = 0; i < sizeof(*ipv6); i++) +- if (((char *)ipv6)[i]) +- break; +- +- return (i == sizeof(*ipv6)); +-} +- +-#ifdef IPTC_DEBUG +-/* Do every conceivable sanity check on the handle */ +-static void +-do_check(TC_HANDLE_T h, unsigned int line) +-{ +- unsigned int i, n; +- unsigned int user_offset; /* Offset of first user chain */ +- int was_return; +- +- assert(h->changed == 0 || h->changed == 1); +- if (strcmp(h->info.name, "filter") == 0) { +- assert(h->info.valid_hooks +- == (1 << NF_IP6_LOCAL_IN +- | 1 << NF_IP6_FORWARD +- | 1 << NF_IP6_LOCAL_OUT)); +- +- /* Hooks should be first three */ +- assert(h->info.hook_entry[NF_IP6_LOCAL_IN] == 0); +- +- n = get_chain_end(h, 0); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_FORWARD] == n); +- +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_LOCAL_OUT] == n); +- +- user_offset = h->info.hook_entry[NF_IP6_LOCAL_OUT]; +- } else if (strcmp(h->info.name, "nat") == 0) { +- assert((h->info.valid_hooks +- == (1 << NF_IP6_PRE_ROUTING +- | 1 << NF_IP6_LOCAL_OUT +- | 1 << NF_IP6_POST_ROUTING)) || +- (h->info.valid_hooks +- == (1 << NF_IP6_PRE_ROUTING +- | 1 << NF_IP6_LOCAL_IN +- | 1 << NF_IP6_LOCAL_OUT +- | 1 << NF_IP6_POST_ROUTING))); +- +- assert(h->info.hook_entry[NF_IP6_PRE_ROUTING] == 0); +- +- n = get_chain_end(h, 0); +- +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_POST_ROUTING] == n); +- n = get_chain_end(h, n); +- +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_LOCAL_OUT] == n); +- user_offset = h->info.hook_entry[NF_IP6_LOCAL_OUT]; +- +- if (h->info.valid_hooks & (1 << NF_IP6_LOCAL_IN)) { +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_LOCAL_IN] == n); +- user_offset = h->info.hook_entry[NF_IP6_LOCAL_IN]; +- } +- +- } else if (strcmp(h->info.name, "mangle") == 0) { +- /* This code is getting ugly because linux < 2.4.18-pre6 had +- * two mangle hooks, linux >= 2.4.18-pre6 has five mangle hooks +- * */ +- assert((h->info.valid_hooks +- == (1 << NF_IP6_PRE_ROUTING +- | 1 << NF_IP6_LOCAL_OUT)) || +- (h->info.valid_hooks +- == (1 << NF_IP6_PRE_ROUTING +- | 1 << NF_IP6_LOCAL_IN +- | 1 << NF_IP6_FORWARD +- | 1 << NF_IP6_LOCAL_OUT +- | 1 << NF_IP6_POST_ROUTING))); +- +- /* Hooks should be first five */ +- assert(h->info.hook_entry[NF_IP6_PRE_ROUTING] == 0); +- +- n = get_chain_end(h, 0); +- +- if (h->info.valid_hooks & (1 << NF_IP6_LOCAL_IN)) { +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_LOCAL_IN] == n); +- n = get_chain_end(h, n); +- } +- +- if (h->info.valid_hooks & (1 << NF_IP6_FORWARD)) { +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_FORWARD] == n); +- n = get_chain_end(h, n); +- } +- +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_LOCAL_OUT] == n); +- user_offset = h->info.hook_entry[NF_IP6_LOCAL_OUT]; +- +- if (h->info.valid_hooks & (1 << NF_IP6_POST_ROUTING)) { +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_POST_ROUTING] == n); +- user_offset = h->info.hook_entry[NF_IP6_POST_ROUTING]; +- } +- } else if (strcmp(h->info.name, "raw") == 0) { +- assert(h->info.valid_hooks +- == (1 << NF_IP6_PRE_ROUTING +- | 1 << NF_IP6_LOCAL_OUT)); +- +- /* Hooks should be first three */ +- assert(h->info.hook_entry[NF_IP6_PRE_ROUTING] == 0); +- +- n = get_chain_end(h, n); +- n += get_entry(h, n)->next_offset; +- assert(h->info.hook_entry[NF_IP6_LOCAL_OUT] == n); +- +- user_offset = h->info.hook_entry[NF_IP6_LOCAL_OUT]; +- } else { +- fprintf(stderr, "Unknown table `%s'\n", h->info.name); +- abort(); +- } +- +- /* User chain == end of last builtin + policy entry */ +- user_offset = get_chain_end(h, user_offset); +- user_offset += get_entry(h, user_offset)->next_offset; +- +- /* Overflows should be end of entry chains, and unconditional +- policy nodes. */ +- for (i = 0; i < NUMHOOKS; i++) { +- STRUCT_ENTRY *e; +- STRUCT_STANDARD_TARGET *t; +- +- if (!(h->info.valid_hooks & (1 << i))) +- continue; +- assert(h->info.underflow[i] +- == get_chain_end(h, h->info.hook_entry[i])); +- +- e = get_entry(h, get_chain_end(h, h->info.hook_entry[i])); +- assert(unconditional(&e->ipv6)); +- assert(e->target_offset == sizeof(*e)); +- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e); +- printf("target_size=%u, align=%u\n", +- t->target.u.target_size, ALIGN(sizeof(*t))); +- assert(t->target.u.target_size == ALIGN(sizeof(*t))); +- assert(e->next_offset == sizeof(*e) + ALIGN(sizeof(*t))); +- +- assert(strcmp(t->target.u.user.name, STANDARD_TARGET)==0); +- assert(t->verdict == -NF_DROP-1 || t->verdict == -NF_ACCEPT-1); +- +- /* Hooks and underflows must be valid entries */ +- iptcb_entry2index(h, get_entry(h, h->info.hook_entry[i])); +- iptcb_entry2index(h, get_entry(h, h->info.underflow[i])); +- } +- +- assert(h->info.size +- >= h->info.num_entries * (sizeof(STRUCT_ENTRY) +- +sizeof(STRUCT_STANDARD_TARGET))); +- +- assert(h->entries.size +- >= (h->new_number +- * (sizeof(STRUCT_ENTRY) +- + sizeof(STRUCT_STANDARD_TARGET)))); +- assert(strcmp(h->info.name, h->entries.name) == 0); +- +- i = 0; n = 0; +- was_return = 0; +- +-#if 0 +- /* Check all the entries. */ +- ENTRY_ITERATE(h->entries.entrytable, h->entries.size, +- check_entry, &i, &n, user_offset, &was_return, h); +- +- assert(i == h->new_number); +- assert(n == h->entries.size); +- +- /* Final entry must be error node */ +- assert(strcmp(GET_TARGET(index2entry(h, h->new_number-1)) +- ->u.user.name, +- ERROR_TARGET) == 0); +-#endif +-} +-#endif /*IPTC_DEBUG*/ +diff --git libiptc/libiptc.c libiptc/libiptc.c +deleted file mode 100644 +index 08f5f4c..0000000 +--- libiptc/libiptc.c ++++ /dev/null +@@ -1,2274 +0,0 @@ +-/* Library which manipulates firewall rules. Version $Revision: 4136 $ */ +- +-/* Architecture of firewall rules is as follows: +- * +- * Chains go INPUT, FORWARD, OUTPUT then user chains. +- * Each user chain starts with an ERROR node. +- * Every chain ends with an unconditional jump: a RETURN for user chains, +- * and a POLICY for built-ins. +- */ +- +-/* (C) 1999 Paul ``Rusty'' Russell - Placed under the GNU GPL (See +- * COPYING for details). +- * (C) 2000-2004 by the Netfilter Core Team <coreteam@netfilter.org> +- * +- * 2003-Jun-20: Harald Welte <laforge@netfilter.org>: +- * - Reimplementation of chain cache to use offsets instead of entries +- * 2003-Jun-23: Harald Welte <laforge@netfilter.org>: +- * - performance optimization, sponsored by Astaro AG (http://www.astaro.com/) +- * don't rebuild the chain cache after every operation, instead fix it +- * up after a ruleset change. +- * 2004-Aug-18: Harald Welte <laforge@netfilter.org>: +- * - futher performance work: total reimplementation of libiptc. +- * - libiptc now has a real internal (linked-list) represntation of the +- * ruleset and a parser/compiler from/to this internal representation +- * - again sponsored by Astaro AG (http://www.astaro.com/) +- */ +-#include <sys/types.h> +-#include <sys/socket.h> +- +-#include "linux_list.h" +- +-//#define IPTC_DEBUG2 1 +- +-#ifdef IPTC_DEBUG2 +-#include <fcntl.h> +-#define DEBUGP(x, args...) fprintf(stderr, "%s: " x, __FUNCTION__, ## args) +-#define DEBUGP_C(x, args...) fprintf(stderr, x, ## args) +-#else +-#define DEBUGP(x, args...) +-#define DEBUGP_C(x, args...) +-#endif +- +-#ifndef IPT_LIB_DIR +-#define IPT_LIB_DIR "/usr/local/lib/iptables" +-#endif +- +-static int sockfd = -1; +-static int sockfd_use = 0; +-static void *iptc_fn = NULL; +- +-static const char *hooknames[] +-= { [HOOK_PRE_ROUTING] "PREROUTING", +- [HOOK_LOCAL_IN] "INPUT", +- [HOOK_FORWARD] "FORWARD", +- [HOOK_LOCAL_OUT] "OUTPUT", +- [HOOK_POST_ROUTING] "POSTROUTING", +-#ifdef HOOK_DROPPING +- [HOOK_DROPPING] "DROPPING" +-#endif +-}; +- +-/* Convenience structures */ +-struct ipt_error_target +-{ +- STRUCT_ENTRY_TARGET t; +- char error[TABLE_MAXNAMELEN]; +-}; +- +-struct chain_head; +-struct rule_head; +- +-struct counter_map +-{ +- enum { +- COUNTER_MAP_NOMAP, +- COUNTER_MAP_NORMAL_MAP, +- COUNTER_MAP_ZEROED, +- COUNTER_MAP_SET +- } maptype; +- unsigned int mappos; +-}; +- +-enum iptcc_rule_type { +- IPTCC_R_STANDARD, /* standard target (ACCEPT, ...) */ +- IPTCC_R_MODULE, /* extension module (SNAT, ...) */ +- IPTCC_R_FALLTHROUGH, /* fallthrough rule */ +- IPTCC_R_JUMP, /* jump to other chain */ +-}; +- +-struct rule_head +-{ +- struct list_head list; +- struct chain_head *chain; +- struct counter_map counter_map; +- +- unsigned int index; /* index (needed for counter_map) */ +- unsigned int offset; /* offset in rule blob */ +- +- enum iptcc_rule_type type; +- struct chain_head *jump; /* jump target, if IPTCC_R_JUMP */ +- +- unsigned int size; /* size of entry data */ +- STRUCT_ENTRY entry[0]; +-}; +- +-struct chain_head +-{ +- struct list_head list; +- char name[TABLE_MAXNAMELEN]; +- unsigned int hooknum; /* hook number+1 if builtin */ +- unsigned int references; /* how many jumps reference us */ +- int verdict; /* verdict if builtin */ +- +- STRUCT_COUNTERS counters; /* per-chain counters */ +- struct counter_map counter_map; +- +- unsigned int num_rules; /* number of rules in list */ +- struct list_head rules; /* list of rules */ +- +- unsigned int index; /* index (needed for jump resolval) */ +- unsigned int head_offset; /* offset in rule blob */ +- unsigned int foot_index; /* index (needed for counter_map) */ +- unsigned int foot_offset; /* offset in rule blob */ +-}; +- +-STRUCT_TC_HANDLE +-{ +- int changed; /* Have changes been made? */ +- +- struct list_head chains; +- +- struct chain_head *chain_iterator_cur; +- struct rule_head *rule_iterator_cur; +- +- STRUCT_GETINFO info; +- STRUCT_GET_ENTRIES *entries; +-}; +- +-/* allocate a new chain head for the cache */ +-static struct chain_head *iptcc_alloc_chain_head(const char *name, int hooknum) +-{ +- struct chain_head *c = malloc(sizeof(*c)); +- if (!c) +- return NULL; +- memset(c, 0, sizeof(*c)); +- +- strncpy(c->name, name, TABLE_MAXNAMELEN); +- c->hooknum = hooknum; +- INIT_LIST_HEAD(&c->rules); +- +- return c; +-} +- +-/* allocate and initialize a new rule for the cache */ +-static struct rule_head *iptcc_alloc_rule(struct chain_head *c, unsigned int size) +-{ +- struct rule_head *r = malloc(sizeof(*r)+size); +- if (!r) +- return NULL; +- memset(r, 0, sizeof(*r)); +- +- r->chain = c; +- r->size = size; +- +- return r; +-} +- +-/* notify us that the ruleset has been modified by the user */ +-static void +-set_changed(TC_HANDLE_T h) +-{ +- h->changed = 1; +-} +- +-#ifdef IPTC_DEBUG +-static void do_check(TC_HANDLE_T h, unsigned int line); +-#define CHECK(h) do { if (!getenv("IPTC_NO_CHECK")) do_check((h), __LINE__); } while(0) +-#else +-#define CHECK(h) +-#endif +- +- +-/********************************************************************** +- * iptc blob utility functions (iptcb_*) +- **********************************************************************/ +- +-static inline int +-iptcb_get_number(const STRUCT_ENTRY *i, +- const STRUCT_ENTRY *seek, +- unsigned int *pos) +-{ +- if (i == seek) +- return 1; +- (*pos)++; +- return 0; +-} +- +-static inline int +-iptcb_get_entry_n(STRUCT_ENTRY *i, +- unsigned int number, +- unsigned int *pos, +- STRUCT_ENTRY **pe) +-{ +- if (*pos == number) { +- *pe = i; +- return 1; +- } +- (*pos)++; +- return 0; +-} +- +-static inline STRUCT_ENTRY * +-iptcb_get_entry(TC_HANDLE_T h, unsigned int offset) +-{ +- return (STRUCT_ENTRY *)((char *)h->entries->entrytable + offset); +-} +- +-static unsigned int +-iptcb_entry2index(const TC_HANDLE_T h, const STRUCT_ENTRY *seek) +-{ +- unsigned int pos = 0; +- +- if (ENTRY_ITERATE(h->entries->entrytable, h->entries->size, +- iptcb_get_number, seek, &pos) == 0) { +- fprintf(stderr, "ERROR: offset %u not an entry!\n", +- (unsigned int)((char *)seek - (char *)h->entries->entrytable)); +- abort(); +- } +- return pos; +-} +- +-static inline STRUCT_ENTRY * +-iptcb_offset2entry(TC_HANDLE_T h, unsigned int offset) +-{ +- return (STRUCT_ENTRY *) ((void *)h->entries->entrytable+offset); +-} +- +- +-static inline unsigned long +-iptcb_entry2offset(const TC_HANDLE_T h, const STRUCT_ENTRY *e) +-{ +- return (void *)e - (void *)h->entries->entrytable; +-} +- +-static inline unsigned int +-iptcb_offset2index(const TC_HANDLE_T h, unsigned int offset) +-{ +- return iptcb_entry2index(h, iptcb_offset2entry(h, offset)); +-} +- +-/* Returns 0 if not hook entry, else hooknumber + 1 */ +-static inline unsigned int +-iptcb_ent_is_hook_entry(STRUCT_ENTRY *e, TC_HANDLE_T h) +-{ +- unsigned int i; +- +- for (i = 0; i < NUMHOOKS; i++) { +- if ((h->info.valid_hooks & (1 << i)) +- && iptcb_get_entry(h, h->info.hook_entry[i]) == e) +- return i+1; +- } +- return 0; +-} +- +- +-/********************************************************************** +- * iptc cache utility functions (iptcc_*) +- **********************************************************************/ +- +-/* Is the given chain builtin (1) or user-defined (0) */ +-static unsigned int iptcc_is_builtin(struct chain_head *c) +-{ +- return (c->hooknum ? 1 : 0); +-} +- +-/* Get a specific rule within a chain */ +-static struct rule_head *iptcc_get_rule_num(struct chain_head *c, +- unsigned int rulenum) +-{ +- struct rule_head *r; +- unsigned int num = 0; +- +- list_for_each_entry(r, &c->rules, list) { +- num++; +- if (num == rulenum) +- return r; +- } +- return NULL; +-} +- +-/* Get a specific rule within a chain backwards */ +-static struct rule_head *iptcc_get_rule_num_reverse(struct chain_head *c, +- unsigned int rulenum) +-{ +- struct rule_head *r; +- unsigned int num = 0; +- +- list_for_each_entry_reverse(r, &c->rules, list) { +- num++; +- if (num == rulenum) +- return r; +- } +- return NULL; +-} +- +-/* Returns chain head if found, otherwise NULL. */ +-static struct chain_head * +-iptcc_find_chain_by_offset(TC_HANDLE_T handle, unsigned int offset) +-{ +- struct list_head *pos; +- +- if (list_empty(&handle->chains)) +- return NULL; +- +- list_for_each(pos, &handle->chains) { +- struct chain_head *c = list_entry(pos, struct chain_head, list); +- if (offset >= c->head_offset && offset <= c->foot_offset) +- return c; +- } +- +- return NULL; +-} +-/* Returns chain head if found, otherwise NULL. */ +-static struct chain_head * +-iptcc_find_label(const char *name, TC_HANDLE_T handle) +-{ +- struct list_head *pos; +- +- if (list_empty(&handle->chains)) +- return NULL; +- +- list_for_each(pos, &handle->chains) { +- struct chain_head *c = list_entry(pos, struct chain_head, list); +- if (!strcmp(c->name, name)) +- return c; +- } +- +- return NULL; +-} +- +-/* called when rule is to be removed from cache */ +-static void iptcc_delete_rule(struct rule_head *r) +-{ +- DEBUGP("deleting rule %p (offset %u)\n", r, r->offset); +- /* clean up reference count of called chain */ +- if (r->type == IPTCC_R_JUMP +- && r->jump) +- r->jump->references--; +- +- list_del(&r->list); +- free(r); +-} +- +- +-/********************************************************************** +- * RULESET PARSER (blob -> cache) +- **********************************************************************/ +- +-/* Delete policy rule of previous chain, since cache doesn't contain +- * chain policy rules. +- * WARNING: This function has ugly design and relies on a lot of context, only +- * to be called from specific places within the parser */ +-static int __iptcc_p_del_policy(TC_HANDLE_T h, unsigned int num) +-{ +- if (h->chain_iterator_cur) { +- /* policy rule is last rule */ +- struct rule_head *pr = (struct rule_head *) +- h->chain_iterator_cur->rules.prev; +- +- /* save verdict */ +- h->chain_iterator_cur->verdict = +- *(int *)GET_TARGET(pr->entry)->data; +- +- /* save counter and counter_map information */ +- h->chain_iterator_cur->counter_map.maptype = +- COUNTER_MAP_NORMAL_MAP; +- h->chain_iterator_cur->counter_map.mappos = num-1; +- memcpy(&h->chain_iterator_cur->counters, &pr->entry->counters, +- sizeof(h->chain_iterator_cur->counters)); +- +- /* foot_offset points to verdict rule */ +- h->chain_iterator_cur->foot_index = num; +- h->chain_iterator_cur->foot_offset = pr->offset; +- +- /* delete rule from cache */ +- iptcc_delete_rule(pr); +- h->chain_iterator_cur->num_rules--; +- +- return 1; +- } +- return 0; +-} +- +-/* alphabetically insert a chain into the list */ +-static inline void iptc_insert_chain(TC_HANDLE_T h, struct chain_head *c) +-{ +- struct chain_head *tmp; +- +- /* sort only user defined chains */ +- if (!c->hooknum) { +- list_for_each_entry(tmp, &h->chains, list) { +- if (strcmp(c->name, tmp->name) <= 0) { +- list_add(&c->list, tmp->list.prev); +- return; +- } +- } +- } +- +- /* survived till end of list: add at tail */ +- list_add_tail(&c->list, &h->chains); +-} +- +-/* Another ugly helper function split out of cache_add_entry to make it less +- * spaghetti code */ +-static void __iptcc_p_add_chain(TC_HANDLE_T h, struct chain_head *c, +- unsigned int offset, unsigned int *num) +-{ +- __iptcc_p_del_policy(h, *num); +- +- c->head_offset = offset; +- c->index = *num; +- +- iptc_insert_chain(h, c); +- +- h->chain_iterator_cur = c; +-} +- +-/* main parser function: add an entry from the blob to the cache */ +-static int cache_add_entry(STRUCT_ENTRY *e, +- TC_HANDLE_T h, +- STRUCT_ENTRY **prev, +- unsigned int *num) +-{ +- unsigned int builtin; +- unsigned int offset = (char *)e - (char *)h->entries->entrytable; +- +- DEBUGP("entering..."); +- +- /* Last entry ("policy rule"). End it.*/ +- if (iptcb_entry2offset(h,e) + e->next_offset == h->entries->size) { +- /* This is the ERROR node at the end of the chain */ +- DEBUGP_C("%u:%u: end of table:\n", *num, offset); +- +- __iptcc_p_del_policy(h, *num); +- +- h->chain_iterator_cur = NULL; +- goto out_inc; +- } +- +- /* We know this is the start of a new chain if it's an ERROR +- * target, or a hook entry point */ +- +- if (strcmp(GET_TARGET(e)->u.user.name, ERROR_TARGET) == 0) { +- struct chain_head *c = +- iptcc_alloc_chain_head((const char *)GET_TARGET(e)->data, 0); +- DEBUGP_C("%u:%u:new userdefined chain %s: %p\n", *num, offset, +- (char *)c->name, c); +- if (!c) { +- errno = -ENOMEM; +- return -1; +- } +- +- __iptcc_p_add_chain(h, c, offset, num); +- +- } else if ((builtin = iptcb_ent_is_hook_entry(e, h)) != 0) { +- struct chain_head *c = +- iptcc_alloc_chain_head((char *)hooknames[builtin-1], +- builtin); +- DEBUGP_C("%u:%u new builtin chain: %p (rules=%p)\n", +- *num, offset, c, &c->rules); +- if (!c) { +- errno = -ENOMEM; +- return -1; +- } +- +- c->hooknum = builtin; +- +- __iptcc_p_add_chain(h, c, offset, num); +- +- /* FIXME: this is ugly. */ +- goto new_rule; +- } else { +- /* has to be normal rule */ +- struct rule_head *r; +-new_rule: +- +- if (!(r = iptcc_alloc_rule(h->chain_iterator_cur, +- e->next_offset))) { +- errno = ENOMEM; +- return -1; +- } +- DEBUGP_C("%u:%u normal rule: %p: ", *num, offset, r); +- +- r->index = *num; +- r->offset = offset; +- memcpy(r->entry, e, e->next_offset); +- r->counter_map.maptype = COUNTER_MAP_NORMAL_MAP; +- r->counter_map.mappos = r->index; +- +- /* handling of jumps, etc. */ +- if (!strcmp(GET_TARGET(e)->u.user.name, STANDARD_TARGET)) { +- STRUCT_STANDARD_TARGET *t; +- +- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e); +- if (t->target.u.target_size +- != ALIGN(sizeof(STRUCT_STANDARD_TARGET))) { +- errno = EINVAL; +- return -1; +- } +- +- if (t->verdict < 0) { +- DEBUGP_C("standard, verdict=%d\n", t->verdict); +- r->type = IPTCC_R_STANDARD; +- } else if (t->verdict == r->offset+e->next_offset) { +- DEBUGP_C("fallthrough\n"); +- r->type = IPTCC_R_FALLTHROUGH; +- } else { +- DEBUGP_C("jump, target=%u\n", t->verdict); +- r->type = IPTCC_R_JUMP; +- /* Jump target fixup has to be deferred +- * until second pass, since we migh not +- * yet have parsed the target */ +- } +- } else { +- DEBUGP_C("module, target=%s\n", GET_TARGET(e)->u.user.name); +- r->type = IPTCC_R_MODULE; +- } +- +- list_add_tail(&r->list, &h->chain_iterator_cur->rules); +- h->chain_iterator_cur->num_rules++; +- } +-out_inc: +- (*num)++; +- return 0; +-} +- +- +-/* parse an iptables blob into it's pieces */ +-static int parse_table(TC_HANDLE_T h) +-{ +- STRUCT_ENTRY *prev; +- unsigned int num = 0; +- struct chain_head *c; +- +- /* First pass: over ruleset blob */ +- ENTRY_ITERATE(h->entries->entrytable, h->entries->size, +- cache_add_entry, h, &prev, &num); +- +- /* Second pass: fixup parsed data from first pass */ +- list_for_each_entry(c, &h->chains, list) { +- struct rule_head *r; +- list_for_each_entry(r, &c->rules, list) { +- struct chain_head *c; +- STRUCT_STANDARD_TARGET *t; +- +- if (r->type != IPTCC_R_JUMP) +- continue; +- +- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(r->entry); +- c = iptcc_find_chain_by_offset(h, t->verdict); +- if (!c) +- return -1; +- r->jump = c; +- c->references++; +- } +- } +- +- /* FIXME: sort chains */ +- +- return 1; +-} +- +- +-/********************************************************************** +- * RULESET COMPILATION (cache -> blob) +- **********************************************************************/ +- +-/* Convenience structures */ +-struct iptcb_chain_start{ +- STRUCT_ENTRY e; +- struct ipt_error_target name; +-}; +-#define IPTCB_CHAIN_START_SIZE (sizeof(STRUCT_ENTRY) + \ +- ALIGN(sizeof(struct ipt_error_target))) +- +-struct iptcb_chain_foot { +- STRUCT_ENTRY e; +- STRUCT_STANDARD_TARGET target; +-}; +-#define IPTCB_CHAIN_FOOT_SIZE (sizeof(STRUCT_ENTRY) + \ +- ALIGN(sizeof(STRUCT_STANDARD_TARGET))) +- +-struct iptcb_chain_error { +- STRUCT_ENTRY entry; +- struct ipt_error_target target; +-}; +-#define IPTCB_CHAIN_ERROR_SIZE (sizeof(STRUCT_ENTRY) + \ +- ALIGN(sizeof(struct ipt_error_target))) +- +- +- +-/* compile rule from cache into blob */ +-static inline int iptcc_compile_rule (TC_HANDLE_T h, STRUCT_REPLACE *repl, struct rule_head *r) +-{ +- /* handle jumps */ +- if (r->type == IPTCC_R_JUMP) { +- STRUCT_STANDARD_TARGET *t; +- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(r->entry); +- /* memset for memcmp convenience on delete/replace */ +- memset(t->target.u.user.name, 0, FUNCTION_MAXNAMELEN); +- strcpy(t->target.u.user.name, STANDARD_TARGET); +- /* Jumps can only happen to builtin chains, so we +- * can safely assume that they always have a header */ +- t->verdict = r->jump->head_offset + IPTCB_CHAIN_START_SIZE; +- } else if (r->type == IPTCC_R_FALLTHROUGH) { +- STRUCT_STANDARD_TARGET *t; +- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(r->entry); +- t->verdict = r->offset + r->size; +- } +- +- /* copy entry from cache to blob */ +- memcpy((char *)repl->entries+r->offset, r->entry, r->size); +- +- return 1; +-} +- +-/* compile chain from cache into blob */ +-static int iptcc_compile_chain(TC_HANDLE_T h, STRUCT_REPLACE *repl, struct chain_head *c) +-{ +- int ret; +- struct rule_head *r; +- struct iptcb_chain_start *head; +- struct iptcb_chain_foot *foot; +- +- /* only user-defined chains have heaer */ +- if (!iptcc_is_builtin(c)) { +- /* put chain header in place */ +- head = (void *)repl->entries + c->head_offset; +- head->e.target_offset = sizeof(STRUCT_ENTRY); +- head->e.next_offset = IPTCB_CHAIN_START_SIZE; +- strcpy(head->name.t.u.user.name, ERROR_TARGET); +- head->name.t.u.target_size = +- ALIGN(sizeof(struct ipt_error_target)); +- strcpy(head->name.error, c->name); +- } else { +- repl->hook_entry[c->hooknum-1] = c->head_offset; +- repl->underflow[c->hooknum-1] = c->foot_offset; +- } +- +- /* iterate over rules */ +- list_for_each_entry(r, &c->rules, list) { +- ret = iptcc_compile_rule(h, repl, r); +- if (ret < 0) +- return ret; +- } +- +- /* put chain footer in place */ +- foot = (void *)repl->entries + c->foot_offset; +- foot->e.target_offset = sizeof(STRUCT_ENTRY); +- foot->e.next_offset = IPTCB_CHAIN_FOOT_SIZE; +- strcpy(foot->target.target.u.user.name, STANDARD_TARGET); +- foot->target.target.u.target_size = +- ALIGN(sizeof(STRUCT_STANDARD_TARGET)); +- /* builtin targets have verdict, others return */ +- if (iptcc_is_builtin(c)) +- foot->target.verdict = c->verdict; +- else +- foot->target.verdict = RETURN; +- /* set policy-counters */ +- memcpy(&foot->e.counters, &c->counters, sizeof(STRUCT_COUNTERS)); +- +- return 0; +-} +- +-/* calculate offset and number for every rule in the cache */ +-static int iptcc_compile_chain_offsets(TC_HANDLE_T h, struct chain_head *c, +- unsigned int *offset, unsigned int *num) +-{ +- struct rule_head *r; +- +- c->head_offset = *offset; +- DEBUGP("%s: chain_head %u, offset=%u\n", c->name, *num, *offset); +- +- if (!iptcc_is_builtin(c)) { +- /* Chain has header */ +- *offset += sizeof(STRUCT_ENTRY) +- + ALIGN(sizeof(struct ipt_error_target)); +- (*num)++; +- } +- +- list_for_each_entry(r, &c->rules, list) { +- DEBUGP("rule %u, offset=%u, index=%u\n", *num, *offset, *num); +- r->offset = *offset; +- r->index = *num; +- *offset += r->size; +- (*num)++; +- } +- +- DEBUGP("%s; chain_foot %u, offset=%u, index=%u\n", c->name, *num, +- *offset, *num); +- c->foot_offset = *offset; +- c->foot_index = *num; +- *offset += sizeof(STRUCT_ENTRY) +- + ALIGN(sizeof(STRUCT_STANDARD_TARGET)); +- (*num)++; +- +- return 1; +-} +- +-/* put the pieces back together again */ +-static int iptcc_compile_table_prep(TC_HANDLE_T h, unsigned int *size) +-{ +- struct chain_head *c; +- unsigned int offset = 0, num = 0; +- int ret = 0; +- +- /* First pass: calculate offset for every rule */ +- list_for_each_entry(c, &h->chains, list) { +- ret = iptcc_compile_chain_offsets(h, c, &offset, &num); +- if (ret < 0) +- return ret; +- } +- +- /* Append one error rule at end of chain */ +- num++; +- offset += sizeof(STRUCT_ENTRY) +- + ALIGN(sizeof(struct ipt_error_target)); +- +- /* ruleset size is now in offset */ +- *size = offset; +- return num; +-} +- +-static int iptcc_compile_table(TC_HANDLE_T h, STRUCT_REPLACE *repl) +-{ +- struct chain_head *c; +- struct iptcb_chain_error *error; +- +- /* Second pass: copy from cache to offsets, fill in jumps */ +- list_for_each_entry(c, &h->chains, list) { +- int ret = iptcc_compile_chain(h, repl, c); +- if (ret < 0) +- return ret; +- } +- +- /* Append error rule at end of chain */ +- error = (void *)repl->entries + repl->size - IPTCB_CHAIN_ERROR_SIZE; +- error->entry.target_offset = sizeof(STRUCT_ENTRY); +- error->entry.next_offset = IPTCB_CHAIN_ERROR_SIZE; +- error->target.t.u.user.target_size = +- ALIGN(sizeof(struct ipt_error_target)); +- strcpy((char *)&error->target.t.u.user.name, ERROR_TARGET); +- strcpy((char *)&error->target.error, "ERROR"); +- +- return 1; +-} +- +-/********************************************************************** +- * EXTERNAL API (operates on cache only) +- **********************************************************************/ +- +-/* Allocate handle of given size */ +-static TC_HANDLE_T +-alloc_handle(const char *tablename, unsigned int size, unsigned int num_rules) +-{ +- size_t len; +- TC_HANDLE_T h; +- +- len = sizeof(STRUCT_TC_HANDLE) + size; +- +- h = malloc(sizeof(STRUCT_TC_HANDLE)); +- if (!h) { +- errno = ENOMEM; +- return NULL; +- } +- memset(h, 0, sizeof(*h)); +- INIT_LIST_HEAD(&h->chains); +- strcpy(h->info.name, tablename); +- +- h->entries = malloc(sizeof(STRUCT_GET_ENTRIES) + size); +- if (!h->entries) +- goto out_free_handle; +- +- strcpy(h->entries->name, tablename); +- h->entries->size = size; +- +- return h; +- +-out_free_handle: +- free(h); +- +- return NULL; +-} +- +- +-TC_HANDLE_T +-TC_INIT(const char *tablename) +-{ +- TC_HANDLE_T h; +- STRUCT_GETINFO info; +- unsigned int tmp; +- socklen_t s; +- +- iptc_fn = TC_INIT; +- +- if (strlen(tablename) >= TABLE_MAXNAMELEN) { +- errno = EINVAL; +- return NULL; +- } +- +- if (sockfd_use == 0) { +- sockfd = socket(TC_AF, SOCK_RAW, IPPROTO_RAW); +- if (sockfd < 0) +- return NULL; +- } +- sockfd_use++; +- +- s = sizeof(info); +- +- strcpy(info.name, tablename); +- if (getsockopt(sockfd, TC_IPPROTO, SO_GET_INFO, &info, &s) < 0) { +- if (--sockfd_use == 0) { +- close(sockfd); +- sockfd = -1; +- } +- return NULL; +- } +- +- DEBUGP("valid_hooks=0x%08x, num_entries=%u, size=%u\n", +- info.valid_hooks, info.num_entries, info.size); +- +- if ((h = alloc_handle(info.name, info.size, info.num_entries)) +- == NULL) { +- if (--sockfd_use == 0) { +- close(sockfd); +- sockfd = -1; +- } +- return NULL; +- } +- +- /* Initialize current state */ +- h->info = info; +- +- h->entries->size = h->info.size; +- +- tmp = sizeof(STRUCT_GET_ENTRIES) + h->info.size; +- +- if (getsockopt(sockfd, TC_IPPROTO, SO_GET_ENTRIES, h->entries, +- &tmp) < 0) +- goto error; +- +-#ifdef IPTC_DEBUG2 +- { +- int fd = open("/tmp/libiptc-so_get_entries.blob", +- O_CREAT|O_WRONLY); +- if (fd >= 0) { +- write(fd, h->entries, tmp); +- close(fd); +- } +- } +-#endif +- +- if (parse_table(h) < 0) +- goto error; +- +- CHECK(h); +- return h; +-error: +- if (--sockfd_use == 0) { +- close(sockfd); +- sockfd = -1; +- } +- TC_FREE(&h); +- return NULL; +-} +- +-void +-TC_FREE(TC_HANDLE_T *h) +-{ +- struct chain_head *c, *tmp; +- +- iptc_fn = TC_FREE; +- if (--sockfd_use == 0) { +- close(sockfd); +- sockfd = -1; +- } +- +- list_for_each_entry_safe(c, tmp, &(*h)->chains, list) { +- struct rule_head *r, *rtmp; +- +- list_for_each_entry_safe(r, rtmp, &c->rules, list) { +- free(r); +- } +- +- free(c); +- } +- +- free((*h)->entries); +- free(*h); +- +- *h = NULL; +-} +- +-static inline int +-print_match(const STRUCT_ENTRY_MATCH *m) +-{ +- printf("Match name: `%s'\n", m->u.user.name); +- return 0; +-} +- +-static int dump_entry(STRUCT_ENTRY *e, const TC_HANDLE_T handle); +- +-void +-TC_DUMP_ENTRIES(const TC_HANDLE_T handle) +-{ +- iptc_fn = TC_DUMP_ENTRIES; +- CHECK(handle); +-#if 0 +- printf("libiptc v%s. %u bytes.\n", +- IPTABLES_VERSION, handle->entries->size); +- printf("Table `%s'\n", handle->info.name); +- printf("Hooks: pre/in/fwd/out/post = %u/%u/%u/%u/%u\n", +- handle->info.hook_entry[HOOK_PRE_ROUTING], +- handle->info.hook_entry[HOOK_LOCAL_IN], +- handle->info.hook_entry[HOOK_FORWARD], +- handle->info.hook_entry[HOOK_LOCAL_OUT], +- handle->info.hook_entry[HOOK_POST_ROUTING]); +- printf("Underflows: pre/in/fwd/out/post = %u/%u/%u/%u/%u\n", +- handle->info.underflow[HOOK_PRE_ROUTING], +- handle->info.underflow[HOOK_LOCAL_IN], +- handle->info.underflow[HOOK_FORWARD], +- handle->info.underflow[HOOK_LOCAL_OUT], +- handle->info.underflow[HOOK_POST_ROUTING]); +- +- ENTRY_ITERATE(handle->entries->entrytable, handle->entries->size, +- dump_entry, handle); +-#endif +-} +- +-/* Does this chain exist? */ +-int TC_IS_CHAIN(const char *chain, const TC_HANDLE_T handle) +-{ +- iptc_fn = TC_IS_CHAIN; +- return iptcc_find_label(chain, handle) != NULL; +-} +- +-static void iptcc_chain_iterator_advance(TC_HANDLE_T handle) +-{ +- struct chain_head *c = handle->chain_iterator_cur; +- +- if (c->list.next == &handle->chains) +- handle->chain_iterator_cur = NULL; +- else +- handle->chain_iterator_cur = +- list_entry(c->list.next, struct chain_head, list); +-} +- +-/* Iterator functions to run through the chains. */ +-const char * +-TC_FIRST_CHAIN(TC_HANDLE_T *handle) +-{ +- struct chain_head *c = list_entry((*handle)->chains.next, +- struct chain_head, list); +- +- iptc_fn = TC_FIRST_CHAIN; +- +- +- if (list_empty(&(*handle)->chains)) { +- DEBUGP(": no chains\n"); +- return NULL; +- } +- +- (*handle)->chain_iterator_cur = c; +- iptcc_chain_iterator_advance(*handle); +- +- DEBUGP(": returning `%s'\n", c->name); +- return c->name; +-} +- +-/* Iterator functions to run through the chains. Returns NULL at end. */ +-const char * +-TC_NEXT_CHAIN(TC_HANDLE_T *handle) +-{ +- struct chain_head *c = (*handle)->chain_iterator_cur; +- +- iptc_fn = TC_NEXT_CHAIN; +- +- if (!c) { +- DEBUGP(": no more chains\n"); +- return NULL; +- } +- +- iptcc_chain_iterator_advance(*handle); +- +- DEBUGP(": returning `%s'\n", c->name); +- return c->name; +-} +- +-/* Get first rule in the given chain: NULL for empty chain. */ +-const STRUCT_ENTRY * +-TC_FIRST_RULE(const char *chain, TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- +- iptc_fn = TC_FIRST_RULE; +- +- DEBUGP("first rule(%s): ", chain); +- +- c = iptcc_find_label(chain, *handle); +- if (!c) { +- errno = ENOENT; +- return NULL; +- } +- +- /* Empty chain: single return/policy rule */ +- if (list_empty(&c->rules)) { +- DEBUGP_C("no rules, returning NULL\n"); +- return NULL; +- } +- +- r = list_entry(c->rules.next, struct rule_head, list); +- (*handle)->rule_iterator_cur = r; +- DEBUGP_C("%p\n", r); +- +- return r->entry; +-} +- +-/* Returns NULL when rules run out. */ +-const STRUCT_ENTRY * +-TC_NEXT_RULE(const STRUCT_ENTRY *prev, TC_HANDLE_T *handle) +-{ +- struct rule_head *r; +- +- iptc_fn = TC_NEXT_RULE; +- DEBUGP("rule_iterator_cur=%p...", (*handle)->rule_iterator_cur); +- +- if (!(*handle)->rule_iterator_cur) { +- DEBUGP_C("returning NULL\n"); +- return NULL; +- } +- +- r = list_entry((*handle)->rule_iterator_cur->list.next, +- struct rule_head, list); +- +- iptc_fn = TC_NEXT_RULE; +- +- DEBUGP_C("next=%p, head=%p...", &r->list, +- &(*handle)->rule_iterator_cur->chain->rules); +- +- if (&r->list == &(*handle)->rule_iterator_cur->chain->rules) { +- (*handle)->rule_iterator_cur = NULL; +- DEBUGP_C("finished, returning NULL\n"); +- return NULL; +- } +- +- (*handle)->rule_iterator_cur = r; +- +- /* NOTE: prev is without any influence ! */ +- DEBUGP_C("returning rule %p\n", r); +- return r->entry; +-} +- +-/* How many rules in this chain? */ +-unsigned int +-TC_NUM_RULES(const char *chain, TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- iptc_fn = TC_NUM_RULES; +- CHECK(*handle); +- +- c = iptcc_find_label(chain, *handle); +- if (!c) { +- errno = ENOENT; +- return (unsigned int)-1; +- } +- +- return c->num_rules; +-} +- +-const STRUCT_ENTRY *TC_GET_RULE(const char *chain, +- unsigned int n, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- +- iptc_fn = TC_GET_RULE; +- +- CHECK(*handle); +- +- c = iptcc_find_label(chain, *handle); +- if (!c) { +- errno = ENOENT; +- return NULL; +- } +- +- r = iptcc_get_rule_num(c, n); +- if (!r) +- return NULL; +- return r->entry; +-} +- +-/* Returns a pointer to the target name of this position. */ +-const char *standard_target_map(int verdict) +-{ +- switch (verdict) { +- case RETURN: +- return LABEL_RETURN; +- break; +- case -NF_ACCEPT-1: +- return LABEL_ACCEPT; +- break; +- case -NF_DROP-1: +- return LABEL_DROP; +- break; +- case -NF_QUEUE-1: +- return LABEL_QUEUE; +- break; +- default: +- fprintf(stderr, "ERROR: %d not a valid target)\n", +- verdict); +- abort(); +- break; +- } +- /* not reached */ +- return NULL; +-} +- +-/* Returns a pointer to the target name of this position. */ +-const char *TC_GET_TARGET(const STRUCT_ENTRY *ce, +- TC_HANDLE_T *handle) +-{ +- STRUCT_ENTRY *e = (STRUCT_ENTRY *)ce; +- struct rule_head *r = container_of(e, struct rule_head, entry[0]); +- +- iptc_fn = TC_GET_TARGET; +- +- switch(r->type) { +- int spos; +- case IPTCC_R_FALLTHROUGH: +- return ""; +- break; +- case IPTCC_R_JUMP: +- DEBUGP("r=%p, jump=%p, name=`%s'\n", r, r->jump, r->jump->name); +- return r->jump->name; +- break; +- case IPTCC_R_STANDARD: +- spos = *(int *)GET_TARGET(e)->data; +- DEBUGP("r=%p, spos=%d'\n", r, spos); +- return standard_target_map(spos); +- break; +- case IPTCC_R_MODULE: +- return GET_TARGET(e)->u.user.name; +- break; +- } +- return NULL; +-} +-/* Is this a built-in chain? Actually returns hook + 1. */ +-int +-TC_BUILTIN(const char *chain, const TC_HANDLE_T handle) +-{ +- struct chain_head *c; +- +- iptc_fn = TC_BUILTIN; +- +- c = iptcc_find_label(chain, handle); +- if (!c) { +- errno = ENOENT; +- return 0; +- } +- +- return iptcc_is_builtin(c); +-} +- +-/* Get the policy of a given built-in chain */ +-const char * +-TC_GET_POLICY(const char *chain, +- STRUCT_COUNTERS *counters, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- +- iptc_fn = TC_GET_POLICY; +- +- DEBUGP("called for chain %s\n", chain); +- +- c = iptcc_find_label(chain, *handle); +- if (!c) { +- errno = ENOENT; +- return NULL; +- } +- +- if (!iptcc_is_builtin(c)) +- return NULL; +- +- *counters = c->counters; +- +- return standard_target_map(c->verdict); +-} +- +-static int +-iptcc_standard_map(struct rule_head *r, int verdict) +-{ +- STRUCT_ENTRY *e = r->entry; +- STRUCT_STANDARD_TARGET *t; +- +- t = (STRUCT_STANDARD_TARGET *)GET_TARGET(e); +- +- if (t->target.u.target_size +- != ALIGN(sizeof(STRUCT_STANDARD_TARGET))) { +- errno = EINVAL; +- return 0; +- } +- /* memset for memcmp convenience on delete/replace */ +- memset(t->target.u.user.name, 0, FUNCTION_MAXNAMELEN); +- strcpy(t->target.u.user.name, STANDARD_TARGET); +- t->verdict = verdict; +- +- r->type = IPTCC_R_STANDARD; +- +- return 1; +-} +- +-static int +-iptcc_map_target(const TC_HANDLE_T handle, +- struct rule_head *r) +-{ +- STRUCT_ENTRY *e = r->entry; +- STRUCT_ENTRY_TARGET *t = GET_TARGET(e); +- +- /* Maybe it's empty (=> fall through) */ +- if (strcmp(t->u.user.name, "") == 0) { +- r->type = IPTCC_R_FALLTHROUGH; +- return 1; +- } +- /* Maybe it's a standard target name... */ +- else if (strcmp(t->u.user.name, LABEL_ACCEPT) == 0) +- return iptcc_standard_map(r, -NF_ACCEPT - 1); +- else if (strcmp(t->u.user.name, LABEL_DROP) == 0) +- return iptcc_standard_map(r, -NF_DROP - 1); +- else if (strcmp(t->u.user.name, LABEL_QUEUE) == 0) +- return iptcc_standard_map(r, -NF_QUEUE - 1); +- else if (strcmp(t->u.user.name, LABEL_RETURN) == 0) +- return iptcc_standard_map(r, RETURN); +- else if (TC_BUILTIN(t->u.user.name, handle)) { +- /* Can't jump to builtins. */ +- errno = EINVAL; +- return 0; +- } else { +- /* Maybe it's an existing chain name. */ +- struct chain_head *c; +- DEBUGP("trying to find chain `%s': ", t->u.user.name); +- +- c = iptcc_find_label(t->u.user.name, handle); +- if (c) { +- DEBUGP_C("found!\n"); +- r->type = IPTCC_R_JUMP; +- r->jump = c; +- c->references++; +- return 1; +- } +- DEBUGP_C("not found :(\n"); +- } +- +- /* Must be a module? If not, kernel will reject... */ +- /* memset to all 0 for your memcmp convenience: don't clear version */ +- memset(t->u.user.name + strlen(t->u.user.name), +- 0, +- FUNCTION_MAXNAMELEN - 1 - strlen(t->u.user.name)); +- r->type = IPTCC_R_MODULE; +- set_changed(handle); +- return 1; +-} +- +-/* Insert the entry `fw' in chain `chain' into position `rulenum'. */ +-int +-TC_INSERT_ENTRY(const IPT_CHAINLABEL chain, +- const STRUCT_ENTRY *e, +- unsigned int rulenum, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- struct list_head *prev; +- +- iptc_fn = TC_INSERT_ENTRY; +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- /* first rulenum index = 0 +- first c->num_rules index = 1 */ +- if (rulenum > c->num_rules) { +- errno = E2BIG; +- return 0; +- } +- +- /* If we are inserting at the end just take advantage of the +- double linked list, insert will happen before the entry +- prev points to. */ +- if (rulenum == c->num_rules) { +- prev = &c->rules; +- } else if (rulenum + 1 <= c->num_rules/2) { +- r = iptcc_get_rule_num(c, rulenum + 1); +- prev = &r->list; +- } else { +- r = iptcc_get_rule_num_reverse(c, c->num_rules - rulenum); +- prev = &r->list; +- } +- +- if (!(r = iptcc_alloc_rule(c, e->next_offset))) { +- errno = ENOMEM; +- return 0; +- } +- +- memcpy(r->entry, e, e->next_offset); +- r->counter_map.maptype = COUNTER_MAP_SET; +- +- if (!iptcc_map_target(*handle, r)) { +- free(r); +- return 0; +- } +- +- list_add_tail(&r->list, prev); +- c->num_rules++; +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Atomically replace rule `rulenum' in `chain' with `fw'. */ +-int +-TC_REPLACE_ENTRY(const IPT_CHAINLABEL chain, +- const STRUCT_ENTRY *e, +- unsigned int rulenum, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r, *old; +- +- iptc_fn = TC_REPLACE_ENTRY; +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- if (rulenum >= c->num_rules) { +- errno = E2BIG; +- return 0; +- } +- +- /* Take advantage of the double linked list if possible. */ +- if (rulenum + 1 <= c->num_rules/2) { +- old = iptcc_get_rule_num(c, rulenum + 1); +- } else { +- old = iptcc_get_rule_num_reverse(c, c->num_rules - rulenum); +- } +- +- if (!(r = iptcc_alloc_rule(c, e->next_offset))) { +- errno = ENOMEM; +- return 0; +- } +- +- memcpy(r->entry, e, e->next_offset); +- r->counter_map.maptype = COUNTER_MAP_SET; +- +- if (!iptcc_map_target(*handle, r)) { +- free(r); +- return 0; +- } +- +- list_add(&r->list, &old->list); +- iptcc_delete_rule(old); +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Append entry `fw' to chain `chain'. Equivalent to insert with +- rulenum = length of chain. */ +-int +-TC_APPEND_ENTRY(const IPT_CHAINLABEL chain, +- const STRUCT_ENTRY *e, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- +- iptc_fn = TC_APPEND_ENTRY; +- if (!(c = iptcc_find_label(chain, *handle))) { +- DEBUGP("unable to find chain `%s'\n", chain); +- errno = ENOENT; +- return 0; +- } +- +- if (!(r = iptcc_alloc_rule(c, e->next_offset))) { +- DEBUGP("unable to allocate rule for chain `%s'\n", chain); +- errno = ENOMEM; +- return 0; +- } +- +- memcpy(r->entry, e, e->next_offset); +- r->counter_map.maptype = COUNTER_MAP_SET; +- +- if (!iptcc_map_target(*handle, r)) { +- DEBUGP("unable to map target of rule for chain `%s'\n", chain); +- free(r); +- return 0; +- } +- +- list_add_tail(&r->list, &c->rules); +- c->num_rules++; +- +- set_changed(*handle); +- +- return 1; +-} +- +-static inline int +-match_different(const STRUCT_ENTRY_MATCH *a, +- const unsigned char *a_elems, +- const unsigned char *b_elems, +- unsigned char **maskptr) +-{ +- const STRUCT_ENTRY_MATCH *b; +- unsigned int i; +- +- /* Offset of b is the same as a. */ +- b = (void *)b_elems + ((unsigned char *)a - a_elems); +- +- if (a->u.match_size != b->u.match_size) +- return 1; +- +- if (strcmp(a->u.user.name, b->u.user.name) != 0) +- return 1; +- +- *maskptr += ALIGN(sizeof(*a)); +- +- for (i = 0; i < a->u.match_size - ALIGN(sizeof(*a)); i++) +- if (((a->data[i] ^ b->data[i]) & (*maskptr)[i]) != 0) +- return 1; +- *maskptr += i; +- return 0; +-} +- +-static inline int +-target_same(struct rule_head *a, struct rule_head *b,const unsigned char *mask) +-{ +- unsigned int i; +- STRUCT_ENTRY_TARGET *ta, *tb; +- +- if (a->type != b->type) +- return 0; +- +- ta = GET_TARGET(a->entry); +- tb = GET_TARGET(b->entry); +- +- switch (a->type) { +- case IPTCC_R_FALLTHROUGH: +- return 1; +- case IPTCC_R_JUMP: +- return a->jump == b->jump; +- case IPTCC_R_STANDARD: +- return ((STRUCT_STANDARD_TARGET *)ta)->verdict +- == ((STRUCT_STANDARD_TARGET *)tb)->verdict; +- case IPTCC_R_MODULE: +- if (ta->u.target_size != tb->u.target_size) +- return 0; +- if (strcmp(ta->u.user.name, tb->u.user.name) != 0) +- return 0; +- +- for (i = 0; i < ta->u.target_size - sizeof(*ta); i++) +- if (((ta->data[i] ^ tb->data[i]) & mask[i]) != 0) +- return 0; +- return 1; +- default: +- fprintf(stderr, "ERROR: bad type %i\n", a->type); +- abort(); +- } +-} +- +-static unsigned char * +-is_same(const STRUCT_ENTRY *a, +- const STRUCT_ENTRY *b, +- unsigned char *matchmask); +- +-/* Delete the first rule in `chain' which matches `fw'. */ +-int +-TC_DELETE_ENTRY(const IPT_CHAINLABEL chain, +- const STRUCT_ENTRY *origfw, +- unsigned char *matchmask, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r, *i; +- +- iptc_fn = TC_DELETE_ENTRY; +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- /* Create a rule_head from origfw. */ +- r = iptcc_alloc_rule(c, origfw->next_offset); +- if (!r) { +- errno = ENOMEM; +- return 0; +- } +- +- memcpy(r->entry, origfw, origfw->next_offset); +- r->counter_map.maptype = COUNTER_MAP_NOMAP; +- if (!iptcc_map_target(*handle, r)) { +- DEBUGP("unable to map target of rule for chain `%s'\n", chain); +- free(r); +- return 0; +- } +- +- list_for_each_entry(i, &c->rules, list) { +- unsigned char *mask; +- +- mask = is_same(r->entry, i->entry, matchmask); +- if (!mask) +- continue; +- +- if (!target_same(r, i, mask)) +- continue; +- +- /* If we are about to delete the rule that is the +- * current iterator, move rule iterator back. next +- * pointer will then point to real next node */ +- if (i == (*handle)->rule_iterator_cur) { +- (*handle)->rule_iterator_cur = +- list_entry((*handle)->rule_iterator_cur->list.prev, +- struct rule_head, list); +- } +- +- c->num_rules--; +- iptcc_delete_rule(i); +- +- set_changed(*handle); +- free(r); +- return 1; +- } +- +- free(r); +- errno = ENOENT; +- return 0; +-} +- +- +-/* Delete the rule in position `rulenum' in `chain'. */ +-int +-TC_DELETE_NUM_ENTRY(const IPT_CHAINLABEL chain, +- unsigned int rulenum, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- +- iptc_fn = TC_DELETE_NUM_ENTRY; +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- if (rulenum >= c->num_rules) { +- errno = E2BIG; +- return 0; +- } +- +- /* Take advantage of the double linked list if possible. */ +- if (rulenum + 1 <= c->num_rules/2) { +- r = iptcc_get_rule_num(c, rulenum + 1); +- } else { +- r = iptcc_get_rule_num_reverse(c, c->num_rules - rulenum); +- } +- +- /* If we are about to delete the rule that is the current +- * iterator, move rule iterator back. next pointer will then +- * point to real next node */ +- if (r == (*handle)->rule_iterator_cur) { +- (*handle)->rule_iterator_cur = +- list_entry((*handle)->rule_iterator_cur->list.prev, +- struct rule_head, list); +- } +- +- c->num_rules--; +- iptcc_delete_rule(r); +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Check the packet `fw' on chain `chain'. Returns the verdict, or +- NULL and sets errno. */ +-const char * +-TC_CHECK_PACKET(const IPT_CHAINLABEL chain, +- STRUCT_ENTRY *entry, +- TC_HANDLE_T *handle) +-{ +- iptc_fn = TC_CHECK_PACKET; +- errno = ENOSYS; +- return NULL; +-} +- +-/* Flushes the entries in the given chain (ie. empties chain). */ +-int +-TC_FLUSH_ENTRIES(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r, *tmp; +- +- iptc_fn = TC_FLUSH_ENTRIES; +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- list_for_each_entry_safe(r, tmp, &c->rules, list) { +- iptcc_delete_rule(r); +- } +- +- c->num_rules = 0; +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Zeroes the counters in a chain. */ +-int +-TC_ZERO_ENTRIES(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- +- iptc_fn = TC_ZERO_ENTRIES; +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- list_for_each_entry(r, &c->rules, list) { +- if (r->counter_map.maptype == COUNTER_MAP_NORMAL_MAP) +- r->counter_map.maptype = COUNTER_MAP_ZEROED; +- } +- +- set_changed(*handle); +- +- return 1; +-} +- +-STRUCT_COUNTERS * +-TC_READ_COUNTER(const IPT_CHAINLABEL chain, +- unsigned int rulenum, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- +- iptc_fn = TC_READ_COUNTER; +- CHECK(*handle); +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return NULL; +- } +- +- if (!(r = iptcc_get_rule_num(c, rulenum))) { +- errno = E2BIG; +- return NULL; +- } +- +- return &r->entry[0].counters; +-} +- +-int +-TC_ZERO_COUNTER(const IPT_CHAINLABEL chain, +- unsigned int rulenum, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- +- iptc_fn = TC_ZERO_COUNTER; +- CHECK(*handle); +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- if (!(r = iptcc_get_rule_num(c, rulenum))) { +- errno = E2BIG; +- return 0; +- } +- +- if (r->counter_map.maptype == COUNTER_MAP_NORMAL_MAP) +- r->counter_map.maptype = COUNTER_MAP_ZEROED; +- +- set_changed(*handle); +- +- return 1; +-} +- +-int +-TC_SET_COUNTER(const IPT_CHAINLABEL chain, +- unsigned int rulenum, +- STRUCT_COUNTERS *counters, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- struct rule_head *r; +- STRUCT_ENTRY *e; +- +- iptc_fn = TC_SET_COUNTER; +- CHECK(*handle); +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- if (!(r = iptcc_get_rule_num(c, rulenum))) { +- errno = E2BIG; +- return 0; +- } +- +- e = r->entry; +- r->counter_map.maptype = COUNTER_MAP_SET; +- +- memcpy(&e->counters, counters, sizeof(STRUCT_COUNTERS)); +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Creates a new chain. */ +-/* To create a chain, create two rules: error node and unconditional +- * return. */ +-int +-TC_CREATE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle) +-{ +- static struct chain_head *c; +- +- iptc_fn = TC_CREATE_CHAIN; +- +- /* find_label doesn't cover built-in targets: DROP, ACCEPT, +- QUEUE, RETURN. */ +- if (iptcc_find_label(chain, *handle) +- || strcmp(chain, LABEL_DROP) == 0 +- || strcmp(chain, LABEL_ACCEPT) == 0 +- || strcmp(chain, LABEL_QUEUE) == 0 +- || strcmp(chain, LABEL_RETURN) == 0) { +- DEBUGP("Chain `%s' already exists\n", chain); +- errno = EEXIST; +- return 0; +- } +- +- if (strlen(chain)+1 > sizeof(IPT_CHAINLABEL)) { +- DEBUGP("Chain name `%s' too long\n", chain); +- errno = EINVAL; +- return 0; +- } +- +- c = iptcc_alloc_chain_head(chain, 0); +- if (!c) { +- DEBUGP("Cannot allocate memory for chain `%s'\n", chain); +- errno = ENOMEM; +- return 0; +- +- } +- +- DEBUGP("Creating chain `%s'\n", chain); +- list_add_tail(&c->list, &(*handle)->chains); +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Get the number of references to this chain. */ +-int +-TC_GET_REFERENCES(unsigned int *ref, const IPT_CHAINLABEL chain, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- +- iptc_fn = TC_GET_REFERENCES; +- if (!(c = iptcc_find_label(chain, *handle))) { +- errno = ENOENT; +- return 0; +- } +- +- *ref = c->references; +- +- return 1; +-} +- +-/* Deletes a chain. */ +-int +-TC_DELETE_CHAIN(const IPT_CHAINLABEL chain, TC_HANDLE_T *handle) +-{ +- unsigned int references; +- struct chain_head *c; +- +- iptc_fn = TC_DELETE_CHAIN; +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- DEBUGP("cannot find chain `%s'\n", chain); +- errno = ENOENT; +- return 0; +- } +- +- if (TC_BUILTIN(chain, *handle)) { +- DEBUGP("cannot remove builtin chain `%s'\n", chain); +- errno = EINVAL; +- return 0; +- } +- +- if (!TC_GET_REFERENCES(&references, chain, handle)) { +- DEBUGP("cannot get references on chain `%s'\n", chain); +- return 0; +- } +- +- if (references > 0) { +- DEBUGP("chain `%s' still has references\n", chain); +- errno = EMLINK; +- return 0; +- } +- +- if (c->num_rules) { +- DEBUGP("chain `%s' is not empty\n", chain); +- errno = ENOTEMPTY; +- return 0; +- } +- +- /* If we are about to delete the chain that is the current +- * iterator, move chain iterator firward. */ +- if (c == (*handle)->chain_iterator_cur) +- iptcc_chain_iterator_advance(*handle); +- +- list_del(&c->list); +- free(c); +- +- DEBUGP("chain `%s' deleted\n", chain); +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Renames a chain. */ +-int TC_RENAME_CHAIN(const IPT_CHAINLABEL oldname, +- const IPT_CHAINLABEL newname, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- iptc_fn = TC_RENAME_CHAIN; +- +- /* find_label doesn't cover built-in targets: DROP, ACCEPT, +- QUEUE, RETURN. */ +- if (iptcc_find_label(newname, *handle) +- || strcmp(newname, LABEL_DROP) == 0 +- || strcmp(newname, LABEL_ACCEPT) == 0 +- || strcmp(newname, LABEL_QUEUE) == 0 +- || strcmp(newname, LABEL_RETURN) == 0) { +- errno = EEXIST; +- return 0; +- } +- +- if (!(c = iptcc_find_label(oldname, *handle)) +- || TC_BUILTIN(oldname, *handle)) { +- errno = ENOENT; +- return 0; +- } +- +- if (strlen(newname)+1 > sizeof(IPT_CHAINLABEL)) { +- errno = EINVAL; +- return 0; +- } +- +- strncpy(c->name, newname, sizeof(IPT_CHAINLABEL)); +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Sets the policy on a built-in chain. */ +-int +-TC_SET_POLICY(const IPT_CHAINLABEL chain, +- const IPT_CHAINLABEL policy, +- STRUCT_COUNTERS *counters, +- TC_HANDLE_T *handle) +-{ +- struct chain_head *c; +- +- iptc_fn = TC_SET_POLICY; +- +- if (!(c = iptcc_find_label(chain, *handle))) { +- DEBUGP("cannot find chain `%s'\n", chain); +- errno = ENOENT; +- return 0; +- } +- +- if (!iptcc_is_builtin(c)) { +- DEBUGP("cannot set policy of userdefinedchain `%s'\n", chain); +- errno = ENOENT; +- return 0; +- } +- +- if (strcmp(policy, LABEL_ACCEPT) == 0) +- c->verdict = -NF_ACCEPT - 1; +- else if (strcmp(policy, LABEL_DROP) == 0) +- c->verdict = -NF_DROP - 1; +- else { +- errno = EINVAL; +- return 0; +- } +- +- if (counters) { +- /* set byte and packet counters */ +- memcpy(&c->counters, counters, sizeof(STRUCT_COUNTERS)); +- c->counter_map.maptype = COUNTER_MAP_SET; +- } else { +- c->counter_map.maptype = COUNTER_MAP_NOMAP; +- } +- +- set_changed(*handle); +- +- return 1; +-} +- +-/* Without this, on gcc 2.7.2.3, we get: +- libiptc.c: In function `TC_COMMIT': +- libiptc.c:833: fixed or forbidden register was spilled. +- This may be due to a compiler bug or to impossible asm +- statements or clauses. +-*/ +-static void +-subtract_counters(STRUCT_COUNTERS *answer, +- const STRUCT_COUNTERS *a, +- const STRUCT_COUNTERS *b) +-{ +- answer->pcnt = a->pcnt - b->pcnt; +- answer->bcnt = a->bcnt - b->bcnt; +-} +- +- +-static void counters_nomap(STRUCT_COUNTERS_INFO *newcounters, +- unsigned int index) +-{ +- newcounters->counters[index] = ((STRUCT_COUNTERS) { 0, 0}); +- DEBUGP_C("NOMAP => zero\n"); +-} +- +-static void counters_normal_map(STRUCT_COUNTERS_INFO *newcounters, +- STRUCT_REPLACE *repl, +- unsigned int index, +- unsigned int mappos) +-{ +- /* Original read: X. +- * Atomic read on replacement: X + Y. +- * Currently in kernel: Z. +- * Want in kernel: X + Y + Z. +- * => Add in X + Y +- * => Add in replacement read. +- */ +- newcounters->counters[index] = repl->counters[mappos]; +- DEBUGP_C("NORMAL_MAP => mappos %u \n", mappos); +-} +- +-static void counters_map_zeroed(STRUCT_COUNTERS_INFO *newcounters, +- STRUCT_REPLACE *repl, +- unsigned int index, +- unsigned int mappos, +- STRUCT_COUNTERS *counters) +-{ +- /* Original read: X. +- * Atomic read on replacement: X + Y. +- * Currently in kernel: Z. +- * Want in kernel: Y + Z. +- * => Add in Y. +- * => Add in (replacement read - original read). +- */ +- subtract_counters(&newcounters->counters[index], +- &repl->counters[mappos], +- counters); +- DEBUGP_C("ZEROED => mappos %u\n", mappos); +-} +- +-static void counters_map_set(STRUCT_COUNTERS_INFO *newcounters, +- unsigned int index, +- STRUCT_COUNTERS *counters) +-{ +- /* Want to set counter (iptables-restore) */ +- +- memcpy(&newcounters->counters[index], counters, +- sizeof(STRUCT_COUNTERS)); +- +- DEBUGP_C("SET\n"); +-} +- +- +-int +-TC_COMMIT(TC_HANDLE_T *handle) +-{ +- /* Replace, then map back the counters. */ +- STRUCT_REPLACE *repl; +- STRUCT_COUNTERS_INFO *newcounters; +- struct chain_head *c; +- int ret; +- size_t counterlen; +- int new_number; +- unsigned int new_size; +- +- iptc_fn = TC_COMMIT; +- CHECK(*handle); +- +- /* Don't commit if nothing changed. */ +- if (!(*handle)->changed) +- goto finished; +- +- new_number = iptcc_compile_table_prep(*handle, &new_size); +- if (new_number < 0) { +- errno = ENOMEM; +- return 0; +- } +- +- repl = malloc(sizeof(*repl) + new_size); +- if (!repl) { +- errno = ENOMEM; +- return 0; +- } +- memset(repl, 0, sizeof(*repl) + new_size); +- +-#if 0 +- TC_DUMP_ENTRIES(*handle); +-#endif +- +- counterlen = sizeof(STRUCT_COUNTERS_INFO) +- + sizeof(STRUCT_COUNTERS) * new_number; +- +- /* These are the old counters we will get from kernel */ +- repl->counters = malloc(sizeof(STRUCT_COUNTERS) +- * (*handle)->info.num_entries); +- if (!repl->counters) { +- free(repl); +- errno = ENOMEM; +- return 0; +- } +- /* These are the counters we're going to put back, later. */ +- newcounters = malloc(counterlen); +- if (!newcounters) { +- free(repl->counters); +- free(repl); +- errno = ENOMEM; +- return 0; +- } +- memset(newcounters, 0, counterlen); +- +- strcpy(repl->name, (*handle)->info.name); +- repl->num_entries = new_number; +- repl->size = new_size; +- +- repl->num_counters = (*handle)->info.num_entries; +- repl->valid_hooks = (*handle)->info.valid_hooks; +- +- DEBUGP("num_entries=%u, size=%u, num_counters=%u\n", +- repl->num_entries, repl->size, repl->num_counters); +- +- ret = iptcc_compile_table(*handle, repl); +- if (ret < 0) { +- errno = ret; +- free(repl->counters); +- free(repl); +- return 0; +- } +- +- +-#ifdef IPTC_DEBUG2 +- { +- int fd = open("/tmp/libiptc-so_set_replace.blob", +- O_CREAT|O_WRONLY); +- if (fd >= 0) { +- write(fd, repl, sizeof(*repl) + repl->size); +- close(fd); +- } +- } +-#endif +- +- if (setsockopt(sockfd, TC_IPPROTO, SO_SET_REPLACE, repl, +- sizeof(*repl) + repl->size) < 0) { +- free(repl->counters); +- free(repl); +- free(newcounters); +- return 0; +- } +- +- /* Put counters back. */ +- strcpy(newcounters->name, (*handle)->info.name); +- newcounters->num_counters = new_number; +- +- list_for_each_entry(c, &(*handle)->chains, list) { +- struct rule_head *r; +- +- /* Builtin chains have their own counters */ +- if (iptcc_is_builtin(c)) { +- DEBUGP("counter for chain-index %u: ", c->foot_index); +- switch(c->counter_map.maptype) { +- case COUNTER_MAP_NOMAP: +- counters_nomap(newcounters, c->foot_index); +- break; +- case COUNTER_MAP_NORMAL_MAP: +- counters_normal_map(newcounters, repl, +- c->foot_index, +- c->counter_map.mappos); +- break; +- case COUNTER_MAP_ZEROED: +- counters_map_zeroed(newcounters, repl, +- c->foot_index, +- c->counter_map.mappos, +- &c->counters); +- break; +- case COUNTER_MAP_SET: +- counters_map_set(newcounters, c->foot_index, +- &c->counters); +- break; +- } +- } +- +- list_for_each_entry(r, &c->rules, list) { +- DEBUGP("counter for index %u: ", r->index); +- switch (r->counter_map.maptype) { +- case COUNTER_MAP_NOMAP: +- counters_nomap(newcounters, r->index); +- break; +- +- case COUNTER_MAP_NORMAL_MAP: +- counters_normal_map(newcounters, repl, +- r->index, +- r->counter_map.mappos); +- break; +- +- case COUNTER_MAP_ZEROED: +- counters_map_zeroed(newcounters, repl, +- r->index, +- r->counter_map.mappos, +- &r->entry->counters); +- break; +- +- case COUNTER_MAP_SET: +- counters_map_set(newcounters, r->index, +- &r->entry->counters); +- break; +- } +- } +- } +- +- +-#ifdef KERNEL_64_USERSPACE_32 +- { +- /* Kernel will think that pointer should be 64-bits, and get +- padding. So we accomodate here (assumption: alignment of +- `counters' is on 64-bit boundary). */ +- u_int64_t *kernptr = (u_int64_t *)&newcounters->counters; +- if ((unsigned long)&newcounters->counters % 8 != 0) { +- fprintf(stderr, +- "counters alignment incorrect! Mail rusty!\n"); +- abort(); +- } +- *kernptr = newcounters->counters; +- } +-#endif /* KERNEL_64_USERSPACE_32 */ +- +-#ifdef IPTC_DEBUG2 +- { +- int fd = open("/tmp/libiptc-so_set_add_counters.blob", +- O_CREAT|O_WRONLY); +- if (fd >= 0) { +- write(fd, newcounters, counterlen); +- close(fd); +- } +- } +-#endif +- +- if (setsockopt(sockfd, TC_IPPROTO, SO_SET_ADD_COUNTERS, +- newcounters, counterlen) < 0) { +- free(repl->counters); +- free(repl); +- free(newcounters); +- return 0; +- } +- +- free(repl->counters); +- free(repl); +- free(newcounters); +- +- finished: +- TC_FREE(handle); +- return 1; +-} +- +-/* Get raw socket. */ +-int +-TC_GET_RAW_SOCKET() +-{ +- return sockfd; +-} +- +-/* Translates errno numbers into more human-readable form than strerror. */ +-const char * +-TC_STRERROR(int err) +-{ +- unsigned int i; +- struct table_struct { +- void *fn; +- int err; +- const char *message; +- } table [] = +- { { TC_INIT, EPERM, "Permission denied (you must be root)" }, +- { TC_INIT, EINVAL, "Module is wrong version" }, +- { TC_INIT, ENOENT, +- "Table does not exist (do you need to insmod?)" }, +- { TC_DELETE_CHAIN, ENOTEMPTY, "Chain is not empty" }, +- { TC_DELETE_CHAIN, EINVAL, "Can't delete built-in chain" }, +- { TC_DELETE_CHAIN, EMLINK, +- "Can't delete chain with references left" }, +- { TC_CREATE_CHAIN, EEXIST, "Chain already exists" }, +- { TC_INSERT_ENTRY, E2BIG, "Index of insertion too big" }, +- { TC_REPLACE_ENTRY, E2BIG, "Index of replacement too big" }, +- { TC_DELETE_NUM_ENTRY, E2BIG, "Index of deletion too big" }, +- { TC_READ_COUNTER, E2BIG, "Index of counter too big" }, +- { TC_ZERO_COUNTER, E2BIG, "Index of counter too big" }, +- { TC_INSERT_ENTRY, ELOOP, "Loop found in table" }, +- { TC_INSERT_ENTRY, EINVAL, "Target problem" }, +- /* EINVAL for CHECK probably means bad interface. */ +- { TC_CHECK_PACKET, EINVAL, +- "Bad arguments (does that interface exist?)" }, +- { TC_CHECK_PACKET, ENOSYS, +- "Checking will most likely never get implemented" }, +- /* ENOENT for DELETE probably means no matching rule */ +- { TC_DELETE_ENTRY, ENOENT, +- "Bad rule (does a matching rule exist in that chain?)" }, +- { TC_SET_POLICY, ENOENT, +- "Bad built-in chain name" }, +- { TC_SET_POLICY, EINVAL, +- "Bad policy name" }, +- +- { NULL, 0, "Incompatible with this kernel" }, +- { NULL, ENOPROTOOPT, "iptables who? (do you need to insmod?)" }, +- { NULL, ENOSYS, "Will be implemented real soon. I promise ;)" }, +- { NULL, ENOMEM, "Memory allocation problem" }, +- { NULL, ENOENT, "No chain/target/match by that name" }, +- }; +- +- for (i = 0; i < sizeof(table)/sizeof(struct table_struct); i++) { +- if ((!table[i].fn || table[i].fn == iptc_fn) +- && table[i].err == err) +- return table[i].message; +- } +- +- return strerror(err); +-} +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/0005-MINOR-Ignore-generated-files.patch b/net-firewall/iptables-snmp/files/0005-MINOR-Ignore-generated-files.patch new file mode 100644 index 00000000..6003b6fd --- /dev/null +++ b/net-firewall/iptables-snmp/files/0005-MINOR-Ignore-generated-files.patch @@ -0,0 +1,29 @@ +From c085e41a3b9fc3ef257fba4ec99927d38aece068 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:07:51 +0100 +Subject: [PATCH 5/9] MINOR: Ignore generated files + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + .gitignore | 9 +++++++++ + 1 file changed, 9 insertions(+) + create mode 100644 .gitignore + +diff --git .gitignore .gitignore +new file mode 100644 +index 0000000..ae11007 +--- /dev/null ++++ .gitignore +@@ -0,0 +1,9 @@ ++config.h ++config.log ++config.status ++configure ++ ++Makefile ++ ++iptables-snmp.o ++iptables-snmp.so +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/0006-MINOR-Strip-spaces.patch b/net-firewall/iptables-snmp/files/0006-MINOR-Strip-spaces.patch new file mode 100644 index 00000000..437e4f8f --- /dev/null +++ b/net-firewall/iptables-snmp/files/0006-MINOR-Strip-spaces.patch @@ -0,0 +1,906 @@ +From 768fec83dc722072215aaf55a680686a3b6ef387 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:09:34 +0100 +Subject: [PATCH 6/9] MINOR: Strip spaces + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + COPYING | 2 - + Makefile.in | 20 ++---- + README | 9 +-- + aclocal.m4 | 1 - + iptables-snmp.c | 195 ++++++++++++++++++++++-------------------------------- + iptables-snmp.h | 14 ++-- + mibs/IPTABLES.MIB | 5 +- + mibs/STAMFEST.MIB | 3 +- + mkinstalldirs | 0 + 9 files changed, 97 insertions(+), 152 deletions(-) + mode change 100755 => 100644 mkinstalldirs + +diff --git COPYING COPYING +index 589e208..1f00f14 100644 +--- COPYING ++++ COPYING +@@ -1,7 +1,6 @@ + NOTE: Some additional restrictions are placed on some files. See the + comments in the MIB files distributed. + +- + ------------------------------------------------------------------ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 +@@ -312,7 +311,6 @@ the "copyright" line and a pointer to where the full notice is found. + along with this program; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +- + Also add information on how to contact you by electronic and paper mail. + + If the program is interactive, make it output a short notice like this +diff --git Makefile.in Makefile.in +index 8b2e0a3..7744b82 100644 +--- Makefile.in ++++ Makefile.in +@@ -1,18 +1,15 @@ +-# +-# $Id$ +-# + # This file is part of iptables-snmp - using SNMP to read data from linux + # iptables +-# +-# iptables-snmp is copyrighted software: ++# ++# iptables-snmp is copyrighted software: + # (c) 2003 by Peter Stamfest <peter@stamfest.at> + # munged by Nigel Roberts <nigel@nobiscuit.com> +-# ++# + # iptables-snmp is free software; you can redistribute it and/or modify + # it under the terms of the GNU General Public License as published by + # the Free Software Foundation; either version 2 of the License, or + # (at your option) any later version. +-# ++# + # iptables-snmp is distributed in the hope that it will be useful, + # but WITHOUT ANY WARRANTY; without even the implied warranty of + # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +@@ -24,8 +21,8 @@ + # + # Note: See the file COPYING for the GNU General Public License and some + # extensions to it designed to protect the OID space of Peter Stamfest from +-# becoming polluted. +-# ++# becoming polluted. ++ + SHELL = /bin/sh + VPATH = @srcdir@ + +@@ -59,7 +56,7 @@ L_LDFLAGS = -lip4tc $(L_SNMP_FLAGS) + NETFILTER = \"$(IPTABLES)\" + + LIBIPTC_SRCS = libiptc/libip4tc.c \ +- libiptc/libip6tc.c ++ libiptc/libip6tc.c + LIBIPTC_OBJS = $(LIBIPTC_SRCS:.c=.o) + + DFLAGS = -fPIC +@@ -121,6 +118,3 @@ Makefile: Makefile.in config.status + ./config.status + config.status: configure + ./config.status --recheck +- +- +- +diff --git README README +index 11e6802..815ce54 100644 +--- README ++++ README +@@ -46,9 +46,9 @@ Make the software: + + $ make + +-Try it: ++Try it: + +-You will have to add a line like ++You will have to add a line like + + dlmod iptables /path/to/iptables-snmp.so + +@@ -77,8 +77,3 @@ IPTABLES-MIB::chainIndex.1.0 = INTEGER: 0 + IPTABLES-MIB::chainIndex.1.1 = INTEGER: 1 + IPTABLES-MIB::chainIndex.1.2 = INTEGER: 2 + [truncated] +- +- +- +- +- +diff --git aclocal.m4 aclocal.m4 +index 334fb95..9161320 100644 +--- aclocal.m4 ++++ aclocal.m4 +@@ -830,4 +830,3 @@ fi + test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) + AC_LIB_PROG_LD_GNU + ]) +- +diff --git iptables-snmp.c iptables-snmp.c +index f1dd72c..34f3367 100644 +--- iptables-snmp.c ++++ iptables-snmp.c +@@ -1,18 +1,18 @@ +-/* ++/* + * $Id$ +- * ++ * + * This file is part of iptables-snmp - using SNMP to read data from linux + * iptables +- * +- * iptables-snmp is copyrighted software: ++ * ++ * iptables-snmp is copyrighted software: + * (c) 2003 by Peter Stamfest <peter@stamfest.at> + * (c) 2005 by Nigel Roberts <nigel@nobiscuit.com> +- * ++ * + * iptables-snmp is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. +- * ++ * + * iptables-snmp is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +@@ -24,7 +24,7 @@ + * + * Note: See the file COPYING for the GNU General Public License and some + * extensions to it designed to protect the OID space of Peter Stamfest from +- * becoming polluted. ++ * becoming polluted. + */ + + #include <errno.h> +@@ -73,7 +73,6 @@ typedef struct _iptables_data { + static iptables_data ipt = { 0, NULL }; + /* static iptables_data ipt = { 0, xx, tt }; */ + +- + static void free_data(iptables_data *data) { + if (!data) return; + if (data->tables) { +@@ -81,7 +80,7 @@ static void free_data(iptables_data *data) { + + for (i = 0 ; data->tables[i] ; i++) { + free(data->tables[i]); +- ++ + if (data->t[i] != NULL) { + iptc_free(data->t[i]); + } +@@ -94,7 +93,6 @@ static void free_data(iptables_data *data) { + data->loaded = 0; /* just to make sure */ + } + +- + static iptables_data *get_data() { + time_t now = time(NULL); + FILE *fp; +@@ -114,21 +112,20 @@ static iptables_data *get_data() { + free_data(&ipt); + + fp = fopen(PROCFILE, "r"); +- ++ + if (fp == NULL) { + /** error - bail out */ + snmp_log(LOG_ERR, +- "Cannot open iptables table file %s: %s", ++ "Cannot open iptables table file %s: %s", + PROCFILE, strerror(errno)); + return NULL; + } + +- + while (fgets(line, sizeof(line), fp)) { + int n = strlen(line); + if (n == 0) continue; + if (line[n-1] == '\n') line[n-1] = 0; +- ++ + if (num >= N - 2) { + N += 10; + ipt.tables = realloc(ipt.tables, N * sizeof(char*)); +@@ -161,15 +158,13 @@ static iptables_data *get_data() { + return NULL; + } + } +- ++ + done: + fclose(fp); + + return &ipt; + } + +- +- + /* static void get_tables() { */ + + /* } */ +@@ -179,8 +174,6 @@ struct tables_iter { + iptables_data *ctx; + }; + +- +- + static netsnmp_variable_list * + store_names(void **my_loop_context, void **my_data_context, + netsnmp_variable_list * put_index_data, +@@ -191,23 +184,21 @@ store_names(void **my_loop_context, void **my_data_context, + /* char **tables = (char**) *my_data_context; */ + netsnmp_variable_list *vars; + +- +- if (data == NULL || +- data->tables == NULL || ++ if (data == NULL || ++ data->tables == NULL || + data->tables[ti->i] == NULL) return NULL; + + /* printf("store %d\n", ti->i); */ +- ++ + vars = put_index_data; + snmp_set_var_typed_value(vars, ASN_INTEGER, + (void*)&(ti->i), sizeof(ti->i)); + + *my_data_context = data; +- ++ + return vars; + } + +- + /** returns the first data point within the table data. + + Set the my_loop_context variable to the first data point structure +@@ -259,7 +250,7 @@ get_next_names(void **my_loop_context, + void **my_data_context, + netsnmp_variable_list *put_index_data, + netsnmp_iterator_info *iinfo) +-{ ++{ + struct tables_iter *ti = *my_loop_context; + + if (!my_loop_context || !*my_loop_context) +@@ -270,15 +261,13 @@ get_next_names(void **my_loop_context, + put_index_data, iinfo); + } + +- +-static void free_loop_context_at_end(void *my_loop_context, ++static void free_loop_context_at_end(void *my_loop_context, + netsnmp_iterator_info *iinfo) + { + if (my_loop_context) free(my_loop_context); + /* printf("free_loop_context_at_end\n"); */ + } + +- + static int + iptables_names_handler(netsnmp_mib_handler *handler, + netsnmp_handler_registration *reginfo, +@@ -290,7 +279,6 @@ iptables_names_handler(netsnmp_mib_handler *handler, + int index = 0; + iptables_data *ctx; + +- + for (request = requests; request; request = request->next) { + netsnmp_variable_list *var = request->requestvb; + table_info = netsnmp_extract_table_info(request); +@@ -300,7 +288,7 @@ iptables_names_handler(netsnmp_mib_handler *handler, + + switch (reqinfo->mode) { + case MODE_GET: +- ctx = (iptables_data *) netsnmp_extract_iterator_context(request); ++ ctx = (iptables_data *) netsnmp_extract_iterator_context(request); + index = var->name[var->name_length - 1]; + + switch (table_info->colnum) { +@@ -311,7 +299,7 @@ iptables_names_handler(netsnmp_mib_handler *handler, + } + case 2: { + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *)ctx->tables[index], ++ (unsigned char *)ctx->tables[index], + strlen(ctx->tables[index])); + break; + } +@@ -326,7 +314,7 @@ iptables_names_handler(netsnmp_mib_handler *handler, + default: + /* + * We should never get here, getnext already have been +- * handled by the table_iterator and we're read_only ++ * handled by the table_iterator and we're read_only + */ + snmp_log(LOG_ERR, + "table accessed as mode=%d. We're improperly registered!", +@@ -340,12 +328,6 @@ iptables_names_handler(netsnmp_mib_handler *handler, + + /* chains table */ + +- +- +- +- +- +- + typedef struct _chains_iter { + int table; + int chain; +@@ -364,7 +346,7 @@ store_chains(void **my_loop_context, + netsnmp_variable_list *put_index_data, + netsnmp_iterator_info *iinfo, + int incr) +-{ ++{ + chains_iter *c = (chains_iter *) *my_loop_context; + netsnmp_variable_list *var = put_index_data; + +@@ -378,7 +360,7 @@ store_chains(void **my_loop_context, + /* next table */ + c->table++; + if (c->ctx->tables[c->table] == NULL) return NULL; +- ++ + c->chainname = iptc_first_chain(c->ctx->t[c->table]); + c->chain = 0; + } else { +@@ -397,7 +379,6 @@ store_chains(void **my_loop_context, + snmp_set_var_typed_value(var, ASN_INTEGER, + (void*)&(c->chain), sizeof(c->table)); + +- + return put_index_data; + } + +@@ -449,18 +430,18 @@ chains_get_next_names(void **my_loop_context, + void **my_data_context, + netsnmp_variable_list *put_index_data, + netsnmp_iterator_info *iinfo) +-{ ++{ + return store_chains(my_loop_context, my_data_context, + put_index_data, iinfo, 1); + } + +-static void chains_free_loop_context_at_end(void *my_loop_context, ++static void chains_free_loop_context_at_end(void *my_loop_context, + netsnmp_iterator_info *iinfo) + { + if (my_loop_context) free(my_loop_context); + } + +-static void chains_free_data_context(void *my_data_context, ++static void chains_free_data_context(void *my_data_context, + netsnmp_iterator_info *iinfo) + { + if (my_data_context) free(my_data_context); +@@ -491,18 +472,17 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + + data = (chains_data *) netsnmp_extract_iterator_context(request); + +- if (data == NULL) ++ if (data == NULL) + continue; + + ctx = data->ctx; + + chain = var->name[var->name_length - 1]; + table = var->name[var->name_length - 2]; +- ++ + /* sprintf(buf, "%d_%d_%d", table, chain, rule); */ + /* snmp_set_var_typed_value(var, ASN_OCTET_STR, buf, strlen(buf)); */ + +- + switch (reqinfo->mode) { + case MODE_GET: + switch (table_info->colnum) { +@@ -519,10 +499,10 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + } + */ + case C_CHAIN_NAME: +- case C_CHAIN_POLICY: +- case C_CHAIN_OCTETS: ++ case C_CHAIN_POLICY: ++ case C_CHAIN_OCTETS: + case C_CHAIN_PACKETS: { /* bad style follows ... */ +- ++ + const char *cn; + int i; + for (cn = iptc_first_chain(ctx->t[table]), i=0 ; cn ; +@@ -530,16 +510,16 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + if (i == chain) { + if (table_info->colnum == C_CHAIN_NAME) { + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *) cn, ++ (unsigned char *) cn, + strlen(cn)); + } else { + struct counter64 c64; + struct ipt_counters cnt; + unsigned int isbuiltin = 1; +- +- char *pol = ++ ++ char *pol = + (char *)iptc_get_policy(cn, &cnt, ctx->t[table]); +- ++ + if (!pol) { + isbuiltin = 0; + } +@@ -550,7 +530,7 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + pol = "none"; + } + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *) pol, ++ (unsigned char *) pol, + strlen(pol)); + break; + case C_CHAIN_OCTETS: +@@ -559,9 +539,9 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + } + c64.low = 0xffffffff & cnt.bcnt; + c64.high = 0xffffffff & (cnt.bcnt >> 32); +- snmp_set_var_typed_value(var, ASN_COUNTER64, +- (void*) &(c64), +- sizeof(c64)); ++ snmp_set_var_typed_value(var, ASN_COUNTER64, ++ (void*) &(c64), ++ sizeof(c64)); + break; + case C_CHAIN_PACKETS: + if (!isbuiltin) { +@@ -580,10 +560,10 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + } + break; + } +- case C_TABLE_NAME: ++ case C_TABLE_NAME: + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *) ctx->tables[table], +- strlen(ctx->tables[table])); ++ (unsigned char *) ctx->tables[table], ++ strlen(ctx->tables[table])); + break; + default: + /* We shouldn't get here */ +@@ -596,7 +576,7 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + default: + /* + * We should never get here, getnext already have been +- * handled by the table_iterator and we're read_only ++ * handled by the table_iterator and we're read_only + */ + snmp_log(LOG_ERR, + "table accessed as mode=%d. We're improperly registered!", +@@ -634,7 +614,7 @@ store_rules(void **my_loop_context, + netsnmp_variable_list *put_index_data, + netsnmp_iterator_info *iinfo, + int incr) +-{ ++{ + rules_iter *c = (rules_iter *) *my_loop_context; + netsnmp_variable_list *var = put_index_data; + +@@ -735,7 +715,7 @@ rules_get_next_names(void **my_loop_context, + void **my_data_context, + netsnmp_variable_list *put_index_data, + netsnmp_iterator_info *iinfo) +-{ ++{ + /* rules_iter *c = (rules_iter *) *my_loop_context; */ + + /* c->chain++; */ +@@ -749,20 +729,19 @@ rules_get_next_names(void **my_loop_context, + put_index_data, iinfo, 1); + } + +-static void rules_free_loop_context_at_end(void *my_loop_context, ++static void rules_free_loop_context_at_end(void *my_loop_context, + netsnmp_iterator_info *iinfo) + { + if (my_loop_context) free(my_loop_context); + } + +-static void rules_free_data_context(void *my_data_context, ++static void rules_free_data_context(void *my_data_context, + netsnmp_iterator_info *iinfo) + { + if (my_data_context) free(my_data_context); + /* printf("free data_context %08lx\n", (long) my_data_context); */ + } + +- + static int short_ip(const char *prefix, + u_int32_t ip, u_int32_t mask, + int inv, +@@ -771,7 +750,6 @@ static int short_ip(const char *prefix, + int n = sz; + int i; + +- + if (!ip && !mask) { + return 0; + } +@@ -780,7 +758,7 @@ static int short_ip(const char *prefix, + n -= i; + if (n <= 0) return sz; + buf += i; +- ++ + inet_ntop(AF_INET, &ip, buf, n); + i = strlen(buf); + n -= i; +@@ -793,7 +771,7 @@ static int short_ip(const char *prefix, + mask = ~mask; + while (mask & 1) { + b--; +- mask /= 2; ++ mask /= 2; + } + + i = snprintf(buf, n, "/%d", b); +@@ -801,7 +779,7 @@ static int short_ip(const char *prefix, + if (n <= 0) return sz; + buf += i; + } +- ++ + return sz - n; + } + +@@ -827,21 +805,20 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + + if (request->processed != 0) + continue; +- ++ + data = (rules_data *) netsnmp_extract_iterator_context(request); +- ++ + if (data == NULL || data->ctx == NULL) continue; +- ++ + ctx = data->ctx; + + rule = var->name[var->name_length - 1]; + chain = var->name[var->name_length - 2]; + table = var->name[var->name_length - 3]; +- ++ + /* sprintf(buf, "%d_%d_%d\n", table, chain, rule); */ + /* snmp_set_var_typed_value(var, ASN_OCTET_STR, buf, strlen(buf)); */ + +- + switch (reqinfo->mode) { + case MODE_GET: + switch (table_info->colnum) { +@@ -869,7 +846,7 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + cn = iptc_next_chain(ctx->t[table]), i++) { + if (i == chain) { + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *) cn, ++ (unsigned char *) cn, + strlen(cn)); + break; + } +@@ -878,11 +855,11 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + } + case R_TABLE_NAME_INDEX: { + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *) ctx->tables[table], ++ (unsigned char *) ctx->tables[table], + strlen(ctx->tables[table])); + break; + } +- case R_OCTETS_INDEX: ++ case R_OCTETS_INDEX: + case R_PACKETS_INDEX: { + const char *cn; + int i; +@@ -891,18 +868,17 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + cn = iptc_next_chain(ctx->t[table]), i++) { + /* printf("%d %d\n", i, chain); */ + if (i == chain) { +- struct ipt_counters *cnt = ++ struct ipt_counters *cnt = + iptc_read_counter(cn, rule+1, ctx->t[table]); + struct counter64 c64; + +- + /* snmp_set_var_typed_value(var, ASN_INTEGER64, */ + /* (void*) &(cnt->bcnt), */ + /* sizeof(cnt->bcnt)); */ + + /* cnt->bcnt is a u_int64_t variable, but + ASN_COUNTER64 awaits a struct counter64: */ +- ++ + if (table_info->colnum == R_OCTETS_INDEX) { + c64.low = 0xffffffff & cnt->bcnt; + c64.high = 0xffffffff & (cnt->bcnt >> 32); +@@ -929,12 +905,11 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + + if (data->e->ip.proto) { + i = snprintf(buf + sizeof(buf) - n, n, +- ";p=%s%d", ++ ";p=%s%d", + data->e->ip.invflags & IPT_INV_PROTO ? "!":"", + data->e->ip.proto); + n -= i; +- } +- ++ } + + i = short_ip("s", e->ip.src.s_addr, e->ip.smsk.s_addr, + e->ip.invflags & IPT_INV_SRCIP, +@@ -946,40 +921,37 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + buf + sizeof(buf) - n, n); + n -= i; + +- /* Print target name */ ++ /* Print target name */ + target_name = iptc_get_target(e, ctx->t[table]); + + if (target_name && *target_name) { + i = snprintf(buf + sizeof(buf) - n, n, +- ";j=%s", target_name); ++ ";j=%s", target_name); + n -= i; + } + +- +- +- + snmp_set_var_typed_value(var, ASN_OCTET_STR, + (unsigned char *) buf, strlen(buf)); + break; + } + case R_SRC_IPADDR_INDEX: + snmp_set_var_typed_value(var, ASN_IPADDRESS, +- (void*) &(data->e->ip.src.s_addr), ++ (void*) &(data->e->ip.src.s_addr), + sizeof(data->e->ip.src.s_addr)); + break; + case R_SRC_MASK_INDEX: + snmp_set_var_typed_value(var, ASN_IPADDRESS, +- (void*) &(data->e->ip.smsk.s_addr), ++ (void*) &(data->e->ip.smsk.s_addr), + sizeof(data->e->ip.smsk.s_addr)); + break; + case R_DST_IPADDR_INDEX: + snmp_set_var_typed_value(var, ASN_IPADDRESS, +- (void*) &(data->e->ip.dst.s_addr), ++ (void*) &(data->e->ip.dst.s_addr), + sizeof(data->e->ip.dst.s_addr)); + break; + case R_DST_MASK_INDEX: + snmp_set_var_typed_value(var, ASN_IPADDRESS, +- (void*) &(data->e->ip.dmsk.s_addr), ++ (void*) &(data->e->ip.dmsk.s_addr), + sizeof(data->e->ip.dmsk.s_addr)); + break; + default: +@@ -993,7 +965,7 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + default: + /* + * We should never get here, getnext already have been +- * handled by the table_iterator and we're read_only ++ * handled by the table_iterator and we're read_only + */ + snmp_log(LOG_ERR, + "table accessed as mode=%d. We're improperly registered!", +@@ -1008,14 +980,6 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + return SNMP_ERR_NOERROR; + } + +- +- +- +- +- +- +- +- + static int + info_handler(netsnmp_mib_handler *handler, + netsnmp_handler_registration *reginfo, +@@ -1036,12 +1000,12 @@ info_handler(netsnmp_mib_handler *handler, + switch (index) { + case AGENT_VERSION_INDEX: + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *) AGENT_VERSION, ++ (unsigned char *) AGENT_VERSION, + strlen(AGENT_VERSION)); + break; + case IPTABLES_VERSION_INDEX: + snmp_set_var_typed_value(var, ASN_OCTET_STR, +- (unsigned char *) IPTABLES_VERSION, ++ (unsigned char *) IPTABLES_VERSION, + strlen(IPTABLES_VERSION)); + break; + } +@@ -1049,7 +1013,7 @@ info_handler(netsnmp_mib_handler *handler, + default: + /* + * We should never get here, getnext already have been +- * handled by the table_iterator and we're read_only ++ * handled by the table_iterator and we're read_only + */ + snmp_log(LOG_ERR, + "variable accessed as mode=%d. We're improperly registered!", +@@ -1065,13 +1029,13 @@ void + init_iptables(void) + { + /* +- * here we initialize all the tables we're planning on supporting ++ * here we initialize all the tables we're planning on supporting + */ + netsnmp_handler_registration *my_handler; + netsnmp_table_registration_info *table_info; + netsnmp_iterator_info *iinfo; + +- my_handler = ++ my_handler = + netsnmp_create_handler_registration("agent_version", + info_handler, + agent_version_oid, +@@ -1083,7 +1047,7 @@ init_iptables(void) + + netsnmp_register_read_only_instance(my_handler); + +- my_handler = ++ my_handler = + netsnmp_create_handler_registration("agent_version", + info_handler, + iptables_version_oid, +@@ -1095,9 +1059,6 @@ init_iptables(void) + + netsnmp_register_read_only_instance(my_handler); + +- +- +- + /** */ + + my_handler = netsnmp_create_handler_registration("iptables_names", +@@ -1132,13 +1093,13 @@ init_iptables(void) + + /** chains table */ + +- my_handler = ++ my_handler = + netsnmp_create_handler_registration("iptables_chains", + iptables_chains_handler, + iptables_chains_oid, + OID_LENGTH(iptables_chains_oid), + HANDLER_CAN_RONLY); +- ++ + if (!my_handler) + return; + +@@ -1167,13 +1128,13 @@ init_iptables(void) + + /** rules table */ + +- my_handler = ++ my_handler = + netsnmp_create_handler_registration("iptables_rules", + iptables_rules_handler, + iptables_rules_oid, + sizeof(iptables_rules_oid) / sizeof(oid), + HANDLER_CAN_RONLY); +- ++ + if (!my_handler) + return; + +diff --git iptables-snmp.h iptables-snmp.h +index 4746ff2..f2f407a 100644 +--- iptables-snmp.h ++++ iptables-snmp.h +@@ -1,17 +1,17 @@ +-/* ++/* + * $Id$ +- * ++ * + * This file is part of iptables-snmp - using SNMP to read data from linux + * iptables +- * +- * iptables-snmp is copyrighted software: ++ * ++ * iptables-snmp is copyrighted software: + * (c) 2003 by Peter Stamfest <peter@stamfest.at> +- * ++ * + * iptables-snmp is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. +- * ++ * + * iptables-snmp is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +@@ -23,7 +23,7 @@ + * + * Note: See the file COPYING for the GNU General Public License and some + * extensions to it designed to protect the OID space of Peter Stamfest from +- * becoming polluted. ++ * becoming polluted. + */ + #ifndef IPTABLES_SNMP_H_INCLUDED + #define IPTABLES_SNMP_H_INCLUDED +diff --git mibs/IPTABLES.MIB mibs/IPTABLES.MIB +index faaabd9..c322145 100644 +--- mibs/IPTABLES.MIB ++++ mibs/IPTABLES.MIB +@@ -5,7 +5,7 @@ IPTABLES-MIB DEFINITIONS ::= BEGIN + -- An experimental MIB to describe Linux iptables (tables, chains, rules) + -- This is work in progress. Use with caution. + -- +--- This is copyrighted software: ++-- This is copyrighted software: + -- (c) 2003 by Peter Stamfest <peter@stamfest.at> + -- + -- This MIB is provided AS-IS. It is distributed in the hope that it +@@ -76,7 +76,7 @@ iptablesVersion OBJECT-TYPE + MAX-ACCESS read-only + STATUS current + DESCRIPTION +- "The version of the iptables software the handling SNMP agent ++ "The version of the iptables software the handling SNMP agent + is based on." + ::= { iptablesInformation 2 } + +@@ -127,7 +127,6 @@ tableName OBJECT-TYPE + "The name of the corresponding iptables table" + ::= { iptableNamesEntry 2 } + +- + ---------------------------------------------------------------------- + -- + -- An SNMP table to list the rules of linux iptables chains +diff --git mibs/STAMFEST.MIB mibs/STAMFEST.MIB +index 05182c5..b2126a4 100644 +--- mibs/STAMFEST.MIB ++++ mibs/STAMFEST.MIB +@@ -32,7 +32,7 @@ IMPORTS + -- enterprises FROM SNMPv2-SMI; + -- Modified by AG + enterprises, MODULE-IDENTITY FROM SNMPv2-SMI; +- ++ + stamfestTOP MODULE-IDENTITY + -- LAST-UPDATED "200303131352Z" + LAST-UPDATED "201202231311Z" +@@ -61,4 +61,3 @@ stamfestTOP MODULE-IDENTITY + stamfestMIB OBJECT IDENTIFIER ::= { stamfestTOP 6 } + + END +- +diff --git mkinstalldirs mkinstalldirs +old mode 100755 +new mode 100644 +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/0007-MINOR-Remove-dead-code.patch b/net-firewall/iptables-snmp/files/0007-MINOR-Remove-dead-code.patch new file mode 100644 index 00000000..f7d43b71 --- /dev/null +++ b/net-firewall/iptables-snmp/files/0007-MINOR-Remove-dead-code.patch @@ -0,0 +1,214 @@ +From 896af1625ab90775e3aa235dcafc1a32ed9a5009 Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:54:24 +0100 +Subject: [PATCH 7/9] MINOR: Remove dead code + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + iptables-snmp.c | 79 --------------------------------------------------------- + 1 file changed, 79 deletions(-) + +diff --git iptables-snmp.c iptables-snmp.c +index 34f3367..a34d42f 100644 +--- iptables-snmp.c ++++ iptables-snmp.c +@@ -67,11 +67,7 @@ typedef struct _iptables_data { + iptc_handle_t *t; + } iptables_data; + +-/* char *xx[2] = { "filter", NULL } ; */ +-/* iptc_handle_t tt[2] = { NULL, NULL }; */ +- + static iptables_data ipt = { 0, NULL }; +-/* static iptables_data ipt = { 0, xx, tt }; */ + + static void free_data(iptables_data *data) { + if (!data) return; +@@ -101,11 +97,6 @@ static iptables_data *get_data() { + char **c; + iptc_handle_t *t; + +-/* if (tt[0]) free(tt[0]); */ +-/* tt[0] = iptc_init(xx[0]); */ +- +-/* return &ipt; */ +- + if (now - ipt.loaded < MAXTIME && ipt.tables) { + return &ipt; + } +@@ -165,10 +156,6 @@ static iptables_data *get_data() { + return &ipt; + } + +-/* static void get_tables() { */ +- +-/* } */ +- + struct tables_iter { + int i; + iptables_data *ctx; +@@ -181,15 +168,12 @@ store_names(void **my_loop_context, void **my_data_context, + { + struct tables_iter *ti = (struct tables_iter *) *my_loop_context; + iptables_data *data = (iptables_data *) ti->ctx; +-/* char **tables = (char**) *my_data_context; */ + netsnmp_variable_list *vars; + + if (data == NULL || + data->tables == NULL || + data->tables[ti->i] == NULL) return NULL; + +-/* printf("store %d\n", ti->i); */ +- + vars = put_index_data; + snmp_set_var_typed_value(vars, ASN_INTEGER, + (void*)&(ti->i), sizeof(ti->i)); +@@ -265,7 +249,6 @@ static void free_loop_context_at_end(void *my_loop_context, + netsnmp_iterator_info *iinfo) + { + if (my_loop_context) free(my_loop_context); +-/* printf("free_loop_context_at_end\n"); */ + } + + static int +@@ -455,11 +438,8 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + { + netsnmp_table_request_info *table_info; + netsnmp_request_info *request; +-/* char **ctx; */ +-/* int index; */ + + int table, chain; +-/* char buf[50]; */ + iptables_data *ctx; + chains_data *data; + +@@ -480,24 +460,9 @@ iptables_chains_handler(netsnmp_mib_handler *handler, + chain = var->name[var->name_length - 1]; + table = var->name[var->name_length - 2]; + +-/* sprintf(buf, "%d_%d_%d", table, chain, rule); */ +-/* snmp_set_var_typed_value(var, ASN_OCTET_STR, buf, strlen(buf)); */ +- + switch (reqinfo->mode) { + case MODE_GET: + switch (table_info->colnum) { +-/* +- case C_CHAIN_INDEX: { +- snmp_set_var_typed_value(var, ASN_INTEGER, +- (void*) &chain, sizeof(chain)); +- break; +- } +- case C_TABLE_INDEX: { +- snmp_set_var_typed_value(var, ASN_INTEGER, +- (void*) &table, sizeof(table)); +- break; +- } +-*/ + case C_CHAIN_NAME: + case C_CHAIN_POLICY: + case C_CHAIN_OCTETS: +@@ -716,15 +681,6 @@ rules_get_next_names(void **my_loop_context, + netsnmp_variable_list *put_index_data, + netsnmp_iterator_info *iinfo) + { +-/* rules_iter *c = (rules_iter *) *my_loop_context; */ +- +-/* c->chain++; */ +-/* if (c->chain >= 2 * c->table) { */ +-/* c->table++; */ +-/* c->chain = 1; */ +-/* } */ +-/* if (c->table == 4) return NULL; */ +- + return store_rules(my_loop_context, my_data_context, + put_index_data, iinfo, 1); + } +@@ -739,7 +695,6 @@ static void rules_free_data_context(void *my_data_context, + netsnmp_iterator_info *iinfo) + { + if (my_data_context) free(my_data_context); +-/* printf("free data_context %08lx\n", (long) my_data_context); */ + } + + static int short_ip(const char *prefix, +@@ -791,11 +746,8 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + { + netsnmp_table_request_info *table_info; + netsnmp_request_info *request; +-/* char **ctx; */ +-/* int index; */ + + int table, chain, rule; +-/* char buf[50]; */ + iptables_data *ctx; + rules_data *data; + +@@ -816,29 +768,9 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + chain = var->name[var->name_length - 2]; + table = var->name[var->name_length - 3]; + +-/* sprintf(buf, "%d_%d_%d\n", table, chain, rule); */ +-/* snmp_set_var_typed_value(var, ASN_OCTET_STR, buf, strlen(buf)); */ +- + switch (reqinfo->mode) { + case MODE_GET: + switch (table_info->colnum) { +-/* +- case R_RULE_INDEX: { +- snmp_set_var_typed_value(var, ASN_INTEGER, +- (void*) &rule, sizeof(rule)); +- break; +- } +- case R_CHAIN_INDEX: { +- snmp_set_var_typed_value(var, ASN_INTEGER, +- (void*) &chain, sizeof(chain)); +- break; +- } +- case R_TABLE_INDEX: { +- snmp_set_var_typed_value(var, ASN_INTEGER, +- (void*) &table, sizeof(table)); +- break; +- } +-*/ + case R_CHAIN_NAME_INDEX: { + const char *cn; + int i; +@@ -866,19 +798,11 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + + for (cn = iptc_first_chain(ctx->t[table]), i=0 ; cn ; + cn = iptc_next_chain(ctx->t[table]), i++) { +-/* printf("%d %d\n", i, chain); */ + if (i == chain) { + struct ipt_counters *cnt = + iptc_read_counter(cn, rule+1, ctx->t[table]); + struct counter64 c64; + +-/* snmp_set_var_typed_value(var, ASN_INTEGER64, */ +-/* (void*) &(cnt->bcnt), */ +-/* sizeof(cnt->bcnt)); */ +- +- /* cnt->bcnt is a u_int64_t variable, but +- ASN_COUNTER64 awaits a struct counter64: */ +- + if (table_info->colnum == R_OCTETS_INDEX) { + c64.low = 0xffffffff & cnt->bcnt; + c64.high = 0xffffffff & (cnt->bcnt >> 32); +@@ -1059,8 +983,6 @@ init_iptables(void) + + netsnmp_register_read_only_instance(my_handler); + +- /** */ +- + my_handler = netsnmp_create_handler_registration("iptables_names", + iptables_names_handler, + iptables_names_oid, +@@ -1161,5 +1083,4 @@ init_iptables(void) + + iinfo->table_reginfo = table_info; + netsnmp_register_table_iterator(my_handler, iinfo); +- + } +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/0008-MINOR-Remove-unused-parameters.patch b/net-firewall/iptables-snmp/files/0008-MINOR-Remove-unused-parameters.patch new file mode 100644 index 00000000..e5f94dc1 --- /dev/null +++ b/net-firewall/iptables-snmp/files/0008-MINOR-Remove-unused-parameters.patch @@ -0,0 +1,284 @@ +From 8e9e8beae873aab658ec0f64e2065d4dbfb9f0fd Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:55:12 +0100 +Subject: [PATCH 8/9] MINOR: Remove unused parameters + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + iptables-snmp.c | 82 ++++++++++++++++++++++++++------------------------------- + iptables-snmp.h | 10 +++++++ + 2 files changed, 47 insertions(+), 45 deletions(-) + +diff --git iptables-snmp.c iptables-snmp.c +index a34d42f..918d4c8 100644 +--- iptables-snmp.c ++++ iptables-snmp.c +@@ -67,7 +67,7 @@ typedef struct _iptables_data { + iptc_handle_t *t; + } iptables_data; + +-static iptables_data ipt = { 0, NULL }; ++static iptables_data ipt = { 0, NULL, NULL }; + + static void free_data(iptables_data *data) { + if (!data) return; +@@ -163,8 +163,7 @@ struct tables_iter { + + static netsnmp_variable_list * + store_names(void **my_loop_context, void **my_data_context, +- netsnmp_variable_list * put_index_data, +- netsnmp_iterator_info *iinfo) ++ netsnmp_variable_list * put_index_data) + { + struct tables_iter *ti = (struct tables_iter *) *my_loop_context; + iptables_data *data = (iptables_data *) ti->ctx; +@@ -204,7 +203,7 @@ store_names(void **my_loop_context, void **my_data_context, + static netsnmp_variable_list * + get_first_names(void **my_loop_context, void **my_data_context, + netsnmp_variable_list * put_index_data, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + struct tables_iter *ti; + +@@ -219,7 +218,7 @@ get_first_names(void **my_loop_context, void **my_data_context, + *my_loop_context = ti; + + return store_names(my_loop_context, my_data_context, +- put_index_data, iinfo); ++ put_index_data); + } + + /** functionally the same as get_first_data_point, but +@@ -233,7 +232,7 @@ static netsnmp_variable_list * + get_next_names(void **my_loop_context, + void **my_data_context, + netsnmp_variable_list *put_index_data, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + struct tables_iter *ti = *my_loop_context; + +@@ -242,18 +241,18 @@ get_next_names(void **my_loop_context, + + (ti->i)++; + return store_names(my_loop_context, my_data_context, +- put_index_data, iinfo); ++ put_index_data); + } + + static void free_loop_context_at_end(void *my_loop_context, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + if (my_loop_context) free(my_loop_context); + } + + static int +-iptables_names_handler(netsnmp_mib_handler *handler, +- netsnmp_handler_registration *reginfo, ++iptables_names_handler(netsnmp_mib_handler *handler __U__, ++ netsnmp_handler_registration *reginfo __U__, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) + { +@@ -325,10 +324,7 @@ typedef struct _chains_data { + + static netsnmp_variable_list * + store_chains(void **my_loop_context, +- void **my_data_context, +- netsnmp_variable_list *put_index_data, +- netsnmp_iterator_info *iinfo, +- int incr) ++ netsnmp_variable_list *put_index_data) + { + chains_iter *c = (chains_iter *) *my_loop_context; + netsnmp_variable_list *var = put_index_data; +@@ -367,7 +363,7 @@ store_chains(void **my_loop_context, + + void * + chains_make_data_context(void *loop_context, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + chains_iter *c = loop_context; + chains_data *data = SNMP_MALLOC_TYPEDEF(chains_data); +@@ -382,7 +378,7 @@ chains_make_data_context(void *loop_context, + static netsnmp_variable_list * + chains_get_first_names(void **my_loop_context, void **my_data_context, + netsnmp_variable_list * put_index_data, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + chains_iter *c = (chains_iter *) malloc(sizeof(chains_iter)); + if (c == NULL) { +@@ -397,8 +393,8 @@ chains_get_first_names(void **my_loop_context, void **my_data_context, + *my_loop_context = c; + *my_data_context = NULL; + +- return store_chains(my_loop_context, my_data_context, +- put_index_data, iinfo, 0); ++ return store_chains(my_loop_context, ++ put_index_data); + } + + /** functionally the same as get_first_data_point, but +@@ -410,29 +406,29 @@ chains_get_first_names(void **my_loop_context, void **my_data_context, + updated again. */ + static netsnmp_variable_list * + chains_get_next_names(void **my_loop_context, +- void **my_data_context, ++ void **my_data_context __U__, + netsnmp_variable_list *put_index_data, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { +- return store_chains(my_loop_context, my_data_context, +- put_index_data, iinfo, 1); ++ return store_chains(my_loop_context, ++ put_index_data); + } + + static void chains_free_loop_context_at_end(void *my_loop_context, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + if (my_loop_context) free(my_loop_context); + } + + static void chains_free_data_context(void *my_data_context, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + if (my_data_context) free(my_data_context); + } + + static int +-iptables_chains_handler(netsnmp_mib_handler *handler, +- netsnmp_handler_registration *reginfo, ++iptables_chains_handler(netsnmp_mib_handler *handler __U__, ++ netsnmp_handler_registration *reginfo __U__, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) + { +@@ -575,10 +571,7 @@ typedef struct _rules_data { + + static netsnmp_variable_list * + store_rules(void **my_loop_context, +- void **my_data_context, +- netsnmp_variable_list *put_index_data, +- netsnmp_iterator_info *iinfo, +- int incr) ++ netsnmp_variable_list *put_index_data) + { + rules_iter *c = (rules_iter *) *my_loop_context; + netsnmp_variable_list *var = put_index_data; +@@ -626,12 +619,11 @@ store_rules(void **my_loop_context, + (void*)&(c->rule), sizeof(c->rule)); + + return put_index_data; +- + } + + void * + rules_make_data_context(void *loop_context, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + rules_iter *c = loop_context; + rules_data *data = SNMP_MALLOC_TYPEDEF(rules_data); +@@ -647,7 +639,7 @@ rules_make_data_context(void *loop_context, + static netsnmp_variable_list * + rules_get_first_names(void **my_loop_context, void **my_data_context, + netsnmp_variable_list * put_index_data, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + rules_iter *c = (rules_iter *) malloc(sizeof(rules_iter)); + if (c == NULL) { +@@ -664,8 +656,8 @@ rules_get_first_names(void **my_loop_context, void **my_data_context, + *my_loop_context = c; + *my_data_context = NULL; + +- return store_rules(my_loop_context, my_data_context, +- put_index_data, iinfo, 0); ++ return store_rules(my_loop_context, ++ put_index_data); + } + + /** functionally the same as get_first_data_point, but +@@ -677,22 +669,22 @@ rules_get_first_names(void **my_loop_context, void **my_data_context, + updated again. */ + static netsnmp_variable_list * + rules_get_next_names(void **my_loop_context, +- void **my_data_context, ++ void **my_data_context __U__, + netsnmp_variable_list *put_index_data, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { +- return store_rules(my_loop_context, my_data_context, +- put_index_data, iinfo, 1); ++ return store_rules(my_loop_context, ++ put_index_data); + } + + static void rules_free_loop_context_at_end(void *my_loop_context, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + if (my_loop_context) free(my_loop_context); + } + + static void rules_free_data_context(void *my_data_context, +- netsnmp_iterator_info *iinfo) ++ netsnmp_iterator_info *iinfo __U__) + { + if (my_data_context) free(my_data_context); + } +@@ -739,8 +731,8 @@ static int short_ip(const char *prefix, + } + + static int +-iptables_rules_handler(netsnmp_mib_handler *handler, +- netsnmp_handler_registration *reginfo, ++iptables_rules_handler(netsnmp_mib_handler *handler __U__, ++ netsnmp_handler_registration *reginfo __U__, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) + { +@@ -905,8 +897,8 @@ iptables_rules_handler(netsnmp_mib_handler *handler, + } + + static int +-info_handler(netsnmp_mib_handler *handler, +- netsnmp_handler_registration *reginfo, ++info_handler(netsnmp_mib_handler *handler __U__, ++ netsnmp_handler_registration *reginfo __U__, + netsnmp_agent_request_info *reqinfo, + netsnmp_request_info *requests) + { +diff --git iptables-snmp.h iptables-snmp.h +index f2f407a..f755028 100644 +--- iptables-snmp.h ++++ iptables-snmp.h +@@ -28,6 +28,16 @@ + #ifndef IPTABLES_SNMP_H_INCLUDED + #define IPTABLES_SNMP_H_INCLUDED + ++#define HAVE___ATTRIBUTE__ 1 ++ ++#if HAVE___ATTRIBUTE__ ++# define __UNUSED__ __attribute__((unused)) ++# define __U__ __attribute__((unused)) ++#else ++# define __UNUSED__ ++# define __U__ ++#endif /* HAVE___ATTRIBUTE__ */ ++ + /* init function */ + void init_iptables(void); + +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/0009-MAJOR-Replace-autotools-with-simple-Makefile.patch b/net-firewall/iptables-snmp/files/0009-MAJOR-Replace-autotools-with-simple-Makefile.patch new file mode 100644 index 00000000..e30301d2 --- /dev/null +++ b/net-firewall/iptables-snmp/files/0009-MAJOR-Replace-autotools-with-simple-Makefile.patch @@ -0,0 +1,6012 @@ +From 224ec706dd220fb1b71d26e6960b3cc1ac9f001f Mon Sep 17 00:00:00 2001 +From: Bertrand Jacquin <beber@meleeweb.net> +Date: Thu, 12 Dec 2013 23:51:10 +0100 +Subject: [PATCH 9/9] MAJOR: Replace autotools with simple Makefile + +Get IPTABLES_VERSION from iptables/internal.h + +Signed-off-by: Bertrand Jacquin <beber@meleeweb.net> +--- + .gitignore | 12 +- + Makefile | 123 ++ + Makefile.in | 120 -- + aclocal.m4 | 832 ---------- + config.h.in | 1 - + configure | 4739 ------------------------------------------------------ + configure.in | 29 - + iptables-snmp.c | 6 +- + mibs/Makefile.in | 4 - + mkinstalldirs | 40 - + 10 files changed, 131 insertions(+), 5775 deletions(-) + create mode 100644 Makefile + delete mode 100644 Makefile.in + delete mode 100644 aclocal.m4 + delete mode 100644 config.h.in + delete mode 100755 configure + delete mode 100644 configure.in + delete mode 100644 mibs/Makefile.in + delete mode 100644 mkinstalldirs + +diff --git .gitignore .gitignore +index ae11007..53ccfaa 100644 +--- .gitignore ++++ .gitignore +@@ -1,9 +1,7 @@ +-config.h +-config.log +-config.status +-configure +- +-Makefile +- + iptables-snmp.o + iptables-snmp.so ++ ++iptables-snmp-*.tar ++iptables-snmp-*.txz ++ ++*.patch +diff --git Makefile Makefile +new file mode 100644 +index 0000000..7f78f21 +--- /dev/null ++++ Makefile +@@ -0,0 +1,123 @@ ++#!/usr/bin/make -f ++# ++# (c) 2013 - Bertrand Jacquin <beber@meleeweb.net> ++# ++ ++NAME = iptables-snmp ++VERSION = $(shell git describe --tags --dirty=-dev 2> /dev/null) ++ ++DESTDIR ?= ++PREFIX ?= /usr/local ++LIBDIR ?= $(PREFIX)/lib ++MIBDIR ?= $(PREFIX)/share/snmp/mibs ++DOCDIR ?= $(PREFIX)/share/doc/$(NAME) ++ ++SRC = \ ++ iptables-snmp.c ++ ++MIBS = \ ++ mibs/IPTABLES.MIB \ ++ mibs/STAMFEST.MIB ++ ++DOCS = \ ++ README ++ ++NETSNMP_CFLAGS = ++ ++NETSNMP_LDFLAGS = \ ++ -lnetsnmp \ ++ -lnetsnmpagent \ ++ -lnetsnmphelpers \ ++ -lnetsnmpmibs ++ ++IPTC_CFLAGS = \ ++ $(shell pkg-config --cflags libiptc) ++ ++IPTC_LDFLAGS = \ ++ $(shell pkg-config --libs libiptc) ++ ++CFLAGS ?= \ ++ -W -Wall ++ ++SPEC_CFLAGS = \ ++ -fPIC \ ++ -DAGENT_VERSION='"$(VERSION)"' \ ++ $(NETSNMP_CFLAGS) \ ++ $(IPTC_CFLAGS) ++ ++SPEC_LDFLAGS = \ ++ $(NETSNMP_LDFLAGS) \ ++ $(IPTC_LDFLAGS) ++ ++CC ?= cc ++ ++INSTALL ?= install ++ ++RM ?= rm -f ++ ++TAR ?= tar ++XZ ?= xz ++ ++ifeq ($(V),) ++ Q = @ ++ INSTALL_Q = ++ quiet_cmd = @printf " %-8s %s\n" "$(1)" "$(2)"; ++else ++ Q = ++ INSTALL_Q = ++ quiet_cmd = ++endif ++ ++all: $(NAME).so ++dist: $(NAME)-$(VERSION).txz ++ ++%.o: %.c %.h ++ $(call quiet_cmd,CC,$@) ++ $(Q)$(CC) -c $(SPEC_CFLAGS) $(CFLAGS) -o $@ $< ++ ++$(NAME).so: $(SRC:c=o) ++ $(call quiet_cmd,CC,$@) ++ $(Q)$(CC) -shared -o $@ $^ $(SPEC_LDFLAGS) $(LDFLAGS) ++ ++install: install-lib install-mib ++ ++install-lib: $(DESTDIR)$(LIBDIR)/$(NAME).so ++install-mib: $(MIBS:mibs/%=$(DESTDIR)$(MIBDIR)/%) ++install-doc: $(DOCS:%=$(DESTDIR)$(DOCDIR)/%) ++ ++$(DESTDIR)$(LIBDIR)/%.so: MODE = 644 ++$(DESTDIR)$(LIBDIR)/%: % ++ $(call quiet_cmd,INSTALL,$<) ++ $(Q)$(INSTALL) $(INSTALL_Q) -D -m $(MODE) $< $@ ++ ++$(DESTDIR)$(MIBDIR)/%: MODE = 644 ++$(DESTDIR)$(MIBDIR)/%: mibs/% ++ $(call quiet_cmd,INSTALL,$<) ++ $(Q)$(INSTALL) $(INSTALL_Q) -D -m $(MODE) $< $@ ++ ++$(DESTDIR)$(DOCDIR)/%: MODE = 644 ++$(DESTDIR)$(DOCDIR)/%: % ++ $(call quiet_cmd,INSTALL,$<) ++ $(Q)$(INSTALL) $(INSTALL_Q) -D -m $(MODE) $< $@ ++ ++$(NAME)-$(VERSION).tar: $(SRC) $(SRC:c=h) $(EXTRA_FILES) Makefile $(DOC_FILES) ++ $(call quiet_cmd,TAR,$@) ++ $(Q)$(TAR) cf $@ \ ++ --transform "s,^,$(NAME)-$(VERSION)/," \ ++ --force-local --numeric-owner \ ++ $^ ++ ++%.txz: %.tar ++ $(call quiet_cmd,XZ,$@) ++ $(Q)$(XZ) -c > $@ < $< ++clean: ++ $(call quiet_cmd,RM,$(SRC:c=o)) ++ $(Q)$(RM) $(SRC:c=o) ++ $(call quiet_cmd,RM,$(NAME).so) ++ $(Q)$(RM) $(NAME).so ++ ++dist-clean: clean ++ $(call quiet_cmd,RM,$(NAME)-$(VERSION).tar) ++ $(Q)$(RM) $(NAME)-$(VERSION).tar ++ $(call quiet_cmd,RM,$(NAME)-$(VERSION).txz) ++ $(Q)$(RM) $(NAME)-$(VERSION).txz +diff --git Makefile.in Makefile.in +deleted file mode 100644 +index 7744b82..0000000 +--- Makefile.in ++++ /dev/null +@@ -1,120 +0,0 @@ +-# This file is part of iptables-snmp - using SNMP to read data from linux +-# iptables +-# +-# iptables-snmp is copyrighted software: +-# (c) 2003 by Peter Stamfest <peter@stamfest.at> +-# munged by Nigel Roberts <nigel@nobiscuit.com> +-# +-# iptables-snmp is free software; you can redistribute it and/or modify +-# it under the terms of the GNU General Public License as published by +-# the Free Software Foundation; either version 2 of the License, or +-# (at your option) any later version. +-# +-# iptables-snmp is distributed in the hope that it will be useful, +-# but WITHOUT ANY WARRANTY; without even the implied warranty of +-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +-# GNU General Public License for more details. +-# +-# You should have received a copy of the GNU General Public License +-# along with iptables-snmp; if not, write to the Free Software +-# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA +-# +-# Note: See the file COPYING for the GNU General Public License and some +-# extensions to it designed to protect the OID space of Peter Stamfest from +-# becoming polluted. +- +-SHELL = /bin/sh +-VPATH = @srcdir@ +- +-subdirs = @subdirs@ +-top_srcdir = @top_srcdir@ +-srcdir = @srcdir@ +-prefix = @prefix@ +-exec_prefix = @exec_prefix@ +-libdir = $(prefix)/lib/ +- +-CC = @CC@ +-CPPFLAGS = @CPPFLAGS@ +-CFLAGS = $(CPPFLAGS) @CFLAGS@ +-LDFLAGS = @LDFLAGS@ +-LIBS = @LIBS@ +-INSTALL = @INSTALL@ +-INSTALL_PREFIX = +- +-NAME = iptables-snmp +-AGENT_VERSION = 0.1 +- +-IPTABLES = 1.3.3 +- +-STAMFEST_OID = 1,3,6,1,4,1,12806 +- +-SRCS = iptables-snmp.c +-OBJS = $(SRCS:.c=.o) +-L_SNMP_FLAGS = -lnetsnmp -lnetsnmphelpers -lnetsnmpagent -lnetsnmpmibs +-L_LDFLAGS = -lip4tc $(L_SNMP_FLAGS) +- +-NETFILTER = \"$(IPTABLES)\" +- +-LIBIPTC_SRCS = libiptc/libip4tc.c \ +- libiptc/libip6tc.c +-LIBIPTC_OBJS = $(LIBIPTC_SRCS:.c=.o) +- +-DFLAGS = -fPIC +- +-OTHER = -DIPTABLES_VERSION=$(NETFILTER) -DUSE_ENTERPRISE_OID=$(STAMFEST_OID) -DAGENT_VERSION=\"$(AGENT_VERSION)\" +- +-all: iptables-snmp.so +- +-iptables-snmp.so: $(OBJS) Makefile +- $(CC) $(DFLAGS) -shared -o $@ $(OBJS) $(L_LDFLAGS) $(LDFLAGS) +- +-libiptc.a: $(LIBIPTC_OBJS) Makefile +- $(AR) rc $@ $(LIBIPTC_OBJS) +- +-$(LIBIPTC_OBJS): libiptc/libiptc.c +- +-.c.o: +- $(CC) $(CFLAGS) $(OTHER) $(DFLAGS) -c -o $@ $< +- +-iptables-snmp.o: iptables-snmp.h +- +-clean: local-clean +- +-local-clean: +- rm -f *.o libiptc/*.a libiptc/*.o +- rm -f *.so +- rm -f *.a +- +-patch: $(IPTABLES_BASE).patch +- +-dist: +- rm -rf $(NAME)-$(AGENT_VERSION) +- mkdir $(NAME)-$(AGENT_VERSION) +- cpio -pudam $(NAME)-$(AGENT_VERSION) < MANIFEST +- tar -czf $(NAME)-$(AGENT_VERSION).tar.gz $(NAME)-$(AGENT_VERSION) +- rm -rf $(NAME)-$(AGENT_VERSION) +- +-install: iptables-snmp.so +- $(top_srcdir)/mkinstalldirs $(INSTALL_PREFIX)$(libdir) +- $(INSTALL) -c -m 755 iptables-snmp.so $(INSTALL_PREFIX)$(libdir) +- +-uninstall: +- -/bin/rm -f $(libdir)/iptables-snmp.so +- +-# automatic re-running of configure if the ocnfigure.in file has changed +-${srcdir}/configure: configure.in aclocal.m4 +- cd ${srcdir} && autoconf +- +-# autoheader might not change config.h.in, so touch a stamp file +-${srcdir}/config.h.in: stamp-h.in +-${srcdir}/stamp-h.in: configure.in aclocal.m4 +- cd ${srcdir} && autoheader +- echo timestamp > ${srcdir}/stamp-h.in +- +-config.h: stamp-h +-stamp-h: config.h.in config.status +- ./config.status +-Makefile: Makefile.in config.status +- ./config.status +-config.status: configure +- ./config.status --recheck +diff --git aclocal.m4 aclocal.m4 +deleted file mode 100644 +index 9161320..0000000 +--- aclocal.m4 ++++ /dev/null +@@ -1,832 +0,0 @@ +-dnl aclocal.m4 generated automatically by aclocal 1.4-p6 +- +-dnl Copyright (C) 1994, 1995-8, 1999, 2001 Free Software Foundation, Inc. +-dnl This file is free software; the Free Software Foundation +-dnl gives unlimited permission to copy and/or distribute it, +-dnl with or without modifications, as long as this notice is preserved. +- +-dnl This program is distributed in the hope that it will be useful, +-dnl but WITHOUT ANY WARRANTY, to the extent permitted by law; without +-dnl even the implied warranty of MERCHANTABILITY or FITNESS FOR A +-dnl PARTICULAR PURPOSE. +- +-# lib-prefix.m4 serial 3 (gettext-0.13) +-dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +-dnl This file is free software, distributed under the terms of the GNU +-dnl General Public License. As a special exception to the GNU General +-dnl Public License, this file may be distributed as part of a program +-dnl that contains a configuration script generated by Autoconf, under +-dnl the same distribution terms as the rest of that program. +- +-dnl From Bruno Haible. +- +-dnl AC_LIB_ARG_WITH is synonymous to AC_ARG_WITH in autoconf-2.13, and +-dnl similar to AC_ARG_WITH in autoconf 2.52...2.57 except that is doesn't +-dnl require excessive bracketing. +-ifdef([AC_HELP_STRING], +-[AC_DEFUN([AC_LIB_ARG_WITH], [AC_ARG_WITH([$1],[[$2]],[$3],[$4])])], +-[AC_DEFUN([AC_][LIB_ARG_WITH], [AC_ARG_WITH([$1],[$2],[$3],[$4])])]) +- +-dnl AC_LIB_PREFIX adds to the CPPFLAGS and LDFLAGS the flags that are needed +-dnl to access previously installed libraries. The basic assumption is that +-dnl a user will want packages to use other packages he previously installed +-dnl with the same --prefix option. +-dnl This macro is not needed if only AC_LIB_LINKFLAGS is used to locate +-dnl libraries, but is otherwise very convenient. +-AC_DEFUN([AC_LIB_PREFIX], +-[ +- AC_BEFORE([$0], [AC_LIB_LINKFLAGS]) +- AC_REQUIRE([AC_PROG_CC]) +- AC_REQUIRE([AC_CANONICAL_HOST]) +- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) +- dnl By default, look in $includedir and $libdir. +- use_additional=yes +- AC_LIB_WITH_FINAL_PREFIX([ +- eval additional_includedir=\"$includedir\" +- eval additional_libdir=\"$libdir\" +- ]) +- AC_LIB_ARG_WITH([lib-prefix], +-[ --with-lib-prefix[=DIR] search for libraries in DIR/include and DIR/lib +- --without-lib-prefix don't search for libraries in includedir and libdir], +-[ +- if test "X$withval" = "Xno"; then +- use_additional=no +- else +- if test "X$withval" = "X"; then +- AC_LIB_WITH_FINAL_PREFIX([ +- eval additional_includedir=\"$includedir\" +- eval additional_libdir=\"$libdir\" +- ]) +- else +- additional_includedir="$withval/include" +- additional_libdir="$withval/lib" +- fi +- fi +-]) +- if test $use_additional = yes; then +- dnl Potentially add $additional_includedir to $CPPFLAGS. +- dnl But don't add it +- dnl 1. if it's the standard /usr/include, +- dnl 2. if it's already present in $CPPFLAGS, +- dnl 3. if it's /usr/local/include and we are using GCC on Linux, +- dnl 4. if it doesn't exist as a directory. +- if test "X$additional_includedir" != "X/usr/include"; then +- haveit= +- for x in $CPPFLAGS; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- if test "X$x" = "X-I$additional_includedir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- if test "X$additional_includedir" = "X/usr/local/include"; then +- if test -n "$GCC"; then +- case $host_os in +- linux*) haveit=yes;; +- esac +- fi +- fi +- if test -z "$haveit"; then +- if test -d "$additional_includedir"; then +- dnl Really add $additional_includedir to $CPPFLAGS. +- CPPFLAGS="${CPPFLAGS}${CPPFLAGS:+ }-I$additional_includedir" +- fi +- fi +- fi +- fi +- dnl Potentially add $additional_libdir to $LDFLAGS. +- dnl But don't add it +- dnl 1. if it's the standard /usr/lib, +- dnl 2. if it's already present in $LDFLAGS, +- dnl 3. if it's /usr/local/lib and we are using GCC on Linux, +- dnl 4. if it doesn't exist as a directory. +- if test "X$additional_libdir" != "X/usr/lib"; then +- haveit= +- for x in $LDFLAGS; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- if test "X$x" = "X-L$additional_libdir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- if test "X$additional_libdir" = "X/usr/local/lib"; then +- if test -n "$GCC"; then +- case $host_os in +- linux*) haveit=yes;; +- esac +- fi +- fi +- if test -z "$haveit"; then +- if test -d "$additional_libdir"; then +- dnl Really add $additional_libdir to $LDFLAGS. +- LDFLAGS="${LDFLAGS}${LDFLAGS:+ }-L$additional_libdir" +- fi +- fi +- fi +- fi +- fi +-]) +- +-dnl AC_LIB_PREPARE_PREFIX creates variables acl_final_prefix, +-dnl acl_final_exec_prefix, containing the values to which $prefix and +-dnl $exec_prefix will expand at the end of the configure script. +-AC_DEFUN([AC_LIB_PREPARE_PREFIX], +-[ +- dnl Unfortunately, prefix and exec_prefix get only finally determined +- dnl at the end of configure. +- if test "X$prefix" = "XNONE"; then +- acl_final_prefix="$ac_default_prefix" +- else +- acl_final_prefix="$prefix" +- fi +- if test "X$exec_prefix" = "XNONE"; then +- acl_final_exec_prefix='${prefix}' +- else +- acl_final_exec_prefix="$exec_prefix" +- fi +- acl_save_prefix="$prefix" +- prefix="$acl_final_prefix" +- eval acl_final_exec_prefix=\"$acl_final_exec_prefix\" +- prefix="$acl_save_prefix" +-]) +- +-dnl AC_LIB_WITH_FINAL_PREFIX([statement]) evaluates statement, with the +-dnl variables prefix and exec_prefix bound to the values they will have +-dnl at the end of the configure script. +-AC_DEFUN([AC_LIB_WITH_FINAL_PREFIX], +-[ +- acl_save_prefix="$prefix" +- prefix="$acl_final_prefix" +- acl_save_exec_prefix="$exec_prefix" +- exec_prefix="$acl_final_exec_prefix" +- $1 +- exec_prefix="$acl_save_exec_prefix" +- prefix="$acl_save_prefix" +-]) +- +-# lib-link.m4 serial 4 (gettext-0.12) +-dnl Copyright (C) 2001-2003 Free Software Foundation, Inc. +-dnl This file is free software, distributed under the terms of the GNU +-dnl General Public License. As a special exception to the GNU General +-dnl Public License, this file may be distributed as part of a program +-dnl that contains a configuration script generated by Autoconf, under +-dnl the same distribution terms as the rest of that program. +- +-dnl From Bruno Haible. +- +-dnl AC_LIB_LINKFLAGS(name [, dependencies]) searches for libname and +-dnl the libraries corresponding to explicit and implicit dependencies. +-dnl Sets and AC_SUBSTs the LIB${NAME} and LTLIB${NAME} variables and +-dnl augments the CPPFLAGS variable. +-AC_DEFUN([AC_LIB_LINKFLAGS], +-[ +- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) +- AC_REQUIRE([AC_LIB_RPATH]) +- define([Name],[translit([$1],[./-], [___])]) +- define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], +- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) +- AC_CACHE_CHECK([how to link with lib[]$1], [ac_cv_lib[]Name[]_libs], [ +- AC_LIB_LINKFLAGS_BODY([$1], [$2]) +- ac_cv_lib[]Name[]_libs="$LIB[]NAME" +- ac_cv_lib[]Name[]_ltlibs="$LTLIB[]NAME" +- ac_cv_lib[]Name[]_cppflags="$INC[]NAME" +- ]) +- LIB[]NAME="$ac_cv_lib[]Name[]_libs" +- LTLIB[]NAME="$ac_cv_lib[]Name[]_ltlibs" +- INC[]NAME="$ac_cv_lib[]Name[]_cppflags" +- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) +- AC_SUBST([LIB]NAME) +- AC_SUBST([LTLIB]NAME) +- dnl Also set HAVE_LIB[]NAME so that AC_LIB_HAVE_LINKFLAGS can reuse the +- dnl results of this search when this library appears as a dependency. +- HAVE_LIB[]NAME=yes +- undefine([Name]) +- undefine([NAME]) +-]) +- +-dnl AC_LIB_HAVE_LINKFLAGS(name, dependencies, includes, testcode) +-dnl searches for libname and the libraries corresponding to explicit and +-dnl implicit dependencies, together with the specified include files and +-dnl the ability to compile and link the specified testcode. If found, it +-dnl sets and AC_SUBSTs HAVE_LIB${NAME}=yes and the LIB${NAME} and +-dnl LTLIB${NAME} variables and augments the CPPFLAGS variable, and +-dnl #defines HAVE_LIB${NAME} to 1. Otherwise, it sets and AC_SUBSTs +-dnl HAVE_LIB${NAME}=no and LIB${NAME} and LTLIB${NAME} to empty. +-AC_DEFUN([AC_LIB_HAVE_LINKFLAGS], +-[ +- AC_REQUIRE([AC_LIB_PREPARE_PREFIX]) +- AC_REQUIRE([AC_LIB_RPATH]) +- define([Name],[translit([$1],[./-], [___])]) +- define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], +- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) +- +- dnl Search for lib[]Name and define LIB[]NAME, LTLIB[]NAME and INC[]NAME +- dnl accordingly. +- AC_LIB_LINKFLAGS_BODY([$1], [$2]) +- +- dnl Add $INC[]NAME to CPPFLAGS before performing the following checks, +- dnl because if the user has installed lib[]Name and not disabled its use +- dnl via --without-lib[]Name-prefix, he wants to use it. +- ac_save_CPPFLAGS="$CPPFLAGS" +- AC_LIB_APPENDTOVAR([CPPFLAGS], [$INC]NAME) +- +- AC_CACHE_CHECK([for lib[]$1], [ac_cv_lib[]Name], [ +- ac_save_LIBS="$LIBS" +- LIBS="$LIBS $LIB[]NAME" +- AC_TRY_LINK([$3], [$4], [ac_cv_lib[]Name=yes], [ac_cv_lib[]Name=no]) +- LIBS="$ac_save_LIBS" +- ]) +- if test "$ac_cv_lib[]Name" = yes; then +- HAVE_LIB[]NAME=yes +- AC_DEFINE([HAVE_LIB]NAME, 1, [Define if you have the $1 library.]) +- AC_MSG_CHECKING([how to link with lib[]$1]) +- AC_MSG_RESULT([$LIB[]NAME]) +- else +- HAVE_LIB[]NAME=no +- dnl If $LIB[]NAME didn't lead to a usable library, we don't need +- dnl $INC[]NAME either. +- CPPFLAGS="$ac_save_CPPFLAGS" +- LIB[]NAME= +- LTLIB[]NAME= +- fi +- AC_SUBST([HAVE_LIB]NAME) +- AC_SUBST([LIB]NAME) +- AC_SUBST([LTLIB]NAME) +- undefine([Name]) +- undefine([NAME]) +-]) +- +-dnl Determine the platform dependent parameters needed to use rpath: +-dnl libext, shlibext, hardcode_libdir_flag_spec, hardcode_libdir_separator, +-dnl hardcode_direct, hardcode_minus_L. +-AC_DEFUN([AC_LIB_RPATH], +-[ +- AC_REQUIRE([AC_PROG_CC]) dnl we use $CC, $GCC, $LDFLAGS +- AC_REQUIRE([AC_LIB_PROG_LD]) dnl we use $LD, $with_gnu_ld +- AC_REQUIRE([AC_CANONICAL_HOST]) dnl we use $host +- AC_REQUIRE([AC_CONFIG_AUX_DIR_DEFAULT]) dnl we use $ac_aux_dir +- AC_CACHE_CHECK([for shared library run path origin], acl_cv_rpath, [ +- CC="$CC" GCC="$GCC" LDFLAGS="$LDFLAGS" LD="$LD" with_gnu_ld="$with_gnu_ld" \ +- ${CONFIG_SHELL-/bin/sh} "$ac_aux_dir/config.rpath" "$host" > conftest.sh +- . ./conftest.sh +- rm -f ./conftest.sh +- acl_cv_rpath=done +- ]) +- wl="$acl_cv_wl" +- libext="$acl_cv_libext" +- shlibext="$acl_cv_shlibext" +- hardcode_libdir_flag_spec="$acl_cv_hardcode_libdir_flag_spec" +- hardcode_libdir_separator="$acl_cv_hardcode_libdir_separator" +- hardcode_direct="$acl_cv_hardcode_direct" +- hardcode_minus_L="$acl_cv_hardcode_minus_L" +- dnl Determine whether the user wants rpath handling at all. +- AC_ARG_ENABLE(rpath, +- [ --disable-rpath do not hardcode runtime library paths], +- :, enable_rpath=yes) +-]) +- +-dnl AC_LIB_LINKFLAGS_BODY(name [, dependencies]) searches for libname and +-dnl the libraries corresponding to explicit and implicit dependencies. +-dnl Sets the LIB${NAME}, LTLIB${NAME} and INC${NAME} variables. +-AC_DEFUN([AC_LIB_LINKFLAGS_BODY], +-[ +- define([NAME],[translit([$1],[abcdefghijklmnopqrstuvwxyz./-], +- [ABCDEFGHIJKLMNOPQRSTUVWXYZ___])]) +- dnl By default, look in $includedir and $libdir. +- use_additional=yes +- AC_LIB_WITH_FINAL_PREFIX([ +- eval additional_includedir=\"$includedir\" +- eval additional_libdir=\"$libdir\" +- ]) +- AC_LIB_ARG_WITH([lib$1-prefix], +-[ --with-lib$1-prefix[=DIR] search for lib$1 in DIR/include and DIR/lib +- --without-lib$1-prefix don't search for lib$1 in includedir and libdir], +-[ +- if test "X$withval" = "Xno"; then +- use_additional=no +- else +- if test "X$withval" = "X"; then +- AC_LIB_WITH_FINAL_PREFIX([ +- eval additional_includedir=\"$includedir\" +- eval additional_libdir=\"$libdir\" +- ]) +- else +- additional_includedir="$withval/include" +- additional_libdir="$withval/lib" +- fi +- fi +-]) +- dnl Search the library and its dependencies in $additional_libdir and +- dnl $LDFLAGS. Using breadth-first-seach. +- LIB[]NAME= +- LTLIB[]NAME= +- INC[]NAME= +- rpathdirs= +- ltrpathdirs= +- names_already_handled= +- names_next_round='$1 $2' +- while test -n "$names_next_round"; do +- names_this_round="$names_next_round" +- names_next_round= +- for name in $names_this_round; do +- already_handled= +- for n in $names_already_handled; do +- if test "$n" = "$name"; then +- already_handled=yes +- break +- fi +- done +- if test -z "$already_handled"; then +- names_already_handled="$names_already_handled $name" +- dnl See if it was already located by an earlier AC_LIB_LINKFLAGS +- dnl or AC_LIB_HAVE_LINKFLAGS call. +- uppername=`echo "$name" | sed -e 'y|abcdefghijklmnopqrstuvwxyz./-|ABCDEFGHIJKLMNOPQRSTUVWXYZ___|'` +- eval value=\"\$HAVE_LIB$uppername\" +- if test -n "$value"; then +- if test "$value" = yes; then +- eval value=\"\$LIB$uppername\" +- test -z "$value" || LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$value" +- eval value=\"\$LTLIB$uppername\" +- test -z "$value" || LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$value" +- else +- dnl An earlier call to AC_LIB_HAVE_LINKFLAGS has determined +- dnl that this library doesn't exist. So just drop it. +- : +- fi +- else +- dnl Search the library lib$name in $additional_libdir and $LDFLAGS +- dnl and the already constructed $LIBNAME/$LTLIBNAME. +- found_dir= +- found_la= +- found_so= +- found_a= +- if test $use_additional = yes; then +- if test -n "$shlibext" && test -f "$additional_libdir/lib$name.$shlibext"; then +- found_dir="$additional_libdir" +- found_so="$additional_libdir/lib$name.$shlibext" +- if test -f "$additional_libdir/lib$name.la"; then +- found_la="$additional_libdir/lib$name.la" +- fi +- else +- if test -f "$additional_libdir/lib$name.$libext"; then +- found_dir="$additional_libdir" +- found_a="$additional_libdir/lib$name.$libext" +- if test -f "$additional_libdir/lib$name.la"; then +- found_la="$additional_libdir/lib$name.la" +- fi +- fi +- fi +- fi +- if test "X$found_dir" = "X"; then +- for x in $LDFLAGS $LTLIB[]NAME; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- case "$x" in +- -L*) +- dir=`echo "X$x" | sed -e 's/^X-L//'` +- if test -n "$shlibext" && test -f "$dir/lib$name.$shlibext"; then +- found_dir="$dir" +- found_so="$dir/lib$name.$shlibext" +- if test -f "$dir/lib$name.la"; then +- found_la="$dir/lib$name.la" +- fi +- else +- if test -f "$dir/lib$name.$libext"; then +- found_dir="$dir" +- found_a="$dir/lib$name.$libext" +- if test -f "$dir/lib$name.la"; then +- found_la="$dir/lib$name.la" +- fi +- fi +- fi +- ;; +- esac +- if test "X$found_dir" != "X"; then +- break +- fi +- done +- fi +- if test "X$found_dir" != "X"; then +- dnl Found the library. +- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$found_dir -l$name" +- if test "X$found_so" != "X"; then +- dnl Linking with a shared library. We attempt to hardcode its +- dnl directory into the executable's runpath, unless it's the +- dnl standard /usr/lib. +- if test "$enable_rpath" = no || test "X$found_dir" = "X/usr/lib"; then +- dnl No hardcoding is needed. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" +- else +- dnl Use an explicit option to hardcode DIR into the resulting +- dnl binary. +- dnl Potentially add DIR to ltrpathdirs. +- dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. +- haveit= +- for x in $ltrpathdirs; do +- if test "X$x" = "X$found_dir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- ltrpathdirs="$ltrpathdirs $found_dir" +- fi +- dnl The hardcoding into $LIBNAME is system dependent. +- if test "$hardcode_direct" = yes; then +- dnl Using DIR/libNAME.so during linking hardcodes DIR into the +- dnl resulting binary. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" +- else +- if test -n "$hardcode_libdir_flag_spec" && test "$hardcode_minus_L" = no; then +- dnl Use an explicit option to hardcode DIR into the resulting +- dnl binary. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" +- dnl Potentially add DIR to rpathdirs. +- dnl The rpathdirs will be appended to $LIBNAME at the end. +- haveit= +- for x in $rpathdirs; do +- if test "X$x" = "X$found_dir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- rpathdirs="$rpathdirs $found_dir" +- fi +- else +- dnl Rely on "-L$found_dir". +- dnl But don't add it if it's already contained in the LDFLAGS +- dnl or the already constructed $LIBNAME +- haveit= +- for x in $LDFLAGS $LIB[]NAME; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- if test "X$x" = "X-L$found_dir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir" +- fi +- if test "$hardcode_minus_L" != no; then +- dnl FIXME: Not sure whether we should use +- dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" +- dnl here. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_so" +- else +- dnl We cannot use $hardcode_runpath_var and LD_RUN_PATH +- dnl here, because this doesn't fit in flags passed to the +- dnl compiler. So give up. No hardcoding. This affects only +- dnl very old systems. +- dnl FIXME: Not sure whether we should use +- dnl "-L$found_dir -l$name" or "-L$found_dir $found_so" +- dnl here. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" +- fi +- fi +- fi +- fi +- else +- if test "X$found_a" != "X"; then +- dnl Linking with a static library. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$found_a" +- else +- dnl We shouldn't come here, but anyway it's good to have a +- dnl fallback. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$found_dir -l$name" +- fi +- fi +- dnl Assume the include files are nearby. +- additional_includedir= +- case "$found_dir" in +- */lib | */lib/) +- basedir=`echo "X$found_dir" | sed -e 's,^X,,' -e 's,/lib/*$,,'` +- additional_includedir="$basedir/include" +- ;; +- esac +- if test "X$additional_includedir" != "X"; then +- dnl Potentially add $additional_includedir to $INCNAME. +- dnl But don't add it +- dnl 1. if it's the standard /usr/include, +- dnl 2. if it's /usr/local/include and we are using GCC on Linux, +- dnl 3. if it's already present in $CPPFLAGS or the already +- dnl constructed $INCNAME, +- dnl 4. if it doesn't exist as a directory. +- if test "X$additional_includedir" != "X/usr/include"; then +- haveit= +- if test "X$additional_includedir" = "X/usr/local/include"; then +- if test -n "$GCC"; then +- case $host_os in +- linux*) haveit=yes;; +- esac +- fi +- fi +- if test -z "$haveit"; then +- for x in $CPPFLAGS $INC[]NAME; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- if test "X$x" = "X-I$additional_includedir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- if test -d "$additional_includedir"; then +- dnl Really add $additional_includedir to $INCNAME. +- INC[]NAME="${INC[]NAME}${INC[]NAME:+ }-I$additional_includedir" +- fi +- fi +- fi +- fi +- fi +- dnl Look for dependencies. +- if test -n "$found_la"; then +- dnl Read the .la file. It defines the variables +- dnl dlname, library_names, old_library, dependency_libs, current, +- dnl age, revision, installed, dlopen, dlpreopen, libdir. +- save_libdir="$libdir" +- case "$found_la" in +- */* | *\\*) . "$found_la" ;; +- *) . "./$found_la" ;; +- esac +- libdir="$save_libdir" +- dnl We use only dependency_libs. +- for dep in $dependency_libs; do +- case "$dep" in +- -L*) +- additional_libdir=`echo "X$dep" | sed -e 's/^X-L//'` +- dnl Potentially add $additional_libdir to $LIBNAME and $LTLIBNAME. +- dnl But don't add it +- dnl 1. if it's the standard /usr/lib, +- dnl 2. if it's /usr/local/lib and we are using GCC on Linux, +- dnl 3. if it's already present in $LDFLAGS or the already +- dnl constructed $LIBNAME, +- dnl 4. if it doesn't exist as a directory. +- if test "X$additional_libdir" != "X/usr/lib"; then +- haveit= +- if test "X$additional_libdir" = "X/usr/local/lib"; then +- if test -n "$GCC"; then +- case $host_os in +- linux*) haveit=yes;; +- esac +- fi +- fi +- if test -z "$haveit"; then +- haveit= +- for x in $LDFLAGS $LIB[]NAME; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- if test "X$x" = "X-L$additional_libdir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- if test -d "$additional_libdir"; then +- dnl Really add $additional_libdir to $LIBNAME. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-L$additional_libdir" +- fi +- fi +- haveit= +- for x in $LDFLAGS $LTLIB[]NAME; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- if test "X$x" = "X-L$additional_libdir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- if test -d "$additional_libdir"; then +- dnl Really add $additional_libdir to $LTLIBNAME. +- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-L$additional_libdir" +- fi +- fi +- fi +- fi +- ;; +- -R*) +- dir=`echo "X$dep" | sed -e 's/^X-R//'` +- if test "$enable_rpath" != no; then +- dnl Potentially add DIR to rpathdirs. +- dnl The rpathdirs will be appended to $LIBNAME at the end. +- haveit= +- for x in $rpathdirs; do +- if test "X$x" = "X$dir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- rpathdirs="$rpathdirs $dir" +- fi +- dnl Potentially add DIR to ltrpathdirs. +- dnl The ltrpathdirs will be appended to $LTLIBNAME at the end. +- haveit= +- for x in $ltrpathdirs; do +- if test "X$x" = "X$dir"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- ltrpathdirs="$ltrpathdirs $dir" +- fi +- fi +- ;; +- -l*) +- dnl Handle this in the next round. +- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's/^X-l//'` +- ;; +- *.la) +- dnl Handle this in the next round. Throw away the .la's +- dnl directory; it is already contained in a preceding -L +- dnl option. +- names_next_round="$names_next_round "`echo "X$dep" | sed -e 's,^X.*/,,' -e 's,^lib,,' -e 's,\.la$,,'` +- ;; +- *) +- dnl Most likely an immediate library name. +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$dep" +- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }$dep" +- ;; +- esac +- done +- fi +- else +- dnl Didn't find the library; assume it is in the system directories +- dnl known to the linker and runtime loader. (All the system +- dnl directories known to the linker should also be known to the +- dnl runtime loader, otherwise the system is severely misconfigured.) +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }-l$name" +- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-l$name" +- fi +- fi +- fi +- done +- done +- if test "X$rpathdirs" != "X"; then +- if test -n "$hardcode_libdir_separator"; then +- dnl Weird platform: only the last -rpath option counts, the user must +- dnl pass all path elements in one option. We can arrange that for a +- dnl single library, but not when more than one $LIBNAMEs are used. +- alldirs= +- for found_dir in $rpathdirs; do +- alldirs="${alldirs}${alldirs:+$hardcode_libdir_separator}$found_dir" +- done +- dnl Note: hardcode_libdir_flag_spec uses $libdir and $wl. +- acl_save_libdir="$libdir" +- libdir="$alldirs" +- eval flag=\"$hardcode_libdir_flag_spec\" +- libdir="$acl_save_libdir" +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" +- else +- dnl The -rpath options are cumulative. +- for found_dir in $rpathdirs; do +- acl_save_libdir="$libdir" +- libdir="$found_dir" +- eval flag=\"$hardcode_libdir_flag_spec\" +- libdir="$acl_save_libdir" +- LIB[]NAME="${LIB[]NAME}${LIB[]NAME:+ }$flag" +- done +- fi +- fi +- if test "X$ltrpathdirs" != "X"; then +- dnl When using libtool, the option that works for both libraries and +- dnl executables is -R. The -R options are cumulative. +- for found_dir in $ltrpathdirs; do +- LTLIB[]NAME="${LTLIB[]NAME}${LTLIB[]NAME:+ }-R$found_dir" +- done +- fi +-]) +- +-dnl AC_LIB_APPENDTOVAR(VAR, CONTENTS) appends the elements of CONTENTS to VAR, +-dnl unless already present in VAR. +-dnl Works only for CPPFLAGS, not for LIB* variables because that sometimes +-dnl contains two or three consecutive elements that belong together. +-AC_DEFUN([AC_LIB_APPENDTOVAR], +-[ +- for element in [$2]; do +- haveit= +- for x in $[$1]; do +- AC_LIB_WITH_FINAL_PREFIX([eval x=\"$x\"]) +- if test "X$x" = "X$element"; then +- haveit=yes +- break +- fi +- done +- if test -z "$haveit"; then +- [$1]="${[$1]}${[$1]:+ }$element" +- fi +- done +-]) +- +-# lib-ld.m4 serial 3 (gettext-0.13) +-dnl Copyright (C) 1996-2003 Free Software Foundation, Inc. +-dnl This file is free software, distributed under the terms of the GNU +-dnl General Public License. As a special exception to the GNU General +-dnl Public License, this file may be distributed as part of a program +-dnl that contains a configuration script generated by Autoconf, under +-dnl the same distribution terms as the rest of that program. +- +-dnl Subroutines of libtool.m4, +-dnl with replacements s/AC_/AC_LIB/ and s/lt_cv/acl_cv/ to avoid collision +-dnl with libtool.m4. +- +-dnl From libtool-1.4. Sets the variable with_gnu_ld to yes or no. +-AC_DEFUN([AC_LIB_PROG_LD_GNU], +-[AC_CACHE_CHECK([if the linker ($LD) is GNU ld], acl_cv_prog_gnu_ld, +-[# I'd rather use --version here, but apparently some GNU ld's only accept -v. +-case `$LD -v 2>&1 </dev/null` in +-*GNU* | *'with BFD'*) +- acl_cv_prog_gnu_ld=yes ;; +-*) +- acl_cv_prog_gnu_ld=no ;; +-esac]) +-with_gnu_ld=$acl_cv_prog_gnu_ld +-]) +- +-dnl From libtool-1.4. Sets the variable LD. +-AC_DEFUN([AC_LIB_PROG_LD], +-[AC_ARG_WITH(gnu-ld, +-[ --with-gnu-ld assume the C compiler uses GNU ld [default=no]], +-test "$withval" = no || with_gnu_ld=yes, with_gnu_ld=no) +-AC_REQUIRE([AC_PROG_CC])dnl +-AC_REQUIRE([AC_CANONICAL_HOST])dnl +-# Prepare PATH_SEPARATOR. +-# The user is always right. +-if test "${PATH_SEPARATOR+set}" != set; then +- echo "#! /bin/sh" >conf$$.sh +- echo "exit 0" >>conf$$.sh +- chmod +x conf$$.sh +- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then +- PATH_SEPARATOR=';' +- else +- PATH_SEPARATOR=: +- fi +- rm -f conf$$.sh +-fi +-ac_prog=ld +-if test "$GCC" = yes; then +- # Check if gcc -print-prog-name=ld gives a path. +- AC_MSG_CHECKING([for ld used by GCC]) +- case $host in +- *-*-mingw*) +- # gcc leaves a trailing carriage return which upsets mingw +- ac_prog=`($CC -print-prog-name=ld) 2>&5 | tr -d '\015'` ;; +- *) +- ac_prog=`($CC -print-prog-name=ld) 2>&5` ;; +- esac +- case $ac_prog in +- # Accept absolute paths. +- [[\\/]* | [A-Za-z]:[\\/]*)] +- [re_direlt='/[^/][^/]*/\.\./'] +- # Canonicalize the path of ld +- ac_prog=`echo $ac_prog| sed 's%\\\\%/%g'` +- while echo $ac_prog | grep "$re_direlt" > /dev/null 2>&1; do +- ac_prog=`echo $ac_prog| sed "s%$re_direlt%/%"` +- done +- test -z "$LD" && LD="$ac_prog" +- ;; +- "") +- # If it fails, then pretend we aren't using GCC. +- ac_prog=ld +- ;; +- *) +- # If it is relative, then search for the first ld in PATH. +- with_gnu_ld=unknown +- ;; +- esac +-elif test "$with_gnu_ld" = yes; then +- AC_MSG_CHECKING([for GNU ld]) +-else +- AC_MSG_CHECKING([for non-GNU ld]) +-fi +-AC_CACHE_VAL(acl_cv_path_LD, +-[if test -z "$LD"; then +- IFS="${IFS= }"; ac_save_ifs="$IFS"; IFS="${IFS}${PATH_SEPARATOR-:}" +- for ac_dir in $PATH; do +- test -z "$ac_dir" && ac_dir=. +- if test -f "$ac_dir/$ac_prog" || test -f "$ac_dir/$ac_prog$ac_exeext"; then +- acl_cv_path_LD="$ac_dir/$ac_prog" +- # Check to see if the program is GNU ld. I'd rather use --version, +- # but apparently some GNU ld's only accept -v. +- # Break only if it was the GNU/non-GNU ld that we prefer. +- case `"$acl_cv_path_LD" -v 2>&1 < /dev/null` in +- *GNU* | *'with BFD'*) +- test "$with_gnu_ld" != no && break ;; +- *) +- test "$with_gnu_ld" != yes && break ;; +- esac +- fi +- done +- IFS="$ac_save_ifs" +-else +- acl_cv_path_LD="$LD" # Let the user override the test with a path. +-fi]) +-LD="$acl_cv_path_LD" +-if test -n "$LD"; then +- AC_MSG_RESULT($LD) +-else +- AC_MSG_RESULT(no) +-fi +-test -z "$LD" && AC_MSG_ERROR([no acceptable ld found in \$PATH]) +-AC_LIB_PROG_LD_GNU +-]) +diff --git config.h.in config.h.in +deleted file mode 100644 +index ceeab28..0000000 +--- config.h.in ++++ /dev/null +@@ -1 +0,0 @@ +-/* config.h.in. Generated automatically from configure.in by autoheader 2.13. */ +diff --git configure configure +deleted file mode 100755 +index 7cc8d0a..0000000 +--- configure ++++ /dev/null +@@ -1,4739 +0,0 @@ +-#! /bin/sh +-# Guess values for system-dependent variables and create Makefiles. +-# Generated by GNU Autoconf 2.59 for FULL-PACKAGE-NAME VERSION. +-# +-# Report bugs to <BUG-REPORT-ADDRESS>. +-# +-# Copyright (C) 2003 Free Software Foundation, Inc. +-# This configure script is free software; the Free Software Foundation +-# gives unlimited permission to copy, distribute and modify it. +-## --------------------- ## +-## M4sh Initialization. ## +-## --------------------- ## +- +-# Be Bourne compatible +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +- emulate sh +- NULLCMD=: +- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which +- # is contrary to our usage. Disable this feature. +- alias -g '${1+"$@"}'='"$@"' +-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then +- set -o posix +-fi +-DUALCASE=1; export DUALCASE # for MKS sh +- +-# Support unset when possible. +-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +- as_unset=unset +-else +- as_unset=false +-fi +- +- +-# Work around bugs in pre-3.0 UWIN ksh. +-$as_unset ENV MAIL MAILPATH +-PS1='$ ' +-PS2='> ' +-PS4='+ ' +- +-# NLS nuisances. +-for as_var in \ +- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ +- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ +- LC_TELEPHONE LC_TIME +-do +- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then +- eval $as_var=C; export $as_var +- else +- $as_unset $as_var +- fi +-done +- +-# Required to use basename. +-if expr a : '\(a\)' >/dev/null 2>&1; then +- as_expr=expr +-else +- as_expr=false +-fi +- +-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +- as_basename=basename +-else +- as_basename=false +-fi +- +- +-# Name of the executable. +-as_me=`$as_basename "$0" || +-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ +- X"$0" : 'X\(//\)$' \| \ +- X"$0" : 'X\(/\)$' \| \ +- . : '\(.\)' 2>/dev/null || +-echo X/"$0" | +- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } +- /^X\/\(\/\/\)$/{ s//\1/; q; } +- /^X\/\(\/\).*/{ s//\1/; q; } +- s/.*/./; q'` +- +- +-# PATH needs CR, and LINENO needs CR and PATH. +-# Avoid depending upon Character Ranges. +-as_cr_letters='abcdefghijklmnopqrstuvwxyz' +-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +-as_cr_Letters=$as_cr_letters$as_cr_LETTERS +-as_cr_digits='0123456789' +-as_cr_alnum=$as_cr_Letters$as_cr_digits +- +-# The user is always right. +-if test "${PATH_SEPARATOR+set}" != set; then +- echo "#! /bin/sh" >conf$$.sh +- echo "exit 0" >>conf$$.sh +- chmod +x conf$$.sh +- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then +- PATH_SEPARATOR=';' +- else +- PATH_SEPARATOR=: +- fi +- rm -f conf$$.sh +-fi +- +- +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" || { +- # Find who we are. Look in the path if we contain no path at all +- # relative or not. +- case $0 in +- *[\\/]* ) as_myself=$0 ;; +- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +-done +- +- ;; +- esac +- # We did not find ourselves, most probably we were run as `sh COMMAND' +- # in which case we are not to be found in the path. +- if test "x$as_myself" = x; then +- as_myself=$0 +- fi +- if test ! -f "$as_myself"; then +- { echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2 +- { (exit 1); exit 1; }; } +- fi +- case $CONFIG_SHELL in +- '') +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for as_base in sh bash ksh sh5; do +- case $as_dir in +- /*) +- if ("$as_dir/$as_base" -c ' +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then +- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } +- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } +- CONFIG_SHELL=$as_dir/$as_base +- export CONFIG_SHELL +- exec "$CONFIG_SHELL" "$0" ${1+"$@"} +- fi;; +- esac +- done +-done +-;; +- esac +- +- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO +- # uniformly replaced by the line number. The first 'sed' inserts a +- # line-number line before each line; the second 'sed' does the real +- # work. The second script uses 'N' to pair each line-number line +- # with the numbered line, and appends trailing '-' during +- # substitution so that $LINENO is not a special case at line end. +- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the +- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) +- sed '=' <$as_myself | +- sed ' +- N +- s,$,-, +- : loop +- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, +- t loop +- s,-$,, +- s,^['$as_cr_digits']*\n,, +- ' >$as_me.lineno && +- chmod +x $as_me.lineno || +- { echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2 +- { (exit 1); exit 1; }; } +- +- # Don't try to exec as it changes $[0], causing all sort of problems +- # (the dirname of $[0] is not the place where we might find the +- # original and so on. Autoconf is especially sensible to this). +- . ./$as_me.lineno +- # Exit status is that of the last command. +- exit +-} +- +- +-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in +- *c*,-n*) ECHO_N= ECHO_C=' +-' ECHO_T=' ' ;; +- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; +- *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +-esac +- +-if expr a : '\(a\)' >/dev/null 2>&1; then +- as_expr=expr +-else +- as_expr=false +-fi +- +-rm -f conf$$ conf$$.exe conf$$.file +-echo >conf$$.file +-if ln -s conf$$.file conf$$ 2>/dev/null; then +- # We could just check for DJGPP; but this test a) works b) is more generic +- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). +- if test -f conf$$.exe; then +- # Don't use ln at all; we don't have any links +- as_ln_s='cp -p' +- else +- as_ln_s='ln -s' +- fi +-elif ln conf$$.file conf$$ 2>/dev/null; then +- as_ln_s=ln +-else +- as_ln_s='cp -p' +-fi +-rm -f conf$$ conf$$.exe conf$$.file +- +-if mkdir -p . 2>/dev/null; then +- as_mkdir_p=: +-else +- test -d ./-p && rmdir ./-p +- as_mkdir_p=false +-fi +- +-as_executable_p="test -f" +- +-# Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +- +-# Sed expression to map a string onto a valid variable name. +-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +- +- +-# IFS +-# We need space, tab and new line, in precisely that order. +-as_nl=' +-' +-IFS=" $as_nl" +- +-# CDPATH. +-$as_unset CDPATH +- +- +-# Name of the host. +-# hostname on some systems (SVR3.2, Linux) returns a bogus exit status, +-# so uname gets run too. +-ac_hostname=`(hostname || uname -n) 2>/dev/null | sed 1q` +- +-exec 6>&1 +- +-# +-# Initializations. +-# +-ac_default_prefix=/usr/local +-ac_config_libobj_dir=. +-cross_compiling=no +-subdirs= +-MFLAGS= +-MAKEFLAGS= +-SHELL=${CONFIG_SHELL-/bin/sh} +- +-# Maximum number of lines to put in a shell here document. +-# This variable seems obsolete. It should probably be removed, and +-# only ac_max_sed_lines should be used. +-: ${ac_max_here_lines=38} +- +-# Identity of this package. +-PACKAGE_NAME='FULL-PACKAGE-NAME' +-PACKAGE_TARNAME='full-package-name' +-PACKAGE_VERSION='VERSION' +-PACKAGE_STRING='FULL-PACKAGE-NAME VERSION' +-PACKAGE_BUGREPORT='BUG-REPORT-ADDRESS' +- +-ac_unique_file="iptables-snmp.c" +-# Factoring default headers for most tests. +-ac_includes_default="\ +-#include <stdio.h> +-#if HAVE_SYS_TYPES_H +-# include <sys/types.h> +-#endif +-#if HAVE_SYS_STAT_H +-# include <sys/stat.h> +-#endif +-#if STDC_HEADERS +-# include <stdlib.h> +-# include <stddef.h> +-#else +-# if HAVE_STDLIB_H +-# include <stdlib.h> +-# endif +-#endif +-#if HAVE_STRING_H +-# if !STDC_HEADERS && HAVE_MEMORY_H +-# include <memory.h> +-# endif +-# include <string.h> +-#endif +-#if HAVE_STRINGS_H +-# include <strings.h> +-#endif +-#if HAVE_INTTYPES_H +-# include <inttypes.h> +-#else +-# if HAVE_STDINT_H +-# include <stdint.h> +-# endif +-#endif +-#if HAVE_UNISTD_H +-# include <unistd.h> +-#endif" +- +-ac_subst_vars='SHELL PATH_SEPARATOR PACKAGE_NAME PACKAGE_TARNAME PACKAGE_VERSION PACKAGE_STRING PACKAGE_BUGREPORT exec_prefix prefix program_transform_name bindir sbindir libexecdir datadir sysconfdir sharedstatedir localstatedir libdir includedir oldincludedir infodir mandir build_alias host_alias target_alias DEFS ECHO_C ECHO_N ECHO_T LIBS CC CFLAGS LDFLAGS CPPFLAGS ac_ct_CC EXEEXT OBJEXT CPP EGREP LIBOBJS INSTALL ac_ct_INSTALL LTLIBOBJS' +-ac_subst_files='' +- +-# Initialize some variables set by options. +-ac_init_help= +-ac_init_version=false +-# The variables have the same names as the options, with +-# dashes changed to underlines. +-cache_file=/dev/null +-exec_prefix=NONE +-no_create= +-no_recursion= +-prefix=NONE +-program_prefix=NONE +-program_suffix=NONE +-program_transform_name=s,x,x, +-silent= +-site= +-srcdir= +-verbose= +-x_includes=NONE +-x_libraries=NONE +- +-# Installation directory options. +-# These are left unexpanded so users can "make install exec_prefix=/foo" +-# and all the variables that are supposed to be based on exec_prefix +-# by default will actually change. +-# Use braces instead of parens because sh, perl, etc. also accept them. +-bindir='${exec_prefix}/bin' +-sbindir='${exec_prefix}/sbin' +-libexecdir='${exec_prefix}/libexec' +-datadir='${prefix}/share' +-sysconfdir='${prefix}/etc' +-sharedstatedir='${prefix}/com' +-localstatedir='${prefix}/var' +-libdir='${exec_prefix}/lib' +-includedir='${prefix}/include' +-oldincludedir='/usr/include' +-infodir='${prefix}/info' +-mandir='${prefix}/man' +- +-ac_prev= +-for ac_option +-do +- # If the previous option needs an argument, assign it. +- if test -n "$ac_prev"; then +- eval "$ac_prev=\$ac_option" +- ac_prev= +- continue +- fi +- +- ac_optarg=`expr "x$ac_option" : 'x[^=]*=\(.*\)'` +- +- # Accept the important Cygnus configure options, so we can diagnose typos. +- +- case $ac_option in +- +- -bindir | --bindir | --bindi | --bind | --bin | --bi) +- ac_prev=bindir ;; +- -bindir=* | --bindir=* | --bindi=* | --bind=* | --bin=* | --bi=*) +- bindir=$ac_optarg ;; +- +- -build | --build | --buil | --bui | --bu) +- ac_prev=build_alias ;; +- -build=* | --build=* | --buil=* | --bui=* | --bu=*) +- build_alias=$ac_optarg ;; +- +- -cache-file | --cache-file | --cache-fil | --cache-fi \ +- | --cache-f | --cache- | --cache | --cach | --cac | --ca | --c) +- ac_prev=cache_file ;; +- -cache-file=* | --cache-file=* | --cache-fil=* | --cache-fi=* \ +- | --cache-f=* | --cache-=* | --cache=* | --cach=* | --cac=* | --ca=* | --c=*) +- cache_file=$ac_optarg ;; +- +- --config-cache | -C) +- cache_file=config.cache ;; +- +- -datadir | --datadir | --datadi | --datad | --data | --dat | --da) +- ac_prev=datadir ;; +- -datadir=* | --datadir=* | --datadi=* | --datad=* | --data=* | --dat=* \ +- | --da=*) +- datadir=$ac_optarg ;; +- +- -disable-* | --disable-*) +- ac_feature=`expr "x$ac_option" : 'x-*disable-\(.*\)'` +- # Reject names that are not valid shell variable names. +- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && +- { echo "$as_me: error: invalid feature name: $ac_feature" >&2 +- { (exit 1); exit 1; }; } +- ac_feature=`echo $ac_feature | sed 's/-/_/g'` +- eval "enable_$ac_feature=no" ;; +- +- -enable-* | --enable-*) +- ac_feature=`expr "x$ac_option" : 'x-*enable-\([^=]*\)'` +- # Reject names that are not valid shell variable names. +- expr "x$ac_feature" : ".*[^-_$as_cr_alnum]" >/dev/null && +- { echo "$as_me: error: invalid feature name: $ac_feature" >&2 +- { (exit 1); exit 1; }; } +- ac_feature=`echo $ac_feature | sed 's/-/_/g'` +- case $ac_option in +- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; +- *) ac_optarg=yes ;; +- esac +- eval "enable_$ac_feature='$ac_optarg'" ;; +- +- -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi \ +- | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- \ +- | --exec | --exe | --ex) +- ac_prev=exec_prefix ;; +- -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* \ +- | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* \ +- | --exec=* | --exe=* | --ex=*) +- exec_prefix=$ac_optarg ;; +- +- -gas | --gas | --ga | --g) +- # Obsolete; use --with-gas. +- with_gas=yes ;; +- +- -help | --help | --hel | --he | -h) +- ac_init_help=long ;; +- -help=r* | --help=r* | --hel=r* | --he=r* | -hr*) +- ac_init_help=recursive ;; +- -help=s* | --help=s* | --hel=s* | --he=s* | -hs*) +- ac_init_help=short ;; +- +- -host | --host | --hos | --ho) +- ac_prev=host_alias ;; +- -host=* | --host=* | --hos=* | --ho=*) +- host_alias=$ac_optarg ;; +- +- -includedir | --includedir | --includedi | --included | --include \ +- | --includ | --inclu | --incl | --inc) +- ac_prev=includedir ;; +- -includedir=* | --includedir=* | --includedi=* | --included=* | --include=* \ +- | --includ=* | --inclu=* | --incl=* | --inc=*) +- includedir=$ac_optarg ;; +- +- -infodir | --infodir | --infodi | --infod | --info | --inf) +- ac_prev=infodir ;; +- -infodir=* | --infodir=* | --infodi=* | --infod=* | --info=* | --inf=*) +- infodir=$ac_optarg ;; +- +- -libdir | --libdir | --libdi | --libd) +- ac_prev=libdir ;; +- -libdir=* | --libdir=* | --libdi=* | --libd=*) +- libdir=$ac_optarg ;; +- +- -libexecdir | --libexecdir | --libexecdi | --libexecd | --libexec \ +- | --libexe | --libex | --libe) +- ac_prev=libexecdir ;; +- -libexecdir=* | --libexecdir=* | --libexecdi=* | --libexecd=* | --libexec=* \ +- | --libexe=* | --libex=* | --libe=*) +- libexecdir=$ac_optarg ;; +- +- -localstatedir | --localstatedir | --localstatedi | --localstated \ +- | --localstate | --localstat | --localsta | --localst \ +- | --locals | --local | --loca | --loc | --lo) +- ac_prev=localstatedir ;; +- -localstatedir=* | --localstatedir=* | --localstatedi=* | --localstated=* \ +- | --localstate=* | --localstat=* | --localsta=* | --localst=* \ +- | --locals=* | --local=* | --loca=* | --loc=* | --lo=*) +- localstatedir=$ac_optarg ;; +- +- -mandir | --mandir | --mandi | --mand | --man | --ma | --m) +- ac_prev=mandir ;; +- -mandir=* | --mandir=* | --mandi=* | --mand=* | --man=* | --ma=* | --m=*) +- mandir=$ac_optarg ;; +- +- -nfp | --nfp | --nf) +- # Obsolete; use --without-fp. +- with_fp=no ;; +- +- -no-create | --no-create | --no-creat | --no-crea | --no-cre \ +- | --no-cr | --no-c | -n) +- no_create=yes ;; +- +- -no-recursion | --no-recursion | --no-recursio | --no-recursi \ +- | --no-recurs | --no-recur | --no-recu | --no-rec | --no-re | --no-r) +- no_recursion=yes ;; +- +- -oldincludedir | --oldincludedir | --oldincludedi | --oldincluded \ +- | --oldinclude | --oldinclud | --oldinclu | --oldincl | --oldinc \ +- | --oldin | --oldi | --old | --ol | --o) +- ac_prev=oldincludedir ;; +- -oldincludedir=* | --oldincludedir=* | --oldincludedi=* | --oldincluded=* \ +- | --oldinclude=* | --oldinclud=* | --oldinclu=* | --oldincl=* | --oldinc=* \ +- | --oldin=* | --oldi=* | --old=* | --ol=* | --o=*) +- oldincludedir=$ac_optarg ;; +- +- -prefix | --prefix | --prefi | --pref | --pre | --pr | --p) +- ac_prev=prefix ;; +- -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*) +- prefix=$ac_optarg ;; +- +- -program-prefix | --program-prefix | --program-prefi | --program-pref \ +- | --program-pre | --program-pr | --program-p) +- ac_prev=program_prefix ;; +- -program-prefix=* | --program-prefix=* | --program-prefi=* \ +- | --program-pref=* | --program-pre=* | --program-pr=* | --program-p=*) +- program_prefix=$ac_optarg ;; +- +- -program-suffix | --program-suffix | --program-suffi | --program-suff \ +- | --program-suf | --program-su | --program-s) +- ac_prev=program_suffix ;; +- -program-suffix=* | --program-suffix=* | --program-suffi=* \ +- | --program-suff=* | --program-suf=* | --program-su=* | --program-s=*) +- program_suffix=$ac_optarg ;; +- +- -program-transform-name | --program-transform-name \ +- | --program-transform-nam | --program-transform-na \ +- | --program-transform-n | --program-transform- \ +- | --program-transform | --program-transfor \ +- | --program-transfo | --program-transf \ +- | --program-trans | --program-tran \ +- | --progr-tra | --program-tr | --program-t) +- ac_prev=program_transform_name ;; +- -program-transform-name=* | --program-transform-name=* \ +- | --program-transform-nam=* | --program-transform-na=* \ +- | --program-transform-n=* | --program-transform-=* \ +- | --program-transform=* | --program-transfor=* \ +- | --program-transfo=* | --program-transf=* \ +- | --program-trans=* | --program-tran=* \ +- | --progr-tra=* | --program-tr=* | --program-t=*) +- program_transform_name=$ac_optarg ;; +- +- -q | -quiet | --quiet | --quie | --qui | --qu | --q \ +- | -silent | --silent | --silen | --sile | --sil) +- silent=yes ;; +- +- -sbindir | --sbindir | --sbindi | --sbind | --sbin | --sbi | --sb) +- ac_prev=sbindir ;; +- -sbindir=* | --sbindir=* | --sbindi=* | --sbind=* | --sbin=* \ +- | --sbi=* | --sb=*) +- sbindir=$ac_optarg ;; +- +- -sharedstatedir | --sharedstatedir | --sharedstatedi \ +- | --sharedstated | --sharedstate | --sharedstat | --sharedsta \ +- | --sharedst | --shareds | --shared | --share | --shar \ +- | --sha | --sh) +- ac_prev=sharedstatedir ;; +- -sharedstatedir=* | --sharedstatedir=* | --sharedstatedi=* \ +- | --sharedstated=* | --sharedstate=* | --sharedstat=* | --sharedsta=* \ +- | --sharedst=* | --shareds=* | --shared=* | --share=* | --shar=* \ +- | --sha=* | --sh=*) +- sharedstatedir=$ac_optarg ;; +- +- -site | --site | --sit) +- ac_prev=site ;; +- -site=* | --site=* | --sit=*) +- site=$ac_optarg ;; +- +- -srcdir | --srcdir | --srcdi | --srcd | --src | --sr) +- ac_prev=srcdir ;; +- -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=*) +- srcdir=$ac_optarg ;; +- +- -sysconfdir | --sysconfdir | --sysconfdi | --sysconfd | --sysconf \ +- | --syscon | --sysco | --sysc | --sys | --sy) +- ac_prev=sysconfdir ;; +- -sysconfdir=* | --sysconfdir=* | --sysconfdi=* | --sysconfd=* | --sysconf=* \ +- | --syscon=* | --sysco=* | --sysc=* | --sys=* | --sy=*) +- sysconfdir=$ac_optarg ;; +- +- -target | --target | --targe | --targ | --tar | --ta | --t) +- ac_prev=target_alias ;; +- -target=* | --target=* | --targe=* | --targ=* | --tar=* | --ta=* | --t=*) +- target_alias=$ac_optarg ;; +- +- -v | -verbose | --verbose | --verbos | --verbo | --verb) +- verbose=yes ;; +- +- -version | --version | --versio | --versi | --vers | -V) +- ac_init_version=: ;; +- +- -with-* | --with-*) +- ac_package=`expr "x$ac_option" : 'x-*with-\([^=]*\)'` +- # Reject names that are not valid shell variable names. +- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && +- { echo "$as_me: error: invalid package name: $ac_package" >&2 +- { (exit 1); exit 1; }; } +- ac_package=`echo $ac_package| sed 's/-/_/g'` +- case $ac_option in +- *=*) ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"`;; +- *) ac_optarg=yes ;; +- esac +- eval "with_$ac_package='$ac_optarg'" ;; +- +- -without-* | --without-*) +- ac_package=`expr "x$ac_option" : 'x-*without-\(.*\)'` +- # Reject names that are not valid shell variable names. +- expr "x$ac_package" : ".*[^-_$as_cr_alnum]" >/dev/null && +- { echo "$as_me: error: invalid package name: $ac_package" >&2 +- { (exit 1); exit 1; }; } +- ac_package=`echo $ac_package | sed 's/-/_/g'` +- eval "with_$ac_package=no" ;; +- +- --x) +- # Obsolete; use --with-x. +- with_x=yes ;; +- +- -x-includes | --x-includes | --x-include | --x-includ | --x-inclu \ +- | --x-incl | --x-inc | --x-in | --x-i) +- ac_prev=x_includes ;; +- -x-includes=* | --x-includes=* | --x-include=* | --x-includ=* | --x-inclu=* \ +- | --x-incl=* | --x-inc=* | --x-in=* | --x-i=*) +- x_includes=$ac_optarg ;; +- +- -x-libraries | --x-libraries | --x-librarie | --x-librari \ +- | --x-librar | --x-libra | --x-libr | --x-lib | --x-li | --x-l) +- ac_prev=x_libraries ;; +- -x-libraries=* | --x-libraries=* | --x-librarie=* | --x-librari=* \ +- | --x-librar=* | --x-libra=* | --x-libr=* | --x-lib=* | --x-li=* | --x-l=*) +- x_libraries=$ac_optarg ;; +- +- -*) { echo "$as_me: error: unrecognized option: $ac_option +-Try \`$0 --help' for more information." >&2 +- { (exit 1); exit 1; }; } +- ;; +- +- *=*) +- ac_envvar=`expr "x$ac_option" : 'x\([^=]*\)='` +- # Reject names that are not valid shell variable names. +- expr "x$ac_envvar" : ".*[^_$as_cr_alnum]" >/dev/null && +- { echo "$as_me: error: invalid variable name: $ac_envvar" >&2 +- { (exit 1); exit 1; }; } +- ac_optarg=`echo "$ac_optarg" | sed "s/'/'\\\\\\\\''/g"` +- eval "$ac_envvar='$ac_optarg'" +- export $ac_envvar ;; +- +- *) +- # FIXME: should be removed in autoconf 3.0. +- echo "$as_me: WARNING: you should use --build, --host, --target" >&2 +- expr "x$ac_option" : ".*[^-._$as_cr_alnum]" >/dev/null && +- echo "$as_me: WARNING: invalid host type: $ac_option" >&2 +- : ${build_alias=$ac_option} ${host_alias=$ac_option} ${target_alias=$ac_option} +- ;; +- +- esac +-done +- +-if test -n "$ac_prev"; then +- ac_option=--`echo $ac_prev | sed 's/_/-/g'` +- { echo "$as_me: error: missing argument to $ac_option" >&2 +- { (exit 1); exit 1; }; } +-fi +- +-# Be sure to have absolute paths. +-for ac_var in exec_prefix prefix +-do +- eval ac_val=$`echo $ac_var` +- case $ac_val in +- [\\/$]* | ?:[\\/]* | NONE | '' ) ;; +- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 +- { (exit 1); exit 1; }; };; +- esac +-done +- +-# Be sure to have absolute paths. +-for ac_var in bindir sbindir libexecdir datadir sysconfdir sharedstatedir \ +- localstatedir libdir includedir oldincludedir infodir mandir +-do +- eval ac_val=$`echo $ac_var` +- case $ac_val in +- [\\/$]* | ?:[\\/]* ) ;; +- *) { echo "$as_me: error: expected an absolute directory name for --$ac_var: $ac_val" >&2 +- { (exit 1); exit 1; }; };; +- esac +-done +- +-# There might be people who depend on the old broken behavior: `$host' +-# used to hold the argument of --host etc. +-# FIXME: To remove some day. +-build=$build_alias +-host=$host_alias +-target=$target_alias +- +-# FIXME: To remove some day. +-if test "x$host_alias" != x; then +- if test "x$build_alias" = x; then +- cross_compiling=maybe +- echo "$as_me: WARNING: If you wanted to set the --build type, don't use --host. +- If a cross compiler is detected then cross compile mode will be used." >&2 +- elif test "x$build_alias" != "x$host_alias"; then +- cross_compiling=yes +- fi +-fi +- +-ac_tool_prefix= +-test -n "$host_alias" && ac_tool_prefix=$host_alias- +- +-test "$silent" = yes && exec 6>/dev/null +- +- +-# Find the source files, if location was not specified. +-if test -z "$srcdir"; then +- ac_srcdir_defaulted=yes +- # Try the directory containing this script, then its parent. +- ac_confdir=`(dirname "$0") 2>/dev/null || +-$as_expr X"$0" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$0" : 'X\(//\)[^/]' \| \ +- X"$0" : 'X\(//\)$' \| \ +- X"$0" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || +-echo X"$0" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } +- /^X\(\/\/\)[^/].*/{ s//\1/; q; } +- /^X\(\/\/\)$/{ s//\1/; q; } +- /^X\(\/\).*/{ s//\1/; q; } +- s/.*/./; q'` +- srcdir=$ac_confdir +- if test ! -r $srcdir/$ac_unique_file; then +- srcdir=.. +- fi +-else +- ac_srcdir_defaulted=no +-fi +-if test ! -r $srcdir/$ac_unique_file; then +- if test "$ac_srcdir_defaulted" = yes; then +- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $ac_confdir or .." >&2 +- { (exit 1); exit 1; }; } +- else +- { echo "$as_me: error: cannot find sources ($ac_unique_file) in $srcdir" >&2 +- { (exit 1); exit 1; }; } +- fi +-fi +-(cd $srcdir && test -r ./$ac_unique_file) 2>/dev/null || +- { echo "$as_me: error: sources are in $srcdir, but \`cd $srcdir' does not work" >&2 +- { (exit 1); exit 1; }; } +-srcdir=`echo "$srcdir" | sed 's%\([^\\/]\)[\\/]*$%\1%'` +-ac_env_build_alias_set=${build_alias+set} +-ac_env_build_alias_value=$build_alias +-ac_cv_env_build_alias_set=${build_alias+set} +-ac_cv_env_build_alias_value=$build_alias +-ac_env_host_alias_set=${host_alias+set} +-ac_env_host_alias_value=$host_alias +-ac_cv_env_host_alias_set=${host_alias+set} +-ac_cv_env_host_alias_value=$host_alias +-ac_env_target_alias_set=${target_alias+set} +-ac_env_target_alias_value=$target_alias +-ac_cv_env_target_alias_set=${target_alias+set} +-ac_cv_env_target_alias_value=$target_alias +-ac_env_CC_set=${CC+set} +-ac_env_CC_value=$CC +-ac_cv_env_CC_set=${CC+set} +-ac_cv_env_CC_value=$CC +-ac_env_CFLAGS_set=${CFLAGS+set} +-ac_env_CFLAGS_value=$CFLAGS +-ac_cv_env_CFLAGS_set=${CFLAGS+set} +-ac_cv_env_CFLAGS_value=$CFLAGS +-ac_env_LDFLAGS_set=${LDFLAGS+set} +-ac_env_LDFLAGS_value=$LDFLAGS +-ac_cv_env_LDFLAGS_set=${LDFLAGS+set} +-ac_cv_env_LDFLAGS_value=$LDFLAGS +-ac_env_CPPFLAGS_set=${CPPFLAGS+set} +-ac_env_CPPFLAGS_value=$CPPFLAGS +-ac_cv_env_CPPFLAGS_set=${CPPFLAGS+set} +-ac_cv_env_CPPFLAGS_value=$CPPFLAGS +-ac_env_CPP_set=${CPP+set} +-ac_env_CPP_value=$CPP +-ac_cv_env_CPP_set=${CPP+set} +-ac_cv_env_CPP_value=$CPP +- +-# +-# Report the --help message. +-# +-if test "$ac_init_help" = "long"; then +- # Omit some internal or obsolete options to make the list less imposing. +- # This message is too long to be a string in the A/UX 3.1 sh. +- cat <<_ACEOF +-\`configure' configures FULL-PACKAGE-NAME VERSION to adapt to many kinds of systems. +- +-Usage: $0 [OPTION]... [VAR=VALUE]... +- +-To assign environment variables (e.g., CC, CFLAGS...), specify them as +-VAR=VALUE. See below for descriptions of some of the useful variables. +- +-Defaults for the options are specified in brackets. +- +-Configuration: +- -h, --help display this help and exit +- --help=short display options specific to this package +- --help=recursive display the short help of all the included packages +- -V, --version display version information and exit +- -q, --quiet, --silent do not print \`checking...' messages +- --cache-file=FILE cache test results in FILE [disabled] +- -C, --config-cache alias for \`--cache-file=config.cache' +- -n, --no-create do not create output files +- --srcdir=DIR find the sources in DIR [configure dir or \`..'] +- +-_ACEOF +- +- cat <<_ACEOF +-Installation directories: +- --prefix=PREFIX install architecture-independent files in PREFIX +- [$ac_default_prefix] +- --exec-prefix=EPREFIX install architecture-dependent files in EPREFIX +- [PREFIX] +- +-By default, \`make install' will install all the files in +-\`$ac_default_prefix/bin', \`$ac_default_prefix/lib' etc. You can specify +-an installation prefix other than \`$ac_default_prefix' using \`--prefix', +-for instance \`--prefix=\$HOME'. +- +-For better control, use the options below. +- +-Fine tuning of the installation directories: +- --bindir=DIR user executables [EPREFIX/bin] +- --sbindir=DIR system admin executables [EPREFIX/sbin] +- --libexecdir=DIR program executables [EPREFIX/libexec] +- --datadir=DIR read-only architecture-independent data [PREFIX/share] +- --sysconfdir=DIR read-only single-machine data [PREFIX/etc] +- --sharedstatedir=DIR modifiable architecture-independent data [PREFIX/com] +- --localstatedir=DIR modifiable single-machine data [PREFIX/var] +- --libdir=DIR object code libraries [EPREFIX/lib] +- --includedir=DIR C header files [PREFIX/include] +- --oldincludedir=DIR C header files for non-gcc [/usr/include] +- --infodir=DIR info documentation [PREFIX/info] +- --mandir=DIR man documentation [PREFIX/man] +-_ACEOF +- +- cat <<\_ACEOF +-_ACEOF +-fi +- +-if test -n "$ac_init_help"; then +- case $ac_init_help in +- short | recursive ) echo "Configuration of FULL-PACKAGE-NAME VERSION:";; +- esac +- cat <<\_ACEOF +- +-Some influential environment variables: +- CC C compiler command +- CFLAGS C compiler flags +- LDFLAGS linker flags, e.g. -L<lib dir> if you have libraries in a +- nonstandard directory <lib dir> +- CPPFLAGS C/C++ preprocessor flags, e.g. -I<include dir> if you have +- headers in a nonstandard directory <include dir> +- CPP C preprocessor +- +-Use these variables to override the choices made by `configure' or to help +-it to find libraries and programs with nonstandard names/locations. +- +-Report bugs to <BUG-REPORT-ADDRESS>. +-_ACEOF +-fi +- +-if test "$ac_init_help" = "recursive"; then +- # If there are subdirs, report their specific --help. +- ac_popdir=`pwd` +- for ac_dir in : $ac_subdirs_all; do test "x$ac_dir" = x: && continue +- test -d $ac_dir || continue +- ac_builddir=. +- +-if test "$ac_dir" != .; then +- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` +- # A "../" for each directory in $ac_dir_suffix. +- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +-else +- ac_dir_suffix= ac_top_builddir= +-fi +- +-case $srcdir in +- .) # No --srcdir option. We are building in place. +- ac_srcdir=. +- if test -z "$ac_top_builddir"; then +- ac_top_srcdir=. +- else +- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` +- fi ;; +- [\\/]* | ?:[\\/]* ) # Absolute path. +- ac_srcdir=$srcdir$ac_dir_suffix; +- ac_top_srcdir=$srcdir ;; +- *) # Relative path. +- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix +- ac_top_srcdir=$ac_top_builddir$srcdir ;; +-esac +- +-# Do not use `cd foo && pwd` to compute absolute paths, because +-# the directories may not exist. +-case `pwd` in +-.) ac_abs_builddir="$ac_dir";; +-*) +- case "$ac_dir" in +- .) ac_abs_builddir=`pwd`;; +- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; +- *) ac_abs_builddir=`pwd`/"$ac_dir";; +- esac;; +-esac +-case $ac_abs_builddir in +-.) ac_abs_top_builddir=${ac_top_builddir}.;; +-*) +- case ${ac_top_builddir}. in +- .) ac_abs_top_builddir=$ac_abs_builddir;; +- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; +- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; +- esac;; +-esac +-case $ac_abs_builddir in +-.) ac_abs_srcdir=$ac_srcdir;; +-*) +- case $ac_srcdir in +- .) ac_abs_srcdir=$ac_abs_builddir;; +- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; +- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; +- esac;; +-esac +-case $ac_abs_builddir in +-.) ac_abs_top_srcdir=$ac_top_srcdir;; +-*) +- case $ac_top_srcdir in +- .) ac_abs_top_srcdir=$ac_abs_builddir;; +- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; +- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; +- esac;; +-esac +- +- cd $ac_dir +- # Check for guested configure; otherwise get Cygnus style configure. +- if test -f $ac_srcdir/configure.gnu; then +- echo +- $SHELL $ac_srcdir/configure.gnu --help=recursive +- elif test -f $ac_srcdir/configure; then +- echo +- $SHELL $ac_srcdir/configure --help=recursive +- elif test -f $ac_srcdir/configure.ac || +- test -f $ac_srcdir/configure.in; then +- echo +- $ac_configure --help +- else +- echo "$as_me: WARNING: no configuration information is in $ac_dir" >&2 +- fi +- cd "$ac_popdir" +- done +-fi +- +-test -n "$ac_init_help" && exit 0 +-if $ac_init_version; then +- cat <<\_ACEOF +-FULL-PACKAGE-NAME configure VERSION +-generated by GNU Autoconf 2.59 +- +-Copyright (C) 2003 Free Software Foundation, Inc. +-This configure script is free software; the Free Software Foundation +-gives unlimited permission to copy, distribute and modify it. +-_ACEOF +- exit 0 +-fi +-exec 5>config.log +-cat >&5 <<_ACEOF +-This file contains any messages produced by compilers while +-running configure, to aid debugging if configure makes a mistake. +- +-It was created by FULL-PACKAGE-NAME $as_me VERSION, which was +-generated by GNU Autoconf 2.59. Invocation command line was +- +- $ $0 $@ +- +-_ACEOF +-{ +-cat <<_ASUNAME +-## --------- ## +-## Platform. ## +-## --------- ## +- +-hostname = `(hostname || uname -n) 2>/dev/null | sed 1q` +-uname -m = `(uname -m) 2>/dev/null || echo unknown` +-uname -r = `(uname -r) 2>/dev/null || echo unknown` +-uname -s = `(uname -s) 2>/dev/null || echo unknown` +-uname -v = `(uname -v) 2>/dev/null || echo unknown` +- +-/usr/bin/uname -p = `(/usr/bin/uname -p) 2>/dev/null || echo unknown` +-/bin/uname -X = `(/bin/uname -X) 2>/dev/null || echo unknown` +- +-/bin/arch = `(/bin/arch) 2>/dev/null || echo unknown` +-/usr/bin/arch -k = `(/usr/bin/arch -k) 2>/dev/null || echo unknown` +-/usr/convex/getsysinfo = `(/usr/convex/getsysinfo) 2>/dev/null || echo unknown` +-hostinfo = `(hostinfo) 2>/dev/null || echo unknown` +-/bin/machine = `(/bin/machine) 2>/dev/null || echo unknown` +-/usr/bin/oslevel = `(/usr/bin/oslevel) 2>/dev/null || echo unknown` +-/bin/universe = `(/bin/universe) 2>/dev/null || echo unknown` +- +-_ASUNAME +- +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- echo "PATH: $as_dir" +-done +- +-} >&5 +- +-cat >&5 <<_ACEOF +- +- +-## ----------- ## +-## Core tests. ## +-## ----------- ## +- +-_ACEOF +- +- +-# Keep a trace of the command line. +-# Strip out --no-create and --no-recursion so they do not pile up. +-# Strip out --silent because we don't want to record it for future runs. +-# Also quote any args containing shell meta-characters. +-# Make two passes to allow for proper duplicate-argument suppression. +-ac_configure_args= +-ac_configure_args0= +-ac_configure_args1= +-ac_sep= +-ac_must_keep_next=false +-for ac_pass in 1 2 +-do +- for ac_arg +- do +- case $ac_arg in +- -no-create | --no-c* | -n | -no-recursion | --no-r*) continue ;; +- -q | -quiet | --quiet | --quie | --qui | --qu | --q \ +- | -silent | --silent | --silen | --sile | --sil) +- continue ;; +- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) +- ac_arg=`echo "$ac_arg" | sed "s/'/'\\\\\\\\''/g"` ;; +- esac +- case $ac_pass in +- 1) ac_configure_args0="$ac_configure_args0 '$ac_arg'" ;; +- 2) +- ac_configure_args1="$ac_configure_args1 '$ac_arg'" +- if test $ac_must_keep_next = true; then +- ac_must_keep_next=false # Got value, back to normal. +- else +- case $ac_arg in +- *=* | --config-cache | -C | -disable-* | --disable-* \ +- | -enable-* | --enable-* | -gas | --g* | -nfp | --nf* \ +- | -q | -quiet | --q* | -silent | --sil* | -v | -verb* \ +- | -with-* | --with-* | -without-* | --without-* | --x) +- case "$ac_configure_args0 " in +- "$ac_configure_args1"*" '$ac_arg' "* ) continue ;; +- esac +- ;; +- -* ) ac_must_keep_next=true ;; +- esac +- fi +- ac_configure_args="$ac_configure_args$ac_sep'$ac_arg'" +- # Get rid of the leading space. +- ac_sep=" " +- ;; +- esac +- done +-done +-$as_unset ac_configure_args0 || test "${ac_configure_args0+set}" != set || { ac_configure_args0=; export ac_configure_args0; } +-$as_unset ac_configure_args1 || test "${ac_configure_args1+set}" != set || { ac_configure_args1=; export ac_configure_args1; } +- +-# When interrupted or exit'd, cleanup temporary files, and complete +-# config.log. We remove comments because anyway the quotes in there +-# would cause problems or look ugly. +-# WARNING: Be sure not to use single quotes in there, as some shells, +-# such as our DU 5.0 friend, will then `close' the trap. +-trap 'exit_status=$? +- # Save into config.log some information that might help in debugging. +- { +- echo +- +- cat <<\_ASBOX +-## ---------------- ## +-## Cache variables. ## +-## ---------------- ## +-_ASBOX +- echo +- # The following way of writing the cache mishandles newlines in values, +-{ +- (set) 2>&1 | +- case `(ac_space='"'"' '"'"'; set | grep ac_space) 2>&1` in +- *ac_space=\ *) +- sed -n \ +- "s/'"'"'/'"'"'\\\\'"'"''"'"'/g; +- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='"'"'\\2'"'"'/p" +- ;; +- *) +- sed -n \ +- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" +- ;; +- esac; +-} +- echo +- +- cat <<\_ASBOX +-## ----------------- ## +-## Output variables. ## +-## ----------------- ## +-_ASBOX +- echo +- for ac_var in $ac_subst_vars +- do +- eval ac_val=$`echo $ac_var` +- echo "$ac_var='"'"'$ac_val'"'"'" +- done | sort +- echo +- +- if test -n "$ac_subst_files"; then +- cat <<\_ASBOX +-## ------------- ## +-## Output files. ## +-## ------------- ## +-_ASBOX +- echo +- for ac_var in $ac_subst_files +- do +- eval ac_val=$`echo $ac_var` +- echo "$ac_var='"'"'$ac_val'"'"'" +- done | sort +- echo +- fi +- +- if test -s confdefs.h; then +- cat <<\_ASBOX +-## ----------- ## +-## confdefs.h. ## +-## ----------- ## +-_ASBOX +- echo +- sed "/^$/d" confdefs.h | sort +- echo +- fi +- test "$ac_signal" != 0 && +- echo "$as_me: caught signal $ac_signal" +- echo "$as_me: exit $exit_status" +- } >&5 +- rm -f core *.core && +- rm -rf conftest* confdefs* conf$$* $ac_clean_files && +- exit $exit_status +- ' 0 +-for ac_signal in 1 2 13 15; do +- trap 'ac_signal='$ac_signal'; { (exit 1); exit 1; }' $ac_signal +-done +-ac_signal=0 +- +-# confdefs.h avoids OS command line length limits that DEFS can exceed. +-rm -rf conftest* confdefs.h +-# AIX cpp loses on an empty file, so make sure it contains at least a newline. +-echo >confdefs.h +- +-# Predefined preprocessor variables. +- +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_NAME "$PACKAGE_NAME" +-_ACEOF +- +- +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_TARNAME "$PACKAGE_TARNAME" +-_ACEOF +- +- +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_VERSION "$PACKAGE_VERSION" +-_ACEOF +- +- +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_STRING "$PACKAGE_STRING" +-_ACEOF +- +- +-cat >>confdefs.h <<_ACEOF +-#define PACKAGE_BUGREPORT "$PACKAGE_BUGREPORT" +-_ACEOF +- +- +-# Let the site file select an alternate cache file if it wants to. +-# Prefer explicitly selected file to automatically selected ones. +-if test -z "$CONFIG_SITE"; then +- if test "x$prefix" != xNONE; then +- CONFIG_SITE="$prefix/share/config.site $prefix/etc/config.site" +- else +- CONFIG_SITE="$ac_default_prefix/share/config.site $ac_default_prefix/etc/config.site" +- fi +-fi +-for ac_site_file in $CONFIG_SITE; do +- if test -r "$ac_site_file"; then +- { echo "$as_me:$LINENO: loading site script $ac_site_file" >&5 +-echo "$as_me: loading site script $ac_site_file" >&6;} +- sed 's/^/| /' "$ac_site_file" >&5 +- . "$ac_site_file" +- fi +-done +- +-if test -r "$cache_file"; then +- # Some versions of bash will fail to source /dev/null (special +- # files actually), so we avoid doing that. +- if test -f "$cache_file"; then +- { echo "$as_me:$LINENO: loading cache $cache_file" >&5 +-echo "$as_me: loading cache $cache_file" >&6;} +- case $cache_file in +- [\\/]* | ?:[\\/]* ) . $cache_file;; +- *) . ./$cache_file;; +- esac +- fi +-else +- { echo "$as_me:$LINENO: creating cache $cache_file" >&5 +-echo "$as_me: creating cache $cache_file" >&6;} +- >$cache_file +-fi +- +-# Check that the precious variables saved in the cache have kept the same +-# value. +-ac_cache_corrupted=false +-for ac_var in `(set) 2>&1 | +- sed -n 's/^ac_env_\([a-zA-Z_0-9]*\)_set=.*/\1/p'`; do +- eval ac_old_set=\$ac_cv_env_${ac_var}_set +- eval ac_new_set=\$ac_env_${ac_var}_set +- eval ac_old_val="\$ac_cv_env_${ac_var}_value" +- eval ac_new_val="\$ac_env_${ac_var}_value" +- case $ac_old_set,$ac_new_set in +- set,) +- { echo "$as_me:$LINENO: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&5 +-echo "$as_me: error: \`$ac_var' was set to \`$ac_old_val' in the previous run" >&2;} +- ac_cache_corrupted=: ;; +- ,set) +- { echo "$as_me:$LINENO: error: \`$ac_var' was not set in the previous run" >&5 +-echo "$as_me: error: \`$ac_var' was not set in the previous run" >&2;} +- ac_cache_corrupted=: ;; +- ,);; +- *) +- if test "x$ac_old_val" != "x$ac_new_val"; then +- { echo "$as_me:$LINENO: error: \`$ac_var' has changed since the previous run:" >&5 +-echo "$as_me: error: \`$ac_var' has changed since the previous run:" >&2;} +- { echo "$as_me:$LINENO: former value: $ac_old_val" >&5 +-echo "$as_me: former value: $ac_old_val" >&2;} +- { echo "$as_me:$LINENO: current value: $ac_new_val" >&5 +-echo "$as_me: current value: $ac_new_val" >&2;} +- ac_cache_corrupted=: +- fi;; +- esac +- # Pass precious variables to config.status. +- if test "$ac_new_set" = set; then +- case $ac_new_val in +- *" "*|*" "*|*[\[\]\~\#\$\^\&\*\(\)\{\}\\\|\;\<\>\?\"\']*) +- ac_arg=$ac_var=`echo "$ac_new_val" | sed "s/'/'\\\\\\\\''/g"` ;; +- *) ac_arg=$ac_var=$ac_new_val ;; +- esac +- case " $ac_configure_args " in +- *" '$ac_arg' "*) ;; # Avoid dups. Use of quotes ensures accuracy. +- *) ac_configure_args="$ac_configure_args '$ac_arg'" ;; +- esac +- fi +-done +-if $ac_cache_corrupted; then +- { echo "$as_me:$LINENO: error: changes in the environment can compromise the build" >&5 +-echo "$as_me: error: changes in the environment can compromise the build" >&2;} +- { { echo "$as_me:$LINENO: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&5 +-echo "$as_me: error: run \`make distclean' and/or \`rm $cache_file' and start over" >&2;} +- { (exit 1); exit 1; }; } +-fi +- +-ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- +- ac_config_headers="$ac_config_headers config.h" +- +- +-# Checks for programs. +-ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +-if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}gcc", so it can be a program name with args. +-set dummy ${ac_tool_prefix}gcc; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$CC"; then +- ac_cv_prog_CC="$CC" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_CC="${ac_tool_prefix}gcc" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-fi +-fi +-CC=$ac_cv_prog_CC +-if test -n "$CC"; then +- echo "$as_me:$LINENO: result: $CC" >&5 +-echo "${ECHO_T}$CC" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +-fi +-if test -z "$ac_cv_prog_CC"; then +- ac_ct_CC=$CC +- # Extract the first word of "gcc", so it can be a program name with args. +-set dummy gcc; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$ac_ct_CC"; then +- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_ac_ct_CC="gcc" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-fi +-fi +-ac_ct_CC=$ac_cv_prog_ac_ct_CC +-if test -n "$ac_ct_CC"; then +- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +-echo "${ECHO_T}$ac_ct_CC" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +- CC=$ac_ct_CC +-else +- CC="$ac_cv_prog_CC" +-fi +- +-if test -z "$CC"; then +- if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}cc", so it can be a program name with args. +-set dummy ${ac_tool_prefix}cc; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$CC"; then +- ac_cv_prog_CC="$CC" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_CC="${ac_tool_prefix}cc" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-fi +-fi +-CC=$ac_cv_prog_CC +-if test -n "$CC"; then +- echo "$as_me:$LINENO: result: $CC" >&5 +-echo "${ECHO_T}$CC" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +-fi +-if test -z "$ac_cv_prog_CC"; then +- ac_ct_CC=$CC +- # Extract the first word of "cc", so it can be a program name with args. +-set dummy cc; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$ac_ct_CC"; then +- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_ac_ct_CC="cc" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-fi +-fi +-ac_ct_CC=$ac_cv_prog_ac_ct_CC +-if test -n "$ac_ct_CC"; then +- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +-echo "${ECHO_T}$ac_ct_CC" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +- CC=$ac_ct_CC +-else +- CC="$ac_cv_prog_CC" +-fi +- +-fi +-if test -z "$CC"; then +- # Extract the first word of "cc", so it can be a program name with args. +-set dummy cc; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$CC"; then +- ac_cv_prog_CC="$CC" # Let the user override the test. +-else +- ac_prog_rejected=no +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- if test "$as_dir/$ac_word$ac_exec_ext" = "/usr/ucb/cc"; then +- ac_prog_rejected=yes +- continue +- fi +- ac_cv_prog_CC="cc" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-if test $ac_prog_rejected = yes; then +- # We found a bogon in the path, so make sure we never use it. +- set dummy $ac_cv_prog_CC +- shift +- if test $# != 0; then +- # We chose a different compiler from the bogus one. +- # However, it has the same basename, so the bogon will be chosen +- # first if we set CC to just the basename; use the full file name. +- shift +- ac_cv_prog_CC="$as_dir/$ac_word${1+' '}$@" +- fi +-fi +-fi +-fi +-CC=$ac_cv_prog_CC +-if test -n "$CC"; then +- echo "$as_me:$LINENO: result: $CC" >&5 +-echo "${ECHO_T}$CC" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +-fi +-if test -z "$CC"; then +- if test -n "$ac_tool_prefix"; then +- for ac_prog in cl +- do +- # Extract the first word of "$ac_tool_prefix$ac_prog", so it can be a program name with args. +-set dummy $ac_tool_prefix$ac_prog; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$CC"; then +- ac_cv_prog_CC="$CC" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_CC="$ac_tool_prefix$ac_prog" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-fi +-fi +-CC=$ac_cv_prog_CC +-if test -n "$CC"; then +- echo "$as_me:$LINENO: result: $CC" >&5 +-echo "${ECHO_T}$CC" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +- test -n "$CC" && break +- done +-fi +-if test -z "$CC"; then +- ac_ct_CC=$CC +- for ac_prog in cl +-do +- # Extract the first word of "$ac_prog", so it can be a program name with args. +-set dummy $ac_prog; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_ac_ct_CC+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$ac_ct_CC"; then +- ac_cv_prog_ac_ct_CC="$ac_ct_CC" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_ac_ct_CC="$ac_prog" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-fi +-fi +-ac_ct_CC=$ac_cv_prog_ac_ct_CC +-if test -n "$ac_ct_CC"; then +- echo "$as_me:$LINENO: result: $ac_ct_CC" >&5 +-echo "${ECHO_T}$ac_ct_CC" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +- test -n "$ac_ct_CC" && break +-done +- +- CC=$ac_ct_CC +-fi +- +-fi +- +- +-test -z "$CC" && { { echo "$as_me:$LINENO: error: no acceptable C compiler found in \$PATH +-See \`config.log' for more details." >&5 +-echo "$as_me: error: no acceptable C compiler found in \$PATH +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +- +-# Provide some information about the compiler. +-echo "$as_me:$LINENO:" \ +- "checking for C compiler version" >&5 +-ac_compiler=`set X $ac_compile; echo $2` +-{ (eval echo "$as_me:$LINENO: \"$ac_compiler --version </dev/null >&5\"") >&5 +- (eval $ac_compiler --version </dev/null >&5) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } +-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -v </dev/null >&5\"") >&5 +- (eval $ac_compiler -v </dev/null >&5) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } +-{ (eval echo "$as_me:$LINENO: \"$ac_compiler -V </dev/null >&5\"") >&5 +- (eval $ac_compiler -V </dev/null >&5) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } +- +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-ac_clean_files_save=$ac_clean_files +-ac_clean_files="$ac_clean_files a.out a.exe b.out" +-# Try to create an executable without -o first, disregard a.out. +-# It will help us diagnose broken compilers, and finding out an intuition +-# of exeext. +-echo "$as_me:$LINENO: checking for C compiler default output file name" >&5 +-echo $ECHO_N "checking for C compiler default output file name... $ECHO_C" >&6 +-ac_link_default=`echo "$ac_link" | sed 's/ -o *conftest[^ ]*//'` +-if { (eval echo "$as_me:$LINENO: \"$ac_link_default\"") >&5 +- (eval $ac_link_default) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then +- # Find the output, starting from the most likely. This scheme is +-# not robust to junk in `.', hence go to wildcards (a.*) only as a last +-# resort. +- +-# Be careful to initialize this variable, since it used to be cached. +-# Otherwise an old cache value of `no' led to `EXEEXT = no' in a Makefile. +-ac_cv_exeext= +-# b.out is created by i960 compilers. +-for ac_file in a_out.exe a.exe conftest.exe a.out conftest a.* conftest.* b.out +-do +- test -f "$ac_file" || continue +- case $ac_file in +- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) +- ;; +- conftest.$ac_ext ) +- # This is the source file. +- ;; +- [ab].out ) +- # We found the default executable, but exeext='' is most +- # certainly right. +- break;; +- *.* ) +- ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` +- # FIXME: I believe we export ac_cv_exeext for Libtool, +- # but it would be cool to find out if it's true. Does anybody +- # maintain Libtool? --akim. +- export ac_cv_exeext +- break;; +- * ) +- break;; +- esac +-done +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-{ { echo "$as_me:$LINENO: error: C compiler cannot create executables +-See \`config.log' for more details." >&5 +-echo "$as_me: error: C compiler cannot create executables +-See \`config.log' for more details." >&2;} +- { (exit 77); exit 77; }; } +-fi +- +-ac_exeext=$ac_cv_exeext +-echo "$as_me:$LINENO: result: $ac_file" >&5 +-echo "${ECHO_T}$ac_file" >&6 +- +-# Check the compiler produces executables we can run. If not, either +-# the compiler is broken, or we cross compile. +-echo "$as_me:$LINENO: checking whether the C compiler works" >&5 +-echo $ECHO_N "checking whether the C compiler works... $ECHO_C" >&6 +-# FIXME: These cross compiler hacks should be removed for Autoconf 3.0 +-# If not cross compiling, check that we can run a simple program. +-if test "$cross_compiling" != yes; then +- if { ac_try='./$ac_file' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- cross_compiling=no +- else +- if test "$cross_compiling" = maybe; then +- cross_compiling=yes +- else +- { { echo "$as_me:$LINENO: error: cannot run C compiled programs. +-If you meant to cross compile, use \`--host'. +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot run C compiled programs. +-If you meant to cross compile, use \`--host'. +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +- fi +- fi +-fi +-echo "$as_me:$LINENO: result: yes" >&5 +-echo "${ECHO_T}yes" >&6 +- +-rm -f a.out a.exe conftest$ac_cv_exeext b.out +-ac_clean_files=$ac_clean_files_save +-# Check the compiler produces executables we can run. If not, either +-# the compiler is broken, or we cross compile. +-echo "$as_me:$LINENO: checking whether we are cross compiling" >&5 +-echo $ECHO_N "checking whether we are cross compiling... $ECHO_C" >&6 +-echo "$as_me:$LINENO: result: $cross_compiling" >&5 +-echo "${ECHO_T}$cross_compiling" >&6 +- +-echo "$as_me:$LINENO: checking for suffix of executables" >&5 +-echo $ECHO_N "checking for suffix of executables... $ECHO_C" >&6 +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then +- # If both `conftest.exe' and `conftest' are `present' (well, observable) +-# catch `conftest.exe'. For instance with Cygwin, `ls conftest' will +-# work properly (i.e., refer to `conftest.exe'), while it won't with +-# `rm'. +-for ac_file in conftest.exe conftest conftest.*; do +- test -f "$ac_file" || continue +- case $ac_file in +- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg | *.o | *.obj ) ;; +- *.* ) ac_cv_exeext=`expr "$ac_file" : '[^.]*\(\..*\)'` +- export ac_cv_exeext +- break;; +- * ) break;; +- esac +-done +-else +- { { echo "$as_me:$LINENO: error: cannot compute suffix of executables: cannot compile and link +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot compute suffix of executables: cannot compile and link +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-fi +- +-rm -f conftest$ac_cv_exeext +-echo "$as_me:$LINENO: result: $ac_cv_exeext" >&5 +-echo "${ECHO_T}$ac_cv_exeext" >&6 +- +-rm -f conftest.$ac_ext +-EXEEXT=$ac_cv_exeext +-ac_exeext=$EXEEXT +-echo "$as_me:$LINENO: checking for suffix of object files" >&5 +-echo $ECHO_N "checking for suffix of object files... $ECHO_C" >&6 +-if test "${ac_cv_objext+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.o conftest.obj +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; then +- for ac_file in `(ls conftest.o conftest.obj; ls conftest.*) 2>/dev/null`; do +- case $ac_file in +- *.$ac_ext | *.xcoff | *.tds | *.d | *.pdb | *.xSYM | *.bb | *.bbg ) ;; +- *) ac_cv_objext=`expr "$ac_file" : '.*\.\(.*\)'` +- break;; +- esac +-done +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-{ { echo "$as_me:$LINENO: error: cannot compute suffix of object files: cannot compile +-See \`config.log' for more details." >&5 +-echo "$as_me: error: cannot compute suffix of object files: cannot compile +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-fi +- +-rm -f conftest.$ac_cv_objext conftest.$ac_ext +-fi +-echo "$as_me:$LINENO: result: $ac_cv_objext" >&5 +-echo "${ECHO_T}$ac_cv_objext" >&6 +-OBJEXT=$ac_cv_objext +-ac_objext=$OBJEXT +-echo "$as_me:$LINENO: checking whether we are using the GNU C compiler" >&5 +-echo $ECHO_N "checking whether we are using the GNU C compiler... $ECHO_C" >&6 +-if test "${ac_cv_c_compiler_gnu+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-int +-main () +-{ +-#ifndef __GNUC__ +- choke me +-#endif +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_compiler_gnu=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_compiler_gnu=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-ac_cv_c_compiler_gnu=$ac_compiler_gnu +- +-fi +-echo "$as_me:$LINENO: result: $ac_cv_c_compiler_gnu" >&5 +-echo "${ECHO_T}$ac_cv_c_compiler_gnu" >&6 +-GCC=`test $ac_compiler_gnu = yes && echo yes` +-ac_test_CFLAGS=${CFLAGS+set} +-ac_save_CFLAGS=$CFLAGS +-CFLAGS="-g" +-echo "$as_me:$LINENO: checking whether $CC accepts -g" >&5 +-echo $ECHO_N "checking whether $CC accepts -g... $ECHO_C" >&6 +-if test "${ac_cv_prog_cc_g+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_prog_cc_g=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_prog_cc_g=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-echo "$as_me:$LINENO: result: $ac_cv_prog_cc_g" >&5 +-echo "${ECHO_T}$ac_cv_prog_cc_g" >&6 +-if test "$ac_test_CFLAGS" = set; then +- CFLAGS=$ac_save_CFLAGS +-elif test $ac_cv_prog_cc_g = yes; then +- if test "$GCC" = yes; then +- CFLAGS="-g -O2" +- else +- CFLAGS="-g" +- fi +-else +- if test "$GCC" = yes; then +- CFLAGS="-O2" +- else +- CFLAGS= +- fi +-fi +-echo "$as_me:$LINENO: checking for $CC option to accept ANSI C" >&5 +-echo $ECHO_N "checking for $CC option to accept ANSI C... $ECHO_C" >&6 +-if test "${ac_cv_prog_cc_stdc+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- ac_cv_prog_cc_stdc=no +-ac_save_CC=$CC +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <stdarg.h> +-#include <stdio.h> +-#include <sys/types.h> +-#include <sys/stat.h> +-/* Most of the following tests are stolen from RCS 5.7's src/conf.sh. */ +-struct buf { int x; }; +-FILE * (*rcsopen) (struct buf *, struct stat *, int); +-static char *e (p, i) +- char **p; +- int i; +-{ +- return p[i]; +-} +-static char *f (char * (*g) (char **, int), char **p, ...) +-{ +- char *s; +- va_list v; +- va_start (v,p); +- s = g (p, va_arg (v,int)); +- va_end (v); +- return s; +-} +- +-/* OSF 4.0 Compaq cc is some sort of almost-ANSI by default. It has +- function prototypes and stuff, but not '\xHH' hex character constants. +- These don't provoke an error unfortunately, instead are silently treated +- as 'x'. The following induces an error, until -std1 is added to get +- proper ANSI mode. Curiously '\x00'!='x' always comes out true, for an +- array size at least. It's necessary to write '\x00'==0 to get something +- that's true only with -std1. */ +-int osf4_cc_array ['\x00' == 0 ? 1 : -1]; +- +-int test (int i, double x); +-struct s1 {int (*f) (int a);}; +-struct s2 {int (*f) (double a);}; +-int pairnames (int, char **, FILE *(*)(struct buf *, struct stat *, int), int, int); +-int argc; +-char **argv; +-int +-main () +-{ +-return f (e, argv, 0) != argv[0] || f (e, argv, 1) != argv[1]; +- ; +- return 0; +-} +-_ACEOF +-# Don't try gcc -ansi; that turns off useful extensions and +-# breaks some systems' header files. +-# AIX -qlanglvl=ansi +-# Ultrix and OSF/1 -std1 +-# HP-UX 10.20 and later -Ae +-# HP-UX older versions -Aa -D_HPUX_SOURCE +-# SVR4 -Xc -D__EXTENSIONS__ +-for ac_arg in "" -qlanglvl=ansi -std1 -Ae "-Aa -D_HPUX_SOURCE" "-Xc -D__EXTENSIONS__" +-do +- CC="$ac_save_CC $ac_arg" +- rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_prog_cc_stdc=$ac_arg +-break +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-fi +-rm -f conftest.err conftest.$ac_objext +-done +-rm -f conftest.$ac_ext conftest.$ac_objext +-CC=$ac_save_CC +- +-fi +- +-case "x$ac_cv_prog_cc_stdc" in +- x|xno) +- echo "$as_me:$LINENO: result: none needed" >&5 +-echo "${ECHO_T}none needed" >&6 ;; +- *) +- echo "$as_me:$LINENO: result: $ac_cv_prog_cc_stdc" >&5 +-echo "${ECHO_T}$ac_cv_prog_cc_stdc" >&6 +- CC="$CC $ac_cv_prog_cc_stdc" ;; +-esac +- +-# Some people use a C++ compiler to compile C. Since we use `exit', +-# in C++ we need to declare it. In case someone uses the same compiler +-# for both compiling C and C++ we need to have the C++ compiler decide +-# the declaration of exit, since it's the most demanding environment. +-cat >conftest.$ac_ext <<_ACEOF +-#ifndef __cplusplus +- choke me +-#endif +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- for ac_declaration in \ +- '' \ +- 'extern "C" void std::exit (int) throw (); using std::exit;' \ +- 'extern "C" void std::exit (int); using std::exit;' \ +- 'extern "C" void exit (int) throw ();' \ +- 'extern "C" void exit (int);' \ +- 'void exit (int);' +-do +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_declaration +-#include <stdlib.h> +-int +-main () +-{ +-exit (42); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-continue +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_declaration +-int +-main () +-{ +-exit (42); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- break +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-done +-rm -f conftest* +-if test -n "$ac_declaration"; then +- echo '#ifdef __cplusplus' >>confdefs.h +- echo $ac_declaration >>confdefs.h +- echo '#endif' >>confdefs.h +-fi +- +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +- +- +-# Checks for libraries. +- +-# Checks for header files. +- +-ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +-echo "$as_me:$LINENO: checking how to run the C preprocessor" >&5 +-echo $ECHO_N "checking how to run the C preprocessor... $ECHO_C" >&6 +-# On Suns, sometimes $CPP names a directory. +-if test -n "$CPP" && test -d "$CPP"; then +- CPP= +-fi +-if test -z "$CPP"; then +- if test "${ac_cv_prog_CPP+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- # Double quotes because CPP needs to be expanded +- for CPP in "$CC -E" "$CC -E -traditional-cpp" "/lib/cpp" +- do +- ac_preproc_ok=false +-for ac_c_preproc_warn_flag in '' yes +-do +- # Use a header file that comes with gcc, so configuring glibc +- # with a fresh cross-compiler works. +- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since +- # <limits.h> exists even on freestanding compilers. +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#ifdef __STDC__ +-# include <limits.h> +-#else +-# include <assert.h> +-#endif +- Syntax error +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- : +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- # Broken: fails on valid input. +-continue +-fi +-rm -f conftest.err conftest.$ac_ext +- +- # OK, works on sane cases. Now check whether non-existent headers +- # can be detected and how. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <ac_nonexistent.h> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- # Broken: success on invalid input. +-continue +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- # Passes both tests. +-ac_preproc_ok=: +-break +-fi +-rm -f conftest.err conftest.$ac_ext +- +-done +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then +- break +-fi +- +- done +- ac_cv_prog_CPP=$CPP +- +-fi +- CPP=$ac_cv_prog_CPP +-else +- ac_cv_prog_CPP=$CPP +-fi +-echo "$as_me:$LINENO: result: $CPP" >&5 +-echo "${ECHO_T}$CPP" >&6 +-ac_preproc_ok=false +-for ac_c_preproc_warn_flag in '' yes +-do +- # Use a header file that comes with gcc, so configuring glibc +- # with a fresh cross-compiler works. +- # Prefer <limits.h> to <assert.h> if __STDC__ is defined, since +- # <limits.h> exists even on freestanding compilers. +- # On the NeXT, cc -E runs the code through the compiler's parser, +- # not just through cpp. "Syntax error" is here to catch this case. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#ifdef __STDC__ +-# include <limits.h> +-#else +-# include <assert.h> +-#endif +- Syntax error +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- : +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- # Broken: fails on valid input. +-continue +-fi +-rm -f conftest.err conftest.$ac_ext +- +- # OK, works on sane cases. Now check whether non-existent headers +- # can be detected and how. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <ac_nonexistent.h> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- # Broken: success on invalid input. +-continue +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- # Passes both tests. +-ac_preproc_ok=: +-break +-fi +-rm -f conftest.err conftest.$ac_ext +- +-done +-# Because of `break', _AC_PREPROC_IFELSE's cleaning code was skipped. +-rm -f conftest.err conftest.$ac_ext +-if $ac_preproc_ok; then +- : +-else +- { { echo "$as_me:$LINENO: error: C preprocessor \"$CPP\" fails sanity check +-See \`config.log' for more details." >&5 +-echo "$as_me: error: C preprocessor \"$CPP\" fails sanity check +-See \`config.log' for more details." >&2;} +- { (exit 1); exit 1; }; } +-fi +- +-ac_ext=c +-ac_cpp='$CPP $CPPFLAGS' +-ac_compile='$CC -c $CFLAGS $CPPFLAGS conftest.$ac_ext >&5' +-ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $LIBS >&5' +-ac_compiler_gnu=$ac_cv_c_compiler_gnu +- +- +-echo "$as_me:$LINENO: checking for egrep" >&5 +-echo $ECHO_N "checking for egrep... $ECHO_C" >&6 +-if test "${ac_cv_prog_egrep+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if echo a | (grep -E '(a|b)') >/dev/null 2>&1 +- then ac_cv_prog_egrep='grep -E' +- else ac_cv_prog_egrep='egrep' +- fi +-fi +-echo "$as_me:$LINENO: result: $ac_cv_prog_egrep" >&5 +-echo "${ECHO_T}$ac_cv_prog_egrep" >&6 +- EGREP=$ac_cv_prog_egrep +- +- +-echo "$as_me:$LINENO: checking for ANSI C header files" >&5 +-echo $ECHO_N "checking for ANSI C header files... $ECHO_C" >&6 +-if test "${ac_cv_header_stdc+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <stdlib.h> +-#include <stdarg.h> +-#include <string.h> +-#include <float.h> +- +-int +-main () +-{ +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_header_stdc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_header_stdc=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +- +-if test $ac_cv_header_stdc = yes; then +- # SunOS 4.x string.h does not declare mem*, contrary to ANSI. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <string.h> +- +-_ACEOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "memchr" >/dev/null 2>&1; then +- : +-else +- ac_cv_header_stdc=no +-fi +-rm -f conftest* +- +-fi +- +-if test $ac_cv_header_stdc = yes; then +- # ISC 2.0.2 stdlib.h does not declare free, contrary to ANSI. +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <stdlib.h> +- +-_ACEOF +-if (eval "$ac_cpp conftest.$ac_ext") 2>&5 | +- $EGREP "free" >/dev/null 2>&1; then +- : +-else +- ac_cv_header_stdc=no +-fi +-rm -f conftest* +- +-fi +- +-if test $ac_cv_header_stdc = yes; then +- # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. +- if test "$cross_compiling" = yes; then +- : +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <ctype.h> +-#if ((' ' & 0x0FF) == 0x020) +-# define ISLOWER(c) ('a' <= (c) && (c) <= 'z') +-# define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) +-#else +-# define ISLOWER(c) \ +- (('a' <= (c) && (c) <= 'i') \ +- || ('j' <= (c) && (c) <= 'r') \ +- || ('s' <= (c) && (c) <= 'z')) +-# define TOUPPER(c) (ISLOWER(c) ? ((c) | 0x40) : (c)) +-#endif +- +-#define XOR(e, f) (((e) && !(f)) || (!(e) && (f))) +-int +-main () +-{ +- int i; +- for (i = 0; i < 256; i++) +- if (XOR (islower (i), ISLOWER (i)) +- || toupper (i) != TOUPPER (i)) +- exit(2); +- exit (0); +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- : +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_header_stdc=no +-fi +-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +-fi +-fi +-echo "$as_me:$LINENO: result: $ac_cv_header_stdc" >&5 +-echo "${ECHO_T}$ac_cv_header_stdc" >&6 +-if test $ac_cv_header_stdc = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define STDC_HEADERS 1 +-_ACEOF +- +-fi +- +-# On IRIX 5.3, sys/types and inttypes.h are conflicting. +- +- +- +- +- +- +- +- +- +-for ac_header in sys/types.h sys/stat.h stdlib.h string.h memory.h strings.h \ +- inttypes.h stdint.h unistd.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +- +-#include <$ac_header> +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- eval "$as_ac_Header=yes" +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-eval "$as_ac_Header=no" +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +-if test `eval echo '${'$as_ac_Header'}'` = yes; then +- cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +- +-done +- +- +- +-for ac_header in arpa/inet.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +-else +- # Is the header compilable? +-echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_header_compiler=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6 +- +-# Is the header present? +-echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <$ac_header> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +-rm -f conftest.err conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6 +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- ( +- cat <<\_ASBOX +-## --------------------------------- ## +-## Report this to BUG-REPORT-ADDRESS ## +-## --------------------------------- ## +-_ASBOX +- ) | +- sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +- +-fi +-if test `eval echo '${'$as_ac_Header'}'` = yes; then +- cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +- +-done +- +- +-# Checks for typedefs, structures, and compiler characteristics. +-echo "$as_me:$LINENO: checking for an ANSI C-conforming const" >&5 +-echo $ECHO_N "checking for an ANSI C-conforming const... $ECHO_C" >&6 +-if test "${ac_cv_c_const+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +- +-int +-main () +-{ +-/* FIXME: Include the comments suggested by Paul. */ +-#ifndef __cplusplus +- /* Ultrix mips cc rejects this. */ +- typedef int charset[2]; +- const charset x; +- /* SunOS 4.1.1 cc rejects this. */ +- char const *const *ccp; +- char **p; +- /* NEC SVR4.0.2 mips cc rejects this. */ +- struct point {int x, y;}; +- static struct point const zero = {0,0}; +- /* AIX XL C 1.02.0.0 rejects this. +- It does not let you subtract one const X* pointer from another in +- an arm of an if-expression whose if-part is not a constant +- expression */ +- const char *g = "string"; +- ccp = &g + (g ? g-g : 0); +- /* HPUX 7.0 cc rejects these. */ +- ++ccp; +- p = (char**) ccp; +- ccp = (char const *const *) p; +- { /* SCO 3.2v4 cc rejects this. */ +- char *t; +- char const *s = 0 ? (char *) 0 : (char const *) 0; +- +- *t++ = 0; +- } +- { /* Someone thinks the Sun supposedly-ANSI compiler will reject this. */ +- int x[] = {25, 17}; +- const int *foo = &x[0]; +- ++foo; +- } +- { /* Sun SC1.0 ANSI compiler rejects this -- but not the above. */ +- typedef const int *iptr; +- iptr p = 0; +- ++p; +- } +- { /* AIX XL C 1.02.0.0 rejects this saying +- "k.c", line 2.27: 1506-025 (S) Operand must be a modifiable lvalue. */ +- struct s { int j; const int *ap[3]; }; +- struct s *b; b->j = 5; +- } +- { /* ULTRIX-32 V3.1 (Rev 9) vcc rejects this */ +- const int foo = 10; +- } +-#endif +- +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_c_const=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_cv_c_const=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-fi +-echo "$as_me:$LINENO: result: $ac_cv_c_const" >&5 +-echo "${ECHO_T}$ac_cv_c_const" >&6 +-if test $ac_cv_c_const = no; then +- +-cat >>confdefs.h <<\_ACEOF +-#define const +-_ACEOF +- +-fi +- +- +-# Checks for library functions. +- +-for ac_header in stdlib.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +-else +- # Is the header compilable? +-echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_header_compiler=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6 +- +-# Is the header present? +-echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <$ac_header> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +-rm -f conftest.err conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6 +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- ( +- cat <<\_ASBOX +-## --------------------------------- ## +-## Report this to BUG-REPORT-ADDRESS ## +-## --------------------------------- ## +-_ASBOX +- ) | +- sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +- +-fi +-if test `eval echo '${'$as_ac_Header'}'` = yes; then +- cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +- +-done +- +-echo "$as_me:$LINENO: checking for GNU libc compatible malloc" >&5 +-echo $ECHO_N "checking for GNU libc compatible malloc... $ECHO_C" >&6 +-if test "${ac_cv_func_malloc_0_nonnull+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_func_malloc_0_nonnull=no +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#if STDC_HEADERS || HAVE_STDLIB_H +-# include <stdlib.h> +-#else +-char *malloc (); +-#endif +- +-int +-main () +-{ +-exit (malloc (0) ? 0 : 1); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_func_malloc_0_nonnull=yes +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_func_malloc_0_nonnull=no +-fi +-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +-fi +-echo "$as_me:$LINENO: result: $ac_cv_func_malloc_0_nonnull" >&5 +-echo "${ECHO_T}$ac_cv_func_malloc_0_nonnull" >&6 +-if test $ac_cv_func_malloc_0_nonnull = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_MALLOC 1 +-_ACEOF +- +-else +- cat >>confdefs.h <<\_ACEOF +-#define HAVE_MALLOC 0 +-_ACEOF +- +- case $LIBOBJS in +- "malloc.$ac_objext" | \ +- *" malloc.$ac_objext" | \ +- "malloc.$ac_objext "* | \ +- *" malloc.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS malloc.$ac_objext" ;; +-esac +- +- +-cat >>confdefs.h <<\_ACEOF +-#define malloc rpl_malloc +-_ACEOF +- +-fi +- +- +- +- +-for ac_header in stdlib.h +-do +-as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +-else +- # Is the header compilable? +-echo "$as_me:$LINENO: checking $ac_header usability" >&5 +-echo $ECHO_N "checking $ac_header usability... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-$ac_includes_default +-#include <$ac_header> +-_ACEOF +-rm -f conftest.$ac_objext +-if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 +- (eval $ac_compile) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest.$ac_objext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_header_compiler=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-ac_header_compiler=no +-fi +-rm -f conftest.err conftest.$ac_objext conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_compiler" >&5 +-echo "${ECHO_T}$ac_header_compiler" >&6 +- +-# Is the header present? +-echo "$as_me:$LINENO: checking $ac_header presence" >&5 +-echo $ECHO_N "checking $ac_header presence... $ECHO_C" >&6 +-cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#include <$ac_header> +-_ACEOF +-if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 +- (eval $ac_cpp conftest.$ac_ext) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } >/dev/null; then +- if test -s conftest.err; then +- ac_cpp_err=$ac_c_preproc_warn_flag +- ac_cpp_err=$ac_cpp_err$ac_c_werror_flag +- else +- ac_cpp_err= +- fi +-else +- ac_cpp_err=yes +-fi +-if test -z "$ac_cpp_err"; then +- ac_header_preproc=yes +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +- ac_header_preproc=no +-fi +-rm -f conftest.err conftest.$ac_ext +-echo "$as_me:$LINENO: result: $ac_header_preproc" >&5 +-echo "${ECHO_T}$ac_header_preproc" >&6 +- +-# So? What about this header? +-case $ac_header_compiler:$ac_header_preproc:$ac_c_preproc_warn_flag in +- yes:no: ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&5 +-echo "$as_me: WARNING: $ac_header: accepted by the compiler, rejected by the preprocessor!" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the compiler's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the compiler's result" >&2;} +- ac_header_preproc=yes +- ;; +- no:yes:* ) +- { echo "$as_me:$LINENO: WARNING: $ac_header: present but cannot be compiled" >&5 +-echo "$as_me: WARNING: $ac_header: present but cannot be compiled" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: check for missing prerequisite headers?" >&5 +-echo "$as_me: WARNING: $ac_header: check for missing prerequisite headers?" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: see the Autoconf documentation" >&5 +-echo "$as_me: WARNING: $ac_header: see the Autoconf documentation" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&5 +-echo "$as_me: WARNING: $ac_header: section \"Present But Cannot Be Compiled\"" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: proceeding with the preprocessor's result" >&5 +-echo "$as_me: WARNING: $ac_header: proceeding with the preprocessor's result" >&2;} +- { echo "$as_me:$LINENO: WARNING: $ac_header: in the future, the compiler will take precedence" >&5 +-echo "$as_me: WARNING: $ac_header: in the future, the compiler will take precedence" >&2;} +- ( +- cat <<\_ASBOX +-## --------------------------------- ## +-## Report this to BUG-REPORT-ADDRESS ## +-## --------------------------------- ## +-_ASBOX +- ) | +- sed "s/^/$as_me: WARNING: /" >&2 +- ;; +-esac +-echo "$as_me:$LINENO: checking for $ac_header" >&5 +-echo $ECHO_N "checking for $ac_header... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_Header+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- eval "$as_ac_Header=\$ac_header_preproc" +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_Header'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_Header'}'`" >&6 +- +-fi +-if test `eval echo '${'$as_ac_Header'}'` = yes; then +- cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_header" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +- +-done +- +-echo "$as_me:$LINENO: checking for GNU libc compatible realloc" >&5 +-echo $ECHO_N "checking for GNU libc compatible realloc... $ECHO_C" >&6 +-if test "${ac_cv_func_realloc_0_nonnull+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test "$cross_compiling" = yes; then +- ac_cv_func_realloc_0_nonnull=no +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-#if STDC_HEADERS || HAVE_STDLIB_H +-# include <stdlib.h> +-#else +-char *realloc (); +-#endif +- +-int +-main () +-{ +-exit (realloc (0, 0) ? 0 : 1); +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && { ac_try='./conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- ac_cv_func_realloc_0_nonnull=yes +-else +- echo "$as_me: program exited with status $ac_status" >&5 +-echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-( exit $ac_status ) +-ac_cv_func_realloc_0_nonnull=no +-fi +-rm -f core *.core gmon.out bb.out conftest$ac_exeext conftest.$ac_objext conftest.$ac_ext +-fi +-fi +-echo "$as_me:$LINENO: result: $ac_cv_func_realloc_0_nonnull" >&5 +-echo "${ECHO_T}$ac_cv_func_realloc_0_nonnull" >&6 +-if test $ac_cv_func_realloc_0_nonnull = yes; then +- +-cat >>confdefs.h <<\_ACEOF +-#define HAVE_REALLOC 1 +-_ACEOF +- +-else +- cat >>confdefs.h <<\_ACEOF +-#define HAVE_REALLOC 0 +-_ACEOF +- +- case $LIBOBJS in +- "realloc.$ac_objext" | \ +- *" realloc.$ac_objext" | \ +- "realloc.$ac_objext "* | \ +- *" realloc.$ac_objext "* ) ;; +- *) LIBOBJS="$LIBOBJS realloc.$ac_objext" ;; +-esac +- +- +-cat >>confdefs.h <<\_ACEOF +-#define realloc rpl_realloc +-_ACEOF +- +-fi +- +- +- +- +- +-for ac_func in strdup strerror +-do +-as_ac_var=`echo "ac_cv_func_$ac_func" | $as_tr_sh` +-echo "$as_me:$LINENO: checking for $ac_func" >&5 +-echo $ECHO_N "checking for $ac_func... $ECHO_C" >&6 +-if eval "test \"\${$as_ac_var+set}\" = set"; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- cat >conftest.$ac_ext <<_ACEOF +-/* confdefs.h. */ +-_ACEOF +-cat confdefs.h >>conftest.$ac_ext +-cat >>conftest.$ac_ext <<_ACEOF +-/* end confdefs.h. */ +-/* Define $ac_func to an innocuous variant, in case <limits.h> declares $ac_func. +- For example, HP-UX 11i <limits.h> declares gettimeofday. */ +-#define $ac_func innocuous_$ac_func +- +-/* System header to define __stub macros and hopefully few prototypes, +- which can conflict with char $ac_func (); below. +- Prefer <limits.h> to <assert.h> if __STDC__ is defined, since +- <limits.h> exists even on freestanding compilers. */ +- +-#ifdef __STDC__ +-# include <limits.h> +-#else +-# include <assert.h> +-#endif +- +-#undef $ac_func +- +-/* Override any gcc2 internal prototype to avoid an error. */ +-#ifdef __cplusplus +-extern "C" +-{ +-#endif +-/* We use char because int might match the return type of a gcc2 +- builtin and then its argument prototype would still apply. */ +-char $ac_func (); +-/* The GNU C library defines this for functions which it implements +- to always fail with ENOSYS. Some functions are actually named +- something starting with __ and the normal name is an alias. */ +-#if defined (__stub_$ac_func) || defined (__stub___$ac_func) +-choke me +-#else +-char (*f) () = $ac_func; +-#endif +-#ifdef __cplusplus +-} +-#endif +- +-int +-main () +-{ +-return f != $ac_func; +- ; +- return 0; +-} +-_ACEOF +-rm -f conftest.$ac_objext conftest$ac_exeext +-if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 +- (eval $ac_link) 2>conftest.er1 +- ac_status=$? +- grep -v '^ *+' conftest.er1 >conftest.err +- rm -f conftest.er1 +- cat conftest.err >&5 +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); } && +- { ac_try='test -z "$ac_c_werror_flag" || test ! -s conftest.err' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; } && +- { ac_try='test -s conftest$ac_exeext' +- { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 +- (eval $ac_try) 2>&5 +- ac_status=$? +- echo "$as_me:$LINENO: \$? = $ac_status" >&5 +- (exit $ac_status); }; }; then +- eval "$as_ac_var=yes" +-else +- echo "$as_me: failed program was:" >&5 +-sed 's/^/| /' conftest.$ac_ext >&5 +- +-eval "$as_ac_var=no" +-fi +-rm -f conftest.err conftest.$ac_objext \ +- conftest$ac_exeext conftest.$ac_ext +-fi +-echo "$as_me:$LINENO: result: `eval echo '${'$as_ac_var'}'`" >&5 +-echo "${ECHO_T}`eval echo '${'$as_ac_var'}'`" >&6 +-if test `eval echo '${'$as_ac_var'}'` = yes; then +- cat >>confdefs.h <<_ACEOF +-#define `echo "HAVE_$ac_func" | $as_tr_cpp` 1 +-_ACEOF +- +-fi +-done +- +- +-if test -n "$ac_tool_prefix"; then +- # Extract the first word of "${ac_tool_prefix}install", so it can be a program name with args. +-set dummy ${ac_tool_prefix}install; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_INSTALL+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$INSTALL"; then +- ac_cv_prog_INSTALL="$INSTALL" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_INSTALL="${ac_tool_prefix}install" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +-fi +-fi +-INSTALL=$ac_cv_prog_INSTALL +-if test -n "$INSTALL"; then +- echo "$as_me:$LINENO: result: $INSTALL" >&5 +-echo "${ECHO_T}$INSTALL" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +-fi +-if test -z "$ac_cv_prog_INSTALL"; then +- ac_ct_INSTALL=$INSTALL +- # Extract the first word of "install", so it can be a program name with args. +-set dummy install; ac_word=$2 +-echo "$as_me:$LINENO: checking for $ac_word" >&5 +-echo $ECHO_N "checking for $ac_word... $ECHO_C" >&6 +-if test "${ac_cv_prog_ac_ct_INSTALL+set}" = set; then +- echo $ECHO_N "(cached) $ECHO_C" >&6 +-else +- if test -n "$ac_ct_INSTALL"; then +- ac_cv_prog_ac_ct_INSTALL="$ac_ct_INSTALL" # Let the user override the test. +-else +-as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for ac_exec_ext in '' $ac_executable_extensions; do +- if $as_executable_p "$as_dir/$ac_word$ac_exec_ext"; then +- ac_cv_prog_ac_ct_INSTALL="install" +- echo "$as_me:$LINENO: found $as_dir/$ac_word$ac_exec_ext" >&5 +- break 2 +- fi +-done +-done +- +- test -z "$ac_cv_prog_ac_ct_INSTALL" && ac_cv_prog_ac_ct_INSTALL=":" +-fi +-fi +-ac_ct_INSTALL=$ac_cv_prog_ac_ct_INSTALL +-if test -n "$ac_ct_INSTALL"; then +- echo "$as_me:$LINENO: result: $ac_ct_INSTALL" >&5 +-echo "${ECHO_T}$ac_ct_INSTALL" >&6 +-else +- echo "$as_me:$LINENO: result: no" >&5 +-echo "${ECHO_T}no" >&6 +-fi +- +- INSTALL=$ac_ct_INSTALL +-else +- INSTALL="$ac_cv_prog_INSTALL" +-fi +- +- +- ac_config_files="$ac_config_files mibs/Makefile" +- +- ac_config_files="$ac_config_files Makefile" +- +-cat >confcache <<\_ACEOF +-# This file is a shell script that caches the results of configure +-# tests run on this system so they can be shared between configure +-# scripts and configure runs, see configure's option --config-cache. +-# It is not useful on other systems. If it contains results you don't +-# want to keep, you may remove or edit it. +-# +-# config.status only pays attention to the cache file if you give it +-# the --recheck option to rerun configure. +-# +-# `ac_cv_env_foo' variables (set or unset) will be overridden when +-# loading this file, other *unset* `ac_cv_foo' will be assigned the +-# following values. +- +-_ACEOF +- +-# The following way of writing the cache mishandles newlines in values, +-# but we know of no workaround that is simple, portable, and efficient. +-# So, don't put newlines in cache variables' values. +-# Ultrix sh set writes to stderr and can't be redirected directly, +-# and sets the high bit in the cache file unless we assign to the vars. +-{ +- (set) 2>&1 | +- case `(ac_space=' '; set | grep ac_space) 2>&1` in +- *ac_space=\ *) +- # `set' does not quote correctly, so add quotes (double-quote +- # substitution turns \\\\ into \\, and sed turns \\ into \). +- sed -n \ +- "s/'/'\\\\''/g; +- s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1='\\2'/p" +- ;; +- *) +- # `set' quotes correctly as required by POSIX, so do not add quotes. +- sed -n \ +- "s/^\\([_$as_cr_alnum]*_cv_[_$as_cr_alnum]*\\)=\\(.*\\)/\\1=\\2/p" +- ;; +- esac; +-} | +- sed ' +- t clear +- : clear +- s/^\([^=]*\)=\(.*[{}].*\)$/test "${\1+set}" = set || &/ +- t end +- /^ac_cv_env/!s/^\([^=]*\)=\(.*\)$/\1=${\1=\2}/ +- : end' >>confcache +-if diff $cache_file confcache >/dev/null 2>&1; then :; else +- if test -w $cache_file; then +- test "x$cache_file" != "x/dev/null" && echo "updating cache $cache_file" +- cat confcache >$cache_file +- else +- echo "not updating unwritable cache $cache_file" +- fi +-fi +-rm -f confcache +- +-test "x$prefix" = xNONE && prefix=$ac_default_prefix +-# Let make expand exec_prefix. +-test "x$exec_prefix" = xNONE && exec_prefix='${prefix}' +- +-# VPATH may cause trouble with some makes, so we remove $(srcdir), +-# ${srcdir} and @srcdir@ from VPATH if srcdir is ".", strip leading and +-# trailing colons and then remove the whole line if VPATH becomes empty +-# (actually we leave an empty line to preserve line numbers). +-if test "x$srcdir" = x.; then +- ac_vpsub='/^[ ]*VPATH[ ]*=/{ +-s/:*\$(srcdir):*/:/; +-s/:*\${srcdir}:*/:/; +-s/:*@srcdir@:*/:/; +-s/^\([^=]*=[ ]*\):*/\1/; +-s/:*$//; +-s/^[^=]*=[ ]*$//; +-}' +-fi +- +-DEFS=-DHAVE_CONFIG_H +- +-ac_libobjs= +-ac_ltlibobjs= +-for ac_i in : $LIBOBJS; do test "x$ac_i" = x: && continue +- # 1. Remove the extension, and $U if already installed. +- ac_i=`echo "$ac_i" | +- sed 's/\$U\././;s/\.o$//;s/\.obj$//'` +- # 2. Add them. +- ac_libobjs="$ac_libobjs $ac_i\$U.$ac_objext" +- ac_ltlibobjs="$ac_ltlibobjs $ac_i"'$U.lo' +-done +-LIBOBJS=$ac_libobjs +- +-LTLIBOBJS=$ac_ltlibobjs +- +- +- +-: ${CONFIG_STATUS=./config.status} +-ac_clean_files_save=$ac_clean_files +-ac_clean_files="$ac_clean_files $CONFIG_STATUS" +-{ echo "$as_me:$LINENO: creating $CONFIG_STATUS" >&5 +-echo "$as_me: creating $CONFIG_STATUS" >&6;} +-cat >$CONFIG_STATUS <<_ACEOF +-#! $SHELL +-# Generated by $as_me. +-# Run this file to recreate the current configuration. +-# Compiler output produced by configure, useful for debugging +-# configure, is in config.log if it exists. +- +-debug=false +-ac_cs_recheck=false +-ac_cs_silent=false +-SHELL=\${CONFIG_SHELL-$SHELL} +-_ACEOF +- +-cat >>$CONFIG_STATUS <<\_ACEOF +-## --------------------- ## +-## M4sh Initialization. ## +-## --------------------- ## +- +-# Be Bourne compatible +-if test -n "${ZSH_VERSION+set}" && (emulate sh) >/dev/null 2>&1; then +- emulate sh +- NULLCMD=: +- # Zsh 3.x and 4.x performs word splitting on ${1+"$@"}, which +- # is contrary to our usage. Disable this feature. +- alias -g '${1+"$@"}'='"$@"' +-elif test -n "${BASH_VERSION+set}" && (set -o posix) >/dev/null 2>&1; then +- set -o posix +-fi +-DUALCASE=1; export DUALCASE # for MKS sh +- +-# Support unset when possible. +-if ( (MAIL=60; unset MAIL) || exit) >/dev/null 2>&1; then +- as_unset=unset +-else +- as_unset=false +-fi +- +- +-# Work around bugs in pre-3.0 UWIN ksh. +-$as_unset ENV MAIL MAILPATH +-PS1='$ ' +-PS2='> ' +-PS4='+ ' +- +-# NLS nuisances. +-for as_var in \ +- LANG LANGUAGE LC_ADDRESS LC_ALL LC_COLLATE LC_CTYPE LC_IDENTIFICATION \ +- LC_MEASUREMENT LC_MESSAGES LC_MONETARY LC_NAME LC_NUMERIC LC_PAPER \ +- LC_TELEPHONE LC_TIME +-do +- if (set +x; test -z "`(eval $as_var=C; export $as_var) 2>&1`"); then +- eval $as_var=C; export $as_var +- else +- $as_unset $as_var +- fi +-done +- +-# Required to use basename. +-if expr a : '\(a\)' >/dev/null 2>&1; then +- as_expr=expr +-else +- as_expr=false +-fi +- +-if (basename /) >/dev/null 2>&1 && test "X`basename / 2>&1`" = "X/"; then +- as_basename=basename +-else +- as_basename=false +-fi +- +- +-# Name of the executable. +-as_me=`$as_basename "$0" || +-$as_expr X/"$0" : '.*/\([^/][^/]*\)/*$' \| \ +- X"$0" : 'X\(//\)$' \| \ +- X"$0" : 'X\(/\)$' \| \ +- . : '\(.\)' 2>/dev/null || +-echo X/"$0" | +- sed '/^.*\/\([^/][^/]*\)\/*$/{ s//\1/; q; } +- /^X\/\(\/\/\)$/{ s//\1/; q; } +- /^X\/\(\/\).*/{ s//\1/; q; } +- s/.*/./; q'` +- +- +-# PATH needs CR, and LINENO needs CR and PATH. +-# Avoid depending upon Character Ranges. +-as_cr_letters='abcdefghijklmnopqrstuvwxyz' +-as_cr_LETTERS='ABCDEFGHIJKLMNOPQRSTUVWXYZ' +-as_cr_Letters=$as_cr_letters$as_cr_LETTERS +-as_cr_digits='0123456789' +-as_cr_alnum=$as_cr_Letters$as_cr_digits +- +-# The user is always right. +-if test "${PATH_SEPARATOR+set}" != set; then +- echo "#! /bin/sh" >conf$$.sh +- echo "exit 0" >>conf$$.sh +- chmod +x conf$$.sh +- if (PATH="/nonexistent;."; conf$$.sh) >/dev/null 2>&1; then +- PATH_SEPARATOR=';' +- else +- PATH_SEPARATOR=: +- fi +- rm -f conf$$.sh +-fi +- +- +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" || { +- # Find who we are. Look in the path if we contain no path at all +- # relative or not. +- case $0 in +- *[\\/]* ) as_myself=$0 ;; +- *) as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in $PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- test -r "$as_dir/$0" && as_myself=$as_dir/$0 && break +-done +- +- ;; +- esac +- # We did not find ourselves, most probably we were run as `sh COMMAND' +- # in which case we are not to be found in the path. +- if test "x$as_myself" = x; then +- as_myself=$0 +- fi +- if test ! -f "$as_myself"; then +- { { echo "$as_me:$LINENO: error: cannot find myself; rerun with an absolute path" >&5 +-echo "$as_me: error: cannot find myself; rerun with an absolute path" >&2;} +- { (exit 1); exit 1; }; } +- fi +- case $CONFIG_SHELL in +- '') +- as_save_IFS=$IFS; IFS=$PATH_SEPARATOR +-for as_dir in /bin$PATH_SEPARATOR/usr/bin$PATH_SEPARATOR$PATH +-do +- IFS=$as_save_IFS +- test -z "$as_dir" && as_dir=. +- for as_base in sh bash ksh sh5; do +- case $as_dir in +- /*) +- if ("$as_dir/$as_base" -c ' +- as_lineno_1=$LINENO +- as_lineno_2=$LINENO +- as_lineno_3=`(expr $as_lineno_1 + 1) 2>/dev/null` +- test "x$as_lineno_1" != "x$as_lineno_2" && +- test "x$as_lineno_3" = "x$as_lineno_2" ') 2>/dev/null; then +- $as_unset BASH_ENV || test "${BASH_ENV+set}" != set || { BASH_ENV=; export BASH_ENV; } +- $as_unset ENV || test "${ENV+set}" != set || { ENV=; export ENV; } +- CONFIG_SHELL=$as_dir/$as_base +- export CONFIG_SHELL +- exec "$CONFIG_SHELL" "$0" ${1+"$@"} +- fi;; +- esac +- done +-done +-;; +- esac +- +- # Create $as_me.lineno as a copy of $as_myself, but with $LINENO +- # uniformly replaced by the line number. The first 'sed' inserts a +- # line-number line before each line; the second 'sed' does the real +- # work. The second script uses 'N' to pair each line-number line +- # with the numbered line, and appends trailing '-' during +- # substitution so that $LINENO is not a special case at line end. +- # (Raja R Harinath suggested sed '=', and Paul Eggert wrote the +- # second 'sed' script. Blame Lee E. McMahon for sed's syntax. :-) +- sed '=' <$as_myself | +- sed ' +- N +- s,$,-, +- : loop +- s,^\(['$as_cr_digits']*\)\(.*\)[$]LINENO\([^'$as_cr_alnum'_]\),\1\2\1\3, +- t loop +- s,-$,, +- s,^['$as_cr_digits']*\n,, +- ' >$as_me.lineno && +- chmod +x $as_me.lineno || +- { { echo "$as_me:$LINENO: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&5 +-echo "$as_me: error: cannot create $as_me.lineno; rerun with a POSIX shell" >&2;} +- { (exit 1); exit 1; }; } +- +- # Don't try to exec as it changes $[0], causing all sort of problems +- # (the dirname of $[0] is not the place where we might find the +- # original and so on. Autoconf is especially sensible to this). +- . ./$as_me.lineno +- # Exit status is that of the last command. +- exit +-} +- +- +-case `echo "testing\c"; echo 1,2,3`,`echo -n testing; echo 1,2,3` in +- *c*,-n*) ECHO_N= ECHO_C=' +-' ECHO_T=' ' ;; +- *c*,* ) ECHO_N=-n ECHO_C= ECHO_T= ;; +- *) ECHO_N= ECHO_C='\c' ECHO_T= ;; +-esac +- +-if expr a : '\(a\)' >/dev/null 2>&1; then +- as_expr=expr +-else +- as_expr=false +-fi +- +-rm -f conf$$ conf$$.exe conf$$.file +-echo >conf$$.file +-if ln -s conf$$.file conf$$ 2>/dev/null; then +- # We could just check for DJGPP; but this test a) works b) is more generic +- # and c) will remain valid once DJGPP supports symlinks (DJGPP 2.04). +- if test -f conf$$.exe; then +- # Don't use ln at all; we don't have any links +- as_ln_s='cp -p' +- else +- as_ln_s='ln -s' +- fi +-elif ln conf$$.file conf$$ 2>/dev/null; then +- as_ln_s=ln +-else +- as_ln_s='cp -p' +-fi +-rm -f conf$$ conf$$.exe conf$$.file +- +-if mkdir -p . 2>/dev/null; then +- as_mkdir_p=: +-else +- test -d ./-p && rmdir ./-p +- as_mkdir_p=false +-fi +- +-as_executable_p="test -f" +- +-# Sed expression to map a string onto a valid CPP name. +-as_tr_cpp="eval sed 'y%*$as_cr_letters%P$as_cr_LETTERS%;s%[^_$as_cr_alnum]%_%g'" +- +-# Sed expression to map a string onto a valid variable name. +-as_tr_sh="eval sed 'y%*+%pp%;s%[^_$as_cr_alnum]%_%g'" +- +- +-# IFS +-# We need space, tab and new line, in precisely that order. +-as_nl=' +-' +-IFS=" $as_nl" +- +-# CDPATH. +-$as_unset CDPATH +- +-exec 6>&1 +- +-# Open the log real soon, to keep \$[0] and so on meaningful, and to +-# report actual input values of CONFIG_FILES etc. instead of their +-# values after options handling. Logging --version etc. is OK. +-exec 5>>config.log +-{ +- echo +- sed 'h;s/./-/g;s/^.../## /;s/...$/ ##/;p;x;p;x' <<_ASBOX +-## Running $as_me. ## +-_ASBOX +-} >&5 +-cat >&5 <<_CSEOF +- +-This file was extended by FULL-PACKAGE-NAME $as_me VERSION, which was +-generated by GNU Autoconf 2.59. Invocation command line was +- +- CONFIG_FILES = $CONFIG_FILES +- CONFIG_HEADERS = $CONFIG_HEADERS +- CONFIG_LINKS = $CONFIG_LINKS +- CONFIG_COMMANDS = $CONFIG_COMMANDS +- $ $0 $@ +- +-_CSEOF +-echo "on `(hostname || uname -n) 2>/dev/null | sed 1q`" >&5 +-echo >&5 +-_ACEOF +- +-# Files that config.status was made for. +-if test -n "$ac_config_files"; then +- echo "config_files=\"$ac_config_files\"" >>$CONFIG_STATUS +-fi +- +-if test -n "$ac_config_headers"; then +- echo "config_headers=\"$ac_config_headers\"" >>$CONFIG_STATUS +-fi +- +-if test -n "$ac_config_links"; then +- echo "config_links=\"$ac_config_links\"" >>$CONFIG_STATUS +-fi +- +-if test -n "$ac_config_commands"; then +- echo "config_commands=\"$ac_config_commands\"" >>$CONFIG_STATUS +-fi +- +-cat >>$CONFIG_STATUS <<\_ACEOF +- +-ac_cs_usage="\ +-\`$as_me' instantiates files from templates according to the +-current configuration. +- +-Usage: $0 [OPTIONS] [FILE]... +- +- -h, --help print this help, then exit +- -V, --version print version number, then exit +- -q, --quiet do not print progress messages +- -d, --debug don't remove temporary files +- --recheck update $as_me by reconfiguring in the same conditions +- --file=FILE[:TEMPLATE] +- instantiate the configuration file FILE +- --header=FILE[:TEMPLATE] +- instantiate the configuration header FILE +- +-Configuration files: +-$config_files +- +-Configuration headers: +-$config_headers +- +-Report bugs to <bug-autoconf@gnu.org>." +-_ACEOF +- +-cat >>$CONFIG_STATUS <<_ACEOF +-ac_cs_version="\\ +-FULL-PACKAGE-NAME config.status VERSION +-configured by $0, generated by GNU Autoconf 2.59, +- with options \\"`echo "$ac_configure_args" | sed 's/[\\""\`\$]/\\\\&/g'`\\" +- +-Copyright (C) 2003 Free Software Foundation, Inc. +-This config.status script is free software; the Free Software Foundation +-gives unlimited permission to copy, distribute and modify it." +-srcdir=$srcdir +-_ACEOF +- +-cat >>$CONFIG_STATUS <<\_ACEOF +-# If no file are specified by the user, then we need to provide default +-# value. By we need to know if files were specified by the user. +-ac_need_defaults=: +-while test $# != 0 +-do +- case $1 in +- --*=*) +- ac_option=`expr "x$1" : 'x\([^=]*\)='` +- ac_optarg=`expr "x$1" : 'x[^=]*=\(.*\)'` +- ac_shift=: +- ;; +- -*) +- ac_option=$1 +- ac_optarg=$2 +- ac_shift=shift +- ;; +- *) # This is not an option, so the user has probably given explicit +- # arguments. +- ac_option=$1 +- ac_need_defaults=false;; +- esac +- +- case $ac_option in +- # Handling of the options. +-_ACEOF +-cat >>$CONFIG_STATUS <<\_ACEOF +- -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r) +- ac_cs_recheck=: ;; +- --version | --vers* | -V ) +- echo "$ac_cs_version"; exit 0 ;; +- --he | --h) +- # Conflict between --help and --header +- { { echo "$as_me:$LINENO: error: ambiguous option: $1 +-Try \`$0 --help' for more information." >&5 +-echo "$as_me: error: ambiguous option: $1 +-Try \`$0 --help' for more information." >&2;} +- { (exit 1); exit 1; }; };; +- --help | --hel | -h ) +- echo "$ac_cs_usage"; exit 0 ;; +- --debug | --d* | -d ) +- debug=: ;; +- --file | --fil | --fi | --f ) +- $ac_shift +- CONFIG_FILES="$CONFIG_FILES $ac_optarg" +- ac_need_defaults=false;; +- --header | --heade | --head | --hea ) +- $ac_shift +- CONFIG_HEADERS="$CONFIG_HEADERS $ac_optarg" +- ac_need_defaults=false;; +- -q | -quiet | --quiet | --quie | --qui | --qu | --q \ +- | -silent | --silent | --silen | --sile | --sil | --si | --s) +- ac_cs_silent=: ;; +- +- # This is an error. +- -*) { { echo "$as_me:$LINENO: error: unrecognized option: $1 +-Try \`$0 --help' for more information." >&5 +-echo "$as_me: error: unrecognized option: $1 +-Try \`$0 --help' for more information." >&2;} +- { (exit 1); exit 1; }; } ;; +- +- *) ac_config_targets="$ac_config_targets $1" ;; +- +- esac +- shift +-done +- +-ac_configure_extra_args= +- +-if $ac_cs_silent; then +- exec 6>/dev/null +- ac_configure_extra_args="$ac_configure_extra_args --silent" +-fi +- +-_ACEOF +-cat >>$CONFIG_STATUS <<_ACEOF +-if \$ac_cs_recheck; then +- echo "running $SHELL $0 " $ac_configure_args \$ac_configure_extra_args " --no-create --no-recursion" >&6 +- exec $SHELL $0 $ac_configure_args \$ac_configure_extra_args --no-create --no-recursion +-fi +- +-_ACEOF +- +- +- +- +- +-cat >>$CONFIG_STATUS <<\_ACEOF +-for ac_config_target in $ac_config_targets +-do +- case "$ac_config_target" in +- # Handling of arguments. +- "mibs/Makefile" ) CONFIG_FILES="$CONFIG_FILES mibs/Makefile" ;; +- "Makefile" ) CONFIG_FILES="$CONFIG_FILES Makefile" ;; +- "config.h" ) CONFIG_HEADERS="$CONFIG_HEADERS config.h" ;; +- *) { { echo "$as_me:$LINENO: error: invalid argument: $ac_config_target" >&5 +-echo "$as_me: error: invalid argument: $ac_config_target" >&2;} +- { (exit 1); exit 1; }; };; +- esac +-done +- +-# If the user did not use the arguments to specify the items to instantiate, +-# then the envvar interface is used. Set only those that are not. +-# We use the long form for the default assignment because of an extremely +-# bizarre bug on SunOS 4.1.3. +-if $ac_need_defaults; then +- test "${CONFIG_FILES+set}" = set || CONFIG_FILES=$config_files +- test "${CONFIG_HEADERS+set}" = set || CONFIG_HEADERS=$config_headers +-fi +- +-# Have a temporary directory for convenience. Make it in the build tree +-# simply because there is no reason to put it here, and in addition, +-# creating and moving files from /tmp can sometimes cause problems. +-# Create a temporary directory, and hook for its removal unless debugging. +-$debug || +-{ +- trap 'exit_status=$?; rm -rf $tmp && exit $exit_status' 0 +- trap '{ (exit 1); exit 1; }' 1 2 13 15 +-} +- +-# Create a (secure) tmp directory for tmp files. +- +-{ +- tmp=`(umask 077 && mktemp -d -q "./confstatXXXXXX") 2>/dev/null` && +- test -n "$tmp" && test -d "$tmp" +-} || +-{ +- tmp=./confstat$$-$RANDOM +- (umask 077 && mkdir $tmp) +-} || +-{ +- echo "$me: cannot create a temporary directory in ." >&2 +- { (exit 1); exit 1; } +-} +- +-_ACEOF +- +-cat >>$CONFIG_STATUS <<_ACEOF +- +-# +-# CONFIG_FILES section. +-# +- +-# No need to generate the scripts if there are no CONFIG_FILES. +-# This happens for instance when ./config.status config.h +-if test -n "\$CONFIG_FILES"; then +- # Protect against being on the right side of a sed subst in config.status. +- sed 's/,@/@@/; s/@,/@@/; s/,;t t\$/@;t t/; /@;t t\$/s/[\\\\&,]/\\\\&/g; +- s/@@/,@/; s/@@/@,/; s/@;t t\$/,;t t/' >\$tmp/subs.sed <<\\CEOF +-s,@SHELL@,$SHELL,;t t +-s,@PATH_SEPARATOR@,$PATH_SEPARATOR,;t t +-s,@PACKAGE_NAME@,$PACKAGE_NAME,;t t +-s,@PACKAGE_TARNAME@,$PACKAGE_TARNAME,;t t +-s,@PACKAGE_VERSION@,$PACKAGE_VERSION,;t t +-s,@PACKAGE_STRING@,$PACKAGE_STRING,;t t +-s,@PACKAGE_BUGREPORT@,$PACKAGE_BUGREPORT,;t t +-s,@exec_prefix@,$exec_prefix,;t t +-s,@prefix@,$prefix,;t t +-s,@program_transform_name@,$program_transform_name,;t t +-s,@bindir@,$bindir,;t t +-s,@sbindir@,$sbindir,;t t +-s,@libexecdir@,$libexecdir,;t t +-s,@datadir@,$datadir,;t t +-s,@sysconfdir@,$sysconfdir,;t t +-s,@sharedstatedir@,$sharedstatedir,;t t +-s,@localstatedir@,$localstatedir,;t t +-s,@libdir@,$libdir,;t t +-s,@includedir@,$includedir,;t t +-s,@oldincludedir@,$oldincludedir,;t t +-s,@infodir@,$infodir,;t t +-s,@mandir@,$mandir,;t t +-s,@build_alias@,$build_alias,;t t +-s,@host_alias@,$host_alias,;t t +-s,@target_alias@,$target_alias,;t t +-s,@DEFS@,$DEFS,;t t +-s,@ECHO_C@,$ECHO_C,;t t +-s,@ECHO_N@,$ECHO_N,;t t +-s,@ECHO_T@,$ECHO_T,;t t +-s,@LIBS@,$LIBS,;t t +-s,@CC@,$CC,;t t +-s,@CFLAGS@,$CFLAGS,;t t +-s,@LDFLAGS@,$LDFLAGS,;t t +-s,@CPPFLAGS@,$CPPFLAGS,;t t +-s,@ac_ct_CC@,$ac_ct_CC,;t t +-s,@EXEEXT@,$EXEEXT,;t t +-s,@OBJEXT@,$OBJEXT,;t t +-s,@CPP@,$CPP,;t t +-s,@EGREP@,$EGREP,;t t +-s,@LIBOBJS@,$LIBOBJS,;t t +-s,@INSTALL@,$INSTALL,;t t +-s,@ac_ct_INSTALL@,$ac_ct_INSTALL,;t t +-s,@LTLIBOBJS@,$LTLIBOBJS,;t t +-CEOF +- +-_ACEOF +- +- cat >>$CONFIG_STATUS <<\_ACEOF +- # Split the substitutions into bite-sized pieces for seds with +- # small command number limits, like on Digital OSF/1 and HP-UX. +- ac_max_sed_lines=48 +- ac_sed_frag=1 # Number of current file. +- ac_beg=1 # First line for current file. +- ac_end=$ac_max_sed_lines # Line after last line for current file. +- ac_more_lines=: +- ac_sed_cmds= +- while $ac_more_lines; do +- if test $ac_beg -gt 1; then +- sed "1,${ac_beg}d; ${ac_end}q" $tmp/subs.sed >$tmp/subs.frag +- else +- sed "${ac_end}q" $tmp/subs.sed >$tmp/subs.frag +- fi +- if test ! -s $tmp/subs.frag; then +- ac_more_lines=false +- else +- # The purpose of the label and of the branching condition is to +- # speed up the sed processing (if there are no `@' at all, there +- # is no need to browse any of the substitutions). +- # These are the two extra sed commands mentioned above. +- (echo ':t +- /@[a-zA-Z_][a-zA-Z_0-9]*@/!b' && cat $tmp/subs.frag) >$tmp/subs-$ac_sed_frag.sed +- if test -z "$ac_sed_cmds"; then +- ac_sed_cmds="sed -f $tmp/subs-$ac_sed_frag.sed" +- else +- ac_sed_cmds="$ac_sed_cmds | sed -f $tmp/subs-$ac_sed_frag.sed" +- fi +- ac_sed_frag=`expr $ac_sed_frag + 1` +- ac_beg=$ac_end +- ac_end=`expr $ac_end + $ac_max_sed_lines` +- fi +- done +- if test -z "$ac_sed_cmds"; then +- ac_sed_cmds=cat +- fi +-fi # test -n "$CONFIG_FILES" +- +-_ACEOF +-cat >>$CONFIG_STATUS <<\_ACEOF +-for ac_file in : $CONFIG_FILES; do test "x$ac_file" = x: && continue +- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +- case $ac_file in +- - | *:- | *:-:* ) # input from stdin +- cat >$tmp/stdin +- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- * ) ac_file_in=$ac_file.in ;; +- esac +- +- # Compute @srcdir@, @top_srcdir@, and @INSTALL@ for subdirectories. +- ac_dir=`(dirname "$ac_file") 2>/dev/null || +-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$ac_file" : 'X\(//\)[^/]' \| \ +- X"$ac_file" : 'X\(//\)$' \| \ +- X"$ac_file" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || +-echo X"$ac_file" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } +- /^X\(\/\/\)[^/].*/{ s//\1/; q; } +- /^X\(\/\/\)$/{ s//\1/; q; } +- /^X\(\/\).*/{ s//\1/; q; } +- s/.*/./; q'` +- { if $as_mkdir_p; then +- mkdir -p "$ac_dir" +- else +- as_dir="$ac_dir" +- as_dirs= +- while test ! -d "$as_dir"; do +- as_dirs="$as_dir $as_dirs" +- as_dir=`(dirname "$as_dir") 2>/dev/null || +-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$as_dir" : 'X\(//\)[^/]' \| \ +- X"$as_dir" : 'X\(//\)$' \| \ +- X"$as_dir" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || +-echo X"$as_dir" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } +- /^X\(\/\/\)[^/].*/{ s//\1/; q; } +- /^X\(\/\/\)$/{ s//\1/; q; } +- /^X\(\/\).*/{ s//\1/; q; } +- s/.*/./; q'` +- done +- test ! -n "$as_dirs" || mkdir $as_dirs +- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} +- { (exit 1); exit 1; }; }; } +- +- ac_builddir=. +- +-if test "$ac_dir" != .; then +- ac_dir_suffix=/`echo "$ac_dir" | sed 's,^\.[\\/],,'` +- # A "../" for each directory in $ac_dir_suffix. +- ac_top_builddir=`echo "$ac_dir_suffix" | sed 's,/[^\\/]*,../,g'` +-else +- ac_dir_suffix= ac_top_builddir= +-fi +- +-case $srcdir in +- .) # No --srcdir option. We are building in place. +- ac_srcdir=. +- if test -z "$ac_top_builddir"; then +- ac_top_srcdir=. +- else +- ac_top_srcdir=`echo $ac_top_builddir | sed 's,/$,,'` +- fi ;; +- [\\/]* | ?:[\\/]* ) # Absolute path. +- ac_srcdir=$srcdir$ac_dir_suffix; +- ac_top_srcdir=$srcdir ;; +- *) # Relative path. +- ac_srcdir=$ac_top_builddir$srcdir$ac_dir_suffix +- ac_top_srcdir=$ac_top_builddir$srcdir ;; +-esac +- +-# Do not use `cd foo && pwd` to compute absolute paths, because +-# the directories may not exist. +-case `pwd` in +-.) ac_abs_builddir="$ac_dir";; +-*) +- case "$ac_dir" in +- .) ac_abs_builddir=`pwd`;; +- [\\/]* | ?:[\\/]* ) ac_abs_builddir="$ac_dir";; +- *) ac_abs_builddir=`pwd`/"$ac_dir";; +- esac;; +-esac +-case $ac_abs_builddir in +-.) ac_abs_top_builddir=${ac_top_builddir}.;; +-*) +- case ${ac_top_builddir}. in +- .) ac_abs_top_builddir=$ac_abs_builddir;; +- [\\/]* | ?:[\\/]* ) ac_abs_top_builddir=${ac_top_builddir}.;; +- *) ac_abs_top_builddir=$ac_abs_builddir/${ac_top_builddir}.;; +- esac;; +-esac +-case $ac_abs_builddir in +-.) ac_abs_srcdir=$ac_srcdir;; +-*) +- case $ac_srcdir in +- .) ac_abs_srcdir=$ac_abs_builddir;; +- [\\/]* | ?:[\\/]* ) ac_abs_srcdir=$ac_srcdir;; +- *) ac_abs_srcdir=$ac_abs_builddir/$ac_srcdir;; +- esac;; +-esac +-case $ac_abs_builddir in +-.) ac_abs_top_srcdir=$ac_top_srcdir;; +-*) +- case $ac_top_srcdir in +- .) ac_abs_top_srcdir=$ac_abs_builddir;; +- [\\/]* | ?:[\\/]* ) ac_abs_top_srcdir=$ac_top_srcdir;; +- *) ac_abs_top_srcdir=$ac_abs_builddir/$ac_top_srcdir;; +- esac;; +-esac +- +- +- +- # Let's still pretend it is `configure' which instantiates (i.e., don't +- # use $as_me), people would be surprised to read: +- # /* config.h. Generated by config.status. */ +- if test x"$ac_file" = x-; then +- configure_input= +- else +- configure_input="$ac_file. " +- fi +- configure_input=$configure_input"Generated from `echo $ac_file_in | +- sed 's,.*/,,'` by configure." +- +- # First look for the input files in the build tree, otherwise in the +- # src tree. +- ac_file_inputs=`IFS=: +- for f in $ac_file_in; do +- case $f in +- -) echo $tmp/stdin ;; +- [\\/$]*) +- # Absolute (can't be DOS-style, as IFS=:) +- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- echo "$f";; +- *) # Relative +- if test -f "$f"; then +- # Build tree +- echo "$f" +- elif test -f "$srcdir/$f"; then +- # Source tree +- echo "$srcdir/$f" +- else +- # /dev/null tree +- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- fi;; +- esac +- done` || { (exit 1); exit 1; } +- +- if test x"$ac_file" != x-; then +- { echo "$as_me:$LINENO: creating $ac_file" >&5 +-echo "$as_me: creating $ac_file" >&6;} +- rm -f "$ac_file" +- fi +-_ACEOF +-cat >>$CONFIG_STATUS <<_ACEOF +- sed "$ac_vpsub +-$extrasub +-_ACEOF +-cat >>$CONFIG_STATUS <<\_ACEOF +-:t +-/@[a-zA-Z_][a-zA-Z_0-9]*@/!b +-s,@configure_input@,$configure_input,;t t +-s,@srcdir@,$ac_srcdir,;t t +-s,@abs_srcdir@,$ac_abs_srcdir,;t t +-s,@top_srcdir@,$ac_top_srcdir,;t t +-s,@abs_top_srcdir@,$ac_abs_top_srcdir,;t t +-s,@builddir@,$ac_builddir,;t t +-s,@abs_builddir@,$ac_abs_builddir,;t t +-s,@top_builddir@,$ac_top_builddir,;t t +-s,@abs_top_builddir@,$ac_abs_top_builddir,;t t +-" $ac_file_inputs | (eval "$ac_sed_cmds") >$tmp/out +- rm -f $tmp/stdin +- if test x"$ac_file" != x-; then +- mv $tmp/out $ac_file +- else +- cat $tmp/out +- rm -f $tmp/out +- fi +- +-done +-_ACEOF +-cat >>$CONFIG_STATUS <<\_ACEOF +- +-# +-# CONFIG_HEADER section. +-# +- +-# These sed commands are passed to sed as "A NAME B NAME C VALUE D", where +-# NAME is the cpp macro being defined and VALUE is the value it is being given. +-# +-# ac_d sets the value in "#define NAME VALUE" lines. +-ac_dA='s,^\([ ]*\)#\([ ]*define[ ][ ]*\)' +-ac_dB='[ ].*$,\1#\2' +-ac_dC=' ' +-ac_dD=',;t' +-# ac_u turns "#undef NAME" without trailing blanks into "#define NAME VALUE". +-ac_uA='s,^\([ ]*\)#\([ ]*\)undef\([ ][ ]*\)' +-ac_uB='$,\1#\2define\3' +-ac_uC=' ' +-ac_uD=',;t' +- +-for ac_file in : $CONFIG_HEADERS; do test "x$ac_file" = x: && continue +- # Support "outfile[:infile[:infile...]]", defaulting infile="outfile.in". +- case $ac_file in +- - | *:- | *:-:* ) # input from stdin +- cat >$tmp/stdin +- ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- *:* ) ac_file_in=`echo "$ac_file" | sed 's,[^:]*:,,'` +- ac_file=`echo "$ac_file" | sed 's,:.*,,'` ;; +- * ) ac_file_in=$ac_file.in ;; +- esac +- +- test x"$ac_file" != x- && { echo "$as_me:$LINENO: creating $ac_file" >&5 +-echo "$as_me: creating $ac_file" >&6;} +- +- # First look for the input files in the build tree, otherwise in the +- # src tree. +- ac_file_inputs=`IFS=: +- for f in $ac_file_in; do +- case $f in +- -) echo $tmp/stdin ;; +- [\\/$]*) +- # Absolute (can't be DOS-style, as IFS=:) +- test -f "$f" || { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- # Do quote $f, to prevent DOS paths from being IFS'd. +- echo "$f";; +- *) # Relative +- if test -f "$f"; then +- # Build tree +- echo "$f" +- elif test -f "$srcdir/$f"; then +- # Source tree +- echo "$srcdir/$f" +- else +- # /dev/null tree +- { { echo "$as_me:$LINENO: error: cannot find input file: $f" >&5 +-echo "$as_me: error: cannot find input file: $f" >&2;} +- { (exit 1); exit 1; }; } +- fi;; +- esac +- done` || { (exit 1); exit 1; } +- # Remove the trailing spaces. +- sed 's/[ ]*$//' $ac_file_inputs >$tmp/in +- +-_ACEOF +- +-# Transform confdefs.h into two sed scripts, `conftest.defines' and +-# `conftest.undefs', that substitutes the proper values into +-# config.h.in to produce config.h. The first handles `#define' +-# templates, and the second `#undef' templates. +-# And first: Protect against being on the right side of a sed subst in +-# config.status. Protect against being in an unquoted here document +-# in config.status. +-rm -f conftest.defines conftest.undefs +-# Using a here document instead of a string reduces the quoting nightmare. +-# Putting comments in sed scripts is not portable. +-# +-# `end' is used to avoid that the second main sed command (meant for +-# 0-ary CPP macros) applies to n-ary macro definitions. +-# See the Autoconf documentation for `clear'. +-cat >confdef2sed.sed <<\_ACEOF +-s/[\\&,]/\\&/g +-s,[\\$`],\\&,g +-t clear +-: clear +-s,^[ ]*#[ ]*define[ ][ ]*\([^ (][^ (]*\)\(([^)]*)\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1\2${ac_dC}\3${ac_dD},gp +-t end +-s,^[ ]*#[ ]*define[ ][ ]*\([^ ][^ ]*\)[ ]*\(.*\)$,${ac_dA}\1${ac_dB}\1${ac_dC}\2${ac_dD},gp +-: end +-_ACEOF +-# If some macros were called several times there might be several times +-# the same #defines, which is useless. Nevertheless, we may not want to +-# sort them, since we want the *last* AC-DEFINE to be honored. +-uniq confdefs.h | sed -n -f confdef2sed.sed >conftest.defines +-sed 's/ac_d/ac_u/g' conftest.defines >conftest.undefs +-rm -f confdef2sed.sed +- +-# This sed command replaces #undef with comments. This is necessary, for +-# example, in the case of _POSIX_SOURCE, which is predefined and required +-# on some systems where configure will not decide to define it. +-cat >>conftest.undefs <<\_ACEOF +-s,^[ ]*#[ ]*undef[ ][ ]*[a-zA-Z_][a-zA-Z_0-9]*,/* & */, +-_ACEOF +- +-# Break up conftest.defines because some shells have a limit on the size +-# of here documents, and old seds have small limits too (100 cmds). +-echo ' # Handle all the #define templates only if necessary.' >>$CONFIG_STATUS +-echo ' if grep "^[ ]*#[ ]*define" $tmp/in >/dev/null; then' >>$CONFIG_STATUS +-echo ' # If there are no defines, we may have an empty if/fi' >>$CONFIG_STATUS +-echo ' :' >>$CONFIG_STATUS +-rm -f conftest.tail +-while grep . conftest.defines >/dev/null +-do +- # Write a limited-size here document to $tmp/defines.sed. +- echo ' cat >$tmp/defines.sed <<CEOF' >>$CONFIG_STATUS +- # Speed up: don't consider the non `#define' lines. +- echo '/^[ ]*#[ ]*define/!b' >>$CONFIG_STATUS +- # Work around the forget-to-reset-the-flag bug. +- echo 't clr' >>$CONFIG_STATUS +- echo ': clr' >>$CONFIG_STATUS +- sed ${ac_max_here_lines}q conftest.defines >>$CONFIG_STATUS +- echo 'CEOF +- sed -f $tmp/defines.sed $tmp/in >$tmp/out +- rm -f $tmp/in +- mv $tmp/out $tmp/in +-' >>$CONFIG_STATUS +- sed 1,${ac_max_here_lines}d conftest.defines >conftest.tail +- rm -f conftest.defines +- mv conftest.tail conftest.defines +-done +-rm -f conftest.defines +-echo ' fi # grep' >>$CONFIG_STATUS +-echo >>$CONFIG_STATUS +- +-# Break up conftest.undefs because some shells have a limit on the size +-# of here documents, and old seds have small limits too (100 cmds). +-echo ' # Handle all the #undef templates' >>$CONFIG_STATUS +-rm -f conftest.tail +-while grep . conftest.undefs >/dev/null +-do +- # Write a limited-size here document to $tmp/undefs.sed. +- echo ' cat >$tmp/undefs.sed <<CEOF' >>$CONFIG_STATUS +- # Speed up: don't consider the non `#undef' +- echo '/^[ ]*#[ ]*undef/!b' >>$CONFIG_STATUS +- # Work around the forget-to-reset-the-flag bug. +- echo 't clr' >>$CONFIG_STATUS +- echo ': clr' >>$CONFIG_STATUS +- sed ${ac_max_here_lines}q conftest.undefs >>$CONFIG_STATUS +- echo 'CEOF +- sed -f $tmp/undefs.sed $tmp/in >$tmp/out +- rm -f $tmp/in +- mv $tmp/out $tmp/in +-' >>$CONFIG_STATUS +- sed 1,${ac_max_here_lines}d conftest.undefs >conftest.tail +- rm -f conftest.undefs +- mv conftest.tail conftest.undefs +-done +-rm -f conftest.undefs +- +-cat >>$CONFIG_STATUS <<\_ACEOF +- # Let's still pretend it is `configure' which instantiates (i.e., don't +- # use $as_me), people would be surprised to read: +- # /* config.h. Generated by config.status. */ +- if test x"$ac_file" = x-; then +- echo "/* Generated by configure. */" >$tmp/config.h +- else +- echo "/* $ac_file. Generated by configure. */" >$tmp/config.h +- fi +- cat $tmp/in >>$tmp/config.h +- rm -f $tmp/in +- if test x"$ac_file" != x-; then +- if diff $ac_file $tmp/config.h >/dev/null 2>&1; then +- { echo "$as_me:$LINENO: $ac_file is unchanged" >&5 +-echo "$as_me: $ac_file is unchanged" >&6;} +- else +- ac_dir=`(dirname "$ac_file") 2>/dev/null || +-$as_expr X"$ac_file" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$ac_file" : 'X\(//\)[^/]' \| \ +- X"$ac_file" : 'X\(//\)$' \| \ +- X"$ac_file" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || +-echo X"$ac_file" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } +- /^X\(\/\/\)[^/].*/{ s//\1/; q; } +- /^X\(\/\/\)$/{ s//\1/; q; } +- /^X\(\/\).*/{ s//\1/; q; } +- s/.*/./; q'` +- { if $as_mkdir_p; then +- mkdir -p "$ac_dir" +- else +- as_dir="$ac_dir" +- as_dirs= +- while test ! -d "$as_dir"; do +- as_dirs="$as_dir $as_dirs" +- as_dir=`(dirname "$as_dir") 2>/dev/null || +-$as_expr X"$as_dir" : 'X\(.*[^/]\)//*[^/][^/]*/*$' \| \ +- X"$as_dir" : 'X\(//\)[^/]' \| \ +- X"$as_dir" : 'X\(//\)$' \| \ +- X"$as_dir" : 'X\(/\)' \| \ +- . : '\(.\)' 2>/dev/null || +-echo X"$as_dir" | +- sed '/^X\(.*[^/]\)\/\/*[^/][^/]*\/*$/{ s//\1/; q; } +- /^X\(\/\/\)[^/].*/{ s//\1/; q; } +- /^X\(\/\/\)$/{ s//\1/; q; } +- /^X\(\/\).*/{ s//\1/; q; } +- s/.*/./; q'` +- done +- test ! -n "$as_dirs" || mkdir $as_dirs +- fi || { { echo "$as_me:$LINENO: error: cannot create directory \"$ac_dir\"" >&5 +-echo "$as_me: error: cannot create directory \"$ac_dir\"" >&2;} +- { (exit 1); exit 1; }; }; } +- +- rm -f $ac_file +- mv $tmp/config.h $ac_file +- fi +- else +- cat $tmp/config.h +- rm -f $tmp/config.h +- fi +-done +-_ACEOF +- +-cat >>$CONFIG_STATUS <<\_ACEOF +- +-{ (exit 0); exit 0; } +-_ACEOF +-chmod +x $CONFIG_STATUS +-ac_clean_files=$ac_clean_files_save +- +- +-# configure is writing to config.log, and then calls config.status. +-# config.status does its own redirection, appending to config.log. +-# Unfortunately, on DOS this fails, as config.log is still kept open +-# by configure, so config.status won't be able to write to it; its +-# output is simply discarded. So we exec the FD to /dev/null, +-# effectively closing config.log, so it can be properly (re)opened and +-# appended to by config.status. When coming back to configure, we +-# need to make the FD available again. +-if test "$no_create" != yes; then +- ac_cs_success=: +- ac_config_status_args= +- test "$silent" = yes && +- ac_config_status_args="$ac_config_status_args --quiet" +- exec 5>/dev/null +- $SHELL $CONFIG_STATUS $ac_config_status_args || ac_cs_success=false +- exec 5>>config.log +- # Use ||, not &&, to avoid exiting from the if with $? = 1, which +- # would make configure fail if this is the last instruction. +- $ac_cs_success || { (exit 1); exit 1; } +-fi +- +diff --git configure.in configure.in +deleted file mode 100644 +index 8625241..0000000 +--- configure.in ++++ /dev/null +@@ -1,29 +0,0 @@ +-# -*- Autoconf -*- +-# Process this file with autoconf to produce a configure script. +- +-AC_PREREQ(2.59) +-AC_INIT(FULL-PACKAGE-NAME, VERSION, BUG-REPORT-ADDRESS) +-AC_CONFIG_SRCDIR([iptables-snmp.c]) +-AC_CONFIG_HEADER([config.h]) +- +-# Checks for programs. +-AC_PROG_CC +- +-# Checks for libraries. +- +-# Checks for header files. +-AC_CHECK_HEADERS([arpa/inet.h]) +- +-# Checks for typedefs, structures, and compiler characteristics. +-AC_C_CONST +- +-# Checks for library functions. +-AC_FUNC_MALLOC +-AC_FUNC_REALLOC +-AC_CHECK_FUNCS([strdup strerror]) +- +-AC_CHECK_TOOL(INSTALL, install, :) +- +-AC_CONFIG_FILES([mibs/Makefile]) +-AC_CONFIG_FILES([Makefile]) +-AC_OUTPUT +diff --git iptables-snmp.c iptables-snmp.c +index 918d4c8..f845cc1 100644 +--- iptables-snmp.c ++++ iptables-snmp.c +@@ -1,6 +1,4 @@ + /* +- * $Id$ +- * + * This file is part of iptables-snmp - using SNMP to read data from linux + * iptables + * +@@ -33,10 +31,12 @@ + #include <net-snmp/net-snmp-config.h> + #include <net-snmp/net-snmp-includes.h> + #include <net-snmp/agent/net-snmp-agent-includes.h> +-#include "iptables-snmp.h" + ++#include <iptables/internal.h> + #include <libiptc/libiptc.h> + ++#include "iptables-snmp.h" ++ + /* For backward compatibility */ + typedef struct iptc_handle *iptc_handle_t; + +diff --git mibs/Makefile.in mibs/Makefile.in +deleted file mode 100644 +index fa434cb..0000000 +--- mibs/Makefile.in ++++ /dev/null +@@ -1,4 +0,0 @@ +-all: +- +-clean: +- rm -f .index *.MIB~ +diff --git mkinstalldirs mkinstalldirs +deleted file mode 100644 +index 4f58503..0000000 +--- mkinstalldirs ++++ /dev/null +@@ -1,40 +0,0 @@ +-#! /bin/sh +-# mkinstalldirs --- make directory hierarchy +-# Author: Noah Friedman <friedman@prep.ai.mit.edu> +-# Created: 1993-05-16 +-# Public domain +- +-# $Id: mkinstalldirs,v 1.13 1999/01/05 03:18:55 bje Exp $ +- +-errstatus=0 +- +-for file +-do +- set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` +- shift +- +- pathcomp= +- for d +- do +- pathcomp="$pathcomp$d" +- case "$pathcomp" in +- -* ) pathcomp=./$pathcomp ;; +- esac +- +- if test ! -d "$pathcomp"; then +- echo "mkdir $pathcomp" +- +- mkdir "$pathcomp" || lasterr=$? +- +- if test ! -d "$pathcomp"; then +- errstatus=$lasterr +- fi +- fi +- +- pathcomp="$pathcomp/" +- done +-done +- +-exit $errstatus +- +-# mkinstalldirs ends here +-- +1.8.5.1 + diff --git a/net-firewall/iptables-snmp/files/001-use_libiptc.patch b/net-firewall/iptables-snmp/files/001-use_libiptc.patch deleted file mode 100644 index 38d9a917..00000000 --- a/net-firewall/iptables-snmp/files/001-use_libiptc.patch +++ /dev/null @@ -1,27 +0,0 @@ -From: https://dev.openwrt.org/browser/packages/net/iptables-snmp/patches/001-use_libiptc.patch - -diff -urN iptables-snmp-0.1/Makefile.in iptables-snmp-0.1.new/Makefile.in ---- iptables-snmp-0.1/Makefile.in 2005-11-02 13:00:10.000000000 +0100 -+++ iptables-snmp-0.1.new/Makefile.in 2009-08-02 01:13:40.000000000 +0200 -@@ -67,7 +67,7 @@ - - all: iptables-snmp.so - --iptables-snmp.so: $(OBJS) libiptc.a Makefile -+iptables-snmp.so: $(OBJS) Makefile - $(CC) $(CFLAGS) $(OTHER) $(DFLAGS) -shared -o $@ $(OBJS) $(LDFLAGS) - - libiptc.a: $(LIBIPTC_OBJS) Makefile -diff -urN iptables-snmp-0.1/iptables-snmp.c iptables-snmp-0.1.new/iptables-snmp.c ---- iptables-snmp-0.1/iptables-snmp.c 2005-11-02 12:10:54.000000000 +0100 -+++ iptables-snmp-0.1.new/iptables-snmp.c 2009-08-02 01:13:30.000000000 +0200 -@@ -37,6 +37,9 @@ - - #include "libiptc/libiptc.h" - -+/* For backward compatibility */ -+typedef struct iptc_handle *iptc_handle_t; -+ - static oid agent_version_oid[] = { - BASE_OID, 1, 0, AGENT_VERSION_INDEX - }; diff --git a/net-firewall/iptables-snmp/files/003-libdir.patch b/net-firewall/iptables-snmp/files/003-libdir.patch deleted file mode 100644 index be4d4912..00000000 --- a/net-firewall/iptables-snmp/files/003-libdir.patch +++ /dev/null @@ -1,11 +0,0 @@ ---- Makefile.in.ori 2013-12-12 22:12:18.948424332 +0100 -+++ Makefile.in 2013-12-12 22:12:34.292771808 +0100 -@@ -34,7 +34,7 @@ top_srcdir = @top_srcdir@ - srcdir = @srcdir@ - prefix = @prefix@ - exec_prefix = @exec_prefix@ --libdir = $(prefix)/lib/ -+libdir = @libdir@ - - CC = @CC@ - CPPFLAGS = @CPPFLAGS@ diff --git a/net-firewall/iptables-snmp/iptables-snmp-0.1.ebuild b/net-firewall/iptables-snmp/iptables-snmp-0.1.ebuild index 918a950a..dfb09256 100644 --- a/net-firewall/iptables-snmp/iptables-snmp-0.1.ebuild +++ b/net-firewall/iptables-snmp/iptables-snmp-0.1.ebuild @@ -21,13 +21,18 @@ DEPEND="net-firewall/iptables RDEPEND="${DEPEND}" src_prepare() { - epatch "${FILESDIR}/001-use_libiptc.patch" - epatch "${FILESDIR}/002-use_libiptc.patch" - epatch "${FILESDIR}/003-libdir.patch" + epatch "${FILESDIR}"/*.patch + + tc-export CC +} + +src_compile() { + emake V=1 VERSION="${PVR}" } src_install() { - emake install INSTALL_PREFIX="${ED}" + emake install-lib V=1 \ + DESTDIR="${ED}" LIBDIR="/usr/$(get_libdir)" insinto /usr/share/snmp/mibs newins mibs/IPTABLES.MIB IPTABLES.txt |