-
Notifications
You must be signed in to change notification settings - Fork 2
MFD:ifXTable:Data_Structures
Let's take a look in ifXTable.h. Since we will be using the netsnmp access routines to get the interface data, we specified netsnmp_interface_entry as our data context. You might expect to run into it a lot in the code. Instead, the code uses a typedef:
|
Whenever you see ifXTable_data, remember that it is simply a typedef for netsnmp_interface_entry. As we will see in a moment, the the row request context has a pointer to an ifXTable_data structure. The first edit we need to make is to include the interface access header file:
|
However, the netsnmp_interface_entry does not contain all the information we need to implement all the ifXTable columns. In particluar, the ifLinkUpDownTrapEnable and ifAlias columns are specific to the ifXTable, and not kept in the netsnmp_interface_entry structure. To keep track of them, we'll add them to the rowrequest_context. Because we specified a type for our data context, mib2c did not generate storage for any columns. So we need to add storage. For consistency's sake, we'll use mib2c to generate a data context. We specify dummy as the output file name, so that it won't get confused with the other ifXTable implementation files.
|
Then we copy the definitions we need from dummy_storage.h to the rowrequest_context in ifXTable.h:
|