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 ¶
- type Filterable
- type List
- type Map
- type Set
- type WaitSet
- func (w *WaitSet) ApplyFilter(f Filterable)
- func (w *WaitSet) Check(i int) bool
- func (w *WaitSet) Filter(l []int) []int
- func (w *WaitSet) MaxOffsets() (int, int)
- func (w *WaitSet) Put(i int) bool
- func (w *WaitSet) PutAt(i int, bof, eof int64) bool
- func (w *WaitSet) WaitingOn() []int
- func (w *WaitSet) WaitingOnAt(bof, eof int64) []int
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) 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
type Set ¶
type Set struct {
// contains filtered or unexported fields
}
A priority set holds a number of priority lists Todo: add a slice of max BOF/ EOF offsets (so that signature sets without priorities but with bof limits/eof limits won't cause lengthy scans)
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. Todo: add maxOffsets here
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 ¶
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)
func (*WaitSet) PutAt ¶
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)
func (*WaitSet) WaitingOn ¶
For periodic checking - what signatures are we currently waiting on? Accumulates values from all the priority lists within the set. Returns nil if *any* of the priority lists is nil.
func (*WaitSet) WaitingOnAt ¶
For periodic checking - what signatures are we currently waiting on, at the given offsets? Accumulates values from all the priority lists within the set. Returns nil if *any* of the priority lists is nil.