esp-open-rtos/extras/dhcpserver/include/dhcpserver.h

48 lines
1.1 KiB
C
Raw Normal View History

/* Very basic LWIP & FreeRTOS-based DHCP server
*
* 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
*/
#ifndef _DHCPSERVER_H
#define _DHCPSERVER_H
#ifndef DHCPSERVER_LEASE_TIME
#define DHCPSERVER_LEASE_TIME 3600
#endif
#ifdef __cplusplus
extern "C" {
#endif
/* Start DHCP server.
Static IP of server should already be set and network interface enabled.
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.
*/
2017-10-11 10:26:43 +00:00
void dhcpserver_start(const ip4_addr_t *first_client_addr, uint8_t max_leases);
2017-06-06 02:47:21 +00:00
void dhcpserver_get_lease(const ip4_addr_t *first_client_addr, uint8_t max_leases);
/* Stop DHCP server.
*/
void dhcpserver_stop(void);
2017-06-06 02:47:21 +00:00
/* Set a router address to send as an option. */
void dhcpserver_set_router(const ip4_addr_t *router);
/* Set a DNS address to send as an option. */
void dhcpserver_set_dns(const ip4_addr_t *dns);
#ifdef __cplusplus
}
#endif
#endif