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 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--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> </DIV> <DIV>I have a question about implementation of the get-next request.</DIV> <DIV> </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> </DIV> <DIV>iinfo->get_first_data_point = myTable_get_first_data_point;<BR>iinfo->get_next_data_point = myTable_get_next_data_point;<BR></DIV> <DIV>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.</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> </DIV> <DIV>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):</DIV> <DIV> </DIV> <DIV>"If the processing of any variable binding fails for a reason other<BR> than listed above, then the Response-PDU is re-formatted with the<BR> same values in its request-id and variable-bindings fields as the<BR> received GetNextRequest-PDU, with the value of its error-status field<BR> set to "genErr", and the value of its error-index field is set to the<BR> 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> </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 |