|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.ireasoning.protocol.snmp.VarBindContainer com.ireasoning.protocol.snmp.SnmpPdu
This class represents SNMP Protocol Data Unit (PDU).
Field Summary |
Fields inherited from interface com.ireasoning.protocol.snmp.SnmpDataType |
BITS, BITSTRING, COUNTER32, COUNTER64, END_OF_MIB_VIEW, END_OF_MIB_VIEW_OBJECT, GAUGE32, INTEGER, IPADDRESS, NO_SUCH_INSTANCE, NO_SUCH_INSTANCE_OBJECT, NO_SUCH_OBJECT, NO_SUCH_OBJECT_OBJECT, NULL, OCTETSTRING, OID, OPAQUE, PDU, SEQUENCE, SEQUENCEOF, serialVersionUID, TIMETICKS, UNSIGNED32, VARBIND |
Fields inherited from interface com.ireasoning.protocol.Msg |
ERROR_TYPE |
Constructor Summary | |
SnmpPdu(int cmd)
Constructs an SnmpPdu object |
|
SnmpPdu(int cmd,
SnmpVarBind[] varbinds)
Creates a new pdu with the spcified command and the list of variables. |
|
SnmpPdu(int cmd,
SnmpVarBind[] varbinds,
int requestID)
Constructs a new SnmpPdu object |
|
SnmpPdu(SnmpPdu pdu)
Makes a copy of passed pdu object |
Method Summary | |
SnmpDataType |
copy()
Makes a copy of itself |
static SnmpPdu |
decodePdu(byte[] data,
int length)
Constructs an SnmpPdu (SNMP v1/v2c) based on passed byte array |
int |
encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder)
For internal use |
static byte[] |
encodePdu(SnmpPdu pdu)
Encodes passed SNMPv1/v2c SnmpPdu object to byte array |
int |
getCommand()
Returns the snmp command contained in this PDU |
String |
getCommunity()
Returns the community name contained in this object. |
byte[] |
getContextEngineID()
Returns the context engine ID |
String |
getContextName()
Returns the context name |
String |
getDestinationAddress()
Returns the PDU receiver's ip address or host name |
int |
getDestinationPort()
Returns the PDU receiver's socket port number |
int |
getErrorIndex()
Returns the error index. |
int |
getErrorStatus()
Returns the error status code |
String |
getErrorStatusString()
Returns the string representation of this object's error status code |
static String |
getErrorStatusString(int errStatusCode)
Returns the string representation of passed error status code |
String |
getErrorString()
Returns the error string. |
String |
getIpAddress()
Returns the PDU sender's IP address or host name. |
int |
getMaxRepetitions()
Returns the max-repetition value |
int |
getNonRepeaters()
Used with get-bulk command. |
int |
getRequestID()
Returns PDU's request ID |
MsgHeader |
getSnmpV3MsgHeader()
|
MsgSecurityParameters |
getSnmpv3MsgSecurityParameters()
|
String |
getSourceAddress()
Returns the PDU sender's IP address or host name |
int |
getSourcePort()
Returns the PDU sender's socket port number |
int |
getType()
Returns SnmpDataType.PDU |
String |
getTypeString()
Returns "PDU" |
int |
getVersion()
Returns the version of SNMP. |
boolean |
hasMore()
Determines whether there are any more elements. |
boolean |
isSnmpV3AuthenticationFailed()
Returns true if SNMPv3 authentication failed. |
void |
setCommand(int cmd)
Set new command |
void |
setCommunity(String community)
Sets new community string. |
void |
setContextEngineID(byte[] id)
Sets the context engine id (SNMPV3) |
void |
setContextName(String name)
Sets the context name (SNMPV3) |
void |
setDestinationAddress(String ipAddress)
Sets the PDU receiver's ip address or host name |
void |
setDestinationPort(int port)
|
void |
setErrorIndex(int index)
Sets the error index field of PDU |
void |
setErrorStatus(int status)
Sets the error status code |
void |
setHasMore(boolean b)
Sets this object's HasMore property |
void |
setIpAddress(String ipAddr)
Sets PDU sender's ip address or host name The same as setSourceAddress(String ipAddress) |
void |
setMaxRepetitions(int maxrep)
Sets the max-repetition value of get-bulk command |
void |
setNonRepeaters(int nonrep)
Sets the non-repeater value (SNMPV2 get-bulk command) |
void |
setOID(SnmpOID oid)
Sets a new oid, removes all old ones. |
void |
setOID(String oid)
Sets a new oid, removes all old ones. |
void |
setOIDs(SnmpOID[] oids)
Sets a new set of oids |
void |
setOIDs(String[] oids)
Sets a new set of oids, removes all old ones. |
void |
setRequestID(int reqid)
Sets new reuqest ID |
void |
setSourceAddress(String ipAddress)
Sets PDU sender's ip address or host name |
void |
setSourcePort(int port)
|
void |
setVersion(int version)
Sets the version of SNMP. |
String |
toString()
|
Methods inherited from class com.ireasoning.protocol.snmp.VarBindContainer |
addVarBind, addVarBinds, addVarBinds, getFirstVarBind, getLastVarBind, getVarBind, getVarBindCount, getVarBinds, removeAllVarBinds, removeAllVarBinds, removeVarBind, setVarBinds, setVarBinds |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.ireasoning.protocol.snmp.SnmpDataType |
equals, hashCode |
Constructor Detail |
public SnmpPdu(SnmpPdu pdu)
public SnmpPdu(int cmd)
cmd
- the snmp command, such as SnmpConst.GET, SnmpConst.GET_NEXT,
etc.public SnmpPdu(int cmd, SnmpVarBind[] varbinds)
cmd
- the snmp command, such as SnmpConst.GET, SnmpConst.GET_NEXT,
etc.varbinds
- The variable bindingspublic SnmpPdu(int cmd, SnmpVarBind[] varbinds, int requestID)
cmd
- the snmp command, such as SnmpConst.GET, SnmpConst.GET_NEXT,
etc.varbinds
- The variable bindingsrequestID
- the request idMethod Detail |
public static SnmpPdu decodePdu(byte[] data, int length) throws SnmpDecodingException
data
- byte array representation of SNMP v1/v2c PDUlength
- the number of bytes of data to be decoded
SnmpDecodingException
public static byte[] encodePdu(SnmpPdu pdu) throws SnmpEncodingException
pdu
- SNMPv1/v2c PDU object
SnmpEncodingException
public boolean hasMore()
setHasMore(boolean)
public void setHasMore(boolean b)
b
- a boolean variable determining the result of hasMore() methodhasMore()
public void setCommand(int cmd)
cmd
- The new command.public int getRequestID()
public void setRequestID(int reqid)
public void setOID(String oid)
oid
- new oidpublic void setOID(SnmpOID oid)
oid
- new oidpublic void setOIDs(String[] oids)
oids
- new set of oidspublic void setOIDs(SnmpOID[] oids)
oids
- new set of oidspublic int getCommand()
public int getType()
getType
in interface SnmpDataType
public String getTypeString()
getTypeString
in interface SnmpDataType
public int getVersion()
public void setVersion(int version)
public String getCommunity()
public void setCommunity(String community)
public boolean isSnmpV3AuthenticationFailed()
public String getErrorString()
public String getErrorStatusString()
public static String getErrorStatusString(int errStatusCode)
errStatusCode
- error status codepublic int getErrorStatus()
public void setErrorStatus(int status)
public int getErrorIndex()
public void setErrorIndex(int index)
public int getNonRepeaters()
public void setNonRepeaters(int nonrep)
public int getMaxRepetitions()
public void setMaxRepetitions(int maxrep)
public String getContextName()
public void setContextName(String name)
public byte[] getContextEngineID()
public void setContextEngineID(byte[] id)
public String getSourceAddress()
public void setSourceAddress(String ipAddress)
public int getSourcePort()
public void setSourcePort(int port)
public int getDestinationPort()
public void setDestinationPort(int port)
public String getDestinationAddress()
public void setDestinationAddress(String ipAddress)
public String getIpAddress()
getSourceAddress()
public void setIpAddress(String ipAddr)
setSourceAddress(java.lang.String)
public MsgHeader getSnmpV3MsgHeader()
public MsgSecurityParameters getSnmpv3MsgSecurityParameters()
public String toString()
public SnmpDataType copy()
SnmpDataType
copy
in interface SnmpDataType
public int encode(com.ireasoning.protocol.snmp.SnmpEncoder encoder) throws SnmpEncodingException
SnmpDataType
encode
in interface SnmpDataType
SnmpEncodingException
|
HOME | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |