On 2010/09/20 16:35, Stuart Henderson wrote: > update to a newer version, and let it find mibs from the base OS > in /usr/share/snmp/mibs. > > any test reports? ok?
...or we could load our MIBs by default too, so that you can see names even when you don't specify a mib on the command-line. this one hardcodes a string that may possibly change in a future update of the port, so I've added a sanity-check to pre-configure. Index: Makefile =================================================================== RCS file: /cvs/ports/net/net-snmp/Makefile,v retrieving revision 1.45 diff -u -p -r1.45 Makefile --- Makefile 12 Jul 2010 22:07:39 -0000 1.45 +++ Makefile 20 Sep 2010 16:32:37 -0000 @@ -4,10 +4,8 @@ COMMENT-main= extendable SNMP implementa COMMENT-perl= SNMP modules for Perl COMMENT-tkmib= graphical SNMP MIB browser -V= 5.4.2.1 +V= 5.4.3 DISTNAME= net-snmp-${V} -REVISION-main= 5 -REVISION-perl= 1 PKGNAME-main= ${DISTNAME} PKGNAME-perl= p5-SNMP-${V} PKGNAME-tkmib= net-snmp-tkmib-${V} @@ -19,22 +17,27 @@ SHARED_LIBS= netsnmp 8.0 \ CATEGORIES= net perl5 MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/} -HOMEPAGE= http://www.net-snmp.org +HOMEPAGE= http://www.net-snmp.org/ # BSD PERMIT_PACKAGE_CDROM= Yes PERMIT_PACKAGE_FTP= Yes PERMIT_DISTFILES_CDROM= Yes PERMIT_DISTFILES_FTP= Yes + WANTLIB-main= c crypto kvm m perl util wrap -MULTI_PACKAGES= -main -perl -tkmib +MULTI_PACKAGES= -main -perl -tkmib -LIB_DEPENDS-perl= netsnmptrapd,netsnmpmibs,netsnmphelpers,netsnmpagent,netsnmp::net/net-snmp,-main +WANTLIB-perl= netsnmp netsnmpagent netsnmphelpers netsnmptrapd +WANTLIB-perl+= netsnmpmibs +LIB_DEPENDS-perl= ::net/net-snmp,-main RUN_DEPENDS-tkmib= ::net/net-snmp,-perl \ ::x11/p5-Tk -NET_SNMP_MIB_LIST= host disman/event-mib smux mibII/mta_sendmail +NET_SNMP_MIB_LIST= host disman/event-mib smux mibII/mta_sendmail +DEFAULT_MIBS= IP-MIB:IF-MIB:TCP-MIB:UDP-MIB:SNMPv2-MIB:RFC1213-MIB +OPENBSD_MIBS= OPENBSD-BASE-MIB:OPENBSD-MEM-MIB:OPENBSD-SENSORS-MIB:OPENBSD-SNMPD-CONF USE_LIBTOOL= Yes CONFIGURE_STYLE= gnu @@ -45,6 +48,8 @@ CONFIGURE_ARGS= ${CONFIGURE_SHARED} \ --with-perl-modules \ --with-copy-persistent-files="no" \ --with-mib-modules="${NET_SNMP_MIB_LIST}" \ + --with-mibs="${DEFAULT_MIBS}:${OPENBSD_MIBS}" \ + --with-mibdirs="\$$HOME/.snmp/mibs:/usr/share/snmp/mibs:${TRUEPREFIX}/share/snmp/mibs" \ --with-default-snmp-version="3" \ --with-sys-contact="nob...@nowhere.invalid" \ --with-sys-location="somewhere" \ @@ -52,6 +57,11 @@ CONFIGURE_ARGS= ${CONFIGURE_SHARED} \ --with-persistent-directory="/var/net-snmp" REGRESS_TARGET= test + +pre-configure: + @if ! fgrep '#define NETSNMP_DEFAULT_MIBS "${DEFAULT_MIBS}"' \ + ${WRKSRC}/include/net-snmp/net-snmp-config.h.in > /dev/null; then \ + echo 'DEFAULT_MIBS in the port Makefile is out of sync'; exit 1; fi post-install: @perl -pi -e 's,^(#define[ ]PACKAGE_.*)$$,/* $$1 */,' \ Index: distinfo =================================================================== RCS file: /cvs/ports/net/net-snmp/distinfo,v retrieving revision 1.10 diff -u -p -r1.10 distinfo --- distinfo 7 Nov 2008 09:48:40 -0000 1.10 +++ distinfo 20 Sep 2010 16:32:37 -0000 @@ -1,5 +1,5 @@ -MD5 (net-snmp-5.4.2.1.tar.gz) = mEkyUgFD8Mi/e3zh/J4doQ== -RMD160 (net-snmp-5.4.2.1.tar.gz) = IUjELUhu2I+c/Dyh1Qxoq81+PWM= -SHA1 (net-snmp-5.4.2.1.tar.gz) = Ty356mI0T+hA9JPQ4Iq+XeNpeGI= -SHA256 (net-snmp-5.4.2.1.tar.gz) = Eai68Wf3v/9g0lkOBQmRQAo6CCkj282/heDgzkbrJHw= -SIZE (net-snmp-5.4.2.1.tar.gz) = 5185390 +MD5 (net-snmp-5.4.3.tar.gz) = NRPjnuGp1sdYHFCIELgY+Q== +RMD160 (net-snmp-5.4.3.tar.gz) = QX9HwwHDIhpk83FitWtGYcn22Ms= +SHA1 (net-snmp-5.4.3.tar.gz) = hJog3eqpCxsAEOSHh2kn5hW1xrw= +SHA256 (net-snmp-5.4.3.tar.gz) = Rhp6cqy+WtE+OfC64Sm0nfVBuOqPkXjSck3nZU1PHEA= +SIZE (net-snmp-5.4.3.tar.gz) = 5199202 Index: patches/patch-agent_mibgroup_if-mib_data_access_interface_sysctl_c =================================================================== RCS file: /cvs/ports/net/net-snmp/patches/patch-agent_mibgroup_if-mib_data_access_interface_sysctl_c,v retrieving revision 1.2 diff -u -p -r1.2 patch-agent_mibgroup_if-mib_data_access_interface_sysctl_c --- patches/patch-agent_mibgroup_if-mib_data_access_interface_sysctl_c 19 May 2010 15:50:00 -0000 1.2 +++ patches/patch-agent_mibgroup_if-mib_data_access_interface_sysctl_c 20 Sep 2010 16:32:37 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-agent_mibgroup_if-mib_data_access_interface_sysctl_c,v 1.2 2010/05/19 15:50:00 sthen Exp $ ---- agent/mibgroup/if-mib/data_access/interface_sysctl.c.orig Sat Mar 13 01:01:16 2010 -+++ agent/mibgroup/if-mib/data_access/interface_sysctl.c Sat Mar 13 01:01:09 2010 +--- agent/mibgroup/if-mib/data_access/interface_sysctl.c.orig Thu Apr 9 09:44:41 2009 ++++ agent/mibgroup/if-mib/data_access/interface_sysctl.c Mon Sep 20 09:48:18 2010 @@ -183,6 +183,7 @@ netsnmp_sysctl_ifmedia_to_speed(int media, u_int *spee #endif } @@ -21,38 +21,3 @@ $OpenBSD: patch-agent_mibgroup_if-mib_da #ifdef IFM_ATM case IFM_ATM: switch (IFM_SUBTYPE(media)) { -@@ -451,22 +453,22 @@ netsnmp_arch_interface_container_load(netsnmp_containe - NETSNMP_INTERFACE_FLAGS_HAS_V6_REASMMAX; - - /* get counters */ -- entry->stats.ibytes.low = ifp->ifm_data.ifi_ibytes; -- entry->stats.ibytes.high = 0; -- entry->stats.iucast.low = ifp->ifm_data.ifi_ipackets; -- entry->stats.iucast.high = 0; -- entry->stats.imcast.low = ifp->ifm_data.ifi_imcasts; -- entry->stats.imcast.high = 0; -+ entry->stats.ibytes.low = ifp->ifm_data.ifi_ibytes & 0xffffffff; -+ entry->stats.ibytes.high = ifp->ifm_data.ifi_ibytes >> 32; -+ entry->stats.iucast.low = ifp->ifm_data.ifi_ipackets & 0xffffffff; -+ entry->stats.iucast.high = ifp->ifm_data.ifi_ipackets >> 32; -+ entry->stats.imcast.low = ifp->ifm_data.ifi_imcasts & 0xffffffff; -+ entry->stats.imcast.high = ifp->ifm_data.ifi_imcasts >> 32; - entry->stats.ierrors = ifp->ifm_data.ifi_ierrors; - entry->stats.idiscards = ifp->ifm_data.ifi_iqdrops; - entry->stats.iunknown_protos = ifp->ifm_data.ifi_noproto; - -- entry->stats.obytes.low = ifp->ifm_data.ifi_obytes; -- entry->stats.obytes.high = 0; -- entry->stats.oucast.low = ifp->ifm_data.ifi_opackets; -- entry->stats.oucast.high = 0; -- entry->stats.omcast.low = ifp->ifm_data.ifi_omcasts; -- entry->stats.omcast.high = 0; -+ entry->stats.obytes.low = ifp->ifm_data.ifi_obytes & 0xffffffff; -+ entry->stats.obytes.high = ifp->ifm_data.ifi_obytes >> 32; -+ entry->stats.oucast.low = ifp->ifm_data.ifi_opackets & 0xffffffff; -+ entry->stats.oucast.high = ifp->ifm_data.ifi_opackets >> 32; -+ entry->stats.omcast.low = ifp->ifm_data.ifi_omcasts & 0xffffffff; -+ entry->stats.omcast.high = ifp->ifm_data.ifi_omcasts >> 32; - entry->stats.oerrors = ifp->ifm_data.ifi_oerrors; - entry->ns_flags |= NETSNMP_INTERFACE_FLAGS_HAS_BYTES | - NETSNMP_INTERFACE_FLAGS_HAS_DROPS | Index: patches/patch-agent_mibgroup_mibII_interfaces_c =================================================================== RCS file: /cvs/ports/net/net-snmp/patches/patch-agent_mibgroup_mibII_interfaces_c,v retrieving revision 1.4 diff -u -p -r1.4 patch-agent_mibgroup_mibII_interfaces_c --- patches/patch-agent_mibgroup_mibII_interfaces_c 26 Sep 2007 20:03:42 -0000 1.4 +++ patches/patch-agent_mibgroup_mibII_interfaces_c 20 Sep 2010 16:32:37 -0000 @@ -1,7 +1,7 @@ $OpenBSD: patch-agent_mibgroup_mibII_interfaces_c,v 1.4 2007/09/26 20:03:42 rui Exp $ ---- agent/mibgroup/mibII/interfaces.c.orig Mon Nov 6 23:43:27 2006 -+++ agent/mibgroup/mibII/interfaces.c Sat Sep 15 23:12:28 2007 -@@ -2097,11 +2097,10 @@ Interface_Scan_Get_Count(void) +--- agent/mibgroup/mibII/interfaces.c.orig Wed Apr 14 09:11:44 2010 ++++ agent/mibgroup/mibII/interfaces.c Mon Sep 20 09:48:18 2010 +@@ -2117,11 +2117,10 @@ Interface_Scan_Get_Count(void) #else /* hpux11 */ Index: patches/patch-configure =================================================================== RCS file: /cvs/ports/net/net-snmp/patches/patch-configure,v retrieving revision 1.9 diff -u -p -r1.9 patch-configure --- patches/patch-configure 20 Sep 2008 22:15:52 -0000 1.9 +++ patches/patch-configure 20 Sep 2010 16:32:37 -0000 @@ -1,6 +1,6 @@ $OpenBSD: patch-configure,v 1.9 2008/09/20 22:15:52 rui Exp $ ---- configure.orig Fri Sep 5 10:29:01 2008 -+++ configure Fri Sep 19 18:04:38 2008 +--- configure.orig Sun May 23 22:10:00 2010 ++++ configure Mon Sep 20 09:48:18 2010 @@ -21655,34 +21655,6 @@ fi echo "$as_me:$LINENO: result: $EXTRACPPFLAGS" >&5 echo "${ECHO_T}$EXTRACPPFLAGS" >&6 @@ -52,7 +52,7 @@ $OpenBSD: patch-configure,v 1.9 2008/09/ #include <tcpd.h> _ACEOF if { (eval echo "$as_me:$LINENO: \"$ac_cpp conftest.$ac_ext\"") >&5 -@@ -33939,7 +33913,7 @@ done +@@ -34009,7 +33983,7 @@ done @@ -61,7 +61,7 @@ $OpenBSD: patch-configure,v 1.9 2008/09/ do as_ac_Header=`echo "ac_cv_header_$ac_header" | $as_tr_sh` echo "$as_me:$LINENO: checking for $ac_header" >&5 -@@ -37415,7 +37389,6 @@ cat confdefs.h >>conftest.$ac_ext +@@ -37485,7 +37459,6 @@ cat confdefs.h >>conftest.$ac_ext cat >>conftest.$ac_ext <<_ACEOF /* end confdefs.h. */ Index: patches/patch-local_tkmib =================================================================== RCS file: patches/patch-local_tkmib diff -N patches/patch-local_tkmib --- patches/patch-local_tkmib 17 Aug 2009 14:58:45 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,8 +0,0 @@ -$OpenBSD: patch-local_tkmib,v 1.1 2009/08/17 14:58:45 giovanni Exp $ ---- local/tkmib.orig Thu Jul 16 09:07:45 2009 -+++ local/tkmib Thu Jul 16 09:08:01 2009 -@@ -1,4 +1,3 @@ --#!/usr/bin/perl - #!/usr/bin/perl -w - - require 5; Index: patches/patch-snmplib_snmpUDPDomain_c =================================================================== RCS file: patches/patch-snmplib_snmpUDPDomain_c diff -N patches/patch-snmplib_snmpUDPDomain_c --- patches/patch-snmplib_snmpUDPDomain_c 13 Feb 2009 09:39:38 -0000 1.1 +++ /dev/null 1 Jan 1970 00:00:00 -0000 @@ -1,23 +0,0 @@ -$OpenBSD: patch-snmplib_snmpUDPDomain_c,v 1.1 2009/02/13 09:39:38 jasper Exp $ - -Fix for SA33884, which could disclose sensitive information. -Patch taken from upstream svn, -r17367. - ---- snmplib/snmpUDPDomain.c.orig Fri Feb 13 10:20:08 2009 -+++ snmplib/snmpUDPDomain.c Fri Feb 13 10:21:07 2009 -@@ -104,12 +104,12 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t, void *data, - 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); - } Index: pkg/PLIST-main =================================================================== RCS file: /cvs/ports/net/net-snmp/pkg/PLIST-main,v retrieving revision 1.7 diff -u -p -r1.7 PLIST-main --- pkg/PLIST-main 17 Aug 2009 14:58:45 -0000 1.7 +++ pkg/PLIST-main 20 Sep 2010 16:32:37 -0000 @@ -231,7 +231,6 @@ lib/libnetsnmptrapd.la @man man/man3/init_mib.3 @man man/man3/init_mib_internals.3 @man man/man3/mib_api.3 -...@man man/man3/netsnmp_Container_iterator.3 @man man/man3/netsnmp_agent.3 @man man/man3/netsnmp_baby_steps.3 @man man/man3/netsnmp_bulk_to_next.3 @@ -473,6 +472,7 @@ share/snmp/mibs/NET-SNMP-AGENT-MIB.txt share/snmp/mibs/NET-SNMP-EXAMPLES-MIB.txt share/snmp/mibs/NET-SNMP-EXTEND-MIB.txt share/snmp/mibs/NET-SNMP-MIB.txt +share/snmp/mibs/NET-SNMP-PASS-MIB.txt share/snmp/mibs/NET-SNMP-TC.txt share/snmp/mibs/NET-SNMP-VACM-MIB.txt share/snmp/mibs/NETWORK-SERVICES-MIB.txt