| Index: ppapi/c/private/ppb_host_resolver_private.h
|
| diff --git a/ppapi/c/private/ppb_host_resolver_private.h b/ppapi/c/private/ppb_host_resolver_private.h
|
| new file mode 100644
|
| index 0000000000000000000000000000000000000000..60098025fbd039dcbde294fc02749fc4b970903e
|
| --- /dev/null
|
| +++ b/ppapi/c/private/ppb_host_resolver_private.h
|
| @@ -0,0 +1,116 @@
|
| +/* Copyright (c) 2012 The Chromium Authors. All rights reserved.
|
| + * Use of this source code is governed by a BSD-style license that can be
|
| + * found in the LICENSE file.
|
| + */
|
| +
|
| +/* From private/ppb_host_resolver_private.idl,
|
| + * modified Fri Feb 17 11:20:04 2012.
|
| + */
|
| +
|
| +#ifndef PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_
|
| +#define PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_
|
| +
|
| +#include "ppapi/c/pp_bool.h"
|
| +#include "ppapi/c/pp_completion_callback.h"
|
| +#include "ppapi/c/pp_instance.h"
|
| +#include "ppapi/c/pp_macros.h"
|
| +#include "ppapi/c/pp_resource.h"
|
| +#include "ppapi/c/pp_stdint.h"
|
| +#include "ppapi/c/pp_var.h"
|
| +#include "ppapi/c/private/ppb_net_address_private.h"
|
| +
|
| +#define PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1 "PPB_HostResolver_Private;0.1"
|
| +#define PPB_HOSTRESOLVER_PRIVATE_INTERFACE \
|
| + PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1
|
| +
|
| +/**
|
| + * @file
|
| + * This file defines the <code>PPB_HostResolver_Private</code> interface.
|
| + */
|
| +
|
| +
|
| +/**
|
| + * @addtogroup Enums
|
| + * @{
|
| + */
|
| +/**
|
| + * The <code>PP_HostResolver_Flags</code> is an enumeration of the
|
| + * different types of flags, that can be OR-ed and passed to host
|
| + * resolver.
|
| + */
|
| +typedef enum {
|
| + /**
|
| + * AI_CANONNAME
|
| + */
|
| + PP_HOST_RESOLVER_FLAGS_CANONNAME = 1 << 0,
|
| + /**
|
| + * Hint to the resolver that only loopback addresses are configured.
|
| + */
|
| + PP_HOST_RESOLVER_FLAGS_LOOPBACK_ONLY = 1 << 1
|
| +} PP_HostResolver_Private_Flags;
|
| +PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_HostResolver_Private_Flags, 4);
|
| +/**
|
| + * @}
|
| + */
|
| +
|
| +/**
|
| + * @addtogroup Structs
|
| + * @{
|
| + */
|
| +struct PP_HostResolver_Private_Hint {
|
| + PP_NetAddressFamily_Private family;
|
| + PP_HostResolver_Private_Flags flags;
|
| +};
|
| +PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_HostResolver_Private_Hint, 8);
|
| +/**
|
| + * @}
|
| + */
|
| +
|
| +/**
|
| + * @addtogroup Interfaces
|
| + * @{
|
| + */
|
| +struct PPB_HostResolver_Private_0_1 {
|
| + /**
|
| + * Allocates a Host Resolver resource.
|
| + */
|
| + PP_Resource (*Create)(PP_Instance instance);
|
| + /**
|
| + * Determines if a given resource is a Host Resolver.
|
| + */
|
| + PP_Bool (*IsHostResolver)(PP_Resource resource);
|
| + /**
|
| + * Creates a new request to Host Resolver. |callback| is invoked
|
| + * when request is processed and a list of network addresses is
|
| + * obtained. These addresses can be be used in Connect, Bind or
|
| + * Listen calls to connect to a given |host| and |port|.
|
| + */
|
| + int32_t (*Resolve)(PP_Resource host_resolver,
|
| + const char* host,
|
| + uint16_t port,
|
| + const struct PP_HostResolver_Private_Hint* hint,
|
| + struct PP_CompletionCallback callback);
|
| + /**
|
| + * Returns number of network addresses obtained after Resolve call.
|
| + */
|
| + uint32_t (*GetSize)(PP_Resource host_resolver);
|
| + /**
|
| + * Stores in the |canonname| and |addr| |index|-th canonical name of
|
| + * host and network address. |canonname| or |addr| can be NULL and
|
| + * in this case corresponding value not stored. Returns PP_TRUE if
|
| + * success or PP_FALSE if given resource is not a Host Resolver or
|
| + * |index| exceeds number of available addresses.
|
| + */
|
| + PP_Bool (*GetItem)(PP_Resource host_resolver,
|
| + uint32_t index,
|
| + struct PP_Var* canonname,
|
| + struct PP_NetAddress_Private* addr);
|
| +};
|
| +
|
| +typedef struct PPB_HostResolver_Private_0_1 PPB_HostResolver_Private;
|
| +/**
|
| + * @}
|
| + */
|
| +
|
| +#endif /* PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_ */
|
| +
|
|
|