TCPIP_DHCPS_LeaseGetInfoById Function

C

TCPIP_DHCPS_RES TCPIP_DHCPS_LeaseGetInfoById(TCPIP_NET_HANDLE netH, const uint8_t* clientId, size_t idLen, TCPIP_DHCPS_LEASE_INFO* pLeaseInfo);

Description

Get the lease entry details for the requested client ID

This function returns a DB lease entry info for the selected ID on the selected interface

Precondition

The DHCP Server module should have been initialized.

Parameters

ParametersDescription
hNetselected interface handle
clientIdthe client ID, usually a MAC address
idLenlength of the ID
pLeaseInfoaddress to store the lease entry details Could be NULL if details not needed

Returns

- TCPIP_DHCPS_RES_OK - the call is successful and the pLeaseInfo has been updated, if not NULL

- < 0 - if wrong interface or DHCP server is not running on that interface, or wrong/unused index

- TCPIP_DHCPS_RES_ACCESS_LOCKED - if access to the DHCP server DB is locked by another thread and the the call can be retried. Multi-threaded access is enabled (build symbol TCPIP_DHCPS_MULTI_THREADED_ACCESS != 0)

Remarks

The maximum size of the client ID should be TCPIP_DHCPS_CLIENT_ID_MAX_SIZE. Extra characters will be truncated. Usually the client ID is a MAC address. However some clients can use different, longer IDs.