diff options
-rw-r--r-- | babeld/babel_interface.c | 20 | ||||
-rw-r--r-- | babeld/babel_interface.h | 5 | ||||
-rw-r--r-- | babeld/babel_main.c | 2 | ||||
-rw-r--r-- | bfdd/ptm_adapter.c | 11 | ||||
-rw-r--r-- | bgpd/bgp_zebra.c | 23 | ||||
-rw-r--r-- | eigrpd/eigrp_interface.c | 22 | ||||
-rw-r--r-- | eigrpd/eigrp_interface.h | 1 | ||||
-rw-r--r-- | isisd/isis_circuit.c | 22 | ||||
-rw-r--r-- | ldpd/ldp_zebra.c | 23 | ||||
-rw-r--r-- | lib/if.c | 18 | ||||
-rw-r--r-- | lib/if.h | 5 | ||||
-rw-r--r-- | nhrpd/nhrp_interface.c | 20 | ||||
-rw-r--r-- | nhrpd/nhrp_main.c | 2 | ||||
-rw-r--r-- | nhrpd/nhrpd.h | 4 | ||||
-rw-r--r-- | ospf6d/ospf6_interface.c | 22 | ||||
-rw-r--r-- | ospfd/ospf_interface.c | 23 | ||||
-rw-r--r-- | pbrd/pbr_main.c | 2 | ||||
-rw-r--r-- | pbrd/pbr_zebra.c | 20 | ||||
-rw-r--r-- | pbrd/pbr_zebra.h | 6 | ||||
-rw-r--r-- | pimd/pim_iface.c | 20 | ||||
-rw-r--r-- | pimd/pim_iface.h | 6 | ||||
-rw-r--r-- | pimd/pim_main.c | 2 | ||||
-rw-r--r-- | ripd/rip_interface.c | 22 | ||||
-rw-r--r-- | ripngd/ripng_interface.c | 22 | ||||
-rw-r--r-- | sharpd/sharp_zebra.c | 23 | ||||
-rw-r--r-- | staticd/static_zebra.c | 24 | ||||
-rw-r--r-- | vrrpd/vrrp_vty.c | 1 | ||||
-rw-r--r-- | vrrpd/vrrp_zebra.c | 23 | ||||
-rw-r--r-- | vrrpd/vrrp_zebra.h | 5 | ||||
-rw-r--r-- | zebra/interface.c | 5 |
30 files changed, 403 insertions, 1 deletions
diff --git a/babeld/babel_interface.c b/babeld/babel_interface.c index 0eeb9b2bb..898848f84 100644 --- a/babeld/babel_interface.c +++ b/babeld/babel_interface.c @@ -1260,6 +1260,26 @@ DEFUN (show_babel_parameters, 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) { diff --git a/babeld/babel_interface.h b/babeld/babel_interface.h index d9e274582..983382792 100644 --- a/babeld/babel_interface.h +++ b/babeld/babel_interface.h @@ -121,6 +121,11 @@ int babel_interface_delete (int, struct zclient *, zebra_size_t, vrf_id_t); 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 */ diff --git a/babeld/babel_main.c b/babeld/babel_main.c index a3f2b4e7d..4bb840815 100644 --- a/babeld/babel_main.c +++ b/babeld/babel_main.c @@ -202,6 +202,8 @@ main(int argc, char **argv) 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 */ diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index ae6d04e77..2d1b17ce4 100644 --- a/bfdd/ptm_adapter.c +++ b/bfdd/ptm_adapter.c @@ -756,8 +756,19 @@ static int bfdd_interface_address_update(ZAPI_CALLBACK_ARGS) 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); diff --git a/bgpd/bgp_zebra.c b/bgpd/bgp_zebra.c index 71f7f6d0e..ee523e51c 100644 --- a/bgpd/bgp_zebra.c +++ b/bgpd/bgp_zebra.c @@ -2721,10 +2721,33 @@ stream_failure: /* for STREAM_GETX */ 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); diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c index fd1d3f5cb..76e101b01 100644 --- a/eigrpd/eigrp_interface.c +++ b/eigrpd/eigrp_interface.c @@ -122,10 +122,32 @@ int eigrp_if_delete_hook(struct interface *ifp) 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); diff --git a/eigrpd/eigrp_interface.h b/eigrpd/eigrp_interface.h index a18b0b701..1e66dafde 100644 --- a/eigrpd/eigrp_interface.h +++ b/eigrpd/eigrp_interface.h @@ -63,5 +63,4 @@ extern uint32_t eigrp_scaled_to_bandwidth(uint32_t); extern uint32_t eigrp_delay_to_scaled(uint32_t); extern uint32_t eigrp_scaled_to_delay(uint32_t); - #endif /* ZEBRA_EIGRP_INTERFACE_H_ */ diff --git a/isisd/isis_circuit.c b/isisd/isis_circuit.c index 5da8e6ee9..64ec04705 100644 --- a/isisd/isis_circuit.c +++ b/isisd/isis_circuit.c @@ -1389,6 +1389,26 @@ int isis_if_delete_hook(struct interface *ifp) 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 */ @@ -1398,4 +1418,6 @@ void isis_circuit_init(void) /* 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); } diff --git a/ldpd/ldp_zebra.c b/ldpd/ldp_zebra.c index 884ae159b..251df7388 100644 --- a/ldpd/ldp_zebra.c +++ b/ldpd/ldp_zebra.c @@ -532,9 +532,32 @@ ldp_zebra_connected(struct zclient *zclient) 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); @@ -58,6 +58,13 @@ DEFINE_QOBJ_TYPE(interface) 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 @@ -1367,6 +1374,17 @@ void if_cmd_init(void) 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 ------- */ /* @@ -558,6 +558,11 @@ void if_link_params_free(struct interface *); /* 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 diff --git a/nhrpd/nhrp_interface.c b/nhrpd/nhrp_interface.c index 8f1ba14fe..31e19eda3 100644 --- a/nhrpd/nhrp_interface.c +++ b/nhrpd/nhrp_interface.c @@ -436,3 +436,23 @@ void nhrp_interface_set_source(struct interface *ifp, const char *ifname) 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; +} diff --git a/nhrpd/nhrp_main.c b/nhrpd/nhrp_main.c index 969638cd7..c6c83614e 100644 --- a/nhrpd/nhrp_main.c +++ b/nhrpd/nhrp_main.c @@ -152,6 +152,8 @@ int main(int argc, char **argv) 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(); diff --git a/nhrpd/nhrpd.h b/nhrpd/nhrpd.h index 670c9f4f1..50746d9ad 100644 --- a/nhrpd/nhrpd.h +++ b/nhrpd/nhrpd.h @@ -319,6 +319,10 @@ void nhrp_interface_notify_del(struct interface *ifp, struct notifier_block *n); 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); diff --git a/ospf6d/ospf6_interface.c b/ospf6d/ospf6_interface.c index 692c84ad0..50e9f80cc 100644 --- a/ospf6d/ospf6_interface.c +++ b/ospf6d/ospf6_interface.c @@ -1935,11 +1935,33 @@ static struct cmd_node interface_node = { 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); diff --git a/ospfd/ospf_interface.c b/ospfd/ospf_interface.c index 387770870..3324740d5 100644 --- a/ospfd/ospf_interface.c +++ b/ospfd/ospf_interface.c @@ -1218,8 +1218,31 @@ uint8_t ospf_default_iftype(struct interface *ifp) 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); diff --git a/pbrd/pbr_main.c b/pbrd/pbr_main.c index 246d836ac..bb92703ae 100644 --- a/pbrd/pbr_main.c +++ b/pbrd/pbr_main.c @@ -166,6 +166,8 @@ int main(int argc, char **argv, char **envp) 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(); diff --git a/pbrd/pbr_zebra.c b/pbrd/pbr_zebra.c index d74d0fcd2..b8df7fc5a 100644 --- a/pbrd/pbr_zebra.c +++ b/pbrd/pbr_zebra.c @@ -579,3 +579,23 @@ void pbr_send_pbr_map(struct pbr_map_sequence *pbrms, 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; +} diff --git a/pbrd/pbr_zebra.h b/pbrd/pbr_zebra.h index 4cbefe263..d5d938021 100644 --- a/pbrd/pbr_zebra.h +++ b/pbrd/pbr_zebra.h @@ -39,4 +39,10 @@ extern void pbr_send_pbr_map(struct pbr_map_sequence *pbrms, 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 diff --git a/pimd/pim_iface.c b/pimd/pim_iface.c index bdeda2d76..d20713b9c 100644 --- a/pimd/pim_iface.c +++ b/pimd/pim_iface.c @@ -1526,3 +1526,23 @@ int pim_if_ifchannel_count(struct pim_interface *pim_ifp) 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; +} diff --git a/pimd/pim_iface.h b/pimd/pim_iface.h index 1c11e8570..1b76b5230 100644 --- a/pimd/pim_iface.h +++ b/pimd/pim_iface.h @@ -227,4 +227,10 @@ int pim_update_source_set(struct interface *ifp, struct in_addr source); 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 */ diff --git a/pimd/pim_main.c b/pimd/pim_main.c index 5a8991c4c..6a7dbe769 100644 --- a/pimd/pim_main.c +++ b/pimd/pim_main.c @@ -127,6 +127,8 @@ int main(int argc, char **argv, char **envp) /* * 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(); diff --git a/ripd/rip_interface.c b/ripd/rip_interface.c index 80561f350..f20058a17 100644 --- a/ripd/rip_interface.c +++ b/ripd/rip_interface.c @@ -1253,6 +1253,26 @@ static int rip_interface_delete_hook(struct interface *ifp) 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) { @@ -1263,4 +1283,6 @@ 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); } diff --git a/ripngd/ripng_interface.c b/ripngd/ripng_interface.c index 9ed9dc28f..02c35e04c 100644 --- a/ripngd/ripng_interface.c +++ b/ripngd/ripng_interface.c @@ -989,6 +989,26 @@ static struct cmd_node interface_node = { 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) { @@ -999,4 +1019,6 @@ 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); } diff --git a/sharpd/sharp_zebra.c b/sharpd/sharp_zebra.c index 6263f429e..6e3478555 100644 --- a/sharpd/sharp_zebra.c +++ b/sharpd/sharp_zebra.c @@ -392,12 +392,35 @@ static int sharp_nexthop_update(ZAPI_CALLBACK_ARGS) 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); diff --git a/staticd/static_zebra.c b/staticd/static_zebra.c index 1965c2968..c18cbed6b 100644 --- a/staticd/static_zebra.c +++ b/staticd/static_zebra.c @@ -504,10 +504,34 @@ extern void static_zebra_route_add(struct route_node *rn, 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); diff --git a/vrrpd/vrrp_vty.c b/vrrpd/vrrp_vty.c index 2dc3d3f8a..f71b34314 100644 --- a/vrrpd/vrrp_vty.c +++ b/vrrpd/vrrp_vty.c @@ -30,6 +30,7 @@ #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 diff --git a/vrrpd/vrrp_zebra.c b/vrrpd/vrrp_zebra.c index 72b77c131..0844b9026 100644 --- a/vrrpd/vrrp_zebra.c +++ b/vrrpd/vrrp_zebra.c @@ -236,8 +236,31 @@ int vrrp_zclient_send_interface_protodown(struct interface *ifp, bool down) 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); diff --git a/vrrpd/vrrp_zebra.h b/vrrpd/vrrp_zebra.h index 84bcba23c..02d7055b8 100644 --- a/vrrpd/vrrp_zebra.h +++ b/vrrpd/vrrp_zebra.h @@ -29,4 +29,9 @@ extern void vrrp_zebra_radv_set(struct vrrp_router *r, bool enable); 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__ */ diff --git a/zebra/interface.c b/zebra/interface.c index d21ab25fe..baf94ad28 100644 --- a/zebra/interface.c +++ b/zebra/interface.c @@ -3202,6 +3202,11 @@ void zebra_if_init(void) 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); |