Documentation ¶
Index ¶
- Constants
- func GetRoutes(result *[]database.PrefixRoute, device string) error
- func GetSocketServer(s *co.Switch) libol.SocketServer
- func GetStateEncap(mode string, sport, dport int) *nl.XfrmStateEncap
- func ListWorker(call func(w Networker))
- func PeerName(name, prefix string) (string, string)
- type Apps
- type ConfD
- func (c *ConfD) Add(table string, model model.Model)
- func (c *ConfD) AddLink(obj *database.VirtualLink)
- func (c *ConfD) AddRoute(obj *database.PrefixRoute)
- func (c *ConfD) DelLink(obj *database.VirtualLink)
- func (c *ConfD) DelRoute(obj *database.PrefixRoute)
- func (c *ConfD) Delete(table string, model model.Model)
- func (c *ConfD) DiffLink(old *database.VirtualLink, new *database.VirtualLink) bool
- func (c *ConfD) Initialize()
- func (c *ConfD) Start()
- func (c *ConfD) Stop()
- func (c *ConfD) Update(table string, old model.Model, new model.Model)
- func (c *ConfD) UpdateName(obj *database.NameCache)
- type Dhcp
- func (d *Dhcp) Clean()
- func (d *Dhcp) Conf() *co.Dhcp
- func (d *Dhcp) ConfFile() string
- func (d *Dhcp) Initialize()
- func (d *Dhcp) LeaseFile() string
- func (d *Dhcp) LogFile() string
- func (d *Dhcp) Path() string
- func (d *Dhcp) PidFile() string
- func (d *Dhcp) SaveConf()
- func (d *Dhcp) Start()
- func (d *Dhcp) Stop()
- func (d *Dhcp) Tmpl() string
- func (d *Dhcp) UUID() string
- type EspWorker
- func (w *EspWorker) AddRoute(device, src, remote string) error
- func (w *EspWorker) DownDummy(name string) error
- func (w *EspWorker) Initialize()
- func (w *EspWorker) Reload(v api.Switcher)
- func (w *EspWorker) Start(v api.Switcher)
- func (w *EspWorker) Stop()
- func (w *EspWorker) UpDummy(name, addr, peer string) error
- type FabricWorker
- func (w *FabricWorker) AddNetwork(cfg *co.Network)
- func (w *FabricWorker) AddTunnel(cfg co.FabricTunnel)
- func (w *FabricWorker) Addr2Port(addr, pre string) string
- func (w *FabricWorker) DelNetwork(bridge string, vni uint32)
- func (w *FabricWorker) DelTunnel(name string)
- func (w *FabricWorker) Initialize()
- func (w *FabricWorker) IsSlave(n Networker) bool
- func (w *FabricWorker) Reload(v api.Switcher)
- func (w *FabricWorker) Start(v api.Switcher)
- func (w *FabricWorker) Stop()
- func (w *FabricWorker) TcpMss() int
- func (w *FabricWorker) UpLink(bridge string, vni uint32, addr string) *ovs.PortStats
- type Fabricer
- type Hook
- type Http
- func (h *Http) GetIndex(w http.ResponseWriter, r *http.Request)
- func (h *Http) IndexHtml(w http.ResponseWriter, r *http.Request)
- func (h *Http) Initialize()
- func (h *Http) IsAuth(w http.ResponseWriter, r *http.Request) bool
- func (h *Http) LoadRouter()
- func (h *Http) LoadToken()
- func (h *Http) Middleware(next http.Handler) http.Handler
- func (h *Http) PProf(r *mux.Router)
- func (h *Http) ParseFiles(w http.ResponseWriter, name string, data interface{}) error
- func (h *Http) PubFile(w http.ResponseWriter, r *http.Request)
- func (h *Http) Router() *mux.Router
- func (h *Http) SaveToken()
- func (h *Http) SetToken(value string)
- func (h *Http) Shutdown()
- func (h *Http) Start()
- type L2TP
- func (d *L2TP) Clean()
- func (d *L2TP) Conf() *co.L2TP
- func (d *L2TP) ConfFile() string
- func (d *L2TP) Initialize()
- func (d *L2TP) OptionsFile() string
- func (d *L2TP) OptionsTmpl() string
- func (d *L2TP) Path() string
- func (d *L2TP) PidFile() string
- func (d *L2TP) Render(fp *os.File, tmpl string, data interface{})
- func (d *L2TP) SaveConf()
- func (d *L2TP) SaveOptions()
- func (d *L2TP) Start()
- func (d *L2TP) Stop()
- func (d *L2TP) Tmpl() string
- func (d *L2TP) UUID() string
- type Link
- func (l *Link) Clean()
- func (l *Link) Conf() *co.Point
- func (l *Link) ConfFile() string
- func (l *Link) Initialize()
- func (l *Link) LogFile() string
- func (l *Link) Model() *models.Link
- func (l *Link) Path() string
- func (l *Link) PidFile() string
- func (l *Link) Start()
- func (l *Link) StatusFile() string
- func (l *Link) Stop()
- func (l *Link) UUID() string
- type LinkImpl
- type Links
- type LinuxPort
- type MemberLink
- type Networker
- type OpenLANWorker
- func (w *OpenLANWorker) AddLink(c co.Point)
- func (w *OpenLANWorker) Bridge() cn.Bridger
- func (w *OpenLANWorker) DelLink(addr string)
- func (w *OpenLANWorker) IfAddr() string
- func (w *OpenLANWorker) Initialize()
- func (w *OpenLANWorker) LoadLinks()
- func (w *OpenLANWorker) LoadRoutes()
- func (w *OpenLANWorker) Reload(v api.Switcher)
- func (w *OpenLANWorker) Start(v api.Switcher)
- func (w *OpenLANWorker) Stop()
- func (w *OpenLANWorker) Subnet() string
- func (w *OpenLANWorker) UnLoadLinks()
- func (w *OpenLANWorker) UnLoadRoutes()
- func (w *OpenLANWorker) UpBridge(cfg *co.Bridge)
- func (w *OpenLANWorker) UpTime() int64
- type OpenVPN
- func (o *OpenVPN) Clean()
- func (o *OpenVPN) Directory() string
- func (o *OpenVPN) DirectoryClientConfig() string
- func (o *OpenVPN) FileCfg(full bool) string
- func (o *OpenVPN) FileClient(full bool) string
- func (o *OpenVPN) FileIpp(full bool) string
- func (o *OpenVPN) FileLog(full bool) string
- func (o *OpenVPN) FilePid(full bool) string
- func (o *OpenVPN) FileStats(full bool) string
- func (o *OpenVPN) ID() string
- func (o *OpenVPN) Initialize()
- func (o *OpenVPN) Path() string
- func (o *OpenVPN) Profile() ([]byte, error)
- func (o *OpenVPN) ProfileTmpl() string
- func (o *OpenVPN) ServerTmpl() string
- func (o *OpenVPN) Start()
- func (o *OpenVPN) Stop()
- func (o *OpenVPN) ValidConf() bool
- func (o *OpenVPN) WriteConf(path string) error
- type OpenVPNData
- type OpenVPNProfile
- type OvsBridge
- type OvsPort
- type PolicyParameter
- type RouterWorker
- type StateParameters
- type Switch
- func (v *Switch) Alias() string
- func (v *Switch) Config() *co.Switch
- func (v *Switch) FreeTap(dev network.Taper) error
- func (v *Switch) GetBridge(tenant string) (network.Bridger, error)
- func (v *Switch) GetPort(listen string) string
- func (v *Switch) Initialize()
- func (v *Switch) LoadLDAP()
- func (v *Switch) LoadPass()
- func (v *Switch) NewTap(tenant string) (network.Taper, error)
- func (v *Switch) OffClient(client libol.SocketClient)
- func (v *Switch) OnClient(client libol.SocketClient) error
- func (v *Switch) OnClose(client libol.SocketClient) error
- func (v *Switch) Protocol() string
- func (v *Switch) ReadClient(client libol.SocketClient, frame *libol.FrameMessage) error
- func (v *Switch) ReadTap(device network.Taper, readAt func(f *libol.FrameMessage) error)
- func (v *Switch) Reload()
- func (v *Switch) Save()
- func (v *Switch) Server() libol.SocketServer
- func (v *Switch) SetPass(file string)
- func (v *Switch) SignIn(client libol.SocketClient) error
- func (v *Switch) Start()
- func (v *Switch) Stop()
- func (v *Switch) UUID() string
- func (v *Switch) UpTime() int64
- type TunnelLink
- type VxLANWorker
- type WorkerImpl
- func (w *WorkerImpl) AddOutput(bridge string, port *LinuxPort)
- func (w *WorkerImpl) AddPhysical(bridge string, vlan int, output string)
- func (w *WorkerImpl) Bridge() cn.Bridger
- func (w *WorkerImpl) Config() *co.Network
- func (w *WorkerImpl) DelOutput(bridge string, port *LinuxPort)
- func (w *WorkerImpl) DelPhysical(bridge string, vlan int, output string)
- func (w *WorkerImpl) GetCfgs() (*co.Network, *co.OpenVPN)
- func (w *WorkerImpl) ID() string
- func (w *WorkerImpl) Initialize()
- func (w *WorkerImpl) Provider() string
- func (w *WorkerImpl) Reload(v api.Switcher)
- func (w *WorkerImpl) Start(v api.Switcher)
- func (w *WorkerImpl) Stop()
- func (w *WorkerImpl) String() string
- func (w *WorkerImpl) Subnet() string
Constants ¶
View Source
const ( DhcpBin = "dnsmasq" DhcpDir = "/var/openlan/dhcp" )
View Source
const ( TLsToTun = 2 // From a switch include border to tunnels. TTunToLs = 4 // From tunnels to a switch. TSourceLearn = 10 // Learning source mac. TUcastToTun = 20 // Forwarding by fdb. TFloodToTun = 30 // Flooding to tunnels or patch by flags. TFloodToBor = 31 // Flooding to border in a switch. TFloodLoop = 32 // Flooding to patch in a switch from border. )
View Source
const ( FFromLs = 2 // In a logical switch. FFromTun = 4 // From peer tunnels. )
View Source
const ( MatchRegFlag = "reg10" NxmRegFlag = "NXM_NX_REG10[0..31]" NxmRegEthDst = "NXM_OF_ETH_DST[]" NxmRegEthSrc = "NXM_OF_ETH_SRC[]" NxmRegTunId = "NXM_NX_TUN_ID[0..31]" NxmRegInPort = "NXM_OF_IN_PORT[]" )
View Source
const ( L2TPBin = "xl2tpd" L2TPDir = "/var/openlan/l2tp" )
View Source
const ( OlapBin = "openlan-point" OlapDir = "/var/openlan/point" )
View Source
const ( OpenVPNBin = "openvpn" DefaultCurDir = "/var/openlan/openvpn/default" )
View Source
const (
UDPBin = "openudp"
)
Variables ¶
This section is empty.
Functions ¶
func GetSocketServer ¶
func GetSocketServer(s *co.Switch) libol.SocketServer
func GetStateEncap ¶
func GetStateEncap(mode string, sport, dport int) *nl.XfrmStateEncap
func ListWorker ¶
func ListWorker(call func(w Networker))
Types ¶
type ConfD ¶
type ConfD struct {
// contains filtered or unexported fields
}
func (*ConfD) AddLink ¶
func (c *ConfD) AddLink(obj *database.VirtualLink)
func (*ConfD) AddRoute ¶
func (c *ConfD) AddRoute(obj *database.PrefixRoute)
func (*ConfD) DelLink ¶
func (c *ConfD) DelLink(obj *database.VirtualLink)
func (*ConfD) DelRoute ¶
func (c *ConfD) DelRoute(obj *database.PrefixRoute)
func (*ConfD) DiffLink ¶
func (c *ConfD) DiffLink(old *database.VirtualLink, new *database.VirtualLink) bool
func (*ConfD) Initialize ¶
func (c *ConfD) Initialize()
func (*ConfD) UpdateName ¶
type Dhcp ¶
type Dhcp struct {
// contains filtered or unexported fields
}
func (*Dhcp) Initialize ¶
func (d *Dhcp) Initialize()
type EspWorker ¶
type EspWorker struct { *WorkerImpl // contains filtered or unexported fields }
func NewESPWorker ¶
func (*EspWorker) Initialize ¶
func (w *EspWorker) Initialize()
type FabricWorker ¶
type FabricWorker struct { *WorkerImpl // contains filtered or unexported fields }
func NewFabricWorker ¶
func NewFabricWorker(c *co.Network) *FabricWorker
func (*FabricWorker) AddNetwork ¶
func (w *FabricWorker) AddNetwork(cfg *co.Network)
func (*FabricWorker) AddTunnel ¶
func (w *FabricWorker) AddTunnel(cfg co.FabricTunnel)
func (*FabricWorker) Addr2Port ¶
func (w *FabricWorker) Addr2Port(addr, pre string) string
func (*FabricWorker) DelNetwork ¶
func (w *FabricWorker) DelNetwork(bridge string, vni uint32)
func (*FabricWorker) DelTunnel ¶
func (w *FabricWorker) DelTunnel(name string)
func (*FabricWorker) Initialize ¶
func (w *FabricWorker) Initialize()
func (*FabricWorker) IsSlave ¶
func (w *FabricWorker) IsSlave(n Networker) bool
func (*FabricWorker) Reload ¶
func (w *FabricWorker) Reload(v api.Switcher)
func (*FabricWorker) Start ¶
func (w *FabricWorker) Start(v api.Switcher)
func (*FabricWorker) Stop ¶
func (w *FabricWorker) Stop()
func (*FabricWorker) TcpMss ¶
func (w *FabricWorker) TcpMss() int
type Fabricer ¶
type Fabricer interface { AddNetwork(cfg *co.Network) DelNetwork(bridge string, vni uint32) TcpMss() int }
func GetFabricer ¶
type Hook ¶
type Hook func(client libol.SocketClient, frame *libol.FrameMessage) error
type Http ¶
type Http struct {
// contains filtered or unexported fields
}
func (*Http) Initialize ¶
func (h *Http) Initialize()
func (*Http) LoadRouter ¶
func (h *Http) LoadRouter()
func (*Http) ParseFiles ¶
func (h *Http) ParseFiles(w http.ResponseWriter, name string, data interface{}) error
type L2TP ¶
type L2TP struct {
// contains filtered or unexported fields
}
func (*L2TP) Initialize ¶
func (d *L2TP) Initialize()
func (*L2TP) OptionsFile ¶
func (*L2TP) OptionsTmpl ¶
func (*L2TP) SaveOptions ¶
func (d *L2TP) SaveOptions()
type Link ¶
type Link struct {
// contains filtered or unexported fields
}
func (*Link) Initialize ¶
func (l *Link) Initialize()
func (*Link) StatusFile ¶
type LinkImpl ¶
type LinkImpl struct {
// contains filtered or unexported fields
}
func (*LinkImpl) Add ¶
func (l *LinkImpl) Add(obj *database.VirtualLink)
func (*LinkImpl) Del ¶
func (l *LinkImpl) Del(obj *database.VirtualLink)
func (*LinkImpl) Update ¶
func (l *LinkImpl) Update(obj *database.VirtualLink)
type MemberLink ¶
type MemberLink struct {
LinkImpl
}
func (*MemberLink) Add ¶
func (l *MemberLink) Add(obj *database.VirtualLink)
func (*MemberLink) Del ¶
func (l *MemberLink) Del(obj *database.VirtualLink)
func (*MemberLink) Update ¶
func (l *MemberLink) Update(obj *database.VirtualLink)
type Networker ¶
type Networker interface { String() string ID() string Initialize() Start(v api.Switcher) Stop() Bridge() cn.Bridger Config() *co.Network Subnet() string Reload(v api.Switcher) Provider() string }
func NewNetworker ¶
type OpenLANWorker ¶
type OpenLANWorker struct { *WorkerImpl // contains filtered or unexported fields }
func NewOpenLANWorker ¶
func NewOpenLANWorker(c *co.Network) *OpenLANWorker
func (*OpenLANWorker) AddLink ¶
func (w *OpenLANWorker) AddLink(c co.Point)
func (*OpenLANWorker) Bridge ¶
func (w *OpenLANWorker) Bridge() cn.Bridger
func (*OpenLANWorker) DelLink ¶
func (w *OpenLANWorker) DelLink(addr string)
func (*OpenLANWorker) IfAddr ¶
func (w *OpenLANWorker) IfAddr() string
func (*OpenLANWorker) Initialize ¶
func (w *OpenLANWorker) Initialize()
func (*OpenLANWorker) LoadLinks ¶
func (w *OpenLANWorker) LoadLinks()
func (*OpenLANWorker) LoadRoutes ¶
func (w *OpenLANWorker) LoadRoutes()
func (*OpenLANWorker) Reload ¶
func (w *OpenLANWorker) Reload(v api.Switcher)
func (*OpenLANWorker) Start ¶
func (w *OpenLANWorker) Start(v api.Switcher)
func (*OpenLANWorker) Stop ¶
func (w *OpenLANWorker) Stop()
func (*OpenLANWorker) Subnet ¶
func (w *OpenLANWorker) Subnet() string
func (*OpenLANWorker) UnLoadLinks ¶
func (w *OpenLANWorker) UnLoadLinks()
func (*OpenLANWorker) UnLoadRoutes ¶
func (w *OpenLANWorker) UnLoadRoutes()
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 (*OpenVPN) DirectoryClientConfig ¶
func (*OpenVPN) FileClient ¶
func (*OpenVPN) Initialize ¶
func (o *OpenVPN) Initialize()
func (*OpenVPN) ProfileTmpl ¶
func (*OpenVPN) ServerTmpl ¶
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 ClientConfigDir 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 OvsBridge ¶
type OvsBridge struct {
// contains filtered or unexported fields
}
func NewOvsBridge ¶
type PolicyParameter ¶
type PolicyParameter struct {
// contains filtered or unexported fields
}
type RouterWorker ¶
type RouterWorker struct { *WorkerImpl // contains filtered or unexported fields }
func NewRouterWorker ¶
func NewRouterWorker(c *co.Network) *RouterWorker
func (*RouterWorker) Forward ¶
func (w *RouterWorker) Forward()
func (*RouterWorker) Initialize ¶
func (w *RouterWorker) Initialize()
func (*RouterWorker) LoadRoutes ¶
func (w *RouterWorker) LoadRoutes()
func (*RouterWorker) Reload ¶
func (w *RouterWorker) Reload(v api.Switcher)
func (*RouterWorker) Start ¶
func (w *RouterWorker) Start(v api.Switcher)
func (*RouterWorker) Stop ¶
func (w *RouterWorker) Stop()
func (*RouterWorker) UnLoadRoutes ¶
func (w *RouterWorker) UnLoadRoutes()
type StateParameters ¶
type StateParameters struct {
// contains filtered or unexported fields
}
type Switch ¶
type Switch struct {
// contains filtered or unexported fields
}
func (*Switch) Initialize ¶
func (v *Switch) Initialize()
func (*Switch) OffClient ¶
func (v *Switch) OffClient(client libol.SocketClient)
func (*Switch) ReadClient ¶
func (v *Switch) ReadClient(client libol.SocketClient, frame *libol.FrameMessage) error
func (*Switch) Server ¶
func (v *Switch) Server() libol.SocketServer
type TunnelLink ¶
type TunnelLink struct {
LinkImpl
}
func (*TunnelLink) Add ¶
func (l *TunnelLink) Add(obj *database.VirtualLink)
func (*TunnelLink) Del ¶
func (l *TunnelLink) Del(obj *database.VirtualLink)
type VxLANWorker ¶
type VxLANWorker struct { *WorkerImpl // contains filtered or unexported fields }
func NewVxLANWorker ¶
func NewVxLANWorker(c *co.Network) *VxLANWorker
func (*VxLANWorker) Initialize ¶
func (w *VxLANWorker) Initialize()
func (*VxLANWorker) Reload ¶
func (w *VxLANWorker) Reload(v api.Switcher)
func (*VxLANWorker) Start ¶
func (w *VxLANWorker) Start(v api.Switcher)
func (*VxLANWorker) Stop ¶
func (w *VxLANWorker) Stop()
type WorkerImpl ¶
type WorkerImpl struct {
// contains filtered or unexported fields
}
func NewWorkerApi ¶
func NewWorkerApi(c *co.Network) *WorkerImpl
func (*WorkerImpl) AddOutput ¶
func (w *WorkerImpl) AddOutput(bridge string, port *LinuxPort)
func (*WorkerImpl) AddPhysical ¶
func (w *WorkerImpl) AddPhysical(bridge string, vlan int, output string)
func (*WorkerImpl) Bridge ¶
func (w *WorkerImpl) Bridge() cn.Bridger
func (*WorkerImpl) Config ¶
func (w *WorkerImpl) Config() *co.Network
func (*WorkerImpl) DelOutput ¶
func (w *WorkerImpl) DelOutput(bridge string, port *LinuxPort)
func (*WorkerImpl) DelPhysical ¶
func (w *WorkerImpl) DelPhysical(bridge string, vlan int, output string)
func (*WorkerImpl) ID ¶
func (w *WorkerImpl) ID() string
func (*WorkerImpl) Initialize ¶
func (w *WorkerImpl) Initialize()
func (*WorkerImpl) Provider ¶
func (w *WorkerImpl) Provider() string
func (*WorkerImpl) Reload ¶
func (w *WorkerImpl) Reload(v api.Switcher)
func (*WorkerImpl) Start ¶
func (w *WorkerImpl) Start(v api.Switcher)
func (*WorkerImpl) Stop ¶
func (w *WorkerImpl) Stop()
func (*WorkerImpl) String ¶
func (w *WorkerImpl) String() string
func (*WorkerImpl) Subnet ¶
func (w *WorkerImpl) Subnet() string
Click to show internal directories.
Click to hide internal directories.