diff options
author | Rahat Mahmood <rahat@google.com> | 2019-06-06 15:03:44 -0700 |
---|---|---|
committer | Shentubot <shentubot@google.com> | 2019-06-06 15:04:47 -0700 |
commit | 2d2831e3541c8ae3c84f17cfd1bf0a26f2027044 (patch) | |
tree | 73511b008d7be602ba39947c17bdf71ced981778 /pkg/sentry/socket/socket.go | |
parent | bf0b1b9d767736e632fa56b90d904fee968d8d3d (diff) |
Track and export socket state.
This is necessary for implementing network diagnostic interfaces like
/proc/net/{tcp,udp,unix} and sock_diag(7).
For pass-through endpoints such as hostinet, we obtain the socket
state from the backend. For netstack, we add explicit tracking of TCP
states.
PiperOrigin-RevId: 251934850
Diffstat (limited to 'pkg/sentry/socket/socket.go')
-rw-r--r-- | pkg/sentry/socket/socket.go | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/pkg/sentry/socket/socket.go b/pkg/sentry/socket/socket.go index 9393acd28..a99423365 100644 --- a/pkg/sentry/socket/socket.go +++ b/pkg/sentry/socket/socket.go @@ -116,6 +116,10 @@ type Socket interface { // SendTimeout gets the current timeout (in ns) for send operations. Zero // means no timeout, and negative means DONTWAIT. SendTimeout() int64 + + // State returns the current state of the socket, as represented by Linux in + // procfs. The returned state value is protocol-specific. + State() uint32 } // Provider is the interface implemented by providers of sockets for specific |