Hi Magnus, Thanks for the reply. I have one more question. This is related to data table helper and table helper. In the case of table helper, reqinfo->mode can be used to check for MODE_GET and MODE_GETNEXT. But in the case of data table helper, all this is done for you. But when the index of a table is an ASN_OCTET_STR, get _next is not getting the next oid properly. I do not know if this still an issue. I want to introspect what is happening here. Is there anyway, I can know in the case of data table helper what the next oid index is ?
mani -----Original Message----- From: Magnus Fromreide [mailto:ma...@lysator.liu.se] Sent: Tuesday, June 30, 2015 2:42 PM To: Mani Pooni Cc: net-snmp-coders@lists.sourceforge.net Subject: Re: Writing a custom sub agent for a oid prefix On Tue, Jun 30, 2015 at 08:53:16PM +0000, Mani Pooni wrote: > I am trying to use net-snmp to write my own subagent. My use case is like > this. I want anything with a specific oid prefix needs to forwarded to my > subagent. I have looked at the autogenerated code. But for that I need to > define to generate code for every table. Is there any example code someone > can point to me where it show how I can register for a specific oid prefix > and for everything underneath that oid prefix the subagent gets called. > > For example if I register a subagent for oid .1.3.6.1.4.1.22610.2.4.4 then > for anything underneath this oid prefix .1.3.6.1.4.1.22610.2.4.4.1 or > .1.3.6.1.4.1.22610.2.4.4.1.1 the subagent needs to be called. I usually calls netsnmp_create_handler_registration and then call netsnmp_register_handler on the output from that. The resulting handler takes everything below the registering OID that ain't overridden by a more specific handler. /MF ------------------------------------------------------------------------------ Don't Limit Your Business. Reach for the Cloud. GigeNET's Cloud Solutions provide you with the tools and support that you need to offload your IT needs and focus on growing your business. Configured For All Businesses. Start Your Cloud Today. https://www.gigenetcloud.com/ _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/net-snmp-coders