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.AbstractHeader
Packet.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, contains, equals, get, getOuterOf, getPayload, getRawData, hashCode, iterator, length, toHexString, toString
public 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()
AbstractPacket
getHeader
in interface Packet
getHeader
in class AbstractPacket
public DnsPacket.Builder getBuilder()
Packet
getBuilder
in interface Packet
getBuilder
in class AbstractPacket
Copyright © 2011–2017 Pcap4J.org. All rights reserved.