fabric

package
v0.8.16 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2021 License: Apache-2.0 Imports: 13 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 BreakoutName added in v0.7.5

func BreakoutName(x *xir.Endpoint) (string, bool)

func GetFabric added in v0.7.5

func GetFabric(leaf *xir.Node) (*xir.Node, *xir.Endpoint, *xir.Endpoint, error)

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 GetInfraSwitch added in v0.7.5

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

func GetNodeSwitch

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 LinkName added in v0.7.5

func LinkName(x *xir.Endpoint) string

returns the name of the link, if the link is a part of a bond, returns the name of the bond

func MapFabrics

func MapFabrics(link *task.LinkInfo, amap AccessMap, ltmap TrunkMap,
	vvmap VlanVxlanMap, topo *xir.Net, mtu int) (
	TrunkMap, VtepMap, []EvpnAdvertisement, error)

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

func MapNodes

func MapNodes(link *task.LinkInfo, topo *xir.Net,
) (AccessMap, TrunkMap, VlanVxlanMap, 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.

func (AccessMap) AddEntry

func (m AccessMap) AddEntry(node, name string, value *AccessPort)

type AccessPort

type AccessPort struct {
	Name string
	Vid  int
	XpID string
}

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.

func (CanopyOps) ExecFor added in v0.8.8

func (ops CanopyOps) ExecFor(target string) error

type EvpnAdvertisement

type EvpnAdvertisement struct {
	RouterAPI  string
	RouterHost string
	Addr       string
	ASN        int
	VNI        int
	XpID       string
}

type HostAccessPort

type HostAccessPort struct {
	Host string
	AccessPort
}

type HostTrunkPort

type HostTrunkPort struct {
	Host string
	TrunkPort
}

type HostVtep

type HostVtep struct {
	Host string
	Vtep
}

type LinkPlan

type LinkPlan struct {

	// materialization id
	Mzid string

	Role LinkPlanRole

	LinkKind task.LinkKind

	MTU int

	AccessMap AccessMap
	TrunkMap  TrunkMap
	VtepMap   VtepMap

	VVMap VlanVxlanMap

	EvpnAdvertisements []EvpnAdvertisement

	Topo *xir.Net `json:"-"`
	// 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 FetchLinkPlan added in v0.7.5

func FetchLinkPlan(mzid string, role LinkPlanRole) (*LinkPlan, error)

func ListLinkPlans

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

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

func NewLinkPlan

func NewLinkPlan(mzid string, topo *xir.Net, role LinkPlanRole, mtu int,
	links ...*task.LinkInfo) (
	*LinkPlan, error)

NewLinkPlan creates a new link plan

func (lp *LinkPlan) AddLink(link *task.LinkInfo) error

func (LinkPlan) Advertise

func (lp LinkPlan) Advertise() error

func (LinkPlan) Create

func (lp LinkPlan) Create() CanopyOps

Create returns a canopy operation that creates a link plan

func (*LinkPlan) Delete

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

func (l LinkPlan) LookupTable() LinkPlanLookup

func (*LinkPlan) Save

func (l *LinkPlan) Save() error

Save a linkplan to the datastore

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{}

func (LinkPlan) Withdraw

func (lp LinkPlan) Withdraw() error

type LinkPlanLookup

type LinkPlanLookup struct {
	Access         map[string][]HostAccessPort
	Trunk          map[string][]HostTrunkPort
	Vtep           map[string][]HostVtep
	Advertisements map[string][]EvpnAdvertisement
}

func NewLinkPlanLookup

func NewLinkPlanLookup() LinkPlanLookup

type LinkPlanRole

type LinkPlanRole int
const (
	InfraLP LinkPlanRole = iota
	ExperimentLP
)

func (LinkPlanRole) String

func (r LinkPlanRole) String() string

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

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
	XpIDs []string
}

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 VlanVxlanMap

type VlanVxlanMap map[int]int

VlanVxlanMap maps VLAN Vids onto VXLAN Vnis

type Vtep

type Vtep struct {
	Name          string
	Vid           int
	Vni           int
	Bridge        string
	TunnelIP      string
	DirectConnect bool
	XpID          string
	Mtu           int
	Device        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, name string, value *Vtep)

Add a vtep to a switch with the specified name

type VxlanConfig

type VxlanConfig struct {
	TunnelIP string
	Bridge   string
	ASN      int
}

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