diff options
author | Felix Fietkau <nbd@openwrt.org> | 2011-05-03 00:53:40 +0200 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2011-05-03 00:53:40 +0200 |
commit | f6fb6bee2c29f31d13d0b0288f4f680b6b56e9ba (patch) | |
tree | 1bf7e863882ff56f93ecb493c5ab55e0471112fa /interface-ip.c | |
parent | 273550337f70b8b2175875e0c4f0bbd483cfe326 (diff) |
add routes/gateway support
Diffstat (limited to 'interface-ip.c')
-rw-r--r-- | interface-ip.c | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/interface-ip.c b/interface-ip.c index 51f23ef..6c673c6 100644 --- a/interface-ip.c +++ b/interface-ip.c @@ -46,3 +46,23 @@ void interface_del_ctx_addr(struct interface *iface, void *ctx) interface_del_address(iface, addr); } } + +int interface_add_route(struct interface *iface, struct device_route *route) +{ + list_add(&route->list, &iface->routes); + return system_add_route(iface->l3_iface->dev, route); +} + +void interface_del_route(struct interface *iface, struct device_route *route) +{ + list_del(&route->list); + system_del_route(iface->l3_iface->dev, route); +} + +void interface_del_all_routes(struct interface *iface) +{ + struct device_route *route, *tmp; + + list_for_each_entry_safe(route, tmp, &iface->routes, list) + interface_del_route(iface, route); +} |