public final class DnsPacket extends AbstractPacket
| Modifier and Type | Class and Description |
|---|---|
static class |
DnsPacket.Builder |
static class |
DnsPacket.DnsHeader
DNS header
+---------------------+
| Header |
+---------------------+
| Question | the question for the name server
+---------------------+
| Answer | RRs answering the question
+---------------------+
| Authority | RRs pointing toward an authority
+---------------------+
| Additional | RRs holding additional information
+---------------------+
Header:
1 1 1 1 1 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ID |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
|QR| Opcode |AA|TC|RD|RA| Z|AD|CD| RCODE |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| QDCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ANCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| NSCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
| ARCOUNT |
+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ |
AbstractPacket.AbstractBuilder, AbstractPacket.AbstractHeaderPacket.Header| Modifier and Type | Method and Description |
|---|---|
DnsPacket.Builder |
getBuilder()
Returns a new Builder object populated with this object's fields' values.
|
DnsPacket.DnsHeader |
getHeader()
Returns the Header object representing this packet's header.
|
static DnsPacket |
newPacket(byte[] rawData,
int offset,
int length)
A static factory method.
|
buildHexString, buildRawData, buildString, calcHashCode, calcLength, equals, getPayload, getRawData, hashCode, length, toHexString, toStringclone, finalize, getClass, notify, notifyAll, wait, wait, waitcontains, get, getOuterOf, iteratorpublic static DnsPacket newPacket(byte[] rawData, int offset, int length) throws IllegalRawDataException
ByteArrays.validateBounds(byte[], int, int),
which may throw exceptions undocumented here.rawData - rawDataoffset - offsetlength - lengthIllegalRawDataException - if parsing the raw data fails.public DnsPacket.DnsHeader getHeader()
AbstractPacketgetHeader in interface PacketgetHeader in class AbstractPacketpublic DnsPacket.Builder getBuilder()
PacketgetBuilder in interface PacketgetBuilder in class AbstractPacketCopyright © 2011 - 2018 Pcap4J.org. All rights reserved.