bgp

package
v0.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 18, 2024 License: Apache-2.0 Imports: 11 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	AS       uint32
	RouterID string
	SourceIP string
	SourceIF string

	HoldTime          uint64
	KeepaliveInterval uint64

	Peers []Peer
}

Config defines the BGP server configuration

type Peer

type Peer struct {
	Address  string
	AS       uint32
	Password string
	MultiHop bool
}

Peer defines a BGP Peer

func ParseBGPPeerConfig

func ParseBGPPeerConfig(config string) (bgpPeers []Peer, err error)

ParseBGPPeerConfig - take a string and parses it into an array of peers

type Server

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

Server manages a server object

func NewBGPServer

func NewBGPServer(c *Config, peerStateChangeCallback func(*api.WatchEventResponse_PeerEvent)) (b *Server, err error)

NewBGPServer takes a configuration and returns a running BGP server instance

func (*Server) AddHost

func (b *Server) AddHost(addr string) (err error)

AddHost will update peers of a host

func (*Server) AddPeer

func (b *Server) AddPeer(peer Peer) (err error)

AddPeer will add peers to the BGP configuration

func (*Server) Close

func (b *Server) Close() error

Close will stop a running BGP Server

func (*Server) DelHost

func (b *Server) DelHost(addr string) (err error)

DelHost will inform peers to remove a host

Jump to

Keyboard shortcuts

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