📄 megacomessage.idl
字号:
// ``The contents of this file are subject to the Erlang Public License,// Version 1.1, (the "License"); you may not use this file except in// compliance with the License. You should have received a copy of the// Erlang Public License along with this software. If not, it can be// retrieved via the world wide web at http://www.erlang.org/.//// Software distributed under the License is distributed on an "AS IS"// basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See// the License for the specific language governing rights and limitations// under the License.//// The Initial Developer of the Original Code is Ericsson Utvecklings AB.// Portions created by Ericsson are Copyright 1999, Ericsson Utvecklings// AB. All Rights Reserved.''//// $Id$#ifndef _MEGACOMESSAGE_IDL_#define _MEGACOMESSAGE_IDL_// Changes made due to Implementations Guide is marked// whith a comment indicating version of document,// e.g. IGv6.//// This module defines an IDL mapping of the ASN.1 spec// for the Megaco/H.248 protocol as defined in RFC 3015//// As far as possible the following mapping rules// has been applied on the ASN.1 spec://// SEQUENCE - struct// SEQUENCE OF - sequence// CHOICE - union TypeUnion switch(TypeChoice) {...};// NULL OPTIONAL - boolean// OPTIONAL - boolean union (see below)// OCTET STRING - sequence<octet>// INTEGER - unsigned short when 0..65535// INTEGER - unsigned long when 0..4294967295// IA5String - string// BIT STRING - sequence<EnumType>//// Optional datatypes:// Several data types in this document uses OPTIONAL parts.// I.e. Part of the datatype is optional, e.g.// SecondRequestedEvent where the StreamID part is optional.// For every optional datatype we have defined special// optional datatype, e.g://// union OptX switch(boolean) {// case TRUE: X val;// };//// where X is the datatype. There is also the same case whith// optional lists, e.g://// union OptXList switch(boolean) {// case TRUE: sequence<X> val;// };//// In both these cases the actual value (val) is only valid if the// descriminator has the value TRUE.//module MegacoMessage { // Optional boolean (OUCH, this iiis ugly) union OptBoolean switch(boolean) { case TRUE: boolean val; }; // Optional unsigned short union OptUnsignedShort switch(boolean) { case TRUE: unsigned short val; }; // Optional unsigned long union OptUnsignedLong switch(boolean) { case TRUE: unsigned long val; }; typedef sequence<octet> OctetString; // IGv6 chap 6.40 struct IP4Address { sequence<octet, 4> address; // 4..4 OptUnsignedShort portNumber; // 0..65535 OPTIONAL }; struct IP6Address { sequence<octet, 16> address; // 16..16 OptUnsignedShort portNumber; // 0..65535 OPTIONAL }; struct DomainName { string name; OptUnsignedShort portNumber; // 0..65535 OPTIONAL }; typedef string PathName; // 1..64 enum MIdChoice { MIdChoice_ip4Address, MIdChoice_ip6Address, MIdChoice_domainName, MIdChoice_deviceName, MIdChoice_mtpAddress, MIdChoice_preliminary // MegacoSession special purpose }; typedef OctetString MtpAddress; union MIdUnion switch(MIdChoice) { case MIdChoice_ip4Address: IP4Address ip4; case MIdChoice_ip6Address: IP6Address ip6; case MIdChoice_domainName: DomainName domain; case MIdChoice_deviceName: PathName device; case MIdChoice_mtpAddress: MtpAddress mtp; // 2..4 - IGv6 chap 6.25 }; union OptMIdUnion switch(boolean) { case TRUE: MIdUnion val; }; typedef unsigned short ErrorCode; // 0..65535 typedef string ErrorText; union OptErrorText switch(boolean) { case TRUE: ErrorText val; }; struct ErrorDescriptor { ErrorCode code; // name clash OptErrorText text; // OPTIONAL name clash }; union OptErrorDescriptor switch(boolean) { case TRUE: ErrorDescriptor val; }; typedef unsigned long TransactionId; // 0..4294967295 union OptTransactionId switch(boolean) { case TRUE: TransactionId val; }; typedef unsigned long ContextID; // 0..4294967295 const ContextID nullContextID = 0; // 0 const ContextID chooseContextID = 4294967294; // 0xFFFFFFFE const ContextID allContextID = 4294967295; // 0xFFFFFFFF typedef sequence<octet, 1> WildcardField; // 1..1 struct BinaryTerminationId { sequence<WildcardField> wildcard; sequence<octet, 8> id; // 1..8 }; struct TextTerminationId { boolean containsWildcards; sequence<string> id; }; enum Encoding {Encoding_text, Encoding_binary}; union TerminationIdUnion switch(Encoding) { case Encoding_text: TextTerminationId text; case Encoding_binary: BinaryTerminationId binary; }; typedef sequence<TerminationIdUnion> TerminationIdList; enum TopologyDirection { TopologyDirection_bothway, TopologyDirection_isolate, TopologyDirection_oneway }; struct TopologyRequest { TerminationIdUnion terminationFrom; TerminationIdUnion terminationTo; TopologyDirection dir; // Name clash }; union OptTopologyRequestList switch(boolean) { case TRUE: sequence<TopologyRequest> val; }; struct ContextRequest { OptUnsignedShort priority; // 0..15 OPTIONAL OptBoolean emergency; // OPTIONAL OptTopologyRequestList topologyReq; // OPTIONAL }; struct ContextAttrAuditRequest { boolean topology; // NULL OPTIONAL boolean emergency; // NULL OPTIONAL boolean priority; // NULL OPTIONAL }; enum StreamMode { StreamMode_sendOnly, StreamMode_recvOnly, StreamMode_sendRecv, StreamMode_inactive, StreamMode_loopBack }; union OptStreamMode switch(boolean) { case TRUE: StreamMode val; }; enum Relation { Relation_greaterThan, Relation_smallerThan, Relation_unequalTo }; typedef OctetString Name; // ASN1: 2..2; ABNF; 1..64 typedef OctetString PkgdName; // ASN1: 4..4; ABNF 1..64 SLASH 1..64 typedef PkgdName EventName; enum ExtraInfoChoice { ExtraInfoChoice_relation, ExtraInfoChoice_range, ExtraInfoChoice_sublist }; union ExtraInfoUnion switch(ExtraInfoChoice) { case ExtraInfoChoice_relation: Relation rel; case ExtraInfoChoice_range: boolean range; case ExtraInfoChoice_sublist: boolean sub; }; union OptExtraInfoUnion switch(boolean) { case TRUE: ExtraInfoUnion val; }; typedef sequence<OctetString> Value; // IGv6 chap 6.40 struct PropertyParm { PkgdName name; sequence<OctetString> value; OptExtraInfoUnion extraInfo; // OPTIONAL }; struct LocalControlDescriptor { OptStreamMode streamMode; // OPTIONAL OptBoolean reserveValue; // OPTIONAL - IGv6 chap 6.69 OptBoolean reserveGroup; // OPTIONAL - IGv6 chap 6.69 sequence<PropertyParm> propertyParms; }; union OptLocalControlDescriptor switch(boolean) { case TRUE: LocalControlDescriptor val; }; typedef sequence<PropertyParm> PropertyGroup; struct LocalRemoteDescriptor { sequence<PropertyGroup> propGrps; }; union OptLocalRemoteDescriptor switch(boolean) { case TRUE: LocalRemoteDescriptor val; }; struct StreamParms { OptLocalControlDescriptor localControlDescriptor; // OPTIONAL OptLocalRemoteDescriptor localDescriptor; // OPTIONAL OptLocalRemoteDescriptor remoteDescriptor; // OPTIONAL }; typedef unsigned short StreamID; // 0..65535 union OptStreamID switch(boolean) { case TRUE: StreamID val; }; struct StreamDescriptor { StreamID id; StreamParms parms; }; enum StreamsChoice { StreamsChoice_oneStream, StreamsChoice_multiStream }; union StreamsUnion switch(StreamsChoice) { case StreamsChoice_oneStream: StreamParms one; case StreamsChoice_multiStream: sequence<StreamDescriptor> multi; }; // IGv6 chap 6.50 union OptStreamsUnion switch(boolean) { case TRUE: StreamsUnion val; }; enum EventBufferControl { EventBufferControl_off, EventBufferControl_lockStep }; union OptEventBufferControl switch(boolean) { case TRUE: EventBufferControl val; }; enum ServiceState { ServiceState_test, ServiceState_outOfSvc, ServiceState_inSvc }; union OptServiceState switch(boolean) { case TRUE: ServiceState val; }; struct TerminationStateDescriptor { sequence<PropertyParm> propertyParms; OptEventBufferControl eventBufferControl; // OPTIONAL OptServiceState serviceState; // OPTIONAL }; union OptTerminationStateDescriptor switch(boolean) { case TRUE: TerminationStateDescriptor val; }; struct MediaDescriptor { OptTerminationStateDescriptor termStateDescr; // OPTIONAL OptStreamsUnion streams; // OPTIONAL - IGv6 chap 6.50 }; enum ModemType { ModemType_v18, ModemType_v22, ModemType_v22bis, ModemType_v32, ModemType_v32bis, ModemType_v34, ModemType_v90, ModemType_v91, ModemType_synchISDN }; struct ModemDescriptor { sequence<ModemType> mtl; sequence<PropertyParm> mpl; // NonStandardData OPTIONAL }; enum MuxType { MuxType_h221, MuxType_h223, MuxType_h226, MuxType_v76 }; struct MuxDescriptor { MuxType type; TerminationIdList termIdList; // NonStandardData OPTIONAL }; typedef Name DigitMapName; union OptDigitMapName switch(boolean) { case TRUE: DigitMapName val; }; struct DigitMapValue { OptUnsignedShort startTimer; // 0..99 OPTIONAL OptUnsignedShort shortTimer; // 0..99 OPTIONAL OptUnsignedShort longTimer; // 0..99 OPTIONAL string digitMapBody; }; union OptDigitMapValue switch(boolean) { case TRUE: DigitMapValue val; }; enum EventDMChoice { EventDMChoice_digitMapName, EventDMChoice_digitMapValue }; struct DigitMapDescriptor { OptDigitMapName digitMapName; // OPTIONAL OptDigitMapValue digitMapValue; // OPTIONAL }; union EventDMUnion switch(EventDMChoice) { case EventDMChoice_digitMapName: DigitMapName name; case EventDMChoice_digitMapValue: DigitMapValue value; }; union OptEventDMUnion switch(boolean) { case TRUE: EventDMUnion val; }; typedef PkgdName SignalName; enum SignalType { SignalType_brief, SignalType_onOff, SignalType_timeOut }; union OptSignalType switch(boolean) { case TRUE: SignalType val; }; enum NotifyCompletionBits { NotifyCompletionBits_onTimeOut, NotifyCompletionBits_onInterruptByEvent, NotifyCompletionBits_onInterruptByNewSignalDescr, NotifyCompletionBits_otherReason }; typedef sequence<NotifyCompletionBits> NotifyCompletion; // BIT STRING union OptNotifyCompletion switch(boolean) { case TRUE: NotifyCompletion val; }; // IGv6 chap 6.22 union OptValue switch(boolean) { case TRUE: Value val; }; struct SigParameter { Name sigParameterName; Value sigParameterValue; // name clash OptExtraInfoUnion extraInfo; // OPTIONAL - IGv6 chap 6.56 }; struct Signal { SignalName name; // name clash OptStreamID streamID; // OPTIONAL OptSignalType sigType; // OPTIONAL OptUnsignedShort duration; // 0..65535 OPTIONAL OptNotifyCompletion notifyCompletion; // OPTIONAL OptBoolean keepActive; // OPTIONAL sequence<SigParameter> sigParList; }; struct SeqSigList { unsigned short id; // 0..65535 sequence<Signal> signalList; }; enum SignalRequestChoice { SignalRequestChoice_signal, SignalRequestChoice_seqSigList }; union SignalRequestUnion switch(SignalRequestChoice) { case SignalRequestChoice_signal: Signal sig; // name clash case SignalRequestChoice_seqSigList: SeqSigList seqSig; }; typedef sequence<SignalRequestUnion> SignalsDescriptor; union OptSignalsDescriptor switch(boolean) { case TRUE: SignalsDescriptor val; }; struct SecondRequestedActions { OptBoolean keepActive; // OPTIONAL - IGv6 chap 6.15 OptEventDMUnion eventDM; // OPTIONAL OptSignalsDescriptor signalsDescriptor; // OPTIONAL }; union OptSecondRequestedActions switch(boolean) { case TRUE: SecondRequestedActions val; };
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -