Documentation
¶
Index ¶
- type Fib
- type FibEntry
- type NeighborState
- type NeighborTable
- func (nt *NeighborTable) Add(name enc.Name) *NeighborState
- func (nt *NeighborTable) Get(name enc.Name) *NeighborState
- func (nt *NeighborTable) GetAll() []*NeighborState
- func (nt *NeighborTable) GetH(nameHash uint64) *NeighborState
- func (nt *NeighborTable) Remove(name enc.Name)
- func (nt *NeighborTable) Size() int
- func (nt *NeighborTable) String() string
- type PrefixEntry
- type PrefixNextHop
- type PrefixTable
- func (pt *PrefixTable) Announce(name enc.Name, face uint64, cost uint64)
- func (pt *PrefixTable) Apply(wire enc.Wire) (dirty bool)
- func (pt *PrefixTable) GetRouter(name enc.Name) *PrefixTableRouter
- func (pt *PrefixTable) Reset()
- func (pt *PrefixTable) Snap() enc.Wire
- func (pt *PrefixTable) String() string
- func (pt *PrefixTable) Withdraw(name enc.Name, face uint64)
- type PrefixTableRouter
- type Rib
- func (r *Rib) Advert() *tlv.Advertisement
- func (r *Rib) DirtyResetNextHop(nextHop enc.Name)
- func (r *Rib) Entries() iter.Seq2[uint64, *RibEntry]
- func (rib *Rib) GetFibEntries(nt *NeighborTable, router uint64) (entries []FibEntry)
- func (r *Rib) Has(destName enc.Name) bool
- func (r *Rib) Print()
- func (r *Rib) Prune() bool
- func (r *Rib) RemoveNextHop(nextHop enc.Name) bool
- func (r *Rib) Set(destName enc.Name, nextHop enc.Name, cost uint64) bool
- func (r *Rib) Size() int
- func (r *Rib) String() string
- type RibEntry
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Fib ¶
type Fib struct {
// contains filtered or unexported fields
}
func (*Fib) RemoveUnmarked ¶
func (fib *Fib) RemoveUnmarked()
type NeighborState ¶
type NeighborState struct { // neighbor name Name enc.Name // advertisement boot time for neighbor AdvertBoot uint64 // advertisement sequence number for neighbor AdvertSeq uint64 // most recent advertisement Advert *tlv.Advertisement // contains filtered or unexported fields }
func (*NeighborState) IsDead ¶
func (ns *NeighborState) IsDead() bool
func (*NeighborState) RecvPing ¶
func (ns *NeighborState) RecvPing(faceId uint64, active bool) (error, bool)
Call this when a ping is received from a face. This will automatically register the face route with the neighbor and update the last seen time for the neighbor. Return => true if the face ID has changed
type NeighborTable ¶
type NeighborTable struct {
// contains filtered or unexported fields
}
func NewNeighborTable ¶
func NewNeighborTable(config *config.Config, nfdc *nfdc.NfdMgmtThread) *NeighborTable
func (*NeighborTable) Add ¶
func (nt *NeighborTable) Add(name enc.Name) *NeighborState
func (*NeighborTable) Get ¶
func (nt *NeighborTable) Get(name enc.Name) *NeighborState
func (*NeighborTable) GetAll ¶
func (nt *NeighborTable) GetAll() []*NeighborState
func (*NeighborTable) GetH ¶
func (nt *NeighborTable) GetH(nameHash uint64) *NeighborState
func (*NeighborTable) Remove ¶
func (nt *NeighborTable) Remove(name enc.Name)
func (*NeighborTable) Size ¶ added in v1.4.3
func (nt *NeighborTable) Size() int
func (*NeighborTable) String ¶ added in v1.4.3
func (nt *NeighborTable) String() string
type PrefixEntry ¶
type PrefixEntry struct { Name enc.Name Cost uint64 // Only known for the local router NextHops []PrefixNextHop }
type PrefixNextHop ¶ added in v1.5.2
type PrefixTable ¶
type PrefixTable struct {
// contains filtered or unexported fields
}
func NewPrefixTable ¶
func NewPrefixTable(config *config.Config, publish func(enc.Wire)) *PrefixTable
func (*PrefixTable) Announce ¶
func (pt *PrefixTable) Announce(name enc.Name, face uint64, cost uint64)
func (*PrefixTable) Apply ¶
func (pt *PrefixTable) Apply(wire enc.Wire) (dirty bool)
Applies ops from a list. Returns if dirty.
func (*PrefixTable) GetRouter ¶
func (pt *PrefixTable) GetRouter(name enc.Name) *PrefixTableRouter
func (*PrefixTable) Reset ¶ added in v1.4.3
func (pt *PrefixTable) Reset()
func (*PrefixTable) Snap ¶ added in v1.5.0
func (pt *PrefixTable) Snap() enc.Wire
func (*PrefixTable) String ¶ added in v1.4.3
func (pt *PrefixTable) String() string
type PrefixTableRouter ¶
type PrefixTableRouter struct {
Prefixes map[string]*PrefixEntry
}
type Rib ¶
type Rib struct {
// contains filtered or unexported fields
}
Routing Information Base (RIB)
func (*Rib) Advert ¶
func (r *Rib) Advert() *tlv.Advertisement
Get all advertisement entries in the RIB.
func (*Rib) DirtyResetNextHop ¶
Resets all entries for a given next hop to infinity without refreshing any entry. This is specifically intended for the RIB update algorithm to avoid unnecessary changes.
func (*Rib) GetFibEntries ¶
func (rib *Rib) GetFibEntries(nt *NeighborTable, router uint64) (entries []FibEntry)
Get the FIB entry for a name prefix. router should be hash of the router name.
func (*Rib) Prune ¶
Whenever the RIB is changed, this must be called manually to remove unreachable destinations. Returns true if the Advertisement might change.
func (*Rib) RemoveNextHop ¶
Remove all entries with a given next hop. Returns true if the Advertisement might change.