1 {{+bindTo:partials.standard_nacl_api}} 2 <h1>PPB_HostResolver Struct Reference</h1> 3 <div id="doxygen-ref"> 4 {{- dummy div to appease doxygen -}} 5 <div> 6 <!-- Generated by Doxygen 1.7.6.1 --> 7 8 9 </div> 10 <!--header--> 11 <div class="contents"> 12 <!-- doxytag: class="PPB_HostResolver" --><h2> 13 Data Fields</h2><table class="memberdecls"> 14 15 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a7dfb4977c9bb0b3efb8016393e1adcc1">Create</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td></tr> 16 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a26202fbec754f45ec43e1b7479f07365">IsHostResolver</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr> 17 <tr><td class="memItemLeft" align="right" valign="top">int32_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea">Resolve</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver, const char *host, uint16_t port, const struct <a class="el" href="struct_p_p___host_resolver___hint.html">PP_HostResolver_Hint</a> *hint, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td></tr> 18 <tr><td class="memItemLeft" align="right" valign="top">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a5edb535ad2bdc3db835ef7ec57f98f49">GetCanonicalName</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver)</td></tr> 19 <tr><td class="memItemLeft" align="right" valign="top">uint32_t(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___host_resolver__1__0.html#afe9dc8c673c2a12331eceaf60ecba911">GetNetAddressCount</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver)</td></tr> 20 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a7202ffb6c7b6d02da4ece9e748aaa886">GetNetAddress</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver, uint32_t index)</td></tr> 21 </table> 22 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2> 23 <div class="textblock"><p>The <code>PPB_HostResolver</code> interface supports host name resolution. </p> 24 <p>Permissions: In order to run <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code>, apps permission <code>socket</code> with subrule <code>resolve-host</code> is required. For more details about network communication permissions, please see: <a href="http://developer.chrome.com/apps/app_network.html">http://developer.chrome.com/apps/app_network.html</a> </p> 25 </div><hr /><h2>Field Documentation</h2> 26 <a class="anchor" id="a7dfb4977c9bb0b3efb8016393e1adcc1"></a><!-- doxytag: member="PPB_HostResolver::Create" ref="a7dfb4977c9bb0b3efb8016393e1adcc1" args=")(PP_Instance instance)" --> 27 <div class="memitem"> 28 <div class="memproto"> 29 <table class="memname"> 30 <tr> 31 <td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___host_resolver__1__0.html#a7dfb4977c9bb0b3efb8016393e1adcc1">PPB_HostResolver::Create</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance)</td> 32 </tr> 33 </table> 34 </div> 35 <div class="memdoc"> 36 <p>Creates a host resolver resource. </p> 37 <dl class="params"><dt><b>Parameters:</b></dt><dd> 38 <table class="params"> 39 <tr><td class="paramdir">[in]</td><td class="paramname">instance</td><td>A <code>PP_Instance</code> identifying one instance of a module.</td></tr> 40 </table> 41 </dd> 42 </dl> 43 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> corresponding to a host reslover or 0 on failure. </dd></dl> 44 </div> 45 </div> 46 <a class="anchor" id="a5edb535ad2bdc3db835ef7ec57f98f49"></a><!-- doxytag: member="PPB_HostResolver::GetCanonicalName" ref="a5edb535ad2bdc3db835ef7ec57f98f49" args=")(PP_Resource host_resolver)" --> 47 <div class="memitem"> 48 <div class="memproto"> 49 <table class="memname"> 50 <tr> 51 <td class="memname">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* <a class="el" href="struct_p_p_b___host_resolver__1__0.html#a5edb535ad2bdc3db835ef7ec57f98f49">PPB_HostResolver::GetCanonicalName</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver)<code> [read]</code></td> 52 </tr> 53 </table> 54 </div> 55 <div class="memdoc"> 56 <p>Gets the canonical name of the host. </p> 57 <dl class="params"><dt><b>Parameters:</b></dt><dd> 58 <table class="params"> 59 <tr><td class="paramdir">[in]</td><td class="paramname">host_resolver</td><td>A <code>PP_Resource</code> corresponding to a host resolver.</td></tr> 60 </table> 61 </dd> 62 </dl> 63 <dl class="return"><dt><b>Returns:</b></dt><dd>A string <code><a class="el" href="struct_p_p___var.html" title="The PP_VAR struct is a variant data type and can contain any value of one of the types named in the P...">PP_Var</a></code> on success, which is an empty string if <code>PP_HOSTRESOLVER_FLAG_CANONNAME</code> is not set in the hint flags when calling <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code>; an undefined <code><a class="el" href="struct_p_p___var.html" title="The PP_VAR struct is a variant data type and can contain any value of one of the types named in the P...">PP_Var</a></code> if there is a pending <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code> call or the previous <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code> call failed. </dd></dl> 64 </div> 65 </div> 66 <a class="anchor" id="a7202ffb6c7b6d02da4ece9e748aaa886"></a><!-- doxytag: member="PPB_HostResolver::GetNetAddress" ref="a7202ffb6c7b6d02da4ece9e748aaa886" args=")(PP_Resource host_resolver, uint32_t index)" --> 67 <div class="memitem"> 68 <div class="memproto"> 69 <table class="memname"> 70 <tr> 71 <td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___host_resolver__1__0.html#a7202ffb6c7b6d02da4ece9e748aaa886">PPB_HostResolver::GetNetAddress</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver, uint32_t index)</td> 72 </tr> 73 </table> 74 </div> 75 <div class="memdoc"> 76 <p>Gets a network address. </p> 77 <dl class="params"><dt><b>Parameters:</b></dt><dd> 78 <table class="params"> 79 <tr><td class="paramdir">[in]</td><td class="paramname">host_resolver</td><td>A <code>PP_Resource</code> corresponding to a host resolver. </td></tr> 80 <tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>An index indicating which address to return.</td></tr> 81 </table> 82 </dd> 83 </dl> 84 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PPB_NetAddress</code> resource on success; 0 if there is a pending <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code> call or the previous <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code> call failed, or the specified index is out of range. </dd></dl> 85 </div> 86 </div> 87 <a class="anchor" id="afe9dc8c673c2a12331eceaf60ecba911"></a><!-- doxytag: member="PPB_HostResolver::GetNetAddressCount" ref="afe9dc8c673c2a12331eceaf60ecba911" args=")(PP_Resource host_resolver)" --> 88 <div class="memitem"> 89 <div class="memproto"> 90 <table class="memname"> 91 <tr> 92 <td class="memname">uint32_t(* <a class="el" href="struct_p_p_b___host_resolver__1__0.html#afe9dc8c673c2a12331eceaf60ecba911">PPB_HostResolver::GetNetAddressCount</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver)</td> 93 </tr> 94 </table> 95 </div> 96 <div class="memdoc"> 97 <p>Gets the number of network addresses. </p> 98 <dl class="params"><dt><b>Parameters:</b></dt><dd> 99 <table class="params"> 100 <tr><td class="paramdir">[in]</td><td class="paramname">host_resolver</td><td>A <code>PP_Resource</code> corresponding to a host resolver.</td></tr> 101 </table> 102 </dd> 103 </dl> 104 <dl class="return"><dt><b>Returns:</b></dt><dd>The number of available network addresses on success; 0 if there is a pending <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code> call or the previous <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea" title="Requests resolution of a host name.">Resolve()</a></code> call failed. </dd></dl> 105 </div> 106 </div> 107 <a class="anchor" id="a26202fbec754f45ec43e1b7479f07365"></a><!-- doxytag: member="PPB_HostResolver::IsHostResolver" ref="a26202fbec754f45ec43e1b7479f07365" args=")(PP_Resource resource)" --> 108 <div class="memitem"> 109 <div class="memproto"> 110 <table class="memname"> 111 <tr> 112 <td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___host_resolver__1__0.html#a26202fbec754f45ec43e1b7479f07365">PPB_HostResolver::IsHostResolver</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td> 113 </tr> 114 </table> 115 </div> 116 <div class="memdoc"> 117 <p>Determines if a given resource is a host resolver. </p> 118 <dl class="params"><dt><b>Parameters:</b></dt><dd> 119 <table class="params"> 120 <tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> to check.</td></tr> 121 </table> 122 </dd> 123 </dl> 124 <dl class="return"><dt><b>Returns:</b></dt><dd><code>PP_TRUE</code> if the input is a <code>PPB_HostResolver</code> resource; <code>PP_FALSE</code> otherwise. </dd></dl> 125 </div> 126 </div> 127 <a class="anchor" id="a006c54c355fc4258fc1c9e75e8861dea"></a><!-- doxytag: member="PPB_HostResolver::Resolve" ref="a006c54c355fc4258fc1c9e75e8861dea" args=")(PP_Resource host_resolver, const char *host, uint16_t port, const struct PP_HostResolver_Hint *hint, struct PP_CompletionCallback callback)" --> 128 <div class="memitem"> 129 <div class="memproto"> 130 <table class="memname"> 131 <tr> 132 <td class="memname">int32_t(* <a class="el" href="struct_p_p_b___host_resolver__1__0.html#a006c54c355fc4258fc1c9e75e8861dea">PPB_HostResolver::Resolve</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> host_resolver, const char *host, uint16_t port, const struct <a class="el" href="struct_p_p___host_resolver___hint.html">PP_HostResolver_Hint</a> *hint, struct <a class="el" href="struct_p_p___completion_callback.html">PP_CompletionCallback</a> callback)</td> 133 </tr> 134 </table> 135 </div> 136 <div class="memdoc"> 137 <p>Requests resolution of a host name. </p> 138 <p>If the call completes successfully, the results can be retrieved by <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a5edb535ad2bdc3db835ef7ec57f98f49" title="Gets the canonical name of the host.">GetCanonicalName()</a></code>, <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#afe9dc8c673c2a12331eceaf60ecba911" title="Gets the number of network addresses.">GetNetAddressCount()</a></code> and <code><a class="el" href="struct_p_p_b___host_resolver__1__0.html#a7202ffb6c7b6d02da4ece9e748aaa886" title="Gets a network address.">GetNetAddress()</a></code>.</p> 139 <dl class="params"><dt><b>Parameters:</b></dt><dd> 140 <table class="params"> 141 <tr><td class="paramdir">[in]</td><td class="paramname">host_resolver</td><td>A <code>PP_Resource</code> corresponding to a host resolver. </td></tr> 142 <tr><td class="paramdir">[in]</td><td class="paramname">host</td><td>The host name (or IP address literal) to resolve. </td></tr> 143 <tr><td class="paramdir">[in]</td><td class="paramname">port</td><td>The port number to be set in the resulting network addresses. </td></tr> 144 <tr><td class="paramdir">[in]</td><td class="paramname">hint</td><td>A <code><a class="el" href="struct_p_p___host_resolver___hint.html" title="PP_HostResolver_Hint represents hints for host resolution.">PP_HostResolver_Hint</a></code> structure providing hints for host resolution. </td></tr> 145 <tr><td class="paramdir">[in]</td><td class="paramname">callback</td><td>A <code><a class="el" href="struct_p_p___completion_callback.html" title="PP_CompletionCallback is a common mechanism for supporting potentially asynchronous calls in browser ...">PP_CompletionCallback</a></code> to be called upon completion.</td></tr> 146 </table> 147 </dd> 148 </dl> 149 <dl class="return"><dt><b>Returns:</b></dt><dd>An int32_t containing an error code from <code><a class="el" href="pp__errors_8h.html" title="This file defines an enumeration of all PPAPI error codes.">pp_errors.h</a></code>. <code>PP_ERROR_NOACCESS</code> will be returned if the caller doesn't have required permissions. <code>PP_ERROR_NAME_NOT_RESOLVED</code> will be returned if the host name couldn't be resolved. </dd></dl> 150 </div> 151 </div> 152 <hr />The documentation for this struct was generated from the following file:<ul> 153 <li><a class="el" href="ppb__host__resolver_8h.html">ppb_host_resolver.h</a></li> 154 </ul> 155 </div><!-- contents --> 156 </div> 157 {{/partials.standard_nacl_api}} 158