I have some question about  the code at the end of this function:

1.) Why is the send_trap_to_sess() called for each entry at sinks  
without check the snmpNotifyFilter?
2.) And why is the snmpNotifyFilter called via callback 2 times (with  
v1 and v2 trap pdu)?
3.) Why is the callback called too if the NETSNMP_DISABLE_SNMPV1 is set?

The background to my questions is the following scenario:

I have configured 3 trap receiver:
1 trapsink
1 trap2sink
1 informsink

Than each trap is send 3 times and logged 2 times at the nlmLogTable.
That seems for me to be wrong!

It would be nice to get an answer,

Claus

##########################

int
netsnmp_send_traps(int trap, int specific,
                           const oid * enterprise, int  
enterprise_length,
                           netsnmp_variable_list * vars,
                           const char * context, int flags)
{

// ... skip

     /*
      *  Now loop through the list of trap sinks
      *   and call the trap callback routines,
      *   providing an appropriately formatted PDU in each case
      */
     for (sink = sinks; sink; sink = sink->next) {
#ifndef NETSNMP_DISABLE_SNMPV1
         if (sink->version == SNMP_VERSION_1) {
           if (template_v1pdu) {
             send_trap_to_sess(sink->sesp, template_v1pdu);     // FIXME:  
without filter and no log? ck
           }
         } else {
#endif
           if (template_v2pdu) {
             template_v2pdu->command = sink->pdutype;   // FIXME: the  
last loop value will be seen by callbacks! ck
             send_trap_to_sess(sink->sesp, template_v2pdu);
           }
#ifndef NETSNMP_DISABLE_SNMPV1
         }
#endif
     }
     if (template_v1pdu)
         snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
                         SNMPD_CALLBACK_SEND_TRAP1, template_v1pdu);
     if (template_v2pdu)
         snmp_call_callbacks(SNMP_CALLBACK_APPLICATION,
                         SNMPD_CALLBACK_SEND_TRAP2, template_v2pdu);
     snmp_free_pdu(template_v1pdu);
     snmp_free_pdu(template_v2pdu);
     return 0;
}


------------------------------------------------------------------------------
Nokia and AT&T present the 2010 Calling All Innovators-North America contest
Create new apps & games for the Nokia N8 for consumers in  U.S. and Canada
$10 million total in prizes - $4M cash, 500 devices, nearly $6M in marketing
Develop with Nokia Qt SDK, Web Runtime, or Java and Publish to Ovi Store 
http://p.sf.net/sfu/nokia-dev2dev
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to