network

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureForwarding

func ConfigureForwarding(options ForwardingOptions) error

func ServerVPNIPs

func ServerVPNIPs(cidr, cidr6 string) (ipv4, ipv6 netip.Prefix, err error)

ServerVPNIPs returns two netip.Prefix objects (for IPv4 + IPv6) with the Addr set to the server's IP addresses in these subnets, i.e. the first usable address The return values are the zero prefixes if the corresponding input is an empty string

func SplitAddresses

func SplitAddresses(addresses string) []string

SplitAddresses splits multiple comma-separated addresses into a slice of address strings

func StringJoinIPNets

func StringJoinIPNets(a, b netip.Prefix) string

StringJoinIPNets joins the string representations of a and b using ", "

func StringJoinIPs

func StringJoinIPs(a, b netip.Prefix) string

StringJoinIPs joins the string representations of the IPs of a and b using ", "

Types

type ForwardingOptions added in v0.7.0

type ForwardingOptions struct {
	GatewayIface    string
	CIDR, CIDRv6    string
	NAT44, NAT66    bool
	ClientIsolation bool
	AllowedIPs      []string
	// contains filtered or unexported fields
}

ForwardingOptions contains all options used for configuring the firewall rules

Jump to

Keyboard shortcuts

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