Documentation
¶
Overview ¶
Package priority creates a subordinate-superiors map of identifications. These maps can be flattened into sorted lists for use by the bytematcher and containermatcher engines. Multiple priority lists can be added to priority sets. These contain the priorities of different identifiers within a bytematcher or containermatcher.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Filterable ¶
type Map ¶
a priority map links subordinate results to a list of priority results
func (Map) Apply ¶ added in v1.10.0
Apply checks a list of hits against a priority map and returns a subset of that list for any hits that don't have superiors also in that list
func (Map) Complete ¶
func (m Map) Complete()
After adding all priorities, walk the priority map to make sure that it is consistent, i.e. that for any format with a superior fmt, then anything superior to that superior fmt is also marked as superior to the base fmt, all the way down the tree
func (Map) Difference ¶
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
A priority set holds a number of priority lists
func (*Set) Add ¶
Add a priority list to a set. The length is the number of signatures the priority list applies to, not the length of the priority list. This length will only differ when no priorities are set for a given set of signatures.
type WaitSet ¶
type WaitSet struct { *Set // contains filtered or unexported fields }
A wait set is a mutating structure that holds the set of indexes that should be waited for while matching underway
func (*WaitSet) ApplyFilter ¶
func (w *WaitSet) ApplyFilter(f Filterable)
func (*WaitSet) Check ¶
Check a signature index against the appropriate priority list. Should we continue trying to match this signature?
func (*WaitSet) Filter ¶
Filter a waitset with a list of potential matches, return only those that we are still waiting on. Return nil if none.
func (*WaitSet) MaxOffsets ¶
MaxOffsets returns max/min offset info in order to override the max/min offsets set on the bytematcher when any identifiers have been excluded.
func (*WaitSet) Put ¶
Set the priority list & return a boolean indicating whether the WaitSet is satisfied such that matching can stop (i.e. no priority list is nil, and all are empty)