+static int
+netifd_del_dynamic(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ struct blob_attr *tb[__DI_MAX];
+ struct interface *iface;
+
+ blobmsg_parse(dynamic_policy, __DI_MAX, tb, blob_data(msg), blob_len(msg));
+
+ if (!tb[DI_NAME])
+ return UBUS_STATUS_INVALID_ARGUMENT;
+
+ const char *name = blobmsg_get_string(tb[DI_NAME]);
+ iface = vlist_find(&interfaces, name, iface, node);
+
+ if (!iface)
+ return UBUS_STATUS_NOT_FOUND;
+ else if (!iface->dynamic)
+ return UBUS_STATUS_INVALID_COMMAND;
+
+ vlist_delete(&interfaces, &iface->node);
+ return UBUS_STATUS_OK;
+}
+