Documentation ¶
Overview ¶
peer.go
server.go
Index ¶
- Constants
- type AdjRIBPolicyParams
- type AggUpdate
- type BGPServer
- func (s *BGPServer) AddOrUpdateAgg(oldConf config.BGPAggregate, newConf config.BGPAggregate, attrSet []bool) error
- func (s *BGPServer) ApplyAdjRIBAction(actionInfo interface{}, conditionInfo []interface{}, params interface{}, ...)
- func (s *BGPServer) ApplyAggregateAction(actionInfo interface{}, conditionInfo []interface{}, params interface{}, ...)
- func (s *BGPServer) BulkGetBGPv4Neighbors(index int, count int) (int, int, []*config.NeighborState)
- func (s *BGPServer) BulkGetBGPv6Neighbors(index int, count int) (int, int, []*config.NeighborState)
- func (s *BGPServer) CheckForAggregation(updated map[uint32]map[*bgprib.Path][]*bgprib.Destination, ...) (map[uint32]map[*bgprib.Path][]*bgprib.Destination, []*bgprib.Destination, ...)
- func (s *BGPServer) ConvertIntfStrToIfIndex(intfString string) (ifIndex int32, ifName string, err error)
- func (s *BGPServer) CreatePeer(newPeer config.NeighborConfig)
- func (s *BGPServer) DeleteAgg(aggConf config.BGPAggregate) error
- func (s *BGPServer) DoesAdjRIBInRouteExist(params interface{}) bool
- func (s *BGPServer) DoesAdjRIBOutRouteExist(params interface{}) bool
- func (s *BGPServer) DoesAdjRIBRouteExist(params interface{}, adjRIBDir bgprib.AdjRIBDir) bool
- func (s *BGPServer) DoesRouteExist(params interface{}) bool
- func (s *BGPServer) GetBGPGlobalState() config.GlobalState
- func (s *BGPServer) GetBGPNeighborState(neighborIP string) *config.NeighborState
- func (s *BGPServer) GetIfaceIP(ifIndex int32) (*utils.IPInfo, error)
- func (s *BGPServer) GetIntfObjects()
- func (s *BGPServer) InitBGPEvent()
- func (s *BGPServer) ProcessConnectedRoutes(installedRoutes, withdrawnRoutes []*config.RouteInfo)
- func (s *BGPServer) ProcessIntfMapUpdates(cfg []config.IntfMapInfo)
- func (s *BGPServer) ProcessIntfStates(intfs []*config.IntfStateInfo)
- func (s *BGPServer) ProcessRemoveNeighbor(peerIp string, peer *Peer)
- func (s *BGPServer) ProcessUpdate(pktInfo *packet.BGPPktSrc)
- func (s *BGPServer) RemoveRoutesFromAllNeighbor()
- func (s *BGPServer) Restart(cfg config.GlobalConfig)
- func (s *BGPServer) SendAllRoutesToPeer(peer *Peer)
- func (s *BGPServer) SendUpdate(updated map[uint32]map[*bgprib.Path][]*bgprib.Destination, ...)
- func (s *BGPServer) SetupRedistribution(gConf config.GlobalConfig)
- func (s *BGPServer) StartServer()
- func (s *BGPServer) StopPeersByGroup(groupName string, peerAddrType config.PeerAddressType) []*Peer
- func (s *BGPServer) TrAndRevAggForIPv4(policyData interface{})
- func (s *BGPServer) TrAndRevAggForIPv6(policyData interface{})
- func (s *BGPServer) TraverseAndApplyAdjRibIn(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
- func (s *BGPServer) TraverseAndApplyAdjRibOut(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
- func (s *BGPServer) TraverseAndApplyBGPRib(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
- func (s *BGPServer) TraverseAndReverseAdjRIB(policyData interface{}, pe *bgppolicy.AdjRibPPolicyEngine)
- func (s *BGPServer) TraverseAndReverseAdjRIBIn(policyData interface{})
- func (s *BGPServer) TraverseAndReverseAdjRIBOut(policyData interface{})
- func (s *BGPServer) TraverseAndReverseBGPRib(policyData interface{}, pe *bgppolicy.LocRibPolicyEngine)
- func (s *BGPServer) UndoAdjRIBAction(actionInfo interface{}, conditionInfo []interface{}, params interface{}, ...)
- func (s *BGPServer) UndoAggregateAction(actionInfo interface{}, conditionList []interface{}, params interface{}, ...)
- func (s *BGPServer) UpdateAdjRIBInRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{})
- func (s *BGPServer) UpdateAdjRIBOutRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{})
- func (s *BGPServer) UpdateAdjRIBRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{}, ...)
- func (s *BGPServer) UpdateAggPolicy(policyName string, pe *bgppolicy.LocRibPolicyEngine, ...) error
- func (s *BGPServer) UpdateGlobal(bgpGlobal *bgpd.BGPGlobal, oldConfig, newConfig config.GlobalConfig, ...)
- func (s *BGPServer) UpdateGlobalForPatchUpdate(oldConfig, newConfig config.GlobalConfig, op []*bgpd.PatchOpInfo)
- func (s *BGPServer) UpdatePeerGroupInPeers(groupName string, peerAddrType config.PeerAddressType, ...)
- func (s *BGPServer) UpdateRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{})
- func (s *BGPServer) Updatev4Peer(bgpPeer *bgpd.BGPv4Neighbor, oldPeer, newPeer config.NeighborConfig, ...)
- func (s *BGPServer) Updatev6Peer(bgpPeer *bgpd.BGPv6Neighbor, oldPeer, newPeer config.NeighborConfig, ...)
- func (s *BGPServer) VerifyBgpGlobalConfig() bool
- type GlobalUpdate
- type IntfEntry
- type Peer
- func (p *Peer) AcceptConn(conn *net.TCPConn)
- func (p *Peer) AddAdjRIBFilter(pe *bgppolicy.AdjRibPPolicyEngine, policyName string, ...)
- func (p *Peer) AddRouteNLRIs(route *bgprib.AdjRIBRoute, ...) map[*bgprib.Path]map[uint32]*bgprib.FilteredRoutes
- func (p *Peer) AdjRIBInPolicyUpdated(adjRibDir bgprib.AdjRIBDir, data interface{}, ...) (map[uint32]map[*bgprib.Path][]*bgprib.Destination, []*bgprib.Destination, ...)
- func (p *Peer) AdjRIBOutPolicyUpdated(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
- func (p *Peer) BfdFaultCleared()
- func (p *Peer) BfdFaultSet()
- func (p *Peer) Cleanup()
- func (p *Peer) Command(command int, reason int)
- func (p *Peer) GetActionType(adjRIBDir bgprib.AdjRIBDir) (int, bool)
- func (p *Peer) GetAdjRIB(adjRIBDir bgprib.AdjRIBDir) map[uint32]map[string]*bgprib.AdjRIBRoute
- func (p *Peer) Init()
- func (p *Peer) IsActive() bool
- func (p *Peer) IsBfdStateUp() bool
- func (p *Peer) IsConfigured() bool
- func (p *Peer) IsDisabled() bool
- func (p *Peer) MaxPrefixesExceeded()
- func (p *Peer) PeerConnBroken(fsmCleanup bool)
- func (p *Peer) PeerConnEstablished(conn *net.Conn)
- func (p *Peer) ProcessBfd(add bool)
- func (p *Peer) ReceiveUpdate(pktInfo *packet.BGPPktSrc) (map[uint32]map[*bgprib.Path][]*bgprib.Destination, []*bgprib.Destination, ...)
- func (p *Peer) RemoveAdjRIBFilter(pe *bgppolicy.AdjRibPPolicyEngine, policyName string, ...)
- func (p *Peer) ResetNeighborAddress()
- func (p *Peer) SendUpdate(updated map[uint32]map[*bgprib.Path][]*bgprib.Destination, ...)
- func (p *Peer) SetNeighborAddress(ip net.IP)
- func (p *Peer) StopFSM(msg string)
- func (p *Peer) UpdateGlobal(gConf *config.GlobalConfig)
- func (p *Peer) UpdateNeighborConf(nConf config.NeighborConfig, bgp *config.Bgp)
- func (p *Peer) UpdatePeerGroup(peerGroup *config.PeerGroupConfig)
- type PeerGroupUpdate
- type PeerUpdate
- type PolicyParams
Constants ¶
View Source
const ( Reject int = iota Accept )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AdjRIBPolicyParams ¶
type AdjRIBPolicyParams struct { CreateType int DeleteType int Route *bgprib.AdjRIBRoute Peer *Peer Accept int PolicyEngine *bgppolicy.AdjRibPPolicyEngine // contains filtered or unexported fields }
type AggUpdate ¶
type AggUpdate struct { OldAgg config.BGPAggregate NewAgg config.BGPAggregate AttrSet []bool }
type BGPServer ¶
type BGPServer struct { BgpConfig config.Bgp GlobalConfigCh chan GlobalUpdate AddPeerCh chan PeerUpdate RemPeerCh chan config.NeighborConfig AddPeerGroupCh chan PeerGroupUpdate RemPeerGroupCh chan config.PeerGroupConfig AddAggCh chan AggUpdate RemAggCh chan config.BGPAggregate PeerFSMConnCh chan fsm.PeerFSMConn PeerConnEstCh chan string PeerConnBrokenCh chan string PeerCommandCh chan config.PeerCommand ReachabilityCh chan config.ReachabilityInfo BGPPktSrcCh chan *packet.BGPPktSrc BfdCh chan config.BfdInfo IntfCh chan config.IntfStateInfo IntfMapCh chan config.IntfMapInfo RoutesCh chan *config.RouteCh ServerUpCh chan bool GlobalCfgDone bool NeighborMutex sync.RWMutex PeerMap map[string]*Peer Neighbors []*Peer LocRib *bgprib.LocRib ConnRoutesPath *bgprib.Path IfIndexPeerMap map[int32][]string IntfIdNameMap map[int32]IntfEntry IfNameToIfIndex map[string]int32 RedistributionMap map[string]string AddPathCount int // all managers IntfMgr config.IntfStateMgrIntf // contains filtered or unexported fields }
func NewBGPServer ¶
func NewBGPServer(logger *logging.Writer, policyManager *bgppolicy.BGPPolicyManager, iMgr config.IntfStateMgrIntf, rMgr config.RouteMgrIntf, bMgr config.BfdMgrIntf, sDBMgr statedbclient.StateDBClient) *BGPServer
func (*BGPServer) AddOrUpdateAgg ¶
func (s *BGPServer) AddOrUpdateAgg(oldConf config.BGPAggregate, newConf config.BGPAggregate, attrSet []bool) error
func (*BGPServer) ApplyAdjRIBAction ¶
func (s *BGPServer) ApplyAdjRIBAction(actionInfo interface{}, conditionInfo []interface{}, params interface{}, policyStmt utilspolicy.PolicyStmt)
func (*BGPServer) ApplyAggregateAction ¶
func (s *BGPServer) ApplyAggregateAction(actionInfo interface{}, conditionInfo []interface{}, params interface{}, policyStmt utilspolicy.PolicyStmt)
func (*BGPServer) BulkGetBGPv4Neighbors ¶
func (*BGPServer) BulkGetBGPv6Neighbors ¶
func (*BGPServer) CheckForAggregation ¶
func (s *BGPServer) CheckForAggregation(updated map[uint32]map[*bgprib.Path][]*bgprib.Destination, withdrawn, updatedAddPaths []*bgprib.Destination) (map[uint32]map[*bgprib.Path][]*bgprib.Destination, []*bgprib.Destination, []*bgprib.Destination)
func (*BGPServer) ConvertIntfStrToIfIndex ¶
func (*BGPServer) CreatePeer ¶
func (s *BGPServer) CreatePeer(newPeer config.NeighborConfig)
func (*BGPServer) DoesAdjRIBInRouteExist ¶
func (*BGPServer) DoesAdjRIBOutRouteExist ¶
func (*BGPServer) DoesAdjRIBRouteExist ¶
func (*BGPServer) DoesRouteExist ¶
func (*BGPServer) GetBGPGlobalState ¶
func (s *BGPServer) GetBGPGlobalState() config.GlobalState
func (*BGPServer) GetBGPNeighborState ¶
func (s *BGPServer) GetBGPNeighborState(neighborIP string) *config.NeighborState
func (*BGPServer) GetIntfObjects ¶
func (s *BGPServer) GetIntfObjects()
func (*BGPServer) InitBGPEvent ¶
func (s *BGPServer) InitBGPEvent()
func (*BGPServer) ProcessConnectedRoutes ¶
func (*BGPServer) ProcessIntfMapUpdates ¶
func (s *BGPServer) ProcessIntfMapUpdates(cfg []config.IntfMapInfo)
func (*BGPServer) ProcessIntfStates ¶
func (s *BGPServer) ProcessIntfStates(intfs []*config.IntfStateInfo)
func (*BGPServer) ProcessRemoveNeighbor ¶
func (*BGPServer) ProcessUpdate ¶
func (*BGPServer) RemoveRoutesFromAllNeighbor ¶
func (s *BGPServer) RemoveRoutesFromAllNeighbor()
func (*BGPServer) Restart ¶
func (s *BGPServer) Restart(cfg config.GlobalConfig)
func (*BGPServer) SendAllRoutesToPeer ¶
func (*BGPServer) SendUpdate ¶
func (s *BGPServer) SendUpdate(updated map[uint32]map[*bgprib.Path][]*bgprib.Destination, withdrawn, updatedAddPaths []*bgprib.Destination)
func (*BGPServer) SetupRedistribution ¶
func (s *BGPServer) SetupRedistribution(gConf config.GlobalConfig)
func (*BGPServer) StartServer ¶
func (s *BGPServer) StartServer()
func (*BGPServer) StopPeersByGroup ¶
func (s *BGPServer) StopPeersByGroup(groupName string, peerAddrType config.PeerAddressType) []*Peer
func (*BGPServer) TrAndRevAggForIPv4 ¶
func (s *BGPServer) TrAndRevAggForIPv4(policyData interface{})
func (*BGPServer) TrAndRevAggForIPv6 ¶
func (s *BGPServer) TrAndRevAggForIPv6(policyData interface{})
func (*BGPServer) TraverseAndApplyAdjRibIn ¶
func (s *BGPServer) TraverseAndApplyAdjRibIn(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
func (*BGPServer) TraverseAndApplyAdjRibOut ¶
func (s *BGPServer) TraverseAndApplyAdjRibOut(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
func (*BGPServer) TraverseAndApplyBGPRib ¶
func (s *BGPServer) TraverseAndApplyBGPRib(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
func (*BGPServer) TraverseAndReverseAdjRIB ¶
func (s *BGPServer) TraverseAndReverseAdjRIB(policyData interface{}, pe *bgppolicy.AdjRibPPolicyEngine)
func (*BGPServer) TraverseAndReverseAdjRIBIn ¶
func (s *BGPServer) TraverseAndReverseAdjRIBIn(policyData interface{})
func (*BGPServer) TraverseAndReverseAdjRIBOut ¶
func (s *BGPServer) TraverseAndReverseAdjRIBOut(policyData interface{})
func (*BGPServer) TraverseAndReverseBGPRib ¶
func (s *BGPServer) TraverseAndReverseBGPRib(policyData interface{}, pe *bgppolicy.LocRibPolicyEngine)
func (*BGPServer) UndoAdjRIBAction ¶
func (s *BGPServer) UndoAdjRIBAction(actionInfo interface{}, conditionInfo []interface{}, params interface{}, policyStmt utilspolicy.PolicyStmt)
func (*BGPServer) UndoAggregateAction ¶
func (s *BGPServer) UndoAggregateAction(actionInfo interface{}, conditionList []interface{}, params interface{}, policyStmt utilspolicy.PolicyStmt)
func (*BGPServer) UpdateAdjRIBInRouteAndPolicyDB ¶
func (s *BGPServer) UpdateAdjRIBInRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{})
func (*BGPServer) UpdateAdjRIBOutRouteAndPolicyDB ¶
func (s *BGPServer) UpdateAdjRIBOutRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{})
func (*BGPServer) UpdateAdjRIBRouteAndPolicyDB ¶
func (s *BGPServer) UpdateAdjRIBRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{}, pe *bgppolicy.AdjRibPPolicyEngine)
func (*BGPServer) UpdateAggPolicy ¶
func (s *BGPServer) UpdateAggPolicy(policyName string, pe *bgppolicy.LocRibPolicyEngine, aggConf config.BGPAggregate) error
func (*BGPServer) UpdateGlobal ¶
func (*BGPServer) UpdateGlobalForPatchUpdate ¶
func (s *BGPServer) UpdateGlobalForPatchUpdate(oldConfig, newConfig config.GlobalConfig, op []*bgpd.PatchOpInfo)
func (*BGPServer) UpdatePeerGroupInPeers ¶
func (s *BGPServer) UpdatePeerGroupInPeers(groupName string, peerAddrType config.PeerAddressType, peerGroup *config.PeerGroupConfig)
func (*BGPServer) UpdateRouteAndPolicyDB ¶
func (s *BGPServer) UpdateRouteAndPolicyDB(policyDetails utilspolicy.PolicyDetails, params interface{})
func (*BGPServer) Updatev4Peer ¶
func (s *BGPServer) Updatev4Peer(bgpPeer *bgpd.BGPv4Neighbor, oldPeer, newPeer config.NeighborConfig, attrSet []bool)
func (*BGPServer) Updatev6Peer ¶
func (s *BGPServer) Updatev6Peer(bgpPeer *bgpd.BGPv6Neighbor, oldPeer, newPeer config.NeighborConfig, attrSet []bool)
func (*BGPServer) VerifyBgpGlobalConfig ¶
type GlobalUpdate ¶
type GlobalUpdate struct { BGPConfig *bgpd.BGPGlobal OldConfig config.GlobalConfig NewConfig config.GlobalConfig AttrSet []bool PatchOp []*bgpd.PatchOpInfo Op string }
type Peer ¶
type Peer struct { NeighborConf *base.NeighborConf // contains filtered or unexported fields }
func NewPeer ¶
func NewPeer(server *BGPServer, locRib *bgprib.LocRib, globalConf *config.GlobalConfig, peerGroup *config.PeerGroupConfig, peerConf config.NeighborConfig) *Peer
func (*Peer) AcceptConn ¶
func (*Peer) AddAdjRIBFilter ¶
func (*Peer) AddRouteNLRIs ¶
func (p *Peer) AddRouteNLRIs(route *bgprib.AdjRIBRoute, pathNLRIs map[*bgprib.Path]map[uint32]*bgprib.FilteredRoutes, add bool) map[*bgprib.Path]map[uint32]*bgprib.FilteredRoutes
func (*Peer) AdjRIBInPolicyUpdated ¶
func (p *Peer) AdjRIBInPolicyUpdated(adjRibDir bgprib.AdjRIBDir, data interface{}, updateFunc utilspolicy.PolicyApplyfunc) (map[uint32]map[*bgprib.Path][]*bgprib.Destination, []*bgprib.Destination, []*bgprib.Destination)
func (*Peer) AdjRIBOutPolicyUpdated ¶
func (p *Peer) AdjRIBOutPolicyUpdated(data interface{}, updateFunc utilspolicy.PolicyApplyfunc)
func (*Peer) BfdFaultCleared ¶
func (p *Peer) BfdFaultCleared()
func (*Peer) BfdFaultSet ¶
func (p *Peer) BfdFaultSet()
func (*Peer) IsBfdStateUp ¶
func (*Peer) IsConfigured ¶
func (*Peer) IsDisabled ¶
func (*Peer) MaxPrefixesExceeded ¶
func (p *Peer) MaxPrefixesExceeded()
func (*Peer) PeerConnBroken ¶
func (*Peer) PeerConnEstablished ¶
func (*Peer) ProcessBfd ¶
func (*Peer) ReceiveUpdate ¶
func (p *Peer) ReceiveUpdate(pktInfo *packet.BGPPktSrc) (map[uint32]map[*bgprib.Path][]*bgprib.Destination, []*bgprib.Destination, []*bgprib.Destination)
func (*Peer) RemoveAdjRIBFilter ¶
func (*Peer) ResetNeighborAddress ¶
func (p *Peer) ResetNeighborAddress()
func (*Peer) SendUpdate ¶
func (p *Peer) SendUpdate(updated map[uint32]map[*bgprib.Path][]*bgprib.Destination, withdrawn, updatedAddPaths []*bgprib.Destination)
func (*Peer) SetNeighborAddress ¶
func (*Peer) UpdateGlobal ¶
func (p *Peer) UpdateGlobal(gConf *config.GlobalConfig)
func (*Peer) UpdateNeighborConf ¶
func (p *Peer) UpdateNeighborConf(nConf config.NeighborConfig, bgp *config.Bgp)
func (*Peer) UpdatePeerGroup ¶
func (p *Peer) UpdatePeerGroup(peerGroup *config.PeerGroupConfig)
type PeerGroupUpdate ¶
type PeerGroupUpdate struct { OldGroup config.PeerGroupConfig NewGroup config.PeerGroupConfig AttrSet []bool }
type PeerUpdate ¶
type PeerUpdate struct { BGPPeer interface{} PeerType string OldPeer config.NeighborConfig NewPeer config.NeighborConfig AttrSet []bool PatchOp []*bgpd.PatchOpInfo Op string }
type PolicyParams ¶
Click to show internal directories.
Click to hide internal directories.