config

package
v1.5.3 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2025 License: MIT Imports: 5 Imported by: 3

Documentation

Index

Constants

View Source
const CostInfinity = uint64(16)

CostInfinity is the maximum cost to a router.

View Source
const CostPfxInfinity = uint64(0xFFFFFFFF)

CostPfxInfinity is the maximum cost to a name prefix.

View Source
const NlsrOrigin = uint64(mgmt.RouteOriginNLSR)

NlsrOrigin is the origin to use for local registration.

Variables

View Source
var MulticastStrategy = enc.LOCALHOST.
	Append(enc.NewGenericComponent("nfd")).
	Append(enc.NewGenericComponent("strategy")).
	Append(enc.NewGenericComponent("multicast"))
View Source
var SchemaBytes []byte

Functions

This section is empty.

Types

type Config

type Config struct {
	// Network should be the same for all routers in the network.
	Network string `json:"network"`
	// Router should be unique for each router in the network.
	Router string `json:"router"`
	// Period of sending Advertisement Sync Interests.
	AdvertisementSyncInterval_ms uint64 `json:"advertise_interval"`
	// Time after which a neighbor is considered dead.
	RouterDeadInterval_ms uint64 `json:"router_dead_interval"`
	// URI specifying KeyChain location.
	KeyChainUri string `json:"keychain"`
	// List of trust anchor full names.
	TrustAnchors []string `json:"trust_anchors"`
	// List of permanent neighbors.
	Neighbors []Neighbor `json:"neighbors"`
	// contains filtered or unexported fields
}

func DefaultConfig

func DefaultConfig() *Config

(AI GENERATED DESCRIPTION): Creates a default `Config` instance with empty network and router fields, preset advertisement sync and router‑dead intervals, and an undefined key‑chain URI.

func (*Config) AdvertisementDataPrefix

func (c *Config) AdvertisementDataPrefix() enc.Name

(AI GENERATED DESCRIPTION): Retrieves the configured advertisement data prefix (enc.Name) from the Config instance.

func (*Config) AdvertisementSyncActivePrefix

func (c *Config) AdvertisementSyncActivePrefix() enc.Name

(AI GENERATED DESCRIPTION): Retrieves the configured advertisement sync active prefix (an `enc.Name`) from the `Config` instance.

func (*Config) AdvertisementSyncInterval

func (c *Config) AdvertisementSyncInterval() time.Duration

(AI GENERATED DESCRIPTION): Returns the advertisement synchronization interval from the configuration, converting the stored millisecond value into a `time.Duration`.

func (*Config) AdvertisementSyncPassivePrefix

func (c *Config) AdvertisementSyncPassivePrefix() enc.Name

(AI GENERATED DESCRIPTION): Returns the Name of the prefix used for passive advertisement synchronization.

func (*Config) AdvertisementSyncPrefix

func (c *Config) AdvertisementSyncPrefix() enc.Name

(AI GENERATED DESCRIPTION): Retrieves and returns the advertisement sync prefix stored in the configuration as an `enc.Name`.

func (*Config) MgmtPrefix added in v1.4.3

func (c *Config) MgmtPrefix() enc.Name

(AI GENERATED DESCRIPTION): Returns the management prefix stored in the Config object.

func (*Config) NetworkName

func (c *Config) NetworkName() enc.Name

(AI GENERATED DESCRIPTION): Retrieves and returns the network name stored in the configuration.

func (*Config) Parse

func (c *Config) Parse() (err error)

(AI GENERATED DESCRIPTION): Parses and validates the NLSR configuration, converting string fields into `enc.Name` objects, enforcing network‑router relationship and timing constraints, and computing the internal name prefixes used for advertisement sync, data, and prefix sync.

func (*Config) PrefixTableGroupPrefix added in v1.5.2

func (c *Config) PrefixTableGroupPrefix() enc.Name

(AI GENERATED DESCRIPTION): Retrieves the prefix table group prefix stored in the configuration.

func (*Config) RouterDeadInterval

func (c *Config) RouterDeadInterval() time.Duration

(AI GENERATED DESCRIPTION): Returns the router dead interval configured in milliseconds, converting the `RouterDeadInterval_ms` field to a `time.Duration`.

func (*Config) RouterName

func (c *Config) RouterName() enc.Name

(AI GENERATED DESCRIPTION): Returns the router name (enc.Name) stored in the Config instance.

func (*Config) SchemaBytes added in v1.4.3

func (c *Config) SchemaBytes() []byte

(AI GENERATED DESCRIPTION): Returns the raw byte slice representing the configuration schema.

func (*Config) TrustAnchorNames added in v1.4.3

func (c *Config) TrustAnchorNames() []enc.Name

(AI GENERATED DESCRIPTION): Returns the slice of trust‑anchor names stored in the Config.

type Neighbor added in v1.5.0

type Neighbor struct {
	// Remote URI of the neighbor.
	Uri string `json:"uri"`
	// MTU of the link face.
	Mtu uint64 `json:"mtu"`

	// FaceId of the neighbor.
	FaceId uint64 `json:"-"`
	// Whether this instance created this face
	Created bool `json:"-"`
}

Jump to

Keyboard shortcuts

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