Documentation
¶
Index ¶
- Variables
- func ActivateInterface(ctx context.Context, name string) error
- func DeactivateInterface(ctx context.Context, name string) error
- func InterfaceNetwork(ifaceName string, forAddr netip.Addr, ipv6 bool) (netip.Prefix, error)
- func NewKernel(ctx context.Context, name string, mtu uint32) error
- func NewTUN(ctx context.Context, name string, mtu uint32) (realName string, closer func(), err error)
- func RemoveInterface(ctx context.Context, ifaceName string) error
- func RemoveInterfaceAddress(_ context.Context, name string, addr netip.Prefix) error
- func SetInterfaceAddress(_ context.Context, name string, addr netip.Prefix) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrLinkNotExists is returned when a link does not exist. ErrLinkNotExists = errors.New("link does not exist") )
Functions ¶
func ActivateInterface ¶
ActivateInterface activates the interface with the given name.
func DeactivateInterface ¶
DeactivateInterface deactivates the interface with the given name.
func InterfaceNetwork ¶
InterfaceNetwork returns the network for the given interface and address.
func NewKernel ¶
NewKernel creates a new kernel WireGuard interface on the host system with the given name.
func NewTUN ¶
func NewTUN(ctx context.Context, name string, mtu uint32) (realName string, closer func(), err error)
NewTUN creates a new WireGuard interface using the userspace tun driver.
func RemoveInterface ¶
RemoveInterface removes the given interface.
func RemoveInterfaceAddress ¶
RemoveInterfaceAddress removes the address of the interface with the given name.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.