summaryrefslogtreecommitdiffhomepage
path: root/config/bgp_configs.go
diff options
context:
space:
mode:
authorWataru Ishida <ishida.wataru@lab.ntt.co.jp>2016-10-09 07:18:13 -0700
committerFUJITA Tomonori <fujita.tomonori@lab.ntt.co.jp>2016-10-09 07:18:13 -0700
commit614746ca1159fe421047df04c5af6f07c38b2e65 (patch)
tree77e93a40ec38318a96ab3a195fb1baa68372acd2 /config/bgp_configs.go
parent6b6f6974fcea37dc006f90dbd2f8d65495048725 (diff)
*: support long lived graceful restart
Signed-off-by: Wataru Ishida <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config/bgp_configs.go')
-rw-r--r--config/bgp_configs.go97
1 files changed, 97 insertions, 0 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go
index f56a3750..d526184d 100644
--- a/config/bgp_configs.go
+++ b/config/bgp_configs.go
@@ -2802,6 +2802,86 @@ func (lhs *MplsLabelRange) Equal(rhs *MplsLabelRange) bool {
}
//struct for container gobgp:state
+type LongLivedGracefulRestartState struct {
+ // original -> gobgp:enabled
+ //gobgp:enabled's original type is boolean
+ Enabled bool `mapstructure:"enabled"`
+ // original -> gobgp:received
+ //gobgp:received's original type is boolean
+ Received bool `mapstructure:"received"`
+ // original -> gobgp:advertised
+ //gobgp:advertised's original type is boolean
+ Advertised bool `mapstructure:"advertised"`
+ // original -> gobgp:peer-restart-time
+ PeerRestartTime uint32 `mapstructure:"peer-restart-time"`
+ // original -> gobgp:peer-restart-timer-expired
+ //gobgp:peer-restart-timer-expired's original type is boolean
+ PeerRestartTimerExpired bool `mapstructure:"peer-restart-timer-expired"`
+}
+
+func (lhs *LongLivedGracefulRestartState) Equal(rhs *LongLivedGracefulRestartState) bool {
+ if lhs == nil || rhs == nil {
+ return false
+ }
+ if lhs.Enabled != rhs.Enabled {
+ return false
+ }
+ if lhs.Received != rhs.Received {
+ return false
+ }
+ if lhs.Advertised != rhs.Advertised {
+ return false
+ }
+ if lhs.PeerRestartTime != rhs.PeerRestartTime {
+ return false
+ }
+ if lhs.PeerRestartTimerExpired != rhs.PeerRestartTimerExpired {
+ return false
+ }
+ return true
+}
+
+//struct for container gobgp:config
+type LongLivedGracefulRestartConfig struct {
+ // original -> gobgp:enabled
+ //gobgp:enabled's original type is boolean
+ Enabled bool `mapstructure:"enabled"`
+ // original -> gobgp:restart-time
+ RestartTime uint32 `mapstructure:"restart-time"`
+}
+
+func (lhs *LongLivedGracefulRestartConfig) Equal(rhs *LongLivedGracefulRestartConfig) bool {
+ if lhs == nil || rhs == nil {
+ return false
+ }
+ if lhs.Enabled != rhs.Enabled {
+ return false
+ }
+ if lhs.RestartTime != rhs.RestartTime {
+ return false
+ }
+ return true
+}
+
+//struct for container gobgp:long-lived-graceful-restart
+type LongLivedGracefulRestart struct {
+ // original -> gobgp:long-lived-graceful-restart-config
+ Config LongLivedGracefulRestartConfig `mapstructure:"config"`
+ // original -> gobgp:long-lived-graceful-restart-state
+ State LongLivedGracefulRestartState `mapstructure:"state"`
+}
+
+func (lhs *LongLivedGracefulRestart) Equal(rhs *LongLivedGracefulRestart) bool {
+ if lhs == nil || rhs == nil {
+ return false
+ }
+ if !lhs.Config.Equal(&(rhs.Config)) {
+ return false
+ }
+ return true
+}
+
+//struct for container gobgp:state
type RouteTargetMembershipState struct {
// original -> gobgp:deferral-time
DeferralTime uint16 `mapstructure:"deferral-time"`
@@ -3464,6 +3544,8 @@ type AfiSafi struct {
PrefixLimit PrefixLimit `mapstructure:"prefix-limit"`
// original -> gobgp:route-target-membership
RouteTargetMembership RouteTargetMembership `mapstructure:"route-target-membership"`
+ // original -> gobgp:long-lived-graceful-restart
+ LongLivedGracefulRestart LongLivedGracefulRestart `mapstructure:"long-lived-graceful-restart"`
}
func (lhs *AfiSafi) Equal(rhs *AfiSafi) bool {
@@ -3521,6 +3603,9 @@ func (lhs *AfiSafi) Equal(rhs *AfiSafi) bool {
if !lhs.RouteTargetMembership.Equal(&(rhs.RouteTargetMembership)) {
return false
}
+ if !lhs.LongLivedGracefulRestart.Equal(&(rhs.LongLivedGracefulRestart)) {
+ return false
+ }
return true
}
@@ -3552,6 +3637,9 @@ type GracefulRestartState struct {
// original -> gobgp:notification-enabled
//gobgp:notification-enabled's original type is boolean
NotificationEnabled bool `mapstructure:"notification-enabled"`
+ // original -> gobgp:long-lived-enabled
+ //gobgp:long-lived-enabled's original type is boolean
+ LongLivedEnabled bool `mapstructure:"long-lived-enabled"`
}
func (lhs *GracefulRestartState) Equal(rhs *GracefulRestartState) bool {
@@ -3588,6 +3676,9 @@ func (lhs *GracefulRestartState) Equal(rhs *GracefulRestartState) bool {
if lhs.NotificationEnabled != rhs.NotificationEnabled {
return false
}
+ if lhs.LongLivedEnabled != rhs.LongLivedEnabled {
+ return false
+ }
return true
}
@@ -3609,6 +3700,9 @@ type GracefulRestartConfig struct {
// original -> gobgp:notification-enabled
//gobgp:notification-enabled's original type is boolean
NotificationEnabled bool `mapstructure:"notification-enabled"`
+ // original -> gobgp:long-lived-enabled
+ //gobgp:long-lived-enabled's original type is boolean
+ LongLivedEnabled bool `mapstructure:"long-lived-enabled"`
}
func (lhs *GracefulRestartConfig) Equal(rhs *GracefulRestartConfig) bool {
@@ -3633,6 +3727,9 @@ func (lhs *GracefulRestartConfig) Equal(rhs *GracefulRestartConfig) bool {
if lhs.NotificationEnabled != rhs.NotificationEnabled {
return false
}
+ if lhs.LongLivedEnabled != rhs.LongLivedEnabled {
+ return false
+ }
return true
}