Re: GET Request

This is a discussion on Re: GET Request within the SNMP Users forums, part of the Networking and Network Related category; On Fri, 2005-12-02 at 15:47 -0800, manik chopra wrote: > Following is a sample of my sub-...


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-13-2005
Dave Shield
 
Posts: n/a
Default Re: GET Request

On Fri, 2005-12-02 at 15:47 -0800, manik chopra wrote:
> Following is a sample of my sub-agent stub file:
>
> unsigned char *var_fnc()
> {
> my_struct *p;
>
> header_simple_table(........)
> { }


I trust you're actually checking the return value of this
routine, to tell whether to continue processing or not?


> if ( fnc(p->value) < 0)
> { return NULL; }


How is 'p' being initialised?
I'd expect you to extract the index from the OID returned
by 'header_simple_table', and use this to select the
appropriate row of the table.

But you don't show any of this code.



> If "( fnc(p->value) < 0)" for 1st node, the function returns null
> and never checks 2nd and the 3rd node for "( fnc(p->value) < 0)".


See above.
How is 'p' set?


> In my case "( fnc(p->value)" will be "> 0" only at the 3rd node. but
> at present if "( fnc(p->value) < 0)" for 1st node, "*var_fnc()" is
> never called again.


Then I'm not quite sure why you are using this particular test?

The 'var_fnc' routine will be called *once* to process *one*
varbind. The utility routine 'header_simple_table' will validate
the request (and update the OID for a GETNEXT request).

Then it's up to you to locate the row that's being asked for,
and return the appropriate column value. If you're asked
for a value from the first row, that's what you should return.
If you're asked for a value from the third row, then that's
what you should return. If you're asked for a value from the
fourth row, then you should return NULL.


With the limited code that you've shown us, it's impossible to
provide any more detailed advice.

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 08:18 PM.


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