Documentation
¶
Index ¶
- func AddIPv4IncludedRoute(route IPv4Route)
- func AddRouteForNetworkConfig(destination string) error
- func AddRouteForServerIP(serverIP, interfaceName string) error
- func AddRoutes(remoteSubnets []string, interfaceName string) error
- func ClearNetworkSettings()
- func ConfigureInterface(interfaceName string, tunnelIp string, mtu int) error
- func DarwinAddRoute(destination string, gateway string, interfaceName string) error
- func DarwinRemoveRoute(destination string) error
- func FindUnusedUTUN() (string, error)
- func GetIncrementor() int
- func GetJSON() (string, error)
- func LinuxAddRoute(destination string, gateway string, interfaceName string) error
- func LinuxRemoveRoute(destination string) error
- func RemoveIPv4IncludedRoute(route IPv4Route)
- func RemoveRouteForNetworkConfig(destination string) error
- func RemoveRouteForServerIP(serverIP string, interfaceName string) error
- func RemoveRoutes(remoteSubnets []string) error
- func SetDNSServers(servers []string)
- func SetIPv4ExcludedRoutes(routes []IPv4Route)
- func SetIPv4IncludedRoutes(routes []IPv4Route)
- func SetIPv4Settings(addresses []string, subnetMasks []string)
- func SetIPv6ExcludedRoutes(routes []IPv6Route)
- func SetIPv6IncludedRoutes(routes []IPv6Route)
- func SetIPv6Settings(addresses []string, networkPrefixes []string)
- func SetMTU(mtu int)
- func SetTunnelRemoteAddress(address string)
- func WindowsAddRoute(destination string, gateway string, interfaceName string) error
- func WindowsRemoveRoute(destination string) error
- type IPv4Route
- type IPv6Route
- type NetworkSettings
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AddIPv4IncludedRoute ¶
func AddIPv4IncludedRoute(route IPv4Route)
func AddRouteForServerIP ¶
addRouteForServerIP adds an OS-specific route for the server IP
func ClearNetworkSettings ¶
func ClearNetworkSettings()
ClearNetworkSettings clears all network settings
func ConfigureInterface ¶
ConfigureInterface configures a network interface with an IP address and brings it up
func DarwinAddRoute ¶
func DarwinRemoveRoute ¶
func FindUnusedUTUN ¶
func GetIncrementor ¶
func GetIncrementor() int
func LinuxAddRoute ¶
func LinuxRemoveRoute ¶
func RemoveIPv4IncludedRoute ¶
func RemoveIPv4IncludedRoute(route IPv4Route)
func RemoveRouteForServerIP ¶
removeRouteForServerIP removes an OS-specific route for the server IP
func RemoveRoutes ¶
removeRoutesForRemoteSubnets removes routes for each subnet in RemoteSubnets
func SetIPv4ExcludedRoutes ¶
func SetIPv4ExcludedRoutes(routes []IPv4Route)
func SetIPv4IncludedRoutes ¶
func SetIPv4IncludedRoutes(routes []IPv4Route)
SetIPv4IncludedRoutes sets the included IPv4 routes
func SetIPv4Settings ¶
SetIPv4Settings sets IPv4 addresses and subnet masks
func SetIPv6ExcludedRoutes ¶
func SetIPv6ExcludedRoutes(routes []IPv6Route)
SetIPv6ExcludedRoutes sets the excluded IPv6 routes
func SetIPv6IncludedRoutes ¶
func SetIPv6IncludedRoutes(routes []IPv6Route)
SetIPv6IncludedRoutes sets the included IPv6 routes
func SetIPv6Settings ¶
SetIPv6Settings sets IPv6 addresses and network prefixes
func SetTunnelRemoteAddress ¶
func SetTunnelRemoteAddress(address string)
SetTunnelRemoteAddress sets the tunnel remote address
func WindowsAddRoute ¶
func WindowsRemoveRoute ¶
Types ¶
type IPv4Route ¶
type IPv4Route struct {
DestinationAddress string `json:"destination_address"`
SubnetMask string `json:"subnet_mask,omitempty"`
GatewayAddress string `json:"gateway_address,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
}
IPv4Route represents an IPv4 route
type IPv6Route ¶
type IPv6Route struct {
DestinationAddress string `json:"destination_address"`
NetworkPrefixLength int `json:"network_prefix_length,omitempty"`
GatewayAddress string `json:"gateway_address,omitempty"`
IsDefault bool `json:"is_default,omitempty"`
}
IPv6Route represents an IPv6 route
type NetworkSettings ¶
type NetworkSettings struct {
TunnelRemoteAddress string `json:"tunnel_remote_address,omitempty"`
MTU *int `json:"mtu,omitempty"`
DNSServers []string `json:"dns_servers,omitempty"`
IPv4Addresses []string `json:"ipv4_addresses,omitempty"`
IPv4SubnetMasks []string `json:"ipv4_subnet_masks,omitempty"`
IPv4IncludedRoutes []IPv4Route `json:"ipv4_included_routes,omitempty"`
IPv4ExcludedRoutes []IPv4Route `json:"ipv4_excluded_routes,omitempty"`
IPv6Addresses []string `json:"ipv6_addresses,omitempty"`
IPv6NetworkPrefixes []string `json:"ipv6_network_prefixes,omitempty"`
IPv6IncludedRoutes []IPv6Route `json:"ipv6_included_routes,omitempty"`
IPv6ExcludedRoutes []IPv6Route `json:"ipv6_excluded_routes,omitempty"`
}
NetworkSettings represents the network configuration for the tunnel
func GetSettings ¶
func GetSettings() NetworkSettings