File: multicast_state_autogen.go

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

package multicast

import (
	"context"

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

func (r *RouteTable) StateTypeName() string {
	return "pkg/tcpip/network/internal/multicast.RouteTable"
}

func (r *RouteTable) StateFields() []string {
	return []string{
		"installedRoutes",
		"pendingRoutes",
		"cleanupPendingRoutesTimer",
		"isCleanupRoutineRunning",
		"config",
	}
}

func (r *RouteTable) beforeSave() {}

// +checklocksignore
func (r *RouteTable) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.installedRoutes)
	stateSinkObject.Save(1, &r.pendingRoutes)
	stateSinkObject.Save(2, &r.cleanupPendingRoutesTimer)
	stateSinkObject.Save(3, &r.isCleanupRoutineRunning)
	stateSinkObject.Save(4, &r.config)
}

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

// +checklocksignore
func (r *RouteTable) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.installedRoutes)
	stateSourceObject.Load(1, &r.pendingRoutes)
	stateSourceObject.Load(2, &r.cleanupPendingRoutesTimer)
	stateSourceObject.Load(3, &r.isCleanupRoutineRunning)
	stateSourceObject.Load(4, &r.config)
}

func (r *InstalledRoute) StateTypeName() string {
	return "pkg/tcpip/network/internal/multicast.InstalledRoute"
}

func (r *InstalledRoute) StateFields() []string {
	return []string{
		"MulticastRoute",
		"lastUsedTimestamp",
	}
}

func (r *InstalledRoute) beforeSave() {}

// +checklocksignore
func (r *InstalledRoute) StateSave(stateSinkObject state.Sink) {
	r.beforeSave()
	stateSinkObject.Save(0, &r.MulticastRoute)
	stateSinkObject.Save(1, &r.lastUsedTimestamp)
}

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

// +checklocksignore
func (r *InstalledRoute) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &r.MulticastRoute)
	stateSourceObject.Load(1, &r.lastUsedTimestamp)
}

func (p *PendingRoute) StateTypeName() string {
	return "pkg/tcpip/network/internal/multicast.PendingRoute"
}

func (p *PendingRoute) StateFields() []string {
	return []string{
		"packets",
		"expiration",
	}
}

func (p *PendingRoute) beforeSave() {}

// +checklocksignore
func (p *PendingRoute) StateSave(stateSinkObject state.Sink) {
	p.beforeSave()
	stateSinkObject.Save(0, &p.packets)
	stateSinkObject.Save(1, &p.expiration)
}

func (p *PendingRoute) afterLoad(context.Context) {}

// +checklocksignore
func (p *PendingRoute) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &p.packets)
	stateSourceObject.Load(1, &p.expiration)
}

func (c *Config) StateTypeName() string {
	return "pkg/tcpip/network/internal/multicast.Config"
}

func (c *Config) StateFields() []string {
	return []string{
		"MaxPendingQueueSize",
		"Clock",
	}
}

func (c *Config) beforeSave() {}

// +checklocksignore
func (c *Config) StateSave(stateSinkObject state.Sink) {
	c.beforeSave()
	stateSinkObject.Save(0, &c.MaxPendingQueueSize)
	stateSinkObject.Save(1, &c.Clock)
}

func (c *Config) afterLoad(context.Context) {}

// +checklocksignore
func (c *Config) StateLoad(ctx context.Context, stateSourceObject state.Source) {
	stateSourceObject.Load(0, &c.MaxPendingQueueSize)
	stateSourceObject.Load(1, &c.Clock)
}

func init() {
	state.Register((*RouteTable)(nil))
	state.Register((*InstalledRoute)(nil))
	state.Register((*PendingRoute)(nil))
	state.Register((*Config)(nil))
}