![]() |
Network Component
Version 7.8.0
MDK Middleware for IPv4 and IPv6 Networking
|
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 | IN_ADDR |
Generic IPv4 Address structure. More... | |
struct | IN6_ADDR |
Generic IPv6 Address structure. More... | |
struct | SOCKADDR_IN |
IPv4 Socket Address structure. More... | |
struct | SOCKADDR_IN6 |
IPv6 Socket Address structure. More... | |
struct | HOSTENT |
BSD Host Entry structure. More... | |
struct | NET_ETH_LINK_INFO |
Ethernet link 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 info. More... | |
union | IN_ADDR.__unnamed__ |
struct | IN_ADDR.__unnamed__.__unnamed__ |
struct | IN_ADDR.__unnamed__.__unnamed__ |
union | IN6_ADDR.__unnamed__ |
Macros | |
#define | ntohl(v) __builtin_bswap32((uint32_t)(v)) |
Network to host byte order conversion. More... | |
#define | ntohs(v) __builtin_bswap16((uint16_t)(v)) |
#define | htons(v) ntohs(v) |
Host to network byte order conversion. More... | |
#define | htonl(v) ntohl(v) |
#define | NET_ADDR_ETH_LEN 6 |
General definitions. More... | |
#define | NET_ADDR_IP4_LEN 4 |
IPv4 Address Length in bytes. More... | |
#define | NET_ADDR_IP6_LEN 16 |
IPv6 Address Length in bytes. More... | |
#define | NET_HOSTNAME_LEN 16 |
Hostname Buffer Length in bytes. More... | |
#define | NET_ROOT_DIR_LEN 80 |
Service Root Folder Length in bytes. More... | |
#define | NET_ADDR_IP4 0 |
Network Address types. More... | |
#define | NET_ADDR_IP6 1 |
IPv6 Address. More... | |
#define | NET_USERNAME_LEN 16 |
Service Authentication definitions. More... | |
#define | NET_PASSWORD_LEN 16 |
Password Buffer Length in bytes. More... | |
#define | NET_ACCESS_FILE_READ 0x01 |
Network Access definitions. More... | |
#define | NET_ACCESS_FILE_WRITE 0x02 |
File Write is allowed. More... | |
#define | NET_ACCESS_DIRECTORY_CREATE 0x04 |
Directory Create is allowed. More... | |
#define | NET_ACCESS_DIRECTORY_REMOVE 0x08 |
Directory Remove is allowed. More... | |
#define | NET_ACCESS_DIRECTORY_LIST 0x10 |
Directory List is allowed. More... | |
#define | NET_UDP_CHECKSUM_SEND 0x01 |
UDP Checksum Options. More... | |
#define | NET_UDP_CHECKSUM_VERIFY 0x02 |
Verify Checksum for received UDP frames (default) More... | |
#define | AF_UNSPEC 0 |
BSD Socket Address Family. More... | |
#define | AF_INET 1 |
Internet Address Family. More... | |
#define | AF_NETBIOS 2 |
NetBios-style addresses. More... | |
#define | AF_INET6 3 |
Internet Address Family version 6. More... | |
#define | PF_UNSPEC 0 |
BSD Protocol families (same as address families). More... | |
#define | PF_INET 1 |
Internet Address Family. More... | |
#define | PF_NETBIOS 2 |
NetBios-style addresses. More... | |
#define | PF_INET6 3 |
Internet Address Family version 6. More... | |
#define | SOCK_STREAM 1 |
BSD Socket Type. More... | |
#define | SOCK_DGRAM 2 |
Datagram Socket (Connectionless) More... | |
#define | IPPROTO_TCP 1 |
BSD Socket Protocol. More... | |
#define | IPPROTO_UDP 2 |
UDP Protocol. More... | |
#define | INADDR_ANY 0x00000000 |
BSD Internet Addresses IPv4. More... | |
#define | INADDR_NONE 0xffffffff |
No IP address accepted. More... | |
#define | MSG_DONTWAIT 0x01 |
BSD Socket flags parameter. More... | |
#define | MSG_PEEK 0x02 |
Peeks at the incoming data. More... | |
#define | FIONBIO 1 |
BSD Socket ioctl commands. More... | |
#define | SOL_SOCKET 1 |
BSD Socket level. More... | |
#define | IPPROTO_IP 2 |
IPv4 Level. More... | |
#define | IPPROTO_IPV6 3 |
IPv6 Level. More... | |
#define | SO_KEEPALIVE 1 |
BSD Socket options. More... | |
#define | SO_RCVTIMEO 2 |
Timeout for blocking receive (in milliseconds) More... | |
#define | IP_TOS 1 |
BSD Socket IPv4 options. More... | |
#define | IP_TTL 2 |
Time to Live (TTL) More... | |
#define | IPV6_TCLASS 1 |
BSD Socket IPv6 options. More... | |
#define | IPV6_MULTICAST_HOPS 2 |
Multi-cast Hop Limit. More... | |
#define | BSD_SUCCESS 0 |
BSD Socket Return values. More... | |
#define | BSD_ERROR (-1) |
General Error. More... | |
#define | BSD_ERROR_SOCKET (-2) |
Invalid socket descriptor. More... | |
#define | BSD_ERROR_PARAMETER (-3) |
Invalid parameter. More... | |
#define | BSD_ERROR_WOULDBLOCK (-4) |
It would have blocked. More... | |
#define | BSD_ERROR_NOMEMORY (-5) |
Not enough memory in memory pool. More... | |
#define | BSD_ERROR_CLOSED (-6) |
Connection is closed or aborted. More... | |
#define | BSD_ERROR_LOCKED (-7) |
Socket is locked by another thread. More... | |
#define | BSD_ERROR_TIMEOUT (-8) |
Socket, Host Resolver timeout. More... | |
#define | BSD_ERROR_INPROGRESS (-9) |
Host Name resolving in progress. More... | |
#define | BSD_ERROR_NONAME (-10) |
Host Name not existing. More... | |
#define | s6_addr s6_b |
#define | NET_IF_CLASS_ETH (1U << 8) |
Interface Class. More... | |
#define | NET_IF_CLASS_PPP (2U << 8) |
PPP interface. More... | |
#define | NET_IF_CLASS_SLIP (3U << 8) |
SLIP interface. More... | |
#define | NET_ETH_SPEED_10M 0 |
Ethernet link speed. More... | |
#define | NET_ETH_SPEED_100M 1 |
100 Mbps link speed More... | |
#define | NET_ETH_SPEED_1G 2 |
1 Gpbs link speed More... | |
#define | NET_ETH_DUPLEX_HALF 0 |
Ethernet duplex mode. More... | |
#define | NET_ETH_DUPLEX_FULL 1 |
Full duplex link. More... | |
#define | NET_DHCP_OPTION_IP_ADDRESS 0 |
DHCP Option Codes. More... | |
#define | NET_DHCP_OPTION_NTP_SERVERS 42 |
NTP Servers option. More... | |
#define | NET_DHCP_OPTION_CLIENT_ID 61 |
Client-identifier option. More... | |
#define | NET_DHCP_OPTION_BOOTFILE_NAME 67 |
Bootfile name option. More... | |
#define | NET_DHCP6_OPTION_IP_ADDRESS 0 |
DHCPv6 Option Codes. More... | |
#define | NET_SMTP_MTA_USETLS 0x01 |
SMTP Mail Transfer Agent Flags. More... | |
#define | NET_SNMP_MIB_INTEGER 0x02 |
SNMP-MIB definitions. More... | |
#define | NET_SNMP_MIB_OCTET_STR 0x04 |
MIB entry type OCTET_STRING. More... | |
#define | NET_SNMP_MIB_OBJECT_ID 0x06 |
MIB entry type OBJECT_IDENTIFIER. More... | |
#define | NET_SNMP_MIB_IP_ADDR 0x40 |
MIB entry type IP ADDRESS (uint8_t[4]) More... | |
#define | NET_SNMP_MIB_COUNTER 0x41 |
MIB entry type COUNTER (uint32_t) More... | |
#define | NET_SNMP_MIB_GAUGE 0x42 |
MIB entry type GAUGE (uint32_t) More... | |
#define | NET_SNMP_MIB_TIME_TICKS 0x43 |
MIB entry type TIME_TICKS. More... | |
#define | NET_SNMP_MIB_ATR_RO 0x80 |
MIB entry attribute READ_ONLY. More... | |
#define | NET_SNMP_MIB_OID_SIZE 17 |
Max.size of Object ID value. More... | |
#define | NET_SNMP_MIB_STR_SIZE 110 |
Max.size of Octet String variable. More... | |
#define | NET_SNMP_MIB_READ 0 |
MIB entry Read access. More... | |
#define | NET_SNMP_MIB_WRITE 1 |
MIB entry Write access. More... | |
#define | NET_SNMP_MIB_STR(s) sizeof(s)-1, s |
SNMP-MIB macros. More... | |
#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) |
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. More... | |
typedef void(* | netPing_cb_t )(netPing_Event event) |
Ping Event callback function. More... | |
typedef void(* | netARP_cb_t )(netARP_Event event) |
ARP Probe Event callback function. More... | |
typedef void(* | netNDP_cb_t )(netNDP_Event event) |
NDP Probe Event callback function. More... | |
typedef void(* | netDNSc_cb_t )(netDNSc_Event event, const NET_ADDR *addr) |
DNS Client Event callback function. More... | |
typedef void(* | netSNTPc_cb_t )(uint32_t seconds, uint32_t seconds_fraction) |
SNTP Client callback function. More... | |
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. More... | |
Functions | |
netStatus | netInitialize (void) |
Initialize Network Component and interfaces. [not_thread-safe]. More... | |
netStatus | netUninitialize (void) |
De-initialize Network Component and interfaces. [not_thread-safe]. More... | |
const char * | netSYS_GetHostName (void) |
Retrieve localhost name. [thread-safe]. More... | |
netStatus | netSYS_SetHostName (const char *hostname) |
Set localhost name. [thread-safe]. More... | |
int32_t | netUDP_GetSocket (netUDP_cb_t cb_func) |
Allocate a free UDP socket. [thread-safe]. More... | |
netStatus | netUDP_ReleaseSocket (int32_t socket) |
Release UDP socket and free resources. [thread-safe]. More... | |
netStatus | netUDP_Open (int32_t socket, uint16_t port) |
Open UDP socket for communication. [thread-safe]. More... | |
netStatus | netUDP_Close (int32_t socket) |
Stop UDP communication and close socket. [thread-safe]. More... | |
uint8_t * | netUDP_GetBuffer (uint32_t size) |
Allocate memory for UDP send buffer. [thread-safe]. More... | |
netStatus | netUDP_Send (int32_t socket, const NET_ADDR *addr, uint8_t *buf, uint32_t len) |
Send data to a remote node. [thread-safe]. More... | |
netStatus | netUDP_SetOption (int32_t socket, netUDP_Option option, uint32_t val) |
Set UDP socket IP option. [thread-safe]. More... | |
uint16_t | netUDP_GetLocalPort (int32_t socket) |
Retrieve local port number of UDP socket. [thread-safe]. More... | |
int | socket (int family, int type, int protocol) |
Create a communication endpoint called socket. [thread-safe]. More... | |
int | bind (int sock, const SOCKADDR *addr, int addrlen) |
Assign a local address and port to a socket. [thread-safe]. More... | |
int | listen (int sock, int backlog) |
Set a socket in a listening mode. [thread-safe]. More... | |
int | accept (int sock, SOCKADDR *addr, int *addrlen) |
Accept connect request for a listening socket. [thread-safe]. More... | |
int | connect (int sock, const SOCKADDR *addr, int addrlen) |
Connect a socket to a remote host. [thread-safe]. More... | |
int | send (int sock, const char *buf, int len, int flags) |
Send data on already connected socket. [thread-safe]. More... | |
int | sendto (int sock, const char *buf, int len, int flags, const SOCKADDR *to, int tolen) |
Send data to endpoint node. [thread-safe]. More... | |
int | recv (int sock, char *buf, int len, int flags) |
Receive data on already connected socket. [thread-safe]. More... | |
int | recvfrom (int sock, char *buf, int len, int flags, SOCKADDR *from, int *fromlen) |
Receive data from endpoint node. [thread-safe]. More... | |
int | closesocket (int sock) |
Close socket and release socket descriptor. [thread-safe]. More... | |
int | getpeername (int sock, SOCKADDR *name, int *namelen) |
Retrieve IP address and port number of the endpoint node. [thread-safe]. More... | |
int | getsockname (int sock, SOCKADDR *name, int *namelen) |
Retrieve local IP address and port number. [thread-safe]. More... | |
int | setsockopt (int sock, int level, int optname, const char *optval, int optlen) |
Manipulate options for the socket. [thread-safe]. More... | |
int | ioctlsocket (int sock, long cmd, unsigned long *argp) |
Control IO mode of a socket. [thread-safe]. More... | |
HOSTENT * | gethostbyname (const char *name, int *err) |
Retrieve host IP address from host name. [thread-safe]. More... | |
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]. More... | |
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]. More... | |
netStatus | netIF_SetDefault (uint32_t if_id, netIF_Version ip_version) |
Set default network interface for internet access. [thread-safe]. More... | |
netStatus | netETH_SendRaw (uint32_t if_num, const uint8_t *buf, uint32_t len) |
Send raw Ethernet data. [thread-safe]. More... | |
netStatus | netARP_CacheIP (uint32_t if_num, const uint8_t *ip4_addr, netARP_CacheType type) |
Determine whether the ARP table has MAC address resolved for requested IP address. [thread-safe]. More... | |
netStatus | netARP_CacheMAC (uint32_t if_num, const uint8_t *mac_addr) |
Determine whether the ARP table has IP address resolved for requested MAC address. [thread-safe]. More... | |
netStatus | netARP_GetIP (uint32_t if_num, const uint8_t *mac_addr, uint8_t *ip4_addr) |
Get IP address from the ARP cache. [thread-safe]. More... | |
netStatus | netARP_GetMAC (uint32_t if_num, const uint8_t *ip4_addr, uint8_t *mac_addr) |
Get MAC address from the ARP cache. [thread-safe]. More... | |
netStatus | netARP_Probe (uint32_t if_num, const uint8_t *ip4_addr, netARP_cb_t cb_func) |
Determine whether the IP address is already in use. [thread-safe]. More... | |
netStatus | netNDP_CacheIP (uint32_t if_num, const uint8_t *ip6_addr) |
Determine whether neighbor cache has MAC address resolved for requested IP address. [thread-safe]. More... | |
netStatus | netNDP_GetIP (uint32_t if_num, const uint8_t *mac_addr, uint8_t *ip6_addr) |
Get IP address from neighbor discovery cache. [thread-safe]. More... | |
netStatus | netNDP_GetMAC (uint32_t if_num, const uint8_t *ip6_addr, uint8_t *mac_addr) |
Get MAC address from neighbor discovery cache. [thread-safe]. More... | |
netStatus | netNDP_Probe (uint32_t if_num, const uint8_t *ip6_addr, netNDP_cb_t cb_func) |
Determine whether the IP address is already in use. [thread-safe]. More... | |
netStatus | netIGMP_Join (uint32_t if_num, const uint8_t *ip4_addr) |
Join this host to a host group specified with IP address. [thread-safe]. More... | |
netStatus | netIGMP_Leave (uint32_t if_num, const uint8_t *ip4_addr) |
Leave a host group specified with IP address. [thread-safe]. More... | |
netStatus | netDHCP_Enable (uint32_t if_num) |
Enable Dynamic Host Configuration at runtime. [thread-safe]. More... | |
netStatus | netDHCP_Disable (uint32_t if_num) |
Disable Dynamic Host Configuration at runtime. [thread-safe]. More... | |
netStatus | netDHCP_SetOption (uint32_t if_num, uint8_t option, const uint8_t *val, uint32_t len) |
Set DHCP Option value at runtime. [thread-safe]. More... | |
netStatus | netDHCP6_Enable (uint32_t if_num, netDHCP6_Mode mode) |
Enable Dynamic Host Configuration version 6 at runtime. [thread-safe]. More... | |
netStatus | netDHCP6_Disable (uint32_t if_num) |
Disable Dynamic Host Configuration version 6 at runtime. [thread-safe]. More... | |
void | netETH_Notify (uint32_t if_num, netETH_Event event, uint32_t val) |
Notify the user of Ethernet link state change event. [user-provided]. More... | |
void | netETH_ReceiveRaw (uint32_t if_num, const uint8_t *buf, uint32_t len) |
Receive raw Ethernet data. [user-provided]. More... | |
void | netDHCP_Notify (uint32_t if_num, uint8_t option, const uint8_t *val, uint32_t len) |
Notify the user of DHCP event or extended DHCP option. [user-provided]. More... | |
void | netDHCP6_Notify (uint32_t if_num, uint8_t option, const uint8_t *val, uint32_t len) |
Notify the user of DHCPv6 event or extended DHCPv6 option. [user-provided]. More... | |
netStatus | netPPP_Listen (const char *username, const char *password) |
Start PPP interface to accept incoming PPP connection. [thread-safe]. More... | |
netStatus | netPPP_Connect (const char *dial_num, const char *username, const char *password) |
Start a dial-up connection to remote PPP server. [thread-safe]. More... | |
netStatus | netPPP_Close (void) |
Disconnect PPP link between two modems. [thread-safe]. More... | |
bool | netPPP_LinkUp (void) |
Determine the state of PPP link. [thread-safe]. More... | |
netStatus | netSLIP_Listen (void) |
Start SLIP interface to accept incoming SLIP connections. [thread-safe]. More... | |
netStatus | netSLIP_Connect (const char *dial_num) |
Start a dial-up connection to remote SLIP server. [thread-safe]. More... | |
netStatus | netSLIP_Close (void) |
Disconnect SLIP link between two modems. [thread-safe]. More... | |
bool | netSLIP_LinkUp (void) |
Determine the state of SLIP link. [thread-safe]. More... | |
netStatus | netPing_Echo (const NET_ADDR *addr, netPing_cb_t cb_func) |
Start ICMP ping process. [thread-safe]. More... | |
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]. More... | |
netStatus | netDNSc_ClearCache (void) |
Flush or clear the local DNS cache. [thread-safe]. More... | |
netStatus | netFTPs_Start (void) |
Start FTP server. [thread-safe]. More... | |
netStatus | netFTPs_Stop (void) |
Stop FTP server. [thread-safe]. More... | |
bool | netFTPs_Running (void) |
Check if FTP server is running. [thread-safe]. More... | |
uint16_t | netFTPs_GetPort (void) |
Get port number of FTP server. [thread-safe]. More... | |
netStatus | netFTPs_SetPort (uint16_t port) |
Set port number of FTP server. [thread-safe]. More... | |
const char * | netFTPs_GetRootPath (void) |
Retrieve path to the root directory of FTP server. [thread-safe]. More... | |
netStatus | netFTPs_SetRootPath (const char *path) |
Set path to the root directory of FTP server. [thread-safe]. More... | |
const char * | netFTPs_GetUsername (void) |
Retrieve username of the built-in user account. [thread-safe]. More... | |
netStatus | netFTPs_SetUsername (const char *username) |
Set username of the built-in user account. [thread-safe]. More... | |
const char * | netFTPs_GetPassword (void) |
Retrieve password of the built-in user account. [thread-safe]. More... | |
netStatus | netFTPs_SetPassword (const char *password) |
Reset password of the built-in user account. [thread-safe]. More... | |
bool | netFTPs_LoginActive (void) |
Determine if FTP server authentication is enabled. [thread-safe]. More... | |
netStatus | netFTPs_LoginOnOff (bool login) |
Enable or disable FTP server authentication. [thread-safe]. More... | |
bool | netFTPs_AcceptClient (const NET_ADDR *addr) |
Accept or deny connection from remote FTP client. [user-provided]. More... | |
uint8_t | netFTPs_CheckUsername (const char *username) |
Check if an user account exists in the user database. [user-provided]. More... | |
bool | netFTPs_CheckPassword (uint8_t user_id, const char *password) |
Check user account password in the user database. [user-provided]. More... | |
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]. More... | |
uint8_t | netFTPs_GetUserId (void) |
Retrieve the user identification number. [thread-safe]. More... | |
void | netFTPs_Notify (netFTPs_Event event) |
Notify the user application about events in FTP server service. [user-provided]. More... | |
void * | netFTPs_fopen (const char *fname, const char *mode) |
Open a file for reading or writing in FTP server. [interface]. More... | |
void | netFTPs_fclose (void *file) |
Close a file previously open in FTP server. [interface]. More... | |
uint32_t | netFTPs_fread (void *file, uint8_t *buf, uint32_t len) |
Read block of data from a file in FTP server. [interface]. More... | |
uint32_t | netFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len) |
Write block of data to a file in FTP server. [interface]. More... | |
bool | netFTPs_fdelete (const char *fname) |
Delete a file in FTP server. [interface]. More... | |
bool | netFTPs_frename (const char *fname, const char *newname) |
Rename a file or directory in FTP server. [interface]. More... | |
bool | netFTPs_mkdir (const char *path) |
Make a new directory in FTP server. [interface]. More... | |
bool | netFTPs_rmdir (const char *path) |
Remove an empty directory in FTP server. [interface]. More... | |
uint32_t | netFTPs_ffind (uint8_t code, char *buf, uint32_t buf_len, const char *mask) |
Search the file system directory for matching files. [interface]. More... | |
netStatus | netFTPc_Connect (const NET_ADDR *addr, netFTP_Command command) |
Start FTP client file operation session. [thread-safe]. More... | |
uint32_t | netFTPc_Process (netFTPc_Request request, char *buf, uint32_t buf_len) |
Request parameters for FTP client session. [user-provided]. More... | |
void | netFTPc_Notify (netFTPc_Event event) |
Notify the user application when FTP client operation ends. [user-provided]. More... | |
void * | netFTPc_fopen (const char *fname, const char *mode) |
Open local file for reading or writing in FTP client. [interface]. More... | |
void | netFTPc_fclose (void *file) |
Close local file previously open in FTP client. [interface]. More... | |
uint32_t | netFTPc_fread (void *file, uint8_t *buf, uint32_t len) |
Read block of data from local file in FTP client. [interface]. More... | |
uint32_t | netFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len) |
Write block of data to local file in FTP client. [interface]. More... | |
netStatus | netTFTPs_Start (void) |
Start the TFTP server. [thread-safe]. More... | |
netStatus | netTFTPs_Stop (void) |
Stop the TFTP server. [thread-safe]. More... | |
bool | netTFTPs_Running (void) |
Check if the TFTP server is running. [thread-safe]. More... | |
uint16_t | netTFTPs_GetPort (void) |
Get port number of the TFTP server. [thread-safe]. More... | |
netStatus | netTFTPs_SetPort (uint16_t port) |
Set port number of the TFTP server. [thread-safe]. More... | |
const char * | netTFTPs_GetRootPath (void) |
Retrieve path to the root directory of TFTP server. [thread-safe]. More... | |
netStatus | netTFTPs_SetRootPath (const char *path) |
Set path to the root directory of TFTP server. [thread-safe]. More... | |
bool | netTFTPs_AcceptClient (const NET_ADDR *addr) |
Accept or deny connection from a remote TFTP client. [user-provided]. More... | |
void * | netTFTPs_fopen (const char *fname, const char *mode) |
Open a file for reading or writing in the TFTP server. [interface]. More... | |
void | netTFTPs_fclose (void *file) |
Close a file previously open in the TFTP server. [interface]. More... | |
uint32_t | netTFTPs_fread (void *file, uint8_t *buf, uint32_t len) |
Read block of data from a file in the TFTP server. [interface]. More... | |
uint32_t | netTFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len) |
Write block of data to a file in the TFTP server. [interface]. More... | |
netStatus | netTFTPc_Put (const NET_ADDR *addr, const char *fname, const char *local_fname) |
Put a file to a remote TFTP server. [thread-safe]. More... | |
netStatus | netTFTPc_Get (const NET_ADDR *addr, const char *fname, const char *local_fname) |
Retrieve a file from aremote TFTP server. [thread-safe]. More... | |
void | netTFTPc_Notify (netTFTPc_Event event) |
Notify the user application when TFTP client operation ends. [user-provided]. More... | |
void * | netTFTPc_fopen (const char *fname, const char *mode) |
Open local file for reading or writing in the TFTP client. [interface]. More... | |
void | netTFTPc_fclose (void *file) |
Close local file previously open in the TFTP client. [interface]. More... | |
uint32_t | netTFTPc_fread (void *file, uint8_t *buf, uint32_t len) |
Read block of data from local file in the TFTP client. [interface]. More... | |
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]. More... | |
netStatus | netTELNETs_Start (void) |
Start the Telnet server. [thread-safe]. More... | |
netStatus | netTELNETs_Stop (void) |
Stop the Telnet server. [thread-safe]. More... | |
bool | netTELNETs_Running (void) |
Check if the Telnet server is running. [thread-safe]. More... | |
uint16_t | netTELNETs_GetPort (void) |
Get port number of the Telnet server. [thread-safe]. More... | |
netStatus | netTELNETs_SetPort (uint16_t port) |
Set port number of the Telnet server. [thread-safe]. More... | |
const char * | netTELNETs_GetUsername (void) |
Retrieve username of the built-in user account. [thread-safe]. More... | |
netStatus | netTELNETs_SetUsername (const char *username) |
Set username of the built-in user account. [thread-safe]. More... | |
const char * | netTELNETs_GetPassword (void) |
Retrieve password of the built-in user account. [thread-safe]. More... | |
netStatus | netTELNETs_SetPassword (const char *password) |
Reset password of the built-in user account. [thread-safe]. More... | |
bool | netTELNETs_LoginActive (void) |
Determine if Telnet server authentication is enabled. [thread-safe]. More... | |
netStatus | netTELNETs_LoginOnOff (bool login) |
Enable or disable Telnet server authentication. [thread-safe]. More... | |
netStatus | netTELNETs_GetClient (NET_ADDR *addr, uint32_t addr_len) |
Get IP address and port number of a connected Telnet client. [thread-safe]. More... | |
int32_t | netTELNETs_GetSession (void) |
Get current session number of the Telnet server. [thread-safe]. More... | |
bool | netTELNETs_CheckCommand (const char *cmd, const char *user_cmd) |
Check command string for a command. [thread-safe]. More... | |
netStatus | netTELNETs_RepeatCommand (uint32_t delay) |
Request a repeated call to netTELNETs_ProcessCommand function. [thread-safe]. More... | |
netStatus | netTELNETs_RequestMessage (int32_t session) |
Request unsolicited message processing in netTELNETs_ProcessMessage function. [thread-safe]. More... | |
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]. More... | |
uint32_t | netTELNETs_ProcessMessage (netTELNETs_Message msg, char *buf, uint32_t buf_len) |
Request a message for a Telnet server session. [user-provided]. More... | |
bool | netTELNETs_AcceptClient (const NET_ADDR *addr) |
Accept or deny a connection from a remote Telnet client. [user-provided]. More... | |
uint8_t | netTELNETs_CheckUsername (const char *username) |
Check if an user account exist in the user database. [user-provided]. More... | |
bool | netTELNETs_CheckPassword (uint8_t user_id, const char *password) |
Check user account password in the user database. [user-provided]. More... | |
uint8_t | netTELNETs_GetUserId (void) |
Retrieve the user identification number. [thread-safe]. More... | |
netStatus | netHTTPs_Start (void) |
Start the HTTP server. [thread-safe]. More... | |
netStatus | netHTTPs_Stop (void) |
Stop the HTTP server. [thread-safe]. More... | |
bool | netHTTPs_Running (void) |
Check if the HTTP server is running. [thread-safe]. More... | |
uint16_t | netHTTPs_GetPort (void) |
Get port number of the HTTP server. [thread-safe]. More... | |
netStatus | netHTTPs_SetPort (uint16_t port) |
Set port number of the HTTP server. [thread-safe]. More... | |
const char * | netHTTPs_GetRootPath (void) |
Retrieve path to the root directory of HTTP server. [thread-safe]. More... | |
netStatus | netHTTPs_SetRootPath (const char *path) |
Set path to the root directory of HTTP server. [thread-safe]. More... | |
const char * | netHTTPs_GetUsername (void) |
Retrieve username of the built-in user account. [thread-safe]. More... | |
netStatus | netHTTPs_SetUsername (const char *username) |
Set username of the built-in user account. [thread-safe]. More... | |
const char * | netHTTPs_GetPassword (void) |
Retrieve password of the built-in user account. [thread-safe]. More... | |
netStatus | netHTTPs_SetPassword (const char *password) |
Reset password of the built-in user account. [thread-safe]. More... | |
bool | netHTTPs_LoginActive (void) |
Determine if the HTTP server authentication is enabled. [thread-safe]. More... | |
netStatus | netHTTPs_LoginOnOff (bool login) |
Enable or disable HTTP server authentication. [thread-safe]. More... | |
netStatus | netHTTPs_GetClient (NET_ADDR *addr, uint32_t addr_len) |
Get IP address and port number of a connected remote HTTP client. [thread-safe]. More... | |
int32_t | netHTTPs_GetSession (void) |
Get current session number of the HTTP server. [thread-safe]. More... | |
const char * | netHTTPs_GetLanguage (void) |
Retrieve the preferred language setting from the browser. [thread-safe]. More... | |
const char * | netHTTPs_GetContentType (void) |
Get Content-Type HTML header, received in XML post request. [thread-safe]. More... | |
bool | netHTTPs_AcceptClient (const NET_ADDR *addr) |
Accept or deny a connection from a remote HTTP client. [user-provided]. More... | |
uint8_t | netHTTPs_CheckAccount (const char *username, const char *password) |
Check if an user account exist in the user database. [user-provided]. More... | |
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]. More... | |
uint8_t | netHTTPs_GetUserId (void) |
Retrieve the user identification. [thread-safe]. More... | |
void * | netHTTPs_fopen (const char *fname) |
Open a file for reading in HTTP server. [interface]. More... | |
void | netHTTPs_fclose (void *file) |
Close a file previously open in HTTP server. [interface]. More... | |
uint32_t | netHTTPs_fread (void *file, uint8_t *buf, uint32_t len) |
Read block of data from a file in HTTP server. [interface]. More... | |
char * | netHTTPs_fgets (void *file, char *buf, uint32_t size) |
Read a string from a file in HTTP server. [interface]. More... | |
void | netHTTPs_fstat (const char *fname, uint32_t *fsize, uint32_t *ftime) |
Retrieve file size and last modification time. [interface]. More... | |
void | netCGI_ProcessQuery (const char *qstr) |
Process query string received by GET request. [user-provided]. More... | |
void | netCGI_ProcessData (uint8_t code, const char *data, uint32_t len) |
Process data received by POST request. [user-provided]. More... | |
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]. More... | |
const char * | netCGI_GetEnvVar (const char *env, char *ansi, uint32_t max_len) |
Process environment variables and convert to ANSI format. [thread-safe]. More... | |
const char * | netCGI_Charset (void) |
Override default character encoding in html documents. [user-provided]. More... | |
const char * | netCGI_ContentType (const char *file_ext) |
Add custom MIME type for unsupported file types. [user-provided]. More... | |
const char * | netCGI_Redirect (const char *file_name) |
Redirect resource URL address to a new location. [user-provided]. More... | |
const char * | netCGX_ContentType (void) |
Override default Content-Type for CGX script files. [user-provided]. More... | |
netStatus | netSMTPc_Connect (const NET_ADDR *addr) |
Start SMTP client to send an email in legacy mode. [thread-safe]. More... | |
netStatus | netSMTPc_SendMail (const NET_SMTP_MAIL *mail, const NET_SMTP_MTA *mta) |
Send an email in blocking mode. [thread-safe]. More... | |
uint32_t | netSMTPc_Process (netSMTPc_Request request, char *buf, uint32_t buf_len, uint32_t *pvar) |
Request parameters for SMTP client session. [user-provided]. More... | |
void | netSMTPc_Notify (netSMTPc_Event event) |
Notify the user application when SMTP client operation ends. [user-provided]. More... | |
bool | netSMTPc_AcceptAuthentication (const NET_ADDR *addr) |
Accept or deny authentication requested by SMTP server. [user-provided]. More... | |
void * | netSMTPc_fopen (const char *fname) |
Open a file for reading in SMTP client. [interface]. More... | |
void | netSMTPc_fclose (void *file) |
Close a file previously open in SMTP client. [interface]. More... | |
uint32_t | netSMTPc_fread (void *file, uint8_t *buf, uint32_t len) |
Read block of data from a file in SMTP client. [interface]. More... | |
netStatus | netSNTPc_SetMode (netSNTPc_Mode mode) |
Set mode of operation for SNTP client. [thread-safe]. More... | |
netStatus | netSNTPc_GetTime (const NET_ADDR *addr, netSNTPc_cb_t cb_func) |
Determine current time from NTP or SNTP time server. [thread-safe]. More... | |
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]. More... | |
netStatus | netSNMP_SetCommunity (const char *community) |
Change SNMP community to a new community. [thread-safe]. More... | |
netStatus | netSNMP_SetMIB_Table (const NET_SNMP_MIB_INFO *info, uint32_t size) |
Register MIB table to SNMP Agent. [thread-safe]. More... | |
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]. More... | |
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]. More... | |
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]. More... | |
bool | netMAC_aton (const char *mac_string, uint8_t *mac_addr) |
Convert MAC address from text to binary form. [thread-safe]. More... | |
int32_t | netTCP_GetSocket (netTCP_cb_t cb_func) |
Allocate a free TCP socket. [thread-safe]. More... | |
netStatus | netTCP_ReleaseSocket (int32_t socket) |
Release TCP socket and free resources. [thread-safe]. More... | |
netStatus | netTCP_Listen (int32_t socket, uint16_t port) |
Open TCP socket for incoming connection. [thread-safe]. More... | |
netStatus | netTCP_Connect (int32_t socket, const NET_ADDR *addr, uint16_t local_port) |
Initiate a TCP connection to a remote node. [thread-safe]. More... | |
netStatus | netTCP_Close (int32_t socket) |
Stop TCP communication and start closing procedure. [thread-safe]. More... | |
netStatus | netTCP_Abort (int32_t socket) |
Instantly stop TCP communication. [thread-safe]. More... | |
uint32_t | netTCP_GetMaxSegmentSize (int32_t socket) |
Determine maximum number of data bytes that can be sent in TCP packet. [thread-safe]. More... | |
uint8_t * | netTCP_GetBuffer (uint32_t size) |
Allocate memory for TCP send buffer. [thread-safe]. More... | |
bool | netTCP_SendReady (int32_t socket) |
Check if TCP socket can send data. [thread-safe]. More... | |
netStatus | netTCP_Send (int32_t socket, uint8_t *buf, uint32_t len) |
Send a data packet to remote node. [thread-safe]. More... | |
netTCP_State | netTCP_GetState (int32_t socket) |
Determine current state of a TCP socket. [thread-safe]. More... | |
netStatus | netTCP_ResetReceiveWindow (int32_t socket) |
Reset TCP window size to a default value from the configuration. [thread-safe]. More... | |
netStatus | netTCP_SetOption (int32_t socket, netTCP_Option option, uint32_t val) |
Set TCP socket IP option. [thread-safe]. More... | |
uint16_t | netTCP_GetLocalPort (int32_t socket) |
Retrieve local port number of TCP socket. [thread-safe]. More... | |
netStatus | netTCP_GetPeer (int32_t socket, NET_ADDR *addr, uint32_t addr_len) |
Retrieve IP address and port number of remote peer. [thread-safe]. More... | |
uint32_t | netTCP_GetTimer (int32_t socket) |
Determine TCP socket connection timeout. [thread-safe]. More... | |
Variables | |
NET_DHCP_OPTION_ITEM | netDHCP_PrivateOptionsTableN [] |
DHCP Private Options. More... | |
uint8_t | netDHCP_PrivateOptionsCountN |
Number of DHCP Private Options. More... | |
#define AF_INET 1 |
Internet Address Family.
#define AF_INET6 3 |
Internet Address Family version 6.
#define AF_NETBIOS 2 |
NetBios-style addresses.
#define AF_UNSPEC 0 |
BSD Socket Address Family.
Unspecified
#define BSD_ERROR (-1) |
General Error.
#define BSD_ERROR_CLOSED (-6) |
Connection is closed or aborted.
#define BSD_ERROR_INPROGRESS (-9) |
Host Name resolving in progress.
#define BSD_ERROR_LOCKED (-7) |
Socket is locked by another thread.
#define BSD_ERROR_NOMEMORY (-5) |
Not enough memory in memory pool.
#define BSD_ERROR_NONAME (-10) |
Host Name not existing.
#define BSD_ERROR_PARAMETER (-3) |
Invalid parameter.
#define BSD_ERROR_SOCKET (-2) |
Invalid socket descriptor.
#define BSD_ERROR_TIMEOUT (-8) |
Socket, Host Resolver timeout.
#define BSD_ERROR_WOULDBLOCK (-4) |
It would have blocked.
#define BSD_SUCCESS 0 |
BSD Socket Return values.
Success
#define FIONBIO 1 |
BSD Socket ioctl commands.
Set mode (blocking/non-blocking)
#define htonl | ( | v | ) | ntohl(v) |
#define htons | ( | v | ) | ntohs(v) |
Host to network byte order conversion.
#define INADDR_ANY 0x00000000 |
BSD Internet Addresses IPv4.
All IP addresses accepted
#define INADDR_NONE 0xffffffff |
No IP address accepted.
#define IP_TOS 1 |
BSD Socket IPv4 options.
Type of Service (TOS)
#define IP_TTL 2 |
Time to Live (TTL)
#define IPPROTO_IP 2 |
IPv4 Level.
#define IPPROTO_IPV6 3 |
IPv6 Level.
#define IPPROTO_TCP 1 |
BSD Socket Protocol.
TCP Protocol
#define IPPROTO_UDP 2 |
UDP Protocol.
#define IPV6_MULTICAST_HOPS 2 |
Multi-cast Hop Limit.
#define IPV6_TCLASS 1 |
BSD Socket IPv6 options.
Traffic Class
#define MSG_DONTWAIT 0x01 |
BSD Socket flags parameter.
Enables non-blocking operation
#define MSG_PEEK 0x02 |
Peeks at the incoming data.
#define NET_ACCESS_DIRECTORY_CREATE 0x04 |
Directory Create is allowed.
#define NET_ACCESS_DIRECTORY_LIST 0x10 |
Directory List is allowed.
#define NET_ACCESS_DIRECTORY_REMOVE 0x08 |
Directory Remove is allowed.
#define NET_ACCESS_FILE_READ 0x01 |
Network Access definitions.
File Read is allowed
#define NET_ACCESS_FILE_WRITE 0x02 |
File Write is allowed.
#define NET_ADDR_ETH_LEN 6 |
General definitions.
Ethernet MAC Address Length in bytes
#define NET_ADDR_IP4 0 |
Network Address types.
IPv4 Address
#define NET_ADDR_IP4_LEN 4 |
IPv4 Address Length in bytes.
#define NET_ADDR_IP6 1 |
IPv6 Address.
#define NET_ADDR_IP6_LEN 16 |
IPv6 Address Length in bytes.
#define NET_DHCP6_OPTION_IP_ADDRESS 0 |
DHCPv6 Option Codes.
IPv6 address change event
#define NET_DHCP_OPTION_BOOTFILE_NAME 67 |
Bootfile name option.
#define NET_DHCP_OPTION_CLIENT_ID 61 |
Client-identifier option.
#define NET_DHCP_OPTION_IP_ADDRESS 0 |
DHCP Option Codes.
IP address change event
#define NET_DHCP_OPTION_NTP_SERVERS 42 |
NTP Servers option.
#define NET_ETH_DUPLEX_FULL 1 |
Full duplex link.
#define NET_ETH_DUPLEX_HALF 0 |
Ethernet duplex mode.
Half duplex link
#define NET_ETH_SPEED_100M 1 |
100 Mbps link speed
#define NET_ETH_SPEED_10M 0 |
Ethernet link speed.
10 Mbps link speed
#define NET_ETH_SPEED_1G 2 |
1 Gpbs link speed
#define NET_HOSTNAME_LEN 16 |
Hostname Buffer Length in bytes.
#define NET_IF_CLASS_ETH (1U << 8) |
Interface Class.
Ethernet interface
#define NET_IF_CLASS_PPP (2U << 8) |
PPP interface.
#define NET_IF_CLASS_SLIP (3U << 8) |
SLIP interface.
#define NET_PASSWORD_LEN 16 |
Password Buffer Length in bytes.
#define NET_ROOT_DIR_LEN 80 |
Service Root Folder Length in bytes.
#define NET_SMTP_MTA_USETLS 0x01 |
SMTP Mail Transfer Agent Flags.
Use secure TLS mode (Implicit TLS)
#define NET_SNMP_MIB_ATR_RO 0x80 |
MIB entry attribute READ_ONLY.
#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_INT | ( | o | ) | sizeof(o), (void *)&o |
#define NET_SNMP_MIB_INTEGER 0x02 |
SNMP-MIB definitions.
MIB entry type INTEGER
#define NET_SNMP_MIB_IP | ( | ip | ) | 4, (void *)&ip |
#define NET_SNMP_MIB_IP_ADDR 0x40 |
MIB entry type IP ADDRESS (uint8_t[4])
#define NET_SNMP_MIB_OBJECT_ID 0x06 |
MIB entry type OBJECT_IDENTIFIER.
#define NET_SNMP_MIB_OCTET_STR 0x04 |
MIB entry type OCTET_STRING.
#define NET_SNMP_MIB_OID0 | ( | f, | |
s | |||
) | (f*40 + s) |
#define NET_SNMP_MIB_OID_SIZE 17 |
Max.size of Object ID value.
#define NET_SNMP_MIB_READ 0 |
MIB entry Read access.
#define NET_SNMP_MIB_STR | ( | s | ) | sizeof(s)-1, s |
SNMP-MIB macros.
#define NET_SNMP_MIB_STR_SIZE 110 |
Max.size of Octet String variable.
#define NET_SNMP_MIB_TIME_TICKS 0x43 |
MIB entry type TIME_TICKS.
#define NET_SNMP_MIB_WRITE 1 |
MIB entry Write access.
#define NET_UDP_CHECKSUM_SEND 0x01 |
UDP Checksum Options.
Calculate Checksum for UDP send frames (default)
#define NET_UDP_CHECKSUM_VERIFY 0x02 |
Verify Checksum for received UDP frames (default)
#define NET_USERNAME_LEN 16 |
Service Authentication definitions.
Username Buffer Length in bytes
#define ntohl | ( | v | ) | __builtin_bswap32((uint32_t)(v)) |
Network to host byte order conversion.
#define ntohs | ( | v | ) | __builtin_bswap16((uint16_t)(v)) |
#define PF_INET 1 |
Internet Address Family.
#define PF_INET6 3 |
Internet Address Family version 6.
#define PF_NETBIOS 2 |
NetBios-style addresses.
#define PF_UNSPEC 0 |
BSD Protocol families (same as address families).
Unspecified
#define s6_addr s6_b |
#define SO_KEEPALIVE 1 |
BSD Socket options.
Keep Alive
#define SO_RCVTIMEO 2 |
Timeout for blocking receive (in milliseconds)
#define SOCK_DGRAM 2 |
Datagram Socket (Connectionless)
#define SOCK_STREAM 1 |
BSD Socket Type.
Stream Socket (Connection oriented)
#define SOL_SOCKET 1 |
BSD Socket level.
Socket Level
uint8_t netDHCP_PrivateOptionsCountN |
Number of DHCP Private Options.
NET_DHCP_OPTION_ITEM netDHCP_PrivateOptionsTableN[] |
DHCP Private Options.
DHCP Private Options Table