summaryrefslogtreecommitdiff
path: root/lib/mgmt_fe_client.c
AgeCommit message (Collapse)Author
2023-07-14lib: mgmtd: only clear pending for the in-progress commandChristian Hopps
The lock/unlocks are being done short-circuit so they are never pending; however, the handling of the unlock notification was always resuming the command if pending was set. In all cases pending is set for another command. For example implicit commit locks then when notified its done unlocks which was clearing the set-config pending flag and resuming that command incorrectly. Signed-off-by: Christian Hopps <chopps@labn.net>
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-19mgmtd: KISS the locking codeChristian Hopps
Move away from things like "lock if not locked" type code, require the user has locked prior to geting to that point. For now we warn if we are taking a lock we already had; however, this should really be a failure point. New requirements: SETCFG - not implicit commit - requires user has locked candidate DS and they must unlock after implicit commit - requires user has locked candidate and running DS both locks will be unlocked on reply to the SETCFG COMMITCFG - requires user has locked candidate and running DS and they must unlock after rollback - this code now get both locks and then does an unlock and early return thing on the adapter side. It needs to be un-special cased in follow up work that would also include tests for this functionality. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-18lib: mgmtd: use short-circuit for lockingChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-13lib: mgmtd: improvements in logging and commentaryChristian Hopps
- log names of datastores not numbers - improve logging for mgmt_msg_read - Rather than use a bool, instead store the pending const string name of the command being run that has postponed the CLI. This adds some nice information to the logging when enabled. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-12lib: mgmtd: session create and destroy both short-circuitChristian Hopps
For creation this is the first thing done so short-circuit just means inline sync response. However, for destroy there could be commands in-flight, these will be discarded when they match no session, and the state cleaned up immediately when the message short-circuits. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-06-04lib: mgmtd: remove obfuscating abstraction layer and other cleanupChristian Hopps
Remove an obfuscating abstraction layer whose existence was entirely based on using a uintptr_t rather than a pointer to an declared-only struct. As the code is no longer using a global FE "client context", and instead create client objects, rename the structure and it's uses to reflect this. Change init "params" structure into a single use callbacks one. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-30lib: mgmtd: fixes for startup config file processingChristian 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: enable short circuit for FE client/adapter connectionChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28lib: add short-circuit operation between same processChristian Hopps
- Use a socketpair for connection, and direct (no event loop) message sending and handling. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28lib: mgmtd: add a identifying tag to the debug messageChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28lib: dont be tricky with session_id just make it a session_idChristian Hopps
- Previously was substituting a pointer to local allocated session for the session_id returned from the FE adapter. This complexity isn't needed. - Get rid of "%llu" format and the casts that came with it, instead use PRIu64 and the actual (uint64_t) type. Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28lib: msg: refactor common connection code from mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28lib: mgmt msg: add version to messagesChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-05-28lib: remove write-on-off, just requeue to the back of the queueChristian 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-03-27lib: Remove unneeded asserts in mgmt codeDonald Sharp
event_add_XXXX functions have no failure path where if you pass in a double event pointer that it could return without setting the pointer. As such these asserts make no sense and are unnecessary Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert `struct event_master` to `struct event_loop`Donald Sharp
Let's find a better name for it. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert THREAD_XXX macros to EVENT_XXX macrosDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert struct thread_master to struct event_master and it's ilkDonald Sharp
Convert the `struct thread_master` to `struct event_master` across the code base. Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Convert thread_add_XXX functions to event_add_XXXDonald Sharp
Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-24*: Rename `struct thread` to `struct event`Donald Sharp
Effectively a massive search and replace of `struct thread` to `struct event`. Using the term `thread` gives people the thought that this event system is a pthread when it is not Signed-off-by: Donald Sharp <sharpd@nvidia.com>
2023-03-22lib: mgmtd: fix build warnings (as error)dev/mgmtdChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
2023-03-22mgmtd: lib: utilize msglib constructed from the removed codeChristian Hopps
Signed-off-by: Christian Hopps <chopps@labn.net>
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>