/** * True if this record has the same type as some other record. */ boolean sameType(DNSRecord other) { return this.getRecordType() == other.getRecordType(); }
/** * True if this record has the same type as some other record. */ boolean sameType(DNSRecord other) { return this.getRecordType() == other.getRecordType(); }
/** * True if this record has the same type as some other record. */ boolean sameType(DNSRecord other) { return this.getRecordType() == other.getRecordType(); }
/** * True if this record has the same type as some other record. */ boolean sameType(DNSRecord other) { return this.getRecordType() == other.getRecordType(); }
if (answer.getRecordType().equals(DNSRecordType.TYPE_A) || answer.getRecordType().equals(DNSRecordType.TYPE_AAAA)) { arecords.add(answer); } else {
switch (record.getRecordType()) { case TYPE_A: // IPv4 case TYPE_AAAA: // IPv6 if (DNSRecordType.TYPE_A.equals(record.getRecordType())) { final Inet4Address inet4Address = (Inet4Address) address.getAddress();
/** * Handle an incoming response. Cache answers, and pass them on to the appropriate questions. * * @exception IOException */ void handleResponse(DNSIncoming msg) throws IOException { final long now = System.currentTimeMillis(); boolean hostConflictDetected = false; boolean serviceConflictDetected = false; for (DNSRecord newRecord : msg.getAllAnswers()) { this.handleRecord(newRecord, now); if (DNSRecordType.TYPE_A.equals(newRecord.getRecordType()) || DNSRecordType.TYPE_AAAA.equals(newRecord.getRecordType())) { hostConflictDetected |= newRecord.handleResponse(this); } else { serviceConflictDetected |= newRecord.handleResponse(this); } } if (hostConflictDetected || serviceConflictDetected) { this.startProber(); } }
/** * Handle an incoming response. Cache answers, and pass them on to the appropriate questions. * * @exception IOException */ void handleResponse(DNSIncoming msg) throws IOException { final long now = System.currentTimeMillis(); boolean hostConflictDetected = false; boolean serviceConflictDetected = false; for (DNSRecord newRecord : msg.getAllAnswers()) { this.handleRecord(newRecord, now); if (DNSRecordType.TYPE_A.equals(newRecord.getRecordType()) || DNSRecordType.TYPE_AAAA.equals(newRecord.getRecordType())) { hostConflictDetected |= newRecord.handleResponse(this); } else { serviceConflictDetected |= newRecord.handleResponse(this); } } if (hostConflictDetected || serviceConflictDetected) { this.startProber(); } }
/** * Handle an incoming response. Cache answers, and pass them on to the appropriate questions. * * @exception IOException */ void handleResponse(DNSIncoming msg) throws IOException { final long now = System.currentTimeMillis(); boolean hostConflictDetected = false; boolean serviceConflictDetected = false; for (DNSRecord newRecord : msg.getAllAnswers()) { this.handleRecord(newRecord, now); if (DNSRecordType.TYPE_A.equals(newRecord.getRecordType()) || DNSRecordType.TYPE_AAAA.equals(newRecord.getRecordType())) { hostConflictDetected |= newRecord.handleResponse(this); } else { serviceConflictDetected |= newRecord.handleResponse(this); } } if (hostConflictDetected || serviceConflictDetected) { this.startProber(); } }
for (DNSEntry entry : dnsEntryLits) { final DNSRecord record = (DNSRecord) entry; if (record.getRecordType() == DNSRecordType.TYPE_SRV) { if (record.getKey().endsWith(loType)) {
/** * Handle an incoming response. Cache answers, and pass them on to the appropriate questions. * * @exception IOException */ void handleResponse(DNSIncoming msg) throws IOException { final long now = System.currentTimeMillis(); boolean hostConflictDetected = false; boolean serviceConflictDetected = false; List<DNSRecord> allAnswers = msg.getAllAnswers(); allAnswers = aRecordsLast(allAnswers); for (DNSRecord newRecord : allAnswers) { this.handleRecord(newRecord, now); if (DNSRecordType.TYPE_A.equals(newRecord.getRecordType()) || DNSRecordType.TYPE_AAAA.equals(newRecord.getRecordType())) { hostConflictDetected |= newRecord.handleResponse(this); } else { serviceConflictDetected |= newRecord.handleResponse(this); } } if (hostConflictDetected || serviceConflictDetected) { this.startProber(); } }
for (DNSEntry entry : dnsEntryLits) { final DNSRecord record = (DNSRecord) entry; if (record.getRecordType() == DNSRecordType.TYPE_SRV) { if (record.getKey().endsWith(loType)) {
for (DNSEntry entry : dnsEntryLits) { final DNSRecord record = (DNSRecord) entry; if (record.getRecordType() == DNSRecordType.TYPE_SRV) { if (record.getKey().endsWith(loType)) {
for (DNSEntry entry : dnsEntryLits) { final DNSRecord record = (DNSRecord) entry; if (record.getRecordType() == DNSRecordType.TYPE_SRV) { if (record.getKey().endsWith(loType)) {
if (DNSRecordType.TYPE_PTR.equals(rec.getRecordType()))
if (newRecord.getRecordType().equals(entry.getRecordType()) && newRecord.getRecordClass().equals(entry.getRecordClass()) && (entry != cachedRecord)) { ((DNSRecord) entry).setWillExpireSoon(now); if (newRecord.getRecordType() == DNSRecordType.TYPE_PTR) {
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }
void writeRecord(DNSRecord rec, long now) { writeName(rec.getName()); writeShort(rec.getRecordType().indexValue()); writeShort(rec.getRecordClass().indexValue() | ((rec.isUnique() && _out.isMulticast()) ? DNSRecordClass.CLASS_UNIQUE : 0)); writeInt((now == 0) ? rec.getTTL() : rec.getRemainingTTL(now)); // We need to take into account the 2 size bytes MessageOutputStream record = new MessageOutputStream(512, _out, _offset + this.size() + 2); rec.write(record); byte[] byteArray = record.toByteArray(); writeShort(byteArray.length); write(byteArray, 0, byteArray.length); }