On Mon, 25 Jul 2005 17:21:20 +0100 Dave wrote: DS> We should probably ensure that the hard-coded and interactive DS> defaults match - either bringing the hard-coded settings into DS> line with the interactive versions (my preference), or vice versa.
Agreed. DS> The other suggestion relates to the 'object_get' routines - and in DS> particular to code generated for processing string- and OID-based DS> objects. DS> Currently, this code includes checks on the size of the buffer DS> passed in, and re-allocates memory if necessary (potentially DS> resulting in a memory leak, since the old memory doesn't appear DS> to be released). I´m pretty sure there isn´t a leak - the calling function should detect if the pointer changed. DS> It struck me that this is effectively duplicating DS> the internal processing of the 'snmp_set_var_value' library routine. DS> DS> Wouldn't it be clearer to tweak this 'object_get' interface slightly DS> to pass in the varbind structure, [...] Clearer to us, yes. Clearer to them? Not likely. One of the explicit goals of the MFD code is to require a little net-snmp specific knowledge as possible. Any C programmer worth their salt should understand a pointer to a pointer and a pointer to the length. When confronted with a netsnmp_variable_list, they start asking questions about what it is, how is it used, what header is it defined in, etc. The goal isn´t to be efficient, it´s to be easy to understand. (I really wish it could use C++ as a better C - I´d much rather have references than pointer to pointers.) -- 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.Net email is Sponsored by the Better Software Conference & EXPO September 19-22, 2005 * San Francisco, CA * Development Lifecycle Practices Agile & Plan-Driven Development * Managing Projects & Teams * Testing & QA Security * Process Improvement & Measurement * http://www.sqe.com/bsce5sf _______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
