Documentation
¶
Index ¶
- Constants
- Variables
- type NetworkEmulationBackend
- type PeeringBackend
- type Virt
- func (v *Virt) BlockLink(source orchestrator.MachineID, target orchestrator.MachineID) error
- func (v *Virt) GetIPAddress(id orchestrator.MachineID) (net.IPNet, error)
- func (v *Virt) RegisterMachine(id orchestrator.MachineID, name string, host orchestrator.Host, ...) error
- func (v *Virt) ResolveIPAddress(ip net.IP) (orchestrator.MachineID, error)
- func (v *Virt) SetBandwidth(source orchestrator.MachineID, target orchestrator.MachineID, bandwidth uint64) error
- func (v *Virt) SetLatency(source orchestrator.MachineID, target orchestrator.MachineID, latency uint32) error
- func (v *Virt) StartMachine(machine orchestrator.MachineID) error
- func (v *Virt) Stop() error
- func (v *Virt) StopMachine(machine orchestrator.MachineID) error
- func (v *Virt) UnblockLink(source orchestrator.MachineID, target orchestrator.MachineID) error
Constants ¶
const ( REGISTERED state = iota STARTED STOPPED KILLED )
const GUESTINTERFACE = "eth0"
const HOST_INTERFACE = "ens4"
const OUTPUTPATH = "/celestial/out"
const ROOTPATH = "/celestial"
Variables ¶
Functions ¶
This section is empty.
Types ¶
type NetworkEmulationBackend ¶
type NetworkEmulationBackend interface { Register(id orchestrator.MachineID, tap string) error SetBandwidth(source orchestrator.MachineID, target net.IPNet, bandwidth uint64) error SetLatency(source orchestrator.MachineID, target net.IPNet, latency uint32) error UnblockLink(source orchestrator.MachineID, target net.IPNet) error BlockLink(source orchestrator.MachineID, target net.IPNet) error Stop() error }
NetworkEmulationBackend is the interface for the network emulation backend.
type PeeringBackend ¶
type PeeringBackend interface { GetHostID() (uint8, error) Route(network net.IPNet, host orchestrator.Host) error Stop() error }
PeeringBackend is the interface for the peering backend.
type Virt ¶
Virt provides virtualization functionality using firecracker.
func New ¶
func New(hostInterface string, initDelay uint64, pb PeeringBackend, neb NetworkEmulationBackend) (*Virt, error)
New creates a new virt backend.
func (*Virt) BlockLink ¶
func (v *Virt) BlockLink(source orchestrator.MachineID, target orchestrator.MachineID) error
BlockLink blocks the link between two machines using the network emulation backend.
func (*Virt) GetIPAddress ¶
func (*Virt) RegisterMachine ¶
func (v *Virt) RegisterMachine(id orchestrator.MachineID, name string, host orchestrator.Host, config orchestrator.MachineConfig) error
RegisterMachine registers a machine with the virt backend. If the machine is on a remote host, it will be routed there.
func (*Virt) ResolveIPAddress ¶
func (*Virt) SetBandwidth ¶
func (v *Virt) SetBandwidth(source orchestrator.MachineID, target orchestrator.MachineID, bandwidth uint64) error
SetBandwidth sets the bandwidth between two machines using the network emulation backend.
func (*Virt) SetLatency ¶
func (v *Virt) SetLatency(source orchestrator.MachineID, target orchestrator.MachineID, latency uint32) error
SetLatency sets the latency between two machines using the network emulation backend.
func (*Virt) StartMachine ¶
func (v *Virt) StartMachine(machine orchestrator.MachineID) error
func (*Virt) StopMachine ¶
func (v *Virt) StopMachine(machine orchestrator.MachineID) error
func (*Virt) UnblockLink ¶
func (v *Virt) UnblockLink(source orchestrator.MachineID, target orchestrator.MachineID) error
UnblockLink unblocks the link between two machines using the network emulation backend.