Description: Code
#ifndef __SS7_CHI_H__
#define __SS7_CHI_H__
#ident "@(#) chi.h,v openss7-0_9_2_G(0.9.2.8) Copyright (c) 2001-2008 OpenSS7 Corporation"
typedef int32_t ch_long;
typedef uint32_t ch_ulong;
typedef uint16_t ch_ushort;
typedef uint8_t ch_uchar;
#define CH_INFO_REQ 1U
#define CH_OPTMGMT_REQ 2U
#define CH_ATTACH_REQ 3U
#define CH_ENABLE_REQ 4U
#define CH_CONNECT_REQ 5U
#define CH_DATA_REQ 6U
#define CH_DISCONNECT_REQ 7U
#define CH_DISABLE_REQ 8U
#define CH_DETACH_REQ 9U
#define CH_INFO_ACK 10U
#define CH_OPTMGMT_ACK 11U
#define CH_OK_ACK 12U
#define CH_ERROR_ACK 13U
#define CH_ENABLE_CON 14U
#define CH_CONNECT_CON 15U
#define CH_DATA_IND 16U
#define CH_DISCONNECT_IND 17U
#define CH_DISCONNECT_CON 18U
#define CH_DISABLE_IND 19U
#define CH_DISABLE_CON 20U
#define CH_EVENT_IND 21U
#define CHS_UNINIT -2U
#define CHS_UNUSABLE -1U
#define CHS_DETACHED 0U
#define CHS_WACK_AREQ 1U
#define CHS_WACK_UREQ 2U
#define CHS_ATTACHED 3U
#define CHS_WACK_EREQ 4U
#define CHS_WCON_EREQ 5U
#define CHS_WACK_RREQ 6U
#define CHS_WCON_RREQ 7U
#define CHS_ENABLED 8U
#define CHS_WACK_CREQ 9U
#define CHS_WCON_CREQ 10U
#define CHS_WACK_DREQ 11U
#define CHS_WCON_DREQ 12U
#define CHS_CONNECTED 13U
#define CHSF_UNINIT (1<<(2+CHS_UNINIT))
#define CHSF_UNUSABLE (1<<(2+CHS_UNUSABLE))
#define CHSF_DETACHED (1<<(2+CHS_DETACHED))
#define CHSF_WACK_AREQ (1<<(2+CHS_WACK_AREQ))
#define CHSF_WACK_UREQ (1<<(2+CHS_WACK_UREQ))
#define CHSF_ATTACHED (1<<(2+CHS_ATTACHED))
#define CHSF_WACK_EREQ (1<<(2+CHS_WACK_EREQ))
#define CHSF_WCON_EREQ (1<<(2+CHS_WCON_EREQ))
#define CHSF_WACK_RREQ (1<<(2+CHS_WACK_RREQ))
#define CHSF_WCON_RREQ (1<<(2+CHS_WCON_RREQ))
#define CHSF_ENABLED (1<<(2+CHS_ENABLED))
#define CHSF_WACK_CREQ (1<<(2+CHS_WACK_CREQ))
#define CHSF_WCON_CREQ (1<<(2+CHS_WCON_CREQ))
#define CHSF_WACK_DREQ (1<<(2+CHS_WACK_DREQ))
#define CHSF_WCON_DREQ (1<<(2+CHS_WCON_DREQ))
#define CHSF_CONNECTED (1<<(2+CHS_CONNECTED))
typedef struct CH_info_req {
ch_ulong ch_primitive;
} CH_info_req_t;
typedef struct CH_info_ack {
ch_ulong ch_primitive;
ch_ulong ch_addr_length;
ch_ulong ch_addr_offset;
ch_ulong ch_parm_length;
ch_ulong ch_parm_offset;
ch_ulong ch_prov_flags;
ch_ulong ch_prov_class;
ch_ulong ch_style;
ch_ulong ch_version;
ch_ulong ch_state;
} CH_info_ack_t;
#define CH_CIRCUIT 0x01
#define CH_STYLE1 0x0
#define CH_STYLE2 0x1
#define CH_VERSION_1_0 0x10
#define CH_VERSION_1_1 0x11
#define CH_VERSION CH_VERSION_1_1
#define CH_PARMS_CIRCUIT 0x01
typedef struct CH_parms_circuit {
ch_ulong cp_type;
ch_ulong cp_encoding;
ch_ulong cp_block_size;
ch_ulong cp_samples;
ch_ulong cp_sample_size;
ch_ulong cp_rate;
ch_ulong cp_tx_channels;
ch_ulong cp_rx_channels;
ch_ulong cp_opt_flags;
} CH_parms_circuit_t;
union CH_parms {
ch_ulong cp_type;
CH_parms_circuit_t circuit;
};
#define CH_PARM_OPT_CLRCH 0x01
#define CH_ENCODING_NONE 0
#define CH_ENCODING_CN 1
#define CH_ENCODING_DVI4 2
#define CH_ENCODING_FS1015 3
#define CH_ENCODING_FS1016 4
#define CH_ENCODING_G711_PCM_A 5
#define CH_ENCODING_G711_PCM_L 6
#define CH_ENCODING_G711_PCM_U 7
#define CH_ENCODING_G721 8
#define CH_ENCODING_G722 9
#define CH_ENCODING_G723 10
#define CH_ENCODING_G726 11
#define CH_ENCODING_G728 12
#define CH_ENCODING_G729 13
#define CH_ENCODING_GSM 14
#define CH_ENCODING_GSM_EFR 15
#define CH_ENCODING_GSM_HR 16
#define CH_ENCODING_LPC 17
#define CH_ENCODING_MPA 18
#define CH_ENCODING_QCELP 19
#define CH_ENCODING_RED 20
#define CH_ENCODING_S16_BE 21
#define CH_ENCODING_S16_LE 22
#define CH_ENCODING_S8 23
#define CH_ENCODING_U16_BE 24
#define CH_ENCODING_U16_LE 25
#define CH_ENCODING_U8 26
#define CH_ENCODING_VDVI 27
#define CH_RATE_VARIABLE 0
#define CH_RATE_8000 8000
#define CH_RATE_11025 11025
#define CH_RATE_16000 16000
#define CH_RATE_22050 22050
#define CH_RATE_44100 44100
#define CH_RATE_90000 90000
#define CH_RATE_184000 184000
#define CH_RATE_192000 192000
#define CH_RATE_240000 240000
#define CH_RATE_248000 248000
#define CH_RATE_768000 768000
#define CH_RATE_992000 992000
#define CH_RATE_3968000 3968000
#define CH_RATE_5376000 5376000
typedef struct CH_optmgmt_req {
ch_ulong ch_primitive;
ch_ulong ch_opt_length;
ch_ulong ch_opt_offset;
ch_ulong ch_mgmt_flags;
} CH_optmgmt_req_t;
typedef struct CH_optmgmt_ack {
ch_ulong ch_primitive;
ch_ulong ch_opt_length;
ch_ulong ch_opt_offset;
ch_ulong ch_mgmt_flags;
} CH_optmgmt_ack_t;
#define CH_SET_OPT 0x01
#define CH_GET_OPT 0x02
#define CH_NEGOTIATE 0x03
#define CH_DEFAULT 0x04
typedef struct CH_attach_req {
ch_ulong ch_primitive;
ch_ulong ch_addr_length;
ch_ulong ch_addr_offset;
ch_ulong ch_flags;
} CH_attach_req_t;
typedef struct CH_detach_req {
ch_ulong ch_primitive;
} CH_detach_req_t;
typedef struct CH_ok_ack {
ch_ulong ch_primitive;
ch_ulong ch_correct_prim;
ch_ulong ch_state;
} CH_ok_ack_t;
typedef struct CH_error_ack {
ch_ulong ch_primitive;
ch_ulong ch_error_primitive;
ch_ulong ch_error_type;
ch_ulong ch_unix_error;
ch_ulong ch_state;
} CH_error_ack_t;
#define CHSYSERR 0
#define CHBADADDR 1
#define CHOUTSTATE 2
#define CHBADOPT 3
#define CHBADPARM 4
#define CHBADPARMTYPE 5
#define CHBADFLAG 6
#define CHBADPRIM 7
#define CHNOTSUPP 8
#define CHBADSLOT 9
typedef struct CH_enable_req {
ch_ulong ch_primitive;
} CH_enable_req_t;
typedef struct CH_enable_con {
ch_ulong ch_primitive;
} CH_enable_con_t;
typedef struct CH_disable_req {
ch_ulong ch_primitive;
} CH_disable_req_t;
typedef struct CH_disable_ind {
ch_ulong ch_primitive;
ch_ulong ch_cause;
} CH_disable_ind_t;
typedef struct CH_disable_con {
ch_ulong ch_primitive;
} CH_disable_con_t;
typedef struct CH_data_req {
ch_ulong ch_primitive;
ch_ulong ch_slot;
} CH_data_req_t;
typedef struct CH_data_ind {
ch_ulong ch_primitive;
ch_ulong ch_slot;
} CH_data_ind_t;
typedef struct CH_connect_req {
ch_ulong ch_primitive;
ch_ulong ch_conn_flags;
ch_ulong ch_slot;
} CH_connect_req_t;
#define CHF_RX_DIR 0x01
#define CHF_TX_DIR 0x02
#define CHF_BOTH_DIR (CHF_RX_DIR|CHF_TX_DIR)
typedef struct CH_connect_con {
ch_ulong ch_primitive;
ch_ulong ch_conn_flags;
ch_ulong ch_slot;
} CH_connect_con_t;
typedef struct CH_disconnect_req {
ch_ulong ch_primitive;
ch_ulong ch_conn_flags;
ch_ulong ch_slot;
} CH_disconnect_req_t;
typedef struct CH_disconnect_ind {
ch_ulong ch_primitive;
ch_ulong ch_conn_flags;
ch_ulong ch_cause;
ch_ulong ch_slot;
} CH_disconnect_ind_t;
typedef struct CH_disconnect_con {
ch_ulong ch_primitive;
ch_ulong ch_conn_flags;
ch_ulong ch_slot;
} CH_disconnect_con_t;
typedef struct CH_event_ind {
ch_ulong ch_primitive;
ch_ulong ch_event;
ch_ulong ch_slot;
} CH_event_ind_t;
#define CH_EVT_DCD_ASSERT 0
#define CH_EVT_DCD_DEASSERT 1
#define CH_EVT_DSR_ASSERT 2
#define CH_EVT_DSR_DEASSERT 3
#define CH_EVT_DTR_ASSERT 4
#define CH_EVT_DTR_DEASSERT 5
#define CH_EVT_RTS_ASSERT 6
#define CH_EVT_RTS_DEASSERT 7
#define CH_EVT_CTS_ASSERT 8
#define CH_EVT_CTS_DEASSERT 9
#define CH_EVT_RI_ASSERT 10
#define CH_EVT_RI_DEASSERT 11
#define CH_EVT_YEL_ALARM 12
#define CH_EVT_BLU_ALARM 13
#define CH_EVT_RED_ALARM 14
#define CH_EVT_NO_ALARM 15
#define CHF_EVT_DCD_ASSERT (1 << 0)
#define CHF_EVT_DCD_DEASSERT (1 << 1)
#define CHF_EVT_DSR_ASSERT (1 << 2)
#define CHF_EVT_DSR_DEASSERT (1 << 3)
#define CHF_EVT_DTR_ASSERT (1 << 4)
#define CHF_EVT_DTR_DEASSERT (1 << 5)
#define CHF_EVT_RTS_ASSERT (1 << 6)
#define CHF_EVT_RTS_DEASSERT (1 << 7)
#define CHF_EVT_CTS_ASSERT (1 << 8)
#define CHF_EVT_CTS_DEASSERT (1 << 9)
#define CHF_EVT_RI_ASSERT (1 << 10)
#define CHF_EVT_RI_DEASSERT (1 << 11)
#define CHF_EVT_YEL_ALARM (1 << 12)
#define CHF_EVT_BLU_ALARM (1 << 13)
#define CHF_EVT_RED_ALARM (1 << 14)
#define CHF_EVT_NO_ALARM (1 << 15)
#define CHF_EVT_DCD_CHANGE (CHF_EVT_DCD_ASSERT|CHF_EVT_DCD_DEASSERT)
#define CHF_EVT_DSR_CHANGE (CHF_EVT_DSR_ASSERT|CHF_EVT_DSR_DEASSERT)
#define CHF_EVT_DTR_CHANGE (CHF_EVT_DTR_ASSERT|CHF_EVT_DTR_DEASSERT)
#define CHF_EVT_RTS_CHANGE (CHF_EVT_RTS_ASSERT|CHF_EVT_RTS_DEASSERT)
#define CHF_EVT_CTS_CHANGE (CHF_EVT_CTS_ASSERT|CHF_EVT_CTS_DEASSERT)
#define CHF_EVT_RI_CHANGE (CHF_EVT_RI_ASSERT|CHF_EVT_RI_DEASSERT)
#endif