mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-02 18:52:04 +00:00
lib: convert filters to mgmtd
Signed-off-by: Christian Hopps <chopps@labn.net>
This commit is contained in:
parent
dabc92de9e
commit
63ca751c11
12
lib/filter.c
12
lib/filter.c
@ -885,7 +885,7 @@ static void access_list_init_ipv6(void)
|
||||
install_element(ENABLE_NODE, &show_ipv6_access_list_name_cmd);
|
||||
}
|
||||
|
||||
void access_list_init(void)
|
||||
void access_list_init_new(bool in_backend)
|
||||
{
|
||||
cmd_variable_handler_register(access_list_handlers);
|
||||
|
||||
@ -893,7 +893,15 @@ void access_list_init(void)
|
||||
access_list_init_ipv6();
|
||||
access_list_init_mac();
|
||||
|
||||
filter_cli_init();
|
||||
if (!in_backend) {
|
||||
/* we do not want to handle config commands in the backend */
|
||||
filter_cli_init();
|
||||
}
|
||||
}
|
||||
|
||||
void access_list_init(void)
|
||||
{
|
||||
access_list_init_new(false);
|
||||
}
|
||||
|
||||
void access_list_reset(void)
|
||||
|
@ -114,6 +114,7 @@ struct access_master {
|
||||
|
||||
/* Prototypes for access-list. */
|
||||
extern void access_list_init(void);
|
||||
extern void access_list_init_new(bool in_backend);
|
||||
extern void access_list_reset(void);
|
||||
extern void access_list_add_hook(void (*func)(struct access_list *));
|
||||
extern void access_list_delete_hook(void (*func)(struct access_list *));
|
||||
@ -124,13 +125,13 @@ extern enum filter_type access_list_apply(struct access_list *access,
|
||||
struct access_list *access_list_get(afi_t afi, const char *name);
|
||||
void access_list_delete(struct access_list *access);
|
||||
struct filter *filter_new(void);
|
||||
void access_list_filter_add(struct access_list *access,
|
||||
struct filter *filter);
|
||||
void access_list_filter_add(struct access_list *access, struct filter *filter);
|
||||
void access_list_filter_delete(struct access_list *access,
|
||||
struct filter *filter);
|
||||
int64_t filter_new_seq_get(struct access_list *access);
|
||||
|
||||
extern const struct frr_yang_module_info frr_filter_info;
|
||||
extern const struct frr_yang_module_info frr_filter_cli_info;
|
||||
|
||||
|
||||
/* filter_nb.c */
|
||||
|
@ -1785,3 +1785,35 @@ const struct frr_yang_module_info frr_filter_info = {
|
||||
},
|
||||
}
|
||||
};
|
||||
|
||||
const struct frr_yang_module_info frr_filter_cli_info = {
|
||||
.name = "frr-filter",
|
||||
.ignore_cfg_cbs = true,
|
||||
.nodes = {
|
||||
{
|
||||
.xpath = "/frr-filter:lib/access-list/remark",
|
||||
.cbs.cli_show = access_list_remark_show,
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-filter:lib/access-list/entry",
|
||||
.cbs = {
|
||||
.cli_cmp = access_list_cmp,
|
||||
.cli_show = access_list_show,
|
||||
}
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-filter:lib/prefix-list/remark",
|
||||
.cbs.cli_show = prefix_list_remark_show,
|
||||
},
|
||||
{
|
||||
.xpath = "/frr-filter:lib/prefix-list/entry",
|
||||
.cbs = {
|
||||
.cli_cmp = prefix_list_cmp,
|
||||
.cli_show = prefix_list_show,
|
||||
}
|
||||
},
|
||||
{
|
||||
.xpath = NULL,
|
||||
},
|
||||
}
|
||||
};
|
||||
|
@ -170,7 +170,7 @@ const struct frr_yang_module_info zebra_route_map_info = {
|
||||
* MGMTd.
|
||||
*/
|
||||
static const struct frr_yang_module_info *const mgmt_yang_modules[] = {
|
||||
&frr_filter_info,
|
||||
&frr_filter_cli_info,
|
||||
&frr_interface_info,
|
||||
&frr_route_map_cli_info,
|
||||
&frr_routing_info,
|
||||
|
@ -564,6 +564,7 @@ void mgmt_vty_init(void)
|
||||
/*
|
||||
* Library based CLI handlers
|
||||
*/
|
||||
filter_cli_init();
|
||||
route_map_cli_init();
|
||||
|
||||
/*
|
||||
|
@ -33,8 +33,8 @@ frr_top_src = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||
|
||||
daemon_flags = {
|
||||
"lib/agentx.c": "VTYSH_ISISD|VTYSH_RIPD|VTYSH_OSPFD|VTYSH_OSPF6D|VTYSH_BGPD|VTYSH_ZEBRA",
|
||||
"lib/filter.c": "VTYSH_ACL",
|
||||
"lib/filter_cli.c": "VTYSH_ACL",
|
||||
"lib/filter.c": "VTYSH_ACL_SHOW",
|
||||
"lib/filter_cli.c": "VTYSH_ACL_CONFIG",
|
||||
"lib/if.c": "VTYSH_INTERFACE",
|
||||
"lib/keychain.c": "VTYSH_KEYS",
|
||||
"lib/mgmt_be_client.c": "VTYSH_MGMT_BACKEND",
|
||||
|
@ -49,7 +49,17 @@ extern struct event_loop *master;
|
||||
VTYSH_PIM6D | VTYSH_NHRPD | VTYSH_EIGRPD | VTYSH_BABELD | \
|
||||
VTYSH_SHARPD | VTYSH_PBRD | VTYSH_STATICD | VTYSH_BFDD | \
|
||||
VTYSH_FABRICD | VTYSH_VRRPD | VTYSH_PATHD | VTYSH_MGMTD
|
||||
#define VTYSH_ACL VTYSH_BFDD|VTYSH_BABELD|VTYSH_BGPD|VTYSH_EIGRPD|VTYSH_ISISD|VTYSH_FABRICD|VTYSH_LDPD|VTYSH_NHRPD|VTYSH_OSPF6D|VTYSH_OSPFD|VTYSH_PBRD|VTYSH_PIMD|VTYSH_PIM6D|VTYSH_RIPD|VTYSH_RIPNGD|VTYSH_VRRPD|VTYSH_ZEBRA
|
||||
#define VTYSH_ACL_CONFIG \
|
||||
VTYSH_BFDD | VTYSH_BABELD | VTYSH_BGPD | VTYSH_EIGRPD | VTYSH_ISISD | \
|
||||
VTYSH_FABRICD | VTYSH_LDPD | VTYSH_NHRPD | VTYSH_OSPF6D | \
|
||||
VTYSH_OSPFD | VTYSH_PBRD | VTYSH_PIMD | VTYSH_PIM6D | \
|
||||
VTYSH_RIPNGD | VTYSH_VRRPD | VTYSH_ZEBRA | VTYSH_MGMTD
|
||||
#define VTYSH_ACL_SHOW \
|
||||
VTYSH_BFDD | VTYSH_BABELD | VTYSH_BGPD | VTYSH_EIGRPD | VTYSH_ISISD | \
|
||||
VTYSH_FABRICD | VTYSH_LDPD | VTYSH_NHRPD | VTYSH_OSPF6D | \
|
||||
VTYSH_OSPFD | VTYSH_PBRD | VTYSH_PIMD | VTYSH_PIM6D | \
|
||||
VTYSH_RIPD | VTYSH_RIPNGD | VTYSH_VRRPD | VTYSH_ZEBRA
|
||||
|
||||
#define VTYSH_AFFMAP VTYSH_ZEBRA | VTYSH_ISISD
|
||||
#define VTYSH_RMAP_CONFIG \
|
||||
VTYSH_ZEBRA | VTYSH_RIPNGD | VTYSH_OSPFD | VTYSH_OSPF6D | VTYSH_BGPD | \
|
||||
|
Loading…
Reference in New Issue
Block a user