File: header_state_autogen.go

package info (click to toggle)
golang-gvisor-gvisor 0.0~20240729.0-4
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 21,300 kB
  • sloc: asm: 3,361; ansic: 1,197; cpp: 348; makefile: 92; python: 89; sh: 83
file content (120 lines) | stat: -rw-r--r-- 2,705 bytes parent folder | download | duplicates (2)
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
// automatically generated by stateify.

package header

import (
	"context"

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

func (t *TCPSynOptions) StateTypeName() string {
	return "pkg/tcpip/header.TCPSynOptions"
}

func (t *TCPSynOptions) StateFields() []string {
	return []string{
		"MSS",
		"WS",
		"TS",
		"TSVal",
		"TSEcr",
		"SACKPermitted",
		"Flags",
	}
}

func (t *TCPSynOptions) beforeSave() {}

// +checklocksignore
func (t *TCPSynOptions) StateSave(stateSinkObject state.Sink) {
	t.beforeSave()
	stateSinkObject.Save(0, &t.MSS)
	stateSinkObject.Save(1, &t.WS)
	stateSinkObject.Save(2, &t.TS)
	stateSinkObject.Save(3, &t.TSVal)
	stateSinkObject.Save(4, &t.TSEcr)
	stateSinkObject.Save(5, &t.SACKPermitted)
	stateSinkObject.Save(6, &t.Flags)
}

func (t *TCPSynOptions) afterLoad(context.Context) {}

// +checklocksignore
func (t *TCPSynOptions) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &t.MSS)
	stateSourceObject.Load(1, &t.WS)
	stateSourceObject.Load(2, &t.TS)
	stateSourceObject.Load(3, &t.TSVal)
	stateSourceObject.Load(4, &t.TSEcr)
	stateSourceObject.Load(5, &t.SACKPermitted)
	stateSourceObject.Load(6, &t.Flags)
}

func (r *SACKBlock) StateTypeName() string {
	return "pkg/tcpip/header.SACKBlock"
}

func (r *SACKBlock) StateFields() []string {
	return []string{
		"Start",
		"End",
	}
}

func (r *SACKBlock) beforeSave() {}

// +checklocksignore
func (r *SACKBlock) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.Start)
	stateSinkObject.Save(1, &r.End)
}

func (r *SACKBlock) afterLoad(context.Context) {}

// +checklocksignore
func (r *SACKBlock) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.Start)
	stateSourceObject.Load(1, &r.End)
}

func (t *TCPOptions) StateTypeName() string {
	return "pkg/tcpip/header.TCPOptions"
}

func (t *TCPOptions) StateFields() []string {
	return []string{
		"TS",
		"TSVal",
		"TSEcr",
		"SACKBlocks",
	}
}

func (t *TCPOptions) beforeSave() {}

// +checklocksignore
func (t *TCPOptions) StateSave(stateSinkObject state.Sink) {
	t.beforeSave()
	stateSinkObject.Save(0, &t.TS)
	stateSinkObject.Save(1, &t.TSVal)
	stateSinkObject.Save(2, &t.TSEcr)
	stateSinkObject.Save(3, &t.SACKBlocks)
}

func (t *TCPOptions) afterLoad(context.Context) {}

// +checklocksignore
func (t *TCPOptions) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &t.TS)
	stateSourceObject.Load(1, &t.TSVal)
	stateSourceObject.Load(2, &t.TSEcr)
	stateSourceObject.Load(3, &t.SACKBlocks)
}

func init() {
	state.Register((*TCPSynOptions)(nil))
	state.Register((*SACKBlock)(nil))
	state.Register((*TCPOptions)(nil))
}