Documentation
¶
Overview ¶
Package bytematcher builds a matching engine from a set of signatures and performs concurrent matching against an input siegreader.Buffer.
Index ¶
- func Add(c core.Matcher, ss core.SignatureSet, priorities priority.List) (core.Matcher, int, error)
- func Load(ls *persist.LoadSaver) core.Matcher
- func Save(c core.Matcher, ls *persist.LoadSaver)
- type Matcher
- func (b *Matcher) DescribeKeyFrames(i int) []string
- func (b *Matcher) DescribeTestTree(i int) ([]int, []int, int, int, int, int)
- func (b *Matcher) Identify(name string, sb *siegreader.Buffer, hints ...core.Hint) (chan core.Result, error)
- func (b *Matcher) InspectTestTree(i int) []int
- func (b *Matcher) KeyFramesLen() int
- func (b *Matcher) String() string
- func (b *Matcher) TestTreeLen() int
- type SignatureSet
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Matcher ¶
type Matcher struct {
// contains filtered or unexported fields
}
Matcher matches byte signatures against the siegreader.Buffer.
func (*Matcher) DescribeKeyFrames ¶ added in v1.7.9
func (*Matcher) DescribeTestTree ¶ added in v1.7.9
func (*Matcher) Identify ¶
func (b *Matcher) Identify(name string, sb *siegreader.Buffer, hints ...core.Hint) (chan core.Result, error)
Identify matches a Matcher's signatures against the input siegreader.Buffer. Results are passed on the returned channel.
Example:
ret := bm.Identify("", buf) for v := range ret { if v.Index() == 0 { fmt.Print("Success! It is signature 0!") } }
func (*Matcher) InspectTestTree ¶
InspectTestTree reports which signatures are linked to a given index in the test tree. This is used by the -log debug and -log slow options for sf.
func (*Matcher) KeyFramesLen ¶ added in v1.7.9
func (*Matcher) String ¶
String returns information about the Bytematcher including the number of BOF, VAR and EOF sequences, the number of BOF and EOF frames, and the total number of tests.
func (*Matcher) TestTreeLen ¶ added in v1.7.9
type SignatureSet ¶
SignatureSet for a bytematcher is a slice of frames.Signature.
Source Files
¶
Directories
¶
Path | Synopsis |
---|---|
Package frames describes the Frame interface.
|
Package frames describes the Frame interface. |
tests
Package tests exports shared frames and signatures for use by the other bytematcher packages
|
Package tests exports shared frames and signatures for use by the other bytematcher packages |
Package patterns describes the Pattern interface.
|
Package patterns describes the Pattern interface. |
tests
Package tests exports shared patterns for use by the other bytematcher packages
|
Package tests exports shared patterns for use by the other bytematcher packages |