Functions to notify the user application about events on the interface. More...
Functions | |
void | netDHCP_Notify (uint32_t if_id, uint8_t option, const uint8_t *val, uint32_t len) |
Notify the user of DHCP event or extended DHCP option. [user-provided]. | |
void | netDHCP6_Notify (uint32_t if_id, uint8_t option, const uint8_t *val, uint32_t len) |
Notify the user of DHCPv6 event or extended DHCPv6 option. [user-provided]. | |
Functions to notify the user application about events on the interface.
An interface configuration change is reported by the function netDHCP_Notify for IPv4 and netDHCP6_Notify for IPv6. If you need to monitor the status of your connection, you must implement these functions.
void netDHCP6_Notify | ( | uint32_t | if_id, |
uint8_t | option, | ||
const uint8_t * | val, | ||
uint32_t | len | ||
) |
Notify the user of DHCPv6 event or extended DHCPv6 option. [user-provided].
[in] | if_id | Interface identification (class and number). |
[in] | option | DHCPv6 option code. |
[in] | val | pointer to option value. |
[in] | len | length of option value in bytes. |
The user function netDHCP6_Notify is called by the DHCPv6 client to signal IPv6 address changes or provide information about extended DHCPv6 options. Extended DHCP options are enabled in the Configuration files.
DHCPv6 client notifications require the implementation of the function netDHCP6_Notify in the user code.
The parameter if_id indicates the Interface Identification number.
The parameter option specifies the extended DHCPv6 option code.
The parameter val is a pointer to information provided by the DCHPv6 server replies (see table below).
The parameter len contains the length of the option value in bytes.
The following table shows the various option codes.
Option Code (option) | Description | val is |
---|---|---|
NET_DHCP6_OPTION_IP_ADDRESS | IP address change event | pointer to new dynamic IPv6 address (binary) |
Code Example
void netDHCP_Notify | ( | uint32_t | if_id, |
uint8_t | option, | ||
const uint8_t * | val, | ||
uint32_t | len | ||
) |
Notify the user of DHCP event or extended DHCP option. [user-provided].
[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 user function netDHCP_Notify is called by the DHCP client to signal IP address changes or provide information about extended DHCP options. Extended DHCP options are enabled in the Configuration files and that allow request information such as a boot file name or NTP Server IP addresses.
DHCP client notifications require the implementation of the function netDHCP_Notify in the user code.
The parameter if_id indicates the Interface Identification number.
The parameter option specifies the extended DHCP option code.
The parameter val is a pointer to information provided by the DCHP server replies (see table below).
The parameter len contains the length of the option value in bytes.
The following table shows the various option codes.
Option Code (option) | Description | val is |
---|---|---|
NET_DHCP_OPTION_IP_ADDRESS | IP address change event | pointer to new dynamic IPv4 address (binary) |
NET_DHCP_OPTION_NTP_SERVERS | IP addresses of NTP Server | pointer to list of NTP Server IPv4 addresses (binary) |
NET_DHCP_OPTION_BOOTFILE_NAME | Boot file name from DHCP server | pointer to boot file name (ASCII string) |
Code Example