fibdef

package
v0.0.0-...-c2e30b8 Latest Latest
Warning

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

Go to latest
Published: Jan 26, 2021 License: NIST-PD-fallback Imports: 6 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

View Source
var (
	ErrNameTooLong = errors.New("FIB entry name too long")
	ErrNexthops    = errors.New("number of nexthops out of range")
	ErrStrategy    = errors.New("missing strategy")
)

Errors.

Functions

This section is empty.

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"`
}

EntryBody contains logical FIB entry contents except name.

func (EntryBody) Equals

func (body EntryBody) Equals(other EntryBody) bool

Equals determines whether two EntryBody records have the same values.

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
	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