blob: d039fac129f7f672147df7ef974bc555e1840cb2 (
plain)
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
|
/**
*
*/
package javax.jmdns.impl.constants;
/**
* DNS option code.
*
* @author Arthur van Hoff, Pierre Frisch, Rick Blair
*/
public enum DNSOptionCode {
/**
* Token
*/
Unknown("Unknown", 65535),
/**
* Long-Lived Queries Option [http://files.dns-sd.org/draft-sekar-dns-llq.txt]
*/
LLQ("LLQ", 1),
/**
* Update Leases Option [http://files.dns-sd.org/draft-sekar-dns-ul.txt]
*/
UL("UL", 2),
/**
* Name Server Identifier Option [RFC5001]
*/
NSID("NSID", 3),
/**
* Owner Option [draft-cheshire-edns0-owner-option]
*/
Owner("Owner", 4);
private final String _externalName;
private final int _index;
DNSOptionCode(String name, int index) {
_externalName = name;
_index = index;
}
/**
* Return the string representation of this type
*
* @return String
*/
public String externalName() {
return _externalName;
}
/**
* Return the numeric value of this type
*
* @return String
*/
public int indexValue() {
return _index;
}
/**
* @param optioncode
* @return label
*/
public static DNSOptionCode resultCodeForFlags(int optioncode) {
int maskedIndex = optioncode;
for (DNSOptionCode aCode : DNSOptionCode.values()) {
if (aCode._index == maskedIndex) return aCode;
}
return Unknown;
}
@Override
public String toString() {
return this.name() + " index " + this.indexValue();
}
}
|