83 #define SOCKET uint8_t
87 #define SOCK_FATAL -1000
90 #define SOCKERR_SOCKNUM (SOCK_ERROR - 1)
91 #define SOCKERR_SOCKOPT (SOCK_ERROR - 2)
92 #define SOCKERR_SOCKINIT (SOCK_ERROR - 3)
93 #define SOCKERR_SOCKCLOSED (SOCK_ERROR - 4)
94 #define SOCKERR_SOCKMODE (SOCK_ERROR - 5)
95 #define SOCKERR_SOCKFLAG (SOCK_ERROR - 6)
96 #define SOCKERR_SOCKSTATUS (SOCK_ERROR - 7)
97 #define SOCKERR_ARG (SOCK_ERROR - 10)
98 #define SOCKERR_PORTZERO (SOCK_ERROR - 11)
99 #define SOCKERR_IPINVALID (SOCK_ERROR - 12)
100 #define SOCKERR_TIMEOUT (SOCK_ERROR - 13)
101 #define SOCKERR_DATALEN (SOCK_ERROR - 14)
102 #define SOCKERR_BUFFER (SOCK_ERROR - 15)
104 #define SOCKFATAL_PACKLEN (SOCK_FATAL - 1)
109 #define SF_ETHER_OWN (Sn_MR_MFEN)
110 #define SF_IGMP_VER2 (Sn_MR_MC)
111 #define SF_TCP_NODELAY (Sn_MR_ND)
112 #define SF_MULTI_ENABLE (Sn_MR_MULTI)
114 #if _WIZCHIP_ == 5500
115 #define SF_BROAD_BLOCK (Sn_MR_BCASTB)
116 #define SF_MULTI_BLOCK (Sn_MR_MMB)
117 #define SF_IPv6_BLOCK (Sn_MR_MIP6B)
118 #define SF_UNI_BLOCK (Sn_MR_UCASTB)
121 #define SF_IO_NONBLOCK 0x01
126 #define PACK_FIRST 0x80
127 #define PACK_REMAINED 0x01
128 #define PACK_COMPLETED 0x00
147 int8_t
socket(uint8_t sn, uint8_t protocol, uint16_t port, uint8_t flag);
159 int8_t
close(uint8_t sn);
172 int8_t
listen(uint8_t sn);
195 int8_t
connect(uint8_t sn, uint8_t * addr, uint16_t port);
232 int32_t
send(uint8_t sn, uint8_t * buf, uint16_t len);
254 int32_t
recv(uint8_t sn, uint8_t * buf, uint16_t len);
282 int32_t
sendto(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t port);
312 int32_t
recvfrom(uint8_t sn, uint8_t * buf, uint16_t len, uint8_t * addr, uint16_t *port);
318 #define SOCK_IO_BLOCK 0
319 #define SOCK_IO_NONBLOCK 1
369 #if _WIZCHIP_ != 5100