Sophie

Sophie

distrib > Mandriva > current > i586 > media > main-updates > by-pkgid > e0236b39c613e86bcee76bad717809a5 > files > 113

libapr-devel-1.4.6-0.1mdv2010.2.i586.rpm

<!-- This comment will put IE 6, 7 and 8 in quirks mode -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>Apache Portable Runtime: apr_network_io.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javaScript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body onload='searchBox.OnSelectItem(0);'>
<!-- Generated by Doxygen 1.6.3 -->
<script type="text/javascript"><!--
var searchBox = new SearchBox("searchBox", "search",false,'Search');
--></script>
<div class="navigation" id="top">
  <div class="tabs">
    <ul>
      <li><a href="index.html"><span>Main&nbsp;Page</span></a></li>
      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>
      <li class="current"><a href="files.html"><span>Files</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <img id="MSearchSelect" src="search/search.png"
             onmouseover="return searchBox.OnSearchSelectShow()"
             onmouseout="return searchBox.OnSearchSelectHide()"
             alt=""/>
        <input type="text" id="MSearchField" value="Search" accesskey="S"
             onfocus="searchBox.OnSearchFieldFocus(true)" 
             onblur="searchBox.OnSearchFieldFocus(false)" 
             onkeyup="searchBox.OnSearchFieldChange(event)"/>
        <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
        </div>
      </li>
    </ul>
  </div>
  <div class="tabs">
    <ul>
      <li><a href="files.html"><span>File&nbsp;List</span></a></li>
      <li><a href="globals.html"><span>Globals</span></a></li>
    </ul>
  </div>
<h1>apr_network_io.h</h1><a href="apr__network__io_8h.html">Go to the documentation of this file.</a><div class="fragment"><pre class="fragment"><a name="l00001"></a>00001 <span class="comment">/* Licensed to the Apache Software Foundation (ASF) under one or more</span>
<a name="l00002"></a>00002 <span class="comment"> * contributor license agreements.  See the NOTICE file distributed with</span>
<a name="l00003"></a>00003 <span class="comment"> * this work for additional information regarding copyright ownership.</span>
<a name="l00004"></a>00004 <span class="comment"> * The ASF licenses this file to You under the Apache License, Version 2.0</span>
<a name="l00005"></a>00005 <span class="comment"> * (the &quot;License&quot;); you may not use this file except in compliance with</span>
<a name="l00006"></a>00006 <span class="comment"> * the License.  You may obtain a copy of the License at</span>
<a name="l00007"></a>00007 <span class="comment"> *</span>
<a name="l00008"></a>00008 <span class="comment"> *     http://www.apache.org/licenses/LICENSE-2.0</span>
<a name="l00009"></a>00009 <span class="comment"> *</span>
<a name="l00010"></a>00010 <span class="comment"> * Unless required by applicable law or agreed to in writing, software</span>
<a name="l00011"></a>00011 <span class="comment"> * distributed under the License is distributed on an &quot;AS IS&quot; BASIS,</span>
<a name="l00012"></a>00012 <span class="comment"> * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.</span>
<a name="l00013"></a>00013 <span class="comment"> * See the License for the specific language governing permissions and</span>
<a name="l00014"></a>00014 <span class="comment"> * limitations under the License.</span>
<a name="l00015"></a>00015 <span class="comment"> */</span>
<a name="l00016"></a>00016 
<a name="l00017"></a>00017 <span class="preprocessor">#ifndef APR_NETWORK_IO_H</span>
<a name="l00018"></a>00018 <span class="preprocessor"></span><span class="preprocessor">#define APR_NETWORK_IO_H</span>
<a name="l00019"></a>00019 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00020"></a>00020 <span class="comment"> * @file apr_network_io.h</span>
<a name="l00021"></a>00021 <span class="comment"> * @brief APR Network library</span>
<a name="l00022"></a>00022 <span class="comment"> */</span>
<a name="l00023"></a>00023 
<a name="l00024"></a>00024 <span class="preprocessor">#include &quot;<a class="code" href="apr_8h.html" title="APR Platform Definitions.">apr.h</a>&quot;</span>
<a name="l00025"></a>00025 <span class="preprocessor">#include &quot;<a class="code" href="apr__pools_8h.html" title="APR memory allocation.">apr_pools.h</a>&quot;</span>
<a name="l00026"></a>00026 <span class="preprocessor">#include &quot;<a class="code" href="apr__file__io_8h.html" title="APR File I/O Handling.">apr_file_io.h</a>&quot;</span>
<a name="l00027"></a>00027 <span class="preprocessor">#include &quot;<a class="code" href="apr__errno_8h.html" title="APR Error Codes.">apr_errno.h</a>&quot;</span>
<a name="l00028"></a>00028 <span class="preprocessor">#include &quot;<a class="code" href="apr__inherit_8h.html" title="APR File Handle Inheritance Helpers.">apr_inherit.h</a>&quot;</span> 
<a name="l00029"></a>00029 
<a name="l00030"></a>00030 <span class="preprocessor">#if APR_HAVE_NETINET_IN_H</span>
<a name="l00031"></a>00031 <span class="preprocessor"></span><span class="preprocessor">#include &lt;netinet/in.h&gt;</span>
<a name="l00032"></a>00032 <span class="preprocessor">#endif</span>
<a name="l00033"></a>00033 <span class="preprocessor"></span>
<a name="l00034"></a>00034 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00035"></a>00035 <span class="preprocessor"></span><span class="keyword">extern</span> <span class="stringliteral">&quot;C&quot;</span> {
<a name="l00036"></a>00036 <span class="preprocessor">#endif </span><span class="comment">/* __cplusplus */</span>
<a name="l00037"></a>00037 <span class="comment"></span>
<a name="l00038"></a>00038 <span class="comment">/**</span>
<a name="l00039"></a>00039 <span class="comment"> * @defgroup apr_network_io Network Routines</span>
<a name="l00040"></a>00040 <span class="comment"> * @ingroup APR </span>
<a name="l00041"></a>00041 <span class="comment"> * @{</span>
<a name="l00042"></a>00042 <span class="comment"> */</span>
<a name="l00043"></a>00043 
<a name="l00044"></a>00044 <span class="preprocessor">#ifndef APR_MAX_SECS_TO_LINGER</span>
<a name="l00045"></a>00045 <span class="preprocessor"></span><span class="comment">/** Maximum seconds to linger */</span>
<a name="l00046"></a><a class="code" href="group__apr__network__io.html#ga8311c84f6946742188a6b9a45e92ea8e">00046</a> <span class="preprocessor">#define APR_MAX_SECS_TO_LINGER 30</span>
<a name="l00047"></a>00047 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00048"></a>00048 <span class="preprocessor"></span>
<a name="l00049"></a>00049 <span class="preprocessor">#ifndef APRMAXHOSTLEN</span>
<a name="l00050"></a>00050 <span class="preprocessor"></span><span class="comment">/** Maximum hostname length */</span>
<a name="l00051"></a><a class="code" href="group__apr__network__io.html#ga7f5b3882209106bb407b1d518d6ad59d">00051</a> <span class="preprocessor">#define APRMAXHOSTLEN 256</span>
<a name="l00052"></a>00052 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00053"></a>00053 <span class="preprocessor"></span>
<a name="l00054"></a>00054 <span class="preprocessor">#ifndef APR_ANYADDR</span>
<a name="l00055"></a>00055 <span class="preprocessor"></span><span class="comment">/** Default &#39;any&#39; address */</span>
<a name="l00056"></a><a class="code" href="group__apr__network__io.html#gadce1131c46b897ec63e9e4316a4631dd">00056</a> <span class="preprocessor">#define APR_ANYADDR &quot;0.0.0.0&quot;</span>
<a name="l00057"></a>00057 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00058"></a>00058 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00059"></a>00059 <span class="comment">/**</span>
<a name="l00060"></a>00060 <span class="comment"> * @defgroup apr_sockopt Socket option definitions</span>
<a name="l00061"></a>00061 <span class="comment"> * @{</span>
<a name="l00062"></a>00062 <span class="comment"> */</span>
<a name="l00063"></a><a class="code" href="group__apr__sockopt.html#ga6a807e7b78937ab74a4fcd6e99d76669">00063</a> <span class="preprocessor">#define APR_SO_LINGER        1    </span><span class="comment">/**&lt; Linger */</span>
<a name="l00064"></a><a class="code" href="group__apr__sockopt.html#ga0c54c5b98593d9ad2f8cc8836da7eae5">00064</a> <span class="preprocessor">#define APR_SO_KEEPALIVE     2    </span><span class="comment">/**&lt; Keepalive */</span>
<a name="l00065"></a><a class="code" href="group__apr__sockopt.html#ga2b30d26f69059692e97a59ec1d6db73b">00065</a> <span class="preprocessor">#define APR_SO_DEBUG         4    </span><span class="comment">/**&lt; Debug */</span>
<a name="l00066"></a><a class="code" href="group__apr__sockopt.html#gac3bf19cc28b43da9b9dc396c84914a0f">00066</a> <span class="preprocessor">#define APR_SO_NONBLOCK      8    </span><span class="comment">/**&lt; Non-blocking IO */</span>
<a name="l00067"></a><a class="code" href="group__apr__sockopt.html#ga90434074950efa1383d7c5649026a159">00067</a> <span class="preprocessor">#define APR_SO_REUSEADDR     16   </span><span class="comment">/**&lt; Reuse addresses */</span>
<a name="l00068"></a><a class="code" href="group__apr__sockopt.html#ga0e7ef8d3785eec5210ede9fd309db35f">00068</a> <span class="preprocessor">#define APR_SO_SNDBUF        64   </span><span class="comment">/**&lt; Send buffer */</span>
<a name="l00069"></a><a class="code" href="group__apr__sockopt.html#ga4ab9494893075c8db6ac26a997f41f0e">00069</a> <span class="preprocessor">#define APR_SO_RCVBUF        128  </span><span class="comment">/**&lt; Receive buffer */</span>
<a name="l00070"></a><a class="code" href="group__apr__sockopt.html#ga5fd72839e254ddec03ffb624c21fa564">00070</a> <span class="preprocessor">#define APR_SO_DISCONNECTED  256  </span><span class="comment">/**&lt; Disconnected */</span>
<a name="l00071"></a><a class="code" href="group__apr__sockopt.html#ga24db924d850dea792e92be7f8bc45cbd">00071</a> <span class="preprocessor">#define APR_TCP_NODELAY      512  </span><span class="comment">/**&lt; For SCTP sockets, this is mapped</span>
<a name="l00072"></a>00072 <span class="comment">                                   * to STCP_NODELAY internally.</span>
<a name="l00073"></a>00073 <span class="comment">                                   */</span>
<a name="l00074"></a><a class="code" href="group__apr__sockopt.html#ga7679a9e3114815eb6c31d26db707975d">00074</a> <span class="preprocessor">#define APR_TCP_NOPUSH       1024 </span><span class="comment">/**&lt; No push */</span>
<a name="l00075"></a><a class="code" href="group__apr__sockopt.html#gac9ee12e841eefaf86fabaae4a298adea">00075</a> <span class="preprocessor">#define APR_RESET_NODELAY    2048 </span><span class="comment">/**&lt; This flag is ONLY set internally</span>
<a name="l00076"></a>00076 <span class="comment">                                   * when we set APR_TCP_NOPUSH with</span>
<a name="l00077"></a>00077 <span class="comment">                                   * APR_TCP_NODELAY set to tell us that</span>
<a name="l00078"></a>00078 <span class="comment">                                   * APR_TCP_NODELAY should be turned on</span>
<a name="l00079"></a>00079 <span class="comment">                                   * again when NOPUSH is turned off</span>
<a name="l00080"></a>00080 <span class="comment">                                   */</span>
<a name="l00081"></a><a class="code" href="group__apr__sockopt.html#ga73b6c80791c5148c2a416e03a8a1ff8a">00081</a> <span class="preprocessor">#define APR_INCOMPLETE_READ 4096  </span><span class="comment">/**&lt; Set on non-blocking sockets</span>
<a name="l00082"></a>00082 <span class="comment">                                   * (timeout != 0) on which the</span>
<a name="l00083"></a>00083 <span class="comment">                                   * previous read() did not fill a buffer</span>
<a name="l00084"></a>00084 <span class="comment">                                   * completely.  the next apr_socket_recv() </span>
<a name="l00085"></a>00085 <span class="comment">                                   * will first call select()/poll() rather than</span>
<a name="l00086"></a>00086 <span class="comment">                                   * going straight into read().  (Can also</span>
<a name="l00087"></a>00087 <span class="comment">                                   * be set by an application to force a</span>
<a name="l00088"></a>00088 <span class="comment">                                   * select()/poll() call before the next</span>
<a name="l00089"></a>00089 <span class="comment">                                   * read, in cases where the app expects</span>
<a name="l00090"></a>00090 <span class="comment">                                   * that an immediate read would fail.)</span>
<a name="l00091"></a>00091 <span class="comment">                                   */</span>
<a name="l00092"></a><a class="code" href="group__apr__sockopt.html#ga0c1544983845bf747b4a2a3facfb45e9">00092</a> <span class="preprocessor">#define APR_INCOMPLETE_WRITE 8192 </span><span class="comment">/**&lt; like APR_INCOMPLETE_READ, but for write</span>
<a name="l00093"></a>00093 <span class="comment">                                   * @see APR_INCOMPLETE_READ</span>
<a name="l00094"></a>00094 <span class="comment">                                   */</span>
<a name="l00095"></a><a class="code" href="group__apr__sockopt.html#gae1126f69a19a23c484e3292b016375df">00095</a> <span class="preprocessor">#define APR_IPV6_V6ONLY     16384 </span><span class="comment">/**&lt; Don&#39;t accept IPv4 connections on an</span>
<a name="l00096"></a>00096 <span class="comment">                                   * IPv6 listening socket.</span>
<a name="l00097"></a>00097 <span class="comment">                                   */</span>
<a name="l00098"></a><a class="code" href="group__apr__sockopt.html#gaa81adac9b40a87f1d4c0c2f037e9af78">00098</a> <span class="preprocessor">#define APR_TCP_DEFER_ACCEPT 32768 </span><span class="comment">/**&lt; Delay accepting of new connections </span>
<a name="l00099"></a>00099 <span class="comment">                                    * until data is available.</span>
<a name="l00100"></a>00100 <span class="comment">                                    * @see apr_socket_accept_filter</span>
<a name="l00101"></a>00101 <span class="comment">                                    */</span>
<a name="l00102"></a>00102 <span class="comment"></span>
<a name="l00103"></a>00103 <span class="comment">/** @} */</span>
<a name="l00104"></a>00104 <span class="comment"></span>
<a name="l00105"></a>00105 <span class="comment">/** Define what type of socket shutdown should occur. */</span>
<a name="l00106"></a><a class="code" href="group__apr__network__io.html#gae2130f1fa2d0db58c5c3c9c73d9b4009">00106</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00107"></a><a class="code" href="group__apr__network__io.html#ggae2130f1fa2d0db58c5c3c9c73d9b4009a88d0661d35eea5319715d6ca69265b01">00107</a>     <a class="code" href="group__apr__network__io.html#ggae2130f1fa2d0db58c5c3c9c73d9b4009a88d0661d35eea5319715d6ca69265b01">APR_SHUTDOWN_READ</a>,          <span class="comment">/**&lt; no longer allow read request */</span>
<a name="l00108"></a><a class="code" href="group__apr__network__io.html#ggae2130f1fa2d0db58c5c3c9c73d9b4009a5e335b392088e14df65d1bd5e0db7c46">00108</a>     <a class="code" href="group__apr__network__io.html#ggae2130f1fa2d0db58c5c3c9c73d9b4009a5e335b392088e14df65d1bd5e0db7c46">APR_SHUTDOWN_WRITE</a>,         <span class="comment">/**&lt; no longer allow write requests */</span>
<a name="l00109"></a><a class="code" href="group__apr__network__io.html#ggae2130f1fa2d0db58c5c3c9c73d9b4009add172f55ff5ee7b930683a3903c99768">00109</a>     <a class="code" href="group__apr__network__io.html#ggae2130f1fa2d0db58c5c3c9c73d9b4009add172f55ff5ee7b930683a3903c99768">APR_SHUTDOWN_READWRITE</a>      <span class="comment">/**&lt; no longer allow read or write requests */</span>
<a name="l00110"></a>00110 } <a class="code" href="group__apr__network__io.html#gae2130f1fa2d0db58c5c3c9c73d9b4009">apr_shutdown_how_e</a>;
<a name="l00111"></a>00111 
<a name="l00112"></a><a class="code" href="group__apr__network__io.html#ga58aa30a94127b4a80f27fbf2e03fdfd8">00112</a> <span class="preprocessor">#define APR_IPV4_ADDR_OK  0x01  </span><span class="comment">/**&lt; @see apr_sockaddr_info_get() */</span>
<a name="l00113"></a><a class="code" href="group__apr__network__io.html#gaef1f70f9b969d25832a230f429837207">00113</a> <span class="preprocessor">#define APR_IPV6_ADDR_OK  0x02  </span><span class="comment">/**&lt; @see apr_sockaddr_info_get() */</span>
<a name="l00114"></a>00114 
<a name="l00115"></a>00115 <span class="preprocessor">#if (!APR_HAVE_IN_ADDR)</span>
<a name="l00116"></a>00116 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00117"></a>00117 <span class="comment"> * We need to make sure we always have an in_addr type, so APR will just</span>
<a name="l00118"></a>00118 <span class="comment"> * define it ourselves, if the platform doesn&#39;t provide it.</span>
<a name="l00119"></a>00119 <span class="comment"> */</span>
<a name="l00120"></a>00120 <span class="keyword">struct </span>in_addr {
<a name="l00121"></a>00121     apr_uint32_t  s_addr; <span class="comment">/**&lt; storage to hold the IP# */</span>
<a name="l00122"></a>00122 };
<a name="l00123"></a>00123 <span class="preprocessor">#endif</span>
<a name="l00124"></a>00124 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00125"></a>00125 <span class="comment">/** @def APR_INADDR_NONE</span>
<a name="l00126"></a>00126 <span class="comment"> * Not all platforms have a real INADDR_NONE.  This macro replaces</span>
<a name="l00127"></a>00127 <span class="comment"> * INADDR_NONE on all platforms.</span>
<a name="l00128"></a>00128 <span class="comment"> */</span>
<a name="l00129"></a>00129 <span class="preprocessor">#ifdef INADDR_NONE</span>
<a name="l00130"></a>00130 <span class="preprocessor"></span><span class="preprocessor">#define APR_INADDR_NONE INADDR_NONE</span>
<a name="l00131"></a>00131 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00132"></a><a class="code" href="group__apr__network__io.html#ga16eb7ee55ff87a5093f2114ea5351217">00132</a> <span class="preprocessor"></span><span class="preprocessor">#define APR_INADDR_NONE ((unsigned int) 0xffffffff)</span>
<a name="l00133"></a>00133 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00134"></a>00134 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00135"></a>00135 <span class="comment">/**</span>
<a name="l00136"></a>00136 <span class="comment"> * @def APR_INET</span>
<a name="l00137"></a>00137 <span class="comment"> * Not all platforms have these defined, so we&#39;ll define them here</span>
<a name="l00138"></a>00138 <span class="comment"> * The default values come from FreeBSD 4.1.1</span>
<a name="l00139"></a>00139 <span class="comment"> */</span>
<a name="l00140"></a><a class="code" href="group__apr__network__io.html#gaa96e8e8dbf92bc77643a4032017b3d67">00140</a> <span class="preprocessor">#define APR_INET     AF_INET</span>
<a name="l00141"></a>00141 <span class="preprocessor"></span><span class="comment">/** @def APR_UNSPEC</span>
<a name="l00142"></a>00142 <span class="comment"> * Let the system decide which address family to use</span>
<a name="l00143"></a>00143 <span class="comment"> */</span>
<a name="l00144"></a>00144 <span class="preprocessor">#ifdef AF_UNSPEC</span>
<a name="l00145"></a>00145 <span class="preprocessor"></span><span class="preprocessor">#define APR_UNSPEC   AF_UNSPEC</span>
<a name="l00146"></a>00146 <span class="preprocessor"></span><span class="preprocessor">#else</span>
<a name="l00147"></a><a class="code" href="group__apr__network__io.html#gaa7a33b17a7d0820b09ef489bd3328f85">00147</a> <span class="preprocessor"></span><span class="preprocessor">#define APR_UNSPEC   0</span>
<a name="l00148"></a>00148 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00149"></a>00149 <span class="preprocessor"></span><span class="preprocessor">#if APR_HAVE_IPV6</span>
<a name="l00150"></a>00150 <span class="preprocessor"></span><span class="comment">/** @def APR_INET6</span>
<a name="l00151"></a>00151 <span class="comment">* IPv6 Address Family. Not all platforms may have this defined.</span>
<a name="l00152"></a>00152 <span class="comment">*/</span>
<a name="l00153"></a>00153 
<a name="l00154"></a><a class="code" href="group__apr__network__io.html#gad09d9ea8995f50f35073ae0c77efb44f">00154</a> <span class="preprocessor">#define APR_INET6    AF_INET6</span>
<a name="l00155"></a>00155 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00156"></a>00156 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00157"></a>00157 <span class="comment">/**</span>
<a name="l00158"></a>00158 <span class="comment"> * @defgroup IP_Proto IP Protocol Definitions for use when creating sockets</span>
<a name="l00159"></a>00159 <span class="comment"> * @{</span>
<a name="l00160"></a>00160 <span class="comment"> */</span>
<a name="l00161"></a><a class="code" href="group___i_p___proto.html#gad231c935f9f9746ca43b46cdcf80338e">00161</a> <span class="preprocessor">#define APR_PROTO_TCP       6   </span><span class="comment">/**&lt; TCP  */</span>
<a name="l00162"></a><a class="code" href="group___i_p___proto.html#ga05acc4775ee3f3a637f97c904b8ebd7d">00162</a> <span class="preprocessor">#define APR_PROTO_UDP      17   </span><span class="comment">/**&lt; UDP  */</span>
<a name="l00163"></a><a class="code" href="group___i_p___proto.html#ga89b4fd2811d13e945e937f890b750727">00163</a> <span class="preprocessor">#define APR_PROTO_SCTP    132   </span><span class="comment">/**&lt; SCTP */</span>
<a name="l00164"></a>00164 <span class="comment">/** @} */</span>
<a name="l00165"></a>00165 <span class="comment"></span>
<a name="l00166"></a>00166 <span class="comment">/**</span>
<a name="l00167"></a>00167 <span class="comment"> * Enum used to denote either the local and remote endpoint of a</span>
<a name="l00168"></a>00168 <span class="comment"> * connection.</span>
<a name="l00169"></a>00169 <span class="comment"> */</span>
<a name="l00170"></a><a class="code" href="group__apr__network__io.html#ga1982f44f48fdf00a8bd754bc7b773edc">00170</a> <span class="keyword">typedef</span> <span class="keyword">enum</span> {
<a name="l00171"></a><a class="code" href="group__apr__network__io.html#gga1982f44f48fdf00a8bd754bc7b773edca6c23a4bf48b8f93dff08adf827382616">00171</a>     <a class="code" href="group__apr__network__io.html#gga1982f44f48fdf00a8bd754bc7b773edca6c23a4bf48b8f93dff08adf827382616">APR_LOCAL</a>,   <span class="comment">/**&lt; Socket information for local end of connection */</span>
<a name="l00172"></a><a class="code" href="group__apr__network__io.html#gga1982f44f48fdf00a8bd754bc7b773edcaeb8be70b031f06a513ac0ebcaa5bac8a">00172</a>     <a class="code" href="group__apr__network__io.html#gga1982f44f48fdf00a8bd754bc7b773edcaeb8be70b031f06a513ac0ebcaa5bac8a">APR_REMOTE</a>   <span class="comment">/**&lt; Socket information for remote end of connection */</span>
<a name="l00173"></a>00173 } <a class="code" href="group__apr__network__io.html#ga1982f44f48fdf00a8bd754bc7b773edc">apr_interface_e</a>;
<a name="l00174"></a>00174 <span class="comment"></span>
<a name="l00175"></a>00175 <span class="comment">/**</span>
<a name="l00176"></a>00176 <span class="comment"> * The specific declaration of inet_addr&#39;s ... some platforms fall back</span>
<a name="l00177"></a>00177 <span class="comment"> * inet_network (this is not good, but necessary)</span>
<a name="l00178"></a>00178 <span class="comment"> */</span>
<a name="l00179"></a>00179 
<a name="l00180"></a>00180 <span class="preprocessor">#if APR_HAVE_INET_ADDR</span>
<a name="l00181"></a><a class="code" href="group__apr__network__io.html#ga46a8b06887871cfd60a3e37385775e22">00181</a> <span class="preprocessor"></span><span class="preprocessor">#define apr_inet_addr    inet_addr</span>
<a name="l00182"></a>00182 <span class="preprocessor"></span><span class="preprocessor">#elif APR_HAVE_INET_NETWORK        </span><span class="comment">/* only DGUX, as far as I know */</span>
<a name="l00183"></a>00183 <span class="comment">/**</span>
<a name="l00184"></a>00184 <span class="comment"> * @warning</span>
<a name="l00185"></a>00185 <span class="comment"> * not generally safe... inet_network() and inet_addr() perform</span>
<a name="l00186"></a>00186 <span class="comment"> * different functions */</span>
<a name="l00187"></a>00187 <span class="preprocessor">#define apr_inet_addr    inet_network</span>
<a name="l00188"></a>00188 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00189"></a>00189 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00190"></a>00190 <span class="comment">/** A structure to represent sockets */</span>
<a name="l00191"></a><a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">00191</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a>     <a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a>;<span class="comment"></span>
<a name="l00192"></a>00192 <span class="comment">/**</span>
<a name="l00193"></a>00193 <span class="comment"> * A structure to encapsulate headers and trailers for apr_socket_sendfile</span>
<a name="l00194"></a>00194 <span class="comment"> */</span>
<a name="l00195"></a><a class="code" href="group__apr__network__io.html#ga97887d5358a9c79c241ccafab61d8ff5">00195</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__hdtr__t.html">apr_hdtr_t</a>       <a class="code" href="structapr__hdtr__t.html">apr_hdtr_t</a>;<span class="comment"></span>
<a name="l00196"></a>00196 <span class="comment">/** A structure to represent in_addr */</span>
<a name="l00197"></a><a class="code" href="group__apr__network__io.html#gad30d6c55a354a9a2e0a8747abb0c8176">00197</a> <span class="keyword">typedef</span> <span class="keyword">struct </span>in_addr          <a class="code" href="group__apr__network__io.html#gad30d6c55a354a9a2e0a8747abb0c8176">apr_in_addr_t</a>;<span class="comment"></span>
<a name="l00198"></a>00198 <span class="comment">/** A structure to represent an IP subnet */</span>
<a name="l00199"></a><a class="code" href="group__apr__network__io.html#gac86ee04eb80f938902095d1d0a67c324">00199</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="group__apr__network__io.html#gac86ee04eb80f938902095d1d0a67c324">apr_ipsubnet_t</a> <a class="code" href="group__apr__network__io.html#gac86ee04eb80f938902095d1d0a67c324">apr_ipsubnet_t</a>;
<a name="l00200"></a>00200 <span class="comment"></span>
<a name="l00201"></a>00201 <span class="comment">/** @remark use apr_uint16_t just in case some system has a short that isn&#39;t 16 bits... */</span>
<a name="l00202"></a><a class="code" href="group__apr__network__io.html#gaa670a71960f6eb4fe0d0de2a1e7aba03">00202</a> <span class="keyword">typedef</span> apr_uint16_t            <a class="code" href="group__apr__network__io.html#gaa670a71960f6eb4fe0d0de2a1e7aba03">apr_port_t</a>;
<a name="l00203"></a>00203 <span class="comment"></span>
<a name="l00204"></a>00204 <span class="comment">/** @remark It&#39;s defined here as I think it should all be platform safe...</span>
<a name="l00205"></a>00205 <span class="comment"> * @see apr_sockaddr_t</span>
<a name="l00206"></a>00206 <span class="comment"> */</span>
<a name="l00207"></a><a class="code" href="group__apr__network__io.html#ga373fb6f32d0875c5deb648b779c8a709">00207</a> <span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a>;<span class="comment"></span>
<a name="l00208"></a>00208 <span class="comment">/**</span>
<a name="l00209"></a>00209 <span class="comment"> * APRs socket address type, used to ensure protocol independence</span>
<a name="l00210"></a>00210 <span class="comment"> */</span>
<a name="l00211"></a><a class="code" href="structapr__sockaddr__t.html">00211</a> <span class="keyword">struct </span><a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> {<span class="comment"></span>
<a name="l00212"></a>00212 <span class="comment">    /** The pool to use... */</span>
<a name="l00213"></a><a class="code" href="structapr__sockaddr__t.html#a5f2d72a6a181cf2f54ba7c922aa0dfab">00213</a>     <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *<a class="code" href="structapr__sockaddr__t.html#a5f2d72a6a181cf2f54ba7c922aa0dfab">pool</a>;<span class="comment"></span>
<a name="l00214"></a>00214 <span class="comment">    /** The hostname */</span>
<a name="l00215"></a><a class="code" href="structapr__sockaddr__t.html#a8e675775b407f25674aaa938a40de9cd">00215</a>     <span class="keywordtype">char</span> *<a class="code" href="structapr__sockaddr__t.html#a8e675775b407f25674aaa938a40de9cd">hostname</a>;<span class="comment"></span>
<a name="l00216"></a>00216 <span class="comment">    /** Either a string of the port number or the service name for the port */</span>
<a name="l00217"></a><a class="code" href="structapr__sockaddr__t.html#a668335161a8347b9a34c600bff80b52f">00217</a>     <span class="keywordtype">char</span> *<a class="code" href="structapr__sockaddr__t.html#a668335161a8347b9a34c600bff80b52f">servname</a>;<span class="comment"></span>
<a name="l00218"></a>00218 <span class="comment">    /** The numeric port */</span>
<a name="l00219"></a><a class="code" href="structapr__sockaddr__t.html#a174c19138de9c208f13ed71b5892e505">00219</a>     apr_port_t <a class="code" href="structapr__sockaddr__t.html#a174c19138de9c208f13ed71b5892e505">port</a>;<span class="comment"></span>
<a name="l00220"></a>00220 <span class="comment">    /** The family */</span>
<a name="l00221"></a><a class="code" href="structapr__sockaddr__t.html#ac17f6e803928cfc29069a6e62dcb3a52">00221</a>     apr_int32_t <a class="code" href="structapr__sockaddr__t.html#ac17f6e803928cfc29069a6e62dcb3a52">family</a>;<span class="comment"></span>
<a name="l00222"></a>00222 <span class="comment">    /** How big is the sockaddr we&#39;re using? */</span>
<a name="l00223"></a><a class="code" href="structapr__sockaddr__t.html#aef1d2a482f85eeab7b6bf0a7732a087a">00223</a>     apr_socklen_t <a class="code" href="structapr__sockaddr__t.html#aef1d2a482f85eeab7b6bf0a7732a087a">salen</a>;<span class="comment"></span>
<a name="l00224"></a>00224 <span class="comment">    /** How big is the ip address structure we&#39;re using? */</span>
<a name="l00225"></a><a class="code" href="structapr__sockaddr__t.html#a81be21b2eb968b83ca36183213c99867">00225</a>     <span class="keywordtype">int</span> <a class="code" href="structapr__sockaddr__t.html#a81be21b2eb968b83ca36183213c99867">ipaddr_len</a>;<span class="comment"></span>
<a name="l00226"></a>00226 <span class="comment">    /** How big should the address buffer be?  16 for v4 or 46 for v6</span>
<a name="l00227"></a>00227 <span class="comment">     *  used in inet_ntop... */</span>
<a name="l00228"></a><a class="code" href="structapr__sockaddr__t.html#a8f7cda5562e904a1398ed5a4a6f0a9d9">00228</a>     <span class="keywordtype">int</span> <a class="code" href="structapr__sockaddr__t.html#a8f7cda5562e904a1398ed5a4a6f0a9d9">addr_str_len</a>;<span class="comment"></span>
<a name="l00229"></a>00229 <span class="comment">    /** This points to the IP address structure within the appropriate</span>
<a name="l00230"></a>00230 <span class="comment">     *  sockaddr structure.  */</span>
<a name="l00231"></a><a class="code" href="structapr__sockaddr__t.html#a6e1b71121ada4047acde36c6777b5442">00231</a>     <span class="keywordtype">void</span> *<a class="code" href="structapr__sockaddr__t.html#a6e1b71121ada4047acde36c6777b5442">ipaddr_ptr</a>;<span class="comment"></span>
<a name="l00232"></a>00232 <span class="comment">    /** If multiple addresses were found by apr_sockaddr_info_get(), this </span>
<a name="l00233"></a>00233 <span class="comment">     *  points to a representation of the next address. */</span>
<a name="l00234"></a><a class="code" href="structapr__sockaddr__t.html#a774835c6b8e3adf255b752e8b126c434">00234</a>     <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *<a class="code" href="structapr__sockaddr__t.html#a774835c6b8e3adf255b752e8b126c434">next</a>;<span class="comment"></span>
<a name="l00235"></a>00235 <span class="comment">    /** Union of either IPv4 or IPv6 sockaddr. */</span>
<a name="l00236"></a>00236     <span class="keyword">union </span>{<span class="comment"></span>
<a name="l00237"></a>00237 <span class="comment">        /** IPv4 sockaddr structure */</span>
<a name="l00238"></a><a class="code" href="structapr__sockaddr__t.html#a7d5cf0290260c3c448360fc819b28714">00238</a>         <span class="keyword">struct </span>sockaddr_in <a class="code" href="structapr__sockaddr__t.html#a7d5cf0290260c3c448360fc819b28714">sin</a>;
<a name="l00239"></a>00239 <span class="preprocessor">#if APR_HAVE_IPV6</span>
<a name="l00240"></a>00240 <span class="preprocessor"></span><span class="comment">        /** IPv6 sockaddr structure */</span>
<a name="l00241"></a><a class="code" href="structapr__sockaddr__t.html#ab3a1f900d2a1e58d337a61d99e94d3f9">00241</a>         <span class="keyword">struct </span>sockaddr_in6 <a class="code" href="structapr__sockaddr__t.html#ab3a1f900d2a1e58d337a61d99e94d3f9">sin6</a>;
<a name="l00242"></a>00242 <span class="preprocessor">#endif</span>
<a name="l00243"></a>00243 <span class="preprocessor"></span><span class="preprocessor">#if APR_HAVE_SA_STORAGE</span>
<a name="l00244"></a>00244 <span class="preprocessor"></span><span class="comment">        /** Placeholder to ensure that the size of this union is not</span>
<a name="l00245"></a>00245 <span class="comment">         * dependent on whether APR_HAVE_IPV6 is defined. */</span>
<a name="l00246"></a><a class="code" href="structapr__sockaddr__t.html#ac823daa30be02ee1589b4b67615cef5f">00246</a>         <span class="keyword">struct </span>sockaddr_storage <a class="code" href="structapr__sockaddr__t.html#ac823daa30be02ee1589b4b67615cef5f">sas</a>;
<a name="l00247"></a>00247 <span class="preprocessor">#endif</span>
<a name="l00248"></a>00248 <span class="preprocessor"></span>    } <a class="code" href="structapr__sockaddr__t.html#a3ca40eae640100e0f157e7c21b33a17d">sa</a>;
<a name="l00249"></a>00249 };
<a name="l00250"></a>00250 
<a name="l00251"></a>00251 <span class="preprocessor">#if APR_HAS_SENDFILE</span>
<a name="l00252"></a>00252 <span class="preprocessor"></span><span class="comment">/** </span>
<a name="l00253"></a>00253 <span class="comment"> * Support reusing the socket on platforms which support it (from disconnect,</span>
<a name="l00254"></a>00254 <span class="comment"> * specifically Win32.</span>
<a name="l00255"></a>00255 <span class="comment"> * @remark Optional flag passed into apr_socket_sendfile() </span>
<a name="l00256"></a>00256 <span class="comment"> */</span>
<a name="l00257"></a><a class="code" href="group__apr__network__io.html#gaca378d0e24b1588e3fdb143e4ea9090d">00257</a> <span class="preprocessor">#define APR_SENDFILE_DISCONNECT_SOCKET      1</span>
<a name="l00258"></a>00258 <span class="preprocessor"></span><span class="preprocessor">#endif</span>
<a name="l00259"></a>00259 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00260"></a>00260 <span class="comment">/** A structure to encapsulate headers and trailers for apr_socket_sendfile */</span>
<a name="l00261"></a><a class="code" href="structapr__hdtr__t.html">00261</a> <span class="keyword">struct </span><a class="code" href="structapr__hdtr__t.html">apr_hdtr_t</a> {<span class="comment"></span>
<a name="l00262"></a>00262 <span class="comment">    /** An iovec to store the headers sent before the file. */</span>
<a name="l00263"></a><a class="code" href="structapr__hdtr__t.html#afc2035a3ef314f9aa6ae3aabe7c0dc72">00263</a>     <span class="keyword">struct </span>iovec* <a class="code" href="structapr__hdtr__t.html#afc2035a3ef314f9aa6ae3aabe7c0dc72">headers</a>;<span class="comment"></span>
<a name="l00264"></a>00264 <span class="comment">    /** number of headers in the iovec */</span>
<a name="l00265"></a><a class="code" href="structapr__hdtr__t.html#a8915ade68ef06f4d23005ec0f81e9305">00265</a>     <span class="keywordtype">int</span> <a class="code" href="structapr__hdtr__t.html#a8915ade68ef06f4d23005ec0f81e9305">numheaders</a>;<span class="comment"></span>
<a name="l00266"></a>00266 <span class="comment">    /** An iovec to store the trailers sent after the file. */</span>
<a name="l00267"></a><a class="code" href="structapr__hdtr__t.html#a538387cfa0065abc2bfa6ba7393fa3ee">00267</a>     <span class="keyword">struct </span>iovec* <a class="code" href="structapr__hdtr__t.html#a538387cfa0065abc2bfa6ba7393fa3ee">trailers</a>;<span class="comment"></span>
<a name="l00268"></a>00268 <span class="comment">    /** number of trailers in the iovec */</span>
<a name="l00269"></a><a class="code" href="structapr__hdtr__t.html#a9468659de891a5672b0b84cf442e9c7b">00269</a>     <span class="keywordtype">int</span> <a class="code" href="structapr__hdtr__t.html#a9468659de891a5672b0b84cf442e9c7b">numtrailers</a>;
<a name="l00270"></a>00270 };
<a name="l00271"></a>00271 
<a name="l00272"></a>00272 <span class="comment">/* function definitions */</span>
<a name="l00273"></a>00273 <span class="comment"></span>
<a name="l00274"></a>00274 <span class="comment">/**</span>
<a name="l00275"></a>00275 <span class="comment"> * Create a socket.</span>
<a name="l00276"></a>00276 <span class="comment"> * @param new_sock The new socket that has been set up.</span>
<a name="l00277"></a>00277 <span class="comment"> * @param family The address family of the socket (e.g., APR_INET).</span>
<a name="l00278"></a>00278 <span class="comment"> * @param type The type of the socket (e.g., SOCK_STREAM).</span>
<a name="l00279"></a>00279 <span class="comment"> * @param protocol The protocol of the socket (e.g., APR_PROTO_TCP).</span>
<a name="l00280"></a>00280 <span class="comment"> * @param cont The pool for the apr_socket_t and associated storage.</span>
<a name="l00281"></a>00281 <span class="comment"> */</span>
<a name="l00282"></a>00282 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga46b81e267ef80e64510d4e83880a91bd">apr_socket_create</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> **new_sock, 
<a name="l00283"></a>00283                                             <span class="keywordtype">int</span> family, <span class="keywordtype">int</span> type,
<a name="l00284"></a>00284                                             <span class="keywordtype">int</span> protocol,
<a name="l00285"></a>00285                                             <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *cont);
<a name="l00286"></a>00286 <span class="comment"></span>
<a name="l00287"></a>00287 <span class="comment">/**</span>
<a name="l00288"></a>00288 <span class="comment"> * Shutdown either reading, writing, or both sides of a socket.</span>
<a name="l00289"></a>00289 <span class="comment"> * @param thesocket The socket to close </span>
<a name="l00290"></a>00290 <span class="comment"> * @param how How to shutdown the socket.  One of:</span>
<a name="l00291"></a>00291 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00292"></a>00292 <span class="comment"> *            APR_SHUTDOWN_READ         no longer allow read requests</span>
<a name="l00293"></a>00293 <span class="comment"> *            APR_SHUTDOWN_WRITE        no longer allow write requests</span>
<a name="l00294"></a>00294 <span class="comment"> *            APR_SHUTDOWN_READWRITE    no longer allow read or write requests </span>
<a name="l00295"></a>00295 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00296"></a>00296 <span class="comment"> * @see apr_shutdown_how_e</span>
<a name="l00297"></a>00297 <span class="comment"> * @remark This does not actually close the socket descriptor, it just</span>
<a name="l00298"></a>00298 <span class="comment"> *      controls which calls are still valid on the socket.</span>
<a name="l00299"></a>00299 <span class="comment"> */</span>
<a name="l00300"></a>00300 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gac5aea857a50c493f840c48b930abc48e">apr_socket_shutdown</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *thesocket,
<a name="l00301"></a>00301                                               <a class="code" href="group__apr__network__io.html#gae2130f1fa2d0db58c5c3c9c73d9b4009">apr_shutdown_how_e</a> how);
<a name="l00302"></a>00302 <span class="comment"></span>
<a name="l00303"></a>00303 <span class="comment">/**</span>
<a name="l00304"></a>00304 <span class="comment"> * Close a socket.</span>
<a name="l00305"></a>00305 <span class="comment"> * @param thesocket The socket to close </span>
<a name="l00306"></a>00306 <span class="comment"> */</span>
<a name="l00307"></a>00307 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga88779f243ce19a2563544aee81894e6d">apr_socket_close</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *thesocket);
<a name="l00308"></a>00308 <span class="comment"></span>
<a name="l00309"></a>00309 <span class="comment">/**</span>
<a name="l00310"></a>00310 <span class="comment"> * Bind the socket to its associated port</span>
<a name="l00311"></a>00311 <span class="comment"> * @param sock The socket to bind </span>
<a name="l00312"></a>00312 <span class="comment"> * @param sa The socket address to bind to</span>
<a name="l00313"></a>00313 <span class="comment"> * @remark This may be where we will find out if there is any other process</span>
<a name="l00314"></a>00314 <span class="comment"> *      using the selected port.</span>
<a name="l00315"></a>00315 <span class="comment"> */</span>
<a name="l00316"></a>00316 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga512882c9979c2b9cad7cbc2508516d65">apr_socket_bind</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00317"></a>00317                                           <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *sa);
<a name="l00318"></a>00318 <span class="comment"></span>
<a name="l00319"></a>00319 <span class="comment">/**</span>
<a name="l00320"></a>00320 <span class="comment"> * Listen to a bound socket for connections.</span>
<a name="l00321"></a>00321 <span class="comment"> * @param sock The socket to listen on </span>
<a name="l00322"></a>00322 <span class="comment"> * @param backlog The number of outstanding connections allowed in the sockets</span>
<a name="l00323"></a>00323 <span class="comment"> *                listen queue.  If this value is less than zero, the listen</span>
<a name="l00324"></a>00324 <span class="comment"> *                queue size is set to zero.  </span>
<a name="l00325"></a>00325 <span class="comment"> */</span>
<a name="l00326"></a>00326 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga154bcee918f6f01fe0373359dd74b0c4">apr_socket_listen</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00327"></a>00327                                             apr_int32_t backlog);
<a name="l00328"></a>00328 <span class="comment"></span>
<a name="l00329"></a>00329 <span class="comment">/**</span>
<a name="l00330"></a>00330 <span class="comment"> * Accept a new connection request</span>
<a name="l00331"></a>00331 <span class="comment"> * @param new_sock A copy of the socket that is connected to the socket that</span>
<a name="l00332"></a>00332 <span class="comment"> *                 made the connection request.  This is the socket which should</span>
<a name="l00333"></a>00333 <span class="comment"> *                 be used for all future communication.</span>
<a name="l00334"></a>00334 <span class="comment"> * @param sock The socket we are listening on.</span>
<a name="l00335"></a>00335 <span class="comment"> * @param connection_pool The pool for the new socket.</span>
<a name="l00336"></a>00336 <span class="comment"> */</span>
<a name="l00337"></a>00337 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga1d62711ca77ccc0f6413a298a47876da">apr_socket_accept</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> **new_sock, 
<a name="l00338"></a>00338                                             <a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00339"></a>00339                                             <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *connection_pool);
<a name="l00340"></a>00340 <span class="comment"></span>
<a name="l00341"></a>00341 <span class="comment">/**</span>
<a name="l00342"></a>00342 <span class="comment"> * Issue a connection request to a socket either on the same machine </span>
<a name="l00343"></a>00343 <span class="comment"> * or a different one.</span>
<a name="l00344"></a>00344 <span class="comment"> * @param sock The socket we wish to use for our side of the connection </span>
<a name="l00345"></a>00345 <span class="comment"> * @param sa The address of the machine we wish to connect to.</span>
<a name="l00346"></a>00346 <span class="comment"> */</span>
<a name="l00347"></a>00347 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga8e58bd8112ed2ce5004487918cd9275e">apr_socket_connect</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00348"></a>00348                                              <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *sa);
<a name="l00349"></a>00349 <span class="comment"></span>
<a name="l00350"></a>00350 <span class="comment">/**</span>
<a name="l00351"></a>00351 <span class="comment"> * Determine whether the receive part of the socket has been closed by</span>
<a name="l00352"></a>00352 <span class="comment"> * the peer (such that a subsequent call to apr_socket_read would</span>
<a name="l00353"></a>00353 <span class="comment"> * return APR_EOF), if the socket&#39;s receive buffer is empty.  This</span>
<a name="l00354"></a>00354 <span class="comment"> * function does not block waiting for I/O.</span>
<a name="l00355"></a>00355 <span class="comment"> *</span>
<a name="l00356"></a>00356 <span class="comment"> * @param sock The socket to check</span>
<a name="l00357"></a>00357 <span class="comment"> * @param atreadeof If APR_SUCCESS is returned, *atreadeof is set to</span>
<a name="l00358"></a>00358 <span class="comment"> *                  non-zero if a subsequent read would return APR_EOF</span>
<a name="l00359"></a>00359 <span class="comment"> * @return an error is returned if it was not possible to determine the</span>
<a name="l00360"></a>00360 <span class="comment"> *         status, in which case *atreadeof is not changed.</span>
<a name="l00361"></a>00361 <span class="comment"> */</span>
<a name="l00362"></a>00362 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gabfcb1fe4447921e5b86d395126b5d6f0">apr_socket_atreadeof</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00363"></a>00363                                                <span class="keywordtype">int</span> *atreadeof);
<a name="l00364"></a>00364 <span class="comment"></span>
<a name="l00365"></a>00365 <span class="comment">/**</span>
<a name="l00366"></a>00366 <span class="comment"> * Create apr_sockaddr_t from hostname, address family, and port.</span>
<a name="l00367"></a>00367 <span class="comment"> * @param sa The new apr_sockaddr_t.</span>
<a name="l00368"></a>00368 <span class="comment"> * @param hostname The hostname or numeric address string to resolve/parse, or</span>
<a name="l00369"></a>00369 <span class="comment"> *               NULL to build an address that corresponds to 0.0.0.0 or ::</span>
<a name="l00370"></a>00370 <span class="comment"> * @param family The address family to use, or APR_UNSPEC if the system should </span>
<a name="l00371"></a>00371 <span class="comment"> *               decide.</span>
<a name="l00372"></a>00372 <span class="comment"> * @param port The port number.</span>
<a name="l00373"></a>00373 <span class="comment"> * @param flags Special processing flags:</span>
<a name="l00374"></a>00374 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00375"></a>00375 <span class="comment"> *       APR_IPV4_ADDR_OK          first query for IPv4 addresses; only look</span>
<a name="l00376"></a>00376 <span class="comment"> *                                 for IPv6 addresses if the first query failed;</span>
<a name="l00377"></a>00377 <span class="comment"> *                                 only valid if family is APR_UNSPEC and hostname</span>
<a name="l00378"></a>00378 <span class="comment"> *                                 isn&#39;t NULL; mutually exclusive with</span>
<a name="l00379"></a>00379 <span class="comment"> *                                 APR_IPV6_ADDR_OK</span>
<a name="l00380"></a>00380 <span class="comment"> *       APR_IPV6_ADDR_OK          first query for IPv6 addresses; only look</span>
<a name="l00381"></a>00381 <span class="comment"> *                                 for IPv4 addresses if the first query failed;</span>
<a name="l00382"></a>00382 <span class="comment"> *                                 only valid if family is APR_UNSPEC and hostname</span>
<a name="l00383"></a>00383 <span class="comment"> *                                 isn&#39;t NULL and APR_HAVE_IPV6; mutually exclusive</span>
<a name="l00384"></a>00384 <span class="comment"> *                                 with APR_IPV4_ADDR_OK</span>
<a name="l00385"></a>00385 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00386"></a>00386 <span class="comment"> * @param p The pool for the apr_sockaddr_t and associated storage.</span>
<a name="l00387"></a>00387 <span class="comment"> */</span>
<a name="l00388"></a>00388 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gaa2f399ca2b60b35c0abf7630298c6c9f">apr_sockaddr_info_get</a>(<a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> **sa,
<a name="l00389"></a>00389                                           const <span class="keywordtype">char</span> *hostname,
<a name="l00390"></a>00390                                           apr_int32_t family,
<a name="l00391"></a>00391                                           apr_port_t port,
<a name="l00392"></a>00392                                           apr_int32_t flags,
<a name="l00393"></a>00393                                           <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p);
<a name="l00394"></a>00394 <span class="comment"></span>
<a name="l00395"></a>00395 <span class="comment">/**</span>
<a name="l00396"></a>00396 <span class="comment"> * Look up the host name from an apr_sockaddr_t.</span>
<a name="l00397"></a>00397 <span class="comment"> * @param hostname The hostname.</span>
<a name="l00398"></a>00398 <span class="comment"> * @param sa The apr_sockaddr_t.</span>
<a name="l00399"></a>00399 <span class="comment"> * @param flags Special processing flags.</span>
<a name="l00400"></a>00400 <span class="comment"> */</span>
<a name="l00401"></a>00401 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga7a56fd9573b942753738ec30b887c9de">apr_getnameinfo</a>(<span class="keywordtype">char</span> **hostname,
<a name="l00402"></a>00402                                           <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *sa,
<a name="l00403"></a>00403                                           apr_int32_t flags);
<a name="l00404"></a>00404 <span class="comment"></span>
<a name="l00405"></a>00405 <span class="comment">/**</span>
<a name="l00406"></a>00406 <span class="comment"> * Parse hostname/IP address with scope id and port.</span>
<a name="l00407"></a>00407 <span class="comment"> *</span>
<a name="l00408"></a>00408 <span class="comment"> * Any of the following strings are accepted:</span>
<a name="l00409"></a>00409 <span class="comment"> *   8080                  (just the port number)</span>
<a name="l00410"></a>00410 <span class="comment"> *   www.apache.org        (just the hostname)</span>
<a name="l00411"></a>00411 <span class="comment"> *   www.apache.org:8080   (hostname and port number)</span>
<a name="l00412"></a>00412 <span class="comment"> *   [fe80::1]:80          (IPv6 numeric address string only)</span>
<a name="l00413"></a>00413 <span class="comment"> *   [fe80::1%eth0]        (IPv6 numeric address string and scope id)</span>
<a name="l00414"></a>00414 <span class="comment"> *</span>
<a name="l00415"></a>00415 <span class="comment"> * Invalid strings:</span>
<a name="l00416"></a>00416 <span class="comment"> *                         (empty string)</span>
<a name="l00417"></a>00417 <span class="comment"> *   [abc]                 (not valid IPv6 numeric address string)</span>
<a name="l00418"></a>00418 <span class="comment"> *   abc:65536             (invalid port number)</span>
<a name="l00419"></a>00419 <span class="comment"> *</span>
<a name="l00420"></a>00420 <span class="comment"> * @param addr The new buffer containing just the hostname.  On output, *addr </span>
<a name="l00421"></a>00421 <span class="comment"> *             will be NULL if no hostname/IP address was specfied.</span>
<a name="l00422"></a>00422 <span class="comment"> * @param scope_id The new buffer containing just the scope id.  On output, </span>
<a name="l00423"></a>00423 <span class="comment"> *                 *scope_id will be NULL if no scope id was specified.</span>
<a name="l00424"></a>00424 <span class="comment"> * @param port The port number.  On output, *port will be 0 if no port was </span>
<a name="l00425"></a>00425 <span class="comment"> *             specified.</span>
<a name="l00426"></a>00426 <span class="comment"> *             ### FIXME: 0 is a legal port (per RFC 1700). this should</span>
<a name="l00427"></a>00427 <span class="comment"> *             ### return something besides zero if the port is missing.</span>
<a name="l00428"></a>00428 <span class="comment"> * @param str The input string to be parsed.</span>
<a name="l00429"></a>00429 <span class="comment"> * @param p The pool from which *addr and *scope_id are allocated.</span>
<a name="l00430"></a>00430 <span class="comment"> * @remark If scope id shouldn&#39;t be allowed, check for scope_id != NULL in </span>
<a name="l00431"></a>00431 <span class="comment"> *         addition to checking the return code.  If addr/hostname should be </span>
<a name="l00432"></a>00432 <span class="comment"> *         required, check for addr == NULL in addition to checking the </span>
<a name="l00433"></a>00433 <span class="comment"> *         return code.</span>
<a name="l00434"></a>00434 <span class="comment"> */</span>
<a name="l00435"></a>00435 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga90c31b2f012c6b1e2d842a96c4431de3">apr_parse_addr_port</a>(<span class="keywordtype">char</span> **addr,
<a name="l00436"></a>00436                                               <span class="keywordtype">char</span> **scope_id,
<a name="l00437"></a>00437                                               apr_port_t *port,
<a name="l00438"></a>00438                                               const <span class="keywordtype">char</span> *str,
<a name="l00439"></a>00439                                               <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p);
<a name="l00440"></a>00440 <span class="comment"></span>
<a name="l00441"></a>00441 <span class="comment">/**</span>
<a name="l00442"></a>00442 <span class="comment"> * Get name of the current machine</span>
<a name="l00443"></a>00443 <span class="comment"> * @param buf A buffer to store the hostname in.</span>
<a name="l00444"></a>00444 <span class="comment"> * @param len The maximum length of the hostname that can be stored in the</span>
<a name="l00445"></a>00445 <span class="comment"> *            buffer provided.  The suggested length is APRMAXHOSTLEN + 1.</span>
<a name="l00446"></a>00446 <span class="comment"> * @param cont The pool to use.</span>
<a name="l00447"></a>00447 <span class="comment"> * @remark If the buffer was not large enough, an error will be returned.</span>
<a name="l00448"></a>00448 <span class="comment"> */</span>
<a name="l00449"></a>00449 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga6bd3d656ba935ca428075f477b8a6f8b">apr_gethostname</a>(<span class="keywordtype">char</span> *buf, <span class="keywordtype">int</span> len, <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *cont);
<a name="l00450"></a>00450 <span class="comment"></span>
<a name="l00451"></a>00451 <span class="comment">/**</span>
<a name="l00452"></a>00452 <span class="comment"> * Return the data associated with the current socket</span>
<a name="l00453"></a>00453 <span class="comment"> * @param data The user data associated with the socket.</span>
<a name="l00454"></a>00454 <span class="comment"> * @param key The key to associate with the user data.</span>
<a name="l00455"></a>00455 <span class="comment"> * @param sock The currently open socket.</span>
<a name="l00456"></a>00456 <span class="comment"> */</span>
<a name="l00457"></a>00457 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gae76b48d0224a608b4ddb8bd00582eaa7">apr_socket_data_get</a>(<span class="keywordtype">void</span> **data, const <span class="keywordtype">char</span> *key,
<a name="l00458"></a>00458                                               <a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock);
<a name="l00459"></a>00459 <span class="comment"></span>
<a name="l00460"></a>00460 <span class="comment">/**</span>
<a name="l00461"></a>00461 <span class="comment"> * Set the data associated with the current socket.</span>
<a name="l00462"></a>00462 <span class="comment"> * @param sock The currently open socket.</span>
<a name="l00463"></a>00463 <span class="comment"> * @param data The user data to associate with the socket.</span>
<a name="l00464"></a>00464 <span class="comment"> * @param key The key to associate with the data.</span>
<a name="l00465"></a>00465 <span class="comment"> * @param cleanup The cleanup to call when the socket is destroyed.</span>
<a name="l00466"></a>00466 <span class="comment"> */</span>
<a name="l00467"></a>00467 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gafec197f3aa9a495801cdf7892ff8dcb5">apr_socket_data_set</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, <span class="keywordtype">void</span> *data,
<a name="l00468"></a>00468                                               const <span class="keywordtype">char</span> *key,
<a name="l00469"></a>00469                                               <a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> (*cleanup)(<span class="keywordtype">void</span>*));
<a name="l00470"></a>00470 <span class="comment"></span>
<a name="l00471"></a>00471 <span class="comment">/**</span>
<a name="l00472"></a>00472 <span class="comment"> * Send data over a network.</span>
<a name="l00473"></a>00473 <span class="comment"> * @param sock The socket to send the data over.</span>
<a name="l00474"></a>00474 <span class="comment"> * @param buf The buffer which contains the data to be sent. </span>
<a name="l00475"></a>00475 <span class="comment"> * @param len On entry, the number of bytes to send; on exit, the number</span>
<a name="l00476"></a>00476 <span class="comment"> *            of bytes sent.</span>
<a name="l00477"></a>00477 <span class="comment"> * @remark</span>
<a name="l00478"></a>00478 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00479"></a>00479 <span class="comment"> * This functions acts like a blocking write by default.  To change </span>
<a name="l00480"></a>00480 <span class="comment"> * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK</span>
<a name="l00481"></a>00481 <span class="comment"> * socket option.</span>
<a name="l00482"></a>00482 <span class="comment"> *</span>
<a name="l00483"></a>00483 <span class="comment"> * It is possible for both bytes to be sent and an error to be returned.</span>
<a name="l00484"></a>00484 <span class="comment"> *</span>
<a name="l00485"></a>00485 <span class="comment"> * APR_EINTR is never returned.</span>
<a name="l00486"></a>00486 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00487"></a>00487 <span class="comment"> */</span>
<a name="l00488"></a>00488 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga943268245cf59f6ff8cf1458c9a9ba8d">apr_socket_send</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, const <span class="keywordtype">char</span> *buf, 
<a name="l00489"></a>00489                                           apr_size_t *len);
<a name="l00490"></a>00490 <span class="comment"></span>
<a name="l00491"></a>00491 <span class="comment">/**</span>
<a name="l00492"></a>00492 <span class="comment"> * Send multiple packets of data over a network.</span>
<a name="l00493"></a>00493 <span class="comment"> * @param sock The socket to send the data over.</span>
<a name="l00494"></a>00494 <span class="comment"> * @param vec The array of iovec structs containing the data to send </span>
<a name="l00495"></a>00495 <span class="comment"> * @param nvec The number of iovec structs in the array</span>
<a name="l00496"></a>00496 <span class="comment"> * @param len Receives the number of bytes actually written</span>
<a name="l00497"></a>00497 <span class="comment"> * @remark</span>
<a name="l00498"></a>00498 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00499"></a>00499 <span class="comment"> * This functions acts like a blocking write by default.  To change </span>
<a name="l00500"></a>00500 <span class="comment"> * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK</span>
<a name="l00501"></a>00501 <span class="comment"> * socket option.</span>
<a name="l00502"></a>00502 <span class="comment"> * The number of bytes actually sent is stored in argument 3.</span>
<a name="l00503"></a>00503 <span class="comment"> *</span>
<a name="l00504"></a>00504 <span class="comment"> * It is possible for both bytes to be sent and an error to be returned.</span>
<a name="l00505"></a>00505 <span class="comment"> *</span>
<a name="l00506"></a>00506 <span class="comment"> * APR_EINTR is never returned.</span>
<a name="l00507"></a>00507 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00508"></a>00508 <span class="comment"> */</span>
<a name="l00509"></a>00509 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga99ece70c34a7a332daa3941de3950c64">apr_socket_sendv</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00510"></a>00510                                            const struct iovec *vec,
<a name="l00511"></a>00511                                            apr_int32_t nvec, apr_size_t *len);
<a name="l00512"></a>00512 <span class="comment"></span>
<a name="l00513"></a>00513 <span class="comment">/**</span>
<a name="l00514"></a>00514 <span class="comment"> * @param sock The socket to send from</span>
<a name="l00515"></a>00515 <span class="comment"> * @param where The apr_sockaddr_t describing where to send the data</span>
<a name="l00516"></a>00516 <span class="comment"> * @param flags The flags to use</span>
<a name="l00517"></a>00517 <span class="comment"> * @param buf  The data to send</span>
<a name="l00518"></a>00518 <span class="comment"> * @param len  The length of the data to send</span>
<a name="l00519"></a>00519 <span class="comment"> */</span>
<a name="l00520"></a>00520 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga03ae34bc5712dac2b3fdee39e5f87be3">apr_socket_sendto</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00521"></a>00521                                             <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *where,
<a name="l00522"></a>00522                                             apr_int32_t flags, const <span class="keywordtype">char</span> *buf, 
<a name="l00523"></a>00523                                             apr_size_t *len);
<a name="l00524"></a>00524 <span class="comment"></span>
<a name="l00525"></a>00525 <span class="comment">/**</span>
<a name="l00526"></a>00526 <span class="comment"> * Read data from a socket.  On success, the address of the peer from</span>
<a name="l00527"></a>00527 <span class="comment"> * which the data was sent is copied into the @a from parameter, and the</span>
<a name="l00528"></a>00528 <span class="comment"> * @a len parameter is updated to give the number of bytes written to</span>
<a name="l00529"></a>00529 <span class="comment"> * @a buf.</span>
<a name="l00530"></a>00530 <span class="comment"> *</span>
<a name="l00531"></a>00531 <span class="comment"> * @param from Updated with the address from which the data was received</span>
<a name="l00532"></a>00532 <span class="comment"> * @param sock The socket to use</span>
<a name="l00533"></a>00533 <span class="comment"> * @param flags The flags to use</span>
<a name="l00534"></a>00534 <span class="comment"> * @param buf  The buffer to use</span>
<a name="l00535"></a>00535 <span class="comment"> * @param len  The length of the available buffer</span>
<a name="l00536"></a>00536 <span class="comment"> */</span>
<a name="l00537"></a>00537 
<a name="l00538"></a>00538 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga80880312b41e86c9c266ede1a504e2ca">apr_socket_recvfrom</a>(<a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *from, 
<a name="l00539"></a>00539                                               <a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00540"></a>00540                                               apr_int32_t flags, <span class="keywordtype">char</span> *buf, 
<a name="l00541"></a>00541                                               apr_size_t *len);
<a name="l00542"></a>00542  
<a name="l00543"></a>00543 <span class="preprocessor">#if APR_HAS_SENDFILE || defined(DOXYGEN)</span>
<a name="l00544"></a>00544 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00545"></a>00545 <span class="comment">/**</span>
<a name="l00546"></a>00546 <span class="comment"> * Send a file from an open file descriptor to a socket, along with </span>
<a name="l00547"></a>00547 <span class="comment"> * optional headers and trailers</span>
<a name="l00548"></a>00548 <span class="comment"> * @param sock The socket to which we&#39;re writing</span>
<a name="l00549"></a>00549 <span class="comment"> * @param file The open file from which to read</span>
<a name="l00550"></a>00550 <span class="comment"> * @param hdtr A structure containing the headers and trailers to send</span>
<a name="l00551"></a>00551 <span class="comment"> * @param offset Offset into the file where we should begin writing</span>
<a name="l00552"></a>00552 <span class="comment"> * @param len (input)  - Number of bytes to send from the file </span>
<a name="l00553"></a>00553 <span class="comment"> *            (output) - Number of bytes actually sent, </span>
<a name="l00554"></a>00554 <span class="comment"> *                       including headers, file, and trailers</span>
<a name="l00555"></a>00555 <span class="comment"> * @param flags APR flags that are mapped to OS specific flags</span>
<a name="l00556"></a>00556 <span class="comment"> * @remark This functions acts like a blocking write by default.  To change </span>
<a name="l00557"></a>00557 <span class="comment"> *         this behavior, use apr_socket_timeout_set() or the</span>
<a name="l00558"></a>00558 <span class="comment"> *         APR_SO_NONBLOCK socket option.</span>
<a name="l00559"></a>00559 <span class="comment"> * The number of bytes actually sent is stored in the len parameter.</span>
<a name="l00560"></a>00560 <span class="comment"> * The offset parameter is passed by reference for no reason; its</span>
<a name="l00561"></a>00561 <span class="comment"> * value will never be modified by the apr_socket_sendfile() function.</span>
<a name="l00562"></a>00562 <span class="comment"> */</span>
<a name="l00563"></a>00563 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga3d93e6212c4c27f2390b0057f8f4a8be">apr_socket_sendfile</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00564"></a>00564                                               <a class="code" href="group__apr__file__io.html#gaa46e4763ac375ea3c7a43ba6f6099e22">apr_file_t</a> *file,
<a name="l00565"></a>00565                                               <a class="code" href="structapr__hdtr__t.html">apr_hdtr_t</a> *hdtr,
<a name="l00566"></a>00566                                               apr_off_t *offset,
<a name="l00567"></a>00567                                               apr_size_t *len,
<a name="l00568"></a>00568                                               apr_int32_t flags);
<a name="l00569"></a>00569 
<a name="l00570"></a>00570 <span class="preprocessor">#endif </span><span class="comment">/* APR_HAS_SENDFILE */</span>
<a name="l00571"></a>00571 <span class="comment"></span>
<a name="l00572"></a>00572 <span class="comment">/**</span>
<a name="l00573"></a>00573 <span class="comment"> * Read data from a network.</span>
<a name="l00574"></a>00574 <span class="comment"> * @param sock The socket to read the data from.</span>
<a name="l00575"></a>00575 <span class="comment"> * @param buf The buffer to store the data in. </span>
<a name="l00576"></a>00576 <span class="comment"> * @param len On entry, the number of bytes to receive; on exit, the number</span>
<a name="l00577"></a>00577 <span class="comment"> *            of bytes received.</span>
<a name="l00578"></a>00578 <span class="comment"> * @remark</span>
<a name="l00579"></a>00579 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00580"></a>00580 <span class="comment"> * This functions acts like a blocking read by default.  To change </span>
<a name="l00581"></a>00581 <span class="comment"> * this behavior, use apr_socket_timeout_set() or the APR_SO_NONBLOCK</span>
<a name="l00582"></a>00582 <span class="comment"> * socket option.</span>
<a name="l00583"></a>00583 <span class="comment"> * The number of bytes actually received is stored in argument 3.</span>
<a name="l00584"></a>00584 <span class="comment"> *</span>
<a name="l00585"></a>00585 <span class="comment"> * It is possible for both bytes to be received and an APR_EOF or</span>
<a name="l00586"></a>00586 <span class="comment"> * other error to be returned.</span>
<a name="l00587"></a>00587 <span class="comment"> *</span>
<a name="l00588"></a>00588 <span class="comment"> * APR_EINTR is never returned.</span>
<a name="l00589"></a>00589 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00590"></a>00590 <span class="comment"> */</span>
<a name="l00591"></a>00591 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gaa6ee00191f197f64b5a5409f4aff53d1">apr_socket_recv</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00592"></a>00592                                    <span class="keywordtype">char</span> *buf, apr_size_t *len);
<a name="l00593"></a>00593 <span class="comment"></span>
<a name="l00594"></a>00594 <span class="comment">/**</span>
<a name="l00595"></a>00595 <span class="comment"> * Setup socket options for the specified socket</span>
<a name="l00596"></a>00596 <span class="comment"> * @param sock The socket to set up.</span>
<a name="l00597"></a>00597 <span class="comment"> * @param opt The option we would like to configure.  One of:</span>
<a name="l00598"></a>00598 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00599"></a>00599 <span class="comment"> *            APR_SO_DEBUG      --  turn on debugging information </span>
<a name="l00600"></a>00600 <span class="comment"> *            APR_SO_KEEPALIVE  --  keep connections active</span>
<a name="l00601"></a>00601 <span class="comment"> *            APR_SO_LINGER     --  lingers on close if data is present</span>
<a name="l00602"></a>00602 <span class="comment"> *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket</span>
<a name="l00603"></a>00603 <span class="comment"> *                                  When this option is enabled, use</span>
<a name="l00604"></a>00604 <span class="comment"> *                                  the APR_STATUS_IS_EAGAIN() macro to</span>
<a name="l00605"></a>00605 <span class="comment"> *                                  see if a send or receive function</span>
<a name="l00606"></a>00606 <span class="comment"> *                                  could not transfer data without</span>
<a name="l00607"></a>00607 <span class="comment"> *                                  blocking.</span>
<a name="l00608"></a>00608 <span class="comment"> *            APR_SO_REUSEADDR  --  The rules used in validating addresses</span>
<a name="l00609"></a>00609 <span class="comment"> *                                  supplied to bind should allow reuse</span>
<a name="l00610"></a>00610 <span class="comment"> *                                  of local addresses.</span>
<a name="l00611"></a>00611 <span class="comment"> *            APR_SO_SNDBUF     --  Set the SendBufferSize</span>
<a name="l00612"></a>00612 <span class="comment"> *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize</span>
<a name="l00613"></a>00613 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00614"></a>00614 <span class="comment"> * @param on Value for the option.</span>
<a name="l00615"></a>00615 <span class="comment"> */</span>
<a name="l00616"></a>00616 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga08f5e505fa611005f56c12783269ffa9">apr_socket_opt_set</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00617"></a>00617                                              apr_int32_t opt, apr_int32_t on);
<a name="l00618"></a>00618 <span class="comment"></span>
<a name="l00619"></a>00619 <span class="comment">/**</span>
<a name="l00620"></a>00620 <span class="comment"> * Setup socket timeout for the specified socket</span>
<a name="l00621"></a>00621 <span class="comment"> * @param sock The socket to set up.</span>
<a name="l00622"></a>00622 <span class="comment"> * @param t Value for the timeout.</span>
<a name="l00623"></a>00623 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00624"></a>00624 <span class="comment"> *   t &gt; 0  -- read and write calls return APR_TIMEUP if specified time</span>
<a name="l00625"></a>00625 <span class="comment"> *             elapsess with no data read or written</span>
<a name="l00626"></a>00626 <span class="comment"> *   t == 0 -- read and write calls never block</span>
<a name="l00627"></a>00627 <span class="comment"> *   t &lt; 0  -- read and write calls block</span>
<a name="l00628"></a>00628 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00629"></a>00629 <span class="comment"> */</span>
<a name="l00630"></a>00630 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga945bdbe807ec5635d65a6fd9ddb78c29">apr_socket_timeout_set</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00631"></a>00631                                                  <a class="code" href="group__apr__time.html#gaae2129185a395cc393f76fabf4f43e47">apr_interval_time_t</a> t);
<a name="l00632"></a>00632 <span class="comment"></span>
<a name="l00633"></a>00633 <span class="comment">/**</span>
<a name="l00634"></a>00634 <span class="comment"> * Query socket options for the specified socket</span>
<a name="l00635"></a>00635 <span class="comment"> * @param sock The socket to query</span>
<a name="l00636"></a>00636 <span class="comment"> * @param opt The option we would like to query.  One of:</span>
<a name="l00637"></a>00637 <span class="comment"> * &lt;PRE&gt;</span>
<a name="l00638"></a>00638 <span class="comment"> *            APR_SO_DEBUG      --  turn on debugging information </span>
<a name="l00639"></a>00639 <span class="comment"> *            APR_SO_KEEPALIVE  --  keep connections active</span>
<a name="l00640"></a>00640 <span class="comment"> *            APR_SO_LINGER     --  lingers on close if data is present</span>
<a name="l00641"></a>00641 <span class="comment"> *            APR_SO_NONBLOCK   --  Turns blocking on/off for socket</span>
<a name="l00642"></a>00642 <span class="comment"> *            APR_SO_REUSEADDR  --  The rules used in validating addresses</span>
<a name="l00643"></a>00643 <span class="comment"> *                                  supplied to bind should allow reuse</span>
<a name="l00644"></a>00644 <span class="comment"> *                                  of local addresses.</span>
<a name="l00645"></a>00645 <span class="comment"> *            APR_SO_SNDBUF     --  Set the SendBufferSize</span>
<a name="l00646"></a>00646 <span class="comment"> *            APR_SO_RCVBUF     --  Set the ReceiveBufferSize</span>
<a name="l00647"></a>00647 <span class="comment"> *            APR_SO_DISCONNECTED -- Query the disconnected state of the socket.</span>
<a name="l00648"></a>00648 <span class="comment"> *                                  (Currently only used on Windows)</span>
<a name="l00649"></a>00649 <span class="comment"> * &lt;/PRE&gt;</span>
<a name="l00650"></a>00650 <span class="comment"> * @param on Socket option returned on the call.</span>
<a name="l00651"></a>00651 <span class="comment"> */</span>
<a name="l00652"></a>00652 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga1934c2d5943efc8ce925f376f3c2e17e">apr_socket_opt_get</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00653"></a>00653                                              apr_int32_t opt, apr_int32_t *on);
<a name="l00654"></a>00654 <span class="comment"></span>
<a name="l00655"></a>00655 <span class="comment">/**</span>
<a name="l00656"></a>00656 <span class="comment"> * Query socket timeout for the specified socket</span>
<a name="l00657"></a>00657 <span class="comment"> * @param sock The socket to query</span>
<a name="l00658"></a>00658 <span class="comment"> * @param t Socket timeout returned from the query.</span>
<a name="l00659"></a>00659 <span class="comment"> */</span>
<a name="l00660"></a>00660 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gaa32313b54afed590367c8571075d2bc1">apr_socket_timeout_get</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00661"></a>00661                                                  <a class="code" href="group__apr__time.html#gaae2129185a395cc393f76fabf4f43e47">apr_interval_time_t</a> *t);
<a name="l00662"></a>00662 <span class="comment"></span>
<a name="l00663"></a>00663 <span class="comment">/**</span>
<a name="l00664"></a>00664 <span class="comment"> * Query the specified socket if at the OOB/Urgent data mark</span>
<a name="l00665"></a>00665 <span class="comment"> * @param sock The socket to query</span>
<a name="l00666"></a>00666 <span class="comment"> * @param atmark Is set to true if socket is at the OOB/urgent mark,</span>
<a name="l00667"></a>00667 <span class="comment"> *               otherwise is set to false.</span>
<a name="l00668"></a>00668 <span class="comment"> */</span>
<a name="l00669"></a>00669 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga2389de257444870974b5ded91cf7a10c">apr_socket_atmark</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, 
<a name="l00670"></a>00670                                             <span class="keywordtype">int</span> *atmark);
<a name="l00671"></a>00671 <span class="comment"></span>
<a name="l00672"></a>00672 <span class="comment">/**</span>
<a name="l00673"></a>00673 <span class="comment"> * Return an address associated with a socket; either the address to</span>
<a name="l00674"></a>00674 <span class="comment"> * which the socket is bound locally or the the address of the peer</span>
<a name="l00675"></a>00675 <span class="comment"> * to which the socket is connected.</span>
<a name="l00676"></a>00676 <span class="comment"> * @param sa The returned apr_sockaddr_t.</span>
<a name="l00677"></a>00677 <span class="comment"> * @param which Whether to retrieve the local or remote address</span>
<a name="l00678"></a>00678 <span class="comment"> * @param sock The socket to use</span>
<a name="l00679"></a>00679 <span class="comment"> */</span>
<a name="l00680"></a>00680 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gacad56b59eafc6ad2459bf6493c992515">apr_socket_addr_get</a>(<a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> **sa,
<a name="l00681"></a>00681                                               <a class="code" href="group__apr__network__io.html#ga1982f44f48fdf00a8bd754bc7b773edc">apr_interface_e</a> which,
<a name="l00682"></a>00682                                               <a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock);
<a name="l00683"></a>00683  <span class="comment"></span>
<a name="l00684"></a>00684 <span class="comment">/**</span>
<a name="l00685"></a>00685 <span class="comment"> * Return the IP address (in numeric address string format) in</span>
<a name="l00686"></a>00686 <span class="comment"> * an APR socket address.  APR will allocate storage for the IP address </span>
<a name="l00687"></a>00687 <span class="comment"> * string from the pool of the apr_sockaddr_t.</span>
<a name="l00688"></a>00688 <span class="comment"> * @param addr The IP address.</span>
<a name="l00689"></a>00689 <span class="comment"> * @param sockaddr The socket address to reference.</span>
<a name="l00690"></a>00690 <span class="comment"> */</span>
<a name="l00691"></a>00691 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gab78fc9b9799c119f4a5517411458a660">apr_sockaddr_ip_get</a>(<span class="keywordtype">char</span> **addr, 
<a name="l00692"></a>00692                                               <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *sockaddr);
<a name="l00693"></a>00693 <span class="comment"></span>
<a name="l00694"></a>00694 <span class="comment">/**</span>
<a name="l00695"></a>00695 <span class="comment"> * Write the IP address (in numeric address string format) of the APR</span>
<a name="l00696"></a>00696 <span class="comment"> * socket address @a sockaddr into the buffer @a buf (of size @a buflen).</span>
<a name="l00697"></a>00697 <span class="comment"> * @param sockaddr The socket address to reference.</span>
<a name="l00698"></a>00698 <span class="comment"> */</span>
<a name="l00699"></a>00699 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga8c88ae154304e30d47c2696f4370dc6d">apr_sockaddr_ip_getbuf</a>(<span class="keywordtype">char</span> *buf, apr_size_t buflen,
<a name="l00700"></a>00700                                                  <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *sockaddr);
<a name="l00701"></a>00701 <span class="comment"></span>
<a name="l00702"></a>00702 <span class="comment">/**</span>
<a name="l00703"></a>00703 <span class="comment"> * See if the IP addresses in two APR socket addresses are</span>
<a name="l00704"></a>00704 <span class="comment"> * equivalent.  Appropriate logic is present for comparing</span>
<a name="l00705"></a>00705 <span class="comment"> * IPv4-mapped IPv6 addresses with IPv4 addresses.</span>
<a name="l00706"></a>00706 <span class="comment"> *</span>
<a name="l00707"></a>00707 <span class="comment"> * @param addr1 One of the APR socket addresses.</span>
<a name="l00708"></a>00708 <span class="comment"> * @param addr2 The other APR socket address.</span>
<a name="l00709"></a>00709 <span class="comment"> * @remark The return value will be non-zero if the addresses</span>
<a name="l00710"></a>00710 <span class="comment"> * are equivalent.</span>
<a name="l00711"></a>00711 <span class="comment"> */</span>
<a name="l00712"></a>00712 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">int</span>) <a class="code" href="group__apr__network__io.html#ga1bf65369305ae352f3280af2acc684f5">apr_sockaddr_equal</a>(const <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *addr1,
<a name="l00713"></a>00713                                     const <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *addr2);
<a name="l00714"></a>00714 <span class="comment"></span>
<a name="l00715"></a>00715 <span class="comment">/**</span>
<a name="l00716"></a>00716 <span class="comment">* Return the type of the socket.</span>
<a name="l00717"></a>00717 <span class="comment">* @param sock The socket to query.</span>
<a name="l00718"></a>00718 <span class="comment">* @param type The returned type (e.g., SOCK_STREAM).</span>
<a name="l00719"></a>00719 <span class="comment">*/</span>
<a name="l00720"></a>00720 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga8d23ee2db9a84af2e6408ef460613514">apr_socket_type_get</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00721"></a>00721                                               <span class="keywordtype">int</span> *type);
<a name="l00722"></a>00722  <span class="comment"></span>
<a name="l00723"></a>00723 <span class="comment">/**</span>
<a name="l00724"></a>00724 <span class="comment"> * Given an apr_sockaddr_t and a service name, set the port for the service</span>
<a name="l00725"></a>00725 <span class="comment"> * @param sockaddr The apr_sockaddr_t that will have its port set</span>
<a name="l00726"></a>00726 <span class="comment"> * @param servname The name of the service you wish to use</span>
<a name="l00727"></a>00727 <span class="comment"> */</span>
<a name="l00728"></a>00728 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gad5b504c0fe4d578e72531e3ca0263654">apr_getservbyname</a>(<a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *sockaddr, 
<a name="l00729"></a>00729                                             const <span class="keywordtype">char</span> *servname);<span class="comment"></span>
<a name="l00730"></a>00730 <span class="comment">/**</span>
<a name="l00731"></a>00731 <span class="comment"> * Build an ip-subnet representation from an IP address and optional netmask or</span>
<a name="l00732"></a>00732 <span class="comment"> * number-of-bits.</span>
<a name="l00733"></a>00733 <span class="comment"> * @param ipsub The new ip-subnet representation</span>
<a name="l00734"></a>00734 <span class="comment"> * @param ipstr The input IP address string</span>
<a name="l00735"></a>00735 <span class="comment"> * @param mask_or_numbits The input netmask or number-of-bits string, or NULL</span>
<a name="l00736"></a>00736 <span class="comment"> * @param p The pool to allocate from</span>
<a name="l00737"></a>00737 <span class="comment"> */</span>
<a name="l00738"></a>00738 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#ga34a3c7f1666427f4e381e857b9e9c298">apr_ipsubnet_create</a>(<a class="code" href="group__apr__network__io.html#gac86ee04eb80f938902095d1d0a67c324">apr_ipsubnet_t</a> **ipsub, 
<a name="l00739"></a>00739                                               const <span class="keywordtype">char</span> *ipstr, 
<a name="l00740"></a>00740                                               const <span class="keywordtype">char</span> *mask_or_numbits, 
<a name="l00741"></a>00741                                               <a class="code" href="group__apr__pools.html#gaf137f28edcf9a086cd6bc36c20d7cdfb">apr_pool_t</a> *p);
<a name="l00742"></a>00742 <span class="comment"></span>
<a name="l00743"></a>00743 <span class="comment">/**</span>
<a name="l00744"></a>00744 <span class="comment"> * Test the IP address in an apr_sockaddr_t against a pre-built ip-subnet</span>
<a name="l00745"></a>00745 <span class="comment"> * representation.</span>
<a name="l00746"></a>00746 <span class="comment"> * @param ipsub The ip-subnet representation</span>
<a name="l00747"></a>00747 <span class="comment"> * @param sa The socket address to test</span>
<a name="l00748"></a>00748 <span class="comment"> * @return non-zero if the socket address is within the subnet, 0 otherwise</span>
<a name="l00749"></a>00749 <span class="comment"> */</span>
<a name="l00750"></a>00750 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<span class="keywordtype">int</span>) <a class="code" href="group__apr__network__io.html#gab74d21b8898b7c40bf7fd07ad3eb993d">apr_ipsubnet_test</a>(<a class="code" href="group__apr__network__io.html#gac86ee04eb80f938902095d1d0a67c324">apr_ipsubnet_t</a> *ipsub, <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *sa);
<a name="l00751"></a>00751 
<a name="l00752"></a>00752 <span class="preprocessor">#if APR_HAS_SO_ACCEPTFILTER || defined(DOXYGEN)</span>
<a name="l00753"></a>00753 <span class="preprocessor"></span><span class="comment">/**</span>
<a name="l00754"></a>00754 <span class="comment"> * Set an OS level accept filter.</span>
<a name="l00755"></a>00755 <span class="comment"> * @param sock The socket to put the accept filter on.</span>
<a name="l00756"></a>00756 <span class="comment"> * @param name The accept filter</span>
<a name="l00757"></a>00757 <span class="comment"> * @param args Any extra args to the accept filter.  Passing NULL here removes</span>
<a name="l00758"></a>00758 <span class="comment"> *             the accept filter. </span>
<a name="l00759"></a>00759 <span class="comment"> */</span>
<a name="l00760"></a>00760 <a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a> <a class="code" href="group__apr__network__io.html#ga270b7c0835283fa2b85a05d295dd7ee5">apr_socket_accept_filter</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock, <span class="keywordtype">char</span> *name,
<a name="l00761"></a>00761                                       <span class="keywordtype">char</span> *args);
<a name="l00762"></a>00762 <span class="preprocessor">#endif</span>
<a name="l00763"></a>00763 <span class="preprocessor"></span><span class="comment"></span>
<a name="l00764"></a>00764 <span class="comment">/**</span>
<a name="l00765"></a>00765 <span class="comment"> * Return the protocol of the socket.</span>
<a name="l00766"></a>00766 <span class="comment"> * @param sock The socket to query.</span>
<a name="l00767"></a>00767 <span class="comment"> * @param protocol The returned protocol (e.g., APR_PROTO_TCP).</span>
<a name="l00768"></a>00768 <span class="comment"> */</span>
<a name="l00769"></a>00769 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__network__io.html#gac402d9426de37b6cede18fa157020bd9">apr_socket_protocol_get</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00770"></a>00770                                                   <span class="keywordtype">int</span> *protocol);
<a name="l00771"></a>00771 <span class="comment"></span>
<a name="l00772"></a>00772 <span class="comment">/**</span>
<a name="l00773"></a>00773 <span class="comment"> * Get the pool used by the socket.</span>
<a name="l00774"></a>00774 <span class="comment"> */</span>
<a name="l00775"></a>00775 <a class="code" href="group__apr__pools.html#ga89ce1d55c7f0c39ea87c88eabd655394">APR_POOL_DECLARE_ACCESSOR</a>(socket);
<a name="l00776"></a>00776 <span class="comment"></span>
<a name="l00777"></a>00777 <span class="comment">/**</span>
<a name="l00778"></a>00778 <span class="comment"> * Set a socket to be inherited by child processes.</span>
<a name="l00779"></a>00779 <span class="comment"> */</span>
<a name="l00780"></a>00780 <a class="code" href="apr__inherit_8h.html#aa67d345784df8cce8114086e1f67cf3d">APR_DECLARE_INHERIT_SET</a>(socket);
<a name="l00781"></a>00781 <span class="comment"></span>
<a name="l00782"></a>00782 <span class="comment">/**</span>
<a name="l00783"></a>00783 <span class="comment"> * Unset a socket from being inherited by child processes.</span>
<a name="l00784"></a>00784 <span class="comment"> */</span>
<a name="l00785"></a>00785 <a class="code" href="apr__inherit_8h.html#ad4886be514d6cead6bd119a48984d4b5">APR_DECLARE_INHERIT_UNSET</a>(socket);
<a name="l00786"></a>00786 <span class="comment"></span>
<a name="l00787"></a>00787 <span class="comment">/**</span>
<a name="l00788"></a>00788 <span class="comment"> * @defgroup apr_mcast IP Multicast</span>
<a name="l00789"></a>00789 <span class="comment"> * @{</span>
<a name="l00790"></a>00790 <span class="comment"> */</span>
<a name="l00791"></a>00791 <span class="comment"></span>
<a name="l00792"></a>00792 <span class="comment">/**</span>
<a name="l00793"></a>00793 <span class="comment"> * Join a Multicast Group</span>
<a name="l00794"></a>00794 <span class="comment"> * @param sock The socket to join a multicast group</span>
<a name="l00795"></a>00795 <span class="comment"> * @param join The address of the multicast group to join</span>
<a name="l00796"></a>00796 <span class="comment"> * @param iface Address of the interface to use.  If NULL is passed, the </span>
<a name="l00797"></a>00797 <span class="comment"> *              default multicast interface will be used. (OS Dependent)</span>
<a name="l00798"></a>00798 <span class="comment"> * @param source Source Address to accept transmissions from (non-NULL </span>
<a name="l00799"></a>00799 <span class="comment"> *               implies Source-Specific Multicast)</span>
<a name="l00800"></a>00800 <span class="comment"> */</span>
<a name="l00801"></a>00801 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__mcast.html#ga731894962f9b20b2ee3ccd057053ef71">apr_mcast_join</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00802"></a>00802                                          <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *join,
<a name="l00803"></a>00803                                          <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *iface,
<a name="l00804"></a>00804                                          <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *source);
<a name="l00805"></a>00805 <span class="comment"></span>
<a name="l00806"></a>00806 <span class="comment">/**</span>
<a name="l00807"></a>00807 <span class="comment"> * Leave a Multicast Group.  All arguments must be the same as</span>
<a name="l00808"></a>00808 <span class="comment"> * apr_mcast_join.</span>
<a name="l00809"></a>00809 <span class="comment"> * @param sock The socket to leave a multicast group</span>
<a name="l00810"></a>00810 <span class="comment"> * @param addr The address of the multicast group to leave</span>
<a name="l00811"></a>00811 <span class="comment"> * @param iface Address of the interface to use.  If NULL is passed, the </span>
<a name="l00812"></a>00812 <span class="comment"> *              default multicast interface will be used. (OS Dependent)</span>
<a name="l00813"></a>00813 <span class="comment"> * @param source Source Address to accept transmissions from (non-NULL </span>
<a name="l00814"></a>00814 <span class="comment"> *               implies Source-Specific Multicast)</span>
<a name="l00815"></a>00815 <span class="comment"> */</span>
<a name="l00816"></a>00816 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__mcast.html#gadd3d59b5f628786093277b962c863d13">apr_mcast_leave</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00817"></a>00817                                           <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *addr,
<a name="l00818"></a>00818                                           <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *iface,
<a name="l00819"></a>00819                                           <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *source);
<a name="l00820"></a>00820 <span class="comment"></span>
<a name="l00821"></a>00821 <span class="comment">/**</span>
<a name="l00822"></a>00822 <span class="comment"> * Set the Multicast Time to Live (ttl) for a multicast transmission.</span>
<a name="l00823"></a>00823 <span class="comment"> * @param sock The socket to set the multicast ttl</span>
<a name="l00824"></a>00824 <span class="comment"> * @param ttl Time to live to Assign. 0-255, default=1</span>
<a name="l00825"></a>00825 <span class="comment"> * @remark If the TTL is 0, packets will only be seen by sockets on </span>
<a name="l00826"></a>00826 <span class="comment"> * the local machine, and only when multicast loopback is enabled.</span>
<a name="l00827"></a>00827 <span class="comment"> */</span>
<a name="l00828"></a>00828 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__mcast.html#ga373041d43cb0fd05b2974b9fef0ae30f">apr_mcast_hops</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00829"></a>00829                                          apr_byte_t ttl);
<a name="l00830"></a>00830 <span class="comment"></span>
<a name="l00831"></a>00831 <span class="comment">/**</span>
<a name="l00832"></a>00832 <span class="comment"> * Toggle IP Multicast Loopback</span>
<a name="l00833"></a>00833 <span class="comment"> * @param sock The socket to set multicast loopback</span>
<a name="l00834"></a>00834 <span class="comment"> * @param opt 0=disable, 1=enable</span>
<a name="l00835"></a>00835 <span class="comment"> */</span>
<a name="l00836"></a>00836 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__mcast.html#ga84bc14970499f79de8b71d77898f68ee">apr_mcast_loopback</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00837"></a>00837                                              apr_byte_t opt);
<a name="l00838"></a>00838 
<a name="l00839"></a>00839 <span class="comment"></span>
<a name="l00840"></a>00840 <span class="comment">/**</span>
<a name="l00841"></a>00841 <span class="comment"> * Set the Interface to be used for outgoing Multicast Transmissions.</span>
<a name="l00842"></a>00842 <span class="comment"> * @param sock The socket to set the multicast interface on</span>
<a name="l00843"></a>00843 <span class="comment"> * @param iface Address of the interface to use for Multicast</span>
<a name="l00844"></a>00844 <span class="comment"> */</span>
<a name="l00845"></a>00845 <a class="code" href="group__apr__platform.html#gad7b91b811a172bfa802603c2fb688f98">APR_DECLARE</a>(<a class="code" href="group__apr__errno.html#gaf76ee4543247e9fb3f3546203e590a6c">apr_status_t</a>) <a class="code" href="group__apr__mcast.html#ga9949eb40d8bfb670f9bce997cebcdcae">apr_mcast_interface</a>(<a class="code" href="group__apr__network__io.html#ga49262b223e7434746e1f1737659aa2c3">apr_socket_t</a> *sock,
<a name="l00846"></a>00846                                               <a class="code" href="structapr__sockaddr__t.html">apr_sockaddr_t</a> *iface);
<a name="l00847"></a>00847 <span class="comment"></span>
<a name="l00848"></a>00848 <span class="comment">/** @} */</span>
<a name="l00849"></a>00849 <span class="comment"></span>
<a name="l00850"></a>00850 <span class="comment">/** @} */</span>
<a name="l00851"></a>00851 
<a name="l00852"></a>00852 <span class="preprocessor">#ifdef __cplusplus</span>
<a name="l00853"></a>00853 <span class="preprocessor"></span>}
<a name="l00854"></a>00854 <span class="preprocessor">#endif</span>
<a name="l00855"></a>00855 <span class="preprocessor"></span>
<a name="l00856"></a>00856 <span class="preprocessor">#endif  </span><span class="comment">/* ! APR_NETWORK_IO_H */</span>
<a name="l00857"></a>00857 
</pre></div></div>
<!--- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&nbsp;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&nbsp;</span>Data Structures</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&nbsp;</span>Files</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&nbsp;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&nbsp;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&nbsp;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&nbsp;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&nbsp;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&nbsp;</span>Defines</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<hr class="footer"/><address style="text-align: right;"><small>Generated on Tue Feb 14 10:09:01 2012 for Apache Portable Runtime by&nbsp;
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.3 </small></address>
</body>
</html>