summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/tcpip_state_autogen.go
blob: e79c0b4916559bf3b8ebb92afa487229309837ed (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
// automatically generated by stateify.

package tcpip

import (
	"gvisor.dev/gvisor/pkg/state"
)

func (x *FullAddress) StateTypeName() string {
	return "pkg/tcpip.FullAddress"
}

func (x *FullAddress) StateFields() []string {
	return []string{
		"NIC",
		"Addr",
		"Port",
	}
}

func (x *FullAddress) beforeSave() {}

func (x *FullAddress) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.NIC)
	m.Save(1, &x.Addr)
	m.Save(2, &x.Port)
}

func (x *FullAddress) afterLoad() {}

func (x *FullAddress) StateLoad(m state.Source) {
	m.Load(0, &x.NIC)
	m.Load(1, &x.Addr)
	m.Load(2, &x.Port)
}

func (x *ControlMessages) StateTypeName() string {
	return "pkg/tcpip.ControlMessages"
}

func (x *ControlMessages) StateFields() []string {
	return []string{
		"HasTimestamp",
		"Timestamp",
		"HasInq",
		"Inq",
		"HasTOS",
		"TOS",
		"HasTClass",
		"TClass",
		"HasIPPacketInfo",
		"PacketInfo",
	}
}

func (x *ControlMessages) beforeSave() {}

func (x *ControlMessages) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.HasTimestamp)
	m.Save(1, &x.Timestamp)
	m.Save(2, &x.HasInq)
	m.Save(3, &x.Inq)
	m.Save(4, &x.HasTOS)
	m.Save(5, &x.TOS)
	m.Save(6, &x.HasTClass)
	m.Save(7, &x.TClass)
	m.Save(8, &x.HasIPPacketInfo)
	m.Save(9, &x.PacketInfo)
}

func (x *ControlMessages) afterLoad() {}

func (x *ControlMessages) StateLoad(m state.Source) {
	m.Load(0, &x.HasTimestamp)
	m.Load(1, &x.Timestamp)
	m.Load(2, &x.HasInq)
	m.Load(3, &x.Inq)
	m.Load(4, &x.HasTOS)
	m.Load(5, &x.TOS)
	m.Load(6, &x.HasTClass)
	m.Load(7, &x.TClass)
	m.Load(8, &x.HasIPPacketInfo)
	m.Load(9, &x.PacketInfo)
}

func (x *LinkPacketInfo) StateTypeName() string {
	return "pkg/tcpip.LinkPacketInfo"
}

func (x *LinkPacketInfo) StateFields() []string {
	return []string{
		"Protocol",
	}
}

func (x *LinkPacketInfo) beforeSave() {}

func (x *LinkPacketInfo) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.Protocol)
}

func (x *LinkPacketInfo) afterLoad() {}

func (x *LinkPacketInfo) StateLoad(m state.Source) {
	m.Load(0, &x.Protocol)
}

func (x *IPPacketInfo) StateTypeName() string {
	return "pkg/tcpip.IPPacketInfo"
}

func (x *IPPacketInfo) StateFields() []string {
	return []string{
		"NIC",
		"LocalAddr",
		"DestinationAddr",
	}
}

func (x *IPPacketInfo) beforeSave() {}

func (x *IPPacketInfo) StateSave(m state.Sink) {
	x.beforeSave()
	m.Save(0, &x.NIC)
	m.Save(1, &x.LocalAddr)
	m.Save(2, &x.DestinationAddr)
}

func (x *IPPacketInfo) afterLoad() {}

func (x *IPPacketInfo) StateLoad(m state.Source) {
	m.Load(0, &x.NIC)
	m.Load(1, &x.LocalAddr)
	m.Load(2, &x.DestinationAddr)
}

func init() {
	state.Register((*FullAddress)(nil))
	state.Register((*ControlMessages)(nil))
	state.Register((*LinkPacketInfo)(nil))
	state.Register((*IPPacketInfo)(nil))
}