yggdrasil

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2018 License: LGPL-3.0 Imports: 33 Imported by: 0

Documentation

Index

Constants

View Source
const NodeIDLen = sha512.Size
View Source
const TreeIDLen = sha512.Size

Variables

This section is empty.

Functions

This section is empty.

Types

type Core

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

The Core object represents the Yggdrasil node. You should create a Core object for each Yggdrasil node you plan to run.

func (*Core) AddAllowedEncryptionPublicKey added in v0.2.0

func (c *Core) AddAllowedEncryptionPublicKey(boxStr string) error

Adds an allowed public key. This allow peerings to be restricted only to keys that you have selected.

func (*Core) AddMulticastInterfaceExpr added in v0.2.0

func (c *Core) AddMulticastInterfaceExpr(expr *regexp.Regexp)

Adds an expression to select multicast interfaces for peer discovery. This should be done before calling Start. This function can be called multiple times to add multiple search expressions.

func (*Core) AddPeer added in v0.2.0

func (c *Core) AddPeer(addr string, sintf string) error

Adds a peer. This should be specified in the peer URI format, i.e. tcp://a.b.c.d:e, udp://a.b.c.d:e, socks://a.b.c.d:e/f.g.h.i:j

func (*Core) GetAddress added in v0.2.0

func (c *Core) GetAddress() *net.IP

Gets the IPv6 address of the Yggdrasil node. This is always a /128.

func (*Core) GetAdminDefaultListen added in v0.2.7

func (c *Core) GetAdminDefaultListen() string

Gets the default admin listen address for your platform.

func (*Core) GetNodeID

func (c *Core) GetNodeID() *NodeID

Gets the node ID.

func (*Core) GetSubnet added in v0.2.0

func (c *Core) GetSubnet() *net.IPNet

Gets the routed IPv6 subnet of the Yggdrasil node. This is always a /64.

func (*Core) GetTUNDefaultIfMTU added in v0.2.0

func (c *Core) GetTUNDefaultIfMTU() int

Gets the default TUN/TAP interface MTU for your platform. This can be as high as 65535, depending on platform, but is never lower than 1280.

func (*Core) GetTUNDefaultIfName added in v0.2.0

func (c *Core) GetTUNDefaultIfName() string

Gets the default TUN/TAP interface name for your platform.

func (*Core) GetTUNDefaultIfTAPMode added in v0.2.0

func (c *Core) GetTUNDefaultIfTAPMode() bool

Gets the default TUN/TAP interface mode for your platform.

func (*Core) GetTUNIfMTU added in v0.2.0

func (c *Core) GetTUNIfMTU() int

Gets the current TUN/TAP interface MTU.

func (*Core) GetTUNIfName added in v0.2.0

func (c *Core) GetTUNIfName() string

Gets the current TUN/TAP interface name.

func (*Core) GetTUNMaximumIfMTU added in v0.2.0

func (c *Core) GetTUNMaximumIfMTU() int

Gets the maximum supported TUN/TAP interface MTU for your platform. This can be as high as 65535, depending on platform, but is never lower than 1280.

func (*Core) GetTreeID

func (c *Core) GetTreeID() *TreeID

Gets the tree ID.

func (*Core) NewEncryptionKeys added in v0.2.0

func (c *Core) NewEncryptionKeys() (*boxPubKey, *boxPrivKey)

Generates a new encryption keypair. The encryption keys are used to encrypt traffic and to derive the IPv6 address/subnet of the node.

func (*Core) NewSigningKeys added in v0.2.0

func (c *Core) NewSigningKeys() (*sigPubKey, *sigPrivKey)

Generates a new signing keypair. The signing keys are used to derive the structure of the spanning tree.

func (*Core) SetLogger added in v0.2.0

func (c *Core) SetLogger(log *log.Logger)

Sets the output logger of the Yggdrasil node after startup. This may be useful if you want to redirect the output later.

func (*Core) Start added in v0.2.0

func (c *Core) Start(nc *config.NodeConfig, log *log.Logger) error

Starts up Yggdrasil using the provided NodeConfig, and outputs debug logging through the provided log.Logger. The started stack will include TCP and UDP sockets, a multicast discovery socket, an admin socket, router, switch and DHT node.

func (*Core) Stop added in v0.2.0

func (c *Core) Stop()

Stops the Yggdrasil node.

type NodeID

type NodeID [NodeIDLen]byte

type TreeID

type TreeID [TreeIDLen]byte

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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