fibdef

package
v0.0.0-...-6c4fd92 Latest Latest
Warning

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

Go to latest
Published: May 17, 2024 License: NIST-PD-fallback Imports: 9 Imported by: 0

Documentation

Overview

Package fibdef declares common data structures for FIB.

Index

Constants

View Source
const (
	MinCapacity     = 1<<8 - 1
	MaxCapacity     = 1<<31 - 1
	DefaultCapacity = 1<<16 - 1

	MinStartDepth     = 2
	MaxStartDepth     = 17
	DefaultStartDepth = 8
)

Limits and defaults.

View Source
const (
	// MaxNameLength is the maximum TLV-LENGTH of a FIB entry name.
	MaxNameLength = 494

	// MaxNexthops is the maximum number of nexthops in a FIB entry.
	MaxNexthops = 8

	// ScratchSize is the size of strategy scratch area.
	ScratchSize = 96
)

Variables

This section is empty.

Functions

func EntryBodyEquals

func EntryBodyEquals(lhs, rhs EntryBody) bool

EntryBodyEquals determines whether two EntryBody records have the same values.

Types

type Config

type Config struct {
	Capacity   int `json:"capacity,omitempty"`   // Capacity.
	NBuckets   int `json:"nBuckets,omitempty"`   // Hashtable buckets.
	StartDepth int `json:"startDepth,omitempty"` // 'M' in 2-stage LPM algorithm.
}

Config contains FIB configuration.

func (*Config) ApplyDefaults

func (cfg *Config) ApplyDefaults()

ApplyDefaults applies defaults.

type Entry

type Entry struct {
	EntryBody
	Name ndn.Name `json:"name"`
}

Entry contains logical FIB entry contents.

func (Entry) Validate

func (entry Entry) Validate() error

Validate checks entry fields.

type EntryBody

type EntryBody struct {
	Nexthops []iface.ID     `json:"nexthops"`
	Strategy int            `json:"strategy"`
	Params   map[string]any `json:"params"`
}

EntryBody contains logical FIB entry contents except name.

func (EntryBody) HasNextHop

func (entry EntryBody) HasNextHop(id iface.ID) bool

HasNextHop determines whether a nexthop face exists.

type EntryCounters

type EntryCounters struct {
	NRxInterests uint64 `json:"nRxInterests"`
	NRxData      uint64 `json:"nRxData"`
	NRxNacks     uint64 `json:"nRxNacks"`
	NTxInterests uint64 `json:"nTxInterests"`
}

EntryCounters contains entry counters.

func (EntryCounters) String

func (cnt EntryCounters) String() string

type RealUpdate

type RealUpdate struct {
	EntryBody
	Name     ndn.Name
	Action   UpdateAction
	WithVirt *VirtUpdate
}

RealUpdate represents a real entry update command.

type Update

type Update interface {
	Real() *RealUpdate
	Virt() *VirtUpdate
	Commit()
	Revert()
}

Update represents a tree update command.

type UpdateAction

type UpdateAction int

UpdateAction indicates entry update action.

const (
	ActInsert UpdateAction = iota + 1
	ActReplace
	ActErase
)

UpdateAction values.

type VirtUpdate

type VirtUpdate struct {
	Name    ndn.Name
	Action  UpdateAction
	HasReal bool
	Height  int
}

VirtUpdate represents a virtual entry update command.

Jump to

Keyboard shortcuts

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