diff options
Diffstat (limited to 'config/bgp_configs.go')
-rw-r--r-- | config/bgp_configs.go | 59 |
1 files changed, 59 insertions, 0 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index f5329096..a76708b6 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -1565,6 +1565,8 @@ type PeerGroup struct { UseMultiplePaths UseMultiplePaths `mapstructure:"use-multiple-paths" json:"use-multiple-paths,omitempty"` // original -> gobgp:route-server RouteServer RouteServer `mapstructure:"route-server" json:"route-server,omitempty"` + // original -> gobgp:ttl-security + TtlSecurity TtlSecurity `mapstructure:"ttl-security" json:"ttl-security,omitempty"` } func (lhs *PeerGroup) Equal(rhs *PeerGroup) bool { @@ -1626,6 +1628,58 @@ func (lhs *PeerGroup) Equal(rhs *PeerGroup) bool { if !lhs.RouteServer.Equal(&(rhs.RouteServer)) { return false } + if !lhs.TtlSecurity.Equal(&(rhs.TtlSecurity)) { + return false + } + return true +} + +//struct for container gobgp:state +type TtlSecurityState struct { + // original -> gobgp:enabled + //gobgp:enabled's original type is boolean + Enabled bool `mapstructure:"enabled" json:"enabled,omitempty"` + // original -> gobgp:ttl-min + TtlMin uint8 `mapstructure:"ttl-min" json:"ttl-min,omitempty"` +} + +//struct for container gobgp:config +type TtlSecurityConfig struct { + // original -> gobgp:enabled + //gobgp:enabled's original type is boolean + Enabled bool `mapstructure:"enabled" json:"enabled,omitempty"` + // original -> gobgp:ttl-min + TtlMin uint8 `mapstructure:"ttl-min" json:"ttl-min,omitempty"` +} + +func (lhs *TtlSecurityConfig) Equal(rhs *TtlSecurityConfig) bool { + if lhs == nil || rhs == nil { + return false + } + if lhs.Enabled != rhs.Enabled { + return false + } + if lhs.TtlMin != rhs.TtlMin { + return false + } + return true +} + +//struct for container gobgp:ttl-security +type TtlSecurity struct { + // original -> gobgp:ttl-security-config + Config TtlSecurityConfig `mapstructure:"config" json:"config,omitempty"` + // original -> gobgp:ttl-security-state + State TtlSecurityState `mapstructure:"state" json:"state,omitempty"` +} + +func (lhs *TtlSecurity) Equal(rhs *TtlSecurity) bool { + if lhs == nil || rhs == nil { + return false + } + if !lhs.Config.Equal(&(rhs.Config)) { + return false + } return true } @@ -2521,6 +2575,8 @@ type Neighbor struct { UseMultiplePaths UseMultiplePaths `mapstructure:"use-multiple-paths" json:"use-multiple-paths,omitempty"` // original -> gobgp:route-server RouteServer RouteServer `mapstructure:"route-server" json:"route-server,omitempty"` + // original -> gobgp:ttl-security + TtlSecurity TtlSecurity `mapstructure:"ttl-security" json:"ttl-security,omitempty"` } func (lhs *Neighbor) Equal(rhs *Neighbor) bool { @@ -2582,6 +2638,9 @@ func (lhs *Neighbor) Equal(rhs *Neighbor) bool { if !lhs.RouteServer.Equal(&(rhs.RouteServer)) { return false } + if !lhs.TtlSecurity.Equal(&(rhs.TtlSecurity)) { + return false + } return true } |