diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2017-07-04 14:24:57 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp> | 2017-07-04 14:24:57 +0900 |
commit | 454fd93ef707c530b3ece04ef4727ad1f7371d4b (patch) | |
tree | 379ef72e0b04fcc5bb913c435f162bdeaf5fcbdc /config | |
parent | 1d46f58ff1df4d1195091a9f25e74a583801b39d (diff) |
support addpath recv
Diffstat (limited to 'config')
-rw-r--r-- | config/util.go | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/config/util.go b/config/util.go index 8ecf56d5..ab7ebfe3 100644 --- a/config/util.go +++ b/config/util.go @@ -69,11 +69,18 @@ func (c AfiSafis) ToRfList() ([]bgp.RouteFamily, error) { return rfs, nil } -func CreateRfMap(p *Neighbor) map[bgp.RouteFamily]bool { +func CreateRfMap(p *Neighbor) map[bgp.RouteFamily]bgp.BGPAddPathMode { rfs, _ := AfiSafis(p.AfiSafis).ToRfList() - rfMap := make(map[bgp.RouteFamily]bool) + mode := bgp.BGP_ADD_PATH_NONE + if p.AddPaths.Config.Receive { + mode |= bgp.BGP_ADD_PATH_RECEIVE + } + if p.AddPaths.Config.SendMax > 0 { + mode |= bgp.BGP_ADD_PATH_SEND + } + rfMap := make(map[bgp.RouteFamily]bgp.BGPAddPathMode) for _, rf := range rfs { - rfMap[rf] = true + rfMap[rf] = mode } return rfMap } |