On Thu, 14 Jul 2011 15:46:56 +0200 Giuseppe wrote:
GM> > Simply define the special enums in the mib, and the text description can
GM> > describe the 0-1000 by five restriction.
GM> 
GM> Are you suggesting something similar?
GM> 
GM> volumeControl OBJECT-TYPE
GM>       SYNTAX           INTEGER{ mute(-100) }
GM>       MAX-ACCESS       read-write
GM>       STATUS           current
GM>       DESCRIPTION
GM>                        "SET this variable in 0..1000 range
GM>                         by 5 steps, or mute(-100)."
GM>       ::= { parentNode 1 }

Yes, that's what I was suggesting.

GM> What does the manager say when the user wants to SET this variable to a 
value of, say, 10?  I supposed the manager didn't allow setting values that 
aren't in the range written in the MIB file (and in this case the range is 
composed by a single value, -100).

Good question. I'm used to snmpset which doesn't restrict you to the
enumerated values. It is possible that some managers might restrict you to the
enumerated values.

GM> Is this approach (to not list permitted values in the SYNTAX clause) 
correct?  Is this approach acceptable?  Should I expect some manager complains 
with that?

If you want to be absolutely safe, then you could enumerate all the actual
allowable values, as Fulko suggested.  Personally, I would use his other
suggestion, a range of 0-1000, 0 being mute, and specify the 'by 5'
requirement in the text.  There are lots of MIBs which specify additional
requirements in the description... They were never meant to be 100% machine
parseable...

GM> Another question regarding a similar thing.  I read enumeration values 
should start from value 1 and increase without holes, but I read many MIB that 
didn't adhere to this rule.  What do you think?

Any value is allowed.. See 7.1.1 of RFC 2578,

------------------------------------------------------------------------------
AppSumo Presents a FREE Video for the SourceForge Community by Eric 
Ries, the creator of the Lean Startup Methodology on "Lean Startup 
Secrets Revealed." This video shows you how to validate your ideas, 
optimize your ideas and identify your business strategy.
http://p.sf.net/sfu/appsumosfdev2dev
_______________________________________________
Net-snmp-coders mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/net-snmp-coders

Reply via email to