head 1.3; access; symbols pkgsrc-2013Q2:1.3.0.2 pkgsrc-2013Q2-base:1.3 pkgsrc-2012Q4:1.2.0.18 pkgsrc-2012Q4-base:1.2 pkgsrc-2012Q3:1.2.0.16 pkgsrc-2012Q3-base:1.2 pkgsrc-2012Q2:1.2.0.14 pkgsrc-2012Q2-base:1.2 pkgsrc-2012Q1:1.2.0.12 pkgsrc-2012Q1-base:1.2 pkgsrc-2011Q4:1.2.0.10 pkgsrc-2011Q4-base:1.2 pkgsrc-2011Q3:1.2.0.8 pkgsrc-2011Q3-base:1.2 pkgsrc-2011Q2:1.2.0.6 pkgsrc-2011Q2-base:1.2 pkgsrc-2011Q1:1.2.0.4 pkgsrc-2011Q1-base:1.2 pkgsrc-2010Q4:1.2.0.2 pkgsrc-2010Q4-base:1.2 pkgsrc-2010Q3:1.1.0.4 pkgsrc-2010Q3-base:1.1 pkgsrc-2010Q2:1.1.0.2 pkgsrc-2010Q2-base:1.1; locks; strict; comment @# @; 1.3 date 2013.03.17.00.15.29; author gdt; state dead; branches; next 1.2; 1.2 date 2010.11.17.00.59.06; author taca; state Exp; branches; next 1.1; 1.1 date 2010.05.11.04.39.54; author adam; state Exp; branches 1.1.4.1; next ; 1.1.4.1 date 2010.11.28.14.04.37; author tron; state Exp; branches; next ; desc @@ 1.3 log @Update to 5.7.2. This is a major update in terms of pkgsrc patches, of which there are far far too many. Analysis of patches was done by Karen Sirois of BBN, and I have remvoed patches that have been applied upstream. This builds fine and passes tests on NetBSD 6 i386. If you look after some other platform (Dragonfly, Darwin, FreeBSD, etc.), please make sure any problems are filed as upstream tickets; pkgsrc is not appropriate to carry patches long-term that should be fixed upstream, and this package has gotten out of hand. (OK by adam@@ to do the update, but he has not reviewed the changes, so errors are my fault. It's quite likely there are issues on other platforms.) Upstream NEWS: *5.7.2* snmp: - BUG: 3526549: CVE-2012-2141 Array index error leading to crash snmpd: - BUG: 3532090: Fix high ifIndex values crashing hrDeviceDescr building: - PATCH: 2091156: correctly declare dependencies in Makefile. 'make -j ' should work now. Backport this to V5-4 as it is needed for correct operation in the single threaded case of make miblib as well. Many other miscellaneous minor bug fixes *5.7.1* libnetsnmp: - Fixed the mib-parsing-bug introduced shortly before 5.7 agent: - fixed rounding errors for disk percentage calculations openbsd: - better support for recent openbsd releases features: - bug fixes with minimalist support after additional user feedback Many other miscellaneous minor bug fixes *5.7* snmpd: - Delivery of data via regularily scheduled notifications. (see "Data Delivery via Notfications" in snmpd.conf) - Many time-based config options can take (m)ins, (h)ours, ... arguments (see the snmpd.conf manual page) - The PING and TRACEROUTE MIBs now compile and work-ish on linux http://www.net-snmp.org/wiki/index.php/DISMAN - Mib handlers can now implement a data_clone function for cloning the myvoid structure variable to avoid dangling pointers - Fixed persistent storage of VACM MIB configuration - Multi-homed agents send UDP responses from the proper IP address - The hrStorageTable implementation now supports large filesystems better - optimizations for large route tables - Added a deliveryByNotify config token for regular data delivery (see the snmpd.conf manual page and the NET-SNMP-PERIODIC-NOTIFY-MIB) - [PATCH 3141462]: fix agentx subagent issues with multiple-object requests - [PATCH 3057093]: linux uses libpci for creating useful ifDescr strings - [PATCH 3131397]: huge speedups of the TCP/UDP Tables libnetsnmp: - Removed the older CMU compatibility support - The SSH transport is now configurable TLS/DTLS support: - The SNMP over DTLS transport now properly supports IPv6 - Introduced new configuration tokens: localCert/peerCert (deprecating serverCert, clientCert, defX509ServerPub, defX509ClientPub) - Various fixes for the TLS/DTLS transports apps: - Added a per-variable timed output support to snmpwalk using -CT - snmpinform now correctly uses the local engineID for informs - A number of mib2c bug fixes - New snmp.conf tokens for timeouts and retries building: - New flags to reduce the amount of compiled code to bare minimums. This is provided by a new generic feature marking/selection mechanism. http://www.net-snmp.org/wiki/index.php/Feature_Marking_and_Selection - It's now possible to build without SNMPv3/USM (e.g., if you only want TLS/DTLS with SNMPv3/TSM) - It's possible to build the suite with no SET support configure using --enable-read-only - It's possible to build the agent as a notify-only agent configure using --enable-notify-only - Added a script to test memory usage with various config options (see the local/minimalist/sizetests script) - Net-SNMP can now be built to perform local DNSSEC validation (install DNSSEC-Tools' libval and use --with-local-dnssec-validation) testing: - a number of new API unit-tests have been added to the suite (to run the tests: cd testing && ./RUNFULLTESTS -g unit-tests) - The unit tests can be more easily run under valgrind (See http://bit.ly/jsgRnv for details) openbsd: - Support for updating the routing table via SNMP win32: - The testing suite works better under win32 environments - Many building fixes for the win32 environment(s) solaris: - Net-SNMP now supports the SCTP-MIB DragonFlyBSD, FreeBSD8: - Net-SNMP should now work on DragonFlyBSD and FreeBSD8 And of course: - Many other bug fixes. See the CHANGES and ChangeLog for details. @ text @$NetBSD: patch-ev,v 1.2 2010/11/17 00:59:06 taca Exp $ --- agent/mibgroup/mibII/kernel_netbsd.c.orig 2010-10-19 03:54:58.000000000 +0000 +++ agent/mibgroup/mibII/kernel_netbsd.c @@@@ -0,0 +1,198 @@@@ +/* + * NetBSD implementation for mapping the IP stat arrays into struct's + * Required for NetBSD versions produced after April 7th 2008 (4+) + * + * Based on: http://mail-index.netbsd.org/pkgsrc-users/2008/04/27/msg007095.html + */ + +#include +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +#include +#include +#include + +#include "kernel_netbsd.h" + +#if defined(NETBSD_STATS_VIA_SYSCTL) + +int +netbsd_read_icmp_stat(struct icmp_mib *mib) +{ + size_t size; + uint64_t icmpstat[ICMP_NSTATS]; + int i; + + (void)memset(mib, 0, sizeof(*mib)); + + if (-1 == sysctlbyname("net.inet.icmp.stats", icmpstat, &size, NULL, 0)) + return -1; + + mib->icmpInMsgs = icmpstat[ICMP_STAT_BADCODE] + + icmpstat[ICMP_STAT_TOOSHORT] + + icmpstat[ICMP_STAT_CHECKSUM] + + icmpstat[ICMP_STAT_BADLEN]; + for (i = 0; i <= ICMP_MAXTYPE; i++) + mib->icmpInMsgs += icmpstat[ICMP_STAT_INHIST + i]; + mib->icmpInErrors = icmpstat[ICMP_STAT_BADCODE] + + icmpstat[ICMP_STAT_TOOSHORT] + + icmpstat[ICMP_STAT_CHECKSUM] + + icmpstat[ICMP_STAT_BADLEN]; + mib->icmpInDestUnreachs = icmpstat[ICMP_STAT_INHIST + ICMP_UNREACH]; + mib->icmpInTimeExcds = icmpstat[ICMP_STAT_INHIST + ICMP_TIMXCEED]; + mib->icmpInParmProbs = icmpstat[ICMP_STAT_INHIST + ICMP_PARAMPROB]; + mib->icmpInSrcQuenchs = icmpstat[ICMP_STAT_INHIST + ICMP_SOURCEQUENCH]; + mib->icmpInRedirects = icmpstat[ICMP_STAT_INHIST + ICMP_REDIRECT]; + mib->icmpInEchos = icmpstat[ICMP_STAT_INHIST + ICMP_ECHO]; + mib->icmpInEchoReps = icmpstat[ICMP_STAT_INHIST + ICMP_ECHOREPLY]; + mib->icmpInTimestamps = icmpstat[ICMP_STAT_INHIST + ICMP_TSTAMP]; + mib->icmpInTimestampReps + = icmpstat[ICMP_STAT_INHIST + ICMP_TSTAMPREPLY]; + mib->icmpInAddrMasks = icmpstat[ICMP_STAT_INHIST + ICMP_MASKREQ]; + mib->icmpInAddrMaskReps = icmpstat[ICMP_STAT_INHIST + ICMP_MASKREPLY]; + mib->icmpOutMsgs = icmpstat[ICMP_STAT_OLDSHORT] + + icmpstat[ICMP_STAT_OLDICMP]; + for (i = 0; i <= ICMP_MAXTYPE; i++) + mib->icmpOutMsgs += icmpstat[ICMP_STAT_OUTHIST + i]; + mib->icmpOutErrors = icmpstat[ICMP_STAT_OLDSHORT] + + icmpstat[ICMP_STAT_OLDICMP]; + mib->icmpOutDestUnreachs = icmpstat[ICMP_STAT_OUTHIST + ICMP_UNREACH]; + mib->icmpOutTimeExcds = icmpstat[ICMP_STAT_OUTHIST + ICMP_TIMXCEED]; + mib->icmpOutParmProbs = icmpstat[ICMP_STAT_OUTHIST + ICMP_PARAMPROB]; + mib->icmpOutSrcQuenchs + = icmpstat[ICMP_STAT_OUTHIST + ICMP_SOURCEQUENCH]; + mib->icmpOutRedirects = icmpstat[ICMP_STAT_OUTHIST + ICMP_REDIRECT]; + mib->icmpOutEchos = icmpstat[ICMP_STAT_OUTHIST + ICMP_ECHO]; + mib->icmpOutEchoReps = icmpstat[ICMP_STAT_OUTHIST + ICMP_ECHOREPLY]; + mib->icmpOutTimestamps = icmpstat[ICMP_STAT_OUTHIST + ICMP_TSTAMP]; + mib->icmpOutTimestampReps + = icmpstat[ICMP_STAT_OUTHIST + ICMP_TSTAMPREPLY]; + mib->icmpOutAddrMasks = icmpstat[ICMP_STAT_OUTHIST + ICMP_MASKREQ]; + mib->icmpOutAddrMaskReps = icmpstat[ICMP_STAT_OUTHIST + ICMP_MASKREPLY]; + + return 0; +} + +int +netbsd_read_ip_stat(struct ip_mib *mib) +{ + size_t size; + uint64_t ipstat[IP_NSTATS]; + int i; + static int sname[4] = { 4, 2, 0, 0 }; // CTL_NET, PF_INET, IPPROTO_IP, 0 + size_t len; + + (void)memset(mib, 0, sizeof(*mib)); + + if (-1 == sysctlbyname("net.inet.ip.stats", ipstat, &size, NULL, 0)) + return -1; + + mib->ipForwarding = 0; + len = sizeof i; + sname[3] = IPCTL_FORWARDING; + if (0 == sysctl(sname, 4, &i, &len, 0, 0)) { + mib->ipForwarding = (long)i; + } + + mib->ipDefaultTTL = 0; + sname[3] = IPCTL_DEFTTL; + if (0 == sysctl(sname, 4, &i, &len, 0, 0)) { + mib->ipDefaultTTL = (long)i; + } + + mib->ipInReceives = ipstat[IP_STAT_TOTAL]; + mib->ipInHdrErrors = ipstat[IP_STAT_BADSUM] + + ipstat[IP_STAT_TOOSHORT] + ipstat[IP_STAT_TOOSMALL] + + ipstat[IP_STAT_BADHLEN] + ipstat[IP_STAT_BADLEN]; + mib->ipInAddrErrors = ipstat[IP_STAT_CANTFORWARD]; + mib->ipForwDatagrams = ipstat[IP_STAT_FORWARD]; + mib->ipInUnknownProtos = ipstat[IP_STAT_NOPROTO]; + mib->ipInDiscards = ipstat[IP_STAT_FRAGDROPPED]; /* FIXME */ + mib->ipInDelivers = ipstat[IP_STAT_DELIVERED]; + mib->ipOutRequests = ipstat[IP_STAT_LOCALOUT]; + mib->ipOutDiscards = ipstat[IP_STAT_ODROPPED]; + mib->ipOutNoRoutes = 0; /* FIXME */ + mib->ipReasmTimeout = 0; /* IPFRAGTTL; */ + mib->ipReasmReqds = ipstat[IP_STAT_FRAGMENTS]; + mib->ipReasmOKs = ipstat[IP_STAT_REASSEMBLED]; + mib->ipReasmFails = ipstat[IP_STAT_FRAGDROPPED] + + ipstat[IP_STAT_FRAGTIMEOUT]; + mib->ipFragOKs = ipstat[IP_STAT_FRAGMENTS]; + mib->ipFragFails = ipstat[IP_STAT_CANTFRAG]; + mib->ipFragCreates = ipstat[IP_STAT_OFRAGMENTS]; + mib->ipRoutingDiscards = ipstat[IP_STAT_NOROUTE]; + + return 0; +} + +int +netbsd_read_tcp_stat(struct tcp_mib *mib) +{ + size_t size; + uint64_t tcpstat[TCP_NSTATS]; + + (void)memset(mib, 0, sizeof(*mib)); + + if (-1 == sysctlbyname("net.inet.tcp.stats", tcpstat, &size, NULL, 0)) + return -1; + + mib->tcpRtoAlgorithm = 4; /* Assume Van Jacobsen's algorithm */ + mib->tcpRtoMin = TCPTV_MIN; + mib->tcpRtoMax = TCPTV_REXMTMAX; + mib->tcpMaxConn = -1; /* Dynamic Maximum */ + mib->tcpActiveOpens = tcpstat[TCP_STAT_CONNATTEMPT]; + mib->tcpPassiveOpens = tcpstat[TCP_STAT_ACCEPTS]; + mib->tcpAttemptFails = tcpstat[TCP_STAT_CONNDROPS]; + mib->tcpEstabResets = tcpstat[TCP_STAT_DROPS]; + mib->tcpCurrEstab = 0; /* FIXME */ + mib->tcpInSegs = tcpstat[TCP_STAT_RCVTOTAL]; + mib->tcpOutSegs = tcpstat[TCP_STAT_SNDTOTAL] + - tcpstat[TCP_STAT_SNDREXMITPACK]; + mib->tcpRetransSegs = tcpstat[TCP_STAT_SNDREXMITPACK]; + mib->tcpInErrs = tcpstat[TCP_STAT_RCVBADSUM] + + tcpstat[TCP_STAT_RCVBADOFF] + + tcpstat[TCP_STAT_RCVMEMDROP] + + tcpstat[TCP_STAT_RCVSHORT]; + mib->tcpOutRsts = tcpstat[TCP_STAT_SNDCTRL] + - tcpstat[TCP_STAT_CLOSED]; + mib->tcpInErrsValid = mib->tcpInErrs; /* FIXME */ + mib->tcpOutRstsValid = mib->tcpOutRsts; /* FIXME */ + + return 0; +} + +int +netbsd_read_udp_stat(struct udp_mib *mib) +{ + size_t size; + uint64_t udpstat[UDP_NSTATS]; + + (void)memset(mib, 0, sizeof(*mib)); + + if (-1 == sysctlbyname("net.inet.udp.stats", udpstat, &size, NULL, 0)) + return -1; + + mib->udpInDatagrams = udpstat[UDP_STAT_IPACKETS]; + mib->udpNoPorts = udpstat[UDP_STAT_NOPORT]; + mib->udpOutDatagrams = udpstat[UDP_STAT_OPACKETS]; + mib->udpInErrors = udpstat[UDP_STAT_HDROPS] + + udpstat[UDP_STAT_BADSUM] //+ udpstat[UDP_STAT_DISCARD] /* FIXME */ + + udpstat[UDP_STAT_FULLSOCK] + udpstat[UDP_STAT_BADLEN]; + + return 0; +} + +#endif @ 1.2 log @Fix build problem on NetBSD 4. Previous patch for NetBSD wasn't really for netbsd4 but 4.99.58 and later. So, I changed "#ifdef netbsd4" to "#ifdef NETBSD_STATS_VIA_SYSCTL" and clean up patches. Should be fix PR pkg/43288. It is fix of build problem only, so no PKG_REVISION bump. @ text @d1 1 a1 1 $NetBSD: patch-ev,v 1.1 2010/05/11 04:39:54 adam Exp $ @ 1.1 log @Added patches, courtesy of Mike Bowie: * Address changes in sysctl() storage, which has yielded values such as IP-MIB::ipForwarding.0 invalid. * RAM reporting on 64-bit systems. @ text @d1 1 a1 1 $NetBSD$ d3 3 a5 3 --- agent/mibgroup/mibII/kernel_netbsd.c.orig 2010-03-12 00:47:14.000000000 +0000 +++ agent/mibgroup/mibII/kernel_netbsd.c 2010-03-12 01:40:58.000000000 +0000 @@@@ -0,0 +1,194 @@@@ d35 2 d202 2 @ 1.1.4.1 log @Pullup ticket #3284 - requested by taca net/net-snmp: build fix Revisions pulled up: - net/net-snmp/distinfo 1.57 - net/net-snmp/patches/patch-et 1.5 - net/net-snmp/patches/patch-eu 1.2 - net/net-snmp/patches/patch-ev 1.2 - net/net-snmp/patches/patch-ew 1.2 - net/net-snmp/patches/patch-ex 1.2 - net/net-snmp/patches/patch-ey 1.3 - net/net-snmp/patches/patch-ez 1.2 - net/net-snmp/patches/patch-fa 1.2 --- Module Name: pkgsrc Committed By: taca Date: Wed Nov 17 00:59:07 UTC 2010 Modified Files: pkgsrc/net/net-snmp: distinfo pkgsrc/net/net-snmp/patches: patch-et patch-eu patch-ev patch-ew patch-ex patch-ey patch-ez patch-fa Log Message: Fix build problem on NetBSD 4. Previous patch for NetBSD wasn't really for netbsd4 but 4.99.58 and later. So, I changed "#ifdef netbsd4" to "#ifdef NETBSD_STATS_VIA_SYSCTL" and clean up patches. Should be fix PR pkg/43288. It is fix of build problem only, so no PKG_REVISION bump. @ text @d3 3 a5 3 --- agent/mibgroup/mibII/kernel_netbsd.c.orig 2010-10-19 03:54:58.000000000 +0000 +++ agent/mibgroup/mibII/kernel_netbsd.c @@@@ -0,0 +1,198 @@@@ a34 2 +#if defined(NETBSD_STATS_VIA_SYSCTL) + a199 2 + +#endif @