svn commit: r345798 - head/contrib/bsnmp/snmp_mibII
Andrey V. Elsukov
ae at FreeBSD.org
Tue Sep 3 14:06:24 UTC 2019
Author: ae
Date: Tue Apr 2 13:38:00 2019
New Revision: 345798
URL: https://svnweb.freebsd.org/changeset/base/345798
Log:
Create 64bit mibII counters for all interfaces.
PR: 157015
Obtained from: Yandex LLC
MFC after: 1 month
Modified:
head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
Modified: head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c
==============================================================================
--- head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Tue Apr 2 12:50:01 2019 (r345797)
+++ head/contrib/bsnmp/snmp_mibII/mibII_interfaces.c Tue Apr 2 13:38:00 2019 (r345798)
@@ -373,11 +373,6 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu
switch (op) {
- again:
- if (op != SNMP_OP_GETNEXT)
- return (SNMP_ERR_NOSUCHNAME);
- /* FALLTHROUGH */
-
case SNMP_OP_GETNEXT:
if ((ifp = NEXT_OBJECT_INT(&mibif_list, &value->var, sub)) == NULL)
return (SNMP_ERR_NOSUCHNAME);
@@ -460,52 +455,36 @@ op_ifxtable(struct snmp_context *ctx, struct snmp_valu
break;
case LEAF_ifHCInOctets:
- if (!(ifp->flags & MIBIF_HIGHSPEED))
- goto again;
value->v.counter64 = MIBIF_PRIV(ifp)->hc_inoctets;
break;
case LEAF_ifHCInUcastPkts:
- if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
- goto again;
value->v.counter64 = MIBIF_PRIV(ifp)->hc_ipackets -
MIBIF_PRIV(ifp)->hc_imcasts;
break;
case LEAF_ifHCInMulticastPkts:
- if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
- goto again;
value->v.counter64 = MIBIF_PRIV(ifp)->hc_imcasts;
break;
case LEAF_ifHCInBroadcastPkts:
- if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
- goto again;
value->v.counter64 = 0;
break;
case LEAF_ifHCOutOctets:
- if (!(ifp->flags & MIBIF_HIGHSPEED))
- goto again;
value->v.counter64 = MIBIF_PRIV(ifp)->hc_outoctets;
break;
case LEAF_ifHCOutUcastPkts:
- if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
- goto again;
value->v.counter64 = MIBIF_PRIV(ifp)->hc_opackets -
MIBIF_PRIV(ifp)->hc_omcasts;
break;
case LEAF_ifHCOutMulticastPkts:
- if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
- goto again;
value->v.counter64 = MIBIF_PRIV(ifp)->hc_omcasts;
break;
case LEAF_ifHCOutBroadcastPkts:
- if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
- goto again;
value->v.counter64 = 0;
break;
More information about the svn-src-all
mailing list