1 #ifndef __INTERFACE_IP_H
2 #define __INTERFACE_IP_H
6 enum device_addr_flags {
7 /* address family for routes and addresses */
8 DEVADDR_INET4 = (0 << 0),
9 DEVADDR_INET6 = (1 << 0),
10 DEVADDR_FAMILY = DEVADDR_INET4 | DEVADDR_INET6,
12 /* device route (no gateway) */
13 DEVADDR_DEVICE = (1 << 1),
15 /* externally added address */
16 DEVADDR_EXTERNAL = (1 << 2),
25 struct vlist_node node;
27 enum device_addr_flags flags;
30 struct device *device;
38 struct vlist_node node;
40 enum device_addr_flags flags;
44 union if_addr nexthop;
45 struct device *device;
55 struct vlist_simple_node node;
60 struct dns_search_domain {
61 struct vlist_simple_node node;
65 extern const struct config_param_list route_attr_list;
67 void interface_ip_init(struct interface_ip_settings *ip, struct interface *iface);
68 void interface_add_dns_server(struct interface_ip_settings *ip, const char *str);
69 void interface_add_dns_server_list(struct interface_ip_settings *ip, struct blob_attr *list);
70 void interface_add_dns_search_list(struct interface_ip_settings *ip, struct blob_attr *list);
71 void interface_write_resolv_conf(void);
73 void interface_ip_add_route(struct interface *iface, struct blob_attr *attr, bool v6);
75 void interface_ip_update_start(struct interface_ip_settings *ip);
76 void interface_ip_update_complete(struct interface_ip_settings *ip);
77 void interface_ip_flush(struct interface_ip_settings *ip);
78 void interface_ip_set_enabled(struct interface_ip_settings *ip, bool enabled);