1
// Copyright (c) 1999-2004 Brian Wellington (bwelling@xbill.org)
6
* Constants and functions relating to flags in the DNS header.
8
* @author Brian Wellington
11
public final class Flags {
13
private static Mnemonic flags = new Mnemonic("DNS Header Flag",
17
public static final byte QR = 0;
19
/** authoritative answer */
20
public static final byte AA = 5;
23
public static final byte TC = 6;
25
/** recursion desired */
26
public static final byte RD = 7;
28
/** recursion available */
29
public static final byte RA = 8;
31
/** authenticated data */
32
public static final byte AD = 10;
34
/** (security) checking disabled */
35
public static final byte CD = 11;
37
/** dnssec ok (extended) */
38
public static final int DO = ExtendedFlags.DO;
41
flags.setMaximum(0xF);
42
flags.setPrefix("FLAG");
43
flags.setNumericAllowed(true);
57
/** Converts a numeric Flag into a String */
60
return flags.getText(i);
63
/** Converts a String representation of an Flag into its numeric value */
66
return flags.getValue(s);
70
* Indicates if a bit in the flags field is a flag or not. If it's part of
71
* the rcode or opcode, it's not.
76
if ((index >= 1 && index <= 4) || (index >= 12))