Package org.xbill.DNS
Class CookieOption
java.lang.Object
org.xbill.DNS.EDNSOption
org.xbill.DNS.CookieOption
- All Implemented Interfaces:
Serializable
Cookie EDNS0 Option.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class org.xbill.DNS.EDNSOption
EDNSOption.Code -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate byte[]client cookieprivate byte[]server cookie -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor for constructing instance from binary representation.CookieOption(byte[] clientCookie) Constructor.CookieOption(byte[] clientCookie, byte[] serverCookie) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbyte[]Returns the client cookie.Optional<byte[]> Returns the server cookie.(package private) voidConverts the wire format of an EDNS Option (the option data only) into the type-specific format.(package private) StringReturns a string representation of the option parameters(package private) voidoptionToWire(DNSOutput out) Converts an EDNS Option (the type-specific option data only) into wire format.
-
Field Details
-
clientCookie
private byte[] clientCookieclient cookie -
serverCookie
private byte[] serverCookieserver cookie
-
-
Constructor Details
-
CookieOption
CookieOption()Default constructor for constructing instance from binary representation. -
CookieOption
public CookieOption(byte[] clientCookie) Constructor.- Parameters:
clientCookie- the client cookie, which must consist of eight bytes
-
CookieOption
public CookieOption(byte[] clientCookie, byte[] serverCookie) Constructor.- Parameters:
clientCookie- the client cookie, which must consist of eight bytesserverCookie- the server cookie, which must consist of 8 to 32 bytes if present
-
-
Method Details
-
getClientCookie
public byte[] getClientCookie()Returns the client cookie.- Returns:
- the client cookie
-
getServerCookie
Returns the server cookie.- Returns:
- the server cookie
-
optionFromWire
Converts the wire format of an EDNS Option (the option data only) into the type-specific format.- Specified by:
optionFromWirein classEDNSOption- Parameters:
in- The input stream.- Throws:
IOException
-
optionToWire
Converts an EDNS Option (the type-specific option data only) into wire format.- Specified by:
optionToWirein classEDNSOption- Parameters:
out- The output stream.
-
optionToString
String optionToString()Returns a string representation of the option parameters- Specified by:
optionToStringin classEDNSOption- Returns:
- the string representation
-