TOC PREV NEXT INDEX


SNMP OBJECT-TYPE



The SNMP OBJECT-TYPE MACRO is one of several MACROs used in Management Information Base (MIB) definitions. It is the only MACRO of interest to ASN1C because it is the one that specifies the object identifiers and data that are contained in the MIB.

The version of the MACRO currently supported by this version of ASN1C can be found in the SMI Version 2 RFC (RFC 2578). The compiler generates code for two of the items specified in this MACRO definition:


For an example of the generated code, we can look at the following definition from the UDP MIB:

udpInDatagrams OBJECT-TYPE
    SYNTAX      Counter32
 
    MAX-ACCESS  read-only
 
    STATUS      current
 
    DESCRIPTION
 
            "The total number of UDP datagrams delivered to UDP users."
 
    ::= { udp 1 }
 

In this case, a type definition is generated for the SYNTAX element and an Object Identifier value is generated for the entire item. The name used for the type definition is "<name>_SYNTAX" where <name> would be replaced with the OBJECT-TYPE name (i.e., udpInDatagrams). The name used for the Object Identifier value constant is the OBJECT-TYPE name. So for the above definitions, the following two C# items would be generated:

1. A "udpInDatagrams_SYNTAX.cs" file. This would contain the udpInDatagrams_SYNTAX class definition, and

2. A udpInDatagrams value definition in the _UDP_MIBValues class.



Objective Systems, Inc.

102 Pickering Way, Suite #506
Exton, Pennsylvania 19341
http://www.obj-sys.com
Phone: (484) 875-9841
Toll-free: (877) 307-6855 (US only)
Fax: (484) 875-9830
info@obj-sys.com
TOC PREV NEXT INDEX