public final class DnsResourceRecord extends Object implements Serializable
1 1 1 1 1 1 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | | / / / NAME / | | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | TYPE | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | CLASS | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | TTL | | | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | RDLENGTH | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--| / RDATA / / / +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Modifier and Type | Class and Description |
---|---|
static class |
DnsResourceRecord.Builder |
static interface |
DnsResourceRecord.DnsRData
The interface representing an RDATA.
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(Object obj) |
DnsResourceRecord.Builder |
getBuilder() |
DnsClass |
getDataClass() |
DnsResourceRecordType |
getDataType() |
DnsDomainName |
getName() |
byte[] |
getRawData() |
DnsResourceRecord.DnsRData |
getRData() |
short |
getRdLength() |
int |
getRdLengthAsInt() |
int |
getTtl() |
long |
getTtlAsLong() |
int |
hashCode() |
int |
length() |
static DnsResourceRecord |
newInstance(byte[] rawData,
int offset,
int length)
A static factory method.
|
String |
toString() |
String |
toString(String indent) |
String |
toString(String indent,
byte[] headerRawData) |
public static DnsResourceRecord newInstance(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 DnsDomainName getName()
public DnsResourceRecordType getDataType()
public DnsClass getDataClass()
public int getTtl()
public long getTtlAsLong()
public short getRdLength()
public int getRdLengthAsInt()
public DnsResourceRecord.DnsRData getRData()
public DnsResourceRecord.Builder getBuilder()
public byte[] getRawData()
public int length()
public String toString(String indent)
indent
- indentpublic String toString(String indent, byte[] headerRawData)
indent
- indentheaderRawData
- the raw data of the DNS header including this resource record.Copyright © 2011–2017 Pcap4J.org. All rights reserved.