summaryrefslogtreecommitdiffstats
path: root/eigrpd/eigrp_cli.c
diff options
context:
space:
mode:
authorDonald Sharp <sharpd@cumulusnetworks.com>2019-06-15 19:48:18 +0200
committerRafael Zalamena <rzalamena@opensourcerouting.org>2019-08-07 03:41:05 +0200
commite944996140173700f73281cf7efc444377eec331 (patch)
treee6cebd6e8c5a1979e5d22be74256120bb71d94ce /eigrpd/eigrp_cli.c
parenteigrpd: Create a socket per vrf for communication (diff)
downloadfrr-e944996140173700f73281cf7efc444377eec331.tar.xz
frr-e944996140173700f73281cf7efc444377eec331.zip
eigrpd: Add `router eigrp AS [vrf NAME]` and various stuff
Add the ability to parse `router eigrp AS [vrf NAME]` and modify eigrp_lookup to actually handle a vrf_id for us. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
Diffstat (limited to 'eigrpd/eigrp_cli.c')
-rw-r--r--eigrpd/eigrp_cli.c26
1 files changed, 16 insertions, 10 deletions
diff --git a/eigrpd/eigrp_cli.c b/eigrpd/eigrp_cli.c
index ba657a7d5..a93d4c828 100644
--- a/eigrpd/eigrp_cli.c
+++ b/eigrpd/eigrp_cli.c
@@ -40,17 +40,18 @@
DEFPY_NOSH(
router_eigrp,
router_eigrp_cmd,
- "router eigrp (1-65535)$as",
+ "router eigrp (1-65535)$as [vrf NAME]",
ROUTER_STR
EIGRP_STR
- AS_STR)
+ AS_STR
+ VRF_CMD_HELP_STR)
{
char xpath[XPATH_MAXLEN];
int rv;
snprintf(xpath, sizeof(xpath),
- "/frr-eigrpd:eigrpd/instance[asn='%s'][vrf='']",
- as_str);
+ "/frr-eigrpd:eigrpd/instance[asn='%s'][vrf='%s']",
+ as_str, vrf ? vrf : VRF_DEFAULT_NAME);
nb_cli_enqueue_change(vty, xpath, NB_OP_CREATE, NULL);
rv = nb_cli_apply_changes(vty, NULL);
@@ -60,20 +61,21 @@ DEFPY_NOSH(
return rv;
}
-DEFPY_NOSH(
+DEFPY(
no_router_eigrp,
no_router_eigrp_cmd,
- "no router eigrp (1-65535)$as",
+ "no router eigrp (1-65535)$as [vrf NAME]",
NO_STR
ROUTER_STR
EIGRP_STR
- AS_STR)
+ AS_STR
+ VRF_CMD_HELP_STR)
{
char xpath[XPATH_MAXLEN];
snprintf(xpath, sizeof(xpath),
- "/frr-eigrpd:eigrpd/instance[asn='%s'][vrf='']",
- as_str);
+ "/frr-eigrpd:eigrpd/instance[asn='%s'][vrf='%s']",
+ as_str, vrf ? vrf : VRF_DEFAULT_NAME);
nb_cli_enqueue_change(vty, xpath, NB_OP_DESTROY, NULL);
return nb_cli_apply_changes(vty, NULL);
@@ -83,8 +85,12 @@ void eigrp_cli_show_header(struct vty *vty, struct lyd_node *dnode,
bool show_defaults)
{
const char *asn = yang_dnode_get_string(dnode, "./asn");
+ const char *vrf = yang_dnode_get_string(dnode, "./vrf");
- vty_out(vty, "router eigrp %s\n", asn);
+ vty_out(vty, "router eigrp %s", asn);
+ if (strcmp(vrf, VRF_DEFAULT_NAME))
+ vty_out(vty, " vrf %s", vrf);
+ vty_out(vty, "\n");
}
void eigrp_cli_show_end_header(struct vty *vty, struct lyd_node *dnode)