Network Component  Version 7.12.0
MDK Middleware for IPv4 and IPv6 Networking
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Common Interface

Generic functions for all kinds of interfaces help to get or set interface options. More...

Content

 User API
 Common functions for all Interfaces.
 
 User Callbacks
 Functions to notify the user application about events on the interface.
 
 Enumerations
 Common enumerations for all Interfaces.
 
 Structures
 Common structures for all Interfaces.
 

Description

Generic functions for all kinds of interfaces help to get or set interface options.

These functions are used to read various interface settings (such as the IP4 address, subnet mask, default gateway etc.), and to change these settings at run time. For example, you can read the IP address assigned via DHCP using the netIF_GetOption function, or change a static IP address using the netIF_SetOption function.

This documentation is separated as follows:

Interface Identification Number

Several functions have a parameter if_id to indicate the network interface. It is composed of the network interface class identifier and an interface number (or-ed).

The interface class identifier is specified with the following defines:

The interface number is a zero-based number to identify the interface within the class.

Note
Currently only one Ethernet interface and one WiFi interface is supported and therefore the interface number in if_id is always set to 0.

Code Example

// Ethernet interface 0
uint32_t if_id = NET_IF_CLASS_ETH | 0;
// WiFi interface 0
uint32_t if_id = NET_IF_CLASS_WIFI | 0;
// PPP interface
uint32_t if_id = NET_IF_CLASS_PPP;
// SLIP interface
uint32_t if_id = NET_IF_CLASS_SLIP;

Interface Number

Several functions have a parameter if_num, which indicates an instance of the Ethernet or Wifi interface. The interface number is a zero-based number to identify the interface within the Ethernet or WiFi class.

Note
Currently only one Ethernet interface and one WiFi interface is supported and therefore if_num is always set to 0.