86 #define SOCKET uint8_t
90 #define SOCK_FATAL -1000
93 #define SOCKERR_SOCKNUM (SOCK_ERROR - 1)
94 #define SOCKERR_SOCKOPT (SOCK_ERROR - 2)
95 #define SOCKERR_SOCKINIT (SOCK_ERROR - 3)
96 #define SOCKERR_SOCKCLOSED (SOCK_ERROR - 4)
97 #define SOCKERR_SOCKMODE (SOCK_ERROR - 5)
98 #define SOCKERR_SOCKFLAG (SOCK_ERROR - 6)
99 #define SOCKERR_SOCKSTATUS (SOCK_ERROR - 7)
100 #define SOCKERR_ARG (SOCK_ERROR - 10)
101 #define SOCKERR_PORTZERO (SOCK_ERROR - 11)
102 #define SOCKERR_IPINVALID (SOCK_ERROR - 12)
103 #define SOCKERR_TIMEOUT (SOCK_ERROR - 13)
104 #define SOCKERR_DATALEN (SOCK_ERROR - 14)
105 #define SOCKERR_BUFFER (SOCK_ERROR - 15)
107 #define SOCKFATAL_PACKLEN (SOCK_FATAL - 1)
112 #define SF_ETHER_OWN (Sn_MR_MFEN)
113 #define SF_IGMP_VER2 (Sn_MR_MC)
114 #define SF_TCP_NODELAY (Sn_MR_ND)
115 #define SF_MULTI_ENABLE (Sn_MR_MULTI)
117 #if _WIZCHIP_ == 5500
118 #define SF_BROAD_BLOCK (Sn_MR_BCASTB)
119 #define SF_MULTI_BLOCK (Sn_MR_MMB)
120 #define SF_IPv6_BLOCK (Sn_MR_MIP6B)
121 #define SF_UNI_BLOCK (Sn_MR_UCASTB)
124 #define SF_IO_NONBLOCK 0x01
129 #define PACK_FIRST 0x80
130 #define PACK_REMAINED 0x01
131 #define PACK_COMPLETED 0x00
150 int8_t
socket(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag);
162 int8_t
close(uint8_t sn);
175 int8_t
listen(uint8_t sn);
198 int8_t
connect(uint8_t sn, uint8_t * addr, uint16_t port);
235 int32_t
send(uint8_t sn, uint8_t * buf, uint16_t len);
257 int32_t
recv(uint8_t sn, uint8_t * buf, uint16_t len);
285 int32_t
sendto(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port);
315 int32_t
recvfrom(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port);
321 #define SOCK_IO_BLOCK 0
322 #define SOCK_IO_NONBLOCK 1
372 #if _WIZCHIP_ != 5100