📄 mgi.h
字号:
/***************************************************************************** @(#) mgi.h,v 0.9.2.4 2007/02/13 14:05:28 brian Exp ----------------------------------------------------------------------------- Copyright (c) 2001-2007 OpenSS7 Corporation <http://www.openss7.com/> Copyright (c) 1997-2001 Brian F. G. Bidulock <bidulock@openss7.org> All Rights Reserved. This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. ----------------------------------------------------------------------------- U.S. GOVERNMENT RESTRICTED RIGHTS. If you are licensing this Software on behalf of the U.S. Government ("Government"), the following provisions apply to you. If the Software is supplied by the Department of Defense ("DoD"), it is classified as "Commercial Computer Software" under paragraph 252.227-7014 of the DoD Supplement to the Federal Acquisition Regulations ("DFARS") (or any successor regulations) and the Government is acquiring only the license rights granted herein (the license rights customarily provided to non-Government users). If the Software is supplied to any unit or agency of the Government other than DoD, it is classified as "Restricted Computer Software" and the Government's rights in the Software are defined in paragraph 52.227-19 of the Federal Acquisition Regulations ("FAR") (or any successor regulations) or, in the cases of NASA, in paragraph 18.52.227-86 of the NASA Supplement to the FAR (or any successor regulations). ----------------------------------------------------------------------------- Commercial licensing and support of this software is available from OpenSS7 Corporation at a fee. See http://www.openss7.com/ ----------------------------------------------------------------------------- Last Modified 2007/02/13 14:05:28 by brian ----------------------------------------------------------------------------- mgi.h,v Revision 0.9.2.4 2007/02/13 14:05:28 brian - corrected ulong and long for 32-bit compat *****************************************************************************/#ifndef __SS7_MG_H__#define __SS7_MG_H__#ident "@(#) mgi.h,v openss7-0_9_2_E(0.9.2.4) Copyright (c) 2001-2007 OpenSS7 Corporation."/* This file can be processed by doxygen(1). */#define MG_INFO_REQ 1UL#define MG_OPTMGMT_REQ 2UL#define MG_ATTACH_REQ 3UL#define MG_DETACH_REQ 4UL#define MG_JOIN_REQ 5UL#define MG_ACTION_REQ 6UL#define MG_ABORT_REQ 7UL#define MG_CONN_REQ 8UL#define MG_DATA_REQ 9UL#define MG_DISCON_REQ 10UL#define MG_LEAVE_REQ 11UL#define MG_NOTIFY_REQ 12UL#define MG_INFO_ACK 13UL#define MG_OPTMGMT_ACK 14UL#define MG_OK_ACK 15UL#define MG_ERROR_ACK 16UL#define MG_ATTACH_ACK 17UL#define MG_JOIN_CON 18UL#define MG_ACTION_CON 19UL#define MG_ACTION_IND 20UL#define MG_CONN_CON 21UL#define MG_DATA_IND 22UL#define MG_DISCON_IND 23UL#define MG_DISCON_CON 24UL#define MG_LEAVE_IND 25UL#define MG_LEAVE_CON 26UL#define MG_NOTIFY_IND 27UL/* * MG STATES */#define MGS_UNINIT -2UL#define MGS_UNUSABLE -1UL#define MGS_DETACHED 0UL#define MGS_WACK_AREQ 1UL#define MGS_WCON_AREQ 2UL#define MGS_WACK_UREQ 3UL#define MGS_WCON_UREQ 4UL#define MGS_ATTACHED 5UL#define MGS_WACK_JREQ 6UL#define MGS_WCON_JREQ 7UL#define MGS_WACK_LREQ 8UL#define MGS_WCON_LREQ 9UL#define MGS_JOINED 10UL#define MGS_WACK_CREQ 11UL#define MGS_WCON_CREQ 12UL#define MGS_WACK_DREQ 13UL#define MGS_WCON_DREQ 14UL#define MGS_CONNECTED 15UL#define MGSF_UNINIT 0#define MGSF_UNUSABLE 0#define MGSF_DETACHED (1<<MGS_DETACHED)#define MGSF_WACK_AREQ (1<<MGS_WACK_AREQ)#define MGSF_WCON_AREQ (1<<MGS_WCON_AREQ)#define MGSF_WACK_UREQ (1<<MGS_WACK_UREQ)#define MGSF_WCON_UREQ (1<<MGS_WCON_UREQ)#define MGSF_ATTACHED (1<<MGS_ATTACHED)#define MGSF_WACK_JREQ (1<<MGS_WACK_JREQ)#define MGSF_WCON_JREQ (1<<MGS_WCON_JREQ)#define MGSF_WACK_LREQ (1<<MGS_WACK_LREQ)#define MGSF_WCON_LREQ (1<<MGS_WCON_LREQ)#define MGSF_JOINED (1<<MGS_JOINED)#define MGSF_WACK_CREQ (1<<MGS_WACK_CREQ)#define MGSF_WCON_CREQ (1<<MGS_WCON_CREQ)#define MGSF_WACK_DREQ (1<<MGS_WACK_DREQ)#define MGSF_WCON_DREQ (1<<MGS_WCON_DREQ)#define MGSF_CONNECTED (1<<MGS_CONNECTED)/* * MG PROTOCOL PRIMITIVES *//* * MG_OPTMGMT_REQ * ------------------------------------------------------------------------- */typedef struct MG_optmgmt_req { mg_ulong mg_primitive; /* always MG_INFO_REQ */ mg_ulong mg_opt_length; /* length of options */ mg_ulong mg_opt_offset; /* offset of options */ mg_ulong mg_mgmt_flags; /* management flags */} MG_optmgmt_req_t;/* * MG_OPTMGMT_ACK * ------------------------------------------------------------------------- */typedef struct MG_optmgmt_ack { mg_ulong mg_primitive; /* always MG_INFO_ACK */ mg_ulong mg_opt_length; /* length of options */ mg_ulong mg_opt_offset; /* offset of options */ mg_ulong mg_mgmt_flags; /* management flags */} MG_optmgmt_ack_t;#define MG_SUCCESS 0x00 /* indicates successful operation */#define MG_FAILURE 0x01 /* indicates unsuccessful operation */#define MG_SET_OPT 0x02 /* set options */#define MG_GET_OPT 0x04 /* get options */#define MG_NEGOTIATE 0x08 /* negotiate options */#define MG_DEFAULT 0x10 /* default options */typedef struct MG_channel_opt { mg_ulong mg_obj_type; /* always MG_OBJ_TYPE_CH */ mg_ulong mg_obj_id; /* channel id */ mg_ulong ch_type; /* channel media type */ mg_ulong ch_flags; /* channel media options flags */ mg_ulong ch_block_size; /* data block size (bits) */ mg_ulong ch_encoding; /* encoding */ mg_ulong ch_sample_size; /* sample size (bits) */ mg_ulong ch_rate; /* clock rate (Hz) */ mg_ulong ch_tx_channels; /* number of tx channels */ mg_ulong ch_rx_channels; /* number of rx channels */ mg_ulong ch_opt_flags; /* options flags */} MG_channel_opt_t;typedef struct MG_connleg_opt { mg_ulong mg_obj_type; /* always MG_OBJ_TYPE_LG */ mg_ulong mg_obj_id; /* channel id */ mg_ulong lg_type; /* conn leg media type */ mg_ulong lg_flags; /* conn leg media options flags */ mg_ulong lg_block_size; /* data block size (bits) */ mg_ulong lg_encoding; /* encoding */ mg_ulong lg_sample_size; /* sample size (bits) */ mg_ulong lg_rate; /* clock rate (Hz) */ mg_ulong lg_tx_channels; /* number of tx channels */ mg_ulong lg_rx_channels; /* number of rx channels */ mg_ulong lg_opt_flags; /* options flags */} MG_connleg_opt_t;typedef struct MG_session_opt { mg_ulong mg_obj_type; /* always MG_OBJ_TYPE_SE */ mg_ulong mg_obj_id; /* session id */ mg_ulong se_type; /* session media type */ mg_ulong se_flags; /* session media options flags */ mg_ulong se_block_size; /* data block size (bits) */ mg_ulong se_encoding; /* encoding */ mg_ulong se_sample_size; /* sample size (bits) */ mg_ulong se_rate; /* clock rate (Hz) */ mg_ulong se_tx_channels; /* number of tx channels */ mg_ulong se_rx_channels; /* number of rx channels */ mg_ulong se_opt_flags; /* options flags */} MG_session_opt_t;#define SEF_INTERWORKING 0x01 /* encoding interworking */#define SEF_CONFERENCING 0x02 /* conferencing in effect */#define SEF_CLEARCHANNEL 0x04 /* clear channel enforced */typedef union MG_options { struct { mg_ulong mg_obj_type; /* object type */ mg_ulong mg_obj_id; /* object id */ } obj; struct MG_channel_opt ch; /* channel options */ struct MG_connleg_opt lg; /* conn leg options */ struct MG_session_opt se; /* session options */} MG_options_t;#define MG_SE_OPT_AUTO_GAIN_CONTROL 0x01 /* perform Automatic Gain Control */#define MG_SE_OPT_LIMITING 0x02 /* perform limiting */#define MG_SE_OPT_COMPRESSION 0x04 /* perform compression *//* * MG_INFO_REQ * ------------------------------------------------------------------------- * Requests information about the MG stream including its current channel * configuration. */typedef struct MG_info_req { mg_ulong mg_primitive; /* always MG_INFO_REQ */} MG_info_req_t;/* * MG_INFO_ACK * ------------------------------------------------------------------------- * Provides information about the MG stream and provide including the current * channel configuration. */typedef struct MG_info_ack { mg_ulong mg_primitive; /* always MG_INFO_ACK */ mg_ulong mg_se_id; /* session id */ mg_ulong mg_opt_length; /* channel options length */ mg_ulong mg_opt_offset; /* channel options offset */ mg_ulong mg_prov_flags; /* provider options flags */ mg_ulong mg_style; /* provider style */ mg_ulong mg_version; /* provider version */} MG_info_ack_t;#define MG_STYLE1 0x0 /* does not perform attach */#define MG_STYLE2 0x1 /* does perform attach */#define MG_VERSION_1_0 0x10 /* version 1.0 of interface */#define MG_VERSION MG_VERSION_1_0/* * MG_ATTACH_REQ * ------------------------------------------------------------------------- * Requests that the specified slot on the requesting stream (mg_mx_id == 0) * or specified multiplex (mg_mx_id != 0) be associated with a newly created * channel with specified (mg_ch_id non-zero) or provider assigned (mg_ch_id * zero) channel id. * * This primitive is acknowledged with the MG_ATTACH_ACK. * * If the requesting stream is closed, all channels attached to the * requesting stream will be detached. Only channels that are associated * with the requesting stream need be assigned in this fashion. */typedef struct MG_attach_req { mg_ulong mg_primitive; /* always MG_ATTACH_REQ */ mg_ulong mg_mx_id; /* multiplex id (or 0 for requesting stream) */ mg_ulong mg_mx_slot; /* multiplex slot number */ mg_ulong mg_ch_id; /* channel id (or 0 for provider assignment) */ mg_ulong mg_ch_type; /* type of channel */} MG_attach_req_t;/* * MG_ATTACH_ACK * ------------------------------------------------------------------------- * Acknowledges an MG_ATTACH_REQ. Returns the channel id. */typedef struct MG_attach_ack { mg_ulong mg_primitive; /* always MG_ATTACH_ACK */ mg_ulong mg_mx_id; /* multiplex id (or 0 for requesting stream) */ mg_ulong mg_mx_slot; /* multiplex slot number */ mg_ulong mg_ch_id; /* channel id assignment */} MG_attach_ack_t;/* * MG_DETACH_REQ * ------------------------------------------------------------------------- * Requests that the specified requesting stream channel be detached. This * primitive is acknowledged with the MG_OK_ACK. */typedef struct MG_detach_req { mg_ulong mg_primitive; /* always MG_DETACH_REQ */ mg_ulong mg_ch_id; /* channel id */} MG_detach_req_t;/* * MG_JOIN_REQ * ------------------------------------------------------------------------- * Requests that the specified channels be joined to the specified session * with newly created termination point with id specified by the caller * (mg_tp_id non-zero) or assigned by the provider (mg_tp_id zero). If the * specified session id is zero then a new session will be created. If the * specified session id exists, the existing session will be joined. If the * specified session id is non-zero but does not exist, one will be created * wtih the specified id. All channels must be successfully enabled before * this primitive will be confirmed. This primtive is confirmed with the * MG_JOIN_CON primitive. It is refused with the MG_ERROR_ACK or * MG_LEAVE_IND primitive. */typedef struct MG_join_req { mg_ulong mg_primitive; /* always MG_JOIN_REQ */ mg_ulong mg_se_id; /* session to join (0 to create) */ mg_ulong mg_tp_id; /* joined termination (0 for new) */ mg_ulong mg_channel_length; /* channel ids that make up termination */ mg_ulong mg_channel_offset; /* channel ids that make up termination */} MG_join_req_t;/* * MG_JOIN_CON * ------------------------------------------------------------------------- * Confirms that the previous join request was successful and the session id * and termination point id of the join. */typedef struct MG_join_con { mg_ulong mg_primitive; /* always MG_JOIN_CON */ mg_ulong mg_se_id; /* joined session */ mg_ulong mg_tp_id; /* joined termination */} MG_join_con_t;/* * MG_ACTION_REQ, M_PROTO w/ 0 or more M_DATA * ------------------------------------------------------------------------- * Requests that the action of the requested type be performed against the * specified session and termination point for the requested duration and
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -