summaryrefslogtreecommitdiff
path: root/mgmtd/mgmt_vty.c
AgeCommit message (Collapse)Author
2024-08-27lib: common debug status outputIgor Ryzhov
Implement common code for debug status output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-08-27lib: common debug config outputIgor Ryzhov
Implement common code for debug config output and remove daemon-specific code that is duplicated everywhere. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-04-22lib: add native RPC processing to mgmt frontend clientIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-26mgmtd: add support for native 'edit' operationIgor Ryzhov
This operation basically implements support for RESTCONF operations. It receives an xpath and a data tree in JSON/XML format, instead of a list of (xpath, value) tuples as required by the current protobuf interface. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-03-08Merge pull request #15469 from LabNConsulting/chopps/keychain-yangDonald Sharp
add ietf-key-chain YANG module support
2024-03-04lib: add keychain northbound supportChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-03-01mgmtd: fix warning if ripngd disabledVincent JARDIN
./configure [...] --disable-ripngd could lead to: mgmtd/mgmt_vty.c:614:5: warning: "HAVE_RIPNGD" is not defined, evaluates to 0 [-Wundef] 614 | #if HAVE_RIPNGD | ^~~~~~~~~~~ Signed-off-by: Vincent Jardin <vjardin@free.fr>
2024-01-31mgmtd: add ability to choose datastore to get data fromIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-31mgmtd: add support for with-defaults parameter to get-dataIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28zebra: convert to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-28lib: convert affinity-map to mgmtdIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-26ripngd: convert ripngd to mgmtdChristian Hopps
- a couple small fixes for ripd conversion as well. Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26ripd: ripd convert to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26lib: convert filters to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-26lib: convert route-map to mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2024-01-15lib, mgmtd: add ability to request the exact node in get-data requestIgor Ryzhov
RESTCONF expects to receive the exact node as a result, not the whole data tree. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-15lib, mgmtd: add ability to set content type in get-data requestIgor Ryzhov
Like in RESTCONF GET request and NETCONF get-data request, make it possible to request state-only, config-only, or all data. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-14lib, mgmtd: add separate get-data request for the frontendIgor Ryzhov
Currently it's the same as get-tree request for the backend, but it is going to be expanded in the following commits. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmt, lib: implement REPLACE operationIgor Ryzhov
Replace operation removes the current data node configuration and sets the provided value. As current northbound code works only with one xpath at a time, the operation only makes sense to clear the config of a container without deleting it itself. However, the next step is to allow passing JSON-encoded complex values to northbound operations which will make replace operation much more useful. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmt, lib: differentiate DELETE and REMOVE operationsIgor Ryzhov
Currently, there's a single operation type which doesn't return error if the object doesn't exists. To be compatible with NETCONF/RESTCONF, we should support differentiate between DELETE (fails when object doesn't exist) and REMOVE (doesn't fail if the object doesn't exist). Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2024-01-11mgmtd, lib: implement CREATE_EXCL operationIgor Ryzhov
Currently, there's no difference between CREATE and MODIFY operations. To be compatible with NETCONF/RESTCONF, add new CREATE_EXCL operation that throws an error if the configuration data already exists. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-12-28mgmtd: step 6: remove old unfinished get-data codeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-28lib: step 1: mgmtd: add FE get-tree functionalityChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-12-05mgmtd: enable conn debug when user enables mgmtd debugsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-21mgmtd: add node for writing configurationIgor Ryzhov
Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-11-13Merge pull request #14768 from idryzhov/mgmtd-base-xpathDonald Sharp
lib, mgmtd: respect base xpath in mgmtd
2023-11-12lib, mgmtd: respect base xpath in mgmtdIgor Ryzhov
`nb_cli_apply_changes` can be called with base xpath which should be prepended to xpaths of every change in a transaction. This base xpath is respected by regular northbound CLI but not by mgmtd. This commit fixes the problem. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-11-11lib: mgmtd: fix debug cli commands and memleaksChristian Hopps
- Cannot have 2 cmd_node's with same .node number. Install the mgmtd client library debug nodes (client frontend and client backend) using new unique node numbers. Fixes memleaks. - Fix "debug mgmt client backend" to generate correct config (and not for frontend). Signed-off-by: Christian Hopps <chopps@labn.net>
2023-11-06mgmtd: simplify xpath registriesChristian Hopps
- move from client id indexed array of uints for register info per client to a u64 bitmask. - add bit walking FOREACH macro Walk the client IDs whose bits are set in a mask. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-10-12mgmtd: clarify the startup dance in commentsChristian Hopps
Also retry the config read vs. aborting if we haven't got a FE client connection yet. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-09-27mgmtd: fix crash on "show mgmtd datastore-contents"Igor Ryzhov
When the command is called without specifying the datastore, it crashes. Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
2023-06-27mgmtd: consolidate getcfg and getdata msgs into "get"Christian Hopps
eliminates tons of copy and paste code. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-12lib: mgmtd: simplify implicit commit codeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30mgmtd: fix possible race btw read config and backend connectionChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30mgmtd: fix reading of config file[s]Christian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28lib: mgmtd: add server-side connection code to mgmt_msgChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-01mgmtd: fully implement debug flags for mgmtd and clientsChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-04-05mgmtd: Fixing style warningsrgirada
Description: Fixing the style warnings in the mgmtd code. Signed-off-by: Rajesh Girada <rgirada@vmware.com>
2023-04-04Merge pull request #13131 from LabNConsulting/chopps/no-startup-fileJafar Al-Gharaibeh
mgmtd: remove startup config feature for now
2023-04-01mgmtd: lib: read transitioned daemons split config files in mgmtdChristian Hopps
When daemons transition to mgmtd they should stop reading their split config files, and let mgmtd do that, otherwise things can get out of sync. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-31mgmtd: Fix for issue 13154.Manoj Naragund
The changes involve adding show debuggin command for MGMTd which resolves command incomplete issue. issue #13154 Signed-off-by: Manoj Naragund <mnaragund@vmware.com>
2023-03-21mgmtd: Enroll Staticd as a backend client for MGMTDChristian Hopps
This commmit introduces Staticd as a backend client for the MGMTd framework. All the static commands will be diverted to the MGMT daemon and will use the transactional model to make changes to the internal state. Similar mechanism can be used by other daemons to use the MGMT framework in the future. This commit includes the following functionalities in the changeset: 1. Diverts all the staticd (config only) commands to MGMTd. 2. Enrolls staticd as a backend client to use the MGMT framework. 3. Modify the staticd NB config handlers so that they can be compiled into a library and loaded in the MGMTd process context. 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 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 Backend Interface FrameworkChristian Hopps
This commit introduces the MGMT Backend Interface which can be used by back-end management client daemons like BGPd, Staticd, Zebra to connect with new FRR Management daemon (MGMTd) and utilize the new FRR Management Framework to let any Frontend clients to retrieve any operational data or manipulate any configuration data owned by the individual Backend daemon component. This commit includes the following functionalities in the changeset: 1. Add new Backend server for Backend daemons connect to. 2. Add a C-based Backend client library which can be used by daemons to communicate with MGMTd via the Backend interface. 3. Maintain a backend adapter for each connection from an appropriate Backend client to facilitate client requests and track one or more transactions initiated from Frontend client sessions that involves the backend client component. 4. Add the following commands to inspect various Backend client related information a. show mgmt backend-adapter all b. show mgmt backend-yang-xpath-registry c. show mgmt yang-xpath-subscription 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>