diff options
Diffstat (limited to 'internal/pkg/config')
-rw-r--r-- | internal/pkg/config/bgp_configs.go | 11 | ||||
-rw-r--r-- | internal/pkg/config/default.go | 14 |
2 files changed, 25 insertions, 0 deletions
diff --git a/internal/pkg/config/bgp_configs.go b/internal/pkg/config/bgp_configs.go index 8dee732d..37fe1b39 100644 --- a/internal/pkg/config/bgp_configs.go +++ b/internal/pkg/config/bgp_configs.go @@ -1133,6 +1133,10 @@ type ZebraState struct { // Configure MPLS label range size which will be requested to // FRR/Zebra. MplsLabelRangeSize uint32 `mapstructure:"mpls-label-range-size" json:"mpls-label-range-size,omitempty"` + // original -> gobgp:software-name + // Configure zebra software name. + // quagga, frr3, frr4, frr5, frr6, frr7 can be used. + SoftwareName string `mapstructure:"software-name" json:"software-name,omitempty"` } // struct for container gobgp:config. @@ -1159,6 +1163,10 @@ type ZebraConfig struct { // Configure MPLS label range size which will be requested to // FRR/Zebra. MplsLabelRangeSize uint32 `mapstructure:"mpls-label-range-size" json:"mpls-label-range-size,omitempty"` + // original -> gobgp:software-name + // Configure zebra software name. + // quagga, frr3, frr4, frr5, frr6, frr7 can be used. + SoftwareName string `mapstructure:"software-name" json:"software-name,omitempty"` } func (lhs *ZebraConfig) Equal(rhs *ZebraConfig) bool { @@ -1191,6 +1199,9 @@ func (lhs *ZebraConfig) Equal(rhs *ZebraConfig) bool { if lhs.MplsLabelRangeSize != rhs.MplsLabelRangeSize { return false } + if lhs.SoftwareName != rhs.SoftwareName { + return false + } return true } diff --git a/internal/pkg/config/default.go b/internal/pkg/config/default.go index 9bec51be..7fd5b5c1 100644 --- a/internal/pkg/config/default.go +++ b/internal/pkg/config/default.go @@ -413,6 +413,7 @@ func setDefaultConfigValuesWithViper(v *viper.Viper, b *BgpConfigSet) error { } else if b.Zebra.Config.Version > zebra.MaxZapiVer { b.Zebra.Config.Version = zebra.MaxZapiVer } + if !v.IsSet("zebra.config.nexthop-trigger-enable") && !b.Zebra.Config.NexthopTriggerEnable && b.Zebra.Config.Version > 2 { b.Zebra.Config.NexthopTriggerEnable = true } @@ -420,6 +421,19 @@ func setDefaultConfigValuesWithViper(v *viper.Viper, b *BgpConfigSet) error { b.Zebra.Config.NexthopTriggerDelay = 5 } + //SoftwareName for Zebra + allowableZebraSoftwareName := []string{"", "quagga", "frr3", "frr4", "frr5", "frr6", "frr7"} + isAllowable := false + for _, allowable := range allowableZebraSoftwareName { + if b.Zebra.Config.SoftwareName == allowable { + isAllowable = true + break + } + } + if !isAllowable { + b.Zebra.Config.SoftwareName = "" + } + list, err := extractArray(v.Get("neighbors")) if err != nil { return err |