189 #ifndef __SL_NET_SOCK_H__ 190 #define __SL_NET_SOCK_H__ 216 #define SLNETSOCK_MAX_CONCURRENT_SOCKETS (32) 219 #define SLNETSOCK_AF_INET (2) 220 #define SLNETSOCK_AF_INET6 (3) 221 #define SLNETSOCK_AF_RF (6) 222 #define SLNETSOCK_AF_PACKET (17) 225 #define SLNETSOCK_PF_INET SLNETSOCK_AF_INET 226 #define SLNETSOCK_PF_INET6 SLNETSOCK_AF_INET6 229 #define SLNETSOCK_SOCK_STREAM (1) 230 #define SLNETSOCK_SOCK_DGRAM (2) 231 #define SLNETSOCK_SOCK_RAW (3) 232 #define SLNETSOCK_SOCK_RX_MTR (4) 233 #define SLNETSOCK_SOCK_MAC_WITH_CCA (5) 234 #define SLNETSOCK_SOCK_MAC_WITH_NO_CCA (6) 235 #define SLNETSOCK_SOCK_BRIDGE (7) 236 #define SLNETSOCK_SOCK_ROUTER (8) 239 #define SLNETSOCK_PROTO_TCP (6) 240 #define SLNETSOCK_PROTO_UDP (17) 241 #define SLNETSOCK_PROTO_RAW (255) 242 #define SLNETSOCK_PROTO_SECURE (100) 245 #define SLNETSOCK_INADDR_ANY (0) 246 #define SLNETSOCK_IN6ADDR_ANY (0) 252 #define SLNETSOCK_LVL_SOCKET (1) 253 #define SLNETSOCK_LVL_IP (2) 254 #define SLNETSOCK_LVL_PHY (3) 259 #define SLNETSOCK_OPSOCK_RCV_BUF (8) 260 #define SLNETSOCK_OPSOCK_RCV_TIMEO (20) 261 #define SLNETSOCK_OPSOCK_KEEPALIVE (9) 262 #define SLNETSOCK_OPSOCK_KEEPALIVE_TIME (36) 263 #define SLNETSOCK_OPSOCK_LINGER (13) 264 #define SLNETSOCK_OPSOCK_NON_BLOCKING (24) 265 #define SLNETSOCK_OPSOCK_NON_IP_BOUNDARY (38) 266 #define SLNETSOCK_OPSOCK_SLNETSOCKSD (59) 269 #define SLNETSOCK_OPIP_MULTICAST_TTL (61) 270 #define SLNETSOCK_OPIP_ADD_MEMBERSHIP (65) 271 #define SLNETSOCK_OPIP_DROP_MEMBERSHIP (66) 272 #define SLNETSOCK_OPIP_HDRINCL (67) 273 #define SLNETSOCK_OPIP_RAW_RX_NO_HEADER (68) 274 #define SLNETSOCK_OPIP_RAW_IPV6_HDRINCL (69) 275 #define SLNETSOCK_OPIPV6_ADD_MEMBERSHIP (70) 276 #define SLNETSOCK_OPIPV6_DROP_MEMBERSHIP (71) 277 #define SLNETSOCK_OPIPV6_MULTICAST_HOPS (72) 280 #define SLNETSOCK_OPPHY_CHANNEL (107) 281 #define SLNETSOCK_OPPHY_RATE (100) 282 #define SLNETSOCK_OPPHY_TX_POWER (101) 283 #define SLNETSOCK_OPPHY_NUM_FRAMES_TO_TX (102) 284 #define SLNETSOCK_OPPHY_PREAMBLE (103) 285 #define SLNETSOCK_OPPHY_TX_INHIBIT_THRESHOLD (104) 286 #define SLNETSOCK_OPPHY_TX_TIMEOUT (105) 287 #define SLNETSOCK_OPPHY_ALLOW_ACKS (106) 319 #define SLNETSOCK_SEC_METHOD_SSLV3 (0) 320 #define SLNETSOCK_SEC_METHOD_TLSV1 (1) 321 #define SLNETSOCK_SEC_METHOD_TLSV1_1 (2) 322 #define SLNETSOCK_SEC_METHOD_TLSV1_2 (3) 323 #define SLNETSOCK_SEC_METHOD_SSLv3_TLSV1_2 (4) 324 #define SLNETSOCK_SEC_METHOD_DLSV1 (5) 327 #define SLNETSOCK_SEC_CIPHER_SSL_RSA_WITH_RC4_128_SHA (1 << 0) 328 #define SLNETSOCK_SEC_CIPHER_SSL_RSA_WITH_RC4_128_MD5 (1 << 1) 329 #define SLNETSOCK_SEC_CIPHER_TLS_RSA_WITH_AES_256_CBC_SHA (1 << 2) 330 #define SLNETSOCK_SEC_CIPHER_TLS_DHE_RSA_WITH_AES_256_CBC_SHA (1 << 3) 331 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA (1 << 4) 332 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_RSA_WITH_RC4_128_SHA (1 << 5) 333 #define SLNETSOCK_SEC_CIPHER_TLS_RSA_WITH_AES_128_CBC_SHA256 (1 << 6) 334 #define SLNETSOCK_SEC_CIPHER_TLS_RSA_WITH_AES_256_CBC_SHA256 (1 << 7) 335 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256 (1 << 8) 336 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 (1 << 9) 337 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_ECDSA_WITH_AES_128_CBC_SHA (1 << 10) 338 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_ECDSA_WITH_AES_256_CBC_SHA (1 << 11) 339 #define SLNETSOCK_SEC_CIPHER_TLS_RSA_WITH_AES_128_GCM_SHA256 (1 << 12) 340 #define SLNETSOCK_SEC_CIPHER_TLS_RSA_WITH_AES_256_GCM_SHA384 (1 << 13) 341 #define SLNETSOCK_SEC_CIPHER_TLS_DHE_RSA_WITH_AES_128_GCM_SHA256 (1 << 14) 342 #define SLNETSOCK_SEC_CIPHER_TLS_DHE_RSA_WITH_AES_256_GCM_SHA384 (1 << 15) 343 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (1 << 16) 344 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (1 << 17) 345 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 (1 << 18) 346 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_ECDSA_WITH_AES_256_GCM_SHA384 (1 << 19) 347 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_ECDSA_WITH_CHACHA20_POLY1305_SHA256 (1 << 20) 348 #define SLNETSOCK_SEC_CIPHER_TLS_ECDHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (1 << 21) 349 #define SLNETSOCK_SEC_CIPHER_TLS_DHE_RSA_WITH_CHACHA20_POLY1305_SHA256 (1 << 22) 352 #define SLNETSOCK_SEC_ALPN_H1 (1 << 0) 353 #define SLNETSOCK_SEC_ALPN_H2 (1 << 1) 354 #define SLNETSOCK_SEC_ALPN_H2C (1 << 2) 355 #define SLNETSOCK_SEC_ALPN_H2_14 (1 << 3) 356 #define SLNETSOCK_SEC_ALPN_H2_16 (1 << 4) 357 #define SLNETSOCK_SEC_ALPN_FULL_LIST ((SLNETSOCK_SEC_ALPN_H2_16 << 1 ) - 1) 360 #define SLNETSOCK_SEC_START_SECURITY_SESSION_ONLY (1 << 0) 361 #define SLNETSOCK_SEC_BIND_CONTEXT_ONLY (1 << 1) 362 #define SLNETSOCK_SEC_IS_SERVER (1 << 2) 366 #define SLNETSOCK_CREATE_IF_STATE_ENABLE (1 << 0) 367 #define SLNETSOCK_CREATE_IF_STATUS_CONNECTED (1 << 1) 368 #define SLNETSOCK_CREATE_ALLOW_PARTIAL_MATCH (1 << 2) 372 #define SLNETSOCK_SHUT_RD (0) 373 #define SLNETSOCK_SHUT_WR (1) 374 #define SLNETSOCK_SHUT_RDWR (2) 377 #define SLNETSOCK_INET6_ADDRSTRLEN (40) 378 #define SLNETSOCK_INET_ADDRSTRLEN (15) 380 #define SLNETSOCK_RECV_MSG_DONTWAIT (1 << 0) 403 uint8_t s_b1,s_b2,s_b3,s_b4;
701 int16_t
SlNetSock_create(int16_t domain, int16_t type, int16_t protocol, uint32_t ifBitmap, int16_t flags);
1443 int32_t
SlNetSock_recv(int16_t sd,
void *buf, uint32_t len, uint32_t flags);
1548 int32_t
SlNetSock_send(int16_t sd,
const void *buf, uint32_t len, uint32_t flags);
uint32_t secureALPN
Definition: slnetsock.h:478
Definition: slnetsock.h:314
int32_t SlNetSock_sdsSet(int16_t sd, SlNetSock_SdSet_t *sdset)
SlNetSock_select's SlNetSock_SdSet_t SET function.
struct _SlNetSock_NonIpBoundary_t SlNetSock_NonIpBoundary_t
The SlNetSock_NonIpBoundary_t structure is used in SLNETSOCK_OPSOCK_NON_IP_BOUNDARY socket level opti...
The SlNetSock_TransceiverRxOverHead_t structure holds the data for Rx transceiver mode using a raw so...
Definition: slnetsock.h:591
uint32_t ipv6mr_interface
Definition: slnetsock.h:512
SlNetSockSecAttrib_e
The SlNetSockSecAttrib_e enumerations is used for security attribute object in SlNetSock_secAttribSet...
Definition: slnetsock.h:305
int32_t SlNetSock_startSec(int16_t sd, SlNetSockSecAttrib_t *secAttrib, uint8_t flags)
Start a security session on an opened socket.
int32_t SlNetSock_recvFrom(int16_t sd, void *buf, uint32_t len, uint32_t flags, SlNetSock_Addr_t *from, SlNetSocklen_t *fromlen)
Read data from socket.
int32_t SlNetSock_connectUrl(int16_t sd, const char *url)
Initiate a connection on a socket by URL.
Definition: slnetsock.h:298
SlNetSock IPv4 address, Internet style.
Definition: slnetsock.h:571
uint8_t * attribBuff
Definition: slnetsock.h:463
Definition: slnetsock.h:299
The SlNetSock_IpMreq_t structure is used in SLNETSOCK_OPIP_ADD_MEMBERSHIP/SLNETSOCK_OPIP_DROP_MEMBERS...
Definition: slnetsock.h:500
int32_t SlNetSock_sdsIsSet(int16_t sd, SlNetSock_SdSet_t *sdset)
SlNetSock_select's SlNetSock_SdSet_t ISSET function.
struct _SlNetSock_IpV6Mreq_t SlNetSock_IpV6Mreq_t
The SlNetSock_IpV6Mreq_t structure is used in SLNETSOCK_OPIPV6_ADD_MEMBERSHIP/SLNETSOCK_OPIPV6_DROP_M...
int32_t SlNetSock_bind(int16_t sd, const SlNetSock_Addr_t *addr, int16_t addrlen)
Assign a name to a socket.
int32_t SlNetSock_getOpt(int16_t sd, int16_t level, int16_t optname, void *optval, SlNetSocklen_t *optlen)
Get socket options.
int32_t SlNetSock_close(int16_t sd)
Gracefully close socket.
int32_t SlNetSock_shutdown(int16_t sd, int16_t how)
Shutting down parts of a full-duplex connection.
int32_t SlNetSock_getIfID(uint16_t sd)
Get interface ID from socket descriptor (sd)
int32_t SlNetSock_recv(int16_t sd, void *buf, uint32_t len, uint32_t flags)
Read data from TCP socket.
SlNetSockSecAttrib_e attribName
Definition: slnetsock.h:462
int32_t SlNetSock_secAttribSet(SlNetSockSecAttrib_t *secAttrib, SlNetSockSecAttrib_e attribName, void *val, uint16_t len)
set a security attributes
uint32_t l_onoff
Definition: slnetsock.h:520
int8_t rssi
Definition: slnetsock.h:595
Internet address.
Definition: slnetsock.h:390
Definition: slnetsock.h:310
uint16_t SlNetSocklen_t
The SlNetSocklen_t is used for declaring the socket length parameter.
Definition: slnetsock.h:545
uint32_t keepaliveEnabled
Definition: slnetsock.h:430
Definition: slnetsock.h:315
int16_t SlNetSock_create(int16_t domain, int16_t type, int16_t protocol, uint32_t ifBitmap, int16_t flags)
Create an endpoint for communication.
SlNetSock_InAddr_t imr_multiaddr
Definition: slnetsock.h:502
Definition: slnetsock.h:308
#define SLNETSOCK_MAX_CONCURRENT_SOCKETS
Definition: slnetsock.h:216
uint16_t sin6_port
Definition: slnetsock.h:562
int32_t SlNetSock_init(int32_t flags)
Initialize the slnetsock module.
Definition: slnetsock.h:307
uint16_t attribBuffLen
Definition: slnetsock.h:464
The SlNetSock_Keepalive_t structure is used in SLNETSOCK_OPSOCK_KEEPALIVE socket level option...
Definition: slnetsock.h:428
The SlNetSock_Nonblocking_t structure is used in SLNETSOCK_OPSOCK_NON_BLOCKING socket level option...
Definition: slnetsock.h:452
Definition: slnetsock.h:309
struct _SlNetSock_Winsize_t SlNetSock_Winsize_t
The SlNetSock_Winsize_t structure is used in SLNETSOCK_OPSOCK_RCV_BUF socket level option...
uint8_t padding
Definition: slnetsock.h:596
int16_t SlNetSock_accept(int16_t sd, SlNetSock_Addr_t *addr, SlNetSocklen_t *addrlen)
Accept a connection on a socket.
int32_t SlNetSock_sdsClr(int16_t sd, SlNetSock_SdSet_t *sdset)
SlNetSock_select's SlNetSock_SdSet_t CLR function.
SlNetSock_InAddr_t sin_addr
Definition: slnetsock.h:575
struct _SlNetSock_InAddr_t SlNetSock_InAddr_t
Internet address.
Secure socket attribute context.
Definition: slnetsock.h:460
int32_t SlNetSock_getPeerName(int16_t sd, SlNetSock_Addr_t *addr, SlNetSocklen_t *addrlen)
Return address info about the remote side of the connection.
uint32_t s_addr
Definition: slnetsock.h:393
struct _SlNetSock_Keepalive_t SlNetSock_Keepalive_t
The SlNetSock_Keepalive_t structure is used in SLNETSOCK_OPSOCK_KEEPALIVE socket level option...
SlNetSock_In6Addr_t sin6_addr
Definition: slnetsock.h:564
IpV6 or Ipv6 EUI64.
Definition: slnetsock.h:416
struct _SlNetSock_Nonblocking_t SlNetSock_Nonblocking_t
The SlNetSock_Nonblocking_t structure is used in SLNETSOCK_OPSOCK_NON_BLOCKING socket level option...
IpV4 socket address.
Definition: slnetsock.h:550
SlNetSockTime_t tv_sec
Definition: slnetsock.h:538
uint16_t sin_port
Definition: slnetsock.h:574
struct _SlNetSock_SecureMethod_t SlNetSock_SecureMethod_t
Secure Method structure.
The SlNetSock_IpV6Mreq_t structure is used in SLNETSOCK_OPIPV6_ADD_MEMBERSHIP/SLNETSOCK_OPIPV6_DROP_M...
Definition: slnetsock.h:509
The SlNetSock_NonIpBoundary_t structure is used in SLNETSOCK_OPSOCK_NON_IP_BOUNDARY socket level opti...
Definition: slnetsock.h:436
uint32_t secureMask
Definition: slnetsock.h:486
struct _SlNetSock_Timeval_t SlNetSock_Timeval_t
The SlNetSock_Timeval_t structure is used in SLNETSOCK_OPSOCK_RCV_TIMEO socket level option...
struct _SlNetSock_SecAttribNode_t * next
Definition: slnetsock.h:465
int32_t SlNetSock_setOpt(int16_t sd, int16_t level, int16_t optname, void *optval, SlNetSocklen_t optlen)
Set socket options-.
uint32_t winSize
Definition: slnetsock.h:446
Definition: slnetsock.h:311
uint32_t imr_interface
Definition: slnetsock.h:503
uint32_t sin6_flowinfo
Definition: slnetsock.h:563
uint8_t channel
Definition: slnetsock.h:594
int32_t SlNetSockuseconds_t
The SlNetSockuseconds_t is used for setting/getting time in micro-seconds.
Definition: slnetsock.h:531
Secure Mask structure.
Definition: slnetsock.h:484
int32_t SlNetSockTime_t
The SlNetSockTime_t is used for setting/getting time in seconds.
Definition: slnetsock.h:527
int32_t SlNetSock_sdsClrAll(SlNetSock_SdSet_t *sdset)
SlNetSock_select's SlNetSock_SdSet_t ZERO function.
The SlNetSock_linger_t structure is used in SLNETSOCK_OPSOCK_LINGER socket level option.
Definition: slnetsock.h:518
uint16_t sin6_family
Definition: slnetsock.h:561
Definition: slnetsock.h:294
uint32_t nonBlockingEnabled
Definition: slnetsock.h:454
SlNetSockTxInhibitThreshold_e
The SlNetSockTxInhibitThreshold_e enumerations is used in SLNETSOCK_OPPHY_TX_INHIBIT_THRESHOLD PHY le...
Definition: slnetsock.h:292
Secure ALPN structure.
Definition: slnetsock.h:476
SlNetSock IPv6 address, Internet style.
Definition: slnetsock.h:559
SlNetSock_SecAttribNode_t * SlNetSockSecAttrib_t
Secure socket attribute handler.
Definition: slnetsock.h:471
Definition: slnetsock.h:295
SlNetSock_In6Addr_t ipv6mr_multiaddr
Definition: slnetsock.h:511
struct _SlNetSock_SdSet_t SlNetSock_SdSet_t
The SlNetSock_SdSet_t structure holds the sd array for SlNetSock_select function. ...
struct _SlNetSock_IpMreq_t SlNetSock_IpMreq_t
The SlNetSock_IpMreq_t structure is used in SLNETSOCK_OPIP_ADD_MEMBERSHIP/SLNETSOCK_OPIP_DROP_MEMBERS...
Definition: slnetsock.h:297
int32_t nonIpBoundaryEnabled
Definition: slnetsock.h:438
int32_t SlNetSock_connect(int16_t sd, const SlNetSock_Addr_t *addr, SlNetSocklen_t addrlen)
Initiate a connection on a socket.
The SlNetSock_Timeval_t structure is used in SLNETSOCK_OPSOCK_RCV_TIMEO socket level option...
Definition: slnetsock.h:536
The SlNetSock_Winsize_t structure is used in SLNETSOCK_OPSOCK_RCV_BUF socket level option...
Definition: slnetsock.h:444
struct _SlNetSock_linger_t SlNetSock_linger_t
The SlNetSock_linger_t structure is used in SLNETSOCK_OPSOCK_LINGER socket level option.
uint32_t timestamp
Definition: slnetsock.h:597
Secure Method structure.
Definition: slnetsock.h:492
struct _SlNetSock_AddrIn_t SlNetSock_AddrIn_t
SlNetSock IPv4 address, Internet style.
struct _SlNetSock_Addr_t SlNetSock_Addr_t
IpV4 socket address.
Definition: slnetsock.h:296
struct _SlNetSock_TransceiverRxOverHead_t SlNetSock_TransceiverRxOverHead_t
The SlNetSock_TransceiverRxOverHead_t structure holds the data for Rx transceiver mode using a raw so...
uint8_t rate
Definition: slnetsock.h:593
struct _SlNetSock_In6Addr_t SlNetSock_In6Addr_t
IpV6 or Ipv6 EUI64.
int32_t SlNetSock_listen(int16_t sd, int16_t backlog)
Listen for connections on a socket.
struct _SlNetSock_SecAttribNode_t SlNetSock_SecAttribNode_t
Secure socket attribute context.
int32_t SlNetSock_sendTo(int16_t sd, const void *buf, uint32_t len, uint32_t flags, const SlNetSock_Addr_t *to, SlNetSocklen_t tolen)
Write data to socket.
Definition: slnetsock.h:313
int32_t SlNetSock_secAttribDelete(SlNetSockSecAttrib_t *secAttrib)
Deletes a security attributes object.
struct _SlNetSock_SecureALPN_t SlNetSock_SecureALPN_t
Secure ALPN structure.
Definition: slnetsock.h:312
uint16_t sin_family
Definition: slnetsock.h:573
uint32_t l_linger
Definition: slnetsock.h:521
SlNetSockSecAttrib_t * SlNetSock_secAttribCreate(void)
Creates a security attributes object.
uint32_t sin6_scope_id
Definition: slnetsock.h:565
struct _SlNetSock_AddrIn6_t SlNetSock_AddrIn6_t
SlNetSock IPv6 address, Internet style.
int32_t SlNetSock_send(int16_t sd, const void *buf, uint32_t len, uint32_t flags)
Write data to TCP socket.
uint8_t secureMethod
Definition: slnetsock.h:494
The SlNetSock_SdSet_t structure holds the sd array for SlNetSock_select function. ...
Definition: slnetsock.h:582
uint16_t sa_family
Definition: slnetsock.h:552
struct _SlNetSock_SecureMask_t SlNetSock_SecureMask_t
Secure Mask structure.
SlNetSockuseconds_t tv_usec
Definition: slnetsock.h:539
int32_t SlNetSock_getSockName(int16_t sd, SlNetSock_Addr_t *addr, SlNetSocklen_t *addrlen)
Get local address info by socket descriptor Returns the local address info of the socket descriptor...
int32_t SlNetSock_select(int16_t nsds, SlNetSock_SdSet_t *readsds, SlNetSock_SdSet_t *writesds, SlNetSock_SdSet_t *exceptsds, SlNetSock_Timeval_t *timeout)
Monitor socket activity.