Re: row_prep() returning MFD_SKIP results in error

This is a discussion on Re: row_prep() returning MFD_SKIP results in error within the SNMP Coders forums, part of the Networking and Network Related category; --===============0763276256== Content-Type: multipart/alternative; boundary="0-2034170350-1182369017=:16447" Content-Transfer-Encoding: 8bit --0-2034170350-1182369017=:16447 ...


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

FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 06-20-2007
Need Help
 
Posts: n/a
Default Re: row_prep() returning MFD_SKIP results in error

--===============0763276256==
Content-Type: multipart/alternative; boundary="0-2034170350-1182369017=:16447"
Content-Transfer-Encoding: 8bit

--0-2034170350-1182369017=:16447
Content-Type: text/plain; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

1) I verified the following code segment (which was added into the "_mfd_ocStbHostAnalogVideoTable_get_values()" routine) is never being executed (ie: never is true), so row3 still displays:

if (requests->processed)
continue;

I looked around the code a bit and noticed some things which might explain the reason for this occurring. In the "_mfd_ocStbHostAnalogVideoTable_object_lookup( )" routine the following code exists:

if (MFD_SUCCESS != rc)
netsnmp_request_set_error_all(requests, rc);
else {
rc = ocStbHostAnalogVideoTable_row_prep(rowreq_ctx);
if (rc == MFD_SKIP) {
netsnmp_request_info *req;
for (req=requests; req; req=req->next)
req->requestvb->type = SNMP_NOSUCHINSTANCE;
rc = SNMP_ERR_NOERROR;
}
}

You will notice when an error occurs then the "netsnmp_request_set_error_all()" routine is called. This routine will call the "_request_set_error()" routine which will set the "requests->processed" field to "1" as well as setting the "requestvb->type " field appropriately.

However, if no error occurred then the "ocStbHostAnalogVideoTable_row_prep()" routine is called. When a MFD_SKIP value is returned then we simply set the "requestvb->type" only and DO NOT set the "processed" field to "1" at all.

I believe this is the reason why our the check for "processed == 1" does not work.


2) As a result of (1) above, I decided to try the following code in the "_mfd_ocStbHostAnalogVideoTable_get_values()" routine which checks to check for the "requestvb->type" field instead:

if (requests->requestvb->type == SNMP_NOSUCHINSTANCE)
continue;


This code works correctly by skipping row3. When I perform a "snmpgetnext" on row2, then row4 is now displayed.

Is this the solution I should use or shall I set the "processed = 1" value in the "_mfd_ocStbHostAnalogVideoTable_object_lookup( )" routine along with the "requestvb->type" value. If so, then I could use your original code by checking whether the "processed" field is "1".


Here is the trace output for case (2) which worked (I removed my printf statements):

[net-snmp]# /export/home/myname/snmp/usr/local/bin/snmpgetnext -v 1 -c mycommunity_ro localhost ocStbHostAnalogVideoProtectionStatus.2

handler:calling: main handler bulk_to_next
handler:calling: calling handler bulk_to_next for mode GETNEXT
handler:returned: handler bulk_to_next returned 0
handler:calling: calling handler table for mode GETNEXT
handler:calling: calling handler cache_handler for mode GETNEXT
handler:returned: handler cache_handler returned 0
handler:calling: calling handler table_container for mode GETNEXT
table_container: Mode GETNEXT, Got request:
table_container: data_lookup oid:OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.2
handler:calling: calling handler row_merge for mode GET
handler:calling: calling handler baby_steps for mode GET
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_pre_request: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_pre_request: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_object_lookup: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_row_prep: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode GET
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_values: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_post_request: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_post_request: called
handler:returned: handler baby_steps_mux returned 0
handler:returned: handler baby_steps returned 0
handler:returned: handler row_merge returned 0
handler:returned: handler table_container returned 0
sparse: retry for NOSUCHINSTANCE
handler:returned: handler table returned 0
handler:calling: main handler bulk_to_next
handler:calling: calling handler bulk_to_next for mode GETNEXT
handler:returned: handler bulk_to_next returned 0
handler:calling: calling handler table for mode GETNEXT
handler:calling: calling handler cache_handler for mode GETNEXT
handler:returned: handler cache_handler returned 0
handler:calling: calling handler table_container for mode GETNEXT
table_container: Mode GETNEXT, Got request:
table_container: data_lookup oid:OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.3
handler:calling: calling handler row_merge for mode GET
handler:calling: calling handler baby_steps for mode GET
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_pre_request: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_pre_request: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_object_lookup: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_row_prep: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode GET
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_values: called
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_column: called for 1
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoProtectionStatus_get: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_post_request: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_post_request: called
handler:returned: handler baby_steps_mux returned 0
handler:returned: handler baby_steps returned 0
handler:returned: handler row_merge returned 0
handler:returned: handler table_container returned 0
handler:returned: handler table returned 0
OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.4 = INTEGER: fourLineSplitBurst(3)






Need Help <snmpnoob@yahoo.com> wrote: Based on the changes I described I was going to make (see my last email below this one), it seems row3 does not get skipped. It is still displayed when you perform the "snmpgetnext" request on row2.

Here is the trace output:

[net-snmp]# /export/home/myname/snmp/usr/local/bin/snmpgetnext -v 1 -c mycommunity_ro localhost ocStbHostAnalogVideoProtectionStatus.2

handler:calling: main handler bulk_to_next
handler:calling: calling handler bulk_to_next for mode GETNEXT
handler:returned: handler bulk_to_next returned 0
handler:calling: calling handler table for mode GETNEXT
handler:calling: calling handler cache_handler for mode GETNEXT
handler:returned: handler cache_handler returned 0
handler:calling: calling handler table_container for mode GETNEXT
table_container: Mode GETNEXT, Got request:
table_container: data_lookup oid:OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.2
handler:calling: calling handler row_merge for mode GET
handler:calling: calling handler baby_steps for mode GET
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_pre_request: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_pre_request: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_object_lookup: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_row_prep: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode GET
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_values: called
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_column: called for 1
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoProtectionStatus_get: called
handler:returned: handler baby_steps_mux returned 0
handler:calling: calling handler baby_steps_mux for mode (null)
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_post_request: called
verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_post_request: called
handler:returned: handler baby_steps_mux returned 0
handler:returned: handler baby_steps returned 0
handler:returned: handler row_merge returned 0
handler:returned: handler table_container returned 0
handler:returned: handler table returned 0
OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.3 = INTEGER: copyProtectionOff(0)





Need Help <snmpnoob@yahoo.com> wrote: I am confused with your "put back in the prep SKIP" statement.

The row_prep() routine which returns MFD_SKIP was never removed, so I am assuming you want me to put back in the "object_lookup" code which returns the MFD_SKIP value.

I am planning on doing the following .... please confirm.

1) Put the following code back into the "_mfd_ocStbHostAnalogVideoTable_object_lookup( )":

if (rc == MFD_SKIP) {
netsnmp_request_info *req;
for (req=requests; req; req=req->next)
req->requestvb->type = SNMP_NOSUCHINSTANCE;
rc = SNMP_ERR_NOERROR;
}

2) Remove the code from "ocStbHostAnalogVideoProtectionStatus_get()" which checks for ProtectionStatus = 0 (copyProtectionOff) value.

3) Update the "_mfd_ocStbHostAnalogVideoTable_get_values()" routine with your suggested code.



Robert Story <rstory@freesnmp.com> wrote: On Wed, 20 Jun 2007 06:12:08 -0700 (PDT) Need wrote:
NH> Ok, I changed the analog table's interface handler back to how it use to be (ie: no MFD_SKIP logic) and added the logic you recommended to return MFD_SKIP to the analog table's "get" handler for the ProtectionStatus field.
NH>
NH> [...] Perhaps you are just having me add this logic to acquire some more traces only?

Yes, exactly.

NH> Now, here is the trace output you requested:
NH>
NH> internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_object_lookup: called
NH> verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_row_prep: called
NH> SKIP ROW ocStbHostAnalogVideoTable_row_prep() row=3
NH> handler:returned: handler baby_steps_mux returned 0
NH> handler:calling: calling handler baby_steps_mux for mode GET
NH> internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_values: called
NH> internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_column: called for 1
NH> verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoProtectionStatus_get: called
NH> SKIP STATUS row=3
NH> handler:returned: handler baby_steps_mux returned 0
NH> handler:calling: calling handler baby_steps_mux for mode (null)
NH> internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_post_request: called
NH> verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_post_request: called
NH> handler:returned: handler baby_steps_mux returned 0
NH> handler:returned: handler baby_steps returned 0
NH> handler:returned: handler row_merge returned 0
NH> handler:returned: handler table_container returned 0
NH> sparse: retry for NOSUCHINSTANCE

Ok, this confirms what I thought... the baby steps handler only checks for
hard errors, and since NOSUCHINSTANCE is a soft error, it keeps on going. So,
options are:

1) set a hard error in addition to a soft one. This will break out of the
handler, but will result in an imbalance - pre_request was called, but
post_request won't be. (though it could be called manually from your interface
code.)

2) update the handler to check for soft errors on object lookup. But I'm
loathe to add extra checks for this special case.

3) let the processing continue, but update your interface code to skip
requests with soft errors.

Let's start with #3. So, put back in the prep SKIP, remove the status SKIP,
and update _mfd_XXX_get_values:

change

for (; requests; requests = requests->next) {
/*
* save old pointer, so we can free it if replaced
*/

to

for (; requests; requests = requests->next) {
if (requests->processed)
continue;
/*
* save old pointer, so we can free it if replaced
*/

and give that a whirl...



---------------------------------
Park yourself in front of a world of choices in alternative vehicles.
Visit the Yahoo! Auto Green Center.-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/...______________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders



---------------------------------
Sick sense of humor? Visit Yahoo! TV's Comedy with an Edge to see what's on, when. -------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/...______________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders



---------------------------------
Get the free Yahoo! toolbar and rest assured with the added security of spyware protection.
--0-2034170350-1182369017=:16447
Content-Type: text/html; charset=iso-8859-1
Content-Transfer-Encoding: 8bit

<span style="font-weight: bold;">1)</span>&nbsp; I verified the following code segment (which was added into the&nbsp; "_mfd_ocStbHostAnalogVideoTable_get_values()" routine) is never being executed (ie: never is true), so row3 still displays:<br><br><span style="font-weight: bold;">&nbsp;&nbsp; if (requests-&gt;processed)</span><br style="font-weight: bold;"> <span style="font-weight: bold;">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;</span><br> <br>I looked around the code a bit and noticed some things which might explain the reason for this occurring.&nbsp; In the "_mfd_ocStbHostAnalogVideoTable_object_lookup( )" routine the following code exists:<br><br>&nbsp;&nbsp;<span style="font-weight: bold;"> if (MFD_SUCCESS != rc)</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp; &nbsp;&nbsp; netsnmp_request_set_error_all(requests, rc);</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp;&nbsp; else {</span><br
style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp;&nbsp; rc = ocStbHostAnalogVideoTable_row_prep(rowreq_ctx);</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp;&nbsp; if (rc == MFD_SKIP) {</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; netsnmp_request_info *req;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; for (req=requests; req;&nbsp; req=req-&gt;next)</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; req-&gt;requestvb-&gt;type = SNMP_NOSUCHINSTANCE;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp; &nbsp;&nbsp;&nbsp; rc = SNMP_ERR_NOERROR;</span><br style="font-weight: bold;"><span style="font-weight: bold;">&nbsp; &nbsp;&nbsp; }</span><br style="font-weight: bold;"><span style="font-weight:
bold;">&nbsp;&nbsp; }</span><br><br>You will notice when an error occurs then the "netsnmp_request_set_error_all()" routine is called.&nbsp; This routine will call the "_request_set_error()" routine which will set the "requests-&gt;processed" field to "1" as well as setting the "requestvb-&gt;type " field appropriately.<br><br>However, if no error occurred then the "ocStbHostAnalogVideoTable_row_prep()" routine is called.&nbsp; When a MFD_SKIP value is returned then we simply set the "requestvb-&gt;type" only and DO NOT set the "processed" field to "1" at all.&nbsp;&nbsp; <br><br>I believe this is the reason why our the check for "processed == 1" does not work.<br><br><br><span style="font-weight: bold;">2)</span>&nbsp; As a result of (1) above, I decided to try the following code in the "_mfd_ocStbHostAnalogVideoTable_get_values()" routine which checks to check for the "requestvb-&gt;type" field instead:<br><br>&nbsp;<span style="font-weight: bold;">&nbsp; if
(requests-&gt;requestvb-&gt;type == SNMP_NOSUCHINSTANCE)</span><br style="font-weight: bold;"><span style="font-weight: bold;"> &nbsp;&nbsp;&nbsp;&nbsp;&nbsp; continue;</span><br> <br><br>This <span style="font-weight: bold; text-decoration: underline;">code works</span> correctly by skipping row3.&nbsp; When I perform a "snmpgetnext" on row2, then row4 is now displayed.<br><br>Is this the solution I should use or shall I set the "processed = 1" value in the "_mfd_ocStbHostAnalogVideoTable_object_lookup( )" routine along with the "requestvb-&gt;type" value.&nbsp; If so, then I could use your original code by checking whether the "processed" field is "1".<br><br><br><span style="text-decoration: underline;">Here is the trace output for case (2) which worked (I removed my printf statements):</span><br><br>[net-snmp]# <span style="font-weight: bold;">/export/home/myname/snmp/usr/local/bin/snmpgetnext -v 1 -c mycommunity_ro localhost
ocStbHostAnalogVideoProtectionStatus.2</span><br><br>handler:calling: main handler bulk_to_next<br>handler:calling: calling handler bulk_to_next for mode GETNEXT<br>handler:returned: handler bulk_to_next returned 0<br>handler:calling: calling handler table for mode GETNEXT<br>handler:calling: calling handler cache_handler for mode GETNEXT<br>handler:returned: handler cache_handler returned 0<br>handler:calling: calling handler table_container for mode GETNEXT<br>table_container: Mode GETNEXT, Got request:<br>table_container:&nbsp;&nbsp; data_lookup oid:OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.2<br>han dler:calling: calling handler row_merge for mode GET<br>handler:calling: calling handler baby_steps for mode GET<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_pre_request: called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_pre_request:
called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_object_lookup: called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_row_prep: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode GET<br>internal:ocStbHostAnalogVideoTable:_mfd_ocS tbHostAnalogVideoTable_get_values: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_post_request: called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_post_request: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:returned: handler baby_steps returned 0<br>handler:returned: handler row_merge returned 0<br>handler:returned: handler
table_container returned 0<br>sparse: retry for NOSUCHINSTANCE<br>handler:returned: handler table returned 0<br>handler:calling: main handler bulk_to_next<br>handler:calling: calling handler bulk_to_next for mode GETNEXT<br>handler:returned: handler bulk_to_next returned 0<br>handler:calling: calling handler table for mode GETNEXT<br>handler:calling: calling handler cache_handler for mode GETNEXT<br>handler:returned: handler cache_handler returned 0<br>handler:calling: calling handler table_container for mode GETNEXT<br>table_container: Mode GETNEXT, Got request:<br>table_container:&nbsp;&nbsp; data_lookup oid:OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.3<br>han dler:calling: calling handler row_merge for mode GET<br>handler:calling: calling handler baby_steps for mode GET<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_pre_request:
called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_pre_request: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_object_lookup: called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_row_prep: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode GET<br>internal:ocStbHostAnalogVideoTable:_mfd_ocS tbHostAnalogVideoTable_get_values: called<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_get_column: called for 1<br>verbose:ocStbHostAnalogVideoTable:ocStbHostAn alogVideoProtectionStatus_get: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_post_request:
called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_post_request: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:returned: handler baby_steps returned 0<br>handler:returned: handler row_merge returned 0<br>handler:returned: handler table_container returned 0<br>handler:returned: handler table returned 0<br><span style="font-weight: bold;">OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.4 = INTEGER: fourLineSplitBurst(3)</span><br><br><br><br><br><br><br><b><i>Need Help &lt;snmpnoob@yahoo.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> Based on the changes I described I was going to make (see my last email below this one), it seems row3 does not get skipped.&nbsp; It is still displayed when you perform the "snmpgetnext" request on row2.<br><br>Here is the trace output:<br><br>[net-snmp]#<span style="font-weight: bold;">
/export/home/myname/snmp/usr/local/bin/snmpgetnext -v 1 -c mycommunity_ro localhost ocStbHostAnalogVideoProtectionStatus.2</span><br><br>handler:calling: main handler bulk_to_next<br>handler:calling: calling handler bulk_to_next for mode GETNEXT<br>handler:returned: handler bulk_to_next returned 0<br>handler:calling: calling handler table for mode GETNEXT<br>handler:calling: calling handler cache_handler for mode GETNEXT<br>handler:returned: handler cache_handler returned 0<br>handler:calling: calling handler table_container for mode GETNEXT<br>table_container: Mode GETNEXT, Got request:<br>table_container:&nbsp;&nbsp; data_lookup oid:OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.2<br>han dler:calling: calling handler row_merge for mode GET<br>handler:calling: calling handler baby_steps for mode GET<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_pre_request:
called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_pre_request: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_object_lookup: called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_row_prep: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode GET<br>internal:ocStbHostAnalogVideoTable:_mfd_ocS tbHostAnalogVideoTable_get_values: called<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_get_column: called for 1<br>verbose:ocStbHostAnalogVideoTable:ocStbHostAn alogVideoProtectionStatus_get: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:calling: calling handler baby_steps_mux for mode (null)<br>internal:ocStbHostAnalogVideoTable:_mfd_ ocStbHostAnalogVideoTable_post_request:
called<br>verbose:ocStbHostAnalogVideoTable:ocStbH ostAnalogVideoTable_post_request: called<br>handler:returned: handler baby_steps_mux returned 0<br>handler:returned: handler baby_steps returned 0<br>handler:returned: handler row_merge returned 0<br>handler:returned: handler table_container returned 0<br>handler:returned: handler table returned 0<br><span style="font-weight: bold;">OC-STB-HOST-MIB::ocStbHostAnalogVideoProtectionStatus.3 = INTEGER: copyProtectionOff(0)</span><br><br><br><br><br><br><b><i>Need Help &lt;snmpnoob@yahoo.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> I am confused with your "put back in the <span style="font-weight: bold;">prep </span>SKIP" statement.<br><br>The row_<span style="font-weight: bold;">prep</span>() routine which returns MFD_SKIP was never removed, so I am assuming you want me to put back in the "object_lookup" code which returns the MFD_SKIP
value.&nbsp;&nbsp; <br><br>I am planning on doing the following .... please confirm.<br><br>1) Put the following code back into the "_mfd_ocStbHostAnalogVideoTable_object_lookup()":< br><br>&nbsp;&nbsp; <font size="1">if (rc == MFD_SKIP) {<br>&nbsp; &nbsp; &nbsp; netsnmp_request_info *req;<br>&nbsp; &nbsp; &nbsp; for (req=requests; req;&nbsp; req=req-&gt;next)<br>&nbsp; &nbsp; &nbsp;&nbsp;&nbsp;&nbsp; req-&gt;requestvb-&gt;type = SNMP_NOSUCHINSTANCE;<br>&nbsp; &nbsp; &nbsp; rc = SNMP_ERR_NOERROR;<br>&nbsp;&nbsp; }</font><br><br>2) Remove the code from "ocStbHostAnalogVideoProtectionStatus_get()" which checks for ProtectionStatus = 0 (copyProtectionOff) value.<br><br>3) Update the "_mfd_ocStbHostAnalogVideoTable_get_values()" routine with your suggested code.<br><br><br><br><b><i>Robert Story &lt;rstory@freesnmp.com&gt;</i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> On Wed, 20 Jun 2007
06:12:08 -0700 (PDT) Need wrote:<br>NH&gt; Ok, I changed the analog table's interface handler back to how it use to be (ie: no MFD_SKIP logic) and added the logic you recommended to return MFD_SKIP to the analog table's "get" handler for the ProtectionStatus field.<br>NH&gt; <br>NH&gt; [...] Perhaps you are just having me add this logic to acquire some more traces only?<br><br>Yes, exactly.<br><br>NH&gt; Now, here is the trace output you requested:<br>NH&gt; <br>NH&gt; internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_object_lookup: called<br>NH&gt; verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_row_prep: called<br>NH&gt; SKIP ROW ocStbHostAnalogVideoTable_row_prep() row=3<br>NH&gt; handler:returned: handler baby_steps_mux returned 0<br>NH&gt; handler:calling: calling handler baby_steps_mux for mode GET<br>NH&gt; internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_values: called<br>NH&gt;
internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_get_column: called for 1<br>NH&gt; verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoProtectionStatus_get: called<br>NH&gt; SKIP STATUS row=3<br>NH&gt; handler:returned: handler baby_steps_mux returned 0<br>NH&gt; handler:calling: calling handler baby_steps_mux for mode (null)<br>NH&gt; internal:ocStbHostAnalogVideoTable:_mfd_ocStbHostA nalogVideoTable_post_request: called<br>NH&gt; verbose:ocStbHostAnalogVideoTable:ocStbHostAnalogV ideoTable_post_request: called<br>NH&gt; handler:returned: handler baby_steps_mux returned 0<br>NH&gt; handler:returned: handler baby_steps returned 0<br>NH&gt; handler:returned: handler row_merge returned 0<br>NH&gt; handler:returned: handler table_container returned 0<br>NH&gt; sparse: retry for NOSUCHINSTANCE<br><br>Ok, this confirms what I thought... the baby steps handler only checks for<br>hard errors, and since NOSUCHINSTANCE is a soft error, it keeps on going.
So,<br>options are:<br><br>1) set a hard error in addition to a soft one. This will break out of the<br>handler, but will result in an imbalance - pre_request was called, but<br>post_request won't be. (though it could be called manually from your interface<br>code.)<br><br>2) update the handler to check for soft errors on object lookup. But I'm<br>loathe to add extra checks for this special case.<br><br>3) let the processing continue, but update your interface code to skip<br>requests with soft errors.<br><br>Let's start with #3. So, put back in the prep SKIP, remove the status SKIP,<br>and update _mfd_XXX_get_values:<br><br>change<br><br> for (; requests; requests = requests-&gt;next) {<br> /*<br> * save old pointer, so we can free it if replaced<br> */<br><br>to<br><br> for (; requests; requests = requests-&gt;next) {<br> if (requests-&gt;processed)<br> continue;<br> /*<br> * save old pointer, so we can free
it if replaced<br> */<br><br>and give that a whirl...<br></blockquote><br><div> </div><hr size="1">Park yourself in front of a world of choices in alternative vehicles.<br><a href="http://us.rd.yahoo.com/evt=48246/*http://autos.yahoo.com/green_center/;_ylc=X3oDMTE5cDF2bXZzBF9TAzk3MTA3MDc2BHNlYwNtYWls dGFncwRzbGsDZ3JlZW4tY2VudGVy">Visit the Yahoo! Auto Green Center.</a>-------------------------------------------------------------------------<br>This SF.net email is sponsored by DB2 Express<br>Download DB2 Express C - the FREE version of DB2 express and take<br>control of your XML. No limits. Just data. Click to get it now.<br>http://sourceforge.net/powerbar/db2/_______________________________________________<br >Net-snmp-coders mailing list<br>Net-snmp-coders@lists.sourceforge.net<br>https://lists.sourceforge.net/lists/listinfo/net-snmp-coders<br></blockquote><br><div> </div><hr size="1">Sick sense of humor? Visit Yahoo! TV's <a
href="http://us.rd.yahoo.com/evt=47093/*http://tv.yahoo.com/collections/222">Comedy with an Edge </a>to see what's on, when. -------------------------------------------------------------------------<br>This SF.net email is sponsored by DB2 Express<br>Download DB2 Express C - the FREE version of DB2 express and take<br>control of your XML. No limits. Just data. Click to get it now.<br>http://sourceforge.net/powerbar/db2/_______________________________________________<br >Net-snmp-coders mailing list<br>Net-snmp-coders@lists.sourceforge.net<br>https://lists.sourceforge.net/lists/listinfo/net-snmp-coders<br></blockquote><br><p>
<hr size=1><a href="http://us.rd.yahoo.com/evt=48226/*http://new.toolbar.yahoo.com/toolbar/features/norton/index.php">Get the free Yahoo! toolbar</a> and rest assured with the added security of spyware protection.

--0-2034170350-1182369017=:16447--


--===============0763276256==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
--===============0763276256==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Net-snmp-coders mailing list
Net-snmp-coders@lists.sourceforge.net
https://lists.sourceforge.net/lists/...et-snmp-coders

--===============0763276256==--

Reply With Quote
Reply


Thread Tools
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

vB 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 10:40 PM.


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