TCPIP_DHCPS_LeaseEntriesGet Function

C

TCPIP_DHCPS_RES TCPIP_DHCPS_LeaseEntriesGet(TCPIP_NET_HANDLE netH, uint16_t* pLeases, uint16_t* pInUse);

Description

Get the total and in use number of lease entries for the selected interface.

This function returns the total and in use number of entries in the DB for the selected interface.

Precondition

The DHCP Server module must be initialized.

Parameters

ParametersDescription
hNetInterface to query
pLeasesaddress to store the total number of leases
Can be NULL if not needed
pInUseaddress to store the number of in use lease entries
Can be NULL if not needed

Returns

- TCPIP_DHCPS_RES_OK - the call is successful and the number of entries in the DB for the selected interface have been updated

- < 0 - An error code if wrong interface, or DHCP server is not running on that interface

- 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 returned value in pLeases should match the corresponding TCPIP_DHCPS_INTERFACE_CONFIG::leaseEntries;