mgmtd: remove full vrf initialization

We don't really need full VRF infrastructure in mgmtd. We only need to
register vty commands.

Signed-off-by: Igor Ryzhov <iryzhov@nfware.com>
This commit is contained in:
Igor Ryzhov 2024-01-13 15:51:59 +02:00
parent 8006207a92
commit fe55bb15be

View File

@ -25,7 +25,6 @@ static const struct option longopts[] = {
{0}};
static void mgmt_exit(int);
static void mgmt_vrf_terminate(void);
/* privileges */
static zebra_capabilities_t _caps_p[] = {ZCAP_BIND, ZCAP_NET_RAW,
@ -114,8 +113,6 @@ static __attribute__((__noreturn__)) void mgmt_exit(int status)
/* stop pthreads (if any) */
frr_pthread_stop_all();
mgmt_vrf_terminate();
frr_fini();
exit(status);
}
@ -139,52 +136,6 @@ static struct frr_signal_t mgmt_signals[] = {
},
};
static int mgmt_vrf_new(struct vrf *vrf)
{
zlog_debug("VRF Created: %s(%u)", vrf->name, vrf->vrf_id);
return 0;
}
static int mgmt_vrf_delete(struct vrf *vrf)
{
zlog_debug("VRF Deletion: %s(%u)", vrf->name, vrf->vrf_id);
return 0;
}
static int mgmt_vrf_enable(struct vrf *vrf)
{
zlog_debug("VRF Enable: %s(%u)", vrf->name, vrf->vrf_id);
return 0;
}
static int mgmt_vrf_disable(struct vrf *vrf)
{
zlog_debug("VRF Disable: %s(%u)", vrf->name, vrf->vrf_id);
/* Note: This is a callback, the VRF will be deleted by the caller. */
return 0;
}
static int mgmt_vrf_config_write(struct vty *vty)
{
return 0;
}
static void mgmt_vrf_init(void)
{
vrf_init(mgmt_vrf_new, mgmt_vrf_enable, mgmt_vrf_disable,
mgmt_vrf_delete);
vrf_cmd_init(mgmt_vrf_config_write);
}
static void mgmt_vrf_terminate(void)
{
vrf_terminate();
}
#ifdef HAVE_STATICD
extern const struct frr_yang_module_info frr_staticd_info;
#endif
@ -295,8 +246,8 @@ int main(int argc, char **argv)
/* MGMTD master init. */
mgmt_master_init(frr_init(), buffer_size);
/* VRF Initializations. */
mgmt_vrf_init();
/* VRF commands initialization. */
vrf_cmd_init(NULL);
/* MGMTD related initialization. */
mgmt_init();