chromium/net/base/address_family.h

// Copyright 2010 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_BASE_ADDRESS_FAMILY_H_
#define NET_BASE_ADDRESS_FAMILY_H_

#include "net/base/net_export.h"

namespace net {

class IPAddress;

// Enum wrapper around the address family types supported by host resolver
// procedures.
enum AddressFamily {};

// HostResolverFlags is a bitflag enum used by host resolver procedures to
// determine the value of addrinfo.ai_flags and work around getaddrinfo
// peculiarities.
enum {};
HostResolverFlags;

// Returns AddressFamily for |address|.
NET_EXPORT AddressFamily GetAddressFamily(const IPAddress& address);

// Maps the given AddressFamily to either AF_INET, AF_INET6 or AF_UNSPEC.
NET_EXPORT int ConvertAddressFamily(AddressFamily address_family);

// Maps AF_INET, AF_INET6 or AF_UNSPEC to an AddressFamily.
NET_EXPORT AddressFamily ToAddressFamily(int family);

}  // namespace net

#endif  // NET_BASE_ADDRESS_FAMILY_H_