Sophie

Sophie

distrib > Mageia > 4 > x86_64 > by-pkgid > f800694edefe91adea2624f711a41a2d > files > 5591

php-manual-en-5.5.7-1.mga4.noarch.rpm

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>Adds a server</title>

 </head>
 <body><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.radius-acct-open.html">radius_acct_open</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.radius-auth-open.html">radius_auth_open</a></div>
 <div class="up"><a href="ref.radius.html">Radius Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div><hr /><div id="function.radius-add-server" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">radius_add_server</h1>
  <p class="verinfo">(PECL radius &gt;= 1.1.0)</p><p class="refpurpose"><span class="refname">radius_add_server</span> &mdash; <span class="dc-title">Adds a server</span></p>

 </div>

 <div class="refsect1 description" id="refsect1-function.radius-add-server-description">
  <h3 class="title">Description</h3>
  <div class="methodsynopsis dc-description">
   <span class="type">bool</span> <span class="methodname"><strong>radius_add_server</strong></span>
    ( <span class="methodparam"><span class="type">resource</span> <code class="parameter">$radius_handle</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$hostname</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$port</code></span>
   , <span class="methodparam"><span class="type">string</span> <code class="parameter">$secret</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$timeout</code></span>
   , <span class="methodparam"><span class="type">int</span> <code class="parameter">$max_tries</code></span>
   )</div>

  <p class="para rdfs-comment">
    <span class="function"><strong>radius_add_server()</strong></span> may be called multiple times, and it
   may be used together with  <span class="function"><a href="function.radius-config.html" class="function">radius_config()</a></span>. At most 10
   servers may be specified. When multiple servers are given, they are tried
   in round-robin fashion until a valid response is received, or until each
   server&#039;s <em><code class="parameter">max_tries</code></em> limit has been reached.
  </p>
 </div>


 <div class="refsect1 parameters" id="refsect1-function.radius-add-server-parameters">
  <h3 class="title">Parameters</h3>
  <p class="para">
   <dl>

    <dt>

     <span class="term"><em><code class="parameter">radius_handle</code></em></span>
     <dd>

      <p class="para">
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">hostname</code></em></span>
     <dd>

      <p class="para">
       The <em><code class="parameter">hostname</code></em> parameter specifies the server host,
       either as a fully qualified domain name or as a dotted-quad IP address
       in text form.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">port</code></em></span>
     <dd>

      <p class="para">
       The <em><code class="parameter">port</code></em> specifies the UDP port to contact on
       the server. If port is given as 0, the library looks up the
       <code class="systemitem systemitem">radius/udp</code> or
       <code class="systemitem systemitem">radacct/udp</code> service in the
       network services database, and uses the port found there.  If no entry
       is found, the library uses the standard Radius ports, 1812 for
       authentication and 1813 for accounting. 
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">secret</code></em></span>
     <dd>

      <p class="para">
       The shared secret for the server host is passed to the
       <em><code class="parameter">secret</code></em> parameter. The Radius protocol ignores
       all but the leading 128 bytes of the shared secret.
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">timeout</code></em></span>
     <dd>

      <p class="para">
       The timeout for receiving replies from the server is passed to the
       <em><code class="parameter">timeout</code></em> parameter, in units of seconds.  
      </p>
     </dd>

    </dt>

    <dt>

     <span class="term"><em><code class="parameter">max_tries</code></em></span>
     <dd>

      <p class="para">
       The maximum number of repeated requests to make before giving up is
       passed into the <em><code class="parameter">max_tries</code></em>.
      </p>
     </dd>

    </dt>

   </dl>

  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.radius-add-server-returnvalues">
  <h3 class="title">Return Values</h3>
  <p class="para">
   Returns <strong><code>TRUE</code></strong> on success or <strong><code>FALSE</code></strong> on failure.
  </p>
 </div>


 <div class="refsect1 examples" id="refsect1-function.radius-add-server-examples">
  <h3 class="title">Examples</h3>
  <p class="para">
   <div class="example" id="example-614">
    <p><strong>Example #1  <span class="function"><strong>radius_add_server()</strong></span> example</strong></p>
    <div class="example-contents">
<div class="phpcode"><code><span style="color: #000000">
<span style="color: #0000BB">&lt;?php<br /></span><span style="color: #007700">if&nbsp;(!</span><span style="color: #0000BB">radius_add_server</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'radius.example.com'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">1812</span><span style="color: #007700">,&nbsp;</span><span style="color: #DD0000">'testing123'</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">,&nbsp;</span><span style="color: #0000BB">3</span><span style="color: #007700">))&nbsp;{<br />&nbsp;&nbsp;&nbsp;&nbsp;echo&nbsp;</span><span style="color: #DD0000">'RadiusError:'&nbsp;</span><span style="color: #007700">.&nbsp;</span><span style="color: #0000BB">radius_strerror</span><span style="color: #007700">(</span><span style="color: #0000BB">$res</span><span style="color: #007700">).&nbsp;</span><span style="color: #DD0000">"\n&lt;br&gt;"</span><span style="color: #007700">;<br />&nbsp;&nbsp;&nbsp;&nbsp;exit;<br />}<br /></span><span style="color: #0000BB">?&gt;</span>
</span>
</code></div>
    </div>

   </div>
  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.radius-add-server-seealso">
  <h3 class="title">See Also</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"> <span class="function"><a href="function.radius-config.html" class="function" rel="rdfs-seeAlso">radius_config()</a> - Causes the library to read the given configuration file</span></li>
   </ul>
  </p>
 </div>

</div><hr /><div class="manualnavbar" style="text-align: center;">
 <div class="prev" style="text-align: left; float: left;"><a href="function.radius-acct-open.html">radius_acct_open</a></div>
 <div class="next" style="text-align: right; float: right;"><a href="function.radius-auth-open.html">radius_auth_open</a></div>
 <div class="up"><a href="ref.radius.html">Radius Functions</a></div>
 <div class="home"><a href="index.html">PHP Manual</a></div>
</div></body></html>