[Midnightbsd-cvs] src [11019] U trunk/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3: sync

laffer1 at midnightbsd.org laffer1 at midnightbsd.org
Fri Jun 15 18:39:11 EDT 2018


Revision: 11019
          http://svnweb.midnightbsd.org/src/?rev=11019
Author:   laffer1
Date:     2018-06-15 18:39:11 -0400 (Fri, 15 Jun 2018)
Log Message:
-----------
sync

Modified Paths:
--------------
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_begemot.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_network_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swrun_tbl.c
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_tree.def

Property Changed:
----------------
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_tree.def
    trunk/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt	2018-06-15 22:39:11 UTC (rev 11019)
@@ -26,8 +26,8 @@
 -- OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 -- SUCH DAMAGE.
 --
+-- $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt 312257 2017-01-16 06:54:07Z ngie $
 -- $MidnightBSD$
---
 -- Additional stuff for the HOST-RESOURCES MIB.
 --
 BEGEMOT-HOSTRES-MIB DEFINITIONS ::= BEGIN
@@ -54,6 +54,9 @@
 	     E-mail:	harti at freebsd.org"
     DESCRIPTION
 	    "The MIB for additional HOST-RESOURCES data."
+    REVISION	"200601030000Z"
+    DESCRIPTION
+		"Initial revision."
     ::= { begemot 202 }
 
 begemotHostresObjects	OBJECT IDENTIFIER ::= { begemotHostres 1 }


Property changes on: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/BEGEMOT-HOSTRES-MIB.txt
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+# $MidnightBSD$
 #
 # Copyright (c) 2005-2006 The FreeBSD Project
 # All rights reserved.
@@ -25,10 +26,10 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
-# $MidnightBSD$
+# $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/Makefile 313223 2017-02-04 16:40:28Z ngie $
 #
 
-LPRSRC=	${.CURDIR}/../../../lpr/common_source
+LPRSRC=	${SRCTOP}/usr.sbin/lpr/common_source
 .PATH: ${LPRSRC}
 
 MOD=	hostres
@@ -76,7 +77,3 @@
 
 printcap.So: printcap.c
 	${CC} ${PICFLAG} -DPIC ${CFLAGS:C/^-W.*//} -c ${.IMPSRC} -o ${.TARGET}
-
-smilint:
-	env SMIPATH=.:/usr/share/snmp/mibs:/usr/local/share/snmp/mibs \
-	    smilint -c /dev/null -l6 -i group-membership BEGEMOT-HOSTRES-MIB

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_begemot.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_begemot.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_begemot.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006.
  *	Hartmut Brandt.
@@ -27,7 +28,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_begemot.c 154137 2006-01-09 13:01:26Z harti $
  */
 
 #include <stdlib.h>

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
  /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_device_tbl.c 325396 2017-11-04 14:56:58Z pfg $
  */
 
 /*
@@ -123,7 +124,7 @@
 	if (map == NULL) {
 		/* new object - get a new index */
 		if (next_device_index > INT_MAX) {
-		        syslog(LOG_ERR,
+			syslog(LOG_ERR,
 			    "%s: hrDeviceTable index wrap", __func__);
 			/* There isn't much we can do here.
 			 * If the next_swins_index is consumed
@@ -200,7 +201,7 @@
 
 	/*
 	 * From here till the end of this function we reuse name_len
-	 * for a diferrent purpose - for device_entry::descr
+	 * for a different purpose - for device_entry::descr
 	 */
 	if (name[0] != '\0')
 		name_len = strlen(name) + strlen(descr) +
@@ -479,7 +480,9 @@
 	} else {
 		if (read_len == sizeof(buf))
 			goto again;
-		refresh_device_tbl(1);
+		/* Only refresh device table on a device add or remove event. */
+		if (buf[0] == '+' || buf[0] == '-')
+			refresh_device_tbl(1);
 	}
 }
 

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_diskstorage_tbl.c 240595 2012-09-17 07:32:53Z trociny $
  */
 
 /*
@@ -448,7 +449,7 @@
 			/*
 			 * not found there - insert it as immutable
 			 */
-			syslog(LOG_WARNING, "%s: device '%s' not in "
+			syslog(LOG_WARNING, "%s: adding device '%s' to "
 			    "device list", __func__, disk);
 
 			if ((entry = device_entry_create(disk, "", "")) == NULL)
@@ -482,7 +483,8 @@
 		disk_entry->media = DSM_UNKNOWN;
 		disk_entry->removable = SNMP_FALSE;
 
-		if (strncmp(disk_entry->dev_name, "da", 2) == 0) {
+		if (strncmp(disk_entry->dev_name, "da", 2) == 0 ||
+		    strncmp(disk_entry->dev_name, "ada", 3) == 0) {
 			disk_entry->media = DSM_HARDDISK;
 			disk_entry->removable = SNMP_FALSE;
 		} else if (strncmp(disk_entry->dev_name, "cd", 2) == 0) {
@@ -640,7 +642,7 @@
 	  	value->v.integer = entry->media;
 	  	return (SNMP_ERR_NOERROR);
 
-	case LEAF_hrDiskStorageRemoveble:
+	case LEAF_hrDiskStorageRemovable:
 	  	value->v.integer = entry->removable;
 	  	return (SNMP_ERR_NOERROR);
 

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_fs_tbl.c 310900 2016-12-31 10:30:56Z ngie $
  */
 
 /*
@@ -131,7 +132,7 @@
 	const struct asn_oid	*oid;	/* the OID to return */
 } fs_type_map[] = {
 	{ "ufs",	&OIDX_hrFSBerkeleyFFS_c },
-	{ "zfs",        &OIDX_hrFSOther_c },
+	{ "zfs",	&OIDX_hrFSOther_c },
 	{ "cd9660",	&OIDX_hrFSiso9660_c },
 	{ "nfs",	&OIDX_hrFSNFS_c },
 	{ "ext2fs",	&OIDX_hrFSLinuxExt2_c },
@@ -167,7 +168,7 @@
 		/* new object - get a new index */
 		if (next_fs_index > INT_MAX) {
 			/* Unrecoverable error - die clean and quicly*/
-		        syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
+			syslog(LOG_ERR, "%s: hrFSTable index wrap", __func__);
 			errx(EX_SOFTWARE, "hrFSTable index wrap");
 		}
 

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_network_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_network_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_network_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_network_tbl.c 160341 2006-07-14 09:07:56Z harti $
  */
 
 /*

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_partition_tbl.c 310900 2016-12-31 10:30:56Z ngie $
  */
 
 /*
@@ -177,7 +178,7 @@
 
 		if (next_partition_index > INT_MAX) {
 			/* Unrecoverable error - die clean and quicly*/
-		        syslog(LOG_ERR, "%s: hrPartitionTable index wrap",
+			syslog(LOG_ERR, "%s: hrPartitionTable index wrap",
 			    __func__);
 			errx(EX_SOFTWARE, "hrPartitionTable index wrap");
 		}

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_printer_tbl.c 285851 2015-07-24 19:21:48Z pfg $
  */
 
 /*
@@ -175,7 +176,7 @@
 		goto LABEL_DONE;
 	}
 
-	memset(&fline[0], '\0', sizeof(line));
+	memset(&fline[0], '\0', sizeof(fline));
 	if (fgets(fline, sizeof(fline) -1, f) == NULL) {
 		ps = PS_UNKNOWN;
 		goto LABEL_DONE;

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_processor_tbl.c 214489 2010-10-28 20:18:26Z uqs $
  */
 
 /*

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_scalars.c 311720 2017-01-09 01:07:16Z ngie $
  */
 
 /*
@@ -33,7 +34,7 @@
  * Host Resources MIB scalars implementation for SNMPd.
  */
 
-#include <sys/types.h>
+#include <sys/param.h>
 #include <sys/sysctl.h>
 
 #include <pwd.h>
@@ -85,7 +86,7 @@
 		int mib[2] = { CTL_KERN, KERN_BOOTTIME };
 		size_t len = sizeof(kernel_boot_timestamp);
 
-		if (sysctl(mib, 2, &kernel_boot_timestamp,
+		if (sysctl(mib, nitems(mib), &kernel_boot_timestamp,
 		    &len, NULL, 0) == -1) {
 			syslog(LOG_ERR, "sysctl KERN_BOOTTIME failed: %m");
 			return (SNMP_ERR_GENERR);
@@ -170,8 +171,8 @@
 
 /**
  * Get kernel boot path. For FreeBSD it seems that no arguments are
- * present. Returns NULL if an error occured. The returned data is a
- * pointer to a global strorage.
+ * present. Returns NULL if an error occurred. The returned data is a
+ * pointer to a global storage.
  */
 int
 OS_getSystemInitialLoadParameters(u_char **params)
@@ -193,7 +194,7 @@
 			syslog(LOG_ERR, "malloc failed");
 			return (SNMP_ERR_GENERR);
 		}
-                if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) {
+		if (sysctl(mib, 2, buf, &buf_len, NULL, 0)) {
 			syslog(LOG_ERR,
 			    "sysctl({CTL_KERN,KERN_BOOTFILE}) failed: %m");
 			free(buf);
@@ -296,7 +297,7 @@
 		*ms = UINT32_MAX;
 	else
 		*ms = phys_mem_size;
-        return (SNMP_ERR_NOERROR);
+	return (SNMP_ERR_NOERROR);
 }
 
 /*
@@ -360,7 +361,7 @@
 	if (settimeofday(timeval_to_set, NULL) == -1) {
 		syslog(LOG_ERR, "settimeofday failed: %m");
 		return (SNMP_ERR_GENERR);
-        }
+	}
 	return (SNMP_ERR_NOERROR);
 }
 
@@ -378,7 +379,7 @@
 
 	switch (curr_op) {
 
-          case SNMP_OP_GET:
+	  case SNMP_OP_GET:
 		switch (value->var.subs[sub - 1]) {
 
 		case LEAF_hrSystemUptime:

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -37,7 +38,7 @@
  * this stuff is worth it, you can buy me a beer in return.   Poul-Henning Kamp
  * ----------------------------------------------------------------------------
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c 310900 2016-12-31 10:30:56Z ngie $
  */
 
 /*
@@ -163,7 +164,7 @@
 	start_processor_tbl(hostres_module);
 	start_network_tbl();
 
-        HRDBG("done.");
+	HRDBG("done.");
 }
 
 /* this identifies the HOST RESOURCES mib module */
@@ -175,8 +176,8 @@
 	NULL,
 	NULL,
 	hostres_start,
-	NULL,                   /* proxy a PDU */
-	hostres_ctree,          /* see the generated hostres_tree.h */
+	NULL,		   /* proxy a PDU */
+	hostres_ctree,	  /* see the generated hostres_tree.h */
 	hostres_CTREE_SIZE,     /* see the generated hostres_tree.h */
 	NULL
 };
@@ -201,8 +202,8 @@
 	else
 		str[8] = '+';
 
-	str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
-	str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
+	str[9] = (u_char)(labs(tm->tm_gmtoff) / 3600);
+	str[10] = (u_char)((labs(tm->tm_gmtoff) % 3600) / 60);
 
 	return (11);
 }

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -28,7 +29,7 @@
  *
  * Host Resources MIB for SNMPd.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.h 228990 2011-12-30 10:58:14Z uqs $
  */
 
 #ifndef HOSTRES_SNMP_H_1132245017
@@ -218,7 +219,7 @@
 /* Called after refreshing fs part of hrStorageTable */
 void fs_tbl_post_refresh(void);
 
-/* Refresh the FS table if neccessary. */
+/* Refresh the FS table if necessary. */
 void refresh_fs_tbl(void);
 
 /* Finalization routine for hrFSTable. */

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*-
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_storage_tbl.c 310900 2016-12-31 10:30:56Z ngie $
  */
 
 /*
@@ -133,7 +134,7 @@
     OIDX_hrStorageVirtualMemory;
 
 /**
- * Create a new entry into the storage table and, if neccessary, an
+ * Create a new entry into the storage table and, if necessary, an
  * entry into the storage map.
  */
 static struct storage_entry *
@@ -153,7 +154,7 @@
 	if (map == NULL) {
 		/* new object - get a new index */
 		if (next_storage_index > INT_MAX) {
-		        syslog(LOG_ERR,
+			syslog(LOG_ERR,
 			    "%s: hrStorageTable index wrap", __func__);
 			errx(EX_SOFTWARE, "hrStorageTable index wrap");
 		}
@@ -188,7 +189,7 @@
 		syslog(LOG_WARNING, "%s: %m", __func__);
 		return (NULL);
 	}
-        memset(entry, 0, sizeof(*entry));
+	memset(entry, 0, sizeof(*entry));
 
 	entry->index = map->hrIndex;
 
@@ -374,11 +375,14 @@
 static void
 storage_OS_get_swap(void)
 {
-        int nswapdev = 0;
-	size_t len = sizeof(nswapdev);
 	struct storage_entry *entry;
 	char swap_w_prefix[SE_DESC_MLEN];
+	size_t len;
+	int nswapdev;
 
+	len = sizeof(nswapdev);
+	nswapdev = 0;
+
 	if (sysctlbyname("vm.nswapdev", &nswapdev, &len, NULL,0 ) < 0) {
 		syslog(LOG_ERR,
 		    "hrStorageTable: sysctlbyname(\"vm.nswapdev\") "

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swinstalled_tbl.c 310900 2016-12-31 10:30:56Z ngie $
  *
  * Host Resources MIB implementation for SNMPd: instrumentation for
  * hrSWInstalledTable
@@ -50,7 +51,7 @@
 #include "hostres_oid.h"
 #include "hostres_tree.h"
 
-#define	CONTENTS_FNAME          "+CONTENTS"
+#define	CONTENTS_FNAME	"+CONTENTS"
 
 enum SWInstalledType {
 	SWI_UNKNOWN		= 1,
@@ -136,7 +137,7 @@
 		size_t name_len;
 		/* new object - get a new index */
 		if (next_swins_index > INT_MAX) {
-		        syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap",
+			syslog(LOG_ERR, "%s: hrSWInstalledTable index wrap",
 			    __func__ );
 			/* There isn't much we can do here.
 			 * If the next_swins_index is consumed
@@ -292,7 +293,7 @@
 	struct stat sb;
 	DIR *p_dir;
 	struct dirent *ent;
-        struct tm k_ts;
+	struct tm k_ts;
 	char *pkg_file;
 	struct swins_entry *entry;
 	int ret = 0;
@@ -327,7 +328,7 @@
 		return (-1);
 	}
 
-        while (errno = 0, (ent = readdir(p_dir)) != NULL) {
+	while (errno = 0, (ent = readdir(p_dir)) != NULL) {
 		HRDBG("  pkg file: %s", ent->d_name);
 
 		/* check that the contents file is a regular file */
@@ -371,7 +372,7 @@
 		entry->type = (int32_t)SWI_APPLICATION;
 
 		entry->date_len = make_date_time(entry->date, &k_ts, 0);
-        }
+	}
 
 	if (errno != 0) {
 		syslog(LOG_ERR, "hrSWInstalledTable: readdir_r(\"%s\") failed:"

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swrun_tbl.c
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swrun_tbl.c	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swrun_tbl.c	2018-06-15 22:39:11 UTC (rev 11019)
@@ -1,3 +1,4 @@
+/* $MidnightBSD$ */
 /*
  * Copyright (c) 2005-2006 The FreeBSD Project
  * All rights reserved.
@@ -26,7 +27,7 @@
  * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
  * SUCH DAMAGE.
  *
- * $MidnightBSD$
+ * $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_swrun_tbl.c 240352 2012-09-11 08:28:58Z glebius $
  *
  * Host Resources MIB for SNMPd. Implementation for hrSWRunTable
  */
@@ -319,7 +320,7 @@
 }
 
 /**
- * Get all visible proceses including the kernel visible threads
+ * Get all visible processes including the kernel visible threads
  */
 static void
 swrun_OS_get_procs(void)

Modified: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_tree.def
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_tree.def	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_tree.def	2018-06-15 22:39:11 UTC (rev 11019)
@@ -25,8 +25,8 @@
 # OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 # SUCH DAMAGE.
 #
+# $FreeBSD: stable/10/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_tree.def 226683 2011-10-24 12:21:58Z ivoras $
 # $MidnightBSD$
-#
 # This is the .def file for both HOST-RESOURCES-MIB and HOST-RESOURCES-TYPES
 #
 
@@ -149,7 +149,7 @@
             (1 hrDiskStorageEntry : INTEGER op_hrDiskStorageTable
               (1 hrDiskStorageAccess INTEGER GET)
               (2 hrDiskStorageMedia INTEGER GET)
-              (3 hrDiskStorageRemoveble INTEGER GET)
+              (3 hrDiskStorageRemovable INTEGER GET)
               (4 hrDiskStorageCapacity INTEGER GET)
             )
           )


Property changes on: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/hostres_tree.def
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property
Index: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
===================================================================
--- trunk/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3	2018-06-15 22:38:05 UTC (rev 11018)
+++ trunk/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3	2018-06-15 22:39:11 UTC (rev 11019)

Property changes on: trunk/usr.sbin/bsnmpd/modules/snmp_hostres/snmp_hostres.3
___________________________________________________________________
Added: svn:keywords
## -0,0 +1 ##
+MidnightBSD=%H
\ No newline at end of property


More information about the Midnightbsd-cvs mailing list