install_element(BABEL_NODE, &babel_ipv6_distribute_list_cmd);
install_element(BABEL_NODE, &babel_no_ipv6_distribute_list_cmd);
+ vrf_cmd_init(NULL, &babeld_privs);
+
babel_if_init();
/* Access list install. */
install_element(EIGRP_NODE, &eigrp_neighbor_cmd);
install_element(EIGRP_NODE, &eigrp_redistribute_source_metric_cmd);
+ vrf_cmd_init(NULL, &eigrpd_privs);
+
install_node(&eigrp_interface_node);
if_cmd_init();
{
vrf_init(isis_vrf_new, isis_vrf_enable, isis_vrf_disable,
isis_vrf_delete, isis_vrf_enable);
+
+ vrf_cmd_init(NULL, &isisd_privs);
}
void isis_terminate()
return CMD_WARNING_CONFIG_FAILED;
}
+ if (vrf_get_backend() == VRF_BACKEND_VRF_LITE) {
+ /*
+ * Remove the VRF interface config. Currently, we allow to
+ * remove only inactive VRFs, so we use VRF_DEFAULT_NAME here,
+ * because when the VRF is removed from kernel, the interface
+ * is moved to the default VRF. If we ever allow removing
+ * active VRFs, this code have to be updated accordingly.
+ */
+ snprintf(xpath_list, sizeof(xpath_list),
+ "/frr-interface:lib/interface[name='%s'][vrf='%s']",
+ vrfname, VRF_DEFAULT_NAME);
+ nb_cli_enqueue_change(vty, xpath_list, NB_OP_DESTROY, NULL);
+ }
+
snprintf(xpath_list, sizeof(xpath_list), FRR_VRF_KEY_XPATH, vrfname);
nb_cli_enqueue_change(vty, xpath_list, NB_OP_DESTROY, NULL);
- return nb_cli_apply_changes(vty, xpath_list);
+ return nb_cli_apply_changes(vty, NULL);
}
static const struct frr_yang_module_info *const nhrpd_yang_modules[] = {
&frr_filter_info,
&frr_interface_info,
+ &frr_vrf_info,
};
FRR_DAEMON_INFO(nhrpd, NHRP, .vty_port = NHRP_VTY_PORT,
install_element(CONFIG_NODE, &nhrp_multicast_nflog_group_cmd);
install_element(CONFIG_NODE, &no_nhrp_multicast_nflog_group_cmd);
+ vrf_cmd_init(NULL, &nhrpd_privs);
+
/* interface specific commands */
install_node(&nhrp_interface_node);
{
vrf_init(ospf6_vrf_new, ospf6_vrf_enable, ospf6_vrf_disable,
ospf6_vrf_delete, ospf6_vrf_enable);
+
+ vrf_cmd_init(NULL, &ospf6d_privs);
}
static void ospf6_top_lsdb_hook_add(struct ospf6_lsa *lsa)
install_element(OSPF_NODE, &ospf_max_multipath_cmd);
install_element(OSPF_NODE, &no_ospf_max_multipath_cmd);
+ vrf_cmd_init(NULL, &ospfd_privs);
+
/* Init interface related vty commands. */
ospf_vty_if_init();
static const struct frr_yang_module_info *const pbrd_yang_modules[] = {
&frr_filter_info,
&frr_interface_info,
+ &frr_vrf_info,
};
FRR_DAEMON_INFO(pbrd, PBR, .vty_port = PBR_VTY_PORT,
}
};
+extern struct zebra_privs_t pbr_privs;
+
void pbr_vty_init(void)
{
cmd_variable_handler_register(pbr_map_name);
+ vrf_cmd_init(NULL, &pbr_privs);
+
install_node(&interface_node);
if_cmd_init();
{
vrf_init(rip_vrf_new, rip_vrf_enable, rip_vrf_disable, rip_vrf_delete,
rip_vrf_enable);
+
+ vrf_cmd_init(NULL, &ripd_privs);
}
void rip_vrf_terminate(void)
{
vrf_init(ripng_vrf_new, ripng_vrf_enable, ripng_vrf_disable,
ripng_vrf_delete, ripng_vrf_enable);
+
+ vrf_cmd_init(NULL, &ripngd_privs);
}
void ripng_vrf_terminate(void)
install_node(&debug_node);
install_node(&interface_node);
install_node(&vrrp_node);
+ vrf_cmd_init(NULL, &vrrp_privs);
if_cmd_init();
install_element(VIEW_NODE, &vrrp_vrid_show_cmd);
#define VTYSH_ACL VTYSH_BFDD|VTYSH_BABELD|VTYSH_BGPD|VTYSH_EIGRPD|VTYSH_ISISD|VTYSH_FABRICD|VTYSH_LDPD|VTYSH_NHRPD|VTYSH_OSPF6D|VTYSH_OSPFD|VTYSH_PBRD|VTYSH_PIMD|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_VRRPD|VTYSH_ZEBRA
#define VTYSH_RMAP VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ISISD|VTYSH_PIMD|VTYSH_EIGRPD|VTYSH_FABRICD
#define VTYSH_INTERFACE VTYSH_ZEBRA|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_ISISD|VTYSH_PIMD|VTYSH_NHRPD|VTYSH_EIGRPD|VTYSH_BABELD|VTYSH_PBRD|VTYSH_FABRICD|VTYSH_VRRPD
-#define VTYSH_VRF VTYSH_ZEBRA|VTYSH_PIMD|VTYSH_STATICD
+#define VTYSH_VRF VTYSH_INTERFACE|VTYSH_STATICD
#define VTYSH_KEYS VTYSH_RIPD|VTYSH_EIGRPD
/* Daemons who can process nexthop-group configs */
#define VTYSH_NH_GROUP VTYSH_PBRD|VTYSH_SHARPD