Versions in this module Expand all Collapse all v0 v0.11.0 May 14, 2024 v0.10.0 Dec 21, 2023 v0.9.1 Oct 30, 2023 v0.9.0 Oct 16, 2023 v0.8.0 Jun 14, 2022 Changes in this version + var DefaultPathCount = 1 + var DefaultPathPolicy = &pathpol.Policy + var DefaultPerfPolicy = fingerPrintOrder + var ErrAlreadyRunning = serrors.New("is running") + var ObjectDestroyedError = serrors.New("object was destroyed") + func PathPolicyWithAllowedInterfaces(policy policies.PathPolicy, remote addr.IA, allowedInterfaces []uint64) policies.PathPolicy + type Aggregator struct + ExpiryInterval time.Duration + ReportingInterval time.Duration + RoutingUpdateChan chan (RemoteGateways) + func (a *Aggregator) Close(ctx context.Context) + func (a *Aggregator) Prefixes(remote addr.IA, gateway Gateway, prefixes []*net.IPNet) error + func (a *Aggregator) Run(ctx context.Context) error + type ConfigPublisher struct + func (n *ConfigPublisher) Publish(sp SessionPolicies, rp *routing.Policy) + func (n *ConfigPublisher) RoutingPolicy() *routing.Policy + func (n *ConfigPublisher) SubscribeRemoteIAs() <-chan []addr.IA + func (n *ConfigPublisher) SubscribeRoutingPolicies() <-chan *routing.Policy + func (n *ConfigPublisher) SubscribeSessionPolicies() <-chan SessionPolicies + type Consumer interface + Close func() + Updates func() <-chan RouteUpdate + type ConsumerFactory interface + NewConsumer func() Consumer + type DataplaneSession interface + Close func() + SetPaths func([]snet.Path) error + type DataplaneSessionFactory interface + New func(sessID uint8, policyID int, remoteIA addr.IA, remoteAddr net.Addr) DataplaneSession + type DefaultEngineFactory struct + DataplaneSessionFactory DataplaneSessionFactory + DeviceManager DeviceManager + Metrics EngineMetrics + PathMonitor PathMonitor + ProbeConnFactory PacketConnFactory + func (f *DefaultEngineFactory) New(table RoutingTable, sessions []*SessionConfig, ...) Worker + type Device interface + AddRoute func(ctx context.Context, r *Route) error + DeleteRoute func(ctx context.Context, r *Route) error + type DeviceHandle Device + type DeviceManager interface + Get func(ctx context.Context, ia addr.IA) (DeviceHandle, error) + type DeviceOpener interface + Open func(ctx context.Context, ia addr.IA) (Device, error) + type DeviceOpenerFunc func(ctx context.Context, ia addr.IA) (Device, error) + func (f DeviceOpenerFunc) Open(ctx context.Context, ia addr.IA) (Device, error) + type Diagnostics struct + Routes []Route + type DiagnosticsWriter interface + DiagnosticsWrite func(io.Writer) + type Discoverer interface + Gateways func(ctx context.Context) ([]Gateway, error) + type Engine struct + DataplaneSessionFactory DataplaneSessionFactory + DeviceManager DeviceManager + Metrics EngineMetrics + PathMonitor PathMonitor + ProbeConnFactory PacketConnFactory + RoutingTable RoutingTable + RoutingTableIndices map[int][]uint8 + SessionConfigs []*SessionConfig + func (e *Engine) Close(ctx context.Context) error + func (e *Engine) DiagnosticsWrite(w io.Writer) + func (e *Engine) Run(ctx context.Context) error + func (e *Engine) Status(w io.Writer) + type EngineController struct + ConfigurationUpdates <-chan []*SessionConfig + EngineFactory EngineFactory + RoutePublisherFactory PublisherFactory + RouteSourceIPv4 net.IP + RouteSourceIPv6 net.IP + RoutingTableFactory RoutingTableFactory + RoutingTableSwapper RoutingTableSwapper + SwapDelay time.Duration + func (c *EngineController) DiagnosticsWrite(w io.Writer) + func (c *EngineController) Run(ctx context.Context) error + func (c *EngineController) Status(w io.Writer) + type EngineFactory interface + New func(table RoutingTable, sessions []*SessionConfig, ...) Worker + type EngineMetrics struct + RouterMetrics RouterMetrics + SessionMetrics SessionMetrics + SessionMonitorMetrics SessionMonitorMetrics + type Event int + const EventDown + const EventUp + type Gateway struct + Control *net.UDPAddr + Data *net.UDPAddr + Interfaces []uint64 + Probe *net.UDPAddr + func (g Gateway) Equal(other Gateway) bool + type GatewayWatcher struct + DiscoverInterval time.Duration + DiscoverTimeout time.Duration + Discoverer Discoverer + Metrics GatewayWatcherMetrics + Remote addr.IA + Template PrefixWatcherConfig + func (w *GatewayWatcher) Run(ctx context.Context) error + type GatewayWatcherFactory interface + New func(context.Context, addr.IA, GatewayWatcherMetrics) Runner + type GatewayWatcherMetrics struct + DiscoveryErrors metrics.Counter + PrefixFetchErrors metrics.Counter + Remotes metrics.Gauge + RemotesChanges metrics.Counter + type LegacySessionPolicyAdapter struct + func (LegacySessionPolicyAdapter) Parse(ctx context.Context, raw []byte) (SessionPolicies, error) + type PacketConnFactory interface + New func() (net.PacketConn, error) + type PathMonitor interface + Register func(ctx context.Context, ia addr.IA, policies *policies.Policies, policyID string) PathMonitorRegistration + type PathMonitorRegistration interface + Close func() + Get func() pathhealth.Selection + type PktWriter interface + Write func(packet gopacket.Packet) + type PrefixConsumer interface + Prefixes func(remote addr.IA, gateway Gateway, prefixes []*net.IPNet) error + type PrefixFetcher interface + Close func() error + Prefixes func(ctx context.Context, gateway *net.UDPAddr) ([]*net.IPNet, error) + type PrefixFetcherFactory interface + NewPrefixFetcher func(ctx context.Context, gateway Gateway) PrefixFetcher + type PrefixWatcherConfig struct + Consumer PrefixConsumer + FetcherFactory PrefixFetcherFactory + PollInterval time.Duration + PollTimeout time.Duration + type PrefixesFilter struct + Consumer PrefixConsumer + LocalIA addr.IA + Metrics PrefixesFilterMetrics + PolicyProvider RoutingPolicyProvider + func (f PrefixesFilter) Prefixes(remote addr.IA, gateway Gateway, prefixes []*net.IPNet) error + type PrefixesFilterMetrics struct + PrefixesAccepted metrics.Gauge + PrefixesRejected metrics.Gauge + type Publisher interface + AddRoute func(route Route) + Close func() + DeleteRoute func(route Route) + type PublisherFactory interface + NewPublisher func() Publisher + type RemoteGateway struct + Gateway Gateway + Prefixes []*net.IPNet + type RemoteGateways struct + Gateways map[addr.IA][]RemoteGateway + type RemoteMonitor struct + GatewayWatcherFactory GatewayWatcherFactory + IAs <-chan []addr.IA + PrefixFetchErrors func(addr.IA) metrics.Counter + RemoteDiscoveryErrors func(addr.IA) metrics.Counter + RemotesChanges func(addr.IA) metrics.Counter + RemotesMonitored func(addr.IA) metrics.Gauge + func (rm *RemoteMonitor) Close(ctx context.Context) error + func (rm *RemoteMonitor) DiagnosticsWrite(w io.Writer) + func (rm *RemoteMonitor) Run(ctx context.Context) error + type Route struct + IA addr.IA + NextHop net.IP + Prefix *net.IPNet + Source net.IP + func (r *Route) String() string + type RouteUpdate struct + IsAdd bool + type Router struct + DataplaneSessions map[uint8]PktWriter + Events <-chan SessionEvent + Metrics RouterMetrics + RoutingTable RoutingTableWriter + RoutingTableIndices map[int][]uint8 + func (r *Router) Close(ctx context.Context) error + func (r *Router) DiagnosticsWrite(w io.Writer) + func (r *Router) Run(ctx context.Context) error + type RouterMetrics struct + RoutingChainHealthy func(routingChain int) metrics.Gauge + SessionChanges func(routingChain int) metrics.Counter + SessionsAlive func(routingChain int) metrics.Gauge + StateChanges func(routingChain int) metrics.Counter + type RoutingChain struct + Prefixes []*net.IPNet + RemoteIA addr.IA + TrafficMatchers []TrafficMatcher + type RoutingPolicyProvider interface + RoutingPolicy func() *routing.Policy + type RoutingTable interface + func NewPublishingRoutingTable(rcs []*RoutingChain, rt RoutingTable, routePublisher Publisher, ...) RoutingTable + type RoutingTableFactory interface + New func([]*RoutingChain) (RoutingTable, error) + type RoutingTableReader interface + RouteIPv4 func(pkt layers.IPv4) PktWriter + RouteIPv6 func(pkt layers.IPv6) PktWriter + type RoutingTableSwapper interface + SetRoutingTable func(RoutingTable) io.Closer + type RoutingTableWriter interface + ClearSession func(index int) error + SetSession func(index int, session PktWriter) error + type Runner interface + Run func(context.Context) error + type Session struct + DataplaneSession DataplaneSession + Events chan<- SessionEvent + ID uint8 + Metrics SessionMetrics + PathMonitorPollInterval time.Duration + PathMonitorRegistration PathMonitorRegistration + RemoteIA addr.IA + SessionMonitorEvents <-chan SessionEvent + func (s *Session) Run(ctx context.Context) error + type SessionConfig struct + Gateway Gateway + IA addr.IA + ID uint8 + PathCount int + PathPolicy policies.PathPolicy + PerfPolicy policies.PerfPolicy + PolicyID int + Prefixes []*net.IPNet + TrafficMatcher pktcls.Cond + type SessionConfigurator struct + RoutingUpdates <-chan RemoteGateways + SessionConfigurations chan<- []*SessionConfig + SessionPolicies <-chan SessionPolicies + func (sc *SessionConfigurator) Close(ctx context.Context) error + func (sc *SessionConfigurator) DiagnosticsWrite(w io.Writer) + func (sc *SessionConfigurator) Run(ctx context.Context) error + type SessionEvent struct + Event Event + SessionID uint8 + type SessionMetrics struct + PathChanges metrics.Counter + type SessionMonitor struct + Events chan<- SessionEvent + HealthExpiration time.Duration + ID uint8 + Metrics SessionMonitorMetrics + Paths PathMonitorRegistration + ProbeAddr *net.UDPAddr + ProbeConn net.PacketConn + ProbeInterval time.Duration + RemoteIA addr.IA + func (m *SessionMonitor) Close(ctx context.Context) error + func (m *SessionMonitor) Run(ctx context.Context) error + type SessionMonitorMetrics struct + IsHealthy metrics.Gauge + ProbeReplies metrics.Counter + Probes metrics.Counter + StateChanges metrics.Counter + type SessionPolicies []SessionPolicy + func LoadSessionPolicies(ctx context.Context, file string, parser SessionPolicyParser) (SessionPolicies, error) + func (p SessionPolicies) Copy() SessionPolicies + func (p SessionPolicies) RemoteIAs() []addr.IA + type SessionPolicy struct + IA addr.IA + ID int + PathCount int + PathPolicy policies.PathPolicy + PerfPolicy policies.PerfPolicy + Prefixes []*net.IPNet + TrafficMatcher pktcls.Cond + func (sp SessionPolicy) Copy() SessionPolicy + type SessionPolicyParser interface + Parse func(context.Context, []byte) (SessionPolicies, error) + type TrafficMatcher struct + ID int + Matcher pktcls.Cond + type Worker interface + Close func(context.Context) error + Run func(context.Context) error