Case for MIB compilers : which compiler is right ? - SNMP

This is a discussion on Case for MIB compilers : which compiler is right ? - SNMP ; Hello, the following excerpt in an SNMP MIB ASN.1 definition file is accepted without error by a MIB compiler (let's call it C1) and rejected by another (let's call it C2). Which compiler is right ? C2 complains on line ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: Case for MIB compilers : which compiler is right ?

  1. Case for MIB compilers : which compiler is right ?

    Hello,

    the following excerpt in an SNMP MIB ASN.1 definition file is accepted without
    error by a MIB compiler (let's call it C1) and rejected by another (let's call
    it C2).
    Which compiler is right ?

    C2 complains on line 2 of the following excerpt.

    ...
    -- next line is line 1
    errorStatus OBJECT-TYPE
    SYNTAX SEQUENCE OF error
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION ""
    ::= { subtree 1 }

    error OBJECT-TYPE
    SYNTAX errorStatusStructure
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION "Entry of ErrorStatus-Table"
    INDEX { errorEntryId }
    ::= { errorStatus 1 }

    errorStatusStructure ::= SEQUENCE
    {
    errorEntryId INTEGER,
    errorName OCTET STRING
    }

    errorEntryId OBJECT-TYPE
    SYNTAX INTEGER
    MAX-ACCESS not-accessible
    STATUS current
    DESCRIPTION ""
    ::= { error 1 }


    errorName OBJECT-TYPE
    SYNTAX OCTET STRING
    MAX-ACCESS read-only
    STATUS current
    DESCRIPTION ""
    ::= { error 2 }

    ..

    --
    F
    This message is monitored by axinews : http://www.axinews.com


  2. Re: Case for MIB compilers : which compiler is right ?

    Hello FR,

    C2 is right, because a type definition must start with a uppercase letter
    but "error" starts with a lowercase letter.

    Regards,
    Frank Fock

    fr wrote:

    >Hello,
    >
    >the following excerpt in an SNMP MIB ASN.1 definition file is accepted without
    >error by a MIB compiler (let's call it C1) and rejected by another (let's call
    >it C2).
    >Which compiler is right ?
    >
    >C2 complains on line 2 of the following excerpt.
    >
    >..
    >-- next line is line 1
    >errorStatus OBJECT-TYPE
    >SYNTAX SEQUENCE OF error
    >MAX-ACCESS not-accessible
    >STATUS current
    >DESCRIPTION ""
    > ::= { subtree 1 }
    >
    >error OBJECT-TYPE
    >SYNTAX errorStatusStructure
    >MAX-ACCESS not-accessible
    >STATUS current
    >DESCRIPTION "Entry of ErrorStatus-Table"
    >INDEX { errorEntryId }
    > ::= { errorStatus 1 }
    >
    >errorStatusStructure ::= SEQUENCE
    >{
    >errorEntryId INTEGER,
    >errorName OCTET STRING
    > }
    >
    >errorEntryId OBJECT-TYPE
    >SYNTAX INTEGER
    >MAX-ACCESS not-accessible
    >STATUS current
    >DESCRIPTION ""
    > ::= { error 1 }
    >
    >
    >errorName OBJECT-TYPE
    >SYNTAX OCTET STRING
    >MAX-ACCESS read-only
    >STATUS current
    >DESCRIPTION ""
    > ::= { error 2 }
    >
    >..
    >
    >
    >


  3. Re: Case for MIB compilers : which compiler is right ?

    HI,

    The definitions below are incorrect for several reasons.
    First, the below is NOT ASN.1! The language for defining
    SNMP MIB modules is NOT ASN.1.

    Many SNMP MIB parsers don't validate. It's a hard
    job to write a validating MIB parser.

    A quick look at the below shows the following
    problems:
    1) the naming conventions for tables, rows, and sequences
    is not followed
    2) the descriptors for sequences MUST start with an uppercase
    letter, and the one below (errorStatusStructure) does not
    3) for object "errorStatus", the value of the SYNTAX
    clause is totally bogus. It says "SEQUENCE OF error".
    It MUST specify a sequence and not an object.
    4) In general, it not OK to use just "INTEGER" for the
    value of the SYNTAX clause (as done for object
    errorEntryId)
    5) In general, you should ALWAYS specifiy a SIZE clause
    on an OCTET STRING (which is missing for object
    errorName)
    6) The values for index objects MUST NOT be negative.

    Regards,
    /david t. perkins
    On Wed, 30 Mar 2005, fr wrote:
    > Hello,
    >
    > the following excerpt in an SNMP MIB ASN.1 definition file is accepted without

    error by a MIB compiler (let's call it C1) and rejected by another (let's call
    it C2).
    > Which compiler is right ?
    >
    > C2 complains on line 2 of the following excerpt.
    >
    > ..
    > -- next line is line 1
    > errorStatus OBJECT-TYPE
    > SYNTAX SEQUENCE OF error
    > MAX-ACCESS not-accessible
    > STATUS current
    > DESCRIPTION ""
    > ::= { subtree 1 }
    >
    > error OBJECT-TYPE
    > SYNTAX errorStatusStructure
    > MAX-ACCESS not-accessible
    > STATUS current
    > DESCRIPTION "Entry of ErrorStatus-Table"
    > INDEX { errorEntryId }
    > ::= { errorStatus 1 }
    >
    > errorStatusStructure ::= SEQUENCE
    > {
    > errorEntryId INTEGER,
    > errorName OCTET STRING
    > }
    >
    > errorEntryId OBJECT-TYPE
    > SYNTAX INTEGER
    > MAX-ACCESS not-accessible
    > STATUS current
    > DESCRIPTION ""
    > ::= { error 1 }
    >
    >
    > errorName OBJECT-TYPE
    > SYNTAX OCTET STRING
    > MAX-ACCESS read-only
    > STATUS current
    > DESCRIPTION ""
    > ::= { error 2 }
    >
    > ..


    --
    FR
    This message is monitored by axinews : http://www.axinews.com/

    >


+ Reply to Thread