diff options
Diffstat (limited to 'pkg/tcpip/tcpip.go')
-rw-r--r-- | pkg/tcpip/tcpip.go | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/pkg/tcpip/tcpip.go b/pkg/tcpip/tcpip.go index fa73cfa47..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 @@ -1987,14 +1995,3 @@ func DeleteDanglingEndpoint(e Endpoint) { // AsyncLoading is the global barrier for asynchronous endpoint loading // activities. var AsyncLoading sync.WaitGroup - -// ICMPReason is a marker interface for network protocol agnostic ICMP errors. -type ICMPReason interface { - isICMP() -} - -// ICMPReasonPortUnreachable is an error where the transport protocol has no -// listener and no alternative means to inform the sender. -type ICMPReasonPortUnreachable struct{} - -func (*ICMPReasonPortUnreachable) isICMP() {} |