Documentation
¶
Index ¶
- type EpInfo
- type NodeSvcProxy
- func (p *NodeSvcProxy) AddLocalIP(globalIP, localIP string)
- func (p *NodeSvcProxy) AddSvcSpec(svcName string, spec *core.ServiceSpec) error
- func (p *NodeSvcProxy) DelSvcSpec(svcName string, spec *core.ServiceSpec) error
- func (p *NodeSvcProxy) DeleteLocalIP(globalIP string)
- func (p *NodeSvcProxy) SvcProviderUpdate(svcName string, providers []string)
- type OvsDriver
- func (d *OvsDriver) AddBgp(id string) error
- func (d *OvsDriver) AddMaster(node core.ServiceInfo) error
- func (d *OvsDriver) AddPeerHost(node core.ServiceInfo) error
- func (d *OvsDriver) AddPolicyRule(id string) error
- func (d *OvsDriver) AddSvcSpec(svcName string, spec *core.ServiceSpec) error
- func (d *OvsDriver) CreateEndpoint(id string) error
- func (d *OvsDriver) CreateHostAccPort(portName, globalIP string, net int) (string, error)
- func (d *OvsDriver) CreateNetwork(id string) error
- func (d *OvsDriver) CreateRemoteEndpoint(id string) error
- func (d *OvsDriver) Deinit()
- func (d *OvsDriver) DelPolicyRule(id string) error
- func (d *OvsDriver) DelSvcSpec(svcName string, spec *core.ServiceSpec) error
- func (d *OvsDriver) DeleteBgp(id string) error
- func (d *OvsDriver) DeleteEndpoint(id string) error
- func (d *OvsDriver) DeleteHostAccPort(id string) error
- func (d *OvsDriver) DeleteMaster(node core.ServiceInfo) error
- func (d *OvsDriver) DeleteNetwork(id, subnet, nwType, encap string, pktTag, extPktTag int, gateway string, ...) error
- func (d *OvsDriver) DeletePeerHost(node core.ServiceInfo) error
- func (d *OvsDriver) DeleteRemoteEndpoint(id string) error
- func (d *OvsDriver) GetEndpointStats() ([]byte, error)
- func (d *OvsDriver) GlobalConfigUpdate(inst core.InstanceInfo) error
- func (d *OvsDriver) Init(info *core.InstanceInfo) error
- func (d *OvsDriver) InspectBgp() ([]byte, error)
- func (d *OvsDriver) InspectNameserver() ([]byte, error)
- func (d *OvsDriver) InspectState() ([]byte, error)
- func (d *OvsDriver) SvcProviderUpdate(svcName string, providers []string)
- func (d *OvsDriver) UpdateEndpointGroup(id string) error
- type OvsDriverOperState
- type OvsSwitch
- func (sw *OvsSwitch) AddBgp(hostname string, routerIP string, As string, neighborAs, neighbor string) error
- func (sw *OvsSwitch) AddHostPort(intfName string, intfNum, network int, isHostNS bool) (string, error)
- func (sw *OvsSwitch) AddMaster(node core.ServiceInfo) error
- func (sw *OvsSwitch) AddNameServer(ns ofnet.NameServer)
- func (sw *OvsSwitch) AddSvcSpec(svcName string, spec *ofnet.ServiceSpec) error
- func (sw *OvsSwitch) AddUplink(uplinkName string, intfList []string) error
- func (sw *OvsSwitch) CreateNetwork(pktTag uint16, extPktTag uint32, defaultGw string, Vrf string) error
- func (sw *OvsSwitch) CreatePort(intfName string, cfgEp *mastercfg.CfgEndpointState, ...) error
- func (sw *OvsSwitch) CreateVtep(vtepIP string) error
- func (sw *OvsSwitch) DelHostPort(intfName string, isHostNS bool) error
- func (sw *OvsSwitch) DelSvcSpec(svcName string, spec *ofnet.ServiceSpec) error
- func (sw *OvsSwitch) Delete()
- func (sw *OvsSwitch) DeleteBgp() error
- func (sw *OvsSwitch) DeleteMaster(node core.ServiceInfo) error
- func (sw *OvsSwitch) DeleteNetwork(pktTag uint16, extPktTag uint32, gateway string, Vrf string) error
- func (sw *OvsSwitch) DeletePort(epOper *drivers.OperEndpointState, skipVethPair bool) error
- func (sw *OvsSwitch) DeleteVtep(vtepIP string) error
- func (sw *OvsSwitch) GetEndpointStats() (map[string]*ofnet.OfnetEndpointStats, error)
- func (sw *OvsSwitch) GetUplinkInterfaces(uplinkID string) []string
- func (sw *OvsSwitch) GlobalConfigUpdate(cfg ofnet.OfnetGlobalConfig) error
- func (sw *OvsSwitch) HandleLinkUpdates(linkUpd ofnet.LinkUpdateInfo)
- func (sw *OvsSwitch) InspectBgp() (interface{}, error)
- func (sw *OvsSwitch) InspectState() (interface{}, error)
- func (sw *OvsSwitch) RemoveUplinks() error
- func (sw *OvsSwitch) SvcProviderUpdate(svcName string, providers []string)
- func (sw *OvsSwitch) UpdateEndpoint(ovsPortName string, burst, dscp int, epgBandwidth int64) error
- func (sw *OvsSwitch) UpdatePort(intfName string, cfgEp *mastercfg.CfgEndpointState, pktTag, nwPktTag, dscp int, ...) error
- type OvsdbDriver
- func (d *OvsdbDriver) AddController(ipAddr string, portNo uint16) error
- func (d *OvsdbDriver) CreatePort(intfName, intfType, id string, tag, burst int, bandwidth int64) error
- func (d *OvsdbDriver) CreatePortBond(intfList []string, bondName string) error
- func (d *OvsdbDriver) CreateVtep(intfName string, vtepRemoteIP string) error
- func (d *OvsdbDriver) Delete() error
- func (d *OvsdbDriver) DeletePort(intfName string) error
- func (d *OvsdbDriver) DeletePortBond(bondName string, intfList []string) error
- func (d *OvsdbDriver) DeleteVtep(intfName string) error
- func (d *OvsdbDriver) Echo([]interface{})
- func (d *OvsdbDriver) GetInterfacesInPort(portName string) []string
- func (d *OvsdbDriver) GetIntfInfo(uuid libovsdb.UUID) libovsdb.Row
- func (d *OvsdbDriver) GetOfpPortNo(intfName string) (uint32, error)
- func (d *OvsdbDriver) GetPortOrIntfNameFromID(id string, isPort bool) (string, error)
- func (d *OvsdbDriver) IsControllerPresent(target string) bool
- func (d *OvsdbDriver) IsIntfNamePresent(intfName string) bool
- func (d *OvsdbDriver) IsPortNamePresent(portName string) bool
- func (d *OvsdbDriver) IsVtepPresent(remoteIP string) (bool, string)
- func (d *OvsdbDriver) Locked([]interface{})
- func (d *OvsdbDriver) RemoveController(target string) error
- func (d *OvsdbDriver) Stolen([]interface{})
- func (d *OvsdbDriver) Update(context interface{}, tableUpdates libovsdb.TableUpdates)
- func (d *OvsdbDriver) UpdatePolicingRate(intfName string, burst int, bandwidth int64) error
- type Presence
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EpInfo ¶
type EpInfo struct {
Ovsportname string `json:"Ovsportname"`
EpgKey string `json:"EpgKey"`
BridgeType string `json:"BridgeType"`
}
EpInfo contains the ovsport and id of the group
type NodeSvcProxy ¶
type NodeSvcProxy struct {
Mutex sync.Mutex
SvcMap map[string]core.ServiceSpec // service name as key
ProvMap map[string]Presence // service name as key
LocalIP map[string]string // globalIP as key
// contains filtered or unexported fields
}
NodeSvcProxy holds service proxy info
func NewNodeProxy ¶
func NewNodeProxy() (*NodeSvcProxy, error)
NewNodeProxy creates an instance of the node proxy
func (*NodeSvcProxy) AddLocalIP ¶
func (p *NodeSvcProxy) AddLocalIP(globalIP, localIP string)
AddLocalIP adds an entry to the localIP map
func (*NodeSvcProxy) AddSvcSpec ¶
func (p *NodeSvcProxy) AddSvcSpec(svcName string, spec *core.ServiceSpec) error
AddSvcSpec adds a service to the proxy
func (*NodeSvcProxy) DelSvcSpec ¶
func (p *NodeSvcProxy) DelSvcSpec(svcName string, spec *core.ServiceSpec) error
DelSvcSpec deletes a service from the proxy
func (*NodeSvcProxy) DeleteLocalIP ¶
func (p *NodeSvcProxy) DeleteLocalIP(globalIP string)
DeleteLocalIP removes an entry from the localIP map
func (*NodeSvcProxy) SvcProviderUpdate ¶
func (p *NodeSvcProxy) SvcProviderUpdate(svcName string, providers []string)
SvcProviderUpdate invokes switch api
type OvsDriver ¶
type OvsDriver struct {
HostProxy *NodeSvcProxy
// contains filtered or unexported fields
}
OvsDriver implements the Layer 2 Network and Endpoint Driver interfaces specific to vlan based open-vswitch.
func (*OvsDriver) AddMaster ¶
func (d *OvsDriver) AddMaster(node core.ServiceInfo) error
AddMaster adds master node
func (*OvsDriver) AddPeerHost ¶
func (d *OvsDriver) AddPeerHost(node core.ServiceInfo) error
AddPeerHost adds VTEPs if necessary
func (*OvsDriver) AddPolicyRule ¶
AddPolicyRule creates a policy rule
func (*OvsDriver) AddSvcSpec ¶
func (d *OvsDriver) AddSvcSpec(svcName string, spec *core.ServiceSpec) error
AddSvcSpec invokes switch api
func (*OvsDriver) CreateEndpoint ¶
CreateEndpoint creates an endpoint by named identifier
func (*OvsDriver) CreateHostAccPort ¶
CreateHostAccPort creates an access port
func (*OvsDriver) CreateNetwork ¶
CreateNetwork creates a network by named identifier
func (*OvsDriver) CreateRemoteEndpoint ¶
CreateRemoteEndpoint creates a remote endpoint by named identifier
func (*OvsDriver) Deinit ¶
func (d *OvsDriver) Deinit()
Deinit performs cleanup prior to destruction of the OvsDriver
func (*OvsDriver) DelPolicyRule ¶
DelPolicyRule deletes a policy rule
func (*OvsDriver) DelSvcSpec ¶
func (d *OvsDriver) DelSvcSpec(svcName string, spec *core.ServiceSpec) error
DelSvcSpec invokes switch api
func (*OvsDriver) DeleteEndpoint ¶
DeleteEndpoint deletes an endpoint by named identifier.
func (*OvsDriver) DeleteHostAccPort ¶
DeleteHostAccPort deletes the access port
func (*OvsDriver) DeleteMaster ¶
func (d *OvsDriver) DeleteMaster(node core.ServiceInfo) error
DeleteMaster deletes master node
func (*OvsDriver) DeleteNetwork ¶
func (d *OvsDriver) DeleteNetwork(id, subnet, nwType, encap string, pktTag, extPktTag int, gateway string, tenant string) error
DeleteNetwork deletes a network by named identifier
func (*OvsDriver) DeletePeerHost ¶
func (d *OvsDriver) DeletePeerHost(node core.ServiceInfo) error
DeletePeerHost deletes associated VTEP
func (*OvsDriver) DeleteRemoteEndpoint ¶
DeleteRemoteEndpoint deletes a remote endpoint by named identifier
func (*OvsDriver) GetEndpointStats ¶
GetEndpointStats gets all endpoints from all ovs instances
func (*OvsDriver) GlobalConfigUpdate ¶
func (d *OvsDriver) GlobalConfigUpdate(inst core.InstanceInfo) error
GlobalConfigUpdate sets the global level configs like arp-mode
func (*OvsDriver) Init ¶
func (d *OvsDriver) Init(info *core.InstanceInfo) error
Init initializes the OVS driver.
func (*OvsDriver) InspectBgp ¶
InspectBgp returns bgp state as json string
func (*OvsDriver) InspectNameserver ¶
InspectNameserver returns nameserver state as json string
func (*OvsDriver) InspectState ¶
InspectState returns driver state as json string
func (*OvsDriver) SvcProviderUpdate ¶
SvcProviderUpdate invokes switch api
func (*OvsDriver) UpdateEndpointGroup ¶
UpdateEndpointGroup updates the epg
type OvsDriverOperState ¶
type OvsDriverOperState struct {
core.CommonState
// used to allocate port names. XXX: should it be user controlled?
CurrPortNum int `json:"currPortNum"`
LocalEpInfo map[string]*EpInfo `json:"LocalEpInfo"` // info about local endpoints
// contains filtered or unexported fields
}
OvsDriverOperState carries operational state of the OvsDriver.
func (*OvsDriverOperState) Clear ¶
func (s *OvsDriverOperState) Clear() error
Clear removes the state.
func (*OvsDriverOperState) Read ¶
func (s *OvsDriverOperState) Read(id string) error
Read the state given an ID.
type OvsSwitch ¶
type OvsSwitch struct {
// contains filtered or unexported fields
}
OvsSwitch represents on OVS bridge instance
func NewOvsSwitch ¶
func NewOvsSwitch(bridgeName, netType, localIP, fwdMode string, vlanIntf []string, hostPvtNW int, vxlanUDPPort int) (*OvsSwitch, error)
NewOvsSwitch Creates a new OVS switch instance
func (*OvsSwitch) AddBgp ¶
func (sw *OvsSwitch) AddBgp(hostname string, routerIP string, As string, neighborAs, neighbor string) error
AddBgp adds a bgp config to host
func (*OvsSwitch) AddHostPort ¶
func (sw *OvsSwitch) AddHostPort(intfName string, intfNum, network int, isHostNS bool) (string, error)
AddHostPort adds a host port to the OVS
func (*OvsSwitch) AddMaster ¶
func (sw *OvsSwitch) AddMaster(node core.ServiceInfo) error
AddMaster adds master node
func (*OvsSwitch) AddNameServer ¶
func (sw *OvsSwitch) AddNameServer(ns ofnet.NameServer)
AddNameServer returns ofnet state in json form
func (*OvsSwitch) AddSvcSpec ¶
func (sw *OvsSwitch) AddSvcSpec(svcName string, spec *ofnet.ServiceSpec) error
AddSvcSpec invokes ofnetAgent api
func (*OvsSwitch) CreateNetwork ¶
func (sw *OvsSwitch) CreateNetwork(pktTag uint16, extPktTag uint32, defaultGw string, Vrf string) error
CreateNetwork creates a new network/vlan
func (*OvsSwitch) CreatePort ¶
func (sw *OvsSwitch) CreatePort(intfName string, cfgEp *mastercfg.CfgEndpointState, pktTag, nwPktTag, burst, dscp int, skipVethPair bool, bandwidth int64) error
CreatePort creates a port in ovs switch
func (*OvsSwitch) CreateVtep ¶
CreateVtep creates a VTEP interface
func (*OvsSwitch) DelHostPort ¶
DelHostPort removes a host port from the OVS
func (*OvsSwitch) DelSvcSpec ¶
func (sw *OvsSwitch) DelSvcSpec(svcName string, spec *ofnet.ServiceSpec) error
DelSvcSpec invokes ofnetAgent api
func (*OvsSwitch) Delete ¶
func (sw *OvsSwitch) Delete()
Delete performs cleanup prior to destruction of the OvsDriver
func (*OvsSwitch) DeleteMaster ¶
func (sw *OvsSwitch) DeleteMaster(node core.ServiceInfo) error
DeleteMaster deletes master node
func (*OvsSwitch) DeleteNetwork ¶
func (sw *OvsSwitch) DeleteNetwork(pktTag uint16, extPktTag uint32, gateway string, Vrf string) error
DeleteNetwork deletes a network/vlan
func (*OvsSwitch) DeletePort ¶
func (sw *OvsSwitch) DeletePort(epOper *drivers.OperEndpointState, skipVethPair bool) error
DeletePort removes a port from OVS
func (*OvsSwitch) DeleteVtep ¶
DeleteVtep deletes a VTEP
func (*OvsSwitch) GetEndpointStats ¶
func (sw *OvsSwitch) GetEndpointStats() (map[string]*ofnet.OfnetEndpointStats, error)
GetEndpointStats invokes ofnetAgent api
func (*OvsSwitch) GetUplinkInterfaces ¶
GetUplinkInterfaces returns the list of interface associated with the uplink port
func (*OvsSwitch) GlobalConfigUpdate ¶
func (sw *OvsSwitch) GlobalConfigUpdate(cfg ofnet.OfnetGlobalConfig) error
GlobalConfigUpdate updates the global configs like arp-mode
func (*OvsSwitch) HandleLinkUpdates ¶
func (sw *OvsSwitch) HandleLinkUpdates(linkUpd ofnet.LinkUpdateInfo)
HandleLinkUpdates handle link updates and update the datapath
func (*OvsSwitch) InspectBgp ¶
InspectBgp returns ofnet state in json form
func (*OvsSwitch) InspectState ¶
InspectState ireturns ofnet state in json form
func (*OvsSwitch) RemoveUplinks ¶
RemoveUplinks removes uplink ports from the OVS
func (*OvsSwitch) SvcProviderUpdate ¶
SvcProviderUpdate invokes ofnetAgent api
func (*OvsSwitch) UpdateEndpoint ¶
UpdateEndpoint updates endpoint state
func (*OvsSwitch) UpdatePort ¶
func (sw *OvsSwitch) UpdatePort(intfName string, cfgEp *mastercfg.CfgEndpointState, pktTag, nwPktTag, dscp int, skipVethPair bool) error
UpdatePort updates an OVS port without creating it
type OvsdbDriver ¶
type OvsdbDriver struct {
// contains filtered or unexported fields
}
OvsdbDriver is responsible for programming OVS using ovsdb protocol. It also implements the libovsdb.Notifier interface to keep cache of ovs table state.
func NewOvsdbDriver ¶
func NewOvsdbDriver(bridgeName string, failMode string, vxlanUDPPort int) (*OvsdbDriver, error)
NewOvsdbDriver creates a new OVSDB driver instance. Create one ovsdb driver instance per OVS bridge that needs to be managed
func (*OvsdbDriver) AddController ¶
func (d *OvsdbDriver) AddController(ipAddr string, portNo uint16) error
AddController : Add controller configuration to OVS
func (*OvsdbDriver) CreatePort ¶
func (d *OvsdbDriver) CreatePort(intfName, intfType, id string, tag, burst int, bandwidth int64) error
CreatePort creates an OVS port
func (*OvsdbDriver) CreatePortBond ¶
func (d *OvsdbDriver) CreatePortBond(intfList []string, bondName string) error
CreatePortBond creates port bond in OVS
func (*OvsdbDriver) CreateVtep ¶
func (d *OvsdbDriver) CreateVtep(intfName string, vtepRemoteIP string) error
CreateVtep creates a VTEP port on the OVS
func (*OvsdbDriver) Delete ¶
func (d *OvsdbDriver) Delete() error
Delete : Cleanup the ovsdb driver. delete the bridge we created.
func (*OvsdbDriver) DeletePort ¶
func (d *OvsdbDriver) DeletePort(intfName string) error
DeletePort deletes a port from OVS
func (*OvsdbDriver) DeletePortBond ¶
func (d *OvsdbDriver) DeletePortBond(bondName string, intfList []string) error
DeletePortBond deletes a port bond from OVS
func (*OvsdbDriver) DeleteVtep ¶
func (d *OvsdbDriver) DeleteVtep(intfName string) error
DeleteVtep deletes a VTEP port
func (*OvsdbDriver) Echo ¶
func (d *OvsdbDriver) Echo([]interface{})
Echo satisfies a libovsdb interface dependency.
func (*OvsdbDriver) GetInterfacesInPort ¶
func (d *OvsdbDriver) GetInterfacesInPort(portName string) []string
GetInterfacesInPort gets list of interfaces in a port in sorted order
func (*OvsdbDriver) GetIntfInfo ¶
func (d *OvsdbDriver) GetIntfInfo(uuid libovsdb.UUID) libovsdb.Row
GetIntfInfo gets interface information from "Interface" table
func (*OvsdbDriver) GetOfpPortNo ¶
func (d *OvsdbDriver) GetOfpPortNo(intfName string) (uint32, error)
GetOfpPortNo returns OFP port number for an interface
func (*OvsdbDriver) GetPortOrIntfNameFromID ¶
func (d *OvsdbDriver) GetPortOrIntfNameFromID(id string, isPort bool) (string, error)
GetPortOrIntfNameFromID gets interface name from id
func (*OvsdbDriver) IsControllerPresent ¶
func (d *OvsdbDriver) IsControllerPresent(target string) bool
IsControllerPresent : Check if Controller already exists
func (*OvsdbDriver) IsIntfNamePresent ¶
func (d *OvsdbDriver) IsIntfNamePresent(intfName string) bool
IsIntfNamePresent checks if intf already exists in OVS bridge
func (*OvsdbDriver) IsPortNamePresent ¶
func (d *OvsdbDriver) IsPortNamePresent(portName string) bool
IsPortNamePresent checks if port already exists in OVS bridge
func (*OvsdbDriver) IsVtepPresent ¶
func (d *OvsdbDriver) IsVtepPresent(remoteIP string) (bool, string)
IsVtepPresent checks if VTEP already exists
func (*OvsdbDriver) Locked ¶
func (d *OvsdbDriver) Locked([]interface{})
Locked satisfies a libovsdb interface dependency.
func (*OvsdbDriver) RemoveController ¶
func (d *OvsdbDriver) RemoveController(target string) error
RemoveController : Remove controller configuration
func (*OvsdbDriver) Stolen ¶
func (d *OvsdbDriver) Stolen([]interface{})
Stolen satisfies a libovsdb interface dependency.
func (*OvsdbDriver) Update ¶
func (d *OvsdbDriver) Update(context interface{}, tableUpdates libovsdb.TableUpdates)
Update updates the ovsdb with the libovsdb.TableUpdates.
func (*OvsdbDriver) UpdatePolicingRate ¶
func (d *OvsdbDriver) UpdatePolicingRate(intfName string, burst int, bandwidth int64) error
UpdatePolicingRate will update the ingress policing rate in interface table.