diff options
Diffstat (limited to 'config/bgp_configs.go')
-rw-r--r-- | config/bgp_configs.go | 75 |
1 files changed, 75 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 } |