Network Component  Version 7.19.0
MDK Middleware for IPv4 and IPv6 Networking
Migration

The new Network Component supports IPv4 and IPv6, whereas previous versions of the Middleware provided support only for IPv4. Based on this difference, the API has changed which will require either to use a compatibility mode to be able to use the new Network Core together with the old API or a manual change of the user code to reflect the API changes.

The following sections show how to migrate projects from previous versions of the Middleware:

  • Project Migration describes how to migrate an MDK Version 5 project from the previous Middleware (v5.x and v6.x) to the latest version.
  • Porting Library Functionality demonstrates how to port functionality based on the internal library functions to the new API.
  • Component Migration explains the required code changes for every single software component.
  • Network Configuration describes the differences in the configuration files of the Network Component.
  • STDIO Debug explains how to use the legacy debug features.

Project Migration

There is an easy migration path available for users of the Network Component v5 and v6. Simply open the project that is about to be migrated in µVision. The IDE will show an error message that a software component is not available:

Error message opening a legacy project

This message is shown because the previous variants Debug/Release have been changed to IPv4/IPv6 Debug and IPv4/IPv6 Release. Open the Manage Run-Time Environment window. It will show the same error message in a different way:

Error message in the Run-Time Environment

Select a New Core Variant

Select the variant IPv4/IPv6 Release to get rid of this validation message:

Manually resolve the error message

Using the Compatibility Mode

The Network Component v7 contains a compatibility mode that enables you to use the old API with the new Network Core. This gives you the benefit to use the latest Network library (with all updates and bug fixes) and the new API, while it is not necessary to change all the legacy code right now. You can mix the old and the new APi on component level, for example using the new API for TCP sockets while using the old API for the Ethernet interface.

Check the box to use the Legacy API:

Enable to use the Legacy API

A few legacy API functions cannot be used with the compatibility mode:

  • The function telnet_server_message_poll will create errors during compile
  • The SNMP Agent will compile but fail at runtime because the MIB table is not registered properly

These example projects will not build:

Note
The section Porting Library Functionality explains the details on how to work-around these problems.

Update Configuration Files

After pressing OK, the Project window will look like this:

Updated Project window

Two files (for supporting the legacy API) have been added: Net_Legacy.c and Net_Config_Legacy.h. Files with a red icon require your attention because they are incompatible with this version of the Network Component. You need to update them in order to use the new component. Refer to for details.

Right-clicking each file will give you the update options:

Update options for configuration files

Update Config File will simply copy the new configuration file into your project containing the default settings. The old file with your project's settings will be renamed to Net_Config.c.0000 for example. If you want to manually merge the two files, you can open this backup file (located in the folder RTE\Network) and compare it with the new file line by line.

A better way is to use the option Update Config File and Launch Merge. This option is available for µVision users with version 5.15 and above. Refer to the µVision help for details.

Not all configuration files require a merge, as many of them are compatible. The section Network Configuration describes the differences in more detail.

Configure Keil RTX

If you use RTX v5, you do not need to change the RTX settings, because all resources are statically allocated.

If you use RTX v4, you must change the following settings in file:

RTX v4 configuration in RTX_Conf_CM.c
  • Increase the Number of concurrent running threads by 2
  • Increase the Number of threads with user-provided stack size by 2
  • Increase Total stack size [bytes] for threads with user-provided stack size by 1536 bytes
  • Enable User Timers
Note
Refer to the section Resource Requirements for more information.

Build and Run the Network Project

Finally, after merging the configuration files, you should be able to compile the project and run it on your target hardware:

Error-free build output
Note
If you see errors/warnings in the Build Output window, check the section Porting Library Functionality for details on how to migrate functions that are not covered by the compatibility layer.

Porting Library Functionality

Runtime Configuration Migration

In previous versions of the Network Component (v5 and v6) and in the old RL-ARM networking stack it was possible to get direct access to a structure called LOCALM. This was used to change the configuration of the network interface at runtime. This is deprecated and the following two control functions have been introduced for runtime configuration. Use:

For more information on the usage of the two functions refer to Runtime Configuration. The following shows how to migrate code using LOCALM to the new Network Component API.

LOCALM

In previous versions, the
LOCALM structure defined network parameters for all available interfaces (Ethernet, PPP or SLIP). It was defined as follows:

// Local Machine info
typedef struct localm {
uint8_t IpAddr [IP4_ADDR_LEN]; // Local IP Address
uint8_t DefGW [IP4_ADDR_LEN]; // Default GateWay
uint8_t NetMask[IP4_ADDR_LEN]; // Net Mask
uint8_t PriDNS [IP4_ADDR_LEN]; // Primary DNS Server
uint8_t SecDNS [IP4_ADDR_LEN]; // Secondary DNS Server
} LOCALM;

Access to the structure was directly available using:

localm[NETIF_ETH] // parameters for Ethernet interface
localm[NETIF_PPP] // parameters for PPP interface
localm[NETIF_SLIP] // parameters for SLIP interface

Code Examples

Previous Versions

extern LOCALM localm[];
uint8_t ip_addr[IP4_ADDR_LEN];
// Read IP address
memcpy (ip_addr, localm[NETIF_ETH].IpAddr, IP4_ADDR_LEN);
// Write IP address
memcpy (localm[NETIF_ETH].IpAddr, ip_addr, IP4_ADDR_LEN);

Network Component v7

TCP Socket Access Migration

The example projects for HTTP and Telnet Server previously accessed the TCP socket control block directly (using tcp_config and TCP_INFO). This is deprecated in Network Component v7. New API functions have been introduced for that purpose:

Code Examples

The current state of a particular TCP socket can be determined using the function netTCP_GetState. If the function returns netTCP_StateINVALID, the socket is not available (not in the range of sockets specified in Net_Config_TCP.h). For example, this can be used to determine the maximum number of available TCP sockets:

Previous Versions

#define tcp_NumSocks tcp_config.NumSocks;
:
do {
// Process socket information
} while (++socket < tcpNumSocks)

Network Component v7

do {
// Process socket information

HTTP/Telnet Server Migration

The example projects for HTTP and Telnet Server previously used internal functionality to access the server authentication and the user password (using http_config, and tnet_config). This is deprecated in Network Component v7. Use the following new API functions instead:

Code Examples

Previous Versions

#define http_EnAuth http_config.EnAuth;
:
if (http_EnAuth != 0) {
strcpy (http_auth_passw, passw);
}

Network Component v7

if (netHTTPs_LoginActive () == true) {
}

Component Migration

This section shows how to migrate each software component of the Network separately. Using the Compatibility Mode, it is possible to mix old (v5/v6) and new API calls in the same project. This enables the user to change to the new API on a component level which reduces risk and required time for the migration.

In general, all function names are changed according to a new naming convention. Most functions are compatible, with the exception of a few, where parameters are changed and optimized. Parameters providing an IP address and a port are replaced with a single structure NET_ADDR that contains both, the IP address and port number.

Usually, functions are now RTOS thread-safe and can be called from different threads.

For a function-by-function comparison visit the appropriate reference sections:

Network Core Functions

The Network v7 Core runs in event-driven mode in a separate thread (netCore_Thread, thread-safe) which is created by the netInitialize function. Core processing is triggered using a timer tick every 100ms, or when a packet is received. Otherwise, netCore_Thread is idle. The function net_main is removed.

The following API functions are added:

Code Examples

Previous Versions

int main (void) {
net_initialize();
while(1) {
net_main ();
}
}

Network Component v7

int main (void) {
while(1) {
// do anything
}
}

HTTP Server

Previous versions started the HTTP server automatically in net_initialize. Now it is required to start the HTTP server either using:

  • A configuration setting to start system services in Net_Config.c:
    #define NET_START_SERVICE 1
    or
  • Manual service start in the application code:

interface functions are renamed and compatible:

Old API v7 API
http_server_fopen netHTTPs_fopen
http_server_fclose netHTTPs_fclose
http_server_fread netHTTPs_fread
http_server_fgets netHTTPs_fgets
http_server_ftime netHTTPs_fstat
Note
netHTTPs_fstat is incompatible with the previous version. It is changed to provide the file size and file time.

The following API functions are added:

FTP Server

Previous versions started the FTP server automatically in net_initialize. Now it is required to start the FTP server either using:

  • A configuration setting to start system services in Net_Config.c:
    #define NET_START_SERVICE 1
    or
  • Manual service start in the application code:

The interface functions are renamed and compatible:

Old API v7 API
ftp_server_fopen netFTPs_fopen
ftp_server_fclose netFTPs_fclose
ftp_server_fread netFTPs_fread
ftp_server_fwrite netFTPs_fwrite
ftp_server_fdelete netFTPs_fdelete
ftp_server_frename netFTPs_frename
ftp_server_mkdir netFTPs_mkdir
ftp_server_rmdir netFTPs_rmdir
ftp_server_ffind netFTPs_ffind
Note
netFTPs_ffind is incompatible with the previous version. It is changed to provide the file name, file size and file time.

The following API functions are added:

FTP Client

The interface functions are renamed and compatible:

Old API v7 API
ftp_client_fopen netFTPc_fopen
ftp_client_fclose netFTPc_fclose
ftp_client_fread netFTPc_fread
ftp_client_fwrite netFTPc_fwrite

TFTP Server

Previous versions started the TFTP server automatically in net_initialize. Now it is required to start the TFTP server either using:

  • A configuration setting to start system services in Net_Config.c:
    #define NET_START_SERVICE 1
    or
  • Manual service start in the application code:

The interface functions are renamed and compatible:

Old API v7 API
tftp_server_fopen netTFTPs_fopen
tftp_server_fclose netTFTPs_fclose
tftp_server_fread netTFTPs_fread
tftp_server_fwrite netTFTPs_fwrite

The following API functions are added:

TFTP Client

The interface functions are renamed and compatible:

Old API v7 API
tftp_client_fopen netTFTPc_fopen
tftp_client_fclose netTFTPc_fclose
tftp_client_fread netTFTPc_fread
tftp_client_fwrite netTFTPc_fwrite

Telnet Server

Previous versions started the Telnet server automatically in net_initialize. Now it is required to start the Telnet server either using:

  • A configuration setting to start system services in Net_Config.c:
    #define NET_START_SERVICE 1
    or
  • Manual service start in the application code:

The following API functions are added:

SNMP Agent

SNMP-MIB definitions are renamed and are compatible:

Old API v7 API
MIB_INTEGER NET_SNMP_MIB_INTEGER
MIB_OCTET_STR NET_SNMP_MIB_OCTET_STR
MIB_OBJECT_ID NET_SNMP_MIB_OBJECT_ID
MIB_IP_ADDR NET_SNMP_MIB_IP_ADDR
MIB_COUNTER NET_SNMP_MIB_COUNTER
MIB_GAUGE NET_SNMP_MIB_GAUGE
MIB_TIME_TICKS NET_SNMP_MIB_TIME_TICKS
MIB_ATR_RO NET_SNMP_MIB_ATR_RO
MIB_OID_SIZE NET_SNMP_MIB_OID_SIZE
MIB_STR_SIZE NET_SNMP_MIB_STR_SIZE
MIB_READ NET_SNMP_MIB_READ
MIB_WRITE NET_SNMP_MIB_WRITE

SNMP-MIB macros are renamed and are compatible:

Old API v7 API
MIB_STR(s) NET_SNMP_MIB_STR(s)
MIB_INT(o) NET_SNMP_MIB_INT(o)
MIB_IP(ip) NET_SNMP_MIB_IP(ip)
MIB_OID0(f,s) NET_SNMP_MIB_OID0(f,s)
SNMP_MIB_SIZE(mib) removed

MIB-Entry information typedef SNMP_MIB is renamed to NET_SNMP_MIB_INFO.

The registering of the MIB data table has changed in the SNMP agent:

  • Previous versions used variable names: snmp_mib and snmp_mib_size,
  • Network Component v7 uses netSNMP_SetMIB_Table function to register the MIB data table.

The following API functions are added:

SNTP Client

The following API functions are added:

  • netSNTPc_SetMode changes the operation mode of the SNTP client (to unicast/broadcast mode)

BSD Sockets

The BSD socket API is not changed and is fully backward compatible. It has been extended to support IPv6 addresses without breaking the existing API.

TCP Sockets

The socket types TCP_TYPE_SERVER and TCP_TYPE_CLIENT are removed from socket attributes. A socket type is now implicitly defined when the socket is opened for use:

The following API functions are added:

UDP Sockets

The following API functions are deprecated:

The following API functions are added:

Network Interface Functions

The following API functions are added:

  • netARP_Probe determines whether the requested IPv4 address is already used in local area network
  • netNDP_CacheIP determines whether the NDP table has already an entry for a certain IPv6 address
  • netNDP_GetIP determines the resolved IPv6 address for a specific MAC address
  • netNDP_GetMAC determines the resolved MAC address for a specific IPv6 address
  • netNDP_Probe determines whether the requested IPv6 address is already used in local area network
  • netDHCP_Enable starts the DHCP service at runtime
  • netIF_GetOption retrieves the current value of a requested option for an interface
  • netIF_SetOption sets different options for an interface

Network Address Conversion Functions

The network address conversion functions are similar, but not compatible. The functions in the new API need to provide an output buffer for the conversion to an ASCII string. The functions are RTOS thread-safe and can be called from different threads.

Network Configuration

Some network configuration files have changed in the Network Component v7. In general, IP address configuration has changed. The address string has replaced individual address byte configuration. Further details for every configuration file are explained below.

The following files maintain full compatibility from v5/v6 to v7:

  • Net_Config_BSD.h
  • Net_Config_DNS_Client.h
  • Net_Config_FTP_Client.h
  • Net_Config_SMTP_Client.h
  • Net_Config_TFTP_Client.h
  • Net_Config_UDP.h
Note
The following screenshots always show the previous settings on the left hand side, whereas the new settings are shown on the right hand side.

Net_Config.c

Old Net_Config.c vs. new Net_Config.c
  • NET_MEM_SIZE presentation changed from words to bytes
  • NET_START_SERVICE setting added for compatibility with Network version 5
  • NET_THREAD_STACK_SIZE and NET_THREAD_PRIORITY settings added
  • Enumerator ERROR_CODE changed to incompatible NET_ERROR:
    Old Enumerator New Enumerator
    ERR_MEM_ALLOC NET_ERROR_MEM_ALLOC
    ERR_MEM_FREE NET_ERROR_MEM_FREE
    ERR_MEM_CORRUPT NET_ERROR_MEM_CORRUPT
    ERR_MEM_LOCK NET_ERROR_CONFIG (replaced with configuration error)
    ERR_UDP_ALLOC NET_ERROR_UDP_ALLOC
    ERR_TCP_ALLOC NET_ERROR_TCP_ALLOC
    ERR_TCP_STATE NET_ERROR_TCP_STATE

Net_Config_ETH.h

Old Net_Config_ETH.h vs. new Net_Config_ETH.h
  • MAC Address changed to string MAC presentation
  • Network version 5 settings moved to IPv4 section
  • IP Address, Subnet mask, Default Gateway etc. presentation changed to string
  • Added OS Resource Settings with settings for ETH interface thread creation (ETH_THREAD_STACK_SIZE and ETH_THREAD_PRIORITY)

Net_Config_FTP_Server.h

Old Net_Config_FTP_Server.h vs. new Net_Config_FTP_Server.h
  • Added built-in administrator account enable (FTP_SERVER_AUTH_ADMIN added)
  • Added Local Root Folder setting (FTP_SERVER_ROOT_ENABLE and FTP_SERVER_ROOT_FOLDER)

Net_Config_HTTP_Server.h

Old Net_Config_HTTP_Server.h vs. new Net_Config_HTTP_Server.h
  • Added built-in administrator account enable (HTTP_SERVER_AUTH_ADMIN added)
  • Added Local Root Folder setting (HTTP_SERVER_ROOT_ENABLE and HTTP_SERVER_ROOT_FOLDER)

Net_Config_PPP.h

Old Net_Config_PPP.h vs. new Net_Config_PPP.h
  • IP Address, Subnet mask, Default Gateway etc. presentation changed to string
  • Added OS Resource Settings with settings for PPP interface thread creation (PPP_THREAD_STACK_SIZE and PPP_THREAD_PRIORITY)

Net_Config_SLIP.h

Old Net_Config_SLIP.h vs. new Net_Config_SLIP.h
  • IP Address, Subnet mask, Default Gateway etc. presentation changed to string
  • Added OS Resource Settings with settings for SLIP interface thread creation (SLIP_THREAD_STACK_SIZE and SLIP_THREAD_PRIORITY)

Net_Config_SNMP_Agent.h

Old Net_Config_SNMP_Agent.h vs. new Net_Config_SNMP_Agent.h
  • Trap Server Address presentation changed to string

Net_Config_SNTP_Client.h

Old Net_Config_SNTP_Client.h vs. new Net_Config_SNTP_Client.h
  • NTP Server Address presentation changed to string

Net_Config_TCP.h

In principle, the configuration files are compatible, but the following default settings have changed:

  • Receive Window Size changed from 4380 to 4320 octets
  • Maximum Segment Size changed from 1460 to 1440 octets
Old Net_Config_TCP.h vs. new Net_Config_TCP.h

Net_Config_Telnet_Server.h

Old Net_Config_Telnet_Server.h vs. new Net_Config_Telnet_Server.h
  • Added built-in administrator account enable (TELNET_SERVER_AUTH_ADMIN added)

Net_Config_TFTP_Server.h

Old Net_Config_TFTP_Server.h vs. new Net_Config_TFTP_Server.h
  • Added Local Root Folder setting (TFTP_SERVER_ROOT_ENABLE and TFTP_SERVER_ROOT_FOLDER)

Net_Debug.c

Old Net_Debug.c vs. new Net_Debug.c
  • Added IPv6 protocols for debugging
  • Debug configuration settings reorganized to:
    • System Debug
    • IPv4 Core Debug
    • IPv6 Core Debug
    • Socket Debug
    • Service Debug

STDIO Debug

STDIO Debug is a legacy debug variant that prints event information as ASCII messages to a standard IO port. It is generally less feature-rich and slower than the debug with Event Recorder and is not recommended for new projects.

To enable STDIO debugging together with the Network Component, it is required to create an image that generates event information. The necessary steps are:

  1. In the RTE management dialog select the Debug STDIO variant for the Network:Core software component. All necessary files, such as the Net_Debug.c file and the debug library will be automatically added to your project.
  2. In the RTE management dialog enable Compiler:I/O:STDOUT component and select its ITM variant.
  3. Configure the Debug Levels.
  4. Build the application code and download it to the target hardware.
Note
  • If the target system has only one serial port that is used by the PPP or SLIP Network Interface, then use ITM channel for printing debug messages. Otherwise, the debug messages will interfere with the IP packets and the system might malfunction or crash. The ARM::Compiler component helps you to configure the stdio channel.
  • If the debug mode is used on a high traffic LAN, the system might block. Reduce the amount of printed debug messages in Net_Debug.c configuration or disable the debug mode completely.

Debug Levels

The system is made up of several modules that output debug messages. It is possible to configure the stdio debug output for each module separately. This can be done in the Net_Debug.c file. There are three debug levels available:

Level Description
Off The debug messages for the selected module are disabled.
Errors Only Only error messages are output. This mode is useful for error tracking.
Full Debug In this mode, all debug messages are output.

The following debug options are available:

  • Print Time Stamp switch enables or disables printing the time information with debug messages. If this switch is not enabled, the timing information is not printed.
  • Debug level for each module defines what kind of debug messages are printed.

The owner module of the displayed debug message is identified by the message prefix. The following system and application modules are configurable for debugging:

ID Module Description
MEM Memory Management Debug Allocates and releases frame buffers.
ETH Ethernet Debug Handles Ethernet link.
WIFI WiFi Debug Handles wireless network link.
PPP PPP Debug Handles serial line direct or modem connection PPP link.
SLIP SLIP Debug Handles serial line direct or modem connection SLIP link.
LOOP Loopback Debug Handles localhost loopback interface.
ARP ARP Debug Handles Ethernet MAC address resolution and caching.
IP4 IPv4 Debug Processes the IP version 4 network layer.
ICMP ICMP Debug Processes ICMP messages. Best known example is the ping.
IGMP IGMP Debug Processes IGMP messages, Hosts groups and IP Multicasting.
IP6 IPv6 Debug Processes the IP version 6 network layer.
ICMP6 ICMPv6 Debug Processes ICMP version 6 messages. Best known example is the ping.
NDP6 NDP Debug Handles Neighbor Discovery MAC address resolution and caching.
UDP UDP Debug Processes UDP frames.
TCP TCP Debug Processes TCP frames.
BSD BSD Debug Processes TCP and UDP frames via standard BSD Sockets API.
NBNS NBNS Debug The NetBIOS Name Service maintains name access to your hardware.
DHCP DHCP Debug Handles automatic configuration of IP address, Net mask, Default Gateway, and Primary and Secondary DNS servers.
DHCP6 DHCP6 Debug Handles automatic configuration of IP address in IP version 6.
DNS DNS Debug Handles the resolution of the IP address from a host name.
SNMP SNMP Debug Manages devices on IP network.
HTTP HTTP Server Debug Delivers web pages on the request to web clients.
FTP FTP Server Debug Manages the files stored on the server and serves the file requests received from the clients.
FTPC FTP Client Debug Connects to FTP server to transfer files on the server, and to manage files stored on the server.
TELN Telnet Server Debug Allows remote clients to control the system using the command line interface.
TFTP TFTP Server Debug A simple service which allows you to send files to or read files from the server.
TFTPC TFTP Client Debug Connects to TFTP server to send or receive files.
SMTP SMTP Client Debug Connects to SMTP server to send emails.
SNTP SNTP Debug Manages clock synchronization over the network.

An example of the debug output is:

015.0 ETH:*** Processing frame ***
015.0 ETH: DstMAC 1E-30-6C-A2-45-5E
015.0 ETH: SrcMAC 00-11-43-A4-FE-40
015.0 ETH: Proto IP4, 66 bytes
015.0 IP4:*** Processing frame ***
015.0 IP4: SrcAddr 192.168.0.5
015.0 IP4: DstAddr 192.168.0.150
015.0 IP4: Proto TCP, Id=0x0622
015.0 IP4: Length 52 bytes
015.0 TCP:*** Processing frame ***
015.0 TCP: Ports : Src=49232, Dst=80
015.0 TCP: Segment: Seq=0x31EDC88C, Ack=0x0
015.0 TCP: Control: [SYN] Win=8192, Cks=0x0C67
015.0 TCP: Mapped to Socket 1, state LISTEN
015.0 TCP:Process Options, 12 bytes
015.0 TCP: Opt-MSS: 1440
015.0 TCP: SendWin: 8192
015.0 TCP: RTO=4000ms (sa=0, sv=40)
015.0 TCP: Next state SYN_REC

In the above example, Ethernet, IP and TCP debug messages are enabled:

  • Received Ethernet packets are processed by the Ethernet layer and a debug message containing Ethernet header information is printed out. Ethernet debug information contains source and destination MAC address, Ethernet frame length and Ethernet protocol type.
  • The packet is then passed to the IP layer. IP layer prints out IP debug messages containing the IP header information such as source and destination IP address, frame length, protocol type etc.
  • When the IP layer has processed the packet, the packet is passed to the upper TCP layer. TCP layer prints out TCP debug messages containing the TCP header information such as source and destination ports, sequence and acknowledge numbers, checksum value, frame length etc.

Redirecting Output

Debug messages are output to a standard IO port. The Low level routine sendchar function outputs a single character. If required, you can customize this function to send the debug messages to some other device. In most cases, a serial ITM debug channel is used to print out the debug messages.

Note
  • When the sendchar function runs in polling mode, printing all debug messages significantly reduces the performance. The preferred way is to rewrite the sendchar function to work in the interrupt mode.
  • Use the highest baud rate possible to reduce the impact on performance from printing the debug messages.
  • If the debug mode is enabled and the embedded system is connected to a high traffic LAN with plenty of broadcast packets, the system might malfunction.
  • Printing debug messages blocks out the system task scheduler during the time when the message is being sent from the serial port. The incoming IP packets accumulate in the memory. This soon causes an out of memory error. Any further incoming packets are lost until some memory is released.

Migrating from RL-TCPnet

The following sections describe the changes to the API functions of the Network Component compared to RL-TCPnet, the Real-Time Library provided with MDK Version 4. Previously, there have been two files carrying the header files: rtl.h and net_config.h. This has been unified in MDK-ARM Version 5 to one header file called rl_net.h. The MDK-ARM Version 5 Network Component requires CMSIS-RTOS functionality. Events are no longer called by interrupt service routines which makes the timing of the overall system more predictable.

The API functions along with the differences are shown in the order:


RL-TCPnet: MDK-ARM Version 4 with links to the RL-ARM online manual.
Network Component v7: IPv4/IPv6 support.
Description of the difference (if more than a name change to the new naming convention).


Note
Some API function names are changed to unify the name space of the Software Components.

Changes from rtl.h


rtl.h         // Network API for RL-ARM middleware components (MDK-ARM Version 4)
rl_net.h      // Complete API for Network Component (MDK-ARM Version 5)

MDK Middleware now uses a single header file for the Network Component.


void       init_TcpNet   (void)
netStatus  netInitialize (void)

Return code changed to netStatus.


BOOL  main_TcpNet (void)
removed 

This function is now called internally in Network Component library.


void  timer_tick (void)
removed 

The function is now replaced by CMSIS-RTOS functionality and therefore no longer required.


U8       udp_get_socket   (U8 tos, U8 opt, U16 (*listener)(U8 socket, U8 *remip, U16 port, U8 *buf, U16 len))
int32_t  netUDP_GetSocket (netUDP_cb_t cb_func)

Return code changed to int32_t, removed parameters tos and opt. Refer to netUDP_cb_t.


BOOL       udp_release_socket   (U8      socket)
netStatus  netUDP_ReleaseSocket (int32_t socket)

Return code changed to netStatus.


BOOL       udp_open    (U8      socket, U16   locport)
netStatus  netUDP_Open (int32_t socket, uint16_t port)

Return code changed to netStatus.


BOOL       udp_close    (U8      socket)
netStatus  netUDP_Close (int32_t socket)

Return code changed to netStatus.


BOOL  udp_mcast_ttl (U8 socket, U8 ttl)
removed 

Use netUDP_SetOption instead.


U8      * udp_get_buf      (U16      size)
uint8_t * netUDP_GetBuffer (uint32_t size)

Identical functionality.


BOOL       udp_send    (U8      socket, U8 *remip, U16 remport, U8      *buf, U16     dlen)
netStatus  netUDP_Send (int32_t socket, const NET_ADDR *addr,   uint8_t *buf, uint32_t len)

Return code changed to netStatus and IP address to NET_ADDR.


U8       tcp_get_socket   (U8 type, U8 tos, U16 tout, U16 (*listener)(U8 socket, U8 event, U8 *buf, U16 len))
int32_t  netTCP_GetSocket (netTCP_cb_t cb_func)

Return code changed to int32_t, removed parameters type and tos. Refer to netTCP_cb_t.


BOOL       tcp_release_socket   (U8      socket)
netStatus  netTCP_ReleaseSocket (int32_t socket)

Return code changed to netStatus.


BOOL       tcp_listen    (U8      socket, U16   locport)
netStatus  netTCP_Listen (int32_t socket, uint16_t port)

Return code changed to netStatus.


BOOL       tcp_connect    (U8      socket, U8 *remip, U16 remport, U16      locport   )
netStatus  netTCP_Connect (int32_t socket, const NET_ADDR *addr,   uint16_t local_port)

Return code changed to netStatus and IP address to NET_ADDR.


U8      * tcp_get_buf      (U16      size)
uint8_t * netTCP_GetBuffer (uint32_t size)

Identical functionality.


U16       tcp_max_dsize            (U8      socket)
uint32_t  netTCP_GetMaxSegmentSize (int32_t socket)

Identical functionality.


BOOL  tcp_check_send   (U8      socket)
bool  netTCP_SendReady (int32_t socket)

Identical functionality.


U8            tcp_get_state   (U8      socket)
netTCP_State  netTCP_GetState (int32_t socket)

Return code changed to netTCP_State.


BOOL       tcp_send    (U8      socket, U8      *buf, U16     dlen)
netStatus  netTCP_Send (int32_t socket, uint8_t *buf, uint32_t len)

Return code changed to netStatus.


BOOL       tcp_close    (U8      socket)
netStatus  netTCP_Close (int32_t socket)

Return code changed to netStatus.


BOOL       tcp_abort    (U8      socket)
netStatus  netTCP_Abort (int32_t socket)

Return code changed to netStatus.


void       tcp_reset_window          (U8      socket)
netStatus  netTCP_ResetReceiveWindow (int32_t socket)

Return code changed to netStatus.


BOOL       arp_cache_ip   (                       U8      *ipadr,    U8               type)
netStatus  netARP_CacheIP (uint32_t if_num, const uint8_t *ip4_addr, netARP_CacheType type)

BOOL       arp_cache_mac   (                       U8      *hwadr)
netStatus  netARP_CacheMAC (uint32_t if_num, const uint8_t *mac_addr)
  • Return code changed to netStatus.
  • Added if_num specifying the network interface number.

void       ppp_listen     (const char *user,     const char *passw)
netStatus  netPPP_Listen  (const char *username, const char *password)

Return code changed to netStatus.


void       ppp_connect    (const char *dialnum,  const char *user,     const char *passw)
netStatus  netPPP_Connect (const char *dial_num, const char *username, const char *password)

Return code changed to netStatus.


void       ppp_close    (void)
netStatus  netPPP_Close (void)

Return code changed to netStatus.


void       slip_listen    (void)
netStatus  netSLIP_Listen (void)

Return code changed to netStatus.


void       slip_connect    (const char *dialnum)
netStatus  netSLIP_Connect (const char *dial_num)

Return code changed to netStatus.


void       slip_close    (void)
netStatus  netSLIP_Close (void)

Return code changed to netStatus.


U8         get_host_by_name      (U8         *hostn,                    void (*cbfunc)(U8 event, U8 *host_ip))
netStatus  netDNSc_GetHostByName (const char *name, int16_t addr_type,  netDNSc_cb_t cb_func)

BOOL       smtp_connect     (U8 *ipadr, U16 port, void (*cbfunc)(U8 event))
netStatus  netSMTPc_Connect (const NET_ADDR *addr)
  • Return code changed to netStatus.
  • Function callback parameter removed.
  • New function netSMTPc_Notify added for that purpose.

void       dhcp_disable    (void)
netStatus  netDHCP_Disable (uint32_t if_num)
  • Return code changed to netStatus.
  • The argument if_num specifies the network interface number.

BOOL       igmp_join    (                       U8      *group_ip)
netStatus  netIGMP_Join (uint32_t if_num, const uint8_t *ip4_addr)
  • Return code changed to netStatus.
  • The argument if_num specifies the network interface number.

BOOL       igmp_leave    (                       U8      *group_ip)
netStatus  netIGMP_Leave (uint32_t if_num, const uint8_t *ip4_addr)
  • Return code changed to netStatus.
  • The argument if_num specifies the network interface number.

BOOL       snmp_trap    (      U8 *manager_ip, U8     gen_trap, U8     spec_trap,       U16      *obj_list)
netStatus  netSNMP_Trap (const NET_ADDR *addr, uint8_t generic, uint8_t specific, const uint16_t *obj_list)

BOOL       snmp_set_community   (const char *community)
netStatus  netSNMP_SetCommunity (const char *community)

Return code changed to netStatus.


BOOL       icmp_ping    (      U8      *remip, void (*cbfunc)(U8 event))
netStatus  netPing_Echo (const NET_ADDR *addr, netPing_cb_t cb_func)

BOOL       ftpc_connect    (U8 *ipadr, U16 port,  U8             command, void (*cbfunc)(U8 event))
netStatus  netFTPc_Connect (const NET_ADDR *addr, netFTP_Command command)

BOOL       tftpc_put    (U8 *ipadr, U16  port, const char *src,   const char *dst,       void (*cbfunc)(U8 event))
netStatus  netTFTPc_Put (const NET_ADDR *addr, const char *fname, const char *local_fname)
  • Return code changed to netStatus.
  • Function callback parameter removed. New function netTFTPc_Notify added for that purpose.

BOOL       tftpc_get    (U8 *ipadr, U16  port, const char *src,   const char *dst,       void (*cbfunc)(U8 event))
netStatus  netTFTPc_Get (const NET_ADDR *addr, const char *fname, const char *local_fname)
  • Return code changed to netStatus.
  • Function callback parameter removed. New function netTFTPc_Notify added for that purpose.

BOOL       sntp_get_time    (      U8      *ipadr, void (*cbfunc)(U32 utc_time))
netStatus  netSNTPc_GetTime (const NET_ADDR *addr, netSNTPc_cb_t cb_func)

void  ftp_evt_notify (U8            evt)
void  netFTPs_Notify (netFTPs_Event event)

Event definitions changed to enum netFTPs_Event.


const char *http_encoding  (void)
const char *netCGI_Charset (void)

Identical functionality.


BSD socket functions

Return code changed from SCK_Exxx to BSD_ERROR_xxx.

Changes from net_config.h


net_config.h     // Common TCPnet definitions (MDK-ARM Version 4)
rl_net_ds.h      // Complete API for Network Component (MDK-ARM Version 5, Dual-Stack)

MDK Middleware now uses a single header file for the Network Component.


void  dhcp_cbfunc    (                 U8         opt,       U8      *val, U16      len)
void  netDHCP_Notify (uint32_t if_num, uint8_t option, const uint8_t *val, uint32_t len)
  • Added if_num specifying the network interface number.

void * http_fopen     (      U8   *name)
void * netHTTPs_fopen (const char *fname)

Identical functionality.


void  http_fclose     (void *file)
void  netHTTPs_fclose (void *file)

Identical functionality.


U16       http_fread     (void *file, U8      *buf, U16      len)
uint32_t  netHTTPs_fread (void *file, uint8_t *buf, uint32_t len)

Identical functionality.


BOOL   http_fgets     (void *file, U8   *buf, U16      size)
char  *netHTTPs_fgets (void *file, char *buf, uint32_t size)

Return code changed to *char.


U32   http_finfo     (      U8   *name)
void  netHTTPs_fstat (const char *fname, uint32_t *fsize, uint32_t *ftime)
  • Added parameters *fsize and *ftime.
  • Return code removed.

void  cgi_process_var     (      U8   *qstr)
void  netCGI_ProcessQuery (const char *qstr)

Identical functionality.


void  cgi_process_data   (U8      code,       U8   *dat,  U16      len)
void  netCGI_ProcessData (uint8_t code, const char *data, uint32_t len)

Identical functionality.


U16       cgi_func      (      U8   *env, U8   *buf, U16       buflen, U32      *pcgi)
uint32_t  netCGI_Script (const char *env, char *buf, uint32_t buf_len, uint32_t *pcgi)

Identical functionality.


      U8   * cgx_content_type   (void)
const char * netCGX_ContentType (void)

Return code changed to const char *.


BOOL  http_accept_host      (U8 *rem_ip, U16 rem_port)
bool  netHTTPs_AcceptClient (const NET_ADDR *addr)

Identical functionality.


BOOL  http_file_access    (U8 *fname, U8 user_id)
bool  netHTTPs_FileAccess (uint8_t user_id, const char *fname)

Identical functionality.


U8       http_check_account    (      U8   *user,           U8   *passw)
uint8_t  netHTTPs_CheckAccount (const char *username, const char *password)

Identical functionality.


      U8   * http_get_var     (      U8   *env, void *ansi, U16      maxlen)
const char * netCGI_GetEnvVar (const char *env, char *ansi, uint32_t max_len)

Return code changed to const char *.


      U8   * http_get_lang        (void)
const char * netHTTPs_GetLanguage (void)

Return code changed to const char *.


void       http_get_info      (REMOTEM *info)
netStatus  netHTTPs_GetClient (NET_ADDR *addr, uint32_t addr_len)

Return code changed to netStatus.


U8       http_get_session    (void)
int32_t  netHTTPs_GetSession (void)

Identical functionality.


U8       http_get_user_id   (void)
uint8_t  netHTTPs_GetUserId (void)

Identical functionality.


      U8   * http_get_content_type   (void)
const char * netHTTPs_GetContentType (void)

Return code changed to const char *.


U32   http_date (RL_TIME *time)
removed 

U16       tnet_cbfunc               (U8                code, U8   *buf, U16      buflen)
uint32_t  netTELNETs_ProcessMessage (netTELNETs_Message msg, char *buf, uint32_t buf_len)

Identical functionality.


U16       tnet_process_cmd          (      U8   *cmd, U8   *buf, U16      buflen,  U32      *pvar)
uint32_t  netTELNETs_ProcessCommand (const char *cmd, char *buf, uint32_t buf_len, uint32_t *pvar)

Identical functionality.


BOOL  tnet_ccmp               (      U8   *buf,       U8   *cmd)
bool  netTELNETs_CheckCommand (const char *cmd, const char *user_cmd)

Identical functionality.


void  tnet_set_delay (U16 cnt)
removed 

Use netTELNETs_RepeatCommand instead.


void       tnet_get_info        (REMOTEM *info)
netStatus  netTELNETs_GetClient (NET_ADDR *addr, uint32_t addr_len)

Return code changed to netStatus.


new int32_t netTELNETs_GetSession (void)

Identical functionality.


U8       tnet_get_user_id     (void)
uint8_t  netTELNETs_GetUserId (void)

Identical functionality.


BOOL  tnet_msg_poll (U8 session)
removed 

Use netTELNETs_RequestMessage instead.


BOOL  tnet_accept_host        (U8 *rem_ip, U16 rem_port)
bool  netTELNETs_AcceptClient (const NET_ADDR *addr)

Identical functionality.


U8    tnet_check_account (U8 code, U8 *id)
removed 

Use netTELNETs_CheckUsername and netTELNETs_CheckPassword instead.


void * tftp_fopen     (      U8   *fname,       U8   *mode)
void * netTFTPs_fopen (const char *fname, const char *mode)

Identical functionality.


void  tftp_fclose     (void *file)
void  netTFTPs_fclose (void *file)

Identical functionality.


U16       tftp_fread     (void *file, U8      *buf, U16      len)
uint32_t  netTFTPs_fread (void *file, uint8_t *buf, uint32_t len)

Identical functionality.


U16       tftp_fwrite     (void *file,       U8      *buf, U16      len)
uint32_t  netTFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len)

Identical functionality.


BOOL  tftp_accept_host      (U8 *rem_ip, U16 rem_port)
bool  netTFTPs_AcceptClient (const NET_ADDR *addr)

Identical functionality.


void * tftpc_fopen    (      U8   *fname,       U8   *mode)
void * netTFTPc_fopen (const char *fname, const char *mode)

Identical functionality.


void  tftpc_fclose    (void *file)
void  netTFTPc_fclose (void *file)

Identical functionality.


U16       tftpc_fread    (void *file, U8      *buf, U16      len)
uint32_t  netTFTPc_fread (void *file, uint8_t *buf, uint32_t len)

Identical functionality.


U16       tftpc_fwrite    (void *file,       U8      *buf, U16      len)
uint32_t  netTFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len)

Identical functionality.


void * ftp_fopen     (      U8   *fname,       U8   *mode)
void * netFTPs_fopen (const char *fname, const char *mode)

Identical functionality.


void  ftp_fclose     (void *file)
void  netFTPs_fclose (void *file)

Identical functionality.


U16       ftp_fread     (void *file, U8      *buf, U16      len)
uint32_t  netFTPs_fread (void *file, uint8_t *buf, uint32_t len)

Identical functionality.


U16       ftp_fwrite     (void *file,       U8      *buf, U16      len)
uint32_t  netFTPs_fwrite (void *file, const uint8_t *buf, uint32_t len)

Identical functionality.


BOOL  ftp_fdelete     (      U8   *fname)
bool  netFTPs_fdelete (const char *fname)

Identical functionality.


BOOL  ftp_frename     (      U8   *fname,       U8   *newn)
bool  netFTPs_frename (const char *fname, const char *newname)

Identical functionality.


U16      ftp_ffind     (    U8      code,  U8    *buf,   U8      *mask,   U16        len)
int32_t  netFTPs_ffind (const char *mask, char *fname, uint32_t *fsize, NET_FS_TIME *ftime, bool first)
  • name changed, functions not compatible.
  • removed parameters code, *buf and len.
  • added parameters *fname, *fsize, *ftime and first.
  • return code changed to return the status.

BOOL  ftp_accept_host      (U8 *rem_ip, U16 rem_port)
bool  netFTPs_AcceptClient (const NET_ADDR *addr)

Changed IP address and port to NET_ADDR.


U8    ftp_check_account (U8 code, U8 *id)
removed 

Use netFTPs_CheckUsername and netFTPs_CheckPassword instead.


U8       ftp_get_user_id   (void)
uint8_t  netFTPs_GetUserId (void)

Identical functionality.


BOOL  ftp_file_access    (U8 *fname, U8 mode, U8 user_id)
bool  netFTPs_FileAccess (uint8_t user_id, const char *fname, uint8_t access)

Identical functionality.


void  ftp_evt_notify (U8            evt)
void  netFTPs_Notify (netFTPs_Event event)

Changed event to netFTPs_Event enum.


void * ftpc_fopen    (                         U8   *mode)
void * netFTPc_fopen (const char *fname, const char *mode)
  • The argument fname specifies local file name.

void  ftpc_fclose    (void *file)
void  netFTPc_fclose (void *file)

Identical functionality.


U16       ftpc_fread    (void *file, U8      *buf, U16      len)
uint32_t  netFTPc_fread (void *file, uint8_t *buf, uint32_t len)

Identical functionality.


U16       ftpc_fwrite    (void *file,       U8      *buf, U16      len)
uint32_t  netFTPc_fwrite (void *file, const uint8_t *buf, uint32_t len)

Identical functionality.


U16       ftpc_cbfunc     (U8 code,                 U8   *buf, U16      buflen)
uint32_t  netFTPc_Process (netFTPc_Request request, char *buf, uint32_t buf_len)

Changed code/request to netFTPc_Request.


U16       smtp_cbfunc      (U8 code,                  U8   *buf, U16      buflen,  U32      *pvar)
uint32_t  netSMTPc_Process (netSMTPc_Request request, char *buf, uint32_t buf_len, uint32_t *pvar)

Changed code/request to netSMTPc_Request.


BOOL  smtp_accept_auth              (U8 *srv_ip)
bool  netSMTPc_AcceptAuthentication (const NET_ADDR *addr)

Changed IP address to NET_ADDR.

Migrating from Network Component v5/v6

Previous versions of the MDK-Professional Middleware (Keil.MDK-Middleware.6.5.0 and below) did not support IPv6. This has been added in the latest release. With this, a change in the namespace has taken place. Most functions are working identically, but have been extended to support IPv6. This reference compares the API changes for every component function-by-function. If you require a complete function reference for the old API, please install a previous version of the Network Component.

The API functions along with the differences are shown in the order:


Network Component v5/v6: IPv4-only support.
Network Component v7: IPv4/IPv6 support.
Description of the difference.




Network Core


netStatus net_initialize (void)
netStatus netInitialize  (void)
  • name changed, functions compatible
  • netInitialize creates netCore_Thread and RTOS protection objects (thread-safe).
  • netCore_Thread runs in event-driven mode

int net_main (void)
removed 
  • removed from Network-DS user API and moved to an internal netCore_Thread
  • netInitialize creates netCore_Thread and RTOS protection objects (thread-safe).



UDP Sockets


int32_t udp_get_socket   (uint8_t tos, uint8_t opt, net_udp_cb_t cb_func)
int32_t netUDP_GetSocket (                          netUDP_cb_t  cb_func)
  • name changed, functions not compatible
  • replaced parameters with default values: tos, opt
  • callback function changed to netUDP_cb_t (different parameters)
  • netUDP_GetSocket is thread-safe

Default values for removed parameters:

  • tos = 0,
  • opt = Calculate and verify checksum enabled.

Use netUDP_SetOption function to change these values:

To change the tos value use:

To disable the checksum calculation use:


uint32_t (*net_udp_cb_t)(int32_t socket, const uint8_t *ip_addr, uint16_t port, const uint8_t *buf, uint32_t len);
uint32_t (*netUDP_cb_t) (int32_t socket, const NET_ADDR   *addr,                const uint8_t *buf, uint32_t len);
  • name changed, functions not compatible
  • parameters *ip_addr and port replaced with structure *addr, where:
    ip_addr = addr->addr
    port = addr->port

netStatus udp_release_socket   (int32_t socket)
netStatus netUDP_ReleaseSocket (int32_t socket)
  • name changed, functions compatible
  • netUDP_ReleaseSocket is thread-safe

netStatus udp_open    (int32_t socket, uint16_t port)
netStatus netUDP_Open (int32_t socket, uint16_t port)
  • name changed, functions compatible
  • netUDP_Open is thread-safe

netStatus udp_close    (int32_t socket)
netStatus netUDP_Close (int32_t socket)
  • name changed, functions compatible
  • netUDP_Close is thread-safe

uint8_t *udp_get_buf      (uint32_t size)
uint8_t *netUDP_GetBuffer (uint32_t size)
  • name changed, functions compatible
  • netUDP_GetBuffer is thread-safe

netStatus udp_send    (int32_t socket, const uint8_t *ip_addr, uint16_t port, uint8_t *buf, uint32_t len)
netStatus netUDP_Send (int32_t socket, const NET_ADDR *addr,                  uint8_t *buf, uint32_t len)
  • name changed, functions not compatible
  • parameters *ip_addr and port replaced with *addr structure
  • netUDP_Send is thread-safe

To convert from old parameters to new NET_ADDR structure use the following code:

NET_ADDR4 addr4;
addr4.port = port;
memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);

netStatus udp_multicast_ttl (int32_t socket, uint8_t ttl)
removed 

Use netUDP_SetOption function to change ttl:




TCP Sockets


int32_t tcp_get_socket   (uint8_t type, uint8_t tos, uint32_t tout, net_tcp_cb_t cb_func)
int32_t netTCP_GetSocket (                                          netTCP_cb_t  cb_func)
  • name changed, functions not compatible
  • replaced parameters with defaults: type, tos, tout
  • callback function changed to netTCP_cb_t (different parameters)
  • netTCP_GetSocket is thread-safe

Default values for removed parameters:

  • type = 0,
  • tos = 0,
  • tout = default timeout specified in configuration Net_Config_TCP.h

Use netTCP_SetOption function to change the defaults.

To enable TCP_TYPE_DELAY_ACK use:

To enable TCP_TYPE_KEEP_ALIVE use:

To enable TCP_TYPE_FLOW_CTRL use:


uint32_t (*net_tcp_cb_t)(int32_t socket,     tcpEvent event,                       const uint8_t *buf, uint32_t len);
uint32_t (*netTCP_cb_t) (int32_t socket, netTCP_Event event, const NET_ADDR *addr, const uint8_t *buf, uint32_t len);
  • name changed, functions not compatible
  • parameter tcpEvent changed to netTCP_Event, enumerations are compatible
  • added parameter addr, which provides an IP address and port number of the remote peer
  • parameter buf and len functionality changed to provide only the data
    In Network v5/v6 the meaning of parameters was defined with an event type:
    • tcpEventData: buf = pointer to data, len = length of the data
    • other events: buf = IP address, len = port number.

netStatus tcp_release_socket   (int32_t socket)
netStatus netTCP_ReleaseSocket (int32_t socket)
  • name changed, functions compatible
  • netTCP_ReleaseSocket is thread-safe

netStatus tcp_listen    (int32_t socket, uint16_t port)
netStatus netTCP_Listen (int32_t socket, uint16_t port)
  • name changed, functions compatible
  • now implicitly starts a TCP socket in SERVER mode
  • netTCP_Listen is thread-safe

netStatus tcp_connect    (int32_t socket, const uint8_t *ip_addr, uint16_t port, uint16_t local_port)
netStatus netTCP_Connect (int32_t socket, const NET_ADDR *addr,                  uint16_t local_port)
  • name changed, functions not compatible
  • parameters *ip_addr and port need conversion to structure *addr Use the following code for the conversion:
    NET_ADDR4 addr4;
    addr4.port = port;
    memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);
  • now implicitly starts a TCP socket in CLIENT mode
  • netTCP_Connect is thread-safe

uint8_t *tcp_get_buf      (uint32_t size)
uint8_t *netTCP_GetBuffer (uint32_t size)
  • name changed, functions compatible
  • netTCP_GetBuffer is thread-safe

uint32_t tcp_max_data_size        (int32_t socket)
uint32_t netTCP_GetMaxSegmentSize (int32_t socket)
  • name changed, functions compatible
  • netTCP_GetMaxSegmentSize is thread-safe

bool tcp_check_send   (int32_t socket)
bool netTCP_SendReady (int32_t socket)
  • name changed, functions compatible
  • netTCP_SendReady is thread-safe

tcpState     tcp_get_state   (int32_t socket)
netTCP_State netTCP_GetState (int32_t socket)
  • name changed, functions not compatible
  • enumerator netTCP_State has an additional state netTCP_StateINVALID, which was not existing before
  • netTCP_GetState is thread-safe

const char *tcp_ntoa (tcpState state)
removed 

netStatus tcp_send    (int32_t socket, uint8_t *buf, uint32_t len)
netStatus netTCP_Send (int32_t socket, uint8_t *buf, uint32_t len)
  • name changed, functions compatible
  • netTCP_Send is thread-safe

netStatus tcp_close    (int32_t socket)
netStatus netTCP_Close (int32_t socket)
  • name changed, functions compatible
  • netTCP_Close is thread-safe

netStatus tcp_abort    (int32_t socket)
netStatus netTCP_Abort (int32_t socket)
  • name changed, functions compatible
  • netTCP_Abort is thread-safe

netStatus tcp_reset_window          (int32_t socket)
netStatus netTCP_ResetReceiveWindow (int32_t socket)
  • name changed, functions compatible
  • netTCP_ResetReceiveWindow is thread-safe



BSD Sockets

The BSD Socket API is not changed and is backward compatible. It has been extended to support new IPv6 addresses without breaking existing API.

FTP Server


bool ftp_accept_client    (const uint8_t *ip_addr, uint16_t port)
bool netFTPs_AcceptClient (const NET_ADDR *addr)
  • name changed, functions not compatible
  • parameters *ip_addr and port are replaced with structure *addr, where
    port = addr->port
    ip_addr = addr->addr

uint8_t ftp_check_username    (const char *username)
uint8_t netFTPs_CheckUsername (const char *username)
  • name changed, functions compatible

bool ftp_check_password    (uint8_t user_id, const char *password)
bool netFTPs_CheckPassword (uint8_t user_id, const char *password)
  • name changed, functions compatible

bool ftp_file_access    (uint8_t user_id, const char *fname, uint8_t  mode)
bool netFTPs_FileAccess (uint8_t user_id, const char *fname, uint32_t access)
  • name changed, functions not compatible
  • parameter mode changed to access:
    mode access
    0 NET_ACCESS_FILE_READ
    1 NET_ACCESS_FILE_WRITE
    2 NET_ACCESS_DIRECTORY_CREATE and NET_ACCESS_DIRECTORY_REMOVE
    3 NET_ACCESS_DIRECTORY_LIST

uint8_t ftp_get_user_id   (void)
uint8_t netFTPs_GetUserId (void)
  • name changed, functions compatible

void ftp_server_notify (ftpServerEvent event)
void netFTPs_Notify    (netFTPs_Event  event)
  • name changed, functions compatible
  • enumerators ftpServerEvent and netFTPs_Event are compatible

void *ftp_server_fopen (const char *fname, const char *mode)
void *netFTPs_fopen    (const char *fname, const char *mode)

Changed function name to new naming convention.


void ftp_server_fclose (void *file)
void netFTPs_fclose    (void *file)

Changed function name to new naming convention.


uint32_t ftp_server_fread (void *file, uint8_t *buf, uint32_t len)
uint32_t netFTPs_fread    (void *file, uint8_t *buf, uint32_t len)

Changed function name to new naming convention.


uint32_t ftp_server_fwrite (void *file, const uint8_t *buf, uint32_t len)
uint32_t netFTPs_fwrite    (void *file, const uint8_t *buf, uint32_t len)

Changed function name to new naming convention.


bool ftp_server_fdelete (const char *fname)
bool netFTPs_fdelete    (const char *fname)

Changed function name to new naming convention.


bool ftp_server_frename (const char *fname, const char *newname)
bool netFTPs_frename    (const char *fname, const char *newname)

Changed function name to new naming convention.


bool ftp_server_mkdir (const char *path)
bool netFTPs_mkdir    (const char *path)

Changed function name to new naming convention.


bool ftp_server_rmdir (const char *path)
bool netFTPs_rmdir    (const char *path)

Changed function name to new naming convention.


uint32_t ftp_server_ffind (uint8_t     code, char   *buf, uint32_t  buflen, const char  *mask)
int32_t  netFTPs_ffind    (const char *mask, char *fname, uint32_t  *fsize, NET_FS_TIME *ftime, bool first)
  • name changed, functions not compatible.
  • removed parameters code, *buf and len.
  • added parameters *fname, *fsize, *ftime and first.
  • return code changed to return the status.



FTP Client


netStatus ftp_client_connect (const uint8_t *ip_addr, uint16_t port, ftpCommand     command)
netStatus netFTPc_Connect    (const NET_ADDR *addr,                  netFTP_Command command)
  • name changed, functions not compatible
  • parameters *ip_addr and port need conversion to structure *addr
    Use the following code for the conversion:
    NET_ADDR4 addr4;
    addr4.port = port;
    memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);
  • enumerators ftpCommand and netFTP_Command are compatible
  • netFTPc_Connect is thread-safe

uint32_t ftp_client_request (ftpClientRequest request, char *buf, uint32_t len)
uint32_t netFTPc_Process    (netFTPc_Request  request, char *buf, uint32_t buf_len)
  • name changed, functions not compatible
  • enumerators ftpClientRequest and netFTPc_Request are not compatible:
    ftpClientRequest netFTPc_Request
    ftpClientUsername netFTPc_RequestUsername
    ftpClientPassword netFTPc_RequestPassword
    ftpClientPath netFTPc_RequestDirectory
    ftpClientFilename netFTPc_RequestName
    ftpClientDirectory netFTPc_RequestName
    ftpClientNewName netFTPc_RequestNewName
    ftpClientFilterMask netFTPc_RequestListMask
    ftpClientList netFTPc_RequestList
    ftpClientLocalFile netFTPc_RequestLocalFilename

void ftp_client_notify (ftpClientEvent event)
void netFTPc_Notify    (netFTPc_Event  event)
  • name changed, functions compatible
  • enumerators ftpClientEvent and netFTPc_Event are compatible

void *ftp_client_fopen (const char *fname, const char *mode)
void *netFTPc_fopen    (const char *fname, const char *mode)

Changed function name to new naming convention.


void ftp_client_fclose (void *file)
void netFTPc_fclose    (void *file)

Changed function name to new naming convention.


uint32_t ftp_client_fread (void *file, uint8_t *buf, uint32_t len)
uint32_t netFTPc_fread    (void *file, uint8_t *buf, uint32_t len)

Changed function name to new naming convention.


uint32_t ftp_client_fwrite (void *file, const uint8_t *buf, uint32_t len)
uint32_t netFTPc_fwrite    (void *file, const uint8_t *buf, uint32_t len)

Changed function name to new naming convention.




TFTP Server


bool tftp_accept_client    (const uint8_t *ip_addr, uint16_t port)
bool netTFTPs_AcceptClient (const NET_ADDR *addr)
  • name changed, functions not compatible
  • parameters *ip_addr and port are replaced with structure *addr, where
    port = addr->port
    ip_addr = addr->addr

void *tftp_server_fopen (const char *fname, const char *mode)
void *netTFTPs_fopen    (const char *fname, const char *mode)

Changed function name to new naming convention.


void tftp_server_fclose (void *file)
void netTFTPs_fclose    (void *file)

Changed function name to new naming convention.


uint32_t tftp_server_fread (void *file, uint8_t *buf, uint32_t len)
uint32_t netTFTPs_fread    (void *file, uint8_t *buf, uint32_t len)

Changed function name to new naming convention.


uint32_t tftp_server_fwrite (void *file, const uint8_t *buf, uint32_t len)
uint32_t netTFTPs_fwrite    (void *file, const uint8_t *buf, uint32_t len)

Changed function name to new naming convention.




TFTP Client


netStatus tftp_client_put (const uint8_t *ip_addr, uint16_t port, const char *src,   const char *dst)
netStatus netTFTPc_Put    (const NET_ADDR *addr,                  const char *fname, const char *local_fname)
  • name changed, functions not compatible
  • parameters *ip_addr and port need conversion to structure *addr
    Use the following code for the conversion:
    NET_ADDR4 addr4;
    addr4.port = port;
    memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);
  • parameter *src renamed to *local_name
  • parameter *dst renamed to *fname
  • netTFTPc_Put is thread-safe

netStatus tftp_client_get (const uint8_t *ip_addr, uint16_t port, const char *src,   const char *dst)
netStatus netTFTPc_Get    (const NET_ADDR *addr,                  const char *fname, const char *local_fname)
  • name changed, functions not compatible
  • parameters *ip_addr and port need conversion to structure *addr
    Use the following code for the conversion:
    NET_ADDR4 addr4;
    addr4.port = port;
    memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);
  • parameter *src renamed to *fname
  • parameter *dst renamed to *local_name
  • netTFTPc_Get is thread-safe

void tftp_client_notify (tftpClientEvent event)
void netTFTPc_Notify    (netTFTPc_Event  event)
  • name changed, functions not compatible
  • enumerators tftpClientEvent and netTFTPc_Event are not compatible:
    tftpClientEvent netTFTPc_Event
    tftpClientSuccess netTFTPc_EventSuccess
    tftpClientTimeout netTFTPc_EventTimeout
    tftpClientAccessDenied netTFTPc_EventAccessDenied
    tftpClientFileNotFound netTFTPc_EventFileNotFound
    tftpClientDiskFull netTFTPc_EventDiskFull
    tftpClientDiskFull netTFTPc_EventLocalFileError
    tftpClientError netTFTPc_EventError

void *tftp_client_fopen (const char *fname, const char *mode)
void *netTFTPc_fopen    (const char *fname, const char *mode)

Changed function name to new naming convention.


void tftp_client_fclose (void *file)
void netTFTPc_fclose    (void *file)

Changed function name to new naming convention.


uint32_t tftp_client_fread (void *file, uint8_t *buf, uint32_t len)
uint32_t netTFTPc_fread    (void *file, uint8_t *buf, uint32_t len)

Changed function name to new naming convention.


uint32_t tftp_client_fwrite (void *file, const uint8_t *buf, uint32_t len)
uint32_t netTFTPc_fwrite    (void *file, const uint8_t *buf, uint32_t len)

Changed function name to new naming convention.




Telnet Server


netStatus telnet_server_set_delay  (uint32_t delay)
netStatus netTELNETs_RepeatCommand (uint32_t delay)
  • name changed, functions compatible

netStatus telnet_server_get_client (uint8_t *ip_addr, uint8_t *mac_addr)
netStatus netTELNETs_GetClient     (NET_ADDR *addr, uint32_t addr_len)
  • name changed, functions not compatible
  • parameter *ip_addr replaced with structure *addr and addr_len
  • parameter *mac_addr removed
    Use netARP_GetMAC or netNDP_GetMAC to retrieve MAC address from cache

int32_t telnet_server_get_session (void)
int32_t netTELNETs_GetSession     (void)
  • name changed, functions compatible

bool telnet_check_command     (const char *cmd, const char *user_cmd)
bool netTELNETs_CheckCommand  (const char *cmd, const char *user_cmd)
  • name changed, functions compatible

uint32_t telnet_server_message      (telnetServerMessage msg, char *buf, uint32_t len)
uint32_t netTELNETs_ProcessMessage  (netTELNETs_Message  msg, char *buf, uint32_t buf_len)
  • name changed, functions compatible
  • enumerators telnetServerMessage and netTELNETs_Message are compatible, but the sequence of definitions is reordered

uint32_t telnet_server_process     (const char *cmd, char *buf, uint32_t buflen,  uint32_t *pvar)
uint32_t netTELNETs_ProcessCommand (const char *cmd, char *buf, uint32_t buf_len, uint32_t *pvar)
  • name changed, functions compatible

bool telnet_server_message_poll (int32_t session)
removed 

Use netTELNETs_RequestMessage function for unsolicited messages instead.

Network v7 library does not poll for unsolicited messages anymore. When a request for unsolicited message is registered with the netTELNETs_RequestMessage function, the server requests the message content with the function netTELNETs_ProcessMessage.


bool telnet_accept_client    (const uint8_t *ip_addr, uint16_t port)
bool netTELNETs_AcceptClient (const NET_ADDR *addr)
  • name changed, functions not compatible
  • parameters *ip_addr and port are replaced with structure *addr, where
    port = addr->port
    ip_addr = addr->addr

uint8_t telnet_check_username    (const char *username)
uint8_t netTELNETs_CheckUsername (const char *username)
  • name changed, functions compatible

bool telnet_check_password    (uint8_t user_id, const char *password)
bool netTELNETs_CheckPassword (uint8_t user_id, const char *password)
  • name changed, functions compatible

uint8_t telnet_get_user_id   (void)
uint8_t netTELNETs_GetUserId (void)
  • name changed, functions compatible



HTTP Server


const char *http_get_env_var (const char *env, char *ansi, uint32_t maxlen)
const char *netCGI_GetEnvVar (const char *env, char *ansi, uint32_t max_len)
  • name changed, functions compatible

uint32_t http_utc_time (uint8_t hr, uint8_t min, uint8_t sec, uint8_t day, uint8_t mon, uint16_t year)
removed 

netStatus http_server_get_client (uint8_t *ip_addr, uint8_t *mac_addr)
netStatus netHTTPs_GetClient     (NET_ADDR *addr, uint32_t addr_len)
  • name changed, functions not compatible
  • parameter *ip_addr replaced with structure *addr and addr_len
  • parameter *mac_addr removed
    Use netARP_GetMAC or netNDP_GetMAC to retrieve MAC address from cache

int32_t http_server_get_session (void)
int32_t netHTTPs_GetSession     (void)
  • name changed, functions compatible

const char *http_server_get_lang (void)
const char *netHTTPs_GetLanguage (void)
  • name changed, functions compatible

const char *http_server_get_content_type (void)
const char *netHTTPs_GetContentType      (void)

Changed function name to new naming convention.

  • name changed, functions compatible

void cgi_process_query   (const char *qstr)
void netCGI_ProcessQuery (const char *qstr)
  • name changed, functions compatible

void cgi_process_data   (uint8_t code, const char *data, uint32_t len)
void netCGI_ProcessData (uint8_t code, const char *data, uint32_t len)
  • name changed, functions compatible

uint32_t cgi_script    (const char *env, char *buf, uint32_t buflen,  uint32_t *pcgi)
uint32_t netCGI_Script (const char *env, char *buf, uint32_t buf_len, uint32_t *pcgi)
  • name changed, functions compatible

const char *cgi_content_type   (const char *file_ext)
const char *netCGI_ContentType (const char *file_ext)
  • name changed, functions compatible

const char *cgx_content_type   (void)
const char *netCGX_ContentType (void)
  • name changed, functions compatible

const char *http_encoding  (void)
const char *netCGI_Charset (void)
  • name changed, functions compatible

bool http_accept_client    (const uint8_t *ip_addr, uint16_t port)
bool netHTTPs_AcceptClient (const NET_ADDR *addr)
  • name changed, functions not compatible
  • parameters *ip_addr and port are replaced with structure *addr, where
    port = addr->port
    ip_addr = addr->addr

uint8_t http_check_account    (const char *username, const char *password)
uint8_t netHTTPs_CheckAccount (const char *username, const char *password)
  • name changed, functions compatible

bool http_file_access    (uint8_t user_id, const char *fname)
bool netHTTPs_FileAccess (uint8_t user_id, const char *fname)
  • name changed, functions compatible

uint8_t http_get_user_id   (void)
uint8_t netHTTPs_GetUserId (void)
  • name changed, functions compatible

void *http_server_fopen (const char *fname)
void *netHTTPs_fopen    (const char *fname)
  • name changed, functions compatible

void http_server_fclose (void *file)
void netHTTPs_fclose    (void *file)
  • name changed, functions compatible

uint32_t http_server_fread (void *file, uint8_t *buf, uint32_t len)
uint32_t netHTTPs_fread    (void *file, uint8_t *buf, uint32_t len)
  • name changed, functions compatible

char *http_server_fgets (void *file, char *buf, uint32_t size)
char *netHTTPs_fgets    (void *file, char *buf, uint32_t size)
  • name changed, functions compatible

uint32_t http_server_ftime (const char *fname)
removed 

Use netHTTPs_fstat instead.




SMTP Client


netStatus smtp_client_connect (const uint8_t *ip_addr, uint16_t port)
netStatus netSMTPc_Connect    (const NET_ADDR *addr)
  • name changed, functions not compatible
  • parameters *ip_addr and port need conversion to structure *addr
    Use the following code for the conversion:
    NET_ADDR4 addr4;
    addr4.port = port;
    memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);
  • netSMTPc_Connect is thread-safe

uint32_t smtp_client_request (smtpClientRequest request, char *buf, uint32_t buflen,  uint32_t *pvar)
uint32_t netSMTPc_Process    (netSMTPc_Request  request, char *buf, uint32_t buf_len, uint32_t *pvar)
  • name changed, functions not compatible
  • enumerators smtpClientRequest and netSMTPc_Request are compatible.

void smtp_client_notify (smtpClientEvent event)
void netSMTPc_Notify    (netSMTPc_Event  event)
  • name changed, functions compatible
  • enumerators smtpClientEvent and netSMTPc_Event are compatible

bool smtp_client_accept_authentication (const uint8_t *ip_addr)
bool netSMTPc_AcceptAuthentication     (const NET_ADDR *addr)
  • name changed, functions not compatible
  • parameter *ip_addr replaced with structure *addr, where:
    ip_addr = addr->addr



SNTP Client


netStatus sntp_get_time    (const uint8_t *ip_addr, net_sntp_client_cb_t cb_func)
netStatus netSNTPc_GetTime (const NET_ADDR *addr,   netSNTPc_cb_t        cb_func)

void (*net_sntp_client_cb_t)(uint32_t utc_time);
void (*netSNTPc_cb_t)       (uint32_t seconds, uint32_t seconds_fraction);
  • name changed, functions not compatible
  • parameter utc_time renamed to seconds
  • parameter seconds_fraction added



SNMP Agent


netStatus snmp_trap    (const uint8_t *ip_addr, uint8_t generic, uint8_t specific, const uint16_t *obj_list)
netStatus netSNMP_Trap (const NET_ADDR *addr,   uint8_t generic, uint8_t specific, const uint16_t *obj_list)
  • name changed, functions not compatible
  • parameter *ip_addr changed to structure *addr
    Use the following code for the conversion:
    NET_ADDR4 addr4;
    memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);
  • netSNMP_Trap is thread-safe

netStatus snmp_set_community   (const char *community)
netStatus netSNMP_SetCommunity (const char *community)
  • name changed, functions compatible
  • netSNMP_SetCommunity is thread-safe



Network Interfaces


netStatus arp_cache_ip   (uint32_t if_num, const uint8_t *ip_addr,  arpCacheType type)
netStatus netARP_CacheIP (uint32_t if_num, const uint8_t *ip4_addr, netARP_CacheType type)
  • name changed, functions compatible
  • enumerators arpCacheType and netARP_CacheType are compatible
  • netARP_CacheIP is thread-safe

netStatus arp_cache_mac   (uint32_t if_num, const uint8_t *mac_addr)
netStatus netARP_CacheMAC (uint32_t if_num, const uint8_t *mac_addr)
  • name changed, functions compatible
  • netARP_CacheMAC is thread-safe

netStatus arp_get_ip   (                 const uint8_t *mac_addr, uint8_t *ip_addr)
netStatus netARP_GetIP (uint32_t if_num, const uint8_t *mac_addr, uint8_t *ip4_addr)
  • name changed, functions not compatible
  • parameter if_num added
    Use if_num=0 when replacing arp_get_ip
  • netARP_GetIP is thread-safe

netStatus arp_get_mac   (                 const uint8_t *ip_addr,  uint8_t *mac_addr)
netStatus netARP_GetMAC (uint32_t if_num, const uint8_t *ip4_addr, uint8_t *mac_addr)
  • name changed, functions not compatible
  • parameter if_num added
    Use if_num=0 when replacing arp_get_mac
  • netARP_GetMAC is thread-safe

netStatus dhcp_disable    (uint32_t if_num)
netStatus netDHCP_Disable (uint32_t if_num)
  • name changed, functions compatible
  • netDHCP_Disable is thread-safe

netStatus igmp_join    (uint32_t if_num, const uint8_t *ip_addr)
netStatus netIGMP_Join (uint32_t if_num, const uint8_t *ip4_addr)
  • name changed, functions compatible
  • netIGMP_Join is thread-safe

netStatus igmp_leave    (uint32_t if_num, const uint8_t *ip_addr)
netStatus netIGMP_Leave (uint32_t if_num, const uint8_t *ip4_addr)
  • name changed, functions compatible
  • netIGMP_Leave is thread-safe

void eth_link_notify (uint32_t if_num, ethLinkEvent event)
void netETH_Notify   (uint32_t if_num, netETH_Event event, uint32_t val)
  • name changed, functions not compatible
  • parameter val added
  • enumerators ethLinkEvent and netETH_Event are not compatible:
    • events ethLinkDown and netETH_LinkDown are equal
    • multiple events ethLinkUp_xxxx are replaced by a single event netETH_LinkUp, where additional parameter val provides more information about the link

void dhcp_client_notify (uint32_t if_num, dhcpClientOption opt, const uint8_t *val, uint32_t len)
void netDHCP_Notify     (uint32_t if_num,       uint8_t option, const uint8_t *val, uint32_t len)
  • name changed, functions not compatible
  • parameter opt changed to option:
    opt option
    dhcpClientIPaddress #define NET_DHCP_OPTION_IP_ADDRESS
    dhcpClientNTPservers #define NET_DHCP_OPTION_NTP_SERVERS
    dhcpClientBootfileName #define NET_DHCP_OPTION_BOOTFILE_NAME

netStatus ppp_listen     (const char *username, const char *password)
netStatus netPPP_Listen  (const char *username, const char *password)
  • name changed, functions compatible
  • netPPP_Listen is thread-safe

netStatus ppp_connect    (const char *dial_num, const char *username, const char *password)
netStatus netPPP_Connect (const char *dial_num, const char *username, const char *password)
  • name changed, functions compatible
  • netPPP_Connect is thread-safe

netStatus ppp_close    (void)
netStatus netPPP_Close (void)
  • name changed, functions compatible
  • netPPP_Close is thread-safe

bool ppp_is_up     (void)
bool netPPP_LinkUp (void)
  • name changed, functions compatible
  • netPPP_LinkUp is thread-safe

netStatus slip_listen    (void)
netStatus netSLIP_Listen (void)
  • name changed, functions compatible
  • netSLIP_Listen is thread-safe

netStatus slip_connect    (const char *dial_num)
netStatus netSLIP_Connect (const char *dial_num)
  • name changed, functions compatible
  • netSLIP_Connect is thread-safe

netStatus slip_close    (void)
netStatus netSLIP_Close (void)
  • name changed, functions compatible
  • netSLIP_Close is thread-safe

bool slip_is_up     (void)
bool netSLIP_LinkUp (void)
  • name changed, functions compatible
  • netSLIP_LinkUp is thread-safe

netStatus icmp_ping    (const uint8_t *ip_addr, net_icmp_cb_t cb_func)
netStatus netPing_Echo (const NET_ADDR *addr,   netPing_cb_t  cb_func)
  • name changed, functions not compatible
  • parameter *ip_addr changed to structure *addr
    Use the following code for the conversion:
    NET_ADDR4 addr4;
    memcpy (addr4.addr, ip_addr, NET_ADDR_IP4_LEN);
    // addr4.port - don't care
  • callback function changed to netPing_cb_t
  • netPing_Echo is thread-safe

void (*net_icmp_cb_t)(icmpEvent     event);
void (*netPing_cb_t) (netPing_Event event);
  • name changed, functions compatible
  • enumerators icmpEvent and netPing_Event are compatible

netStatus get_host_by_name      (const char *name,                    net_dns_client_cb_t cb_func)
netStatus netDNSc_GetHostByName (const char *name, int16_t addr_type, netDNSc_cb_t        cb_func)
  • name changed, functions not compatible
  • added parameter addr_type
  • callback function changed to netDNSc_cb_t
  • netDNSc_GetHostByName is thread-safe

void (*net_dns_client_cb_t)(dnsClientEvent event, const uint8_t *ip_addr);
void (*netDNSc_cb_t)       (netDNSc_Event  event, const NET_ADDR   *addr);
  • name changed, functions not compatible
  • enumerators dnsClientEvent and netDNSc_Event are compatible
  • parameter *ip_addr replaced with structure *addr, where:
    ip_addr = addr->addr



Network Address Conversion


const char *ip4_ntoa   (                    const uint8_t *ip4_addr)
const char *netIP_ntoa (int16_t addr_type,  const uint8_t *ip_addr, char *string_buf, uint32_t buf_len)
  • name changed, functions not compatible
  • parameters addr_type, *string_buf and buf_len added.
    Use the following code for the conversion:
    char ip_ascii[16];
    netIP_ntoa (NET_ADDR_IP4, ip4_addr, ip_ascii, sizeof(ip_ascii));
  • netIP_ntoa is thread-safe

bool ip4_aton   (const char *cp,                             uint8_t *ip4_addr)
bool netIP_aton (const char *addr_string, int16_t addr_type, uint8_t *ip_addr)
  • name changed, functions not compatible
  • parameter *cp renamed to *addr_string
  • parameters addr_type and *ip_addr added
    Use the following code for the conversion:
    netIP_aton (cp, NET_ADDR_IP4, ip4_addr);
  • netIP_aton is thread-safe

const char *mac_ntoa    (const uint8_t *mac_addr)
const char *netMAC_ntoa (const uint8_t *mac_addr, char *string_buf, uint32_t buf_len)
  • name changed, functions not compatible
  • parameters addr_type, *string_buf and buf_len added
    Use the following code for the conversion:
    char mac_ascii[20];
    netMAC_ntoa (mac_addr, mac_ascii, sizeof(mac_ascii));
  • netMAC_ntoa is thread-safe

bool mac_aton    (const char *cp,         uint8_t *mac_addr)
bool netMAC_aton (const char *mac_string, uint8_t *mac_addr)
  • name changed, functions compatible
  • parameter *cp renamed to *mac_string
  • netMAC_aton is thread-safe

Network Definitions

Network definitions have been changed. Refer to this table:

Network Component v5/v6 Network Component v7
IP4_ADDR_LEN NET_ADDR_IP4_LEN
ETH_ADDR_LEN NET_ADDR_ETH_LEN