[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
RE: draft-ietf-syslog-device-mib-00.txt - Enums starting at zero
> On Mon, 26 Aug 2002, Joan Cucchiara wrote:
> > My question is about what the current practice is
> > for starting enums at zero when there is a reason
> > for starting at zero.
>
> Values of enums in SMIv2 are not restricted like they
> were in SMIv1 -- they can have any integer value.
> There is no longer any reason to require them to
> start at 1.
>
Actually, RFC2578 sect 7.1.1 2nd para still recommends
that you start with 1. But some consider it a CLR
(Crappy Little Rule) and if you have good reasons
(like below) then the RFC indeed does allow to start at 1.
> > Specifically in this MIB, there is an enum:
> >
> > SyslogSeverity ::= TEXTUAL-CONVENTION
> > STATUS current
> > DESCRIPTION
> > "This textual convention maps out to the severity levels
> > of syslog messages. The syslog protocol uses the values
> > 0 (emergency), to 7 (debug)."
> > SYNTAX INTEGER {
> > emergency(1),
> > alert(2),
> > critical(3),
> > error(4),
> > warning(5),
> > notice(6),
> > info(7),
> > debug(8)
> > }
>
> Re-numbering the enums from 0 to 7 to match RFC 3164 would make
> more sense than what is done above.
>
> > At one point having enums start at zero in SMIv2 was
> > not encouraged due to backwards compatibility with SMIv1,
> > but am wondering if this is still the case?
>
> No, not any more. We keep SMIv1 around because we don't
> want to have to re-write perfectly good SMIv1 MIBs, but
> essentially all new work these days is done in SMIv2,
> both within and outside the IETF.
>
> //cmh
>
>