// 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 IfXEntry extends SnmpTableEntry
{
protected String _ifName = "";
protected SnmpCounter32 _ifInMulticastPkts = new SnmpCounter32();
protected SnmpCounter32 _ifInBroadcastPkts = new SnmpCounter32();
protected SnmpCounter32 _ifOutMulticastPkts = new SnmpCounter32();
protected SnmpCounter32 _ifOutBroadcastPkts = new SnmpCounter32();
protected SnmpCounter64 _ifHCInOctets = new SnmpCounter64();
protected SnmpCounter64 _ifHCInUcastPkts = new SnmpCounter64();
protected SnmpCounter64 _ifHCInMulticastPkts = new SnmpCounter64();
protected SnmpCounter64 _ifHCInBroadcastPkts = new SnmpCounter64();
protected SnmpCounter64 _ifHCOutOctets = new SnmpCounter64();
protected SnmpCounter64 _ifHCOutUcastPkts = new SnmpCounter64();
protected SnmpCounter64 _ifHCOutMulticastPkts = new SnmpCounter64();
protected SnmpCounter64 _ifHCOutBroadcastPkts = new SnmpCounter64();
protected int _ifLinkUpDownTrapEnable = 0;
protected SnmpGauge32 _ifHighSpeed = new SnmpGauge32();
protected int _ifPromiscuousMode = 0;
protected int _ifConnectorPresent = 0;
protected String _ifAlias = "";
public IfXEntry(SnmpTable table)
{
super(table);
}
public IfXEntry( SnmpTable table, String ifName)
{
super(table);
this._ifName = ifName;
}
public IfXEntry( SnmpTable table, String ifName, SnmpCounter32 ifInMulticastPkts, SnmpCounter32 ifInBroadcastPkts, SnmpCounter32 ifOutMulticastPkts, SnmpCounter32 ifOutBroadcastPkts, SnmpCounter64 ifHCInOctets, SnmpCounter64 ifHCInUcastPkts, SnmpCounter64 ifHCInMulticastPkts, SnmpCounter64 ifHCInBroadcastPkts, SnmpCounter64 ifHCOutOctets, SnmpCounter64 ifHCOutUcastPkts, SnmpCounter64 ifHCOutMulticastPkts, SnmpCounter64 ifHCOutBroadcastPkts, int ifLinkUpDownTrapEnable, SnmpGauge32 ifHighSpeed, int ifPromiscuousMode, int ifConnectorPresent, String ifAlias)
{
super(table);
this._ifName = ifName;
this._ifInMulticastPkts = ifInMulticastPkts;
this._ifInBroadcastPkts = ifInBroadcastPkts;
this._ifOutMulticastPkts = ifOutMulticastPkts;
this._ifOutBroadcastPkts = ifOutBroadcastPkts;
this._ifHCInOctets = ifHCInOctets;
this._ifHCInUcastPkts = ifHCInUcastPkts;
this._ifHCInMulticastPkts = ifHCInMulticastPkts;
this._ifHCInBroadcastPkts = ifHCInBroadcastPkts;
this._ifHCOutOctets = ifHCOutOctets;
this._ifHCOutUcastPkts = ifHCOutUcastPkts;
this._ifHCOutMulticastPkts = ifHCOutMulticastPkts;
this._ifHCOutBroadcastPkts = ifHCOutBroadcastPkts;
this._ifLinkUpDownTrapEnable = ifLinkUpDownTrapEnable;
this._ifHighSpeed = ifHighSpeed;
this._ifPromiscuousMode = ifPromiscuousMode;
this._ifConnectorPresent = ifConnectorPresent;
this._ifAlias = ifAlias;
}
private SnmpTable getBaseTable()
{
IfTable table = AgentMib.getIfTable();
return table;
}
private SnmpTableEntry getBaseTableEntry(int index)
{
SnmpTable table = getBaseTable();
return table.getRow(index);
}
public String getIndexSuffix()
{
if(_suffix.length() == 0)
{
SnmpTable baseTable = getBaseTable();
int count = baseTable.getRowCount();
int currentNumOfRows = _table.getRowCount();
if(currentNumOfRows > count - 1)
{
return null;
}
SnmpTableEntry baseEntry = getBaseTableEntry(currentNumOfRows);
baseEntry.addDependentRow(_table, this);
_suffix = baseEntry.getIndexSuffix();
}
return _suffix;
}
public void set(int index, SnmpDataType value)
{
switch(index)
{
case 0 :
_ifName = value.toString();
break;
case 1 :
_ifInMulticastPkts = (SnmpCounter32) value;
break;
case 2 :
_ifInBroadcastPkts = (SnmpCounter32) value;
break;
case 3 :
_ifOutMulticastPkts = (SnmpCounter32) value;
break;
case 4 :
_ifOutBroadcastPkts = (SnmpCounter32) value;
break;
case 5 :
_ifHCInOctets = (SnmpCounter64) value;
break;
case 6 :
_ifHCInUcastPkts = (SnmpCounter64) value;
break;
case 7 :
_ifHCInMulticastPkts = (SnmpCounter64) value;
break;
case 8 :
_ifHCInBroadcastPkts = (SnmpCounter64) value;
break;
case 9 :
_ifHCOutOctets = (SnmpCounter64) value;
break;
case 10 :
_ifHCOutUcastPkts = (SnmpCounter64) value;
break;
case 11 :
_ifHCOutMulticastPkts = (SnmpCounter64) value;
break;
case 12 :
_ifHCOutBroadcastPkts = (SnmpCounter64) value;
break;
case 13 :
_ifLinkUpDownTrapEnable = ((SnmpInt) value).getValue();
break;
case 14 :
_ifHighSpeed = (SnmpGauge32) value;
break;
case 15 :
_ifPromiscuousMode = ((SnmpInt) value).getValue();
break;
case 16 :
_ifConnectorPresent = ((SnmpInt) value).getValue();
break;
case 17 :
_ifAlias = value.toString();
break;
}
}
}