Documentation ¶
Index ¶
Constants ¶
const ( FeatureError uint32 = 1 << iota FeatureSshPassword FeatureSshKey FeatureVpnc FeatureOpenConnect FeatureLocalOnly FeatureSocks )
Features that are required to correctly handle a tunnel configuration
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { Comments []string General struct { Description string Author string Main string Version int Other map[string]string Comments []string } Hosts []Host Forwards []Forward HostsMap map[string]int OpenConnect map[string]string Vpnc map[string]string VpnRoutes []string }
Config is a complete tunnel configuration
func Load ¶
Load loads and parses an io.Reader as a tunnel config, returning a Config pointer or an error.
func (*Config) FeatureFlags ¶
FeatureFlags returns the set of features required to handle a tunnel configuration.
func (*Config) Remap ¶
func (c *Config) Remap()
Remap changes all forwarding directives to use the default localhost address 127.0.0.1 instead of their configured source, if it differs from 127.0.0.1.
func (*Config) SourceAddresses ¶
SourceAddresses returns all the source addresses used in forwarding directives.
type Forward ¶
type Forward struct { Name string Lines []ForwardLine Other map[string]string Comments []string }
Forward is a port forwarding directive
type ForwardLine ¶
ForwardLine is a specific port or range or ports to forward
func (ForwardLine) DstString ¶
func (line ForwardLine) DstString(i int) string
DstString returns the destination IP address and port as a string formatted for use with Dial() and similar.
func (ForwardLine) SrcString ¶
func (line ForwardLine) SrcString(i int) string
SrcString returns the source IP address and port as a string formatted for use with Dial() and similar.
func (ForwardLine) String ¶
func (line ForwardLine) String() string
String returns a human readable representation of the port forward.