diff options
| author | Christian Hopps <chopps@labn.net> | 2024-01-21 13:12:39 +0000 | 
|---|---|---|
| committer | Christian Hopps <chopps@labn.net> | 2024-01-22 11:32:29 +0000 | 
| commit | eba64f79cc9090a1a706291442dc02597e359cac (patch) | |
| tree | ce1496abb764e47efaca16071a8e794aeb297b98 /lib/distribute.h | |
| parent | dc8f1360641596bf7e88f983fbeaafed332d88cf (diff) | |
lib: add northbound support to distribute-list code.
Signed-off-by: Christian Hopps <chopps@labn.net>
Diffstat (limited to 'lib/distribute.h')
| -rw-r--r-- | lib/distribute.h | 31 | 
1 files changed, 31 insertions, 0 deletions
diff --git a/lib/distribute.h b/lib/distribute.h index 75783712a1..6fe890c045 100644 --- a/lib/distribute.h +++ b/lib/distribute.h @@ -9,6 +9,7 @@  #include <zebra.h>  #include "if.h"  #include "filter.h" +#include "northbound.h"  #ifdef __cplusplus  extern "C" { @@ -74,6 +75,36 @@ extern int distribute_list_parser(bool prefix, bool v4, const char *dir,  extern int distribute_list_no_parser(struct vty *vty, bool prefix, bool v4,  				     const char *dir, const char *list,  				     const char *ifname); + +/* + * Northbound + */ + +/* + * Define your own create callback and then call thes helper with your + * distribute list context when a list entry is created. Additionally, plug the + * destroy callback into the frr_module_yang_info struct, or call it if you have + * your own callback destroy function. + */ +extern int group_distribute_list_create_helper(struct nb_cb_create_args *args, +					       struct distribute_ctx *ctx); +extern int group_distribute_list_destroy(struct nb_cb_destroy_args *args); + +/* + * Plug 3 of these handlers in for your distribute-list for all the northbound + * distribute_list leaf callbacks. If you need multi-protocol then use the + * grouping twice under 2 different containers. + */ +extern int group_distribute_list_ipv4_modify(struct nb_cb_modify_args *args); +extern int group_distribute_list_ipv4_destroy(struct nb_cb_destroy_args *args); +extern void group_distribute_list_ipv4_cli_show(struct vty *vty, +						const struct lyd_node *dnode, +						bool show_defaults); +extern int group_distribute_list_ipv6_modify(struct nb_cb_modify_args *args); +extern int group_distribute_list_ipv6_destroy(struct nb_cb_destroy_args *args); +extern void group_distribute_list_ipv6_cli_show(struct vty *vty, +						const struct lyd_node *dnode, +						bool show_defaults);  #ifdef __cplusplus  }  #endif  | 
