Referring to my oroblem outlined in (1) below ......

It seems the problem might be due to the fact that 
Table2(ocStbHostAnalogVideoTable) seems to be initialized before 
Table1(ocStbHostAVInterfaceTable), thus the cache from Table1 does not exist 
yet and can not be used for Table2.

Is there a way to indicate which table should init first?  I will keep looking 
around.



Need Help <[EMAIL PROTECTED]> wrote: 1) I updated my code a bit but for some 
reason the Table2_row_prep() routine is never called when I perform a 
"snmpwalk" of Table2.  Any ideas why "Table2_row_prep()" is not being called at 
all (see the steps a-e below)?


Here are the two tables I am dealing with for testing:

Table1(ocStbHostAVInterfaceTable)
Table2(ocStbHostAnalogVideoTable)


a) I updated the Table1(ocStbHostAVInterfaceTable) data_context structure to 
include the fields from Table2(ocStbHostAnalogVideoTable).

b) I updated Table2 "_ocStbHostAnalogVideoTable_container_init()" routine with 
the following code only, which I believe should tell Table2 to use the same 
cache as Table1(ocStbHostAVInterfaceTable):

    if_ctx->cache =
        netsnmp_cache_find_by_oid(ocStbHostAVInterfaceTable_oid, 
ocStbHostAVInterfaceTable_oid_size);

    if (NULL != if_ctx->cache)  {
        if_ctx->container = (netsnmp_container *) if_ctx->cache->magic;
        return;
    } else {
        snmp_log(LOG_ERR, "error finding ocStbHostAVInterfaceTable cache\n");
    }


c) I added printf statements to the "init_data", "container_init", 
"container_load" and "row_prep" routines of Table1 and Table2 to verify the 
flow through the code was correct when an SNMP request was performed.


d) When I start the SNMP agent the following flow is displayed.   Does this 
seem correct so far?


   ENTER ocStbHostAnalogVideoTable_init_data()
   EXIT  ocStbHostAnalogVideoTable_init_data()
   ENTER _ocStbHostAnalogVideoTable_container_init()
   EXIT  _ocStbHostAnalogVideoTable_container_init()
   ENTER  ocStbHostAVInterfaceTable_init_data()
   EXIT  ocStbHostAVInterfaceTable_init_data()
   ENTER ocStbHostAVInterfaceTable_container_init()
   EXIT  ocStbHostAVInterfaceTable_container_init()
   ENTER ocStbHostAVInterfaceTable_container_load()
   EXIT  ocStbHostAVInterfaceTable_container_load()



e) When I request a "snmpwalk" through Table1(ocStbHostAVInterfaceTable) then 
all of the fields of Table1 seem to displayed appropriately, however, doing a 
"snmpwalk" through Table2(ocStbHostAnalogVideoTable), returns nothing.  I 
simply get the Linux cursor back, without any error or anything.  Actually, 
none of my printf statements are displayed either, which means that the 
Table2_row_prep() routine is not being called at all.   Note: I realize the 
"Table2_container_load()" routine is not being called (which is normal) since 
Table2 is using the same cache as Table1.   I actually commented out all of the 
internal code in the "Table2_container_load()" routine, but I left the actual 
routine visible.  Basically, the routine simply does nothing now, it is just 
empty.



       
---------------------------------
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/listinfo/net-snmp-coders

Reply via email to