server

package
v0.0.0-...-ccb7345 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2016 License: Apache-2.0, Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
const (
	HOLDTIME_OPENSENT = 240
	HOLDTIME_IDLE     = 5
)
View Source
const (
	REQ_GLOBAL_CONFIG
	REQ_MOD_GLOBAL_CONFIG
	REQ_NEIGHBOR
	REQ_NEIGHBORS
	REQ_ADJ_RIB_IN
	REQ_ADJ_RIB_OUT
	REQ_LOCAL_RIB
	REQ_NEIGHBOR_SHUTDOWN
	REQ_NEIGHBOR_RESET
	REQ_NEIGHBOR_SOFT_RESET
	REQ_NEIGHBOR_SOFT_RESET_IN
	REQ_NEIGHBOR_SOFT_RESET_OUT
	REQ_NEIGHBOR_ENABLE
	REQ_NEIGHBOR_DISABLE
	REQ_MOD_NEIGHBOR
	REQ_GLOBAL_RIB
	REQ_MONITOR_GLOBAL_BEST_CHANGED
	REQ_MONITOR_NEIGHBOR_PEER_STATE
	REQ_MRT_GLOBAL_RIB
	REQ_MRT_LOCAL_RIB
	REQ_MOD_MRT
	REQ_RPKI
	REQ_MOD_RPKI
	REQ_ROA
	REQ_VRF
	REQ_VRFS
	REQ_VRF_MOD
	REQ_MOD_PATH
	REQ_DEFINED_SET
	REQ_MOD_DEFINED_SET
	REQ_STATEMENT
	REQ_MOD_STATEMENT
	REQ_POLICY
	REQ_MOD_POLICY
	REQ_POLICY_ASSIGNMENT
	REQ_MOD_POLICY_ASSIGNMENT
)
View Source
const (
	FLOP_THRESHOLD    = time.Second * 30
	MIN_CONNECT_RETRY = 10
)
View Source
const (
	WATCHER_MRT watcherType // UPDATE MSG
	WATCHER_BMP
	WATCHER_ZEBRA
	WATCHER_GRPC_BESTPATH
)
View Source
const (
	WATCHER_EVENT_UPDATE_MSG watcherEventType
	WATCHER_EVENT_STATE_CHANGE
	WATCHER_EVENT_BESTPATH_CHANGE
)
View Source
const (
	GLOBAL_RIB_NAME = "global"
)
View Source
const GRPC_PORT = 8080
View Source
const (
	TCP_MD5SIG = 14
)

Variables

This section is empty.

Functions

func SetTcpMD5SigSockopts

func SetTcpMD5SigSockopts(l *net.TCPListener, address string, key string) error

func SetTcpTTLSockopts

func SetTcpTTLSockopts(conn *net.TCPConn, ttl int) error

Types

type AdminState

type AdminState int
const (
	ADMIN_STATE_UP AdminState = iota
	ADMIN_STATE_DOWN
)

func (AdminState) String

func (s AdminState) String() string

type BgpServer

type BgpServer struct {
	GrpcReqCh chan *GrpcRequest
	// contains filtered or unexported fields
}

func NewBgpServer

func NewBgpServer(port int) *BgpServer

func (*BgpServer) NewZclient

func (server *BgpServer) NewZclient(url string, redistRouteTypes []string) error

func (*BgpServer) PeerAdd

func (server *BgpServer) PeerAdd(peer config.Neighbor)

func (*BgpServer) PeerDelete

func (server *BgpServer) PeerDelete(peer config.Neighbor)

func (*BgpServer) PeerUpdate

func (server *BgpServer) PeerUpdate(peer config.Neighbor)

func (*BgpServer) Serve

func (server *BgpServer) Serve()

func (*BgpServer) SetBmpConfig

func (server *BgpServer) SetBmpConfig(c config.BmpServers)

func (*BgpServer) SetGlobalType

func (server *BgpServer) SetGlobalType(g config.Global)

func (*BgpServer) SetPolicy

func (server *BgpServer) SetPolicy(pl config.RoutingPolicy) error

func (*BgpServer) SetRpkiConfig

func (server *BgpServer) SetRpkiConfig(c config.RpkiServers)

func (*BgpServer) Shutdown

func (server *BgpServer) Shutdown()

func (*BgpServer) UpdatePolicy

func (server *BgpServer) UpdatePolicy(policy config.RoutingPolicy)

type FSM

type FSM struct {
	// contains filtered or unexported fields
}

func NewFSM

func NewFSM(gConf *config.Global, pConf *config.Neighbor, peer *Peer) *FSM

func (*FSM) LocalHostPort

func (fsm *FSM) LocalHostPort() (string, uint16)

func (*FSM) RemoteHostPort

func (fsm *FSM) RemoteHostPort() (string, uint16)

func (*FSM) StateChange

func (fsm *FSM) StateChange(nextState bgp.FSMState)

type FSMHandler

type FSMHandler struct {
	// contains filtered or unexported fields
}

func NewFSMHandler

func NewFSMHandler(fsm *FSM, incoming chan *FsmMsg, outgoing chan *bgp.BGPMessage) *FSMHandler

type FsmMsg

type FsmMsg struct {
	MsgType  FsmMsgType
	MsgSrc   string
	MsgDst   string
	MsgData  interface{}
	PathList []*table.Path
	// contains filtered or unexported fields
}

type FsmMsgType

type FsmMsgType int
const (
	FSM_MSG_STATE_CHANGE FsmMsgType
	FSM_MSG_BGP_MESSAGE
)

type GrpcRequest

type GrpcRequest struct {
	RequestType int
	Name        string
	RouteFamily bgp.RouteFamily
	ResponseCh  chan *GrpcResponse
	EndCh       chan struct{}
	Err         error
	Data        interface{}
}

func NewGrpcRequest

func NewGrpcRequest(reqType int, name string, rf bgp.RouteFamily, d interface{}) *GrpcRequest

type GrpcResponse

type GrpcResponse struct {
	ResponseErr error
	Data        interface{}
}

func (*GrpcResponse) Err

func (r *GrpcResponse) Err() error

type Peer

type Peer struct {
	// contains filtered or unexported fields
}

func NewPeer

func NewPeer(g config.Global, conf config.Neighbor, loc *table.TableManager) *Peer

func (*Peer) ApplyPolicy

func (peer *Peer) ApplyPolicy(d table.PolicyDirection, paths []*table.Path) ([]*table.Path, []*table.Path)

func (*Peer) DropAll

func (peer *Peer) DropAll(rfList []bgp.RouteFamily)

func (*Peer) Fsm

func (peer *Peer) Fsm() *FSM

func (*Peer) GetDefaultPolicy

func (peer *Peer) GetDefaultPolicy(d table.PolicyDirection) table.RouteType

func (*Peer) GetPolicy

func (peer *Peer) GetPolicy(d table.PolicyDirection) []*table.Policy

func (*Peer) MarshalJSON

func (peer *Peer) MarshalJSON() ([]byte, error)

func (*Peer) Outgoing

func (peer *Peer) Outgoing() chan *bgp.BGPMessage

func (*Peer) PassConn

func (peer *Peer) PassConn(conn *net.TCPConn)

func (*Peer) SetDefaultPolicy

func (peer *Peer) SetDefaultPolicy(d table.PolicyDirection, typ table.RouteType) error

func (*Peer) SetPolicy

func (peer *Peer) SetPolicy(d table.PolicyDirection, policies []*table.Policy) error

func (*Peer) ToApiStruct

func (peer *Peer) ToApiStruct() *api.Peer

type SenderMsg

type SenderMsg struct {
	// contains filtered or unexported fields
}

type Server

type Server struct {
	// contains filtered or unexported fields
}

func NewGrpcServer

func NewGrpcServer(port int, bgpServerCh chan *GrpcRequest) *Server

func (*Server) Disable

func (s *Server) Disable(ctx context.Context, arg *api.Arguments) (*api.Error, error)

func (*Server) Enable

func (s *Server) Enable(ctx context.Context, arg *api.Arguments) (*api.Error, error)

func (*Server) GetDefinedSet

func (s *Server) GetDefinedSet(ctx context.Context, arg *api.DefinedSet) (*api.DefinedSet, error)

func (*Server) GetDefinedSets

func (s *Server) GetDefinedSets(arg *api.DefinedSet, stream api.GobgpApi_GetDefinedSetsServer) error

func (*Server) GetGlobalConfig

func (s *Server) GetGlobalConfig(ctx context.Context, arg *api.Arguments) (*api.Global, error)

func (*Server) GetMrt

func (s *Server) GetMrt(arg *api.MrtArguments, stream api.GobgpApi_GetMrtServer) error

func (*Server) GetNeighbor

func (s *Server) GetNeighbor(ctx context.Context, arg *api.Arguments) (*api.Peer, error)

func (*Server) GetNeighbors

func (s *Server) GetNeighbors(_ *api.Arguments, stream api.GobgpApi_GetNeighborsServer) error

func (*Server) GetPolicies

func (s *Server) GetPolicies(arg *api.Policy, stream api.GobgpApi_GetPoliciesServer) error

func (*Server) GetPolicy

func (s *Server) GetPolicy(ctx context.Context, arg *api.Policy) (*api.Policy, error)

func (*Server) GetPolicyAssignment

func (s *Server) GetPolicyAssignment(ctx context.Context, arg *api.PolicyAssignment) (*api.PolicyAssignment, error)

func (*Server) GetROA

func (s *Server) GetROA(arg *api.Arguments, stream api.GobgpApi_GetROAServer) error

func (*Server) GetRPKI

func (s *Server) GetRPKI(arg *api.Arguments, stream api.GobgpApi_GetRPKIServer) error

func (*Server) GetRib

func (s *Server) GetRib(ctx context.Context, arg *api.Table) (*api.Table, error)

func (*Server) GetStatement

func (s *Server) GetStatement(ctx context.Context, arg *api.Statement) (*api.Statement, error)

func (*Server) GetStatements

func (s *Server) GetStatements(arg *api.Statement, stream api.GobgpApi_GetStatementsServer) error

func (*Server) GetVrfs

func (s *Server) GetVrfs(arg *api.Arguments, stream api.GobgpApi_GetVrfsServer) error

func (*Server) ModDefinedSet

func (s *Server) ModDefinedSet(ctx context.Context, arg *api.ModDefinedSetArguments) (*api.Error, error)

func (*Server) ModGlobalConfig

func (s *Server) ModGlobalConfig(ctx context.Context, arg *api.ModGlobalConfigArguments) (*api.Error, error)

func (*Server) ModMrt

func (s *Server) ModMrt(ctx context.Context, arg *api.ModMrtArguments) (*api.Error, error)

func (*Server) ModNeighbor

func (s *Server) ModNeighbor(ctx context.Context, arg *api.ModNeighborArguments) (*api.Error, error)

func (*Server) ModPath

func (s *Server) ModPath(stream api.GobgpApi_ModPathServer) error

func (*Server) ModPolicy

func (s *Server) ModPolicy(ctx context.Context, arg *api.ModPolicyArguments) (*api.Error, error)

func (*Server) ModPolicyAssignment

func (s *Server) ModPolicyAssignment(ctx context.Context, arg *api.ModPolicyAssignmentArguments) (*api.Error, error)

func (*Server) ModRPKI

func (s *Server) ModRPKI(ctx context.Context, arg *api.ModRpkiArguments) (*api.Error, error)

func (*Server) ModStatement

func (s *Server) ModStatement(ctx context.Context, arg *api.ModStatementArguments) (*api.Error, error)

func (*Server) ModVrf

func (s *Server) ModVrf(ctx context.Context, arg *api.ModVrfArguments) (*api.Error, error)

func (*Server) MonitorBestChanged

func (s *Server) MonitorBestChanged(arg *api.Arguments, stream api.GobgpApi_MonitorBestChangedServer) error

func (*Server) MonitorPeerState

func (s *Server) MonitorPeerState(arg *api.Arguments, stream api.GobgpApi_MonitorPeerStateServer) error

func (*Server) Reset

func (s *Server) Reset(ctx context.Context, arg *api.Arguments) (*api.Error, error)

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) Shutdown

func (s *Server) Shutdown(ctx context.Context, arg *api.Arguments) (*api.Error, error)

func (*Server) SoftReset

func (s *Server) SoftReset(ctx context.Context, arg *api.Arguments) (*api.Error, error)

func (*Server) SoftResetIn

func (s *Server) SoftResetIn(ctx context.Context, arg *api.Arguments) (*api.Error, error)

func (*Server) SoftResetOut

func (s *Server) SoftResetOut(ctx context.Context, arg *api.Arguments) (*api.Error, error)

Jump to

Keyboard shortcuts

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