config

package
v0.0.0-...-d1ba03b Latest Latest
Warning

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

Go to latest
Published: Nov 4, 2025 License: MIT Imports: 5 Imported by: 0

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

"Returns a default configuration with invalid network/router identifiers, 5-second advertisement sync interval, 30-second router dead interval, and an undefined key chain URI, requiring customization before use."

func (*Config) AdvertisementDataPrefix

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

Returns the configured advertisement data prefix name used for data packet naming in the NDN network.

func (*Config) AdvertisementSyncActivePrefix

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

Returns the active name prefix used for advertisement synchronization in the configuration.

func (*Config) AdvertisementSyncInterval

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

Returns the advertisement synchronization interval as a `time.Duration`, converting the configured millisecond value into the appropriate duration for timing operations.

func (*Config) AdvertisementSyncPassivePrefix

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

Returns the name of the passive prefix used for advertisement synchronization in the routing protocol.

func (*Config) AdvertisementSyncPrefix

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

Returns the configured advertisement synchronization prefix name.

func (*Config) MgmtPrefix

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

Returns the management prefix configured for this instance.

func (*Config) NetworkName

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

Returns the network name stored in the configuration as an `enc.Name`.

func (*Config) Parse

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

Parses and validates NDN router configuration parameters, constructs name components for advertisements and data packets, and enforces hierarchical naming constraints between network and router identities.

func (*Config) PrefixTableGroupPrefix

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

Returns the configured group prefix name used for prefix table synchronization.

func (*Config) RouterDeadInterval

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

Returns the router dead interval duration as a `time.Duration`, converted from the configured value in milliseconds.

func (*Config) RouterName

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

Returns the router's name stored in the configuration as an `enc.Name`.

func (*Config) SchemaBytes

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

Returns the schema bytes associated with the configuration.

func (*Config) TrustAnchorNames

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

Returns the names of the trust anchors configured in this configuration.

type Neighbor

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