List DHCP Servers leased clients IP addresses
I am using TCP/IP Stack version 7.31 on a PIC32MZ2048EFMH144 chip using Harmony Configurator 184.108.40.206.
I am using the PIC as a DHCP Server to assign IP addresses to other client devices. This works correctly. What I am trying to do now is get a list of IP addresses that have been assigned out. Ideally is to get a list of current connected clients. I plan to iterate through the clients and query their states through either TCP or UDP. The problem I am having is getting the list of IP addresses from the DHCP Server (service) running.
Running the following I can get the number of clients.
int tmpInt = TCPIP_DHCPS_GetPoolEntries(netH, DHCP_SERVER_POOL_ENTRY_IN_USE); // In Use clients
int tmpInt = TCPIP_DHCPS_GetPoolEntries(netH, DHCP_SERVER_POOL_ENTRY_ALL); // All clients
This returns a 2 for the two clients I have connected. Now I want their IP addresses.
To get their IP addresses, it appears that I need to use the command TCPIP_DHCPS_LeaseEntryGet() in dhcps.c.
This function returns a TCPIP_DHCPS_LEASE_HANDLE and also requires a TCPIP_DHCPS_LEASE_HANDLE as an argument. Since this is the only function that returns a TCPIP_DHCPS_LEASE_HANDLE, what do I pass to the function as an argument and where do I get it?