net_lwip_webserver: allow users to enable LWIP_IP6 if desired
This commit is contained in:
@@ -96,19 +96,19 @@ static const dhcp_config_t *config = NULL;
|
||||
|
||||
char magic_cookie[] = {0x63,0x82,0x53,0x63};
|
||||
|
||||
static ip_addr_t get_ip(const uint8_t *pnt)
|
||||
static ip4_addr_t get_ip(const uint8_t *pnt)
|
||||
{
|
||||
ip_addr_t result;
|
||||
ip4_addr_t result;
|
||||
memcpy(&result, pnt, sizeof(result));
|
||||
return result;
|
||||
}
|
||||
|
||||
static void set_ip(uint8_t *pnt, ip_addr_t value)
|
||||
static void set_ip(uint8_t *pnt, ip4_addr_t value)
|
||||
{
|
||||
memcpy(pnt, &value.addr, sizeof(value.addr));
|
||||
}
|
||||
|
||||
static dhcp_entry_t *entry_by_ip(ip_addr_t ip)
|
||||
static dhcp_entry_t *entry_by_ip(ip4_addr_t ip)
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < config->num_entry; i++)
|
||||
@@ -162,11 +162,11 @@ uint8_t *find_dhcp_option(uint8_t *attrs, int size, uint8_t attr)
|
||||
int fill_options(void *dest,
|
||||
uint8_t msg_type,
|
||||
const char *domain,
|
||||
ip_addr_t dns,
|
||||
ip4_addr_t dns,
|
||||
int lease_time,
|
||||
ip_addr_t serverid,
|
||||
ip_addr_t router,
|
||||
ip_addr_t subnet)
|
||||
ip4_addr_t serverid,
|
||||
ip4_addr_t router,
|
||||
ip4_addr_t subnet)
|
||||
{
|
||||
uint8_t *ptr = (uint8_t *)dest;
|
||||
/* ACK message type */
|
||||
|
@@ -41,16 +41,16 @@
|
||||
|
||||
typedef struct dhcp_entry
|
||||
{
|
||||
uint8_t mac[6];
|
||||
ip_addr_t addr;
|
||||
uint32_t lease;
|
||||
uint8_t mac[6];
|
||||
ip4_addr_t addr;
|
||||
uint32_t lease;
|
||||
} dhcp_entry_t;
|
||||
|
||||
typedef struct dhcp_config
|
||||
{
|
||||
ip_addr_t router;
|
||||
ip4_addr_t router;
|
||||
uint16_t port;
|
||||
ip_addr_t dns;
|
||||
ip4_addr_t dns;
|
||||
const char *domain;
|
||||
int num_entry;
|
||||
dhcp_entry_t *entries;
|
||||
|
@@ -136,7 +136,7 @@ static void udp_recv_proc(void *arg, struct udp_pcb *upcb, struct pbuf *p, const
|
||||
dns_header_t *header;
|
||||
static dns_query_t query;
|
||||
struct pbuf *out;
|
||||
ip_addr_t host_addr;
|
||||
ip4_addr_t host_addr;
|
||||
dns_answer_t *answer;
|
||||
|
||||
(void)arg;
|
||||
|
@@ -39,7 +39,7 @@
|
||||
#include "lwip/udp.h"
|
||||
#include "netif/etharp.h"
|
||||
|
||||
typedef bool (*dns_query_proc_t)(const char *name, ip_addr_t *addr);
|
||||
typedef bool (*dns_query_proc_t)(const char *name, ip4_addr_t *addr);
|
||||
|
||||
err_t dnserv_init(const ip_addr_t *bind, uint16_t port, dns_query_proc_t query_proc);
|
||||
void dnserv_free(void);
|
||||
|
Reference in New Issue
Block a user