mirror of
https://git.savannah.nongnu.org/git/lwip.git
synced 2026-05-24 17:17:03 +08:00
Implement task #14594: Improve consistency of ip route API parameters
reverse parameters of ip4_route_src to be consistent with other ip*_route* functions This commit will break applications using this function!
This commit is contained in:
@@ -262,7 +262,7 @@ extern struct ip_globals ip_data;
|
||||
#define ip_route(src, dest) \
|
||||
(IP_IS_V6(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(src), ip_2_ip4(dest)))
|
||||
/**
|
||||
* @ingroup ip
|
||||
* Get netif for IP.
|
||||
@@ -287,7 +287,7 @@ err_t ip_input(struct pbuf *p, struct netif *inp);
|
||||
#define ip_output_if_hdrincl(p, src, dest, netif) \
|
||||
ip4_output_if(p, src, LWIP_IP_HDRINCL, 0, 0, 0, netif)
|
||||
#define ip_route(src, dest) \
|
||||
ip4_route_src(dest, src)
|
||||
ip4_route_src(src, dest)
|
||||
#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)
|
||||
|
||||
@@ -64,9 +64,9 @@ extern "C" {
|
||||
#define ip_init() /* Compatibility define, no init needed. */
|
||||
struct netif *ip4_route(const ip4_addr_t *dest);
|
||||
#if LWIP_IPV4_SRC_ROUTING
|
||||
struct netif *ip4_route_src(const ip4_addr_t *dest, const ip4_addr_t *src);
|
||||
struct netif *ip4_route_src(const ip4_addr_t *src, const ip4_addr_t *dest);
|
||||
#else /* LWIP_IPV4_SRC_ROUTING */
|
||||
#define ip4_route_src(dest, src) ip4_route(dest)
|
||||
#define ip4_route_src(src, dest) ip4_route(dest)
|
||||
#endif /* LWIP_IPV4_SRC_ROUTING */
|
||||
err_t ip4_input(struct pbuf *p, struct netif *inp);
|
||||
err_t ip4_output(struct pbuf *p, const ip4_addr_t *src, const ip4_addr_t *dest,
|
||||
|
||||
@@ -2629,10 +2629,10 @@
|
||||
#endif
|
||||
|
||||
/**
|
||||
* LWIP_HOOK_IP4_ROUTE_SRC(dest, src):
|
||||
* LWIP_HOOK_IP4_ROUTE_SRC(src, dest):
|
||||
* Source-based routing for IPv4 - called from ip_route() (IPv4)
|
||||
* Signature:
|
||||
* struct netif *my_hook(const ip4_addr_t *dest, const ip4_addr_t *src);
|
||||
* struct netif *my_hook(const ip4_addr_t *src, const ip4_addr_t *dest);
|
||||
* Arguments:
|
||||
* - dest: destination IPv4 address
|
||||
* - src: local/source IPv4 address
|
||||
@@ -2641,7 +2641,7 @@
|
||||
* - NULL if no destination netif is found. In that case, ip_route() continues as normal.
|
||||
*/
|
||||
#ifdef __DOXYGEN__
|
||||
#define LWIP_HOOK_IP4_ROUTE_SRC(dest, src)
|
||||
#define LWIP_HOOK_IP4_ROUTE_SRC(src, dest)
|
||||
#endif
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user