On Wed, 2005-12-07 at 16:02 -0800, Yong Chen (yongche) wrote:
> 1. where do you populate treecache for a SET request?
> Is it "netsnmp_add_varbind_to_cache"? And is it the place that you
> combine all varbinds having the same handler into one "requests"

I think so, yes.
I'm not very familiar with that code (and don't have the time
to read it carefully), but a brief scan seems to indicate that
this is probably where most of the work is done.

>  This func is not very easy to understand.

A little more high-level comments might be useful, certainly.
I suggest you ask your vendor for a refund :-)



> 2. As I mentioned, I'm actually using 4.x style
> So for my case, do I still have varbinds combined?

No.
As I said yesterday, the v4 model processes each varbind
separately - so your write method will be called once for
each varbind in the request  (per pass)
   But see below.


> 3. Since I'm not using 5.x handler API, do you consider
> "my_write_method" as a handler?... how is my_write_method
> called in 5.x agent?

OK - now you're getting more into the detailed internal
implementation nitty-gritty.

v4-style MIB modules (within a v5 agent) are handled
by the 'old_api' helper  (see 'helpers/old_api.c' - and
in particular 'netsnmp_old_api_helper()')
Basically, this maps v5 handler-style processing into
the previous get_*/write_* routines.

So returning to your second question:


> For a SET pdu like:
> 
>    set my_table.a=1, my_table.b=2, my_table.c=3
> 
> How many times will netsnmp_call_handlers() be called?

"netsnmp_call_handlers" will be called once (I think),
which will pass all three varbinds down the handler chain
to 'netsnmp_old_api_helper'.
  This will then call 'get_mytable' three times,
followed by 'write_mytable_X' three times for each
SET pass.

OK?

Dave


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://ads.osdn.com/?ad_id=7637&alloc_id=16865&op=click
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to