lwip: Remove undocumented CONFIG_MDNS macro flag

All options that were enabled via CONFIG_MDNS are now in menuconfig, with
the default values set the same as with CONFIG_MDNS enabled (meaning existing
projects that were using CONFIG_MDNS do not need to change).
This commit is contained in:
Angus Gratton 2017-07-10 17:22:56 +08:00 committed by Angus Gratton
parent 61d2069e1c
commit 2cc8c91ad8
5 changed files with 110 additions and 29 deletions

View file

@ -35,11 +35,25 @@ config LWIP_THREAD_LOCAL_STORAGE_INDEX
config LWIP_SO_REUSE config LWIP_SO_REUSE
bool "Enable SO_REUSEADDR option" bool "Enable SO_REUSEADDR option"
default n default y
help help
Enabling this option allows binding to a port which remains in Enabling this option allows binding to a port which remains in
TIME_WAIT. TIME_WAIT.
config LWIP_SO_REUSE_RXTOALL
bool "SO_REUSEADDR copies broadcast/multicast to all matches"
depends on LWIP_SO_REUSE
default y
help
Enabling this option means that any incoming broadcast or multicast
packet will be copied to all of the local sockets that it matches
(may be more than one if SO_REUSEADDR is set on the socket.)
This increases memory overhead as the packets need to be copied,
however they are only copied per matching socket. You can safely
disable it if you don't plan to receive broadcast or multicast
traffic on more than one socket at a time.
config LWIP_SO_RCVBUF config LWIP_SO_RCVBUF
bool "Enable SO_RCVBUF option" bool "Enable SO_RCVBUF option"
default n default n
@ -89,7 +103,6 @@ config LWIP_ETHARP_TRUST_IP_MAC
The peer *is* in the ARP table if it requested our address before. The peer *is* in the ARP table if it requested our address before.
Also notice that this slows down input processing of every IP packet! Also notice that this slows down input processing of every IP packet!
config TCPIP_RECVMBOX_SIZE config TCPIP_RECVMBOX_SIZE
int "TCPIP receive mail box size" int "TCPIP receive mail box size"
default 32 default 32
@ -98,6 +111,72 @@ config TCPIP_RECVMBOX_SIZE
Set TCPIP receive mail box size. Generally bigger value means higher throughput Set TCPIP receive mail box size. Generally bigger value means higher throughput
but more memory. The value should be bigger than UDP/TCP mail box size. but more memory. The value should be bigger than UDP/TCP mail box size.
config LWIP_DHCP_DOES_ARP_CHECK
bool "DHCP: Perform ARP check on any offered address"
default y
help
Enabling this option performs a check (via ARP request) if the offered IP address
is not already in use by another host on the network.
menuconfig LWIP_AUTOIP
bool "Enable IPV4 Link-Local Addressing (AUTOIP)"
default y
help
Enabling this option allows the device to self-assign an address
in the 169.256/16 range if none is assigned statically or via DHCP.
See RFC 3927.
config LWIP_AUTOIP_TRIES
int "DHCP Probes before self-assigning IPv4 LL address"
range 1 100
default 2
depends on LWIP_AUTOIP
help
DHCP client will send this many probes before self-assigning a
link local address.
From LWIP help: "This can be set as low as 1 to get an AutoIP
address very quickly, but you should be prepared to handle a
changing IP address when DHCP overrides AutoIP." (In the case of
ESP-IDF, this means multiple SYSTEM_EVENT_STA_GOT_IP events.)
config LWIP_AUTOIP_MAX_CONFLICTS
int "Max IP conflicts before rate limiting"
range 1 100
default 9
depends on LWIP_AUTOIP
help
If the AUTOIP functionality detects this many IP conflicts while
self-assigning an address, it will go into a rate limited mode.
config LWIP_AUTOIP_RATE_LIMIT_INTERVAL
int "Rate limited interval (seconds)"
range 5 120
default 20
depends on LWIP_AUTOIP
help
If rate limiting self-assignment requests, wait this long between
each request.
menuconfig LWIP_NETIF_LOOPBACK
bool "Support per-interface loopback"
default y
help
Enabling this option means that if a packet is sent with a destination
address equal to the interface's own IP address, it will "loop back" and
be received by this interface.
config LWIP_LOOPBACK_MAX_PBUFS
int "Max queued loopback packets per interface"
range 0 16
default 8
depends on LWIP_NETIF_LOOPBACK
help
Configure the maximum number of packets which can be queued for
loopback on a given interface. Reducing this number may cause packets
to be dropped, but will avoid filling memory with queued packet data.
menu "TCP" menu "TCP"
config TCP_MAXRTX config TCP_MAXRTX
@ -234,13 +313,6 @@ config UDP_RECVMBOX_SIZE
endmenu # UDP endmenu # UDP
config LWIP_DHCP_DOES_ARP_CHECK
bool "Enable an ARP check on the offered address"
default y
help
Enabling this option allows check if the offered IP address is not already
in use by another host on the network.
config TCPIP_TASK_STACK_SIZE config TCPIP_TASK_STACK_SIZE
int "TCP/IP Task Stack Size" int "TCP/IP Task Stack Size"
default 2560 default 2560

View file

@ -68,13 +68,8 @@ extern "C" {
#define ANNOUNCE_NUM 2 /* (number of announcement packets) */ #define ANNOUNCE_NUM 2 /* (number of announcement packets) */
#define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */ #define ANNOUNCE_INTERVAL 2 /* seconds (time between announcement packets) */
#define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */ #define ANNOUNCE_WAIT 2 /* seconds (delay before announcing) */
#if CONFIG_MDNS #define MAX_CONFLICTS LWIP_AUTOIP_MAX_CONFLICTS /* (max conflicts before rate limiting) */
#define MAX_CONFLICTS 9 /* (max conflicts before rate limiting) */ #define RATE_LIMIT_INTERVAL LWIP_AUTOIP_RATE_LIMIT_INTERVAL /* seconds (delay between successive attempts) */
#define RATE_LIMIT_INTERVAL 20 /* seconds (delay between successive attempts) */
#else
#define MAX_CONFLICTS 10 /* (max conflicts before rate limiting) */
#define RATE_LIMIT_INTERVAL 60 /* seconds (delay between successive attempts) */
#endif
#define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */ #define DEFEND_INTERVAL 10 /* seconds (min. wait between defensive ARPs) */
/* AutoIP client states */ /* AutoIP client states */

View file

@ -823,6 +823,22 @@
#define LWIP_DHCP_AUTOIP_COOP_TRIES 9 #define LWIP_DHCP_AUTOIP_COOP_TRIES 9
#endif #endif
/**
* LWIP_AUTOIP_MAX_CONFLICTS:
* Maximum number of AutoIP IP conflicts before rate limiting is enabled.
*/
#ifndef LWIP_AUTOIP_MAX_CONFLICTS
#define LWIP_AUTOIP_MAX_CONFLICTS 10
#endif
/**
* LWIP_AUTOIP_RATE_LIMIT_INTERVAL:
* Rate limited request interval, in seconds.
*/
#ifndef LWIP_AUTOIP_RATE_LIMIT_INTERVAL
#define LWIP_AUTOIP_RATE_LIMIT_INTERVAL 60
#endif
/* /*
---------------------------------- ----------------------------------
----- SNMP MIB2 support ----- ----- SNMP MIB2 support -----

View file

@ -221,10 +221,7 @@
---------- AUTOIP options ---------- ---------- AUTOIP options ----------
------------------------------------ ------------------------------------
*/ */
#if CONFIG_MDNS #ifdef CONFIG_LWIP_AUTOIP
/**
* LWIP_AUTOIP==1: Enable AUTOIP module.
*/
#define LWIP_AUTOIP 1 #define LWIP_AUTOIP 1
/** /**
@ -240,8 +237,13 @@
* be prepared to handle a changing IP address when DHCP overrides * be prepared to handle a changing IP address when DHCP overrides
* AutoIP. * AutoIP.
*/ */
#define LWIP_DHCP_AUTOIP_COOP_TRIES 2 #define LWIP_DHCP_AUTOIP_COOP_TRIES CONFIG_LWIP_AUTOIP_TRIES
#endif
#define LWIP_AUTOIP_MAX_CONFLICTS CONFIG_LWIP_AUTOIP_MAX_CONFLICTS
#define LWIP_AUTOIP_RATE_LIMIT_INTERVAL CONFIG_LWIP_AUTOIP_RATE_LIMIT_INTERVAL
#endif /* CONFIG_LWIP_AUTOIP */
/* /*
---------------------------------- ----------------------------------
@ -367,7 +369,7 @@
---------- LOOPIF options ---------- ---------- LOOPIF options ----------
------------------------------------ ------------------------------------
*/ */
#if CONFIG_MDNS #ifdef CONFIG_LWIP_NETIF_LOOPBACK
/** /**
* LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP * LWIP_NETIF_LOOPBACK==1: Support sending packets with a destination IP
* address equal to the netif IP address, looping them back up the stack. * address equal to the netif IP address, looping them back up the stack.
@ -378,7 +380,7 @@
* LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback * LWIP_LOOPBACK_MAX_PBUFS: Maximum number of pbufs on queue for loopback
* sending for each netif (0 = disabled) * sending for each netif (0 = disabled)
*/ */
#define LWIP_LOOPBACK_MAX_PBUFS 8 #define LWIP_LOOPBACK_MAX_PBUFS CONFIG_LWIP_LOOPBACK_MAX_PBUFS
#endif #endif
/* /*
@ -506,14 +508,12 @@
*/ */
#define SO_REUSE CONFIG_LWIP_SO_REUSE #define SO_REUSE CONFIG_LWIP_SO_REUSE
#if CONFIG_MDNS
/** /**
* SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets * SO_REUSE_RXTOALL==1: Pass a copy of incoming broadcast/multicast packets
* to all local matches if SO_REUSEADDR is turned on. * to all local matches if SO_REUSEADDR is turned on.
* WARNING: Adds a memcpy for every packet if passing to more than one pcb! * WARNING: Adds a memcpy for every packet if passing to more than one pcb!
*/ */
#define SO_REUSE_RXTOALL 1 #define SO_REUSE_RXTOALL CONFIG_LWIP_SO_REUSE_RXTOALL
#endif
/* /*
---------------------------------------- ----------------------------------------

View file

@ -5,7 +5,5 @@
PROJECT_NAME := udp-multicast PROJECT_NAME := udp-multicast
CFLAGS := -DCONFIG_MDNS
include $(IDF_PATH)/make/project.mk include $(IDF_PATH)/make/project.mk