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

RE: Enumerated INTEGER - start with zero or one (0 or 1) ?



> Answering my own question:  the InetAddressType TC in RFC 3291.
> 
> Incorporating this and the forwarded comments from Keith, the stuff
> on enumerations now reads as follows:
> 
>    - For integer-valued enumerations:
> 
>      - INTEGER is REQUIRED;
>      - Integer32, Unsigned32, and Gauge32 MUST NOT be used.
> 
>    Note that RFC 2578 recommends (but does not require) that integer-
>    valued enumerations start at 1 and be numbered contiguously.  This
>    recommendation SHOULD be followed unless there is a valid reason to
>    do otherwise, e.g., to match values of external data or to indicate
>    special cases.  For an example see the InetAddressType TC [RFC3291].
> 
> I removed the "SHOULD be documented" language, mainly because the
> note that RFC 3291 doesn't follow that recommendation.

Can we at least keep a "In case a zero is used, it often helps if one 
documents why a zero value is used".

>  The original
> version in RFC 2851 had the following ASN.1 comments to explain why
> the enumerations were not contiguous:
> 
>                      unknown(0),
>                      ipv4(1),    -- these named numbers are aligned
>                      ipv6(2),    -- with AddressFamilyNumbers from
>                      dns(16)     -- IANA-ADDRESS-FAMILY-NUMBERS-MIB
> 
> However, those comments are no longer present in RFC 3291.
> 
> //cmh
> 
>