This is a discussion on Questions about portion of code in agent_registry.c (netsnmp_subtree_load) within the SNMP Coders forums, part of the Networking and Network Related category; I am trying to understand the purpose of a portion of code in agent_registry.c/netsnmp_subtree_load. The code was submitted ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
I am trying to understand the purpose of a portion of
code in agent_registry.c/netsnmp_subtree_load. The code was submitted in version 5.25.2.1. Here is the code: if (!netsnmp_subtree_find_first(context_name)) { static int inloop = 0; if (!inloop) { oid ccitt[1] = { 0 }; oid iso[1] = { 1 }; oid joint_ccitt_iso[1] = { 2 }; inloop = 1; printf("netsnmp_subtree_load loading defaults %d \n",__LINE__); netsnmp_register_null_context(snmp_duplicate_objid (ccitt, 1), 1, context_name); netsnmp_register_null_context(snmp_duplicate_objid (iso, 1), 1, context_name); netsnmp_register_null_context(snmp_duplicate_objid (joint_ccitt_iso, 1), 1, context_name); inloop = 0; } } Here is the comment when the code was committed: The comment made during submission was: Revision : 5.25.2.1 Date : 2004/12/16 19:55:54 Author : 'rstory' State : 'Exp' Lines : +3 -2 Description : cache next ptr b4 object could be freed Can you explain the purpose of this code? Can you explain why inloop is set to 0 after being set to 1? It would seem like there is a bug here or some extraneous code. ------------------------------------------------------- SF.Net email is sponsored by: Discover Easy Linux Migration Strategies from IBM. Find simple to follow Roadmaps, straightforward articles, informative Webcasts and more! Get everything you need to get up to speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click _______________________________________________ Net-snmp-coders mailing list Net-snmp-coders@lists.sourceforge.net https://lists.sourceforge.net/lists/...et-snmp-coders |