}
}
+void
+interface_add_dns_server(struct interface *iface, const char *str)
+{
+ struct dns_server *s;
+
+ s = calloc(1, sizeof(*s));
+ s->af = AF_INET;
+ if (inet_pton(s->af, str, &s->addr.in))
+ goto add;
+
+ s->af = AF_INET6;
+ if (inet_pton(s->af, str, &s->addr.in))
+ goto add;
+
+ free(s);
+ return;
+
+add:
+ D(INTERFACE, "Add IPv%c DNS server: %s\n",
+ s->af == AF_INET6 ? '6' : '4', str);
+ list_add_tail(&s->list, &iface->proto_dns_servers);
+}
+
+void
+interface_add_dns_server_list(struct interface *iface, struct blob_attr *list)
+{
+ struct blob_attr *cur;
+ int rem;
+
+ blobmsg_for_each_attr(cur, list, rem) {
+ if (blobmsg_type(cur) != BLOBMSG_TYPE_STRING)
+ continue;
+
+ if (!blobmsg_check_attr(cur, NULL))
+ continue;
+
+ interface_add_dns_server(iface, blobmsg_data(cur));
+ }
+}
+
static void
interface_clear_dns_servers(struct interface *iface)
{
}
void
+interface_ip_update_start(struct interface *iface)
+{
+ interface_clear_dns(iface);
+ vlist_update(&iface->proto_route);
+ vlist_update(&iface->proto_addr);
+}
+
+void
+interface_ip_update_complete(struct interface *iface)
+{
+ vlist_flush(&iface->proto_route);
+ vlist_flush(&iface->proto_addr);
+}
+
+void
interface_ip_init(struct interface *iface)
{
vlist_init(&iface->proto_route, route_cmp, interface_update_proto_route,