Previous section.

Inter-domain Management: Specification Translation

Inter-domain Management: Specification Translation
Copyright © 1997 The Open Group

Mapping of SNMPv2 RFC Modules

Mapping of SNMPv2-SMI (RFC1442)

SNMPv2-SMI Module (RFC1442) is mapped to a file named SNMPv2_SMI.idl.

This SNMPv2_SMI.idl file contains the following IDL types and interfaces as translated from RFC 1442:

#ifndef _SNMPv2_SMI_idl
#define _SNMPv2_SMI_idl
#include <ASN1Types.idl>
#include <SNMPMgmt.idl>

module SNMPv2_SMI {

typedef long	Integer32Type;
typedef unsigned long	UInteger32Type;

typedef sequence<octet, 4>	IpAddressType;
typedef unsigned long	Counter32Type;
typedef long	Counter64Type[2];
typedef unsigned long	Gauge32Type;
typedef unsigned long	TimeTicksType;
typedef sequence<octet>	OpaqueType;
typedef ASN1_OctetString	NsapAddressType;

typedef ASN1_ObjectIdentifier	ObjectNameType;

enum SimpleSyntaxChoice {
    integerValueChoice,
    stringValueChoice,
    objectIDValueChoice,
    bitValueChoice
};

union SimpleSyntaxType switch(SimpleSyntaxChoice) {
    case integerValueChoice : ASN1_INTEGER integerValue;
    case stringValueChoice : ASN1_OctetString stringValue;
    case objectIDValueChoice : ASN1_ObjectIdentifier objectIDValue;
    case bitValueChoice : ASN1_BitString bitValue;
};

enum ApplicationSyntaxChoice {
    ipAddressValueChoice,
    counterValueChoice,
    gaugeValueChoice,
    timeticksValueChoice,
    arbitaryValueChoice,
    nsapAddressValueChoice,
    bigCounterValueChoice,
    unsignedIntegerValue
};

union ApplicationSyntaxType switch(ApplicationSyntaxChoice) {
    case ipAddressValueChoice : IpAddressType ipAddressValue;
    case counterValueChoice : Counter32Type counterValue;
    case gaugeValueChoice : Gauge32Type gaugeValue;
    case timeticksValueChoice : TimeTicksType timeticksValue;
    case arbitaryValueChoice : OpaqueType arbitaryValue;
    case nsapAddressValueChoice : NsapAddressType nsapAddressValue;
    case bigCounterValueChoice : Counter64Type bigCounterValue;
    case unsignedIntegerValueChoice : UInteger32Type unsignedIntegerValue;
};

enum ObjectSyntaxChoice {
    simpleChoice,
    applicationWideChoice
};

union ObjectSyntaxType switch(ObjectSyntaxChoice) {
    case simpleChice : SimpleSyntaxType simple;
    case applicationWideChoice : ApplicationSyntaxType application_wide;
};

}; /* End of SNMPv2_SMI Module.*/

Mapping of SNMPv2-TC (RFC1443)

SNMPv2-TC Module (RFC1443) is mapped to a file named SNMPv2_TC.idl, which contains the following IDL types and interfaces as translated from RFC 1443:

#ifndef _SNMPv2_TC_idl
#define _SNMPv2_TC_idl
#include <SNMPv2_SMI.idl>

module SNMPv2_TC {

typedef SNMPv2_SMI::ObjectSyntaxType ObjectSyntaxType;
typedef SNMPv2_SMI::Integer32Type Integer32Type;
typedef SNMPv2_SMI::TimeTicksType TimeTicksType;

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
// DisplayString ::= OCTET STRING (SIZE (0..255))
typedef sequence<octet, 256> DisplayStringType;

/*
DISPLAY-HINT: 255a
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.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
//     PhysAddress ::= OCTET STRING
typedef ASN1_OctetString PhysAddressType;

/*
DISPLAY-HINT: 1x:
DESCRIPTION: Represents a media or physical-level address.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
// MacAddress ::= OCTET STRING (SIZE (6))
typedef sequence<octet, 6> MacAddressType;

/*
DISPLAY-HINT: 1x:
DESCRIPTION:
    Represents an 802 MAC address represented in the
    canonical order defined by IEEE 802.1a, taht is,
    as if it were transmitted least significant bit
    first, even though 802.5 (in contrast to other
    802.x protocols) requires MAC addresses to be
    transmitted most significant bit first.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
// TruthValue ::= INTEGER { true (1) , false (2) }
typedef ASN1_INTEGER TruthValueType;

/*
DESCRIPTION: Represents a boolean value.
*/
const TruthValueType	true = 1;
const TruthValueType	false = 2;
const string TruthValue_NameNumberList = "true (1) , false (2)";

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
// TestAndIncr ::= INTEGER (0..2147483647)
typedef ASN1_INTEGER TestAndIncrType;

/*
DESCRIPTION:
    Represents integer-valued information used for
    atomic operations.
    See RFC 1443 for detailed description.
const string TestAndIncr_ValueRange = "0..2147483647";
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
//     AutonomousType ::=OBJECT IDENTIFIER
typedef ASN1_ObjectIdentifier AutonomousTypeType;

/*
DESCRIPTION:
    Represents an independently extensible type
    identification value. It may, for example,
    indicate a particular sub-tree with further MIB
    definitions, or define a particular type of
    protocol or hardware.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
//     InstancePointer ::= OBJECT IDENTIFIER
typedef ASN1_ObjectIdentifier InstancePointerType;

/*
DESCRIPTION:
    A pointer to a specific instance of a conceptual
    row of a MIB table in the managed device. By
    convention, it is the name of the particular
    instance of the first columnar object in the
    conceptual row.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
// TimeStamp = TimeTicks
typedef TimeTicksType TimeStampType;

/*
DESCRIPTION:
    The value of MIB-IIs sysUpTime object at which a
    specific occurrence happened. The specific
    occurrence must be defined in description of
    any object defined using this type.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
//     TimeInterval ::= INTEGER (0..2147483647)
typedef ASN1_INTEGER TimeIntervalType;

/*
DESCRIPTION: A period of time, measured in units of 0.01 seconds.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
// RowStatus ::= INTEGER {active(1), notInService(2),
//                notReady(3), createAndGo(4),
//                createAndWait(5), destroy(6) }
typedef ASN1_INTEGER RowStatusType;
const RowStatusType active = 1;
const RowStatusType notInService = 2;
const RowStatusType notReady = 3;
const RowStatusType createAndGo = 4;
const RowStatusType createAndWait = 5;
const RowStatusType destroy = 6;
const string RowStatus_NamedNumberList = ""
"active (1), notInService (2), notReady (3),
createAndGo (4), createAndWait (5), destroy (6)";

/*
DESCRIPTION:
    The RowStatus textual convention is used to manage
    the creation and deletion of conceptual
    rows, and is used as the value of the SYNTAX /clause
    for the status column of a conceptual row
    See RFC 1443 for detailed description.
*/

// Following ASN.1 type is derived from SYNTAX clause
// and mapped to IDL type
//     DateAndTime ::= OCTET STRING (SIZE (8 | 11))
typedef sequence<octet, 11> DateAndTimeType;

/*
DISPLAY-HINT: 2d-1d-1d,1d:1d:1d.1d,1a1d:1d
DESCRIPTION:
    A date-time specification.
    See RFC 1443 for detailed description.
    For example, Tuesday May 26, 1992 at
    1:30:15 PM EDT would be displayed as:
        1992-5-26,13:30:15.0,-4:0
    Note that if only local time is known, then
    timezone information (fields 8-10) is not present.
*/

/* pseudo */
interface TextualConventions {

    /*
    DISPLAY-HINT: 255a
    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.
    */
    string DisplayStringToString(in DisplayStringType value);
    DisplayStringType DisplayStringFromString(in string str);

    /*
    DISPLAY-HINT: 1x
    DESCRIPTION: Represents a media or physical-level address.
    */
    string PhysAddressToString(in PhysAddressType value);
    PhysAddressType PhysAddressFromString(in string str);

    /*
    DISPLAY-HINT: 1x
    DESCRIPTION: ....
    */
    string MacAddressToString(in MacAddressType value);
    MacAddressType MacAddressFromString(in string str);

    /*
    DESCRIPTION: Represents a boolean value.
    */
    string TruthValueToString(in TruthValueType value);
    TruthValueType TruthValueFromString(in string str);

    /*
    DESCRIPTION:
        The RowStatus textual convention is used to manage
        the creation and deletion of conceptual rows,
        and is used as the value of the SYNTAX /clause for
        the status column of a conceptual row.
        See RFC 1443 for detailed description.
    */
    string RowStatusToString(in RowStatusType value);
    RowStatusType RowStatusFromString(in string str);

    /*
    DISPLAY-HINT: 2d-1d-1d,1d:1d:1d.1d,1a1d:1d
    DESCRIPTION:
        A date-time specification. See RFC 1443 for detailed
        description. For example, Tuesday May 26, 1992 at
        1:30:15 PM EDT would be displayed as:
            1992-5-26,13:30:15.0,-4:0
        Note that if only local time is known, then timezone
        information (fields 8-10) is not present.
    */
    string DateAndTimeToString(in DateAndTimeType value);
    DateAndTimeType DateAndTimeFromString(in string str);

}; // End of TextualConvention interface

}; /* End of SNMPv2_TC Module.*/
#endif /* _SNMPv2_TC_idl */

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