// File: IOP.idl
// From CORBA 3.0: Chapter 13, ORB Interoperability Achitecture
#pragma prefix "omg.org"

#include <orb.idl>

module IOP {


    // IOR Profiles

    // Standard Protocol Profile tag values
    typedef unsigned long           ProfileId;
    const ProfileId                 TAG_INTERNET_IOP = 0;
    const ProfileId                 TAG_MULTIPLE_COMPONENTS = 1;
    const ProfileId                 TAG_SCCP_IOP = 2;
    const ProfileId                 TAG_UIPMC = 3;

    struct TaggedProfile {
        ProfileId                   tag;
        sequence <octet>            profile_data;
    };

    typedef sequence <TaggedProfile> TaggedProfileSeq;

    // The IOR

    // an Interoperable Object Reference is a sequence of
    // object-specific protocol profiles, plus a type ID.
    struct IOR {
        string                      type_id;
        sequence <TaggedProfile>    profiles;
    };

    // IOR Components


    // Standard way of representing multicomponent profiles.
    // This would be encapsulated in a TaggedProfile.

    typedef unsigned long ComponentId;

    typedef CORBA::OctetSeq ComponentData;

    struct TaggedComponent {
        ComponentId                 tag;
        ComponentData               component_data;
    };

    typedef sequence <TaggedComponent> TaggedComponentSeq;
    typedef sequence <TaggedComponent> MultipleComponentProfile;

    typedef CORBA::OctetSeq ObjectKey;

    const ComponentId           TAG_ORB_TYPE                = 0;
    const ComponentId           TAG_CODE_SETS               = 1;
    const ComponentId           TAG_POLICIES                = 2;
    const ComponentId           TAG_ALTERNATE_IIOP_ADDRESS  = 3;
    const ComponentId           TAG_ASSOCIATION_OPTIONS     = 13;
    const ComponentId           TAG_SEC_NAME                = 14;
    const ComponentId           TAG_SPKM_1_SEC_MECH         = 15;
    const ComponentId           TAG_SPKM_2_SEC_MECH         = 16;
    const ComponentId           TAG_KerberosV5_SEC_MECH     = 17;
    const ComponentId           TAG_CSI_ECMA_Secret_SEC_MECH= 18;
    const ComponentId           TAG_CSI_ECMA_Hybrid_SEC_MECH= 19;
    const ComponentId           TAG_SSL_SEC_TRANS           = 20;
    const ComponentId           TAG_CSI_ECMA_Public_SEC_MECH= 21;
    const ComponentId           TAG_GENERIC_SEC_MECH        = 22;
    const ComponentId           TAG_FIREWALL_TRANS          = 23;
    const ComponentId           TAG_SCCP_CONTACT_INFO       = 24;
    const ComponentId           TAG_JAVA_CODEBASE           = 25;

    const ComponentId           TAG_TRANSACTION_POLICY      = 26;
    const ComponentId           TAG_MESSAGE_ROUTER          = 30;
    const ComponentId           TAG_OTS_POLICY              = 31;
    const ComponentId           TAG_INV_POLICY              = 32;

    const ComponentId           TAG_CSI_SEC_MECH_LIST       = 33;
    const ComponentId           TAG_NULL_TAG                = 34;
    const ComponentId           TAG_SECIOP_SEC_TRANS        = 35;

    const ComponentId           TAG_TLS_SEC_TRANS           = 36;

    const ComponentId           TAG_ACTIVITY_POLICY         = 37;

    const ComponentId           TAG_RMI_CUSTOM_MAX_STREAM_FORMAT = 38;

    const ComponentId           TAG_GROUP                   = 39;
    const ComponentId           TAG_GROUP_IIOP              = 40;

    const ComponentId           TAG_COMPLETE_OBJECT_KEY     = 5;
    const ComponentId           TAG_ENDPOINT_ID_POSITION    = 6;
    const ComponentId           TAG_LOCATION_POLICY         = 12;
    const ComponentId           TAG_DCE_STRING_BINDING      = 100;
    const ComponentId           TAG_DCE_BINDING_NAME        = 101;
    const ComponentId           TAG_DCE_NO_PIPES            = 102;

    const ComponentId           TAG_DCE_SEC_MECH            = 103;

    const ComponentId           TAG_INET_SEC_TRANS          = 123;


    // Service Contexts

    typedef unsigned long       ServiceId;
    struct ServiceContext {
        ServiceId               context_id;
        sequence <octet>        context_data;
    };
    typedef sequence <ServiceContext> ServiceContextList;
    const ServiceId             TransactionService          = 0;
    const ServiceId             CodeSets                    = 1;
    const ServiceId             ChainBypassCheck            = 2;
    const ServiceId             ChainBypassInfo             = 3;
    const ServiceId             LogicalThreadId             = 4;
    const ServiceId             BI_DIR_IIOP                 = 5;
    const ServiceId             SendingContextRunTime       = 6;
    const ServiceId             INVOCATION_POLICIES         = 7;
    const ServiceId             FORWARDED_IDENTITY          = 8;
    const ServiceId             UnknownExceptionInfo        = 9;
    const ServiceId             RTCorbaPriority             = 10;
    const ServiceId             RTCorbaPriorityRange        = 11;
    const ServiceId             FT_GROUP_VERSION            = 12;
    const ServiceId             FT_REQUEST                  = 13;
    const ServiceId             ExceptionDetailMessage      = 14;
    const ServiceId             SecurityAttributeService    = 15;
    const ServiceId             ActivityService             = 16;

    // Coder Decoder from Portable Interceptor

    local interface Codec {
        exception InvalidTypeForEncoding {};
        exception FormatMismatch {};
        exception TypeMismatch {};

        CORBA::OctetSeq encode (in any data)
            raises (InvalidTypeForEncoding);
        any decode (in CORBA::OctetSeq data)
            raises (FormatMismatch);
        CORBA::OctetSeq encode_value (in any data)
            raises (InvalidTypeForEncoding);
        any decode_value (
            in CORBA::OctetSeq data,
            in CORBA::TypeCode tc)
            raises (FormatMismatch, TypeMismatch);
    };

    // Codec Factory

    typedef short EncodingFormat;
    const EncodingFormat ENCODING_CDR_ENCAPS = 0;

    struct Encoding {
        EncodingFormat format;
        octet major_version;
        octet minor_version;
    };

    local interface CodecFactory {
        exception UnknownEncoding {};
        Codec create_codec (in Encoding enc)
            raises (UnknownEncoding);
    };
};
