return 0;
}
+int
+interface_renew(struct interface *iface)
+{
+ if (iface->state == IFS_TEARDOWN || iface->state == IFS_DOWN)
+ return -1;
+
+ return interface_proto_event(iface->proto, PROTO_CMD_RENEW, false);
+}
+
void
interface_start_pending(void)
{
int interface_set_up(struct interface *iface);
int interface_set_down(struct interface *iface);
void __interface_set_down(struct interface *iface, bool force);
+int interface_renew(struct interface *iface);
void interface_set_main_dev(struct interface *iface, struct device *dev);
void interface_set_l3_dev(struct interface *iface, struct device *dev);
return 0;
}
+static int
+netifd_handle_renew(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ struct interface *iface;
+
+ iface = container_of(obj, struct interface, ubus);
+ interface_renew(iface);
+
+ return 0;
+}
+
static void
netifd_add_interface_errors(struct blob_buf *b, struct interface *iface)
{
static struct ubus_method iface_object_methods[] = {
{ .name = "up", .handler = netifd_handle_up },
{ .name = "down", .handler = netifd_handle_down },
+ { .name = "renew", .handler = netifd_handle_renew },
{ .name = "status", .handler = netifd_handle_status },
{ .name = "prepare", .handler = netifd_handle_iface_prepare },
{ .name = "dump", .handler = netifd_handle_dump },