public class CookieOption extends EDNSOption
EDNSOption.Code
Modifier and Type | Field and Description |
---|---|
private byte[] |
clientCookie
client cookie
|
private byte[] |
serverCookie
server cookie
|
Constructor and Description |
---|
CookieOption()
Default constructor for constructing instance from binary representation.
|
CookieOption(byte[] clientCookie)
Constructor.
|
CookieOption(byte[] clientCookie,
byte[] serverCookie)
Constructor.
|
Modifier and Type | Method and Description |
---|---|
byte[] |
getClientCookie()
Returns the client cookie.
|
java.util.Optional<byte[]> |
getServerCookie()
Returns the server cookie.
|
(package private) void |
optionFromWire(DNSInput in)
Converts the wire format of an EDNS Option (the option data only) into the type-specific
format.
|
(package private) java.lang.String |
optionToString()
Returns a string representation of the option parameters
|
(package private) void |
optionToWire(DNSOutput out)
Converts an EDNS Option (the type-specific option data only) into wire format.
|
private byte[] clientCookie
private byte[] serverCookie
CookieOption()
public CookieOption(byte[] clientCookie)
clientCookie
- the client cookie, which must consist of eight bytespublic CookieOption(byte[] clientCookie, byte[] serverCookie)
clientCookie
- the client cookie, which must consist of eight bytesserverCookie
- the server cookie, which must consist of 8 to 32 bytes if presentpublic byte[] getClientCookie()
public java.util.Optional<byte[]> getServerCookie()
void optionFromWire(DNSInput in) throws java.io.IOException
optionFromWire
in class EDNSOption
in
- The input stream.java.io.IOException
void optionToWire(DNSOutput out)
optionToWire
in class EDNSOption
out
- The output stream.java.lang.String optionToString()
optionToString
in class EDNSOption