DHCP Allows selecting the DHCP server's network interface

This changes the parameters of dhcpserver_start.

  Besides that, dhcpserver_start should only be called after user_init has
finished, else the call sdk_system_get_netif(SOFTAP_IF) will return NULL.
This commit is contained in:
Fernando Governatore 2017-08-03 22:34:59 -03:00
parent 9523e872f8
commit be7cabd94d
4 changed files with 19 additions and 12 deletions

View file

@ -25,8 +25,10 @@ extern "C" {
first_client_addr is the IP address of the first lease to be handed
to a client. Subsequent lease addresses are calculated by
incrementing the final octet of the IPv4 address, up to max_leases.
The server will wait for requests on server_if interface.
*/
void dhcpserver_start(const ip_addr_t *first_client_addr, uint8_t max_leases);
void dhcpserver_start(struct netif *server_if, const ip_addr_t *first_client_addr, uint8_t max_leases);
void dhcpserver_get_lease(const ip_addr_t *first_client_addr, uint8_t max_leases);