diff options
author | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-27 09:41:29 +0000 |
---|---|---|
committer | ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp> | 2016-04-27 10:07:02 +0000 |
commit | f6c70e980d41066df51ce8cf63f2351911391e47 (patch) | |
tree | bb774d3b6e6f4792937154da4362e5e047e22876 /config | |
parent | 21938add9f67de5bea1ac7ccb4b21b24a996437b (diff) |
config: make route-target config struct aligned with open-config model
have config/state container
Signed-off-by: ISHIDA Wataru <ishida.wataru@lab.ntt.co.jp>
Diffstat (limited to 'config')
-rw-r--r-- | config/bgp_configs.go | 43 |
1 files changed, 40 insertions, 3 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 7beaeec9..d69995d1 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -2561,13 +2561,29 @@ func (lhs *Zebra) Equal(rhs *Zebra) bool { return true } -//struct for container gobgp:route-target-membership -type RouteTargetMembership struct { +//struct for container gobgp:state +type RouteTargetMembershipState struct { // original -> gobgp:deferral-time DeferralTime uint16 `mapstructure:"deferral-time"` } -func (lhs *RouteTargetMembership) Equal(rhs *RouteTargetMembership) bool { +func (lhs *RouteTargetMembershipState) Equal(rhs *RouteTargetMembershipState) bool { + if lhs == nil || rhs == nil { + return false + } + if lhs.DeferralTime != rhs.DeferralTime { + return false + } + return true +} + +//struct for container gobgp:config +type RouteTargetMembershipConfig struct { + // original -> gobgp:deferral-time + DeferralTime uint16 `mapstructure:"deferral-time"` +} + +func (lhs *RouteTargetMembershipConfig) Equal(rhs *RouteTargetMembershipConfig) bool { if lhs == nil || rhs == nil { return false } @@ -2577,6 +2593,27 @@ func (lhs *RouteTargetMembership) Equal(rhs *RouteTargetMembership) bool { return true } +//struct for container gobgp:route-target-membership +type RouteTargetMembership struct { + // original -> gobgp:route-target-membership-config + Config RouteTargetMembershipConfig `mapstructure:"config"` + // original -> gobgp:route-target-membership-state + State RouteTargetMembershipState `mapstructure:"state"` +} + +func (lhs *RouteTargetMembership) Equal(rhs *RouteTargetMembership) bool { + if lhs == nil || rhs == nil { + return false + } + if !lhs.Config.Equal(&(rhs.Config)) { + return false + } + if !lhs.State.Equal(&(rhs.State)) { + return false + } + return true +} + //struct for container bgp-mp:l2vpn-evpn type L2vpnEvpn struct { // original -> bgp-mp:prefix-limit |