public final class DnsDomainName extends Object implements Serializable
labels: 1 len 1 len +-------+-------+-//-+-------+-------+-------+-//-+-------+--//--+-------+ | len | label | len | label | |len (0)| +-------+-------+-//-+-------+-------+-------+-//-+-------+--//--+-------+ pointer: +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+ | 1 1| OFFSET | +--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+--+
Modifier and Type | Class and Description |
---|---|
static class |
DnsDomainName.Builder |
Modifier and Type | Field and Description |
---|---|
static DnsDomainName |
ROOT_DOMAIN
The root domain (zero)
|
Modifier and Type | Method and Description |
---|---|
String |
decompress(byte[] headerRawData) |
boolean |
equals(Object obj) |
DnsDomainName.Builder |
getBuilder() |
List<String> |
getLabels() |
String |
getName() |
Short |
getPointer() |
Integer |
getPointerAsInt() |
byte[] |
getRawData() |
int |
hashCode() |
int |
length() |
static DnsDomainName |
newInstance(byte[] rawData,
int offset,
int length)
A static factory method.
|
String |
toString() |
String |
toString(byte[] headerRawData)
Convert this object to string representation including all fields info and decompressed domain
name.
|
public static final DnsDomainName ROOT_DOMAIN
public static DnsDomainName 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 String getName()
public Short getPointer()
public Integer getPointerAsInt()
public String decompress(byte[] headerRawData) throws IllegalRawDataException
headerRawData
- the raw data of the DNS header including this domain name.IllegalRawDataException
- if an error occurred during decompression
or circular reference is detected.public DnsDomainName.Builder getBuilder()
public byte[] getRawData()
public int length()
public String toString(byte[] headerRawData)
headerRawData
- the raw data of the DNS header including this domain name.Copyright © 2011–2018 Pcap4J.org. All rights reserved.