Re: Expanding the "data_context" structure to include other Table

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 ...


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-07-2007
Need Help
 
Posts: n/a
Default Re: Expanding the "data_context" structure to include other Table

--===============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?&nbsp; I will keep looking around.<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;"> 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.&nbsp; 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>&nbsp;&n bsp;&nbsp; if_ctx-&gt;cache =<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; netsnmp_cache_find_by_oid(ocStbHostAVInterfaceTabl e_oid, ocStbHostAVInterfaceTable_oid_size);<br><br>&nbsp; &nbsp;&nbsp; if (NULL != if_ctx-&gt;cache) {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if_ctx-&gt;container = (netsnmp_container *) if_ctx-&gt;cache-&gt;magic;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp; return;<br>&nbsp;&nbsp;&nbsp; } else {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; snmp_log(LOG_ERR, "error finding ocStbHostAVInterfaceTable cache\n");<br>&nbsp;&nbsp;&nbsp; }<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.&nbsp;&nbsp; Does this seem correct so far?<br><br><br>&nbsp;&nbsp; ENTER ocStbHostAnalogVideoTable_init_data()<br>&nbsp;&nb sp; EXIT&nbsp; ocStbHostAnalogVideoTable_init_data()<br>&nbsp;&nb sp; ENTER _ocStbHostAnalogVideoTable_container_init()<br>&nb sp;&nbsp; EXIT&nbsp; _ocStbHostAnalogVideoTable_container_init()<br>&nb sp;&nbsp; ENTER ocStbHostAVInterfaceTable_init_data()<br>&nbsp;&nb sp; EXIT&nbsp; ocStbHostAVInterfaceTable_init_data()<br>&nbsp;&nb sp; ENTER ocStbHostAVInterfaceTable_container_init()<br>&nbs p;&nbsp; EXIT&nbsp; ocStbHostAVInterfaceTable_container_init()<br>&nbs p;&nbsp; ENTER ocStbHostAVInterfaceTable_container_load()<br>&nbs p;&nbsp; EXIT&nbsp; 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.&nbsp; I simply get the Linux cursor back, without any error or anything.&nbsp; Actually, none of my printf statements are displayed either, which means that the Table2_row_prep() routine is not being called at all.&nbsp;&nbsp; Note: I realize the "Table2_container_load()" routine is not being called (which is normal) since Table2 is using the same cache as Table1.&nbsp; I actually commented out all of the internal code in the "Table2_container_load()" routine, but I left the actual routine visible.&nbsp; 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==--


Reply With Quote
Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
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

BB 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 06:11 AM.


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