Discover Packages
github.com/letitbeat/bpf-parser
package
module
Version:
v0.0.0-...-a8af5a2
Opens a new window with list of versions in this module.
Published: Feb 6, 2019
License: MIT
Opens a new window with license information.
Imports: 4
Opens a new window with list of imports.
Imported by: 1 module, 1 package
The first number is the count of modules that contain a package that imports this one.
The module count is a better indicator of popularity than the package count.
A module with 100 importing packages is counted only once instead of 100 times,
reflecting the fact that the choice to use the package was likely made only once,
not 100 times.
A '?' means that the value hasn't been computed yet.
Opens a new window with list of known importers.
README
README
¶
BPF Parser
A simple BPF parser written in Go using particle library.
Expand ▾
Collapse ▴
Documentation
¶
type Direction struct {
Src bool ` @ "src"`
Dst bool `| @ "dst"`
}
Direction specify a particular transfer direction to and/or from id.
Possible directions are src, dst
Expression consists of one or more Primitives
Qualifiers returns a map containing the qualifiers
of the expression where the key is the qualifier and the
values are the Id's from the primitive
type Filter struct {
Primitives *Expression ` @@ `
}
Filter expressions wrapper
Parse receives a BPF expression and returns an Filter object
from the parsed expression
type Primitive struct {
Qualifiers []*Qualifier `@@ { @@ }`
Id string `(@Mac | @Host | @Number)`
}
Primitive consist of an id (name or number) preceded by one or more qualifiers
type Protocol struct {
TCP bool ` @ "tcp"`
UDP bool `| @ "udp"`
Ether bool `| @ "ether"`
}
Protocol restricts the match to a particular protocol.
Possible protos are: ether, tcp and udp. E.g., 'ether src foo' 'tcp port 21'
Qualifier there are tree types of qualifiers in a BPF
expression type, dir, proto
Compare compares the qualifier value
type Type struct {
Host bool ` @ "host"`
Net bool `| @ "net"`
Port bool `| @ "port"`
}
Type kind of thing the id name or number refers to.
Possible types are host, net , port
Source Files
¶
Click to show internal directories.
Click to hide internal directories.