59 #define HOSTNAME_MAX_SIZE 100 66 #define SOCKET_BUFFER_MAX_LENGTH 1400 92 #define SOCKET_FLAGS_SSL 0x01 97 #define TCP_SOCK_MAX (7) 102 #define UDP_SOCK_MAX 4 107 #define MAX_SOCKET (TCP_SOCK_MAX + UDP_SOCK_MAX) 118 #define SO_SET_UDP_SEND_CALLBACK 0x00 125 #define IP_ADD_MEMBERSHIP 0x01 132 #define IP_DROP_MEMBERSHIP 0x02 141 #define SOL_SSL_SOCKET 2 148 #define SO_SSL_BYPASS_X509_VERIF 0x01 160 #define SO_SSL_SNI 0x02 170 #define SO_SSL_ENABLE_SESSION_CACHING 0x03 180 #define SO_SSL_ENABLE_CERTNAME_VALIDATION 0x04 190 #define SO_SSL_ENABLE_SNI_VALIDATION 0x04 206 #define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA NBIT0 207 #define SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 NBIT1 208 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA NBIT2 209 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 NBIT3 210 #define SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 NBIT4 211 #define SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 NBIT5 212 #define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA NBIT6 213 #define SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 NBIT7 214 #define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA NBIT8 215 #define SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 NBIT9 216 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA NBIT10 217 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_256_CBC_SHA NBIT11 218 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_CBC_SHA256 NBIT12 219 #define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 NBIT13 220 #define SSL_CIPHER_ECDHE_RSA_WITH_AES_128_GCM_SHA256 NBIT14 221 #define SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 NBIT15 224 #define SSL_ECC_ONLY_CIPHERS \ 226 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_CBC_SHA256 | \ 227 SSL_CIPHER_ECDHE_ECDSA_WITH_AES_128_GCM_SHA256 \ 235 #define SSL_DEFAULT_CIPHERS \ 237 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA | \ 238 SSL_CIPHER_RSA_WITH_AES_128_CBC_SHA256 | \ 239 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA | \ 240 SSL_CIPHER_DHE_RSA_WITH_AES_128_CBC_SHA256 | \ 241 SSL_CIPHER_RSA_WITH_AES_128_GCM_SHA256 | \ 242 SSL_CIPHER_DHE_RSA_WITH_AES_128_GCM_SHA256 | \ 243 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA | \ 244 SSL_CIPHER_RSA_WITH_AES_256_CBC_SHA256 | \ 245 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA | \ 246 SSL_CIPHER_DHE_RSA_WITH_AES_256_CBC_SHA256 \ 258 #ifdef _NM_BSP_BIG_END 259 #define _htonl(m) (m) 263 #define _htons(A) (A) 269 (uint32)(((uint32)(m << 24)) | ((uint32)((m & 0x0000FF00) << 8)) | ((uint32)((m & 0x00FF0000) >> 8)) | ((uint32)(((uint32)m) >> 24))) 274 #define _htons(A) (uint16)((((uint16) (A)) << 8) | (((uint16) (A)) >> 8)) 281 #define _ntohl _htonl 287 #define _ntohs _htons 302 #define SOCK_ERR_NO_ERROR 0 309 #define SOCK_ERR_INVALID_ADDRESS -1 316 #define SOCK_ERR_ADDR_ALREADY_IN_USE -2 323 #define SOCK_ERR_MAX_TCP_SOCK -3 330 #define SOCK_ERR_MAX_UDP_SOCK -4 337 #define SOCK_ERR_INVALID_ARG -6 343 #define SOCK_ERR_MAX_LISTEN_SOCK -7 350 #define SOCK_ERR_INVALID -9 357 #define SOCK_ERR_ADDR_IS_REQUIRED -11 364 #define SOCK_ERR_CONN_ABORTED -12 370 #define SOCK_ERR_TIMEOUT -13 376 #define SOCK_ERR_BUFFER_FULL -14 1690 const void *option_value,
uint16 u16OptionLen);
NMI_API sint8 connect(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
NMI_API sint16 recvfrom(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
signed short sint16
Range of values between -32768 to 32767.
static void socket_cb(SOCKET sock, uint8_t u8Msg, void *pvMsg)
Callback to get the Data from socket.
NMI_API SOCKET socket(uint16 u16Domain, uint8 u8Type, uint8 u8Flags)
signed char sint8
Range of values between -128 to 127.
NMI_API sint8 listen(SOCKET sock, uint8 backlog)
NMI_API sint16 recv(SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec)
NMI_API sint8 m2m_ping_req(uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb)
Socket address structure for IPV4 addresses. Used to specify socket address information to connect to...
NMI_API sint8 accept(SOCKET sock, struct sockaddr *addr, uint8 *addrlen)
WINC3400 IoT Application Interface Internal Types.
NMI_API uint32 nmi_inet_addr(char *pcIpAddr)
unsigned short uint16
Range of values between 0 to 65535.
tenuSocketCallbackMsgType
Asynchronous APIs make use of callback functions in-order to return back the results once the corresp...
void(* tpfAppSocketCb)(SOCKET sock, uint8 u8Msg, void *pvMsg)
The main socket application callback function. Applications register their main socket application ca...
NMI_API sint8 bind(SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen)
NMI_API sint8 setsockopt(SOCKET socket, uint8 u8Level, uint8 option_name, const void *option_value, uint16 u16OptionLen)
void(* tpfAppResolveCb)(uint8 *pu8DomainName, uint32 u32ServerIP)
DNS resolution callback function. Applications requiring DNS resolution should register their callbac...
NMI_API sint8 getsockopt(SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 *pu8OptLen)
NMI_API sint8 gethostbyname(uint8 *pcHostName)
Generic socket address structure.
NMI_API void socketInit(void)
IPv4 address representation.
NMI_API void socketDeinit(void)
Socket Layer De-initialization.
NMI_API sint8 close(SOCKET sock)
unsigned long uint32
Range of values between 0 to 4294967295.
unsigned char uint8
Range of values between 0 to 255.
NMI_API sint16 send(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 u16Flags)
NMI_API sint16 sendto(SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen)
NMI_API void registerSocketCallback(tpfAppSocketCb socket_cb, tpfAppResolveCb resolve_cb)
void(* tpfPingCb)(uint32 u32IPAddr, uint32 u32RTT, uint8 u8ErrorCode)
PING Callback.