fabric

package
v0.4.5 Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2020 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var PersistentTrunks = []int{
	2,
}

PersistentTrunks are trunks that never go away

Functions

func GetInfraLeaf

func GetInfraLeaf(topo *xir.Net, node string) (*xir.Node, *xir.Endpoint, error)

GetInfraLeaf finds the infrastructure leaf switch attached to the specified node. If none exists nil is returned.

func GetNodeSwitch added in v0.3.5

func GetNodeSwitch(
	tb *xir.Net, node, ifx string) (*xir.Node, *xir.Endpoint, *xir.Endpoint, error)

GetNodeSwitch finds the switch attached to the specified node. If none exists nil is returned.

func MapFabrics

func MapFabrics(spec cogs.LinkSpec, amap AccessMap, ltmap TrunkMap, topo *xir.Net) (
	TrunkMap, VtepMap, bool, error)

MapFabrics creates trunk and vtep maps from the set of testbed fabric switches.

func MapNodes added in v0.3.5

func MapNodes(spec cogs.LinkSpec, topo *xir.Net) (AccessMap, TrunkMap, error)

MapNodes creates access and turnk maps on switches the specified nodes are directly connected to.

Types

type AccessMap

type AccessMap map[string]map[string]AccessPort

AccessMap is a switch -> port -> access-port mapping

func (AccessMap) Add

func (m AccessMap) Add(leaf *xir.Node, ep *xir.Endpoint, value AccessPort)

Add an access port to a switch on the specified endpoint.

type AccessPort

type AccessPort struct {
	Name string
	Vid  int
}

AccessPort encapsulates access port info

func (AccessPort) Create

func (ap AccessPort) Create() *canopy.Property

Create returns a canopy proerty that creates an access port

func (AccessPort) Destroy

func (ap AccessPort) Destroy() *canopy.Property

Destroy returns a canopy proerty taht destroys an access port

type CanopyOps

type CanopyOps map[string][]*canopy.Property

CanopyOps is a map from a target hosts to a list of canopy properties. This is used for executing many canopy operations over many hosts.

func (CanopyOps) Exec

func (ops CanopyOps) Exec() error

Exec carries out a set of canopy operations over a set of hosts as defined in the underlying operations map.

type LinkPlan

type LinkPlan struct {

	// materialization id
	Mzid string

	// id of the experiment link this plan is being created for
	XlinkID string

	LinkKind cogs.LinkKind

	AccessMap AccessMap
	TrunkMap  TrunkMap
	VtepMap   VtepMap
	// contains filtered or unexported fields
}

LinkPlan defines a deployment plan for a link in terms of the ports and virtual interfaces that must be created to materialize it.

func ListLinkPlans added in v0.2.18

func ListLinkPlans(mzid string) ([]*LinkPlan, error)

ListLinkPlans lists all link plans associated with the given materialization ID.

func NewLinkPlan

func NewLinkPlan(mzid string, spec cogs.LinkSpec, topo *xir.Net) (
	*LinkPlan, error)

NewLinkPlan creates a new link plan

func (LinkPlan) Create

func (lp LinkPlan) Create() CanopyOps

Create returns a canopy operation that creates a link plan

func (*LinkPlan) Delete added in v0.2.13

func (l *LinkPlan) Delete() error

Delete a link plan from the datastore

func (LinkPlan) Destroy

func (lp LinkPlan) Destroy() CanopyOps

Destroy returns a canopy operation that destroys a link plan

func (*LinkPlan) GetVersion

func (l *LinkPlan) GetVersion() int64

GetVersion returns the current datastore version of the object

func (*LinkPlan) Key

func (l *LinkPlan) Key() string

Key returns the datastore key for this object.

func (*LinkPlan) Save added in v0.2.13

func (l *LinkPlan) Save() error

Save a linkplan to the databstore

func (*LinkPlan) SetVersion

func (l *LinkPlan) SetVersion(v int64)

SetVersion sets the current datastore version of the object

func (*LinkPlan) Value

func (l *LinkPlan) Value() interface{}

Value returns this object as an interface{}

type TrunkMap

type TrunkMap map[string]map[string]TrunkPort

TrunkMap is a switch -> port -> trunk-port mapping

func (TrunkMap) Add

func (m TrunkMap) Add(node *xir.Node, ep *xir.Endpoint, value TrunkPort)

Add a trunk port to a switch on the specified endpoint

func (TrunkMap) AddEntry added in v0.2.18

func (m TrunkMap) AddEntry(node, ep string, value TrunkPort)

AddEntry adds a trunk point to a switch at the specified endpoint

type TrunkPort

type TrunkPort struct {
	Name string
	Vids []int
}

TrunkPort encapsulates access port info

func (TrunkPort) Create

func (tp TrunkPort) Create() *canopy.Property

Create returns a canopy property that creates a trunk port

func (TrunkPort) Destroy

func (tp TrunkPort) Destroy() *canopy.Property

Destroy returns a canopy property that destroys a trunk port

type Vtep

type Vtep struct {
	Name     string
	Vid      int
	Vni      int
	Bridge   string
	TunnelIP string
}

Vtep encapsulates vtep info

func (Vtep) Create

func (v Vtep) Create() []*canopy.Property

Create returns a canopy property that creates a VTEP

func (Vtep) Destroy

func (v Vtep) Destroy() []*canopy.Property

Destroy returns a canopy port that destroys a VTEP

type VtepMap

type VtepMap map[string]map[string]Vtep

VtepMap is a fabirc -> interface -> vtep map

func (VtepMap) Add

func (m VtepMap) Add(node *xir.Node, name string, value Vtep)

Add a vtep to a switch with the specified name

type VxlanConfig

type VxlanConfig struct {
	TunnelIP string
	Bridge   string
}

VxlanConfig encapsulates information about a VXLAN configuration

Jump to

Keyboard shortcuts

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