Add some more functions and macros to documentation

This commit is contained in:
Dirk Ziegelmeier 2016-08-06 22:16:49 +02:00
parent 73131b1677
commit b94c8ee76f
2 changed files with 25 additions and 7 deletions

View File

@ -37,11 +37,14 @@
*/ */
/** /**
* @defgroup ip4 IPv4 * @defgroup ip IP
* @ingroup callbackstyle_api * @ingroup callbackstyle_api
*
* @defgroup ip4 IPv4
* @ingroup ip
* *
* @defgroup ip6 IPv6 * @defgroup ip6 IPv6
* @ingroup callbackstyle_api * @ingroup ip
* *
* @defgroup ipaddr IP address handling * @defgroup ipaddr IP address handling
* @ingroup infrastructure * @ingroup infrastructure

View File

@ -227,17 +227,26 @@ extern struct ip_globals ip_data;
#define ip_reset_option(pcb, opt) ((pcb)->so_options &= ~(opt)) #define ip_reset_option(pcb, opt) ((pcb)->so_options &= ~(opt))
#if LWIP_IPV4 && LWIP_IPV6 #if LWIP_IPV4 && LWIP_IPV6
/** Output IP packet, netif is selected by source address */ /**
* @ingroup ip
* Output IP packet, netif is selected by source address
*/
#define ip_output(p, src, dest, ttl, tos, proto) \ #define ip_output(p, src, dest, ttl, tos, proto) \
(IP_IS_V6(dest) ? \ (IP_IS_V6(dest) ? \
ip6_output(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto) : \ ip6_output(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto) : \
ip4_output(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto)) ip4_output(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto))
/** Output IP packet to specified interface */ /**
* @ingroup ip
* Output IP packet to specified interface
*/
#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \ #define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
(IP_IS_V6(dest) ? \ (IP_IS_V6(dest) ? \
ip6_output_if(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \ ip6_output_if(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \
ip4_output_if(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif)) ip4_output_if(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, netif))
/** Output IP packet to interface specifying source address */ /**
* @ingroup ip
* Output IP packet to interface specifying source address
*/
#define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \ #define ip_output_if_src(p, src, dest, ttl, tos, proto, netif) \
(IP_IS_V6(dest) ? \ (IP_IS_V6(dest) ? \
ip6_output_if_src(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \ ip6_output_if_src(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, netif) : \
@ -247,12 +256,18 @@ extern struct ip_globals ip_data;
(IP_IS_V6(dest) ? \ (IP_IS_V6(dest) ? \
ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, addr_hint) : \ ip6_output_hinted(p, ip_2_ip6(src), ip_2_ip6(dest), ttl, tos, proto, addr_hint) : \
ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, addr_hint)) ip4_output_hinted(p, ip_2_ip4(src), ip_2_ip4(dest), ttl, tos, proto, addr_hint))
/** Get netif for address combination. See \ref ip6_route and \ref ip4_route */ /**
* @ingroup ip
* Get netif for address combination. See \ref ip6_route and \ref ip4_route
*/
#define ip_route(src, dest) \ #define ip_route(src, dest) \
(IP_IS_V6(dest) ? \ (IP_IS_V6(dest) ? \
ip6_route(ip_2_ip6(src), ip_2_ip6(dest)) : \ ip6_route(ip_2_ip6(src), ip_2_ip6(dest)) : \
ip4_route_src(ip_2_ip4(dest), ip_2_ip4(src))) ip4_route_src(ip_2_ip4(dest), ip_2_ip4(src)))
/** Get netif for IP.*/ /**
* @ingroup ip
* Get netif for IP.
*/
#define ip_netif_get_local_ip(netif, dest) (IP_IS_V6(dest) ? \ #define ip_netif_get_local_ip(netif, dest) (IP_IS_V6(dest) ? \
ip6_netif_get_local_ip(netif, ip_2_ip6(dest)) : \ ip6_netif_get_local_ip(netif, ip_2_ip6(dest)) : \
ip4_netif_get_local_ip(netif)) ip4_netif_get_local_ip(netif))