本文整理了Java中org.xbill.DNS.Header.<init>()
方法的一些代码示例,展示了Header.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Header.<init>()
方法的具体详情如下:
包路径:org.xbill.DNS.Header
类名称:Header
方法名:<init>
暂无
代码示例来源:origin: dnsjava/dnsjava
/** Creates a new Message with a random Message ID */
public
Message() {
this(new Header());
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
/** Creates a new Message with a random Message ID */
public
Message() {
this(new Header());
}
代码示例来源:origin: tiandawu/IotXmpp
/** Creates a new Message with a random Message ID */
public
Message() {
this(new Header());
}
代码示例来源:origin: dnsjava/dnsjava
/** Creates a new Message with the specified Message ID */
public
Message(int id) {
this(new Header(id));
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
/** Creates a new Message with the specified Message ID */
public
Message(int id) {
this(new Header(id));
}
代码示例来源:origin: tiandawu/IotXmpp
/** Creates a new Message with the specified Message ID */
public
Message(int id) {
this(new Header(id));
}
代码示例来源:origin: org.littleshoot/dnsjava
/** Creates a new Message with the specified Message ID */
public
Message(int id) {
this(new Header(id));
}
代码示例来源:origin: org.littleshoot/dnsjava
/** Creates a new Message with a random Message ID */
public
Message() {
this(new Header());
}
代码示例来源:origin: org.littleshoot/dnsjava
public Object
clone() {
Header h = new Header();
h.id = id;
h.flags = flags;
System.arraycopy(counts, 0, h.counts, 0, counts.length);
return h;
}
代码示例来源:origin: dnsjava/dnsjava
public Object
clone() {
Header h = new Header();
h.id = id;
h.flags = flags;
System.arraycopy(counts, 0, h.counts, 0, counts.length);
return h;
}
代码示例来源:origin: tiandawu/IotXmpp
public Object
clone() {
Header h = new Header();
h.id = id;
h.flags = flags;
System.arraycopy(counts, 0, h.counts, 0, counts.length);
return h;
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
public Object
clone() {
Header h = new Header();
h.id = id;
h.flags = flags;
System.arraycopy(counts, 0, h.counts, 0, counts.length);
return h;
}
代码示例来源:origin: dnsjava/dnsjava
public byte []
formerrMessage(byte [] in) {
Header header;
try {
header = new Header(in);
}
catch (IOException e) {
return null;
}
return buildErrorMessage(header, Rcode.FORMERR, null);
}
代码示例来源:origin: OpenNMS/opennms
public byte[] formerrMessage(final byte[] in) {
try {
return buildErrorMessage(new Header(in), Rcode.FORMERR, null);
} catch (final IOException e) {
LOG.debug("unable to build error message", e);
return null;
}
}
代码示例来源:origin: org.echocat.jomon.net/common
public byte[] formerrMessage(byte[] in) {
final Header header;
try {
header = new Header(in);
} catch (final IOException ignored) {
return null;
}
return buildErrorMessage(header, Rcode.FORMERR, null);
}
代码示例来源:origin: org.jboss.resteasy/resteasy-eagledns-fork
byte[] formerrMessage(byte[] in) {
Header header;
try {
header = new Header(in);
} catch (IOException e) {
return null;
}
return buildErrorMessage(header, Rcode.FORMERR, null);
}
代码示例来源:origin: org.apache.hadoop/hadoop-yarn-registry
/**
* Creates a DNS error response.
*
* @param in the byte array detailing the error.
* @return the error message, in bytes
*/
public byte[] formErrorMessage(byte[] in) {
Header header;
try {
header = new Header(in);
} catch (IOException e) {
return null;
}
return buildErrorMessage(header, Rcode.FORMERR, null);
}
代码示例来源:origin: net.sf.dnsjava-osgi/dnsjava-osgi
Message(DNSInput in) throws IOException {
this(new Header(in));
boolean isUpdate = (header.getOpcode() == Opcode.UPDATE);
boolean truncated = header.getFlag(Flags.TC);
try {
for (int i = 0; i < 4; i++) {
int count = header.getCount(i);
if (count > 0)
sections[i] = new ArrayList(count);
for (int j = 0; j < count; j++) {
int pos = in.current();
Record rec = Record.fromWire(in, i, isUpdate);
sections[i].add(rec);
if (rec.getType() == Type.TSIG)
tsigstart = pos;
}
}
} catch (WireParseException e) {
if (!truncated)
throw e;
}
size = in.current();
}
代码示例来源:origin: org.littleshoot/dnsjava
Message(DNSInput in) throws IOException {
this(new Header(in));
boolean isUpdate = (header.getOpcode() == Opcode.UPDATE);
boolean truncated = header.getFlag(Flags.TC);
try {
for (int i = 0; i < 4; i++) {
int count = header.getCount(i);
if (count > 0)
sections[i] = new ArrayList(count);
for (int j = 0; j < count; j++) {
int pos = in.current();
Record rec = Record.fromWire(in, i, isUpdate);
sections[i].add(rec);
if (rec.getType() == Type.TSIG)
tsigstart = pos;
if (rec.getType() == Type.SIG &&
((SIGRecord) rec).getTypeCovered() == 0)
sig0start = pos;
}
}
} catch (WireParseException e) {
if (!truncated)
throw e;
}
size = in.current();
}
代码示例来源: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;
}
内容来源于网络,如有侵权,请联系作者删除!