summaryrefslogtreecommitdiff
path: root/src/providers
diff options
context:
space:
mode:
Diffstat (limited to 'src/providers')
-rw-r--r--src/providers/data_provider_be.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/providers/data_provider_be.c b/src/providers/data_provider_be.c
index 059a0514..004ee097 100644
--- a/src/providers/data_provider_be.c
+++ b/src/providers/data_provider_be.c
@@ -55,11 +55,14 @@ static int data_provider_res_init(DBusMessage *message,
struct sbus_connection *conn);
static int data_provider_go_offline(DBusMessage *message,
struct sbus_connection *conn);
+static int data_provider_reset_offline(DBusMessage *message,
+ struct sbus_connection *conn);
struct sbus_method monitor_be_methods[] = {
{ MON_CLI_METHOD_PING, monitor_common_pong },
{ MON_CLI_METHOD_RES_INIT, data_provider_res_init },
{ MON_CLI_METHOD_OFFLINE, data_provider_go_offline },
+ { MON_CLI_METHOD_RESET_OFFLINE, data_provider_reset_offline },
{ MON_CLI_METHOD_ROTATE, monitor_common_rotate_logs },
{ NULL, NULL }
};
@@ -170,6 +173,14 @@ void be_mark_offline(struct be_ctx *ctx)
be_run_offline_cb(ctx);
}
+void be_reset_offline(struct be_ctx *ctx)
+{
+ DEBUG(8, ("Going back online!\n"));
+
+ ctx->offstat.offline = false;
+ be_run_online_cb(ctx);
+}
+
static int be_check_online(DBusMessage *message, struct sbus_connection *conn)
{
struct be_client *becli;
@@ -1229,3 +1240,12 @@ static int data_provider_go_offline(DBusMessage *message,
be_mark_offline(be_ctx);
return monitor_common_pong(message, conn);
}
+
+static int data_provider_reset_offline(DBusMessage *message,
+ struct sbus_connection *conn)
+{
+ struct be_ctx *be_ctx;
+ be_ctx = talloc_get_type(sbus_conn_get_private_data(conn), struct be_ctx);
+ be_reset_offline(be_ctx);
+ return monitor_common_pong(message, conn);
+}