本文整理了Java中org.xbill.DNS.Header.setRcode()
方法的一些代码示例,展示了Header.setRcode()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header.setRcode()
方法的具体详情如下:
包路径:org.xbill.DNS.Header
类名称:Header
方法名:setRcode
暂无
代码示例来源:origin: julian-klode/dns66
Log.i(TAG, "handleDnsRequest: DNS Name " + dnsQueryName + " Blocked!");
dnsMsg.getHeader().setFlag(Flags.QR);
dnsMsg.getHeader().setRcode(Rcode.NOERROR);
dnsMsg.addRecord(NEGATIVE_CACHE_SOA_RECORD, Section.AUTHORITY);
handleDnsResponse(parsedPacket, dnsMsg.toWire());
代码示例来源:origin: posicks/mdnsjava
/**
* {@inheritDoc}
*/
protected void writeResponse(final Message message)
throws IOException
{
if (mdnsVerbose)
{
logger.logp(Level.INFO, getClass().getName(), "writeResponse", "Writing Response to " + multicastAddress.getHostAddress() + ":" + port);
}
Header header = message.getHeader();
header.setFlag(Flags.AA);
header.setFlag(Flags.QR);
header.setRcode(0);
writeMessageToWire(message/* , true */);
}
代码示例来源: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();
}
代码示例来源:origin: posicks/mdnsjava
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;
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry
/**
* Create an error message.
*
* @param header the response header.
* @param rcode the response code.
* @param question the question record.
* @return the error message.
*/
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);
}
response.addRecord(question, Section.QUESTION);
header.setRcode(rcode);
return response.toWire();
}
代码示例来源:origin: posicks/mdnsjava
if ((messages != null) && (messages.length > 0))
header.setRcode(Rcode.NOERROR);
header.setOpcode(Opcode.QUERY);
header.setFlag(Flags.QR);
header.setRcode(Rcode.NXDOMAIN);
代码示例来源:origin: org.nhind/dns
/**
* Processes a DNS error condition and creates an appropriate DNS response.
* @param request The original DNS request.
* @param error The error condition that occured.
* @return A response to the DNS request.
*/
protected Message processError(Message request, DNSError<?> error)
{
Message errorResponse = null;
try
{
Header respHeader = new Header(request.toWire());
Message response = new Message();
response.setHeader(respHeader);
for (int i = 0; i < 4; i++)
response.removeAllRecords(i);
response.addRecord(request.getQuestion(), Section.QUESTION);
response.getHeader().setFlag(Flags.QR);
if (request.getHeader().getFlag(Flags.RD))
response.getHeader().setFlag(Flags.RD);
respHeader.setRcode(Integer.parseInt(error.getError().toString()));
return response;
}
catch (IOException e) {}
return errorResponse;
}
代码示例来源:origin: posicks/mdnsjava
header.setRcode(Rcode.NXDOMAIN);
if (response.isSuccessful())
header.setRcode(Rcode.NOERROR);
header.setOpcode(Opcode.QUERY);
header.setFlag(Flags.QR);
header.setRcode(Rcode.NXDOMAIN);
if (response.isSuccessful())
header.setRcode(Rcode.NOERROR);
header.setOpcode(Opcode.QUERY);
header.setFlag(Flags.QR);
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry
response.getHeader().setRcode(Rcode.NXDOMAIN);
if (isDNSSECEnabled()) {
try {
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry
if (rcode != Rcode.NOERROR) {
rcode = remoteLookup(response, name, type, 0);
response.getHeader().setRcode(rcode);
代码示例来源:origin: org.jboss.resteasy/resteasy-eagledns-fork
response.getHeader().setRcode(Rcode.NXDOMAIN);
if (zone != null) {
addSOA(response, zone);
代码示例来源:origin: OpenNMS/opennms
response.getHeader().setRcode(Rcode.NXDOMAIN);
if (zone != null) {
addSOA(response, zone);
代码示例来源:origin: dnsjava/dnsjava
response.getHeader().setRcode(Rcode.NXDOMAIN);
if (zone != null) {
addSOA(response, zone);
代码示例来源:origin: org.echocat.jomon.net/common
response.getHeader().setRcode(Rcode.NXDOMAIN);
if (zone != null) {
addSOA(response, zone);
内容来源于网络,如有侵权,请联系作者删除!