diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-09-18 16:20:04 -0400 | 
|---|---|---|
| committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-09-19 13:34:06 -0400 | 
| commit | 138c5a745018a291c8463b67dba7602886859d2e (patch) | |
| tree | 58e5fa805122bfb110bc347db2d263c9ef1a5920 /bfdd/ptm_adapter.c | |
| parent | 1d311a05c97d6b7b6c893aafa86db150a7397887 (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 'bfdd/ptm_adapter.c')
| -rw-r--r-- | bfdd/ptm_adapter.c | 11 | 
1 files changed, 11 insertions, 0 deletions
diff --git a/bfdd/ptm_adapter.c b/bfdd/ptm_adapter.c index ae6d04e77d..2d1b17ce4a 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);  | 
