summaryrefslogtreecommitdiffhomepage
path: root/config
diff options
context:
space:
mode:
Diffstat (limited to 'config')
-rw-r--r--config/bgp_configs.go21
-rw-r--r--config/util.go9
2 files changed, 30 insertions, 0 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go
index 47d070b4..1b3d2a73 100644
--- a/config/bgp_configs.go
+++ b/config/bgp_configs.go
@@ -2597,6 +2597,22 @@ func (lhs *Collector) Equal(rhs *Collector) bool {
return true
}
+//struct for container gobgp:route-target-membership
+type RouteTargetMembership struct {
+ // original -> gobgp:deferral-time
+ DeferralTime uint16 `mapstructure:"deferral-time"`
+}
+
+func (lhs *RouteTargetMembership) Equal(rhs *RouteTargetMembership) bool {
+ if lhs == nil || rhs == nil {
+ return false
+ }
+ if lhs.DeferralTime != rhs.DeferralTime {
+ return false
+ }
+ return true
+}
+
//struct for container bgp-mp:l2vpn-evpn
type L2vpnEvpn struct {
// original -> bgp-mp:prefix-limit
@@ -3224,6 +3240,8 @@ type AfiSafi struct {
UseMultiplePaths UseMultiplePaths `mapstructure:"use-multiple-paths"`
// original -> bgp-mp:prefix-limit
PrefixLimit PrefixLimit `mapstructure:"prefix-limit"`
+ // original -> gobgp:route-target-membership
+ RouteTargetMembership RouteTargetMembership `mapstructure:"route-target-membership"`
}
func (lhs *AfiSafi) Equal(rhs *AfiSafi) bool {
@@ -3284,6 +3302,9 @@ func (lhs *AfiSafi) Equal(rhs *AfiSafi) bool {
if !lhs.PrefixLimit.Equal(&(rhs.PrefixLimit)) {
return false
}
+ if !lhs.RouteTargetMembership.Equal(&(rhs.RouteTargetMembership)) {
+ return false
+ }
return true
}
diff --git a/config/util.go b/config/util.go
index 47edc98f..8d7d2546 100644
--- a/config/util.go
+++ b/config/util.go
@@ -57,3 +57,12 @@ func CreateRfMap(p *Neighbor) map[bgp.RouteFamily]bool {
}
return rfMap
}
+
+func GetAfiSafi(p *Neighbor, family bgp.RouteFamily) *AfiSafi {
+ for _, a := range p.AfiSafis {
+ if string(a.AfiSafiName) == family.String() {
+ return &a
+ }
+ }
+ return nil
+}