On 15 January 2013 22:30, pal snmp <pals...@gmail.com> wrote:
> This simple table handler routine is called with 'name' OID
> lexicographically smaller than the prefix OID for getNext request.
> Question 1:
>    should the handler just return MATCH_FAILED

No.

>                          as this handler can't
> possibly get the value for this requested OID?

It's actually exactly the opposite.

If the OID being requested ('name') is less than the registered
prefix, and this routine is being called (which indicates that no
earlier module has dealt with this particular request), then the
handler should return a match for the first instance that it
implements.


> Question 2:
>   The else-if part of header_simple_table() (Line 70-80), seems to copy the
> requested OID to newname rather than the prefix.

That's correct.
The routine has been called with an OID where the prefix matches
the registered prefix (but the OID is longer than a valid instance of the table)
So the next valid instance will be obtained by truncating the specified
OID to match that of the previous instance, and then moving on to the next one.


> This has an adverse impact for a case like this:
> prefix OID: EID.8888.1.3.4.1.1
> name OID: EID.8888.1.1.22.1.2.43 (compound index; index1=2;index2=43)

If this is a compound index, then you cannot use 'header_simple_table'
The code is designed for use with *simple* tables - i.e. a single integer
index (and consecutive values)

One of the reasons for introducing the new v5 handler-based was to
aid the implementation of non-simple tables.   The older UCD v4 style
(which seems to be what you are using) had a utility function for simple
single-integer indexed tables, but everything else had to be proessed
manually.
  I really wouldn't recommend using this approach for any new implementations.
Particularly not a compound indexed table.

Use the newer approach - it's much, much easier!


Dave

------------------------------------------------------------------------------
Master SQL Server Development, Administration, T-SQL, SSAS, SSIS, SSRS
and more. Get SQL Server skills now (including 2012) with LearnDevNow -
200+ hours of step-by-step video tutorials by Microsoft MVPs and experts.
SALE $99.99 this month only - learn more at:
http://p.sf.net/sfu/learnmore_122512
_______________________________________________
Net-snmp-users mailing list
Net-snmp-users@lists.sourceforge.net
Please see the following page to unsubscribe or change other options:
https://lists.sourceforge.net/lists/listinfo/net-snmp-users

Reply via email to