Questions about portion of code in agent_registry.c (netsnmp_subtree_load)

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 ...


Go Back   Usenet Forums > Networking and Network Related > SNMP Coders

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-16-2005
gg gg
 
Posts: n/a
Default Questions about portion of code in agent_registry.c (netsnmp_subtree_load)

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
Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are Off
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT +1. The time now is 09:12 AM.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.0.0