[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

subidwrite/substr draft-ietf-snmpconf-pm-05.txt questions

A couple of questions have come up in implementing the policy language.

. Page 48, 49, draft-ietf-snmpconf-pm-05.txt, para 9.4.7:

  subidwrite returns -1 on error.  What does subidwrite 
  return if there is no error?

. Page 52, draft-ietf-snmpconf-pm-05.txt, para 9.4.16:

    string substr(string &str, integer offset,
                  integer len [, string replacement])

   The substr prototype only shows the replacement argument as
   optional, but the description says that len may be omitted (to
   get the rest of the string after offset regardless of length).
   The len argument is not bracketed in the prototype.

   It makes sense to be able to specify the replacement string
   without the length (replace everything starting at offset), but
   one must intuit the argument types to figure out to which 
   argument the third string must be assigned.

   I see two choices here:

   .  Remove the replacement functionality from this function. 
      String replacement is orthogonal to extracting a substring.
      At the risk of cluttering up the language, I think this is
      the correct solution.

   .  Make the len argument nonoptional when doing string replacement.
      This means that one is always going to have to think about
      len (i.e., there is no way to specify "replace everything after
      offset 5 with this string, expanding or contracting the 
      string as necessary).  I guess just supplying a huge value
      would be adequate.

	- Steve

Steve Moulton        SNMP Research, Inc            voice: +1 865 573 1434
Sr Software Engineer 3001 Kimberlin Heights Rd.    fax: +1 865 573 9197
moulton@snmp.com     Knoxville, TN 37920-9716 USA  http://www.snmp.com