Documentation ¶
Index ¶
- Constants
- type FakeNetEpDriver
- func (d *FakeNetEpDriver) CreateEndpoint(id string) error
- func (d *FakeNetEpDriver) CreateNetwork(id string) error
- func (d *FakeNetEpDriver) CreatePeerHost(id string) error
- func (d *FakeNetEpDriver) Deinit()
- func (d *FakeNetEpDriver) DeleteEndpoint(id string) (err error)
- func (d *FakeNetEpDriver) DeleteNetwork(id string) error
- func (d *FakeNetEpDriver) DeletePeerHost(id string) error
- func (d *FakeNetEpDriver) Init(config *core.Config, info *core.InstanceInfo) error
- type FakeNetEpDriverConfig
- type OvsCfgEndpointState
- type OvsCfgNetworkState
- type OvsDriver
- func (d *OvsDriver) CreateEndpoint(id string) error
- func (d *OvsDriver) CreateNetwork(id string) error
- func (d *OvsDriver) CreatePeerHost(id string) error
- func (d *OvsDriver) Deinit()
- func (d *OvsDriver) DeleteEndpoint(id string) (err error)
- func (d *OvsDriver) DeleteNetwork(id string) error
- func (d *OvsDriver) DeletePeerHost(id string) error
- func (d *OvsDriver) Init(config *core.Config, info *core.InstanceInfo) error
- type OvsDriverConfig
- type OvsDriverOperState
- type OvsOperEndpointState
- type OvsSwitch
- func (sw *OvsSwitch) AddUplinkPort(intfName string) error
- func (sw *OvsSwitch) CreateNetwork(pktTag uint16, extPktTag uint32) error
- func (sw *OvsSwitch) CreatePort(intfName, intfType string, cfgEp *OvsCfgEndpointState, pktTag int) error
- func (sw *OvsSwitch) CreateVtep(vtepIP string) error
- func (sw *OvsSwitch) Delete()
- func (sw *OvsSwitch) DeleteNetwork(pktTag uint16, extPktTag uint32) error
- func (sw *OvsSwitch) DeletePort(epOper *OvsOperEndpointState) error
- func (sw *OvsSwitch) DeleteVtep(vtepIP string) error
- func (sw *OvsSwitch) UpdatePort(intfName string, cfgEp *OvsCfgEndpointState, pktTag int) error
- type OvsdbDriver
- func (d *OvsdbDriver) AddController(ipAddr string, portNo uint16) error
- func (d *OvsdbDriver) CreatePort(intfName, intfType, id string, tag int) 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) DeleteVtep(intfName string) error
- func (d *OvsdbDriver) Echo([]interface{})
- 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) IsPortNamePresent(intfName 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)
- type PeerHostState
Constants ¶
const ( // StateBasePath is the base path for all state operations. StateBasePath = "/contiv/" // StateConfigPath is the path to the root of the configuration state StateConfigPath = StateBasePath + "config/" // StateOperPath is the path to the operations stored in state. StateOperPath = StateBasePath + "oper/" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FakeNetEpDriver ¶
type FakeNetEpDriver struct { }
FakeNetEpDriver implements core.NetworkDriver interface for use with unit-tests
func (*FakeNetEpDriver) CreateEndpoint ¶
func (d *FakeNetEpDriver) CreateEndpoint(id string) error
CreateEndpoint is not implemented.
func (*FakeNetEpDriver) CreateNetwork ¶
func (d *FakeNetEpDriver) CreateNetwork(id string) error
CreateNetwork is not implemented.
func (*FakeNetEpDriver) CreatePeerHost ¶
func (d *FakeNetEpDriver) CreatePeerHost(id string) error
CreatePeerHost is not implemented.
func (*FakeNetEpDriver) DeleteEndpoint ¶
func (d *FakeNetEpDriver) DeleteEndpoint(id string) (err error)
DeleteEndpoint is not implemented.
func (*FakeNetEpDriver) DeleteNetwork ¶
func (d *FakeNetEpDriver) DeleteNetwork(id string) error
DeleteNetwork is not implemented.
func (*FakeNetEpDriver) DeletePeerHost ¶
func (d *FakeNetEpDriver) DeletePeerHost(id string) error
DeletePeerHost is not implemented.
func (*FakeNetEpDriver) Init ¶
func (d *FakeNetEpDriver) Init(config *core.Config, info *core.InstanceInfo) error
Init is not implemented.
type FakeNetEpDriverConfig ¶
type FakeNetEpDriverConfig struct{}
FakeNetEpDriverConfig represents the configuration of the fakedriver, which is an empty struct.
type OvsCfgEndpointState ¶
type OvsCfgEndpointState struct { core.CommonState NetID string `json:"netID"` ContName string `json:"contName"` AttachUUID string `json:"attachUUID"` IPAddress string `json:"ipAddress"` MacAddress string `json:"macAddress"` HomingHost string `json:"homingHost"` IntfName string `json:"intfName"` VtepIP string `json:"vtepIP"` }
OvsCfgEndpointState implements the State interface for an endpoint implemented using vlans with ovs. The state is stored as Json objects.
func (*OvsCfgEndpointState) Clear ¶
func (s *OvsCfgEndpointState) Clear() error
Clear removes the state.
func (*OvsCfgEndpointState) Read ¶
func (s *OvsCfgEndpointState) Read(id string) error
Read the state for a given identifier.
func (*OvsCfgEndpointState) ReadAll ¶
func (s *OvsCfgEndpointState) ReadAll() ([]core.State, error)
ReadAll reads all state objects for the endpoints.
func (*OvsCfgEndpointState) WatchAll ¶
func (s *OvsCfgEndpointState) WatchAll(rsps chan core.WatchState) error
WatchAll fills a channel on each state event related to endpoints.
type OvsCfgNetworkState ¶
type OvsCfgNetworkState struct { core.CommonState Tenant string `json:"tenant"` PktTagType string `json:"pktTagType"` PktTag int `json:"pktTag"` ExtPktTag int `json:"extPktTag"` SubnetIP string `json:"subnetIP"` SubnetLen uint `json:"subnetLen"` DefaultGw string `json:"defaultGw"` EpCount int `json:"epCount"` IPAllocMap bitset.BitSet `json:"ipAllocMap"` }
OvsCfgNetworkState implements the State interface for a network implemented using vlans with ovs. The state is stored as Json objects.
func (*OvsCfgNetworkState) Clear ¶
func (s *OvsCfgNetworkState) Clear() error
Clear removes the state.
func (*OvsCfgNetworkState) Read ¶
func (s *OvsCfgNetworkState) Read(id string) error
Read the state for a given identifier
func (*OvsCfgNetworkState) ReadAll ¶
func (s *OvsCfgNetworkState) ReadAll() ([]core.State, error)
ReadAll state and return the collection.
func (*OvsCfgNetworkState) WatchAll ¶
func (s *OvsCfgNetworkState) WatchAll(rsps chan core.WatchState) error
WatchAll state transitions and send them through the channel.
type OvsDriver ¶
type OvsDriver struct {
// contains filtered or unexported fields
}
OvsDriver implements the Layer 2 Network and Endpoint Driver interfaces specific to vlan based open-vswitch.
func (*OvsDriver) CreateEndpoint ¶
CreateEndpoint creates an endpoint by named identifier
func (*OvsDriver) CreateNetwork ¶
CreateNetwork creates a network by named identifier
func (*OvsDriver) CreatePeerHost ¶
CreatePeerHost creates peer host object and adds VTEPs if necessary
func (*OvsDriver) Deinit ¶
func (d *OvsDriver) Deinit()
Deinit performs cleanup prior to destruction of the OvsDriver
func (*OvsDriver) DeleteEndpoint ¶
DeleteEndpoint deletes an endpoint by named identifier.
func (*OvsDriver) DeleteNetwork ¶
DeleteNetwork deletes a network by named identifier
func (*OvsDriver) DeletePeerHost ¶
DeletePeerHost deletes peer host info and associated VTEP
type OvsDriverConfig ¶
OvsDriverConfig defines the configuration required to initialize the OvsDriver.
type OvsDriverOperState ¶
type OvsDriverOperState struct { core.CommonState // used to allocate port names. XXX: should it be user controlled? CurrPortNum int `json:"currPortNum"` }
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 OvsOperEndpointState ¶
type OvsOperEndpointState struct { core.CommonState NetID string `json:"netID"` ContName string `json:"contName"` ContUUID string `json:"contUUID"` AttachUUID string `json:"attachUUID"` IPAddress string `json:"ipAddress"` MacAddress string `json:"macAddress"` HomingHost string `json:"homingHost"` IntfName string `json:"intfName"` PortName string `json:"portName"` VtepIP string `json:"vtepIP"` }
OvsOperEndpointState is the necessary data used to perform operations on endpoints.
func (*OvsOperEndpointState) Clear ¶
func (s *OvsOperEndpointState) Clear() error
Clear removes the state.
func (*OvsOperEndpointState) Matches ¶
func (s *OvsOperEndpointState) Matches(c *OvsCfgEndpointState) bool
Matches matches the fields updated from configuration state
func (*OvsOperEndpointState) Read ¶
func (s *OvsOperEndpointState) Read(id string) error
Read the state for a given identifier.
type OvsSwitch ¶
type OvsSwitch struct {
// contains filtered or unexported fields
}
OvsSwitch represents on OVS bridge instance
func NewOvsSwitch ¶
NewOvsSwitch Creates a new OVS switch instance
func (*OvsSwitch) AddUplinkPort ¶
AddUplinkPort adds uplink port to the OVS
func (*OvsSwitch) CreateNetwork ¶
CreateNetwork creates a new network/vlan
func (*OvsSwitch) CreatePort ¶
func (sw *OvsSwitch) CreatePort(intfName, intfType string, cfgEp *OvsCfgEndpointState, pktTag int) error
CreatePort creates a port in ovs switch
func (*OvsSwitch) CreateVtep ¶
CreateVtep creates a VTEP interface
func (*OvsSwitch) Delete ¶
func (sw *OvsSwitch) Delete()
Delete performs cleanup prior to destruction of the OvsDriver
func (*OvsSwitch) DeleteNetwork ¶
DeleteNetwork deletes a network/vlan
func (*OvsSwitch) DeletePort ¶
func (sw *OvsSwitch) DeletePort(epOper *OvsOperEndpointState) error
DeletePort removes a port from OVS
func (*OvsSwitch) DeleteVtep ¶
DeleteVtep deletes a VTEP
func (*OvsSwitch) UpdatePort ¶
func (sw *OvsSwitch) UpdatePort(intfName string, cfgEp *OvsCfgEndpointState, pktTag int) 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) (*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 int) error
CreatePort creates an OVS port
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) 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) GetOfpPortNo ¶
func (d *OvsdbDriver) GetOfpPortNo(intfName string) (uint32, error)
GetOfpPortNo : Return 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) IsPortNamePresent ¶
func (d *OvsdbDriver) IsPortNamePresent(intfName 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.
type PeerHostState ¶
type PeerHostState struct { core.CommonState Hostname string // Name of this host HostAddr string // control plane IP address of the host VtepIPAddr string // VTEP IP address to use }
PeerHostState : Information about the peer host
func (*PeerHostState) Read ¶
func (s *PeerHostState) Read(id string) error
Read the state for a given identifier.
func (*PeerHostState) ReadAll ¶
func (s *PeerHostState) ReadAll() ([]core.State, error)
ReadAll reads all state objects for the peer.
func (*PeerHostState) WatchAll ¶
func (s *PeerHostState) WatchAll(rsps chan core.WatchState) error
WatchAll fills a channel on each state event related to peers.