summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/registration.go
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-10-29 18:38:23 +0000
committergVisor bot <gvisor-bot@google.com>2019-10-29 18:38:23 +0000
commit2fa80a171608bb5172edb2d9dbbd17df47839aae (patch)
treeca5e77431f28cbfb3765d3a053d72d728a859711 /pkg/tcpip/stack/registration.go
parent862aefb66429be48e5910f72c8e1bc3b6b78e6f4 (diff)
parent7d80e85835fbe47b2395eedf287cf902ed78599a (diff)
Merge release-20190806.1-337-g7d80e85 (automated)
Diffstat (limited to 'pkg/tcpip/stack/registration.go')
-rw-r--r--pkg/tcpip/stack/registration.go14
1 files changed, 14 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/registration.go b/pkg/tcpip/stack/registration.go
index 0869fb084..0360187b8 100644
--- a/pkg/tcpip/stack/registration.go
+++ b/pkg/tcpip/stack/registration.go
@@ -67,6 +67,20 @@ type TransportEndpoint interface {
// HandleControlPacket is called by the stack when new control (e.g.,
// ICMP) packets arrive to this transport endpoint.
HandleControlPacket(id TransportEndpointID, typ ControlType, extra uint32, vv buffer.VectorisedView)
+
+ // Close puts the endpoint in a closed state and frees all resources
+ // associated with it. This cleanup may happen asynchronously. Wait can
+ // be used to block on this asynchronous cleanup.
+ Close()
+
+ // Wait waits for any worker goroutines owned by the endpoint to stop.
+ //
+ // An endpoint can be requested to stop its worker goroutines by calling
+ // its Close method.
+ //
+ // Wait will not block if the endpoint hasn't started any goroutines
+ // yet, even if it might later.
+ Wait()
}
// RawTransportEndpoint is the interface that needs to be implemented by raw