File: string.go

package info (click to toggle)
golang-github-mdlayher-dhcp6 0.0~git20190311.2a67805-2
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, forky, sid, trixie
  • size: 400 kB
  • sloc: makefile: 3
file content (65 lines) | stat: -rw-r--r-- 2,892 bytes parent folder | download
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
// Code generated by "stringer -output=string.go -type=MessageType,Status,OptionCode"; DO NOT EDIT.

package dhcp6

import "fmt"

const _MessageType_name = "MessageTypeSolicitMessageTypeAdvertiseMessageTypeRequestMessageTypeConfirmMessageTypeRenewMessageTypeRebindMessageTypeReplyMessageTypeReleaseMessageTypeDeclineMessageTypeReconfigureMessageTypeInformationRequestMessageTypeRelayForwMessageTypeRelayReplMessageTypeLeasequeryMessageTypeLeasequeryReplyMessageTypeLeasequeryDoneMessageTypeLeasequeryDataMessageTypeReconfigureRequestMessageTypeReconfigureReplyMessageTypeDHCPv4QueryMessageTypeDHCPv4Response"

var _MessageType_index = [...]uint16{0, 18, 38, 56, 74, 90, 107, 123, 141, 159, 181, 210, 230, 250, 271, 297, 322, 347, 376, 403, 425, 450}

func (i MessageType) String() string {
	i -= 1
	if i >= MessageType(len(_MessageType_index)-1) {
		return fmt.Sprintf("MessageType(%d)", i+1)
	}
	return _MessageType_name[_MessageType_index[i]:_MessageType_index[i+1]]
}

const _Status_name = "StatusSuccessStatusUnspecFailStatusNoAddrsAvailStatusNoBindingStatusNotOnLinkStatusUseMulticastStatusNoPrefixAvailStatusUnknownQueryTypeStatusMalformedQueryStatusNotConfiguredStatusNotAllowedStatusQueryTerminated"

var _Status_index = [...]uint8{0, 13, 29, 47, 62, 77, 95, 114, 136, 156, 175, 191, 212}

func (i Status) String() string {
	if i >= Status(len(_Status_index)-1) {
		return fmt.Sprintf("Status(%d)", i)
	}
	return _Status_name[_Status_index[i]:_Status_index[i+1]]
}

const (
	_OptionCode_name_0 = "OptionClientIDOptionServerIDOptionIANAOptionIATAOptionIAAddrOptionOROOptionPreferenceOptionElapsedTimeOptionRelayMsg"
	_OptionCode_name_1 = "OptionAuthOptionUnicastOptionStatusCodeOptionRapidCommitOptionUserClassOptionVendorClassOptionVendorOptsOptionInterfaceIDOptionReconfMsgOptionReconfAccept"
	_OptionCode_name_2 = "OptionIAPDOptionIAPrefix"
	_OptionCode_name_3 = "OptionRemoteIdentifier"
	_OptionCode_name_4 = "OptionBootFileURLOptionBootFileParamOptionClientArchTypeOptionNII"
)

var (
	_OptionCode_index_0 = [...]uint8{0, 14, 28, 38, 48, 60, 69, 85, 102, 116}
	_OptionCode_index_1 = [...]uint8{0, 10, 23, 39, 56, 71, 88, 104, 121, 136, 154}
	_OptionCode_index_2 = [...]uint8{0, 10, 24}
	_OptionCode_index_3 = [...]uint8{0, 22}
	_OptionCode_index_4 = [...]uint8{0, 17, 36, 56, 65}
)

func (i OptionCode) String() string {
	switch {
	case 1 <= i && i <= 9:
		i -= 1
		return _OptionCode_name_0[_OptionCode_index_0[i]:_OptionCode_index_0[i+1]]
	case 11 <= i && i <= 20:
		i -= 11
		return _OptionCode_name_1[_OptionCode_index_1[i]:_OptionCode_index_1[i+1]]
	case 25 <= i && i <= 26:
		i -= 25
		return _OptionCode_name_2[_OptionCode_index_2[i]:_OptionCode_index_2[i+1]]
	case i == 37:
		return _OptionCode_name_3
	case 59 <= i && i <= 62:
		i -= 59
		return _OptionCode_name_4[_OptionCode_index_4[i]:_OptionCode_index_4[i+1]]
	default:
		return fmt.Sprintf("OptionCode(%d)", i)
	}
}