diff options
Diffstat (limited to 'internal/pkg')
-rw-r--r-- | internal/pkg/config/bgp_configs.go | 18 | ||||
-rw-r--r-- | internal/pkg/config/default.go | 7 |
2 files changed, 25 insertions, 0 deletions
diff --git a/internal/pkg/config/bgp_configs.go b/internal/pkg/config/bgp_configs.go index a49bfe57..f5a8215b 100644 --- a/internal/pkg/config/bgp_configs.go +++ b/internal/pkg/config/bgp_configs.go @@ -1394,6 +1394,12 @@ type BmpServerState struct { // Enable feature for mirroring of received BGP messages // mainly for debugging purpose. RouteMirroringEnabled bool `mapstructure:"route-mirroring-enabled" json:"route-mirroring-enabled,omitempty"` + // original -> gobgp:sys-name + // Reference to the SysName of the BMP server. + SysName string `mapstructure:"sys-name" json:"sys-name,omitempty"` + // original -> gobgp:sys-descr + // Reference to the SysDescr of the BMP server. + SysDescr string `mapstructure:"sys-descr" json:"sys-descr,omitempty"` } // struct for container gobgp:config. @@ -1417,6 +1423,12 @@ type BmpServerConfig struct { // Enable feature for mirroring of received BGP messages // mainly for debugging purpose. RouteMirroringEnabled bool `mapstructure:"route-mirroring-enabled" json:"route-mirroring-enabled,omitempty"` + // original -> gobgp:sys-name + // Reference to the SysName of the BMP server. + SysName string `mapstructure:"sys-name" json:"sys-name,omitempty"` + // original -> gobgp:sys-descr + // Reference to the SysDescr of the BMP server. + SysDescr string `mapstructure:"sys-descr" json:"sys-descr,omitempty"` } func (lhs *BmpServerConfig) Equal(rhs *BmpServerConfig) bool { @@ -1438,6 +1450,12 @@ func (lhs *BmpServerConfig) Equal(rhs *BmpServerConfig) bool { if lhs.RouteMirroringEnabled != rhs.RouteMirroringEnabled { return false } + if lhs.SysName != rhs.SysName { + return false + } + if lhs.SysDescr != rhs.SysDescr { + return false + } return true } diff --git a/internal/pkg/config/default.go b/internal/pkg/config/default.go index 13e1267c..9bec51be 100644 --- a/internal/pkg/config/default.go +++ b/internal/pkg/config/default.go @@ -349,7 +349,14 @@ func setDefaultConfigValuesWithViper(v *viper.Viper, b *BgpConfigSet) error { return err } + bmpSysPrefix := "Gobgp-R" for idx, server := range b.BmpServers { + if server.Config.SysName == "" { + server.Config.SysName = bmpSysPrefix + strconv.Itoa(idx) + } + if server.Config.SysDescr == "" { + server.Config.SysDescr = "Gobgp Version: master" + } if server.Config.Port == 0 { server.Config.Port = bmp.BMP_DEFAULT_PORT } |