summaryrefslogtreecommitdiffhomepage
path: root/pkg/sentry/socket/netlink
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-06-24 06:37:35 +0000
committergVisor bot <gvisor-bot@google.com>2020-06-24 06:37:35 +0000
commit9183888b520beeee8609170819a28bea89202909 (patch)
tree3cdcfa4de9ced4c539ab7c57e4cf58ffea980f6c /pkg/sentry/socket/netlink
parentcab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff)
parent364ac92baf83f2352f78b718090472639bd92a76 (diff)
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/sentry/socket/netlink')
-rw-r--r--pkg/sentry/socket/netlink/netlink_state_autogen.go110
-rw-r--r--pkg/sentry/socket/netlink/port/port_state_autogen.go22
-rw-r--r--pkg/sentry/socket/netlink/route/route_state_autogen.go16
-rw-r--r--pkg/sentry/socket/netlink/uevent/uevent_state_autogen.go16
4 files changed, 120 insertions, 44 deletions
diff --git a/pkg/sentry/socket/netlink/netlink_state_autogen.go b/pkg/sentry/socket/netlink/netlink_state_autogen.go
index fa6a7ce74..5a7a09b6d 100644
--- a/pkg/sentry/socket/netlink/netlink_state_autogen.go
+++ b/pkg/sentry/socket/netlink/netlink_state_autogen.go
@@ -6,59 +6,103 @@ import (
"gvisor.dev/gvisor/pkg/state"
)
+func (x *Socket) StateTypeName() string {
+ return "pkg/sentry/socket/netlink.Socket"
+}
+
+func (x *Socket) StateFields() []string {
+ return []string{
+ "socketOpsCommon",
+ }
+}
+
func (x *Socket) beforeSave() {}
-func (x *Socket) save(m state.Map) {
+
+func (x *Socket) StateSave(m state.Sink) {
x.beforeSave()
- m.Save("socketOpsCommon", &x.socketOpsCommon)
+ m.Save(0, &x.socketOpsCommon)
}
func (x *Socket) afterLoad() {}
-func (x *Socket) load(m state.Map) {
- m.Load("socketOpsCommon", &x.socketOpsCommon)
+
+func (x *Socket) StateLoad(m state.Source) {
+ m.Load(0, &x.socketOpsCommon)
+}
+
+func (x *socketOpsCommon) StateTypeName() string {
+ return "pkg/sentry/socket/netlink.socketOpsCommon"
+}
+
+func (x *socketOpsCommon) StateFields() []string {
+ return []string{
+ "SendReceiveTimeout",
+ "ports",
+ "protocol",
+ "skType",
+ "ep",
+ "connection",
+ "bound",
+ "portID",
+ "sendBufferSize",
+ "passcred",
+ "filter",
+ }
}
func (x *socketOpsCommon) beforeSave() {}
-func (x *socketOpsCommon) save(m state.Map) {
+
+func (x *socketOpsCommon) StateSave(m state.Sink) {
x.beforeSave()
- m.Save("SendReceiveTimeout", &x.SendReceiveTimeout)
- m.Save("ports", &x.ports)
- m.Save("protocol", &x.protocol)
- m.Save("skType", &x.skType)
- m.Save("ep", &x.ep)
- m.Save("connection", &x.connection)
- m.Save("bound", &x.bound)
- m.Save("portID", &x.portID)
- m.Save("sendBufferSize", &x.sendBufferSize)
- m.Save("passcred", &x.passcred)
- m.Save("filter", &x.filter)
+ m.Save(0, &x.SendReceiveTimeout)
+ m.Save(1, &x.ports)
+ m.Save(2, &x.protocol)
+ m.Save(3, &x.skType)
+ m.Save(4, &x.ep)
+ m.Save(5, &x.connection)
+ m.Save(6, &x.bound)
+ m.Save(7, &x.portID)
+ m.Save(8, &x.sendBufferSize)
+ m.Save(9, &x.passcred)
+ m.Save(10, &x.filter)
}
func (x *socketOpsCommon) afterLoad() {}
-func (x *socketOpsCommon) load(m state.Map) {
- m.Load("SendReceiveTimeout", &x.SendReceiveTimeout)
- m.Load("ports", &x.ports)
- m.Load("protocol", &x.protocol)
- m.Load("skType", &x.skType)
- m.Load("ep", &x.ep)
- m.Load("connection", &x.connection)
- m.Load("bound", &x.bound)
- m.Load("portID", &x.portID)
- m.Load("sendBufferSize", &x.sendBufferSize)
- m.Load("passcred", &x.passcred)
- m.Load("filter", &x.filter)
+
+func (x *socketOpsCommon) StateLoad(m state.Source) {
+ m.Load(0, &x.SendReceiveTimeout)
+ m.Load(1, &x.ports)
+ m.Load(2, &x.protocol)
+ m.Load(3, &x.skType)
+ m.Load(4, &x.ep)
+ m.Load(5, &x.connection)
+ m.Load(6, &x.bound)
+ m.Load(7, &x.portID)
+ m.Load(8, &x.sendBufferSize)
+ m.Load(9, &x.passcred)
+ m.Load(10, &x.filter)
+}
+
+func (x *kernelSCM) StateTypeName() string {
+ return "pkg/sentry/socket/netlink.kernelSCM"
+}
+
+func (x *kernelSCM) StateFields() []string {
+ return []string{}
}
func (x *kernelSCM) beforeSave() {}
-func (x *kernelSCM) save(m state.Map) {
+
+func (x *kernelSCM) StateSave(m state.Sink) {
x.beforeSave()
}
func (x *kernelSCM) afterLoad() {}
-func (x *kernelSCM) load(m state.Map) {
+
+func (x *kernelSCM) StateLoad(m state.Source) {
}
func init() {
- state.Register("pkg/sentry/socket/netlink.Socket", (*Socket)(nil), state.Fns{Save: (*Socket).save, Load: (*Socket).load})
- state.Register("pkg/sentry/socket/netlink.socketOpsCommon", (*socketOpsCommon)(nil), state.Fns{Save: (*socketOpsCommon).save, Load: (*socketOpsCommon).load})
- state.Register("pkg/sentry/socket/netlink.kernelSCM", (*kernelSCM)(nil), state.Fns{Save: (*kernelSCM).save, Load: (*kernelSCM).load})
+ state.Register((*Socket)(nil))
+ state.Register((*socketOpsCommon)(nil))
+ state.Register((*kernelSCM)(nil))
}
diff --git a/pkg/sentry/socket/netlink/port/port_state_autogen.go b/pkg/sentry/socket/netlink/port/port_state_autogen.go
index c509cc7d5..16c59e616 100644
--- a/pkg/sentry/socket/netlink/port/port_state_autogen.go
+++ b/pkg/sentry/socket/netlink/port/port_state_autogen.go
@@ -6,17 +6,29 @@ import (
"gvisor.dev/gvisor/pkg/state"
)
+func (x *Manager) StateTypeName() string {
+ return "pkg/sentry/socket/netlink/port.Manager"
+}
+
+func (x *Manager) StateFields() []string {
+ return []string{
+ "ports",
+ }
+}
+
func (x *Manager) beforeSave() {}
-func (x *Manager) save(m state.Map) {
+
+func (x *Manager) StateSave(m state.Sink) {
x.beforeSave()
- m.Save("ports", &x.ports)
+ m.Save(0, &x.ports)
}
func (x *Manager) afterLoad() {}
-func (x *Manager) load(m state.Map) {
- m.Load("ports", &x.ports)
+
+func (x *Manager) StateLoad(m state.Source) {
+ m.Load(0, &x.ports)
}
func init() {
- state.Register("pkg/sentry/socket/netlink/port.Manager", (*Manager)(nil), state.Fns{Save: (*Manager).save, Load: (*Manager).load})
+ state.Register((*Manager)(nil))
}
diff --git a/pkg/sentry/socket/netlink/route/route_state_autogen.go b/pkg/sentry/socket/netlink/route/route_state_autogen.go
index bd10fe189..bc0111017 100644
--- a/pkg/sentry/socket/netlink/route/route_state_autogen.go
+++ b/pkg/sentry/socket/netlink/route/route_state_autogen.go
@@ -6,15 +6,25 @@ import (
"gvisor.dev/gvisor/pkg/state"
)
+func (x *Protocol) StateTypeName() string {
+ return "pkg/sentry/socket/netlink/route.Protocol"
+}
+
+func (x *Protocol) StateFields() []string {
+ return []string{}
+}
+
func (x *Protocol) beforeSave() {}
-func (x *Protocol) save(m state.Map) {
+
+func (x *Protocol) StateSave(m state.Sink) {
x.beforeSave()
}
func (x *Protocol) afterLoad() {}
-func (x *Protocol) load(m state.Map) {
+
+func (x *Protocol) StateLoad(m state.Source) {
}
func init() {
- state.Register("pkg/sentry/socket/netlink/route.Protocol", (*Protocol)(nil), state.Fns{Save: (*Protocol).save, Load: (*Protocol).load})
+ state.Register((*Protocol)(nil))
}
diff --git a/pkg/sentry/socket/netlink/uevent/uevent_state_autogen.go b/pkg/sentry/socket/netlink/uevent/uevent_state_autogen.go
index b82dddf32..4f2211ec2 100644
--- a/pkg/sentry/socket/netlink/uevent/uevent_state_autogen.go
+++ b/pkg/sentry/socket/netlink/uevent/uevent_state_autogen.go
@@ -6,15 +6,25 @@ import (
"gvisor.dev/gvisor/pkg/state"
)
+func (x *Protocol) StateTypeName() string {
+ return "pkg/sentry/socket/netlink/uevent.Protocol"
+}
+
+func (x *Protocol) StateFields() []string {
+ return []string{}
+}
+
func (x *Protocol) beforeSave() {}
-func (x *Protocol) save(m state.Map) {
+
+func (x *Protocol) StateSave(m state.Sink) {
x.beforeSave()
}
func (x *Protocol) afterLoad() {}
-func (x *Protocol) load(m state.Map) {
+
+func (x *Protocol) StateLoad(m state.Source) {
}
func init() {
- state.Register("pkg/sentry/socket/netlink/uevent.Protocol", (*Protocol)(nil), state.Fns{Save: (*Protocol).save, Load: (*Protocol).load})
+ state.Register((*Protocol)(nil))
}