FOUND IT
My problem was caused by having Table1 try to #include the header file from
Table2 while Table2 had code to #include the header file from Table1. Things
were getting screwy.
I fixed this and it now compiles but I have a question.
1) Table2 included the Table1 header file so it could share the data structures
defined in Table1. This is required based on how the ifTable/ifXTable share
the data structures, so this seemed fine.
Based on previous discussions, my goal was to update the data_context of Table1
to include a "union" of all the required "extended table" data structures since
they are mutually exclusive to each other. Since Table2 already had all of
it's data fields defined in one data_context structure, I thought I could
simply have Table1 "#include" the header from Table2 and use this structure
inside the Table1 data_context "union" definition.
I then figured out I could not compile since both tables were trying to include
each other's header files and this caused some problems.
Anyway, I looked how ifTable/ifXTable handled this scenario and I saw that the
ifTable did "not" include the header file from the ifXTable, but instead all of
the fields in the ifXTable were copied into the ifTable data_context directly.
I decided I could not simply copy all of the fields from my Table2 data_context
into the Table1 data_context since I wanted to use a "union" of each table, so
I needed to keep all the table data fields defined within their own structure.
Using structures within the "union" definition allows me to keep each table
mutually exclusive to each other easily. Anyway, what I ended up doing was
simply moving the Table2 data_context structure definition into the header file
of Table1 (I also renamed this data structure so the name did not conflict).
Everything compiles now, but I have a question. Knowing that I have six tables
which are extensions of Table1, then I would need to copy all of the
data_context structures from these six extension tables into the Table1 header
file to allow the "union" to work.
Is there a better way to go about this? I mean, should Table1 header file
include all data_context structure definitions from all extension tables?
2) Looking at how the ifTable/ifXTable code is implemented, I believe I do not
need the following routines in my Table2 "interface.c" file. Would you please
let me know if you agree that I can delete the following routines (also if you
think there are more, then let me know):
Table2_allocate_rowreq_ctx()
Table2_release_rowreq_ctx()
_cache_load()
_cache_free()
_container_item_free()
_container_free()
3) I also decided I needed to update the _mfd_Table2_post_request() routine in
Table2 to ...
replace:
Table2_release_rowreq_ctx(rowreq_ctx);
with:
Table1_release_rowreq_ctx(rowreq_ctx);
Does this seem correct?
Need Help <[EMAIL PROTECTED]> wrote: Here are the two tables I am dealing with
again:
Table1(ocStbHostAVInterfaceTable)
Table2(ocStbHostAnalogVideoTable)
I looked into the "ifXTable.h" file and saw how the "ifTable" data structures
are being used.
As a result I removed the following structure/definitions from Table2 ....
ocStbHostAnalogVideoTable_registration
ocStbHostAnalogVideoTable_data
ocStbHostAnalogVideoTable_mib_index
ocStbHostAnalogVideoTable_rowreq_ctx
ocStbHostAnalogVideoTable_ref_rowreq_ctx
..... and added the following code to indicate to use Table1 structures:
typedef ocStbHostAVInterfaceTable_registration
ocStbHostAnalogVideoTable_registration;
typedef ocStbHostAVInterfaceTable_data
ocStbHostAnalogVideoTable_data;
typedef ocStbHostAVInterfaceTable_mib_index
ocStbHostAnalogVideoTable_mib_index;
typedef ocStbHostAVInterfaceTable_rowreq_ctx
ocStbHostAnalogVideoTable_rowreq_ctx;
typedef ocStbHostAVInterfaceTable_ref_rowreq_ctx
ocStbHostAnalogVideoTable_ref_rowreq_ctx;
My problem now is that the code does not compile. I confirmed the compile
errors are due to not being able to find the Table1 structure definitions
(shown below).
ocStbHostAVInterfaceTable_registration
ocStbHostAVInterfaceTable_data
ocStbHostAVInterfaceTable_mib_index
ocStbHostAVInterfaceTable_rowreq_ctx
ocStbHostAVInterfaceTable_ref_rowreq_ctx
Of course, I made sure the Table1 header file (where these structures are
defined) was included:
#include
"OC-STB-HOST-MIB/ocStbHostAVInterfaceTable/ocStbHostAVInterfaceTable.h"
Anyway, I know this might be a long shot, but do you think I am missing some
other thing? I have been looking at the "ifTable.h" and "ifXTable.h" code as a
guide to see if I am missing anything, but I can determine what it could be
causing my compile errors.
Robert Story <[EMAIL PROTECTED]> wrote: On Thu, 7 Jun 2007 12:05:15 -0700 (PDT)
Need wrote:
NH> Ugh ... I just noticed something I think I am doing wrong:
NH>
Yep. Check out the ifXTable headers.. you'll see that it is using ifTable
structures.
---------------------------------
Got a little couch potato?
Check out fun summer activities for
kids.-------------------------------------------------------------------------
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
---------------------------------
Get the free Yahoo! toolbar and rest assured with the added security of spyware
protection.
-------------------------------------------------------------------------
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