mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2025-08-07 15:04:39 +08:00
Convert IP address type numbers to an enum to improve documentation
This commit is contained in:
parent
97b774ceb9
commit
6abcd00f71
@ -471,7 +471,7 @@ raw_new(u8_t proto)
|
|||||||
* @return The RAW PCB which was created. NULL if the PCB data structure
|
* @return The RAW PCB which was created. NULL if the PCB data structure
|
||||||
* could not be allocated.
|
* could not be allocated.
|
||||||
*
|
*
|
||||||
* @param type IP address type, see IPADDR_TYPE_XX definitions.
|
* @param type IP address type, see @ref lwip_ip_addr_type definitions.
|
||||||
* If you want to listen to IPv4 and IPv6 (dual-stack) packets,
|
* 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.
|
* 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
|
* @param proto the protocol number (next header) of the IPv6 packet payload
|
||||||
|
@ -1602,7 +1602,7 @@ tcp_new(void)
|
|||||||
* place it on any of the TCP PCB lists.
|
* place it on any of the TCP PCB lists.
|
||||||
* The pcb is not put on any list until binding using tcp_bind().
|
* The pcb is not put on any list until binding using tcp_bind().
|
||||||
*
|
*
|
||||||
* @param type IP address type, see IPADDR_TYPE_XX definitions.
|
* @param type IP address type, see @ref lwip_ip_addr_type definitions.
|
||||||
* If you want to listen to IPv4 and IPv6 (dual-stack) connections,
|
* 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.
|
* 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
|
* @return a new tcp_pcb that initially is in state CLOSED
|
||||||
|
@ -1143,7 +1143,7 @@ udp_new(void)
|
|||||||
* @ingroup udp_raw
|
* @ingroup udp_raw
|
||||||
* Create a UDP PCB for specific IP type.
|
* Create a UDP PCB for specific IP type.
|
||||||
*
|
*
|
||||||
* @param type IP address type, see IPADDR_TYPE_XX definitions.
|
* @param type IP address type, see @ref lwip_ip_addr_type definitions.
|
||||||
* If you want to listen to IPv4 and IPv6 (dual-stack) packets,
|
* 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.
|
* 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
|
* @return The UDP PCB which was created. NULL if the PCB data structure
|
||||||
|
@ -47,14 +47,18 @@
|
|||||||
extern "C" {
|
extern "C" {
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/** Value for ip_addr_t.type: IPv4 */
|
/** @ingroup ipaddr
|
||||||
#define IPADDR_TYPE_V4 0U
|
* IP address types for use in ip_addr_t.type member.
|
||||||
/** 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().
|
* @see tcp_new_ip_type(), udp_new_ip_type(), raw_new_ip_type().
|
||||||
*/
|
*/
|
||||||
#define IPADDR_TYPE_ANY 46U
|
enum lwip_ip_addr_type {
|
||||||
|
/** IPv4 */
|
||||||
|
IPADDR_TYPE_V4 = 0U,
|
||||||
|
/** IPv6 */
|
||||||
|
IPADDR_TYPE_V6 = 6U,
|
||||||
|
/** IPv4+IPv6 ("dual-stack") */
|
||||||
|
IPADDR_TYPE_ANY = 46U
|
||||||
|
};
|
||||||
|
|
||||||
#if LWIP_IPV4 && LWIP_IPV6
|
#if LWIP_IPV4 && LWIP_IPV6
|
||||||
/**
|
/**
|
||||||
@ -67,6 +71,7 @@ typedef struct _ip_addr {
|
|||||||
ip6_addr_t ip6;
|
ip6_addr_t ip6;
|
||||||
ip4_addr_t ip4;
|
ip4_addr_t ip4;
|
||||||
} u_addr;
|
} u_addr;
|
||||||
|
/** @ref lwip_ip_addr_type */
|
||||||
u8_t type;
|
u8_t type;
|
||||||
} ip_addr_t;
|
} ip_addr_t;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user