diff options
author | Lou Berger <lberger@labn.net> | 2018-08-29 17:08:10 +0200 |
---|---|---|
committer | Lou Berger <lberger@labn.net> | 2018-08-29 17:08:10 +0200 |
commit | 752a286dfa79d607d41ec41bf1623faf3fdee66c (patch) | |
tree | aedc9fb8fcec64fb12cf2e8518d62c9d43949deb /bgpd | |
parent | rfapi: debug related changes to support topotest -- add cost (diff) | |
download | frr-752a286dfa79d607d41ec41bf1623faf3fdee66c.tar.xz frr-752a286dfa79d607d41ec41bf1623faf3fdee66c.zip |
rfp_example: add 'rfp full-table-download' config to support topotest
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'bgpd')
-rw-r--r-- | bgpd/rfp-example/librfp/rfp_example.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/bgpd/rfp-example/librfp/rfp_example.c b/bgpd/rfp-example/librfp/rfp_example.c index bed952826..fe74be682 100644 --- a/bgpd/rfp-example/librfp/rfp_example.c +++ b/bgpd/rfp-example/librfp/rfp_example.c @@ -54,6 +54,7 @@ DEFUN (rfp_example_config_value, rfi->config_var = value; return CMD_SUCCESS; } + DEFUN (rfp_holddown_factor, rfp_holddown_factor_cmd, "rfp holddown-factor (0-4294967295)", @@ -75,6 +76,33 @@ DEFUN (rfp_holddown_factor, return CMD_SUCCESS; } + +DEFUN (rfp_full_table_download, + rfp_full_table_download_cmd, + "rfp full-table-download <on|off>", + RFP_SHOW_STR + "RFP full table download support (default=on)\n" + "Enable RFP full table download\n" + "Disable RFP full table download\n") +{ + struct rfp_instance_t *rfi; + rfapi_rfp_download_type old; + + rfi = rfapi_get_rfp_start_val(VTY_GET_CONTEXT(bgp)); /* BGP_NODE */ + if (!rfi) { + vty_out(vty, "VNC not configured\n"); + return CMD_WARNING; + } + old = rfi->rfapi_config.download_type; + if (argv[--argc]->arg[1] == 'n' || argv[argc]->arg[1] == 'N') + rfi->rfapi_config.download_type = RFAPI_RFP_DOWNLOAD_FULL; + else + rfi->rfapi_config.download_type = RFAPI_RFP_DOWNLOAD_PARTIAL; + if (old != rfi->rfapi_config.download_type) + rfapi_rfp_set_configuration(rfi, &rfi->rfapi_config); + return CMD_SUCCESS; +} + static void rfp_vty_install() { static int installed = 0; @@ -84,6 +112,7 @@ static void rfp_vty_install() /* example of new cli command */ install_element(BGP_NODE, &rfp_example_config_value_cmd); install_element(BGP_NODE, &rfp_holddown_factor_cmd); + install_element(BGP_NODE, &rfp_full_table_download_cmd); } /*********************************************************************** @@ -222,6 +251,10 @@ static int rfp_cfg_write_cb(struct vty *vty, void *rfp_start_val) rfi->rfapi_config.holddown_factor); write++; } + if (rfi->rfapi_config.download_type != RFAPI_RFP_DOWNLOAD_FULL) { + vty_out(vty, " rfp full-table-download off\n"); + write++; + } return write; } |