diff options
| author | Quentin Young <qlyoung@users.noreply.github.com> | 2021-10-26 15:26:32 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-10-26 15:26:32 -0400 |
| commit | 0c124f75db6b37cd67f643935b04ee40b9ea6b52 (patch) | |
| tree | 3e8a7d13e08e955c16a99dbd29b4afdc9a91e6bd /zebra/zebra_vty.c | |
| parent | d12799878586a9ea5823fc51de5432495c94fe7a (diff) | |
| parent | 30085ba550c6e20e93eecc1d78929f5e5ed1afaa (diff) | |
Merge pull request #9440 from dlqs/dplanehook2
Diffstat (limited to 'zebra/zebra_vty.c')
| -rw-r--r-- | zebra/zebra_vty.c | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c index 2cb2b5118b..85e1a4b2bf 100644 --- a/zebra/zebra_vty.c +++ b/zebra/zebra_vty.c @@ -60,6 +60,7 @@ #include "zebra/zebra_nb.h" #include "zebra/kernel_netlink.h" #include "zebra/table_manager.h" +#include "zebra/zebra_script.h" extern int allow_delete; @@ -4323,6 +4324,30 @@ DEFUN(ip_table_range, ip_table_range_cmd, return table_manager_range(vty, true, zvrf, argv[3]->arg, argv[4]->arg); } +#ifdef HAVE_SCRIPTING + +DEFUN(zebra_on_rib_process_script, zebra_on_rib_process_script_cmd, + "zebra on-rib-process script SCRIPT", + ZEBRA_STR + "on_rib_process_dplane_results hook call\n" + "Set a script\n" + "Script name (same as filename in /etc/frr/scripts/, without .lua)\n") +{ + + if (frrscript_names_set_script_name(ZEBRA_ON_RIB_PROCESS_HOOK_CALL, + argv[3]->arg) + == 0) { + vty_out(vty, "Successfully added script %s for hook call %s\n", + argv[3]->arg, ZEBRA_ON_RIB_PROCESS_HOOK_CALL); + } else { + vty_out(vty, "Failed to add script %s for hook call %s\n", + argv[3]->arg, ZEBRA_ON_RIB_PROCESS_HOOK_CALL); + } + return CMD_SUCCESS; +} + +#endif /* HAVE_SCRIPTING */ + /* IP node for static routes. */ static int zebra_ip_config(struct vty *vty); static struct cmd_node ip_node = { @@ -4479,5 +4504,9 @@ void zebra_vty_init(void) install_element(CONFIG_NODE, &no_zebra_kernel_netlink_batch_tx_buf_cmd); #endif /* HAVE_NETLINK */ +#ifdef HAVE_SCRIPTING + install_element(CONFIG_NODE, &zebra_on_rib_process_script_cmd); +#endif /* HAVE_SCRIPTING */ + install_element(VIEW_NODE, &zebra_show_routing_tables_summary_cmd); } |
