|
|||||||||
| 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 | |
(package private) SnmpAPI |
API
|
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. |
(package private) boolean |
authenticationFailed
|
(package private) byte[] |
contextID
The context ID associated with the message. |
(package private) byte[] |
contextName
Context name associated with the message. |
(package private) byte |
msgFlags
To store the decoded msgFlags on a received message |
(package private) int |
msgID
Get snmp security model from the message. |
(package private) int |
msgMaxSize
|
static byte |
NO_AUTH_NO_PRIV
Used to specify that both authentication and privacy should not be used. |
(package private) SecurityProvider |
provider
|
static byte |
REPORT_FLAG
Used to specify that the report flag is set when request is sent out. |
(package private) SecurityModelEntry |
security
The SecurityModelEntry reference for the message |
(package private) int |
securityModel
SecurityModel associated with the message. |
(package private) byte[] |
securityName
|
| Fields inherited from class com.adventnet.snmp.snmp2.SnmpMessage |
alwaysEncode,
asnParser,
community,
communityEnc,
isDebug,
messageVersion,
msgVersion,
pdu,
writeCommunity |
| 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. |
(package private) |
Snmp3Message(SnmpPDU p)
|
| Method Summary | |
(package private) int |
authenticate(SnmpSession session)
|
(package private) void |
copy(Snmp3Message copy3Msg)
|
(package private) boolean |
encode(SnmpSession session)
|
(package private) void |
encodeMsgVersion()
|
SnmpAPI |
getAPI()
|
ASN1Parser |
getASNParser()
|
(package private) byte[] |
getContextID()
Get context ID associated with the message. |
(package private) byte[] |
getContextName()
Get the context name associated with the message. |
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. |
(package private) byte[] |
getSecurityName()
Return the securityModel independent securityName |
SecurityProvider |
getSecurityProvider()
|
(package private) void |
init()
|
boolean |
isAuthenticationFailed()
Returns a boolean value based on whether V3 authentication has failed. |
(package private) void |
processMessage(SnmpSession session)
|
(package private) void |
setContextID(byte[] id)
Set context ID associated with the message. |
(package private) void |
setContextName(byte[] name)
Set the context name associated with the message. |
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. |
(package private) void |
setSecurityModel(int model)
Set the securityModel to be associated with this message. |
(package private) void |
setSecurityName(byte[] name)
Set the securityModel independent securityName. |
void |
setSecurityProvider(SecurityProvider provider)
|
| Methods inherited from class com.adventnet.snmp.snmp2.SnmpMessage |
authenticate,
copy,
encodeCommunity,
getCommunity,
getCommunityEncoding,
getMsgVersion,
getPDU,
getWriteCommunity,
setCommunity,
setCommunityEncoding,
setDebug,
setMsgVersion,
setReEncode,
setWriteCommunity |
| Methods inherited from class java.lang.Object |
|
| 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
byte msgFlags
int msgID
int msgMaxSize
SecurityModelEntry security
byte[] securityName
byte[] contextID
byte[] contextName
int securityModel
transient SecurityProvider provider
transient SnmpAPI API
boolean authenticationFailed
| Constructor Detail |
public Snmp3Message()
Snmp3Message(SnmpPDU p)
public Snmp3Message(byte[] message,
SecurityProvider securityprovider)
throws SnmpException
public Snmp3Message(byte[] message)
throws SnmpException
| 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 entryvoid setSecurityName(byte[] name)
byte[] getSecurityName()
void setContextID(byte[] id)
byte[] getContextID()
void setContextName(byte[] name)
byte[] getContextName()
void setSecurityModel(int model)
public int getSecurityModel()
public void setSecurityProvider(SecurityProvider provider)
public SecurityProvider getSecurityProvider()
void init()
public ASN1Parser getASNParser()
public SnmpAPI getAPI()
void copy(Snmp3Message copy3Msg)
boolean encode(SnmpSession session)
void encodeMsgVersion()
public boolean isAuthenticationFailed()
int authenticate(SnmpSession session)
void processMessage(SnmpSession session)
throws SnmpException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||