summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/inet
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/inet')
-rw-r--r--pkg/sentry/inet/BUILD20
-rw-r--r--pkg/sentry/inet/inet_state_autogen.go66
2 files changed, 66 insertions, 20 deletions
diff --git a/pkg/sentry/inet/BUILD b/pkg/sentry/inet/BUILD
deleted file mode 100644
index 07bf39fed..000000000
--- a/pkg/sentry/inet/BUILD
+++ /dev/null
@@ -1,20 +0,0 @@
-load("//tools:defs.bzl", "go_library")
-
-package(
- default_visibility = ["//:sandbox"],
- licenses = ["notice"],
-)
-
-go_library(
- name = "inet",
- srcs = [
- "context.go",
- "inet.go",
- "namespace.go",
- "test_stack.go",
- ],
- deps = [
- "//pkg/context",
- "//pkg/tcpip/stack",
- ],
-)
diff --git a/pkg/sentry/inet/inet_state_autogen.go b/pkg/sentry/inet/inet_state_autogen.go
new file mode 100644
index 000000000..dc382a657
--- /dev/null
+++ b/pkg/sentry/inet/inet_state_autogen.go
@@ -0,0 +1,66 @@
+// automatically generated by stateify.
+
+package inet
+
+import (
+ "gvisor.dev/gvisor/pkg/state"
+)
+
+func (x *TCPBufferSize) StateTypeName() string {
+ return "pkg/sentry/inet.TCPBufferSize"
+}
+
+func (x *TCPBufferSize) StateFields() []string {
+ return []string{
+ "Min",
+ "Default",
+ "Max",
+ }
+}
+
+func (x *TCPBufferSize) beforeSave() {}
+
+func (x *TCPBufferSize) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.Min)
+ m.Save(1, &x.Default)
+ m.Save(2, &x.Max)
+}
+
+func (x *TCPBufferSize) afterLoad() {}
+
+func (x *TCPBufferSize) StateLoad(m state.Source) {
+ m.Load(0, &x.Min)
+ m.Load(1, &x.Default)
+ m.Load(2, &x.Max)
+}
+
+func (x *Namespace) StateTypeName() string {
+ return "pkg/sentry/inet.Namespace"
+}
+
+func (x *Namespace) StateFields() []string {
+ return []string{
+ "creator",
+ "isRoot",
+ }
+}
+
+func (x *Namespace) beforeSave() {}
+
+func (x *Namespace) StateSave(m state.Sink) {
+ x.beforeSave()
+ m.Save(0, &x.creator)
+ m.Save(1, &x.isRoot)
+}
+
+func (x *Namespace) StateLoad(m state.Source) {
+ m.LoadWait(0, &x.creator)
+ m.Load(1, &x.isRoot)
+ m.AfterLoad(x.afterLoad)
+}
+
+func init() {
+ state.Register((*TCPBufferSize)(nil))
+ state.Register((*Namespace)(nil))
+}