|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.adventnet.snmp.snmp2.SnmpMessage | +--com.adventnet.snmp.snmp2.Snmp3Message
This class encapsulates a v3 message. The message contains the version specifc pdu processing routines. Additional routines provide access to the security data, the security model specific constants etc..
Field Summary | |
static byte |
AUTH_NO_PRIV
Used to specify that authenticated message be sent to the peer. |
static byte |
AUTH_PRIV
Used to specify that authentication and privacy are used in the communication with the peer. |
static byte |
NO_AUTH_NO_PRIV
Used to specify that both authentication and privacy should not be used. |
static byte |
REPORT_FLAG
Used to specify that the report flag is set when request is sent out. |
Constructor Summary | |
Snmp3Message()
|
|
Snmp3Message(byte[] message)
Creates an Snmp3Message object initialised with the given byte array. |
|
Snmp3Message(byte[] message,
SecurityProvider securityprovider)
Creates an Snmp3Message object initialised with the given byte array and security provider. |
Method Summary | |
SnmpAPI |
getAPI()
|
ASN1Parser |
getASNParser()
|
byte |
getMsgFlags()
Get the msgFlags field of the SNMP PDU. |
int |
getMsgID()
Returns the message Id for the v3 packet. |
int |
getMsgMaxSize()
Returns the max message size field of the SNMPV3 packet. |
SecurityModelEntry |
getSecurity()
Get securityModel object is associated with the message. |
int |
getSecurityModel()
Returns the securityModel assoicated with this message. |
SecurityProvider |
getSecurityProvider()
|
boolean |
isAuthenticationFailed()
Returns a boolean value based on whether V3 authentication has failed. |
void |
setMsgFlags(byte flags)
This methods sets the message flags of the SNMPv3 message. |
void |
setMsgID(int id)
Sets the message Id for the v3 packet |
void |
setMsgMaxSize(int size)
Sets the message max size field for the SNMPV3 packet. |
void |
setSecurity(SecurityModelEntry entry,
int modelNo)
Set securityModel object is associated with the message. |
void |
setSecurityProvider(SecurityProvider provider)
|
Methods inherited from class com.adventnet.snmp.snmp2.SnmpMessage |
getPDU, setMsgVersion |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final byte NO_AUTH_NO_PRIV
public static final byte AUTH_NO_PRIV
public static final byte AUTH_PRIV
public static final byte REPORT_FLAG
Constructor Detail |
public Snmp3Message()
public Snmp3Message(byte[] message, SecurityProvider securityprovider) throws SnmpException
SnmpException
- is thrown upon error.public Snmp3Message(byte[] message) throws SnmpException
SnmpException
- is thrown whenever error occurs.Method Detail |
public void setMsgFlags(byte flags)
The eight bits of this flag can be explained as follows:
NU | NU | NU | NU | NU | R | P | A |
NU - NOT USED
R - Report bit.
That is, if this bit is set to one, then the SNMPv3 entity that receives
this message should respond back to the sender.
P - Priv bit.
That is, if this bit is set to one, then this SNMPv3 message uses privacy.
A - Auth bit.
That is, if this bit is set to one, then this SNMPv3 message uses
authentication.
The Possible values for this msgFlags are
Value in Decimal | R | P | A |
0 | 0 | 0 | 0 |
1 | 0 | 0 | 1 |
3 | 0 | 1 | 1 |
4 | 1 | 0 | 0 |
5 | 1 | 0 | 1 |
7 | 1 | 1 | 1 |
There cannot be privacy without authentication, hence the values 2
and 6 cannot exist.
flags
- the msgFlags value to set for this SNMPv3 message. If an
invalid value is passed as argument to this method, then the method will
return and the previous value will be retained.public byte getMsgFlags()
public void setMsgID(int id)
id
- The messageID to be set for the SNMPV3 request.public int getMsgID()
public void setMsgMaxSize(int size)
size
- The maximum message size for the SNMPV3 packet.public int getMsgMaxSize()
public SecurityModelEntry getSecurity()
public void setSecurity(SecurityModelEntry entry, int modelNo)
entry
- The security model reference is to set the corresponding
entry in the message.modelNo
- The securityModel no. is associated with the securit entrypublic int getSecurityModel()
public void setSecurityProvider(SecurityProvider provider)
public SecurityProvider getSecurityProvider()
public ASN1Parser getASNParser()
public SnmpAPI getAPI()
public boolean isAuthenticationFailed()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |