Class DefaultDnsOptEcsRecord

    • Field Detail

      • srcPrefixLength

        private final int srcPrefixLength
      • address

        private final byte[] address
    • Constructor Detail

      • DefaultDnsOptEcsRecord

        public DefaultDnsOptEcsRecord​(int maxPayloadSize,
                                      int extendedRcode,
                                      int version,
                                      int srcPrefixLength,
                                      byte[] address)
        Creates a new instance.
        Parameters:
        maxPayloadSize - the suggested max payload size in bytes
        extendedRcode - the extended rcode
        version - the version
        srcPrefixLength - the prefix length
        address - the bytes of the InetAddress to use
      • DefaultDnsOptEcsRecord

        public DefaultDnsOptEcsRecord​(int maxPayloadSize,
                                      int srcPrefixLength,
                                      byte[] address)
        Creates a new instance.
        Parameters:
        maxPayloadSize - the suggested max payload size in bytes
        srcPrefixLength - the prefix length
        address - the bytes of the InetAddress to use
      • DefaultDnsOptEcsRecord

        public DefaultDnsOptEcsRecord​(int maxPayloadSize,
                                      InternetProtocolFamily protocolFamily)
        Creates a new instance.
        Parameters:
        maxPayloadSize - the suggested max payload size in bytes
        protocolFamily - the InternetProtocolFamily to use. This should be the same as the one used to send the query.
    • Method Detail

      • verifyAddress

        private static byte[] verifyAddress​(byte[] bytes)
      • sourcePrefixLength

        public int sourcePrefixLength()
        Description copied from interface: DnsOptEcsRecord
        Returns the leftmost number of significant bits of ADDRESS to be used for the lookup.
        Specified by:
        sourcePrefixLength in interface DnsOptEcsRecord
      • scopePrefixLength

        public int scopePrefixLength()
        Description copied from interface: DnsOptEcsRecord
        Returns the leftmost number of significant bits of ADDRESS that the response covers. In queries, it MUST be 0.
        Specified by:
        scopePrefixLength in interface DnsOptEcsRecord
      • address

        public byte[] address()
        Description copied from interface: DnsOptEcsRecord
        Returns the bytes of the InetAddress to use.
        Specified by:
        address in interface DnsOptEcsRecord