diff options
author | Bertrand Jacquin <beber@meleeweb.net> | 2013-05-28 20:36:36 +0200 |
---|---|---|
committer | Bertrand Jacquin <beber@meleeweb.net> | 2013-05-28 23:30:14 +0200 |
commit | 6afb7ee8152b01ae3a2b41bd710974fce78f11d1 (patch) | |
tree | c5f5802ee7c3bb1b055b7ee60ca8228053402be4 /net-analyzer | |
parent | delete unused net-analyzer/cacti-cactid (diff) | |
download | portage-6afb7ee8152b01ae3a2b41bd710974fce78f11d1.tar.xz |
delete old net-analyzer/net-snmp work
Diffstat (limited to 'net-analyzer')
35 files changed, 0 insertions, 4462 deletions
diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest deleted file mode 100644 index ad45292f..00000000 --- a/net-analyzer/net-snmp/Manifest +++ /dev/null @@ -1,35 +0,0 @@ -AUX CVE-2008-6123.patch 867 RMD160 1e8b6521ae0955681493c1ba594eb0344183e147 SHA1 3742c405fab9ac829acc93383bc39ba5b39962e9 SHA256 31a9b72b252582cd84e7f673b670ebbd2153dc719894aa668a48b24d6ba516f6 -AUX multi-tun-segv.patch 7231 RMD160 d02666572b7691d9e279f2586820992b8394a2ef SHA1 c250eebb22385be994d9e7b67fbb67a0dec295ce SHA256 929cc61484fbf69134273acc3416f2644251d9a490850c901d8746b1d2f7c47a -AUX net-snmp-5.1.2-snmpconf-selinux.patch 286 RMD160 c78fd9d2a563ebafd21aa85a582b989a805eb645 SHA1 159990e855cfeb50ac3657d1b97eda181d4ffb9e SHA256 70b4bdaa243efd5ae5703b3272063314fc56b6e2333f7c650b635ddab141f874 -AUX net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 RMD160 904d195cafa4334f9d8116a3d13eff4181e06d3b SHA1 0101a446e217a95f621e634544b19490fa01c072 SHA256 893180ba84ef69381d270286f042852a200c35b7792f55fe23920a0bcb1d8fb9 -AUX net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 RMD160 c11898fcfe7964f2263c64a164b5010741be3e8b SHA1 670a0d4c5de33d79fc026cb4190f8c7f55ac9d10 SHA256 0304fe236b335eab2a42c9009e66310c03c82b9ead9886d6f558fc245f83581c -AUX net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 RMD160 05b1099c32c2091e9606f167288a21503510cc20 SHA1 278b48283e536bc76935865ec227c402019e7df6 SHA256 100f18794f11c0d0fe43e9f50cec755158906268b4c2b560f45f8d7ff797422e -AUX net-snmp-5.2.2-asneeded.patch 3014 RMD160 4394ac08e2ab0a4c57036b61b554e1bdc7c29ff2 SHA1 9c2f1e4ac9ffab8f604740b47dce9914dd0200f6 SHA256 2caa3beb56a0087e1800d875988ceaf11da0ba1eb5121804f2827d4b53a682b7 -AUX net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 RMD160 3b716cac3df53db19b2c4eb295a5fb8045f96125 SHA1 e23506ea9f27e82d796e5896158632cb93f0f8ac SHA256 7186744012f9afe8834366c96784d9088fd6f0c306c0fc65eb0e8bbdc8cdf338 -AUX net-snmp-5.3.1-retrans-time.patch 3240 RMD160 54e63d1cc4fe9791d0889480f57cf5f651fa9a60 SHA1 8ca179d5620a1a0b38f45c04d3f790099a426828 SHA256 4ccd692d796833fba418af6653cbc33f7d24c04f6093d5e504d5c6c18cff1f6b -AUX net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 RMD160 4c2d25a50375f950642a49d79678532f89b36ede SHA1 adea9cce4b81e1d66757194257e9d8d489c32d96 SHA256 a806f3208729c5b3f8946d4bdf3e97c3540e99adf91b363b308adcc96b6c051b -AUX net-snmp-5.4-exec-crash.patch 567 RMD160 fe110ace0ae451a8cf25d18d4133fb0d85dcaf5c SHA1 4a4538958e4c805981e1f0da4d6f1980a03aeab6 SHA256 2c4d3d281380d394d0d349c37839bb89f3d82d3e1c43513e042d24126441741c -AUX net-snmp-5.4-makefile.patch 597 RMD160 90f8e6db0a05fd21c06e98b65b4bbd377f931fe9 SHA1 2ff51b2ab2df2224dd34ca1af16430fbf0b97927 SHA256 fd8c6ceda9c5d99cd92f81a7977d2134960ee14fac3ab9f1f8c6d03c6a69edb1 -AUX net-snmp-5.4.1-CVE-2008-2292.patch 6212 RMD160 79b2e05df4623972dbaea2dd92dea4a46975c566 SHA1 7fe5f5e9785deeaa1852de76fcba17cbbf9781dc SHA256 10908598aa445bad84708af3ebba1e6a6d985a8008e0c4be42df556851f6a48d -AUX net-snmp-5.4.1-clientaddr-fix.patch 2942 RMD160 02893663d464cce39f6b54c3e27776d27fe5fe67 SHA1 fee0d795797f73de463aceaad13ebc24311763b9 SHA256 355b5661d1ecc066a8094969269b8af35e63e406a32547d6b0f8c3c57b1a4685 -AUX net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch 16053 RMD160 1d33a23b165946f7dd4e97b329c79d27c42ec913 SHA1 c4a107c35cf96b3c52a3156ab9f999b46582b693 SHA256 2d3aad8d76046e11a520d45bc5d3304b1ceff91c6d5a5510dc020aae47506b3d -AUX net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch 4740 RMD160 305f962976c6afc39b0ee37706f34d05ea768874 SHA1 93b806c407048cba4f5c63137df1e819c83d0010 SHA256 0872a11f48106f1a2a9c4a8a894abe31b04ee607bdfd44b8207c8e659213ef31 -AUX net-snmp-5.4.1-perl-asneeded.patch 1219 RMD160 caced600c35165603069e62a17a664d7a0180586 SHA1 89bedb2424d65176a9bfba8c9b318b1d50b5b3ed SHA256 42640b545363cd5c6c7eef6b17b10c1d256e189ceb7b7c874baa4041de24e151 -AUX net-snmp-5.4.1-process-count-race.patch 1489 RMD160 221f218270b83afec95d1efd260109b8baf05626 SHA1 3986f4789c145dd7182bf5f7d94a1cda0504ce5c SHA256 74a6e001de7a855079be988dd0cb23190095082e1a9adaefb9a9cac677ffa116 -AUX net-snmp-5.4.1-sensors3-version_detect.patch 1391 RMD160 eba5c1cba2fc5d0484143eb4b41f656f5f72bee4 SHA1 8c8ebcc9e4725e91cc7b07cdd45cbcf6e2ed806e SHA256 e18f7bd358c4f587793f9e9250489200d2708b50529dfe222f04b71617fa1e59 -AUX net-snmp-5.4.1-sensors3.patch 48401 RMD160 9899c587eb252cf9edac758133a420ef0307c315 SHA1 cd5adc2fab5c1d58c8a318d34aa3fcd4fd25c455 SHA256 e74e06a5f23350a2851fdc9f419335767d898ec66dd809e1c0413e39034d6f53 -AUX net-snmp-5.4.1-suppresssuppress-annoying.patch 800 RMD160 aa23a30241ae64aeed6a08a630326fd7c2e0f9fe SHA1 2b99c56d1f659f324c5676d48ab257ea3b55467f SHA256 f5249b782079be96256ab6e7a0d398c04dfbcabffa7f4c716fe1abd39897aabe -AUX net-snmp-5.4.2.1-BJA-cross-net-snmp-config.diff 265 RMD160 c4bc4d420087b06d3de8549f60d656600b65c6b6 SHA1 27854b0c0f3df8704708e5467a17a6ade5634743 SHA256 3350f601dfc5a005f528e51cc24e9db7d68999ccf5a004991594e95bec0b2811 -AUX net-snmp-5.4.2.1-perlcc-hppa.patch 644 RMD160 4200893069839a8168dc706c1d940a029e975f02 SHA1 118157050c5c0cfbdb5aeb08dc3f5f020c0ccd5e SHA256 54f3fdd3b62ee8ceca1bd61c4db4bca075619afc958d04ded6178380785a2fec -AUX net-snmp-lm_sensors.patch 13686 RMD160 b2e67c6f5a5347442fbaa97c9ce209f1d9bed194 SHA1 3e795339fc93306a4d662feeaa16faca2509a058 SHA256 51dc2363a687d9f4e65b0a59e767b33129d07623a0b4da07b685e406d2576b86 -AUX net-snmp-maxreps.patch 5495 RMD160 a1a958f292f780f5c4f8ec66a4ec350f261d3214 SHA1 2ed58bb7c1136452532909154a1cb2c2f322467d SHA256 5e37133da687d84cb06eea7899e1be23d9613be1d24f43e8e8555577f3d47da7 -AUX snmpd-5.1.conf 606 RMD160 a243da5c9dfde4a5cfb16bd7d4491cedb7879620 SHA1 5c7c45a434cb566cfec678050384f9ab6af912a9 SHA256 f569766eb6ca203a0c9549b2592d6f36ae4999cfaabc423cad5a864201a86ac9 -AUX snmpd-5.1.rc6 714 RMD160 1f7cef43888500044be0b0d4938574922b48bcfd SHA1 7468069b6e12b527f5a6a8026b67125f3545d243 SHA256 8f02a26a794a5c37e4cb4092ab61f82a6d7ec5876146738d4630ed147cc9ccf6 -AUX snmpd.conf 598 RMD160 c72a20fe6d4682ceea533587762782d62906b630 SHA1 51ebdca93c68ca04b7f402fad4f504422ec2c6cf SHA256 1f4f07b831c3227588fd546423137ed5c60a602fbee13b0d66edd801e4e7d598 -AUX snmpd.init 1054 RMD160 6cc814d19524e1899b4bb9539ee9752304451bc9 SHA1 ed2b1a4bd7da84ca6294c0df66cace2e7c0ffe72 SHA256 824ae327db4d76fe4cdc882f06ac989e510ee1ee96c90137ab84bc18446ba8b6 -AUX snmpd.rc7 706 RMD160 137d85e5f2b7cae62e214141aabcec495777007e SHA1 8d94d3bb2d3b43e20604030dc585c735685cf99b SHA256 93337ebeac92ec0073c896db0a4384beebf84ee17365bdc2594285fd33ac7dfe -AUX snmptrapd.conf 635 RMD160 aba7b7196835bd359174156a527e13188f76e248 SHA1 0d296caa01c789455c3cd4c67cd81aca5547681d SHA256 902d73cb44446df060bf20e0c8ef0f8815d5b846f96d93894913d3309a3841b3 -AUX snmptrapd.init 624 RMD160 799faf488a62bc219d3765ed6d6283ca7764ad1c SHA1 1fdef5a0a29f181c2df31b9d7adc4d4ebb8b018c SHA256 0e6dae4ca0213be9f9311c8dacdf36e7fea05150db48d15660506d53abda5a39 -AUX snmptrapd.rc7 557 RMD160 e67117fbcb0a6f8668cb1abbc8fcfcb548ebfdb5 SHA1 dcaac6c0f9e086e49f653f100e0c3f9a7f65db1d SHA256 3594345cdf3c9a5a04073ec11a54e4a19881b27288cdbf22874cca5d0a0f624c -DIST net-snmp-5.4.2.1.tar.gz 5185390 RMD160 2148c42d486ed88f9cfc3ca1d50c68abcd7e3d63 SHA1 4f2df9ea62344fe840f493d0e08abe5de3697862 SHA256 11a8baf167f7bfff60d2590e050991400a3a082923dbcdbf85e0e0ce46eb247c -EBUILD net-snmp-5.4.2.1-r4.ebuild 6024 RMD160 c1bd78186aec9add484d3869ed840d3e9ddc6bc7 SHA1 7745b88dbb8faa555d8ff57fef81fb806a089b3b SHA256 a00279ab6a940bd7765299db14b2db5f302412d7229d1ea305379a21ccf5aa43 diff --git a/net-analyzer/net-snmp/files/CVE-2008-6123.patch b/net-analyzer/net-snmp/files/CVE-2008-6123.patch deleted file mode 100644 index b4b06f63..00000000 --- a/net-analyzer/net-snmp/files/CVE-2008-6123.patch +++ /dev/null @@ -1,19 +0,0 @@ -diff -Naur snmplib.orig/snmpUDPDomain.c snmplib/snmpUDPDomain.c ---- snmplib.orig/snmpUDPDomain.c 2007-10-11 22:46:30.000000000 +0200 -+++ snmplib/snmpUDPDomain.c 2009-07-10 23:41:37.000000000 +0200 -@@ -104,12 +110,12 @@ - char tmp[64]; - to = (struct sockaddr_in *) &(addr_pair->remote_addr); - if (to == NULL) { -- sprintf(tmp, "UDP: [%s]->unknown", -+ sprintf(tmp, "UDP: unknown->[%s]", - inet_ntoa(addr_pair->local_addr)); - } else { -- sprintf(tmp, "UDP: [%s]->", inet_ntoa(addr_pair->local_addr)); -- sprintf(tmp + strlen(tmp), "[%s]:%hd", -+ sprintf(tmp, "UDP: [%s]:%hu->", - inet_ntoa(to->sin_addr), ntohs(to->sin_port)); -+ sprintf(tmp + strlen(tmp), "[%s]", inet_ntoa(addr_pair->local_addr)); - } - return strdup(tmp); - } diff --git a/net-analyzer/net-snmp/files/multi-tun-segv.patch b/net-analyzer/net-snmp/files/multi-tun-segv.patch deleted file mode 100644 index e47f5b79..00000000 --- a/net-analyzer/net-snmp/files/multi-tun-segv.patch +++ /dev/null @@ -1,153 +0,0 @@ -Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c
-===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c (revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_data_access.c (working copy)
-@@ -258,9 +258,10 @@
- if ((NULL != rowreq_ctx) &&
- (MFD_SUCCESS ==
- ipAddressTable_indexes_set(rowreq_ctx,
-+ ipaddress_entry->ia_address_len + 1,
-+ ipaddress_entry->ia_address,
- ipaddress_entry->ia_address_len,
-- ipaddress_entry->ia_address,
-- ipaddress_entry->ia_address_len))) {
-+ ipaddress_entry->if_index))) {
- if (CONTAINER_INSERT(container, rowreq_ctx) < 0) {
- DEBUGMSGTL (("ipAddressTable:access","container insert failed for new entry\n"));
- ipAddressTable_release_rowreq_ctx(rowreq_ctx);
-Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c
-===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c (revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.c (working copy)
-@@ -348,10 +348,18 @@
- *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4;
- break;
-
-+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z:
-+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV4Z;
-+ break;
-+
- case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6:
- *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6;
- break;
-
-+ case INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z:
-+ *mib_ipAddressAddrType_val_ptr = INETADDRESSTYPE_IPV6Z;
-+ break;
-+
- default:
- snmp_log(LOG_ERR, "couldn't map value %ld for ipAddressAddrType\n",
- raw_ipAddressAddrType_val);
-@@ -382,8 +390,11 @@
- ipAddressTable_indexes_set_tbl_idx(ipAddressTable_mib_index * tbl_idx,
- u_long ipAddressAddrType_val,
- char *ipAddressAddr_val_ptr,
-- size_t ipAddressAddr_val_ptr_len)
-+ size_t ipAddressAddr_val_ptr_len,
-+ u_long ipAddressAddr_ifIndex)
- {
-+ uint32_t zone = htonl(ipAddressAddr_ifIndex);
-+
- DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set_tbl_idx", "called\n"));
-
- /*
-@@ -409,6 +420,11 @@
- memcpy(tbl_idx->ipAddressAddr, ipAddressAddr_val_ptr,
- ipAddressAddr_val_ptr_len * sizeof(ipAddressAddr_val_ptr[0]));
-
-+ /** zone */
-+ tbl_idx->ipAddressAddr_len += sizeof(zone);
-+ memcpy(&tbl_idx->ipAddressAddr[ipAddressAddr_val_ptr_len *
-+ sizeof(ipAddressAddr_val_ptr[0])],
-+ &zone, sizeof(zone));
-
- return MFD_SUCCESS;
- } /* ipAddressTable_indexes_set_tbl_idx */
-@@ -430,7 +446,8 @@
- ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx * rowreq_ctx,
- u_long ipAddressAddrType_val,
- char *ipAddressAddr_val_ptr,
-- size_t ipAddressAddr_val_ptr_len)
-+ size_t ipAddressAddr_val_ptr_len,
-+ u_long ipAddressAddr_ifIndex)
- {
- DEBUGMSGTL(("verbose:ipAddressTable:ipAddressTable_indexes_set",
- "called\n"));
-@@ -439,7 +456,8 @@
- ipAddressTable_indexes_set_tbl_idx(&rowreq_ctx->tbl_idx,
- ipAddressAddrType_val,
- ipAddressAddr_val_ptr,
-- ipAddressAddr_val_ptr_len))
-+ ipAddressAddr_val_ptr_len,
-+ ipAddressAddr_ifIndex))
- return MFD_ERROR;
-
- /*
-Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h
-===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h (revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable_constants.h (working copy)
-@@ -106,7 +106,9 @@
- * simplistic map of address length to type
- */
- #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4 4
-+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV4Z 5
- #define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6 16
-+#define INTERNAL_IPADDRESSTABLE_IPADDRESSADDRTYPE_IPV6Z 17
-
-
- /*************************************************************
-Index: agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h
-===================================================================
---- agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h (revision 16711)
-+++ agent/mibgroup/ip-mib/ipAddressTable/ipAddressTable.h (working copy)
-@@ -273,14 +273,16 @@
- u_long ipAddressAddrType_val,
- char *ipAddressAddr_val_ptr,
- size_t
-- ipAddressAddr_val_ptr_len);
-+ ipAddressAddr_val_ptr_len,
-+ u_long ipAddressAddr_ifIndex);
- int ipAddressTable_indexes_set(ipAddressTable_rowreq_ctx *
- rowreq_ctx,
- u_long
- ipAddressAddrType_val,
- char *ipAddressAddr_val_ptr,
- size_t
-- ipAddressAddr_val_ptr_len);
-+ ipAddressAddr_val_ptr_len,
-+ u_long ipAddressAddr_ifIndex);
-
-
-
-Index: agent/mibgroup/ip-mib/data_access/ipaddress_common.c
-===================================================================
---- agent/mibgroup/ip-mib/data_access/ipaddress_common.c (revision 16711)
-+++ agent/mibgroup/ip-mib/data_access/ipaddress_common.c (working copy)
-@@ -411,6 +415,7 @@
- {
- const netsnmp_ipaddress_entry *lh = (const netsnmp_ipaddress_entry *)lhs;
- const netsnmp_ipaddress_entry *rh = (const netsnmp_ipaddress_entry *)rhs;
-+ int rc;
-
- netsnmp_assert(NULL != lhs);
- netsnmp_assert(NULL != rhs);
-@@ -426,5 +431,17 @@
- /*
- * length equal, compare address
- */
-- return memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
-+ rc = memcmp(lh->ia_address, rh->ia_address, lh->ia_address_len);
-+ if (rc)
-+ return rc;
-+
-+ /*
-+ * address same, compare ifIndex
-+ */
-+ if (lh->if_index < rh->if_index)
-+ return -1;
-+ else if (lh->if_index > rh->if_index)
-+ return 1;
-+
-+ return 0;
- }
diff --git a/net-analyzer/net-snmp/files/net-snmp-5.1.2-snmpconf-selinux.patch b/net-analyzer/net-snmp/files/net-snmp-5.1.2-snmpconf-selinux.patch deleted file mode 100644 index 9171b693..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.1.2-snmpconf-selinux.patch +++ /dev/null @@ -1,12 +0,0 @@ -https://bugzilla.redhat.com/show_bug.cgi?id=248329 - ---- net-snmp-5.1.2/local/snmpconf.orig 2004-04-20 16:20:51.000000000 +0200 -+++ net-snmp-5.1.2/local/snmpconf 2007-07-09 15:34:48.000000000 +0200 -@@ -585,6 +585,7 @@ - } - } - close(O); -+ system("restorecon $outputf"); - } - } - diff --git a/net-analyzer/net-snmp/files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch b/net-analyzer/net-snmp/files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch deleted file mode 100644 index 9ba30336..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch +++ /dev/null @@ -1,147 +0,0 @@ ---- configure.orig 2005-02-17 20:20:50.735101408 +0930 -+++ configure 2005-02-17 20:36:35.883389400 +0930 -@@ -1253,7 +1253,9 @@ - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-pic try to use only PIC/non-PIC objects default=use both - --with-libwrap=LIBPATH Compile in libwrap (tcp_wrappers) support. -+ --without-elf use elf libraries - --with-zlib=DIR use libz in DIR -+ --with-bzip2=DIR use libbzip2 in DIR - - Some influential environment variables: - CC C compiler command -@@ -5911,7 +5913,7 @@ - case $host in - *-*-irix6*) - # Find out which ABI we are using. -- echo '#line 5914 "configure"' > conftest.$ac_ext -+ echo '#line 5916 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? -@@ -6483,7 +6485,7 @@ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" - compiler_c_o=no --if { (eval echo configure:6486: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then -+if { (eval echo configure:6488: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then -@@ -8447,7 +8449,7 @@ - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF --#line 8450 "configure" -+#line 8452 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -8545,7 +8547,7 @@ - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF --#line 8548 "configure" -+#line 8550 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -14405,6 +14407,12 @@ - - # nlist is needed for uptime on some sytems in the generic library - -+# Check whether --with-elf or --without-elf was given. -+if test "${with_elf+set}" = set; then -+ withval="$with_elf" -+ -+ if test "x$with_elf" != "xno"; then -+ - echo "$as_me:$LINENO: checking for nlist in -lelf" >&5 - echo $ECHO_N "checking for nlist in -lelf... $ECHO_C" >&6 - if test "${ac_cv_lib_elf_nlist+set}" = set; then -@@ -14478,6 +14486,11 @@ - - fi - -+ fi -+ -+fi; -+ -+ - - # On some platforms (Irix) libnsl and libsocket should not be used. - echo "$as_me:$LINENO: checking for gethostbyname" >&5 -@@ -15250,7 +15263,17 @@ - - - # two variants of bzip2 need checking. -- echo "$as_me:$LINENO: checking for bzread in -lbz2" >&5 -+ -+# Check whether --with-bzip2 or --without-bzip2 was given. -+if test "${with_bzip2+set}" = set; then -+ withval="$with_bzip2" -+ -+ if test -d "$withval"; then -+ CPPFLAGS="${CPPFLAGS} -I$withval/include" -+ LDFLAGS="${LDFLAGS} -L$withval/lib" -+ fi -+ if test "x$with_bzip2" != "xno"; then -+ echo "$as_me:$LINENO: checking for bzread in -lbz2" >&5 - echo $ECHO_N "checking for bzread in -lbz2... $ECHO_C" >&6 - if test "${ac_cv_lib_bz2_bzread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -@@ -15387,6 +15410,10 @@ - - fi - -+ fi -+ -+fi; -+ - - # two variants of db1 need checking. - echo "$as_me:$LINENO: checking for dbopen in -ldb1" >&5 ---- configure.in.orig 2005-02-17 19:14:14.000000000 +0930 -+++ configure.in 2005-02-17 20:36:18.450039672 +0930 -@@ -1,3 +1,4 @@ -+Wrpm - # Portions of this file are subject to the following copyright. See - # the Net-SNMP's COPYING file for more details and other copyrights - # that may apply: -@@ -2172,7 +2173,14 @@ - # AC_CHECK_LIB(des, main) - AC_CHECK_LIB(m, asin) - # nlist is needed for uptime on some sytems in the generic library --AC_CHECK_LIB(elf, nlist) -+ AC_ARG_WITH(elf, -+ [ --without-elf use elf libraries],[ -+ if test "x$with_elf" != "xno"; then -+ AC_CHECK_LIB(elf, nlist) -+ fi -+ ]) -+ -+ - - # On some platforms (Irix) libnsl and libsocket should not be used. - AC_CHECK_FUNC(gethostbyname, AC_DEFINE(HAVE_GETHOSTBYNAME), -@@ -2219,8 +2227,18 @@ - CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}) - - # two variants of bzip2 need checking. -- AC_CHECK_LIB(bz2, bzread, [_rpmlibs="$_rpmlibs -lbz2"], -- AC_CHECK_LIB(bz2, BZ2_bzread, [_rpmlibs="$_rpmlibs -lbz2"],)) -+ AC_ARG_WITH(bzip2, -+ [ --with-bzip2[=DIR] use libbzip2 in DIR],[ -+ if test -d "$withval"; then -+ CPPFLAGS="${CPPFLAGS} -I$withval/include" -+ LDFLAGS="${LDFLAGS} -L$withval/lib" -+ fi -+ if test "x$with_bzip2" != "xno"; then -+ AC_CHECK_LIB(bz2, bzread, [_rpmlibs="$_rpmlibs -lbz2"], -+ AC_CHECK_LIB(bz2, BZ2_bzread, [_rpmlibs="$_rpmlibs -lbz2"],)) -+ fi -+ ]) -+ - - # two variants of db1 need checking. - AC_CHECK_LIB(db1, dbopen, [_rpmlibs="-ldb1 $_rpmlibs"], diff --git a/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-64bit-interface-counters.diff b/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-64bit-interface-counters.diff deleted file mode 100644 index 18515d44..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-64bit-interface-counters.diff +++ /dev/null @@ -1,29 +0,0 @@ -diff -u -p -r5.33 interfaces.c ---- agent/mibgroup/mibII/interfaces.c 9 May 2005 20:06:02 -0000 5.33 -+++ agent/mibgroup/mibII/interfaces.c 9 Jun 2005 20:08:04 -0000 -@@ -1552,19 +1552,19 @@ Interface_Scan_Init(void) - if (!strcmp(ifname_buf, "lo") && rec_pkt > 0 && !snd_pkt) - snd_pkt = rec_pkt; - -- nnew->if_ipackets = rec_pkt; -+ nnew->if_ipackets = rec_pkt & 0xffffffff; - nnew->if_ierrors = rec_err; -- nnew->if_opackets = snd_pkt; -+ nnew->if_opackets = snd_pkt & 0xffffffff; - nnew->if_oerrors = snd_err; - nnew->if_collisions = coll; - if (scan_line_to_use == scan_line_2_2) { -- nnew->if_ibytes = rec_oct; -- nnew->if_obytes = snd_oct; -+ nnew->if_ibytes = rec_oct & 0xffffffff; -+ nnew->if_obytes = snd_oct & 0xffffffff; - nnew->if_iqdrops = rec_drop; - nnew->if_snd.ifq_drops = snd_drop; - } else { -- nnew->if_ibytes = rec_pkt * 308; -- nnew->if_obytes = snd_pkt * 308; -+ nnew->if_ibytes = (rec_pkt * 308) & 0xffffffff; -+ nnew->if_obytes = (snd_pkt * 308) & 0xffffffff; - } - - /* diff --git a/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-insecure-fixproc.diff b/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-insecure-fixproc.diff deleted file mode 100644 index cad67929..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-insecure-fixproc.diff +++ /dev/null @@ -1,52 +0,0 @@ ---- local/fixproc.orig 2005-05-18 09:57:16.000000000 -0400 -+++ local/fixproc 2005-05-18 11:00:38.000000000 -0400 -@@ -129,6 +129,9 @@ - # - # Timothy Kong 3/1995 - -+require File::Temp; -+use File::Temp(); -+ - $database_file = '/local/etc/fixproc.conf'; - - $debug = 0; # specify debug level using -dN -@@ -196,7 +199,6 @@ - printf (stderr "create_sh_script\n") if ($debug > 0); - - $! = $fixproc_error; -- open (file, ">"."$file") || die "$0: cannot open $file\n"; - while ( $shell_lines[$i] ne $shell_end_marker ) - { - printf (file "%s", $shell_lines[$i]); -@@ -231,13 +233,13 @@ - { - # it must be "shell", so execute the shell script defined in database - -- local ($tmpfile) = "/tmp/fix_$$"; -+ local ($tmpfile) = new File::Temp(TEMPLATE => 'fix_XXXXX', -+ DIR => '/tmp'); - - &create_sh_script ($fix{$proc}, $tmpfile); - - # return code is number divided by 256 - $error_code = (system "$tmpfile") / 256; -- system "rm $tmpfile"; - return ($fix_failed_error) if ($error_code != 0); - # sleep needed here? - return &do_exist ($proc); -@@ -262,13 +264,13 @@ - # if not "exist", then it must be "shell", so execute the shell script - # defined in database - -- local ($tmpfile) = "/tmp/check_$$"; -+ local ($tmpfile) = new File::Temp(TEMPLATE => 'check_XXXXXX', -+ DIR => '/tmp'); - - &create_sh_script ($check{$proc}, $tmpfile); - - # return code is number divided by 256 - $error_code = (system "$tmpfile") / 256; -- system "rm $tmpfile"; - return ($check_failed_error) if ($error_code != 0); - - # check passed, continue diff --git a/net-analyzer/net-snmp/files/net-snmp-5.2.2-asneeded.patch b/net-analyzer/net-snmp/files/net-snmp-5.2.2-asneeded.patch deleted file mode 100644 index 12af501d..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.2.2-asneeded.patch +++ /dev/null @@ -1,70 +0,0 @@ -Index: net-snmp-5.2.2/snmplib/Makefile.in -=================================================================== ---- net-snmp-5.2.2.orig/snmplib/Makefile.in -+++ net-snmp-5.2.2/snmplib/Makefile.in -@@ -185,11 +185,11 @@ all: standardall - - # how to build the libraries. - libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION): ${TOBJS} -- $(LIB_LD_CMD) libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION) ${TOBJS} -+ $(LIB_LD_CMD) libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION) ${TOBJS} @LIBCRYPTO@ - $(RANLIB) libnetsnmp.$(LIB_EXTENSION)$(LIB_VERSION) - - libsnmp.$(LIB_EXTENSION)$(LIB_VERSION): ${TOBJS} -- $(LIB_LD_CMD) libsnmp.$(LIB_EXTENSION)$(LIB_VERSION) ${TOBJS} -+ $(LIB_LD_CMD) libsnmp.$(LIB_EXTENSION)$(LIB_VERSION) ${TOBJS} @LIBCRYPTO@ - $(RANLIB) libsnmp.$(LIB_EXTENSION)$(LIB_VERSION) - - # -Index: net-snmp-5.2.2/configure.in -=================================================================== ---- net-snmp-5.2.2.orig/configure.in -+++ net-snmp-5.2.2/configure.in -@@ -2362,11 +2362,12 @@ if test $? -eq 0 ; then - *) - AC_CHECK_HEADER(sensors/sensors.h,, - [AC_MSG_ERROR([asked to use lm_sensors but I couldn't find sensors/sensors.h])]) -- AC_CHECK_LIB(sensors, sensors_get_detected_chips, LIBS="${LIBS} -lsensors", -+ AC_CHECK_LIB(sensors, sensors_get_detected_chips, SENSORLIBS="-lsensors", - [AC_MSG_ERROR([asked to use lm_sensors but I couldn't find -lsensors])]) - ;; - esac - fi -+AC_SUBST(SENSORLIBS) - - # - # Install the various perl modules -@@ -2691,6 +2692,7 @@ if test "x$useopenssl" != "xno" ; then - encrmodes="[disabled]" - fi - AC_DEFINE(USE_OPENSSL) -+ LIBCRYPTO="-lcrypto" - AC_MSG_RESULT(OpenSSL Support) - elif test "x$usepkcs" != "xno" ; then - authmodes="MD5 SHA1" -@@ -2710,6 +2712,7 @@ fi - if test "x$enable_md5" = "xno"; then - authmodes=`echo $authmodes | sed 's/MD5 *//;'` - fi -+AC_SUBST(LIBCRYPTO) - - AC_MSG_CACHE_ADD(Authentication support: $authmodes) - AC_MSG_CACHE_ADD(Encryption support: $encrmodes) -Index: net-snmp-5.2.2/agent/Makefile.in -=================================================================== ---- net-snmp-5.2.2.orig/agent/Makefile.in -+++ net-snmp-5.2.2/agent/Makefile.in -@@ -130,11 +130,11 @@ snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) - - - libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION) -- $(LIB_LD_CMD) libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION) ${LLIBAGENTOBJS} $(LIB_LD_LIBS) -+ $(LIB_LD_CMD) libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION) ${LLIBAGENTOBJS} $(LIB_LD_LIBS) helpers/libnetsnmphelpers.la - $(RANLIB) libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION) - - libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION): ${LMIBOBJS} -- $(LIB_LD_CMD) libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION) ${LMIBOBJS} $(LIB_LD_LIBS) -+ $(LIB_LD_CMD) libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION) ${LMIBOBJS} $(LIB_LD_LIBS) @SENSORLIBS@ - $(RANLIB) libnetsnmpmibs.$(LIB_EXTENSION)$(LIB_VERSION) - - embedperlinstall: diff --git a/net-analyzer/net-snmp/files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch b/net-analyzer/net-snmp/files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch deleted file mode 100644 index 362fcbcc..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch +++ /dev/null @@ -1,144 +0,0 @@ -diff --exclude='*~' -Naur net-snmp-5.2.2.orig/configure net-snmp-5.2.2/configure ---- net-snmp-5.2.2.orig/configure 2005-12-26 19:05:44.000000000 -0200 -+++ net-snmp-5.2.2/configure 2005-12-26 19:10:47.000000000 -0200 -@@ -1254,7 +1254,9 @@ - --with-gnu-ld assume the C compiler uses GNU ld default=no - --with-pic try to use only PIC/non-PIC objects default=use both - --with-libwrap=LIBPATH Compile in libwrap (tcp_wrappers) support. -+ --without-elf use elf libraries - --with-zlib=DIR use libz in DIR -+ --with-bzip2=DIR use libbzip2 in DIR - - Some influential environment variables: - CC C compiler command -@@ -5935,7 +5937,7 @@ - case $host in - *-*-irix6*) - # Find out which ABI we are using. -- echo '#line 5938 "configure"' > conftest.$ac_ext -+ echo '#line 5940 "configure"' > conftest.$ac_ext - if { (eval echo "$as_me:$LINENO: \"$ac_compile\"") >&5 - (eval $ac_compile) 2>&5 - ac_status=$? -@@ -6507,7 +6509,7 @@ - save_CFLAGS="$CFLAGS" - CFLAGS="$CFLAGS -o out/conftest2.$ac_objext" - compiler_c_o=no --if { (eval echo configure:6510: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then -+if { (eval echo configure:6512: \"$ac_compile\") 1>&5; (eval $ac_compile) 2>out/conftest.err; } && test -s out/conftest2.$ac_objext; then - # The compiler can only warn and ignore the option if not recognized - # So say no if there are warnings - if test -s out/conftest.err; then -@@ -8471,7 +8473,7 @@ - lt_dlunknown=0; lt_dlno_uscore=1; lt_dlneed_uscore=2 - lt_status=$lt_dlunknown - cat > conftest.$ac_ext <<EOF --#line 8474 "configure" -+#line 8476 "configure" - #include "confdefs.h" - - #if HAVE_DLFCN_H -@@ -13996,6 +13998,12 @@ - - # nlist is needed for uptime on some sytems in the generic library - # add hosts which don't use nlist to the blank first line -+# Check whether --with-elf or --without-elf was given. -+if test "${with_elf+set}" = set; then -+ withval="$with_elf" -+ -+ if test "x$with_elf" != "xno"; then -+ - case $target_os in - linux*) ;; - irix*) # Check for nlist in mld (irix) -@@ -14226,6 +14234,10 @@ - ;; - esac - -+ fi -+ -+fi; -+ - # On some platforms (Irix) libnsl and libsocket should not be used. - echo "$as_me:$LINENO: checking for gethostbyname" >&5 - echo $ECHO_N "checking for gethostbyname... $ECHO_C" >&6 -@@ -16020,7 +16032,16 @@ - - - # two variants of bzip2 need checking. -- echo "$as_me:$LINENO: checking for bzread in -lbz2" >&5 -+# Check whether --with-bzip2 or --without-bzip2 was given. -+if test "${with_bzip2+set}" = set; then -+ withval="$with_bzip2" -+ -+ if test -d "$withval"; then -+ CPPFLAGS="${CPPFLAGS} -I$withval/include" -+ LDFLAGS="${LDFLAGS} -L$withval/lib" -+ fi -+ if test "x$with_bzip2" != "xno"; then -+ echo "$as_me:$LINENO: checking for bzread in -lbz2" >&5 - echo $ECHO_N "checking for bzread in -lbz2... $ECHO_C" >&6 - if test "${ac_cv_lib_bz2_bzread+set}" = set; then - echo $ECHO_N "(cached) $ECHO_C" >&6 -@@ -16157,6 +16178,9 @@ - - fi - -+ fi -+ -+fi; - - # two variants of db1 need checking. - echo "$as_me:$LINENO: checking for dbopen in -ldb1" >&5 -diff --exclude='*~' -Naur net-snmp-5.2.2.orig/configure.in net-snmp-5.2.2/configure.in ---- net-snmp-5.2.2.orig/configure.in 2005-12-26 19:05:44.000000000 -0200 -+++ net-snmp-5.2.2/configure.in 2005-12-26 19:23:50.000000000 -0200 -@@ -1,3 +1,4 @@ -+Wrpm - # Portions of this file are subject to the following copyright. See - # the Net-SNMP's COPYING file for more details and other copyrights - # that may apply: -@@ -2152,11 +2153,21 @@ - case $target_os in - linux*) ;; - irix*) # Check for nlist in mld (irix) -- AC_CHECK_LIB(elf, nlist) -+ AC_ARG_WITH(elf, -+ [ --without-elf use elf libraries],[ -+ if test "x$with_elf" != "xno"; then -+ AC_CHECK_LIB(elf, nlist) -+ fi -+ ]) - AC_CHECK_LIB(mld, nlist) - ;; - *) # default -- AC_CHECK_LIB(elf, nlist) -+ AC_ARG_WITH(elf, -+ [ --without-elf use elf libraries],[ -+ if test "x$with_elf" != "xno"; then -+ AC_CHECK_LIB(elf, nlist) -+ fi -+ ]) - ;; - esac - -@@ -2280,8 +2291,17 @@ - CPPFLAGS=${_cppflags} LDFLAGS=${_ldflags}) - - # two variants of bzip2 need checking. -- AC_CHECK_LIB(bz2, bzread, [_rpmlibs="$_rpmlibs -lbz2"], -- AC_CHECK_LIB(bz2, BZ2_bzread, [_rpmlibs="$_rpmlibs -lbz2"],)) -+ AC_ARG_WITH(bzip2, -+ [ --with-bzip2[=DIR] use libbzip2 in DIR],[ -+ if test -d "$withval"; then -+ CPPFLAGS="${CPPFLAGS} -I$withval/include" -+ LDFLAGS="${LDFLAGS} -L$withval/lib" -+ fi -+ if test "x$with_bzip2" != "xno"; then -+ AC_CHECK_LIB(bz2, bzread, [_rpmlibs="$_rpmlibs -lbz2"], -+ AC_CHECK_LIB(bz2, BZ2_bzread, [_rpmlibs="$_rpmlibs -lbz2"],)) -+ fi -+ ]) - - # two variants of db1 need checking. - AC_CHECK_LIB(db1, dbopen, [_rpmlibs="-ldb1 $_rpmlibs"], diff --git a/net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch b/net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch deleted file mode 100644 index 45eb35cf..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch +++ /dev/null @@ -1,93 +0,0 @@ -Index: agent/mibgroup/if-mib/data_access/interface_linux.c -=================================================================== ---- agent/mibgroup/if-mib/data_access/interface_linux.c.orig -+++ agent/mibgroup/if-mib/data_access/interface_linux.c -@@ -22,6 +22,8 @@ - #include "interface_ioctl.h" - - #include <sys/types.h> -+#include <sys/stat.h> -+#include <unistd.h> - - #ifdef HAVE_LINUX_ETHTOOL_H - #include <sys/types.h> -@@ -40,6 +42,10 @@ unsigned int - netsnmp_linux_interface_get_if_speed_mii(int fd, const char *name); - #endif - -+#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS "/proc/sys/net/ipv%d/neigh/%s/retrans_time_ms" -+#define PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME "/proc/sys/net/ipv%d/neigh/%s/retrans_time" -+static char *proc_sys_retrans_time; -+static unsigned short retrans_time_factor = 0; - - void - netsnmp_arch_interface_init(void) -@@ -47,6 +53,20 @@ netsnmp_arch_interface_init(void) - /* - * nothing to do - */ -+ char proc_path[64+IF_NAMESIZE]; -+ char proc_path2[64+IF_NAMESIZE]; -+ struct stat st; -+ -+ snprintf(proc_path, sizeof(proc_path), PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 6, "default"); -+ snprintf(proc_path2, sizeof(proc_path2), PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS, 4, "default"); -+ -+ if ((stat(proc_path, &st) == 0) || (stat(proc_path2, &st) == 0)) { -+ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME_MS; -+ } -+ else { -+ proc_sys_retrans_time = PROC_SYS_NET_IPVx_NEIGH_RETRANS_TIME; -+ retrans_time_factor = 10; -+ } - } - - /* -@@ -161,7 +181,7 @@ _arch_interface_flags_v4_get(netsnmp_int - /* - * get the retransmit time - */ -- snprintf(line,sizeof(line),"/proc/sys/net/ipv4/neigh/%s/retrans_time", -+ snprintf(line,sizeof(line),proc_sys_retrans_time, 4, - entry->name); - if (!(fin = fopen(line, "r"))) { - DEBUGMSGTL(("access:interface", -@@ -169,7 +189,12 @@ _arch_interface_flags_v4_get(netsnmp_int - } - else { - if (fgets(line, sizeof(line), fin)) { -- entry->retransmit_v4 = atoi(line) * 100; -+ if (retrans_time_factor) { -+ entry->retransmit_v4 = atoi(line) * retrans_time_factor; -+ } -+ else { -+ entry->retransmit_v4 = atoi(line); -+ }; - entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V4_RETRANSMIT; - } - fclose(fin); -@@ -191,7 +216,7 @@ _arch_interface_flags_v6_get(netsnmp_int - /* - * get the retransmit time - */ -- snprintf(line,sizeof(line),"/proc/sys/net/ipv6/neigh/%s/retrans_time", -+ snprintf(line,sizeof(line),proc_sys_retrans_time, 6, - entry->name); - if (!(fin = fopen(line, "r"))) { - DEBUGMSGTL(("access:interface", -@@ -199,7 +224,12 @@ _arch_interface_flags_v6_get(netsnmp_int - } - else { - if (fgets(line, sizeof(line), fin)) { -- entry->retransmit_v6 = atoi(line); -+ if (retrans_time_factor) { -+ entry->retransmit_v6 = atoi(line) * retrans_time_factor; -+ } -+ else { -+ entry->retransmit_v6 = atoi(line); -+ }; - entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_V6_RETRANSMIT; - } - fclose(fin); - - diff --git a/net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch b/net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch deleted file mode 100644 index 389cd2bf..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch +++ /dev/null @@ -1,233 +0,0 @@ -Index: agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c -=================================================================== -RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c,v -retrieving revision 1.5.2.1 -diff -u -p -u -r1.5.2.1 tcpConn_linux.c ---- agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c 17 Aug 2006 08:52:15 -0000 1.5.2.1 -+++ agent/mibgroup/tcp-mib/data_access/tcpConn_linux.c 1 Sep 2006 17:15:23 -0000 -@@ -169,11 +169,20 @@ _load4(netsnmp_container *container, u_i - break; - } - -- entry->loc_port = htons((unsigned short) local_port); -- entry->rmt_port = htons((unsigned short) remote_port); -+ /** oddly enough, these appear to already be in network order */ -+ entry->loc_port = (unsigned short) local_port; -+ entry->rmt_port = (unsigned short) remote_port; - entry->tcpConnState = state; -+ -+ /** the addr string may need work */ - buf_len = strlen(local_addr); -- netsnmp_assert(8 == buf_len); -+ if ((8 != buf_len) || -+ (-1 == netsnmp_addrstr_hton(local_addr, 8))) { -+ DEBUGMSGT(("verbose:access:tcpconn:container", -+ " error processing local address\n")); -+ netsnmp_access_tcpconn_entry_free(entry); -+ continue; -+ } - offset = 0; - tmp_ptr = entry->loc_addr; - rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len, -@@ -188,8 +197,15 @@ _load4(netsnmp_container *container, u_i - continue; - } - -- buf_len = strlen(remote_addr); -- netsnmp_assert(8 == buf_len); -+ /** the addr string may need work */ -+ buf_len = strlen((char*)remote_addr); -+ if ((8 != buf_len) || -+ (-1 == netsnmp_addrstr_hton(remote_addr, 8))) { -+ DEBUGMSGT(("verbose:access:tcpconn:container", -+ " error processing remote address\n")); -+ netsnmp_access_tcpconn_entry_free(entry); -+ continue; -+ } - offset = 0; - tmp_ptr = entry->rmt_addr; - rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len, -@@ -244,6 +260,8 @@ _load6(netsnmp_container *container, u_i - fgets(line, sizeof(line), in); /* skip header */ - - /* -+ * Note: PPC (big endian) -+ * - * sl local_address rem_address st tx_queue rx_queue tr tm->when retrnsmt uid timeout inode - * 0: 00000000000000000000000000000001:1466 00000000000000000000000000000000:0000 0A 00000000:00000000 00:00000000 00000000 500 0 326699 1 efb81580 3000 0 0 2 -1 - */ -@@ -291,11 +309,20 @@ _load6(netsnmp_container *container, u_i - break; - } - -- entry->loc_port = htons((unsigned short) local_port); -- entry->rmt_port = htons((unsigned short) remote_port); -+ /** oddly enough, these appear to already be in network order */ -+ entry->loc_port = (unsigned short) local_port; -+ entry->rmt_port = (unsigned short) remote_port; - entry->tcpConnState = state; - -- buf_len = strlen(local_addr); -+ /** the addr string may need work */ -+ buf_len = strlen((char*)local_addr); -+ if ((32 != buf_len) || -+ (-1 == netsnmp_addrstr_hton(local_addr, 32))) { -+ DEBUGMSGT(("verbose:access:tcpconn:container", -+ " error processing local address\n")); -+ netsnmp_access_tcpconn_entry_free(entry); -+ continue; -+ } - offset = 0; - tmp_ptr = entry->loc_addr; - rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len, -@@ -310,7 +337,14 @@ _load6(netsnmp_container *container, u_i - continue; - } - -- buf_len = strlen(remote_addr); -+ buf_len = strlen((char*)remote_addr); -+ if ((32 != buf_len) || -+ (-1 == netsnmp_addrstr_hton(remote_addr, 32))) { -+ DEBUGMSGT(("verbose:access:tcpconn:container", -+ " error processing remote address\n")); -+ netsnmp_access_tcpconn_entry_free(entry); -+ continue; -+ } - offset = 0; - tmp_ptr = entry->rmt_addr; - rc = netsnmp_hex_to_binary(&tmp_ptr, &buf_len, -Index: agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c -=================================================================== -RCS file: /cvsroot/net-snmp/net-snmp/agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c,v -retrieving revision 1.2.2.1 -diff -u -p -u -r1.2.2.1 udp_endpoint_linux.c ---- agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c 25 Jan 2006 16:27:40 -0000 1.2.2.1 -+++ agent/mibgroup/udp-mib/data_access/udp_endpoint_linux.c 1 Sep 2006 17:15:23 -0000 -@@ -112,9 +112,9 @@ _process_line_udp_ep(netsnmp_line_info * - struct netsnmp_line_process_info_s* lpi) - { - netsnmp_udp_endpoint_entry *ep = (netsnmp_udp_endpoint_entry *)mem; -- char *ptr; -+ char *ptr, *sep; - u_char *u_ptr; -- size_t u_ptr_len, offset; -+ size_t u_ptr_len, offset, len; - - /* - * skip 'sl' -@@ -135,10 +135,22 @@ _process_line_udp_ep(netsnmp_line_info * - /* - * get local address. ignore error on hex conversion, since that - * function doesn't like the ':' between address and port. check the -- * offset to see if it worked. -+ * offset to see if it worked. May need to flip string too. - */ - u_ptr = ep->loc_addr; - u_ptr_len = sizeof(ep->loc_addr); -+ sep = strchr(ptr, ':'); -+ if (NULL == sep) { -+ DEBUGMSGTL(("text:util:tvi", "no ':' '%s'\n", -+ line_info->start)); -+ return PMLP_RC_MEMORY_UNUSED; -+ } -+ len = (sep - ptr); -+ if (-1 == netsnmp_addrstr_hton(ptr, len)) { -+ DEBUGMSGTL(("text:util:tvi", "bad length %d for loc addr '%s'\n", -+ u_ptr_len, line_info->start)); -+ return PMLP_RC_MEMORY_UNUSED; -+ } - offset = 0; - netsnmp_hex_to_binary(&u_ptr, &u_ptr_len, &offset, 0, ptr, NULL); - if ((4 != offset) && (16 != offset)) { -@@ -159,14 +171,26 @@ _process_line_udp_ep(netsnmp_line_info * - /* - * get remote address. ignore error on hex conversion, since that - * function doesn't like the ':' between address and port. check the -- * offset to see if it worked. -+ * offset to see if it worked. May need to flip string too. - */ - u_ptr = ep->rmt_addr; - u_ptr_len = sizeof(ep->rmt_addr); -+ sep = strchr(ptr, ':'); -+ if (NULL == sep) { -+ DEBUGMSGTL(("text:util:tvi", "no ':' '%s'\n", -+ line_info->start)); -+ return PMLP_RC_MEMORY_UNUSED; -+ } -+ len = (sep - ptr); -+ if (-1 == netsnmp_addrstr_hton(ptr, len)) { -+ DEBUGMSGTL(("text:util:tvi", "bad length %d for rmt addr '%s'\n", -+ u_ptr_len, line_info->start)); -+ return PMLP_RC_MEMORY_UNUSED; -+ } - offset = 0; - netsnmp_hex_to_binary(&u_ptr, &u_ptr_len, &offset, 0, ptr, NULL); - if ((4 != offset) && (16 != offset)) { -- DEBUGMSGTL(("text:util:tvi", "bad offset %d for loc addr '%s'\n", -+ DEBUGMSGTL(("text:util:tvi", "bad offset %d for rmt addr '%s'\n", - offset, line_info->start)); - return PMLP_RC_MEMORY_UNUSED; - } -Index: include/net-snmp/library/tools.h -=================================================================== -RCS file: /cvsroot/net-snmp/net-snmp/include/net-snmp/library/tools.h,v -retrieving revision 5.8.2.2 -diff -u -p -u -r5.8.2.2 tools.h ---- include/net-snmp/library/tools.h 13 Jun 2006 12:50:36 -0000 5.8.2.2 -+++ include/net-snmp/library/tools.h 1 Sep 2006 17:15:24 -0000 -@@ -198,7 +198,9 @@ extern "C" { - int marker_tticks(marker_t pm); - int timeval_tticks(struct timeval *tv); - char *netsnmp_getenv(const char *name); -- -+ -+ int netsnmp_addrstr_hton(char *ptr, size_t len); -+ - #ifdef __cplusplus - } - #endif -Index: snmplib/tools.c -=================================================================== -RCS file: /cvsroot/net-snmp/net-snmp/snmplib/tools.c,v -retrieving revision 5.10.2.2 -diff -u -p -u -r5.10.2.2 tools.c ---- snmplib/tools.c 25 Jul 2006 08:04:35 -0000 5.10.2.2 -+++ snmplib/tools.c 1 Sep 2006 17:15:26 -0000 -@@ -1042,3 +1042,35 @@ char *netsnmp_getenv(const char *name) - #endif - } - -+/* -+ * swap the order of an inet addr string -+ */ -+int -+netsnmp_addrstr_hton(char *ptr, size_t len) -+{ -+#ifndef WORDS_BIGENDIAN -+ char tmp[8]; -+ -+ if (8 == len) { -+ tmp[0] = ptr[6]; -+ tmp[1] = ptr[7]; -+ tmp[2] = ptr[4]; -+ tmp[3] = ptr[5]; -+ tmp[4] = ptr[2]; -+ tmp[5] = ptr[3]; -+ tmp[6] = ptr[0]; -+ tmp[7] = ptr[1]; -+ memcpy (ptr, &tmp, 8); -+ } -+ else if (32 == len) { -+ netsnmp_addrstr_hton(ptr , 8); -+ netsnmp_addrstr_hton(ptr+8 , 8); -+ netsnmp_addrstr_hton(ptr+16, 8); -+ netsnmp_addrstr_hton(ptr+24, 8); -+ } -+ else -+ return -1; -+#endif -+ -+ return 0; -+} - - diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4-exec-crash.patch b/net-analyzer/net-snmp/files/net-snmp-5.4-exec-crash.patch deleted file mode 100644 index 6dae95a3..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4-exec-crash.patch +++ /dev/null @@ -1,14 +0,0 @@ -https://bugzilla.redhat.com/show_bug.cgi?id=243536 - ---- net-snmp-5.4/agent/mibgroup/agent/extend.c.orig 2006-10-18 21:07:35.000000000 +0200 -+++ net-snmp-5.4/agent/mibgroup/agent/extend.c 2007-06-27 14:30:08.000000000 +0200 -@@ -448,6 +448,9 @@ - extension->command = strdup( exec_command ); - if (cptr) - extension->args = strdup( cptr ); -+ } else { -+ snmp_log(LOG_ERR, "Duplicate MIBOID '%s' detected in exec statement, only the first one will be used.\n", exec_name); -+ return; - } - - #ifndef USING_UCD_SNMP_EXTENSIBLE_MODULE diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4-makefile.patch b/net-analyzer/net-snmp/files/net-snmp-5.4-makefile.patch deleted file mode 100644 index 7b7ba127..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4-makefile.patch +++ /dev/null @@ -1,20 +0,0 @@ -diff -ru net-snmp-5.4~/agent/mibgroup/Makefile.in net-snmp-5.4/agent/mibgroup/Makefile.in ---- net-snmp-5.4~/agent/mibgroup/Makefile.in 2006-11-26 16:43:18.000000000 +0100 -+++ net-snmp-5.4/agent/mibgroup/Makefile.in 2006-11-26 16:44:49.000000000 +0100 -@@ -22,9 +22,13 @@ - .c.o: - $(CC) -c $(CPPFLAGS) $(CFLAGS) -o $@ $< - --OBJS = @mib_module_list_o@ --LOBJS = @mib_module_list_lo@ --SRCS = @mib_module_list_c@ -+@mib_module_list_o@ -+@mib_module_list_lo@ -+@mib_module_list_c@ -+ -+OBJS = $(mib_module_list_o) -+LOBJS = $(mib_module_list_lo) -+SRCS = $(mib_module_list_c) - - all: standardall $(LOBJS) - diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-CVE-2008-2292.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-CVE-2008-2292.patch deleted file mode 100644 index 125ccf22..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-CVE-2008-2292.patch +++ /dev/null @@ -1,192 +0,0 @@ -r16770 | dts12 | 2007-12-22 22:22:44 +0300 (Сбт, 22 Дек 2007) | 2 lines - -CHANGES: perl: BUG: 1826174: Check for buffer overflow when printing values. - -CHANGES: python: BUG: 1826174: Check for buffer overflow when printing values. -Addresses CVE-2008-2292 - ---- perl/SNMP/SNMP.xs (revision 16769) -+++ perl/SNMP/SNMP.xs (revision 16770) -@@ -470,14 +470,16 @@ - if (flag == USE_ENUMS) { - for(ep = tp->enums; ep; ep = ep->next) { - if (ep->value == *var->val.integer) { -- strcpy(buf, ep->label); -+ strncpy(buf, ep->label, buf_len); -+ buf[buf_len-1] = '\0'; - len = strlen(buf); - break; - } - } - } - if (!len) { -- sprintf(buf,"%ld", *var->val.integer); -+ snprintf(buf, buf_len, "%ld", *var->val.integer); -+ buf[buf_len-1] = '\0'; - len = strlen(buf); - } - break; -@@ -486,21 +488,25 @@ - case ASN_COUNTER: - case ASN_TIMETICKS: - case ASN_UINTEGER: -- sprintf(buf,"%lu", (unsigned long) *var->val.integer); -+ snprintf(buf, buf_len, "%lu", (unsigned long) *var->val.integer); -+ buf[buf_len-1] = '\0'; - len = strlen(buf); - break; - - case ASN_OCTET_STR: - case ASN_OPAQUE: -- memcpy(buf, (char*)var->val.string, var->val_len); - len = var->val_len; -+ if ( len > buf_len ) -+ len = buf_len; -+ memcpy(buf, (char*)var->val.string, len); - break; - - case ASN_IPADDRESS: -- ip = (u_char*)var->val.string; -- sprintf(buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); -- len = strlen(buf); -- break; -+ ip = (u_char*)var->val.string; -+ snprintf(buf, buf_len, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); -+ buf[buf_len-1] = '\0'; -+ len = strlen(buf); -+ break; - - case ASN_NULL: - break; -@@ -512,14 +518,14 @@ - break; - - case SNMP_ENDOFMIBVIEW: -- sprintf(buf,"%s", "ENDOFMIBVIEW"); -- break; -+ snprintf(buf, buf_len, "%s", "ENDOFMIBVIEW"); -+ break; - case SNMP_NOSUCHOBJECT: -- sprintf(buf,"%s", "NOSUCHOBJECT"); -- break; -+ snprintf(buf, buf_len, "%s", "NOSUCHOBJECT"); -+ break; - case SNMP_NOSUCHINSTANCE: -- sprintf(buf,"%s", "NOSUCHINSTANCE"); -- break; -+ snprintf(buf, buf_len, "%s", "NOSUCHINSTANCE"); -+ break; - - case ASN_COUNTER64: - #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES -@@ -538,19 +544,19 @@ - #endif - - case ASN_BIT_STR: -- snprint_bitstring(buf, sizeof(buf), var, NULL, NULL, NULL); -+ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL); - len = strlen(buf); - break; - #ifdef NETSNMP_WITH_OPAQUE_SPECIAL_TYPES - case ASN_OPAQUE_FLOAT: -- if (var->val.floatVal) -- sprintf(buf,"%f", *var->val.floatVal); -- break; -+ if (var->val.floatVal) -+ snprintf(buf, buf_len, "%f", *var->val.floatVal); -+ break; - - case ASN_OPAQUE_DOUBLE: -- if (var->val.doubleVal) -- sprintf(buf,"%f", *var->val.doubleVal); -- break; -+ if (var->val.doubleVal) -+ snprintf(buf, buf_len, "%f", *var->val.doubleVal); -+ break; - #endif - - case ASN_NSAP: ---- python/netsnmp/client_intf.c (revision 16961) -+++ python/netsnmp/client_intf.c (revision 16962) -@@ -330,14 +330,15 @@ - if (flag == USE_ENUMS) { - for(ep = tp->enums; ep; ep = ep->next) { - if (ep->value == *var->val.integer) { -- strcpy(buf, ep->label); -+ strncpy(buf, ep->label, buf_len); -+ buf[buf_len -1] = 0; - len = STRLEN(buf); - break; - } - } - } - if (!len) { -- sprintf(buf,"%ld", *var->val.integer); -+ snprintf(buf,"%ld", buf_len, *var->val.integer); - len = STRLEN(buf); - } - break; -@@ -346,19 +347,21 @@ - case ASN_COUNTER: - case ASN_TIMETICKS: - case ASN_UINTEGER: -- sprintf(buf,"%lu", (unsigned long) *var->val.integer); -+ snprintf(buf, buf_len, "%lu", (unsigned long) *var->val.integer); - len = STRLEN(buf); - break; - - case ASN_OCTET_STR: - case ASN_OPAQUE: -- memcpy(buf, (char*)var->val.string, var->val_len); - len = var->val_len; -+ if (len > buf_len) -+ len = buf_len; -+ memcpy(buf, (char*)var->val.string, len); - break; - - case ASN_IPADDRESS: - ip = (u_char*)var->val.string; -- sprintf(buf, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); -+ snprintf(buf, buf_len, "%d.%d.%d.%d", ip[0], ip[1], ip[2], ip[3]); - len = STRLEN(buf); - break; - -@@ -372,13 +375,13 @@ - break; - - case SNMP_ENDOFMIBVIEW: -- sprintf(buf,"%s", "ENDOFMIBVIEW"); -+ snprintf(buf, buf_len, "%s", "ENDOFMIBVIEW"); - break; - case SNMP_NOSUCHOBJECT: -- sprintf(buf,"%s", "NOSUCHOBJECT"); -+ snprintf(buf, buf_len, "%s", "NOSUCHOBJECT"); - break; - case SNMP_NOSUCHINSTANCE: -- sprintf(buf,"%s", "NOSUCHINSTANCE"); -+ snprintf(buf, buf_len, "%s", "NOSUCHINSTANCE"); - break; - - case ASN_COUNTER64: -@@ -398,18 +401,18 @@ - #endif - - case ASN_BIT_STR: -- snprint_bitstring(buf, sizeof(buf), var, NULL, NULL, NULL); -+ snprint_bitstring(buf, buf_len, var, NULL, NULL, NULL); - len = STRLEN(buf); - break; - #ifdef OPAQUE_SPECIAL_TYPES - case ASN_OPAQUE_FLOAT: - if (var->val.floatVal) -- sprintf(buf,"%f", *var->val.floatVal); -+ snprintf(buf, buf_len, "%f", *var->val.floatVal); - break; - - case ASN_OPAQUE_DOUBLE: - if (var->val.doubleVal) -- sprintf(buf,"%f", *var->val.doubleVal); -+ snprintf(buf, buf_len, "%f", *var->val.doubleVal); - break; - #endif - diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch deleted file mode 100644 index 116e524f..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch +++ /dev/null @@ -1,63 +0,0 @@ -Fix clientaddr functionality. - -Previously, the clientaddr option in snmp.conf was parsed, but the actual -clientaddr was used to bind(), yet sendmsg() was still called with 0.0.0.0. - -This patch alters: -- netsnmp_udp_fmtaddr: include both sides of addr_pair for debugging. -- netsnmp_udp_transport: Set addr_pair->local_addr in the remote && client_socket path. -- netsnmp_udp_transport: Print a debugging error on failure to bind() -- netsnmp_udp_transport: Print out the full client open addr_pair data. - -Signed-off-by: Robin H. Johnson <robbat2@gentoo.org> -Status: Merged in upstream r16654 -Tracking-URL: https://sourceforge.net/tracker/?func=detail&atid=312694&aid=1775124&group_id=12694 - -diff -NuwbBar --exclude docs --exclude '*.o' --exclude 'config.*' --exclude perl --exclude '*~' net-snmp-5.4.old/snmplib/snmpUDPDomain.c net-snmp-5.4/snmplib/snmpUDPDomain.c ---- net-snmp-5.4.old/snmplib/snmpUDPDomain.c 2006-09-19 16:42:17.000000000 -0700 -+++ net-snmp-5.4/snmplib/snmpUDPDomain.c 2007-08-15 19:17:27.000000000 -0700 -@@ -100,12 +100,15 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t - struct sockaddr_in *to = NULL; - char tmp[64]; - to = (struct sockaddr_in *) &(addr_pair->remote_addr); -+ /* Using strdup on the output of inet_ntoa is important! */ - if (to == NULL) { -- return strdup("UDP: unknown"); -+ sprintf(tmp, "UDP: [%s]->unknown", -+ strdup(inet_ntoa(addr_pair->local_addr))); -+ } else { -+ sprintf(tmp, "UDP: [%s]->[%s]:%hu", -+ strdup(inet_ntoa(addr_pair->local_addr)), -+ strdup(inet_ntoa(to->sin_addr)), ntohs(to->sin_port)); - } -- -- sprintf(tmp, "UDP: [%s]:%hu", -- inet_ntoa(to->sin_addr), ntohs(to->sin_port)); - return strdup(tmp); - } - } -@@ -670,11 +673,23 @@ netsnmp_udp_transport(struct sockaddr_in - NETSNMP_DS_LIB_CLIENT_ADDR); - if (client_socket) { - struct sockaddr_in client_addr; -+ int ret; - netsnmp_sockaddr_in2(&client_addr, client_socket, NULL); -+ addr_pair.local_addr = client_addr.sin_addr; - client_addr.sin_port = 0; -- bind(t->sock, (struct sockaddr *)&client_addr, -+ ret = bind(t->sock, (struct sockaddr *)&client_addr, - sizeof(struct sockaddr)); -+ if(ret) -+ DEBUGMSGTL(("netsnmp_udp", "failed to bind for clientaddr: %d %s\n", -+ errno,strerror(errno))); -+ /* TODO: should we exit here? */ - } -+ -+ str = netsnmp_udp_fmtaddr(NULL, (void *)&addr_pair, -+ sizeof(netsnmp_udp_addr_pair)); -+ DEBUGMSGTL(("netsnmp_udp", "client open %s\n", str)); -+ free(str); -+ - /* - * Save the (remote) address in the - * transport-specific data pointer for later use by netsnmp_udp_send. diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch deleted file mode 100644 index 03af69f9..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-incorrect-hrFSStorageIndex.patch +++ /dev/null @@ -1,538 +0,0 @@ -r16694 | rstory | 2007-09-14 17:11:59 +0400 (Птн, 14 Сен 2007) | 3 lines - -Apple patches -- add/fix disk/partition tables on darwin - -Also fixes incorrect hrFSStorageIndex - -http://bugs.gentoo.org/show_bug.cgi?id=211660 -http://sourceforge.net/tracker/index.php?func=detail&aid=1696044&group_id=12694&atid=312694 - ---- agent/mibgroup/host/hr_partition.c (revision 16693) -+++ agent/mibgroup/host/hr_partition.c (revision 16694) -@@ -1,8 +1,17 @@ -- - /* - * Host Resources MIB - partition device group implementation - hr_partition.c - * - */ -+/* Portions of this file are subject to the following copyright(s). See -+ * the Net-SNMP's COPYING file for more details and other copyrights -+ * that may apply: -+ */ -+/* -+ * Portions of this file are copyrighted by: -+ * Copyright (C) 2007 Apple, Inc. All rights reserved. -+ * Use is subject to license terms specified in the COPYING file -+ * distributed with the Net-SNMP package. -+ */ - - #include <net-snmp/net-snmp-config.h> - #include <fcntl.h> -@@ -35,6 +44,9 @@ - static int HRP_savedDiskIndex; - static int HRP_savedPartIndex; - static char HRP_savedName[1024]; -+#ifdef NETSNMP_CAN_GET_DISK_LABEL -+static char HRP_savedLabel[1024]; -+#endif - - static int HRP_DiskIndex; - -@@ -135,6 +147,7 @@ - (name[HRPART_DISK_NAME_LENGTH] & - ((1 << HRDEV_TYPE_SHIFT) - 1)); - -+ DEBUGMSGTL(("host/hr_partition", "... low index %d\n", LowDiskIndex)); - while (HRP_DiskIndex < LowDiskIndex) { - Init_HR_Partition(); /* moves to next disk */ - if (HRP_DiskIndex == -1) -@@ -144,6 +157,7 @@ - - for (;;) { - part_idx = Get_Next_HR_Partition(); -+ DEBUGMSGTL(("host/hr_partition", "... part index %d\n", part_idx)); - if (part_idx == 0) - break; - newname[HRPART_DISK_NAME_LENGTH] = -@@ -225,8 +239,13 @@ - long_return = part_idx; - return (u_char *) & long_return; - case HRPART_LABEL: -+#ifdef NETSNMP_CAN_GET_DISK_LABEL -+ *var_len = strlen(HRP_savedLabel); -+ return (u_char *) HRP_savedLabel; -+#else - *var_len = strlen(HRP_savedName); - return (u_char *) HRP_savedName; -+#endif - case HRPART_ID: /* Use the device number */ - sprintf(string, "0x%x", (int) stat_buf.st_rdev); - *var_len = strlen(string); -@@ -259,9 +278,11 @@ - static void - Init_HR_Partition(void) - { -+ DEBUGMSGTL(("host/hr_partition", "Init_HR_Partition\n")); - HRP_DiskIndex = Get_Next_HR_Disk(); - if (HRP_DiskIndex != -1) - HRP_DiskIndex &= ((1 << HRDEV_TYPE_SHIFT) - 1); -+ DEBUGMSGTL(("host/hr_partition", "... %d\n",HRP_DiskIndex)); - - HRP_index = -1; - } -@@ -272,6 +293,7 @@ - char string[1024]; - int fd; - -+ DEBUGMSGTL(("host/hr_partition", "Get_Next_HR_Partition %d\n",HRP_DiskIndex)); - if (HRP_DiskIndex == -1) { - return 0; - } -@@ -309,4 +331,7 @@ - HRP_savedDiskIndex = disk_idx; - HRP_savedPartIndex = part_idx; - (void) Get_Next_HR_Disk_Partition(HRP_savedName, sizeof(HRP_savedName), HRP_index); -+#ifdef NETSNMP_CAN_GET_DISK_LABEL -+ (void) Get_HR_Disk_Label(HRP_savedLabel, sizeof(HRP_savedLabel), HRP_savedName); -+#endif - } -Index: agent/mibgroup/host/hr_filesys.c -=================================================================== ---- agent/mibgroup/host/hr_filesys.c (revision 16693) -+++ agent/mibgroup/host/hr_filesys.c (revision 16694) -@@ -2,11 +2,25 @@ - * Host Resources MIB - File System device group implementation - hr_filesys.c - * - */ -+/* Portions of this file are subject to the following copyright(s). See -+ * the Net-SNMP's COPYING file for more details and other copyrights -+ * that may apply: -+ */ -+/* -+ * Portions of this file are copyrighted by: -+ * Copyright (C) 2007 Apple, Inc. All rights reserved. -+ * Use is subject to license terms specified in the COPYING file -+ * distributed with the Net-SNMP package. -+ */ - - #include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/memory.h> - #include "host_res.h" - #include "hr_filesys.h" - #include "hr_storage.h" -+#include "hr_disk.h" - #include <net-snmp/utilities.h> - - #if HAVE_MNTENT_H -@@ -535,7 +549,7 @@ - long_return = 2; /* others probably aren't */ - return (u_char *) & long_return; - case HRFSYS_STOREIDX: -- long_return = fsys_idx + HRS_TYPE_FIXED_MAX; -+ long_return = fsys_idx + NETSNMP_MEM_TYPE_MAX; - return (u_char *) & long_return; - case HRFSYS_FULLDUMP: - return when_dumped(HRFS_entry->HRFS_name, FULL_DUMP, var_len); -Index: agent/mibgroup/host/hr_disk.c -=================================================================== ---- agent/mibgroup/host/hr_disk.c (revision 16693) -+++ agent/mibgroup/host/hr_disk.c (revision 16694) -@@ -2,6 +2,16 @@ - * Host Resources MIB - disk device group implementation - hr_disk.c - * - */ -+/* Portions of this file are subject to the following copyright(s). See -+ * the Net-SNMP's COPYING file for more details and other copyrights -+ * that may apply: -+ */ -+/* -+ * Portions of this file are copyrighted by: -+ * Copyright (C) 2007 Apple, Inc. All rights reserved. -+ * Use is subject to license terms specified in the COPYING file -+ * distributed with the Net-SNMP package. -+ */ - - #include <net-snmp/net-snmp-config.h> - #include "host_res.h" -@@ -65,6 +75,15 @@ - #include <limits.h> - #endif - -+#ifdef darwin -+#include <CoreFoundation/CoreFoundation.h> -+#include <IOKit/IOKitLib.h> -+#include <IOKit/storage/IOBlockStorageDriver.h> -+#include <IOKit/storage/IOMedia.h> -+#include <IOKit/IOBSD.h> -+#include <DiskArbitration/DADisk.h> -+#endif -+ - #ifdef linux - /* - * define BLKGETSIZE from <linux/fs.h>: -@@ -79,6 +98,27 @@ - - #define HRD_MONOTONICALLY_INCREASING - -+/************************************************************* -+ * constants for enums for the MIB node -+ * hrDiskStorageAccess (INTEGER / ASN_INTEGER) -+ */ -+#define HRDISKSTORAGEACCESS_READWRITE 1 -+#define HRDISKSTORAGEACCESS_READONLY 2 -+ -+ -+/************************************************************* -+ * constants for enums for the MIB node -+ * hrDiskStorageMedia (INTEGER / ASN_INTEGER) -+ */ -+#define HRDISKSTORAGEMEDIA_OTHER 1 -+#define HRDISKSTORAGEMEDIA_UNKNOWN 2 -+#define HRDISKSTORAGEMEDIA_HARDDISK 3 -+#define HRDISKSTORAGEMEDIA_FLOPPYDISK 4 -+#define HRDISKSTORAGEMEDIA_OPTICALDISKROM 5 -+#define HRDISKSTORAGEMEDIA_OPTICALDISKWORM 6 -+#define HRDISKSTORAGEMEDIA_OPTICALDISKRW 7 -+#define HRDISKSTORAGEMEDIA_RAMDISK 8 -+ - /********************* - * - * Kernel & interface information, -@@ -132,6 +172,19 @@ - static struct disklabel HRD_info; - #endif - -+#ifdef darwin -+static int64_t HRD_cap; -+static int HRD_access; -+static int HRD_type; -+static int HRD_removeble; -+static char HRD_model[40]; -+static int HRD_saved_access; -+static int HRD_saved_type; -+static int HRD_saved_removeble; -+static int _get_type_from_protocol( const char *prot ); -+static int _get_type_value( const char *str_type ); -+#endif -+ - static void parse_disk_config(const char *, char *); - static void free_disk_config(void); - -@@ -185,6 +238,8 @@ - "/dev/rdsk/c%dt%dd0s0", 0, 7); - Add_HR_Disk_entry("/dev/rdsk/c%dd%ds%d", 0, 7, 0, 15, - "/dev/rdsk/c%dd%ds0", 0, 7); -+#elif defined(darwin) -+ Add_HR_Disk_entry("/dev/disk%ds%d", -1, -1, 0, 32, "/dev/disk%d", 1, 32); - #elif defined(freebsd4) || defined(freebsd5) - Add_HR_Disk_entry("/dev/ad%ds%d%c", 0, 1, 1, 4, "/dev/ad%ds%d", 'a', 'h'); - Add_HR_Disk_entry("/dev/da%ds%d%c", 0, 1, 1, 4, "/dev/da%ds%d", 'a', 'h'); -@@ -484,6 +539,7 @@ - Init_HR_Disk(); - for (;;) { - disk_idx = Get_Next_HR_Disk(); -+ DEBUGMSGTL(("host/hr_disk", "... index %d\n", disk_idx)); - if (disk_idx == -1) - break; - newname[HRDISK_ENTRY_NAME_LENGTH] = disk_idx; -@@ -749,7 +805,13 @@ - HRD_history[iindex] = 0; - return ((HRDEV_DISK << HRDEV_TYPE_SHIFT) + iindex); - } -+ DEBUGMSGTL(("host/hr_disk", -+ "Get_Next_HR_Disk: can't query %s\n", string)); - } -+ else { -+ DEBUGMSGTL(("host/hr_disk", -+ "Get_Next_HR_Disk: can't open %s\n", string)); -+ } - HRD_history[iindex] = now; - HRD_index++; - } -@@ -801,6 +863,66 @@ - return 0; - } - -+#ifdef darwin -+int -+Get_HR_Disk_Label(char *string, size_t str_len, const char *devfull) -+{ -+ DASessionRef sess_ref; -+ DADiskRef disk; -+ CFDictionaryRef desc; -+ CFStringRef str_ref; -+ CFStringEncoding sys_encoding = CFStringGetSystemEncoding(); -+ -+ DEBUGMSGTL(("host/hr_disk", "Disk Label type %s\n", devfull)); -+ -+ sess_ref = DASessionCreate( NULL ); -+ if (NULL == sess_ref) { -+ strncpy(string, devfull, str_len); -+ string[str_len-1] = 0; -+ return -1; -+ } -+ -+ disk = DADiskCreateFromBSDName( NULL, sess_ref, devfull ); -+ if (NULL == disk) { -+ CFRelease(sess_ref); -+ strncpy(string, devfull, str_len); -+ string[str_len-1] = 0; -+ return -1; -+ } -+ -+ desc = DADiskCopyDescription( disk ); -+ if (NULL == desc) { -+ snmp_log(LOG_ERR, -+ "diskmgr: couldn't get disk description for %s, skipping\n", -+ devfull); -+ CFRelease(disk); -+ CFRelease(sess_ref); -+ strncpy(string, devfull, str_len); -+ return -1; -+ } -+ -+ /** model */ -+ str_ref = (CFStringRef) -+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaNameKey); -+ if (str_ref) { -+ strncpy(string, CFStringGetCStringPtr(str_ref, sys_encoding), -+ str_len); -+ string[str_len-1] = 0; -+ DEBUGMSGTL(("verbose:diskmgr:darwin", " name %s\n", string)); -+ } -+ else { -+ strncpy(string, devfull, str_len); -+ string[str_len-1] = 0; -+ } -+ -+ CFRelease(disk); -+ CFRelease(desc); -+ CFRelease(sess_ref); -+ -+ return 0; -+} -+#endif -+ - static void - Save_HR_Disk_Specific(void) - { -@@ -822,6 +944,13 @@ - #ifdef DIOCGDINFO - HRD_savedCapacity = HRD_info.d_secperunit / 2; - #endif -+#ifdef darwin -+ HRD_savedCapacity = HRD_cap / 1024; -+ HRD_saved_access = HRD_access; -+ HRD_saved_type = HRD_type; -+ HRD_saved_removeble = HRD_removeble; -+#endif -+ - } - - static void -@@ -845,6 +974,11 @@ - sizeof(HRD_savedModel)-1); - HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0; - #endif -+#ifdef darwin -+ strncpy(HRD_savedModel, HRD_model, -+ sizeof(HRD_savedModel)-1); -+ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0; -+#endif - } - - static const char * -@@ -900,6 +1034,104 @@ - result = ioctl(fd, DIOCGDINFO, &HRD_info); - #endif - -+#ifdef darwin -+ DASessionRef sess_ref; -+ DADiskRef disk; -+ CFDictionaryRef desc; -+ CFStringRef str_ref; -+ CFNumberRef number_ref; -+ CFBooleanRef bool_ref; -+ CFStringEncoding sys_encoding = CFStringGetSystemEncoding(); -+ -+ sess_ref = DASessionCreate( NULL ); -+ if (NULL == sess_ref) -+ return -1; -+ -+ disk = DADiskCreateFromBSDName( NULL, sess_ref, devfull ); -+ if (NULL == disk) { -+ CFRelease(sess_ref); -+ return -1; -+ } -+ -+ desc = DADiskCopyDescription( disk ); -+ if (NULL == desc) { -+ CFRelease(disk); -+ CFRelease(sess_ref); -+ return -1; -+ } -+ -+ number_ref = (CFNumberRef) -+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaSizeKey); -+ if (number_ref) -+ CFNumberGetValue(number_ref, kCFNumberSInt64Type, &HRD_cap); -+ else -+ HRD_cap = 0; -+ DEBUGMSGTL(("verbose:diskmgr:darwin", " size %lld\n", HRD_cap)); -+ -+ /** writable? */ -+ bool_ref = (CFBooleanRef) -+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaWritableKey); -+ if (bool_ref) { -+ HRD_access = CFBooleanGetValue(bool_ref); -+ } -+ else -+ HRD_access = 0; -+ DEBUGMSGTL(("verbose:diskmgr:darwin", " writable %d\n", -+ HRD_access)); -+ -+ /** removable? */ -+ bool_ref = (CFBooleanRef) -+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaRemovableKey); -+ if (bool_ref) { -+ HRD_removeble = CFBooleanGetValue(bool_ref); -+ } -+ else -+ HRD_removeble = 0; -+ DEBUGMSGTL(("verbose:diskmgr:darwin", " removable %d\n", -+ HRD_removeble)); -+ -+ /** get type */ -+ str_ref = (CFStringRef) -+ CFDictionaryGetValue(desc, kDADiskDescriptionMediaTypeKey); -+ if (str_ref) { -+ HRD_type = _get_type_value(CFStringGetCStringPtr(str_ref, -+ sys_encoding)); -+ DEBUGMSGTL(("verbose:diskmgr:darwin", " type %s / %d\n", -+ CFStringGetCStringPtr(str_ref, sys_encoding), -+ HRD_type)); -+ } -+ else { -+ str_ref = (CFStringRef) -+ CFDictionaryGetValue(desc, kDADiskDescriptionDeviceProtocolKey); -+ if (str_ref) { -+ HRD_type = -+ _get_type_from_protocol(CFStringGetCStringPtr(str_ref, -+ sys_encoding)); -+ DEBUGMSGTL(("verbose:diskmgr:darwin", " type %s / %d\n", -+ CFStringGetCStringPtr(str_ref, sys_encoding), -+ HRD_type)); -+ } -+ else -+ HRD_type = HRDISKSTORAGEMEDIA_UNKNOWN; -+ } -+ -+ /** model */ -+ str_ref = (CFStringRef) -+ CFDictionaryGetValue(desc, kDADiskDescriptionDeviceModelKey); -+ if (str_ref) { -+ strncpy(HRD_model, CFStringGetCStringPtr(str_ref, sys_encoding), -+ sizeof(HRD_model)); -+ HRD_savedModel[ sizeof(HRD_savedModel)-1 ] = 0; -+ DEBUGMSGTL(("verbose:diskmgr:darwin", " model %s\n", HRD_model)); -+ } -+ else -+ HRD_model[0] = 0; -+ CFRelease(disk); -+ CFRelease(desc); -+ CFRelease(sess_ref); -+ result = 0; -+#endif -+ - return (result); - } - -@@ -918,6 +1150,11 @@ - return (2); /* read only */ - #endif - -+#ifdef darwin -+ if (!HRD_access) -+ return (2); -+#endif -+ - return (1); /* read-write */ - } - -@@ -990,6 +1227,9 @@ - } - #endif - -+#ifdef darwin -+ return HRD_type; -+#endif - - return (2); /* Unknown */ - } -@@ -1020,5 +1260,63 @@ - return (1); /* true */ - #endif - -+#ifdef darwin -+ if (HRD_removeble) -+ return (1); -+#endif -+ - return (2); /* false */ - } -+ -+#ifdef darwin -+typedef struct type_value_map_s { -+ const char *type; -+ uint32_t value; -+} type_value_map; -+ -+static type_value_map media_type_map[] = { -+ { "CD-ROM", HRDISKSTORAGEMEDIA_OPTICALDISKROM}, -+ { "DVD-R", HRDISKSTORAGEMEDIA_OPTICALDISKWORM}, -+ { "DVD+R", HRDISKSTORAGEMEDIA_OPTICALDISKWORM}, -+}; -+static int media_types = sizeof(media_type_map)/sizeof(media_type_map[0]); -+ -+static int -+_get_type_value( const char *str_type ) -+{ -+ int i, len; -+ -+ if (NULL == str_type) -+ return HRDISKSTORAGEMEDIA_UNKNOWN; -+ -+ len = strlen(str_type); -+ for(i=0; i < media_types; ++i) { -+ if (0 == strcmp(media_type_map[i].type, str_type)) -+ return media_type_map[i].value; -+ } -+ -+ return HRDISKSTORAGEMEDIA_UNKNOWN; -+} -+ -+static type_value_map proto_map[] = { -+ { "ATA", HRDISKSTORAGEMEDIA_HARDDISK}, -+ { "ATAPI", HRDISKSTORAGEMEDIA_OPTICALDISKROM} -+}; -+static int proto_maps = sizeof(proto_map)/sizeof(proto_map[0]); -+ -+static int _get_type_from_protocol( const char *prot ) -+{ -+ int i, len; -+ -+ if (NULL == prot) -+ return TV_FALSE; -+ -+ len = strlen(prot); -+ for(i=0; i < proto_maps; ++i) { -+ if (0 == strcmp(proto_map[i].type, prot)) -+ return proto_map[i].value; -+ } -+ -+ return HRDISKSTORAGEMEDIA_UNKNOWN; -+} -+#endif diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch deleted file mode 100644 index 900d51d2..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-ipAddressTable-crash-with-double-free.patch +++ /dev/null @@ -1,134 +0,0 @@ -r16804 | magfr | 2008-02-14 02:37:48 +0300 (Чтв, 14 Фев 2008) | 2 lines - -NEWS: snmplib: Change CONTAINER_INSERT to not do partial inserts in containers with multiple indices when one insert fails. - -http://sourceforge.net/tracker/index.php?func=detail&aid=1733344&group_id=12694&atid=112694 - -http://bugs.gentoo.org/show_bug.cgi?id=203127 - -Index: snmplib/container.c -=================================================================== ---- snmplib/container.c (revision 16803) -+++ snmplib/container.c (revision 16804) -@@ -282,31 +282,41 @@ - * These functions should EXACTLY match the inline version in - * container.h. If you change one, change them both. - */ --int CONTAINER_INSERT(netsnmp_container *x, const void *k) --{ -- int rc2, rc = 0; -- -- /** start at first container */ -- while(x->prev) -- x = x->prev; -- for(; x; x = x->next) { -- if ((NULL != x->insert_filter) && -- (x->insert_filter(x,k) == 1)) -- continue; -- rc2 = x->insert(x,k); -- if (rc2) { -+int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k) -+{ -+ while(x && x->insert_filter && x->insert_filter(x,k) == 1) -+ x = x->next; -+ if(x) { -+ int rc = x->insert(x,k); -+ if(rc) - snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", -- x->container_name ? x->container_name : "", rc2); -- rc = rc2; -+ x->container_name ? x->container_name : "", rc); -+ else { -+ rc = CONTAINER_INSERT_HELPER(x->next, k); -+ if(rc) -+ x->remove(x,k); - } -+ return rc; - } -- return rc; -+ return 0; - } - - /*------------------------------------------------------------------ - * These functions should EXACTLY match the inline version in - * container.h. If you change one, change them both. - */ -+int CONTAINER_INSERT(netsnmp_container* x, const void* k) -+{ -+ /** start at first container */ -+ while(x->prev) -+ x = x->prev; -+ return CONTAINER_INSERT_HELPER(x, k); -+} -+ -+/*------------------------------------------------------------------ -+ * These functions should EXACTLY match the inline version in -+ * container.h. If you change one, change them both. -+ */ - int CONTAINER_REMOVE(netsnmp_container *x, const void *k) - { - int rc2, rc = 0; -Index: include/net-snmp/library/container.h -=================================================================== ---- include/net-snmp/library/container.h (revision 16803) -+++ include/net-snmp/library/container.h (revision 16804) -@@ -364,32 +364,43 @@ - * container.c. If you change one, change them both. - */ - NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ -- int CONTAINER_INSERT(netsnmp_container *x, const void *k) -+ int CONTAINER_INSERT_HELPER(netsnmp_container* x, const void* k) - { -- int rc2, rc = 0; -- -- /** start at first container */ -- while(x->prev) -- x = x->prev; -- for(; x; x = x->next) { -- if ((NULL != x->insert_filter) && -- (x->insert_filter(x,k) == 1)) -- continue; -- rc2 = x->insert(x,k); -- if (rc2) { -+ while(x && x->insert_filter && x->insert_filter(x,k) == 1) -+ x = x->next; -+ if(x) { -+ int rc = x->insert(x,k); -+ if(rc) - snmp_log(LOG_ERR,"error on subcontainer '%s' insert (%d)\n", -- x->container_name ? x->container_name : "", rc2); -- rc = rc2; -+ x->container_name ? x->container_name : "", rc); -+ else { -+ rc = CONTAINER_INSERT_HELPER(x->next, k); -+ if(rc) -+ x->remove(x,k); - } -+ return rc; - } -- return rc; -+ return 0; - } -- -+ - /*------------------------------------------------------------------ - * These functions should EXACTLY match the function version in - * container.c. If you change one, change them both. - */ - NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ -+ int CONTAINER_INSERT(netsnmp_container* x, const void* k) -+ { -+ /** start at first container */ -+ while(x->prev) -+ x = x->prev; -+ return CONTAINER_INSERT_HELPER(x, k); -+ } -+ -+ /*------------------------------------------------------------------ -+ * These functions should EXACTLY match the function version in -+ * container.c. If you change one, change them both. -+ */ -+ NETSNMP_STATIC_INLINE /* gcc docs recommend static w/inline */ - int CONTAINER_REMOVE(netsnmp_container *x, const void *k) - { - int rc2, rc = 0; diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-perl-asneeded.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-perl-asneeded.patch deleted file mode 100644 index 766436e3..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-perl-asneeded.patch +++ /dev/null @@ -1,33 +0,0 @@ -Index: net-snmp-5.4.1/configure.in -=================================================================== ---- net-snmp-5.4.1.orig/configure.in -+++ net-snmp-5.4.1/configure.in -@@ -2,7 +2,7 @@ - # the Net-SNMP's COPYING file for more details and other copyrights - # that may apply: - # --# Portions Copyright © 2003 Sun Microsystems, Inc. All rights reserved. -+# Portions Copyright © 2003 Sun Microsystems, Inc. All rights reserved. - # Use is subject to license terms specified in the COPYING file - # distributed with the Net-SNMP package. - # -@@ -3097,8 +3097,8 @@ fi - - # check needed functions - if test "x$embed_perl" != "xno" ; then -- OLDLDFLAGS="$LDFLAGS" -- LDFLAGS="$LDFLAGS $netsnmp_perlldopts" -+ OLDLIBS="$LIBS" -+ LIBS="$LIBS $netsnmp_perlldopts" - - # newer perl vs older perl call functions - AC_CHECK_FUNCS(eval_pv) -@@ -3109,7 +3109,7 @@ if test "x$embed_perl" != "xno" ; then - AC_CHECK_FUNC(perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_LC)) - AC_CHECK_FUNC(Perl_eval_pv, AC_DEFINE(HAVE_PERL_EVAL_PV_UC)) - -- LDFLAGS="$OLDLDFLAGS" -+ LIBS="$OLDLIBS" - - - if test "x$ac_cv_func_perl_eval_pv" != "xyes" -a "x$ac_cv_func_Perl_eval_pv" != "xyes" -a "x$ac_cv_func_eval_pv" != "xyes" ; then diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-process-count-race.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-process-count-race.patch deleted file mode 100644 index 56defedd..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-process-count-race.patch +++ /dev/null @@ -1,52 +0,0 @@ -r16705 | tanders | 2007-09-21 01:55:49 +0400 (Птн, 21 Сен 2007) | 3 lines - -CHANGES: snmpd: PATCH: 1746831: from cunnijd: fix process checking race -condition under Linux and platform #ifdefs - ---- agent/mibgroup/ucd-snmp/proc.c (revision 16704) -+++ agent/mibgroup/ucd-snmp/proc.c (revision 16705) -@@ -427,7 +427,7 @@ - return count; - } - --#elif OSTYPE == NETSNMP_LINUXID -+#elif NETSNMP_OSTYPE == NETSNMP_LINUXID - - #include <dirent.h> - #include <fcntl.h> -@@ -452,7 +452,7 @@ - #ifdef USE_PROC_CMDLINE /* old method */ - /* read /proc/XX/cmdline */ - sprintf(cmdline,"/proc/%s/cmdline",ent->d_name); -- if((fd = open(cmdline, O_RDONLY)) < 0) break; -+ if((fd = open(cmdline, O_RDONLY)) < 0) continue; - len = read(fd,cmdline,sizeof(cmdline) - 1); - close(fd); - if(len <= 0) continue; -@@ -464,7 +464,7 @@ - /* read /proc/XX/status */ - sprintf(cmdline,"/proc/%s/status",ent->d_name); - if ((status = fopen(cmdline, "r")) == NULL) -- break; -+ continue; - if (fgets(cmdline, sizeof(cmdline), status) == NULL) { - fclose(status); - break; -@@ -507,7 +507,7 @@ - return total; - } - --#elif OSTYPE == NETSNMP_ULTRIXID -+#elif NETSNMP_OSTYPE == NETSNMP_ULTRIXID - - #define NPROCS 32 /* number of proces to read at once */ - -@@ -688,7 +688,7 @@ - return (0); - return (1); - } --#elif OSTYPE == NETSNMP_SOLARISID -+#elif NETSNMP_OSTYPE == NETSNMP_SOLARISID - - #ifdef _SLASH_PROC_METHOD_ - diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-sensors3-version_detect.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-sensors3-version_detect.patch deleted file mode 100644 index 9159dd03..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-sensors3-version_detect.patch +++ /dev/null @@ -1,56 +0,0 @@ -From: Gordon Malm <gengor@gentoo.org> - -Detect lm_sensors version and build accordingly. - ---- a/agent/mibgroup/hardware/sensors.h -+++ b/agent/mibgroup/hardware/sensors.h -@@ -1,13 +1,21 @@ - config_require(hardware/sensors/hw_sensors) - - #if defined(solaris) -+ - # if defined(HAVE_PICL_H) - config_require(hardware/sensors/picld_sensors) - # else - config_require(hardware/sensors/kstat_sensors) - # endif -+ - #else -+ -+# if defined(HAVE_LMSENSORS_V2) -+config_require(hardware/sensors/lmsensors_v2) -+# else - config_require(hardware/sensors/lmsensors_v3) -+# endif -+ - #endif - - //config_require(hardware/sensors/dummy_sensors) ---- a/configure.in -+++ b/configure.in -@@ -1909,6 +1909,25 @@ done - - AC_MSG_RESULT([$new_module_list.]) - -+echo " $new_module_list " | $GREP "ucd-snmp/lmsensorsMib" > /dev/null -+if test $? -eq 0 ; then -+ case $target_os in -+ linux*) -+ AC_CHECK_HEADER(sensors/sensors.h,,[AC_MSG_ERROR([asked to use lm_sensors but I couldn't find sensors/sensors.h])]) -+ -+ AC_MSG_CHECKING([lm_sensors version]) -+ AC_EGREP_CPP(lmsensors_v2,[ -+#include <sensors/sensors.h> -+#if SENSORS_API_VERSION < 0x400 -+lmsensors_v2 -+#endif -+ ], [AC_DEFINE([HAVE_LMSENSORS_V2], [1], [Define if lm_sensors version 2.x])] -+ have_lmsensors_ver="2.x", have_lmsensors_ver="3.x or higher") -+ AC_MSG_RESULT([$have_lmsensors_ver]) -+ ;; -+ esac -+fi -+ - #--------------------- - # loop over module list - # diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-sensors3.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-sensors3.patch deleted file mode 100644 index 8e4b09ba..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-sensors3.patch +++ /dev/null @@ -1,1314 +0,0 @@ -Source: http://cvs.fedoraproject.org/viewvc/devel/net-snmp/net-snmp-5.4.1-sensors3.patch - ---- - -351991: Port net-snmp to lm_sensors-3.x.x -Source: upstream, svn diff -r 16736:16739 -Reviewed-By: Jan Safranek <jsafrane@redhat.com> - -Index: configure -=================================================================== -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.c ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.c 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,60 @@ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/sensors.h> -+ -+ -+void netsnmp_sensor_arch_init( void ) { -+ /* Nothing to do */ -+ DEBUGMSGTL(("sensors:arch", "Initialise Dummy Sensors module\n")); -+} -+ -+int -+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) { -+ time_t now; -+ struct tm *tm; -+ netsnmp_sensor_info *sp; -+ -+ time(&now); -+ tm = localtime(&now); -+ -+ DEBUGMSGTL(("sensors:arch", "Reload Dummy Sensors module\n")); -+ -+ /* First pseudo-sensor - slowly-rising temperature */ -+ sp = sensor_by_name( "minute", NETSNMP_SENSOR_TYPE_TEMPERATURE ); -+ sp->value = tm->tm_min; -+ snprintf( sp->descr, 256, "Minute-based pseudo-sensor - slowly-rising temperature" ); -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ -+ /* Second pseudo-sensor - quickly-rising temperature */ -+ sp = sensor_by_name( "second", NETSNMP_SENSOR_TYPE_TEMPERATURE ); -+ sp->value = tm->tm_sec; -+ snprintf( sp->descr, 256, "Second-based pseudo-sensor - quickly-rising temperature" ); -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ -+ /* Third pseudo-sensor - annual fan speed */ -+ sp = sensor_by_name( "year", NETSNMP_SENSOR_TYPE_RPM ); -+ sp->value = tm->tm_year + 1900; -+ snprintf( sp->descr, 256, "RPM pseudo-sensor - annual fan speed" ); -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ -+ /* Fourth pseudo-sensor - daily voltage */ -+ sp = sensor_by_name( "day", NETSNMP_SENSOR_TYPE_VOLTAGE_DC ); -+ sp->value = tm->tm_mday-20; -+ snprintf( sp->descr, 256, "Day-based pseudo-sensor - positive or negative voltage" ); -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ -+ /* Fifth pseudo-sensor - monthly voltage */ -+ sp = sensor_by_name( "month", NETSNMP_SENSOR_TYPE_VOLTAGE_DC ); -+ sp->value = tm->tm_mon; -+ snprintf( sp->descr, 256, "Month-based pseudo-sensor - positive voltage" ); -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ -+ /* Sixth pseudo-sensor - annual daily something */ -+ sp = sensor_by_name( "yday", NETSNMP_SENSOR_TYPE_OTHER ); -+ sp->value = tm->tm_yday; -+ snprintf( sp->descr, 256, "Day-based pseudo-sensor - annual something" ); -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ -+ return 0; -+} -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/dummy_sensors.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1 @@ -+config_require(hardware/sensors/hw_sensors) -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,13 @@ -+config_require(hardware/sensors/hw_sensors) -+ -+#if defined(solaris) -+# if defined(HAVE_PICL_H) -+config_require(hardware/sensors/picld_sensors) -+# else -+config_require(hardware/sensors/kstat_sensors) -+# endif -+#else -+config_require(hardware/sensors/lmsensors_v3) -+#endif -+ -+//config_require(hardware/sensors/dummy_sensors) -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.c ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.c 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,183 @@ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/sensors.h> -+ -+ -+extern NetsnmpCacheLoad netsnmp_sensor_arch_load; -+extern void netsnmp_sensor_arch_init( void ); -+static int _sensor_load( void ); -+static void _sensor_free( void ); -+ -+static int _sensorAutoUpdate = 0; /* 0 means on-demand caching */ -+static void _sensor_update_stats( unsigned int, void* ); -+ -+netsnmp_cache *_sensor_cache = NULL; -+netsnmp_container *_sensor_container = NULL; -+static int _sensor_idx = 0; -+ -+void init_hw_sensors( void ) { -+ -+ if ( _sensor_container ) -+ return; /* Already initialised */ -+ -+ DEBUGMSGTL(("sensors", "Initialise Hardware Sensors module\n")); -+ -+ /* -+ * Define a container to hold the basic list of sensors -+ * The four LM-SENSOR-MIB containers will be created in -+ * the relevant initialisation routine(s) -+ */ -+ _sensor_container = netsnmp_container_find("sensorTable:table_container"); -+ if ( NULL == _sensor_container ) { -+ snmp_log( LOG_ERR, "failed to create container for sensorTable"); -+ return; -+ } -+ netsnmp_sensor_arch_init( ); -+ -+ /* -+ * If we're sampling the sensor information automatically, -+ * then arrange for this to be triggered regularly. -+ * -+ * If we're not sampling these values regularly, -+ * create a suitable cache handler instead. -+ */ -+ if ( _sensorAutoUpdate ) { -+ DEBUGMSGTL(("sensors", "Reloading Hardware Sensors automatically (%d)\n", -+ _sensorAutoUpdate)); -+ snmp_alarm_register( _sensorAutoUpdate, SA_REPEAT, -+ _sensor_update_stats, NULL ); -+ } -+ else { -+ _sensor_cache = netsnmp_cache_create( 5, netsnmp_sensor_load, -+ netsnmp_sensor_free, NULL, 0 ); -+ DEBUGMSGTL(("sensors", "Reloading Hardware Sensors on-demand (%p)\n", -+ _sensor_cache)); -+ } -+} -+ -+void shutdown_hw_sensors( void ) { -+ _sensor_free(); -+} -+ -+/* -+ * Return the main sensor container -+ */ -+netsnmp_container *get_sensor_container( void ) { return _sensor_container; } -+ -+/* -+ * Return the main sensor cache control structure (if defined) -+ */ -+netsnmp_cache *get_sensor_cache( void ) { return _sensor_cache; } -+ -+ -+/* -+ * Wrapper routine for automatically updating sensor statistics -+ */ -+void -+_sensor_update_stats( unsigned int clientreg, void *data ) -+{ -+ _sensor_free(); -+ _sensor_load(); -+} -+ -+/* -+ * Wrapper routine for re-loading sensor statistics on demand -+ */ -+int -+netsnmp_sensor_load( netsnmp_cache *cache, void *data ) -+{ -+ return _sensor_load(); -+} -+ -+/* -+ * Wrapper routine for releasing expired sensor statistics -+ */ -+void -+netsnmp_sensor_free( netsnmp_cache *cache, void *data ) -+{ -+ _sensor_free(); -+} -+ -+ -+/* -+ * Architecture-independent processing of loading sensor statistics -+ */ -+static int -+_sensor_load( void ) -+{ -+ netsnmp_sensor_arch_load( NULL, NULL ); -+} -+ -+/* -+ * Architecture-independent release of sensor statistics -+ */ -+static void -+_sensor_free( void ) -+{ -+ netsnmp_sensor_info *sp; -+ -+ for (sp = CONTAINER_FIRST( _sensor_container ); -+ sp; -+ sp = CONTAINER_NEXT( _sensor_container, sp )) { -+ -+ sp->flags &= ~ NETSNMP_SENSOR_FLAG_ACTIVE; -+ } -+} -+ -+ -+/* -+ * Retrieve a sensor entry by name, -+ * or (optionally) insert a new one into the container -+ */ -+netsnmp_sensor_info * -+sensor_by_name( char *name, int create_type ) -+{ -+ netsnmp_sensor_info *sp; -+ -+ DEBUGMSGTL(("sensors:name", "Get sensor entry (%s)\n", name)); -+ -+ /* -+ * Look through the list for a matching entry -+ */ -+ /* .. or use a secondary index container ?? */ -+ for (sp = CONTAINER_FIRST( _sensor_container ); -+ sp; -+ sp = CONTAINER_NEXT( _sensor_container, sp )) { -+ -+ if ( !strcmp( name, sp->name )) -+ return sp; -+ } -+ -+ /* -+ * Not found... -+ */ -+ if ( create_type == NETSNMP_SENSOR_FIND_EXIST ) { -+ DEBUGMSGTL(("sensors:name", "No such sensor entry\n")); -+ return NULL; -+ } -+ -+ /* -+ * ... so let's create a new one, using the type supplied -+ */ -+ sp = SNMP_MALLOC_TYPEDEF( netsnmp_sensor_info ); -+ if ( sp ) { -+ strcpy( sp->name, name ); -+ sp->type = create_type; -+ /* -+ * Set up the index value. -+ * -+ * All this trouble, just for a simple integer. -+ * Surely there must be a better way? -+ */ -+ sp->idx.len = 1; -+ sp->idx.oids = SNMP_MALLOC_TYPEDEF( oid ); -+ sp->idx.oids[0] = ++_sensor_idx; -+ } -+ -+ DEBUGMSGTL(("sensors:name", "Create sensor entry (type = %d, index = %d\n", -+ create_type, _sensor_idx)); -+ CONTAINER_INSERT( _sensor_container, sp ); -+ return sp; -+} -+ -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/hw_sensors.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1 @@ -+void init_hw_sensors( void ); -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.c ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.c 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,161 @@ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/sensors.h> -+ -+#include "util_funcs.h" -+#include <time.h> -+ -+#include <kstat.h> -+#include </usr/platform/sun4u/include/sys/envctrl.h> -+ -+void netsnmp_sensor_arch_init( void ) { -+ DEBUGMSGTL(("sensors:arch", "Initialise KStat Sensors module\n")); -+} -+ -+ -+int -+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) { -+ netsnmp_sensor_info *sp; -+ -+ int i; -+ const char *fantypes[]={"CPU","PWR","AFB"}; -+ char name[ 256 ]; -+ -+ kstat_ctl_t *kc; -+ kstat_t *kp; -+ envctrl_fan_t *fan_info; -+ envctrl_ps_t *power_info; -+ envctrl_encl_t *enc_info; -+ -+ -+ DEBUGMSGTL(("sensors:arch", "Reload KStat Sensors module\n")); -+ -+ kc = kstat_open(); -+ if ( kc == 0) { -+ DEBUGMSGTL(("sensors:arch", "Couldn't open kstat\n")); -+ return 1; -+ } -+ -+ -+ /* -+ * Retrieve fan information -+ */ -+ kp = kstat_lookup( kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_FANSTAT); -+ if (( kp == 0 ) || (kstat_read( kc, kp, 0 ) == -1 )) { -+ DEBUGMSGTL(("sensors:arch", "No fan information\n")); -+ } else { -+ fan_info = (envctrl_fan_t *)kp->ks_data; -+ for (i=0; i<kp->ks_ndata; i++) { -+ memset( name, 0, 256 ); -+ snprintf( name, 255, "%s%d", fantypes[fan_info->type], fan_info->instance ); -+ -+ sp = sensor_by_name( name, NETSNMP_SENSOR_TYPE_RPM ); -+ if ( sp ) { -+ sp->value = fan_info->fanspeed; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ snprintf( sp->descr, 255, "fan type %s number %d", -+ fantypes[fan_info->type], fan_info->instance ); -+ } -+ -+ fan_info++; -+ } -+ } -+ -+ -+ /* -+ * Retrieve Power Supply information -+ */ -+ kp = kstat_lookup( kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_PSNAME); -+ if (( kp == 0 ) || (kstat_read( kc, kp, 0 ) == -1 )) { -+ DEBUGMSGTL(("sensors:arch", "No PSU information\n")); -+ } else { -+ power_info = (envctrl_ps_t *)kp->ks_data; -+ for (i=0; i<kp->ks_ndata; i++) { -+ memset( name, 0, 256 ); -+ snprintf( name, 255, "PSU%d", power_info->instance ); -+ -+ sp = sensor_by_name( name, NETSNMP_SENSOR_TYPE_TEMPERATURE); -+ if ( sp ) { -+ sp->value = power_info->ps_tempr; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ snprintf( sp->descr, 255, "power supply %d", power_info->instance ); -+ } -+ -+ power_info++; -+ } -+ } -+ -+ -+ /* -+ * Retrieve Enclosure information -+ */ -+ kp = kstat_lookup( kc, ENVCTRL_MODULE_NAME, 0, ENVCTRL_KSTAT_ENCL); -+ if (( kp == 0 ) || (kstat_read( kc, kp, 0 ) == -1 )) { -+ DEBUGMSGTL(("sensors:arch", "No enclosure information\n")); -+ } else { -+ enc_info = (envctrl_encl_t *)kp->ks_data; -+ for (i=0; i<kp->ks_ndata; i++) { -+ /* -+ * The enclosure information covers several different types of sensor -+ */ -+ switch ( enc_info->type ) { -+ case ENVCTRL_ENCL_FSP: -+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Front Panel\n")); -+ sp = sensor_by_name( "FSP", NETSNMP_SENSOR_TYPE_OTHER); -+ if ( sp ) { -+ sp->value = enc_info->value; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } -+ break; -+ -+ case ENVCTRL_ENCL_AMBTEMPR: -+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Ambient Temperature\n")); -+ sp = sensor_by_name( "Ambient", NETSNMP_SENSOR_TYPE_TEMPERATURE); -+ if ( sp ) { -+ sp->value = enc_info->value; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } -+ break; -+ -+ case ENVCTRL_ENCL_CPUTEMPR: -+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure CPU Temperature\n")); -+ memset( name, 0, 256 ); -+ snprintf( name, 255, "CPU%d", enc_info->instance ); -+ sp = sensor_by_name( name, NETSNMP_SENSOR_TYPE_TEMPERATURE); -+ if ( sp ) { -+ sp->value = enc_info->value; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ snprintf( sp->descr, 255, "CPU%d temperature", enc_info->instance ); -+ } -+ break; -+ -+ case ENVCTRL_ENCL_BACKPLANE4: -+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Backplane4\n")); -+ sp = sensor_by_name( "Backplane4", NETSNMP_SENSOR_TYPE_OTHER); -+ if ( sp ) { -+ sp->value = enc_info->value; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } -+ break; -+ -+ case ENVCTRL_ENCL_BACKPLANE8: -+ DEBUGMSGTL(("sensors:arch:detail", "Enclosure Backplane4\n")); -+ sp = sensor_by_name( "Backplane4", NETSNMP_SENSOR_TYPE_OTHER); -+ if ( sp ) { -+ sp->value = enc_info->value; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } -+ break; -+ -+ default: -+ DEBUGMSGTL(("sensors:arch:detail", "Unrecognised Enclosure entry (%d)n", -+ enc_info->type)); -+ } -+ -+ enc_info++; -+ } -+ } -+ -+ return 0; -+} -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/kstat_sensors.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1 @@ -+config_require(hardware/sensors/hw_sensors) -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.c ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.c 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,75 @@ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/sensors.h> -+ -+#include "util_funcs.h" -+#include <time.h> -+#include <sensors/sensors.h> -+ -+void netsnmp_sensor_arch_init( void ) { -+ FILE *fp = fopen("/etc/sensors.conf", "r"); -+ DEBUGMSGTL(("sensors:arch", "Initialise LM Sensors module\n")); -+ sensors_init( fp ); -+} -+ -+int -+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) { -+ netsnmp_sensor_info *sp; -+ const sensors_chip_name *chip; -+ const sensors_feature_data *data; -+ int chip_nr = 0; -+ -+ DEBUGMSGTL(("sensors:arch", "Reload LM Sensors module\n")); -+ while ((chip = sensors_get_detected_chips(&chip_nr))) { -+ int a = 0; -+ int b = 0; -+ -+ while ((data = sensors_get_all_features(*chip, &a, &b))) { -+ DEBUGMSGTL(("sensors:arch:detail", "get_all_features (%d, %d)\n", a, b)); -+ char *label = NULL; -+ double val; -+ int type = NETSNMP_SENSOR_TYPE_OTHER; -+ -+ if ((data->mode & SENSORS_MODE_R) && -+ (data->mapping == SENSORS_NO_MAPPING) && -+ !sensors_get_label(*chip, data->number, &label) && -+ !sensors_get_feature(*chip, data->number, &val)) { -+ -+ DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val)); -+ /* -+ * Determine the type of sensor from the description. -+ * -+ * If the text being looked for below is not in the label of a -+ * given sensor (e.g., the temp1 sensor has been labeled 'CPU' -+ * rather than 'CPU temp') it will be categorised as OTHER. -+ */ -+ if (strstr(label, "V")) { -+ type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC; -+ } -+ if (strstr(label, "fan") || strstr(label, "Fan")) { -+ type = NETSNMP_SENSOR_TYPE_RPM; -+ } -+ if (strstr(label, "temp") || strstr(label, "Temp")) { -+ type = NETSNMP_SENSOR_TYPE_TEMPERATURE; -+ } -+ -+ /* -+ * Use this type to create a new sensor entry -+ * (inserting it in the appropriate sub-containers) -+ */ -+ sp = sensor_by_name( label, type ); -+ if ( sp ) { -+ sp->value = val; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } -+ } -+ if (label) { -+ free(label); -+ label = NULL; -+ } -+ } /* end while data */ -+ } /* end while chip */ -+ -+ return 0; -+} -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v2.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1 @@ -+config_require(hardware/sensors/hw_sensors) -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.c ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.c 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,101 @@ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/sensors.h> -+ -+#include "util_funcs.h" -+#include <time.h> -+#include <sensors/sensors.h> -+ -+ -+void netsnmp_sensor_arch_init( void ) { -+ FILE *fp = fopen("/etc/sensors.conf", "r"); -+ DEBUGMSGTL(("sensors:arch", "Initialise v3 LM Sensors module\n")); -+ sensors_init( fp ); -+} -+ -+int -+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) { -+ netsnmp_sensor_info *sp; -+ const sensors_chip_name *chip; -+ const sensors_feature *data; -+ const sensors_subfeature *data2; -+ int chip_nr = 0; -+ -+ DEBUGMSGTL(("sensors:arch", "Reload v3 LM Sensors module\n")); -+ while ((chip = sensors_get_detected_chips( NULL, &chip_nr))) { -+ int a = 0; -+ -+ while ((data = sensors_get_features( chip, &a))) { -+ DEBUGMSGTL(("sensors:arch:detail", "get_features (%s, %d)\n", data->name, data->number)); -+ int b = 0; -+ -+ -+ while ((data2 = sensors_get_all_subfeatures( chip, data, &b))) { -+ char *label = NULL; -+ double val; -+ int type = NETSNMP_SENSOR_TYPE_OTHER; -+ -+ DEBUGMSGTL(("sensors:arch:detail", " get_subfeatures (%s, %d)\n", data2->name, data2->number)); -+ /* -+ * Check the type of this subfeature, -+ * concentrating on the main "input" measurements. -+ */ -+ switch ( data2->type ) { -+ case SENSORS_SUBFEATURE_IN_INPUT: -+ type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC; -+ break; -+ case SENSORS_SUBFEATURE_FAN_INPUT: -+ type = NETSNMP_SENSOR_TYPE_RPM; -+ break; -+ case SENSORS_SUBFEATURE_TEMP_INPUT: -+ type = NETSNMP_SENSOR_TYPE_TEMPERATURE; -+ break; -+ case SENSORS_SUBFEATURE_VID: -+ type = NETSNMP_SENSOR_TYPE_VOLTAGE_DC; -+ break; -+ default: -+ /* Skip everything other than these basic sensor features - ??? */ -+ DEBUGMSGTL(("sensors:arch:detail", " Skip type %x\n", data2->type)); -+ continue; -+ } -+ -+ /* -+ * Get the name and value of this subfeature -+ */ -+/* -+ if (!(label = sensors_get_label(chip, data))) { -+ DEBUGMSGTL(("sensors:arch:detail", " Can't get name (%s)\n", label)); -+ continue; -+ } -+ if (sensors_get_value(chip, data2->number, &val) < 0) { -+ DEBUGMSGTL(("sensors:arch:detail", " Can't get value (%f)\n", val)); -+ continue; -+ } -+*/ -+ if (!(label = sensors_get_label(chip, data)) || -+ (sensors_get_value(chip, data2->number, &val) < 0)) { -+ DEBUGMSGTL(("sensors:arch:detail", " Can't get name/value (%s, %f)\n", label, val)); -+ continue; -+ } -+ DEBUGMSGTL(("sensors:arch:detail", "%s = %f\n", label, val)); -+ -+ /* -+ * Use this type to create a new sensor entry -+ * (inserting it in the appropriate sub-containers) -+ */ -+ sp = sensor_by_name( label, type ); -+ if ( sp ) { -+ sp->value = val; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } -+ if (label) { -+ free(label); -+ label = NULL; -+ } -+ } /* end while data2 */ -+ } /* end while data */ -+ } /* end while chip */ -+ -+ return 0; -+} -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/lmsensors_v3.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1 @@ -+config_require(hardware/sensors/hw_sensors) -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.c ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.c 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,341 @@ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/sensors.h> -+ -+#include "util_funcs.h" -+#include <time.h> -+ -+#include <picl.h> -+#include </usr/platform/sun4u/include/sys/envctrl.h> -+ -+void netsnmp_sensor_arch_init( void ) { -+ DEBUGMSGTL(("sensors:arch", "Initialise PICLd Sensors module\n")); -+ picl_initialize(); -+} -+ -+ -+/* -+ * Handle a numeric-valued sensor -+ */ -+static int -+read_num_sensor( picl_nodehdl_t childh, char *propval, float *value ) -+{ -+ picl_nodehdl_t sensorh; -+ picl_propinfo_t sensor_info; -+ picl_errno_t error_code; -+ -+ union valu { -+ char buf[PICL_PROPSIZE_MAX]; -+ uint32_t us4; -+ uint16_t us2; -+ int32_t is4; -+ int16_t is2; -+ float f; -+ } val; -+ -+ /* -+ * Retrieve the specified sensor information and value -+ */ -+ error_code = picl_get_propinfo_by_name(childh, propval, &sensor_info, &sensorh); -+ if ( error_code != PICL_SUCCESS ) { -+ DEBUGMSGTL(("sensors:arch:detail", "sensor info lookup failed (%d)\n", -+ error_code)); -+ return( error_code ); -+ } -+ -+ error_code = picl_get_propval(sensorh, &val.buf, sensor_info.size); -+ if ( error_code != PICL_SUCCESS ) { -+ DEBUGMSGTL(("sensors:arch:detail", "sensor value lookup failed (%d)\n", -+ error_code)); -+ return( error_code ); -+ } -+ -+ /* -+ * Check the validity (type and size) of this value -+ */ -+ if ( sensor_info.type == PICL_PTYPE_FLOAT ) { -+ *value = val.f; -+ } else if ( sensor_info.type == PICL_PTYPE_UNSIGNED_INT ) { -+ /* 16-bit or 32-bit unsigned integers */ -+ if ( sensor_info.size == 2 ) { -+ *value = val.us2; -+ } else if ( sensor_info.size == 4 ) { -+ *value = val.us4; -+ } else { -+ DEBUGMSGTL(("sensors:arch:detail", "unsigned integer (%d bit)\n", -+ sensor_info.size * 8)); -+ return PICL_FAILURE; -+ } -+ } else if ( sensor_info.type == PICL_PTYPE_INT ) { -+ /* 16-bit or 32-bit signed integers */ -+ if ( sensor_info.size == 2 ) { -+ *value = val.is2; -+ } else if ( sensor_info.size == 4 ) { -+ *value = val.is4; -+ } else { -+ DEBUGMSGTL(("sensors:arch:detail", "signed integer (%d bit)\n", -+ sensor_info.size * 8)); -+ return PICL_FAILURE; -+ } -+ } else { -+ DEBUGMSGTL(("sensors:arch:detail", "unrecognised type (%d)\n", -+ sensor_info.type)); -+ return PICL_FAILURE; -+ } -+ -+ return error_code; -+} -+ -+static int -+process_num_sensor( picl_nodehdl_t childh, char *propname, char *propval, int typ ) -+{ -+ netsnmp_sensor_info *sp; -+ float value; -+ picl_errno_t error_code; -+ -+ sp = sensor_by_name( propname, typ ); -+ if ( !sp ) { -+ return -1; -+ } -+ -+ error_code = read_num_sensor( childh, propval, &value ); -+ if ( error_code == PICL_SUCCESS ) { -+ sp->value = value; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } else { -+ DEBUGMSGTL(("sensors:arch:detail", "Failed to read %s sensor value (%d)\n", -+ propname, error_code)); -+ return -1; -+ } -+ return 0; -+} -+ -+ -+ -+/* -+ * Handle an enumeration-valued sensor -+ */ -+char *switch_settings[] = { "OFF","ON","NORMAL","LOCKED", -+ "UNKNOWN","DIAG","SECURE", -+ NULL }; -+char *led_settings[] = { "OFF","ON","BLINK", -+ NULL }; -+char *i2c_settings[] = { "OK", -+ NULL }; -+ -+static int -+read_enum_sensor( picl_nodehdl_t childh, float *value, char **options ) -+{ -+ picl_nodehdl_t sensorh; -+ picl_propinfo_t sensor_info; -+ picl_errno_t error_code; -+ char state[PICL_PROPSIZE_MAX]; -+ int i; -+ -+ /* -+ * Retrieve the specified sensor information and value -+ */ -+ error_code = picl_get_propinfo_by_name(childh, "State", &sensor_info, &sensorh); -+ if ( error_code != PICL_SUCCESS ) { -+ DEBUGMSGTL(("sensors:arch:detail", "sensor info lookup failed (%d)\n", -+ error_code)); -+ return( error_code ); -+ } -+ -+ error_code = picl_get_propval(sensorh, state, sensor_info.size); -+ if ( error_code != PICL_SUCCESS ) { -+ DEBUGMSGTL(("sensors:arch:detail", "sensor value lookup failed (%d)\n", -+ error_code)); -+ return( error_code ); -+ } -+ -+ /* -+ * Try to find a matching entry in the list of options. -+ * Note that some platforms may use upper or lower case -+ * versions of these enumeration values -+ * (so the checks are case insensitive) -+ */ -+ *value = 99; /* Dummy value */ -+ for ( i=0; options[i] != NULL; i++ ) { -+ if (strncasecmp(state, options[i], strlen(options[i])) == 0) { -+ *value = i; -+ return 0; -+ } -+ } -+ -+ DEBUGMSGTL(("sensors:arch:detail", "Enumeration state %s not matched\n", -+ state)); -+ return 0; /* Or an error ? */ -+} -+ -+static int -+process_enum_sensor( picl_nodehdl_t childh, char *propname, int typ, char **options ) -+{ -+ netsnmp_sensor_info *sp; -+ float value; -+ picl_errno_t error_code; -+ -+ sp = sensor_by_name( propname, typ ); -+ if ( !sp ) { -+ return -1; -+ } -+ -+ error_code = read_enum_sensor( childh, &value, options ); -+ if ( error_code == PICL_SUCCESS ) { -+ sp->value = value; -+ sp->flags|= NETSNMP_SENSOR_FLAG_ACTIVE; -+ } else { -+ DEBUGMSGTL(("sensors:arch:detail", "Failed to read %s sensor value (%d)\n", -+ propname, error_code)); -+ return -1; -+ } -+ return 0; -+} -+static int -+process_enum_sensor( picl_nodehdl_t childh, char *propname, int typ, char **options ) -+{ -+ return 0; -+} -+ -+ -+ -+/* -+ * Recursively walk through the tree of sensors -+ */ -+static int -+process_sensors( int level, picl_nodehdl_t nodeh ) { -+ picl_nodehdl_t childh, nexth; -+ char propname[ PICL_PROPNAMELEN_MAX ]; -+ char propclass[ PICL_CLASSNAMELEN_MAX ]; -+ picl_errno_t error_code; -+ -+ level++; -+ DEBUGMSGTL(("sensors:arch:detail", "process_sensors - level %d\n", level)); -+ -+ /* Look up the first child node at this level */ -+ error_code = pick_get_propval_by_name( nodeh, PICL_PROP_CHILD, -+ &childh, sizeof(childh)); -+ if ( error_code != PICL_SUCCESS ) { -+ DEBUGMSGTL(("sensors:arch:detail", "Failed to get first child node (%d)\n", -+ error_code)); -+ return( error_code ); -+ } -+ -+ /* Step through the child nodes, retrieving the name and class of each one */ -+ while ( error_code == PICL_SUCCESS ) { -+ error_code = pick_get_propval_by_name( childh, PICL_PROP_NAME, -+ propname, sizeof(propname)-1); -+ if ( error_code != PICL_SUCCESS ) { -+ /* The Node With No Name */ -+ DEBUGMSGTL(("sensors:arch:detail", "get property name failed (%d)\n", -+ error_code)); -+ return( error_code ); -+ } -+ -+ error_code = pick_get_propval_by_name( childh, PICL_PROP_CLASSNAME, -+ propclass, sizeof(propclass)-1); -+ if ( error_code != PICL_SUCCESS ) { -+ /* The Classless Society */ -+ DEBUGMSGTL(("sensors:arch:detail", "get property class failed (%d)\n", -+ error_code)); -+ return( error_code ); -+ } -+ -+ DEBUGMSGTL(("sensors:arch:detail", "Name: %s, Class %s\n", -+ propname, propclass )); -+ -+ -+ /* -+ * Three classes represent further groups of sensors, etc. -+ * Call 'process_sensors' recursively to handle this next level -+ */ -+ if (( strstr( propclass, "picl" )) || -+ ( strstr( propclass, "frutree" )) || -+ ( strstr( propclass, "obp" ))) { -+ process_sensors( level, childh ); -+ } -+ /* -+ * Otherwise retrieve the value appropriately based on the -+ * class of the sensor. -+ * -+ * We need to specify the name of the PICL property to retrieve -+ * for this class of sensor, and the Net-SNMP sensor type. -+ */ -+ else if ( strstr( propclass, "fan-tachometer" )) { -+ process_num_sensor( childh, propname, "AtoDSensorValue", -+ NETSNMP_SENSOR_TYPE_RPM ); -+ } else if ( strstr( propclass, "fan" )) { -+ process_num_sensor( childh, propname, "Speed", -+ NETSNMP_SENSOR_TYPE_RPM ); -+ } else if ( strstr( propclass, "temperature-sensor" )) { -+ process_num_sensor( childh, propname, "Temperature", -+ NETSNMP_SENSOR_TYPE_TEMPERATURE ); -+ } else if ( strstr( propclass, "voltage-sensor" )) { -+ process_num_sensor( childh, propname, "Voltage", -+ /* ?? */ NETSNMP_SENSOR_TYPE_VOLTAGE_DC ); -+ } else if ( strstr( propclass, "digital-sensor" )) { -+ process_num_sensor( childh, propname, "AtoDSensorValue", -+ /* ?? */ NETSNMP_SENSOR_TYPE_VOLTAGE_DC ); -+ /* -+ * Enumeration-valued sensors use a fixed PICL property ("State"), -+ * but take a list of the values appropriate for that sensor, -+ * as well as the Net-SNMP sensor type. -+ */ -+ } else if ( strstr( propclass, "switch" )) { -+ process_enum_sensor( childh, propname, NETSNMP_SENSOR_TYPE_OTHER, -+ switch_settings ); -+ } else if ( strstr( propclass, "led" )) { -+ process_enum_sensor( childh, propname, NETSNMP_SENSOR_TYPE_OTHER, -+ led_settings ); -+ } else if ( strstr( propclass, "i2c" )) { -+ process_enum_sensor( childh, propname, NETSNMP_SENSOR_TYPE_BOOLEAN, /* ?? */ -+ i2c_settings ); -+ } else { -+ /* Skip other classes of sensor */ -+ DEBUGMSGTL(("sensors:arch:detail", "Skipping class %s\n", propclass )); -+ } -+ -+ /* -+ * Move on to the next child node at the current level (if any) -+ */ -+ error_code = pick_get_propval_by_name( childh, PICL_PROP_PEER, -+ &nexth, sizeof(nexth)); -+ if ( error_code != PICL_SUCCESS ) { -+ /* That's All Folks! */ -+ return (( error_code == PICL_PROPNOTFOUND ) -+ ? PICL_SUCCESS : error_code ); -+ } -+ childh = nexth; -+ } -+ -+ return error_code; -+} -+ -+ -+int -+netsnmp_sensor_arch_load(netsnmp_cache *cache, void *vp) { -+ int error_code; -+ picl_nodehdl_t rooth; -+ -+ DEBUGMSGTL(("sensors:arch", "Reload PICLd Sensors module\n")); -+ -+ error_code = picl_get_root(&rooth); -+ if ( error_code != PICL_SUCCESS) { -+ DEBUGMSGTL(("sensors:arch", "Couldn't get root node (error %d)\n", error_code)); -+ return 1; -+ } -+ -+ error_code = process_sensors(0, rooth); -+ if ( error_code != 255 ) -+ if ( error_code != 7 ) /* ignore PICL_PROPNOTFOUND error */ -+ DEBUGMSGTL(("sensors:arch", "Internal PICLd problem (error %d)\n", error_code)); -+ -+ return 0; -+} -+ -+void netsnmp_sensor_arch_shutdown( void ) { -+ DEBUGMSGTL(("sensors:arch", "Shutdown PicLD Sensors module\n")); -+ picl_shutdown(); -+} -+ -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/hardware/sensors/picld_sensors.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1 @@ -+config_require(hardware/sensors/hw_sensors) -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.c ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.c 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,205 @@ -+#include <net-snmp/net-snmp-config.h> -+#include <net-snmp/net-snmp-includes.h> -+#include <net-snmp/agent/net-snmp-agent-includes.h> -+#include <net-snmp/agent/hardware/sensors.h> -+#include "ucd-snmp/lmsensorsMib.h" -+ -+netsnmp_container *sensorContainer = NULL; -+ -+void initialize_lmSensorsTable(const char *tableName, oid *tableOID, -+ netsnmp_container_op *filter, int mult ); -+ -+int _sensor_filter_temp( netsnmp_container *c, const void *v ); -+int _sensor_filter_fan( netsnmp_container *c, const void *v ); -+int _sensor_filter_volt( netsnmp_container *c, const void *v ); -+int _sensor_filter_misc( netsnmp_container *c, const void *v ); -+ -+static oid lmTempSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,2}; -+static oid lmFanSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,3}; -+static oid lmVoltSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,4}; -+static oid lmMiscSensorsTable_oid[] = {1,3,6,1,4,1,2021,13,16,5}; -+ /* All the tables have the same length root OID */ -+size_t lmSensorsTables_oid_len = OID_LENGTH(lmMiscSensorsTable_oid); -+ -+ -+/* Initialise the LM Sensors MIB module */ -+void -+init_lmsensorsMib(void) -+{ -+ DEBUGMSGTL(("ucd-snmp/lmsensorsMib","Initializing LM-SENSORS-MIB tables\n")); -+ -+ /* -+ * Initialise the four LM-SENSORS-MIB tables -+ * -+ * They are almost identical, so we can use the same registration code. -+ */ -+ initialize_lmSensorsTable( "lmTempSensorsTable", lmTempSensorsTable_oid, -+ _sensor_filter_temp, 1000 ); /* MIB asks for mC */ -+ initialize_lmSensorsTable( "lmFanSensorsTable", lmFanSensorsTable_oid, -+ _sensor_filter_fan, 1); -+ initialize_lmSensorsTable( "lmVoltSensorsTable", lmVoltSensorsTable_oid, -+ _sensor_filter_volt, 1000 ); /* MIB asks for mV */ -+ initialize_lmSensorsTable( "lmMiscSensorsTable", lmMiscSensorsTable_oid, -+ _sensor_filter_misc, 1 ); -+} -+ -+/* -+ * Common initialisation code, used for setting up all four tables -+ */ -+void -+initialize_lmSensorsTable(const char *tableName, oid *tableOID, -+ netsnmp_container_op *filter, int mult ) -+{ -+ netsnmp_handler_registration *reg; -+ netsnmp_table_registration_info *table_info; -+ netsnmp_cache *cache; -+ netsnmp_container *container; -+ -+ /* -+ * Ensure the HAL sensors module has been initialised, -+ * and retrieve the main sensors container. -+ * This table will then be registered using a filter on this container. -+ */ -+ sensorContainer = get_sensor_container(); -+ if ( !sensorContainer ) { -+ init_hw_sensors( ); -+ sensorContainer = get_sensor_container(); -+ } -+ container = netsnmp_container_find("sensorTable:table_container"); -+ container->insert_filter = filter; -+ netsnmp_container_add_index( sensorContainer, container ); -+ -+ -+ /* -+ * Create a basic registration structure for the table -+ */ -+ reg = netsnmp_create_handler_registration( -+ tableName, lmSensorsTables_handler, -+ tableOID, lmSensorsTables_oid_len, HANDLER_CAN_RONLY -+ ); -+ -+ /* -+ * Register the table using the filtered container -+ * Include an indicator of any scaling to be applied to the sensor value -+ */ -+ reg->my_reg_void = (void *)mult; -+ table_info = SNMP_MALLOC_TYPEDEF( netsnmp_table_registration_info ); -+ netsnmp_table_helper_add_indexes(table_info, ASN_INTEGER, 0); -+ table_info->min_column = COLUMN_LMSENSORS_INDEX; -+ table_info->max_column = COLUMN_LMSENSORS_VALUE; -+ netsnmp_container_table_register( reg, table_info, container, 0 ); -+ -+ /* -+ * If the HAL sensors module was configured as an on-demand caching -+ * module (rather than being automatically loaded regularly), -+ * then ensure this table makes use of that cache. -+ */ -+ cache = get_sensor_cache(); -+ if ( cache ) { -+ netsnmp_inject_handler_before( reg, netsnmp_cache_handler_get( cache ), -+ "table_container"); -+ } -+ -+} -+ -+ -+/* -+ * Container filters for the four tables -+ * -+ * Used to ensure that sensor entries appear in the appropriate table. -+ */ -+int _sensor_filter_temp( netsnmp_container *c, const void *v ) { -+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v; -+ /* Only matches temperature sensors */ -+ return (( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) ? 0 : 1 ); -+} -+ -+int _sensor_filter_fan( netsnmp_container *c, const void *v ) { -+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v; -+ /* Only matches fan sensors */ -+ return (( sp->type == NETSNMP_SENSOR_TYPE_RPM ) ? 0 : 1 ); -+} -+ -+int _sensor_filter_volt( netsnmp_container *c, const void *v ) { -+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v; -+ /* Only matches voltage sensors (AC or DC) */ -+ return ((( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC ) || -+ ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC )) ? 0 : 1 ); -+} -+ -+int _sensor_filter_misc( netsnmp_container *c, const void *v ) { -+ const netsnmp_sensor_info *sp = (const netsnmp_sensor_info *)v; -+ /* Matches everything except temperature, fan or voltage sensors */ -+ return ((( sp->type == NETSNMP_SENSOR_TYPE_TEMPERATURE ) || -+ ( sp->type == NETSNMP_SENSOR_TYPE_RPM ) || -+ ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_DC ) || -+ ( sp->type == NETSNMP_SENSOR_TYPE_VOLTAGE_AC )) ? 1 : 0 ); -+} -+ -+ -+/* -+ * Handle requests for any of the four lmXxxxSensorsTables -+ * -+ * This is possible because all the table share the -+ * same structure and behaviour. -+ */ -+int -+lmSensorsTables_handler( -+ netsnmp_mib_handler *handler, -+ netsnmp_handler_registration *reginfo, -+ netsnmp_agent_request_info *reqinfo, -+ netsnmp_request_info *requests) { -+ -+ netsnmp_request_info *request; -+ netsnmp_table_request_info *table_info; -+ netsnmp_sensor_info *sensor_info; -+ int mult = (int)reginfo->my_reg_void; -+ -+ DEBUGMSGTL(( "ucd-snmp/lmsensorsMib","lmSensorsTables_handler - root: ")); -+ DEBUGMSGOID(("ucd-snmp/lmsensorsMib", reginfo->rootoid, reginfo->rootoid_len)); -+ DEBUGMSG(( "ucd-snmp/lmsensorsMib",", mode %d\n", reqinfo->mode )); -+ /* -+ * This is a read-only table, so we only need to handle GET requests. -+ * (The container helper converts GETNEXT->GET requests automatically). -+ */ -+ switch (reqinfo->mode) { -+ case MODE_GET: -+ for (request=requests; request; request=request->next) { -+ sensor_info = (netsnmp_sensor_info *) -+ netsnmp_container_table_extract_context(request); -+ if ( !sensor_info ) { -+ netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHINSTANCE); -+ continue; -+ } -+ -+ table_info = netsnmp_extract_table_info(request); -+ switch (table_info->colnum) { -+ case COLUMN_LMSENSORS_INDEX: -+ snmp_set_var_typed_integer( request->requestvb, ASN_INTEGER, -+ sensor_info->idx.oids[0]); -+ break; -+ case COLUMN_LMSENSORS_DEVICE: -+ if ( sensor_info->descr[0] != '\0' ) { -+ snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR, -+ sensor_info->descr, strlen(sensor_info->descr)); -+ } else { -+ snmp_set_var_typed_value( request->requestvb, ASN_OCTET_STR, -+ sensor_info->name, strlen(sensor_info->name)); -+ } -+ break; -+ case COLUMN_LMSENSORS_VALUE: -+ /* Multiply the value by the appropriate scaling factor for this table */ -+ snmp_set_var_typed_integer( request->requestvb, ASN_GAUGE, -+ (int)(mult*sensor_info->value)); -+ break; -+ default: -+ netsnmp_set_request_error(reqinfo, request, -+ SNMP_NOSUCHOBJECT); -+ break; -+ } -+ } -+ break; -+ -+ } -+ return SNMP_ERR_NOERROR; -+} -diff -up /dev/null net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/agent/mibgroup/ucd-snmp/lmsensorsMib.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,23 @@ -+#ifndef LM_SENSORS_MIB_H -+#define LM_SENSORS_MIB_H -+ -+config_require(hardware/sensors) -+config_add_mib(LM-SENSORS-MIB) -+ -+/* function declarations */ -+void init_lmsensorsMib(void); -+ -+/* -+ * Handler and Column definitions for lmXxxxSensorsTable -+ * -+ * Note that the same handler (and hence the same -+ * column identifiers) are used for all four tables. -+ * This is possible because all the table share the -+ * same structure and behaviour. -+ */ -+Netsnmp_Node_Handler lmSensorsTables_handler; -+#define COLUMN_LMSENSORS_INDEX 1 -+#define COLUMN_LMSENSORS_DEVICE 2 -+#define COLUMN_LMSENSORS_VALUE 3 -+ -+#endif /* LM_SENSORS_MIB_H */ -diff -up net-snmp-5.4.1/configure.backup_patch_15 net-snmp-5.4.1/configure ---- net-snmp-5.4.1/configure.backup_patch_15 2008-07-25 12:53:39.000000000 +0200 -+++ net-snmp-5.4.1/configure 2008-07-25 12:53:46.000000000 +0200 -@@ -31030,7 +31030,7 @@ fi - fi - - # LM-SENSORS-MIB support --echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null -+echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null - if test $? -eq 0 ; then - echo "$as_me:$LINENO: checking for sensors support" >&5 - echo $ECHO_N "checking for sensors support... $ECHO_C" >&6 -diff -up net-snmp-5.4.1/configure.in.backup_patch_15 net-snmp-5.4.1/configure.in ---- net-snmp-5.4.1/configure.in.backup_patch_15 2008-07-25 12:53:39.000000000 +0200 -+++ net-snmp-5.4.1/configure.in 2008-07-25 12:53:46.000000000 +0200 -@@ -2880,7 +2880,7 @@ if test $? -eq 0 ; then - fi - - # LM-SENSORS-MIB support --echo " $module_list " | grep " ucd-snmp/lmSensors " > /dev/null -+echo " $module_list " | $GREP -i "ucd-snmp/lmsensor" > /dev/null - if test $? -eq 0 ; then - AC_MSG_CHECKING([for sensors support]) - case $target_os in -diff -up /dev/null net-snmp-5.4.1/include/net-snmp/agent/hardware/sensors.h ---- /dev/null 2008-07-23 14:59:56.660004489 +0200 -+++ net-snmp-5.4.1/include/net-snmp/agent/hardware/sensors.h 2008-07-25 12:53:46.000000000 +0200 -@@ -0,0 +1,48 @@ -+/* -+ * Hardware Abstraction Layer - Sensors module -+ * -+ * Public interface -+ */ -+ -+#define NETSNMP_SENSOR_TYPE_OTHER 1 -+#define NETSNMP_SENSOR_TYPE_VOLTAGE_AC 3 -+#define NETSNMP_SENSOR_TYPE_VOLTAGE_DC 4 -+#define NETSNMP_SENSOR_TYPE_CURRENT 5 -+#define NETSNMP_SENSOR_TYPE_POWER 6 -+#define NETSNMP_SENSOR_TYPE_FREQUENCY 7 -+#define NETSNMP_SENSOR_TYPE_TEMPERATURE 8 -+#define NETSNMP_SENSOR_TYPE_HUMIDITY 9 -+#define NETSNMP_SENSOR_TYPE_RPM 10 -+#define NETSNMP_SENSOR_TYPE_VOLUME 11 -+#define NETSNMP_SENSOR_TYPE_BOOLEAN 12 -+ -+ -+#define NETSNMP_SENSOR_FLAG_ACTIVE 0x01 -+#define NETSNMP_SENSOR_FLAG_NAVAIL 0x02 -+#define NETSNMP_SENSOR_FLAG_BROKEN 0x04 -+#define NETSNMP_SENSOR_FLAG_DISABLE 0x08 -+ -+#define NETSNMP_SENSOR_MASK_STATUS 0x06 /* NAVAIL|BROKEN */ -+ -+ -+#define NETSNMP_SENSOR_FIND_CREATE 1 /* or use one of the sensor type values */ -+#define NETSNMP_SENSOR_FIND_EXIST 0 -+ -+typedef struct netsnmp_sensor_info_s netsnmp_sensor_info; -+struct netsnmp_sensor_info_s { -+ -+ netsnmp_index idx; -+ /* int idx; */ -+ char name[256]; -+ -+ int type; -+ float value; -+ char descr[256]; -+ long flags; -+}; -+ -+netsnmp_container *get_sensor_container( void ); -+netsnmp_cache *get_sensor_cache( void ); -+netsnmp_sensor_info *sensor_by_name( char *, int ); -+NetsnmpCacheLoad netsnmp_sensor_load; -+NetsnmpCacheFree netsnmp_sensor_free; diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch deleted file mode 100644 index f08d8f71..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.1-suppresssuppress-annoying.patch +++ /dev/null @@ -1,17 +0,0 @@ -NEWS: agent: suppress annoying "registration != duplicate" warning for root oids -(otherwise, you'll get this message on almost every startup) - -http://net-snmp.svn.sourceforge.net/viewvc/net-snmp?view=rev&revision=16669 - ---- branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/20 08:06:42 16668 -+++ branches/V5-4-patches/net-snmp/agent/agent_registry.c 2007/08/22 21:56:23 16669 -@@ -532,7 +532,8 @@ - - if (next && (next->namelen == new_sub->namelen) && - (next->priority == new_sub->priority)) { -- netsnmp_assert(!"registration != duplicate"); /* always false */ -+ if (new_sub->namelen != 1) /* ignore root OID dups */ -+ netsnmp_assert(!"registration != duplicate"); /* always false */ - return MIB_DUPLICATE_REGISTRATION; - } - diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.2.1-BJA-cross-net-snmp-config.diff b/net-analyzer/net-snmp/files/net-snmp-5.4.2.1-BJA-cross-net-snmp-config.diff deleted file mode 100644 index 6cf86e07..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.2.1-BJA-cross-net-snmp-config.diff +++ /dev/null @@ -1,11 +0,0 @@ ---- net-snmp-config.in.ori 2011-05-31 23:38:58.918259036 +0200 -+++ net-snmp-config.in 2011-05-31 23:40:34.627769905 +0200 -@@ -27,7 +27,7 @@ - fi - } - --prefix=@prefix@ -+prefix=${ROOT}@prefix@ - exec_prefix=@exec_prefix@ - includedir=@includedir@ - libdir=@libdir@ diff --git a/net-analyzer/net-snmp/files/net-snmp-5.4.2.1-perlcc-hppa.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.2.1-perlcc-hppa.patch deleted file mode 100644 index 40a0d1bb..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-5.4.2.1-perlcc-hppa.patch +++ /dev/null @@ -1,12 +0,0 @@ -diff -uNr net-snmp-5.4.2.1.orig/configure.in net-snmp-5.4.2.1/configure.in ---- net-snmp-5.4.2.1.orig/configure.in 2010-07-29 12:05:12.619347954 +0200 -+++ net-snmp-5.4.2.1/configure.in 2010-07-29 12:05:38.358857068 +0200 -@@ -2986,7 +2986,7 @@ - if test "xenable_perl_cc_checks" != "xno" ; then - AC_MSG_CHECKING([for Perl cc]) - changequote(, ) -- PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/]+).;\s*/$1/);'` -+ PERLCC=`$myperl -V:cc | $myperl -n -e 'print if (s/^\s*cc=.([-=\w\s\/\.]+).;\s*/$1/);'` - changequote([, ]) - if test "x$PERLCC" != "x" ; then - AC_MSG_RESULT([$PERLCC]) diff --git a/net-analyzer/net-snmp/files/net-snmp-lm_sensors.patch b/net-analyzer/net-snmp/files/net-snmp-lm_sensors.patch deleted file mode 100644 index 29ba1ea8..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-lm_sensors.patch +++ /dev/null @@ -1,475 +0,0 @@ -diff -Naur net-snmp-5.1.1.old/agent/mibgroup/host/hr_sensor.c net-snmp-5.1.1/agent/mibgroup/host/hr_sensor.c ---- net-snmp-5.1.1.old/agent/mibgroup/host/hr_sensor.c 1970-01-01 02:00:00.000000000 +0200 -+++ net-snmp-5.1.1/agent/mibgroup/host/hr_sensor.c 2003-10-21 12:49:57.000000000 +0300 -@@ -0,0 +1,322 @@ -+/* This file was generated by mib2c and is intended for use as a mib module -+ for the ucd-snmp snmpd agent. */ -+ -+#include <net-snmp/net-snmp-config.h> -+ -+#include <stdio.h> -+#if HAVE_STDLIB_H -+#include <stdlib.h> -+#endif -+#if HAVE_STRING_H -+#include <string.h> -+#else -+#include <strings.h> -+#endif -+ -+#include <getopt.h> -+#include <errno.h> -+#include <dlfcn.h> -+ -+#include "sensors/sensors.h" -+#include "sensors/error.h" -+ -+#include "host_res.h" -+#include "hr_sensor.h" -+ -+ -+/* -+ * hr_sensor_variables_oid: -+ * this is the top level oid that we want to register under. This -+ * is essentially a prefix, with the suffix appearing in the -+ * variable below. -+ */ -+ -+ -+oid hr_sensor_variables_oid[] = { 1,3,6,1,2,1,25,8 }; -+ -+ -+/* -+ * variable2 hr_sensor_variables: -+ * this variable defines function callbacks and type return information -+ * for the hr_sensor mib section -+ */ -+ -+ -+struct variable2 hr_sensor_variables[] = { -+ /* magic number , variable type , ro/rw , callback fn , L, oidsuffix */ -+#define HRSENSORMAPPING 2 -+ { HRSENSORMAPPING, ASN_INTEGER , RONLY , var_hr_sensor, 2, { 1,1 } }, -+#define HRSENSORNUMBER 3 -+ { HRSENSORNUMBER, ASN_INTEGER , RONLY , var_hr_sensor, 2, { 1,2 } }, -+#define HRSENSORNAME 4 -+ { HRSENSORNAME , ASN_OCTET_STR , RONLY , var_hr_sensor, 2, { 1,3 } }, -+#define HRSENSORLABEL 5 -+ { HRSENSORLABEL , ASN_OCTET_STR , RONLY , var_hr_sensor, 2, { 1,4 } }, -+#define HRSENSORVALUE 6 -+ { HRSENSORVALUE , ASN_OCTET_STR , RONLY , var_hr_sensor, 2, { 1,5 } }, -+ -+}; -+/* (L = length of the oidsuffix) */ -+ -+ -+#define DEFAULT_CONFIG_FILE_NAME "sensors.conf" -+ -+static char *config_file_name; -+FILE *config_file; -+static const char *config_file_path[] = -+{ "/etc", "/usr/lib/sensors", "/usr/local/lib/sensors", "/usr/lib", -+ "/usr/local/lib", ".", 0 }; -+ -+static void open_config_file(void); -+static int open_this_config_file(char *filename); -+ -+ -+/* -+ * functions that are dynamically loaded if the lm_sensors library is -+ * installed. -+ */ -+static int (*sensors_get_label_dl)(sensors_chip_name name, int feature, -+ char **result); -+static int (*sensors_init_dl)(FILE *input); -+static int (*sensors_get_feature_dl)(sensors_chip_name name, int feature, -+ double *result); -+static const sensors_feature_data *(*sensors_get_all_features_dl) -+ (sensors_chip_name name, int *nr1,int *nr2); -+static const sensors_chip_name *(*sensors_get_detected_chips_dl)(int *nr); -+ -+#define CHIPS_MAX 20 -+static sensors_chip_name chips[CHIPS_MAX]; -+static int chips_count=0; -+static int do_sets; -+ -+/* This examines global var config_file, and leaves the name there too. -+ It also opens config_file. */ -+static void open_config_file(void) -+{ -+#define MAX_FILENAME_LEN 1024 -+ char *filename; -+ char buffer[MAX_FILENAME_LEN]; -+ int res,i; -+ -+ if (config_file_name && !strcmp(config_file_name,"-")) { -+ config_file = stdin; -+ return; -+ } else if (config_file_name && index(config_file_name,'/')) { -+ if ((res = open_this_config_file(config_file_name))) { -+ fprintf(stderr,"Could not locate or open config file\n"); -+ fprintf(stderr,"%s: %s\n",config_file_name,strerror(res)); -+ exit(1); -+ } -+ } -+ else { -+ if (config_file_name) -+ filename = config_file_name; -+ else -+ filename = strdup(DEFAULT_CONFIG_FILE_NAME); -+ for (i = 0; config_file_path[i]; i++) { -+ if ((snprintf(buffer,MAX_FILENAME_LEN, -+ "%s/%s",config_file_path[i],filename)) < 1) { -+ fprintf(stderr, -+ "open_config_file: ridiculous long config file name!\n"); -+ exit(1); -+ } -+ if (!open_this_config_file(buffer)) { -+ free(config_file_name); -+ config_file_name = strdup(buffer); -+ return; -+ } -+ } -+ fprintf(stderr,"Could not locate or open config file!\n"); -+ exit(1); -+ } -+} -+ -+static int open_this_config_file(char *filename) -+{ -+ config_file = fopen(filename,"r"); -+ if (! config_file) -+ return -errno; -+ return 0; -+} -+ -+static long *sensor_tbl = 0; -+sensors_chip_name *chip_tbl = 0; -+static int sensor_maxnum = 0; -+ -+static void do_register(sensors_chip_name name) -+{ -+ const char *algo,*adap; -+ -+ { -+ const sensors_feature_data *sensor; -+ const char *map=0; -+ int index0 = 0, index1 = 0; -+ -+ printf("%s\n", name); -+ -+ while ((sensor = sensors_get_all_features_dl (name, &index0, &index1)) -+ != NULL) { -+ if(sensor_tbl = realloc(sensor_tbl, sizeof(long) * (sensor_maxnum+2))) -+ sensor_tbl[sensor_maxnum] = sensor->number; -+ if (chip_tbl = realloc(chip_tbl, sizeof(sensors_chip_name) * (sensor_maxnum+2))) -+ chip_tbl[sensor_maxnum] = name; -+ sensor_maxnum++; -+ } -+ } -+} -+ -+/* -+ * init_hr_sensor(): -+ * Initialization routine. This is called when the agent starts up. -+ * At a minimum, registration of your variables should take place here. -+ */ -+void init_hr_sensor(void) { -+ -+ const sensors_chip_name *chip; -+ int chip_nr,i; -+ int c,res; -+ void *sensors_library; -+ -+ /* This could probably due with a bit more error reporting. */ -+ sensors_library=dlopen("libsensors.so",RTLD_LAZY); -+ if(sensors_library==NULL) -+ return; // return before anything is registered -+ -+ sensors_get_label_dl=dlsym(sensors_library,"sensors_get_label"); -+ sensors_init_dl=dlsym(sensors_library,"sensors_init"); -+ sensors_get_feature_dl=dlsym(sensors_library,"sensors_get_feature"); -+ sensors_get_all_features_dl=dlsym(sensors_library, -+ "sensors_get_all_features"); -+ sensors_get_detected_chips_dl=dlsym(sensors_library, -+ "sensors_get_detected_chips"); -+ if(sensors_get_label_dl==NULL || sensors_init_dl==NULL || -+ sensors_get_feature_dl==NULL || sensors_get_all_features_dl==NULL || -+ sensors_get_detected_chips_dl==NULL) -+ return; // return before anything is registered -+ -+ /* register ourselves with the agent to handle our mib tree */ -+ REGISTER_MIB("hr_sensor", hr_sensor_variables, variable2, -+ hr_sensor_variables_oid); -+ -+ -+ /* place any other initialization junk you need here */ -+ -+ -+ chips[0].prefix = SENSORS_CHIP_NAME_PREFIX_ANY; -+ chips[0].bus = SENSORS_CHIP_NAME_BUS_ANY; -+ chips[0].addr = SENSORS_CHIP_NAME_ADDR_ANY; -+ chips_count = 1; -+ -+ open_config_file(); -+ -+ if ((res = sensors_init_dl(config_file))) { -+ return; -+ } -+ -+ for (chip_nr = 0; (chip = sensors_get_detected_chips_dl(&chip_nr));) -+ do_register (*chip); -+} -+ -+ -+/* -+ * var_hr_sensor(): -+ * This function is called every time the agent gets a request for -+ * a scalar variable that might be found within your mib section -+ * registered above. It is up to you to do the right thing and -+ * return the correct value. -+ * You should also correct the value of "var_len" if necessary. -+ * -+ * Please see the documentation for more information about writing -+ * module extensions, and check out the examples in the examples -+ * and mibII directories. -+ */ -+unsigned char * -+var_hr_sensor(struct variable *vp, -+ oid *name, -+ size_t *length, -+ int exact, -+ size_t *var_len, -+ WriteMethod **write_method) -+{ -+ /* variables we may use later */ -+ static long long_ret; -+ static char *string = 0; -+ static oid objid[MAX_OID_LEN]; -+ static struct counter64 c64; -+ -+ const sensors_feature_data *sensor; -+ const char *map=0; -+ int index0 = 0, index1 = 0; -+ int sensor_idx = 0, sensor_num = 0; -+ sensors_chip_name chip_name; -+ double value; -+ -+ -+ if (header_simple_table(vp,name,length,exact,var_len,write_method,sensor_maxnum) -+ == MATCH_FAILED ) -+ return NULL; -+ -+ sensor_idx = name[*length - 1] - 1; -+ sensor_num = sensor_tbl[sensor_idx]; -+ chip_name = chip_tbl[sensor_idx]; -+ -+ while ((sensor = sensors_get_all_features_dl (chip_name, &index0, &index1)) -+ != NULL) { -+ if(sensor_num == sensor->number) { -+ /* -+ * this is where we do the value assignments for the mib results. -+ */ -+ switch(vp->magic) { -+ -+ -+ case HRSENSORMAPPING: -+ -+ long_ret = sensor->mapping; -+ return (unsigned char *) &long_ret; -+ -+ case HRSENSORNUMBER: -+ -+ long_ret = sensor_num; -+ return (unsigned char *) &long_ret; -+ -+ case HRSENSORNAME: -+ -+ string = malloc(SPRINT_MAX_LEN); -+ strncpy(string, sensor->name, SPRINT_MAX_LEN); -+ *var_len = strlen(string); -+ return (unsigned char *) string; -+ -+ case HRSENSORLABEL: -+ -+ string = malloc(SPRINT_MAX_LEN); -+ -+ if (sensors_get_label_dl (chip_name, sensor->number, &string)) { -+ return 0; -+ } -+ -+ *var_len = strlen(string); -+ return (unsigned char *) string; -+ -+ case HRSENSORVALUE: -+ -+ if (!(sensor->mode & SENSORS_MODE_R)) { -+ return 0; -+ } else if (!(sensor->mode & SENSORS_MODE_R)) { -+ return 0; -+ } else if (sensors_get_feature_dl (chip_name, sensor->number, &value)){ -+ return 0; -+ } -+ string = malloc(SPRINT_MAX_LEN); -+ snprintf(string, SPRINT_MAX_LEN, "%f", value); -+ *var_len = strlen(string); -+ return (unsigned char *) string; -+ -+ default: -+ ERROR_MSG(""); -+ return NULL; -+ } -+ } -+ } -+ return NULL; -+} -+ -diff -Naur net-snmp-5.1.1.old/agent/mibgroup/host/hr_sensor.h net-snmp-5.1.1/agent/mibgroup/host/hr_sensor.h ---- net-snmp-5.1.1.old/agent/mibgroup/host/hr_sensor.h 1970-01-01 02:00:00.000000000 +0200 -+++ net-snmp-5.1.1/agent/mibgroup/host/hr_sensor.h 2003-10-21 12:47:04.000000000 +0300 -@@ -0,0 +1,24 @@ -+/* This file was generated by mib2c and is intended for use as a mib module -+ for the ucd-snmp snmpd agent. */ -+ -+ -+#ifndef _MIBGROUP_HRSENSOR_H -+#define _MIBGROUP_HRSENSOR_H -+ -+ -+/* we may use header_generic and header_simple_table from the util_funcs module */ -+ -+ -+config_require(util_funcs) -+ -+ -+/* function prototypes */ -+ -+ -+extern void init_hr_sensor(void); -+extern FindVarMethod var_hr_sensor; -+ -+ -+ -+ -+#endif /* _MIBGROUP_HRSENSOR_H */ -diff -Naur net-snmp-5.1.1.old/agent/mibgroup/host.h net-snmp-5.1.1/agent/mibgroup/host.h ---- net-snmp-5.1.1.old/agent/mibgroup/host.h 2002-04-20 10:30:00.000000000 +0300 -+++ net-snmp-5.1.1/agent/mibgroup/host.h 2003-10-21 12:47:04.000000000 +0300 -@@ -15,6 +15,7 @@ - config_require(host/hr_filesys) - config_require(host/hr_swrun) - config_require(host/hr_swinst) -+ config_require(host/hr_sensor) - - /* add the host resources mib to the default mibs to load */ - config_add_mib(HOST-RESOURCES-MIB) -diff -Naur net-snmp-5.1.1.old/mibs/HOST-RESOURCES-MIB.txt net-snmp-5.1.1/mibs/HOST-RESOURCES-MIB.txt ---- net-snmp-5.1.1.old/mibs/HOST-RESOURCES-MIB.txt 2002-04-20 10:30:15.000000000 +0300 -+++ net-snmp-5.1.1/mibs/HOST-RESOURCES-MIB.txt 2003-10-21 12:47:04.000000000 +0300 -@@ -106,6 +106,7 @@ - hrSWRunPerf OBJECT IDENTIFIER ::= { host 5 } - hrSWInstalled OBJECT IDENTIFIER ::= { host 6 } - hrMIBAdminInfo OBJECT IDENTIFIER ::= { host 7 } -+hrSensor OBJECT IDENTIFIER ::= { host 8 } - - -- textual conventions - -@@ -1390,6 +1391,66 @@ - (hex)'00 00 01 01 00 00 00 00'." - ::= { hrSWInstalledEntry 5 } - -+ -+hrSensorEntry OBJECT-TYPE -+ SYNTAX hrSensorEntry -+ MAX-ACCESS not-accessible -+ STATUS current -+ DESCRIPTION -+ "The CPU temperature sensor settings." -+ INDEX { hrSensor } -+ ::= { hrSensor 1 } -+ -+hrSensorEntry ::= SEQUENCE { -+ hrSensorNumber Integer32, -+ hrSensorMapping Integer32, -+ hrSensorName DisplayString, -+ hrSensorLabel DisplayString, -+ hrSensorValue DisplayString -+ } -+ -+ -+ -+hrSensorMapping OBJECT-TYPE -+ SYNTAX Integer32 (1..2147483647) -+ MAX-ACCESS read-only -+ STATUS current -+ DESCRIPTION -+ "The mapping" -+ ::= { hrSensorEntry 1 } -+ -+hrSensorNumber OBJECT-TYPE -+ SYNTAX Integer32 (1..2147483647) -+ MAX-ACCESS read-only -+ STATUS current -+ DESCRIPTION -+ "The Number" -+ ::= { hrSensorEntry 2 } -+ -+hrSensorName OBJECT-TYPE -+ SYNTAX DisplayString -+ MAX-ACCESS read-only -+ STATUS current -+ DESCRIPTION -+ "The name of the sensor." -+ ::= { hrSensorEntry 3 } -+ -+hrSensorLabel OBJECT-TYPE -+ SYNTAX DisplayString -+ MAX-ACCESS read-only -+ STATUS current -+ DESCRIPTION -+ "The label of the sensor." -+ ::= { hrSensorEntry 4 } -+ -+hrSensorValue OBJECT-TYPE -+ SYNTAX DisplayString -+ MAX-ACCESS read-only -+ STATUS current -+ DESCRIPTION -+ "The value of the sensor" -+ ::= { hrSensorEntry 5 } -+ - -- Conformance information - - hrMIBCompliances OBJECT IDENTIFIER ::= { hrMIBAdminInfo 2 } -@@ -1456,6 +1517,13 @@ - "The Installed Software Group. - Implementation of this group is at the discretion - of the implementor." -+ -+ GROUP hrSensorGroup -+ DESCRIPTION -+ "The Sensors Group. -+ Implementation of this group is at the discretion -+ of the implementor." -+ - ::= { hrMIBCompliances 1 } - - hrSystemGroup OBJECT-GROUP -@@ -1537,4 +1605,17 @@ - "The Host Resources Installed Software Group." - ::= { hrMIBGroups 6 } - -+ hrSensorGroup OBJECT-GROUP -+ OBJECTS { -+ hrSensorEntry, -+ hrSensorNumber, -+ hrSensorMapping, -+ hrSensorName, -+ hrSensorLabel, -+ hrSensorValue -+ } -+ STATUS current -+ DESCRIPTION -+ "The Sensor Resources Group." -+ ::= { hrMIBGroups 7 } - END diff --git a/net-analyzer/net-snmp/files/net-snmp-maxreps.patch b/net-analyzer/net-snmp/files/net-snmp-maxreps.patch deleted file mode 100644 index 7d9627de..00000000 --- a/net-analyzer/net-snmp/files/net-snmp-maxreps.patch +++ /dev/null @@ -1,122 +0,0 @@ -Index: man/snmpd.conf.5.def -=================================================================== ---- man/snmpd.conf.5.def (revision 16338) -+++ man/snmpd.conf.5.def (working copy) -@@ -71,6 +71,28 @@ - .IP "leave_pidfile yes" - instructs the agent to not remove its pid file on shutdown. Equivalent to - specifying "-U" on the command line. -+.IP "maxGetbulkRepeats NUM" -+Sets the maximum number of responses allowed for a single variable in -+a getbulk request. Set to 0 to enable the default and set it to -1 to -+enable unlimited. Because memory is allocated ahead of time, sitting -+this to unlimited is not considered safe if your user population can -+not be trusted. A repeat number greater than this will be truncated -+to this value. -+.IP -+This is set by default to -1. -+.IP "maxGetbulkResponses NUM" -+Sets the maximum number of responses allowed for a getbulk request. -+This is set by default to 100. Set to 0 to enable the default and set -+it to -1 to enable unlimited. Because memory is allocated ahead of -+time, sitting this to unlimited is not considered safe if your user -+population can not be trusted. -+.IP -+In general, the total number of responses will not be allowed to -+exceed the maxGetbulkResponses number and the total number returned -+will be an integer multiple of the number of variables requested times -+the calculated number of repeats allow to fit below this number. -+.IP -+Also not that processing of maxGetbulkRepeats is handled first. - .SS SNMPv3 Configuration - SNMPv3 requires an SNMP agent to define a unique "engine ID" - in order to respond to SNMPv3 requests. -Index: include/net-snmp/agent/ds_agent.h -=================================================================== ---- include/net-snmp/agent/ds_agent.h (revision 16338) -+++ include/net-snmp/agent/ds_agent.h (working copy) -@@ -59,5 +59,7 @@ - #define NETSNMP_DS_AGENT_CACHE_TIMEOUT 10 /* default cache timeout */ - #define NETSNMP_DS_AGENT_INTERNAL_VERSION 11 /* used by internal queries */ - #define NETSNMP_DS_AGENT_INTERNAL_SECLEVEL 12 /* used by internal queries */ -+#define NETSNMP_DS_AGENT_MAX_GETBULKREPEATS 13 /* max getbulk repeats */ -+#define NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES 14 /* max getbulk respones */ - - #endif -Index: agent/agent_read_config.c -=================================================================== ---- agent/agent_read_config.c (revision 16338) -+++ agent/agent_read_config.c (working copy) -@@ -258,6 +258,12 @@ - netsnmp_ds_register_config(ASN_BOOLEAN, app, "dontLogTCPWrappersConnects", - NETSNMP_DS_APPLICATION_ID, - NETSNMP_DS_AGENT_DONT_LOG_TCPWRAPPERS_CONNECTS); -+ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkRepeats", -+ NETSNMP_DS_APPLICATION_ID, -+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS); -+ netsnmp_ds_register_config(ASN_INTEGER, app, "maxGetbulkResponses", -+ NETSNMP_DS_APPLICATION_ID, -+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES); - netsnmp_init_handler_conf(); - - #include "agent_module_dot_conf.h" -Index: agent/snmp_agent.c -=================================================================== ---- agent/snmp_agent.c (revision 16338) -+++ agent/snmp_agent.c (working copy) -@@ -2156,7 +2156,6 @@ - * getbulk prep - */ - int count = count_varbinds(asp->pdu->variables); -- - if (asp->pdu->errstat < 0) { - asp->pdu->errstat = 0; - } -@@ -2173,8 +2172,37 @@ - r = 0; - asp->bulkcache = NULL; - } else { -+ int numresponses; -+ int maxbulk = -+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID, -+ NETSNMP_DS_AGENT_MAX_GETBULKREPEATS); -+ int maxresponses = -+ netsnmp_ds_get_int(NETSNMP_DS_APPLICATION_ID, -+ NETSNMP_DS_AGENT_MAX_GETBULKRESPONSES); -+ -+ if (maxresponses == 0) -+ maxresponses = 100; /* more than reasonable default */ -+ -+ if (maxbulk == 0) -+ maxbulk = -1; -+ -+ /* limit getbulk number of repeats to a configured size */ -+ if (asp->pdu->errindex > maxbulk && maxbulk != -1) { -+ asp->pdu->errindex = maxbulk; -+ } -+ -+ numresponses = asp->pdu->errindex * r; -+ -+ /* limit getbulk number of getbulk responses to a configured size */ -+ if (maxresponses != -1 && numresponses > maxresponses) { -+ /* attempt to truncate this */ -+ asp->pdu->errindex = maxresponses/r; -+ numresponses = asp->pdu->errindex * r; -+ DEBUGMSGTL(("snmp_agent", "truncating number of getbulk repeats to %d\n", asp->pdu->errindex)); -+ } -+ - asp->bulkcache = -- (netsnmp_variable_list **) malloc(asp->pdu->errindex * r * -+ (netsnmp_variable_list **) malloc(numresponses * - sizeof(struct - varbind_list *)); - if (!asp->bulkcache) { -@@ -2184,6 +2212,8 @@ - } - DEBUGMSGTL(("snmp_agent", "GETBULK N = %d, M = %d, R = %d\n", - n, asp->pdu->errindex, r)); -+ fprintf(stderr, "GETBULK N = %d, M = %d, R = %d\n", -+ n, asp->pdu->errindex, r); - } - - /* diff --git a/net-analyzer/net-snmp/files/snmpd-5.1.conf b/net-analyzer/net-snmp/files/snmpd-5.1.conf deleted file mode 100644 index 60e8a77e..00000000 --- a/net-analyzer/net-snmp/files/snmpd-5.1.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd-5.1.conf,v 1.3 2004/07/14 23:06:06 agriffis Exp $ - -# Initial (empty) options. -SNMPD_FLAGS="" - -# Enable connection logging. -#SNMPD_FLAGS="${SNMPD_FLAGS} -a" - -# Enable syslog and disable file log. -#SNMPD_FLAGS="${SNMPD_FLAGS} -Lsd -Lf /dev/null" - -# Enable agentx socket as /var/agentx/master -# *NOTE* Before uncommenting this, make sure -# the /var/agentx directory exists. -#SNMPD_FLAGS="${SNMPD_FLAGS} -x /var/agentx/master" diff --git a/net-analyzer/net-snmp/files/snmpd-5.1.rc6 b/net-analyzer/net-snmp/files/snmpd-5.1.rc6 deleted file mode 100755 index d4cd2306..00000000 --- a/net-analyzer/net-snmp/files/snmpd-5.1.rc6 +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd-5.1.rc6,v 1.3 2004/07/14 23:06:06 agriffis Exp $ - -depend() { - use logger - need net -} - -checkconfig() { - if [ ! -e /etc/snmp/snmpd.conf ] ; then - eerror "You need an /etc/snmp/snmpd.conf config file to run snmpd" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting net-snmpd" - start-stop-daemon --start --quiet --exec /usr/sbin/snmpd \ - -- -p /var/run/snmpd.pid ${SNMPD_FLAGS} - eend $? -} - -stop() { - ebegin "Stopping net-snmpd" - start-stop-daemon --stop --quiet --pidfile /var/run/snmpd.pid - eend $? -} diff --git a/net-analyzer/net-snmp/files/snmpd.conf b/net-analyzer/net-snmp/files/snmpd.conf deleted file mode 100644 index 97a1d705..00000000 --- a/net-analyzer/net-snmp/files/snmpd.conf +++ /dev/null @@ -1,17 +0,0 @@ -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd.conf,v 1.8 2006/11/26 21:37:22 cedk Exp $ - -# Initial (empty) options. -SNMPD_FLAGS="" - -# Enable connection logging. -#SNMPD_FLAGS="${SNMPD_FLAGS} -a" - -# Enable syslog and disable file log. -#SNMPD_FLAGS="${SNMPD_FLAGS} -Lsd -Lf /dev/null" - -# Enable agentx socket as /var/agentx/master -# *NOTE* Before uncommenting this, make sure -# the /var/agentx directory exists. -#SNMPD_FLAGS="${SNMPD_FLAGS} -x /var/agentx/master" diff --git a/net-analyzer/net-snmp/files/snmpd.init b/net-analyzer/net-snmp/files/snmpd.init deleted file mode 100644 index d8419eaa..00000000 --- a/net-analyzer/net-snmp/files/snmpd.init +++ /dev/null @@ -1,47 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd.init,v 1.1 2009/10/16 08:51:05 gengor Exp $ - -opts="${opts} reload" - -depend() { - use logger - need net -} - -SNMPD_PIDFILE="${SNMPD_PIDFILE:-/var/run/snmpd.pid}" - -checkconfig() { - if [ ! -e /etc/snmp/snmpd.conf ] ; then - eerror "${SVCNAME} requires an /etc/snmp/snmpd.conf configuration file" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting ${SVCNAME}" - start-stop-daemon --start --quiet --exec /usr/sbin/snmpd \ - -- -p ${SNMPD_PIDFILE} ${SNMPD_FLAGS} - eend $? -} - -stop() { - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --quiet --pidfile ${SNMPD_PIDFILE} - eend $? -} - -reload() { - checkconfig || return 1 - if [ ! -f ${SNMPD_PIDFILE} ]; then - eerror "Cannot reload configuration, ${SVCNAME} is not running" - eend 1 - return 1 - fi - - ebegin "Reloading ${SVCNAME} configuration" - kill -HUP $(< ${SNMPD_PIDFILE}) &>/dev/null - eend $? -} diff --git a/net-analyzer/net-snmp/files/snmpd.rc7 b/net-analyzer/net-snmp/files/snmpd.rc7 deleted file mode 100644 index 11329bd7..00000000 --- a/net-analyzer/net-snmp/files/snmpd.rc7 +++ /dev/null @@ -1,30 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmpd.rc7,v 1.1 2006/11/26 21:37:22 cedk Exp $ - -depend() { - use logger - need net -} - -checkconfig() { - if [ ! -e /etc/snmp/snmpd.conf ] ; then - eerror "You need an /etc/snmp/snmpd.conf config file to run snmpd" - return 1 - fi -} - -start() { - checkconfig || return 1 - ebegin "Starting net-snmpd" - start-stop-daemon --start --quiet --exec /usr/sbin/snmpd \ - -- -p /var/run/snmpd.pid ${SNMPD_FLAGS} - eend $? -} - -stop() { - ebegin "Stopping net-snmpd" - start-stop-daemon --stop --quiet --pidfile /var/run/snmpd.pid - eend $? -} diff --git a/net-analyzer/net-snmp/files/snmptrapd.conf b/net-analyzer/net-snmp/files/snmptrapd.conf deleted file mode 100644 index b6259fcf..00000000 --- a/net-analyzer/net-snmp/files/snmptrapd.conf +++ /dev/null @@ -1,16 +0,0 @@ -# Copyright 1999-2005 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmptrapd.conf,v 1.1 2005/01/28 11:19:25 ka0ttic Exp $ - -# extra flags to pass to snmptrapd -SNMPTRAPD_FLAGS="" - -# ignore authentication failure traps -#SNMPTRAPD_FLAGS="${SNMPTRAPD_FLAGS} -a" - -# log messages to specified file -#SNMPTRAPD_FLAGS="${SNMPTRAPD_FLAGS} -Lf /var/log/snmptrapd.log" - -# log messages to syslog with the specified facility -# where facility is: 'd' = LOG_DAEMON, 'u' = LOG_USER, [0-7] = LOG_LOCAL[0-7] -#SNMPTRAPD_FLAGS="${SNMPTRAPD_FLAGS} -Ls d" diff --git a/net-analyzer/net-snmp/files/snmptrapd.init b/net-analyzer/net-snmp/files/snmptrapd.init deleted file mode 100644 index 7a311f95..00000000 --- a/net-analyzer/net-snmp/files/snmptrapd.init +++ /dev/null @@ -1,24 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2009 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmptrapd.init,v 1.1 2009/10/16 08:51:05 gengor Exp $ - -depend() { - use logger - need net -} - -SNMPTRAPD_PIDFILE="${SNMPTRAPD_PIDFILE:-/var/run/snmptrapd.pid}" - -start() { - ebegin "Starting ${SVCNAME}" - start-stop-daemon --start --quiet --exec /usr/sbin/snmptrapd \ - -- -p ${SNMPTRAPD_PIDFILE} ${SNMPTRAPD_FLAGS} - eend $? -} - -stop() { - ebegin "Stopping ${SVCNAME}" - start-stop-daemon --stop --quiet --pidfile ${SNMPTRAPD_PIDFILE} - eend $? -} diff --git a/net-analyzer/net-snmp/files/snmptrapd.rc7 b/net-analyzer/net-snmp/files/snmptrapd.rc7 deleted file mode 100644 index 585675b4..00000000 --- a/net-analyzer/net-snmp/files/snmptrapd.rc7 +++ /dev/null @@ -1,22 +0,0 @@ -#!/sbin/runscript -# Copyright 1999-2004 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/files/snmptrapd.rc7,v 1.1 2006/11/26 21:37:22 cedk Exp $ - -depend() { - use logger - need net -} - -start() { - ebegin "Starting snmptrapd" - start-stop-daemon --start --quiet --exec /usr/sbin/snmptrapd \ - -- -p /var/run/snmptrapd.pid ${SNMPTRAPD_FLAGS} - eend $? -} - -stop() { - ebegin "Stopping snmptrapd" - start-stop-daemon --stop --quiet --pidfile /var/run/snmptrapd.pid - eend $? -} diff --git a/net-analyzer/net-snmp/net-snmp-5.4.2.1-r4.ebuild b/net-analyzer/net-snmp/net-snmp-5.4.2.1-r4.ebuild deleted file mode 100644 index 24666681..00000000 --- a/net-analyzer/net-snmp/net-snmp-5.4.2.1-r4.ebuild +++ /dev/null @@ -1,219 +0,0 @@ -# Copyright 1999-2011 Gentoo Foundation -# Distributed under the terms of the GNU General Public License v2 -# $Header: /var/cvsroot/gentoo-x86/net-analyzer/net-snmp/net-snmp-5.4.2.1-r4.ebuild,v 1.13 2011/03/01 20:02:12 arfrever Exp $ - -EAPI="3" -PYTHON_DEPEND="python? 2" - -inherit fixheadtails flag-o-matic perl-module python autotools prefix - -DESCRIPTION="Software for generating and retrieving SNMP data" -HOMEPAGE="http://net-snmp.sourceforge.net/" -SRC_URI="mirror://sourceforge/${PN}/${P}.tar.gz" - -LICENSE="as-is BSD" -SLOT="0" -KEYWORDS="alpha amd64 arm hppa ia64 ~mips ppc ppc64 s390 sh sparc x86" -IUSE="bzip2 diskio doc elf extensible ipv6 kernel_linux lm_sensors mfd-rewrites minimal perl python rpm selinux sendmail smux ssl tcpd X zlib" - -COMMON="ssl? ( >=dev-libs/openssl-0.9.6d ) - tcpd? ( >=sys-apps/tcp-wrappers-7.6 ) - rpm? ( - app-arch/rpm - dev-libs/popt - app-arch/bzip2 - >=sys-libs/zlib-1.1.4 - ) - bzip2? ( app-arch/bzip2 ) - zlib? ( >=sys-libs/zlib-1.1.4 ) - elf? ( dev-libs/elfutils ) - lm_sensors? ( - kernel_linux? ( sys-apps/lm_sensors ) - ) - python? ( dev-python/setuptools )" - -RDEPEND="${COMMON} - perl? ( - X? ( dev-perl/perl-tk ) - !minimal? ( dev-perl/TermReadKey ) - ) - selinux? ( sec-policy/selinux-snmpd )" - -# Dependency on autoconf due to bug #225893 -DEPEND="${COMMON} - >=sys-devel/autoconf-2.61-r2 - >=sys-apps/sed-4 - doc? ( app-doc/doxygen )" - -pkg_setup() { - if use python; then - python_set_active_version 2 - python_pkg_setup - fi -} - -src_prepare() { - # Fix CVE-2008-6123 - epatch "${FILESDIR}"/CVE-2008-6123.patch - - # lm_sensors-3 support - if use lm_sensors ; then - epatch "${FILESDIR}"/${PN}-5.4.1-sensors3.patch \ - "${FILESDIR}"/${PN}-5.4.1-sensors3-version_detect.patch - fi - - # fix access violation in make check - sed -i -e 's/\(snmpd.*\)-Lf/\1-l/' testing/eval_tools.sh || \ - die "sed eval_tools.sh failed" - # fix path in fixproc - sed -i -e 's|\(database_file =.*\)/local\(.*\)$|\1\2|' local/fixproc || \ - die "sed fixproc failed" - - if use python ; then - PYTHON_DIR="$(python_get_sitedir)" - sed -i -e "s:\(install --basedir=\$\$dir\):\1 --root='${D}':" Makefile.in || \ - die "sed python failed" - fi - - # snmpconf generates config files with proper selinux context - use selinux && epatch "${FILESDIR}"/${PN}-5.1.2-snmpconf-selinux.patch - - # remove CFLAGS from net-snmp-config script (bug #257622): - sed -i -e 's|@CFLAGS@||g' -e 's|@LDFLAGS@||g' \ - net-snmp-config.in || die "sedding CFLAGS/LDFLAGS failed" - - eprefixify net-snmp-config.in - - # Fix version number: - sed -i -e "s:NetSnmpVersionInfo = \".*\":NetSnmpVersionInfo = \"${PV}\":" \ - snmplib/snmp_version.c || die "sedding version failed" - - # Fix toolchain quadruplet detection, bug #330353 - epatch "${FILESDIR}/${P}-perlcc-hppa.patch" - - eautoreconf - - ht_fix_all -} - -src_configure() { - strip-flags - - local mibs="host ucd-snmp/dlmod" - use diskio && mibs="${mibs} ucd-snmp/diskio" - use extensible && mibs="${mibs} ucd-snmp/extensible" - use lm_sensors && mibs="${mibs} ucd-snmp/lmsensorsMib" - use sendmail && mibs="${mibs} mibII/mta_sendmail" - use smux && mibs="${mibs} smux" - - local myconf="$(use_enable ipv6) \ - $(use_enable mfd-rewrites) \ - $(use_enable perl embedded-perl) \ - $(use_enable !ssl internal-md5) \ - $(use_with elf) \ - $(use_with perl perl-modules) \ - $(use_with python python-modules) \ - $(use_with ssl openssl) \ - $(use_with tcpd libwrap)" - if use rpm ; then - myconf="${myconf} \ - --with-rpm \ - --with-bzip2 \ - --with-zlib" - else - myconf="${myconf} \ - --without-rpm \ - $(use_with bzip2) \ - $(use_with zlib)" - fi - - econf \ - --with-install-prefix="${D}" \ - --with-sys-location="Unknown" \ - --with-sys-contact="root@Unknown" \ - --with-default-snmp-version="3" \ - --with-mib-modules="${mibs}" \ - --with-logfile="/var/log/net-snmpd.log" \ - --with-persistent-directory="/var/lib/net-snmp" \ - --enable-ucd-snmp-compatibility \ - --enable-shared \ - --enable-as-needed \ - ${myconf} -} - -src_compile() { - emake -j1 || die "emake failed" - - if use doc ; then - einfo "Building HTML Documentation" - make docsdox || die "failed to build docs" - fi -} - -src_test() { - cd testing - if ! make test ; then - echo - einfo "Don't be alarmed if a few tests FAIL." - einfo "This could happen for several reasons:" - einfo " - You don't already have a working configuration." - einfo " - Your ethernet interface isn't properly configured." - echo - fi -} - -src_install () { - # bug #317965 - emake -j1 DESTDIR="${D}" install || die "make install failed" - - if use perl ; then - fixlocalpod - use X || rm -f "${D}"/usr/bin/tkmib - else - rm -f "${D}"/usr/bin/mib2c "${D}"/usr/bin/snmpcheck "${D}"/usr/bin/tkmib - fi - - dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO || die - newdoc EXAMPLE.conf.def EXAMPLE.conf || die - - use doc && { dohtml docs/html/* || die ; } - - keepdir /etc/snmp /var/lib/net-snmp - - newinitd "${FILESDIR}"/snmpd.init snmpd || die - newconfd "${FILESDIR}"/snmpd.conf snmpd || die - - newinitd "${FILESDIR}"/snmptrapd.init snmptrapd || die - newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd || die - - # Remove everything not required for an agent. - # Keep only the snmpd, snmptrapd, MIBs, headers and libraries. - if use minimal; then - elog "USE='minimal' is set. Removing excess/non-minimal components." - rm -rf - "${D}"/usr/bin/{encode_keychange,snmp{get,getnext,set,usm,walk,bulkwalk,table,trap,bulkget,translate,status,delta,test,df,vacm,netstat,inform,snmpcheck}} - rm -rf "${D}"/usr/share/snmp/snmpconf-data "${D}"/usr/share/snmp/*.conf - rm -rf "${D}"/usr/bin/{fixproc,traptoemail} "${D}"/usr/bin/snmpc{heck,onf} - find "${D}" -name '*.pl' -exec rm -f '{}' \; - use ipv6 || rm -rf "${D}"/usr/share/snmp/mibs/IPV6* - fi - - # bug 113788, install example config - insinto /etc/snmp - newins "${S}"/EXAMPLE.conf snmpd.conf.example || die -} - -pkg_postinst() { - if use python; then - python_mod_optimize netsnmp - fi - - elog "An example configuration file has been installed in" - elog "/etc/snmp/snmpd.conf.example." -} - -pkg_postrm() { - if use python; then - python_mod_cleanup netsnmp - fi -} |