@UnstableApi public final class DefaultDnsOptEcsRecord extends AbstractDnsOptPseudoRrRecord implements DnsOptEcsRecord
DnsOptEcsRecord implementation.| Modifier and Type | Field and Description |
|---|---|
private byte[] |
address |
private int |
srcPrefixLength |
CLASS_ANY, CLASS_CHAOS, CLASS_CSNET, CLASS_HESIOD, CLASS_IN, CLASS_NONE| Constructor and Description |
|---|
DefaultDnsOptEcsRecord(int maxPayloadSize,
int srcPrefixLength,
byte[] address)
Creates a new instance.
|
DefaultDnsOptEcsRecord(int maxPayloadSize,
InternetProtocolFamily protocolFamily)
Creates a new instance.
|
DefaultDnsOptEcsRecord(int maxPayloadSize,
int extendedRcode,
int version,
int srcPrefixLength,
byte[] address)
Creates a new instance.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
address()
Returns the bytes of the
InetAddress to use. |
int |
scopePrefixLength()
Returns the leftmost number of significant bits of ADDRESS that the response covers.
|
int |
sourcePrefixLength()
Returns the leftmost number of significant bits of ADDRESS to be used for the lookup.
|
java.lang.String |
toString() |
private static byte[] |
verifyAddress(byte[] bytes) |
extendedRcode, flags, toStringBuilder, versiondnsClass, equals, hashCode, name, timeToLive, typeclone, finalize, getClass, notify, notifyAll, wait, wait, waitextendedRcode, flags, versiondnsClass, name, timeToLive, typepublic DefaultDnsOptEcsRecord(int maxPayloadSize,
int extendedRcode,
int version,
int srcPrefixLength,
byte[] address)
maxPayloadSize - the suggested max payload size in bytesextendedRcode - the extended rcodeversion - the versionsrcPrefixLength - the prefix lengthaddress - the bytes of the InetAddress to usepublic DefaultDnsOptEcsRecord(int maxPayloadSize,
int srcPrefixLength,
byte[] address)
maxPayloadSize - the suggested max payload size in bytessrcPrefixLength - the prefix lengthaddress - the bytes of the InetAddress to usepublic DefaultDnsOptEcsRecord(int maxPayloadSize,
InternetProtocolFamily protocolFamily)
maxPayloadSize - the suggested max payload size in bytesprotocolFamily - the InternetProtocolFamily to use. This should be the same as the one used to
send the query.private static byte[] verifyAddress(byte[] bytes)
public int sourcePrefixLength()
DnsOptEcsRecordsourcePrefixLength in interface DnsOptEcsRecordpublic int scopePrefixLength()
DnsOptEcsRecordscopePrefixLength in interface DnsOptEcsRecordpublic byte[] address()
DnsOptEcsRecordInetAddress to use.address in interface DnsOptEcsRecordpublic java.lang.String toString()
toString in class AbstractDnsOptPseudoRrRecord