Files
pico-examples/pico_w/access_point/dnsserver/dnsserver.h
Peter Harper 566ce86a6e Improve ap example (#233)
* Add dns server

The access point example is a bit complicated to use as you have to open
a browser and enter a url with the IP address of the device

Add a simple dns server that can be used to make the access point behave
like a captive portal. All DNS requests point back to the gateway IP.

* Improve AP example

The web page /ledtest gives you a web page with an option to turn the
led on and off

Start the DNS server and redirect all HTTP requests to this page.

Improve the code so it can handle more than one request at a time.

Fixes: #232
2023-01-23 08:35:33 -06:00

21 lines
370 B
C

/**
* Copyright (c) 2022 Raspberry Pi (Trading) Ltd.
*
* SPDX-License-Identifier: BSD-3-Clause
*/
#ifndef _DNSSERVER_H_
#define _DNSSERVER_H_
#include "lwip/ip_addr.h"
typedef struct dns_server_t_ {
struct udp_pcb *udp;
ip_addr_t ip;
} dns_server_t;
void dns_server_init(dns_server_t *d, ip_addr_t *ip);
void dns_server_deinit(dns_server_t *d);
#endif