cbnet

package
v0.0.16 Latest Latest
Warning

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

Go to latest
Published: Nov 25, 2022 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Index

Constants

View Source
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

View Source
var CBLogger *logrus.Logger

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

Functions

func SelectDestinationByRuleType added in v0.0.14

func SelectDestinationByRuleType(ruleType string, sourcePeer model.Peer, destinationPeer model.Peer) (string, string, error)

SelectDestinationByRuleType represents a function to set a unique host ID

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 New

func New(name string, port string) *CBNetwork

New represents a constructor of CBNetwork

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

func (cbnetwork *CBNetwork) ConfigureCBNetworkInterface() error

ConfigureCBNetworkInterface represents a function to configure a network interface (default: cbnet0) for Cloud Adaptive Network

func (*CBNetwork) ConfigureHostID added in v0.0.11

func (cbnetwork *CBNetwork) ConfigureHostID() error

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

func (cbnetwork *CBNetwork) EnableEncryption(isTrue bool)

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) GetKey

func (cbnetwork CBNetwork) GetKey(hostID string) *rsa.PublicKey

GetKey returns a public key by a host ID

func (*CBNetwork) GetPeer added in v0.0.16

func (cbnetwork *CBNetwork) GetPeer(hostID string) (model.Peer, error)

GetPeer represents a function to find and return a peer in the local map (data structure)

func (CBNetwork) GetPublicKeyBase64

func (cbnetwork CBNetwork) GetPublicKeyBase64() (string, error)

GetPublicKeyBase64 represents a function to get a public key.

func (CBNetwork) IsEncryptionEnabled

func (cbnetwork CBNetwork) IsEncryptionEnabled() bool

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

func (cbnetwork *CBNetwork) StorePeer(peer model.Peer)

StorePeer represents a function to add, synchronize, manage peers in local (memory)

func (CBNetwork) ThisPeerState added in v0.0.16

func (cbnetwork CBNetwork) ThisPeerState() string

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

func (cbnetwork *CBNetwork) UpdateKeyring(hostID string, base64PublicKey string) error

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.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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