table

package
v1.4.3 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2025 License: MIT Imports: 12 Imported by: 0

Documentation

Index

Constants

View Source
const PREFIX_SNAP_THRESHOLD = 100

Variables

Functions

This section is empty.

Types

type Fib

type Fib struct {
	// contains filtered or unexported fields
}

func NewFib

func NewFib(config *config.Config, nfdc *nfdc.NfdMgmtThread) *Fib

func (*Fib) MarkH

func (fib *Fib) MarkH(name uint64)

func (*Fib) RemoveUnmarked

func (fib *Fib) RemoveUnmarked()

func (*Fib) Size added in v1.4.3

func (fib *Fib) Size() int

func (*Fib) UnmarkAll

func (fib *Fib) UnmarkAll()

func (*Fib) Update

func (fib *Fib) Update(name enc.Name, newEntries []FibEntry) bool

func (*Fib) UpdateH

func (fib *Fib) UpdateH(nameH uint64, name enc.Name, newEntries []FibEntry) bool

type FibEntry

type FibEntry struct {
	// next hop face Id
	FaceId uint64
	// cost in this entry
	Cost uint64
	// contains filtered or unexported fields
}

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
}

type PrefixTable

type PrefixTable struct {
	// contains filtered or unexported fields
}

func NewPrefixTable

func NewPrefixTable(
	config *config.Config,
	client ndn.Client,
	svs *ndn_sync.SvSync,
) *PrefixTable

func (*PrefixTable) Announce

func (pt *PrefixTable) Announce(name enc.Name)

func (*PrefixTable) Apply

func (pt *PrefixTable) Apply(ops *tlv.PrefixOpList) (dirty bool)

Applies ops from a list. Returns if dirty.

func (*PrefixTable) ApplyData added in v1.4.3

func (pt *PrefixTable) ApplyData(name enc.Name, data []byte, router *PrefixTableRouter) bool

Process the received prefix data. 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) String added in v1.4.3

func (pt *PrefixTable) String() string

func (*PrefixTable) Withdraw

func (pt *PrefixTable) Withdraw(name enc.Name)

type PrefixTableRouter

type PrefixTableRouter struct {
	Name     enc.Name
	Fetching bool
	BootTime uint64
	Known    uint64
	Latest   uint64
	Prefixes map[string]*PrefixEntry
}

func (*PrefixTableRouter) GetNextDataName added in v1.4.3

func (r *PrefixTableRouter) GetNextDataName() enc.Name

Get the object name to fetch the next prefix table data. If the difference between Known and Latest is greater than the threshold, fetch the latest snapshot. Otherwise, fetch the next sequence number.

type Rib

type Rib struct {
	// contains filtered or unexported fields
}

Routing Information Base (RIB)

func NewRib

func NewRib(config *config.Config) *Rib

func (*Rib) Advert

func (r *Rib) Advert() *tlv.Advertisement

Get all advertisement entries in the RIB.

func (*Rib) DirtyResetNextHop

func (r *Rib) DirtyResetNextHop(nextHop enc.Name)

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

func (r *Rib) Entries() []*RibEntry

Get all destinations reachable in the RIB.

func (*Rib) GetFibEntries

func (rib *Rib) GetFibEntries(nt *NeighborTable, router uint64) []FibEntry

Get the FIB entry for a name prefix. router should be hash of the router name.

func (*Rib) Has

func (r *Rib) Has(destName enc.Name) bool

Check if a destination is reachable in the RIB.

func (*Rib) Print

func (r *Rib) Print()

Print the RIB to the console (for debugging).

func (*Rib) Prune

func (r *Rib) Prune() bool

Whenever the RIB is changed, this must be called manually to remove unreachable destinations. Returns true if the Advertisement might change.

func (*Rib) RemoveNextHop

func (r *Rib) RemoveNextHop(nextHop enc.Name) bool

Remove all entries with a given next hop. Returns true if the Advertisement might change.

func (*Rib) Set

func (r *Rib) Set(destName enc.Name, nextHop enc.Name, cost uint64) bool

Set a destination in the RIB. Returns true if the Advertisement might change.

func (*Rib) Size added in v1.4.3

func (r *Rib) Size() int

Size gets the number of entries in the RIB.

func (*Rib) String added in v1.4.3

func (r *Rib) String() string

Log identifier for the RIB.

type RibEntry

type RibEntry struct {
	// contains filtered or unexported fields
}

func (*RibEntry) Name

func (e *RibEntry) Name() enc.Name

func (*RibEntry) Set

func (e *RibEntry) Set(nextHop uint64, cost uint64) bool

Jump to

Keyboard shortcuts

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