This is a discussion on Re: Expanding the "data_context" structure to include other Table within the SNMP Coders forums, part of the Networking and Network Related category; --===============0048060330== Content-Type: multipart/alternative; boundary="0-1421994043-1181235024=:5104" Content-Transfer-Encoding: 8bit --0-1421994043-1181235024=:5104 ...
|
|||||||
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
|
|||
|
--===============0048060330==
Content-Type: multipart/alternative; boundary="0-1421994043-1181235024=:5104" Content-Transfer-Encoding: 8bit --0-1421994043-1181235024=:5104 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit 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 <snmpnoob@yahoo.com> 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(ocStbHostAVInterfaceTabl e_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. --0-1421994043-1181235024=:5104 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: 8bit Referring to my oroblem outlined in (1) below ......<br><br>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.<br><br>Is there a way to indicate which table should init first? I will keep looking around.<br><br><br><br><b><i>Need Help <snmpnoob@yahoo.com></i></b> wrote:<blockquote class="replbq" style="border-left: 2px solid rgb(16, 16, 255); margin-left: 5px; padding-left: 5px;"> 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)?<br><br><br>Here are the two tables I am dealing with for testing:<br><br>Table1(ocStbHostAVInterfaceTable)< br>Table2(ocStbHostAnalogVideoTable)<br><br><br>a) I updated the Table1(ocStbHostAVInterfaceTable) data_context structure to include the fields from Table2(ocStbHostAnalogVideoTable).<br><br>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):<br><br> &n bsp; if_ctx->cache =<br> netsnmp_cache_find_by_oid(ocStbHostAVInterfaceTabl e_oid, ocStbHostAVInterfaceTable_oid_size);<br><br> if (NULL != if_ctx->cache) {<br> if_ctx->container = (netsnmp_container *) if_ctx->cache->magic;<br> return;<br> } else {<br> snmp_log(LOG_ERR, "error finding ocStbHostAVInterfaceTable cache\n");<br> }<br><br><br>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.<br><br><br>d) When I start the SNMP agent the following flow is displayed. Does this seem correct so far?<br><br><br> ENTER ocStbHostAnalogVideoTable_init_data()<br> &nb sp; EXIT ocStbHostAnalogVideoTable_init_data()<br> &nb sp; ENTER _ocStbHostAnalogVideoTable_container_init()<br>&nb sp; EXIT _ocStbHostAnalogVideoTable_container_init()<br>&nb sp; ENTER ocStbHostAVInterfaceTable_init_data()<br> &nb sp; EXIT ocStbHostAVInterfaceTable_init_data()<br> &nb sp; ENTER ocStbHostAVInterfaceTable_container_init()<br>&nbs p; EXIT ocStbHostAVInterfaceTable_container_init()<br>&nbs p; ENTER ocStbHostAVInterfaceTable_container_load()<br>&nbs p; EXIT ocStbHostAVInterfaceTable_container_load()<br><br> <br><br>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.<br><br></blockquote><br><p> <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. --0-1421994043-1181235024=:5104-- --===============0048060330== 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/ --===============0048060330== 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 --===============0048060330==-- |