diff options
author | Bertrand Jacquin <beber@meleeweb.net> | 2008-06-02 23:50:22 +0200 |
---|---|---|
committer | Bertrand Jacquin <beber@meleeweb.net> | 2008-06-02 23:50:22 +0200 |
commit | ef397c1afa8c946355291861fb497eba99b8712c (patch) | |
tree | 41995801f7d5b55c5cee1723dc6fb894fadfd890 /net-analyzer/net-snmp | |
parent | lighttpd: update (diff) | |
download | portage-ef397c1afa8c946355291861fb497eba99b8712c.tar.xz |
snmp & net-tools: perso release
Diffstat (limited to 'net-analyzer/net-snmp')
20 files changed, 2015 insertions, 0 deletions
diff --git a/net-analyzer/net-snmp/Manifest b/net-analyzer/net-snmp/Manifest new file mode 100644 index 00000000..11059e06 --- /dev/null +++ b/net-analyzer/net-snmp/Manifest @@ -0,0 +1,80 @@ +AUX multi-tun-segv.patch 7231 RMD160 d02666572b7691d9e279f2586820992b8394a2ef SHA1 c250eebb22385be994d9e7b67fbb67a0dec295ce SHA256 929cc61484fbf69134273acc3416f2644251d9a490850c901d8746b1d2f7c47a +MD5 c6eb08e45ad70e529aa3383f5d73156a files/multi-tun-segv.patch 7231 +RMD160 d02666572b7691d9e279f2586820992b8394a2ef files/multi-tun-segv.patch 7231 +SHA256 929cc61484fbf69134273acc3416f2644251d9a490850c901d8746b1d2f7c47a files/multi-tun-segv.patch 7231 +AUX net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 RMD160 904d195cafa4334f9d8116a3d13eff4181e06d3b SHA1 0101a446e217a95f621e634544b19490fa01c072 SHA256 893180ba84ef69381d270286f042852a200c35b7792f55fe23920a0bcb1d8fb9 +MD5 82d14deda5805e21a60de03e0a69659c files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 +RMD160 904d195cafa4334f9d8116a3d13eff4181e06d3b files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 +SHA256 893180ba84ef69381d270286f042852a200c35b7792f55fe23920a0bcb1d8fb9 files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch 4734 +AUX net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 RMD160 c11898fcfe7964f2263c64a164b5010741be3e8b SHA1 670a0d4c5de33d79fc026cb4190f8c7f55ac9d10 SHA256 0304fe236b335eab2a42c9009e66310c03c82b9ead9886d6f558fc245f83581c +MD5 bce531dc2d093d0659e02707c28a7b95 files/net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 +RMD160 c11898fcfe7964f2263c64a164b5010741be3e8b files/net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 +SHA256 0304fe236b335eab2a42c9009e66310c03c82b9ead9886d6f558fc245f83581c files/net-snmp-5.2.1-fix-64bit-interface-counters.diff 1195 +AUX net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 RMD160 05b1099c32c2091e9606f167288a21503510cc20 SHA1 278b48283e536bc76935865ec227c402019e7df6 SHA256 100f18794f11c0d0fe43e9f50cec755158906268b4c2b560f45f8d7ff797422e +MD5 a63107c1d81a8aeb10e84be0658e2794 files/net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 +RMD160 05b1099c32c2091e9606f167288a21503510cc20 files/net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 +SHA256 100f18794f11c0d0fe43e9f50cec755158906268b4c2b560f45f8d7ff797422e files/net-snmp-5.2.1-fix-insecure-fixproc.diff 1639 +AUX net-snmp-5.2.2-asneeded.patch 3014 RMD160 4394ac08e2ab0a4c57036b61b554e1bdc7c29ff2 SHA1 9c2f1e4ac9ffab8f604740b47dce9914dd0200f6 SHA256 2caa3beb56a0087e1800d875988ceaf11da0ba1eb5121804f2827d4b53a682b7 +MD5 55644512ad20558e95bedce0d6476278 files/net-snmp-5.2.2-asneeded.patch 3014 +RMD160 4394ac08e2ab0a4c57036b61b554e1bdc7c29ff2 files/net-snmp-5.2.2-asneeded.patch 3014 +SHA256 2caa3beb56a0087e1800d875988ceaf11da0ba1eb5121804f2827d4b53a682b7 files/net-snmp-5.2.2-asneeded.patch 3014 +AUX net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 RMD160 3b716cac3df53db19b2c4eb295a5fb8045f96125 SHA1 e23506ea9f27e82d796e5896158632cb93f0f8ac SHA256 7186744012f9afe8834366c96784d9088fd6f0c306c0fc65eb0e8bbdc8cdf338 +MD5 ca3a2ba5a12a796d29087038828f2c21 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 +RMD160 3b716cac3df53db19b2c4eb295a5fb8045f96125 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 +SHA256 7186744012f9afe8834366c96784d9088fd6f0c306c0fc65eb0e8bbdc8cdf338 files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch 4815 +AUX net-snmp-5.3.1-retrans-time.patch 3240 RMD160 54e63d1cc4fe9791d0889480f57cf5f651fa9a60 SHA1 8ca179d5620a1a0b38f45c04d3f790099a426828 SHA256 4ccd692d796833fba418af6653cbc33f7d24c04f6093d5e504d5c6c18cff1f6b +MD5 5a9189510527a178f92b3b9751d20b6c files/net-snmp-5.3.1-retrans-time.patch 3240 +RMD160 54e63d1cc4fe9791d0889480f57cf5f651fa9a60 files/net-snmp-5.3.1-retrans-time.patch 3240 +SHA256 4ccd692d796833fba418af6653cbc33f7d24c04f6093d5e504d5c6c18cff1f6b files/net-snmp-5.3.1-retrans-time.patch 3240 +AUX net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 RMD160 4c2d25a50375f950642a49d79678532f89b36ede SHA1 adea9cce4b81e1d66757194257e9d8d489c32d96 SHA256 a806f3208729c5b3f8946d4bdf3e97c3540e99adf91b363b308adcc96b6c051b +MD5 3f888bb1a96a76d1a54af4f0a50fceff files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 +RMD160 4c2d25a50375f950642a49d79678532f89b36ede files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 +SHA256 a806f3208729c5b3f8946d4bdf3e97c3540e99adf91b363b308adcc96b6c051b files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch 9037 +AUX net-snmp-5.4-makefile.patch 597 RMD160 90f8e6db0a05fd21c06e98b65b4bbd377f931fe9 SHA1 2ff51b2ab2df2224dd34ca1af16430fbf0b97927 SHA256 fd8c6ceda9c5d99cd92f81a7977d2134960ee14fac3ab9f1f8c6d03c6a69edb1 +MD5 d61d49e044489f4b4549cda0b7cbc336 files/net-snmp-5.4-makefile.patch 597 +RMD160 90f8e6db0a05fd21c06e98b65b4bbd377f931fe9 files/net-snmp-5.4-makefile.patch 597 +SHA256 fd8c6ceda9c5d99cd92f81a7977d2134960ee14fac3ab9f1f8c6d03c6a69edb1 files/net-snmp-5.4-makefile.patch 597 +AUX net-snmp-5.4.1-clientaddr-fix.patch 2942 RMD160 02893663d464cce39f6b54c3e27776d27fe5fe67 SHA1 fee0d795797f73de463aceaad13ebc24311763b9 SHA256 355b5661d1ecc066a8094969269b8af35e63e406a32547d6b0f8c3c57b1a4685 +MD5 68ccb8d180ff38847ed5e8d2561cbaee files/net-snmp-5.4.1-clientaddr-fix.patch 2942 +RMD160 02893663d464cce39f6b54c3e27776d27fe5fe67 files/net-snmp-5.4.1-clientaddr-fix.patch 2942 +SHA256 355b5661d1ecc066a8094969269b8af35e63e406a32547d6b0f8c3c57b1a4685 files/net-snmp-5.4.1-clientaddr-fix.patch 2942 +AUX net-snmp-lm_sensors.patch 13686 RMD160 b2e67c6f5a5347442fbaa97c9ce209f1d9bed194 SHA1 3e795339fc93306a4d662feeaa16faca2509a058 SHA256 51dc2363a687d9f4e65b0a59e767b33129d07623a0b4da07b685e406d2576b86 +MD5 25d92c9a7adcbb80240a914a8f6bbfe5 files/net-snmp-lm_sensors.patch 13686 +RMD160 b2e67c6f5a5347442fbaa97c9ce209f1d9bed194 files/net-snmp-lm_sensors.patch 13686 +SHA256 51dc2363a687d9f4e65b0a59e767b33129d07623a0b4da07b685e406d2576b86 files/net-snmp-lm_sensors.patch 13686 +AUX net-snmp-maxreps.patch 5495 RMD160 a1a958f292f780f5c4f8ec66a4ec350f261d3214 SHA1 2ed58bb7c1136452532909154a1cb2c2f322467d SHA256 5e37133da687d84cb06eea7899e1be23d9613be1d24f43e8e8555577f3d47da7 +MD5 d12c1aa77ee79717e2dba9ecc058f67c files/net-snmp-maxreps.patch 5495 +RMD160 a1a958f292f780f5c4f8ec66a4ec350f261d3214 files/net-snmp-maxreps.patch 5495 +SHA256 5e37133da687d84cb06eea7899e1be23d9613be1d24f43e8e8555577f3d47da7 files/net-snmp-maxreps.patch 5495 +AUX snmpd-5.1.conf 606 RMD160 a243da5c9dfde4a5cfb16bd7d4491cedb7879620 SHA1 5c7c45a434cb566cfec678050384f9ab6af912a9 SHA256 f569766eb6ca203a0c9549b2592d6f36ae4999cfaabc423cad5a864201a86ac9 +MD5 ed2e953a9a923caec45eeca95bec2efc files/snmpd-5.1.conf 606 +RMD160 a243da5c9dfde4a5cfb16bd7d4491cedb7879620 files/snmpd-5.1.conf 606 +SHA256 f569766eb6ca203a0c9549b2592d6f36ae4999cfaabc423cad5a864201a86ac9 files/snmpd-5.1.conf 606 +AUX snmpd-5.1.rc6 714 RMD160 1f7cef43888500044be0b0d4938574922b48bcfd SHA1 7468069b6e12b527f5a6a8026b67125f3545d243 SHA256 8f02a26a794a5c37e4cb4092ab61f82a6d7ec5876146738d4630ed147cc9ccf6 +MD5 0dbde7b1bdd9c9dc988039e676800337 files/snmpd-5.1.rc6 714 +RMD160 1f7cef43888500044be0b0d4938574922b48bcfd files/snmpd-5.1.rc6 714 +SHA256 8f02a26a794a5c37e4cb4092ab61f82a6d7ec5876146738d4630ed147cc9ccf6 files/snmpd-5.1.rc6 714 +AUX snmpd.conf 598 RMD160 c72a20fe6d4682ceea533587762782d62906b630 SHA1 51ebdca93c68ca04b7f402fad4f504422ec2c6cf SHA256 1f4f07b831c3227588fd546423137ed5c60a602fbee13b0d66edd801e4e7d598 +MD5 cc6b95963357eab99f7f2d55398d5acb files/snmpd.conf 598 +RMD160 c72a20fe6d4682ceea533587762782d62906b630 files/snmpd.conf 598 +SHA256 1f4f07b831c3227588fd546423137ed5c60a602fbee13b0d66edd801e4e7d598 files/snmpd.conf 598 +AUX snmpd.rc7 706 RMD160 137d85e5f2b7cae62e214141aabcec495777007e SHA1 8d94d3bb2d3b43e20604030dc585c735685cf99b SHA256 93337ebeac92ec0073c896db0a4384beebf84ee17365bdc2594285fd33ac7dfe +MD5 7f66808dbbe407d788d9bd9676f5d07a files/snmpd.rc7 706 +RMD160 137d85e5f2b7cae62e214141aabcec495777007e files/snmpd.rc7 706 +SHA256 93337ebeac92ec0073c896db0a4384beebf84ee17365bdc2594285fd33ac7dfe files/snmpd.rc7 706 +AUX snmptrapd.conf 635 RMD160 aba7b7196835bd359174156a527e13188f76e248 SHA1 0d296caa01c789455c3cd4c67cd81aca5547681d SHA256 902d73cb44446df060bf20e0c8ef0f8815d5b846f96d93894913d3309a3841b3 +MD5 791cd8d81154f2c1d01e3f87b86faa44 files/snmptrapd.conf 635 +RMD160 aba7b7196835bd359174156a527e13188f76e248 files/snmptrapd.conf 635 +SHA256 902d73cb44446df060bf20e0c8ef0f8815d5b846f96d93894913d3309a3841b3 files/snmptrapd.conf 635 +AUX snmptrapd.rc7 557 RMD160 e67117fbcb0a6f8668cb1abbc8fcfcb548ebfdb5 SHA1 dcaac6c0f9e086e49f653f100e0c3f9a7f65db1d SHA256 3594345cdf3c9a5a04073ec11a54e4a19881b27288cdbf22874cca5d0a0f624c +MD5 f12dedff94a6a3359f76a012fad7ec79 files/snmptrapd.rc7 557 +RMD160 e67117fbcb0a6f8668cb1abbc8fcfcb548ebfdb5 files/snmptrapd.rc7 557 +SHA256 3594345cdf3c9a5a04073ec11a54e4a19881b27288cdbf22874cca5d0a0f624c files/snmptrapd.rc7 557 +DIST net-snmp-5.4.1.tar.gz 5122455 RMD160 3723488dab8d164702a7d55c9c72eeaec07dd50c SHA1 ac5ba033c10d53d3057415121f8c4936c643c208 SHA256 0ea976722c993c87dede8eb6348e6feb059e3851bbef2de824bf18ac97cdb565 +EBUILD net-snmp-5.4.1-r1.ebuild 5715 RMD160 e4c073bcbcea5977fbd9789498ce956851cb50b6 SHA1 44c350833b0dd7d0ec586f40dfd46fb930a4f2da SHA256 687b4c47bf4e5e37fa284e7a1aa9f3cf7a057b61e152098aa39bd9a348a273e5 +MD5 8fc95b29e4983db685bc640d98c5d400 net-snmp-5.4.1-r1.ebuild 5715 +RMD160 e4c073bcbcea5977fbd9789498ce956851cb50b6 net-snmp-5.4.1-r1.ebuild 5715 +SHA256 687b4c47bf4e5e37fa284e7a1aa9f3cf7a057b61e152098aa39bd9a348a273e5 net-snmp-5.4.1-r1.ebuild 5715 +MD5 2e34b0d7a577176cbcf6ef8d902718fb files/digest-net-snmp-5.4.1-r1 247 +RMD160 eea7a4c51416de3c43bcf3c2404be5affd3f6118 files/digest-net-snmp-5.4.1-r1 247 +SHA256 2f2084a65a62043ef1cb434c7ed0717ed22310fa0bd3225946c19b7fb6864ecb files/digest-net-snmp-5.4.1-r1 247 diff --git a/net-analyzer/net-snmp/files/multi-tun-segv.patch b/net-analyzer/net-snmp/files/multi-tun-segv.patch new file mode 100644 index 00000000..e47f5b79 --- /dev/null +++ b/net-analyzer/net-snmp/files/multi-tun-segv.patch @@ -0,0 +1,153 @@ +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.2.1-conf-elf-rpm-bz2.patch b/net-analyzer/net-snmp/files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch new file mode 100644 index 00000000..9ba30336 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.2.1-conf-elf-rpm-bz2.patch @@ -0,0 +1,147 @@ +--- 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 new file mode 100644 index 00000000..18515d44 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-64bit-interface-counters.diff @@ -0,0 +1,29 @@ +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 new file mode 100644 index 00000000..cad67929 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.2.1-fix-insecure-fixproc.diff @@ -0,0 +1,52 @@ +--- 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 new file mode 100644 index 00000000..12af501d --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.2.2-asneeded.patch @@ -0,0 +1,70 @@ +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 new file mode 100644 index 00000000..362fcbcc --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.2.2-conf-elf-rpm-bz2.patch @@ -0,0 +1,144 @@ +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 new file mode 100644 index 00000000..45eb35cf --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.3.1-retrans-time.patch @@ -0,0 +1,93 @@ +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 new file mode 100644 index 00000000..389cd2bf --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.3.1-tcp-udp-mib-byteorder.patch @@ -0,0 +1,233 @@ +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-makefile.patch b/net-analyzer/net-snmp/files/net-snmp-5.4-makefile.patch new file mode 100644 index 00000000..7b7ba127 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4-makefile.patch @@ -0,0 +1,20 @@ +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-clientaddr-fix.patch b/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch new file mode 100644 index 00000000..116e524f --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-5.4.1-clientaddr-fix.patch @@ -0,0 +1,63 @@ +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-lm_sensors.patch b/net-analyzer/net-snmp/files/net-snmp-lm_sensors.patch new file mode 100644 index 00000000..29ba1ea8 --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-lm_sensors.patch @@ -0,0 +1,475 @@ +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 new file mode 100755 index 00000000..7d9627de --- /dev/null +++ b/net-analyzer/net-snmp/files/net-snmp-maxreps.patch @@ -0,0 +1,122 @@ +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 new file mode 100644 index 00000000..60e8a77e --- /dev/null +++ b/net-analyzer/net-snmp/files/snmpd-5.1.conf @@ -0,0 +1,17 @@ +# 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 new file mode 100755 index 00000000..d4cd2306 --- /dev/null +++ b/net-analyzer/net-snmp/files/snmpd-5.1.rc6 @@ -0,0 +1,30 @@ +#!/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 new file mode 100644 index 00000000..97a1d705 --- /dev/null +++ b/net-analyzer/net-snmp/files/snmpd.conf @@ -0,0 +1,17 @@ +# 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.rc7 b/net-analyzer/net-snmp/files/snmpd.rc7 new file mode 100644 index 00000000..11329bd7 --- /dev/null +++ b/net-analyzer/net-snmp/files/snmpd.rc7 @@ -0,0 +1,30 @@ +#!/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 new file mode 100644 index 00000000..b6259fcf --- /dev/null +++ b/net-analyzer/net-snmp/files/snmptrapd.conf @@ -0,0 +1,16 @@ +# 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.rc7 b/net-analyzer/net-snmp/files/snmptrapd.rc7 new file mode 100644 index 00000000..585675b4 --- /dev/null +++ b/net-analyzer/net-snmp/files/snmptrapd.rc7 @@ -0,0 +1,22 @@ +#!/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.1-r1.ebuild b/net-analyzer/net-snmp/net-snmp-5.4.1-r1.ebuild new file mode 100644 index 00000000..8b190b40 --- /dev/null +++ b/net-analyzer/net-snmp/net-snmp-5.4.1-r1.ebuild @@ -0,0 +1,202 @@ +# Copyright 1999-2007 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.1-r1.ebuild,v 1.9 2007/11/19 06:16:52 kumba Exp $ + +inherit fixheadtails flag-o-matic perl-module python + +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="diskio doc elf ipv6 lm_sensors mfd-rewrites minimal perl python rpm selinux smux ssl tcpd X sendmail" + +DEPEND="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 + ) + elf? ( dev-libs/elfutils ) + lm_sensors? ( sys-apps/lm_sensors ) + python? ( dev-python/setuptools )" + +RDEPEND="${DEPEND} + perl? ( + X? ( dev-perl/perl-tk ) + !minimal? ( dev-perl/TermReadKey ) + ) + selinux? ( sec-policy/selinux-snmpd )" + +DEPEND="${DEPEND} + >=sys-apps/sed-4 + doc? ( app-doc/doxygen )" + +src_unpack() { + unpack ${A} + cd "${S}" + +# The lm_sensors patch has a memory leak +# If you can help, please attach a patch to bug 109785 + +# if use lm_sensors; then +# if use x86 || use amd64; then +# epatch "${FILESDIR}"/${PN}-lm_sensors.patch +# else +# eerror "Unfortunatly you are trying to enable lm_sensors support for an unsupported arch." +# eerror "please check the availability of sys-apps/lm_sensors - if it is available on" +# eerror "your arch, please file a bug about this." +# die "lm_sensors patch error: unsupported arch." +# fi +# 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_version + PYTHON_MODNAME="netsnmp" + PYTHON_DIR=/usr/$(get_libdir)/python${PYVER}/site-packages + sed -i -e "s:\(install --basedir=\$\$dir\):\1 --root='${D}':" Makefile.in || die "sed python failed" + fi + + # Fix usage of clientaddr + EPATCH_OPTS="-p1" epatch "${FILESDIR}"/${PN}-5.4.1-clientaddr-fix.patch + + epatch "${FILESDIR}/multi-tun-segv.patch" + + ht_fix_all +} + +src_compile() { + local mibs + + strip-flags + + # filter for bug #145960 + # as it seems that the option is not enough + filter-ldflags -Wl,--as-needed + + mibs="host ucd-snmp/dlmod" + use smux && mibs="${mibs} smux" + use sendmail && mibs="${mibs} mibII/mta_sendmail" + use lm_sensors && mibs="${mibs} ucd-snmp/lmSensors" + use diskio && mibs="${mibs} ucd-snmp/diskio" + + 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 \ + $(use_enable mfd-rewrites) \ + $(use_enable perl embedded-perl) \ + $(use_enable ipv6) \ + $(use_enable !ssl internal-md5) \ + $(use_with ssl openssl) \ + $(use_with tcpd libwrap) \ + $(use_with rpm) \ + $(use_with rpm bzip2) \ + $(use_with rpm zlib) \ + $(use_with elf) \ + $(use_with python python-modules) \ + || die "econf failed" + + emake -j1 || die "emake failed" + + if use perl ; then + emake perlmodules || die "compile perl modules problem" + fi + + if use python ; then + emake pythonmodules || die "compile python modules problem" + fi + + 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 () { + + make DESTDIR="${D}" install || die "make install failed" + + if use perl ; then + make DESTDIR="${D}" perlinstall || die "make perlinstall failed" + fixlocalpod + + use X || rm -f "${D}/usr/bin/tkmib" + else + rm -f "${D}/usr/bin/mib2c" "${D}/usr/bin/tkmib" "${D}/usr/bin/snmpcheck" + fi + + if use python ; then + mkdir -p "${D}/${PYTHON_DIR}" || die "Couldn't make $PYTHON_DIR" + make pythoninstall || die "make pythoninstall failed" + fi + + dodoc AGENT.txt ChangeLog FAQ INSTALL NEWS PORTING README* TODO + newdoc EXAMPLE.conf.def EXAMPLE.conf + + use doc && dohtml docs/html/* + + keepdir /etc/snmp /var/lib/net-snmp + + newinitd "${FILESDIR}"/snmpd.rc7 snmpd + newconfd "${FILESDIR}"/snmpd.conf snmpd + + newinitd "${FILESDIR}"/snmptrapd.rc7 snmptrapd + newconfd "${FILESDIR}"/snmptrapd.conf snmptrapd + + # Remove everything, keeping only the snmpd, snmptrapd, MIBs, libs, and includes. + if use minimal; then + elog "USE=minimal is set. Cleaning up excess cruft for a embedded/minimal/server only install." + 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 +} + +pkg_postrm() { + if use python ; then + python_mod_cleanup + fi +} + +pkg_postinst() { + elog "An example configuration file has been installed in" + elog "/etc/snmp/snmpd.conf.example." +} |