Documentation
¶
Overview ¶
Package filter is the packet filter every agent applies to traffic that arrives from the mesh. The coordinator compiles the access-control policy into Rules for each node; the filter admits inbound packets a rule allows plus replies to connections the node opened itself.
Index ¶
Constants ¶
View Source
const ( ProtoICMP uint8 = 1 ProtoTCP uint8 = 6 ProtoUDP uint8 = 17 )
IP protocol numbers used in rules.
Variables ¶
View Source
var AllPorts = PortRange{0, 65535}
AllPorts matches every port.
Functions ¶
Types ¶
type Filter ¶
type Filter struct {
// PingPort is a UDP port that is treated like ICMP echo: open to every
// peer a rule lets reach this node on any port.
PingPort uint16
// contains filtered or unexported fields
}
Filter is a stateful packet filter. It is safe for concurrent use.
func New ¶
func New() *Filter
New returns a filter that drops every inbound packet until SetRules is called.
func (*Filter) Inbound ¶
Inbound reports whether a packet that arrived from the mesh may be delivered.
type PortRange ¶
type PortRange struct {
First, Last uint16
}
PortRange is an inclusive range of ports; {0, 65535} is every port.
Click to show internal directories.
Click to hide internal directories.