rait

package
v3.2.3 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

Package rait provides the core logic of rait

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Babeld

type Babeld struct {
	SocketType string `hcl:"socket_type,optional"` // optional, control socket type, tcp or unix
	SocketAddr string `hcl:"socket_addr,optional"` // optional, control socket address
	Param      string `hcl:"param,optional"`       // optional, interfaces params
	ExtraCmd   string `hcl:"extra_cmd,optional"`   // optional, additional command passed to socket at the end of sync
}

func (*Babeld) LinkAdd

func (b *Babeld) LinkAdd(name string) error

func (*Babeld) LinkDel

func (b *Babeld) LinkDel(name string) error
func (b *Babeld) LinkList() ([]string, error)

func (*Babeld) LinkSync

func (b *Babeld) LinkSync(target []string) error

func (*Babeld) WriteCommand

func (b *Babeld) WriteCommand(command string) (*bytes.Buffer, error)

type Endpoint added in v3.1.0

type Endpoint struct {
	AddressFamily string `hcl:"address_family,attr"` // mandatory, socket address family, ip4 or ip6
	SendPort      int    `hcl:"send_port,attr"`      // mandatory, socket send port
	Address       string `hcl:"address,optional"`    // optional, ip address or resolvable domain name
}

type Isolation

type Isolation struct {
	IFGroup int    `hcl:"ifgroup,attr"`     // mandatory, interface group, for recognizing managed interfaces
	Transit string `hcl:"transit,optional"` // optional, the namespace to create sockets in
	Target  string `hcl:"target,optional"`  // optional, the namespace to move interfaces into
}

type Peer

type Peer struct {
	PublicKey string     `hcl:"public_key,attr"` // mandatory, wireguard public key, base64 encoded
	Name      string     `hcl:"name,optional"`   // optional, peer human readable name
	Remarks   hcl.Body   `hcl:"remarks,remain"`  // optional, additional information
	Endpoint  []Endpoint `hcl:"endpoint,block"`  // mandatory, node endpoints
}

func NewPeers

func NewPeers(path string, pubkey string) ([]Peer, error)

type Peers

type Peers struct {
	Peers []Peer `hcl:"peers,block"`
}

type RAIT

type RAIT struct {
	PrivateKey string      `hcl:"private_key,attr"` // mandatory, wireguard private key, base64 encoded
	Name       string      `hcl:"name,optional"`    // optional, human readable node name
	Peers      string      `hcl:"peers,attr"`       // mandatory, list of peers, in hcl format
	Transport  []Transport `hcl:"transport,block"`  // mandatory, underlying transport for wireguard sockets
	Isolation  *Isolation  `hcl:"isolation,block"`  // optional, params for the separation of underlay and overlay
	Babeld     *Babeld     `hcl:"babeld,block"`     // optional, integration with babeld
	Remarks    hcl.Body    `hcl:"remarks,remain"`   // optional, additional information
}

RAIT is the model corresponding to rait.conf, for default value of fields, see NewRAIT

func NewRAIT

func NewRAIT(path string) (*RAIT, error)

func (*RAIT) List

func (r *RAIT) List() ([]misc.Link, error)

func (*RAIT) Load

func (r *RAIT) Load() ([]misc.Link, error)

func (*RAIT) PublicConf added in v3.2.0

func (r *RAIT) PublicConf(dest string) error

func (*RAIT) Sync

func (r *RAIT) Sync(up bool) error

type Transport

type Transport struct {
	AddressFamily string `hcl:"address_family,attr"`  // mandatory, socket address family, ip4 or ip6
	SendPort      int    `hcl:"send_port,attr"`       // mandatory, socket send port
	MTU           int    `hcl:"mtu,attr"`             // mandatory, interface mtu
	IFPrefix      string `hcl:"ifprefix,attr"`        // mandatory, interface naming prefix, should not collide between transports
	Address       string `hcl:"address,optional"`     // optional, public ip address or resolvable domain name
	BindAddress   string `hcl:"bind_addr,optional"`   // optional, socket bind address, only has effect when -b is set
	FwMark        int    `hcl:"fwmark,optional"`      // optional, fwmark set on out going packets
	RandomPort    bool   `hcl:"random_port,optional"` // optional, whether to randomize listen port
}

Jump to

Keyboard shortcuts

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