java.lang.Object
|
+--com.adventnet.simulator.netsim.snmp.SimulatorSnmpPdu
The SimulatorSnmpPdu class provides methods to override the parameters of the PDU of the agents present in the Network .When ever the value of the parameter is set in the PDU, it overrides the value in the session. These methods should be used only for Network Simulator.
| Constructor Summary | |
SimulatorSnmpPdu()
|
|
| Method Summary | |
byte |
getCommand()
Gets the command type of this PDU. |
java.lang.String |
getCommunity()
Gets the community string of this PDU. |
com.adventnet.snmp.snmp2.SnmpOID |
getEnterprise()
Gets the enterprise field of the trap PDU which is of type SnmpOID. |
int |
getErrindex()
Gets the error index of this PDU. |
int |
getErrstat()
Gets the error status of this PDU. |
java.lang.String |
getIPAddress()
Returns the IPAddress of the agents present in the Network .The returned IPAddress can be checked with the specified one. |
java.lang.String |
getOid()
Returns the Object id for which the manager has placed a request. |
int |
getPort()
Returns the Port number of the agents present in the Network .The returned port number can be checked with the specified one. |
int |
getReqid()
Gets the request id of this PDU. |
java.lang.String |
getValue()
Returns the value of the request object id. |
java.lang.String[] |
getVarbindOids()
Returns the list of varbind OIDs present in the PDU. |
java.lang.String[] |
getVarbindValues()
Returns the list of varbind values for the corresponding varbind OIDs
geot using getVarbindOids() method. |
void |
setCommand(byte type)
Sets the command type of this PDU .The command type is one of the constants defined in the SNMP API. |
void |
setCommunity(java.lang.String community)
Sets community string recieved/sent.The community string in the PDU overrides the community set in session. |
void |
setEnterprise(com.adventnet.snmp.snmp2.SnmpOID oid)
Sets the enterprise field of the trap PDU which is of type SnmpOID. |
void |
setErrIndex(int errIndex)
Sets Error Index for this PDU. |
void |
setErrStat(int errStat)
Sets Error Status for this PDU. |
void |
setReqid(int reqId)
Sets Request id for this PDU .If request Id is set non zero , the said request Id will be set .If its 0 a unique request ID will be assigned to ensure no conflict with other requests .So if you do not want to manage the request Ids yourself set it to 0. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify,
notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public SimulatorSnmpPdu()
| Method Detail |
public void setCommunity(java.lang.String community)
Sets community string recieved/sent.The community string in the PDU overrides the community set in session.
community - - Community to be set for this PDUpublic void setCommand(byte type)
Sets the command type of this PDU .The command type is one of the constants defined in the SNMP API.
type - - Command type to be set for this PDU.
The various command types that can be passed as argument to this method
are:
SnmpAPI.GET_REQ_MSG,SnmpAPI.GETNEXT_REQ_MSG,SnmpAPI.SET_REQ_MSG,SnmpAPI.GETBULK_REQ_MSG,
SnmpAPI.GET_RSP_MSG,SnmpAPI.TRP_REQ_MSGpublic void setEnterprise(com.adventnet.snmp.snmp2.SnmpOID oid)
Sets the enterprise field of the trap PDU which is of type SnmpOID.
oid - - The SnmpOID representing the enterprise
field of PDU to be set.public void setErrIndex(int errIndex)
Sets Error Index for this PDU.
errIndex - - The error index to be set for this
PDU.Only values greater than or equal to zero will be accepted by this
methodpublic void setErrStat(int errStat)
Sets Error Status for this PDU.
errStat - - The error status to be set for this
PDU. The error status value that can be set using this method are :
SnmpAPI.SNMP_ERR_TOOBIG,SnmpAPI.SNMP_ERR_NOACCESS,SnmpAPI.SNMP_ERR_READONLY,
SnmpAPI.SNMP_ERR_BADVALUE,SnmpAPI.SNMP_ERR_GENERR,SnmpAPI.SNMP_ERR_NOSUCHNAME
This method will not accept values other than the one mentioned above.public void setReqid(int reqId)
Sets Request id for this PDU .If request Id is set non zero , the said request Id will be set .If its 0 a unique request ID will be assigned to ensure no conflict with other requests .So if you do not want to manage the request Ids yourself set it to 0.
reqId - - The requestId for this PDU.public int getPort()
Returns the Port number of the agents present in the Network .The returned port number can be checked with the specified one.
public java.lang.String getIPAddress()
Returns the IPAddress of the agents present in the Network .The returned IPAddress can be checked with the specified one.
public byte getCommand()
Gets the command type of this PDU.
public java.lang.String getCommunity()
Gets the community string of this PDU.
public com.adventnet.snmp.snmp2.SnmpOID getEnterprise()
Gets the enterprise field of the trap PDU which is of type SnmpOID.
public int getErrindex()
Gets the error index of this PDU.
public int getErrstat()
Gets the error status of this PDU.
public java.lang.String getOid()
Returns the Object id for which the manager has placed a request.
public int getReqid()
Gets the request id of this PDU.
public java.lang.String getValue()
Returns the value of the request object id.
public java.lang.String[] getVarbindOids()
Returns the list of varbind OIDs present in the PDU.
public java.lang.String[] getVarbindValues()
Returns the list of varbind values for the corresponding varbind OIDs geot using getVarbindOids() method.