Documentation ¶
Index ¶
- Constants
- Variables
- func SelectDestinationByRuleType(ruleType string, sourcePeer model.Peer, destinationPeer model.Peer) (string, string, error)
- type CBNetwork
- func (cbnetwork *CBNetwork) CloseCBNetworkInterface()
- func (cbnetwork *CBNetwork) ConfigureCBNetworkInterface() error
- func (cbnetwork *CBNetwork) ConfigureHostID() error
- func (cbnetwork *CBNetwork) DisableEncryption()
- func (cbnetwork *CBNetwork) EnableEncryption(isTrue bool)
- func (cbnetwork CBNetwork) GetHostNetworkInformation() model.HostNetworkInformation
- func (cbnetwork CBNetwork) GetKey(hostID string) *rsa.PublicKey
- func (cbnetwork *CBNetwork) GetPeer(hostID string) (model.Peer, error)
- func (cbnetwork CBNetwork) GetPublicKeyBase64() (string, error)
- func (cbnetwork CBNetwork) IsEncryptionEnabled() bool
- func (cbnetwork *CBNetwork) Run()
- func (cbnetwork *CBNetwork) StorePeer(peer model.Peer)
- func (cbnetwork CBNetwork) ThisPeerState() string
- func (cbnetwork *CBNetwork) UpdateHostNetworkInformation()
- func (cbnetwork *CBNetwork) UpdateKeyring(hostID string, base64PublicKey string) error
- func (cbnetwork *CBNetwork) UpdateNetworkingRule(networkingRule model.NetworkingRule)
Constants ¶
const ( // BUFFERSIZE represents a size of read buffer. BUFFERSIZE = 1500 // MTU represents a maximum transmission unit. MTU = "1300" // IPv4 represents a version of IP address IPv4 = "IPv4" // IPv6 represents a version of IP address IPv6 = "IPv6" )
I use TUN interface, so only plain IP packet, no ethernet header + mtu is set to 1300
Variables ¶
var CBLogger *logrus.Logger
CBLogger represents a logger to show execution processes according to the logging level.
Functions ¶
Types ¶
type CBNetwork ¶
type CBNetwork struct { // Variables for the cb-network CLADNetID string // ID for a cloud adaptive network NetworkingRule model.NetworkingRule // Networking rule for a network interface and tunneling // Variables for the cb-network agents HostID string // HostID in a cloud adaptive network HostName string // HostName in a cloud adaptive network HostPublicIP string // Inquired public IP of VM/Host ThisPeer model.Peer // Peer object for this host OtherPeers map[string]model.Peer // Peers map for the other hosts Interface *os.File // Assigned cbnet0 IP from the controller // contains filtered or unexported fields }
CBNetwork represents a network for the multi-cloud
func (*CBNetwork) CloseCBNetworkInterface ¶ added in v0.0.11
func (cbnetwork *CBNetwork) CloseCBNetworkInterface()
CloseCBNetworkInterface represents a function to stop the cloud-barista network.
func (*CBNetwork) ConfigureCBNetworkInterface ¶ added in v0.0.11
ConfigureCBNetworkInterface represents a function to configure a network interface (default: cbnet0) for Cloud Adaptive Network
func (*CBNetwork) ConfigureHostID ¶ added in v0.0.11
ConfigureHostID represents a function to set a unique host ID
func (*CBNetwork) DisableEncryption ¶ added in v0.0.12
func (cbnetwork *CBNetwork) DisableEncryption()
DisableEncryption represents a function to set a status for message encryption.
func (*CBNetwork) EnableEncryption ¶
EnableEncryption represents a function to set a status for message encryption.
func (CBNetwork) GetHostNetworkInformation ¶
func (cbnetwork CBNetwork) GetHostNetworkInformation() model.HostNetworkInformation
GetHostNetworkInformation represents a function to get the network information of a VM.
func (*CBNetwork) GetPeer ¶ added in v0.0.16
GetPeer represents a function to find and return a peer in the local map (data structure)
func (CBNetwork) GetPublicKeyBase64 ¶
GetPublicKeyBase64 represents a function to get a public key.
func (CBNetwork) IsEncryptionEnabled ¶
IsEncryptionEnabled represents a function to check if a message is encrypted or not.
func (*CBNetwork) Run ¶
func (cbnetwork *CBNetwork) Run()
Run represents a function to start the cloud-barista network.
func (*CBNetwork) StorePeer ¶ added in v0.0.16
StorePeer represents a function to add, synchronize, manage peers in local (memory)
func (CBNetwork) ThisPeerState ¶ added in v0.0.16
ThisPeerState represents the state of this host (peer)
func (*CBNetwork) UpdateHostNetworkInformation ¶
func (cbnetwork *CBNetwork) UpdateHostNetworkInformation()
UpdateHostNetworkInformation represents a function to update the host network information, such as public IP address of VM and private IPv4 networks.
func (*CBNetwork) UpdateKeyring ¶
UpdateKeyring updates a public key with a host ID
func (*CBNetwork) UpdateNetworkingRule ¶ added in v0.0.14
func (cbnetwork *CBNetwork) UpdateNetworkingRule(networkingRule model.NetworkingRule)
UpdateNetworkingRule represents a function to update networking rule.