X-Git-Url: https://git.archive.openwrt.org/?a=blobdiff_plain;f=interface-ip.h;h=6049d144a1ca089bccab4a589a8373c16f1c5b90;hb=547d96cd6d1bdf3624711b08491ca7fce6b4b0a3;hp=92667278096da88f4c8f41b4ea03f807c89a0307;hpb=69b2dcb92b8402b9c6df4d6a041a890fe6468e18;p=project%2Fnetifd.git diff --git a/interface-ip.h b/interface-ip.h index 9266727..6049d14 100644 --- a/interface-ip.h +++ b/interface-ip.h @@ -3,12 +3,15 @@ enum device_addr_flags { /* address family for routes and addresses */ - DEVADDR_INET4 = (0 << 0), - DEVADDR_INET6 = (1 << 0), - DEVADDR_FAMILY = DEVADDR_INET4 | DEVADDR_INET6, + DEVADDR_INET4 = (0 << 0), + DEVADDR_INET6 = (1 << 0), + DEVADDR_FAMILY = DEVADDR_INET4 | DEVADDR_INET6, /* device route (no gateway) */ - DEVADDR_DEVICE = (1 << 1), + DEVADDR_DEVICE = (1 << 1), + + /* externally added address */ + DEVADDR_EXTERNAL = (1 << 2), }; union if_addr { @@ -21,6 +24,7 @@ struct device_addr { enum device_addr_flags flags; + /* must be last */ unsigned int mask; union if_addr addr; }; @@ -31,11 +35,33 @@ struct device_route { enum device_addr_flags flags; bool keep; + union if_addr nexthop; + struct device *device; + + /* must be last */ unsigned int mask; union if_addr addr; - union if_addr nexthop; +}; + +struct dns_server { + struct list_head list; + int af; + union if_addr addr; +}; + +struct dns_search_domain { + struct list_head list; + char name[]; }; void interface_ip_init(struct interface *iface); +void interface_add_dns_server(struct interface *iface, const char *str); +void interface_add_dns_server_list(struct interface *iface, struct blob_attr *list); +void interface_clear_dns(struct interface *iface); +void interface_write_resolv_conf(void); + +void interface_ip_update_start(struct interface *iface); +void interface_ip_update_complete(struct interface *iface); + #endif