On Friday, June 25, 2010 04:30:45 pm Wes Hardaker wrote:
> > Hi i'm looking at net-snmp code to understand the main flow of the
> > requests that come/go. I'm looking at netsnmp_register_handler
> > (agent_handler.c:207) As far as i understand it makes some checks and
> > passes the
> > netsnmp_handler_registration *reginfo to netsnmp_register_mib function to
> > register it to oid tree. My question actually is about
> > netsnmp_register_mib (agent_registry.c:708) as far as i understand it
> > creates a netsnmp_subtree *subtree it puts the reginfo in it but i dont
> > see any place that this subtree is registered (attached to any global
> > structure) can someone tell me what the netsnmp_register_mib is doing
> > and what happens to created subtree structure ?
> 
> I actually have been working toward putting more documentation about
> that in the tutorials, but I don't think I'll get to that part until at
> least after next week.
> 
> The "netsnmp_subtree_load" is the function in "netsnmp_register_mib"

Yes i found the netsnmp_subtree_load but couldnt see the place where it stores 
the subtree into global list. Which data structure is that global "tree like 
ordered list" ?

> that takes the subtree and stores it for future use.  It gets stored in
> an ordered list of subtrees that the agent later uses to look through
> when an incoming request is received.  Each OID in a request is paired
> against the proper subtree from the ordered list so that the appropriate
> registered handler can be found.

Thanks for your answer it is clearer now. There is a tree like linked list 
that has the oids and every snmp_subtree has reginfo in it (that stores the 
handler chains). Therefore when a request comes its oid is searched in tree 
and the handlers that match in that snmp_subtree are called (in reverse order 
they were injected). Is it right ?

------------------------------------------------------------------------------
ThinkGeek and WIRED's GeekDad team up for the Ultimate 
GeekDad Father's Day Giveaway. ONE MASSIVE PRIZE to the 
lucky parental unit.  See the prize list and enter to win: 
http://p.sf.net/sfu/thinkgeek-promo
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to