I am using NetSNMP v5.4.1 and have create my code using mib2c using the MfD 
config file.


Disclaimer: 
I have tried to trace through what the NetSNMP code is doing but I can not 
determine what is going on.  It is very hard for me to follow at this point.  I 
have tried to use some debugging statements when performing the SNMP requests 
as well, but can not seem to make any sense out of the output.  I have been 
working 12 hour days on this to try to find a solution but am not getting 
close, so hopefully someone with MfD experience can help me out.


Here is how my tables are populated:

** If you cut-n-paste the chart below into a text editor then everything should 
line up, but perhaps you can still get the idea of what I am trying to 
describe. 
 

   |TYPE |DESC |STAT |   EXTENSION TABLE FIELDS    |
   +-----+-----+-----+-----------------------------+
 1 |1394 |text | off |    |    |    |    |    | T7 |
   +-----+-----+-----+----+----+----+----+----+----+
 2 |1394 |text | off |    |    |    |    |    | T7 |
   +-----+-----+-----+----+----+----+----+----+----+
 3 |RCA  |text | on  | T2 |    |    |    |    |    |
   +-----+-----+-----+----+----+----+----+----+----+
 4 |RCA  |text | on  | T2 |    |    |    |    |    |
   +-----+-----+-----+----+----+----+----+----+----+
 5 |RMOD |text | on  | T2 |    |    | T5 |    |    |
   +-----+-----+-----+----+----+----+----+----+----+
 6 |SVID |text | on  | T2 |    | T4 |    |    |    |
   +-----+-----+-----+----+----+----+----+----+----+
 7 |SVID |text | on  | T2 |    | T4 |    |    |    |
   +-----+-----+-----+----+----+----+----+----+----+
 8 |COMP |text | on  | T2 | T3 |    |    |    |    |
   +-----+-----+-----+----+----+----+----+----+----+
 8 |SDIF |text | on  |    |    |    |    | T6 |    |
   +-----+-----+-----+----+----+----+----+----+----+
10 |1394 |text | off |    |    |    |    |    | T7 |
   +-----+-----+-----+----+----+----+----+----+----+


My main table (Table1) has 10 rows and each row has a "Type", "Description" and 
"Status" value.  There are other tables (T2,T3,T4,T5,T6,T7) which extend the 
main table.  The "Type" value in the row defines which table fields extend this 
row.  For example, if the "Type" is "RCA, RMOD, SVID, COMP" then Table2(T2) 
field data is located in this row.  If the "Type" field is "COMP" then 
Table3(T3) extends this row. You will notice tables T3,T4,T5,T6,T7 are mutually 
exclusive to each other.

I am doing a similiar thing as the ifTable/ifXTable provided by NetSNMP do in 
that my tables share the same cache/container of the main table.   Also, all of 
the extension tables (T2,T3,T4,T5,T6,T7) have their structures defined in the 
main "Table.h" file (just like the ifXTable does).

When I perform a "snmpwalk" through an extension table (T2,T3,T4,T5,T6.T7), I 
believe the row_prep() routine will be called 10 times (one time for each row 
defined in the main Table1). I am returning MFD_SKIP for those rows which are 
not related to the extension table (T2,T3,T4,T5,T6,T7) which I am walking 
through.  

Robert helped me add some code to the "TableX_object_lookup()" and 
"TableX_get_values()" routines to be able to handle the MFD_SKIP response code 
from the row_prep() routine.

What I believe should occur when performing a snmpwalk request through an 
extension table (ex: T3) is that the main Table1_container_load() routine 
should be called once (assuming the cache has expired) and then the 
T3_row_prep() routine should be called 10 times (ie: one time for each row in 
Table1).  Is this correct?


Problem1:

When I perform an SNMPWALK request (see below) for the main Table1, then the 
following happens:

   /usr/local/bin/snmpwalk -v1 -c pace_ro 127.0.0.1 ocStbHostAVInterfaceTable


1) I see Table1_container_load() routine execute one time and the 
Table1_row_prep() routine executes "30 times" (ie: goes through all rows in the 
table 3 times).  Why would row_prep() be called 30 times?

2) After (1) completes, then the Table3_row_prep() routine is called "528 
times".   The Table3_row_prep() routine is called for rows 1 thru 7 and I 
return MFD_SKIP since these rows are not related to Table3.  The 
Table3_row_prep() routine is then called for row 8 and I return MFD_SUCCESS to 
indicate the data is populated correctly.  Next, the Table3_row_prep() routine 
is called again for rows 1 thru 8 again, and again, and again.   It repeatedly 
cycles through row 1 thru 8 a total of 66 times, thus 66x8=528 times 
Table3_row_prep() routine is called.


NOTE: The resulted display of this request shows the 10 "Type", "Desc" and 
"Status" values.  I do not think a a snmpwalk request of Table1 should show any 
of the extended table data fields, so this output seems correct.  I just do not 
understand why the row_prep() routines are being called so many times.


Problem2 (related):

When I perform an SNMPGETNEXT request (see below) indicating the last entry in 
Table1, then the following happens:

  /usr/local/bin/snmpgetnext -v 1 -c pace_ro 127.0.0.1 
ocStbHostAVInterfaceStatus.10


1) I see Table1_container_load() routine execute one time.  The 
Table1_row_prep() routine does not execute.  I think this is normal.

2) After (1) completes, then the Table3_row_prep() routine is called "128 
times".   The Table3_row_prep() routine is called for rows 1 thru 7 and I 
return MFD_SKIP since these rows are not related to Table3.  The 
Table3_row_prep() routine is then called for row 8 and I return MFD_SUCCESS to 
indicate the data is populated correctly.  Next, the Table3_row_prep() routine 
is called again for rows 1 thru 8 again, and again, and again.   It repeatedly 
cycles through row 1 thru 8 a total of 16 times, thus 16x8=128 times 
Table3_row_prep() routine is called.

NOTE: The resulted display of this request shows the 1 Table3(T3) field from 
row 8.  I am not sure what really should be displayed when performing a 
snmpgetnext this way ... and of course do not know why the row_prep() is being 
called so many times.


       
---------------------------------
Ready for the edge of your seat? Check out tonight's top picks on Yahoo! TV. 
-------------------------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc.
Still grepping through log files to find problems?  Stop.
Now Search log events and configuration files using AJAX and a browser.
Download your FREE copy of Splunk now >>  http://get.splunk.com/
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to