Documentation ¶
Index ¶
- Constants
- 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) NewZclient(url string, redistRouteTypes []string) error
- func (server *BgpServer) PeerAdd(peer config.Neighbor)
- func (server *BgpServer) PeerDelete(peer config.Neighbor)
- func (server *BgpServer) PeerUpdate(peer config.Neighbor)
- func (server *BgpServer) Serve()
- func (server *BgpServer) SetBmpConfig(c config.BmpServers)
- func (server *BgpServer) SetGlobalType(g config.Global)
- func (server *BgpServer) SetPolicy(pl config.RoutingPolicy) error
- func (server *BgpServer) SetRpkiConfig(c config.RpkiServers)
- func (server *BgpServer) Shutdown()
- func (server *BgpServer) UpdatePolicy(policy config.RoutingPolicy)
- type FSM
- type FSMHandler
- type FsmMsg
- type FsmMsgType
- type GrpcRequest
- type GrpcResponse
- type Peer
- func (peer *Peer) ApplyPolicy(d table.PolicyDirection, paths []*table.Path) ([]*table.Path, []*table.Path)
- func (peer *Peer) DropAll(rfList []bgp.RouteFamily)
- func (peer *Peer) Fsm() *FSM
- func (peer *Peer) GetDefaultPolicy(d table.PolicyDirection) table.RouteType
- func (peer *Peer) GetPolicy(d table.PolicyDirection) []*table.Policy
- func (peer *Peer) MarshalJSON() ([]byte, error)
- func (peer *Peer) Outgoing() chan *bgp.BGPMessage
- func (peer *Peer) PassConn(conn *net.TCPConn)
- func (peer *Peer) SetDefaultPolicy(d table.PolicyDirection, typ table.RouteType) error
- func (peer *Peer) SetPolicy(d table.PolicyDirection, policies []*table.Policy) error
- func (peer *Peer) ToApiStruct() *api.Peer
- 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) 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(stream api.GobgpApi_ModPathServer) 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) 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)
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
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 (*BgpServer) NewZclient ¶
func (*BgpServer) PeerDelete ¶
func (*BgpServer) PeerUpdate ¶
func (*BgpServer) SetBmpConfig ¶
func (server *BgpServer) SetBmpConfig(c config.BmpServers)
func (*BgpServer) SetGlobalType ¶
func (*BgpServer) SetRpkiConfig ¶
func (server *BgpServer) SetRpkiConfig(c config.RpkiServers)
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 ¶
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 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 (*Peer) ApplyPolicy ¶
func (*Peer) GetDefaultPolicy ¶
func (peer *Peer) GetDefaultPolicy(d table.PolicyDirection) table.RouteType
func (*Peer) MarshalJSON ¶
func (*Peer) SetDefaultPolicy ¶
func (*Peer) ToApiStruct ¶
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewGrpcServer ¶
func NewGrpcServer(port int, 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) ModPolicyAssignment ¶
func (*Server) ModStatement ¶
func (*Server) MonitorBestChanged ¶
func (*Server) MonitorPeerState ¶
func (*Server) SoftResetIn ¶
Click to show internal directories.
Click to hide internal directories.