Documentation ¶
Overview ¶
Package filter contains a stateful packet filter.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var MatchAllowAll = Matches{ Match{[]NetPortRange{NetPortRangeAny}, []Net{NetAny}}, }
MatchAllowAll matches all packets.
var NetAny = Net{0, 0}
var NetPortRangeAny = NetPortRange{NetAny, PortRangeAny}
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 Matches ¶
type Matches []Match
func MatchesFromFilterRules ¶ added in v1.2.0
func MatchesFromFilterRules(pf []tailcfg.FilterRule) (Matches, error)
MatchesFromFilterRules parse a number of wire-format FilterRule values into the Matches format. If an error is returned, the Matches result is still valid, containing the rules that were successfully converted.
type NetPortRange ¶ added in v0.98.1
func (NetPortRange) String ¶ added in v0.98.1
func (ipr NetPortRange) String() string