return CMD_SUCCESS;
}
+int babel_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+int babel_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+int babel_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+int babel_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void
babel_if_init(void)
{
int babel_interface_address_add (int, struct zclient *, zebra_size_t, vrf_id_t);
int babel_interface_address_delete (int, struct zclient *, zebra_size_t, vrf_id_t);
+int babel_ifp_create(struct interface *ifp);
+int babel_ifp_up(struct interface *ifp);
+int babel_ifp_down(struct interface *ifp);
+int babel_ifp_destroy(struct interface *ifp);
+
unsigned jitter(babel_interface_nfo *, int);
unsigned update_jitter(babel_interface_nfo *babel_ifp, int urgent);
/* return "true" if "address" is one of our ipv6 addresses */
babel_replace_by_null(STDIN_FILENO);
/* init some quagga's dependencies, and babeld's commands */
+ if_zapi_callbacks(babel_ifp_create, babel_ifp_up,
+ babel_ifp_down, babel_ifp_destroy);
babeld_quagga_init();
/* init zebra client's structure and it's commands */
/* this replace kernel_setup && kernel_setup_socket */
return 0;
}
+static int bfd_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int bfd_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void bfdd_zclient_init(struct zebra_privs_t *bfdd_priv)
{
+ if_zapi_callbacks(bfd_ifp_create, NULL, NULL, bfd_ifp_destroy);
zclient = zclient_new(master, &zclient_options_default);
assert(zclient != NULL);
zclient_init(zclient, ZEBRA_ROUTE_BFD, 0, bfdd_priv);
extern struct zebra_privs_t bgpd_privs;
+static int bgp_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int bgp_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int bgp_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int bgp_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void bgp_zebra_init(struct thread_master *master, unsigned short instance)
{
zclient_num_connects = 0;
+ if_zapi_callbacks(bgp_ifp_create, bgp_ifp_up,
+ bgp_ifp_down, bgp_ifp_destroy);
+
/* Set default values. */
zclient = zclient_new(master, &zclient_options_default);
zclient_init(zclient, ZEBRA_ROUTE_BGP, 0, &bgpd_privs);
return 0;
}
+static int eigrp_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int eigrp_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int eigrp_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int eigrp_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
struct list *eigrp_iflist;
void eigrp_if_init(void)
{
+ if_zapi_callbacks(eigrp_ifp_create, eigrp_ifp_up,
+ eigrp_ifp_down, eigrp_ifp_destroy);
/* Initialize Zebra interface data structure. */
// hook_register_prio(if_add, 0, eigrp_if_new);
hook_register_prio(if_del, 0, eigrp_if_delete_hook);
extern uint32_t eigrp_delay_to_scaled(uint32_t);
extern uint32_t eigrp_scaled_to_delay(uint32_t);
-
#endif /* ZEBRA_EIGRP_INTERFACE_H_ */
return 0;
}
+static int isis_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int isis_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int isis_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int isis_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void isis_circuit_init(void)
{
/* Initialize Zebra interface data structure */
/* Install interface node */
install_node(&interface_node, isis_interface_config_write);
if_cmd_init();
+ if_zapi_callbacks(isis_ifp_create, isis_ifp_up,
+ isis_ifp_down, isis_ifp_destroy);
}
extern struct zebra_privs_t ldpd_privs;
+static int ldp_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ldp_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ldp_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ldp_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void
ldp_zebra_init(struct thread_master *master)
{
+ if_zapi_callbacks(ldp_ifp_create, ldp_ifp_up,
+ ldp_ifp_down, ldp_ifp_destroy);
+
/* Set default values. */
zclient = zclient_new(master, &zclient_options_default);
zclient_init(zclient, ZEBRA_ROUTE_LDP, 0, &ldpd_privs);
DEFINE_HOOK(if_add, (struct interface * ifp), (ifp))
DEFINE_KOOH(if_del, (struct interface * ifp), (ifp))
+struct interface_master{
+ int (*create_hook)(struct interface *ifp);
+ int (*up_hook)(struct interface *ifp);
+ int (*down_hook)(struct interface *ifp);
+ int (*destroy_hook)(struct interface *ifp);
+} ifp_master = { 0, };
+
/* Compare interface names, returning an integer greater than, equal to, or
* less than 0, (following the strcmp convention), according to the
* relationship between ifp1 and ifp2. Interface names consist of an
install_element(INTERFACE_NODE, &no_interface_desc_cmd);
}
+void if_zapi_callbacks(int (*create)(struct interface *ifp),
+ int (*up)(struct interface *ifp),
+ int (*down)(struct interface *ifp),
+ int (*destroy)(struct interface *ifp))
+{
+ ifp_master.create_hook = create;
+ ifp_master.up_hook = up;
+ ifp_master.down_hook = down;
+ ifp_master.destroy_hook = destroy;
+}
+
/* ------- Northbound callbacks ------- */
/*
/* Northbound. */
extern void if_cmd_init(void);
+extern void if_zapi_callbacks(int (*create)(struct interface *ifp),
+ int (*up)(struct interface *ifp),
+ int (*down)(struct interface *ifp),
+ int (*destroy)(struct interface *ifp));
+
extern const struct frr_yang_module_info frr_interface_info;
#ifdef __cplusplus
nhrp_interface_update_nbma(ifp);
}
+
+int nhrp_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+int nhrp_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+int nhrp_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+int nhrp_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
nhrp_vc_init();
nhrp_packet_init();
vici_init();
+ if_zapi_callbacks(nhrp_ifp_create, nhrp_ifp_up,
+ nhrp_ifp_down, nhrp_ifp_destroy);
nhrp_zebra_init();
nhrp_shortcut_init();
void nhrp_interface_set_protection(struct interface *ifp, const char *profile,
const char *fallback_profile);
void nhrp_interface_set_source(struct interface *ifp, const char *ifname);
+extern int nhrp_ifp_create(struct interface *ifp);
+extern int nhrp_ifp_up(struct interface *ifp);
+extern int nhrp_ifp_down(struct interface *ifp);
+extern int nhrp_ifp_destroy(struct interface *ifp);
int nhrp_nhs_add(struct interface *ifp, afi_t afi, union sockunion *proto_addr,
const char *nbma_fqdn);
INTERFACE_NODE, "%s(config-if)# ", 1 /* VTYSH */
};
+static int ospf6_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ospf6_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ospf6_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ospf6_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void ospf6_interface_init(void)
{
/* Install interface node. */
install_node(&interface_node, config_write_ospf6_interface);
if_cmd_init();
+ if_zapi_callbacks(ospf6_ifp_create, ospf6_ifp_up,
+ ospf6_ifp_down, ospf6_ifp_destroy);
install_element(VIEW_NODE, &show_ipv6_ospf6_interface_prefix_cmd);
install_element(VIEW_NODE, &show_ipv6_ospf6_interface_ifname_cmd);
return OSPF_IFTYPE_BROADCAST;
}
+static int ospf_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ospf_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ospf_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ospf_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void ospf_if_init(void)
{
+ if_zapi_callbacks(ospf_ifp_create, ospf_ifp_up,
+ ospf_ifp_down, ospf_ifp_destroy);
+
/* Initialize Zebra interface data structure. */
hook_register_prio(if_add, 0, ospf_if_new_hook);
hook_register_prio(if_del, 0, ospf_if_delete_hook);
access_list_init();
pbr_nht_init();
pbr_map_init();
+ if_zapi_callbacks(pbr_ifp_create, pbr_ifp_up,
+ pbr_ifp_down, pbr_ifp_destroy);
pbr_zebra_init();
pbr_vty_init();
zclient_send_message(zclient);
}
+
+int pbr_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+int pbr_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+int pbr_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+int pbr_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
struct pbr_map_interface *pmi, bool install);
extern struct pbr_interface *pbr_if_new(struct interface *ifp);
+
+extern int pbr_ifp_create(struct interface *ifp);
+extern int pbr_ifp_up(struct interface *ifp);
+extern int pbr_ifp_down(struct interface *ifp);
+extern int pbr_ifp_destroy(struct interface *ifp);
+
#endif
return count;
}
+
+int pim_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+int pim_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+int pim_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+int pim_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
bool pim_if_is_vrf_device(struct interface *ifp);
int pim_if_ifchannel_count(struct pim_interface *pim_ifp);
+
+extern int pim_ifp_create(struct interface *ifp);
+extern int pim_ifp_up(struct interface *ifp);
+extern int pim_ifp_down(struct interface *ifp);
+extern int pim_ifp_destroy(struct interface *ifp);
+
#endif /* PIM_IFACE_H */
/*
* Initialize zclient "update" and "lookup" sockets
*/
+ if_zapi_callbacks(pim_ifp_create, pim_ifp_up,
+ pim_ifp_down, pim_ifp_destroy);
pim_zebra_init();
pim_bfd_init();
return 0;
}
+static int rip_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int rip_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int rip_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int rip_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
/* Allocate and initialize interface vector. */
void rip_if_init(void)
{
/* Install interface node. */
install_node(&interface_node, rip_interface_config_write);
if_cmd_init();
+ if_zapi_callbacks(rip_ifp_create, rip_ifp_up,
+ rip_ifp_down, rip_ifp_destroy);
}
INTERFACE_NODE, "%s(config-if)# ", 1 /* VTYSH */
};
+static int ripng_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ripng_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ripng_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int ripng_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
/* Initialization of interface. */
void ripng_if_init(void)
{
/* Install interface node. */
install_node(&interface_node, interface_config_write);
if_cmd_init();
+ if_zapi_callbacks(ripng_ifp_create, ripng_ifp_up,
+ ripng_ifp_down, ripng_ifp_destroy);
}
return 0;
}
+static int sharp_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int sharp_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int sharp_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int sharp_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
extern struct zebra_privs_t sharp_privs;
void sharp_zebra_init(void)
{
struct zclient_options opt = {.receive_notify = true};
+ if_zapi_callbacks(sharp_ifp_create, sharp_ifp_up,
+ sharp_ifp_down, sharp_ifp_destroy);
+
zclient = zclient_new(master, &opt);
zclient_init(zclient, ZEBRA_ROUTE_SHARP, 0, &sharp_privs);
ZEBRA_ROUTE_ADD : ZEBRA_ROUTE_DELETE,
zclient, &api);
}
+
+static int static_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+static int static_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+static int static_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+static int static_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void static_zebra_init(void)
{
struct zclient_options opt = { .receive_notify = true };
+ if_zapi_callbacks(static_ifp_create, static_ifp_up,
+ static_ifp_down, static_ifp_destroy);
+
zclient = zclient_new(master, &opt);
zclient_init(zclient, ZEBRA_ROUTE_STATIC, 0, &static_privs);
#include "vrrp.h"
#include "vrrp_debug.h"
#include "vrrp_vty.h"
+#include "vrrp_zebra.h"
#ifndef VTYSH_EXTRACT_PL
#include "vrrpd/vrrp_vty_clippy.c"
#endif
down);
}
+int vrrp_ifp_create(struct interface *ifp)
+{
+ return 0;
+}
+
+int vrrp_ifp_up(struct interface *ifp)
+{
+ return 0;
+}
+
+int vrrp_ifp_down(struct interface *ifp)
+{
+ return 0;
+}
+
+int vrrp_ifp_destroy(struct interface *ifp)
+{
+ return 0;
+}
+
void vrrp_zebra_init(void)
{
+ if_zapi_callbacks(vrrp_ifp_create, vrrp_ifp_up,
+ vrrp_ifp_down, vrrp_ifp_destroy);
+
/* Socket for receiving updates from Zebra daemon */
zclient = zclient_new(master, &zclient_options_default);
extern int vrrp_zclient_send_interface_protodown(struct interface *ifp,
bool down);
+extern int vrrp_ifp_create(struct interface *ifp);
+extern int vrrp_ifp_up(struct interface *ifp);
+extern int vrrp_ifp_down(struct interface *ifp);
+extern int vrrp_ifp_destroy(struct interface *ifp);
+
#endif /* __VRRP_ZEBRA_H__ */
install_node(&interface_node, if_config_write);
install_node(&link_params_node, NULL);
if_cmd_init();
+ /*
+ * This is *intentionally* setting this to NULL, signaling
+ * that interface creation for zebra acts differently
+ */
+ if_zapi_callbacks(NULL, NULL, NULL, NULL);
install_element(VIEW_NODE, &show_interface_cmd);
install_element(VIEW_NODE, &show_interface_vrf_all_cmd);