-
Notifications
You must be signed in to change notification settings - Fork 2.8k
/
drop.go
69 lines (65 loc) · 2.16 KB
/
drop.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
// Copyright 2018 Authors of Cilium
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
package api
import (
"fmt"
)
var errors = map[uint8]string{
0: "Success",
2: "Invalid packet",
130: "Invalid source mac",
131: "Invalid destination mac",
132: "Invalid source ip",
133: "Policy denied (L3)",
134: "Invalid packet",
135: "CT: Truncated or invalid header",
136: "CT: Missing TCP ACK flag",
137: "CT: Unknown L4 protocol",
138: "CT: Can't create entry from packet",
139: "Unsupported L3 protocol",
140: "Missed tail call",
141: "Error writing to packet",
142: "Unknown L4 protocol",
143: "Unknown ICMPv4 code",
144: "Unknown ICMPv4 type",
145: "Unknown ICMPv6 code",
146: "Unknown ICMPv6 type",
147: "Error retrieving tunnel key",
148: "Error retrieving tunnel options",
149: "Invalid Geneve option",
150: "Unknown L3 target address",
151: "Not a local target address",
152: "No matching local container found",
153: "Error while correcting L3 checksum",
154: "Error while correcting L4 checksum",
155: "CT: Map insertion failed",
156: "Invalid IPv6 extension header",
157: "IP fragmentation not supported",
158: "Service backend not found",
159: "Policy denied (L4)",
160: "No tunnel/encapsulation endpoint (datapath BUG!)",
161: "Failed to insert into proxymap",
162: "Policy denied (CIDR)",
163: "Unknown connection tracking state",
164: "Local host is unreachable",
165: "No configuration available to perform policy decision",
166: "Unsupported L2 protocol",
}
// DropReason prints the drop reason in a human readable string
func DropReason(reason uint8) string {
if err, ok := errors[reason]; ok {
return err
}
return fmt.Sprintf("%d", reason)
}