1 /* Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 * Use of this source code is governed by a BSD-style license that can be
3 * found in the LICENSE file.
7 * This file defines the <code>PPB_HostResolver_Private</code> interface.
15 * The <code>PP_HostResolver_Flags</code> is an enumeration of the
16 * different types of flags, that can be OR-ed and passed to host
20 enum PP_HostResolver_Private_Flags
{
24 PP_HOST_RESOLVER_PRIVATE_FLAGS_CANONNAME
= 1 << 0,
26 * Hint to the resolver that only loopback addresses are configured.
28 PP_HOST_RESOLVER_PRIVATE_FLAGS_LOOPBACK_ONLY
= 1 << 1
32 struct PP_HostResolver_Private_Hint
{
33 PP_NetAddressFamily_Private family
;
37 interface PPB_HostResolver_Private
{
39 * Allocates a Host Resolver resource.
41 PP_Resource Create
([in] PP_Instance instance
);
44 * Determines if a given resource is a Host Resolver.
46 PP_Bool IsHostResolver
([in] PP_Resource resource
);
49 * Creates a new request to Host Resolver. |callback| is invoked
50 * when request is processed and a list of network addresses is
51 * obtained. These addresses can be be used in Connect, Bind or
52 * Listen calls to connect to a given |host| and |port|.
54 int32_t Resolve
([in] PP_Resource host_resolver
,
57 [in] PP_HostResolver_Private_Hint hint
,
58 [in] PP_CompletionCallback
callback);
61 * Returns canonical name of host.
63 PP_Var GetCanonicalName
([in] PP_Resource host_resolver
);
66 * Returns number of network addresses obtained after Resolve call.
68 uint32_t GetSize
([in] PP_Resource host_resolver
);
71 * Stores in the |addr| |index|-th network address. |addr| can't be
72 * NULL. Returns PP_TRUE if success or PP_FALSE if the given
73 * resource is not a Host Resolver or |index| exceeds number of
74 * available addresses.
76 PP_Bool GetNetAddress
([in] PP_Resource host_resolver
,
78 [out] PP_NetAddress_Private addr
);