Documentation ¶
Overview ¶
Package filter contains a stateful packet filter.
Index ¶
Constants ¶
View Source
const IPAny = IP(0)
Variables ¶
View Source
var IPPortRangeAny = IPPortRange{IPAny, PortRangeAny}
View Source
var MatchAllowAll = Matches{ Match{[]IPPortRange{IPPortRangeAny}, []IP{IPAny}}, }
MatchAllowAll matches all packets.
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
}
Filter is a stateful packet filter.
func New ¶
New creates a new packet Filter with the given Matches rules. 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 ¶
func NewAllowAll() *Filter
NewAllowAll returns a packet filter that accepts everything.
func NewAllowNone ¶
func NewAllowNone() *Filter
NewAllowNone returns a packet filter that rejects everything.
type IPPortRange ¶
func (IPPortRange) String ¶
func (ipr IPPortRange) String() string
type Match ¶
type Match struct { DstPorts []IPPortRange SrcIPs []IP }
Click to show internal directories.
Click to hide internal directories.