public class InterfacePdu extends GetPdu
InterfacesPdu
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
DOWN
The current operational state is down
|
static java.lang.String |
TESTING
The current operational state is testing
|
static java.lang.String |
UNKNOWN
The current operational state is unknown
|
static java.lang.String |
UP
The current operational state is up
|
added, answered, context, encodedPacket, errind, errstat, msg_type, reqVarbinds, respVarbinds, snmpv3MsgId
Constructor and Description |
---|
InterfacePdu(SnmpContextBasisFace con,
java.util.Observer o,
int interf)
Constructor that will send the request immediately.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getDescription()
Returns the description of the interface.
|
int |
getIndex()
Returns the index of the interface.
|
long |
getInOctet()
Returns the total number of octets received on the
interface, including framing characters.
|
static int |
getNumIfs(SnmpContextBasisFace con)
Returns how many interfaces are present.
|
int |
getOperStatus()
Returns the operational state of the interface.
|
java.lang.String |
getOperStatusString()
Returns the string representation of the operational state of the
interface.
|
java.lang.String |
getOperStatusString(int status)
Returns the string representation of a operational state.
|
long |
getOutOctet()
Returns the total number of octets transmitted outOctets of the
interface, including framing characters.
|
long |
getSpeed(InterfacePdu old)
Calculates the speed of the interface.
|
long |
getSysUpTime()
Returns the time (in hundredths of a second) since the network management
portion of the system was last re-initialized.
|
protected void |
new_value(int n,
varbind res)
The value of the request is set.
|
protected void |
tell_them()
This method notifies all observers.
|
addOid, addOid, addOid, addOid, addOid, addToTrans, getContext, getErrorIndex, getErrorStatus, getErrorStatusString, getMsgType, getReqId, getRequestVarbinds, getResponseVarbinds, getRetryIntervals, isExpectingResponse, isTimedOut, notifyObservers, printVars, send, send, send, sendme, setErrorIndex, setErrorStatus, setErrorStatus, setMsgType, setRetryIntervals, toString, toString, waitForSelf
public static final java.lang.String UP
public static final java.lang.String DOWN
public static final java.lang.String TESTING
public static final java.lang.String UNKNOWN
public InterfacePdu(SnmpContextBasisFace con, java.util.Observer o, int interf) throws PduException, java.io.IOException
con
- the SnmpContextBasisFaceo
- the Observer that will be notified when the answer is receivedinterf
- the index of the requested interfacePduException
java.io.IOException
public int getIndex()
public long getSysUpTime()
public java.lang.String getDescription()
public int getOperStatus()
public java.lang.String getOperStatusString()
getOperStatus()
,
getOperStatusString(int)
public java.lang.String getOperStatusString(int status)
getOperStatusString()
public long getInOctet()
public long getOutOctet()
public long getSpeed(InterfacePdu old)
old
- The previous value of this interfaceprotected void new_value(int n, varbind res)
new_value
in class Pdu
n
- the index of the valueres
- the valuePdu.new_value(int, uk.co.westhawk.snmp.stack.varbind)
protected void tell_them()
Unless an exception occurred the Object to the update() method of the Observer will be a varbind, so any AsnObject type can be returned. In the case of an exception, that exception will be passed.
public static int getNumIfs(SnmpContextBasisFace con) throws PduException, java.io.IOException
PduException
java.io.IOException