summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/netstack
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/socket/netstack')
-rw-r--r--pkg/sentry/socket/netstack/BUILD58
-rw-r--r--pkg/sentry/socket/netstack/netstack_state_autogen.go119
2 files changed, 119 insertions, 58 deletions
diff --git a/pkg/sentry/socket/netstack/BUILD b/pkg/sentry/socket/netstack/BUILD
deleted file mode 100644
index 1fb777a6c..000000000
--- a/pkg/sentry/socket/netstack/BUILD
+++ /dev/null
@@ -1,58 +0,0 @@
-load("//tools:defs.bzl", "go_library")
-
-package(licenses = ["notice"])
-
-go_library(
- name = "netstack",
- srcs = [
- "device.go",
- "netstack.go",
- "netstack_vfs2.go",
- "provider.go",
- "provider_vfs2.go",
- "save_restore.go",
- "stack.go",
- ],
- visibility = [
- "//pkg/sentry:internal",
- ],
- deps = [
- "//pkg/abi/linux",
- "//pkg/amutex",
- "//pkg/binary",
- "//pkg/context",
- "//pkg/log",
- "//pkg/metric",
- "//pkg/safemem",
- "//pkg/sentry/arch",
- "//pkg/sentry/device",
- "//pkg/sentry/fs",
- "//pkg/sentry/fs/fsutil",
- "//pkg/sentry/fs/lock",
- "//pkg/sentry/fsimpl/sockfs",
- "//pkg/sentry/inet",
- "//pkg/sentry/kernel",
- "//pkg/sentry/kernel/auth",
- "//pkg/sentry/kernel/time",
- "//pkg/sentry/socket",
- "//pkg/sentry/socket/netfilter",
- "//pkg/sentry/unimpl",
- "//pkg/sentry/vfs",
- "//pkg/sync",
- "//pkg/syserr",
- "//pkg/syserror",
- "//pkg/tcpip",
- "//pkg/tcpip/buffer",
- "//pkg/tcpip/header",
- "//pkg/tcpip/network/ipv4",
- "//pkg/tcpip/network/ipv6",
- "//pkg/tcpip/stack",
- "//pkg/tcpip/transport/tcp",
- "//pkg/tcpip/transport/udp",
- "//pkg/usermem",
- "//pkg/waiter",
- "//tools/go_marshal/marshal",
- "//tools/go_marshal/primitive",
- "@org_golang_x_sys//unix:go_default_library",
- ],
-)
diff --git a/pkg/sentry/socket/netstack/netstack_state_autogen.go b/pkg/sentry/socket/netstack/netstack_state_autogen.go
new file mode 100644
index 000000000..27e3ada76
--- /dev/null
+++ b/pkg/sentry/socket/netstack/netstack_state_autogen.go
@@ -0,0 +1,119 @@
+// automatically generated by stateify.
+
+package netstack
+
+import (
+ "gvisor.dev/gvisor/pkg/state"
+)
+
+func (x *SocketOperations) StateTypeName() string {
+ return "pkg/sentry/socket/netstack.SocketOperations"
+}
+
+func (x *SocketOperations) StateFields() []string {
+ return []string{
+ "socketOpsCommon",
+ }
+}
+
+func (x *SocketOperations) beforeSave() {}
+
+func (x *SocketOperations) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.socketOpsCommon)
+}
+
+func (x *SocketOperations) afterLoad() {}
+
+func (x *SocketOperations) StateLoad(m state.Source) {
+ m.Load(0, &x.socketOpsCommon)
+}
+
+func (x *socketOpsCommon) StateTypeName() string {
+ return "pkg/sentry/socket/netstack.socketOpsCommon"
+}
+
+func (x *socketOpsCommon) StateFields() []string {
+ return []string{
+ "SendReceiveTimeout",
+ "Queue",
+ "family",
+ "Endpoint",
+ "skType",
+ "protocol",
+ "readViewHasData",
+ "readView",
+ "readCM",
+ "sender",
+ "linkPacketInfo",
+ "sockOptTimestamp",
+ "timestampValid",
+ "timestampNS",
+ "sockOptInq",
+ }
+}
+
+func (x *socketOpsCommon) beforeSave() {}
+
+func (x *socketOpsCommon) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.SendReceiveTimeout)
+ m.Save(1, &x.Queue)
+ m.Save(2, &x.family)
+ m.Save(3, &x.Endpoint)
+ m.Save(4, &x.skType)
+ m.Save(5, &x.protocol)
+ m.Save(6, &x.readViewHasData)
+ m.Save(7, &x.readView)
+ m.Save(8, &x.readCM)
+ m.Save(9, &x.sender)
+ m.Save(10, &x.linkPacketInfo)
+ m.Save(11, &x.sockOptTimestamp)
+ m.Save(12, &x.timestampValid)
+ m.Save(13, &x.timestampNS)
+ m.Save(14, &x.sockOptInq)
+}
+
+func (x *socketOpsCommon) afterLoad() {}
+
+func (x *socketOpsCommon) StateLoad(m state.Source) {
+ m.Load(0, &x.SendReceiveTimeout)
+ m.Load(1, &x.Queue)
+ m.Load(2, &x.family)
+ m.Load(3, &x.Endpoint)
+ m.Load(4, &x.skType)
+ m.Load(5, &x.protocol)
+ m.Load(6, &x.readViewHasData)
+ m.Load(7, &x.readView)
+ m.Load(8, &x.readCM)
+ m.Load(9, &x.sender)
+ m.Load(10, &x.linkPacketInfo)
+ m.Load(11, &x.sockOptTimestamp)
+ m.Load(12, &x.timestampValid)
+ m.Load(13, &x.timestampNS)
+ m.Load(14, &x.sockOptInq)
+}
+
+func (x *Stack) StateTypeName() string {
+ return "pkg/sentry/socket/netstack.Stack"
+}
+
+func (x *Stack) StateFields() []string {
+ return []string{}
+}
+
+func (x *Stack) beforeSave() {}
+
+func (x *Stack) StateSave(m state.Sink) {
+ x.beforeSave()
+}
+
+func (x *Stack) StateLoad(m state.Source) {
+ m.AfterLoad(x.afterLoad)
+}
+
+func init() {
+ state.Register((*SocketOperations)(nil))
+ state.Register((*socketOpsCommon)(nil))
+ state.Register((*Stack)(nil))
+}