callmapper

package
v0.0.0-...-2c9b28d Latest Latest
Warning

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

Go to latest
Published: Sep 23, 2024 License: MPL-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var LimiterModes = map[string]LimiterMode{
	"none":        None,
	"normal":      Normal,
	"high":        High,
	"strict":      Strict,
	"very-strict": VeryStrict,
}
View Source
var SearchAlgs = map[string]SearchAlgorithm{
	"bfs": Bfs,
	"dfs": Dfs,
}

Functions

This section is empty.

Types

type BFSNode

type BFSNode struct {
	Node *callgraph.Node
	Path []wallynode.WallyNode
}

TODO: this should be path of the callpath structs in match pkg

type CallMapper

type CallMapper struct {
	Options        Options
	Match          *match.RouteMatch
	Stop           bool
	CallgraphNodes map[*ssa.Function]*callgraph.Node
	NodeFactory    *wallynode.WallyNodeFactory
}

func NewCallMapper

func NewCallMapper(match *match.RouteMatch, nodes map[*ssa.Function]*callgraph.Node, options Options) *CallMapper

func (*CallMapper) AllPathsBFS

func (cm *CallMapper) AllPathsBFS(s *callgraph.Node) *match.CallPaths

func (*CallMapper) AllPathsDFS

func (cm *CallMapper) AllPathsDFS(s *callgraph.Node) *match.CallPaths

func (*CallMapper) BFS

func (cm *CallMapper) BFS(start *callgraph.Node, initialPath []wallynode.WallyNode, paths *match.CallPaths)

func (*CallMapper) DFS

func (cm *CallMapper) DFS(destination *callgraph.Node, visited map[int]bool, path []wallynode.WallyNode, paths *match.CallPaths, site ssa.CallInstruction)

type LimiterMode

type LimiterMode int
const (
	None LimiterMode = iota
	Normal
	High
	Strict
	VeryStrict
)

None = allows analysis to run pass main Normal = filters up to the main function if possible unless. It also filters up to main pkg *unless* the last function before going outside of main is a closure Strict = Does not allow going past the main package

type Options

type Options struct {
	Filter       string
	MaxFuncs     int
	MaxPaths     int
	PrintNodes   bool
	SearchAlg    SearchAlgorithm
	Limiter      LimiterMode
	SkipClosures bool
	ModuleOnly   bool
	Simplify     bool
}

type SearchAlgorithm

type SearchAlgorithm int
const (
	Bfs SearchAlgorithm = iota
	Dfs
)

Jump to

Keyboard shortcuts

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