-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathconst_gen.go
79 lines (70 loc) · 1.86 KB
/
const_gen.go
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
// Code generated by "stringer -linecomment -output const_gen.go -type=Layer,Proto"; DO NOT EDIT.
package divert
import "strconv"
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[Network-0]
_ = x[NetworkForward-1]
_ = x[Flow-2]
_ = x[Socket-3]
_ = x[Reflect-4]
_ = x[Unknown-5]
}
const _Layer_name = "NetworkNetworkForwardFlowSocketReflectUnknown"
var _Layer_index = [...]uint8{0, 7, 21, 25, 31, 38, 45}
func (i Layer) String() string {
if i >= Layer(len(_Layer_index)-1) {
return "Layer(" + strconv.FormatInt(int64(i), 10) + ")"
}
return _Layer_name[_Layer_index[i]:_Layer_index[i+1]]
}
func _() {
// An "invalid array index" compiler error signifies that the constant values have changed.
// Re-run the stringer command to generate them again.
var x [1]struct{}
_ = x[HOPOPTS-0]
_ = x[ICMP-1]
_ = x[TCP-6]
_ = x[UDP-17]
_ = x[ROUTING-43]
_ = x[FRAGMENT-44]
_ = x[AH-51]
_ = x[ICMPV6-58]
_ = x[NONE-59]
_ = x[DSTOPTS-60]
}
const (
_Proto_name_0 = "hopoptsicmp"
_Proto_name_1 = "tcp"
_Proto_name_2 = "udp"
_Proto_name_3 = "routingfragment"
_Proto_name_4 = "ah"
_Proto_name_5 = "icmp6nonedstopts"
)
var (
_Proto_index_0 = [...]uint8{0, 7, 11}
_Proto_index_3 = [...]uint8{0, 7, 15}
_Proto_index_5 = [...]uint8{0, 5, 9, 16}
)
func (i Proto) String() string {
switch {
case i <= 1:
return _Proto_name_0[_Proto_index_0[i]:_Proto_index_0[i+1]]
case i == 6:
return _Proto_name_1
case i == 17:
return _Proto_name_2
case 43 <= i && i <= 44:
i -= 43
return _Proto_name_3[_Proto_index_3[i]:_Proto_index_3[i+1]]
case i == 51:
return _Proto_name_4
case 58 <= i && i <= 60:
i -= 58
return _Proto_name_5[_Proto_index_5[i]:_Proto_index_5[i+1]]
default:
return "Proto(" + strconv.FormatInt(int64(i), 10) + ")"
}
}