40 #include "simplelink.h"
42 #ifndef __SL_SOCKET_H__
43 #define __SL_SOCKET_H__
63 #define SL_FD_SETSIZE SL_MAX_SOCKETS
64 #define BSD_SOCKET_ID_MASK (0x0F)
66 #define SL_SOCK_STREAM (1)
67 #define SL_SOCK_DGRAM (2)
68 #define SL_SOCK_RAW (3)
69 #define SL_IPPROTO_TCP (6)
70 #define SL_IPPROTO_UDP (17)
71 #define SL_IPPROTO_RAW (255)
72 #define SL_SEC_SOCKET (100)
75 #define SL_AF_INET (2)
76 #define SL_AF_INET6 (3)
77 #define SL_AF_INET6_EUI_48 (9)
79 #define SL_AF_PACKET (17)
81 #define SL_PF_INET AF_INET
82 #define SL_PF_INET6 AF_INET6
83 #define SL_INADDR_ANY (0)
86 #define SL_SOC_ERROR (-1)
87 #define SL_SOC_OK ( 0)
90 #define SL_ENSOCK (-10)
91 #define SL_EAGAIN (-11)
92 #define SL_EWOULDBLOCK SL_EAGAIN
93 #define SL_ENOMEM (-12)
94 #define SL_EACCES (-13)
95 #define SL_EFAULT (-14)
96 #define SL_ECLOSE (-15)
97 #define SL_EALREADY_ENABLED (-21)
98 #define SL_EINVAL (-22)
99 #define SL_EAUTO_CONNECT_OR_CONNECTING (-69)
100 #define SL_CONNECTION_PENDING (-72)
101 #define SL_EUNSUPPORTED_ROLE (-86)
102 #define SL_EDESTADDRREQ (-89)
103 #define SL_EPROTOTYPE (-91)
104 #define SL_ENOPROTOOPT (-92)
105 #define SL_EPROTONOSUPPORT (-93)
106 #define SL_ESOCKTNOSUPPORT (-94)
107 #define SL_EOPNOTSUPP (-95)
108 #define SL_EAFNOSUPPORT (-97)
109 #define SL_EADDRINUSE (-98)
110 #define SL_EADDRNOTAVAIL (-99)
111 #define SL_ENETUNREACH (-101)
112 #define SL_ENOBUFS (-105)
113 #define SL_EOBUFF SL_ENOBUFS
114 #define SL_EISCONN (-106)
115 #define SL_ENOTCONN (-107)
116 #define SL_ETIMEDOUT (-110)
117 #define SL_ECONNREFUSED (-111)
118 #define SL_EALREADY (-114)
120 #define SL_ESEC_RSA_WRONG_TYPE_E (-130)
121 #define SL_ESEC_RSA_BUFFER_E (-131)
122 #define SL_ESEC_BUFFER_E (-132)
123 #define SL_ESEC_ALGO_ID_E (-133)
124 #define SL_ESEC_PUBLIC_KEY_E (-134)
125 #define SL_ESEC_DATE_E (-135)
126 #define SL_ESEC_SUBJECT_E (-136)
127 #define SL_ESEC_ISSUER_E (-137)
128 #define SL_ESEC_CA_TRUE_E (-138)
129 #define SL_ESEC_EXTENSIONS_E (-139)
130 #define SL_ESEC_ASN_PARSE_E (-140)
131 #define SL_ESEC_ASN_VERSION_E (-141)
132 #define SL_ESEC_ASN_GETINT_E (-142)
133 #define SL_ESEC_ASN_RSA_KEY_E (-143)
134 #define SL_ESEC_ASN_OBJECT_ID_E (-144)
135 #define SL_ESEC_ASN_TAG_NULL_E (-145)
136 #define SL_ESEC_ASN_EXPECT_0_E (-146)
137 #define SL_ESEC_ASN_BITSTR_E (-147)
138 #define SL_ESEC_ASN_UNKNOWN_OID_E (-148)
139 #define SL_ESEC_ASN_DATE_SZ_E (-149)
140 #define SL_ESEC_ASN_BEFORE_DATE_E (-150)
141 #define SL_ESEC_ASN_AFTER_DATE_E (-151)
142 #define SL_ESEC_ASN_SIG_OID_E (-152)
143 #define SL_ESEC_ASN_TIME_E (-153)
144 #define SL_ESEC_ASN_INPUT_E (-154)
145 #define SL_ESEC_ASN_SIG_CONFIRM_E (-155)
146 #define SL_ESEC_ASN_SIG_HASH_E (-156)
147 #define SL_ESEC_ASN_SIG_KEY_E (-157)
148 #define SL_ESEC_ASN_DH_KEY_E (-158)
149 #define SL_ESEC_ASN_NTRU_KEY_E (-159)
150 #define SL_ESEC_ECC_BAD_ARG_E (-170)
151 #define SL_ESEC_ASN_ECC_KEY_E (-171)
152 #define SL_ESEC_ECC_CURVE_OID_E (-172)
153 #define SL_ESEC_BAD_FUNC_ARG (-173)
154 #define SL_ESEC_NOT_COMPILED_IN (-174)
155 #define SL_ESEC_UNICODE_SIZE_E (-175)
156 #define SL_ESEC_NO_PASSWORD (-176)
157 #define SL_ESEC_ALT_NAME_E (-177)
158 #define SL_ESEC_AES_GCM_AUTH_E (-180)
159 #define SL_ESEC_AES_CCM_AUTH_E (-181)
160 #define SL_SOCKET_ERROR_E (-208)
162 #define SL_ESEC_MEMORY_ERROR (-203)
163 #define SL_ESEC_VERIFY_FINISHED_ERROR (-204)
164 #define SL_ESEC_VERIFY_MAC_ERROR (-205)
165 #define SL_ESEC_UNKNOWN_HANDSHAKE_TYPE (-207)
166 #define SL_ESEC_SOCKET_ERROR_E (-208)
167 #define SL_ESEC_SOCKET_NODATA (-209)
168 #define SL_ESEC_INCOMPLETE_DATA (-210)
169 #define SL_ESEC_UNKNOWN_RECORD_TYPE (-211)
170 #define SL_ESEC_FATAL_ERROR (-213)
171 #define SL_ESEC_ENCRYPT_ERROR (-214)
172 #define SL_ESEC_NO_PEER_KEY (-216)
173 #define SL_ESEC_NO_PRIVATE_KEY (-217)
174 #define SL_ESEC_RSA_PRIVATE_ERROR (-218)
175 #define SL_ESEC_NO_DH_PARAMS (-219)
176 #define SL_ESEC_BUILD_MSG_ERROR (-220)
177 #define SL_ESEC_BAD_HELLO (-221)
178 #define SL_ESEC_DOMAIN_NAME_MISMATCH (-222)
179 #define SL_ESEC_WANT_READ (-223)
180 #define SL_ESEC_NOT_READY_ERROR (-224)
181 #define SL_ESEC_PMS_VERSION_ERROR (-225)
182 #define SL_ESEC_VERSION_ERROR (-226)
183 #define SL_ESEC_WANT_WRITE (-227)
184 #define SL_ESEC_BUFFER_ERROR (-228)
185 #define SL_ESEC_VERIFY_CERT_ERROR (-229)
186 #define SL_ESEC_VERIFY_SIGN_ERROR (-230)
188 #define SL_ESEC_LENGTH_ERROR (-241)
189 #define SL_ESEC_PEER_KEY_ERROR (-242)
190 #define SL_ESEC_ZERO_RETURN (-243)
191 #define SL_ESEC_SIDE_ERROR (-244)
192 #define SL_ESEC_NO_PEER_CERT (-245)
193 #define SL_ESEC_ECC_CURVETYPE_ERROR (-250)
194 #define SL_ESEC_ECC_CURVE_ERROR (-251)
195 #define SL_ESEC_ECC_PEERKEY_ERROR (-252)
196 #define SL_ESEC_ECC_MAKEKEY_ERROR (-253)
197 #define SL_ESEC_ECC_EXPORT_ERROR (-254)
198 #define SL_ESEC_ECC_SHARED_ERROR (-255)
199 #define SL_ESEC_NOT_CA_ERROR (-257)
200 #define SL_ESEC_BAD_PATH_ERROR (-258)
201 #define SL_ESEC_BAD_CERT_MANAGER_ERROR (-259)
202 #define SL_ESEC_MAX_CHAIN_ERROR (-268)
203 #define SL_ESEC_SUITES_ERROR (-271)
204 #define SL_ESEC_SSL_NO_PEM_HEADER (-272)
205 #define SL_ESEC_OUT_OF_ORDER_E (-273)
206 #define SL_ESEC_SANITY_CIPHER_E (-275)
207 #define SL_ESEC_GEN_COOKIE_E (-277)
208 #define SL_ESEC_NO_PEER_VERIFY (-278)
209 #define SL_ESEC_UNKNOWN_SNI_HOST_NAME_E (-281)
211 #define SL_ESEC_UNSUPPORTED_SUITE (-290)
212 #define SL_ESEC_MATCH_SUITE_ERROR (-291 )
215 #define SL_ESEC_CLOSE_NOTIFY (-300)
216 #define SL_ESEC_UNEXPECTED_MESSAGE (-310)
217 #define SL_ESEC_BAD_RECORD_MAC (-320)
218 #define SL_ESEC_DECRYPTION_FAILED (-321)
219 #define SL_ESEC_RECORD_OVERFLOW (-322)
220 #define SL_ESEC_DECOMPRESSION_FAILURE (-330)
221 #define SL_ESEC_HANDSHAKE_FAILURE (-340)
222 #define SL_ESEC_NO_CERTIFICATE (-341)
223 #define SL_ESEC_BAD_CERTIFICATE (-342)
224 #define SL_ESEC_UNSUPPORTED_CERTIFICATE (-343)
225 #define SL_ESEC_CERTIFICATE_REVOKED (-344)
226 #define SL_ESEC_CERTIFICATE_EXPIRED (-345)
227 #define SL_ESEC_CERTIFICATE_UNKNOWN (-346)
228 #define SL_ESEC_ILLEGAL_PARAMETER (-347)
229 #define SL_ESEC_UNKNOWN_CA (-348)
230 #define SL_ESEC_ACCESS_DENIED (-349)
231 #define SL_ESEC_DECODE_ERROR (-350)
232 #define SL_ESEC_DECRYPT_ERROR (-351)
233 #define SL_ESEC_EXPORT_RESTRICTION (-360)
234 #define SL_ESEC_PROTOCOL_VERSION (-370)
235 #define SL_ESEC_INSUFFICIENT_SECURITY (-371)
236 #define SL_ESEC_INTERNAL_ERROR (-380)
237 #define SL_ESEC_USER_CANCELLED (-390)
238 #define SL_ESEC_NO_RENEGOTIATION (-400)
239 #define SL_ESEC_UNSUPPORTED_EXTENSION (-410)
240 #define SL_ESEC_CERTIFICATE_UNOBTAINABLE (-411)
241 #define SL_ESEC_UNRECOGNIZED_NAME (-412)
242 #define SL_ESEC_BAD_CERTIFICATE_STATUS_RESPONSE (-413)
243 #define SL_ESEC_BAD_CERTIFICATE_HASH_VALUE (-414)
245 #define SL_ESECGENERAL (-450)
246 #define SL_ESECDECRYPT (-451)
247 #define SL_ESECCLOSED (-452)
248 #define SL_ESECSNOVERIFY (-453)
249 #define SL_ESECNOCAFILE (-454)
250 #define SL_ESECMEMORY (-455)
251 #define SL_ESECBADCAFILE (-456)
252 #define SL_ESECBADCERTFILE (-457)
253 #define SL_ESECBADPRIVATEFILE (-458)
254 #define SL_ESECBADDHFILE (-459)
255 #define SL_ESECT00MANYSSLOPENED (-460)
256 #define SL_ESECDATEERROR (-461)
257 #define SL_ESECHANDSHAKETIMEDOUT (-462)
262 #define SL_SOCKET_PAYLOAD_TYPE_MASK (0xF0)
263 #define SL_SOCKET_PAYLOAD_TYPE_UDP_IPV4 (0x00)
264 #define SL_SOCKET_PAYLOAD_TYPE_TCP_IPV4 (0x10)
265 #define SL_SOCKET_PAYLOAD_TYPE_UDP_IPV6 (0x20)
266 #define SL_SOCKET_PAYLOAD_TYPE_TCP_IPV6 (0x30)
267 #define SL_SOCKET_PAYLOAD_TYPE_UDP_IPV4_SECURE (0x40)
268 #define SL_SOCKET_PAYLOAD_TYPE_TCP_IPV4_SECURE (0x50)
269 #define SL_SOCKET_PAYLOAD_TYPE_UDP_IPV6_SECURE (0x60)
270 #define SL_SOCKET_PAYLOAD_TYPE_TCP_IPV6_SECURE (0x70)
271 #define SL_SOCKET_PAYLOAD_TYPE_RAW_TRANCEIVER (0x80)
272 #define SL_SOCKET_PAYLOAD_TYPE_RAW_PACKET (0x90)
273 #define SL_SOCKET_PAYLOAD_TYPE_RAW_IP4 (0xa0)
274 #define SL_SOCKET_PAYLOAD_TYPE_RAW_IP6 (SL_SOCKET_PAYLOAD_TYPE_RAW_IP4 )
278 #define SL_SOL_SOCKET (1)
279 #define SL_IPPROTO_IP (2)
280 #define SL_SOL_PHY_OPT (3)
282 #define SL_SO_RCVBUF (8)
283 #define SL_SO_KEEPALIVE (9)
284 #define SL_SO_RCVTIMEO (20)
285 #define SL_SO_NONBLOCKING (24)
286 #define SL_SO_SECMETHOD (25)
287 #define SL_SO_SECURE_MASK (26)
288 #define SL_SO_SECURE_FILES (27)
289 #define SL_SO_CHANGE_CHANNEL (28)
290 #define SL_SO_SECURE_FILES_PRIVATE_KEY_FILE_NAME (30)
291 #define SL_SO_SECURE_FILES_CERTIFICATE_FILE_NAME (31)
292 #define SL_SO_SECURE_FILES_CA_FILE_NAME (32)
293 #define SL_SO_SECURE_FILES_DH_KEY_FILE_NAME (33)
294 #define SO_SECURE_DOMAIN_NAME_VERIFICATION (35)
295 #define SECURE_MAX_DOMAIN_LENGTH (64)
297 #define SL_IP_MULTICAST_IF (60)
298 #define SL_IP_MULTICAST_TTL (61)
299 #define SL_IP_ADD_MEMBERSHIP (65)
300 #define SL_IP_DROP_MEMBERSHIP (66)
301 #define SL_IP_HDRINCL (67)
302 #define SL_IP_RAW_RX_NO_HEADER (68)
303 #define SL_IP_RAW_IPV6_HDRINCL (69)
305 #define SL_SO_PHY_RATE (100)
306 #define SL_SO_PHY_TX_POWER (101)
307 #define SL_SO_PHY_NUM_FRAMES_TO_TX (102)
308 #define SL_SO_PHY_PREAMBLE (103)
310 #define SL_SO_SEC_METHOD_SSLV3 (0)
311 #define SL_SO_SEC_METHOD_TLSV1 (1)
312 #define SL_SO_SEC_METHOD_TLSV1_1 (2)
313 #define SL_SO_SEC_METHOD_TLSV1_2 (3)
314 #define SL_SO_SEC_METHOD_SSLv3_TLSV1_2 (4)
315 #define SL_SO_SEC_METHOD_DLSV1 (5)
317 #define SL_SEC_MASK_SSL_RSA_WITH_RC4_128_SHA (1 << 0)
318 #define SL_SEC_MASK_SSL_RSA_WITH_RC4_128_MD5 (1 << 1)
319 #define SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA (1 << 2)
320 #define SL_SEC_MASK_TLS_DHE_RSA_WITH_AES_256_CBC_SHA (1 << 3)
321 #define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (1 << 4)
322 #define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_RC4_128_SHA (1 << 5)
323 #define SL_SEC_MASK_TLS_RSA_WITH_AES_128_CBC_SHA256 (1 << 6)
324 #define SL_SEC_MASK_TLS_RSA_WITH_AES_256_CBC_SHA256 (1 << 7)
325 #define SL_SEC_MASK_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (1 << 8)
326 #define SL_SEC_MASK_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (1 << 9)
329 #define SL_SEC_MASK_SECURE_DEFAULT ((SL_SEC_MASK_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 << 1) - 1)
331 #define SL_MSG_DONTWAIT (0x00000008)
334 #define SL_IP_LEASE_PEER_RELEASE (0)
335 #define SL_IP_LEASE_PEER_DECLINE (1)
336 #define SL_IP_LEASE_EXPIRED (2)
339 #define SSL_ACCEPT (0)
340 #define RX_FRAGMENTATION_TOO_BIG (1)
341 #define OTHER_SIDE_CLOSE_SSL_DATA_NOT_ENCRYPTED (2)
345 #ifdef SL_INC_STD_BSD_API_NAMING
347 #define FD_SETSIZE SL_FD_SETSIZE
349 #define SOCK_STREAM SL_SOCK_STREAM
350 #define SOCK_DGRAM SL_SOCK_DGRAM
351 #define SOCK_RAW SL_SOCK_RAW
352 #define IPPROTO_TCP SL_IPPROTO_TCP
353 #define IPPROTO_UDP SL_IPPROTO_UDP
354 #define IPPROTO_RAW SL_IPPROTO_RAW
356 #define AF_INET SL_AF_INET
357 #define AF_INET6 SL_AF_INET6
358 #define AF_INET6_EUI_48 SL_AF_INET6_EUI_48
359 #define AF_RF SL_AF_RF
360 #define AF_PACKET SL_AF_PACKET
362 #define PF_INET SL_PF_INET
363 #define PF_INET6 SL_PF_INET6
365 #define INADDR_ANY SL_INADDR_ANY
366 #define ERROR SL_SOC_ERROR
367 #define INEXE SL_INEXE
368 #define EBADF SL_EBADF
369 #define ENSOCK SL_ENSOCK
370 #define EAGAIN SL_EAGAIN
371 #define EWOULDBLOCK SL_EWOULDBLOCK
372 #define ENOMEM SL_ENOMEM
373 #define EACCES SL_EACCES
374 #define EFAULT SL_EFAULT
375 #define EINVAL SL_EINVAL
376 #define EDESTADDRREQ SL_EDESTADDRREQ
377 #define EPROTOTYPE SL_EPROTOTYPE
378 #define ENOPROTOOPT SL_ENOPROTOOPT
379 #define EPROTONOSUPPORT SL_EPROTONOSUPPORT
380 #define ESOCKTNOSUPPORT SL_ESOCKTNOSUPPORT
381 #define EOPNOTSUPP SL_EOPNOTSUPP
382 #define EAFNOSUPPORT SL_EAFNOSUPPORT
383 #define EADDRINUSE SL_EADDRINUSE
384 #define EADDRNOTAVAIL SL_EADDRNOTAVAIL
385 #define ENETUNREACH SL_ENETUNREACH
386 #define ENOBUFS SL_ENOBUFS
387 #define EOBUFF SL_EOBUFF
388 #define EISCONN SL_EISCONN
389 #define ENOTCONN SL_ENOTCONN
390 #define ETIMEDOUT SL_ETIMEDOUT
391 #define ECONNREFUSED SL_ECONNREFUSED
393 #define SOL_SOCKET SL_SOL_SOCKET
394 #define IPPROTO_IP SL_IPPROTO_IP
395 #define SO_KEEPALIVE SL_SO_KEEPALIVE
397 #define SO_RCVTIMEO SL_SO_RCVTIMEO
398 #define SO_NONBLOCKING SL_SO_NONBLOCKING
400 #define IP_MULTICAST_IF SL_IP_MULTICAST_IF
401 #define IP_MULTICAST_TTL SL_IP_MULTICAST_TTL
402 #define IP_ADD_MEMBERSHIP SL_IP_ADD_MEMBERSHIP
403 #define IP_DROP_MEMBERSHIP SL_IP_DROP_MEMBERSHIP
405 #define socklen_t SlSocklen_t
406 #define timeval SlTimeval_t
407 #define sockaddr SlSockAddr_t
408 #define in6_addr SlIn6Addr_t
409 #define sockaddr_in6 SlSockAddrIn6_t
410 #define in_addr SlInAddr_t
411 #define sockaddr_in SlSockAddrIn_t
413 #define MSG_DONTWAIT SL_MSG_DONTWAIT
415 #define FD_SET SL_FD_SET
416 #define FD_CLR SL_FD_CLR
417 #define FD_ISSET SL_FD_ISSET
418 #define FD_ZERO SL_FD_ZERO
419 #define fd_set SlFdSet_t
421 #define socket sl_Socket
422 #define close sl_Close
423 #define accept sl_Accept
425 #define listen sl_Listen
426 #define connect sl_Connect
427 #define select sl_Select
428 #define setsockopt sl_SetSockOpt
429 #define getsockopt sl_GetSockOpt
431 #define recvfrom sl_RecvFrom
432 #define write sl_Write
434 #define sendto sl_SendTo
435 #define gethostbyname sl_NetAppDnsGetHostByName
436 #define htonl sl_Htonl
437 #define ntohl sl_Ntohl
438 #define htons sl_Htons
439 #define ntohs sl_Ntohs
453 struct { _u8 s_b1,s_b2,s_b3,s_b4; } S_un_b;
454 struct { _u8 s_w1,s_w2; } S_un_w;
464 _u32 KeepaliveEnabled;
469 _u32 ReuseaddrEnabled;
479 _u32 NonblockingEnabled;
529 SL_BSD_SECURED_PRIVATE_KEY_IDX = 0,
530 SL_BSD_SECURED_CERTIFICATE_IDX,
531 SL_BSD_SECURED_CA_IDX,
532 SL_BSD_SECURED_DH_IDX
533 }slBsd_secureSocketFilesIndex_e;
543 typedef _u32 SlTime_t;
544 typedef _u32 SlSuseconds_t;
549 SlSuseconds_t tv_usec;
552 typedef _u16 SlSocklen_t;
646 _u32 fd_array[(SL_FD_SETSIZE + (_u8)31)/(_u8)32];
715 #if _SL_INCLUDE_FUNC(sl_Socket)
716 _i16
sl_Socket(_i16 Domain, _i16 Type, _i16 Protocol);
734 #if _SL_INCLUDE_FUNC(sl_Close)
788 #if _SL_INCLUDE_FUNC(sl_Accept)
818 #if _SL_INCLUDE_FUNC(sl_Bind)
842 #if _SL_INCLUDE_FUNC(sl_Listen)
884 #if _SL_INCLUDE_FUNC(sl_Connect)
936 #if _SL_INCLUDE_FUNC(sl_Select)
1246 #if _SL_INCLUDE_FUNC(sl_SetSockOpt)
1247 _i16
sl_SetSockOpt(_i16 sd, _i16 level, _i16 optname,
const void *optval, SlSocklen_t optlen);
1290 #if _SL_INCLUDE_FUNC(sl_GetSockOpt)
1291 _i16
sl_GetSockOpt(_i16 sd, _i16 level, _i16 optname,
void *optval, SlSocklen_t *optlen);
1356 #if _SL_INCLUDE_FUNC(sl_Recv)
1357 _i16
sl_Recv(_i16 sd,
void *buf, _i16 Len, _i16 flags);
1415 #if _SL_INCLUDE_FUNC(sl_RecvFrom)
1465 #if _SL_INCLUDE_FUNC(sl_Send )
1466 _i16
sl_Send(_i16 sd,
const void *buf, _i16 Len, _i16 flags);
1519 #if _SL_INCLUDE_FUNC(sl_SendTo)
1520 _i16
sl_SendTo(_i16 sd,
const void *buf, _i16 Len, _i16 flags,
const SlSockAddr_t *to, SlSocklen_t tolen);
1536 #if _SL_INCLUDE_FUNC(sl_Htonl )
1539 #define sl_Ntohl sl_Htonl
1555 #if _SL_INCLUDE_FUNC(sl_Htons )
1558 #define sl_Ntohs sl_Htons
_i16 sl_Connect(_i16 sd, const SlSockAddr_t *addr, _i16 addrlen)
Initiate a connection on a socket.
_i16 sl_GetSockOpt(_i16 sd, _i16 level, _i16 optname, void *optval, SlSocklen_t *optlen)
Get socket options.
void SL_FD_ZERO(SlFdSet_t *fdset)
Select's SlFdSet_t ZERO function.
_i16 sl_RecvFrom(_i16 sd, void *buf, _i16 Len, _i16 flags, SlSockAddr_t *from, SlSocklen_t *fromlen)
read data from socket
void SL_FD_SET(_i16 fd, SlFdSet_t *fdset)
Select's SlFdSet_t SET function.
_i16 sl_Recv(_i16 sd, void *buf, _i16 Len, _i16 flags)
read data from TCP socket
void SL_FD_CLR(_i16 fd, SlFdSet_t *fdset)
Select's SlFdSet_t CLR function.
_i16 sl_Accept(_i16 sd, SlSockAddr_t *addr, SlSocklen_t *addrlen)
Accept a connection on a socket.
_i16 sl_Socket(_i16 Domain, _i16 Type, _i16 Protocol)
create an endpoint for communication
_u32 sl_Htonl(_u32 val)
Reorder the bytes of a 32-bit unsigned value.
_i16 sl_Send(_i16 sd, const void *buf, _i16 Len, _i16 flags)
write data to TCP socket
_i16 sl_Listen(_i16 sd, _i16 backlog)
listen for connections on a socket
_i16 sl_SetSockOpt(_i16 sd, _i16 level, _i16 optname, const void *optval, SlSocklen_t optlen)
set socket options
_i16 sl_SendTo(_i16 sd, const void *buf, _i16 Len, _i16 flags, const SlSockAddr_t *to, SlSocklen_t tolen)
write data to socket
_i16 sl_Select(_i16 nfds, SlFdSet_t *readsds, SlFdSet_t *writesds, SlFdSet_t *exceptsds, struct SlTimeval_t *timeout)
Monitor socket activity.
_i16 sl_Bind(_i16 sd, const SlSockAddr_t *addr, _i16 addrlen)
assign a name to a socket
_i16 SL_FD_ISSET(_i16 fd, SlFdSet_t *fdset)
Select's SlFdSet_t ISSET function.
_u16 sl_Htons(_u16 val)
Reorder the bytes of a 16-bit unsigned value.
_i16 sl_Close(_i16 sd)
gracefully close socket