lib

package module
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Aug 15, 2024 License: Apache-2.0 Imports: 4 Imported by: 2

Documentation

Index

Constants

View Source
const WPCNICSubsystemID = "E810-XXV-4T"

Variables

View Source
var GlobalConfig = configObject{}

Functions

func DifferentNicWrapper

func DifferentNicWrapper(config export.L2Info, if1, if2 int) bool

Algo wrapper for !SameNic

func DifferentNodeWrapper

func DifferentNodeWrapper(config export.L2Info, if1, if2 int) bool

algo wrapper for !SameNode

func GetAllGraphVertices

func GetAllGraphVertices(count int) (l []int)

func IsPTP

func IsPTP(config export.L2Info, aInterface *l2lib.PtpIf) bool

check if an interface is receiving GM

func IsPTPWrapper

func IsPTPWrapper(config export.L2Info, if1 int) bool

Checks that an if an interface receives ptp frames

func NilWrapper

func NilWrapper() bool

wrapper for nil algo function

func PermutationsWithConstraints

func PermutationsWithConstraints(config export.L2Info, algo [][][]int, l []int, s, e, n int, result bool, solutions *[][]int)

Recursive solver function. Creates a set of permutations and applies contraints at each step to reduce the solution graph and speed up execution

func PrintSolution

func PrintSolution(config export.L2Info, p []int)

Print a single solution

func SameLan2

func SameLan2(config export.L2Info, if1, if2 int, lans *[][]int) bool

Checks if 2 interfaces are connected to the same LAN

func SameLan2Wrapper

func SameLan2Wrapper(config export.L2Info, if1, if2 int) bool

wrapper for SameLan2

func SameLan3

func SameLan3(config export.L2Info, if1, if2, if3 int, lans *[][]int) bool

Checks if 3 interfaces are connected to the same LAN

func SameLan3Wrapper

func SameLan3Wrapper(config export.L2Info, if1, if2, if3 int) bool

algo wrapper for SameLan3

func SameNic

func SameNic(ifaceName1, ifaceName2 *l2lib.PtpIf) bool

Determines if 2 interfaces (ports) belong to the same NIC

func SameNicWrapper

func SameNicWrapper(config export.L2Info, if1, if2 int) bool

wrapper for SameNic

func SameNode

func SameNode(if1, if2 *l2lib.PtpIf) bool

Checks if 2 interfaces are on the same node

func SameNodeWrapper

func SameNodeWrapper(config export.L2Info, if1, if2 int) bool

algo Wrapper for SameNode

Types

type AlgoFunction0

type AlgoFunction0 int

list of Algorithm functions with zero params

const (
	// same node
	StepNil AlgoFunction0 = iota
)

See applyStep

type AlgoFunction1

type AlgoFunction1 int

list of Algorithm function with 1 params

const (
	// same node
	StepIsPTP AlgoFunction1 = iota
	StepIsWPCNic
)

See applyStep

type AlgoFunction2

type AlgoFunction2 int

list of Algorithm function with 2 params

const (
	StepSameLan2 AlgoFunction2 = iota
	StepSameNic
	StepSameNode
	StepDifferentNode
	StepDifferentNic
)

See applyStep

type AlgoFunction3

type AlgoFunction3 int

list of Algorithm function with 3 params

const (
	StepSameLan3 AlgoFunction3 = iota
)

See applyStep

type Algorithm

type Algorithm struct {
	// number of interfaces to solve
	IfCount int
	// Function to run algo
	TestSolution ConfigFunc
}

type ConfigFunc

type ConfigFunc func(export.L2Info, []int) bool

type ConfigFunc0

type ConfigFunc0 func() bool

Signature for algorithm functions with 0 params

type ConfigFunc1

type ConfigFunc1 func(export.L2Info, int) bool

Signature for algorithm functions with 1 params

type ConfigFunc2

type ConfigFunc2 func(export.L2Info, int, int) bool

Signature for algorithm functions with 2 params

type ConfigFunc3

type ConfigFunc3 func(export.L2Info, int, int, int) bool

Signature for algorithm functions with 3 params

Jump to

Keyboard shortcuts

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