-static int interface_change(struct network *network,
- struct interface *interface,
- bool up)
+static void add_interface(struct network *network,
+ struct interface *interface)
+{
+ list_add(&network->interfaces, &interface->list);
+ interface->dev = discover_device_create(network->handler,
+ interface->name);
+ interface->dev->device->type = DEVICE_TYPE_NETWORK;
+ device_handler_add_device(network->handler, interface->dev);
+}
+
+static void remove_interface(struct network *network,
+ struct interface *interface)
+{
+ device_handler_remove(network->handler, interface->dev);
+ list_remove(&interface->list);
+ talloc_free(interface);
+}
+
+static int interface_change(struct interface *interface, bool up)