From 46b21a1725111dff416f483a12171d03359df3bf Mon Sep 17 00:00:00 2001 From: ISHIDA Wataru Date: Wed, 29 Jul 2015 02:46:38 +0900 Subject: mrt: support mrt rib dump of neighbor's local rib This feature can be used in route-server env. CLI syntax changed like below $ gobgp mrt dump rib global [] $ gobgp mrt dump rib neighbor [] Signed-off-by: ISHIDA Wataru --- api/util.go | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'api/util.go') diff --git a/api/util.go b/api/util.go index 677d4f6a..d1bd4649 100644 --- a/api/util.go +++ b/api/util.go @@ -26,3 +26,23 @@ var AF_RTC *AddressFamily = &AddressFamily{AFI_IP, SAFI_ROUTE_TARGET_CONSTRAINTS func (lhs *AddressFamily) Equal(rhs *AddressFamily) bool { return lhs.Afi == rhs.Afi && lhs.Safi == rhs.Safi } + +func (af *AddressFamily) ShortString() string { + switch { + case af.Equal(AF_IPV4_UC): + return "ipv4" + case af.Equal(AF_IPV6_UC): + return "ipv6" + case af.Equal(AF_IPV4_VPN): + return "vpnv4" + case af.Equal(AF_IPV4_VPN): + return "vpnv6" + case af.Equal(AF_EVPN): + return "evpn" + case af.Equal(AF_ENCAP): + return "encap" + case af.Equal(AF_RTC): + return "rtc" + } + return "unknown" +} -- cgit v1.2.3