Re: Getnext Implementation

"Dave Shield" <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <[email protected]>
On 26/09/06, [email protected] <[email protected]> wrote:
> Suppose we have one table having index's data type as integer.
> Suppose it has three rows with index 1, 2, 3.

Then the agent needs to know this.
Not just what the syntax of the indexing is, but what the currently
valid indexes actually are.
Or at the very least, it needs some way to find out about the next index.

Will the rows of this table always be consecutive starting from 1?
Or will there sometimes be gaps?   If so, then small gaps or large gaps?


> But the info about the rows are not stored in the index .It is stored in the data base.

That's not a problem.

>  Now if some query comes with only column name of that particular table how agent is
> going to decide that the next index is 1?

If the table indexes are consecutive (or nearly so), then the first
index will *always* be 1.
The MIB module  can just take the index from the incoming request, add
1 (or use 1 in the case above), and request that row from the
database.

If the rows are strictly consecutive, then the first row that doesn't
exist will mark the end of the table, and the MIB module can return
failure.
If there are occasional gaps, then if a row doesn't exist, the MIB
module will need to try again with the next index. This also implies
some other mechanism for detecting the last row of the table.
If there are large gaps (e.g. using processIDs, or semi-random index
values), then this approach probably isn't appropriate.   There needs
to be some way to calculate or ask for "the next valid index".


> For example suppose we have the following table
>
> NetworkDhcpPoolSubnetEntry ::= SEQUENCE {
         [snip]
>       }
>


The structure of a table row is irrelevant.   The first task is always
to determine which row of the table is required (ignoring the column
information).

How is the table populated initially, how is it updated, and how
rapidly will it change?

Dave

-------------------------------------------------------------------------
Take Surveys. Earn Cash. Influence the Future of IT
Join SourceForge.net's Techsay panel and you'll get the chance to share your
opinions on IT & business topics through brief surveys -- and earn cash
http://www.techsay.com/default.php?page=join.php&p=sourceforge&CID=DEVDEV
_______________________________________________
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.