/** * Converts a String representation of an Type into its numeric value * @return The type code, or -1 on error. */ public static int value(String s) { return value(s, false); }
/** * Converts a String representation of an Type into its numeric value * @return The type code, or -1 on error. */ public static int value(String s) { return value(s, false); }
/** * Converts a String representation of an Type into its numeric value * @return The type code, or -1 on error. */ public static int value(String s) { return value(s, false); }
/** * Converts a String representation of an Type into its numeric value * @return The type code, or -1 on error. */ public static int value(String s) { return value(s, false); }
protected Record getRecord(String recstr) { String[] fields = recstr.split(SPACE); if (fields.length != 3) { throw new IllegalArgumentException("Wrong DNS query string: " + recstr); } return Record.newRecord(Name.fromConstantString(fields[0]), Type.value(fields[1]), DClass.value(fields[2])); }
public Record getRecord(long zoneTTL, Name origin) throws TextParseException, IOException { long ttl; if(this.ttl == null){ ttl = zoneTTL; }else{ ttl = this.ttl; } StringBuilder stringBuilder = new StringBuilder(); stringBuilder.append(this.content); String rdata = stringBuilder.toString(); Record record = Record.fromString(Name.fromString(this.name,origin), Type.value(type), DClass.value(dclass), ttl, rdata, origin); return record; }
protected Record getRecord(String recstr) { String[] fields = recstr.split(SPACE); if (fields.length != 3) { throw new IllegalArgumentException("Wrong DNS query string: " + recstr); } return Record.newRecord(Name.fromConstantString(fields[0]), Type.value(fields[1]), DClass.value(fields[2])); }
public static void main(String [] args) throws Exception { int type = Type.A; int start = 0; if (args.length > 2 && args[0].equals("-t")) { type = Type.value(args[1]); if (type < 0) throw new IllegalArgumentException("invalid type"); start = 2; } for (int i = start; i < args.length; i++) { Lookup l = new Lookup(args[i], type); l.run(); printAnswer(args[i], l); } }
void rdataFromString(Tokenizer st, Name origin) throws IOException { next = st.getName(origin); bitmap = new BitSet(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value, true); if (typecode <= 0 || typecode > 128) throw st.exception("Invalid type: " + t.value); bitmap.set(typecode); } st.unget(); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { next = st.getName(origin); bitmap = new BitSet(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value, true); if (typecode <= 0 || typecode > 128) throw st.exception("Invalid type: " + t.value); bitmap.set(typecode); } st.unget(); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { next = st.getName(origin); bitmap = new BitSet(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value, true); if (typecode <= 0 || typecode > 128) throw st.exception("Invalid type: " + t.value); bitmap.set(typecode); } st.unget(); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { next = st.getName(origin); bitmap = new BitSet(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value, true); if (typecode <= 0 || typecode > 128) throw st.exception("Invalid type: " + t.value); bitmap.set(typecode); } st.unget(); }
public TypeBitmap(Tokenizer st) throws IOException { this(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value); if (typecode < 0) { throw st.exception("Invalid type: " + t.value); } types.add(Mnemonic.toInteger(typecode)); } st.unget(); }
public TypeBitmap(Tokenizer st) throws IOException { this(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value); if (typecode < 0) { throw st.exception("Invalid type: " + t.value); } types.add(Mnemonic.toInteger(typecode)); } st.unget(); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { next = st.getName(origin); List list = new ArrayList(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value); if (typecode < 0) { throw st.exception("Invalid type: " + t.value); } list.add(Mnemonic.toInteger(typecode)); } st.unget(); types = listToArray(list); Arrays.sort(types); }
public TypeBitmap(Tokenizer st) throws IOException { this(); while (true) { Tokenizer.Token t = st.get(); if (!t.isString()) break; int typecode = Type.value(t.value); if (typecode < 0) { throw st.exception("Invalid type: " + t.value); } types.add(Mnemonic.toInteger(typecode)); } st.unget(); }
void doProhibit(Tokenizer st) throws IOException { Tokenizer.Token token; Name name; Record record; int type; name = st.getName(zone); token = st.get(); if (token.isString()) { if ((type = Type.value(token.value)) < 0) throw new IOException("Invalid type: " + token.value); } else type = Type.ANY; record = Record.newRecord(name, type, DClass.NONE, 0); query.addRecord(record, Section.PREREQ); print(record); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { String typeString = st.getString(); covered = Type.value(typeString); if (covered < 0) throw st.exception("Invalid type: " + typeString); String algString = st.getString(); alg = DNSSEC.Algorithm.value(algString); if (alg < 0) throw st.exception("Invalid algorithm: " + algString); labels = st.getUInt8(); origttl = st.getTTL(); expire = FormattedTime.parse(st.getString()); timeSigned = FormattedTime.parse(st.getString()); footprint = st.getUInt16(); signer = st.getName(origin); signature = st.getBase64(); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { String typeString = st.getString(); covered = Type.value(typeString); if (covered < 0) throw st.exception("Invalid type: " + typeString); String algString = st.getString(); alg = DNSSEC.Algorithm.value(algString); if (alg < 0) throw st.exception("Invalid algorithm: " + algString); labels = st.getUInt8(); origttl = st.getTTL(); expire = FormattedTime.parse(st.getString()); timeSigned = FormattedTime.parse(st.getString()); footprint = st.getUInt16(); signer = st.getName(origin); signature = st.getBase64(); }
void rdataFromString(Tokenizer st, Name origin) throws IOException { String typeString = st.getString(); covered = Type.value(typeString); if (covered < 0) throw st.exception("Invalid type: " + typeString); String algString = st.getString(); alg = DNSSEC.Algorithm.value(algString); if (alg < 0) throw st.exception("Invalid algorithm: " + algString); labels = st.getUInt8(); origttl = st.getTTL(); expire = FormattedTime.parse(st.getString()); timeSigned = FormattedTime.parse(st.getString()); footprint = st.getUInt16(); signer = st.getName(origin); signature = st.getBase64(); }