8 #include "interface-ip.h"
14 interface_update_proto_addr(struct vlist_tree *tree,
15 struct vlist_node *node_new,
16 struct vlist_node *node_old)
18 struct interface *iface;
20 struct device_addr *addr;
22 iface = container_of(tree, struct interface, proto_addr);
23 dev = iface->l3_dev->dev;
26 addr = container_of(node_old, struct device_addr, node);
27 system_del_address(dev, addr);
32 addr = container_of(node_new, struct device_addr, node);
33 system_add_address(dev, addr);
38 interface_update_proto_route(struct vlist_tree *tree,
39 struct vlist_node *node_new,
40 struct vlist_node *node_old)
42 struct interface *iface;
44 struct device_route *route;
46 iface = container_of(tree, struct interface, proto_route);
47 dev = iface->l3_dev->dev;
50 route = container_of(node_old, struct device_route, node);
51 system_del_route(dev, route);
56 route = container_of(node_new, struct device_route, node);
57 system_add_route(dev, route);
62 interface_ip_init(struct interface *iface)
64 vlist_init(&iface->proto_route, interface_update_proto_route,
65 struct device_route, node, mask, addr);
66 vlist_init(&iface->proto_addr, interface_update_proto_addr,
67 struct device_addr, node, mask, addr);