lib: implement new route map CLI

Use the northbound back-end instead of the old route map CLI.

Signed-off-by: Rafael Zalamena <rzalamena@opensourcerouting.org>
This commit is contained in:
Rafael Zalamena 2019-09-30 15:01:46 -03:00
parent 686d244f00
commit 2b3e4807ec
6 changed files with 1108 additions and 1102 deletions

File diff suppressed because it is too large Load Diff

View File

@ -666,8 +666,27 @@ int lib_route_map_entry_match_destroy(enum nb_event event,
const struct lyd_node *dnode);
int lib_route_map_entry_set_destroy(enum nb_event event,
const struct lyd_node *dnode);
extern const struct frr_yang_module_info frr_route_map_info;
/* routemap_cli.c */
extern void route_map_instance_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void route_map_instance_show_end(struct vty *vty,
struct lyd_node *dnode);
extern void route_map_condition_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void route_map_action_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void route_map_exit_policy_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void route_map_call_show(struct vty *vty, struct lyd_node *dnode,
bool show_defaults);
extern void route_map_description_show(struct vty *vty,
struct lyd_node *dnode,
bool show_defaults);
extern void route_map_cli_init(void);
#ifdef __cplusplus
}
#endif

1075
lib/routemap_cli.c Normal file

File diff suppressed because it is too large Load Diff

View File

@ -1218,6 +1218,8 @@ const struct frr_yang_module_info frr_route_map_info = {
.cbs = {
.create = lib_route_map_entry_create,
.destroy = lib_route_map_entry_destroy,
.cli_show = route_map_instance_show,
.cli_show_end = route_map_instance_show_end,
}
},
{
@ -1225,6 +1227,7 @@ const struct frr_yang_module_info frr_route_map_info = {
.cbs = {
.modify = lib_route_map_entry_description_modify,
.destroy = lib_route_map_entry_description_destroy,
.cli_show = route_map_description_show,
}
},
{
@ -1238,12 +1241,14 @@ const struct frr_yang_module_info frr_route_map_info = {
.cbs = {
.modify = lib_route_map_entry_call_modify,
.destroy = lib_route_map_entry_call_destroy,
.cli_show = route_map_call_show,
}
},
{
.xpath = "/frr-route-map:lib/route-map/entry/exit-policy",
.cbs = {
.modify = lib_route_map_entry_exit_policy_modify,
.cli_show = route_map_exit_policy_show,
}
},
{
@ -1258,6 +1263,7 @@ const struct frr_yang_module_info frr_route_map_info = {
.cbs = {
.create = lib_route_map_entry_match_condition_create,
.destroy = lib_route_map_entry_match_condition_destroy,
.cli_show = route_map_condition_show,
}
},
{
@ -1321,6 +1327,7 @@ const struct frr_yang_module_info frr_route_map_info = {
.cbs = {
.create = lib_route_map_entry_set_action_create,
.destroy = lib_route_map_entry_set_action_destroy,
.cli_show = route_map_action_show,
}
},
{

View File

@ -71,6 +71,7 @@ lib_libfrr_la_SOURCES = \
lib/qobj.c \
lib/ringbuf.c \
lib/routemap.c \
lib/routemap_cli.c \
lib/routemap_northbound.c \
lib/sbuf.c \
lib/seqlock.c \
@ -122,6 +123,7 @@ vtysh_scan += \
$(top_srcdir)/lib/nexthop_group.c \
$(top_srcdir)/lib/plist.c \
$(top_srcdir)/lib/routemap.c \
$(top_srcdir)/lib/routemap_cli.c \
$(top_srcdir)/lib/vrf.c \
$(top_srcdir)/lib/vty.c \
# end
@ -141,6 +143,8 @@ lib/nexthop_group_clippy.c: $(CLIPPY_DEPS)
lib/nexthop_group.lo: lib/nexthop_group_clippy.c
lib/northbound_cli_clippy.c: $(CLIPPY_DEPS)
lib/northbound_cli.lo: lib/northbound_cli_clippy.c
lib/routemap_cli_clippy.c: $(CLIPPY_DEPS)
lib/routemap_cli.lo: lib/routemap_cli_clippy.c
lib/vty_clippy.c: $(CLIPPY_DEPS)
lib/vty.lo: lib/vty_clippy.c
lib/log_vty_clippy.c: $(CLIPPY_DEPS)

View File

@ -87,7 +87,7 @@ sub scan_file {
if ($file =~ /lib\/keychain\.c$/) {
$protocol = "VTYSH_RIPD|VTYSH_EIGRPD";
}
elsif ($file =~ /lib\/routemap\.c$/) {
elsif ($file =~ /lib\/routemap\.c$/ || $file =~ /lib\/routemap_cli\.c$/) {
$protocol = "VTYSH_RMAP";
}
elsif ($file =~ /lib\/vrf\.c$/) {