diff options
author | Jonas Gorski <jonas.gorski@bisdn.de> | 2024-02-20 12:50:48 (GMT) |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2024-05-17 14:31:12 (GMT) |
commit | 3e0806317b5116bca7a097a0cb9b7a9cbebc465a (patch) | |
tree | 5132a1dc0a03cfe3b88d4e80a3ad04f9f8e7934f /include | |
parent | 401c2488624f2eb184e2b6f2e55d07c840854882 (diff) | |
download | libnl-3e0806317b5116bca7a097a0cb9b7a9cbebc465a.zip libnl-3e0806317b5116bca7a097a0cb9b7a9cbebc465a.tar.gz libnl-3e0806317b5116bca7a097a0cb9b7a9cbebc465a.tar.bz2 |
route: expose nexthop id attribute
Routes may reference a nexthop (group) via the new nexthop API by its
ID, so add accessors for setting and getting it.
Referencing a nexthop is mutually exclusive to specifiying nexthops in
the route, so make sure we do not do that when creating netlink
messages (which may exist both, since netlink messages from the kernel
contain both unless 'nexthop_compat_mode' is disabled).
$ ip -6 r
2001:db8:3::/64 nhid 20 metric 1024 pref medium
nexthop via 2001:db8:1::2 dev v0 weight 1
nexthop via 2001:db8:2::2 dev v1 weight 1
Before:
$ nl-route-list
inet6 2001:db8:3::/64 table main type unicast via 2001:db8:1::2 dev v0 via 2001:db8:2::2 dev v1
After:
$ nl-route-list
inet6 2001:db8:3::/64 table main type unicast nhid 20 via 2001:db8:1::2 dev v0 via 2001:db8:2::2 dev v1
Signed-off-by: Jonas Gorski <jonas.gorski@bisdn.de>
https://github.com/thom311/libnl/pull/386
Diffstat (limited to 'include')
-rw-r--r-- | include/netlink/route/route.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/include/netlink/route/route.h b/include/netlink/route/route.h index 3824762..4377062 100644 --- a/include/netlink/route/route.h +++ b/include/netlink/route/route.h @@ -94,6 +94,8 @@ extern int rtnl_route_get_src_len(struct rtnl_route *); extern void rtnl_route_set_ttl_propagate(struct rtnl_route *route, uint8_t ttl_prop); extern int rtnl_route_get_ttl_propagate(struct rtnl_route *route); +extern void rtnl_route_set_nhid(struct rtnl_route *, uint32_t); +extern uint32_t rtnl_route_get_nhid(struct rtnl_route *); extern void rtnl_route_add_nexthop(struct rtnl_route *, struct rtnl_nexthop *); |