filter

package
v0.96.1 Latest Latest
Warning

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

Go to latest
Published: Mar 17, 2020 License: BSD-3-Clause Imports: 8 Imported by: 22 modules, 29 packages

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.

Documentation

Index

Constants

View Source
const IPAny = IP(0)
View Source
const LRU_MAX = 512 // max entries in UDP LRU cache

Variables

View Source
var IPPortRangeAny = IPPortRange{IPAny, PortRangeAny}
View Source
var MatchAllowAll = Matches{
	Match{[]IPPortRange{IPPortRangeAny}, []IP{IPAny}},
}
View Source
var NewIP = packet.NewIP
View Source
var PortRangeAny = PortRange{0, 65535}

Functions

This section is empty.

Types

type Filter

type Filter struct {
	// contains filtered or unexported fields
}

func New

func New(matches Matches) *Filter

func NewAllowAll

func NewAllowAll() *Filter

func NewAllowNone

func NewAllowNone() *Filter

func (*Filter) RunIn

func (f *Filter) RunIn(b []byte, q *packet.QDecode, rf RunFlags) Response

func (*Filter) RunOut

func (f *Filter) RunOut(b []byte, q *packet.QDecode, rf RunFlags) Response

type IP

type IP = packet.IP

type IPPortRange

type IPPortRange struct {
	IP    IP
	Ports PortRange
}

func (IPPortRange) String

func (ipr IPPortRange) String() string

type Match

type Match struct {
	DstPorts []IPPortRange
	SrcIPs   []IP
}

func (Match) Clone

func (m Match) Clone() (res Match)

func (Match) String

func (m Match) String() string

type Matches

type Matches []Match

func (Matches) Clone

func (m Matches) Clone() (res Matches)

type PortRange

type PortRange struct {
	First, Last uint16
}

func (PortRange) String

func (pr PortRange) String() string

type Response

type Response int
const (
	Drop Response = iota
	Accept
)

func (Response) String

func (r Response) String() string

type RunFlags

type RunFlags int
const (
	LogDrops RunFlags = 1 << iota
	LogAccepts
	HexdumpDrops
	HexdumpAccepts
)

Jump to

Keyboard shortcuts

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