diff options
Diffstat (limited to 'config')
-rw-r--r-- | config/bgp_configs.go | 1881 | ||||
-rw-r--r-- | config/default.go | 45 | ||||
-rw-r--r-- | config/serve.go | 12 |
3 files changed, 1299 insertions, 639 deletions
diff --git a/config/bgp_configs.go b/config/bgp_configs.go index 3f0381b5..adb4a1c5 100644 --- a/config/bgp_configs.go +++ b/config/bgp_configs.go @@ -17,447 +17,375 @@ package config import "net" -// typedef for typedef bgp:remove-private-as-option +// typedef for typedef bgp-types:rr-cluster-id-type +type RrClusterIdType string + +// typedef for typedef bgp-types:remove-private-as-option type RemovePrivateAsOption int const ( - REMOVE_PRIVATE_AS_OPTION_ALL = iota + REMOVE_PRIVATE_AS_OPTION_ALL RemovePrivateAsOption = iota REMOVE_PRIVATE_AS_OPTION_REPLACE ) -// typedef for typedef bgp:community-type +// typedef for typedef bgp-types:bgp-community-regexp-type +type BgpCommunityRegexpType string + +// typedef for typedef bgp-types:community-type type CommunityType int const ( - COMMUNITY_TYPE_STANDARD = iota + COMMUNITY_TYPE_STANDARD CommunityType = iota COMMUNITY_TYPE_EXTENDED COMMUNITY_TYPE_BOTH COMMUNITY_TYPE_NONE ) -// typedef for typedef bgp:rr-cluster-id-type -type RrClusterIdType string +// typedef for typedef bgp-types:bgp-ext-community-type +type BgpExtCommunityType string + +// typedef for typedef bgp-types:bgp-std-community-type +type BgpStdCommunityType string -// typedef for typedef bgp:peer-type +// typedef for typedef bgp-types:peer-type type PeerTypeDef int const ( - PEER_TYPE_INTERNAL = iota + PEER_TYPE_INTERNAL PeerTypeDef = iota PEER_TYPE_EXTERNAL ) -// typedef for typedef bgp:percentage +// typedef for typedef bgp-types:percentage type Percentage uint8 -// typedef for typedef bgp:bgp-origin-attr-type +// typedef for typedef bgp-types:bgp-session-direction +type BgpSessionDirection int + +const ( + BGP_SESSION_DIRECTION_INBOUND BgpSessionDirection = iota + BGP_SESSION_DIRECTION_OUTBOUND +) + +// typedef for typedef bgp-types:bgp-origin-attr-type type BgpOriginAttrType int const ( - BGP_ORIGIN_ATTR_TYPE_IGP = 0 - BGP_ORIGIN_ATTR_TYPE_EGP = 1 - BGP_ORIGIN_ATTR_TYPE_INCOMPLETE = 2 + BGP_ORIGIN_ATTR_TYPE_IGP BgpOriginAttrType = 0 + BGP_ORIGIN_ATTR_TYPE_EGP = 1 + BGP_ORIGIN_ATTR_TYPE_INCOMPLETE = 2 ) -// typedef for typedef ptypes:igp-tag-type -type IgpTagType string +// typedef for typedef ptypes:match-set-options-restricted-type +type MatchSetOptionsRestrictedType int + +const ( + MATCH_SET_OPTIONS_RESTRICTED_TYPE_ANY MatchSetOptionsRestrictedType = iota + MATCH_SET_OPTIONS_RESTRICTED_TYPE_INVERT +) // typedef for typedef ptypes:match-set-options-type type MatchSetOptionsType int const ( - MATCH_SET_OPTIONS_TYPE_ANY = iota + MATCH_SET_OPTIONS_TYPE_ANY MatchSetOptionsType = iota MATCH_SET_OPTIONS_TYPE_ALL MATCH_SET_OPTIONS_TYPE_INVERT ) -// typedef for typedef rpol:install-protocol-type -type InstallProtocolType int - -const ( - INSTALL_PROTOCOL_TYPE_ISIS = iota - INSTALL_PROTOCOL_TYPE_OSPF - INSTALL_PROTOCOL_TYPE_OSPF3 - INSTALL_PROTOCOL_TYPE_STATIC - INSTALL_PROTOCOL_TYPE_DIRECTLY_CONNECTED -) +// typedef for typedef ptypes:tag-type +type TagType string // typedef for typedef rpol:default-policy-type type DefaultPolicyType int const ( - DEFAULT_POLICY_TYPE_ACCEPT_ROUTE = iota + DEFAULT_POLICY_TYPE_ACCEPT_ROUTE DefaultPolicyType = iota DEFAULT_POLICY_TYPE_REJECT_ROUTE ) -// typedef for typedef bgp-pol:bgp-set-community-option-type -type BgpSetCommunityOptionType int - -const ( - BGP_SET_COMMUNITY_OPTION_TYPE_ADD = iota - BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE - BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE - BGP_SET_COMMUNITY_OPTION_TYPE_NULL -) - -// typedef for typedef bgp-pol:bgp-community-regexp-type -type BgpCommunityRegexpType string - -// typedef for typedef bgp-pol:bgp-set-med-type -type BgpSetMedType string - -// typedef for typedef bgp-pol:bgp-ext-community-type -type BgpExtCommunityType string +// typedef for typedef bgp-pol:bgp-next-hop-type +type BgpNextHopType string // typedef for typedef bgp-pol:bgp-as-path-prepend-repeat type BgpAsPathPrependRepeat uint8 -// typedef for typedef bgp-pol:bgp-std-community-type -type BgpStdCommunityType string - -// typedef for typedef bgp-pol:bgp-next-hop-type -type BgpNextHopType string +// typedef for typedef bgp-pol:bgp-set-med-type +type BgpSetMedType string -// typedef for typedef bgp-pol:bgp-well-known-community-type -type BgpWellKnownCommunityType int +// typedef for typedef bgp-pol:bgp-set-community-option-type +type BgpSetCommunityOptionType int const ( - BGP_WELL_KNOWN_COMMUNITY_TYPE_INTERNET = iota - BGP_WELL_KNOWN_COMMUNITY_TYPE_NO_EXPORT - BGP_WELL_KNOWN_COMMUNITY_TYPE_NO_ADVERTISE - BGP_WELL_KNOWN_COMMUNITY_TYPE_NO_EXPORT_SUBCONFED + BGP_SET_COMMUNITY_OPTION_TYPE_ADD BgpSetCommunityOptionType = iota + BGP_SET_COMMUNITY_OPTION_TYPE_REMOVE + BGP_SET_COMMUNITY_OPTION_TYPE_REPLACE ) -//struct for container bgp-pol:set-ext-community -type SetExtCommunity struct { - // original -> bgp-pol:communities - //original type is list of union - Communities []string - // original -> bgp-pol:options - //bgp-pol:options's original type is bgp-set-community-option-type - Options string -} - -//struct for container bgp-pol:set-community -type SetCommunity struct { - // original -> bgp-pol:communities - //original type is list of union - Communities []string - // original -> bgp-pol:options - //bgp-pol:options's original type is bgp-set-community-option-type - Options string -} - -//struct for container bgp-pol:set-as-path-prepend -type SetAsPathPrepend struct { - // original -> bgp-pol:as - //bgp-pol:as's original type is union - As string - // original -> bgp-pol:repeat-n - RepeatN uint8 -} - -//struct for container bgp-pol:bgp-actions -type BgpActions struct { - // original -> bgp-pol:set-as-path-prepend - SetAsPathPrepend SetAsPathPrepend - // original -> bgp-pol:set-community - SetCommunity SetCommunity - // original -> bgp-pol:set-ext-community - SetExtCommunity SetExtCommunity - // original -> bgp-pol:set-route-origin - SetRouteOrigin BgpOriginAttrType - // original -> bgp-pol:set-local-pref - SetLocalPref uint32 - // original -> bgp-pol:set-next-hop - SetNextHop BgpNextHopType - // original -> bgp-pol:set-med - SetMed BgpSetMedType -} - -//struct for container rpol:igp-actions -type IgpActions struct { - // original -> rpol:set-tag - SetTag IgpTagType +//struct for container bgp:state +type PeerGroupState struct { + // original -> bgp:peer-as + //bgp:peer-as's original type is inet:as-number + PeerAs uint32 + // original -> bgp:local-as + //bgp:local-as's original type is inet:as-number + LocalAs uint32 + // original -> bgp:peer-type + PeerType PeerTypeDef + // original -> bgp:auth-password + AuthPassword string + // original -> bgp:remove-private-as + RemovePrivateAs RemovePrivateAsOption + // original -> bgp:route-flap-damping + //bgp:route-flap-damping's original type is boolean + RouteFlapDamping bool + // original -> bgp:send-community + SendCommunity CommunityType + // original -> bgp:description + Description string + // original -> bgp:peer-group-name + PeerGroupName string + // original -> bgp-op:total-paths + TotalPaths uint32 + // original -> bgp-op:total-prefixes + TotalPrefixes uint32 } -//struct for container rpol:actions -type Actions struct { - // original -> rpol:accept-route - //rpol:accept-route's original type is empty - AcceptRoute bool - // original -> rpol:reject-route - //rpol:reject-route's original type is empty - RejectRoute bool - // original -> rpol:igp-actions - IgpActions IgpActions - // original -> bgp-pol:bgp-actions - BgpActions BgpActions +//struct for container bgp:config +type PeerGroupConfig struct { + // original -> bgp:peer-as + //bgp:peer-as's original type is inet:as-number + PeerAs uint32 + // original -> bgp:local-as + //bgp:local-as's original type is inet:as-number + LocalAs uint32 + // original -> bgp:peer-type + PeerType PeerTypeDef + // original -> bgp:auth-password + AuthPassword string + // original -> bgp:remove-private-as + RemovePrivateAs RemovePrivateAsOption + // original -> bgp:route-flap-damping + //bgp:route-flap-damping's original type is boolean + RouteFlapDamping bool + // original -> bgp:send-community + SendCommunity CommunityType + // original -> bgp:description + Description string + // original -> bgp:peer-group-name + PeerGroupName string } -//struct for container bgp-pol:as-path-length -type AsPathLength struct { - // original -> ptypes:operator - Operator string - // original -> ptypes:value - Value uint32 +//struct for container bgp:peer-group +type PeerGroup struct { + // original -> bgp:peer-group-name + PeerGroupName string + // original -> bgp:peer-group-config + PeerGroupConfig PeerGroupConfig + // original -> bgp:peer-group-state + PeerGroupState PeerGroupState + // original -> bgp:timers + Timers Timers + // original -> bgp:transport + Transport Transport + // original -> bgp:error-handling + ErrorHandling ErrorHandling + // original -> bgp:logging-options + LoggingOptions LoggingOptions + // original -> bgp:ebgp-multihop + EbgpMultihop EbgpMultihop + // original -> bgp:route-reflector + RouteReflector RouteReflector + // original -> bgp:route-server + RouteServer RouteServer + // original -> bgp:as-path-options + AsPathOptions AsPathOptions + // original -> bgp:add-paths + AddPaths AddPaths + // original -> bgp:afi-safis + AfiSafis AfiSafis + // original -> bgp:graceful-restart + GracefulRestart GracefulRestart + // original -> rpol:apply-policy + ApplyPolicy ApplyPolicy + // original -> bgp-mp:use-multiple-paths + UseMultiplePaths UseMultiplePaths } -//struct for container bgp-pol:community-count -type CommunityCount struct { - // original -> ptypes:operator - Operator string - // original -> ptypes:value - Value uint32 +//struct for container bgp:peer-groups +type PeerGroups struct { + // original -> bgp:peer-group + PeerGroupList []PeerGroup } -//struct for container bgp-pol:bgp-conditions -type BgpConditions struct { - // original -> bgp-pol:match-community-set - MatchCommunitySet string - // original -> bgp-pol:match-ext-community-set - MatchExtCommunitySet string - // original -> bgp-pol:match-as-path-set - MatchAsPathSet string - // original -> bgp-pol:med-eq - MedEq uint32 - // original -> bgp-pol:origin-eq - OriginEq BgpOriginAttrType - // original -> bgp-pol:next-hop-in - //original type is list of inet:ip-address - NextHopIn []net.IP - // original -> bgp-pol:local-pref-eq - LocalPrefEq uint32 - // original -> bgp-pol:community-count - CommunityCount CommunityCount - // original -> bgp-pol:as-path-length - AsPathLength AsPathLength - // original -> bgp-pol:route-type - //bgp-pol:route-type's original type is enumeration - RouteType string +//struct for container bgp-op:prefixes +type Prefixes struct { + // original -> bgp-op:received + Received uint32 + // original -> bgp-op:sent + Sent uint32 + // original -> bgp-op:installed + Installed uint32 } -//struct for container rpol:igp-conditions -type IgpConditions struct { - // original -> rpol:tag-eq - TagEq IgpTagType +//struct for container bgp:state +type AddPathsState struct { + // original -> bgp:receive + //bgp:receive's original type is boolean + Receive bool + // original -> bgp:send-max + SendMax uint8 } -//struct for container rpol:conditions -type Conditions struct { - // original -> rpol:call-policy - CallPolicy string - // original -> rpol:match-prefix-set - MatchPrefixSet string - // original -> rpol:match-neighbor-set - MatchNeighborSet string - // original -> rpol:match-set-options - MatchSetOptions MatchSetOptionsType - // original -> rpol:install-protocol-eq - InstallProtocolEq InstallProtocolType - // original -> rpol:igp-conditions - IgpConditions IgpConditions - // original -> bgp-pol:bgp-conditions - BgpConditions BgpConditions +//struct for container bgp:config +type AddPathsConfig struct { + // original -> bgp:receive + //bgp:receive's original type is boolean + Receive bool + // original -> bgp:send-max + SendMax uint8 } -//struct for container rpol:statement -type Statement struct { - // original -> rpol:name - Name string - // original -> rpol:conditions - Conditions Conditions - // original -> rpol:actions - Actions Actions +//struct for container bgp:add-paths +type AddPaths struct { + // original -> bgp:add-paths-config + AddPathsConfig AddPathsConfig + // original -> bgp:add-paths-state + AddPathsState AddPathsState } -//struct for container rpol:policy-definition -type PolicyDefinition struct { - // original -> rpol:name - Name string - // original -> rpol:statement - StatementList []Statement +//struct for container bgp:state +type AsPathOptionsState struct { + // original -> bgp:allow-own-as + AllowOwnAs uint8 + // original -> bgp:replace-peer-as + //bgp:replace-peer-as's original type is boolean + ReplacePeerAs bool } -//struct for container bgp-pol:as-path-set -type AsPathSet struct { - // original -> bgp-pol:as-path-set-name - AsPathSetName string - // original -> bgp-pol:as-path-set-members - AsPathSetMembers []string +//struct for container bgp:config +type AsPathOptionsConfig struct { + // original -> bgp:allow-own-as + AllowOwnAs uint8 + // original -> bgp:replace-peer-as + //bgp:replace-peer-as's original type is boolean + ReplacePeerAs bool } -//struct for container bgp-pol:ext-community-set -type ExtCommunitySet struct { - // original -> bgp-pol:ext-community-set-name - ExtCommunitySetName string - // original -> bgp-pol:ext-community-members - //original type is list of union - ExtCommunityMembers []string +//struct for container bgp:as-path-options +type AsPathOptions struct { + // original -> bgp:as-path-options-config + AsPathOptionsConfig AsPathOptionsConfig + // original -> bgp:as-path-options-state + AsPathOptionsState AsPathOptionsState } -//struct for container bgp-pol:community-set -type CommunitySet struct { - // original -> bgp-pol:community-set-name - CommunitySetName string - // original -> bgp-pol:community-members - //original type is list of union - CommunityMembers []string +//struct for container bgp:route-server +type RouteServer struct { + // original -> bgp:route-server-client + //bgp:route-server-client's original type is boolean + RouteServerClient bool } -//struct for container bgp-pol:bgp-defined-sets -type BgpDefinedSets struct { - // original -> bgp-pol:community-set - CommunitySetList []CommunitySet - // original -> bgp-pol:ext-community-set - ExtCommunitySetList []ExtCommunitySet - // original -> bgp-pol:as-path-set - AsPathSetList []AsPathSet +//struct for container bgp:state +type RouteReflectorState struct { + // original -> bgp:route-reflector-cluster-id + RouteReflectorClusterId RrClusterIdType + // original -> bgp:route-reflector-client + //bgp:route-reflector-client's original type is boolean + RouteReflectorClient bool } -//struct for container rpol:neighbor-info -type NeighborInfo struct { - // original -> rpol:address - //rpol:address's original type is inet:ip-address - Address net.IP +//struct for container bgp:config +type RouteReflectorConfig struct { + // original -> bgp:route-reflector-cluster-id + RouteReflectorClusterId RrClusterIdType + // original -> bgp:route-reflector-client + //bgp:route-reflector-client's original type is boolean + RouteReflectorClient bool } -//struct for container rpol:neighbor-set -type NeighborSet struct { - // original -> rpol:neighbor-set-name - NeighborSetName string - // original -> rpol:neighbor-info - NeighborInfoList []NeighborInfo +//struct for container bgp:route-reflector +type RouteReflector struct { + // original -> bgp:route-reflector-config + RouteReflectorConfig RouteReflectorConfig + // original -> bgp:route-reflector-state + RouteReflectorState RouteReflectorState } -//struct for container rpol:prefix -type Prefix struct { - // original -> rpol:address - //rpol:address's original type is inet:ip-address - Address net.IP - // original -> rpol:masklength - Masklength uint8 - // original -> rpol:masklength-range - MasklengthRange string +//struct for container bgp:state +type EbgpMultihopState struct { + // original -> bgp:enabled + //bgp:enabled's original type is boolean + Enabled bool + // original -> bgp:multihop-ttl + MultihopTtl uint8 } -//struct for container rpol:prefix-set -type PrefixSet struct { - // original -> rpol:prefix-set-name - PrefixSetName string - // original -> rpol:prefix - PrefixList []Prefix +//struct for container bgp:config +type EbgpMultihopConfig struct { + // original -> bgp:enabled + //bgp:enabled's original type is boolean + Enabled bool + // original -> bgp:multihop-ttl + MultihopTtl uint8 } -//struct for container rpol:defined-sets -type DefinedSets struct { - // original -> rpol:prefix-set - PrefixSetList []PrefixSet - // original -> rpol:neighbor-set - NeighborSetList []NeighborSet - // original -> bgp-pol:bgp-defined-sets - BgpDefinedSets BgpDefinedSets +//struct for container bgp:ebgp-multihop +type EbgpMultihop struct { + // original -> bgp:ebgp-multihop-config + EbgpMultihopConfig EbgpMultihopConfig + // original -> bgp:ebgp-multihop-state + EbgpMultihopState EbgpMultihopState } -//struct for container rpol:routing-policy -type RoutingPolicy struct { - // original -> rpol:defined-sets - DefinedSets DefinedSets - // original -> rpol:policy-definition - PolicyDefinitionList []PolicyDefinition +//struct for container bgp:state +type LoggingOptionsState struct { + // original -> bgp:log-neighbor-state-changes + //bgp:log-neighbor-state-changes's original type is boolean + LogNeighborStateChanges bool } -//struct for container rpol:apply-policy -type ApplyPolicy struct { - // original -> rpol:import-policies - ImportPolicies []string - // original -> rpol:default-import-policy - DefaultImportPolicy DefaultPolicyType - // original -> rpol:export-policies - ExportPolicies []string - // original -> rpol:default-export-policy - DefaultExportPolicy DefaultPolicyType - // original -> rpol:distribute-policies - DistributePolicies []string - // original -> rpol:default-distribute-policy - DefaultDistributePolicy DefaultPolicyType +//struct for container bgp:config +type LoggingOptionsConfig struct { + // original -> bgp:log-neighbor-state-changes + //bgp:log-neighbor-state-changes's original type is boolean + LogNeighborStateChanges bool } -//struct for container bgp-op:bgp-neighbor-common-state -type BgpNeighborCommonState struct { - // original -> bgp-op:state - State uint32 - // original -> bgp-op:uptime - Uptime int64 - // original -> bgp-op:downtime - Downtime int64 - // original -> bgp-op:open-in - OpenIn uint32 - // original -> bgp-op:open-out - OpenOut uint32 - // original -> bgp-op:update-in - UpdateIn uint32 - // original -> bgp-op:update-out - UpdateOut uint32 - // original -> bgp-op:update-recv-time - UpdateRecvTime int64 - // original -> bgp-op:keepalive-in - KeepaliveIn uint32 - // original -> bgp-op:keepalive-out - KeepaliveOut uint32 - // original -> bgp-op:notify-in - NotifyIn uint32 - // original -> bgp-op:notify-out - NotifyOut uint32 - // original -> bgp-op:refresh-in - RefreshIn uint32 - // original -> bgp-op:refresh-out - RefreshOut uint32 - // original -> bgp-op:dynamic-cap-in - DynamicCapIn uint32 - // original -> bgp-op:dynamic-cap-out - DynamicCapOut uint32 - // original -> bgp-op:discarded-in - DiscardedIn uint32 - // original -> bgp-op:discarded-out - DiscardedOut uint32 - // original -> bgp-op:total-in - TotalIn uint32 - // original -> bgp-op:total-out - TotalOut uint32 - // original -> bgp-op:established-count - EstablishedCount uint32 - // original -> bgp-op:flops - Flops uint32 +//struct for container bgp:logging-options +type LoggingOptions struct { + // original -> bgp:logging-options-config + LoggingOptionsConfig LoggingOptionsConfig + // original -> bgp:logging-options-state + LoggingOptionsState LoggingOptionsState } -//struct for container bgp:add-paths -type AddPaths struct { - // original -> bgp:receive - //bgp:receive's original type is empty - Receive bool - // original -> bgp:send-max - SendMax uint8 +//struct for container bgp:state +type ErrorHandlingState struct { + // original -> bgp:treat-as-withdraw + //bgp:treat-as-withdraw's original type is boolean + TreatAsWithdraw bool + // original -> bgp-op:erroneous-update-messages + ErroneousUpdateMessages uint32 } -//struct for container bgp:as-path-options -type AsPathOptions struct { - // original -> bgp:allow-own-as - //bgp:allow-own-as's original type is boolean - AllowOwnAs bool - // original -> bgp:replace-peer-as - //bgp:replace-peer-as's original type is boolean - ReplacePeerAs bool +//struct for container bgp:config +type ErrorHandlingConfig struct { + // original -> bgp:treat-as-withdraw + //bgp:treat-as-withdraw's original type is boolean + TreatAsWithdraw bool } //struct for container bgp:error-handling type ErrorHandling struct { - // original -> bgp:treat-as-withdraw - //bgp:treat-as-withdraw's original type is boolean - TreatAsWithdraw bool + // original -> bgp:error-handling-config + ErrorHandlingConfig ErrorHandlingConfig + // original -> bgp:error-handling-state + ErrorHandlingState ErrorHandlingState } -//struct for container bgp:transport-options -type TransportOptions struct { +//struct for container bgp:state +type TransportState struct { // original -> bgp:tcp-mss TcpMss uint16 // original -> bgp:mtu-discovery @@ -466,266 +394,502 @@ type TransportOptions struct { // original -> bgp:passive-mode //bgp:passive-mode's original type is boolean PassiveMode bool + // original -> bgp:local-address + //bgp:local-address's original type is inet:ip-address + LocalAddress net.IP + // original -> bgp-op:local-port + //bgp-op:local-port's original type is inet:port-number + LocalPort uint16 + // original -> bgp-op:remote-address + //bgp-op:remote-address's original type is inet:ip-address + RemoteAddress net.IP + // original -> bgp-op:remote-port + //bgp-op:remote-port's original type is inet:port-number + RemotePort uint16 } -//struct for container bgp:bgp-logging-options -type BgpLoggingOptions struct { - // original -> bgp:log-neighbor-state-changes - //bgp:log-neighbor-state-changes's original type is boolean - LogNeighborStateChanges bool -} - -//struct for container bgp:route-server -type RouteServer struct { - // original -> bgp:route-server-client - //bgp:route-server-client's original type is boolean - RouteServerClient bool -} - -//struct for container bgp:route-reflector -type RouteReflector struct { - // original -> bgp:route-reflector-cluster-id - RouteReflectorClusterId RrClusterIdType - // original -> bgp:route-reflector-client - //bgp:route-reflector-client's original type is boolean - RouteReflectorClient bool +//struct for container bgp:config +type TransportConfig struct { + // original -> bgp:tcp-mss + TcpMss uint16 + // original -> bgp:mtu-discovery + //bgp:mtu-discovery's original type is boolean + MtuDiscovery bool + // original -> bgp:passive-mode + //bgp:passive-mode's original type is boolean + PassiveMode bool + // original -> bgp:local-address + //bgp:local-address's original type is inet:ip-address + LocalAddress net.IP } -//struct for container bgp:ebgp-multihop -type EbgpMultihop struct { - // original -> bgp:multihop-ttl - MultihopTtl uint8 +//struct for container bgp:transport +type Transport struct { + // original -> bgp:transport-config + TransportConfig TransportConfig + // original -> bgp:transport-state + TransportState TransportState } -//struct for container bgp:timers -type Timers struct { +//struct for container bgp:state +type TimersState struct { // original -> bgp:connect-retry //bgp:connect-retry's original type is decimal64 ConnectRetry float64 // original -> bgp:hold-time //bgp:hold-time's original type is decimal64 HoldTime float64 + // original -> bgp:keepalive-interval + //bgp:keepalive-interval's original type is decimal64 + KeepaliveInterval float64 // original -> bgp:idle-hold-time-after-reset //bgp:idle-hold-time-after-reset's original type is decimal64 IdleHoldTimeAfterReset float64 + // original -> bgp:minimum-advertisement-interval + //bgp:minimum-advertisement-interval's original type is decimal64 + MinimumAdvertisementInterval float64 + // original -> bgp-op:uptime + //bgp-op:uptime's original type is yang:timeticks + Uptime int64 + // original -> bgp-op:downtime + //bgp-op:downtime's original type is yang:timeticks + Downtime int64 + // original -> bgp-op:update-recv-time + UpdateRecvTime int64 + // original -> bgp-op:negotiated-hold-time + //bgp-op:negotiated-hold-time's original type is decimal64 + NegotiatedHoldTime float64 +} + +//struct for container bgp:config +type TimersConfig struct { + // original -> bgp:connect-retry + //bgp:connect-retry's original type is decimal64 + ConnectRetry float64 + // original -> bgp:hold-time + //bgp:hold-time's original type is decimal64 + HoldTime float64 // original -> bgp:keepalive-interval //bgp:keepalive-interval's original type is decimal64 KeepaliveInterval float64 + // original -> bgp:idle-hold-time-after-reset + //bgp:idle-hold-time-after-reset's original type is decimal64 + IdleHoldTimeAfterReset float64 // original -> bgp:minimum-advertisement-interval //bgp:minimum-advertisement-interval's original type is decimal64 MinimumAdvertisementInterval float64 - // original -> bgp:send-update-delay - //bgp:send-update-delay's original type is decimal64 - SendUpdateDelay float64 } -//struct for container bgp-mp:prefix-limit -type PrefixLimit struct { - // original -> bgp-mp:max-prefixes - MaxPrefixes uint32 - // original -> bgp-mp:shutdown-threshold-pct - ShutdownThresholdPct Percentage - // original -> bgp-mp:restart-timer - //bgp-mp:restart-timer's original type is decimal64 - RestartTimer float64 +//struct for container bgp:timers +type Timers struct { + // original -> bgp:timers-config + TimersConfig TimersConfig + // original -> bgp:timers-state + TimersState TimersState } -//struct for container bgp-mp:l2vpn-evpn -type L2vpnEvpn struct { +//struct for container bgp:queues +type Queues struct { + // original -> bgp-op:input + Input uint32 + // original -> bgp-op:output + Output uint32 +} + +//struct for container bgp:received +type Received struct { + // original -> bgp-op:UPDATE + Update uint64 + // original -> bgp-op:NOTIFICATION + Notification uint64 + // original -> bgp-op:OPEN + Open uint64 + // original -> bgp-op:REFRESH + Refresh uint64 + // original -> bgp-op:KEEPALIVE + Keepalive uint64 + // original -> bgp-op:DYNAMIC-CAP + DynamicCap uint64 + // original -> bgp-op:DISCARDED + Discarded uint64 + // original -> bgp-op:TOTAL + Total uint64 +} + +//struct for container bgp:sent +type Sent struct { + // original -> bgp-op:UPDATE + Update uint64 + // original -> bgp-op:NOTIFICATION + Notification uint64 + // original -> bgp-op:OPEN + Open uint64 + // original -> bgp-op:REFRESH + Refresh uint64 + // original -> bgp-op:KEEPALIVE + Keepalive uint64 + // original -> bgp-op:DYNAMIC-CAP + DynamicCap uint64 + // original -> bgp-op:DISCARDED + Discarded uint64 + // original -> bgp-op:TOTAL + Total uint64 +} + +//struct for container bgp:messages +type Messages struct { + // original -> bgp:sent + Sent Sent + // original -> bgp:received + Received Received +} + +//struct for container bgp:state +type NeighborState struct { + // original -> bgp:peer-as + //bgp:peer-as's original type is inet:as-number + PeerAs uint32 + // original -> bgp:local-as + //bgp:local-as's original type is inet:as-number + LocalAs uint32 + // original -> bgp:peer-type + PeerType PeerTypeDef + // original -> bgp:auth-password + AuthPassword string + // original -> bgp:remove-private-as + RemovePrivateAs RemovePrivateAsOption + // original -> bgp:route-flap-damping + //bgp:route-flap-damping's original type is boolean + RouteFlapDamping bool + // original -> bgp:send-community + SendCommunity CommunityType + // original -> bgp:description + Description string + // original -> bgp:peer-group + PeerGroup string + // original -> bgp:neighbor-address + //bgp:neighbor-address's original type is inet:ip-address + NeighborAddress net.IP + // original -> bgp-op:session-state + //bgp-op:session-state's original type is enumeration + SessionState uint32 + // original -> bgp-op:supported-capabilities + //original type is list of identityref + SupportedCapabilities []string + // original -> bgp-op:established-count + EstablishedCount uint32 + // original -> bgp-op:flops + Flops uint32 + // original -> bgp:messages + Messages Messages + // original -> bgp:queues + Queues Queues +} + +//struct for container bgp:config +type NeighborConfig struct { + // original -> bgp:peer-as + //bgp:peer-as's original type is inet:as-number + PeerAs uint32 + // original -> bgp:local-as + //bgp:local-as's original type is inet:as-number + LocalAs uint32 + // original -> bgp:peer-type + PeerType PeerTypeDef + // original -> bgp:auth-password + AuthPassword string + // original -> bgp:remove-private-as + RemovePrivateAs RemovePrivateAsOption + // original -> bgp:route-flap-damping + //bgp:route-flap-damping's original type is boolean + RouteFlapDamping bool + // original -> bgp:send-community + SendCommunity CommunityType + // original -> bgp:description + Description string + // original -> bgp:peer-group + PeerGroup string + // original -> bgp:neighbor-address + //bgp:neighbor-address's original type is inet:ip-address + NeighborAddress net.IP +} + +//struct for container bgp:neighbor +type Neighbor struct { + // original -> bgp:neighbor-address + //bgp:neighbor-address's original type is inet:ip-address + NeighborAddress net.IP + // original -> bgp:neighbor-config + NeighborConfig NeighborConfig + // original -> bgp:neighbor-state + NeighborState NeighborState + // original -> bgp:timers + Timers Timers + // original -> bgp:transport + Transport Transport + // original -> bgp:error-handling + ErrorHandling ErrorHandling + // original -> bgp:logging-options + LoggingOptions LoggingOptions + // original -> bgp:ebgp-multihop + EbgpMultihop EbgpMultihop + // original -> bgp:route-reflector + RouteReflector RouteReflector + // original -> bgp:route-server + RouteServer RouteServer + // original -> bgp:as-path-options + AsPathOptions AsPathOptions + // original -> bgp:add-paths + AddPaths AddPaths + // original -> bgp:afi-safis + AfiSafis AfiSafis + // original -> bgp:graceful-restart + GracefulRestart GracefulRestart // original -> rpol:apply-policy ApplyPolicy ApplyPolicy + // original -> bgp-mp:use-multiple-paths + UseMultiplePaths UseMultiplePaths +} + +//struct for container bgp:neighbors +type Neighbors struct { + // original -> bgp:neighbor + NeighborList []Neighbor +} + +//struct for container bgp-mp:l2vpn-evpn +type L2vpnEvpn struct { // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } //struct for container bgp-mp:l2vpn-vpls type L2vpnVpls struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } //struct for container bgp-mp:l3vpn-ipv6-multicast type L3vpnIpv6Multicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } //struct for container bgp-mp:l3vpn-ipv4-multicast type L3vpnIpv4Multicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } //struct for container bgp-mp:l3vpn-ipv6-unicast type L3vpnIpv6Unicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } //struct for container bgp-mp:l3vpn-ipv4-unicast type L3vpnIpv4Unicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } //struct for container bgp-mp:ipv6-labelled-unicast type Ipv6LabelledUnicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } //struct for container bgp-mp:ipv4-labelled-unicast type Ipv4LabelledUnicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit } -//struct for container bgp-mp:ipv6-multicast -type Ipv6Multicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy - // original -> bgp-mp:prefix-limit - PrefixLimit PrefixLimit +//struct for container bgp-mp:state +type Ipv6UnicastState struct { + // original -> bgp-mp:send-default-route + //bgp-mp:send-default-route's original type is boolean + SendDefaultRoute bool } -//struct for container bgp-mp:ipv4-multicast -type Ipv4Multicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy - // original -> bgp-mp:prefix-limit - PrefixLimit PrefixLimit +//struct for container bgp-mp:config +type Ipv6UnicastConfig struct { + // original -> bgp-mp:send-default-route + //bgp-mp:send-default-route's original type is boolean + SendDefaultRoute bool } //struct for container bgp-mp:ipv6-unicast type Ipv6Unicast struct { - // original -> bgp-mp:enabled - //bgp-mp:enabled's original type is boolean - Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy // original -> bgp-mp:prefix-limit PrefixLimit PrefixLimit + // original -> bgp-mp:ipv6-unicast-config + Ipv6UnicastConfig Ipv6UnicastConfig + // original -> bgp-mp:ipv6-unicast-state + Ipv6UnicastState Ipv6UnicastState +} + +//struct for container bgp-mp:state +type Ipv4UnicastState struct { + // original -> bgp-mp:send-default-route + //bgp-mp:send-default-route's original type is boolean + SendDefaultRoute bool +} + +//struct for container bgp-mp:config +type Ipv4UnicastConfig struct { // original -> bgp-mp:send-default-route //bgp-mp:send-default-route's original type is boolean SendDefaultRoute bool } +//struct for container bgp-mp:state +type PrefixLimitState struct { + // original -> bgp-mp:max-prefixes + MaxPrefixes uint32 + // original -> bgp-mp:shutdown-threshold-pct + ShutdownThresholdPct Percentage + // original -> bgp-mp:restart-timer + //bgp-mp:restart-timer's original type is decimal64 + RestartTimer float64 +} + +//struct for container bgp-mp:config +type PrefixLimitConfig struct { + // original -> bgp-mp:max-prefixes + MaxPrefixes uint32 + // original -> bgp-mp:shutdown-threshold-pct + ShutdownThresholdPct Percentage + // original -> bgp-mp:restart-timer + //bgp-mp:restart-timer's original type is decimal64 + RestartTimer float64 +} + +//struct for container bgp-mp:prefix-limit +type PrefixLimit struct { + // original -> bgp-mp:prefix-limit-config + PrefixLimitConfig PrefixLimitConfig + // original -> bgp-mp:prefix-limit-state + PrefixLimitState PrefixLimitState +} + //struct for container bgp-mp:ipv4-unicast type Ipv4Unicast struct { + // original -> bgp-mp:prefix-limit + PrefixLimit PrefixLimit + // original -> bgp-mp:ipv4-unicast-config + Ipv4UnicastConfig Ipv4UnicastConfig + // original -> bgp-mp:ipv4-unicast-state + Ipv4UnicastState Ipv4UnicastState +} + +//struct for container rpol:state +type ApplyPolicyState struct { + // original -> rpol:import-policy + ImportPolicy []string + // original -> rpol:default-import-policy + DefaultImportPolicy DefaultPolicyType + // original -> rpol:export-policy + ExportPolicy []string + // original -> rpol:default-export-policy + DefaultExportPolicy DefaultPolicyType + // original -> rpol:distribute-policy + DistributePolicy []string + // original -> rpol:default-distribute-policy + DefaultDistributePolicy DefaultPolicyType +} + +//struct for container rpol:config +type ApplyPolicyConfig struct { + // original -> rpol:import-policy + ImportPolicy []string + // original -> rpol:default-import-policy + DefaultImportPolicy DefaultPolicyType + // original -> rpol:export-policy + ExportPolicy []string + // original -> rpol:default-export-policy + DefaultExportPolicy DefaultPolicyType + // original -> rpol:distribute-policy + DistributePolicy []string + // original -> rpol:default-distribute-policy + DefaultDistributePolicy DefaultPolicyType +} + +//struct for container rpol:apply-policy +type ApplyPolicy struct { + // original -> rpol:apply-policy-config + ApplyPolicyConfig ApplyPolicyConfig + // original -> rpol:apply-policy-state + ApplyPolicyState ApplyPolicyState +} + +//struct for container bgp-mp:state +type AfiSafiState struct { + // original -> bgp-mp:afi-safi-name + AfiSafiName string // original -> bgp-mp:enabled //bgp-mp:enabled's original type is boolean Enabled bool - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy - // original -> bgp-mp:prefix-limit - PrefixLimit PrefixLimit - // original -> bgp-mp:send-default-route - //bgp-mp:send-default-route's original type is boolean - SendDefaultRoute bool + // original -> bgp-op:total-paths + TotalPaths uint32 + // original -> bgp-op:total-prefixes + TotalPrefixes uint32 } -//struct for container bgp-mp:ibgp -type Ibgp struct { - // original -> bgp-mp:maximum-paths - MaximumPaths uint32 +//struct for container bgp-mp:config +type AfiSafiConfig struct { + // original -> bgp-mp:afi-safi-name + AfiSafiName string + // original -> bgp-mp:enabled + //bgp-mp:enabled's original type is boolean + Enabled bool } -//struct for container bgp-mp:ebgp -type Ebgp struct { - // original -> bgp-mp:allow-multiple-as - //bgp-mp:allow-multiple-as's original type is boolean - AllowMultipleAs bool - // original -> bgp-mp:maximum-paths - MaximumPaths uint32 +//struct for container bgp-mp:state +type MpGracefulRestartState struct { + // original -> bgp-mp:enabled + //bgp-mp:enabled's original type is boolean + Enabled bool + // original -> bgp-op:received + //bgp-op:received's original type is boolean + Received bool + // original -> bgp-op:advertised + //bgp-op:advertised's original type is boolean + Advertised bool } -//struct for container bgp-mp:use-multiple-paths -type UseMultiplePaths struct { - // original -> bgp-mp:ebgp - Ebgp Ebgp - // original -> bgp-mp:ibgp - Ibgp Ibgp +//struct for container bgp-mp:config +type MpGracefulRestartConfig struct { + // original -> bgp-mp:enabled + //bgp-mp:enabled's original type is boolean + Enabled bool } -//struct for container bgp-mp:route-selection-options -type RouteSelectionOptions struct { - // original -> bgp-mp:always-compare-med - //bgp-mp:always-compare-med's original type is boolean - AlwaysCompareMed bool - // original -> bgp-mp:ignore-as-path-length - //bgp-mp:ignore-as-path-length's original type is boolean - IgnoreAsPathLength bool - // original -> bgp-mp:external-compare-router-id - //bgp-mp:external-compare-router-id's original type is boolean - ExternalCompareRouterId bool - // original -> bgp-mp:advertise-inactive-routes - //bgp-mp:advertise-inactive-routes's original type is boolean - AdvertiseInactiveRoutes bool - // original -> bgp-mp:enable-aigp - //bgp-mp:enable-aigp's original type is empty - EnableAigp bool - // original -> bgp-mp:ignore-next-hop-igp-metric - //bgp-mp:ignore-next-hop-igp-metric's original type is boolean - IgnoreNextHopIgpMetric bool +//struct for container bgp-mp:graceful-restart +type MpGracefulRestart struct { + // original -> bgp-mp:mp-graceful-restart-config + MpGracefulRestartConfig MpGracefulRestartConfig + // original -> bgp-mp:mp-graceful-restart-state + MpGracefulRestartState MpGracefulRestartState } //struct for container bgp-mp:afi-safi type AfiSafi struct { // original -> bgp-mp:afi-safi-name + //bgp-mp:afi-safi-name's original type is identityref AfiSafiName string - // original -> bgp-mp:route-selection-options - RouteSelectionOptions RouteSelectionOptions - // original -> bgp-mp:use-multiple-paths - UseMultiplePaths UseMultiplePaths + // original -> bgp-mp:mp-graceful-restart + MpGracefulRestart MpGracefulRestart + // original -> bgp-mp:afi-safi-config + AfiSafiConfig AfiSafiConfig + // original -> bgp-mp:afi-safi-state + AfiSafiState AfiSafiState + // original -> rpol:apply-policy + ApplyPolicy ApplyPolicy // original -> bgp-mp:ipv4-unicast Ipv4Unicast Ipv4Unicast // original -> bgp-mp:ipv6-unicast Ipv6Unicast Ipv6Unicast - // original -> bgp-mp:ipv4-multicast - Ipv4Multicast Ipv4Multicast - // original -> bgp-mp:ipv6-multicast - Ipv6Multicast Ipv6Multicast // original -> bgp-mp:ipv4-labelled-unicast Ipv4LabelledUnicast Ipv4LabelledUnicast // original -> bgp-mp:ipv6-labelled-unicast @@ -742,133 +906,144 @@ type AfiSafi struct { L2vpnVpls L2vpnVpls // original -> bgp-mp:l2vpn-evpn L2vpnEvpn L2vpnEvpn + // original -> bgp-mp:route-selection-options + RouteSelectionOptions RouteSelectionOptions + // original -> bgp-mp:use-multiple-paths + UseMultiplePaths UseMultiplePaths } -//struct for container bgp:graceful-restart -type GracefulRestart struct { +//struct for container bgp:afi-safis +type AfiSafis struct { + // original -> bgp-mp:afi-safi + AfiSafiList []AfiSafi +} + +//struct for container bgp:state +type GracefulRestartState struct { + // original -> bgp:enabled + //bgp:enabled's original type is boolean + Enabled bool // original -> bgp:restart-time RestartTime uint16 // original -> bgp:stale-routes-time //bgp:stale-routes-time's original type is decimal64 StaleRoutesTime float64 + // original -> bgp:helper-only + //bgp:helper-only's original type is boolean + HelperOnly bool + // original -> bgp-op:peer-restart-time + PeerRestartTime uint16 + // original -> bgp-op:peer-restarting + //bgp-op:peer-restarting's original type is boolean + PeerRestarting bool + // original -> bgp-op:local-restarting + //bgp-op:local-restarting's original type is boolean + LocalRestarting bool + // original -> bgp-op:mode + //bgp-op:mode's original type is enumeration + Mode uint32 } -//struct for container bgp:neighbor -type Neighbor struct { - // original -> bgp:neighbor-address - //bgp:neighbor-address's original type is inet:ip-address - NeighborAddress net.IP - // original -> bgp:peer-as - //bgp:peer-as's original type is inet:as-number - PeerAs uint32 - // original -> bgp:description - Description string - // original -> bgp:graceful-restart - GracefulRestart GracefulRestart - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy - // original -> bgp-mp:use-multiple-paths - UseMultiplePaths UseMultiplePaths - // original -> bgp-mp:afi-safi - AfiSafiList []AfiSafi - // original -> bgp:auth-password - AuthPassword string - // original -> bgp:peer-type - PeerType PeerTypeDef - // original -> bgp:timers - Timers Timers - // original -> bgp:ebgp-multihop - EbgpMultihop EbgpMultihop - // original -> bgp:route-reflector - RouteReflector RouteReflector - // original -> bgp:route-server - RouteServer RouteServer - // original -> bgp:remove-private-as - RemovePrivateAs RemovePrivateAsOption - // original -> bgp:bgp-logging-options - BgpLoggingOptions BgpLoggingOptions - // original -> bgp:transport-options - TransportOptions TransportOptions - // original -> bgp:local-address - //bgp:local-address's original type is inet:ip-address - LocalAddress net.IP - // original -> bgp:route-flap-damping - //bgp:route-flap-damping's original type is boolean - RouteFlapDamping bool - // original -> bgp:send-community - SendCommunity CommunityType - // original -> bgp:error-handling - ErrorHandling ErrorHandling - // original -> bgp:as-path-options - AsPathOptions AsPathOptions - // original -> bgp:add-paths - AddPaths AddPaths - // original -> bgp-op:bgp-neighbor-common-state - BgpNeighborCommonState BgpNeighborCommonState +//struct for container bgp:config +type GracefulRestartConfig struct { + // original -> bgp:enabled + //bgp:enabled's original type is boolean + Enabled bool + // original -> bgp:restart-time + RestartTime uint16 + // original -> bgp:stale-routes-time + //bgp:stale-routes-time's original type is decimal64 + StaleRoutesTime float64 + // original -> bgp:helper-only + //bgp:helper-only's original type is boolean + HelperOnly bool } -//struct for container bgp-op:bgp-group-common-state -type BgpGroupCommonState struct { +//struct for container bgp:graceful-restart +type GracefulRestart struct { + // original -> bgp:graceful-restart-config + GracefulRestartConfig GracefulRestartConfig + // original -> bgp:graceful-restart-state + GracefulRestartState GracefulRestartState } -//struct for container bgp:peer-group -type PeerGroup struct { - // original -> bgp:group-name - GroupName string - // original -> bgp-op:bgp-group-common-state - BgpGroupCommonState BgpGroupCommonState - // original -> bgp:description - Description string - // original -> bgp:graceful-restart - GracefulRestart GracefulRestart - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy - // original -> bgp-mp:use-multiple-paths - UseMultiplePaths UseMultiplePaths - // original -> bgp-mp:afi-safi - AfiSafiList []AfiSafi - // original -> bgp:auth-password - AuthPassword string - // original -> bgp:peer-type - PeerType PeerTypeDef - // original -> bgp:timers - Timers Timers - // original -> bgp:ebgp-multihop - EbgpMultihop EbgpMultihop - // original -> bgp:route-reflector - RouteReflector RouteReflector - // original -> bgp:route-server - RouteServer RouteServer - // original -> bgp:remove-private-as - RemovePrivateAs RemovePrivateAsOption - // original -> bgp:bgp-logging-options - BgpLoggingOptions BgpLoggingOptions - // original -> bgp:transport-options - TransportOptions TransportOptions - // original -> bgp:local-address - //bgp:local-address's original type is inet:ip-address - LocalAddress net.IP - // original -> bgp:route-flap-damping - //bgp:route-flap-damping's original type is boolean - RouteFlapDamping bool - // original -> bgp:send-community - SendCommunity CommunityType - // original -> bgp:error-handling - ErrorHandling ErrorHandling - // original -> bgp:as-path-options - AsPathOptions AsPathOptions - // original -> bgp:add-paths - AddPaths AddPaths - // original -> bgp:neighbor - NeighborList []Neighbor +//struct for container bgp-mp:state +type IbgpState struct { + // original -> bgp-mp:maximum-paths + MaximumPaths uint32 } -//struct for container bgp-op:bgp-global-state -type BgpGlobalState struct { +//struct for container bgp-mp:config +type IbgpConfig struct { + // original -> bgp-mp:maximum-paths + MaximumPaths uint32 } -//struct for container bgp:confederation -type Confederation struct { +//struct for container bgp-mp:ibgp +type Ibgp struct { + // original -> bgp-mp:ibgp-config + IbgpConfig IbgpConfig + // original -> bgp-mp:ibgp-state + IbgpState IbgpState +} + +//struct for container bgp-mp:state +type EbgpState struct { + // original -> bgp-mp:allow-multiple-as + //bgp-mp:allow-multiple-as's original type is boolean + AllowMultipleAs bool + // original -> bgp-mp:maximum-paths + MaximumPaths uint32 +} + +//struct for container bgp-mp:config +type EbgpConfig struct { + // original -> bgp-mp:allow-multiple-as + //bgp-mp:allow-multiple-as's original type is boolean + AllowMultipleAs bool + // original -> bgp-mp:maximum-paths + MaximumPaths uint32 +} + +//struct for container bgp-mp:ebgp +type Ebgp struct { + // original -> bgp-mp:ebgp-config + EbgpConfig EbgpConfig + // original -> bgp-mp:ebgp-state + EbgpState EbgpState +} + +//struct for container bgp-mp:state +type UseMultiplePathsState struct { + // original -> bgp-mp:enabled + //bgp-mp:enabled's original type is boolean + Enabled bool +} + +//struct for container bgp-mp:config +type UseMultiplePathsConfig struct { + // original -> bgp-mp:enabled + //bgp-mp:enabled's original type is boolean + Enabled bool +} + +//struct for container bgp-mp:use-multiple-paths +type UseMultiplePaths struct { + // original -> bgp-mp:use-multiple-paths-config + UseMultiplePathsConfig UseMultiplePathsConfig + // original -> bgp-mp:use-multiple-paths-state + UseMultiplePathsState UseMultiplePathsState + // original -> bgp-mp:ebgp + Ebgp Ebgp + // original -> bgp-mp:ibgp + Ibgp Ibgp +} + +//struct for container bgp:state +type ConfederationState struct { + // original -> bgp:enabled + //bgp:enabled's original type is boolean + Enabled bool // original -> bgp:identifier //bgp:identifier's original type is inet:as-number Identifier uint32 @@ -877,42 +1052,524 @@ type Confederation struct { MemberAs []uint32 } -//struct for container bgp:default-route-distance -type DefaultRouteDistance struct { +//struct for container bgp:config +type ConfederationConfig struct { + // original -> bgp:enabled + //bgp:enabled's original type is boolean + Enabled bool + // original -> bgp:identifier + //bgp:identifier's original type is inet:as-number + Identifier uint32 + // original -> bgp:member-as + //original type is list of inet:as-number + MemberAs []uint32 +} + +//struct for container bgp:confederation +type Confederation struct { + // original -> bgp:confederation-config + ConfederationConfig ConfederationConfig + // original -> bgp:confederation-state + ConfederationState ConfederationState +} + +//struct for container bgp:state +type DefaultRouteDistanceState struct { // original -> bgp:external-route-distance ExternalRouteDistance uint8 // original -> bgp:internal-route-distance InternalRouteDistance uint8 } -//struct for container bgp:global -type Global struct { +//struct for container bgp:config +type DefaultRouteDistanceConfig struct { + // original -> bgp:external-route-distance + ExternalRouteDistance uint8 + // original -> bgp:internal-route-distance + InternalRouteDistance uint8 +} + +//struct for container bgp:default-route-distance +type DefaultRouteDistance struct { + // original -> bgp:default-route-distance-config + DefaultRouteDistanceConfig DefaultRouteDistanceConfig + // original -> bgp:default-route-distance-state + DefaultRouteDistanceState DefaultRouteDistanceState +} + +//struct for container bgp-mp:state +type RouteSelectionOptionsState struct { + // original -> bgp-mp:always-compare-med + //bgp-mp:always-compare-med's original type is boolean + AlwaysCompareMed bool + // original -> bgp-mp:ignore-as-path-length + //bgp-mp:ignore-as-path-length's original type is boolean + IgnoreAsPathLength bool + // original -> bgp-mp:external-compare-router-id + //bgp-mp:external-compare-router-id's original type is boolean + ExternalCompareRouterId bool + // original -> bgp-mp:advertise-inactive-routes + //bgp-mp:advertise-inactive-routes's original type is boolean + AdvertiseInactiveRoutes bool + // original -> bgp-mp:enable-aigp + //bgp-mp:enable-aigp's original type is boolean + EnableAigp bool + // original -> bgp-mp:ignore-next-hop-igp-metric + //bgp-mp:ignore-next-hop-igp-metric's original type is boolean + IgnoreNextHopIgpMetric bool +} + +//struct for container bgp-mp:config +type RouteSelectionOptionsConfig struct { + // original -> bgp-mp:always-compare-med + //bgp-mp:always-compare-med's original type is boolean + AlwaysCompareMed bool + // original -> bgp-mp:ignore-as-path-length + //bgp-mp:ignore-as-path-length's original type is boolean + IgnoreAsPathLength bool + // original -> bgp-mp:external-compare-router-id + //bgp-mp:external-compare-router-id's original type is boolean + ExternalCompareRouterId bool + // original -> bgp-mp:advertise-inactive-routes + //bgp-mp:advertise-inactive-routes's original type is boolean + AdvertiseInactiveRoutes bool + // original -> bgp-mp:enable-aigp + //bgp-mp:enable-aigp's original type is boolean + EnableAigp bool + // original -> bgp-mp:ignore-next-hop-igp-metric + //bgp-mp:ignore-next-hop-igp-metric's original type is boolean + IgnoreNextHopIgpMetric bool +} + +//struct for container bgp-mp:route-selection-options +type RouteSelectionOptions struct { + // original -> bgp-mp:route-selection-options-config + RouteSelectionOptionsConfig RouteSelectionOptionsConfig + // original -> bgp-mp:route-selection-options-state + RouteSelectionOptionsState RouteSelectionOptionsState +} + +//struct for container bgp:state +type GlobalState struct { + // original -> bgp:as + //bgp:as's original type is inet:as-number + As uint32 + // original -> bgp:router-id + //bgp:router-id's original type is inet:ipv4-address + RouterId net.IP + // original -> bgp-op:total-paths + TotalPaths uint32 + // original -> bgp-op:total-prefixes + TotalPrefixes uint32 +} + +//struct for container bgp:config +type GlobalConfig struct { // original -> bgp:as //bgp:as's original type is inet:as-number As uint32 // original -> bgp:router-id //bgp:router-id's original type is inet:ipv4-address RouterId net.IP +} + +//struct for container bgp:global +type Global struct { + // original -> bgp:global-config + GlobalConfig GlobalConfig + // original -> bgp:global-state + GlobalState GlobalState + // original -> bgp-mp:route-selection-options + RouteSelectionOptions RouteSelectionOptions // original -> bgp:default-route-distance DefaultRouteDistance DefaultRouteDistance // original -> bgp:confederation Confederation Confederation // original -> bgp-mp:use-multiple-paths UseMultiplePaths UseMultiplePaths - // original -> bgp-mp:afi-safi - AfiSafiList []AfiSafi - // original -> bgp-op:bgp-global-state - BgpGlobalState BgpGlobalState + // original -> bgp:graceful-restart + GracefulRestart GracefulRestart + // original -> bgp:afi-safis + AfiSafis AfiSafis + // original -> rpol:apply-policy + ApplyPolicy ApplyPolicy } //struct for container bgp:bgp type Bgp struct { // original -> bgp:global Global Global - // original -> bgp:peer-group - PeerGroupList []PeerGroup - // original -> bgp:neighbor - NeighborList []Neighbor - // original -> rpol:apply-policy - ApplyPolicy ApplyPolicy + // original -> bgp:neighbors + Neighbors Neighbors + // original -> bgp:peer-groups + PeerGroups PeerGroups +} + +//struct for container bgp-pol:set-ext-community-method +type SetExtCommunityMethod struct { + // original -> bgp-pol:communities + //original type is list of union + Communities []string + // original -> bgp-pol:ext-community-set-ref + ExtCommunitySetRef string +} + +//struct for container bgp-pol:set-ext-community +type SetExtCommunity struct { + // original -> bgp-pol:set-ext-community-method + SetExtCommunityMethod SetExtCommunityMethod + // original -> bgp-pol:options + //bgp-pol:options's original type is bgp-set-community-option-type + Options string +} + +//struct for container bgp-pol:set-community-method +type SetCommunityMethod struct { + // original -> bgp-pol:communities + //original type is list of union + Communities []string + // original -> bgp-pol:community-set-ref + CommunitySetRef string +} + +//struct for container bgp-pol:set-community +type SetCommunity struct { + // original -> bgp-pol:set-community-method + SetCommunityMethod SetCommunityMethod + // original -> bgp-pol:options + //bgp-pol:options's original type is bgp-set-community-option-type + Options string +} + +//struct for container bgp-pol:set-as-path-prepend +type SetAsPathPrepend struct { + // original -> bgp-pol:as + //bgp-pol:as's original type is union + As string + // original -> bgp-pol:repeat-n + RepeatN uint8 +} + +//struct for container bgp-pol:bgp-actions +type BgpActions struct { + // original -> bgp-pol:set-as-path-prepend + SetAsPathPrepend SetAsPathPrepend + // original -> bgp-pol:set-community + SetCommunity SetCommunity + // original -> bgp-pol:set-ext-community + SetExtCommunity SetExtCommunity + // original -> bgp-pol:set-route-origin + SetRouteOrigin BgpOriginAttrType + // original -> bgp-pol:set-local-pref + SetLocalPref uint32 + // original -> bgp-pol:set-next-hop + SetNextHop BgpNextHopType + // original -> bgp-pol:set-med + SetMed BgpSetMedType +} + +//struct for container rpol:igp-actions +type IgpActions struct { + // original -> rpol:set-tag + SetTag TagType +} + +//struct for container rpol:route-disposition +type RouteDisposition struct { + // original -> rpol:accept-route + //rpol:accept-route's original type is empty + AcceptRoute bool + // original -> rpol:reject-route + //rpol:reject-route's original type is empty + RejectRoute bool +} + +//struct for container rpol:actions +type Actions struct { + // original -> rpol:route-disposition + RouteDisposition RouteDisposition + // original -> rpol:igp-actions + IgpActions IgpActions + // original -> bgp-pol:bgp-actions + BgpActions BgpActions +} + +//struct for container bgp-pol:as-path-length +type AsPathLength struct { + // original -> ptypes:operator + Operator string + // original -> ptypes:value + Value uint32 +} + +//struct for container bgp-pol:community-count +type CommunityCount struct { + // original -> ptypes:operator + Operator string + // original -> ptypes:value + Value uint32 +} + +//struct for container bgp-pol:match-as-path-set +type MatchAsPathSet struct { + // original -> bgp-pol:as-path-set + AsPathSet string + // original -> rpol:match-set-options + MatchSetOptions MatchSetOptionsType +} + +//struct for container bgp-pol:match-ext-community-set +type MatchExtCommunitySet struct { + // original -> bgp-pol:ext-community-set + ExtCommunitySet string + // original -> rpol:match-set-options + MatchSetOptions MatchSetOptionsType +} + +//struct for container bgp-pol:match-community-set +type MatchCommunitySet struct { + // original -> bgp-pol:community-set + CommunitySet string + // original -> rpol:match-set-options + MatchSetOptions MatchSetOptionsType +} + +//struct for container bgp-pol:bgp-conditions +type BgpConditions struct { + // original -> bgp-pol:match-community-set + MatchCommunitySet MatchCommunitySet + // original -> bgp-pol:match-ext-community-set + MatchExtCommunitySet MatchExtCommunitySet + // original -> bgp-pol:match-as-path-set + MatchAsPathSet MatchAsPathSet + // original -> bgp-pol:med-eq + MedEq uint32 + // original -> bgp-pol:origin-eq + OriginEq BgpOriginAttrType + // original -> bgp-pol:next-hop-in + //original type is list of inet:ip-address + NextHopIn []net.IP + // original -> bgp-pol:local-pref-eq + LocalPrefEq uint32 + // original -> bgp-pol:community-count + CommunityCount CommunityCount + // original -> bgp-pol:as-path-length + AsPathLength AsPathLength + // original -> bgp-pol:route-type + //bgp-pol:route-type's original type is enumeration + RouteType uint32 +} + +//struct for container rpol:igp-conditions +type IgpConditions struct { +} + +//struct for container rpol:match-tag-set +type MatchTagSet struct { + // original -> rpol:tag-set + TagSet string + // original -> rpol:match-set-options + MatchSetOptions MatchSetOptionsRestrictedType +} + +//struct for container rpol:match-neighbor-set +type MatchNeighborSet struct { + // original -> rpol:neighbor-set + NeighborSet string + // original -> rpol:match-set-options + MatchSetOptions MatchSetOptionsRestrictedType +} + +//struct for container rpol:match-prefix-set +type MatchPrefixSet struct { + // original -> rpol:prefix-set + PrefixSet string + // original -> rpol:match-set-options + MatchSetOptions MatchSetOptionsRestrictedType +} + +//struct for container rpol:conditions +type Conditions struct { + // original -> rpol:call-policy + CallPolicy string + // original -> rpol:match-prefix-set + MatchPrefixSet MatchPrefixSet + // original -> rpol:match-neighbor-set + MatchNeighborSet MatchNeighborSet + // original -> rpol:match-tag-set + MatchTagSet MatchTagSet + // original -> rpol:install-protocol-eq + InstallProtocolEq string + // original -> rpol:igp-conditions + IgpConditions IgpConditions + // original -> bgp-pol:bgp-conditions + BgpConditions BgpConditions +} + +//struct for container rpol:statement +type Statement struct { + // original -> rpol:name + Name string + // original -> rpol:conditions + Conditions Conditions + // original -> rpol:actions + Actions Actions +} + +//struct for container rpol:statements +type Statements struct { + // original -> rpol:statement + StatementList []Statement +} + +//struct for container rpol:policy-definition +type PolicyDefinition struct { + // original -> rpol:name + Name string + // original -> rpol:statements + Statements Statements +} + +//struct for container rpol:policy-definitions +type PolicyDefinitions struct { + // original -> rpol:policy-definition + PolicyDefinitionList []PolicyDefinition +} + +//struct for container bgp-pol:as-path-set +type AsPathSet struct { + // original -> bgp-pol:as-path-set-name + AsPathSetName string + // original -> bgp-pol:as-path-set-member + AsPathSetMember []string +} + +//struct for container bgp-pol:as-path-sets +type AsPathSets struct { + // original -> bgp-pol:as-path-set + AsPathSetList []AsPathSet +} + +//struct for container bgp-pol:ext-community-set +type ExtCommunitySet struct { + // original -> bgp-pol:ext-community-set-name + ExtCommunitySetName string + // original -> bgp-pol:ext-community-member + //original type is list of union + ExtCommunityMember []string +} + +//struct for container bgp-pol:ext-community-sets +type ExtCommunitySets struct { + // original -> bgp-pol:ext-community-set + ExtCommunitySetList []ExtCommunitySet +} + +//struct for container bgp-pol:community-set +type CommunitySet struct { + // original -> bgp-pol:community-set-name + CommunitySetName string + // original -> bgp-pol:community-member + //original type is list of union + CommunityMember []string +} + +//struct for container bgp-pol:community-sets +type CommunitySets struct { + // original -> bgp-pol:community-set + CommunitySetList []CommunitySet +} + +//struct for container bgp-pol:bgp-defined-sets +type BgpDefinedSets struct { + // original -> bgp-pol:community-sets + CommunitySets CommunitySets + // original -> bgp-pol:ext-community-sets + ExtCommunitySets ExtCommunitySets + // original -> bgp-pol:as-path-sets + AsPathSets AsPathSets +} + +//struct for container rpol:tag +type Tag struct { + // original -> rpol:value + Value TagType +} + +//struct for container rpol:tag-set +type TagSet struct { + // original -> rpol:tag-set-name + TagSetName string + // original -> rpol:tag + TagList []Tag +} + +//struct for container rpol:tag-sets +type TagSets struct { + // original -> rpol:tag-set + TagSetList []TagSet +} + +//struct for container rpol:neighbor-info +type NeighborInfo struct { + // original -> rpol:address + //rpol:address's original type is inet:ip-address + Address net.IP +} + +//struct for container rpol:neighbor-set +type NeighborSet struct { + // original -> rpol:neighbor-set-name + NeighborSetName string + // original -> rpol:neighbor-info + NeighborInfoList []NeighborInfo +} + +//struct for container rpol:neighbor-sets +type NeighborSets struct { + // original -> rpol:neighbor-set + NeighborSetList []NeighborSet +} + +//struct for container rpol:prefix +type Prefix struct { + // original -> rpol:ip-prefix + //rpol:ip-prefix's original type is inet:ip-prefix + IpPrefix net.IPNet + // original -> rpol:masklength-range + MasklengthRange string +} + +//struct for container rpol:prefix-set +type PrefixSet struct { + // original -> rpol:prefix-set-name + PrefixSetName string + // original -> rpol:prefix + PrefixList []Prefix +} + +//struct for container rpol:prefix-sets +type PrefixSets struct { + // original -> rpol:prefix-set + PrefixSetList []PrefixSet +} + +//struct for container rpol:defined-sets +type DefinedSets struct { + // original -> rpol:prefix-sets + PrefixSets PrefixSets + // original -> rpol:neighbor-sets + NeighborSets NeighborSets + // original -> rpol:tag-sets + TagSets TagSets + // original -> bgp-pol:bgp-defined-sets + BgpDefinedSets BgpDefinedSets +} + +//struct for container rpol:routing-policy +type RoutingPolicy struct { + // original -> rpol:defined-sets + DefinedSets DefinedSets + // original -> rpol:policy-definitions + PolicyDefinitions PolicyDefinitions } diff --git a/config/default.go b/config/default.go index f0c37f66..cdb37c32 100644 --- a/config/default.go +++ b/config/default.go @@ -29,8 +29,8 @@ func SetDefaultConfigValues(md toml.MetaData, bt *Bgp) error { } } - if _, ok := global["Global.AfiSafiList"]; !ok { - bt.Global.AfiSafiList = []AfiSafi{ + if _, ok := global["Global.AfiSafis.AfiSafiList"]; !ok { + bt.Global.AfiSafis.AfiSafiList = []AfiSafi{ AfiSafi{AfiSafiName: "ipv4-unicast"}, AfiSafi{AfiSafiName: "ipv6-unicast"}, AfiSafi{AfiSafiName: "l3vpn-ipv4-unicast"}, @@ -43,10 +43,10 @@ func SetDefaultConfigValues(md toml.MetaData, bt *Bgp) error { nidx := 0 for _, key := range md.Keys() { - if !strings.HasPrefix(key.String(), "NeighborList") { + if !strings.HasPrefix(key.String(), "Neighbors.NeighborList") { continue } - if key.String() == "NeighborList" { + if key.String() == "Neighbors.NeighborList" { neighbors = append(neighbors, neighbor{attributes: make(map[string]bool)}) nidx++ } else { @@ -54,30 +54,33 @@ func SetDefaultConfigValues(md toml.MetaData, bt *Bgp) error { } } for i, n := range neighbors { - if _, ok := n.attributes["NeighborList.Timers.ConnectRetry"]; !ok { - bt.NeighborList[i].Timers.HoldTime = float64(DEFAULT_CONNECT_RETRY) + neighbor := &bt.Neighbors.NeighborList[i] + timerConfig := &neighbor.Timers.TimersConfig + + if _, ok := n.attributes["Neighbors.NeighborList.Timers.TimersConfig.ConnectRetry"]; !ok { + timerConfig.HoldTime = float64(DEFAULT_CONNECT_RETRY) } - if _, ok := n.attributes["NeighborList.Timers.HoldTime"]; !ok { - bt.NeighborList[i].Timers.HoldTime = float64(DEFAULT_HOLDTIME) + if _, ok := n.attributes["Neighbors.NeighborList.Timers.TimersConfig.HoldTime"]; !ok { + timerConfig.HoldTime = float64(DEFAULT_HOLDTIME) } - if _, ok := n.attributes["NeighborList.Timers.KeepaliveInterval"]; !ok { - bt.NeighborList[i].Timers.KeepaliveInterval = bt.NeighborList[i].Timers.HoldTime / 3 + if _, ok := n.attributes["Neighbors.NeighborList.Timers.TimersConfig.KeepaliveInterval"]; !ok { + timerConfig.KeepaliveInterval = timerConfig.HoldTime / 3 } - if _, ok := n.attributes["NeighborList.Timers.IdleHoldTimeAfterReset"]; !ok { - bt.NeighborList[i].Timers.IdleHoldTimeAfterReset = float64(DEFAULT_IDLE_HOLDTIME_AFTER_RESET) + if _, ok := n.attributes["Neighbors.NeighborList.Timers.TimersConfig.IdleHoldTimeAfterReset"]; !ok { + timerConfig.IdleHoldTimeAfterReset = float64(DEFAULT_IDLE_HOLDTIME_AFTER_RESET) } - if _, ok := n.attributes["NeighborList.AfiSafiList"]; !ok { - if bt.NeighborList[i].NeighborAddress.To4() != nil { - bt.NeighborList[i].AfiSafiList = []AfiSafi{ + if _, ok := n.attributes["Neighbors.NeighborList.AfiSafis.AfiSafiList"]; !ok { + if neighbor.NeighborConfig.NeighborAddress.To4() != nil { + neighbor.AfiSafis.AfiSafiList = []AfiSafi{ AfiSafi{AfiSafiName: "ipv4-unicast"}} } else { - bt.NeighborList[i].AfiSafiList = []AfiSafi{ + neighbor.AfiSafis.AfiSafiList = []AfiSafi{ AfiSafi{AfiSafiName: "ipv6-unicast"}} } } else { - for _, rf := range bt.NeighborList[i].AfiSafiList { + for _, rf := range neighbor.AfiSafis.AfiSafiList { _, err := bgp.GetRouteFamily(rf.AfiSafiName) if err != nil { return err @@ -85,11 +88,11 @@ func SetDefaultConfigValues(md toml.MetaData, bt *Bgp) error { } } - if _, ok := n.attributes["NeighborList.PeerType"]; !ok { - if bt.NeighborList[i].PeerAs != bt.Global.As { - bt.NeighborList[i].PeerType = PEER_TYPE_EXTERNAL + if _, ok := n.attributes["Neighbors.NeighborList.NeighborConfig"]; !ok { + if neighbor.NeighborConfig.PeerAs != bt.Global.GlobalConfig.As { + neighbor.NeighborConfig.PeerType = PEER_TYPE_EXTERNAL } else { - bt.NeighborList[i].PeerType = PEER_TYPE_INTERNAL + neighbor.NeighborConfig.PeerType = PEER_TYPE_INTERNAL } } } diff --git a/config/serve.go b/config/serve.go index 390229c1..74529a16 100644 --- a/config/serve.go +++ b/config/serve.go @@ -37,7 +37,7 @@ func ReadConfigfileServe(path string, configCh chan BgpConfigSet, reloadCh chan func inSlice(n Neighbor, b []Neighbor) bool { for _, nb := range b { - if nb.NeighborAddress.String() == n.NeighborAddress.String() { + if nb.NeighborConfig.NeighborAddress.String() == n.NeighborConfig.NeighborAddress.String() { return true } } @@ -56,19 +56,19 @@ func UpdateConfig(curC *Bgp, newC *Bgp) (*Bgp, []Neighbor, []Neighbor) { added := []Neighbor{} deleted := []Neighbor{} - for _, n := range newC.NeighborList { - if inSlice(n, curC.NeighborList) == false { + for _, n := range newC.Neighbors.NeighborList { + if inSlice(n, curC.Neighbors.NeighborList) == false { added = append(added, n) } } - for _, n := range curC.NeighborList { - if inSlice(n, newC.NeighborList) == false { + for _, n := range curC.Neighbors.NeighborList { + if inSlice(n, newC.Neighbors.NeighborList) == false { deleted = append(deleted, n) } } - bgpConfig.NeighborList = newC.NeighborList + bgpConfig.Neighbors.NeighborList = newC.Neighbors.NeighborList return &bgpConfig, added, deleted } |