Network Component  
MDK Middleware for IPv4 and IPv6 Networking
 
Loading...
Searching...
No Matches
rl_net.h File Reference
#include <stdint.h>
#include <stdbool.h>
#include <stddef.h>
#include "cmsis_compiler.h"
#include "RTE_Components.h"

Data Structures

struct  NET_ADDR
 Network Address IPv4/IPv6 capable. More...
 
struct  NET_ADDR4
 Network Address IPv4 only. More...
 
struct  SOCKADDR
 Generic Socket Address structure. More...
 
struct  SOCKADDR_IN
 IPv4 Socket Address structure. More...
 
struct  SOCKADDR_IN6
 IPv6 Socket Address structure. More...
 
struct  SOCKADDR_STORAGE
 Socket Address storage structure. More...
 
struct  HOSTENT
 BSD Host Entry structure. More...
 
struct  fd_set
 BSD fd_set structure. More...
 
struct  timeval
 BSD timeval structure. More...
 
struct  IOVEC
 BSD scatter/gather array of items. More...
 
struct  MSGHDR
 BSD message header structure. More...
 
struct  CMSGHDR
 BSD cmsg header structure. More...
 
struct  NET_WIFI_CONFIG
 WiFi Configuration. More...
 
struct  NET_WIFI_NET_INFO
 WiFi Network information. More...
 
struct  NET_WIFI_SCAN_INFO
 WiFi Scan information. More...
 
struct  NET_DHCP_OPTION_ITEM
 DHCP Option Item. More...
 
struct  NET_SMTP_MAIL
 SMTP Email Descriptor. More...
 
struct  NET_SMTP_MTA
 SMTP Mail Transfer Agent Descriptor. More...
 
struct  NET_SNMP_MIB_INFO
 SNMP-MIB Entry information. More...
 
struct  NET_SNMP_BYTE_STR
 SNMP-MIB byte-string. More...
 
struct  NET_FS_TIME
 FS Interface Time info. More...
 

Macros

#define MW_NET_VERSION_MAJOR   8
 Network component version.
 
#define MW_NET_VERSION_MINOR   0
 
#define MW_NET_VERSION_PATCH   0
 
#define ntohl(v)   (uint32_t)__REV(v)
 Network to host byte order conversion.
 
#define ntohs(v)   (uint16_t)__REV16(v)
 
#define htons(v)   ntohs(v)
 Host to network byte order conversion.
 
#define htonl(v)   ntohl(v)
 
#define NET_ADDR_ETH_LEN   6
 General definitions.
 
#define NET_ADDR_IP4_LEN   4
 IPv4 Address Length in bytes.
 
#define NET_ADDR_IP6_LEN   16
 IPv6 Address Length in bytes.
 
#define NET_HOSTNAME_LEN   16
 Hostname Buffer Length in bytes.
 
#define NET_ROOT_DIR_LEN   80
 Service Root Folder Length in bytes.
 
#define NET_ADDR_ANY   (-1)
 Network Address types.
 
#define NET_ADDR_IP4   0
 IPv4 Address.
 
#define NET_ADDR_IP6   1
 IPv6 Address.
 
#define NET_USERNAME_LEN   16
 Service Authentication definitions.
 
#define NET_PASSWORD_LEN   16
 Password Buffer Length in bytes.
 
#define NET_ACCESS_FILE_READ   0x01
 Network Access definitions.
 
#define NET_ACCESS_FILE_WRITE   0x02
 File Write is allowed.
 
#define NET_ACCESS_DIRECTORY_CREATE   0x04
 Directory Create is allowed.
 
#define NET_ACCESS_DIRECTORY_REMOVE   0x08
 Directory Remove is allowed.
 
#define NET_ACCESS_DIRECTORY_LIST   0x10
 Directory List is allowed.
 
#define NET_UDP_CHECKSUM_SEND   0x01
 UDP Checksum Options.
 
#define NET_UDP_CHECKSUM_VERIFY   0x02
 Verify Checksum for received UDP frames (default)
 
#define AF_UNSPEC   0
 BSD Socket Address Family.
 
#define AF_INET   1
 Internet Address Family.
 
#define AF_NETBIOS   2
 NetBios-style addresses.
 
#define AF_INET6   3
 Internet Address Family version 6.
 
#define PF_UNSPEC   0
 BSD Protocol families (same as address families).
 
#define PF_INET   1
 Internet Address Family.
 
#define PF_NETBIOS   2
 NetBios-style addresses.
 
#define PF_INET6   3
 Internet Address Family version 6.
 
#define SOCK_STREAM   1
 BSD Socket Type.
 
#define SOCK_DGRAM   2
 Datagram Socket (Connectionless)
 
#define IPPROTO_TCP   1
 BSD Socket Protocol.
 
#define IPPROTO_UDP   2
 UDP Protocol.
 
#define INADDR_ANY   0x00000000
 BSD Internet Addresses IPv4.
 
#define INADDR_NONE   0xffffffff
 No IP address accepted.
 
#define INADDR_LOOPBACK   0x7f000001
 Localhost IP address.
 
#define MSG_DONTWAIT   0x01
 BSD Socket flags parameter.
 
#define MSG_PEEK   0x02
 Peeks at the incoming data.
 
#define MSG_TRUNC   0x04
 Normal data was truncated.
 
#define MSG_CTRUNC   0x08
 Control data was truncated.
 
#define FIONBIO   1
 BSD Socket ioctl commands.
 
#define SOL_SOCKET   1
 BSD Socket level.
 
#define IPPROTO_IP   2
 IPv4 Level.
 
#define IPPROTO_IPV6   3
 IPv6 Level.
 
#define SO_KEEPALIVE   1
 BSD Socket options.
 
#define SO_RCVTIMEO   2
 Timeout for blocking receive (in milliseconds)
 
#define SO_SNDTIMEO   3
 Timeout for blocking send (in milliseconds)
 
#define SO_TYPE   4
 Socket type (read only)
 
#define SO_BINDTODEVICE   5
 Bind to network interface.
 
#define IP_TOS   1
 BSD Socket IPv4 options.
 
#define IP_TTL   2
 Time to Live (TTL)
 
#define IP_RECVDSTADDR   3
 Receive destination IPv4 address.
 
#define IPV6_TCLASS   1
 BSD Socket IPv6 options.
 
#define IPV6_MULTICAST_HOPS   2
 Multi-cast Hop Limit.
 
#define IPV6_RECVDSTADDR   3
 Receive destination IPv6 address.
 
#define IPV6_V6ONLY   4
 Restrict to IPv6 communications only (default on)
 
#define BSD_ERROR   (-1)
 BSD Socket Error codes.
 
#define BSD_ESOCK   (-2)
 Invalid socket descriptor.
 
#define BSD_EINVAL   (-3)
 Invalid parameter.
 
#define BSD_ENOTSUP   (-11)
 Operation or feature not supported.
 
#define BSD_ENOMEM   (-5)
 Not enough memory.
 
#define BSD_ELOCKED   (-7)
 Socket locked by another thread.
 
#define BSD_EWOULDBLOCK   (-4)
 Operation would block.
 
#define BSD_ETIMEDOUT   (-8)
 Operation timed out.
 
#define BSD_EINPROGRESS   (-9)
 Operation in progress.
 
#define BSD_ENOTCONN   (-6)
 Socket not connected.
 
#define BSD_EISCONN   (-12)
 Socket is connected.
 
#define BSD_ECONNREFUSED   (-13)
 Connection rejected by the peer.
 
#define BSD_ECONNRESET   (-14)
 Connection reset by the peer.
 
#define BSD_ECONNABORTED   (-15)
 Connection aborted locally.
 
#define BSD_EALREADY   (-16)
 Connection already in progress.
 
#define BSD_EADDRINUSE   (-17)
 Address already in use.
 
#define BSD_EDESTADDRREQ   (-18)
 Destination address required.
 
#define BSD_EHOSTNOTFOUND   (-10)
 Host not found.
 
#define BSD_EMSGSIZE   (-19)
 Message too large.
 
#define INET_ADDRSTRLEN   16
 BSD address string length.
 
#define INET6_ADDRSTRLEN   46
 IP6 address string length.
 
#define FD_SETSIZE   64
 BSD fd_set size.
 
#define FD_WR(fd, code)   if ((fd > 0) && (fd <= FD_SETSIZE)) { code; }
 BSD safe read/write fd_set macros.
 
#define FD_RD(fd, code)   (((fd > 0) && (fd <= FD_SETSIZE)) ? (code) : 0)
 
#define FD_SET(fd, set)   FD_WR(fd, (set)->fd_bits[(fd-1)>>5] |= (1U << ((fd-1)&0x1F)))
 BSD initialize and test fd_set macros.
 
#define FD_CLR(fd, set)   FD_WR(fd, (set)->fd_bits[(fd-1)>>5] &= ~(1U << ((fd-1)&0x1F)))
 
#define FD_ISSET(fd, set)   FD_RD(fd, (set)->fd_bits[(fd-1)>>5] & (1U << ((fd-1)&0x1F)))
 
#define FD_ZERO(set)   memset(set, 0, sizeof(*set))
 
#define CMSG_FIRSTHDR(mhdr)
 BSD access ancillary data macros (RFC 2292).
 
#define CMSG_NXTHDR(mhdr, cmsg)
 
#define CMSG_DATA(cmsg)   ((uint8_t *)(cmsg) + sizeof(CMSGHDR))
 
#define CMSG_ALIGN(len)   (((len) + 3) & ~3U)
 
#define CMSG_LEN(len)   ((len) + sizeof(CMSGHDR))
 
#define CMSG_SPACE(len)   CMSG_ALIGN((len) + sizeof(CMSGHDR))
 
#define NET_IF_CLASS_ETH   (1U << 8)
 Interface Class.
 
#define NET_IF_CLASS_WIFI   (2U << 8)
 WiFi interface.
 
#define NET_IF_CLASS_PPP   (3U << 8)
 PPP interface.
 
#define NET_IF_CLASS_SLIP   (4U << 8)
 SLIP interface.
 
#define NET_ETH_SPEED_10M   0
 Ethernet link speed.
 
#define NET_ETH_SPEED_100M   1
 100 Mbps link speed
 
#define NET_ETH_SPEED_1G   2
 1 Gpbs link speed
 
#define NET_ETH_DUPLEX_HALF   0
 Ethernet duplex mode.
 
#define NET_ETH_DUPLEX_FULL   1
 Full duplex link.
 
#define NET_DHCP_OPTION_IP_ADDRESS   0
 DHCP Option Codes.
 
#define NET_DHCP_OPTION_NTP_SERVERS   42
 NTP Servers option.
 
#define NET_DHCP_OPTION_CLIENT_ID   61
 Client-identifier option.
 
#define NET_DHCP_OPTION_BOOTFILE_NAME   67
 Bootfile name option.
 
#define NET_DHCP6_OPTION_IP_ADDRESS   0
 DHCPv6 Option Codes.
 
#define NET_PING_IP4_ONLY   0x01
 Ping Control Flags.
 
#define NET_PING_IP6_ONLY   0x02
 Force using IPv6 only.
 
#define NET_SMTP_MTA_USETLS   0x01
 SMTP Mail Transfer Agent Flags.
 
#define NET_SNMP_MIB_INTEGER   0x02
 SNMP-MIB definitions.
 
#define NET_SNMP_MIB_OCTET_STR   0x04
 MIB entry type OCTET_STRING (null-terminated)
 
#define NET_SNMP_MIB_OBJECT_ID   0x06
 MIB entry type OBJECT_IDENTIFIER.
 
#define NET_SNMP_MIB_BYTE_STR   0x07
 MIB entry type BYTE_STRING (length encoded)
 
#define NET_SNMP_MIB_IP_ADDR   0x40
 MIB entry type IP ADDRESS (uint8_t[4])
 
#define NET_SNMP_MIB_COUNTER   0x41
 MIB entry type COUNTER (uint32_t)
 
#define NET_SNMP_MIB_GAUGE   0x42
 MIB entry type GAUGE (uint32_t)
 
#define NET_SNMP_MIB_TIME_TICKS   0x43
 MIB entry type TIME_TICKS.
 
#define NET_SNMP_MIB_ATR_RO   0x80
 MIB entry attribute READ_ONLY.
 
#define NET_SNMP_MIB_OID_SIZE   17
 Max.size of Object ID value.
 
#define NET_SNMP_MIB_STR_SIZE   110
 Max.size of Octet String variable.
 
#define NET_SNMP_MIB_READ   0
 MIB entry Read access.
 
#define NET_SNMP_MIB_WRITE   1
 MIB entry Write access.
 
#define NET_SNMP_MIB_STR(s)   sizeof(s)-1, s
 SNMP-MIB macros.
 
#define NET_SNMP_MIB_INT(o)   sizeof(o), (void *)&o
 
#define NET_SNMP_MIB_IP(ip)   4, (void *)&ip
 
#define NET_SNMP_MIB_OID0(f, s)   (f*40 + s)
 
#define NET_FS_ATTR_FILE   1
 FS Interface Attributes.
 
#define NET_FS_ATTR_DIRECTORY   2
 Directory entry.
 

Typedefs

typedef uint32_t(* netUDP_cb_t) (int32_t socket, const NET_ADDR *addr, const uint8_t *buf, uint32_t len)
 UDP Event callback function.
 
typedef void(* netPing_cb_t) (netPing_Event event)
 Ping Event callback function.
 
typedef void(* netARP_cb_t) (netARP_Event event)
 ARP Probe Event callback function.
 
typedef void(* netNDP_cb_t) (netNDP_Event event)
 NDP Probe Event callback function.
 
typedef void(* netDNSc_cb_t) (netDNSc_Event event, const NET_ADDR *addr)
 DNS Client Event callback function.
 
typedef void(* netSNTPc_cb_t) (uint32_t seconds, uint32_t seconds_fraction)
 SNTP Client callback function.
 
typedef uint32_t(* netTCP_cb_t) (int32_t socket, netTCP_Event event, const NET_ADDR *addr, const uint8_t *buf, uint32_t len)
 TCP Event callback function.
 

Enumerations

enum  netStatus {
  netOK = 0 ,
  netBusy ,
  netError ,
  netInvalidParameter ,
  netWrongState ,
  netDriverError ,
  netServerError ,
  netAuthenticationFailed ,
  netDnsResolverError ,
  netFileError ,
  netTimeout
}
 Status code values returned by Network library functions. More...
 
enum  netUDP_Option {
  netUDP_OptionTOS = 0 ,
  netUDP_OptionTTL ,
  netUDP_OptionTrafficClass ,
  netUDP_OptionHopLimit ,
  netUDP_OptionInterface ,
  netUDP_OptionChecksum
}
 UDP Socket Options. More...
 
enum  netTCP_Event {
  netTCP_EventConnect = 0 ,
  netTCP_EventEstablished ,
  netTCP_EventClosed ,
  netTCP_EventAborted ,
  netTCP_EventACK ,
  netTCP_EventData
}
 TCP Socket Events. More...
 
enum  netTCP_State {
  netTCP_StateINVALID =-1 ,
  netTCP_StateUNUSED = 0 ,
  netTCP_StateCLOSED ,
  netTCP_StateLISTEN ,
  netTCP_StateSYN_RECEIVED ,
  netTCP_StateSYN_SENT ,
  netTCP_StateFIN_WAIT_1 ,
  netTCP_StateFIN_WAIT_2 ,
  netTCP_StateCLOSING ,
  netTCP_StateLAST_ACK ,
  netTCP_StateTIME_WAIT ,
  netTCP_StateESTABLISHED
}
 TCP Socket States. More...
 
enum  netTCP_Option {
  netTCP_OptionTOS = 0 ,
  netTCP_OptionTrafficClass ,
  netTCP_OptionTimeout ,
  netTCP_OptionKeepAlive ,
  netTCP_OptionFlowControl ,
  netTCP_OptionDelayedACK
}
 TCP Socket Options. More...
 
enum  netIF_Option {
  netIF_OptionMAC_Address ,
  netIF_OptionVLAN_Identifier ,
  netIF_OptionIP4_MTU ,
  netIF_OptionIP4_Address ,
  netIF_OptionIP4_SubnetMask ,
  netIF_OptionIP4_DefaultGateway ,
  netIF_OptionIP4_PrimaryDNS ,
  netIF_OptionIP4_SecondaryDNS ,
  netIF_OptionIP6_MTU ,
  netIF_OptionIP6_LinkLocalAddress ,
  netIF_OptionIP6_StaticAddress ,
  netIF_OptionIP6_DynamicAddress ,
  netIF_OptionIP6_SubnetPrefixLength ,
  netIF_OptionIP6_DefaultGateway ,
  netIF_OptionIP6_PrimaryDNS ,
  netIF_OptionIP6_SecondaryDNS
}
 Interface Option codes. More...
 
enum  netIF_Version {
  netIF_VersionIP4 ,
  netIF_VersionIP6
}
 Interface IP Versions. More...
 
enum  netETH_Event {
  netETH_LinkDown = 0 ,
  netETH_LinkUp ,
  netETH_Wakeup ,
  netETH_TimerAlarm
}
 Ethernet Callback Events. More...
 
enum  netWiFi_Security {
  netWiFi_SecurityOpen = 0 ,
  netWiFi_SecurityWEP ,
  netWiFi_SecurityWPA ,
  netWiFi_SecurityWPA2 ,
  netWiFi_SecurityUnknown = 255
}
 WiFi Security Types. More...
 
enum  netWiFi_Option {
  netWiFi_OptionBSSID = 1 ,
  netWiFi_OptionTxPower ,
  netWiFi_OptionLpTimer ,
  netWiFi_OptionDTIM ,
  netWiFi_OptionBeacon
}
 WiFi Driver Options. More...
 
enum  netWiFi_WPS {
  netWiFi_WPS_None = 0 ,
  netWiFi_WPS_PBC ,
  netWiFi_WPS_PIN
}
 WiFi WPS Methods. More...
 
enum  netARP_CacheType {
  netARP_CacheFixedIP ,
  netARP_CacheTemporaryIP
}
 ARP Cache Entry types. More...
 
enum  netDHCP6_Mode {
  netDHCP6_ModeStateless = 0 ,
  netDHCP6_ModeStateful
}
 DHCPv6 Modes. More...
 
enum  netPing_Event {
  netPing_EventSuccess = 0 ,
  netPing_EventTimeout
}
 Ping Callback Events. More...
 
enum  netARP_Event {
  netARP_EventSuccess = 0 ,
  netARP_EventTimeout
}
 ARP Probe Callback Events. More...
 
enum  netNDP_Event {
  netNDP_EventSuccess = 0 ,
  netNDP_EventTimeout
}
 NDP Probe Callback Events. More...
 
enum  netDNSc_Event {
  netDNSc_EventSuccess = 0 ,
  netDNSc_EventTimeout ,
  netDNSc_EventNotResolved ,
  netDNSc_EventError
}
 DNS Client Callback Events. More...
 
enum  netFTP_Command {
  netFTP_CommandPUT ,
  netFTP_CommandGET ,
  netFTP_CommandAPPEND ,
  netFTP_CommandDELETE ,
  netFTP_CommandLIST ,
  netFTP_CommandRENAME ,
  netFTP_CommandMKDIR ,
  netFTP_CommandRMDIR ,
  netFTP_CommandNLIST
}
 FTP Commands. More...
 
enum  netFTPs_Event {
  netFTPs_EventLogin ,
  netFTPs_EventLogout ,
  netFTPs_EventLoginFailed ,
  netFTPs_EventDownload ,
  netFTPs_EventUpload ,
  netFTPs_EventDelete ,
  netFTPs_EventRename ,
  netFTPs_EventMakeDirectory ,
  netFTPs_EventRemoveDirectory ,
  netFTPs_EventOperationDenied ,
  netFTPs_EventLocalFileError ,
  netFTPs_EventFileError ,
  netFTPs_EventError
}
 FTP Server Events. More...
 
enum  netFTPc_Request {
  netFTPc_RequestUsername ,
  netFTPc_RequestPassword ,
  netFTPc_RequestDirectory ,
  netFTPc_RequestName ,
  netFTPc_RequestNewName ,
  netFTPc_RequestListMask ,
  netFTPc_RequestList ,
  netFTPc_RequestLocalFilename
}
 FTP Client Requests. More...
 
enum  netFTPc_Event {
  netFTPc_EventSuccess = 0 ,
  netFTPc_EventTimeout ,
  netFTPc_EventLoginFailed ,
  netFTPc_EventAccessDenied ,
  netFTPc_EventFileNotFound ,
  netFTPc_EventInvalidDirectory ,
  netFTPc_EventLocalFileError ,
  netFTPc_EventError
}
 FTP Client Events. More...
 
enum  netTFTPc_Event {
  netTFTPc_EventSuccess = 0 ,
  netTFTPc_EventTimeout ,
  netTFTPc_EventAccessDenied ,
  netTFTPc_EventFileNotFound ,
  netTFTPc_EventDiskFull ,
  netTFTPc_EventLocalFileError ,
  netTFTPc_EventError
}
 TFTP Client Events. More...
 
enum  netTELNETs_Message {
  netTELNETs_MessageWelcome ,
  netTELNETs_MessageLogin ,
  netTELNETs_MessageUsername ,
  netTELNETs_MessagePassword ,
  netTELNETs_MessageLoginFailed ,
  netTELNETs_MessageLoginTimeout ,
  netTELNETs_MessagePrompt ,
  netTELNETs_MessageUnsolicited
}
 Telnet Server Messages. More...
 
enum  netSMTPc_Request {
  netSMTPc_RequestUsername ,
  netSMTPc_RequestPassword ,
  netSMTPc_RequestSender ,
  netSMTPc_RequestRecipient ,
  netSMTPc_RequestSubject ,
  netSMTPc_RequestBody
}
 SMTP Client Request. More...
 
enum  netSMTPc_Event {
  netSMTPc_EventSuccess = 0 ,
  netSMTPc_EventTimeout ,
  netSMTPc_EventAuthenticationFailed ,
  netSMTPc_EventError
}
 SMTP Client Events. More...
 
enum  netSNTPc_Mode {
  netSNTPc_ModeUnicast = 0 ,
  netSNTPc_ModeBroadcast
}
 SNTP Client Mode. More...
 

Functions

netStatus netInitialize (void)
 Initialize Network Component and interfaces. [not_thread-safe].
 
netStatus netUninitialize (void)
 De-initialize Network Component and interfaces. [not_thread-safe].
 
const char * netSYS_GetHostName (void)
 Retrieve localhost name. [thread-safe].
 
netStatus netSYS_SetHostName (const char *hostname)
 Set localhost name. [thread-safe].
 
int32_t netUDP_GetSocket (netUDP_cb_t cb_func)
 Allocate a free UDP socket. [thread-safe].
 
netStatus netUDP_ReleaseSocket (int32_t socket)
 Release UDP socket and free resources. [thread-safe].
 
netStatus netUDP_Open (int32_t socket, uint16_t port)
 Open UDP socket for communication. [thread-safe].
 
netStatus netUDP_Close (int32_t socket)
 Stop UDP communication and close socket. [thread-safe].
 
uint8_t * netUDP_GetBuffer (uint32_t size)
 Allocate memory for UDP send buffer. [thread-safe].
 
netStatus netUDP_Send (int32_t socket, const NET_ADDR *addr, uint8_t *buf, uint32_t len)
 Send data to a remote node. [thread-safe].
 
netStatus netUDP_SetOption (int32_t socket, netUDP_Option option, uint32_t val)
 Set UDP socket IP option. [thread-safe].
 
uint16_t netUDP_GetLocalPort (int32_t socket)
 Retrieve local port number of UDP socket. [thread-safe].
 
int32_t socket (int32_t family, int32_t type, int32_t protocol)
 Create a communication endpoint called socket. [thread-safe].
 
int32_t bind (int32_t sock, const SOCKADDR *addr, int32_t addrlen)
 Assign a local address and port to a socket. [thread-safe].
 
int32_t listen (int32_t sock, int32_t backlog)
 Set a socket in a listening mode. [thread-safe].
 
int32_t accept (int32_t sock, SOCKADDR *addr, int32_t *addrlen)
 Accept connect request for a listening socket. [thread-safe].
 
int32_t connect (int32_t sock, const SOCKADDR *addr, int32_t addrlen)
 Connect a socket to a remote host. [thread-safe].
 
int32_t send (int32_t sock, const char *buf, int32_t len, int32_t flags)
 Send data on already connected socket. [thread-safe].
 
int32_t sendto (int32_t sock, const char *buf, int32_t len, int32_t flags, const SOCKADDR *to, int32_t tolen)
 Send data to endpoint node. [thread-safe].
 
int32_t sendmsg (int32_t sock, const MSGHDR *msg, int32_t flags)
 Send a message to endpoint node. [thread-safe].
 
int32_t recv (int32_t sock, char *buf, int32_t len, int32_t flags)
 Receive data on already connected socket. [thread-safe].
 
int32_t recvfrom (int32_t sock, char *buf, int32_t len, int32_t flags, SOCKADDR *from, int32_t *fromlen)
 Receive data from endpoint node. [thread-safe].
 
int32_t recvmsg (int32_t sock, MSGHDR *msg, int32_t flags)
 Receive a message from a socket. [thread-safe].
 
int32_t closesocket (int32_t sock)
 Close socket and release socket descriptor. [thread-safe].
 
int32_t getpeername (int32_t sock, SOCKADDR *name, int32_t *namelen)
 Retrieve IP address and port number of the endpoint node. [thread-safe].
 
int32_t getsockname (int32_t sock, SOCKADDR *name, int32_t *namelen)
 Retrieve local IP address and port number. [thread-safe].
 
int32_t getsockopt (int32_t sock, int32_t level, int32_t optname, char *optval, int32_t *optlen)
 Retrieve options for the socket. [thread-safe].
 
int32_t setsockopt (int32_t sock, int32_t level, int32_t optname, const char *optval, int32_t optlen)
 Manipulate options for the socket. [thread-safe].
 
int32_t ioctlsocket (int32_t sock, long cmd, unsigned long *argp)
 Control IO mode of a socket. [thread-safe].
 
int32_t select (int32_t nfds, fd_set *readfds, fd_set *writefds, fd_set *errorfds, struct timeval *timeout)
 Check the status of one or more sockets. [thread-safe].
 
HOSTENTgethostbyname (const char *name, int32_t *err)
 Retrieve host IP address from host name. [thread-safe].
 
IN_ADDR inet_addr (const char *cp)
 Convert from text address to a network address. [thread-safe].
 
int32_t inet_aton (const char *cp, IN_ADDR *addr)
 Convert from text address to a network address. [thread-safe].
 
const char * inet_ntoa (IN_ADDR in)
 Convert from network address to a text string. [not_thread-safe].
 
int32_t inet_pton (int32_t af, const char *src, void *dst)
 Convert from text address to a binary network address. [thread-safe].
 
const char * inet_ntop (int32_t af, const void *src, char *dst, int32_t size)
 Convert from binary network address to a text string. [thread-safe].
 
netStatus netIF_GetOption (uint32_t if_id, netIF_Option option, uint8_t *buf, uint32_t buf_len)
 Get the current value of an Interface option. [thread-safe].
 
netStatus netIF_SetOption (uint32_t if_id, netIF_Option option, const uint8_t *buf, uint32_t buf_len)
 Set the value of an Interface option. [thread-safe].
 
netStatus netIF_SetDefault (uint32_t if_id, netIF_Version ip_version)
 Set default network interface for Internet access. [thread-safe].
 
netStatus netICMP_SetNoEcho (uint32_t if_id, bool no_echo)
 Enable or disable ICMP Echo response. [thread-safe].
 
netStatus netICMP6_SetNoEcho (uint32_t if_id, bool no_echo)
 Enable or disable ICMPv6 Echo response. [thread-safe].
 
netStatus netETH_SendRaw (uint32_t if_num, const uint8_t *buf, uint32_t len)
 Send raw Ethernet data. [thread-safe].
 
netStatus netARP_CacheIP (uint32_t if_id, const uint8_t *ip4_addr, netARP_CacheType type)
 Determine whether the ARP table has MAC address resolved for requested IP address. [thread-safe].
 
netStatus netARP_CacheMAC (uint32_t if_id, const uint8_t *mac_addr)
 Determine whether the ARP table has IP address resolved for requested MAC address. [thread-safe].
 
netStatus netARP_GetIP (uint32_t if_id, const uint8_t *mac_addr, uint8_t *ip4_addr)
 Get IP address from the ARP cache. [thread-safe].
 
netStatus netARP_GetMAC (uint32_t if_id, const uint8_t *ip4_addr, uint8_t *mac_addr)
 Get MAC address from the ARP cache. [thread-safe].
 
netStatus netARP_Probe (uint32_t if_id, const uint8_t *ip4_addr, netARP_cb_t cb_func)
 Determine whether the IP address is already in use. [thread-safe].
 
netStatus netARP_ProbeX (uint32_t if_id, const uint8_t *ip4_addr)
 Determine whether the IP address is already in use in blocking mode. [thread-safe].
 
netStatus netARP_AddCache (uint32_t if_id, const uint8_t *ip4_addr, const uint8_t *mac_addr)
 Add the host as a static entry in the local ARP cache table. [thread-safe].
 
netStatus netARP_ClearCache (uint32_t if_id)
 Flush or clear the local ARP cache. [thread-safe].
 
netStatus netNDP_CacheIP (uint32_t if_id, const uint8_t *ip6_addr)
 Determine whether neighbor cache has MAC address resolved for requested IP address. [thread-safe].
 
netStatus netNDP_GetIP (uint32_t if_id, const uint8_t *mac_addr, uint8_t *ip6_addr)
 Get IP address from neighbor discovery cache. [thread-safe].
 
netStatus netNDP_GetMAC (uint32_t if_id, const uint8_t *ip6_addr, uint8_t *mac_addr)
 Get MAC address from neighbor discovery cache. [thread-safe].
 
netStatus netNDP_Probe (uint32_t if_id, const uint8_t *ip6_addr, netNDP_cb_t cb_func)
 Determine whether the IP address is already in use. [thread-safe].
 
netStatus netNDP_ProbeX (uint32_t if_id, const uint8_t *ip6_addr)
 Determine whether the IP address is already in use in blocking mode. [thread-safe].
 
netStatus netNDP_ClearCache (uint32_t if_id)
 Flush or clear the local NDP cache. [thread-safe].
 
netStatus netIGMP_Join (uint32_t if_id, const uint8_t *ip4_addr)
 Join this host to a host group specified with IP address. [thread-safe].
 
netStatus netIGMP_Leave (uint32_t if_id, const uint8_t *ip4_addr)
 Leave a host group specified with IP address. [thread-safe].
 
netStatus netMLD_Join (uint32_t if_id, const uint8_t *ip6_addr)
 Join this node to a multicast group specified with IP address. [thread-safe].
 
netStatus netMLD_Leave (uint32_t if_id, const uint8_t *ip6_addr)
 Leave a multicast group specified with IP address. [thread-safe].
 
netStatus netNBNS_Resolve (uint32_t if_id, const char *name, uint8_t *ip4_addr)
 Resolve IP address of a host from a NetBIOS hostname. [thread-safe].
 
netStatus netNBNS_ClearCache (uint32_t if_id)
 Flush or clear the local NBNS cache. [thread-safe].
 
netStatus netDHCP_Enable (uint32_t if_id)
 Enable Dynamic Host Configuration at runtime. [thread-safe].
 
netStatus netDHCP_Disable (uint32_t if_id)
 Disable Dynamic Host Configuration at runtime. [thread-safe].
 
netStatus netDHCP_SetOption (uint32_t if_id, uint8_t option, const uint8_t *val, uint32_t len)
 Set DHCP Option value at runtime. [thread-safe].
 
netStatus netDHCP6_Enable (uint32_t if_id, netDHCP6_Mode mode)
 Enable Dynamic Host Configuration version 6 at runtime. [thread-safe].
 
netStatus netDHCP6_Disable (uint32_t if_id)
 Disable Dynamic Host Configuration version 6 at runtime. [thread-safe].
 
void netETH_Notify (uint32_t if_num, netETH_Event event, uint32_t val)
 Notify the user of Ethernet link state change event. [user-provided].
 
void netETH_ReceiveRaw (uint32_t if_num, const uint8_t *buf, uint32_t len)
 Receive raw Ethernet data. [user-provided].
 
void netDHCP_Notify (uint32_t if_id, uint8_t option, const uint8_t *val, uint32_t len)
 Notify the user of DHCP event or extended DHCP option. [user-provided].
 
void netDHCP6_Notify (uint32_t if_id, uint8_t option, const uint8_t *val, uint32_t len)
 Notify the user of DHCPv6 event or extended DHCPv6 option. [user-provided].
 
netStatus netWiFi_Scan (uint32_t if_num, NET_WIFI_SCAN_INFO scan_info[], uint32_t *scan_num)
 Search for available WiFi networks. [thread-safe].
 
netStatus netWiFi_GetOption (uint32_t if_num, netWiFi_Option option, void *buf, uint32_t buf_len)
 Get the value of the WiFi driver option. [thread-safe].
 
netStatus netWiFi_SetOption (uint32_t if_num, netWiFi_Option option, const void *buf, uint32_t buf_len)
 Set the value of the WiFi driver option. [thread-safe].
 
netStatus netWiFi_Activate (uint32_t if_num, const NET_WIFI_CONFIG *config)
 Activate the WiFi interface. [thread-safe].
 
netStatus netWiFi_Deactivate (uint32_t if_num)
 Deactivate the WiFi interface. [thread-safe].
 
bool netWiFi_IsConnected (uint32_t if_num)
 Get the connection state of the WiFi interface. [thread-safe].
 
netStatus netWiFi_GetNetInfo (uint32_t if_num, NET_WIFI_NET_INFO *net_info)
 Get the network information of the WiFi interface. [thread-safe].
 
netStatus netPPP_Listen (const char *username, const char *password)
 Start PPP interface to accept incoming PPP connection. [thread-safe].
 
netStatus netPPP_Connect (const char *dial_num, const char *username, const char *password)
 Start a dial-up connection to remote PPP server. [thread-safe].
 
netStatus netPPP_Close (void)
 Disconnect PPP link between two modems. [thread-safe].
 
bool netPPP_LinkUp (void)
 Determine the state of PPP link. [thread-safe].
 
netStatus netSLIP_Listen (void)
 Start SLIP interface to accept incoming SLIP connections. [thread-safe].
 
netStatus netSLIP_Connect (const char *dial_num)
 Start a dial-up connection to remote SLIP server. [thread-safe].
 
netStatus netSLIP_Close (void)
 Disconnect SLIP link between two modems. [thread-safe].
 
bool netSLIP_LinkUp (void)
 Determine the state of SLIP link. [thread-safe].
 
netStatus netPing_Echo (const NET_ADDR *addr, netPing_cb_t cb_func)
 Start ICMP ping process. [thread-safe].
 
netStatus netPing_EchoX (const char *target, uint32_t flags)
 Start ICMP ping process in blocking mode. [thread-safe].
 
netStatus netDNSc_GetHostByName (const char *name, int16_t addr_type, netDNSc_cb_t cb_func)
 Resolve IP address of a host from a hostname. [thread-safe].
 
netStatus netDNSc_GetHostByNameX (const char *name, int16_t addr_type, NET_ADDR *addr)
 Resolve IP address of a host from a hostname in blocking mode. [thread-safe].
 
netStatus netDNSc_ClearCache (void)
 Flush or clear the local DNS cache. [thread-safe].
 
netStatus netFTPs_Start (void)
 Start FTP server. [thread-safe].
 
netStatus netFTPs_Stop (void)
 Stop FTP server. [thread-safe].
 
bool netFTPs_Running (void)
 Check if FTP server is running. [thread-safe].
 
uint16_t netFTPs_GetPort (void)
 Get port number of FTP server. [thread-safe].
 
netStatus netFTPs_SetPort (uint16_t port)
 Set port number of FTP server. [thread-safe].
 
const char * netFTPs_GetRootPath (void)
 Retrieve path to the root directory on FTP server. [thread-safe].
 
netStatus netFTPs_SetRootPath (const char *path)
 Set path to the root directory on FTP server. [thread-safe].
 
const char * netFTPs_GetUsername (void)
 Retrieve username of the built-in user account. [thread-safe].
 
netStatus netFTPs_SetUsername (const char *username)
 Set username of the built-in user account. [thread-safe].
 
const char * netFTPs_GetPassword (void)
 Retrieve password of the built-in user account. [thread-safe].
 
netStatus netFTPs_SetPassword (const char *password)
 Reset password of the built-in user account. [thread-safe].
 
bool netFTPs_LoginActive (void)
 Determine if FTP server authentication is enabled. [thread-safe].
 
netStatus netFTPs_LoginOnOff (bool login)
 Enable or disable FTP server authentication. [thread-safe].
 
bool netFTPs_AcceptClient (const NET_ADDR *addr)
 Accept or deny connection from remote FTP client. [user-provided].
 
uint8_t netFTPs_CheckUsername (const char *username)
 Check if an user account exists in the user database. [user-provided].
 
bool netFTPs_CheckPassword (uint8_t user_id, const char *password)
 Check user account password in the user database. [user-provided].
 
bool netFTPs_FileAccess (uint8_t user_id, const char *fname, uint32_t access)
 Check if remote user is allowed to access a file on FTP server. [user-provided].
 
uint8_t netFTPs_GetUserId (void)
 Retrieve the user identification number. [thread-safe].
 
void netFTPs_Notify (netFTPs_Event event)
 Notify the user application about events in FTP server service. [user-provided].
 
void * netFTPs_fopen (const char *fname, const char *mode)
 Open a file for reading or writing on FTP server. [interface].
 
void netFTPs_fclose (void *file)
 Close a file previously open on FTP server. [interface].
 
uint32_t netFTPs_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from a file on FTP server. [interface].
 
uint32_t netFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len)
 Write block of data to a file on FTP server. [interface].
 
bool netFTPs_fdelete (const char *fname)
 Delete a file on FTP server. [interface].
 
bool netFTPs_frename (const char *fname, const char *newname)
 Rename a file or directory on FTP server. [interface].
 
bool netFTPs_mkdir (const char *path)
 Make a new directory on FTP server. [interface].
 
bool netFTPs_rmdir (const char *path)
 Remove an empty directory on FTP server. [interface].
 
bool netFTPs_chdir (const char *path)
 Check that the directory exists on FTP server. [interface].
 
int32_t netFTPs_ffind (const char *mask, char *fname, uint32_t *fsize, NET_FS_TIME *ftime, bool first)
 Search the file system directory for matching files. [interface].
 
netStatus netFTPc_Connect (const NET_ADDR *addr, netFTP_Command command)
 Start FTP client file operation session. [thread-safe].
 
uint32_t netFTPc_Process (netFTPc_Request request, char *buf, uint32_t buf_len)
 Request parameters for FTP client session. [user-provided].
 
void netFTPc_Notify (netFTPc_Event event)
 Notify the user application when FTP client operation ends. [user-provided].
 
void * netFTPc_fopen (const char *fname, const char *mode)
 Open local file for reading or writing in FTP client. [interface].
 
void netFTPc_fclose (void *file)
 Close local file previously open in FTP client. [interface].
 
uint32_t netFTPc_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from local file in FTP client. [interface].
 
uint32_t netFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len)
 Write block of data to local file in FTP client. [interface].
 
netStatus netTFTPs_Start (void)
 Start the TFTP server. [thread-safe].
 
netStatus netTFTPs_Stop (void)
 Stop the TFTP server. [thread-safe].
 
bool netTFTPs_Running (void)
 Check if the TFTP server is running. [thread-safe].
 
uint16_t netTFTPs_GetPort (void)
 Get port number of the TFTP server. [thread-safe].
 
netStatus netTFTPs_SetPort (uint16_t port)
 Set port number of the TFTP server. [thread-safe].
 
const char * netTFTPs_GetRootPath (void)
 Retrieve path to the root directory on TFTP server. [thread-safe].
 
netStatus netTFTPs_SetRootPath (const char *path)
 Set path to the root directory on TFTP server. [thread-safe].
 
bool netTFTPs_AcceptClient (const NET_ADDR *addr)
 Accept or deny connection from a remote TFTP client. [user-provided].
 
void * netTFTPs_fopen (const char *fname, const char *mode)
 Open a file for reading or writing on the TFTP server. [interface].
 
void netTFTPs_fclose (void *file)
 Close a file previously open on the TFTP server. [interface].
 
uint32_t netTFTPs_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from a file on the TFTP server. [interface].
 
uint32_t netTFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len)
 Write block of data to a file on the TFTP server. [interface].
 
netStatus netTFTPc_Put (const NET_ADDR *addr, const char *fname, const char *local_fname)
 Put a file to a remote TFTP server. [thread-safe].
 
netStatus netTFTPc_Get (const NET_ADDR *addr, const char *fname, const char *local_fname)
 Retrieve a file from a remote TFTP server. [thread-safe].
 
void netTFTPc_Notify (netTFTPc_Event event)
 Notify the user application when TFTP client operation ends. [user-provided].
 
void * netTFTPc_fopen (const char *fname, const char *mode)
 Open local file for reading or writing in the TFTP client. [interface].
 
void netTFTPc_fclose (void *file)
 Close local file previously open in the TFTP client. [interface].
 
uint32_t netTFTPc_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from local file in the TFTP client. [interface].
 
uint32_t netTFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len)
 Write block of data to local file in the TFTP client. [interface].
 
netStatus netTELNETs_Start (void)
 Start the Telnet server. [thread-safe].
 
netStatus netTELNETs_Stop (void)
 Stop the Telnet server. [thread-safe].
 
bool netTELNETs_Running (void)
 Check if the Telnet server is running. [thread-safe].
 
uint16_t netTELNETs_GetPort (void)
 Get port number of the Telnet server. [thread-safe].
 
netStatus netTELNETs_SetPort (uint16_t port)
 Set port number of the Telnet server. [thread-safe].
 
const char * netTELNETs_GetUsername (void)
 Retrieve username of the built-in user account. [thread-safe].
 
netStatus netTELNETs_SetUsername (const char *username)
 Set username of the built-in user account. [thread-safe].
 
const char * netTELNETs_GetPassword (void)
 Retrieve password of the built-in user account. [thread-safe].
 
netStatus netTELNETs_SetPassword (const char *password)
 Reset password of the built-in user account. [thread-safe].
 
bool netTELNETs_LoginActive (void)
 Determine if Telnet server authentication is enabled. [thread-safe].
 
netStatus netTELNETs_LoginOnOff (bool login)
 Enable or disable Telnet server authentication. [thread-safe].
 
netStatus netTELNETs_GetClient (NET_ADDR *addr, uint32_t addr_len)
 Get IP address and port number of a connected Telnet client. [thread-safe].
 
int32_t netTELNETs_GetSession (void)
 Get current session number of the Telnet server. [thread-safe].
 
bool netTELNETs_CheckCommand (const char *cmd, const char *user_cmd)
 Check command string for a command. [thread-safe].
 
netStatus netTELNETs_RepeatCommand (uint32_t delay)
 Request a repeated call to netTELNETs_ProcessCommand function. [thread-safe].
 
netStatus netTELNETs_RequestMessage (int32_t session)
 Request unsolicited message processing in netTELNETs_ProcessMessage function. [thread-safe].
 
uint32_t netTELNETs_ProcessCommand (const char *cmd, char *buf, uint32_t buf_len, uint32_t *pvar)
 Process and execute a command requested by the Telnet client. [user-provided].
 
uint32_t netTELNETs_ProcessMessage (netTELNETs_Message msg, char *buf, uint32_t buf_len)
 Request a message for a Telnet server session. [user-provided].
 
bool netTELNETs_AcceptClient (const NET_ADDR *addr)
 Accept or deny a connection from a remote Telnet client. [user-provided].
 
uint8_t netTELNETs_CheckUsername (const char *username)
 Check if an user account exist in the user database. [user-provided].
 
bool netTELNETs_CheckPassword (uint8_t user_id, const char *password)
 Check user account password in the user database. [user-provided].
 
uint8_t netTELNETs_GetUserId (void)
 Retrieve the user identification number. [thread-safe].
 
netStatus netHTTPs_Start (void)
 Start the HTTP server. [thread-safe].
 
netStatus netHTTPs_Stop (void)
 Stop the HTTP server. [thread-safe].
 
bool netHTTPs_Running (void)
 Check if the HTTP server is running. [thread-safe].
 
uint16_t netHTTPs_GetPort (void)
 Get port number of the HTTP server. [thread-safe].
 
netStatus netHTTPs_SetPort (uint16_t port)
 Set port number of the HTTP server. [thread-safe].
 
const char * netHTTPs_GetRootPath (void)
 Retrieve path to the root directory on HTTP server. [thread-safe].
 
netStatus netHTTPs_SetRootPath (const char *path)
 Set path to the root directory on HTTP server. [thread-safe].
 
const char * netHTTPs_GetUsername (void)
 Retrieve username of the built-in user account. [thread-safe].
 
netStatus netHTTPs_SetUsername (const char *username)
 Set username of the built-in user account. [thread-safe].
 
const char * netHTTPs_GetPassword (void)
 Retrieve password of the built-in user account. [thread-safe].
 
netStatus netHTTPs_SetPassword (const char *password)
 Reset password of the built-in user account. [thread-safe].
 
bool netHTTPs_LoginActive (void)
 Determine if the HTTP server authentication is enabled. [thread-safe].
 
netStatus netHTTPs_LoginOnOff (bool login)
 Enable or disable HTTP server authentication. [thread-safe].
 
netStatus netHTTPs_GetClient (NET_ADDR *addr, uint32_t addr_len)
 Get IP address and port number of a connected remote HTTP client. [thread-safe].
 
int32_t netHTTPs_GetSession (void)
 Get current session number of the HTTP server. [thread-safe].
 
const char * netHTTPs_GetLanguage (void)
 Retrieve the preferred language setting from the browser. [thread-safe].
 
const char * netHTTPs_GetContentType (void)
 Get Content-Type HTML header, received in XML post request. [thread-safe].
 
bool netHTTPs_AcceptClient (const NET_ADDR *addr)
 Accept or deny a connection from a remote HTTP client. [user-provided].
 
uint8_t netHTTPs_CheckAccount (const char *username, const char *password)
 Check if an user account exist in the user database. [user-provided].
 
void netHTTPs_GetUserSecret (uint8_t user_id, char *buf, uint32_t buf_len)
 Retrieve the secret word for the selected user. [user-provided].
 
bool netHTTPs_FileAccess (uint8_t user_id, const char *fname)
 Check if remote user is allowed to access a file on HTTP server. [user-provided].
 
uint8_t netHTTPs_GetUserId (void)
 Retrieve the user identification. [thread-safe].
 
netStatus netHTTPs_CalcHashHA1 (const char *username, const char *password, char *buf, uint32_t buf_len)
 Calculate HA1 hash value for the given credentials. [thread-safe].
 
void * netHTTPs_fopen (const char *fname)
 Open a file for reading on HTTP server. [interface].
 
void netHTTPs_fclose (void *file)
 Close a file previously open on HTTP server. [interface].
 
uint32_t netHTTPs_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from a file on HTTP server. [interface].
 
char * netHTTPs_fgets (void *file, char *buf, uint32_t size)
 Read a string from a file on HTTP server. [interface].
 
void netHTTPs_fstat (const char *fname, uint32_t *fsize, uint32_t *ftime)
 Retrieve file size and last modification time. [interface].
 
void netCGI_ProcessQuery (const char *qstr)
 Process query string received by GET or POST request. [user-provided].
 
void netCGI_ProcessData (uint8_t code, const char *data, uint32_t len)
 Process data received by POST request. [user-provided].
 
uint32_t netCGI_Script (const char *env, char *buf, uint32_t buf_len, uint32_t *pcgi)
 Generate dynamic web data based on a CGI script. [user-provided].
 
const char * netCGI_GetEnvVar (const char *env, char *ansi, uint32_t max_len)
 Process environment variables and convert to ANSI format. [thread-safe].
 
const char * netCGI_Charset (void)
 Override default character encoding in HTML documents. [user-provided].
 
const char * netCGI_ContentType (const char *file_ext)
 Add custom MIME type for unsupported file types. [user-provided].
 
const char * netCGI_Redirect (const char *file_name)
 Redirect resource URL address to a new location. [user-provided].
 
const char * netCGX_ContentType (void)
 Override default Content-Type for CGX script files. [user-provided].
 
const char * netCGI_CustomHeader (void)
 Add custom HTTP response header. [user-provided].
 
netStatus netCGI_SetCookie (const char *cookie)
 Set HTTP cookie to send to the client. [thread-safe].
 
void netCGI_ProcessRequest (const char *method, const char *uri, const char *header, uint32_t header_len)
 Process HTTP request. [user-provided].
 
void netCGI_ProcessCookie (const char *method, const char *uri, const char *cookie, uint32_t cookie_len)
 Process HTTP cookie. [user-provided].
 
netStatus netSMTPc_Connect (const NET_ADDR *addr)
 Start SMTP client to send an email in legacy mode. [thread-safe].
 
netStatus netSMTPc_SendMail (const NET_SMTP_MAIL *mail, const NET_SMTP_MTA *mta)
 Send an email in blocking mode. [thread-safe].
 
uint32_t netSMTPc_Process (netSMTPc_Request request, char *buf, uint32_t buf_len, uint32_t *pvar)
 Request parameters for SMTP client session. [user-provided].
 
void netSMTPc_Notify (netSMTPc_Event event)
 Notify the user application when SMTP client operation ends. [user-provided].
 
bool netSMTPc_AcceptAuthentication (const NET_ADDR *addr)
 Accept or deny authentication requested by SMTP server. [user-provided].
 
void * netSMTPc_fopen (const char *fname)
 Open a file for reading in SMTP client. [interface].
 
void netSMTPc_fclose (void *file)
 Close a file previously open in SMTP client. [interface].
 
uint32_t netSMTPc_fread (void *file, uint8_t *buf, uint32_t len)
 Read block of data from a file in SMTP client. [interface].
 
netStatus netSNTPc_SetMode (netSNTPc_Mode mode)
 Set mode of operation for SNTP client. [thread-safe].
 
netStatus netSNTPc_GetTime (const NET_ADDR *addr, netSNTPc_cb_t cb_func)
 Determine current time from NTP or SNTP time server. [thread-safe].
 
netStatus netSNTPc_GetTimeX (const char *server, uint32_t *seconds, uint32_t *seconds_fraction)
 Determine current time from NTP or SNTP time server in blocking mode. [thread-safe].
 
netStatus netSNMP_Trap (const NET_ADDR *addr, uint8_t generic, uint8_t specific, const uint16_t *obj_list)
 Send a trap message to the Trap Manager. [thread-safe].
 
netStatus netSNMP_SetCommunity (const char *community)
 Change SNMP community to a new community. [thread-safe].
 
netStatus netSNMP_SetMIB_Table (const NET_SNMP_MIB_INFO *info, uint32_t size)
 Register MIB table to SNMP Agent. [thread-safe].
 
const char * netIP_ntoa (int16_t addr_type, const uint8_t *ip_addr, char *string_buf, uint32_t buf_len)
 Convert IP address from binary to text form. [thread-safe].
 
bool netIP_aton (const char *addr_string, int16_t addr_type, uint8_t *ip_addr)
 Convert IP address from text to binary form. [thread-safe].
 
const char * netMAC_ntoa (const uint8_t *mac_addr, char *string_buf, uint32_t buf_len)
 Convert MAC address from binary to text form. [thread-safe].
 
bool netMAC_aton (const char *mac_string, uint8_t *mac_addr)
 Convert MAC address from text to binary form. [thread-safe].
 
int32_t netTCP_GetSocket (netTCP_cb_t cb_func)
 Allocate a free TCP socket. [thread-safe].
 
netStatus netTCP_ReleaseSocket (int32_t socket)
 Release TCP socket and free resources. [thread-safe].
 
netStatus netTCP_Listen (int32_t socket, uint16_t port)
 Open TCP socket for incoming connection. [thread-safe].
 
netStatus netTCP_Connect (int32_t socket, const NET_ADDR *addr, uint16_t local_port)
 Initiate a TCP connection to a remote node. [thread-safe].
 
netStatus netTCP_Close (int32_t socket)
 Stop TCP communication and start closing procedure. [thread-safe].
 
netStatus netTCP_Abort (int32_t socket)
 Instantly stop TCP communication. [thread-safe].
 
uint32_t netTCP_GetMaxSegmentSize (int32_t socket)
 Determine maximum number of data bytes that can be sent in TCP packet. [thread-safe].
 
uint8_t * netTCP_GetBuffer (uint32_t size)
 Allocate memory for TCP send buffer. [thread-safe].
 
bool netTCP_SendReady (int32_t socket)
 Check if TCP socket can send data. [thread-safe].
 
netStatus netTCP_Send (int32_t socket, uint8_t *buf, uint32_t len)
 Send a data packet to remote node. [thread-safe].
 
netTCP_State netTCP_GetState (int32_t socket)
 Determine current state of a TCP socket. [thread-safe].
 
netStatus netTCP_ResetReceiveWindow (int32_t socket)
 Reset TCP window size to a default value from the configuration. [thread-safe].
 
netStatus netTCP_SetOption (int32_t socket, netTCP_Option option, uint32_t val)
 Set TCP socket IP option. [thread-safe].
 
uint16_t netTCP_GetLocalPort (int32_t socket)
 Retrieve local port number of TCP socket. [thread-safe].
 
netStatus netTCP_GetPeer (int32_t socket, NET_ADDR *addr, uint32_t addr_len)
 Retrieve IP address and port number of remote peer. [thread-safe].
 
uint32_t netTCP_GetTimer (int32_t socket)
 Determine TCP socket connection timeout. [thread-safe].
 

Variables

const IN6_ADDR in6addr_any
 BSD Internet Addresses IPv6.
 
const IN6_ADDR in6addr_loopback
 Localhost IPv6 address.
 
NET_DHCP_OPTION_ITEM netDHCP_PrivateOptionsTableN []
 DHCP Private Options.
 
uint8_t netDHCP_PrivateOptionsCountN
 Number of DHCP Private Options.
 

Data Structure Documentation

◆ NET_SNMP_BYTE_STR

struct NET_SNMP_BYTE_STR

SNMP-MIB byte-string.

Data Fields
uint8_t data[] String content.
uint8_t len Length of a string.

◆ NET_FS_TIME

struct NET_FS_TIME

FS Interface Time info.

Data Fields
uint8_t day Day [1..31].
uint8_t hr Hours [0..23].
uint8_t min Minutes [0..59].
uint8_t mon Month [1..12].
uint8_t sec Seconds [0..59].
uint16_t year Year [1980..2107].

Macro Definition Documentation

◆ AF_INET

#define AF_INET   1

Internet Address Family.

◆ AF_INET6

#define AF_INET6   3

Internet Address Family version 6.

◆ AF_NETBIOS

#define AF_NETBIOS   2

NetBios-style addresses.

◆ AF_UNSPEC

#define AF_UNSPEC   0

BSD Socket Address Family.

Unspecified

◆ CMSG_ALIGN

#define CMSG_ALIGN (   len)    (((len) + 3) & ~3U)

◆ CMSG_DATA

#define CMSG_DATA (   cmsg)    ((uint8_t *)(cmsg) + sizeof(CMSGHDR))

◆ CMSG_FIRSTHDR

#define CMSG_FIRSTHDR (   mhdr)
Value:
((mhdr)->msg_controllen >= sizeof(CMSGHDR)) ? \
(CMSGHDR *)(mhdr)->msg_control : \
(CMSGHDR *)NULL

BSD access ancillary data macros (RFC 2292).

◆ CMSG_LEN

#define CMSG_LEN (   len)    ((len) + sizeof(CMSGHDR))

◆ CMSG_NXTHDR

#define CMSG_NXTHDR (   mhdr,
  cmsg 
)
Value:
(CMSG_ALIGN((uint32_t)(cmsg) + (cmsg)->cmsg_len) + sizeof(CMSGHDR) > \
(uint32_t)(mhdr)->msg_control + (mhdr)->msg_controllen) ? \
(CMSGHDR *)NULL : \
(CMSGHDR *)CMSG_ALIGN((uint32_t)(cmsg) + (cmsg)->cmsg_len)

◆ CMSG_SPACE

#define CMSG_SPACE (   len)    CMSG_ALIGN((len) + sizeof(CMSGHDR))

◆ FD_CLR

#define FD_CLR (   fd,
  set 
)    FD_WR(fd, (set)->fd_bits[(fd-1)>>5] &= ~(1U << ((fd-1)&0x1F)))

◆ FD_ISSET

#define FD_ISSET (   fd,
  set 
)    FD_RD(fd, (set)->fd_bits[(fd-1)>>5] & (1U << ((fd-1)&0x1F)))

◆ FD_RD

#define FD_RD (   fd,
  code 
)    (((fd > 0) && (fd <= FD_SETSIZE)) ? (code) : 0)

◆ FD_SET

#define FD_SET (   fd,
  set 
)    FD_WR(fd, (set)->fd_bits[(fd-1)>>5] |= (1U << ((fd-1)&0x1F)))

BSD initialize and test fd_set macros.

◆ FD_SETSIZE

#define FD_SETSIZE   64

BSD fd_set size.

Maximum number of sockets in fd_set structure

◆ FD_WR

#define FD_WR (   fd,
  code 
)    if ((fd > 0) && (fd <= FD_SETSIZE)) { code; }

BSD safe read/write fd_set macros.

◆ FD_ZERO

#define FD_ZERO (   set)    memset(set, 0, sizeof(*set))

◆ FIONBIO

#define FIONBIO   1

BSD Socket ioctl commands.

Set mode (blocking/non-blocking)

◆ htonl

#define htonl (   v)    ntohl(v)

◆ htons

#define htons (   v)    ntohs(v)

Host to network byte order conversion.

◆ INADDR_ANY

#define INADDR_ANY   0x00000000

BSD Internet Addresses IPv4.

All IP addresses accepted

◆ INADDR_LOOPBACK

#define INADDR_LOOPBACK   0x7f000001

Localhost IP address.

◆ INADDR_NONE

#define INADDR_NONE   0xffffffff

No IP address accepted.

◆ INET6_ADDRSTRLEN

#define INET6_ADDRSTRLEN   46

IP6 address string length.

◆ INET_ADDRSTRLEN

#define INET_ADDRSTRLEN   16

BSD address string length.

IP address string length

◆ IP_RECVDSTADDR

#define IP_RECVDSTADDR   3

Receive destination IPv4 address.

◆ IP_TOS

#define IP_TOS   1

BSD Socket IPv4 options.

Type of Service (TOS)

◆ IP_TTL

#define IP_TTL   2

Time to Live (TTL)

◆ IPPROTO_IP

#define IPPROTO_IP   2

IPv4 Level.

◆ IPPROTO_IPV6

#define IPPROTO_IPV6   3

IPv6 Level.

◆ IPPROTO_TCP

#define IPPROTO_TCP   1

BSD Socket Protocol.

TCP Protocol

◆ IPPROTO_UDP

#define IPPROTO_UDP   2

UDP Protocol.

◆ IPV6_MULTICAST_HOPS

#define IPV6_MULTICAST_HOPS   2

Multi-cast Hop Limit.

◆ IPV6_RECVDSTADDR

#define IPV6_RECVDSTADDR   3

Receive destination IPv6 address.

◆ IPV6_TCLASS

#define IPV6_TCLASS   1

BSD Socket IPv6 options.

Traffic Class

◆ IPV6_V6ONLY

#define IPV6_V6ONLY   4

Restrict to IPv6 communications only (default on)

◆ MSG_CTRUNC

#define MSG_CTRUNC   0x08

Control data was truncated.

◆ MSG_DONTWAIT

#define MSG_DONTWAIT   0x01

BSD Socket flags parameter.

Enables non-blocking operation

◆ MSG_PEEK

#define MSG_PEEK   0x02

Peeks at the incoming data.

◆ MSG_TRUNC

#define MSG_TRUNC   0x04

Normal data was truncated.

◆ MW_NET_VERSION_MAJOR

#define MW_NET_VERSION_MAJOR   8

Network component version.

◆ MW_NET_VERSION_MINOR

#define MW_NET_VERSION_MINOR   0

◆ MW_NET_VERSION_PATCH

#define MW_NET_VERSION_PATCH   0

◆ NET_ACCESS_DIRECTORY_CREATE

#define NET_ACCESS_DIRECTORY_CREATE   0x04

Directory Create is allowed.

◆ NET_ACCESS_DIRECTORY_LIST

#define NET_ACCESS_DIRECTORY_LIST   0x10

Directory List is allowed.

◆ NET_ACCESS_DIRECTORY_REMOVE

#define NET_ACCESS_DIRECTORY_REMOVE   0x08

Directory Remove is allowed.

◆ NET_ACCESS_FILE_READ

#define NET_ACCESS_FILE_READ   0x01

Network Access definitions.

File Read is allowed

◆ NET_ACCESS_FILE_WRITE

#define NET_ACCESS_FILE_WRITE   0x02

File Write is allowed.

◆ NET_ADDR_ANY

#define NET_ADDR_ANY   (-1)

Network Address types.

IP address any

◆ NET_ADDR_ETH_LEN

#define NET_ADDR_ETH_LEN   6

General definitions.

Ethernet MAC Address Length in bytes

◆ NET_ADDR_IP4

#define NET_ADDR_IP4   0

IPv4 Address.

◆ NET_ADDR_IP4_LEN

#define NET_ADDR_IP4_LEN   4

IPv4 Address Length in bytes.

◆ NET_ADDR_IP6

#define NET_ADDR_IP6   1

IPv6 Address.

◆ NET_ADDR_IP6_LEN

#define NET_ADDR_IP6_LEN   16

IPv6 Address Length in bytes.

◆ NET_DHCP6_OPTION_IP_ADDRESS

#define NET_DHCP6_OPTION_IP_ADDRESS   0

DHCPv6 Option Codes.

IPv6 address change event

◆ NET_DHCP_OPTION_BOOTFILE_NAME

#define NET_DHCP_OPTION_BOOTFILE_NAME   67

Bootfile name option.

◆ NET_DHCP_OPTION_CLIENT_ID

#define NET_DHCP_OPTION_CLIENT_ID   61

Client-identifier option.

◆ NET_DHCP_OPTION_IP_ADDRESS

#define NET_DHCP_OPTION_IP_ADDRESS   0

DHCP Option Codes.

IP address change event

◆ NET_DHCP_OPTION_NTP_SERVERS

#define NET_DHCP_OPTION_NTP_SERVERS   42

NTP Servers option.

◆ NET_ETH_DUPLEX_FULL

#define NET_ETH_DUPLEX_FULL   1

Full duplex link.

◆ NET_ETH_DUPLEX_HALF

#define NET_ETH_DUPLEX_HALF   0

Ethernet duplex mode.

Half duplex link

◆ NET_ETH_SPEED_100M

#define NET_ETH_SPEED_100M   1

100 Mbps link speed

◆ NET_ETH_SPEED_10M

#define NET_ETH_SPEED_10M   0

Ethernet link speed.

10 Mbps link speed

◆ NET_ETH_SPEED_1G

#define NET_ETH_SPEED_1G   2

1 Gpbs link speed

◆ NET_FS_ATTR_DIRECTORY

#define NET_FS_ATTR_DIRECTORY   2

Directory entry.

◆ NET_FS_ATTR_FILE

#define NET_FS_ATTR_FILE   1

FS Interface Attributes.

File entry

◆ NET_HOSTNAME_LEN

#define NET_HOSTNAME_LEN   16

Hostname Buffer Length in bytes.

◆ NET_IF_CLASS_ETH

#define NET_IF_CLASS_ETH   (1U << 8)

Interface Class.

Ethernet interface

◆ NET_IF_CLASS_PPP

#define NET_IF_CLASS_PPP   (3U << 8)

PPP interface.

◆ NET_IF_CLASS_SLIP

#define NET_IF_CLASS_SLIP   (4U << 8)

SLIP interface.

◆ NET_IF_CLASS_WIFI

#define NET_IF_CLASS_WIFI   (2U << 8)

WiFi interface.

◆ NET_PASSWORD_LEN

#define NET_PASSWORD_LEN   16

Password Buffer Length in bytes.

◆ NET_PING_IP4_ONLY

#define NET_PING_IP4_ONLY   0x01

Ping Control Flags.

Force using IPv4 only

◆ NET_PING_IP6_ONLY

#define NET_PING_IP6_ONLY   0x02

Force using IPv6 only.

◆ NET_ROOT_DIR_LEN

#define NET_ROOT_DIR_LEN   80

Service Root Folder Length in bytes.

◆ NET_SMTP_MTA_USETLS

#define NET_SMTP_MTA_USETLS   0x01

SMTP Mail Transfer Agent Flags.

Use secure TLS mode (Implicit TLS)

◆ NET_SNMP_MIB_ATR_RO

#define NET_SNMP_MIB_ATR_RO   0x80

MIB entry attribute READ_ONLY.

◆ NET_SNMP_MIB_BYTE_STR

#define NET_SNMP_MIB_BYTE_STR   0x07

MIB entry type BYTE_STRING (length encoded)

◆ NET_SNMP_MIB_COUNTER

#define NET_SNMP_MIB_COUNTER   0x41

MIB entry type COUNTER (uint32_t)

◆ NET_SNMP_MIB_GAUGE

#define NET_SNMP_MIB_GAUGE   0x42

MIB entry type GAUGE (uint32_t)

◆ NET_SNMP_MIB_INT

#define NET_SNMP_MIB_INT (   o)    sizeof(o), (void *)&o

◆ NET_SNMP_MIB_INTEGER

#define NET_SNMP_MIB_INTEGER   0x02

SNMP-MIB definitions.

MIB entry type INTEGER

◆ NET_SNMP_MIB_IP

#define NET_SNMP_MIB_IP (   ip)    4, (void *)&ip

◆ NET_SNMP_MIB_IP_ADDR

#define NET_SNMP_MIB_IP_ADDR   0x40

MIB entry type IP ADDRESS (uint8_t[4])

◆ NET_SNMP_MIB_OBJECT_ID

#define NET_SNMP_MIB_OBJECT_ID   0x06

MIB entry type OBJECT_IDENTIFIER.

◆ NET_SNMP_MIB_OCTET_STR

#define NET_SNMP_MIB_OCTET_STR   0x04

MIB entry type OCTET_STRING (null-terminated)

◆ NET_SNMP_MIB_OID0

#define NET_SNMP_MIB_OID0 (   f,
 
)    (f*40 + s)

◆ NET_SNMP_MIB_OID_SIZE

#define NET_SNMP_MIB_OID_SIZE   17

Max.size of Object ID value.

◆ NET_SNMP_MIB_READ

#define NET_SNMP_MIB_READ   0

MIB entry Read access.

◆ NET_SNMP_MIB_STR

#define NET_SNMP_MIB_STR (   s)    sizeof(s)-1, s

SNMP-MIB macros.

◆ NET_SNMP_MIB_STR_SIZE

#define NET_SNMP_MIB_STR_SIZE   110

Max.size of Octet String variable.

◆ NET_SNMP_MIB_TIME_TICKS

#define NET_SNMP_MIB_TIME_TICKS   0x43

MIB entry type TIME_TICKS.

◆ NET_SNMP_MIB_WRITE

#define NET_SNMP_MIB_WRITE   1

MIB entry Write access.

◆ NET_UDP_CHECKSUM_SEND

#define NET_UDP_CHECKSUM_SEND   0x01

UDP Checksum Options.

Calculate Checksum for UDP send frames (default)

◆ NET_UDP_CHECKSUM_VERIFY

#define NET_UDP_CHECKSUM_VERIFY   0x02

Verify Checksum for received UDP frames (default)

◆ NET_USERNAME_LEN

#define NET_USERNAME_LEN   16

Service Authentication definitions.

Username Buffer Length in bytes

◆ ntohl

#define ntohl (   v)    (uint32_t)__REV(v)

Network to host byte order conversion.

◆ ntohs

#define ntohs (   v)    (uint16_t)__REV16(v)

◆ PF_INET

#define PF_INET   1

Internet Address Family.

◆ PF_INET6

#define PF_INET6   3

Internet Address Family version 6.

◆ PF_NETBIOS

#define PF_NETBIOS   2

NetBios-style addresses.

◆ PF_UNSPEC

#define PF_UNSPEC   0

BSD Protocol families (same as address families).

Unspecified

◆ SO_BINDTODEVICE

#define SO_BINDTODEVICE   5

Bind to network interface.

◆ SO_KEEPALIVE

#define SO_KEEPALIVE   1

BSD Socket options.

Keep Alive

◆ SO_RCVTIMEO

#define SO_RCVTIMEO   2

Timeout for blocking receive (in milliseconds)

◆ SO_SNDTIMEO

#define SO_SNDTIMEO   3

Timeout for blocking send (in milliseconds)

◆ SO_TYPE

#define SO_TYPE   4

Socket type (read only)

◆ SOCK_DGRAM

#define SOCK_DGRAM   2

Datagram Socket (Connectionless)

◆ SOCK_STREAM

#define SOCK_STREAM   1

BSD Socket Type.

Stream Socket (Connection oriented)

◆ SOL_SOCKET

#define SOL_SOCKET   1

BSD Socket level.

Socket Level

Variable Documentation

◆ in6addr_any

const IN6_ADDR in6addr_any
extern

BSD Internet Addresses IPv6.

All IPv6 addresses accepted

◆ in6addr_loopback

const IN6_ADDR in6addr_loopback
extern

Localhost IPv6 address.

◆ netDHCP_PrivateOptionsCountN

uint8_t netDHCP_PrivateOptionsCountN
extern

Number of DHCP Private Options.

◆ netDHCP_PrivateOptionsTableN

NET_DHCP_OPTION_ITEM netDHCP_PrivateOptionsTableN[]
extern

DHCP Private Options.

DHCP Private Options Table