01: // Copyright (c) 2004 Brian Wellington (bwelling@xbill.org)
02:
03: package org.xbill.DNS;
04:
05: /**
06: * Constants and functions relating to EDNS flags.
07: *
08: * @author Brian Wellington
09: */
10:
11: public final class ExtendedFlags {
12:
13: private static Mnemonic extflags = new Mnemonic("EDNS Flag",
14: Mnemonic.CASE_LOWER);
15:
16: /** dnssec ok */
17: public static final int DO = 0x8000;
18:
19: static {
20: extflags.setMaximum(0xFFFF);
21: extflags.setPrefix("FLAG");
22: extflags.setNumericAllowed(true);
23:
24: extflags.add(DO, "do");
25: }
26:
27: private ExtendedFlags() {
28: }
29:
30: /** Converts a numeric extended flag into a String */
31: public static String string(int i) {
32: return extflags.getText(i);
33: }
34:
35: /**
36: * Converts a textual representation of an extended flag into its numeric
37: * value
38: */
39: public static int value(String s) {
40: return extflags.getValue(s);
41: }
42:
43: }
|