static vector babel_enable_if; /* enable interfaces (by cmd). */
-static int interface_config_write(struct vty *vty);
-static struct cmd_node babel_interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = interface_config_write,
-};
-
int
babel_interface_up (ZAPI_CALLBACK_ARGS)
babel_enable_if = vector_init (1);
/* install interface node and commands */
- install_node(&babel_interface_node);
- if_cmd_init();
+ if_cmd_init(interface_config_write);
install_element(BABEL_NODE, &babel_network_cmd);
install_element(BABEL_NODE, &no_babel_network_cmd);
return written;
}
-static int eigrp_write_interface(struct vty *vty);
-static struct cmd_node eigrp_interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = eigrp_write_interface,
-};
-
-
static int eigrp_write_interface(struct vty *vty)
{
struct lyd_node *dnode;
vrf_cmd_init(NULL, &eigrpd_privs);
- install_node(&eigrp_interface_node);
- if_cmd_init();
+ if_cmd_init(eigrp_write_interface);
install_element(INTERFACE_NODE, &eigrp_if_delay_cmd);
install_element(INTERFACE_NODE, &no_eigrp_if_delay_cmd);
passwd);
}
-struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = isis_interface_config_write,
-};
-
void isis_circuit_circ_type_set(struct isis_circuit *circuit, int circ_type)
{
if (circuit->circ_type == circ_type)
hook_register_prio(if_del, 0, isis_if_delete_hook);
/* Install interface node */
- install_node(&interface_node);
- if_cmd_init();
+ if_cmd_init(isis_interface_config_write);
if_zapi_callbacks(isis_ifp_create, isis_ifp_up,
isis_ifp_down, isis_ifp_destroy);
}
{.tokenname = "INTERFACE", .completions = if_autocomplete},
{.completions = NULL}};
-void if_cmd_init(void)
+static struct cmd_node interface_node = {
+ .name = "interface",
+ .node = INTERFACE_NODE,
+ .parent_node = CONFIG_NODE,
+ .prompt = "%s(config-if)# ",
+};
+
+void if_cmd_init(int (*config_write)(struct vty *))
{
cmd_variable_handler_register(if_var_handlers);
+ interface_node.config_write = config_write;
+ install_node(&interface_node);
+
install_element(CONFIG_NODE, &interface_cmd);
install_element(CONFIG_NODE, &no_interface_cmd);
void if_link_params_free(struct interface *);
/* Northbound. */
-extern void if_cmd_init(void);
+struct vty;
+extern void if_cmd_init(int (*config_write)(struct vty *));
extern void if_zapi_callbacks(int (*create)(struct interface *ifp),
int (*up)(struct interface *ifp),
int (*down)(struct interface *ifp),
.config_write = nhrp_config_write,
};
-static int interface_config_write(struct vty *vty);
-static struct cmd_node nhrp_interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = interface_config_write,
-};
-
#define NHRP_DEBUG_FLAGS_CMD "<all|common|event|interface|kernel|route|vici>"
#define NHRP_DEBUG_FLAGS_STR \
vrf_cmd_init(NULL, &nhrpd_privs);
/* interface specific commands */
- install_node(&nhrp_interface_node);
-
- if_cmd_init();
+ if_cmd_init(interface_config_write);
install_element(INTERFACE_NODE, &tunnel_protection_cmd);
install_element(INTERFACE_NODE, &no_tunnel_protection_cmd);
install_element(INTERFACE_NODE, &tunnel_source_cmd);
return write;
}
-static int config_write_ospf6_interface(struct vty *vty, struct vrf *vrf);
-static struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = config_write_interface,
-};
-
static int ospf6_ifp_create(struct interface *ifp)
{
if (IS_OSPF6_DEBUG_ZEBRA(RECV))
void ospf6_interface_init(void)
{
/* Install interface node. */
- install_node(&interface_node);
- if_cmd_init();
+ if_cmd_init(config_write_interface);
if_zapi_callbacks(ospf6_ifp_create, ospf6_ifp_up,
ospf6_ifp_down, ospf6_ifp_destroy);
install_element(VIEW_NODE, &show_ip_ospf_external_aggregator_cmd);
}
-static int config_write_interface(struct vty *vty);
-/* ospfd's interface node. */
-static struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = config_write_interface,
-};
-
/* Initialization of OSPF interface. */
static void ospf_vty_if_init(void)
{
/* Install interface node. */
- install_node(&interface_node);
- if_cmd_init();
+ if_cmd_init(config_write_interface);
/* "ip ospf authentication" commands. */
install_element(INTERFACE_NODE, &ip_ospf_authentication_args_addr_cmd);
/* ------------------------------------------------------------------------- */
-static int pbr_interface_config_write(struct vty *vty);
-static struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = pbr_interface_config_write,
-};
-
static int pbr_interface_config_write(struct vty *vty)
{
struct interface *ifp;
vrf_cmd_init(NULL, &pbr_privs);
- install_node(&interface_node);
- if_cmd_init();
+ if_cmd_init(pbr_interface_config_write);
install_node(&pbr_map_node);
#include "pimd/pim_cmd_clippy.c"
#endif
-static struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = pim_interface_config_write,
-};
-
static struct cmd_node debug_node = {
.name = "debug",
.node = DEBUG_NODE,
void pim_cmd_init(void)
{
- install_node(&interface_node); /* INTERFACE_NODE */
- if_cmd_init();
+ if_cmd_init(pim_interface_config_write);
install_node(&debug_node);
return 0;
}
-static int rip_interface_config_write(struct vty *vty);
-static struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = rip_interface_config_write,
-};
-
void rip_interface_sync(struct interface *ifp)
{
struct vrf *vrf;
hook_register_prio(if_del, 0, rip_interface_delete_hook);
/* Install interface node. */
- install_node(&interface_node);
- if_cmd_init();
+ if_cmd_init(rip_interface_config_write);
if_zapi_callbacks(rip_ifp_create, rip_ifp_up,
rip_ifp_down, rip_ifp_destroy);
}
return write;
}
-static int interface_config_write(struct vty *vty);
-/* ripngd's interface node. */
-static struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = interface_config_write,
-};
-
/* Initialization of interface. */
void ripng_if_init(void)
{
hook_register_prio(if_del, 0, ripng_if_delete_hook);
/* Install interface node. */
- install_node(&interface_node);
- if_cmd_init();
+ if_cmd_init(interface_config_write);
if_zapi_callbacks(ripng_ifp_create, ripng_ifp_up,
ripng_ifp_down, ripng_ifp_destroy);
}
return write;
}
-static struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = vrrp_config_write_interface,
-};
-
static struct cmd_node debug_node = {
.name = "debug",
.node = DEBUG_NODE,
void vrrp_vty_init(void)
{
install_node(&debug_node);
- install_node(&interface_node);
install_node(&vrrp_node);
vrf_cmd_init(NULL, &vrrp_privs);
- if_cmd_init();
+ if_cmd_init(vrrp_config_write_interface);
install_element(VIEW_NODE, &vrrp_vrid_show_cmd);
install_element(VIEW_NODE, &vrrp_vrid_show_summary_cmd);
#endif /* HAVE_NET_RT_IFLIST */
}
-static int if_config_write(struct vty *vty);
-struct cmd_node interface_node = {
- .name = "interface",
- .node = INTERFACE_NODE,
- .parent_node = CONFIG_NODE,
- .prompt = "%s(config-if)# ",
- .config_write = if_config_write,
-};
-
#ifndef VTYSH_EXTRACT_PL
#include "zebra/interface_clippy.c"
#endif
hook_register_prio(if_del, 0, if_zebra_delete_hook);
/* Install configuration write function. */
- install_node(&interface_node);
+ if_cmd_init(if_config_write);
install_node(&link_params_node);
- if_cmd_init();
/*
* This is *intentionally* setting this to NULL, signaling
* that interface creation for zebra acts differently