diff options
author | Hitoshi Irino <irino@sfc.wide.ad.jp> | 2019-05-05 20:35:52 +0900 |
---|---|---|
committer | FUJITA Tomonori <fujita.tomonori@gmail.com> | 2019-05-08 08:48:26 +0900 |
commit | 7d2823d4c037caf39c7222632669210a4b6d1ed4 (patch) | |
tree | db6523171ffe4f086629ec95108cfa2cc6766d43 /internal/pkg/config | |
parent | cc267fad9e6410705420af220d73d25d288e8a58 (diff) |
zebra: supporting FRRouting version 7
- the "version" parameter (which means ZAPI) 6 in zebra config changes supporting FRRouting version 7 instead of FRRouting version 6.
- the "software-name" parameter which supports backward compatibility is added in zebra config.
(GoBGP support FRRouting version 6 when "version = 6" and "software-name = frr6" is configured.)
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 |