Summary ------- Back before 5.1, I added a priority field to the callback structure, to allow some callbacks to be called before others without depending on the order in which they were registered. A new registration function was created, and the previous one was changed to be a simple wrapper.
Unfortunately, I made a poor decision for the default priority used by the wrapper function (I used 0). The way the code is written, anyone wanting a particular callback to be called before the default must use a negative priority. Proposal -------- What I'd like to do is change the default priority to a positive number, like so: + /* + * Callback priority (lower priority numbers called first( + */ +#define NETSNMP_CALLBACK_HIGHEST_PRIORITY 0 +#define NETSNMP_CALLBACK_DEFAULT_PRIORITY 128 I think this is more in line with how people think of priorities. Using a negative number just doesn't feel right. Considerations -------------- 1) No code in net-snmp uses the api for callback priorities, so all callbacks are using the default and thus would not be affected. 2) Anyone using a priority to run earlier than the defaults in a custom application would not be affected, since the negative number they are using would still be lower than the default. 3) Anyone using a priority >0 && < 128 to run last would see a change in behaviour. -- 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
