Package org.xbill.DNS

Class CookieOption

java.lang.Object
org.xbill.DNS.EDNSOption
org.xbill.DNS.CookieOption
All Implemented Interfaces:
Serializable

public class CookieOption extends EDNSOption
Cookie EDNS0 Option.
See Also:
  • Field Details

    • clientCookie

      private byte[] clientCookie
      client cookie
    • serverCookie

      private byte[] serverCookie
      server 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 bytes
      serverCookie - 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

      public Optional<byte[]> getServerCookie()
      Returns the server cookie.
      Returns:
      the server cookie
    • optionFromWire

      void optionFromWire(DNSInput in) throws IOException
      Converts the wire format of an EDNS Option (the option data only) into the type-specific format.
      Specified by:
      optionFromWire in class EDNSOption
      Parameters:
      in - The input stream.
      Throws:
      IOException
    • optionToWire

      void optionToWire(DNSOutput out)
      Converts an EDNS Option (the type-specific option data only) into wire format.
      Specified by:
      optionToWire in class EDNSOption
      Parameters:
      out - The output stream.
    • optionToString

      String optionToString()
      Returns a string representation of the option parameters
      Specified by:
      optionToString in class EDNSOption
      Returns:
      the string representation