aboutsummaryrefslogtreecommitdiff
path: root/src/org/xbill/DNS/ExtendedFlags.java
blob: 8f3bbab8906716aa98f4e7dc18d2fe763e6a8f59 (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
// Copyright (c) 2004 Brian Wellington (bwelling@xbill.org)

package org.xbill.DNS;

/**
 * Constants and functions relating to EDNS flags.
 *
 * @author Brian Wellington
 */

public final class ExtendedFlags {

private static Mnemonic extflags = new Mnemonic("EDNS Flag",
						Mnemonic.CASE_LOWER);

/** dnssec ok */
public static final int DO		= 0x8000;

static {
	extflags.setMaximum(0xFFFF);
	extflags.setPrefix("FLAG");
	extflags.setNumericAllowed(true);

	extflags.add(DO, "do");
}

private
ExtendedFlags() {}

/** Converts a numeric extended flag into a String */
public static String
string(int i) {
	return extflags.getText(i);
}

/**
 * Converts a textual representation of an extended flag into its numeric
 * value
 */
public static int
value(String s) {
	return extflags.getValue(s);
}

}