Documentation ¶
Overview ¶
Package filter contains a stateful packet filter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var MatchAllowAll = Matches{ Match{[]NetPortRange{NetPortRangeAny}, []Net{NetAny}}, }
MatchAllowAll matches all packets.
View Source
var NetAny = Net{0, 0}
View Source
var NetPortRangeAny = NetPortRange{NetAny, PortRangeAny}
View Source
var PortRangeAny = PortRange{0, 65535}
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
// contains filtered or unexported fields
}
Filter is a stateful packet filter.
func New ¶
New creates a new packet filter. The filter enforces that incoming packets must be destined to an IP in localNets, and must be allowed by matches. If shareStateWith is non-nil, the returned filter shares state with the previous one, to enable rules to be changed at runtime without breaking existing flows.
func NewAllowAll ¶
NewAllowAll returns a packet filter that accepts everything to and from localNets.
func NewAllowNone ¶
NewAllowNone returns a packet filter that rejects everything.
type Match ¶
type Match struct { Dsts []NetPortRange Srcs []Net }
type NetPortRange ¶ added in v0.98.1
func (NetPortRange) String ¶ added in v0.98.1
func (ipr NetPortRange) String() string
Click to show internal directories.
Click to hide internal directories.