diff options
author | gVisor bot <gvisor-bot@google.com> | 2020-09-29 07:23:48 +0000 |
---|---|---|
committer | gVisor bot <gvisor-bot@google.com> | 2020-09-29 07:23:48 +0000 |
commit | ea5cf9131c31e2889ff64233f5f5bfcc6f2c4c39 (patch) | |
tree | a27439ab166dbb68404c3edb9986550fffc3e752 /pkg/tcpip/tcpip.go | |
parent | c56633d8504615721910f62b9fd236ce4a6a8ee7 (diff) | |
parent | 48915bdedb346432327986570f28181d48b68567 (diff) |
Merge release-20200921.0-60-g48915bded (automated)
Diffstat (limited to 'pkg/tcpip/tcpip.go')
-rw-r--r-- | pkg/tcpip/tcpip.go | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go index 464608dee..0d4a803ff 100644 --- a/pkg/tcpip/tcpip.go +++ b/pkg/tcpip/tcpip.go @@ -237,6 +237,14 @@ type Timer interface { // network node. Or, in the case of unix endpoints, it may represent a path. type Address string +// WithPrefix returns the address with a prefix that represents a point subnet. +func (a Address) WithPrefix() AddressWithPrefix { + return AddressWithPrefix{ + Address: a, + PrefixLen: len(a) * 8, + } +} + // AddressMask is a bitmask for an address. type AddressMask string |