diff options
Diffstat (limited to 'pkg/sentry/inet')
-rw-r--r-- | pkg/sentry/inet/BUILD | 21 | ||||
-rw-r--r-- | pkg/sentry/inet/inet_state_autogen.go | 66 |
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..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)) +} |