summaryrefslogtreecommitdiffstats
path: root/sys/net/route.h
diff options
context:
space:
mode:
authormelifaro <melifaro@FreeBSD.org>2016-01-04 15:03:20 +0000
committermelifaro <melifaro@FreeBSD.org>2016-01-04 15:03:20 +0000
commit31d78f6810b70b03dcf590bdcd1f8520d199099d (patch)
tree97043b0fe5b60ef63af4661bdd61f9c954d3bf5b /sys/net/route.h
parentff9e83788d7ed52342dcba4dff1e62fdf3cc985c (diff)
downloadFreeBSD-src-31d78f6810b70b03dcf590bdcd1f8520d199099d.zip
FreeBSD-src-31d78f6810b70b03dcf590bdcd1f8520d199099d.tar.gz
Add rib_lookup_info() to provide API for retrieving individual route
entries data in unified format. There are control plane functions that require information other than just next-hop data (e.g. individual rtentry fields like flags or prefix/mask). Given that the goal is to avoid rte reference/refcounting, re-use rt_addrinfo structure to store most rte fields. If caller wants to retrieve key/mask or gateway (which are sockaddrs and are allocated separately), it needs to provide sufficient-sized sockaddrs structures w/ ther pointers saved in passed rt_addrinfo. Convert: * lltable new records checks (in_lltable_rtcheck(), nd6_is_new_addr_neighbor(). * rtsock pre-add/change route check. * IPv6 NS ND-proxy check (RADIX_MPATH code was eliminated because 1) we don't support RTF_ANNOUNCE ND-proxy for networks and there should not be multiple host routes for such hosts 2) if we have multiple routes we should inspect them (which is not done). 3) the entire idea of abusing KRT as storage for ND proxy seems odd. Userland programs should be used for that purpose).
Diffstat (limited to 'sys/net/route.h')
-rw-r--r--sys/net/route.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/sys/net/route.h b/sys/net/route.h
index 847722c..7c69e1c 100644
--- a/sys/net/route.h
+++ b/sys/net/route.h
@@ -197,6 +197,9 @@ struct rtentry {
#define NHR_IFAIF 0x01 /* Return ifa_ifp interface */
#define NHR_REF 0x02 /* For future use */
+/* Control plane route request flags */
+#define NHR_COPY 0x100 /* Copy rte data */
+
/* rte<>nhop translation */
static inline uint16_t
fib_rte_to_nh_flags(int rt_flags)
@@ -460,6 +463,9 @@ void rtredirect_fib(struct sockaddr *, struct sockaddr *,
int rtrequest_fib(int, struct sockaddr *,
struct sockaddr *, struct sockaddr *, int, struct rtentry **, u_int);
int rtrequest1_fib(int, struct rt_addrinfo *, struct rtentry **, u_int);
+int rib_lookup_info(uint32_t, const struct sockaddr *, uint32_t, uint32_t,
+ struct rt_addrinfo *);
+void rib_free_info(struct rt_addrinfo *info);
#include <sys/eventhandler.h>
typedef void (*rtevent_redirect_fn)(void *, struct rtentry *, struct rtentry *, struct sockaddr *);
OpenPOWER on IntegriCloud