Class DefaultDnsOptCookieRecord
java.lang.Object
io.netty.handler.codec.dns.AbstractDnsRecord
io.netty.handler.codec.dns.AbstractDnsOptPseudoRrRecord
io.netty.handler.codec.dns.DefaultDnsOptCookieRecord
- All Implemented Interfaces:
DnsOptCookieRecord, DnsOptPseudoRecord, DnsRecord
public final class DefaultDnsOptCookieRecord
extends AbstractDnsOptPseudoRrRecord
implements DnsOptCookieRecord
Default
DnsOptCookieRecord implementation.-
Field Summary
Fields inherited from interface DnsOptCookieRecord
CLIENT_COOKIE_LENGTH, OPTION_CODEModifier and TypeFieldDescriptionstatic final intThe length of a client cookie in bytes.static final intTheOPTION-CODEthat is assigned toCOOKIE.Fields inherited from interface DnsRecord
CLASS_ANY, CLASS_CHAOS, CLASS_CSNET, CLASS_HESIOD, CLASS_IN, CLASS_NONEModifier and TypeFieldDescriptionstatic final intDNS resource record class:ANYstatic final intDNS resource record class:CHAOSstatic final intDNS resource record class:CSNETstatic final intDNS resource record class:HESIODstatic final intDNS resource record class:INstatic final intDNS resource record class:NONE -
Constructor Summary
ConstructorsConstructorDescriptionDefaultDnsOptCookieRecord(int maxPayloadSize, byte[] clientCookie) Creates a new instance. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the client cookie, which is alwaysDnsOptCookieRecord.CLIENT_COOKIE_LENGTHbytes long.Methods inherited from class AbstractDnsOptPseudoRrRecord
extendedRcode, flags, toString, versionModifier and TypeMethodDescriptionintReturns theEXTENDED-RCODEwhich is encoded intoDnsRecord.timeToLive().intflags()Returns the 16-bitflagsfield which is encoded into the lower 16 bits ofDnsRecord.timeToLive(), as laid out by RFC 6891.toString()intversion()Returns theVERSIONwhich is encoded intoDnsRecord.timeToLive().Methods inherited from class AbstractDnsRecord
dnsClass, equals, hashCode, name, timeToLive, type
-
Constructor Details
-
DefaultDnsOptCookieRecord
public DefaultDnsOptCookieRecord(int maxPayloadSize, byte[] clientCookie) Creates a new instance.- Parameters:
maxPayloadSize- the suggested max payload size in bytesclientCookie- the client cookie, must be exactlyDnsOptCookieRecord.CLIENT_COOKIE_LENGTHbytes
-
-
Method Details
-
clientCookie
public byte[] clientCookie()Description copied from interface:DnsOptCookieRecordReturns the client cookie, which is alwaysDnsOptCookieRecord.CLIENT_COOKIE_LENGTHbytes long. The returned array is a copy.- Specified by:
clientCookiein interfaceDnsOptCookieRecord
-