Documentation
¶
Index ¶
- Constants
- func DialTCPTimeoutWithMD5Sig(host string, port int, localAddr, key string, msec int) (*net.TCPConn, error)
- func NewROAManager(as uint32) (*roaManager, error)
- func NewRoaClient(address, port string, ch chan *ROAEvent, lifetime int64) *roaClient
- func NewZclient(url string, redistRouteTypes []config.InstallProtocolType) (*zebra.Client, error)
- func SetTcpMD5SigSockopts(l *net.TCPListener, address string, key string) error
- func SetTcpTTLSockopts(conn *net.TCPConn, ttl int) error
- type AdminState
- type BgpServer
- func (server *BgpServer) Api2PathList(resource api.Resource, name string, ApiPathList []*api.Path) ([]*table.Path, error)
- func (server *BgpServer) Listeners(addr string) []*net.TCPListener
- func (server *BgpServer) PeerAdd(peer config.Neighbor) error
- func (server *BgpServer) PeerDelete(peer config.Neighbor) error
- func (server *BgpServer) PeerUpdate(peer config.Neighbor)
- func (server *BgpServer) RSimportPaths(peer *Peer, pathList []*table.Path) []*table.Path
- func (server *BgpServer) Serve()
- func (server *BgpServer) SetBmpConfig(c []config.BmpServer) error
- func (server *BgpServer) SetGlobalType(g config.Global) error
- func (server *BgpServer) SetMrtConfig(c []config.Mrt) error
- func (server *BgpServer) SetRoutingPolicy(pl config.RoutingPolicy) error
- func (server *BgpServer) SetRpkiConfig(c []config.RpkiServer) error
- func (server *BgpServer) Shutdown()
- func (server *BgpServer) UpdatePolicy(policy config.RoutingPolicy)
- type FSM
- type FSMHandler
- type FsmMsg
- type FsmMsgType
- type FsmOutgoingMsg
- type FsmStateReason
- type GrpcRequest
- type GrpcResponse
- type Peer
- func (peer *Peer) DropAll(rfList []bgp.RouteFamily)
- func (peer *Peer) ID() string
- func (peer *Peer) MarshalJSON() ([]byte, error)
- func (peer *Peer) PassConn(conn *net.TCPConn)
- func (peer *Peer) StaleAll(rfList []bgp.RouteFamily)
- func (peer *Peer) TableID() string
- func (peer *Peer) ToApiStruct() *api.Peer
- type ROA
- type ROAEvent
- type ROAEventType
- type SenderMsg
- type Server
- func (s *Server) Disable(ctx context.Context, arg *api.Arguments) (*api.Error, error)
- func (s *Server) Enable(ctx context.Context, arg *api.Arguments) (*api.Error, error)
- func (s *Server) GetDefinedSet(ctx context.Context, arg *api.DefinedSet) (*api.DefinedSet, error)
- func (s *Server) GetDefinedSets(arg *api.DefinedSet, stream api.GobgpApi_GetDefinedSetsServer) error
- func (s *Server) GetGlobalConfig(ctx context.Context, arg *api.Arguments) (*api.Global, error)
- func (s *Server) GetMrt(arg *api.MrtArguments, stream api.GobgpApi_GetMrtServer) error
- func (s *Server) GetNeighbor(ctx context.Context, arg *api.Arguments) (*api.Peer, error)
- func (s *Server) GetNeighbors(_ *api.Arguments, stream api.GobgpApi_GetNeighborsServer) error
- func (s *Server) GetPolicies(arg *api.Policy, stream api.GobgpApi_GetPoliciesServer) error
- func (s *Server) GetPolicy(ctx context.Context, arg *api.Policy) (*api.Policy, error)
- func (s *Server) GetPolicyAssignment(ctx context.Context, arg *api.PolicyAssignment) (*api.PolicyAssignment, error)
- func (s *Server) GetROA(arg *api.Arguments, stream api.GobgpApi_GetROAServer) error
- func (s *Server) GetRPKI(arg *api.Arguments, stream api.GobgpApi_GetRPKIServer) error
- func (s *Server) GetRib(ctx context.Context, arg *api.Table) (*api.Table, error)
- func (s *Server) GetStatement(ctx context.Context, arg *api.Statement) (*api.Statement, error)
- func (s *Server) GetStatements(arg *api.Statement, stream api.GobgpApi_GetStatementsServer) error
- func (s *Server) GetVrfs(arg *api.Arguments, stream api.GobgpApi_GetVrfsServer) error
- func (s *Server) ModBmp(ctx context.Context, arg *api.ModBmpArguments) (*api.Error, error)
- func (s *Server) ModDefinedSet(ctx context.Context, arg *api.ModDefinedSetArguments) (*api.Error, error)
- func (s *Server) ModGlobalConfig(ctx context.Context, arg *api.ModGlobalConfigArguments) (*api.Error, error)
- func (s *Server) ModMrt(ctx context.Context, arg *api.ModMrtArguments) (*api.Error, error)
- func (s *Server) ModNeighbor(ctx context.Context, arg *api.ModNeighborArguments) (*api.Error, error)
- func (s *Server) ModPath(ctx context.Context, arg *api.ModPathArguments) (*api.ModPathResponse, error)
- func (s *Server) ModPaths(stream api.GobgpApi_ModPathsServer) error
- func (s *Server) ModPolicy(ctx context.Context, arg *api.ModPolicyArguments) (*api.Error, error)
- func (s *Server) ModPolicyAssignment(ctx context.Context, arg *api.ModPolicyAssignmentArguments) (*api.Error, error)
- func (s *Server) ModRPKI(ctx context.Context, arg *api.ModRpkiArguments) (*api.Error, error)
- func (s *Server) ModStatement(ctx context.Context, arg *api.ModStatementArguments) (*api.Error, error)
- func (s *Server) ModVrf(ctx context.Context, arg *api.ModVrfArguments) (*api.Error, error)
- func (s *Server) MonitorBestChanged(arg *api.Arguments, stream api.GobgpApi_MonitorBestChangedServer) error
- func (s *Server) MonitorPeerState(arg *api.Arguments, stream api.GobgpApi_MonitorPeerStateServer) error
- func (s *Server) MonitorROAValidation(arg *api.Arguments, stream api.GobgpApi_MonitorROAValidationServer) error
- func (s *Server) MonitorRib(arg *api.Table, stream api.GobgpApi_MonitorRibServer) error
- func (s *Server) Reset(ctx context.Context, arg *api.Arguments) (*api.Error, error)
- func (s *Server) Serve() error
- func (s *Server) Shutdown(ctx context.Context, arg *api.Arguments) (*api.Error, error)
- func (s *Server) SoftReset(ctx context.Context, arg *api.Arguments) (*api.Error, error)
- func (s *Server) SoftResetIn(ctx context.Context, arg *api.Arguments) (*api.Error, error)
- func (s *Server) SoftResetOut(ctx context.Context, arg *api.Arguments) (*api.Error, error)
- type TCPListener
- type Watchers
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_ADD_NEIGHBOR REQ_DEL_NEIGHBOR REQ_GLOBAL_RIB REQ_MONITOR_GLOBAL_BEST_CHANGED REQ_MONITOR_INCOMING REQ_MONITOR_NEIGHBOR_PEER_STATE REQ_MONITOR_ROA_VALIDATION_RESULT REQ_MRT_GLOBAL_RIB REQ_MRT_LOCAL_RIB REQ_MOD_MRT REQ_MOD_BMP REQ_RPKI REQ_MOD_RPKI REQ_ROA REQ_VRF REQ_VRFS REQ_VRF_MOD REQ_MOD_PATH REQ_MOD_PATHS REQ_DEFINED_SET REQ_MOD_DEFINED_SET REQ_STATEMENT REQ_MOD_STATEMENT REQ_POLICY REQ_MOD_POLICY REQ_POLICY_ASSIGNMENT REQ_MOD_POLICY_ASSIGNMENT REQ_BMP_NEIGHBORS REQ_BMP_GLOBAL REQ_BMP_ADJ_IN REQ_DEFERRAL_TIMER_EXPIRED )
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 WATCHER_GRPC_INCOMING )
View Source
const ( WATCHER_EVENT_UPDATE_MSG watcherEventType WATCHER_EVENT_STATE_CHANGE WATCHER_EVENT_BESTPATH_CHANGE WATCHER_EVENT_POST_POLICY_UPDATE_MSG )
View Source
const (
TCP_MD5SIG = 14
)
Variables ¶
This section is empty.
Functions ¶
func NewROAManager ¶
func NewRoaClient ¶
func NewZclient ¶
func SetTcpMD5SigSockopts ¶
func SetTcpMD5SigSockopts(l *net.TCPListener, address string, key string) error
Types ¶
type AdminState ¶
type AdminState int
const ( ADMIN_STATE_UP AdminState = iota ADMIN_STATE_DOWN ADMIN_STATE_PFX_CT )
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() *BgpServer
func (*BgpServer) Api2PathList ¶
func (*BgpServer) PeerUpdate ¶
func (*BgpServer) RSimportPaths ¶
func (*BgpServer) SetRoutingPolicy ¶
func (server *BgpServer) SetRoutingPolicy(pl config.RoutingPolicy) error
func (*BgpServer) SetRpkiConfig ¶
func (server *BgpServer) SetRpkiConfig(c []config.RpkiServer) error
func (*BgpServer) UpdatePolicy ¶
func (server *BgpServer) UpdatePolicy(policy config.RoutingPolicy)
type FSM ¶
type FSM struct {
// contains filtered or unexported fields
}
func (*FSM) LocalHostPort ¶
func (*FSM) RemoteHostPort ¶
func (*FSM) StateChange ¶
type FSMHandler ¶
type FSMHandler struct {
// contains filtered or unexported fields
}
func NewFSMHandler ¶
func NewFSMHandler(fsm *FSM, incoming *channels.InfiniteChannel, stateCh chan *FsmMsg, outgoing chan *FsmOutgoingMsg) *FSMHandler
type FsmMsg ¶
type FsmMsg struct {
MsgType FsmMsgType
MsgSrc 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 FSM_MSG_ROUTE_REFRESH )
type FsmOutgoingMsg ¶
type FsmOutgoingMsg struct {
Paths []*table.Path
Notification *bgp.BGPMessage
StayIdle bool
}
type FsmStateReason ¶
type FsmStateReason int
const ( FSM_DYING FsmStateReason FSM_ADMIN_DOWN FSM_READ_FAILED FSM_WRITE_FAILED FSM_NOTIFICATION_SENT FSM_NOTIFICATION_RECV FSM_HOLD_TIMER_EXPIRED FSM_IDLE_HOLD_TIMER_EXPIRED FSM_RESTART_TIMER_EXPIRED FSM_GRACEFUL_RESTART FSM_INVALID_MSG )
func (FsmStateReason) String ¶
func (r FsmStateReason) String() string
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, policy *table.RoutingPolicy) *Peer
func (*Peer) DropAll ¶
func (peer *Peer) DropAll(rfList []bgp.RouteFamily)
func (*Peer) MarshalJSON ¶
func (*Peer) StaleAll ¶
func (peer *Peer) StaleAll(rfList []bgp.RouteFamily)
func (*Peer) ToApiStruct ¶
type ROAEvent ¶
type ROAEvent struct {
EventType ROAEventType
Src string
Data []byte
// contains filtered or unexported fields
}
type ROAEventType ¶
type ROAEventType uint8
const ( CONNECTED ROAEventType = iota DISCONNECTED RTR LIFETIMEOUT )
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func NewGrpcServer(hosts string, bgpServerCh chan *GrpcRequest) *Server
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 (*Server) GetMrt ¶
func (s *Server) GetMrt(arg *api.MrtArguments, stream api.GobgpApi_GetMrtServer) error
func (*Server) GetNeighbor ¶
func (*Server) GetNeighbors ¶
func (*Server) GetPolicies ¶
func (*Server) GetPolicyAssignment ¶
func (s *Server) GetPolicyAssignment(ctx context.Context, arg *api.PolicyAssignment) (*api.PolicyAssignment, error)
func (*Server) GetStatement ¶
func (*Server) GetStatements ¶
func (*Server) ModDefinedSet ¶
func (*Server) ModGlobalConfig ¶
func (*Server) ModNeighbor ¶
func (*Server) ModPath ¶
func (s *Server) ModPath(ctx context.Context, arg *api.ModPathArguments) (*api.ModPathResponse, error)
func (*Server) ModPolicyAssignment ¶
func (*Server) ModStatement ¶
func (*Server) MonitorBestChanged ¶
func (*Server) MonitorPeerState ¶
func (*Server) MonitorROAValidation ¶
func (*Server) MonitorRib ¶
func (*Server) SoftResetIn ¶
type TCPListener ¶
type TCPListener struct {
// contains filtered or unexported fields
}
func NewTCPListener ¶
avoid mapped IPv6 address
func (*TCPListener) Close ¶
func (l *TCPListener) Close() error
Click to show internal directories.
Click to hide internal directories.