node

package
v0.0.0-...-a8acacb Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2024 License: GPL-3.0 Imports: 28 Imported by: 0

README

Node does most of the work managing networks. It:

  • Generates WireGuard configuration (applied using Mio)
  • Fetches config from Centralsource
  • Decides whether forwarding is necessary
  • Contact other nodes to exchange WireGuard keys
  • etc.

Documentation

Index

Constants

This section is empty.

Variables

View Source
var CommandIp string
View Source
var CommandIptables string

Functions

func TraceInit

func TraceInit()

Types

type Backport

type Backport struct {
	CC *central.Config `json:"cc"`
}

type CSConfig

type CSConfig struct {
	Comment         string
	TLSConfig       *tls.Config
	Host            string
	Token           util.Token
	NetworksAllowed []*regexp.Regexp
	Azusa           map[string]central.Peer
}

type Node

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

func NewNode

func NewNode(cfg NodeConfig) (*Node, error)

There must be only one Node instance as a Node can trigger a trace to stop.

func (*Node) ListenCS

func (n *Node) ListenCS()

func (*Node) LoadBackport

func (n *Node) LoadBackport() error

LoadBackport reads a backport from the path and applies it if CC exists in the backport. This must not be called after Node.ListenCS.

func (*Node) ReplaceCC

func (n *Node) ReplaceCC(cc2 *central.Config)

type NodeConfig

type NodeConfig struct {
	CC                 central.Config
	MioAddr            string
	MioToken           []byte
	HokutoAddr         string
	HokutoToken        []byte
	HokutoDNSAddr      string
	HokutoDNSParent    string
	HokutoUseDNS       bool
	HokutoExtraParents []hokuto.ExtraParent
	CS                 CSConfig
	EndpointOverride   string
	BackportPath       string
	SRVList            string
}

type SRVList

type SRVList struct {
	Networks map[string][]central.SRV
}

Jump to

Keyboard shortcuts

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