Hi Dave How are you doing!
I spend some time to study the iterator helper to retrieve external data outside from SNMP agent. I found that iterator uses a 'get first' and 'get next' way for get and getbulk requests. And for GET request, agent will also use this hook routine to find the index. What's the reason behind this? Is there a document I can refer to know how the get first get next works? For external data, is there a better way for GETBULK request? Suppose external data can be get via blocks(one block has multiple OID data). Thanks and have a nice day! Barclay -----Original Message----- From: dave.shi...@gmail.com [mailto:dave.shi...@gmail.com] On Behalf Of Dave Shield Sent: 2012年12月17日 16:28 To: Zheng, Wenjie (Barclay) Cc: net-snmp-us...@lists.sourceforge.net; net-snmp-coders@lists.sourceforge.net Subject: Re: Index of table in SNMP Agent On 17 December 2012 01:18, Zheng, Wenjie (Barclay) <barclay.zh...@alcatel-lucent.com> wrote: > Thanks for your response, it's really helps. > Is there an example I can refer that SNNP can retrieve data from outside? Hmmm... there are probably not many examples of using the iterator to walk through external data. As I indicated last week, it's not exactly the most efficient of the table helpers, so a more common technique is to read in a snapshot of the external data, cache it, and use that cache to process incoming requests. The cache is only reloaded when it's deemed "too old". A quick look through the code shows about a dozen modules that use the iterator helper. Some of these (nsCache, nsDebug, etc) are reporting on internal data anyway, so aren't really relevant here. Probably the most promising for you to look at would be examples/netSnmpHostTable{,_access}.c which uses a variant of the iterator approach to read from /etc/hosts or mibII/icmp.c mibII/ipCidrRouteTable.c mibII/tcpTable.c mibII/udpTable.c which are probably the closest to what you're trying to do. Dave ------------------------------------------------------------------------------ Master Java SE, Java EE, Eclipse, Spring, Hibernate, JavaScript, jQuery and much more. Keep your Java skills current with LearnJavaNow - 200+ hours of step-by-step video tutorials by Java experts. SALE $49.99 this month only -- learn more at: http://p.sf.net/sfu/learnmore_122612 _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders