Networking_DhcpServerConfig_SetNtpServerAddresses Function

Header: #include <applibs/networking.h>

Applies a set of NTP server IP addresses to a Networking_DhcpServerConfig struct.

int Networking_DhcpServerConfig_SetNtpServerAddresses(Networking_DhcpServerConfig *dhcpServerConfig, const struct in_addr *ntpServerAddresses, size_t serverCount);

Parameters

  • dhcpServerConfig A pointer to the Networking_DhcpServerConfig struct to update.

  • ntpServerAddresses A pointer to an array of NTP server IP addresses.

  • serverCount The number of IP addresses in the ntpServerAddresses array.

Errors

Returns -1 if an error is encountered and sets errno to the error value.

  • EFAULT: the dhcpServerConfig parameter is NULL.

  • EFAULT: the ntpServerAddresses parameter is NULL.

  • EINVAL: More than three IP address were provided.

Any other errno may also be specified; such errors aren't deterministic and the same behavior might not be retained through system updates.

Return value

Returns 0 for success, or -1 for failure, in which case errno will be set to the error value.

Concepts and samples