summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/inet
diff options
context:
space:
mode:
Diffstat (limited to 'pkg/sentry/inet')
-rw-r--r--pkg/sentry/inet/BUILD21
-rw-r--r--pkg/sentry/inet/inet_state_autogen.go66
2 files changed, 66 insertions, 21 deletions
diff --git a/pkg/sentry/inet/BUILD b/pkg/sentry/inet/BUILD
deleted file mode 100644
index 5bba9de0b..000000000
--- a/pkg/sentry/inet/BUILD
+++ /dev/null
@@ -1,21 +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",
- "//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..372a3d50a
--- /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 (t *TCPBufferSize) StateTypeName() string {
+ return "pkg/sentry/inet.TCPBufferSize"
+}
+
+func (t *TCPBufferSize) StateFields() []string {
+ return []string{
+ "Min",
+ "Default",
+ "Max",
+ }
+}
+
+func (t *TCPBufferSize) beforeSave() {}
+
+func (t *TCPBufferSize) StateSave(stateSinkObject state.Sink) {
+ t.beforeSave()
+ stateSinkObject.Save(0, &t.Min)
+ stateSinkObject.Save(1, &t.Default)
+ stateSinkObject.Save(2, &t.Max)
+}
+
+func (t *TCPBufferSize) afterLoad() {}
+
+func (t *TCPBufferSize) StateLoad(stateSourceObject state.Source) {
+ stateSourceObject.Load(0, &t.Min)
+ stateSourceObject.Load(1, &t.Default)
+ stateSourceObject.Load(2, &t.Max)
+}
+
+func (n *Namespace) StateTypeName() string {
+ return "pkg/sentry/inet.Namespace"
+}
+
+func (n *Namespace) StateFields() []string {
+ return []string{
+ "creator",
+ "isRoot",
+ }
+}
+
+func (n *Namespace) beforeSave() {}
+
+func (n *Namespace) StateSave(stateSinkObject state.Sink) {
+ n.beforeSave()
+ stateSinkObject.Save(0, &n.creator)
+ stateSinkObject.Save(1, &n.isRoot)
+}
+
+func (n *Namespace) StateLoad(stateSourceObject state.Source) {
+ stateSourceObject.LoadWait(0, &n.creator)
+ stateSourceObject.Load(1, &n.isRoot)
+ stateSourceObject.AfterLoad(n.afterLoad)
+}
+
+func init() {
+ state.Register((*TCPBufferSize)(nil))
+ state.Register((*Namespace)(nil))
+}