Pepper_47_C_interfaces
ppb_host_resolver_private.h
Go to the documentation of this file.
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.
4  */
5 
6 /* From private/ppb_host_resolver_private.idl,
7  * modified Thu Oct 20 13:57:04 2016.
8  */
9 
10 #ifndef PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_
11 #define PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_
12 
13 #include "ppapi/c/pp_bool.h"
15 #include "ppapi/c/pp_instance.h"
16 #include "ppapi/c/pp_macros.h"
17 #include "ppapi/c/pp_resource.h"
18 #include "ppapi/c/pp_stdint.h"
19 #include "ppapi/c/pp_var.h"
21 
22 #define PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1 "PPB_HostResolver_Private;0.1"
23 #define PPB_HOSTRESOLVER_PRIVATE_INTERFACE \
24  PPB_HOSTRESOLVER_PRIVATE_INTERFACE_0_1
25 
26 /**
27  * @file
28  * This file defines the <code>PPB_HostResolver_Private</code> interface.
29  */
30 
31 
32 /**
33  * @addtogroup Enums
34  * @{
35  */
36 /**
37  * The <code>PP_HostResolver_Flags</code> is an enumeration of the
38  * different types of flags, that can be OR-ed and passed to host
39  * resolver.
40  */
41 typedef enum {
42  /**
43  * AI_CANONNAME
44  */
46  /**
47  * Hint to the resolver that only loopback addresses are configured.
48  */
52 /**
53  * @}
54  */
55 
56 /**
57  * @addtogroup Structs
58  * @{
59  */
62  int32_t flags;
63 };
65 /**
66  * @}
67  */
68 
69 /**
70  * @addtogroup Interfaces
71  * @{
72  */
74  /**
75  * Allocates a Host Resolver resource.
76  */
78  /**
79  * Determines if a given resource is a Host Resolver.
80  */
82  /**
83  * Creates a new request to Host Resolver. |callback| is invoked
84  * when request is processed and a list of network addresses is
85  * obtained. These addresses can be be used in Connect, Bind or
86  * Listen calls to connect to a given |host| and |port|.
87  */
88  int32_t (*Resolve)(PP_Resource host_resolver,
89  const char* host,
90  uint16_t port,
91  const struct PP_HostResolver_Private_Hint* hint,
92  struct PP_CompletionCallback callback);
93  /**
94  * Returns canonical name of host.
95  */
96  struct PP_Var (*GetCanonicalName)(PP_Resource host_resolver);
97  /**
98  * Returns number of network addresses obtained after Resolve call.
99  */
100  uint32_t (*GetSize)(PP_Resource host_resolver);
101  /**
102  * Stores in the |addr| |index|-th network address. |addr| can't be
103  * NULL. Returns PP_TRUE if success or PP_FALSE if the given
104  * resource is not a Host Resolver or |index| exceeds number of
105  * available addresses.
106  */
108  uint32_t index,
109  struct PP_NetAddress_Private* addr);
110 };
111 
113 /**
114  * @}
115  */
116 
117 #endif /* PPAPI_C_PRIVATE_PPB_HOST_RESOLVER_PRIVATE_H_ */
118 
PP_HostResolver_Private_Flags
struct PP_Var(* GetCanonicalName)(PP_Resource host_resolver)
uint32_t(* GetSize)(PP_Resource host_resolver)
PP_Resource(* Create)(PP_Instance instance)
int32_t PP_Resource
Definition: pp_resource.h:40
PP_NetAddressFamily_Private
PP_COMPILE_ASSERT_SIZE_IN_BYTES(PP_HostResolver_Private_Flags, 4)
Definition: pp_var.h:166
PP_Bool(* IsHostResolver)(PP_Resource resource)
PP_NetAddressFamily_Private family
int32_t PP_Instance
Definition: pp_instance.h:34
int32_t(* Resolve)(PP_Resource host_resolver, const char *host, uint16_t port, const struct PP_HostResolver_Private_Hint *hint, struct PP_CompletionCallback callback)
PP_Bool
Definition: pp_bool.h:30
PP_Bool(* GetNetAddress)(PP_Resource host_resolver, uint32_t index, struct PP_NetAddress_Private *addr)
PP_COMPILE_ASSERT_STRUCT_SIZE_IN_BYTES(PP_HostResolver_Private_Hint, 8)