Class DnsCodecUtil
java.lang.Object
io.netty.handler.codec.dns.DnsCodecUtil
final class DnsCodecUtil
extends java.lang.Object
-
Field Summary
FieldsModifier and TypeFieldDescription(package private) static final int(package private) static final int(package private) static final int(package private) static final int -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescription(package private) static intcalculateMaxNameLength(int readable) Returns the initial capacity to use for theStringBuilderthat accumulates a decoded domain name.(package private) static intcheckRecordCount(DnsSection section, int count) Ensures the record count of a section, as announced in the header of a DNS message, does not exceedMAX_RECORDS_PER_SECTION.(package private) static java.lang.String(package private) static ByteBufdecompressDomainName(ByteBuf compression) Decompress pointer data.(package private) static voidencodeDomainName(java.lang.String name, ByteBuf buf) (package private) static voidMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Field Details
-
MAX_DOMAIN_NAME_LENGTH
static final int MAX_DOMAIN_NAME_LENGTH- See Also:
-
MAX_TCP_MESSAGE_LENGTH
static final int MAX_TCP_MESSAGE_LENGTH- See Also:
-
MAX_COMPRESSION_POINTERS
static final int MAX_COMPRESSION_POINTERS- See Also:
-
MAX_RECORDS_PER_SECTION
static final int MAX_RECORDS_PER_SECTION- See Also:
-
-
Constructor Details
-
DnsCodecUtil
private DnsCodecUtil()
-
-
Method Details
-
setTcpMessageLength
-
encodeDomainName
-
calculateMaxNameLength
static int calculateMaxNameLength(int readable) Returns the initial capacity to use for theStringBuilderthat accumulates a decoded domain name. A decoded name can never exceedMAX_DOMAIN_NAME_LENGTHcharacters (see the check indecodeDomainName(ByteBuf)), so the capacity must not scale withreadable, the number of bytes left in the whole message: doing so would let a message with a huge amount of trailing data (e.g. many more records after this name) force an oversized allocation for every single name decoded from it. -
checkRecordCount
Ensures the record count of a section, as announced in the header of a DNS message, does not exceedMAX_RECORDS_PER_SECTION.- Throws:
TooLongFrameException- if the count is too large.
-
decodeDomainName
-
decompressDomainName
-