{{+bindTo:partials.standard_nacl_api}}
<h1>PPB_HostResolver Struct Reference</h1>
<div id="doxygen-ref">
{{- dummy div to appease doxygen -}}
<div>
<!-- Generated by Doxygen 1.7.6.1 -->
</div>
<!--header-->
<div class="contents">
<!-- doxytag: class="PPB_HostResolver" --><h2>
Data Fields</h2><table class="memberdecls">
<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>
<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>
<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>
<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>
<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>
<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>
</table>
<hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><p>The <code>PPB_HostResolver</code> interface supports host name resolution. </p>
<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>
</div><hr /><h2>Field Documentation</h2>
<a class="anchor" id="a7dfb4977c9bb0b3efb8016393e1adcc1"></a><!-- doxytag: member="PPB_HostResolver::Create" ref="a7dfb4977c9bb0b3efb8016393e1adcc1" args=")(PP_Instance instance)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<p>Creates a host resolver resource. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="a5edb535ad2bdc3db835ef7ec57f98f49"></a><!-- doxytag: member="PPB_HostResolver::GetCanonicalName" ref="a5edb535ad2bdc3db835ef7ec57f98f49" args=")(PP_Resource host_resolver)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the canonical name of the host. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="a7202ffb6c7b6d02da4ece9e748aaa886"></a><!-- doxytag: member="PPB_HostResolver::GetNetAddress" ref="a7202ffb6c7b6d02da4ece9e748aaa886" args=")(PP_Resource host_resolver, uint32_t index)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets a network address. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
<tr><td class="paramdir">[in]</td><td class="paramname">index</td><td>An index indicating which address to return.</td></tr>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="afe9dc8c673c2a12331eceaf60ecba911"></a><!-- doxytag: member="PPB_HostResolver::GetNetAddressCount" ref="afe9dc8c673c2a12331eceaf60ecba911" args=")(PP_Resource host_resolver)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<p>Gets the number of network addresses. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<a class="anchor" id="a26202fbec754f45ec43e1b7479f07365"></a><!-- doxytag: member="PPB_HostResolver::IsHostResolver" ref="a26202fbec754f45ec43e1b7479f07365" args=")(PP_Resource resource)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<p>Determines if a given resource is a host resolver. </p>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> to check.</td></tr>
</table>
</dd>
</dl>
<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>
</div>
</div>
<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)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<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>
</tr>
</table>
</div>
<div class="memdoc">
<p>Requests resolution of a host name. </p>
<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>
<dl class="params"><dt><b>Parameters:</b></dt><dd>
<table class="params">
<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>
<tr><td class="paramdir">[in]</td><td class="paramname">host</td><td>The host name (or IP address literal) to resolve. </td></tr>
<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>
<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>
<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>
</table>
</dd>
</dl>
<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>
</div>
</div>
<hr />The documentation for this struct was generated from the following file:<ul>
<li><a class="el" href="ppb__host__resolver_8h.html">ppb_host_resolver.h</a></li>
</ul>
</div><!-- contents -->
</div>
{{/partials.standard_nacl_api}}