diff options
author | harti <harti@FreeBSD.org> | 2004-04-14 16:20:14 +0000 |
---|---|---|
committer | harti <harti@FreeBSD.org> | 2004-04-14 16:20:14 +0000 |
commit | 2dce00c891322ea0439dacc8b83fa1965ba5c2dc (patch) | |
tree | 4ab07393a68643de15ecd9eb3d4baa678839c746 /contrib/bsnmp/snmp_mibII | |
parent | c1b6f5303fde40ed2a5a4dfd652664a790b6d77d (diff) | |
download | FreeBSD-src-2dce00c891322ea0439dacc8b83fa1965ba5c2dc.zip FreeBSD-src-2dce00c891322ea0439dacc8b83fa1965ba5c2dc.tar.gz |
Import of bsnmpd 1.6
Diffstat (limited to 'contrib/bsnmp/snmp_mibII')
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII.c | 4 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII_interfaces.c | 7 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/mibII_ipaddr.c | 36 | ||||
-rw-r--r-- | contrib/bsnmp/snmp_mibII/snmp_mibII.3 | 14 |
4 files changed, 28 insertions, 33 deletions
diff --git a/contrib/bsnmp/snmp_mibII/mibII.c b/contrib/bsnmp/snmp_mibII/mibII.c index ae38b6f..29b0399 100644 --- a/contrib/bsnmp/snmp_mibII/mibII.c +++ b/contrib/bsnmp/snmp_mibII/mibII.c @@ -30,7 +30,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_mibII/mibII.c,v 1.17 2003/12/03 10:01:19 hbb Exp $ + * $Begemot: bsnmp/snmp_mibII/mibII.c,v 1.18 2004/04/13 14:58:46 novo Exp $ * * Implementation of the standard interfaces and ip MIB. */ @@ -466,7 +466,7 @@ get_physaddr(struct mibif *ifp, struct sockaddr_dl *sdl, u_char *ptr) if (sdl->sdl_alen == 0) { /* no address */ - if (ifp->physaddrlen != NULL) { + if (ifp->physaddrlen != 0) { if ((rcv = mib_find_rcvaddr(ifp->index, ifp->physaddr, ifp->physaddrlen)) != NULL) mib_rcvaddr_delete(rcv); diff --git a/contrib/bsnmp/snmp_mibII/mibII_interfaces.c b/contrib/bsnmp/snmp_mibII/mibII_interfaces.c index a0023bd..38811e4 100644 --- a/contrib/bsnmp/snmp_mibII/mibII_interfaces.c +++ b/contrib/bsnmp/snmp_mibII/mibII_interfaces.c @@ -30,7 +30,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_mibII/mibII_interfaces.c,v 1.10 2003/12/03 10:01:19 hbb Exp $ + * $Begemot: bsnmp/snmp_mibII/mibII_interfaces.c,v 1.12 2004/04/13 15:19:59 novo Exp $ * * Interfaces group. */ @@ -132,6 +132,9 @@ ifchange_func(struct snmp_context *ctx __unused, struct snmp_dependency *dep, ifp->trap_enable = ifc->rb_traps; return (SNMP_ERR_NOERROR); + case SNMP_DEPOP_FINISH: + return (SNMP_ERR_NOERROR); + } abort(); } @@ -470,7 +473,7 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_value *value, case LEAF_ifHCOutOctets: if (!(ifp->flags & MIBIF_HIGHSPEED)) goto again; - value->v.counter64 = ifp->hc_inoctets; + value->v.counter64 = ifp->hc_outoctets; break; case LEAF_ifHCOutUcastPkts: diff --git a/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c b/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c index a0050f6..49d14a3 100644 --- a/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c +++ b/contrib/bsnmp/snmp_mibII/mibII_ipaddr.c @@ -30,7 +30,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_mibII/mibII_ipaddr.c,v 1.7 2003/12/03 10:01:19 hbb Exp $ + * $Begemot: bsnmp/snmp_mibII/mibII_ipaddr.c,v 1.8 2004/04/13 14:58:46 novo Exp $ * * IP address table. This table is writeable! * @@ -138,35 +138,16 @@ modify(struct update *upd, struct mibifa *ifa) } /* - * Remove an IP address from an interface. This is called when - * the SET finishes. - */ -static void -destroy_func(struct snmp_context *ctx __unused, int fail __unused, void *arg) -{ - struct mibifa *ifa = arg; - - if (ifa->flags & MIBIFA_DESTROYED) { - TAILQ_REMOVE(&mibifa_list, ifa, link); - free(ifa); - } -} - -/* * Destroy the given row in the table. We remove the address from the * system, but keep the structure around for the COMMIT. It's deleted - * only in the finish function. + * only in the FINISH operation. */ static int -destroy(struct snmp_context *ctx, struct update *upd, struct mibifa *ifa) +destroy(struct snmp_context *ctx __unused, struct update *upd, + struct mibifa *ifa) { if (mib_destroy_ifa(ifa)) return (SNMP_ERR_GENERR); - if (snmp_set_atfinish(ctx, destroy_func, ifa)) { - syslog(LOG_ERR, "atfinish: %m"); - mib_undestroy_ifa(ifa); - return (SNMP_ERR_GENERR); - } upd->rb |= RB_DESTROY; return (SNMP_ERR_NOERROR); } @@ -219,6 +200,15 @@ update_func(struct snmp_context *ctx, struct snmp_dependency *dep, return (SNMP_ERR_NOERROR); } return (SNMP_ERR_NOERROR); + + case SNMP_DEPOP_FINISH: + if ((upd->rb & RB_DESTROY) && + (ifa = mib_find_ifa(upd->addr)) != NULL && + (ifa->flags & MIBIFA_DESTROYED)) { + TAILQ_REMOVE(&mibifa_list, ifa, link); + free(ifa); + } + return (SNMP_ERR_NOERROR); } abort(); } diff --git a/contrib/bsnmp/snmp_mibII/snmp_mibII.3 b/contrib/bsnmp/snmp_mibII/snmp_mibII.3 index 1d7018a..981ed26 100644 --- a/contrib/bsnmp/snmp_mibII/snmp_mibII.3 +++ b/contrib/bsnmp/snmp_mibII/snmp_mibII.3 @@ -30,12 +30,13 @@ .\" 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/snmp_mibII.3,v 1.2 2003/12/03 10:01:19 hbb Exp $ +.\" $Begemot: bsnmp/snmp_mibII/snmp_mibII.3,v 1.3 2004/04/13 17:01:31 novo Exp $ .\" .Dd August 19, 2002 .Dt snmp_mibII 3 .Os .Sh NAME +.Nm mibII , .Nm mibif_notify_f , .Nm mib_netsock , .Nm mib_if_set_dyn , @@ -61,7 +62,7 @@ .Nm mibif_unnotify .Nd "mib-2 module for snmpd. .Sh LIBRARY -.Pq begemotSnmpdModulePath."mibII" = "/usr/local/lib/snmp_mibII.so" +.Pq begemotSnmpdModulePath."mibII" = "@MODPATH@snmp_mibII.so" .Sh SYNOPSIS .In bsnmp/snmpmod.h .In bsnmp/snmp_mibII.h @@ -116,7 +117,7 @@ The module implements parts of the internet standard MIB-2. Most of the relevant MIBs are implemented. Some of the tables are restricted to be read-only instead of read-write. The exact current implementation can be found in -.Pa /usr/local/include/bsnmp/mibII_tree.def . +.Pa @DEFPATH@mibII_tree.def . The module also exports a number of functions and global variables for use by other modules, that need to handle network interfaces. This man page describes these functions. @@ -333,11 +334,12 @@ Both functions need the pointers to the interfaces. Entries are automatically deleted if any of the interfaces of the entry is destroyed. The functions handle both the stack table and the reverse stack table. .Sh FILES -.Bl -tag -width ".It Pa /usr/local/include/bsnmp/mibII_tree.def" -compact -.It Pa /usr/local/include/bsnmp/mibII_tree.def +.Bl -tag -width ".It Pa @DEFPATH@mibII_tree.def" -compact +.It Pa @DEFPATH@mibII_tree.def The description of the MIB tree implemented by .Nm . .It Pa /usr/local/share/snmp/mibs +.It Pa @MIBSPATH@ The various internet MIBs. .Sh SEE ALSO .Xr snmpmod 3 , @@ -345,4 +347,4 @@ The various internet MIBs. .Sh STANDARDS This implementation conforms to the applicable IETF RFCs. .Sh AUTHORS -.An Hartmut Brandt Aq brandt@fokus.gmd.de +.An Hartmut Brandt Aq harti@freebsd.org |