Network Component
Version 7.19.0
MDK Middleware for IPv4 and IPv6 Networking
|
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:
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:
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:
Select the variant IPv4/IPv6 Release to get rid of this validation message:
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:
A few legacy API functions cannot be used with the compatibility mode:
These example projects will not build:
After pressing OK, the Project window will look like this:
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 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.
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:
Finally, after merging the configuration files, you should be able to compile the project and run it on your target hardware:
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.
In previous versions, the
LOCALM structure defined network parameters for all available interfaces (Ethernet, PPP or SLIP). It was defined as follows:
Access to the structure was directly available using:
Code Examples
Previous Versions
Network Component v7
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
Network Component v7
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
Network Component v7
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:
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
Network Component v7
Previous versions started the HTTP server automatically in net_initialize. Now it is required to start the HTTP server either using:
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 |
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:
Previous versions started the FTP server automatically in net_initialize. Now it is required to start the FTP server either using:
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 |
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:
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 |
Previous versions started the TFTP server automatically in net_initialize. Now it is required to start the TFTP server either using:
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:
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 |
Previous versions started the Telnet server automatically in net_initialize. Now it is required to start the Telnet server either using:
The following API functions are added:
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:
snmp_mib
and snmp_mib_size
,The following API functions are added:
The following API functions are added:
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.
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:
The following API functions are deprecated:
The following API functions are added:
The following API functions are added:
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.
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_MEM_SIZE
presentation changed from words to bytesNET_START_SERVICE
setting added for compatibility with Network version 5NET_THREAD_STACK_SIZE
and NET_THREAD_PRIORITY
settings addedERROR_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 |
ETH_THREAD_STACK_SIZE
and ETH_THREAD_PRIORITY
)FTP_SERVER_AUTH_ADMIN
added)FTP_SERVER_ROOT_ENABLE
and FTP_SERVER_ROOT_FOLDER
)HTTP_SERVER_AUTH_ADMIN
added)HTTP_SERVER_ROOT_ENABLE
and HTTP_SERVER_ROOT_FOLDER
)PPP_THREAD_STACK_SIZE
and PPP_THREAD_PRIORITY
)SLIP_THREAD_STACK_SIZE
and SLIP_THREAD_PRIORITY
)In principle, the configuration files are compatible, but the following default settings have changed:
TELNET_SERVER_AUTH_ADMIN
added)TFTP_SERVER_ROOT_ENABLE
and TFTP_SERVER_ROOT_FOLDER
)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:
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:
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:
In the above example, Ethernet, IP and TCP debug messages are enabled:
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.
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).
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)
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)
addr_type
.BOOL smtp_connect (U8 *ipadr, U16 port, void (*cbfunc)(U8 event)) netStatus netSMTPc_Connect (const NET_ADDR *addr)
void dhcp_disable (void) netStatus netDHCP_Disable (uint32_t if_num)
BOOL igmp_join ( U8 *group_ip) netStatus netIGMP_Join (uint32_t if_num, const uint8_t *ip4_addr)
BOOL igmp_leave ( U8 *group_ip) netStatus netIGMP_Leave (uint32_t if_num, const uint8_t *ip4_addr)
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)
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)
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.
Return code changed from SCK_Exxx to BSD_ERROR_xxx.
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)
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)
*fsize
and *ftime
.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)
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)
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.
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.
netStatus net_initialize (void) netStatus netInitialize (void)
int net_main (void) removed
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)
Default values for removed parameters:
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);
netStatus udp_release_socket (int32_t socket) netStatus netUDP_ReleaseSocket (int32_t socket)
netStatus udp_open (int32_t socket, uint16_t port) netStatus netUDP_Open (int32_t socket, uint16_t port)
netStatus udp_close (int32_t socket) netStatus netUDP_Close (int32_t socket)
uint8_t *udp_get_buf (uint32_t size) uint8_t *netUDP_GetBuffer (uint32_t size)
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)
To convert from old parameters to new NET_ADDR structure use the following code:
netStatus udp_multicast_ttl (int32_t socket, uint8_t ttl) removed
Use netUDP_SetOption function to change ttl:
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)
Default values for removed parameters:
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);
tcpEventData:
buf = pointer to data, len = length of the datanetStatus tcp_release_socket (int32_t socket) netStatus netTCP_ReleaseSocket (int32_t socket)
netStatus tcp_listen (int32_t socket, uint16_t port) netStatus netTCP_Listen (int32_t socket, uint16_t port)
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)
uint8_t *tcp_get_buf (uint32_t size) uint8_t *netTCP_GetBuffer (uint32_t size)
uint32_t tcp_max_data_size (int32_t socket) uint32_t netTCP_GetMaxSegmentSize (int32_t socket)
bool tcp_check_send (int32_t socket) bool netTCP_SendReady (int32_t socket)
tcpState tcp_get_state (int32_t socket) netTCP_State netTCP_GetState (int32_t socket)
netTCP_StateINVALID
, which was not existing beforeconst 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)
netStatus tcp_close (int32_t socket) netStatus netTCP_Close (int32_t socket)
netStatus tcp_abort (int32_t socket) netStatus netTCP_Abort (int32_t socket)
netStatus tcp_reset_window (int32_t socket) netStatus netTCP_ResetReceiveWindow (int32_t socket)
The BSD Socket API is not changed and is backward compatible. It has been extended to support new IPv6 addresses without breaking existing API.
bool ftp_accept_client (const uint8_t *ip_addr, uint16_t port) bool netFTPs_AcceptClient (const NET_ADDR *addr)
uint8_t ftp_check_username (const char *username) uint8_t netFTPs_CheckUsername (const char *username)
bool ftp_check_password (uint8_t user_id, const char *password) bool netFTPs_CheckPassword (uint8_t user_id, const char *password)
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)
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)
void ftp_server_notify (ftpServerEvent event) void netFTPs_Notify (netFTPs_Event event)
ftpServerEvent
and netFTPs_Event
are compatiblevoid *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)
netStatus ftp_client_connect (const uint8_t *ip_addr, uint16_t port, ftpCommand command) netStatus netFTPc_Connect (const NET_ADDR *addr, netFTP_Command command)
ftpCommand
and netFTP_Command
are compatible 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)
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)
ftpClientEvent
and netFTPc_Event
are compatiblevoid *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.
bool tftp_accept_client (const uint8_t *ip_addr, uint16_t port) bool netTFTPs_AcceptClient (const NET_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.
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)
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)
void tftp_client_notify (tftpClientEvent event) void netTFTPc_Notify (netTFTPc_Event event)
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.
netStatus telnet_server_set_delay (uint32_t delay) netStatus netTELNETs_RepeatCommand (uint32_t delay)
netStatus telnet_server_get_client (uint8_t *ip_addr, uint8_t *mac_addr) netStatus netTELNETs_GetClient (NET_ADDR *addr, uint32_t addr_len)
int32_t telnet_server_get_session (void) int32_t netTELNETs_GetSession (void)
bool telnet_check_command (const char *cmd, const char *user_cmd) bool netTELNETs_CheckCommand (const char *cmd, const char *user_cmd)
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)
telnetServerMessage
and netTELNETs_Message
are compatible, but the sequence of definitions is reordereduint32_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)
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)
uint8_t telnet_check_username (const char *username) uint8_t netTELNETs_CheckUsername (const char *username)
bool telnet_check_password (uint8_t user_id, const char *password) bool netTELNETs_CheckPassword (uint8_t user_id, const char *password)
uint8_t telnet_get_user_id (void) uint8_t netTELNETs_GetUserId (void)
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)
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)
int32_t http_server_get_session (void) int32_t netHTTPs_GetSession (void)
const char *http_server_get_lang (void) const char *netHTTPs_GetLanguage (void)
const char *http_server_get_content_type (void) const char *netHTTPs_GetContentType (void)
Changed function name to new naming convention.
void cgi_process_query (const char *qstr) void netCGI_ProcessQuery (const char *qstr)
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)
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)
const char *cgi_content_type (const char *file_ext) const char *netCGI_ContentType (const char *file_ext)
const char *cgx_content_type (void) const char *netCGX_ContentType (void)
const char *http_encoding (void) const char *netCGI_Charset (void)
bool http_accept_client (const uint8_t *ip_addr, uint16_t port) bool netHTTPs_AcceptClient (const NET_ADDR *addr)
uint8_t http_check_account (const char *username, const char *password) uint8_t netHTTPs_CheckAccount (const char *username, const char *password)
bool http_file_access (uint8_t user_id, const char *fname) bool netHTTPs_FileAccess (uint8_t user_id, const char *fname)
uint8_t http_get_user_id (void) uint8_t netHTTPs_GetUserId (void)
void *http_server_fopen (const char *fname) void *netHTTPs_fopen (const char *fname)
void http_server_fclose (void *file) void netHTTPs_fclose (void *file)
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)
char *http_server_fgets (void *file, char *buf, uint32_t size) char *netHTTPs_fgets (void *file, char *buf, uint32_t size)
uint32_t http_server_ftime (const char *fname) removed
Use netHTTPs_fstat instead.
netStatus smtp_client_connect (const uint8_t *ip_addr, uint16_t port) netStatus netSMTPc_Connect (const NET_ADDR *addr)
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)
smtpClientRequest
and netSMTPc_Request
are compatible.void smtp_client_notify (smtpClientEvent event) void netSMTPc_Notify (netSMTPc_Event event)
smtpClientEvent
and netSMTPc_Event
are compatiblebool smtp_client_accept_authentication (const uint8_t *ip_addr) bool netSMTPc_AcceptAuthentication (const NET_ADDR *addr)
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);
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)
netStatus snmp_set_community (const char *community) netStatus netSNMP_SetCommunity (const char *community)
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)
arpCacheType
and netARP_CacheType
are compatiblenetStatus arp_cache_mac (uint32_t if_num, const uint8_t *mac_addr) netStatus netARP_CacheMAC (uint32_t if_num, const uint8_t *mac_addr)
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)
if_num=0
when replacing arp_get_ip 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)
if_num=0
when replacing arp_get_mac netStatus dhcp_disable (uint32_t if_num) netStatus netDHCP_Disable (uint32_t if_num)
netStatus igmp_join (uint32_t if_num, const uint8_t *ip_addr) netStatus netIGMP_Join (uint32_t if_num, const uint8_t *ip4_addr)
netStatus igmp_leave (uint32_t if_num, const uint8_t *ip_addr) netStatus netIGMP_Leave (uint32_t if_num, const uint8_t *ip4_addr)
void eth_link_notify (uint32_t if_num, ethLinkEvent event) void netETH_Notify (uint32_t if_num, netETH_Event event, uint32_t val)
ethLinkEvent
and netETH_Event
are not compatible:ethLinkDown
and netETH_LinkDown
are equalethLinkUp_xxxx
are replaced by a single event
netETH_LinkUp, where additional parameter val provides more information about the linkvoid 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)
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)
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)
netStatus ppp_close (void) netStatus netPPP_Close (void)
bool ppp_is_up (void) bool netPPP_LinkUp (void)
netStatus slip_listen (void) netStatus netSLIP_Listen (void)
netStatus slip_connect (const char *dial_num) netStatus netSLIP_Connect (const char *dial_num)
netStatus slip_close (void) netStatus netSLIP_Close (void)
bool slip_is_up (void) bool netSLIP_LinkUp (void)
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)
void (*net_icmp_cb_t)(icmpEvent event); void (*netPing_cb_t) (netPing_Event event);
icmpEvent
and netPing_Event
are compatiblenetStatus 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)
addr_type
void (*net_dns_client_cb_t)(dnsClientEvent event, const uint8_t *ip_addr); void (*netDNSc_cb_t) (netDNSc_Event event, const NET_ADDR *addr);
dnsClientEvent
and netDNSc_Event
are compatible
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)
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)
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)
bool mac_aton (const char *cp, uint8_t *mac_addr) bool netMAC_aton (const char *mac_string, uint8_t *mac_addr)
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 |