1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-14 10:09:48 +00:00

Virgin import of bsnmp 1.9

This commit is contained in:
Hartmut Brandt 2005-04-26 16:43:22 +00:00
parent 94caccb357
commit d7eb6b4714
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/vendor/bsnmp/dist/; revision=145557
10 changed files with 3127 additions and 5 deletions

View File

@ -1,3 +1,8 @@
1.9
tcpwrapper support from glebius@freebsd.org.
crude interface to NTP: snmp_ntp
1.8
many man page fixes from ru@freebsd.org and tobez@freebsd.org
@ -7,6 +12,10 @@
snmpd/trans_lsock.c: include stdio.h to get a prototype for remove.
gensnmptree/gensnmptree.c: fix a compile error
snmp_mibII: add new field spec_oid to ifmib. This allows ifType
specific modules to insert the value to be returned for ifSpecific.
1.7a
fix core dump when config file cannot be opened (submitted by
Maxim Konovalov)

View File

@ -1 +1 @@
1.8
1.9

View File

@ -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.41 2005/02/25 11:51:12 brandt_h Exp $
* $Begemot: bsnmp/gensnmptree/gensnmptree.c,v 1.42 2005/04/26 16:26:19 brandt_h Exp $
*
* Generate OID table from table description.
*
@ -163,7 +163,7 @@ xalloc(size_t size)
void *ptr;
if ((ptr = malloc(size)) == NULL)
err(1, "allocing %u bytes", size);
err(1, "allocing %zu bytes", size);
return (ptr);
}

View File

@ -1,4 +1,4 @@
$Begemot: bsnmp/oid-list,v 1.1 2005/02/25 12:21:00 brandt_h Exp $
$Begemot: bsnmp/oid-list,v 1.2 2005/04/25 11:49:28 brandt_h Exp $
This file documents the OID assignments under BSNMP's private OID.
@ -14,6 +14,7 @@ enterprises
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
If you need an OID and don't know where to stuck it in, I can assign you one -
just drop me a mail.

View File

@ -0,0 +1,117 @@
--
-- Copyright (c) 2005
-- 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_ntp/BEGEMOT-NTP-MIB.txt,v 1.2 2005/04/26 13:38:01 brandt_h Exp $
--
-- Private MIB for NTP module.
--
BEGEMOT-NTP-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, TimeTicks, Unsigned32, Counter64
FROM SNMPv2-SMI
begemot
FROM BEGEMOT-MIB;
begemotNtp MODULE-IDENTITY
LAST-UPDATED "200503210000Z"
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 the NTP control module for SNMP."
::= { begemot 201 }
begemotNtpObjects OBJECT IDENTIFIER ::= { begemotNtp 1 }
begemotNtpHost OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The name of the host where the NTP daemon is running that
is to be connected."
::= { begemotNtpObjects 1 }
begemotNtpPort OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The port of the host where the NTP daemon is running that
is to be connected."
::= { begemotNtpObjects 2 }
begemotNtpTimeout OBJECT-TYPE
SYNTAX TimeTicks
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"The number of ticks to wait for the response from the NTP
daemon to complete."
::= { begemotNtpObjects 3 }
begemotNtpDebug OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-write
STATUS current
DESCRIPTION
"Debug flags. The following flags are currently used:
0x01 - produce a dump of all received/sent NTP packets.
0x02 - print the variable names and values return by the daemon
Other bits are ignored."
::= { begemotNtpObjects 4 }
begemotNtpJitter OBJECT-TYPE
SYNTAX Counter64
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Current jitter in seconds multiplied by 2^32."
::= { begemotNtpObjects 5 }
begemotNtpStability OBJECT-TYPE
SYNTAX Counter64
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"Current stability in ppm multiplied by 2^32."
::= { begemotNtpObjects 6 }
END

View File

@ -0,0 +1,627 @@
--
-- NTP MIB, Revision 0.2, 7/25/97
--
NTP-MIB DEFINITIONS ::= BEGIN
IMPORTS
Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32,
enterprises
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, TruthValue
FROM SNMPv2-TC;
ntpMIB MODULE-IDENTITY
LAST-UPDATED "199707251530Z"
ORGANIZATION
"University of Delaware"
CONTACT-INFO
"Adarsh Sethi
Department of Computer & Information Sciences
University of Delaware
Newark, DE 19716
Tel: +1 302 831 1945
E-mail: sethi@cis.udel.edu
David Mills
Department of Electrical Engineering
University of Delaware
Newark, DE 19716
Tel: +1 302 831 ????
E-mail: mills@ee.udel.edu"
DESCRIPTION
"This MIB module defines a MIB which provides mechanisms to
monitor and control an NTP server."
::= { udel 3 }
--
-- Position within the OID hierarchy of this MIB:
--
udel OBJECT IDENTIFIER
::= { enterprises 1277 }
--
-- The various groups defined within this MIB definition:
--
ntpSystem OBJECT IDENTIFIER
::= { ntpMIB 1 }
ntpPeers OBJECT IDENTIFIER
::= { ntpMIB 2 }
ntpFilter OBJECT IDENTIFIER
::= { ntpMIB 3 }
--
-- Textual conventions:
--
NTPTimeStamp ::= TEXTUAL-CONVENTION
DISPLAY-HINT "4x.4x"
STATUS current
DESCRIPTION
""
SYNTAX OCTET STRING (SIZE(8))
NTPLeapIndicator ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
""
SYNTAX INTEGER {
noWarning(0),
addSecond(1),
subtractSecond(2),
alarm(3) }
--
-- System Group
--
ntpSysLeap OBJECT-TYPE
SYNTAX NTPLeapIndicator
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" two-bit code warning of an impending leap
second to be inserted in the NTP timescale."
::= { ntpSystem 1 }
ntpSysStratum OBJECT-TYPE
SYNTAX Integer32 (0..255)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" indicating the stratum of the local clock.
0, unspecified
1, primary reference (e.g.,, calibrated atomic clock,
radio clock)
2-255, secondary reference (via NTP)"
::= { ntpSystem 2 }
ntpSysPrecision OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"signed integer indicating the precision
of the various clocks, in seconds to the nearest power
of two."
::= { ntpSystem 3 }
ntpSysRootDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the total roundtrip delay to the primary
reference source at the root of the synchronization
subnet, in seconds"
::= { ntpSystem 4 }
ntpSysRootDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the maximum error relative to the primary
reference source at the root of the synchronization
subnet, in seconds. Only positive values greater
than zero are possible"
::= { ntpSystem 5 }
ntpSysRefId OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the particular reference clock. In the case of
stratum 0 (unspecified) or stratum 1 (primary reference
source), this is a four-octet, left-justified,zero-padded
ASCII string.In the case of stratum 2 and greater (secondary
reference) this is the four-octet Internet address of the
peer selected for synchronization."
::= { ntpSystem 6 }
ntpSysRefTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the local time when the local clock was last
updated. If the local clock has neverbeen synchronized,
the value is zero."
::= { ntpSystem 7 }
ntpSysPoll OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the minimum interval between transmitted
messages, in seconds as a power of two. For instance,
a value of six indicates a minimum interval of 64 seconds."
::= { ntpSystem 8 }
ntpSysPeer OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the current synchronization source. Usually
this will be a pointer to a structure containing the peer
variables. The special value NULL indicates there is no
currently valid synchronization source."
::= { ntpSystem 9 }
ntpSysPhase OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpSystem 10 }
ntpSysFreq OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpSystem 11 }
ntpSysError OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpSystem 12 }
ntpSysClock OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the current local time. Local time is derived
from the hardware clock of the particular machine and
increments at intervals depending on the design used."
::= { ntpSystem 13 }
ntpSysSystem OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the type of the local Operating System"
::= { ntpSystem 14 }
ntpSysProcessor OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the type of the local Processor"
::= { ntpSystem 15 }
--
-- Peers Group
--
--
-- Peer Variables Table
--
ntpPeersVarTable OBJECT-TYPE
SYNTAX SEQUENCE OF NtpPeersVarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpPeers 1 }
ntpPeersVarEntry OBJECT-TYPE
SYNTAX NtpPeersVarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { ntpPeersAssocId }
::= { ntpPeersVarTable 1 }
NtpPeersVarEntry ::= SEQUENCE {
ntpPeersAssocId Unsigned32,
ntpPeersConfigured TruthValue,
ntpPeersPeerAddress IpAddress,
ntpPeersPeerPort Unsigned32,
ntpPeersHostAddress IpAddress,
ntpPeersHostPort Unsigned32,
ntpPeersLeap NTPLeapIndicator,
ntpPeersMode INTEGER,
ntpPeersStratum Integer32,
ntpPeersPeerPoll Integer32,
ntpPeersHostPoll Integer32,
ntpPeersPrecision Integer32,
ntpPeersRootDelay OCTET STRING,
ntpPeersRootDispersion OCTET STRING,
ntpPeersRefId OCTET STRING,
ntpPeersRefTime NTPTimeStamp,
ntpPeersOrgTime NTPTimeStamp,
ntpPeersReceiveTime NTPTimeStamp,
ntpPeersTransmitTime NTPTimeStamp,
ntpPeersUpdateTime NTPTimeStamp,
ntpPeersReach Unsigned32,
ntpPeersTimer Integer32,
ntpPeersOffset OCTET STRING,
ntpPeersDelay OCTET STRING,
ntpPeersDispersion OCTET STRING
}
ntpPeersAssocId OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpPeersVarEntry 1 }
ntpPeersConfigured OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" This is a bit indicating that the association
was created from configuration information and should not
be demobilized if the peer becomes unreachable."
::= { ntpPeersVarEntry 2 }
ntpPeersPeerAddress OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the Internet address of the peer"
::= { ntpPeersVarEntry 3 }
ntpPeersPeerPort OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" 16-bit port number of the peer."
::= { ntpPeersVarEntry 4 }
ntpPeersHostAddress OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the Internet address of the host"
::= { ntpPeersVarEntry 5 }
ntpPeersHostPort OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" 16-bit port number of the host"
::= { ntpPeersVarEntry 6 }
ntpPeersLeap OBJECT-TYPE
SYNTAX NTPLeapIndicator
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" two-bit code warning of an impending leap
second to be inserted in the NTP timescale."
::= { ntpPeersVarEntry 7 }
ntpPeersMode OBJECT-TYPE
SYNTAX INTEGER {
unspecified(0),
symmetricActive(1),
symmetricPassive(2),
client(3),
server(4),
broadcast(5),
reservedControl(6),
reservedPrivate(7)
}
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the association mode,with values coded as
follows:
0, unspecified
1, symmetric active
2, symmetric passive
3, client
4, server
5, broadcast
6, reserved for NTP control messages
7, reserved for private use
"
::= { ntpPeersVarEntry 8 }
ntpPeersStratum OBJECT-TYPE
SYNTAX Integer32 (0..255)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" indicating the stratum of the peer clock.
0, unspecified
1, primary reference (e.g.,, calibrated atomic clock,
radio clock)
2-255, secondary reference (via NTP)"
::= { ntpPeersVarEntry 9 }
ntpPeersPeerPoll OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"poll interval of the peer"
::= { ntpPeersVarEntry 10 }
ntpPeersHostPoll OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"poll interval of the host"
::= { ntpPeersVarEntry 11 }
ntpPeersPrecision OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the same as the systemPrecision except this is
for the peer"
::= { ntpPeersVarEntry 12 }
ntpPeersRootDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the same as the systemRootDealy except this is for
the peer"
::= { ntpPeersVarEntry 13 }
ntpPeersRootDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the same as the systemDispersion except this is for
the peer"
::= { ntpPeersVarEntry 14 }
ntpPeersRefId OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the same as the systemRefid except this is for
the peer"
::= { ntpPeersVarEntry 15 }
ntpPeersRefTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the same as the systemRefTime except this is for
the peer"
::= { ntpPeersVarEntry 16 }
ntpPeersOrgTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" the local time at the peer when its latest
NTP message was sent. If the peer becomes unreachable the
value is set to zero."
::= { ntpPeersVarEntry 17 }
ntpPeersReceiveTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the local time when the latest NTP message
from the peer arrived. If the peer becomes unreachable the
value is set to zero."
::= { ntpPeersVarEntry 18 }
ntpPeersTransmitTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the local time at which the NTP message
departed the sender."
::= { ntpPeersVarEntry 19 }
ntpPeersUpdateTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
" "
::= { ntpPeersVarEntry 20 }
ntpPeersReach OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"a shift register of NTP.WINDOW bits used to determine
the reachability status of the peer, with bits entering
from the least significant (rightmost) end. A peer is
considered reachable if at least one bit in this register is
set to one."
::= { ntpPeersVarEntry 21 }
ntpPeersTimer OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpPeersVarEntry 22 }
ntpPeersOffset OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpPeersVarEntry 23 }
ntpPeersDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpPeersVarEntry 24 }
ntpPeersDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpPeersVarEntry 25 }
--
-- Filter Group
--
-- Implementation of this group is optional. It must be implemented
-- when the filter and selection algorithms described in Section 4
-- of RFC 1305 are used.
--
--
-- Filter Group Peer Variables Table
--
ntpFilterPeersVarTable OBJECT-TYPE
SYNTAX SEQUENCE OF NtpFilterPeersVarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
"This table is an extension of the Peer Variables Table
in the Peer Group."
::= { ntpFilter 1 }
ntpFilterPeersVarEntry OBJECT-TYPE
SYNTAX NtpFilterPeersVarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
AUGMENTS { ntpPeersVarEntry }
::= { ntpFilterPeersVarTable 1 }
NtpFilterPeersVarEntry ::= SEQUENCE {
ntpFilterValidEntries Integer32
}
ntpFilterValidEntries OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The number of valid entries for a peer in the Filter Register Table."
::= { ntpFilterPeersVarEntry 1 }
--
-- Filter Register Table
--
ntpFilterRegisterTable OBJECT-TYPE
SYNTAX SEQUENCE OF NtpFilterRegisterEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpFilter 2 }
ntpFilterRegisterEntry OBJECT-TYPE
SYNTAX NtpFilterRegisterEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { ntpPeersAssocId, ntpFilterIndex }
::= { ntpFilterRegisterTable 1 }
NtpFilterRegisterEntry ::= SEQUENCE {
ntpFilterIndex Unsigned32,
ntpFilterPeersOffset OCTET STRING,
ntpFilterPeersDelay OCTET STRING,
ntpFilterPeersDispersion OCTET STRING
}
ntpFilterIndex OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpFilterRegisterEntry 1 }
ntpFilterPeersOffset OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the offset of the peer clock relative to the
local clock in seconds"
::= { ntpFilterRegisterEntry 2 }
ntpFilterPeersDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"roundtrip delay of the peer clock relative to the
local clock over the network path between them, in seconds.
this variable can take on both positive and negative values,
depending on clock precision and skew-error accumulation."
::= { ntpFilterRegisterEntry 3 }
ntpFilterPeersDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"the maximum error of the peer clock relative to the
local clock over the network path between them, in seconds.
Only positive values greater than zero are possible."
::= { ntpFilterRegisterEntry 4 }
END

View File

@ -0,0 +1,616 @@
--
-- NTP Proxy MIB, Revision 0.2, 7/25/97
--
NTP-PROXY-MIB DEFINITIONS ::= BEGIN
IMPORTS
NTPLeapIndicator, NTPTimeStamp
FROM NTP-MIB
Integer32, IpAddress, MODULE-IDENTITY, OBJECT-TYPE, Unsigned32,
enterprises
FROM SNMPv2-SMI
TEXTUAL-CONVENTION, TruthValue
FROM SNMPv2-TC;
ntpProxyMIB MODULE-IDENTITY
LAST-UPDATED "199707251540Z"
ORGANIZATION
"University of Delaware"
CONTACT-INFO
"Adarsh Sethi
Department of Computer & Information Sciences
University of Delaware
Newark, DE 19716
Tel: +1 302 831 1945
E-mail: sethi@cis.udel.edu
David Mills
Department of Electrical Engineering
University of Delaware
Newark, DE 19716
Tel: +1 302 831 ????
E-mail: mills@ee.udel.edu"
DESCRIPTION
"This MIB module defines a MIB which provides mechanisms to
monitor and control many NTP servers via a Proxy Agent."
::= { enterprises 1277 4 }
--
-- The position within the OID hierarchy of this MIB:
--
udel OBJECT IDENTIFIER
::= { enterprises 1277 }
--
-- The various groups defined within this MIB definition:
--
ntpProxyControl OBJECT IDENTIFIER
::= { ntpProxyMIB 1 }
--
-- Textual conventions:
--
NTPRowStatus ::= TEXTUAL-CONVENTION
STATUS current
DESCRIPTION
"The NTPRowStatus textual convention is modeled after the
RowStatus textual convention of RFC 1903, but is simpler
because it only allows one create operation (the create-
and-go of RowStatus) and does not allow row deletion. If
the state of the status column is `notInService' and the
management station tries to set it to `create', the
corresponding row is created and the operation is successful.
If the set to `create' is attempted when the status column
is in state `active', the operation fails and inconsistentValue
is returned. A management station is not permitted to delete
the conceptual row; deletion is carried out by the agent
in an autonomous manner."
SYNTAX INTEGER {
-- the following values are states:
-- these values may be read, but not written
active(1),
notInService(2),
-- the following value is an action:
-- this value may be written, but is never read
create(3)
}
--
-- Control group
--
--
-- ProxyControl Table
--
ntpProxyControlTable OBJECT-TYPE
SYNTAX SEQUENCE OF NtpProxyControlEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpProxyControl 1 }
ntpProxyControlEntry OBJECT-TYPE
SYNTAX NtpProxyControlEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { ntpProxyServerIPAddr }
::= { ntpProxyControlTable 1 }
NtpProxyControlEntry ::= SEQUENCE {
ntpProxyServerIPAddr IpAddress,
ntpProxyControlStatus NTPRowStatus
}
ntpProxyServerIPAddr OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpProxyControlEntry 1 }
ntpProxyControlStatus OBJECT-TYPE
SYNTAX NTPRowStatus
MAX-ACCESS read-create
STATUS current
DESCRIPTION
""
::= { ntpProxyControlEntry 2 }
--
-- Proxy Server System Table
--
ntpProxyServerSystemTable OBJECT-TYPE
SYNTAX SEQUENCE OF NtpProxyServerSystemEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpProxyControl 2 }
ntpProxyServerSystemEntry OBJECT-TYPE
SYNTAX NtpProxyServerSystemEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { ntpProxyServerIPAddr }
::= { ntpProxyServerSystemTable 1 }
NtpProxyServerSystemEntry ::= SEQUENCE {
ntpProxyServerSysLeap NTPLeapIndicator,
ntpProxyServerSysStratum Integer32,
ntpProxyServerSysPrecision Integer32,
ntpProxyServerSysRootDelay OCTET STRING,
ntpProxyServerSysRootDispersion OCTET STRING,
ntpProxyServerSysRefId OCTET STRING,
ntpProxyServerSysRefTime NTPTimeStamp,
ntpProxyServerSysPoll Integer32,
ntpProxyServerSysPeer Unsigned32,
ntpProxyServerSysPhase OCTET STRING,
ntpProxyServerSysFreq OCTET STRING,
ntpProxyServerSysError OCTET STRING,
ntpProxyServerSysClock NTPTimeStamp,
ntpProxyServerSysSystem OCTET STRING,
ntpProxyServerSysProcessor OCTET STRING
}
ntpProxyServerSysLeap OBJECT-TYPE
SYNTAX NTPLeapIndicator
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 1 }
ntpProxyServerSysStratum OBJECT-TYPE
SYNTAX Integer32 (0..255)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 2 }
ntpProxyServerSysPrecision OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 3 }
ntpProxyServerSysRootDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 4 }
ntpProxyServerSysRootDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 5 }
ntpProxyServerSysRefId OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 6 }
ntpProxyServerSysRefTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 7 }
ntpProxyServerSysPoll OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 8 }
ntpProxyServerSysPeer OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 9 }
ntpProxyServerSysPhase OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 10 }
ntpProxyServerSysFreq OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 11 }
ntpProxyServerSysError OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 12 }
ntpProxyServerSysClock OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 13 }
ntpProxyServerSysSystem OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 14 }
ntpProxyServerSysProcessor OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyServerSystemEntry 15 }
--
-- Proxy Peer Variables Table
--
ntpProxyPeersVarTable OBJECT-TYPE
SYNTAX SEQUENCE OF NtpProxyPeersVarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpProxyControl 3 }
ntpProxyPeersVarEntry OBJECT-TYPE
SYNTAX NtpProxyPeersVarEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { ntpProxyServerIPAddr, ntpProxyPeersAssocId }
::= { ntpProxyPeersVarTable 1 }
NtpProxyPeersVarEntry ::= SEQUENCE {
ntpProxyPeersAssocId Unsigned32,
ntpProxyPeersConfigured TruthValue,
ntpProxyPeersPeerAddress IpAddress,
ntpProxyPeersPeerPort Unsigned32,
ntpProxyPeersHostAddress IpAddress,
ntpProxyPeersHostPort Unsigned32,
ntpProxyPeersLeap NTPLeapIndicator,
ntpProxyPeersMode INTEGER,
ntpProxyPeersStratum Integer32,
ntpProxyPeersPeerPoll Integer32,
ntpProxyPeersHostPoll Integer32,
ntpProxyPeersPrecision Integer32,
ntpProxyPeersRootDelay OCTET STRING,
ntpProxyPeersRootDispersion OCTET STRING,
ntpProxyPeersRefId OCTET STRING,
ntpProxyPeersRefTime NTPTimeStamp,
ntpProxyPeersOrgTime NTPTimeStamp,
ntpProxyPeersReceiveTime NTPTimeStamp,
ntpProxyPeersTransmitTime NTPTimeStamp,
ntpProxyPeersUpdateTime NTPTimeStamp,
ntpProxyPeersReach Unsigned32,
ntpProxyPeersTimer Integer32,
ntpProxyPeersOffset OCTET STRING,
ntpProxyPeersDelay OCTET STRING,
ntpProxyPeersDispersion OCTET STRING,
ntpProxyPeersFilterValidEntries Integer32
}
ntpProxyPeersAssocId OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 1 }
ntpProxyPeersConfigured OBJECT-TYPE
SYNTAX TruthValue
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 2 }
ntpProxyPeersPeerAddress OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 3 }
ntpProxyPeersPeerPort OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 4 }
ntpProxyPeersHostAddress OBJECT-TYPE
SYNTAX IpAddress
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 5 }
ntpProxyPeersHostPort OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 6 }
ntpProxyPeersLeap OBJECT-TYPE
SYNTAX NTPLeapIndicator
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 7 }
ntpProxyPeersMode OBJECT-TYPE
SYNTAX INTEGER {
unspecified(0),
symmetricActive(1),
symmetricPassive(2),
client(3),
server(4),
broadcast(5),
reservedControl(6),
reservedPrivate(7) }
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 8 }
ntpProxyPeersStratum OBJECT-TYPE
SYNTAX Integer32 (0..255)
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 9 }
ntpProxyPeersPeerPoll OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 10 }
ntpProxyPeersHostPoll OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 11 }
ntpProxyPeersPrecision OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 12 }
ntpProxyPeersRootDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 13 }
ntpProxyPeersRootDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 14 }
ntpProxyPeersRefId OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 15 }
ntpProxyPeersRefTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 16 }
ntpProxyPeersOrgTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 17 }
ntpProxyPeersReceiveTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 18 }
ntpProxyPeersTransmitTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 19 }
ntpProxyPeersUpdateTime OBJECT-TYPE
SYNTAX NTPTimeStamp
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 20 }
ntpProxyPeersReach OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 21 }
ntpProxyPeersTimer OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 22 }
ntpProxyPeersOffset OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 23 }
ntpProxyPeersDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 24 }
ntpProxyPeersDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyPeersVarEntry 25 }
ntpProxyPeersFilterValidEntries OBJECT-TYPE
SYNTAX Integer32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
"The number of valid entries for a peer in the Proxy Filter
Register Table. This number can be zero."
::= { ntpProxyPeersVarEntry 26 }
--
-- Proxy Filter Register Table
--
ntpProxyFilterRegisterTable OBJECT-TYPE
SYNTAX SEQUENCE OF NtpProxyFilterRegisterEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpProxyControl 4 }
ntpProxyFilterRegisterEntry OBJECT-TYPE
SYNTAX NtpProxyFilterRegisterEntry
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
INDEX { ntpProxyServerIPAddr, ntpProxyPeersAssocId,
ntpProxyFilterIndex }
::= { ntpProxyFilterRegisterTable 1 }
NtpProxyFilterRegisterEntry ::= SEQUENCE {
ntpProxyFilterIndex Unsigned32,
ntpProxyFilterPeersOffset OCTET STRING,
ntpProxyFilterPeersDelay OCTET STRING,
ntpProxyFilterPeersDispersion OCTET STRING
}
ntpProxyFilterIndex OBJECT-TYPE
SYNTAX Unsigned32
MAX-ACCESS not-accessible
STATUS current
DESCRIPTION
""
::= { ntpProxyFilterRegisterEntry 1 }
ntpProxyFilterPeersOffset OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyFilterRegisterEntry 2 }
ntpProxyFilterPeersDelay OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyFilterRegisterEntry 3 }
ntpProxyFilterPeersDispersion OBJECT-TYPE
SYNTAX OCTET STRING
MAX-ACCESS read-only
STATUS current
DESCRIPTION
""
::= { ntpProxyFilterRegisterEntry 4 }
END

View File

@ -0,0 +1,122 @@
#
# Copyright (c) 2005
# Hartmut Brandt.
# All rights reserved.
#
# Author: Harti Brandt <harti@freebsd.org>
#
# Redistribution of this software and documentation 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 or documentation 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 AND DOCUMENTATION IS PROVIDED BY FRAUNHOFER FOKUS
# AND ITS 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
# FRAUNHOFER FOKUS OR ITS 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_ntp/ntp_tree.def,v 1.2 2005/04/26 13:38:01 brandt_h Exp $
#
# Definition of the tree implemented by snmp_ntp.
#
(1 internet
(4 private
(1 enterprises
(1277 udel
(3 ntpMIB
(1 ntpSystem
(1 ntpSysLeap INTEGER op_ntpSystem GET)
(2 ntpSysStratum INTEGER op_ntpSystem GET)
(3 ntpSysPrecision INTEGER32 op_ntpSystem GET)
(4 ntpSysRootDelay OCTETSTRING op_ntpSystem GET)
(5 ntpSysRootDispersion OCTETSTRING op_ntpSystem GET)
(6 ntpSysRefId OCTETSTRING op_ntpSystem GET)
(7 ntpSysRefTime OCTETSTRING op_ntpSystem GET)
(8 ntpSysPoll INTEGER32 op_ntpSystem GET)
(9 ntpSysPeer UNSIGNED32 op_ntpSystem GET)
# No idea what these should be
# (10 ntpSysPhase OCTETSTRING op_ntpSystem GET)
# (11 ntpSysFreq OCTETSTRING op_ntpSystem GET)
# (12 ntpSysError OCTETSTRING op_ntpSystem GET)
(13 ntpSysClock OCTETSTRING op_ntpSystem GET)
(14 ntpSysSystem OCTETSTRING op_ntpSystem GET)
(15 ntpSysProcessor OCTETSTRING op_ntpSystem GET)
)
(2 ntpPeers
(1 ntpPeersVarTable
(1 ntpPeersVarEntry : UNSIGNED32 op_ntpPeersVarTable
(1 ntpPeersAssocId UNSIGNED32)
(2 ntpPeersConfigured INTEGER GET)
(3 ntpPeersPeerAddress IPADDRESS GET)
(4 ntpPeersPeerPort UNSIGNED32 GET)
(5 ntpPeersHostAddress IPADDRESS GET)
(6 ntpPeersHostPort UNSIGNED32 GET)
(7 ntpPeersLeap INTEGER GET)
(8 ntpPeersMode INTEGER GET)
(9 ntpPeersStratum INTEGER GET)
(10 ntpPeersPeerPoll INTEGER32 GET)
(11 ntpPeersHostPoll INTEGER32 GET)
(12 ntpPeersPrecision INTEGER32 GET)
(13 ntpPeersRootDelay OCTETSTRING GET)
(14 ntpPeersRootDispersion OCTETSTRING GET)
(15 ntpPeersRefId OCTETSTRING GET)
(16 ntpPeersRefTime OCTETSTRING GET)
(17 ntpPeersOrgTime OCTETSTRING GET)
(18 ntpPeersReceiveTime OCTETSTRING GET)
(19 ntpPeersTransmitTime OCTETSTRING GET)
# No idea what these should be
# (20 ntpPeersUpdateTime OCTETSTRING GET)
(21 ntpPeersReach UNSIGNED32 GET)
(22 ntpPeersTimer INTEGER32 GET)
(23 ntpPeersOffset OCTETSTRING GET)
(24 ntpPeersDelay OCTETSTRING GET)
(25 ntpPeersDispersion OCTETSTRING GET)
)
)
)
(3 ntpFilter
(1 ntpFilterPeersVarTable
(1 ntpFilterPeersVarEntry : UNSIGNED32 op_ntpFilterPeersVarTable
(1 ntpFilterValidEntries INTEGER32 GET)
)
)
(2 ntpFilterRegisterTable
(1 ntpFilterRegisterEntry : UNSIGNED32 UNSIGNED32 op_ntpFilterRegisterTable
(1 ntpFilterIndex UNSIGNED32)
(2 ntpFilterPeersOffset OCTETSTRING GET)
(3 ntpFilterPeersDelay OCTETSTRING GET)
(4 ntpFilterPeersDispersion OCTETSTRING GET)
)
)
)
)
)
(12325 fokus
(1 begemot
(201 begemotNtp
(1 begemotNtpObjects
(1 begemotNtpHost OCTETSTRING op_begemot_ntp GET)
(2 begemotNtpPort OCTETSTRING op_begemot_ntp GET)
(3 begemotNtpTimeout TIMETICKS op_begemot_ntp GET SET)
(4 begemotNtpDebug UNSIGNED32 op_begemot_ntp GET SET)
(5 begemotNtpJitter COUNTER64 op_begemot_ntp GET)
(6 begemotNtpStability COUNTER64 op_begemot_ntp GET)
)
)
)
)
)
)
)

File diff suppressed because it is too large Load Diff

View File

@ -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.90 2005/02/25 11:50:03 brandt_h Exp $
* $Begemot: bsnmp/snmpd/main.c,v 1.91 2005/04/22 12:18:14 brandt_h Exp $
*
* SNMPd main stuff.
*/
@ -46,6 +46,11 @@
#include <dlfcn.h>
#include <inttypes.h>
#ifdef USE_TCPWRAPPERS
#include <arpa/inet.h>
#include <tcpd.h>
#endif
#include "snmpmod.h"
#include "snmpd.h"
#include "tree.h"
@ -167,6 +172,11 @@ options:\n\
-p file specify pid file\n\
";
/* hosts_access(3) request */
#ifdef USE_TCPWRAPPERS
static struct request_info req;
#endif
/* transports */
extern const struct transport_def udp_trans;
extern const struct transport_def lsock_trans;
@ -879,6 +889,9 @@ snmpd_input(struct port_input *pi, struct tport *tport)
int32_t vi;
int ret;
ssize_t slen;
#ifdef USE_TCPWRAPPERS
char client[16];
#endif
/* get input depending on the transport */
if (pi->stream) {
@ -890,6 +903,23 @@ snmpd_input(struct port_input *pi, struct tport *tport)
if (ret == -1)
return (-1);
#ifdef USE_TCPWRAPPERS
/*
* In case of AF_INET{6} peer, do hosts_access(5) check.
*/
if (inet_ntop(pi->peer->sa_family,
&((struct sockaddr_in *)pi->peer)->sin_addr, client,
sizeof(client)) != NULL) {
request_set(&req, RQ_CLIENT_ADDR, client, 0);
if (hosts_access(&req) == 0) {
syslog(LOG_ERR, "refused connection from %.500s",
eval_client(&req));
return (-1);
}
} else
syslog(LOG_ERR, "inet_ntop(): %m");
#endif
/*
* Handle input
*/
@ -1406,6 +1436,14 @@ main(int argc, char *argv[])
snmp_serial_no = random();
#ifdef USE_TCPWRAPPERS
/*
* Initialize hosts_access(3) handler.
*/
request_init(&req, RQ_DAEMON, "snmpd", 0);
sock_methods(&req);
#endif
/*
* Initialize the tree.
*/