-
Notifications
You must be signed in to change notification settings - Fork 20
/
icmptype_string.go
39 lines (34 loc) · 1.34 KB
/
icmptype_string.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
// Code generated by "stringer -type=icmpType"; DO NOT EDIT.
package cmd
import "strconv"
const (
_icmpType_name_0 = "echoReply"
_icmpType_name_1 = "destinationUnreachablesourceQuenchredirectalternateHostAddress"
_icmpType_name_2 = "echorouterAdvertisementrouterSelectiontimeExceededparameterProblemtimestamptimestampReplyinformationRequestinformationReplyaddressMaskRequestaddressMaskReply"
_icmpType_name_3 = "traceroutedatagramConversionErrormobileHostRedirectipv6WhereAreYouipv6IAmHeremobileRegistrationRequestmobileRegistrationReplydomainNameRequestdomainNameReplyskipphoturis"
_icmpType_name_4 = "echoRequest"
)
var (
_icmpType_index_1 = [...]uint8{0, 22, 34, 42, 62}
_icmpType_index_2 = [...]uint8{0, 4, 23, 38, 50, 66, 75, 89, 107, 123, 141, 157}
_icmpType_index_3 = [...]uint8{0, 10, 33, 51, 66, 77, 102, 125, 142, 157, 161, 169}
)
func (i icmpType) String() string {
switch {
case i == 0:
return _icmpType_name_0
case 3 <= i && i <= 6:
i -= 3
return _icmpType_name_1[_icmpType_index_1[i]:_icmpType_index_1[i+1]]
case 8 <= i && i <= 18:
i -= 8
return _icmpType_name_2[_icmpType_index_2[i]:_icmpType_index_2[i+1]]
case 30 <= i && i <= 40:
i -= 30
return _icmpType_name_3[_icmpType_index_3[i]:_icmpType_index_3[i+1]]
case i == 128:
return _icmpType_name_4
default:
return "icmpType(" + strconv.FormatInt(int64(i), 10) + ")"
}
}