summaryrefslogtreecommitdiffstats
path: root/contrib/bsnmp
diff options
context:
space:
mode:
authorharti <harti@FreeBSD.org>2006-02-27 16:16:18 +0000
committerharti <harti@FreeBSD.org>2006-02-27 16:16:18 +0000
commit247524ddce71d1f56900276811136dfdbe38cc55 (patch)
tree8156bfffe30f91fdf58a22bd39fcc0704622e399 /contrib/bsnmp
parent38bcf38e8ed377df49a5c02ef7a7102bf85e35e2 (diff)
parent9b4fc3d8f13de6a6c075d5b243b2e8370bd35367 (diff)
downloadFreeBSD-src-247524ddce71d1f56900276811136dfdbe38cc55.zip
FreeBSD-src-247524ddce71d1f56900276811136dfdbe38cc55.tar.gz
This commit was generated by cvs2svn to compensate for changes in r156066,
which included commits to RCS files with non-trunk default branches.
Diffstat (limited to 'contrib/bsnmp')
-rw-r--r--contrib/bsnmp/NEWS26
-rw-r--r--contrib/bsnmp/TODO3
-rw-r--r--contrib/bsnmp/VERSION2
-rw-r--r--contrib/bsnmp/gensnmptree/gensnmptree.133
-rw-r--r--contrib/bsnmp/gensnmptree/gensnmptree.c2
-rw-r--r--contrib/bsnmp/lib/asn1.c14
-rw-r--r--contrib/bsnmp/lib/asn1.h2
-rw-r--r--contrib/bsnmp/lib/snmpclient.c10
-rw-r--r--contrib/bsnmp/lib/support.h29
-rw-r--r--contrib/bsnmp/oid-list5
-rw-r--r--contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt61
-rw-r--r--contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt90
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII.c2
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII.h2
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII_begemot.c103
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII_interfaces.c2
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII_route.c9
-rw-r--r--contrib/bsnmp/snmp_mibII/mibII_tree.def2
-rw-r--r--contrib/bsnmp/snmp_mibII/snmp_mibII.h2
-rw-r--r--contrib/bsnmp/snmp_ntp/snmp_ntp.c13
-rw-r--r--contrib/bsnmp/snmpd/bsnmpd.115
-rw-r--r--contrib/bsnmp/snmpd/config.c2
-rw-r--r--contrib/bsnmp/snmpd/export.c2
-rw-r--r--contrib/bsnmp/snmpd/main.c11
-rw-r--r--contrib/bsnmp/snmpd/snmpd.config2
-rw-r--r--contrib/bsnmp/snmpd/snmpmod.39
-rw-r--r--contrib/bsnmp/snmpd/snmpmod.h2
27 files changed, 377 insertions, 78 deletions
diff --git a/contrib/bsnmp/NEWS b/contrib/bsnmp/NEWS
index 0043b0e..e8f0285 100644
--- a/contrib/bsnmp/NEWS
+++ b/contrib/bsnmp/NEWS
@@ -1,3 +1,29 @@
+1.12
+ A couple of man page fixes from various submitters.
+
+ Make default communities NULL for security.
+
+ Fix a core dump when -d tracing suboption has no argument (thanks
+ to Shteryana Shopova).
+
+ Fix bug in parsing the include path in the daemon.
+
+ Fix an uninitialize structure field in gensnmptree (thanks to
+ jasone@freebsdorg)
+
+ 64bit HC counters in the IF-MIB by polling the OS periodically.
+
+ Fix link traps to be more RFC conform (thanks to glebius@freebsd.org)
+
+ Add fallback definition for SA_SIZE() to support.h.
+
+ Move the porting definitions for U?INT32_{MIN,MAX} into support.h.
+
+ Include a sys/tree.h from FreeBSD-current and add autoconf
+ check for it.
+
+1.11a Fix build of modules when stdint.h is included after asn1.h
+
1.11 Make the Mib2 routing table use red-black tree. This vastly
reduces loading and access time. Load the table only every 10
minutes. In the meantime process message from the routing socket
diff --git a/contrib/bsnmp/TODO b/contrib/bsnmp/TODO
index 732c82c..fc3f470 100644
--- a/contrib/bsnmp/TODO
+++ b/contrib/bsnmp/TODO
@@ -1,6 +1,3 @@
-snmpd_mibII:
- - handle HC counters by periodically polling the kernel counters.
-
snmpd:
- rethink transports a little bit: make them loadable and make
a private subtree for transports:
diff --git a/contrib/bsnmp/VERSION b/contrib/bsnmp/VERSION
index 0960158..809bdcb 100644
--- a/contrib/bsnmp/VERSION
+++ b/contrib/bsnmp/VERSION
@@ -1 +1 @@
-1.11
+1.12
diff --git a/contrib/bsnmp/gensnmptree/gensnmptree.1 b/contrib/bsnmp/gensnmptree/gensnmptree.1
index 3ebefe6..593c67a 100644
--- a/contrib/bsnmp/gensnmptree/gensnmptree.1
+++ b/contrib/bsnmp/gensnmptree/gensnmptree.1
@@ -26,9 +26,9 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Begemot: bsnmp/gensnmptree/gensnmptree.1,v 1.5 2005/06/15 11:31:25 brandt_h Exp $
+.\" $Begemot: bsnmp/gensnmptree/gensnmptree.1,v 1.7 2006/02/27 09:52:08 brandt_h Exp $
.\"
-.Dd June 14, 2005
+.Dd February 27, 2006
.Dt GENSNMPTREE 1
.Os
.Sh NAME
@@ -45,7 +45,7 @@ The
utility is used to either generate C language tables and header files from
a MIB description or to numeric OIDs from MIB descriptions.
The first form is used only for maintaining the
-.Xr snmpd 1
+.Xr bsnmpd 1
daemon or for module writers.
The second form may be used by SNMP client program writers.
.Pp
@@ -57,7 +57,7 @@ reads a MIB description from its standard input and creates two files: a
C-file
.Ar prefix Ns tree.c
containing a table used by
-.Xr snmpd 1
+.Xr bsnmpd 1
during PDU processing
and a header file
.Ar prefix Ns tree.h
@@ -70,14 +70,19 @@ option is specified
.Nm
expects MIB variable names (only the last component) on its command line.
It reads a MIB specification from standard input and for each MIB variable
-name emits two C preprocessor defines on its standard output.
-One define
-.Va OID_ Ns Ar name
-can be used as an array initialized to initialize a
-.Va struct asn_oid .
-The other define
-.Va OIDLEN_ Ns Ar name
-contains the length of the OID.
+name emits three C preprocessor defines on its standard output:
+.Bl -tag -width ".Va OIDLEN_ Ns Ar Name"
+.It Va OIDX_ Ns Ar name
+This define can be used to initialize a
+.Va struct asn_oid
+in the following way:
+.Pp
+.Dl const struct asn_oid oid_sysDescr = OIDX_sysDescr;
+.It Va OIDLEN_ Ns Ar name
+is the length of the OID.
+.It Va OID_ Ns Ar name
+is the last component of the OID.
+.El
.Pp
The options are as follows:
.Bl -tag -width ".Fl d Ar argument"
@@ -88,7 +93,7 @@ Enter extract mode.
.It Fl l
Generate local preprocessor includes.
This is used for bootstrapping
-.Xr snmpd 1 .
+.Xr bsnmpd 1 .
.It Fl t
Instead of normal output print the resulting tree.
.It Fl p Ar prefix
@@ -187,6 +192,6 @@ The following MIB description describes the system group:
)
.Ed
.Sh SEE ALSO
-.Xr snmpd 1
+.Xr bsnmpd 1
.Sh AUTHORS
.An Hartmut Brandt Aq harti@freebsd.org
diff --git a/contrib/bsnmp/gensnmptree/gensnmptree.c b/contrib/bsnmp/gensnmptree/gensnmptree.c
index c23c8a1..990844a 100644
--- a/contrib/bsnmp/gensnmptree/gensnmptree.c
+++ b/contrib/bsnmp/gensnmptree/gensnmptree.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.43 2005/10/04 11:21:29 brandt_h Exp $
+ * $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.44 2006/02/14 09:04:17 brandt_h Exp $
*
* Generate OID table from table description.
*
diff --git a/contrib/bsnmp/lib/asn1.c b/contrib/bsnmp/lib/asn1.c
index d72eee5..16b523d 100644
--- a/contrib/bsnmp/lib/asn1.c
+++ b/contrib/bsnmp/lib/asn1.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/lib/asn1.c,v 1.29 2005/10/04 11:21:31 brandt_h Exp $
+ * $Begemot: bsnmp/lib/asn1.c,v 1.31 2005/10/06 07:14:58 brandt_h Exp $
*
* ASN.1 for SNMP.
*/
@@ -41,17 +41,9 @@
#include <inttypes.h>
#endif
#include <assert.h>
-#include "asn1.h"
-#if !defined(INT32_MIN)
-#define INT32_MIN (-0x7fffffff-1)
-#endif
-#if !defined(INT32_MAX)
-#define INT32_MAX (0x7fffffff)
-#endif
-#if !defined(UINT32_MAX)
-#define UINT32_MAX (0xffffffff)
-#endif
+#include "support.h"
+#include "asn1.h"
static void asn_error_func(const struct asn_buf *, const char *, ...);
diff --git a/contrib/bsnmp/lib/asn1.h b/contrib/bsnmp/lib/asn1.h
index ccbafc9..5748b14 100644
--- a/contrib/bsnmp/lib/asn1.h
+++ b/contrib/bsnmp/lib/asn1.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/lib/asn1.h,v 1.19 2005/10/04 11:21:31 brandt_h Exp $
+ * $Begemot: bsnmp/lib/asn1.h,v 1.20 2005/10/05 16:43:11 brandt_h Exp $
*
* ASN.1 for SNMP
*/
diff --git a/contrib/bsnmp/lib/snmpclient.c b/contrib/bsnmp/lib/snmpclient.c
index 5e7d351..b77543a 100644
--- a/contrib/bsnmp/lib/snmpclient.c
+++ b/contrib/bsnmp/lib/snmpclient.c
@@ -30,7 +30,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/lib/snmpclient.c,v 1.34 2005/10/04 14:32:42 brandt_h Exp $
+ * $Begemot: bsnmp/lib/snmpclient.c,v 1.36 2005/10/06 07:14:58 brandt_h Exp $
*
* Support functions for SNMP clients.
*/
@@ -64,14 +64,6 @@
#include "snmpclient.h"
#include "snmppriv.h"
-#if !defined(INT32_MAX)
-#define INT32_MAX (0x7fffffff)
-#endif
-#if !defined(UINT32_MAX)
-#define UINT32_MAX (0xffffffff)
-#endif
-
-
/* global context */
struct snmp_client snmp_client;
diff --git a/contrib/bsnmp/lib/support.h b/contrib/bsnmp/lib/support.h
index 53aba2c..415c85b 100644
--- a/contrib/bsnmp/lib/support.h
+++ b/contrib/bsnmp/lib/support.h
@@ -1,5 +1,5 @@
/*
- * Copyright (C) 2004
+ * Copyright (C) 2004-2005
* Hartmut Brandt.
* All rights reserved.
*
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/lib/support.h,v 1.1 2004/08/06 08:47:59 brandt Exp $
+ * $Begemot: bsnmp/lib/support.h,v 1.2 2005/10/06 07:14:59 brandt_h Exp $
*
* Functions that are missing on certain systems. This header file is not
* to be installed.
@@ -68,4 +68,29 @@ void freeaddrinfo(struct addrinfo *);
#endif
+/*
+ * For systems with missing stdint.h or inttypes.h
+ */
+#if !defined(INT32_MIN)
+#define INT32_MIN (-0x7fffffff-1)
+#endif
+#if !defined(INT32_MAX)
+#define INT32_MAX (0x7fffffff)
+#endif
+#if !defined(UINT32_MAX)
+#define UINT32_MAX (0xffffffff)
+#endif
+
+/*
+ * Systems missing SA_SIZE(). Taken from FreeBSD net/route.h:1.63
+ */
+#ifndef SA_SIZE
+
+#define SA_SIZE(sa) \
+ ( (!(sa) || ((struct sockaddr *)(sa))->sa_len == 0) ? \
+ sizeof(long) : \
+ 1 + ( (((struct sockaddr *)(sa))->sa_len - 1) | (sizeof(long) - 1) ) )
+
+#endif
+
#endif
diff --git a/contrib/bsnmp/oid-list b/contrib/bsnmp/oid-list
index c831f15..6587bd0 100644
--- a/contrib/bsnmp/oid-list
+++ b/contrib/bsnmp/oid-list
@@ -1,4 +1,4 @@
-$Begemot: bsnmp/oid-list,v 1.3 2005/05/23 09:03:22 brandt_h Exp $
+$Begemot: bsnmp/oid-list,v 1.5 2006/02/27 09:55:45 brandt_h Exp $
This file documents the OID assignments under BSNMP's private OID.
@@ -11,11 +11,12 @@ enterprises
1 BEGEMOT
1 BEGEMOT-SNMPD
2 BEGEMOT-NETGRAPH snmpd netgraph module
- 3 BEGEMOT-IP snmpd mibII module
+ 3 BEGEMOT-IP snmpd IP related stuff.
100 BEGEMOT-ILMID snmpd ILMID module
101 BEGEMOT-ATM snmpd ATM module
200 BEGEMOT-PF snmpd PF module (phillip@freebsd.org)
201 BEGEMOT-NTP snmpd NTP module
+ 202 BEGEMOT-HOSTRES snmpd HOSTRES module private stuff
300 BEGEMOT-ACM DLR ACM project
If you need an OID and don't know where to stuck it in, I can assign you one -
diff --git a/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt b/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt
new file mode 100644
index 0000000..761876a
--- /dev/null
+++ b/contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt
@@ -0,0 +1,61 @@
+--
+-- Copyright (c) 2006
+-- Hartmut Brandt
+-- All rights reserved.
+--
+-- Author: Harti Brandt <harti@freebsd.org>
+--
+-- 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.
+--
+-- THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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.
+--
+-- $Begemot: bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt,v 1.1 2006/02/14 09:04:18 brandt_h Exp $
+--
+-- Private MIB for IP stuff.
+--
+BEGEMOT-IP-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY
+ FROM SNMPv2-SMI
+ begemot
+ FROM BEGEMOT-MIB;
+
+begemotIp MODULE-IDENTITY
+ LAST-UPDATED "200602130000Z"
+ ORGANIZATION "German Aerospace Center"
+ CONTACT-INFO
+ " Hartmut Brandt
+
+ Postal: German Aerospace Center
+ Oberpfaffenhofen
+ 82234 Wessling
+ Germany
+
+ Fax: +49 8153 28 2843
+
+ E-mail: harti@freebsd.org"
+ DESCRIPTION
+ "The MIB for IP stuff that is not in the official IP MIBs."
+ ::= { begemot 3 }
+
+begemotIpObjects OBJECT IDENTIFIER ::= { begemotIp 1 }
+
+END
diff --git a/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt b/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt
new file mode 100644
index 0000000..32cf7a6
--- /dev/null
+++ b/contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt
@@ -0,0 +1,90 @@
+--
+-- Copyright (c) 2006
+-- Hartmut Brandt
+-- All rights reserved.
+--
+-- Author: Harti Brandt <harti@freebsd.org>
+--
+-- 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.
+--
+-- THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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.
+--
+-- $Begemot: bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt,v 1.1 2006/02/14 09:04:18 brandt_h Exp $
+--
+-- Private MIB for MIB2.
+--
+BEGEMOT-MIB2-MIB DEFINITIONS ::= BEGIN
+
+IMPORTS
+ MODULE-IDENTITY, OBJECT-TYPE, TimeTicks, Counter64
+ FROM SNMPv2-SMI
+ begemotIp
+ FROM BEGEMOT-IP-MIB;
+
+begemotMib2 MODULE-IDENTITY
+ LAST-UPDATED "200602130000Z"
+ ORGANIZATION "German Aerospace Center"
+ CONTACT-INFO
+ " Hartmut Brandt
+
+ Postal: German Aerospace Center
+ Oberpfaffenhofen
+ 82234 Wessling
+ Germany
+
+ Fax: +49 8153 28 2843
+
+ E-mail: harti@freebsd.org"
+ DESCRIPTION
+ "The MIB for private mib2 stuff."
+ ::= { begemotIp 1 }
+
+begemotIfMaxspeed OBJECT-TYPE
+ SYNTAX Counter64
+ UNITS "bps"
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The speed of the fastest interface in ifTable in bps."
+ ::= { begemotMib2 1 }
+
+begemotIfPoll OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "The current polling rate for the HC 64-bit counters."
+ ::= { begemotMib2 2 }
+
+begemotIfForcePoll OBJECT-TYPE
+ SYNTAX TimeTicks
+ MAX-ACCESS read-write
+ STATUS current
+ DESCRIPTION
+ "The polling rate to be enforced for the HC 64-bit counters.
+ If this value is 0 the mib2 module computes a polling rate
+ depending on the value of begemotIfMaxspeed. If this value
+ turns out to be wrong, the polling rate can be force to an
+ arbitrary value by setting begemotIfForcePoll to a non-0
+ value. This may be necessary if an interface announces a wrong
+ bit rate in its MIB."
+ ::= { begemotMib2 3 }
+
+END
diff --git a/contrib/bsnmp/snmp_mibII/mibII.c b/contrib/bsnmp/snmp_mibII/mibII.c
index 9dbec01..1e0871b 100644
--- a/contrib/bsnmp/snmp_mibII/mibII.c
+++ b/contrib/bsnmp/snmp_mibII/mibII.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmp_mibII/mibII.c,v 1.23 2005/06/09 12:36:52 brandt_h Exp $
+ * $Begemot: bsnmp/snmp_mibII/mibII.c,v 1.24 2006/02/14 09:04:18 brandt_h Exp $
*
* Implementation of the standard interfaces and ip MIB.
*/
diff --git a/contrib/bsnmp/snmp_mibII/mibII.h b/contrib/bsnmp/snmp_mibII/mibII.h
index 65c14cc..a21e023 100644
--- a/contrib/bsnmp/snmp_mibII/mibII.h
+++ b/contrib/bsnmp/snmp_mibII/mibII.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmp_mibII/mibII.h,v 1.15 2005/06/09 12:36:53 brandt_h Exp $
+ * $Begemot: bsnmp/snmp_mibII/mibII.h,v 1.16 2006/02/14 09:04:19 brandt_h Exp $
*
* Implementation of the interfaces and IP groups of MIB-II.
*/
diff --git a/contrib/bsnmp/snmp_mibII/mibII_begemot.c b/contrib/bsnmp/snmp_mibII/mibII_begemot.c
new file mode 100644
index 0000000..5841b81
--- /dev/null
+++ b/contrib/bsnmp/snmp_mibII/mibII_begemot.c
@@ -0,0 +1,103 @@
+/*
+ * Copyright (c) 2006
+ * Hartmut Brandt.
+ * All rights reserved.
+ *
+ * Author: Harti Brandt <harti@freebsd.org>
+ *
+ * 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.
+ *
+ * THIS SOFTWARE IS PROVIDED BY AUTHOR 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 AUTHOR 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.
+ *
+ * $Begemot: bsnmp/snmp_mibII/mibII_begemot.c,v 1.1 2006/02/14 09:04:19 brandt_h Exp $
+ *
+ * Private MIB.
+ */
+#include "mibII.h"
+#include "mibII_oid.h"
+
+/*
+ * Scalars
+ */
+int
+op_begemot_mibII(struct snmp_context *ctx __unused, struct snmp_value *value,
+ u_int sub, u_int idx __unused, enum snmp_op op)
+{
+ switch (op) {
+
+ case SNMP_OP_GETNEXT:
+ abort();
+
+ case SNMP_OP_GET:
+ goto get;
+
+ case SNMP_OP_SET:
+ switch (value->var.subs[sub - 1]) {
+
+ case LEAF_begemotIfMaxspeed:
+ case LEAF_begemotIfPoll:
+ return (SNMP_ERR_NOT_WRITEABLE);
+
+ case LEAF_begemotIfForcePoll:
+ ctx->scratch->int1 = mibif_force_hc_update_interval;
+ mibif_force_hc_update_interval = value->v.uint32;
+ return (SNMP_ERR_NOERROR);
+ }
+ abort();
+
+ case SNMP_OP_ROLLBACK:
+ switch (value->var.subs[sub - 1]) {
+
+ case LEAF_begemotIfForcePoll:
+ mibif_force_hc_update_interval = ctx->scratch->int1;
+ return (SNMP_ERR_NOERROR);
+ }
+ abort();
+
+ case SNMP_OP_COMMIT:
+ switch (value->var.subs[sub - 1]) {
+
+ case LEAF_begemotIfForcePoll:
+ mibif_force_hc_update_interval = ctx->scratch->int1;
+ mibif_reset_hc_timer();
+ return (SNMP_ERR_NOERROR);
+ }
+ abort();
+ }
+ abort();
+
+ get:
+
+ switch (value->var.subs[sub - 1]) {
+
+ case LEAF_begemotIfMaxspeed:
+ value->v.counter64 = mibif_maxspeed;
+ return (SNMP_ERR_NOERROR);
+
+ case LEAF_begemotIfPoll:
+ value->v.uint32 = mibif_hc_update_interval;
+ return (SNMP_ERR_NOERROR);
+
+ case LEAF_begemotIfForcePoll:
+ value->v.uint32 = mibif_force_hc_update_interval;
+ return (SNMP_ERR_NOERROR);
+ }
+ abort();
+}
diff --git a/contrib/bsnmp/snmp_mibII/mibII_interfaces.c b/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
index 50ad630..a1817d3 100644
--- a/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
+++ b/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmp_mibII/mibII_interfaces.c,v 1.16 2005/11/02 12:07:40 brandt_h Exp $
+ * $Begemot: bsnmp/snmp_mibII/mibII_interfaces.c,v 1.17 2006/02/14 09:04:19 brandt_h Exp $
*
* Interfaces group.
*/
diff --git a/contrib/bsnmp/snmp_mibII/mibII_route.c b/contrib/bsnmp/snmp_mibII/mibII_route.c
index feb33c9..e17497d 100644
--- a/contrib/bsnmp/snmp_mibII/mibII_route.c
+++ b/contrib/bsnmp/snmp_mibII/mibII_route.c
@@ -26,11 +26,18 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmp_mibII/mibII_route.c,v 1.7 2005/06/09 12:36:53 brandt_h Exp $
+ * $Begemot: bsnmp/snmp_mibII/mibII_route.c,v 1.9 2005/10/06 07:15:00 brandt_h Exp $
*
* Routing table
*/
+#include "support.h"
+
+#ifdef HAVE_SYS_TREE_H
#include <sys/tree.h>
+#else
+#include "tree.h"
+#endif
+
#include "mibII.h"
#include "mibII_oid.h"
diff --git a/contrib/bsnmp/snmp_mibII/mibII_tree.def b/contrib/bsnmp/snmp_mibII/mibII_tree.def
index 79e1345..90fbb03 100644
--- a/contrib/bsnmp/snmp_mibII/mibII_tree.def
+++ b/contrib/bsnmp/snmp_mibII/mibII_tree.def
@@ -26,7 +26,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Begemot: bsnmp/snmp_mibII/mibII_tree.def,v 1.12 2004/08/06 08:47:05 brandt Exp $
+# $Begemot: bsnmp/snmp_mibII/mibII_tree.def,v 1.13 2006/02/14 09:04:19 brandt_h Exp $
#
# Definition of the standard interfaces and ip trees.
#
diff --git a/contrib/bsnmp/snmp_mibII/snmp_mibII.h b/contrib/bsnmp/snmp_mibII/snmp_mibII.h
index 9345184..91e552e 100644
--- a/contrib/bsnmp/snmp_mibII/snmp_mibII.h
+++ b/contrib/bsnmp/snmp_mibII/snmp_mibII.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmp_mibII/snmp_mibII.h,v 1.17 2005/05/23 09:03:43 brandt_h Exp $
+ * $Begemot: bsnmp/snmp_mibII/snmp_mibII.h,v 1.18 2006/02/14 09:04:19 brandt_h Exp $
*
* Implementation of the interfaces and IP groups of MIB-II.
*/
diff --git a/contrib/bsnmp/snmp_ntp/snmp_ntp.c b/contrib/bsnmp/snmp_ntp/snmp_ntp.c
index 830c01f..fcc129a 100644
--- a/contrib/bsnmp/snmp_ntp/snmp_ntp.c
+++ b/contrib/bsnmp/snmp_ntp/snmp_ntp.c
@@ -27,7 +27,7 @@
* NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE,
* EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmp_ntp/snmp_ntp.c,v 1.7 2005/10/04 11:21:36 brandt_h Exp $
+ * $Begemot: bsnmp/snmp_ntp/snmp_ntp.c,v 1.9 2005/10/06 07:15:01 brandt_h Exp $
*
* NTP interface for SNMPd.
*/
@@ -51,20 +51,11 @@
#include <syslog.h>
#include <unistd.h>
+#include "support.h"
#include "snmpmod.h"
#include "ntp_tree.h"
#include "ntp_oid.h"
-#if !defined(INT32_MIN)
-#define INT32_MIN (-0x7fffffff-1)
-#endif
-#if !defined(INT32_MAX)
-#define INT32_MAX (0x7fffffff)
-#endif
-#if !defined(UINT32_MAX)
-#define UINT32_MAX (0xffffffff)
-#endif
-
#define NTPC_MAX 576
#define NTPC_VERSION 3
#define NTPC_MODE 6
diff --git a/contrib/bsnmp/snmpd/bsnmpd.1 b/contrib/bsnmp/snmpd/bsnmpd.1
index 9da7456..18c46d2 100644
--- a/contrib/bsnmp/snmpd/bsnmpd.1
+++ b/contrib/bsnmp/snmpd/bsnmpd.1
@@ -29,10 +29,10 @@
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
-.\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.9 2005/10/04 08:46:54 brandt_h Exp $
+.\" $Begemot: bsnmp/snmpd/bsnmpd.1,v 1.12 2006/02/27 09:50:03 brandt_h Exp $
.\"
-.Dd October 4, 2005
-.Dt SNMPD 1
+.Dd February 27, 2006
+.Dt BSNMPD 1
.Os
.Sh NAME
.Nm bsnmpd
@@ -49,7 +49,7 @@
.Sh DESCRIPTION
The
.Nm
-daemon servers the internet SNMP (Simple Network Management Protocol).
+daemon server the internet SNMP (Simple Network Management Protocol).
It is intended to serve only the absolute basic MIBs and implement all other
MIBs through loadable modules.
In this way the
@@ -258,9 +258,14 @@ This is the default search path for system include files.
.It Pa @MIBSPATH@BEGEMOT-MIB.txt
.It Pa @MIBSPATH@BEGEMOT-SNMPD.txt
The definitions for the MIBs implemented in the daemon.
+.It Pa /etc/hosts.allow, /etc/hosts.deny
+Access controls that should be enforced by TCP wrappers should be defined here.
+Further details are described in
+.Xr hosts_access 5 .
.El
.Sh SEE ALSO
-.Xr gensnmptree 1
+.Xr gensnmptree 1 ,
+.Xr hosts_access 5
.Sh STANDARDS
The
.Nm
diff --git a/contrib/bsnmp/snmpd/config.c b/contrib/bsnmp/snmpd/config.c
index 0701c41..6480d20 100644
--- a/contrib/bsnmp/snmpd/config.c
+++ b/contrib/bsnmp/snmpd/config.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmpd/config.c,v 1.24 2005/10/04 11:21:37 brandt_h Exp $
+ * $Begemot: bsnmp/snmpd/config.c,v 1.25 2006/02/14 09:04:20 brandt_h Exp $
*
* Parse configuration file.
*/
diff --git a/contrib/bsnmp/snmpd/export.c b/contrib/bsnmp/snmpd/export.c
index 52205e7..9498361 100644
--- a/contrib/bsnmp/snmpd/export.c
+++ b/contrib/bsnmp/snmpd/export.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmpd/export.c,v 1.7 2004/08/06 08:47:11 brandt Exp $
+ * $Begemot: bsnmp/snmpd/export.c,v 1.8 2006/02/14 09:04:20 brandt_h Exp $
*
* Support functions for modules.
*/
diff --git a/contrib/bsnmp/snmpd/main.c b/contrib/bsnmp/snmpd/main.c
index 32ccc45..b183d7f 100644
--- a/contrib/bsnmp/snmpd/main.c
+++ b/contrib/bsnmp/snmpd/main.c
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmpd/main.c,v 1.97 2005/10/04 14:32:45 brandt_h Exp $
+ * $Begemot: bsnmp/snmpd/main.c,v 1.100 2006/02/14 09:04:20 brandt_h Exp $
*
* SNMPd main stuff.
*/
@@ -52,15 +52,12 @@
#include <tcpd.h>
#endif
+#include "support.h"
#include "snmpmod.h"
#include "snmpd.h"
#include "tree.h"
#include "oid.h"
-#if !defined(INT32_MAX)
-#define INT32_MAX (0x7fffffff)
-#endif
-
#define PATH_PID "/var/run/%s.pid"
#define PATH_CONFIG "/etc/%s.config"
@@ -1387,8 +1384,8 @@ main(int argc, char *argv[])
syslog(LOG_ERR,
"no value for 'trace'");
else
- snmp_trace =
- strtoul(value, NULL, 0);
+ snmp_trace = strtoul(value,
+ NULL, 0);
break;
case -1:
diff --git a/contrib/bsnmp/snmpd/snmpd.config b/contrib/bsnmp/snmpd/snmpd.config
index 4b018e8..23db74c 100644
--- a/contrib/bsnmp/snmpd/snmpd.config
+++ b/contrib/bsnmp/snmpd/snmpd.config
@@ -26,7 +26,7 @@
# OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
# SUCH DAMAGE.
#
-# $Begemot: bsnmp/snmpd/snmpd.config,v 1.15 2005/02/25 11:50:43 brandt_h Exp $
+# $Begemot: bsnmp/snmpd/snmpd.config,v 1.16 2006/02/14 09:04:20 brandt_h Exp $
#
# Example configuration file.
#
diff --git a/contrib/bsnmp/snmpd/snmpmod.3 b/contrib/bsnmp/snmpd/snmpmod.3
index ed2717a..3ca067a 100644
--- a/contrib/bsnmp/snmpd/snmpmod.3
+++ b/contrib/bsnmp/snmpd/snmpmod.3
@@ -31,7 +31,7 @@
.\"
.\" $Begemot: bsnmp/snmpd/snmpmod.3,v 1.14 2005/10/04 13:30:35 brandt_h Exp $
.\"
-.Dd October 4, 2005
+.Dd February 27, 2006
.Dt SNMPMOD 3
.Os
.Sh NAME
@@ -85,6 +85,7 @@
.Nm string_commit ,
.Nm string_rollback ,
.Nm string_get ,
+.Nm string_get_max ,
.Nm string_free ,
.Nm ip_save ,
.Nm ip_rollback ,
@@ -197,6 +198,8 @@ Begemot SNMP library
.Fn string_rollback "struct snmp_context *ctx" "u_char **strp"
.Ft int
.Fn string_get "struct snmp_value *val" "const u_char *str" "ssize_t len"
+.Ft int
+.Fn string_get_max "struct snmp_value *val" "const u_char *str" "ssize_t len" "size_t maxlen"
.Ft void
.Fn string_free "struct snmp_context *ctx"
.Ft int
@@ -771,6 +774,10 @@ simply frees the saved old value in the scratch area.
frees the new value, and puts back the old one.
.It Fn string_get
is used for GET or GETNEXT.
+The function
+.It Fn string_get_max
+can be used instead of
+.Nf stringto ensure that the returned string has a certain maximum length.
If
.Fa len
is -1, the length is computed via
diff --git a/contrib/bsnmp/snmpd/snmpmod.h b/contrib/bsnmp/snmpd/snmpmod.h
index 18457bf..5eba370 100644
--- a/contrib/bsnmp/snmpd/snmpmod.h
+++ b/contrib/bsnmp/snmpd/snmpmod.h
@@ -26,7 +26,7 @@
* OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
* SUCH DAMAGE.
*
- * $Begemot: bsnmp/snmpd/snmpmod.h,v 1.31 2005/10/04 13:30:36 brandt_h Exp $
+ * $Begemot: bsnmp/snmpd/snmpmod.h,v 1.32 2006/02/14 09:04:20 brandt_h Exp $
*
* SNMP daemon data and functions exported to modules.
*/
OpenPOWER on IntegriCloud