conf

package
v4.1.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
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

func MakeRangeArray

func MakeRangeArray(start, stop int) []int

Types

type Addrports

type Addrports struct {
	Addr  net.IP
	Ports []int
}

Addr is a composite type of IPAddr and TCP ports

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

func Load(r io.Reader) (*Config, error)

Load loads and parses an io.Reader as a tunnel config, returning a Config pointer or an error.

func (*Config) FeatureFlags

func (c *Config) FeatureFlags() uint32

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

func (c *Config) SourceAddresses() []string

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

type ForwardLine struct {
	Src Addrports
	Dst Addrports
}

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.

type Host

type Host struct {
	Name     string
	Addr     string
	Port     int
	User     string
	Key      string
	Pass     string
	Via      string
	SOCKS    string
	Other    map[string]string
	Comments []string
}

Host is an SSH host to bounce via

Jump to

Keyboard shortcuts

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