dnsMsg.getHeader().setFlag(Flags.QR); dnsMsg.getHeader().setRcode(Rcode.NOERROR); dnsMsg.addRecord(NEGATIVE_CACHE_SOA_RECORD, Section.AUTHORITY); handleDnsResponse(parsedPacket, dnsMsg.toWire());
private void applyEDNS(Message query) { if (queryOPT == null || query.getOPT() != null) return; query.addRecord(queryOPT, Section.ADDITIONAL); }
private void applyEDNS(Message query) { if (queryOPT == null || query.getOPT() != null) return; query.addRecord(queryOPT, Section.ADDITIONAL); }
private void applyEDNS(Message query) { if (queryOPT == null || query.getOPT() != null) return; query.addRecord(queryOPT, Section.ADDITIONAL); }
private final void addSOA(Message response, Zone zone) { response.addRecord(zone.getSOA(), Section.AUTHORITY); }
void doGlue(Tokenizer st) throws IOException { Record record = parseRR(st, defaultClass, defaultTTL); query.addRecord(record, Section.ADDITIONAL); print(record); }
/** * Generates a TSIG record with a specific error for a message and adds it * to the message. * @param m The message * @param error The error * @param old If this message is a response, the TSIG from the request */ public void apply(Message m, int error, TSIGRecord old) { Record r = generate(m, m.toWire(), error, old); m.addRecord(r, Section.ADDITIONAL); m.tsigState = Message.TSIG_SIGNED; }
void doAdd(Tokenizer st) throws IOException { Record record = parseRR(st, defaultClass, defaultTTL); query.addRecord(record, Section.UPDATE); print(record); }
/** * Generates a TSIG record with a specific error for a message and adds it * to the message. * @param m The message * @param error The error * @param old If this message is a response, the TSIG from the request */ public void apply(Message m, int error, TSIGRecord old) { Record r = generate(m, m.toWire(), error, old); m.addRecord(r, Section.ADDITIONAL); m.tsigState = Message.TSIG_SIGNED; }
/** * Generates a TSIG record with a specific error for a message and adds it * to the message. * @param m The message * @param error The error * @param old If this message is a response, the TSIG from the request */ public void apply(Message m, int error, TSIGRecord old) { Record r = generate(m, m.toWire(), error, old); m.addRecord(r, Section.ADDITIONAL); m.tsigState = Message.TSIG_SIGNED; }
private final void addCacheNS(final Message response, final Cache cache, final Name name) { final SetResponse sr = cache.lookupRecords(name, Type.NS, Credibility.HINT); if (!sr.isDelegation()) return; final RRset nsRecords = sr.getNS(); @SuppressWarnings("unchecked") final Iterator<Record> it = nsRecords.rrs(); while (it.hasNext()) { final Record r = it.next(); response.addRecord(r, Section.AUTHORITY); } }
private final void addCacheNS(Message response, Cache cache, Name name) { SetResponse sr = cache.lookupRecords(name, Type.NS, Credibility.HINT); if (!sr.isDelegation()) return; RRset nsRecords = sr.getNS(); Iterator it = nsRecords.rrs(); while (it.hasNext()) { Record r = (Record) it.next(); response.addRecord(r, Section.AUTHORITY); } }
private void addCacheNS(Message response, Cache cache, Name name) { final SetResponse sr = cache.lookupRecords(name, Type.NS, Credibility.HINT); if (!sr.isDelegation()) { return; } final RRset nsRecords = sr.getNS(); final Iterator<?> it = nsRecords.rrs(); while (it.hasNext()) { final Record r = (Record) it.next(); response.addRecord(r, Section.AUTHORITY); } }
/** * Creates a new Message with a random Message ID suitable for sending as a * query. * @param r A record containing the question */ public static Message newQuery(Record r) { Message m = new Message(); m.header.setOpcode(Opcode.QUERY); m.header.setFlag(Flags.RD); m.addRecord(r, Section.QUESTION); return m; }
/** * Creates a new Message with a random Message ID suitable for sending as a * query. * @param r A record containing the question */ public static Message newQuery(Record r) { Message m = new Message(); m.header.setOpcode(Opcode.QUERY); m.header.setFlag(Flags.RD); m.addRecord(r, Section.QUESTION); return m; }
/** * Creates a new Message with a random Message ID suitable for sending as a * query. * @param r A record containing the question */ public static Message newQuery(Record r) { Message m = new Message(); m.header.setOpcode(Opcode.QUERY); m.header.setFlag(Flags.RD); m.addRecord(r, Section.QUESTION); return m; }
byte[] buildErrorMessage(final Header header, final int rcode, final Record question) { final Message response = new Message(); response.setHeader(header); for (int i = 0; i < 4; i++) response.removeAllRecords(i); if (rcode == Rcode.SERVFAIL) response.addRecord(question, Section.QUESTION); header.setRcode(rcode); return response.toWire(); }
byte [] buildErrorMessage(Header header, int rcode, Record question) { Message response = new Message(); response.setHeader(header); for (int i = 0; i < 4; i++) response.removeAllRecords(i); if (rcode == Rcode.SERVFAIL) response.addRecord(question, Section.QUESTION); header.setRcode(rcode); return response.toWire(); }
byte[] buildErrorMessage(Header header, int rcode, Record question) { final Message response = new Message(); response.setHeader(header); for (int i = 0; i < 4; i++) { response.removeAllRecords(i); } if (rcode == Rcode.SERVFAIL) { response.addRecord(question, Section.QUESTION); } header.setRcode(rcode); return response.toWire(); }
private byte[] buildErrorMessage(Header header, int rcode, Record question) { Message response = new Message(); response.setHeader(header); for (int i = 0; i < 4; i++) { response.removeAllRecords(i); } if (rcode == Rcode.SERVFAIL) { response.addRecord(question, Section.QUESTION); } header.setRcode(rcode); return response.toWire(); }