Documentation ¶
Index ¶
- Variables
- type Config
- type Link
- func (l *Link) Acct() (rxBytes, txBytes int64, err error)
- func (l *Link) Close()
- func (l *Link) DPD(ctx context.Context) error
- func (l *Link) Down() (err error)
- func (l *Link) LoopbackRoutesAdd() (err error)
- func (l *Link) LoopbackRoutesDel()
- func (l *Link) Open() (err error)
- func (l *Link) PublicKey() wgtypes.Key
- func (l *Link) RulesAdd() (err error)
- func (l *Link) RulesDel()
- func (l *Link) Up(response *rest.ConnectResponse) (err error)
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTooManyPeers = errors.New("multiple peers on a single wireguard device") ErrDpdTimeout = errors.New("dpd timeout") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Name string `yaml:"name,omitempty"` // Interface name to use for the created WireGuard interface ListenPort int `yaml:"listenPort,omitempty"` // Local UDP listen/bind port - 0 for automatic FirewallMark int `yaml:"firewallMark,omitempty"` // Firewall mark for the traffic generated by the wireguard module PrivateKey string `yaml:"privateKey,omitempty"` // Explicitly specified private key RoutingTable int `yaml:"routingTable,omitempty"` // Routing table number to operate on when managing wireguard routes LeakProtection bool `yaml:"leakProtection,omitempty"` // Enable or disable leak protection ( loopback routes ) ResolvConfBackupFile string `yaml:"resolvConfBackupFile,omitempty"` // Name of the resolv.conf backup file DpdTimeout time.Duration `yaml:"dpdTimeout,omitempty"` // DPD timeout SplitTunnel string `yaml:"splitTunnel,omitempty"` // A comma separated list of networks (CIDRs) for which to bypass the wireguard tunnel ( Split-Tunneling ) }
type Link ¶
type Link struct { Config // contains filtered or unexported fields }
func (*Link) LoopbackRoutesAdd ¶
Add loopback default routes to l.Config.RoutingTable table
func (*Link) LoopbackRoutesDel ¶
func (l *Link) LoopbackRoutesDel()
Remove default routes from l.Config.RoutingTable table
Click to show internal directories.
Click to hide internal directories.