cswitch

package
v0.0.0-...-035d516 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: GPL-3.0 Imports: 36 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BgpBin = "/var/openlan/script/frr-client"
	BgpEtc = "/etc/frr/frr.conf"
)
View Source
const (
	CeciBin = "/usr/bin/openceci"
	CeciDir = "/var/openlan/ceci/"
)
View Source
const (
	DhcpBin = "dnsmasq"
	DhcpDir = "/var/openlan/dhcp"
)
View Source
const (
	IPSecBin    = "/usr/sbin/ipsec"
	IPSecEtcDir = "/etc/ipsec.d"
	IPSecLogDir = "/var/openlan/ipsec"
)
View Source
const (
	AccessBin = "openlan-access"
	AccessDir = "/var/openlan/access"
)
View Source
const (
	OpenVPNBin = "openvpn"
	VPNCurDir  = "/var/openlan/openvpn/default"
)
View Source
const (
	UDPBin = "openudp"
)

Variables

View Source
var BgpTmpl = `` /* 1317-byte string literal not displayed */

Functions

func GetOpenVPNVersion

func GetOpenVPNVersion() int

func GetSocketServer

func GetSocketServer(s *co.Switch) libol.SocketServer

func NewNetworker

func NewNetworker(c *co.Network) api.NetworkApi

func NotAllowed

func NotAllowed(w http.ResponseWriter, r *http.Request)

func NotFound

func NotFound(w http.ResponseWriter, r *http.Request)

func PeerName

func PeerName(name, prefix string) (string, string)

func SplitCombined

func SplitCombined(value string) (string, string)

func TestOpenVPN_Version

func TestOpenVPN_Version(t *testing.T)

Types

type ACL

type ACL struct {
	Name  string
	Rules map[string]*ACLRule
	// contains filtered or unexported fields
}

func NewACL

func NewACL(name string) *ACL

func (*ACL) AddRule

func (a *ACL) AddRule(rule *schema.ACLRule) error

func (*ACL) Chain

func (a *ACL) Chain() string

func (*ACL) DelRule

func (a *ACL) DelRule(rule *schema.ACLRule) error

func (*ACL) Initialize

func (a *ACL) Initialize()

func (*ACL) ListRules

func (a *ACL) ListRules(call func(obj schema.ACLRule))

func (*ACL) SaveRule

func (a *ACL) SaveRule()

func (*ACL) Start

func (a *ACL) Start()

func (*ACL) Stop

func (a *ACL) Stop()

type ACLRule

type ACLRule struct {
	SrcIp   string
	DstIp   string
	Proto   string // TCP, UDP or ICMP
	SrcPort int
	DstPort int
	Action  string // DROP or ACCEPT
	// contains filtered or unexported fields
}

func (*ACLRule) Id

func (r *ACLRule) Id() string

func (*ACLRule) Rule

func (r *ACLRule) Rule() cn.IPRule

type Apps

type Apps struct {
	Auth    *app.Access
	Request *app.Request
}

type BgpWorker

type BgpWorker struct {
	*WorkerImpl
	// contains filtered or unexported fields
}

func NewBgpWorker

func NewBgpWorker(c *co.Network) *BgpWorker

func (*BgpWorker) AddAdvertis

func (w *BgpWorker) AddAdvertis(data schema.BgpPrefix)

func (*BgpWorker) AddNeighbor

func (w *BgpWorker) AddNeighbor(data schema.BgpNeighbor)

func (*BgpWorker) AddReceives

func (w *BgpWorker) AddReceives(data schema.BgpPrefix)

func (*BgpWorker) DelAdvertis

func (w *BgpWorker) DelAdvertis(data schema.BgpPrefix)

func (*BgpWorker) DelNeighbor

func (w *BgpWorker) DelNeighbor(data schema.BgpNeighbor)

func (*BgpWorker) DelReceives

func (w *BgpWorker) DelReceives(data schema.BgpPrefix)

func (*BgpWorker) Disable

func (w *BgpWorker) Disable()

func (*BgpWorker) Enable

func (w *BgpWorker) Enable(data schema.Bgp)

func (*BgpWorker) Get

func (w *BgpWorker) Get() *schema.Bgp

func (*BgpWorker) Initialize

func (w *BgpWorker) Initialize()

func (*BgpWorker) Reload

func (w *BgpWorker) Reload(v api.SwitchApi)

func (*BgpWorker) Start

func (w *BgpWorker) Start(v api.SwitchApi)

func (*BgpWorker) Stop

func (w *BgpWorker) Stop()

type CeciWorker

type CeciWorker struct {
	*WorkerImpl
	// contains filtered or unexported fields
}

func NewCeciWorker

func NewCeciWorker(c *co.Network) *CeciWorker

func (*CeciWorker) AddTcp

func (w *CeciWorker) AddTcp(data schema.CeciTcp)

func (*CeciWorker) DelTcp

func (w *CeciWorker) DelTcp(data schema.CeciTcp)

func (*CeciWorker) Initialize

func (w *CeciWorker) Initialize()

func (*CeciWorker) Reload

func (w *CeciWorker) Reload(v api.SwitchApi)

func (*CeciWorker) Start

func (w *CeciWorker) Start(v api.SwitchApi)

func (*CeciWorker) Stop

func (w *CeciWorker) Stop()

type Dhcp

type Dhcp struct {
	// contains filtered or unexported fields
}

func NewDhcp

func NewDhcp(cfg *co.Dhcp) *Dhcp

func (*Dhcp) Clean

func (d *Dhcp) Clean()

func (*Dhcp) Conf

func (d *Dhcp) Conf() *co.Dhcp

func (*Dhcp) ConfFile

func (d *Dhcp) ConfFile() string

func (*Dhcp) Initialize

func (d *Dhcp) Initialize()

func (*Dhcp) LeaseFile

func (d *Dhcp) LeaseFile() string

func (*Dhcp) LogFile

func (d *Dhcp) LogFile() string

func (*Dhcp) Path

func (d *Dhcp) Path() string

func (*Dhcp) PidFile

func (d *Dhcp) PidFile() string

func (*Dhcp) SaveConf

func (d *Dhcp) SaveConf()

func (*Dhcp) Start

func (d *Dhcp) Start()

func (*Dhcp) Stop

func (d *Dhcp) Stop()

func (*Dhcp) Tmpl

func (d *Dhcp) Tmpl() string

func (*Dhcp) UUID

func (d *Dhcp) UUID() string

type FindHop

type FindHop struct {
	// contains filtered or unexported fields
}

func NewFindHop

func NewFindHop(name string, cfg *co.Network) *FindHop

func (*FindHop) AddHop

func (h *FindHop) AddHop(data schema.FindHop) error

func (*FindHop) DelHop

func (h *FindHop) DelHop(data schema.FindHop) error

func (*FindHop) ListHop

func (h *FindHop) ListHop(call func(obj schema.FindHop))

func (*FindHop) LoadHop

func (h *FindHop) LoadHop(findhop string, nlr *nl.Route)

func (*FindHop) SaveHop

func (h *FindHop) SaveHop()

func (*FindHop) Start

func (h *FindHop) Start()

func (*FindHop) Stop

func (h *FindHop) Stop()

func (*FindHop) UnloadHop

func (h *FindHop) UnloadHop(findhop string, nlr *nl.Route)

type FindHopDriver

type FindHopDriver interface {
	Name() string
	Check([]string) []co.MultiPath
	Start()
	Stop()
	ReloadRoute()
	LoadRoute(route *nl.Route)
	UnloadRoute(route *nl.Route)
	HasRoute() bool
	Config() *co.FindHop
}

type FindHopImpl

type FindHopImpl struct {
	Network string
	// contains filtered or unexported fields
}

func (*FindHopImpl) Check

func (c *FindHopImpl) Check(ipList []string) []co.MultiPath

func (*FindHopImpl) Config

func (c *FindHopImpl) Config() *co.FindHop

func (*FindHopImpl) HasRoute

func (c *FindHopImpl) HasRoute() bool

func (*FindHopImpl) LoadRoute

func (c *FindHopImpl) LoadRoute(nlr *nl.Route)

func (*FindHopImpl) Name

func (c *FindHopImpl) Name() string

func (*FindHopImpl) ReloadRoute

func (c *FindHopImpl) ReloadRoute()

func (*FindHopImpl) Start

func (c *FindHopImpl) Start()

func (*FindHopImpl) Stop

func (c *FindHopImpl) Stop()

func (*FindHopImpl) UnloadRoute

func (c *FindHopImpl) UnloadRoute(rt *nl.Route)

func (*FindHopImpl) UpdateAvailable

func (c *FindHopImpl) UpdateAvailable(mp []co.MultiPath) bool

type Hook

type Hook func(client libol.SocketClient, frame *libol.FrameMessage) error

type Http

type Http struct {
	// contains filtered or unexported fields
}

func NewHttp

func NewHttp(cs api.SwitchApi) (h *Http)

func (*Http) GetApi

func (t *Http) GetApi(w http.ResponseWriter, r *http.Request)

func (*Http) GetIndex

func (h *Http) GetIndex(w http.ResponseWriter, r *http.Request)

func (*Http) IndexHtml

func (h *Http) IndexHtml(w http.ResponseWriter, r *http.Request)

func (*Http) Initialize

func (h *Http) Initialize()

func (*Http) IsAuth

func (h *Http) IsAuth(w http.ResponseWriter, r *http.Request) bool

func (*Http) LoadRouter

func (h *Http) LoadRouter()

func (*Http) LoadToken

func (h *Http) LoadToken()

func (*Http) Middleware

func (h *Http) Middleware(next http.Handler) http.Handler

func (*Http) PProf

func (h *Http) PProf(r *mux.Router)

func (*Http) ParseFiles

func (h *Http) ParseFiles(w http.ResponseWriter, name string, data interface{}) error

func (*Http) Prome

func (h *Http) Prome(r *mux.Router)

func (*Http) PubFile

func (h *Http) PubFile(w http.ResponseWriter, r *http.Request)

func (*Http) Router

func (h *Http) Router() *mux.Router

func (*Http) SaveToken

func (h *Http) SaveToken()

func (*Http) SetToken

func (h *Http) SetToken(value string)

func (*Http) Shutdown

func (h *Http) Shutdown()

func (*Http) Start

func (h *Http) Start()

type IPSecWorker

type IPSecWorker struct {
	*WorkerImpl
	// contains filtered or unexported fields
}

func NewIPSecWorker

func NewIPSecWorker(c *co.Network) *IPSecWorker

func (*IPSecWorker) AddTunnel

func (w *IPSecWorker) AddTunnel(data schema.IPSecTunnel)

func (*IPSecWorker) DelTunnel

func (w *IPSecWorker) DelTunnel(data schema.IPSecTunnel)

func (*IPSecWorker) Initialize

func (w *IPSecWorker) Initialize()

func (*IPSecWorker) ListTunnels

func (w *IPSecWorker) ListTunnels(call func(obj schema.IPSecTunnel))

func (*IPSecWorker) Reload

func (w *IPSecWorker) Reload(v api.SwitchApi)

func (*IPSecWorker) Start

func (w *IPSecWorker) Start(v api.SwitchApi)

func (*IPSecWorker) StartTunnel

func (w *IPSecWorker) StartTunnel(data schema.IPSecTunnel)

func (*IPSecWorker) Stop

func (w *IPSecWorker) Stop()

func (*IPSecWorker) UpdateState

func (w *IPSecWorker) UpdateState()

type KnockRule

type KnockRule struct {
	// contains filtered or unexported fields
}

func (*KnockRule) Expire

func (r *KnockRule) Expire() bool

func (*KnockRule) Id

func (r *KnockRule) Id() string

func (*KnockRule) Rule

func (r *KnockRule) Rule() cn.IPRule
type Link struct {
	// contains filtered or unexported fields
}
func NewLink(cfg *co.Access) *Link

func (*Link) Clean

func (l *Link) Clean()

func (*Link) Conf

func (l *Link) Conf() *co.Access

func (*Link) ConfFile

func (l *Link) ConfFile() string

func (*Link) FindPid

func (l *Link) FindPid() int

func (*Link) ID

func (l *Link) ID() string

func (*Link) Initialize

func (l *Link) Initialize()

func (*Link) Kill

func (l *Link) Kill()

func (*Link) LogFile

func (l *Link) LogFile() string

func (*Link) Path

func (l *Link) Path() string

func (*Link) PidFile

func (l *Link) PidFile() string

func (*Link) Start

func (l *Link) Start() error

func (*Link) StatusFile

func (l *Link) StatusFile() string

func (*Link) Stop

func (l *Link) Stop() error

func (*Link) UUID

func (l *Link) UUID() string
type Links struct {
	// contains filtered or unexported fields
}
func NewLinks() *Links

func (*Links) Add

func (ls *Links) Add(l *Link)

func (*Links) Remove

func (ls *Links) Remove(addr string) *Link
type LinuxLink struct {
	// contains filtered or unexported fields
}

func (*LinuxLink) Kill

func (ll *LinuxLink) Kill()

func (*LinuxLink) Start

func (ll *LinuxLink) Start() error

func (*LinuxLink) Stop

func (ll *LinuxLink) Stop() error

type OpenLANWorker

type OpenLANWorker struct {
	*WorkerImpl
	// contains filtered or unexported fields
}

func NewOpenLANWorker

func NewOpenLANWorker(c *co.Network) *OpenLANWorker

func (*OpenLANWorker) Initialize

func (w *OpenLANWorker) Initialize()

func (*OpenLANWorker) Reload

func (w *OpenLANWorker) Reload(v api.SwitchApi)

func (*OpenLANWorker) Start

func (w *OpenLANWorker) Start(v api.SwitchApi)

func (*OpenLANWorker) Stop

func (w *OpenLANWorker) Stop()

func (*OpenLANWorker) UpBridge

func (w *OpenLANWorker) UpBridge(cfg *co.Bridge)

func (*OpenLANWorker) UpTime

func (w *OpenLANWorker) UpTime() int64

type OpenVPN

type OpenVPN struct {
	Cfg *co.OpenVPN

	Protocol string
	Local    string
	Port     string
	// contains filtered or unexported fields
}

func NewOpenVPN

func NewOpenVPN(cfg *co.OpenVPN) *OpenVPN

func (*OpenVPN) AddClient

func (o *OpenVPN) AddClient(name, address string) error

func (*OpenVPN) CheckWait

func (o *OpenVPN) CheckWait()

func (*OpenVPN) Clean

func (o *OpenVPN) Clean()

func (*OpenVPN) ClientDir

func (o *OpenVPN) ClientDir() string

func (*OpenVPN) DelClient

func (o *OpenVPN) DelClient(name string) error

func (*OpenVPN) Directory

func (o *OpenVPN) Directory() string

func (*OpenVPN) Exec

func (o *OpenVPN) Exec(cmd string) error

func (*OpenVPN) FileCfg

func (o *OpenVPN) FileCfg(full bool) string

func (*OpenVPN) FileClient

func (o *OpenVPN) FileClient(full bool) string

func (*OpenVPN) FileClientProfile

func (o *OpenVPN) FileClientProfile(full bool) string

func (*OpenVPN) FileCtrl

func (o *OpenVPN) FileCtrl(full bool) string

func (*OpenVPN) FileIpp

func (o *OpenVPN) FileIpp(full bool) string

func (*OpenVPN) FileLog

func (o *OpenVPN) FileLog(full bool) string

func (*OpenVPN) FilePid

func (o *OpenVPN) FilePid(full bool) string

func (*OpenVPN) FindPid

func (o *OpenVPN) FindPid() int

func (*OpenVPN) ID

func (o *OpenVPN) ID() string

func (*OpenVPN) Initialize

func (o *OpenVPN) Initialize()

func (*OpenVPN) Kill

func (o *OpenVPN) Kill()

func (*OpenVPN) KillClient

func (o *OpenVPN) KillClient(name string) error

func (*OpenVPN) ListClients

func (o *OpenVPN) ListClients(call func(name, address string))

func (*OpenVPN) Path

func (o *OpenVPN) Path() string

func (*OpenVPN) Profile

func (o *OpenVPN) Profile() ([]byte, error)

func (*OpenVPN) ServerDir

func (o *OpenVPN) ServerDir() string

func (*OpenVPN) Start

func (o *OpenVPN) Start()

func (*OpenVPN) Stop

func (o *OpenVPN) Stop()

func (*OpenVPN) ValidConf

func (o *OpenVPN) ValidConf() bool

func (*OpenVPN) WriteConf

func (o *OpenVPN) WriteConf(path string) error

type OpenVPNData

type OpenVPNData struct {
	Local     string
	Port      string
	CertNot   bool
	Ca        string
	Cert      string
	Key       string
	DhPem     string
	TlsAuth   string
	Cipher    string
	Server    string
	Device    string
	Protocol  string
	Script    string
	Routes    []string
	Renego    int
	Stats     string
	IpIp      string
	Push      []string
	ClientDir string
	ServerDir string
}

func NewOpenVPNDataFromConf

func NewOpenVPNDataFromConf(obj *OpenVPN) *OpenVPNData

type OpenVPNProfile

type OpenVPNProfile struct {
	Server   string
	Port     string
	Ca       string
	Cert     string
	Key      string
	TlsAuth  string
	Cipher   string
	Device   string
	Protocol string
	Renego   int
}

func NewOpenVPNProfileFromConf

func NewOpenVPNProfileFromConf(obj *OpenVPN) *OpenVPNProfile

type PingDriver

type PingDriver struct {
	*FindHopImpl
	CfgName    string
	Running    bool
	PingParams *co.PingParams
}

func NewPingDriver

func NewPingDriver(name string, network string, cfg *co.FindHop) *PingDriver

func (*PingDriver) Check

func (pc *PingDriver) Check(ipList []string) []co.MultiPath

check the ipList and return the available NextHops

func (*PingDriver) Name

func (pc *PingDriver) Name() string

func (*PingDriver) Start

func (pc *PingDriver) Start()

func (*PingDriver) Stop

func (pc *PingDriver) Stop()

type PingResult

type PingResult struct {
	Ip      string
	Latency float64
	Loss    int
}

type QosCtrl

type QosCtrl struct {
	Name  string
	Rules map[string]*QosUser
	// contains filtered or unexported fields
}

func NewQosCtrl

func NewQosCtrl(name string) *QosCtrl

func (*QosCtrl) AddOrUpdateQos

func (q *QosCtrl) AddOrUpdateQos(name string, inSpeed float64)

func (*QosCtrl) AddQos

func (q *QosCtrl) AddQos(name string, inSpeed float64) error

func (*QosCtrl) ChainIn

func (q *QosCtrl) ChainIn() string

func (*QosCtrl) ClientUpdate

func (q *QosCtrl) ClientUpdate()

func (*QosCtrl) DelQos

func (q *QosCtrl) DelQos(name string) error

func (*QosCtrl) DelUserRule

func (q *QosCtrl) DelUserRule(name string)

func (*QosCtrl) FindClient

func (q *QosCtrl) FindClient(name string) *schema.VPNClient

func (*QosCtrl) Initialize

func (q *QosCtrl) Initialize()

func (*QosCtrl) ListQos

func (q *QosCtrl) ListQos(call func(obj schema.Qos))

func (*QosCtrl) SaveQos

func (q *QosCtrl) SaveQos()

func (*QosCtrl) Start

func (q *QosCtrl) Start()

func (*QosCtrl) Stop

func (q *QosCtrl) Stop()

func (*QosCtrl) Update

func (q *QosCtrl) Update()

func (*QosCtrl) UpdateQos

func (q *QosCtrl) UpdateQos(name string, inSpeed float64) error

type QosUser

type QosUser struct {
	QosChainName string
	InSpeed      float64 // Mbit
	Name         string
	Ip           string
	Device       string
	// contains filtered or unexported fields
}

func (*QosUser) BuildChainIn

func (qr *QosUser) BuildChainIn(chain *cn.FireWallChain)

func (*QosUser) BuildChainInJump

func (qr *QosUser) BuildChainInJump(chain *cn.FireWallChain)

func (*QosUser) Clear

func (qr *QosUser) Clear(chainIn *cn.FireWallChain)

func (*QosUser) ClearChainIn

func (qr *QosUser) ClearChainIn(chain *cn.FireWallChain)

func (*QosUser) ClearChainInJump

func (qr *QosUser) ClearChainInJump(chain *cn.FireWallChain)

func (*QosUser) InLimitPacket

func (qr *QosUser) InLimitPacket() string

func (*QosUser) InLimitRule

func (qr *QosUser) InLimitRule() cn.IPRule

func (*QosUser) InLimitStr

func (qr *QosUser) InLimitStr() string

func (*QosUser) ReBuild

func (qr *QosUser) ReBuild(chainIn *cn.FireWallChain)

func (*QosUser) RuleName

func (qr *QosUser) RuleName(dir string) string

func (*QosUser) Start

func (qr *QosUser) Start(chainIn *cn.FireWallChain)

func (*QosUser) Update

func (qr *QosUser) Update(chainIn *cn.FireWallChain, inSpeed float64, device string, ip string)

type RouterWorker

type RouterWorker struct {
	*WorkerImpl
	// contains filtered or unexported fields
}

func NewRouterWorker

func NewRouterWorker(c *co.Network) *RouterWorker

func (*RouterWorker) AddInterface

func (w *RouterWorker) AddInterface(data schema.RouterInterface) error

func (*RouterWorker) AddPrivate

func (w *RouterWorker) AddPrivate(data string) error

func (*RouterWorker) AddRedirect

func (w *RouterWorker) AddRedirect(value schema.RedirectRoute)

func (*RouterWorker) AddTunnel

func (w *RouterWorker) AddTunnel(data schema.RouterTunnel) error

func (*RouterWorker) DelInterface

func (w *RouterWorker) DelInterface(data schema.RouterInterface) error

func (*RouterWorker) DelPrivate

func (w *RouterWorker) DelPrivate(data string) error

func (*RouterWorker) DelRedirect

func (w *RouterWorker) DelRedirect(value schema.RedirectRoute)

func (*RouterWorker) DelTunnel

func (w *RouterWorker) DelTunnel(data schema.RouterTunnel) error

func (*RouterWorker) Forward

func (w *RouterWorker) Forward()

func (*RouterWorker) Initialize

func (w *RouterWorker) Initialize()

func (*RouterWorker) Reload

func (w *RouterWorker) Reload(v api.SwitchApi)

func (*RouterWorker) Start

func (w *RouterWorker) Start(v api.SwitchApi)

func (*RouterWorker) Stop

func (w *RouterWorker) Stop()

type Switch

type Switch struct {
	// contains filtered or unexported fields
}

func NewSwitch

func NewSwitch(c *co.Switch) *Switch

func (*Switch) AddLdap

func (v *Switch) AddLdap(value schema.LDAP) error

func (*Switch) AddNetwork

func (v *Switch) AddNetwork(network string)

func (*Switch) AddRate

func (v *Switch) AddRate(device string, mbit int)

func (*Switch) Alias

func (v *Switch) Alias() string

func (*Switch) Config

func (v *Switch) Config() *co.Switch

func (*Switch) DelLdap

func (v *Switch) DelLdap()

func (*Switch) DelNetwork

func (v *Switch) DelNetwork(network string)

func (*Switch) DelRate

func (v *Switch) DelRate(device string)

func (*Switch) FreeTap

func (v *Switch) FreeTap(dev network.Taper) error

func (*Switch) GetBridge

func (v *Switch) GetBridge(tenant string) (network.Bridger, error)

func (*Switch) GetCert

func (v *Switch) GetCert() (ce schema.VersionCert)

func (*Switch) GetPort

func (v *Switch) GetPort(listen string) string

func (*Switch) Initialize

func (v *Switch) Initialize()

func (*Switch) NewTap

func (v *Switch) NewTap(tenant string) (network.Taper, error)

func (*Switch) OffClient

func (v *Switch) OffClient(client libol.SocketClient)

func (*Switch) OnClient

func (v *Switch) OnClient(client libol.SocketClient) error

func (*Switch) OnClose

func (v *Switch) OnClose(client libol.SocketClient) error

func (*Switch) Protocol

func (v *Switch) Protocol() string

func (*Switch) ReadClient

func (v *Switch) ReadClient(client libol.SocketClient, frame *libol.FrameMessage) error

func (*Switch) ReadTap

func (v *Switch) ReadTap(device network.Taper, readAt func(f *libol.FrameMessage) error)

func (*Switch) Reload

func (v *Switch) Reload()

func (*Switch) Save

func (v *Switch) Save()

func (*Switch) SaveNetwork

func (v *Switch) SaveNetwork(network string)

func (*Switch) Server

func (v *Switch) Server() libol.SocketServer

func (*Switch) SignIn

func (v *Switch) SignIn(client libol.SocketClient) error

func (*Switch) Start

func (v *Switch) Start()

func (*Switch) Stop

func (v *Switch) Stop()

func (*Switch) UUID

func (v *Switch) UUID() string

func (*Switch) UpTime

func (v *Switch) UpTime() int64

func (*Switch) UpdateCert

func (v *Switch) UpdateCert(data schema.VersionCert)

type WorkerImpl

type WorkerImpl struct {
	// contains filtered or unexported fields
}

func NewWorkerApi

func NewWorkerApi(c *co.Network) *WorkerImpl

func (*WorkerImpl) ACLer

func (w *WorkerImpl) ACLer() api.ACLApi

func (*WorkerImpl) AddAddress

func (w *WorkerImpl) AddAddress(value string)

func (*WorkerImpl) AddDnat

func (w *WorkerImpl) AddDnat(data schema.DNAT) error

func (*WorkerImpl) AddOutput

func (w *WorkerImpl) AddOutput(data schema.Output)

func (*WorkerImpl) AddPhysical

func (w *WorkerImpl) AddPhysical(bridge string, output string)

func (*WorkerImpl) AddRoute

func (w *WorkerImpl) AddRoute(route *schema.PrefixRoute, v api.SwitchApi) error

func (*WorkerImpl) AddVPN

func (w *WorkerImpl) AddVPN(value schema.OpenVPN) error

func (*WorkerImpl) AddVPNClient

func (w *WorkerImpl) AddVPNClient(name, address string) error

func (*WorkerImpl) Bridger

func (w *WorkerImpl) Bridger() cn.Bridger

func (*WorkerImpl) Config

func (w *WorkerImpl) Config() *co.Network

func (*WorkerImpl) DelAddress

func (w *WorkerImpl) DelAddress()

func (*WorkerImpl) DelDnat

func (w *WorkerImpl) DelDnat(data schema.DNAT) error

func (*WorkerImpl) DelOutput

func (w *WorkerImpl) DelOutput(data schema.Output)

func (*WorkerImpl) DelPhysical

func (w *WorkerImpl) DelPhysical(bridge string, output string)

func (*WorkerImpl) DelRoute

func (w *WorkerImpl) DelRoute(route *schema.PrefixRoute, v api.SwitchApi) error

func (*WorkerImpl) DelVPN

func (w *WorkerImpl) DelVPN()

func (*WorkerImpl) DelVPNClient

func (w *WorkerImpl) DelVPNClient(name string) error

func (*WorkerImpl) DisableZTrust

func (w *WorkerImpl) DisableZTrust()

func (*WorkerImpl) EnableZTrust

func (w *WorkerImpl) EnableZTrust()

func (*WorkerImpl) FindHoper

func (w *WorkerImpl) FindHoper() api.FindHopApi

func (*WorkerImpl) GetCfgs

func (w *WorkerImpl) GetCfgs() (*co.Network, *co.OpenVPN)

func (*WorkerImpl) ID

func (w *WorkerImpl) ID() string

func (*WorkerImpl) IfAddr

func (w *WorkerImpl) IfAddr() string

func (*WorkerImpl) Initialize

func (w *WorkerImpl) Initialize()

func (*WorkerImpl) KillVPNClient

func (w *WorkerImpl) KillVPNClient(name string) error

func (*WorkerImpl) ListClients

func (w *WorkerImpl) ListClients(call func(name, local string))

func (*WorkerImpl) ListDnat

func (w *WorkerImpl) ListDnat(call func(data schema.DNAT))

func (*WorkerImpl) ListRoute

func (w *WorkerImpl) ListRoute(call func(obj schema.PrefixRoute))

func (*WorkerImpl) Provider

func (w *WorkerImpl) Provider() string

func (*WorkerImpl) Qoser

func (w *WorkerImpl) Qoser() api.QosApi

func (*WorkerImpl) Reload

func (w *WorkerImpl) Reload(v api.SwitchApi)

func (*WorkerImpl) Router

func (w *WorkerImpl) Router() api.RouteApi

func (*WorkerImpl) SaveOutput

func (w *WorkerImpl) SaveOutput()

func (*WorkerImpl) SaveRoute

func (w *WorkerImpl) SaveRoute()

func (*WorkerImpl) SetMss

func (w *WorkerImpl) SetMss(mss int)

func (*WorkerImpl) SetSnat

func (w *WorkerImpl) SetSnat(value string)

func (*WorkerImpl) Start

func (w *WorkerImpl) Start(v api.SwitchApi)

func (*WorkerImpl) StartVPN

func (w *WorkerImpl) StartVPN()

func (*WorkerImpl) Stop

func (w *WorkerImpl) Stop()

func (*WorkerImpl) String

func (w *WorkerImpl) String() string

func (*WorkerImpl) Subnet

func (w *WorkerImpl) Subnet() *net.IPNet

func (*WorkerImpl) ZTruster

func (w *WorkerImpl) ZTruster() api.ZTrustApi

type ZGuest

type ZGuest struct {
	// contains filtered or unexported fields
}

func NewZGuest

func NewZGuest(network, name, source string) *ZGuest

func (*ZGuest) AddRule

func (g *ZGuest) AddRule(rule *KnockRule)

func (*ZGuest) Chain

func (g *ZGuest) Chain() string

func (*ZGuest) Clear

func (g *ZGuest) Clear()

func (*ZGuest) DelRule

func (g *ZGuest) DelRule(rule *KnockRule)

func (*ZGuest) Flush

func (g *ZGuest) Flush()

func (*ZGuest) Start

func (g *ZGuest) Start()

func (*ZGuest) Stop

func (g *ZGuest) Stop()

type ZTrust

type ZTrust struct {
	// contains filtered or unexported fields
}

func NewZTrust

func NewZTrust(network string, expire int) *ZTrust

func (*ZTrust) AddGuest

func (z *ZTrust) AddGuest(name, source string) error

func (*ZTrust) Chain

func (z *ZTrust) Chain() string

func (*ZTrust) DelGuest

func (z *ZTrust) DelGuest(name, source string) error

func (*ZTrust) Initialize

func (z *ZTrust) Initialize()

func (*ZTrust) Knock

func (z *ZTrust) Knock(name string, protocol, dest, port string, age int) error

func (*ZTrust) ListGuest

func (z *ZTrust) ListGuest(call func(obj schema.ZGuest))

func (*ZTrust) ListKnock

func (z *ZTrust) ListKnock(name string, call func(obj schema.KnockRule))

func (*ZTrust) Start

func (z *ZTrust) Start()

func (*ZTrust) Stop

func (z *ZTrust) Stop()

func (*ZTrust) Update

func (z *ZTrust) Update()

Jump to

Keyboard shortcuts

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