]> git.proxmox.com Git - mirror_frr.git/blob - mgmtd/mgmt_history.h
ldpd: changes for code maintainability
[mirror_frr.git] / mgmtd / mgmt_history.h
1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /*
3 * Copyright (C) 2021 Vmware, Inc.
4 * Pushpasis Sarkar <spushpasis@vmware.com>
5 * Copyright (c) 2023, LabN Consulting, L.L.C.
6 *
7 */
8 #ifndef _FRR_MGMTD_HISTORY_H_
9 #define _FRR_MGMTD_HISTORY_H_
10
11 #include "vrf.h"
12
13 PREDECL_DLIST(mgmt_cmt_infos);
14
15 struct mgmt_ds_ctx;
16
17 /*
18 * Rollback specific commit from commit history.
19 *
20 * vty
21 * VTY context.
22 *
23 * cmtid_str
24 * Specific commit id from commit history.
25 *
26 * Returns:
27 * 0 on success, -1 on failure.
28 */
29 extern int mgmt_history_rollback_by_id(struct vty *vty, const char *cmtid_str);
30
31 /*
32 * Rollback n commits from commit history.
33 *
34 * vty
35 * VTY context.
36 *
37 * num_cmts
38 * Number of commits to be rolled back.
39 *
40 * Returns:
41 * 0 on success, -1 on failure.
42 */
43 extern int mgmt_history_rollback_n(struct vty *vty, int num_cmts);
44
45 extern void mgmt_history_rollback_complete(bool success);
46
47 /*
48 * Show mgmt commit history.
49 */
50 extern void show_mgmt_cmt_history(struct vty *vty);
51
52 extern void mgmt_history_new_record(struct mgmt_ds_ctx *ds_ctx);
53
54 extern void mgmt_history_destroy(void);
55 extern void mgmt_history_init(void);
56
57 #endif /* _FRR_MGMTD_HISTORY_H_ */