本文整理了Java中org.xbill.DNS.Message.addRecord()
方法的一些代码示例,展示了Message.addRecord()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Message.addRecord()
方法的具体详情如下:
包路径:org.xbill.DNS.Message
类名称:Message
方法名:addRecord
暂无
代码示例来源:origin: julian-klode/dns66
dnsMsg.getHeader().setFlag(Flags.QR);
dnsMsg.getHeader().setRcode(Rcode.NOERROR);
dnsMsg.addRecord(NEGATIVE_CACHE_SOA_RECORD, Section.AUTHORITY);
handleDnsResponse(parsedPacket, dnsMsg.toWire());
代码示例来源:origin: dnsjava/dnsjava
private void
applyEDNS(Message query) {
if (queryOPT == null || query.getOPT() != null)
return;
query.addRecord(queryOPT, Section.ADDITIONAL);
}
代码示例来源:origin: org.littleshoot/dnsjava
private void
applyEDNS(Message query) {
if (queryOPT == null || query.getOPT() != null)
return;
query.addRecord(queryOPT, Section.ADDITIONAL);
}
代码示例来源:origin: tiandawu/IotXmpp
private void
applyEDNS(Message query) {
if (queryOPT == null || query.getOPT() != null)
return;
query.addRecord(queryOPT, Section.ADDITIONAL);
}
代码示例来源:origin: dnsjava/dnsjava
private final void
addSOA(Message response, Zone zone) {
response.addRecord(zone.getSOA(), Section.AUTHORITY);
}
代码示例来源:origin: dnsjava/dnsjava
void
doGlue(Tokenizer st) throws IOException {
Record record = parseRR(st, defaultClass, defaultTTL);
query.addRecord(record, Section.ADDITIONAL);
print(record);
}
代码示例来源:origin: dnsjava/dnsjava
/**
* 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;
}
代码示例来源:origin: dnsjava/dnsjava
void
doAdd(Tokenizer st) throws IOException {
Record record = parseRR(st, defaultClass, defaultTTL);
query.addRecord(record, Section.UPDATE);
print(record);
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
/**
* 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;
}
代码示例来源:origin: tiandawu/IotXmpp
/**
* 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;
}
代码示例来源:origin: OpenNMS/opennms
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);
}
}
代码示例来源:origin: dnsjava/dnsjava
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);
}
}
代码示例来源:origin: org.echocat.jomon.net/common
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);
}
}
代码示例来源:origin: org.littleshoot/dnsjava
/**
* 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;
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
/**
* 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;
}
代码示例来源:origin: tiandawu/IotXmpp
/**
* 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;
}
代码示例来源:origin: OpenNMS/opennms
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();
}
代码示例来源:origin: dnsjava/dnsjava
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();
}
代码示例来源:origin: org.echocat.jomon.net/common
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();
}
代码示例来源:origin: org.jboss.resteasy/resteasy-eagledns-fork
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();
}
内容来源于网络,如有侵权,请联系作者删除!