Table iterator and get-next question

This is a discussion on Table iterator and get-next question within the SNMP Coders forums, part of the Networking and Network Related category; --0-84240442-1132857814=:84548 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Hi, I have a question ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 11-25-2005
Barbara Kuriata
 
Posts: n/a
Default Table iterator and get-next question

--0-84240442-1132857814=:84548
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: 8bit

Hi,

I have a question about implementation of the get-next request.

I've generated code for my MIB using the mib2c tool. In the init function I've registered the iterator access routines like below:

iinfo->get_first_data_point = myTable_get_first_data_point;
iinfo->get_next_data_point = myTable_get_next_data_point;

Those functions are then called by the netsnmp_table_iterator_helper_handler() routine from the table_iterator.c file. As I understand they are used to find the next index. But those functions can only return a valid pointer, which means the next index was found, or NULL if the end of table was reached. In the second case the next object is taken under consideration and the process continues.
But what happens if some error occurs either in get_first_data_point or get_next_data_point routine? Shouldn't the get-next process be interrupted and the General Error be returned in Response?

That what I thought after reading the RFC 3416, which explains processing of get-next requests the following way (chapter 4.2.2. The GetNextRequest-PDU):

"If the processing of any variable binding fails for a reason other
than listed above, then the Response-PDU is re-formatted with the
same values in its request-id and variable-bindings fields as the
received GetNextRequest-PDU, with the value of its error-status field
set to "genErr", and the value of its error-index field is set to the
index of the failed variable binding."

Is there any way to return error code from the get_first_data_point and get_next_data_point routines? Or error occuring in those functions is treated the same way as when next index is not found?

Thanks for any info
Baska


---------------------------------
Czy już jesteś w Yahoo!?
Oferujemy teraz 1GB pojemności
http://pl.mail.yahoo.com
--0-84240442-1132857814=:84548
Content-Type: text/html; charset=utf-8
Content-Transfer-Encoding: 8bit

<DIV id=RTEContent>Hi,</DIV> <DIV>&nbsp;</DIV> <DIV>I have a question about implementation of the get-next request.</DIV> <DIV>&nbsp;</DIV> <DIV>I've generated code for my MIB using the mib2c tool. In the init function I've registered the iterator access routines like below:</DIV> <DIV>&nbsp;</DIV> <DIV>iinfo-&gt;get_first_data_point =&nbsp; myTable_get_first_data_point;<BR>iinfo-&gt;get_next_data_point =&nbsp; myTable_get_next_data_point;<BR></DIV> <DIV>Those functions are then&nbsp;called by the&nbsp;netsnmp_table_iterator_helper_handler() routine from the table_iterator.c file. As I understand they are used to find the next index. But those functions can only return&nbsp;a valid pointer, which means the next index was found, or NULL&nbsp;if the end of table was reached. In the second case&nbsp;the next object is taken under consideration and the process continues.</DIV> <DIV>But what happens if some error occurs either in get_first_data_point or get_next_data_point
routine? Shouldn't the get-next process be interrupted and the General Error be returned in Response?</DIV> <DIV>&nbsp;</DIV> <DIV>That what I thought after reading the&nbsp;RFC 3416, which explains processing of get-next requests the following way (chapter 4.2.2.&nbsp; The GetNextRequest-PDU):</DIV> <DIV>&nbsp;</DIV> <DIV>"If the processing of any variable binding fails for a reason other<BR>&nbsp;&nbsp; than listed above, then the Response-PDU is re-formatted with the<BR>&nbsp;&nbsp; same values in its request-id and variable-bindings fields as the<BR>&nbsp;&nbsp; received GetNextRequest-PDU, with the value of its error-status field<BR>&nbsp;&nbsp; set to "genErr", and the value of its error-index field is set to the<BR>&nbsp;&nbsp; index of the failed variable binding."<BR></DIV> <DIV>Is there any way to return error code from the get_first_data_point and get_next_data_point routines? Or error occuring in those functions is treated the same way as when next index is
not
found?</DIV> <DIV>&nbsp;</DIV> <DIV>Thanks for any info</DIV> <DIV>Baska</DIV><p>
<hr size="1"><FONT face=Arial size=-1>Czy już jesteś w Yahoo!?<br>
Oferujemy teraz 1GB pojemności<br>
<a href="http://pl.mail.yahoo.com/">http://pl.mail.yahoo.com</a></font>
--0-84240442-1132857814=:84548--


-------------------------------------------------------
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-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 11:11 AM.


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