aboutsummaryrefslogtreecommitdiffstats
path: root/net-mgmt
diff options
context:
space:
mode:
authorKurt Jaeger <pi@FreeBSD.org>2019-09-28 23:16:22 +0800
committerKurt Jaeger <pi@FreeBSD.org>2019-09-28 23:16:22 +0800
commitb7784c125be60aea19245af284ac140c7c6133a4 (patch)
tree3709910b31195876c15262f70939b752eade90bd /net-mgmt
parentf9321ddbdcd3568c4fad00f0f272fb270b78a09d (diff)
downloadfreebsd-ports-gnome-b7784c125be60aea19245af284ac140c7c6133a4.tar.gz
freebsd-ports-gnome-b7784c125be60aea19245af284ac140c7c6133a4.tar.zst
freebsd-ports-gnome-b7784c125be60aea19245af284ac140c7c6133a4.zip
net-mgmt/net-snmp: update 5.7.3 -> 5.8
PR: 232025 Approved by: zi (maintainer timeout) Relnotes: https://sourceforge.net/p/net-snmp/mailman/message/36386084/
Diffstat (limited to 'net-mgmt')
-rw-r--r--net-mgmt/net-snmp/Makefile62
-rw-r--r--net-mgmt/net-snmp/distinfo5
-rw-r--r--net-mgmt/net-snmp/files/extra-patch-local_Makefile.in8
-rw-r--r--net-mgmt/net-snmp/files/extra-patch-openssl11223
-rw-r--r--net-mgmt/net-snmp/files/patch-Makefile.in20
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c (renamed from net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c)8
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c11
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c4
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h12
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcpTable.c (renamed from net-mgmt/net-snmp/files/patch-tcpTable.c)14
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_udpTable.c (renamed from net-mgmt/net-snmp/files/patch-udpTable.c)8
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c12
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c54
-rw-r--r--net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c32
-rw-r--r--net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in11
-rw-r--r--net-mgmt/net-snmp/files/patch-include_net-snmp_library_transform__oids.h11
-rw-r--r--net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h8
-rw-r--r--net-mgmt/net-snmp/files/patch-kthreads96
-rw-r--r--net-mgmt/net-snmp/files/patch-perl5.23135
-rw-r--r--net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c117
-rw-r--r--net-mgmt/net-snmp/files/patch-snmplib_snmpusm.c11
-rw-r--r--net-mgmt/net-snmp/files/patch-snmpusm.c11
-rw-r--r--net-mgmt/net-snmp/files/patch-transform_oids.h11
-rw-r--r--net-mgmt/net-snmp/pkg-plist32
24 files changed, 135 insertions, 781 deletions
diff --git a/net-mgmt/net-snmp/Makefile b/net-mgmt/net-snmp/Makefile
index 868f991fc57b..1513fa93c77e 100644
--- a/net-mgmt/net-snmp/Makefile
+++ b/net-mgmt/net-snmp/Makefile
@@ -2,8 +2,7 @@
# $FreeBSD$
PORTNAME= snmp
-PORTVERSION= 5.7.3
-PORTREVISION= 20
+PORTVERSION= 5.8
CATEGORIES= net-mgmt ipv6
MASTER_SITES= SF/net-${PORTNAME}/net-${PORTNAME}/${PORTVERSION} \
ZI
@@ -21,7 +20,19 @@ LIB_DEPENDS= libpkg.so:ports-mgmt/pkg
NOT_FOR_ARCHS= mips mips64
NOT_FOR_ARCHS_REASON= SSP is currently broken on MIPS
-OPTIONS_DEFINE= IPV6 MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
+LIB_DEPENDS= libpkg.so:ports-mgmt/pkg \
+ libpcre.so:devel/pcre
+
+USES= cpe libtool perl5 ssl
+USE_RC_SUBR= snmpd snmptrapd
+USE_LDCONFIG= yes
+USE_PERL5= build run
+USE_CSTD= c99
+
+CPE_VENDOR= net-snmp
+GNU_CONFIGURE= yes
+
+OPTIONS_DEFINE= MFD_REWRITES PERL PERL_EMBEDDED PYTHON DUMMY TKMIB \
MYSQL AX_SOCKONLY UNPRIVILEGED SMUX DOCS JAIL AX_DISABLE_TRAP \
TLS NEWSYSLOG
OPTIONS_DEFAULT=PERL PERL_EMBEDDED DUMMY SMUX NEWSYSLOG
@@ -42,14 +53,6 @@ MAKE_JOBS_UNSAFE= yes
PORTSCOUT= skipv:5.7.2.1
-GNU_CONFIGURE= yes
-USE_RC_SUBR= snmpd snmptrapd
-USE_LDCONFIG= yes
-USES= cpe libtool perl5 ssl
-CPE_VENDOR= net-snmp
-USE_PERL5= build run
-USE_CSTD= c99
-
CFLAGS+= -I${LOCALBASE}/include -I${PKG_PREFIX}/include
LDFLAGS+= -L${LOCALBASE}/lib
CONFIGURE_ENV+= PERLPROG="${PERL}" PSPROG="${PS_CMD}" SED="${SED}"
@@ -75,10 +78,6 @@ TLS_CONFIGURE_ON= --with-security-modules=tsm --with-transports=TLSTCP,DTLSUDP
.include <bsd.port.options.mk>
-.if (${OSVERSION} >= 1200085 || ${SSL_DEFAULT:Mopenssl111*})
-EXTRA_PATCHES= ${PATCHDIR}/extra-patch-openssl11
-.endif
-
.if ${PORT_OPTIONS:MPYTHON}
PYDISTUTILS_PKGNAME?= netsnmp-python
PYDISTUTILS_PKGVERSION?= 1.0a1
@@ -139,20 +138,12 @@ CONFIGURE_ARGS+=--disable-snmptrapd-subagent
CONFIGURE_ARGS+=--enable-agentx-dom-sock-only
.endif
-.if ${PORT_OPTIONS:MIPV6}
-CONFIGURE_ARGS+=--enable-ipv6
-# --with-transport="UDPIPv6 TCPIPv6" --with-modules=mibII/ipv6"
-PLIST_SUB+= WITH_IPV6=""
-.else
-PLIST_SUB+= WITH_IPV6="@comment "
-.endif
-
.if ${PORT_OPTIONS:MUNPRIVILEGED}
CONFIGURE_ARGS+=--without-root-access
.endif
-SHLIB_VERSION= 30
-SHLIB_VERSION2= .0.3
+SHLIB_VERSION= 35
+SHLIB_VERSION2= .0.0
PLIST_SUB+= SHLIB_VERSION=${SHLIB_VERSION} SHLIB_VERSION2=${SHLIB_VERSION2}
SCRIPTS_SUB= PREFIX=${PREFIX} PERL=${PERL}
@@ -197,7 +188,12 @@ CONFIGURE_ARGS+=--with-out-mib-modules="${NET_SNMP_WITHOUT_MIB_MODULE_LIST}"
BIN_FILES= snmpbulkwalk snmpget snmpgetnext snmpset \
snmpstatus snmptest snmptranslate snmptrap snmpwalk \
snmptable snmpbulkget snmpdelta snmpdf agentxtrap \
- snmpvacm snmpusm encode_keychange snmpnetstat
+ snmpvacm snmpusm encode_keychange snmpnetstat \
+ snmppcap snmpping snmpps
+.if ${PORT_OPTIONS:MTLS}
+BIN_FILES+= snmptls
+.endif
+
LIB_FILES= libnetsnmp.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
libnetsnmpagent.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
libnetsnmpmibs.so.${SHLIB_VERSION}${SHLIB_VERSION2} \
@@ -244,17 +240,13 @@ pre-everything::
post-patch:
.for filename in ${SCRIPT_FILES}
- @${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
+ ${REINPLACE_CMD} -e 's|/usr/local|${PREFIX}|' ${WRKSRC}/local/${filename}
.endfor
- @${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
+ ${REINPLACE_CMD} -e 's!utmp_p->ut_name!utmp_p->ut_user!' \
${WRKSRC}/agent/mibgroup/host/hr_system.c
- @${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
- ${WRKSRC}/configure
-.if (${OSVERSION} >= 1200085 || ${SSL_DEFAULT:Mopenssl111*})
- @${REINPLACE_CMD} -E -e 's|SSL_library_init|OPENSSL_init_ssl|g' \
+ ${REINPLACE_CMD} -E -e 's|return pci_lookup_name|disabled broken|g' \
${WRKSRC}/configure
-.endif
- @${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
+ ${CP} ${WRKSRC}/include/net-snmp/system/freebsd12.h \
${WRKSRC}/include/net-snmp/system/freebsd13.h
post-configure:
@@ -308,7 +300,7 @@ install-config-files:
install-doc-files:
.if ${PORT_OPTIONS:MDOCS}
- @${MKDIR} ${STAGEDIR}${DOCSDIR}
+ ${MKDIR} ${STAGEDIR}${DOCSDIR}
. for filename in ${DOC_FILES}
${INSTALL_DATA} ${WRKSRC}/${filename} ${STAGEDIR}${DOCSDIR}
. endfor
diff --git a/net-mgmt/net-snmp/distinfo b/net-mgmt/net-snmp/distinfo
index 52459822c6d7..5e91811798a8 100644
--- a/net-mgmt/net-snmp/distinfo
+++ b/net-mgmt/net-snmp/distinfo
@@ -1,2 +1,3 @@
-SHA256 (net-snmp-5.7.3.tar.gz) = 12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0
-SIZE (net-snmp-5.7.3.tar.gz) = 6382428
+TIMESTAMP = 1538855962
+SHA256 (net-snmp-5.8.tar.gz) = b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf
+SIZE (net-snmp-5.8.tar.gz) = 6591680
diff --git a/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in b/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in
index 546d8591ef3a..b2887cfd35fc 100644
--- a/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in
+++ b/net-mgmt/net-snmp/files/extra-patch-local_Makefile.in
@@ -1,11 +1,11 @@
---- local/Makefile.in.orig 2015-01-19 14:37:56 UTC
+--- local/Makefile.in.orig 2018-07-16 14:33:40 UTC
+++ local/Makefile.in
-@@ -16,7 +16,7 @@ OTHERUNINSTALL=localuninstall
+@@ -14,7 +14,7 @@ OTHERUNINSTALL=localuninstall
#
SNMPCONFPATH=@SNMPCONFPATH@
PERSISTENT_DIRECTORY=@PERSISTENT_DIRECTORY@
--PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert
-+PERLSCRIPTS=snmpcheck mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert
+-PERLSCRIPTS=snmpcheck tkmib mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert checkbandwidth
++PERLSCRIPTS=snmpcheck mib2c fixproc ipf-mod.pl snmpconf traptoemail snmp-bridge-mib net-snmp-cert checkbandwidth
SHELLSCRIPTS=mib2c-update
SCRIPTSMADEFORPERL=snmpcheck.made tkmib.made mib2c.made fixproc.made \
ipf-mod.pl.made snmpconf.made traptoemail.made snmp-bridge-mib.made \
diff --git a/net-mgmt/net-snmp/files/extra-patch-openssl11 b/net-mgmt/net-snmp/files/extra-patch-openssl11
deleted file mode 100644
index e3e298ccbb73..000000000000
--- a/net-mgmt/net-snmp/files/extra-patch-openssl11
+++ /dev/null
@@ -1,223 +0,0 @@
---- apps/snmpusm.c
-+++ apps/snmpusm.c
-@@ -125,6 +125,32 @@ char *usmUserPublic_val = NULL
- int docreateandwait = 0;
-
-
-+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER)
-+
-+#include <string.h>
-+#include <openssl/engine.h>
-+
-+void DH_get0_pqg(const DH *dh,
-+ const BIGNUM **p, const BIGNUM **q, const BIGNUM **g)
-+{
-+ if (p != NULL)
-+ *p = dh->p;
-+ if (q != NULL)
-+ *q = dh->q;
-+ if (g != NULL)
-+ *g = dh->g;
-+}
-+
-+void DH_get0_key(const DH *dh, const BIGNUM **pub_key, const BIGNUM **priv_key)
-+{
-+ if (pub_key != NULL)
-+ *pub_key = dh->pub_key;
-+ if (priv_key != NULL)
-+ *priv_key = dh->priv_key;
-+}
-+
-+#endif
-+
- void
- usage(void)
- {
-@@ -190,7 +216,7 @@ get_USM_DH_key(netsnmp_variable_list *va
- oid *keyoid, size_t keyoid_len) {
- u_char *dhkeychange;
- DH *dh;
-- BIGNUM *other_pub;
-+ BIGNUM *p, *g, *pub_key, *other_pub;
- u_char *key;
- size_t key_len;
-
-@@ -205,25 +231,29 @@ get_USM_DH_key(netsnmp_variable_list *va
- dh = d2i_DHparams(NULL, &cp, dhvar->val_len);
- }
-
-- if (!dh || !dh->g || !dh->p) {
-+ if (dh)
-+ DH_get0_pqg(dh, &p, NULL, &g);
-+
-+ if (!dh || !g || !p) {
- SNMP_FREE(dhkeychange);
- return SNMPERR_GENERR;
- }
-
-- DH_generate_key(dh);
-- if (!dh->pub_key) {
-+ if (!DH_generate_key(dh)) {
- SNMP_FREE(dhkeychange);
- return SNMPERR_GENERR;
- }
-
-- if (vars->val_len != (unsigned int)BN_num_bytes(dh->pub_key)) {
-+ DH_get0_key(dh, &pub_key, NULL);
-+
-+ if (vars->val_len != (unsigned int)BN_num_bytes(pub_key)) {
- SNMP_FREE(dhkeychange);
- fprintf(stderr,"incorrect diffie-helman lengths (%lu != %d)\n",
-- (unsigned long)vars->val_len, BN_num_bytes(dh->pub_key));
-+ (unsigned long)vars->val_len, BN_num_bytes(pub_key));
- return SNMPERR_GENERR;
- }
-
-- BN_bn2bin(dh->pub_key, dhkeychange + vars->val_len);
-+ BN_bn2bin(pub_key, dhkeychange + vars->val_len);
-
- key_len = DH_size(dh);
- if (!key_len) {
---- configure.d/config_os_libs2
-+++ configure.d/config_os_libs2
-@@ -291,12 +291,6 @@ if test "x$tryopenssl" != "xno" -a "x$tr
- AC_CHECK_LIB(${CRYPTO}, AES_cfb128_encrypt,
- AC_DEFINE(HAVE_AES_CFB128_ENCRYPT, 1,
- [Define to 1 if you have the `AES_cfb128_encrypt' function.]))
--
-- AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_create,
-- AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [],
-- [Define to 1 if you have the `EVP_MD_CTX_create' function.])
-- AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [],
-- [Define to 1 if you have the `EVP_MD_CTX_destroy' function.]))
- fi
- if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then
- AC_CHECK_LIB(ssl, DTLSv1_method,
---- snmplib/keytools.c
-+++ snmplib/keytools.c
-@@ -149,13 +149,13 @@ generate_Ku(const oid * hashtype, u_int
- */
- #ifdef NETSNMP_USE_OPENSSL
-
--#ifdef HAVE_EVP_MD_CTX_CREATE
-+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
- ctx = EVP_MD_CTX_create();
- #else
-- ctx = malloc(sizeof(*ctx));
-- if (!EVP_MD_CTX_init(ctx))
-- return SNMPERR_GENERR;
-+ ctx = EVP_MD_CTX_new();
- #endif
-+ if (!ctx)
-+ return SNMPERR_GENERR;
- #ifndef NETSNMP_DISABLE_MD5
- if (ISTRANSFORM(hashtype, HMACMD5Auth)) {
- if (!EVP_DigestInit(ctx, EVP_md5()))
-@@ -259,11 +259,10 @@ generate_Ku(const oid * hashtype, u_int
- memset(buf, 0, sizeof(buf));
- #ifdef NETSNMP_USE_OPENSSL
- if (ctx) {
--#ifdef HAVE_EVP_MD_CTX_DESTROY
-+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
- EVP_MD_CTX_destroy(ctx);
- #else
-- EVP_MD_CTX_cleanup(ctx);
-- free(ctx);
-+ EVP_MD_CTX_free(ctx);
- #endif
- }
- #endif
---- snmplib/scapi.c
-+++ snmplib/scapi.c
-@@ -486,15 +486,10 @@ sc_hash(const oid * hashtype, size_t has
- }
-
- /** initialize the pointer */
--#ifdef HAVE_EVP_MD_CTX_CREATE
-+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
- cptr = EVP_MD_CTX_create();
- #else
-- cptr = malloc(sizeof(*cptr));
--#if defined(OLD_DES)
-- memset(cptr, 0, sizeof(*cptr));
--#else
-- EVP_MD_CTX_init(cptr);
--#endif
-+ cptr = EVP_MD_CTX_new();
- #endif
- if (!EVP_DigestInit(cptr, hashfn)) {
- /* requested hash function is not available */
-@@ -507,13 +502,11 @@ sc_hash(const oid * hashtype, size_t has
- /** do the final pass */
- EVP_DigestFinal(cptr, MAC, &tmp_len);
- *MAC_len = tmp_len;
--#ifdef HAVE_EVP_MD_CTX_DESTROY
-+
-+#if (OPENSSL_VERSION_NUMBER < 0x10100000L) || defined(LIBRESSL_VERSION_NUMBER)
- EVP_MD_CTX_destroy(cptr);
- #else
--#if !defined(OLD_DES)
-- EVP_MD_CTX_cleanup(cptr);
--#endif
-- free(cptr);
-+ EVP_MD_CTX_free(cptr);
- #endif
- return (rval);
-
-
---- snmplib/snmp_openssl.c 2014-12-08 21:23:22.000000000 +0100
-+++ snmplib/snmp_openssl.c 2017-02-20 12:46:00.059727928 +0100
-@@ -47,7 +47,7 @@ void netsnmp_init_openssl(void) {
- DEBUGMSGTL(("snmp_openssl", "initializing\n"));
-
- /* Initializing OpenSSL */
-- SSL_library_init();
-+ OPENSSL_init_ssl(0, NULL);
- SSL_load_error_strings();
- ERR_load_BIO_strings();
- OpenSSL_add_all_algorithms();
-@@ -164,11 +164,11 @@ netsnmp_openssl_cert_dump_names(X509 *oc
- oname_entry = X509_NAME_get_entry(osubj_name, i);
- netsnmp_assert(NULL != oname_entry);
-
-- if (oname_entry->value->type != V_ASN1_PRINTABLESTRING)
-+ if (X509_NAME_ENTRY_get_data(oname_entry)->type != V_ASN1_PRINTABLESTRING)
- continue;
-
- /** get NID */
-- onid = OBJ_obj2nid(oname_entry->object);
-+ onid = OBJ_obj2nid(X509_NAME_ENTRY_get_object(oname_entry));
- if (onid == NID_undef) {
- prefix_long = prefix_short = "UNKNOWN";
- }
-@@ -179,9 +179,9 @@ netsnmp_openssl_cert_dump_names(X509 *oc
-
- DEBUGMSGT(("9:cert:dump:names",
- "[%02d] NID type %d, ASN type %d\n", i, onid,
-- oname_entry->value->type));
-+ X509_NAME_ENTRY_get_data(oname_entry)->type));
- DEBUGMSGT(("9:cert:dump:names", "%s/%s: '%s'\n", prefix_long,
-- prefix_short, ASN1_STRING_data(oname_entry->value)));
-+ prefix_short, ASN1_STRING_data(X509_NAME_ENTRY_get_data(oname_entry))));
- }
- }
- #endif /* NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES */
-@@ -470,7 +470,7 @@ netsnmp_openssl_cert_get_hash_type(X509
- if (NULL == ocert)
- return 0;
-
-- return _nid2ht(OBJ_obj2nid(ocert->sig_alg->algorithm));
-+ return _nid2ht(X509_get_signature_nid(ocert));
- }
-
- /**
-@@ -487,7 +487,7 @@ netsnmp_openssl_cert_get_fingerprint(X50
- if (NULL == ocert)
- return NULL;
-
-- nid = OBJ_obj2nid(ocert->sig_alg->algorithm);
-+ nid = X509_get_signature_nid(ocert);
- DEBUGMSGT(("9:openssl:fingerprint", "alg %d, cert nid %d (%d)\n", alg, nid,
- _nid2ht(nid)));
-
-
diff --git a/net-mgmt/net-snmp/files/patch-Makefile.in b/net-mgmt/net-snmp/files/patch-Makefile.in
index 839d7a86dbd5..98fc1bca0a3e 100644
--- a/net-mgmt/net-snmp/files/patch-Makefile.in
+++ b/net-mgmt/net-snmp/files/patch-Makefile.in
@@ -1,19 +1,19 @@
---- Makefile.in.orig 2014-12-08 20:23:22 UTC
+--- Makefile.in.orig 2018-07-16 14:33:40 UTC
+++ Makefile.in
-@@ -21,7 +21,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi
- darwin.h darwin7.h darwin8.h darwin9.h darwin10.h dragonfly.h dynix.h \
+@@ -22,7 +22,7 @@ INCLUDESUBDIRHEADERS= aix.h bsd.h bsdi3.h bsdi4.h bsdi
+ dragonfly.h dynix.h \
freebsd2.h freebsd3.h freebsd4.h freebsd5.h freebsd6.h \
freebsd7.h freebsd8.h freebsd9.h freebsd10.h freebsd11.h \
-- freebsd12.h freebsd.h \
-+ freebsd12.h freebsd13.h freebsd.h \
- generic.h \
- hpux.h irix.h linux.h mingw32.h mips.h netbsd.h osf5.h \
- openbsd.h openbsd5.h openbsd4.h \
-@@ -230,7 +230,7 @@ pythonmodules: subdirs
+- freebsd12.h freebsd.h kfreebsd.h \
++ freebsd12.h freebsd13.h freebsd.h kfreebsd.h \
+ generic.h \
+ hpux.h irix.h linux.h mingw32.h mingw32msvc.h mips.h \
+ netbsd.h nto-qnx6.h osf5.h \
+@@ -234,7 +234,7 @@ pythonmodules: subdirs
fi
pythoninstall:
-- @(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir) ; \
+- @(dir=`pwd`; cd python; $(PYMAKE) install --basedir=$$dir --root=$(DESTDIR) --prefix=$(prefix)) ; \
+ @(dir=`pwd`; cd python; $(PYMAKE) install --root=${STAGEDIR} --basedir=$$dir ${PYDISTUTILS_INSTALLARGS}) ; \
if test $$? != 0 ; then \
exit 1 ; \
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c
index 393c135c11b0..3a79088910fb 100644
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu_sysctl.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c
@@ -1,6 +1,6 @@
---- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig 2014-12-08 12:23:22.000000000 -0800
-+++ agent/mibgroup/hardware/cpu/cpu_sysctl.c 2017-04-20 15:05:11.607496000 -0700
-@@ -130,8 +130,21 @@
+--- agent/mibgroup/hardware/cpu/cpu_sysctl.c.orig 2018-07-16 14:33:40 UTC
++++ agent/mibgroup/hardware/cpu/cpu_sysctl.c
+@@ -133,8 +133,21 @@ void init_cpu_sysctl( void ) {
#endif /* VM_UVMEXP2 || VM_UVMEXP */
#elif defined(__FreeBSD__) /* FreeBSD */
@@ -23,7 +23,7 @@
#define NS_VM_INTR v_intr
#define NS_VM_SWTCH v_swtch
#define NS_VM_PAGEIN v_swappgsin
-@@ -206,7 +219,23 @@
+@@ -209,7 +222,23 @@ int netsnmp_cpu_arch_load( netsnmp_cache *cache, void
* Interrupt/Context Switch statistics
* XXX - Do these really belong here ?
*/
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c
deleted file mode 100644
index 564f3eabbb6d..000000000000
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_fsys_fsys__getfsstats.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- agent/mibgroup/hardware/fsys/fsys_getfsstats.c.orig 2017-03-22 16:28:29 UTC
-+++ agent/mibgroup/hardware/fsys/fsys_getfsstats.c
-@@ -116,7 +116,7 @@ netsnmp_fsys_arch_load( void )
- /*
- * Retrieve information about the currently mounted filesystems...
- */
-- n = NSFS_GETFSSTAT( NULL, 0, 0 );
-+ n = NSFS_GETFSSTAT( NULL, 0, MNT_NOWAIT );
- if ( n==0 )
- return;
- stats = (struct NSFS_STATFS *)malloc( n * sizeof( struct NSFS_STATFS ));
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c
index e5204974a550..c62eebe57ed0 100644
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_hardware_memory_memory__freebsd.c
@@ -1,6 +1,6 @@
---- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2015-02-20 14:44:47 UTC
+--- agent/mibgroup/hardware/memory/memory_freebsd.c.orig 2018-07-16 14:33:40 UTC
+++ agent/mibgroup/hardware/memory/memory_freebsd.c
-@@ -163,7 +163,7 @@ int netsnmp_mem_arch_load( netsnmp_cache
+@@ -163,7 +163,7 @@ int netsnmp_mem_arch_load( netsnmp_cache *cache, void
if (!mem->descr)
mem->descr = strdup("Cached memory");
mem->units = pagesize;
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h
index a2cabd06bc01..66dc58969266 100644
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_icmp.h
@@ -1,11 +1,9 @@
---- agent/mibgroup/mibII/icmp.h.orig 2014-12-08 20:23:22 UTC
-+++ agent/mibgroup/mibII/icmp.h
-@@ -14,6 +14,9 @@ config_arch_require(freebsd7, mibII/ker
- config_arch_require(freebsd8, mibII/kernel_sysctl)
- config_arch_require(freebsd9, mibII/kernel_sysctl)
+--- agent/mibgroup/mibII/icmp.h.orig 2018-07-16 16:33:40.000000000 +0200
++++ agent/mibgroup/mibII/icmp.h 2019-06-15 17:15:20.270320000 +0200
+@@ -16,6 +16,7 @@
config_arch_require(freebsd10, mibII/kernel_sysctl)
-+config_arch_require(freebsd11, mibII/kernel_sysctl)
-+config_arch_require(freebsd12, mibII/kernel_sysctl)
+ config_arch_require(freebsd11, mibII/kernel_sysctl)
+ config_arch_require(freebsd12, mibII/kernel_sysctl)
+config_arch_require(freebsd13, mibII/kernel_sysctl)
config_arch_require(netbsd, mibII/kernel_netbsd)
config_arch_require(netbsdelf, mibII/kernel_netbsd)
diff --git a/net-mgmt/net-snmp/files/patch-tcpTable.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcpTable.c
index 03b2e57707f1..ffe8f029b866 100644
--- a/net-mgmt/net-snmp/files/patch-tcpTable.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_tcpTable.c
@@ -1,6 +1,6 @@
---- agent/mibgroup/mibII/tcpTable.c.orig 2017-03-15 17:46:37.000000000 +0000
-+++ agent/mibgroup/mibII/tcpTable.c 2017-03-15 17:46:37.000000000 +0000
-@@ -96,7 +96,11 @@
+--- agent/mibgroup/mibII/tcpTable.c.orig 2018-07-16 14:33:40 UTC
++++ agent/mibgroup/mibII/tcpTable.c
+@@ -120,7 +120,11 @@ struct netsnmp_tcpConnEntry_s {
typedef struct netsnmp_inpcb_s netsnmp_inpcb;
struct netsnmp_inpcb_s {
@@ -12,7 +12,7 @@
int state;
netsnmp_inpcb *inp_next;
};
-@@ -301,8 +305,10 @@
+@@ -330,8 +334,10 @@ tcpTable_handler(netsnmp_mib_handler *handler
#ifndef NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS
int
TCP_Count_Connections( void ) {
@@ -23,7 +23,7 @@
}
#endif /* NETSNMP_FEATURE_REMOVE_TCP_COUNT_CONNECTIONS */
-@@ -923,12 +929,20 @@
+@@ -988,12 +994,20 @@ tcpTable_load(netsnmp_cache *cache, void *vmagic)
nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
if (!nnew)
break;
@@ -42,5 +42,5 @@
sizeof(struct inpcb));
+#endif
- if (nnew->pcb.inp_vflag & INP_IPV6)
- free(nnew);
+ #ifdef INP_ISIPV6
+ if (INP_ISIPV6(&nnew->pcb))
diff --git a/net-mgmt/net-snmp/files/patch-udpTable.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_udpTable.c
index 4160298e6f02..9ed2ae82225c 100644
--- a/net-mgmt/net-snmp/files/patch-udpTable.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_mibII_udpTable.c
@@ -1,6 +1,6 @@
---- agent/mibgroup/mibII/udpTable.c.orig 2017-03-15 18:08:43.000000000 +0000
-+++ agent/mibgroup/mibII/udpTable.c 2017-03-15 18:08:43.000000000 +0000
-@@ -71,7 +71,11 @@
+--- agent/mibgroup/mibII/udpTable.c.orig 2018-07-16 14:33:40 UTC
++++ agent/mibgroup/mibII/udpTable.c
+@@ -97,7 +97,11 @@ struct netsnmp_udpEntry_s {
#if defined(freebsd4) || defined(darwin) || defined(osf5)
typedef struct netsnmp_inpcb_s netsnmp_inpcb;
struct netsnmp_inpcb_s {
@@ -12,7 +12,7 @@
int state;
netsnmp_inpcb *inp_next;
};
-@@ -670,7 +674,11 @@
+@@ -708,7 +712,11 @@ udpTable_load(netsnmp_cache *cache, void *vmagic)
nnew = SNMP_MALLOC_TYPEDEF(UDPTABLE_ENTRY_TYPE);
if (!nnew)
break;
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
index be881f1fd7c0..568471c0b2ec 100644
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_tcp-mib_data__access_tcpConn__freebsd4.c
@@ -1,6 +1,6 @@
---- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig 2017-03-15 18:15:07.000000000 +0000
-+++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c 2017-03-15 18:15:07.000000000 +0000
-@@ -163,7 +163,11 @@
+--- agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c.orig 2018-07-16 14:33:40 UTC
++++ agent/mibgroup/tcp-mib/data_access/tcpConn_freebsd4.c
+@@ -163,7 +163,11 @@ _load(netsnmp_container *container, u_int load_flags)
#else
xig = (struct xinpgen *) ((char *) xig + xig->xig_len);
#endif
@@ -12,12 +12,12 @@
if (load_flags) {
if (state == TCPCONNECTIONSTATE_LISTEN) {
-@@ -215,6 +219,8 @@
+@@ -223,6 +227,8 @@ _load(netsnmp_container *container, u_int load_flags)
entry->arbitrary_index = CONTAINER_SIZE(container) + 1;
CONTAINER_INSERT(container, entry);
}
+
+ free(tcpcb_buf);
- if(rc<0)
- return rc;
+ free(tcpcb_buf);
+
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c
deleted file mode 100644
index c4e4f671cc94..000000000000
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_ucd-snmp_diskio.c
+++ /dev/null
@@ -1,54 +0,0 @@
---- agent/mibgroup/ucd-snmp/diskio.c.orig 2014-12-08 20:23:22 UTC
-+++ agent/mibgroup/ucd-snmp/diskio.c
-@@ -944,14 +944,14 @@ var_diskio(struct variable * vp,
- return (u_char *) stat->dinfo->devices[indx].device_name;
- case DISKIO_NREAD:
- #if HAVE_DEVSTAT_GETDEVS
-- long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
-+ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_READ] & 0xFFFFFFFF;
- #else
- long_ret = (signed long) stat->dinfo->devices[indx].bytes_read;
- #endif
- return (u_char *) & long_ret;
- case DISKIO_NWRITTEN:
- #if HAVE_DEVSTAT_GETDEVS
-- long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
-+ long_ret = (signed long) stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE] & 0xFFFFFFFF;
- #else
- long_ret = (signed long) stat->dinfo->devices[indx].bytes_written;
- #endif
-@@ -959,7 +959,7 @@ var_diskio(struct variable * vp,
- case DISKIO_NREADX:
- *var_len = sizeof(struct counter64);
- #if HAVE_DEVSTAT_GETDEVS
-- longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ];
-+ longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_READ] & 0xFFFFFFFF;
- #else
- longlong_ret = stat->dinfo->devices[indx].bytes_read;
- #endif
-@@ -969,7 +969,7 @@ var_diskio(struct variable * vp,
- case DISKIO_NWRITTENX:
- *var_len = sizeof(struct counter64);
- #if HAVE_DEVSTAT_GETDEVS
-- longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE];
-+ longlong_ret = stat->dinfo->devices[indx].bytes[DEVSTAT_WRITE] & 0xFFFFFFFF;
- #else
- longlong_ret = stat->dinfo->devices[indx].bytes_written;
- #endif
-@@ -978,14 +978,14 @@ var_diskio(struct variable * vp,
- return (u_char *) & c64_ret;
- case DISKIO_READS:
- #if HAVE_DEVSTAT_GETDEVS
-- long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ];
-+ long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_READ] & 0xFFFFFFFF;
- #else
- long_ret = (signed long) stat->dinfo->devices[indx].num_reads;
- #endif
- return (u_char *) & long_ret;
- case DISKIO_WRITES:
- #if HAVE_DEVSTAT_GETDEVS
-- long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE];
-+ long_ret = (signed long) stat->dinfo->devices[indx].operations[DEVSTAT_WRITE] & 0xFFFFFFFF;
- #else
- long_ret = (signed long) stat->dinfo->devices[indx].num_writes;
- #endif
diff --git a/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c b/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
index e409a9990b3d..3752d85e5286 100644
--- a/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
+++ b/net-mgmt/net-snmp/files/patch-agent_mibgroup_udp-mib_data__access_udp__endpoint__freebsd4.c
@@ -1,18 +1,6 @@
---- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig 2014-12-08 12:23:22.000000000 -0800
-+++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c 2017-04-07 16:05:05.752849000 -0700
-@@ -153,7 +153,11 @@
- #endif
-
- #if !defined(NETSNMP_ENABLE_IPV6)
-+#if __FreeBSD_version >= 1200026
-+ if (pcb.inp_vflag & INP_IPV6)
-+#else
- if (pcb.xi_inp.inp_vflag & INP_IPV6)
-+#endif
- continue;
- #endif
-
-@@ -164,9 +168,24 @@
+--- agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c.orig 2018-07-16 14:33:40 UTC
++++ agent/mibgroup/udp-mib/data_access/udp_endpoint_freebsd4.c
+@@ -168,9 +168,24 @@ _load(netsnmp_container *container, u_int load_flags)
}
/** oddly enough, these appear to already be in network order */
@@ -37,8 +25,8 @@
- entry->pid = 0;
/** the addr string may need work */
- if (pcb.xi_inp.inp_vflag & INP_IPV6) {
-@@ -179,6 +198,8 @@
+ #ifdef INP_ISIPV6
+@@ -187,6 +202,8 @@ _load(netsnmp_container *container, u_int load_flags)
memcpy(entry->loc_addr, &pcb.xi_inp.inp_laddr, 4);
memcpy(entry->rmt_addr, &pcb.xi_inp.inp_faddr, 4);
}
@@ -47,12 +35,12 @@
/*
* add entry to container
-@@ -187,6 +208,8 @@
+@@ -194,6 +211,8 @@ _load(netsnmp_container *container, u_int load_flags)
+ entry->index = CONTAINER_SIZE(container) + 1;
CONTAINER_INSERT(container, entry);
}
-
-+ free(udpcb_buf);
+
- if(rc<0)
- return rc;
++ free(udpcb_buf);
+
+ free(udpcb_buf);
diff --git a/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in b/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in
deleted file mode 100644
index 5aae1ccb4262..000000000000
--- a/net-mgmt/net-snmp/files/patch-include__net-snmp__net-snmp-config.h.in
+++ /dev/null
@@ -1,11 +0,0 @@
---- ./include/net-snmp/net-snmp-config.h.in.orig 2012-10-09 18:28:58.000000000 -0400
-+++ ./include/net-snmp/net-snmp-config.h.in 2012-10-14 11:37:35.000000000 -0400
-@@ -2106,7 +2106,7 @@
- #define UCD_SNMP_LIBRARY 1
-
- /* final conclusion on nlist usage */
--#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && defined(HAVE_KMEM) && !defined(NETSNMP_NO_KMEM_USAGE)
-+#if defined(HAVE_NLIST) && defined(HAVE_STRUCT_NLIST_N_VALUE) && !defined(NETSNMP_DONT_USE_NLIST) && !defined(NETSNMP_NO_KMEM_USAGE)
- #define NETSNMP_CAN_USE_NLIST
- #endif
-
diff --git a/net-mgmt/net-snmp/files/patch-include_net-snmp_library_transform__oids.h b/net-mgmt/net-snmp/files/patch-include_net-snmp_library_transform__oids.h
new file mode 100644
index 000000000000..539f2aca2b1e
--- /dev/null
+++ b/net-mgmt/net-snmp/files/patch-include_net-snmp_library_transform__oids.h
@@ -0,0 +1,11 @@
+--- include/net-snmp/library/transform_oids.h.orig 2018-07-16 14:33:40 UTC
++++ include/net-snmp/library/transform_oids.h
+@@ -48,6 +48,8 @@ NETSNMP_IMPORT oid usmDESPrivProtocol[10];
+
+ NETSNMP_IMPORT oid usmAESPrivProtocol[10];
+ NETSNMP_IMPORT oid *usmAES128PrivProtocol; /* backwards compat */
++NETSNMP_IMPORT oid *usmAES192PrivProtocol; /* backwards compat */
++NETSNMP_IMPORT oid *usmAES256PrivProtocol; /* backwards compat */
+
+ /*
+ * backwards compatibility. should not be used in internal code.
diff --git a/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h b/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h
index 254465996a98..d1782cf032ef 100644
--- a/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h
+++ b/net-mgmt/net-snmp/files/patch-include_net-snmp_system_freebsd13.h
@@ -1,6 +1,6 @@
---- include/net-snmp/system/freebsd13.h.orig 2018-12-25 15:35:28 UTC
+--- include/net-snmp/system/freebsd13.h.orig 2019-03-07 15:59:25 UTC
+++ include/net-snmp/system/freebsd13.h
@@ -0,0 +1,3 @@
-+/* freebsd13 is a superset of freebsd12 */
-+#include "freebsd12.h"
-+#define freebsd13 freebsd13
++/* freebsd12 is a superset of freebsd11 */
++#include "freebsd11.h"
++#define freebsd11 freebsd11
diff --git a/net-mgmt/net-snmp/files/patch-kthreads b/net-mgmt/net-snmp/files/patch-kthreads
deleted file mode 100644
index 30971a1d13f2..000000000000
--- a/net-mgmt/net-snmp/files/patch-kthreads
+++ /dev/null
@@ -1,96 +0,0 @@
-diff --git a/agent/mibgroup/host/data_access/swrun.c b/agent/mibgroup/host/data_access/swrun.c
-index d18ea5f..60ad5b4 100644
---- agent/mibgroup/host/data_access/swrun.c
-+++ agent/mibgroup/host/data_access/swrun.c
-@@ -75,10 +75,27 @@ shutdown_swrun(void)
- }
-
- int
--swrun_count_processes( void )
-+swrun_count_processes(int include_kthreads)
- {
-+ netsnmp_swrun_entry *entry;
-+ netsnmp_iterator *it;
-+ int i = 0;
-+
- netsnmp_cache_check_and_reload(swrun_cache);
-- return ( swrun_container ? CONTAINER_SIZE(swrun_container) : 0 );
-+ if ( !swrun_container )
-+ return 0; /* or -1 */
-+
-+ if (include_kthreads)
-+ return ( swrun_container ? CONTAINER_SIZE(swrun_container) : 0 );
-+
-+ it = CONTAINER_ITERATOR( swrun_container );
-+ while ((entry = (netsnmp_swrun_entry*)ITERATOR_NEXT( it )) != NULL) {
-+ if (4 == entry->hrSWRunType)
-+ i++;
-+ }
-+ ITERATOR_RELEASE( it );
-+
-+ return i;
- }
-
- #ifndef NETSNMP_FEATURE_REMOVE_SWRUN_MAX_PROCESSES
-diff --git a/agent/mibgroup/host/hr_system.c b/agent/mibgroup/host/hr_system.c
-index d99cc7d..e853779 100644
---- agent/mibgroup/host/hr_system.c
-+++ agent/mibgroup/host/hr_system.c
-@@ -24,6 +24,7 @@
-
- #include <net-snmp/net-snmp-includes.h>
- #include <net-snmp/agent/net-snmp-agent-includes.h>
-+#include <net-snmp/data_access/swrun.h>
-
- #include "host.h"
- #include "host_res.h"
-@@ -114,7 +115,14 @@ static long get_max_solaris_processes(void);
- static int get_load_dev(void);
- static int count_users(void);
- extern int count_processes(void);
--extern int swrun_count_processes(void);
-+#if USING_HOST_DATA_ACCESS_SWRUN_MODULE
-+static int count_kthreads = 0;
-+
-+static void parse_count_kthreads(const char *token, const char *line)
-+{
-+ count_kthreads = atoi(line);
-+}
-+#endif
-
- /*********************
- *
-@@ -194,6 +202,11 @@ init_hr_system(void)
- #ifdef NPROC_SYMBOL
- auto_nlist(NPROC_SYMBOL, 0, 0);
- #endif
-+#if USING_HOST_DATA_ACCESS_SWRUN_MODULE
-+ snmpd_register_const_config_handler("count_kthreads",
-+ parse_count_kthreads, NULL,
-+ "0|1 0 to exclude kernel threads from hrSystemProcesses.0");
-+#endif
-
- REGISTER_MIB("host/hr_system", hrsystem_variables, variable2,
- hrsystem_variables_oid);
-@@ -317,7 +330,7 @@ var_hrsys(struct variable * vp,
- return (u_char *) & long_return;
- case HRSYS_PROCS:
- #if USING_HOST_DATA_ACCESS_SWRUN_MODULE
-- long_return = swrun_count_processes();
-+ long_return = swrun_count_processes(count_kthreads);
- #elif USING_HOST_HR_SWRUN_MODULE
- long_return = count_processes();
- #else
-diff --git a/include/net-snmp/data_access/swrun.h b/include/net-snmp/data_access/swrun.h
-index 3e15c41..4f768ac 100644
---- include/net-snmp/data_access/swrun.h
-+++ include/net-snmp/data_access/swrun.h
-@@ -85,7 +85,7 @@ extern "C" {
-
- void netsnmp_swrun_entry_free(netsnmp_swrun_entry *entry);
-
-- int swrun_count_processes( void );
-+ int swrun_count_processes( int include_kthreads );
- int swrun_max_processes( void );
- int swrun_count_processes_by_name( char *name );
-
diff --git a/net-mgmt/net-snmp/files/patch-perl5.23 b/net-mgmt/net-snmp/files/patch-perl5.23
deleted file mode 100644
index bb382f20ba2e..000000000000
--- a/net-mgmt/net-snmp/files/patch-perl5.23
+++ /dev/null
@@ -1,135 +0,0 @@
---- agent/snmp_perl.c.orig 2015-08-11 13:07:06 UTC
-+++ agent/snmp_perl.c
-@@ -5,6 +5,10 @@
- #include <EXTERN.h>
- #include "perl.h"
-
-+#ifdef U64TYPE
-+#define U64 U64pairU32
-+#endif
-+
- #include <net-snmp/net-snmp-config.h>
- #include <net-snmp/net-snmp-includes.h>
- #include <net-snmp/agent/net-snmp-agent-includes.h>
---- perl/OID/OID.xs.orig 2015-08-11 13:07:28 UTC
-+++ perl/OID/OID.xs
-@@ -7,6 +7,10 @@
- #include "perl.h"
- #include "XSUB.h"
-
-+#ifdef U64TYPE
-+#define U64 U64pairU32
-+#endif
-+
- #include <net-snmp/net-snmp-config.h>
- #include <net-snmp/net-snmp-includes.h>
-
---- perl/SNMP/SNMP.xs.orig 2015-08-11 13:07:54 UTC
-+++ perl/SNMP/SNMP.xs
-@@ -16,6 +16,10 @@
- #include "perl.h"
- #include "XSUB.h"
-
-+#ifdef U64TYPE
-+#define U64 U64pairU32
-+#endif
-+
- #include <net-snmp/net-snmp-config.h>
- #include <net-snmp/net-snmp-includes.h>
- #include <sys/types.h>
---- perl/TrapReceiver/TrapReceiver.xs.orig 2015-08-11 13:08:02 UTC
-+++ perl/TrapReceiver/TrapReceiver.xs
-@@ -9,6 +9,10 @@
-
- #include "ppport.h"
-
-+#ifdef U64TYPE
-+#define U64 U64pairU32
-+#endif
-+
- #include <net-snmp/net-snmp-config.h>
- #include <net-snmp/net-snmp-includes.h>
- #include <net-snmp/agent/net-snmp-agent-includes.h>
---- perl/agent/agent.xs.orig 2015-08-11 13:07:48 UTC
-+++ perl/agent/agent.xs
-@@ -9,6 +9,10 @@
- #include <netdb.h>
- #include <sys/socket.h>
-
-+#ifdef U64TYPE
-+#define U64 U64pairU32
-+#endif
-+
- #include <net-snmp/net-snmp-config.h>
- #include <net-snmp/net-snmp-includes.h>
- #include <net-snmp/agent/net-snmp-agent-includes.h>
---- perl/ASN/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/ASN/Makefile.PL
-@@ -1,3 +1,4 @@
-+package ASN;
- use ExtUtils::MakeMaker;
- require 5;
- use Config;
---- perl/AnyData_SNMP/Makefile.PL.orig 2015-09-03 22:27:45 UTC
-+++ perl/AnyData_SNMP/Makefile.PL
-@@ -1,3 +1,4 @@
-+package AnyData_SNMP;
- use ExtUtils::MakeMaker;
- # See lib/ExtUtils/MakeMaker.pm for details of how to influence
- # the contents of the Makefile that is written.
---- perl/OID/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/OID/Makefile.PL
-@@ -1,3 +1,4 @@
-+package OID;
- # See lib/ExtUtils/MakeMaker.pm for details of how to influence
- # the contents of the Makefile that is written.
-
---- perl/SNMP/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/SNMP/Makefile.PL
-@@ -1,3 +1,4 @@
-+package SNMP;
- use ExtUtils::MakeMaker;
- require 5;
- use Config;
---- perl/TrapReceiver/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/TrapReceiver/Makefile.PL
-@@ -1,3 +1,4 @@
-+package TrapReceiver;
- use ExtUtils::MakeMaker;
- require 5;
- use Config;
---- perl/agent/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/agent/Makefile.PL
-@@ -1,3 +1,4 @@
-+package agent;
- use ExtUtils::MakeMaker;
- require 5;
- use Config;
---- perl/agent/Support/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/agent/Support/Makefile.PL
-@@ -1,3 +1,4 @@
-+package agent_Support;
- use ExtUtils::MakeMaker;
- require 5;
- use Config;
---- perl/agent/default_store/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/agent/default_store/Makefile.PL
-@@ -1,3 +1,4 @@
-+package agent_default_store;
- use ExtUtils::MakeMaker;
- require 5;
- use Config;
---- perl/default_store/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/default_store/Makefile.PL
-@@ -1,3 +1,4 @@
-+package default_store;
- use ExtUtils::MakeMaker;
- require 5;
- use Config;
---- perl/manager/Makefile.PL.orig 2014-12-08 20:23:22 UTC
-+++ perl/manager/Makefile.PL
-@@ -1,3 +1,4 @@
-+package manager;
- use ExtUtils::MakeMaker;
- # See lib/ExtUtils/MakeMaker.pm for details of how to influence
- # the contents of the Makefile that is written.
diff --git a/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c b/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c
deleted file mode 100644
index 5d9f8a9029eb..000000000000
--- a/net-mgmt/net-snmp/files/patch-snmplib_snmp__api.c
+++ /dev/null
@@ -1,117 +0,0 @@
---- snmplib/snmp_api.c.orig 2014-12-08 20:23:22 UTC
-+++ snmplib/snmp_api.c
-@@ -4350,10 +4350,9 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
- u_char type;
- u_char msg_type;
- u_char *var_val;
-- int badtype = 0;
- size_t len;
- size_t four;
-- netsnmp_variable_list *vp = NULL;
-+ netsnmp_variable_list *vp = NULL, *vplast = NULL;
- oid objid[MAX_OID_LEN];
- u_char *p;
-
-@@ -4493,38 +4492,24 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
- (ASN_SEQUENCE | ASN_CONSTRUCTOR),
- "varbinds");
- if (data == NULL)
-- return -1;
-+ goto fail;
-
- /*
- * get each varBind sequence
- */
- while ((int) *length > 0) {
-- netsnmp_variable_list *vptemp;
-- vptemp = (netsnmp_variable_list *) malloc(sizeof(*vptemp));
-- if (NULL == vptemp) {
-- return -1;
-- }
-- if (NULL == vp) {
-- pdu->variables = vptemp;
-- } else {
-- vp->next_variable = vptemp;
-- }
-- vp = vptemp;
-+ vp = SNMP_MALLOC_TYPEDEF(netsnmp_variable_list);
-+ if (NULL == vp)
-+ goto fail;
-
-- vp->next_variable = NULL;
-- vp->val.string = NULL;
- vp->name_length = MAX_OID_LEN;
-- vp->name = NULL;
-- vp->index = 0;
-- vp->data = NULL;
-- vp->dataFreeHook = NULL;
- DEBUGDUMPSECTION("recv", "VarBind");
- data = snmp_parse_var_op(data, objid, &vp->name_length, &vp->type,
- &vp->val_len, &var_val, length);
- if (data == NULL)
-- return -1;
-+ goto fail;
- if (snmp_set_var_objid(vp, objid, vp->name_length))
-- return -1;
-+ goto fail;
-
- len = MAX_PACKET_LENGTH;
- DEBUGDUMPHEADER("recv", "Value");
-@@ -4604,7 +4589,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
- vp->val.string = (u_char *) malloc(vp->val_len);
- }
- if (vp->val.string == NULL) {
-- return -1;
-+ goto fail;
- }
- p = asn_parse_string(var_val, &len, &vp->type, vp->val.string,
- &vp->val_len);
-@@ -4619,7 +4604,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
- vp->val_len *= sizeof(oid);
- vp->val.objid = (oid *) malloc(vp->val_len);
- if (vp->val.objid == NULL) {
-- return -1;
-+ goto fail;
- }
- memmove(vp->val.objid, objid, vp->val_len);
- break;
-@@ -4631,7 +4616,7 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
- case ASN_BIT_STR:
- vp->val.bitstring = (u_char *) malloc(vp->val_len);
- if (vp->val.bitstring == NULL) {
-- return -1;
-+ goto fail;
- }
- p = asn_parse_bitstring(var_val, &len, &vp->type,
- vp->val.bitstring, &vp->val_len);
-@@ -4640,12 +4625,28 @@ snmp_pdu_parse(netsnmp_pdu *pdu, u_char
- break;
- default:
- snmp_log(LOG_ERR, "bad type returned (%x)\n", vp->type);
-- badtype = -1;
-+ goto fail;
- break;
- }
- DEBUGINDENTADD(-4);
-+
-+ if (NULL == vplast) {
-+ pdu->variables = vp;
-+ } else {
-+ vplast->next_variable = vp;
-+ }
-+ vplast = vp;
-+ vp = NULL;
- }
-- return badtype;
-+ return 0;
-+
-+ fail:
-+ DEBUGMSGTL(("recv", "error while parsing VarBindList\n"));
-+ /** if we were parsing a var, remove it from the pdu and free it */
-+ if (vp)
-+ snmp_free_var(vp);
-+
-+ return -1;
- }
-
- /*
diff --git a/net-mgmt/net-snmp/files/patch-snmplib_snmpusm.c b/net-mgmt/net-snmp/files/patch-snmplib_snmpusm.c
new file mode 100644
index 000000000000..c4361b5c24a3
--- /dev/null
+++ b/net-mgmt/net-snmp/files/patch-snmplib_snmpusm.c
@@ -0,0 +1,11 @@
+--- snmplib/snmpusm.c.orig 2018-07-16 14:33:40 UTC
++++ snmplib/snmpusm.c
+@@ -117,6 +117,8 @@ oid usmDESPrivProtocol[10] = { 1, 3, 6, 1,
+ oid usmAESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 };
+ /* backwards compat */
+ oid *usmAES128PrivProtocol = usmAESPrivProtocol;
++oid *usmAES192PrivProtocol = usmAESPrivProtocol;
++oid *usmAES256PrivProtocol = usmAESPrivProtocol;
+
+ #ifdef NETSNMP_DRAFT_BLUMENTHAL_AES_04
+ /* OIDs from http://www.snmp.com/eso/esoConsortiumMIB.txt */
diff --git a/net-mgmt/net-snmp/files/patch-snmpusm.c b/net-mgmt/net-snmp/files/patch-snmpusm.c
deleted file mode 100644
index e8d8b7bc7d1b..000000000000
--- a/net-mgmt/net-snmp/files/patch-snmpusm.c
+++ /dev/null
@@ -1,11 +0,0 @@
---- snmplib/snmpusm.c.orig 2011-07-27 09:58:24.000000000 -0300
-+++ snmplib/snmpusm.c 2011-07-27 09:57:48.000000000 -0300
-@@ -91,6 +91,8 @@
- oid usmAESPrivProtocol[10] = { 1, 3, 6, 1, 6, 3, 10, 1, 2, 4 };
- /* backwards compat */
- oid *usmAES128PrivProtocol = usmAESPrivProtocol;
-+oid *usmAES192PrivProtocol = usmAESPrivProtocol;
-+oid *usmAES256PrivProtocol = usmAESPrivProtocol;
-
- static u_int dummy_etime, dummy_eboot; /* For ISENGINEKNOWN(). */
-
diff --git a/net-mgmt/net-snmp/files/patch-transform_oids.h b/net-mgmt/net-snmp/files/patch-transform_oids.h
deleted file mode 100644
index 674d4c1acb22..000000000000
--- a/net-mgmt/net-snmp/files/patch-transform_oids.h
+++ /dev/null
@@ -1,11 +0,0 @@
---- include/net-snmp/library/transform_oids.h.orig 2006-10-28 05:19:44.000000000 +0900
-+++ include/net-snmp/library/transform_oids.h 2008-03-26 07:50:45.393507729 +0900
-@@ -23,6 +23,8 @@
- /* XXX: OIDs not defined yet */
- NETSNMP_IMPORT oid usmAESPrivProtocol[10]; /* == { 1,3,6,1,6,3,10,1,2,4 }; */
- NETSNMP_IMPORT oid *usmAES128PrivProtocol; /* backwards compat */
-+NETSNMP_IMPORT oid *usmAES192PrivProtocol; /* backwards compat */
-+NETSNMP_IMPORT oid *usmAES256PrivProtocol; /* backwards compat */
-
- #define USM_AUTH_PROTO_NOAUTH_LEN 10
- #define USM_AUTH_PROTO_MD5_LEN 10
diff --git a/net-mgmt/net-snmp/pkg-plist b/net-mgmt/net-snmp/pkg-plist
index 393a24e3d944..895268b2540f 100644
--- a/net-mgmt/net-snmp/pkg-plist
+++ b/net-mgmt/net-snmp/pkg-plist
@@ -1,4 +1,5 @@
bin/agentxtrap
+bin/checkbandwidth
bin/encode_keychange
bin/fixproc
bin/ipf-mod.pl
@@ -18,11 +19,15 @@ bin/snmpget
bin/snmpgetnext
bin/snmpinform
bin/snmpnetstat
+bin/snmppcap
+bin/snmpping
+bin/snmpps
bin/snmpset
bin/snmpstatus
bin/snmptable
bin/snmptest
%%TLS%%bin/snmptls
+bin/snmptop
bin/snmptranslate
bin/snmptrap
bin/snmpusm
@@ -54,6 +59,7 @@ include/net-snmp/agent/mib_modules.h
include/net-snmp/agent/mode_end_call.h
include/net-snmp/agent/multiplexer.h
include/net-snmp/agent/net-snmp-agent-includes.h
+include/net-snmp/agent/netsnmp_close_fds.h
include/net-snmp/agent/null.h
include/net-snmp/agent/old_api.h
include/net-snmp/agent/read_only.h
@@ -110,6 +116,7 @@ include/net-snmp/library/lcd_time.h
include/net-snmp/library/md5.h
include/net-snmp/library/mib.h
include/net-snmp/library/mt_support.h
+include/net-snmp/library/netsnmp-attribute-format.h
include/net-snmp/library/oid_stash.h
include/net-snmp/library/parse.h
include/net-snmp/library/read_config.h
@@ -120,11 +127,11 @@ include/net-snmp/library/snmpAliasDomain.h
include/net-snmp/library/snmpCallbackDomain.h
%%TLS%%include/net-snmp/library/snmpDTLSUDPDomain.h
include/net-snmp/library/snmpTCPDomain.h
-%%WITH_IPV6%%include/net-snmp/library/snmpTCPIPv6Domain.h
+include/net-snmp/library/snmpTCPIPv6Domain.h
%%TLS%%include/net-snmp/library/snmpTLSBaseDomain.h
%%TLS%%include/net-snmp/library/snmpTLSTCPDomain.h
include/net-snmp/library/snmpUDPDomain.h
-%%WITH_IPV6%%include/net-snmp/library/snmpUDPIPv6Domain.h
+include/net-snmp/library/snmpUDPIPv6Domain.h
include/net-snmp/library/snmpUnixDomain.h
include/net-snmp/library/snmp_alarm.h
include/net-snmp/library/snmp_api.h
@@ -142,7 +149,7 @@ include/net-snmp/library/snmp_transport.h
include/net-snmp/library/snmpusm.h
include/net-snmp/library/snmpv3-security-includes.h
include/net-snmp/library/snmpv3.h
-%%WITH_IPV6%%include/net-snmp/library/snmpIPv6BaseDomain.h
+include/net-snmp/library/snmpIPv6BaseDomain.h
include/net-snmp/library/snmpUDPBaseDomain.h
include/net-snmp/library/snmpUDPIPv4BaseDomain.h
include/net-snmp/library/snmpTCPBaseDomain.h
@@ -177,6 +184,13 @@ include/net-snmp/system/darwin7.h
include/net-snmp/system/darwin8.h
include/net-snmp/system/darwin9.h
include/net-snmp/system/darwin10.h
+include/net-snmp/system/darwin11.h
+include/net-snmp/system/darwin12.h
+include/net-snmp/system/darwin13.h
+include/net-snmp/system/darwin14.h
+include/net-snmp/system/darwin15.h
+include/net-snmp/system/darwin16.h
+include/net-snmp/system/darwin17.h
include/net-snmp/system/dragonfly.h
include/net-snmp/system/dynix.h
include/net-snmp/system/freebsd.h
@@ -195,13 +209,17 @@ include/net-snmp/system/freebsd13.h
include/net-snmp/system/generic.h
include/net-snmp/system/hpux.h
include/net-snmp/system/irix.h
+include/net-snmp/system/kfreebsd.h
include/net-snmp/system/linux.h
include/net-snmp/system/mingw32.h
+include/net-snmp/system/mingw32msvc.h
include/net-snmp/system/mips.h
include/net-snmp/system/netbsd.h
+include/net-snmp/system/nto-qnx6.h
include/net-snmp/system/openbsd.h
include/net-snmp/system/openbsd4.h
include/net-snmp/system/openbsd5.h
+include/net-snmp/system/openbsd6.h
include/net-snmp/system/osf5.h
include/net-snmp/system/solaris.h
include/net-snmp/system/solaris2.3.h
@@ -254,6 +272,8 @@ man/man1/snmpget.1.gz
man/man1/snmpgetnext.1.gz
man/man1/snmpinform.1.gz
man/man1/snmpnetstat.1.gz
+man/man1/snmpps.1.gz
+man/man1/snmptop.1.gz
man/man1/snmpset.1.gz
man/man1/snmpstatus.1.gz
man/man1/snmptable.1.gz
@@ -376,7 +396,7 @@ man/man8/snmptrapd.8.gz
%%WITH_PERL%%man/man3/NetSNMP::default_store.3.gz
%%WITH_PERL%%man/man3/NetSNMP::netsnmp_request_infoPtr.3.gz
%%WITH_PERL%%man/man3/SNMP.3.gz
-%%WITH_PERL%%%%SITE_ARCH%%/Bundle/Makefile.subs.pl
+%%WITH_PERL%%%%SITE_ARCH%%/Bundle/MakefileSubs.pm
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/ASN.pm
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/OID.pm
%%WITH_PERL%%%%SITE_ARCH%%/NetSNMP/TrapReceiver.pm
@@ -431,6 +451,7 @@ sbin/snmptrapd
%%DATADIR%%/mib2c.mfd.conf
%%DATADIR%%/mib2c.notify.conf
%%DATADIR%%/mib2c.old-api.conf
+%%DATADIR%%/mib2c.org-mode.conf
%%DATADIR%%/mib2c.perl.conf
%%DATADIR%%/mib2c.raw-table.conf
%%DATADIR%%/mib2c.scalar.conf
@@ -553,6 +574,7 @@ sbin/snmptrapd
%%DATADIR%%/mibs/SNMP-USER-BASED-SM-MIB.txt
%%DATADIR%%/mibs/SNMP-USM-AES-MIB.txt
%%DATADIR%%/mibs/SNMP-USM-DH-OBJECTS-MIB.txt
+%%DATADIR%%/mibs/SNMP-USM-HMAC-SHA2-MIB.txt
%%DATADIR%%/mibs/SNMP-VIEW-BASED-ACM-MIB.txt
%%DATADIR%%/mibs/SNMPv2-CONF.txt
%%DATADIR%%/mibs/SNMPv2-MIB.txt
@@ -568,7 +590,7 @@ sbin/snmptrapd
%%DATADIR%%/mibs/UCD-IPFWACC-MIB.txt
%%DATADIR%%/mibs/UCD-SNMP-MIB.txt
%%DATADIR%%/mibs/UDP-MIB.txt
-@unexec rm -f %D/%%DATADIR%%/mibs/.index 2>/dev/null || true
+@preunexec rm -f %D/%%DATADIR%%/mibs/.index 2>/dev/null || true
%%WITH_PERL_EMBEDDED%%%%DATADIR%%/snmp_perl.pl
%%DATADIR%%/snmpconf-data/snmp-data/authopts
%%DATADIR%%/snmpconf-data/snmp-data/debugging