// Home | Go Back //
package agent.ifmib;
import java.io.*;
import java.util.*;
import com.ireasoning.util.*;
import com.ireasoning.protocol.snmp.*;
import javax.management.*;
public class IfEntry extends SnmpTableEntry
{
protected int _ifIndex = 0;
protected String _ifDescr = "";
protected int _ifType = 0;
protected int _ifMtu = 0;
protected SnmpGauge32 _ifSpeed = new SnmpGauge32();
protected String _ifPhysAddress = "";
protected int _ifAdminStatus = 0;
protected int _ifOperStatus = 0;
protected SnmpTimeTicks _ifLastChange = new SnmpTimeTicks();
protected SnmpCounter32 _ifInOctets = new SnmpCounter32();
protected SnmpCounter32 _ifInUcastPkts = new SnmpCounter32();
protected SnmpCounter32 _ifInNUcastPkts = new SnmpCounter32();
protected SnmpCounter32 _ifInDiscards = new SnmpCounter32();
protected SnmpCounter32 _ifInErrors = new SnmpCounter32();
protected SnmpCounter32 _ifInUnknownProtos = new SnmpCounter32();
protected SnmpCounter32 _ifOutOctets = new SnmpCounter32();
protected SnmpCounter32 _ifOutUcastPkts = new SnmpCounter32();
protected SnmpCounter32 _ifOutNUcastPkts = new SnmpCounter32();
protected SnmpCounter32 _ifOutDiscards = new SnmpCounter32();
protected SnmpCounter32 _ifOutErrors = new SnmpCounter32();
protected SnmpGauge32 _ifOutQLen = new SnmpGauge32();
protected SnmpOID _ifSpecific = new SnmpOID();
public IfEntry(SnmpTable table)
{
super(table);
}
public IfEntry(SnmpTable table, int ifIndex, String ifDescr, String ifPhysAddress)
{
super(table);
this._ifIndex = ifIndex;
this._ifDescr = ifDescr;
this._ifPhysAddress = ifPhysAddress;
}
public IfEntry( SnmpTable table, int ifIndex, String ifDescr, int ifType, int ifMtu, SnmpGauge32 ifSpeed, String ifPhysAddress, int ifAdminStatus, int ifOperStatus, SnmpTimeTicks ifLastChange, SnmpCounter32 ifInOctets, SnmpCounter32 ifInUcastPkts, SnmpCounter32 ifInNUcastPkts, SnmpCounter32 ifInDiscards, SnmpCounter32 ifInErrors, SnmpCounter32 ifInUnknownProtos, SnmpCounter32 ifOutOctets, SnmpCounter32 ifOutUcastPkts, SnmpCounter32 ifOutNUcastPkts, SnmpCounter32 ifOutDiscards, SnmpCounter32 ifOutErrors, SnmpGauge32 ifOutQLen, SnmpOID ifSpecific)
{
super(table);
this._ifIndex = ifIndex;
this._ifDescr = ifDescr;
this._ifType = ifType;
this._ifMtu = ifMtu;
this._ifSpeed = ifSpeed;
this._ifPhysAddress = ifPhysAddress;
this._ifAdminStatus = ifAdminStatus;
this._ifOperStatus = ifOperStatus;
this._ifLastChange = ifLastChange;
this._ifInOctets = ifInOctets;
this._ifInUcastPkts = ifInUcastPkts;
this._ifInNUcastPkts = ifInNUcastPkts;
this._ifInDiscards = ifInDiscards;
this._ifInErrors = ifInErrors;
this._ifInUnknownProtos = ifInUnknownProtos;
this._ifOutOctets = ifOutOctets;
this._ifOutUcastPkts = ifOutUcastPkts;
this._ifOutNUcastPkts = ifOutNUcastPkts;
this._ifOutDiscards = ifOutDiscards;
this._ifOutErrors = ifOutErrors;
this._ifOutQLen = ifOutQLen;
this._ifSpecific = ifSpecific;
}
public String getIndexSuffix()
{
if(_suffix.length() == 0)
{
_suffix = "." + SnmpTableEntry.getIndexString("" + _ifIndex, false);
}
return _suffix;
}
public void set(int index, SnmpDataType value)
{
switch(index)
{
case 0 :
_ifIndex = ((SnmpInt) value).getValue();
break;
case 1 :
_ifDescr = ((SnmpOctetString)value).toString2();
break;
case 2 :
_ifType = ((SnmpInt) value).getValue();
break;
case 3 :
_ifMtu = ((SnmpInt) value).getValue();
break;
case 4 :
_ifSpeed = (SnmpGauge32) value;
break;
case 5 :
_ifPhysAddress = value.toString();
break;
case 6 :
_ifAdminStatus = ((SnmpInt) value).getValue();
break;
case 7 :
_ifOperStatus = ((SnmpInt) value).getValue();
break;
case 8 :
_ifLastChange = (SnmpTimeTicks) value;
break;
case 9 :
_ifInOctets = (SnmpCounter32) value;
break;
case 10 :
_ifInUcastPkts = (SnmpCounter32) value;
break;
case 11 :
_ifInNUcastPkts = (SnmpCounter32) value;
break;
case 12 :
_ifInDiscards = (SnmpCounter32) value;
break;
case 13 :
_ifInErrors = (SnmpCounter32) value;
break;
case 14 :
_ifInUnknownProtos = (SnmpCounter32) value;
break;
case 15 :
_ifOutOctets = (SnmpCounter32) value;
break;
case 16 :
_ifOutUcastPkts = (SnmpCounter32) value;
break;
case 17 :
_ifOutNUcastPkts = (SnmpCounter32) value;
break;
case 18 :
_ifOutDiscards = (SnmpCounter32) value;
break;
case 19 :
_ifOutErrors = (SnmpCounter32) value;
break;
case 20 :
_ifOutQLen = (SnmpGauge32) value;
break;
case 21 :
_ifSpecific = (SnmpOID) value;
break;
}
}
}