summaryrefslogtreecommitdiffstats
path: root/mgmtd/mgmt_ds.h
diff options
context:
space:
mode:
authorYash Ranjan <ranjany@vmware.com>2021-10-28 09:07:11 +0200
committerChristian Hopps <chopps@labn.net>2023-03-22 03:08:32 +0100
commit74335ceb2753cc73afe2854b20640018431acc19 (patch)
tree0ff2afc2aacd7078131086fd6051321725b5cd94 /mgmtd/mgmt_ds.h
parentmgmtd: Add MGMT Backend Interface Framework (diff)
downloadfrr-74335ceb2753cc73afe2854b20640018431acc19.tar.xz
frr-74335ceb2753cc73afe2854b20640018431acc19.zip
mgmtd: Add MGMT Transaction Framework
This commit introduces the MGMT Transaction framework that takes management requests from one (or more) frontend client sessions, translates them into transactions and drives them to completion in co-oridination with one (or more) backend client daemons involved in the request. This commit includes the following functionalities in the changeset: 1. Introduces the actual Transaction module. Commands added related to transaction are: a. show mgmt transaction all 2. Adds support for commit rollback feature which stores upto the 10 commit buffers. Each commit has a commit-id which can be used to rollback to the exact configuration state. Commands supported for this feature are: a. show mgmt commit-history b. mgmt rollback commit-id COMMIT_ID 3. Add hidden commands to enable record various performance metrics: a. mgmt performance-measurement b. mgmt reset-statistic Co-authored-by: Pushpasis Sarkar <pushpasis@gmail.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Yash Ranjan <ranjany@vmware.com>
Diffstat (limited to 'mgmtd/mgmt_ds.h')
-rw-r--r--mgmtd/mgmt_ds.h33
1 files changed, 8 insertions, 25 deletions
diff --git a/mgmtd/mgmt_ds.h b/mgmtd/mgmt_ds.h
index 7a6737cd2..89a2ea942 100644
--- a/mgmtd/mgmt_ds.h
+++ b/mgmtd/mgmt_ds.h
@@ -13,6 +13,8 @@
#include "northbound.h"
#include "mgmtd/mgmt_defines.h"
+#include "mgmtd/mgmt_be_adapter.h"
+#include "mgmtd/mgmt_fe_adapter.h"
#define MGMTD_MAX_NUM_DSNODES_PER_BATCH 128
@@ -35,16 +37,10 @@
#define MGMTD_COMMIT_INDEX_FILE_NAME DAEMON_DB_DIR "/commit-index.dat"
#define MGMTD_COMMIT_TIME_STR_LEN 100
-struct mgmt_master;
-
extern struct nb_config *running_config;
struct mgmt_ds_ctx;
-typedef void (*mgmt_ds_node_iter_fn)(uint64_t ds_hndl, char *xpath,
- struct lyd_node *node,
- struct nb_node *nb_node, void *ctx);
-
/***************************************************************
* Global data exported
***************************************************************/
@@ -203,25 +199,6 @@ extern int mgmt_ds_write_lock(struct mgmt_ds_ctx *ds_ctx);
extern int mgmt_ds_unlock(struct mgmt_ds_ctx *ds_ctx);
/*
- * Merge two datastores.
- *
- * src_ds
- * Source datastore handle.
- *
- * dst_ds
- * Destination datastore handle.
- *
- * update_cmd_rec
- * TRUE if need to update commit record, FALSE otherwise.
- *
- * Returns:
- * 0 on success, -1 on failure.
- */
-extern int mgmt_ds_merge_dss(struct mgmt_ds_ctx *src_ds_ctx,
- struct mgmt_ds_ctx *dst_ds_ctx,
- bool update_cmt_rec);
-
-/*
* Copy from source to destination datastore.
*
* src_ds
@@ -388,4 +365,10 @@ extern void mgmt_ds_status_write_one(struct vty *vty,
*/
extern void mgmt_ds_status_write(struct vty *vty);
+
+/*
+ * Reset the candidate DS to empty state
+ */
+void mgmt_ds_reset_candidate(void);
+
#endif /* _FRR_MGMTD_DS_H_ */