chromium/net/dns/public/dns_query_type.h

// Copyright 2018 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef NET_DNS_PUBLIC_DNS_QUERY_TYPE_H_
#define NET_DNS_PUBLIC_DNS_QUERY_TYPE_H_

#include <string_view>

#include "base/containers/enum_set.h"
#include "base/containers/fixed_flat_map.h"
#include "net/base/net_export.h"

namespace net {

// DNS query type for HostResolver requests.
// See:
// https://www.iana.org/assignments/dns-parameters/dns-parameters.xhtml#dns-parameters-4
// CAUTION: When adding new entries, remember to update `MAX` and update
// kDnsQueryTypes below.
enum class DnsQueryType : uint8_t {};

DnsQueryTypeSet;

inline constexpr auto kDnsQueryTypes =;

// `true` iff `dns_query_type` is an address-resulting type, convertible to and
// from `net::AddressFamily`.
bool NET_EXPORT IsAddressType(DnsQueryType dns_query_type);

// `true` iff `dns_query_types` contains an address type. `dns_query_types` must
// be non-empty and must not contain `DnsQueryType::UNSPECIFIED`.
bool NET_EXPORT HasAddressType(DnsQueryTypeSet dns_query_types);

}  // namespace net

#endif  // NET_DNS_PUBLIC_DNS_QUERY_TYPE_H_