server

package
v0.0.0-...-429388b Latest Latest
Warning

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

Go to latest
Published: May 8, 2026 License: Apache-2.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetRid

func GetRid(srid string) (bgp.BGPID, error)

GetRid converts the string RID to actual BGPID.

func LoadConfigFile

func LoadConfigFile(filename string) (map[string]PeerConfig, error)

LoadConfigFile reads and parses the JSON configuration file. It returns a map of IP address strings to PeerConfig for O(1) lookups.

Types

type BenchStats

type BenchStats struct {
	Duration        time.Duration
	GCCycles        uint32
	TotalAlloc      uint64
	HeapObjs        uint64
	SteadyStateHeap uint64
}

IngestBenchmark runs a full-table ingestion benchmark. It returns stats about the run.

func RunIngestBenchmark

func RunIngestBenchmark(prefixCount int, useAddPath bool) (BenchStats, error)

type Config

type Config struct {
	Rid               bgp.BGPID
	Port              int
	GrpcPort          int
	HttpPort          int
	Logfile           string
	Eor               bool
	Quiet             bool
	IgnoreCommunities bool
	PeersConfig       map[string]PeerConfig
	Asn               uint32
	GRRestartTime     time.Duration
	GREoRFallbackTime time.Duration
}

type ConfigFile

type ConfigFile struct {
	Peers []PeerConfig `json:"peers"`
}

ConfigFile represents the JSON configuration file

type Family

type Family struct {
	AFI  uint16
	SAFI uint8
}

type GracefulRestartManager

type GracefulRestartManager interface {
	HandlePeerDown(ctx context.Context, peerIP string) error
	ProcessCapExchange(ctx context.Context, peerIP string, params bgp.Parameters) error
	ReceiveEoR(ctx context.Context, peerIP string, family Family) error
	CompleteGracefulRestart(ctx context.Context, peerIP string) error
}

GracefulRestartManager defines the interface for managing BGP Graceful Restart state transitions for the receiving speaker (helper mode).

func NewGracefulRestartManager

func NewGracefulRestartManager(s *Server) GracefulRestartManager

NewGracefulRestartManager creates a new instance of the default GR manager.

type PeerConfig

type PeerConfig struct {
	IP       string `json:"ip"`
	Name     string `json:"name,omitempty"`
	Password string `json:"password,omitempty"`
}

PeerConfig holds the configuration for a single peer

type PeerStatus

type PeerStatus uint32

PeerStatus defines the atomic state values for the Graceful Restart state machine.

const (
	StatusEstablished PeerStatus = iota
	StatusGRStale
	StatusWaitingForEOR
	StatusPurging
	StatusPurgingRemainingStale
)

func (PeerStatus) String

func (s PeerStatus) String() string

type Server

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

func New

func New(conf Config) *Server

func (*Server) Start

func (s *Server) Start()

func (*Server) Stop

func (s *Server) Stop()

Jump to

Keyboard shortcuts

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