Yes, it is a good idea of using "snmp_clone_pdu" to improve the efficiency 
of the codes.And because the num of trap receivers is not certain, so I use 
"struct netsnmp_session *ss_head" as a head of linked list,which is built 
before sending a series of traps and free at last.It seems like that this 
method can resolve the problem perfectly.
     Thank you very much for your help,Dave~!
   
   
  Best regards,
   
  zhou

Dave Shield <[EMAIL PROTECTED]> 写道:
  On 12/02/07, jin zhou wrote:
> But I am afraid simply using :
> snmp_send( ss1, pdu );
> snmp_send( ss2, pdu );
> snmp_send( ss3, pdu );
>
> can't send a trap with content pdu to different destinations ,because the
> routine snmp_send will free pdu automaticlly if succeed.

Good point.
Yes - you would have to construct a copy of the template PDU,
and send that instead.

tpdu = snmp_pdu_create(SNMP_MSG_TRAP2);
// set up tpdu
pdu = snmp_clone_pdu( tpdu ); snmp_send( ss1, pdu );
pdu = snmp_clone_pdu( tpdu ); snmp_send( ss2, pdu );
pdu = snmp_clone_pdu( tpdu ); snmp_send( ss3, pdu );

Dave


                
---------------------------------
 雅虎1G免费邮箱百分百防垃圾信
 雅虎助手-搜索、杀毒、防骚扰  
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
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