summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/link
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/tcpip/link
parentcab13958a54419262aba2a0cd7f1075ed02c8ee0 (diff)
parent364ac92baf83f2352f78b718090472639bd92a76 (diff)
Merge release-20200608.0-119-g364ac92ba (automated)
Diffstat (limited to 'pkg/tcpip/link')
-rw-r--r--pkg/tcpip/link/channel/channel_state_autogen.go22
-rw-r--r--pkg/tcpip/link/tun/tun_state_autogen.go36
2 files changed, 42 insertions, 16 deletions
diff --git a/pkg/tcpip/link/channel/channel_state_autogen.go b/pkg/tcpip/link/channel/channel_state_autogen.go
index ce52482a2..d00c11cb2 100644
--- a/pkg/tcpip/link/channel/channel_state_autogen.go
+++ b/pkg/tcpip/link/channel/channel_state_autogen.go
@@ -6,17 +6,29 @@ import (
"gvisor.dev/gvisor/pkg/state"
)
+func (x *NotificationHandle) StateTypeName() string {
+ return "pkg/tcpip/link/channel.NotificationHandle"
+}
+
+func (x *NotificationHandle) StateFields() []string {
+ return []string{
+ "n",
+ }
+}
+
func (x *NotificationHandle) beforeSave() {}
-func (x *NotificationHandle) save(m state.Map) {
+
+func (x *NotificationHandle) StateSave(m state.Sink) {
x.beforeSave()
- m.Save("n", &x.n)
+ m.Save(0, &x.n)
}
func (x *NotificationHandle) afterLoad() {}
-func (x *NotificationHandle) load(m state.Map) {
- m.Load("n", &x.n)
+
+func (x *NotificationHandle) StateLoad(m state.Source) {
+ m.Load(0, &x.n)
}
func init() {
- state.Register("pkg/tcpip/link/channel.NotificationHandle", (*NotificationHandle)(nil), state.Fns{Save: (*NotificationHandle).save, Load: (*NotificationHandle).load})
+ state.Register((*NotificationHandle)(nil))
}
diff --git a/pkg/tcpip/link/tun/tun_state_autogen.go b/pkg/tcpip/link/tun/tun_state_autogen.go
index 4b70647af..7f75aef19 100644
--- a/pkg/tcpip/link/tun/tun_state_autogen.go
+++ b/pkg/tcpip/link/tun/tun_state_autogen.go
@@ -6,22 +6,36 @@ import (
"gvisor.dev/gvisor/pkg/state"
)
-func (x *Device) save(m state.Map) {
+func (x *Device) StateTypeName() string {
+ return "pkg/tcpip/link/tun.Device"
+}
+
+func (x *Device) StateFields() []string {
+ return []string{
+ "Queue",
+ "endpoint",
+ "notifyHandle",
+ "flags",
+ }
+}
+
+func (x *Device) StateSave(m state.Sink) {
x.beforeSave()
- m.Save("Queue", &x.Queue)
- m.Save("endpoint", &x.endpoint)
- m.Save("notifyHandle", &x.notifyHandle)
- m.Save("flags", &x.flags)
+ m.Save(0, &x.Queue)
+ m.Save(1, &x.endpoint)
+ m.Save(2, &x.notifyHandle)
+ m.Save(3, &x.flags)
}
func (x *Device) afterLoad() {}
-func (x *Device) load(m state.Map) {
- m.Load("Queue", &x.Queue)
- m.Load("endpoint", &x.endpoint)
- m.Load("notifyHandle", &x.notifyHandle)
- m.Load("flags", &x.flags)
+
+func (x *Device) StateLoad(m state.Source) {
+ m.Load(0, &x.Queue)
+ m.Load(1, &x.endpoint)
+ m.Load(2, &x.notifyHandle)
+ m.Load(3, &x.flags)
}
func init() {
- state.Register("pkg/tcpip/link/tun.Device", (*Device)(nil), state.Fns{Save: (*Device).save, Load: (*Device).load})
+ state.Register((*Device)(nil))
}