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 AddonInterface []string `hcl:"addon_interface,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 }
type Endpoint ¶
type Endpoint struct { AddressFamily string `hcl:"address_family,attr"` // mandatory, socket address family, ip4 or ip6 Mac string `hcl:"mac,optional"` // optional, mac address Port int `hcl:"port,attr"` // mandatory, socket listen port InnerAddress string `hcl:"inner_address,optional"` // optional, remote inner address 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 (*Peer) GenerateInnerAddress ¶
func (*Peer) GenerateMac ¶
func (s *Peer) GenerateMac() net.HardwareAddr
type RAIT ¶
type RAIT struct { 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 (*RAIT) PublicConf ¶
type Transport ¶
type Transport struct { PrivateKey string `hcl:"private_key,attr"` // mandatory, wireguard private key, base64 encoded AddressFamily string `hcl:"address_family,attr"` // mandatory, socket address family, ip4 or ip6 Port int `hcl:"port,attr"` // mandatory, socket listen port MTU int `hcl:"mtu,attr"` // mandatory, interface mtu IFPrefix string `hcl:"ifprefix,attr"` // mandatory, interface naming prefix, should not collide between transports InnerAddress string `hcl:"inner_address,optional"` //optional, interface inner ip, should not collide in a network Mac string `hcl:"mac,optional"` VNI int `hcl:"vni"` 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 WgGoInterface string `hcl:"go_interface,optional"` // optional, use userspace wireguard instead of kernel module }
Click to show internal directories.
Click to hide internal directories.