Network Component
Version 7.19.0
MDK Middleware for IPv4 and IPv6 Networking
|
Common functions for all Interfaces. More...
Typedefs | |
typedef void(* | netARP_cb_t) (netARP_Event event) |
ARP Probe Event callback function. More... | |
typedef void(* | netNDP_cb_t) (netNDP_Event event) |
NDP Probe Event callback function. More... | |
Functions | |
netStatus | netIF_GetOption (uint32_t if_id, netIF_Option option, uint8_t *buf, uint32_t buf_len) |
Get the current value of an Interface option. [thread-safe]. More... | |
netStatus | netIF_SetOption (uint32_t if_id, netIF_Option option, const uint8_t *buf, uint32_t buf_len) |
Set the value of an Interface option. [thread-safe]. More... | |
netStatus | netIF_SetDefault (uint32_t if_id, netIF_Version ip_version) |
Set default network interface for Internet access. [thread-safe]. More... | |
netStatus | netARP_CacheIP (uint32_t if_id, const uint8_t *ip4_addr, netARP_CacheType type) |
Determine whether the ARP table has MAC address resolved for requested IP address. [thread-safe]. More... | |
netStatus | netARP_CacheMAC (uint32_t if_id, const uint8_t *mac_addr) |
Determine whether the ARP table has IP address resolved for requested MAC address. [thread-safe]. More... | |
netStatus | netARP_GetIP (uint32_t if_id, const uint8_t *mac_addr, uint8_t *ip4_addr) |
Get IP address from the ARP cache. [thread-safe]. More... | |
netStatus | netARP_GetMAC (uint32_t if_id, const uint8_t *ip4_addr, uint8_t *mac_addr) |
Get MAC address from the ARP cache. [thread-safe]. More... | |
netStatus | netARP_Probe (uint32_t if_id, const uint8_t *ip4_addr, netARP_cb_t cb_func) |
Determine whether the IP address is already in use. [thread-safe]. More... | |
netStatus | netARP_ProbeX (uint32_t if_id, const uint8_t *ip4_addr) |
Determine whether the IP address is already in use in blocking mode. [thread-safe]. More... | |
netStatus | netARP_ClearCache (uint32_t if_id) |
Flush or clear the local ARP cache. [thread-safe]. More... | |
netStatus | netIGMP_Join (uint32_t if_id, const uint8_t *ip4_addr) |
Join this host to a host group specified with IP address. [thread-safe]. More... | |
netStatus | netIGMP_Leave (uint32_t if_id, const uint8_t *ip4_addr) |
Leave a host group specified with IP address. [thread-safe]. More... | |
netStatus | netDHCP_Enable (uint32_t if_id) |
Enable Dynamic Host Configuration at runtime. [thread-safe]. More... | |
netStatus | netDHCP_Disable (uint32_t if_id) |
Disable Dynamic Host Configuration at runtime. [thread-safe]. More... | |
netStatus | netDHCP_SetOption (uint32_t if_id, uint8_t option, const uint8_t *val, uint32_t len) |
Set DHCP Option value at runtime. [thread-safe]. More... | |
netStatus | netNBNS_Resolve (uint32_t if_id, const char *name, uint8_t *ip4_addr) |
Resolve IP address of a host from a NetBIOS hostname. [thread-safe]. More... | |
netStatus | netNBNS_ClearCache (uint32_t if_id) |
Flush or clear the local NBNS cache. [thread-safe]. More... | |
netStatus | netNDP_CacheIP (uint32_t if_id, const uint8_t *ip6_addr) |
Determine whether neighbor cache has MAC address resolved for requested IP address. [thread-safe]. More... | |
netStatus | netNDP_GetIP (uint32_t if_id, const uint8_t *mac_addr, uint8_t *ip6_addr) |
Get IP address from neighbor discovery cache. [thread-safe]. More... | |
netStatus | netNDP_GetMAC (uint32_t if_id, const uint8_t *ip6_addr, uint8_t *mac_addr) |
Get MAC address from neighbor discovery cache. [thread-safe]. More... | |
netStatus | netNDP_Probe (uint32_t if_id, const uint8_t *ip6_addr, netNDP_cb_t cb_func) |
Determine whether the IP address is already in use. [thread-safe]. More... | |
netStatus | netNDP_ProbeX (uint32_t if_id, const uint8_t *ip6_addr) |
Determine whether the IP address is already in use in blocking mode. [thread-safe]. More... | |
netStatus | netNDP_ClearCache (uint32_t if_id) |
Flush or clear the local NDP cache. [thread-safe]. More... | |
netStatus | netDHCP6_Enable (uint32_t if_id, netDHCP6_Mode mode) |
Enable Dynamic Host Configuration version 6 at runtime. [thread-safe]. More... | |
netStatus | netDHCP6_Disable (uint32_t if_id) |
Disable Dynamic Host Configuration version 6 at runtime. [thread-safe]. More... | |
netStatus | netICMP_SetNoEcho (uint32_t if_id, bool no_echo) |
Enable or disable ICMP Echo response. [thread-safe]. More... | |
netStatus | netICMP6_SetNoEcho (uint32_t if_id, bool no_echo) |
Enable or disable ICMPv6 Echo response. [thread-safe]. More... | |
Common functions for all Interfaces.
In the Network Component, the Common interface API is responsible for various Application/Internet/Link layer protocols such as ARP, NDP, IGMP, and DHCP. In the Network Component v7, these protocols are supported for IPv4 and IPv6 connections (where applicable).
void(* netARP_cb_t)(netARP_Event event) |
ARP Probe Event callback function.
[in] | event | - Probe event as defined in netARP_Event. |
Is the type definition for the Probe callback function. Users must provide the function. The callback function uses the event argument to signal one of the following Probe events:
Event | Description |
---|---|
netARP_EventSuccess | Remote host responded to ARP probe. |
netARP_EventTimeout | Probe session has timed out, remote host did not respond. |
Parameter for:
void(* netNDP_cb_t)(netNDP_Event event) |
NDP Probe Event callback function.
[in] | event | - Probe event as defined in netNDP_Event. |
Is the type definition for the Probe callback function. Users must provide the function. The callback function uses the event argument to signal one of the following Probe events:
Event | Description |
---|---|
netNDP_EventSuccess | Remote host responded to NDP probe. |
netNDP_EventTimeout | Probe session has timed out, remote host did not respond. |
Parameter for:
netStatus netARP_CacheIP | ( | uint32_t | if_id, |
const uint8_t * | ip4_addr, | ||
netARP_CacheType | type | ||
) |
Determine whether the ARP table has MAC address resolved for requested IP address. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip4_addr | requested IPv4 address. |
[in] | type | address cache type. |
The function netARP_CacheIP determines whether the ARP table has a MAC (Ethernet) address entry for the requested IP address. If an entry does not exist, the function forces the Network Core to resolve and cache the MAC address into the internal ARP table buffer. To resolve the MAC address, the Network Core sends an ARP request to the network.
The argument if_id is the Interface Identification number for which to check the ARP table.
The argument ip4_addr points to a buffer containing the four octets of the dotted decimal IPv4 address to be resolved.
The argument type specifies whether the IP address is fixed or temporary. This consequently determines whether or not the Network Core automatically refreshes the IP address entry in the ARP cache.
Type | Description |
---|---|
netARP_CacheTemporaryIP | The IP address is temporary, and thus Network removes the IP address entry from the ARP cache after a timeout. |
netARP_CacheFixedIP | The IP address is fixed, and thus Network's ARP module automatically refreshes the IP address entry after the timeout. |
Possible netStatus return values:
Code Example
netStatus netARP_CacheMAC | ( | uint32_t | if_id, |
const uint8_t * | mac_addr | ||
) |
Determine whether the ARP table has IP address resolved for requested MAC address. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | mac_addr | requested MAC address. |
The function netARP_CacheMAC determines whether the ARP table has an IP address entry for the requested MAC (Ethernet) address mac_addr. If an entry does not exist, the function forces the Network Core to resolve and cache the IP address into the internal ARP table buffer. To resolve the IP address, the Network Core sends an inverse ARP request to the network.
The argument if_id is the Interface Identification number for which to check the ARP table.
The argument mac_addr points to a buffer containing the six octets of the MAC address to be resolved.
Possible netStatus return values:
Code Example
netStatus netARP_ClearCache | ( | uint32_t | if_id | ) |
Flush or clear the local ARP cache. [thread-safe].
[in] | if_id | Interface identification (class and number). |
The function netARP_ClearCache flushes all resolved MAC addresses from the local ARP cache. You can use this function when the cache holds outdated values that are no longer valid.
The argument if_id is the Interface Identification number for which to clear the ARP cache table.
Possible netStatus return values:
Code Example
netStatus netARP_GetIP | ( | uint32_t | if_id, |
const uint8_t * | mac_addr, | ||
uint8_t * | ip4_addr | ||
) |
Get IP address from the ARP cache. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | mac_addr | requested MAC address. |
[out] | ip4_addr | resolved IPv4 address. |
The function netARP_GetIP determines the resolved IP address for a specific MAC address.
The argument if_id is the Interface Identification number for which to check the ARP table.
The argument mac_addr points to a buffer containing the six octets of the MAC address to be resolved.
The argument ip4_addr points to a buffer that stores the resolved IPv4 address.
Possible netStatus return values:
Refer to
Code Example (see netARP_CacheMAC)
netStatus netARP_GetMAC | ( | uint32_t | if_id, |
const uint8_t * | ip4_addr, | ||
uint8_t * | mac_addr | ||
) |
Get MAC address from the ARP cache. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip4_addr | requested IPv4 address. |
[out] | mac_addr | resolved MAC address. |
The function netARP_GetMAC determines the resolved MAC address for a specific IP address.
The argument if_id is the Interface Identification number for which to check the ARP table.
The argument ip4_addr points to a buffer containing four octets of the dotted decimal IPv4 address to be resolved.
The argument mac_addr points to a buffer that stores the resolved six octets of the MAC address.
Possible netStatus return values:
Refer to
Code Example
netStatus netARP_Probe | ( | uint32_t | if_id, |
const uint8_t * | ip4_addr, | ||
netARP_cb_t | cb_func | ||
) |
Determine whether the IP address is already in use. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip4_addr | requested IPv4 address. |
[in] | cb_func | callback function to call, when probe session ends. |
The function netARP_Probe determines whether the requested IPv4 address is already used in local area network. You can use this function to check for IPv4 address collisions.
The argument if_id is the Interface Identification number for which to check the IPv4 address.
The argument ip4_addr points to a buffer containing four octets of the dotted decimal IPv4 address to be checked.
The argument cb_func points to an event callback function called by the Network Core when the probe session ends. Refer to netARP_cb_t.
Possible netStatus return values:
Refer to
Code Example
netStatus netARP_ProbeX | ( | uint32_t | if_id, |
const uint8_t * | ip4_addr | ||
) |
Determine whether the IP address is already in use in blocking mode. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip4_addr | requested IPv4 address. |
The blocking function netARP_ProbeX determines whether the requested IPv4 address is already used in local area network. You can use this function to check for IPv4 address collisions.
The argument if_id is the Interface Identification number for which to check the IPv4 address.
The argument ip4_addr points to a buffer containing four octets of the dotted decimal IPv4 address to be checked.
Possible netStatus return values:
Refer to
Code Example
netStatus netDHCP6_Disable | ( | uint32_t | if_id | ) |
Disable Dynamic Host Configuration version 6 at runtime. [thread-safe].
[in] | if_id | Interface identification (class and number). |
The function netDHCP6_Disable permanently disables the DHCPv6 service at runtime. To enable the DHCPv6 client again, you must call netDHCP6_Enable.
The argument if_id specifies the Interface Identification number for which DHCPv6 is to be disabled.
Possible netStatus return values:
Code Example
netStatus netDHCP6_Enable | ( | uint32_t | if_id, |
netDHCP6_Mode | mode | ||
) |
Enable Dynamic Host Configuration version 6 at runtime. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | mode | DHCPv6 operation mode. |
The function netDHCP6_Enable enables the DHCPv6 service at runtime.
The argument if_id specifies the Interface Identification number for which DHCPv6 is to be enabled.
The argument mode specifies whether DHCPv6 client runs in stateful mode with IPv6 address assignment, or in stateless mode with no IPv6 address assignment. In stateless mode, DHCPv6 client obtains only additional information, such as DNS name servers.
Possible netStatus return values:
NET_START_SERVICE
to 1 in Net_Config.c, all selected services will be started automatically. Thus, you only need to call this function, if you have either stopped the DHCPv6 service previously using netDHCP6_Disable or have set NET_START_SERVICE
to 0.Code Example (see netDHCP6_Disable)
netStatus netDHCP_Disable | ( | uint32_t | if_id | ) |
Disable Dynamic Host Configuration at runtime. [thread-safe].
[in] | if_id | Interface identification (class and number). |
The function netDHCP_Disable permanently disables the DHCP service at runtime. To enable the DHCP client again, you must call netDHCP_Enable.
The argument if_id specifies the Interface Identification number for which DHCP is to be disabled.
Possible netStatus return values:
Code Example
netStatus netDHCP_Enable | ( | uint32_t | if_id | ) |
Enable Dynamic Host Configuration at runtime. [thread-safe].
[in] | if_id | Interface identification (class and number). |
The function netDHCP_Enable enables the DHCP service at runtime.
The argument if_id specifies the Interface Identification number for which DHCP is to be enabled.
Possible netStatus return values:
NET_START_SERVICE
to 1 in Net_Config.c, all selected services will be started automatically. Thus, you only need to call this function, if you have either stopped the DHCP service previously using netDHCP_Disable or have set NET_START_SERVICE
to 0.Code Example (see netDHCP_Disable)
netStatus netDHCP_SetOption | ( | uint32_t | if_id, |
uint8_t | option, | ||
const uint8_t * | val, | ||
uint32_t | len | ||
) |
Set DHCP Option value at runtime. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | option | DHCP option code. |
[in] | val | pointer to option value. |
[in] | len | length of option value in bytes. |
The function netDHCP_SetOption changes DHCP client options at runtime. To change a DHCP option, DHCP client must be disabled with a call to netDHCP_Disable, and enabled again after the call to netDHCP_SetOption with netDHCP_Enable.
The argument if_id specifies the Interface Identification number for which DHCP option is to be set.
The argument option specifies a DHCP option to be set. The following options are supported:
Option | Description | Minimum length |
---|---|---|
NET_DHCP_OPTION_CLIENT_ID | Client-identifier option | 2 bytes |
The argument val is a pointer to user provided DHCP option value. If argument val is NULL, default DHCP option value is used instead of the user provided. Default DHCP Client-identifier option is Ethernet MAC address.
The argument len contains the length of the option value in bytes.
Possible netStatus return values:
Code Example
netStatus netICMP6_SetNoEcho | ( | uint32_t | if_id, |
bool | no_echo | ||
) |
Enable or disable ICMPv6 Echo response. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | no_echo | new state of NoEcho attribute:
|
The function netICMP6_SetNoEcho enables or disables the Echo response on the interface at runtime.
The argument if_id specifies the Interface Identification number for which ICMPv6 Echo response mode is to be changed.
The argument no_echo switches the NoEcho response mode on (true) or off (false).
Possible netStatus return values:
Code Example
netStatus netICMP_SetNoEcho | ( | uint32_t | if_id, |
bool | no_echo | ||
) |
Enable or disable ICMP Echo response. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | no_echo | new state of NoEcho attribute:
|
The function netICMP_SetNoEcho enables or disables the Echo response on the interface at runtime.
The argument if_id specifies the Interface Identification number for which ICMP Echo response mode is to be changed.
The argument no_echo switches the NoEcho response mode on (true) or off (false).
Possible netStatus return values:
Code Example
netStatus netIF_GetOption | ( | uint32_t | if_id, |
netIF_Option | option, | ||
uint8_t * | buf, | ||
uint32_t | buf_len | ||
) |
Get the current value of an Interface option. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | option | Interface option as specified by netIF_Option. |
[out] | buf | buffer to store the option value to. |
[in] | buf_len | length of buffer. |
The function netIF_GetOption retrieves the current value of an option for the interface specified by if_id.
The argument if_id specifies the Interface Identification number.
The argument option specifies the interface option that is to be retrieved (see netIF_SetOption).
The argument buf points to a buffer that will be used to store the value of the option.
The argument buf_len specifies the length of the buffer buf.
Possible netStatus return values:
Code Example
netStatus netIF_SetDefault | ( | uint32_t | if_id, |
netIF_Version | ip_version | ||
) |
Set default network interface for Internet access. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip_version | IP version as specified by netIF_Version. |
The function netIF_SetDefault sets the default interface to the interface specified by if_id. The default interface is used for Internet access.
The argument if_id specifies th Interface Identification number.
The argument ip_version specifies the Internet Protocol version IPv4 or IPv6, for which the default interface is to be set.
Possible netStatus return values:
Code Example
netStatus netIF_SetOption | ( | uint32_t | if_id, |
netIF_Option | option, | ||
const uint8_t * | buf, | ||
uint32_t | buf_len | ||
) |
Set the value of an Interface option. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | option | Interface option as specified by netIF_Option. |
[in] | buf | buffer containing the option value. |
[in] | buf_len | length of buffer. |
The function netIF_SetOption sets different options for the interface identified by the argument if_id.
The argument if_id specifies the Interface Identification number.
The argument option specifies the interface option that is to be set (see below).
The argument buf points to a buffer containing the value of the option to be set.
The argument buf_len specifies the actual length of the buffer buf and must match the length of the corresponding option as specified with argument option (see below).
Option | Description | Length |
---|---|---|
netIF_OptionMAC_Address | Ethernet MAC Address | 6 bytes |
netIF_OptionVLAN_Identifier | Ethernet VLAN Identifier | 2 bytes |
netIF_OptionIP4_MTU | IPv4 Maximum Transmission Unit | 2 bytes |
netIF_OptionIP4_Address | IPv4 Address | 4 bytes |
netIF_OptionIP4_SubnetMask | IPv4 Subnet mask | 4 bytes |
netIF_OptionIP4_DefaultGateway | IPv4 Default Gateway | 4 bytes |
netIF_OptionIP4_PrimaryDNS | IPv4 Primary DNS | 4 bytes |
netIF_OptionIP4_SecondaryDNS | IPv4 Secondary DNS | 4 bytes |
netIF_OptionIP6_MTU | IPv6 Maximum Transmission Unit | 2 bytes |
netIF_OptionIP6_LinkLocalAddress | IPv6 Link-local Address | 16 bytes |
netIF_OptionIP6_StaticAddress | IPv6 Static Address | 16 bytes |
netIF_OptionIP6_DynamicAddress | IPv6 Dynamic Address | 16 bytes |
netIF_OptionIP6_SubnetPrefixLength | IPv6 Subnet Prefix-length | 1 byte |
netIF_OptionIP6_DefaultGateway | IPv6 Default Gateway | 16 bytes |
netIF_OptionIP6_PrimaryDNS | IPv6 Primary DNS | 16 bytes |
netIF_OptionIP6_SecondaryDNS | IPv6 Secondary DNS | 16 bytes |
Possible netStatus return values:
The option netIF_OptionIP4_MTU sets the maximum transmission unit for the interface (MTU). The valid values for the MTU option depend on the network inteface and are as follows:
IPv4 fragmentation is enabled if the option value is nonzero. Option value 0 disables IPv4 fragmentation.
The option netIF_OptionVLAN_Identifier sets the Virtual LAN for the Ethernet interface (VLAN). Valid VLAN ID is from 1 to 4093. Option value 0 disables VLAN.
Code Example
netStatus netIGMP_Join | ( | uint32_t | if_id, |
const uint8_t * | ip4_addr | ||
) |
Join this host to a host group specified with IP address. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip4_addr | group IPv4 address. |
The function netIGMP_Join requests that a host should become a member of the host group identified by ip4_addr.
The argument if_id is the Interface Identification number of the host.
The argument ip4_addr points to the address of the group. Before any datagrams destined to a particular group can be received, an upper-layer protocol must ask the IP module to join that group.
Possible netStatus return values:
Code Example
netStatus netIGMP_Leave | ( | uint32_t | if_id, |
const uint8_t * | ip4_addr | ||
) |
Leave a host group specified with IP address. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip4_addr | group IPv4 address. |
The function netIGMP_Leave requests a host to give up its membership in a host group.
The argument if_id is the host Interface Identification number.
The argument ip4_addr points to the host group. After the upper-layer has requested to leave the host group, datagrams destined to a particular group can not be received, but are silently discarded by the IP-layer.
Possible netStatus return values:
Code Example
netStatus netNBNS_ClearCache | ( | uint32_t | if_id | ) |
Flush or clear the local NBNS cache. [thread-safe].
[in] | if_id | Interface identification (class and number). |
The function netNBNS_ClearCache flushes all resolved IP addresses from the local NBNS cache. You can use this function when the cache holds outdated values that are no longer valid.
The argument if_id is the Interface Identification number for which to clear the NBNS cache table.
Possible netStatus return values:
Code Example
netStatus netNBNS_Resolve | ( | uint32_t | if_id, |
const char * | name, | ||
uint8_t * | ip4_addr | ||
) |
Resolve IP address of a host from a NetBIOS hostname. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | name | NetBIOS hostname, a null-terminated string. |
[out] | ip4_addr | resolved IPv4 address. |
The blocking function netNBNS_Resolve resolves the IP address of a host from a host name on the local network. It starts the NBNS client, sends a broadcast request to all hosts that are on local network and returns the resolved IP address. If the host is already resolved and cached in local NBNS cache, the function returns immediately with the IP address.
The argument if_id is the host Interface Identification number.
The argument name is a pointer to a null-terminated string that specifies the host name. The argument name can also be "localhost" or the local system host name. In this case the NBNS client returns immediately with the loopback IP address: "127.0.0.1"
The argument ip4_addr specifies a user-provided address buffer that will receive the resolved IP address.
Possible netStatus return values:
Code Example
netStatus netNDP_CacheIP | ( | uint32_t | if_id, |
const uint8_t * | ip6_addr | ||
) |
Determine whether neighbor cache has MAC address resolved for requested IP address. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip6_addr | requested IPv6 address. |
The function netNDP_CacheIP determines whether the NDP table has already an entry for the requested IPv6 address ip6_addr. If an entry does not exist, the function forces the Network Core to resolve and cache the IP address into the internal NDP table buffer.
The argument if_id is the Interface Identification number for which to cache the NDP table.
The argument ip6_addr points to a buffer containing the IPv6 address.
Possible netStatus return values:
Code Example
netStatus netNDP_ClearCache | ( | uint32_t | if_id | ) |
Flush or clear the local NDP cache. [thread-safe].
[in] | if_id | Interface identification (class and number). |
The function netNDP_ClearCache flushes all resolved MAC addresses from the local NDP cache. You can use this function when the cache holds outdated values that are no longer valid.
The argument if_id is the Interface Identification number for which to clear the NDP cache table.
Possible netStatus return values:
Code Example
netStatus netNDP_GetIP | ( | uint32_t | if_id, |
const uint8_t * | mac_addr, | ||
uint8_t * | ip6_addr | ||
) |
Get IP address from neighbor discovery cache. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | mac_addr | requested MAC address. |
[out] | ip6_addr | resolved IPv6 address. |
The function netNDP_GetIP determines the resolved IPv6 address for a specific MAC address.
The argument if_id is the Interface Identification number to be used.
The argument mac_addr points to a buffer containing the MAC address.
The argument ip6_addr points to a buffer that stores the resolved IPv6 address.
Possible netStatus return values:
Code Example
netStatus netNDP_GetMAC | ( | uint32_t | if_id, |
const uint8_t * | ip6_addr, | ||
uint8_t * | mac_addr | ||
) |
Get MAC address from neighbor discovery cache. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip6_addr | requested IPv6 address. |
[out] | mac_addr | resolved MAC address. |
The function netNDP_GetMAC determines the resolved MAC address for a specific IPv6 address.
The argument if_id is the Interface Identification number to be used.
The argument ip6_addr points to a buffer containing the IPv6 address.
The argument mac_addr points to a buffer that stores the resolved six octets of the MAC address.
Possible netStatus return values:
Code Example
netStatus netNDP_Probe | ( | uint32_t | if_id, |
const uint8_t * | ip6_addr, | ||
netNDP_cb_t | cb_func | ||
) |
Determine whether the IP address is already in use. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip6_addr | requested IPv6 address. |
[in] | cb_func | callback function to call, when probe session ends. |
The function netNDP_Probe determines whether the requested IPv6 address is already used in local area network. You can use this function to check for IPv6 address collisions.
The argument if_id is the Interface Identification number for which to check the IPv6 address.
The argument ip6_addr points to a buffer containing the IPv6 address to be checked.
The argument cb_func points to an event callback function called by the Network Core when the probe session ends. Refer to netNDP_cb_t.
Possible netStatus return values:
Refer to
Code Example
netStatus netNDP_ProbeX | ( | uint32_t | if_id, |
const uint8_t * | ip6_addr | ||
) |
Determine whether the IP address is already in use in blocking mode. [thread-safe].
[in] | if_id | Interface identification (class and number). |
[in] | ip6_addr | requested IPv6 address. |
The blocking function netNDP_ProbeX determines whether the requested IPv6 address is already used in local area network. You can use this function to check for IPv6 address collisions.
The argument if_id is the Interface Identification number for which to check the IPv6 address.
The argument ip6_addr points to a buffer containing the IPv6 address to be checked.
Possible netStatus return values:
Refer to
Code Example