Networking_DhcpServerConfig_SetLease Function

Header: #include <applibs/networking.h>

Applies lease information to a Networking_DhcpServerConfig struct.

int Networking_DhcpServerConfig_SetLease(Networking_DhcpServerConfig *dhcpServerConfig, struct in_addr startIpAddress, uint8_t ipAddressCount, struct in_addr subnetMask, struct in_addr gatewayAddress, uint32_t leaseTimeInHours);

Parameters

  • dhcpServerConfig A pointer to the Networking_DhcpServerConfig struct to update.

  • startIpAddress The starting IP address in the address range to lease.

  • ipAddressCount The number of IP addresses the server can lease.

  • subnetMask The subnet mask for the IP addresses.

  • gatewayAddress The gateway address for the network interface.

  • leaseTimeInHours The duration of the lease, in hours.

Errors

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

  • EFAULT: the dhcpServerConfig parameter is NULL.

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