xmlprofile

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Sep 17, 2024 License: MIT Imports: 6 Imported by: 0

Documentation

Overview

Package xmlprofile contains the XML profile.

Index

Constants

This section is empty.

Variables

View Source
var (
	// SystemProfile is the file path of the system XML profile.
	SystemProfile = "/var/lib/oc-daemon/profile.xml"
)

Functions

This section is empty.

Types

type AllowCaptivePortalRemediation

type AllowCaptivePortalRemediation struct {
	Flag                            string `xml:",chardata"`
	CaptivePortalRemediationTimeout string `xml:"CaptivePortalRemediationTimeout"`
}

AllowCaptivePortalRemediation specifies if captive portal remediation is allowed in the profile.

type AlwaysOn

type AlwaysOn struct {
	Flag                 bool                 `xml:",chardata"`
	ConnectFailurePolicy ConnectFailurePolicy `xml:"ConnectFailurePolicy"`
	AllowVPNDisconnect   string               `xml:"AllowVPNDisconnect"`
	AllowedHosts         string               `xml:"AllowedHosts"`
}

AlwaysOn contains the AlwaysOn settings in the profile.

type AnyConnectProfile

type AnyConnectProfile struct {
	AutomaticVPNPolicy AutomaticVPNPolicy `xml:"ClientInitialization>AutomaticVPNPolicy"`
	ServerList         ServerList         `xml:"ServerList"`
}

AnyConnectProfile is the anyconnet profile.

type AutomaticVPNPolicy

type AutomaticVPNPolicy struct {
	Flag                   string               `xml:",chardata"`
	TrustedDNSDomains      []string             `xml:"TrustedDNSDomains"`
	TrustedDNSServers      []string             `xml:"TrustedDNSServers"`
	TrustedHTTPSServerList []TrustedHTTPSServer `xml:"TrustedHttpsServerList>TrustedHttpsServer"`
	TrustedNetworkPolicy   string               `xml:"TrustedNetworkPolicy"`
	UntrustedNetworkPolicy string               `xml:"UntrustedNetworkPolicy"`
	AlwaysOn               AlwaysOn             `xml:"AlwaysOn"`
}

AutomaticVPNPolicy contains the automatic vpn policy in the profile.

type ConnectFailurePolicy

type ConnectFailurePolicy struct {
	Flag                           string                        `xml:",chardata"`
	AllowCaptivePortalRemediation  AllowCaptivePortalRemediation `xml:"AllowCaptivePortalRemediation"`
	ApplyLastVPNLocalResourceRules string                        `xml:"ApplyLastVPNLocalResourceRules"`
}

ConnectFailurePolicy specifies the connect failure policy in the profile.

type HostEntry

type HostEntry struct {
	HostName                string              `xml:"HostName"`
	HostAddress             string              `xml:"HostAddress"`
	UserGroup               string              `xml:"UserGroup"`
	BackupServerList        []string            `xml:"BackupServerList>HostAddress"`
	LoadBalancingServerList []string            `xml:"LoadBalancingServerList>HostAddress"`
	AutomaticSCEPHost       string              `xml:"AutomaticSCEPHost"`
	CAURL                   string              `xml:"CAURL"`
	MobileHostEntryInfo     MobileHostEntryInfo `xml:"MobileHostEntryInfo"`
	PrimaryProtocol         PrimaryProtocol     `xml:"PrimaryProtocol"`
	CertificatePinList      []Pin               `xml:"CertificatePinList>Pin"`
}

HostEntry is a host entry in the profile.

type MobileHostEntryInfo

type MobileHostEntryInfo struct {
	NetworkRoaming            string   `xml:"NetworkRoaming"`
	CertificatePolicy         string   `xml:"CertificatePolicy"`
	ConnectOnDemand           string   `xml:"ConnectOnDemand"`
	AlwaysConnectDomainList   []string `xml:"AlwaysConnectDomainList"`
	NeverConnectDomainList    []string `xml:"NeverConnectDomainList"`
	ConnectIfNeededDomainList []string `xml:"ConnectIfNeededDomainList"`
	ActivateOnImport          string   `xml:"ActivateOnImport"`
}

MobileHostEntryInfo contains the mobile host entry info in the profile.

type Pin

type Pin struct {
	Subject string `xml:"Subject,attr"`
	Issuer  string `xml:"Issuer,attr"`
}

Pin is a pin in the profile.

type PrimaryProtocol

type PrimaryProtocol struct {
	Flag                       string                     `xml:",chardata"`
	StandardAuthenticationOnly StandardAuthenticationOnly `xml:"StandardAuthenticationOnly"`
}

PrimaryProtocol specifies primary protocol in the profile.

type Profile

type Profile AnyConnectProfile

Profile is an XML Profile.

func LoadProfile

func LoadProfile(file string) (*Profile, error)

LoadProfile loads the XML profile from file.

func LoadSystemProfile

func LoadSystemProfile() *Profile

LoadSystemProfile loads the XML profile from the default system location.

func NewProfile

func NewProfile() *Profile

NewProfile returns a new Profile.

func (*Profile) Equal

func (p *Profile) Equal(other *Profile) bool

Equal returns whether the profile and other are equal.

func (*Profile) GetAllowedHosts

func (p *Profile) GetAllowedHosts() (hosts []string)

GetAllowedHosts returns the allowed hosts in the XML profile.

func (*Profile) GetAlwaysOn

func (p *Profile) GetAlwaysOn() bool

GetAlwaysOn returns the always on flag in the XML profile.

func (*Profile) GetTNDHTTPSServers

func (p *Profile) GetTNDHTTPSServers() (servers map[string]string)

GetTNDHTTPSServers gets the TND HTTPS server URLs and their hashes in the XML profile.

func (*Profile) GetTNDServers

func (p *Profile) GetTNDServers() (servers []string)

GetTNDServers returns the TND servers in the XML profile.

func (*Profile) GetVPNServerHostNames

func (p *Profile) GetVPNServerHostNames() (servers []string)

GetVPNServerHostNames returns the VPN server hostnames in the xml profile.

func (*Profile) GetVPNServers

func (p *Profile) GetVPNServers() (servers []string)

GetVPNServers returns the VPN servers in the XML profile.

type ServerList

type ServerList struct {
	HostEntry []HostEntry `xml:"HostEntry"`
}

ServerList is the server list in the profile.

type StandardAuthenticationOnly

type StandardAuthenticationOnly struct {
	Flag                           string `xml:",chardata"`
	AuthMethodDuringIKENegotiation string `xml:"AuthMethodDuringIKENegotiation"`
	IKEIdentity                    string `xml:"IKEIdentity"`
}

StandardAuthenticationOnly specifies standard authentication in the profile.

type TrustedHTTPSServer

type TrustedHTTPSServer struct {
	Address         string `xml:"Address"`
	Port            string `xml:"Port"`
	CertificateHash string `xml:"CertificateHash"`
}

TrustedHTTPSServer is a trusted https server in the profile.

Jump to

Keyboard shortcuts

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