From 4b45baee101b02f29143c22db92f33162edb1ece Mon Sep 17 00:00:00 2001 From: Dirk Ziegelmeier Date: Fri, 26 Aug 2016 15:58:18 +0200 Subject: [PATCH] Add some dual-stack notes to documentation --- src/core/raw.c | 2 ++ src/core/tcp.c | 2 ++ src/core/udp.c | 2 ++ src/include/lwip/ip_addr.h | 6 +++++- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/core/raw.c b/src/core/raw.c index efa21f90..a3a90778 100644 --- a/src/core/raw.c +++ b/src/core/raw.c @@ -472,6 +472,8 @@ raw_new(u8_t proto) * could not be allocated. * * @param type IP address type, see IPADDR_TYPE_XX definitions. + * If you want to listen to IPv4 and IPv6 (dual-stack) packets, + * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. * @param proto the protocol number (next header) of the IPv6 packet payload * (e.g. IP6_NEXTH_ICMP6) * diff --git a/src/core/tcp.c b/src/core/tcp.c index 7f15c04c..64eef699 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -1603,6 +1603,8 @@ tcp_new(void) * The pcb is not put on any list until binding using tcp_bind(). * * @param type IP address type, see IPADDR_TYPE_XX definitions. + * If you want to listen to IPv4 and IPv6 (dual-stack) connections, + * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. * @return a new tcp_pcb that initially is in state CLOSED */ struct tcp_pcb * diff --git a/src/core/udp.c b/src/core/udp.c index 04a64537..60d3f4a6 100644 --- a/src/core/udp.c +++ b/src/core/udp.c @@ -1145,6 +1145,8 @@ udp_new(void) * Create a UDP PCB for specific IP type. * * @param type IP address type, see IPADDR_TYPE_XX definitions. + * If you want to listen to IPv4 and IPv6 (dual-stack) packets, + * supply @ref IPADDR_TYPE_ANY as argument and bind to @ref IP_ANY_TYPE. * @return The UDP PCB which was created. NULL if the PCB data structure * could not be allocated. * diff --git a/src/include/lwip/ip_addr.h b/src/include/lwip/ip_addr.h index 5523ee02..4b13e702 100644 --- a/src/include/lwip/ip_addr.h +++ b/src/include/lwip/ip_addr.h @@ -47,9 +47,13 @@ extern "C" { #endif -/** These are the values for ip_addr_t.type */ +/** Value for ip_addr_t.type: IPv4 */ #define IPADDR_TYPE_V4 0U +/** Value for ip_addr_t.type: IPv6 */ #define IPADDR_TYPE_V6 6U +/** Value for ip_addr_t.type: IPv4+IPv6 ("dual-stack") + * @see tcp_new_ip_type(), udp_new_ip_type(), raw_new_ip_type(). + */ #define IPADDR_TYPE_ANY 46U #if LWIP_IPV4 && LWIP_IPV6