On Wed, 23 Feb 2005 14:35:31 -0500 Olsson, wrote:
OS> RS> Another good idea. My only question is, how is it published? As a PDU? 
OS> RS> the formatted text string?
OS> 
OS> It publishes a PDU (netsnmp_pdu) that has been packed into a byte stream
OS> and then can be unpacked on the other end.  I suspect there will be some 
OS> comments here since I wasn't exactly sure what should be packed and what
OS> should be left alone.  I mostly packed and unpacked everything in the 
OS> netsnmp_pdu struct.  Through trial and error (and memory leaks) I found
OS> that some data was not really owned by the pdu, and didn't need to be
OS> packed/unpacked.  

What did you end up leaving out?

OS> I separated the PDU code into its own unit called snmp_pdu.c, but when I
OS> asked about this to the coders list some time back they said it should
OS> just be left in the snmp_api.c file for now awaiting major restructuring of
OS> the file in the future.

That's right. In general, patches should have as minimal an impact as possible.

OS> I suspect some more work could be done to automate the reception 
OS> and call a callback on the subscriber side.  This would make it trivial
OS> and transparent to receive the traps and call a user supplied 
OS> callback in any net-snmp bound management application.  [...]  I envision
OS> that they could just make a couple of calls once this is implemented and
OS> they'll be in business.
OS> 
OS> netsnmp_init_snmp_trap_subscriber();
OS> netsnmp_add_snmp_trap_subscription_handler(callback);
OS> 
OS> Where callback is a C function to be called when a trap is received from
OS> the publisher.
OS> 
OS> Right now, the they would need to do the select() and read() and 
OS> netsnmp_unpack_snmp_pdu() which really isn't that much harder, but is
OS> not as cool.

True, but that assumes they are using the net-snmp event loop, which they might
not be if all they want is traps. The fd/handler should be available for those
applications. The integrated method would be nice, but is secondary. (eg if you
want to add it, go for it.)

-- 
Robert Story; NET-SNMP Junkie
Support: <http://www.net-snmp.org/> <irc://irc.freenode.net/#net-snmp>
Archive: <http://sourceforge.net/mailarchive/forum.php?forum=net-snmp-coders>

You are lost in a twisty maze of little standards, all different. 


-------------------------------------------------------
SF email is sponsored by - The IT Product Guide
Read honest & candid reviews on hundreds of IT Products from real users.
Discover which products truly live up to the hype. Start reading now.
http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to