#ifndef _M2UA_MSG__H
#define _M2UA_MSG__H

#define COMBO_W(par_class,par_type)		((par_class << 8) + par_type)

int m2ua_sctp_close(int fd, WORD sg_id);
int m2ua_dec_msg(WORD sg_id);
int m2ua_send_msg(WORD sg_id, WORD msg);

int m2ua_sd_mtp3_primi(WORD lk, BYTE primi);
int m2ua_sd_mtp3_msg(WORD sg, WORD lk);

int iua_sd_q931_primi(WORD lk, BYTE primi);
int iua_sd_q931_msg(WORD sg, WORD lk);

int m3ua_sd_mtp3_user_primi(WORD lk, BYTE primi);
int m3ua_sd_mtp3_user_msg(WORD sg);
int m3ua_sd_mtp3_user_rc_cmd(WORD sg, BYTE primi);
int m3ua_sd_mtp3_user_ssnm_cmd(WORD sg, BYTE primi);

int m2ua_sg_init(WORD id);
int m2ua_lk_init(WORD id);


int enable_sg(WORD sg);
int rm_sg_lk(WORD sg, WORD lk);


char *dec_sctp_primi(long sctp_primi);

#ifndef _LKSCTP

int m2ua_sctp_t_open(WORD sg);
int expect(int fd, int sg, int *msg, int want);

int m2ua_sctp_optmgmt_req(int fd, int sg, ulong flags);
int m2ua_sctp_bind_req(int fd, int sg, m2ua_sctp_addr_t *addr, int coninds);
int m2ua_sctp_conn_res(int fd, int fd2, int sg, long seq);
int m2ua_sctp_ordrel_req(int fd, int sg);
int m2ua_sctp_discon_req(int fd, int sg, ulong seq);
int m2ua_sctp_conn_req(int fd, int sg, m2ua_sctp_addr_t *addr);
int m2ua_sctp_optdata_req(int fd, int sg, int len);

#else

int m2ua_sctp_optmgmt_req_lksctp(int fd, int sg);
int m2ua_sctp_optmgmt_req_lksctp_ext(int fd, int sg);
int m2ua_sctp_bind_req_lksctp(int fd, int sg, m2ua_sctp_addr_t *addr, int coninds);
int m2ua_sctp_open_lksctp(WORD sg);
int m2ua_sctp_conn_req_lksctp(int fd, int sg, m2ua_sctp_addr_t *addr);
int m2ua_sctp_get_msg_lksctp(int fd, WORD sg);
int expect_lksctp(int fd, int sg, int *msg, int want);
int m2ua_sctp_discon_req_lksctp(int fd, int sg, int flag);
int m2ua_sctp_put_msg_lksctp(int fd, int sg);
int m2ua_sctp_optdata_req_lksctp(int fd, int sg, int len);

#endif

#endif
