diff options
Diffstat (limited to 'contrib/bsnmp/snmp_mibII')
-rw-r--r-- | contrib/bsnmp/snmp_mibII/BEGEMOT-IP-MIB.txt | 61 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/BEGEMOT-MIB2-MIB.txt | 90 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII.c | 2 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII.h | 2 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII_begemot.c | 103 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII_interfaces.c | 2 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII_route.c | 9 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII_tree.def | 2 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/snmp_mibII.h | 2 |
9 files changed, 267 insertions, 6 deletions
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. */ |