summaryrefslogtreecommitdiffhomepage
path: root/config/bgp_configs.go
diff options
context:
space:
mode:
authorIWASE Yusuke <iwase.yusuke0@gmail.com>2017-06-09 15:21:38 +0900
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2017-06-23 18:13:19 +0900
commit5bb427a994989f97570ddfc7200a884e57e5530b (patch)
tree0448f2c314ab06a2b30093cf0ce83302c7a28f83 /config/bgp_configs.go
parent1747a3311c7a29a3d58a223e70e37e854460b852 (diff)
config: Add parameters for TTL Security
Signed-off-by: IWASE Yusuke <iwase.yusuke0@gmail.com>
Diffstat (limited to 'config/bgp_configs.go')
-rw-r--r--config/bgp_configs.go59
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
}