brintsubrole

package
Version: v0.0.0-...-9649b88 Latest Latest
Warning

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

Go to latest
Published: Sep 16, 2020 License: Apache-2.0 Imports: 26 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VethGwBrint   = "vethGWbrint"
	VethGwHost    = "vethGWhost"
	DefaultTenant = "admin"
)
View Source
const (
	DefaultGWFakePodNs   = "DefaultGWFakePodNs"
	DefaultGWFakePodName = "DefaultGWFakePodName"
)
View Source
const (
	DefaultVethOpsRetryTimes  = 5
	DefaultVethOpsRetryIntval = 30
)

Variables

This section is empty.

Functions

func ActivateVethPair

func ActivateVethPair(veth ovs.VethPair) error

func AddPort2Ovs

func AddPort2Ovs(bridge, port string, properties ...string) error

func ConfigDefaultGwObj

func ConfigDefaultGwObj(defaultNetName string) error

func CreateDefaultGw

func CreateDefaultGw(port *manager.Port) error

func CreateDefaultGwPort

func CreateDefaultGwPort(defaultNetName string) (*manager.Port, error)

func CreatePort4Gw

func CreatePort4Gw(defaultNetName, vethName string) (*manager.Port, error)

func DeleteGwIaasPort4Etcd

func DeleteGwIaasPort4Etcd() error

func GetDefaultNetName

func GetDefaultNetName(cfg *jason.Object) string

func GetDefaultNetworkID

func GetDefaultNetworkID(networkName string) (string, error)

func GetGwPortFromEtcd

func GetGwPortFromEtcd(defaultNetName string) (*manager.Port, error)

func GetNetworkID

func GetNetworkID(userName, networkName string) (string, error)

func GetVniByNetworkID

func GetVniByNetworkID(networkID string) (int, error)

func InitDefaultGw

func InitDefaultGw(defaultNetName string) error

func OvsVsctl

func OvsVsctl(args ...string) error

func RetryInitDefaultGw

func RetryInitDefaultGw(defaultNetName string) error

func SetPort4Gw

func SetPort4Gw(vethName string, port *manager.Port) error

func SetSnatRule

func SetSnatRule(cidr string, srcIP string) error

func StoreGwIaasPort2Etcd

func StoreGwIaasPort2Etcd(mport *manager.Port) error

Types

type Gateway

type Gateway struct {
	NetworkID string `json:"network_id"`
	Network   string `json:"network"`
	Vni       int    `json:"vni"`
	VlanID    string `json:"vlan_id"`
	IP        string `json:"ip"`
	Mac       string `json:"mac"`
	Mask      string `json:"mask"`
}

func GetDefaultGwSingleton

func GetDefaultGwSingleton() *Gateway

type PortRole

type PortRole struct {
}

func (PortRole) AttachPort

func (this PortRole) AttachPort(vethNameOfBridge, vlanID string) error

func (PortRole) DelPort

func (this PortRole) DelPort(portID, tenantID string, vethPair *ovs.VethPair, mgr *manager.ManagerClient)

func (PortRole) DetachPort

func (this PortRole) DetachPort(vethNameOfBridge string) error

type TenantNetworkTableRole

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

func GetTenantNetworkTableSingleton

func GetTenantNetworkTableSingleton() *TenantNetworkTableRole

func (*TenantNetworkTableRole) DecRefCount

func (this *TenantNetworkTableRole) DecRefCount(networkID, podNs, podName string) error

func (*TenantNetworkTableRole) Delete

func (this *TenantNetworkTableRole) Delete(netID string) error

func (*TenantNetworkTableRole) Get

func (this *TenantNetworkTableRole) Get(networkID string) (*TenantNetworkValue, error)

func (*TenantNetworkTableRole) GetAll

func (*TenantNetworkTableRole) IncRefCount

func (this *TenantNetworkTableRole) IncRefCount(networkID, podNs, podName string) error

func (*TenantNetworkTableRole) Insert

func (this *TenantNetworkTableRole) Insert(networkID string, vni int, vlanID string) error

func (*TenantNetworkTableRole) Load

func (this *TenantNetworkTableRole) Load() error

func (*TenantNetworkTableRole) NeedDelete

func (this *TenantNetworkTableRole) NeedDelete(networkID string) bool

type TenantNetworkValue

type TenantNetworkValue struct {
	Vni    int             `json:"vni"`
	VlanID string          `json:"vlan_id"`
	PodIds alg.StringSlice `json:"pod_ids"`
}

Jump to

Keyboard shortcuts

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