summaryrefslogtreecommitdiff
path: root/eigrpd
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-09-18 16:20:04 -0400
committerDonald Sharp <sharpd@cumulusnetworks.com>2019-09-19 13:34:06 -0400
commit138c5a745018a291c8463b67dba7602886859d2e (patch)
tree58e5fa805122bfb110bc347db2d263c9ef1a5920 /eigrpd
parent1d311a05c97d6b7b6c893aafa86db150a7397887 (diff)
*: Add infrastructure to support zapi interface callbacks
Start the conversion to allow zapi interface callbacks to be controlled like vrf creation/destruction/change callbacks. This will allow us to consolidate control into the interface.c instead of having each daemon read the stream and react accordingly. This will hopefully reduce a bunch of cut-n-paste stuff Create 4 new callback functions that will be controlled by lib/if.c create -> A upper level protocol receives an interface creation event The ifp is brand spanking newly created in the system. up -> A upper level protocol receives a interface up event This means the interface is up and ready to go. down -> A upper level protocol receives a interface down destroy -> A upper level protocol receives a destroy event This means to delete the pointers associated with it. At this point this is just boilerplate setup for future commits. There is no new functionality. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd')
-rw-r--r--eigrpd/eigrp_interface.c22
-rw-r--r--eigrpd/eigrp_interface.h1
2 files changed, 22 insertions, 1 deletions
diff --git a/eigrpd/eigrp_interface.c b/eigrpd/eigrp_interface.c
index fd1d3f5cb9..76e101b010 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 a18b0b7015..1e66dafde2 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_ */