From d10b528e62f66d99f8d70a3144805a600b82819d3ecf22ca647d97423144fe8c Mon Sep 17 00:00:00 2001 From: Marcus Meissner Date: Mon, 15 Oct 2018 15:40:54 +0000 Subject: [PATCH] Accepting request 641283 from home:abergmann:branches:network:utilities - Update to net-snmp-5.8. Fixes included: * Fix remote DoS in agent/helpers/table.c (bsc#1111122, CVE-2018-18065) * Fix agentx freezing on timeout (bsc#1027353) * swintst_rpm: Protect against unspecified Group name (bsc#1102775) - Add tsm and tlstm MIBs and the USM security module. (bsc#1081164) - Rename and refactor patches and remove those that are already included inside the new version. Added: * net-snmp-5.8-socket-path.patch * net-snmp-5.8-testing-empty-arptable.patch * net-snmp-5.8-pie.patch * net-snmp-5.8-net-snmp-config-headercheck.patch * net-snmp-5.8-perl-tk-warning.patch * net-snmp-5.8-velocity-mib.patch * net-snmp-5.8-netgroups.patch * net-snmp-5.8-snmpstatus-suppress-output.patch * net-snmp-5.8-fix-Makefile.PL.patch * net-snmp-5.8-modern-rpm-api.patch * net-snmp-5.8-fix-python3.patch Removed: * net-snmp-5.7.3-socket-path.patch * net-snmp-5.7.3-testing-empty-arptable.patch * net-snmp-5.7.3-pie.patch * net-snmp-5.7.3-net-snmp-config-headercheck.patch * net-snmp-5.7.3-perl-tk-warning.patch * net-snmp-5.7.3-velocity-mib.patch * net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch * net-snmp-5.7.3-netgroups.patch * net-snmp-5.7.3-snmpstatus-suppress-output.patch OBS-URL: https://build.opensuse.org/request/show/641283 OBS-URL: https://build.opensuse.org/package/show/network:utilities/net-snmp?expand=0&rev=16 --- net-snmp-5.7.2-systemd.patch | 1650 ----------- net-snmp-5.7.3-Fix-Makefile.PL.patch | 23 - net-snmp-5.7.3-Remove-U64-typedef.patch | 2518 ----------------- net-snmp-5.7.3-build-with-openssl-1.1.patch | 1287 --------- ...-5.7.3-fix-snmp_pdu_parse-incomplete.patch | 120 - ...-crashing-when-an-agentx-disconnects.patch | 54 - ...rs-table-skip-if-next-handler-called.patch | 21 - net-snmp-5.7.3-netgroups.patch | 286 -- net-snmp-5.7.3.tar.gz | 3 - net-snmp-5.8-fix-Makefile.PL.patch | 22 + net-snmp-5.8-fix-python3.patch | 578 ++++ ...patch => net-snmp-5.8-modern-rpm-api.patch | 52 +- ...snmp-5.8-net-snmp-config-headercheck.patch | 15 +- net-snmp-5.8-netgroups.patch | 41 + ...atch => net-snmp-5.8-perl-tk-warning.patch | 0 ...-5.7.3-pie.patch => net-snmp-5.8-pie.patch | 18 +- ...-snmp-5.8-snmpstatus-suppress-output.patch | 24 +- ...th.patch => net-snmp-5.8-socket-path.patch | 0 ... net-snmp-5.8-testing-empty-arptable.patch | 0 ...b.patch => net-snmp-5.8-velocity-mib.patch | 0 net-snmp-5.8.tar.gz | 3 + net-snmp-python3.patch | 505 ---- net-snmp.changes | 42 + net-snmp.spec | 41 +- 24 files changed, 757 insertions(+), 6546 deletions(-) delete mode 100644 net-snmp-5.7.2-systemd.patch delete mode 100644 net-snmp-5.7.3-Fix-Makefile.PL.patch delete mode 100644 net-snmp-5.7.3-Remove-U64-typedef.patch delete mode 100644 net-snmp-5.7.3-build-with-openssl-1.1.patch delete mode 100644 net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch delete mode 100644 net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch delete mode 100644 net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch delete mode 100644 net-snmp-5.7.3-netgroups.patch delete mode 100644 net-snmp-5.7.3.tar.gz create mode 100644 net-snmp-5.8-fix-Makefile.PL.patch create mode 100644 net-snmp-5.8-fix-python3.patch rename net-snmp-5.7.3-modern-rpm-api.patch => net-snmp-5.8-modern-rpm-api.patch (70%) rename net-snmp-5.7.3-net-snmp-config-headercheck.patch => net-snmp-5.8-net-snmp-config-headercheck.patch (87%) create mode 100644 net-snmp-5.8-netgroups.patch rename net-snmp-5.7.3-perl-tk-warning.patch => net-snmp-5.8-perl-tk-warning.patch (100%) rename net-snmp-5.7.3-pie.patch => net-snmp-5.8-pie.patch (62%) rename net-snmp-5.7.3-snmpstatus-suppress-output.patch => net-snmp-5.8-snmpstatus-suppress-output.patch (86%) rename net-snmp-5.7.3-socket-path.patch => net-snmp-5.8-socket-path.patch (100%) rename net-snmp-5.7.3-testing-empty-arptable.patch => net-snmp-5.8-testing-empty-arptable.patch (100%) rename net-snmp-5.7.3-velocity-mib.patch => net-snmp-5.8-velocity-mib.patch (100%) create mode 100644 net-snmp-5.8.tar.gz delete mode 100644 net-snmp-python3.patch diff --git a/net-snmp-5.7.2-systemd.patch b/net-snmp-5.7.2-systemd.patch deleted file mode 100644 index 419a6e2..0000000 --- a/net-snmp-5.7.2-systemd.patch +++ /dev/null @@ -1,1650 +0,0 @@ -718183 - Provide native systemd unit file - -Gathered from following upstream git commits and backported to 5.7. - -commit 19499c3c90bf9d7b2b9e5d08baa26cc6bba28a11 -Author: Jan Safranek -Date: Mon Aug 8 15:48:54 2011 +0200 - - CHANGES: snmpd: integrated with systemd, see README.systemd for details. - - It brings sd-daemon.c and .h directly downloaded from systemd. I've made very - few changes to it to match our NETSNMP_NO_SYSTEMD and include paths. - -commit fef6cddfdb94da1a6b1fb768af62918b80f11fd3 -Author: Jan Safranek -Date: Mon Aug 8 15:48:54 2011 +0200 - - CHANGES: snmptrapd: integrate systemd notification support. - -commit 0641e43c694c485cbbffef0556efc4641bd3ff50 -Author: Jan Safranek -Date: Mon Aug 8 15:48:54 2011 +0200 - - Add sd_find_inet_socket() and sd_find_inet_unisx() helpers into - system-specific code. This will help us to find various sockets - created by systemd much easier. - -commit 76530a89f1c8bbd0b63acce63e10d5d4812a1a16 -Author: Jan Safranek -Date: Mon Aug 8 15:48:54 2011 +0200 - - Check sockets created by systemd when opening new server sockets. - - systemd can pass sockets to our daemons during startup using LISTEN_FDS - environment variable. So check this variable when opening new listening - socket - maybe system has already opened the socket for us. - -commit bf108d7f1354f6276fc43c129963f2c49b9fc242 -Author: Jan Safranek -Date: Mon Aug 8 15:48:54 2011 +0200 - - Added sample systemd service files. - -commit 884ec488a6596380ba283d707827dd926a52e0b2 -Author: Jan Safranek -Date: Mon Aug 8 15:48:55 2011 +0200 - - Run autoheader+autoconf. - -commit 86132e3f1e6ef7b4e0b96d8fa24e37c81b71b0e0 -Author: Jan Safranek -Date: Tue Aug 9 10:53:43 2011 +0200 - - Update systemd documentation and samples. - - - add socket unit for snmpd to paralelize boot - - update WantedBy in socket units as recommended by http://0pointer.de/blog/projects/socket-activation.html - - rephrase README.systemd - -diff -up net-snmp-5.7.3/agent/snmpd.c.MPGqYh net-snmp-5.7.3/agent/snmpd.c ---- net-snmp-5.7.3/agent/snmpd.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/snmpd.c 2015-02-17 13:34:05.736221851 +0100 -@@ -164,6 +164,10 @@ typedef long fd_mask; - - #endif - -+#ifndef NETSNMP_NO_SYSTEMD -+#include -+#endif -+ - netsnmp_feature_want(logging_file) - netsnmp_feature_want(logging_stdio) - netsnmp_feature_want(logging_syslog) -@@ -443,18 +447,26 @@ main(int argc, char *argv[]) - int agent_mode = -1; - char *pid_file = NULL; - char option_compatability[] = "-Le"; -+ int prepared_sockets = 0; - #if HAVE_GETPID - int fd; - FILE *PID; - #endif - - #ifndef WIN32 -+#ifndef NETSNMP_NO_SYSYSTEMD -+ /* check if systemd has sockets for us and don't close them */ -+ prepared_sockets = netsnmp_sd_listen_fds(0); -+#endif /* NETSNMP_NO_SYSYSTEMD */ -+ - /* - * close all non-standard file descriptors we may have - * inherited from the shell. - */ -- for (i = getdtablesize() - 1; i > 2; --i) { -- (void) close(i); -+ if (!prepared_sockets) { -+ for (i = getdtablesize() - 1; i > 2; --i) { -+ (void) close(i); -+ } - } - #endif /* #WIN32 */ - -@@ -1107,6 +1119,19 @@ main(int argc, char *argv[]) - netsnmp_addrcache_initialise(); - - /* -+ * Let systemd know we're up. -+ */ -+#ifndef NETSNMP_NO_SYSTEMD -+ netsnmp_sd_notify(1, "READY=1\n"); -+ if (prepared_sockets) -+ /* -+ * Clear the environment variable, we already processed all the sockets -+ * by now. -+ */ -+ netsnmp_sd_listen_fds(1); -+#endif -+ -+ /* - * Forever monitor the dest_port for incoming PDUs. - */ - DEBUGMSGTL(("snmpd/main", "We're up. Starting to process data.\n")); -diff -up net-snmp-5.7.3/apps/snmptrapd.c.MPGqYh net-snmp-5.7.3/apps/snmptrapd.c ---- net-snmp-5.7.3/apps/snmptrapd.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/apps/snmptrapd.c 2015-02-17 13:34:05.736221851 +0100 -@@ -125,6 +125,10 @@ SOFTWARE. - - #include - -+#ifndef NETSNMP_NO_SYSTEMD -+#include -+#endif -+ - #ifndef BSD4_3 - #define BSD4_2 - #endif -@@ -657,15 +661,22 @@ main(int argc, char *argv[]) - int agentx_subagent = 1; - #endif - netsnmp_trapd_handler *traph; -+ int prepared_sockets = 0; - - - #ifndef WIN32 -+#ifndef NETSNMP_NO_SYSTEMD -+ /* check if systemd has sockets for us and don't close them */ -+ prepared_sockets = netsnmp_sd_listen_fds(0); -+#endif - /* - * close all non-standard file descriptors we may have - * inherited from the shell. - */ -- for (i = getdtablesize() - 1; i > 2; --i) { -- (void) close(i); -+ if (!prepared_sockets) { -+ for (i = getdtablesize() - 1; i > 2; --i) { -+ (void) close(i); -+ } - } - #endif /* #WIN32 */ - -@@ -1318,6 +1329,19 @@ main(int argc, char *argv[]) - #endif - #endif - -+ /* -+ * Let systemd know we're up. -+ */ -+#ifndef NETSNMP_NO_SYSTEMD -+ netsnmp_sd_notify(1, "READY=1\n"); -+ if (prepared_sockets) -+ /* -+ * Clear the environment variable, we already processed all the sockets -+ * by now. -+ */ -+ netsnmp_sd_listen_fds(1); -+#endif -+ - #ifdef WIN32SERVICE - trapd_status = SNMPTRAPD_RUNNING; - #endif -diff -up net-snmp-5.7.3/configure.d/config_modules_lib.MPGqYh net-snmp-5.7.3/configure.d/config_modules_lib ---- net-snmp-5.7.3/configure.d/config_modules_lib.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/configure.d/config_modules_lib 2015-02-17 13:34:05.737221850 +0100 -@@ -53,6 +53,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" - other_ftobjs_list="$other_ftobjs_list winpipe.ft" - fi - -+# Linux systemd -+if test "x$with_systemd" == "xyes"; then -+ other_src_list="$other_src_list sd-daemon.c" -+ other_objs_list="$other_objs_list sd-daemon.o" -+ other_lobjs_list="$other_lobjs_list sd-daemon.lo" -+ other_ftobjs_list="$other_ftobjs_list sd-daemon.ft" -+fi -+ - AC_SUBST(other_src_list) - AC_SUBST(other_objs_list) - AC_SUBST(other_lobjs_list) -diff -up net-snmp-5.7.3/configure.d/config_project_with_enable.MPGqYh net-snmp-5.7.3/configure.d/config_project_with_enable ---- net-snmp-5.7.3/configure.d/config_project_with_enable.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/configure.d/config_project_with_enable 2015-02-17 13:34:05.737221850 +0100 -@@ -690,6 +690,15 @@ if test "x$with_dummy_values" != "xyes"; - data for]) - fi - -+NETSNMP_ARG_WITH(systemd, -+[ --with-systemd Provide systemd support. See README.systemd -+ for details.]) -+# Define unless specifically suppressed (i.e., option defaults to false). -+if test "x$with_systemd" != "xyes"; then -+ AC_DEFINE(NETSNMP_NO_SYSTEMD, 1, -+ [If you don't want to integrate with systemd.]) -+fi -+ - NETSNMP_ARG_ENABLE(set-support, - [ --disable-set-support Do not allow SNMP set requests.]) - if test "x$enable_set_support" = "xno"; then -diff -up net-snmp-5.7.3/configure.MPGqYh net-snmp-5.7.3/configure ---- net-snmp-5.7.3/configure.MPGqYh 2014-12-08 21:23:37.000000000 +0100 -+++ net-snmp-5.7.3/configure 2015-02-17 13:34:05.744221845 +0100 -@@ -951,6 +951,8 @@ with_kmem_usage - enable_kmem_usage - with_dummy_values - enable_dummy_values -+with_systemd -+enable_systemd - enable_set_support - with_set_support - with_sys_contact -@@ -1867,6 +1869,8 @@ Configuring the agent: - This is technically not compliant with the - SNMP specifications, but was how the agent - operated for versions < 4.0. -+ --with-systemd Provide systemd support. See README.systemd -+ for details. - --with-sys-contact="who@where" Default system contact. - (Default: LOGIN@DOMAINNAME) - --with-sys-location="location" Default system location. -@@ -4398,6 +4402,24 @@ $as_echo "#define NETSNMP_NO_DUMMY_VALUE - - fi - -+ -+# Check whether --with-systemd was given. -+if test "${with_systemd+set}" = set; then : -+ withval=$with_systemd; -+fi -+ -+ # Check whether --enable-systemd was given. -+if test "${enable_systemd+set}" = set; then : -+ enableval=$enable_systemd; as_fn_error $? "Invalid option. Use --with-systemd/--without-systemd instead" "$LINENO" 5 -+fi -+ -+# Define unless specifically suppressed (i.e., option defaults to false). -+if test "x$with_systemd" != "xyes"; then -+ -+$as_echo "#define NETSNMP_NO_SYSTEMD 1" >>confdefs.h -+ -+fi -+ - # Check whether --enable-set-support was given. - if test "${enable_set_support+set}" = set; then : - enableval=$enable_set_support; -@@ -18639,6 +18661,14 @@ if test "x$PARTIALTARGETOS" = "xmingw32" - other_ftobjs_list="$other_ftobjs_list winpipe.ft" - fi - -+# Linux systemd -+if test "x$with_systemd" == "xyes"; then -+ other_src_list="$other_src_list sd-daemon.c" -+ other_objs_list="$other_objs_list sd-daemon.o" -+ other_lobjs_list="$other_lobjs_list sd-daemon.lo" -+ other_ftobjs_list="$other_ftobjs_list sd-daemon.ft" -+fi -+ - - - -diff -up net-snmp-5.7.3/dist/snmpd.service.MPGqYh net-snmp-5.7.3/dist/snmpd.service ---- net-snmp-5.7.3/dist/snmpd.service.MPGqYh 2015-02-17 13:34:05.745221844 +0100 -+++ net-snmp-5.7.3/dist/snmpd.service 2015-02-17 13:34:05.745221844 +0100 -@@ -0,0 +1,18 @@ -+# -+# SNMP agent service file for systemd -+# -+# -+# The service should be enabled, i.e. snmpd should start during machine boot. -+# Socket activation shall not be used. See README.systemd for details. -+ -+[Unit] -+Description=Simple Network Management Protocol (SNMP) daemon. -+After=syslog.target network.target -+ -+[Service] -+# Type=notify is also supported. It should be set when snmpd.socket is not used. -+Type=simple -+ExecStart=/usr/sbin/snmpd -f -+ -+[Install] -+WantedBy=multi-user.target -diff -up net-snmp-5.7.3/dist/snmpd.socket.MPGqYh net-snmp-5.7.3/dist/snmpd.socket ---- net-snmp-5.7.3/dist/snmpd.socket.MPGqYh 2015-02-17 13:34:05.745221844 +0100 -+++ net-snmp-5.7.3/dist/snmpd.socket 2015-02-17 13:34:05.745221844 +0100 -@@ -0,0 +1,17 @@ -+[Unit] -+Description=Socket listening for SNMP and AgentX messages -+ -+[Socket] -+ListenDatagram=0.0.0.0:161 -+# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. -+# It must match listening addresses/ports defined in snmpd.service -+# or snmpd.conf. -+# ListenStream=0.0.0.0:161 -+# ListenDatagram=[::]:161 -+# ListenStream=[::]:161 -+# -+# Uncomment AgentX socket if snmpd.conf enables AgentX protocol. -+# ListenStream=/var/agentx/master -+ -+[Install] -+WantedBy=sockets.target -diff -up net-snmp-5.7.3/dist/snmptrapd.service.MPGqYh net-snmp-5.7.3/dist/snmptrapd.service ---- net-snmp-5.7.3/dist/snmptrapd.service.MPGqYh 2015-02-17 13:34:05.745221844 +0100 -+++ net-snmp-5.7.3/dist/snmptrapd.service 2015-02-17 13:34:05.745221844 +0100 -@@ -0,0 +1,16 @@ -+# -+# SNMP trap-processing service file for systemd -+# -+ -+[Unit] -+Description=Simple Network Management Protocol (SNMP) Trap daemon. -+After=syslog.target network.target -+ -+[Service] -+# Type=notify is also supported. It should be set when snmptrapd.socket is not -+# used. -+Type=simple -+ExecStart=/usr/sbin/snmptrapd -f -+ -+[Install] -+WantedBy=multi-user.target -diff -up net-snmp-5.7.3/dist/snmptrapd.socket.MPGqYh net-snmp-5.7.3/dist/snmptrapd.socket ---- net-snmp-5.7.3/dist/snmptrapd.socket.MPGqYh 2015-02-17 13:34:05.745221844 +0100 -+++ net-snmp-5.7.3/dist/snmptrapd.socket 2015-02-17 13:34:05.745221844 +0100 -@@ -0,0 +1,14 @@ -+[Unit] -+Description=Socket listening for SNMP trap messages -+ -+[Socket] -+ListenDatagram=0.0.0.0:162 -+# Uncomment other listening addresses as needed - TCP, UDP6, TCP6. -+# It must match listening addresses/ports defined in snmptrapd.service -+# or snmptrapd.conf. -+# ListenStream=0.0.0.0:162 -+# ListenDatagram=[::]:162 -+# ListenStream=[::]:162 -+ -+[Install] -+WantedBy=sockets.target -diff -up net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h.MPGqYh net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h ---- net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h.MPGqYh 2015-02-17 13:34:05.746221843 +0100 -+++ net-snmp-5.7.3/include/net-snmp/library/sd-daemon.h 2015-02-17 13:34:05.746221843 +0100 -@@ -0,0 +1,286 @@ -+/*-*- Mode: C; c-basic-offset: 8; indent-tabs-mode: nil -*-*/ -+ -+#ifndef SNMPD_SD_DAEMON_H -+#define SNMPD_SD_DAEMON_H -+ -+/*** -+ Copyright 2010 Lennart Poettering -+ -+ Permission is hereby granted, free of charge, to any person -+ obtaining a copy of this software and associated documentation files -+ (the "Software"), to deal in the Software without restriction, -+ including without limitation the rights to use, copy, modify, merge, -+ publish, distribute, sublicense, and/or sell copies of the Software, -+ and to permit persons to whom the Software is furnished to do so, -+ subject to the following conditions: -+ -+ The above copyright notice and this permission notice shall be -+ included in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ SOFTWARE. -+***/ -+ -+#include -+#include -+ -+#ifdef __cplusplus -+extern "C" { -+#endif -+ -+/* -+ Reference implementation of a few systemd related interfaces for -+ writing daemons. These interfaces are trivial to implement. To -+ simplify porting we provide this reference implementation. -+ Applications are welcome to reimplement the algorithms described -+ here if they do not want to include these two source files. -+ -+ The following functionality is provided: -+ -+ - Support for logging with log levels on stderr -+ - File descriptor passing for socket-based activation -+ - Daemon startup and status notification -+ - Detection of systemd boots -+ -+ You may compile this with -DDISABLE_SYSTEMD to disable systemd -+ support. This makes all those calls NOPs that are directly related to -+ systemd (i.e. only sd_is_xxx() will stay useful). -+ -+ Since this is drop-in code we don't want any of our symbols to be -+ exported in any case. Hence we declare hidden visibility for all of -+ them. -+ -+ You may find an up-to-date version of these source files online: -+ -+ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.h -+ http://cgit.freedesktop.org/systemd/plain/src/sd-daemon.c -+ -+ This should compile on non-Linux systems, too, but with the -+ exception of the sd_is_xxx() calls all functions will become NOPs. -+ -+ See sd-daemon(7) for more information. -+*/ -+ -+#ifndef _sd_printf_attr_ -+#if __GNUC__ >= 4 -+#define _sd_printf_attr_(a,b) __attribute__ ((format (printf, a, b))) -+#else -+#define _sd_printf_attr_(a,b) -+#endif -+#endif -+ -+/* -+ Log levels for usage on stderr: -+ -+ fprintf(stderr, SD_NOTICE "Hello World!\n"); -+ -+ This is similar to printk() usage in the kernel. -+*/ -+#define SD_EMERG "<0>" /* system is unusable */ -+#define SD_ALERT "<1>" /* action must be taken immediately */ -+#define SD_CRIT "<2>" /* critical conditions */ -+#define SD_ERR "<3>" /* error conditions */ -+#define SD_WARNING "<4>" /* warning conditions */ -+#define SD_NOTICE "<5>" /* normal but significant condition */ -+#define SD_INFO "<6>" /* informational */ -+#define SD_DEBUG "<7>" /* debug-level messages */ -+ -+/* The first passed file descriptor is fd 3 */ -+#define SD_LISTEN_FDS_START 3 -+ -+/* -+ Returns how many file descriptors have been passed, or a negative -+ errno code on failure. Optionally, removes the $LISTEN_FDS and -+ $LISTEN_PID file descriptors from the environment (recommended, but -+ problematic in threaded environments). If r is the return value of -+ this function you'll find the file descriptors passed as fds -+ SD_LISTEN_FDS_START to SD_LISTEN_FDS_START+r-1. Returns a negative -+ errno style error code on failure. This function call ensures that -+ the FD_CLOEXEC flag is set for the passed file descriptors, to make -+ sure they are not passed on to child processes. If FD_CLOEXEC shall -+ not be set, the caller needs to unset it after this call for all file -+ descriptors that are used. -+ -+ See sd_listen_fds(3) for more information. -+*/ -+int netsnmp_sd_listen_fds(int unset_environment); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is a FIFO in the file system stored under the -+ specified path, 0 otherwise. If path is NULL a path name check will -+ not be done and the call only verifies if the file descriptor -+ refers to a FIFO. Returns a negative errno style error code on -+ failure. -+ -+ See sd_is_fifo(3) for more information. -+*/ -+int netsnmp_sd_is_fifo(int fd, const char *path); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is a special character device on the file -+ system stored under the specified path, 0 otherwise. -+ If path is NULL a path name check will not be done and the call -+ only verifies if the file descriptor refers to a special character. -+ Returns a negative errno style error code on failure. -+ -+ See sd_is_special(3) for more information. -+*/ -+int netsnmp_sd_is_special(int fd, const char *path); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is a socket of the specified family (AF_INET, -+ ...) and type (SOCK_DGRAM, SOCK_STREAM, ...), 0 otherwise. If -+ family is 0 a socket family check will not be done. If type is 0 a -+ socket type check will not be done and the call only verifies if -+ the file descriptor refers to a socket. If listening is > 0 it is -+ verified that the socket is in listening mode. (i.e. listen() has -+ been called) If listening is == 0 it is verified that the socket is -+ not in listening mode. If listening is < 0 no listening mode check -+ is done. Returns a negative errno style error code on failure. -+ -+ See sd_is_socket(3) for more information. -+*/ -+int netsnmp_sd_is_socket(int fd, int family, int type, int listening); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is an Internet socket, of the specified family -+ (either AF_INET or AF_INET6) and the specified type (SOCK_DGRAM, -+ SOCK_STREAM, ...), 0 otherwise. If version is 0 a protocol version -+ check is not done. If type is 0 a socket type check will not be -+ done. If port is 0 a socket port check will not be done. The -+ listening flag is used the same way as in sd_is_socket(). Returns a -+ negative errno style error code on failure. -+ -+ See sd_is_socket_inet(3) for more information. -+*/ -+int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port); -+ -+/* -+ Helper call for identifying a passed file descriptor. Returns 1 if -+ the file descriptor is an AF_UNIX socket of the specified type -+ (SOCK_DGRAM, SOCK_STREAM, ...) and path, 0 otherwise. If type is 0 -+ a socket type check will not be done. If path is NULL a socket path -+ check will not be done. For normal AF_UNIX sockets set length to -+ 0. For abstract namespace sockets set length to the length of the -+ socket name (including the initial 0 byte), and pass the full -+ socket path in path (including the initial 0 byte). The listening -+ flag is used the same way as in sd_is_socket(). Returns a negative -+ errno style error code on failure. -+ -+ See sd_is_socket_unix(3) for more information. -+*/ -+int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length); -+ -+/* -+ Informs systemd about changed daemon state. This takes a number of -+ newline separated environment-style variable assignments in a -+ string. The following variables are known: -+ -+ READY=1 Tells systemd that daemon startup is finished (only -+ relevant for services of Type=notify). The passed -+ argument is a boolean "1" or "0". Since there is -+ little value in signaling non-readiness the only -+ value daemons should send is "READY=1". -+ -+ STATUS=... Passes a single-line status string back to systemd -+ that describes the daemon state. This is free-from -+ and can be used for various purposes: general state -+ feedback, fsck-like programs could pass completion -+ percentages and failing programs could pass a human -+ readable error message. Example: "STATUS=Completed -+ 66% of file system check..." -+ -+ ERRNO=... If a daemon fails, the errno-style error code, -+ formatted as string. Example: "ERRNO=2" for ENOENT. -+ -+ BUSERROR=... If a daemon fails, the D-Bus error-style error -+ code. Example: "BUSERROR=org.freedesktop.DBus.Error.TimedOut" -+ -+ MAINPID=... The main pid of a daemon, in case systemd did not -+ fork off the process itself. Example: "MAINPID=4711" -+ -+ Daemons can choose to send additional variables. However, it is -+ recommended to prefix variable names not listed above with X_. -+ -+ Returns a negative errno-style error code on failure. Returns > 0 -+ if systemd could be notified, 0 if it couldn't possibly because -+ systemd is not running. -+ -+ Example: When a daemon finished starting up, it could issue this -+ call to notify systemd about it: -+ -+ sd_notify(0, "READY=1"); -+ -+ See sd_notifyf() for more complete examples. -+ -+ See sd_notify(3) for more information. -+*/ -+int netsnmp_sd_notify(int unset_environment, const char *state); -+ -+/* -+ Similar to sd_notify() but takes a format string. -+ -+ Example 1: A daemon could send the following after initialization: -+ -+ sd_notifyf(0, "READY=1\n" -+ "STATUS=Processing requests...\n" -+ "MAINPID=%lu", -+ (unsigned long) getpid()); -+ -+ Example 2: A daemon could send the following shortly before -+ exiting, on failure: -+ -+ sd_notifyf(0, "STATUS=Failed to start up: %s\n" -+ "ERRNO=%i", -+ strerror(errno), -+ errno); -+ -+ See sd_notifyf(3) for more information. -+*/ -+int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) _sd_printf_attr_(2,3); -+ -+/* -+ Returns > 0 if the system was booted with systemd. Returns < 0 on -+ error. Returns 0 if the system was not booted with systemd. Note -+ that all of the functions above handle non-systemd boots just -+ fine. You should NOT protect them with a call to this function. Also -+ note that this function checks whether the system, not the user -+ session is controlled by systemd. However the functions above work -+ for both user and system services. -+ -+ See sd_booted(3) for more information. -+*/ -+int netsnmp_sd_booted(void); -+ -+/** -+ * Find an socket with given parameters. See man sd_is_socket_inet for -+ * description of the arguments. -+ * -+ * Returns the file descriptor if it is found, 0 otherwise. -+ */ -+int netsnmp_sd_find_inet_socket(int family, int type, int listening, int port); -+ -+/** -+ * Find an unix socket with given parameters. See man sd_is_socket_unix for -+ * description of the arguments. -+ * -+ * Returns the file descriptor if it is found, 0 otherwise. -+ */ -+int -+netsnmp_sd_find_unix_socket(int type, int listening, const char *path); -+ -+#ifdef __cplusplus -+} -+#endif -+ -+#endif /* SNMPD_SD_DAEMON_H */ -diff -up net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in.MPGqYh net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in ---- net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/include/net-snmp/net-snmp-config.h.in 2015-02-17 13:34:05.746221843 +0100 -@@ -1410,6 +1410,9 @@ - /* If you don't have root access don't exit upon kmem errors */ - #undef NETSNMP_NO_ROOT_ACCESS - -+/* If you don't want to integrate with systemd. */ -+#undef NETSNMP_NO_SYSTEMD -+ - /* Define if you want to remove all SET/write access from the code */ - #undef NETSNMP_NO_WRITE_SUPPORT - -diff -up net-snmp-5.7.3/README.systemd.MPGqYh net-snmp-5.7.3/README.systemd ---- net-snmp-5.7.3/README.systemd.MPGqYh 2015-02-17 13:34:05.747221843 +0100 -+++ net-snmp-5.7.3/README.systemd 2015-02-17 13:34:05.747221843 +0100 -@@ -0,0 +1,41 @@ -+README.systemd -+-------------- -+Net-SNMP provides two daemons, which support systemd system manager. -+See http://www.freedesktop.org/wiki/Software/systemd to learn how -+systemd works. Both socket activation and notification is supported by these -+daemons. -+ -+To enable systemd support, the sources must be compiled with -+--with-systemd configure option. -+ -+snmpd - The SNMP agent -+---------------------- -+Socket activation od snmpd daemon is implemented, but it's discouraged. -+The reason is simple - snmpd not only listens and processes SNMP requests -+from network, but also gathers system statistics counters, sends traps and -+communicates with subagents. It even opens few netlink sockets. -+ -+In other words, snmpd should run from system start to properly work. -+This can be done in two ways: -+1) either as snmpd service unit with 'Type=notification' and without a socket -+ unit -+2) or as snmpd service unit with 'Type=simple', appropriate socket socket unit -+ and the snmpd service enabled. This way systemd creates the snmpd listening -+ socket early during boot and passes the sockets to snmpd slightly later -+ (but still during machine boot). This way systemd can paralelize start of -+ services, which depend on snmpd. Admins must adjust the socket file manually, -+ depending if the snmpd support AgentX, IPv6, SMUX etc. -+ -+snmpd should be started with '-f' command line parameter to disable forking - -+systemd does that for us automatically. -+ -+ -+snmptrapd - The trap processing daemon -+-------------------------------------- -+snmptrapd supports full socket activation and also notification (if needed). -+Both 'Type=simple' (with appropriate socket unit) and 'Type=notify' services -+will work. Again, '-f' parameter should be provided on snmptrapd command line. -+ -+If integration with SNMP agent using AgentX protocol is enabled, snmptrapd should -+start during boot and not after first SNMP trap arrives. Same rules as for snmpd -+applies then. -\ No newline at end of file -diff -up net-snmp-5.7.3/snmplib/sd-daemon.c.MPGqYh net-snmp-5.7.3/snmplib/sd-daemon.c ---- net-snmp-5.7.3/snmplib/sd-daemon.c.MPGqYh 2015-02-17 13:34:05.747221843 +0100 -+++ net-snmp-5.7.3/snmplib/sd-daemon.c 2015-02-17 13:34:05.747221843 +0100 -@@ -0,0 +1,532 @@ -+/* -+ * Systemd integration parts. -+ * -+ * Most of this file is directly copied from systemd sources. -+ * Changes: -+ * - all functions were renamed to have netsnmp_ prefix -+ * - includes were changed to match Net-SNMP style. -+ * - removed gcc export macros -+ * - removed POSIX message queues -+ */ -+ -+#include -+#include -+#include -+#include -+ -+#ifndef NETSNMP_NO_SYSTEMD -+ -+/*** -+ Copyright 2010 Lennart Poettering -+ -+ Permission is hereby granted, free of charge, to any person -+ obtaining a copy of this software and associated documentation files -+ (the "Software"), to deal in the Software without restriction, -+ including without limitation the rights to use, copy, modify, merge, -+ publish, distribute, sublicense, and/or sell copies of the Software, -+ and to permit persons to whom the Software is furnished to do so, -+ subject to the following conditions: -+ -+ The above copyright notice and this permission notice shall be -+ included in all copies or substantial portions of the Software. -+ -+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -+ EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -+ NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS -+ BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN -+ ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN -+ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -+ SOFTWARE. -+***/ -+ -+#ifndef _GNU_SOURCE -+#define _GNU_SOURCE -+#endif -+ -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+#include -+ -+#include -+ -+int netsnmp_sd_listen_fds(int unset_environment) { -+ -+ int r, fd; -+ const char *e; -+ char *p = NULL; -+ unsigned long l; -+ -+ if (!(e = getenv("LISTEN_PID"))) { -+ r = 0; -+ goto finish; -+ } -+ -+ errno = 0; -+ l = strtoul(e, &p, 10); -+ -+ if (errno != 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ if (!p || *p || l <= 0) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ /* Is this for us? */ -+ if (getpid() != (pid_t) l) { -+ r = 0; -+ goto finish; -+ } -+ -+ if (!(e = getenv("LISTEN_FDS"))) { -+ r = 0; -+ goto finish; -+ } -+ -+ errno = 0; -+ l = strtoul(e, &p, 10); -+ -+ if (errno != 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ if (!p || *p) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ for (fd = SD_LISTEN_FDS_START; fd < SD_LISTEN_FDS_START + (int) l; fd ++) { -+ int flags; -+ -+ if ((flags = fcntl(fd, F_GETFD)) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ if (flags & FD_CLOEXEC) -+ continue; -+ -+ if (fcntl(fd, F_SETFD, flags | FD_CLOEXEC) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ } -+ -+ r = (int) l; -+ -+finish: -+ if (unset_environment) { -+ unsetenv("LISTEN_PID"); -+ unsetenv("LISTEN_FDS"); -+ } -+ -+ return r; -+} -+ -+int netsnmp_sd_is_fifo(int fd, const char *path) { -+ struct stat st_fd; -+ -+ if (fd < 0) -+ return -EINVAL; -+ -+ memset(&st_fd, 0, sizeof(st_fd)); -+ if (fstat(fd, &st_fd) < 0) -+ return -errno; -+ -+ if (!S_ISFIFO(st_fd.st_mode)) -+ return 0; -+ -+ if (path) { -+ struct stat st_path; -+ -+ memset(&st_path, 0, sizeof(st_path)); -+ if (stat(path, &st_path) < 0) { -+ -+ if (errno == ENOENT || errno == ENOTDIR) -+ return 0; -+ -+ return -errno; -+ } -+ -+ return -+ st_path.st_dev == st_fd.st_dev && -+ st_path.st_ino == st_fd.st_ino; -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_is_special(int fd, const char *path) { -+ struct stat st_fd; -+ -+ if (fd < 0) -+ return -EINVAL; -+ -+ if (fstat(fd, &st_fd) < 0) -+ return -errno; -+ -+ if (!S_ISREG(st_fd.st_mode) && !S_ISCHR(st_fd.st_mode)) -+ return 0; -+ -+ if (path) { -+ struct stat st_path; -+ -+ if (stat(path, &st_path) < 0) { -+ -+ if (errno == ENOENT || errno == ENOTDIR) -+ return 0; -+ -+ return -errno; -+ } -+ -+ if (S_ISREG(st_fd.st_mode) && S_ISREG(st_path.st_mode)) -+ return -+ st_path.st_dev == st_fd.st_dev && -+ st_path.st_ino == st_fd.st_ino; -+ else if (S_ISCHR(st_fd.st_mode) && S_ISCHR(st_path.st_mode)) -+ return st_path.st_rdev == st_fd.st_rdev; -+ else -+ return 0; -+ } -+ -+ return 1; -+} -+ -+static int sd_is_socket_internal(int fd, int type, int listening) { -+ struct stat st_fd; -+ -+ if (fd < 0 || type < 0) -+ return -EINVAL; -+ -+ if (fstat(fd, &st_fd) < 0) -+ return -errno; -+ -+ if (!S_ISSOCK(st_fd.st_mode)) -+ return 0; -+ -+ if (type != 0) { -+ int other_type = 0; -+ socklen_t l = sizeof(other_type); -+ -+ if (getsockopt(fd, SOL_SOCKET, SO_TYPE, &other_type, &l) < 0) -+ return -errno; -+ -+ if (l != sizeof(other_type)) -+ return -EINVAL; -+ -+ if (other_type != type) -+ return 0; -+ } -+ -+ if (listening >= 0) { -+ int accepting = 0; -+ socklen_t l = sizeof(accepting); -+ -+ if (getsockopt(fd, SOL_SOCKET, SO_ACCEPTCONN, &accepting, &l) < 0) -+ return -errno; -+ -+ if (l != sizeof(accepting)) -+ return -EINVAL; -+ -+ if (!accepting != !listening) -+ return 0; -+ } -+ -+ return 1; -+} -+ -+union sockaddr_union { -+ struct sockaddr sa; -+ struct sockaddr_in in4; -+ struct sockaddr_in6 in6; -+ struct sockaddr_un un; -+ struct sockaddr_storage storage; -+}; -+ -+int netsnmp_sd_is_socket(int fd, int family, int type, int listening) { -+ int r; -+ -+ if (family < 0) -+ return -EINVAL; -+ -+ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) -+ return r; -+ -+ if (family > 0) { -+ union sockaddr_union sockaddr; -+ socklen_t l; -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ l = sizeof(sockaddr); -+ -+ if (getsockname(fd, &sockaddr.sa, &l) < 0) -+ return -errno; -+ -+ if (l < sizeof(sa_family_t)) -+ return -EINVAL; -+ -+ return sockaddr.sa.sa_family == family; -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_is_socket_inet(int fd, int family, int type, int listening, uint16_t port) { -+ union sockaddr_union sockaddr; -+ socklen_t l; -+ int r; -+ -+ if (family != 0 && family != AF_INET && family != AF_INET6) -+ return -EINVAL; -+ -+ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) -+ return r; -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ l = sizeof(sockaddr); -+ -+ if (getsockname(fd, &sockaddr.sa, &l) < 0) -+ return -errno; -+ -+ if (l < sizeof(sa_family_t)) -+ return -EINVAL; -+ -+ if (sockaddr.sa.sa_family != AF_INET && -+ sockaddr.sa.sa_family != AF_INET6) -+ return 0; -+ -+ if (family > 0) -+ if (sockaddr.sa.sa_family != family) -+ return 0; -+ -+ if (port > 0) { -+ if (sockaddr.sa.sa_family == AF_INET) { -+ if (l < sizeof(struct sockaddr_in)) -+ return -EINVAL; -+ -+ return htons(port) == sockaddr.in4.sin_port; -+ } else { -+ if (l < sizeof(struct sockaddr_in6)) -+ return -EINVAL; -+ -+ return htons(port) == sockaddr.in6.sin6_port; -+ } -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_is_socket_unix(int fd, int type, int listening, const char *path, size_t length) { -+ union sockaddr_union sockaddr; -+ socklen_t l; -+ int r; -+ -+ if ((r = sd_is_socket_internal(fd, type, listening)) <= 0) -+ return r; -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ l = sizeof(sockaddr); -+ -+ if (getsockname(fd, &sockaddr.sa, &l) < 0) -+ return -errno; -+ -+ if (l < sizeof(sa_family_t)) -+ return -EINVAL; -+ -+ if (sockaddr.sa.sa_family != AF_UNIX) -+ return 0; -+ -+ if (path) { -+ if (length <= 0) -+ length = strlen(path); -+ -+ if (length <= 0) -+ /* Unnamed socket */ -+ return l == offsetof(struct sockaddr_un, sun_path); -+ -+ if (path[0]) -+ /* Normal path socket */ -+ return -+ (l >= offsetof(struct sockaddr_un, sun_path) + length + 1) && -+ memcmp(path, sockaddr.un.sun_path, length+1) == 0; -+ else -+ /* Abstract namespace socket */ -+ return -+ (l == offsetof(struct sockaddr_un, sun_path) + length) && -+ memcmp(path, sockaddr.un.sun_path, length) == 0; -+ } -+ -+ return 1; -+} -+ -+int netsnmp_sd_notify(int unset_environment, const char *state) { -+ int fd = -1, r; -+ struct msghdr msghdr; -+ struct iovec iovec; -+ union sockaddr_union sockaddr; -+ const char *e; -+ -+ if (!state) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ if (!(e = getenv("NOTIFY_SOCKET"))) -+ return 0; -+ -+ /* Must be an abstract socket, or an absolute path */ -+ if ((e[0] != '@' && e[0] != '/') || e[1] == 0) { -+ r = -EINVAL; -+ goto finish; -+ } -+ -+ if ((fd = socket(AF_UNIX, SOCK_DGRAM|SOCK_CLOEXEC, 0)) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ memset(&sockaddr, 0, sizeof(sockaddr)); -+ sockaddr.sa.sa_family = AF_UNIX; -+ strncpy(sockaddr.un.sun_path, e, sizeof(sockaddr.un.sun_path)); -+ -+ if (sockaddr.un.sun_path[0] == '@') -+ sockaddr.un.sun_path[0] = 0; -+ -+ memset(&iovec, 0, sizeof(iovec)); -+ iovec.iov_base = (char *)state; -+ iovec.iov_len = strlen(state); -+ -+ memset(&msghdr, 0, sizeof(msghdr)); -+ msghdr.msg_name = &sockaddr; -+ msghdr.msg_namelen = offsetof(struct sockaddr_un, sun_path) + strlen(e); -+ -+ if (msghdr.msg_namelen > sizeof(struct sockaddr_un)) -+ msghdr.msg_namelen = sizeof(struct sockaddr_un); -+ -+ msghdr.msg_iov = &iovec; -+ msghdr.msg_iovlen = 1; -+ -+ if (sendmsg(fd, &msghdr, MSG_NOSIGNAL) < 0) { -+ r = -errno; -+ goto finish; -+ } -+ -+ r = 1; -+ -+finish: -+ if (unset_environment) -+ unsetenv("NOTIFY_SOCKET"); -+ -+ if (fd >= 0) -+ close(fd); -+ -+ return r; -+} -+ -+int netsnmp_sd_notifyf(int unset_environment, const char *format, ...) { -+ va_list ap; -+ char *p = NULL; -+ int r; -+ -+ va_start(ap, format); -+ r = vasprintf(&p, format, ap); -+ va_end(ap); -+ -+ if (r < 0 || !p) -+ return -ENOMEM; -+ -+ r = netsnmp_sd_notify(unset_environment, p); -+ free(p); -+ -+ return r; -+} -+ -+int netsnmp_sd_booted(void) { -+ struct stat a, b; -+ -+ /* We simply test whether the systemd cgroup hierarchy is -+ * mounted */ -+ -+ if (lstat("/sys/fs/cgroup", &a) < 0) -+ return 0; -+ -+ if (lstat("/sys/fs/cgroup/systemd", &b) < 0) -+ return 0; -+ -+ return a.st_dev != b.st_dev; -+} -+ -+/* End of original sd-daemon.c from systemd sources */ -+ -+int -+netsnmp_sd_find_inet_socket(int family, int type, int listening, int port) -+{ -+ int count, fd; -+ -+ count = netsnmp_sd_listen_fds(0); -+ if (count <= 0) { -+ DEBUGMSGTL(("systemd:find_inet_socket", "No LISTEN_FDS found.\n")); -+ return 0; -+ } -+ DEBUGMSGTL(("systemd:find_inet_socket", "LISTEN_FDS reports %d sockets.\n", -+ count)); -+ -+ for (fd = 3; fd < 3+count; fd++) { -+ int rc = netsnmp_sd_is_socket_inet(fd, family, type, listening, port); -+ if (rc < 0) -+ DEBUGMSGTL(("systemd:find_inet_socket", -+ "sd_is_socket_inet error: %d\n", rc)); -+ if (rc > 0) { -+ DEBUGMSGTL(("systemd:find_inet_socket", -+ "Found the socket in LISTEN_FDS\n")); -+ return fd; -+ } -+ } -+ DEBUGMSGTL(("systemd:find_inet_socket", "Socket not found in LISTEN_FDS\n")); -+ return 0; -+} -+ -+int -+netsnmp_sd_find_unix_socket(int type, int listening, const char *path) -+{ -+ int count, fd; -+ -+ count = netsnmp_sd_listen_fds(0); -+ if (count <= 0) { -+ DEBUGMSGTL(("systemd:find_unix_socket", "No LISTEN_FDS found.\n")); -+ return 0; -+ } -+ DEBUGMSGTL(("systemd:find_unix_socket", "LISTEN_FDS reports %d sockets.\n", -+ count)); -+ -+ for (fd = 3; fd < 3+count; fd++) { -+ int rc = netsnmp_sd_is_socket_unix(fd, type, listening, path, 0); -+ if (rc < 0) -+ DEBUGMSGTL(("systemd:find_unix_socket", -+ "netsnmp_sd_is_socket_unix error: %d\n", rc)); -+ if (rc > 0) { -+ DEBUGMSGTL(("systemd:find_unix_socket", -+ "Found the socket in LISTEN_FDS\n")); -+ return fd; -+ } -+ } -+ DEBUGMSGTL(("systemd:find_unix_socket", "Socket not found in LISTEN_FDS\n")); -+ return 0; -+} -+ -+#endif /* ! NETSNMP_NO_SYSTEMD */ -diff -up net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c ---- net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/snmplib/transports/snmpTCPDomain.c 2015-02-17 13:34:05.748221842 +0100 -@@ -43,6 +43,10 @@ - #include - #include - -+#ifndef NETSNMP_NO_SYSTEMD -+#include -+#endif -+ - /* - * needs to be in sync with the definitions in snmplib/snmpUDPDomain.c - * and perl/agent/agent.xs -@@ -149,6 +153,7 @@ netsnmp_tcp_transport(struct sockaddr_in - netsnmp_transport *t = NULL; - netsnmp_udp_addr_pair *addr_pair = NULL; - int rc = 0; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -178,7 +183,19 @@ netsnmp_tcp_transport(struct sockaddr_in - t->domain_length = - sizeof(netsnmp_snmpTCPDomain) / sizeof(netsnmp_snmpTCPDomain[0]); - -- t->sock = socket(PF_INET, SOCK_STREAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_STREAM, 1, -+ ntohs(addr->sin_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET, SOCK_STREAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -215,11 +232,13 @@ netsnmp_tcp_transport(struct sockaddr_in - setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, - sizeof(opt)); - -- rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *)addr, sizeof(struct sockaddr)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -@@ -235,12 +254,13 @@ netsnmp_tcp_transport(struct sockaddr_in - /* - * Now sit here and wait for connections to arrive. - */ -- -- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -diff -up net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c ---- net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/snmplib/transports/snmpTCPIPv6Domain.c 2015-02-17 13:34:05.748221842 +0100 -@@ -49,6 +49,10 @@ - #include - #include - -+#ifndef NETSNMP_NO_SYSTEMD -+#include -+#endif -+ - #include "inet_ntop.h" - - oid netsnmp_TCPIPv6Domain[] = { TRANSPORT_DOMAIN_TCP_IPV6 }; -@@ -140,6 +144,7 @@ netsnmp_tcp6_transport(struct sockaddr_i - { - netsnmp_transport *t = NULL; - int rc = 0; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -174,7 +179,19 @@ netsnmp_tcp6_transport(struct sockaddr_i - t->domain = netsnmp_TCPIPv6Domain; - t->domain_length = sizeof(netsnmp_TCPIPv6Domain) / sizeof(oid); - -- t->sock = socket(PF_INET6, SOCK_STREAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_STREAM, 1, -+ ntohs(addr->sin6_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET6, SOCK_STREAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -220,12 +237,14 @@ netsnmp_tcp6_transport(struct sockaddr_i - - setsockopt(t->sock, SOL_SOCKET, SO_REUSEADDR, (void *)&opt, sizeof(opt)); - -- rc = bind(t->sock, (struct sockaddr *) addr, -- sizeof(struct sockaddr_in6)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *) addr, -+ sizeof(struct sockaddr_in6)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -@@ -242,11 +261,13 @@ netsnmp_tcp6_transport(struct sockaddr_i - * Now sit here and wait for connections to arrive. - */ - -- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - - /* -diff -up net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c ---- net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/snmplib/transports/snmpUDPIPv4BaseDomain.c 2015-02-17 13:36:22.744123462 +0100 -@@ -40,6 +40,10 @@ - - #include - -+#ifndef NETSNMP_NO_SYSTEMD -+#include -+#endif -+ - #if defined(HAVE_IP_PKTINFO) || defined(HAVE_IP_RECVDSTADDR) - int netsnmp_udpipv4_recvfrom(int s, void *buf, int len, struct sockaddr *from, - socklen_t *fromlen, struct sockaddr *dstip, -@@ -64,6 +68,7 @@ netsnmp_udpipv4base_transport(struct soc - char *client_socket = NULL; - netsnmp_indexed_addr_pair addr_pair; - socklen_t local_addr_len; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -88,7 +93,20 @@ netsnmp_udpipv4base_transport(struct soc - free(str); - } - -- t->sock = socket(PF_INET, SOCK_DGRAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET, SOCK_DGRAM, -1, -+ ntohs(addr->sin_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET, SOCK_DGRAM, 0); -+ - DEBUGMSGTL(("UDPBase", "openned socket %d as local=%d\n", t->sock, local)); - if (t->sock < 0) { - netsnmp_transport_free(t); -@@ -151,12 +169,14 @@ netsnmp_udpipv4base_transport(struct soc - } - } - #endif /* !defined(WIN32) */ -- rc = bind(t->sock, (struct sockaddr *) addr, -- sizeof(struct sockaddr)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *) addr, -+ sizeof(struct sockaddr)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - t->data = NULL; - t->data_length = 0; -diff -up net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c ---- net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/snmplib/transports/snmpUDPIPv6Domain.c 2015-02-17 13:37:16.256087147 +0100 -@@ -67,6 +67,10 @@ static const struct in6_addr in6addr_any - #include - #include - -+#ifndef NETSNMP_NO_SYSTEMD -+#include -+#endif -+ - #include "inet_ntop.h" - #include "inet_pton.h" - -@@ -190,6 +194,7 @@ netsnmp_udp6_transport(struct sockaddr_i - { - netsnmp_transport *t = NULL; - int rc = 0; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - if (local) -@@ -217,7 +222,19 @@ netsnmp_udp6_transport(struct sockaddr_i - t->domain_length = - sizeof(netsnmp_UDPIPv6Domain) / sizeof(netsnmp_UDPIPv6Domain[0]); - -- t->sock = socket(PF_INET6, SOCK_DGRAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_inet_socket(PF_INET6, SOCK_DGRAM, -1, -+ ntohs(addr->sin6_port)); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_INET6, SOCK_DGRAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -242,13 +259,14 @@ netsnmp_udp6_transport(struct sockaddr_i - } - } - #endif -- -- rc = bind(t->sock, (struct sockaddr *) addr, -- sizeof(struct sockaddr_in6)); -- if (rc != 0) { -- netsnmp_socketbase_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = bind(t->sock, (struct sockaddr *) addr, -+ sizeof(struct sockaddr_in6)); -+ if (rc != 0) { -+ netsnmp_socketbase_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } - t->local = (unsigned char*)malloc(18); - if (t->local == NULL) { -diff -up net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c.MPGqYh net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c ---- net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c.MPGqYh 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/snmplib/transports/snmpUnixDomain.c 2015-02-17 13:34:05.749221841 +0100 -@@ -37,6 +37,10 @@ - #include /* mkdirhier */ - #include - -+#ifndef NETSNMP_NO_SYSTEMD -+#include -+#endif -+ - netsnmp_feature_child_of(transport_unix_socket_all, transport_all) - netsnmp_feature_child_of(unix_socket_paths, transport_unix_socket_all) - -@@ -295,6 +299,7 @@ netsnmp_unix_transport(struct sockaddr_u - netsnmp_transport *t = NULL; - sockaddr_un_pair *sup = NULL; - int rc = 0; -+ int socket_initialized = 0; - - #ifdef NETSNMP_NO_LISTEN_SUPPORT - /* SPECIAL CIRCUMSTANCE: We still want AgentX to be able to operate, -@@ -333,7 +338,18 @@ netsnmp_unix_transport(struct sockaddr_u - t->data_length = sizeof(sockaddr_un_pair); - sup = (sockaddr_un_pair *) t->data; - -- t->sock = socket(PF_UNIX, SOCK_STREAM, 0); -+#ifndef NETSNMP_NO_SYSTEMD -+ /* -+ * Maybe the socket was already provided by systemd... -+ */ -+ if (local) { -+ t->sock = netsnmp_sd_find_unix_socket(SOCK_STREAM, 1, addr->sun_path); -+ if (t->sock) -+ socket_initialized = 1; -+ } -+#endif -+ if (!socket_initialized) -+ t->sock = socket(PF_UNIX, SOCK_STREAM, 0); - if (t->sock < 0) { - netsnmp_transport_free(t); - return NULL; -@@ -357,25 +373,26 @@ netsnmp_unix_transport(struct sockaddr_u - - t->flags |= NETSNMP_TRANSPORT_FLAG_LISTEN; - -- unlink(addr->sun_path); -- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -- -- if (rc != 0 && errno == ENOENT && create_path) { -- rc = mkdirhier(addr->sun_path, create_mode, 1); -+ if (!socket_initialized) { -+ unlink(addr->sun_path); -+ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -+ if (rc != 0 && errno == ENOENT && create_path) { -+ rc = mkdirhier(addr->sun_path, create_mode, 1); -+ if (rc != 0) { -+ netsnmp_unix_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } -+ rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -+ } - if (rc != 0) { -+ DEBUGMSGTL(("netsnmp_unix_transport", -+ "couldn't bind \"%s\", errno %d (%s)\n", -+ addr->sun_path, errno, strerror(errno))); - netsnmp_unix_close(t); - netsnmp_transport_free(t); - return NULL; - } -- rc = bind(t->sock, (struct sockaddr *) addr, SUN_LEN(addr)); -- } -- if (rc != 0) { -- DEBUGMSGTL(("netsnmp_unix_transport", -- "couldn't bind \"%s\", errno %d (%s)\n", -- addr->sun_path, errno, strerror(errno))); -- netsnmp_unix_close(t); -- netsnmp_transport_free(t); -- return NULL; - } - - /* -@@ -391,16 +408,17 @@ netsnmp_unix_transport(struct sockaddr_u - * Now sit here and listen for connections to arrive. - */ - -- rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -- if (rc != 0) { -- DEBUGMSGTL(("netsnmp_unix_transport", -- "couldn't listen to \"%s\", errno %d (%s)\n", -- addr->sun_path, errno, strerror(errno))); -- netsnmp_unix_close(t); -- netsnmp_transport_free(t); -- return NULL; -+ if (!socket_initialized) { -+ rc = listen(t->sock, NETSNMP_STREAM_QUEUE_LEN); -+ if (rc != 0) { -+ DEBUGMSGTL(("netsnmp_unix_transport", -+ "couldn't listen to \"%s\", errno %d (%s)\n", -+ addr->sun_path, errno, strerror(errno))); -+ netsnmp_unix_close(t); -+ netsnmp_transport_free(t); -+ return NULL; -+ } - } -- - } else { - t->remote = (u_char *)malloc(strlen(addr->sun_path)); - if (t->remote == NULL) { diff --git a/net-snmp-5.7.3-Fix-Makefile.PL.patch b/net-snmp-5.7.3-Fix-Makefile.PL.patch deleted file mode 100644 index c031b32..0000000 --- a/net-snmp-5.7.3-Fix-Makefile.PL.patch +++ /dev/null @@ -1,23 +0,0 @@ -diff -up net-snmp-5.7.3/perl/ASN/Makefile.PL.orig net-snmp-5.7.3/perl/ASN/Makefile.PL ---- net-snmp-5.7.3/perl/ASN/Makefile.PL.orig 2016-05-06 10:35:30.005905040 +0200 -+++ net-snmp-5.7.3/perl/ASN/Makefile.PL 2016-05-06 10:35:57.518776400 +0200 -@@ -3,6 +3,7 @@ require 5; - use Config; - use Getopt::Long; - my $lib_version; -+my %MakeParams = (); - - # See lib/ExtUtils/MakeMaker.pm for details of how to influence - # the contents of the Makefile that is written. -diff -up net-snmp-5.7.3/perl/Makefile.PL.orig net-snmp-5.7.3/perl/Makefile.PL ---- net-snmp-5.7.3/perl/Makefile.PL.orig 2016-05-06 10:34:38.975143641 +0200 -+++ net-snmp-5.7.3/perl/Makefile.PL 2016-05-06 10:35:13.326983024 +0200 -@@ -2,6 +2,7 @@ use ExtUtils::MakeMaker; - use Config; - use Getopt::Long; - require 5; -+my %MakeParams = (); - - %MakeParams = InitMakeParams(); - - diff --git a/net-snmp-5.7.3-Remove-U64-typedef.patch b/net-snmp-5.7.3-Remove-U64-typedef.patch deleted file mode 100644 index c01cd8d..0000000 --- a/net-snmp-5.7.3-Remove-U64-typedef.patch +++ /dev/null @@ -1,2518 +0,0 @@ -From 477b4307ef12ddce3b6a9205e0bdddbfb2e0e9b6 Mon Sep 17 00:00:00 2001 -From: Bart Van Assche -Date: Sat, 20 Feb 2016 18:58:18 -0800 -Subject: [PATCH] Remove U64 typedef - -The U64 typedef conflicts with a typedef in a Perl header file. Hence -remove the U64 typedef from the Net-SNMP header files. This patch does -not modify the Net-SNMP ABI. ---- - agent/mibgroup/if-mib/ifXTable/ifXTable.c | 16 +- - agent/mibgroup/if-mib/ifXTable/ifXTable.h | 48 +- - .../mibgroup/if-mib/ifXTable/ifXTable_interface.c | 32 +- - .../ip-mib/data_access/systemstats_common.c | 2 +- - .../ipIfStatsTable/ipIfStatsTable_data_get.c | 28 +- - .../ipIfStatsTable/ipIfStatsTable_data_get.h | 28 +- - .../ipIfStatsTable/ipIfStatsTable_interface.c | 56 +- - .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.c | 28 +- - .../ip-mib/ipSystemStatsTable/ipSystemStatsTable.h | 921 ++------------------- - .../ipSystemStatsTable_interface.c | 56 +- - include/net-snmp/data_access/ipstats.h | 42 +- - include/net-snmp/library/int64.h | 34 +- - snmplib/int64.c | 38 +- - snmplib/read_config.c | 6 +- - testing/fulltests/unit-tests/T015int64_clib.c | 10 +- - 15 files changed, 274 insertions(+), 1071 deletions(-) - -diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable.c b/agent/mibgroup/if-mib/ifXTable/ifXTable.c -index bb3e736..0c952ba 100644 ---- a/agent/mibgroup/if-mib/ifXTable/ifXTable.c -+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable.c -@@ -722,7 +722,7 @@ The total number of octets received on the interface, - */ - int - ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInOctets_val_ptr) -+ struct counter64 *ifHCInOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInOctets_val_ptr); -@@ -779,7 +779,7 @@ The number of packets, delivered by this sub-layer to a - */ - int - ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInUcastPkts_val_ptr) -+ struct counter64 *ifHCInUcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInUcastPkts_val_ptr); -@@ -838,7 +838,7 @@ The number of packets, delivered by this sub-layer to a - */ - int - ifHCInMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInMulticastPkts_val_ptr) -+ struct counter64 *ifHCInMulticastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInMulticastPkts_val_ptr); -@@ -897,7 +897,7 @@ The number of packets, delivered by this sub-layer to a - */ - int - ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInBroadcastPkts_val_ptr) -+ struct counter64 *ifHCInBroadcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCInBroadcastPkts_val_ptr); -@@ -955,7 +955,7 @@ The total number of octets transmitted out of the - */ - int - ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutOctets_val_ptr) -+ struct counter64 *ifHCOutOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutOctets_val_ptr); -@@ -1013,7 +1013,7 @@ The total number of packets that higher-level protocols - */ - int - ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutUcastPkts_val_ptr) -+ struct counter64 *ifHCOutUcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutUcastPkts_val_ptr); -@@ -1074,7 +1074,7 @@ The total number of packets that higher-level protocols - */ - int - ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutMulticastPkts_val_ptr) -+ struct counter64 *ifHCOutMulticastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutMulticastPkts_val_ptr); -@@ -1134,7 +1134,7 @@ The total number of packets that higher-level protocols - */ - int - ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutBroadcastPkts_val_ptr) -+ struct counter64 *ifHCOutBroadcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ifHCOutBroadcastPkts_val_ptr); -diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable.h b/agent/mibgroup/if-mib/ifXTable/ifXTable.h -index ba22f97..925af13 100644 ---- a/agent/mibgroup/if-mib/ifXTable/ifXTable.h -+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable.h -@@ -143,28 +143,28 @@ config_require(if-mib/ifXTable/ifXTable_data_access) - u_long * - ifOutBroadcastPkts_val_ptr); - int ifHCInOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInOctets_val_ptr); -+ struct counter64 *ifHCInOctets_val_ptr); - int ifHCInUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCInUcastPkts_val_ptr); -+ struct counter64 *ifHCInUcastPkts_val_ptr); - int ifHCInMulticastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCInMulticastPkts_val_ptr); - int ifHCInBroadcastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCInBroadcastPkts_val_ptr); - int ifHCOutOctets_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutOctets_val_ptr); -+ struct counter64 *ifHCOutOctets_val_ptr); - int ifHCOutUcastPkts_get(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 * ifHCOutUcastPkts_val_ptr); -+ struct counter64 *ifHCOutUcastPkts_val_ptr); - int ifHCOutMulticastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCOutMulticastPkts_val_ptr); - int ifHCOutBroadcastPkts_get(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ifHCOutBroadcastPkts_val_ptr); - int ifLinkUpDownTrapEnable_get(ifXTable_rowreq_ctx * - rowreq_ctx, -@@ -284,86 +284,86 @@ config_require(if-mib/ifXTable/ifXTable_data_access) - - int ifHCInOctets_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInOctets_val); -+ struct counter64 ifHCInOctets_val); - int ifHCInOctets_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInOctets_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCInOctets_val); -+ struct counter64 ifHCInOctets_val); - int ifHCInOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx); - - int ifHCInUcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInUcastPkts_val); -+ struct counter64 ifHCInUcastPkts_val); - int ifHCInUcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCInUcastPkts_val); -+ struct counter64 ifHCInUcastPkts_val); - int ifHCInUcastPkts_undo(ifXTable_rowreq_ctx * rowreq_ctx); - - int ifHCInMulticastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCInMulticastPkts_val); - int ifHCInMulticastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInMulticastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInMulticastPkts_val); -+ struct counter64 ifHCInMulticastPkts_val); - int ifHCInMulticastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCInBroadcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCInBroadcastPkts_val); - int ifHCInBroadcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCInBroadcastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCInBroadcastPkts_val); -+ struct counter64 ifHCInBroadcastPkts_val); - int ifHCInBroadcastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCOutOctets_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutOctets_val); -+ struct counter64 ifHCOutOctets_val); - int ifHCOutOctets_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutOctets_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCOutOctets_val); -+ struct counter64 ifHCOutOctets_val); - int ifHCOutOctets_undo(ifXTable_rowreq_ctx * rowreq_ctx); - - int ifHCOutUcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutUcastPkts_val); -+ struct counter64 ifHCOutUcastPkts_val); - int ifHCOutUcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutUcastPkts_set(ifXTable_rowreq_ctx * rowreq_ctx, -- U64 ifHCOutUcastPkts_val); -+ struct counter64 ifHCOutUcastPkts_val); - int ifHCOutUcastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCOutMulticastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCOutMulticastPkts_val); - int ifHCOutMulticastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutMulticastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutMulticastPkts_val); -+ struct counter64 ifHCOutMulticastPkts_val); - int ifHCOutMulticastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - - int ifHCOutBroadcastPkts_check_value(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 -+ struct counter64 - ifHCOutBroadcastPkts_val); - int ifHCOutBroadcastPkts_undo_setup(ifXTable_rowreq_ctx * - rowreq_ctx); - int ifHCOutBroadcastPkts_set(ifXTable_rowreq_ctx * - rowreq_ctx, -- U64 ifHCOutBroadcastPkts_val); -+ struct counter64 ifHCOutBroadcastPkts_val); - int ifHCOutBroadcastPkts_undo(ifXTable_rowreq_ctx * - rowreq_ctx); - -diff --git a/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c -index 23b50d0..e561842 100644 ---- a/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c -+++ b/agent/mibgroup/if-mib/ifXTable/ifXTable_interface.c -@@ -729,72 +729,72 @@ _ifXTable_get_column(ifXTable_rowreq_ctx * rowreq_ctx, - * ifHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCInUcastPkts(7)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINUCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInUcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCInMulticastPkts(8)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINMULTICASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCInBroadcastPkts(9)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCINBROADCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCInBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCInBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutOctets(10)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutUcastPkts(11)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTUCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutUcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutUcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutMulticastPkts(12)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTMULTICASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutMulticastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutMulticastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* - * ifHCOutBroadcastPkts(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IFHCOUTBROADCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ifHCOutBroadcastPkts_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* -diff --git a/agent/mibgroup/ip-mib/data_access/systemstats_common.c b/agent/mibgroup/ip-mib/data_access/systemstats_common.c -index 29109bd..7434b3a 100644 ---- a/agent/mibgroup/ip-mib/data_access/systemstats_common.c -+++ b/agent/mibgroup/ip-mib/data_access/systemstats_common.c -@@ -264,7 +264,7 @@ _calculate_entries(netsnmp_systemstats_entry * entry) - && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTFRAGCREATES] - && entry->stats.columnAvail[IPSYSTEMSTATSTABLE_HCOUTDISCARDS]) { - -- U64 tmp, tmp2, tmp3; -+ struct counter64 tmp, tmp2, tmp3; - tmp = entry->stats.HCOutRequests; - u64Incr(&tmp, &entry->stats.HCOutForwDatagrams); - u64Incr(&tmp, &entry->stats.HCOutFragCreates); -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -index db673dc..fec36b2 100644 ---- a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.c -@@ -270,7 +270,7 @@ The total number of input IP datagrams received, including - */ - int - ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInReceives_val_ptr) -+ struct counter64 *ipIfStatsHCInReceives_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInReceives_val_ptr); -@@ -395,7 +395,7 @@ The total number of octets received in input IP datagrams, - */ - int - ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInOctets_val_ptr) -+ struct counter64 *ipIfStatsHCInOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInOctets_val_ptr); -@@ -862,7 +862,7 @@ The number of input datagrams for which this entity was not - */ - int - ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInForwDatagrams_val_ptr) -+ struct counter64 *ipIfStatsHCInForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInForwDatagrams_val_ptr); -@@ -1267,7 +1267,7 @@ The total number of datagrams successfully delivered to IP - */ - int - ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInDelivers_val_ptr) -+ struct counter64 *ipIfStatsHCInDelivers_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInDelivers_val_ptr); -@@ -1396,7 +1396,7 @@ The total number of IP datagrams that local IP user- - */ - int - ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutRequests_val_ptr) -+ struct counter64 *ipIfStatsHCOutRequests_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutRequests_val_ptr); -@@ -1532,7 +1532,7 @@ The number of datagrams for which this entity was not their - */ - int - ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutForwDatagrams_val_ptr) -+ struct counter64 *ipIfStatsHCOutForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutForwDatagrams_val_ptr); -@@ -1999,7 +1999,7 @@ The total number of IP datagrams that this entity supplied - */ - int - ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutTransmits_val_ptr) -+ struct counter64 *ipIfStatsHCOutTransmits_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutTransmits_val_ptr); -@@ -2123,7 +2123,7 @@ The total number of octets in IP datagrams delivered to the - */ - int - ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutOctets_val_ptr) -+ struct counter64 *ipIfStatsHCOutOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutOctets_val_ptr); -@@ -2245,7 +2245,7 @@ The number of IP multicast datagrams received. This object - */ - int - ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInMcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCInMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInMcastPkts_val_ptr); -@@ -2372,7 +2372,7 @@ The total number of octets received in IP multicast - */ - int - ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInMcastOctets_val_ptr) -+ struct counter64 *ipIfStatsHCInMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInMcastOctets_val_ptr); -@@ -2497,7 +2497,7 @@ The number of IP multicast datagrams transmitted. This - */ - int - ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutMcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCOutMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutMcastPkts_val_ptr); -@@ -2621,7 +2621,7 @@ The total number of octets transmitted in IP multicast - */ - int - ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutMcastOctets_val_ptr) -+ struct counter64 *ipIfStatsHCOutMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutMcastOctets_val_ptr); -@@ -2743,7 +2743,7 @@ The number of IP broadcast datagrams received. This object - */ - int - ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCInBcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCInBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCInBcastPkts_val_ptr); -@@ -2865,7 +2865,7 @@ The number of IP broadcast datagrams transmitted. This - */ - int - ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipIfStatsHCOutBcastPkts_val_ptr) -+ struct counter64 *ipIfStatsHCOutBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipIfStatsHCOutBcastPkts_val_ptr); -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -index 0cc7e47..ad5d8a0 100644 ---- a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_data_get.h -@@ -50,7 +50,7 @@ extern "C" { - ipIfStatsInReceives_val_ptr); - int ipIfStatsHCInReceives_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInReceives_val_ptr); - int ipIfStatsInOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -58,7 +58,7 @@ extern "C" { - ipIfStatsInOctets_val_ptr); - int ipIfStatsHCInOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInOctets_val_ptr); - int ipIfStatsInHdrErrors_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -87,7 +87,7 @@ extern "C" { - int - ipIfStatsHCInForwDatagrams_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInForwDatagrams_val_ptr); - int ipIfStatsReasmReqds_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -111,7 +111,7 @@ extern "C" { - ipIfStatsInDelivers_val_ptr); - int ipIfStatsHCInDelivers_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInDelivers_val_ptr); - int ipIfStatsOutRequests_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -119,7 +119,7 @@ extern "C" { - ipIfStatsOutRequests_val_ptr); - int ipIfStatsHCOutRequests_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutRequests_val_ptr); - int ipIfStatsOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx - * rowreq_ctx, -@@ -128,7 +128,7 @@ extern "C" { - int - ipIfStatsHCOutForwDatagrams_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutForwDatagrams_val_ptr); - int ipIfStatsOutDiscards_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -156,7 +156,7 @@ extern "C" { - ipIfStatsOutTransmits_val_ptr); - int ipIfStatsHCOutTransmits_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutTransmits_val_ptr); - int ipIfStatsOutOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -164,7 +164,7 @@ extern "C" { - ipIfStatsOutOctets_val_ptr); - int ipIfStatsHCOutOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutOctets_val_ptr); - int ipIfStatsInMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -172,7 +172,7 @@ extern "C" { - ipIfStatsInMcastPkts_val_ptr); - int ipIfStatsHCInMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInMcastPkts_val_ptr); - int ipIfStatsInMcastOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -180,7 +180,7 @@ extern "C" { - ipIfStatsInMcastOctets_val_ptr); - int ipIfStatsHCInMcastOctets_get(ipIfStatsTable_rowreq_ctx - * rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInMcastOctets_val_ptr); - int ipIfStatsOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -188,7 +188,7 @@ extern "C" { - ipIfStatsOutMcastPkts_val_ptr); - int ipIfStatsHCOutMcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutMcastPkts_val_ptr); - int ipIfStatsOutMcastOctets_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -196,7 +196,7 @@ extern "C" { - ipIfStatsOutMcastOctets_val_ptr); - int ipIfStatsHCOutMcastOctets_get(ipIfStatsTable_rowreq_ctx - * rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutMcastOctets_val_ptr); - int ipIfStatsInBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -204,7 +204,7 @@ extern "C" { - ipIfStatsInBcastPkts_val_ptr); - int ipIfStatsHCInBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCInBcastPkts_val_ptr); - int ipIfStatsOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -@@ -212,7 +212,7 @@ extern "C" { - ipIfStatsOutBcastPkts_val_ptr); - int ipIfStatsHCOutBcastPkts_get(ipIfStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipIfStatsHCOutBcastPkts_val_ptr); - int - ipIfStatsDiscontinuityTime_get(ipIfStatsTable_rowreq_ctx * -diff --git a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -index 559d1c1..4955a8b 100644 ---- a/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -+++ b/agent/mibgroup/ip-mib/ipIfStatsTable/ipIfStatsTable_interface.c -@@ -722,10 +722,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINRECEIVES: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInReceives_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -741,9 +741,9 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ipIfStatsHCInOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ipIfStatsHCInOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* -@@ -810,10 +810,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -869,10 +869,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINDELIVERS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInDelivers_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -889,10 +889,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTREQUESTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutRequests_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -909,10 +909,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -979,10 +979,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTTRANSMITS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutTransmits_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -999,9 +999,9 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; -- rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (U64 *) var->val.string); -+ rc = ipIfStatsHCOutOctets_get(rowreq_ctx, (struct counter64 *) var->val.string); - break; - - /* -@@ -1018,10 +1018,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1038,10 +1038,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1058,10 +1058,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1078,10 +1078,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1098,10 +1098,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCINBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCInBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1118,10 +1118,10 @@ _ipIfStatsTable_get_column(ipIfStatsTable_rowreq_ctx * rowreq_ctx, - * ipIfStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPIFSTATSHCOUTBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipIfStatsHCOutBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -index 10587e2..5a9323f 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.c -@@ -452,7 +452,7 @@ The total number of input IP datagrams received, including - */ - int - ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInReceives_val_ptr) -+ struct counter64 *ipSystemStatsHCInReceives_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInReceives_val_ptr); -@@ -579,7 +579,7 @@ The total number of octets received in input IP datagrams, - */ - int - ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInOctets_val_ptr) -+ struct counter64 *ipSystemStatsHCInOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInOctets_val_ptr); -@@ -1058,7 +1058,7 @@ The number of input datagrams for which this entity was not - int - ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -1474,7 +1474,7 @@ The total number of datagrams successfully delivered to IP - */ - int - ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInDelivers_val_ptr) -+ struct counter64 *ipSystemStatsHCInDelivers_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInDelivers_val_ptr); -@@ -1602,7 +1602,7 @@ The total number of IP datagrams which local IP user- - */ - int - ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutRequests_val_ptr) -+ struct counter64 *ipSystemStatsHCOutRequests_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutRequests_val_ptr); -@@ -1809,7 +1809,7 @@ The number of datagrams for which this entity was not their - int - ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutForwDatagrams_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -2288,7 +2288,7 @@ The total number of IP datagrams that this entity supplied - */ - int - ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutTransmits_val_ptr) -+ struct counter64 *ipSystemStatsHCOutTransmits_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutTransmits_val_ptr); -@@ -2415,7 +2415,7 @@ The total number of octets in IP datagrams delivered to the - */ - int - ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutOctets_val_ptr) -+ struct counter64 *ipSystemStatsHCOutOctets_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutOctets_val_ptr); -@@ -2539,7 +2539,7 @@ The number of IP multicast datagrams received. This object - */ - int - ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInMcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCInMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInMcastPkts_val_ptr); -@@ -2665,7 +2665,7 @@ The total number of octets received in IP multicast - int - ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -2790,7 +2790,7 @@ The number of IP multicast datagrams transmitted. This - */ - int - ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutMcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCOutMcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutMcastPkts_val_ptr); -@@ -2921,7 +2921,7 @@ The total number of octets transmitted in IP multicast - int - ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutMcastOctets_val_ptr) - { - /** we should have a non-NULL pointer */ -@@ -3046,7 +3046,7 @@ The number of IP broadcast datagrams received. This object - */ - int - ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCInBcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCInBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCInBcastPkts_val_ptr); -@@ -3170,7 +3170,7 @@ The number of IP broadcast datagrams transmitted. This - */ - int - ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, -- U64 * ipSystemStatsHCOutBcastPkts_val_ptr) -+ struct counter64 *ipSystemStatsHCOutBcastPkts_val_ptr) - { - /** we should have a non-NULL pointer */ - netsnmp_assert(NULL != ipSystemStatsHCOutBcastPkts_val_ptr); -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h -index ca1e1f3..5c3823e 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable.h -@@ -144,93 +144,22 @@ config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access) - ********************************************************************* - * function prototypes - */ -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_pre_request(ipSystemStatsTable_registration * -+ int ipSystemStatsTable_pre_request(ipSystemStatsTable_registration * - user_context); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_post_request(ipSystemStatsTable_registration * -+ int ipSystemStatsTable_post_request(ipSystemStatsTable_registration * - user_context, int rc); - -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsTable_rowreq_ctx_init(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - void *user_init_ctx); - void -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- - ipSystemStatsTable_rowreq_ctx_cleanup(ipSystemStatsTable_rowreq_ctx - * rowreq_ctx); - - ipSystemStatsTable_data *ipSystemStatsTable_allocate_data(void); - void ipSystemStatsTable_release_data(ipSystemStatsTable_data - * data); -- -- -- -- -- -- -- -- -- ipSystemStatsTable_rowreq_ctx -+ ipSystemStatsTable_rowreq_ctx - * ipSystemStatsTable_row_find_by_mib_index - (ipSystemStatsTable_mib_index * mib_idx); - -@@ -265,226 +194,50 @@ config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access) - * indexes - */ - -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInReceives_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInReceives_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInReceives_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInReceives_val_ptr); - int ipSystemStatsInOctets_get(ipSystemStatsTable_rowreq_ctx - * rowreq_ctx, - u_long * - ipSystemStatsInOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * ipSystemStatsHCInOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx * -+ struct counter64 *ipSystemStatsHCInOctets_val_ptr); -+ int ipSystemStatsInHdrErrors_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInHdrErrors_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInNoRoutes_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInNoRoutes_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInAddrErrors_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInAddrErrors_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInUnknownProtos_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInUnknownProtos_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInTruncatedPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInTruncatedPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsReasmReqds_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsReasmReqds_val_ptr); -@@ -492,690 +245,142 @@ config_require(ip-mib/ipSystemStatsTable/ipSystemStatsTable_data_access) - * rowreq_ctx, - u_long * - ipSystemStatsReasmOKs_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsReasmFails_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsReasmFails_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInDiscards_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInDiscards_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInDelivers_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInDelivers_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInDelivers_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInDelivers_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutRequests_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutRequests_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutRequests_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutRequests_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutNoRoutes_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutNoRoutes_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutForwDatagrams_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutForwDatagrams_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutDiscards_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutDiscards_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragReqds_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragReqds_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragOKs_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragOKs_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragFails_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragFails_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutFragCreates_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutFragCreates_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutTransmits_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutTransmits_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutTransmits_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutTransmits_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutMcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutMcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutMcastOctets_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutMcastOctets_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsInBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCInBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCInBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsOutBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsHCOutBcastPkts_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, -- U64 * -+ struct counter64 * - ipSystemStatsHCOutBcastPkts_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsDiscontinuityTime_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsDiscontinuityTime_val_ptr); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsRefreshRate_get(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long * - ipSystemStatsRefreshRate_val_ptr); -- -- -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index -+ int ipSystemStatsTable_indexes_set_tbl_idx(ipSystemStatsTable_mib_index - * tbl_idx, - u_long - ipSystemStatsIPVersion_val); -- int -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx * -+ int ipSystemStatsTable_indexes_set(ipSystemStatsTable_rowreq_ctx * - rowreq_ctx, - u_long ipSystemStatsIPVersion_val); - -- -- - /* - ********************************************************************* - * SET function declarations -diff --git a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c -index e1ca2cb..09c061f 100644 ---- a/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c -+++ b/agent/mibgroup/ip-mib/ipSystemStatsTable/ipSystemStatsTable_interface.c -@@ -674,10 +674,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInReceives(4)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINRECEIVES: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInReceives_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -694,10 +694,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInOctets(6)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -764,10 +764,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInForwDatagrams(13)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -824,10 +824,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInDelivers(19)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINDELIVERS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInDelivers_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -844,10 +844,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutRequests(21)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTREQUESTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutRequests_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -874,10 +874,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutForwDatagrams(24)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTFORWDATAGRAMS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutForwDatagrams_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -944,10 +944,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutTransmits(31)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTTRANSMITS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutTransmits_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -964,10 +964,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutOctets(33)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -984,10 +984,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInMcastPkts(35)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1004,10 +1004,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInMcastOctets(37)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1024,10 +1024,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutMcastPkts(39)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTMCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutMcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1044,10 +1044,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutMcastOctets(41)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTMCASTOCTETS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutMcastOctets_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1064,10 +1064,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCInBcastPkts(43)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCINBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCInBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -@@ -1084,10 +1084,10 @@ _ipSystemStatsTable_get_column(ipSystemStatsTable_rowreq_ctx * rowreq_ctx, - * ipSystemStatsHCOutBcastPkts(45)/COUNTER64/ASN_COUNTER64/U64(U64)//l/A/w/e/r/d/h - */ - case COLUMN_IPSYSTEMSTATSHCOUTBCASTPKTS: -- var->val_len = sizeof(U64); -+ var->val_len = sizeof(struct counter64); - var->type = ASN_COUNTER64; - rc = ipSystemStatsHCOutBcastPkts_get(rowreq_ctx, -- (U64 *) var->val.string); -+ (struct counter64 *) var->val.string); - break; - - /* -diff --git a/include/net-snmp/data_access/ipstats.h b/include/net-snmp/data_access/ipstats.h -index f782459..f0df46b 100644 ---- a/include/net-snmp/data_access/ipstats.h -+++ b/include/net-snmp/data_access/ipstats.h -@@ -58,45 +58,45 @@ typedef struct netsnmp_ipstats_s { - * other columns, when underlying OS does not provide them. - * Always fill at least 32 bits, the table is periodically polled -> 32 bit - * overflow shall be detected and 64 bit value should be computed automatically. */ -- U64 HCInReceives; -- U64 HCInOctets; -+ struct counter64 HCInReceives; -+ struct counter64 HCInOctets; - u_long InHdrErrors; -- U64 HCInNoRoutes; -+ struct counter64 HCInNoRoutes; - u_long InAddrErrors; - u_long InUnknownProtos; - u_long InTruncatedPkts; - - /* optional, can be computed from HCInNoRoutes and HCOutForwDatagrams */ -- U64 HCInForwDatagrams; -+ struct counter64 HCInForwDatagrams; - - u_long ReasmReqds; - u_long ReasmOKs; - u_long ReasmFails; - u_long InDiscards; -- U64 HCInDelivers; -- U64 HCOutRequests; -- U64 HCOutNoRoutes; -- U64 HCOutForwDatagrams; -- U64 HCOutDiscards; -+ struct counter64 HCInDelivers; -+ struct counter64 HCOutRequests; -+ struct counter64 HCOutNoRoutes; -+ struct counter64 HCOutForwDatagrams; -+ struct counter64 HCOutDiscards; - - /* optional, can be computed from HCOutFragOKs + HCOutFragFails*/ -- U64 HCOutFragReqds; -- U64 HCOutFragOKs; -- U64 HCOutFragFails; -- U64 HCOutFragCreates; -+ struct counter64 HCOutFragReqds; -+ struct counter64 HCOutFragOKs; -+ struct counter64 HCOutFragFails; -+ struct counter64 HCOutFragCreates; - - /* optional, can be computed from - * HCOutRequests +HCOutForwDatagrams + HCOutFragCreates - * - HCOutFragReqds - HCOutNoRoutes - HCOutDiscards */ -- U64 HCOutTransmits; -+ struct counter64 HCOutTransmits; - -- U64 HCOutOctets; -- U64 HCInMcastPkts; -- U64 HCInMcastOctets; -- U64 HCOutMcastPkts; -- U64 HCOutMcastOctets; -- U64 HCInBcastPkts; -- U64 HCOutBcastPkts; -+ struct counter64 HCOutOctets; -+ struct counter64 HCInMcastPkts; -+ struct counter64 HCInMcastOctets; -+ struct counter64 HCOutMcastPkts; -+ struct counter64 HCOutMcastOctets; -+ struct counter64 HCInBcastPkts; -+ struct counter64 HCOutBcastPkts; - - /* Array of available columns.*/ - int columnAvail[IPSYSTEMSTATSTABLE_LAST+1]; -diff --git a/include/net-snmp/library/int64.h b/include/net-snmp/library/int64.h -index 9c7c894..3a85213 100644 ---- a/include/net-snmp/library/int64.h -+++ b/include/net-snmp/library/int64.h -@@ -5,31 +5,29 @@ - extern "C" { - #endif - -- typedef struct counter64 U64; -- - #define I64CHARSZ 21 - -- void divBy10(U64, U64 *, unsigned int *); -- void multBy10(U64, U64 *); -- void incrByU16(U64 *, unsigned int); -- void incrByU32(U64 *, unsigned int); -+ void divBy10(struct counter64, struct counter64 *, unsigned int *); -+ void multBy10(struct counter64, struct counter64 *); -+ void incrByU16(struct counter64 *, unsigned int); -+ void incrByU32(struct counter64 *, unsigned int); - NETSNMP_IMPORT -- void zeroU64(U64 *); -- int isZeroU64(const U64 *); -+ void zeroU64(struct counter64 *); -+ int isZeroU64(const struct counter64 *); - NETSNMP_IMPORT -- void printU64(char *, const U64 *); -+ void printU64(char *, const struct counter64 *); - NETSNMP_IMPORT -- void printI64(char *, const U64 *); -- int read64(U64 *, const char *); -+ void printI64(char *, const struct counter64 *); -+ int read64(struct counter64 *, const char *); - NETSNMP_IMPORT -- void u64Subtract(const U64 * pu64one, const U64 * pu64two, -- U64 * pu64out); -- void u64Incr(U64 * pu64out, const U64 * pu64one); -- void u64UpdateCounter(U64 * pu64out, const U64 * pu64one, -- const U64 * pu64two); -- void u64Copy(U64 * pu64one, const U64 * pu64two); -+ void u64Subtract(const struct counter64 *pu64one, const struct counter64 *pu64two, -+ struct counter64 *pu64out); -+ void u64Incr(struct counter64 *pu64out, const struct counter64 *pu64one); -+ void u64UpdateCounter(struct counter64 *pu64out, const struct counter64 *pu64one, -+ const struct counter64 *pu64two); -+ void u64Copy(struct counter64 *pu64one, const struct counter64 *pu64two); - -- int netsnmp_c64_check_for_32bit_wrap(U64 *old_val, U64 *new_val, -+ int netsnmp_c64_check_for_32bit_wrap(struct counter64 *old_val, struct counter64 *new_val, - int adjust); - NETSNMP_IMPORT - int netsnmp_c64_check32_and_update(struct counter64 *prev_val, -diff --git a/snmplib/int64.c b/snmplib/int64.c -index 51f1f32..951f813 100644 ---- a/snmplib/int64.c -+++ b/snmplib/int64.c -@@ -33,7 +33,7 @@ - * @param[out] puR Remainder. - */ - void --divBy10(U64 u64, U64 * pu64Q, unsigned int *puR) -+divBy10(struct counter64 u64, struct counter64 *pu64Q, unsigned int *puR) - { - unsigned long ulT; - unsigned long ulQ; -@@ -83,7 +83,7 @@ divBy10(U64 u64, U64 * pu64Q, unsigned int *puR) - * @param[out] pu64P Product. - */ - void --multBy10(U64 u64, U64 * pu64P) -+multBy10(struct counter64 u64, struct counter64 *pu64P) - { - unsigned long ulT; - unsigned long ulP; -@@ -130,7 +130,7 @@ multBy10(U64 u64, U64 * pu64P) - * - */ - void --incrByU16(U64 * pu64, unsigned int u16) -+incrByU16(struct counter64 *pu64, unsigned int u16) - { - incrByU32(pu64, u16); - } -@@ -143,7 +143,7 @@ incrByU16(U64 * pu64, unsigned int u16) - * - */ - void --incrByU32(U64 * pu64, unsigned int u32) -+incrByU32(struct counter64 *pu64, unsigned int u32) - { - uint32_t tmp; - -@@ -161,7 +161,7 @@ incrByU32(U64 * pu64, unsigned int u32) - * @param[out] pu64out pu64one - pu64two. - */ - void --u64Subtract(const U64 * pu64one, const U64 * pu64two, U64 * pu64out) -+u64Subtract(const struct counter64 *pu64one, const struct counter64 *pu64two, struct counter64 *pu64out) - { - int carry; - -@@ -177,7 +177,7 @@ u64Subtract(const U64 * pu64one, const U64 * pu64two, U64 * pu64out) - * @param[in,out] pu64out pu64out += pu64one. - */ - void --u64Incr(U64 * pu64out, const U64 * pu64one) -+u64Incr(struct counter64 *pu64out, const struct counter64 *pu64one) - { - pu64out->high = (uint32_t)(pu64out->high + pu64one->high); - incrByU32(pu64out, pu64one->low); -@@ -191,9 +191,9 @@ u64Incr(U64 * pu64out, const U64 * pu64one) - * @param[out] pu64out pu64out += (pu64one - pu64two) - */ - void --u64UpdateCounter(U64 * pu64out, const U64 * pu64one, const U64 * pu64two) -+u64UpdateCounter(struct counter64 *pu64out, const struct counter64 *pu64one, const struct counter64 *pu64two) - { -- U64 tmp; -+ struct counter64 tmp; - - u64Subtract(pu64one, pu64two, &tmp); - u64Incr(pu64out, &tmp); -@@ -208,7 +208,7 @@ netsnmp_feature_child_of(u64copy, netsnmp_unused) - * @param[out] pu64one Where to store the copy - *pu64one = *pu64two. - */ - void --u64Copy(U64 * pu64one, const U64 * pu64two) -+u64Copy(struct counter64 *pu64one, const struct counter64 *pu64two) - { - *pu64one = *pu64two; - } -@@ -220,7 +220,7 @@ u64Copy(U64 * pu64one, const U64 * pu64two) - * @param[in] pu64 Number to be zeroed. - */ - void --zeroU64(U64 * pu64) -+zeroU64(struct counter64 *pu64) - { - pu64->low = 0; - pu64->high = 0; -@@ -232,7 +232,7 @@ zeroU64(U64 * pu64) - * @param[in] pu64 Number to be checked. - */ - int --isZeroU64(const U64 * pu64) -+isZeroU64(const struct counter64 *pu64) - { - return pu64->low == 0 && pu64->high == 0; - } -@@ -390,10 +390,10 @@ netsnmp_c64_check32_and_update(struct counter64 *prev_val, struct counter64 *new - /** Convert an unsigned 64-bit number to ASCII. */ - void - printU64(char *buf, /* char [I64CHARSZ+1]; */ -- const U64 * pu64) -+ const struct counter64 *pu64) - { -- U64 u64a; -- U64 u64b; -+ struct counter64 u64a; -+ struct counter64 u64b; - - char aRes[I64CHARSZ + 1]; - unsigned int u; -@@ -414,9 +414,9 @@ printU64(char *buf, /* char [I64CHARSZ+1]; */ - /** Convert a signed 64-bit number to ASCII. */ - void - printI64(char *buf, /* char [I64CHARSZ+1]; */ -- const U64 * pu64) -+ const struct counter64 *pu64) - { -- U64 u64a; -+ struct counter64 u64a; - - if (pu64->high & 0x80000000) { - u64a.high = (uint32_t) ~pu64->high; -@@ -429,11 +429,11 @@ printI64(char *buf, /* char [I64CHARSZ+1]; */ - } - } - --/** Convert a signed 64-bit integer from ASCII to U64. */ -+/** Convert a signed 64-bit integer from ASCII to struct counter64. */ - int --read64(U64 * i64, const char *str) -+read64(struct counter64 *i64, const char *str) - { -- U64 i64p; -+ struct counter64 i64p; - unsigned int u; - int sign = 0; - int ok = 0; -diff --git a/snmplib/read_config.c b/snmplib/read_config.c -index e159c27..ab5b6a3 100644 ---- a/snmplib/read_config.c -+++ b/snmplib/read_config.c -@@ -2279,10 +2279,10 @@ read_config_read_memory(int type, char *readfrom, - return readfrom; - - case ASN_COUNTER64: -- if (*len < sizeof(U64)) -+ if (*len < sizeof(struct counter64)) - return NULL; -- *len = sizeof(U64); -- read64((U64 *) dataptr, readfrom); -+ *len = sizeof(struct counter64); -+ read64((struct counter64 *) dataptr, readfrom); - readfrom = skip_token(readfrom); - return readfrom; - } -diff --git a/testing/fulltests/unit-tests/T015int64_clib.c b/testing/fulltests/unit-tests/T015int64_clib.c -index 5f5f4b6..66f66b7 100644 ---- a/testing/fulltests/unit-tests/T015int64_clib.c -+++ b/testing/fulltests/unit-tests/T015int64_clib.c -@@ -1,4 +1,4 @@ --/* HEADER Testing 64-bit integer operations (U64). */ -+/* HEADER Testing 64-bit integer operations (struct counter64). */ - - int i, j; - char buf[22]; -@@ -15,7 +15,7 @@ static const int64_t intval[] = { - }; - - for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { -- U64 a, b; -+ struct counter64 a, b; - a.low = (uint32_t)intval[i]; - a.high = (uint32_t)(intval[i] >> 32); - printI64(buf, &a); -@@ -27,7 +27,7 @@ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - - for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) { -- U64 a, b; -+ struct counter64 a, b; - uint64_t d; - a.low = (uint32_t)intval[i]; - a.high = (uint32_t)(intval[i] >> 32); -@@ -43,7 +43,7 @@ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - - for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - for (j = i; j < sizeof(intval)/sizeof(intval[0]); ++j) { -- U64 a, b, c; -+ struct counter64 a, b, c; - uint64_t d; - a.low = (uint32_t)intval[i]; - a.high = (uint32_t)(intval[i] >> 32); -@@ -58,7 +58,7 @@ for (i = 0; i < sizeof(intval)/sizeof(intval[0]); ++i) { - } - - { -- U64 old_val, new_val; -+ struct counter64 old_val, new_val; - old_val.low = 7; - old_val.high = 0; - new_val = old_val; --- -2.5.5 diff --git a/net-snmp-5.7.3-build-with-openssl-1.1.patch b/net-snmp-5.7.3-build-with-openssl-1.1.patch deleted file mode 100644 index 92a92dc..0000000 --- a/net-snmp-5.7.3-build-with-openssl-1.1.patch +++ /dev/null @@ -1,1287 +0,0 @@ -From 392e006fc5c64a74ec080b090d02a2d29340494c Mon Sep 17 00:00:00 2001 -From: Daniel Molkentin -Date: Wed, 22 Mar 2017 14:49:06 +0100 -Subject: [PATCH] Backport several fixes from upstream's V5-7-patches branch. - -Initial support for OpenSSL 1.1 API changes. A slightly modified version from -patch 1336, updated to work if you have LibreSSL. - -There is more work needed to handle TLSTCP and DTLSUDP transports. - -Thanks to Sharmila Podury. - -OpenSSL 1.1 fixes for SNMP-USM-DH-OBJECTS-MIB implementation. - -openssl 1.1.0: Fix several build errors - -Autodetect DH_get0_pqg() and DH_get0_key() to unbreak the MinGW build. - -In recent versions of openssl several data structures have been made -opaque that were not opaque before. Avoid that attempts to access -members of these opaque data structures cause the build to fail. - -MIBs: Use strlcpy() instead of strcpy() to copy a variable-length string into a fixed-size array - -apps/snmpusm: Only provide a DH_get0_key() replacement if openssl is available ---- - agent/mibgroup/disman/event/mteEvent.c | 6 +- - agent/mibgroup/disman/event/mteTriggerConf.c | 5 +- - agent/mibgroup/disman/schedule/schedCore.c | 17 +-- - agent/mibgroup/hardware/cpu/cpu.c | 2 +- - agent/mibgroup/hardware/cpu/cpu_linux.c | 2 +- - agent/mibgroup/hardware/cpu/cpu_pcp.c | 2 +- - agent/mibgroup/hardware/cpu/cpu_sysinfo.c | 2 +- - agent/mibgroup/hardware/sensors/hw_sensors.c | 2 +- - agent/mibgroup/host/hr_disk.c | 3 +- - agent/mibgroup/host/hr_network.c | 2 +- - agent/mibgroup/host/hr_swrun.c | 34 +++--- - agent/mibgroup/mibII/mta_sendmail.c | 4 +- - agent/mibgroup/mibII/system_mib.c | 2 +- - agent/mibgroup/mibII/vacm_conf.c | 13 ++- - .../usmDHParameters/usmDHParameters.c | 39 ++++++- - .../usmDHUserKeyTable/usmDHUserKeyTable_data_get.c | 67 +++++++++++- - agent/mibgroup/target/snmpTargetParamsEntry.c | 3 +- - agent/mibgroup/ucd-snmp/logmatch.c | 5 +- - agent/mibgroup/ucd-snmp/proc.c | 2 +- - agent/mibgroup/util_funcs.c | 2 +- - agent/mibgroup/util_funcs/get_pid_from_inode.c | 4 +- - apps/snmpusm.c | 51 +++++++-- - configure | 115 ++++++++++++++++++++- - configure.d/config_os_libs2 | 29 +++++- - include/net-snmp/net-snmp-config.h.in | 21 ++++ - snmplib/keytools.c | 8 +- - snmplib/scapi.c | 8 +- - snmplib/snmp_openssl.c | 36 +++++-- - snmplib/vacm.c | 20 ++-- - win32/net-snmp/net-snmp-config.h | 15 +++ - win32/net-snmp/net-snmp-config.h.in | 15 +++ - 31 files changed, 440 insertions(+), 96 deletions(-) - -diff --git a/agent/mibgroup/disman/event/mteEvent.c b/agent/mibgroup/disman/event/mteEvent.c -index bc4ff0bfb..880520f22 100644 ---- a/agent/mibgroup/disman/event/mteEvent.c -+++ b/agent/mibgroup/disman/event/mteEvent.c -@@ -76,9 +76,7 @@ _init_builtin_mteEvent( const char *event, const char *oname, oid *trapOID, size - netsnmp_tdata_row *row; - struct mteEvent *entry; - -- memset(ename, 0, sizeof(ename)); -- ename[0] = '_'; -- memcpy(ename+1, event, strlen(event)); -+ snprintf(ename, sizeof(ename), "_%s", event); - - row = mteEvent_createEntry( "_snmpd", ename, 1 ); - if (!row || !row->data) -@@ -89,7 +87,7 @@ _init_builtin_mteEvent( const char *event, const char *oname, oid *trapOID, size - entry->mteNotification_len = trapOID_len; - memcpy( entry->mteNotification, trapOID, trapOID_len*sizeof(oid)); - memcpy( entry->mteNotifyOwner, "_snmpd", 6 ); -- memcpy( entry->mteNotifyObjects, oname, strlen(oname)); -+ strlcpy(entry->mteNotifyObjects, oname, sizeof(entry->mteNotifyObjects)); - entry->flags |= MTE_EVENT_FLAG_ENABLED| - MTE_EVENT_FLAG_ACTIVE| - MTE_EVENT_FLAG_VALID; -diff --git a/agent/mibgroup/disman/event/mteTriggerConf.c b/agent/mibgroup/disman/event/mteTriggerConf.c -index e7bb69b28..a0eaf2f3d 100644 ---- a/agent/mibgroup/disman/event/mteTriggerConf.c -+++ b/agent/mibgroup/disman/event/mteTriggerConf.c -@@ -507,13 +507,12 @@ parse_mteMonitor(const char *token, const char *line) - memcpy(oid_name_buf, buf, SPRINT_MAX_LEN); - memset( buf, 0, SPRINT_MAX_LEN); - cp = copy_nword_const(cp, buf, SPRINT_MAX_LEN); -- value = strtol(buf, NULL, 0); -+ value = strtol(buf, NULL, 0); - - /* - * ... then save the rest of the line for later. - */ -- memset( buf, 0, strlen(buf)); -- memcpy( buf, cp, strlen(cp)); -+ strlcpy(buf, cp, sizeof(buf)); - cp = NULL; /* To terminate the processing loop */ - DEBUGMSGTL(("disman:event:conf", "%s: Thresh (%s, %ld, %s)\n", - tname, oid_name_buf, value, buf)); -diff --git a/agent/mibgroup/disman/schedule/schedCore.c b/agent/mibgroup/disman/schedule/schedCore.c -index c3db34f20..9dcf63b12 100644 ---- a/agent/mibgroup/disman/schedule/schedCore.c -+++ b/agent/mibgroup/disman/schedule/schedCore.c -@@ -454,6 +454,7 @@ schedTable_createEntry(const char *schedOwner, const char *schedName) - { - struct schedTable_entry *entry; - netsnmp_tdata_row *row; -+ int len; - - DEBUGMSGTL(("disman:schedule:entry", "creating entry (%s, %s)\n", - schedOwner, schedName)); -@@ -472,16 +473,20 @@ schedTable_createEntry(const char *schedOwner, const char *schedName) - * data structure, and in the table_data helper. - */ - if (schedOwner) { -- memcpy(entry->schedOwner, schedOwner, strlen(schedOwner)); -- netsnmp_tdata_row_add_index(row, ASN_OCTET_STR, -- entry->schedOwner, strlen(schedOwner)); -+ len = strlen(schedOwner); -+ if (len > sizeof(entry->schedOwner)) -+ len = sizeof(entry->schedOwner); -+ memcpy(entry->schedOwner, schedOwner, len); -+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR, entry->schedOwner, len); - } - else - netsnmp_tdata_row_add_index(row, ASN_OCTET_STR, "", 0 ); - -- memcpy( entry->schedName, schedName, strlen(schedName)); -- netsnmp_tdata_row_add_index(row, ASN_OCTET_STR, -- entry->schedName, strlen(schedName)); -+ len = strlen(schedName); -+ if (len > sizeof(entry->schedName)) -+ len = sizeof(entry->schedName); -+ memcpy(entry->schedName, schedName, len); -+ netsnmp_tdata_row_add_index(row, ASN_OCTET_STR, entry->schedName, len); - /* - * Set the (non-zero) default values in the row data structure. - */ -diff --git a/agent/mibgroup/hardware/cpu/cpu.c b/agent/mibgroup/hardware/cpu/cpu.c -index 27720016d..80fef1853 100644 ---- a/agent/mibgroup/hardware/cpu/cpu.c -+++ b/agent/mibgroup/hardware/cpu/cpu.c -@@ -148,7 +148,7 @@ netsnmp_cpu_info *netsnmp_cpu_get_byName( char *name, int create ) { - return NULL; - } - -- strcpy(cpu->name, name); -+ strlcpy(cpu->name, name, sizeof(cpu)); - if ( _cpu_tail ) { - cpu->idx = _cpu_tail->idx+1; - _cpu_tail->next = cpu; -diff --git a/agent/mibgroup/hardware/cpu/cpu_linux.c b/agent/mibgroup/hardware/cpu/cpu_linux.c -index b1dc30832..b221afc55 100644 ---- a/agent/mibgroup/hardware/cpu/cpu_linux.c -+++ b/agent/mibgroup/hardware/cpu/cpu_linux.c -@@ -72,7 +72,7 @@ void init_cpu_linux( void ) { - #ifdef DESCR_FIELD - if (!strncmp( buf, DESCR_FIELD, strlen(DESCR_FIELD))) { - cp = strchr( buf, ':' ); -- strcpy( cpu->descr, cp+2 ); -+ strlcpy(cpu->descr, cp + 2, sizeof(cpu->descr)); - cp = strchr( cpu->descr, '\n' ); - *cp = 0; - } -diff --git a/agent/mibgroup/hardware/cpu/cpu_pcp.c b/agent/mibgroup/hardware/cpu/cpu_pcp.c -index 94c7b5cfa..62c0a0443 100644 ---- a/agent/mibgroup/hardware/cpu/cpu_pcp.c -+++ b/agent/mibgroup/hardware/cpu/cpu_pcp.c -@@ -120,7 +120,7 @@ void init_cpu_pcp( void ) { - for (i=0; iname, tstr); -+ strlcpy(cpu->name, tstr, sizeof(cpu->name)); - strcpy(cpu->descr, "An electronic chip that makes the computer work"); - } - } -diff --git a/agent/mibgroup/hardware/cpu/cpu_sysinfo.c b/agent/mibgroup/hardware/cpu/cpu_sysinfo.c -index ed1f3579f..7b009a226 100644 ---- a/agent/mibgroup/hardware/cpu/cpu_sysinfo.c -+++ b/agent/mibgroup/hardware/cpu/cpu_sysinfo.c -@@ -66,7 +66,7 @@ void init_cpu_sysinfo( void ) - { - cpu = netsnmp_cpu_get_byIdx(i, 1); - sprintf(tstr, "cpu%d",i); -- strcpy(cpu->name, tstr); -+ strlcpy(cpu->name, tstr, sizeof(cpu->name)); - strcpy(cpu->descr, "Central Processing Unit"); - } - } -diff --git a/agent/mibgroup/hardware/sensors/hw_sensors.c b/agent/mibgroup/hardware/sensors/hw_sensors.c -index 1a0164553..a5341d0f9 100644 ---- a/agent/mibgroup/hardware/sensors/hw_sensors.c -+++ b/agent/mibgroup/hardware/sensors/hw_sensors.c -@@ -168,7 +168,7 @@ sensor_by_name( const char *name, int create_type ) - free(sp); - return NULL; - } -- strcpy( sp->name, name ); -+ strlcpy(sp->name, name, sizeof(sp->name)); - sp->type = create_type; - /* - * Set up the index value. -diff --git a/agent/mibgroup/host/hr_disk.c b/agent/mibgroup/host/hr_disk.c -index c4ac52f09..27629f673 100644 ---- a/agent/mibgroup/host/hr_disk.c -+++ b/agent/mibgroup/host/hr_disk.c -@@ -407,7 +407,7 @@ parse_disk_config(const char *token, char *cptr) - *p != '\0' && *p != '?' && *p != '*' && *p != '['; p++); - c = *p; - *p = '\0'; -- d_str = (char *) malloc(strlen(name) + 1); -+ d_str = strdup(name); - if (!d_str) { - SNMP_FREE(d_new); - SNMP_FREE(d_str); -@@ -416,7 +416,6 @@ parse_disk_config(const char *token, char *cptr) - config_perror("Out of memory"); - return; - } -- strcpy(d_str, name); - *p = c; - di_curr->item_type = ITEM_STRING; - di_curr->item_details = (void *) d_str; -diff --git a/agent/mibgroup/host/hr_network.c b/agent/mibgroup/host/hr_network.c -index 6cce58c8f..3036d9200 100644 ---- a/agent/mibgroup/host/hr_network.c -+++ b/agent/mibgroup/host/hr_network.c -@@ -257,7 +257,7 @@ int HRN_index; - void - Save_HR_Network_Info(void) - { -- strcpy(HRN_savedName, HRN_name); -+ strlcpy(HRN_savedName, HRN_name, sizeof(HRN_savedName)); - #if defined( USING_IF_MIB_IFTABLE_IFTABLE_DATA_ACCESS_MODULE ) - HRN_savedFlags = HRN_ifnet->os_flags; - HRN_savedErrors = HRN_ifnet->stats.ierrors + HRN_ifnet->stats.oerrors; -diff --git a/agent/mibgroup/host/hr_swrun.c b/agent/mibgroup/host/hr_swrun.c -index f40e99790..1fc9ae3e4 100644 ---- a/agent/mibgroup/host/hr_swrun.c -+++ b/agent/mibgroup/host/hr_swrun.c -@@ -698,13 +698,13 @@ var_hrswrun(struct variable * vp, - *cp = '\0'; - #elif HAVE_KVM_GETPROCS - #if defined(freebsd5) && __FreeBSD_version >= 500014 -- strcpy(string, proc_table[LowProcIndex].ki_comm); -+ strlcpy(string, proc_table[LowProcIndex].ki_comm, sizeof(string)); - #elif defined(dragonfly) && __DragonFly_version >= 190000 -- strcpy(string, proc_table[LowProcIndex].kp_comm); -+ strlcpy(string, proc_table[LowProcIndex].kp_comm, sizeof(string)); - #elif defined(openbsd5) -- strcpy(string, proc_table[LowProcIndex].p_comm); -+ strlcpy(string, proc_table[LowProcIndex].p_comm, sizeof(string)); - #else -- strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm); -+ strlcpy(string, proc_table[LowProcIndex].kp_proc.p_comm, sizeof(string)); - #endif - #elif defined(linux) - if( (cp=get_proc_name_from_status(pid,buf,sizeof(buf))) == NULL ) { -@@ -712,7 +712,7 @@ var_hrswrun(struct variable * vp, - *var_len = strlen(string); - return (u_char *) string; - } -- strcpy(string, cp); -+ strlcpy(string, cp, sizeof(string)); - #elif defined(cygwin) - /* if (lowproc.process_state & (PID_ZOMBIE | PID_EXITED)) */ - if (lowproc.process_state & PID_EXITED || (lowproc.exitcode & ~0xffff)) -@@ -721,7 +721,7 @@ var_hrswrun(struct variable * vp, - cygwin_conv_to_posix_path(lowproc.progname, string); - cp = strrchr(string, '/'); - if (cp) -- strcpy(string, cp + 1); -+ strlcpy(string, cp + 1, sizeof(string)); - } else if (query == CW_GETPINFO_FULL) { - DWORD n = lowproc.dwProcessId & 0xffff; - HANDLE h = -@@ -739,7 +739,7 @@ var_hrswrun(struct variable * vp, - sizeof string)) { - cp = strrchr(string, '\\'); - if (cp) -- strcpy(string, cp + 1); -+ strlcpy(string, cp + 1, sizeof(string)); - } else - strcpy(string, "*** unknown"); - CloseHandle(h); -@@ -795,7 +795,7 @@ var_hrswrun(struct variable * vp, - #elif defined(solaris2) - #ifdef _SLASH_PROC_METHOD_ - if (proc_buf) -- strcpy(string, proc_buf->pr_psargs); -+ strlcpy(string, proc_buf->pr_psargs, sizeof(string)); - else - sprintf(string, ""); - cp = strchr(string, ' '); -@@ -821,18 +821,18 @@ var_hrswrun(struct variable * vp, - *cp = '\0'; - #elif HAVE_KVM_GETPROCS - #if defined(freebsd5) && __FreeBSD_version >= 500014 -- strcpy(string, proc_table[LowProcIndex].ki_comm); -+ strlcpy(string, proc_table[LowProcIndex].ki_comm, sizeof(string)); - #elif defined(dragonfly) && __DragonFly_version >= 190000 -- strcpy(string, proc_table[LowProcIndex].kp_comm); -+ strlcpy(string, proc_table[LowProcIndex].kp_comm, sizeof(string)); - #elif defined(openbsd5) -- strcpy(string, proc_table[LowProcIndex].p_comm); -+ strlcpy(string, proc_table[LowProcIndex].p_comm, sizeof(string)); - #else -- strcpy(string, proc_table[LowProcIndex].kp_proc.p_comm); -+ strlcpy(string, proc_table[LowProcIndex].kp_proc.p_comm, sizeof(string)); - #endif - #elif defined(linux) - cp = get_proc_name_from_cmdline(pid,buf,sizeof(buf)-1); - if (cp != NULL && *cp) /* argv[0] '\0' argv[1] '\0' .... */ -- strcpy(string, cp); -+ strlcpy(string, cp, sizeof(string)); - else { - /* - * swapped out - no cmdline -@@ -842,7 +842,7 @@ var_hrswrun(struct variable * vp, - *var_len = strlen(string); - return (u_char *) string; - } -- strcpy(string, cp); -+ strlcpy(string, cp, sizeof(string)); - } - #elif defined(cygwin) - /* if (lowproc.process_state & (PID_ZOMBIE | PID_EXITED)) */ -@@ -900,7 +900,7 @@ var_hrswrun(struct variable * vp, - if (proc_buf) { - cp = strchr(proc_buf->pr_psargs, ' '); - if (cp) -- strcpy(string, cp + 1); -+ strlcpy(string, cp + 1, sizeof(string)); - else - string[0] = 0; - } else -@@ -911,7 +911,7 @@ var_hrswrun(struct variable * vp, - cp++; - if (*cp == ' ') - cp++; -- strcpy(string, cp); -+ strlcpy(string, cp, sizeof(string)); - #endif - #elif defined(aix4) || defined(aix5) || defined(aix6) || defined(aix7) - cp = strchr(proc_table[LowProcIndex].pi_comm, ' '); -@@ -972,7 +972,7 @@ var_hrswrun(struct variable * vp, - while (*cp) - ++cp; - ++cp; -- strcpy(string, cp); -+ strlcpy(string, cp, sizeof(string)); - #elif defined(cygwin) - string[0] = 0; - #else -diff --git a/agent/mibgroup/mibII/mta_sendmail.c b/agent/mibgroup/mibII/mta_sendmail.c -index c1edd079f..bcdf8fa14 100644 ---- a/agent/mibgroup/mibII/mta_sendmail.c -+++ b/agent/mibgroup/mibII/mta_sendmail.c -@@ -586,7 +586,7 @@ add_queuegroup(const char *name, char *path) - */ - *p = '\0'; - -- strcpy(parentdir, path); -+ strlcpy(parentdir, path, sizeof(parentdir)); - /* - * remove last directory component from parentdir - */ -@@ -877,7 +877,7 @@ read_sendmailcf(BOOL config) - linenr, sendmailcf_fn); - break; - } -- strcpy(sendmailst_fn, line + 2); -+ strlcpy(sendmailst_fn, line + 2, sizeof(sendmailst_fn)); - found_sendmailst = TRUE; - DEBUGMSGTL(("mibII/mta_sendmail.c:read_sendmailcf", - "found statatistics file \"%s\"\n", -diff --git a/agent/mibgroup/mibII/system_mib.c b/agent/mibgroup/mibII/system_mib.c -index 65b0b7c64..8010357e0 100644 ---- a/agent/mibgroup/mibII/system_mib.c -+++ b/agent/mibgroup/mibII/system_mib.c -@@ -309,7 +309,7 @@ init_system_mib(void) - if (RegQueryValueEx(hKey, "RegisteredOwner", NULL, NULL, - (LPBYTE)registeredOwner, - ®isteredOwnerSz) == ERROR_SUCCESS) { -- strcpy(sysContact, registeredOwner); -+ strlcpy(sysContact, registeredOwner, sizeof(sysContact)); - } - RegCloseKey(hKey); - } -diff --git a/agent/mibgroup/mibII/vacm_conf.c b/agent/mibgroup/mibII/vacm_conf.c -index f2faf8653..c56ed099d 100644 ---- a/agent/mibgroup/mibII/vacm_conf.c -+++ b/agent/mibgroup/mibII/vacm_conf.c -@@ -480,7 +480,7 @@ vacm_parse_authaccess(const char *token, char *confline) - - for (i = 0; i <= VACM_MAX_VIEWS; i++) { - if (viewtypes & (1 << i)) { -- strcpy(ap->views[i], view); -+ strlcpy(ap->views[i], view, sizeof(ap->views[i])); - } - } - ap->contextMatch = prefix; -@@ -542,7 +542,7 @@ vacm_parse_setaccess(const char *token, char *param) - return; - } - -- strcpy(ap->views[viewnum], viewval); -+ strlcpy(ap->views[viewnum], viewval, sizeof(ap->views[viewnum])); - ap->contextMatch = iprefix; - ap->storageType = SNMP_STORAGE_PERMANENT; - ap->status = SNMP_ROW_ACTIVE; -@@ -598,9 +598,12 @@ vacm_parse_access(const char *token, char *param) - config_perror("failed to create access entry"); - return; - } -- strcpy(ap->views[VACM_VIEW_READ], readView); -- strcpy(ap->views[VACM_VIEW_WRITE], writeView); -- strcpy(ap->views[VACM_VIEW_NOTIFY], notify); -+ strlcpy(ap->views[VACM_VIEW_READ], readView, -+ sizeof(ap->views[VACM_VIEW_READ])); -+ strlcpy(ap->views[VACM_VIEW_WRITE], writeView, -+ sizeof(ap->views[VACM_VIEW_WRITE])); -+ strlcpy(ap->views[VACM_VIEW_NOTIFY], notify, -+ sizeof(ap->views[VACM_VIEW_NOTIFY])); - ap->contextMatch = iprefix; - ap->storageType = SNMP_STORAGE_PERMANENT; - ap->status = SNMP_ROW_ACTIVE; -diff --git a/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c -index d28225d14..4e8388eab 100644 ---- a/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c -+++ b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.c -@@ -12,6 +12,38 @@ - - static DH *dh_params = NULL; - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -+static int -+DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) -+{ -+ /* If the fields p and g in d are NULL, the corresponding input -+ * parameters MUST be non-NULL. q may remain NULL. -+ */ -+ if ((dh->p == NULL && p == NULL) -+ || (dh->g == NULL && g == NULL)) -+ return 0; -+ -+ if (p != NULL) { -+ BN_free(dh->p); -+ dh->p = p; -+ } -+ if (q != NULL) { -+ BN_free(dh->q); -+ dh->q = q; -+ } -+ if (g != NULL) { -+ BN_free(dh->g); -+ dh->g = g; -+ } -+ -+ if (q != NULL) { -+ dh->length = BN_num_bits(q); -+ } -+ -+ return 1; -+} -+#endif -+ - DH * - get_dh_params(void) - { -@@ -22,6 +54,7 @@ get_dh_params(void) - void - init_usmDHParameters(void) - { -+ BIGNUM *p, *g; - static oid usmDHParameters_oid[] = - { 1, 3, 6, 1, 3, 101, 1, 1, 1 }; - -@@ -38,9 +71,9 @@ init_usmDHParameters(void) - management apps though */ - if (!dh_params) { - dh_params = DH_new(); -- dh_params->g = BN_new(); -- BN_hex2bn(&dh_params->g, "02"); -- BN_hex2bn(&dh_params->p, "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"); -+ BN_hex2bn(&g, "02"); -+ BN_hex2bn(&p, "ffffffffffffffffc90fdaa22168c234c4c6628b80dc1cd129024e088a67cc74020bbea63b139b22514a08798e3404ddef9519b3cd3a431b302b0a6df25f14374fe1356d6d51c245e485b576625e7ec6f44c42e9a637ed6b0bff5cb6f406b7edee386bfb5a899fa5ae9f24117c4b1fe649286651ece65381ffffffffffffffff"); -+ DH_set0_pqg(dh_params, p, NULL, g); - } - } - -diff --git a/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c -index 427d26f85..5fc9ca5d0 100644 ---- a/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c -+++ b/agent/mibgroup/snmp-usm-dh-objects-mib/usmDHUserKeyTable/usmDHUserKeyTable_data_get.c -@@ -20,10 +20,64 @@ - #include "usmDHUserKeyTable.h" - #include "snmp-usm-dh-objects-mib/usmDHParameters/usmDHParameters.h" - -+#if OPENSSL_VERSION_NUMBER < 0x10100000L || defined(LIBRESSL_VERSION_NUMBER) -+static int -+DH_set0_pqg(DH *dh, BIGNUM *p, BIGNUM *q, BIGNUM *g) -+{ -+ /* If the fields p and g in d are NULL, the corresponding input -+ * parameters MUST be non-NULL. q may remain NULL. -+ */ -+ if ((dh->p == NULL && p == NULL) -+ || (dh->g == NULL && g == NULL)) -+ return 0; -+ -+ if (p != NULL) { -+ BN_free(dh->p); -+ dh->p = p; -+ } -+ if (q != NULL) { -+ BN_free(dh->q); -+ dh->q = q; -+ } -+ if (g != NULL) { -+ BN_free(dh->g); -+ dh->g = g; -+ } -+ -+ if (q != NULL) { -+ dh->length = BN_num_bits(q); -+ } -+ -+ return 1; -+} -+ -+static 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; -+} -+ -+static 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 -+ - DH * - usmDHGetUserDHptr(struct usmUser *user, int for_auth_key) - { - DH *dh, *dh_params; -+ const BIGNUM *g, *p; - void **theptr; - - if (user == NULL) -@@ -44,9 +98,10 @@ usmDHGetUserDHptr(struct usmUser *user, int for_auth_key) - dh_params = get_dh_params(); - if (!dh_params) - return NULL; -- dh->g = BN_dup(dh_params->g); -- dh->p = BN_dup(dh_params->p); -- if (!dh->g || !dh->p) -+ DH_get0_pqg(dh_params, &p, NULL, &g); -+ DH_set0_pqg(dh, BN_dup(p), NULL, BN_dup(g)); -+ DH_get0_pqg(dh, &p, NULL, &g); -+ if (!g || !p) - return NULL; - DH_generate_key(dh); - *theptr = dh; -@@ -61,6 +116,7 @@ usmDHGetUserKeyChange(struct usmUser *user, int for_auth_key, - u_char **keyobj, size_t *keyobj_len) - { - DH *dh; -+ const BIGNUM *pub_key; - - dh = usmDHGetUserDHptr(user, for_auth_key); - -@@ -70,9 +126,10 @@ usmDHGetUserKeyChange(struct usmUser *user, int for_auth_key, - return MFD_ERROR; - } - -- *keyobj_len = BN_num_bytes(dh->pub_key); -+ DH_get0_key(dh, &pub_key, NULL); -+ *keyobj_len = BN_num_bytes(pub_key); - *keyobj = malloc(*keyobj_len); -- BN_bn2bin(dh->pub_key, *keyobj); -+ BN_bn2bin(pub_key, *keyobj); - - return MFD_SUCCESS; - } -diff --git a/agent/mibgroup/target/snmpTargetParamsEntry.c b/agent/mibgroup/target/snmpTargetParamsEntry.c -index 4e1f4e2bb..1d29d0b20 100644 ---- a/agent/mibgroup/target/snmpTargetParamsEntry.c -+++ b/agent/mibgroup/target/snmpTargetParamsEntry.c -@@ -686,8 +686,7 @@ var_snmpTargetParamsEntry(struct variable * vp, - /* - * including null character. - */ -- memcpy(string, temp_struct->secName, strlen(temp_struct->secName)); -- string[strlen(temp_struct->secName)] = '\0'; -+ strlcpy((char *)string, temp_struct->secName, sizeof(string)); - *var_len = strlen(temp_struct->secName); - return (unsigned char *) string; - -diff --git a/agent/mibgroup/ucd-snmp/logmatch.c b/agent/mibgroup/ucd-snmp/logmatch.c -index 83b4e4aa7..1b77bf698 100644 ---- a/agent/mibgroup/ucd-snmp/logmatch.c -+++ b/agent/mibgroup/ucd-snmp/logmatch.c -@@ -393,8 +393,9 @@ logmatch_parse_config(const char *token, char *cptr) - logmatchTable[logmatchCount].regEx); - - /* fill in filename with initial data */ -- strcpy(logmatchTable[logmatchCount].filename, -- logmatchTable[logmatchCount].filenamePattern); -+ strlcpy(logmatchTable[logmatchCount].filename, -+ logmatchTable[logmatchCount].filenamePattern, -+ sizeof(logmatchTable[logmatchCount].filename)); - logmatch_update_filename(logmatchTable[logmatchCount].filenamePattern, - logmatchTable[logmatchCount].filename); - -diff --git a/agent/mibgroup/ucd-snmp/proc.c b/agent/mibgroup/ucd-snmp/proc.c -index e90c2e8e3..874c2400a 100644 ---- a/agent/mibgroup/ucd-snmp/proc.c -+++ b/agent/mibgroup/ucd-snmp/proc.c -@@ -168,7 +168,7 @@ procfix_parse_config(const char *token, char *cptr) - return; - } - -- strcpy(procp->fixcmd, cptr); -+ strlcpy(procp->fixcmd, cptr, sizeof(procp->fixcmd)); - } - - -diff --git a/agent/mibgroup/util_funcs.c b/agent/mibgroup/util_funcs.c -index 54068c6e7..ac265bf97 100644 ---- a/agent/mibgroup/util_funcs.c -+++ b/agent/mibgroup/util_funcs.c -@@ -258,7 +258,7 @@ get_exec_output(struct extensible *ex) - curtime = time(NULL); - if (curtime > (cachetime + NETSNMP_EXCACHETIME) || - strcmp(ex->command, lastcmd) != 0) { -- strcpy(lastcmd, ex->command); -+ strlcpy(lastcmd, ex->command, sizeof(lastcmd)); - cachetime = curtime; - #endif - -diff --git a/agent/mibgroup/util_funcs/get_pid_from_inode.c b/agent/mibgroup/util_funcs/get_pid_from_inode.c -index 8e157ae9f..aee907dd0 100644 ---- a/agent/mibgroup/util_funcs/get_pid_from_inode.c -+++ b/agent/mibgroup/util_funcs/get_pid_from_inode.c -@@ -2,6 +2,7 @@ - - #include "get_pid_from_inode.h" - -+#include /* strlcpy() */ - #include - - #include -@@ -144,7 +145,8 @@ netsnmp_get_pid_from_inode_init(void) - if (filelen + strlen(pidinfo->d_name) > PATH_MAX) - continue; - -- strcpy(path_name + filelen, pidinfo->d_name); -+ strlcpy(path_name + filelen, pidinfo->d_name, -+ sizeof(path_name) - filelen); - - /* The file discriptor is a symbolic link to a socket or a file.*/ - /* Thus read the symbolic link.*/ -diff --git a/apps/snmpusm.c b/apps/snmpusm.c -index 42919bde4..5dd114748 100644 ---- a/apps/snmpusm.c -+++ b/apps/snmpusm.c -@@ -125,6 +125,39 @@ char *usmUserPublic_val = NULL; - int docreateandwait = 0; - - -+#if !defined(HAVE_DH_GET0_PQG) -+ -+#include -+#include -+ -+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; -+} -+ -+#endif -+ -+#if defined(HAVE_OPENSSL_DH_H) && !defined(HAVE_DH_GET0_KEY) -+ -+#include -+#include -+ -+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 +223,7 @@ get_USM_DH_key(netsnmp_variable_list *vars, netsnmp_variable_list *dhvar, - 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 +238,29 @@ get_USM_DH_key(netsnmp_variable_list *vars, netsnmp_variable_list *dhvar, - 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) { -diff --git a/configure b/configure -index 433ba5ba2..d7e6bbc64 100755 ---- a/configure -+++ b/configure -@@ -23186,13 +23186,76 @@ eval ac_res=\$$as_ac_Lib - $as_echo "$ac_res" >&6; } - if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : - --$as_echo "#define HAVE_EVP_MD_CTX_CREATE /**/" >>confdefs.h -+$as_echo "#define HAVE_EVP_MD_CTX_CREATE 1" >>confdefs.h - - --$as_echo "#define HAVE_EVP_MD_CTX_DESTROY /**/" >>confdefs.h -+$as_echo "#define HAVE_EVP_MD_CTX_DESTROY 1" >>confdefs.h - - fi - -+ -+ as_ac_Lib=`$as_echo "ac_cv_lib_${CRYPTO}''_EVP_MD_CTX_new" | $as_tr_sh` -+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for EVP_MD_CTX_new in -l${CRYPTO}" >&5 -+$as_echo_n "checking for EVP_MD_CTX_new in -l${CRYPTO}... " >&6; } -+if eval \${$as_ac_Lib+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-l${CRYPTO} $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char EVP_MD_CTX_new (); -+int -+main () -+{ -+return EVP_MD_CTX_new (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ eval "$as_ac_Lib=yes" -+else -+ eval "$as_ac_Lib=no" -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+eval ac_res=\$$as_ac_Lib -+ { $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_res" >&5 -+$as_echo "$ac_res" >&6; } -+if eval test \"x\$"$as_ac_Lib"\" = x"yes"; then : -+ -+$as_echo "#define HAVE_EVP_MD_CTX_NEW 1" >>confdefs.h -+ -+ -+$as_echo "#define HAVE_EVP_MD_CTX_FREE 1" >>confdefs.h -+ -+fi -+ -+ save_LIBS=$LIBS -+ LIBS="$LIBS -l${CRYPTO}" -+ for ac_func in DH_get0_pqg DH_get0_key X509_NAME_ENTRY_get_data X509_NAME_ENTRY_get_object X509_get_signature_nid -+do : -+ as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh` -+ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var" -+if eval test \"x\$"$as_ac_var"\" = x"yes"; then : -+ cat >>confdefs.h <<_ACEOF -+#define `$as_echo "HAVE_$ac_func" | $as_tr_cpp` 1 -+_ACEOF -+ -+fi -+done -+ -+ LIBS=$save_LIBS - fi - if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for DTLSv1_method in -lssl" >&5 -@@ -23249,7 +23312,7 @@ if ${ac_cv_lib_ssl_SSL_library_init+:} false; then : - $as_echo_n "(cached) " >&6 - else - ac_check_lib_save_LIBS=$LIBS --LIBS="-lssl -lcrypto $LIBS" -+LIBS="-lssl $LIBS" - cat confdefs.h - <<_ACEOF >conftest.$ac_ext - /* end confdefs.h. */ - -@@ -23283,11 +23346,55 @@ if test "x$ac_cv_lib_ssl_SSL_library_init" = xyes; then : - - $as_echo "#define HAVE_LIBSSL 1" >>confdefs.h - -+fi -+ -+ { $as_echo "$as_me:${as_lineno-$LINENO}: checking for OPENSSL_init_ssl in -lssl" >&5 -+$as_echo_n "checking for OPENSSL_init_ssl in -lssl... " >&6; } -+if ${ac_cv_lib_ssl_OPENSSL_init_ssl+:} false; then : -+ $as_echo_n "(cached) " >&6 -+else -+ ac_check_lib_save_LIBS=$LIBS -+LIBS="-lssl $LIBS" -+cat confdefs.h - <<_ACEOF >conftest.$ac_ext -+/* end confdefs.h. */ -+ -+/* Override any GCC internal prototype to avoid an error. -+ Use char because int might match the return type of a GCC -+ builtin and then its argument prototype would still apply. */ -+#ifdef __cplusplus -+extern "C" -+#endif -+char OPENSSL_init_ssl (); -+int -+main () -+{ -+return OPENSSL_init_ssl (); -+ ; -+ return 0; -+} -+_ACEOF -+if ac_fn_c_try_link "$LINENO"; then : -+ ac_cv_lib_ssl_OPENSSL_init_ssl=yes -+else -+ ac_cv_lib_ssl_OPENSSL_init_ssl=no -+fi -+rm -f core conftest.err conftest.$ac_objext \ -+ conftest$ac_exeext conftest.$ac_ext -+LIBS=$ac_check_lib_save_LIBS -+fi -+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_ssl_OPENSSL_init_ssl" >&5 -+$as_echo "$ac_cv_lib_ssl_OPENSSL_init_ssl" >&6; } -+if test "x$ac_cv_lib_ssl_OPENSSL_init_ssl" = xyes; then : -+ -+$as_echo "#define HAVE_LIBSSL 1" >>confdefs.h -+ -+fi -+ -+ if test "$ac_cv_lib_ssl_SSL_library_init" = yes -o "$ac_cv_lib_ssl_OPENSSL_init_ssl" = yes; then - LIBCRYPTO=" -lssl $LIBCRYPTO" - else - as_fn_error $? "The DTLS based transports require the libssl library from OpenSSL to be available" "$LINENO" 5 - fi -- - TLSPROG=yes - fi - if echo " $transport_result_list " | $GREP " SSH " > /dev/null; then -diff --git a/configure.d/config_os_libs2 b/configure.d/config_os_libs2 -index 47491e24c..913457522 100644 ---- a/configure.d/config_os_libs2 -+++ b/configure.d/config_os_libs2 -@@ -293,10 +293,23 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then - [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], [], -+ AC_DEFINE([HAVE_EVP_MD_CTX_CREATE], [1], - [Define to 1 if you have the `EVP_MD_CTX_create' function.]) -- AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [], -+ AC_DEFINE([HAVE_EVP_MD_CTX_DESTROY], [1], - [Define to 1 if you have the `EVP_MD_CTX_destroy' function.])) -+ -+ AC_CHECK_LIB(${CRYPTO}, EVP_MD_CTX_new, -+ AC_DEFINE([HAVE_EVP_MD_CTX_NEW], [1], -+ [Define to 1 if you have the `EVP_MD_CTX_new' function.]) -+ AC_DEFINE([HAVE_EVP_MD_CTX_FREE], [1], -+ [Define to 1 if you have the `EVP_MD_CTX_free' function.])) -+ save_LIBS=$LIBS -+ LIBS="$LIBS -l${CRYPTO}" -+ AC_CHECK_FUNCS([DH_get0_pqg DH_get0_key ] dnl -+ [X509_NAME_ENTRY_get_data ] dnl -+ [X509_NAME_ENTRY_get_object] dnl -+ [X509_get_signature_nid]) -+ LIBS=$save_LIBS - fi - if echo " $transport_result_list " | $GREP "DTLS" > /dev/null; then - AC_CHECK_LIB(ssl, DTLSv1_method, -@@ -309,9 +322,15 @@ if test "x$tryopenssl" != "xno" -a "x$tryopenssl" != "xinternal"; then - if echo " $transport_result_list " | $GREP "TLS" > /dev/null; then - AC_CHECK_LIB(ssl, SSL_library_init, - AC_DEFINE(HAVE_LIBSSL, 1, -- [Define to 1 if you have the `ssl' library (-lssl).]) -- LIBCRYPTO=" -lssl $LIBCRYPTO", -- AC_MSG_ERROR([The DTLS based transports require the libssl library from OpenSSL to be available]) ,-lcrypto) -+ [Define to 1 if you have the `ssl' library (-lssl).])) -+ AC_CHECK_LIB(ssl, OPENSSL_init_ssl, -+ AC_DEFINE(HAVE_LIBSSL, 1, -+ [Define to 1 if you have the `ssl' library (-lssl).])) -+ if test "$ac_cv_lib_ssl_SSL_library_init" = yes -o "$ac_cv_lib_ssl_OPENSSL_init_ssl" = yes; then -+ LIBCRYPTO=" -lssl $LIBCRYPTO" -+ else -+ AC_MSG_ERROR([The DTLS based transports require the libssl library from OpenSSL to be available]) -+ fi - TLSPROG=yes - fi - if echo " $transport_result_list " | $GREP " SSH " > /dev/null; then -diff --git a/include/net-snmp/net-snmp-config.h.in b/include/net-snmp/net-snmp-config.h.in -index 1db02379b..70389cd97 100644 ---- a/include/net-snmp/net-snmp-config.h.in -+++ b/include/net-snmp/net-snmp-config.h.in -@@ -124,6 +124,12 @@ - /* define if you have devstat_getdevs() */ - #undef HAVE_DEVSTAT_GETDEVS - -+/* Define to 1 if you have the `DH_get0_key' function. */ -+#undef HAVE_DH_GET0_KEY -+ -+/* Define to 1 if you have the `DH_get0_pqg' function. */ -+#undef HAVE_DH_GET0_PQG -+ - /* Define to 1 if you have the header file, and it defines `DIR'. - */ - #undef HAVE_DIRENT_H -@@ -155,6 +161,12 @@ - /* Define to 1 if you have the `EVP_MD_CTX_destroy' function. */ - #undef HAVE_EVP_MD_CTX_DESTROY - -+/* Define to 1 if you have the `EVP_MD_CTX_free' function. */ -+#undef HAVE_EVP_MD_CTX_FREE -+ -+/* Define to 1 if you have the `EVP_MD_CTX_new' function. */ -+#undef HAVE_EVP_MD_CTX_NEW -+ - /* Define if you have EVP_sha224/256 in openssl */ - #undef HAVE_EVP_SHA224 - -@@ -1298,6 +1310,15 @@ - /* Define to 1 if you have the header file. */ - #undef HAVE_WS2TCPIP_H - -+/* Define to 1 if you have the `X509_get_signature_nid' function. */ -+#undef HAVE_X509_GET_SIGNATURE_NID -+ -+/* Define to 1 if you have the `X509_NAME_ENTRY_get_data' function. */ -+#undef HAVE_X509_NAME_ENTRY_GET_DATA -+ -+/* Define to 1 if you have the `X509_NAME_ENTRY_get_object' function. */ -+#undef HAVE_X509_NAME_ENTRY_GET_OBJECT -+ - /* Define to 1 if you have the header file. */ - #undef HAVE_XTI_H - -diff --git a/snmplib/keytools.c b/snmplib/keytools.c -index 0ccb3a673..0db988810 100644 ---- a/snmplib/keytools.c -+++ b/snmplib/keytools.c -@@ -149,7 +149,9 @@ generate_Ku(const oid * hashtype, u_int hashtype_len, - */ - #ifdef NETSNMP_USE_OPENSSL - --#ifdef HAVE_EVP_MD_CTX_CREATE -+#ifdef HAVE_EVP_MD_CTX_NEW -+ ctx = EVP_MD_CTX_new(); -+#elif HAVE_EVP_MD_CTX_CREATE - ctx = EVP_MD_CTX_create(); - #else - ctx = malloc(sizeof(*ctx)); -@@ -259,7 +261,9 @@ generate_Ku(const oid * hashtype, u_int hashtype_len, - memset(buf, 0, sizeof(buf)); - #ifdef NETSNMP_USE_OPENSSL - if (ctx) { --#ifdef HAVE_EVP_MD_CTX_DESTROY -+#ifdef HAVE_EVP_MD_CTX_FREE -+ EVP_MD_CTX_free(ctx); -+#elif HAVE_EVP_MD_CTX_DESTROY - EVP_MD_CTX_destroy(ctx); - #else - EVP_MD_CTX_cleanup(ctx); -diff --git a/snmplib/scapi.c b/snmplib/scapi.c -index 16ac8296f..6693a623c 100644 ---- a/snmplib/scapi.c -+++ b/snmplib/scapi.c -@@ -486,7 +486,9 @@ sc_hash(const oid * hashtype, size_t hashtypelen, const u_char * buf, - } - - /** initialize the pointer */ --#ifdef HAVE_EVP_MD_CTX_CREATE -+#ifdef HAVE_EVP_MD_CTX_NEW -+ cptr = EVP_MD_CTX_new(); -+#elif HAVE_EVP_MD_CTX_CREATE - cptr = EVP_MD_CTX_create(); - #else - cptr = malloc(sizeof(*cptr)); -@@ -507,7 +509,9 @@ sc_hash(const oid * hashtype, size_t hashtypelen, const u_char * buf, - /** do the final pass */ - EVP_DigestFinal(cptr, MAC, &tmp_len); - *MAC_len = tmp_len; --#ifdef HAVE_EVP_MD_CTX_DESTROY -+#ifdef HAVE_EVP_MD_CTX_FREE -+ EVP_MD_CTX_free(cptr); -+#elif HAVE_EVP_MD_CTX_DESTROY - EVP_MD_CTX_destroy(cptr); - #else - #if !defined(OLD_DES) -diff --git a/snmplib/snmp_openssl.c b/snmplib/snmp_openssl.c -index 3b0eaa837..2337446d0 100644 ---- a/snmplib/snmp_openssl.c -+++ b/snmplib/snmp_openssl.c -@@ -141,6 +141,28 @@ netsnmp_openssl_cert_get_commonName(X509 *ocert, char **buf, int *len) - } - - #ifndef NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES -+ -+#ifndef HAVE_X509_NAME_ENTRY_GET_DATA -+static ASN1_STRING * X509_NAME_ENTRY_get_data(const X509_NAME_ENTRY *ne) -+{ -+ return ne ? ne->value : NULL; -+} -+#endif -+ -+#ifndef HAVE_X509_NAME_ENTRY_GET_OBJECT -+static ASN1_OBJECT *X509_NAME_ENTRY_get_object(const X509_NAME_ENTRY *ne) -+{ -+ return ne ? ne->object : NULL; -+} -+#endif -+ -+#ifndef HAVE_X509_GET_SIGNATURE_NID -+static int X509_get_signature_nid(const X509 *x) -+{ -+ return OBJ_obj2nid(x->sig_alg->algorithm); -+} -+#endif -+ - /** netsnmp_openssl_cert_dump_name: dump subject names in cert - */ - void -@@ -148,6 +170,7 @@ netsnmp_openssl_cert_dump_names(X509 *ocert) - { - int i, onid; - X509_NAME_ENTRY *oname_entry; -+ ASN1_STRING *oname_value; - X509_NAME *osubj_name; - const char *prefix_short, *prefix_long; - -@@ -163,12 +186,13 @@ netsnmp_openssl_cert_dump_names(X509 *ocert) - for (i = 0; i < X509_NAME_entry_count(osubj_name); i++) { - oname_entry = X509_NAME_get_entry(osubj_name, i); - netsnmp_assert(NULL != oname_entry); -+ oname_value = X509_NAME_ENTRY_get_data(oname_entry); - -- if (oname_entry->value->type != V_ASN1_PRINTABLESTRING) -+ if (oname_value->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 +203,9 @@ netsnmp_openssl_cert_dump_names(X509 *ocert) - - DEBUGMSGT(("9:cert:dump:names", - "[%02d] NID type %d, ASN type %d\n", i, onid, -- oname_entry->value->type)); -+ oname_value->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(oname_value))); - } - } - #endif /* NETSNMP_FEATURE_REMOVE_CERT_DUMP_NAMES */ -@@ -470,7 +494,7 @@ netsnmp_openssl_cert_get_hash_type(X509 *ocert) - if (NULL == ocert) - return 0; - -- return _nid2ht(OBJ_obj2nid(ocert->sig_alg->algorithm)); -+ return _nid2ht(X509_get_signature_nid(ocert)); - } - - /** -@@ -487,7 +511,7 @@ netsnmp_openssl_cert_get_fingerprint(X509 *ocert, int alg) - 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/snmplib/vacm.c b/snmplib/vacm.c -index c6397855a..bce0186c7 100644 ---- a/snmplib/vacm.c -+++ b/snmplib/vacm.c -@@ -54,6 +54,7 @@ - #include - - #include -+#include /* strlcpy() */ - #include - #include - -@@ -439,7 +440,7 @@ netsnmp_view_get(struct vacm_viewEntry *head, const char *viewName, - if (glen < 0 || glen > VACM_MAX_STRING) - return NULL; - view[0] = glen; -- strcpy(view + 1, viewName); -+ strlcpy(view + 1, viewName, sizeof(view) - 1); - for (vp = head; vp; vp = vp->next) { - if (!memcmp(view, vp->viewName, glen + 1) - && viewSubtreeLen >= (vp->viewSubtreeLen - 1)) { -@@ -522,7 +523,7 @@ netsnmp_view_subtree_check(struct vacm_viewEntry *head, const char *viewName, - if (glen < 0 || glen > VACM_MAX_STRING) - return VACM_NOTINVIEW; - view[0] = glen; -- strcpy(view + 1, viewName); -+ strlcpy(view + 1, viewName, sizeof(view) - 1); - DEBUGMSGTL(("9:vacm:checkSubtree", "view %s\n", viewName)); - for (vp = head; vp; vp = vp->next) { - if (!memcmp(view, vp->viewName, glen + 1)) { -@@ -689,7 +690,7 @@ netsnmp_view_create(struct vacm_viewEntry **head, const char *viewName, - } - - vp->viewName[0] = glen; -- strcpy(vp->viewName + 1, viewName); -+ strlcpy(vp->viewName + 1, viewName, sizeof(vp->viewName) - 1); - vp->viewSubtree[0] = viewSubtreeLen; - memcpy(vp->viewSubtree + 1, viewSubtree, viewSubtreeLen * sizeof(oid)); - vp->viewSubtreeLen = viewSubtreeLen + 1; -@@ -768,7 +769,7 @@ vacm_getGroupEntry(int securityModel, const char *securityName) - if (glen < 0 || glen > VACM_MAX_STRING) - return NULL; - secname[0] = glen; -- strcpy(secname + 1, securityName); -+ strlcpy(secname + 1, securityName, sizeof(secname) - 1); - - for (vp = groupList; vp; vp = vp->next) { - if ((securityModel == vp->securityModel -@@ -817,7 +818,7 @@ vacm_createGroupEntry(int securityModel, const char *securityName) - - gp->securityModel = securityModel; - gp->securityName[0] = glen; -- strcpy(gp->securityName + 1, securityName); -+ strlcpy(gp->securityName + 1, securityName, sizeof(gp->securityName) - 1); - - lg = groupList; - og = NULL; -@@ -939,9 +940,9 @@ vacm_getAccessEntry(const char *groupName, - return NULL; - - group[0] = glen; -- strcpy(group + 1, groupName); -+ strlcpy(group + 1, groupName, sizeof(group) - 1); - context[0] = clen; -- strcpy(context + 1, contextPrefix); -+ strlcpy(context + 1, contextPrefix, sizeof(context) - 1); - for (vp = accessList; vp; vp = vp->next) { - if ((securityModel == vp->securityModel - || vp->securityModel == SNMP_SEC_MODEL_ANY) -@@ -1006,9 +1007,10 @@ vacm_createAccessEntry(const char *groupName, - vp->securityModel = securityModel; - vp->securityLevel = securityLevel; - vp->groupName[0] = glen; -- strcpy(vp->groupName + 1, groupName); -+ strlcpy(vp->groupName + 1, groupName, sizeof(vp->groupName) - 1); - vp->contextPrefix[0] = clen; -- strcpy(vp->contextPrefix + 1, contextPrefix); -+ strlcpy(vp->contextPrefix + 1, contextPrefix, -+ sizeof(vp->contextPrefix) - 1); - - lp = accessList; - while (lp) { -diff --git a/win32/net-snmp/net-snmp-config.h b/win32/net-snmp/net-snmp-config.h -index 1608563b5..0cc123c6c 100644 ---- a/win32/net-snmp/net-snmp-config.h -+++ b/win32/net-snmp/net-snmp-config.h -@@ -250,6 +250,21 @@ - /* Define to 1 if you have the header file. */ - #define HAVE_DIRECT_H 1 - -+/* Define to 1 if you have the `DH_get0_key' function. */ -+#define HAVE_DH_GET0_KEY 1 -+ -+/* Define to 1 if you have the `DH_get0_pqg' function. */ -+#define HAVE_DH_GET0_PQG 1 -+ -+/* Define to 1 if you have the `X509_get_signature_nid' function. */ -+#define HAVE_X509_GET_SIGNATURE_NID 1 -+ -+/* Define to 1 if you have the `X509_NAME_ENTRY_get_data' function. */ -+#define HAVE_X509_NAME_ENTRY_GET_DATA 1 -+ -+/* Define to 1 if you have the `X509_NAME_ENTRY_get_object' function. */ -+#define HAVE_X509_NAME_ENTRY_GET_OBJECT 1 -+ - /* Define to 1 if you have the header file, and it defines `DIR'. - */ - /* #undef HAVE_DIRENT_H */ -diff --git a/win32/net-snmp/net-snmp-config.h.in b/win32/net-snmp/net-snmp-config.h.in -index 969373012..d576d6c5e 100644 ---- a/win32/net-snmp/net-snmp-config.h.in -+++ b/win32/net-snmp/net-snmp-config.h.in -@@ -250,6 +250,21 @@ - /* Define to 1 if you have the header file. */ - #define HAVE_DIRECT_H 1 - -+/* Define to 1 if you have the `DH_get0_key' function. */ -+#define HAVE_DH_GET0_KEY 1 -+ -+/* Define to 1 if you have the `DH_get0_pqg' function. */ -+#define HAVE_DH_GET0_PQG 1 -+ -+/* Define to 1 if you have the `X509_get_signature_nid' function. */ -+#define HAVE_X509_GET_SIGNATURE_NID 1 -+ -+/* Define to 1 if you have the `X509_NAME_ENTRY_get_data' function. */ -+#define HAVE_X509_NAME_ENTRY_GET_DATA 1 -+ -+/* Define to 1 if you have the `X509_NAME_ENTRY_get_object' function. */ -+#define HAVE_X509_NAME_ENTRY_GET_OBJECT 1 -+ - /* Define to 1 if you have the header file, and it defines `DIR'. - */ - /* #undef HAVE_DIRENT_H */ --- -2.12.3 - diff --git a/net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch b/net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch deleted file mode 100644 index 2cbab97..0000000 --- a/net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch +++ /dev/null @@ -1,120 +0,0 @@ -diff -Nurp net-snmp-5.7.3.pre5-orig/snmplib/snmp_api.c net-snmp-5.7.3.pre5/snmplib/snmp_api.c ---- net-snmp-5.7.3.pre5-orig/snmplib/snmp_api.c 2015-08-13 21:33:38.835653065 +0200 -+++ net-snmp-5.7.3.pre5/snmplib/snmp_api.c 2015-08-13 21:54:03.099348588 +0200 -@@ -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,21 +4616,37 @@ 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); - if (!p) -- return -1; -+ goto fail; - 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-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch b/net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch deleted file mode 100644 index 2ea8046..0000000 --- a/net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch +++ /dev/null @@ -1,54 +0,0 @@ -commit f9304c83f76202db0e684269ca1af32e43cd9db4 -Author: Jan Safranek -Date: Tue Feb 7 14:53:44 2012 +0100 - - CHANGES: PATCH 1633670: fixed snmpd crashing when an AgentX subagent disconnect in the middle of processing of a request. - - I fixed also the memory leak reported in the tracker comments. - -Index: net-snmp-5.7.2/agent/mibgroup/agentx/master.c -=================================================================== ---- net-snmp-5.7.2.orig/agent/mibgroup/agentx/master.c -+++ net-snmp-5.7.2/agent/mibgroup/agentx/master.c -@@ -219,6 +219,9 @@ agentx_got_response(int operation, - if (!cache) { - DEBUGMSGTL(("agentx/master", "response too late on session %8p\n", - session)); -+ /* response is too late, free the cache */ -+ if (magic) -+ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) magic); - return 0; - } - requests = cache->requests; -@@ -606,6 +609,8 @@ agentx_master_handler(netsnmp_mib_handle - result = snmp_async_send(ax_session, pdu, agentx_got_response, cb_data); - if (result == 0) { - snmp_free_pdu(pdu); -+ if (cb_data) -+ netsnmp_free_delegated_cache((netsnmp_delegated_cache*) cb_data); - } - - return SNMP_ERR_NOERROR; -Index: net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c -=================================================================== ---- net-snmp-5.7.2.orig/agent/mibgroup/agentx/master_admin.c -+++ net-snmp-5.7.2/agent/mibgroup/agentx/master_admin.c -@@ -133,11 +133,16 @@ close_agentx_session(netsnmp_session * s - * requests, so that the delegated request will be completed and - * further requests can be processed - */ -- netsnmp_remove_delegated_requests_for_session(session); -+ while (netsnmp_remove_delegated_requests_for_session(session)) { -+ DEBUGMSGTL(("agentx/master", "Continue removing delegated reqests\n")); -+ } -+ - if (session->subsession != NULL) { - netsnmp_session *subsession = session->subsession; - for(; subsession; subsession = subsession->next) { -- netsnmp_remove_delegated_requests_for_session(subsession); -+ while (netsnmp_remove_delegated_requests_for_session(subsession)) { -+ DEBUGMSGTL(("agentx/master", "Continue removing delegated subsession reqests\n")); -+ } - } - } - diff --git a/net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch b/net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch deleted file mode 100644 index 1765240..0000000 --- a/net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch +++ /dev/null @@ -1,21 +0,0 @@ -diff -Nurp net-snmp-5.7.3-orig/agent/helpers/table.c net-snmp-5.7.3/agent/helpers/table.c ---- net-snmp-5.7.3-orig/agent/helpers/table.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/helpers/table.c 2018-10-09 00:54:37.410522720 +0200 -@@ -406,6 +406,8 @@ table_helper_handler(netsnmp_mib_handler - if (reqinfo->mode == MODE_GET) - table_helper_cleanup(reqinfo, request, - SNMP_NOSUCHOBJECT); -+ else -+ request->processed = 1; /* skip if next handler called */ - continue; - } - -@@ -483,6 +485,8 @@ table_helper_handler(netsnmp_mib_handler - #endif /* NETSNMP_NO_WRITE_SUPPORT */ - table_helper_cleanup(reqinfo, request, - SNMP_NOSUCHOBJECT); -+ else -+ request->processed = 1; /* skip if next handler called */ - continue; - } - /* diff --git a/net-snmp-5.7.3-netgroups.patch b/net-snmp-5.7.3-netgroups.patch deleted file mode 100644 index 7c09e68..0000000 --- a/net-snmp-5.7.3-netgroups.patch +++ /dev/null @@ -1,286 +0,0 @@ -diff -Nurp net-snmp-5.7.3.orig/configure.d/config_os_functions net-snmp-5.7.3/configure.d/config_os_functions ---- net-snmp-5.7.3.orig/configure.d/config_os_functions 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/configure.d/config_os_functions 2015-07-16 10:32:15.159643068 +0200 -@@ -31,11 +31,12 @@ AC_CHECK_FUNCS([lrand48 rand - [signal sigset ] ) - - # Library: --AC_CHECK_FUNCS([closedir fgetc_unlocked flockfile ] dnl -- [fork funlockfile getipnodebyname ] dnl -- [gettimeofday if_nametoindex mkstemp ] dnl -- [opendir readdir regcomp ] dnl -- [setenv setitimer setlocale ] dnl -+AC_CHECK_FUNCS([closedir endnetgrent fgetc_unlocked ] dnl -+ [flockfile fork funlockfile ] dnl -+ [getipnodebyname getnetgrent gettimeofday ] dnl -+ [if_nametoindex mkstemp opendir ] dnl -+ [readdir regcomp setenv ] dnl -+ [setitimer setlocale setnetgrent ] dnl - [setsid snprintf strcasestr ] dnl - [strdup strerror strncasecmp ] dnl - [sysconf times vsnprintf ] ) -diff -Nurp net-snmp-5.7.3.orig/man/snmpd.conf.5.def net-snmp-5.7.3/man/snmpd.conf.5.def ---- net-snmp-5.7.3.orig/man/snmpd.conf.5.def 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/man/snmpd.conf.5.def 2015-07-16 10:41:34.337850287 +0200 -@@ -389,7 +389,14 @@ map an SNMPv1 or SNMPv2c community strin - a particular range of source addresses, or globally (\fI"default"\fR). - A restricted source can either be a specific hostname (or address), or - a subnet - represented as IP/MASK (e.g. 10.10.10.0/255.255.255.0), or --IP/BITS (e.g. 10.10.10.0/24), or the IPv6 equivalents. -+IP/BITS (e.g. 10.10.10.0/24), or the IPv6 equivalents. It is also possible -+to reference a specific \fInetgroup\fR starting with an '@' character (e.g. -+@adminhosts). The \fInetgroup\fR lookup is running through the NSS (Name -+Services Switch) making it possible to define the group locally or via -+NIS/LDAP. -+.IP -+Note: The hostname DNS lookup and \fInetgroup\fR resolution is done only -+during snmpd start or reload. - .IP - The same community string can be specified in several separate directives - (presumably with different source tokens), and the first source/community -diff -Nurp net-snmp-5.7.3.orig/snmplib/transports/snmpUDPDomain.c net-snmp-5.7.3/snmplib/transports/snmpUDPDomain.c ---- net-snmp-5.7.3.orig/snmplib/transports/snmpUDPDomain.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/snmplib/transports/snmpUDPDomain.c 2015-07-16 10:32:15.160643078 +0200 -@@ -88,6 +88,11 @@ void _netsnmp_udp_sockopt_set(int fd, in - int - netsnmp_sockaddr_in2(struct sockaddr_in *addr, - const char *inpeername, const char *default_target); -+static void -+netsnmp_udp_com2SecList_add(char *secName, size_t secNameLen, -+ char *contextName, size_t contextNameLen, -+ char *community, size_t communityLen, -+ struct in_addr network, struct in_addr mask); - - /* - * Return a string representing the address in data, or else the "far end" -@@ -100,6 +105,59 @@ netsnmp_udp_fmtaddr(netsnmp_transport *t - return netsnmp_ipv4_fmtaddr("UDP", t, data, len); - } - -+static int -+netsnmp_udp_resolve_source(char *source, struct in_addr *network, -+ struct in_addr *mask) -+{ -+ /* Split the source/netmask parts */ -+ char *strmask = strchr(source, '/'); -+ if (strmask != NULL) -+ /* Mask given. */ -+ *strmask++ = '\0'; -+ -+ /* Try interpreting as a dotted quad. */ -+ if (inet_pton(AF_INET, source, network) == 0) { -+ /* Nope, wasn't a dotted quad. Must be a hostname. */ -+ int ret = netsnmp_gethostbyname_v4(source, &(network->s_addr)); -+ if (ret < 0) { -+ config_perror("cannot resolve source hostname"); -+ return ret; -+ } -+ } -+ -+ /* Now work out the mask. */ -+ if (strmask == NULL || *strmask == '\0') { -+ /* No mask was given. Assume /32 */ -+ mask->s_addr = (in_addr_t)(~0UL); -+ } else { -+ /* Try to interpret mask as a "number of 1 bits". */ -+ char* cp; -+ long maskLen = strtol(strmask, &cp, 10); -+ if (*cp == '\0') { -+ if (0 < maskLen && maskLen <= 32) -+ mask->s_addr = htonl((in_addr_t)(~0UL << (32 - maskLen))); -+ else if (maskLen == 0) -+ mask->s_addr = 0; -+ else { -+ config_perror("bad mask length"); -+ return -1; -+ } -+ } -+ /* Try to interpret mask as a dotted quad. */ -+ else if (inet_pton(AF_INET, strmask, mask) == 0) { -+ config_perror("bad mask"); -+ return -1; -+ } -+ -+ /* Check that the network and mask are consistent. */ -+ if (network->s_addr & ~mask->s_addr) { -+ config_perror("source/mask mismatch"); -+ return -1; -+ } -+ } -+ return 0; -+} -+ - - #if defined(HAVE_IP_PKTINFO) || defined(HAVE_IP_RECVDSTADDR) - -@@ -259,102 +317,85 @@ netsnmp_udp_parse_security(const char *t - if (strcmp(source, "default") == 0) { - network.s_addr = 0; - mask.s_addr = 0; -+ netsnmp_udp_com2SecList_add(secName, secNameLen, contextName, -+ contextNameLen, community, communityLen, network, mask); - } else { -- /* Split the source/netmask parts */ -- char *strmask = strchr(source, '/'); -- if (strmask != NULL) -- /* Mask given. */ -- *strmask++ = '\0'; -- -- /* Try interpreting as a dotted quad. */ -- if (inet_pton(AF_INET, source, &network) == 0) { -- /* Nope, wasn't a dotted quad. Must be a hostname. */ -- int ret = netsnmp_gethostbyname_v4(source, &network.s_addr); -- if (ret < 0) { -- config_perror("cannot resolve source hostname"); -- return; -- } -- } -- -- /* Now work out the mask. */ -- if (strmask == NULL || *strmask == '\0') { -- /* No mask was given. Assume /32 */ -- mask.s_addr = (in_addr_t)(~0UL); -- } else { -- /* Try to interpret mask as a "number of 1 bits". */ -- char* cp; -- long maskLen = strtol(strmask, &cp, 10); -- if (*cp == '\0') { -- if (0 < maskLen && maskLen <= 32) -- mask.s_addr = htonl((in_addr_t)(~0UL << (32 - maskLen))); -- else if (maskLen == 0) -- mask.s_addr = 0; -- else { -- config_perror("bad mask length"); -- return; -+#if HAVE_ENDNETGRENT && HAVE_GETNETGRENT && HAVE_SETNETGRENT -+ /* Interpret as netgroup */ -+ if (*source == '@') { -+ char *netgroup = source+1; -+ char *host, *user, *domain; -+ setnetgrent(netgroup); -+ while (getnetgrent(&host, &user, &domain)) { -+ if (netsnmp_udp_resolve_source(host, &network, &mask) == 0) { -+ netsnmp_udp_com2SecList_add(secName, secNameLen, contextName, -+ contextNameLen, community, communityLen, network, mask); - } - } -- /* Try to interpret mask as a dotted quad. */ -- else if (inet_pton(AF_INET, strmask, &mask) == 0) { -- config_perror("bad mask"); -- return; -- } -- -- /* Check that the network and mask are consistent. */ -- if (network.s_addr & ~mask.s_addr) { -- config_perror("source/mask mismatch"); -- return; -+ endnetgrent(); -+ } -+ /* Without '@' it has to be an address or hostname */ -+ else -+#endif -+ { -+ if (netsnmp_udp_resolve_source(source, &network, &mask) == 0) { -+ netsnmp_udp_com2SecList_add(secName, secNameLen, contextName, -+ contextNameLen, community, communityLen, network, mask); - } - } - } -+} - -- { -- void* v = malloc(offsetof(com2SecEntry, community) + communityLen + -- secNameLen + contextNameLen); -- -- com2SecEntry* e = (com2SecEntry*)v; -- char* last = ((char*)v) + offsetof(com2SecEntry, community); -+static void -+netsnmp_udp_com2SecList_add(char *secName, size_t secNameLen, char *contextName, -+ size_t contextNameLen, char *community, size_t communityLen, -+ struct in_addr network, struct in_addr mask) -+{ -+ void *v = malloc(offsetof(com2SecEntry, community) + communityLen + -+ secNameLen + contextNameLen); - -- if (v == NULL) { -- config_perror("memory error"); -- return; -- } -+ com2SecEntry* e = (com2SecEntry*)v; -+ char* last = ((char*)v) + offsetof(com2SecEntry, community); - -- /* -- * Everything is okay. Copy the parameters to the structure allocated -- * above and add it to END of the list. -- */ -+ if (v == NULL) { -+ config_perror("memory error"); -+ return; -+ } - -- { -- char buf1[INET_ADDRSTRLEN]; -- char buf2[INET_ADDRSTRLEN]; -- DEBUGMSGTL(("netsnmp_udp_parse_security", -- "<\"%s\", %s/%s> => \"%s\"\n", community, -- inet_ntop(AF_INET, &network, buf1, sizeof(buf1)), -- inet_ntop(AF_INET, &mask, buf2, sizeof(buf2)), -- secName)); -- } -+ /* -+ * Everything is okay. Copy the parameters to the structure allocated -+ * above and add it to END of the list. -+ */ - -- memcpy(last, community, communityLen); -- last += communityLen; -- memcpy(last, secName, secNameLen); -- e->secName = last; -- last += secNameLen; -- if (contextNameLen) { -- memcpy(last, contextName, contextNameLen); -- e->contextName = last; -- } else -- e->contextName = last - 1; -- e->network = network.s_addr; -- e->mask = mask.s_addr; -- e->next = NULL; -- -- if (com2SecListLast != NULL) { -- com2SecListLast->next = e; -- com2SecListLast = e; -- } else { -- com2SecListLast = com2SecList = e; -- } -+ { -+ char buf1[INET_ADDRSTRLEN]; -+ char buf2[INET_ADDRSTRLEN]; -+ DEBUGMSGTL(("netsnmp_udp_parse_security", -+ "<\"%s\", %s/%s> => \"%s\"\n", community, -+ inet_ntop(AF_INET, &network, buf1, sizeof(buf1)), -+ inet_ntop(AF_INET, &mask, buf2, sizeof(buf2)), -+ secName)); -+ } -+ -+ memcpy(last, community, communityLen); -+ last += communityLen; -+ memcpy(last, secName, secNameLen); -+ e->secName = last; -+ last += secNameLen; -+ if (contextNameLen) { -+ memcpy(last, contextName, contextNameLen); -+ e->contextName = last; -+ } else -+ e->contextName = last - 1; -+ e->network = network.s_addr; -+ e->mask = mask.s_addr; -+ e->next = NULL; -+ -+ if (com2SecListLast != NULL) { -+ com2SecListLast->next = e; -+ com2SecListLast = e; -+ } else { -+ com2SecListLast = com2SecList = e; - } - } - diff --git a/net-snmp-5.7.3.tar.gz b/net-snmp-5.7.3.tar.gz deleted file mode 100644 index 7202548..0000000 --- a/net-snmp-5.7.3.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:12ef89613c7707dc96d13335f153c1921efc9d61d3708ef09f3fc4a7014fb4f0 -size 6382428 diff --git a/net-snmp-5.8-fix-Makefile.PL.patch b/net-snmp-5.8-fix-Makefile.PL.patch new file mode 100644 index 0000000..a8945c1 --- /dev/null +++ b/net-snmp-5.8-fix-Makefile.PL.patch @@ -0,0 +1,22 @@ +diff -Nurp net-snmp-5.8-orig/perl/ASN/Makefile.PL net-snmp-5.8/perl/ASN/Makefile.PL +--- net-snmp-5.8-orig/perl/ASN/Makefile.PL 2018-10-10 09:45:14.875074783 +0000 ++++ net-snmp-5.8/perl/ASN/Makefile.PL 2018-10-10 15:02:06.342732928 +0000 +@@ -8,6 +8,7 @@ use Config; + use MakefileSubs; + + my $lib_version; ++my %MakeParams = (); + + # See lib/ExtUtils/MakeMaker.pm for details of how to influence + # the contents of the Makefile that is written. +diff -Nurp net-snmp-5.8-orig/perl/Makefile.PL net-snmp-5.8/perl/Makefile.PL +--- net-snmp-5.8-orig/perl/Makefile.PL 2018-10-10 09:45:14.875074783 +0000 ++++ net-snmp-5.8/perl/Makefile.PL 2018-10-10 15:02:25.810916073 +0000 +@@ -4,6 +4,7 @@ use ExtUtils::MakeMaker; + use Config; + require 5; + use MakefileSubs; ++my %MakeParams = (); + + WriteMakefile(TopLevelInitMakeParams()); + diff --git a/net-snmp-5.8-fix-python3.patch b/net-snmp-5.8-fix-python3.patch new file mode 100644 index 0000000..8ad8126 --- /dev/null +++ b/net-snmp-5.8-fix-python3.patch @@ -0,0 +1,578 @@ +diff -Nurp net-snmp-5.8-orig/python/netsnmp/client.py net-snmp-5.8/python/netsnmp/client.py +--- net-snmp-5.8-orig/python/netsnmp/client.py 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/python/netsnmp/client.py 2018-10-10 19:40:47.130879742 +0000 +@@ -34,12 +34,12 @@ def _parse_session_args(kargs): + 'TheirHostname':'', + 'TrustCert':'' + } +- keys = kargs.keys() ++ keys = list(kargs.keys()) + for key in keys: +- if sessArgs.has_key(key): ++ if key in sessArgs: + sessArgs[key] = kargs[key] + else: +- print >>stderr, "ERROR: unknown key", key ++ print("ERROR: unknown key", key, file=stderr) + return sessArgs + + def STR(obj): +@@ -132,7 +132,7 @@ class Session(object): + + sess_args = _parse_session_args(args) + +- for k, v in sess_args.items(): ++ for k, v in list(sess_args.items()): + self.__dict__[k] = v + + +diff -Nurp net-snmp-5.8-orig/python/netsnmp/client_intf.c net-snmp-5.8/python/netsnmp/client_intf.c +--- net-snmp-5.8-orig/python/netsnmp/client_intf.c 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/python/netsnmp/client_intf.c 2018-10-10 19:52:16.993235587 +0000 +@@ -853,7 +853,11 @@ py_netsnmp_attr_string(PyObject *obj, ch + PyObject *attr = PyObject_GetAttrString(obj, attr_name); + if (attr) { + int retval; ++#if PY_MAJOR_VERSION >= 3 ++ retval = PyBytes_AsStringAndSize(attr, val, len); ++#else + retval = PyString_AsStringAndSize(attr, val, len); ++#endif + Py_DECREF(attr); + return retval; + } +@@ -870,7 +874,11 @@ py_netsnmp_attr_long(PyObject *obj, char + if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { + PyObject *attr = PyObject_GetAttrString(obj, attr_name); + if (attr) { ++#if PY_MAJOR_VERSION >= 3 ++ val = PyLong_AsLong(attr); ++#else + val = PyInt_AsLong(attr); ++#endif + Py_DECREF(attr); + } + } +@@ -955,13 +963,22 @@ __py_netsnmp_update_session_errors(PyObj + + py_netsnmp_attr_set_string(session, "ErrorStr", err_str, STRLEN(err_str)); + ++#if PY_MAJOR_VERSION >= 3 ++ tmp_for_conversion = PyLong_FromLong(err_num); ++#else + tmp_for_conversion = PyInt_FromLong(err_num); ++#endif ++ + if (!tmp_for_conversion) + return; /* nothing better to do? */ + PyObject_SetAttrString(session, "ErrorNum", tmp_for_conversion); + Py_DECREF(tmp_for_conversion); + ++#if PY_MAJOR_VERSION >= 3 ++ tmp_for_conversion = PyLong_FromLong(err_ind); ++#else + tmp_for_conversion = PyInt_FromLong(err_ind); ++#endif + if (!tmp_for_conversion) + return; /* nothing better to do? */ + PyObject_SetAttrString(session, "ErrorInd", tmp_for_conversion); +@@ -2490,13 +2507,28 @@ static PyMethodDef ClientMethods[] = { + {NULL, NULL, 0, NULL} /* Sentinel */ + }; + ++#if PY_MAJOR_VERSION >= 3 ++static struct PyModuleDef ClientModuleDef = { ++ PyModuleDef_HEAD_INIT, ++ "client_intf", ++ NULL, ++ -1, ++ ClientMethods, ++ NULL, ++ NULL, ++ NULL, ++ NULL ++}; ++ ++PyMODINIT_FUNC ++PyInit_client_intf(void) ++{ ++ return PyModule_Create(&ClientModuleDef); ++} ++#else + PyMODINIT_FUNC + initclient_intf(void) + { + (void) Py_InitModule("client_intf", ClientMethods); + } +- +- +- +- +- ++#endif +diff -Nurp net-snmp-5.8-orig/python/netsnmp/tests/test.py net-snmp-5.8/python/netsnmp/tests/test.py +--- net-snmp-5.8-orig/python/netsnmp/tests/test.py 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/python/netsnmp/tests/test.py 2018-10-10 19:46:04.689790403 +0000 +@@ -62,107 +62,107 @@ class BasicTests(unittest.TestCase): + self.assertEqual(var.iid, '') + + def test_v1_get(self): +- print "\n" +- print "---v1 GET tests -------------------------------------\n" ++ print("\n") ++ print("---v1 GET tests -------------------------------------\n") + var = netsnmp.Varbind('.1.3.6.1.2.1.1.1', '0') + res = netsnmp.snmpget(var, **snmp_dest()) + +- print "v1 snmpget result: ", res, "\n" ++ print("v1 snmpget result: ", res, "\n") + self.assertEqual(len(res), 1) + +- print "v1 get var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print("v1 get var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + self.assertEqual(var.tag, 'sysDescr') + self.assertEqual(var.iid, '0') + self.assertEqual(var.val, res[0]) + self.assertEqual(var.type, 'OCTETSTR') + + def test_v1_getnext(self): +- print "\n" +- print "---v1 GETNEXT tests-------------------------------------\n" ++ print("\n") ++ print("---v1 GETNEXT tests-------------------------------------\n") + var = netsnmp.Varbind('.1.3.6.1.2.1.1.1', '0') + res = netsnmp.snmpgetnext(var, **snmp_dest()) + +- print "v1 snmpgetnext result: ", res, "\n" ++ print("v1 snmpgetnext result: ", res, "\n") + self.assertEqual(len(res), 1) + +- print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print("v1 getnext var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + self.assertTrue(var.tag is not None) + self.assertTrue(var.iid is not None) + self.assertTrue(var.val is not None) + self.assertTrue(var.type is not None) + + def test_v1_set(self): +- print "\n" +- print "---v1 SET tests-------------------------------------\n" ++ print("\n") ++ print("---v1 SET tests-------------------------------------\n") + var = netsnmp.Varbind('sysLocation', '0', 'my new location') + res = netsnmp.snmpset(var, **snmp_dest()) + +- print "v1 snmpset result: ", res, "\n" ++ print("v1 snmpset result: ", res, "\n") + self.assertEqual(res, 1) + +- print "v1 set var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print("v1 set var: ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + self.assertEqual(var.tag, 'sysLocation') + self.assertEqual(var.iid, '0') + self.assertEqual(var.val, 'my new location') + self.assertTrue(var.type is None) + + def test_v1_walk(self): +- print "\n" +- print "---v1 walk tests-------------------------------------\n" ++ print("\n") ++ print("---v1 walk tests-------------------------------------\n") + varlist = netsnmp.VarList(netsnmp.Varbind('system')) + +- print "v1 varlist walk in: " ++ print("v1 varlist walk in: ") + for var in varlist: +- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + + res = netsnmp.snmpwalk(varlist, **snmp_dest()) +- print "v1 snmpwalk result: ", res, "\n" ++ print("v1 snmpwalk result: ", res, "\n") + self.assertTrue(len(res) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + + def test_v1_walk_2(self): +- print "\n" +- print "---v1 walk 2-------------------------------------\n" ++ print("\n") ++ print("---v1 walk 2-------------------------------------\n") + +- print "v1 varbind walk in: " ++ print("v1 varbind walk in: ") + var = netsnmp.Varbind('system') + self.assertEqual(var.tag, 'system') + self.assertEqual(var.iid, '') + self.assertEqual(var.val, None) + self.assertEqual(var.type, None) + res = netsnmp.snmpwalk(var, **snmp_dest()) +- print "v1 snmpwalk result (should be = orig): ", res, "\n" ++ print("v1 snmpwalk result (should be = orig): ", res, "\n") + self.assertTrue(len(res) > 0) + +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + self.assertEqual(var.tag, 'system') + self.assertEqual(var.iid, '') + self.assertEqual(var.val, None) + self.assertEqual(var.type, None) + + def test_v1_mv_get(self): +- print "\n" +- print "---v1 multi-varbind test-------------------------------------\n" ++ print("\n") ++ print("---v1 multi-varbind test-------------------------------------\n") + sess = setup_v1() + + varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) + vals = sess.get(varlist) +- print "v1 sess.get result: ", vals, "\n" ++ print("v1 sess.get result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + + vals = sess.getnext(varlist) +- print "v1 sess.getnext result: ", vals, "\n" ++ print("v1 sess.getnext result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + + varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), + netsnmp.Varbind('sysORLastChange'), +@@ -171,71 +171,71 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysORUpTime')) + + vals = sess.getbulk(2, 8, varlist) +- print "v1 sess.getbulk result: ", vals, "\n" ++ print("v1 sess.getbulk result: ", vals, "\n") + self.assertEqual(vals, None) # GetBulk is not supported for v1 + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') + + def test_v1_set_2(self): +- print "\n" +- print "---v1 set2-------------------------------------\n" ++ print("\n") ++ print("---v1 set2-------------------------------------\n") + + sess = setup_v1() + varlist = netsnmp.VarList( + netsnmp.Varbind('sysLocation', '0', 'my newer location')) + res = sess.set(varlist) +- print "v1 sess.set result: ", res, "\n" ++ print("v1 sess.set result: ", res, "\n") + + def test_v1_walk_3(self): +- print "\n" +- print "---v1 walk3-------------------------------------\n" ++ print("\n") ++ print("---v1 walk3-------------------------------------\n") + + sess = setup_v1() + varlist = netsnmp.VarList(netsnmp.Varbind('system')) + + vals = sess.walk(varlist) +- print "v1 sess.walk result: ", vals, "\n" ++ print("v1 sess.walk result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + + def test_v2c_get(self): +- print "\n" +- print "---v2c get-------------------------------------\n" ++ print("\n") ++ print("---v2c get-------------------------------------\n") + + sess = setup_v2() + varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) + vals = sess.get(varlist) +- print "v2 sess.get result: ", vals, "\n" ++ print("v2 sess.get result: ", vals, "\n") + self.assertEqual(len(vals), 3) + + def test_v2c_getnext(self): +- print "\n" +- print "---v2c getnext-------------------------------------\n" ++ print("\n") ++ print("---v2c getnext-------------------------------------\n") + + sess = setup_v2() + varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + + vals = sess.getnext(varlist) +- print "v2 sess.getnext result: ", vals, "\n" ++ print("v2 sess.getnext result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + + def test_v2c_getbulk(self): +- print "\n" +- print "---v2c getbulk-------------------------------------\n" ++ print("\n") ++ print("---v2c getbulk-------------------------------------\n") + + sess = setup_v2() + varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), +@@ -245,16 +245,16 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysORUpTime')) + + vals = sess.getbulk(2, 8, varlist) +- print "v2 sess.getbulk result: ", vals, "\n" ++ print("v2 sess.getbulk result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + + def test_v2c_set(self): +- print "\n" +- print "---v2c set-------------------------------------\n" ++ print("\n") ++ print("---v2c set-------------------------------------\n") + + sess = setup_v2() + +@@ -262,54 +262,54 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysLocation', '0', 'my even newer location')) + + res = sess.set(varlist) +- print "v2 sess.set result: ", res, "\n" ++ print("v2 sess.set result: ", res, "\n") + self.assertEqual(res, 1) + + def test_v2c_walk(self): +- print "\n" +- print "---v2c walk-------------------------------------\n" ++ print("\n") ++ print("---v2c walk-------------------------------------\n") + + sess = setup_v2() + + varlist = netsnmp.VarList(netsnmp.Varbind('system')) + + vals = sess.walk(varlist) +- print "v2 sess.walk result: ", vals, "\n" ++ print("v2 sess.walk result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + + def test_v3_get(self): +- print "\n" ++ print("\n") + sess = setup_v3(); + varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) +- print "---v3 get-------------------------------------\n" ++ print("---v3 get-------------------------------------\n") + vals = sess.get(varlist) +- print "v3 sess.get result: ", vals, "\n" ++ print("v3 sess.get result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + + def test_v3_getnext(self): +- print "\n" +- print "---v3 getnext-------------------------------------\n" ++ print("\n") ++ print("---v3 getnext-------------------------------------\n") + + sess = setup_v3(); + varlist = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), + netsnmp.Varbind('sysContact', 0), + netsnmp.Varbind('sysLocation', 0)) + vals = sess.getnext(varlist) +- print "v3 sess.getnext result: ", vals, "\n" ++ print("v3 sess.getnext result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + + def test_v3_getbulk(self): + sess = setup_v3(); +@@ -320,47 +320,47 @@ class BasicTests(unittest.TestCase): + netsnmp.Varbind('sysORUpTime')) + + vals = sess.getbulk(2, 8, varlist) +- print "v3 sess.getbulk result: ", vals, "\n" ++ print("v3 sess.getbulk result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + + def test_v3_set(self): +- print "\n" +- print "---v3 set-------------------------------------\n" ++ print("\n") ++ print("---v3 set-------------------------------------\n") + + sess = setup_v3(); + varlist = netsnmp.VarList( + netsnmp.Varbind('sysLocation', '0', 'my final destination')) + res = sess.set(varlist) +- print "v3 sess.set result: ", res, "\n" ++ print("v3 sess.set result: ", res, "\n") + self.assertEqual(res, 1) + + def test_v3_walk(self): +- print "\n" +- print "---v3 walk-------------------------------------\n" ++ print("\n") ++ print("---v3 walk-------------------------------------\n") + sess = setup_v3(); + varlist = netsnmp.VarList(netsnmp.Varbind('system')) + + vals = sess.walk(varlist) +- print "v3 sess.walk result: ", vals, "\n" ++ print("v3 sess.walk result: ", vals, "\n") + self.assertTrue(len(vals) > 0) + + for var in varlist: +- print " ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print(" ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + + + class SetTests(unittest.TestCase): + """SNMP set tests for the Net-SNMP Python interface""" + def testFuncs(self): + """Test code""" +- print "\n-------------- SET Test Start ----------------------------\n" ++ print("\n-------------- SET Test Start ----------------------------\n") + + var = netsnmp.Varbind('sysUpTime', '0') + res = netsnmp.snmpget(var, **snmp_dest()) +- print "uptime = ", res[0] ++ print("uptime = ", res[0]) + self.assertEqual(len(res), 1) + + +@@ -370,19 +370,19 @@ class SetTests(unittest.TestCase): + + var = netsnmp.Varbind('sysUpTime', '0') + res = netsnmp.snmpget(var, **snmp_dest()) +- print "uptime = ", res[0] ++ print("uptime = ", res[0]) + self.assertEqual(len(res), 1) + + var = netsnmp.Varbind('nsCacheEntry') + res = netsnmp.snmpgetnext(var, **snmp_dest()) +- print "var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print("var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + self.assertEqual(len(res), 1) + + var.val = 65 + res = netsnmp.snmpset(var, **snmp_dest()) + self.assertEqual(res, 1) + res = netsnmp.snmpget(var, **snmp_dest()) +- print "var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')' ++ print("var = ", var.tag, var.iid, "=", var.val, '(', var.type, ')') + self.assertEqual(len(res), 1) + self.assertEqual(res[0], '65'); + +@@ -394,7 +394,7 @@ class SetTests(unittest.TestCase): + netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116', '', 4)) + res = sess.set(varlist) + +- print "res = ", res ++ print("res = ", res) + self.assertEqual(res, 1) + + varlist = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), +@@ -414,15 +414,15 @@ class SetTests(unittest.TestCase): + self.assertEqual(varlist[2].val, '3') + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + + varlist = netsnmp.VarList( + netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116', '', 6)) + + res = sess.set(varlist) + +- print "res = ", res ++ print("res = ", res) + self.assertEqual(res, 1) + + varlist = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), +@@ -436,10 +436,10 @@ class SetTests(unittest.TestCase): + self.assertNotEqual(varlist[2].tag, 'snmpTargetAddrRowStatus') + + for var in varlist: +- print var.tag, var.iid, "=", var.val, '(', var.type, ')' +- print "\n" ++ print(var.tag, var.iid, "=", var.val, '(', var.type, ')') ++ print("\n") + +- print "\n-------------- SET Test End ----------------------------\n" ++ print("\n-------------- SET Test End ----------------------------\n") + + + if __name__ == '__main__': +diff -Nurp net-snmp-5.8-orig/python/setup.py net-snmp-5.8/python/setup.py +--- net-snmp-5.8-orig/python/setup.py 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/python/setup.py 2018-10-10 19:38:51.185817022 +0000 +@@ -9,9 +9,9 @@ intree=0 + + args = sys.argv[:] + for arg in args: +- if string.find(arg,'--basedir=') == 0: +- basedir = string.split(arg,'=')[1] +- sys.argv.remove(arg) ++ if arg.find('--basedir=') == 0: ++ basedir = arg.split('=')[1] ++ sys.argv.remove(arg) + intree=1 + + if intree: diff --git a/net-snmp-5.7.3-modern-rpm-api.patch b/net-snmp-5.8-modern-rpm-api.patch similarity index 70% rename from net-snmp-5.7.3-modern-rpm-api.patch rename to net-snmp-5.8-modern-rpm-api.patch index 3f0d5e1..1ee292f 100644 --- a/net-snmp-5.7.3-modern-rpm-api.patch +++ b/net-snmp-5.8-modern-rpm-api.patch @@ -1,20 +1,20 @@ -diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/data_access/swinst_rpm.c net-snmp-5.7.3/agent/mibgroup/host/data_access/swinst_rpm.c ---- net-snmp-5.7.3.orig/agent/mibgroup/host/data_access/swinst_rpm.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/mibgroup/host/data_access/swinst_rpm.c 2017-08-11 00:16:35.232470439 +0200 -@@ -96,8 +96,7 @@ - - rpmdbMatchIterator mi; - Header h; +diff -Nurp net-snmp-5.8-orig/agent/mibgroup/host/data_access/swinst_rpm.c net-snmp-5.8/agent/mibgroup/host/data_access/swinst_rpm.c +--- net-snmp-5.8-orig/agent/mibgroup/host/data_access/swinst_rpm.c 2018-10-10 09:45:14.907075076 +0000 ++++ net-snmp-5.8/agent/mibgroup/host/data_access/swinst_rpm.c 2018-10-10 19:31:51.161967195 +0000 +@@ -101,8 +101,7 @@ netsnmp_swinst_arch_load( netsnmp_contai + const char *g; + rpmtd td_name, td_version, td_release, td_group, td_time; + #else - char *n, *v, *r, *g; - int32_t *t; + const char *n, *v, *r, *g; + #endif time_t install_time; size_t date_len; - int i = 1; -@@ -119,11 +118,11 @@ - CONTAINER_INSERT(container, entry); - - h = headerLink( h ); +@@ -146,14 +145,14 @@ netsnmp_swinst_arch_load( netsnmp_contai + install_time = rpmtdGetNumber(td_time); + g = rpmtdGetString(td_group); + #else - headerGetEntry( h, RPMTAG_NAME, NULL, (void**)&n, NULL); - headerGetEntry( h, RPMTAG_VERSION, NULL, (void**)&v, NULL); - headerGetEntry( h, RPMTAG_RELEASE, NULL, (void**)&r, NULL); @@ -25,21 +25,17 @@ diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/data_access/swinst_rpm.c net-s + r = headerGetString( h, RPMTAG_RELEASE); + g = headerGetString( h, RPMTAG_GROUP); + install_time = headerGetNumber( h, RPMTAG_INSTALLTIME); - ++ entry->swName_len = snprintf( entry->swName, sizeof(entry->swName), "%s-%s-%s", n, v, r); -@@ -133,7 +132,6 @@ - ? 2 /* operatingSystem */ - : 4; /* application */ - - install_time = *t; - dt = date_n_time( &install_time, &date_len ); - if (date_len != 8 && date_len != 11) { - snmp_log(LOG_ERR, "Bogus length from date_n_time for %s", entry->swName); -diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c net-snmp-5.7.3/agent/mibgroup/host/hr_swinst.c ---- net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c 2014-12-08 21:23:22.000000000 +0100 -+++ net-snmp-5.7.3/agent/mibgroup/host/hr_swinst.c 2017-08-11 00:17:07.488544492 +0200 -@@ -484,9 +484,9 @@ + #endif + entry->swType = (g && NULL != strstr( g, "System Environment")) + ? 2 /* operatingSystem */ +diff -Nurp net-snmp-5.8-orig/agent/mibgroup/host/hr_swinst.c net-snmp-5.8/agent/mibgroup/host/hr_swinst.c +--- net-snmp-5.8-orig/agent/mibgroup/host/hr_swinst.c 2018-10-10 09:45:14.907075076 +0000 ++++ net-snmp-5.8/agent/mibgroup/host/hr_swinst.c 2018-10-10 19:34:48.935596621 +0000 +@@ -479,9 +479,9 @@ var_hrswinst(struct variable * vp, } #else # ifdef HAVE_LIBRPM @@ -52,7 +48,7 @@ diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c net-snmp-5.7.3/age long_return = 2; /* operatingSystem */ else long_return = 4; /* applcation */ -@@ -503,9 +503,8 @@ +@@ -498,9 +498,8 @@ var_hrswinst(struct variable * vp, case HRSWINST_DATE: { #ifdef HAVE_LIBRPM @@ -64,16 +60,16 @@ diff -uNr net-snmp-5.7.3.orig/agent/mibgroup/host/hr_swinst.c net-snmp-5.7.3/age ret = date_n_time(&installTime, var_len); } else { ret = date_n_time(NULL, var_len); -@@ -665,7 +664,7 @@ +@@ -660,7 +659,7 @@ Save_HR_SW_info(int ix) if (1 <= ix && ix <= swi->swi_nrec && ix != swi->swi_prevx) { int offset; Header h; - char *n, *v, *r; -+ const char *n, *v, *r; ++ const char *n, *v, *r; offset = swi->swi_recs[ix - 1]; -@@ -690,11 +689,9 @@ +@@ -685,11 +684,9 @@ Save_HR_SW_info(int ix) swi->swi_h = h; swi->swi_prevx = ix; diff --git a/net-snmp-5.7.3-net-snmp-config-headercheck.patch b/net-snmp-5.8-net-snmp-config-headercheck.patch similarity index 87% rename from net-snmp-5.7.3-net-snmp-config-headercheck.patch rename to net-snmp-5.8-net-snmp-config-headercheck.patch index 1be8285..50b08cb 100644 --- a/net-snmp-5.7.3-net-snmp-config-headercheck.patch +++ b/net-snmp-5.8-net-snmp-config-headercheck.patch @@ -1,7 +1,6 @@ -Index: net-snmp-5.7.2/net-snmp-config.in -=================================================================== ---- net-snmp-5.7.2.orig/net-snmp-config.in -+++ net-snmp-5.7.2/net-snmp-config.in +diff -Nurp net-snmp-5.8-orig/net-snmp-config.in net-snmp-5.8/net-snmp-config.in +--- net-snmp-5.8-orig/net-snmp-config.in 2018-10-10 09:45:14.947075442 +0000 ++++ net-snmp-5.8/net-snmp-config.in 2018-10-10 09:48:04.792631474 +0000 @@ -41,6 +41,14 @@ count() echo $# } @@ -17,7 +16,7 @@ Index: net-snmp-5.7.2/net-snmp-config.in prefix=@prefix@ exec_prefix=@exec_prefix@ includedir=@includedir@ -@@ -138,9 +146,11 @@ else +@@ -140,9 +148,11 @@ else ;; #################################################### compile --base-cflags) @@ -29,7 +28,7 @@ Index: net-snmp-5.7.2/net-snmp-config.in echo @CFLAGS@ @DEVFLAGS@ @CPPFLAGS@ -I. -I${NSC_INCLUDEDIR} ;; --srcdir) -@@ -151,6 +161,7 @@ else +@@ -153,6 +163,7 @@ else echo $NSC_LIBDIR ;; --ldflags|--ld*) @@ -37,7 +36,7 @@ Index: net-snmp-5.7.2/net-snmp-config.in echo $NSC_LDFLAGS ;; --build-lib-dirs) -@@ -188,29 +199,37 @@ else +@@ -190,29 +201,37 @@ else #################################################### client lib --libs) # use this one == --netsnmp-libs + --external-libs @@ -75,7 +74,7 @@ Index: net-snmp-5.7.2/net-snmp-config.in echo $NSC_LDFLAGS $NSC_LMIBLIBS $NSC_LAGENTLIBS $NSC_LNETSNMPLIBS $NSC_LIBS ;; #################################################### -@@ -236,6 +255,7 @@ else +@@ -238,6 +257,7 @@ else #################################################### --compile-subagent) diff --git a/net-snmp-5.8-netgroups.patch b/net-snmp-5.8-netgroups.patch new file mode 100644 index 0000000..3167524 --- /dev/null +++ b/net-snmp-5.8-netgroups.patch @@ -0,0 +1,41 @@ +diff -Nurp net-snmp-5.8-orig/configure.d/config_os_functions net-snmp-5.8/configure.d/config_os_functions +--- net-snmp-5.8-orig/configure.d/config_os_functions 2018-10-10 09:45:14.899075003 +0000 ++++ net-snmp-5.8/configure.d/config_os_functions 2018-10-10 10:06:55.326988809 +0000 +@@ -37,11 +37,12 @@ AC_CHECK_FUNCS([rand random srand sran + + # Library: + AC_CHECK_FUNCS([asprintf ] dnl +- [closedir fgetc_unlocked flockfile ] dnl +- [fork funlockfile getipnodebyname ] dnl +- [gettimeofday if_nametoindex mkstemp ] dnl +- [opendir readdir regcomp ] dnl +- [setenv setitimer setlocale ] dnl ++ [closedir endnetgrent fgetc_unlocked ] dnl ++ [flockfile fork funlockfile ] dnl ++ [getipnodebyname getnetgrent gettimeofday ] dnl ++ [if_nametoindex mkstemp opendir ] dnl ++ [readdir regcomp setenv ] dnl ++ [setitimer setlocale setnetgrent ] dnl + [setsid snprintf strcasestr ] dnl + [strdup strerror strncasecmp ] dnl + [sysconf times vsnprintf ] ) +diff -Nurp net-snmp-5.8-orig/man/snmpd.conf.5.def net-snmp-5.8/man/snmpd.conf.5.def +--- net-snmp-5.8-orig/man/snmpd.conf.5.def 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/man/snmpd.conf.5.def 2018-10-10 10:10:44.057084311 +0000 +@@ -390,7 +390,15 @@ map an SNMPv1 or SNMPv2c community strin + a particular range of source addresses, or globally (\fI"default"\fR). + A restricted source can either be a specific hostname (or address), or + a subnet - represented as IP/MASK (e.g. 10.10.10.0/255.255.255.0), or +-IP/BITS (e.g. 10.10.10.0/24), or the IPv6 equivalents. ++IP/BITS (e.g. 10.10.10.0/24), or the IPv6 equivalents. It is also possible ++to reference a specific \fInetgroup\fR starting with an '@' character (e.g. ++@adminhosts). The \fInetgroup\fR lookup is running through the NSS (Name ++Services Switch) making it possible to define the group locally or via ++NIS/LDAP. ++.IP ++Note: The hostname DNS lookup and \fInetgroup\fR resolution is done only ++during snmpd start or reload. ++.IP + A restriction preceded by an exclamation mark (!) denies access from + that address or subnet, e.g., !10.10.10.0/24 denies requests from + that sources in that subnet. Deny restrictions must be before diff --git a/net-snmp-5.7.3-perl-tk-warning.patch b/net-snmp-5.8-perl-tk-warning.patch similarity index 100% rename from net-snmp-5.7.3-perl-tk-warning.patch rename to net-snmp-5.8-perl-tk-warning.patch diff --git a/net-snmp-5.7.3-pie.patch b/net-snmp-5.8-pie.patch similarity index 62% rename from net-snmp-5.7.3-pie.patch rename to net-snmp-5.8-pie.patch index 29b8590..86d4c1c 100644 --- a/net-snmp-5.7.3-pie.patch +++ b/net-snmp-5.8-pie.patch @@ -1,8 +1,7 @@ -Index: net-snmp-5.7.2/agent/Makefile.in -=================================================================== ---- net-snmp-5.7.2.orig/agent/Makefile.in -+++ net-snmp-5.7.2/agent/Makefile.in -@@ -294,7 +294,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c +diff -Nurp net-snmp-5.8-orig/agent/Makefile.in net-snmp-5.8/agent/Makefile.in +--- net-snmp-5.8-orig/agent/Makefile.in 2018-10-10 20:12:33.288508471 +0000 ++++ net-snmp-5.8/agent/Makefile.in 2018-10-10 20:12:13.236322553 +0000 +@@ -297,7 +297,7 @@ getmibstat.o: mibgroup/kernel_sunos5.c $(CC) $(CFLAGS) -o $@ -D_GETMIBSTAT_TEST -DDODEBUG -c $? snmpd$(EXEEXT): ${LAGENTOBJS} $(USELIBS) $(AGENTLIB) $(HELPERLIB) $(MIBLIB) $(LIBTARG) @@ -11,11 +10,10 @@ Index: net-snmp-5.7.2/agent/Makefile.in libnetsnmpagent.$(LIB_EXTENSION)$(LIB_VERSION): ${LLIBAGENTOBJS} $(USELIBS) $(LIB_LD_CMD) $(AGENTLIB) ${LLIBAGENTOBJS} $(USELIBS) ${LAGENTLIBS} @LD_NO_UNDEFINED@ $(LDFLAGS) $(PERLLDOPTS_FOR_LIBS) $(LIB_LD_LIBS) @AGENTLIBS@ -Index: net-snmp-5.7.2/apps/Makefile.in -=================================================================== ---- net-snmp-5.7.2.orig/apps/Makefile.in -+++ net-snmp-5.7.2/apps/Makefile.in -@@ -170,7 +170,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX +diff -Nurp net-snmp-5.8-orig/apps/Makefile.in net-snmp-5.8/apps/Makefile.in +--- net-snmp-5.8-orig/apps/Makefile.in 2018-10-10 20:10:23.983309589 +0000 ++++ net-snmp-5.8/apps/Makefile.in 2018-10-10 20:11:50.172108708 +0000 +@@ -183,7 +183,7 @@ snmptest$(EXEEXT): snmptest.$(OSUFFIX $(LINK) ${CFLAGS} -o $@ snmptest.$(OSUFFIX) ${LDFLAGS} ${LIBS} snmptrapd$(EXEEXT): $(TRAPD_OBJECTS) $(USETRAPLIBS) $(INSTALLLIBS) diff --git a/net-snmp-5.7.3-snmpstatus-suppress-output.patch b/net-snmp-5.8-snmpstatus-suppress-output.patch similarity index 86% rename from net-snmp-5.7.3-snmpstatus-suppress-output.patch rename to net-snmp-5.8-snmpstatus-suppress-output.patch index 820a7c9..7de2165 100644 --- a/net-snmp-5.7.3-snmpstatus-suppress-output.patch +++ b/net-snmp-5.8-snmpstatus-suppress-output.patch @@ -1,6 +1,6 @@ -diff -Nurp net-snmp-5.7.3.orig/apps/snmpstatus.c net-snmp-5.7.3/apps/snmpstatus.c ---- net-snmp-5.7.3.orig/apps/snmpstatus.c 2015-07-14 22:06:08.938851077 +0200 -+++ net-snmp-5.7.3/apps/snmpstatus.c 2015-07-14 22:06:23.905980889 +0200 +diff -Nurp net-snmp-5.8-orig/apps/snmpstatus.c net-snmp-5.8/apps/snmpstatus.c +--- net-snmp-5.8-orig/apps/snmpstatus.c 2018-10-10 09:45:14.955075516 +0000 ++++ net-snmp-5.8/apps/snmpstatus.c 2018-10-10 10:15:16.131576910 +0000 @@ -96,6 +96,15 @@ size_t length_ipOutRequests = #define NETSNMP_DS_APP_DONT_FIX_PDUS 0 @@ -53,14 +53,14 @@ diff -Nurp net-snmp-5.7.3.orig/apps/snmpstatus.c net-snmp-5.7.3/apps/snmpstatus. } -@@ -152,7 +183,7 @@ main(int argc, char *argv[]) +@@ -154,7 +185,7 @@ main(int argc, char *argv[]) /* * get the common command line arguments */ - switch (snmp_parse_args(argc, argv, &session, "C:", &optProc)) { + switch (snmp_parse_args(argc, argv, &session, "C:S:", &optProc)) { case NETSNMP_PARSE_ARGS_ERROR: - exit(1); + goto out; case NETSNMP_PARSE_ARGS_SUCCESS_EXIT: @@ -185,8 +216,10 @@ main(int argc, char *argv[]) pdu = snmp_pdu_create(SNMP_MSG_GET); @@ -75,7 +75,7 @@ diff -Nurp net-snmp-5.7.3.orig/apps/snmpstatus.c net-snmp-5.7.3/apps/snmpstatus. /* * do the request -@@ -278,6 +311,10 @@ main(int argc, char *argv[]) +@@ -279,6 +312,10 @@ main(int argc, char *argv[]) if (response) snmp_free_pdu(response); @@ -86,7 +86,7 @@ diff -Nurp net-snmp-5.7.3.orig/apps/snmpstatus.c net-snmp-5.7.3/apps/snmpstatus. /* * create PDU for GET request and add object names to request */ -@@ -375,11 +412,11 @@ main(int argc, char *argv[]) +@@ -386,11 +423,11 @@ main(int argc, char *argv[]) } printf("Interfaces: %d, Recv/Trans packets: %d/%d | IP: %d/%d\n", interfaces, ipackets, opackets, ipin, ipout); @@ -98,11 +98,11 @@ diff -Nurp net-snmp-5.7.3.orig/apps/snmpstatus.c net-snmp-5.7.3/apps/snmpstatus. - + done: snmp_close(ss); - SOCK_CLEANUP; - return exitval; -diff -Nurp net-snmp-5.7.3.orig/man/snmpstatus.1.def net-snmp-5.7.3/man/snmpstatus.1.def ---- net-snmp-5.7.3.orig/man/snmpstatus.1.def 2015-07-14 22:06:08.838850210 +0200 -+++ net-snmp-5.7.3/man/snmpstatus.1.def 2015-07-14 22:13:19.891588792 +0200 + + out: +diff -Nurp net-snmp-5.8-orig/man/snmpstatus.1.def net-snmp-5.8/man/snmpstatus.1.def +--- net-snmp-5.8-orig/man/snmpstatus.1.def 2018-10-10 09:45:14.951075479 +0000 ++++ net-snmp-5.8/man/snmpstatus.1.def 2018-10-10 10:15:16.131576910 +0000 @@ -32,7 +32,7 @@ snmpstatus - retrieves a fixed set of management information from a network entity .SH SYNOPSIS diff --git a/net-snmp-5.7.3-socket-path.patch b/net-snmp-5.8-socket-path.patch similarity index 100% rename from net-snmp-5.7.3-socket-path.patch rename to net-snmp-5.8-socket-path.patch diff --git a/net-snmp-5.7.3-testing-empty-arptable.patch b/net-snmp-5.8-testing-empty-arptable.patch similarity index 100% rename from net-snmp-5.7.3-testing-empty-arptable.patch rename to net-snmp-5.8-testing-empty-arptable.patch diff --git a/net-snmp-5.7.3-velocity-mib.patch b/net-snmp-5.8-velocity-mib.patch similarity index 100% rename from net-snmp-5.7.3-velocity-mib.patch rename to net-snmp-5.8-velocity-mib.patch diff --git a/net-snmp-5.8.tar.gz b/net-snmp-5.8.tar.gz new file mode 100644 index 0000000..717d4f4 --- /dev/null +++ b/net-snmp-5.8.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:b2fc3500840ebe532734c4786b0da4ef0a5f67e51ef4c86b3345d697e4976adf +size 6591680 diff --git a/net-snmp-python3.patch b/net-snmp-python3.patch deleted file mode 100644 index 4de2dc6..0000000 --- a/net-snmp-python3.patch +++ /dev/null @@ -1,505 +0,0 @@ -Index: net-snmp-5.7.3/python/setup.py -=================================================================== ---- net-snmp-5.7.3.orig/python/setup.py -+++ net-snmp-5.7.3/python/setup.py -@@ -9,9 +9,9 @@ intree=0 - - args = sys.argv[:] - for arg in args: -- if string.find(arg,'--basedir=') == 0: -- basedir = string.split(arg,'=')[1] -- sys.argv.remove(arg) -+ if arg.find('--basedir=') == 0: -+ basedir = arg.split('=')[1] -+ sys.argv.remove(arg) - intree=1 - - if intree: -Index: net-snmp-5.7.3/python/netsnmp/client.py -=================================================================== ---- net-snmp-5.7.3.orig/python/netsnmp/client.py -+++ net-snmp-5.7.3/python/netsnmp/client.py -@@ -1,3 +1,4 @@ -+from __future__ import print_function - import client_intf - import string - import re -@@ -35,12 +36,12 @@ def _parse_session_args(kargs): - 'TheirHostname':'', - 'TrustCert':'' - } -- keys = kargs.keys() -+ keys = list(kargs.keys()) - for key in keys: -- if sessArgs.has_key(key): -+ if key in sessArgs: - sessArgs[key] = kargs[key] - else: -- print >>stderr, "ERROR: unknown key", key -+ print("ERROR: unknown key", key, file=stderr) - return sessArgs - - def STR(obj): -@@ -127,7 +128,7 @@ class Session(object): - - sess_args = _parse_session_args(args) - -- for k,v in sess_args.items(): -+ for k,v in list(sess_args.items()): - self.__dict__[k] = v - - -Index: net-snmp-5.7.3/python/netsnmp/tests/test.py -=================================================================== ---- net-snmp-5.7.3.orig/python/netsnmp/tests/test.py -+++ net-snmp-5.7.3/python/netsnmp/tests/test.py -@@ -8,7 +8,7 @@ import time - - class BasicTests(unittest.TestCase): - def testFuncs(self): -- print "" -+ print("") - var = netsnmp.Varbind('sysDescr.0') - var = netsnmp.Varbind('sysDescr','0') - var = netsnmp.Varbind( -@@ -19,67 +19,67 @@ class BasicTests(unittest.TestCase): - - var = netsnmp.Varbind('.1.3.6.1.2.1.1.1','0') - -- print "---v1 GET tests -------------------------------------\n" -+ print("---v1 GET tests -------------------------------------\n") - res = netsnmp.snmpget(var, - Version = 1, - DestHost='localhost', - Community='public') - -- print "v1 snmpget result: ", res, "\n" -+ print("v1 snmpget result: ", res, "\n") - -- print "v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print("v1 get var: ", var.tag, var.iid, "=", var.val, '(',var.type,')') - -- print "---v1 GETNEXT tests-------------------------------------\n" -+ print("---v1 GETNEXT tests-------------------------------------\n") - res = netsnmp.snmpgetnext(var, - Version = 1, - DestHost='localhost', - Community='public') - -- print "v1 snmpgetnext result: ", res, "\n" -+ print("v1 snmpgetnext result: ", res, "\n") - -- print "v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print("v1 getnext var: ", var.tag, var.iid, "=", var.val, '(',var.type,')') - -- print "---v1 SET tests-------------------------------------\n" -+ print("---v1 SET tests-------------------------------------\n") - var = netsnmp.Varbind('sysLocation','0', 'my new location') - res = netsnmp.snmpset(var, - Version = 1, - DestHost='localhost', - Community='public') - -- print "v1 snmpset result: ", res, "\n" -+ print("v1 snmpset result: ", res, "\n") - -- print "v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print("v1 set var: ", var.tag, var.iid, "=", var.val, '(',var.type,')') - -- print "---v1 walk tests-------------------------------------\n" -+ print("---v1 walk tests-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - -- print "v1 varlist walk in: " -+ print("v1 varlist walk in: ") - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') - - res = netsnmp.snmpwalk(vars, - Version = 1, - DestHost='localhost', - Community='public') -- print "v1 snmpwalk result: ", res, "\n" -+ print("v1 snmpwalk result: ", res, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') - - -- print "---v1 walk 2-------------------------------------\n" -+ print("---v1 walk 2-------------------------------------\n") - -- print "v1 varbind walk in: " -+ print("v1 varbind walk in: ") - var = netsnmp.Varbind('system') - res = netsnmp.snmpwalk(var, - Version = 1, - DestHost='localhost', - Community='public') -- print "v1 snmpwalk result (should be = orig): ", res, "\n" -+ print("v1 snmpwalk result (should be = orig): ", res, "\n") - -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') - -- print "---v1 multi-varbind test-------------------------------------\n" -+ print("---v1 multi-varbind test-------------------------------------\n") - sess = netsnmp.Session(Version=1, - DestHost='localhost', - Community='public') -@@ -88,16 +88,16 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - vals = sess.get(vars) -- print "v1 sess.get result: ", vals, "\n" -+ print("v1 sess.get result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') - - vals = sess.getnext(vars) -- print "v1 sess.getnext result: ", vals, "\n" -+ print("v1 sess.getnext result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') - - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), - netsnmp.Varbind('sysORLastChange'), -@@ -106,28 +106,28 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, vars) -- print "v1 sess.getbulk result: ", vals, "\n" -+ print("v1 sess.getbulk result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') - -- print "---v1 set2-------------------------------------\n" -+ print("---v1 set2-------------------------------------\n") - - vars = netsnmp.VarList( - netsnmp.Varbind('sysLocation', '0', 'my newer location')) - res = sess.set(vars) -- print "v1 sess.set result: ", res, "\n" -+ print("v1 sess.set result: ", res, "\n") - -- print "---v1 walk3-------------------------------------\n" -+ print("---v1 walk3-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(vars) -- print "v1 sess.walk result: ", vals, "\n" -+ print("v1 sess.walk result: ", vals, "\n") - - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') - -- print "---v2c get-------------------------------------\n" -+ print("---v2c get-------------------------------------\n") - - sess = netsnmp.Session(Version=2, - DestHost='localhost', -@@ -140,22 +140,22 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) - vals = sess.get(vars) -- print "v2 sess.get result: ", vals, "\n" -+ print("v2 sess.get result: ", vals, "\n") - -- print "---v2c getnext-------------------------------------\n" -+ print("---v2c getnext-------------------------------------\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - - vals = sess.getnext(vars) -- print "v2 sess.getnext result: ", vals, "\n" -+ print("v2 sess.getnext result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - -- print "---v2c getbulk-------------------------------------\n" -+ print("---v2c getbulk-------------------------------------\n") - - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), - netsnmp.Varbind('sysORLastChange'), -@@ -164,30 +164,30 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, vars) -- print "v2 sess.getbulk result: ", vals, "\n" -+ print("v2 sess.getbulk result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - -- print "---v2c set-------------------------------------\n" -+ print("---v2c set-------------------------------------\n") - - vars = netsnmp.VarList( - netsnmp.Varbind('sysLocation','0','my even newer location')) - - res = sess.set(vars) -- print "v2 sess.set result: ", res, "\n" -+ print("v2 sess.set result: ", res, "\n") - -- print "---v2c walk-------------------------------------\n" -+ print("---v2c walk-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(vars) -- print "v2 sess.walk result: ", vals, "\n" -+ print("v2 sess.walk result: ", vals, "\n") - - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') - -- print "---v3 setup-------------------------------------\n" -+ print("---v3 setup-------------------------------------\n") - sess = netsnmp.Session(Version=3, - DestHost='localhost', - SecLevel='authPriv', -@@ -200,22 +200,22 @@ class BasicTests(unittest.TestCase): - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime', 0), - netsnmp.Varbind('sysContact', 0), - netsnmp.Varbind('sysLocation', 0)) -- print "---v3 get-------------------------------------\n" -+ print("---v3 get-------------------------------------\n") - vals = sess.get(vars) -- print "v3 sess.get result: ", vals, "\n" -+ print("v3 sess.get result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - -- print "---v3 getnext-------------------------------------\n" -+ print("---v3 getnext-------------------------------------\n") - - vals = sess.getnext(vars) -- print "v3 sess.getnext result: ", vals, "\n" -+ print("v3 sess.getnext result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - - vars = netsnmp.VarList(netsnmp.Varbind('sysUpTime'), - netsnmp.Varbind('sysORLastChange'), -@@ -224,37 +224,37 @@ class BasicTests(unittest.TestCase): - netsnmp.Varbind('sysORUpTime')) - - vals = sess.getbulk(2, 8, vars) -- print "v3 sess.getbulk result: ", vals, "\n" -+ print("v3 sess.getbulk result: ", vals, "\n") - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - -- print "---v3 set-------------------------------------\n" -+ print("---v3 set-------------------------------------\n") - - vars = netsnmp.VarList( - netsnmp.Varbind('sysLocation','0', 'my final destination')) - res = sess.set(vars) -- print "v3 sess.set result: ", res, "\n" -+ print("v3 sess.set result: ", res, "\n") - -- print "---v3 walk-------------------------------------\n" -+ print("---v3 walk-------------------------------------\n") - vars = netsnmp.VarList(netsnmp.Varbind('system')) - - vals = sess.walk(vars) -- print "v3 sess.walk result: ", vals, "\n" -+ print("v3 sess.walk result: ", vals, "\n") - - for var in vars: -- print " ",var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print(" ",var.tag, var.iid, "=", var.val, '(',var.type,')') - - - class SetTests(unittest.TestCase): - def testFuncs(self): -- print "\n-------------- SET Test Start ----------------------------\n" -+ print("\n-------------- SET Test Start ----------------------------\n") - - var = netsnmp.Varbind('sysUpTime','0') - res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', - Community='public') -- print "uptime = ", res[0] -+ print("uptime = ", res[0]) - - - var = netsnmp.Varbind('versionRestartAgent','0', 1) -@@ -264,19 +264,19 @@ class SetTests(unittest.TestCase): - var = netsnmp.Varbind('sysUpTime','0') - res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', - Community='public') -- print "uptime = ", res[0] -+ print("uptime = ", res[0]) - - var = netsnmp.Varbind('nsCacheEntry') - res = netsnmp.snmpgetnext(var, Version = 1, DestHost='localhost', - Community='public') -- print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print("var = ", var.tag, var.iid, "=", var.val, '(',var.type,')') - - var.val = 65 - res = netsnmp.snmpset(var, Version = 1, DestHost='localhost', - Community='public') - res = netsnmp.snmpget(var, Version = 1, DestHost='localhost', - Community='public') -- print "var = ", var.tag, var.iid, "=", var.val, '(',var.type,')' -+ print("var = ", var.tag, var.iid, "=", var.val, '(',var.type,')') - - sess = netsnmp.Session(Version = 1, DestHost='localhost', - Community='public') -@@ -286,7 +286,7 @@ class SetTests(unittest.TestCase): - netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 4)) - res = sess.set(vars) - -- print "res = ", res -+ print("res = ", res) - - vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), - netsnmp.Varbind('snmpTargetAddrTAddress'), -@@ -295,14 +295,14 @@ class SetTests(unittest.TestCase): - res = sess.getnext(vars) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - - vars = netsnmp.VarList(netsnmp.Varbind('.1.3.6.1.6.3.12.1.2.1.9.116.101.115.116','', 6)) - - res = sess.set(vars) - -- print "res = ", res -+ print("res = ", res) - - vars = netsnmp.VarList(netsnmp.Varbind('snmpTargetAddrTDomain'), - netsnmp.Varbind('snmpTargetAddrTAddress'), -@@ -311,10 +311,10 @@ class SetTests(unittest.TestCase): - res = sess.getnext(vars) - - for var in vars: -- print var.tag, var.iid, "=", var.val, '(',var.type,')' -- print "\n" -+ print(var.tag, var.iid, "=", var.val, '(',var.type,')') -+ print("\n") - -- print "\n-------------- SET Test End ----------------------------\n" -+ print("\n-------------- SET Test End ----------------------------\n") - - - if __name__=='__main__': -Index: net-snmp-5.7.3/python/netsnmp/client_intf.c -=================================================================== ---- net-snmp-5.7.3.orig/python/netsnmp/client_intf.c -+++ net-snmp-5.7.3/python/netsnmp/client_intf.c -@@ -979,7 +979,11 @@ py_netsnmp_attr_string(PyObject *obj, ch - PyObject *attr = PyObject_GetAttrString(obj, attr_name); - if (attr) { - int retval; -+#if PY_MAJOR_VERSION >= 3 -+ retval = PyBytes_AsStringAndSize(attr, val, len); -+#else - retval = PyString_AsStringAndSize(attr, val, len); -+#endif - Py_DECREF(attr); - return retval; - } -@@ -996,7 +1000,11 @@ py_netsnmp_attr_long(PyObject *obj, char - if (obj && attr_name && PyObject_HasAttrString(obj, attr_name)) { - PyObject *attr = PyObject_GetAttrString(obj, attr_name); - if (attr) { -+#if PY_MAJOR_VERSION >= 3 -+ val = PyLong_AsLong(attr); -+#else - val = PyInt_AsLong(attr); -+#endif - Py_DECREF(attr); - } - } -@@ -1079,11 +1087,19 @@ __py_netsnmp_update_session_errors(PyObj - - py_netsnmp_attr_set_string(session, "ErrorStr", err_str, STRLEN(err_str)); - -+#if PY_MAJOR_VERSION >= 3 -+ tmp_for_conversion = PyLong_FromLong(err_num); -+#else - tmp_for_conversion = PyInt_FromLong(err_num); -+#endif - PyObject_SetAttrString(session, "ErrorNum", tmp_for_conversion); - Py_DECREF(tmp_for_conversion); - -+#if PY_MAJOR_VERSION >= 3 -+ tmp_for_conversion = PyLong_FromLong(err_ind); -+#else - tmp_for_conversion = PyInt_FromLong(err_ind); -+#endif - PyObject_SetAttrString(session, "ErrorInd", tmp_for_conversion); - Py_DECREF(tmp_for_conversion); - } -@@ -2607,13 +2623,28 @@ static PyMethodDef ClientMethods[] = { - {NULL, NULL, 0, NULL} /* Sentinel */ - }; - -+#if PY_MAJOR_VERSION >= 3 -+static struct PyModuleDef ClientModuleDef = { -+ PyModuleDef_HEAD_INIT, -+ "client_intf", -+ NULL, -+ -1, -+ ClientMethods, -+ NULL, -+ NULL, -+ NULL, -+ NULL -+}; -+ -+PyMODINIT_FUNC -+PyInit_client_intf(void) -+{ -+ return PyModule_Create(&ClientModuleDef); -+} -+#else - PyMODINIT_FUNC - initclient_intf(void) - { - (void) Py_InitModule("client_intf", ClientMethods); - } -- -- -- -- -- -+#endif diff --git a/net-snmp.changes b/net-snmp.changes index 41ed352..1ceffde 100644 --- a/net-snmp.changes +++ b/net-snmp.changes @@ -1,3 +1,45 @@ +------------------------------------------------------------------- +Wed Oct 10 20:22:35 UTC 2018 - abergmann@suse.com + +- Update to net-snmp-5.8. + Fixes included: + * Fix remote DoS in agent/helpers/table.c (bsc#1111122, CVE-2018-18065) + * Fix agentx freezing on timeout (bsc#1027353) + * swintst_rpm: Protect against unspecified Group name (bsc#1102775) +- Add tsm and tlstm MIBs and the USM security module. (bsc#1081164) +- Rename and refactor patches and remove those that are already included + inside the new version. + Added: + * net-snmp-5.8-socket-path.patch + * net-snmp-5.8-testing-empty-arptable.patch + * net-snmp-5.8-pie.patch + * net-snmp-5.8-net-snmp-config-headercheck.patch + * net-snmp-5.8-perl-tk-warning.patch + * net-snmp-5.8-velocity-mib.patch + * net-snmp-5.8-netgroups.patch + * net-snmp-5.8-snmpstatus-suppress-output.patch + * net-snmp-5.8-fix-Makefile.PL.patch + * net-snmp-5.8-modern-rpm-api.patch + * net-snmp-5.8-fix-python3.patch + Removed: + * net-snmp-5.7.3-socket-path.patch + * net-snmp-5.7.3-testing-empty-arptable.patch + * net-snmp-5.7.3-pie.patch + * net-snmp-5.7.3-net-snmp-config-headercheck.patch + * net-snmp-5.7.3-perl-tk-warning.patch + * net-snmp-5.7.3-velocity-mib.patch + * net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch + * net-snmp-5.7.3-netgroups.patch + * net-snmp-5.7.3-snmpstatus-suppress-output.patch + * net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch + * net-snmp-5.7.3-Remove-U64-typedef.patch + * net-snmp-5.7.3-Fix-Makefile.PL.patch + * net-snmp-5.7.3-build-with-openssl-1.1.patch + * net-snmp-5.7.3-modern-rpm-api.patch + * net-snmp-python3.patch + * net-snmp-5.7.2-systemd.patch + * net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch + ------------------------------------------------------------------- Mon Oct 8 23:44:37 UTC 2018 - abergmann@suse.com diff --git a/net-snmp.spec b/net-snmp.spec index 0e3d65c..876fa4a 100644 --- a/net-snmp.spec +++ b/net-snmp.spec @@ -30,7 +30,7 @@ %define libname libsnmp30 %bcond_without python2 Name: net-snmp -Version: 5.7.3 +Version: 5.8 Release: 0 Summary: SNMP Daemon License: BSD-3-Clause AND MIT @@ -48,23 +48,17 @@ Source11: snmptrapd.sysconfig Source20: net-snmp-tmpfs.conf Source98: net-snmp-rpmlintrc Source99: baselibs.conf -Patch1: net-snmp-5.7.3-socket-path.patch -Patch2: net-snmp-5.7.3-testing-empty-arptable.patch -Patch3: net-snmp-5.7.3-pie.patch -Patch4: net-snmp-5.7.3-net-snmp-config-headercheck.patch -Patch5: net-snmp-5.7.3-perl-tk-warning.patch -Patch6: net-snmp-5.7.3-velocity-mib.patch -Patch7: net-snmp-5.7.3-fix-snmpd-crashing-when-an-agentx-disconnects.patch -Patch8: net-snmp-5.7.3-netgroups.patch -Patch9: net-snmp-5.7.3-snmpstatus-suppress-output.patch -Patch10: net-snmp-5.7.3-fix-snmp_pdu_parse-incomplete.patch -Patch11: net-snmp-5.7.3-Remove-U64-typedef.patch -Patch12: net-snmp-5.7.3-Fix-Makefile.PL.patch -Patch13: net-snmp-5.7.3-build-with-openssl-1.1.patch -Patch14: net-snmp-5.7.3-modern-rpm-api.patch -Patch15: net-snmp-python3.patch -Patch16: net-snmp-5.7.2-systemd.patch -Patch17: net-snmp-5.7.3-helpers-table-skip-if-next-handler-called.patch +Patch1: net-snmp-5.8-socket-path.patch +Patch2: net-snmp-5.8-testing-empty-arptable.patch +Patch3: net-snmp-5.8-pie.patch +Patch4: net-snmp-5.8-net-snmp-config-headercheck.patch +Patch5: net-snmp-5.8-perl-tk-warning.patch +Patch6: net-snmp-5.8-velocity-mib.patch +Patch7: net-snmp-5.8-netgroups.patch +Patch8: net-snmp-5.8-snmpstatus-suppress-output.patch +Patch9: net-snmp-5.8-fix-Makefile.PL.patch +Patch10: net-snmp-5.8-modern-rpm-api.patch +Patch11: net-snmp-5.8-fix-python3.patch BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} BuildRequires: autoconf @@ -215,7 +209,8 @@ Net-SNMP toolkit library. MIBS="misc/ipfwacc ucd-snmp/diskio etherlike-mib rmon-mib velocity smux \ ip-mib/ipv4InterfaceTable ip-mib/ipv6InterfaceTable \ ip-mib/ipDefaultRouterTable ip-mib/ipAddressPrefixTable \ - ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable" + ip-mib/ipv6ScopeZoneIndexTable ip-mib/ipIfStatsTable \ + tsm-mib tlstm-mib" %if 0%{?netsnmp_with_sensors} MIBS="$MIBS ucd-snmp/lmsensorsMib" @@ -242,7 +237,7 @@ autoreconf -fvi --enable-local-smux \ --enable-ipv6 \ --enable-ucd-snmp-compatibility \ - --with-security-modules=tsm \ + --with-security-modules=tsm,usm \ --with-transports=TLSTCP,DTLSUDP \ --with-systemd @@ -345,6 +340,10 @@ find %{buildroot} -type f -name "*.la" -delete -print %{_bindir}/net-snmp-cert %{_bindir}/agentxtrap %{_bindir}/snmp-bridge-mib +%{_bindir}/checkbandwidth +%{_bindir}/snmpping +%{_bindir}/snmpps +%{_bindir}/snmptop %dir %{_libexecdir}/net-snmp %dir %{_libexecdir}/net-snmp/agents %{_mandir}/man[158]/* @@ -383,7 +382,7 @@ find %{buildroot} -type f -name "*.la" -delete -print %files -n perl-SNMP %{perl_vendorarch}/auto/SNMP %{perl_vendorarch}/auto/NetSNMP -%{perl_vendorarch}/auto/Bundle +%{perl_vendorarch}/Bundle %{perl_vendorarch}/SNMP.pm %{perl_vendorarch}/NetSNMP %{_bindir}/tkmib