UCD simple table implementation : weird agent behavior

pal snmp <[email protected]>
Newsgroups gmane.network.net-snmp.user
Message-ID <CAJX137rL0BQV5mDbk90xL-U4wiEHfNy8r=i5PY_z4sxDHhzYcA@mail.gmail.com>
All,

I have a simple table implemented (meets all the 'simple' table rules) but
noticing a strange thing and needs clarification.

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 as this handler can't
possibly get the value for this requested OID? If this is rejected, will it
break SNMP compliance for getNext?

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. 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) and
this is the last index of this table . I expected the prefix is copied to
newname rather than the name. Am I missing something here? If possible, can
you briefly explain the objective of the conditional statements in
header_simple_table (the exact case is clear to me though)?

66     if (((int) *length) <= (int) vp->namelen || rtest == -1) {
 67         memmove(newname, vp->name, (int) vp->namelen * sizeof(oid));
 68         newname[vp->namelen] = 1;
 69         *length = vp->namelen + 1;
 70     } else if (((int) *length) > (int) vp->namelen + 1) {       /*
exact case checked earlier */
 71         *length = vp->namelen + 1;
 72         memmove(newname, name, (*length) * sizeof(oid));
 73         if (name[*length - 1] < MAX_SUBID) {
 74             newname[*length - 1] = name[*length - 1] + 1;
 75         } else {
 76             /*
 77              * Careful not to overflow...
 78              */
 79             newname[*length - 1] = name[*length - 1];
 80         }

Thanks
Pal

------------------------------------------------------------------------------
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
[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.