Documentation
¶
Index ¶
- Constants
- Variables
- func AddInternalPort(ovsClient *libovsdb.OvsdbClient, bridgeName string, portName string, tag uint) error
- func AddPeer(peerIp string) error
- func CreateBridge() (string, error)
- func CreateOVSBridge(ovsClient *libovsdb.OvsdbClient, bridgeName string) (string, error)
- func DeleteBridge() error
- func DeleteNetwork(name string) error
- func DeleteOVSBridge(ovsClient *libovsdb.OvsdbClient, bridgeName, bridgeUuid string) error
- func DeletePeer(peerIp string) error
- func GenerateRandomName(prefix string, size int) (string, error)
- func GetAvailableGwAddress(bridgeIP string) (gwaddr string, err error)
- func GetAvailableSubnet() (subnet *net.IPNet, err error)
- func GetTableCache(tableName string) map[string]libovsdb.Row
- func InitAgent(d *Daemon) error
- func MarkUsed(VNI string, addr net.IP, subnet net.IPNet) bool
- func ReleaseIP(addr net.IP, subnet net.IPNet, VNI string) bool
- func RequestIP(VNI string, subnet net.IPNet) net.IP
- func ServeApi(d *Daemon)
- func UpdateConnectionContext(ovsPort string, key string, context string) error
- func UpdatePortContext(ovsClient *libovsdb.OvsdbClient, portName string, key string, context string) error
- type BridgeConf
- type Connection
- type ConnectionCtx
- type Daemon
- type HttpApiFunc
- type HttpErr
- type Listener
- type Network
- type NodeCtx
- type Notifier
- type OvsConnection
- type SafeMap
Constants ¶
View Source
const CONTEXT_KEY = "container_id"
View Source
const CONTEXT_VALUE = "container_data"
Variables ¶
View Source
var ContextCache map[string]string
Functions ¶
func AddInternalPort ¶
func CreateBridge ¶
func CreateOVSBridge ¶
func CreateOVSBridge(ovsClient *libovsdb.OvsdbClient, bridgeName string) (string, error)
func DeleteBridge ¶
func DeleteBridge() error
func DeleteNetwork ¶
func DeleteOVSBridge ¶
func DeleteOVSBridge(ovsClient *libovsdb.OvsdbClient, bridgeName, bridgeUuid string) error
func DeletePeer ¶
func GenerateRandomName ¶
GenerateRandomName returns a new name joined with a prefix. This size specified is used to truncate the randomly generated value
func GetAvailableGwAddress ¶
func GetAvailableSubnet ¶
func RequestIP ¶
ipStore manage the cluster ip resource key is the vlan/subnet, value is the available ip address bytes Get an IP from the unused subnet and mark it as used
func UpdateConnectionContext ¶
func UpdatePortContext ¶
Types ¶
type BridgeConf ¶
type Connection ¶
type Connection struct {
ContainerID string `json:"containerID"`
ContainerName string `json:"containerName"`
ContainerPID string `json:"containerPID"`
RequestIp string `json:"requestIP,omitempty"`
Network string `json:"network"`
OvsPortID string `json:"ovsPortID"`
BandWidth string `json:"bandWidth,omitempty"`
Delay string `json:"delay,omitempty"`
RXTotal uint64 `json:"rxKbytes"` // in KB
TXTotal uint64 `json:"txKbytes"` // in KB
RXRate float64 `json:"rxRate"` // in Kb/s
TXRate float64 `json:"txRate"` // in Kb/s
ConnectionDetail OvsConnection `json:"ovs_connectionDetails"`
}
type ConnectionCtx ¶
type ConnectionCtx struct {
Action int
Connection *Connection
Result chan *Connection
}
type Daemon ¶
type Daemon struct {
Gateways map[string]struct{} //network set
// contains filtered or unexported fields
}
type HttpApiFunc ¶
type Listener ¶
type Listener struct{}
func (Listener) NotifyKeyUpdate ¶
func (l Listener) NotifyKeyUpdate(nType netAgent.NotifyUpdateType, key string, data []byte)
func (Listener) NotifyNodeUpdate ¶
func (l Listener) NotifyNodeUpdate(nType netAgent.NotifyUpdateType, nodeAddr string)
func (Listener) NotifyStoreUpdate ¶
type Network ¶
type Network struct {
Name string `json:"name"`
Subnet string `json:"subnet"`
Gateway string `json:"gateway"`
VNI uint `json:"vni"`
}
func CreateDefaultNetwork ¶
func GetNetwork ¶
get the network detail of a given name
func GetNetworks ¶
type Notifier ¶
type Notifier struct {
}
func (Notifier) Disconnected ¶
func (n Notifier) Disconnected(ovsClient *libovsdb.OvsdbClient)
func (Notifier) Update ¶
func (n Notifier) Update(context interface{}, tableUpdates libovsdb.TableUpdates)
type OvsConnection ¶
Click to show internal directories.
Click to hide internal directories.