Virgin import of bsnmpd 1.12
This commit is contained in:
parent
c6a4e65805
commit
748b5b1ebd
@ -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
|
||||
|
@ -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:
|
||||
|
@ -1 +1 @@
|
||||
1.11
|
||||
1.12
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*
|
||||
|
@ -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 *, ...);
|
||||
|
||||
|
@ -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
|
||||
*/
|
||||
|
@ -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;
|
||||
|
||||
|
@ -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
|
||||
|
@ -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 -
|
||||
|
61
contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt
Normal file
61
contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt
Normal file
@ -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
|
90
contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt
Normal file
90
contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt
Normal file
@ -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
|
@ -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.
|
||||
*/
|
||||
|
@ -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.
|
||||
*/
|
||||
|
103
contrib/bsnmp/snmp_mibII/mibII_begemot.c
Normal file
103
contrib/bsnmp/snmp_mibII/mibII_begemot.c
Normal file
@ -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();
|
||||
}
|
@ -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.
|
||||
*/
|
||||
|
@ -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"
|
||||
|
||||
|
@ -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.
|
||||
#
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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.
|
||||
*/
|
||||
|
@ -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:
|
||||
|
@ -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.
|
||||
#
|
||||
|
@ -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
|
||||
|
@ -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.
|
||||
*/
|
||||
|
Loading…
Reference in New Issue
Block a user