cbnet

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Running is const for the running state
	Running = "running"

	// Suspended is const for the suspended state
	Suspended = "suspended"
)

Variables

View Source
var CBLogger *logrus.Logger

CBLogger represents a logger to show execution processes according to the logging level.

Functions

This section is empty.

Types

type AdminWebConfig

type AdminWebConfig struct {
	Host string `yaml:"host"`
	Port string `yaml:"port"`
}

AdminWebConfig represents the configuration information for a AdminWeb

type CBNetworkConfig

type CBNetworkConfig struct {
	CLADNetID   string `yaml:"cladnet_id"`
	HostID      string `yaml:"host_id"`
	IsEncrypted bool   `yaml:"is_encrypted"`
}

CBNetworkConfig represents the configuration information for a cloud adaptive network

type CLADNetSpecification

type CLADNetSpecification struct {
	ID               string `json:"id"`
	Name             string `json:"name"`
	Ipv4AddressSpace string `json:"ipv4AddressSpace"`
	Description      string `json:"description"`
}

CLADNetSpecification represents the specification of a Cloud Adaptive Network (CLADNet).

type Config

type Config struct {
	ETCD      ETCDConfig      `yaml:"etcd_cluster"`
	AdminWeb  AdminWebConfig  `yaml:"admin_web"`
	CBNetwork CBNetworkConfig `yaml:"cb_network"`
	GRPC      GRPCConfig      `yaml:"grpc"`
}

Config represents the configuration information for cb-network

func LoadConfig

func LoadConfig(path string) (Config, error)

LoadConfig represents a function to read the configuration information from a file

type ETCDConfig

type ETCDConfig struct {
	Endpoints []string `yaml:"endpoints"`
}

ETCDConfig represents the configuration information for a etcd cluster

type GRPCConfig

type GRPCConfig struct {
	ServiceEndpoint string `yaml:"service_endpoint"`
	ServerPort      string `yaml:"server_port"`
	GatewayPort     string `yaml:"gateway_port"`
}

GRPCConfig represnets the configuration information for a gRPC server

type HostNetworkInformation

type HostNetworkInformation struct {
	IsEncrypted         bool     `json:"isEncrypted"`
	PublicIP            string   `json:"publicIPAddress"`
	PrivateIPv4Networks []string `json:"privateIPv4Networks"`
}

HostNetworkInformation represents the network information of VM, such as public IP and private networks

type IP

type IP struct {
	Version     string `json:"Version"`
	IPAddress   string `json:"IP"`
	IPv4Network string `json:"IPv4Network"`
}

IP represents a set of information related to IP address

type InterHostNetworkStatus

type InterHostNetworkStatus struct {
	SourceIP       string  `json:"sourceIP"`
	SourceID       string  `json:"sourceID"`
	DestinationIP  string  `json:"destinationIP"`
	DestinationID  string  `json:"destinationID"`
	MininumRTT     float64 `json:"minimunRTT"`
	AverageRTT     float64 `json:"averageRTT"`
	MaximumRTT     float64 `json:"maximumRTT"`
	StdDevRTT      float64 `json:"stddevRTT"`
	PacketsReceive int     `json:"packetsReceive"`
	PacketsLoss    int     `json:"packetLoss"`
	BytesReceived  int     `json:"bytesReceived"`
}

InterHostNetworkStatus represents the network performance between two virtual machines in a CLADNet.

type NetworkInterface

type NetworkInterface struct {
	Name string `json:"Name"`
	IPs  []IP   `json:"IPs"`
}

NetworkInterface represents a network interface in a system with assigned IPs (Typically IPv4, and IPv6)

type NetworkStatus

type NetworkStatus struct {
	InterHostNetworkStatus []InterHostNetworkStatus `json:"interHostNetworkStatus"`
}

NetworkStatus represents the statistics of a Cloud Adaptive Network (CLADNet).

type NetworkingRule

type NetworkingRule struct {
	CLADNetID       string   `json:"CLADNetID"`
	HostID          []string `json:"hostID"`
	HostIPv4Network []string `json:"hostIPv4Network"`
	HostIPAddress   []string `json:"hostIPAddress"`
	PublicIPAddress []string `json:"publicIPAddress"`
}

NetworkingRule represents a networking rule of the cloud adaptive network. It is used for tunneling between hosts(e.g., VMs).

func (*NetworkingRule) AppendRule

func (netrule *NetworkingRule) AppendRule(ID string, privateIPv4Network string, privateIPv4Address string, publicIPv4Addres string)

AppendRule represents a function to append a rule to the NetworkingRule

func (NetworkingRule) Contain

func (netrule NetworkingRule) Contain(x string) bool

Contain represents a function to check if the host exists or not

func (NetworkingRule) GetIndexOfCBNet

func (netrule NetworkingRule) GetIndexOfCBNet(hostIPv4Network string) int

GetIndexOfCBNet represents a function to find and return an index of HostIPv4Network from NetworkingRule

func (NetworkingRule) GetIndexOfCBNetIP

func (netrule NetworkingRule) GetIndexOfCBNetIP(hostIPAddress string) int

GetIndexOfCBNetIP represents a function to find and return an index of HostIPAddress from NetworkingRule

func (NetworkingRule) GetIndexOfHostID added in v0.0.8

func (netrule NetworkingRule) GetIndexOfHostID(id string) int

GetIndexOfHostID represents a function to find and return an index of HostID from NetworkingRule

func (NetworkingRule) GetIndexOfPublicIP

func (netrule NetworkingRule) GetIndexOfPublicIP(publicIP string) int

GetIndexOfPublicIP represents a function to find and return an index of PublicIPAddress from NetworkingRule

func (*NetworkingRule) UpdateRule

func (netrule *NetworkingRule) UpdateRule(id string, privateIPv4Network string, privateIPv4Address string, publicIPv4Address string)

UpdateRule represents a function to update a rule to the NetworkingRule

type Peer added in v0.0.8

type Peer struct {
	CLADNetID          string `json:"cladNetID"`
	HostID             string `json:"hostID"`
	PrivateIPv4Network string `json:"privateIPv4Network"`
	PrivateIPv4Address string `json:"privateIPv4Address"`
	PublicIPv4Address  string `json:"publicIPv4Address"`
	State              string `json:"state"`
}

Peer represents a host's rule of the cloud adaptive network.

type TestSpecification

type TestSpecification struct {
	CLADNetID  string `json:"CLADNetID"`
	TrialCount int    `json:"trialCount"`
}

TestSpecification represents the specification of a Cloud Adaptive Network (CLADNet).

type WebsocketMessageFrame

type WebsocketMessageFrame struct {
	Type string `json:"type"`
	Text string `json:"text"`
}

WebsocketMessageFrame represents a message struct to communicate web server and client.

Jump to

Keyboard shortcuts

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