1 {{+bindTo:partials.standard_nacl_article}}
2 <h1>PPB_NetAddress Struct Reference</h1>
4 <!-- Generated by Doxygen 1.7.6.1 -->
10 <!-- doxytag: class="PPB_NetAddress" --><h2>
11 Data Fields</h2><table class="memberdecls">
13 <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___net_address__1__0.html#a82fab17541bec1817622932f102afdf9">CreateFromIPv4Address</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, const struct <a class="el" href="struct_p_p___net_address___i_pv4.html">PP_NetAddress_IPv4</a> *ipv4_addr)</td></tr>
14 <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___net_address__1__0.html#a7531096a8ddbda89e83b1b57958337df">CreateFromIPv6Address</a> )(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, const struct <a class="el" href="struct_p_p___net_address___i_pv6.html">PP_NetAddress_IPv6</a> *ipv6_addr)</td></tr>
15 <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___net_address__1__0.html#a13f63cdfe4ee93b2539f73ec23739422">IsNetAddress</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td></tr>
16 <tr><td class="memItemLeft" align="right" valign="top"><a class="el" href="group___enums.html#ga43636bcadf9aa312a4c345d210ae6c55">PP_NetAddress_Family</a>(* </td><td class="memItemRight" valign="bottom"><a class="el" href="struct_p_p_b___net_address__1__0.html#a139a1f09d00f0dcfce2eaad70af24124">GetFamily</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr)</td></tr>
17 <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___net_address__1__0.html#a7552e536b89cc3aa4415f41a5c7ee7ee">DescribeAsString</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> include_port)</td></tr>
18 <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___net_address__1__0.html#af04c1b08407b0db414d796d2c733f0c0">DescribeAsIPv4Address</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr, struct <a class="el" href="struct_p_p___net_address___i_pv4.html">PP_NetAddress_IPv4</a> *ipv4_addr)</td></tr>
19 <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___net_address__1__0.html#a613670dcb447c3c32c2b39c8faa14b88">DescribeAsIPv6Address</a> )(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr, struct <a class="el" href="struct_p_p___net_address___i_pv6.html">PP_NetAddress_IPv6</a> *ipv6_addr)</td></tr>
21 <hr /><a name="details" id="details"></a><h2>Detailed Description</h2>
22 <div class="textblock"><p>The <code>PPB_NetAddress</code> interface provides operations on network addresses. </p>
23 </div><hr /><h2>Field Documentation</h2>
24 <a class="anchor" id="a82fab17541bec1817622932f102afdf9"></a><!-- doxytag: member="PPB_NetAddress::CreateFromIPv4Address" ref="a82fab17541bec1817622932f102afdf9" args=")(PP_Instance instance, const struct PP_NetAddress_IPv4 *ipv4_addr)" -->
26 <div class="memproto">
27 <table class="memname">
29 <td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___net_address__1__0.html#a82fab17541bec1817622932f102afdf9">PPB_NetAddress::CreateFromIPv4Address</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, const struct <a class="el" href="struct_p_p___net_address___i_pv4.html">PP_NetAddress_IPv4</a> *ipv4_addr)</td>
34 <p>Creates a <code>PPB_NetAddress</code> resource with the specified IPv4 address. </p>
35 <dl class="params"><dt><b>Parameters:</b></dt><dd>
36 <table class="params">
37 <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>
38 <tr><td class="paramdir">[in]</td><td class="paramname">ipv4_addr</td><td>An IPv4 address.</td></tr>
42 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> representing the same address as <code>ipv4_addr</code> or 0 on failure. </dd></dl>
45 <a class="anchor" id="a7531096a8ddbda89e83b1b57958337df"></a><!-- doxytag: member="PPB_NetAddress::CreateFromIPv6Address" ref="a7531096a8ddbda89e83b1b57958337df" args=")(PP_Instance instance, const struct PP_NetAddress_IPv6 *ipv6_addr)" -->
47 <div class="memproto">
48 <table class="memname">
50 <td class="memname"><a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a>(* <a class="el" href="struct_p_p_b___net_address__1__0.html#a7531096a8ddbda89e83b1b57958337df">PPB_NetAddress::CreateFromIPv6Address</a>)(<a class="el" href="group___typedefs.html#ga89b662403e6a687bb914b80114c0d19d">PP_Instance</a> instance, const struct <a class="el" href="struct_p_p___net_address___i_pv6.html">PP_NetAddress_IPv6</a> *ipv6_addr)</td>
55 <p>Creates a <code>PPB_NetAddress</code> resource with the specified IPv6 address. </p>
56 <dl class="params"><dt><b>Parameters:</b></dt><dd>
57 <table class="params">
58 <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>
59 <tr><td class="paramdir">[in]</td><td class="paramname">ipv6_addr</td><td>An IPv6 address.</td></tr>
63 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Resource</code> representing the same address as <code>ipv6_addr</code> or 0 on failure. </dd></dl>
66 <a class="anchor" id="af04c1b08407b0db414d796d2c733f0c0"></a><!-- doxytag: member="PPB_NetAddress::DescribeAsIPv4Address" ref="af04c1b08407b0db414d796d2c733f0c0" args=")(PP_Resource addr, struct PP_NetAddress_IPv4 *ipv4_addr)" -->
68 <div class="memproto">
69 <table class="memname">
71 <td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___net_address__1__0.html#af04c1b08407b0db414d796d2c733f0c0">PPB_NetAddress::DescribeAsIPv4Address</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr, struct <a class="el" href="struct_p_p___net_address___i_pv4.html">PP_NetAddress_IPv4</a> *ipv4_addr)</td>
76 <p>Fills a <code><a class="el" href="struct_p_p___net_address___i_pv4.html" title="All members are expressed in network byte order.">PP_NetAddress_IPv4</a></code> structure if the network address is of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family. </p>
77 <p>Note that passing a network address of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family will fail even if the address is an IPv4-mapped IPv6 address.</p>
78 <dl class="params"><dt><b>Parameters:</b></dt><dd>
79 <table class="params">
80 <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>A <code>PP_Resource</code> corresponding to a network address. </td></tr>
81 <tr><td class="paramdir">[out]</td><td class="paramname">ipv4_addr</td><td>A <code><a class="el" href="struct_p_p___net_address___i_pv4.html" title="All members are expressed in network byte order.">PP_NetAddress_IPv4</a></code> structure to store the result.</td></tr>
85 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> value indicating whether the operation succeeded. </dd></dl>
88 <a class="anchor" id="a613670dcb447c3c32c2b39c8faa14b88"></a><!-- doxytag: member="PPB_NetAddress::DescribeAsIPv6Address" ref="a613670dcb447c3c32c2b39c8faa14b88" args=")(PP_Resource addr, struct PP_NetAddress_IPv6 *ipv6_addr)" -->
90 <div class="memproto">
91 <table class="memname">
93 <td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___net_address__1__0.html#a613670dcb447c3c32c2b39c8faa14b88">PPB_NetAddress::DescribeAsIPv6Address</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr, struct <a class="el" href="struct_p_p___net_address___i_pv6.html">PP_NetAddress_IPv6</a> *ipv6_addr)</td>
98 <p>Fills a <code><a class="el" href="struct_p_p___net_address___i_pv6.html" title="All members are expressed in network byte order.">PP_NetAddress_IPv6</a></code> structure if the network address is of <code>PP_NETADDRESS_FAMILY_IPV6</code> address family. </p>
99 <p>Note that passing a network address of <code>PP_NETADDRESS_FAMILY_IPV4</code> address family will fail - this method doesn't map it to an IPv6 address.</p>
100 <dl class="params"><dt><b>Parameters:</b></dt><dd>
101 <table class="params">
102 <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>A <code>PP_Resource</code> corresponding to a network address. </td></tr>
103 <tr><td class="paramdir">[out]</td><td class="paramname">ipv6_addr</td><td>A <code><a class="el" href="struct_p_p___net_address___i_pv6.html" title="All members are expressed in network byte order.">PP_NetAddress_IPv6</a></code> structure to store the result.</td></tr>
107 <dl class="return"><dt><b>Returns:</b></dt><dd>A <code>PP_Bool</code> value indicating whether the operation succeeded. </dd></dl>
110 <a class="anchor" id="a7552e536b89cc3aa4415f41a5c7ee7ee"></a><!-- doxytag: member="PPB_NetAddress::DescribeAsString" ref="a7552e536b89cc3aa4415f41a5c7ee7ee" args=")(PP_Resource addr, PP_Bool include_port)" -->
111 <div class="memitem">
112 <div class="memproto">
113 <table class="memname">
115 <td class="memname">struct <a class="el" href="struct_p_p___var.html">PP_Var</a>(* <a class="el" href="struct_p_p_b___net_address__1__0.html#a7552e536b89cc3aa4415f41a5c7ee7ee">PPB_NetAddress::DescribeAsString</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr, <a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a> include_port)<code> [read]</code></td>
120 <p>Returns a human-readable description of the network address. </p>
121 <p>The description is in the form of host [ ":" port ] and conforms to <a href="http://tools.ietf.org/html/rfc3986#section-3.2">http://tools.ietf.org/html/rfc3986#section-3.2</a> for IPv4 and IPv6 addresses (e.g., "192.168.0.1", "192.168.0.1:99", or "[::1]:80").</p>
122 <dl class="params"><dt><b>Parameters:</b></dt><dd>
123 <table class="params">
124 <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>A <code>PP_Resource</code> corresponding to a network address. </td></tr>
125 <tr><td class="paramdir">[in]</td><td class="paramname">include_port</td><td>Whether to include the port number in the description.</td></tr>
129 <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; 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> on failure. </dd></dl>
132 <a class="anchor" id="a139a1f09d00f0dcfce2eaad70af24124"></a><!-- doxytag: member="PPB_NetAddress::GetFamily" ref="a139a1f09d00f0dcfce2eaad70af24124" args=")(PP_Resource addr)" -->
133 <div class="memitem">
134 <div class="memproto">
135 <table class="memname">
137 <td class="memname"><a class="el" href="group___enums.html#ga43636bcadf9aa312a4c345d210ae6c55">PP_NetAddress_Family</a>(* <a class="el" href="struct_p_p_b___net_address__1__0.html#a139a1f09d00f0dcfce2eaad70af24124">PPB_NetAddress::GetFamily</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> addr)</td>
142 <p>Gets the address family. </p>
143 <dl class="params"><dt><b>Parameters:</b></dt><dd>
144 <table class="params">
145 <tr><td class="paramdir">[in]</td><td class="paramname">addr</td><td>A <code>PP_Resource</code> corresponding to a network address.</td></tr>
149 <dl class="return"><dt><b>Returns:</b></dt><dd>The address family on success; <code>PP_NETADDRESS_FAMILY_UNSPECIFIED</code> on failure. </dd></dl>
152 <a class="anchor" id="a13f63cdfe4ee93b2539f73ec23739422"></a><!-- doxytag: member="PPB_NetAddress::IsNetAddress" ref="a13f63cdfe4ee93b2539f73ec23739422" args=")(PP_Resource resource)" -->
153 <div class="memitem">
154 <div class="memproto">
155 <table class="memname">
157 <td class="memname"><a class="el" href="group___enums.html#ga4f272d99be14aacafe08dfd4ef830918">PP_Bool</a>(* <a class="el" href="struct_p_p_b___net_address__1__0.html#a13f63cdfe4ee93b2539f73ec23739422">PPB_NetAddress::IsNetAddress</a>)(<a class="el" href="group___typedefs.html#gafdc3895ee80f4750d0d95ae1b677e9b7">PP_Resource</a> resource)</td>
162 <p>Determines if a given resource is a network address. </p>
163 <dl class="params"><dt><b>Parameters:</b></dt><dd>
164 <table class="params">
165 <tr><td class="paramdir">[in]</td><td class="paramname">resource</td><td>A <code>PP_Resource</code> to check.</td></tr>
169 <dl class="return"><dt><b>Returns:</b></dt><dd><code>PP_TRUE</code> if the input is a <code>PPB_NetAddress</code> resource; <code>PP_FALSE</code> otherwise. </dd></dl>
172 <hr />The documentation for this struct was generated from the following file:<ul>
173 <li><a class="el" href="ppb__net__address_8h.html">ppb_net_address.h</a></li>
175 </div><!-- contents -->
176 {{/partials.standard_nacl_article}}