summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/stack/registration.go
diff options
context:
space:
mode:
authorAndrei Vagin <avagin@google.com>2019-10-30 15:32:20 -0700
committergVisor bot <gvisor-bot@google.com>2019-10-30 15:33:41 -0700
commitdb37483cb6acf55b66132d534bb734f09555b1cf (patch)
treef923c3a814c93906df1d5b18fcc88f509d86c21d /pkg/tcpip/stack/registration.go
parent8bc7b8dba2dcc339ab5bd1b05c83f74a6211a7d0 (diff)
Store endpoints inside multiPortEndpoint in a sorted order
It is required to guarantee the same order of endpoints after save/restore. PiperOrigin-RevId: 277598665
Diffstat (limited to 'pkg/tcpip/stack/registration.go')
-rw-r--r--pkg/tcpip/stack/registration.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/pkg/tcpip/stack/registration.go b/pkg/tcpip/stack/registration.go
index 0360187b8..94015ba54 100644
--- a/pkg/tcpip/stack/registration.go
+++ b/pkg/tcpip/stack/registration.go
@@ -60,6 +60,9 @@ const (
// TransportEndpoint is the interface that needs to be implemented by transport
// protocol (e.g., tcp, udp) endpoints that can handle packets.
type TransportEndpoint interface {
+ // UniqueID returns an unique ID for this transport endpoint.
+ UniqueID() uint64
+
// HandlePacket is called by the stack when new packets arrive to
// this transport endpoint.
HandlePacket(r *Route, id TransportEndpointID, vv buffer.VectorisedView)