⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 megacosession.idl

📁 一个Megaco实现源代码
💻 IDL
📖 第 1 页 / 共 2 页
字号:
// ``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 _MEGACOSESSION_IDL_#define _MEGACOSESSION_IDL_#include <erlang.idl>#include <MegacoMessage.idl>module Megaco {  typedef long        RequestRef;  //////////////////////////////////////////////////  // Error and status codes  //////////////////////////////////////////////////  enum StatusCode {ok, errorString, errorDesc};  union Status switch(StatusCode) {    case errorString: string                         result;      case errorDesc:   MegacoMessage::ErrorDescriptor desc;  };  typedef erlang::pid          SessionRef;  typedef sequence<SessionRef> SessionRefList;  typedef erlang::pid          SessionUserRef;  const long infinity = -1;  typedef sequence<MegacoMessage::ActionRequest>    ActionRequests;  typedef sequence<MegacoMessage::ActionReply>      ActionReplies;  //////////////////////////////////////////////////  // Handles  //////////////////////////////////////////////////  typedef MegacoMessage::MIdUnion          UserMid;  typedef MegacoMessage::TransactionUnion  Transaction;  struct ConnHandle {    UserMid localMid;    UserMid remoteMid;  };  struct ReceiveHandle {    UserMid localMid;    string  encodingMod;    string  encodingConfig;    string  sendMod;  };  //////////////////////////////////////////////////  // Timers  //////////////////////////////////////////////////  struct IncrTimer {    long waitFor;    long factor;    long incr;    long maxRetries; // infinity | positive integer  };  enum TimerType {TimerType_once, TimerType_incr};  union Timer switch(TimerType) {    case TimerType_once: long      once; // infinity | positive integer    case TimerType_incr: IncrTimer incr;  };  //////////////////////////////////////////////////  // System info  //////////////////////////////////////////////////  enum SystemInfoItem {    SystemInfo_connections,    SystemInfo_users,    SystemInfo_NActiveRequests,    SystemInfo_NActiveReplies,    SystemInfo_NActiveConnections  };  union SystemInfoValue switch(SystemInfoItem) {    case SystemInfo_connections:        sequence<ConnHandle> connections;      case SystemInfo_users:              sequence<UserMid>    users;    case SystemInfo_NActiveRequests:    long                 nActiveRequests;    case SystemInfo_NActiveReplies:     long                 nActiveReplies;    case SystemInfo_NActiveConnections: long                 nActiveConnections;  };  //////////////////////////////////////////////////  // User info  //////////////////////////////////////////////////  enum UserInfoItem {    UserInfo_connections,    UserInfo_receiveHandle,    UserInfo_minTransId,    UserInfo_maxTransId,    UserInfo_requestTimer,    UserInfo_longRequestTimer,    UserInfo_autoAck,    UserInfo_replyTimer,    UserInfo_pendingTimer,    UserInfo_sendMod,    UserInfo_encodingMod,    UserInfo_encodingConfig,    UserInfo_protocolVersion,    UserInfo_replyData,    UserInfo_userMod,    UserInfo_userArgs  };  union UserInfoValue switch(UserInfoItem) {    case UserInfo_connections:      sequence<ConnHandle> connections;      case UserInfo_receiveHandle:    ReceiveHandle        rh;    case UserInfo_minTransId:       long                 minTransId;     case UserInfo_maxTransId:       long                 maxTransId;         case UserInfo_requestTimer:     Timer                requestTimer;    case UserInfo_longRequestTimer: Timer                longRequestTimer;    case UserInfo_autoAck:          boolean              autoAck;    case UserInfo_replyTimer:       Timer                replyTimer;    case UserInfo_pendingTimer:     Timer                pendingTimer;    case UserInfo_sendMod:          string               sendMod;    case UserInfo_encodingMod:      string               encodingMod;    case UserInfo_encodingConfig:   string               encodingConfig;    case UserInfo_protocolVersion:  unsigned short       protocolVersion;    case UserInfo_replyData:        string               replyData;    case UserInfo_userMod:          string               userMod;    case UserInfo_userArgs:         string               userArgs;  };  //////////////////////////////////////////////////////////////////  // Connection info  //////////////////////////////////////////////////////////////////  enum ConnInfoItem {    ConnInfo_controlPid,    ConnInfo_sendHandle,    ConnInfo_receiveHandle,    ConnInfo_transId,    ConnInfo_maxTransId,    ConnInfo_requestTimer,    ConnInfo_longRequestTimer,    ConnInfo_autoAck,    ConnInfo_replyTimer,    ConnInfo_pendingTimer,    ConnInfo_sendMod,    ConnInfo_encodingMod,    ConnInfo_encodingConfig,    ConnInfo_protocolVersion,    ConnInfo_replyData  };  union ConnInfoValue switch(ConnInfoItem) {    case ConnInfo_controlPid:           erlang::pid    controlPid;      case ConnInfo_sendHandle:           erlang::binary sendHandle;      case ConnInfo_receiveHandle:        ReceiveHandle  rh;    case ConnInfo_transId:              long           transId;     case ConnInfo_maxTransId:           long           maxTransId;         case ConnInfo_requestTimer:         Timer          requestTimer;    case ConnInfo_longRequestTimer:     Timer          longRequestTimer;    case ConnInfo_autoAck:              boolean        autoAck;    case ConnInfo_replyTimer:           Timer          replyTimer;    case ConnInfo_pendingTimer:         Timer          pendingTimer;    case ConnInfo_sendMod:              string         sendMod;    case ConnInfo_encodingMod:          string         encodingMod;    case ConnInfo_encodingConfig:       string         encodingConfig;    case ConnInfo_protocolVersion:      unsigned short protocolVersion;    case ConnInfo_replyData:            string         replyData;  };  typedef sequence<UserInfoValue> UserInfoValues;  typedef sequence<ConnInfoValue> ConnInfoValues;  //////////////////////////////////////////////////////////////////  // Session  //////////////////////////////////////////////////////////////////#ifdef _CLIENT2SERVER_  interface Session {    // Lookup system information    oneway void systemInfo(in RequestRef       ref,                           in SessionUserRef   replyTo,                           in SystemInfoItem   item);    // Initial configuration of a user    oneway void startUser(in RequestRef       ref,                          in SessionUserRef   replyTo,                          in UserMid          mid,                          in UserInfoValues   config);    // Delete the configuration of a user    oneway void stopUser(in RequestRef       ref,                         in SessionUserRef   replyTo,                         in UserMid          mid);    // Lookup user information    oneway void userInfo(in RequestRef       ref,                         in SessionUserRef   replyTo,                         in UserMid          user,                         in UserInfoItem     item);    // Update information about a user    oneway void updateUserInfo(in RequestRef       ref,                               in SessionUserRef   replyTo,                               in UserMid          user,                               in UserInfoValue    value);    // Lookup information about an active connection    oneway void connInfo(in RequestRef        ref,                         in SessionUserRef    replyTo,

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -