server

package
v0.0.0-...-5ab4575 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2018 License: Apache-2.0 Imports: 37 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BgpServer

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

func NewBgpServer

func NewBgpServer() *BgpServer

func (*BgpServer) AddBmp

func (s *BgpServer) AddBmp(ctx context.Context, r *api.AddBmpRequest) error

func (*BgpServer) AddDefinedSet

func (s *BgpServer) AddDefinedSet(ctx context.Context, r *api.AddDefinedSetRequest) error

func (*BgpServer) AddDynamicNeighbor

func (s *BgpServer) AddDynamicNeighbor(ctx context.Context, r *api.AddDynamicNeighborRequest) error

func (*BgpServer) AddPath

func (*BgpServer) AddPeer

func (s *BgpServer) AddPeer(ctx context.Context, r *api.AddPeerRequest) error

func (*BgpServer) AddPeerGroup

func (s *BgpServer) AddPeerGroup(ctx context.Context, r *api.AddPeerGroupRequest) error

func (*BgpServer) AddPolicy

func (s *BgpServer) AddPolicy(ctx context.Context, r *api.AddPolicyRequest) error

func (*BgpServer) AddPolicyAssignment

func (s *BgpServer) AddPolicyAssignment(ctx context.Context, r *api.AddPolicyAssignmentRequest) error

func (*BgpServer) AddRpki

func (s *BgpServer) AddRpki(ctx context.Context, r *api.AddRpkiRequest) error

func (*BgpServer) AddStatement

func (s *BgpServer) AddStatement(ctx context.Context, r *api.AddStatementRequest) error

func (*BgpServer) AddVrf

func (s *BgpServer) AddVrf(ctx context.Context, r *api.AddVrfRequest) error

func (*BgpServer) DeleteBmp

func (s *BgpServer) DeleteBmp(ctx context.Context, r *api.DeleteBmpRequest) error

func (*BgpServer) DeleteDefinedSet

func (s *BgpServer) DeleteDefinedSet(ctx context.Context, r *api.DeleteDefinedSetRequest) error

func (*BgpServer) DeletePath

func (s *BgpServer) DeletePath(ctx context.Context, r *api.DeletePathRequest) error

func (*BgpServer) DeletePeer

func (s *BgpServer) DeletePeer(ctx context.Context, r *api.DeletePeerRequest) error

func (*BgpServer) DeletePeerGroup

func (s *BgpServer) DeletePeerGroup(ctx context.Context, r *api.DeletePeerGroupRequest) error

func (*BgpServer) DeletePolicy

func (s *BgpServer) DeletePolicy(ctx context.Context, r *api.DeletePolicyRequest) error

func (*BgpServer) DeletePolicyAssignment

func (s *BgpServer) DeletePolicyAssignment(ctx context.Context, r *api.DeletePolicyAssignmentRequest) error

func (*BgpServer) DeleteRpki

func (s *BgpServer) DeleteRpki(ctx context.Context, r *api.DeleteRpkiRequest) error

func (*BgpServer) DeleteStatement

func (s *BgpServer) DeleteStatement(ctx context.Context, r *api.DeleteStatementRequest) error

func (*BgpServer) DeleteVrf

func (s *BgpServer) DeleteVrf(ctx context.Context, r *api.DeleteVrfRequest) error

func (*BgpServer) DisableMrt

func (s *BgpServer) DisableMrt(ctx context.Context, r *api.DisableMrtRequest) error

func (*BgpServer) DisableNeighbor

func (s *BgpServer) DisableNeighbor(ctx context.Context, r *api.DisablePeerRequest) error

func (*BgpServer) DisableRpki

func (s *BgpServer) DisableRpki(ctx context.Context, r *api.DisableRpkiRequest) error

func (*BgpServer) EnableMrt

func (s *BgpServer) EnableMrt(ctx context.Context, r *api.EnableMrtRequest) error

func (*BgpServer) EnableNeighbor

func (s *BgpServer) EnableNeighbor(ctx context.Context, r *api.EnablePeerRequest) error

func (*BgpServer) EnableRpki

func (s *BgpServer) EnableRpki(ctx context.Context, r *api.EnableRpkiRequest) error

func (*BgpServer) EnableZebra

func (s *BgpServer) EnableZebra(ctx context.Context, r *api.EnableZebraRequest) error

func (*BgpServer) GetBgp

func (*BgpServer) GetTable

func (*BgpServer) ListDefinedSet

func (s *BgpServer) ListDefinedSet(ctx context.Context, r *api.ListDefinedSetRequest) (sets []*api.DefinedSet, err error)

func (*BgpServer) ListPath

func (s *BgpServer) ListPath(ctx context.Context, r *api.ListPathRequest) ([]*api.Destination, error)

func (*BgpServer) ListPeer

func (s *BgpServer) ListPeer(ctx context.Context, r *api.ListPeerRequest) ([]*api.Peer, error)

func (*BgpServer) ListPolicy

func (s *BgpServer) ListPolicy(ctx context.Context, r *api.ListPolicyRequest) ([]*api.Policy, error)

func (*BgpServer) ListPolicyAssignment

func (s *BgpServer) ListPolicyAssignment(ctx context.Context, r *api.ListPolicyAssignmentRequest) ([]*api.PolicyAssignment, error)

func (*BgpServer) ListRpki

func (s *BgpServer) ListRpki(ctx context.Context, r *api.ListRpkiRequest) (l []*api.Rpki, err error)

func (*BgpServer) ListRpkiTable

func (s *BgpServer) ListRpkiTable(ctx context.Context, r *api.ListRpkiTableRequest) (l []*api.Roa, err error)

func (*BgpServer) ListStatement

func (s *BgpServer) ListStatement(ctx context.Context, r *api.ListStatementRequest) ([]*api.Statement, error)

func (*BgpServer) ListVrf

func (s *BgpServer) ListVrf(ctx context.Context, _ *api.ListVrfRequest) (l []*api.Vrf)

func (*BgpServer) Listeners

func (server *BgpServer) Listeners(addr string) []*net.TCPListener

func (*BgpServer) ResetPeer

func (s *BgpServer) ResetPeer(ctx context.Context, r *api.ResetPeerRequest) error

func (*BgpServer) ResetRpki

func (s *BgpServer) ResetRpki(ctx context.Context, r *api.ResetRpkiRequest) error

func (*BgpServer) Serve

func (server *BgpServer) Serve()

func (*BgpServer) SetPolicies

func (s *BgpServer) SetPolicies(ctx context.Context, r *api.SetPoliciesRequest) error

func (*BgpServer) SetPolicyAssignment

func (s *BgpServer) SetPolicyAssignment(ctx context.Context, r *api.SetPolicyAssignmentRequest) error

func (*BgpServer) ShutdownPeer

func (s *BgpServer) ShutdownPeer(ctx context.Context, r *api.ShutdownPeerRequest) error

func (*BgpServer) StartBgp

func (s *BgpServer) StartBgp(ctx context.Context, r *api.StartBgpRequest) error

func (*BgpServer) StopBgp

func (s *BgpServer) StopBgp(ctx context.Context, r *api.StopBgpRequest) error

func (*BgpServer) UpdateNeighbor

func (s *BgpServer) UpdateNeighbor(ctx context.Context, r *api.UpdatePeerRequest) (rsp *api.UpdatePeerResponse, err error)

func (*BgpServer) UpdatePeerGroup

func (s *BgpServer) UpdatePeerGroup(ctx context.Context, r *api.UpdatePeerGroupRequest) (rsp *api.UpdatePeerGroupResponse, err error)

func (*BgpServer) Watch

func (s *BgpServer) Watch(opts ...WatchOption) (w *Watcher)

type Server

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

func NewGrpcServer

func NewGrpcServer(b *BgpServer, hosts string) *Server

func NewServer

func NewServer(b *BgpServer, g *grpc.Server, hosts string) *Server

func (*Server) AddBmp

func (s *Server) AddBmp(ctx context.Context, r *api.AddBmpRequest) (*empty.Empty, error)

func (*Server) AddDefinedSet

func (s *Server) AddDefinedSet(ctx context.Context, r *api.AddDefinedSetRequest) (*empty.Empty, error)

func (*Server) AddDynamicNeighbor

func (s *Server) AddDynamicNeighbor(ctx context.Context, r *api.AddDynamicNeighborRequest) (*empty.Empty, error)

func (*Server) AddPath

func (s *Server) AddPath(ctx context.Context, r *api.AddPathRequest) (*api.AddPathResponse, error)

func (*Server) AddPathStream

func (s *Server) AddPathStream(stream api.GobgpApi_AddPathStreamServer) error

func (*Server) AddPeer

func (s *Server) AddPeer(ctx context.Context, r *api.AddPeerRequest) (*empty.Empty, error)

func (*Server) AddPeerGroup

func (s *Server) AddPeerGroup(ctx context.Context, r *api.AddPeerGroupRequest) (*empty.Empty, error)

func (*Server) AddPolicy

func (s *Server) AddPolicy(ctx context.Context, r *api.AddPolicyRequest) (*empty.Empty, error)

func (*Server) AddPolicyAssignment

func (s *Server) AddPolicyAssignment(ctx context.Context, r *api.AddPolicyAssignmentRequest) (*empty.Empty, error)

func (*Server) AddRpki

func (s *Server) AddRpki(ctx context.Context, r *api.AddRpkiRequest) (*empty.Empty, error)

func (*Server) AddStatement

func (s *Server) AddStatement(ctx context.Context, r *api.AddStatementRequest) (*empty.Empty, error)

func (*Server) AddVrf

func (s *Server) AddVrf(ctx context.Context, r *api.AddVrfRequest) (*empty.Empty, error)

func (*Server) DeleteBmp

func (s *Server) DeleteBmp(ctx context.Context, r *api.DeleteBmpRequest) (*empty.Empty, error)

func (*Server) DeleteDefinedSet

func (s *Server) DeleteDefinedSet(ctx context.Context, r *api.DeleteDefinedSetRequest) (*empty.Empty, error)

func (*Server) DeletePath

func (s *Server) DeletePath(ctx context.Context, r *api.DeletePathRequest) (*empty.Empty, error)

func (*Server) DeletePeer

func (s *Server) DeletePeer(ctx context.Context, r *api.DeletePeerRequest) (*empty.Empty, error)

func (*Server) DeletePeerGroup

func (s *Server) DeletePeerGroup(ctx context.Context, r *api.DeletePeerGroupRequest) (*empty.Empty, error)

func (*Server) DeletePolicy

func (s *Server) DeletePolicy(ctx context.Context, r *api.DeletePolicyRequest) (*empty.Empty, error)

func (*Server) DeletePolicyAssignment

func (s *Server) DeletePolicyAssignment(ctx context.Context, r *api.DeletePolicyAssignmentRequest) (*empty.Empty, error)

func (*Server) DeleteRpki

func (s *Server) DeleteRpki(ctx context.Context, r *api.DeleteRpkiRequest) (*empty.Empty, error)

func (*Server) DeleteStatement

func (s *Server) DeleteStatement(ctx context.Context, r *api.DeleteStatementRequest) (*empty.Empty, error)

func (*Server) DeleteVrf

func (s *Server) DeleteVrf(ctx context.Context, r *api.DeleteVrfRequest) (*empty.Empty, error)

func (*Server) DisableMrt

func (s *Server) DisableMrt(ctx context.Context, r *api.DisableMrtRequest) (*empty.Empty, error)

func (*Server) DisablePeer

func (s *Server) DisablePeer(ctx context.Context, r *api.DisablePeerRequest) (*empty.Empty, error)

func (*Server) DisableRpki

func (s *Server) DisableRpki(ctx context.Context, r *api.DisableRpkiRequest) (*empty.Empty, error)

func (*Server) EnableMrt

func (s *Server) EnableMrt(ctx context.Context, r *api.EnableMrtRequest) (*empty.Empty, error)

func (*Server) EnablePeer

func (s *Server) EnablePeer(ctx context.Context, r *api.EnablePeerRequest) (*empty.Empty, error)

func (*Server) EnableRpki

func (s *Server) EnableRpki(ctx context.Context, r *api.EnableRpkiRequest) (*empty.Empty, error)

func (*Server) EnableZebra

func (s *Server) EnableZebra(ctx context.Context, r *api.EnableZebraRequest) (*empty.Empty, error)

func (*Server) GetBgp

func (s *Server) GetBgp(ctx context.Context, r *api.GetBgpRequest) (*api.GetBgpResponse, error)

func (*Server) GetTable

func (*Server) ListDefinedSet

func (*Server) ListPath

func (s *Server) ListPath(r *api.ListPathRequest, stream api.GobgpApi_ListPathServer) error

func (*Server) ListPeer

func (s *Server) ListPeer(r *api.ListPeerRequest, stream api.GobgpApi_ListPeerServer) error

func (*Server) ListPolicy

func (s *Server) ListPolicy(r *api.ListPolicyRequest, stream api.GobgpApi_ListPolicyServer) error

func (*Server) ListRpki

func (s *Server) ListRpki(r *api.ListRpkiRequest, stream api.GobgpApi_ListRpkiServer) error

func (*Server) ListRpkiTable

func (*Server) ListStatement

func (*Server) ListVrf

func (s *Server) ListVrf(r *api.ListVrfRequest, stream api.GobgpApi_ListVrfServer) error

func (*Server) MonitorPeer

func (s *Server) MonitorPeer(arg *api.MonitorPeerRequest, stream api.GobgpApi_MonitorPeerServer) error

func (*Server) MonitorTable

func (s *Server) MonitorTable(arg *api.MonitorTableRequest, stream api.GobgpApi_MonitorTableServer) error

func (*Server) ResetPeer

func (s *Server) ResetPeer(ctx context.Context, r *api.ResetPeerRequest) (*empty.Empty, error)

func (*Server) ResetRpki

func (s *Server) ResetRpki(ctx context.Context, r *api.ResetRpkiRequest) (*empty.Empty, error)

func (*Server) Serve

func (s *Server) Serve() error

func (*Server) SetPolicies

func (s *Server) SetPolicies(ctx context.Context, r *api.SetPoliciesRequest) (*empty.Empty, error)

func (*Server) SetPolicyAssignment

func (s *Server) SetPolicyAssignment(ctx context.Context, r *api.SetPolicyAssignmentRequest) (*empty.Empty, error)

func (*Server) ShutdownPeer

func (s *Server) ShutdownPeer(ctx context.Context, r *api.ShutdownPeerRequest) (*empty.Empty, error)

func (*Server) StartBgp

func (s *Server) StartBgp(ctx context.Context, r *api.StartBgpRequest) (*empty.Empty, error)

func (*Server) StopBgp

func (s *Server) StopBgp(ctx context.Context, r *api.StopBgpRequest) (*empty.Empty, error)

func (*Server) UpdatePeer

func (*Server) UpdatePeerGroup

type WatchEvent

type WatchEvent interface {
}

type WatchEventAdjIn

type WatchEventAdjIn struct {
	PathList []*table.Path
}

type WatchEventBestPath

type WatchEventBestPath struct {
	PathList      []*table.Path
	MultiPathList [][]*table.Path
	Vrf           map[string]uint32
}

type WatchEventMessage

type WatchEventMessage struct {
	Message      *bgp.BGPMessage
	PeerAS       uint32
	LocalAS      uint32
	PeerAddress  net.IP
	LocalAddress net.IP
	PeerID       net.IP
	FourBytesAs  bool
	Timestamp    time.Time
	IsSent       bool
}

type WatchEventPeerState

type WatchEventPeerState struct {
	PeerAS        uint32
	LocalAS       uint32
	PeerAddress   net.IP
	LocalAddress  net.IP
	PeerPort      uint16
	LocalPort     uint16
	PeerID        net.IP
	SentOpen      *bgp.BGPMessage
	RecvOpen      *bgp.BGPMessage
	State         bgp.FSMState
	StateReason   *fsmStateReason
	AdminState    adminState
	Timestamp     time.Time
	PeerInterface string
}

type WatchEventTable

type WatchEventTable struct {
	RouterId string
	PathList map[string][]*table.Path
	Neighbor []*config.Neighbor
}

type WatchEventType

type WatchEventType string
const (
	WATCH_EVENT_TYPE_BEST_PATH   WatchEventType = "bestpath"
	WATCH_EVENT_TYPE_PRE_UPDATE  WatchEventType = "preupdate"
	WATCH_EVENT_TYPE_POST_UPDATE WatchEventType = "postupdate"
	WATCH_EVENT_TYPE_PEER_STATE  WatchEventType = "peerstate"
	WATCH_EVENT_TYPE_TABLE       WatchEventType = "table"
	WATCH_EVENT_TYPE_RECV_MSG    WatchEventType = "receivedmessage"
)

type WatchEventUpdate

type WatchEventUpdate struct {
	Message      *bgp.BGPMessage
	PeerAS       uint32
	LocalAS      uint32
	PeerAddress  net.IP
	LocalAddress net.IP
	PeerID       net.IP
	FourBytesAs  bool
	Timestamp    time.Time
	Payload      []byte
	PostPolicy   bool
	Init         bool
	PathList     []*table.Path
	Neighbor     *config.Neighbor
}

type WatchOption

type WatchOption func(*watchOptions)

func WatchBestPath

func WatchBestPath(current bool) WatchOption

func WatchMessage

func WatchMessage(isSent bool) WatchOption

func WatchPeerState

func WatchPeerState(current bool) WatchOption

func WatchPostUpdate

func WatchPostUpdate(current bool) WatchOption

func WatchTableName

func WatchTableName(name string) WatchOption

func WatchUpdate

func WatchUpdate(current bool) WatchOption

type Watcher

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

func (*Watcher) Event

func (w *Watcher) Event() <-chan WatchEvent

func (*Watcher) Generate

func (w *Watcher) Generate(t WatchEventType) error

func (*Watcher) Stop

func (w *Watcher) Stop()

Jump to

Keyboard shortcuts

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