ovs

package
v0.0.0-...-ad9c0bf Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2019 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DefaultDatabase = "Open_vSwitch"
	SystemTable     = "Open_vSwitch"
	ControllerTable = "Controller"
	InterfaceTable  = "Interface"
	StartOVS        = "start_ovs.sh"
	StopOVS         = "stop_ovs.sh"
	RestartOVS      = "restart_ovs.sh"
)

Variables

This section is empty.

Functions

func OverwriteObjectCacheWithJSON

func OverwriteObjectCacheWithJSON(cache *ObjectCache, jsonConfig map[string]interface{})

Types

type Client

type Client struct {
	Address    string
	Protocol   string
	Port       string
	Connection *libovsdb.OvsdbClient
	Database   string
	Notifier   *Notifier
	Config     *Config
	ErrorChan  chan error
	QuitChan   chan bool
}

func NewClient

func NewClient(address, protocol, port string) (*Client, error)

func (*Client) MonitorAll

func (o *Client) MonitorAll()

func (*Client) RestartSystem

func (o *Client) RestartSystem() error

func (*Client) SetInterface

func (o *Client) SetInterface(interf *Interface) error

func (*Client) SetOpenFlowController

func (o *Client) SetOpenFlowController(controller *OpenFlowController) error

func (*Client) SetSystem

func (o *Client) SetSystem(system *System) error

func (*Client) StartClient

func (o *Client) StartClient(privateKeyPath, publicKeyPath, caPath string)

func (*Client) StartSystem

func (o *Client) StartSystem() error

func (*Client) StopClient

func (o *Client) StopClient()

func (*Client) StopMonitoring

func (o *Client) StopMonitoring()

func (*Client) StopSystem

func (o *Client) StopSystem() error

func (*Client) String

func (o *Client) String() string

func (*Client) SyncChangesToRemote

func (o *Client) SyncChangesToRemote(prev, new *ObjectCache) error

type Config

type Config struct {
	ObjCache *ObjectCache

	Initialized chan struct{}
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig() *Config

func (*Config) DeleteObjectCacheEntry

func (c *Config) DeleteObjectCacheEntry(tableName, uuid string) error

func (*Config) DumpObjectCache

func (c *Config) DumpObjectCache()

func (*Config) DumpRawCache

func (c *Config) DumpRawCache()

func (*Config) InitializeCache

func (c *Config) InitializeCache(updates *libovsdb.TableUpdates)

func (*Config) OverwriteCallback

func (c *Config) OverwriteCallback(callback ConfigCallback)

func (*Config) OverwriteObjectCache

func (c *Config) OverwriteObjectCache(cache *ObjectCache)

func (*Config) SyncCache

func (c *Config) SyncCache(updates *libovsdb.TableUpdates)

func (*Config) UpdateObjectCacheEntry

func (c *Config) UpdateObjectCacheEntry(tableName, uuid string, row libovsdb.Row) error

type ConfigCallback

type ConfigCallback func(config *Config) error

type Interface

type Interface struct {
	Name        string
	MTU         uint16
	AdminStatus string
	LinkStatus  string
	Statistics  *InterfaceStatistics
	// contains filtered or unexported fields
}

func (*Interface) Equal

func (i *Interface) Equal(comp *Interface) bool

func (*Interface) String

func (i *Interface) String() string

type InterfaceStatistics

type InterfaceStatistics struct {
	ReceivedPackets    uint64
	ReceivedErrors     uint64
	ReceivedDropped    uint64
	TransmittedPackets uint64
	TransmittedErrors  uint64
	TransmittedDropped uint64
}

func (*InterfaceStatistics) String

func (s *InterfaceStatistics) String() string

type Notifier

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

func (Notifier) Disconnected

func (n Notifier) Disconnected(client *libovsdb.OvsdbClient)

func (Notifier) Echo

func (n Notifier) Echo([]interface{})

func (Notifier) Locked

func (n Notifier) Locked([]interface{})

func (Notifier) Stolen

func (n Notifier) Stolen([]interface{})

func (Notifier) Update

func (n Notifier) Update(context interface{}, tableUpdates libovsdb.TableUpdates)

type ObjectCache

type ObjectCache struct {
	System      *System
	Controllers map[string]*OpenFlowController
	Interfaces  map[string]*Interface
}

func CopyConfigObjectCache

func CopyConfigObjectCache(c *ObjectCache) *ObjectCache

type OpenFlowController

type OpenFlowController struct {
	Name      string
	Connected bool
	Target    *OpenFlowControllerTarget
	// contains filtered or unexported fields
}

func (*OpenFlowController) Equal

func (c *OpenFlowController) Equal(comp *OpenFlowController) bool

func (*OpenFlowController) String

func (c *OpenFlowController) String() string

type OpenFlowControllerTarget

type OpenFlowControllerTarget struct {
	Address  string
	Protocol string
	Port     uint16
}

func ParseOpenFlowControllerTarget

func ParseOpenFlowControllerTarget(target string) (*OpenFlowControllerTarget, error)

func (*OpenFlowControllerTarget) String

func (t *OpenFlowControllerTarget) String() string

type System

type System struct {
	Version  string
	Hostname string
	// contains filtered or unexported fields
}

func (*System) Equal

func (s *System) Equal(comp *System) bool

func (*System) String

func (s *System) String() string

type SystemBroker

type SystemBroker struct {
	GNXIService *gnxi.Service

	OVSClient *Client
	// contains filtered or unexported fields
}

func NewSystemBroker

func NewSystemBroker(gnxiService *gnxi.Service, certManager *cert.Manager) *SystemBroker

func (*SystemBroker) GNMIConfigChangeCallback

func (s *SystemBroker) GNMIConfigChangeCallback(new ygot.ValidatedGoStruct) error

func (*SystemBroker) GNMIConfigSetupCallback

func (s *SystemBroker) GNMIConfigSetupCallback(new ygot.ValidatedGoStruct) error

func (*SystemBroker) GNOIRebootCallback

func (s *SystemBroker) GNOIRebootCallback() error

func (*SystemBroker) GNOIRotateCertificatesCallback

func (s *SystemBroker) GNOIRotateCertificatesCallback(certID string) error

func (*SystemBroker) GenerateConfig

func (s *SystemBroker) GenerateConfig(config *Config) ([]byte, error)

func (*SystemBroker) OVSConfigChangeCallback

func (s *SystemBroker) OVSConfigChangeCallback(ovsConfig *Config) error

func (*SystemBroker) RegisterWatchdogChannels

func (s *SystemBroker) RegisterWatchdogChannels(startOVSClientChan, startGNXIServiceChan, stopOVSClientChan, stopGNXIServiceChan chan bool)

Jump to

Keyboard shortcuts

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