static Record fromWire(DNSInput in, int section) throws IOException { return fromWire(in, section, false); }
static Record fromWire(DNSInput in, int section) throws IOException { return fromWire(in, section, false); }
static Record fromWire(DNSInput in, int section) throws IOException { return fromWire(in, section, false); }
static Record fromWire(DNSInput in, int section) throws IOException { return fromWire(in, section, false); }
/** * Builds a Record from DNS uncompressed wire format. */ public static Record fromWire(byte [] b, int section) throws IOException { return fromWire(new DNSInput(b), section, false); }
/** * Builds a Record from DNS uncompressed wire format. */ public static Record fromWire(byte [] b, int section) throws IOException { return fromWire(new DNSInput(b), section, false); }
/** * Builds a Record from DNS uncompressed wire format. */ public static Record fromWire(byte [] b, int section) throws IOException { return fromWire(new DNSInput(b), section, false); }
/** * Builds a Record from DNS uncompressed wire format. */ public static Record fromWire(byte [] b, int section) throws IOException { return fromWire(new DNSInput(b), section, false); }
Message(DNSInput in) throws IOException { this(new Header(in)); boolean isUpdate = (header.getOpcode() == Opcode.UPDATE); boolean truncated = header.getFlag(Flags.TC); try { for (int i = 0; i < 4; i++) { int count = header.getCount(i); if (count > 0) sections[i] = new ArrayList(count); for (int j = 0; j < count; j++) { int pos = in.current(); Record rec = Record.fromWire(in, i, isUpdate); sections[i].add(rec); if (rec.getType() == Type.TSIG) tsigstart = pos; } } } catch (WireParseException e) { if (!truncated) throw e; } size = in.current(); }
Message(DNSInput in) throws IOException { this(new Header(in)); boolean isUpdate = (header.getOpcode() == Opcode.UPDATE); boolean truncated = header.getFlag(Flags.TC); try { for (int i = 0; i < 4; i++) { int count = header.getCount(i); if (count > 0) sections[i] = new ArrayList(count); for (int j = 0; j < count; j++) { int pos = in.current(); Record rec = Record.fromWire(in, i, isUpdate); sections[i].add(rec); if (rec.getType() == Type.TSIG) tsigstart = pos; if (rec.getType() == Type.SIG && ((SIGRecord) rec).getTypeCovered() == 0) sig0start = pos; } } } catch (WireParseException e) { if (!truncated) throw e; } size = in.current(); }
for (int j = 0; j < count; j++) { int pos = in.current(); Record rec = Record.fromWire(in, i, isUpdate); sections[i].add(rec); if (i == Section.ADDITIONAL) {
for (int j = 0; j < count; j++) { int pos = in.current(); Record rec = Record.fromWire(in, i, isUpdate); sections[i].add(rec); if (i == Section.ADDITIONAL) {
/** * Converts a raw wire transfer format of a record to a DNS record. * @param data The raw byte stream of a record in wire transfer format. * @return A DNSRecord converted from the wire format. * @throws IOException */ public static DNSRecord fromWire(byte[] data) throws IOException { Record rec = Record.fromWire(data, Section.ANSWER); DNSRecord retVal = new DNSRecord(); retVal.setDclass(rec.getDClass()); retVal.setName(rec.getName().toString()); retVal.setData(rec.rdataToWireCanonical()); retVal.setTtl(rec.getTTL()); retVal.setType(rec.getType()); return retVal; } }
/** * Converts a raw wire transfer format of a record to a DNS record. * @param data The raw byte stream of a record in wire transfer format. * @return A DNSRecord converted from the wire format. * @throws IOException */ public static DNSRecord fromWire(byte[] data) throws IOException { Record rec = Record.fromWire(data, Section.ANSWER); DNSRecord retVal = new DNSRecord(); retVal.setDclass(rec.getDClass()); retVal.setName(rec.getName().toString()); retVal.setData(rec.rdataToWireCanonical()); retVal.setTtl(rec.getTTL()); retVal.setType(rec.getType()); return retVal; } }