> It's not a matter of which approach you prefer.
> The question is more, which approach matches the
> structure of your underlying data.
Agree.
> which implies that several rows in the IP range table
> relate to a single pool in the settings table.
> Is that correct?
>> > dhcpIPRangeEntry OBJECT-TYPE
>> > :
>> > INDEX { dhcpSettingsIndex, dhcpIPRangeIndex }
>> > :
Your guess is right. It is a table-within-a-table structure and the MIB
file definition is pretty clear to me now.
> So all of the IP ranges that relate to testPool1 would have a
> dhcpSettingsIndex value of 2 (and distinct dhcpIPRangeIndex
> values).
>
>> [DHCP settings table]
>> dhcpSindex poolName serverIp rowStatus
>> 1 testPool x.x.x.x 1
>> 2 testPool1 x.x.x.x 1
>> 4 testPool2 x.x.x.x 1
>
>> [IP Range Table] as augment of entries in DHCP settings table
>> ipRindex startIp endIp
>> 3 1.1.1.1 1.1.1.2
>> 5 2.2.2.2 2.2.2.3 <- newly added row
>>
>> Assume row 3 and 5 belong to testPool.
>
> In which case, walking the table would look like:
>
> startIp.1.3 = 1.1.1.1
> startip.1.5 = 2.2.2.2
> endIp.1.3 = 1.1.1.2
> endIp.1.5 = 2.2.2.3
I understand why I can implement two tables separately. I think I need two
linked list for storing data from DHCP settings table and IP Range Table
respectively. I need two indexes for the IP Range Table. One for indexing
rows another one for referencing row number in the DHCP settings table.
The question is how I parse multiple index values in the IP Range Table.
In the single index table case, some code shown in the following example
can help me to get the single index value.
int rowNumber;
netsnmp_request_info * pRequests; //from the argument of the handler
pTableInfo = netsnmp_extract_table(pRequests);
rowNumber = *(pTableInfo->indexes->val.integer);
the last statement can help me to retrieve the index value which is equal
to the row number. But in the multiple indexed case, I have some trouble
on how to differentiate two indexes in the code.
| |
v v
endIp.1.5 = 2.2.2.3
I found some examples like udpTable.c but it doesn't seem to help me out
with my problem. Thanks for your help.
/Pan
-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/
_______________________________________________
Net-snmp-users mailing list
[email protected]
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users