wgengine/filter: add and clean up documentation.

Signed-off-by: David Anderson <danderson@tailscale.com>
This commit is contained in:
David Anderson
2020-11-09 21:22:36 -08:00
committed by Dave Anderson
parent a8589636a8
commit b950bd60bf
3 changed files with 131 additions and 114 deletions

View File

@@ -29,6 +29,7 @@ func (pr PortRange) String() string {
}
}
// contains returns whether port is in pr.
func (pr PortRange) contains(port uint16) bool {
return port >= pr.First && port <= pr.Last
}
@@ -47,6 +48,7 @@ func (npr NetPortRange) String() string {
return fmt.Sprintf("%v:%v", npr.Net, npr.Ports)
}
// NetPortRangeAny matches any IP and port.
var NetPortRangeAny = []NetPortRange{{Net: NetAny[0], Ports: PortRangeAny}}
// Match matches packets from any IP address in Srcs to any ip:port in