18 #define SOCKSTAT_CLOSED -1
19 #define SOCKSTAT_INIT 0
20 #define SOCKSTAT_LISTEN 1
21 #define SOCKSTAT_SYNSENT 2
22 #define SOCKSTAT_SYNRECV 3
23 #define SOCKSTAT_ESTABLISHED 4
24 #define SOCKSTAT_FIN_WAIT 5
25 #define SOCKSTAT_CLOSING 6
26 #define SOCKSTAT_TIME_WAIT 7
27 #define SOCKSTAT_CLOSE_WAIT 8
28 #define SOCKSTAT_LAST_ACK 9
29 #define SOCKSTAT_UDP 10
31 #define SOCKERR_BUSY -1
32 #define SOCKERR_NOT_TCP -2
33 #define SOCKERR_NOT_UDP -3
34 #define SOCKERR_WRONG_ARG -4
35 #define SOCKERR_WRONG_STATUS -5
36 #define SOCKERR_CLOSED -6
37 #define SOCKERR_CLOSE_WAIT -7
38 #define SOCKERR_FIN_WAIT -8
39 #define SOCKERR_NOT_ESTABLISHED -9
40 #define SOCKERR_WINDOW_FULL -10
41 #define SOCKERR_TIME_OUT -11
42 #define SOCKERR_NULL_SRC_IP -12
43 #define SOCKERR_BUF_NOT_ENOUGH -13
44 #define SOCKERR_NOT_SPECIFIED -14
87 void GetDstInfo(uint8 s, uint8 *dstip, uint16 *dstport);
95 int8
TCPClientOpen(uint8 s, uint16 sport, uint8 *dip, uint16 dport);
96 int8
TCPCltOpenNB(uint8 s, uint16 sport, uint8 *dip, uint16 dport);
102 int32
TCPSend(uint8 s,
const int8 *buf, uint16 len);
103 int8
TCPSendNB(uint8 s,
const int8 *buf, uint16 len);
107 int32
TCPRecv(uint8 s, int8 *buf, uint16 len);
108 int8
UDPOpen(uint8 s, uint16 port);
110 int32
UDPSend(uint8 s,
const int8 *buf, uint16 len, uint8 *addr, uint16 port);
111 int32
UDPSendNB(uint8 s,
const int8 *buf, uint16 len, uint8 *addr, uint16 port);
113 int32
UDPRecv(uint8 s, int8 *buf, uint16 len, uint8 *addr, uint16 *port);