summaryrefslogtreecommitdiff
path: root/accel-pppd/libnetlink/iputils.h
diff options
context:
space:
mode:
authorGuillaume Nault <g.nault@alphalink.fr>2018-02-20 18:50:25 +0100
committerDmitry Kozlov <xeb@mail.ru>2018-02-21 22:25:20 +0300
commit8ab2f623fa1d11a2aaec35226cb7a1456fc257d8 (patch)
tree093d82941fa97d7726bd5e1870c69b1e346aa8a1 /accel-pppd/libnetlink/iputils.h
parentc99e2092e9ad048e61110fd094d72e3d55cb49bc (diff)
downloadaccel-ppp-8ab2f623fa1d11a2aaec35226cb7a1456fc257d8.tar.gz
accel-ppp-8ab2f623fa1d11a2aaec35226cb7a1456fc257d8.zip
radius: add support for route priority (metric) in Framed-Route
Let an optional route priority (aka metric) be defined in RADIUS Framed-Route attributes. The priority is an integer placed at the end of the route string. This is backward compatible with the previous format and also conforms with the recommended format defined by RFC 2865 (although we don't allow multiple metrics). Framed-Route format is: <network> [<gateway> [<priority>]] For example, 'Framed-Route = "192.0.2.0/24 203.0.113.1 8"' will let the following route be installed (assuming 203.0.113.1 is routed through eth0): $ ip route show [...] 192.0.2.0/24 via 203.0.113.1 dev eth0 metric 8 It's possible to use the unspecified gateway (0.0.0.0) if one wants to set a priority without specifying a gateway address. Finally, route deletion now also takes the priority into account, in order to avoid removing a different route accidentally. Signed-off-by: Guillaume Nault <g.nault@alphalink.fr>
Diffstat (limited to 'accel-pppd/libnetlink/iputils.h')
-rw-r--r--accel-pppd/libnetlink/iputils.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/accel-pppd/libnetlink/iputils.h b/accel-pppd/libnetlink/iputils.h
index 3211cfb7..66aa9747 100644
--- a/accel-pppd/libnetlink/iputils.h
+++ b/accel-pppd/libnetlink/iputils.h
@@ -18,8 +18,8 @@ int ipaddr_add_peer(int ifindex, in_addr_t addr, in_addr_t peer_addr);
int ipaddr_del(int ifindex, in_addr_t addr, int mask);
int ipaddr_del_peer(int ifindex, in_addr_t addr, in_addr_t peer);
-int iproute_add(int ifindex, in_addr_t src, in_addr_t dst, in_addr_t gw, int proto, int mask);
-int iproute_del(int ifindex, in_addr_t dst, int proto, int mask);
+int iproute_add(int ifindex, in_addr_t src, in_addr_t dst, in_addr_t gw, int proto, int mask, uint32_t prio);
+int iproute_del(int ifindex, in_addr_t dst, int proto, int mask, uint32_t prio);
in_addr_t iproute_get(in_addr_t dst, in_addr_t *gw);
int ip6route_add(int ifindex, struct in6_addr *dst, int prefix_len, int proto);