Documentation
¶
Overview ¶
The config package contains structures related to the configuration of an Yggdrasil node.
The configuration contains, amongst other things, encryption keys which are used to derive a node's identity, information about peerings and node information that is shared with the network. There are also some module-specific options related to TUN, multicast and the admin socket.
In order for a node to maintain the same identity across restarts, you should persist the configuration onto the filesystem or into some configuration storage so that the encryption keys (and therefore the node ID) do not change.
Note that Yggdrasil will automatically populate sane defaults for any configuration option that is not provided.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type NodeConfig ¶
type NodeConfig struct { Peers []string `` /* 286-byte string literal not displayed */ InterfacePeers map[string][]string `` /* 263-byte string literal not displayed */ Listen []string `` /* 343-byte string literal not displayed */ AdminListen string `` /* 263-byte string literal not displayed */ MulticastInterfaces []string `` /* 207-byte string literal not displayed */ AllowedEncryptionPublicKeys []string `` /* 271-byte string literal not displayed */ EncryptionPublicKey string `` /* 131-byte string literal not displayed */ EncryptionPrivateKey string `comment:"Your private encryption key. DO NOT share this with anyone!"` SigningPublicKey string `comment:"Your public signing key. You should not ordinarily need to share\nthis with anyone."` SigningPrivateKey string `comment:"Your private signing key. DO NOT share this with anyone!"` LinkLocalTCPPort uint16 `` /* 359-byte string literal not displayed */ IfName string `` /* 138-byte string literal not displayed */ IfMTU MTU `` /* 170-byte string literal not displayed */ SessionFirewall SessionFirewall `` /* 351-byte string literal not displayed */ TunnelRouting TunnelRouting `` /* 266-byte string literal not displayed */ SwitchOptions SwitchOptions `comment:"Advanced options for tuning the switch. Normally you will not need\nto edit these options."` NodeInfoPrivacy bool `` /* 314-byte string literal not displayed */ NodeInfo map[string]interface{} `` /* 177-byte string literal not displayed */ }
NodeConfig is the main configuration structure, containing configuration options that are necessary for an Yggdrasil node to run. You will need to supply one of these structs to the Yggdrasil core when starting a node.
func GenerateConfig ¶
func GenerateConfig() *NodeConfig
Generates default configuration and returns a pointer to the resulting NodeConfig. This is used when outputting the -genconf parameter and also when using -autoconf.
func (*NodeConfig) NewEncryptionKeys ¶
func (cfg *NodeConfig) NewEncryptionKeys()
NewEncryptionKeys replaces the encryption keypair in the NodeConfig with a new encryption keypair. The encryption keys are used by the router to encrypt traffic and to derive the node ID and IPv6 address/subnet of the node, so this is equivalent to discarding the node's identity on the network.
func (*NodeConfig) NewSigningKeys ¶
func (cfg *NodeConfig) NewSigningKeys()
NewSigningKeys replaces the signing keypair in the NodeConfig with a new signing keypair. The signing keys are used by the switch to derive the structure of the spanning tree.
type NodeState ¶
type NodeState struct { Current NodeConfig Previous NodeConfig Mutex sync.RWMutex }
NodeState represents the active and previous configuration of an Yggdrasil node. A NodeState object is returned when starting an Yggdrasil node. Note that this structure and related functions are likely to disappear soon.
func (*NodeState) GetCurrent ¶
func (s *NodeState) GetCurrent() NodeConfig
Current returns the active node configuration.
func (*NodeState) GetPrevious ¶
func (s *NodeState) GetPrevious() NodeConfig
Previous returns the previous node configuration.
func (*NodeState) Replace ¶
func (s *NodeState) Replace(n NodeConfig)
Replace the node configuration with new configuration.
type SessionFirewall ¶
type SessionFirewall struct { Enable bool `` /* 145-byte string literal not displayed */ AllowFromDirect bool `comment:"Allow network traffic from directly connected peers."` AllowFromRemote bool `comment:"Allow network traffic from remote nodes on the network that you are\nnot directly peered with."` AlwaysAllowOutbound bool `` /* 193-byte string literal not displayed */ WhitelistEncryptionPublicKeys []string `` /* 127-byte string literal not displayed */ BlacklistEncryptionPublicKeys []string `` /* 142-byte string literal not displayed */ }
SessionFirewall controls the session firewall configuration.
type SwitchOptions ¶
type SwitchOptions struct {
MaxTotalQueueSize uint64 `comment:"Maximum size of all switch queues combined (in bytes)."`
}
SwitchOptions contains tuning options for the switch. These are advanced options and shouldn't be changed unless necessary.
type TunnelRouting ¶
type TunnelRouting struct { Enable bool `comment:"Enable or disable tunnel routing."` IPv6RemoteSubnets map[string]string `` /* 135-byte string literal not displayed */ IPv6LocalSubnets []string `` /* 165-byte string literal not displayed */ IPv4RemoteSubnets map[string]string `` /* 126-byte string literal not displayed */ IPv4LocalSubnets []string `comment:"IPv4 subnets belonging to this node's end of the tunnels. Only traffic\nfrom these ranges will be tunnelled."` }
TunnelRouting contains the crypto-key routing tables for tunneling regular IPv4 or IPv6 subnets across the Yggdrasil network.