#ifndef _M2UA_DEF__H
#define _M2UA_DEF__H

#include "m2ua_pub.h"
#include "m2ua.h"
#include "m2ua_const.h"
#include "m2ua_struct.h"

//const BYTE 			m2ua_ver[3] = {10, 0, 6};
BYTE				m2ua_command = 0;

m2ua_sg_info_t 		m2ua_sg_info[M2UA_MAX_SG_FSM_NUM];//for listen m2ua*2,iua*2 
m2ua_lk_info_t		m2ua_lk_info[M2UA_MAX_LK_NUM];

m2ua_sctp_addr_t 	m2ua_sctp_addr;

m2ua_sctp_cmd_t 	m2ua_sctp_cmd;
BYTE				m2ua_sctp_dat[M2UA_SCTP_DAT_BUFSIZE];
int					m2ua_sctp_cmd_len;
int					m2ua_sctp_dat_len;

#ifndef _LKSCTP
struct strbuf 		m2ua_sctp_ctrl = {M2UA_SCTP_CMD_BUFSIZE, 0, m2ua_sctp_cmd.cbuf};
struct strbuf 		m2ua_sctp_data = {M2UA_SCTP_DAT_BUFSIZE, 0, m2ua_sctp_dat};
#else
m2ua_sctp_data_t	m2ua_sctp_data = {M2UA_SCTP_DAT_BUFSIZE, 0, m2ua_sctp_dat};
#endif

m2ua_para_t			m2ua_para;

BYTE				m2ua_mtp3_sd[M2UA_MAX_MSG_LEN * M2UA_MAX_M3MSG_NUM];
WORD				m2ua_mtp3_sd_h;
WORD				m2ua_mtp3_sd_t;

//add by yizane
BYTE				iua_q931_sd[M2UA_MAX_MSG_LEN * M2UA_MAX_M3MSG_NUM];
WORD				iua_q931_sd_h;
WORD				iua_q931_sd_t;
//add by yizane

DWORD				x256[M2UA_MAX_M3MSG_NUM];

char				hostip[20];
char				hostname[50];
DWORD				host_ip;
BYTE				plat_id;

m2ua_sctp_addr_t	m2ua_sctp_server_addr;
m2ua_csta_t			m2ua_csta;

BYTE				m2ua_asciin_buf[MAX_ASCIIIN_LEN];
BYTE				m2ua_asciout_buf[MAX_ASCIIOUT_LEN];
BYTE				m2ua_ascitemp_buf[MAX_ASCITMP_LEN];
WORD				moniter_fg;

BYTE				m2ua_sg_mon_fg[M2UA_MAX_SG_FSM_NUM];
BYTE				m2ua_lk_mon_fg[M2UA_MAX_LK_NUM];
WORD				m2ua_sg_mon_count;
WORD				m2ua_lk_mon_count;

DWORD				err[64];
BYTE				init_flag;

#endif
