Documentation ¶
Index ¶
- Variables
- type DebugInfo
- type DebugInfoPeer
- type DebugInfoPrefix
- type DebugInfoServer
- type Server
- func (s *Server) AddPeer(address net.IP, asn uint32, password string, holdTime uint64) error
- func (s *Server) AddPrefix(subnet net.IPNet, nexthop net.IP, owner string) error
- func (s *Server) Debug() DebugInfo
- func (s *Server) Reconfigure(address string, asn uint32, routerID net.IP) error
- func (s *Server) RemovePeer(address net.IP) error
- func (s *Server) RemovePrefix(subnet net.IPNet, nexthop net.IP) error
- func (s *Server) RemovePrefixByOwner(owner string) error
- func (s *Server) Start(address string, asn uint32, routerID net.IP) error
- func (s *Server) Stop() error
Constants ¶
This section is empty.
Variables ¶
var ErrBadRouterID = fmt.Errorf("Invalid router-id (must be IPv4 address")
ErrBadRouterID is returned when an invalid router-id is provided.
var ErrPeerNotFound = fmt.Errorf("Peer not found")
ErrPeerNotFound is returned when a user provided peer couldn't be found.
var ErrPrefixNotFound = fmt.Errorf("Prefix not found")
ErrPrefixNotFound is returned when a user provided prefix couldn't be found.
Functions ¶
This section is empty.
Types ¶
type DebugInfo ¶
type DebugInfo struct { Server DebugInfoServer `json:"server" yaml:"server"` Prefixes []DebugInfoPrefix `json:"prefixes" yaml:"prefixes"` Peers []DebugInfoPeer `json:"peers" yaml:"peers"` }
DebugInfo represents the internal debug state of the BGP server.
type DebugInfoPeer ¶
type DebugInfoPeer struct { Address string `json:"address" yaml:"address"` ASN uint32 `json:"asn" yaml:"asn"` Password string `json:"password" yaml:"password"` Count int `json:"count" yaml:"count"` HoldTime uint64 `json:"holdtime" yaml:"holdtime"` }
DebugInfoPeer exposes details on a single BGP peer.
type DebugInfoPrefix ¶
type DebugInfoPrefix struct { Owner string `json:"owner" yaml:"owner"` Prefix string `json:"prefix" yaml:"prefix"` Nexthop string `json:"nexthop" yaml:"nexthop"` }
DebugInfoPrefix exposes details on a single BGP prefix.
type DebugInfoServer ¶
type DebugInfoServer struct { Address string `json:"address" yaml:"address"` ASN uint32 `json:"asn" yaml:"asn"` RouterID string `json:"router_id" yaml:"router_id"` Running bool `json:"running" yaml:"running"` }
DebugInfoServer exposes the shared listener configuration.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server represents a BGP server instance.
func (*Server) Reconfigure ¶
Reconfigure updates the listener with a new configuration..
func (*Server) RemovePeer ¶
RemovePeer removes a prefix from the BGP server.
func (*Server) RemovePrefix ¶
RemovePrefix removes a prefix from the BGP server.
func (*Server) RemovePrefixByOwner ¶
RemovePrefixByOwner removes all prefixes for the provided owner.