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