17 #define WINDOWFULL_MAX_RETRY_NUM 3
18 #define WINDOWFULL_WAIT_TIME 1000
21 #define SOCKSTAT_CLOSED -1
22 #define SOCKSTAT_INIT 0
23 #define SOCKSTAT_LISTEN 1
24 #define SOCKSTAT_SYNSENT 2
25 #define SOCKSTAT_SYNRECV 3
26 #define SOCKSTAT_ESTABLISHED 4
27 #define SOCKSTAT_FIN_WAIT 5
28 #define SOCKSTAT_CLOSING 6
29 #define SOCKSTAT_TIME_WAIT 7
30 #define SOCKSTAT_CLOSE_WAIT 8
31 #define SOCKSTAT_LAST_ACK 9
32 #define SOCKSTAT_UDP 10
34 #define SOCKERR_BUSY -1
35 #define SOCKERR_NOT_TCP -2
36 #define SOCKERR_NOT_UDP -3
37 #define SOCKERR_WRONG_ARG -4
38 #define SOCKERR_WRONG_STATUS -5
39 #define SOCKERR_CLOSED -6
40 #define SOCKERR_CLOSE_WAIT -7
41 #define SOCKERR_FIN_WAIT -8
42 #define SOCKERR_NOT_ESTABLISHED -9
43 #define SOCKERR_WINDOW_FULL -10
44 #define SOCKERR_TIME_OUT -11
45 #define SOCKERR_NULL_SRC_IP -12
46 #define SOCKERR_BUF_NOT_ENOUGH -13
47 #define SOCKERR_NOT_SPECIFIED -14
52 int8_t
TCPClientOpen(uint8_t s, uint16_t sport, uint8_t *dip, uint16_t dport);
53 int8_t
TCPCltOpenNB(uint8_t s, uint16_t sport, uint8_t *dip, uint16_t dport);
60 int32_t
TCPSend(uint8_t s,
const int8_t *buf, uint16_t len);
61 int8_t
TCPSendNB(uint8_t s,
const int8_t *buf, uint16_t len);
65 int32_t
TCPRecv(uint8_t s, int8_t *buf, uint16_t len);
66 int8_t
UDPOpen(uint8_t s, uint16_t port);
68 int32_t
UDPSend(uint8_t s,
const int8_t *buf, uint16_t len, uint8_t *addr, uint16_t port);
69 int32_t
UDPSendNB(uint8_t s,
const int8_t *buf, uint16_t len, uint8_t *addr, uint16_t port);
71 int32_t
UDPRecv(uint8_t s, int8_t *buf, uint16_t len, uint8_t *addr, uint16_t *port);