Package io.netty.handler.codec.dns
Class DefaultDnsOptEcsRecord
java.lang.Object
io.netty.handler.codec.dns.AbstractDnsRecord
io.netty.handler.codec.dns.AbstractDnsOptPseudoRrRecord
io.netty.handler.codec.dns.DefaultDnsOptEcsRecord
- All Implemented Interfaces:
DnsOptEcsRecord
,DnsOptPseudoRecord
,DnsRecord
public final class DefaultDnsOptEcsRecord
extends AbstractDnsOptPseudoRrRecord
implements DnsOptEcsRecord
Default
DnsOptEcsRecord
implementation.-
Field Summary
FieldsFields inherited from interface io.netty.handler.codec.dns.DnsRecord
CLASS_ANY, CLASS_CHAOS, CLASS_CSNET, CLASS_HESIOD, CLASS_IN, CLASS_NONE
-
Constructor Summary
ConstructorsConstructorDescriptionDefaultDnsOptEcsRecord
(int maxPayloadSize, int srcPrefixLength, byte[] address) Creates a new instance.DefaultDnsOptEcsRecord
(int maxPayloadSize, int extendedRcode, int version, int srcPrefixLength, byte[] address) Creates a new instance.DefaultDnsOptEcsRecord
(int maxPayloadSize, InternetProtocolFamily protocolFamily) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]
address()
Returns the bytes of theInetAddress
to use.int
Returns the leftmost number of significant bits of ADDRESS that the response covers.int
Returns the leftmost number of significant bits of ADDRESS to be used for the lookup.toString()
private static byte[]
verifyAddress
(byte[] bytes) Methods inherited from class io.netty.handler.codec.dns.AbstractDnsOptPseudoRrRecord
extendedRcode, flags, toStringBuilder, version
Methods inherited from class io.netty.handler.codec.dns.AbstractDnsRecord
dnsClass, equals, hashCode, name, timeToLive, type
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface io.netty.handler.codec.dns.DnsOptPseudoRecord
extendedRcode, flags, version
Methods inherited from interface io.netty.handler.codec.dns.DnsRecord
dnsClass, name, timeToLive, type
-
Field Details
-
srcPrefixLength
private final int srcPrefixLength -
address
private final byte[] address
-
-
Constructor Details
-
DefaultDnsOptEcsRecord
public DefaultDnsOptEcsRecord(int maxPayloadSize, int extendedRcode, int version, int srcPrefixLength, byte[] address) Creates a new instance.- Parameters:
maxPayloadSize
- the suggested max payload size in bytesextendedRcode
- the extended rcodeversion
- the versionsrcPrefixLength
- the prefix lengthaddress
- the bytes of theInetAddress
to use
-
DefaultDnsOptEcsRecord
public DefaultDnsOptEcsRecord(int maxPayloadSize, int srcPrefixLength, byte[] address) Creates a new instance.- Parameters:
maxPayloadSize
- the suggested max payload size in bytessrcPrefixLength
- the prefix lengthaddress
- the bytes of theInetAddress
to use
-
DefaultDnsOptEcsRecord
Creates a new instance.- Parameters:
maxPayloadSize
- the suggested max payload size in bytesprotocolFamily
- theInternetProtocolFamily
to use. This should be the same as the one used to send the query.
-
-
Method Details
-
verifyAddress
private static byte[] verifyAddress(byte[] bytes) -
sourcePrefixLength
public int sourcePrefixLength()Description copied from interface:DnsOptEcsRecord
Returns the leftmost number of significant bits of ADDRESS to be used for the lookup.- Specified by:
sourcePrefixLength
in interfaceDnsOptEcsRecord
-
scopePrefixLength
public int scopePrefixLength()Description copied from interface:DnsOptEcsRecord
Returns the leftmost number of significant bits of ADDRESS that the response covers. In queries, it MUST be 0.- Specified by:
scopePrefixLength
in interfaceDnsOptEcsRecord
-
address
public byte[] address()Description copied from interface:DnsOptEcsRecord
Returns the bytes of theInetAddress
to use.- Specified by:
address
in interfaceDnsOptEcsRecord
-
toString
- Overrides:
toString
in classAbstractDnsOptPseudoRrRecord
-