+static int
+netifd_handle_restart(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ netifd_restart();
+ return 0;
+}
+
+static int
+netifd_handle_reload(struct ubus_context *ctx, struct ubus_object *obj,
+ struct ubus_request_data *req, const char *method,
+ struct blob_attr *msg)
+{
+ netifd_reload();
+ return 0;
+}
+
+static struct ubus_method main_object_methods[] = {
+ { .name = "restart", .handler = netifd_handle_restart },
+ { .name = "reload", .handler = netifd_handle_reload },
+};
+
+static struct ubus_object_type main_object_type =
+ UBUS_OBJECT_TYPE("netifd", main_object_methods);
+
+static struct ubus_object main_object = {
+ .name = "network",
+ .type = &main_object_type,
+ .methods = main_object_methods,
+ .n_methods = ARRAY_SIZE(main_object_methods),
+};
+