diff options
author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-09-18 22:20:04 +0200 |
---|---|---|
committer | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-09-19 19:34:06 +0200 |
commit | 138c5a745018a291c8463b67dba7602886859d2e (patch) | |
tree | 58e5fa805122bfb110bc347db2d263c9ef1a5920 /pbrd | |
parent | lib, zebra: Allow for interface deletion when kernel event happens (diff) | |
download | frr-138c5a745018a291c8463b67dba7602886859d2e.tar.xz frr-138c5a745018a291c8463b67dba7602886859d2e.zip |
*: 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 'pbrd')
-rw-r--r-- | pbrd/pbr_main.c | 2 | ||||
-rw-r--r-- | pbrd/pbr_zebra.c | 20 | ||||
-rw-r--r-- | pbrd/pbr_zebra.h | 6 |
3 files changed, 28 insertions, 0 deletions
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 |