spathmeta

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Sep 24, 2018 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Overview

Package spathmeta implements basic types for working with SCIOND paths.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AppPath

type AppPath struct {
	Entry *sciond.PathReplyEntry
}

AppPath contains a SCIOND path entry.

func (*AppPath) Copy

func (ap *AppPath) Copy() *AppPath

func (*AppPath) Key

func (ap *AppPath) Key() PathKey

Key returns a unique PathKey that can be used for map indexing.

type AppPathSet

type AppPathSet map[PathKey]*AppPath

AppPathSet represents a set of SCIOND path entries, keyed by AppPath.Key().

func NewAppPathSet

func NewAppPathSet(reply *sciond.PathReply) AppPathSet

NewAppPathSet creates a new set of paths from a SCIOND path reply.

func (AppPathSet) Add

func (aps AppPathSet) Add(entry *sciond.PathReplyEntry) *AppPath

Add converts the SCIOND path entry to an AppPath and adds it to the set.

func (AppPathSet) Copy

func (aps AppPathSet) Copy() AppPathSet

func (AppPathSet) GetAppPath

func (aps AppPathSet) GetAppPath(pref PathKey) *AppPath

GetAppPath returns an AppPath from the set. It first tries to find a path with key pref; if one cannot be found, an arbitrary one is returned.

func (AppPathSet) String

func (aps AppPathSet) String() string

type PathKey

type PathKey string

Helper type for pretty printing of maps using paths as keys.

func (PathKey) String

func (pk PathKey) String() string

type PathPredicate

type PathPredicate struct {
	Match []sciond.PathInterface
}

A PathPredicate specifies which sequence of ASes and interfaces the packet must travel through; gaps in the matching are allowed. Wildcard ISDs, ASes and IFIDs are specified with 0. For example, a path filtering predicate that only allows paths which pass through ISD1 can be created with:

pp, err = NewPathPredicate("1-0#0")

To allow paths passing through ISD-AS 1-ff00:0:310 interface 27 and then ISD-AS 1-ff00:0:320 interface 95:

pp, err = NewPathPredicate("1-ff00:0:310#27,1-ff00:0:320#95")

func NewPathPredicate

func NewPathPredicate(expr string) (*PathPredicate, error)

func (*PathPredicate) Eval

func (pp *PathPredicate) Eval(path *sciond.PathReplyEntry) bool

func (*PathPredicate) MarshalJSON

func (pp *PathPredicate) MarshalJSON() ([]byte, error)

func (*PathPredicate) String

func (pp *PathPredicate) String() string

func (*PathPredicate) UnmarshalJSON

func (pp *PathPredicate) UnmarshalJSON(b []byte) error

Jump to

Keyboard shortcuts

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