interface: clean up after hotplug interfaces are removed
[project/netifd.git] / proto.c
diff --git a/proto.c b/proto.c
index 8266e81..ccc5f25 100644 (file)
--- a/proto.c
+++ b/proto.c
@@ -32,8 +32,6 @@ enum {
        OPT_BROADCAST,
        OPT_GATEWAY,
        OPT_IP6GW,
-       OPT_DNS,
-       OPT_DNS_SEARCH,
        __OPT_MAX,
 };
 
@@ -44,14 +42,11 @@ static const struct blobmsg_policy proto_ip_attributes[__OPT_MAX] = {
        [OPT_BROADCAST] = { .name = "broadcast", .type = BLOBMSG_TYPE_STRING },
        [OPT_GATEWAY] = { .name = "gateway", .type = BLOBMSG_TYPE_STRING },
        [OPT_IP6GW] = { .name = "ip6gw", .type = BLOBMSG_TYPE_STRING },
-       [OPT_DNS] = { .name = "dns", .type = BLOBMSG_TYPE_ARRAY },
-       [OPT_DNS_SEARCH] = { .name = "dns_search", .type = BLOBMSG_TYPE_ARRAY },
 };
 
 static const union config_param_info proto_ip_attr_info[__OPT_MAX] = {
        [OPT_IPADDR] = { .type = BLOBMSG_TYPE_STRING },
        [OPT_IP6ADDR] = { .type = BLOBMSG_TYPE_STRING },
-       [OPT_DNS] = { .type = BLOBMSG_TYPE_STRING },
 };
 
 const struct config_param_list proto_ip_attr = {
@@ -339,12 +334,6 @@ proto_apply_static_ip_settings(struct interface *iface, struct blob_attr *attr)
                        goto out;
        }
 
-       if ((cur = tb[OPT_DNS]))
-               interface_add_dns_server_list(&iface->proto_ip, cur);
-
-       if ((cur = tb[OPT_DNS_SEARCH]))
-               interface_add_dns_search_list(&iface->proto_ip, cur);
-
        return 0;
 
 error:
@@ -387,12 +376,6 @@ proto_apply_ip_settings(struct interface *iface, struct blob_attr *attr, bool ex
                        goto out;
        }
 
-       if ((cur = tb[OPT_DNS]))
-               interface_add_dns_server_list(&iface->proto_ip, cur);
-
-       if ((cur = tb[OPT_DNS_SEARCH]))
-               interface_add_dns_search_list(&iface->proto_ip, cur);
-
        return 0;
 
 error:
@@ -467,6 +450,19 @@ get_proto_handler(const char *name)
 }
 
 void
+proto_dump_handlers(struct blob_buf *b)
+{
+       struct proto_handler *p;
+       void *c;
+
+       avl_for_each_element(&handlers, p, avl) {
+               c = blobmsg_open_table(b, p->name);
+               blobmsg_add_u8(b, "no_device", !!(p->flags & PROTO_FLAG_NODEV));
+               blobmsg_close_table(b, c);
+       }
+}
+
+void
 proto_init_interface(struct interface *iface, struct blob_attr *attr)
 {
        const struct proto_handler *proto = iface->proto_handler;