SNMPv3 informs

Buchan, Mike MikeB____dmecorp.net
Tue Mar 25 01:36:12 CET 2003


Thank you for your quick response.  I thought you had pointed out my error
in my first read through.  We were not using one of the
UsmUserTable::addNewRow forms which included the engine ID.  
For a test case, I altered the atm_mib example to do an SNMPv3 inform
following the steps you outlined in your reply.  I tried both forms of
UsmUserTable::addNewRow which include the engine ID as a parameter.  I am
still failing.  
As stated in a previous message I am using the SilverCreek tool to test the
interfaces.  In this case, I'm using there Notification Manager and looking
at the log entries.  The inform never makes it to the Notification Manger.
When in detailed mode, the log shows a set of 68 octets received and
indicates that it returns an UnknownEngineID report.  I am having no luck
deciphering the octets received in relation to what I think should be sent.
Just for information, the octets dump follows:

  30 82 00 40 02 01 03 30 82 00 0f 02 03 31 00 00 02 02 10 00
  04 01 04 02 01 03 04 12 30 82 00 0e 04 00 02 01 00 02 01 00
  04 00 04 00 04 00 30 82 00 12 04 00 04 00 a6 0c 02 02 11 36
  02 01 00 02 01 00 30 00

The following is a sniplet of the altered atm_mib.cpp.  I have only included
the parts pertinent to the v3 inform.  I don't understand what I'm missing.
I would appreciate if you could take a minute to scan through it and tell me
what I'm missing.  I'm certain It's going to be something simple and I'm
going to feel like an idiot but I'm stuck.

Thanks,
Mike Buchan

PS I think it was another Mike working on this project that you may have
talked to last year.  I had never worked with SNMP before November 2002.
;-)


void init(Mib& mib)
{
..
..
    UsmUserTable *uut = new UsmUserTable();

    // Add a user for informs  *** Step 4
    uut->addNewRow("0x12:34:56:EF:56:67", "MD5DESinformer",
                         "MD5DESinformer",
                         SNMPv3_usmHMACMD5AuthProtocol,
                         "iAuth",
                         SNMPv3_usmDESPrivProtocol,
                         "iPriv");
..
..
}

int main (int argc, char* argv[])
{
..
..
    v3MP *v3mp = new v3MP(&snmp, engineId, snmpEngineBoots, stat);

    mib = new Mib();
..
    init(*mib);
..
..
    // register VACM
    Vacm* vacm = new Vacm(*mib);
    reqList->set_vacm(vacm);

    // initialize security information
    vacm->addNewContext("");

    vacm->addNewGroup(SecurityModel_USM, "MD5DES",
                      "testGroup", storageType_nonVolatile);
    vacm->addNewGroup(SecurityModel_USM, "MD5DESinformer",
                      "testGroup", storageType_nonVolatile);

    vacm->addNewAccessEntry("testGroup", "",
                            SecurityModel_USM, SecurityLevel_authPriv,
                            match_prefix,
                            "testView", "testView",
                            "testView", storageType_nonVolatile);

    vacm->addNewView("testView", "1.3.6", "",
                     view_included, storageType_nonVolatile);


    OctetStr parmsName("defaultParms");
    //Create a target parameters table entry *** Step 1
    snmpTargetParamsEntry::instance->add_entry(parmsName, mpV3, 
                                SecurityModel_USM, "MD5DESinformer", 3);

    //Create a Notification table entry  *** Step 2
    OctetStr notifyTag("myEvent");
    OctetStr tag("inform");
    snmpNotifyEntry::instance->add_entry(notifyTag, tag, 2);

    // Create a Target Address table entry  *** Step 3
    UdpAddress dest("192.168.100.14/162");
    OctetStr address;
    IpAddress ip(dest);
    for ( int i=0; i<4; i++ )
    {
        address += (unsigned char)ip[i];
    }
    address += (dest.get_port() >> 8);
    address += (dest.get_port() & 0x00FF);

    snmpTargetAddrEntry::instance->add_entry(
                                  UdpAddress(dest).get_printable(),
                                  Oidx("1.3.6.1.6.1.1"),
                                  address, tag, parmsName);

    Vbx* vbs = 0;
    coldStartOid coldOid;

    // send the notification
    status = mib->notify("", coldOid, vbs, 0);



More information about the AGENTPP mailing list