View | Details | Raw Unified | Return to bug 157015
Collapse All | Expand All

(-)b/contrib/bsnmp/snmp_mibII/mibII_interfaces.c (-21 lines)
Lines 373-383 op_ifxtable(struct snmp_context *ctx, struct snmp_value *value, Link Here
373
373
374
	switch (op) {
374
	switch (op) {
375
375
376
  again:
377
		if (op != SNMP_OP_GETNEXT)
378
			return (SNMP_ERR_NOSUCHNAME);
379
		/* FALLTHROUGH */
380
381
	  case SNMP_OP_GETNEXT:
376
	  case SNMP_OP_GETNEXT:
382
		if ((ifp = NEXT_OBJECT_INT(&mibif_list, &value->var, sub)) == NULL)
377
		if ((ifp = NEXT_OBJECT_INT(&mibif_list, &value->var, sub)) == NULL)
383
			return (SNMP_ERR_NOSUCHNAME);
378
			return (SNMP_ERR_NOSUCHNAME);
Lines 460-511 op_ifxtable(struct snmp_context *ctx, struct snmp_value *value, Link Here
460
		break;
455
		break;
461
456
462
	  case LEAF_ifHCInOctets:
457
	  case LEAF_ifHCInOctets:
463
		if (!(ifp->flags & MIBIF_HIGHSPEED))
464
			goto again;
465
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_inoctets;
458
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_inoctets;
466
		break;
459
		break;
467
460
468
	  case LEAF_ifHCInUcastPkts:
461
	  case LEAF_ifHCInUcastPkts:
469
		if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
470
			goto again;
471
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_ipackets -
462
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_ipackets -
472
		    MIBIF_PRIV(ifp)->hc_imcasts;
463
		    MIBIF_PRIV(ifp)->hc_imcasts;
473
		break;
464
		break;
474
465
475
	  case LEAF_ifHCInMulticastPkts:
466
	  case LEAF_ifHCInMulticastPkts:
476
		if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
477
			goto again;
478
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_imcasts;
467
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_imcasts;
479
		break;
468
		break;
480
469
481
	  case LEAF_ifHCInBroadcastPkts:
470
	  case LEAF_ifHCInBroadcastPkts:
482
		if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
483
			goto again;
484
		value->v.counter64 = 0;
471
		value->v.counter64 = 0;
485
		break;
472
		break;
486
473
487
	  case LEAF_ifHCOutOctets:
474
	  case LEAF_ifHCOutOctets:
488
		if (!(ifp->flags & MIBIF_HIGHSPEED))
489
			goto again;
490
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_outoctets;
475
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_outoctets;
491
		break;
476
		break;
492
477
493
	  case LEAF_ifHCOutUcastPkts:
478
	  case LEAF_ifHCOutUcastPkts:
494
		if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
495
			goto again;
496
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_opackets -
479
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_opackets -
497
		    MIBIF_PRIV(ifp)->hc_omcasts;
480
		    MIBIF_PRIV(ifp)->hc_omcasts;
498
		break;
481
		break;
499
482
500
	  case LEAF_ifHCOutMulticastPkts:
483
	  case LEAF_ifHCOutMulticastPkts:
501
		if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
502
			goto again;
503
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_omcasts;
484
		value->v.counter64 = MIBIF_PRIV(ifp)->hc_omcasts;
504
		break;
485
		break;
505
486
506
	  case LEAF_ifHCOutBroadcastPkts:
487
	  case LEAF_ifHCOutBroadcastPkts:
507
		if (!(ifp->flags & (MIBIF_VERYHIGHSPEED|MIBIF_HIGHSPEED)))
508
			goto again;
509
		value->v.counter64 = 0;
488
		value->v.counter64 = 0;
510
		break;
489
		break;
511
490

Return to bug 157015