diff options
| author | Christian Hopps <chopps@labn.net> | 2023-03-08 17:26:38 -0500 | 
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2023-03-21 22:08:32 -0400 | 
| commit | ef43a6329b063f0fa4acc0c3d9ae3e3875b65da6 (patch) | |
| tree | 6cb59bf2bd086f0099394da337fa638dbf6b3613 /mgmtd/mgmt_main.c | |
| parent | 1c84efe4fa8585df58a9b53459f94c47934f0786 (diff) | |
mgmtd: Add MGMT Frontend Interface Framework
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>
Diffstat (limited to 'mgmtd/mgmt_main.c')
| -rw-r--r-- | mgmtd/mgmt_main.c | 39 | 
1 files changed, 19 insertions, 20 deletions
diff --git a/mgmtd/mgmt_main.c b/mgmtd/mgmt_main.c index 050367e330..f47b91df6c 100644 --- a/mgmtd/mgmt_main.c +++ b/mgmtd/mgmt_main.c @@ -97,26 +97,6 @@ static void sigusr1(void)  	zlog_rotate();  } -static struct frr_signal_t mgmt_signals[] = { -	{ -		.signal = SIGHUP, -		.handler = &sighup, -	}, -	{ -		.signal = SIGUSR1, -		.handler = &sigusr1, -	}, -	{ -		.signal = SIGINT, -		.handler = &sigint, -	}, -	{ -		.signal = SIGTERM, -		.handler = &sigint, -	}, -}; - -  /*   * Try to free up allocations we know about so that diagnostic tools such as   * valgrind are able to better illuminate leaks. @@ -140,6 +120,25 @@ static __attribute__((__noreturn__)) void mgmt_exit(int status)  	exit(status);  } +static struct frr_signal_t mgmt_signals[] = { +	{ +		.signal = SIGHUP, +		.handler = &sighup, +	}, +	{ +		.signal = SIGUSR1, +		.handler = &sigusr1, +	}, +	{ +		.signal = SIGINT, +		.handler = &sigint, +	}, +	{ +		.signal = SIGTERM, +		.handler = &sigint, +	}, +}; +  static int mgmt_vrf_new(struct vrf *vrf)  {  	zlog_debug("VRF Created: %s(%u)", vrf->name, vrf->vrf_id);  | 
