diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/bgp_configs.go | 75 | ||||
-rw-r--r-- | config/serve.go | 1 |
2 files changed, 76 insertions, 0 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 2054efec..16968123 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -871,6 +871,76 @@ func (v RpkiValidationResultType) Validate() error { } //struct for container gobgp:state +type CollectorState struct { + // original -> gobgp:url + Url string `mapstructure:"url"` + // original -> gobgp:db-name + DbName string `mapstructure:"db-name"` + // original -> gobgp:table-dump-interval + TableDumpInterval uint64 `mapstructure:"table-dump-interval"` +} + +func (lhs *CollectorState) Equal(rhs *CollectorState) bool { + if lhs == nil || rhs == nil { + return false + } + if lhs.Url != rhs.Url { + return false + } + if lhs.DbName != rhs.DbName { + return false + } + if lhs.TableDumpInterval != rhs.TableDumpInterval { + return false + } + return true +} + +//struct for container gobgp:config +type CollectorConfig struct { + // original -> gobgp:url + Url string `mapstructure:"url"` + // original -> gobgp:db-name + DbName string `mapstructure:"db-name"` + // original -> gobgp:table-dump-interval + TableDumpInterval uint64 `mapstructure:"table-dump-interval"` +} + +func (lhs *CollectorConfig) Equal(rhs *CollectorConfig) bool { + if lhs == nil || rhs == nil { + return false + } + if lhs.Url != rhs.Url { + return false + } + if lhs.DbName != rhs.DbName { + return false + } + if lhs.TableDumpInterval != rhs.TableDumpInterval { + return false + } + return true +} + +//struct for container gobgp:collector +type Collector struct { + // original -> gobgp:collector-config + Config CollectorConfig `mapstructure:"config"` + // original -> gobgp:collector-state + State CollectorState `mapstructure:"state"` +} + +func (lhs *Collector) Equal(rhs *Collector) bool { + if lhs == nil || rhs == nil { + return false + } + if !lhs.Config.Equal(&(rhs.Config)) { + return false + } + return true +} + +//struct for container gobgp:state type ZebraState struct { // original -> gobgp:enabled //gobgp:enabled's original type is boolean @@ -3998,6 +4068,8 @@ type Bgp struct { MrtDump []Mrt `mapstructure:"mrt-dump"` // original -> gobgp:zebra Zebra Zebra `mapstructure:"zebra"` + // original -> gobgp:collector + Collector Collector `mapstructure:"collector"` } func (lhs *Bgp) Equal(rhs *Bgp) bool { @@ -4090,6 +4162,9 @@ func (lhs *Bgp) Equal(rhs *Bgp) bool { if !lhs.Zebra.Equal(&(rhs.Zebra)) { return false } + if !lhs.Collector.Equal(&(rhs.Collector)) { + return false + } return true } diff --git a/config/serve.go b/config/serve.go index a8f67725..95658a97 100644 --- a/config/serve.go +++ b/config/serve.go @@ -16,6 +16,7 @@ type BgpConfigSet struct { BmpServers []BmpServer `mapstructure:"bmp-servers"` MrtDump []Mrt `mapstructure:"mrt-dump"` Zebra Zebra `mapstructure:"zebra"` + Collector Collector `mapstructure:"collector"` DefinedSets DefinedSets `mapstructure:"defined-sets"` PolicyDefinitions []PolicyDefinition `mapstructure:"policy-definitions"` } |