tb

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 24, 2019 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HasAllocMode

func HasAllocMode(x *xir.Node, allocModes ...AllocMode) bool

func HasRole

func HasRole(x *xir.Node, roles ...Role) bool

func ToXir

func ToXir(t Testbed) *xir.Net

Types

type AllocMode

type AllocMode uint16
const (
	AllocUnspec AllocMode = iota
	NoAlloc
	NetAlloc
	NetEmuAlloc
	FilesystemAlloc
	BlockDeviceAlloc
	PhysicalAlloc
	VirtualAlloc
)

type BasicInterfaceConfig

type BasicInterfaceConfig struct {
	Ip InterfaceIPConfig
}

type InterfaceIPConfig

type InterfaceIPConfig struct {
	Addrs []string
	Mtu   int
}

type MzLinkInfo

type MzLinkInfo struct {
	LinkId int
}

type Resource

type Resource struct {
	Alloc     []AllocMode
	Roles     []Role
	Props     xir.Props
	LinkRoles map[string]Role //system.link.name -> role
	System    *sys.System     `json:"-"`
}

func GetResourceSpec

func GetResourceSpec(x *xir.Node) *Resource

func (*Resource) HasAllocMode

func (r *Resource) HasAllocMode(modes ...AllocMode) bool

func (*Resource) HasRole

func (r *Resource) HasRole(roles ...Role) bool

func (*Resource) Node

func (r *Resource) Node() *xir.Node

type Role

type Role uint16

Roles indicate the usage model of a resource in a testbed. A resource may have multiple roles. Roles have an unsigned 16 bit integer identifier. Roles 0-1024 are reserved. The values in the reserved range are defined here.

const (
	RoleUnspec Role = iota
	Node
	InfraServer
	ConsoleServer
	PowerController
	NetworkEmulator
	XpSwitch
	InfraSwitch
	MgmtSwitch
	Gateway

	Leaf
	Fabric
	Spine

	InfraLink
	XpLink

	Tor
)

type Testbed

type Testbed interface {
	Components() ([]*Resource, []*hw.Cable)
}

Jump to

Keyboard shortcuts

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