server

package
v0.0.0-...-ac9ef1f Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 5, 2017 License: Apache-2.0 Imports: 27 Imported by: 0

Documentation

Overview

peer.go

server.go

Index

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 (*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 (s *BGPServer) BulkGetBGPv4Neighbors(index int, count int) (int, int, []*config.NeighborState)

func (*BGPServer) BulkGetBGPv6Neighbors

func (s *BGPServer) BulkGetBGPv6Neighbors(index int, count int) (int, int, []*config.NeighborState)

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 (s *BGPServer) ConvertIntfStrToIfIndex(intfString string) (ifIndex int32, ifName string, err error)

func (*BGPServer) CreatePeer

func (s *BGPServer) CreatePeer(newPeer config.NeighborConfig)

func (*BGPServer) DeleteAgg

func (s *BGPServer) DeleteAgg(aggConf config.BGPAggregate) error

func (*BGPServer) DoesAdjRIBInRouteExist

func (s *BGPServer) DoesAdjRIBInRouteExist(params interface{}) bool

func (*BGPServer) DoesAdjRIBOutRouteExist

func (s *BGPServer) DoesAdjRIBOutRouteExist(params interface{}) bool

func (*BGPServer) DoesAdjRIBRouteExist

func (s *BGPServer) DoesAdjRIBRouteExist(params interface{}, adjRIBDir bgprib.AdjRIBDir) bool

func (*BGPServer) DoesRouteExist

func (s *BGPServer) DoesRouteExist(params interface{}) bool

func (*BGPServer) GetBGPGlobalState

func (s *BGPServer) GetBGPGlobalState() config.GlobalState

func (*BGPServer) GetBGPNeighborState

func (s *BGPServer) GetBGPNeighborState(neighborIP string) *config.NeighborState

func (*BGPServer) GetIfaceIP

func (s *BGPServer) GetIfaceIP(ifIndex int32) (*utils.IPInfo, error)

func (*BGPServer) GetIntfObjects

func (s *BGPServer) GetIntfObjects()

func (*BGPServer) InitBGPEvent

func (s *BGPServer) InitBGPEvent()

func (*BGPServer) ProcessConnectedRoutes

func (s *BGPServer) ProcessConnectedRoutes(installedRoutes, withdrawnRoutes []*config.RouteInfo)

func (*BGPServer) ProcessIntfMapUpdates

func (s *BGPServer) ProcessIntfMapUpdates(cfg []config.IntfMapInfo)

func (*BGPServer) ProcessIntfStates

func (s *BGPServer) ProcessIntfStates(intfs []*config.IntfStateInfo)

func (*BGPServer) ProcessRemoveNeighbor

func (s *BGPServer) ProcessRemoveNeighbor(peerIp string, peer *Peer)

func (*BGPServer) ProcessUpdate

func (s *BGPServer) ProcessUpdate(pktInfo *packet.BGPPktSrc)

func (*BGPServer) RemoveRoutesFromAllNeighbor

func (s *BGPServer) RemoveRoutesFromAllNeighbor()

func (*BGPServer) Restart

func (s *BGPServer) Restart(cfg config.GlobalConfig)

func (*BGPServer) SendAllRoutesToPeer

func (s *BGPServer) SendAllRoutesToPeer(peer *Peer)

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 (s *BGPServer) UpdateGlobal(bgpGlobal *bgpd.BGPGlobal, oldConfig, newConfig config.GlobalConfig, attrSet []bool)

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

func (s *BGPServer) VerifyBgpGlobalConfig() bool

type GlobalUpdate

type GlobalUpdate struct {
	BGPConfig *bgpd.BGPGlobal
	OldConfig config.GlobalConfig
	NewConfig config.GlobalConfig
	AttrSet   []bool
	PatchOp   []*bgpd.PatchOpInfo
	Op        string
}

type IntfEntry

type IntfEntry struct {
	Name 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 (p *Peer) AcceptConn(conn *net.TCPConn)

func (*Peer) AddAdjRIBFilter

func (p *Peer) AddAdjRIBFilter(pe *bgppolicy.AdjRibPPolicyEngine, policyName string, adjRIBDir bgprib.AdjRIBDir)

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) Cleanup

func (p *Peer) Cleanup()

func (*Peer) Command

func (p *Peer) Command(command int, reason int)

func (*Peer) GetActionType

func (p *Peer) GetActionType(adjRIBDir bgprib.AdjRIBDir) (int, bool)

func (*Peer) GetAdjRIB

func (p *Peer) GetAdjRIB(adjRIBDir bgprib.AdjRIBDir) map[uint32]map[string]*bgprib.AdjRIBRoute

func (*Peer) Init

func (p *Peer) Init()

func (*Peer) IsActive

func (p *Peer) IsActive() bool

func (*Peer) IsBfdStateUp

func (p *Peer) IsBfdStateUp() bool

func (*Peer) IsConfigured

func (p *Peer) IsConfigured() bool

func (*Peer) IsDisabled

func (p *Peer) IsDisabled() bool

func (*Peer) MaxPrefixesExceeded

func (p *Peer) MaxPrefixesExceeded()

func (*Peer) PeerConnBroken

func (p *Peer) PeerConnBroken(fsmCleanup bool)

func (*Peer) PeerConnEstablished

func (p *Peer) PeerConnEstablished(conn *net.Conn)

func (*Peer) ProcessBfd

func (p *Peer) ProcessBfd(add bool)

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 (p *Peer) RemoveAdjRIBFilter(pe *bgppolicy.AdjRibPPolicyEngine, policyName string, adjRIBDir bgprib.AdjRIBDir)

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 (p *Peer) SetNeighborAddress(ip net.IP)

func (*Peer) StopFSM

func (p *Peer) StopFSM(msg string)

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

type PolicyParams struct {
	CreateType int
	DeleteType int
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL