BSD compatible socket interface. More...
#include "bsp/include/nm_bsp.h"
#include "socket/include/socket.h"
#include "driver/source/m2m_hif.h"
#include "socket/source/socket_internal.h"
Go to the source code of this file.
Classes | |
struct | tstrCloseCmd |
struct | tstrSocket |
Macros | |
#define | ETHERNET_HEADER_LENGTH (14) |
#define | ETHERNET_HEADER_OFFSET (34) |
#define | IP_PACKET_OFFSET (ETHERNET_HEADER_LENGTH + ETHERNET_HEADER_OFFSET - M2M_HIF_HDR_OFFSET) |
#define | SOCKET_REQUEST(reqID, reqArgs, reqSize, reqPayload, reqPayloadSize, reqPayloadOffset) hif_send(M2M_REQ_GROUP_IP, reqID, reqArgs, reqSize, reqPayload, reqPayloadSize, reqPayloadOffset) |
#define | SSL_FLAGS_ACTIVE NBIT0 |
#define | SSL_FLAGS_BYPASS_X509 NBIT1 |
#define | SSL_FLAGS_CACHE_SESSION NBIT4 |
#define | SSL_FLAGS_CHECK_CERTNAME NBIT6 |
#define | SSL_TX_PACKET_OFFSET (TCP_TX_PACKET_OFFSET + TLS_RECORD_HEADER_LENGTH) |
#define | TCP_IP_HEADER_LENGTH (40) |
#define | TCP_TX_PACKET_OFFSET (IP_PACKET_OFFSET + TCP_IP_HEADER_LENGTH) |
#define | TLS_RECORD_HEADER_LENGTH (5) |
#define | UDP_IP_HEADER_LENGTH (28) |
#define | UDP_TX_PACKET_OFFSET (IP_PACKET_OFFSET + UDP_IP_HEADER_LENGTH) |
Functions | |
sint8 | accept (SOCKET sock, struct sockaddr *addr, uint8 *addrlen) |
sint8 | bind (SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen) |
sint8 | close (SOCKET sock) |
sint8 | connect (SOCKET sock, struct sockaddr *pstrAddr, uint8 u8AddrLen) |
sint8 | gethostbyname (uint8 *pcHostName) |
sint8 | getsockopt (SOCKET sock, uint8 u8Level, uint8 u8OptName, const void *pvOptValue, uint8 *pu8OptLen) |
sint8 | listen (SOCKET sock, uint8 backlog) |
static void | m2m_ip_cb (uint8 u8OpCode, uint16 u16BufferSize, uint32 u32Address) |
sint8 | m2m_ping_req (uint32 u32DstIP, uint8 u8TTL, tpfPingCb fpPingCb) |
uint32 | nmi_inet_addr (char *pcIpAddr) |
sint16 | recv (SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec) |
sint16 | recvfrom (SOCKET sock, void *pvRecvBuf, uint16 u16BufLen, uint32 u32Timeoutmsec) |
void | registerSocketCallback (tpfAppSocketCb pfAppSocketCb, tpfAppResolveCb pfAppResolveCb) |
sint16 | send (SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags) |
sint16 | sendto (SOCKET sock, void *pvSendBuffer, uint16 u16SendLength, uint16 flags, struct sockaddr *pstrDestAddr, uint8 u8AddrLen) |
sint8 | setsockopt (SOCKET sock, uint8 u8Level, uint8 option_name, const void *option_value, uint16 u16OptionLen) |
SOCKET | socket (uint16 u16Domain, uint8 u8Type, uint8 u8Flags) |
NMI_API void | Socket_ReadSocketData (SOCKET sock, tstrSocketRecvMsg *pstrRecv, uint8 u8SocketMsg, uint32 u32StartAddress, uint16 u16ReadCount) |
void | socketDeinit (void) |
Socket Layer De-initialization. More... | |
void | socketInit (void) |
static sint8 | sslSetSockOpt (SOCKET sock, uint8 u8Opt, const void *pvOptVal, uint16 u16OptLen) |
Variables | |
volatile tstrSocket | gastrSockets [MAX_SOCKET] |
volatile uint8 | gbSocketInit = 0 |
volatile tpfPingCb | gfpPingCb |
volatile tpfAppResolveCb | gpfAppResolveCb |
volatile tpfAppSocketCb | gpfAppSocketCb |
volatile sint8 | gsockerrno |
volatile uint16 | gu16BufferSize |
volatile uint16 | gu16SessionID = 0 |
volatile uint8 | gu8OpCode |
BSD compatible socket interface.
Copyright (c) 2017-2018 Microchip Technology Inc. and its subsidiaries.
Definition in file socket.c.
#define IP_PACKET_OFFSET (ETHERNET_HEADER_LENGTH + ETHERNET_HEADER_OFFSET - M2M_HIF_HDR_OFFSET) |
#define SOCKET_REQUEST | ( | reqID, | |
reqArgs, | |||
reqSize, | |||
reqPayload, | |||
reqPayloadSize, | |||
reqPayloadOffset | |||
) | hif_send(M2M_REQ_GROUP_IP, reqID, reqArgs, reqSize, reqPayload, reqPayloadSize, reqPayloadOffset) |
#define SSL_TX_PACKET_OFFSET (TCP_TX_PACKET_OFFSET + TLS_RECORD_HEADER_LENGTH) |
#define TCP_TX_PACKET_OFFSET (IP_PACKET_OFFSET + TCP_IP_HEADER_LENGTH) |
#define UDP_TX_PACKET_OFFSET (IP_PACKET_OFFSET + UDP_IP_HEADER_LENGTH) |
volatile tstrSocket gastrSockets[MAX_SOCKET] |
volatile tpfAppResolveCb gpfAppResolveCb |
volatile tpfAppSocketCb gpfAppSocketCb |