summaryrefslogtreecommitdiffstats
path: root/bgpd/rfp-example
diff options
context:
space:
mode:
authorLou Berger <lberger@labn.net>2018-08-28 21:11:54 +0200
committerLou Berger <lberger@labn.net>2018-08-29 01:26:04 +0200
commit6a809ee406e4d53b3838792222966d0deca3d9b0 (patch)
tree68024681d44bb9dfa1f1a598d9f2cdcafc3ee833 /bgpd/rfp-example
parentrfapi: debug related changes to support topotest (diff)
downloadfrr-6a809ee406e4d53b3838792222966d0deca3d9b0.tar.xz
frr-6a809ee406e4d53b3838792222966d0deca3d9b0.zip
rfp_example: add rfp holddown-factor to support topotest
Signed-off-by: Lou Berger <lberger@labn.net>
Diffstat (limited to 'bgpd/rfp-example')
-rw-r--r--bgpd/rfp-example/librfp/rfp_example.c27
1 files changed, 26 insertions, 1 deletions
diff --git a/bgpd/rfp-example/librfp/rfp_example.c b/bgpd/rfp-example/librfp/rfp_example.c
index cde2d7b35..bed952826 100644
--- a/bgpd/rfp-example/librfp/rfp_example.c
+++ b/bgpd/rfp-example/librfp/rfp_example.c
@@ -54,6 +54,26 @@ 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)",
+ RFP_SHOW_STR
+ "Set Hold-Down Factor as a percentage of registration lifetime.\n"
+ "Percentage of registration lifetime\n")
+{
+ struct rfp_instance_t *rfi;
+ uint32_t value = 0;
+
+ value = strtoul((argv[--argc]->arg), NULL, 10);
+ rfi = rfapi_get_rfp_start_val(VTY_GET_CONTEXT(bgp)); /* BGP_NODE */
+ if (!rfi) {
+ vty_out(vty, "VNC not configured\n");
+ return CMD_WARNING;
+ }
+ rfi->rfapi_config.holddown_factor = value;
+ rfapi_rfp_set_configuration(rfi, &rfi->rfapi_config);
+ return CMD_SUCCESS;
+}
static void rfp_vty_install()
{
@@ -63,6 +83,7 @@ static void rfp_vty_install()
installed = 1;
/* example of new cli command */
install_element(BGP_NODE, &rfp_example_config_value_cmd);
+ install_element(BGP_NODE, &rfp_holddown_factor_cmd);
}
/***********************************************************************
@@ -196,7 +217,11 @@ static int rfp_cfg_write_cb(struct vty *vty, void *rfp_start_val)
vty_out(vty, "\n");
write++;
}
-
+ if (rfi->rfapi_config.holddown_factor != 0) {
+ vty_out(vty, " rfp holddown-factor %u\n",
+ rfi->rfapi_config.holddown_factor);
+ write++;
+ }
return write;
}