diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/util.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/config/util.go b/config/util.go index 26ab7004..85a36e38 100644 --- a/config/util.go +++ b/config/util.go @@ -15,6 +15,10 @@ package config +import ( + "github.com/osrg/gobgp/packet" +) + func IsConfederationMember(g *Global, p *Neighbor) bool { if p.NeighborConfig.PeerAs != g.GlobalConfig.As { for _, member := range g.Confederation.ConfederationConfig.MemberAs { @@ -25,3 +29,12 @@ func IsConfederationMember(g *Global, p *Neighbor) bool { } return false } + +func CreateRfMap(p *Neighbor) map[bgp.RouteFamily]bool { + rfMap := make(map[bgp.RouteFamily]bool) + for _, rf := range p.AfiSafis.AfiSafiList { + k, _ := bgp.GetRouteFamily(rf.AfiSafiName) + rfMap[k] = true + } + return rfMap +} |