summaryrefslogtreecommitdiff
path: root/mgmtd/mgmt_ds.h
AgeCommit message (Collapse)Author
2025-04-09mgmtd: normalize argument order to copy(dst, src)Christian Hopps
Having just completed a code audit during RCA, the fact that we have 2 different argument orders for the related datastore copying functions was unnecessary and super confusing. Fix this code-maintenance/comprehension mistake and move the newer mgmtd copy routines to use the same arg order as the pre-existing underlying northbound copy functions (i.e., use `copy(dst, src)`) Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-27lib, mgmtd: fix commit history locationDavid Lamparter
Both of these belong in `/var/lib`, not `/var/run`. Rather hilariously, the history read in `mgmt_history_read_cmt_record_index` was always failing, because it was doing a `file_exists(MGMTD_COMMIT_FILE_PATH)` check. Which is the wrong macro - it's `.../commit-%s.json`, including the unprocessed `%s`, which would never exist. I guess noone ever tried if this actually works. Cool. On the plus side, this means I don't have to implement legacy compatibility for this, since it never worked to begin with. (SQLite3 DB location is also changed in this commit since it also uses `DAEMON_DB_DIR`.) Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
2023-11-17lib, mgmtd: move common header to libIgor Ryzhov
The common header included from lib and other daemons should be located in lib, not in mgmt directory. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-06-18mgmtd: simplify locking, removing read locksChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30mgmtd: simplify early config build removing unused codeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-04mgmtd: simplify commit id to just be a timeval stringChristian Hopps
Also fixes coverity warning Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-31mgmtd: remove startup config feature for nowChristian Hopps
The startup config and how it interacts with explicit commits, commit databases and implicit commits needs to be worked out in design first. For now remove the offending code. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-21mgmtd: Add MGMT Transaction FrameworkYash Ranjan
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>
2023-03-21mgmtd: Add MGMT Frontend Interface FrameworkChristian Hopps
This commit introduces the Frontend Interface which can be used by front-end management clients like Netconf server, Restconf Server and CLI to interact with new FRR Management daemon (MGMTd) to access and sometimes modify FRR management data. This commit includes the following functionalities in the changeset: 1. Add new Frontend server for clients connect to. 2. Add a C-based Frontend client library which can be used by Frontend clients to communicate with MGMTd via the Frontend interface. 3. Maintain a frontend adapter for each connection from an appropriate Frontend client to facilitate client requests and track one or more client sessions across it. 4. Define the protobuf message format for messages to be exchanged between MGMTd Frontend module and the Frontend client. 5. This changeset also introduces an instance of MGMT Frontend client embedded within the lib/vty module that can be leveraged by any FRR daemon to connect to MGMTd's Frontend interface. The same has been integrated with and initialized within the MGMTd daemon's process context to implement a bunch of 'set-config', 'commit-apply', 'get-config' and 'get-data' commands via VTYSH 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>
2023-03-21mgmtd: Bringup MGMTD daemon and datastore module supportChristian Hopps
Features added in this commit: 1. Bringup/shutdown new management daemon 'mgmtd' along with FRR. 2. Support for Startup, Candidate and Running DBs. 3. Lock/Unlock DS feature using pthread lock. 4. Load config from a JSON file onto candidate DS. 5. Save config to a JSON file from running/candidate DS. 6. Dump candidate or running DS contents on the terminal or a file in JSON/XML format. 7. Maintaining commit history (Full rollback support to be added in future commits). 8. Addition of debug commands. Co-authored-by: Yash Ranjan <ranjany@vmware.com> Co-authored-by: Abhinay Ramesh <rabhinay@vmware.com> Co-authored-by: Ujwal P <ujwalp@vmware.com> Signed-off-by: Pushpasis Sarkar <pushpasis@gmail.com>