6c673c69272f1044cdb7c6e91f2129937aff6441
12 int interface_add_address(struct interface
*iface
, struct device_addr
*addr
)
16 if (addr
->flags
& DEVADDR_INET6
)
21 list_add(&addr
->list
, &iface
->address
);
22 return system_add_address(iface
->l3_iface
->dev
, addr
);
25 void interface_del_address(struct interface
*iface
, struct device_addr
*addr
)
29 if (addr
->flags
& DEVADDR_INET6
)
34 list_del(&addr
->list
);
35 system_del_address(iface
->l3_iface
->dev
, addr
);
38 void interface_del_ctx_addr(struct interface
*iface
, void *ctx
)
40 struct device_addr
*addr
, *tmp
;
42 list_for_each_entry_safe(addr
, tmp
, &iface
->address
, list
) {
43 if (ctx
&& addr
->ctx
!= ctx
)
46 interface_del_address(iface
, addr
);
50 int interface_add_route(struct interface
*iface
, struct device_route
*route
)
52 list_add(&route
->list
, &iface
->routes
);
53 return system_add_route(iface
->l3_iface
->dev
, route
);
56 void interface_del_route(struct interface
*iface
, struct device_route
*route
)
58 list_del(&route
->list
);
59 system_del_route(iface
->l3_iface
->dev
, route
);
62 void interface_del_all_routes(struct interface
*iface
)
64 struct device_route
*route
, *tmp
;
66 list_for_each_entry_safe(route
, tmp
, &iface
->routes
, list
)
67 interface_del_route(iface
, route
);