On fre, 2007-03-30 at 10:26 -0700, Wes Hardaker wrote:
> >>>>> "MF" == Magnus Fromreide writes:

>
> MF> I am certain that there is some good reason and hope somebody
> MF> could tell me, but why is the AgentX master module initiated by a
> MF> separate call to real_init_agentx in snmp_agent.c?
>
> Yes there is. Now if only we could remember it.


Oh dear, that is a way to common problem.

> We can certainly wish it was commented as to why. We could certainly
> have our wishes unfulfilled.


Well, I have been on an expedition down in the CVS repository (I agree
with your wish for cvs status -v) and then over the mailing list
archives and found that the patch that moved the call to
real_init_master into snmp_app.c was the patch that added the "master"
config directive.

> I do remember discussing it "way back when" though.


I have spent some time reading old mailing list messages - I found
and that
only looks related by a fairly long shot, especially since I run the
init routine after the config reading. (BTW 2001-03 was an interesting
month with lots of AgentX and a nice config reading debate)

> MF> Or, expressed in another way, why is the below patch a bad idea?
>
> Have you tried it?


It runs the test suite and I have made some tests but more would
probably not do any harm.

> With various types of config?


Well, that is a lacking point.


On the other hand the "Work in progress" note probably could be used to
forgive that the testing as to yet is somewhat spotty.

> MF> * Move the master agent code from libnetsnmpagent to
> MF> libnetsnmpmibs
>
> That, however, seems like a different question.


Yes, I agree.

> Why is it in the mib code? cause it isn't a mib implementation and is
> part of the agent, really...


This I think is debateable. I only moved the master support, not the
subagent support, and the master part could be viewed as a kind of
generic mib implementation, just like the proxy handling.
Yes, I wish to factor out SMUX as well but I ain't there yet.

> Regardless of where it is called in the init process, I still think it
> should be in libnetsnmpagent?
>
> MF> (Known drawbacks, the patch is a work in progress:
> MF> * It will reparse the agentx config, possily it should handle
> MF> duplicates there better)
>
> Sounds inefficient.


It depends - the reparsing happens when the user tells the agent to
reparse it's config using SIGHUP. At that time I think it is quite ok to
reparse regardless of the cost. My doubt is to what will happen during
the reparse if some of those config items have changed.

> What's the end goal, just out of curiosity? General clean up or some
> other problem?


General clean up is one part - I dislike special cases and the
initialization of AgentX (and to an even greater degree SMUX) in
init_master_agent() looks like one big special case. Additionally this
separates out the AgentX support nicely from the main agent so it
becomes a cleaner module using only the same interfaces as any other MIB
module.

A secondary part is that I wish to minimize the amount of code that must
be included in the agent to a bare minimum.

/MF


-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys-and earn cash
http://www.techsay.com/default.php?p...rge&CID=DEVDEV
_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders