2015-08-13 07:10:38 +00:00
|
|
|
/* Very basic LWIP & FreeRTOS-based DHCP server
|
2015-09-09 22:15:33 +00:00
|
|
|
*
|
|
|
|
* Header file contains default configuration for the DHCP server.
|
|
|
|
*
|
|
|
|
*
|
|
|
|
* Part of esp-open-rtos
|
|
|
|
* Copyright (C) 2015 Superhouse Automation Pty Ltd
|
|
|
|
* BSD Licensed as described in the file LICENSE
|
2015-08-13 07:10:38 +00:00
|
|
|
*/
|
|
|
|
#ifndef _DHCPSERVER_H
|
|
|
|
#define _DHCPSERVER_H
|
|
|
|
|
|
|
|
#ifndef DHCPSERVER_LEASE_TIME
|
2015-08-24 06:13:24 +00:00
|
|
|
#define DHCPSERVER_LEASE_TIME 3600
|
2015-08-13 07:10:38 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Start DHCP server.
|
|
|
|
|
|
|
|
Static IP of server should already be set and network interface enabled.
|
2015-09-09 22:15:33 +00:00
|
|
|
|
|
|
|
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.
|
2015-08-13 07:10:38 +00:00
|
|
|
*/
|
2015-09-09 22:15:33 +00:00
|
|
|
void dhcpserver_start(const ip_addr_t *first_client_addr, uint8_t max_leases);
|
2015-08-13 07:10:38 +00:00
|
|
|
|
2015-09-23 12:24:25 +00:00
|
|
|
void dhcpserver_get_lease(const ip_addr_t *first_client_addr, uint8_t max_leases);
|
|
|
|
|
2015-08-13 07:10:38 +00:00
|
|
|
/* Stop DHCP server.
|
|
|
|
*/
|
|
|
|
void dhcpserver_stop(void);
|
|
|
|
|
|
|
|
#endif
|