Bluehost.com Web Hosting $6.95

RE: Question about netsnmp_call_handlers() function in snmp_agent.c

This is a discussion on RE: Question about netsnmp_call_handlers() function in snmp_agent.c within the SNMP Users forums, part of the Networking and Network Related category; Ok, got it, I think I missed the "old_api" part. Thanks a lot Dave, I appreciate your great ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 12-09-2005
Yong Chen
 
Posts: n/a
Default RE: Question about netsnmp_call_handlers() function in snmp_agent.c


Ok, got it, I think I missed the "old_api" part. Thanks a lot Dave, I
appreciate your great help.

Best,
Yong Chen=20

-----Original Message-----
From: Dave Shield [mailto:D.T.Shield@csc.liv.ac.uk]=20
Sent: Thursday, December 08, 2005 1:18 AM
To: Yong Chen (yongche)
Cc: net-snmp-users@lists.sourceforge.net
Subject: RE: Question about netsnmp_call_handlers() function in
snmp_agent.c

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=20
> 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=20
> 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=20
> "my_write_method" as a handler?... how is my_write_method called in=20
> 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:
>=20
> set my_table.a=3D1, my_table.b=3D2, my_table.c=3D3
>=20
> 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
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/...net-snmp-users
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 07:02 AM.


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