2020-12-23 22:21:36 +01:00
|
|
|
/* SPDX-License-Identifier: GPL-2.0-or-later */
|
2019-09-25 13:13:40 +02:00
|
|
|
/*
|
2016-07-01 12:11:01 +02:00
|
|
|
* Copyright (C) 2016 Red Hat, Inc.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef __NM_CHECKPOINT_MANAGER_H__
|
|
|
|
|
#define __NM_CHECKPOINT_MANAGER_H__
|
|
|
|
|
|
|
|
|
|
#include "nm-dbus-interface.h"
|
2016-09-29 13:49:01 +02:00
|
|
|
|
2016-07-01 12:11:01 +02:00
|
|
|
#include "nm-checkpoint.h"
|
|
|
|
|
|
|
|
|
|
typedef struct _NMCheckpointManager NMCheckpointManager;
|
|
|
|
|
|
2017-10-21 16:05:14 +02:00
|
|
|
NMCheckpointManager *nm_checkpoint_manager_new(NMManager *manager, GParamSpec *spec);
|
2018-03-27 16:13:17 +02:00
|
|
|
|
|
|
|
|
void nm_checkpoint_manager_free(NMCheckpointManager *self);
|
2016-07-01 12:11:01 +02:00
|
|
|
|
2018-03-27 16:19:20 +02:00
|
|
|
NMCheckpoint *
|
|
|
|
|
nm_checkpoint_manager_lookup_by_path(NMCheckpointManager *self, const char *path, GError **error);
|
|
|
|
|
|
2021-11-09 13:28:54 +01:00
|
|
|
NMCheckpoint *nm_checkpoint_manager_create(NMCheckpointManager *self,
|
|
|
|
|
const char *const *device_names,
|
2016-07-01 12:11:01 +02:00
|
|
|
guint32 rollback_timeout,
|
|
|
|
|
NMCheckpointCreateFlags flags,
|
2021-11-09 13:28:54 +01:00
|
|
|
GError **error);
|
2016-07-01 12:11:01 +02:00
|
|
|
|
2018-03-27 16:19:20 +02:00
|
|
|
void nm_checkpoint_manager_destroy_all(NMCheckpointManager *self);
|
2016-07-01 12:11:01 +02:00
|
|
|
|
|
|
|
|
gboolean nm_checkpoint_manager_destroy(NMCheckpointManager *self, const char *path, GError **error);
|
|
|
|
|
gboolean nm_checkpoint_manager_rollback(NMCheckpointManager *self,
|
2021-11-09 13:28:54 +01:00
|
|
|
const char *path,
|
|
|
|
|
GVariant **results,
|
|
|
|
|
GError **error);
|
2016-07-01 12:11:01 +02:00
|
|
|
|
checkpoint: allow resetting the rollback timeout via D-Bus
This allows to adjust the timeout of an existing checkpoint.
The main usecase of checkpoints, is to have a fail-safe when
configuring the network remotely. By allowing to reset the timeout,
the user can perform a series of actions, and keep bumping the
timeout. That way, the entire series is still guarded by the same
checkpoint, but the user can start with short timeout, and
re-adjust the timeout as he goes along.
The libnm API only implements the async form (at least for now).
Sync methods are fundamentally wrong with D-Bus, and it's probably
not needed. Also, follow glib convenction, where the async form
doesn't have the _async name suffix. Also, accept a D-Bus path
as argument, not a NMCheckpoint instance. The libnm API should
not be more restricted than the underlying D-Bus API. It would
be cumbersome to require the user to lookup the NMCheckpoint
instance first, especially since libnm doesn't provide an efficient
or convenient lookup-by-path method. On the other hand, retrieving
the path from a NMCheckpoint instance is always possible.
2018-03-28 08:09:56 +02:00
|
|
|
gboolean nm_checkpoint_manager_adjust_rollback_timeout(NMCheckpointManager *self,
|
2021-11-09 13:28:54 +01:00
|
|
|
const char *path,
|
checkpoint: allow resetting the rollback timeout via D-Bus
This allows to adjust the timeout of an existing checkpoint.
The main usecase of checkpoints, is to have a fail-safe when
configuring the network remotely. By allowing to reset the timeout,
the user can perform a series of actions, and keep bumping the
timeout. That way, the entire series is still guarded by the same
checkpoint, but the user can start with short timeout, and
re-adjust the timeout as he goes along.
The libnm API only implements the async form (at least for now).
Sync methods are fundamentally wrong with D-Bus, and it's probably
not needed. Also, follow glib convenction, where the async form
doesn't have the _async name suffix. Also, accept a D-Bus path
as argument, not a NMCheckpoint instance. The libnm API should
not be more restricted than the underlying D-Bus API. It would
be cumbersome to require the user to lookup the NMCheckpoint
instance first, especially since libnm doesn't provide an efficient
or convenient lookup-by-path method. On the other hand, retrieving
the path from a NMCheckpoint instance is always possible.
2018-03-28 08:09:56 +02:00
|
|
|
guint32 add_timeout,
|
2021-11-09 13:28:54 +01:00
|
|
|
GError **error);
|
checkpoint: allow resetting the rollback timeout via D-Bus
This allows to adjust the timeout of an existing checkpoint.
The main usecase of checkpoints, is to have a fail-safe when
configuring the network remotely. By allowing to reset the timeout,
the user can perform a series of actions, and keep bumping the
timeout. That way, the entire series is still guarded by the same
checkpoint, but the user can start with short timeout, and
re-adjust the timeout as he goes along.
The libnm API only implements the async form (at least for now).
Sync methods are fundamentally wrong with D-Bus, and it's probably
not needed. Also, follow glib convenction, where the async form
doesn't have the _async name suffix. Also, accept a D-Bus path
as argument, not a NMCheckpoint instance. The libnm API should
not be more restricted than the underlying D-Bus API. It would
be cumbersome to require the user to lookup the NMCheckpoint
instance first, especially since libnm doesn't provide an efficient
or convenient lookup-by-path method. On the other hand, retrieving
the path from a NMCheckpoint instance is always possible.
2018-03-28 08:09:56 +02:00
|
|
|
|
2018-03-27 16:19:20 +02:00
|
|
|
const char **nm_checkpoint_manager_get_checkpoint_paths(NMCheckpointManager *self,
|
2021-11-09 13:28:54 +01:00
|
|
|
guint *out_length);
|
2017-10-21 16:05:14 +02:00
|
|
|
|
2016-07-01 12:11:01 +02:00
|
|
|
#endif /* __NM_CHECKPOINT_MANAGER_H__ */
|