rait

package
v4.4.0 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2022 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Babeld

type Babeld struct {
	Enabled    bool   `hcl:"enabled,optional"`     // mandatory, whether to enable babeld integration
	SocketType string `hcl:"socket_type,optional"` // mandatory, control socket type, tcp or unix
	SocketAddr string `hcl:"socket_addr,optional"` // mandatory, control socket address
	Param      string `hcl:"param,optional"`       // optional, interface param
	Footnote   string `hcl:"footnote,optional"`    // optional, ending command
}

func (*Babeld) Collect added in v4.2.0

func (b *Babeld) Collect(ch chan<- prometheus.Metric)

func (*Babeld) Describe added in v4.2.0

func (b *Babeld) Describe(ch chan<- *prometheus.Desc)

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 RAIT

type RAIT struct {
	Registry    string      `hcl:"registry,attr"`      // mandatory, registry url
	OperatorKey string      `hcl:"operator_key,attr"`  // mandatory, private key of node operator
	PrivateKey  string      `hcl:"private_key,attr"`   // mandatory, wireguard private key
	Namespace   string      `hcl:"namespace,optional"` // optional, wireguard interface namespace
	Transport   []Transport `hcl:"transport,block"`    // mandatory, wireguard socket params

	Babeld  *Babeld           `hcl:"babeld,block"`     // optional, integration with babeld
	Remarks map[string]string `hcl:"remarks,optional"` // optional, public metadata key value map
}

func NewRAIT

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

func (*RAIT) Listing

func (r *RAIT) Listing() ([]entity.Peer, error)

func (*RAIT) Metadata added in v4.1.2

func (r *RAIT) Metadata() (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
	Address       string `hcl:"address,optional"`    // optional, address to advertise
	BindAddress   string `hcl:"bind_addr,optional"`  // optional, address to bind
	SendPort      int    `hcl:"send_port,attr"`      // mandatory, socket send port

	Namespace string `hcl:"namespace,optional"` // optional, wireguard interface creation namespace
	MTU       int    `hcl:"mtu,attr"`           // mandatory, interface mtu
	IFPrefix  string `hcl:"ifprefix,attr"`      // mandatory, interface naming prefix
	IFGroup   int    `hcl:"ifgroup,attr"`       // mandatory, interface group

	FwMark     int  `hcl:"fwmark,optional"`      // optional, fwmark set on out going packets
	RandomPort bool `hcl:"random_port,optional"` // optional, whether to randomize listen port
}

func (*Transport) PeerEnsure

func (trans *Transport) PeerEnsure(r *RAIT, peer entity.Peer) ([]string, error)

func (*Transport) PeersEnsure

func (trans *Transport) PeersEnsure(r *RAIT, peers []entity.Peer) ([]string, error)

Jump to

Keyboard shortcuts

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