#ifndef _TCP_IF_H_
#define _TCP_IF_H_

#include "tcp_inc.h"
#include "tcp_port.h"
#define TCP_MAX_NUM_OF_SAP		4
#define TCP_MAX_USER_NAME_LEN	16

typedef int (*tcp_recv_callback)(WORD usr_port, BYTE *pdata, WORD datalen, DWORD param1, DWORD param2, DWORD param3);

typedef struct	_tcp_sap_t
{
	BYTE	id;
	char	name[TCP_MAX_USER_NAME_LEN];
	tcp_recv_callback	recv_cb;
}tcp_sap_t;

extern void tcp_init(void);
extern void tcp_timer(void);
extern int tcp_bind(tcp_sap_t *ptr_sap);
extern int tcp_unbind(tcp_sap_t *ptr_sap, BYTE index);
extern tcp_sap_t *tcp_sap_get_by_index(int index);


//rtp_port.c
extern int tcp_port_alloc_port(int sap_id, WORD usr_port, tcp_session_t *pSess);
extern int tcp_port_release_port(int sap_id, WORD usr_port, WORD pid);
extern int tcp_send(int sap_id, WORD usr_port, WORD pid, BYTE *payload, WORD len, DWORD param1, DWORD param2, DWORD param3);
extern tcp_session_t *tcp_port_update_sess(int sap_id, WORD usr_port, WORD pid, tcp_session_t *ptr_sess);

#endif

