*net-snmp: update to 5.9.4

*5.9.4*:

    IMPORTANT: SNMP over TLS and/or DTLS are not functioning properly
    in this release with various versions of OpenSSL and will be fixed
    in a future release.

    libsnmp:
      - Remove the SNMP_SWIPE_MEM() macro Remove this macro since it is not
	used in the Net-SNMP code base.
      - DISPLAY-HINT fixes
      - Miscellanious improvements to the transports
      - Handle multiple oldEngineID configuration lines
      - fixes for DNS names longer than 63 characters

    agent:
      - Added a ignoremount configuration option for the HOST-MIB
      - disallow SETs with a NULL varbind
      - fix the --enable-minimalist build

    apps:
      - snmpset: allow SET with NULL varbind for testing
      - snmptrapd: improved MySQL logging code

    general:
      - configure: Remove -Wno-deprecated as it is no longer needed
      - miscellanious ther bug fixes, build fixes and cleanups
This commit is contained in:
wiz 2024-02-21 10:21:00 +00:00
parent bcf71d90d5
commit 40bd5da41d
20 changed files with 56 additions and 1104 deletions

View File

@ -1,6 +1,5 @@
# $NetBSD: Makefile,v 1.142 2023/10/24 22:10:26 wiz Exp $
# $NetBSD: Makefile,v 1.143 2024/02/21 10:21:00 wiz Exp $
PKGREVISION= 2
.include "Makefile.common"
CATEGORIES= net
@ -14,7 +13,8 @@ USE_LIBTOOL= yes
GNU_CONFIGURE= yes
MAKE_ENV+= OPSYS=${OPSYS}
MAKE_JOBS_SAFE= no
CHECK_WRKREF_SKIP+= bin/net-snmp-config
.include "../../mk/bsd.prefs.mk"
@ -74,10 +74,10 @@ CONFIGURE_ARGS+= --with-mib-modules="smux host ucd-snmp/diskio"
.else
CONFIGURE_ARGS+= --with-mib-modules="smux host"
.endif
.if !empty(MACHINE_PLATFORM:MDarwin-[567].*)
.if ${MACHINE_PLATFORM:MDarwin-[567].*}
CONFIGURE_ARGS+= --with-out-mib-modules="ucd-snmp/diskio mibII"
.endif
.if !empty(MACHINE_PLATFORM:MDarwin-9.*)
.if ${MACHINE_PLATFORM:MDarwin-9.*}
CONFIGURE_ARGS+= --with-mib-modules="host ucd-snmp/diskio"
CONFIGURE_ARGS+= --with-out-mib-modules="mibII/icmp host/hr_swrun"
CONFIGURE_ARGS+= --enable-as-needed
@ -108,17 +108,13 @@ USE_TOOLS+= sh:run
INSTALLATION_DIRS+= share/examples/net-snmp
BUILD_DEFS+= VARBASE
post-extract:
.if ${OPSYS} == "DragonFly"
${CP} ${FILESDIR}/cpu_dragonfly.c ${WRKSRC}/agent/mibgroup/hardware/cpu/cpu_nlist.c
.endif
post-wrapper:
.if !empty(MACHINE_PLATFORM:MNetBSD-1.5.[123]*-i386)
mkdir ${BUILDLINK_DIR}/include/sys
cp ${FILESDIR}/disklabel.h ${BUILDLINK_DIR}/include/sys
.endif
post-install:
${INSTALL_DATA} ${WRKSRC}/EXAMPLE.conf \
${DESTDIR}${PREFIX}/share/examples/net-snmp/EXAMPLE.conf

View File

@ -1,8 +1,8 @@
# $NetBSD: Makefile.common,v 1.7 2022/10/18 12:01:52 adam Exp $
# $NetBSD: Makefile.common,v 1.8 2024/02/21 10:21:00 wiz Exp $
# used by net/net-snmp/Makefile
# used by net/py-netsnmp/Makefile
DISTNAME= net-snmp-5.9.3
DISTNAME= net-snmp-5.9.4
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE:=net-snmp/}
HOMEPAGE= http://www.net-snmp.org/

View File

@ -1,4 +1,4 @@
@comment $NetBSD: PLIST,v 1.30 2022/10/18 12:01:52 adam Exp $
@comment $NetBSD: PLIST,v 1.31 2024/02/21 10:21:00 wiz Exp $
bin/agentxtrap
${PLIST.perl}bin/checkbandwidth
bin/encode_keychange
@ -122,7 +122,6 @@ include/net-snmp/library/snmp-tc.h
include/net-snmp/library/snmp.h
include/net-snmp/library/snmpAliasDomain.h
include/net-snmp/library/snmpCallbackDomain.h
include/net-snmp/library/snmpIPBaseDomain.h
include/net-snmp/library/snmpIPv4BaseDomain.h
${PLIST.inet6}include/net-snmp/library/snmpIPv6BaseDomain.h
include/net-snmp/library/snmpSocketBaseDomain.h

View File

@ -1,4 +1,4 @@
# $NetBSD: buildlink3.mk,v 1.19 2023/10/24 22:10:26 wiz Exp $
# $NetBSD: buildlink3.mk,v 1.20 2024/02/21 10:21:00 wiz Exp $
BUILDLINK_TREE+= net-snmp
@ -12,7 +12,7 @@ BUILDLINK_PKGSRCDIR.net-snmp?= ../../net/net-snmp
pkgbase := net-snmp
.include "../../mk/pkg-build-options.mk"
.if !empty(PKG_BUILD_OPTIONS.net-snmp:Mssl)
.if ${PKG_BUILD_OPTIONS.net-snmp:Mssl}
. include "../../security/openssl/buildlink3.mk"
.endif

View File

@ -1,4 +1,4 @@
# $NetBSD: builtin.mk,v 1.4 2024/01/13 20:07:34 riastradh Exp $
# $NetBSD: builtin.mk,v 1.5 2024/02/21 10:21:00 wiz Exp $
BUILTIN_PKG:= net-snmp
@ -24,7 +24,7 @@ MAKEVARS+= IS_BUILTIN.net-snmp
### a package name to represent the built-in package.
###
.if !defined(BUILTIN_PKG.net-snmp) && \
!empty(IS_BUILTIN.net-snmp:M[yY][eE][sS]) && \
${IS_BUILTIN.net-snmp:tl} == yes && \
empty(H_NETSNMP:M__nonexistent__)
BUILTIN_VERSION.net-snmp!= \
${AWK} '/\#define[ ]*PACKAGE_VERSION/ { \
@ -47,10 +47,10 @@ USE_BUILTIN.net-snmp= no
. else
USE_BUILTIN.net-snmp= ${IS_BUILTIN.net-snmp}
. if defined(BUILTIN_PKG.net-snmp) && \
!empty(IS_BUILTIN.net-snmp:M[yY][eE][sS])
${IS_BUILTIN.net-snmp:tl} == yes
USE_BUILTIN.net-snmp= yes
. for _dep_ in ${BUILDLINK_API_DEPENDS.net-snmp}
. if !empty(USE_BUILTIN.net-snmp:M[yY][eE][sS])
. if ${USE_BUILTIN.net-snmp:tl} == yes
USE_BUILTIN.net-snmp!= \
if ${PKG_ADMIN} pmatch ${_dep_:Q} ${BUILTIN_PKG.net-snmp}; then \
${ECHO} yes; \

View File

@ -1,31 +1,24 @@
$NetBSD: distinfo,v 1.102 2023/01/14 21:11:35 mrg Exp $
$NetBSD: distinfo,v 1.103 2024/02/21 10:21:00 wiz Exp $
BLAKE2s (net-snmp-5.9.3.tar.gz) = c5f3e30c73294c0f8b7db2a776a0a28e6f63ed1d55f32acb4328fbbb277cbe4a
SHA512 (net-snmp-5.9.3.tar.gz) = a476df4967029a2eb03d27b0e250170785d0a8c143d49b900ee958c3cbdfaccd415b70af40f6fbed9cb8819d522c35a6073a431091d908ccc7c018fa0aaa2abc
Size (net-snmp-5.9.3.tar.gz) = 6646950 bytes
BLAKE2s (net-snmp-5.9.4.tar.gz) = 44b2e38afb93da994d7d90f342a9971c266f710e232c84206e204bb9a1266fe6
SHA512 (net-snmp-5.9.4.tar.gz) = a510fa91a21e9ddc86a12fd1d0bc6b356e63f3ea53f184d2e31439004d41d902390664134dc40b3b828eabb4282eaf3da628a07c4d480fa00eff7e700950c423
Size (net-snmp-5.9.4.tar.gz) = 6681606 bytes
SHA1 (patch-agent_auto__nlist.c) = a8fe703d8902c2847ca6692af4400ddbf9cbe74b
SHA1 (patch-agent_mibgroup_hardware_cpu_cpu__sysctl.c) = 22fd0b95e06117fd8f59bd0112b2c91e40d61e70
SHA1 (patch-agent_mibgroup_hardware_memory_memory__freebsd.c) = 51d2c7e11b3d422e57ea2f5761aff624f7333842
SHA1 (patch-agent_mibgroup_hardware_memory_memory__netbsd.c) = 928a5aa99e7893ee91dea3110db8098212e328fa
SHA1 (patch-agent_mibgroup_host_data__access_swrun__kinfo.c) = f983ae0d99d85ab1ac6dc7cf2d2c0415b6935258
SHA1 (patch-agent_mibgroup_host_hr__storage.c) = d9595eceeb5ee986ab4365f62e3c3ab339e605aa
SHA1 (patch-agent_mibgroup_host_hr__swrun.c) = d01e8a93f6e766cedfdc324efd69168f71aac76f
SHA1 (patch-agent_mibgroup_if-mib_data__access_interface.h) = f888d65ec32020dc75d60d5d67ec54614d934489
SHA1 (patch-agent_mibgroup_if-mib_data__access_interface.h) = 839003d31a74db7ea71774da0f8c80748c3fc7d3
SHA1 (patch-agent_mibgroup_kernel__sunos5.c) = e1cfb194ec2ef784ae8bdf1ff3537edc9b30b66c
SHA1 (patch-agent_mibgroup_kernel__sunos5.h) = eb80eb5e55020014b1e5524fd572839aefdce5a5
SHA1 (patch-agent_mibgroup_mibII_icmp.c) = 50ac67db8a9ffc16d983b4192e74db25ef439321
SHA1 (patch-agent_mibgroup_mibII_interfaces.c) = 44a4ce6302457094ba2b200e4c47ff6c2a425746
SHA1 (patch-agent_mibgroup_mibII_ip.c) = 04c2a487bad8705c9725ef4a62016051d3898970
SHA1 (patch-agent_mibgroup_mibII_ipAddr.c) = cd3345a4b30fe2280d0555ee38feb5f957a55b1e
SHA1 (patch-agent_mibgroup_mibII_ipv6.c) = f1e99ab8b5d5f31660112b85d863cc9ff90e0fdb
SHA1 (patch-agent_mibgroup_mibII_tcp.c) = 92563fd6be6f27be5b348cdc8bc02061374026b0
SHA1 (patch-agent_mibgroup_mibII_tcpTable.c) = 7996885e155e8283c41c842f1e5d92d27ea8d8ae
SHA1 (patch-agent_mibgroup_mibII_udp.c) = d110e996d0538d17251d39a5eed46df6944ba0fa
SHA1 (patch-agent_mibgroup_mibII_udpTable.c) = 21505245b5c5f159e3eff616ffb639ae180d8362
SHA1 (patch-agent_mibgroup_mibII_var__route.c) = 919348e62849367793e4abf7d608d9824eb8ff2d
SHA1 (patch-agent_mibgroup_ucd-snmp_memory__netbsd1.c) = 7336d905bac315f344f93664e4118332f88fb6ee
SHA1 (patch-agent_snmp__perl.c) = 893cf46624d4f26941b3911a64c752c110ba6ef8
SHA1 (patch-configure) = 26012c2d7e22b01db3ab3a6d7d959645185065bb
SHA1 (patch-agent_mibgroup_mibII_tcp.c) = fb065ad10b375b47608a12cf81f29fd473e6fba1
SHA1 (patch-agent_mibgroup_mibII_var__route.c) = 6050099b8c060f857ec7d05409bc077db21bd650
SHA1 (patch-agent_snmp__perl.c) = 52b7b26ce8cae6d892b017c50831565fc138a337
SHA1 (patch-configure) = a6447c8291638d7a3575f53b2f25442ce4d7e487
SHA1 (patch-ov_UCD-fields) = 40e8d78bad93ca12f4c08c43b86e7f13edafc299
SHA1 (patch-ov_oid__to__type.in) = 281be9a88860987880c71770f4050fd965dd8ed9
SHA1 (patch-perl_OID_OID.xs) = b23d7ae82d367d457181d231a56c80e648b0ee6e

View File

@ -1,493 +0,0 @@
/* $NetBSD: disklabel.h,v 1.1.1.1 2002/10/24 08:29:34 jlam Exp $ */
/* */
/* NetBSD: disklabel.h,v 1.60.4.4 2002/01/29 22:16:37 he Exp */
/*
* Copyright (c) 1987, 1988, 1993
* The Regents of the University of California. All rights reserved.
*
* Redistribution and use in source and binary forms, with or without
* modification, are permitted provided that the following conditions
* are met:
* 1. Redistributions of source code must retain the above copyright
* notice, this list of conditions and the following disclaimer.
* 2. Redistributions in binary form must reproduce the above copyright
* notice, this list of conditions and the following disclaimer in the
* documentation and/or other materials provided with the distribution.
* 3. All advertising materials mentioning features or use of this software
* must display the following acknowledgement:
* This product includes software developed by the University of
* California, Berkeley and its contributors.
* 4. Neither the name of the University nor the names of its contributors
* may be used to endorse or promote products derived from this software
* without specific prior written permission.
*
* THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
* IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
* ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
* OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
* HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
* @(#)disklabel.h 8.2 (Berkeley) 7/10/94
*/
#ifndef _SYS_DISKLABEL_H_
#define _SYS_DISKLABEL_H_
/*
* We need <machine/types.h> for __HAVE_OLD_DISKLABEL
*/
#ifndef _LOCORE
#include <sys/types.h>
#endif
/*
* Each disk has a label which includes information about the hardware
* disk geometry, filesystem partitions, and drive specific information.
* The location of the label, as well as the number of partitions the
* label can describe and the number of the "whole disk" (raw)
* paritition are machine dependent.
*/
#include <machine/disklabel.h>
/*
* The absolute maximum number of disk partitions allowed.
* This is the maximum value of MAXPARTITIONS for which 'struct disklabel'
* is <= DEV_BSIZE bytes long. If MAXPARTITIONS is greater than this, beware.
*/
#define MAXMAXPARTITIONS 22
#if MAXPARTITIONS > MAXMAXPARTITIONS
#warning beware: MAXPARTITIONS bigger than MAXMAXPARTITIONS
#endif
/*
* Ports can switch their MAXPARTITIONS once, as follows:
*
* - define OLDMAXPARTITIONS in <machine/disklabel.h> as the old number
* - define MAXPARTITIONS as the new number
* - define DISKUNIT, DISKPART and DISKMINOR macros in <machine/disklabel.h>
* as appropriate for the port (see the i386 one for an example).
* - define __HAVE_OLD_DISKLABEL in <machine/types.h>
*/
#if defined(_KERNEL) && defined(__HAVE_OLD_DISKLABEL) && \
(MAXPARTITIONS < OLDMAXPARTITIONS)
#error "can only grow disklabel size"
#endif
/*
* Translate between device numbers and major/disk unit/disk partition.
*/
#ifndef __HAVE_OLD_DISKLABEL
#define DISKUNIT(dev) (minor(dev) / MAXPARTITIONS)
#define DISKPART(dev) (minor(dev) % MAXPARTITIONS)
#define DISKMINOR(unit, part) \
(((unit) * MAXPARTITIONS) + (part))
#endif
#define MAKEDISKDEV(maj, unit, part) \
(makedev((maj), DISKMINOR((unit), (part))))
#define DISKMAGIC ((u_int32_t)0x82564557) /* The disk magic number */
#ifndef _LOCORE
struct disklabel {
u_int32_t d_magic; /* the magic number */
u_int16_t d_type; /* drive type */
u_int16_t d_subtype; /* controller/d_type specific */
char d_typename[16]; /* type name, e.g. "eagle" */
/*
* d_packname contains the pack identifier and is returned when
* the disklabel is read off the disk or in-core copy.
* d_boot0 and d_boot1 are the (optional) names of the
* primary (block 0) and secondary (block 1-15) bootstraps
* as found in /usr/mdec. These are returned when using
* getdiskbyname(3) to retrieve the values from /etc/disktab.
*/
union {
char un_d_packname[16]; /* pack identifier */
struct {
char *un_d_boot0; /* primary bootstrap name */
char *un_d_boot1; /* secondary bootstrap name */
} un_b;
} d_un;
#define d_packname d_un.un_d_packname
#define d_boot0 d_un.un_b.un_d_boot0
#define d_boot1 d_un.un_b.un_d_boot1
/* disk geometry: */
u_int32_t d_secsize; /* # of bytes per sector */
u_int32_t d_nsectors; /* # of data sectors per track */
u_int32_t d_ntracks; /* # of tracks per cylinder */
u_int32_t d_ncylinders; /* # of data cylinders per unit */
u_int32_t d_secpercyl; /* # of data sectors per cylinder */
u_int32_t d_secperunit; /* # of data sectors per unit */
/*
* Spares (bad sector replacements) below are not counted in
* d_nsectors or d_secpercyl. Spare sectors are assumed to
* be physical sectors which occupy space at the end of each
* track and/or cylinder.
*/
u_int16_t d_sparespertrack; /* # of spare sectors per track */
u_int16_t d_sparespercyl; /* # of spare sectors per cylinder */
/*
* Alternative cylinders include maintenance, replacement,
* configuration description areas, etc.
*/
u_int32_t d_acylinders; /* # of alt. cylinders per unit */
/* hardware characteristics: */
/*
* d_interleave, d_trackskew and d_cylskew describe perturbations
* in the media format used to compensate for a slow controller.
* Interleave is physical sector interleave, set up by the
* formatter or controller when formatting. When interleaving is
* in use, logically adjacent sectors are not physically
* contiguous, but instead are separated by some number of
* sectors. It is specified as the ratio of physical sectors
* traversed per logical sector. Thus an interleave of 1:1
* implies contiguous layout, while 2:1 implies that logical
* sector 0 is separated by one sector from logical sector 1.
* d_trackskew is the offset of sector 0 on track N relative to
* sector 0 on track N-1 on the same cylinder. Finally, d_cylskew
* is the offset of sector 0 on cylinder N relative to sector 0
* on cylinder N-1.
*/
u_int16_t d_rpm; /* rotational speed */
u_int16_t d_interleave; /* hardware sector interleave */
u_int16_t d_trackskew; /* sector 0 skew, per track */
u_int16_t d_cylskew; /* sector 0 skew, per cylinder */
u_int32_t d_headswitch; /* head switch time, usec */
u_int32_t d_trkseek; /* track-to-track seek, usec */
u_int32_t d_flags; /* generic flags */
#define NDDATA 5
u_int32_t d_drivedata[NDDATA]; /* drive-type specific information */
#define NSPARE 5
u_int32_t d_spare[NSPARE]; /* reserved for future use */
u_int32_t d_magic2; /* the magic number (again) */
u_int16_t d_checksum; /* xor of data incl. partitions */
/* filesystem and partition information: */
u_int16_t d_npartitions; /* number of partitions in following */
u_int32_t d_bbsize; /* size of boot area at sn0, bytes */
u_int32_t d_sbsize; /* max size of fs superblock, bytes */
struct partition { /* the partition table */
u_int32_t p_size; /* number of sectors in partition */
u_int32_t p_offset; /* starting sector */
u_int32_t p_fsize; /* filesystem basic fragment size */
u_int8_t p_fstype; /* filesystem type, see below */
u_int8_t p_frag; /* filesystem fragments per block */
union {
u_int16_t cpg; /* UFS: FS cylinders per group */
u_int16_t sgs; /* LFS: FS segment shift */
} __partition_u1;
#define p_cpg __partition_u1.cpg
#define p_sgs __partition_u1.sgs
} d_partitions[MAXPARTITIONS]; /* actually may be more */
};
#ifdef __HAVE_OLD_DISKLABEL
/*
* Same as above, but with OLDMAXPARTITIONS partitions. For use in
* the old DIOC* ioctl calls.
*/
struct olddisklabel {
u_int32_t d_magic;
u_int16_t d_type;
u_int16_t d_subtype;
char d_typename[16];
union {
char un_d_packname[16];
struct {
char *un_d_boot0;
char *un_d_boot1;
} un_b;
} d_un;
u_int32_t d_secsize;
u_int32_t d_nsectors;
u_int32_t d_ntracks;
u_int32_t d_ncylinders;
u_int32_t d_secpercyl;
u_int32_t d_secperunit;
u_int16_t d_sparespertrack;
u_int16_t d_sparespercyl;
u_int32_t d_acylinders;
u_int16_t d_rpm;
u_int16_t d_interleave;
u_int16_t d_trackskew;
u_int16_t d_cylskew;
u_int32_t d_headswitch;
u_int32_t d_trkseek;
u_int32_t d_flags;
u_int32_t d_drivedata[NDDATA];
u_int32_t d_spare[NSPARE];
u_int32_t d_magic2;
u_int16_t d_checksum;
u_int16_t d_npartitions;
u_int32_t d_bbsize;
u_int32_t d_sbsize;
struct opartition {
u_int32_t p_size;
u_int32_t p_offset;
u_int32_t p_fsize;
u_int8_t p_fstype;
u_int8_t p_frag;
union {
u_int16_t cpg;
u_int16_t sgs;
} __partition_u1;
} d_partitions[OLDMAXPARTITIONS];
};
#endif /* __HAVE_OLD_DISKLABEL */
#else /* _LOCORE */
/*
* offsets for asm boot files.
*/
.set d_secsize,40
.set d_nsectors,44
.set d_ntracks,48
.set d_ncylinders,52
.set d_secpercyl,56
.set d_secperunit,60
.set d_end_,276 /* size of disk label */
#endif /* _LOCORE */
/* d_type values: */
#define DTYPE_SMD 1 /* SMD, XSMD; VAX hp/up */
#define DTYPE_MSCP 2 /* MSCP */
#define DTYPE_DEC 3 /* other DEC (rk, rl) */
#define DTYPE_SCSI 4 /* SCSI */
#define DTYPE_ESDI 5 /* ESDI interface */
#define DTYPE_ST506 6 /* ST506 etc. */
#define DTYPE_HPIB 7 /* CS/80 on HP-IB */
#define DTYPE_HPFL 8 /* HP Fiber-link */
#define DTYPE_FLOPPY 10 /* floppy */
#define DTYPE_CCD 11 /* concatenated disk device */
#define DTYPE_VND 12 /* vnode pseudo-disk */
#define DTYPE_ATAPI 13 /* ATAPI */
#define DTYPE_RAID 14 /* RAIDframe */
#define DTYPE_LD 15 /* logical disk */
#ifdef DKTYPENAMES
static const char *const dktypenames[] = {
"unknown",
"SMD",
"MSCP",
"old DEC",
"SCSI",
"ESDI",
"ST506",
"HP-IB",
"HP-FL",
"type 9",
"floppy",
"ccd",
"vnd",
"ATAPI",
"RAID",
"ld",
NULL
};
#define DKMAXTYPES (sizeof(dktypenames) / sizeof(dktypenames[0]) - 1)
#endif
/*
* Filesystem type and version.
* Used to interpret other filesystem-specific
* per-partition information.
*/
#define FS_UNUSED 0 /* unused */
#define FS_SWAP 1 /* swap */
#define FS_V6 2 /* Sixth Edition */
#define FS_V7 3 /* Seventh Edition */
#define FS_SYSV 4 /* System V */
#define FS_V71K 5 /* V7 with 1K blocks (4.1, 2.9) */
#define FS_V8 6 /* Eighth Edition, 4K blocks */
#define FS_BSDFFS 7 /* 4.2BSD fast file system */
#define FS_MSDOS 8 /* MSDOS file system */
#define FS_BSDLFS 9 /* 4.4BSD log-structured file system */
#define FS_OTHER 10 /* in use, but unknown/unsupported */
#define FS_HPFS 11 /* OS/2 high-performance file system */
#define FS_ISO9660 12 /* ISO 9660, normally CD-ROM */
#define FS_BOOT 13 /* partition contains bootstrap */
#define FS_ADOS 14 /* AmigaDOS fast file system */
#define FS_HFS 15 /* Macintosh HFS */
#define FS_FILECORE 16 /* Acorn Filecore Filing System */
#define FS_EX2FS 17 /* Linux Extended 2 file system */
#define FS_NTFS 18 /* Windows/NT file system */
#define FS_RAID 19 /* RAIDframe component */
#define FS_CCD 20 /* concatenated disk component */
#ifdef FSTYPENAMES
static const char *const fstypenames[] = {
"unused",
"swap",
"Version 6",
"Version 7",
"System V",
"4.1BSD",
"Eighth Edition",
"4.2BSD",
"MSDOS",
"4.4LFS",
"unknown",
"HPFS",
"ISO9660",
"boot",
"ADOS",
"HFS",
"FILECORE",
"Linux Ext2",
"NTFS",
"RAID",
"ccd",
NULL
};
#define FSMAXTYPES (sizeof(fstypenames) / sizeof(fstypenames[0]) - 1)
#endif
#ifdef FSCKNAMES
/* These are the names MOUNT_XXX from <sys/mount.h> */
static const char *const fscknames[] = {
NULL, /* unused */
NULL, /* swap */
NULL, /* Version 6 */
NULL, /* Version 7 */
NULL, /* System V */
NULL, /* 4.1BSD */
NULL, /* Eighth edition */
"ffs", /* 4.2BSD */
"msdos", /* MSDOS */
"lfs", /* 4.4LFS */
NULL, /* unknown */
NULL, /* HPFS */
NULL, /* ISO9660 */
NULL, /* boot */
NULL, /* ADOS */
NULL, /* HFS */
NULL, /* FILECORE */
"ext2fs", /* Linux Ext2 */
NULL, /* Windows/NT */
NULL, /* RAID Component */
NULL, /* concatenated disk component */
NULL /* NULL */
};
#define FSMAXNAMES (sizeof(fscknames) / sizeof(fscknames[0]) - 1)
#endif
#ifdef MOUNTNAMES
/* These are the names MOUNT_XXX from <sys/mount.h> */
static const char *const mountnames[] = {
NULL, /* unused */
NULL, /* swap */
NULL, /* Version 6 */
NULL, /* Version 7 */
NULL, /* System V */
NULL, /* 4.1BSD */
NULL, /* Eighth edition */
"ffs", /* 4.2BSD */
"msdos", /* MSDOS */
"lfs", /* 4.4LFS */
NULL, /* unknown */
NULL, /* HPFS */
"cd9660", /* ISO9660 */
NULL, /* boot */
"ados", /* ADOS */
NULL, /* HFS */
"filecore", /* FILECORE */
"ext2fs", /* Linux Ext2 */
"ntfs", /* Windows/NT */
NULL, /* RAID Component */
NULL, /* concatenated disk component */
NULL /* NULL */
};
#define FSMAXMOUNTNAMES (sizeof(mountnames) / sizeof(mountnames[0]) - 1)
#endif
/*
* flags shared by various drives:
*/
#define D_REMOVABLE 0x01 /* removable media */
#define D_ECC 0x02 /* supports ECC */
#define D_BADSECT 0x04 /* supports bad sector forw. */
#define D_RAMDISK 0x08 /* disk emulator */
#define D_CHAIN 0x10 /* can do back-back transfers */
/*
* Drive data for SMD.
*/
#define d_smdflags d_drivedata[0]
#define D_SSE 0x1 /* supports skip sectoring */
#define d_mindist d_drivedata[1]
#define d_maxdist d_drivedata[2]
#define d_sdist d_drivedata[3]
/*
* Drive data for ST506.
*/
#define d_precompcyl d_drivedata[0]
#define d_gap3 d_drivedata[1] /* used only when formatting */
/*
* Drive data for SCSI.
*/
#define d_blind d_drivedata[0]
#ifndef _LOCORE
/*
* Structure used to perform a format or other raw operation,
* returning data and/or register values. Register identification
* and format are device- and driver-dependent.
*/
struct format_op {
char *df_buf;
int df_count; /* value-result */
daddr_t df_startblk;
int df_reg[8]; /* result */
};
/*
* Structure used internally to retrieve information about a partition
* on a disk.
*/
struct partinfo {
struct disklabel *disklab;
struct partition *part;
};
#ifdef _KERNEL
struct buf_queue;
void diskerr
__P((struct buf *, char *, char *, int, int, struct disklabel *));
void disksort_cylinder __P((struct buf_queue *, struct buf *));
void disksort_blkno __P((struct buf_queue *, struct buf *));
void disksort_tail __P((struct buf_queue *, struct buf *));
u_int dkcksum __P((struct disklabel *));
int setdisklabel __P((struct disklabel *, struct disklabel *, u_long,
struct cpu_disklabel *));
char *readdisklabel __P((dev_t, void (*)(struct buf *), struct disklabel *,
struct cpu_disklabel *));
int writedisklabel __P((dev_t, void (*)(struct buf *), struct disklabel *,
struct cpu_disklabel *));
int bounds_check_with_label __P((struct buf *, struct disklabel *, int));
#endif
#endif /* _LOCORE */
#if !defined(_KERNEL) && !defined(_LOCORE)
#include <sys/cdefs.h>
#endif
#endif /* !_SYS_DISKLABEL_H_ */

View File

@ -1,40 +0,0 @@
$NetBSD: patch-agent_mibgroup_host_hr__storage.c,v 1.1 2022/10/18 12:01:52 adam Exp $
--- agent/mibgroup/host/hr_storage.c.orig 2012-10-09 22:28:58.000000000 +0000
+++ agent/mibgroup/host/hr_storage.c
@@ -69,6 +69,13 @@
#endif
#endif /* vm/vm.h */
#endif /* sys/vm.h */
+#if HAVE_SYS_POOL_H
+#if defined(MBPOOL_SYMBOL) && defined(MCLPOOL_SYMBOL)
+#define __POOL_EXPOSE
+#include <sys/pool.h>
+#else
+#undef HAVE_SYS_POOL_H
+#endif
#if defined(HAVE_UVM_UVM_PARAM_H) && defined(HAVE_UVM_UVM_EXTERN_H)
#include <uvm/uvm_param.h>
#include <uvm/uvm_extern.h>
@@ -76,20 +83,13 @@
#include <vm/vm_param.h>
#include <vm/vm_extern.h>
#endif
+#endif
#if HAVE_KVM_H
#include <kvm.h>
#endif
#if HAVE_FCNTL_H
#include <fcntl.h>
#endif
-#if HAVE_SYS_POOL_H
-#if defined(MBPOOL_SYMBOL) && defined(MCLPOOL_SYMBOL)
-#define __POOL_EXPOSE
-#include <sys/pool.h>
-#else
-#undef HAVE_SYS_POOL_H
-#endif
-#endif
#if HAVE_SYS_MBUF_H
#include <sys/mbuf.h>
#endif

View File

@ -1,16 +1,16 @@
$NetBSD: patch-agent_mibgroup_if-mib_data__access_interface.h,v 1.1 2022/10/18 12:01:52 adam Exp $
$NetBSD: patch-agent_mibgroup_if-mib_data__access_interface.h,v 1.2 2024/02/21 10:21:01 wiz Exp $
Improve portability to newer NetBSD versions.
--- agent/mibgroup/if-mib/data_access/interface.h.orig 2022-07-13 21:14:14.000000000 +0000
--- agent/mibgroup/if-mib/data_access/interface.h.orig 2023-08-15 20:32:01.000000000 +0000
+++ agent/mibgroup/if-mib/data_access/interface.h
@@ -34,7 +34,8 @@ config_require(if-mib/data_access/interf
config_require(if-mib/data_access/interface_ioctl)
config_require(if-mib/data_access/interface_ioctl);
#elif defined( openbsd3 ) || \
defined( freebsd4 ) || defined( freebsd5 ) || defined( freebsd6 ) || \
- defined( darwin ) || defined( dragonfly ) || defined( netbsd1 )
+ defined( darwin ) || defined( dragonfly ) || defined( netbsd1 ) || \
+ defined(netbsd) || defined(netbsdelf) || defined(netbsdelf2) || defined(netbsdelf3)
config_require(if-mib/data_access/interface_sysctl)
config_require(if-mib/data_access/interface_sysctl);
#elif defined(solaris2)
config_require(if-mib/data_access/interface_solaris2)
config_require(if-mib/data_access/interface_solaris2);

View File

@ -1,38 +0,0 @@
$NetBSD: patch-agent_mibgroup_mibII_interfaces.c,v 1.1 2022/10/18 12:01:52 adam Exp $
Some systems define ifnet.if_lastchange as struct timespec (with a
tv_nsec field measured in nanoseconds), while other systems define it
as struct timeval (with a tv_usec field measured in microseconds).
Both variants have a tv_sec field for integer seconds.
--- agent/mibgroup/mibII/interfaces.c.orig 2012-10-09 22:28:58.000000000 +0000
+++ agent/mibgroup/mibII/interfaces.c
@@ -871,15 +871,25 @@ var_ifEntry(struct variable *vp,
* * this is fixed, thus the 199607 comparison.
*/
if (ifnet.if_lastchange.tv_sec == 0 &&
- ifnet.if_lastchange.tv_usec == 0)
+#if HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_NSEC
+ ifnet.if_lastchange.tv_nsec == 0
+#else
+ ifnet.if_lastchange.tv_usec == 0
+#endif
+ )
long_return = 0;
else if (ifnet.if_lastchange.tv_sec < starttime.tv_sec)
long_return = 0;
else {
long_return = (u_long)
((ifnet.if_lastchange.tv_sec - starttime.tv_sec) * 100
- + (ifnet.if_lastchange.tv_usec -
- starttime.tv_usec) / 10000);
+ + (
+#if HAVE_STRUCT_IFNET_IF_LASTCHANGE_TV_NSEC
+ ifnet.if_lastchange.tv_nsec / 1000
+#else
+ ifnet.if_lastchange.tv_usec
+#endif
+ - starttime.tv_usec) / 10000);
}
#else
#if NETSNMP_NO_DUMMY_VALUES

View File

@ -1,145 +0,0 @@
$NetBSD: patch-agent_mibgroup_mibII_ipv6.c,v 1.3 2023/01/13 23:14:31 gutteridge Exp $
Account for pcb struct changes as of NetBSD 9.99.104.
--- agent/mibgroup/mibII/ipv6.c.orig 2022-07-13 21:14:14.000000000 +0000
+++ agent/mibgroup/mibII/ipv6.c
@@ -176,7 +176,7 @@
netsnmp_feature_require(linux_read_ip6_stat);
-#if defined(netbsd1) && !defined(openbsd4)
+#if defined(netbsd1) && !defined(openbsd4) && __NetBSD_Version__ < 999010400
#define inp_lport in6p_lport
#define inp_fport in6p_fport
#define inp_ppcb in6p_ppcb
@@ -1627,8 +1627,13 @@ var_udp6(register struct variable * vp,
}
#endif
#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+# if __NetBSD_Version__ < 999010400
if (in6pcb.in6p_af != AF_INET6)
goto skip;
+# else
+ if (in6pcb.in6p_pcb.inp_af != AF_INET6)
+ goto skip;
+# endif
#elif defined(INP_ISIPV6)
if (!INP_ISIPV6(&in6pcb))
goto skip;
@@ -1650,6 +1655,15 @@ var_udp6(register struct variable * vp,
ntohs(*(uint16_t *) &in6pcb.inp_laddr6.s6_addr[2]);
else
newname[j++] = 0;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_ip6.ip6_src.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_pcb.inp_lport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_ip6.ip6_src))
+ newname[j++] =
+ ntohs(*(uint16_t *) &in6pcb.in6p_ip6.ip6_src.s6_addr[2]);
+ else
+ newname[j++] = 0;
#else
for (i = 0; i < sizeof(struct in6_addr); i++)
newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
@@ -1693,6 +1707,9 @@ var_udp6(register struct variable * vp,
#elif defined(openbsd4)
p = (caddr_t)in6pcb.inp_queue.cqe_next;
if (p == first) break;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ p = (caddr_t)in6pcb.in6p_pcb.inp_queue.tqe_next;
+ if (p == first) break;
#elif defined(__NetBSD__) && __NetBSD_Version__ >= 700000001
p = (caddr_t)in6pcb.in6p_queue.tqe_next;
if (p == first) break;
@@ -1733,6 +1750,12 @@ var_udp6(register struct variable * vp,
ntohs(*(uint16_t *) & in6pcb.inp_laddr6.s6_addr[2]);
else
long_return = 0;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_ip6.ip6_src))
+ long_return =
+ ntohs(*(uint16_t *) & in6pcb.in6p_ip6.ip6_src.s6_addr[2]);
+ else
+ long_return = 0;
#else
if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_laddr))
long_return =
@@ -2204,8 +2227,13 @@ var_tcp6(register struct variable * vp,
}
#endif
#if defined(__NetBSD__) && __NetBSD_Version__ >= 106250000 /*1.6Y*/
+# if __NetBSD_Version__ < 999010400
if (in6pcb.in6p_af != AF_INET6)
+ goto skip;
+# else
+ if (in6pcb.in6p_pcb.inp_af != AF_INET6)
goto skip;
+# endif
#elif defined(INP_ISIPV6)
if (!INP_ISIPV6(&in6pcb))
goto skip;
@@ -2229,6 +2257,18 @@ var_tcp6(register struct variable * vp,
ntohs(*(uint16_t *) &in6pcb.inp_laddr6.s6_addr[2]);
else
newname[j++] = 0;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_ip6.ip6_src.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_pcb.inp_lport);
+ for (i = 0; i < sizeof(struct in6_addr); i++)
+ newname[j++] = in6pcb.in6p_ip6.ip6_dst.s6_addr[i];
+ newname[j++] = ntohs(in6pcb.in6p_pcb.inp_fport);
+ if (IN6_IS_ADDR_LINKLOCAL(&in6pcb.in6p_ip6.ip6_src))
+ newname[j++] =
+ ntohs(*(uint16_t *) &in6pcb.in6p_ip6.ip6_src.s6_addr[2]);
+ else
+ newname[j++] = 0;
#else
for (i = 0; i < sizeof(struct in6_addr); i++)
newname[j++] = in6pcb.in6p_laddr.s6_addr[i];
@@ -2249,7 +2289,11 @@ var_tcp6(register struct variable * vp,
DEBUGMSG(("mibII/ipv6", " %d\n", exact));
#if 1 /* this is very odd but sometimes happen, and cause infinite loop */
+ #if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ if (ntohs(in6pcb.in6p_pcb.inp_lport) == 0)
+ #else
if (ntohs(in6pcb.inp_lport) == 0)
+ #endif
goto skip;
#endif
result = snmp_oid_compare(name, *length, newname, j);
@@ -2279,6 +2323,9 @@ var_tcp6(register struct variable * vp,
#elif defined(openbsd4)
p = (caddr_t)in6pcb.inp_queue.cqe_next;
if (p == first) break;
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ p = (caddr_t)in6pcb.in6p_pcb.inp_queue.tqe_next;
+ if (p == first) break;
#elif defined(__NetBSD__) && __NetBSD_Version__ >= 700000001
p = (caddr_t)in6pcb.in6p_queue.tqe_next;
if (p == first) break;
@@ -2302,11 +2349,17 @@ var_tcp6(register struct variable * vp,
*length = savnameLen;
memcpy((char *) name, (char *) savname, *length * sizeof(oid));
memcpy(&in6pcb, &savpcb, sizeof(savpcb));
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ if (!NETSNMP_KLOOKUP(in6pcb.in6p_pcb.inp_ppcb, (char *) &tcpcb, sizeof(tcpcb))) {
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %p\n",
+ in6pcb.in6p_pcb.inp_ppcb));
+#else
if (!NETSNMP_KLOOKUP(in6pcb.inp_ppcb, (char *) &tcpcb, sizeof(tcpcb))) {
- DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %p\n",
- in6pcb.inp_ppcb));
- found = 0;
- return NULL;
+ DEBUGMSGTL(("mibII/ipv6", "klookup fail for tcb6.tcpcb at %p\n",
+ in6pcb.inp_ppcb));
+#endif
+ found = 0;
+ return NULL;
}
*write_method = 0;
*var_len = sizeof(long); /* default to 'long' results */

View File

@ -1,8 +1,8 @@
$NetBSD: patch-agent_mibgroup_mibII_tcp.c,v 1.1 2022/10/18 12:01:52 adam Exp $
$NetBSD: patch-agent_mibgroup_mibII_tcp.c,v 1.2 2024/02/21 10:21:01 wiz Exp $
--- agent/mibgroup/mibII/tcp.c.orig 2012-10-09 22:28:58.000000000 +0000
--- agent/mibgroup/mibII/tcp.c.orig 2023-08-15 20:32:01.000000000 +0000
+++ agent/mibgroup/mibII/tcp.c
@@ -197,6 +197,16 @@ init_tcp(void)
@@ -205,6 +205,16 @@ typedef uint32_t tcp_stats[TCP_NSTATS];
#define USES_TRADITIONAL_TCPSTAT
#endif
@ -19,10 +19,10 @@ $NetBSD: patch-agent_mibgroup_mibII_tcp.c,v 1.1 2022/10/18 12:01:52 adam Exp $
#if !defined(TCP_STAT_STRUCTURE)
#define TCP_STAT_STRUCTURE struct tcpstat
#define USES_TRADITIONAL_TCPSTAT
@@ -324,6 +334,75 @@ tcp_handler(netsnmp_mib_handler
#endif /* linux */
netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
continue;
@@ -332,6 +342,75 @@ tcp_handler(netsnmp_mib_handler
#elif defined(solaris2)
ret_value = tcpstat.tcpOutRsts;
break;
+#elif defined(TCP_NSTAT)
+ case TCPRTOALGORITHM: /* Assume Van Jacobsen's algorithm */
+ ret_value = 4;
@ -92,6 +92,6 @@ $NetBSD: patch-agent_mibgroup_mibII_tcp.c,v 1.1 2022/10/18 12:01:52 adam Exp $
+ case TCPOUTRSTS:
+ ret_value = tcpstat[TCP_STAT_SNDCTRL] - tcpstat[TCP_STAT_CLOSED];
+ break;
#elif defined(USES_TRADITIONAL_TCPSTAT) && !defined(_USE_FIRST_PROTOCOL)
#ifdef HAVE_SYS_TCPIPSTATS_H
/*
#endif /* linux */
netsnmp_set_request_error(reqinfo, request, SNMP_NOSUCHOBJECT);
continue;

View File

@ -1,86 +0,0 @@
$NetBSD: patch-agent_mibgroup_mibII_tcpTable.c,v 1.3 2023/01/14 21:11:35 mrg Exp $
handle list changes in 6.99.28
handle merged inpcb code since 9.99.104:
http://mail-index.netbsd.org/source-changes/2022/10/28/msg141800.html
--- agent/mibgroup/mibII/tcpTable.c.orig 2022-07-13 14:14:14.000000000 -0700
+++ agent/mibgroup/mibII/tcpTable.c 2023-01-14 00:30:16.395356283 -0800
@@ -123,20 +123,34 @@ struct netsnmp_inpcb_s {
#if __FreeBSD_version >= 1200026
struct xinpcb pcb;
#else
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ struct in4pcb pcb;
+#else
struct inpcb pcb;
#endif
+#endif
int state;
netsnmp_inpcb *inp_next;
};
#undef INP_NEXT_SYMBOL
-#define INP_NEXT_SYMBOL inp_next
#define TCPTABLE_ENTRY_TYPE netsnmp_inpcb
#define TCPTABLE_STATE state
+#define TCPTABLE_IS_LINKED_LIST
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+#define INP_NEXT_SYMBOL inp_next
+#define TCPTABLE_LOCALADDRESS pcb.in4p_ip.ip_src.s_addr
+#define TCPTABLE_LOCALPORT pcb.in4p_pcb.inp_lport
+#define TCPTABLE_REMOTEADDRESS pcb.in4p_ip.ip_dst.s_addr
+#define TCPTABLE_REMOTEPORT pcb.in4p_pcb.inp_fport
+#define TCPTABLE_TCPCB pcb.in4p_pcb.inp_ppcb
+#else
+#define INP_NEXT_SYMBOL inp_next
#define TCPTABLE_LOCALADDRESS pcb.inp_laddr.s_addr
#define TCPTABLE_LOCALPORT pcb.inp_lport
#define TCPTABLE_REMOTEADDRESS pcb.inp_faddr.s_addr
#define TCPTABLE_REMOTEPORT pcb.inp_fport
-#define TCPTABLE_IS_LINKED_LIST
+#define TCPTABLE_TCPCB pcb.inp_ppcb
+#endif
#endif /* hpux11 */
@@ -1057,18 +1071,22 @@ tcpTable_load(netsnmp_cache *cache, void
/*
* Set up a linked list
*/
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 699002800
+ entry = TAILQ_FIRST(&table.inpt_queue);
+#else
entry = table.INP_FIRST_SYMBOL;
+#endif
while (entry) {
nnew = SNMP_MALLOC_TYPEDEF(netsnmp_inpcb);
if (!nnew)
break;
- if (!NETSNMP_KLOOKUP(entry, (char *)&(nnew->pcb), sizeof(struct inpcb))) {
+ if (!NETSNMP_KLOOKUP(entry, (char *)&(nnew->pcb), sizeof(nnew->pcb))) {
DEBUGMSGTL(("mibII/tcpTable:TcpTable_load", "klookup failed\n"));
break;
}
- if (!NETSNMP_KLOOKUP(nnew->pcb.inp_ppcb, (char *)&tcpcb, sizeof(struct tcpcb))) {
+ if (!NETSNMP_KLOOKUP(nnew->TCPTABLE_TCPCB, (char *)&tcpcb, sizeof(struct tcpcb))) {
DEBUGMSGTL(("mibII/tcpTable:TcpTable_load", "klookup failed\n"));
break;
}
@@ -1081,8 +1099,13 @@ tcpTable_load(netsnmp_cache *cache, void
nnew->inp_next = tcp_head;
tcp_head = nnew;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 699002800
+ if (entry == TAILQ_FIRST(&table.inpt_queue))
+ break;
+#else
if (entry == table.INP_FIRST_SYMBOL)
break;
+#endif
}
if (tcp_head) {

View File

@ -1,17 +0,0 @@
$NetBSD: patch-agent_mibgroup_mibII_udp.c,v 1.1 2022/10/18 12:01:52 adam Exp $
--- agent/mibgroup/mibII/udp.c.orig 2012-10-09 22:28:58.000000000 +0000
+++ agent/mibgroup/mibII/udp.c
@@ -151,6 +151,12 @@ init_udp(void)
#define USES_TRADITIONAL_UDPSTAT
#endif
+#ifdef UDP_NSTATS
+typedef struct udpstat {
+ uint64_t st[UDP_NSTATS];
+};
+#define UDP_STAT_STRUCTURE struct udpstat
+#endif
#if !defined(UDP_STAT_STRUCTURE)
#define UDP_STAT_STRUCTURE struct udpstat

View File

@ -1,90 +0,0 @@
$NetBSD: patch-agent_mibgroup_mibII_udpTable.c,v 1.4 2023/01/14 21:11:35 mrg Exp $
handle list changes in 6.99.28
handle merged inpcb code since 9.99.104:
http://mail-index.netbsd.org/source-changes/2022/10/28/msg141800.html
--- agent/mibgroup/mibII/udpTable.c.orig 2022-07-13 14:14:14.000000000 -0700
+++ agent/mibgroup/mibII/udpTable.c 2023-01-14 00:46:14.117378148 -0800
@@ -109,10 +109,16 @@ struct netsnmp_inpcb_s {
#define UDPTABLE_LOCALADDRESS pcb.inp_laddr.s_addr
#define UDPTABLE_LOCALPORT pcb.inp_lport
#else
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+#define UDPTABLE_ENTRY_TYPE struct in4pcb
+#define UDPTABLE_LOCALADDRESS in4p_ip.ip_src.s_addr
+#define UDPTABLE_LOCALPORT in4p_pcb.inp_lport
+#else
#define UDPTABLE_ENTRY_TYPE struct inpcb
#define UDPTABLE_LOCALADDRESS inp_laddr.s_addr
#define UDPTABLE_LOCALPORT inp_lport
#endif
+#endif
#define UDPTABLE_IS_LINKED_LIST
#endif /* hpux11 */
@@ -430,7 +436,13 @@ udpTable_next_entry( void **loop_context
* and update the loop context ready for the next one.
*/
*data_context = (void*)entry;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ *loop_context = (void*)TAILQ_NEXT(entry, in4p_pcb.inp_queue);
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 699002800
+ *loop_context = (void*)TAILQ_NEXT(entry, inp_queue);
+#else
*loop_context = (void*)entry->INP_NEXT_SYMBOL;
+#endif
return index;
}
@@ -440,7 +452,13 @@ udpTable_free(netsnmp_cache *cache, void
UDPTABLE_ENTRY_TYPE *p;
while (udp_head) {
p = udp_head;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 999010400
+ udp_head = TAILQ_NEXT(udp_head, in4p_pcb.inp_queue);
+#elif defined(__NetBSD__) && __NetBSD_Version__ >= 699002800
+ udp_head = TAILQ_NEXT(udp_head, inp_queue);
+#else
udp_head = udp_head->INP_NEXT_SYMBOL;
+#endif
free(p);
}
@@ -752,7 +770,11 @@ udpTable_load(netsnmp_cache *cache, void
/*
* Set up a linked list
*/
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 699002800
+ entry = TAILQ_FIRST(&table.inpt_queue);
+#else
entry = table.INP_FIRST_SYMBOL;
+#endif
while (entry) {
nnew = SNMP_MALLOC_TYPEDEF(struct inpcb);
@@ -809,12 +831,22 @@ udpTable_load(netsnmp_cache *cache, void
break;
}
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 699002800
+ entry = TAILQ_NEXT(nnew, inp_queue); /* Next kernel entry */
+ TAILQ_NEXT(nnew, inp_queue) = udp_head;
+#else
entry = nnew->INP_NEXT_SYMBOL; /* Next kernel entry */
nnew->INP_NEXT_SYMBOL = udp_head;
+#endif
udp_head = nnew;
+#if defined(__NetBSD__) && __NetBSD_Version__ >= 699002800
+ if (entry == TAILQ_FIRST(&table.inpt_queue))
+ break;
+#else
if (entry == udp_inpcb.INP_NEXT_SYMBOL)
break;
+#endif
}
if (udp_head) {

View File

@ -1,12 +1,12 @@
$NetBSD: patch-agent_mibgroup_mibII_var__route.c,v 1.1 2022/10/18 12:01:52 adam Exp $
$NetBSD: patch-agent_mibgroup_mibII_var__route.c,v 1.2 2024/02/21 10:21:01 wiz Exp $
Fix for systems with RTF_LLDATA in place of RTF_LLINFO.
--- agent/mibgroup/mibII/var_route.c.orig 2016-04-29 19:35:23.000000000 +0000
--- agent/mibgroup/mibII/var_route.c.orig 2023-08-15 20:32:01.000000000 +0000
+++ agent/mibgroup/mibII/var_route.c
@@ -954,8 +954,12 @@ load_rtentries(struct radix_node *pt)
@@ -956,8 +956,12 @@ load_rtentries(struct radix_node *pt)
}
#if CHECK_RT_FLAGS
#ifdef CHECK_RT_FLAGS
if (((rt.rt_flags & RTF_CLONING) != RTF_CLONING)
+#ifdef RTF_LLDATA
+ && ((rt.rt_flags & RTF_LLDATA) != RTF_LLDATA)) {

View File

@ -1,39 +0,0 @@
$NetBSD: patch-agent_mibgroup_ucd-snmp_memory__netbsd1.c,v 1.1 2022/10/18 12:01:52 adam Exp $
--- agent/mibgroup/ucd-snmp/memory_netbsd1.c.orig 2012-10-09 22:28:58.000000000 +0000
+++ agent/mibgroup/ucd-snmp/memory_netbsd1.c
@@ -165,7 +165,7 @@ var_extensible_mem(struct variable *vp,
static char errmsg[1024];
static struct uvmexp uvmexp;
- int uvmexp_size = sizeof(uvmexp);
+ size_t uvmexp_size = sizeof(uvmexp);
int uvmexp_mib[] = { CTL_VM, VM_UVMEXP };
static struct vmtotal total;
size_t total_size = sizeof(total);
@@ -181,13 +181,22 @@ var_extensible_mem(struct variable *vp,
/*
* Memory info
*/
- sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0);
- sysctl(total_mib, 2, &total, &total_size, NULL, 0);
+ if (sysctl(uvmexp_mib, 2, &uvmexp, &uvmexp_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl VM_UVMEXP failed (errno %d)\n", errno);
+ return NULL;
+ }
+ if (sysctl(total_mib, 2, &total, &total_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl VM_METER failed (errno %d)\n", errno);
+ return NULL;
+ }
/*
* Physical memory
*/
- sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0);
+ if (sysctl(phys_mem_mib, 2, &phys_mem, &phys_mem_size, NULL, 0) == -1) {
+ snmp_log(LOG_ERR, "sysctl HW_USERMEM failed (errno %d)\n", errno);
+ return NULL;
+ }
long_ret = 0; /* set to 0 as default */

View File

@ -1,10 +1,10 @@
$NetBSD: patch-agent_snmp__perl.c,v 1.1 2016/06/06 14:11:35 he Exp $
$NetBSD: patch-agent_snmp__perl.c,v 1.2 2024/02/21 10:21:01 wiz Exp $
--- agent/snmp_perl.c.orig 2014-12-08 20:23:22.000000000 +0000
--- agent/snmp_perl.c.orig 2023-08-15 20:32:01.000000000 +0000
+++ agent/snmp_perl.c
@@ -5,6 +5,10 @@
#include <EXTERN.h>
@@ -4,6 +4,10 @@
#include "perl.h"
#pragma GCC diagnostic pop
+#ifdef U64TYPE
+#define U64 U64pairU32

View File

@ -1,102 +1,15 @@
$NetBSD: patch-configure,v 1.3 2022/10/18 12:01:52 adam Exp $
$NetBSD: patch-configure,v 1.4 2024/02/21 10:21:01 wiz Exp $
- Do not store configure options as these might be polluted with workdir.
- Fix configure to look for des_cbc_encrypt in -ldes
--- configure.orig 2022-07-13 21:14:22.000000000 +0000
--- configure.orig 2024-02-21 09:11:27.578146251 +0000
+++ configure
@@ -3350,10 +3350,10 @@ ac_config_headers="$ac_config_headers in
@@ -3752,7 +3752,7 @@ ac_config_headers="$ac_config_headers in
# save the configure arguments
#
cat >>confdefs.h <<_ACEOF
-#define NETSNMP_CONFIGURE_OPTIONS "${NETSNMP_CONFIGURE_OPTIONS-$ac_configure_args}"
+#define NETSNMP_CONFIGURE_OPTIONS ""
_ACEOF
-printf "%s\n" "#define NETSNMP_CONFIGURE_OPTIONS \"${NETSNMP_CONFIGURE_OPTIONS-$ac_configure_args}\"" >>confdefs.h
+printf "%s\n" "#define NETSNMP_CONFIGURE_OPTIONS \"\"" >>confdefs.h
-CONFIGURE_OPTIONS="\"$ac_configure_args\""
+CONFIGURE_OPTIONS="\"\""
CONFIGURE_OPTIONS="\"$ac_configure_args\""
#
@@ -23440,6 +23440,81 @@ fi
##
#########################################
+
+echo "$as_me:$LINENO: checking for des_cbc_encrypt in -ldes" >&5
+echo $ECHO_N "checking for des_cbc_encrypt in -ldes... $ECHO_C" >&6
+if test "${ac_cv_lib_des_des_cbc_encrypt+set}" = set; then
+ echo $ECHO_N "(cached) $ECHO_C" >&6
+else
+ ac_check_lib_save_LIBS=$LIBS
+LIBS="-ldes $LIBS"
+cat >conftest.$ac_ext <<_ACEOF
+/* confdefs.h. */
+_ACEOF
+cat confdefs.h >>conftest.$ac_ext
+cat >>conftest.$ac_ext <<_ACEOF
+/* end confdefs.h. */
+
+/* Override any gcc2 internal prototype to avoid an error. */
+#ifdef __cplusplus
+extern "C"
+#endif
+/* We use char because int might match the return type of a gcc2
+ builtin and then its argument prototype would still apply. */
+char des_cbc_encrypt ();
+int
+main ()
+{
+des_cbc_encrypt ();
+ ;
+ return 0;
+}
+_ACEOF
+rm -f conftest.$ac_objext conftest$ac_exeext
+if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5
+ (eval $ac_link) 2>conftest.er1
+ ac_status=$?
+ grep -v '^ *+' conftest.er1 >conftest.err
+ rm -f conftest.er1
+ cat conftest.err >&5
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); } &&
+ { ac_try='test -z "$ac_c_werror_flag"
+ || test ! -s conftest.err'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; } &&
+ { ac_try='test -s conftest$ac_exeext'
+ { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5
+ (eval $ac_try) 2>&5
+ ac_status=$?
+ echo "$as_me:$LINENO: \$? = $ac_status" >&5
+ (exit $ac_status); }; }; then
+ ac_cv_lib_des_des_cbc_encrypt=yes
+else
+ echo "$as_me: failed program was:" >&5
+sed 's/^/| /' conftest.$ac_ext >&5
+
+ac_cv_lib_des_des_cbc_encrypt=no
+fi
+rm -f conftest.err conftest.$ac_objext \
+ conftest$ac_exeext conftest.$ac_ext
+LIBS=$ac_check_lib_save_LIBS
+fi
+echo "$as_me:$LINENO: result: $ac_cv_lib_des_des_cbc_encrypt" >&5
+echo "${ECHO_T}$ac_cv_lib_des_des_cbc_encrypt" >&6
+if test $ac_cv_lib_des_des_cbc_encrypt = yes; then
+ cat >>confdefs.h <<_ACEOF
+#define HAVE_LIBDES 1
+_ACEOF
+
+ LIBS="-ldes $LIBS"
+
+fi
+
+
##
# Compilation-related
##

View File

@ -1,6 +1,5 @@
# $NetBSD: Makefile,v 1.13 2024/01/16 13:37:11 wiz Exp $
# $NetBSD: Makefile,v 1.14 2024/02/21 10:21:01 wiz Exp $
PKGREVISION= 1
.include "../../net/net-snmp/Makefile.common"
PKGNAME= ${PYPKGPREFIX}-${DISTNAME:S/net-snmp/netsnmp/}