diff options
| author | Donald Sharp <sharpd@cumulusnetworks.com> | 2019-06-15 13:48:18 -0400 | 
|---|---|---|
| committer | Rafael Zalamena <rzalamena@opensourcerouting.org> | 2019-08-06 22:41:05 -0300 | 
| commit | e944996140173700f73281cf7efc444377eec331 (patch) | |
| tree | e6cebd6e8c5a1979e5d22be74256120bb71d94ce /eigrpd/eigrp_cli.c | |
| parent | 128ed7604d0d90de1e49a847cc4aa4f585b2b7c5 (diff) | |
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.c | 26 | 
1 files changed, 16 insertions, 10 deletions
diff --git a/eigrpd/eigrp_cli.c b/eigrpd/eigrp_cli.c index ba657a7d5d..a93d4c8280 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)  | 
