As I'm writing a new MIB handler by filling in mib2c-generated code, I'm
reminded again how elegant Net-SNMP can be. I imagine part of that is a
reflection of the simplicity of SNMP itself but the Net-SNMP crew needs to take
credit, too. And I want to thank you all.
One of the best illustrations of this elegance is table iterators. Again and
again, I have to fill in someTable_get_first_data_point() and
someTable_get_next_data_point() and -- always afraid of duplicate code -- I
don't want similar logic in both. The way these functions interact with the
rest of the table iterator framework, I can almost always do something like:
netsnmp_variable_list*
someTable_get_first_data_point(...)
{
// Bootstrap the process
*my_loop_context = (void*)0;
// Do the hard stuff
return someTable_get_next_data_point(...);
}
It's lovely really. The clarity and simplicity of the code appeals to my sense
of aesthetics and parsimony. Occam would be pleased. Thanks.
Chris
-------------------------------------------------------
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