The suffix "Type" is added to all types generated from the ASN.1 types and the SYNTAX clause of the OBJECT-TYPE and TEXTUAL-CONVENTION macros defined in a SNMPv2 Information module.
This file also defines IDL type for untyped event
communication and interfaces generic
typed communications (both push and pull style).
The structure for untyped event communication
is defined from NOTIFICATION PDU format.
The parameters of the operations of interfaces for
typed communications are also derived from NOTIFICATION PDU
format. The types and interfaces are defined in
<module-identifier> DEFINITIONS ::= BEGIN
<macro-instances>
END
The DEFINITIONS statement is mapped to IDL as follows:
module <module-name> {
<idl-mapped-macro-invocations>
};
where <module-identifier> is mapped as an ASN.1 identifier as
defined in
The SNMP->IDL compiler-generated IDL file follows the following rules:
#ifndef _<module-identifier>_IDL_
#define _<module-identifier>_IDL_
module <module-identifier> {
<idl-mapped-macro-invocations>
};
#endif /* !_<module-identifier>_IDL_ */
IMPORTS <descriptor1> [, <descriptor2 ... [, descriptorn] ] FROM <module-name>
Descriptors which are not macro references or macro descriptors
in the IMPORTS statement
are declared within the scope of the IDL module by way of
typedefs as defined in
typedef <module-name>::<descriptor1>Type <descriptor1>Type;
typedef <module-name>::<descriptor2>Type <descriptor2>Type;
........
typedef <module-name>::<descriptor1>Type <descriptor1>Type;
Note the addition of the Type suffix to all types that are defined
in another module. Since base ASN.1 types are assumed to be globally
defined and they are not explicitly imported, the rule is always consistent.
If there are no IMPORTS ... FROM statements in the SNMP module, then the following include directives will be added at the beginning of the file:
#include <ASN1Types.idl>
#include <SNMPMgmt.idl>
in order to include the global ASN.1 types and base IDL interface.
Each FROM <module-name> will map to an include statement at the beginning of the file as follows:
#include <<module-name>.idl>
If there is at least one imported module then it is not necessary to
explicitly import the standard IDL files.
SNMPv2-MIB DEFINITIONS ::= BEGIN
IMPORTS
MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE,
ObjectName, Integer32, Counter32, snmpModules FROM SNMPv2-SM
TruthValue, DisplayString, TestAndIncr, TimeStamp FROM SNMPv2-T
MODULE-COMPLIANCE, OBJECT-GROUP FROM SNMPv2-CON
system, ifIndex, egpNeighAddr FROM RFC1213-MIB
partyEntry FROM SNMPv2-PARTY-MIB;
....
END
maps to following definition in a file named SNMPv2_MIB.idl:
#ifndef SNMPv2_MIB_IDL
#define SNMPv2_MIB_IDL
#include <SNMPv2_SMI.idl>
#include <SNMPv2_TC.idl>
#include <SNMPv2_CONF.idl>
#include <RFC1213_MIB.idl>
#include <SNMPv2_PARTY_MIB.idl>
module SNMPv2_MIB {
// MODULE-IDENTITY, OBJECT-TYPE, NOTIFICATION-TYPE are ignored
typedef SNMPv2_SMI::ObjectNameType ObjectNameType;
typedef SNMPv2_SMI::Integer32Type Integer32Type;
typedef SNMPv2_SMI::Counter32Type Counter32Type;
// snmpModules is macro descriptor so it is ignored
typedef SNMPv2_TC::TruthValueType TruthValueType;
typedef SNMPv2_TC::DisplayStringType DisplayStringType;
typedef SNMPv2_TC::TestAndIncrType TestAndIncrType;
typedef SNMPv2_CONF::TimeStampType TimeStampType;
// system, ifIndex, egpNeighAddr are ignored because they are macro-descriptors
// partyEntry is ignored because its is macro-descriptor
........
}; /* End of SNMPv2_MIB module */
#endif /* !SNMPv2_MIB_IDL */
Contents | Next section | Index |