Documentation ¶
Overview ¶
SPDX-FileCopyrightText: 2023-2024 Steffen Vogel <post@steffenvogel.de> SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- Variables
- type FeasibilityDistance
- type Interface
- type InterfaceHandler
- type InterfaceTable
- type Neighbour
- type NeighbourHandler
- type NeighbourTable
- type Parameters
- type PendingSeqNoRequest
- type PendingSeqNoRequestTable
- type Route
- type RouteTable
- type Source
- type SourceTable
- type Speaker
- type SpeakerConfig
Constants ¶
View Source
const ( DefaultIHUInterval = 12 * time.Second // 3 * DefaultMulticastHelloInterval DefaultInitialRequestTimeout = 2 * time.Second DefaultMulticastHelloInterval = 4 * time.Second DefaultRouteExpiryTime = 56 // 3.5 * DefaultUpdateInterval DefaultSourceGCTime = 3 * time.Minute DefaultUnicastHelloInterval = 0 // infinitive, no Hellos are send DefaultUpdateInterval = 16 * time.Second // 4 * DefaultMulticastHelloInterval DefaultUrgentTimeout = 200 * time.Millisecond DefaultIHUHoldTimeFactor = 3.5 // times the advertised IHU interval DefaultWiredLinkCost = 96 )
View Source
const ( // TrafficClassNetworkControl represents a class selector code-point // as defined by RFC 2474. // Routing protocols are recommended to use the __network control_ service class (CS6) // as recommended by RFC 4594. // We shift it by 2 bits to account for the ECN bits of the traffic class octet. // // See: // - https://datatracker.ietf.org/doc/html/rfc2474#autoid-9 // - https://datatracker.ietf.org/doc/html/rfc4594#section-3.1 TrafficClassNetworkControl = 48 << 2 // DiffServ / DSCP name CS6 )
Variables ¶
View Source
var ( Port = 6697 MulticastGroupIPv6 = netip.MustParseAddr("ff02::1:6") MulticastGroupIPv4 = netip.MustParseAddr("224.0.0.111") )
5. IANA Considerations https://datatracker.ietf.org/doc/html/rfc8966#name-iana-considerations
View Source
var DefaultParameters = Parameters{ MulticastHelloInterval: DefaultMulticastHelloInterval, UnicastHelloInterval: DefaultUnicastHelloInterval, UpdateInterval: DefaultUpdateInterval, IHUInterval: DefaultIHUInterval, RouteExpiryTime: DefaultRouteExpiryTime, InitialRequestTimeout: DefaultInitialRequestTimeout, UrgentTimeout: DefaultUrgentTimeout, SourceGCTime: DefaultSourceGCTime, NominalLinkCost: DefaultWiredLinkCost, }
Functions ¶
This section is empty.
Types ¶
type FeasibilityDistance ¶
type FeasibilityDistance struct { SeqNo proto.SequenceNumber Metric uint }
func (FeasibilityDistance) IsBetter ¶
func (d FeasibilityDistance) IsBetter(o FeasibilityDistance) bool
Less checks if the the feasibility is better than the provided one
type Interface ¶
type Interface struct { *net.Interface Neighbours NeighbourTable // contains filtered or unexported fields }
type InterfaceHandler ¶
type InterfaceTable ¶
func NewInterfaceTable ¶
func NewInterfaceTable() InterfaceTable
func (*InterfaceTable) Foreach ¶
func (t *InterfaceTable) Foreach(cb func(int, *Interface) error) error
func (*InterfaceTable) Insert ¶
func (t *InterfaceTable) Insert(i *Interface)
type Neighbour ¶
type Neighbour struct { Address proto.Address TxCost uint16 // contains filtered or unexported fields }
func (*Neighbour) RxCost ¶
A.2.1. k-out-of-j See: https://datatracker.ietf.org/doc/html/rfc8966#section-a.2.1
type NeighbourHandler ¶
type NeighbourTable ¶
func NewNeighbourTable ¶
func NewNeighbourTable() NeighbourTable
func (*NeighbourTable) Insert ¶
func (t *NeighbourTable) Insert(n *Neighbour)
type Parameters ¶
type Parameters struct { IHUHoldTimeFactor float32 IHUInterval time.Duration InitialRequestTimeout time.Duration MulticastHelloInterval time.Duration RouteExpiryTime time.Duration SourceGCTime time.Duration UnicastHelloInterval time.Duration UpdateInterval time.Duration UrgentTimeout time.Duration NominalLinkCost uint16 }
type PendingSeqNoRequest ¶
type PendingSeqNoRequestTable ¶
type PendingSeqNoRequestTable table.Table[pendingSeqNoRequestKey, *PendingSeqNoRequest]
func (*PendingSeqNoRequestTable) Insert ¶
func (t *PendingSeqNoRequestTable) Insert(req *PendingSeqNoRequest)
func (*PendingSeqNoRequestTable) Lookup ¶
func (t *PendingSeqNoRequestTable) Lookup(pfx proto.Prefix, rid proto.RouterID) (*PendingSeqNoRequest, bool)
type Route ¶
type Route struct { Source *Source Neighbour *Neighbour Metric uint16 SmoothedMetric uint16 SeqNo proto.SequenceNumber NextHop proto.Address Selected bool }
3.2.6. The Route Table https://datatracker.ietf.org/doc/html/rfc8966#section-3.2.6
type RouteTable ¶
func (*RouteTable) Insert ¶
func (t *RouteTable) Insert(r *Route)
type SourceTable ¶
func (*SourceTable) Insert ¶
func (t *SourceTable) Insert(s *Source)
type Speaker ¶
type Speaker struct { Interfaces InterfaceTable Sources SourceTable Routes RouteTable // contains filtered or unexported fields }
func NewSpeaker ¶
func NewSpeaker(cfg *SpeakerConfig) (*Speaker, error)
type SpeakerConfig ¶
type SpeakerConfig struct { *Parameters Handler any RouterID proto.RouterID InterfaceFilter func(string) bool RouteFilter func(*Route) proto.Metric UnicastPeers []net.UDPAddr Multicast bool Logger *slog.Logger }
func (*SpeakerConfig) SetDefaults ¶
func (c *SpeakerConfig) SetDefaults() error
Source Files ¶
Click to show internal directories.
Click to hide internal directories.