From 532f9f17bce81f2ad35aa69a8f1435d533088c9d Mon Sep 17 00:00:00 2001 From: Chirag Shah Date: Wed, 5 Aug 2020 14:38:49 -0700 Subject: [PATCH] lib: yang afi-safi identityref translation Add more afi safis in conversion to-from string to indentityref. Signed-off-by: Chirag Shah --- lib/yang_wrappers.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/lib/yang_wrappers.c b/lib/yang_wrappers.c index 8b0e89d52edc..4f743096ee19 100644 --- a/lib/yang_wrappers.c +++ b/lib/yang_wrappers.c @@ -1203,6 +1203,16 @@ const char *yang_afi_safi_value2identity(afi_t afi, safi_t safi) return "frr-routing:ipv4-multicast"; if (afi == AFI_IP6 && safi == SAFI_MULTICAST) return "frr-routing:ipv6-multicast"; + if (afi == AFI_IP && safi == SAFI_MPLS_VPN) + return "frr-routing:l3vpn-ipv4-unicast"; + if (afi == AFI_IP6 && safi == SAFI_MPLS_VPN) + return "frr-routing:l3vpn-ipv6-unicast"; + if (afi == AFI_L2VPN && safi == SAFI_EVPN) + return "frr-routing:l2vpn-evpn"; + if (afi == AFI_IP && safi == SAFI_LABELED_UNICAST) + return "frr-routing:ipv4-labeled-unicast"; + if (afi == AFI_IP6 && safi == SAFI_LABELED_UNICAST) + return "frr-routing:ipv6-labeled-unicast"; return NULL; } @@ -1221,6 +1231,21 @@ void yang_afi_safi_identity2value(const char *key, afi_t *afi, safi_t *safi) } else if (strmatch(key, "frr-routing:ipv6-multicast")) { *afi = AFI_IP6; *safi = SAFI_MULTICAST; + } else if (strmatch(key, "frr-routing:l3vpn-ipv4-unicast")) { + *afi = AFI_IP; + *safi = SAFI_MPLS_VPN; + } else if (strmatch(key, "frr-routing:l3vpn-ipv6-unicast")) { + *afi = AFI_IP6; + *safi = SAFI_MPLS_VPN; + } else if (strmatch(key, "frr-routing:ipv4-labeled-unicast")) { + *afi = AFI_IP; + *safi = SAFI_LABELED_UNICAST; + } else if (strmatch(key, "frr-routing:ipv6-labeled-unicast")) { + *afi = AFI_IP6; + *safi = SAFI_LABELED_UNICAST; + } else if (strmatch(key, "frr-routing:l2vpn-evpn")) { + *afi = AFI_L2VPN; + *safi = SAFI_EVPN; } else { *afi = AFI_UNSPEC; *safi = SAFI_UNSPEC;