Networking_IpConfig_RenewIp Function

Header: #include <applibs/networking.h>

Renews the device dynamic IP address lease.

Note

Requires Azure Sphere OS version 22.02 or above.

int Networking_IpConfig_RenewIp(const char *networkInterfaceName);

Parameters

  • networkInterfaceName A pointer to the name of the network interface to update.

Errors

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

  • EACCES: the calling application doesn't have the NetworkConfig capability.

  • EFAULT: the networkInterfaceName parameter is NULL.

  • ENOENT: the network interface does not exist.

  • EPERM: the IP address cannot be renewed, such as in a static IP configuration.

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, -1 for failure, in which case errno is set to the error value.

Remarks

If an IP address was acquired via DHCP, this function asynchronously renews the current IP address lease. This function does nothing if DHCP is still working to acquire an IP address. If the DHCP protocol has been stopped with Networking_IpConfig_ReleaseIp, the DHCP transaction will be re-started. Use Networking_IsNetworkingReady to determine if the new IP is acquired.

The application manifest must include the NetworkConfig capability.

Concepts and samples