[SNMP4J] SNMP4J Version 3 SecurityLevel.AUTH_PRIV example

Houghton, Jack SPAWAR jack.houghton at navy.mil
Tue Nov 15 22:37:40 CET 2005


Hi:
I'm new to SNMP4J. First of all, congratulations on your work and thanks
for making it available. I have been tracing through the code and don't
understand one section. Let's say we want to send a SNMPv3 message
(GETNEXT) with authentication and privacy as illustrated in the javadoc
for the Snmp class. After performing the necessary initialization this
call is made:
 
ResponseEvent response = snmp.send(pdu, target);

This results in a call to
Snmp.send( PDU              pdu,
           Target           target,
           TransportMapping transport ), which in turn calls
 
Snmp.sendMessage( PDU              pdu,
                  Target           target,
                  TransportMapping transport ), which in turn calls
 
MessageDispatcherImpl.sendPdu( TransportMapping transport,
                               Address          transportAddress,
                               int              messageProcessingModel,
                               int              securityModel,
                               byte[]           securityName,
                               int              securityLevel,
                               PDU              pdu,
                               boolean          expectResponse ),
 
which in turn calls 
 
MPv3.prepareOutgoingMessage( Address         transportAddress,
                             int             maxMessageSize,
                             int             messageProcessingModel,
                             int             securityModel,
                             byte[]          securityName,
                             int             securityLevel,
                             PDU             pdu,
                             boolean         expectResponse,
                             PduHandle       sendPduHandle,
                             Address         destTransportAddress,
                             BEROutputStream outgoingMessage )

In the body of this method, although securityLevel is input as
SecurityLevel.AUTH_PRIV, because the MPv3 Hashtable variable engineIDs
doesn't have any elements, securityLevel will be reset to
SecurityLevel.NOAUTH_NOPRIV. Is this the desired behavior? Or have I
missed something?
 
Thanks,
Jack Houghton



More information about the SNMP4J mailing list