Hi, (Note: I am not subscribed to this list, so any replies should be CC'd to me.)
A number of messages on this list have noted the inefficiency of the table iterator helper since it walks through every row in the table for every request. When it is expensive to retrieve rows this takes a long time and it is unnecessary when the rows can be provided in sorted order by the external data store (or subagent logic). The attached helper, while somewhat rough, provides a halfway point between using the raw table helper (fast, but coding intensive to handle OIDs properly) and using the table iterator (easy, but slow). The user's first/next callbacks need to be able to find the current row from a given index and return rows in ascending order, but other than that it is very similar to the table iterator helper. There are several improvements that could be made, though we didn't need them; a couple are: * Remove the *ctx method of signaling whether a row is present * Add actual data contexts so that any data retrieved along with the row context does not have to be retrieved again in the individual OID handlers This code is intended to be under the same license terms as the rest of Net-SNMP. As noted in the header comments, it was based on parts of the other helpers. THERE IS NO WARRANTY. -- Joshua Hoke Associate Software Engineer Sixnet | www.sixnet.com O +1 518 877 5173 Ext. 161 F +1 518 602 9209 [email protected]
table_sorted.h
Description: table_sorted.h
table_sorted.c
Description: table_sorted.c
------------------------------------------------------------------------------ Start uncovering the many advantages of virtual appliances and start using them to simplify application deployment and accelerate your shift to cloud computing. http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________ Net-snmp-coders mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/net-snmp-coders
