This module is mainly used to obtain the MAC address list and IP address list of all Ethernet NICs on a device. It applies to scenarios where wired network connection information needs to be obtained.
An Ethernet NIC is a wired network interface on a device. Each Ethernet NIC has a unique MAC address (physical address) and a possibly configured IP address. The MAC address is used to uniquely identify a network device on the network, and the IP address is used for network communication.
Usage: Call OH_Ethernet_GetMacAddress to obtain the MAC address list of Ethernet NICs, and call OH_Ethernet_GetNetAddress to obtain the IP address list of Ethernet NICs. The returned data structure contains the interface name and the corresponding address information.
Since: 26.0.0
| Name | Description |
|---|---|
| net_ethernet.h | Provides C APIs for the Ethernet NIC module. |
| net_ethernet_type.h | Defines data structures for the C APIs of the Ethernet NIC module. |