Tiny DNS Server.
Copyright (c) 2016-2018 Microchip Technology Inc. and its subsidiaries.
|
static ip_addr_t | _tiny_ip4_addr (uint8_t a, uint8_t b, uint8_t c, uint8_t d) |
|
void | lwip_dhcp_register_mac (uint8_t *mac) |
|
void | lwip_dhcp_unregister_mac (uint8_t *mac) |
|
uint32_t | lwip_dns_hton_string (struct pbuf *pbuf, uint32_t offset, char const *name, bool flag, uint32_t *plen) |
| Put host name into DNS RDATA format. More...
|
|
void | lwip_tiny_dhcpserver_start (void) |
| Start Tiny DHCP server. More...
|
|
void | lwip_tiny_dhcpserver_stop (void) |
| Stop Tiny DHCP server. More...
|
|
void | lwip_tiny_dnssdserver_start (void) |
| Start Tiny DNS-SD server. More...
|
|
void | lwip_tiny_dnssdserver_stop (void) |
|
uint32_t | pbuf_read16be (struct pbuf *pbuf, uint32_t offset, uint16_t *pval) |
| Read two bytes (big-endian) from a pbuf. More...
|
|
uint32_t | pbuf_read32le (struct pbuf *pbuf, uint32_t offset, uint32_t *pval) |
| Read four bytes (little-endian) from a pbuf. More...
|
|
uint32_t | pbuf_read8 (struct pbuf *pbuf, uint32_t offset, uint8_t *pval) |
| Read a byte from a pbuf. More...
|
|
static uint32_t | pbuf_read_ip (struct pbuf *pbuf, uint32_t offset, ip_addr_t *p_addr) |
|
err_t | pbuf_take_partial (struct pbuf *buf, uint32_t offset, const void *dataptr, u16_t len) |
| Copy application supplied data into a pbuf. More...
|
|
uint32_t | pbuf_write16be (struct pbuf *pbuf, uint32_t offset, uint16_t val) |
| Write two bytes (big-endian) to a pbuf. More...
|
|
uint32_t | pbuf_write32be (struct pbuf *pbuf, uint32_t offset, uint32_t val) |
| Write four bytes (big-endian) to a pbuf. More...
|
|
uint32_t | pbuf_write32le (struct pbuf *pbuf, uint32_t offset, uint32_t val) |
| Write four bytes (little-endian) to a pbuf. More...
|
|
uint32_t | pbuf_write8 (struct pbuf *pbuf, uint32_t offset, uint8_t val) |
| Write a byte to a pbuf. More...
|
|
static uint32_t | pbuf_write_ip (struct pbuf *pbuf, uint32_t offset, ip_addr_t addr) |
|
void lwip_tiny_dhcpserver_start |
( |
void |
| ) |
|
Start Tiny DHCP server.
Start Tiny DHCP server.
Create a new UDP PCB, bind that PCB to the DHCP_SERVER_PORT and set up a receiver for that PCB.
Thread-safe variant of this function. This function posts the LWIP-thread-only variant of this function (with dummy argument) to the LWIP thread's mailbox and returns.
NOTE: This function cannot wait. It may be called from within the LWIP main thread of execution.
References lwip_dhcpserver_start_threadsafe(), and tcpip_callback.
Referenced by net_interface_up_imp().
Stop Tiny DHCP server.
Stop Tiny DHCP server.
Disconnect and remove the UDP PCB.
Thread-safe variant of this function. This function posts the lwip-main-thread only function and a dummy argument to the main lwip thread.
NOTE: This function cannot wait. It may be called from within the LWIP main thread of execution.
References lwip_tiny_dhcpserver_stop_threadsafe(), and tcpip_callback.
Referenced by net_interface_down_imp().
uint32_t pbuf_read32le |
( |
struct pbuf * |
pbuf, |
|
|
uint32_t |
offset, |
|
|
uint32_t * |
pval |
|
) |
| |
Read four bytes (little-endian) from a pbuf.
If the requested read is beyond the * end of the pbuf chain's payload, then this function does not perform the read. It returns an error instead.
- Parameters
-
buf | pbuf to read data from. |
offset | logical offset into pbuf to start reading from. |
val | the data to read from the pbuf. |
- Returns
- 0 if successful, 1 if the read offset is beyond the end of the pbuf chain's total length.
References _wifi_get32_le(), pbuf_copy_partial(), and pbuf::tot_len.
Referenced by pbuf_read_ip().
err_t pbuf_take_partial |
( |
struct pbuf * |
pbuf, |
|
|
uint32_t |
offset, |
|
|
const void * |
dataptr, |
|
|
u16_t |
len |
|
) |
| |
Copy application supplied data into a pbuf.
This function can only be used to copy the equivalent of buf->tot_len data.
- Parameters
-
buf | pbuf to fill with data |
offset | logical offset into pbuf to start writing data into |
dataptr | application supplied data buffer |
len | length of the application supplied data buffer |
- Returns
- ERR_OK if successful, ERR_MEM if the pbuf is not big enough
References Assert, ERR_ARG, ERR_OK, pbuf::len, pbuf::next, NULL, and pbuf::payload.
Referenced by lwip_dhcp_server_fn(), pbuf_write16be(), pbuf_write32be(), pbuf_write32le(), and pbuf_write8().
uint32_t pbuf_write16be |
( |
struct pbuf * |
pbuf, |
|
|
uint32_t |
offset, |
|
|
uint16_t |
val |
|
) |
| |
Write two bytes (big-endian) to a pbuf.
If the requested write is beyond the * end of the pbuf chain's payload, then this function does not perform the write. It returns an error instead.
- Parameters
-
buf | pbuf to write data to. |
offset | logical offset into pbuf to start writing to. |
val | the data to write to the pbuf. |
- Returns
- 0 if successful, 1 if the write offset is beyond the end of the pbuf chain's total length.
References _wifi_put16_be(), ERR_OK, pbuf_take_partial(), and pbuf::tot_len.
uint32_t pbuf_write32be |
( |
struct pbuf * |
pbuf, |
|
|
uint32_t |
offset, |
|
|
uint32_t |
val |
|
) |
| |
Write four bytes (big-endian) to a pbuf.
If the requested write is beyond the * end of the pbuf chain's payload, then this function does not perform the write. It returns an error instead.
- Parameters
-
buf | pbuf to write data to. |
offset | logical offset into pbuf to start writing to. |
val | the data to write to the pbuf. |
- Returns
- 0 if successful, 1 if the write offset is beyond the end of the pbuf chain's total length.
References _wifi_put32_be(), ERR_OK, pbuf_take_partial(), and pbuf::tot_len.
Referenced by lwip_dhcp_server_fn().
uint32_t pbuf_write32le |
( |
struct pbuf * |
pbuf, |
|
|
uint32_t |
offset, |
|
|
uint32_t |
val |
|
) |
| |
Write four bytes (little-endian) to a pbuf.
If the requested write is beyond the * end of the pbuf chain's payload, then this function does not perform the write. It returns an error instead.
- Parameters
-
buf | pbuf to write data to. |
offset | logical offset into pbuf to start writing to. |
val | the data to write to the pbuf. |
- Returns
- 0 if successful, 1 if the write offset is beyond the end of the pbuf chain's total length.
References _wifi_put32_le(), ERR_OK, pbuf_take_partial(), and pbuf::tot_len.
Referenced by pbuf_write_ip().