config

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2021 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AgentInfo

type AgentInfo struct {
	XMLName              xml.Name `xml:"agent_info"`
	Type                 string   `xml:"type"`
	Version              string   `xml:"version"`
	Platform             string   `xml:"platform"`
	CPU                  string   `xml:"cpu"`
	JavaScript           Bool     `xml:"javascript"`
	ActiveX              Bool     `xml:"activex"`
	Plugin               Bool     `xml:"plugin"`
	LandingURI           string   `xml:"landinguri"`
	Model                string   `xml:"model,omitempty"`
	PlatformVersion      string   `xml:"platform_version,omitempty"`
	MACAddress           string   `xml:"mac_address,omitempty"`
	UniqueID             string   `xml:"unique_id,omitempty"`
	SerialNumber         string   `xml:"serial_number,omitempty"`
	AppID                string   `xml:"app_id,omitempty"`
	AppVersion           string   `xml:"app_version,omitempty"`
	JailBreak            *Bool    `xml:"jailbreak,omitempty"`
	VPNScope             string   `xml:"vpn_scope,omitempty"`
	VPNStartType         string   `xml:"vpn_start_type,omitempty"`
	LockedMode           Bool     `xml:"lockedmode"`
	VPNTunnelType        string   `xml:"vpn_tunnel_type,omitempty"`
	Hostname             Hostname `xml:"hostname"`
	BiometricFingerprint *Bool    `xml:"biometric_fingerprint,omitempty"`
	DevicePasscodeSet    *Bool    `xml:"device_passcode_set,omitempty"`
}

type Bool

type Bool bool

func (Bool) MarshalXML

func (b Bool) MarshalXML(e *xml.Encoder, start xml.StartElement) error

func (Bool) String

func (b Bool) String() string

type ClientData

type ClientData struct {
	XMLName       xml.Name `xml:"data"`
	Token         string   `xml:"token"`
	Version       string   `xml:"version"`
	RedirectURL   string   `xml:"redirect_url"`
	MaxClientData int      `xml:"max_client_data"`
}

type Config

type Config struct {
	Debug       bool           `yanl:"-"`
	Driver      string         `yaml:"driver"`
	ListenDNS   net.IP         `yaml:"-"`
	DNS         []string       `yaml:"dns"`
	Routes      *netaddr.IPSet `yaml:"-"`
	PPPdArgs    []string       `yaml:"pppdArgs"`
	InsecureTLS bool           `yaml:"insecureTLS"`
	DTLS        bool           `yaml:"dtls"`
	IPv6        bool           `yaml:"ipv6"`
	// completely disable DNS servers handling
	DisableDNS bool `yaml:"disableDNS"`
	// rewrite /etc/resolv.conf instead of renaming
	// required in ChromeOS, where /etc/resolv.conf cannot be renamed
	RewriteResolv bool `yaml:"rewriteResolv"`
	// list of detected local DNS servers
	DNSServers []net.IP `yaml:"-"`
	// config path
	Path string `yaml:"-"`
	// current user or sudo user UID
	Uid int `yaml:"-"`
	// current user or sudo user GID
	Gid int `yaml:"-"`
	// Config, returned by F5
	F5Config *Favorite `yaml:"-"`
}

func ReadConfig

func ReadConfig(debug bool) (*Config, error)

func (*Config) UnmarshalYAML

func (r *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

type Favorite

type Favorite struct {
	Object Object `xml:"object"`
}

type FavoriteItem

type FavoriteItem struct {
	ID      string `xml:"id,attr"`
	Caption string `xml:"caption"`
	Name    string `xml:"name"`
	Params  string `xml:"params"`
}

type Filter

type Filter struct {
	Proto   string `xml:"proto,attr"`
	Src     string `xml:"src,attr"`
	SrcMask string `xml:"src_mask,attr"`
	SrcPort string `xml:"src_port,attr"`
	Dst     string `xml:"dst,attr"`
	DstMask string `xml:"dst_mask,attr"`
	DstPort string `xml:"dst_port,attr"`
}

type Flow

type Flow struct {
	Name    string `xml:"name,attr"`
	Rate    string `xml:"rate,attr"`
	Ceiling string `xml:"ceiling,attr"`
	Mode    string `xml:"mode,attr"`
	Burst   string `xml:"burst,attr"`
	Type    string `xml:"type,attr"`
	Via     string `xml:"via,attr"`
	Filter  Filter `xml:"filter"`
}

type Hostname

type Hostname string

func (Hostname) MarshalXML

func (h Hostname) MarshalXML(e *xml.Encoder, start xml.StartElement) error

type Object

type Object struct {
	SessionID                      string         `xml:"Session_ID"`
	IPv4                           Bool           `xml:"IPV4_0"`
	IPv6                           Bool           `xml:"IPV6_0"`
	UrZ                            string         `xml:"ur_Z"`
	HDLCFraming                    Bool           `xml:"-"`
	Host                           string         `xml:"host0"`
	Port                           string         `xml:"port0"`
	TunnelHost                     string         `xml:"tunnel_host0"`
	TunnelPort                     string         `xml:"tunnel_port0"`
	Add2Hosts                      string         `xml:"Add2Hosts0"`
	DNSRegisterConnection          int            `xml:"DNSRegisterConnection0"`
	DNSUseDNSSuffixForRegistration int            `xml:"DNSUseDNSSuffixForRegistration0"`
	SplitTunneling                 int            `xml:"SplitTunneling0"`
	DNSSPlit                       string         `xml:"DNS_SPLIT0"`
	TunnelDTLS                     bool           `xml:"tunnel_dtls"`
	TunnelPortDTLS                 string         `xml:"tunnel_port_dtls"`
	AllowLocalSubnetAccess         bool           `xml:"AllowLocalSubnetAccess0"`
	AllowLocalDNSServersAccess     bool           `xml:"AllowLocalDNSServersAccess0"`
	AllowLocalDHCPAccess           bool           `xml:"AllowLocalDHCPAccess0"`
	DNS                            []net.IP       `xml:"-"`
	DNS6                           []net.IP       `xml:"-"`
	ExcludeSubnets                 []*net.IPNet   `xml:"-"`
	Routes                         *netaddr.IPSet `xml:"-"`
	ExcludeSubnets6                []*net.IPNet   `xml:"-"`
	Routes6                        *netaddr.IPSet `xml:"-"`
	TrafficControl                 TrafficControl `xml:"-"`
	DNSSuffix                      []string       `xml:"-"`
}

func (*Object) UnmarshalXML

func (o *Object) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

type PasswordPolicy

type PasswordPolicy struct {
	Mode    string `xml:"MODE"`
	Timeout int    `xml:"TIMEOUT"`
}

type PreConfigProfile

type PreConfigProfile struct {
	XMLName   xml.Name         `xml:"PROFILE"`
	Version   string           `xml:"VERSION,attr"`
	Servers   []Server         `xml:"SERVERS>SITEM"`
	Session   preConfigSession `xml:"SESSION"`
	DNSSuffix []string         `xml:"LOCATIONS>CORPORATE>DNSSUFFIX"`
}

type Profiles

type Profiles struct {
	Type      string         `xml:"type,attr"`
	Limited   string         `xml:"limited,attr"`
	Favorites []FavoriteItem `xml:"favorite"`
}

Profiles list

type Server

type Server struct {
	Address string `xml:"ADDRESS"`
	Alias   string `xml:"ALIAS"`
}

type Session

type Session struct {
	Token         string `xml:"token"`
	Version       string `xml:"version"`
	RedirectURL   string `xml:"redirect_url"`
	MaxClientData string `xml:"max_client_data"`
}

type TrafficControl

type TrafficControl struct {
	Flow []Flow `xml:"flow"`
}

type Update

type Update struct {
	Mode Bool `xml:"-"`
}

func (*Update) UnmarshalXML

func (o *Update) UnmarshalXML(d *xml.Decoder, start xml.StartElement) error

Jump to

Keyboard shortcuts

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