mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-16 21:26:43 +08:00
Minor: Avoid ip_input() call indirection for when only IPv4 or IPv6 are enabled
This commit is contained in:
@@ -249,7 +249,11 @@ extern struct ip_globals ip_data;
|
||||
ip6_netif_get_local_ip(netif, ip_2_ip6(dest)) : \
|
||||
ip4_netif_get_local_ip(netif))
|
||||
#define ip_debug_print(is_ipv6, p) ((is_ipv6) ? ip6_debug_print(p) : ip4_debug_print(p))
|
||||
|
||||
err_t ip_input(struct pbuf *p, struct netif *inp);
|
||||
|
||||
#elif LWIP_IPV4 /* LWIP_IPV4 && LWIP_IPV6 */
|
||||
|
||||
#define ip_output(p, src, dest, ttl, tos, proto) \
|
||||
ip4_output(p, src, dest, ttl, tos, proto)
|
||||
#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
|
||||
@@ -263,7 +267,11 @@ extern struct ip_globals ip_data;
|
||||
#define ip_netif_get_local_ip(netif, dest) \
|
||||
ip4_netif_get_local_ip(netif)
|
||||
#define ip_debug_print(is_ipv6, p) ip4_debug_print(p)
|
||||
|
||||
#define ip_input ip4_input
|
||||
|
||||
#elif LWIP_IPV6 /* LWIP_IPV4 && LWIP_IPV6 */
|
||||
|
||||
#define ip_output(p, src, dest, ttl, tos, proto) \
|
||||
ip6_output(p, src, dest, ttl, tos, proto)
|
||||
#define ip_output_if(p, src, dest, ttl, tos, proto, netif) \
|
||||
@@ -277,6 +285,9 @@ extern struct ip_globals ip_data;
|
||||
#define ip_netif_get_local_ip(netif, dest) \
|
||||
ip6_netif_get_local_ip(netif, dest)
|
||||
#define ip_debug_print(is_ipv6, p) ip6_debug_print(p)
|
||||
|
||||
#define ip_input ip6_input
|
||||
|
||||
#endif /* LWIP_IPV6 */
|
||||
|
||||
#define ip_route_get_local_ip(src, dest, netif, ipaddr) do { \
|
||||
@@ -284,8 +295,6 @@ extern struct ip_globals ip_data;
|
||||
(ipaddr) = ip_netif_get_local_ip(netif, dest); \
|
||||
}while(0)
|
||||
|
||||
err_t ip_input(struct pbuf *p, struct netif *inp);
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user