Previous section.

Inter-Domain Management: Specification Translation (JIDM_ST)
Copyright © 2000 The Open Group

Mapping of SMIv2 Macros to IDL

ASN.1 Macro Definition Notation

Table: Production of ASN.1 Macro Definition Notation.

MacroDefinition ::= macroreference MACRO "::=" MacroSubstance
MacroSubstance ::= BEGIN MacroBody END | macroreference | Externalmacroreference
MacroBody ::= TypeProduction | ValueProduction | SupportingProductions
TypeProduction ::= TYPE NOTATION "::=" MacroAlternativeList
MacroAlternativeList ::= SymbolList
SymbolList ::= SymbolElement | SymbolList SymbolElement
SymbolElement ::= SymbolDefn | EmbeddedDefinitions

SMIv2 MODULE-IDENTITY Macro

The MODULE-IDENTITY macro is used to provide contact and revision history for each information module. It appears exactly once in every information module.

The <descriptor> of the MODULE-IDENTITY macro is mapped into an IDL constant, where the identifier for the literal is the <descriptor> and the IDL scoped name of the identifier for the <descriptor> is used as the value of the constant.


const string <descriptor> = "::<Module-Scoped-Name>::<descriptor>";

The value of an invocation of the MODULE-IDENTITY macro is mapped into an .oid file for the MIB module.

The value-specification of the other clauses of MODULE-IDENTITY are mapped as block comments below the IDL literal for the OBJECT IDENTIFIER of the MODULE IDENTITY macro. The comments for the clauses are generated in the order they are encountered.

Mapping of DESCRIPTION clause

The DESCRIPTION clause, which must be present, contains a high-level textual description of the contents of this information module.

The value-specification for this clause is mapped as block-comment below the string literal for macro-descriptor. The block comment is specified in the form of .(/* ..*/ ).


/* <value-specification> */

Mapping of LAST-UPDATED clause

The LAST-UPDATED clause, which must be present, contains the date and time that this SNMP information module was last edited. The value-specification for this clause is mapped as comment and appended to the block-comment for the DESCRIPTION clause of this macro:

/* <value-specification> LAST-UPDATED : <value-specification> */

Mapping of ORGANIZATION clause

The ORGANIZATION clause, which must be present, contains a textual description of the organization under whose auspices this information module was developed.

The value-specification for this clause is mapped as comment and appended to the block-comment for the DESCRIPTION clause of this macro:


/* <value-specification> LAST-UPDATED : <value-specification> ORGANIZATION : <value-specification> */

Mapping of CONTACT-INFO clause

The CONTACT-INFO clause, which must be present, contains the name, postal address, telephone number, and electronic mail address of the person to whom technical queries concerning this information module should be sent.

The value-specification for this clause is mapped as comment and appended to the block-comment for the DESCRIPTION clause of this macro:


/* <value-specification> LAST-UPDATED : <value-specification> ORGANIZATION : <value-specification> CONTACT-INFO : <value-specification> */

Mapping of REVISION clause

The REVISION clause, which need not be present, is repeatedly used to describe the revisions made to this information module, in reverse chronological order. Each instance of this clause contains the date and time of the revision.

The value-specification for this clause is mapped as comment and appended to the block-comment for the DESCRIPTION clause of this macro:


/* <value-specification> LAST-UPDATED : <value-specification> ORGANIZATION : <value-specification> CONTACT-INFO : <value-specification> REVISION : <revision-value-specification> REVISION-DESCRIPTION : <description-value-specification> REVISION : <revision-value-specification> REVISION-DESCRIPTION : <description-value-specification> */

Mapping of MODULE-IDENTITY Value

The value of an invocation of the MODULE-IDENTITY is an OBJECT IDENTIFIER and this value is used as authoritative registration identifier for referencing.

The value of the invocation MODULE-IDENTITY macro and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:


<IDL-SCOPED-NAME> <OID> ASN1_ObjectIdentifer not-accessible

Please note that each of the elements of the above declarations are separated by one or more spaces.


Example:
Conversion of SMIv2 MODULE-IDENTITY fizbin to IDL illustrates the mapping of an instance of SMIv2 MODULE-IDENTITY macro, called fizbin. Note that block-comment generated from individual clauses of a macro has been merged into a single block comment. This approach is applied in the rest of the document whenever possible.

Table: Conversion of SMIv2 MODULE-IDENTITY fizbin to IDL

MODULE IDENTITY FIZ-MIB DEFINITIONS ::= BEGIN ...... fizbin MODULE-IDENTITY LAST-UPDATED "9210070433Z" ORGANIZATION "X/Open’s JIDM Task Force" CONTACT-INFO "Subrata Mazumdar DESCRIPTION "The MIB module for entities implementing the xxxx protocol." REVISION "9210070433Z" DESCRIPTION "Initial version of this MIB module." -- contact IANA for actual number ::= { experimental 555} -- Assuming 555 is not used ..... END
IDL module FIZ_MIB {
const string moduleIdentity = "fizbin"; /* The MIB module for entities implementing the xxxx protocol. REVISIONS : 9210070433Z REVISION-DESCRIPTION: description \" Initial version of this MIB module. LAST-UPDATED: : "9210070433Z"; ORGANIZATION: : "The Open Group's JIDM Task Force"; CONTACT-INFO : Subrata Mazumdar " */ const ASN1_ObjectIdentifer fizbin = "::FIZ_MIB::fizbin"; .....
}; // End of FIZ_MIB module
Entries in FIZ_MIB.oid File ::FIZ_MIB::fizbin 1.3.6.1.3.555 ASN1_ObjectIdentifer not-accessible

SMIv2-SMI OBJECT IDENTITY Macro

The OBJECT-IDENTITY macro is used to define information about an OBJECT IDENTIFIER assignment.

The macro is mapped as IDL constant literal of type string. The identifier of the constant is the descriptor of the macro and the value of the constant is IDL scoped name of the constant. The value of the invocation is mapped to the .oid file for the MIB module. All other clauses are mapped within a block comment below the constant for the value of the macro.


const string <descriptor> = "<Module-ScopedName>::<descriptor>";

If the value-specification of the STATUS clause of an OBJECT-IDENTITY macro is either deprecated or obsolete, then the macro is not mapped to IDL.

Mapping of DESCRIPTION Clause

The DESCRIPTION clause contains a high-level textual description of the object assignment and it must be present. The value-specification for this clause is mapped as block comment above the IDL constant for the value of the macro in the following form:

/* <DESCRIPTION-value-specification> */

Mapping of REFERENCE Clause

The REFERENCE clause contains a textual cross-reference to an object assignment defined in some other module and it need not be present. If the clause is present then the value-specification for this clause is appended to the block comment of the description clause:

/* <DESCRIPTION-value-specification> REFERENCE: <value-specification> */

Mapping of OBJECT-IDENTITY Value

The value of an invocation of the OBJECT-IDENTITY is an OBJECT IDENTIFIER and this value is used as authoritative registration identifier for referencing.

The value of the invocation OBJECT-IDENTITY macro and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:


<IDL-SCOPED-NAME> <OID> ASN1_ObjectIdentifer not-accessible

Note that each of the elements of the above declarations are separated by one or more spaces.


Example:
Table: Mapping SMIv2 OBJECT-IDENTITY fizbin to IDL Constants

OBJECT
IDENTITY
FIZ-MIB DEFINITIONS ::= BEGIN ...... fizbinChipSets OBJECT IDENTIFIER ::= { fizbin 1 } ffizbin69 OBJECT-IDENTITY STATUS current DESCRIPTION "The authoritative identity of the Fizbin 69 chipset." ::= { fizbinChipSets 1 } ..... END
IDL module FIZ_MIB {
..... const string fizbinChipSets = "::FIZ_MIB::fizbinChipSets"; /* The authoritative identity of the Fizbin 69 */ const string fizbin69 = "::FIZ_MIB::fizbin69"; .....
}; // End of FIZ_MIB module
Entries in
FIZ_MIB.oid
file
::FIZ_MIB::fizbinChipSets 1.3.6.1.3.555.1 ASN1_ObjectIdentifer not-accessible
::FIZ_MIB::fizbin69 1.3.6.1.3.555.1.1 ASN1_ObjectIdentifer not-accessible

OBJECT-TYPE Macro

Structure of OBJECT-TYPE Macro clauses describes the structure of OBJECT-TYPE Macro. OBJECT-TYPE macro is used to define the Table, TableEntry and the variables in SNMP information module.
Table: Structure of OBJECT-TYPE Macro clauses

OBJECT-TYPE MACRO ::=
BEGIN
TYPE NOTATION ::=
"SYNTAX" Syntax
UnitsPart
"MAX-ACCESS" Access
"STATUS" Status
"DESCRIPTION" Text
ReferPart
IndexPart
DefValPart
VALUE NOTATION ::= value (VALUE ObjectName)
Syntax ::= type | "BITS" "{" NamedBits "}"
NamedBits ::= NamedBit | NamedBits "," NamedBit
NamedBit ::= identifier "(" number ")" -- number is nonnegative
UnitsPart ::= "UNITS" Text | empty
Access ::= "not-accessible" || "accessible-for-notify" | "read-only" |
"read-write" | "read-create"
Status ::= "current" | "deprecated" | "obsolete"
ReferPart ::= "REFERENCE" Text | empty
IndexPart ::= "INDEX" "{" IndexTypes "}" | "AUGMENTS" "{" Entry "}" | empty
IndexTypes ::= IndexType | IndexTypes "," IndexType
IndexType ::= "IMPLIED" Index | Index
Index ::= value (Indexobject ObjectName)
Entry ::= value (Entryobject ObjectName)
DefValPart ::= "DEFVAL" "{" value (Defval Syntax) "}" | empty
-- uses the NVT ASCII character set
Text ::= """" string """"
END

Base IDL Interface for SMI Group or Table Entry

In RFC2578, a conceptual table is defined as follows:

"A conceptual table has SYNTAX of the form:
SEQUENCE OF <EntryType>
where <EntryType> refers to the SEQUENCE type of its subordinate conceptual row".

A conceptual row has SYNTAX of the form:


<EntryType>

where is of type SEQUENCE. is defined as follows:


<EntryType> ::= SEQUENCE { <type1>, ... , <typeN> }

where there is one <type> for each subordinate object, and each <type> is of the form:


<descriptor> <syntax>

where is the descriptor naming a subordinate object, and has the value of that subordinate object’s SYNTAX clause, optionally omitting the sub-typing information.

Although no special syntax exists for defining an abstract group, a group object can be easily identified based on the description of the objects subordinate to the group object in the Object-Identifier hierarchy. In this specification, an abstract group is a special case of the conceptual table where there exists only one row for an abstract group.

The rows of a conceptual table are realized by mapping each row of the table to an instance of an object class which is described by an IDL interface. The instances of the variables of a group object are realized by the values of the attribute of an instance object described by an IDL interface. In this respect, individual rows of a table are treated as an instance of object, and attributes of this object represent the instances of the variables in the row of an SMI table.

Note that above mapping scheme is consistent with the modeling principle defined by IIMC for translating an SNMP information module to GDMO document.

Base IDL Interface for SMI Groups or Table Entries

The base IDL interface for both the groups and tables is called SmiEntry (as shown in The SNMPMgmt::SmiEntry Interface) SNMPMgmt module. If the AUGMENTS clause is used in the OBJECT-TYPE macro then the IDL interface for the entry specified as the value-specification of the AUGMENT clause is used as the base interface instead of SmiEntry .
Table: The SNMPMgmt::SmiEntry Interface

#ifndef _SNMPMgmt_idl_
#define _SNMPMgmt_idl_
 
#include <Cos/PropertySet.idl>
#include <Cos/LifeCycle.idl>
#include <ASN1Types.idl>
 
module SNMPMgmt
{
interface SmiEntry : CosLifeCycle::LifeCycleObject , CosPropertyService::PropertySet
{
// the value of entry_name is always “0” for the groups.
readonly attribute string entry_name;
};
.....
 
}; /* End of SNMPMgmt Module */
#endif /* !_SNMPMgmt_idl_ */

Inheritance Hierarchy of IDL Interfaces for Tables/Groups describes the inheritance hierarchy for IDL interface for the rows of tables or groups generated from the SMI modules. The SmiEntry interface inherits the PropertySet and the LifeCycleObject interfaces. The SNMPMgmt::SmiEntry interface has a read-only attribute called entry_name, which contains the value of the index(es) (instance information part of the object-id of the variables) of the corresponding table entry. The entry_name attribute always contains "0" for SMI entries related to groups. The entry_name of a table-entry is known during create time, and is set by the factory objects. <center> <img src="inhtent.gif" border="2" align="center" width="550"> </center>

Figure: Inheritance Hierarchy of IDL Interfaces for Tables/Groups
Get of Multiple Variables using PropertySet Interface
In SNMP one can get values of more than one variable spanning mutiple tables in a single message. The inherited PropertySet interface allows a client application to get multiple variables from a row in a single method invocation without using the DII. The other way to get more than one variable is to use the Dynamic Invocation Interface (DII) of the ORB. The usage of DII is quite tedious and difficult, so this specification includes proviision of a type-safe alternative to DII.

cX psetif "" 1 describes the operations of the PropertySet interface of CosPropertyService. Since the variables in MIB are mapped as attribute in IDL, the identifiers of the attributes of the can be used as the names of the (static) properties and the define_properties() operation can be used during initialization to set the property names. A client application can use get_property_value(), get_properties(), or get_all_properties() operations to get the value(s) of one variable, more than one variables and all variables, respectively, of a MIB table row in one method invocation. One limitation of this approach is that one cannot get multiple variables spanning different rows/tables in a single method invocation, which can be done in SNMP. For example, we cannot easily correctly monitor counter objects where the default discontinuity indicator is sysUpTime.0. We can get the counters in method invocation, and in a subsequent method invocation we can get sysUpTime.0. This will still allow detection of discontinuities, but we have to give up the granularity of the time base.

Table: PropertySet Interface defined in COS Property Service

module CosPropertyService {
....
interface PropertySet {
/* Support for defining and modifying properties */
void define_property(
in PropertyName property_name,
in any property_value
)
raises(
InvalidPropertyName, ConflictingProperty,
UnsupportedTypeCode, UnsupportedProperty, ReadOnlyProperty
);
void define_properties( in Properties nproperties)
raises(MultipleExceptions);
/* Support for Getting Properties and their Names */
unsigned long get_number_of_properties();
void get_all_property_names(
in unsigned long how_many,
out PropertyNames property_names,
out PropertyNamesIterator rest
);
 
any get_property_value(in PropertyName property_name)
raises(PropertyNotFound, InvalidPropertyName);
boolean get_properties(
in PropertyNames property_names, out Properties nproperties);
void get_all_properties(
in unsigned long how_many,
out Properties nproperties,
out PropertiesIterator rest
);
};
....
}; // End of CosPropertyService module

Mapping of Groups in SMI Information Module

Each group in an SMI information module is mapped to IDL as follows (as shown in Mapping of SNMP Information Module to IDL):

The non-tabular objects of a group are mapped as attribute of the interface for the corresponding group. Each table within a group is mapped as an operation that returns an iterator for all the entries (rows) of the table.

The column variables of a table are mapped as attribute of an IDL interface for entries of the corresponding table. The rows (entries) of a conceptual table is realized by mapping each row of the table to an instance of an object that supports the IDL interface for the entries of the corresponding table. In this regard, individual rows of a table are treated as instances of object, and attributes of this object represent the instances of the variables in the row of the corresponding table.

The SNMPMgmt::SmiTableIterator Interface
An SMI group is a collection of SMI tables. In order to retrieve the infromation about each table in a group, a set of operations are generated. These table-specific operations return a reference to an iterator, called SmiTableIterator .

The SmiTableIterator interface is defined in the SNMP-Mgmt module. The SmiTableIterator interface lets a client application traverse a MIB table in the lexicographic order of the names (as defined in SNMP GET-NEXT) of its entries, and returns the reference to each table entry. A reference to GetNextEntryIterator is obtained as result of the invocation of the In "::<M>::<G>::get_<T>" operation, where ::<M>::<G> represents the IDL scoped name of a group, and <T> represents the identifier of the table.

Table: The SNMPMgmt::SmiTableIterator interface

module SNMPMgmt {
.....
typedef sequence<SmiEntry> SmiEntryList;
interface SmiTableIterator {
boolean next_one_entry( out SmiEntry smi_entry );
 
boolean next_n_entries (
in unsigned long how_many, out SmiEntryList smi_entry_list
);
 
void destroy();
};
.....
}; /* End of SNMPMgmt Module */
The next_one_entry() operation retrieves the object reference to the next entry of a specific table following the SNMP get-next traversal rule. The returned reference is put in the smi_entry parameter. If there are no more entries then the operation returns false, otherwise it returns true.

The next_n_entries() operation retrieves the references to a set of entries of a specific table following the SNMP get-next traversal rule. The number of entries to be retrieved is specified by the how_many parameter, and the returned entries are placed in the i smi_entry_list . If there are no more entries then the operation returns false, otherwise it returns true.

The destroy() operation destroys the iterator object associated with the reference.

Generation of IDL Interface for SMI Group
As described earlier, one IDL interface is generated for each SMI group in an SNMP information module. The descriptor of the OBJECT IDENTIFIER assignment for a group is used as the identifier for the IDL interface.

The non-tabular variables of the group are mapped as IDL attributes with the scope of the IDL interface of the corresponding group. See Mapping of OBJECT TYPE Macro for Variable for the generation of attributes from the OBJECT-TYPE macro for the non-tabular objects within the scope of the group.

The tables within the scope of the group are mapped as IDL operations within the scope of the IDL interface for the enclosing group. The identifier of the operation is constructed by prepending a get_ string to the macro descriptor. The returned value of the of the operation is of type SNMPMgmt::SmiTableIterator interface. See Mapping of OBJECT-TYPE Macro for Table for the generation of operations based on the OBJECT-TYPE macro of the tables within the scope of the group.

The value of the OBJECT IDENTIFIER assignment and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:


<IDL-SCOPED-NAME> <OID> Group not-accessible

Note that each of the elements of the above declarations are separated by one or more spaces and the declarartion is terminated by a newline character.


Example:
Mapping Group eval to IDL Interface describes the mapping of the group eval to its corresponding IDL interface eval . The eval interface is derived from the SNMPMgmt::SmiEntry interface. The non-tabular variables of the eval group are represented as the IDL attribute in the interface. Note that the evalTable is mapped as an IDL operation get_evalTable(), within the scope of the eval interface.

Table: Mapping Group eval to IDL Interface

SMI Group FIZ-MIB DEFINITIONS ::= BEGIN .... eval OBJECT IDENTIFIER = {fizbin 2 } -- eval group has object called evalSlot evalSlot OBJECT-TYPE SYNTAX INTEGER MAX-ACCESS read-only STATUS current DESCRIPTION "" ::= {eval 1} evalTable OBJECT-TYPE SYNTAX SEQUENCE OF EvalEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) evaluation table." ::= {eval 2} ..... END
IDL module FIZ_MIB {
..... interface evalEntry; /*
*/
interface eval : SNMPMgmt::SmiEntry {
const string IndexVarList = ""; /* The Index Number of first unassigned entry in the evaluation table..... */ readonly attribute ASN1_Integer evalSlot; /* The (conceptual) evaluation table. */ SNMPMgmt::SmiTableIterator get_evalTable();
}; .....
}; // End of FIZ_MIB module
Entries in FIZ_MIB.oid File ::FIZ_MIB::eval 1.3.6.1.3.555.2.1 Group not-accessible ::FIZ_MIB::eval::evalSlot 1.3.6.1.3.555.2.1.1 ASN1_Integer read-only ::FIZ_MIB::eval::evalTable 1.3.6.1.3.555.2.1.2 Table not-accessible


Mapping of OBJECT-TYPE Macro for Table

The OBJECT-TYPE macro for a table is mapped as IDL operation within the scope of the IDL interface for the enclosing group. The identifier of the operation constructed by prepending get_ string to the macro descriptor . The returned value of the of the operation is of type SNMPMgmt::SmiTableIterator interface. The operation does not have any parameter. The value specification of the DESCRIPTION clause of the macro is mapped as block comment for the operation.
Mapping of Macro Descriptor
The macro-descriptor in OBJECT-TYPE MACRO is used to derive identifier of the corresponding IDL operation within the scope of the IDL interface for the enclosing group. The identifer of the operation is formed by prepending get_ string to the macro descriptor.

The format for the operation signature is as follows:


SNMPMgmt::SmiTableIterator get_<macro-descriptor>();

and the following operation will be generated for the resulting evalTable :


SNMPMgmt::SmiTableIterator get_evalTable();

Mapping of STATUS clause
The STATUS clause, which must be present, indicates whether this definition is current or historic. Possible values of STATUS clause are current, deprecated, or obsolete. Only those OBJECT-TYPE macros are mapped whose value-specification for STATUS clause is current.
Mapping of MAX-ACCESS Clause
The MAX-ACCESS clause, which must be present, defines whether it makes "protocol-sense" to read, write and/or create an instance of the object.

The value-specification of the MAX-ACCESS clause is ignored for the OBJECT-TYPE macro for the table.

Mapping of SYNTAX Clause
The SYNTAX clause, which must be present, defines the abstract data-structure corresponding to that object.

The SYNTAX clause of a table is always in the form of "SEQUECNE OF" of another type which is always a SEQUENCE in ASN.1. The enclosing SEQUENCE and OID hierarchy is used to identify the table-entry declaration for this table and then derive the name of the IDL interface of the corresponding table-entry.

The SYNTAX clause is ignored.

Mapping of DESCRIPTION Clause
The DESCRIPTION clause, which must be present, contains a textual definition of the object which provides all semantic definition necessary for implementation. The value-specification for this clause is mapped as block comment immediately before the declaration of the corresponding IDL attribute in the following form:

/* <DESCRIPTION-value-specification> */
Mapping of UNITS Clause
This clause is not applicable for Table.
Mapping of REFERENCE Clause
The REFERENCE clause, which need not be present, contains a textual cross-reference to an object defined in some other information module. If this clause is present then, the value-specification for this clause is appended to the block comment for the DESCRIPTION clause of this IDL attribute in the following form:

/* <DESCRIPTION-value-specification> REFERENCE: <value-specification> */

If possible the value-specification of the reference clause in OID format would be mapped in IDL scoped name format.

Mapping of IndexPart Clause
This clause is not applicable for Table.
Mapping of DEFVAL Clause
This clause is not applicable for Table.
Mapping of OBJECT-TYPE Value
The value of an invocation of the OBJECT-TYPE is an OBJECT IDENTIFIER and this value is used as authoritative registration identifier for referencing.

The value of the invocation OBJECT-TYPE macro for a Table and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:


<IDL-SCOPED-NAME> <OID> Table not-accessible

Note that each of the elements of the above declarations are separated by one or more spaces and the declarartion is terminated by a newline character.

Example:
Mapping OBJECT-TYPE Macro for Table to IDL Attributes shows the mapping of OBJECT-TYPE macro for a table, called evalTable , to corresponding IDL attribute. The instances of OBJECT-IDENTITY macro whose STATUS clause is either deprecated or obsolete are ignored.
Table: Mapping OBJECT-TYPE Macro for Table to IDL Attributes

OBJECT IDENTITY FIZ-MIB DEFINITIONS ::= BEGIN .... evalTable OBJECT-TYPE SYNTAX SEQUENCE OF EvalEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) evaluation table." ::= {eval 2} ..... END
IDL module FIZ_MIB {
..... /*
*/
interface eval : SNMPMgmt::SmiEntry {
...... /* "The (conceptual) evaluation table." */ SNMPMgmt::SmiTableIterator get_evalTable();
}; .....
}; // End of FIZ_MIB module
Entries in FIZ_MIB.oid File ::FIZ_MIB::eval 1.3.6.1.3.555.2.1 Group not-accessible ::FIZ_MIB::eval::evalTable 1.3.6.1.3.555.2.1.2 Table not-accessible

Mapping of OBJECT-TYPE Macro for Table Entry

The OBJECT-TYPE macros for are mapped as IDL interface. The macro descriptor is used as the identifier of the IDL interface.

The attributes of the IDL interface are identified based on the descriptors defined in the ASN.1 SEQUENCE in the SYNTAX clause of the OBJECT-TYPE macro of the table entry.

See Mapping of OBJECT TYPE Macro for Variable for the generation of attributes for the IDL interface from the OBJECT-TYPE macro for the column-variables of the table.

The value specification of the other clauses of this macro is mapped as IDL comment.

Mapping of Macro Descriptor
The descriptor in OBJECT-TYPE MACRO for is used as the identifier for the corresponding IDL interface. IDL interface for OBJECT-TYPE MACRO for always inherits from the SNMPMgmt::SmiEntry IDL interface.
Mapping of IndexPart Clause to IDL
An clause contains either an INDEX clause or an AUGMENT clause. It may not be present at all. The INDEX or AUGMENT clause must be present if that object corresponds to conceptual row.

If the INDEX clause is present then the value-specification of this clause is mapped as value of IDL constant literal with identifier IndexVarList of type string within the scope of the IDL interface, in the following form:


const string IndexVarList = “<INDEX-value-specification>“;

If the AUGMENTS clause is present then the value-specification of this clause (which is an table entry name) is converted to corresponding IDL scoped name and then mapped as the base interface (instead of SNMPMgmt::SmiEntry ) for the interface generated for this macro.

Mapping of DESCRIPTION Clause
The DESCRIPTION clause, which must be present, contains a textual definition of the object which provides all semantic definition necessary for implementation. The value-specification of this clause is mapped as block comment above the declaration of the IDL interface in the following form:

/* <DESCRIPTION-value-specification> */

Mapping of REFERENCE Clause
The REFERENCE clause, which need not be present, contains a textual cross-reference to an object defined in some other information module. If this clause is present then the value-specification for this clause is appended to the block comment (generated from DESCRIPTION clause) for the IDL interface in the following form:

/* <DESCRIPTION-value-specification> REFERENCE: <value-specification> */

Mapping of OBJECT-TYPE Value
The value of an invocation of the OBJECT-TYPE is an OBJECT IDENTIFIER and this value is used as authoritative registration identifier for referencing.

The value of the invocation OBJECT-TYPE macro for the and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:


<IDL-SCOPED-NAME> <OID> TableEntry not-accessible

Note that each of the elements of the above declarations are separated by one or more spaces and the declarartion is terminated by a newline character.

Example:
Converting evalEntry and evalAugEntry to IDL Interfaces describes the mapping of the Table Entry evalEntry to its corresponding IDL interface evalEntry . The interface evalEntry is defined as subtype of SNMPMgmt::SmiEntry . The descriptors in the ASN.1 type are used to identify the IDL attributes for the interface evalEntry .

The interface evalAugEntry is defined as subtype of evalEntry based on the ARGUMENTS clause. Also note that operations for default values are generated within the scope of the DefaultValues interface.

Table: Converting evalEntry and evalAugEntry to IDL Interfaces

SMI
OBJECT-TYPE
MACRO
FIZ-MIB DEFINITIONS ::= BEGIN .... evalTable OBJECT-TYPE SYNTAX SEQUENCE OF EvalEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) evaluation table." ::= {eval 2} evalEntry OBJECT-TYPE SYNTAX EvalEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry The (conceptual row) in the evaluation table." INDEX { evalIndex } ::= {evalTable 1 } EvalEntry ::= SEQUENCE { evalIndex Integer32, evalString DisplayString, evalValue Integer32, evalStatus RowStatus } evalAugTable OBJECT-TYPE SYNTAX SEQUENCE OF EvaAuglEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) Augmented evaluation table." ::= {eval 3} evalAugEntry OBJECT-TYPE SYNTAX EvaAuglEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An example of augmented entry." ARGUMENTS { evalEntry } ::= {evalAugTable 1} EvalAugEntry ::= SEQUENCE { evalAugString DisplayString } ..... END
IDL module FIZ_MIB {
..... /*
*/
interface eval : SNMPMgmt::SmiEntry {
...... /* “The (conceptual) evaluation table.” */ SNMPMgmt::SmiTableIterator get_evalTable();
}; /* An entry The (conceptual row ) in the evaluation table. */ interface evalEntry : SNMPMgmt::SmiEntry { const string IndexVarList = “evalIndex”; .... }; interface evalAugEntry : FIZ_MIB::evalEntry { .... }; ...
}; // End of FIZ_MIB module
Entries in FIZ_MIB.oid File ::FIZ_MIB::eval 1.3.6.1.3.555.2.1 Group not-accessible ::FIZ_MIB::eval::evalTable 1.3.6.1.3.555.2.1.2 Table not-accessible ::FIZ_MIB::evalEntry 1.3.6.1.3.555.2.1.2.1 TableEntry not-accessible ::FIZ_MIB::evalAugEntry 1.3.6.1.3.555.2.1.3.1 TableEntry not-accessible

Mapping of OBJECT TYPE Macro for Variable

For each OBJECT-TYPE macro that defines a leaf-object in the hierarchy, an IDL attribute is defined within the scope of the IDL interface for the corresponding parent object. The instances of OBJECT-TYPE macro whose STATUS clause is either deprecated or obsolete are not mapped to IDL. SNMP errors related to variable access are mapped to the following CORBA system exceptions, as follows:
Table: Mapping of SNMP Errors to IDL Exceptions

SNMP ERROR IDL Exception
noError NO_EXCEPTION
tooBig IMP_LIMIT
noSuchName NO_IMPLEMENT
badValue BAD_PARAM
readonly BAD_OPERATION
genErr INTERNAL
noAccess NO_PERMISSION
wrongType BAD_TYPECODE
wrongLength MARSHAL
wrongEncoding MARSHAL
wrongValue BAD_PARAM
noCreation CosLifeCycle::InvalidCriteria
inconsistentValue BAD_PARAM
resourceUnavilable NO_RESOURCE
commitFailed INTERNAL
undoFailed INTERNAL
authorizationError NO_PERMISSION
notWritable BAD_OPERATION
inconsistentName CosLifeCycle::CannotMeetCriteria
noSuchObject INV_OBJREF
noSuchInstance NO_IMPLEMENT
endOfMibView Not Applicable

The mapping of SNMPv1 errors to IDL excpetion can be derived based on the mapping defined in SNMPv1, SNMPv2 and SNMPv3 coexitence specification (see referenced document SMIv1 to SMIv2, and the SNMPv2 error to IDL exception mapping defined in Mapping of SNMP Errors to IDL Exceptions.

Mapping of STATUS Clause
The STATUS clause, which must be present, indicates whether this definition is current or historic. Possible values of STATUS clause are current, deprecated, or obsolete. Only those OBJECT-TYPE macros are mapped whose value-specification for STATUS clause is current.
Mapping of Macro Descriptor
The macro-descriptor in OBJECT-TYPE MACRO is mapped as identifier for the corresponding IDL attribute.
Mapping of MAX-ACCESS Clause
The MAX-ACCESS clause, which must be present, defines whether it makes protocol-sense to read, write and/or create an instance of the object.

The mapping of the value-specification of the MAX-ACCESS clause of a variable is described in Mapping of MAX-ACCESS Clause.

Table: Mapping MAX-ACCESS Clause to IDL Attribute Mode

SNMP MAX-ACCESS IDL Attribute Mode
read-only readonly
read-write <empty>
read-create <empty>
not-accessible <comment>

Mapping of SYNTAX Clause
The SYNTAX clause, which must be present, defines the abstract data-structure corresponding to that object. The data structure must be one of the alternatives defined in the ObjectSyntax CHOICE. Full ASN.1 subtyping is allowed.

The value-specification of the SYNTAX clause is mapped as type of the corresponding attribute.

If the value of the SYNTAX clause is defined to be an ASN.1 subtype, then an intermediate textual-convention macro is defined for mapping. The descriptor of the textual-convention macro is formed by capitalizing the first character of the descriptor for the OBJECT-TYPE macro and the descriptor of the new Textual-Convention macro is used in value-specification of SYNTAX clause. Note that the mapping of the value of the SYNTAX clause to Textual-Convention macro is totally internal to the compiler and we have just used it to explain how the mapping would be done. Since Textual-Convention macros also generate operation in TextualConventions() and DefaultValues() interfaces, the IDL types generated from the intermediate Textual-Conventions are placed within the scope of the module (not the interface).

Mapping ASN.1 Subtype in SYNTAX Clause describes the mapping of ASN.1 subtype in the SYNTAX clause. First, a Textual-Convention macro is created based on the SYNTAX clause; then the modified ASN.1 is mapped, following the mapping of i TextualConventions() and the mapping of OBJECT-TYPE macro. Note that since we have defined the EvalStringType within the context of the module (not the interface) we can use the type for both the attribute of TableEntry interfaces and operations of TextualConventions() and DefaultValues() interfaces without using scoped-name.

Table: Mapping ASN.1 Subtype in SYNTAX Clause

SMI OBJECT -TYPE MACRO evalString OBJECT-TYPE SYNTAX OCTET STRING (SIZE (0..255)) MAX-ACCESS read-create STATUS current DEFVAL "Initial STring" DESCRIPTION "The string to evaluate. evaluation table." ::= {evalEntry 2 }
Modified MACROS (Intermediate form - not generated) EvalString ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION "" SYNTAX OCTET STRING (SIZE (0..255)) evalString OBJECT-TYPE SYNTAX EvalString MAX-ACCESS read-create STATUS current DESCRIPTION "The string to evaluate. evaluation table." ::= {evalEntry 2 }
IDL Attributes module FIZ_MIB { .....
//# The typedef below is derived from the following ASN.1 type //# EvalString ::= OCTET STRING (SIZE (0..255)) typedef sequence<octet, 256> EvalStringType; interface evalEntry {
const string IndexVarList = “evalIndex”; .... /* The string to evaluate. evaluation table. */ attribute EvalStringType evalString; ....
}; /* pseudo */ interface TextualConventions {
string DisplayStringToString(in DisplayStringType value); DisplayStringType DisplayStringFromString(in string str);
};
};

Mapping of DESCRIPTION Clause
The DESCRIPTION clause, which must be present, contains a textual definition of the object which provides all semantic definition necessary for implementation. The value-specification for this clause is mapped as block comment immediately before the declaration of the corresponding IDL attribute in the following form:

/* <DESCRIPTION-value-specification> UNITS : <value-specification> */
Mapping of UNITS Clause
The UNITS clause, which need not be present, contains a textual definition of the units associated with that object. If this clause is present then the value-specification for this clause is mapped as IDL comment and appended to the block comment for DESCRIPTION clause of this attribute in the following form:

/* <value-specification> UNITS : <value-specification> */
Mapping of REFERENCE Clause
The REFERENCE clause, which need not be present, contains a textual cross-reference to an object defined in some other information module. If this clause is present then, the value-specification for this clause is mapped appended to the block comment for the DESCRIPTION clause of this IDL attribute in the following form:

/* <DESCRIPTION-value-specification> UNITS : <value-specification> REFERENCE: <value-specification> */

If possible the value-specification of the reference clause in OID format is mapped in IDL scoped name format.

Mapping of IndexPart Clause
This clause is not applicable for column-variables in a table or a non-tabular object for a group.
Mapping of DEFVAL Clause
The DEFVAL clause, which need not be present, defines an acceptable default value which may be used at the discretion of an SNMP entity acting as agent role when an object instance is created. The value of the DEFVAL clause must correspond to the SYNTAX clause for the object.

If this clause is present then an operation is defined within the scope of the pseudo IDL interface in the following form:


/* pseudo */ interface DefaultValues { // DEFVAL: <value-specification> <Type> <macro-descriptor>(); };

The value-specification of this clause is mapped as comment before the operation declaration. is derived from the mapping of the SYNTAX clause of the macro and must have the same name as the type of the corresponding IDL attribute. If the SYNTAX of the variable is subtype of the built-in ASN.1 types or SMI types, then is based on the typedef defined for the constructed type. In all cases the in the interface must be same as the type name of the corresponding IDL attribute.

IDL pseudo interfaces are mapped as library API (like CORBA::TypeCode interface), in contrast to client and server side skeleton.

Mapping of OBJECT-TYPE Value
The value of an invocation of the OBJECT-TYPE is an OBJECT IDENTIFIER and this value is used as authoritative registration identifier for referencing.

The value of the invocation OBJECT-TYPE macro for a variable and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:


<IDL-SCOPED-NAME> <OID> <SMI-TYPE-OF-SYNTAX> <MAX-ACCESS>

Note that each of the elements of the above declarations are separated by one or more spaces and the declarartion is terminated by a newline character.

Example:
Converting OBJECT-TYPE Macros for Variables to IDL illustrates the mapping of a set of tabular variables. Notice that the variable is not mapped becuase of its max-access clause. Also notice that the DefaultValues() interface is generated in order to map the DEFVAL clauses in and variables.
Table: Converting OBJECT-TYPE Macros for Variables to IDL

SMI OBJECT -TYPE MACRO FIZ-MIB DEFINITIONS ::= BEGIN .... eval OBJECT IDENTIFIER = {fiizbin 2 } -- eval group has object called evalSlot
evalSlot OBJECT-TYPE SYNTAX INTEGER MAX-ACCESS read-only STATUS current DESCRIPTION "" ::= {eval 1} evalTable OBJECT-TYPE SYNTAX SEQUENCE OF EvalEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) evaluation table." ::= {eval 2} evalEntry OBJECT-TYPE SYNTAX EvalEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An entry The (conceptual row) in the evaluation table." INDEX { evalIndex } ::= {evalTable 1 } EvalEntry ::= SEQUENCE { evalIndex Integer32, evalString DisplayString, evalValue Integer32, evalStatus RowStatus evalIndex OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS not-accessible STATUS current DESCRIPTION "The auxiliary variable used for identifying instances of the columnar objects in the evaluation table." ::= {evalEntry 1} evalString OBJECT-TYPE SYNTAX DisplayString MAX-ACCESS read-create STATUS current DESCRIPTION "The string to evaluate. evaluation table." ::= {evalEntry 2 } evalValue OBJECT-TYPE SYNTAX Integer32 MAX-ACCESS read-only STATUS current DESCRIPTION "The value when evalString was last executed." DEFVAL { 0 } ::= {evalEntry 1} evalStatus OBJECT-TYPE SYNTAX RowStatus MAX-ACCESS read-create STATUS current DESCRIPTION "The status column used for creating, modifying, and deleting instances of the columnar objects in the evaluation table." DEFVAL { active } ::= {evalEntry 2 } evalAugTable OBJECT-TYPE SYNTAX SEQUENCE OF EvaAuglEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "The (conceptual) Augmented evaluation table." ::= {eval 3} evalAugEntry OBJECT-TYPE SYNTAX EvaAuglEntry MAX-ACCESS not-accessible STATUS current DESCRIPTION "An example of augmented entry." AGUMENTS { evalEntry } ::= {evalAugTable 1} EvalAugEntry ::= SEQUENCE { evalAugString DisplayString } .....
END
IDL Attributes module FIZ_MIB {
..... interface evalEntry; typedef sequence<evalEntry> evalEntryList; /*
*/
interface eval : SNMPMgmt::SmiEntry {
const string IndexVarList = ""; /* The Index Number of first unassigned entry in the evaluation table..... */ readonly attribute ASN1_Integer evalSlot; /* "The (conceptual) evaluation table." */ SNMPMgmt::SmiTableIterator get_evalTable();; /* "The (conceptual) augmented evaluation table." */ SNMPMgmt::SmiTableIterator get_evalAugTable();
}; /* An entry The (conceptual row ) in the evaluation table. */ interface evalEntry : SNMPMgmt::SmiEntry {
const string IndexVarList = "evalIndex"; /* The string to evaluate. evaluation table. */ readonly attribute DisplayStringType evalString; /* The value when eval string was last executed. DEFVAL : 0 */ readonly attribute Integer32 evalValue; /* The status column used for creating, modifying, and deleting instances of the columnar objects in the evaluation table. DEFVAL : active */ attribute RowStatusType evalStatus;
}; interface evalAugEntry : FIZ_MIB::evalEntry {
const string IndexVarList = ""; .readonly attribute DisplayStringType evalAugString;
};
/* pseudo */ interface DefaultValues {
// DEFVAL : 0 Integer32 evalValue(); // DEFVAL : active RowStatusType evalStatus();
}; /* pseudo */ interface TextualConventions {
string DisplayStringToString(in DisplayStringType value); DisplayStringType DisplayStringFromString(in string str);
};
};
Entries in FIZ_MIB.oid File ::FIZ_MIB::eval 1.3.6.1.3.555.2.1 Group not-accessible ::FIZ_MIB::eval::evalTable 1.3.6.1.3.555.2.1.2 Table not-accessible ::FIZ_MIB::evalEntry 1.3.6.1.3.555.2.1.2.1 TableEntry not-accessible ::FIZ_MIB::evalEntry 1.3.6.1.3.555.2.1.2.1 TableEntry not-accessible ::FIZ_MIB::evalEntry::evalIndex 1.3.6.1.3.555.2.1.2.1.1 Integer32Type read-only ::FIZ_MIB::evalEntry::evalString 1.3.6.1.3.555.2.1.2.1.2 ASN1_OctetString read-only ::FIZ_MIB::evalEntry::evalValue 1.3.6.1.3.555.2.1.2.1.3 Integer32Type read-only ::FIZ_MIB::evalEntry::evalStatus 1.3.6.1.3.555.2.1.2.1.4 ASN1_Integer read-create ::FIZ_MIB::evalAugEntry 1.3.6.1.3.555.2.1.3.1 TableEntry not-accessible ::FIZ_MIB::evalAugEntry::evalAugString 1.3.6.1.3.555.2.1.3.1.1 ASN1_OctetString read-only

Factory Interfaces for Groups/Table-Entries

In SMIv2, there is a data type (TextualConvention) called for creation of a row whose value define various stages of life-cycle of an entry in a table. A table which support entry creation by managers must include a variable of type When a manager wants to create a table, it must pass the proper value of the variable in addition to all the variables with read-create access and the index variables in the SNMP SET message. See RFC 1902, section 7.1.12.1.

We can very easily map such create/delete functions in the SNMP domain by defining create operation in a factory interface in the CORBA domain. A factory interface can be defined for each module and there will be one create_<smi_entry_type>() operation per IDL interface generated for group/table-entry from the SNMP MIB module.

Generating Factory Interfaces for Groups/Table-Entries

A factory interface, called SmiEntryFactory , is generated for each SNMP information module if it has at least one group with a table or a non-tabular variable. The factory interface is defined within the scope of the IDL module for the corresponding SMI module and it is derived from the generic factory, SNMPMgmt::GenericFactory .

For each IDL interface generated for groups/table-entries, one IDL operation is defined. The name of the IDL operation is derived by concatenating the identifier of the interface to the string create_ (in the form create_<interface_id>()). The return value of the operations is the type of the IDL interface. In addition to the criteria parameter (which is always defined as the last parameter), the types and names of the other parameters of a operation are derived from the index variables and those column variables with read-write and read-create mode and with no DEFVAL clause of the corresponding group/table-entry. It is assumed that the IDL interface for a group does not have any index variables.

The exception parameters of the generated create_<interface_id>() operations are based on the exceptions defined in the CosLifeCycle::GenericFactory::create_object(). All the generated create operations may raise one of the following user-defined exceptions:


CosLifeCycle::InvalidCriteria , CosLifeCycle::CannotMeetCriteria , CosNaming::NamingContext::AlreadyBound .

The factory interface for the eval group is shown in Factory Interface for SNMP MIB modules.

Table: Factory Interface for SNMP MIB modules

module Eval_MIB {
....
interface SmiEntryFactory : SNMPMgmt::GenericFactory {
eval create_eval( in CosLifeCycle::Criteria the_criteria }
raises (
CosLifeCycle::InvalidCriteria, CosLifeCycle::CannotMeetCriteria,
CosNaming::NamingContext::AlreadyBound
);
evalEntry create_evalEntry (
in Integer32Type evalIndex, in RowStatusType evalStatus,
in CosLifeCycle::Criteria the_criteria }
raises (
CosLifeCycle::InvalidCriteria, CosLifeCycle::CannotMeetCriteria
CosNaming::NamingContext::AlreadyBound
);
evalAugEntry create_evalAugEntry (
in Integer32Type evalIndex, in RowStatusType evalStatus
in CosLifeCycle::Criteria the_criteria}
raises (
CosLifeCycle::InvalidCriteria, CosLifeCycle::CannotMeetCriteria
CosNaming::NamingContext::AlreadyBound
);
};
};

SMIv2 NOTIFICATION-TYPE Macro

The NOTIFICATION-TYPE macro is used to define the information contained within an unsolicited transmission of management information.

Structure of NOTIFICATION-TYPE Macro shows the structure of the NOTIFICATION-TYPE macro.

Table: Structure of NOTIFICATION-TYPE Macro

NOTIFICATION-TYPE MACRO ::=
BEGIN
TYPE NOTATION ::=
ObjectsPart
"STATUS" Status
"DESCRIPTION" Text
ReferPart
VALUE NOTATION ::= value (VALUE OBJECT IDENTIFIER)
ObjectsPart ::= "OBJECTS" "{" Objects "}" | empty
Objects ::= Object | Objects "," Object
Object ::= value (Name ObjectName)
Status ::= "current" | "deprecated" | "obsolete"
ReferPart ::= "REFERENCE" Text | empty
-- uses the NVT ASCII character set
Text ::= """" string """"
END

The instances of NOTIFICATION-TYPE macro whose STATUS clause is either deprecated or obsolete are ignored.

Mapping of OBJECTS Clause

The OBJECTS clause, which need not be present, defines the ordered sequence of MIB objects which are contained within every instances of notification.

If the clause is present then the value-specification of this clause is mapped to an IDL struct (to be used as event-data) as follows:

The new IDL types (as described above) are declared within the scope of the corresponding IDL module.

The main advantage of mapping OBJECTS clause to IDL struct is that one can use the information about the objects in NOTIFICATION-TYPE macro as event information. This event information can be exchanged both as typed or un-typed event data based on the OMG Event Services Specification (see reference ESS).

Mapping of DESCRIPTION Clause

The DESCRIPTION clause, which must be present, contains a textual definition of the notification which provides all semantic definition necessary for implementation. The value-specification for this clause is mapped as block comment above the IDL declaration of operation for the value of this macro, in the following form:

/* <DESCRIPTION-value-specification> */

Mapping of REFERENCE Clause

The REFERENCE clause, which need not be present, contains a textual cross-reference to an notification defined in some other module. The value-specification for this clause is appended to the block comment for the DESCRIPTION clause of this macro, in the following form:

/* <DESCRIPTION-value-specification> REFERENCE: <value-specification> */

Mapping of NOTIFICATION-TYPE Value

The value of an invocation of the NOTIFICATION-TYPE is an OBJECT IDENTIFIER and this value is used as authoritative registration identifier for referencing. The value of the invocation NOTIFICATION-TYPE macro and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:

<IDL-SCOPED-NAME> <OID> Notification not-accessible

Note that each of the elements of the above declarations are separated by one or more spaces and the declarartion is terminated by a newline character.

Operation for Typed-Push Event Communication

A Notifications interface is generated for each SMI module if there exists at least one NOTIFICATION-TYPE macro in the SMI module being translated. The generated Notifications interface is defined to be subtype of SNMPMgmt::Notifications interface. An operation is generated within the scope of the Notifications interface for typed-push event communication. The descriptor of the macro is used as the identifier for the operation. The mandatory in parameter of the operation are the name of the object that is generating the event, and the time-stamp of the event. The example in Mapping SMIv2 NOTIFICATION-TYPE Macros to IDL describes the types of these parameters. The optional in parameter of the operation is the IDL struct defined for the value-specification of the OBJECTS clause, as described in Mapping of OBJECTS Clause. If the OBJECT clause is not present, then this parameter is not generated. The return value of the operation is of type

Operation for Typed-Pull Event Communication

A PullNotification interface is generated for each SMI module if there exists at least one NOTIFICATION-TYPE macro in the SMI module being translated. The generated PullNotification interface is defined to be subtype of SNMPMgmt::PullNotifications interface. Two operations ( try_<op>() and pull_<op>()) are generated within the scope of the PullNotifications interface of this module, where <op> is the identifier of the corresponding operation in the Notifications interface. The in parameter of push operation in the Notifications interface is converted to an out parameter. The return value of try_<op>() and pull_<op>() are boolean and void , respectively.
Example:
Mapping SMIv2 NOTIFICATION-TYPE Macros to IDL illustrates the mapping of a SMIv2 NOTIFICATION-TYPE macro, called linkUp(), into IDL operation. Note that we have defined an IDL type called LinkUpType . The element of the struct is defined based on the IDL type IfIndexVBType , generated from the object ifIndex . The type for the var_value field in is obtained from the value-specification of the SYNTAX clause of the OBJECT-TYPE macro, called Notice that only one is generated, even though the object is present in both linkUp() and linkDown() notification macros. For coldStart() and warmStart() macros, no IDL type is generated since the OBJECT clause is not present in the macro and as such no parameter is defined in the corresponding operations.

Mapping SMIv2 NOTIFICATION-TYPE Macros to IDL also describes the operation signatures for the typed-push and typed-pull event communication. The operation signature for typed-push communication is linkUp(), which is defined within the scope of the Notifications interface. Operation signatures for typed-pull communication are pull_linkUp() and try_linkup(), which are defined within the scope of the PullNotifications interface. Note that there will be only one interface for typed-push event communication and only one for typed-pull event communication for each SNMP information module. During the connection set-up procedure, a client application would pass the fully-scoped IDL interface name, that is, <moduleName>::Notifications and <moduleName>::PullNotifications , to an event channel to set up a connection.

Table: Mapping SMIv2 NOTIFICATION-TYPE Macros to IDL

SMI NOTIFICATION TYPE SNMPv2-MIB DEFINITIONS ::= BEGIN .... coldStart NOTIFICATION-TYPE STATUS current DESCRIPTION "A coldStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration may be altered." ::= { snmpTraps 1 } warmStart NOTIFICATION-TYPE STATUS current DESCRIPTION "A warmStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered." ::= { snmpTraps 2 } linkDown NOTIFICATION-TYPE OBJECTS { ifIndex } STATUS current DESCRIPTION "A linkDown trap signifies that the SNMPv2 entity, acting i in an agent role, recognizes a failure in one of the communication links represented in its configuration." ::= { snmpTraps 3 } linkUp NOTIFICATION-TYPE OBJECTS { ifIndex } STATUS current DESCRIPTION "A linkUp trap signifies that the SNMPv2 entity, acting i in an agent role, recognizes that one of the communication links represented in its configuration has come up." ::= { snmpTraps 4 } .... END
IDL module SNMPv2_MIB {
.............. struct IfIndexVBType {
string var_name; // IDL Scoped-Name of the object string var_index; // Only Instance Info part ASN1_Integer var_value;
}; struct LinkDownType {
IfIndexVBType ifIndex;
}; struct LinkUpType {
IfIndexVBType ifIndex;
}; /* for typed-push event communication */ interface Notifications : SNMPMgmt::Notifications {
/* A coldStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration may be altered. */ void coldStart (
in CosNaming::Name src_entry_name, in ASN1_GeneralizedTime event_time );
/* A warmStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered. */ void warmStart (
in CosNaming::Name src_entry_name, in ASN1_GeneralizedTime event_time
); /* A linkDown trap signifies that the SNMPv2 entity, acting in an agent role, recognizes a failure in one of the communication links represented in its configuration. */ void linkDown (
in CosNaming::Name src_entry_name, in ASN1_GeneralizedTime event_time, in LinkDownType notification_info
); /* A linkUp trap signifies that the SNMPv2 entity, acting in an agent role, recognizes that one of the communication links represented in its configuration has come up. */ void linkUp (
in CosNaming::Name src_entry_name, in ASN1_GeneralizedTime event_time, in LinkUpType notification_info
);
};
   
  // for typed-pull event communication interface PullNotifications : SNMPMgmt::PullNotification {
/* A coldStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration may be altered. */ void pull_coldStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time
);
/* A coldStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration may be altered. */ boolean try_coldStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time
);
/* A warmStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered. */ void pull_warmStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time
); /* A warmStart trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered. */ boolean try_warmStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time
); /* A linkDown trap signifies that the SNMPv2 entity, acting in an agent role, recognizes a failure in one of the communication links represented in its configuration. */ void pull_linkDown (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out LinkDownType notification_info
); /* A linkDown trap signifies that the SNMPv2 entity, acting in an agent role, recognizes a failure in one of the communication links represented in its configuration. */ boolean try_linkdown (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out LinkDownType notification_info
); /* A LinkUp trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered. */ void pull_linkUp (
out CosNaming::Name src_entry_name, ASN1_GeneralizedTime event_time, out LinkUpType notification_info
); /* A linkUp trap signifies that the SNMPv2 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered. */ boolean try_linkUp (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out LinkUpType notification_info
);
}; }; // End of module SNMPv2_MIB
Entries in SNMPv2_MIB. oid File ::SNMPv2_MIB::Notifications::coldStart 1.3.6.1.6.3.1.1.5.1.1 Notification not-accessible ::SNMPv2_MIB::Notifications::warmStart 1.3.6.1.6.3.1.1.5.2.1 Notification not-accessible ::SNMPv2_MIB::Notifications::linkDown 1.3.6.1.6.3.1.1.5.3.1 Notification not-accessible ::SNMPv2_MIB::Notifications::linkUp 1.3.6.1.6.3.1.1.5.4.1 Notification not accessible

TRAP-TYPE Macros in SMIv1

Although the mapping of groups/tables/variables based on SMIv2 can also be applied to SMIv1 based specs, the same can not be said for traps defined for SMIv1. In SMIv1, traps are defined using TRAP-TYPE macros (as shown in TRAP-TYPE macro in SMIv1) which is described in RFC 1215. The SMIv1 TRAP-TYPE macro specification is different from the SMIv2 NOTIFICATION-TYPE macro.
Table: TRAP-TYPE macro in SMIv1

ourcompany OBJECT IDENTIFIER ::= { enterprises 9999 }
myAlarm TRAP-TYPE
ENTERPRISE ourcompany
VARIABLES { alarmReason }
DESCRIPTION ""
::= 1

The generated IDL interfaces and types from SMIv1 Trap-Type macros uses the IDL interfaces and types defined in the SnmpNotifications module.

Mapping of SMIv1 TRAP-TYPE Macro to IDL Operations

The SMIv1 TRAP-TYPE macros are first converted to SNMMv2 NOTIFICATION-TYPE macros, and then converted to IDL, following the SMIv2 NOTIFICATION-TYPE macro mapping rule (as described in SMIv2 NOTIFICATION-TYPE Macro).
Mapping of TRAP-TYPE to NOTIFICATION-TYPE
The SMIv1 SMI based TRAP-TYPE macros can easily be converted to SMIv2 SMI based NOTIFICATION-TYPE macros by using the following rules (as described in the referenced SNMPv2 Conformance document and SMIv1 to SMIv2 documents):

The OID for TRAP-TYPE macro is generated using the following format (see the mapping in Mapping SMIv1 Generic Traps to IDL Operations):


<enterprise-oid>.0.<trayp-type-macro-value>

The generated OID for the TRAP-TYPE macro and the IDL scoped name for the operations for push model is declared in the .oid file for the module.

The generated OID for the TRAP-TYPE macro and the IDL scoped name of the mapped descriptor are declared in the .oid file for the MIB module in the following format:


<IDL-SCOPED-NAME> <OID> Notification not-accessible

Thus, given a Repository ID of an operation for a trap originated in the CORBA domain, the information about the enterprise-oid and the specific trap type in the SNMP domain, can be recovered.

Once the TRAP-TYPE macros are mapped to NOTIFICATION-TYPE macro, the converted macros are then mapped to IDL using the NOTIFICATION-TYPE mapping rule.

Mapping of TRAP-TYPE Macros for Generic Traps

In order to support SMIv1 generic traps using typed interface for event communication in a CORBA domain, a set of operations is defined based on the usage examples in RFC 1215 section 2.2.2. Mapping SMIv1 Generic Traps to IDL Operations describes the TRAP-TYPE macros (as defined in RFC 1215) for generic traps. Although the Repository ID for the generic traps are defined based on Mapping of TRAP-TYPE to NOTIFICATION-TYPE, the enterprise oid has to be converted to the the gateway. Thus, a CORBA/SNMP gateway have to detect if a trap in SNMP domain or event in CORBA domain is based on generic trap before forwarding to other domain.

Since the ENTERPRISE clause of generic traps is always RFC1213.snmp (1.3.6.1.2.1.11), it is easy to detect if an event is based on generic trap by looking at the Repository ID of the operations in a CORBA domain. Similarly if the generic-trap filed in SNMPv1 PDU is of the generic trap type, the gateway can easily generate the Repository ID of the corresponding IDL operation from the SNMPv1 Trap-PDU.

Table: Mapping SMIv1 Generic Traps to IDL Operations

SMI TRAP-TYPE SNMPv1-GenericTraps DEFINITIONS ::= BEGIN .... coldStart TRAP-TYPE ENTERPRISE snmp DESCRIPTION "A coldStart trap signifies that the SNMPv1 entity, acting in an agent role, is reinitializing itself such that its configuration may be altered." ::= 0 warmStart TRAP-TYPE ENTERPRISE snmp DESCRIPTION "A warmStart trap signifies that the SNMPv1 entity, acting in an agent role, is reinitializing itself such that its configuration is unaltered." ::= 1 linkDown TRAP-TYPE ENTERPRISE snmp VARIABLES { ifIndex } DESCRIPTION "A linkDown trap signifies that the SNMPv1 entity, acting in an agent role, recognizes a failure in one of the communication links represented in its configuration." ::= 2 linkUp TRAP-TYPE ENTERPRISE snmp VARIABLES { ifIndex } DESCRIPTION "A linkUp trap signifies that the SNMPv1 entity, acting in an agent role, recognizes that one of the communication links represented in its configuration has come up." ::= 3 .... END
IDL // File name is SNMPv1_GenericTraps.idl module SNMPv1_GenericTraps {
.............. struct IfIndexVBType {
string var_name; // IDL Scoped-Name of the variable string var_index; // Only Instance Info part ASN1_Integer var_value;
}; struct LinkDownType {
IfIndexVBType ifIndex;
}; struct LinkUpType {
IfIndexVBType ifIndex;
};
// for typed-push event communication interface Notifications : SNMPMgmt::Notifications {
void coldStart (
in CosNaming::Name src_entry_name, in ASN1_GeneralizedTime event_time );
void warmStart (
in CosNaming::Name src_entry_name, in ASN1_GeneralizedTime event_time );
void linkDown (
in CosNaming::Name src_entry_name, in ASN1_GeneralizedTime event_time in LinkDownType notification_info );
void linkUp (
in CosNaming::Name src_entry_name, in CORBA::ScopedName event_type, in ASN1_GeneralizedTime event_time, in LinkUpType notification_info );
};
   
  // for typed-pull event communication interface PullNotifications : SNMPMgmt::PullNotifications {
void pull_coldStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time );
boolean try_coldStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time );
void pull_warmStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time );
boolean try_warmStart (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time );
void pull_linkDown (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out LinkDownType notification_info );
boolean try_linkDown (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out LinkDownType notification_info );
void pull_linkUp (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out LinkUpType notification_info );
boolean try_linkUp (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out LinkUpType notification_info );
};
}; // End of SNMPv1_GenericTraps module
Entries in SNMPv1_ GenericTraps.oid File ::SNMPv1_GenericTraps::Notifications::coldStart 1.3.6.1.2.1.11.0.0 Notification not-accessible ::SNMPv1_GenericTraps::Notifications::warmStart 1.3.6.1.2.1.11.0.1 Notification not-accessible ::SNMPv1_GenericTraps::Notifications::linkDown 1.3.6.1.2.1.11.0.2 Notification not-accessible ::SNMPv1_GenericTraps::Notifications::linkUp 1.3.6.1.2.1.11.0.3 Notification not-accessible

Mapping of Enterprise Specific TRAP-TYPE Macros

Mapping SMIv1Enterprise Specific Traps to IDL illustrates an example of the mapping of the enterprise specific traps in SMIv1 information modules and the mapping rules follow the mapping of the NOTIFICATION-TYPE macro.

Table: Mapping SMIv1Enterprise Specific Traps to IDL

SNMP MODULE SNMPv1-TrapExamples DEFINITIONS ::= BEGIN .... ourcompany OBJECT IDENTIFIER ::= { enterprises 9999 } myAlarm TRAP-TYPE ENTERPRISE ourcompany VARIABLES { alarmReason } DESCRIPTION "" ::= 1 -- Repository ID of this trap is derived by concatenating - the OID in ENTERPRISE clause, "0", and the Id number. END
IDL module SNMPv1_TrapExamples {
typedef sequence<octet, 255> DisplayString; struct AlarmReasonType { // Derived from variables in Object Clause
string var_name; // IDL Scoped-Name of the object string var_index; // Only Instance Info part DisplayString var_value;
}; struct MyAlarmType { // Derived from variables in Object Clause
AlarmReasonType alarmReason;
}; // for typed-push event communication interface Notifications : SNMPMgmt::Notifications {
void myAlarm (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, in MyAlarmType notification_info );
}; // for typed-pull event communication interface PullNotifications : SNMPMgmt::PullNotifications {
void pull_myAlarm (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out MyAlarmType notification_info );
void try_myAlarm (
out CosNaming::Name src_entry_name, out ASN1_GeneralizedTime event_time, out MyAlarmType notification_info );
};
}; // End of SNMPv1_TrapExamples module
Entries in SNMPv1_Trap Examples.oid File ::SNMPv1_TrapExamples::Notifications::myAlarm 1.3.6.1.4.1.11.9999.0.1 Notification not-accessible

SMIv2 TEXTUAL-CONVENTION Macros

The TEXTUAL-CONVENTION macro is used to convey the syntax and semantics associated with a textual convention. Only those TEXTUAL-CONVENTION macros are considered for mapping whose STATUS clause value specification is current.

Structure of TEXTUAL CONVENTION Macro Clauses describes the structure of the TEXTUAL-CONVENTION macro.

Table: Structure of TEXTUAL CONVENTION Macro Clauses

TEXTUAL-CONVENTION MACRO ::=
BEGIN
TYPE NOTATION ::=
DisplayPart
"STATUS" Status
"DESCRIPTION" Text
ReferPart
"SYNTAX" type(Syntax)
VALUE NOTATION ::= value (VALUE Syntax)
DisplayPart ::= "DISPLAY-HINT" Text | empty
Status ::= "current" | "deprecated" | "obsolete"
ReferPart ::= "REFERENCE" Text | empty
-- uses the NVT ASCII character set
Text ::= """" string """"
END

Based on SYNTAX clause, an IDL type is defined for each TEXTUAL-CONVENTION macro. The identifier of the IDL type for an instance of TEXTUAL-CONVENTION macro is the corresponding identifier for the descriptor for the macro. If the DISPLAY-HINT clause is present or the SYNTAX is enumerated INTEGER value or a subtype of OctetString, then two operations are declarea,d to convert the value of an object to displayable string, and displayable string to the typed value.

Mapping of STATUS Clause

The STATUS clause, which must be present, indicates whether this definition is current or historic. The value-specification of this clause is used to determine if an IDL type will be defined for this macro. Only those TEXTUAL-CONVENTION macros whose value-specification is current are mapped to IDL; all others are ignored.

Mapping of SYNTAX Clause

The SYNTAX clause, which must be present, defines the abstract data structure corresponding to the textual convention. The data structure must be one of the alternatives defined in the Object Syntax CHOICE. Full ASN.1 subtyping is allowed.

The type defined in the SYNTAX clause is first mapped to an ASN.1 type where the identifier of the ASN type is the descriptor for the TEXTUAL-CONVENTION macro and then converted to IDL by using the ASN1->IDL translation scheme defined in referenced document CORBA/CMF. The IDL type is defined within the scope of the IDL module for the SMIv2 module for Textual-Convention. Note that, since we are using the ASN.1->IDL translation scheme, a type suffix will be added to the ASN.1 type name in order to generate the identifier for the IDL type.

If the value specification clause is an enumerated INTEGER value or a subtype of then two operations will be declared (as described in Mapping of SYNTAX Clause) within the scope of the interface for mapping integer or octet-string value to enumerated value and vice-versa.

Mapping of DESCRIPTION Clause

The DESCRIPTION clause, which must be present, contains a textual definition of the textual convention which provides all semantic definition necessary for implementation. The value-specification for this clause is mapped as block comment above the IDL declaration of the IDL type in the following form:

/* <DESCRIPTION-value-specification> DISPLAY-HINT : <value-specification>. */

If the DISPLAY-HINT clause is present, the value-specification of this is appended to the block comment .

Mapping of DISPLAY-HINT Clause

The DISPLAY-HINT clause, which need not be present, gives a hint as to how the value of an instance of an object with the syntax defined using this textual convention might be displayed.

If this clause is present then two operations are declared to convert the value of an object to displayable string and displayable string to the typed value. The value-specification for this clause is mapped as IDL block comment above the operation declarations:


/* /* pseudo */ interface TextualConventions { /* <value-specification> of DESCRIPTION clause DISPLAY-HINT : <value-specification>. */ string <macro-descriptor>ToString (in <Type> Value); <Type> <macro-descriptor>FromString (in string str); };

<Type> is derived from the SYNTAX clause as defined in Mapping to Operations in Notification Modules.

Mapping of REFERENCE Clause

The REFERENCE clause, which need not be present, contains a textual cross-reference to a related item defined in some other published work. The value-specification for this clause is appended to the block comment for the DESCRIPTION clause of this macro, in the following form:

/* <DESCRIPTION-value-specification> REFERENCE : <REFERENCE-value-specification> */

If possible the value-specification of the reference clause in OID format is mapped in the IDL scoped name format.

Example:
Mapping TextualConvention for DisplayString to IDL illustrates the mapping of a TEXTUAL-CONVENTION macro, called DisplayString, into the associated IDL type. The IDL type DisplayStringType is mapped from the following ASN.1 type:

DisplayString ::= OCTET STRING (SIZE (0..255) )

Table: Mapping TextualConvention for DisplayString to IDL

TEXTUAL CONVENTION DisplayString ::= TEXTUAL-CONVENTION DISPLAY-HINT "255a" STATUS current DESCRIPTION "Represents textual information taken from the NVT ASCII character set, as defined in pages 4, 10-11 of RFC 854. Any object defined using this syntax may not exceed 255 characters in length." SYNTAX OCTET STRING (SIZE (0..255))
IDL //# Following ASN.1 type is derived from SYNTAX clause of DisplayString //# and mapped to IDL type //# DisplayString ::= OCTET STRING (SIZE (0..255))
/* Represents textual information taken from the NVT ASCII character set, as defined in pages 4, 10-11 of RFC 854. Any object defined using this syntax may not exceed 255 characters in length. DISPLAY-HINT : 255a */ typedef sequence<octet, 256> DisplayStringType; /* pseudo */ interface TextualConventions { /* Represents textual information taken from the NVT ASCII character set, as defined in pages 4, 10-11 of RFC 854. Any object defined using this syntax may not exceed 255 characters in length. DISPLAY-HINT : 255a */ string DisplayStringToString(in DisplayStringType value); DisplayStringType DisplayStringFromString(in string str);
};

Mapping SNMP TextualConvention to IDL Operations illustrates the mapping of a TEXTUAL-CONVENTION macro, called TruthValue, into an IDL type. The IDL type TruthValueType is mapped from the following ASN.1 type:

Table: Mapping SNMP TextualConvention to IDL Operations

TEXTUAL CONVENTION TruthValue ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION "Represents a boolean value." SYNTAX INTEGER { true (1) , false (2) }
IDL //# Following ASN.1 type is derived from SYNTAX clause of TruthValue //# and mapped to IDL type //# TruthValue ::= INTEGER { true (1) , false (2) } /* DESCRIPTION = “Represents a boolean value. */ typedef ASN1_Integer TruthValueType; const TruthValueType true = 1; const TruthValueType false = 2; const string TruthValue_NameNumberList = " true (1) , false (2) "; /* pseudo */ interface TextualConventions { /* Represents a boolean value. */ string TruthValueToString(in TruthValueType value); TruthValueType TruthValueFromString(in string str); };

Mapping SNMP TextualConvention to IDL Operations also illustrates the mapping of a macro, called into the IDL type, TimeStampType .

Table: Mapping SNMP TextualConvention to IDL Operations

TEXTUAL CONVENTION TimeStamp ::= TEXTUAL-CONVENTION STATUS current DESCRIPTION "" SYNTAX TimeTicks
IDL //# Following ASN.1 type is derived from SYNTAX clause of TimeStamp //# and mapped to IDL type //# TimeStamp ::= TimeTicks /* The value of MIB-II’s sysUpTime object at which a specific occurrence happened. The specific occurrence must be defined in description of any object defined using this type. */ typedef TimeTicksType TimeStampType;

SMIv2 Conformance Macros

The SMIv2 conformance macros define "the acceptable lower-bounds of implementation, along with the actual level of implementation achieved" (see referenced document SNMP v2 Protocol Operations). Since the IDL interfaces do not specify implementation requirements, this specification does not address the mapping of the following SMIv2 conformance macros:

MODULE-COMPLIANCE
OBJECT-GROUP
NOTIFICATION-GROUP
AGENT-CAPABILITIES


Why not acquire a nicely bound hard copy?
Click here to return to the publication details or order a copy of this publication.

Contents Next section Index