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_northbound.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_northbound.c')
| -rw-r--r-- | eigrpd/eigrp_northbound.c | 16 | 
1 files changed, 10 insertions, 6 deletions
diff --git a/eigrpd/eigrp_northbound.c b/eigrpd/eigrp_northbound.c index 5eecc33320..4ccce2ebb8 100644 --- a/eigrpd/eigrp_northbound.c +++ b/eigrpd/eigrp_northbound.c @@ -79,14 +79,18 @@ static int eigrpd_instance_create(enum nb_event event,  				  union nb_resource *resource)  {  	struct eigrp *eigrp; +	const char *vrf; +	vrf_id_t vrfid;  	switch (event) {  	case NB_EV_VALIDATE:  		/* NOTHING */  		break;  	case NB_EV_PREPARE: -		eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"), -				  VRF_DEFAULT); +		vrf = yang_dnode_get_string(dnode, "./vrf"); +		vrfid = vrf_name_to_id(vrf); + +		eigrp = eigrp_get(yang_dnode_get_uint16(dnode, "./asn"), vrfid);  		resource->ptr = eigrp;  		break;  	case NB_EV_ABORT: @@ -1185,8 +1189,8 @@ static int lib_interface_eigrp_instance_create(enum nb_event event,  			break;  		} -		eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"), -				  VRF_DEFAULT); +		eigrp = eigrp_get(yang_dnode_get_uint16(dnode, "./asn"), +				  ifp->vrf_id);  		eif = eigrp_interface_lookup(eigrp, ifp->name);  		if (eif == NULL)  			return NB_ERR_INCONSISTENCY; @@ -1197,8 +1201,8 @@ static int lib_interface_eigrp_instance_create(enum nb_event event,  		break;  	case NB_EV_APPLY:  		ifp = nb_running_get_entry(dnode, NULL, true); -		eigrp = eigrp_get(yang_dnode_get_string(dnode, "./asn"), -				  VRF_DEFAULT); +		eigrp = eigrp_get(yang_dnode_get_uint16(dnode, "./asn"), +				  ifp->vrf_id);  		eif = eigrp_interface_lookup(eigrp, ifp->name);  		if (eif == NULL)  			return NB_ERR_INCONSISTENCY;  | 
