Package io.netty.handler.codec.dns
Class DefaultDnsRecordDecoder
java.lang.Object
io.netty.handler.codec.dns.DefaultDnsRecordDecoder
- All Implemented Interfaces:
DnsRecordDecoder
The default
DnsRecordDecoder
implementation.- See Also:
-
Field Summary
FieldsFields inherited from interface io.netty.handler.codec.dns.DnsRecordDecoder
DEFAULT
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic String
decodeName
(ByteBuf in) Retrieves a domain name given a buffer containing a DNS packet.protected String
decodeName0
(ByteBuf in) Retrieves a domain name given a buffer containing a DNS packet.final DnsQuestion
Decodes a DNS question into its object representation.final <T extends DnsRecord>
TdecodeRecord
(ByteBuf in) Decodes a DNS record into its object representation.protected DnsRecord
decodeRecord
(String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf in, int offset, int length) Decodes a record from the information decoded so far bydecodeRecord(ByteBuf)
.
-
Field Details
-
ROOT
- See Also:
-
-
Constructor Details
-
DefaultDnsRecordDecoder
protected DefaultDnsRecordDecoder()Creates a new instance.
-
-
Method Details
-
decodeQuestion
Description copied from interface:DnsRecordDecoder
Decodes a DNS question into its object representation.- Specified by:
decodeQuestion
in interfaceDnsRecordDecoder
- Parameters:
in
- the input buffer which contains a DNS question at its reader index- Throws:
Exception
-
decodeRecord
Description copied from interface:DnsRecordDecoder
Decodes a DNS record into its object representation.- Specified by:
decodeRecord
in interfaceDnsRecordDecoder
- Parameters:
in
- the input buffer which contains a DNS record at its reader index- Returns:
- the decoded record, or
null
if there are not enough data in the input buffer - Throws:
Exception
-
decodeRecord
protected DnsRecord decodeRecord(String name, DnsRecordType type, int dnsClass, long timeToLive, ByteBuf in, int offset, int length) throws Exception Decodes a record from the information decoded so far bydecodeRecord(ByteBuf)
.- Parameters:
name
- the domain name of the recordtype
- the type of the recorddnsClass
- the class of the recordtimeToLive
- the TTL of the recordin
- theByteBuf
that contains the RDATAoffset
- the start offset of the RDATA inin
length
- the length of the RDATA- Returns:
- a
DnsRawRecord
. Override this method to decode RDATA and return other record implementation. - Throws:
Exception
-
decodeName0
Retrieves a domain name given a buffer containing a DNS packet. If the name contains a pointer, the position of the buffer will be set to directly after the pointer's index after the name has been read.- Parameters:
in
- the byte buffer containing the DNS packet- Returns:
- the domain name for an entry
-
decodeName
Retrieves a domain name given a buffer containing a DNS packet. If the name contains a pointer, the position of the buffer will be set to directly after the pointer's index after the name has been read.- Parameters:
in
- the byte buffer containing the DNS packet- Returns:
- the domain name for an entry
-