|
SNMP Stack 4_12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--java.util.Observable | +--uk.co.westhawk.snmp.stack.Pdu | +--uk.co.westhawk.snmp.stack.GetNextPdu | +--uk.co.westhawk.snmp.pdu.GetNextPdu_vec | +--uk.co.westhawk.snmp.pdu.InterfaceGetNextPdu
The InterfaceGetNextPdu class can be used collect information off all current interfaces.
To get the successor (GetNext) of a request, the application must build the new request with the previous one. This is done by calling addOids(InterfaceGetNextPdu) before sending it.
This class can best be used inOctets a loop. To start the loop, build the Pdu with addOids(), when the answer is received, request the next interface by building the Pdu with addOids(InterfaceGetNextPdu). The loops ends when the errorStatus equals AsnObject.SNMP_ERR_NOSUCHNAME
The requested OID are from the RFC 2863.
addOids()
,
addOids(InterfaceGetNextPdu)
Field Summary | |
static java.lang.String |
DESCR
ifDescr A textual string containing information about the interface. |
static java.lang.String |
DOWN
The current operational state is down |
static java.lang.String |
IFNUMBER
ifNumber The number of network interfaces (regardless of their current state) present on this system. |
static java.lang.String |
IN_OCTETS
ifInOctets The total number of octets received on the interface, including framing characters. |
static java.lang.String |
INDEX
ifIndex A unique value for each interface. |
static java.lang.String |
OPR_STATUS
ifOperStatus The current operational state of the interface. |
static java.lang.String |
OUT_OCTETS
ifOutOctets The total number of octets transmitted outOctets of the interface, including framing characters. |
static java.lang.String |
SYS_UPTIME
sysUpTime The time (inOctets hundredths of a second) since the network management portion of the system was last re-initialized. |
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 |
Fields inherited from class uk.co.westhawk.snmp.stack.Pdu |
added, answered, context, encodedPacket, errind, errstat, msg_type, reqVarbinds, respVarbinds |
Constructor Summary | |
InterfaceGetNextPdu(SnmpContextBasisFace con)
Constructor. |
Method Summary | |
boolean |
addOids()
This method should be used when the variables are asked for the first time, the start of the loop. |
void |
addOids(InterfaceGetNextPdu old)
The method addOids is the basic for the GetNext functionality. |
java.lang.String |
getDescription()
Returns the description of the interface. |
int |
getIndex()
Returns the index of the interface. |
static int |
getNumIfs(SnmpContextBasisFace con)
Method to discover 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 |
getSpeed()
Returns the speed of the interface. |
long |
getSpeed(InterfaceGetNextPdu old)
Calculates the speed of the interface. |
protected void |
new_value(int n,
varbind res)
The value of the request is set. |
java.lang.String |
toString()
Returns the string represenation of this request. |
Methods inherited from class uk.co.westhawk.snmp.pdu.GetNextPdu_vec |
tell_them |
Methods inherited from class uk.co.westhawk.snmp.stack.Pdu |
addOid, addOid, addOid, addOid, addOid, addToTrans, getContext, getErrorIndex, getErrorStatus, getErrorStatusString, getMsgType, getReqId, getRequestVarbinds, getResponseVarbinds, isTimedOut, notifyObservers, send, send, send, sendme, setErrorIndex, setErrorStatus, setErrorStatus, setMsgType, setRetryIntervals, toString, waitForSelf |
Methods inherited from class java.util.Observable |
addObserver, clearChanged, countObservers, deleteObserver, deleteObservers, hasChanged, notifyObservers, setChanged |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final java.lang.String IFNUMBER
public static final java.lang.String SYS_UPTIME
public static final java.lang.String INDEX
public static final java.lang.String DESCR
public static final java.lang.String OPR_STATUS
public static final java.lang.String IN_OCTETS
public static final java.lang.String OUT_OCTETS
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
Constructor Detail |
public InterfaceGetNextPdu(SnmpContextBasisFace con)
con
- The context of the requestMethod Detail |
public int getIndex()
INDEX
public java.lang.String getDescription()
DESCR
public int getOperStatus()
OPR_STATUS
public java.lang.String getOperStatusString()
getOperStatus()
,
getOperStatusString(int)
public java.lang.String getOperStatusString(int status)
getOperStatusString()
public long getSpeed()
getSpeed(InterfaceGetNextPdu)
public long getSpeed(InterfaceGetNextPdu old)
old
- The previous value of this interfacepublic boolean addOids()
addOids(InterfaceGetNextPdu)
public void addOids(InterfaceGetNextPdu old)
addOids()
protected void new_value(int n, varbind res)
new_value
in class GetNextPdu_vec
n
- the index of the valuea_var
- the valuePdu.new_value(int, uk.co.westhawk.snmp.stack.varbind)
public java.lang.String toString()
toString
in class Pdu
public static int getNumIfs(SnmpContextBasisFace con) throws PduException, java.io.IOException
|
SNMP Stack 4_12 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |