public Message newMessage() { Message msg = new Message(); msg.getHeader().setOpcode(Opcode.UPDATE); return msg; }
/** * 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; }
/** * 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; }
public static Message newQueryResponse(final Record[] records, final int section) { Message message = new Message(); Header header = message.getHeader(); header.setRcode(Rcode.NOERROR); header.setOpcode(Opcode.QUERY); header.setFlag(Flags.QR); for (int index = 0; index < records.length; index++) { message.addRecord(records[index], section); } return message; }
/** * Creates an update message. * @param zone The name of the zone being updated. * @param dclass The class of the zone being updated. */ public Update(Name zone, int dclass) { super(); if (!zone.isAbsolute()) throw new RelativeNameException(zone); DClass.check(dclass); getHeader().setOpcode(Opcode.UPDATE); Record soa = Record.newRecord(zone, Type.SOA, DClass.IN); addRecord(soa, Section.QUESTION); this.origin = zone; this.dclass = dclass; }
/** * Creates an update message. * @param zone The name of the zone being updated. * @param dclass The class of the zone being updated. */ public Update(Name zone, int dclass) { super(); if (!zone.isAbsolute()) throw new RelativeNameException(zone); DClass.check(dclass); getHeader().setOpcode(Opcode.UPDATE); Record soa = Record.newRecord(zone, Type.SOA, DClass.IN); addRecord(soa, Section.QUESTION); this.origin = zone; this.dclass = dclass; }
/** * Creates an update message. * @param zone The name of the zone being updated. * @param dclass The class of the zone being updated. */ public Update(Name zone, int dclass) { super(); if (!zone.isAbsolute()) throw new RelativeNameException(zone); DClass.check(dclass); getHeader().setOpcode(Opcode.UPDATE); Record soa = Record.newRecord(zone, Type.SOA, DClass.IN); addRecord(soa, Section.QUESTION); this.origin = zone; this.dclass = dclass; }
/** * Creates an update message. * @param zone The name of the zone being updated. * @param dclass The class of the zone being updated. */ public Update(Name zone, int dclass) { super(); if (!zone.isAbsolute()) throw new RelativeNameException(zone); DClass.check(dclass); getHeader().setOpcode(Opcode.UPDATE); Record soa = Record.newRecord(zone, Type.SOA, DClass.IN); addRecord(soa, Section.QUESTION); this.origin = zone; this.dclass = dclass; }
protected Message convertUpdateToQueryResponse(final Message update) { Message m = new Message(); Header h = m.getHeader(); h.setOpcode(Opcode.QUERY); h.setFlag(Flags.AA); h.setFlag(Flags.QR); Record[] records = update.getSectionArray(Section.UPDATE); for (int index = 0; index < records.length; index++ ) { m.addRecord(records[index], Section.ANSWER); } records = update.getSectionArray(Section.ADDITIONAL); for (int index = 0; index < records.length; index++ ) { m.addRecord(records[index], Section.ADDITIONAL); } return m; }
header.setOpcode(Opcode.QUERY); header.setFlag(Flags.QR);
private void sendQuery() throws IOException { Record question = Record.newRecord(zname, qtype, dclass); Message query = new Message(); query.getHeader().setOpcode(Opcode.QUERY); query.addRecord(question, Section.QUESTION); if (qtype == Type.IXFR) { Record soa = new SOARecord(zname, dclass, 0, Name.root, Name.root, ixfr_serial, 0, 0, 0, 0); query.addRecord(soa, Section.AUTHORITY); } if (tsig != null) { tsig.apply(query, null); verifier = new TSIG.StreamVerifier(tsig, query.getTSIG()); } byte [] out = query.toWire(Message.MAXLENGTH); client.send(out); }
private void sendQuery() throws IOException { Record question = Record.newRecord(zname, qtype, dclass); Message query = new Message(); query.getHeader().setOpcode(Opcode.QUERY); query.addRecord(question, Section.QUESTION); if (qtype == Type.IXFR) { Record soa = new SOARecord(zname, dclass, 0, Name.root, Name.root, ixfr_serial, 0, 0, 0, 0); query.addRecord(soa, Section.AUTHORITY); } if (tsig != null) { tsig.apply(query, null); verifier = new TSIG.StreamVerifier(tsig, query.getTSIG()); } byte [] out = query.toWire(Message.MAXLENGTH); client.send(out); }
private void sendQuery() throws IOException { Record question = Record.newRecord(zname, qtype, dclass); Message query = new Message(); query.getHeader().setOpcode(Opcode.QUERY); query.addRecord(question, Section.QUESTION); if (qtype == Type.IXFR) { Record soa = new SOARecord(zname, dclass, 0, Name.root, Name.root, ixfr_serial, 0, 0, 0, 0); query.addRecord(soa, Section.AUTHORITY); } if (tsig != null) { tsig.apply(query, null); verifier = new TSIG.StreamVerifier(tsig, query.getTSIG()); } byte [] out = query.toWire(Message.MAXLENGTH); client.send(out); }
private void sendQuery() throws IOException { Record question = Record.newRecord(zname, qtype, dclass); Message query = new Message(); query.getHeader().setOpcode(Opcode.QUERY); query.addRecord(question, Section.QUESTION); if (qtype == Type.IXFR) { Record soa = new SOARecord(zname, dclass, 0, Name.root, Name.root, ixfr_serial, 0, 0, 0, 0); query.addRecord(soa, Section.AUTHORITY); } if (tsig != null) { tsig.apply(query, null); verifier = new TSIG.StreamVerifier(tsig, query.getTSIG()); } byte [] out = query.toWire(Message.MAXLENGTH); client.send(out); }